@alkimi.org/ui-kit 0.9.6 → 0.9.8
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-2KM266QO.mjs +3 -0
- package/dist/{chunk-VMOF3XI2.mjs.map → chunk-2KM266QO.mjs.map} +1 -1
- package/dist/{chunk-RTGC7LPL.js → chunk-3NIUPM3O.js} +2 -2
- package/dist/{chunk-RTGC7LPL.js.map → chunk-3NIUPM3O.js.map} +1 -1
- package/dist/{chunk-65YNHKNP.js → chunk-3TLCOZ5R.js} +2 -2
- package/dist/{chunk-65YNHKNP.js.map → chunk-3TLCOZ5R.js.map} +1 -1
- package/dist/{chunk-VDRRSPND.mjs → chunk-7FUNOEYE.mjs} +2 -2
- package/dist/{chunk-RYJZXDJ5.mjs → chunk-7X6SCSGJ.mjs} +2 -2
- package/dist/{chunk-HRYHWWL4.mjs → chunk-BLHKJHNV.mjs} +2 -2
- package/dist/{chunk-HRYHWWL4.mjs.map → chunk-BLHKJHNV.mjs.map} +1 -1
- package/dist/{chunk-CP7BC57S.js → chunk-BV7RXRSL.js} +2 -2
- package/dist/{chunk-CP7BC57S.js.map → chunk-BV7RXRSL.js.map} +1 -1
- package/dist/{chunk-MSYJFTUX.js → chunk-C2EJGAYA.js} +2 -2
- package/dist/{chunk-MSYJFTUX.js.map → chunk-C2EJGAYA.js.map} +1 -1
- package/dist/{chunk-GVSERRZX.js → chunk-CJOYCVKY.js} +2 -2
- package/dist/{chunk-GVSERRZX.js.map → chunk-CJOYCVKY.js.map} +1 -1
- package/dist/{chunk-5D66A4ZC.js → chunk-DHHZMQ72.js} +2 -2
- package/dist/{chunk-5D66A4ZC.js.map → chunk-DHHZMQ72.js.map} +1 -1
- package/dist/{chunk-NGEWZBAJ.mjs → chunk-DKMCJGI4.mjs} +2 -2
- package/dist/{chunk-YFIKNTMM.js → chunk-G76GSW2A.js} +2 -2
- package/dist/{chunk-YFIKNTMM.js.map → chunk-G76GSW2A.js.map} +1 -1
- package/dist/{chunk-SBL3PCZC.js → chunk-GRXC46JC.js} +2 -2
- package/dist/{chunk-SBL3PCZC.js.map → chunk-GRXC46JC.js.map} +1 -1
- package/dist/{chunk-S2TENS3V.mjs → chunk-JDM2VZ4X.mjs} +2 -2
- package/dist/{chunk-TAMQA7LM.mjs → chunk-KLU33CJI.mjs} +2 -2
- package/dist/{chunk-ZDWAY77K.js → chunk-MPUHONET.js} +2 -2
- package/dist/{chunk-ZDWAY77K.js.map → chunk-MPUHONET.js.map} +1 -1
- package/dist/{chunk-AL2CF5GT.mjs → chunk-QMJVRGPB.mjs} +2 -2
- package/dist/{chunk-ANKLITGS.js → chunk-RKRTEMMZ.js} +2 -2
- package/dist/{chunk-ANKLITGS.js.map → chunk-RKRTEMMZ.js.map} +1 -1
- package/dist/{chunk-7APORI4E.mjs → chunk-UAUSYTY4.mjs} +2 -2
- package/dist/{chunk-4EOAKJI4.mjs → chunk-WAX33IZF.mjs} +2 -2
- package/dist/{chunk-U6XL5TKL.mjs → chunk-XNMRXE55.mjs} +2 -2
- package/dist/{chunk-OXMHA73F.js → chunk-XQILGD5B.js} +2 -2
- package/dist/{chunk-OXMHA73F.js.map → chunk-XQILGD5B.js.map} +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/button.mjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.mjs +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.mjs +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/command.mjs +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-picker.mjs +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-range-picker.mjs +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.mjs +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.mjs +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/file-upload.mjs +1 -1
- package/dist/components/sidebar.d.mts +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.mjs +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-VMOF3XI2.mjs +0 -3
- /package/dist/{chunk-VDRRSPND.mjs.map → chunk-7FUNOEYE.mjs.map} +0 -0
- /package/dist/{chunk-RYJZXDJ5.mjs.map → chunk-7X6SCSGJ.mjs.map} +0 -0
- /package/dist/{chunk-NGEWZBAJ.mjs.map → chunk-DKMCJGI4.mjs.map} +0 -0
- /package/dist/{chunk-S2TENS3V.mjs.map → chunk-JDM2VZ4X.mjs.map} +0 -0
- /package/dist/{chunk-TAMQA7LM.mjs.map → chunk-KLU33CJI.mjs.map} +0 -0
- /package/dist/{chunk-AL2CF5GT.mjs.map → chunk-QMJVRGPB.mjs.map} +0 -0
- /package/dist/{chunk-7APORI4E.mjs.map → chunk-UAUSYTY4.mjs.map} +0 -0
- /package/dist/{chunk-4EOAKJI4.mjs.map → chunk-WAX33IZF.mjs.map} +0 -0
- /package/dist/{chunk-U6XL5TKL.mjs.map → chunk-XNMRXE55.mjs.map} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a}from"./chunk-S5TKCF6T.mjs";import*as e from"@radix-ui/react-tabs";import{forwardRef as o,useCallback as g,useEffect as p,useRef as T,useState as R}from"react";import{jsx as l,jsxs as h}from"react/jsx-runtime";var C=e.Root,y=o(({className:r,...s},t)=>{let[c,d]=R({left:0,width:0}),n=T(null);p(()=>{let i=()=>{if(!n.current)return;let f=n.current.querySelector('[data-state="active"]');if(f){let v=n.current.getBoundingClientRect(),m=f.getBoundingClientRect();d({left:m.left-v.left,width:m.width})}};i();let u=new MutationObserver(i);return n.current&&u.observe(n.current,{attributes:!0,attributeFilter:["data-state"],subtree:!0}),window.addEventListener("resize",i),()=>{u.disconnect(),window.removeEventListener("resize",i)}},[]);let b=g(i=>{n.current=i,typeof t=="function"?t(i):t&&(t.current=i)},[t]);return h(e.List,{ref:b,className:a("relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground",r),...s,children:[l("span",{className:"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out",style:{left:`${c.left}px`,width:`${c.width}px`}}),s.children]})});y.displayName=e.List.displayName;var P=o(({className:r,...s},t)=>l(e.Trigger,{ref:t,className:a("cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 py-1 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10",r),...s}));P.displayName=e.Trigger.displayName;var w=o(({className:r,...s},t)=>l(e.Content,{ref:t,className:a("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...s}));w.displayName=e.Content.displayName;export{C as a,y as b,P as c,w as d};
|
|
3
|
+
//# sourceMappingURL=chunk-2KM266QO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\nimport { forwardRef, useCallback, useEffect, useRef, useState } from \"react\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const [indicatorStyle, setIndicatorStyle] = useState({\n left: 0,\n width: 0,\n })\n const listRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const updateIndicator = () => {\n if (!listRef.current) return\n\n const activeTab = listRef.current.querySelector(\n '[data-state=\"active\"]'\n ) as HTMLElement\n\n if (activeTab) {\n const listRect = listRef.current.getBoundingClientRect()\n const tabRect = activeTab.getBoundingClientRect()\n\n setIndicatorStyle({\n left: tabRect.left - listRect.left,\n width: tabRect.width,\n })\n }\n }\n\n updateIndicator()\n\n // Use MutationObserver to detect when data-state changes\n const observer = new MutationObserver(updateIndicator)\n\n if (listRef.current) {\n observer.observe(listRef.current, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n }\n\n // Also update on window resize\n window.addEventListener(\"resize\", updateIndicator)\n\n return () => {\n observer.disconnect()\n window.removeEventListener(\"resize\", updateIndicator)\n }\n }, [])\n\n // Combine refs\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n ;(listRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n\n if (typeof ref === \"function\") {\n ref(node)\n } else if (ref) {\n ;(ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n },\n [ref]\n )\n\n return (\n <TabsPrimitive.List\n ref={combinedRef}\n className={cn(\n \"relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground\",\n className\n )}\n {...props}\n >\n {/* Animated indicator */}\n <span\n className=\"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n {props.children}\n </TabsPrimitive.List>\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:hover:bg-secondary
|
|
1
|
+
{"version":3,"sources":["../src/components/tabs.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\nimport { forwardRef, useCallback, useEffect, useRef, useState } from \"react\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const [indicatorStyle, setIndicatorStyle] = useState({\n left: 0,\n width: 0,\n })\n const listRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const updateIndicator = () => {\n if (!listRef.current) return\n\n const activeTab = listRef.current.querySelector(\n '[data-state=\"active\"]'\n ) as HTMLElement\n\n if (activeTab) {\n const listRect = listRef.current.getBoundingClientRect()\n const tabRect = activeTab.getBoundingClientRect()\n\n setIndicatorStyle({\n left: tabRect.left - listRect.left,\n width: tabRect.width,\n })\n }\n }\n\n updateIndicator()\n\n // Use MutationObserver to detect when data-state changes\n const observer = new MutationObserver(updateIndicator)\n\n if (listRef.current) {\n observer.observe(listRef.current, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n }\n\n // Also update on window resize\n window.addEventListener(\"resize\", updateIndicator)\n\n return () => {\n observer.disconnect()\n window.removeEventListener(\"resize\", updateIndicator)\n }\n }, [])\n\n // Combine refs\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n ;(listRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n\n if (typeof ref === \"function\") {\n ref(node)\n } else if (ref) {\n ;(ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n },\n [ref]\n )\n\n return (\n <TabsPrimitive.List\n ref={combinedRef}\n className={cn(\n \"relative inline-flex items-center justify-center rounded-4xl bg-muted p-1 gap-1 text-muted-foreground\",\n className\n )}\n {...props}\n >\n {/* Animated indicator */}\n <span\n className=\"absolute h-[calc(100%-0.5rem)] rounded-4xl bg-background shadow-sm transition-all duration-200 ease-out\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n {props.children}\n </TabsPrimitive.List>\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"cursor-pointer relative inline-flex items-center justify-center whitespace-nowrap data-[state=inactive]:not-disabled:hover:bg-secondary rounded-4xl px-3 py-1 text-sm font-medium ring-offset-background transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=active]:text-foreground z-10\",\n className\n )}\n {...props}\n />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],"mappings":";oCAAA,UAAYA,MAAmB,uBAG/B,OAAS,cAAAC,EAAY,eAAAC,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAsEjE,OASE,OAAAC,EATF,QAAAC,MAAA,oBApEJ,IAAMC,EAAqB,OAErBC,EAAWR,EAGf,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAAQ,CAClC,GAAM,CAACC,EAAgBC,CAAiB,EAAIT,EAAS,CACn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Da,EAAY,YAA4B,UAAQ,YAEhD,IAAMC,EAAcxB,EAGlB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1BN,EAAe,UAAd,CACC,IAAKM,EACL,UAAWW,EACT,kIACAb,CACF,EACC,GAAGC,EACN,CACD,EACDc,EAAY,YAA4B,UAAQ","names":["TabsPrimitive","forwardRef","useCallback","useEffect","useRef","useState","jsx","jsxs","Tabs","TabsList","className","props","ref","indicatorStyle","setIndicatorStyle","listRef","updateIndicator","activeTab","listRect","tabRect","observer","combinedRef","node","cn","TabsTrigger","TabsContent"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkXQILGD5Bjs = require('./chunk-XQILGD5B.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var n = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var H=n.forwardRef(({accept:o,maxSize:s,multiple:f=!1,onFilesChange:m,error:h,disabled:l,className:D,description:g},F)=>{let[y,d]=n.useState(!1),[i,v]=n.useState([]),c=n.useRef(null),R=e=>{e.preventDefault(),e.stopPropagation(),l||d(!0)},C=e=>{e.preventDefault(),e.stopPropagation(),d(!1)},E=e=>{e.preventDefault(),e.stopPropagation()},U=e=>!(s&&e.size>s),x=e=>{if(!e)return;let t=Array.from(e).filter(U),u=f?[...i,...t]:t.slice(0,1);v(u),_optionalChain([m, 'optionalCall', _ => _(u)])},k=e=>{e.preventDefault(),e.stopPropagation(),d(!1),!l&&x(e.dataTransfer.files)},w=()=>{l||_optionalChain([c, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.click, 'call', _4 => _4()])},L=e=>{x(e.target.files),c.current&&(c.current.value="")},M=e=>{let t=i.filter((u,$)=>$!==e);v(t),_optionalChain([m, 'optionalCall', _5 => _5(t)])},b=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${Math.round(e/(1024*1024))} MB`,P=e=>e.split(",").map(t=>t.trim()).map(t=>t.includes("/*")?t.replace("/*","").toUpperCase():t.startsWith(".")?t.slice(1).toUpperCase():t.includes("/")?t.split("/")[1].toUpperCase():t.toUpperCase());return _jsxruntime.jsxs.call(void 0, "div",{ref:F,className:_chunkFUYXCJOQjs.a.call(void 0, "w-full",D),children:[_jsxruntime.jsxs.call(void 0, "div",{onClick:w,onDragEnter:R,onDragLeave:C,onDragOver:E,onDrop:k,className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background px-6 py-4 text-center transition-all cursor-pointer",y&&"bg-secondary",h?"border-destructive-foreground":"border-border hover:bg-secondary",l&&"cursor-not-allowed opacity-50"),children:[_jsxruntime.jsx.call(void 0, "span",{className:_chunkXQILGD5Bjs.a.call(void 0, {variant:"outline",size:"icon"}),children:_jsxruntime.jsx.call(void 0, _lucidereact.Upload,{size:16,className:_chunkFUYXCJOQjs.a.call(void 0, "text-primary-accent")})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsxs.call(void 0, "p",{className:"text-sm text-secondary-text",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-primary-accent",children:"Click to upload"})," or drag and drop"]}),(o||s)&&_jsxruntime.jsxs.call(void 0, "p",{className:"text-xs text-secondary-text",children:[o&&P(o).join(", "),o&&s&&" ",s&&`up to ${b(s)}`]}),g&&_jsxruntime.jsx.call(void 0, "p",{className:"text-xs text-secondary-text",children:g})]})]}),_jsxruntime.jsx.call(void 0, "input",{ref:c,type:"file",accept:o,multiple:f,onChange:L,disabled:l,className:"hidden"}),i.length>0&&_jsxruntime.jsx.call(void 0, "div",{className:"mt-3 space-y-2",children:i.map((e,t)=>_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between rounded-2xl border border-border bg-background px-4 py-2",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-3",children:[_jsxruntime.jsx.call(void 0, _lucidereact.File,{className:"h-5 w-5 text-secondary-text"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm text-primary-accent truncate max-w-[200px]",children:e.name}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs text-secondary-text",children:b(e.size)})]})]}),_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:()=>M(t),className:"rounded-full p-1 hover:bg-secondary transition-colors",children:_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-4 w-4 text-secondary-text"})})]},`${e.name}-${t}`))})]})});H.displayName="FileUpload";exports.a = H;
|
|
3
|
+
//# sourceMappingURL=chunk-3NIUPM3O.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-3NIUPM3O.js","../src/components/file-upload.tsx"],"names":["FileUpload","accept","maxSize","multiple","onFilesChange","error","disabled","className","description","ref","isDragging","setIsDragging","files","setFiles","inputRef","handleDragEnter","handleDragLeave","handleDragOver","validateFile","file","handleFiles","newFiles","validFiles","updatedFiles","handleDrop","handleClick","handleInputChange","removeFile","index","_","i","formatFileSize","bytes"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECDxD,2CACS,+CA0JpB,IAhINA,CAAAA,CAAmB,CAAA,CAAA,UAAA,CACvB,CACE,CACE,MAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,aAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACAC,CAAAA,CAAAA,EACG,CACH,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAClD,CAACC,CAAAA,CAAOC,CAAQ,CAAA,CAAU,CAAA,CAAA,QAAA,CAAiB,CAAC,CAAC,CAAA,CAC7CC,CAAAA,CAAiB,CAAA,CAAA,MAAA,CAAyB,IAAI,CAAA,CAE9CC,CAAAA,CAAmB,CAAA,EAAuB,CAC9C,CAAA,CAAE,cAAA,CAAe,CAAA,CACjB,CAAA,CAAE,eAAA,CAAgB,CAAA,CACbT,CAAAA,EAAUK,CAAAA,CAAc,CAAA,CAAI,CACnC,CAAA,CAEMK,CAAAA,CAAmB,CAAA,EAAuB,CAC9C,CAAA,CAAE,cAAA,CAAe,CAAA,CACjB,CAAA,CAAE,eAAA,CAAgB,CAAA,CAClBL,CAAAA,CAAc,CAAA,CAAK,CACrB,CAAA,CAEMM,CAAAA,CAAkB,CAAA,EAAuB,CAC7C,CAAA,CAAE,cAAA,CAAe,CAAA,CACjB,CAAA,CAAE,eAAA,CAAgB,CACpB,CAAA,CAEMC,CAAAA,CAAgBC,CAAAA,EAChB,CAAA,CAAAjB,CAAAA,EAAWiB,CAAAA,CAAK,IAAA,CAAOjB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,CAAAA,CAAQ,IAAA,CAAa,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-3NIUPM3O.js","sourcesContent":[null,"import * as React from \"react\"\nimport { Upload, X, File } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"./button\"\n\nexport interface FileUploadProps {\n /** Accepted file formats (e.g., \".png,.jpg,.pdf\" or \"image/*\") */\n accept?: string\n /** Maximum file size in bytes */\n maxSize?: number\n /** Allow multiple files */\n multiple?: boolean\n /** Callback when files are selected */\n onFilesChange?: (files: File[]) => void\n /** Error state */\n error?: boolean\n /** Disabled state */\n disabled?: boolean\n /** Custom class name */\n className?: string\n /** Placeholder text */\n placeholder?: string\n /** Description text (e.g., \"PNG, JPG up to 10MB\") */\n description?: string\n}\n\nconst FileUpload = React.forwardRef<HTMLDivElement, FileUploadProps>(\n (\n {\n accept,\n maxSize,\n multiple = false,\n onFilesChange,\n error,\n disabled,\n className,\n description,\n },\n ref\n ) => {\n const [isDragging, setIsDragging] = React.useState(false)\n const [files, setFiles] = React.useState<File[]>([])\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n const handleDragEnter = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (!disabled) setIsDragging(true)\n }\n\n const handleDragLeave = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragging(false)\n }\n\n const handleDragOver = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n }\n\n const validateFile = (file: File): boolean => {\n if (maxSize && file.size > maxSize) {\n return false\n }\n return true\n }\n\n const handleFiles = (newFiles: FileList | null) => {\n if (!newFiles) return\n\n const validFiles = Array.from(newFiles).filter(validateFile)\n const updatedFiles = multiple\n ? [...files, ...validFiles]\n : validFiles.slice(0, 1)\n\n setFiles(updatedFiles)\n onFilesChange?.(updatedFiles)\n }\n\n const handleDrop = (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragging(false)\n\n if (disabled) return\n handleFiles(e.dataTransfer.files)\n }\n\n const handleClick = () => {\n if (!disabled) inputRef.current?.click()\n }\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files)\n if (inputRef.current) inputRef.current.value = \"\"\n }\n\n const removeFile = (index: number) => {\n const updatedFiles = files.filter((_, i) => i !== index)\n setFiles(updatedFiles)\n onFilesChange?.(updatedFiles)\n }\n\n const formatFileSize = (bytes: number): string => {\n if (bytes < 1024) return `${bytes} B`\n if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`\n return `${Math.round(bytes / (1024 * 1024))} MB`\n }\n\n const formatAcceptedTypes = (acceptStr: string): string[] => {\n return acceptStr\n .split(\",\")\n .map((type) => type.trim())\n .map((type) => {\n // Handle wildcards like \"image/*\"\n if (type.includes(\"/*\")) {\n return type.replace(\"/*\", \"\").toUpperCase()\n }\n // Handle extensions like \".png\"\n if (type.startsWith(\".\")) {\n return type.slice(1).toUpperCase()\n }\n // Handle MIME types like \"image/png\"\n if (type.includes(\"/\")) {\n return type.split(\"/\")[1].toUpperCase()\n }\n return type.toUpperCase()\n })\n }\n\n return (\n <div ref={ref} className={cn(\"w-full\", className)}>\n <div\n onClick={handleClick}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={cn(\n \"flex my-2 flex-col items-center justify-center gap-3 rounded-lg border border-border bg-background px-6 py-4 text-center transition-all cursor-pointer\",\n isDragging && \"bg-secondary\",\n error\n ? \"border-destructive-foreground\"\n : \"border-border hover:bg-secondary\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <span\n className={buttonVariants({\n variant: \"outline\",\n size: \"icon\",\n })}\n >\n <Upload size={16} className={cn(\"text-primary-accent\")} />\n </span>\n\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm text-secondary-text\">\n <span className=\"text-primary-accent\">Click to upload</span> or\n drag and drop\n </p>\n {(accept || maxSize) && (\n <p className=\"text-xs text-secondary-text\">\n {accept && formatAcceptedTypes(accept).join(\", \")}\n {accept && maxSize && \" \"}\n {maxSize && `up to ${formatFileSize(maxSize)}`}\n </p>\n )}\n {description && (\n <p className=\"text-xs text-secondary-text\">{description}</p>\n )}\n </div>\n </div>\n\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleInputChange}\n disabled={disabled}\n className=\"hidden\"\n />\n\n {files.length > 0 && (\n <div className=\"mt-3 space-y-2\">\n {files.map((file, index) => (\n <div\n key={`${file.name}-${index}`}\n className=\"flex items-center justify-between rounded-2xl border border-border bg-background px-4 py-2\"\n >\n <div className=\"flex items-center gap-3\">\n <File className=\"h-5 w-5 text-secondary-text\" />\n <div className=\"flex flex-col\">\n <span className=\"text-sm text-primary-accent truncate max-w-[200px]\">\n {file.name}\n </span>\n <span className=\"text-xs text-secondary-text\">\n {formatFileSize(file.size)}\n </span>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => removeFile(index)}\n className=\"rounded-full p-1 hover:bg-secondary transition-colors\"\n >\n <X className=\"h-4 w-4 text-secondary-text\" />\n </button>\n </div>\n ))}\n </div>\n )}\n </div>\n )\n }\n)\nFileUpload.displayName = \"FileUpload\"\n\nexport { FileUpload }\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkGRXC46JCjs = require('./chunk-GRXC46JC.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _datefns = require('date-fns');var _reactpopover = require('@radix-ui/react-popover'); var o = _interopRequireWildcard(_reactpopover);var _jsxruntime = require('react/jsx-runtime');var C=o.Root,x=o.Trigger,c=r.forwardRef(({className:e,align:a="start",sideOffset:n=4,...i},s)=>_jsxruntime.jsx.call(void 0, o.Portal,{children:_jsxruntime.jsx.call(void 0, o.Content,{ref:s,align:a,sideOffset:n,className:_chunkFUYXCJOQjs.a.call(void 0, "z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));c.displayName=o.Content.displayName;var k=r.forwardRef(({dateRange:e,onDateRangeChange:a,placeholder:n="Pick a date range",disabled:i=!1,className:s,calendarProps:P,formatStr:d="LLL dd, y",numberOfMonths:u=2},v)=>{let[g,b]=r.useState(!1),y=()=>_optionalChain([e, 'optionalAccess', _ => _.from])?e.to?`${_datefns.format.call(void 0, e.from,d)} - ${_datefns.format.call(void 0, e.to,d)}`:_datefns.format.call(void 0, e.from,d):n;return _jsxruntime.jsxs.call(void 0, C,{open:g,onOpenChange:b,modal:!0,children:[_jsxruntime.jsx.call(void 0, x,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!_optionalChain([e, 'optionalAccess', _2 => _2.from])&&"text-secondary-text",s),disabled:i,children:[_jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon,{className:"mr-2 h-4 w-4 shrink-0"}),_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:y()})]})}),_jsxruntime.jsx.call(void 0, c,{className:"w-auto p-0",align:"start",children:_jsxruntime.jsx.call(void 0, _chunkGRXC46JCjs.a,{mode:"range",selected:e,onSelect:h=>{_optionalChain([a, 'optionalCall', _3 => _3(h)])},defaultMonth:_optionalChain([e, 'optionalAccess', _4 => _4.from]),numberOfMonths:u,...P})})]})});k.displayName="DateRangePicker";exports.a = k;
|
|
3
|
+
//# sourceMappingURL=chunk-3TLCOZ5R.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-3TLCOZ5R.js","../src/components/date-range-picker.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn","DateRangePicker","dateRange","onDateRangeChange","placeholder","disabled","calendarProps","formatStr","numberOfMonths","open","setOpen","formatDisplayValue"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECCxD,2CACM,mCACN,uGACW,+CAc9B,IAREA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAC3BC,CAAAA,CAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,KAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAS,UAAA,CAAAC,CAAAA,CAAa,CAAA,CAAG,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC3DC,6BAAAA,CAAkB,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,KAAA,CAAOH,CAAAA,CACP,UAAA,CAAYC,CAAAA,CACZ,SAAA,CAAWI,gCAAAA,6bACT,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAAA,CACF,CACD,CAAA,CACDJ,CAAAA,CAAe,WAAA,CAA+B,CAAA,CAAA,OAAA,CAAQ,WAAA,CAgBtD,IAAMQ,CAAAA,CAAwB,CAAA,CAAA,UAAA,CAI5B,CACE,CACE,SAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,mBAAA,CACd,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,SAAA,CAAAX,CAAAA,CACA,aAAA,CAAAY,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,WAAA,CACZ,cAAA,CAAAC,CAAAA,CAAiB,CACnB,CAAA,CACAV,CAAAA,CAAAA,EACG,CACH,GAAM,CAACW,CAAAA,CAAMC,CAAO,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAEtCC,CAAAA,CAAqB,CAAA,CAAA,kBACpBT,CAAAA,2BAAW,MAAA,CAIZA,CAAAA,CAAU,EAAA,CACL,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-3TLCOZ5R.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport { format } from \"date-fns\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport type { DateRange } from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/calendar\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-auto rounded-3xl border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport interface DateRangePickerProps {\n dateRange?: DateRange\n onDateRangeChange?: (dateRange: DateRange | undefined) => void\n placeholder?: string\n disabled?: boolean\n className?: string\n calendarProps?: Omit<\n React.ComponentProps<typeof Calendar>,\n \"mode\" | \"selected\" | \"onSelect\"\n >\n formatStr?: string\n numberOfMonths?: number\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n dateRange,\n onDateRangeChange,\n placeholder = \"Pick a date range\",\n disabled = false,\n className,\n calendarProps,\n formatStr = \"LLL dd, y\",\n numberOfMonths = 2,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false)\n\n const formatDisplayValue = () => {\n if (!dateRange?.from) {\n return placeholder\n }\n\n if (dateRange.to) {\n return `${format(dateRange.from, formatStr)} - ${format(dateRange.to, formatStr)}`\n }\n\n return format(dateRange.from, formatStr)\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen} modal>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !dateRange?.from && \"text-secondary-text\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4 shrink-0\" />\n <span className=\"truncate\">{formatDisplayValue()}</span>\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"range\"\n selected={dateRange}\n onSelect={(range) => {\n onDateRangeChange?.(range)\n }}\n defaultMonth={dateRange?.from}\n numberOfMonths={numberOfMonths}\n {...calendarProps}\n />\n </PopoverContent>\n </Popover>\n )\n }\n)\n\nDateRangePicker.displayName = \"DateRangePicker\"\n\nexport { DateRangePicker }\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as l}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as l}from"./chunk-QMJVRGPB.mjs";import{a as d}from"./chunk-S5TKCF6T.mjs";import*as r from"react";import{CalendarIcon as b}from"lucide-react";import{format as C}from"date-fns";import*as e from"@radix-ui/react-popover";import{jsx as t,jsxs as m}from"react/jsx-runtime";var y=e.Root,h=e.Trigger,c=r.forwardRef(({className:o,align:a="start",sideOffset:i=4,...n},s)=>t(e.Portal,{children:t(e.Content,{ref:s,align:a,sideOffset:i,className:d("z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o),...n})}));c.displayName=e.Content.displayName;var R=r.forwardRef(({date:o,onDateChange:a,placeholder:i="Pick a date",disabled:n=!1,className:s,calendarProps:f,formatStr:P="PPP"},v)=>{let[u,p]=r.useState(!1);return m(y,{open:u,onOpenChange:p,children:[t(h,{asChild:!0,children:m("button",{ref:v,type:"button",className:d("flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!o&&"text-secondary-text",s),disabled:n,children:[t(b,{className:"mr-2 h-4 w-4"}),o?C(o,P):t("span",{children:i})]})}),t(c,{className:"w-auto p-0 rounded-3xl",align:"start",children:t(l,{mode:"single",selected:o,onSelect:g=>{a?.(g),p(!1)},defaultMonth:o,...f})})]})});R.displayName="DatePicker";export{R as a};
|
|
3
|
+
//# sourceMappingURL=chunk-7FUNOEYE.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as N,b as w,c as O}from"./chunk-FZ3NXOFK.mjs";import{a as P,c as k,d as S,e as G,f as b,h as R}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as N,b as w,c as O}from"./chunk-FZ3NXOFK.mjs";import{a as P,c as k,d as S,e as G,f as b,h as R}from"./chunk-XNMRXE55.mjs";import{a as p}from"./chunk-S5TKCF6T.mjs";import*as d from"react";import{Check as z,ChevronDown as A,X as B}from"lucide-react";import{Fragment as F,jsx as o,jsxs as t}from"react/jsx-runtime";function U({options:c=[],groups:s,value:i,onValueChange:M,placeholder:u="Select option...",searchPlaceholder:D="Search...",emptyMessage:E="No option found.",disabled:I=!1,className:T,error:L=!1,multiple:l=!1,values:r=[],onValuesChange:f}){let[g,v]=d.useState(!1),x=d.useMemo(()=>s?s.flatMap(e=>e.options):c,[s,c]),C=x.find(e=>e.value===i),a=x.filter(e=>r.includes(e.value)),X=e=>{if(l){let n=r.includes(e)?r.filter(m=>m!==e):[...r,e];f?.(n)}else M?.(e===i?"":e),v(!1)},$=(e,n)=>{n.preventDefault(),n.stopPropagation();let m=r.filter(q=>q!==e);f?.(m)},j=()=>l?a.length===0?u:a.length===1?a[0].label:`${a.length} selected`:C?C.label:u,h=e=>{let n=l?r.includes(e.value):i===e.value;return t(R,{value:e.value,onSelect:X,className:"rounded-[12px]",children:[o("span",{className:"truncate",children:e.label}),o(z,{className:p("ml-auto h-4 w-4 shrink-0",n?"opacity-100":"opacity-0")})]},e.value)},y=()=>!l||a.length===0?null:o("div",{className:"px-2 py-1.5",children:o("div",{className:"flex flex-wrap gap-1",children:a.map(e=>t("div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[o("span",{className:"truncate",children:e.label}),o(B,{className:"h-3 w-3 cursor-pointer",onClick:n=>$(e.value,n)})]},e.value))})});return t(N,{open:g,onOpenChange:v,children:[o(w,{asChild:!0,children:t("button",{type:"button",role:"combobox","aria-expanded":g,disabled:I,className:p("cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!i&&!r.length&&"text-secondary-text",L&&"border-destructive-foreground focus-visible:ring-destructive-foreground",T),children:[o("span",{className:"truncate",children:j()}),o(A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o(O,{className:"overflow-hidden rounded-xl p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:t(P,{children:[o(k,{placeholder:D}),t(S,{children:[o(G,{children:E}),s?t(F,{children:[y(),s.map(e=>o(b,{heading:e.label,children:e.options.map(h)},e.label))]}):t(b,{children:[y(),c.map(h)]})]})]})})]})}export{U as a};
|
|
3
|
+
//# sourceMappingURL=chunk-7X6SCSGJ.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as n}from"./chunk-S5TKCF6T.mjs";import*as o from"react";import{Slot as l}from"@radix-ui/react-slot";import{cva as p}from"class-variance-authority";import{jsx as a,jsxs as b}from"react/jsx-runtime";var m=p("inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary-accent text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive hover:bg-destructive/90",outline:"border border-input hover:bg-base-accent text-primary-accent",secondary:"bg-muted text-primary-accent hover:bg-muted/20",ghost:"hover:bg-base-accent text-primary-accent",link:"text-primary-accent underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 text-sm",sm:"h-8 text-xs px-3 py-2",lg:"h-10 px-8 py-2 text-sm",icon:"h-9 w-9",none:""}},defaultVariants:{variant:"default",size:"default"}}),f=o.forwardRef(({className:i,variant:s,size:c,asChild:d=!1,loading:e=!1,icon:r,...t},u)=>b(d?l:"button",{className:n(m({variant:s,size:c,className:i})),ref:u,disabled:e||t.disabled,...t,children:[e&&a("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border border-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as n}from"./chunk-S5TKCF6T.mjs";import*as o from"react";import{Slot as l}from"@radix-ui/react-slot";import{cva as p}from"class-variance-authority";import{jsx as a,jsxs as b}from"react/jsx-runtime";var m=p("inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary-accent text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive hover:bg-destructive/90",outline:"border border-input hover:bg-base-accent text-primary-accent",secondary:"bg-muted text-primary-accent hover:bg-muted/20",ghost:"hover:bg-base-accent text-primary-accent",link:"text-primary-accent underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 text-sm",sm:"h-8 text-xs px-3 py-2",lg:"h-10 px-8 py-2 text-sm",icon:"h-9 w-9",none:""}},defaultVariants:{variant:"default",size:"default"}}),f=o.forwardRef(({className:i,variant:s,size:c,asChild:d=!1,loading:e=!1,icon:r,...t},u)=>b(d?l:"button",{className:n(m({variant:s,size:c,className:i})),ref:u,disabled:e||t.disabled,...t,children:[e&&a("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),!e&&r&&a("span",{className:"mr-2",children:r}),t.children]}));f.displayName="Button";export{m as a,f as b};
|
|
3
|
+
//# sourceMappingURL=chunk-BLHKJHNV.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary-accent text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-base-accent text-primary-accent\",\n secondary: \"bg-muted text-primary-accent hover:bg-muted/20\",\n ghost: \"hover:bg-base-accent text-primary-accent\",\n link: \"text-primary-accent underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 text-sm\",\n sm: \"h-8 text-xs px-3 py-2\",\n lg: \"h-10 px-8 py-2 text-sm\",\n icon: \"h-9 w-9\",\n none: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n icon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n icon,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || props.disabled}\n {...props}\n >\n {loading && (\n <div className=\"mr-2 h-4 w-4 animate-spin rounded-full border border-
|
|
1
|
+
{"version":3,"sources":["../src/components/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center cursor-pointer justify-center whitespace-nowrap rounded-4xl font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary-accent text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-base-accent text-primary-accent\",\n secondary: \"bg-muted text-primary-accent hover:bg-muted/20\",\n ghost: \"hover:bg-base-accent text-primary-accent\",\n link: \"text-primary-accent underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 text-sm\",\n sm: \"h-8 text-xs px-3 py-2\",\n lg: \"h-10 px-8 py-2 text-sm\",\n icon: \"h-9 w-9\",\n none: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n icon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n icon,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || props.disabled}\n {...props}\n >\n {loading && (\n <div className=\"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n )}\n {!loading && icon && <span className=\"mr-2\">{icon}</span>}\n {props.children}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"],"mappings":";yCAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BAwDjC,OAOI,OAAAC,EAPJ,QAAAC,MAAA,oBApDN,IAAMC,EAAiBC,EACrB,gTACA,CACE,SAAU,CACR,QAAS,CACP,QACE,gEACF,YAAa,yCACb,QAAS,+DACT,UAAW,iDACX,MAAO,2CACP,KAAM,wDACR,EACA,KAAM,CACJ,QAAS,wBACT,GAAI,wBACJ,GAAI,yBACJ,KAAM,UACN,KAAM,EACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAWMC,EAAe,aACnB,CACE,CACE,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,QAAAC,EAAU,GACV,KAAAC,EACA,GAAGC,CACL,EACAC,IAIEX,EAFWO,EAAUK,EAAO,SAE3B,CACC,UAAWC,EAAGZ,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EAC1D,IAAKO,EACL,SAAUH,GAAWE,EAAM,SAC1B,GAAGA,EAEH,UAAAF,GACCT,EAAC,OAAI,UAAU,sFAAsF,EAEtG,CAACS,GAAWC,GAAQV,EAAC,QAAK,UAAU,OAAQ,SAAAU,EAAK,EACjDC,EAAM,UACT,CAGN,EACAP,EAAO,YAAc","names":["React","Slot","cva","jsx","jsxs","buttonVariants","cva","Button","className","variant","size","asChild","loading","icon","props","ref","Slot","cn"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var _chunk3BVMHDYAjs = require('./chunk-3BVMHDYA.js');var
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunk3BVMHDYAjs = require('./chunk-3BVMHDYA.js');var _chunkXQILGD5Bjs = require('./chunk-XQILGD5B.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var i = _interopRequireWildcard(_react);var _reactdialog = require('@radix-ui/react-dialog'); var e = _interopRequireWildcard(_reactdialog);var _vaul = require('vaul');var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var y=i.createContext({}),b= exports.a =({children:a,open:o,onOpenChange:n,...s})=>{let[p,c]=i.useState(!1),f=o!==void 0,m=f?o:p,r=f?n:R=>{c(R)};return _jsxruntime.jsx.call(void 0, e.Root,{open:m,onOpenChange:r,...s,children:_jsxruntime.jsx.call(void 0, y.Provider,{value:{open:m,onOpenChange:r},children:a})})};b.displayName="Dialog";var M=e.Trigger,P= exports.c =e.Portal,L= exports.d =e.Close,C= exports.e =i.forwardRef(({className:a,...o},n)=>_jsxruntime.jsx.call(void 0, e.Overlay,{ref:n,className:_chunkFUYXCJOQjs.a.call(void 0, "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...o}));C.displayName=e.Overlay.displayName;var x=i.forwardRef(({className:a,children:o,showCloseButton:n=!0,closeOnOverlayClick:s=!0,...p},c)=>{let f=_chunk3BVMHDYAjs.a.call(void 0, "md"),m=i.useContext(y);return f?_jsxruntime.jsxs.call(void 0, P,{children:[_jsxruntime.jsx.call(void 0, C,{}),_jsxruntime.jsxs.call(void 0, e.Content,{ref:c,className:_chunkFUYXCJOQjs.a.call(void 0, "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-3xl overflow-auto",a),onPointerDownOutside:r=>{s||r.preventDefault()},onEscapeKeyDown:r=>{s||r.preventDefault()},...p,children:[o,n&&_jsxruntime.jsx.call(void 0, e.Close,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkXQILGD5Bjs.b,{variant:"secondary",size:"icon",className:"absolute right-4 top-4 rounded-full transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none",children:[_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]})})]})]}):_jsxruntime.jsx.call(void 0, P,{children:_jsxruntime.jsx.call(void 0, _vaul.Drawer.Root,{open:m.open,onOpenChange:m.onOpenChange,dismissible:s,children:_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal,{children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay,{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm"}),_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Content,{ref:c,className:_chunkFUYXCJOQjs.a.call(void 0, "fixed inset-x-0 bottom-0 z-50 mt-24 flex flex-col rounded-t-3xl border border-border bg-background shadow-lg outline-none",a),"aria-describedby":void 0,onPointerDownOutside:r=>{s||r.preventDefault()},onEscapeKeyDown:r=>{s||r.preventDefault()},...p,children:[_jsxruntime.jsx.call(void 0, "div",{className:"mx-auto mt-2 h-2 w-[100px] rounded-full bg-muted"}),n&&_jsxruntime.jsxs.call(void 0, _chunkXQILGD5Bjs.b,{variant:"secondary",size:"icon",onClick:()=>_optionalChain([m, 'access', _ => _.onOpenChange, 'optionalCall', _2 => _2(!1)]),className:"absolute right-4 top-4 rounded-full transition-opacity hover:opacity-100 focus:outline-none",children:[_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]}),_jsxruntime.jsx.call(void 0, "div",{children:o})]})]})})})});x.displayName=e.Content.displayName;var N=({className:a,...o})=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "flex flex-col space-y-1.5 text-left md:text-center",a),...o});N.displayName="DialogHeader";var w=({className:a,...o})=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...o});w.displayName="DialogFooter";var h=i.forwardRef(({className:a,...o},n)=>_jsxruntime.jsx.call(void 0, e.Title,{ref:n,className:_chunkFUYXCJOQjs.a.call(void 0, "text-lg font-semibold leading-none tracking-tight",a),...o}));h.displayName=e.Title.displayName;var T=i.forwardRef(({className:a,...o},n)=>_jsxruntime.jsx.call(void 0, e.Description,{ref:n,className:_chunkFUYXCJOQjs.a.call(void 0, "text-sm text-muted-foreground",a),...o}));T.displayName=e.Description.displayName;exports.a = b; exports.b = M; exports.c = P; exports.d = L; exports.e = C; exports.f = x; exports.g = N; exports.h = w; exports.i = h; exports.j = T;
|
|
3
|
+
//# sourceMappingURL=chunk-BV7RXRSL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-CP7BC57S.js","../src/components/dialog.tsx"],"names":["DialogContentContext","Dialog","children","controlledOpen","controlledOnOpenChange","props","internalOpen","setInternalOpen","isControlled","open","onOpenChange","newOpen","jsx","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","ref","cn","DialogContent","showCloseButton","closeOnOverlayClick","isDesktop","useMediaQuery","context","jsxs","e","Button","X","DrawerPrimitive","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,sDAAwC,uECChG,oGACU,4BACS,2CACxB,+CAgCZ,IArBAA,CAAAA,CAA6B,CAAA,CAAA,aAAA,CAAyC,CAAC,CAAC,CAAA,CAExEC,CAAAA,aAAS,CAAC,CACd,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAMC,CAAAA,CACN,YAAA,CAAcC,CAAAA,CACd,GAAGC,CACL,CAAA,CAAA,EAAyD,CAEvD,GAAM,CAACC,CAAAA,CAAcC,CAAe,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAEtDC,CAAAA,CAAeL,CAAAA,GAAmB,KAAA,CAAA,CAClCM,CAAAA,CAAOD,CAAAA,CAAeL,CAAAA,CAAiBG,CAAAA,CACvCI,CAAAA,CAAeF,CAAAA,CACjBJ,CAAAA,CACCO,CAAAA,EAAqB,CACpBJ,CAAAA,CAAgBI,CAAO,CACzB,CAAA,CAEJ,OACEC,6BAAAA,CAAiB,CAAA,IAAA,CAAhB,CAA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Af,CAAAA,CACA,GAAGZ,CACL,CAAA,CAAA,EACEO,6BAAAA,KAAC,CAAA,CACC,SAAA,CAAWO,gCAAAA,+DACT,CACAF,CACF,CAAA,CACC,GAAGZ,CAAAA,CACN,CAAA,CAEF2B,CAAAA,CAAa,WAAA,CAAc,cAAA,CAE3B,IAAMC,CAAAA,CAAoB,CAAA,CAAA,UAAA,CAGxB,CAAC,CAAE,SAAA,CAAAhB,CAAAA,CAAW,GAAGZ,CAAM,CAAA,CAAGa,CAAAA,CAAAA,EAC1BN,6BAAAA,CAAiB,CAAA,KAAA,CAAhB,CACC,GAAA,CAAKM,CAAAA,CACL,SAAA,CAAWC,gCAAAA,mDACT,CACAF,CACF,CAAA,CACC,GAAGZ,CAAAA,CACN,CACD,CAAA,CACD4B,CAAAA,CAAY,WAAA,CAA8B,CAAA,CAAA,KAAA,CAAM,WAAA,CAEhD,IAAMC,CAAAA,CAA0B,CAAA,CAAA,UAAA,CAG9B,CAAC,CAAE,SAAA,CAAAjB,CAAAA,CAAW,GAAGZ,CAAM,CAAA,CAAGa,CAAAA,CAAAA,EAC1BN,6BAAAA,CAAiB,CAAA,WAAA,CAAhB,CACC,GAAA,CAAKM,CAAAA,CACL,SAAA,CAAWC,gCAAAA,+BAAG,CAAiCF,CAAS,CAAA,CACvD,GAAGZ,CAAAA,CACN,CACD,CAAA,CACD6B,CAAAA,CAAkB,WAAA,CAA8B,CAAA,CAAA,WAAA,CAAY,WAAA,CAAA,qJAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-CP7BC57S.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"./button\"\nimport { useMediaQuery } from \"@/lib/use-media-query\"\n\ninterface DialogContentContextValue {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nconst DialogContentContext = React.createContext<DialogContentContextValue>({})\n\nconst Dialog = ({\n children,\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) => {\n // Use internal state when Dialog is uncontrolled\n const [internalOpen, setInternalOpen] = React.useState(false)\n\n const isControlled = controlledOpen !== undefined\n const open = isControlled ? controlledOpen : internalOpen\n const onOpenChange = isControlled\n ? controlledOnOpenChange\n : (newOpen: boolean) => {\n setInternalOpen(newOpen)\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange} {...props}>\n <DialogContentContext.Provider value={{ open, onOpenChange }}>\n {children}\n </DialogContentContext.Provider>\n </DialogPrimitive.Root>\n )\n}\nDialog.displayName = \"Dialog\"\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n closeOnOverlayClick?: boolean\n }\n>(\n (\n {\n className,\n children,\n showCloseButton = true,\n closeOnOverlayClick = true,\n ...props\n },\n ref\n ) => {\n const isDesktop = useMediaQuery(\"md\")\n const context = React.useContext(DialogContentContext)\n\n if (!isDesktop) {\n // Mobile: Render as bottom drawer\n return (\n <DialogPortal>\n <DrawerPrimitive.Root\n open={context.open}\n onOpenChange={context.onOpenChange}\n dismissible={closeOnOverlayClick}\n >\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DrawerPrimitive.Content\n ref={ref as any}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex flex-col rounded-t-3xl border border-border bg-background shadow-lg outline-none\",\n className\n )}\n aria-describedby={undefined}\n onPointerDownOutside={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n onEscapeKeyDown={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n {...props}\n >\n <div className=\"mx-auto mt-2 h-2 w-[100px] rounded-full bg-muted\" />\n {showCloseButton && (\n <Button\n variant=\"secondary\"\n size=\"icon\"\n onClick={() => context.onOpenChange?.(false)}\n className=\"absolute right-4 top-4 rounded-full transition-opacity hover:opacity-100 focus:outline-none\"\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </Button>\n )}\n <div>{children}</div>\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n </DialogPortal>\n )\n }\n\n // Desktop: Render as centered dialog\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-3xl overflow-auto\",\n className\n )}\n onPointerDownOutside={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n onEscapeKeyDown={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button\n variant=\"secondary\"\n size=\"icon\"\n className=\"absolute right-4 top-4 rounded-full transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none\"\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n }\n)\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-left md:text-center\",\n className\n )}\n {...props}\n />\n)\nDialogHeader.displayName = \"DialogHeader\"\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n)\nDialogFooter.displayName = \"DialogFooter\"\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className\n )}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-BV7RXRSL.js","../src/components/dialog.tsx"],"names":["DialogContentContext","Dialog","children","controlledOpen","controlledOnOpenChange","props","internalOpen","setInternalOpen","isControlled","open","onOpenChange","newOpen","jsx","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","ref","cn","DialogContent","showCloseButton","closeOnOverlayClick","isDesktop","useMediaQuery","context","jsxs","e","Button","X","DrawerPrimitive","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,sDAAwC,uECChG,oGACU,4BACS,2CACxB,+CAgCZ,IArBAA,CAAAA,CAA6B,CAAA,CAAA,aAAA,CAAyC,CAAC,CAAC,CAAA,CAExEC,CAAAA,aAAS,CAAC,CACd,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAMC,CAAAA,CACN,YAAA,CAAcC,CAAAA,CACd,GAAGC,CACL,CAAA,CAAA,EAAyD,CAEvD,GAAM,CAACC,CAAAA,CAAcC,CAAe,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,CAAA,CAAK,CAAA,CAEtDC,CAAAA,CAAeL,CAAAA,GAAmB,KAAA,CAAA,CAClCM,CAAAA,CAAOD,CAAAA,CAAeL,CAAAA,CAAiBG,CAAAA,CACvCI,CAAAA,CAAeF,CAAAA,CACjBJ,CAAAA,CACCO,CAAAA,EAAqB,CACpBJ,CAAAA,CAAgBI,CAAO,CACzB,CAAA,CAEJ,OACEC,6BAAAA,CAAiB,CAAA,IAAA,CAAhB,CAAqB,IAAA,CAAMH,CAAAA,CAAM,YAAA,CAAcC,CAAAA,CAAe,GAAGL,CAAAA,CAChE,QAAA,CAAAO,6BAAAA,CAACZ,CAAqB,QAAA,CAArB,CAA8B,KAAA,CAAO,CAAE,IAAA,CAAAS,CAAAA,CAAM,YAAA,CAAAC,CAAa,CAAA,CACxD,QAAA,CAAAR,CAAAA,CACH,CAAA,CACF,CAEJ,CAAA,CACAD,CAAAA,CAAO,WAAA,C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AGZ,CAAM,CAAA,CAAGa,CAAAA,CAAAA,EAC1BN,6BAAAA,CAAiB,CAAA,KAAA,CAAhB,CACC,GAAA,CAAKM,CAAAA,CACL,SAAA,CAAWC,gCAAAA,mDACT,CACAF,CACF,CAAA,CACC,GAAGZ,CAAAA,CACN,CACD,CAAA,CACD4B,CAAAA,CAAY,WAAA,CAA8B,CAAA,CAAA,KAAA,CAAM,WAAA,CAEhD,IAAMC,CAAAA,CAA0B,CAAA,CAAA,UAAA,CAG9B,CAAC,CAAE,SAAA,CAAAjB,CAAAA,CAAW,GAAGZ,CAAM,CAAA,CAAGa,CAAAA,CAAAA,EAC1BN,6BAAAA,CAAiB,CAAA,WAAA,CAAhB,CACC,GAAA,CAAKM,CAAAA,CACL,SAAA,CAAWC,gCAAAA,+BAAG,CAAiCF,CAAS,CAAA,CACvD,GAAGZ,CAAAA,CACN,CACD,CAAA,CACD6B,CAAAA,CAAkB,WAAA,CAA8B,CAAA,CAAA,WAAA,CAAY,WAAA,CAAA,qJAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-BV7RXRSL.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"./button\"\nimport { useMediaQuery } from \"@/lib/use-media-query\"\n\ninterface DialogContentContextValue {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nconst DialogContentContext = React.createContext<DialogContentContextValue>({})\n\nconst Dialog = ({\n children,\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) => {\n // Use internal state when Dialog is uncontrolled\n const [internalOpen, setInternalOpen] = React.useState(false)\n\n const isControlled = controlledOpen !== undefined\n const open = isControlled ? controlledOpen : internalOpen\n const onOpenChange = isControlled\n ? controlledOnOpenChange\n : (newOpen: boolean) => {\n setInternalOpen(newOpen)\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange} {...props}>\n <DialogContentContext.Provider value={{ open, onOpenChange }}>\n {children}\n </DialogContentContext.Provider>\n </DialogPrimitive.Root>\n )\n}\nDialog.displayName = \"Dialog\"\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n closeOnOverlayClick?: boolean\n }\n>(\n (\n {\n className,\n children,\n showCloseButton = true,\n closeOnOverlayClick = true,\n ...props\n },\n ref\n ) => {\n const isDesktop = useMediaQuery(\"md\")\n const context = React.useContext(DialogContentContext)\n\n if (!isDesktop) {\n // Mobile: Render as bottom drawer\n return (\n <DialogPortal>\n <DrawerPrimitive.Root\n open={context.open}\n onOpenChange={context.onOpenChange}\n dismissible={closeOnOverlayClick}\n >\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm\" />\n <DrawerPrimitive.Content\n ref={ref as any}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex flex-col rounded-t-3xl border border-border bg-background shadow-lg outline-none\",\n className\n )}\n aria-describedby={undefined}\n onPointerDownOutside={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n onEscapeKeyDown={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n {...props}\n >\n <div className=\"mx-auto mt-2 h-2 w-[100px] rounded-full bg-muted\" />\n {showCloseButton && (\n <Button\n variant=\"secondary\"\n size=\"icon\"\n onClick={() => context.onOpenChange?.(false)}\n className=\"absolute right-4 top-4 rounded-full transition-opacity hover:opacity-100 focus:outline-none\"\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </Button>\n )}\n <div>{children}</div>\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n </DialogPortal>\n )\n }\n\n // Desktop: Render as centered dialog\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-3xl overflow-auto\",\n className\n )}\n onPointerDownOutside={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n onEscapeKeyDown={(e) => {\n if (!closeOnOverlayClick) {\n e.preventDefault()\n }\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button\n variant=\"secondary\"\n size=\"icon\"\n className=\"absolute right-4 top-4 rounded-full transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none\"\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n }\n)\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-left md:text-center\",\n className\n )}\n {...props}\n />\n)\nDialogHeader.displayName = \"DialogHeader\"\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n)\nDialogFooter.displayName = \"DialogFooter\"\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className\n )}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var _chunkULIOO55Ijs = require('./chunk-ULIOO55I.js');var
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkULIOO55Ijs = require('./chunk-ULIOO55I.js');var _chunkCJOYCVKYjs = require('./chunk-CJOYCVKY.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var d = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');function U({options:c=[],groups:s,value:i,onValueChange:M,placeholder:u="Select option...",searchPlaceholder:D="Search...",emptyMessage:E="No option found.",disabled:I=!1,className:T,error:L=!1,multiple:l=!1,values:r=[],onValuesChange:f}){let[g,v]=d.useState(!1),x=d.useMemo(()=>s?s.flatMap(e=>e.options):c,[s,c]),C=x.find(e=>e.value===i),a=x.filter(e=>r.includes(e.value)),X=e=>{if(l){let n=r.includes(e)?r.filter(m=>m!==e):[...r,e];_optionalChain([f, 'optionalCall', _ => _(n)])}else _optionalChain([M, 'optionalCall', _2 => _2(e===i?"":e)]),v(!1)},$=(e,n)=>{n.preventDefault(),n.stopPropagation();let m=r.filter(q=>q!==e);_optionalChain([f, 'optionalCall', _3 => _3(m)])},j=()=>l?a.length===0?u:a.length===1?a[0].label:`${a.length} selected`:C?C.label:u,h=e=>{let n=l?r.includes(e.value):i===e.value;return _jsxruntime.jsxs.call(void 0, _chunkCJOYCVKYjs.h,{value:e.value,onSelect:X,className:"rounded-[12px]",children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:e.label}),_jsxruntime.jsx.call(void 0, _lucidereact.Check,{className:_chunkFUYXCJOQjs.a.call(void 0, "ml-auto h-4 w-4 shrink-0",n?"opacity-100":"opacity-0")})]},e.value)},y=()=>!l||a.length===0?null:_jsxruntime.jsx.call(void 0, "div",{className:"px-2 py-1.5",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-wrap gap-1",children:a.map(e=>_jsxruntime.jsxs.call(void 0, "div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:e.label}),_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-3 w-3 cursor-pointer",onClick:n=>$(e.value,n)})]},e.value))})});return _jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.a,{open:g,onOpenChange:v,children:[_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{type:"button",role:"combobox","aria-expanded":g,disabled:I,className:_chunkFUYXCJOQjs.a.call(void 0, "cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!i&&!r.length&&"text-secondary-text",L&&"border-destructive-foreground focus-visible:ring-destructive-foreground",T),children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:j()}),_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.c,{className:"overflow-hidden rounded-xl p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:_jsxruntime.jsxs.call(void 0, _chunkCJOYCVKYjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkCJOYCVKYjs.c,{placeholder:D}),_jsxruntime.jsxs.call(void 0, _chunkCJOYCVKYjs.d,{children:[_jsxruntime.jsx.call(void 0, _chunkCJOYCVKYjs.e,{children:E}),s?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[y(),s.map(e=>_jsxruntime.jsx.call(void 0, _chunkCJOYCVKYjs.f,{heading:e.label,children:e.options.map(h)},e.label))]}):_jsxruntime.jsxs.call(void 0, _chunkCJOYCVKYjs.f,{children:[y(),c.map(h)]})]})]})})]})}exports.a = U;
|
|
3
|
+
//# sourceMappingURL=chunk-C2EJGAYA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-C2EJGAYA.js","../src/components/combobox.tsx"],"names":["Combobox","options","groups","value","onValueChange","placeholder","searchPlaceholder","emptyMessage","disabled","className","error","multiple","values","onValuesChange","open","setOpen","allOptions","g","selectedOption","option","selectedOptions","handleSelect","currentValue","newValues","v","handleRemoveValue","valueToRemove","e","getDisplayText"],"mappings":"AAAA,22BAAY;AACZ,sDAAqD,sDAA2E,sDAAwC,uECDjJ,2CACe,+CAoGhC,SA7DUA,CAAAA,CAAS,CACvB,OAAA,CAAAC,CAAAA,CAAU,CAAC,CAAA,CACX,MAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,kBAAA,CACd,iBAAA,CAAAC,CAAAA,CAAoB,WAAA,CACpB,YAAA,CAAAC,CAAAA,CAAe,kBAAA,CACf,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,CAAA,CAAA,CACR,QAAA,CAAAC,CAAAA,CAAW,CAAA,CAAA,CACX,MAAA,CAAAC,CAAAA,CAAS,CAAC,CAAA,CACV,cAAA,CAAAC,CACF,CAAA,CAAkB,CAChB,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAU,CAAA,CAAA,QAAA,CAAS,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jBjB,CAAAA,CACES,CAAAA,CAAgB,MAAA,GAAW,CAAA,CAAUf,CAAAA,CACrCe,CAAAA,CAAgB,MAAA,GAAW,CAAA,CAAUA,CAAAA,CAAgB,CAAC,CAAA,CAAE,KAAA,CACrD,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-C2EJGAYA.js","sourcesContent":[null,"import * as React from \"react\"\nimport { Check, ChevronDown, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/components/command\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\nexport interface ComboboxOption {\n value: string\n label: string\n}\n\nexport interface ComboboxGroup {\n label: string\n options: ComboboxOption[]\n}\n\nexport interface ComboboxProps {\n options?: ComboboxOption[]\n groups?: ComboboxGroup[]\n value?: string\n onValueChange?: (value: string) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n}\n\nexport function Combobox({\n options = [],\n groups,\n value,\n onValueChange,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No option found.\",\n disabled = false,\n className,\n error = false,\n multiple = false,\n values = [],\n onValuesChange,\n}: ComboboxProps) {\n const [open, setOpen] = React.useState(false)\n\n const allOptions = React.useMemo(() => {\n if (groups) return groups.flatMap((g) => g.options)\n return options\n }, [groups, options])\n\n const selectedOption = allOptions.find((option) => option.value === value)\n const selectedOptions = allOptions.filter((option) =>\n values.includes(option.value)\n )\n\n const handleSelect = (currentValue: string) => {\n if (multiple) {\n const newValues = values.includes(currentValue)\n ? values.filter((v) => v !== currentValue)\n : [...values, currentValue]\n onValuesChange?.(newValues)\n } else {\n onValueChange?.(currentValue === value ? \"\" : currentValue)\n setOpen(false)\n }\n }\n\n const handleRemoveValue = (valueToRemove: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const newValues = values.filter((v) => v !== valueToRemove)\n onValuesChange?.(newValues)\n }\n\n const getDisplayText = () => {\n if (multiple) {\n if (selectedOptions.length === 0) return placeholder\n if (selectedOptions.length === 1) return selectedOptions[0].label\n return `${selectedOptions.length} selected`\n }\n return selectedOption ? selectedOption.label : placeholder\n }\n\n const renderOption = (option: ComboboxOption) => {\n const isSelected = multiple\n ? values.includes(option.value)\n : value === option.value\n\n return (\n <CommandItem\n key={option.value}\n value={option.value}\n onSelect={handleSelect}\n className=\"rounded-[12px]\"\n >\n <span className=\"truncate\">{option.label}</span>\n <Check\n className={cn(\n \"ml-auto h-4 w-4 shrink-0\",\n isSelected ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n </CommandItem>\n )\n }\n\n const renderSelectedChips = () => {\n if (!multiple || selectedOptions.length === 0) return null\n\n return (\n <div className=\"px-2 py-1.5\">\n <div className=\"flex flex-wrap gap-1\">\n {selectedOptions.map((option) => (\n <div\n key={option.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate\">{option.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer\"\n onClick={(e) => handleRemoveValue(option.value, e)}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"overflow-hidden rounded-xl p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <Command>\n <CommandInput placeholder={searchPlaceholder} />\n <CommandList>\n <CommandEmpty>{emptyMessage}</CommandEmpty>\n {groups ? (\n <>\n {renderSelectedChips()}\n {groups.map((group) => (\n <CommandGroup key={group.label} heading={group.label}>\n {group.options.map(renderOption)}\n </CommandGroup>\n ))}\n </>\n ) : (\n <CommandGroup>\n {renderSelectedChips()}\n {options.map(renderOption)}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
|
|
2
|
-
var
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkBV7RXRSLjs = require('./chunk-BV7RXRSL.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var d = _interopRequireWildcard(_react);var _cmdk = require('cmdk');var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var p=d.forwardRef(({className:e,...t},a)=>_jsxruntime.jsx.call(void 0, _cmdk.Command,{ref:a,className:_chunkFUYXCJOQjs.a.call(void 0, "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));p.displayName=_cmdk.Command.displayName;var P=({children:e,...t})=>_jsxruntime.jsx.call(void 0, _chunkBV7RXRSLjs.a,{...t,children:_jsxruntime.jsx.call(void 0, _chunkBV7RXRSLjs.f,{className:"overflow-hidden p-0 shadow-lg",children:_jsxruntime.jsx.call(void 0, p,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),c= exports.c =d.forwardRef(({className:e,...t},a)=>_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),_jsxruntime.jsx.call(void 0, _cmdk.Command.Input,{ref:a,className:_chunkFUYXCJOQjs.a.call(void 0, "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));c.displayName=_cmdk.Command.Input.displayName;var f=d.forwardRef(({className:e,...t},a)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.List,{ref:a,className:_chunkFUYXCJOQjs.a.call(void 0, "max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));f.displayName=_cmdk.Command.List.displayName;var l=d.forwardRef((e,t)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));l.displayName=_cmdk.Command.Empty.displayName;var u=d.forwardRef(({className:e,...t},a)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.Group,{ref:a,className:_chunkFUYXCJOQjs.a.call(void 0, "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));u.displayName=_cmdk.Command.Group.displayName;var g=d.forwardRef(({className:e,...t},a)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.Separator,{ref:a,className:_chunkFUYXCJOQjs.a.call(void 0, "-mx-1 h-px bg-border",e),...t}));g.displayName=_cmdk.Command.Separator.displayName;var y=d.forwardRef(({className:e,...t},a)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.Item,{ref:a,className:_chunkFUYXCJOQjs.a.call(void 0, "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-muted aria-selected:text-secondary-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 truncate",e),...t}));y.displayName=_cmdk.Command.Item.displayName;var R=({className:e,...t})=>_jsxruntime.jsx.call(void 0, "span",{className:_chunkFUYXCJOQjs.a.call(void 0, "ml-auto text-xs tracking-widest text-muted-foreground",e),...t});R.displayName="CommandShortcut";exports.a = p; exports.b = P; exports.c = c; exports.d = f; exports.e = l; exports.f = u; exports.g = g; exports.h = y; exports.i = R;
|
|
3
|
+
//# sourceMappingURL=chunk-CJOYCVKY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-CJOYCVKY.js","../src/components/command.tsx"],"names":["Command","className","props","ref","jsx","CommandPrimitive","cn","CommandDialog","children","Dialog","DialogContent","CommandInput","jsxs","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut"],"mappings":"AAAA,uWAAY;AACZ,sDAA8C,sDAAwC,uECD/D,4BAEqB,2CACrB,+CASrB,IAJIA,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAGpB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAA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GxB,CAAC,CAAE,SAAA,CAAAjB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,aAACC,CAAiB,IAAA,CAAjB,CACC,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,gCAAAA,oPACT,CACAL,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACD,CAAA,CAEDgB,CAAAA,CAAY,WAAA,CAAcb,aAAAA,CAAiB,IAAA,CAAK,WAAA,CAEhD,IAAMc,CAAAA,CAAkB,CAAC,CACvB,SAAA,CAAAlB,CAAAA,CACA,GAAGC,CACL,CAAA,CAAA,EAEIE,6BAAAA,MAAC,CAAA,CACC,SAAA,CAAWE,gCAAAA,uDACT,CACAL,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAAA,CAGJiB,CAAAA,CAAgB,WAAA,CAAc,iBAAA,CAAA,sIAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-CJOYCVKY.js","sourcesContent":[null,"import * as React from \"react\"\nimport { type DialogProps } from \"@radix-ui/react-dialog\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { Search } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Dialog, DialogContent } from \"@/components/dialog\"\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\ninterface CommandDialogProps extends DialogProps {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n))\n\nCommandInput.displayName = CommandPrimitive.Input.displayName\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n))\n\nCommandList.displayName = CommandPrimitive.List.displayName\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n))\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n))\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n))\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-muted aria-selected:text-secondary-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 truncate\",\n className\n )}\n {...props}\n />\n))\n\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = \"CommandShortcut\"\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkGRXC46JCjs = require('./chunk-GRXC46JC.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var r = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _datefns = require('date-fns');var _reactpopover = require('@radix-ui/react-popover'); var e = _interopRequireWildcard(_reactpopover);var _jsxruntime = require('react/jsx-runtime');var y=e.Root,h=e.Trigger,c=r.forwardRef(({className:o,align:a="start",sideOffset:i=4,...n},s)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Content,{ref:s,align:a,sideOffset:i,className:_chunkFUYXCJOQjs.a.call(void 0, "z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o),...n})}));c.displayName=e.Content.displayName;var R=r.forwardRef(({date:o,onDateChange:a,placeholder:i="Pick a date",disabled:n=!1,className:s,calendarProps:f,formatStr:P="PPP"},v)=>{let[u,p]=r.useState(!1);return _jsxruntime.jsxs.call(void 0, y,{open:u,onOpenChange:p,children:[_jsxruntime.jsx.call(void 0, h,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{ref:v,type:"button",className:_chunkFUYXCJOQjs.a.call(void 0, "flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!o&&"text-secondary-text",s),disabled:n,children:[_jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon,{className:"mr-2 h-4 w-4"}),o?_datefns.format.call(void 0, o,P):_jsxruntime.jsx.call(void 0, "span",{children:i})]})}),_jsxruntime.jsx.call(void 0, c,{className:"w-auto p-0 rounded-3xl",align:"start",children:_jsxruntime.jsx.call(void 0, _chunkGRXC46JCjs.a,{mode:"single",selected:o,onSelect:g=>{_optionalChain([a, 'optionalCall', _ => _(g)]),p(!1)},defaultMonth:o,...f})})]})});R.displayName="DatePicker";exports.a = R;
|
|
3
|
+
//# sourceMappingURL=chunk-DHHZMQ72.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-DHHZMQ72.js","../src/components/date-picker.tsx"],"names":["Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","jsx","cn","DatePicker","date","onDateChange","placeholder","disabled","calendarProps","formatStr","open","setOpen","jsxs","CalendarIcon","format","Calendar","selectedDate"],"mappings":"AAAA,22BAAY;AACZ,sDAAuC,sDAAwC,uECCxD,2CACM,mCACN,uGACW,+CAa9B,IAREA,CAAAA,CAA2B,CAAA,CAAA,IAAA,CAC3BC,CAAAA,CAAkC,CAAA,CAAA,OAAA,CAElCC,CAAAA,CAAuB,CAAA,CAAA,U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,CAAA,CACA,QAAA,CAAUW,CAAAA,CAEV,QAAA,CAAA,CAAAN,6BAAAA,yBAACY,CAAA,CAAa,SAAA,CAAU,cAAA,CAAe,CAAA,CACtCT,CAAAA,CAAOU,6BAAAA,CAAOV,CAAMK,CAAS,CAAA,CAAIR,6BAAAA,MAAC,CAAA,CAAM,QAAA,CAAAK,CAAAA,CAAY,CAAA,CAAA,CACvD,CAAA,CACF,CAAA,CACAL,6BAAAA,CAACN,CAAA,CAAe,SAAA,CAAU,wBAAA,CAAyB,KAAA,CAAM,OAAA,CACvD,QAAA,CAAAM,6BAAAA,kBAACc,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAUX,CAAAA,CACV,QAAA,CAAWY,CAAAA,EAAiB,iBAC1BX,CAAAA,wBAAAA,CAAeW,CAAY,GAAA,CAC3BL,CAAAA,CAAQ,CAAA,CAAK,CACf,CAAA,CACA,YAAA,CAAcP,CAAAA,CACb,GAAGI,CAAAA,CACN,CAAA,CACF,CAAA,CAAA,CACF,CAEJ,CACF,CAAA,CAEAL,CAAAA,CAAW,WAAA,CAAc,YAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-DHHZMQ72.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport { format } from \"date-fns\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/calendar\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-auto rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n disabled?: boolean\n className?: string\n calendarProps?: Omit<\n React.ComponentProps<typeof Calendar>,\n \"mode\" | \"selected\" | \"onSelect\"\n >\n formatStr?: string\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n disabled = false,\n className,\n calendarProps,\n formatStr = \"PPP\",\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false)\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"flex my-2 h-9 w-full items-center rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !date && \"text-secondary-text\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, formatStr) : <span>{placeholder}</span>}\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0 rounded-3xl\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={(selectedDate) => {\n onDateChange?.(selectedDate)\n setOpen(false)\n }}\n defaultMonth={date}\n {...calendarProps}\n />\n </PopoverContent>\n </Popover>\n )\n }\n)\n\nDatePicker.displayName = \"DatePicker\"\n\nexport { DatePicker }\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as f}from"./chunk-5TVDBV74.mjs";import{a as p}from"./chunk-4LR7SOCY.mjs";import{b as w}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as f}from"./chunk-5TVDBV74.mjs";import{a as p}from"./chunk-4LR7SOCY.mjs";import{b as w}from"./chunk-BLHKJHNV.mjs";import{a as i}from"./chunk-S5TKCF6T.mjs";import*as a from"react";import{X as x}from"lucide-react";import{Drawer as l}from"vaul";import{jsx as r,jsxs as d}from"react/jsx-runtime";var R="24rem",v=a.createContext(null);function h(){let e=a.useContext(v);if(!e)throw new Error("useDrawer must be used within a Drawer component.");return e}var y=a.forwardRef(({isOpen:e,onClose:o,width:t=R,children:s,...n},c)=>{let u=a.useRef(null),m=p("lg"),b=a.useMemo(()=>({isOpen:e,onClose:o,width:t}),[e,o,t]);return d(v.Provider,{value:b,children:[!m&&r(l.Root,{open:e,onOpenChange:D=>{D||o()},direction:"left",children:d(l.Portal,{children:[r(l.Overlay,{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm"}),d(l.Content,{className:"fixed inset-y-0 left-0 z-50 flex h-full w-[85vw] max-w-md flex-col bg-sidebar border-r border-sidebar-border text-primary-accent shadow-lg outline-none","aria-describedby":void 0,children:[r(l.Title,{className:"sr-only",children:"Drawer"}),s]})]})}),m&&d("div",{ref:c,className:"group/drawer peer","data-state":e?"open":"closed",...n,children:[r("div",{className:i("relative bg-sidebar transition-[width] duration-200 ease-linear",e?"":"w-0"),style:{width:e?t:"0"}}),r("div",{ref:u,className:i("fixed right-0 z-40 transition-[right,width,top,height] duration-200 ease-linear flex","top-(--sidebar-top,0px) h-[calc(100svh-var(--sidebar-top,0px))]",e?"right-0":"right-[calc(var(--drawer-width)*-1)]"),style:{"--drawer-width":t,width:t},children:r("div",{"data-drawer":"drawer",className:"flex h-full w-full flex-col",children:r("div",{className:"flex flex-col my-2.5 mr-2.5 rounded-2xl border bg-sidebar border-sidebar-border h-[calc(100%-1.25rem)] shadow",children:s})})})]})]})});y.displayName="Drawer";var C=a.forwardRef(({className:e,showCloseButton:o=!0,children:t,...s},n)=>{let{onClose:c}=h();return d("div",{ref:n,"data-drawer":"header",className:i("flex w-full items-start justify-between gap-2 p-4 border-b border-sidebar-border",e),...s,children:[r("div",{className:"flex-1",children:t}),o&&d(w,{variant:"secondary",size:"icon",onClick:c,className:"h-8 w-8 shrink-0 rounded-full",children:[r(x,{size:16}),r("span",{className:"sr-only",children:"Close drawer"})]})]})});C.displayName="DrawerHeader";var N=a.forwardRef(({className:e,...o},t)=>r("h2",{ref:t,className:i("text-lg font-semibold text-primary-accent",e),...o}));N.displayName="DrawerTitle";var g=a.forwardRef(({className:e,children:o,...t},s)=>r(f,{className:"flex-1",ref:s,children:r("div",{"data-drawer":"body",className:i("p-4",e),...t,children:o})}));g.displayName="DrawerBody";var P=a.forwardRef(({className:e,...o},t)=>r("div",{ref:t,"data-drawer":"footer",className:i("flex flex-col gap-2 p-4 border-t border-sidebar-border",e),...o}));P.displayName="DrawerFooter";export{h as a,y as b,C as c,N as d,g as e,P as f};
|
|
3
|
+
//# sourceMappingURL=chunk-DKMCJGI4.mjs.map
|