@clasing/ui 0.1.125 → 0.1.126

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),$=require("../../label-CbzkBbPT.cjs"),b=require("../../index-DoxiiusW.cjs"),I=require("../../index-C8P6Mn4U.cjs"),a=require("date-fns"),w=require("react"),T=require("react-day-picker"),f=require("../../style-CA5976Oh.cjs"),P=require("../../icon-component-LY_vGYHZ.cjs"),j=require("../../popover-B8wp2cHF.cjs"),L=I.cva("border-neutral-050 focus-visible:ring-ring-default lg:hover:bg-neutral-000 flex w-full items-center gap-2 border-[0.5px] bg-white text-base whitespace-pre-wrap focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden disabled:border-neutral-100 disabled:bg-neutral-100 disabled:text-neutral-700 lg:disabled:hover:bg-neutral-100",{variants:{size:{sm:"text-label-md h-8 rounded-sm px-2 py-1",md:"text-label-lg h-12 rounded-md px-3 py-1",lg:"text-label-xl h-16 rounded-lg px-4 py-2"},rounded:{default:"",full:"rounded-full"},state:{default:"",selected:"bg-blue-050 focus:blue-800 border-blue-800 font-semibold text-blue-800 active:border-blue-800 lg:hover:bg-blue-100",error:"border-error-main"}},defaultVariants:{size:"md",rounded:"default",state:"default"}}),B=({onChange:d,value:o,options:x})=>e.jsxRuntimeExports.jsx("select",{className:"text-md focus-visible:ring-ring-default h-fit w-fit! cursor-pointer appearance-none rounded-md border-none pr-9 pl-1 font-semibold transition-colors focus:border-0 focus:border-transparent focus:ring-0 focus:ring-transparent focus:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden",onChange:d,value:o,children:x?.map((n,m)=>{const g=n.value===o;return e.jsxRuntimeExports.jsx("option",{value:n.value,disabled:n.disabled,className:b.cn("disabled:hidden",{"bg-blue-050 font-semibold text-blue-800":g}),children:n.label},m)})}),G=({orientation:d="down",size:o=16})=>e.jsxRuntimeExports.jsx(P.IconComponent,{iconName:d==="left"?"IconChevronLeft":"IconChevronRight",stroke:"1.5",size:o}),F=w.forwardRef(({className:d,locale:o="enGB",placeholder:x,label:n,size:m="md",rounded:g="default",disabledDates:N,helperText:C,side:q="bottom",align:M="center",error:c,touched:p,startDate:i,endDate:l,calendarDropdowns:S=!0,onChange:R,minDate:k,maxDate:_,disabled:h=!1,...u},z)=>{const[t,v]=w.useState({from:i?new Date(i):void 0,to:l?new Date(l):void 0}),D=r=>{if(v(r),R){const s={from:r.from?a.format(r.from,"yyyy-MM-dd"):"",to:r.to?a.format(r.to,"yyyy-MM-dd"):""};R({target:{name:u.name,value:s}})}};w.useEffect(()=>{if(i){const r=new Date(i);isNaN(r.getTime())||v(s=>({...s,from:r}))}if(l){const r=new Date(l);isNaN(r.getTime())||v(s=>({...s,to:r}))}},[i,l]);const y=o==="enGB"?f.enGB:o==="enUS"?f.enUS:o==="fr"?f.fr:f.es;return e.jsxRuntimeExports.jsxs("div",{ref:z,className:b.cn("flex flex-col gap-3",d),...u,children:[n&&e.jsxRuntimeExports.jsx($.Label,{htmlFor:u.id,className:b.cn({"text-neutral-700":h}),children:n}),e.jsxRuntimeExports.jsxs(j.Popover,{children:[e.jsxRuntimeExports.jsx(j.PopoverTrigger,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:b.cn(L({size:m,rounded:g,state:t.from&&t.to||p&&!c?"selected":c&&p?"error":"default"}),{"text-neutral-800":!t.from&&!t.to}),disabled:h,children:[e.jsxRuntimeExports.jsx(P.IconComponent,{iconName:"IconCalendar",size:20,className:"pointer-events-none"}),t.from&&t.to?`${a.format(t.from,"PPP",{locale:y})} - ${a.format(t.to,"PPP",{locale:y})}`:x||"Select a date range",e.jsxRuntimeExports.jsx("input",{hidden:!0,onChange:()=>null,value:t.from&&t.to?`${a.format(t.from,"yyyy-MM-dd")} to ${a.format(t.to,"yyyy-MM-dd")}`:`${i||""} to ${l||""}`})]})}),e.jsxRuntimeExports.jsx(j.PopoverContent,{side:q,align:M,children:e.jsxRuntimeExports.jsx(T.DayPicker,{mode:"range",captionLayout:S?"dropdown":"label",selected:t,onSelect:D,locale:y,startMonth:k||new Date(1900,0,1),endMonth:_||new Date(2100,11,31),showOutsideDays:!0,disabled:N,className:"p-2",required:!0,classNames:{root:"w-fit text-sm text-center",weekday:"text-muted-foreground font-regular",month_grid:"border-separate",month_caption:"h-9 relative flex items-center w-full",dropdowns:"absolute w-fit items-center justify-center z-10 left-1/2 flex -translate-x-1/2 top-1/2 -translate-y-1/2",button_next:"rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",button_previous:"rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",nav:"w-full h-9 top-0 left-0 absolute flex justify-between items-center gap-2",selected:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",today:"bg-blue-050 border-[0.5px] text-blue-800 lg:hover:bg-blue-100",outside:"bg-white text-neutral-200 border-[0.5px] border-neutral-000",day_button:"text-sm h-9 w-9 whitespace-nowrap border-none focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] rounded-2xl",caption_label:"text-neutral-1000 text-base font-semibold leading-none self-center w-full",disabled:"bg-white text-neutral-200 border-[0.5px] border-neutral-000 lg:hover:bg-white!",day:"h-9 w-9 aspect-square text-sm rounded-2xl border-[0.5px] border-neutral-050 lg:hover:bg-blue-050 transition-colors p-0 whitespace-nowrap",range_end:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",range_start:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",range_middle:"bg-blue-050! border-[0.5px] border-blue-800! text-blue-800! lg:hover:bg-blue-100 transition-colors font-semibold"},components:{Dropdown:B,Chevron:({orientation:r,size:s})=>e.jsxRuntimeExports.jsx(G,{orientation:r,size:s})}})})]}),c&&p?e.jsxRuntimeExports.jsx("span",{"aria-describedby":u.id,"aria-invalid":"true",className:"text-error-main text-label-md -mt-1",children:c}):e.jsxRuntimeExports.jsx("span",{className:b.clsx("text-muted-foreground -mt-1",{"text-neutral-700":h}),"aria-describedby":u.id,children:C})]})}),E=F;E.displayName="DateRangePicker";exports.DateRangePicker=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),$=require("../../label-CbzkBbPT.cjs"),b=require("../../index-DoxiiusW.cjs"),I=require("../../index-C8P6Mn4U.cjs"),a=require("date-fns"),w=require("react"),T=require("react-day-picker"),f=require("../../style-CA5976Oh.cjs"),N=require("../../icon-component-LY_vGYHZ.cjs"),j=require("../../popover-B8wp2cHF.cjs"),L=I.cva("border-neutral-050 focus-visible:ring-ring-default lg:hover:bg-neutral-000 flex w-full items-center gap-2 border-[0.5px] bg-white text-base whitespace-pre-wrap focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden disabled:border-neutral-100 disabled:bg-neutral-100 disabled:text-neutral-700 lg:disabled:hover:bg-neutral-100",{variants:{size:{sm:"text-label-md h-8 rounded-sm px-2 py-1",md:"text-label-lg h-12 rounded-md px-3 py-1",lg:"text-label-xl h-16 rounded-lg px-4 py-2"},rounded:{default:"",full:"rounded-full"},state:{default:"",selected:"bg-blue-050 focus:blue-800 border-blue-800 font-semibold text-blue-800 active:border-blue-800 lg:hover:bg-blue-100",error:"border-error-main"}},defaultVariants:{size:"md",rounded:"default",state:"default"}}),B=({onChange:d,value:o,options:x})=>e.jsxRuntimeExports.jsx("select",{className:"text-md focus-visible:ring-ring-default h-fit w-fit! cursor-pointer appearance-none rounded-md border-none pr-9 pl-1 font-semibold transition-colors focus:border-0 focus:border-transparent focus:ring-0 focus:ring-transparent focus:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-hidden",onChange:d,value:o,children:x?.map((n,m)=>{const g=n.value===o;return e.jsxRuntimeExports.jsx("option",{value:n.value,disabled:n.disabled,className:b.cn("disabled:hidden",{"bg-blue-050 font-semibold text-blue-800":g}),children:n.label},m)})}),G=({orientation:d="down",size:o=16})=>e.jsxRuntimeExports.jsx(N.IconComponent,{iconName:d==="left"?"IconChevronLeft":"IconChevronRight",stroke:"1.5",size:o}),F=w.forwardRef(({className:d,locale:o="enGB",placeholder:x,label:n,size:m="md",rounded:g="default",disabledDates:E,helperText:C,side:q="bottom",align:M="center",error:c,touched:p,startDate:i,endDate:l,calendarDropdowns:S=!0,onChange:R,minDate:k,maxDate:_,disabled:h=!1,...u},z)=>{const[t,v]=w.useState({from:i?new Date(i):void 0,to:l?new Date(l):void 0}),D=r=>{if(v(r),R){const s={from:r.from?a.format(r.from,"yyyy-MM-dd"):"",to:r.to?a.format(r.to,"yyyy-MM-dd"):""};R({target:{name:u.name,value:s}})}};w.useEffect(()=>{if(i){const r=new Date(i);isNaN(r.getTime())||v(s=>({...s,from:r}))}if(l){const r=new Date(l);isNaN(r.getTime())||v(s=>({...s,to:r}))}},[i,l]);const y=o==="enGB"?f.enGB:o==="enUS"?f.enUS:o==="fr"?f.fr:f.es;return e.jsxRuntimeExports.jsxs("div",{ref:z,className:b.cn("flex flex-col gap-3",d),...u,children:[n&&e.jsxRuntimeExports.jsx($.Label,{htmlFor:u.id,className:b.cn({"text-neutral-700":h}),children:n}),e.jsxRuntimeExports.jsxs(j.Popover,{children:[e.jsxRuntimeExports.jsx(j.PopoverTrigger,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:b.cn(L({size:m,rounded:g,state:t.from&&t.to||p&&!c?"selected":c&&p?"error":"default"}),{"text-neutral-800":!t.from&&!t.to}),disabled:h,children:[e.jsxRuntimeExports.jsx(N.IconComponent,{iconName:"IconCalendar",size:20,className:"pointer-events-none"}),t.from&&t.to?`${a.format(t.from,"PPP",{locale:y})} - ${a.format(t.to,"PPP",{locale:y})}`:x||"Select a date range",e.jsxRuntimeExports.jsx("input",{hidden:!0,onChange:()=>null,value:t.from&&t.to?`${a.format(t.from,"yyyy-MM-dd")} to ${a.format(t.to,"yyyy-MM-dd")}`:`${i||""} to ${l||""}`})]})}),e.jsxRuntimeExports.jsx(j.PopoverContent,{className:"w-auto overflow-hidden p-0",side:q,align:M,children:e.jsxRuntimeExports.jsx(T.DayPicker,{mode:"range",captionLayout:S?"dropdown":"label",selected:t,onSelect:D,locale:y,startMonth:k||new Date(1900,0,1),endMonth:_||new Date(2100,11,31),showOutsideDays:!0,disabled:E,className:"p-2",required:!0,classNames:{root:"w-fit text-sm text-center",weekday:"text-muted-foreground font-regular",month_grid:"border-separate",month_caption:"h-9 relative flex items-center w-full",dropdowns:"absolute w-fit items-center justify-center z-10 left-1/2 flex -translate-x-1/2 top-1/2 -translate-y-1/2",button_next:"rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",button_previous:"rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",nav:"w-full h-9 top-0 left-0 absolute flex justify-between items-center gap-2",selected:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",today:"bg-blue-050 border-[0.5px] text-blue-800 lg:hover:bg-blue-100",outside:"bg-white text-neutral-200 border-[0.5px] border-neutral-000",day_button:"text-sm h-9 w-9 whitespace-nowrap border-none focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] rounded-2xl",caption_label:"text-neutral-1000 text-base font-semibold leading-none self-center w-full",disabled:"bg-white text-neutral-200 border-[0.5px] border-neutral-000 lg:hover:bg-white!",day:"h-9 w-9 aspect-square text-sm rounded-2xl border-[0.5px] border-neutral-050 lg:hover:bg-blue-050 transition-colors p-0 whitespace-nowrap",range_end:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",range_start:"bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",range_middle:"bg-blue-050! border-[0.5px] border-blue-800! text-blue-800! lg:hover:bg-blue-100 transition-colors font-semibold"},components:{Dropdown:B,Chevron:({orientation:r,size:s})=>e.jsxRuntimeExports.jsx(G,{orientation:r,size:s})}})})]}),c&&p?e.jsxRuntimeExports.jsx("span",{"aria-describedby":u.id,"aria-invalid":"true",className:"text-error-main text-label-md -mt-1",children:c}):e.jsxRuntimeExports.jsx("span",{className:b.clsx("text-muted-foreground -mt-1",{"text-neutral-700":h}),"aria-describedby":u.id,children:C})]})}),P=F;P.displayName="DateRangePicker";exports.DateRangePicker=P;
@@ -168,46 +168,54 @@ const A = $(
168
168
  ]
169
169
  }
170
170
  ) }),
171
- /* @__PURE__ */ e.jsx(O, { side: P, align: C, children: /* @__PURE__ */ e.jsx(
172
- B,
171
+ /* @__PURE__ */ e.jsx(
172
+ O,
173
173
  {
174
- mode: "range",
175
- captionLayout: M ? "dropdown" : "label",
176
- selected: t,
177
- onSelect: k,
178
- locale: v,
179
- startMonth: R || new Date(1900, 0, 1),
180
- endMonth: S || new Date(2100, 11, 31),
181
- showOutsideDays: !0,
182
- disabled: j,
183
- className: "p-2",
184
- required: !0,
185
- classNames: {
186
- root: "w-fit text-sm text-center",
187
- weekday: "text-muted-foreground font-regular",
188
- month_grid: "border-separate",
189
- month_caption: "h-9 relative flex items-center w-full",
190
- dropdowns: "absolute w-fit items-center justify-center z-10 left-1/2 flex -translate-x-1/2 top-1/2 -translate-y-1/2",
191
- button_next: "rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",
192
- button_previous: "rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",
193
- nav: "w-full h-9 top-0 left-0 absolute flex justify-between items-center gap-2",
194
- selected: "bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",
195
- today: "bg-blue-050 border-[0.5px] text-blue-800 lg:hover:bg-blue-100",
196
- outside: "bg-white text-neutral-200 border-[0.5px] border-neutral-000",
197
- day_button: "text-sm h-9 w-9 whitespace-nowrap border-none focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] rounded-2xl",
198
- caption_label: "text-neutral-1000 text-base font-semibold leading-none self-center w-full",
199
- disabled: "bg-white text-neutral-200 border-[0.5px] border-neutral-000 lg:hover:bg-white!",
200
- day: "h-9 w-9 aspect-square text-sm rounded-2xl border-[0.5px] border-neutral-050 lg:hover:bg-blue-050 transition-colors p-0 whitespace-nowrap",
201
- range_end: "bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",
202
- range_start: "bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",
203
- range_middle: "bg-blue-050! border-[0.5px] border-blue-800! text-blue-800! lg:hover:bg-blue-100 transition-colors font-semibold"
204
- },
205
- components: {
206
- Dropdown: H,
207
- Chevron: ({ orientation: o, size: l }) => /* @__PURE__ */ e.jsx(J, { orientation: o, size: l })
208
- }
174
+ className: "w-auto overflow-hidden p-0",
175
+ side: P,
176
+ align: C,
177
+ children: /* @__PURE__ */ e.jsx(
178
+ B,
179
+ {
180
+ mode: "range",
181
+ captionLayout: M ? "dropdown" : "label",
182
+ selected: t,
183
+ onSelect: k,
184
+ locale: v,
185
+ startMonth: R || new Date(1900, 0, 1),
186
+ endMonth: S || new Date(2100, 11, 31),
187
+ showOutsideDays: !0,
188
+ disabled: j,
189
+ className: "p-2",
190
+ required: !0,
191
+ classNames: {
192
+ root: "w-fit text-sm text-center",
193
+ weekday: "text-muted-foreground font-regular",
194
+ month_grid: "border-separate",
195
+ month_caption: "h-9 relative flex items-center w-full",
196
+ dropdowns: "absolute w-fit items-center justify-center z-10 left-1/2 flex -translate-x-1/2 top-1/2 -translate-y-1/2",
197
+ button_next: "rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",
198
+ button_previous: "rounded-2xl border-none lg:hover:bg-neutral-050 transition-colors z-1 p-2 disabled:opacity-50 focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] focus-visible:ring-offset-1",
199
+ nav: "w-full h-9 top-0 left-0 absolute flex justify-between items-center gap-2",
200
+ selected: "bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",
201
+ today: "bg-blue-050 border-[0.5px] text-blue-800 lg:hover:bg-blue-100",
202
+ outside: "bg-white text-neutral-200 border-[0.5px] border-neutral-000",
203
+ day_button: "text-sm h-9 w-9 whitespace-nowrap border-none focus-visible:ring-ring-default focus-visible:outline-hidden focus-visible:ring-[1.5px] rounded-2xl",
204
+ caption_label: "text-neutral-1000 text-base font-semibold leading-none self-center w-full",
205
+ disabled: "bg-white text-neutral-200 border-[0.5px] border-neutral-000 lg:hover:bg-white!",
206
+ day: "h-9 w-9 aspect-square text-sm rounded-2xl border-[0.5px] border-neutral-050 lg:hover:bg-blue-050 transition-colors p-0 whitespace-nowrap",
207
+ range_end: "bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",
208
+ range_start: "bg-blue-800 text-white border-[0.5px] border-blue-800! lg:hover:bg-blue-900 transition-colors font-semibold",
209
+ range_middle: "bg-blue-050! border-[0.5px] border-blue-800! text-blue-800! lg:hover:bg-blue-100 transition-colors font-semibold"
210
+ },
211
+ components: {
212
+ Dropdown: H,
213
+ Chevron: ({ orientation: o, size: l }) => /* @__PURE__ */ e.jsx(J, { orientation: o, size: l })
214
+ }
215
+ }
216
+ )
209
217
  }
210
- ) })
218
+ )
211
219
  ] }),
212
220
  b && x ? /* @__PURE__ */ e.jsx(
213
221
  "span",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../jsx-runtime-DUiatUiq.cjs"),c=require("@radix-ui/react-checkbox"),a=require("../index-DoxiiusW.cjs"),s=require("../icon-component-LY_vGYHZ.cjs");function d(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=d(c);function u({className:e,...t}){return n.jsxRuntimeExports.jsx(o.Root,{"data-slot":"checkbox",className:a.cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground dark:data-[state=checked]:bg-secondary data-[state=checked]:border-secondary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:n.jsxRuntimeExports.jsx(o.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:n.jsxRuntimeExports.jsx(s.IconComponent,{iconName:"IconCheck",className:"size-3.5"})})})}exports.Checkbox=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../jsx-runtime-DUiatUiq.cjs"),c=require("@radix-ui/react-checkbox"),a=require("../index-DoxiiusW.cjs"),s=require("../icon-component-LY_vGYHZ.cjs");function d(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=d(c);function u({className:e,...t}){return n.jsxRuntimeExports.jsx(o.Root,{"data-slot":"checkbox",className:a.cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground dark:data-[state=checked]:bg-secondary data-[state=checked]:border-secondary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:n.jsxRuntimeExports.jsx(o.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:n.jsxRuntimeExports.jsx(s.IconComponent,{iconName:"IconCheck",className:"size-3.5"})})})}exports.Checkbox=u;
@@ -11,7 +11,7 @@ function d({
11
11
  {
12
12
  "data-slot": "checkbox",
13
13
  className: a(
14
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground dark:data-[state=checked]:bg-secondary data-[state=checked]:border-secondary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
14
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground dark:data-[state=checked]:bg-secondary data-[state=checked]:border-secondary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
15
15
  i
16
16
  ),
17
17
  ...t,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../jsx-runtime-DUiatUiq.cjs"),M=require("../badge-Czof3oqL.cjs"),x=require("../command-D9M8dk1M.cjs"),y=require("../popover-B8wp2cHF.cjs"),R=require("../index-DoxiiusW.cjs"),r=require("react"),v=require("../icon-component-LY_vGYHZ.cjs"),I=r.createContext(null);function k({children:e,values:n,defaultValues:i,onValuesChange:u}){const[g,m]=r.useState(!1),[h,p]=r.useState(new Set(n??i)),[E,f]=r.useState(new Map);function w(c){const s=l=>{const a=new Set(l);return a.has(c)?a.delete(c):a.add(c),a};p(s),u?.([...s(h)])}const j=r.useCallback((c,s)=>{f(l=>l.get(c)===s?l:new Map(l).set(c,s))},[]);return t.jsxRuntimeExports.jsx(I,{value:{open:g,setOpen:m,selectedValues:n?new Set(n):h,toggleValue:w,items:E,onItemAdded:j},children:t.jsxRuntimeExports.jsx(y.Popover,{open:g,onOpenChange:m,children:e})})}function V({className:e,children:n,...i}){const{open:u}=b();return t.jsxRuntimeExports.jsx(y.PopoverTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsxs("button",{...i,role:i.role??"combobox","aria-expanded":i["aria-expanded"]??u,className:R.cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex h-auto min-h-9 w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent px-3 py-1.5 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),children:[n,t.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconSelector",className:"size-4 shrink-0 opacity-50"})]})})}function z({placeholder:e,clickToRemove:n=!0,className:i,overflowBehavior:u="wrap-when-open",...g}){const{selectedValues:m,toggleValue:h,items:p,open:E}=b(),[f,w]=r.useState(0),j=r.useRef(null),c=r.useRef(null),s=r.useRef(new Set),l=u==="wrap"||u==="wrap-when-open"&&E;r.useEffect(()=>{l&&s.current.forEach(o=>o.style.removeProperty("display"))},[l]);const a=r.useCallback(()=>{if(j.current==null)return;const o=j.current,d=c.current;d!=null&&(d.style.display="none"),s.current.forEach(S=>S.style.removeProperty("display"));let C=0;for(let S=s.current.size-1;S>=0;S--){const N=[...s.current][S];if(o.scrollWidth<=o.clientWidth)break;C=s.current.size-S,N.style.display="none",d?.style.removeProperty("display")}w(C)},[]);return r.useEffect(()=>{if(j.current==null)return;const o=new ResizeObserver(a);return o.observe(j.current),()=>o.disconnect()},[a]),r.useLayoutEffect(()=>{a()},[m,a]),m.size===0&&e?t.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground font-normal",children:e}):t.jsxRuntimeExports.jsxs("div",{...g,ref:j,className:R.cn("flex w-full gap-1.5 overflow-hidden",l&&"h-full flex-wrap",i),children:[[...m].filter(o=>p.has(o)).map(o=>t.jsxRuntimeExports.jsxs(M.Badge,{ref:d=>{if(d!=null)return s.current.add(d),()=>{s.current.delete(d)}},variant:"outline",className:"group flex items-center gap-1",onClick:n?d=>{d.stopPropagation(),h(o)}:void 0,children:[p.get(o),n&&t.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconX",className:"text-muted-foreground group-hover:text-destructive size-2"})]},o)),t.jsxRuntimeExports.jsxs(M.Badge,{style:{display:f>0&&!l?"block":"none"},variant:"outline",ref:c,children:["+",f]})]})}function P({search:e=!0,children:n,...i}){const u=typeof e=="object"?!0:e;return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{display:"none"},children:t.jsxRuntimeExports.jsx(x.Command,{children:t.jsxRuntimeExports.jsx(x.CommandList,{children:n})})}),t.jsxRuntimeExports.jsx(y.PopoverContent,{className:"min-w-[var(--radix-popover-trigger-width)] p-0",children:t.jsxRuntimeExports.jsxs(x.Command,{...i,children:[u?t.jsxRuntimeExports.jsx(x.CommandInput,{placeholder:typeof e=="object"?e.placeholder:void 0}):t.jsxRuntimeExports.jsx("button",{autoFocus:!0,"aria-hidden":"true",className:"sr-only"}),t.jsxRuntimeExports.jsxs(x.CommandList,{children:[u&&t.jsxRuntimeExports.jsx(x.CommandEmpty,{children:typeof e=="object"?e.emptyMessage:void 0}),n]})]})})]})}function q({value:e,children:n,badgeLabel:i,onSelect:u,...g}){const{toggleValue:m,selectedValues:h,onItemAdded:p}=b(),E=h.has(e);return r.useEffect(()=>{p(e,i??n)},[e,n,p,i]),t.jsxRuntimeExports.jsxs(x.CommandItem,{...g,value:e,onSelect:f=>{m(f),u?.(f)},children:[t.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconCheck",className:R.cn("mr-2 size-4",E?"opacity-100":"opacity-0")}),n]})}function O(e){return t.jsxRuntimeExports.jsx(x.CommandGroup,{...e})}function A(e){return t.jsxRuntimeExports.jsx(x.CommandSeparator,{...e})}function b(){const e=r.useContext(I);if(e==null)throw new Error("useMultiSelectContext must be used within a MultiSelectContext");return e}exports.MultiSelect=k;exports.MultiSelectContent=P;exports.MultiSelectGroup=O;exports.MultiSelectItem=q;exports.MultiSelectSeparator=A;exports.MultiSelectTrigger=V;exports.MultiSelectValue=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../jsx-runtime-DUiatUiq.cjs"),M=require("../badge-Czof3oqL.cjs"),x=require("../command-D9M8dk1M.cjs"),b=require("../popover-B8wp2cHF.cjs"),w=require("../index-DoxiiusW.cjs"),s=require("react"),R=require("../icon-component-LY_vGYHZ.cjs"),I=s.createContext(null);function k({children:e,values:n,defaultValues:r,onValuesChange:o}){const[m,p]=s.useState(!1),[h,f]=s.useState(new Set(n??r)),[y,j]=s.useState(new Map);function E(c){const i=l=>{const a=new Set(l);return a.has(c)?a.delete(c):a.add(c),a};f(i),o?.([...i(h)])}const g=s.useCallback((c,i)=>{j(l=>l.get(c)===i?l:new Map(l).set(c,i))},[]);return t.jsxRuntimeExports.jsx(I,{value:{open:m,setOpen:p,selectedValues:n?new Set(n):h,toggleValue:E,items:y,onItemAdded:g},children:t.jsxRuntimeExports.jsx(b.Popover,{open:m,onOpenChange:p,children:e})})}function V({className:e,children:n,size:r="md",...o}){const{open:m}=v();return t.jsxRuntimeExports.jsx(b.PopoverTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsxs("button",{...o,role:o.role??"combobox","aria-expanded":o["aria-expanded"]??m,"data-size":r,className:w.cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r==="xs"&&'text-label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',r==="sm"&&"text-label-md h-8 px-2 py-1",r==="md"&&"text-label-lg h-12 px-3 py-1",r==="lg"&&"text-label-xl h-16 px-4 py-2",e),children:[n,t.jsxRuntimeExports.jsx(R.IconComponent,{iconName:"IconSelector",className:"size-4 shrink-0 opacity-50"})]})})}function z({placeholder:e,clickToRemove:n=!0,className:r,overflowBehavior:o="wrap-when-open",...m}){const{selectedValues:p,toggleValue:h,items:f,open:y}=v(),[j,E]=s.useState(0),g=s.useRef(null),c=s.useRef(null),i=s.useRef(new Set),l=o==="wrap"||o==="wrap-when-open"&&y;s.useEffect(()=>{l&&i.current.forEach(u=>u.style.removeProperty("display"))},[l]);const a=s.useCallback(()=>{if(g.current==null)return;const u=g.current,d=c.current;d!=null&&(d.style.display="none"),i.current.forEach(S=>S.style.removeProperty("display"));let C=0;for(let S=i.current.size-1;S>=0;S--){const N=[...i.current][S];if(u.scrollWidth<=u.clientWidth)break;C=i.current.size-S,N.style.display="none",d?.style.removeProperty("display")}E(C)},[]);return s.useEffect(()=>{if(g.current==null)return;const u=new ResizeObserver(a);return u.observe(g.current),()=>u.disconnect()},[a]),s.useLayoutEffect(()=>{a()},[p,a]),p.size===0&&e?t.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground font-normal",children:e}):t.jsxRuntimeExports.jsxs("div",{...m,ref:g,className:w.cn("flex w-full gap-1.5 overflow-hidden min-h-[1.75rem]",l&&"flex-wrap",r),children:[[...p].filter(u=>f.has(u)).map(u=>t.jsxRuntimeExports.jsxs(M.Badge,{ref:d=>{if(d!=null)return i.current.add(d),()=>{i.current.delete(d)}},variant:"outline",className:"group flex items-center gap-1",onClick:n?d=>{d.stopPropagation(),h(u)}:void 0,children:[f.get(u),n&&t.jsxRuntimeExports.jsx(R.IconComponent,{iconName:"IconX",className:"text-muted-foreground group-hover:text-destructive size-2"})]},u)),t.jsxRuntimeExports.jsxs(M.Badge,{style:{display:j>0&&!l?"block":"none"},variant:"outline",ref:c,children:["+",j]})]})}function P({search:e=!0,children:n,...r}){const o=typeof e=="object"?!0:e;return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{display:"none"},children:t.jsxRuntimeExports.jsx(x.Command,{children:t.jsxRuntimeExports.jsx(x.CommandList,{children:n})})}),t.jsxRuntimeExports.jsx(b.PopoverContent,{className:"min-w-[var(--radix-popover-trigger-width)] p-0",children:t.jsxRuntimeExports.jsxs(x.Command,{...r,children:[o?t.jsxRuntimeExports.jsx(x.CommandInput,{placeholder:typeof e=="object"?e.placeholder:void 0}):t.jsxRuntimeExports.jsx("button",{autoFocus:!0,"aria-hidden":"true",className:"sr-only"}),t.jsxRuntimeExports.jsxs(x.CommandList,{children:[o&&t.jsxRuntimeExports.jsx(x.CommandEmpty,{children:typeof e=="object"?e.emptyMessage:void 0}),n]})]})})]})}function q({value:e,children:n,badgeLabel:r,onSelect:o,...m}){const{toggleValue:p,selectedValues:h,onItemAdded:f}=v(),y=h.has(e);return s.useEffect(()=>{f(e,r??n)},[e,n,f,r]),t.jsxRuntimeExports.jsxs(x.CommandItem,{...m,value:e,onSelect:j=>{p(j),o?.(j)},children:[t.jsxRuntimeExports.jsx(R.IconComponent,{iconName:"IconCheck",className:w.cn("mr-2 size-4",y?"opacity-100":"opacity-0")}),n]})}function O(e){return t.jsxRuntimeExports.jsx(x.CommandGroup,{...e})}function _(e){return t.jsxRuntimeExports.jsx(x.CommandSeparator,{...e})}function v(){const e=s.useContext(I);if(e==null)throw new Error("useMultiSelectContext must be used within a MultiSelectContext");return e}exports.MultiSelect=k;exports.MultiSelectContent=P;exports.MultiSelectGroup=O;exports.MultiSelectItem=q;exports.MultiSelectSeparator=_;exports.MultiSelectTrigger=V;exports.MultiSelectValue=z;
@@ -7,9 +7,10 @@ declare function MultiSelect({ children, values, defaultValues, onValuesChange,
7
7
  defaultValues?: string[];
8
8
  onValuesChange?: (values: string[]) => void;
9
9
  }): import("react/jsx-runtime").JSX.Element;
10
- declare function MultiSelectTrigger({ className, children, ...props }: {
10
+ declare function MultiSelectTrigger({ className, children, size, ...props }: {
11
11
  className?: string;
12
12
  children?: ReactNode;
13
+ size?: 'xs' | 'sm' | 'md' | 'lg';
13
14
  } & ComponentPropsWithoutRef<typeof Button>): import("react/jsx-runtime").JSX.Element;
14
15
  declare function MultiSelectValue({ placeholder, clickToRemove, className, overflowBehavior, ...props }: {
15
16
  placeholder?: string;
@@ -1,59 +1,65 @@
1
1
  import { j as t } from "../jsx-runtime-C5mzlN2N.js";
2
2
  import { B as I } from "../badge-BnerQ2lF.js";
3
- import { C as k, f as z, d as O, b as R, c as A, e as _, g as W } from "../command-BGCSJ9vX.js";
3
+ import { C as k, f as E, d as O, b as R, c as _, e as A, g as W } from "../command-BGCSJ9vX.js";
4
4
  import { P as F, b as G, c as B } from "../popover-BoDRCUh2.js";
5
5
  import { c as S } from "../index-CRiPKpXj.js";
6
- import { createContext as L, useState as j, useCallback as E, useEffect as b, useRef as v, useLayoutEffect as T, useContext as X } from "react";
6
+ import { createContext as L, useState as y, useCallback as V, useEffect as v, useRef as j, useLayoutEffect as T, useContext as X } from "react";
7
7
  import { I as C } from "../icon-component-BZ-4FDV6.js";
8
- const V = L(null);
8
+ const z = L(null);
9
9
  function Y({
10
10
  children: e,
11
11
  values: n,
12
- defaultValues: s,
13
- onValuesChange: i
12
+ defaultValues: r,
13
+ onValuesChange: o
14
14
  }) {
15
- const [x, d] = j(!1), [g, m] = j(
16
- new Set(n ?? s)
17
- ), [w, p] = j(/* @__PURE__ */ new Map());
18
- function y(c) {
19
- const r = (l) => {
20
- const a = new Set(l);
21
- return a.has(c) ? a.delete(c) : a.add(c), a;
15
+ const [d, m] = y(!1), [g, p] = y(
16
+ new Set(n ?? r)
17
+ ), [w, f] = y(/* @__PURE__ */ new Map());
18
+ function b(a) {
19
+ const s = (l) => {
20
+ const c = new Set(l);
21
+ return c.has(a) ? c.delete(a) : c.add(a), c;
22
22
  };
23
- m(r), i?.([...r(g)]);
23
+ p(s), o?.([...s(g)]);
24
24
  }
25
- const f = E((c, r) => {
26
- p((l) => l.get(c) === r ? l : new Map(l).set(c, r));
25
+ const x = V((a, s) => {
26
+ f((l) => l.get(a) === s ? l : new Map(l).set(a, s));
27
27
  }, []);
28
28
  return /* @__PURE__ */ t.jsx(
29
- V,
29
+ z,
30
30
  {
31
31
  value: {
32
- open: x,
33
- setOpen: d,
32
+ open: d,
33
+ setOpen: m,
34
34
  selectedValues: n ? new Set(n) : g,
35
- toggleValue: y,
35
+ toggleValue: b,
36
36
  items: w,
37
- onItemAdded: f
37
+ onItemAdded: x
38
38
  },
39
- children: /* @__PURE__ */ t.jsx(F, { open: x, onOpenChange: d, children: e })
39
+ children: /* @__PURE__ */ t.jsx(F, { open: d, onOpenChange: m, children: e })
40
40
  }
41
41
  );
42
42
  }
43
43
  function Z({
44
44
  className: e,
45
45
  children: n,
46
- ...s
46
+ size: r = "md",
47
+ ...o
47
48
  }) {
48
- const { open: i } = M();
49
+ const { open: d } = M();
49
50
  return /* @__PURE__ */ t.jsx(B, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
50
51
  "button",
51
52
  {
52
- ...s,
53
- role: s.role ?? "combobox",
54
- "aria-expanded": s["aria-expanded"] ?? i,
53
+ ...o,
54
+ role: o.role ?? "combobox",
55
+ "aria-expanded": o["aria-expanded"] ?? d,
56
+ "data-size": r,
55
57
  className: S(
56
- "border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex h-auto min-h-9 w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent px-3 py-1.5 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
58
+ "border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
59
+ r === "xs" && 'text-label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',
60
+ r === "sm" && "text-label-md h-8 px-2 py-1",
61
+ r === "md" && "text-label-lg h-12 px-3 py-1",
62
+ r === "lg" && "text-label-xl h-16 px-4 py-2",
57
63
  e
58
64
  ),
59
65
  children: [
@@ -72,60 +78,60 @@ function Z({
72
78
  function $({
73
79
  placeholder: e,
74
80
  clickToRemove: n = !0,
75
- className: s,
76
- overflowBehavior: i = "wrap-when-open",
77
- ...x
81
+ className: r,
82
+ overflowBehavior: o = "wrap-when-open",
83
+ ...d
78
84
  }) {
79
- const { selectedValues: d, toggleValue: g, items: m, open: w } = M(), [p, y] = j(0), f = v(null), c = v(null), r = v(/* @__PURE__ */ new Set()), l = i === "wrap" || i === "wrap-when-open" && w;
80
- b(() => {
81
- l && r.current.forEach((o) => o.style.removeProperty("display"));
85
+ const { selectedValues: m, toggleValue: g, items: p, open: w } = M(), [f, b] = y(0), x = j(null), a = j(null), s = j(/* @__PURE__ */ new Set()), l = o === "wrap" || o === "wrap-when-open" && w;
86
+ v(() => {
87
+ l && s.current.forEach((i) => i.style.removeProperty("display"));
82
88
  }, [l]);
83
- const a = E(() => {
84
- if (f.current == null) return;
85
- const o = f.current, u = c.current;
86
- u != null && (u.style.display = "none"), r.current.forEach((h) => h.style.removeProperty("display"));
89
+ const c = V(() => {
90
+ if (x.current == null) return;
91
+ const i = x.current, u = a.current;
92
+ u != null && (u.style.display = "none"), s.current.forEach((h) => h.style.removeProperty("display"));
87
93
  let N = 0;
88
- for (let h = r.current.size - 1; h >= 0; h--) {
89
- const P = [...r.current][h];
90
- if (o.scrollWidth <= o.clientWidth)
94
+ for (let h = s.current.size - 1; h >= 0; h--) {
95
+ const P = [...s.current][h];
96
+ if (i.scrollWidth <= i.clientWidth)
91
97
  break;
92
- N = r.current.size - h, P.style.display = "none", u?.style.removeProperty("display");
98
+ N = s.current.size - h, P.style.display = "none", u?.style.removeProperty("display");
93
99
  }
94
- y(N);
100
+ b(N);
95
101
  }, []);
96
- return b(() => {
97
- if (f.current == null) return;
98
- const o = new ResizeObserver(a);
99
- return o.observe(f.current), () => o.disconnect();
100
- }, [a]), T(() => {
101
- a();
102
- }, [d, a]), d.size === 0 && e ? /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground font-normal", children: e }) : /* @__PURE__ */ t.jsxs(
102
+ return v(() => {
103
+ if (x.current == null) return;
104
+ const i = new ResizeObserver(c);
105
+ return i.observe(x.current), () => i.disconnect();
106
+ }, [c]), T(() => {
107
+ c();
108
+ }, [m, c]), m.size === 0 && e ? /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground font-normal", children: e }) : /* @__PURE__ */ t.jsxs(
103
109
  "div",
104
110
  {
105
- ...x,
106
- ref: f,
111
+ ...d,
112
+ ref: x,
107
113
  className: S(
108
- "flex w-full gap-1.5 overflow-hidden",
109
- l && "h-full flex-wrap",
110
- s
114
+ "flex w-full gap-1.5 overflow-hidden min-h-[1.75rem]",
115
+ l && "flex-wrap",
116
+ r
111
117
  ),
112
118
  children: [
113
- [...d].filter((o) => m.has(o)).map((o) => /* @__PURE__ */ t.jsxs(
119
+ [...m].filter((i) => p.has(i)).map((i) => /* @__PURE__ */ t.jsxs(
114
120
  I,
115
121
  {
116
122
  ref: (u) => {
117
123
  if (u != null)
118
- return r.current.add(u), () => {
119
- r.current.delete(u);
124
+ return s.current.add(u), () => {
125
+ s.current.delete(u);
120
126
  };
121
127
  },
122
128
  variant: "outline",
123
129
  className: "group flex items-center gap-1",
124
130
  onClick: n ? (u) => {
125
- u.stopPropagation(), g(o);
131
+ u.stopPropagation(), g(i);
126
132
  } : void 0,
127
133
  children: [
128
- m.get(o),
134
+ p.get(i),
129
135
  n && /* @__PURE__ */ t.jsx(
130
136
  C,
131
137
  {
@@ -135,19 +141,19 @@ function $({
135
141
  )
136
142
  ]
137
143
  },
138
- o
144
+ i
139
145
  )),
140
146
  /* @__PURE__ */ t.jsxs(
141
147
  I,
142
148
  {
143
149
  style: {
144
- display: p > 0 && !l ? "block" : "none"
150
+ display: f > 0 && !l ? "block" : "none"
145
151
  },
146
152
  variant: "outline",
147
- ref: c,
153
+ ref: a,
148
154
  children: [
149
155
  "+",
150
- p
156
+ f
151
157
  ]
152
158
  }
153
159
  )
@@ -158,20 +164,20 @@ function $({
158
164
  function ee({
159
165
  search: e = !0,
160
166
  children: n,
161
- ...s
167
+ ...r
162
168
  }) {
163
- const i = typeof e == "object" ? !0 : e;
169
+ const o = typeof e == "object" ? !0 : e;
164
170
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
165
- /* @__PURE__ */ t.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(z, { children: n }) }) }),
166
- /* @__PURE__ */ t.jsx(G, { className: "min-w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ t.jsxs(k, { ...s, children: [
167
- i ? /* @__PURE__ */ t.jsx(
171
+ /* @__PURE__ */ t.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(E, { children: n }) }) }),
172
+ /* @__PURE__ */ t.jsx(G, { className: "min-w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ t.jsxs(k, { ...r, children: [
173
+ o ? /* @__PURE__ */ t.jsx(
168
174
  O,
169
175
  {
170
176
  placeholder: typeof e == "object" ? e.placeholder : void 0
171
177
  }
172
178
  ) : /* @__PURE__ */ t.jsx("button", { autoFocus: !0, "aria-hidden": "true", className: "sr-only" }),
173
- /* @__PURE__ */ t.jsxs(z, { children: [
174
- i && /* @__PURE__ */ t.jsx(R, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
179
+ /* @__PURE__ */ t.jsxs(E, { children: [
180
+ o && /* @__PURE__ */ t.jsx(R, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
175
181
  n
176
182
  ] })
177
183
  ] }) })
@@ -180,20 +186,20 @@ function ee({
180
186
  function te({
181
187
  value: e,
182
188
  children: n,
183
- badgeLabel: s,
184
- onSelect: i,
185
- ...x
189
+ badgeLabel: r,
190
+ onSelect: o,
191
+ ...d
186
192
  }) {
187
- const { toggleValue: d, selectedValues: g, onItemAdded: m } = M(), w = g.has(e);
188
- return b(() => {
189
- m(e, s ?? n);
190
- }, [e, n, m, s]), /* @__PURE__ */ t.jsxs(
191
- _,
193
+ const { toggleValue: m, selectedValues: g, onItemAdded: p } = M(), w = g.has(e);
194
+ return v(() => {
195
+ p(e, r ?? n);
196
+ }, [e, n, p, r]), /* @__PURE__ */ t.jsxs(
197
+ A,
192
198
  {
193
- ...x,
199
+ ...d,
194
200
  value: e,
195
- onSelect: (p) => {
196
- d(p), i?.(p);
201
+ onSelect: (f) => {
202
+ m(f), o?.(f);
197
203
  },
198
204
  children: [
199
205
  /* @__PURE__ */ t.jsx(
@@ -209,13 +215,13 @@ function te({
209
215
  );
210
216
  }
211
217
  function ne(e) {
212
- return /* @__PURE__ */ t.jsx(A, { ...e });
218
+ return /* @__PURE__ */ t.jsx(_, { ...e });
213
219
  }
214
220
  function re(e) {
215
221
  return /* @__PURE__ */ t.jsx(W, { ...e });
216
222
  }
217
223
  function M() {
218
- const e = X(V);
224
+ const e = X(z);
219
225
  if (e == null)
220
226
  throw new Error(
221
227
  "useMultiSelectContext must be used within a MultiSelectContext"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clasing/ui",
3
- "version": "0.1.125",
3
+ "version": "0.1.126",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",