@next-degree/pickle-shared-js 0.3.19 → 0.3.20
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/README.md +47 -1
- package/dist/app/layout.cjs +70 -1
- package/dist/app/layout.cjs.map +1 -1
- package/dist/app/layout.css +1263 -1
- package/dist/app/layout.css.map +1 -1
- package/dist/app/layout.js +35 -1
- package/dist/app/layout.js.map +1 -1
- package/dist/app/page.cjs +774 -1
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +743 -1
- package/dist/app/page.js.map +1 -1
- package/dist/assets/fonts/AmbitBold.cjs +2 -1
- package/dist/assets/fonts/AmbitBold.js +5 -1
- package/dist/assets/fonts/AmbitBoldItalic.cjs +2 -1
- package/dist/assets/fonts/AmbitBoldItalic.js +5 -1
- package/dist/assets/fonts/AmbitRegular.cjs +2 -1
- package/dist/assets/fonts/AmbitRegular.js +5 -1
- package/dist/components/demos/ComboboxDemo.cjs +759 -1
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +731 -1
- package/dist/components/demos/ComboboxDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +767 -1
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +736 -1
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/primitives/command.cjs +223 -1
- package/dist/components/primitives/command.cjs.map +1 -1
- package/dist/components/primitives/command.js +181 -1
- package/dist/components/primitives/command.js.map +1 -1
- package/dist/components/primitives/dialog.cjs +137 -1
- package/dist/components/primitives/dialog.cjs.map +1 -1
- package/dist/components/primitives/dialog.js +92 -1
- package/dist/components/primitives/dialog.js.map +1 -1
- package/dist/components/primitives/popover.cjs +72 -1
- package/dist/components/primitives/popover.cjs.map +1 -1
- package/dist/components/primitives/popover.js +36 -1
- package/dist/components/primitives/popover.js.map +1 -1
- package/dist/components/primitives/separator.cjs +67 -1
- package/dist/components/primitives/separator.cjs.map +1 -1
- package/dist/components/primitives/separator.js +33 -1
- package/dist/components/primitives/separator.js.map +1 -1
- package/dist/components/ui/Badge.cjs +57 -1
- package/dist/components/ui/Badge.cjs.map +1 -1
- package/dist/components/ui/Badge.js +31 -1
- package/dist/components/ui/Badge.js.map +1 -1
- package/dist/components/ui/Button.cjs +145 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.js +118 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +99 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.js +71 -1
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Chip.cjs +49 -1
- package/dist/components/ui/Chip.cjs.map +1 -1
- package/dist/components/ui/Chip.js +28 -1
- package/dist/components/ui/Chip.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +564 -1
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +532 -1
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Label.cjs +50 -1
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.js +27 -1
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/ListItem.cjs +151 -1
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.js +120 -1
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/Select.cjs +246 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +221 -1
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/index.cjs +855 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +817 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.cjs +34 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js +9 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles/globals.css +1263 -1
- package/dist/styles/globals.css.map +1 -1
- package/package.json +14 -17
|
@@ -1,2 +1,533 @@
|
|
|
1
|
-
"use client";import{forwardRef as Be,useEffect as Fe,useState as ue}from"react";import{ChevronDownIcon as Xe,CircleX as Ke,icons as Je}from"lucide-react";import{cva as $e}from"cva";import{clsx as xe}from"clsx";import{twMerge as Ce}from"tailwind-merge";function a(...e){return Ce(xe(e))}import{Command as l}from"cmdk";import{Search as Se}from"lucide-react";import*as P from"react";import*as i from"@radix-ui/react-dialog";import{X as be}from"lucide-react";import*as w from"react";import{jsx as y,jsxs as z}from"react/jsx-runtime";var Re=i.Portal;var Y=w.forwardRef(({className:e,...t},o)=>y(i.Overlay,{ref:o,className:a("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Y.displayName=i.Overlay.displayName;var Z=w.forwardRef(({className:e,children:t,...o},m)=>z(Re,{children:[y(Y,{}),z(i.Content,{ref:m,className:a("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",e),...o,children:[t,z(i.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400",children:[y(be,{className:"h-4 w-4"}),y("span",{className:"sr-only",children:"Close"})]})]})]}));Z.displayName=i.Content.displayName;var Ne=({className:e,...t})=>y("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ne.displayName="DialogHeader";var ke=({className:e,...t})=>y("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ke.displayName="DialogFooter";var we=w.forwardRef(({className:e,...t},o)=>y(i.Title,{ref:o,className:a("text-lg font-semibold leading-none tracking-tight",e),...t}));we.displayName=i.Title.displayName;var De=w.forwardRef(({className:e,...t},o)=>y(i.Description,{ref:o,className:a("text-sm text-neutral-500 dark:text-neutral-400",e),...t}));De.displayName=i.Description.displayName;import{jsx as g,jsxs as Le}from"react/jsx-runtime";var M=P.forwardRef(({className:e,...t},o)=>g(l,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",e),...t}));M.displayName=l.displayName;var O=P.forwardRef(({className:e,...t},o)=>Le("div",{className:"m-1 flex items-center rounded-xl border px-3","cmdk-input-wrapper":"",children:[g(Se,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),g(l.Input,{ref:o,className:a("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));O.displayName=l.Input.displayName;var H=P.forwardRef(({className:e,...t},o)=>g(l.List,{ref:o,className:a("overflow-y-auto overflow-x-hidden",e),...t}));H.displayName=l.List.displayName;var G=P.forwardRef((e,t)=>g(l.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));G.displayName=l.Empty.displayName;var A=P.forwardRef(({className:e,...t},o)=>g(l.Group,{ref:o,className:a("overflow-hidden p-1 text-neutral-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500",e),...t}));A.displayName=l.Group.displayName;var Ie=P.forwardRef(({className:e,...t},o)=>g(l.Separator,{ref:o,className:a("-mx-1 h-px bg-neutral-200",e),...t}));Ie.displayName=l.Separator.displayName;var B=P.forwardRef(({className:e,...t},o)=>g(l.Item,{ref:o,className:a("relative flex cursor-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50",e),...t}));B.displayName=l.Item.displayName;var Ee=({className:e,...t})=>g("span",{className:a("ml-auto text-xs tracking-widest text-neutral-500",e),...t});Ee.displayName="CommandShortcut";import*as ee from"react";import*as h from"@radix-ui/react-popover";import{jsx as j}from"react/jsx-runtime";var te=h.Root,oe=h.Trigger,F=ee.forwardRef(({className:e,align:t="center",sideOffset:o=4,...m},s)=>j(h.Portal,{children:j(h.Content,{ref:s,align:t,sideOffset:o,className:a("z-50 rounded-2xl border bg-white p-4 text-black shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...m})}));F.displayName=h.Content.displayName;import*as X from"@radix-ui/react-separator";import*as ae from"react";import{jsx as Te}from"react/jsx-runtime";var K=ae.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...m},s)=>Te(X.Root,{ref:s,decorative:o,orientation:t,className:a("shrink-0 bg-grey-10",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...m}));K.displayName=X.Root.displayName;import{CheckIcon as Ve}from"lucide-react";import*as S from"@radix-ui/react-checkbox";import{Check as _e,Minus as We}from"lucide-react";import{forwardRef as ie}from"react";import{jsx as D,jsxs as le}from"react/jsx-runtime";var re=ie(({className:e,...t},o)=>D(S.Root,{ref:o,className:a("group","peer","h-5","w-5","shrink-0","rounded-md","border","border-grey-10","outline","outline-1","outline-offset-2","outline-transparent","hover:border-grey-20","focus:outline-purple-100","active:border-green-80","disabled:cursor-not-allowed","disabled:opacity-50","data-[state=checked]:bg-green-80","data-[state=indeterminate]:bg-green-80","data-[state=checked]:text-white","data-[state=indeterminate]:text-primary-foreground",t.disabled&&"data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",e),...t,children:le(S.Indicator,{className:"flex items-center justify-center text-current",children:[D(_e,{className:"hidden h-4 w-4 group-data-[state=checked]:block"}),D(We,{className:"hidden h-4 w-4 group-data-[state=indeterminate]:block"})]})}));re.displayName=S.Root.displayName;var ne=ie(({classNames:e,children:t,...o},m)=>{let{disabled:s}=o,p=o.id??`${o.name??o.value?.toString()}-checkbox`,v=s?"text-grey-40 pointer-events-none":"";return le("div",{className:a("flex space-x-2",e?.wrapper),children:[D(re,{id:p,disabled:s,ref:m,...o}),D("label",{htmlFor:p,className:a(v,e?.label),children:t})]})});ne.displayName="Checkbox";var se=ne;import{icons as me}from"lucide-react";import{jsx as b,jsxs as pe}from"react/jsx-runtime";function ze({icon:e,hasCheckbox:t,isSelected:o,className:m,title:s,value:p,description:v,..._}){let E=e?(x=>{if(x in me){let W=me[x];return b(W,{size:14})}return null})(e):void 0;return pe("li",{className:a("group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",m),..._,"data-state":o?"checked":"unchecked",children:[E&&b("span",{className:"mr-2",children:E}),t&&b(se,{id:p,checked:o,onClick:x=>x.preventDefault()}),pe("div",{children:[b("p",{children:s}),b("p",{className:"text-xs text-grey-80",children:v})]}),b(Ve,{className:"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",size:16})]})}var de=ze;import{cva as Me}from"cva";import{jsx as He}from"react/jsx-runtime";var Oe=Me("rounded-full px-2 py-0.5 text-xs font-semibold",{variants:{variant:{green:"bg-green-90 text-white",pickle:"bg-pickle-100 text-black",purple:"bg-purple-100 text-white"}},defaultVariants:{variant:"green"}});function ce({className:e,variant:t,...o}){return He("div",{className:a(Oe({variant:t}),e),...o})}import{jsx as Ae}from"react/jsx-runtime";function Ge({text:e,className:t,...o}){return e?Ae("label",{className:a("text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...o,children:e}):null}var fe=Ge;import{jsx as n,jsxs as R}from"react/jsx-runtime";var qe=Be((e,t)=>{let{value:o,label:m,options:s,classNames:p,multiselect:v,placeholder:_,variant:I="default",size:E,icon:x,className:W,onChange:L,children:V}=e,[d,T]=ue([]),[J,$]=ue(!1),q=x&&Je[x],ge=s?.length<=5,N=I==="default",he=I==="chip",Q=()=>$(!1);Fe(()=>{T((v?o??[]:o?[o]:[]).map(r=>s.find(c=>c.value===r)).filter(r=>r!==void 0))},[o]);let ve=C=>{let r=s.find(c=>c.value===C);if(r){if(v)return T(c=>{let U=c.some(k=>k.value===C)?c.filter(k=>k!==r):[...c,r];return L?.(U.map(k=>k.value)),U});T([r]),L?.(r.value),Q()}},ye=()=>{T([]),L?.(v?[]:"")},Pe=()=>{let C=d.length>0?d.map(r=>r.title).join(", "):_;return N?C:m};return R("div",{className:a("flex flex-col gap-2",W),children:[N&&m&&n(fe,{text:m,className:p?.label}),R("div",{className:"relative flex",children:[R(te,{open:J,onOpenChange:$,children:[n(oe,{asChild:!0,disabled:s.length===0,children:R("div",{ref:t,className:a(Qe({variant:I,size:E}),d.length>0&&"pr-10",p?.trigger),"aria-expanded":J,children:[N&&q&&n(q,{className:"h-4 w-4 shrink-0"}),he&&d.length>0&&n(ce,{variant:"purple",children:d.length}),n("span",{className:a("w-full truncate leading-normal",N&&d.length==0&&"text-grey-40"),children:Pe()}),d.length==0&&n(Xe,{className:"shrink-0 transform group-data-[state=open]:rotate-180",size:"16"})]})}),n(M,{children:R(F,{className:a("flex w-full max-w-xs flex-col overflow-hidden p-0","max-h-[--radix-popover-content-available-height]",p?.content),collisionPadding:8,sideOffset:4,align:"start",children:[!ge&&n(O,{placeholder:"Search..."}),R(H,{children:[n(G,{children:"No results"}),n(A,{children:s.map(({id:C,...r})=>n(B,{value:r.title,onSelect:ve,children:n(de,{className:a(p?.items,"truncate py-1"),isSelected:d.some(c=>c.value===r.value),hasCheckbox:v,...r})},C))})]}),!!V&&n(K,{}),V&&V({close:Q})]})})]}),N&&d.length>0&&n("button",{type:"button",className:"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",onClick:ye,children:n(Ke,{className:"h-4 w-4 text-green-100"})})]})]})});qe.displayName="Combobox";var Qe=$e("group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5",{variants:{variant:{default:["w-full","max-w-80","rounded-lg"],chip:["font-bold","rounded-3xl","data-[state=open]:bg-black","data-[state=open]:text-white"]},size:{small:["h-8","py-1","px-2","text-xs"],normal:["h-9","py-2","px-3","text-sm"],large:["h-10","py-3","px-4","text-base"]}},defaultVariants:{variant:"default",size:"normal"}});export{qe as Combobox};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/ui/Combobox.tsx
|
|
4
|
+
import { forwardRef as forwardRef6, useEffect, useState } from "react";
|
|
5
|
+
import { ChevronDownIcon, CircleX, icons as icons2 } from "lucide-react";
|
|
6
|
+
import { cva as cva2 } from "cva";
|
|
7
|
+
|
|
8
|
+
// src/lib/utils.ts
|
|
9
|
+
import { clsx } from "clsx";
|
|
10
|
+
import { twMerge } from "tailwind-merge";
|
|
11
|
+
function cn(...inputs) {
|
|
12
|
+
return twMerge(clsx(inputs));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/components/primitives/command.tsx
|
|
16
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
17
|
+
import { Search } from "lucide-react";
|
|
18
|
+
import * as React2 from "react";
|
|
19
|
+
|
|
20
|
+
// src/components/primitives/dialog.tsx
|
|
21
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
22
|
+
import { X } from "lucide-react";
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
26
|
+
var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
27
|
+
DialogPrimitive.Overlay,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
className: cn(
|
|
31
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
38
|
+
var DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
DialogPrimitive.Content,
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
className: cn(
|
|
45
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
...props,
|
|
49
|
+
children: [
|
|
50
|
+
children,
|
|
51
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
54
|
+
] })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] }));
|
|
59
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
60
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
61
|
+
DialogHeader.displayName = "DialogHeader";
|
|
62
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
DialogFooter.displayName = "DialogFooter";
|
|
70
|
+
var DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71
|
+
DialogPrimitive.Title,
|
|
72
|
+
{
|
|
73
|
+
ref,
|
|
74
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
));
|
|
78
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
79
|
+
var DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
80
|
+
DialogPrimitive.Description,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className: cn("text-sm text-neutral-500 dark:text-neutral-400", className),
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
));
|
|
87
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
88
|
+
|
|
89
|
+
// src/components/primitives/command.tsx
|
|
90
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
91
|
+
var Command = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
92
|
+
CommandPrimitive,
|
|
93
|
+
{
|
|
94
|
+
ref,
|
|
95
|
+
className: cn(
|
|
96
|
+
"flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
103
|
+
var CommandInput = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs2("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
|
|
104
|
+
/* @__PURE__ */ jsx2(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
105
|
+
/* @__PURE__ */ jsx2(
|
|
106
|
+
CommandPrimitive.Input,
|
|
107
|
+
{
|
|
108
|
+
ref,
|
|
109
|
+
className: cn(
|
|
110
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 disabled:cursor-not-allowed disabled:opacity-50",
|
|
111
|
+
className
|
|
112
|
+
),
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }));
|
|
117
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
118
|
+
var CommandList = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
119
|
+
CommandPrimitive.List,
|
|
120
|
+
{
|
|
121
|
+
ref,
|
|
122
|
+
className: cn("overflow-y-auto overflow-x-hidden", className),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
));
|
|
126
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
127
|
+
var CommandEmpty = React2.forwardRef((props, ref) => /* @__PURE__ */ jsx2(CommandPrimitive.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
128
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
129
|
+
var CommandGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
130
|
+
CommandPrimitive.Group,
|
|
131
|
+
{
|
|
132
|
+
ref,
|
|
133
|
+
className: cn(
|
|
134
|
+
"overflow-hidden p-1 text-neutral-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500",
|
|
135
|
+
className
|
|
136
|
+
),
|
|
137
|
+
...props
|
|
138
|
+
}
|
|
139
|
+
));
|
|
140
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
141
|
+
var CommandSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
142
|
+
CommandPrimitive.Separator,
|
|
143
|
+
{
|
|
144
|
+
ref,
|
|
145
|
+
className: cn("-mx-1 h-px bg-neutral-200", className),
|
|
146
|
+
...props
|
|
147
|
+
}
|
|
148
|
+
));
|
|
149
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
150
|
+
var CommandItem = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
151
|
+
CommandPrimitive.Item,
|
|
152
|
+
{
|
|
153
|
+
ref,
|
|
154
|
+
className: cn(
|
|
155
|
+
"relative flex cursor-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50",
|
|
156
|
+
className
|
|
157
|
+
),
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
));
|
|
161
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
162
|
+
var CommandShortcut = ({ className, ...props }) => {
|
|
163
|
+
return /* @__PURE__ */ jsx2(
|
|
164
|
+
"span",
|
|
165
|
+
{
|
|
166
|
+
className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
|
|
167
|
+
...props
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
172
|
+
|
|
173
|
+
// src/components/primitives/popover.tsx
|
|
174
|
+
import * as React3 from "react";
|
|
175
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
176
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
177
|
+
var Popover = PopoverPrimitive.Root;
|
|
178
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
179
|
+
var PopoverContent = React3.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx3(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx3(
|
|
180
|
+
PopoverPrimitive.Content,
|
|
181
|
+
{
|
|
182
|
+
ref,
|
|
183
|
+
align,
|
|
184
|
+
sideOffset,
|
|
185
|
+
className: cn(
|
|
186
|
+
"z-50 rounded-2xl border bg-white p-4 text-black shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
187
|
+
className
|
|
188
|
+
),
|
|
189
|
+
...props
|
|
190
|
+
}
|
|
191
|
+
) }));
|
|
192
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
193
|
+
|
|
194
|
+
// src/components/primitives/separator.tsx
|
|
195
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
196
|
+
import * as React4 from "react";
|
|
197
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
198
|
+
var Separator = React4.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
199
|
+
SeparatorPrimitive.Root,
|
|
200
|
+
{
|
|
201
|
+
ref,
|
|
202
|
+
decorative,
|
|
203
|
+
orientation,
|
|
204
|
+
className: cn(
|
|
205
|
+
"shrink-0 bg-grey-10",
|
|
206
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
207
|
+
className
|
|
208
|
+
),
|
|
209
|
+
...props
|
|
210
|
+
}
|
|
211
|
+
));
|
|
212
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
213
|
+
|
|
214
|
+
// src/components/ui/ListItem.tsx
|
|
215
|
+
import { CheckIcon } from "lucide-react";
|
|
216
|
+
|
|
217
|
+
// src/components/ui/Checkbox.tsx
|
|
218
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
219
|
+
import { Check, Minus } from "lucide-react";
|
|
220
|
+
import {
|
|
221
|
+
forwardRef as forwardRef5
|
|
222
|
+
} from "react";
|
|
223
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
224
|
+
var CheckboxToggle = forwardRef5(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
225
|
+
CheckboxPrimitive.Root,
|
|
226
|
+
{
|
|
227
|
+
ref,
|
|
228
|
+
className: cn(
|
|
229
|
+
"group",
|
|
230
|
+
"peer",
|
|
231
|
+
"h-5",
|
|
232
|
+
"w-5",
|
|
233
|
+
"shrink-0",
|
|
234
|
+
"rounded-md",
|
|
235
|
+
"border",
|
|
236
|
+
"border-grey-10",
|
|
237
|
+
"outline",
|
|
238
|
+
"outline-1",
|
|
239
|
+
"outline-offset-2",
|
|
240
|
+
"outline-transparent",
|
|
241
|
+
"hover:border-grey-20",
|
|
242
|
+
"focus:outline-purple-100",
|
|
243
|
+
"active:border-green-80",
|
|
244
|
+
"disabled:cursor-not-allowed",
|
|
245
|
+
"disabled:opacity-50",
|
|
246
|
+
"data-[state=checked]:bg-green-80",
|
|
247
|
+
"data-[state=indeterminate]:bg-green-80",
|
|
248
|
+
"data-[state=checked]:text-white",
|
|
249
|
+
"data-[state=indeterminate]:text-primary-foreground",
|
|
250
|
+
props.disabled && "data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",
|
|
251
|
+
className
|
|
252
|
+
),
|
|
253
|
+
...props,
|
|
254
|
+
children: /* @__PURE__ */ jsxs3(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
|
|
255
|
+
/* @__PURE__ */ jsx5(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
|
|
256
|
+
/* @__PURE__ */ jsx5(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
|
|
257
|
+
] })
|
|
258
|
+
}
|
|
259
|
+
));
|
|
260
|
+
CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
|
|
261
|
+
var Checkbox = forwardRef5(
|
|
262
|
+
({ classNames, children, ...props }, ref) => {
|
|
263
|
+
const { disabled } = props;
|
|
264
|
+
const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
|
|
265
|
+
const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
|
|
266
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
|
|
267
|
+
/* @__PURE__ */ jsx5(CheckboxToggle, { id, disabled, ref, ...props }),
|
|
268
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
|
|
269
|
+
] });
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
Checkbox.displayName = "Checkbox";
|
|
273
|
+
var Checkbox_default = Checkbox;
|
|
274
|
+
|
|
275
|
+
// src/components/ui/ListItem.tsx
|
|
276
|
+
import { icons } from "lucide-react";
|
|
277
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
278
|
+
function ListItem({
|
|
279
|
+
icon,
|
|
280
|
+
hasCheckbox,
|
|
281
|
+
isSelected,
|
|
282
|
+
className,
|
|
283
|
+
title,
|
|
284
|
+
value,
|
|
285
|
+
description,
|
|
286
|
+
...props
|
|
287
|
+
}) {
|
|
288
|
+
const getIconIfValid = (icon2) => {
|
|
289
|
+
if (icon2 in icons) {
|
|
290
|
+
const IconComponent = icons[icon2];
|
|
291
|
+
return /* @__PURE__ */ jsx6(IconComponent, { size: 14 });
|
|
292
|
+
}
|
|
293
|
+
return null;
|
|
294
|
+
};
|
|
295
|
+
const optionIcon = icon ? getIconIfValid(icon) : void 0;
|
|
296
|
+
return /* @__PURE__ */ jsxs4(
|
|
297
|
+
"li",
|
|
298
|
+
{
|
|
299
|
+
className: cn(
|
|
300
|
+
"group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",
|
|
301
|
+
className
|
|
302
|
+
),
|
|
303
|
+
...props,
|
|
304
|
+
"data-state": isSelected ? "checked" : "unchecked",
|
|
305
|
+
children: [
|
|
306
|
+
optionIcon && /* @__PURE__ */ jsx6("span", { className: "mr-2", children: optionIcon }),
|
|
307
|
+
hasCheckbox && /* @__PURE__ */ jsx6(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
308
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
309
|
+
/* @__PURE__ */ jsx6("p", { children: title }),
|
|
310
|
+
/* @__PURE__ */ jsx6("p", { className: "text-xs text-grey-80", children: description })
|
|
311
|
+
] }),
|
|
312
|
+
/* @__PURE__ */ jsx6(
|
|
313
|
+
CheckIcon,
|
|
314
|
+
{
|
|
315
|
+
className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
|
|
316
|
+
size: 16
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
var ListItem_default = ListItem;
|
|
324
|
+
|
|
325
|
+
// src/components/ui/Badge.tsx
|
|
326
|
+
import { cva } from "cva";
|
|
327
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
328
|
+
var badgeVariants = cva("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
329
|
+
variants: {
|
|
330
|
+
variant: {
|
|
331
|
+
green: "bg-green-90 text-white",
|
|
332
|
+
pickle: "bg-pickle-100 text-black",
|
|
333
|
+
purple: "bg-purple-100 text-white"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
defaultVariants: {
|
|
337
|
+
variant: "green"
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
function Badge({ className, variant, ...props }) {
|
|
341
|
+
return /* @__PURE__ */ jsx7("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// src/components/ui/Label.tsx
|
|
345
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
346
|
+
function Label({ text, className, ...props }) {
|
|
347
|
+
if (!text) return null;
|
|
348
|
+
return /* @__PURE__ */ jsx8(
|
|
349
|
+
"label",
|
|
350
|
+
{
|
|
351
|
+
className: cn(
|
|
352
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
353
|
+
className
|
|
354
|
+
),
|
|
355
|
+
...props,
|
|
356
|
+
children: text
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
var Label_default = Label;
|
|
361
|
+
|
|
362
|
+
// src/components/ui/Combobox.tsx
|
|
363
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
364
|
+
var Combobox = forwardRef6((props, ref) => {
|
|
365
|
+
const {
|
|
366
|
+
value,
|
|
367
|
+
label,
|
|
368
|
+
options,
|
|
369
|
+
classNames,
|
|
370
|
+
multiselect,
|
|
371
|
+
placeholder,
|
|
372
|
+
variant = "default",
|
|
373
|
+
size,
|
|
374
|
+
icon,
|
|
375
|
+
className,
|
|
376
|
+
onChange: handleChange,
|
|
377
|
+
children: footer
|
|
378
|
+
} = props;
|
|
379
|
+
const [selected, setSelected] = useState([]);
|
|
380
|
+
const [open, setOpen] = useState(false);
|
|
381
|
+
const IconComponent = icon && icons2[icon];
|
|
382
|
+
const hideSearchBox = options?.length <= 5;
|
|
383
|
+
const isDefault = variant === "default";
|
|
384
|
+
const isChip = variant === "chip";
|
|
385
|
+
const isEmpty = selected.length == 0;
|
|
386
|
+
const showChevron = isDefault ? isEmpty : true;
|
|
387
|
+
const close = () => setOpen(false);
|
|
388
|
+
useEffect(() => {
|
|
389
|
+
const valueArray = multiselect ? value ?? [] : value ? [value] : [];
|
|
390
|
+
setSelected(
|
|
391
|
+
valueArray.map((v) => options.find((o) => o.value === v)).filter((v) => v !== void 0)
|
|
392
|
+
);
|
|
393
|
+
}, [value]);
|
|
394
|
+
const handleSelect = (value2) => {
|
|
395
|
+
const option = options.find((o) => o.value === value2);
|
|
396
|
+
if (!option) return;
|
|
397
|
+
if (multiselect) {
|
|
398
|
+
return setSelected((prev) => {
|
|
399
|
+
const newSelected = prev.some((o) => o.value === value2) ? prev.filter((v) => v !== option) : [...prev, option];
|
|
400
|
+
handleChange?.(newSelected.map((o) => o.value));
|
|
401
|
+
return newSelected;
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
setSelected([option]);
|
|
405
|
+
handleChange?.(option.value);
|
|
406
|
+
close();
|
|
407
|
+
};
|
|
408
|
+
const handleClear = () => {
|
|
409
|
+
setSelected([]);
|
|
410
|
+
multiselect ? handleChange?.([]) : handleChange?.("");
|
|
411
|
+
};
|
|
412
|
+
const handleDisplayValue = () => {
|
|
413
|
+
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
414
|
+
return isDefault ? defaultLabel : label;
|
|
415
|
+
};
|
|
416
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
417
|
+
isDefault && label && /* @__PURE__ */ jsx9(Label_default, { text: label, className: classNames?.label }),
|
|
418
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative flex", children: [
|
|
419
|
+
/* @__PURE__ */ jsxs5(Popover, { open, onOpenChange: setOpen, children: [
|
|
420
|
+
/* @__PURE__ */ jsx9(
|
|
421
|
+
PopoverTrigger,
|
|
422
|
+
{
|
|
423
|
+
asChild: true,
|
|
424
|
+
disabled: options.length === 0,
|
|
425
|
+
"data-testid": `${props.id ?? props.name}-combobox-trigger`,
|
|
426
|
+
children: /* @__PURE__ */ jsxs5(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
ref,
|
|
430
|
+
className: cn(
|
|
431
|
+
triggerVariants({ variant, size }),
|
|
432
|
+
isDefault && !isEmpty && "pr-10",
|
|
433
|
+
classNames?.trigger
|
|
434
|
+
),
|
|
435
|
+
"aria-expanded": open,
|
|
436
|
+
children: [
|
|
437
|
+
isDefault && IconComponent && /* @__PURE__ */ jsx9(IconComponent, { className: "h-4 w-4 shrink-0" }),
|
|
438
|
+
isChip && !isEmpty && /* @__PURE__ */ jsx9(Badge, { variant: "purple", children: selected.length }),
|
|
439
|
+
/* @__PURE__ */ jsx9(
|
|
440
|
+
"span",
|
|
441
|
+
{
|
|
442
|
+
className: cn(
|
|
443
|
+
"w-full truncate leading-normal",
|
|
444
|
+
isDefault && isEmpty && "text-grey-40"
|
|
445
|
+
),
|
|
446
|
+
children: handleDisplayValue()
|
|
447
|
+
}
|
|
448
|
+
),
|
|
449
|
+
showChevron && /* @__PURE__ */ jsx9(
|
|
450
|
+
ChevronDownIcon,
|
|
451
|
+
{
|
|
452
|
+
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
453
|
+
size: "16"
|
|
454
|
+
}
|
|
455
|
+
)
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
}
|
|
460
|
+
),
|
|
461
|
+
/* @__PURE__ */ jsx9(Command, { children: /* @__PURE__ */ jsxs5(
|
|
462
|
+
PopoverContent,
|
|
463
|
+
{
|
|
464
|
+
className: cn(
|
|
465
|
+
"flex w-full max-w-xs flex-col overflow-hidden p-0",
|
|
466
|
+
"max-h-[--radix-popover-content-available-height]",
|
|
467
|
+
classNames?.content
|
|
468
|
+
),
|
|
469
|
+
collisionPadding: 8,
|
|
470
|
+
sideOffset: 4,
|
|
471
|
+
align: "start",
|
|
472
|
+
children: [
|
|
473
|
+
!hideSearchBox && /* @__PURE__ */ jsx9(CommandInput, { placeholder: "Search..." }),
|
|
474
|
+
/* @__PURE__ */ jsxs5(CommandList, { children: [
|
|
475
|
+
/* @__PURE__ */ jsx9(CommandEmpty, { children: "No results" }),
|
|
476
|
+
/* @__PURE__ */ jsx9(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ jsx9(CommandItem, { value: option.value, onSelect: handleSelect, children: /* @__PURE__ */ jsx9(
|
|
477
|
+
ListItem_default,
|
|
478
|
+
{
|
|
479
|
+
className: cn(classNames?.items, "truncate py-1"),
|
|
480
|
+
isSelected: selected.some((s) => s.value === option.value),
|
|
481
|
+
hasCheckbox: multiselect,
|
|
482
|
+
...option
|
|
483
|
+
}
|
|
484
|
+
) }, id)) })
|
|
485
|
+
] }),
|
|
486
|
+
!!footer && /* @__PURE__ */ jsx9(Separator, {}),
|
|
487
|
+
footer && footer({ close })
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
) })
|
|
491
|
+
] }),
|
|
492
|
+
isDefault && !isEmpty && /* @__PURE__ */ jsx9(
|
|
493
|
+
"button",
|
|
494
|
+
{
|
|
495
|
+
type: "button",
|
|
496
|
+
className: "absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
|
|
497
|
+
onClick: handleClear,
|
|
498
|
+
children: /* @__PURE__ */ jsx9(CircleX, { className: "h-4 w-4 text-green-100" })
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
] })
|
|
502
|
+
] });
|
|
503
|
+
});
|
|
504
|
+
Combobox.displayName = "Combobox";
|
|
505
|
+
var triggerVariants = cva2(
|
|
506
|
+
"group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5",
|
|
507
|
+
{
|
|
508
|
+
variants: {
|
|
509
|
+
variant: {
|
|
510
|
+
default: ["w-full", "max-w-80", "rounded-lg"],
|
|
511
|
+
chip: [
|
|
512
|
+
"font-bold",
|
|
513
|
+
"rounded-3xl",
|
|
514
|
+
"data-[state=open]:bg-black",
|
|
515
|
+
"data-[state=open]:text-white"
|
|
516
|
+
]
|
|
517
|
+
},
|
|
518
|
+
size: {
|
|
519
|
+
small: ["h-8", "py-1", "px-2", "text-xs"],
|
|
520
|
+
normal: ["h-9", "py-2", "px-3", "text-sm"],
|
|
521
|
+
large: ["h-10", "py-3", "px-4", "text-base"]
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
defaultVariants: {
|
|
525
|
+
variant: "default",
|
|
526
|
+
size: "normal"
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
export {
|
|
531
|
+
Combobox
|
|
532
|
+
};
|
|
2
533
|
//# sourceMappingURL=Combobox.js.map
|