@xploreu/components 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-4YATKUEK.js +2 -0
- package/dist/chunk-4YATKUEK.js.map +1 -0
- package/dist/chunk-7ASZFFFB.js +2 -0
- package/dist/chunk-7ASZFFFB.js.map +1 -0
- package/dist/chunk-JFJU2DLY.js +2 -0
- package/dist/chunk-JFJU2DLY.js.map +1 -0
- package/dist/chunk-TED2PUK6.js +2 -0
- package/dist/chunk-TED2PUK6.js.map +1 -0
- package/dist/chunk-XXHHZYH6.js +2 -0
- package/dist/chunk-XXHHZYH6.js.map +1 -0
- package/dist/chunk-ZQTWDSKK.js +2 -0
- package/dist/chunk-ZQTWDSKK.js.map +1 -0
- package/dist/composites/combobox-chip-outside.d.ts +40 -0
- package/dist/composites/combobox-chip-outside.js +2 -0
- package/dist/composites/combobox-chip-outside.js.map +1 -0
- package/dist/composites/index.d.ts +43 -0
- package/dist/composites/index.js +2 -0
- package/dist/composites/index.js.map +1 -0
- package/dist/effects/index.js +1 -1
- package/dist/primitives/index.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/ui/badge.d.ts +20 -0
- package/dist/ui/badge.js +2 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/combobox.d.ts +116 -0
- package/dist/ui/combobox.js +2 -0
- package/dist/ui/combobox.js.map +1 -0
- package/dist/ui/index.d.ts +8 -2
- package/dist/ui/index.js +1 -1
- package/dist/ui/infinite-scroll.d.ts +15 -0
- package/dist/ui/infinite-scroll.js +2 -0
- package/dist/ui/infinite-scroll.js.map +1 -0
- package/dist/ui/input.d.ts +17 -0
- package/dist/ui/input.js +2 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/tabs.js +1 -1
- package/package.json +12 -3
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {XIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var m=cva("inline-flex items-center justify-center size-max whitespace-nowrap shrink-0 [&_svg]:size-3 [&>svg]:pointer-events-none overflow-hidden transition-colors ring-1 ring-inset",{variants:{type:{rounded:"rounded-xp-full",square:"rounded-xp-card-base-sm",modern:"rounded-xp-card-base-sm shadow-xp-xs"},color:{gray:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200",brand:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200",error:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200",warning:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200",success:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200","gray-blue":"bg-utility-gray-blue-50 text-utility-gray-blue-700 ring-utility-gray-blue-200","blue-light":"bg-utility-blue-light-50 text-utility-blue-light-700 ring-utility-blue-light-200",blue:"bg-utility-blue-50 text-utility-blue-700 ring-utility-blue-200",indigo:"bg-utility-indigo-50 text-utility-indigo-700 ring-utility-indigo-200",purple:"bg-utility-purple-50 text-utility-purple-700 ring-utility-purple-200",pink:"bg-utility-pink-50 text-utility-pink-700 ring-utility-pink-200",orange:"bg-utility-orange-50 text-utility-orange-700 ring-utility-orange-200"},size:{sm:"text-body-medium-3 py-0.5 has-[[data-slot=badge-close][data-align=inline-end]]:pr-0.75 has-[[data-slot=badge-close][data-align=inline-start]]:pl-0.75",md:"text-body-medium-2 py-0.5 has-[[data-slot=badge-close][data-align=inline-end]]:pr-xp-xs has-[[data-slot=badge-close][data-align=inline-start]]:pl-xp-xs",lg:"text-body-medium-2 py-1 has-[[data-slot=badge-close][data-align=inline-end]]:pr-xp-sm has-[[data-slot=badge-close][data-align=inline-start]]:pl-xp-sm"},icon:{true:void 0,false:void 0}},compoundVariants:[{type:"modern",className:"bg-primary text-secondary ring-primary"},{type:"rounded",size:"sm",className:"px-2"},{type:"rounded",size:"md",className:"px-2.5"},{type:"rounded",size:"lg",className:"px-3"},{type:"square",size:"sm",className:"px-1.5"},{type:"square",size:"md",className:"px-2"},{type:"square",size:"lg",className:"px-2.5"},{type:"modern",size:"sm",className:"px-1.5"},{type:"modern",size:"md",className:"px-2"},{type:"modern",size:"lg",className:"px-2.5"}],defaultVariants:{type:"square",color:"gray",size:"md"}});function z({className:e,type:t,color:i,size:a,icon:n,render:u,...p}){let d={className:cn(m({type:t,color:i,size:a,icon:n}),e)};return useRender({defaultTagName:"span",props:mergeProps(d,p),render:u,state:{slot:"badge",type:t,color:i,size:a,icon:n}})}function P({className:e,render:t,align:i="inline-end",...a}){let n={className:cn("p-0.5",i==="inline-start"?"mr-xp-xxs":"ml-xp-xxs",e),type:"button",children:jsx(XIcon,{})};return useRender({defaultTagName:"button",render:t,props:mergeProps(n,a),state:{slot:"badge-close",align:i}})}function w({className:e,...t}){return jsx("span",{className:cn("size-1.5 m-px shrink-0 rounded-xp-full bg-current",e),...t})}export{m as a,z as b,P as c,w as d};//# sourceMappingURL=chunk-4YATKUEK.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-4YATKUEK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/badge.tsx"],"names":["badgeVariants","cva","Badge","className","type","color","size","icon","render","props","defaultProps","cn","useRender","mergeProps","BadgeButton","align","jsx","XIcon","BadgeDot"],"mappings":"qQASA,IAAMA,EAAgBC,GAAAA,CACpB,4KAAA,CACA,CACE,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,OAAA,CAAW,iBAAA,CACX,OAAU,yBAAA,CACV,MAAA,CAAU,sCACZ,CAAA,CACA,MAAO,CACL,IAAA,CAAM,gEAAA,CACN,KAAA,CAAO,oEACP,KAAA,CAAO,mEAAA,CACP,OAAA,CAAS,yEAAA,CACT,QAAS,yEAAA,CACT,WAAA,CAAa,+EAAA,CACb,YAAA,CAAc,mFACd,IAAA,CAAM,gEAAA,CACN,MAAA,CAAQ,sEAAA,CACR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k-4YATKUEK.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { XIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeVariants = cva(\r\n \"inline-flex items-center justify-center size-max whitespace-nowrap shrink-0 [&_svg]:size-3 [&>svg]:pointer-events-none overflow-hidden transition-colors ring-1 ring-inset\",\r\n {\r\n variants: {\r\n type: {\r\n \"rounded\": \"rounded-xp-full\",\r\n \"square\": \"rounded-xp-card-base-sm\",\r\n \"modern\": \"rounded-xp-card-base-sm shadow-xp-xs\",\r\n },\r\n color: {\r\n gray: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200\",\r\n brand: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200\",\r\n error: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200\",\r\n warning: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200\",\r\n success: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200\",\r\n \"gray-blue\": \"bg-utility-gray-blue-50 text-utility-gray-blue-700 ring-utility-gray-blue-200\",\r\n \"blue-light\": \"bg-utility-blue-light-50 text-utility-blue-light-700 ring-utility-blue-light-200\",\r\n blue: \"bg-utility-blue-50 text-utility-blue-700 ring-utility-blue-200\",\r\n indigo: \"bg-utility-indigo-50 text-utility-indigo-700 ring-utility-indigo-200\",\r\n purple: \"bg-utility-purple-50 text-utility-purple-700 ring-utility-purple-200\",\r\n pink: \"bg-utility-pink-50 text-utility-pink-700 ring-utility-pink-200\",\r\n orange: \"bg-utility-orange-50 text-utility-orange-700 ring-utility-orange-200\",\r\n },\r\n size: {\r\n sm: \"text-body-medium-3 py-0.5 has-[[data-slot=badge-close][data-align=inline-end]]:pr-0.75 has-[[data-slot=badge-close][data-align=inline-start]]:pl-0.75\",\r\n md: \"text-body-medium-2 py-0.5 has-[[data-slot=badge-close][data-align=inline-end]]:pr-xp-xs has-[[data-slot=badge-close][data-align=inline-start]]:pl-xp-xs\",\r\n lg: \"text-body-medium-2 py-1 has-[[data-slot=badge-close][data-align=inline-end]]:pr-xp-sm has-[[data-slot=badge-close][data-align=inline-start]]:pl-xp-sm\",\r\n },\r\n icon: {\r\n true: undefined,\r\n false: undefined,\r\n },\r\n },\r\n compoundVariants: [\r\n {\r\n type: \"modern\",\r\n className: \"bg-primary text-secondary ring-primary\",\r\n },\r\n { type: \"rounded\", size: \"sm\", className: \"px-2\" },\r\n { type: \"rounded\", size: \"md\", className: \"px-2.5\" },\r\n { type: \"rounded\", size: \"lg\", className: \"px-3\" },\r\n { type: \"square\", size: \"sm\", className: \"px-1.5\" },\r\n { type: \"square\", size: \"md\", className: \"px-2\" },\r\n { type: \"square\", size: \"lg\", className: \"px-2.5\" },\r\n { type: \"modern\", size: \"sm\", className: \"px-1.5\" },\r\n { type: \"modern\", size: \"md\", className: \"px-2\" },\r\n { type: \"modern\", size: \"lg\", className: \"px-2.5\" },\r\n ],\r\n defaultVariants: {\r\n type: \"square\",\r\n color: \"gray\",\r\n size: \"md\",\r\n },\r\n }\r\n)\r\n\r\nexport interface BadgeProps\r\n extends Omit<React.ComponentProps<\"span\">, \"color\">,\r\n VariantProps<typeof badgeVariants> {\r\n}\r\n\r\nfunction Badge({\r\n className,\r\n type,\r\n color,\r\n size,\r\n icon,\r\n render,\r\n ...props\r\n}: BadgeProps & useRender.ComponentProps<\"span\">) {\r\n const defaultProps: useRender.ElementProps<\"span\"> = {\r\n className: cn(badgeVariants({ type, color, size, icon }), className),\r\n }\r\n\r\n return useRender({\r\n defaultTagName: \"span\",\r\n props: mergeProps<\"span\">(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge\",\r\n type,\r\n color,\r\n size,\r\n icon,\r\n },\r\n })\r\n}\r\n\r\nfunction BadgeButton({\r\n className,\r\n render,\r\n align = \"inline-end\",\r\n ...props\r\n}: useRender.ComponentProps<\"button\"> & {\r\n align?: \"inline-end\" | \"inline-start\"\r\n}) {\r\n const defaultProps: useRender.ElementProps<\"button\"> = {\r\n className: cn(\"p-0.5\", align === \"inline-start\" ? \"mr-xp-xxs\" : \"ml-xp-xxs\", className),\r\n type: \"button\",\r\n children: (\r\n <XIcon />\r\n ),\r\n }\r\n\r\n return useRender({\r\n defaultTagName: \"button\",\r\n render,\r\n props: mergeProps<\"button\">(defaultProps, props),\r\n state: {\r\n slot: \"badge-close\",\r\n align,\r\n }\r\n })\r\n}\r\n\r\nfunction BadgeDot({\r\n className,\r\n ...props\r\n}: React.ComponentProps<\"span\">) {\r\n return (\r\n <span\r\n className={cn(\"size-1.5 m-px shrink-0 rounded-xp-full bg-current\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport { Badge, BadgeButton, BadgeDot, badgeVariants }\r\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {c,b,d,l,k,m,n,p,u,w,A,H}from'./chunk-JFJU2DLY.js';import {b as b$1}from'./chunk-XXHHZYH6.js';import*as r from'react';import {cn}from'@xploreu/lib/cn';import {SearchIcon,XIcon}from'lucide-react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function j({multiple:z=true,inputPlaceholder:B="Search...",container:q,items:u$1,infiniteScroll:A$1,isPending:H$1,taggable:c$1=false,maxVisible:i,...m$1}){let[h,g]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[b$2,x]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[v,I]=r.useState([]),C=r.useRef(new Set);r.useEffect(()=>{let e=new Set(b$2.map(t=>t.value));I(t=>{let l=t.filter(a=>e.has(a.value));return l.length===t.length?t:(C.current=new Set(l.map(a=>a.value)),l)});},[b$2]);let n$1=h?.toString().trim()??"",U=r.useMemo(()=>n$1?b$2.some(e=>e.value.toLowerCase()===n$1.toLowerCase()):false,[n$1,b$2]),d$1=r.useMemo(()=>!c$1||!n$1?false:!u$1?.some(e=>e.label.toLowerCase()===n$1.toLowerCase()),[c$1,n$1,u$1]),X=r.useMemo(()=>{let e=[...u$1??[],...v];if(d$1){let t={label:n$1,value:n$1,tag:true};return [...e,t]}return e},[u$1,v,d$1,n$1]);return jsxs(c,{...m$1,behavior:"chip-outside",multiple:true,items:c$1?X:u$1,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{if(c$1){let l=e.filter(a=>a?.tag===true&&!C.current.has(a.value));if(l.length>0){for(let a of l)C.current.add(a.value);I(a=>[...a,...l]);}}x(z?e:[e[e.length-1]],t);},onInputValueChange:g,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(b,{render:jsx(b$1,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(d,{nativeButton:false,render:jsx(XIcon,{className:"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer","data-hidden":!h,"data-slot":"combobox-clear-input",onClick:e=>{g("",{reason:"none",event:e.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:B,startContent:jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"})})}),jsx(l,{className:cn(i!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(k,{children:e=>{let t=i!==void 0?e.slice(0,i):e,l=i!==void 0?e.length-i:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(m,{className:cn(i!==void 0&&"min-w-0 shrink"),children:[i!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(n,{})]},a?.value||"")),l>0&&jsxs(m,{className:"shrink-0",children:["+",l]})]})}})})]}),jsxs(p,{container:q,children:[jsx(u,{status:H$1||u$1===void 0?"pending":u$1?.length===0&&!d$1?"empty":null}),jsxs(w,{children:[u$1?.map(e=>jsx(A,{value:{label:e.label,value:e.value},children:jsx("div",{className:"flex items-center gap-2 w-full min-w-0",children:jsx("span",{className:"truncate",children:e.label})})},e.value)),d$1&&jsx(A,{value:{label:n$1,value:n$1,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!U&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:n$1})]})}),jsx(H,{...A$1})]})]})]})}export{j as a};//# sourceMappingURL=chunk-7ASZFFFB.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-7ASZFFFB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/composites/combobox-chip-outside.tsx"],"names":["ComboboxChipOutside","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","createItem","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInput","Input","ComboboxTrigger","XIcon","event","SearchIcon","ComboboxChips","cn","ComboboxValue","visible","overflow","Fragment","ComboboxChip","ComboboxChipRemove","ComboboxContent","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxInfiniteScroll"],"mappings":"iUA4CA,SAASA,CAAAA,CAAgF,CACvF,QAAA,CAAAC,EAAW,IAAA,CACX,gBAAA,CAAAC,CAAAA,CAAmB,WAAA,CACnB,UAAAC,CAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,cAAA,CAAAC,GAAAA,CACA,SAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,IAAW,KAAA,CACX,UAAA,CAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAAoC,CAClC,GAAM,CAACC,EAAYC,CAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACr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9C,GAAAA,EAAaF,GAAAA,GAAU,MAAA,CACnB,SAAA,CACAA,KAAO,MAAA,GAAW,CAAA,EAAK,CAACqB,GAAAA,CACtB,QACA,IAAA,CAEV,CAAA,CACAI,IAAAA,CAACwB,CAAAA,CAAA,CACE,QAAA,CAAA,CAAAjD,GAAAA,EAAO,GAAA,CAAKkB,CAAAA,EACXc,GAAAA,CAACkB,CAAAA,CAAA,CAEC,KAAA,CAAO,CAAE,KAAA,CAAOhC,CAAAA,CAAK,KAAA,CAAO,KAAA,CAAOA,EAAK,KAAM,CAAA,CAE9C,QAAA,CAAAc,GAAAA,CAAC,OAAI,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAA,GAAAA,CAAC,QAAK,SAAA,CAAU,UAAA,CACb,QAAA,CAAAd,CAAAA,CAAK,MACR,CAAA,CACF,CAAA,CAAA,CAPKA,CAAAA,CAAK,KAQZ,CACD,CAAA,CACAG,GAAAA,EACCW,GAAAA,CAACkB,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,KAAA,CAAO/B,GAAAA,CAAc,KAAA,CAAOA,GAAAA,CAAc,GAAA,CAAK,IAAK,EAE7D,QAAA,CAAAM,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,2CACZ,QAAA,CAAA,CAAA,CAACL,CAAAA,EACAY,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,qBAAA,CAAsB,QAAA,CAAA,SAAA,CAAO,CAAA,CAE/CA,GAAAA,CAAC,QAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAb,GAAAA,CACH,GACF,CAAA,CACF,CAAA,CAEFa,GAAAA,CAACmB,CAAAA,CAAA,CAAwB,GAAGlD,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-7ASZFFFB.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { ComboboxInput as ComboboxInputPrimitive } from \"../primitives/combobox\"\r\nimport { Input } from \"../ui\"\r\nimport {\r\n Combobox,\r\n ComboboxChip,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxContent,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps\r\n} from \"../ui/combobox\"\r\nimport { SearchIcon, XIcon } from \"lucide-react\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\n\r\ntype ComboboxChipOutsideProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChipOutside<Value extends { label: string; value: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipOutsideProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n // Determine if the current input has no exact match in existing items\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n const createItem = {\r\n label: trimmedInput,\r\n value: trimmedInput,\r\n tag: true,\r\n }\r\n return [...base, createItem]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n // Capture newly created taggable items internally\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true\r\n && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n // if multiple is false, we need to replace the value with the new value instead of adding to it\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n <div className=\"flex flex-col gap-2\">\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className=\"h-9 text-body-regular-3 pl-9 pr-7\"\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={inputPlaceholder}\r\n startContent={<SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n />\r\n }\r\n />\r\n <ComboboxChips\r\n className={cn(maxVisible !== undefined && \"flex-nowrap overflow-hidden\")}\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChip\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChip className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChip>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n <ComboboxContent container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={{ label: item.label, value: item.value }}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n <span className=\"truncate\">\r\n {item.label}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxContent>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1,c as c$1}from'./chunk-4YATKUEK.js';import {a as a$1}from'./chunk-TED2PUK6.js';import {a,b}from'./chunk-XXHHZYH6.js';import {b as b$2,c as c$2}from'./chunk-KYD4ATTG.js';import*as H from'react';import {SearchIcon,XIcon,Loader2Icon,CheckCircle2Icon}from'lucide-react';import {Combobox}from'@base-ui/react/combobox';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {useDataState}from'@xploreu/hooks/use-data-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {cn}from'@xploreu/lib/cn';var[no,c]=getStrictContext("ComboboxContext"),[Co,T]=getStrictContext("ComboboxActiveValueContext");function k({behavior:o="default",...t}){let[b,m]=useControlledState({value:t?.open,defaultValue:t?.defaultOpen,onChange:t?.onOpenChange}),[s,C]=useControlledState({value:t?.inputValue?.toString(),defaultValue:t?.defaultInputValue?.toString(),onChange:t?.onInputValueChange}),[a,P]=H.useState(null),l=(x,n)=>{if(n.reason==="input-clear")return n.cancel();C(x,n);},h=(x,n)=>{let po=n.trigger?.dataset;if(o==="chip-outside"&&(n.reason==="trigger-press"&&po?.slot==="combobox-clear-input"&&!x||n.reason==="item-press"))return n.cancel();m(x,n);};return jsx(Co,{value:{highlightedValue:a,setHighlightedValue:P},children:jsx(no,{value:{open:b,setOpen:m,inputValue:s,setInputValue:C},children:jsx(Combobox.Root,{"data-slot":"combobox",...t,onInputValueChange:l,onOpenChange:h})})})}function A(o){return jsx(Combobox.Trigger,{"data-slot":"combobox-trigger",...o})}function M(o){return jsx(Combobox.Label,{"data-slot":"combobox-label",...o})}function B(o){return jsx(Combobox.InputGroup,{"data-slot":"combobox-input-group",...o})}function v(o){return jsx(Combobox.Input,{"data-slot":"combobox-input",...o})}function E(o){return jsx(Combobox.Icon,{"data-slot":"combobox-icon",...o})}function O(o){return jsx(Combobox.Clear,{"data-slot":"combobox-clear",...o})}function z(o){return jsx(Combobox.Value,{"data-slot":"combobox-value",...o})}function F(o){return jsx(Combobox.Chips,{"data-slot":"combobox-chips",...o})}function q(o){return jsx(Combobox.Chip,{"data-slot":"combobox-chip",...o})}function U(o){return jsx(Combobox.ChipRemove,{"data-slot":"combobox-chip-remove",...o})}function y(o){let{open:t}=c();return jsx(AnimatePresence,{children:t&&jsx(Combobox.Portal,{"data-slot":"combobox-portal",keepMounted:true,...o})})}function d(o){return jsx(Combobox.Positioner,{"data-slot":"combobox-positioner",...o})}function g({initialFocus:o,finalFocus:t,transition:b={type:"spring",stiffness:300,damping:25},...m}){return jsx(Combobox.Popup,{finalFocus:t,initialFocus:o,render:jsx(motion.div,{animate:{opacity:1,scale:1},"data-slot":"combobox-popup",exit:{opacity:0,scale:.5},initial:{opacity:0,scale:.5},transition:b,...m},"combobox-popup")})}function X(o){return jsx(Combobox.Backdrop,{"data-slot":"combobox-backdrop",...o})}function $(o){return jsx(Combobox.Status,{"data-slot":"combobox-status",...o})}function J(o){return jsx(Combobox.Empty,{"data-slot":"combobox-empty",...o})}function K(o){return jsx(Combobox.List,{"data-slot":"combobox-list",...o})}function Q({transition:o={type:"spring",stiffness:350,damping:35},...t}){let{highlightedValue:b}=T();return jsx(b$2,{click:false,controlledItems:true,"data-slot":"combobox-highlight",transition:o,value:b,...t})}function W(o){return jsx(c$2,{"data-slot":"combobox-highlight-item",...o})}function Y(o){return jsx(Combobox.Row,{"data-slot":"combobox-row",...o})}function Z(o){let{setHighlightedValue:t}=T(),[,b]=useDataState("highlighted",void 0,(m,s)=>{if(m===true){let C=s.current,a=C?.dataset.value||C?.id||null;a&&t(a);}});return jsx(Combobox.Item,{ref:b,"data-slot":"combobox-item",...o})}function _(o){return jsx(Combobox.ItemIndicator,{"data-slot":"combobox-item-indicator",...o})}function j(o){return jsx(Combobox.Separator,{"data-slot":"combobox-separator",...o})}function D(o){return jsx(Combobox.Group,{"data-slot":"combobox-group",...o})}function oo(o){return jsx(Combobox.GroupLabel,{"data-slot":"combobox-group-label",...o})}function to(o){return jsx(Combobox.Collection,{"data-slot":"combobox-collection",...o})}function eo(o){return jsx(Combobox.Arrow,{"data-slot":"combobox-arrow",...o})}function Oo(o){return jsx(k,{...o})}function lo(o){let{className:t,...b}=o;return jsx(A,{className:cn("group/combobox-trigger flex items-center gap-2",t),...b})}function zo(o){let{className:t,...b}=o;return jsx(M,{className:cn("text-label-semibold-2 text-text-secondary",t),...b})}function Fo(o){let{className:t,...b}=o;return jsx(B,{className:cn("flex w-full items-center gap-2",t),...b})}function qo(o){let{className:t,...b}=o;return jsx(v,{className:cn(a(),t),...b})}function Uo({className:o,displayValueKey:t={label:"label",value:"value"},placeholder:b$1="Search and Select Company",inputProps:m,...s}){let{inputValue:C,setInputValue:a}=c(),{className:P,startContent:l,...h}=m||{};return jsxs("div",{className:cn("flex flex-col gap-2",o),children:[jsx(v,{render:jsx(b,{className:cn("h-9 text-body-regular-3 pl-9 pr-7",P),endContent:jsx(lo,{nativeButton:false,render:jsx(XIcon,{className:"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer","data-hidden":!C,"data-slot":"combobox-clear-input",onClick:x=>{a("",{reason:"none",event:x.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:b$1,startContent:l??jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),...h}),...s}),jsx(co,{onMouseDown:x=>x.preventBaseUIHandler(),children:jsx(uo,{children:x=>x?.map(n=>jsxs(yo,{children:[n?.[t.label]||"",jsx(go,{})]},n?.[t.value]||""))})})]})}function Xo(o){let{className:t,...b}=o;return jsx(E,{className:cn("text-text-secondary",t),...b})}function $o(o){return jsx(O,{render:jsx(XIcon,{}),...o})}function uo(o){return jsx(z,{...o})}function co({className:o,...t}){return jsx(F,{className:cn("flex flex-wrap gap-2",o),...t})}function yo({className:o,...t}){return jsx(b$1,{className:cn("ring-2 ring-border-brand text-body-medium-3",o),color:"brand",render:jsx(q,{...t}),size:"lg"})}function go({className:o,...t}){return jsx(c$1,{className:cn("text-fg-quaternary",o),render:jsx(U,{...t})})}function Jo({className:o,align:t="center",sideOffset:b=4,initialFocus:m,finalFocus:s,style:C,children:a,...P}){return jsx(y,{children:jsx(d,{align:t,className:"z-50",positionMethod:"fixed",sideOffset:b,...P,children:jsx(g,{className:cn("bg-bg-primary text-text-primary w-72 rounded-md border p-4 shadow-md outline-hidden origin-(--transform-origin)",o),finalFocus:s,initialFocus:m,style:C,children:jsx(io,{children:a})})})})}function Ko({className:o,align:t="center",sideOffset:b=4,container:m,initialFocus:s,finalFocus:C,style:a,children:P,...l}){return jsx(y,{container:m,children:jsx(d,{align:t,className:"isolate z-200",sideOffset:b,...l,children:jsx(g,{className:cn("group/combobox-content bg-bg-primary text-text-primary max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary p-xp-xs shadow-md outline-hidden",o),finalFocus:C,initialFocus:s,style:a,children:jsx(io,{children:P})})})})}function Qo(o){return jsx(y,{...o})}function Wo(o){return jsx(d,{...o})}function Yo({className:o,...t}){return jsx(g,{className:cn("bg-bg-primary text-text-primary w-72 rounded-md border shadow-md outline-hidden origin-(--transform-origin)",o),...t})}function Zo(o){let{className:t,...b}=o;return jsx(X,{className:cn("bg-black/30",t),...b})}function _o({className:o,status:t,...b}){let{inputValue:m}=c(),s=m?.toString().trim(),a=t==="empty"&&s?`No matches for "${s}".`:t==="empty"&&!s?"No results.":t==="pending"?jsxs(Fragment,{children:[jsx(Loader2Icon,{className:"animate-spin size-4"}),jsx("span",{children:"Searching..."})]}):null;return jsx($,{className:cn("px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2",!a&&"hidden",o),...b,children:a})}function jo({className:o,...t}){return jsx(J,{className:cn("px-3 py-2 text-body-regular-2 text-text-secondary",o),...t})}function Do({className:o,...t}){return jsx(K,{className:cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col gap-xp-sm",o),...t})}function io(o){let{className:t,...b}=o;return jsx(Q,{className:cn("absolute inset-0 rounded-md bg-bg-primary-hover",t),...b})}function ho(o){return jsx(W,{...o})}function ot(o){let{className:t,...b}=o;return jsx(Y,{className:cn("group/combobox-row",t),...b})}function tt({className:o,children:t,...b}){let{disabled:m}=b;return jsx(ho,{activeClassName:"bg-bg-primary-hover",disabled:m,children:jsxs(Z,{className:cn("flex w-full cursor-default items-center gap-xp-md rounded-md px-xp-md py-2.5 text-body-medium-2 text-text-primary outline-none",o),...b,children:[t,jsx(vo,{children:jsx(CheckCircle2Icon,{className:"size-5 text-fg-brand-primary shrink-0"})})]})})}function vo(o){return jsx(_,{...o})}function et(o){let{className:t,...b}=o;return jsx(j,{className:cn("my-1 h-px bg-border-primary",t),...b})}function bt(o){let{className:t,...b}=o;return jsx(D,{className:cn("py-1",t),...b})}function rt(o){let{className:t,...b}=o;return jsx(oo,{className:cn("px-3 py-1 text-body-semibold-sm text-text-secondary",t),...b})}function it(o){return jsx(to,{...o})}function pt(o){let{className:t,...b}=o;return jsx(eo,{className:cn("fill-bg-primary",t),...b})}function mt({hasMore:o,threshold:t=.5,...b}){return jsx(a$1,{hasMore:o,threshold:t,...b,children:o&&jsxs("div",{className:"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2",children:[jsx(Loader2Icon,{className:"animate-spin size-4"}),jsx("span",{children:"Loading more..."})]})})}export{tt as A,vo as B,et as C,bt as D,rt as E,it as F,pt as G,mt as H,B as a,v as b,Oo as c,lo as d,zo as e,Fo as f,qo as g,Uo as h,Xo as i,$o as j,uo as k,co as l,yo as m,go as n,Jo as o,Ko as p,Qo as q,Wo as r,Yo as s,Zo as t,_o as u,jo as v,Do as w,io as x,ho as y,ot as z};//# sourceMappingURL=chunk-JFJU2DLY.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-JFJU2DLY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/primitives/combobox.tsx","../src/ui/combobox.tsx"],"names":["ComboboxProvider","useCombobox","getStrictContext","ComboboxActiveValueProvider","useComboboxActiveValue","Combobox","behavior","props","open","setOpen","useControlledState","inputValue","setInputValue","highlightedValue","setHighlightedValue","handleInputValueChange","eventDetails","handleOpenChange","dataSet","jsx","ComboboxPrimitive","ComboboxTrigger","ComboboxLabel","ComboboxInputGroup","ComboboxInput","ComboboxIcon","ComboboxClear","ComboboxValue","ComboboxChips","ComboboxChip","ComboboxChipRemove","ComboboxPortal","AnimatePresence","ComboboxPositioner","ComboboxPopup","initialFocus","finalFocus","transition","motion","ComboboxBackdrop","ComboboxStatus","ComboboxEmpty","ComboboxList","ComboboxHighlight","Highlight","ComboboxHighlightItem","HighlightItem","ComboboxRow","ComboboxItem","highlightedRef","useDataState","value","ref","el","v","ComboboxItemIndicator","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","className","rest","cn","inputVariants","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputClassName","startContent","restInputProps","jsxs","Input","XIcon","event","SearchIcon","e","item","Badge","BadgeButton","ComboboxPanel","align","sideOffset","style","children","ComboboxContent","container","status","trimmedInputValue","text","Fragment","Loader2Icon","disabled","CheckCircle2Icon","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"2oBAiCA,GAAM,CAACA,EAAAA,CAAkBC,CAAW,CAAA,CAClCC,gBAAAA,CAA+C,iBAAiB,EAE5D,CAACC,EAAAA,CAA6BC,CAAsB,CAAA,CACxDF,gBAAAA,CAAiD,4BAA4B,EAM/E,SAASG,CAAAA,CAA8D,CACrE,QAAA,CAAAC,CAAAA,CAAW,UACX,GAAGC,CACL,CAAA,CAAmC,CACjC,GAAM,CAACC,EAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,KACd,YAAA,CAAcA,CAAAA,EAAO,WAAA,CACrB,QAAA,CAAUA,CAAAA,EAAO,YACnB,CAAC,CAAA,CAEK,CAACI,CAAAA,CAAYC,CAAa,CAAA,CAAIF,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,CAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,GAAO,iBAAA,EAAmB,QAAA,EAAS,CACjD,QAAA,CAAUA,CAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACM,CAAAA,CAAkBC,CAAm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OY,GAAAA,CAACyC,EAAAA,CAAA,CACN,SAAA,CAAWG,EAAAA,CAAG,kBAAmBF,CAAS,CAAA,CACzC,GAAGC,CAAAA,CACN,CACF,CAEA,SAASiC,EAAAA,CAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,GACZ,GAAG1F,CACL,CAAA,CAAkE,CAChE,OACEY,GAAAA,CAAC+E,IAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAG1F,EAEH,QAAA,CAAAyF,CAAAA,EACCxB,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,UAAArD,GAAAA,CAACyE,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,CAAA,CAC7CzE,IAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,CAAA,CAEJ,CAEJ","file":"chunk-JFJU2DLY.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\r\nimport {\r\n AnimatePresence,\r\n type HTMLMotionProps,\r\n motion\r\n} from \"motion/react\"\r\n\r\nimport {\r\n Highlight,\r\n HighlightItem,\r\n type HighlightItemProps,\r\n type HighlightProps,\r\n} from \"../effects/highlight\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { useDataState } from \"@xploreu/hooks/use-data-state\"\r\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\r\n\r\ntype ComboboxContextType<Value, Multiple extends boolean | undefined = false> = {\r\n open: ComboboxProps<Value, Multiple>[\"open\"];\r\n setOpen: NonNullable<ComboboxProps<Value, Multiple>[\"onOpenChange\"]>;\r\n inputValue: ComboboxProps<Value, Multiple>[\"inputValue\"];\r\n setInputValue: NonNullable<ComboboxProps<Value, Multiple>[\"onInputValueChange\"]>;\r\n}\r\n\r\ntype ComboboxActiveValueContextType = {\r\n highlightedValue: string | null;\r\n setHighlightedValue: (value: string | null) => void;\r\n}\r\n\r\nconst [ComboboxProvider, useCombobox] =\r\n getStrictContext<ComboboxContextType<unknown>>(\"ComboboxContext\")\r\n\r\nconst [ComboboxActiveValueProvider, useComboboxActiveValue] =\r\n getStrictContext<ComboboxActiveValueContextType>(\"ComboboxActiveValueContext\")\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<Value, Multiple> & {\r\n behavior?: \"default\" | \"chip-outside\";\r\n}\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>({\r\n behavior = \"default\",\r\n ...props\r\n}: ComboboxProps<Value, Multiple>) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n })\r\n\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [highlightedValue, setHighlightedValue] = React.useState<string | null>(null)\r\n\r\n const handleInputValueChange: ComboboxProps<Value, Multiple>[\"onInputValueChange\"] = (inputValue, eventDetails) => {\r\n // if the input is cleared, we want to cancel the event to prevent resetting the input value.\r\n if (eventDetails.reason === \"input-clear\") return eventDetails.cancel()\r\n\r\n setInputValue(inputValue, eventDetails)\r\n }\r\n\r\n const handleOpenChange: ComboboxProps<Value, Multiple>[\"onOpenChange\"] = (open, eventDetails) => {\r\n const dataSet = (eventDetails.trigger as HTMLElement)?.dataset\r\n\r\n\r\n if (behavior === \"chip-outside\") {\r\n if (\r\n eventDetails.reason === \"trigger-press\" &&\r\n dataSet?.slot === \"combobox-clear-input\" &&\r\n !open\r\n ) {\r\n return eventDetails.cancel()\r\n }\r\n\r\n if (eventDetails.reason === \"item-press\") {\r\n return eventDetails.cancel()\r\n }\r\n }\r\n\r\n setOpen(open, eventDetails)\r\n }\r\n\r\n return (\r\n <ComboboxActiveValueProvider value={{ highlightedValue, setHighlightedValue }}>\r\n <ComboboxProvider value={{ open, setOpen, inputValue, setInputValue }}>\r\n <ComboboxPrimitive.Root\r\n data-slot=\"combobox\"\r\n {...props}\r\n onInputValueChange={handleInputValueChange}\r\n onOpenChange={handleOpenChange}\r\n />\r\n </ComboboxProvider>\r\n </ComboboxActiveValueProvider>\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n return <ComboboxPrimitive.Trigger\r\n data-slot=\"combobox-trigger\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxPrimitive.Label.Props\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n return <ComboboxPrimitive.Label\r\n data-slot=\"combobox-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxPrimitive.InputGroup.Props\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n return <ComboboxPrimitive.InputGroup\r\n data-slot=\"combobox-input-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxPrimitive.Input.Props\r\n\r\nfunction ComboboxInput(props: ComboboxInputProps) {\r\n return <ComboboxPrimitive.Input\r\n data-slot=\"combobox-input\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxPrimitive.Icon.Props\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n return <ComboboxPrimitive.Icon\r\n data-slot=\"combobox-icon\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxPrimitive.Clear.Props\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n return <ComboboxPrimitive.Clear\r\n data-slot=\"combobox-clear\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxPrimitive.Value.Props\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxPrimitive.Value\r\n data-slot=\"combobox-value\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxPrimitive.Chips.Props\r\n\r\nfunction ComboboxChips(props: ComboboxChipsProps) {\r\n return <ComboboxPrimitive.Chips\r\n data-slot=\"combobox-chips\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxPrimitive.Chip.Props\r\n\r\nfunction ComboboxChip(props: ComboboxChipProps) {\r\n return <ComboboxPrimitive.Chip\r\n data-slot=\"combobox-chip\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxPrimitive.ChipRemove.Props\r\n\r\nfunction ComboboxChipRemove(props: ComboboxChipRemoveProps) {\r\n return <ComboboxPrimitive.ChipRemove\r\n data-slot=\"combobox-chip-remove\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxPortalProps = Omit<\r\n ComboboxPrimitive.Portal.Props,\r\n \"keepMounted\"\r\n>\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n const { open } = useCombobox()\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <ComboboxPrimitive.Portal\r\n data-slot=\"combobox-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n )\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPrimitive.Positioner.Props\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return (\r\n <ComboboxPrimitive.Positioner\r\n data-slot=\"combobox-positioner\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = Omit<\r\n ComboboxPrimitive.Popup.Props,\r\n \"render\"\r\n> &\r\n HTMLMotionProps<\"div\">\r\n\r\nfunction ComboboxPopup({\r\n initialFocus,\r\n finalFocus,\r\n transition = { type: \"spring\", stiffness: 300, damping: 25 },\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPrimitive.Popup\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n render={\r\n <motion.div\r\n key=\"combobox-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\r\n data-slot=\"combobox-popup\"\r\n exit={{ opacity: 0, scale: 0.5 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxPrimitive.Backdrop.Props\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n return <ComboboxPrimitive.Backdrop\r\n data-slot=\"combobox-backdrop\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxPrimitive.Status.Props\r\n\r\nfunction ComboboxStatus(props: ComboboxStatusProps) {\r\n return <ComboboxPrimitive.Status\r\n data-slot=\"combobox-status\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\r\n\r\nfunction ComboboxEmpty(props: ComboboxEmptyProps) {\r\n return <ComboboxPrimitive.Empty\r\n data-slot=\"combobox-empty\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxPrimitive.List.Props\r\n\r\nfunction ComboboxList(props: ComboboxListProps) {\r\n return <ComboboxPrimitive.List\r\n data-slot=\"combobox-list\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxHighlightProps = Omit<\r\n HighlightProps,\r\n \"controlledItems\" | \"enabled\" | \"hover\"\r\n>\r\n\r\nfunction ComboboxHighlight({\r\n transition = { type: \"spring\", stiffness: 350, damping: 35 },\r\n ...props\r\n}: ComboboxHighlightProps) {\r\n const { highlightedValue } = useComboboxActiveValue()\r\n\r\n return (\r\n <Highlight\r\n click={false}\r\n controlledItems\r\n data-slot=\"combobox-highlight\"\r\n transition={transition}\r\n value={highlightedValue}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = HighlightItemProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return (\r\n <HighlightItem\r\n data-slot=\"combobox-highlight-item\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxPrimitive.Row.Props\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n return <ComboboxPrimitive.Row\r\n data-slot=\"combobox-row\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxPrimitive.Item.Props\r\n\r\nfunction ComboboxItem(props: ComboboxItemProps) {\r\n const { setHighlightedValue } = useComboboxActiveValue()\r\n const [, highlightedRef] = useDataState<HTMLDivElement>(\r\n \"highlighted\",\r\n undefined,\r\n (value, ref) => {\r\n if (value === true) {\r\n const el = ref.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n }\r\n },\r\n )\r\n\r\n return <ComboboxPrimitive.Item\r\n ref={highlightedRef}\r\n data-slot=\"combobox-item\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxPrimitive.ItemIndicator.Props\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return <ComboboxPrimitive.ItemIndicator\r\n data-slot=\"combobox-item-indicator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n return <ComboboxPrimitive.Separator\r\n data-slot=\"combobox-separator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxPrimitive.Group.Props\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n return <ComboboxPrimitive.Group\r\n data-slot=\"combobox-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxPrimitive.GroupLabel.Props\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n return <ComboboxPrimitive.GroupLabel\r\n data-slot=\"combobox-group-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxPrimitive.Collection\r\n data-slot=\"combobox-collection\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxPrimitive.Arrow.Props\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n return <ComboboxPrimitive.Arrow\r\n data-slot=\"combobox-arrow\"\r\n {...props}\r\n />\r\n}\r\n\r\nexport {\r\n Combobox,\r\n type ComboboxActiveValueContextType,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n type ComboboxContextType,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInput,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps,\r\n useCombobox,\r\n useComboboxActiveValue,\r\n}","import * as React from \"react\"\r\n\r\nimport {\r\n CheckCircle2Icon,\r\n Loader2Icon,\r\n SearchIcon,\r\n XIcon\r\n} from \"lucide-react\"\r\n\r\nimport {\r\n Combobox as ComboboxPrimitive,\r\n ComboboxArrow as ComboboxArrowPrimitive,\r\n type ComboboxArrowProps as ComboboxArrowPrimitiveProps,\r\n ComboboxBackdrop as ComboboxBackdropPrimitive,\r\n type ComboboxBackdropProps as ComboboxBackdropPrimitiveProps,\r\n ComboboxChip as ComboboxChipPrimitive,\r\n type ComboboxChipProps as ComboboxChipPrimitiveProps,\r\n ComboboxChipRemove as ComboboxChipRemovePrimitive,\r\n type ComboboxChipRemoveProps as ComboboxChipRemovePrimitiveProps,\r\n ComboboxChips as ComboboxChipsPrimitive,\r\n type ComboboxChipsProps as ComboboxChipsPrimitiveProps,\r\n ComboboxClear as ComboboxClearPrimitive,\r\n type ComboboxClearProps as ComboboxClearPrimitiveProps,\r\n ComboboxCollection as ComboboxCollectionPrimitive,\r\n type ComboboxCollectionProps as ComboboxCollectionPrimitiveProps,\r\n ComboboxEmpty as ComboboxEmptyPrimitive,\r\n type ComboboxEmptyProps as ComboboxEmptyPrimitiveProps,\r\n ComboboxGroup as ComboboxGroupPrimitive,\r\n ComboboxGroupLabel as ComboboxGroupLabelPrimitive,\r\n type ComboboxGroupLabelProps as ComboboxGroupLabelPrimitiveProps,\r\n type ComboboxGroupProps as ComboboxGroupPrimitiveProps,\r\n ComboboxHighlight as ComboboxHighlightPrimitive,\r\n ComboboxHighlightItem as ComboboxHighlightItemPrimitive,\r\n type ComboboxHighlightItemProps as ComboboxHighlightItemPrimitiveProps,\r\n type ComboboxHighlightProps as ComboboxHighlightPrimitiveProps,\r\n ComboboxIcon as ComboboxIconPrimitive,\r\n type ComboboxIconProps as ComboboxIconPrimitiveProps,\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup as ComboboxInputGroupPrimitive,\r\n type ComboboxInputGroupProps as ComboboxInputGroupPrimitiveProps,\r\n type ComboboxInputProps as ComboboxInputPrimitiveProps,\r\n ComboboxItem as ComboboxItemPrimitive,\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive,\r\n type ComboboxItemIndicatorProps as ComboboxItemIndicatorPrimitiveProps,\r\n type ComboboxItemProps as ComboboxItemPrimitiveProps,\r\n ComboboxLabel as ComboboxLabelPrimitive,\r\n type ComboboxLabelProps as ComboboxLabelPrimitiveProps,\r\n ComboboxList as ComboboxListPrimitive,\r\n type ComboboxListProps as ComboboxListPrimitiveProps,\r\n ComboboxPopup as ComboboxPopupPrimitive,\r\n type ComboboxPopupProps as ComboboxPopupPrimitiveProps,\r\n ComboboxPortal as ComboboxPortalPrimitive,\r\n type ComboboxPortalProps as ComboboxPortalPrimitiveProps,\r\n ComboboxPositioner as ComboboxPositionerPrimitive,\r\n type ComboboxPositionerProps as ComboboxPositionerPrimitiveProps,\r\n type ComboboxProps as ComboboxPrimitiveProps,\r\n ComboboxRow as ComboboxRowPrimitive,\r\n type ComboboxRowProps as ComboboxRowPrimitiveProps,\r\n ComboboxSeparator as ComboboxSeparatorPrimitive,\r\n type ComboboxSeparatorProps as ComboboxSeparatorPrimitiveProps,\r\n ComboboxStatus as ComboboxStatusPrimitive,\r\n type ComboboxStatusProps as ComboboxStatusPrimitiveProps,\r\n ComboboxTrigger as ComboboxTriggerPrimitive,\r\n type ComboboxTriggerProps as ComboboxTriggerPrimitiveProps,\r\n ComboboxValue as ComboboxValuePrimitive,\r\n type ComboboxValueProps as ComboboxValuePrimitiveProps,\r\n useCombobox,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input, inputVariants } from \"./input\"\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitiveProps<Value, Multiple>\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\r\n return (\r\n <ComboboxPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxTriggerPrimitiveProps\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxTriggerPrimitive\r\n className={cn(\r\n \"group/combobox-trigger flex items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxLabelPrimitiveProps\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxLabelPrimitive\r\n className={cn(\r\n \"text-label-semibold-2 text-text-secondary\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxInputGroupPrimitiveProps\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputGroupPrimitive\r\n className={cn(\r\n \"flex w-full items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxInputPrimitiveProps\r\n\r\nfunction ComboboxInput(props: ComboboxInputProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputPrimitive\r\n className={cn(inputVariants(), className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInputFilter({\r\n className,\r\n displayValueKey = { label: \"label\", value: \"value\" },\r\n placeholder = \"Search and Select Company\",\r\n inputProps,\r\n ...props\r\n}: ComboboxInputProps & {\r\n displayValueKey?: {\r\n label: string\r\n value: string\r\n }\r\n placeholder?: string\r\n inputProps?: React.ComponentProps<typeof Input>\r\n}) {\r\n const { inputValue, setInputValue } = useCombobox()\r\n const { className: inputClassName, startContent, ...restInputProps } = inputProps || {}\r\n\r\n return (\r\n <div className={cn(\"flex flex-col gap-2\", className)}>\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className={cn(\"h-9 text-body-regular-3 pl-9 pr-7\", inputClassName)}\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={placeholder}\r\n startContent={startContent ?? <SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n {...restInputProps}\r\n />\r\n }\r\n {...props}\r\n />\r\n <ComboboxChips onMouseDown={(e) => e.preventBaseUIHandler()}>\r\n <ComboboxValue>\r\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\r\n {(value) => value?.map((item: any) => (\r\n <ComboboxChip key={item?.[displayValueKey.value] || \"\"}>\r\n {item?.[displayValueKey.label] || \"\"}\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxIconPrimitiveProps\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxIconPrimitive\r\n className={cn(\"text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxClearPrimitiveProps\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n\r\n return (\r\n <ComboboxClearPrimitive\r\n render={<XIcon />}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxValuePrimitiveProps\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxValuePrimitive {...props} />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxChipsPrimitiveProps\r\n\r\nfunction ComboboxChips({\r\n className,\r\n ...props\r\n}: ComboboxChipsProps) {\r\n return <ComboboxChipsPrimitive\r\n className={cn(\"flex flex-wrap gap-2\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxChipPrimitiveProps\r\n\r\nfunction ComboboxChip({\r\n className,\r\n ...props\r\n}: ComboboxChipProps) {\r\n return (\r\n <Badge\r\n className={cn(\"ring-2 ring-border-brand text-body-medium-3\", className)}\r\n color=\"brand\"\r\n render={(\r\n <ComboboxChipPrimitive\r\n {...props}\r\n />\r\n )}\r\n size=\"lg\"\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxChipRemovePrimitiveProps\r\n\r\nfunction ComboboxChipRemove({\r\n className,\r\n ...props\r\n}: ComboboxChipRemoveProps) {\r\n return (\r\n <BadgeButton\r\n className={cn(\"text-fg-quaternary\", className)}\r\n render={(\r\n <ComboboxChipRemovePrimitive\r\n {...props}\r\n />\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPanelProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps\r\n\r\nfunction ComboboxPanel({\r\n className,\r\n align = \"center\",\r\n sideOffset = 4,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxPanelProps) {\r\n return (\r\n <ComboboxPortalPrimitive>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"z-50\"\r\n positionMethod=\"fixed\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"bg-bg-primary text-text-primary w-72 rounded-md border p-4 shadow-md outline-hidden origin-(--transform-origin)\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxContentProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps & {\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n }\r\n\r\nfunction ComboboxContent({\r\n className,\r\n align = \"center\",\r\n sideOffset = 4,\r\n container,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxContentProps) {\r\n return (\r\n <ComboboxPortalPrimitive container={container}>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"isolate z-200\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"group/combobox-content bg-bg-primary text-text-primary max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary p-xp-xs shadow-md outline-hidden\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxPortalProps = ComboboxPortalPrimitiveProps\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n return <ComboboxPortalPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPositionerPrimitiveProps\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return <ComboboxPositionerPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPopupProps = ComboboxPopupPrimitiveProps\r\n\r\nfunction ComboboxPopup({ className, ...props }: ComboboxPopupProps) {\r\n return <ComboboxPopupPrimitive\r\n className={cn(\r\n \"bg-bg-primary text-text-primary w-72 rounded-md border shadow-md outline-hidden origin-(--transform-origin)\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxBackdropPrimitiveProps\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxBackdropPrimitive\r\n className={cn(\"bg-black/30\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxStatusPrimitiveProps\r\n\r\nfunction ComboboxStatus({\r\n className,\r\n status,\r\n ...props\r\n}: Omit<ComboboxStatusProps, \"children\"> & {\r\n status?: \"empty\" | \"pending\" | null\r\n}) {\r\n const { inputValue } = useCombobox()\r\n\r\n const trimmedInputValue = inputValue?.toString().trim()\r\n\r\n const getText = () => {\r\n if (status === \"empty\" && trimmedInputValue)\r\n return `No matches for \"${trimmedInputValue}\".`\r\n\r\n if (status === \"empty\" && !trimmedInputValue)\r\n return \"No results.\"\r\n\r\n if (status === \"pending\")\r\n return (\r\n <>\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Searching...\r\n </span>\r\n </>\r\n )\r\n\r\n return null\r\n }\r\n\r\n const text = getText()\r\n\r\n return (\r\n <ComboboxStatusPrimitive\r\n className={cn(\r\n \"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\",\r\n !text && \"hidden\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {text}\r\n </ComboboxStatusPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxLoadingProps = React.ComponentProps<\"div\">\r\n\r\ntype ComboboxEmptyProps = ComboboxEmptyPrimitiveProps\r\n\r\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\r\n return <ComboboxEmptyPrimitive\r\n className={cn(\"px-3 py-2 text-body-regular-2 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxListPrimitiveProps\r\n\r\nfunction ComboboxList({\r\n className,\r\n ...props\r\n}: ComboboxListProps) {\r\n return (\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col gap-xp-sm\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightProps = ComboboxHighlightPrimitiveProps\r\n\r\nfunction ComboboxHighlight(props: ComboboxHighlightProps) {\r\n const { className, ...rest } = props\r\n\r\n return (\r\n <ComboboxHighlightPrimitive\r\n className={cn(\"absolute inset-0 rounded-md bg-bg-primary-hover\", className)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = ComboboxHighlightItemPrimitiveProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return <ComboboxHighlightItemPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxRowPrimitiveProps\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxRowPrimitive\r\n className={cn(\"group/combobox-row\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxItemPrimitiveProps\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxItemProps) {\r\n const { disabled } = props\r\n\r\n return (\r\n <ComboboxHighlightItem\r\n activeClassName=\"bg-bg-primary-hover\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n className={cn(\r\n \"flex w-full cursor-default items-center gap-xp-md rounded-md px-xp-md py-2.5 text-body-medium-2 text-text-primary outline-none\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ComboboxItemIndicator>\r\n <CheckCircle2Icon className=\"size-5 text-fg-brand-primary shrink-0\" />\r\n </ComboboxItemIndicator>\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxItemIndicatorPrimitiveProps\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return (\r\n <ComboboxItemIndicatorPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxSeparatorPrimitiveProps\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxSeparatorPrimitive\r\n className={cn(\"my-1 h-px bg-border-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxGroupPrimitiveProps\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupPrimitive\r\n className={cn(\"py-1\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxGroupLabelPrimitiveProps\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupLabelPrimitive\r\n className={cn(\"px-3 py-1 text-body-semibold-sm text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxCollectionPrimitiveProps\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxCollectionPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxArrowPrimitiveProps\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxArrowPrimitive\r\n className={cn(\"fill-bg-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInfiniteScroll({\r\n hasMore,\r\n threshold = 0.5,\r\n ...props\r\n}: Omit<React.ComponentProps<typeof InfiniteScroll>, \"children\">) {\r\n return (\r\n <InfiniteScroll\r\n hasMore={hasMore}\r\n threshold={threshold}\r\n {...props}\r\n >\r\n {hasMore && (\r\n <div className=\"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\">\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Loading more...\r\n </span>\r\n </div>\r\n )}\r\n </InfiniteScroll>\r\n )\r\n}\r\n\r\nexport {\r\n Combobox,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n ComboboxContent,\r\n type ComboboxContentProps,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxInputFilter,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n type ComboboxLoadingProps,\r\n ComboboxPanel,\r\n type ComboboxPanelProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps\r\n}"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from'react';import {jsx,Fragment}from'react/jsx-runtime';function h({isLoading:o=false,hasMore:s=false,next:a,threshold:t=1,root:c=null,rootMargin:i="0px",reverse:v,children:u}){let l=e.useRef(null),R=e.useCallback(n=>{let r=t;(t<0||t>1)&&(console.warn("threshold should be between 0 and 1. You are exceed the range. will use default value: 1"),r=1),!o&&(l.current&&l.current.disconnect(),n&&(l.current=new IntersectionObserver(b=>{b[0].isIntersecting&&s&&a?.();},{threshold:r,root:c,rootMargin:i}),l.current.observe(n)));},[s,o,a,t,c,i]),f=e.useMemo(()=>e.Children.toArray(u),[u]);return jsx(Fragment,{children:f.map((n,r)=>{if(!e.isValidElement(n))return process.env.NODE_ENV==="development"&&console.warn("You should use a valid element with InfiniteScroll"),n;let d=(v?r===0:r===f.length-1)?R:null;return e.cloneElement(n,{ref:d})})})}export{h as a};//# sourceMappingURL=chunk-TED2PUK6.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-TED2PUK6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/infinite-scroll.tsx"],"names":["InfiniteScroll","isLoading","hasMore","next","threshold","root","rootMargin","reverse","children","observer","observerRef","element","safeThreshold","entries","flattenChild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C,SAAA,CACG,QAAA,CAAAF,EAAgB,GAAA,CAAI,CAACG,CAAAA,CAAOC,CAAAA,GAAU,CAErC,GAAI,CAAO,CAAA,CAAA,cAAA,CAAeD,CAAK,EAC7B,OAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,GAAa,eAC3B,OAAA,CAAQ,IAAA,CAAK,oDAAoD,CAAA,CAE5DA,EAIT,IAAME,CAAAA,CAAAA,CADkBZ,CAAAA,CAAUW,CAAAA,GAAU,EAAIA,CAAAA,GAAUJ,CAAAA,CAAgB,MAAA,CAAS,CAAA,EACrDJ,EAAc,IAAA,CAE5C,OAAa,CAAA,CAAA,YAAA,CAAaO,CAAAA,CAAO,CAAE,GAAA,CAAAE,CAAI,CAAC,CAC1C,CAAC,EACH,CAEJ","file":"chunk-TED2PUK6.js","sourcesContent":["/* eslint-disable react-hooks/refs */\r\nimport * as React from \"react\"\r\n\r\ntype InfiniteScrollProps = {\r\n isLoading?: boolean;\r\n hasMore?: boolean;\r\n next?: () => unknown;\r\n threshold?: number;\r\n root?: Element | Document | null;\r\n rootMargin?: string;\r\n reverse?: boolean;\r\n children?: React.ReactNode;\r\n}\r\n\r\nfunction InfiniteScroll({\r\n isLoading = false,\r\n hasMore = false,\r\n next,\r\n threshold = 1,\r\n root = null,\r\n rootMargin = \"0px\",\r\n reverse,\r\n children,\r\n}: InfiniteScrollProps) {\r\n const observer = React.useRef<IntersectionObserver>(null)\r\n // This callback ref will be called when it is dispatched to an element or detached from an element,\r\n // or when the callback function changes.\r\n const observerRef = React.useCallback(\r\n (element: HTMLElement | null) => {\r\n let safeThreshold = threshold\r\n if (threshold < 0 || threshold > 1) {\r\n console.warn(\r\n \"threshold should be between 0 and 1. You are exceed the range. will use default value: 1\",\r\n )\r\n safeThreshold = 1\r\n }\r\n // When isLoading is true, this callback will do nothing.\r\n // It means that the next function will never be called.\r\n // It is safe because the intersection observer has disconnected the previous element.\r\n if (isLoading) return\r\n\r\n if (observer.current) observer.current.disconnect()\r\n if (!element) return\r\n\r\n // Create a new IntersectionObserver instance because hasMore or next may be changed.\r\n observer.current = new IntersectionObserver(\r\n (entries) => {\r\n if (entries[0].isIntersecting && hasMore) {\r\n next?.()\r\n }\r\n },\r\n { threshold: safeThreshold, root, rootMargin },\r\n )\r\n observer.current.observe(element)\r\n },\r\n [hasMore, isLoading, next, threshold, root, rootMargin],\r\n )\r\n\r\n const flattenChildren = React.useMemo(() => React.Children.toArray(children), [children])\r\n\r\n return (\r\n <>\r\n {flattenChildren.map((child, index) => {\r\n\r\n if (!React.isValidElement(child)) {\r\n if (process.env.NODE_ENV === \"development\") {\r\n console.warn(\"You should use a valid element with InfiniteScroll\")\r\n }\r\n return child\r\n }\r\n\r\n const isObserveTarget = reverse ? index === 0 : index === flattenChildren.length - 1\r\n const ref = isObserveTarget ? observerRef : null\r\n // @ts-expect-error ignore ref type\r\n return React.cloneElement(child, { ref })\r\n })}\r\n </>\r\n )\r\n}\r\n\r\nexport { InfiniteScroll }\r\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as s from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var x=cva(cn("peer/input text-text-primary placeholder:text-text-placeholder data-[placeholder]:text-text-placeholder border-border-primary flex w-full min-w-0 rounded-xp-card-base border bg-bg-primary px-3 text-body-regular-2 transition-[color,box-shadow,border] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-bg-disabled disabled:text-text-disabled","focus-visible:border-border-brand focus-visible:border-2","aria-invalid:border-content-on-error-subtle-action"),{variants:{size:{sm:"h-10",md:"h-11"},variant:{password:void 0},withStartContent:{true:"pl-9.5"},withEndContent:{true:"pr-9.5"}},defaultVariants:{size:"md"}}),p=cva("absolute top-1/2 -translate-y-1/2 size-4.5 text-fg-quaternary",{variants:{side:{start:"left-3",end:"right-3"}}});function v({className:c,wrapperClassName:b,type:m,startContent:a,endContent:r,variant:e,size:u,...w}){let[i,f]=s.useState(false),n=!!a||!!r||e==="password";return jsxs(n?"div":s.Fragment,{...n?{className:cn("relative",b)}:{},children:[jsx("input",{className:cn(x({withStartContent:!!a,withEndContent:!!r||e==="password",size:u}),c),"data-slot":"input",type:e==="password"?i?"text":"password":m,...w}),a&&jsx(Slot,{className:cn(p({side:"start"})),children:a}),r&&e!=="password"&&jsx(Slot,{className:cn(p({side:"end"})),children:r}),e==="password"&&jsx(Slot,{"aria-label":i?"Hide password":"Show password",className:"cursor-pointer select-none","data-slot":"toggle-password",onClick:()=>f(h=>!h)})]})}export{x as a,v as b};//# sourceMappingURL=chunk-XXHHZYH6.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-XXHHZYH6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/input.tsx"],"names":["inputVariants","cva","cn","inputIconVariants","Input","className","wrapperClassName","type","startContent","endContent","variant","size","props","showPassword","setShowPassword","isWrapped","jsxs","jsx","Slot","prev"],"mappings":"qLAUA,IAAMA,CAAAA,CAAgBC,GAAAA,CACpBC,EAAAA,CACE,qXAAA,CACA,0DAAA,CACA,oDACF,CAAA,CACA,CACE,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,GAAI,MAAA,CACJ,EAAA,CAAI,MACN,CAAA,CACA,OAAA,CAAS,CACP,SAAU,MACZ,CAAA,CACA,gBAAA,CAAkB,CAChB,IAAA,CAAM,QACR,EACA,cAAA,CAAgB,CACd,IAAA,CAAM,QACR,CACF,CAAA,CACA,gBAAiB,CACf,IAAA,CAAM,IACR,CACF,CACF,CAAA,CAEMC,EAAoBF,GAAAA,CACxB,+DAAA,CACA,CACE,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,KAAA,CAAO,QAAA,CACP,GAAA,CAAK,SACP,CACF,CACF,CACF,EAEA,SAASG,CAAAA,CAAM,CACb,SAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,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AAA,CAACC,IAAAA,CAAA,CACC,YAAA,CAAYL,CAAAA,CAAe,eAAA,CAAkB,gBAC7C,SAAA,CAAU,4BAAA,CACV,WAAA,CAAU,iBAAA,CACV,OAAA,CAAS,IAAMC,CAAAA,CAAiBK,CAAAA,EAAS,CAACA,CAAI,CAAA,CAOhD,CAAA,CAAA,CAEJ,CAEJ","file":"chunk-XXHHZYH6.js","sourcesContent":["\"use client\"\r\nimport * as React from \"react\"\r\n\r\nimport { Slot } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\n// import { HidePasswords, ShowPasswords } from \"../new\"\r\n\r\nconst inputVariants = cva(\r\n cn(\r\n \"peer/input text-text-primary placeholder:text-text-placeholder data-[placeholder]:text-text-placeholder border-border-primary flex w-full min-w-0 rounded-xp-card-base border bg-bg-primary px-3 text-body-regular-2 transition-[color,box-shadow,border] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-bg-disabled disabled:text-text-disabled\",\r\n \"focus-visible:border-border-brand focus-visible:border-2\",\r\n \"aria-invalid:border-content-on-error-subtle-action\"\r\n ),\r\n {\r\n variants: {\r\n size: {\r\n sm: \"h-10\",\r\n md: \"h-11\",\r\n },\r\n variant: {\r\n password: undefined,\r\n },\r\n withStartContent: {\r\n true: \"pl-9.5\",\r\n },\r\n withEndContent: {\r\n true: \"pr-9.5\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"md\",\r\n }\r\n }\r\n)\r\n\r\nconst inputIconVariants = cva(\r\n \"absolute top-1/2 -translate-y-1/2 size-4.5 text-fg-quaternary\",\r\n {\r\n variants: {\r\n side: {\r\n start: \"left-3\",\r\n end: \"right-3\",\r\n },\r\n },\r\n }\r\n)\r\n\r\nfunction Input({\r\n className,\r\n wrapperClassName,\r\n type,\r\n startContent,\r\n endContent,\r\n variant,\r\n size,\r\n ...props\r\n}: Omit<React.ComponentProps<\"input\">, \"size\"> &\r\n VariantProps<typeof inputVariants> & {\r\n startContent?: React.ReactNode\r\n endContent?: React.ReactNode\r\n wrapperClassName?: string\r\n }\r\n) {\r\n const [showPassword, setShowPassword] = React.useState(false)\r\n\r\n const isWrapped = !!startContent || !!endContent || variant === \"password\"\r\n\r\n const Comp = isWrapped ? \"div\" : React.Fragment\r\n\r\n return (\r\n <Comp {...(isWrapped ? { className: cn(\"relative\", wrapperClassName) } : {})}>\r\n <input\r\n className={cn(inputVariants({ withStartContent: !!startContent, withEndContent: (!!endContent || variant === \"password\"), size }), className)}\r\n data-slot=\"input\"\r\n type={variant === \"password\" ? (showPassword ? \"text\" : \"password\") : type}\r\n {...props}\r\n />\r\n {startContent && (\r\n <Slot className={cn(inputIconVariants({ side: \"start\" }))}>\r\n {startContent}\r\n </Slot>\r\n )}\r\n {(endContent && variant !== \"password\") && (\r\n <Slot className={cn(inputIconVariants({ side: \"end\" }))}>\r\n {endContent}\r\n </Slot>\r\n )}\r\n {variant === \"password\" && (\r\n <Slot\r\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\r\n className=\"cursor-pointer select-none\"\r\n data-slot=\"toggle-password\"\r\n onClick={() => setShowPassword((prev) => !prev)}\r\n >\r\n {/* {showPassword ? (\r\n <ShowPasswords className={cn(inputIconVariants({ side: \"end\" }))} />\r\n ) : (\r\n <HidePasswords className={cn(inputIconVariants({ side: \"end\" }))} />\r\n )} */}\r\n </Slot>\r\n )}\r\n </Comp>\r\n )\r\n}\r\n\r\nexport { Input, inputVariants }\r\n\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-ZQTWDSKK.js"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComboboxProps, ComboboxPortal, ComboboxInfiniteScroll } from '../ui/combobox.js';
|
|
3
|
+
import '@base-ui/react/combobox';
|
|
4
|
+
import 'motion/react';
|
|
5
|
+
import '../effects/highlight.js';
|
|
6
|
+
import '../ui/infinite-scroll.js';
|
|
7
|
+
import '../ui/input.js';
|
|
8
|
+
import 'class-variance-authority/types';
|
|
9
|
+
import 'class-variance-authority';
|
|
10
|
+
|
|
11
|
+
type ComboboxChipOutsideProps<Value> = Omit<ComboboxProps<Value, true>, "multiple"> & {
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
inputPlaceholder?: string;
|
|
14
|
+
container?: React.ComponentProps<typeof ComboboxPortal>["container"];
|
|
15
|
+
items: ({
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[]) | undefined;
|
|
19
|
+
infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>;
|
|
20
|
+
isPending?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* When true, enables creatable / taggable mode.
|
|
23
|
+
* If the typed value has no exact match in the current item list,
|
|
24
|
+
* a "Create \"…\"" option is shown at the top of the dropdown.
|
|
25
|
+
* Created items are appended to the value with `{ label, value, tag: true }`.
|
|
26
|
+
*/
|
|
27
|
+
taggable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum number of chips to show before collapsing the rest into a "+N" chip.
|
|
30
|
+
* When undefined, all chips are shown.
|
|
31
|
+
*/
|
|
32
|
+
maxVisible?: number;
|
|
33
|
+
};
|
|
34
|
+
declare function ComboboxChipOutside<Value extends {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
tag?: true;
|
|
38
|
+
}>({ multiple, inputPlaceholder, container, items, infiniteScroll, isPending, taggable, maxVisible, ...props }: ComboboxChipOutsideProps<Value>): React.JSX.Element;
|
|
39
|
+
|
|
40
|
+
export { ComboboxChipOutside };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{a as ComboboxChipOutside}from'../chunk-7ASZFFFB.js';import'../chunk-ZQTWDSKK.js';import'../chunk-XRBBTMGF.js';import'../chunk-JFJU2DLY.js';import'../chunk-4YATKUEK.js';import'../chunk-52U7K5UV.js';import'../chunk-5YDJTHDG.js';import'../chunk-TED2PUK6.js';import'../chunk-XXHHZYH6.js';import'../chunk-WIUYDPXB.js';import'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';import'../chunk-KYD4ATTG.js';//# sourceMappingURL=combobox-chip-outside.js.map
|
|
2
|
+
//# sourceMappingURL=combobox-chip-outside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"combobox-chip-outside.js"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export { ComboboxChipOutside } from './combobox-chip-outside.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ComboboxProps, ComboboxPortal, ComboboxInfiniteScroll } from '../ui/combobox.js';
|
|
4
|
+
import '@base-ui/react/combobox';
|
|
5
|
+
import 'motion/react';
|
|
6
|
+
import '../effects/highlight.js';
|
|
7
|
+
import '../ui/infinite-scroll.js';
|
|
8
|
+
import '../ui/input.js';
|
|
9
|
+
import 'class-variance-authority/types';
|
|
10
|
+
import 'class-variance-authority';
|
|
11
|
+
|
|
12
|
+
type ComboboxChipProps<Value> = Omit<ComboboxProps<Value, true>, "multiple"> & {
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
inputPlaceholder?: string;
|
|
15
|
+
container?: React.ComponentProps<typeof ComboboxPortal>["container"];
|
|
16
|
+
items: ({
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
image?: string;
|
|
20
|
+
}[]) | undefined;
|
|
21
|
+
infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>;
|
|
22
|
+
isPending?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* When true, enables creatable / taggable mode.
|
|
25
|
+
* If the typed value has no exact match in the current item list,
|
|
26
|
+
* a "Create \"…\"" option is shown at the top of the dropdown.
|
|
27
|
+
* Created items are appended to the value with `{ label, value, tag: true }`.
|
|
28
|
+
*/
|
|
29
|
+
taggable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Maximum number of chips to show before collapsing the rest into a "+N" chip.
|
|
32
|
+
* When undefined, all chips are shown.
|
|
33
|
+
*/
|
|
34
|
+
maxVisible?: number;
|
|
35
|
+
};
|
|
36
|
+
declare function ComboboxChip<Value extends {
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
image?: string;
|
|
40
|
+
tag?: true;
|
|
41
|
+
}>({ multiple, inputPlaceholder, container, items, infiniteScroll, isPending, taggable, maxVisible, ...props }: ComboboxChipProps<Value>): React.JSX.Element;
|
|
42
|
+
|
|
43
|
+
export { ComboboxChip };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{a as ComboboxChipOutside}from'../chunk-7ASZFFFB.js';import'../chunk-ZQTWDSKK.js';import'../chunk-XRBBTMGF.js';import {c,a,l,k,m,n,b,p,u,w,A,H as H$1}from'../chunk-JFJU2DLY.js';import'../chunk-4YATKUEK.js';import'../chunk-52U7K5UV.js';import'../chunk-5YDJTHDG.js';import'../chunk-TED2PUK6.js';import {a as a$1}from'../chunk-XXHHZYH6.js';import'../chunk-WIUYDPXB.js';import'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';import'../chunk-KYD4ATTG.js';import*as r from'react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function H({multiple:z=true,inputPlaceholder:E="Search...",container:G,items:s,infiniteScroll:O,isPending:T,taggable:c$1=false,maxVisible:i,...m$1}){let[j,q]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[b$1,h]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[g,V]=r.useState([]),C=r.useRef(new Set);r.useEffect(()=>{let e=new Set(b$1.map(n=>n.value));V(n=>{let l=n.filter(o=>e.has(o.value));return l.length===n.length?n:(C.current=new Set(l.map(o=>o.value)),l)});},[b$1]);let a$2=j?.toString().trim()??"",A$1=r.useMemo(()=>a$2?b$1.some(e=>e.value.toLowerCase()===a$2.toLowerCase()):false,[a$2,b$1]),p$1=r.useMemo(()=>!c$1||!a$2?false:!s?.some(e=>e.label.toLowerCase()===a$2.toLowerCase()),[c$1,a$2,s]),B=r.useMemo(()=>{let e=[...s??[],...g];return p$1?[...e,{label:a$2,value:a$2,tag:true}]:e},[s,g,p$1,a$2]);return jsxs(c,{...m$1,behavior:"chip-outside",multiple:true,items:c$1?B:s,isItemEqualToValue:(e,n)=>e.value===n.value,onValueChange:(e,n)=>{if(c$1){let l=e.filter(o=>o?.tag===true&&!C.current.has(o.value));if(l.length>0){for(let o of l)C.current.add(o.value);V(o=>[...o,...l]);}}h(z?e:[e[e.length-1]],n);},onInputValueChange:q,children:[jsxs(a,{className:cn(a$1(),"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text"),children:[jsx(l,{className:cn("contents",i!==void 0&&"flex-nowrap overflow-hidden"),children:jsx(k,{children:e=>{let n$1=i!==void 0?e.slice(0,i):e,l=i!==void 0?e.length-i:0;return jsxs(Fragment,{children:[n$1?.map(o=>jsxs(m,{className:cn(i!==void 0&&"min-w-0 shrink"),children:[o?.image&&jsx("img",{src:o.image,alt:o?.label||"",className:"size-4 rounded-full object-cover shrink-0 mr-1"}),i!==void 0?jsx("span",{className:"truncate",children:o?.label||""}):o?.label||"",jsx(n,{})]},o?.value||"")),l>0&&jsxs(m,{className:"shrink-0",children:["+",l]})]})}})}),jsx(b,{render:jsx("input",{className:"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder",placeholder:b$1.length===0?E:void 0})})]}),jsxs(p,{container:G,children:[jsx(u,{status:T||s===void 0?"pending":s?.length===0&&!p$1?"empty":null}),jsxs(w,{children:[s?.map(e=>jsx(A,{value:e,children:jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.image&&jsx("img",{src:e.image,alt:e.label,className:"size-6 rounded-full object-cover shrink-0"}),jsx("span",{className:"truncate",children:e.label})]})},e.value)),p$1&&jsx(A,{value:{label:a$2,value:a$2,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!A$1&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:a$2})]})}),jsx(H$1,{...O})]})]})]})}export{H as ComboboxChip};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/composites/combobox-chip.tsx"],"names":["ComboboxChip","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","jsxs","Combobox","a","b","eventDetails","newTags","tag","ComboboxInputGroup","cn","inputVariants","jsx","ComboboxChips","ComboboxValue","visible","overflow","Fragment","ComboboxChipRemove","ComboboxInput","ComboboxContent","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxInfiniteScroll"],"mappings":"wpBA6CA,SAASA,CAAAA,CAAyF,CAChG,QAAA,CAAAC,EAAW,IAAA,CACX,gBAAA,CAAAC,CAAAA,CAAmB,WAAA,CACnB,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,eAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,GAAAA,CAAW,KAAA,CACX,UAAA,CAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAA6B,CAC3B,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIC,mBAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACnC,YAAA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,SAAA,CAAU,wCAAA,CACZ,QAAA,CAAA,CAAAN,CAAAA,CAAK,KAAA,EACJgB,GAAAA,CAAC,KAAA,CAAA,CACC,GAAA,CAAKhB,EAAK,KAAA,CACV,GAAA,CAAKA,CAAAA,CAAK,KAAA,CACV,SAAA,CAAU,2CAAA,CACZ,CAAA,CAEFgB,GAAAA,CAAC,QAAK,SAAA,CAAU,UAAA,CAAY,QAAA,CAAAhB,CAAAA,CAAK,KAAA,CAAM,CAAA,CAAA,CACzC,CAAA,CAAA,CAZKA,CAAAA,CAAK,KAaZ,CACD,CAAA,CACAG,GAAAA,EACCa,GAAAA,CAACW,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,MAAO1B,GAAAA,CAAc,KAAA,CAAOA,GAAAA,CAAc,GAAA,CAAK,IAAK,CAAA,CAE7D,QAAA,CAAAK,IAAAA,CAAC,OAAI,SAAA,CAAU,0CAAA,CACZ,QAAA,CAAA,CAAA,CAACJ,GAAAA,EACAc,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,qBAAA,CAAsB,mBAAO,CAAA,CAE/CA,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAf,GAAAA,CACH,CAAA,CAAA,CACF,EACF,CAAA,CAEFe,GAAAA,CAACY,GAAAA,CAAA,CAAwB,GAAG7C,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"index.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup,\r\n} from \"../primitives/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxChip as ComboboxChipUI,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxContent,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxValue,\r\n type ComboboxProps\r\n} from \"../ui/combobox\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { inputVariants } from \"../ui/input\"\r\n\r\ntype ComboboxChipProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string; image?: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChip<Value extends { label: string; value: string; image?: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n return [...base, { label: trimmedInput, value: trimmedInput, tag: true } as unknown as Value]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n {/* Input box with chips inside */}\r\n <ComboboxInputGroup\r\n className={cn(\r\n inputVariants(),\r\n \"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text\"\r\n )}\r\n >\r\n {/* Chips inside the input box */}\r\n <ComboboxChips\r\n className={cn(\r\n \"contents\",\r\n maxVisible !== undefined && \"flex-nowrap overflow-hidden\"\r\n )}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChipUI\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {item?.image && (\r\n <img\r\n src={item.image}\r\n alt={item?.label || \"\"}\r\n className=\"size-4 rounded-full object-cover shrink-0 mr-1\"\r\n />\r\n )}\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChipUI>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChipUI className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChipUI>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n\r\n {/* Text input — shrinks to fit remaining space */}\r\n <ComboboxInputPrimitive\r\n render={\r\n <input\r\n className=\"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder\"\r\n placeholder={value.length === 0 ? inputPlaceholder : undefined}\r\n />\r\n }\r\n />\r\n </ComboboxInputGroup>\r\n\r\n <ComboboxContent container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item as Value}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n {item.image && (\r\n <img\r\n src={item.image}\r\n alt={item.label}\r\n className=\"size-6 rounded-full object-cover shrink-0\"\r\n />\r\n )}\r\n <span className=\"truncate\">{item.label}</span>\r\n </div>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxContent>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChip }\r\nexport type { ComboboxChipProps }\r\n"]}
|
package/dist/effects/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as AutoHeight}from'../chunk-ZVME3JB3.js';export{b as Highlight,c as HighlightItem,a as useHighlight}from'../chunk-KYD4ATTG.js'
|
|
1
|
+
export{a as AutoHeight}from'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';export{b as Highlight,c as HighlightItem,a as useHighlight}from'../chunk-KYD4ATTG.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as Dialog,e as DialogBackdrop,g as DialogClose,k as DialogDescription,i as DialogFooter,h as DialogHeader,f as DialogPopup,d as DialogPortal,j as DialogTitle,c as DialogTrigger,a as useDialog}from'../chunk-5YDJTHDG.js';export{a as Tabs,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,f as TabsPanel,g as TabsPanels,e as TabsTab}from'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';
|
|
1
|
+
export{b as Dialog,e as DialogBackdrop,g as DialogClose,k as DialogDescription,i as DialogFooter,h as DialogHeader,f as DialogPopup,d as DialogPortal,j as DialogTitle,c as DialogTrigger,a as useDialog}from'../chunk-5YDJTHDG.js';export{a as Tabs,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,f as TabsPanel,g as TabsPanels,e as TabsTab}from'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';export{a as Slot}from'../chunk-2TUGHMFW.js';import'../chunk-KYD4ATTG.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/primitives/tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as Tabs,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,f as TabsPanel,g as TabsPanels,e as TabsTab}from'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-
|
|
1
|
+
export{a as Tabs,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,f as TabsPanel,g as TabsPanels,e as TabsTab}from'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';import'../chunk-KYD4ATTG.js';//# sourceMappingURL=tabs.js.map
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const badgeVariants: (props?: ({
|
|
7
|
+
type?: "rounded" | "square" | "modern" | null | undefined;
|
|
8
|
+
color?: "gray" | "brand" | "error" | "warning" | "success" | "gray-blue" | "blue-light" | "blue" | "indigo" | "purple" | "pink" | "orange" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
icon?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
interface BadgeProps extends Omit<React.ComponentProps<"span">, "color">, VariantProps<typeof badgeVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare function Badge({ className, type, color, size, icon, render, ...props }: BadgeProps & useRender.ComponentProps<"span">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
15
|
+
declare function BadgeButton({ className, render, align, ...props }: useRender.ComponentProps<"button"> & {
|
|
16
|
+
align?: "inline-end" | "inline-start";
|
|
17
|
+
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
18
|
+
declare function BadgeDot({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { Badge, BadgeButton, BadgeDot, type BadgeProps, badgeVariants };
|
package/dist/ui/badge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"badge.js"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
|
|
3
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
4
|
+
import { HighlightProps, HighlightItemProps } from '../effects/highlight.js';
|
|
5
|
+
import { InfiniteScroll } from './infinite-scroll.js';
|
|
6
|
+
import { Input } from './input.js';
|
|
7
|
+
import 'class-variance-authority/types';
|
|
8
|
+
import 'class-variance-authority';
|
|
9
|
+
|
|
10
|
+
type ComboboxProps$1<Value, Multiple extends boolean | undefined = false> = Combobox$1.Root.Props<Value, Multiple> & {
|
|
11
|
+
behavior?: "default" | "chip-outside";
|
|
12
|
+
};
|
|
13
|
+
type ComboboxTriggerProps$1 = Combobox$1.Trigger.Props;
|
|
14
|
+
type ComboboxLabelProps$1 = Combobox$1.Label.Props;
|
|
15
|
+
type ComboboxInputGroupProps$1 = Combobox$1.InputGroup.Props;
|
|
16
|
+
type ComboboxInputProps$1 = Combobox$1.Input.Props;
|
|
17
|
+
type ComboboxIconProps$1 = Combobox$1.Icon.Props;
|
|
18
|
+
type ComboboxClearProps$1 = Combobox$1.Clear.Props;
|
|
19
|
+
type ComboboxValueProps$1 = Combobox$1.Value.Props;
|
|
20
|
+
type ComboboxChipsProps$1 = Combobox$1.Chips.Props;
|
|
21
|
+
type ComboboxChipProps$1 = Combobox$1.Chip.Props;
|
|
22
|
+
type ComboboxChipRemoveProps$1 = Combobox$1.ChipRemove.Props;
|
|
23
|
+
type ComboboxPortalProps$1 = Omit<Combobox$1.Portal.Props, "keepMounted">;
|
|
24
|
+
type ComboboxPositionerProps$1 = Combobox$1.Positioner.Props;
|
|
25
|
+
type ComboboxPopupProps$1 = Omit<Combobox$1.Popup.Props, "render"> & HTMLMotionProps<"div">;
|
|
26
|
+
type ComboboxBackdropProps$1 = Combobox$1.Backdrop.Props;
|
|
27
|
+
type ComboboxStatusProps$1 = Combobox$1.Status.Props;
|
|
28
|
+
type ComboboxEmptyProps$1 = Combobox$1.Empty.Props;
|
|
29
|
+
type ComboboxListProps$1 = Combobox$1.List.Props;
|
|
30
|
+
type ComboboxHighlightProps$1 = Omit<HighlightProps, "controlledItems" | "enabled" | "hover">;
|
|
31
|
+
type ComboboxHighlightItemProps$1 = HighlightItemProps;
|
|
32
|
+
type ComboboxRowProps$1 = Combobox$1.Row.Props;
|
|
33
|
+
type ComboboxItemProps$1 = Combobox$1.Item.Props;
|
|
34
|
+
type ComboboxItemIndicatorProps$1 = Combobox$1.ItemIndicator.Props;
|
|
35
|
+
type ComboboxSeparatorProps$1 = Combobox$1.Separator.Props;
|
|
36
|
+
type ComboboxGroupProps$1 = Combobox$1.Group.Props;
|
|
37
|
+
type ComboboxGroupLabelProps$1 = Combobox$1.GroupLabel.Props;
|
|
38
|
+
type ComboboxCollectionProps$1 = Combobox$1.Collection.Props;
|
|
39
|
+
type ComboboxArrowProps$1 = Combobox$1.Arrow.Props;
|
|
40
|
+
|
|
41
|
+
type ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxProps$1<Value, Multiple>;
|
|
42
|
+
declare function Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>): React.JSX.Element;
|
|
43
|
+
type ComboboxTriggerProps = ComboboxTriggerProps$1;
|
|
44
|
+
declare function ComboboxTrigger(props: ComboboxTriggerProps): React.JSX.Element;
|
|
45
|
+
type ComboboxLabelProps = ComboboxLabelProps$1;
|
|
46
|
+
declare function ComboboxLabel(props: ComboboxLabelProps): React.JSX.Element;
|
|
47
|
+
type ComboboxInputGroupProps = ComboboxInputGroupProps$1;
|
|
48
|
+
declare function ComboboxInputGroup(props: ComboboxInputGroupProps): React.JSX.Element;
|
|
49
|
+
type ComboboxInputProps = ComboboxInputProps$1;
|
|
50
|
+
declare function ComboboxInput(props: ComboboxInputProps): React.JSX.Element;
|
|
51
|
+
declare function ComboboxInputFilter({ className, displayValueKey, placeholder, inputProps, ...props }: ComboboxInputProps & {
|
|
52
|
+
displayValueKey?: {
|
|
53
|
+
label: string;
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
56
|
+
placeholder?: string;
|
|
57
|
+
inputProps?: React.ComponentProps<typeof Input>;
|
|
58
|
+
}): React.JSX.Element;
|
|
59
|
+
type ComboboxIconProps = ComboboxIconProps$1;
|
|
60
|
+
declare function ComboboxIcon(props: ComboboxIconProps): React.JSX.Element;
|
|
61
|
+
type ComboboxClearProps = ComboboxClearProps$1;
|
|
62
|
+
declare function ComboboxClear(props: ComboboxClearProps): React.JSX.Element;
|
|
63
|
+
type ComboboxValueProps = ComboboxValueProps$1;
|
|
64
|
+
declare function ComboboxValue(props: ComboboxValueProps): React.JSX.Element;
|
|
65
|
+
type ComboboxChipsProps = ComboboxChipsProps$1;
|
|
66
|
+
declare function ComboboxChips({ className, ...props }: ComboboxChipsProps): React.JSX.Element;
|
|
67
|
+
type ComboboxChipProps = ComboboxChipProps$1;
|
|
68
|
+
declare function ComboboxChip({ className, ...props }: ComboboxChipProps): React.JSX.Element;
|
|
69
|
+
type ComboboxChipRemoveProps = ComboboxChipRemoveProps$1;
|
|
70
|
+
declare function ComboboxChipRemove({ className, ...props }: ComboboxChipRemoveProps): React.JSX.Element;
|
|
71
|
+
type ComboboxPanelProps = ComboboxPositionerProps$1 & ComboboxPopupProps$1;
|
|
72
|
+
declare function ComboboxPanel({ className, align, sideOffset, initialFocus, finalFocus, style, children, ...props }: ComboboxPanelProps): React.JSX.Element;
|
|
73
|
+
type ComboboxContentProps = ComboboxPositionerProps$1 & ComboboxPopupProps$1 & {
|
|
74
|
+
container?: React.ComponentProps<typeof ComboboxPortal>["container"];
|
|
75
|
+
};
|
|
76
|
+
declare function ComboboxContent({ className, align, sideOffset, container, initialFocus, finalFocus, style, children, ...props }: ComboboxContentProps): React.JSX.Element;
|
|
77
|
+
type ComboboxPortalProps = ComboboxPortalProps$1;
|
|
78
|
+
declare function ComboboxPortal(props: ComboboxPortalProps): React.JSX.Element;
|
|
79
|
+
type ComboboxPositionerProps = ComboboxPositionerProps$1;
|
|
80
|
+
declare function ComboboxPositioner(props: ComboboxPositionerProps): React.JSX.Element;
|
|
81
|
+
type ComboboxPopupProps = ComboboxPopupProps$1;
|
|
82
|
+
declare function ComboboxPopup({ className, ...props }: ComboboxPopupProps): React.JSX.Element;
|
|
83
|
+
type ComboboxBackdropProps = ComboboxBackdropProps$1;
|
|
84
|
+
declare function ComboboxBackdrop(props: ComboboxBackdropProps): React.JSX.Element;
|
|
85
|
+
type ComboboxStatusProps = ComboboxStatusProps$1;
|
|
86
|
+
declare function ComboboxStatus({ className, status, ...props }: Omit<ComboboxStatusProps, "children"> & {
|
|
87
|
+
status?: "empty" | "pending" | null;
|
|
88
|
+
}): React.JSX.Element;
|
|
89
|
+
type ComboboxLoadingProps = React.ComponentProps<"div">;
|
|
90
|
+
type ComboboxEmptyProps = ComboboxEmptyProps$1;
|
|
91
|
+
declare function ComboboxEmpty({ className, ...props }: ComboboxEmptyProps): React.JSX.Element;
|
|
92
|
+
type ComboboxListProps = ComboboxListProps$1;
|
|
93
|
+
declare function ComboboxList({ className, ...props }: ComboboxListProps): React.JSX.Element;
|
|
94
|
+
type ComboboxHighlightProps = ComboboxHighlightProps$1;
|
|
95
|
+
declare function ComboboxHighlight(props: ComboboxHighlightProps): React.JSX.Element;
|
|
96
|
+
type ComboboxHighlightItemProps = ComboboxHighlightItemProps$1;
|
|
97
|
+
declare function ComboboxHighlightItem(props: ComboboxHighlightItemProps): React.JSX.Element;
|
|
98
|
+
type ComboboxRowProps = ComboboxRowProps$1;
|
|
99
|
+
declare function ComboboxRow(props: ComboboxRowProps): React.JSX.Element;
|
|
100
|
+
type ComboboxItemProps = ComboboxItemProps$1;
|
|
101
|
+
declare function ComboboxItem({ className, children, ...props }: ComboboxItemProps): React.JSX.Element;
|
|
102
|
+
type ComboboxItemIndicatorProps = ComboboxItemIndicatorProps$1;
|
|
103
|
+
declare function ComboboxItemIndicator(props: ComboboxItemIndicatorProps): React.JSX.Element;
|
|
104
|
+
type ComboboxSeparatorProps = ComboboxSeparatorProps$1;
|
|
105
|
+
declare function ComboboxSeparator(props: ComboboxSeparatorProps): React.JSX.Element;
|
|
106
|
+
type ComboboxGroupProps = ComboboxGroupProps$1;
|
|
107
|
+
declare function ComboboxGroup(props: ComboboxGroupProps): React.JSX.Element;
|
|
108
|
+
type ComboboxGroupLabelProps = ComboboxGroupLabelProps$1;
|
|
109
|
+
declare function ComboboxGroupLabel(props: ComboboxGroupLabelProps): React.JSX.Element;
|
|
110
|
+
type ComboboxCollectionProps = ComboboxCollectionProps$1;
|
|
111
|
+
declare function ComboboxCollection(props: ComboboxCollectionProps): React.JSX.Element;
|
|
112
|
+
type ComboboxArrowProps = ComboboxArrowProps$1;
|
|
113
|
+
declare function ComboboxArrow(props: ComboboxArrowProps): React.JSX.Element;
|
|
114
|
+
declare function ComboboxInfiniteScroll({ hasMore, threshold, ...props }: Omit<React.ComponentProps<typeof InfiniteScroll>, "children">): React.JSX.Element;
|
|
115
|
+
|
|
116
|
+
export { Combobox, ComboboxArrow, type ComboboxArrowProps, ComboboxBackdrop, type ComboboxBackdropProps, ComboboxChip, type ComboboxChipProps, ComboboxChipRemove, type ComboboxChipRemoveProps, ComboboxChips, type ComboboxChipsProps, ComboboxClear, type ComboboxClearProps, ComboboxCollection, type ComboboxCollectionProps, ComboboxContent, type ComboboxContentProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxHighlight, ComboboxHighlightItem, type ComboboxHighlightItemProps, type ComboboxHighlightProps, ComboboxIcon, type ComboboxIconProps, ComboboxInfiniteScroll, ComboboxInput, ComboboxInputFilter, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, type ComboboxItemIndicatorProps, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxList, type ComboboxListProps, type ComboboxLoadingProps, ComboboxPanel, type ComboboxPanelProps, ComboboxPopup, type ComboboxPopupProps, ComboboxPortal, type ComboboxPortalProps, ComboboxPositioner, type ComboboxPositionerProps, type ComboboxProps, ComboboxRow, type ComboboxRowProps, ComboboxSeparator, type ComboboxSeparatorProps, ComboboxStatus, type ComboboxStatusProps, ComboboxTrigger, type ComboboxTriggerProps, ComboboxValue, type ComboboxValueProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{c as Combobox,G as ComboboxArrow,t as ComboboxBackdrop,m as ComboboxChip,n as ComboboxChipRemove,l as ComboboxChips,j as ComboboxClear,F as ComboboxCollection,p as ComboboxContent,v as ComboboxEmpty,D as ComboboxGroup,E as ComboboxGroupLabel,x as ComboboxHighlight,y as ComboboxHighlightItem,i as ComboboxIcon,H as ComboboxInfiniteScroll,g as ComboboxInput,h as ComboboxInputFilter,f as ComboboxInputGroup,A as ComboboxItem,B as ComboboxItemIndicator,e as ComboboxLabel,w as ComboboxList,o as ComboboxPanel,s as ComboboxPopup,q as ComboboxPortal,r as ComboboxPositioner,z as ComboboxRow,C as ComboboxSeparator,u as ComboboxStatus,d as ComboboxTrigger,k as ComboboxValue}from'../chunk-JFJU2DLY.js';import'../chunk-4YATKUEK.js';import'../chunk-TED2PUK6.js';import'../chunk-XXHHZYH6.js';import'../chunk-KYD4ATTG.js';//# sourceMappingURL=combobox.js.map
|
|
2
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"combobox.js"}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
export { Button, buttonVariants } from './button.js';
|
|
2
|
+
export { Badge, BadgeButton, BadgeDot, badgeVariants } from './badge.js';
|
|
3
|
+
export { Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxBackdrop, ComboboxBackdropProps, ComboboxChip, ComboboxChipProps, ComboboxChipRemove, ComboboxChipRemoveProps, ComboboxChips, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxHighlight, ComboboxHighlightItem, ComboboxHighlightItemProps, ComboboxHighlightProps, ComboboxIcon, ComboboxIconProps, ComboboxInfiniteScroll, ComboboxInput, ComboboxInputFilter, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxLoadingProps, ComboboxPanel, ComboboxPanelProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPortalProps, ComboboxPositioner, ComboboxPositionerProps, ComboboxProps, ComboboxRow, ComboboxRowProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps } from './combobox.js';
|
|
2
4
|
export { Dialog, DialogClose, DialogCloseProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogPopup, DialogPopupProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './dialog.js';
|
|
5
|
+
export { InfiniteScroll } from './infinite-scroll.js';
|
|
6
|
+
export { Input, inputVariants } from './input.js';
|
|
3
7
|
export { Tabs, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsPanels, TabsPanelsProps, TabsProps, TabsTab, TabsTabProps } from './tabs.js';
|
|
4
8
|
import 'react';
|
|
5
9
|
import 'class-variance-authority/types';
|
|
6
10
|
import 'class-variance-authority';
|
|
7
11
|
import '@base-ui/react/button';
|
|
12
|
+
import '@base-ui/react/use-render';
|
|
13
|
+
import '@base-ui/react/combobox';
|
|
14
|
+
import 'motion/react';
|
|
15
|
+
import '../effects/highlight.js';
|
|
8
16
|
import '../primitives/dialog.js';
|
|
9
17
|
import '@base-ui/react/dialog';
|
|
10
|
-
import 'motion/react';
|
|
11
18
|
import '../primitives/tabs.js';
|
|
12
19
|
import '@base-ui/react/tabs';
|
|
13
|
-
import '../effects/highlight.js';
|
|
14
20
|
import '../effects/auto-height.js';
|
|
15
21
|
import '../primitives/slot.js';
|
package/dist/ui/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as Button,a as buttonVariants}from'../chunk-XRBBTMGF.js';export{a as Dialog,c as DialogClose,h as DialogDescription,f as DialogFooter,e as DialogHeader,d as DialogPopup,g as DialogTitle,b as DialogTrigger}from'../chunk-52U7K5UV.js';export{a as Tabs,b as TabsList,e as TabsPanel,d as TabsPanels,c as TabsTab}from'../chunk-WIUYDPXB.js';import'../chunk-
|
|
1
|
+
import'../chunk-ZQTWDSKK.js';export{b as Button,a as buttonVariants}from'../chunk-XRBBTMGF.js';export{c as Combobox,G as ComboboxArrow,t as ComboboxBackdrop,m as ComboboxChip,n as ComboboxChipRemove,l as ComboboxChips,j as ComboboxClear,F as ComboboxCollection,p as ComboboxContent,v as ComboboxEmpty,D as ComboboxGroup,E as ComboboxGroupLabel,x as ComboboxHighlight,y as ComboboxHighlightItem,i as ComboboxIcon,H as ComboboxInfiniteScroll,g as ComboboxInput,h as ComboboxInputFilter,f as ComboboxInputGroup,A as ComboboxItem,B as ComboboxItemIndicator,e as ComboboxLabel,w as ComboboxList,o as ComboboxPanel,s as ComboboxPopup,q as ComboboxPortal,r as ComboboxPositioner,z as ComboboxRow,C as ComboboxSeparator,u as ComboboxStatus,d as ComboboxTrigger,k as ComboboxValue}from'../chunk-JFJU2DLY.js';export{b as Badge,c as BadgeButton,d as BadgeDot,a as badgeVariants}from'../chunk-4YATKUEK.js';export{a as Dialog,c as DialogClose,h as DialogDescription,f as DialogFooter,e as DialogHeader,d as DialogPopup,g as DialogTitle,b as DialogTrigger}from'../chunk-52U7K5UV.js';import'../chunk-5YDJTHDG.js';export{a as InfiniteScroll}from'../chunk-TED2PUK6.js';export{b as Input,a as inputVariants}from'../chunk-XXHHZYH6.js';export{a as Tabs,b as TabsList,e as TabsPanel,d as TabsPanels,c as TabsTab}from'../chunk-WIUYDPXB.js';import'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';import'../chunk-KYD4ATTG.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type InfiniteScrollProps = {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
hasMore?: boolean;
|
|
6
|
+
next?: () => unknown;
|
|
7
|
+
threshold?: number;
|
|
8
|
+
root?: Element | Document | null;
|
|
9
|
+
rootMargin?: string;
|
|
10
|
+
reverse?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
declare function InfiniteScroll({ isLoading, hasMore, next, threshold, root, rootMargin, reverse, children, }: InfiniteScrollProps): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { InfiniteScroll };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"infinite-scroll.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const inputVariants: (props?: ({
|
|
6
|
+
size?: "sm" | "md" | null | undefined;
|
|
7
|
+
variant?: "password" | null | undefined;
|
|
8
|
+
withStartContent?: boolean | null | undefined;
|
|
9
|
+
withEndContent?: boolean | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function Input({ className, wrapperClassName, type, startContent, endContent, variant, size, ...props }: Omit<React.ComponentProps<"input">, "size"> & VariantProps<typeof inputVariants> & {
|
|
12
|
+
startContent?: React.ReactNode;
|
|
13
|
+
endContent?: React.ReactNode;
|
|
14
|
+
wrapperClassName?: string;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Input, inputVariants };
|
package/dist/ui/input.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"input.js"}
|
package/dist/ui/tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as Tabs,b as TabsList,e as TabsPanel,d as TabsPanels,c as TabsTab}from'../chunk-WIUYDPXB.js';import'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-
|
|
1
|
+
export{a as Tabs,b as TabsList,e as TabsPanel,d as TabsPanels,c as TabsTab}from'../chunk-WIUYDPXB.js';import'../chunk-MMCL4HWD.js';import'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';import'../chunk-KYD4ATTG.js';//# sourceMappingURL=tabs.js.map
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xploreu/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared UI components for XploreU apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -35,6 +35,14 @@
|
|
|
35
35
|
"./effects/*": {
|
|
36
36
|
"types": "./dist/effects/*.d.ts",
|
|
37
37
|
"import": "./dist/effects/*.js"
|
|
38
|
+
},
|
|
39
|
+
"./composites": {
|
|
40
|
+
"types": "./dist/composites/index.d.ts",
|
|
41
|
+
"import": "./dist/composites/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./composites/*": {
|
|
44
|
+
"types": "./dist/composites/*.d.ts",
|
|
45
|
+
"import": "./dist/composites/*.js"
|
|
38
46
|
}
|
|
39
47
|
},
|
|
40
48
|
"files": [
|
|
@@ -45,7 +53,7 @@
|
|
|
45
53
|
"lucide-react": "^0.477.0",
|
|
46
54
|
"react": ">=18",
|
|
47
55
|
"react-dom": ">=18",
|
|
48
|
-
"@xploreu/hooks": "0.2.
|
|
56
|
+
"@xploreu/hooks": "0.2.2",
|
|
49
57
|
"@xploreu/lib": "0.1.2"
|
|
50
58
|
},
|
|
51
59
|
"dependencies": {
|
|
@@ -58,6 +66,7 @@
|
|
|
58
66
|
},
|
|
59
67
|
"devDependencies": {
|
|
60
68
|
"@base-ui/react": "^1.6.0",
|
|
69
|
+
"@types/node": "^20",
|
|
61
70
|
"@types/react": "19.2.17",
|
|
62
71
|
"@types/react-dom": "19.2.3",
|
|
63
72
|
"lucide-react": "^0.477.0",
|
|
@@ -65,7 +74,7 @@
|
|
|
65
74
|
"react-dom": "^19.2.4",
|
|
66
75
|
"tsup": "^8.4.0",
|
|
67
76
|
"typescript": "^5",
|
|
68
|
-
"@xploreu/hooks": "0.2.
|
|
77
|
+
"@xploreu/hooks": "0.2.2",
|
|
69
78
|
"@xploreu/lib": "0.1.2"
|
|
70
79
|
},
|
|
71
80
|
"scripts": {
|