@xploreu/components 0.4.41 → 0.4.43
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-3QGG35QR.js → chunk-5VZ6QNBI.js} +2 -2
- package/dist/{chunk-3QGG35QR.js.map → chunk-5VZ6QNBI.js.map} +1 -1
- package/dist/chunk-A5644ETE.js +2 -0
- package/dist/chunk-A5644ETE.js.map +1 -0
- package/dist/{chunk-77T5FOYW.js → chunk-C675EWZW.js} +2 -2
- package/dist/{chunk-77T5FOYW.js.map → chunk-C675EWZW.js.map} +1 -1
- package/dist/chunk-DL6MI55G.js +2 -0
- package/dist/chunk-DL6MI55G.js.map +1 -0
- package/dist/chunk-DNAWFZ7O.js +2 -0
- package/dist/chunk-DNAWFZ7O.js.map +1 -0
- package/dist/chunk-F56BLRF2.js +2 -0
- package/dist/{chunk-UR3YD2QR.js.map → chunk-F56BLRF2.js.map} +1 -1
- package/dist/{chunk-WWCXHCNU.js → chunk-F77XVICY.js} +2 -2
- package/dist/{chunk-WWCXHCNU.js.map → chunk-F77XVICY.js.map} +1 -1
- package/dist/{chunk-YB74L6RO.js → chunk-H6ETV455.js} +2 -2
- package/dist/{chunk-YB74L6RO.js.map → chunk-H6ETV455.js.map} +1 -1
- package/dist/{chunk-IT4LPPTN.js → chunk-HGLHAEGH.js} +2 -2
- package/dist/{chunk-IT4LPPTN.js.map → chunk-HGLHAEGH.js.map} +1 -1
- package/dist/{chunk-UBTCCHVI.js → chunk-KUOFW7JO.js} +2 -2
- package/dist/{chunk-UBTCCHVI.js.map → chunk-KUOFW7JO.js.map} +1 -1
- package/dist/chunk-MO7LQLS4.js +2 -0
- package/dist/chunk-MO7LQLS4.js.map +1 -0
- package/dist/{chunk-EE5QQGMX.js → chunk-NFLQZ5NB.js} +2 -2
- package/dist/{chunk-EE5QQGMX.js.map → chunk-NFLQZ5NB.js.map} +1 -1
- package/dist/chunk-OHLNKXSV.js +2 -0
- package/dist/chunk-OHLNKXSV.js.map +1 -0
- package/dist/{chunk-WV5OCKQK.js → chunk-RAVBRPQS.js} +2 -2
- package/dist/{chunk-WV5OCKQK.js.map → chunk-RAVBRPQS.js.map} +1 -1
- package/dist/{chunk-IZQFTYJD.js → chunk-RHWRIE3E.js} +2 -2
- package/dist/{chunk-IZQFTYJD.js.map → chunk-RHWRIE3E.js.map} +1 -1
- package/dist/chunk-UINS73U7.js +2 -0
- package/dist/chunk-UINS73U7.js.map +1 -0
- package/dist/{chunk-VHPUQQ6L.js → chunk-V2PW53KI.js} +2 -2
- package/dist/{chunk-VHPUQQ6L.js.map → chunk-V2PW53KI.js.map} +1 -1
- package/dist/chunk-VIBM666E.js +2 -0
- package/dist/chunk-VIBM666E.js.map +1 -0
- package/dist/{chunk-CDHMNEJ5.js → chunk-WN22TTEL.js} +2 -2
- package/dist/{chunk-CDHMNEJ5.js.map → chunk-WN22TTEL.js.map} +1 -1
- package/dist/{chunk-AVJU2H5V.js → chunk-XIZN73T3.js} +2 -2
- package/dist/{chunk-AVJU2H5V.js.map → chunk-XIZN73T3.js.map} +1 -1
- package/dist/chunk-Y6TKCAAJ.js +2 -0
- package/dist/chunk-Y6TKCAAJ.js.map +1 -0
- package/dist/{chunk-ON7PUZWI.js → chunk-YNJZ2P52.js} +2 -2
- package/dist/{chunk-ON7PUZWI.js.map → chunk-YNJZ2P52.js.map} +1 -1
- package/dist/{chunk-LFNLGW5G.js → chunk-YPV6XEV4.js} +2 -2
- package/dist/{chunk-LFNLGW5G.js.map → chunk-YPV6XEV4.js.map} +1 -1
- package/dist/{chunk-KL2GG3KE.js → chunk-ZK7MHZFG.js} +2 -2
- package/dist/{chunk-KL2GG3KE.js.map → chunk-ZK7MHZFG.js.map} +1 -1
- package/dist/composites/combobox-chip-outside.js +1 -1
- package/dist/composites/combobox-chip.js +1 -1
- package/dist/composites/combobox-simple.js +1 -1
- package/dist/composites/filter-combobox.js +1 -1
- package/dist/composites/index.js +1 -1
- package/dist/composites/phone-input.js +1 -1
- package/dist/form/form-input.d.ts +3 -3
- package/dist/form/form-input.js +1 -1
- package/dist/form/form-textarea.d.ts +5 -3
- package/dist/form/form-textarea.js +1 -1
- package/dist/form/form.d.ts +1 -1
- package/dist/form/form.js +1 -1
- package/dist/form/index.js +1 -1
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/alerter.js +1 -1
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/calendar.js +1 -1
- package/dist/ui/carousel.js +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/date-multiple-picker.js +1 -1
- package/dist/ui/date-picker.js +1 -1
- package/dist/ui/date-range-picker.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.js +1 -1
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/textarea.d.ts +7 -2
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/toast.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3ASGRRVT.js +0 -2
- package/dist/chunk-3ASGRRVT.js.map +0 -1
- package/dist/chunk-4PIKXPNO.js +0 -2
- package/dist/chunk-4PIKXPNO.js.map +0 -1
- package/dist/chunk-G6HDEOYZ.js +0 -2
- package/dist/chunk-G6HDEOYZ.js.map +0 -1
- package/dist/chunk-JH6RZ3QH.js +0 -2
- package/dist/chunk-JH6RZ3QH.js.map +0 -1
- package/dist/chunk-K2BMQ2TN.js +0 -2
- package/dist/chunk-K2BMQ2TN.js.map +0 -1
- package/dist/chunk-K7GGFR7W.js +0 -2
- package/dist/chunk-K7GGFR7W.js.map +0 -1
- package/dist/chunk-PJYKUR4F.js +0 -2
- package/dist/chunk-PJYKUR4F.js.map +0 -1
- package/dist/chunk-UR3YD2QR.js +0 -2
- package/dist/chunk-VNAMAKPG.js +0 -2
- package/dist/chunk-VNAMAKPG.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,b,m,e,q,s,w,x,H}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a,b,m,e,q,s,w,x,H}from'./chunk-RHWRIE3E.js';import'react';import {ChevronDownIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function X({multiple:m$1,items:s$1,placeholder:t="Select",icon:d,container:T,isPending:F,className:M,triggerClassName:k,contentClassName:A,disabled:R,infiniteScroll:x$1,filter:c,...o}){let r=m$1===true,L=o.showTitle??r,g=o.showSearch??r,[n,C]=useControlledState({value:o?.value,defaultValue:o?.defaultValue,onChange:o.onValueChange}),[$,q$1]=useControlledState({value:o?.inputValue?.toString(),defaultValue:o?.defaultInputValue?.toString(),onChange:o?.onInputValueChange}),u=Array.isArray(n)?n:n?[n]:[],a$1=u.length>0,z=u.length,B=a$1?r?`${t} (${z})`:u[0]?.label??t:r?`All ${t}`:t,D=()=>{C(null);};return jsxs(a,{items:s$1,multiple:m$1,value:n,onValueChange:C,inputValue:$,onInputValueChange:q$1,filter:c===null||!g?null:c,isItemEqualToValue:(l,p)=>l.value===p.value,disabled:R,...o,children:[jsxs(b,{className:cn("group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors","border-border-primary text-text-secondary hover:bg-bg-primary-hover",a$1&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt","disabled:pointer-events-none disabled:opacity-50","data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary",k,M),children:[d&&jsx("span",{className:cn("size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary",a$1?"text-fg-brand-primary":"text-fg-quaternary"),children:d}),jsx("span",{className:"truncate",children:B}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary",a$1?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(m,{container:T,className:cn("w-72",A),align:"start",sideOffset:8,children:jsxs("div",{className:"flex flex-col",children:[L&&jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:t}),jsx("button",{type:"button",disabled:!a$1,onClick:D,className:cn("text-label-semibold-3 transition-colors",a$1?"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover":"cursor-not-allowed text-text-disabled"),children:"Clear All"})]}),g&&jsx(e,{placeholder:`Search ${t.toLowerCase()}...`}),jsx(q,{status:F||s$1===void 0?"pending":s$1?.length===0?"empty":null}),jsx(s,{children:(l,p,E)=>jsxs(Fragment,{children:[jsx(w,{indicator:r?"checkbox":void 0,value:l,children:jsx(x,{children:l.label})},l.value),p===E-1&&!!x$1&&jsx(H,{...x$1})]})})]})})]})}export{X as a};//# sourceMappingURL=chunk-WN22TTEL.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-WN22TTEL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","multiple","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","filter","props","isMultiple","showTitle","showSearch","value","setValue","useControlledState","inputValue","setInputValue","valueArray","hasValue","count","triggerLabel","handleClear","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","item","index","length","Fragment","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qQA+CA,SAASA,EAA+F,CACtG,QAAA,CAAAC,IACA,KAAA,CAAAC,GAAAA,CAC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CAA2C,SAAA9B,CAAAA,CAAY,CAAA,CACvE8B,IAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAU,CAACV,GAAAA,CACX,OAAA,CAASG,EACT,SAAA,CAAWM,EAAAA,CACT,0CACAT,GAAAA,CACI,4EAAA,CACA,uCACN,CAAA,CACD,qBAED,CAAA,CAAA,CACF,CAAA,CAGDP,GACCiB,GAAAA,CAACG,CAAAA,CAAA,CAAc,WAAA,CAAa,CAAA,OAAA,EAAUjC,CAAAA,CAAY,WAAA,EAAa,CAAA,GAAA,CAAA,CAAO,CAAA,CAGxE8B,IAACI,CAAAA,CAAA,CACC,OACE/B,CAAAA,EAAaJ,GAAAA,GAAU,OACnB,SAAA,CACCA,GAAAA,EAAQ,SAAW,CAAA,CAClB,OAAA,CACA,KAEV,CAAA,CACA+B,GAAAA,CAACK,EAAA,CACE,QAAA,CAAA,CAACC,CAAAA,CAAMC,CAAAA,CAAOC,IACbd,IAAAA,CAAAe,QAAAA,CAAA,CACE,QAAA,CAAA,CAAAT,GAAAA,CAACU,EAAA,CACC,SAAA,CAAW7B,CAAAA,CAAa,UAAA,CAAa,OAErC,KAAA,CAAOyB,CAAAA,CAEP,SAAAN,GAAAA,CAACW,CAAAA,CAAA,CAAmB,QAAA,CAAAL,CAAAA,CAAK,KAAA,CAAM,CAAA,CAAA,CAH1BA,EAAK,KAIZ,CAAA,CACCC,IAAUC,CAAAA,CAAS,CAAA,EAAK,CAAC,CAAC9B,GAAAA,EACzBsB,IAACY,CAAAA,CAAA,CAAwB,GAAGlC,GAAAA,CAAgB,CAAA,CAAA,CAEhD,EAEJ,CAAA,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-CDHMNEJ5.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { ComboboxItem, ComboboxItemTitle, type ComboboxProps } from \"../ui/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxTrigger\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type FilterComboboxItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype FilterComboboxValueType<Value extends FilterComboboxItem, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value;\r\n\r\ntype BaseProps = {\r\n items: FilterComboboxItem[] | undefined\r\n placeholder?: string\r\n icon?: React.ReactNode\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n isPending?: boolean\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n disabled?: boolean\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n showTitle?: boolean\r\n showSearch?: boolean\r\n}\r\n\r\nexport type FilterComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxProps<Value, Multiple> & BaseProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox<Value extends FilterComboboxItem, Multiple extends boolean | undefined = false>({\r\n multiple,\r\n items,\r\n placeholder = \"Select\",\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n infiniteScroll,\r\n filter,\r\n ...props\r\n}: FilterComboboxProps<Value, Multiple>) {\r\n const isMultiple = multiple === true\r\n const showTitle = props.showTitle ?? isMultiple\r\n const showSearch = props.showSearch ?? isMultiple\r\n\r\n const [value, setValue] = useControlledState<FilterComboboxValueType<Value, Multiple> | null>({\r\n value: props?.value,\r\n defaultValue: props?.defaultValue,\r\n onChange: props.onValueChange as (\r\n value: FilterComboboxValueType<Value, Multiple> | null\r\n ) => void\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 // Normalize value to array for label & clear logic\r\n const valueArray = Array.isArray(value) ? value : value ? [value] : []\r\n const hasValue = valueArray.length > 0\r\n const count = valueArray.length\r\n\r\n const triggerLabel = !hasValue\r\n ? isMultiple\r\n ? `All ${placeholder}`\r\n : placeholder\r\n : isMultiple\r\n ? `${placeholder} (${count})`\r\n : valueArray[0]?.label ?? placeholder\r\n\r\n const handleClear = () => {\r\n setValue(null)\r\n }\r\n\r\n return (\r\n <Combobox\r\n items={items}\r\n multiple={multiple}\r\n value={value}\r\n onValueChange={setValue}\r\n inputValue={inputValue}\r\n onInputValueChange={setInputValue}\r\n filter={filter === null || !showSearch ? null : filter}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n {...props}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n \"group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue && \"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span\r\n className={cn(\r\n \"size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n >\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"truncate\">{triggerLabel}</span>\r\n <ChevronDownIcon\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup\r\n container={container}\r\n className={cn(\"w-72\", contentClassName)}\r\n align=\"start\"\r\n sideOffset={8}\r\n >\r\n <div className=\"flex flex-col\">\r\n {showTitle && (\r\n <div className=\"flex items-center justify-between p-3 border-b border-border-primary\">\r\n <span className=\"text-label-semibold-3 text-text-primary\">{placeholder}</span>\r\n <button\r\n type=\"button\"\r\n disabled={!hasValue}\r\n onClick={handleClear}\r\n className={cn(\r\n \"text-label-semibold-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear All\r\n </button>\r\n </div>\r\n )}\r\n\r\n {showSearch && (\r\n <ComboboxInput placeholder={`Search ${placeholder.toLowerCase()}...`} />\r\n )}\r\n\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : (items)?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {(item, index, length) => (\r\n <>\r\n <ComboboxItem\r\n indicator={isMultiple ? \"checkbox\" : undefined}\r\n key={item.value}\r\n value={item}\r\n >\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n {index === length - 1 && !!infiniteScroll && (\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n )}\r\n </>\r\n )}\r\n </ComboboxList>\r\n </div>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","multiple","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","filter","props","isMultiple","showTitle","showSearch","value","setValue","useControlledState","inputValue","setInputValue","valueArray","hasValue","count","triggerLabel","handleClear","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","item","index","length","Fragment","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qQA+CA,SAASA,EAA+F,CACtG,QAAA,CAAAC,IACA,KAAA,CAAAC,GAAAA,CACA,YAAAC,CAAAA,CAAc,QAAA,CACd,IAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,SAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,cAAA,CAAAC,GAAAA,CACA,OAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAyC,CACvC,IAAMC,CAAAA,CAAab,MAAa,IAAA,CAC1Bc,CAAAA,CAAYF,EAAM,SAAA,EAAaC,CAAAA,CAC/BE,EAAaH,CAAAA,CAAM,UAAA,EAAcC,CAAAA,CAEjC,CAACG,EAAOC,CAAQ,CAAA,CAAIC,mBAAoE,CAC5F,KAAA,CAAON,GAAO,KAAA,CACd,YAAA,CAAcA,GAAO,YAAA,CACrB,QAAA,CAAUA,EAAM,aAGlB,CAAC,EAEK,CAACO,CAAAA,CAAYC,GAAa,CAAA,CAAIF,kBAAAA,CAAmB,CACrD,KAAA,CAAON,GAAO,UAAA,EAAY,QAAA,GAC1B,YAAA,CAAcA,CAAAA,EAAO,mBAAmB,QAAA,EAAS,CACjD,QAAA,CAAUA,CAAAA,EAAO,kBACnB,CAAC,CAAA,CAGKS,EAAa,KAAA,CAAM,OAAA,CAAQL,CAAK,CAAA,CAAIA,CAAAA,CAAQA,CAAAA,CAAQ,CAACA,CAAK,CAAA,CAAI,GAC9DM,GAAAA,CAAWD,CAAAA,CAAW,OAAS,CAAA,CAC/BE,CAAAA,CAAQF,EAAW,MAAA,CAEnBG,CAAAA,CAAgBF,IAIlBT,CAAAA,CACE,CAAA,EAAGX,CAAW,CAAA,EAAA,EAAKqB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CAAA,CACF,GACF,CAEJ","file":"chunk-WN22TTEL.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { ComboboxItem, ComboboxItemTitle, type ComboboxProps } from \"../ui/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxTrigger\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type FilterComboboxItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype FilterComboboxValueType<Value extends FilterComboboxItem, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value;\r\n\r\ntype BaseProps = {\r\n items: FilterComboboxItem[] | undefined\r\n placeholder?: string\r\n icon?: React.ReactNode\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n isPending?: boolean\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n disabled?: boolean\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n showTitle?: boolean\r\n showSearch?: boolean\r\n}\r\n\r\nexport type FilterComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxProps<Value, Multiple> & BaseProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox<Value extends FilterComboboxItem, Multiple extends boolean | undefined = false>({\r\n multiple,\r\n items,\r\n placeholder = \"Select\",\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n infiniteScroll,\r\n filter,\r\n ...props\r\n}: FilterComboboxProps<Value, Multiple>) {\r\n const isMultiple = multiple === true\r\n const showTitle = props.showTitle ?? isMultiple\r\n const showSearch = props.showSearch ?? isMultiple\r\n\r\n const [value, setValue] = useControlledState<FilterComboboxValueType<Value, Multiple> | null>({\r\n value: props?.value,\r\n defaultValue: props?.defaultValue,\r\n onChange: props.onValueChange as (\r\n value: FilterComboboxValueType<Value, Multiple> | null\r\n ) => void\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 // Normalize value to array for label & clear logic\r\n const valueArray = Array.isArray(value) ? value : value ? [value] : []\r\n const hasValue = valueArray.length > 0\r\n const count = valueArray.length\r\n\r\n const triggerLabel = !hasValue\r\n ? isMultiple\r\n ? `All ${placeholder}`\r\n : placeholder\r\n : isMultiple\r\n ? `${placeholder} (${count})`\r\n : valueArray[0]?.label ?? placeholder\r\n\r\n const handleClear = () => {\r\n setValue(null)\r\n }\r\n\r\n return (\r\n <Combobox\r\n items={items}\r\n multiple={multiple}\r\n value={value}\r\n onValueChange={setValue}\r\n inputValue={inputValue}\r\n onInputValueChange={setInputValue}\r\n filter={filter === null || !showSearch ? null : filter}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n {...props}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n \"group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue && \"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span\r\n className={cn(\r\n \"size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n >\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"truncate\">{triggerLabel}</span>\r\n <ChevronDownIcon\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup\r\n container={container}\r\n className={cn(\"w-72\", contentClassName)}\r\n align=\"start\"\r\n sideOffset={8}\r\n >\r\n <div className=\"flex flex-col\">\r\n {showTitle && (\r\n <div className=\"flex items-center justify-between p-3 border-b border-border-primary\">\r\n <span className=\"text-label-semibold-3 text-text-primary\">{placeholder}</span>\r\n <button\r\n type=\"button\"\r\n disabled={!hasValue}\r\n onClick={handleClear}\r\n className={cn(\r\n \"text-label-semibold-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear All\r\n </button>\r\n </div>\r\n )}\r\n\r\n {showSearch && (\r\n <ComboboxInput placeholder={`Search ${placeholder.toLowerCase()}...`} />\r\n )}\r\n\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : (items)?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {(item, index, length) => (\r\n <>\r\n <ComboboxItem\r\n indicator={isMultiple ? \"checkbox\" : undefined}\r\n key={item.value}\r\n value={item}\r\n >\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n {index === length - 1 && !!infiniteScroll && (\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n )}\r\n </>\r\n )}\r\n </ComboboxList>\r\n </div>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a as a$3}from'./chunk-F77XVICY.js';import {a as a$1,b,c}from'./chunk-NGSCUYDU.js';import {b as b$1}from'./chunk-UINS73U7.js';import {a as a$2}from'./chunk-T7HRX3EC.js';import {b as b$2,e}from'./chunk-JLZNZFOO.js';import*as a from'react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {format}from'date-fns';import {ChevronDown}from'lucide-react';import'react-day-picker';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';function Z({className:P,value:M,onValueChange:i,defaultValue:N,required:d,disabled:p,placeholder:k="Pick dates",disabledDates:w,dateFormat:j="LLL dd, y",chipDateFormat:S="d MMM",maxVisible:l,...B}){let R=a.useCallback(e=>{d?e?.length&&i?.(e):i?.(e);},[i,d]),[t,u]=useControlledState({value:M,defaultValue:N,onChange:R}),[z,F]=a.useState(t?.[0]||new Date),[O,T]=a.useState(false),s=!!t?.length,m=a.useMemo(()=>t?[...t].sort((e,n)=>e.getTime()-n.getTime()):[],[t]),V=a.useCallback(e=>{let n=t?.filter(L=>L.getTime()!==e.getTime());d&&!n?.length||u(n);},[t,u,d]),I=l!==void 0?m.slice(0,l):m,b$3=l!==void 0?m.length-l:0;return jsxs("div",{className:"flex flex-col gap-2 w-full",children:[jsxs(a$1,{open:p?false:O,onOpenChange:T,children:[jsx(b,{className:"w-full",render:jsxs(b$1,{className:cn("group h-9 w-full justify-between rounded-xp-card-base border px-3 text-body-medium-3 transition-colors","border-border-primary bg-bg-primary text-text-secondary hover:bg-bg-primary-hover",s&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary","data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary","disabled:pointer-events-none disabled:opacity-50",P),variant:null,size:null,disabled:p,children:[jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[jsx(a$2,{className:cn("size-4 shrink-0",s?"text-fg-brand-primary":"text-fg-quaternary")}),jsx("span",{className:"truncate",children:s?`${t.length} ${t.length===1?"date":"dates"} selected`:k})]}),jsx(ChevronDown,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180",s?"text-fg-brand-primary":"text-fg-quaternary")})]})}),jsx(c,{className:"w-auto border-0 rounded-[20px] p-xp-none bg-transparent",style:{background:"linear-gradient(180deg, rgba(46, 51, 90, 0) 0%, rgba(28, 27, 51, 0.04) 100%), radial-gradient(146.13% 118.42% at 50% -15.5%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 99.59%)",backdropFilter:"blur(20px)",boxShadow:"0px 30px 60px 0px #0000001A"},children:jsx(a$3,{autoFocus:true,disabled:w,mode:"multiple",month:z,selected:t,onMonthChange:F,onSelect:e=>{d&&!e?.length||u(e);},...B})})]}),s&&jsxs("div",{className:"flex flex-wrap gap-2",children:[I.map(e$1=>jsxs(b$2,{color:"brand",size:"lg",className:"ring-1 ring-border-brand text-body-medium-3",children:[format(e$1,S),!p&&jsx(e,{className:"text-fg-quaternary",onClick:n=>{n.stopPropagation(),V(e$1);}})]},e$1.toISOString())),b$3>0&&jsxs(b$2,{color:"brand",size:"lg",className:"ring-1 ring-border-brand text-body-medium-3",children:["+",b$3]})]})]})}export{Z as a};//# sourceMappingURL=chunk-XIZN73T3.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-XIZN73T3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/date-multiple-picker.tsx"],"names":["DateMultiplePicker","className","valueProp","onValueChange","defaultValue","required","disabled","placeholder","disabledDates","dateFormat","chipDateFormat","maxVisible","props","handleValueChange","val","value","setValue","useControlledState","currentMonth","setCurrentMonth","isOpen","setIsOpen","hasValue","sortedValue","a","b","handleRemoveDate","dateToRemove","newValue","d","visibleChips","overflowCount","jsxs","Popover","jsx","PopoverTrigger","Button","cn","calendar_icon_default","ChevronDown","PopoverP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AVJU2H5V.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { format } from \"date-fns\"\r\nimport { ChevronDown } from \"lucide-react\"\r\nimport { type Matcher } from \"react-day-picker\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { CalendarIcon } from \"../icons\"\r\nimport { Button } from \"./button\"\r\nimport { Calendar, type CalendarProps } from \"./calendar\"\r\nimport { Popover, PopoverPopup, PopoverTrigger } from \"./popover\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\n\r\nexport type DateMultiplePickerProps = {\r\n className?: string\r\n value?: Date[]\r\n defaultValue?: Date[]\r\n required?: boolean\r\n disabled?: boolean\r\n placeholder?: string\r\n disabledDates?: Matcher | Matcher[] | undefined\r\n dateFormat?: string\r\n chipDateFormat?: string\r\n /** Maximum number of chips to show outside before collapsing the rest into a \"+N\" chip. */\r\n maxVisible?: number\r\n} & ({\r\n required: true\r\n onValueChange?: (value: Date[]) => void\r\n} | {\r\n required?: false\r\n onValueChange?: (value: Date[] | undefined) => void\r\n}) & Omit<CalendarProps, \"mode\" | \"selected\" | \"onSelect\" | \"month\" | \"onMonthChange\">\r\n\r\nfunction DateMultiplePicker({\r\n className,\r\n value: valueProp,\r\n onValueChange,\r\n defaultValue,\r\n required,\r\n disabled,\r\n placeholder = \"Pick dates\",\r\n disabledDates,\r\n dateFormat = \"LLL dd, y\",\r\n chipDateFormat = \"d MMM\",\r\n maxVisible,\r\n ...props\r\n}: DateMultiplePickerProps) {\r\n const handleValueChange = React.useCallback(\r\n (val: Date[] | undefined) => {\r\n if (required) {\r\n if (val?.length) onValueChange?.(val)\r\n } else {\r\n onValueChange?.(val)\r\n }\r\n },\r\n [onValueChange, required],\r\n )\r\n\r\n const [value, setValue] = useControlledState<Date[] | undefined>({\r\n value: valueProp,\r\n defaultValue,\r\n onChange: handleValueChange,\r\n })\r\n\r\n const [currentMonth, setCurrentMonth] = React.useState<Date | undefined>(value?.[0] || new Date())\r\n const [isOpen, setIsOpen] = React.useState(false)\r\n\r\n const hasValue = !!value?.length\r\n\r\n const sortedValue = React.useMemo(() => {\r\n if (!value) return []\r\n return [...value].sort((a, b) => a.getTime() - b.getTime())\r\n }, [value])\r\n\r\n const handleRemoveDate = React.useCallback(\r\n (dateToRemove: Date) => {\r\n const newValue = value?.filter((d) => d.getTime() !== dateToRemove.getTime())\r\n if (required && !newValue?.length) return\r\n setValue(newValue)\r\n },\r\n [value, setValue, required],\r\n )\r\n\r\n const visibleChips = maxVisible !== undefined ? sortedValue.slice(0, maxVisible) : sortedValue\r\n const overflowCount = maxVisible !== undefined ? sortedValue.length - maxVisible : 0\r\n\r\n return (\r\n <div className=\"flex flex-col gap-2 w-full\">\r\n <Popover open={disabled ? false : isOpen} onOpenChange={setIsOpen}>\r\n <PopoverTrigger\r\n className=\"w-full\"\r\n render={\r\n <Button\r\n className={cn(\r\n \"group h-9 w-full justify-between rounded-xp-card-base border px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary bg-bg-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue &&\r\n \"border-border-brand bg-bg-brand-primary text-text-brand-secondary\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n className,\r\n )}\r\n variant={null}\r\n size={null}\r\n disabled={disabled}\r\n >\r\n <span className=\"flex min-w-0 items-center gap-2\">\r\n <CalendarIcon\r\n className={cn(\r\n \"size-4 shrink-0\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\",\r\n )}\r\n />\r\n <span className=\"truncate\">\r\n {hasValue\r\n ? `${value.length} ${value.length === 1 ? \"date\" : \"dates\"} selected`\r\n : placeholder}\r\n </span>\r\n </span>\r\n <ChevronDown\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\",\r\n )}\r\n />\r\n </Button>\r\n }\r\n />\r\n <PopoverPopup\r\n className=\"w-auto border-0 rounded-[20px] p-xp-none bg-transparent\"\r\n style={{\r\n background:\r\n \"linear-gradient(180deg, rgba(46, 51, 90, 0) 0%, rgba(28, 27, 51, 0.04) 100%), radial-gradient(146.13% 118.42% at 50% -15.5%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 99.59%)\",\r\n backdropFilter: \"blur(20px)\",\r\n boxShadow: \"0px 30px 60px 0px #0000001A\",\r\n }}\r\n >\r\n <Calendar\r\n autoFocus\r\n disabled={disabledDates}\r\n mode=\"multiple\"\r\n month={currentMonth}\r\n selected={value}\r\n onMonthChange={setCurrentMonth}\r\n onSelect={(val) => {\r\n if (required && !val?.length) return\r\n setValue(val)\r\n }}\r\n {...props}\r\n />\r\n </PopoverPopup>\r\n </Popover>\r\n\r\n {hasValue && (\r\n <div className=\"flex flex-wrap gap-2\">\r\n {visibleChips.map((d) => (\r\n <Badge\r\n key={d.toISOString()}\r\n color=\"brand\"\r\n size=\"lg\"\r\n className=\"ring-1 ring-border-brand text-body-medium-3\"\r\n >\r\n {format(d, chipDateFormat)}\r\n {!disabled && (\r\n <BadgeButton\r\n className=\"text-fg-quaternary\"\r\n onClick={(e) => {\r\n e.stopPropagation()\r\n handleRemoveDate(d)\r\n }}\r\n />\r\n )}\r\n </Badge>\r\n ))}\r\n {overflowCount > 0 && (\r\n <Badge\r\n color=\"brand\"\r\n size=\"lg\"\r\n className=\"ring-1 ring-border-brand text-body-medium-3\"\r\n >\r\n +{overflowCount}\r\n </Badge>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport { DateMultiplePicker }"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/date-multiple-picker.tsx"],"names":["DateMultiplePicker","className","valueProp","onValueChange","defaultValue","required","disabled","placeholder","disabledDates","dateFormat","chipDateFormat","maxVisible","props","handleValueChange","val","value","setValue","useControlledState","currentMonth","setCurrentMonth","isOpen","setIsOpen","hasValue","sortedValue","a","b","handleRemoveDate","dateToRemove","newValue","d","visibleChips","overflowCount","jsxs","Popover","jsx","PopoverTrigger","Button","cn","calendar_icon_default","ChevronDown","PopoverPopup","Calendar","Badge","format","BadgeButton","e"],"mappings":"keAqCA,SAASA,CAAAA,CAAmB,CAC1B,SAAA,CAAAC,CAAAA,CACA,MAAOC,CAAAA,CACP,aAAA,CAAAC,EACA,YAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,WAAA,CAAAC,CAAAA,CAAc,aACd,aAAA,CAAAC,CAAAA,CACA,WAAAC,CAAAA,CAAa,WAAA,CACb,eAAAC,CAAAA,CAAiB,OAAA,CACjB,WAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAA4B,CAC1B,IAAMC,CAAAA,CAA0B,CAAA,CAAA,WAAA,CAC7BC,GAA4B,CACvBT,CAAAA,CACES,GAAK,MAAA,EAAQX,CAAAA,GAAgBW,CAAG,CAAA,CAEpCX,CAAAA,GAAgBW,CAAG,EAEvB,CAAA,CACA,CAACX,CAAAA,CAAeE,CAAQ,CAC1B,CAAA,CAEM,CAACU,EAAOC,CAAQ,CAAA,CAAIC,mBAAuC,CAC/D,KAAA,CAAOf,EACP,YAAA,CAAAE,CAAAA,CACA,SAAUS,CACZ,CAAC,EAEK,CAACK,CAAAA,CAAcC,CAAe,CAAA,CAAU,CAAA,CAAA,QAAA,CAA2BJ,IAAQ,CAAC,CAAA,EAAK,IAAI,IAAM,CAAA,CAC3F,CAACK,CAAAA,CAAQC,CAAS,EAAU,CAAA,CAAA,QAAA,CAAS,KAAK,EAE1CC,CAAAA,CAAW,CAAC,CAACP,CAAAA,EAAO,MAAA,CAEpBQ,EAAoB,CAAA,CAAA,OAAA,CAAQ,IAC3BR,EACE,CAAC,GAAGA,CAAK,CAAA,CAAE,IAAA,CAAK,CAACS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AAAA,CAACU,GAAAA,CAAA,CACC,KAAA,CAAM,OAAA,CACN,KAAK,IAAA,CACL,SAAA,CAAU,8CACX,QAAA,CAAA,CAAA,GAAA,CACGX,GAAAA,CAAAA,CACJ,CAAA,CAAA,CAEJ,CAAA,CAAA,CAEJ,CAEJ","file":"chunk-XIZN73T3.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { format } from \"date-fns\"\r\nimport { ChevronDown } from \"lucide-react\"\r\nimport { type Matcher } from \"react-day-picker\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { CalendarIcon } from \"../icons\"\r\nimport { Button } from \"./button\"\r\nimport { Calendar, type CalendarProps } from \"./calendar\"\r\nimport { Popover, PopoverPopup, PopoverTrigger } from \"./popover\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\n\r\nexport type DateMultiplePickerProps = {\r\n className?: string\r\n value?: Date[]\r\n defaultValue?: Date[]\r\n required?: boolean\r\n disabled?: boolean\r\n placeholder?: string\r\n disabledDates?: Matcher | Matcher[] | undefined\r\n dateFormat?: string\r\n chipDateFormat?: string\r\n /** Maximum number of chips to show outside before collapsing the rest into a \"+N\" chip. */\r\n maxVisible?: number\r\n} & ({\r\n required: true\r\n onValueChange?: (value: Date[]) => void\r\n} | {\r\n required?: false\r\n onValueChange?: (value: Date[] | undefined) => void\r\n}) & Omit<CalendarProps, \"mode\" | \"selected\" | \"onSelect\" | \"month\" | \"onMonthChange\">\r\n\r\nfunction DateMultiplePicker({\r\n className,\r\n value: valueProp,\r\n onValueChange,\r\n defaultValue,\r\n required,\r\n disabled,\r\n placeholder = \"Pick dates\",\r\n disabledDates,\r\n dateFormat = \"LLL dd, y\",\r\n chipDateFormat = \"d MMM\",\r\n maxVisible,\r\n ...props\r\n}: DateMultiplePickerProps) {\r\n const handleValueChange = React.useCallback(\r\n (val: Date[] | undefined) => {\r\n if (required) {\r\n if (val?.length) onValueChange?.(val)\r\n } else {\r\n onValueChange?.(val)\r\n }\r\n },\r\n [onValueChange, required],\r\n )\r\n\r\n const [value, setValue] = useControlledState<Date[] | undefined>({\r\n value: valueProp,\r\n defaultValue,\r\n onChange: handleValueChange,\r\n })\r\n\r\n const [currentMonth, setCurrentMonth] = React.useState<Date | undefined>(value?.[0] || new Date())\r\n const [isOpen, setIsOpen] = React.useState(false)\r\n\r\n const hasValue = !!value?.length\r\n\r\n const sortedValue = React.useMemo(() => {\r\n if (!value) return []\r\n return [...value].sort((a, b) => a.getTime() - b.getTime())\r\n }, [value])\r\n\r\n const handleRemoveDate = React.useCallback(\r\n (dateToRemove: Date) => {\r\n const newValue = value?.filter((d) => d.getTime() !== dateToRemove.getTime())\r\n if (required && !newValue?.length) return\r\n setValue(newValue)\r\n },\r\n [value, setValue, required],\r\n )\r\n\r\n const visibleChips = maxVisible !== undefined ? sortedValue.slice(0, maxVisible) : sortedValue\r\n const overflowCount = maxVisible !== undefined ? sortedValue.length - maxVisible : 0\r\n\r\n return (\r\n <div className=\"flex flex-col gap-2 w-full\">\r\n <Popover open={disabled ? false : isOpen} onOpenChange={setIsOpen}>\r\n <PopoverTrigger\r\n className=\"w-full\"\r\n render={\r\n <Button\r\n className={cn(\r\n \"group h-9 w-full justify-between rounded-xp-card-base border px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary bg-bg-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue &&\r\n \"border-border-brand bg-bg-brand-primary text-text-brand-secondary\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n className,\r\n )}\r\n variant={null}\r\n size={null}\r\n disabled={disabled}\r\n >\r\n <span className=\"flex min-w-0 items-center gap-2\">\r\n <CalendarIcon\r\n className={cn(\r\n \"size-4 shrink-0\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\",\r\n )}\r\n />\r\n <span className=\"truncate\">\r\n {hasValue\r\n ? `${value.length} ${value.length === 1 ? \"date\" : \"dates\"} selected`\r\n : placeholder}\r\n </span>\r\n </span>\r\n <ChevronDown\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\",\r\n )}\r\n />\r\n </Button>\r\n }\r\n />\r\n <PopoverPopup\r\n className=\"w-auto border-0 rounded-[20px] p-xp-none bg-transparent\"\r\n style={{\r\n background:\r\n \"linear-gradient(180deg, rgba(46, 51, 90, 0) 0%, rgba(28, 27, 51, 0.04) 100%), radial-gradient(146.13% 118.42% at 50% -15.5%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 99.59%)\",\r\n backdropFilter: \"blur(20px)\",\r\n boxShadow: \"0px 30px 60px 0px #0000001A\",\r\n }}\r\n >\r\n <Calendar\r\n autoFocus\r\n disabled={disabledDates}\r\n mode=\"multiple\"\r\n month={currentMonth}\r\n selected={value}\r\n onMonthChange={setCurrentMonth}\r\n onSelect={(val) => {\r\n if (required && !val?.length) return\r\n setValue(val)\r\n }}\r\n {...props}\r\n />\r\n </PopoverPopup>\r\n </Popover>\r\n\r\n {hasValue && (\r\n <div className=\"flex flex-wrap gap-2\">\r\n {visibleChips.map((d) => (\r\n <Badge\r\n key={d.toISOString()}\r\n color=\"brand\"\r\n size=\"lg\"\r\n className=\"ring-1 ring-border-brand text-body-medium-3\"\r\n >\r\n {format(d, chipDateFormat)}\r\n {!disabled && (\r\n <BadgeButton\r\n className=\"text-fg-quaternary\"\r\n onClick={(e) => {\r\n e.stopPropagation()\r\n handleRemoveDate(d)\r\n }}\r\n />\r\n )}\r\n </Badge>\r\n ))}\r\n {overflowCount > 0 && (\r\n <Badge\r\n color=\"brand\"\r\n size=\"lg\"\r\n className=\"ring-1 ring-border-brand text-body-medium-3\"\r\n >\r\n +{overflowCount}\r\n </Badge>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport { DateMultiplePicker }"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-V5WX4TSN.js';import {a as a$1}from'./chunk-EY3W3WZX.js';import*as o 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 g=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 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:ring-2 focus-visible:ring-border-brand/20","aria-invalid:border-content-on-error-subtle-action aria-invalid:ring-2 aria-invalid:ring-content-on-error-subtle-action/20"),{variants:{size:{"3xs":"h-6 text-label-regular-4 px-2","2xs":"h-7 text-label-regular-4 px-2.5",xs:"h-8 text-body-regular-3 px-2.5",sm:"h-9 text-body-regular-3 px-3",md:"h-10 text-body-regular-2 px-3",lg:"h-11 text-body-regular-2 px-3.5",xl:"h-12 text-body-regular-2 px-4"},variant:{password:void 0},withStartContent:{true:"pl-9.5"},withEndContent:{true:"pr-9.5"}},compoundVariants:[{size:"3xs",withStartContent:true,className:"pl-7"},{size:"3xs",withEndContent:true,className:"pr-7"},{size:"2xs",withStartContent:true,className:"pl-7.5"},{size:"2xs",withEndContent:true,className:"pr-7.5"},{size:"xs",withStartContent:true,className:"pl-8"},{size:"xs",withEndContent:true,className:"pr-8"},{size:"sm",withStartContent:true,className:"pl-9"},{size:"sm",withEndContent:true,className:"pr-9"},{size:"md",withStartContent:true,className:"pl-9.5"},{size:"md",withEndContent:true,className:"pr-9.5"},{size:"lg",withStartContent:true,className:"pl-10"},{size:"lg",withEndContent:true,className:"pr-10"},{size:"xl",withStartContent:true,className:"pl-11"},{size:"xl",withEndContent:true,className:"pr-11"}],defaultVariants:{size:"md"}}),l=cva("absolute top-1/2 -translate-y-1/2 text-fg-quaternary [&_svg]:size-full",{variants:{side:{start:"left-3",end:"right-3"},size:{"3xs":"size-3.5","2xs":"size-3.5",xs:"size-4",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-5"}},compoundVariants:[{side:"start",size:"3xs",className:"left-2"},{side:"end",size:"3xs",className:"right-2"},{side:"start",size:"2xs",className:"left-2"},{side:"end",size:"2xs",className:"right-2"},{side:"start",size:"xs",className:"left-2.5"},{side:"end",size:"xs",className:"right-2.5"},{side:"start",size:"sm",className:"left-3"},{side:"end",size:"sm",className:"right-3"},{side:"start",size:"md",className:"left-3"},{side:"end",size:"md",className:"right-3"},{side:"start",size:"lg",className:"left-3.5"},{side:"end",size:"lg",className:"right-3.5"},{side:"start",size:"xl",className:"left-4"},{side:"end",size:"xl",className:"right-4"}],defaultVariants:{side:"start",size:"md"}});function V({className:x,wrapperClassName:h,type:w,startContent:r,endContent:i,variant:t,size:a$2,...N}){let[n,z]=o.useState(false),p=!!r||!!i||t==="password";return jsxs(p?"div":o.Fragment,{...p?{className:cn("relative",h)}:{},children:[jsx("input",{className:cn(g({withStartContent:!!r,withEndContent:!!i||t==="password",size:a$2}),x),"data-slot":"input",type:t==="password"?n?"text":"password":w,...N}),r&&jsx(Slot,{className:cn(l({side:"start",size:a$2})),children:r}),i&&t!=="password"&&jsx(Slot,{className:cn(l({side:"end",size:a$2})),children:i}),t==="password"&&jsx(Slot,{"aria-label":n?"Hide password":"Show password",className:"cursor-pointer select-none","data-slot":"toggle-password",onClick:()=>z(b=>!b),children:n?jsx(a,{className:cn(l({side:"end",size:a$2}))}):jsx(a$1,{className:cn(l({side:"end",size:a$2}))})})]})}export{g as a,V as b};//# sourceMappingURL=chunk-Y6TKCAAJ.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-Y6TKCAAJ.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","show_passwords_icon_default","hide_passwords_icon_default"],"mappings":"oQASA,IAAMA,CAAAA,CAAgBC,GAAAA,CACpBC,EAAAA,CACE,4VAAA,CACA,2FAAA,CACA,4HACF,CAAA,CACA,CACE,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,KAAA,CAAO,+BAAA,CACP,KAAA,CAAO,iCAAA,CACP,EAAA,CAAI,gCAAA,CACJ,EAAA,CAAI,8BAAA,CACJ,EAAA,CAAI,+BAAA,CACJ,EAAA,CAAI,iCAAA,CACJ,EAAA,CAAI,+BACN,CAAA,CACA,OAAA,CAAS,CACP,QAAA,CAAU,MACZ,CAAA,CACA,gBAAA,CAAkB,CAChB,IAAA,CAAM,QACR,CAAA,CACA,cAAA,CAAgB,CACd,KAAM,QACR,CACF,CAAA,CACA,gBAAA,CAAkB,CAChB,CAAE,IAAA,CAAM,KAAA,CAAO,gBAAA,CAAkB,IAAA,CAAM,SAAA,CAAW,MAAO,CAAA,CACzD,CAAE,IAAA,CAAM,KAAA,CAAO,cAAA,CAAgB,IAAA,CAAM,SAAA,CAAW,MAAO,CAAA,CACvD,CAAE,IAAA,CAAM,KAAA,CAAO,gBAAA,CAAkB,IAAA,CAAM,SAAA,CAAW,QAAS,CAAA,CAC3D,CAAE,IAAA,CAAM,KAAA,CAAO,eAAgB,IAAA,CAAM,SAAA,CAAW,QAAS,CAAA,CACzD,CAAE,IAAA,CAAM,IAAA,CAAM,gBAAA,CAAkB,IAAA,CAAM,SAAA,CAAW,MAAO,CAAA,CACxD,CAAE,IAAA,CAAM,IAAA,CAAM,cAAA,CAAgB,IAAA,CAAM,SAAA,CAAW,MAAO,CAAA,CACtD,CAAE,IAAA,CAAM,IAAA,CAAM,gBAAA,CAAkB,IAAA,CAAM,SAAA,CAAW,MAAO,CAAA,CACxD,CAA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CAAA,CACC,YAAA,CAAYL,CAAAA,CAAe,eAAA,CAAkB,eAAA,CAC7C,SAAA,CAAU,4BAAA,CACV,WAAA,CAAU,iBAAA,CACV,OAAA,CAAS,IAAMC,CAAAA,CAAiBK,CAAAA,EAAS,CAACA,CAAI,EAE7C,QAAA,CAAAN,CAAAA,CACCI,GAAAA,CAACG,CAAAA,CAAA,CAAkB,SAAA,CAAWlB,EAAAA,CAAGC,CAAAA,CAAkB,CAAE,IAAA,CAAM,KAAA,CAAO,IAAA,CAAAQ,GAAK,CAAC,CAAC,CAAA,CAAG,CAAA,CAE5EM,GAAAA,CAACI,GAAAA,CAAA,CAAkB,SAAA,CAAWnB,EAAAA,CAAGC,CAAAA,CAAkB,CAAE,IAAA,CAAM,KAAA,CAAO,IAAA,CAAAQ,GAAK,CAAC,CAAC,CAAA,CAAG,CAAA,CAEhF,GAEJ,CAEJ","file":"chunk-Y6TKCAAJ.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\nimport { HidePasswordsIcon, ShowPasswordsIcon } from \"../icons\"\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 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:ring-2 focus-visible:ring-border-brand/20\",\r\n \"aria-invalid:border-content-on-error-subtle-action aria-invalid:ring-2 aria-invalid:ring-content-on-error-subtle-action/20\"\r\n ),\r\n {\r\n variants: {\r\n size: {\r\n \"3xs\": \"h-6 text-label-regular-4 px-2\",\r\n \"2xs\": \"h-7 text-label-regular-4 px-2.5\",\r\n xs: \"h-8 text-body-regular-3 px-2.5\",\r\n sm: \"h-9 text-body-regular-3 px-3\",\r\n md: \"h-10 text-body-regular-2 px-3\",\r\n lg: \"h-11 text-body-regular-2 px-3.5\",\r\n xl: \"h-12 text-body-regular-2 px-4\",\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 compoundVariants: [\r\n { size: \"3xs\", withStartContent: true, className: \"pl-7\" },\r\n { size: \"3xs\", withEndContent: true, className: \"pr-7\" },\r\n { size: \"2xs\", withStartContent: true, className: \"pl-7.5\" },\r\n { size: \"2xs\", withEndContent: true, className: \"pr-7.5\" },\r\n { size: \"xs\", withStartContent: true, className: \"pl-8\" },\r\n { size: \"xs\", withEndContent: true, className: \"pr-8\" },\r\n { size: \"sm\", withStartContent: true, className: \"pl-9\" },\r\n { size: \"sm\", withEndContent: true, className: \"pr-9\" },\r\n { size: \"md\", withStartContent: true, className: \"pl-9.5\" },\r\n { size: \"md\", withEndContent: true, className: \"pr-9.5\" },\r\n { size: \"lg\", withStartContent: true, className: \"pl-10\" },\r\n { size: \"lg\", withEndContent: true, className: \"pr-10\" },\r\n { size: \"xl\", withStartContent: true, className: \"pl-11\" },\r\n { size: \"xl\", withEndContent: true, className: \"pr-11\" },\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 text-fg-quaternary [&_svg]:size-full\",\r\n {\r\n variants: {\r\n side: {\r\n start: \"left-3\",\r\n end: \"right-3\",\r\n },\r\n size: {\r\n \"3xs\": \"size-3.5\",\r\n \"2xs\": \"size-3.5\",\r\n xs: \"size-4\",\r\n sm: \"size-4\",\r\n md: \"size-4.5\",\r\n lg: \"size-5\",\r\n xl: \"size-5\",\r\n },\r\n },\r\n compoundVariants: [\r\n { side: \"start\", size: \"3xs\", className: \"left-2\" },\r\n { side: \"end\", size: \"3xs\", className: \"right-2\" },\r\n { side: \"start\", size: \"2xs\", className: \"left-2\" },\r\n { side: \"end\", size: \"2xs\", className: \"right-2\" },\r\n { side: \"start\", size: \"xs\", className: \"left-2.5\" },\r\n { side: \"end\", size: \"xs\", className: \"right-2.5\" },\r\n { side: \"start\", size: \"sm\", className: \"left-3\" },\r\n { side: \"end\", size: \"sm\", className: \"right-3\" },\r\n { side: \"start\", size: \"md\", className: \"left-3\" },\r\n { side: \"end\", size: \"md\", className: \"right-3\" },\r\n { side: \"start\", size: \"lg\", className: \"left-3.5\" },\r\n { side: \"end\", size: \"lg\", className: \"right-3.5\" },\r\n { side: \"start\", size: \"xl\", className: \"left-4\" },\r\n { side: \"end\", size: \"xl\", className: \"right-4\" },\r\n ],\r\n defaultVariants: {\r\n side: \"start\",\r\n size: \"md\",\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\", size }))}>\r\n {startContent}\r\n </Slot>\r\n )}\r\n {(endContent && variant !== \"password\") && (\r\n <Slot className={cn(inputIconVariants({ side: \"end\", size }))}>\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 <ShowPasswordsIcon className={cn(inputIconVariants({ side: \"end\", size }))} />\r\n ) : (\r\n <HidePasswordsIcon className={cn(inputIconVariants({ side: \"end\", size }))} />\r\n )}\r\n </Slot>\r\n )}\r\n </Comp>\r\n )\r\n}\r\n\r\nexport { Input, inputVariants }\r\n\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,b as b$1,j,i,k,l,m,q,s,w,x,H}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a,b as b$1,j,i,k,l,m,q,s,w,x,H}from'./chunk-RHWRIE3E.js';import {g}from'./chunk-HHG7BSWN.js';import {b}from'./chunk-Y6TKCAAJ.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 ee({multiple:B=true,inputPlaceholder:q$1="Search...",container:A,items:u,infiniteScroll:H$1,isPending:U,taggable:b$2=false,maxVisible:i$1,...m$1}){let[h,x$1]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[c,g$1]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[v,I]=r.useState([]),p=r.useRef(new Set);r.useEffect(()=>{let e=new Set(c.map(t=>t.value));I(t=>{let l=t.filter(a=>e.has(a.value));return l.length===t.length?t:(p.current=new Set(l.map(a=>a.value)),l)});},[c]);let n=h?.toString().trim()??"",X=r.useMemo(()=>n?c.some(e=>e.value.toLowerCase()===n.toLowerCase()):false,[n,c]),C=r.useMemo(()=>!b$2||!n?false:!u?.some(e=>e.label.toLowerCase()===n.toLowerCase()),[b$2,n,u]),D=r.useMemo(()=>{let e=[...u??[],...v];if(C){let t={label:n,value:n,tag:true};return [...e,t]}return e},[u,v,C,n]);return jsxs(a,{...m$1,behavior:"chip-outside",multiple:true,items:b$2?D:u,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{if(b$2){let l=e.filter(a=>a?.tag===true&&!p.current.has(a.value));if(l.length>0){for(let a of l)p.current.add(a.value);I(a=>[...a,...l]);}}g$1(B?e:[e[e.length-1]],t);},onInputValueChange:x$1,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(g,{render:jsx(b,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(b$1,{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=>{x$1("",{reason:"none",event:e.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:q$1,startContent:jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),wrapperClassName:"w-full"})}),jsx(j,{className:cn(i$1!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(i,{children:e=>{let t=i$1!==void 0?e.slice(0,i$1):e,l$1=i$1!==void 0?e.length-i$1:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(k,{className:cn(i$1!==void 0&&"min-w-0 shrink"),children:[i$1!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(l,{})]},a?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}})})]}),jsxs(m,{container:A,children:[jsx(q,{status:U||u===void 0?"pending":u?.length===0&&!C?"empty":null}),jsxs(s,{children:[u?.map(e=>jsx(w,{value:{label:e.label,value:e.value},children:jsx(x,{children:e.label})},e.value)),C&&jsx(w,{value:{label:n,value:n,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!X&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:n})]})}),jsx(H,{...H$1})]})]})]})}export{ee as a};//# sourceMappingURL=chunk-YNJZ2P52.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-YNJZ2P52.js.map
|
|
@@ -1 +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","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qWA6CA,SAASA,EAAAA,CAAgF,CACvF,QAAA,CAAAC,EAAW,IAAA,CACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,UAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,GAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,IAAW,KAAA,CACX,UAAA,CAAAC,GAAAA,CACA,GAAGC,GACL,CAAA,CAAoC,CAClC,GAAM,CAACC,EAAYC,GAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,GAC1B,YAAA,CAAcA,GAAAA,EAAO,iBAAA,EAAmB,QAAA,G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EACtB,OAAA,CACA,IAAA,CAEV,CAAA,CACAI,IAAAA,CAACwB,CAAAA,CAAA,CACE,QAAA,CAAA,CAAAjD,CAAAA,EAAO,IAAKkB,CAAAA,EACXc,GAAAA,CAACkB,CAAAA,CAAA,CAEC,MAAO,CAAE,KAAA,CAAOhC,CAAAA,CAAK,KAAA,CAAO,MAAOA,CAAAA,CAAK,KAAM,CAAA,CAE9C,QAAA,CAAAc,GAAAA,CAACmB,CAAAA,CAAA,CACE,QAAA,CAAAjC,EAAK,KAAA,CACR,CAAA,CAAA,CALKA,CAAAA,CAAK,KAMZ,CACD,CAAA,CACAG,CAAAA,EACCW,GAAAA,CAACkB,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,KAAA,CAAO/B,CAAAA,CAAc,KAAA,CAAOA,CAAAA,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,CAAAA,CACH,GACF,CAAA,CACF,CAAA,CAEFa,GAAAA,CAACoB,CAAAA,CAAA,CAAwB,GAAGnD,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-ON7PUZWI.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 ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle\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 wrapperClassName=\"w-full\"\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 <ComboboxPopup 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 <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\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 </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}
|
|
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","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qWA6CA,SAASA,EAAAA,CAAgF,CACvF,QAAA,CAAAC,EAAW,IAAA,CACX,gBAAA,C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nD,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-YNJZ2P52.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 ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle\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 wrapperClassName=\"w-full\"\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 <ComboboxPopup 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 <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\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 </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$1,e,f,k,i,j,g,h as h$1,m,l}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {a as a$1,e,f,k,i,j,g,h as h$1,m,l}from'./chunk-ZK7MHZFG.js';import*as r from'react';import {X}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';var b={isOpen:false,config:{title:"",confirmText:"OK",cancelText:"Cancel",denyText:"Deny",variant:"default",showCancel:false,showDeny:false,showCloseButton:false,position:"center",textAlign:"left",footerLayout:"row",className:""},resolver:null},a=null,R={add:t=>{if(!a){console.warn("AlertDialog: Alerter component not mounted");return}a({isOpen:true,config:{confirmText:"OK",cancelText:"Cancel",denyText:"Deny",variant:"default",showCancel:false,showDeny:false,showCloseButton:false,position:"center",textAlign:"left",footerLayout:"row",className:"",...t},resolver:null});},confirm:t=>new Promise(o=>{if(!a){console.warn("AlertDialog: Alerter component not mounted"),o("cancel");return}a({isOpen:true,config:{confirmText:"Confirm",cancelText:"Cancel",denyText:"Deny",variant:"default",showCancel:true,showDeny:false,showCloseButton:false,position:"center",textAlign:"left",footerLayout:"row",className:"",...t},resolver:o});})},h=(t="center")=>({"top-start":"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:left-4 sm:right-auto sm:translate-x-0 sm:translate-y-0","top-center":"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:left-1/2 sm:-translate-x-1/2 sm:translate-y-0","top-end":"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:right-4 sm:left-auto sm:translate-x-0 sm:translate-y-0","bottom-start":"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:left-4 sm:right-auto sm:translate-x-0 sm:translate-y-0","bottom-center":"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:left-1/2 sm:-translate-x-1/2 sm:translate-y-0","bottom-end":"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:right-4 sm:left-auto sm:translate-x-0 sm:translate-y-0",center:"sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2"})[t];function T(){let[t,o]=r.useState(b);r.useEffect(()=>(a=o,()=>{a=null;}),[]);let x=async()=>{t.config.onConfirm&&await t.config.onConfirm(),t.resolver&&t.resolver("confirm"),o(n=>({...n,isOpen:false,resolver:null}));},C=async()=>{t.config.onDeny&&await t.config.onDeny(),t.resolver&&t.resolver("deny"),o(n=>({...n,isOpen:false,resolver:null}));},i$1=()=>{t.config.onCancel&&t.config.onCancel(),t.resolver&&t.resolver("cancel"),o(n=>({...n,isOpen:false,resolver:null}));};return jsx(a$1,{open:t.isOpen,onOpenChange:n=>{n||i$1();},children:jsxs(e,{className:cn(h(t.config.position),t.config.className),children:[t.config.showCloseButton&&jsxs("button",{type:"button","aria-label":t.config.closeAriaLabel||"Close",className:"absolute right-3.5 top-3.5 rounded-xp-card-base-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10",onClick:i$1,children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:t.config.closeAriaLabel||"Close"})]}),jsxs(f,{className:cn(t.config.textAlign==="center"?"items-center text-center grid-cols-1":t.config.textAlign==="right"?"items-end text-right":"items-start text-left"),children:[t.config.icon&&jsx(k,{variant:t.config.variant==="destructive"?"error":"brand",children:t.config.icon}),jsx(i,{children:t.config.title}),t.config.description&&jsx(j,{children:t.config.description})]}),t.config.additionalContents&&jsx(g,{children:t.config.additionalContents}),jsxs(h$1,{className:cn(t.config.footerLayout==="col"?"sm:flex-col flex-col gap-2 items-stretch":"flex-row justify-end gap-2 items-center"),children:[t.config.showCancel&&jsx(m,{className:t.config.footerLayout==="col"?"w-full":void 0,onClick:i$1,...t.config.cancelButtonProps,children:t.config.cancelText}),t.config.showDeny&&jsx(l,{className:t.config.footerLayout==="col"?"w-full":void 0,onClick:C,color:t.config.denyButtonProps?.color||"destructive",variant:t.config.denyButtonProps?.variant||"secondary",...t.config.denyButtonProps,children:t.config.denyText}),jsx(l,{className:t.config.footerLayout==="col"?"w-full":void 0,onClick:x,color:t.config.confirmButtonProps?.color||(t.config.variant==="destructive"?"destructive":"default"),variant:t.config.confirmButtonProps?.variant||"primary",...t.config.confirmButtonProps,children:t.config.confirmText})]})]})})}export{R as a,T as b};//# sourceMappingURL=chunk-YPV6XEV4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-YPV6XEV4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/alerter.tsx"],"names":["globalAlertState","globalSetState","alert","options","resolve","getPositionClasses","position","Alerter","state","setState","handleConfirm","prev","handleDeny","handleCancel","jsx","AlertDialog","open","jsxs","AlertDialogPopup","cn","X","AlertDialogHeader","AlertDialogIcon","AlertDialogTitle","AlertDialogDescription","AlertDialogContent","AlertDialogFooter","AlertDialogCancel","AlertDialogAction"],"mappings":"mMAgEA,IAAMA,CAAAA,CAA+B,CACnC,MAAA,CAAQ,KAAA,CACR,MAAA,CAAQ,CACN,KAAA,CAAO,EAAA,CACP,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,SACZ,QAAA,CAAU,MAAA,CACV,OAAA,CAAS,SAAA,CACT,UAAA,CAAY,KAAA,CACZ,QAAA,CAAU,KAAA,CACV,eAAA,CAAiB,KAAA,CACjB,QAAA,CAAU,QAAA,CACV,SAAA,CAAW,MAAA,CACX,YAAA,CAAc,KAAA,CACd,UAAW,EACb,CAAA,CACA,QAAA,CAAU,IACZ,CAAA,CAEIC,CAAAA,CAA0E,IAAA,CAGjEC,CAAAA,CAAQ,CACnB,GAAA,CAAMC,CAAAA,EAA0B,CAC9B,GAAI,CAACF,CAAAA,CAAgB,CACnB,QAAQ,IAAA,CAAK,4CAA4C,CAAA,CACzD,MACF,CAEAA,CAAAA,CAAe,CACb,MAAA,CAAQ,IAAA,CACR,MAAA,CAAQ,CACN,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,QAAA,CACZ,QAAA,CAAU,OACV,OAAA,CAAS,SAAA,CACT,UAA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CAAM,MAAA,CAAO,kBAAA,EAAoB,OAAA,EAAW,SAAA,CACpD,GAAGA,CAAAA,CAAM,MAAA,CAAO,kBAAA,CAEhB,QAAA,CAAAA,CAAAA,CAAM,MAAA,CAAO,WAAA,CAChB,CAAA,CAAA,CACF,CAAA,CAAA,CACF,EACF,CAEJ","file":"chunk-LFNLGW5G.js","sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { X } from \"lucide-react\";\r\nimport { cn } from \"@xploreu/lib/cn\";\r\nimport {\r\n AlertDialog,\r\n AlertDialogAction,\r\n AlertDialogCancel,\r\n AlertDialogContent,\r\n AlertDialogPopup,\r\n AlertDialogDescription,\r\n AlertDialogFooter,\r\n AlertDialogHeader,\r\n AlertDialogIcon,\r\n AlertDialogTitle,\r\n type AlertDialogActionProps,\r\n type AlertDialogCancelProps,\r\n} from \"./alert-dialog\";\r\n\r\n// Types\r\nexport type AlertPosition =\r\n | \"top-start\"\r\n | \"top-center\"\r\n | \"top-end\"\r\n | \"bottom-start\"\r\n | \"bottom-center\"\r\n | \"bottom-end\"\r\n | \"center\";\r\n\r\nexport interface AlertOptions {\r\n title: React.ReactNode;\r\n description?: React.ReactNode;\r\n icon?: React.ReactNode;\r\n confirmText?: string;\r\n cancelText?: string;\r\n denyText?: string;\r\n variant?: \"default\" | \"destructive\";\r\n showCancel?: boolean;\r\n showDeny?: boolean;\r\n position?: AlertPosition;\r\n textAlign?: \"left\" | \"center\" | \"right\";\r\n footerLayout?: \"row\" | \"col\";\r\n showCloseButton?: boolean;\r\n closeAriaLabel?: string;\r\n confirmButtonProps?: AlertDialogActionProps;\r\n cancelButtonProps?: AlertDialogCancelProps;\r\n denyButtonProps?: AlertDialogActionProps;\r\n onConfirm?: () => void | Promise<void>;\r\n onCancel?: () => void;\r\n onDeny?: () => void | Promise<void>;\r\n className?: string;\r\n additionalContents?: React.ReactNode;\r\n}\r\n\r\nexport type AlertResult = \"confirm\" | \"deny\" | \"cancel\";\r\n\r\ninterface AlertState {\r\n isOpen: boolean;\r\n config: AlertOptions;\r\n resolver: ((value: AlertResult) => void) | null;\r\n}\r\n\r\n// Global state\r\nconst globalAlertState: AlertState = {\r\n isOpen: false,\r\n config: {\r\n title: \"\",\r\n confirmText: \"OK\",\r\n cancelText: \"Cancel\",\r\n denyText: \"Deny\",\r\n variant: \"default\",\r\n showCancel: false,\r\n showDeny: false,\r\n showCloseButton: false,\r\n position: \"center\",\r\n textAlign: \"left\",\r\n footerLayout: \"row\",\r\n className: \"\",\r\n },\r\n resolver: null,\r\n};\r\n\r\nlet globalSetState: React.Dispatch<React.SetStateAction<AlertState>> | null = null;\r\n\r\n// Imperative Alert API\r\nexport const alert = {\r\n add: (options: AlertOptions) => {\r\n if (!globalSetState) {\r\n console.warn(\"AlertDialog: Alerter component not mounted\");\r\n return;\r\n }\r\n\r\n globalSetState({\r\n isOpen: true,\r\n config: {\r\n confirmText: \"OK\",\r\n cancelText: \"Cancel\",\r\n denyText: \"Deny\",\r\n variant: \"default\",\r\n showCancel: false,\r\n showDeny: false,\r\n showCloseButton: false,\r\n position: \"center\",\r\n textAlign: \"left\",\r\n footerLayout: \"row\",\r\n className: \"\",\r\n ...options,\r\n },\r\n resolver: null,\r\n });\r\n },\r\n\r\n confirm: (options: AlertOptions): Promise<AlertResult> => {\r\n return new Promise((resolve) => {\r\n if (!globalSetState) {\r\n console.warn(\"AlertDialog: Alerter component not mounted\");\r\n resolve(\"cancel\");\r\n return;\r\n }\r\n\r\n globalSetState({\r\n isOpen: true,\r\n config: {\r\n confirmText: \"Confirm\",\r\n cancelText: \"Cancel\",\r\n denyText: \"Deny\",\r\n variant: \"default\",\r\n showCancel: true,\r\n showDeny: false,\r\n showCloseButton: false,\r\n position: \"center\",\r\n textAlign: \"left\",\r\n footerLayout: \"row\",\r\n className: \"\",\r\n ...options,\r\n },\r\n resolver: resolve,\r\n });\r\n });\r\n },\r\n};\r\n\r\nconst getPositionClasses = (position: AlertPosition = \"center\") => {\r\n const positions: Record<AlertPosition, string> = {\r\n \"top-start\":\r\n \"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:left-4 sm:right-auto sm:translate-x-0 sm:translate-y-0\",\r\n \"top-center\":\r\n \"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:left-1/2 sm:-translate-x-1/2 sm:translate-y-0\",\r\n \"top-end\":\r\n \"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:right-4 sm:left-auto sm:translate-x-0 sm:translate-y-0\",\r\n \"bottom-start\":\r\n \"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:left-4 sm:right-auto sm:translate-x-0 sm:translate-y-0\",\r\n \"bottom-center\":\r\n \"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:left-1/2 sm:-translate-x-1/2 sm:translate-y-0\",\r\n \"bottom-end\":\r\n \"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:right-4 sm:left-auto sm:translate-x-0 sm:translate-y-0\",\r\n center: \"sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2\",\r\n };\r\n return positions[position];\r\n};\r\n\r\n// Alerter Component (mount once at root layout)\r\nexport function Alerter() {\r\n const [state, setState] = React.useState<AlertState>(globalAlertState);\r\n\r\n React.useEffect(() => {\r\n globalSetState = setState;\r\n return () => {\r\n globalSetState = null;\r\n };\r\n }, []);\r\n\r\n const handleConfirm = async () => {\r\n if (state.config.onConfirm) {\r\n await state.config.onConfirm();\r\n }\r\n if (state.resolver) {\r\n state.resolver(\"confirm\");\r\n }\r\n setState((prev) => ({ ...prev, isOpen: false, resolver: null }));\r\n };\r\n\r\n const handleDeny = async () => {\r\n if (state.config.onDeny) {\r\n await state.config.onDeny();\r\n }\r\n if (state.resolver) {\r\n state.resolver(\"deny\");\r\n }\r\n setState((prev) => ({ ...prev, isOpen: false, resolver: null }));\r\n };\r\n\r\n const handleCancel = () => {\r\n if (state.config.onCancel) {\r\n state.config.onCancel();\r\n }\r\n if (state.resolver) {\r\n state.resolver(\"cancel\");\r\n }\r\n setState((prev) => ({ ...prev, isOpen: false, resolver: null }));\r\n };\r\n\r\n return (\r\n <AlertDialog\r\n open={state.isOpen}\r\n onOpenChange={(open) => {\r\n if (!open) handleCancel();\r\n }}\r\n >\r\n <AlertDialogPopup\r\n className={cn(\r\n getPositionClasses(state.config.position),\r\n state.config.className\r\n )}\r\n >\r\n {state.config.showCloseButton && (\r\n <button\r\n type=\"button\"\r\n aria-label={state.config.closeAriaLabel || \"Close\"}\r\n className=\"absolute right-3.5 top-3.5 rounded-xp-card-base-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10\"\r\n onClick={handleCancel}\r\n >\r\n <X className=\"h-4 w-4\" />\r\n <span className=\"sr-only\">{state.config.closeAriaLabel || \"Close\"}</span>\r\n </button>\r\n )}\r\n <AlertDialogHeader\r\n className={cn(\r\n state.config.textAlign === \"center\"\r\n ? \"items-center text-center grid-cols-1\"\r\n : state.config.textAlign === \"right\"\r\n ? \"items-end text-right\"\r\n : \"items-start text-left\"\r\n )}\r\n >\r\n {state.config.icon && (\r\n <AlertDialogIcon\r\n variant={state.config.variant === \"destructive\" ? \"error\" : \"brand\"}\r\n >\r\n {state.config.icon}\r\n </AlertDialogIcon>\r\n )}\r\n <AlertDialogTitle>{state.config.title}</AlertDialogTitle>\r\n {state.config.description && (\r\n <AlertDialogDescription>\r\n {state.config.description}\r\n </AlertDialogDescription>\r\n )}\r\n </AlertDialogHeader>\r\n {state.config.additionalContents && (\r\n <AlertDialogContent>\r\n {state.config.additionalContents}\r\n </AlertDialogContent>\r\n )}\r\n <AlertDialogFooter\r\n className={cn(\r\n state.config.footerLayout === \"col\"\r\n ? \"sm:flex-col flex-col gap-2 items-stretch\"\r\n : \"flex-row justify-end gap-2 items-center\"\r\n )}\r\n >\r\n {state.config.showCancel && (\r\n <AlertDialogCancel\r\n className={state.config.footerLayout === \"col\" ? \"w-full\" : undefined}\r\n onClick={handleCancel}\r\n {...state.config.cancelButtonProps}\r\n >\r\n {state.config.cancelText}\r\n </AlertDialogCancel>\r\n )}\r\n {state.config.showDeny && (\r\n <AlertDialogAction\r\n className={state.config.footerLayout === \"col\" ? \"w-full\" : undefined}\r\n onClick={handleDeny}\r\n color={state.config.denyButtonProps?.color || \"destructive\"}\r\n variant={state.config.denyButtonProps?.variant || \"secondary\"}\r\n {...state.config.denyButtonProps}\r\n >\r\n {state.config.denyText}\r\n </AlertDialogAction>\r\n )}\r\n <AlertDialogAction\r\n className={state.config.footerLayout === \"col\" ? \"w-full\" : undefined}\r\n onClick={handleConfirm}\r\n color={\r\n state.config.confirmButtonProps?.color ||\r\n (state.config.variant === \"destructive\" ? \"destructive\" : \"default\")\r\n }\r\n variant={state.config.confirmButtonProps?.variant || \"primary\"}\r\n {...state.config.confirmButtonProps}\r\n >\r\n {state.config.confirmText}\r\n </AlertDialogAction>\r\n </AlertDialogFooter>\r\n </AlertDialogPopup>\r\n </AlertDialog>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/alerter.tsx"],"names":["globalAlertState","globalSetState","alert","options","resolve","getPositionClasses","position","Alerter","state","setState","handleConfirm","prev","handleDeny","handleCancel","jsx","AlertDialog","open","jsxs","AlertDialogPopup","cn","X","AlertDialogHeader","AlertDialogIcon","AlertDialogTitle","AlertDialogDescription","AlertDialogContent","AlertDialogFooter","AlertDialogCancel","AlertDialogAction"],"mappings":"mMAgEA,IAAMA,CAAAA,CAA+B,CACnC,MAAA,CAAQ,KAAA,CACR,MAAA,CAAQ,CACN,KAAA,CAAO,EAAA,CACP,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,SACZ,QAAA,CAAU,MAAA,CACV,OAAA,CAAS,SAAA,CACT,UAAA,CAAY,KAAA,CACZ,QAAA,CAAU,KAAA,CACV,eAAA,CAAiB,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M,MAAA,CAAO,iBAAiB,OAAA,EAAW,WAAA,CACjD,GAAGA,CAAAA,CAAM,MAAA,CAAO,eAAA,CAEhB,QAAA,CAAAA,CAAAA,CAAM,MAAA,CAAO,QAAA,CAChB,CAAA,CAEFM,GAAAA,CAACc,CAAAA,CAAA,CACC,SAAA,CAAWpB,CAAAA,CAAM,OAAO,YAAA,GAAiB,KAAA,CAAQ,QAAA,CAAW,MAAA,CAC5D,OAAA,CAASE,CAAAA,CACT,KAAA,CACEF,CAAAA,CAAM,MAAA,CAAO,kBAAA,EAAoB,KAAA,GAChCA,CAAAA,CAAM,MAAA,CAAO,OAAA,GAAY,aAAA,CAAgB,aAAA,CAAgB,WAE5D,OAAA,CAASA,CAAAA,CAAM,MAAA,CAAO,kBAAA,EAAoB,OAAA,EAAW,SAAA,CACpD,GAAGA,CAAAA,CAAM,MAAA,CAAO,kBAAA,CAEhB,QAAA,CAAAA,CAAAA,CAAM,MAAA,CAAO,WAAA,CAChB,CAAA,CAAA,CACF,CAAA,CAAA,CACF,EACF,CAEJ","file":"chunk-YPV6XEV4.js","sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { X } from \"lucide-react\";\r\nimport { cn } from \"@xploreu/lib/cn\";\r\nimport {\r\n AlertDialog,\r\n AlertDialogAction,\r\n AlertDialogCancel,\r\n AlertDialogContent,\r\n AlertDialogPopup,\r\n AlertDialogDescription,\r\n AlertDialogFooter,\r\n AlertDialogHeader,\r\n AlertDialogIcon,\r\n AlertDialogTitle,\r\n type AlertDialogActionProps,\r\n type AlertDialogCancelProps,\r\n} from \"./alert-dialog\";\r\n\r\n// Types\r\nexport type AlertPosition =\r\n | \"top-start\"\r\n | \"top-center\"\r\n | \"top-end\"\r\n | \"bottom-start\"\r\n | \"bottom-center\"\r\n | \"bottom-end\"\r\n | \"center\";\r\n\r\nexport interface AlertOptions {\r\n title: React.ReactNode;\r\n description?: React.ReactNode;\r\n icon?: React.ReactNode;\r\n confirmText?: string;\r\n cancelText?: string;\r\n denyText?: string;\r\n variant?: \"default\" | \"destructive\";\r\n showCancel?: boolean;\r\n showDeny?: boolean;\r\n position?: AlertPosition;\r\n textAlign?: \"left\" | \"center\" | \"right\";\r\n footerLayout?: \"row\" | \"col\";\r\n showCloseButton?: boolean;\r\n closeAriaLabel?: string;\r\n confirmButtonProps?: AlertDialogActionProps;\r\n cancelButtonProps?: AlertDialogCancelProps;\r\n denyButtonProps?: AlertDialogActionProps;\r\n onConfirm?: () => void | Promise<void>;\r\n onCancel?: () => void;\r\n onDeny?: () => void | Promise<void>;\r\n className?: string;\r\n additionalContents?: React.ReactNode;\r\n}\r\n\r\nexport type AlertResult = \"confirm\" | \"deny\" | \"cancel\";\r\n\r\ninterface AlertState {\r\n isOpen: boolean;\r\n config: AlertOptions;\r\n resolver: ((value: AlertResult) => void) | null;\r\n}\r\n\r\n// Global state\r\nconst globalAlertState: AlertState = {\r\n isOpen: false,\r\n config: {\r\n title: \"\",\r\n confirmText: \"OK\",\r\n cancelText: \"Cancel\",\r\n denyText: \"Deny\",\r\n variant: \"default\",\r\n showCancel: false,\r\n showDeny: false,\r\n showCloseButton: false,\r\n position: \"center\",\r\n textAlign: \"left\",\r\n footerLayout: \"row\",\r\n className: \"\",\r\n },\r\n resolver: null,\r\n};\r\n\r\nlet globalSetState: React.Dispatch<React.SetStateAction<AlertState>> | null = null;\r\n\r\n// Imperative Alert API\r\nexport const alert = {\r\n add: (options: AlertOptions) => {\r\n if (!globalSetState) {\r\n console.warn(\"AlertDialog: Alerter component not mounted\");\r\n return;\r\n }\r\n\r\n globalSetState({\r\n isOpen: true,\r\n config: {\r\n confirmText: \"OK\",\r\n cancelText: \"Cancel\",\r\n denyText: \"Deny\",\r\n variant: \"default\",\r\n showCancel: false,\r\n showDeny: false,\r\n showCloseButton: false,\r\n position: \"center\",\r\n textAlign: \"left\",\r\n footerLayout: \"row\",\r\n className: \"\",\r\n ...options,\r\n },\r\n resolver: null,\r\n });\r\n },\r\n\r\n confirm: (options: AlertOptions): Promise<AlertResult> => {\r\n return new Promise((resolve) => {\r\n if (!globalSetState) {\r\n console.warn(\"AlertDialog: Alerter component not mounted\");\r\n resolve(\"cancel\");\r\n return;\r\n }\r\n\r\n globalSetState({\r\n isOpen: true,\r\n config: {\r\n confirmText: \"Confirm\",\r\n cancelText: \"Cancel\",\r\n denyText: \"Deny\",\r\n variant: \"default\",\r\n showCancel: true,\r\n showDeny: false,\r\n showCloseButton: false,\r\n position: \"center\",\r\n textAlign: \"left\",\r\n footerLayout: \"row\",\r\n className: \"\",\r\n ...options,\r\n },\r\n resolver: resolve,\r\n });\r\n });\r\n },\r\n};\r\n\r\nconst getPositionClasses = (position: AlertPosition = \"center\") => {\r\n const positions: Record<AlertPosition, string> = {\r\n \"top-start\":\r\n \"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:left-4 sm:right-auto sm:translate-x-0 sm:translate-y-0\",\r\n \"top-center\":\r\n \"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:left-1/2 sm:-translate-x-1/2 sm:translate-y-0\",\r\n \"top-end\":\r\n \"data-[state=open]:slide-in-from-top-2 sm:top-4 sm:right-4 sm:left-auto sm:translate-x-0 sm:translate-y-0\",\r\n \"bottom-start\":\r\n \"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:left-4 sm:right-auto sm:translate-x-0 sm:translate-y-0\",\r\n \"bottom-center\":\r\n \"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:left-1/2 sm:-translate-x-1/2 sm:translate-y-0\",\r\n \"bottom-end\":\r\n \"data-[state=open]:slide-in-from-bottom-2 sm:bottom-4 sm:top-auto sm:right-4 sm:left-auto sm:translate-x-0 sm:translate-y-0\",\r\n center: \"sm:top-1/2 sm:left-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2\",\r\n };\r\n return positions[position];\r\n};\r\n\r\n// Alerter Component (mount once at root layout)\r\nexport function Alerter() {\r\n const [state, setState] = React.useState<AlertState>(globalAlertState);\r\n\r\n React.useEffect(() => {\r\n globalSetState = setState;\r\n return () => {\r\n globalSetState = null;\r\n };\r\n }, []);\r\n\r\n const handleConfirm = async () => {\r\n if (state.config.onConfirm) {\r\n await state.config.onConfirm();\r\n }\r\n if (state.resolver) {\r\n state.resolver(\"confirm\");\r\n }\r\n setState((prev) => ({ ...prev, isOpen: false, resolver: null }));\r\n };\r\n\r\n const handleDeny = async () => {\r\n if (state.config.onDeny) {\r\n await state.config.onDeny();\r\n }\r\n if (state.resolver) {\r\n state.resolver(\"deny\");\r\n }\r\n setState((prev) => ({ ...prev, isOpen: false, resolver: null }));\r\n };\r\n\r\n const handleCancel = () => {\r\n if (state.config.onCancel) {\r\n state.config.onCancel();\r\n }\r\n if (state.resolver) {\r\n state.resolver(\"cancel\");\r\n }\r\n setState((prev) => ({ ...prev, isOpen: false, resolver: null }));\r\n };\r\n\r\n return (\r\n <AlertDialog\r\n open={state.isOpen}\r\n onOpenChange={(open) => {\r\n if (!open) handleCancel();\r\n }}\r\n >\r\n <AlertDialogPopup\r\n className={cn(\r\n getPositionClasses(state.config.position),\r\n state.config.className\r\n )}\r\n >\r\n {state.config.showCloseButton && (\r\n <button\r\n type=\"button\"\r\n aria-label={state.config.closeAriaLabel || \"Close\"}\r\n className=\"absolute right-3.5 top-3.5 rounded-xp-card-base-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10\"\r\n onClick={handleCancel}\r\n >\r\n <X className=\"h-4 w-4\" />\r\n <span className=\"sr-only\">{state.config.closeAriaLabel || \"Close\"}</span>\r\n </button>\r\n )}\r\n <AlertDialogHeader\r\n className={cn(\r\n state.config.textAlign === \"center\"\r\n ? \"items-center text-center grid-cols-1\"\r\n : state.config.textAlign === \"right\"\r\n ? \"items-end text-right\"\r\n : \"items-start text-left\"\r\n )}\r\n >\r\n {state.config.icon && (\r\n <AlertDialogIcon\r\n variant={state.config.variant === \"destructive\" ? \"error\" : \"brand\"}\r\n >\r\n {state.config.icon}\r\n </AlertDialogIcon>\r\n )}\r\n <AlertDialogTitle>{state.config.title}</AlertDialogTitle>\r\n {state.config.description && (\r\n <AlertDialogDescription>\r\n {state.config.description}\r\n </AlertDialogDescription>\r\n )}\r\n </AlertDialogHeader>\r\n {state.config.additionalContents && (\r\n <AlertDialogContent>\r\n {state.config.additionalContents}\r\n </AlertDialogContent>\r\n )}\r\n <AlertDialogFooter\r\n className={cn(\r\n state.config.footerLayout === \"col\"\r\n ? \"sm:flex-col flex-col gap-2 items-stretch\"\r\n : \"flex-row justify-end gap-2 items-center\"\r\n )}\r\n >\r\n {state.config.showCancel && (\r\n <AlertDialogCancel\r\n className={state.config.footerLayout === \"col\" ? \"w-full\" : undefined}\r\n onClick={handleCancel}\r\n {...state.config.cancelButtonProps}\r\n >\r\n {state.config.cancelText}\r\n </AlertDialogCancel>\r\n )}\r\n {state.config.showDeny && (\r\n <AlertDialogAction\r\n className={state.config.footerLayout === \"col\" ? \"w-full\" : undefined}\r\n onClick={handleDeny}\r\n color={state.config.denyButtonProps?.color || \"destructive\"}\r\n variant={state.config.denyButtonProps?.variant || \"secondary\"}\r\n {...state.config.denyButtonProps}\r\n >\r\n {state.config.denyText}\r\n </AlertDialogAction>\r\n )}\r\n <AlertDialogAction\r\n className={state.config.footerLayout === \"col\" ? \"w-full\" : undefined}\r\n onClick={handleConfirm}\r\n color={\r\n state.config.confirmButtonProps?.color ||\r\n (state.config.variant === \"destructive\" ? \"destructive\" : \"default\")\r\n }\r\n variant={state.config.confirmButtonProps?.variant || \"primary\"}\r\n {...state.config.confirmButtonProps}\r\n >\r\n {state.config.confirmText}\r\n </AlertDialogAction>\r\n </AlertDialogFooter>\r\n </AlertDialogPopup>\r\n </AlertDialog>\r\n );\r\n}\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b as b$1,c,g,e,d,f,i,j,k as k$1}from'./chunk-WYVGUIHL.js';import {b as b$2}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {b as b$1,c,g,e,d,f,i,j,k as k$1}from'./chunk-WYVGUIHL.js';import {b as b$2}from'./chunk-UINS73U7.js';import'react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function _(r){return jsx(b$1,{...r})}function b(r){return jsx(c,{...r})}function T(r){return jsx(g,{...r})}function m({className:r,...o}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",r),...o})}function C({className:r,children:o,...l}){return jsxs(d,{children:[jsx(m,{}),jsx(f,{className:cn("group/alert-dialog-popup fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] bg-bg-primary shadow-xp-lg rounded-xl overflow-hidden",r),...l,children:o})]})}function h({className:r,...o}){return jsx("div",{"data-slot":"alert-dialog-header",className:cn("px-4 py-4 grid grid-cols-[auto_1fr] items-start bg-bg-primary",r),...o})}function w({className:r,...o}){return jsx("div",{"data-slot":"alert-dialog-content",className:cn("px-4 pb-4 max-h-[60vh] overflow-y-auto",r),...o})}function k({className:r,...o}){return jsx(i,{className:cn("flex gap-2 items-center justify-end bg-bg-primary px-4 py-3 border-t border-border-tertiary shadow-[0px_-1px_24px_0px_var(--color-shadow-xs)]",r),...o})}function B({className:r,...o}){return jsx(j,{className:cn("col-start-2 [&:not(:has(~_[data-slot=alert-dialog-description]))]:row-span-2 [&:not(:has(~_[data-slot=alert-dialog-description]))]:self-center text-label-bold-2 text-text-primary",r),...o})}function F({className:r,...o}){return jsx(k$1,{className:cn("col-start-2 mt-0.5 text-body-regular-3 text-text-secondary",r),...o})}function H({className:r,variant:o="brand",...l}){return jsx("div",{"data-slot":"alert-dialog-icon","data-variant":o,className:cn("row-span-2 flex items-center justify-center rounded-lg mt-px mr-3 p-2.5 [&_svg]:size-4 text-fg-white",o==="brand"&&"bg-bg-brand-solid shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]",o==="error"&&"bg-bg-error-solid shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-utility-error-100)]",r),...l})}function N({color:r="destructive",variant:o="primary",...l}){return jsx(b$2,{"data-slot":"alert-dialog-action",color:r,variant:o,...l})}function R({color:r="default",variant:o="secondary",size:l,...d}){return jsx(g,{"data-slot":"alert-dialog-cancel",render:jsx(b$2,{color:r,variant:o,size:l}),...d})}export{_ as a,b,T as c,m as d,C as e,h as f,w as g,k as h,B as i,F as j,H as k,N as l,R as m};//# sourceMappingURL=chunk-ZK7MHZFG.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZK7MHZFG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/alert-dialog.tsx"],"names":["AlertDialog","props","jsx","AlertDialogTrigger","AlertDialogClose","AlertDialogBackdrop","className","cn","AlertDialogPopup","children","jsxs","AlertDialogPortal","AlertDialogHeader","AlertDialogContent","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogIcon","variant","AlertDialogAction","color","Button","AlertDialogCancel","size"],"mappings":"qMA2BA,SAASA,CAAAA,CAAYC,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACF,GAAAA,CAAA,CAAsB,GAAGC,EAAO,CAC1C,CAIA,SAASE,CAAAA,CAAmBF,EAAgC,CAC1D,OAAOC,GAAAA,CAACC,CAAAA,CAAA,CAA6B,GAAGF,CAAAA,CAAO,CACjD,CAIA,SAASG,CAAAA,CAAiBH,CAAAA,CAA8B,CACtD,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAA2B,GAAGH,EAAO,CAC/C,CAIA,SAASI,CAAAA,CAAoB,CAAE,SAAA,CAAAC,CAAAA,CAA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AC3D,GAAGtB,EACN,CAEJ","file":"chunk-KL2GG3KE.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport {\r\n AlertDialog as AlertDialogPrimitive,\r\n AlertDialogTrigger as AlertDialogTriggerPrimitive,\r\n AlertDialogPortal as AlertDialogPortalPrimitive,\r\n AlertDialogBackdrop as AlertDialogBackdropPrimitive,\r\n AlertDialogPopup as AlertDialogPopupPrimitive,\r\n AlertDialogClose as AlertDialogClosePrimitive,\r\n AlertDialogFooter as AlertDialogFooterPrimitive,\r\n AlertDialogTitle as AlertDialogTitlePrimitive,\r\n AlertDialogDescription as AlertDialogDescriptionPrimitive,\r\n type AlertDialogProps as AlertDialogPrimitiveProps,\r\n type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,\r\n type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,\r\n type AlertDialogBackdropProps as AlertDialogBackdropPrimitiveProps,\r\n type AlertDialogPopupProps as AlertDialogPopupPrimitiveProps,\r\n type AlertDialogCloseProps as AlertDialogClosePrimitiveProps,\r\n type AlertDialogFooterProps as AlertDialogFooterPrimitiveProps,\r\n type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,\r\n type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,\r\n} from '../primitives/alert-dialog';\r\nimport { Button } from './button';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype AlertDialogProps = AlertDialogPrimitiveProps;\r\n\r\nfunction AlertDialog(props: AlertDialogProps) {\r\n return <AlertDialogPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogTriggerProps = AlertDialogTriggerPrimitiveProps;\r\n\r\nfunction AlertDialogTrigger(props: AlertDialogTriggerProps) {\r\n return <AlertDialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogCloseProps = AlertDialogClosePrimitiveProps;\r\n\r\nfunction AlertDialogClose(props: AlertDialogCloseProps) {\r\n return <AlertDialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogBackdropProps = AlertDialogBackdropPrimitiveProps;\r\n\r\nfunction AlertDialogBackdrop({ className, ...props }: AlertDialogBackdropProps) {\r\n return (\r\n <AlertDialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogPopupProps = AlertDialogPopupPrimitiveProps;\r\n\r\nfunction AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps) {\r\n return (\r\n <AlertDialogPortalPrimitive>\r\n <AlertDialogBackdrop />\r\n <AlertDialogPopupPrimitive\r\n className={cn(\r\n \"group/alert-dialog-popup fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] bg-bg-primary shadow-xp-lg rounded-xl overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </AlertDialogPopupPrimitive>\r\n </AlertDialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-header\"\r\n className={cn(\r\n \"px-4 py-4 grid grid-cols-[auto_1fr] items-start bg-bg-primary\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogContentProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogContent({ className, ...props }: AlertDialogContentProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-content\"\r\n className={cn(\"px-4 pb-4 max-h-[60vh] overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogFooterProps = AlertDialogFooterPrimitiveProps;\r\n\r\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\r\n return (\r\n <AlertDialogFooterPrimitive\r\n className={cn(\r\n \"flex gap-2 items-center justify-end bg-bg-primary px-4 py-3 border-t border-border-tertiary shadow-[0px_-1px_24px_0px_var(--color-shadow-xs)]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogTitleProps = AlertDialogTitlePrimitiveProps;\r\n\r\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\r\n return (\r\n <AlertDialogTitlePrimitive\r\n className={cn(\r\n \"col-start-2 [&:not(:has(~_[data-slot=alert-dialog-description]))]:row-span-2 [&:not(:has(~_[data-slot=alert-dialog-description]))]:self-center text-label-bold-2 text-text-primary\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogDescriptionProps = AlertDialogDescriptionPrimitiveProps;\r\n\r\nfunction AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {\r\n return (\r\n <AlertDialogDescriptionPrimitive\r\n className={cn(\"col-start-2 mt-0.5 text-body-regular-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogIconProps = React.ComponentProps<\"div\"> & {\r\n variant?: \"brand\" | \"error\";\r\n};\r\n\r\nfunction AlertDialogIcon({\r\n className,\r\n variant = \"brand\",\r\n ...props\r\n}: AlertDialogIconProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-icon\"\r\n data-variant={variant}\r\n className={cn(\r\n \"row-span-2 flex items-center justify-center rounded-lg mt-px mr-3 p-2.5 [&_svg]:size-4 text-fg-white\",\r\n variant === \"brand\" &&\r\n \"bg-bg-brand-solid shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]\",\r\n variant === \"error\" &&\r\n \"bg-bg-error-solid shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-utility-error-100)]\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogActionProps = React.ComponentProps<typeof Button>;\r\n\r\nfunction AlertDialogAction({\r\n color = \"destructive\",\r\n variant = \"primary\",\r\n ...props\r\n}: AlertDialogActionProps) {\r\n return (\r\n <Button\r\n data-slot=\"alert-dialog-action\"\r\n color={color}\r\n variant={variant}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogCancelProps = AlertDialogClosePrimitiveProps &\r\n Pick<React.ComponentProps<typeof Button>, \"color\" | \"variant\" | \"size\">;\r\n\r\nfunction AlertDialogCancel({\r\n color = \"default\",\r\n variant = \"secondary\",\r\n size,\r\n ...props\r\n}: AlertDialogCancelProps) {\r\n return (\r\n <AlertDialogClosePrimitive\r\n data-slot=\"alert-dialog-cancel\"\r\n render={<Button color={color} variant={variant} size={size} />}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogTrigger,\r\n AlertDialogClose,\r\n AlertDialogPopup,\r\n AlertDialogHeader,\r\n AlertDialogContent,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n AlertDialogIcon,\r\n AlertDialogBackdrop,\r\n AlertDialogAction,\r\n AlertDialogCancel,\r\n type AlertDialogProps,\r\n type AlertDialogTriggerProps,\r\n type AlertDialogCloseProps,\r\n type AlertDialogPopupProps,\r\n type AlertDialogHeaderProps,\r\n type AlertDialogContentProps,\r\n type AlertDialogFooterProps,\r\n type AlertDialogTitleProps,\r\n type AlertDialogDescriptionProps,\r\n type AlertDialogIconProps,\r\n type AlertDialogBackdropProps,\r\n type AlertDialogActionProps,\r\n type AlertDialogCancelProps,\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/alert-dialog.tsx"],"names":["AlertDialog","props","jsx","AlertDialogTrigger","AlertDialogClose","AlertDialogBackdrop","className","cn","AlertDialogPopup","children","jsxs","AlertDialogPortal","AlertDialogHeader","AlertDialogContent","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogIcon","variant","AlertDialogAction","color","Button","AlertDialogCancel","size"],"mappings":"qMA2BA,SAASA,CAAAA,CAAYC,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACF,GAAAA,CAAA,CAAsB,GAAGC,EAAO,CAC1C,CAIA,SAASE,CAAAA,CAAmBF,EAAgC,CAC1D,OAAOC,GAAAA,CAACC,CAAAA,CAAA,CAA6B,GAAGF,CAAAA,CAAO,CACjD,CAIA,SAASG,CAAAA,CAAiBH,CAAAA,CAA8B,CACtD,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAA2B,GAAGH,EAAO,CAC/C,CAIA,SAASI,CAAAA,CAAoB,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,CAAM,EAA6B,CAC9E,OACEC,GAAAA,CAACG,CAAAA,CAAA,CACC,SAAA,CAAWE,EAAAA,CAAG,iDAAA,CAAmDD,CAAS,EACzE,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASO,CAAAA,CAAiB,CAAE,SAAA,CAAAF,CAAAA,CAAW,SAAAG,CAAAA,CAAU,GAAGR,CAAM,CAAA,CAA0B,CAClF,OACES,IAAAA,CAACC,CAAAA,CAAA,CACC,QAAA,CAAA,CAAAT,GAAAA,CAACG,CAAAA,CAAA,EAAoB,EACrBH,GAAAA,CAACM,CAAAA,CAAA,CACC,SAAA,CAAWD,GACT,wLAAA,CACAD,CACF,CAAA,CACC,GAAGL,EAEH,QAAA,CAAAQ,CAAAA,CACH,CAAA,CAAA,CACF,CAEJ,CAIA,SAASG,CAAAA,CAAkB,CAAE,SAAA,CAAAN,EAAW,GAAGL,CAAM,CAAA,CAA2B,CAC1E,OACEC,GAAAA,CAAC,KAAA,CAAA,CACC,WAAA,CAAU,qBAAA,CACV,UAAWK,EAAAA,CACT,+DAAA,CACAD,CACF,CAAA,CACC,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASY,EAAmB,CAAE,SAAA,CAAAP,CAAAA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A,CAA2B,CACzB,OACEC,GAAAA,CAACmB,IAAA,CACC,WAAA,CAAU,qBAAA,CACV,KAAA,CAAOD,EACP,OAAA,CAASF,CAAAA,CACR,GAAGjB,CAAAA,CACN,CAEJ,CAKA,SAASqB,CAAAA,CAAkB,CACzB,MAAAF,CAAAA,CAAQ,SAAA,CACR,OAAA,CAAAF,CAAAA,CAAU,YACV,IAAA,CAAAK,CAAAA,CACA,GAAGtB,CACL,EAA2B,CACzB,OACEC,GAAAA,CAACE,CAAAA,CAAA,CACC,WAAA,CAAU,qBAAA,CACV,MAAA,CAAQF,GAAAA,CAACmB,IAAA,CAAO,KAAA,CAAOD,CAAAA,CAAO,OAAA,CAASF,EAAS,IAAA,CAAMK,CAAAA,CAAM,CAAA,CAC3D,GAAGtB,EACN,CAEJ","file":"chunk-ZK7MHZFG.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport {\r\n AlertDialog as AlertDialogPrimitive,\r\n AlertDialogTrigger as AlertDialogTriggerPrimitive,\r\n AlertDialogPortal as AlertDialogPortalPrimitive,\r\n AlertDialogBackdrop as AlertDialogBackdropPrimitive,\r\n AlertDialogPopup as AlertDialogPopupPrimitive,\r\n AlertDialogClose as AlertDialogClosePrimitive,\r\n AlertDialogFooter as AlertDialogFooterPrimitive,\r\n AlertDialogTitle as AlertDialogTitlePrimitive,\r\n AlertDialogDescription as AlertDialogDescriptionPrimitive,\r\n type AlertDialogProps as AlertDialogPrimitiveProps,\r\n type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,\r\n type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,\r\n type AlertDialogBackdropProps as AlertDialogBackdropPrimitiveProps,\r\n type AlertDialogPopupProps as AlertDialogPopupPrimitiveProps,\r\n type AlertDialogCloseProps as AlertDialogClosePrimitiveProps,\r\n type AlertDialogFooterProps as AlertDialogFooterPrimitiveProps,\r\n type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,\r\n type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,\r\n} from '../primitives/alert-dialog';\r\nimport { Button } from './button';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype AlertDialogProps = AlertDialogPrimitiveProps;\r\n\r\nfunction AlertDialog(props: AlertDialogProps) {\r\n return <AlertDialogPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogTriggerProps = AlertDialogTriggerPrimitiveProps;\r\n\r\nfunction AlertDialogTrigger(props: AlertDialogTriggerProps) {\r\n return <AlertDialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogCloseProps = AlertDialogClosePrimitiveProps;\r\n\r\nfunction AlertDialogClose(props: AlertDialogCloseProps) {\r\n return <AlertDialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogBackdropProps = AlertDialogBackdropPrimitiveProps;\r\n\r\nfunction AlertDialogBackdrop({ className, ...props }: AlertDialogBackdropProps) {\r\n return (\r\n <AlertDialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogPopupProps = AlertDialogPopupPrimitiveProps;\r\n\r\nfunction AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps) {\r\n return (\r\n <AlertDialogPortalPrimitive>\r\n <AlertDialogBackdrop />\r\n <AlertDialogPopupPrimitive\r\n className={cn(\r\n \"group/alert-dialog-popup fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] bg-bg-primary shadow-xp-lg rounded-xl overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </AlertDialogPopupPrimitive>\r\n </AlertDialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-header\"\r\n className={cn(\r\n \"px-4 py-4 grid grid-cols-[auto_1fr] items-start bg-bg-primary\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogContentProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogContent({ className, ...props }: AlertDialogContentProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-content\"\r\n className={cn(\"px-4 pb-4 max-h-[60vh] overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogFooterProps = AlertDialogFooterPrimitiveProps;\r\n\r\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\r\n return (\r\n <AlertDialogFooterPrimitive\r\n className={cn(\r\n \"flex gap-2 items-center justify-end bg-bg-primary px-4 py-3 border-t border-border-tertiary shadow-[0px_-1px_24px_0px_var(--color-shadow-xs)]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogTitleProps = AlertDialogTitlePrimitiveProps;\r\n\r\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\r\n return (\r\n <AlertDialogTitlePrimitive\r\n className={cn(\r\n \"col-start-2 [&:not(:has(~_[data-slot=alert-dialog-description]))]:row-span-2 [&:not(:has(~_[data-slot=alert-dialog-description]))]:self-center text-label-bold-2 text-text-primary\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogDescriptionProps = AlertDialogDescriptionPrimitiveProps;\r\n\r\nfunction AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {\r\n return (\r\n <AlertDialogDescriptionPrimitive\r\n className={cn(\"col-start-2 mt-0.5 text-body-regular-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogIconProps = React.ComponentProps<\"div\"> & {\r\n variant?: \"brand\" | \"error\";\r\n};\r\n\r\nfunction AlertDialogIcon({\r\n className,\r\n variant = \"brand\",\r\n ...props\r\n}: AlertDialogIconProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-icon\"\r\n data-variant={variant}\r\n className={cn(\r\n \"row-span-2 flex items-center justify-center rounded-lg mt-px mr-3 p-2.5 [&_svg]:size-4 text-fg-white\",\r\n variant === \"brand\" &&\r\n \"bg-bg-brand-solid shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]\",\r\n variant === \"error\" &&\r\n \"bg-bg-error-solid shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-utility-error-100)]\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogActionProps = React.ComponentProps<typeof Button>;\r\n\r\nfunction AlertDialogAction({\r\n color = \"destructive\",\r\n variant = \"primary\",\r\n ...props\r\n}: AlertDialogActionProps) {\r\n return (\r\n <Button\r\n data-slot=\"alert-dialog-action\"\r\n color={color}\r\n variant={variant}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogCancelProps = AlertDialogClosePrimitiveProps &\r\n Pick<React.ComponentProps<typeof Button>, \"color\" | \"variant\" | \"size\">;\r\n\r\nfunction AlertDialogCancel({\r\n color = \"default\",\r\n variant = \"secondary\",\r\n size,\r\n ...props\r\n}: AlertDialogCancelProps) {\r\n return (\r\n <AlertDialogClosePrimitive\r\n data-slot=\"alert-dialog-cancel\"\r\n render={<Button color={color} variant={variant} size={size} />}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogTrigger,\r\n AlertDialogClose,\r\n AlertDialogPopup,\r\n AlertDialogHeader,\r\n AlertDialogContent,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n AlertDialogIcon,\r\n AlertDialogBackdrop,\r\n AlertDialogAction,\r\n AlertDialogCancel,\r\n type AlertDialogProps,\r\n type AlertDialogTriggerProps,\r\n type AlertDialogCloseProps,\r\n type AlertDialogPopupProps,\r\n type AlertDialogHeaderProps,\r\n type AlertDialogContentProps,\r\n type AlertDialogFooterProps,\r\n type AlertDialogTitleProps,\r\n type AlertDialogDescriptionProps,\r\n type AlertDialogIconProps,\r\n type AlertDialogBackdropProps,\r\n type AlertDialogActionProps,\r\n type AlertDialogCancelProps,\r\n};\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as ComboboxChipOutside}from'../chunk-
|
|
1
|
+
export{a as ComboboxChipOutside}from'../chunk-YNJZ2P52.js';import'../chunk-V2PW53KI.js';import'../chunk-5VZ6QNBI.js';import'../chunk-4IAMLCAM.js';import'../chunk-YPV6XEV4.js';import'../chunk-MO7LQLS4.js';import'../chunk-A5644ETE.js';import'../chunk-DL6MI55G.js';import'../chunk-OHLNKXSV.js';import'../chunk-DNAWFZ7O.js';import'../chunk-BRZUHQYB.js';import'../chunk-NKQ3MFRE.js';import'../chunk-KUOFW7JO.js';import'../chunk-NFLQZ5NB.js';import'../chunk-XIZN73T3.js';import'../chunk-C675EWZW.js';import'../chunk-F77XVICY.js';import'../chunk-RH7BQGTL.js';import'../chunk-HGLHAEGH.js';import'../chunk-ZK7MHZFG.js';import'../chunk-WYVGUIHL.js';import'../chunk-66IVKVY6.js';import'../chunk-HRY64DNE.js';import'../chunk-NGSCUYDU.js';import'../chunk-Y6JASO6W.js';import'../chunk-2XAHWERG.js';import'../chunk-JYFVQ5NY.js';import'../chunk-F56BLRF2.js';import'../chunk-6OC5NZB6.js';import'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';import'../chunk-2RHSXF3X.js';import'../chunk-DX767LBV.js';import'../chunk-RN6CYJKG.js';import'../chunk-TES3PKRE.js';import'../chunk-BX7TD4RH.js';import'../chunk-YKX7SKZA.js';import'../chunk-UINS73U7.js';import'../chunk-RHWRIE3E.js';import'../chunk-HHG7BSWN.js';import'../chunk-TED2PUK6.js';import'../chunk-Y6TKCAAJ.js';import'../chunk-7P4PFMCM.js';import'../chunk-W7E2VPJN.js';import'../chunk-2URFXFQC.js';import'../chunk-XG3W7QMP.js';import'../chunk-DCH35MB4.js';import'../chunk-3SORJB7P.js';import'../chunk-3733D5Y7.js';import'../chunk-EIYPBVAD.js';import'../chunk-OLX4O5PI.js';import'../chunk-322IBGFZ.js';import'../chunk-QDCD6MNO.js';import'../chunk-LFQAJN4H.js';import'../chunk-BEJ2SIQP.js';import'../chunk-4PD3DZE6.js';import'../chunk-3RJED3RZ.js';import'../chunk-FKOYTHRM.js';import'../chunk-GJ5F6YBZ.js';import'../chunk-4D2HXXN3.js';import'../chunk-S7ZMBRYT.js';import'../chunk-TIVYCE4X.js';import'../chunk-RCP2CZRA.js';import'../chunk-AGKZWMW5.js';import'../chunk-YWG6HJAX.js';import'../chunk-NHQA6KSU.js';import'../chunk-DDCGJBN7.js';import'../chunk-SGJYHWYM.js';import'../chunk-QYGN3VYS.js';import'../chunk-ADC7WDF4.js';import'../chunk-ICQEZHVV.js';import'../chunk-PSHB2EQA.js';import'../chunk-JVBWH3DS.js';import'../chunk-EHRGIXKH.js';import'../chunk-CQC2IBSD.js';import'../chunk-CKVTRZ3S.js';import'../chunk-YSG3MHTX.js';import'../chunk-4EYPU56T.js';import'../chunk-2JHFRTOZ.js';import'../chunk-FJTQQ4SC.js';import'../chunk-W2HFGSVH.js';import'../chunk-2GABMQSA.js';import'../chunk-7ECOWHUV.js';import'../chunk-IUPJTP3B.js';import'../chunk-LUQVFKR7.js';import'../chunk-PEHI6LCP.js';import'../chunk-3HUMZKFZ.js';import'../chunk-U5N2WWD3.js';import'../chunk-F2D445K4.js';import'../chunk-NUCPKDK5.js';import'../chunk-2IOTGL4J.js';import'../chunk-NASTZUK6.js';import'../chunk-ZSYQCIYS.js';import'../chunk-4NU44YPN.js';import'../chunk-3SQB2TJB.js';import'../chunk-L5AG5DTS.js';import'../chunk-EAF4H4YJ.js';import'../chunk-5TKGJK3A.js';import'../chunk-XH22TH7N.js';import'../chunk-7LF2CJ3L.js';import'../chunk-KO4EAVJY.js';import'../chunk-U6W5PRLZ.js';import'../chunk-D45GNYVU.js';import'../chunk-JXTOUSXQ.js';import'../chunk-DRYKJQ72.js';import'../chunk-46KQF4UN.js';import'../chunk-556ANF7Z.js';import'../chunk-UKXYDUDY.js';import'../chunk-7YXRTIXL.js';import'../chunk-5KMCPFGM.js';import'../chunk-6I4GG756.js';import'../chunk-4UC2VYI5.js';import'../chunk-UCCQUPMT.js';import'../chunk-TMDCYGCN.js';import'../chunk-5ETIHFSE.js';import'../chunk-XJTOYNCA.js';import'../chunk-BZGVXBP3.js';import'../chunk-LSW5TIYQ.js';import'../chunk-5YFGDOSH.js';import'../chunk-3NFGWKSO.js';import'../chunk-L73GMVVO.js';import'../chunk-OL4WHG4U.js';import'../chunk-V5WX4TSN.js';import'../chunk-Z22ALCLD.js';import'../chunk-IHTB4XCP.js';import'../chunk-ECVIBKDN.js';import'../chunk-MPD36YFP.js';import'../chunk-Z5GMQ477.js';import'../chunk-6FL6AY4D.js';import'../chunk-3376QA4Q.js';import'../chunk-PDZ7VJPX.js';import'../chunk-Y72C3IVO.js';import'../chunk-5OQVCPXP.js';import'../chunk-LN37WPV7.js';import'../chunk-5NAO3POG.js';import'../chunk-JWAU7A2Q.js';import'../chunk-YFCBMUPK.js';import'../chunk-SLLTAQ22.js';import'../chunk-WMUM5NGX.js';import'../chunk-A2U6VIQW.js';import'../chunk-VZMFSH37.js';import'../chunk-NREZRMEX.js';import'../chunk-3SKJUZ5H.js';import'../chunk-EDXV6BE6.js';import'../chunk-HM2QBLIL.js';import'../chunk-6IKHZM3V.js';import'../chunk-ZVCIT3QN.js';import'../chunk-UACQQO3I.js';import'../chunk-IHLMMP5Q.js';import'../chunk-HSTY767P.js';import'../chunk-BKWINCGB.js';import'../chunk-VOTCMLJE.js';import'../chunk-ZKFUHFBC.js';import'../chunk-CEYIRTZQ.js';import'../chunk-TORDOY73.js';import'../chunk-CAK44O3E.js';import'../chunk-MTWFWU3I.js';import'../chunk-GDU3OVET.js';import'../chunk-3EU5QGAN.js';import'../chunk-6EMNBLEM.js';import'../chunk-4CBZOTZR.js';import'../chunk-XY4CWRWG.js';import'../chunk-2FGDZ6WR.js';import'../chunk-KHCZBVOK.js';import'../chunk-2TO4PAQM.js';import'../chunk-6KFTNJLJ.js';import'../chunk-C7GZULSV.js';import'../chunk-GGD2FGWK.js';import'../chunk-AI5FYYCO.js';import'../chunk-UCQKCAYY.js';import'../chunk-HL32HBMO.js';import'../chunk-K7EZKYBC.js';import'../chunk-FIXJ55FT.js';import'../chunk-JCFEHT75.js';import'../chunk-5I545S2U.js';import'../chunk-V6YCCR75.js';import'../chunk-NYSABCPP.js';import'../chunk-M5IVXDZ4.js';import'../chunk-2ZG2WNSI.js';import'../chunk-FBKS63GQ.js';import'../chunk-NUGYUIN6.js';import'../chunk-TTZ2UE5L.js';import'../chunk-JZJHLBOV.js';import'../chunk-L6ZGEGUV.js';import'../chunk-DQSDZXTX.js';import'../chunk-R33XCP5H.js';import'../chunk-SDKXW3R4.js';import'../chunk-EJ5XTT5H.js';import'../chunk-6FEBVO2P.js';import'../chunk-Z7IOYXOK.js';import'../chunk-X2VRJLPR.js';import'../chunk-KPA4J3CC.js';import'../chunk-4JEHGT2R.js';import'../chunk-QNEJRZ4U.js';import'../chunk-SCPA3CM2.js';import'../chunk-2PQUW476.js';import'../chunk-HEKI5WR2.js';import'../chunk-SR76VRAC.js';import'../chunk-4GMRFP6B.js';import'../chunk-F5FFAJ6B.js';import'../chunk-5FALHJEA.js';import'../chunk-ICHHISXQ.js';import'../chunk-EERDL5XC.js';import'../chunk-GE3TPDYX.js';import'../chunk-RMGJAA2L.js';import'../chunk-PCUUUW7T.js';import'../chunk-FELUIC3Z.js';import'../chunk-BKBLZKQ7.js';import'../chunk-3Q72MLBZ.js';import'../chunk-ZWZZVZOP.js';import'../chunk-VLSPFIZU.js';import'../chunk-H56Z2DPY.js';import'../chunk-BGSHHAM2.js';import'../chunk-X2J6MJ6Y.js';import'../chunk-KCSDB6W4.js';import'../chunk-3N22A4KQ.js';import'../chunk-F7KNYOYR.js';import'../chunk-IRRA2OTH.js';import'../chunk-QM2KF35E.js';import'../chunk-WI5V5Z76.js';import'../chunk-OREIXD3L.js';import'../chunk-EYH5SNDK.js';import'../chunk-RUTYHOHT.js';import'../chunk-4FH2LYOC.js';import'../chunk-U27RVBYT.js';import'../chunk-SX54FORI.js';import'../chunk-XOIZGRZ6.js';import'../chunk-EY3W3WZX.js';import'../chunk-75BEGXGF.js';import'../chunk-CP6DGMEP.js';import'../chunk-7TNSQNT7.js';import'../chunk-YTN4DVWB.js';import'../chunk-XNDNAHCC.js';import'../chunk-UESMX3LA.js';import'../chunk-33MUUBSB.js';import'../chunk-VK62KNI7.js';import'../chunk-X5TJ3Z24.js';import'../chunk-J64EBQ23.js';import'../chunk-PFSN7DQX.js';import'../chunk-Y2R7ZZYY.js';import'../chunk-LYV7R7DB.js';import'../chunk-EKS6U6XR.js';import'../chunk-5LAJMBKN.js';import'../chunk-ZEONZS5N.js';import'../chunk-MHRHCLIU.js';import'../chunk-V4VKQ2QF.js';import'../chunk-NVVCGBML.js';import'../chunk-ZTCAXM77.js';import'../chunk-UVYYUEHO.js';import'../chunk-FFYGBVMN.js';import'../chunk-HJJ2VCYO.js';import'../chunk-KZMULPFK.js';import'../chunk-MYGQXM66.js';import'../chunk-ZY5FUK37.js';import'../chunk-DNIYW2WB.js';import'../chunk-DVXIIACM.js';import'../chunk-ZPPUEK2E.js';import'../chunk-GOXCPAUM.js';import'../chunk-6L6HTR6E.js';import'../chunk-4VQUQ3NT.js';import'../chunk-4S6MFDRP.js';import'../chunk-OE7VPOT4.js';import'../chunk-LHVBJHQZ.js';import'../chunk-2V46QEC7.js';import'../chunk-TJNOFRWB.js';import'../chunk-Y2TTBBRP.js';import'../chunk-NYQJHUKD.js';import'../chunk-6NPT5BJ7.js';import'../chunk-TJFA5O6Z.js';import'../chunk-KCCBSGT3.js';import'../chunk-QWFECUYL.js';import'../chunk-IPTGAZ37.js';import'../chunk-DEFVXH3J.js';import'../chunk-Y56EKYRN.js';import'../chunk-IW6VX3I7.js';import'../chunk-QWCYJC3T.js';import'../chunk-4WDDWMBW.js';import'../chunk-24ZESL25.js';import'../chunk-QH67MZKV.js';import'../chunk-O5CSN63E.js';import'../chunk-I2K2QQOA.js';import'../chunk-ZPKZLDR2.js';import'../chunk-EBXTHJF5.js';import'../chunk-ZXSIHT6V.js';import'../chunk-JSE2CMYN.js';import'../chunk-WSMQZH5E.js';import'../chunk-CEY3P2QK.js';import'../chunk-E6ZLTD7K.js';import'../chunk-YWDIILO5.js';import'../chunk-WVOOXXON.js';import'../chunk-YRO736RI.js';import'../chunk-QBNIE5KZ.js';import'../chunk-UJRREWOA.js';import'../chunk-3KSOBU4X.js';import'../chunk-ZMNFPSA3.js';import'../chunk-6C2TVGCV.js';import'../chunk-ZQWDYX2E.js';import'../chunk-JUM5W2FF.js';import'../chunk-MOH4SNJJ.js';import'../chunk-YFZPYFTS.js';import'../chunk-WYRCNM2M.js';import'../chunk-EYKDAQEG.js';import'../chunk-K3RU27VR.js';import'../chunk-CFKH5BM3.js';import'../chunk-OEEQX3JR.js';import'../chunk-ZT35KBQN.js';import'../chunk-T7HRX3EC.js';import'../chunk-C4ELFIL6.js';import'../chunk-CHPQMJNP.js';import'../chunk-CJSVB5XT.js';import'../chunk-XFY6L3B6.js';import'../chunk-BNOMWF6G.js';import'../chunk-XQ5APSL5.js';import'../chunk-6UJXNDLR.js';import'../chunk-HG6NCRSN.js';import'../chunk-4TNLRALG.js';import'../chunk-BM65PK4H.js';import'../chunk-3Q67KQWC.js';import'../chunk-A4G246BH.js';import'../chunk-WUGIELON.js';import'../chunk-GYYQR6WJ.js';import'../chunk-PEAZKA47.js';import'../chunk-XU65MB53.js';import'../chunk-JUY2JZGK.js';import'../chunk-NTXAFTKR.js';import'../chunk-MFV4KTCM.js';import'../chunk-I56A4HTS.js';import'../chunk-BES6JPWQ.js';import'../chunk-HVR2PWQX.js';import'../chunk-JLZNZFOO.js';import'../chunk-ICOPUH6U.js';//# sourceMappingURL=combobox-chip-outside.js.map
|
|
2
2
|
//# sourceMappingURL=combobox-chip-outside.js.map
|