@clasing/ui 2.0.8 → 2.0.9

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,8 +1,8 @@
1
- import { j as e, c as h } from "./index-DBpnlzOP.js";
1
+ import { j as e, c as v } from "./index-DBpnlzOP.js";
2
2
  import { Slot as c } from "@radix-ui/react-slot";
3
- import { c as f } from "./index-CwXB7YIx.js";
3
+ import { c as x } from "./index-CwXB7YIx.js";
4
4
  import { I as o } from "./icon-component-DGImZz3K.js";
5
- const x = f(
5
+ const f = x(
6
6
  "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-2 overflow-hidden border font-semibold whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none",
7
7
  {
8
8
  variants: {
@@ -19,10 +19,18 @@ const x = f(
19
19
  primary: "bg-primary-600 [a&]:hover:bg-primary-600/90 border-transparent text-white",
20
20
  yellow: "border-transparent bg-yellow-600 text-white [a&]:hover:bg-yellow-600/90",
21
21
  blue: "border-transparent bg-blue-600 text-white [a&]:hover:bg-blue-600/90",
22
- violet: "border-transparent bg-violet-600 text-white [a&]:hover:bg-violet-600/90"
22
+ violet: "border-transparent bg-violet-600 text-white [a&]:hover:bg-violet-600/90",
23
+ "not-started": "text-neutral-1000 border-transparent bg-neutral-100 [a&]:hover:bg-neutral-100/90",
24
+ "in-progress": "bg-blue-050 text-neutral-1000 [a&]:hover:bg-blue-050/90 border-transparent",
25
+ completed: "bg-success-light text-neutral-1000 [a&]:hover:bg-success-light/90 border-transparent",
26
+ blocked: "text-neutral-1000 border-transparent bg-neutral-100 [a&]:hover:bg-neutral-100/90",
27
+ paused: "bg-warning-light text-neutral-1000 [a&]:hover:bg-warning-light/90 border-transparent",
28
+ failed: "bg-error-light text-neutral-1000 [a&]:hover:bg-error-light/90 border-transparent",
29
+ expired: "bg-error-light text-neutral-1000 [a&]:hover:bg-error-light/90 border-transparent",
30
+ cancelled: "bg-error-light text-neutral-1000 [a&]:hover:bg-error-light/90 border-transparent"
23
31
  },
24
32
  size: {
25
- xs: "paragraph-xs px-3 py-px [&>svg]:size-3",
33
+ xs: "paragraph-xs h-6.5 px-3 py-px [&>svg]:size-3.5",
26
34
  sm: "paragraph-xs px-4 py-1 [&>svg]:size-4",
27
35
  md: "paragraph-sm px-4 py-2 [&>svg]:size-4",
28
36
  lg: "paragraph-md px-4 py-2 [&>svg]:size-5"
@@ -48,32 +56,32 @@ const x = f(
48
56
  );
49
57
  function j({
50
58
  className: s,
51
- variant: n,
59
+ variant: i,
52
60
  size: g,
53
- weight: d,
54
- rounded: l,
61
+ weight: l,
62
+ rounded: b,
55
63
  iconName: r,
56
64
  iconPosition: t = "left",
57
- iconStroke: a,
58
- iconOnly: i,
59
- asChild: b = !1,
60
- children: p,
61
- ...u
65
+ iconStroke: a = "1",
66
+ iconOnly: n,
67
+ asChild: d = !1,
68
+ children: u,
69
+ ...h
62
70
  }) {
63
- const v = b ? c : "span";
71
+ const p = d ? c : "span";
64
72
  return /* @__PURE__ */ e.jsxs(
65
- v,
73
+ p,
66
74
  {
67
75
  "data-slot": "badge",
68
- className: h(
69
- x({ variant: n, size: g, weight: d, rounded: l }),
70
- i && "px-2.5 py-2",
76
+ className: v(
77
+ f({ variant: i, size: g, weight: l, rounded: b }),
78
+ n && "px-2.5 py-2",
71
79
  s
72
80
  ),
73
- ...u,
81
+ ...h,
74
82
  children: [
75
83
  r && t === "left" && /* @__PURE__ */ e.jsx(o, { iconName: r, stroke: a }),
76
- !i && p,
84
+ !n && u,
77
85
  r && t === "right" && /* @__PURE__ */ e.jsx(o, { iconName: r, stroke: a })
78
86
  ]
79
87
  }
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./index-DSjHHn1r.cjs"),c=require("@radix-ui/react-slot"),v=require("./index-BVmT9wZC.cjs"),o=require("./icon-component-DTlgy__B.cjs"),x=v.cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-2 overflow-hidden border font-semibold whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none",{variants:{variant:{default:"bg-muted text-muted-foreground [a&]:hover:bg-muted/90 border-transparent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",error:"bg-error-light text-error-main [a&]:hover:bg-error-light/90 border-transparent",warning:"bg-warning-light text-warning-main [a&]:hover:bg-warning-light/90 border-transparent",success:"bg-success-light text-success-main [a&]:hover:bg-success-light/90 border-transparent",info:"bg-info-light text-info-main [a&]:hover:bg-info-light/90 border-transparent",neutral:"border-transparent bg-black text-white [a&]:hover:bg-black/90",primary:"bg-primary-600 [a&]:hover:bg-primary-600/90 border-transparent text-white",yellow:"border-transparent bg-yellow-600 text-white [a&]:hover:bg-yellow-600/90",blue:"border-transparent bg-blue-600 text-white [a&]:hover:bg-blue-600/90",violet:"border-transparent bg-violet-600 text-white [a&]:hover:bg-violet-600/90","not-started":"text-neutral-1000 border-transparent bg-neutral-100 [a&]:hover:bg-neutral-100/90","in-progress":"bg-blue-050 text-neutral-1000 [a&]:hover:bg-blue-050/90 border-transparent",completed:"bg-success-light text-neutral-1000 [a&]:hover:bg-success-light/90 border-transparent",blocked:"text-neutral-1000 border-transparent bg-neutral-100 [a&]:hover:bg-neutral-100/90",paused:"bg-warning-light text-neutral-1000 [a&]:hover:bg-warning-light/90 border-transparent",failed:"bg-error-light text-neutral-1000 [a&]:hover:bg-error-light/90 border-transparent",expired:"bg-error-light text-neutral-1000 [a&]:hover:bg-error-light/90 border-transparent",cancelled:"bg-error-light text-neutral-1000 [a&]:hover:bg-error-light/90 border-transparent"},size:{xs:"paragraph-xs h-6.5 px-3 py-px [&>svg]:size-3.5",sm:"paragraph-xs px-4 py-1 [&>svg]:size-4",md:"paragraph-sm px-4 py-2 [&>svg]:size-4",lg:"paragraph-md px-4 py-2 [&>svg]:size-5"},weight:{light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},rounded:{default:"rounded-2xl",full:"rounded-full"}},defaultVariants:{variant:"default",size:"xs",weight:"semibold",rounded:"full"}});function f({className:i,variant:s,size:g,weight:l,rounded:b,iconName:r,iconPosition:t="left",iconStroke:a="1",iconOnly:n,asChild:d=!1,children:u,...h}){const p=d?c.Slot:"span";return e.jsxRuntimeExports.jsxs(p,{"data-slot":"badge",className:e.cn(x({variant:s,size:g,weight:l,rounded:b}),n&&"px-2.5 py-2",i),...h,children:[r&&t==="left"&&e.jsxRuntimeExports.jsx(o.IconComponent,{iconName:r,stroke:a}),!n&&u,r&&t==="right"&&e.jsxRuntimeExports.jsx(o.IconComponent,{iconName:r,stroke:a})]})}exports.Badge=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../badge-CS2XfLYQ.cjs");exports.Badge=e.Badge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../badge-oQqEF2X5.cjs");exports.Badge=e.Badge;
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  import { TablerIconName } from './icon-component';
4
4
  declare const badgeVariants: (props?: ({
5
- variant?: "default" | "error" | "outline" | "primary" | "secondary" | "destructive" | "info" | "success" | "warning" | "neutral" | "yellow" | "blue" | "violet" | null | undefined;
5
+ variant?: "default" | "error" | "outline" | "primary" | "secondary" | "destructive" | "info" | "success" | "warning" | "neutral" | "yellow" | "blue" | "violet" | "not-started" | "in-progress" | "completed" | "blocked" | "paused" | "failed" | "expired" | "cancelled" | null | undefined;
6
6
  size?: "lg" | "md" | "sm" | "xs" | null | undefined;
7
7
  weight?: "bold" | "light" | "regular" | "semibold" | null | undefined;
8
8
  rounded?: "default" | "full" | null | undefined;
@@ -1,4 +1,4 @@
1
- import { B as o } from "../badge-B4oRxQ-G.js";
1
+ import { B as o } from "../badge-Ds17GJH4.js";
2
2
  export {
3
3
  o as Badge
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../index-DSjHHn1r.cjs"),I=require("../../badge-CS2XfLYQ.cjs"),l=require("../../card-Dj2wgH-P.cjs"),p=require("../../icon-component-DTlgy__B.cjs"),x=require("../../tooltip-BvdeurjC.cjs"),q=require("../../index-BVmT9wZC.cjs"),w=require("react"),y=q.cva("focus-visible:border-ring focus-visible:ring-ring/50 transition-[color,box-shadow] focus-visible:ring-[3px]"),j=w.forwardRef(({className:g,isActive:n,title:u,text:m,helperText:d,badgeText:t,disabled:r,badgeVariant:h,badgeSize:f="xs",iconName:i,iconText:a,tooltipIconName:R="IconHelpCircleFilled",tooltipText:s,tooltipTitle:o,tooltipSide:b,tooltipSideOffset:C,tooltipAlign:E,children:N,...c},v)=>e.jsxRuntimeExports.jsxs(l.Card,{ref:v,className:e.cn(y({className:g}),{"bg-blue-050 border-blue-950":n,"border-neutral-100 bg-neutral-100":r,"cursor-pointer lg:active:bg-blue-100":c.onClick&&n&&!r,"lg:active:bg-blue-050 cursor-pointer":c.onClick&&!n&&!r}),role:"button",tabIndex:0,...c,children:[t||i||a?e.jsxRuntimeExports.jsxs(l.CardHeader,{className:"flex items-center justify-between gap-2",children:[i||a?e.jsxRuntimeExports.jsx("div",{className:e.cn("rounded-full p-1",{"bg-neutral-000 text-muted-foreground":!n,"bg-white text-blue-800":n,"bg-white text-neutral-700":r}),children:e.jsxRuntimeExports.jsx(p.IconComponent,{iconName:i,iconText:a,size:20})}):null,(t||s)&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[t?e.jsxRuntimeExports.jsx(I.Badge,{variant:h,size:f,weight:"semibold",className:e.cn({"opacity-50":r}),children:t}):null,s&&e.jsxRuntimeExports.jsxs(x.Tooltip,{children:[e.jsxRuntimeExports.jsx(x.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(p.IconComponent,{iconName:R??"IconHelpCircleFilled",size:20,className:"z-10 min-h-5 min-w-5"})}),e.jsxRuntimeExports.jsx(x.TooltipContent,{side:b,sideOffset:C,align:E,children:o||s&&e.jsxRuntimeExports.jsxs("div",{className:"text-neutral-1000 flex flex-col gap-1",children:[o&&e.jsxRuntimeExports.jsx("p",{className:"paragraph-md font-semibold",children:o}),s&&e.jsxRuntimeExports.jsx("p",{className:"paragraph-md",children:s})]})})]})]})]}):null,e.jsxRuntimeExports.jsxs(l.CardContent,{className:"flex flex-col gap-1",children:[u?e.jsxRuntimeExports.jsx("p",{className:e.cn("text-foreground label-xl font-semibold",{"text-neutral-700":r}),children:u}):null,m?e.jsxRuntimeExports.jsx("p",{className:e.cn("text-muted-foreground paragraph-md",{"text-neutral-700":r}),children:m}):null,N]}),d?e.jsxRuntimeExports.jsx(l.CardFooter,{children:e.jsxRuntimeExports.jsx("p",{className:e.cn("paragraph-sm text-neutral-800",{"text-neutral-700":r}),children:d})}):null]}));j.displayName="InteractiveCard";const z=j;exports.InteractiveCard=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../index-DSjHHn1r.cjs"),I=require("../../badge-oQqEF2X5.cjs"),l=require("../../card-Dj2wgH-P.cjs"),p=require("../../icon-component-DTlgy__B.cjs"),x=require("../../tooltip-BvdeurjC.cjs"),q=require("../../index-BVmT9wZC.cjs"),w=require("react"),y=q.cva("focus-visible:border-ring focus-visible:ring-ring/50 transition-[color,box-shadow] focus-visible:ring-[3px]"),j=w.forwardRef(({className:g,isActive:n,title:u,text:m,helperText:d,badgeText:t,disabled:r,badgeVariant:h,badgeSize:f="xs",iconName:i,iconText:a,tooltipIconName:R="IconHelpCircleFilled",tooltipText:s,tooltipTitle:o,tooltipSide:b,tooltipSideOffset:C,tooltipAlign:E,children:N,...c},v)=>e.jsxRuntimeExports.jsxs(l.Card,{ref:v,className:e.cn(y({className:g}),{"bg-blue-050 border-blue-950":n,"border-neutral-100 bg-neutral-100":r,"cursor-pointer lg:active:bg-blue-100":c.onClick&&n&&!r,"lg:active:bg-blue-050 cursor-pointer":c.onClick&&!n&&!r}),role:"button",tabIndex:0,...c,children:[t||i||a?e.jsxRuntimeExports.jsxs(l.CardHeader,{className:"flex items-center justify-between gap-2",children:[i||a?e.jsxRuntimeExports.jsx("div",{className:e.cn("rounded-full p-1",{"bg-neutral-000 text-muted-foreground":!n,"bg-white text-blue-800":n,"bg-white text-neutral-700":r}),children:e.jsxRuntimeExports.jsx(p.IconComponent,{iconName:i,iconText:a,size:20})}):null,(t||s)&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[t?e.jsxRuntimeExports.jsx(I.Badge,{variant:h,size:f,weight:"semibold",className:e.cn({"opacity-50":r}),children:t}):null,s&&e.jsxRuntimeExports.jsxs(x.Tooltip,{children:[e.jsxRuntimeExports.jsx(x.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(p.IconComponent,{iconName:R??"IconHelpCircleFilled",size:20,className:"z-10 min-h-5 min-w-5"})}),e.jsxRuntimeExports.jsx(x.TooltipContent,{side:b,sideOffset:C,align:E,children:o||s&&e.jsxRuntimeExports.jsxs("div",{className:"text-neutral-1000 flex flex-col gap-1",children:[o&&e.jsxRuntimeExports.jsx("p",{className:"paragraph-md font-semibold",children:o}),s&&e.jsxRuntimeExports.jsx("p",{className:"paragraph-md",children:s})]})})]})]})]}):null,e.jsxRuntimeExports.jsxs(l.CardContent,{className:"flex flex-col gap-1",children:[u?e.jsxRuntimeExports.jsx("p",{className:e.cn("text-foreground label-xl font-semibold",{"text-neutral-700":r}),children:u}):null,m?e.jsxRuntimeExports.jsx("p",{className:e.cn("text-muted-foreground paragraph-md",{"text-neutral-700":r}),children:m}):null,N]}),d?e.jsxRuntimeExports.jsx(l.CardFooter,{children:e.jsxRuntimeExports.jsx("p",{className:e.cn("paragraph-sm text-neutral-800",{"text-neutral-700":r}),children:d})}):null]}));j.displayName="InteractiveCard";const z=j;exports.InteractiveCard=z;
@@ -1,5 +1,5 @@
1
1
  import { j as e, c as a } from "../../index-DBpnlzOP.js";
2
- import { B as w } from "../../badge-B4oRxQ-G.js";
2
+ import { B as w } from "../../badge-Ds17GJH4.js";
3
3
  import { C as y, e as z, b as F, d as H } from "../../card-BNTyYiyA.js";
4
4
  import { I as x } from "../../icon-component-DGImZz3K.js";
5
5
  import { T as k, c as B, a as R } from "../../tooltip-CUaxcngn.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DSjHHn1r.cjs"),I=require("../badge-CS2XfLYQ.cjs"),m=require("../command-CHisYTN-.cjs"),N=require("../popover-BnLx2OY6.cjs"),n=require("react"),v=require("../icon-component-DTlgy__B.cjs"),V=n.createContext(null);function k({children:t,values:r,defaultValues:i,onValuesChange:u,isLoading:d,onSearchChange:c,loadingText:f="Loading...",noResultsText:a="No results found"}){const[h,p]=n.useState(!1),[y,j]=n.useState(new Set(r??i)),[b,x]=n.useState(new Map),[S,E]=n.useState("");function o(s){const g=R=>{const C=new Set(R);return C.has(s)?C.delete(s):C.add(s),C};j(g),u?.([...g(y)])}const l=n.useCallback((s,g)=>{x(R=>R.get(s)===g?R:new Map(R).set(s,g))},[]),w=n.useCallback(s=>{E(s),c?.(s)},[c]);return e.jsxRuntimeExports.jsx(V,{value:{open:h,setOpen:p,selectedValues:r?new Set(r):y,toggleValue:o,items:b,onItemAdded:l,isLoading:d,searchValue:S,onSearchChange:w,loadingText:f,noResultsText:a},children:e.jsxRuntimeExports.jsx(N.Popover,{open:h,onOpenChange:p,children:t})})}function z({className:t,children:r,size:i="md",...u}){const{open:d}=M();return e.jsxRuntimeExports.jsx(N.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{...u,role:u.role??"combobox","aria-expanded":u["aria-expanded"]??d,"data-size":i,className:e.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",i==="xs"&&'label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',i==="sm"&&"label-md h-8 px-2 py-1",i==="md"&&"label-lg h-12 px-3 py-1",i==="lg"&&"label-xl h-16 px-4 py-2",t),children:[r,e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconSelector",className:"size-4 shrink-0 opacity-50"})]})})}function P({placeholder:t,clickToRemove:r=!0,className:i,overflowBehavior:u="wrap-when-open",...d}){const{selectedValues:c,toggleValue:f,items:a,open:h}=M(),[p,y]=n.useState(0),j=n.useRef(null),b=n.useRef(null),x=n.useRef(new Set),S=u==="wrap"||u==="wrap-when-open"&&h;n.useEffect(()=>{S&&x.current.forEach(o=>o.style.removeProperty("display"))},[S]);const E=n.useCallback(()=>{if(j.current==null)return;const o=j.current,l=b.current;l!=null&&(l.style.display="none"),x.current.forEach(s=>s.style.removeProperty("display"));let w=0;for(let s=x.current.size-1;s>=0;s--){const g=[...x.current][s];if(o.scrollWidth<=o.clientWidth)break;w=x.current.size-s,g.style.display="none",l?.style.removeProperty("display")}y(w)},[]);return n.useEffect(()=>{if(j.current==null)return;const o=new ResizeObserver(E);return o.observe(j.current),()=>o.disconnect()},[E]),n.useLayoutEffect(()=>{E()},[c,E]),c.size===0&&t?e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground font-normal",children:t}):e.jsxRuntimeExports.jsxs("div",{...d,ref:j,className:e.cn("flex min-h-[1.75rem] w-full gap-1.5 overflow-hidden",S&&"flex-wrap",i),children:[[...c].filter(o=>a.has(o)).map(o=>e.jsxRuntimeExports.jsxs(I.Badge,{ref:l=>{if(l!=null)return x.current.add(l),()=>{x.current.delete(l)}},variant:"outline",className:"group flex items-center gap-1",onClick:r?l=>{l.stopPropagation(),f(o)}:void 0,children:[a.get(o),r&&e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconX",className:"text-muted-foreground group-hover:text-destructive size-2"})]},o)),e.jsxRuntimeExports.jsxs(I.Badge,{style:{display:p>0&&!S?"block":"none"},variant:"outline",ref:b,children:["+",p]})]})}function q({search:t=!0,children:r,...i}){const{isLoading:u,onSearchChange:d,searchValue:c,noResultsText:f}=M(),a=typeof t=="object"?!0:t;return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{display:"none"},children:e.jsxRuntimeExports.jsx(m.Command,{children:e.jsxRuntimeExports.jsx(m.CommandList,{children:r})})}),e.jsxRuntimeExports.jsx(N.PopoverContent,{className:"min-w-[var(--radix-popover-trigger-width)] p-0",children:e.jsxRuntimeExports.jsxs(m.Command,{...i,children:[a?e.jsxRuntimeExports.jsx(m.CommandInput,{placeholder:typeof t=="object"?t.placeholder:void 0,value:c,onValueChange:d}):e.jsxRuntimeExports.jsx("button",{autoFocus:!0,"aria-hidden":"true",className:"sr-only"}),e.jsxRuntimeExports.jsx(m.CommandList,{children:u?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconLoader2",className:"text-muted-foreground size-4 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground ml-2 text-sm",children:u})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[a&&e.jsxRuntimeExports.jsx(m.CommandEmpty,{children:f}),r]})})]})})]})}function O({value:t,children:r,badgeLabel:i,onSelect:u,...d}){const{toggleValue:c,selectedValues:f,onItemAdded:a}=M(),h=f.has(t);return n.useEffect(()=>{a(t,i??r)},[t,r,a,i]),e.jsxRuntimeExports.jsxs(m.CommandItem,{...d,value:t,onSelect:p=>{c(p),u?.(p)},children:[e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconCheck",className:e.cn("mr-2 size-4",h?"opacity-100":"opacity-0")}),r]})}function L(t){return e.jsxRuntimeExports.jsx(m.CommandGroup,{...t})}function _(t){return e.jsxRuntimeExports.jsx(m.CommandSeparator,{...t})}function M(){const t=n.useContext(V);if(t==null)throw new Error("useMultiSelectContext must be used within a MultiSelectContext");return t}exports.MultiSelect=k;exports.MultiSelectContent=q;exports.MultiSelectGroup=L;exports.MultiSelectItem=O;exports.MultiSelectSeparator=_;exports.MultiSelectTrigger=z;exports.MultiSelectValue=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DSjHHn1r.cjs"),I=require("../badge-oQqEF2X5.cjs"),m=require("../command-CHisYTN-.cjs"),N=require("../popover-BnLx2OY6.cjs"),n=require("react"),v=require("../icon-component-DTlgy__B.cjs"),V=n.createContext(null);function k({children:t,values:r,defaultValues:i,onValuesChange:u,isLoading:d,onSearchChange:c,loadingText:f="Loading...",noResultsText:a="No results found"}){const[h,p]=n.useState(!1),[y,j]=n.useState(new Set(r??i)),[b,x]=n.useState(new Map),[S,E]=n.useState("");function o(s){const g=R=>{const C=new Set(R);return C.has(s)?C.delete(s):C.add(s),C};j(g),u?.([...g(y)])}const l=n.useCallback((s,g)=>{x(R=>R.get(s)===g?R:new Map(R).set(s,g))},[]),w=n.useCallback(s=>{E(s),c?.(s)},[c]);return e.jsxRuntimeExports.jsx(V,{value:{open:h,setOpen:p,selectedValues:r?new Set(r):y,toggleValue:o,items:b,onItemAdded:l,isLoading:d,searchValue:S,onSearchChange:w,loadingText:f,noResultsText:a},children:e.jsxRuntimeExports.jsx(N.Popover,{open:h,onOpenChange:p,children:t})})}function z({className:t,children:r,size:i="md",...u}){const{open:d}=M();return e.jsxRuntimeExports.jsx(N.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{...u,role:u.role??"combobox","aria-expanded":u["aria-expanded"]??d,"data-size":i,className:e.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",i==="xs"&&'label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',i==="sm"&&"label-md h-8 px-2 py-1",i==="md"&&"label-lg h-12 px-3 py-1",i==="lg"&&"label-xl h-16 px-4 py-2",t),children:[r,e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconSelector",className:"size-4 shrink-0 opacity-50"})]})})}function P({placeholder:t,clickToRemove:r=!0,className:i,overflowBehavior:u="wrap-when-open",...d}){const{selectedValues:c,toggleValue:f,items:a,open:h}=M(),[p,y]=n.useState(0),j=n.useRef(null),b=n.useRef(null),x=n.useRef(new Set),S=u==="wrap"||u==="wrap-when-open"&&h;n.useEffect(()=>{S&&x.current.forEach(o=>o.style.removeProperty("display"))},[S]);const E=n.useCallback(()=>{if(j.current==null)return;const o=j.current,l=b.current;l!=null&&(l.style.display="none"),x.current.forEach(s=>s.style.removeProperty("display"));let w=0;for(let s=x.current.size-1;s>=0;s--){const g=[...x.current][s];if(o.scrollWidth<=o.clientWidth)break;w=x.current.size-s,g.style.display="none",l?.style.removeProperty("display")}y(w)},[]);return n.useEffect(()=>{if(j.current==null)return;const o=new ResizeObserver(E);return o.observe(j.current),()=>o.disconnect()},[E]),n.useLayoutEffect(()=>{E()},[c,E]),c.size===0&&t?e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground font-normal",children:t}):e.jsxRuntimeExports.jsxs("div",{...d,ref:j,className:e.cn("flex min-h-[1.75rem] w-full gap-1.5 overflow-hidden",S&&"flex-wrap",i),children:[[...c].filter(o=>a.has(o)).map(o=>e.jsxRuntimeExports.jsxs(I.Badge,{ref:l=>{if(l!=null)return x.current.add(l),()=>{x.current.delete(l)}},variant:"outline",className:"group flex items-center gap-1",onClick:r?l=>{l.stopPropagation(),f(o)}:void 0,children:[a.get(o),r&&e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconX",className:"text-muted-foreground group-hover:text-destructive size-2"})]},o)),e.jsxRuntimeExports.jsxs(I.Badge,{style:{display:p>0&&!S?"block":"none"},variant:"outline",ref:b,children:["+",p]})]})}function q({search:t=!0,children:r,...i}){const{isLoading:u,onSearchChange:d,searchValue:c,noResultsText:f}=M(),a=typeof t=="object"?!0:t;return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{display:"none"},children:e.jsxRuntimeExports.jsx(m.Command,{children:e.jsxRuntimeExports.jsx(m.CommandList,{children:r})})}),e.jsxRuntimeExports.jsx(N.PopoverContent,{className:"min-w-[var(--radix-popover-trigger-width)] p-0",children:e.jsxRuntimeExports.jsxs(m.Command,{...i,children:[a?e.jsxRuntimeExports.jsx(m.CommandInput,{placeholder:typeof t=="object"?t.placeholder:void 0,value:c,onValueChange:d}):e.jsxRuntimeExports.jsx("button",{autoFocus:!0,"aria-hidden":"true",className:"sr-only"}),e.jsxRuntimeExports.jsx(m.CommandList,{children:u?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconLoader2",className:"text-muted-foreground size-4 animate-spin"}),e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground ml-2 text-sm",children:u})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[a&&e.jsxRuntimeExports.jsx(m.CommandEmpty,{children:f}),r]})})]})})]})}function O({value:t,children:r,badgeLabel:i,onSelect:u,...d}){const{toggleValue:c,selectedValues:f,onItemAdded:a}=M(),h=f.has(t);return n.useEffect(()=>{a(t,i??r)},[t,r,a,i]),e.jsxRuntimeExports.jsxs(m.CommandItem,{...d,value:t,onSelect:p=>{c(p),u?.(p)},children:[e.jsxRuntimeExports.jsx(v.IconComponent,{iconName:"IconCheck",className:e.cn("mr-2 size-4",h?"opacity-100":"opacity-0")}),r]})}function L(t){return e.jsxRuntimeExports.jsx(m.CommandGroup,{...t})}function _(t){return e.jsxRuntimeExports.jsx(m.CommandSeparator,{...t})}function M(){const t=n.useContext(V);if(t==null)throw new Error("useMultiSelectContext must be used within a MultiSelectContext");return t}exports.MultiSelect=k;exports.MultiSelectContent=q;exports.MultiSelectGroup=L;exports.MultiSelectItem=O;exports.MultiSelectSeparator=_;exports.MultiSelectTrigger=z;exports.MultiSelectValue=P;
@@ -1,5 +1,5 @@
1
1
  import { j as e, c as z } from "../index-DBpnlzOP.js";
2
- import { B as E } from "../badge-B4oRxQ-G.js";
2
+ import { B as E } from "../badge-Ds17GJH4.js";
3
3
  import { C as P, f as R, d as _, b as A, c as L, e as F, g as W } from "../command-CGUB58ej.js";
4
4
  import { P as G, b as T, c as B } from "../popover-C6pozFVL.js";
5
5
  import { createContext as X, useState as y, useCallback as I, useEffect as k, useRef as V, useLayoutEffect as q, useContext as D } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clasing/ui",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",
@@ -1 +0,0 @@
1
- "use strict";const r=require("./index-DSjHHn1r.cjs"),v=require("@radix-ui/react-slot"),h=require("./index-BVmT9wZC.cjs"),i=require("./icon-component-DTlgy__B.cjs"),x=h.cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-2 overflow-hidden border font-semibold whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none",{variants:{variant:{default:"bg-muted text-muted-foreground [a&]:hover:bg-muted/90 border-transparent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",error:"bg-error-light text-error-main [a&]:hover:bg-error-light/90 border-transparent",warning:"bg-warning-light text-warning-main [a&]:hover:bg-warning-light/90 border-transparent",success:"bg-success-light text-success-main [a&]:hover:bg-success-light/90 border-transparent",info:"bg-info-light text-info-main [a&]:hover:bg-info-light/90 border-transparent",neutral:"border-transparent bg-black text-white [a&]:hover:bg-black/90",primary:"bg-primary-600 [a&]:hover:bg-primary-600/90 border-transparent text-white",yellow:"border-transparent bg-yellow-600 text-white [a&]:hover:bg-yellow-600/90",blue:"border-transparent bg-blue-600 text-white [a&]:hover:bg-blue-600/90",violet:"border-transparent bg-violet-600 text-white [a&]:hover:bg-violet-600/90"},size:{xs:"paragraph-xs px-3 py-px [&>svg]:size-3",sm:"paragraph-xs px-4 py-1 [&>svg]:size-4",md:"paragraph-sm px-4 py-2 [&>svg]:size-4",lg:"paragraph-md px-4 py-2 [&>svg]:size-5"},weight:{light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},rounded:{default:"rounded-2xl",full:"rounded-full"}},defaultVariants:{variant:"default",size:"xs",weight:"semibold",rounded:"full"}});function f({className:o,variant:s,size:d,weight:g,rounded:l,iconName:e,iconPosition:t="left",iconStroke:a,iconOnly:n,asChild:b=!1,children:u,...p}){const c=b?v.Slot:"span";return r.jsxRuntimeExports.jsxs(c,{"data-slot":"badge",className:r.cn(x({variant:s,size:d,weight:g,rounded:l}),n&&"px-2.5 py-2",o),...p,children:[e&&t==="left"&&r.jsxRuntimeExports.jsx(i.IconComponent,{iconName:e,stroke:a}),!n&&u,e&&t==="right"&&r.jsxRuntimeExports.jsx(i.IconComponent,{iconName:e,stroke:a})]})}exports.Badge=f;