@alkimi.org/ui-kit 0.12.7 → 0.13.2
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/COMPONENTS.md +11 -2
- package/dist/{chunk-3TLCOZ5R.js → chunk-24EJLBGD.js} +2 -2
- package/dist/chunk-24EJLBGD.js.map +1 -0
- package/dist/chunk-372VUZFE.js.map +1 -1
- package/dist/chunk-3BVMHDYA.js.map +1 -1
- package/dist/{chunk-GRXC46JC.js → chunk-3DUPSGEY.js} +2 -2
- package/dist/chunk-3DUPSGEY.js.map +1 -0
- package/dist/{chunk-DMMKR6TY.js → chunk-3N5K4X23.js} +2 -2
- package/dist/chunk-3N5K4X23.js.map +1 -0
- package/dist/chunk-3PEPOFYU.js.map +1 -1
- package/dist/{chunk-DATWXRPT.mjs → chunk-4DRIPZWE.mjs} +2 -2
- package/dist/{chunk-BV7RXRSL.js → chunk-53P3PXF7.js} +2 -2
- package/dist/chunk-53P3PXF7.js.map +1 -0
- package/dist/chunk-5L5DM2X5.js.map +1 -1
- package/dist/chunk-5X26XR44.js.map +1 -1
- package/dist/{chunk-GTHJWD33.js → chunk-73MWZSJI.js} +2 -2
- package/dist/chunk-73MWZSJI.js.map +1 -0
- package/dist/chunk-7SOZ6MOV.js.map +1 -1
- package/dist/chunk-ALSJLUSL.js.map +1 -1
- package/dist/chunk-C4GUY2JQ.js.map +1 -1
- package/dist/chunk-CT2CRYC2.js.map +1 -1
- package/dist/chunk-DEWWZMYC.js.map +1 -1
- package/dist/chunk-EBNJXPHG.js.map +1 -1
- package/dist/{chunk-UAUSYTY4.mjs → chunk-EDOMXQSZ.mjs} +2 -2
- package/dist/{chunk-UAUSYTY4.mjs.map → chunk-EDOMXQSZ.mjs.map} +1 -1
- package/dist/chunk-EIM5R7AJ.js.map +1 -1
- package/dist/chunk-EJTY2ABY.js.map +1 -1
- package/dist/{chunk-QMJVRGPB.mjs → chunk-EOFZPG26.mjs} +2 -2
- package/dist/{chunk-QMJVRGPB.mjs.map → chunk-EOFZPG26.mjs.map} +1 -1
- package/dist/chunk-ETE5IUMO.js.map +1 -1
- package/dist/chunk-FUYXCJOQ.js.map +1 -1
- package/dist/chunk-I5INE4KG.js.map +1 -1
- package/dist/{chunk-RKRTEMMZ.js → chunk-IJRJBDSO.js} +2 -2
- package/dist/chunk-IJRJBDSO.js.map +1 -0
- package/dist/{chunk-XQILGD5B.js → chunk-IJVB2BVO.js} +2 -2
- package/dist/chunk-IJVB2BVO.js.map +1 -0
- package/dist/{chunk-DKMCJGI4.mjs → chunk-JD2CTTZW.mjs} +2 -2
- package/dist/chunk-JOEQLSHD.js.map +1 -1
- package/dist/{chunk-PD43W3YN.mjs → chunk-JYA3425I.mjs} +2 -2
- package/dist/chunk-KN2ZJ5E6.mjs +3 -0
- package/dist/chunk-KN2ZJ5E6.mjs.map +1 -0
- package/dist/{chunk-574USYNO.mjs → chunk-MKZJL4AD.mjs} +2 -2
- package/dist/{chunk-574USYNO.mjs.map → chunk-MKZJL4AD.mjs.map} +1 -1
- package/dist/{chunk-DHHZMQ72.js → chunk-NCBOTFZQ.js} +2 -2
- package/dist/chunk-NCBOTFZQ.js.map +1 -0
- package/dist/chunk-NU2US7UW.mjs +3 -0
- package/dist/chunk-NU2US7UW.mjs.map +1 -0
- package/dist/{chunk-AQZWRJVJ.mjs → chunk-OLF2HLRF.mjs} +2 -2
- package/dist/chunk-OLF2HLRF.mjs.map +1 -0
- package/dist/chunk-QOEM7ZRV.mjs +3 -0
- package/dist/chunk-QOEM7ZRV.mjs.map +1 -0
- package/dist/{chunk-BLHKJHNV.mjs → chunk-QZKQORLQ.mjs} +2 -2
- package/dist/chunk-QZKQORLQ.mjs.map +1 -0
- package/dist/chunk-RJMIOBXZ.js.map +1 -1
- package/dist/chunk-RRAIGAHU.js.map +1 -1
- package/dist/{chunk-KLU33CJI.mjs → chunk-RUEPYIWM.mjs} +2 -2
- package/dist/{chunk-7J2ETVGK.js → chunk-SPGHRCUD.js} +2 -2
- package/dist/chunk-SPGHRCUD.js.map +1 -0
- package/dist/chunk-TDMRUCR6.js.map +1 -1
- package/dist/chunk-UJZP6L4S.js.map +1 -1
- package/dist/chunk-ULIOO55I.js.map +1 -1
- package/dist/chunk-UNR6ATUH.js.map +1 -1
- package/dist/chunk-UW73WIQU.js +3 -0
- package/dist/chunk-UW73WIQU.js.map +1 -0
- package/dist/chunk-WFD523CV.js.map +1 -1
- package/dist/chunk-WKRZIVSX.js +3 -0
- package/dist/chunk-WKRZIVSX.js.map +1 -0
- package/dist/chunk-WYRD4UAK.js.map +1 -1
- package/dist/{chunk-USPGZYMV.js → chunk-XUVA7BXG.js} +2 -2
- package/dist/chunk-XUVA7BXG.js.map +1 -0
- package/dist/chunk-XVF3OJWZ.js +3 -0
- package/dist/chunk-XVF3OJWZ.js.map +1 -0
- package/dist/chunk-XYO4VLMF.js.map +1 -1
- package/dist/{chunk-LQMOWEA7.js → chunk-YE7OOLWB.js} +2 -2
- package/dist/chunk-YE7OOLWB.js.map +1 -0
- package/dist/{chunk-TYRJ7CQV.mjs → chunk-YIVVQTGD.mjs} +2 -2
- package/dist/chunk-YSIF7HA3.mjs +3 -0
- package/dist/chunk-YSIF7HA3.mjs.map +1 -0
- package/dist/chunk-Z5V4P3EC.js.map +1 -1
- package/dist/components/GeometricFluidGrid.js.map +1 -1
- package/dist/components/GlitchLink.js.map +1 -1
- package/dist/components/PixelLoad.js.map +1 -1
- package/dist/components/TextDecoder.js.map +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb.mjs +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/button.mjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/calendar.mjs +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.d.mts +19 -2
- package/dist/components/combobox.d.ts +19 -2
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/combobox.mjs +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/command.mjs +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-picker.js.map +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.js.map +1 -1
- package/dist/components/date-range-picker.mjs +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dialog.mjs +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/drawer.mjs +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/file-upload.js.map +1 -1
- package/dist/components/file-upload.mjs +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/input.mjs +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/sidebar.mjs +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tabs.mjs +1 -1
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.js.map +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tree-select.js +1 -1
- package/dist/components/tree-select.js.map +1 -1
- package/dist/components/tree-select.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3TLCOZ5R.js.map +0 -1
- package/dist/chunk-4UISHS25.mjs +0 -3
- package/dist/chunk-4UISHS25.mjs.map +0 -1
- package/dist/chunk-7FUNOEYE.mjs +0 -3
- package/dist/chunk-7FUNOEYE.mjs.map +0 -1
- package/dist/chunk-7J2ETVGK.js.map +0 -1
- package/dist/chunk-AQZWRJVJ.mjs.map +0 -1
- package/dist/chunk-BLHKJHNV.mjs.map +0 -1
- package/dist/chunk-BV7RXRSL.js.map +0 -1
- package/dist/chunk-DHHZMQ72.js.map +0 -1
- package/dist/chunk-DMMKR6TY.js.map +0 -1
- package/dist/chunk-GRXC46JC.js.map +0 -1
- package/dist/chunk-GTHJWD33.js.map +0 -1
- package/dist/chunk-K4GMCVHO.js +0 -3
- package/dist/chunk-K4GMCVHO.js.map +0 -1
- package/dist/chunk-LQMOWEA7.js.map +0 -1
- package/dist/chunk-NEOUFWZN.mjs +0 -3
- package/dist/chunk-NEOUFWZN.mjs.map +0 -1
- package/dist/chunk-ODXDXJ72.js +0 -3
- package/dist/chunk-ODXDXJ72.js.map +0 -1
- package/dist/chunk-RKRTEMMZ.js.map +0 -1
- package/dist/chunk-USPGZYMV.js.map +0 -1
- package/dist/chunk-VBPIXXIA.js +0 -3
- package/dist/chunk-VBPIXXIA.js.map +0 -1
- package/dist/chunk-WZ5F5VT3.mjs +0 -3
- package/dist/chunk-WZ5F5VT3.mjs.map +0 -1
- package/dist/chunk-XQILGD5B.js.map +0 -1
- /package/dist/{chunk-DATWXRPT.mjs.map → chunk-4DRIPZWE.mjs.map} +0 -0
- /package/dist/{chunk-DKMCJGI4.mjs.map → chunk-JD2CTTZW.mjs.map} +0 -0
- /package/dist/{chunk-PD43W3YN.mjs.map → chunk-JYA3425I.mjs.map} +0 -0
- /package/dist/{chunk-KLU33CJI.mjs.map → chunk-RUEPYIWM.mjs.map} +0 -0
- /package/dist/{chunk-TYRJ7CQV.mjs.map → chunk-YIVVQTGD.mjs.map} +0 -0
|
@@ -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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunkWYRD4UAKjs = require('./chunk-WYRD4UAK.js');var _chunkULIOO55Ijs = require('./chunk-ULIOO55I.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var i = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');function M(e){let n=[e.value];if(e.children)for(let a of e.children)n.push(...M(a));return n}function $(e,n){if(!e.children||e.children.length===0)return n.has(e.value)?"checked":"unchecked";let a=M(e),r=a.filter(l=>n.has(l)).length;return r===0?"unchecked":r===a.length?"checked":"indeterminate"}function J(e,n){let a=n.toLowerCase().trim();if(!a)return e;let r=[];for(let l of e){let f=l.label.toLowerCase().includes(a);if(l.children&&l.children.length>0){let h=J(l.children,n);f?r.push(l):h&&h.length>0&&r.push({...l,children:h})}else f&&r.push(l)}return r.length>0?r:null}function le(e,n){let a=n.toLowerCase().trim(),r=new Set;function l(f){let h=!1;for(let g of f){let w=g.label.toLowerCase().includes(a),S=!1;g.children&&(S=l(g.children)),(w||S)&&(r.add(g.value),h=!0)}return h}return l(e),r}function N(e,n){for(let a of e){if(a.value===n)return a;if(a.children){let r=N(a.children,n);if(r)return r}}}function Q(e){let n=new Set;for(let a of e)if(a.children&&a.children.length>0){n.add(a.value);for(let r of Q(a.children))n.add(r)}return n}function oe(e,n){if(!n)return e;let a=n.toLowerCase().trim();if(!a)return e;let r=e.toLowerCase().indexOf(a);return r===-1?e:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e.slice(0,r),_jsxruntime.jsx.call(void 0, "span",{className:"font-semibold underline",children:e.slice(r,r+a.length)}),e.slice(r+a.length)]})}function W({node:e,depth:n,multiple:a,selectedSet:r,expandedValues:l,focusedValue:f,onToggleExpand:h,onSelect:g,onFocus:w,searchTerm:S}){let V=e.children&&e.children.length>0,y=l.has(e.value),v=a?$(e,r):r.has(e.value)?"checked":"unchecked",A=n*20;return _jsxruntime.jsxs.call(void 0, "div",{role:"treeitem","aria-expanded":V?y:void 0,"aria-selected":v==="checked",children:[_jsxruntime.jsxs.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50","hover:bg-muted",v==="checked"&&!a&&"bg-muted"),style:{paddingLeft:`${8+A}px`},onClick:()=>g(e),onFocus:()=>w(e.value),"data-tree-value":e.value,tabIndex:f===e.value?0:-1,children:[V?_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50",onClick:m=>{m.stopPropagation(),h(e.value)},"aria-label":y?`Collapse ${e.label}`:`Expand ${e.label}`,tabIndex:-1,children:y?_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"h-3.5 w-3.5"}):_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight,{className:"h-3.5 w-3.5"})}):_jsxruntime.jsx.call(void 0, "span",{className:"h-4 w-4 shrink-0"}),a?_jsxruntime.jsx.call(void 0, _chunkWYRD4UAKjs.a,{checked:v==="checked"?!0:v==="indeterminate"?"indeterminate":!1,onCheckedChange:()=>g(e),onClick:m=>m.stopPropagation(),className:"shrink-0","aria-label":e.label}):_jsxruntime.jsx.call(void 0, _lucidereact.Check,{className:_chunkFUYXCJOQjs.a.call(void 0, "h-4 w-4 shrink-0",v==="checked"?"opacity-100":"opacity-0")}),_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:oe(e.label,S)})]}),V&&y&&_jsxruntime.jsx.call(void 0, "div",{role:"group",children:e.children.map(m=>_jsxruntime.jsx.call(void 0, W,{node:m,depth:n+1,multiple:a,selectedSet:r,expandedValues:l,focusedValue:f,onToggleExpand:h,onSelect:g,onFocus:w,searchTerm:S},m.value))})]})}function ge({nodes:e,value:n,onValueChange:a,multiple:r=!1,values:l=[],onValuesChange:f,placeholder:h="Select...",searchPlaceholder:g="Search...",emptyMessage:w="No results found.",disabled:S=!1,className:V,error:y=!1,defaultExpandedValues:v,expandAll:A=!1}){let[m,B]=i.useState(!1),[b,K]=i.useState(""),[p,k]=i.useState(null),[D,L]=i.useState(()=>A?Q(e):v?new Set(v):new Set),P=i.useRef(null),I=i.useRef(null),C=i.useMemo(()=>new Set(r?l:n?[n]:[]),[r,l,n]),F=i.useMemo(()=>b?J(e,b):e,[e,b]);i.useEffect(()=>{if(b){P.current||(P.current=new Set(D));let t=le(e,b);L(t)}else P.current&&(L(P.current),P.current=null)},[b,e]);let Y=i.useCallback(t=>{B(t),t||(K(""),k(null))},[]),T=i.useCallback(t=>{L(s=>{let d=new Set(s);return d.has(t)?d.delete(t):d.add(t),d})},[]),H=i.useCallback(t=>{if(r){let s=M(t),d=$(t,C),c;if(d==="checked"){let u=new Set(s);c=l.filter(R=>!u.has(R))}else{let u=s.filter(R=>!C.has(R));c=[...l,...u]}_optionalChain([f, 'optionalCall', _2 => _2(c)])}else{if(t.children&&t.children.length>0){T(t.value);return}let d=t.value===n?"":t.value;_optionalChain([a, 'optionalCall', _3 => _3(d)]),B(!1)}},[r,l,n,C,f,a,T]),Z=i.useCallback((t,s)=>{s.preventDefault(),s.stopPropagation();let d=N(e,t);if(d){let c=new Set(M(d)),u=l.filter(R=>!c.has(R));_optionalChain([f, 'optionalCall', _4 => _4(u)])}},[e,l,f]),q=i.useMemo(()=>{if(!r)return[];let t=[];function s(d){for(let c of d){let u=$(c,C);u==="checked"?t.push(c.value):u==="indeterminate"&&c.children&&s(c.children)}}return s(e),t},[e,C,r]),O=i.useCallback(()=>I.current?Array.from(I.current.querySelectorAll("[data-tree-value]")):[],[]),_=i.useCallback(t=>{let s=O(),d=s.findIndex(c=>c.dataset.treeValue===p);switch(t.key){case"ArrowDown":{t.preventDefault();let c=Math.min(d+1,s.length-1),u=_optionalChain([s, 'access', _5 => _5[c], 'optionalAccess', _6 => _6.dataset, 'access', _7 => _7.treeValue]);u&&(k(u),_optionalChain([s, 'access', _8 => _8[c], 'optionalAccess', _9 => _9.focus, 'call', _10 => _10()]));break}case"ArrowUp":{t.preventDefault();let c=Math.max(d-1,0),u=_optionalChain([s, 'access', _11 => _11[c], 'optionalAccess', _12 => _12.dataset, 'access', _13 => _13.treeValue]);u&&(k(u),_optionalChain([s, 'access', _14 => _14[c], 'optionalAccess', _15 => _15.focus, 'call', _16 => _16()]));break}case"ArrowRight":{if(t.preventDefault(),p){let c=N(e,p);if(_optionalChain([c, 'optionalAccess', _17 => _17.children, 'optionalAccess', _18 => _18.length]))if(!D.has(p))T(p);else{let u=c.children[0].value;k(u),requestAnimationFrame(()=>{_optionalChain([O, 'call', _19 => _19(), 'access', _20 => _20.find, 'call', _21 => _21(re=>re.dataset.treeValue===u), 'optionalAccess', _22 => _22.focus, 'call', _23 => _23()])})}}break}case"ArrowLeft":{t.preventDefault(),p&&D.has(p)&&T(p);break}case"Enter":case" ":{if(t.preventDefault(),p){let c=N(e,p);c&&H(c)}break}case"Home":{t.preventDefault();let c=_optionalChain([s, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.dataset, 'access', _26 => _26.treeValue]);c&&(k(c),_optionalChain([s, 'access', _27 => _27[0], 'optionalAccess', _28 => _28.focus, 'call', _29 => _29()]));break}case"End":{t.preventDefault();let c=_optionalChain([s, 'access', _30 => _30[s.length-1], 'optionalAccess', _31 => _31.dataset, 'access', _32 => _32.treeValue]);c&&(k(c),_optionalChain([s, 'access', _33 => _33[s.length-1], 'optionalAccess', _34 => _34.focus, 'call', _35 => _35()]));break}}},[p,e,D,O,T,H]),ee=()=>r?l.length===0?h:l.length===1?_nullishCoalesce(_optionalChain([N, 'call', _36 => _36(e,l[0]), 'optionalAccess', _37 => _37.label]), () => (l[0])):`${l.length} selected`:n?_nullishCoalesce(_optionalChain([N, 'call', _38 => _38(e,n), 'optionalAccess', _39 => _39.label]), () => (n)):h,te=()=>{if(!r||q.length===0)return null;let t=q.map(s=>N(e,s)).filter(Boolean);return _jsxruntime.jsx.call(void 0, "div",{className:"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-wrap gap-1",children:t.map(s=>_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 max-w-[120px]",children:s.label}),_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-3 w-3 cursor-pointer shrink-0",onClick:d=>Z(s.value,d),"aria-label":`Remove ${s.label}`})]},s.value))})})};return _jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.a,{open:m,onOpenChange:Y,children:[_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"tree",disabled:S,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 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50",!n&&!l.length&&"text-secondary-text",y&&"border-destructive-foreground focus-visible:ring-destructive-foreground",V),children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:ee()}),_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.c,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center border-b px-3",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),_jsxruntime.jsx.call(void 0, "input",{value:b,onChange:t=>K(t.target.value),placeholder:g,className:"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","aria-label":"Search tree"})]}),te(),_jsxruntime.jsx.call(void 0, "div",{className:"max-h-[300px] overflow-y-auto",children:F&&F.length>0?_jsxruntime.jsx.call(void 0, "div",{ref:I,role:"tree","aria-label":"Options",className:"p-1",onKeyDown:_,children:F.map(t=>_jsxruntime.jsx.call(void 0, W,{node:t,depth:0,multiple:r,selectedSet:C,expandedValues:D,focusedValue:p,onToggleExpand:T,onSelect:H,onFocus:k,searchTerm:b},t.value))}):_jsxruntime.jsx.call(void 0, "div",{className:"py-6 text-center text-sm text-muted-foreground",children:w})})]})]})}exports.a = ge;
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkWYRD4UAKjs = require('./chunk-WYRD4UAK.js');var _chunkULIOO55Ijs = require('./chunk-ULIOO55I.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var i = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');function M(e){let n=[e.value];if(e.children)for(let a of e.children)n.push(...M(a));return n}function $(e,n){if(!e.children||e.children.length===0)return n.has(e.value)?"checked":"unchecked";let a=M(e),r=a.filter(l=>n.has(l)).length;return r===0?"unchecked":r===a.length?"checked":"indeterminate"}function J(e,n){let a=n.toLowerCase().trim();if(!a)return e;let r=[];for(let l of e){let f=l.label.toLowerCase().includes(a);if(l.children&&l.children.length>0){let h=J(l.children,n);f?r.push(l):h&&h.length>0&&r.push({...l,children:h})}else f&&r.push(l)}return r.length>0?r:null}function le(e,n){let a=n.toLowerCase().trim(),r=new Set;function l(f){let h=!1;for(let g of f){let w=g.label.toLowerCase().includes(a),S=!1;g.children&&(S=l(g.children)),(w||S)&&(r.add(g.value),h=!0)}return h}return l(e),r}function N(e,n){for(let a of e){if(a.value===n)return a;if(a.children){let r=N(a.children,n);if(r)return r}}}function Q(e){let n=new Set;for(let a of e)if(a.children&&a.children.length>0){n.add(a.value);for(let r of Q(a.children))n.add(r)}return n}function oe(e,n){if(!n)return e;let a=n.toLowerCase().trim();if(!a)return e;let r=e.toLowerCase().indexOf(a);return r===-1?e:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e.slice(0,r),_jsxruntime.jsx.call(void 0, "span",{className:"font-semibold underline",children:e.slice(r,r+a.length)}),e.slice(r+a.length)]})}function W({node:e,depth:n,multiple:a,selectedSet:r,expandedValues:l,focusedValue:f,onToggleExpand:h,onSelect:g,onFocus:w,searchTerm:S}){let V=e.children&&e.children.length>0,y=l.has(e.value),v=a?$(e,r):r.has(e.value)?"checked":"unchecked",A=n*20;return _jsxruntime.jsxs.call(void 0, "div",{role:"treeitem","aria-expanded":V?y:void 0,"aria-selected":v==="checked",children:[_jsxruntime.jsxs.call(void 0, "div",{className:_chunkFUYXCJOQjs.a.call(void 0, "relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50","hover:bg-muted",v==="checked"&&!a&&"bg-muted"),style:{paddingLeft:`${8+A}px`},onClick:()=>g(e),onFocus:()=>w(e.value),"data-tree-value":e.value,tabIndex:f===e.value?0:-1,children:[V?_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50",onClick:m=>{m.stopPropagation(),h(e.value)},"aria-label":y?`Collapse ${e.label}`:`Expand ${e.label}`,tabIndex:-1,children:y?_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"h-3.5 w-3.5"}):_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight,{className:"h-3.5 w-3.5"})}):_jsxruntime.jsx.call(void 0, "span",{className:"h-4 w-4 shrink-0"}),a?_jsxruntime.jsx.call(void 0, _chunkWYRD4UAKjs.a,{checked:v==="checked"?!0:v==="indeterminate"?"indeterminate":!1,onCheckedChange:()=>g(e),onClick:m=>m.stopPropagation(),className:"shrink-0","aria-label":e.label}):_jsxruntime.jsx.call(void 0, _lucidereact.Check,{className:_chunkFUYXCJOQjs.a.call(void 0, "h-4 w-4 shrink-0",v==="checked"?"opacity-100":"opacity-0")}),_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:oe(e.label,S)})]}),V&&y&&_jsxruntime.jsx.call(void 0, "div",{role:"group",children:e.children.map(m=>_jsxruntime.jsx.call(void 0, W,{node:m,depth:n+1,multiple:a,selectedSet:r,expandedValues:l,focusedValue:f,onToggleExpand:h,onSelect:g,onFocus:w,searchTerm:S},m.value))})]})}function ge({nodes:e,value:n,onValueChange:a,multiple:r=!1,values:l=[],onValuesChange:f,placeholder:h="Select...",searchPlaceholder:g="Search...",emptyMessage:w="No results found.",disabled:S=!1,className:V,error:y=!1,defaultExpandedValues:v,expandAll:A=!1}){let[m,B]=i.useState(!1),[b,K]=i.useState(""),[p,k]=i.useState(null),[D,L]=i.useState(()=>A?Q(e):v?new Set(v):new Set),P=i.useRef(null),I=i.useRef(null),C=i.useMemo(()=>new Set(r?l:n?[n]:[]),[r,l,n]),F=i.useMemo(()=>b?J(e,b):e,[e,b]);i.useEffect(()=>{if(b){P.current||(P.current=new Set(D));let t=le(e,b);L(t)}else P.current&&(L(P.current),P.current=null)},[b,e]);let Y=i.useCallback(t=>{B(t),t||(K(""),k(null))},[]),T=i.useCallback(t=>{L(s=>{let d=new Set(s);return d.has(t)?d.delete(t):d.add(t),d})},[]),H=i.useCallback(t=>{if(r){let s=M(t),d=$(t,C),c;if(d==="checked"){let u=new Set(s);c=l.filter(R=>!u.has(R))}else{let u=s.filter(R=>!C.has(R));c=[...l,...u]}_optionalChain([f, 'optionalCall', _2 => _2(c)])}else{if(t.children&&t.children.length>0){T(t.value);return}let d=t.value===n?"":t.value;_optionalChain([a, 'optionalCall', _3 => _3(d)]),B(!1)}},[r,l,n,C,f,a,T]),Z=i.useCallback((t,s)=>{s.preventDefault(),s.stopPropagation();let d=N(e,t);if(d){let c=new Set(M(d)),u=l.filter(R=>!c.has(R));_optionalChain([f, 'optionalCall', _4 => _4(u)])}},[e,l,f]),q=i.useMemo(()=>{if(!r)return[];let t=[];function s(d){for(let c of d){let u=$(c,C);u==="checked"?t.push(c.value):u==="indeterminate"&&c.children&&s(c.children)}}return s(e),t},[e,C,r]),O=i.useCallback(()=>I.current?Array.from(I.current.querySelectorAll("[data-tree-value]")):[],[]),_=i.useCallback(t=>{let s=O(),d=s.findIndex(c=>c.dataset.treeValue===p);switch(t.key){case"ArrowDown":{t.preventDefault();let c=Math.min(d+1,s.length-1),u=_optionalChain([s, 'access', _5 => _5[c], 'optionalAccess', _6 => _6.dataset, 'access', _7 => _7.treeValue]);u&&(k(u),_optionalChain([s, 'access', _8 => _8[c], 'optionalAccess', _9 => _9.focus, 'call', _10 => _10()]));break}case"ArrowUp":{t.preventDefault();let c=Math.max(d-1,0),u=_optionalChain([s, 'access', _11 => _11[c], 'optionalAccess', _12 => _12.dataset, 'access', _13 => _13.treeValue]);u&&(k(u),_optionalChain([s, 'access', _14 => _14[c], 'optionalAccess', _15 => _15.focus, 'call', _16 => _16()]));break}case"ArrowRight":{if(t.preventDefault(),p){let c=N(e,p);if(_optionalChain([c, 'optionalAccess', _17 => _17.children, 'optionalAccess', _18 => _18.length]))if(!D.has(p))T(p);else{let u=c.children[0].value;k(u),requestAnimationFrame(()=>{_optionalChain([O, 'call', _19 => _19(), 'access', _20 => _20.find, 'call', _21 => _21(re=>re.dataset.treeValue===u), 'optionalAccess', _22 => _22.focus, 'call', _23 => _23()])})}}break}case"ArrowLeft":{t.preventDefault(),p&&D.has(p)&&T(p);break}case"Enter":case" ":{if(t.preventDefault(),p){let c=N(e,p);c&&H(c)}break}case"Home":{t.preventDefault();let c=_optionalChain([s, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.dataset, 'access', _26 => _26.treeValue]);c&&(k(c),_optionalChain([s, 'access', _27 => _27[0], 'optionalAccess', _28 => _28.focus, 'call', _29 => _29()]));break}case"End":{t.preventDefault();let c=_optionalChain([s, 'access', _30 => _30[s.length-1], 'optionalAccess', _31 => _31.dataset, 'access', _32 => _32.treeValue]);c&&(k(c),_optionalChain([s, 'access', _33 => _33[s.length-1], 'optionalAccess', _34 => _34.focus, 'call', _35 => _35()]));break}}},[p,e,D,O,T,H]),ee=()=>r?l.length===0?h:l.length===1?_nullishCoalesce(_optionalChain([N, 'call', _36 => _36(e,l[0]), 'optionalAccess', _37 => _37.label]), () => (l[0])):`${l.length} selected`:n?_nullishCoalesce(_optionalChain([N, 'call', _38 => _38(e,n), 'optionalAccess', _39 => _39.label]), () => (n)):h,te=()=>{if(!r||q.length===0)return null;let t=q.map(s=>N(e,s)).filter(Boolean);return _jsxruntime.jsx.call(void 0, "div",{className:"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-wrap gap-1",children:t.map(s=>_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 max-w-[120px]",children:s.label}),_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-3 w-3 cursor-pointer shrink-0",onClick:d=>Z(s.value,d),"aria-label":`Remove ${s.label}`})]},s.value))})})};return _jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.a,{open:m,onOpenChange:Y,children:[_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"tree",disabled:S,className:_chunkFUYXCJOQjs.a.call(void 0, "cursor-pointer flex my-2 h-8 lg: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 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50",!n&&!l.length&&"text-secondary-text",y&&"border-destructive-foreground focus-visible:ring-destructive-foreground",V),children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:ee()}),_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.c,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center border-b px-3",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),_jsxruntime.jsx.call(void 0, "input",{value:b,onChange:t=>K(t.target.value),placeholder:g,className:"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","aria-label":"Search tree"})]}),te(),_jsxruntime.jsx.call(void 0, "div",{className:"max-h-[300px] overflow-y-auto",children:F&&F.length>0?_jsxruntime.jsx.call(void 0, "div",{ref:I,role:"tree","aria-label":"Options",className:"p-1",onKeyDown:_,children:F.map(t=>_jsxruntime.jsx.call(void 0, W,{node:t,depth:0,multiple:r,selectedSet:C,expandedValues:D,focusedValue:p,onToggleExpand:T,onSelect:H,onFocus:k,searchTerm:b},t.value))}):_jsxruntime.jsx.call(void 0, "div",{className:"py-6 text-center text-sm text-muted-foreground",children:w})})]})]})}exports.a = ge;
|
|
3
|
+
//# sourceMappingURL=chunk-YE7OOLWB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-YE7OOLWB.js","../src/components/tree-select.tsx"],"names":["getAllDescendantValues","node","values","child","getCheckState","selectedSet","descendants","selectedCount","v","filterTree","nodes","searchTerm","term","result","labelMatches","filteredChildren","getValuesOfMatchingNodes","walk","nodeList","hasMatch","childHasMatch","findNodeByValue","value","found","collectAllBranchValues","renderHighlightedLabel","label","index","jsxs","Fragment","jsx","TreeNodeItem","depth","multiple","expandedValues","focusedValue","onToggleExpand","onSelect","onFocus","hasChildren","isExpanded","checkState","indentPx","cn"],"mappings":"AAAA,+8BAAY;AACZ,sDAAuC,sDAAsD,sDAAwC,uECC9G,2CACqC,+CAgKxD,SA3HKA,CAAAA,CAAuBC,CAAAA,CAAgC,CAC9D,IAAMC,CAAAA,CAAmB,CAACD,CAAAA,CAAK,KAAK,CAAA,CACpC,EAAA,CAAIA,CAAAA,CAAK,QAAA,CACP,GAAA,CAAA,IAAWE,EAAAA,GAASF,CAAAA,CAAK,QAAA,CACvBC,CAAAA,CAAO,IAAA,CAAK,GAAGF,CAAAA,CAAuBG,CAAK,CAAC,CAAA,CAGhD,OAAOD,CACT,CAEA,SAASE,CAAAA,CACPH,CAAAA,CACAI,CAAAA,CACY,CACZ,EAAA,CAAI,CAACJ,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,GAAW,CAAA,CAC7C,OAAOI,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CAAI,SAAA,CAAY,WAAA,CAGnD,IAAMK,CAAAA,CAAcN,CAAAA,CAAuBC,CAAI,CAAA,CACzCM,CAAAA,CAAgBD,CAAAA,CAAY,MAAA,CAAQE,CAAAA,EAAMH,CAAAA,CAAY,GAAA,CAAIG,CAAC,CAAC,CAAA,CAAE,MAAA,CAEpE,OAAID,CAAAA,GAAkB,CAAA,CAAU,WAAA,CAC5BA,CAAAA,GAAkBD,CAAAA,CAAY,MAAA,CAAe,SAAA,CAC1C,eACT,CAEA,SAASG,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CACyB,CACzB,IAAMC,CAAAA,CAAOD,CAAAA,CAAW,WAAA,CAAY,CAAA,CAAE,IAAA,CAAK,CAAA,CAC3C,EAAA,CAAI,CAACC,CAAAA,CAAM,OAAOF,CAAAA,CAElB,IAAMG,CAAAA,CAA2B,CAAC,CAAA,CAElC,GAAA,CAAA,IAAWZ,EAAAA,GAAQS,CAAAA,CAAO,CACxB,IAAMI,CAAAA,CAAeb,CAAAA,CAAK,KAAA,CAAM,WAAA,CAAY,CAAA,CAAE,QAAA,CAASW,CAAI,CAAA,CAE3D,EAAA,CAAIX,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,CAAS,CAAA,CAAG,CAC7C,IAAMc,CAAAA,CAAmBN,CAAAA,CAAWR,CAAAA,CAAK,QAAA,CAAUU,CAAU,CAAA,CAEzDG,CAAAA,CACFD,CAAAA,CAAO,IAAA,CAAKZ,CAAI,CAAA,CACPc,CAAAA,EAAoBA,CAAAA,CAAiB,MAAA,CAAS,CAAA,EACvDF,CAAAA,CAAO,IAAA,CAAK,CAAE,GAAGZ,CAAAA,CAAM,QAAA,CAAUc,CAAiB,CAAC,CAEvD,CAAA,KAAWD,CAAAA,EACTD,CAAAA,CAAO,IAAA,CAAKZ,CAAI,CAEpB,CAEA,OAAOY,CAAAA,CAAO,MAAA,CAAS,CAAA,CAAIA,CAAAA,CAAS,IACtC,CAEA,SAASG,EAAAA,CACPN,CAAAA,CACAC,CAAAA,CACa,CACb,IAAMC,CAAAA,CAAOD,CAAAA,CAAW,WAAA,CAAY,CAAA,CAAE,IAAA,CAAK,CAAA,CACrCE,CAAAA,CAAS,IAAI,GAAA,CAEnB,SAASI,CAAAA,CAAKC,CAAAA,CAAqC,CACjD,IAAIC,CAAAA,CAAW,CAAA,CAAA,CACf,GAAA,CAAA,IAAWlB,EAAAA,GAAQiB,CAAAA,CAAU,CAC3B,IAAMJ,CAAAA,CAAeb,CAAAA,CAAK,KAAA,CAAM,WAAA,CAAY,CAAA,CAAE,QAAA,CAASW,CAAI,CAAA,CACvDQ,CAAAA,CAAgB,CAAA,CAAA,CAEhBnB,CAAAA,CAAK,QAAA,EAAA,CACPmB,CAAAA,CAAgBH,CAAAA,CAAKhB,CAAAA,CAAK,QAAQ,CAAA,CAAA,CAAA,CAGhCa,CAAAA,EAAgBM,CAAAA,CAAAA,EAAAA,CAClBP,CAAAA,CAAO,GAAA,CAAIZ,CAAAA,CAAK,KAAK,CAAA,CACrBkB,CAAAA,CAAW,CAAA,CAAA,CAEf,CACA,OAAOA,CACT,CAEA,OAAAF,CAAAA,CAAKP,CAAK,CAAA,CACHG,CACT,CAEA,SAASQ,CAAAA,CACPX,CAAAA,CACAY,CAAAA,CAC4B,CAC5B,GAAA,CAAA,IAAWrB,EAAAA,GAAQS,CAAAA,CAAO,CACxB,EAAA,CAAIT,CAAAA,CAAK,KAAA,GAAUqB,CAAAA,CAAO,OAAOrB,CAAAA,CACjC,EAAA,CAAIA,CAAAA,CAAK,QAAA,CAAU,CACjB,IAAMsB,CAAAA,CAAQF,CAAAA,CAAgBpB,CAAAA,CAAK,QAAA,CAAUqB,CAAK,CAAA,CAClD,EAAA,CAAIC,CAAAA,CAAO,OAAOA,CACpB,CACF,CAEF,CAEA,SAASC,CAAAA,CAAuBd,CAAAA,CAAsC,CACpE,IAAMG,CAAAA,CAAS,IAAI,GAAA,CACnB,GAAA,CAAA,IAAWZ,EAAAA,GAAQS,CAAAA,CACjB,EAAA,CAAIT,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,CAAS,CAAA,CAAG,CAC7CY,CAAAA,CAAO,GAAA,CAAIZ,CAAAA,CAAK,KAAK,CAAA,CACrB,GAAA,CAAA,IAAWO,EAAAA,GAAKgB,CAAAA,CAAuBvB,CAAAA,CAAK,QAAQ,CAAA,CAClDY,CAAAA,CAAO,GAAA,CAAIL,CAAC,CAEhB,CAEF,OAAOK,CACT,CAEA,SAASY,EAAAA,CACPC,CAAAA,CACAf,CAAAA,CACiB,CACjB,EAAA,CAAI,CAACA,CAAAA,CAAY,OAAOe,CAAAA,CAExB,IAAMd,CAAAA,CAAOD,CAAAA,CAAW,WAAA,CAAY,CAAA,CAAE,IAAA,CAAK,CAAA,CAC3C,EAAA,CAAI,CAACC,CAAAA,CAAM,OAAOc,CAAAA,CAElB,IAAMC,CAAAA,CAAQD,CAAAA,CAAM,WAAA,CAAY,CAAA,CAAE,OAAA,CAAQd,CAAI,CAAA,CAC9C,OAAIe,CAAAA,GAAU,CAAA,CAAA,CAAWD,CAAAA,CAGvBE,8BAAAA,oBAAAC,CAAA,CACG,QAAA,CAAA,CAAAH,CAAAA,CAAM,KAAA,CAAM,CAAA,CAAGC,CAAK,CAAA,CACrBG,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAU,yBAAA,CACb,QAAA,CAAAJ,CAAAA,CAAM,KAAA,CAAMC,CAAAA,CAAOA,CAAAA,CAAQf,CAAAA,CAAK,MAAM,CAAA,CACzC,CAAA,CACCc,CAAAA,CAAM,KAAA,CAAMC,CAAAA,CAAQf,CAAAA,CAAK,MAAM,CAAA,CAAA,CAClC,CAEJ,CAiBA,SAASmB,CAAAA,CAAa,CACpB,IAAA,CAAA9B,CAAAA,CACA,KAAA,CAAA+B,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,WAAA,CAAA5B,CAAAA,CACA,cAAA,CAAA6B,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,UAAA,CAAA3B,CACF,CAAA,CAAsB,CACpB,IAAM4B,CAAAA,CAActC,CAAAA,CAAK,QAAA,EAAYA,CAAAA,CAAK,QAAA,CAAS,MAAA,CAAS,CAAA,CACtDuC,CAAAA,CAAaN,CAAAA,CAAe,GAAA,CAAIjC,CAAAA,CAAK,KAAK,CAAA,CAC1CwC,CAAAA,CAAaR,CAAAA,CACf7B,CAAAA,CAAcH,CAAAA,CAAMI,CAAW,CAAA,CAC/BA,CAAAA,CAAY,GAAA,CAAIJ,CAAAA,CAAK,KAAK,CAAA,CACxB,SAAA,CACA,WAAA,CAEAyC,CAAAA,CAAWV,CAAAA,CAAQ,EAAA,CAEzB,OACEJ,8BAAAA,KAAC,CAAA,CACC,IAAA,CAAK,UAAA,CACL,eAAA,CAAeW,CAAAA,CAAcC,CAAAA,CAAa,KAAA,CAAA,CAC1C,eAAA,CAAeC,CAAAA,GAAe,SAAA,CAE9B,QAAA,CAAA,CAAAb,8BAAAA,KAAC,CAAA,CACC,SAAA,CAAWe,gCAAAA,kIACT,CACA,gBAAA,CACAF,CAAAA,GAAe,SAAA,EAAa,CAACR,CAAAA,EAAY,UAG3C,CAAA,CACA,KAAA,CAAO,CAAE,WAAA,CAAa,CAAA,EAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-YE7OOLWB.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, ChevronRight, Search, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Checkbox } from \"@/components/checkbox\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\n// --- Public types ---\n\nexport interface TreeSelectNode {\n value: string\n label: string\n children?: TreeSelectNode[]\n}\n\nexport interface TreeSelectProps {\n nodes: TreeSelectNode[]\n value?: string\n onValueChange?: (value: string) => void\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n defaultExpandedValues?: string[]\n expandAll?: boolean\n}\n\n// --- Internal types ---\n\ntype CheckState = \"checked\" | \"indeterminate\" | \"unchecked\"\n\n// --- Utility functions ---\n\nfunction getAllDescendantValues(node: TreeSelectNode): string[] {\n const values: string[] = [node.value]\n if (node.children) {\n for (const child of node.children) {\n values.push(...getAllDescendantValues(child))\n }\n }\n return values\n}\n\nfunction getCheckState(\n node: TreeSelectNode,\n selectedSet: Set<string>\n): CheckState {\n if (!node.children || node.children.length === 0) {\n return selectedSet.has(node.value) ? \"checked\" : \"unchecked\"\n }\n\n const descendants = getAllDescendantValues(node)\n const selectedCount = descendants.filter((v) => selectedSet.has(v)).length\n\n if (selectedCount === 0) return \"unchecked\"\n if (selectedCount === descendants.length) return \"checked\"\n return \"indeterminate\"\n}\n\nfunction filterTree(\n nodes: TreeSelectNode[],\n searchTerm: string\n): TreeSelectNode[] | null {\n const term = searchTerm.toLowerCase().trim()\n if (!term) return nodes\n\n const result: TreeSelectNode[] = []\n\n for (const node of nodes) {\n const labelMatches = node.label.toLowerCase().includes(term)\n\n if (node.children && node.children.length > 0) {\n const filteredChildren = filterTree(node.children, searchTerm)\n\n if (labelMatches) {\n result.push(node)\n } else if (filteredChildren && filteredChildren.length > 0) {\n result.push({ ...node, children: filteredChildren })\n }\n } else if (labelMatches) {\n result.push(node)\n }\n }\n\n return result.length > 0 ? result : null\n}\n\nfunction getValuesOfMatchingNodes(\n nodes: TreeSelectNode[],\n searchTerm: string\n): Set<string> {\n const term = searchTerm.toLowerCase().trim()\n const result = new Set<string>()\n\n function walk(nodeList: TreeSelectNode[]): boolean {\n let hasMatch = false\n for (const node of nodeList) {\n const labelMatches = node.label.toLowerCase().includes(term)\n let childHasMatch = false\n\n if (node.children) {\n childHasMatch = walk(node.children)\n }\n\n if (labelMatches || childHasMatch) {\n result.add(node.value)\n hasMatch = true\n }\n }\n return hasMatch\n }\n\n walk(nodes)\n return result\n}\n\nfunction findNodeByValue(\n nodes: TreeSelectNode[],\n value: string\n): TreeSelectNode | undefined {\n for (const node of nodes) {\n if (node.value === value) return node\n if (node.children) {\n const found = findNodeByValue(node.children, value)\n if (found) return found\n }\n }\n return undefined\n}\n\nfunction collectAllBranchValues(nodes: TreeSelectNode[]): Set<string> {\n const result = new Set<string>()\n for (const node of nodes) {\n if (node.children && node.children.length > 0) {\n result.add(node.value)\n for (const v of collectAllBranchValues(node.children)) {\n result.add(v)\n }\n }\n }\n return result\n}\n\nfunction renderHighlightedLabel(\n label: string,\n searchTerm: string\n): React.ReactNode {\n if (!searchTerm) return label\n\n const term = searchTerm.toLowerCase().trim()\n if (!term) return label\n\n const index = label.toLowerCase().indexOf(term)\n if (index === -1) return label\n\n return (\n <>\n {label.slice(0, index)}\n <span className=\"font-semibold underline\">\n {label.slice(index, index + term.length)}\n </span>\n {label.slice(index + term.length)}\n </>\n )\n}\n\n// --- TreeNodeItem (internal) ---\n\ninterface TreeNodeItemProps {\n node: TreeSelectNode\n depth: number\n multiple: boolean\n selectedSet: Set<string>\n expandedValues: Set<string>\n focusedValue: string | null\n onToggleExpand: (value: string) => void\n onSelect: (node: TreeSelectNode) => void\n onFocus: (value: string) => void\n searchTerm: string\n}\n\nfunction TreeNodeItem({\n node,\n depth,\n multiple,\n selectedSet,\n expandedValues,\n focusedValue,\n onToggleExpand,\n onSelect,\n onFocus,\n searchTerm,\n}: TreeNodeItemProps) {\n const hasChildren = node.children && node.children.length > 0\n const isExpanded = expandedValues.has(node.value)\n const checkState = multiple\n ? getCheckState(node, selectedSet)\n : selectedSet.has(node.value)\n ? \"checked\"\n : \"unchecked\"\n\n const indentPx = depth * 20\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-selected={checkState === \"checked\"}\n >\n <div\n className={cn(\n \"relative flex items-center gap-2 rounded-sm px-2 py-1.5 my-0.5 text-sm cursor-pointer select-none outline-none active:opacity-50\",\n \"hover:bg-muted\",\n checkState === \"checked\" && !multiple && \"bg-muted\"\n // This adds a focus ring when the node is focused, but it's not needed for the tree-select component.\n // focusedValue === node.value && \"z-10 ring-2 ring-ring\"\n )}\n style={{ paddingLeft: `${8 + indentPx}px` }}\n onClick={() => onSelect(node)}\n onFocus={() => onFocus(node.value)}\n data-tree-value={node.value}\n tabIndex={focusedValue === node.value ? 0 : -1}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n className=\"h-4 w-4 shrink-0 flex items-center justify-center rounded-sm hover:bg-secondary active:opacity-50\"\n onClick={(e) => {\n e.stopPropagation()\n onToggleExpand(node.value)\n }}\n aria-label={\n isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`\n }\n tabIndex={-1}\n >\n {isExpanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </button>\n ) : (\n <span className=\"h-4 w-4 shrink-0\" />\n )}\n\n {multiple ? (\n <Checkbox\n checked={\n checkState === \"checked\"\n ? true\n : checkState === \"indeterminate\"\n ? \"indeterminate\"\n : false\n }\n onCheckedChange={() => onSelect(node)}\n onClick={(e) => e.stopPropagation()}\n className=\"shrink-0\"\n aria-label={node.label}\n />\n ) : (\n <Check\n className={cn(\n \"h-4 w-4 shrink-0\",\n checkState === \"checked\" ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n )}\n\n <span className=\"truncate\">\n {renderHighlightedLabel(node.label, searchTerm)}\n </span>\n </div>\n\n {hasChildren && isExpanded && (\n <div role=\"group\">\n {node.children!.map((child) => (\n <TreeNodeItem\n key={child.value}\n node={child}\n depth={depth + 1}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={onToggleExpand}\n onSelect={onSelect}\n onFocus={onFocus}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n\n// --- TreeSelect (main component) ---\n\nexport function TreeSelect({\n nodes,\n value,\n onValueChange,\n multiple = false,\n values = [],\n onValuesChange,\n placeholder = \"Select...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No results found.\",\n disabled = false,\n className,\n error = false,\n defaultExpandedValues,\n expandAll = false,\n}: TreeSelectProps) {\n const [open, setOpen] = React.useState(false)\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null)\n const [expandedValues, setExpandedValues] = React.useState<Set<string>>(\n () => {\n if (expandAll) return collectAllBranchValues(nodes)\n if (defaultExpandedValues) return new Set(defaultExpandedValues)\n return new Set<string>()\n }\n )\n\n const preSearchExpandedRef = React.useRef<Set<string> | null>(null)\n const treeRef = React.useRef<HTMLDivElement>(null)\n\n const selectedSet = React.useMemo(\n () => new Set(multiple ? values : value ? [value] : []),\n [multiple, values, value]\n )\n\n const filteredNodes = React.useMemo(\n () => (searchTerm ? filterTree(nodes, searchTerm) : nodes),\n [nodes, searchTerm]\n )\n\n // Auto-expand matching ancestors during search\n React.useEffect(() => {\n if (searchTerm) {\n if (!preSearchExpandedRef.current) {\n preSearchExpandedRef.current = new Set(expandedValues)\n }\n const matchingAncestors = getValuesOfMatchingNodes(nodes, searchTerm)\n setExpandedValues(matchingAncestors)\n } else if (preSearchExpandedRef.current) {\n setExpandedValues(preSearchExpandedRef.current)\n preSearchExpandedRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchTerm, nodes])\n\n const handleOpenChange = React.useCallback((isOpen: boolean) => {\n setOpen(isOpen)\n if (!isOpen) {\n setSearchTerm(\"\")\n setFocusedValue(null)\n }\n }, [])\n\n const handleToggleExpand = React.useCallback((nodeValue: string) => {\n setExpandedValues((prev) => {\n const next = new Set(prev)\n if (next.has(nodeValue)) {\n next.delete(nodeValue)\n } else {\n next.add(nodeValue)\n }\n return next\n })\n }, [])\n\n const handleSelect = React.useCallback(\n (node: TreeSelectNode) => {\n if (multiple) {\n const allDescendants = getAllDescendantValues(node)\n const currentState = getCheckState(node, selectedSet)\n\n let newValues: string[]\n if (currentState === \"checked\") {\n const toRemove = new Set(allDescendants)\n newValues = values.filter((v) => !toRemove.has(v))\n } else {\n const toAdd = allDescendants.filter((v) => !selectedSet.has(v))\n newValues = [...values, ...toAdd]\n }\n onValuesChange?.(newValues)\n } else {\n // Single-select: clicking a parent toggles expand instead of selecting\n const hasChildren = node.children && node.children.length > 0\n if (hasChildren) {\n handleToggleExpand(node.value)\n return\n }\n const newValue = node.value === value ? \"\" : node.value\n onValueChange?.(newValue)\n setOpen(false)\n }\n },\n [\n multiple,\n values,\n value,\n selectedSet,\n onValuesChange,\n onValueChange,\n handleToggleExpand,\n ]\n )\n\n const handleRemoveChip = React.useCallback(\n (chipValue: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const node = findNodeByValue(nodes, chipValue)\n if (node) {\n const toRemove = new Set(getAllDescendantValues(node))\n const newValues = values.filter((v) => !toRemove.has(v))\n onValuesChange?.(newValues)\n }\n },\n [nodes, values, onValuesChange]\n )\n\n // Smart chips: minimal set representing the selection\n const chipValues = React.useMemo(() => {\n if (!multiple) return []\n\n const chips: string[] = []\n\n function walk(nodeList: TreeSelectNode[]) {\n for (const node of nodeList) {\n const state = getCheckState(node, selectedSet)\n if (state === \"checked\") {\n chips.push(node.value)\n } else if (state === \"indeterminate\" && node.children) {\n walk(node.children)\n }\n }\n }\n\n walk(nodes)\n return chips\n }, [nodes, selectedSet, multiple])\n\n // Keyboard navigation\n const getVisibleNodes = React.useCallback((): HTMLElement[] => {\n if (!treeRef.current) return []\n return Array.from(treeRef.current.querySelectorAll(\"[data-tree-value]\"))\n }, [])\n\n const handleTreeKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n const visibleNodes = getVisibleNodes()\n const currentIndex = visibleNodes.findIndex(\n (el) => el.dataset.treeValue === focusedValue\n )\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault()\n const nextIndex = Math.min(currentIndex + 1, visibleNodes.length - 1)\n const nextValue = visibleNodes[nextIndex]?.dataset.treeValue\n if (nextValue) {\n setFocusedValue(nextValue)\n visibleNodes[nextIndex]?.focus()\n }\n break\n }\n case \"ArrowUp\": {\n e.preventDefault()\n const prevIndex = Math.max(currentIndex - 1, 0)\n const prevValue = visibleNodes[prevIndex]?.dataset.treeValue\n if (prevValue) {\n setFocusedValue(prevValue)\n visibleNodes[prevIndex]?.focus()\n }\n break\n }\n case \"ArrowRight\": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node?.children?.length) {\n if (!expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n } else {\n const firstChildValue = node.children[0].value\n setFocusedValue(firstChildValue)\n requestAnimationFrame(() => {\n const els = getVisibleNodes()\n const el = els.find(\n (n) => n.dataset.treeValue === firstChildValue\n )\n el?.focus()\n })\n }\n }\n }\n break\n }\n case \"ArrowLeft\": {\n e.preventDefault()\n if (focusedValue && expandedValues.has(focusedValue)) {\n handleToggleExpand(focusedValue)\n }\n break\n }\n case \"Enter\":\n case \" \": {\n e.preventDefault()\n if (focusedValue) {\n const node = findNodeByValue(nodes, focusedValue)\n if (node) handleSelect(node)\n }\n break\n }\n case \"Home\": {\n e.preventDefault()\n const firstValue = visibleNodes[0]?.dataset.treeValue\n if (firstValue) {\n setFocusedValue(firstValue)\n visibleNodes[0]?.focus()\n }\n break\n }\n case \"End\": {\n e.preventDefault()\n const lastValue =\n visibleNodes[visibleNodes.length - 1]?.dataset.treeValue\n if (lastValue) {\n setFocusedValue(lastValue)\n visibleNodes[visibleNodes.length - 1]?.focus()\n }\n break\n }\n }\n },\n [\n focusedValue,\n nodes,\n expandedValues,\n getVisibleNodes,\n handleToggleExpand,\n handleSelect,\n ]\n )\n\n const getDisplayText = () => {\n if (multiple) {\n if (values.length === 0) return placeholder\n if (values.length === 1) {\n const node = findNodeByValue(nodes, values[0])\n return node?.label ?? values[0]\n }\n return `${values.length} selected`\n }\n if (value) {\n const node = findNodeByValue(nodes, value)\n return node?.label ?? value\n }\n return placeholder\n }\n\n const renderSelectedChips = () => {\n if (!multiple || chipValues.length === 0) return null\n\n const chipNodes = chipValues\n .map((v) => findNodeByValue(nodes, v))\n .filter(Boolean) as TreeSelectNode[]\n\n return (\n <div className=\"max-h-[100px] overflow-y-auto px-2 py-1.5 border-b border-border\">\n <div className=\"flex flex-wrap gap-1\">\n {chipNodes.map((node) => (\n <div\n key={node.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 max-w-[120px]\">{node.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer shrink-0\"\n onClick={(e) => handleRemoveChip(node.value, e)}\n aria-label={`Remove ${node.label}`}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"tree\"\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-8 lg: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 active:opacity-50 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=\"p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div className=\"flex items-center border-b px-3\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <input\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n placeholder={searchPlaceholder}\n className=\"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 aria-label=\"Search tree\"\n />\n </div>\n\n {renderSelectedChips()}\n\n <div className=\"max-h-[300px] overflow-y-auto\">\n {filteredNodes && filteredNodes.length > 0 ? (\n <div\n ref={treeRef}\n role=\"tree\"\n aria-label=\"Options\"\n className=\"p-1\"\n onKeyDown={handleTreeKeyDown}\n >\n {filteredNodes.map((node) => (\n <TreeNodeItem\n key={node.value}\n node={node}\n depth={0}\n multiple={multiple}\n selectedSet={selectedSet}\n expandedValues={expandedValues}\n focusedValue={focusedValue}\n onToggleExpand={handleToggleExpand}\n onSelect={handleSelect}\n onFocus={setFocusedValue}\n searchTerm={searchTerm}\n />\n ))}\n </div>\n ) : (\n <div className=\"py-6 text-center text-sm text-muted-foreground\">\n {emptyMessage}\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as Y,b as J,c as Q,d as Z}from"./chunk-QC5MA4WL.mjs";import{a as j}from"./chunk-YBV4CPVD.mjs";import{a as $,f as W,g as U,i as q,j as X}from"./chunk-QVMQ55JW.mjs";import{a as _}from"./chunk-CNRZOMR4.mjs";import{a as K}from"./chunk-NEOUFWZN.mjs";import{a as z,b as D}from"./chunk-BLHKJHNV.mjs";import{a as o}from"./chunk-S5TKCF6T.mjs";import*as e from"react";import{Slot as w}from"@radix-ui/react-slot";import{cva as ie}from"class-variance-authority";import{PanelLeft as se,X as de,Menu as le}from"lucide-react";import{Fragment as k,jsx as r,jsxs as u}from"react/jsx-runtime";var ce="sidebar_state",pe=3600*24*7,be="16.75rem",ee="23rem",ue="calc(3rem + 0.75rem)",fe="b",me="55px",ae=e.createContext(null),te=e.createContext(!1);function y(){let a=e.useContext(ae);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}var ge=e.forwardRef(({defaultOpen:a=!0,open:t,onOpenChange:n,bannerHeight:i=me,className:s,style:c,children:p,...d},R)=>{let[v,b]=e.useState(!1),[g,C]=e.useState(a),[x,S]=e.useState(!1),[m,N]=e.useState(!1),[M,h]=e.useState(a),I=t??M,E=e.useCallback(l=>{let f=typeof l=="function"?l(I):l;n?n(f):h(f),document.cookie=`${ce}=${f}; path=/; max-age=${pe}`},[n,I]),T=e.useCallback(()=>{E(l=>!l)},[E]),A=e.useCallback(()=>{let l=getComputedStyle(document.documentElement).getPropertyValue("--breakpoint-md").trim();l&&window.matchMedia(`(min-width: ${l})`).matches||b(f=>!f)},[b]);e.useEffect(()=>{let l=f=>{f.key===fe&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),T())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[T]);let O=I?"expanded":"collapsed",L=e.useRef([]),V=e.Children.toArray(p),B=V.filter(l=>e.isValidElement(l)&&l.type?.displayName==="SidebarBanner"),ne=V.filter(l=>!e.isValidElement(l)||l.type?.displayName!=="SidebarBanner");B.length>0&&m&&(L.current=B);let G=B.length>0,P=G&&m,H=!P&&L.current.length>0,F=G,oe=e.useMemo(()=>({state:O,isOpen:g,setOpen:E,openMobile:v,setOpenMobile:b,toggleSidebar:T,toggleMobileSidebar:A,setIsFullyOpen:C,isAnimating:x,setIsAnimating:S,isBannerClosing:H,bannerVisible:m,setBannerVisible:N}),[O,g,E,v,b,T,A,C,x,S,H,m]);return r(ae.Provider,{value:oe,children:r(Y,{delayDuration:0,children:r("div",{style:{"--sidebar-width":be,"--sidebar-width-icon":ue,"--sidebar-top":P?i:"0px",...c},className:o("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",F&&"flex-col",s),ref:R,...d,children:F?u(k,{children:[r("div",{className:"relative overflow-hidden transition-[height] duration-200 ease-linear",style:{height:P?i:"0px"},children:r("div",{className:"fixed top-0 left-0 right-0 z-20 w-full transition-transform duration-200 ease-linear data-[state=closed]:-translate-y-full",style:{height:i},"data-state":P?"open":"closed",onTransitionEnd:()=>{H&&(L.current=[])},children:B})}),r("div",{className:"flex flex-1",children:ne})]}):p})})})});ge.displayName="SidebarProvider";var ve=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"banner",className:o("w-full",a),...t}));ve.displayName="SidebarBanner";var he=e.forwardRef(({side:a="left",variant:t="sidebar",collapsible:n="offcanvas",className:i,children:s,...c},p)=>{let{state:d,openMobile:R,setOpenMobile:v,setIsFullyOpen:b,setIsAnimating:g,isBannerClosing:C}=y(),x=e.useRef(null),S=e.useRef(!0);return e.useEffect(()=>{let m=x.current;if(!m)return;if(S.current){S.current=!1,b(d==="expanded"),g(!1);return}g(!0);let N=setTimeout(()=>{b(d==="expanded"),g(!1)},300),M=h=>{h.target===m&&(h.propertyName==="left"||h.propertyName==="right"||h.propertyName==="width")&&(clearTimeout(N),b(d==="expanded"),g(!1))};return m.addEventListener("transitionend",M),()=>{m.removeEventListener("transitionend",M),clearTimeout(N)}},[d,b,g]),n==="none"?r("aside",{className:o("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),ref:p,...c,children:s}):u(k,{children:[r($,{open:R,onOpenChange:v,children:u(W,{"data-sidebar":"sidebar","data-mobile":"true",className:"md:hidden bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{width:ee,maxWidth:ee},side:a,children:[u(U,{className:"sr-only",children:[r(q,{children:"Sidebar"}),r(X,{children:"Displays the mobile sidebar."})]}),r(te.Provider,{value:!0,children:r("div",{className:"flex h-full w-full flex-col",children:s})})]})}),u("aside",{ref:p,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":a,children:[r("div",{className:o("w-(--sidebar-width) transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),r("div",{ref:x,"data-banner-closing":C,className:o("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width,top,height] duration-200 ease-linear md:flex","top-(--sidebar-top) h-[calc(100svh-var(--sidebar-top))]",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)",i),...c,children:r("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r("div",{className:"flex flex-col my-2.5 ml-2.5 rounded-2xl border bg-sidebar border-sidebar-border flex-1 min-h-0",children:s})})})]})]})});he.displayName="Sidebar";var re=e.forwardRef(({className:a,onClick:t,...n},i)=>{let{toggleSidebar:s,toggleMobileSidebar:c,openMobile:p}=y();return u(k,{children:[u(D,{"data-sidebar":"trigger",variant:"ghost",size:"icon",className:o("md:hidden bg-transparent hover:bg-transparent",a),onClick:d=>{t?.(d),c()},...n,children:[p?r("span",{className:o(z({variant:"secondary",size:"icon"})),children:r(de,{size:16})}):r("span",{className:o(z({variant:"outline",size:"icon"})),children:r(le,{size:16})}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]}),u(D,{ref:i,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:o("hidden md:inline-flex h-7 w-7",a),onClick:d=>{t?.(d),s()},...n,children:[r("span",{className:"rounded-full p-2",children:r(se,{size:16})}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})});re.displayName="SidebarTrigger";var Re=e.forwardRef(({className:a,...t},n)=>{let{toggleSidebar:i}=y();return r("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:o("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...t})});Re.displayName="SidebarRail";var xe=e.memo(e.forwardRef(({className:a,...t},n)=>r("main",{ref:n,className:o("relative flex min-w-0 w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",a),...t})));xe.displayName="SidebarInset";var Se=e.forwardRef(({className:a,...t},n)=>r(K,{ref:n,"data-sidebar":"input",className:o("h-8 w-full bg-sidebar shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",a),...t}));Se.displayName="SidebarInput";var we=e.forwardRef(({className:a,showTrigger:t=!1,children:n,...i},s)=>{let{state:c}=y(),p=e.useContext(te),d=c==="collapsed"&&!p;return u("div",{ref:s,"data-sidebar":"header",className:o("flex w-full gap-2 p-2 items-center",d?"justify-center items-center":"justify-between items-start",a),...i,children:[!d&&r("div",{className:"transition-all duration-200 w-full h-fit flex justify-between overflow-hidden",children:r("div",{className:"whitespace-nowrap",children:n})}),t&&r(re,{})]})});we.displayName="SidebarHeader";var ye=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"footer",className:o("flex flex-col gap-2 p-2",a),...t}));ye.displayName="SidebarFooter";var Ce=e.forwardRef(({className:a,...t},n)=>r(j,{ref:n,"data-sidebar":"separator",className:o("mx-2 w-auto bg-border",a),...t}));Ce.displayName="SidebarSeparator";var Ne=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"content",className:o("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden p-2",a),...t}));Ne.displayName="SidebarContent";var Me=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"group",className:o("relative flex w-full min-w-0 flex-col","group-data-[collapsible=icon]:p-0",a),...t}));Me.displayName="SidebarGroup";var Ee=e.forwardRef(({className:a,asChild:t=!1,...n},i)=>r(t?w:"div",{ref:i,"data-sidebar":"group-label",className:o("flex h-8 shrink-0 items-center rounded-md text-xs font-medium text-secondary-text outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...n}));Ee.displayName="SidebarGroupLabel";var Te=e.forwardRef(({className:a,asChild:t=!1,...n},i)=>r(t?w:"button",{ref:i,"data-sidebar":"group-action",className:o("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",a),...n}));Te.displayName="SidebarGroupAction";var Be=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"group-content",className:o("w-full text-sm",a),...t}));Be.displayName="SidebarGroupContent";var Pe=e.forwardRef(({className:a,...t},n)=>r("ul",{ref:n,"data-sidebar":"menu",className:o("flex w-full min-w-0 flex-col gap-1",a),...t}));Pe.displayName="SidebarMenu";var Ie=e.forwardRef(({className:a,...t},n)=>r("li",{ref:n,"data-sidebar":"menu-item",className:o("group/menu-item relative",a),...t}));Ie.displayName="SidebarMenuItem";var Le=ie("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"",outline:"bg-sidebar shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),He=e.forwardRef(({asChild:a=!1,isActive:t=!1,variant:n="default",size:i="default",tooltip:s,className:c,...p},d)=>{let R=a?w:"button",{state:v}=y(),b=r(R,{ref:d,"data-sidebar":"menu-button","data-size":i,"data-active":t,className:o(Le({variant:n,size:i}),c),...p});return s?(typeof s=="string"&&(s={children:s}),u(J,{children:[r(Q,{asChild:!0,children:b}),r(Z,{side:"right",align:"center",hidden:v!=="collapsed",...s})]})):b});He.displayName="SidebarMenuButton";var ze=e.forwardRef(({className:a,asChild:t=!1,showOnHover:n=!1,...i},s)=>r(t?w:"button",{ref:s,"data-sidebar":"menu-action",className:o("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-base-accent-foreground md:opacity-0",a),...i}));ze.displayName="SidebarMenuAction";var De=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"menu-badge",className:o("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...t}));De.displayName="SidebarMenuBadge";var _e=e.forwardRef(({className:a,showIcon:t=!1,...n},i)=>{let s=e.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return u("div",{ref:i,"data-sidebar":"menu-skeleton",className:o("flex h-8 items-center gap-2 rounded-md px-2",a),...n,children:[t&&r(_,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),r(_,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});_e.displayName="SidebarMenuSkeleton";var ke=e.forwardRef(({className:a,...t},n)=>r("ul",{ref:n,"data-sidebar":"menu-sub",className:o("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...t}));ke.displayName="SidebarMenuSub";var Ae=e.forwardRef(({...a},t)=>r("li",{ref:t,...a}));Ae.displayName="SidebarMenuSubItem";var Oe=e.forwardRef(({asChild:a=!1,size:t="md",isActive:n,className:i,...s},c)=>r(a?w:"a",{ref:c,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:o("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...s}));Oe.displayName="SidebarMenuSubButton";export{y as a,ge as b,ve as c,he as d,re as e,Re as f,xe as g,Se as h,we as i,ye as j,Ce as k,Ne as l,Me as m,Ee as n,Te as o,Be as p,Pe as q,Ie as r,He as s,ze as t,De as u,_e as v,ke as w,Ae as x,Oe as y};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as Y,b as J,c as Q,d as Z}from"./chunk-QC5MA4WL.mjs";import{a as j}from"./chunk-YBV4CPVD.mjs";import{a as $,f as W,g as U,i as q,j as X}from"./chunk-QVMQ55JW.mjs";import{a as _}from"./chunk-CNRZOMR4.mjs";import{a as K}from"./chunk-YSIF7HA3.mjs";import{a as z,b as D}from"./chunk-QZKQORLQ.mjs";import{a as o}from"./chunk-S5TKCF6T.mjs";import*as e from"react";import{Slot as w}from"@radix-ui/react-slot";import{cva as ie}from"class-variance-authority";import{PanelLeft as se,X as de,Menu as le}from"lucide-react";import{Fragment as k,jsx as r,jsxs as u}from"react/jsx-runtime";var ce="sidebar_state",pe=3600*24*7,be="16.75rem",ee="23rem",ue="calc(3rem + 0.75rem)",fe="b",me="55px",ae=e.createContext(null),te=e.createContext(!1);function y(){let a=e.useContext(ae);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}var ge=e.forwardRef(({defaultOpen:a=!0,open:t,onOpenChange:n,bannerHeight:i=me,className:s,style:c,children:p,...d},R)=>{let[v,b]=e.useState(!1),[g,C]=e.useState(a),[x,S]=e.useState(!1),[m,N]=e.useState(!1),[M,h]=e.useState(a),I=t??M,E=e.useCallback(l=>{let f=typeof l=="function"?l(I):l;n?n(f):h(f),document.cookie=`${ce}=${f}; path=/; max-age=${pe}`},[n,I]),T=e.useCallback(()=>{E(l=>!l)},[E]),A=e.useCallback(()=>{let l=getComputedStyle(document.documentElement).getPropertyValue("--breakpoint-md").trim();l&&window.matchMedia(`(min-width: ${l})`).matches||b(f=>!f)},[b]);e.useEffect(()=>{let l=f=>{f.key===fe&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),T())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[T]);let O=I?"expanded":"collapsed",L=e.useRef([]),V=e.Children.toArray(p),B=V.filter(l=>e.isValidElement(l)&&l.type?.displayName==="SidebarBanner"),ne=V.filter(l=>!e.isValidElement(l)||l.type?.displayName!=="SidebarBanner");B.length>0&&m&&(L.current=B);let G=B.length>0,P=G&&m,H=!P&&L.current.length>0,F=G,oe=e.useMemo(()=>({state:O,isOpen:g,setOpen:E,openMobile:v,setOpenMobile:b,toggleSidebar:T,toggleMobileSidebar:A,setIsFullyOpen:C,isAnimating:x,setIsAnimating:S,isBannerClosing:H,bannerVisible:m,setBannerVisible:N}),[O,g,E,v,b,T,A,C,x,S,H,m]);return r(ae.Provider,{value:oe,children:r(Y,{delayDuration:0,children:r("div",{style:{"--sidebar-width":be,"--sidebar-width-icon":ue,"--sidebar-top":P?i:"0px",...c},className:o("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",F&&"flex-col",s),ref:R,...d,children:F?u(k,{children:[r("div",{className:"relative overflow-hidden transition-[height] duration-200 ease-linear",style:{height:P?i:"0px"},children:r("div",{className:"fixed top-0 left-0 right-0 z-20 w-full transition-transform duration-200 ease-linear data-[state=closed]:-translate-y-full",style:{height:i},"data-state":P?"open":"closed",onTransitionEnd:()=>{H&&(L.current=[])},children:B})}),r("div",{className:"flex flex-1",children:ne})]}):p})})})});ge.displayName="SidebarProvider";var ve=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"banner",className:o("w-full",a),...t}));ve.displayName="SidebarBanner";var he=e.forwardRef(({side:a="left",variant:t="sidebar",collapsible:n="offcanvas",className:i,children:s,...c},p)=>{let{state:d,openMobile:R,setOpenMobile:v,setIsFullyOpen:b,setIsAnimating:g,isBannerClosing:C}=y(),x=e.useRef(null),S=e.useRef(!0);return e.useEffect(()=>{let m=x.current;if(!m)return;if(S.current){S.current=!1,b(d==="expanded"),g(!1);return}g(!0);let N=setTimeout(()=>{b(d==="expanded"),g(!1)},300),M=h=>{h.target===m&&(h.propertyName==="left"||h.propertyName==="right"||h.propertyName==="width")&&(clearTimeout(N),b(d==="expanded"),g(!1))};return m.addEventListener("transitionend",M),()=>{m.removeEventListener("transitionend",M),clearTimeout(N)}},[d,b,g]),n==="none"?r("aside",{className:o("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),ref:p,...c,children:s}):u(k,{children:[r($,{open:R,onOpenChange:v,children:u(W,{"data-sidebar":"sidebar","data-mobile":"true",className:"md:hidden bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{width:ee,maxWidth:ee},side:a,children:[u(U,{className:"sr-only",children:[r(q,{children:"Sidebar"}),r(X,{children:"Displays the mobile sidebar."})]}),r(te.Provider,{value:!0,children:r("div",{className:"flex h-full w-full flex-col",children:s})})]})}),u("aside",{ref:p,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":a,children:[r("div",{className:o("w-(--sidebar-width) transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),r("div",{ref:x,"data-banner-closing":C,className:o("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width,top,height] duration-200 ease-linear md:flex","top-(--sidebar-top) h-[calc(100svh-var(--sidebar-top))]",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)",i),...c,children:r("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r("div",{className:"flex flex-col my-2.5 ml-2.5 rounded-2xl border bg-sidebar border-sidebar-border flex-1 min-h-0",children:s})})})]})]})});he.displayName="Sidebar";var re=e.forwardRef(({className:a,onClick:t,...n},i)=>{let{toggleSidebar:s,toggleMobileSidebar:c,openMobile:p}=y();return u(k,{children:[u(D,{"data-sidebar":"trigger",variant:"ghost",size:"icon",className:o("md:hidden bg-transparent hover:bg-transparent",a),onClick:d=>{t?.(d),c()},...n,children:[p?r("span",{className:o(z({variant:"secondary",size:"icon"})),children:r(de,{size:16})}):r("span",{className:o(z({variant:"outline",size:"icon"})),children:r(le,{size:16})}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]}),u(D,{ref:i,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:o("hidden md:inline-flex h-7 w-7",a),onClick:d=>{t?.(d),s()},...n,children:[r("span",{className:"rounded-full p-2",children:r(se,{size:16})}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})});re.displayName="SidebarTrigger";var Re=e.forwardRef(({className:a,...t},n)=>{let{toggleSidebar:i}=y();return r("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:o("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...t})});Re.displayName="SidebarRail";var xe=e.memo(e.forwardRef(({className:a,...t},n)=>r("main",{ref:n,className:o("relative flex min-w-0 w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",a),...t})));xe.displayName="SidebarInset";var Se=e.forwardRef(({className:a,...t},n)=>r(K,{ref:n,"data-sidebar":"input",className:o("h-8 w-full bg-sidebar shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",a),...t}));Se.displayName="SidebarInput";var we=e.forwardRef(({className:a,showTrigger:t=!1,children:n,...i},s)=>{let{state:c}=y(),p=e.useContext(te),d=c==="collapsed"&&!p;return u("div",{ref:s,"data-sidebar":"header",className:o("flex w-full gap-2 p-2 items-center",d?"justify-center items-center":"justify-between items-start",a),...i,children:[!d&&r("div",{className:"transition-all duration-200 w-full h-fit flex justify-between overflow-hidden",children:r("div",{className:"whitespace-nowrap",children:n})}),t&&r(re,{})]})});we.displayName="SidebarHeader";var ye=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"footer",className:o("flex flex-col gap-2 p-2",a),...t}));ye.displayName="SidebarFooter";var Ce=e.forwardRef(({className:a,...t},n)=>r(j,{ref:n,"data-sidebar":"separator",className:o("mx-2 w-auto bg-border",a),...t}));Ce.displayName="SidebarSeparator";var Ne=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"content",className:o("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden p-2",a),...t}));Ne.displayName="SidebarContent";var Me=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"group",className:o("relative flex w-full min-w-0 flex-col","group-data-[collapsible=icon]:p-0",a),...t}));Me.displayName="SidebarGroup";var Ee=e.forwardRef(({className:a,asChild:t=!1,...n},i)=>r(t?w:"div",{ref:i,"data-sidebar":"group-label",className:o("flex h-8 shrink-0 items-center rounded-md text-xs font-medium text-secondary-text outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...n}));Ee.displayName="SidebarGroupLabel";var Te=e.forwardRef(({className:a,asChild:t=!1,...n},i)=>r(t?w:"button",{ref:i,"data-sidebar":"group-action",className:o("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",a),...n}));Te.displayName="SidebarGroupAction";var Be=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"group-content",className:o("w-full text-sm",a),...t}));Be.displayName="SidebarGroupContent";var Pe=e.forwardRef(({className:a,...t},n)=>r("ul",{ref:n,"data-sidebar":"menu",className:o("flex w-full min-w-0 flex-col gap-1",a),...t}));Pe.displayName="SidebarMenu";var Ie=e.forwardRef(({className:a,...t},n)=>r("li",{ref:n,"data-sidebar":"menu-item",className:o("group/menu-item relative",a),...t}));Ie.displayName="SidebarMenuItem";var Le=ie("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"",outline:"bg-sidebar shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),He=e.forwardRef(({asChild:a=!1,isActive:t=!1,variant:n="default",size:i="default",tooltip:s,className:c,...p},d)=>{let R=a?w:"button",{state:v}=y(),b=r(R,{ref:d,"data-sidebar":"menu-button","data-size":i,"data-active":t,className:o(Le({variant:n,size:i}),c),...p});return s?(typeof s=="string"&&(s={children:s}),u(J,{children:[r(Q,{asChild:!0,children:b}),r(Z,{side:"right",align:"center",hidden:v!=="collapsed",...s})]})):b});He.displayName="SidebarMenuButton";var ze=e.forwardRef(({className:a,asChild:t=!1,showOnHover:n=!1,...i},s)=>r(t?w:"button",{ref:s,"data-sidebar":"menu-action",className:o("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-base-accent-foreground md:opacity-0",a),...i}));ze.displayName="SidebarMenuAction";var De=e.forwardRef(({className:a,...t},n)=>r("div",{ref:n,"data-sidebar":"menu-badge",className:o("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...t}));De.displayName="SidebarMenuBadge";var _e=e.forwardRef(({className:a,showIcon:t=!1,...n},i)=>{let s=e.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return u("div",{ref:i,"data-sidebar":"menu-skeleton",className:o("flex h-8 items-center gap-2 rounded-md px-2",a),...n,children:[t&&r(_,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),r(_,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});_e.displayName="SidebarMenuSkeleton";var ke=e.forwardRef(({className:a,...t},n)=>r("ul",{ref:n,"data-sidebar":"menu-sub",className:o("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...t}));ke.displayName="SidebarMenuSub";var Ae=e.forwardRef(({...a},t)=>r("li",{ref:t,...a}));Ae.displayName="SidebarMenuSubItem";var Oe=e.forwardRef(({asChild:a=!1,size:t="md",isActive:n,className:i,...s},c)=>r(a?w:"a",{ref:c,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:o("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...s}));Oe.displayName="SidebarMenuSubButton";export{y as a,ge as b,ve as c,he as d,re as e,Re as f,xe as g,Se as h,we as i,ye as j,Ce as k,Ne as l,Me as m,Ee as n,Te as o,Be as p,Pe as q,Ie as r,He as s,ze as t,De as u,_e as v,ke as w,Ae as x,Oe as y};
|
|
3
|
+
//# sourceMappingURL=chunk-YIVVQTGD.mjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as e}from"./chunk-S5TKCF6T.mjs";import*as r from"react";import{jsx as d}from"react/jsx-runtime";var l=r.forwardRef(({className:t,type:o,error:n,...i},s)=>d("input",{type:o,className:e("flex my-2 h-8 lg:h-9 w-full rounded-3xl border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-secondary-text 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?"border-destructive-foreground focus-visible:ring-destructive-foreground":"border-border",t),ref:s,...i}));l.displayName="Input";export{l as a};
|
|
3
|
+
//# sourceMappingURL=chunk-YSIF7HA3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n error?: boolean\n}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, error, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex my-2 h-8 lg:h-9 w-full rounded-3xl border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-secondary-text 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 error\n ? \"border-destructive-foreground focus-visible:ring-destructive-foreground\"\n : \"border-border\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"mappings":";yCAAA,UAAYA,MAAW,QAWjB,cAAAC,MAAA,oBAHN,IAAMC,EAAc,aAClB,CAAC,CAAE,UAAAC,EAAW,KAAAC,EAAM,MAAAC,EAAO,GAAGC,CAAM,EAAGC,IAEnCN,EAAC,SACC,KAAMG,EACN,UAAWI,EACT,mYACAH,EACI,0EACA,gBACJF,CACF,EACA,IAAKI,EACJ,GAAGD,EACN,CAGN,EACAJ,EAAM,YAAc","names":["React","jsx","Input","className","type","error","props","ref","cn"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-Z5V4P3EC.js","../src/components/radio-group.tsx"],"names":["RadioGroup","className","props","ref","jsx","cn","RadioGroupItem","Circle"],"mappings":"AAAA,uWAAY;AACZ,sDAAkC,uECCX,iHACc,2CACd,+CASnB,IALEA,CAAAA,CAAmB,CAAA,CAAA,UAAA,CAGvB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAExBC,6BAAAA,CAAqB,CAAA,IAAA,CAApB,CACC,SAAA,CAAWC,gCAAAA,YAAG,CAAcJ,CAAS,CAAA,CACpC,GAAGC,CAAAA,CACJ,GAAA,CAAKC,CAAAA,CACP,CAEH,CAAA,CACDH,CAAAA,CAAW,WAAA,CAAkC,CAAA,CAAA,IAAA,CAAK,WAAA,CAElD,IAAMM,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAL,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAExBC,6BAAAA,CAAqB,CAAA,IAAA,CAApB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,sUACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CAEJ,QAAA,CAAAE,6BAAAA,CAAqB,CAAA,SAAA,CAApB,CAA8B,SAAA,CAAU,kCAAA,CACvC,QAAA,CAAAA,6BAAAA,mBAACG,CAAA,CAAO,SAAA,CAAU,uCAAA,CAAwC,CAAA,CAC5D,CAAA,CACF,CAEH,CAAA,CACDD,CAAAA,CAAe,WAAA,CAAkC,CAAA,CAAA,IAAA,CAAK,WAAA,CAAA,6BAAA","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/chunk-Z5V4P3EC.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\"\nimport { Circle } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root\n className={cn(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-accent-muted bg-background ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-accent data-[state=checked]:text-accent\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/GeometricFluidGrid.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAmC,gCAA6B,qCAAqB","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/GeometricFluidGrid.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/GlitchLink.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAqC,gCAA6B,gCAA6B,mFAA0C","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/GlitchLink.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/PixelLoad.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAmC,gCAA6B,uCAAuB","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/PixelLoad.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/TextDecoder.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAmC,gCAA6B,gCAA6B,qCAAqB","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/TextDecoder.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/accordion.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAyC,gCAA6B,gCAA6B,iLAAsF","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/accordion.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/avatar.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAA2C,gCAA6B,gCAA6B,yNAAqG","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/avatar.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunk73MWZSJIjs = require('../chunk-73MWZSJI.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Breadcrumb = _chunk73MWZSJIjs.a; exports.BreadcrumbEllipsis = _chunk73MWZSJIjs.g; exports.BreadcrumbItem = _chunk73MWZSJIjs.c; exports.BreadcrumbLink = _chunk73MWZSJIjs.d; exports.BreadcrumbList = _chunk73MWZSJIjs.b; exports.BreadcrumbPage = _chunk73MWZSJIjs.e; exports.BreadcrumbSeparator = _chunk73MWZSJIjs.f;
|
|
3
3
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/breadcrumb.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,uDAA+C,gCAA6B,gCAA6B,+TAAyJ","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/breadcrumb.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a,b,c,d,e,f,g}from"../chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"../chunk-OLF2HLRF.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as Breadcrumb,g as BreadcrumbEllipsis,c as BreadcrumbItem,d as BreadcrumbLink,b as BreadcrumbList,e as BreadcrumbPage,f as BreadcrumbSeparator};
|
|
3
3
|
//# sourceMappingURL=breadcrumb.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunkIJVB2BVOjs = require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Button = _chunkIJVB2BVOjs.b; exports.buttonVariants = _chunkIJVB2BVOjs.a;
|
|
3
3
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/button.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,uDAAqC,gCAA6B,gCAA6B,iFAAwC","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/button.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a,b}from"../chunk-
|
|
2
|
+
import{a,b}from"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{b as Button,a as buttonVariants};
|
|
3
3
|
//# sourceMappingURL=button.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunk3DUPSGEYjs = require('../chunk-3DUPSGEY.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Calendar = _chunk3DUPSGEYjs.a; exports.CalendarDayButton = _chunk3DUPSGEYjs.b;
|
|
3
3
|
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/calendar.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAqC,gCAA6B,gCAA6B,gCAA6B,sFAA6C","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/calendar.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a,b}from"../chunk-
|
|
2
|
+
"use client";import{a,b}from"../chunk-EOFZPG26.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as Calendar,b as CalendarDayButton};
|
|
3
3
|
//# sourceMappingURL=calendar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/card.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,uDAA6C,gCAA6B,gCAA6B,oPAAuG","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/card.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/checkbox.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAmC,gCAA6B,gCAA6B,sCAAsB","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/checkbox.js"}
|
|
@@ -30,7 +30,24 @@ interface ComboboxProps {
|
|
|
30
30
|
onTriggerClick?: () => void;
|
|
31
31
|
showChipRemoveIcon?: boolean;
|
|
32
32
|
triggerProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
33
|
+
/** When true, external chips are not rendered inside the Combobox. Use ComboboxChips to render them externally. */
|
|
34
|
+
externalChipsOnly?: boolean;
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
interface ComboboxChipsProps {
|
|
37
|
+
/** The selected options to display as chips */
|
|
38
|
+
selectedOptions: ComboboxOption[];
|
|
39
|
+
/** Callback when a chip is removed */
|
|
40
|
+
onRemove?: (value: string) => void;
|
|
41
|
+
/** Whether to show the remove icon on chips */
|
|
42
|
+
showRemoveIcon?: boolean;
|
|
43
|
+
/** Whether the chips are disabled */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Additional class name for the chip container */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Additional class name for individual chips */
|
|
48
|
+
chipClassName?: string;
|
|
49
|
+
}
|
|
50
|
+
declare function ComboboxChips({ selectedOptions, onRemove, showRemoveIcon, disabled, className, chipClassName, }: ComboboxChipsProps): react_jsx_runtime.JSX.Element | null;
|
|
51
|
+
declare function Combobox({ options, groups, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, disableLabelControls, className, error, multiple, values, onValuesChange, variant, searchable, onTriggerClick, showChipRemoveIcon, triggerProps, externalChipsOnly, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
35
52
|
|
|
36
|
-
export { Combobox, type ComboboxGroup, type ComboboxOption, type ComboboxProps };
|
|
53
|
+
export { Combobox, ComboboxChips, type ComboboxChipsProps, type ComboboxGroup, type ComboboxOption, type ComboboxProps };
|
|
@@ -30,7 +30,24 @@ interface ComboboxProps {
|
|
|
30
30
|
onTriggerClick?: () => void;
|
|
31
31
|
showChipRemoveIcon?: boolean;
|
|
32
32
|
triggerProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
33
|
+
/** When true, external chips are not rendered inside the Combobox. Use ComboboxChips to render them externally. */
|
|
34
|
+
externalChipsOnly?: boolean;
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
interface ComboboxChipsProps {
|
|
37
|
+
/** The selected options to display as chips */
|
|
38
|
+
selectedOptions: ComboboxOption[];
|
|
39
|
+
/** Callback when a chip is removed */
|
|
40
|
+
onRemove?: (value: string) => void;
|
|
41
|
+
/** Whether to show the remove icon on chips */
|
|
42
|
+
showRemoveIcon?: boolean;
|
|
43
|
+
/** Whether the chips are disabled */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Additional class name for the chip container */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Additional class name for individual chips */
|
|
48
|
+
chipClassName?: string;
|
|
49
|
+
}
|
|
50
|
+
declare function ComboboxChips({ selectedOptions, onRemove, showRemoveIcon, disabled, className, chipClassName, }: ComboboxChipsProps): react_jsx_runtime.JSX.Element | null;
|
|
51
|
+
declare function Combobox({ options, groups, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, disableLabelControls, className, error, multiple, values, onValuesChange, variant, searchable, onTriggerClick, showChipRemoveIcon, triggerProps, externalChipsOnly, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
35
52
|
|
|
36
|
-
export { Combobox, type ComboboxGroup, type ComboboxOption, type ComboboxProps };
|
|
53
|
+
export { Combobox, ComboboxChips, type ComboboxChipsProps, type ComboboxGroup, type ComboboxOption, type ComboboxProps };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunkUW73WIQUjs = require('../chunk-UW73WIQU.js');require('../chunk-ULIOO55I.js');require('../chunk-SPGHRCUD.js');require('../chunk-53P3PXF7.js');require('../chunk-3BVMHDYA.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Combobox = _chunkUW73WIQUjs.b; exports.ComboboxChips = _chunkUW73WIQUjs.a;
|
|
3
3
|
//# sourceMappingURL=combobox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/combobox.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,uDAAqC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,kFAAyC","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/combobox.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a}from"../chunk-
|
|
2
|
+
import{a,b}from"../chunk-QOEM7ZRV.mjs";import"../chunk-FZ3NXOFK.mjs";import"../chunk-4DRIPZWE.mjs";import"../chunk-RUEPYIWM.mjs";import"../chunk-4LR7SOCY.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{b as Combobox,a as ComboboxChips};
|
|
3
3
|
//# sourceMappingURL=combobox.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunkSPGHRCUDjs = require('../chunk-SPGHRCUD.js');require('../chunk-53P3PXF7.js');require('../chunk-3BVMHDYA.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Command = _chunkSPGHRCUDjs.a; exports.CommandDialog = _chunkSPGHRCUDjs.b; exports.CommandEmpty = _chunkSPGHRCUDjs.e; exports.CommandGroup = _chunkSPGHRCUDjs.f; exports.CommandInput = _chunkSPGHRCUDjs.c; exports.CommandItem = _chunkSPGHRCUDjs.h; exports.CommandList = _chunkSPGHRCUDjs.d; exports.CommandSeparator = _chunkSPGHRCUDjs.g; exports.CommandShortcut = _chunkSPGHRCUDjs.i;
|
|
3
3
|
//# sourceMappingURL=command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/command.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,uDAAmD,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,mYAA2K","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/command.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i}from"../chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i}from"../chunk-4DRIPZWE.mjs";import"../chunk-RUEPYIWM.mjs";import"../chunk-4LR7SOCY.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as Command,b as CommandDialog,e as CommandEmpty,f as CommandGroup,c as CommandInput,h as CommandItem,d as CommandList,g as CommandSeparator,i as CommandShortcut};
|
|
3
3
|
//# sourceMappingURL=command.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunkNCBOTFZQjs = require('../chunk-NCBOTFZQ.js');require('../chunk-3DUPSGEY.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.DatePicker = _chunkNCBOTFZQjs.a;
|
|
3
3
|
//# sourceMappingURL=date-picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/date-picker.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAmC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,wCAAwB","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/date-picker.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a}from"../chunk-
|
|
2
|
+
"use client";import{a}from"../chunk-KN2ZJ5E6.mjs";import"../chunk-EOFZPG26.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as DatePicker};
|
|
3
3
|
//# sourceMappingURL=date-picker.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunk24EJLBGDjs = require('../chunk-24EJLBGD.js');require('../chunk-3DUPSGEY.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.DateRangePicker = _chunk24EJLBGDjs.a;
|
|
3
3
|
//# sourceMappingURL=date-range-picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/date-range-picker.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAmC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,6CAA6B","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/date-range-picker.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a}from"../chunk-
|
|
2
|
+
"use client";import{a}from"../chunk-EDOMXQSZ.mjs";import"../chunk-EOFZPG26.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as DateRangePicker};
|
|
3
3
|
//# sourceMappingURL=date-range-picker.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunk53P3PXF7js = require('../chunk-53P3PXF7.js');require('../chunk-3BVMHDYA.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Dialog = _chunk53P3PXF7js.a; exports.DialogClose = _chunk53P3PXF7js.d; exports.DialogContent = _chunk53P3PXF7js.f; exports.DialogDescription = _chunk53P3PXF7js.j; exports.DialogFooter = _chunk53P3PXF7js.h; exports.DialogHeader = _chunk53P3PXF7js.g; exports.DialogOverlay = _chunk53P3PXF7js.e; exports.DialogPortal = _chunk53P3PXF7js.c; exports.DialogTitle = _chunk53P3PXF7js.i; exports.DialogTrigger = _chunk53P3PXF7js.b;
|
|
3
3
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/dialog.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAqD,gCAA6B,gCAA6B,gCAA6B,gCAA6B,6aAA4L","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/dialog.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a,b,c,d,e,f,g,h,i,j}from"../chunk-
|
|
2
|
+
"use client";import{a,b,c,d,e,f,g,h,i,j}from"../chunk-RUEPYIWM.mjs";import"../chunk-4LR7SOCY.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as Dialog,d as DialogClose,f as DialogContent,j as DialogDescription,h as DialogFooter,g as DialogHeader,e as DialogOverlay,c as DialogPortal,i as DialogTitle,b as DialogTrigger};
|
|
3
3
|
//# sourceMappingURL=dialog.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunkIJRJBDSOjs = require('../chunk-IJRJBDSO.js');require('../chunk-RJMIOBXZ.js');require('../chunk-3BVMHDYA.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.Drawer = _chunkIJRJBDSOjs.b; exports.DrawerBody = _chunkIJRJBDSOjs.e; exports.DrawerFooter = _chunkIJRJBDSOjs.f; exports.DrawerHeader = _chunkIJRJBDSOjs.c; exports.DrawerTitle = _chunkIJRJBDSOjs.d; exports.useDrawer = _chunkIJRJBDSOjs.a;
|
|
3
3
|
//# sourceMappingURL=drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/drawer.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAA6C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,qPAAwG","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/drawer.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a,b,c,d,e,f}from"../chunk-
|
|
2
|
+
"use client";import{a,b,c,d,e,f}from"../chunk-JD2CTTZW.mjs";import"../chunk-5TVDBV74.mjs";import"../chunk-4LR7SOCY.mjs";import"../chunk-QZKQORLQ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{b as Drawer,e as DrawerBody,f as DrawerFooter,c as DrawerHeader,d as DrawerTitle,a as useDrawer};
|
|
3
3
|
//# sourceMappingURL=drawer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/dropdown-menu.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAA+D,gCAA6B,gCAA6B,6uBAA+X","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/dropdown-menu.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/field.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY,CAAC,uDAAuC,gCAA6B,gCAA6B,2HAAyD","file":"/Users/aktoriukas/Documents/Projects/alkimi/alkimi-ui-kit/dist/components/field.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunkXUVA7BXGjs = require('../chunk-XUVA7BXG.js');require('../chunk-IJVB2BVO.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.FileUpload = _chunkXUVA7BXGjs.a;
|
|
3
3
|
//# sourceMappingURL=file-upload.js.map
|