@womp/kookie-ui 0.26.3 → 0.27.1

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.
Files changed (161) hide show
  1. package/components.css +139 -0
  2. package/dist/cjs/components/_internal/pane-chrome.d.ts +13 -1
  3. package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  5. package/dist/cjs/components/_internal/pane-chrome.js.map +4 -4
  6. package/dist/cjs/components/_internal/shell-page-scroll.d.ts +15 -0
  7. package/dist/cjs/components/_internal/shell-page-scroll.d.ts.map +1 -0
  8. package/dist/cjs/components/_internal/shell-page-scroll.js +3 -0
  9. package/dist/cjs/components/_internal/shell-page-scroll.js.map +7 -0
  10. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  11. package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
  12. package/dist/cjs/components/index.js +2 -2
  13. package/dist/cjs/components/index.js.map +4 -4
  14. package/dist/cjs/components/schemas/index.js +1 -1
  15. package/dist/cjs/components/schemas/index.js.map +2 -2
  16. package/dist/cjs/components/schemas/shell.schema.d.ts +1 -0
  17. package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
  18. package/dist/cjs/components/schemas/shell.schema.js +1 -1
  19. package/dist/cjs/components/schemas/shell.schema.js.map +2 -2
  20. package/dist/cjs/components/shell.d.ts +11 -0
  21. package/dist/cjs/components/shell.d.ts.map +1 -1
  22. package/dist/cjs/components/shell.js +1 -1
  23. package/dist/cjs/components/shell.js.map +4 -4
  24. package/dist/cjs/components/sidebar.js +1 -1
  25. package/dist/cjs/components/sidebar.js.map +4 -4
  26. package/dist/cjs/components/toolbar.js +1 -1
  27. package/dist/cjs/components/toolbar.js.map +4 -4
  28. package/dist/cjs/index.js +4 -4
  29. package/dist/cjs/index.js.map +4 -4
  30. package/dist/esm/{chunk-GMWCTK5G.js → chunk-2E57H3NH.js} +2 -2
  31. package/dist/esm/{chunk-Q2TLWILH.js → chunk-2FYUM6TA.js} +2 -2
  32. package/dist/esm/{chunk-W3ES2XSB.js → chunk-2S7HPQVX.js} +2 -2
  33. package/dist/esm/{chunk-27XQ5PN5.js → chunk-2ZKEQS76.js} +2 -2
  34. package/dist/esm/chunk-4LV37PHM.js +3 -0
  35. package/dist/esm/chunk-4LV37PHM.js.map +7 -0
  36. package/dist/esm/{chunk-WYKNBNM5.js → chunk-5BX2YZV6.js} +2 -2
  37. package/dist/esm/{chunk-VPP5IDW7.js → chunk-67UEMB4K.js} +2 -2
  38. package/dist/esm/{chunk-MPCCYR7L.js → chunk-6YWHNLSC.js} +2 -2
  39. package/dist/esm/{chunk-6C6EK2B5.js → chunk-7V6M3MIR.js} +2 -2
  40. package/dist/esm/{chunk-T2DZDW5Y.js → chunk-AQKSO3SW.js} +2 -2
  41. package/dist/esm/{chunk-ACMANOVD.js → chunk-AS2STDGA.js} +2 -2
  42. package/dist/esm/{chunk-IDEDEPBM.js → chunk-B6OFKABP.js} +2 -2
  43. package/dist/esm/chunk-CZ24FOFS.js +3 -0
  44. package/dist/esm/chunk-CZ24FOFS.js.map +7 -0
  45. package/dist/esm/{chunk-RP5ORPPH.js → chunk-DP7MPGR7.js} +2 -2
  46. package/dist/esm/{chunk-UMR4AF35.js → chunk-FMVOB367.js} +2 -2
  47. package/dist/esm/{chunk-YOZXIUZY.js → chunk-FVRVBB6O.js} +2 -2
  48. package/dist/esm/{chunk-6JGF6PQH.js → chunk-H2J25HXP.js} +2 -2
  49. package/dist/esm/{chunk-E2LSWNWZ.js → chunk-HBO7W7SS.js} +2 -2
  50. package/dist/esm/{chunk-2R7WQPXX.js → chunk-HR2VHGJ5.js} +2 -2
  51. package/dist/esm/{chunk-3UIODOPE.js → chunk-J54GYD7A.js} +2 -2
  52. package/dist/esm/{chunk-DSM5SUH3.js → chunk-JKQN6QCP.js} +2 -2
  53. package/dist/esm/{chunk-FK434VPA.js → chunk-JTMLFTNZ.js} +2 -2
  54. package/dist/esm/{chunk-R7YHDIFM.js → chunk-K3GDM26A.js} +2 -2
  55. package/dist/esm/{chunk-CGFLZ3DC.js → chunk-KJZSXLIX.js} +2 -2
  56. package/dist/esm/{chunk-KLYI5E6F.js → chunk-LABMK6Q7.js} +2 -2
  57. package/dist/esm/{chunk-OLWUS7PC.js → chunk-MJKVVGGV.js} +2 -2
  58. package/dist/esm/chunk-MJROOEPE.js +3 -0
  59. package/dist/esm/chunk-MJROOEPE.js.map +7 -0
  60. package/dist/esm/{chunk-Z5W4ACO2.js → chunk-MMDZBPSX.js} +2 -2
  61. package/dist/esm/chunk-QEDKL23P.js +3 -0
  62. package/dist/esm/chunk-QEDKL23P.js.map +7 -0
  63. package/dist/esm/{chunk-ZIAA2C4H.js → chunk-REORAMUH.js} +2 -2
  64. package/dist/esm/{chunk-MCHK36NI.js → chunk-SUQJ7DD4.js} +2 -2
  65. package/dist/esm/{chunk-OUOP6Q3Z.js → chunk-VQDCHBZR.js} +2 -2
  66. package/dist/esm/{chunk-2NWHEGKZ.js → chunk-WAXRIARV.js} +2 -2
  67. package/dist/esm/{chunk-4CIQRUYW.js → chunk-ZOUIIO4C.js} +2 -2
  68. package/dist/esm/components/_internal/base-button.js +1 -1
  69. package/dist/esm/components/_internal/pane-chrome.d.ts +13 -1
  70. package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
  71. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  72. package/dist/esm/components/_internal/portal-theme.js +1 -1
  73. package/dist/esm/components/_internal/shell-page-scroll.d.ts +15 -0
  74. package/dist/esm/components/_internal/shell-page-scroll.d.ts.map +1 -0
  75. package/dist/esm/components/_internal/shell-page-scroll.js +3 -0
  76. package/dist/esm/components/_internal/shell-page-scroll.js.map +7 -0
  77. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  78. package/dist/esm/components/accordion.js +1 -1
  79. package/dist/esm/components/alert-dialog.js +1 -1
  80. package/dist/esm/components/avatar.js +1 -1
  81. package/dist/esm/components/button.js +1 -1
  82. package/dist/esm/components/chatbar.js +1 -1
  83. package/dist/esm/components/checkbox-group.js +1 -1
  84. package/dist/esm/components/checkbox.js +1 -1
  85. package/dist/esm/components/chip.js +1 -1
  86. package/dist/esm/components/combobox.js +1 -1
  87. package/dist/esm/components/context-menu.js +1 -1
  88. package/dist/esm/components/dialog.js +1 -1
  89. package/dist/esm/components/dropdown-menu.js +1 -1
  90. package/dist/esm/components/index.js +1 -1
  91. package/dist/esm/components/message-scroller.js +1 -1
  92. package/dist/esm/components/notice.js +1 -1
  93. package/dist/esm/components/popover.js +1 -1
  94. package/dist/esm/components/radio-group.js +1 -1
  95. package/dist/esm/components/radio.js +1 -1
  96. package/dist/esm/components/schemas/index.js +1 -1
  97. package/dist/esm/components/schemas/shell.schema.d.ts +1 -0
  98. package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
  99. package/dist/esm/components/schemas/shell.schema.js +1 -1
  100. package/dist/esm/components/select.js +1 -1
  101. package/dist/esm/components/sheet.js +1 -1
  102. package/dist/esm/components/shell.d.ts +11 -0
  103. package/dist/esm/components/shell.d.ts.map +1 -1
  104. package/dist/esm/components/shell.js +1 -1
  105. package/dist/esm/components/sidebar.js +1 -1
  106. package/dist/esm/components/slider.js +1 -1
  107. package/dist/esm/components/switch.js +1 -1
  108. package/dist/esm/components/tabs.js +1 -1
  109. package/dist/esm/components/text-area.js +1 -1
  110. package/dist/esm/components/text-field.js +1 -1
  111. package/dist/esm/components/theme.js +1 -1
  112. package/dist/esm/components/toggle.js +1 -1
  113. package/dist/esm/components/toolbar.js +1 -1
  114. package/dist/esm/components/tooltip.js +1 -1
  115. package/dist/esm/index.js +1 -1
  116. package/package.json +1 -1
  117. package/schemas/index.json +6 -1
  118. package/schemas/shell-root.json +6 -1
  119. package/src/components/_internal/pane-chrome.tsx +23 -4
  120. package/src/components/_internal/shell-page-scroll.ts +49 -0
  121. package/src/components/message-scroller.css +3 -0
  122. package/src/components/schemas/shell.schema.ts +4 -1
  123. package/src/components/shell.css +201 -0
  124. package/src/components/shell.tsx +128 -22
  125. package/styles.css +139 -0
  126. package/dist/esm/chunk-OLTRWCQK.js +0 -3
  127. package/dist/esm/chunk-OLTRWCQK.js.map +0 -7
  128. package/dist/esm/chunk-SCIFT27R.js +0 -3
  129. package/dist/esm/chunk-SCIFT27R.js.map +0 -7
  130. package/dist/esm/chunk-XGES2VBG.js +0 -3
  131. package/dist/esm/chunk-XGES2VBG.js.map +0 -7
  132. /package/dist/esm/{chunk-GMWCTK5G.js.map → chunk-2E57H3NH.js.map} +0 -0
  133. /package/dist/esm/{chunk-Q2TLWILH.js.map → chunk-2FYUM6TA.js.map} +0 -0
  134. /package/dist/esm/{chunk-W3ES2XSB.js.map → chunk-2S7HPQVX.js.map} +0 -0
  135. /package/dist/esm/{chunk-27XQ5PN5.js.map → chunk-2ZKEQS76.js.map} +0 -0
  136. /package/dist/esm/{chunk-WYKNBNM5.js.map → chunk-5BX2YZV6.js.map} +0 -0
  137. /package/dist/esm/{chunk-VPP5IDW7.js.map → chunk-67UEMB4K.js.map} +0 -0
  138. /package/dist/esm/{chunk-MPCCYR7L.js.map → chunk-6YWHNLSC.js.map} +0 -0
  139. /package/dist/esm/{chunk-6C6EK2B5.js.map → chunk-7V6M3MIR.js.map} +0 -0
  140. /package/dist/esm/{chunk-T2DZDW5Y.js.map → chunk-AQKSO3SW.js.map} +0 -0
  141. /package/dist/esm/{chunk-ACMANOVD.js.map → chunk-AS2STDGA.js.map} +0 -0
  142. /package/dist/esm/{chunk-IDEDEPBM.js.map → chunk-B6OFKABP.js.map} +0 -0
  143. /package/dist/esm/{chunk-RP5ORPPH.js.map → chunk-DP7MPGR7.js.map} +0 -0
  144. /package/dist/esm/{chunk-UMR4AF35.js.map → chunk-FMVOB367.js.map} +0 -0
  145. /package/dist/esm/{chunk-YOZXIUZY.js.map → chunk-FVRVBB6O.js.map} +0 -0
  146. /package/dist/esm/{chunk-6JGF6PQH.js.map → chunk-H2J25HXP.js.map} +0 -0
  147. /package/dist/esm/{chunk-E2LSWNWZ.js.map → chunk-HBO7W7SS.js.map} +0 -0
  148. /package/dist/esm/{chunk-2R7WQPXX.js.map → chunk-HR2VHGJ5.js.map} +0 -0
  149. /package/dist/esm/{chunk-3UIODOPE.js.map → chunk-J54GYD7A.js.map} +0 -0
  150. /package/dist/esm/{chunk-DSM5SUH3.js.map → chunk-JKQN6QCP.js.map} +0 -0
  151. /package/dist/esm/{chunk-FK434VPA.js.map → chunk-JTMLFTNZ.js.map} +0 -0
  152. /package/dist/esm/{chunk-R7YHDIFM.js.map → chunk-K3GDM26A.js.map} +0 -0
  153. /package/dist/esm/{chunk-CGFLZ3DC.js.map → chunk-KJZSXLIX.js.map} +0 -0
  154. /package/dist/esm/{chunk-KLYI5E6F.js.map → chunk-LABMK6Q7.js.map} +0 -0
  155. /package/dist/esm/{chunk-OLWUS7PC.js.map → chunk-MJKVVGGV.js.map} +0 -0
  156. /package/dist/esm/{chunk-Z5W4ACO2.js.map → chunk-MMDZBPSX.js.map} +0 -0
  157. /package/dist/esm/{chunk-ZIAA2C4H.js.map → chunk-REORAMUH.js.map} +0 -0
  158. /package/dist/esm/{chunk-MCHK36NI.js.map → chunk-SUQJ7DD4.js.map} +0 -0
  159. /package/dist/esm/{chunk-OUOP6Q3Z.js.map → chunk-VQDCHBZR.js.map} +0 -0
  160. /package/dist/esm/{chunk-2NWHEGKZ.js.map → chunk-WAXRIARV.js.map} +0 -0
  161. /package/dist/esm/{chunk-4CIQRUYW.js.map → chunk-ZOUIIO4C.js.map} +0 -0
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as se,b as ie}from"./chunk-OLWUS7PC.js";import{a as ne}from"./chunk-WUCBFB25.js";import{a as ae}from"./chunk-TGRHRMQI.js";import{a as Y}from"./chunk-BUXK5VGR.js";import{b as Z,c as ee}from"./chunk-GKDGNPBD.js";import{c as X}from"./chunk-5KMEUZWN.js";import{a as Q}from"./chunk-LPLW7OWA.js";import{a as I}from"./chunk-L54FWKJE.js";import{c as O}from"./chunk-OKQAVYW4.js";import{a as re}from"./chunk-T2DZDW5Y.js";import{b as te}from"./chunk-YOZXIUZY.js";import{c as W}from"./chunk-HBWBPBSA.js";import{b as oe}from"./chunk-5ON3XLRD.js";import{b as J}from"./chunk-XU74PNM2.js";import{a as Le}from"./chunk-VQPANPMI.js";var je={};Le(je,{Content:()=>ye,Empty:()=>Se,Group:()=>Ve,Input:()=>Re,Item:()=>Te,Label:()=>Ee,List:()=>ve,Root:()=>Pe,Separator:()=>ke,Trigger:()=>ge,Value:()=>he});import*as e from"react";import d from"classnames";import{Popover as me}from"radix-ui";import{useCallbackRef as H,useComposedRefs as pe,useControllableState as A,useLayoutEffect as K}from"radix-ui/internal";import{Command as T,useCommandState as ce}from"cmdk";var Oe=["1","2","3","4"],G={size:{type:"enum",className:"kui-r-size",values:Oe,default:"2",responsive:!0}},ze=["raised","surface","soft","outline","ghost"],le={variant:{type:"enum",className:"kui-variant",values:ze,default:"raised"},error:{type:"boolean"},loading:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean"},...W,...J,width:I.width,placeholder:{type:"string"}},Me=["1","2","3","4"],z={size:{type:"enum",className:"kui-r-size",values:Me,default:"2",responsive:!0},...W,width:I.width,minWidth:I.minWidth,maxWidth:{...I.maxWidth,default:"480px"},...Q};var Fe={size:G.size},Be={size:z.size},be=new Set;function We(o){be.has(o)||(be.add(o),console.warn(o))}function Ge(o){let r=o,t=new Set;return{get:()=>r,set:a=>{Object.is(a,r)||(r=a,t.forEach(n=>n()))},subscribe:a=>(t.add(a),()=>{t.delete(a)})}}var ue=e.createContext(null),M=o=>{let r=e.useContext(ue);if(!r)throw new Error(`Combobox.${o} must be used within Combobox.Root`);return r},de=e.createContext(null),fe=e.createContext(null),Ce=e.createContext(null),xe=()=>e.useContext(Ce);function Ae(o){let r=o.getAttribute("aria-label")?.trim();if(r)return r;let t=o.getAttribute("aria-labelledby");if(t){let n=t.split(/\s+/).map(s=>o.ownerDocument.getElementById(s)?.textContent?.trim()).filter(Boolean).join(" ");if(n)return n}let a=o.labels;if(a&&a.length>0){let n=Array.from(a).map(s=>s.textContent?.trim()).filter(Boolean).join(" ");if(n)return n}}var Pe=o=>{let{children:r,size:t,value:a,defaultValue:n=null,onValueChange:s,open:m,defaultOpen:f=!1,onOpenChange:l,placeholder:c="Select an option",searchPlaceholder:P="Search...",searchValue:g,defaultSearchValue:h="",onSearchValueChange:y,filter:C,shouldFilter:i=!0,loop:b=!0,disabled:R,resetSearchOnSelect:x=!0,resetSearchOnClose:S=!0,color:V,displayValue:v,...k}=o,u=oe(t,G.size),[E,w]=A({prop:m,defaultProp:f,onChange:l}),[p,we]=A({prop:a,defaultProp:n,onChange:s}),[q,N]=A({prop:g,defaultProp:h,onChange:y}),$=typeof v=="function"?v(p):v,[D]=e.useState(()=>Ge(p));K(()=>{D.set(p)},[D,p]);let F=H(L=>{w(L),!L&&S&&N("")}),_=H(L=>{we(L),w(!1),x&&N("")}),B=e.useRef(null),U=e.useCallback(()=>B.current?Ae(B.current):void 0,[]),Ie=e.useMemo(()=>({value:p,displayValue:$,setOpen:F,size:u,placeholder:c,searchPlaceholder:P,disabled:R,color:V,loop:b,shouldFilter:i,filter:C,triggerRef:B,getTriggerLabel:U}),[p,$,F,u,c,P,R,V,b,i,C,U]),Ne=e.useMemo(()=>({value:q,setValue:N}),[q,N]),De=e.useMemo(()=>({store:D,onSelect:_,disabled:R}),[D,_,R]);return e.createElement(ue.Provider,{value:Ie},e.createElement(de.Provider,{value:Ne},e.createElement(fe.Provider,{value:De},e.createElement(se,{open:E,onOpenChange:F,...k},r))))};Pe.displayName="Combobox.Root";var ge=e.forwardRef((o,r)=>{let t=M("Trigger"),{children:a,className:n,placeholder:s,disabled:m,readOnly:f,error:l,loading:c,color:P,radius:g,onClick:h,onKeyDown:y,type:C,...i}=O({size:t.size,...o},Fe,le),b=m??t.disabled,R=P??t.color,x=!!(f||c),S=t.value==null&&t.displayValue==null,V=pe(r,t.triggerRef),{getTriggerLabel:v}=t;e.useEffect(()=>{},[v]);let k=p=>{h?.(p),x&&p.preventDefault()},u=p=>{y?.(p),!(p.defaultPrevented||x||b)&&(p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),t.setOpen(!0))},E=e.createElement("span",{className:"kui-SelectIcon kui-SelectLoadingIcon","aria-hidden":"true"},e.createElement(Y,null)),w=e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-SelectTriggerInner"},e.createElement("span",{className:"kui-ComboboxValue"},t.displayValue??t.value??s??t.placeholder)),c?E:e.createElement(ee,{className:"kui-SelectIcon"}));return e.createElement(ie,{disabled:b},e.createElement("button",{"data-accent-color":R,"data-radius":g,"data-error":l,"data-loading":c,"data-disabled":b||void 0,"data-read-only":f||void 0,"data-placeholder":S?"":void 0,...i,role:"combobox","aria-disabled":b||i["aria-disabled"],"aria-readonly":f||i["aria-readonly"],"aria-invalid":l||i["aria-invalid"],"aria-busy":c||i["aria-busy"],type:C??"button",disabled:b,onClick:k,onKeyDown:u,ref:V,className:d("kui-reset","kui-SelectTrigger","kui-ComboboxTrigger",n)},a?e.createElement(e.Fragment,null,ae(a),c?E:null):w))});ge.displayName="Combobox.Trigger";var he=e.forwardRef(({placeholder:o,children:r,className:t,...a},n)=>{let s=M("Value"),m=s.displayValue??s.value??void 0;return e.createElement("span",{...a,ref:n,className:d("kui-ComboboxValue",t)},m??r??o??s.placeholder)});he.displayName="Combobox.Value";function He(){let o=ce(n=>n.filtered.count),r=ce(n=>n.search),[t,a]=e.useState("");return e.useEffect(()=>{let n=r?o===0?"No results":`${o} result${o===1?"":"s"}`:"",s=window.setTimeout(()=>a(n),r?400:0);return()=>window.clearTimeout(s)},[o,r]),e.createElement(ne,{role:"status","aria-live":"polite","aria-atomic":"true"},t)}var ye=e.forwardRef((o,r)=>{let t=M("Content"),a=te(),n=o.size??t.size??z.size.default,{className:s,children:m,color:f,forceMount:l,container:c,onOpenAutoFocus:P,"aria-label":g,"aria-labelledby":h,...y}=O({...o,size:n},z),C=f||t.color||a.accentColor,{getTriggerLabel:i}=t,[b,R]=e.useState(i);K(()=>{if(b!==void 0)return;let u=i();u!==void 0&&R(u)},[i,b]);let x=o["aria-label"]??b,S=e.useMemo(()=>({sizeClassName:O({size:n},Be).className||void 0,color:C,label:x}),[n,C,x]),V=e.useRef(null),v=u=>{if(P?.(u),u.defaultPrevented)return;let E=V.current;if(!E||E.querySelector("[cmdk-input]"))return;u.preventDefault(),(E.querySelector("[cmdk-list]")??E).focus({preventScroll:!0})},k=t.value?.trim()||void 0;return e.createElement(me.Portal,{container:c,forceMount:l?!0:void 0},e.createElement(re,{asChild:!0},e.createElement(me.Content,{"data-accent-color":C,align:"start",sideOffset:4,collisionPadding:10,"aria-label":h?void 0:x,"aria-labelledby":h,...y,forceMount:l?!0:void 0,onOpenAutoFocus:v,ref:r,className:d("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-ComboboxContent",s)},e.createElement(Ce.Provider,{value:S},e.createElement(T,{ref:V,loop:t.loop,shouldFilter:t.shouldFilter,filter:t.filter,label:x,defaultValue:k,className:"kui-ComboboxCommand"},m,e.createElement(He,null))))))});ye.displayName="Combobox.Content";var Re=e.forwardRef(({className:o,startAdornment:r,endAdornment:t,placeholder:a,variant:n,value:s,onValueChange:m,...f},l)=>{let c=M("Input"),P=e.useContext(de),g=xe(),h=n??"soft",y=s??P?.value??"",C=m??P?.setValue,i=e.createElement("div",{className:d("kui-TextFieldRoot","kui-ComboboxInputRoot",g?.sizeClassName,`kui-variant-${h}`),"data-accent-color":g?.color},r?e.createElement("div",{className:"kui-TextFieldSlot"},r):null,e.createElement(T.Input,{...f,ref:l,value:y,onValueChange:C,placeholder:a??c.searchPlaceholder,className:d("kui-reset","kui-TextFieldInput",o)}),t?e.createElement("div",{className:"kui-TextFieldSlot","data-side":"right"},t):null);return g?e.createElement("div",{className:"kui-ComboboxSearch"},i):i});Re.displayName="Combobox.Input";var ve=e.forwardRef(({className:o,children:r,label:t,...a},n)=>{let s=xe();return e.createElement("div",{className:"kui-ComboboxScrollArea"},e.createElement("div",{className:d("kui-BaseMenuViewport","kui-ComboboxViewport")},e.createElement(T.List,{...a,label:t??s?.label,ref:n,className:d("kui-ComboboxList",o)},r)))});ve.displayName="Combobox.List";var Se=e.forwardRef(({className:o,...r},t)=>e.createElement(T.Empty,{...r,ref:t,className:d("kui-ComboboxEmpty",o)}));Se.displayName="Combobox.Empty";var Ve=e.forwardRef(({className:o,...r},t)=>e.createElement(T.Group,{...r,ref:t,className:d("kui-BaseMenuGroup","kui-ComboboxGroup",o)}));Ve.displayName="Combobox.Group";var Ee=e.forwardRef(({className:o,id:r,...t},a)=>{let n=e.useId(),s=r??n,m=e.useRef(null),f=pe(a,m);return K(()=>{let l=m.current?.closest("[cmdk-group-items]");if(!(!l||l.hasAttribute("aria-labelledby")))return l.setAttribute("aria-labelledby",s),()=>{l.getAttribute("aria-labelledby")===s&&l.removeAttribute("aria-labelledby")}},[s]),e.createElement("div",{...t,id:s,ref:f,className:d("kui-BaseMenuLabel","kui-ComboboxLabel",o)})});Ee.displayName="Combobox.Label";var ke=e.forwardRef(({className:o,...r},t)=>e.createElement(T.Separator,{...r,ref:t,className:d("kui-BaseMenuSeparator","kui-ComboboxSeparator",o)}));ke.displayName="Combobox.Separator";function j(o){return o==null||typeof o=="boolean"?"":typeof o=="string"||typeof o=="number"?String(o):Array.isArray(o)?o.map(j).join(""):e.isValidElement(o)?j(o.props.children):""}var Te=e.forwardRef(({className:o,children:r,label:t,value:a,disabled:n,onSelect:s,keywords:m,...f},l)=>{let c=e.useContext(fe);if(!c)throw new Error("Combobox.Item must be used within Combobox.Root");let{store:P,onSelect:g,disabled:h}=c,y=a??(typeof r=="string"?r.trim():void 0),C=()=>y!==void 0&&P.get()===y,i=e.useSyncExternalStore(P.subscribe,C,C),b=H(s),R=e.useCallback(k=>{let u=a??k;g(u),b(u)},[a,g,b]),x=(t??j(r)).replace(/\s+/g," ").trim(),S=x?m?[x,...m]:[x]:m,V=S?S.join("\0"):"",v=n??h??!1;return e.createElement(T.Item,{key:V,...f,value:a,keywords:S,"aria-checked":i,disabled:v||void 0,ref:l,onSelect:R,className:d("kui-reset","kui-BaseMenuItem","kui-ComboboxItem",o)},i?e.createElement("span",{className:d("kui-BaseMenuItemIndicator","kui-ComboboxItemIndicator")},e.createElement(Z,{className:d("kui-BaseMenuItemIndicatorIcon","kui-ComboboxItemIndicatorIcon")})):null,e.createElement(X,null,r))});Te.displayName="Combobox.Item";export{Pe as a,ge as b,he as c,ye as d,Re as e,ve as f,Se as g,Ve as h,Ee as i,ke as j,Te as k,je as l};
3
- //# sourceMappingURL=chunk-GMWCTK5G.js.map
2
+ import{a as se,b as ie}from"./chunk-MJKVVGGV.js";import{a as ne}from"./chunk-WUCBFB25.js";import{a as ae}from"./chunk-TGRHRMQI.js";import{a as Y}from"./chunk-BUXK5VGR.js";import{b as Z,c as ee}from"./chunk-GKDGNPBD.js";import{c as X}from"./chunk-5KMEUZWN.js";import{a as Q}from"./chunk-LPLW7OWA.js";import{a as I}from"./chunk-L54FWKJE.js";import{c as O}from"./chunk-OKQAVYW4.js";import{a as re}from"./chunk-AQKSO3SW.js";import{b as te}from"./chunk-FVRVBB6O.js";import{b as oe}from"./chunk-5ON3XLRD.js";import{c as W}from"./chunk-HBWBPBSA.js";import{b as J}from"./chunk-XU74PNM2.js";import{a as Le}from"./chunk-VQPANPMI.js";var je={};Le(je,{Content:()=>ye,Empty:()=>Se,Group:()=>Ve,Input:()=>Re,Item:()=>Te,Label:()=>Ee,List:()=>ve,Root:()=>Pe,Separator:()=>ke,Trigger:()=>ge,Value:()=>he});import*as e from"react";import d from"classnames";import{Popover as me}from"radix-ui";import{useCallbackRef as H,useComposedRefs as pe,useControllableState as A,useLayoutEffect as K}from"radix-ui/internal";import{Command as T,useCommandState as ce}from"cmdk";var Oe=["1","2","3","4"],G={size:{type:"enum",className:"kui-r-size",values:Oe,default:"2",responsive:!0}},ze=["raised","surface","soft","outline","ghost"],le={variant:{type:"enum",className:"kui-variant",values:ze,default:"raised"},error:{type:"boolean"},loading:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean"},...W,...J,width:I.width,placeholder:{type:"string"}},Me=["1","2","3","4"],z={size:{type:"enum",className:"kui-r-size",values:Me,default:"2",responsive:!0},...W,width:I.width,minWidth:I.minWidth,maxWidth:{...I.maxWidth,default:"480px"},...Q};var Fe={size:G.size},Be={size:z.size},be=new Set;function We(o){be.has(o)||(be.add(o),console.warn(o))}function Ge(o){let r=o,t=new Set;return{get:()=>r,set:a=>{Object.is(a,r)||(r=a,t.forEach(n=>n()))},subscribe:a=>(t.add(a),()=>{t.delete(a)})}}var ue=e.createContext(null),M=o=>{let r=e.useContext(ue);if(!r)throw new Error(`Combobox.${o} must be used within Combobox.Root`);return r},de=e.createContext(null),fe=e.createContext(null),Ce=e.createContext(null),xe=()=>e.useContext(Ce);function Ae(o){let r=o.getAttribute("aria-label")?.trim();if(r)return r;let t=o.getAttribute("aria-labelledby");if(t){let n=t.split(/\s+/).map(s=>o.ownerDocument.getElementById(s)?.textContent?.trim()).filter(Boolean).join(" ");if(n)return n}let a=o.labels;if(a&&a.length>0){let n=Array.from(a).map(s=>s.textContent?.trim()).filter(Boolean).join(" ");if(n)return n}}var Pe=o=>{let{children:r,size:t,value:a,defaultValue:n=null,onValueChange:s,open:m,defaultOpen:f=!1,onOpenChange:l,placeholder:c="Select an option",searchPlaceholder:P="Search...",searchValue:g,defaultSearchValue:h="",onSearchValueChange:y,filter:C,shouldFilter:i=!0,loop:b=!0,disabled:R,resetSearchOnSelect:x=!0,resetSearchOnClose:S=!0,color:V,displayValue:v,...k}=o,u=oe(t,G.size),[E,w]=A({prop:m,defaultProp:f,onChange:l}),[p,we]=A({prop:a,defaultProp:n,onChange:s}),[q,N]=A({prop:g,defaultProp:h,onChange:y}),$=typeof v=="function"?v(p):v,[D]=e.useState(()=>Ge(p));K(()=>{D.set(p)},[D,p]);let F=H(L=>{w(L),!L&&S&&N("")}),_=H(L=>{we(L),w(!1),x&&N("")}),B=e.useRef(null),U=e.useCallback(()=>B.current?Ae(B.current):void 0,[]),Ie=e.useMemo(()=>({value:p,displayValue:$,setOpen:F,size:u,placeholder:c,searchPlaceholder:P,disabled:R,color:V,loop:b,shouldFilter:i,filter:C,triggerRef:B,getTriggerLabel:U}),[p,$,F,u,c,P,R,V,b,i,C,U]),Ne=e.useMemo(()=>({value:q,setValue:N}),[q,N]),De=e.useMemo(()=>({store:D,onSelect:_,disabled:R}),[D,_,R]);return e.createElement(ue.Provider,{value:Ie},e.createElement(de.Provider,{value:Ne},e.createElement(fe.Provider,{value:De},e.createElement(se,{open:E,onOpenChange:F,...k},r))))};Pe.displayName="Combobox.Root";var ge=e.forwardRef((o,r)=>{let t=M("Trigger"),{children:a,className:n,placeholder:s,disabled:m,readOnly:f,error:l,loading:c,color:P,radius:g,onClick:h,onKeyDown:y,type:C,...i}=O({size:t.size,...o},Fe,le),b=m??t.disabled,R=P??t.color,x=!!(f||c),S=t.value==null&&t.displayValue==null,V=pe(r,t.triggerRef),{getTriggerLabel:v}=t;e.useEffect(()=>{},[v]);let k=p=>{h?.(p),x&&p.preventDefault()},u=p=>{y?.(p),!(p.defaultPrevented||x||b)&&(p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),t.setOpen(!0))},E=e.createElement("span",{className:"kui-SelectIcon kui-SelectLoadingIcon","aria-hidden":"true"},e.createElement(Y,null)),w=e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-SelectTriggerInner"},e.createElement("span",{className:"kui-ComboboxValue"},t.displayValue??t.value??s??t.placeholder)),c?E:e.createElement(ee,{className:"kui-SelectIcon"}));return e.createElement(ie,{disabled:b},e.createElement("button",{"data-accent-color":R,"data-radius":g,"data-error":l,"data-loading":c,"data-disabled":b||void 0,"data-read-only":f||void 0,"data-placeholder":S?"":void 0,...i,role:"combobox","aria-disabled":b||i["aria-disabled"],"aria-readonly":f||i["aria-readonly"],"aria-invalid":l||i["aria-invalid"],"aria-busy":c||i["aria-busy"],type:C??"button",disabled:b,onClick:k,onKeyDown:u,ref:V,className:d("kui-reset","kui-SelectTrigger","kui-ComboboxTrigger",n)},a?e.createElement(e.Fragment,null,ae(a),c?E:null):w))});ge.displayName="Combobox.Trigger";var he=e.forwardRef(({placeholder:o,children:r,className:t,...a},n)=>{let s=M("Value"),m=s.displayValue??s.value??void 0;return e.createElement("span",{...a,ref:n,className:d("kui-ComboboxValue",t)},m??r??o??s.placeholder)});he.displayName="Combobox.Value";function He(){let o=ce(n=>n.filtered.count),r=ce(n=>n.search),[t,a]=e.useState("");return e.useEffect(()=>{let n=r?o===0?"No results":`${o} result${o===1?"":"s"}`:"",s=window.setTimeout(()=>a(n),r?400:0);return()=>window.clearTimeout(s)},[o,r]),e.createElement(ne,{role:"status","aria-live":"polite","aria-atomic":"true"},t)}var ye=e.forwardRef((o,r)=>{let t=M("Content"),a=te(),n=o.size??t.size??z.size.default,{className:s,children:m,color:f,forceMount:l,container:c,onOpenAutoFocus:P,"aria-label":g,"aria-labelledby":h,...y}=O({...o,size:n},z),C=f||t.color||a.accentColor,{getTriggerLabel:i}=t,[b,R]=e.useState(i);K(()=>{if(b!==void 0)return;let u=i();u!==void 0&&R(u)},[i,b]);let x=o["aria-label"]??b,S=e.useMemo(()=>({sizeClassName:O({size:n},Be).className||void 0,color:C,label:x}),[n,C,x]),V=e.useRef(null),v=u=>{if(P?.(u),u.defaultPrevented)return;let E=V.current;if(!E||E.querySelector("[cmdk-input]"))return;u.preventDefault(),(E.querySelector("[cmdk-list]")??E).focus({preventScroll:!0})},k=t.value?.trim()||void 0;return e.createElement(me.Portal,{container:c,forceMount:l?!0:void 0},e.createElement(re,{asChild:!0},e.createElement(me.Content,{"data-accent-color":C,align:"start",sideOffset:4,collisionPadding:10,"aria-label":h?void 0:x,"aria-labelledby":h,...y,forceMount:l?!0:void 0,onOpenAutoFocus:v,ref:r,className:d("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-ComboboxContent",s)},e.createElement(Ce.Provider,{value:S},e.createElement(T,{ref:V,loop:t.loop,shouldFilter:t.shouldFilter,filter:t.filter,label:x,defaultValue:k,className:"kui-ComboboxCommand"},m,e.createElement(He,null))))))});ye.displayName="Combobox.Content";var Re=e.forwardRef(({className:o,startAdornment:r,endAdornment:t,placeholder:a,variant:n,value:s,onValueChange:m,...f},l)=>{let c=M("Input"),P=e.useContext(de),g=xe(),h=n??"soft",y=s??P?.value??"",C=m??P?.setValue,i=e.createElement("div",{className:d("kui-TextFieldRoot","kui-ComboboxInputRoot",g?.sizeClassName,`kui-variant-${h}`),"data-accent-color":g?.color},r?e.createElement("div",{className:"kui-TextFieldSlot"},r):null,e.createElement(T.Input,{...f,ref:l,value:y,onValueChange:C,placeholder:a??c.searchPlaceholder,className:d("kui-reset","kui-TextFieldInput",o)}),t?e.createElement("div",{className:"kui-TextFieldSlot","data-side":"right"},t):null);return g?e.createElement("div",{className:"kui-ComboboxSearch"},i):i});Re.displayName="Combobox.Input";var ve=e.forwardRef(({className:o,children:r,label:t,...a},n)=>{let s=xe();return e.createElement("div",{className:"kui-ComboboxScrollArea"},e.createElement("div",{className:d("kui-BaseMenuViewport","kui-ComboboxViewport")},e.createElement(T.List,{...a,label:t??s?.label,ref:n,className:d("kui-ComboboxList",o)},r)))});ve.displayName="Combobox.List";var Se=e.forwardRef(({className:o,...r},t)=>e.createElement(T.Empty,{...r,ref:t,className:d("kui-ComboboxEmpty",o)}));Se.displayName="Combobox.Empty";var Ve=e.forwardRef(({className:o,...r},t)=>e.createElement(T.Group,{...r,ref:t,className:d("kui-BaseMenuGroup","kui-ComboboxGroup",o)}));Ve.displayName="Combobox.Group";var Ee=e.forwardRef(({className:o,id:r,...t},a)=>{let n=e.useId(),s=r??n,m=e.useRef(null),f=pe(a,m);return K(()=>{let l=m.current?.closest("[cmdk-group-items]");if(!(!l||l.hasAttribute("aria-labelledby")))return l.setAttribute("aria-labelledby",s),()=>{l.getAttribute("aria-labelledby")===s&&l.removeAttribute("aria-labelledby")}},[s]),e.createElement("div",{...t,id:s,ref:f,className:d("kui-BaseMenuLabel","kui-ComboboxLabel",o)})});Ee.displayName="Combobox.Label";var ke=e.forwardRef(({className:o,...r},t)=>e.createElement(T.Separator,{...r,ref:t,className:d("kui-BaseMenuSeparator","kui-ComboboxSeparator",o)}));ke.displayName="Combobox.Separator";function j(o){return o==null||typeof o=="boolean"?"":typeof o=="string"||typeof o=="number"?String(o):Array.isArray(o)?o.map(j).join(""):e.isValidElement(o)?j(o.props.children):""}var Te=e.forwardRef(({className:o,children:r,label:t,value:a,disabled:n,onSelect:s,keywords:m,...f},l)=>{let c=e.useContext(fe);if(!c)throw new Error("Combobox.Item must be used within Combobox.Root");let{store:P,onSelect:g,disabled:h}=c,y=a??(typeof r=="string"?r.trim():void 0),C=()=>y!==void 0&&P.get()===y,i=e.useSyncExternalStore(P.subscribe,C,C),b=H(s),R=e.useCallback(k=>{let u=a??k;g(u),b(u)},[a,g,b]),x=(t??j(r)).replace(/\s+/g," ").trim(),S=x?m?[x,...m]:[x]:m,V=S?S.join("\0"):"",v=n??h??!1;return e.createElement(T.Item,{key:V,...f,value:a,keywords:S,"aria-checked":i,disabled:v||void 0,ref:l,onSelect:R,className:d("kui-reset","kui-BaseMenuItem","kui-ComboboxItem",o)},i?e.createElement("span",{className:d("kui-BaseMenuItemIndicator","kui-ComboboxItemIndicator")},e.createElement(Z,{className:d("kui-BaseMenuItemIndicatorIcon","kui-ComboboxItemIndicatorIcon")})):null,e.createElement(X,null,r))});Te.displayName="Combobox.Item";export{Pe as a,ge as b,he as c,ye as d,Re as e,ve as f,Se as g,Ve as h,Ee as i,ke as j,Te as k,je as l};
3
+ //# sourceMappingURL=chunk-2E57H3NH.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as F}from"./chunk-324VC67W.js";import{a as O,b as U,c as q,e as C,f as $}from"./chunk-VPP5IDW7.js";import{a as E}from"./chunk-3UIODOPE.js";import{a as z,b as V,c as j}from"./chunk-OLWUS7PC.js";import{d as H}from"./chunk-GKDGNPBD.js";import{b as L}from"./chunk-5KMEUZWN.js";import{a as W}from"./chunk-QPRUTOLI.js";import{b as y,c as K}from"./chunk-OLTRWCQK.js";import{a as ue}from"./chunk-VQPANPMI.js";var fe={};ue(fe,{Group:()=>oe,GroupContent:()=>ie,GroupLabel:()=>ae,Menu:()=>Y,MenuButton:()=>T,MenuItem:()=>D,MenuSub:()=>ee,MenuSubContent:()=>re,MenuSubTrigger:()=>te,Search:()=>se,Separator:()=>Q});import*as e from"react";import d from"classnames";import*as f from"@radix-ui/react-accordion";var Q=e.forwardRef(({className:t,...r},n)=>e.createElement(F,{...r,ref:n,className:d("kui-SidebarSeparator",t)}));Q.displayName="Sidebar.Separator";var Y=e.forwardRef(({className:t,...r},n)=>e.createElement("ul",{...r,ref:n,className:d("kui-SidebarMenu",t)}));Y.displayName="Sidebar.Menu";var D=e.forwardRef(({className:t,...r},n)=>e.createElement("li",{...r,ref:n,className:d("kui-SidebarMenuItem",t)}));D.displayName="Sidebar.MenuItem";function A(t){if(typeof t=="function"){let r=t;return r.displayName||r.name}if(t&&typeof t=="object"){let r=t;return r.displayName||A(r.render)||A(r.type)}}function ce(t){return t.type==="svg"||t.props?.icon?!0:A(t.type)?.includes("Icon")??!1}function Z(t){return typeof t=="string"||typeof t=="number"}function de(t){let r=e.Children.toArray(t),n=[],o=[];for(let a of r)e.isValidElement(a)&&ce(a)?n.push(a):o.push(Z(a)?e.createElement("span",{key:o.length,className:"kui-SidebarMenuLabel"},a):a);return n.length===0&&r.length>1&&e.isValidElement(r[0])&&(n.push(r[0]),o.shift()),{icons:n,labels:o}}function pe(t){return e.Children.map(t,r=>Z(r)?e.createElement("span",{className:"kui-SidebarMenuLabel"},r):r)}function _(t){if(t.key!=="ArrowDown"&&t.key!=="ArrowUp")return;let r=t.currentTarget.closest(".kui-SidebarContent, .kui-SidebarSearchPopover"),n=r?Array.from(r.querySelectorAll(".kui-SidebarMenuButton")).filter(u=>u.offsetParent!==null):[],o=n.indexOf(t.currentTarget),a=n[o+(t.key==="ArrowDown"?1:-1)];o!==-1&&a&&(t.preventDefault(),a.focus())}var T=e.forwardRef(({asChild:t=!1,isActive:r=!1,shortcut:n,badge:o,className:a,children:u,onKeyDown:p,...s},l)=>{let c=y(),k=e.useContext(K),g=c?.size??k,M=c?.presentation==="thin",N=t?L:"button",P=i=>{p?.(i),i.defaultPrevented||_(i)},m=M?null:e.createElement(e.Fragment,null,o&&e.createElement("div",{className:"kui-SidebarMenuBadge"},typeof o=="string"?e.createElement(E,{size:g,variant:"soft"},o):e.createElement(E,{size:o.size||g,variant:o.variant||"soft",color:o.color,radius:o.radius},o.content)),n&&e.createElement("div",{className:"kui-BaseMenuShortcut kui-SidebarMenuShortcut"},e.createElement(W,{size:g},n))),h=i=>{if(M){let{icons:v,labels:w}=de(i);if(v.length>0)return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},v),w)}return e.createElement(e.Fragment,null,pe(i),m)},S;return t&&e.isValidElement(u)&&e.Children.count(u)===1?S=e.cloneElement(u,void 0,h(u.props.children)):t?S=u:S=h(u),e.createElement(N,{type:t?void 0:"button",...s,ref:l,"aria-current":r?"page":void 0,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton",a),"data-active":r||void 0,onKeyDown:P},S)});T.displayName="Sidebar.MenuButton";var x=e.createContext("accordion"),ee=e.forwardRef(({defaultOpen:t=!1,children:r,...n},o)=>(y()?.presentation==="thin"?"dropdown":"accordion")==="dropdown"?e.createElement("div",{...n,ref:o},e.createElement(O,null,e.createElement(x.Provider,{value:"dropdown"},r))):e.createElement("div",{...n,ref:o},e.createElement(x.Provider,{value:"accordion"},e.createElement(f.Root,{type:"single",collapsible:!0,defaultValue:t?"item":void 0},e.createElement(f.Item,{value:"item"},r)))));ee.displayName="Sidebar.MenuSub";var te=e.forwardRef(({asChild:t=!1,className:r,children:n,onKeyDown:o,...a},u)=>e.useContext(x)==="dropdown"?e.createElement(U,null,e.createElement("button",{...a,onKeyDown:o,ref:u,type:"button","aria-haspopup":"menu",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},n)):e.createElement(f.Header,{asChild:!0},e.createElement("div",null,e.createElement(f.Trigger,{...a,onKeyDown:s=>{_(s),o?.(s)},ref:u,asChild:t,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},t?n:e.createElement(e.Fragment,null,n,e.createElement(H,{className:d("kui-BaseMenuSubTriggerIcon","kui-SidebarMenuSubTriggerIcon")}))))));te.displayName="Sidebar.MenuSubTrigger";function X(t,r){if(e.isValidElement(t)&&t.type===T){let{asChild:n,isActive:o,shortcut:a,badge:u,type:p,children:s,...l}=t.props,c={...l,"data-active":o||void 0,"aria-current":o?"page":void 0};return n&&e.isValidElement(s)&&e.Children.count(s)===1?e.createElement(C,{key:r,...c,asChild:!0},s):e.createElement(C,{key:r,...c},s)}return e.isValidElement(t)?e.createElement(C,{key:r,asChild:!0},t):e.createElement(C,{key:r},t)}function le(t){return e.Children.map(t,(r,n)=>e.isValidElement(r)&&r.type===T?e.createElement(D,{key:r.key??n},r):r)}var re=e.forwardRef(({className:t,children:r,...n},o)=>{let a=y();if(e.useContext(x)==="dropdown"){let p=e.Children.map(r,(s,l)=>{if(e.isValidElement(s)&&s.type===D){let c=e.Children.toArray(s.props.children);return X(c.length===1?c[0]:c,l)}return X(s,l)});return e.createElement(q,{...n,ref:o,size:a?.size,className:d(t)},e.createElement($,null,p))}return e.createElement(f.Content,{...n,ref:o,className:d("kui-SidebarMenuSubContent",t)},e.createElement("ul",{className:"kui-SidebarMenuSubList"},le(r)))});re.displayName="Sidebar.MenuSubContent";var ne=e.createContext(null),oe=e.forwardRef(({className:t,...r},n)=>{let o=e.useId(),[a,u]=e.useState(null),p=e.useMemo(()=>({labelId:o,setLabelId:u}),[o]);return e.createElement(ne.Provider,{value:p},e.createElement("div",{role:a?"group":void 0,"aria-labelledby":a??void 0,...r,ref:n,className:d("kui-BaseMenuGroup","kui-SidebarGroup",t)}))});oe.displayName="Sidebar.Group";var ae=e.forwardRef(({asChild:t=!1,className:r,id:n,...o},a)=>{let u=t?L:"div",p=e.useContext(ne),s=n??p?.labelId,l=p?.setLabelId;return e.useEffect(()=>{if(!(!l||!s))return l(s),()=>l(null)},[l,s]),e.createElement(u,{...o,id:s,ref:a,className:d("kui-BaseMenuLabel","kui-SidebarGroupLabel",r)})});ae.displayName="Sidebar.GroupLabel";var ie=e.forwardRef(({className:t,...r},n)=>e.createElement("div",{...r,ref:n,className:d("kui-SidebarGroupContent",t)}));ie.displayName="Sidebar.GroupContent";var B=({className:t})=>e.createElement("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("circle",{cx:"11",cy:"11",r:"8"}),e.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),J=({className:t})=>e.createElement("svg",{className:t,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),se=e.forwardRef(({value:t,onValueChange:r,placeholder:n="Search...",children:o,className:a,...u},p)=>{let s=y(),l=s?.presentation==="thin",c=e.useRef(null),k=e.useRef(null),M=`${e.useId()}-results`,N=e.useRef(t);N.current=t;let P=e.useRef(r);P.current=r;let m=n.replace(/\.+$/,""),h=e.useCallback(i=>{i.key==="Escape"&&N.current&&(i.preventDefault(),i.stopPropagation(),P.current(""),c.current?.focus())},[]),S=e.useCallback(i=>{if(i.defaultPrevented)return;let v=k.current;if(!v)return;let w=v.querySelector('[role="group"]');if(!w)return;let b=Array.from(w.querySelectorAll("a, button"));if(b.length===0)return;let G=document.activeElement,I=G===c.current,R=b.indexOf(G);if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&!I&&R!==-1){c.current?.focus();return}switch(i.key){case"ArrowDown":{i.preventDefault(),I||R===-1?b[0]?.focus():R<b.length-1&&b[R+1]?.focus();break}case"ArrowUp":{i.preventDefault(),R<=0?c.current?.focus():b[R-1]?.focus();break}case"Home":{I||(i.preventDefault(),b[0]?.focus());break}case"End":{I||(i.preventDefault(),b[b.length-1]?.focus());break}}},[]);return l?e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--thin",a)},e.createElement(z,null,e.createElement(V,null,e.createElement("button",{type:"button",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarSearchTrigger"),"aria-label":m},e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},e.createElement(B,null)),e.createElement("span",{className:"kui-SidebarMenuLabel"},"Search"))),e.createElement(j,{side:"right",align:"start",size:"2",width:"280px","aria-label":m},e.createElement("div",{ref:k,className:"kui-SidebarSearchPopover",role:"search",onKeyDown:S},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m,"aria-controls":o?M:void 0,autoFocus:!0}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))),o&&e.createElement("div",{id:M,role:"group","aria-label":"Search results"},o))))):e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--expanded","kui-ShellPaneChrome",`kui-r-size-${s?.size??"2"}`,a),role:"search"},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))))});se.displayName="Sidebar.Search";export{Q as a,Y as b,D as c,T as d,ee as e,te as f,re as g,oe as h,ae as i,ie as j,se as k,fe as l};
3
- //# sourceMappingURL=chunk-Q2TLWILH.js.map
2
+ import{a as F}from"./chunk-324VC67W.js";import{a as O,b as U,c as q,e as C,f as $}from"./chunk-67UEMB4K.js";import{a as E}from"./chunk-J54GYD7A.js";import{a as z,b as V,c as j}from"./chunk-MJKVVGGV.js";import{d as H}from"./chunk-GKDGNPBD.js";import{b as L}from"./chunk-5KMEUZWN.js";import{a as W}from"./chunk-QPRUTOLI.js";import{b as y,c as K}from"./chunk-MJROOEPE.js";import{a as ue}from"./chunk-VQPANPMI.js";var fe={};ue(fe,{Group:()=>oe,GroupContent:()=>ie,GroupLabel:()=>ae,Menu:()=>Y,MenuButton:()=>T,MenuItem:()=>D,MenuSub:()=>ee,MenuSubContent:()=>re,MenuSubTrigger:()=>te,Search:()=>se,Separator:()=>Q});import*as e from"react";import d from"classnames";import*as f from"@radix-ui/react-accordion";var Q=e.forwardRef(({className:t,...r},n)=>e.createElement(F,{...r,ref:n,className:d("kui-SidebarSeparator",t)}));Q.displayName="Sidebar.Separator";var Y=e.forwardRef(({className:t,...r},n)=>e.createElement("ul",{...r,ref:n,className:d("kui-SidebarMenu",t)}));Y.displayName="Sidebar.Menu";var D=e.forwardRef(({className:t,...r},n)=>e.createElement("li",{...r,ref:n,className:d("kui-SidebarMenuItem",t)}));D.displayName="Sidebar.MenuItem";function A(t){if(typeof t=="function"){let r=t;return r.displayName||r.name}if(t&&typeof t=="object"){let r=t;return r.displayName||A(r.render)||A(r.type)}}function ce(t){return t.type==="svg"||t.props?.icon?!0:A(t.type)?.includes("Icon")??!1}function Z(t){return typeof t=="string"||typeof t=="number"}function de(t){let r=e.Children.toArray(t),n=[],o=[];for(let a of r)e.isValidElement(a)&&ce(a)?n.push(a):o.push(Z(a)?e.createElement("span",{key:o.length,className:"kui-SidebarMenuLabel"},a):a);return n.length===0&&r.length>1&&e.isValidElement(r[0])&&(n.push(r[0]),o.shift()),{icons:n,labels:o}}function pe(t){return e.Children.map(t,r=>Z(r)?e.createElement("span",{className:"kui-SidebarMenuLabel"},r):r)}function _(t){if(t.key!=="ArrowDown"&&t.key!=="ArrowUp")return;let r=t.currentTarget.closest(".kui-SidebarContent, .kui-SidebarSearchPopover"),n=r?Array.from(r.querySelectorAll(".kui-SidebarMenuButton")).filter(u=>u.offsetParent!==null):[],o=n.indexOf(t.currentTarget),a=n[o+(t.key==="ArrowDown"?1:-1)];o!==-1&&a&&(t.preventDefault(),a.focus())}var T=e.forwardRef(({asChild:t=!1,isActive:r=!1,shortcut:n,badge:o,className:a,children:u,onKeyDown:p,...s},l)=>{let c=y(),k=e.useContext(K),g=c?.size??k,M=c?.presentation==="thin",N=t?L:"button",P=i=>{p?.(i),i.defaultPrevented||_(i)},m=M?null:e.createElement(e.Fragment,null,o&&e.createElement("div",{className:"kui-SidebarMenuBadge"},typeof o=="string"?e.createElement(E,{size:g,variant:"soft"},o):e.createElement(E,{size:o.size||g,variant:o.variant||"soft",color:o.color,radius:o.radius},o.content)),n&&e.createElement("div",{className:"kui-BaseMenuShortcut kui-SidebarMenuShortcut"},e.createElement(W,{size:g},n))),h=i=>{if(M){let{icons:v,labels:w}=de(i);if(v.length>0)return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},v),w)}return e.createElement(e.Fragment,null,pe(i),m)},S;return t&&e.isValidElement(u)&&e.Children.count(u)===1?S=e.cloneElement(u,void 0,h(u.props.children)):t?S=u:S=h(u),e.createElement(N,{type:t?void 0:"button",...s,ref:l,"aria-current":r?"page":void 0,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton",a),"data-active":r||void 0,onKeyDown:P},S)});T.displayName="Sidebar.MenuButton";var x=e.createContext("accordion"),ee=e.forwardRef(({defaultOpen:t=!1,children:r,...n},o)=>(y()?.presentation==="thin"?"dropdown":"accordion")==="dropdown"?e.createElement("div",{...n,ref:o},e.createElement(O,null,e.createElement(x.Provider,{value:"dropdown"},r))):e.createElement("div",{...n,ref:o},e.createElement(x.Provider,{value:"accordion"},e.createElement(f.Root,{type:"single",collapsible:!0,defaultValue:t?"item":void 0},e.createElement(f.Item,{value:"item"},r)))));ee.displayName="Sidebar.MenuSub";var te=e.forwardRef(({asChild:t=!1,className:r,children:n,onKeyDown:o,...a},u)=>e.useContext(x)==="dropdown"?e.createElement(U,null,e.createElement("button",{...a,onKeyDown:o,ref:u,type:"button","aria-haspopup":"menu",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},n)):e.createElement(f.Header,{asChild:!0},e.createElement("div",null,e.createElement(f.Trigger,{...a,onKeyDown:s=>{_(s),o?.(s)},ref:u,asChild:t,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},t?n:e.createElement(e.Fragment,null,n,e.createElement(H,{className:d("kui-BaseMenuSubTriggerIcon","kui-SidebarMenuSubTriggerIcon")}))))));te.displayName="Sidebar.MenuSubTrigger";function X(t,r){if(e.isValidElement(t)&&t.type===T){let{asChild:n,isActive:o,shortcut:a,badge:u,type:p,children:s,...l}=t.props,c={...l,"data-active":o||void 0,"aria-current":o?"page":void 0};return n&&e.isValidElement(s)&&e.Children.count(s)===1?e.createElement(C,{key:r,...c,asChild:!0},s):e.createElement(C,{key:r,...c},s)}return e.isValidElement(t)?e.createElement(C,{key:r,asChild:!0},t):e.createElement(C,{key:r},t)}function le(t){return e.Children.map(t,(r,n)=>e.isValidElement(r)&&r.type===T?e.createElement(D,{key:r.key??n},r):r)}var re=e.forwardRef(({className:t,children:r,...n},o)=>{let a=y();if(e.useContext(x)==="dropdown"){let p=e.Children.map(r,(s,l)=>{if(e.isValidElement(s)&&s.type===D){let c=e.Children.toArray(s.props.children);return X(c.length===1?c[0]:c,l)}return X(s,l)});return e.createElement(q,{...n,ref:o,size:a?.size,className:d(t)},e.createElement($,null,p))}return e.createElement(f.Content,{...n,ref:o,className:d("kui-SidebarMenuSubContent",t)},e.createElement("ul",{className:"kui-SidebarMenuSubList"},le(r)))});re.displayName="Sidebar.MenuSubContent";var ne=e.createContext(null),oe=e.forwardRef(({className:t,...r},n)=>{let o=e.useId(),[a,u]=e.useState(null),p=e.useMemo(()=>({labelId:o,setLabelId:u}),[o]);return e.createElement(ne.Provider,{value:p},e.createElement("div",{role:a?"group":void 0,"aria-labelledby":a??void 0,...r,ref:n,className:d("kui-BaseMenuGroup","kui-SidebarGroup",t)}))});oe.displayName="Sidebar.Group";var ae=e.forwardRef(({asChild:t=!1,className:r,id:n,...o},a)=>{let u=t?L:"div",p=e.useContext(ne),s=n??p?.labelId,l=p?.setLabelId;return e.useEffect(()=>{if(!(!l||!s))return l(s),()=>l(null)},[l,s]),e.createElement(u,{...o,id:s,ref:a,className:d("kui-BaseMenuLabel","kui-SidebarGroupLabel",r)})});ae.displayName="Sidebar.GroupLabel";var ie=e.forwardRef(({className:t,...r},n)=>e.createElement("div",{...r,ref:n,className:d("kui-SidebarGroupContent",t)}));ie.displayName="Sidebar.GroupContent";var B=({className:t})=>e.createElement("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("circle",{cx:"11",cy:"11",r:"8"}),e.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),J=({className:t})=>e.createElement("svg",{className:t,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),se=e.forwardRef(({value:t,onValueChange:r,placeholder:n="Search...",children:o,className:a,...u},p)=>{let s=y(),l=s?.presentation==="thin",c=e.useRef(null),k=e.useRef(null),M=`${e.useId()}-results`,N=e.useRef(t);N.current=t;let P=e.useRef(r);P.current=r;let m=n.replace(/\.+$/,""),h=e.useCallback(i=>{i.key==="Escape"&&N.current&&(i.preventDefault(),i.stopPropagation(),P.current(""),c.current?.focus())},[]),S=e.useCallback(i=>{if(i.defaultPrevented)return;let v=k.current;if(!v)return;let w=v.querySelector('[role="group"]');if(!w)return;let b=Array.from(w.querySelectorAll("a, button"));if(b.length===0)return;let G=document.activeElement,I=G===c.current,R=b.indexOf(G);if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&!I&&R!==-1){c.current?.focus();return}switch(i.key){case"ArrowDown":{i.preventDefault(),I||R===-1?b[0]?.focus():R<b.length-1&&b[R+1]?.focus();break}case"ArrowUp":{i.preventDefault(),R<=0?c.current?.focus():b[R-1]?.focus();break}case"Home":{I||(i.preventDefault(),b[0]?.focus());break}case"End":{I||(i.preventDefault(),b[b.length-1]?.focus());break}}},[]);return l?e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--thin",a)},e.createElement(z,null,e.createElement(V,null,e.createElement("button",{type:"button",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarSearchTrigger"),"aria-label":m},e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},e.createElement(B,null)),e.createElement("span",{className:"kui-SidebarMenuLabel"},"Search"))),e.createElement(j,{side:"right",align:"start",size:"2",width:"280px","aria-label":m},e.createElement("div",{ref:k,className:"kui-SidebarSearchPopover",role:"search",onKeyDown:S},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m,"aria-controls":o?M:void 0,autoFocus:!0}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))),o&&e.createElement("div",{id:M,role:"group","aria-label":"Search results"},o))))):e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--expanded","kui-ShellPaneChrome",`kui-r-size-${s?.size??"2"}`,a),role:"search"},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))))});se.displayName="Sidebar.Search";export{Q as a,Y as b,D as c,T as d,ee as e,te as f,re as g,oe as h,ae as i,ie as j,se as k,fe as l};
3
+ //# sourceMappingURL=chunk-2FYUM6TA.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{b as C,c as T,d as N,e as G}from"./chunk-2ACVWLFA.js";import{a as F}from"./chunk-TGRHRMQI.js";import{b as z,d as L,f as O}from"./chunk-GKDGNPBD.js";import{c as h,e as V,g as S,h as k,i as A}from"./chunk-ISCZ57VL.js";import{b,c as R,d as I,e as v}from"./chunk-EB4AG3OL.js";import{a as y}from"./chunk-MGWGD6KI.js";import{c as f}from"./chunk-OKQAVYW4.js";import{a as g}from"./chunk-T2DZDW5Y.js";import{b as j}from"./chunk-YOZXIUZY.js";import{c as W}from"./chunk-5ON3XLRD.js";import{a as ne}from"./chunk-VQPANPMI.js";var ae={};ne(ae,{CheckboxItem:()=>Y,Content:()=>K,Group:()=>J,Item:()=>H,Label:()=>U,RadioGroup:()=>Q,RadioItem:()=>X,Root:()=>_,Separator:()=>te,Sub:()=>Z,SubContent:()=>ee,SubTrigger:()=>$,Trigger:()=>q});import*as e from"react";import s from"classnames";import{ContextMenu as i,Slot as B}from"radix-ui";import{useCallbackRef as re}from"radix-ui/internal";var _=t=>{let{open:r,onOpenChange:n}=t,[a,o]=e.useState(!1),u=r??a,p=re(n),c=e.useCallback(l=>{o(l),p(l)},[p]),m=e.useCallback(()=>c(!1),[c]);return e.createElement(V,{value:m},e.createElement(i.Root,{...t,open:u,onOpenChange:c}))};_.displayName="ContextMenu.Root";var q=e.forwardRef(({children:t,...r},n)=>e.createElement(i.Trigger,{...r,ref:n,asChild:!0},F(t)));q.displayName="ContextMenu.Trigger";var E=e.createContext({}),K=e.forwardRef((t,r)=>{let n=W(t,C.size),a=j(),{size:o=C.size.default}=n,{className:u,children:p,color:c,container:m,forceMount:l,submenuBehavior:w,virtualized:d=!1,...P}=f(n,C),x=c||a.accentColor,M=b(o,C.size.default),oe=e.useMemo(()=>({size:o,color:x}),[o,x]),D=e.createElement(h,{size:o},e.createElement(E.Provider,{value:oe},p));return e.createElement(i.Portal,{container:m,forceMount:l},e.createElement(g,{asChild:!0},e.createElement(i.Content,{"data-accent-color":x,alignOffset:R(M),collisionPadding:10,...P,asChild:!1,ref:r,className:s("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-ContextMenuContent",u)},d?e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport","kui-virtualized")},D):e.createElement(y,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport")},D)))))});K.displayName="ContextMenu.Content";var U=e.forwardRef(({className:t,id:r,...n},a)=>{let o=A(r);return e.createElement(i.Label,{...n,id:o,asChild:!1,ref:a,className:s("kui-BaseMenuLabel","kui-ContextMenuLabel",t)})});U.displayName="ContextMenu.Label";var H=e.forwardRef((t,r)=>{let{className:n,children:a,color:o=T.color.default,shortcut:u,...p}=t;return e.createElement(i.Item,{"data-accent-color":o,"aria-keyshortcuts":u?I(u):void 0,...p,ref:r,className:s("kui-reset","kui-BaseMenuItem","kui-ContextMenuItem",n)},e.createElement(B.Slottable,null,a),u&&e.createElement(v,{shortcut:u,className:"kui-ContextMenuShortcut"}))});H.displayName="ContextMenu.Item";var J=e.forwardRef(({className:t,"aria-labelledby":r,...n},a)=>{let[o,u]=k(r);return e.createElement(S,{value:u},e.createElement(i.Group,{"aria-labelledby":o,...n,asChild:!1,ref:a,className:s("kui-BaseMenuGroup","kui-ContextMenuGroup",t)}))});J.displayName="ContextMenu.Group";var Q=e.forwardRef(({className:t,"aria-labelledby":r,...n},a)=>{let[o,u]=k(r);return e.createElement(S,{value:u},e.createElement(i.RadioGroup,{"aria-labelledby":o,...n,asChild:!1,ref:a,className:s("kui-BaseMenuRadioGroup","kui-ContextMenuRadioGroup",t)}))});Q.displayName="ContextMenu.RadioGroup";var X=e.forwardRef((t,r)=>{let{children:n,className:a,color:o=G.color.default,...u}=t;return e.createElement(i.RadioItem,{...u,asChild:!1,ref:r,"data-accent-color":o,className:s("kui-BaseMenuItem","kui-BaseMenuRadioItem","kui-ContextMenuItem","kui-ContextMenuRadioItem",a)},e.createElement(B.Slottable,null,n),e.createElement(i.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator"},e.createElement(O,{className:"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon"})))});X.displayName="ContextMenu.RadioItem";var Y=e.forwardRef((t,r)=>{let{children:n,className:a,shortcut:o,color:u=N.color.default,...p}=t;return e.createElement(i.CheckboxItem,{"aria-keyshortcuts":o?I(o):void 0,...p,asChild:!1,ref:r,"data-accent-color":u,className:s("kui-BaseMenuItem","kui-BaseMenuCheckboxItem","kui-ContextMenuItem","kui-ContextMenuCheckboxItem",a)},e.createElement(B.Slottable,null,n),e.createElement(i.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator"},e.createElement(z,{className:"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon"})),o&&e.createElement(v,{shortcut:o,className:"kui-ContextMenuShortcut"}))});Y.displayName="ContextMenu.CheckboxItem";var Z=t=>e.createElement(i.Sub,{...t});Z.displayName="ContextMenu.Sub";var $=e.forwardRef((t,r)=>{let{className:n,children:a,...o}=t;return e.createElement(i.SubTrigger,{...o,asChild:!1,ref:r,className:s("kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-ContextMenuItem","kui-ContextMenuSubTrigger",n)},a,e.createElement("div",{className:"kui-BaseMenuShortcut kui-ContextMenuShortcut"},e.createElement(L,{className:"kui-BaseMenuSubTriggerIcon kui-ContextMenuSubTriggerIcon"})))});$.displayName="ContextMenu.SubTrigger";var ee=e.forwardRef((t,r)=>{let n=e.useContext(E),a=t.size??n.size,o=t.color??n.color,{className:u,children:p,container:c,forceMount:m,color:l,virtualized:w=!1,...d}=f({...t,size:a},C),P=b(a,C.size.default),x=e.useMemo(()=>({size:a,color:o}),[a,o]),M=e.createElement(h,{size:a},e.createElement(E.Provider,{value:x},p));return e.createElement(i.Portal,{container:c,forceMount:m},e.createElement(g,{asChild:!0},e.createElement(i.SubContent,{"data-accent-color":o,alignOffset:R(P),sideOffset:1,collisionPadding:10,...d,asChild:!1,ref:r,className:s("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-BaseMenuSubContent","kui-ContextMenuContent","kui-ContextMenuSubContent",u)},w?e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport","kui-virtualized")},M):e.createElement(y,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport")},M)))))});ee.displayName="ContextMenu.SubContent";var te=e.forwardRef(({className:t,...r},n)=>e.createElement(i.Separator,{...r,asChild:!1,ref:n,className:s("kui-BaseMenuSeparator","kui-ContextMenuSeparator",t)}));te.displayName="ContextMenu.Separator";export{_ as a,q as b,K as c,U as d,H as e,J as f,Q as g,X as h,Y as i,Z as j,$ as k,ee as l,te as m,ae as n};
3
- //# sourceMappingURL=chunk-W3ES2XSB.js.map
2
+ import{b as C,c as T,d as N,e as G}from"./chunk-2ACVWLFA.js";import{a as F}from"./chunk-TGRHRMQI.js";import{b as z,d as L,f as O}from"./chunk-GKDGNPBD.js";import{c as h,e as V,g as S,h as k,i as A}from"./chunk-ISCZ57VL.js";import{b,c as R,d as I,e as v}from"./chunk-EB4AG3OL.js";import{a as y}from"./chunk-MGWGD6KI.js";import{c as f}from"./chunk-OKQAVYW4.js";import{a as g}from"./chunk-AQKSO3SW.js";import{b as j}from"./chunk-FVRVBB6O.js";import{c as W}from"./chunk-5ON3XLRD.js";import{a as ne}from"./chunk-VQPANPMI.js";var ae={};ne(ae,{CheckboxItem:()=>Y,Content:()=>K,Group:()=>J,Item:()=>H,Label:()=>U,RadioGroup:()=>Q,RadioItem:()=>X,Root:()=>_,Separator:()=>te,Sub:()=>Z,SubContent:()=>ee,SubTrigger:()=>$,Trigger:()=>q});import*as e from"react";import s from"classnames";import{ContextMenu as i,Slot as B}from"radix-ui";import{useCallbackRef as re}from"radix-ui/internal";var _=t=>{let{open:r,onOpenChange:n}=t,[a,o]=e.useState(!1),u=r??a,p=re(n),c=e.useCallback(l=>{o(l),p(l)},[p]),m=e.useCallback(()=>c(!1),[c]);return e.createElement(V,{value:m},e.createElement(i.Root,{...t,open:u,onOpenChange:c}))};_.displayName="ContextMenu.Root";var q=e.forwardRef(({children:t,...r},n)=>e.createElement(i.Trigger,{...r,ref:n,asChild:!0},F(t)));q.displayName="ContextMenu.Trigger";var E=e.createContext({}),K=e.forwardRef((t,r)=>{let n=W(t,C.size),a=j(),{size:o=C.size.default}=n,{className:u,children:p,color:c,container:m,forceMount:l,submenuBehavior:w,virtualized:d=!1,...P}=f(n,C),x=c||a.accentColor,M=b(o,C.size.default),oe=e.useMemo(()=>({size:o,color:x}),[o,x]),D=e.createElement(h,{size:o},e.createElement(E.Provider,{value:oe},p));return e.createElement(i.Portal,{container:m,forceMount:l},e.createElement(g,{asChild:!0},e.createElement(i.Content,{"data-accent-color":x,alignOffset:R(M),collisionPadding:10,...P,asChild:!1,ref:r,className:s("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-ContextMenuContent",u)},d?e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport","kui-virtualized")},D):e.createElement(y,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport")},D)))))});K.displayName="ContextMenu.Content";var U=e.forwardRef(({className:t,id:r,...n},a)=>{let o=A(r);return e.createElement(i.Label,{...n,id:o,asChild:!1,ref:a,className:s("kui-BaseMenuLabel","kui-ContextMenuLabel",t)})});U.displayName="ContextMenu.Label";var H=e.forwardRef((t,r)=>{let{className:n,children:a,color:o=T.color.default,shortcut:u,...p}=t;return e.createElement(i.Item,{"data-accent-color":o,"aria-keyshortcuts":u?I(u):void 0,...p,ref:r,className:s("kui-reset","kui-BaseMenuItem","kui-ContextMenuItem",n)},e.createElement(B.Slottable,null,a),u&&e.createElement(v,{shortcut:u,className:"kui-ContextMenuShortcut"}))});H.displayName="ContextMenu.Item";var J=e.forwardRef(({className:t,"aria-labelledby":r,...n},a)=>{let[o,u]=k(r);return e.createElement(S,{value:u},e.createElement(i.Group,{"aria-labelledby":o,...n,asChild:!1,ref:a,className:s("kui-BaseMenuGroup","kui-ContextMenuGroup",t)}))});J.displayName="ContextMenu.Group";var Q=e.forwardRef(({className:t,"aria-labelledby":r,...n},a)=>{let[o,u]=k(r);return e.createElement(S,{value:u},e.createElement(i.RadioGroup,{"aria-labelledby":o,...n,asChild:!1,ref:a,className:s("kui-BaseMenuRadioGroup","kui-ContextMenuRadioGroup",t)}))});Q.displayName="ContextMenu.RadioGroup";var X=e.forwardRef((t,r)=>{let{children:n,className:a,color:o=G.color.default,...u}=t;return e.createElement(i.RadioItem,{...u,asChild:!1,ref:r,"data-accent-color":o,className:s("kui-BaseMenuItem","kui-BaseMenuRadioItem","kui-ContextMenuItem","kui-ContextMenuRadioItem",a)},e.createElement(B.Slottable,null,n),e.createElement(i.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator"},e.createElement(O,{className:"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon"})))});X.displayName="ContextMenu.RadioItem";var Y=e.forwardRef((t,r)=>{let{children:n,className:a,shortcut:o,color:u=N.color.default,...p}=t;return e.createElement(i.CheckboxItem,{"aria-keyshortcuts":o?I(o):void 0,...p,asChild:!1,ref:r,"data-accent-color":u,className:s("kui-BaseMenuItem","kui-BaseMenuCheckboxItem","kui-ContextMenuItem","kui-ContextMenuCheckboxItem",a)},e.createElement(B.Slottable,null,n),e.createElement(i.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator"},e.createElement(z,{className:"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon"})),o&&e.createElement(v,{shortcut:o,className:"kui-ContextMenuShortcut"}))});Y.displayName="ContextMenu.CheckboxItem";var Z=t=>e.createElement(i.Sub,{...t});Z.displayName="ContextMenu.Sub";var $=e.forwardRef((t,r)=>{let{className:n,children:a,...o}=t;return e.createElement(i.SubTrigger,{...o,asChild:!1,ref:r,className:s("kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-ContextMenuItem","kui-ContextMenuSubTrigger",n)},a,e.createElement("div",{className:"kui-BaseMenuShortcut kui-ContextMenuShortcut"},e.createElement(L,{className:"kui-BaseMenuSubTriggerIcon kui-ContextMenuSubTriggerIcon"})))});$.displayName="ContextMenu.SubTrigger";var ee=e.forwardRef((t,r)=>{let n=e.useContext(E),a=t.size??n.size,o=t.color??n.color,{className:u,children:p,container:c,forceMount:m,color:l,virtualized:w=!1,...d}=f({...t,size:a},C),P=b(a,C.size.default),x=e.useMemo(()=>({size:a,color:o}),[a,o]),M=e.createElement(h,{size:a},e.createElement(E.Provider,{value:x},p));return e.createElement(i.Portal,{container:c,forceMount:m},e.createElement(g,{asChild:!0},e.createElement(i.SubContent,{"data-accent-color":o,alignOffset:R(P),sideOffset:1,collisionPadding:10,...d,asChild:!1,ref:r,className:s("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-BaseMenuSubContent","kui-ContextMenuContent","kui-ContextMenuSubContent",u)},w?e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport","kui-virtualized")},M):e.createElement(y,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport")},M)))))});ee.displayName="ContextMenu.SubContent";var te=e.forwardRef(({className:t,...r},n)=>e.createElement(i.Separator,{...r,asChild:!1,ref:n,className:s("kui-BaseMenuSeparator","kui-ContextMenuSeparator",t)}));te.displayName="ContextMenu.Separator";export{_ as a,q as b,K as c,U as d,H as e,J as f,Q as g,X as h,Y as i,Z as j,$ as k,ee as l,te as m,ae as n};
3
+ //# sourceMappingURL=chunk-2S7HPQVX.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as W}from"./chunk-BUXK5VGR.js";import{a as F}from"./chunk-KVVRFWGQ.js";import{k as _}from"./chunk-GKDGNPBD.js";import{c as j}from"./chunk-OKQAVYW4.js";import{d as z}from"./chunk-HBWBPBSA.js";import{c as A}from"./chunk-5ON3XLRD.js";import{b as H}from"./chunk-XU74PNM2.js";import{a as V}from"./chunk-CLJ6SEGP.js";import*as e from"react";import le from"classnames";import{Slot as de}from"radix-ui";import{useComposedRefs as pe,useLayoutEffect as ue}from"radix-ui/internal";var ie=["1","2","3","4"],ce=["raised","solid","soft","surface","outline","ghost"],C={...V,size:{type:"enum",className:"kui-r-size",values:ie,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:ce,default:"solid"},...z,...H,loading:{type:"boolean",className:"kui-loading",default:!1},fullWidth:{type:"boolean",className:"kui-full-width",default:!1}};var me=e.forwardRef((i,n)=>{let a=A(i,C.size),{className:T,children:o,asChild:s,as:R,color:X,radius:q,disabled:y,done:b=!1,...u}=j(a,C),p=!!a.loading,D=a.loading!==void 0,m=!!y||p,{onClick:v,"aria-describedby":M}=u,K=e.useCallback(t=>{if(m){t.preventDefault();return}v?.(t)},[m,v]),Q=e.useMemo(()=>{let t=s&&e.isValidElement(o)?o.props.children:o,c=k(t),l=r=>e.isValidElement(r)&&(r.type==="svg"||typeof r.type!="string"&&r.type!==e.Fragment&&!fe.has(P(r.type)));return{iconStart:l(c[0]),iconEnd:l(c[c.length-1])}},[s,o]),[E,$]=e.useState(null),S=e.useRef(null),J=pe(n,S);ue(()=>{let t=S.current;if(!t||p||b)return;let c=t.querySelector(":scope > .kui-BaseButtonContent")??t,l=G(c,"start"),r=G(c,"end");$(d=>d&&d.iconStart===l&&d.iconEnd===r?d:{iconStart:l,iconEnd:r})});let{iconStart:h,iconEnd:U}=E??Q,x=!!u["data-icon-only"],f=e.useMemo(()=>{if(!b)return o;let t=e.createElement(_,{key:"kui-done-tick",className:"kui-BaseButtonTick","aria-hidden":!0}),c=l=>{if(x)return t;let r=k(l),d=r.findIndex(B=>!(typeof B=="string"&&!B.trim())),I=r[d];return d!==-1&&h&&(E!==null||e.isValidElement(I)&&I.type==="svg")?r.map((B,re)=>re===d?t:B):[t,...r]};if(s&&e.isValidElement(o)){let l=o;return e.cloneElement(l,void 0,c(l.props.children))}return c(o)},[b,o,x,h,E,s]),Y=s?de.Root:R||"button",Z=["button","input","textarea","select"],w=s?e.isValidElement(o)?o.type:void 0:R||"button",N=typeof w=="string"&&Z.includes(w),{onClickCapture:L}=u,ee=e.useCallback(t=>{if(s&&m){t.preventDefault(),t.stopPropagation();return}L?.(t)},[s,m,L]),te=!s&&(!R||R==="button"),ne="type"in u,oe=e.useId(),g=p?`${oe}-loading`:void 0,ae=e.useMemo(()=>p?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":[M,g].filter(Boolean).join(" ")}:y&&(!N||s)?{"aria-disabled":!0}:{},[p,g,M,y,N,s]),O=(t,c)=>D?e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-BaseButtonContent","aria-hidden":p||void 0},t),p?e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-sr-only"},e.createElement("span",{id:g,"aria-hidden":!0},"Loading"),c),e.createElement(F,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},e.createElement("span",null,e.createElement(W,{"aria-hidden":"true"})))):null):t,se=s&&D&&e.isValidElement(f)?e.cloneElement(f,void 0,O(f.props.children,e.isValidElement(o)?o.props.children:null)):f;return e.createElement(Y,{"data-accent-color":X,"data-radius":q,"data-icon-start":h||void 0,"data-icon-end":U||void 0,"data-done":b||void 0,...u,...ae,"data-disabled":m||void 0,onClick:K,onClickCapture:ee,ref:J,className:le("kui-reset","kui-BaseButton",T),...N&&{disabled:y},...te&&!ne?{type:"button"}:{}},s?se:O(f,o))});me.displayName="BaseButton";var fe=new Set(["Text","Kbd","Code","Link","Em","Strong","Quote","Badge","Trans"]);function P(i){if(!i||typeof i!="function"&&typeof i!="object")return"";let n=i;return n.displayName||n.name||P(n.render)||P(n.type)}function k(i){return e.Children.toArray(i).flatMap(n=>e.isValidElement(n)&&n.type===e.Fragment?k(n.props.children):[n])}function G(i,n){let a=n==="start"?i.firstChild:i.lastChild;for(;a&&(a.nodeType===Node.COMMENT_NODE||a.nodeType===Node.TEXT_NODE&&!a.textContent?.trim());)a=n==="start"?a.nextSibling:a.previousSibling;return a?.nodeType===Node.ELEMENT_NODE&&a.localName==="svg"}export{me as a};
3
- //# sourceMappingURL=chunk-27XQ5PN5.js.map
2
+ import{a as W}from"./chunk-BUXK5VGR.js";import{a as F}from"./chunk-KVVRFWGQ.js";import{k as _}from"./chunk-GKDGNPBD.js";import{c as j}from"./chunk-OKQAVYW4.js";import{c as A}from"./chunk-5ON3XLRD.js";import{d as z}from"./chunk-HBWBPBSA.js";import{b as H}from"./chunk-XU74PNM2.js";import{a as V}from"./chunk-CLJ6SEGP.js";import*as e from"react";import le from"classnames";import{Slot as de}from"radix-ui";import{useComposedRefs as pe,useLayoutEffect as ue}from"radix-ui/internal";var ie=["1","2","3","4"],ce=["raised","solid","soft","surface","outline","ghost"],C={...V,size:{type:"enum",className:"kui-r-size",values:ie,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:ce,default:"solid"},...z,...H,loading:{type:"boolean",className:"kui-loading",default:!1},fullWidth:{type:"boolean",className:"kui-full-width",default:!1}};var me=e.forwardRef((i,n)=>{let a=A(i,C.size),{className:T,children:o,asChild:s,as:R,color:X,radius:q,disabled:y,done:b=!1,...u}=j(a,C),p=!!a.loading,D=a.loading!==void 0,m=!!y||p,{onClick:v,"aria-describedby":M}=u,K=e.useCallback(t=>{if(m){t.preventDefault();return}v?.(t)},[m,v]),Q=e.useMemo(()=>{let t=s&&e.isValidElement(o)?o.props.children:o,c=k(t),l=r=>e.isValidElement(r)&&(r.type==="svg"||typeof r.type!="string"&&r.type!==e.Fragment&&!fe.has(P(r.type)));return{iconStart:l(c[0]),iconEnd:l(c[c.length-1])}},[s,o]),[E,$]=e.useState(null),S=e.useRef(null),J=pe(n,S);ue(()=>{let t=S.current;if(!t||p||b)return;let c=t.querySelector(":scope > .kui-BaseButtonContent")??t,l=G(c,"start"),r=G(c,"end");$(d=>d&&d.iconStart===l&&d.iconEnd===r?d:{iconStart:l,iconEnd:r})});let{iconStart:h,iconEnd:U}=E??Q,x=!!u["data-icon-only"],f=e.useMemo(()=>{if(!b)return o;let t=e.createElement(_,{key:"kui-done-tick",className:"kui-BaseButtonTick","aria-hidden":!0}),c=l=>{if(x)return t;let r=k(l),d=r.findIndex(B=>!(typeof B=="string"&&!B.trim())),I=r[d];return d!==-1&&h&&(E!==null||e.isValidElement(I)&&I.type==="svg")?r.map((B,re)=>re===d?t:B):[t,...r]};if(s&&e.isValidElement(o)){let l=o;return e.cloneElement(l,void 0,c(l.props.children))}return c(o)},[b,o,x,h,E,s]),Y=s?de.Root:R||"button",Z=["button","input","textarea","select"],w=s?e.isValidElement(o)?o.type:void 0:R||"button",N=typeof w=="string"&&Z.includes(w),{onClickCapture:L}=u,ee=e.useCallback(t=>{if(s&&m){t.preventDefault(),t.stopPropagation();return}L?.(t)},[s,m,L]),te=!s&&(!R||R==="button"),ne="type"in u,oe=e.useId(),g=p?`${oe}-loading`:void 0,ae=e.useMemo(()=>p?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":[M,g].filter(Boolean).join(" ")}:y&&(!N||s)?{"aria-disabled":!0}:{},[p,g,M,y,N,s]),O=(t,c)=>D?e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-BaseButtonContent","aria-hidden":p||void 0},t),p?e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-sr-only"},e.createElement("span",{id:g,"aria-hidden":!0},"Loading"),c),e.createElement(F,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},e.createElement("span",null,e.createElement(W,{"aria-hidden":"true"})))):null):t,se=s&&D&&e.isValidElement(f)?e.cloneElement(f,void 0,O(f.props.children,e.isValidElement(o)?o.props.children:null)):f;return e.createElement(Y,{"data-accent-color":X,"data-radius":q,"data-icon-start":h||void 0,"data-icon-end":U||void 0,"data-done":b||void 0,...u,...ae,"data-disabled":m||void 0,onClick:K,onClickCapture:ee,ref:J,className:le("kui-reset","kui-BaseButton",T),...N&&{disabled:y},...te&&!ne?{type:"button"}:{}},s?se:O(f,o))});me.displayName="BaseButton";var fe=new Set(["Text","Kbd","Code","Link","Em","Strong","Quote","Badge","Trans"]);function P(i){if(!i||typeof i!="function"&&typeof i!="object")return"";let n=i;return n.displayName||n.name||P(n.render)||P(n.type)}function k(i){return e.Children.toArray(i).flatMap(n=>e.isValidElement(n)&&n.type===e.Fragment?k(n.props.children):[n])}function G(i,n){let a=n==="start"?i.firstChild:i.lastChild;for(;a&&(a.nodeType===Node.COMMENT_NODE||a.nodeType===Node.TEXT_NODE&&!a.textContent?.trim());)a=n==="start"?a.nextSibling:a.previousSibling;return a?.nodeType===Node.ELEMENT_NODE&&a.localName==="svg"}export{me as a};
3
+ //# sourceMappingURL=chunk-2ZKEQS76.js.map
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as Ge,b as Ye}from"./chunk-4G3FJUER.js";import{a as Xe}from"./chunk-ZG2XQUOH.js";import{a as Ke}from"./chunk-YMUERC2J.js";import{a as je}from"./chunk-AS2STDGA.js";import{c as ue,d as pe,e as we,f as fe,i as Ae,j as Ie,k as Ne}from"./chunk-MJROOEPE.js";import{c as xe,d as ke}from"./chunk-QEDKL23P.js";import{b as Ee}from"./chunk-5ON3XLRD.js";import{a as Le}from"./chunk-ANQLWGFN.js";import{a as $e}from"./chunk-QRV32INS.js";import{a as Fe,b as me}from"./chunk-3QWGSRYC.js";import{a as Pe,b as he,c as ve}from"./chunk-LTUW36HM.js";import{a as De,b as Be,c as Ve}from"./chunk-QKCNGEX4.js";import{a as Oe}from"./chunk-WEBNIUEX.js";import{a as J,b as We,c as _e,d as Ue,g as qe}from"./chunk-XUCR7L4G.js";import{a as ye}from"./chunk-G66WDIIV.js";import{e as ie,f as Te,h as Me,i as ne,j as ze,k as ce,l as de,n as He,o as oe}from"./chunk-GHWEXMF6.js";import{a as st}from"./chunk-VQPANPMI.js";var Pt={};st(Pt,{Bottom:()=>$e,Content:()=>at,Header:()=>nt,Inspector:()=>Ke,Left:()=>ot,PaneFooter:()=>Ie,PaneHeader:()=>Ae,Panel:()=>Ce,Rail:()=>lt,Root:()=>tt,Scroll:()=>Ne,Sidebar:()=>je,Trigger:()=>rt,useResponsivePresentation:()=>Xe,useShell:()=>Ye,useSidebarMode:()=>Ge});import*as e from"react";import $ from"classnames";import{Slot as it}from"radix-ui";import{useComposedRefs as be,useLayoutEffect as ct}from"radix-ui/internal";var Re=0;function Je(a){Re=Math.max(0,Re+a);let r=document.documentElement;Re>0?r.setAttribute("data-kui-shell-lock",""):r.removeAttribute("data-kui-shell-lock")}var Se="data-kui-shell-inert",dt=30;function Q(a,r){return r===null||r===a||r===a.body||r===a.documentElement}function Qe(a,r,s){for(let u of a.querySelectorAll("[data-shell-trigger][aria-controls]"))if(!(u.getAttribute("aria-controls")!==r||u.closest("[inert]"))&&!(s&&!s.some(R=>R.contains(u))))return u;return null}var ut={values:["1","2","3"]},et=e.createContext(null),Ze=64;function ge(a){return a.querySelector(":scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport")??a.querySelector(":scope > .kui-ShellContent")}var tt=e.forwardRef(({className:a,children:r,height:s="full",contained:u,size:R,style:g,onKeyDown:F,onFocus:x,...k},T)=>{let P=Ee(R,ut),[i]=e.useState(Te),C=e.useCallback(t=>Me(i,t),[i]);e.useSyncExternalStore(C,()=>i.version,()=>0);let S=e.useRef(null),D=be(T,S),[E,w]=e.useState(()=>new Set),A=e.useCallback(t=>{w(n=>n.has(t)?n:new Set(n).add(t))},[]),f=e.useCallback(t=>{w(n=>{if(!n.has(t))return n;let o=new Set(n);return o.delete(t),o})},[]),m=e.useMemo(()=>({registerInset:A,unregisterInset:f}),[A,f]),I=e.useCallback(()=>{for(let t of i.entries.values())t.overlayLive&&t.setValue("closed","dismiss")},[i]),M=e.useCallback(()=>[...i.entries.values()].filter(t=>t.overlayLive&&t.el).map(t=>({name:t.name,id:t.id,el:t.el})),[i]),y=[...i.entries.values()].filter(t=>t.overlayLive&&t.el).length,N=u===!0||s!=="full"&&s!=="auto",V=!N&&s==="full",[Z,le]=e.useState(void 0);e.useEffect(()=>{if(!V)return;let t=S.current,n=t?.ownerDocument.defaultView;if(!t||!n||typeof n.matchMedia!="function")return;let o=xe(),c=o?n.scrollY:ge(t)?.scrollTop??0,h=0,v=0,L=()=>{v&&cancelAnimationFrame(v),v=requestAnimationFrame(()=>{v=0})},U=()=>{o&&!v&&(c=n.scrollY)},q=l=>{!o&&!v&&l.target instanceof HTMLElement&&l.target===ge(t)&&(c=l.target.scrollTop)};n.addEventListener("resize",L),n.addEventListener("scroll",U,{passive:!0}),t.addEventListener("scroll",q,{passive:!0,capture:!0});let se=ke(l=>{o=l;let d=c;h&&cancelAnimationFrame(h),h=requestAnimationFrame(()=>{if(h=0,l)n.scrollTo(0,d);else{let p=ge(t);p&&(p.scrollTop=d)}})});return()=>{h&&cancelAnimationFrame(h),v&&cancelAnimationFrame(v),n.removeEventListener("resize",L),n.removeEventListener("scroll",U),t.removeEventListener("scroll",q,{capture:!0}),se()}},[V]);let K=e.useCallback(()=>{let t=S.current;if(!t)return;let n=M().map(o=>o.el);for(let o of t.children){if(!(o instanceof HTMLElement)||o.classList.contains("kui-ShellScrim"))continue;let c=n.some(h=>o===h||o.contains(h));n.length===0||c?o.hasAttribute(Se)&&(o.removeAttribute(Se),o.inert=!1):o.inert||(o.setAttribute(Se,""),o.inert=!0)}},[M]),j=e.useRef(null),G=e.useRef([]),ee=e.useRef(null),O=e.useRef(!1),z=e.useRef(0),W=e.useCallback(()=>{z.current&&cancelAnimationFrame(z.current),z.current=0},[]),_=e.useCallback((t,n)=>{W();let o=0,c=()=>{if(z.current=0,!!t.isConnected){if(n(t.ownerDocument.activeElement)){t.focus({preventScroll:!0});return}o+=1,o<dt&&(z.current=requestAnimationFrame(c))}};z.current=requestAnimationFrame(c)},[W]);e.useEffect(()=>()=>{W(),O.current&&(O.current=!1,Je(-1))},[W]),e.useEffect(()=>{let t=S.current;if(!t)return;let n=t.ownerDocument,o=M(),c=o.map(l=>l.el),h=!N&&o.length>0;h!==O.current&&(O.current=h,Je(h?1:-1));let v=G.current;G.current=o;let L=v.filter(l=>{if(c.includes(l.el))return!1;let d=i.entries.get(l.name);return!l.el.isConnected||!d||d.el!==l.el||d.value==="closed"}),U=l=>l!==null&&L.some(d=>d.el.contains(l));if(v.length===0&&o.length>0){let l=n.activeElement,d=l instanceof HTMLElement&&!Q(n,l)&&!c.some(p=>p.contains(l))?l:null;if(d&&!t.contains(d)){let p=ee.current;p&&p.isConnected&&!c.some(te=>te.contains(p))&&(d=p)}j.current=d}if(K(),o.length===0){let l=j.current;if(j.current=null,L.length===0)return;let p=(H=>H!==null&&H.isConnected&&!H.closest("[inert]")&&!U(H))(l)?l:null;for(let H of L)p??(p=Qe(n,H.id));if(!p)return;let te=H=>Q(n,H)||U(H);te(n.activeElement)?p.focus({preventScroll:!0}):_(p,te);return}if(L.length>0){let l=n.activeElement;if(Q(n,l)||U(l)){let d=null;for(let p of L)d??(d=Qe(n,p.id,c));(d??c[c.length-1]).focus({preventScroll:!0})}}let q=c.filter(l=>!v.some(d=>d.el===l)),se=n.activeElement;q.length>0&&!c.some(l=>l.contains(se))&&(q[0].focus({preventScroll:!0}),_(q[0],l=>Q(n,l)||l instanceof Element&&l.closest("[inert]")!==null))}),e.useEffect(()=>{let t=S.current;if(!t||y===0||typeof MutationObserver>"u")return;let n=new MutationObserver(K);return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]}),()=>n.disconnect()},[y,K]);let Y=t=>{F?.(t),!(t.key!=="Escape"||t.defaultPrevented||y===0)&&(I(),t.stopPropagation())};e.useEffect(()=>{let t=S.current;if(!t||y===0)return;let n=t.ownerDocument,o=c=>{c.key!=="Escape"||c.defaultPrevented||!Q(n,c.target)||I()};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[y,I]);let ae=t=>{x?.(t),t.target instanceof HTMLElement&&S.current?.contains(t.target)&&(ee.current=t.target)},B=i.entries.get("rail"),X=B!==void 0&&B.value!==void 0&&B.value!=="closed"?E.has("rail")?`calc(${B.size}px + 2 * var(--shell-inset-gap))`:`${B.size}px`:void 0,re=s==="full"?{}:s==="auto"?{height:"auto"}:typeof s=="number"?{height:`${s}px`}:{height:s};return e.createElement(ze.Provider,{value:i},e.createElement(ue.Provider,{value:P},e.createElement(pe.Provider,{value:!1},e.createElement(we.Provider,{value:V},e.createElement(et.Provider,{value:le},e.createElement(He.Provider,{value:m},e.createElement(Le.Provider,{value:void 0},e.createElement("div",{...k,ref:D,className:$("kui-ShellRoot",a),"data-height":s==="auto"&&!N?"auto":void 0,"data-contained":N||void 0,"data-window":V||void 0,"data-has-inset":E.size>0||void 0,"data-overlay-live":y>0||void 0,onKeyDown:Y,onFocus:ae,style:{...re,...X?{"--shell-rail-offset":X}:{},...Z!==void 0?{"--kui-shell-header-h":`${Z}px`}:{},...g}},r,e.createElement("div",{className:"kui-ShellScrim","aria-hidden":!0,onClick:I})))))))))});tt.displayName="Shell.Root";var nt=e.forwardRef(({className:a,height:r=Ze,style:s,...u},R)=>{let g=e.useContext(et);return ct(()=>{if(g)return g(r===Ze?void 0:r),()=>g(void 0)},[g,r]),e.createElement("header",{...u,ref:R,className:$("kui-ShellHeader",a),style:{...s,"--shell-header-height":`${r}px`}})});nt.displayName="Shell.Header";var ot=e.forwardRef(({children:a},r)=>(e.useEffect(()=>{},[]),e.createElement(e.Fragment,null,a)));ot.displayName="Shell.Left";var pt={controlled:"open",default:"defaultOpen"},lt=e.forwardRef((a,r)=>{let{className:s,presentation:u,expandedSize:R=64,collapsible:g,onExpand:F,onCollapse:x,children:k,style:T,open:P,defaultOpen:i,onOpenChange:C,inset:S,id:D,...E}=a,{table:w,attributes:A}=ve(u,"fixed"),f=Pe({name:"rail",label:"Rail",propNames:pt,id:D,controlled:J(P),defaultValue:J(i),presentationTable:w,builtIn:We,onChange:(I,M)=>C?.(I!=="closed",{reason:M}),onExpand:F,onCollapse:x,size:R});oe("rail",S);let m=be(r,f.setElement);return e.createElement("div",{...E,role:E.role??"navigation",id:f.id,ref:m,className:$("kui-ShellPane","kui-ShellRail",s),...he(f,A),"data-inset":S||void 0,tabIndex:f.overlaying?-1:E.tabIndex,style:{...T,"--rail-size":`${R}px`}},e.createElement(ft,null,k))});lt.displayName="Shell.Rail";function ft({children:a}){let r=e.useContext(ue);return e.createElement("div",{className:$("kui-ShellRailContent",`kui-r-size-${r}`)},e.createElement(fe,{presentation:"thin"},a))}var mt={controlled:"open",default:"defaultOpen"},Ce=e.forwardRef((a,r)=>{let{className:s,presentation:u,defaultOpen:R,open:g,onOpenChange:F,size:x,defaultSize:k,expandedSize:T=288,minSize:P=100,maxSize:i=800,resizable:C=!1,collapsible:S=!0,onExpand:D,onCollapse:E,onResize:w,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:I,collapseThreshold:M,paneId:y,persistence:N,children:V,style:Z,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j=50,inset:G,id:ee,...O}=a,z=ce("Shell.Panel"),W=de(z,"rail"),_=ve(u,"fixed"),Y=u===void 0,ae=Y?W?.presentationTable??ie:_.table,B=Y?{"data-presentation-follows":""}:_.attributes,b=Pe({name:"panel",label:"Panel",propNames:mt,id:ee,controlled:J(g),defaultValue:J(R),presentationTable:ae,builtIn:_e,onChange:(v,L)=>F?.(v!=="closed",{reason:L}),onExpand:D,onCollapse:E,size:T});oe("panel",G),e.useEffect(()=>{(m!==void 0||M!==void 0||y!==void 0||N!==void 0)&&void 0},[m,M,y,N]);let X=e.useRef(null),re=be(r,b.setElement,X),t=Be({name:"panel",elementId:b.id,elementRef:X,cssVarName:"--panel-size",orientation:"vertical",edge:"end",growth:Ue,expandedSize:T,minSize:P,maxSize:i,resizable:C,collapsible:S,size:x,defaultSize:k,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j,onResize:w,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:I,collapseThreshold:M,paneId:y,persistence:N,overlaying:b.overlaying,overlayingNow:()=>(Y?z.entries.get("rail")?.presentationTable??ie:_.table)[ye()]==="overlay",requestCollapse:()=>b.setValue("closed","toggle"),requestToggle:()=>b.toggle("toggle")}),n=De(x,k,P,i),{handles:o,content:c}=Ve(V,me),h=C&&b.shown!==!1&&!b.overlaying?e.createElement(Oe.Provider,{value:t},o.length>0?o:e.createElement(Fe,null)):null;return e.createElement("div",{...qe(O),role:O.role??"navigation",id:b.id,ref:re,className:$("kui-ShellPane","kui-ShellPanel",s),...he(b,B),"data-inset":G||void 0,tabIndex:b.overlaying?-1:O.tabIndex,style:{...Z,"--panel-expanded-size":`${T}px`,...n?{"--panel-size":n}:{}}},e.createElement("div",{className:"kui-ShellPanelContent"},e.createElement(fe,null,c)),h)});Ce.displayName="Shell.Panel";Ce.Handle=me;var at=e.forwardRef(({className:a,inset:r,children:s,...u},R)=>(oe("content",r),e.createElement("main",{...u,ref:R,className:$("kui-ShellContent",a),"data-inset":r||void 0},e.createElement(pe.Provider,{value:!0},s))));at.displayName="Shell.Content";var rt=e.forwardRef(({target:a,action:r="toggle",peekOnHover:s,asChild:u=!1,onClick:R,onMouseEnter:g,onMouseLeave:F,children:x,...k},T)=>{let P=ce("Shell.Trigger");e.useEffect(()=>{a==="left"&&void 0,s&&void 0},[a,s]);let i=a==="left"?"rail":a,C=de(P,i),S=C?.value===void 0?void 0:C.value!=="closed",D=f=>{if(R?.(f),f.defaultPrevented)return;let m=P.entries.get(i);m&&(P.peek===i&&ne(P,null),r==="toggle"?m.toggle("toggle"):r==="expand"?m.setValue("open","toggle"):m.setValue("closed","toggle"))},E=f=>{if(g?.(f),!s)return;let m=P.entries.get(i);m&&m.value==="closed"&&m.presentation!=="overlay"&&ne(P,i)},w=f=>{F?.(f),s&&P.peek===i&&ne(P,null)},A=u?it.Root:"button";return e.createElement(A,{...!u&&{type:"button"},"aria-controls":C?.id,"aria-expanded":S,...k,ref:T,onClick:D,onMouseEnter:E,onMouseLeave:w,"data-shell-trigger":a,"data-shell-action":r},x)});rt.displayName="Shell.Trigger";export{tt as a,nt as b,ot as c,lt as d,Ce as e,at as f,rt as g,Pt as h};
3
+ //# sourceMappingURL=chunk-4LV37PHM.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/shell.tsx"],
4
+ "sourcesContent": ["/**\n * Shell: the app frame.\n *\n * Since 0.8.0 the Shell is built on kookie-ui-v2's model, behind v1's API:\n *\n * - The Root is a CSS grid and renders its children as given, in JSX order.\n * Each pane claims its own grid area, so the Root never scans or reorders\n * children, any child renders, and a pane mounted after the Root works.\n * - State lives on each pane: `auto` (untouched), `open` or `closed`. An\n * untouched pane follows the window, resolved by the\n * stylesheet, so first paint needs no script and no open-state callback\n * fires on mount or on a resize.\n * - A pane is one element at every width. `overlay` is a posture of that\n * element, not a Sheet swapped in: crossing a breakpoint keeps its scroll\n * position, its focus and its children's state.\n * - The Root owns what an overlay needs: one scrim, `inert` on everything\n * else, focus moved in and returned, Escape, and a scroll lock.\n * - Nothing links panes to each other. A Rail closing no longer closes the\n * Panel; an app that wants that writes it in `onOpenChange`.\n */\n'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\nimport { PaneResizeContext } from './_internal/shell-resize.js';\nimport { PaneHandle, PanelHandle } from './_internal/shell-handles.js';\nimport { Sidebar } from './_internal/shell-sidebar.js';\nimport type { SidebarPublicProps } from './_internal/shell-sidebar.js';\nimport { Bottom } from './_internal/shell-bottom.js';\nimport type { BottomPublicProps } from './_internal/shell-bottom.js';\nimport { Inspector } from './_internal/shell-inspector.js';\nimport type { InspectorPublicProps } from './_internal/shell-inspector.js';\nimport { usePane, paneAttributes, usePresentationTable } from './_internal/shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane } from './_internal/shell-resizable.js';\nimport {\n FIXED_TABLE,\n ShellInsetContext,\n ShellStoreContext,\n createShellStore,\n setShellPeek,\n subscribeShellStore,\n useInsetRegistration,\n usePaneEntry,\n useShellStore,\n warnOnce,\n type InsetPaneId,\n} from './_internal/shell-store.js';\nimport { navigationRest, detailRest, toPaneValue, startAnchoredGrowth, withoutRemovedPaneProps } from './_internal/shell-rest.js';\nimport { useShell, useSidebarMode } from './shell.context.js';\nimport { useResponsivePresentation } from './shell.hooks.js';\nimport { readBreakpoint } from '../hooks/use-breakpoint.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { PaneChromeScope, PaneFooter, PaneHeader, Scroll, ShellContentContext, ShellSizeContext, ShellWindowContext } from './_internal/pane-chrome.js';\nimport { onPageScrollMediaChange, pageScrollMatches } from './_internal/shell-page-scroll.js';\nimport type { PaneSize, PaneHeaderProps, PaneFooterProps, ScrollProps } from './_internal/pane-chrome.js';\nimport { PaneBandSizeContext } from './_internal/pane-band-context.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneMode, PaneName, PaneTarget, ResponsivePresentation, SidebarMode } from './shell.types.js';\n\n/* \u2500\u2500 Root \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ShellRootProps extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n /**\n * The Shell's height. `full` (the default) is the window's height; on a narrow touch screen the\n * page scrolls instead of the content, so the browser can hide its toolbars. `auto` grows with\n * the content. Any other value is the Shell's own height, and makes it contained.\n */\n height?: 'full' | 'auto' | string | number;\n /**\n * Makes the Shell fill its parent instead of the window, and always scroll inside itself. Its\n * overlays cover only its own box and leave the page free to scroll. Use it for a Shell in a\n * card, a demo or a canvas. An explicit `height` implies it.\n */\n contained?: boolean;\n /** The index the panes' chrome takes: `Shell.PaneHeader`, `Shell.Scroll`, `Shell.PaneFooter` and the Sidebar rows in them. Defaults to the nearest Theme's size (3 when the Theme is 4), else `2`. */\n size?: PaneSize;\n}\n\n/**\n * Every Shell with a live overlay holds the page still, counted across Shells,\n * through an attribute the stylesheet reads. Saving and restoring the\n * document's inline `overflow` would fight any other scroll lock on the page.\n */\nlet pageLockHolders = 0;\nfunction updatePageLock(delta: 1 | -1) {\n pageLockHolders = Math.max(0, pageLockHolders + delta);\n const doc = document.documentElement;\n if (pageLockHolders > 0) doc.setAttribute('data-kui-shell-lock', '');\n else doc.removeAttribute('data-kui-shell-lock');\n}\n\n/** Marks a child the Root made inert, so closing removes only what the Root added. */\nconst INERT_MARK = 'data-kui-shell-inert';\n\n/** How many frames a focus rescue watches after an overlay opens or closes. */\nconst RESCUE_FRAMES = 30;\n\n/** Focus that is nowhere useful: the document, or nothing at all. */\nfunction isNowhere(doc: Document, el: Element | EventTarget | null): boolean {\n return el === null || el === doc || el === doc.body || el === doc.documentElement;\n}\n\n/** A Trigger that drives the pane with this id and can take focus, optionally only inside `within`. */\nfunction triggerFor(doc: Document, id: string, within?: HTMLElement[]): HTMLElement | null {\n for (const el of doc.querySelectorAll<HTMLElement>('[data-shell-trigger][aria-controls]')) {\n if (el.getAttribute('aria-controls') !== id || el.closest('[inert]')) continue;\n if (within && !within.some((pane) => pane.contains(el))) continue;\n return el;\n }\n return null;\n}\n\ntype LivePane = { name: PaneName; id: string; el: HTMLElement };\n\n/** Shell.Root's own range; a Theme size above it maps to 3. */\nconst shellSizePropDef = { values: ['1', '2', '3'] as const };\n\n/** Lets a Shell.Header tell the Root its height, for the rows that stick beneath it while the page scrolls. */\nconst ShellHeaderHeightContext = React.createContext<((height: number | undefined) => void) | null>(null);\n\n/** The Shell.Header's default height, which the stylesheet assumes until a Header says otherwise. */\nconst DEFAULT_HEADER_HEIGHT = 64;\n\n/** The content's scroller while the frame scrolls: the Shell.Scroll's viewport, or the content itself. */\nfunction frameScroller(rootEl: HTMLElement): HTMLElement | null {\n return rootEl.querySelector<HTMLElement>(':scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport') ?? rootEl.querySelector<HTMLElement>(':scope > .kui-ShellContent');\n}\n\nconst Root = React.forwardRef<HTMLDivElement, ShellRootProps>(({ className, children, height = 'full', contained: containedProp, size: sizeProp, style, onKeyDown, onFocus, ...props }, ref) => {\n // No size of its own: the nearest Theme's, mapped into 1-3.\n const size = useThemeSize(sizeProp, shellSizePropDef);\n const [store] = React.useState(createShellStore);\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n // Subscribed for the re-render, not for a value: a pane opening or closing\n // must bring the Root back so containment and the scrim follow it.\n React.useSyncExternalStore(\n subscribe,\n () => store.version,\n () => 0,\n );\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const composedRef = useComposedRefs(ref, rootRef);\n\n // Inset: the Root paints the backdrop while any pane is inset.\n const [insetPanes, setInsetPanes] = React.useState<ReadonlySet<InsetPaneId>>(() => new Set());\n const registerInset = React.useCallback((id: InsetPaneId) => {\n setInsetPanes((prev) => (prev.has(id) ? prev : new Set(prev).add(id)));\n }, []);\n const unregisterInset = React.useCallback((id: InsetPaneId) => {\n setInsetPanes((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }, []);\n const insetContext = React.useMemo(() => ({ registerInset, unregisterInset }), [registerInset, unregisterInset]);\n\n const closeOverlays = React.useCallback(() => {\n for (const entry of store.entries.values()) {\n if (entry.overlayLive) entry.setValue('closed', 'dismiss');\n }\n }, [store]);\n\n const livePanes = React.useCallback(\n (): LivePane[] => [...store.entries.values()].filter((entry) => entry.overlayLive && entry.el).map((entry) => ({ name: entry.name, id: entry.id, el: entry.el as HTMLElement })),\n [store],\n );\n const liveCount = [...store.entries.values()].filter((entry) => entry.overlayLive && entry.el).length;\n\n // A contained Shell sits inside a page, and its overlays cover only its box:\n // it holds no page lock. A height of its own implies it. `full` is the\n // window, and `auto` grows with its content, so its overlays are placed on\n // the window. Only a `full` Shell lets the page scroll on a phone.\n const contained = containedProp === true || (height !== 'full' && height !== 'auto');\n const windowShell = !contained && height === 'full';\n\n const [headerHeight, setHeaderHeight] = React.useState<number | undefined>(undefined);\n\n /*\n * The reading position crosses with the scroller. When a touch window\n * crosses the narrow boundary (a phone rotating, an iPad entering Split\n * View), the scroller changes between the content and the page, and the new\n * one starts at the top. The offset is remembered on `scroll` from whichever\n * scroller is live, because by the time the change is reported the old one\n * has already been laid out again and clamped. Only the live scroller is\n * heard. The clamp itself is reported as a scroll in the same frame as the\n * resize and before the media change, so scrolls are not heard from a resize\n * until that frame's animation callbacks.\n */\n React.useEffect(() => {\n if (!windowShell) return;\n const rootEl = rootRef.current;\n const win = rootEl?.ownerDocument.defaultView;\n if (!rootEl || !win || typeof win.matchMedia !== 'function') return;\n let pageScrolls = pageScrollMatches();\n let offset = pageScrolls ? win.scrollY : (frameScroller(rootEl)?.scrollTop ?? 0);\n let frame = 0;\n let resizing = 0;\n const onResize = () => {\n if (resizing) cancelAnimationFrame(resizing);\n resizing = requestAnimationFrame(() => {\n resizing = 0;\n });\n };\n const fromPage = () => {\n if (pageScrolls && !resizing) offset = win.scrollY;\n };\n const fromFrame = (event: Event) => {\n if (!pageScrolls && !resizing && event.target instanceof HTMLElement && event.target === frameScroller(rootEl)) offset = event.target.scrollTop;\n };\n win.addEventListener('resize', onResize);\n win.addEventListener('scroll', fromPage, { passive: true });\n rootEl.addEventListener('scroll', fromFrame, { passive: true, capture: true });\n const stop = onPageScrollMediaChange((matches) => {\n pageScrolls = matches;\n const carried = offset;\n if (frame) cancelAnimationFrame(frame);\n frame = requestAnimationFrame(() => {\n frame = 0;\n if (matches) win.scrollTo(0, carried);\n else {\n const el = frameScroller(rootEl);\n if (el) el.scrollTop = carried;\n }\n });\n });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n if (resizing) cancelAnimationFrame(resizing);\n win.removeEventListener('resize', onResize);\n win.removeEventListener('scroll', fromPage);\n rootEl.removeEventListener('scroll', fromFrame, { capture: true });\n stop();\n };\n }, [windowShell]);\n\n /*\n * Containment is the Root's, not the pane's. Only the Root can see every live\n * overlay and every child at once. A per-pane effect, given two overlays,\n * inerts the other live overlay and restores values the other effect wrote,\n * which can leave the whole frame inert for good.\n *\n * Exempt are the scrim and each root child that CONTAINS a live overlay, so\n * a pane wrapped in a plain element is not inerted with its wrapper. A child\n * the Root inerts is marked, and closing clears only marked children, so\n * `inert` the app sets on a child is the app's before, during and after.\n */\n const contain = React.useCallback(() => {\n const rootEl = rootRef.current;\n if (!rootEl) return;\n const liveEls = livePanes().map((pane) => pane.el);\n for (const child of rootEl.children) {\n if (!(child instanceof HTMLElement) || child.classList.contains('kui-ShellScrim')) continue;\n const holdsLive = liveEls.some((el) => child === el || child.contains(el));\n if (liveEls.length === 0 || holdsLive) {\n if (child.hasAttribute(INERT_MARK)) {\n child.removeAttribute(INERT_MARK);\n child.inert = false;\n }\n } else if (!child.inert) {\n child.setAttribute(INERT_MARK, '');\n child.inert = true;\n }\n }\n }, [livePanes]);\n\n const returnFocusTo = React.useRef<HTMLElement | null>(null);\n const lastLive = React.useRef<LivePane[]>([]);\n const lastFocusInRoot = React.useRef<HTMLElement | null>(null);\n const holdsLock = React.useRef(false);\n\n /*\n * Focus can be taken away after the commit that moved it: a menu that\n * opened or closed a pane restores focus to its own trigger when it\n * finishes closing, which may be inert or hidden by then. For a few frames\n * after an overlay opens or closes, focus that ends up nowhere useful is\n * put back where it belongs.\n */\n const rescueFrame = React.useRef(0);\n const cancelRescue = React.useCallback(() => {\n if (rescueFrame.current) cancelAnimationFrame(rescueFrame.current);\n rescueFrame.current = 0;\n }, []);\n const rescueFocus = React.useCallback(\n (target: HTMLElement, lost: (active: Element | null) => boolean) => {\n cancelRescue();\n let frames = 0;\n const tick = () => {\n rescueFrame.current = 0;\n if (!target.isConnected) return;\n if (lost(target.ownerDocument.activeElement)) {\n target.focus({ preventScroll: true });\n return;\n }\n frames += 1;\n if (frames < RESCUE_FRAMES) rescueFrame.current = requestAnimationFrame(tick);\n };\n rescueFrame.current = requestAnimationFrame(tick);\n },\n [cancelRescue],\n );\n\n React.useEffect(\n () => () => {\n cancelRescue();\n if (holdsLock.current) {\n holdsLock.current = false;\n updatePageLock(-1);\n }\n },\n [cancelRescue],\n );\n\n // No dependency array, on purpose: a pane opening or closing is a render\n // of this component, and so is a child appearing through the Root.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl) return;\n const doc = rootEl.ownerDocument;\n const live = livePanes();\n const liveEls = live.map((pane) => pane.el);\n\n const wantsLock = !contained && live.length > 0;\n if (wantsLock !== holdsLock.current) {\n holdsLock.current = wantsLock;\n updatePageLock(wantsLock ? 1 : -1);\n }\n\n const previous = lastLive.current;\n lastLive.current = live;\n // A pane that left the live set because it closed, as opposed to one\n // that is still open but stopped being an overlay at a breakpoint.\n const closed = previous.filter((pane) => {\n if (liveEls.includes(pane.el)) return false;\n const entry = store.entries.get(pane.name);\n return !pane.el.isConnected || !entry || entry.el !== pane.el || entry.value === 'closed';\n });\n const inClosed = (active: Element | null) => active !== null && closed.some((pane) => pane.el.contains(active));\n\n // The return target is taken on the opening edge, before inerting: inerting\n // the subtree that holds the trigger blurs it. Focus already inside the\n // overlay (a pane that became one at a breakpoint) is no place to return\n // to, and an opener in a portal (a menu item) goes away with its menu, so\n // the last place focus held inside the frame stands in for it.\n if (previous.length === 0 && live.length > 0) {\n const active = doc.activeElement;\n let target = active instanceof HTMLElement && !isNowhere(doc, active) && !liveEls.some((el) => el.contains(active)) ? active : null;\n if (target && !rootEl.contains(target)) {\n const inRoot = lastFocusInRoot.current;\n if (inRoot && inRoot.isConnected && !liveEls.some((el) => el.contains(inRoot))) target = inRoot;\n }\n returnFocusTo.current = target;\n }\n\n contain();\n\n if (live.length === 0) {\n const before = returnFocusTo.current;\n returnFocusTo.current = null;\n // Every overlay that left only stopped being one: focus stays where it is.\n if (closed.length === 0) return;\n const usable = (el: HTMLElement | null) => el !== null && el.isConnected && !el.closest('[inert]') && !inClosed(el);\n let target = usable(before) ? before : null;\n for (const pane of closed) target ??= triggerFor(doc, pane.id);\n if (!target) return;\n const lost = (active: Element | null) => isNowhere(doc, active) || inClosed(active);\n if (lost(doc.activeElement)) target.focus({ preventScroll: true });\n else rescueFocus(target, lost);\n return;\n }\n\n // Some overlays closed while others stay: focus left in a closed one goes\n // to the Trigger that opened it, if a live pane holds it, or to the pane\n // on top.\n if (closed.length > 0) {\n const active = doc.activeElement;\n if (isNowhere(doc, active) || inClosed(active)) {\n let target: HTMLElement | null = null;\n for (const pane of closed) target ??= triggerFor(doc, pane.id, liveEls);\n (target ?? liveEls[liveEls.length - 1]).focus({ preventScroll: true });\n }\n }\n\n // Focus moves in on the opening edge and nowhere else, and only when it\n // is not already somewhere the user put it inside the live set.\n const opened = liveEls.filter((el) => !previous.some((pane) => pane.el === el));\n const active = doc.activeElement;\n if (opened.length > 0 && !liveEls.some((el) => el.contains(active))) {\n opened[0].focus({ preventScroll: true });\n rescueFocus(opened[0], (now) => isNowhere(doc, now) || (now instanceof Element && now.closest('[inert]') !== null));\n }\n });\n\n // A child that appears through its own state while an overlay is live does\n // not render the Root, so the Root watches its children while one is.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl || liveCount === 0 || typeof MutationObserver === 'undefined') return;\n const observer = new MutationObserver(contain);\n observer.observe(rootEl, { childList: true, subtree: true, attributes: true, attributeFilter: ['inert'] });\n return () => observer.disconnect();\n }, [liveCount, contain]);\n\n /*\n * Escape closes the overlays. It is handled as a React event on the Root, so\n * a component inside a pane that answers Escape in its own onKeyDown runs\n * first, and its preventDefault() or stopPropagation() keeps the pane open.\n * When the Root closes something it stops the event there, so a React\n * Escape handler above the Shell does not act on it too. A layer that\n * listens on the document in the capture phase (Radix dialogs, menus and\n * popovers) answers first and calls preventDefault() when it closes, so an\n * enclosing Kookie Dialog closes before a Shell inside it is asked.\n */\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.key !== 'Escape' || event.defaultPrevented || liveCount === 0) return;\n closeOverlays();\n event.stopPropagation();\n };\n\n // With focus on the document itself (a pane closed under it, or a menu that\n // closed and took focus with it), the Root never sees the key. While an\n // overlay is live the document answers that one case.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl || liveCount === 0) return;\n const doc = rootEl.ownerDocument;\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented || !isNowhere(doc, event.target)) return;\n closeOverlays();\n };\n doc.addEventListener('keydown', onDocumentKeyDown);\n return () => doc.removeEventListener('keydown', onDocumentKeyDown);\n }, [liveCount, closeOverlays]);\n\n const handleFocus = (event: React.FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n if (event.target instanceof HTMLElement && rootRef.current?.contains(event.target)) lastFocusInRoot.current = event.target;\n };\n\n // A floating Panel sits beside the Rail when the Rail is showing, and\n // beside its card when the Rail is inset.\n const rail = store.entries.get('rail');\n const railShown = rail !== undefined && rail.value !== undefined && rail.value !== 'closed';\n const railOffset = railShown ? (insetPanes.has('rail') ? `calc(${rail.size}px + 2 * var(--shell-inset-gap))` : `${rail.size}px`) : undefined;\n\n // `full` writes no inline height: the stylesheet states it as 100vh with a\n // 100dvh override where supported, and an inline value would beat both.\n const heightStyle: React.CSSProperties = height === 'full' ? {} : height === 'auto' ? { height: 'auto' } : typeof height === 'number' ? { height: `${height}px` } : { height };\n\n return (\n <ShellStoreContext.Provider value={store}>\n <ShellSizeContext.Provider value={size}>\n <ShellContentContext.Provider value={false}>\n <ShellWindowContext.Provider value={windowShell}>\n <ShellHeaderHeightContext.Provider value={setHeaderHeight}>\n <ShellInsetContext.Provider value={insetContext}>\n {/* A Shell inside a portalled surface's Theme starts with no band, like any other. */}\n <PaneBandSizeContext.Provider value={undefined}>\n {/* The Root is not a widget: it hears Escape bubbling up from the panes,\n after their own handlers, to close the overlays. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n {...props}\n ref={composedRef}\n className={classNames('kui-ShellRoot', className)}\n data-height={height === 'auto' && !contained ? 'auto' : undefined}\n data-contained={contained || undefined}\n data-window={windowShell || undefined}\n data-has-inset={insetPanes.size > 0 || undefined}\n data-overlay-live={liveCount > 0 || undefined}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n style={{\n ...heightStyle,\n ...(railOffset ? ({ '--shell-rail-offset': railOffset } as CSSPropertiesWithVars) : {}),\n ...(headerHeight !== undefined ? ({ '--kui-shell-header-h': `${headerHeight}px` } as CSSPropertiesWithVars) : {}),\n ...style,\n }}\n >\n {children}\n {/* Root-owned and always mounted. The stylesheet shows it while an\n overlay is live; containment takes the rest of the frame out of\n the accessibility tree, so the scrim itself is hidden from it. */}\n <div className=\"kui-ShellScrim\" aria-hidden onClick={closeOverlays} />\n </div>\n </PaneBandSizeContext.Provider>\n </ShellInsetContext.Provider>\n </ShellHeaderHeightContext.Provider>\n </ShellWindowContext.Provider>\n </ShellContentContext.Provider>\n </ShellSizeContext.Provider>\n </ShellStoreContext.Provider>\n );\n});\nRoot.displayName = 'Shell.Root';\n\n/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface ShellHeaderProps extends React.ComponentPropsWithoutRef<'header'> {\n height?: number;\n}\n\nconst Header = React.forwardRef<HTMLElement, ShellHeaderProps>(({ className, height = DEFAULT_HEADER_HEIGHT, style, ...props }, ref) => {\n // Rows that stick beneath the header while the page scrolls need its height. The stylesheet\n // assumes the default, so only another height is told to the Root.\n const setHeaderHeight = React.useContext(ShellHeaderHeightContext);\n useLayoutEffect(() => {\n if (!setHeaderHeight) return;\n setHeaderHeight(height === DEFAULT_HEADER_HEIGHT ? undefined : height);\n return () => setHeaderHeight(undefined);\n }, [setHeaderHeight, height]);\n return (\n <header\n {...props}\n ref={ref}\n className={classNames('kui-ShellHeader', className)}\n style={\n {\n ...style,\n '--shell-header-height': `${height}px`,\n } as CSSPropertiesWithVars\n }\n />\n );\n});\nHeader.displayName = 'Shell.Header';\n\n/* \u2500\u2500 Left (deprecated) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface LeftProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, meta: { reason: 'init' | 'toggle' | 'panel' | 'responsive' | 'dismiss' }) => void;\n collapsible?: boolean;\n onExpand?: () => void;\n onCollapse?: () => void;\n inset?: boolean;\n}\n\n/**\n * @deprecated The Root no longer wraps the Rail and Panel in a Left\n * container: each is its own pane. `Shell.Left` renders its children and\n * ignores its own props. Removed in 1.0.\n */\nconst Left = React.forwardRef<HTMLDivElement, LeftProps>(({ children }, _ref) => {\n React.useEffect(() => {\n warnOnce('Shell.Left is deprecated and is removed in 1.0. Render Shell.Rail and Shell.Panel directly in Shell.Root.');\n }, []);\n return <>{children}</>;\n});\nLeft.displayName = 'Shell.Left';\n\n/* \u2500\u2500 Rail \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RailOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'panel' | 'dismiss' };\n\ntype RailControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; defaultOpen?: never };\ntype RailUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; open?: never };\n\ntype RailProps = React.ComponentPropsWithoutRef<'div'> & {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. */\n onCollapse?: () => void;\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n} & (RailControlledProps | RailUncontrolledProps);\n\nconst RAIL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\nconst Rail = React.forwardRef<HTMLDivElement, RailProps>((props, ref) => {\n const { className, presentation, expandedSize = 64, collapsible: _collapsible, onExpand, onCollapse, children, style, open, defaultOpen, onOpenChange, inset, id, ...domProps } = props;\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'rail',\n label: 'Rail',\n propNames: RAIL_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('rail', inset);\n const composedRef = useComposedRefs(ref, pane.setElement);\n\n return (\n <div\n {...domProps}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellRail', className)}\n {...paneAttributes(pane, attributes)}\n data-inset={inset || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={{ ...style, '--rail-size': `${expandedSize}px` } as CSSPropertiesWithVars}\n >\n <RailContent>{children}</RailContent>\n </div>\n );\n});\nRail.displayName = 'Shell.Rail';\n\n/** The Rail's content carries the index, so the thin row styles can size themselves by it. */\nfunction RailContent({ children }: { children: React.ReactNode }) {\n const size = React.useContext(ShellSizeContext);\n return (\n <div className={classNames('kui-ShellRailContent', `kui-r-size-${size}`)}>\n <PaneChromeScope presentation=\"thin\">{children}</PaneChromeScope>\n </div>\n );\n}\n\n/* \u2500\u2500 Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype HandleComponent = React.ForwardRefExoticComponent<React.ComponentPropsWithoutRef<'div'> & React.RefAttributes<HTMLDivElement>>;\n\ntype PanelOpenChangeMeta = { reason: 'toggle' | 'left' | 'init' | 'responsive' | 'dismiss' };\ntype PanelControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; defaultOpen?: never };\ntype PanelUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; open?: never };\n\ntype PanelSizeControlledProps = { size: number | string; defaultSize?: never };\ntype PanelSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\n\ntype PanelSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype PanelPublicProps = PaneBaseProps &\n (PanelControlledProps | PanelUncontrolledProps) &\n (PanelSizeControlledProps | PanelSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: PanelSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n };\ntype PanelComponent = React.ForwardRefExoticComponent<PanelPublicProps & React.RefAttributes<HTMLDivElement>> & {\n Handle: HandleComponent;\n};\n\nconst PANEL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\n/**\n * A Panel with a `presentation` of its own uses it. One without follows the\n * Rail rendered before it, which is how 0.7 placed a Panel; the stylesheet\n * reads the Rail's attributes for the first paint and the registry carries\n * the Rail's table for the JS mirror.\n */\nconst Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) => {\n const {\n className,\n presentation,\n defaultOpen,\n open,\n onOpenChange,\n size,\n defaultSize,\n expandedSize = 288,\n minSize = 100,\n maxSize = 800,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n id,\n ...domProps\n } = props;\n const store = useShellStore('Shell.Panel');\n const rail = usePaneEntry(store, 'rail');\n const own = usePresentationTable(presentation, 'fixed');\n const followsRail = presentation === undefined;\n const presentationTable = followsRail ? (rail?.presentationTable ?? FIXED_TABLE) : own.table;\n const presentationAttributes = followsRail ? { 'data-presentation-follows': '' } : own.attributes;\n\n const pane = usePane({\n name: 'panel',\n label: 'Panel',\n propNames: PANEL_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('panel', inset);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Panel: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'panel',\n elementId: pane.id,\n elementRef,\n cssVarName: '--panel-size',\n orientation: 'vertical',\n edge: 'end',\n growth: startAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n // Asked when the effect runs: the Rail registers its table after this\n // Panel first renders, so the render's answer can be out of date.\n overlayingNow: () => {\n const table = followsRail ? (store.entries.get('rail')?.presentationTable ?? FIXED_TABLE) : own.table;\n return table[readBreakpoint()] === 'overlay';\n },\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n // The starting size is in the server HTML, so the pane does not jump on hydration.\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n const { handles, content } = splitHandles(children, PanelHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellPanel', className)}\n {...paneAttributes(pane, presentationAttributes)}\n data-inset={inset || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--panel-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--panel-size': initialSize } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellPanelContent\">\n <PaneChromeScope>{content}</PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as PanelComponent;\nPanel.displayName = 'Shell.Panel';\nPanel.Handle = PanelHandle;\n\n/* \u2500\u2500 Content \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface ShellContentProps extends React.ComponentPropsWithoutRef<'main'> {\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n}\n\n/**\n * The work area. It scrolls as it is; with a `Shell.Scroll` child it becomes a column and the\n * Scroll scrolls instead, so a `Shell.PaneHeader float` beside it stays pinned over the page.\n */\nconst Content = React.forwardRef<HTMLElement, ShellContentProps>(({ className, inset, children, ...props }, ref) => {\n useInsetRegistration('content', inset);\n return (\n <main {...props} ref={ref} className={classNames('kui-ShellContent', className)} data-inset={inset || undefined}>\n <ShellContentContext.Provider value={true}>{children}</ShellContentContext.Provider>\n </main>\n );\n});\nContent.displayName = 'Shell.Content';\n\n/* \u2500\u2500 Trigger \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype TriggerAction = 'toggle' | 'expand' | 'collapse';\n\ninterface TriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n target: PaneTarget;\n action?: TriggerAction;\n /**\n * Renders the single child in place of the trigger's own button, with the trigger's click,\n * `aria-controls`, `aria-expanded` and data attributes merged onto it. Use it to make a\n * `Button` the trigger: `<Shell.Trigger asChild><Button iconOnly aria-label=\"Toggle sidebar\">\u2026</Button></Shell.Trigger>`.\n */\n asChild?: boolean;\n /**\n * Whether to show a preview of the target pane on hover while it is closed\n * and not an overlay. Defaults to false.\n *\n * @deprecated Removed in 1.0. A preview reachable only by mouse hover has no\n * keyboard or touch equivalent; open the pane instead.\n */\n peekOnHover?: boolean;\n}\n\n/**\n * A button that drives a pane by name, through the registry. It sets\n * `aria-controls` and `aria-expanded` (left off while an untouched pane\n * cannot know its state yet), renders `type=\"button\"`, and runs the\n * consumer's `onClick` first: calling `preventDefault()` there cancels it. With `asChild` the\n * child is the button, and its own `type` stands.\n */\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(({ target, action = 'toggle', peekOnHover, asChild = false, onClick, onMouseEnter, onMouseLeave, children, ...props }, ref) => {\n const store = useShellStore('Shell.Trigger');\n React.useEffect(() => {\n if (target === 'left') warnOnce('Shell.Trigger target=\"left\" is deprecated and is removed in 1.0. Use target=\"rail\".');\n if (peekOnHover) warnOnce('Shell.Trigger: `peekOnHover` is deprecated and is removed in 1.0.');\n }, [target, peekOnHover]);\n const name: PaneName = target === 'left' ? 'rail' : target;\n // Subscribes to its own pane only.\n const entry = usePaneEntry(store, name);\n const shown = entry?.value === undefined ? undefined : entry.value !== 'closed';\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const current = store.entries.get(name);\n if (!current) return;\n if (store.peek === name) setShellPeek(store, null);\n if (action === 'toggle') current.toggle('toggle');\n else if (action === 'expand') current.setValue('open', 'toggle');\n else current.setValue('closed', 'toggle');\n };\n\n const handleMouseEnter = (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(event);\n if (!peekOnHover) return;\n const current = store.entries.get(name);\n if (current && current.value === 'closed' && current.presentation !== 'overlay') setShellPeek(store, name);\n };\n\n const handleMouseLeave = (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(event);\n if (peekOnHover && store.peek === name) setShellPeek(store, null);\n };\n\n const Comp = asChild ? Slot.Root : 'button';\n return (\n <Comp\n // A button's default type is `submit`. Stated before the spread, so a consumer's own wins.\n // An asChild child states its own (Button already says `button`; a link has none), so the\n // key is left off rather than passed as undefined.\n {...(!asChild && { type: 'button' as const })}\n aria-controls={entry?.id}\n aria-expanded={shown}\n {...props}\n ref={ref}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n data-shell-trigger={target}\n data-shell-action={action}\n >\n {children}\n </Comp>\n );\n});\nTrigger.displayName = 'Shell.Trigger';\n\n// Exports\nexport {\n Root,\n Header,\n Left,\n Rail,\n Panel,\n Sidebar,\n Content,\n Inspector,\n Bottom,\n Trigger,\n PaneHeader,\n PaneFooter,\n Scroll,\n useShell,\n useSidebarMode,\n useResponsivePresentation,\n type PaneMode,\n type SidebarMode,\n type ResponsivePresentation,\n type PaneTarget,\n type TriggerAction,\n type ShellRootProps as RootProps,\n type ShellHeaderProps as HeaderProps,\n type RailProps,\n type PanelPublicProps as PanelProps,\n type SidebarPublicProps as SidebarProps,\n type ShellContentProps as ContentProps,\n type InspectorPublicProps as InspectorProps,\n type BottomPublicProps as BottomProps,\n type TriggerProps,\n type PaneHeaderProps,\n type PaneFooterProps,\n type ScrollProps,\n};\n"],
5
+ "mappings": ";g4BAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,YAAAC,GAAA,WAAAC,GAAA,cAAAC,GAAA,SAAAC,GAAA,eAAAC,GAAA,eAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,WAAAC,GAAA,YAAAC,GAAA,YAAAC,GAAA,8BAAAC,GAAA,aAAAC,GAAA,mBAAAC,KAsBA,UAAYC,MAAW,QACvB,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", "Content", "Header", "Inspector", "Left", "PaneFooter", "PaneHeader", "Panel", "Rail", "Root", "Scroll", "Sidebar", "Trigger", "useResponsivePresentation", "useShell", "useSidebarMode", "React", "classNames", "Slot", "useComposedRefs", "useLayoutEffect", "pageLockHolders", "updatePageLock", "delta", "doc", "INERT_MARK", "RESCUE_FRAMES", "isNowhere", "el", "triggerFor", "id", "within", "pane", "shellSizePropDef", "ShellHeaderHeightContext", "DEFAULT_HEADER_HEIGHT", "frameScroller", "rootEl", "Root", "className", "children", "height", "containedProp", "sizeProp", "style", "onKeyDown", "onFocus", "props", "ref", "size", "useThemeSize", "store", "createShellStore", "subscribe", "listener", "subscribeShellStore", "rootRef", "composedRef", "useComposedRefs", "insetPanes", "setInsetPanes", "registerInset", "prev", "unregisterInset", "next", "insetContext", "closeOverlays", "entry", "livePanes", "liveCount", "contained", "windowShell", "headerHeight", "setHeaderHeight", "win", "pageScrolls", "pageScrollMatches", "offset", "frame", "resizing", "onResize", "fromPage", "fromFrame", "event", "stop", "onPageScrollMediaChange", "matches", "carried", "contain", "liveEls", "child", "holdsLive", "returnFocusTo", "lastLive", "lastFocusInRoot", "holdsLock", "rescueFrame", "cancelRescue", "rescueFocus", "target", "lost", "frames", "tick", "live", "wantsLock", "previous", "closed", "inClosed", "active", "inRoot", "before", "opened", "now", "observer", "handleKeyDown", "onDocumentKeyDown", "handleFocus", "rail", "railOffset", "heightStyle", "ShellStoreContext", "ShellSizeContext", "ShellContentContext", "ShellWindowContext", "ShellInsetContext", "PaneBandSizeContext", "classNames", "Header", "useLayoutEffect", "Left", "_ref", "RAIL_PROP_NAMES", "Rail", "presentation", "expandedSize", "_collapsible", "onExpand", "onCollapse", "open", "defaultOpen", "onOpenChange", "inset", "domProps", "table", "attributes", "usePresentationTable", "usePane", "toPaneValue", "navigationRest", "value", "reason", "useInsetRegistration", "paneAttributes", "RailContent", "PaneChromeScope", "PANEL_PROP_NAMES", "Panel", "defaultSize", "minSize", "maxSize", "resizable", "collapsible", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "useShellStore", "usePaneEntry", "own", "followsRail", "presentationTable", "FIXED_TABLE", "presentationAttributes", "detailRest", "elementRef", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "initialSize", "useInitialPaneSize", "handles", "content", "splitHandles", "PanelHandle", "handle", "PaneResizeContext", "PaneHandle", "withoutRemovedPaneProps", "Content", "Trigger", "action", "peekOnHover", "asChild", "onClick", "onMouseEnter", "onMouseLeave", "name", "shown", "handleClick", "current", "setShellPeek", "handleMouseEnter", "handleMouseLeave", "Comp", "Slot"]
7
+ }
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as p}from"./chunk-FATCGZZE.js";import{a as D}from"./chunk-7VJF6EXN.js";import{a as g}from"./chunk-JP36JSNP.js";import{a as l}from"./chunk-TGRHRMQI.js";import{a as m}from"./chunk-4MNRLB57.js";import{c as r}from"./chunk-OKQAVYW4.js";import{a as n}from"./chunk-T2DZDW5Y.js";import{c as s}from"./chunk-5ON3XLRD.js";import{a as w}from"./chunk-VQPANPMI.js";var S={};w(S,{Close:()=>y,Content:()=>C,Description:()=>R,Root:()=>c,Title:()=>d,Trigger:()=>f});import*as o from"react";import W from"classnames";import{Dialog as t}from"radix-ui";var c=e=>o.createElement(t.Root,{...e,modal:!0});c.displayName="Dialog.Root";var f=o.forwardRef(({children:e,...i},a)=>o.createElement(t.Trigger,{...i,ref:a,asChild:!0},l(e)));f.displayName="Dialog.Trigger";var{align:O,...P}=p,B={align:O},C=o.forwardRef(({align:e,...i},a)=>{let T=s(i,P.size),{className:v}=r({align:e},B),{className:u,forceMount:h,container:E,onCloseAutoFocus:N,...x}=r(T,P);return D(),o.createElement(t.Portal,{container:E,forceMount:h},o.createElement(n,{asChild:!0},o.createElement(t.Overlay,{className:"kui-BaseDialogOverlay kui-DialogOverlay"},o.createElement("div",{className:"kui-BaseDialogScroll kui-DialogScroll"},o.createElement("div",{className:`kui-BaseDialogScrollPadding kui-DialogScrollPadding ${v}`},o.createElement(t.Content,{...x,ref:a,className:W("kui-BaseDialogContent","kui-DialogContent",u),"aria-modal":"true",onCloseAutoFocus:k=>{N?.(k),document.body.style.pointerEvents=""}}))))))});C.displayName="Dialog.Content";var d=o.forwardRef((e,i)=>o.createElement(t.Title,{asChild:!0},o.createElement(g,{size:"5",trim:"start",...e,asChild:!1,ref:i})));d.displayName="Dialog.Title";var R=o.forwardRef((e,i)=>o.createElement(t.Description,{asChild:!0},o.createElement(m,{as:"p",size:"3",...e,asChild:!1,ref:i})));R.displayName="Dialog.Description";var y=o.forwardRef(({children:e,...i},a)=>o.createElement(t.Close,{...i,ref:a,asChild:!0},l(e)));y.displayName="Dialog.Close";export{c as a,f as b,C as c,d,R as e,y as f,S as g};
3
- //# sourceMappingURL=chunk-WYKNBNM5.js.map
2
+ import{a as p}from"./chunk-FATCGZZE.js";import{a as D}from"./chunk-7VJF6EXN.js";import{a as g}from"./chunk-JP36JSNP.js";import{a as l}from"./chunk-TGRHRMQI.js";import{a as m}from"./chunk-4MNRLB57.js";import{c as r}from"./chunk-OKQAVYW4.js";import{a as n}from"./chunk-AQKSO3SW.js";import{c as s}from"./chunk-5ON3XLRD.js";import{a as w}from"./chunk-VQPANPMI.js";var S={};w(S,{Close:()=>y,Content:()=>C,Description:()=>R,Root:()=>c,Title:()=>d,Trigger:()=>f});import*as o from"react";import W from"classnames";import{Dialog as t}from"radix-ui";var c=e=>o.createElement(t.Root,{...e,modal:!0});c.displayName="Dialog.Root";var f=o.forwardRef(({children:e,...i},a)=>o.createElement(t.Trigger,{...i,ref:a,asChild:!0},l(e)));f.displayName="Dialog.Trigger";var{align:O,...P}=p,B={align:O},C=o.forwardRef(({align:e,...i},a)=>{let T=s(i,P.size),{className:v}=r({align:e},B),{className:u,forceMount:h,container:E,onCloseAutoFocus:N,...x}=r(T,P);return D(),o.createElement(t.Portal,{container:E,forceMount:h},o.createElement(n,{asChild:!0},o.createElement(t.Overlay,{className:"kui-BaseDialogOverlay kui-DialogOverlay"},o.createElement("div",{className:"kui-BaseDialogScroll kui-DialogScroll"},o.createElement("div",{className:`kui-BaseDialogScrollPadding kui-DialogScrollPadding ${v}`},o.createElement(t.Content,{...x,ref:a,className:W("kui-BaseDialogContent","kui-DialogContent",u),"aria-modal":"true",onCloseAutoFocus:k=>{N?.(k),document.body.style.pointerEvents=""}}))))))});C.displayName="Dialog.Content";var d=o.forwardRef((e,i)=>o.createElement(t.Title,{asChild:!0},o.createElement(g,{size:"5",trim:"start",...e,asChild:!1,ref:i})));d.displayName="Dialog.Title";var R=o.forwardRef((e,i)=>o.createElement(t.Description,{asChild:!0},o.createElement(m,{as:"p",size:"3",...e,asChild:!1,ref:i})));R.displayName="Dialog.Description";var y=o.forwardRef(({children:e,...i},a)=>o.createElement(t.Close,{...i,ref:a,asChild:!0},l(e)));y.displayName="Dialog.Close";export{c as a,f as b,C as c,d,R as e,y as f,S as g};
3
+ //# sourceMappingURL=chunk-5BX2YZV6.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as I,b as y,c as z,d as _,e as K}from"./chunk-2ACVWLFA.js";import{a as te}from"./chunk-TGRHRMQI.js";import{b as H,c as U,d as k,e as Y,f as q}from"./chunk-GKDGNPBD.js";import{a as M,b as v,c as J,d as Q,e as E,f as Z,g as ee,h as N}from"./chunk-5JYSYTHA.js";import{c as B,e as oe,g,h as O,i as ne}from"./chunk-ISCZ57VL.js";import{b as h,c as $,d as T,e as x}from"./chunk-EB4AG3OL.js";import{a as L}from"./chunk-MGWGD6KI.js";import{c as S}from"./chunk-OKQAVYW4.js";import{a as G}from"./chunk-T2DZDW5Y.js";import{b as re}from"./chunk-YOZXIUZY.js";import{c as X}from"./chunk-5ON3XLRD.js";import{a as he}from"./chunk-VQPANPMI.js";var Oe={};he(Oe,{CheckboxItem:()=>Me,Content:()=>de,Group:()=>me,Item:()=>ce,Label:()=>le,RadioGroup:()=>De,RadioItem:()=>we,Root:()=>ue,Separator:()=>be,Sub:()=>fe,SubContent:()=>Re,SubTrigger:()=>Pe,Trigger:()=>se,TriggerIcon:()=>Ie});import*as e from"react";import l from"classnames";import{DropdownMenu as s,Slot as W}from"radix-ui";import{useCallbackRef as ie}from"radix-ui/internal";var ae=e.createContext(!1),ue=o=>{let{open:n,defaultOpen:t=!1,onOpenChange:u}=o,[i,r]=e.useState(t),a=n??i,c=ie(u),p=e.useCallback(D=>{r(D),c(D)},[c]),m=e.useCallback(()=>p(!1),[p]);return e.createElement(ae.Provider,{value:a},e.createElement(oe,{value:m},e.createElement(s.Root,{...o,open:a,onOpenChange:p})))};ue.displayName="DropdownMenu.Root";var se=e.forwardRef(({children:o,...n},t)=>e.createElement(s.Trigger,{...n,ref:t,asChild:!0},te(o)));se.displayName="DropdownMenu.Trigger";var V=e.createContext({}),Te={ltr:"ArrowLeft",rtl:"ArrowRight"},xe={ltr:"ArrowRight",rtl:"ArrowLeft"};function Ee(o){return o instanceof HTMLElement&&(o.isContentEditable||o.tagName==="INPUT"||o.tagName==="TEXTAREA")}function pe(o){return o?.closest("[dir]")?.getAttribute("dir")==="rtl"?"rtl":"ltr"}var de=e.forwardRef((o,n)=>{let t=X(o,I.size),u=re(),{size:i=I.size.default}=t,{className:r,children:a,color:c,container:p,forceMount:m,submenuBehavior:D,virtualized:d=!1,onEscapeKeyDown:P,onKeyDown:R,...f}=S(t,I),b=c||u.accentColor,A=h(D,"cascade"),F=A==="drill-down",ge=e.useContext(ae),C=J(),ye=w=>{P?.(w),!(w.defaultPrevented||!F||C.getDepth()===0)&&(w.preventDefault(),C.pop("keyboard"))},Se=w=>{R?.(w),!(w.defaultPrevented||!F||C.getDepth()===0)&&(Ee(w.target)||w.key===Te[pe(w.currentTarget)]&&(w.preventDefault(),C.pop("keyboard")))},ke=e.useMemo(()=>({size:i,color:b}),[i,b]),j=e.createElement(B,{size:i},e.createElement(V.Provider,{value:ke},e.createElement(Q,{store:C,behavior:A,open:ge},a)));return e.createElement(s.Portal,{container:p,forceMount:m},e.createElement(G,{asChild:!0},e.createElement(s.Content,{"data-accent-color":b,align:"start",sideOffset:4,collisionPadding:10,...f,onEscapeKeyDown:ye,onKeyDown:Se,asChild:!1,ref:n,className:l("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-DropdownMenuContent",r)},d?e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport","kui-virtualized")},j):e.createElement(L,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport")},j)))))});de.displayName="DropdownMenu.Content";var le=e.forwardRef(({className:o,id:n,...t},u)=>{let i=e.useContext(M),r=ne(n,i);return i?e.createElement(s.Label,{...t,id:r,asChild:!1,ref:u,className:l("kui-BaseMenuLabel","kui-DropdownMenuLabel",o)}):null});le.displayName="DropdownMenu.Label";var ce=e.forwardRef((o,n)=>{let{className:t,children:u,color:i=z.color.default,shortcut:r,...a}=o;return e.useContext(M)?e.createElement(s.Item,{"data-accent-color":i,"aria-keyshortcuts":r?T(r):void 0,...a,ref:n,className:l("kui-reset","kui-BaseMenuItem","kui-DropdownMenuItem",t)},e.createElement(W.Slottable,null,u),r&&e.createElement(x,{shortcut:r,className:"kui-DropdownMenuShortcut"})):null});ce.displayName="DropdownMenu.Item";var me=e.forwardRef(({className:o,"aria-labelledby":n,...t},u)=>{let[i,r]=O(n),a=e.useContext(M);return e.createElement(g,{value:r},e.createElement(s.Group,{...a?{"aria-labelledby":i}:{role:"none"},...t,asChild:!1,ref:u,className:l("kui-BaseMenuGroup","kui-DropdownMenuGroup",o)}))});me.displayName="DropdownMenu.Group";var De=e.forwardRef(({className:o,"aria-labelledby":n,...t},u)=>{let[i,r]=O(n),a=e.useContext(M);return e.createElement(g,{value:r},e.createElement(s.RadioGroup,{...a?{"aria-labelledby":i}:{role:"none"},...t,asChild:!1,ref:u,className:l("kui-BaseMenuRadioGroup","kui-DropdownMenuRadioGroup",o)}))});De.displayName="DropdownMenu.RadioGroup";var we=e.forwardRef((o,n)=>{let{children:t,className:u,color:i=K.color.default,...r}=o;return e.useContext(M)?e.createElement(s.RadioItem,{...r,asChild:!1,ref:n,"data-accent-color":i,className:l("kui-BaseMenuItem","kui-BaseMenuRadioItem","kui-DropdownMenuItem","kui-DropdownMenuRadioItem",u)},e.createElement(W.Slottable,null,t),e.createElement(s.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator"},e.createElement(q,{className:"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon"}))):null});we.displayName="DropdownMenu.RadioItem";var Me=e.forwardRef((o,n)=>{let{children:t,className:u,shortcut:i,color:r=_.color.default,...a}=o;return e.useContext(M)?e.createElement(s.CheckboxItem,{"aria-keyshortcuts":i?T(i):void 0,...a,asChild:!1,ref:n,"data-accent-color":r,className:l("kui-BaseMenuItem","kui-BaseMenuCheckboxItem","kui-DropdownMenuItem","kui-DropdownMenuCheckboxItem",u)},e.createElement(W.Slottable,null,t),e.createElement(s.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator"},e.createElement(H,{className:"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon"})),i&&e.createElement(x,{shortcut:i,className:"kui-DropdownMenuShortcut"})):null});Me.displayName="DropdownMenu.CheckboxItem";var fe=({label:o="Back",open:n,defaultOpen:t,onOpenChange:u,children:i})=>{let r=v(),a=e.useId(),c=e.useMemo(()=>({id:a,label:o}),[a,o]),p=E(r,a)!=="closed",m=ie(u),D=n!==void 0;e.useLayoutEffect(()=>{if(!(!r||!D))return r.setController(a,m),()=>r.setController(a,null)},[r,D,a,m]),e.useLayoutEffect(()=>{!r||n===void 0||(n&&!r.isOpen(a)?r.open(a,r.takePendingModality(a)):!n&&r.isOpen(a)&&r.close(a,r.takePendingModality(a)))},[r,n,a]);let d=e.useRef(n===void 0&&!!t);e.useLayoutEffect(()=>{r&&d.current?r.open(a):d.current=!1},[]);let P=e.useRef(p);return e.useEffect(()=>{if(!(!r||P.current===p)){if(P.current=p,p&&d.current){d.current=!1;return}n!==void 0&&n===p||m(p)}},[r,p,m,n]),e.createElement(ee.Provider,{value:c},e.createElement(s.Sub,{open:n,defaultOpen:t,onOpenChange:r?void 0:u},i))};fe.displayName="DropdownMenu.Sub";var Pe=e.forwardRef((o,n)=>{let{className:t,children:u,onKeyDown:i,...r}=o,a=v(),c=N(),p=e.useContext(M);if(a&&c){if(!p)return null;let m=d=>{d.preventDefault(),a.push(c.id)},D=d=>{i?.(d),!(d.defaultPrevented||r.disabled)&&d.key===xe[pe(d.currentTarget)]&&(d.preventDefault(),a.push(c.id,"keyboard"))};return e.createElement(s.Item,{...r,"data-drill-down-trigger":c.id,"data-drill-down-name":r.textValue,onSelect:m,onKeyDown:D,ref:n,className:l("kui-reset","kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-DropdownMenuItem","kui-DropdownMenuSubTrigger","kui-DropdownMenuDrillDownSubTrigger",t)},u,e.createElement("div",{className:"kui-BaseMenuShortcut kui-DropdownMenuShortcut"},e.createElement(k,{className:"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon"})))}return e.createElement(s.SubTrigger,{...r,onKeyDown:i,asChild:!1,ref:n,className:l("kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-DropdownMenuItem","kui-DropdownMenuSubTrigger",t)},u,e.createElement("div",{className:"kui-BaseMenuShortcut kui-DropdownMenuShortcut"},e.createElement(k,{className:"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon"})))});Pe.displayName="DropdownMenu.SubTrigger";var be=e.forwardRef(({className:o,...n},t)=>e.useContext(M)?e.createElement(s.Separator,{...n,asChild:!1,ref:t,className:l("kui-BaseMenuSeparator","kui-DropdownMenuSeparator",o)}):null);be.displayName="DropdownMenu.Separator";function Ne({label:o,name:n}){let t=v(),u=e.useCallback(a=>{a.preventDefault(),t?.pop()},[t]),i=typeof o=="string"?o:n,r=i&&i!=="Back"?`Back from ${i}`:void 0;return e.createElement(s.Item,{"aria-label":r,textValue:i||"Back",onSelect:u,className:l("kui-reset","kui-BaseMenuItem","kui-DropdownMenuItem","kui-DropdownMenuDrillDownBackItem")},e.createElement(Y,{className:"kui-BaseMenuSubTriggerIcon kui-DropdownMenuDrillDownBackIcon"}),e.createElement("span",{className:"kui-DropdownMenuDrillDownBackLabel"},o))}function Be(o){let{loop:n,onEscapeKeyDown:t,onPointerDownOutside:u,onFocusOutside:i,onInteractOutside:r,sideOffset:a,alignOffset:c,avoidCollisions:p,collisionBoundary:m,collisionPadding:D,arrowPadding:d,sticky:P,hideWhenDetached:R,updatePositionStrategy:f,...b}=o;return b}var Re=e.forwardRef((o,n)=>{let t=v(),u=N();return t&&u?e.createElement(ve,{...o,ref:n,store:t,sub:u}):e.createElement(Ce,{...o,ref:n})});Re.displayName="DropdownMenu.SubContent";var Ce=e.forwardRef((o,n)=>{let t=e.useContext(V),u=o.size??t.size,i=o.color??t.color,{className:r,children:a,container:c,forceMount:p,color:m,virtualized:D=!1,...d}=S({...o,size:u},y),P=h(u,y.size.default),R=e.useMemo(()=>({size:u,color:i}),[u,i]),f=e.createElement(B,{size:u},e.createElement(V.Provider,{value:R},a));return e.createElement(s.Portal,{container:c,forceMount:p},e.createElement(G,{asChild:!0},e.createElement(s.SubContent,{"data-accent-color":i,alignOffset:$(P),sideOffset:1,collisionPadding:10,...d,asChild:!1,ref:n,className:l("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-BaseMenuSubContent","kui-DropdownMenuContent","kui-DropdownMenuSubContent",r)},D?e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport","kui-virtualized")},f):e.createElement(L,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport")},f)))))});Ce.displayName="DropdownMenu.CascadeSubContent";var ve=e.forwardRef(({store:o,sub:n,...t},u)=>{let i=E(o,n.id),r=Z(o,n.id);if(i==="closed")return null;let{className:a,children:c,container:p,forceMount:m,virtualized:D,size:d,color:P,...R}=Be(t),f=i==="top",b=r?.name||(typeof n.label=="string"?n.label:"");return e.createElement("div",{role:"group","aria-label":b||void 0,...R,ref:u,"data-drill-down-panel":n.id,"data-drill-down-active":f?!0:void 0,className:l("kui-DropdownMenuDrillDownPanel",a)},f&&e.createElement(e.Fragment,null,e.createElement(Ne,{label:n.label,name:b}),e.createElement(s.Separator,{className:"kui-BaseMenuSeparator kui-DropdownMenuSeparator"})),e.createElement(g,{value:null},e.createElement(M.Provider,{value:f},c)))});ve.displayName="DropdownMenu.DrillDownPanel";var Ie=e.forwardRef(({className:o,...n},t)=>e.createElement(U,{...n,ref:t,className:l("kui-DropdownMenuTriggerIcon",o)}));Ie.displayName="DropdownMenu.TriggerIcon";export{ue as a,se as b,de as c,le as d,ce as e,me as f,De as g,we as h,Me as i,fe as j,Pe as k,be as l,Re as m,Ie as n,Oe as o};
3
- //# sourceMappingURL=chunk-VPP5IDW7.js.map
2
+ import{a as I,b as y,c as z,d as _,e as K}from"./chunk-2ACVWLFA.js";import{a as te}from"./chunk-TGRHRMQI.js";import{b as H,c as U,d as k,e as Y,f as q}from"./chunk-GKDGNPBD.js";import{a as M,b as v,c as J,d as Q,e as E,f as Z,g as ee,h as N}from"./chunk-5JYSYTHA.js";import{c as B,e as oe,g,h as O,i as ne}from"./chunk-ISCZ57VL.js";import{b as h,c as $,d as T,e as x}from"./chunk-EB4AG3OL.js";import{a as L}from"./chunk-MGWGD6KI.js";import{c as S}from"./chunk-OKQAVYW4.js";import{a as G}from"./chunk-AQKSO3SW.js";import{b as re}from"./chunk-FVRVBB6O.js";import{c as X}from"./chunk-5ON3XLRD.js";import{a as he}from"./chunk-VQPANPMI.js";var Oe={};he(Oe,{CheckboxItem:()=>Me,Content:()=>de,Group:()=>me,Item:()=>ce,Label:()=>le,RadioGroup:()=>De,RadioItem:()=>we,Root:()=>ue,Separator:()=>be,Sub:()=>fe,SubContent:()=>Re,SubTrigger:()=>Pe,Trigger:()=>se,TriggerIcon:()=>Ie});import*as e from"react";import l from"classnames";import{DropdownMenu as s,Slot as W}from"radix-ui";import{useCallbackRef as ie}from"radix-ui/internal";var ae=e.createContext(!1),ue=o=>{let{open:n,defaultOpen:t=!1,onOpenChange:u}=o,[i,r]=e.useState(t),a=n??i,c=ie(u),p=e.useCallback(D=>{r(D),c(D)},[c]),m=e.useCallback(()=>p(!1),[p]);return e.createElement(ae.Provider,{value:a},e.createElement(oe,{value:m},e.createElement(s.Root,{...o,open:a,onOpenChange:p})))};ue.displayName="DropdownMenu.Root";var se=e.forwardRef(({children:o,...n},t)=>e.createElement(s.Trigger,{...n,ref:t,asChild:!0},te(o)));se.displayName="DropdownMenu.Trigger";var V=e.createContext({}),Te={ltr:"ArrowLeft",rtl:"ArrowRight"},xe={ltr:"ArrowRight",rtl:"ArrowLeft"};function Ee(o){return o instanceof HTMLElement&&(o.isContentEditable||o.tagName==="INPUT"||o.tagName==="TEXTAREA")}function pe(o){return o?.closest("[dir]")?.getAttribute("dir")==="rtl"?"rtl":"ltr"}var de=e.forwardRef((o,n)=>{let t=X(o,I.size),u=re(),{size:i=I.size.default}=t,{className:r,children:a,color:c,container:p,forceMount:m,submenuBehavior:D,virtualized:d=!1,onEscapeKeyDown:P,onKeyDown:R,...f}=S(t,I),b=c||u.accentColor,A=h(D,"cascade"),F=A==="drill-down",ge=e.useContext(ae),C=J(),ye=w=>{P?.(w),!(w.defaultPrevented||!F||C.getDepth()===0)&&(w.preventDefault(),C.pop("keyboard"))},Se=w=>{R?.(w),!(w.defaultPrevented||!F||C.getDepth()===0)&&(Ee(w.target)||w.key===Te[pe(w.currentTarget)]&&(w.preventDefault(),C.pop("keyboard")))},ke=e.useMemo(()=>({size:i,color:b}),[i,b]),j=e.createElement(B,{size:i},e.createElement(V.Provider,{value:ke},e.createElement(Q,{store:C,behavior:A,open:ge},a)));return e.createElement(s.Portal,{container:p,forceMount:m},e.createElement(G,{asChild:!0},e.createElement(s.Content,{"data-accent-color":b,align:"start",sideOffset:4,collisionPadding:10,...f,onEscapeKeyDown:ye,onKeyDown:Se,asChild:!1,ref:n,className:l("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-DropdownMenuContent",r)},d?e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport","kui-virtualized")},j):e.createElement(L,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport")},j)))))});de.displayName="DropdownMenu.Content";var le=e.forwardRef(({className:o,id:n,...t},u)=>{let i=e.useContext(M),r=ne(n,i);return i?e.createElement(s.Label,{...t,id:r,asChild:!1,ref:u,className:l("kui-BaseMenuLabel","kui-DropdownMenuLabel",o)}):null});le.displayName="DropdownMenu.Label";var ce=e.forwardRef((o,n)=>{let{className:t,children:u,color:i=z.color.default,shortcut:r,...a}=o;return e.useContext(M)?e.createElement(s.Item,{"data-accent-color":i,"aria-keyshortcuts":r?T(r):void 0,...a,ref:n,className:l("kui-reset","kui-BaseMenuItem","kui-DropdownMenuItem",t)},e.createElement(W.Slottable,null,u),r&&e.createElement(x,{shortcut:r,className:"kui-DropdownMenuShortcut"})):null});ce.displayName="DropdownMenu.Item";var me=e.forwardRef(({className:o,"aria-labelledby":n,...t},u)=>{let[i,r]=O(n),a=e.useContext(M);return e.createElement(g,{value:r},e.createElement(s.Group,{...a?{"aria-labelledby":i}:{role:"none"},...t,asChild:!1,ref:u,className:l("kui-BaseMenuGroup","kui-DropdownMenuGroup",o)}))});me.displayName="DropdownMenu.Group";var De=e.forwardRef(({className:o,"aria-labelledby":n,...t},u)=>{let[i,r]=O(n),a=e.useContext(M);return e.createElement(g,{value:r},e.createElement(s.RadioGroup,{...a?{"aria-labelledby":i}:{role:"none"},...t,asChild:!1,ref:u,className:l("kui-BaseMenuRadioGroup","kui-DropdownMenuRadioGroup",o)}))});De.displayName="DropdownMenu.RadioGroup";var we=e.forwardRef((o,n)=>{let{children:t,className:u,color:i=K.color.default,...r}=o;return e.useContext(M)?e.createElement(s.RadioItem,{...r,asChild:!1,ref:n,"data-accent-color":i,className:l("kui-BaseMenuItem","kui-BaseMenuRadioItem","kui-DropdownMenuItem","kui-DropdownMenuRadioItem",u)},e.createElement(W.Slottable,null,t),e.createElement(s.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator"},e.createElement(q,{className:"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon"}))):null});we.displayName="DropdownMenu.RadioItem";var Me=e.forwardRef((o,n)=>{let{children:t,className:u,shortcut:i,color:r=_.color.default,...a}=o;return e.useContext(M)?e.createElement(s.CheckboxItem,{"aria-keyshortcuts":i?T(i):void 0,...a,asChild:!1,ref:n,"data-accent-color":r,className:l("kui-BaseMenuItem","kui-BaseMenuCheckboxItem","kui-DropdownMenuItem","kui-DropdownMenuCheckboxItem",u)},e.createElement(W.Slottable,null,t),e.createElement(s.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator"},e.createElement(H,{className:"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon"})),i&&e.createElement(x,{shortcut:i,className:"kui-DropdownMenuShortcut"})):null});Me.displayName="DropdownMenu.CheckboxItem";var fe=({label:o="Back",open:n,defaultOpen:t,onOpenChange:u,children:i})=>{let r=v(),a=e.useId(),c=e.useMemo(()=>({id:a,label:o}),[a,o]),p=E(r,a)!=="closed",m=ie(u),D=n!==void 0;e.useLayoutEffect(()=>{if(!(!r||!D))return r.setController(a,m),()=>r.setController(a,null)},[r,D,a,m]),e.useLayoutEffect(()=>{!r||n===void 0||(n&&!r.isOpen(a)?r.open(a,r.takePendingModality(a)):!n&&r.isOpen(a)&&r.close(a,r.takePendingModality(a)))},[r,n,a]);let d=e.useRef(n===void 0&&!!t);e.useLayoutEffect(()=>{r&&d.current?r.open(a):d.current=!1},[]);let P=e.useRef(p);return e.useEffect(()=>{if(!(!r||P.current===p)){if(P.current=p,p&&d.current){d.current=!1;return}n!==void 0&&n===p||m(p)}},[r,p,m,n]),e.createElement(ee.Provider,{value:c},e.createElement(s.Sub,{open:n,defaultOpen:t,onOpenChange:r?void 0:u},i))};fe.displayName="DropdownMenu.Sub";var Pe=e.forwardRef((o,n)=>{let{className:t,children:u,onKeyDown:i,...r}=o,a=v(),c=N(),p=e.useContext(M);if(a&&c){if(!p)return null;let m=d=>{d.preventDefault(),a.push(c.id)},D=d=>{i?.(d),!(d.defaultPrevented||r.disabled)&&d.key===xe[pe(d.currentTarget)]&&(d.preventDefault(),a.push(c.id,"keyboard"))};return e.createElement(s.Item,{...r,"data-drill-down-trigger":c.id,"data-drill-down-name":r.textValue,onSelect:m,onKeyDown:D,ref:n,className:l("kui-reset","kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-DropdownMenuItem","kui-DropdownMenuSubTrigger","kui-DropdownMenuDrillDownSubTrigger",t)},u,e.createElement("div",{className:"kui-BaseMenuShortcut kui-DropdownMenuShortcut"},e.createElement(k,{className:"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon"})))}return e.createElement(s.SubTrigger,{...r,onKeyDown:i,asChild:!1,ref:n,className:l("kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-DropdownMenuItem","kui-DropdownMenuSubTrigger",t)},u,e.createElement("div",{className:"kui-BaseMenuShortcut kui-DropdownMenuShortcut"},e.createElement(k,{className:"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon"})))});Pe.displayName="DropdownMenu.SubTrigger";var be=e.forwardRef(({className:o,...n},t)=>e.useContext(M)?e.createElement(s.Separator,{...n,asChild:!1,ref:t,className:l("kui-BaseMenuSeparator","kui-DropdownMenuSeparator",o)}):null);be.displayName="DropdownMenu.Separator";function Ne({label:o,name:n}){let t=v(),u=e.useCallback(a=>{a.preventDefault(),t?.pop()},[t]),i=typeof o=="string"?o:n,r=i&&i!=="Back"?`Back from ${i}`:void 0;return e.createElement(s.Item,{"aria-label":r,textValue:i||"Back",onSelect:u,className:l("kui-reset","kui-BaseMenuItem","kui-DropdownMenuItem","kui-DropdownMenuDrillDownBackItem")},e.createElement(Y,{className:"kui-BaseMenuSubTriggerIcon kui-DropdownMenuDrillDownBackIcon"}),e.createElement("span",{className:"kui-DropdownMenuDrillDownBackLabel"},o))}function Be(o){let{loop:n,onEscapeKeyDown:t,onPointerDownOutside:u,onFocusOutside:i,onInteractOutside:r,sideOffset:a,alignOffset:c,avoidCollisions:p,collisionBoundary:m,collisionPadding:D,arrowPadding:d,sticky:P,hideWhenDetached:R,updatePositionStrategy:f,...b}=o;return b}var Re=e.forwardRef((o,n)=>{let t=v(),u=N();return t&&u?e.createElement(ve,{...o,ref:n,store:t,sub:u}):e.createElement(Ce,{...o,ref:n})});Re.displayName="DropdownMenu.SubContent";var Ce=e.forwardRef((o,n)=>{let t=e.useContext(V),u=o.size??t.size,i=o.color??t.color,{className:r,children:a,container:c,forceMount:p,color:m,virtualized:D=!1,...d}=S({...o,size:u},y),P=h(u,y.size.default),R=e.useMemo(()=>({size:u,color:i}),[u,i]),f=e.createElement(B,{size:u},e.createElement(V.Provider,{value:R},a));return e.createElement(s.Portal,{container:c,forceMount:p},e.createElement(G,{asChild:!0},e.createElement(s.SubContent,{"data-accent-color":i,alignOffset:$(P),sideOffset:1,collisionPadding:10,...d,asChild:!1,ref:n,className:l("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-BaseMenuSubContent","kui-DropdownMenuContent","kui-DropdownMenuSubContent",r)},D?e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport","kui-virtualized")},f):e.createElement(L,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:l("kui-BaseMenuViewport","kui-DropdownMenuViewport")},f)))))});Ce.displayName="DropdownMenu.CascadeSubContent";var ve=e.forwardRef(({store:o,sub:n,...t},u)=>{let i=E(o,n.id),r=Z(o,n.id);if(i==="closed")return null;let{className:a,children:c,container:p,forceMount:m,virtualized:D,size:d,color:P,...R}=Be(t),f=i==="top",b=r?.name||(typeof n.label=="string"?n.label:"");return e.createElement("div",{role:"group","aria-label":b||void 0,...R,ref:u,"data-drill-down-panel":n.id,"data-drill-down-active":f?!0:void 0,className:l("kui-DropdownMenuDrillDownPanel",a)},f&&e.createElement(e.Fragment,null,e.createElement(Ne,{label:n.label,name:b}),e.createElement(s.Separator,{className:"kui-BaseMenuSeparator kui-DropdownMenuSeparator"})),e.createElement(g,{value:null},e.createElement(M.Provider,{value:f},c)))});ve.displayName="DropdownMenu.DrillDownPanel";var Ie=e.forwardRef(({className:o,...n},t)=>e.createElement(U,{...n,ref:t,className:l("kui-DropdownMenuTriggerIcon",o)}));Ie.displayName="DropdownMenu.TriggerIcon";export{ue as a,se as b,de as c,le as d,ce as e,me as f,De as g,we as h,Me as i,fe as j,Pe as k,be as l,Re as m,Ie as n,Oe as o};
3
+ //# sourceMappingURL=chunk-67UEMB4K.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as P}from"./chunk-4MNRLB57.js";import{a as e}from"./chunk-L54FWKJE.js";import{c as s}from"./chunk-OKQAVYW4.js";import{a as l}from"./chunk-T2DZDW5Y.js";import*as o from"react";import W from"classnames";import{Tooltip as t}from"radix-ui";var a={content:{type:"ReactNode",required:!0},width:e.width,minWidth:e.minWidth,maxWidth:{...e.maxWidth,default:"360px"}};var m=200,f=o.createContext(!1);function N({delayDuration:i=m,children:r,...p}){return o.createElement(f.Provider,{value:!0},o.createElement(t.Provider,{delayDuration:i,...p},r))}N.displayName="TooltipProvider";var g=o.forwardRef((i,r)=>{let{children:p,className:d,open:T,defaultOpen:c,onOpenChange:v,delayDuration:y,disableHoverableContent:h,content:u,container:R,forceMount:C,...D}=s(i,a),x={open:T,defaultOpen:c,onOpenChange:v,delayDuration:y,disableHoverableContent:h},w=o.useContext(f),n=o.createElement(t.Root,{...x},o.createElement(t.Trigger,{asChild:!0},p),o.createElement(t.Portal,{container:R,forceMount:C},o.createElement(l,{asChild:!0},o.createElement(t.Content,{sideOffset:4,collisionPadding:10,...D,asChild:!1,ref:r,className:W("kui-TooltipContent",d)},o.createElement(P,{as:"p",className:"kui-TooltipText",size:"1"},u),o.createElement(t.Arrow,{className:"kui-TooltipArrow"})))));return w?n:o.createElement(t.Provider,{delayDuration:m},n)});g.displayName="Tooltip";export{N as a,g as b};
3
- //# sourceMappingURL=chunk-MPCCYR7L.js.map
2
+ import{a as P}from"./chunk-4MNRLB57.js";import{a as e}from"./chunk-L54FWKJE.js";import{c as s}from"./chunk-OKQAVYW4.js";import{a as l}from"./chunk-AQKSO3SW.js";import*as o from"react";import W from"classnames";import{Tooltip as t}from"radix-ui";var a={content:{type:"ReactNode",required:!0},width:e.width,minWidth:e.minWidth,maxWidth:{...e.maxWidth,default:"360px"}};var m=200,f=o.createContext(!1);function N({delayDuration:i=m,children:r,...p}){return o.createElement(f.Provider,{value:!0},o.createElement(t.Provider,{delayDuration:i,...p},r))}N.displayName="TooltipProvider";var g=o.forwardRef((i,r)=>{let{children:p,className:d,open:T,defaultOpen:c,onOpenChange:v,delayDuration:y,disableHoverableContent:h,content:u,container:R,forceMount:C,...D}=s(i,a),x={open:T,defaultOpen:c,onOpenChange:v,delayDuration:y,disableHoverableContent:h},w=o.useContext(f),n=o.createElement(t.Root,{...x},o.createElement(t.Trigger,{asChild:!0},p),o.createElement(t.Portal,{container:R,forceMount:C},o.createElement(l,{asChild:!0},o.createElement(t.Content,{sideOffset:4,collisionPadding:10,...D,asChild:!1,ref:r,className:W("kui-TooltipContent",d)},o.createElement(P,{as:"p",className:"kui-TooltipText",size:"1"},u),o.createElement(t.Arrow,{className:"kui-TooltipArrow"})))));return w?n:o.createElement(t.Provider,{delayDuration:m},n)});g.displayName="Tooltip";export{N as a,g as b};
3
+ //# sourceMappingURL=chunk-6YWHNLSC.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as d}from"./chunk-CGFLZ3DC.js";import{a as R}from"./chunk-4MNRLB57.js";import{a as u,b as f}from"./chunk-5ON3XLRD.js";import*as e from"react";import z from"classnames";var v=e.createContext(void 0),C={values:["1","2","3","4"]},N=e.forwardRef(({kind:r,size:o="2",color:t="gray",className:c,children:a,trailing:s,leading:i,...l},n)=>e.createElement("div",{role:"status","aria-live":"polite",...l,ref:n,className:z("kui-NoticeRoot",`kui-r-size-${o}`,c),"data-kind":r,"data-accent-color":t},i?e.createElement("span",{className:"kui-NoticeIcon","aria-hidden":!0},i):null,e.createElement(R,{as:"div",size:o,className:"kui-NoticeText"},a),s));N.displayName="Strip";var g=e.forwardRef(({icon:r,action:o,onDismiss:t,dismissLabel:c="Dismiss",size:a,...s},i)=>{let l=e.useContext(v),n=f(a??l,C),p=o||t?e.createElement("span",{className:"kui-NoticeActions"},o?e.createElement(u.Provider,{value:n},o):null,t?e.createElement(d,{iconOnly:!0,size:n,variant:"ghost",color:"gray","aria-label":c,className:"kui-NoticeDismiss",onClick:t},e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},e.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null;return e.createElement(N,{...s,size:n,ref:i,kind:"notice",leading:r,trailing:p})});g.displayName="Notice";var k=e.forwardRef(({confirmLabel:r,cancelLabel:o="Not now",onConfirm:t,onCancel:c,busy:a=!1,size:s,color:i="gray",...l},n)=>{let p=e.useContext(v),m=f(s??p,C);return e.createElement(N,{...l,size:m,color:i,ref:n,kind:"confirmation",trailing:e.createElement("span",{className:"kui-NoticeActions"},e.createElement(d,{size:m,variant:"ghost",color:"gray",disabled:a,onClick:c},o),e.createElement(d,{size:m,variant:"solid",color:i,loading:a,onClick:t},r))})});k.displayName="Confirmation";export{v as a,g as b,k as c};
3
- //# sourceMappingURL=chunk-6C6EK2B5.js.map
2
+ import{a as d}from"./chunk-KJZSXLIX.js";import{a as R}from"./chunk-4MNRLB57.js";import{a as u,b as f}from"./chunk-5ON3XLRD.js";import*as e from"react";import z from"classnames";var v=e.createContext(void 0),C={values:["1","2","3","4"]},N=e.forwardRef(({kind:r,size:o="2",color:t="gray",className:c,children:a,trailing:s,leading:i,...l},n)=>e.createElement("div",{role:"status","aria-live":"polite",...l,ref:n,className:z("kui-NoticeRoot",`kui-r-size-${o}`,c),"data-kind":r,"data-accent-color":t},i?e.createElement("span",{className:"kui-NoticeIcon","aria-hidden":!0},i):null,e.createElement(R,{as:"div",size:o,className:"kui-NoticeText"},a),s));N.displayName="Strip";var g=e.forwardRef(({icon:r,action:o,onDismiss:t,dismissLabel:c="Dismiss",size:a,...s},i)=>{let l=e.useContext(v),n=f(a??l,C),p=o||t?e.createElement("span",{className:"kui-NoticeActions"},o?e.createElement(u.Provider,{value:n},o):null,t?e.createElement(d,{iconOnly:!0,size:n,variant:"ghost",color:"gray","aria-label":c,className:"kui-NoticeDismiss",onClick:t},e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},e.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null;return e.createElement(N,{...s,size:n,ref:i,kind:"notice",leading:r,trailing:p})});g.displayName="Notice";var k=e.forwardRef(({confirmLabel:r,cancelLabel:o="Not now",onConfirm:t,onCancel:c,busy:a=!1,size:s,color:i="gray",...l},n)=>{let p=e.useContext(v),m=f(s??p,C);return e.createElement(N,{...l,size:m,color:i,ref:n,kind:"confirmation",trailing:e.createElement("span",{className:"kui-NoticeActions"},e.createElement(d,{size:m,variant:"ghost",color:"gray",disabled:a,onClick:c},o),e.createElement(d,{size:m,variant:"solid",color:i,loading:a,onClick:t},r))})});k.displayName="Confirmation";export{v as a,g as b,k as c};
3
+ //# sourceMappingURL=chunk-7V6M3MIR.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{c as t}from"./chunk-YOZXIUZY.js";import{a as o}from"./chunk-ANQLWGFN.js";import*as e from"react";var m=e.forwardRef((r,a)=>e.createElement(o.Provider,{value:null},e.createElement(t,{...r,ref:a})));m.displayName="PortalTheme";export{m as a};
3
- //# sourceMappingURL=chunk-T2DZDW5Y.js.map
2
+ import{c as t}from"./chunk-FVRVBB6O.js";import{a as o}from"./chunk-ANQLWGFN.js";import*as e from"react";var m=e.forwardRef((r,a)=>e.createElement(o.Provider,{value:null},e.createElement(t,{...r,ref:a})));m.displayName="PortalTheme";export{m as a};
3
+ //# sourceMappingURL=chunk-AQKSO3SW.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{e as x}from"./chunk-OLTRWCQK.js";import{a as T,c as b}from"./chunk-3QWGSRYC.js";import{a as V,b as k,c as I}from"./chunk-LTUW36HM.js";import{a as N,b as w,c as B}from"./chunk-QKCNGEX4.js";import{a as E}from"./chunk-WEBNIUEX.js";import{b as A,d as H,g as U}from"./chunk-XUCR7L4G.js";import{a as y}from"./chunk-G66WDIIV.js";import{o as M}from"./chunk-GHWEXMF6.js";import*as e from"react";import pe from"classnames";import{useComposedRefs as ue}from"radix-ui/internal";var D=t=>t==="collapsed"?"closed":"open",Se=t=>t==="closed"?"collapsed":"expanded";function L(t){if(t===void 0)return;if(typeof t=="string")return D(t);let n={};for(let[r,i]of Object.entries(t))i!==void 0&&(n[r]=D(i));return n}var ce={controlled:"state",default:"defaultState"},be={initial:"overlay",sm:"fixed"},O=e.forwardRef((t,n)=>{let{className:r,presentation:i=be,expandedSize:o=288,minSize:s=200,maxSize:d=400,resizable:m=!1,collapsible:_=!0,onExpand:$,onCollapse:W,onResize:j,onResizeStart:q,onResizeEnd:F,snapPoints:l,snapTolerance:G,collapseThreshold:p,paneId:u,persistence:S,children:K,style:J,state:Q,defaultState:X,onStateChange:Y,size:f,defaultSize:P,onSizeChange:Z,sizeUpdate:ee,sizeUpdateMs:ae=50,inset:h,id:te,...c}=t,{table:g,attributes:ne}=I(i,"fixed"),a=V({name:"sidebar",label:"Sidebar",propNames:ce,id:te,controlled:L(Q),defaultValue:L(X),presentationTable:g,builtIn:A,onChange:(de,le)=>Y?.(Se(de),{reason:le}),onExpand:$,onCollapse:W,size:o});M("sidebar",h),e.useEffect(()=>{(l!==void 0||p!==void 0||u!==void 0||S!==void 0)&&void 0},[l,p,u,S]);let z=e.useRef(null),ie=ue(n,a.setElement,z),oe=w({name:"sidebar",elementId:a.id,elementRef:z,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:H,expandedSize:o,minSize:s,maxSize:d,resizable:m,collapsible:_,size:f,defaultSize:P,onSizeChange:Z,sizeUpdate:ee,sizeUpdateMs:ae,onResize:j,onResizeStart:q,onResizeEnd:F,snapPoints:l,snapTolerance:G,collapseThreshold:p,paneId:u,persistence:S,overlaying:a.overlaying,overlayingNow:()=>g[y()]==="overlay",requestCollapse:()=>a.setValue("closed","toggle"),requestToggle:()=>a.toggle("toggle")}),{handles:v,content:re}=B(K,b),se=m&&a.value!=="closed"&&!a.overlaying?e.createElement(E.Provider,{value:oe},v.length>0?v:e.createElement(T,null)):null,R=a.peeking?`var(--sidebar-size, ${o}px)`:void 0,C=N(f,P,s,d);return e.createElement("div",{...U(c),role:c.role??"navigation",id:a.id,ref:ie,className:pe("kui-ShellPane","kui-ShellSidebar",r),...k(a,ne),"data-inset":h||void 0,tabIndex:a.overlaying?-1:c.tabIndex,style:{...J,"--sidebar-expanded-size":`${o}px`,...C?{"--sidebar-size":C}:{},"--sidebar-min-size":`${s}px`,"--sidebar-max-size":`${d}px`,...R?{"--peek-sidebar-width":R}:{}}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(x,null,re)),se)});O.displayName="Shell.Sidebar";O.Handle=b;export{O as a};
3
- //# sourceMappingURL=chunk-ACMANOVD.js.map
2
+ import{f as x}from"./chunk-MJROOEPE.js";import{a as T,c as b}from"./chunk-3QWGSRYC.js";import{a as V,b as k,c as I}from"./chunk-LTUW36HM.js";import{a as N,b as w,c as B}from"./chunk-QKCNGEX4.js";import{a as E}from"./chunk-WEBNIUEX.js";import{b as A,d as H,g as U}from"./chunk-XUCR7L4G.js";import{a as y}from"./chunk-G66WDIIV.js";import{o as M}from"./chunk-GHWEXMF6.js";import*as e from"react";import pe from"classnames";import{useComposedRefs as ue}from"radix-ui/internal";var D=t=>t==="collapsed"?"closed":"open",Se=t=>t==="closed"?"collapsed":"expanded";function L(t){if(t===void 0)return;if(typeof t=="string")return D(t);let n={};for(let[r,i]of Object.entries(t))i!==void 0&&(n[r]=D(i));return n}var ce={controlled:"state",default:"defaultState"},be={initial:"overlay",sm:"fixed"},O=e.forwardRef((t,n)=>{let{className:r,presentation:i=be,expandedSize:o=288,minSize:s=200,maxSize:d=400,resizable:m=!1,collapsible:_=!0,onExpand:$,onCollapse:W,onResize:j,onResizeStart:q,onResizeEnd:F,snapPoints:l,snapTolerance:G,collapseThreshold:p,paneId:u,persistence:S,children:K,style:J,state:Q,defaultState:X,onStateChange:Y,size:f,defaultSize:P,onSizeChange:Z,sizeUpdate:ee,sizeUpdateMs:ae=50,inset:h,id:te,...c}=t,{table:g,attributes:ne}=I(i,"fixed"),a=V({name:"sidebar",label:"Sidebar",propNames:ce,id:te,controlled:L(Q),defaultValue:L(X),presentationTable:g,builtIn:A,onChange:(de,le)=>Y?.(Se(de),{reason:le}),onExpand:$,onCollapse:W,size:o});M("sidebar",h),e.useEffect(()=>{(l!==void 0||p!==void 0||u!==void 0||S!==void 0)&&void 0},[l,p,u,S]);let z=e.useRef(null),ie=ue(n,a.setElement,z),oe=w({name:"sidebar",elementId:a.id,elementRef:z,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:H,expandedSize:o,minSize:s,maxSize:d,resizable:m,collapsible:_,size:f,defaultSize:P,onSizeChange:Z,sizeUpdate:ee,sizeUpdateMs:ae,onResize:j,onResizeStart:q,onResizeEnd:F,snapPoints:l,snapTolerance:G,collapseThreshold:p,paneId:u,persistence:S,overlaying:a.overlaying,overlayingNow:()=>g[y()]==="overlay",requestCollapse:()=>a.setValue("closed","toggle"),requestToggle:()=>a.toggle("toggle")}),{handles:v,content:re}=B(K,b),se=m&&a.value!=="closed"&&!a.overlaying?e.createElement(E.Provider,{value:oe},v.length>0?v:e.createElement(T,null)):null,R=a.peeking?`var(--sidebar-size, ${o}px)`:void 0,C=N(f,P,s,d);return e.createElement("div",{...U(c),role:c.role??"navigation",id:a.id,ref:ie,className:pe("kui-ShellPane","kui-ShellSidebar",r),...k(a,ne),"data-inset":h||void 0,tabIndex:a.overlaying?-1:c.tabIndex,style:{...J,"--sidebar-expanded-size":`${o}px`,...C?{"--sidebar-size":C}:{},"--sidebar-min-size":`${s}px`,"--sidebar-max-size":`${d}px`,...R?{"--peek-sidebar-width":R}:{}}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(x,null,re)),se)});O.displayName="Shell.Sidebar";O.Handle=b;export{O as a};
3
+ //# sourceMappingURL=chunk-AS2STDGA.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{c as j}from"./chunk-OKQAVYW4.js";import{c as E}from"./chunk-HBWBPBSA.js";import{c as I}from"./chunk-5ON3XLRD.js";import{b as L}from"./chunk-XU74PNM2.js";import*as r from"react";import re from"classnames";import{Direction as ae,Slider as v}from"radix-ui";var te=["1","2","3","4"],g={size:{type:"enum",className:"kui-r-size",values:te,default:"2",responsive:!0},showTickLabels:{type:"boolean"},snapToTicks:{type:"boolean"},...E,...L};var ne=r.forwardRef((K,O)=>{let W=I(K,g.size),{className:B,color:G,radius:A,tabIndex:C,...H}=j(W,g),{ticks:c,unit:u,showTickLabels:U,snapToTicks:y,value:$,defaultValue:q,onValueChange:x,onValueCommit:p,"aria-label":F,"aria-labelledby":J,...i}=H,k=i.min??0,d=i.max??100,[Q,X]=r.useState(()=>q??[k]),P=$!==void 0,s=P?$:Q,D=r.useId(),Y=i.step,l=r.useMemo(()=>c?[...c].sort((e,t)=>e.value-t.value):[],[c]),m=r.useCallback(e=>{let t=l[0].value;for(let a of l)Math.abs(a.value-e)<Math.abs(t-e)&&(t=a.value);return t},[l]),R=r.useCallback((e,t)=>{let a=m(e);return e>t&&a<=t?l.find(n=>n.value>t)?.value??t:e<t&&a>=t?[...l].reverse().find(n=>n.value<t)?.value??t:a},[m,l]),f=r.useRef(!1),N=r.useCallback(e=>{let t=a=>u?`${a} ${u}`:a.toString();return e.length===1?`${t(e[0])} out of ${t(d)}`:e.length===2?`${t(e[0])} to ${t(e[1])} out of ${t(d)}`:`${e.map(t).join(", ")} out of ${t(d)}`},[u,d]),Z=ae.useDirection(i.dir),T=i.orientation??"horizontal",V=T==="vertical"?!i.inverted:Z==="rtl"!=!!i.inverted,S=r.useMemo(()=>c?c.map((e,t)=>{let a=(e.value-k)/(d-k)*100;return{...e,percentage:V?100-a:a,index:t}}):null,[c,k,d,V]),b=r.useRef(null),h=r.useRef(null),_=r.useCallback(e=>{b.current&&(b.current.textContent=N(e),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{b.current&&(b.current.textContent="")},1e3))},[N]),w=r.useCallback(e=>{let a=y&&l.length>0?e.map((n,o)=>f.current&&s[o]!==void 0?R(n,s[o]):m(n)):e;P||X(a),x?.(a)},[y,l,R,m,s,x,P]),ee=r.useCallback(e=>{if(!p)return;if(!y||l.length===0){p(e);return}let t=f.current,a=e.map((n,o)=>t&&s[o]!==void 0?R(n,s[o]):m(n));t&&a.every((n,o)=>n===s[o])||p(a)},[p,y,l,R,m,s]);return r.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),r.createElement("div",{className:"kui-SliderContainer","data-orientation":T,"data-has-ticks":S?"":void 0},r.createElement("div",{ref:b,"aria-live":"polite","aria-atomic":"true",className:"kui-sr-only"}),r.createElement(v.Root,{"data-accent-color":G,"data-radius":A,ref:O,...i,value:s,step:Y,onKeyDown:e=>{f.current=!0,i.onKeyDown?.(e)},onPointerDown:e=>{f.current=!1,i.onPointerDown?.(e)},onValueChange:w,onValueCommit:ee,asChild:!1,className:re("kui-SliderRoot",B)},r.createElement(v.Track,{className:"kui-SliderTrack"},r.createElement(v.Range,{className:"kui-SliderRange","data-inverted":i.inverted?"":void 0})),s.map((e,t)=>r.createElement(v.Thumb,{key:t,className:"kui-SliderThumb",...C!==void 0?{tabIndex:C}:void 0,"aria-label":F,"aria-labelledby":J,"aria-valuetext":u?`${e} ${u}`:void 0}))),S&&r.createElement("div",{className:"kui-SliderTicks","data-orientation":T,role:"group","aria-label":"Slider tick marks"},S.map(e=>r.createElement("button",{key:e.index,className:"kui-SliderTick",style:T==="vertical"?{top:`${e.percentage}%`}:{left:`${e.percentage}%`},disabled:i.disabled,onClick:()=>{let t=0;s.forEach((n,o)=>{let M=Math.abs(n-e.value),z=Math.abs(s[t]-e.value);(M<z||M===z&&e.value>n)&&(t=o)});let a=s.map((n,o)=>o===t?e.value:n).sort((n,o)=>n-o);f.current=!1,w(a),p?.(a),_(a)},"aria-label":`Set to ${e.label||(u?`${e.value} ${u}`:e.value)}`,"aria-describedby":e.label?void 0:`${D}-tick-${e.index}`,type:"button"},r.createElement("div",{className:"kui-SliderTickMark"}),e.label&&U!==!1&&r.createElement("div",{className:"kui-SliderTickLabel"},e.label),!e.label&&r.createElement("span",{id:`${D}-tick-${e.index}`,className:"kui-sr-only"},u?`${e.value} ${u}`:e.value)))))});ne.displayName="Slider";export{ne as a};
3
- //# sourceMappingURL=chunk-IDEDEPBM.js.map
2
+ import{c as j}from"./chunk-OKQAVYW4.js";import{c as I}from"./chunk-5ON3XLRD.js";import{c as E}from"./chunk-HBWBPBSA.js";import{b as L}from"./chunk-XU74PNM2.js";import*as r from"react";import re from"classnames";import{Direction as ae,Slider as v}from"radix-ui";var te=["1","2","3","4"],g={size:{type:"enum",className:"kui-r-size",values:te,default:"2",responsive:!0},showTickLabels:{type:"boolean"},snapToTicks:{type:"boolean"},...E,...L};var ne=r.forwardRef((K,O)=>{let W=I(K,g.size),{className:B,color:G,radius:A,tabIndex:C,...H}=j(W,g),{ticks:c,unit:u,showTickLabels:U,snapToTicks:y,value:$,defaultValue:q,onValueChange:x,onValueCommit:p,"aria-label":F,"aria-labelledby":J,...i}=H,k=i.min??0,d=i.max??100,[Q,X]=r.useState(()=>q??[k]),P=$!==void 0,s=P?$:Q,D=r.useId(),Y=i.step,l=r.useMemo(()=>c?[...c].sort((e,t)=>e.value-t.value):[],[c]),m=r.useCallback(e=>{let t=l[0].value;for(let a of l)Math.abs(a.value-e)<Math.abs(t-e)&&(t=a.value);return t},[l]),R=r.useCallback((e,t)=>{let a=m(e);return e>t&&a<=t?l.find(n=>n.value>t)?.value??t:e<t&&a>=t?[...l].reverse().find(n=>n.value<t)?.value??t:a},[m,l]),f=r.useRef(!1),N=r.useCallback(e=>{let t=a=>u?`${a} ${u}`:a.toString();return e.length===1?`${t(e[0])} out of ${t(d)}`:e.length===2?`${t(e[0])} to ${t(e[1])} out of ${t(d)}`:`${e.map(t).join(", ")} out of ${t(d)}`},[u,d]),Z=ae.useDirection(i.dir),T=i.orientation??"horizontal",V=T==="vertical"?!i.inverted:Z==="rtl"!=!!i.inverted,S=r.useMemo(()=>c?c.map((e,t)=>{let a=(e.value-k)/(d-k)*100;return{...e,percentage:V?100-a:a,index:t}}):null,[c,k,d,V]),b=r.useRef(null),h=r.useRef(null),_=r.useCallback(e=>{b.current&&(b.current.textContent=N(e),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{b.current&&(b.current.textContent="")},1e3))},[N]),w=r.useCallback(e=>{let a=y&&l.length>0?e.map((n,o)=>f.current&&s[o]!==void 0?R(n,s[o]):m(n)):e;P||X(a),x?.(a)},[y,l,R,m,s,x,P]),ee=r.useCallback(e=>{if(!p)return;if(!y||l.length===0){p(e);return}let t=f.current,a=e.map((n,o)=>t&&s[o]!==void 0?R(n,s[o]):m(n));t&&a.every((n,o)=>n===s[o])||p(a)},[p,y,l,R,m,s]);return r.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),r.createElement("div",{className:"kui-SliderContainer","data-orientation":T,"data-has-ticks":S?"":void 0},r.createElement("div",{ref:b,"aria-live":"polite","aria-atomic":"true",className:"kui-sr-only"}),r.createElement(v.Root,{"data-accent-color":G,"data-radius":A,ref:O,...i,value:s,step:Y,onKeyDown:e=>{f.current=!0,i.onKeyDown?.(e)},onPointerDown:e=>{f.current=!1,i.onPointerDown?.(e)},onValueChange:w,onValueCommit:ee,asChild:!1,className:re("kui-SliderRoot",B)},r.createElement(v.Track,{className:"kui-SliderTrack"},r.createElement(v.Range,{className:"kui-SliderRange","data-inverted":i.inverted?"":void 0})),s.map((e,t)=>r.createElement(v.Thumb,{key:t,className:"kui-SliderThumb",...C!==void 0?{tabIndex:C}:void 0,"aria-label":F,"aria-labelledby":J,"aria-valuetext":u?`${e} ${u}`:void 0}))),S&&r.createElement("div",{className:"kui-SliderTicks","data-orientation":T,role:"group","aria-label":"Slider tick marks"},S.map(e=>r.createElement("button",{key:e.index,className:"kui-SliderTick",style:T==="vertical"?{top:`${e.percentage}%`}:{left:`${e.percentage}%`},disabled:i.disabled,onClick:()=>{let t=0;s.forEach((n,o)=>{let M=Math.abs(n-e.value),z=Math.abs(s[t]-e.value);(M<z||M===z&&e.value>n)&&(t=o)});let a=s.map((n,o)=>o===t?e.value:n).sort((n,o)=>n-o);f.current=!1,w(a),p?.(a),_(a)},"aria-label":`Set to ${e.label||(u?`${e.value} ${u}`:e.value)}`,"aria-describedby":e.label?void 0:`${D}-tick-${e.index}`,type:"button"},r.createElement("div",{className:"kui-SliderTickMark"}),e.label&&U!==!1&&r.createElement("div",{className:"kui-SliderTickLabel"},e.label),!e.label&&r.createElement("span",{id:`${D}-tick-${e.index}`,className:"kui-sr-only"},u?`${e.value} ${u}`:e.value)))))});ne.displayName="Slider";export{ne as a};
3
+ //# sourceMappingURL=chunk-B6OFKABP.js.map