@womp/kookie-ui 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.css +13 -0
- package/dist/cjs/components/chatbar.js +2 -2
- package/dist/cjs/components/chatbar.js.map +4 -4
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/message-scroller.d.ts +6 -0
- package/dist/cjs/components/message-scroller.d.ts.map +1 -1
- package/dist/cjs/components/message-scroller.js +2 -2
- package/dist/cjs/components/message-scroller.js.map +4 -4
- package/dist/cjs/components/scroll-area.d.ts.map +1 -1
- package/dist/cjs/components/scroll-area.js +1 -1
- package/dist/cjs/components/scroll-area.js.map +4 -4
- package/dist/cjs/components/scroll-area.props.d.ts +10 -0
- package/dist/cjs/components/scroll-area.props.d.ts.map +1 -1
- package/dist/cjs/components/scroll-area.props.js +1 -1
- package/dist/cjs/components/scroll-area.props.js.map +2 -2
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +4 -4
- package/dist/cjs/components/table.js +1 -1
- package/dist/cjs/components/table.js.map +4 -4
- package/dist/cjs/components/theme-panel.js +3 -3
- package/dist/cjs/components/theme-panel.js.map +4 -4
- package/dist/cjs/hooks/use-scroll-edges.d.ts +12 -0
- package/dist/cjs/hooks/use-scroll-edges.d.ts.map +1 -0
- package/dist/cjs/hooks/use-scroll-edges.js +2 -0
- package/dist/cjs/hooks/use-scroll-edges.js.map +7 -0
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +2 -2
- package/dist/esm/{chunk-MWIIGYAJ.js → chunk-25LBWKEV.js} +2 -2
- package/dist/esm/{chunk-ABSKRHVM.js → chunk-36A5BYCN.js} +2 -2
- package/dist/esm/chunk-4D2OAD6I.js +2 -0
- package/dist/esm/chunk-4D2OAD6I.js.map +7 -0
- package/dist/esm/{chunk-YQRSAP46.js → chunk-53SZ4Y23.js} +2 -2
- package/dist/esm/chunk-5BWLY27A.js +2 -0
- package/dist/esm/chunk-5BWLY27A.js.map +7 -0
- package/dist/esm/chunk-COWZAUZR.js +2 -0
- package/dist/esm/chunk-COWZAUZR.js.map +7 -0
- package/dist/esm/{chunk-PHC3QBV3.js → chunk-MZXHKM4V.js} +2 -2
- package/dist/esm/{chunk-NIM7DIVH.js → chunk-PQKJNRMR.js} +2 -2
- package/dist/esm/{chunk-YTD3AJAU.js → chunk-QK5RBHKV.js} +2 -2
- package/dist/esm/chunk-XPRPYCII.js +2 -0
- package/dist/esm/{chunk-5KICSAT7.js.map → chunk-XPRPYCII.js.map} +2 -2
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/message-scroller.d.ts +6 -0
- package/dist/esm/components/message-scroller.d.ts.map +1 -1
- package/dist/esm/components/message-scroller.js +1 -1
- package/dist/esm/components/scroll-area.d.ts.map +1 -1
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/scroll-area.props.d.ts +10 -0
- package/dist/esm/components/scroll-area.props.d.ts.map +1 -1
- package/dist/esm/components/scroll-area.props.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/theme-panel.js +1 -1
- package/dist/esm/hooks/use-scroll-edges.d.ts +12 -0
- package/dist/esm/hooks/use-scroll-edges.d.ts.map +1 -0
- package/dist/esm/hooks/use-scroll-edges.js +2 -0
- package/dist/esm/hooks/use-scroll-edges.js.map +7 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +6 -2
- package/src/components/message-scroller.tsx +24 -5
- package/src/components/scroll-area.css +44 -0
- package/src/components/scroll-area.props.tsx +8 -0
- package/src/components/scroll-area.tsx +7 -1
- package/src/hooks/use-scroll-edges.ts +46 -0
- package/styles.css +13 -0
- package/dist/esm/chunk-5KICSAT7.js +0 -2
- package/dist/esm/chunk-CTA5ODAO.js +0 -2
- package/dist/esm/chunk-CTA5ODAO.js.map +0 -7
- package/dist/esm/chunk-W4WWN3RC.js +0 -2
- package/dist/esm/chunk-W4WWN3RC.js.map +0 -7
- /package/dist/esm/{chunk-MWIIGYAJ.js.map → chunk-25LBWKEV.js.map} +0 -0
- /package/dist/esm/{chunk-ABSKRHVM.js.map → chunk-36A5BYCN.js.map} +0 -0
- /package/dist/esm/{chunk-YQRSAP46.js.map → chunk-53SZ4Y23.js.map} +0 -0
- /package/dist/esm/{chunk-PHC3QBV3.js.map → chunk-MZXHKM4V.js.map} +0 -0
- /package/dist/esm/{chunk-NIM7DIVH.js.map → chunk-PQKJNRMR.js.map} +0 -0
- /package/dist/esm/{chunk-YTD3AJAU.js.map → chunk-QK5RBHKV.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-IBF5U4QW.js";import{a as X,b as q,c as J}from"./chunk-WHFJ4JUN.js";import{a as w}from"./chunk-VX6ARMWP.js";import{a as W}from"./chunk-4XGGX2V2.js";import{a as U}from"./chunk-
|
|
1
|
+
import{a as Q}from"./chunk-IBF5U4QW.js";import{a as X,b as q,c as J}from"./chunk-WHFJ4JUN.js";import{a as w}from"./chunk-VX6ARMWP.js";import{a as W}from"./chunk-4XGGX2V2.js";import{a as U}from"./chunk-COWZAUZR.js";import{a as j}from"./chunk-73QGEY2I.js";import{a as R}from"./chunk-OLAWVEAI.js";import{a as T}from"./chunk-4YFJWXL2.js";import{a as D}from"./chunk-ERNM3KVF.js";import{a as F}from"./chunk-GO7OHBHW.js";import{a as v}from"./chunk-5WRCK4R7.js";import{b as V,c as x}from"./chunk-SEY4NA45.js";import{a as O}from"./chunk-F22ZRNWL.js";import{a as s}from"./chunk-XYVLQDGR.js";import{a as i}from"./chunk-FHOCUZDR.js";import{a as G}from"./chunk-E67CIG6A.js";import*as e from"react";import{useCallbackRef as ie}from"radix-ui/internal";import{flushSync as re}from"react-dom";var Y=`
|
|
2
2
|
[contenteditable],
|
|
3
3
|
[role="combobox"],
|
|
4
4
|
[role="listbox"],
|
|
@@ -7,4 +7,4 @@ import{a as Q}from"./chunk-IBF5U4QW.js";import{a as X,b as q,c as J}from"./chunk
|
|
|
7
7
|
select,
|
|
8
8
|
textarea
|
|
9
9
|
`,se=e.forwardRef(({defaultOpen:n=!0,...o},r)=>{let[u,d]=e.useState(n),h=e.useRef(null),l=e.useRef(null);return e.useEffect(()=>{function C(c){let k=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey,g=document.activeElement?.closest(Y);if(c.key?.toUpperCase()==="T"&&!k&&!g){let f=!1;re(()=>{d(H=>(f=!H,f))}),f?(l.current=document.activeElement,h.current?.focus()):l.current?.focus()}}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[]),e.createElement(_,{...o,ref:r,triggerRef:h,open:u,shortcut:e.createElement(R,{content:"Press T to show/hide the Theme Panel",side:"bottom",sideOffset:6},e.createElement(G,{asChild:!0,size:"3",tabIndex:0,className:"rt-ThemePanelShortcut"},e.createElement("button",{type:"button",onClick:()=>d(C=>!C),ref:h,"aria-label":"Toggle the Theme Panel"},"T")))})});se.displayName="ThemePanel";var _=e.forwardRef((n,o)=>{let{open:r,onAppearanceChange:u,shortcut:d,triggerRef:h,...l}=n,C=V();return e.createElement(x,{asChild:!0,radius:"medium",scaling:"100%"},e.createElement(i,{direction:"column",position:"fixed",top:"0",right:"0",mr:{initial:"2",sm:"4"},mt:{initial:"2",sm:"4"},width:{initial:"360px"},maxHeight:{initial:"calc(100svh - var(--space-2) - var(--space-2))",sm:"calc(100svh - var(--space-4) - var(--space-4))"},maxWidth:{initial:"calc(100svw - var(--space-2) - var(--space-2))",sm:"calc(100svw - var(--space-4) - var(--space-4))"},inert:r?void 0:Q,...l,ref:o,style:{zIndex:999999999,overflow:"hidden",borderRadius:"var(--radius-4)",backgroundColor:"var(--color-panel-solid)",transformOrigin:"top center",transitionProperty:"transform, box-shadow",transitionDuration:"200ms",transitionTimingFunction:r?"ease-out":"ease-in",transform:r?"none":"translateX(105%)",boxShadow:r?"var(--shadow-5)":"var(--shadow-2)",...n.style}},e.createElement(U,null,e.createElement(T,{flexGrow:"1",p:{initial:"4",xs:"5"},position:"relative"},!!d&&e.createElement(T,{position:"absolute",top:"0",right:"0",m:"2"},d),e.createElement(ee,{onAppearanceChange:u,context:C})))))});_.displayName="ThemePanelImpl";var ee=e.forwardRef((n,o)=>{let{onAppearanceChange:r,context:u,...d}=n,h=V(),{appearance:l,onAppearanceChange:C,accentColor:c,onAccentColorChange:k,grayColor:g,onGrayColorChange:K,panelBackground:f,onPanelBackgroundChange:H,radius:M,onRadiusChange:te,scaling:Z,onScalingChange:ae}=u??h,[E,S]=e.useState(l==="inherit"?null:l),N=r!==void 0,$=ie(r),A=e.useCallback(t=>{let a=ce();if(l!=="inherit"){C(t);return}N?$(t):(S(t),de(t)),a()},[l,C,N,$]),I=O(c),z=g==="auto"?I:g,[ne,B]=e.useState("idle");async function oe(){let t={appearance:l===s.appearance.default?void 0:l,accentColor:c===s.accentColor.default?void 0:c,grayColor:g===s.grayColor.default?void 0:g,panelBackground:f===s.panelBackground.default?void 0:f,radius:M===s.radius.default?void 0:M,scaling:Z===s.scaling.default?void 0:Z},a=Object.keys(t).filter(p=>t[p]!==void 0).map(p=>`${p}="${t[p]}"`).join(" "),y=a?`<Theme ${a}>`:"<Theme>";B("copying"),await navigator.clipboard.writeText(y),B("copied"),setTimeout(()=>B("idle"),2e3)}return e.useEffect(()=>{function t(a){let y=a.altKey||a.ctrlKey||a.shiftKey||a.metaKey,p=document.activeElement?.closest(Y);a.key?.toUpperCase()==="D"&&!y&&!p&&A(E==="light"?"dark":"light")}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[A,E]),e.useEffect(()=>{let t=document.documentElement,a=document.body;function y(){let L=t.classList.contains("dark")||t.classList.contains("dark-theme")||a.classList.contains("dark")||a.classList.contains("dark-theme");S(l==="inherit"?L?"dark":"light":l)}let p=new MutationObserver(function(L){L.forEach(function(le){le.attributeName==="class"&&y()})});return y(),l==="inherit"&&(p.observe(t,{attributes:!0}),p.observe(a,{attributes:!0})),()=>p.disconnect()},[l]),e.createElement(i,{direction:"column",gap:"5",...d,ref:o},e.createElement(F,{size:{initial:"3",sm:"5"},trim:"both",as:"h2"},"Theme"),e.createElement(i,{direction:"column",gap:"5"},e.createElement(P,null,e.createElement(b,{id:"accent-color-title"},"Accent color"),e.createElement(i,{wrap:"wrap",gap:"2",role:"group","aria-labelledby":"accent-color-title"},s.accentColor.values.map(t=>e.createElement(T,{asChild:!0,key:t},e.createElement("label",{className:"rt-ThemePanelSwatch","aria-label":m(t),style:{backgroundColor:`var(--${t}-9)`}},e.createElement(R,{content:`${m(t)}${c==="gray"&&z!=="gray"?` (${m(z)})`:""}`},e.createElement("input",{className:"rt-ThemePanelSwatchInput",type:"radio",name:"accentColor",value:t,checked:c===t,onChange:a=>k(a.target.value)}))))))),e.createElement(P,null,e.createElement(b,{id:"gray-color-title"},"Gray color"),e.createElement(i,{wrap:"wrap",gap:"2",role:"group","aria-labelledby":"gray-color-title"},s.grayColor.values.map(t=>e.createElement(i,{key:t,asChild:!0,align:"center",justify:"center"},e.createElement("label",{className:"rt-ThemePanelSwatch","aria-label":m(t),style:{backgroundColor:t==="auto"?`var(--${I}-9)`:t==="gray"?"var(--gray-9)":`var(--${t}-9)`,filter:t==="gray"?"saturate(0)":void 0}},e.createElement(R,{content:`${m(t)}${t==="auto"?` (${m(I)})`:""}`},e.createElement("input",{className:"rt-ThemePanelSwatchInput",type:"radio",name:"grayColor",value:t,checked:g===t,onChange:a=>K(a.target.value)}))))))),e.createElement(P,null,e.createElement(b,{id:"appearance-title"},"Appearance"),e.createElement(w,{columns:"2",gap:"2",role:"group","aria-labelledby":"appearance-title"},["light","dark"].map(t=>e.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"appearance",value:t,checked:E===t,onChange:a=>A(a.target.value)}),e.createElement(i,{align:"center",justify:"center",height:"32px",gap:"2"},t==="light"?e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -1px"}},e.createElement("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})):e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -1px"}},e.createElement("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),e.createElement(v,{size:"1",weight:"medium"},m(t))))))),e.createElement(P,null,e.createElement(b,{id:"radius-title"},"Radius"),e.createElement(i,{gap:"2",role:"group","aria-labelledby":"radius-title",wrap:"wrap"},s.radius.values.map(t=>e.createElement(i,{key:t,direction:"column",align:"center"},e.createElement("label",{className:"rt-ThemePanelRadioCard"},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"radius",id:`theme-panel-radius-${t}`,value:t,checked:M===t,onChange:a=>te(a.target.value)}),e.createElement(x,{asChild:!0,radius:t},e.createElement(T,{m:"3",width:{initial:"24px",sm:"32px"},height:{initial:"24px",sm:"32px"},style:{borderTopLeftRadius:t==="full"?"80%":"var(--radius-5)",backgroundImage:"linear-gradient(to bottom right, var(--accent-3), var(--accent-4))",borderTop:"2px solid var(--accent-a8)",borderLeft:"2px solid var(--accent-a8)"}}))),e.createElement(T,{asChild:!0,pt:"2"},e.createElement(v,{asChild:!0,size:"1",emphasis:"medium"},e.createElement("label",{htmlFor:`theme-panel-radius-${t}`},m(t)))))))),e.createElement(P,null,e.createElement(b,{id:"scaling-title"},"Scaling"),e.createElement(w,{columns:{initial:"repeat(3, 1fr)",sm:"5"},gap:"2",role:"group","aria-labelledby":"scaling-title"},s.scaling.values.map(t=>e.createElement("label",{key:t,className:"rt-ThemePanelRadioCard","aria-label":`Scaling ${t}`},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"scaling",value:t,checked:Z===t,onChange:a=>ae(a.target.value)}),e.createElement(i,{align:"center",justify:"center",height:"32px"},e.createElement(x,{asChild:!0,scaling:t},e.createElement(i,{align:"center",justify:"center"},e.createElement(v,{size:"1",weight:"medium"},m(t))))))))),e.createElement(P,null,e.createElement(i,{align:"center",gap:"2"},e.createElement(b,{id:"panel-background-title"},"Panel background"),e.createElement(X,null,e.createElement(q,null,e.createElement(W,{size:"1",variant:"ghost",color:"gray"},e.createElement(D,{label:"Learn more about panel background options"},e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fillRule:"evenodd",clipRule:"evenodd"}))))),e.createElement(J,{size:"1",width:"220px",maxWidth:"90svw",minWidth:"0",side:"top",align:"center"},e.createElement(v,{as:"p",size:"1"},"Whether Card and Table panels are translucent, showing some of the background behind them.")))),e.createElement(w,{columns:{initial:"1",sm:"2"},rows:{initial:"2",sm:"1"},gap:"2",role:"group","aria-labelledby":"panel-background-title"},s.panelBackground.values.map(t=>e.createElement("label",{key:t,className:"rt-ThemePanelRadioCard"},e.createElement("input",{className:"rt-ThemePanelRadioCardInput",type:"radio",name:"panelBackground",value:t,checked:f===t,onChange:a=>H(a.target.value)}),e.createElement(i,{align:"center",justify:"center",height:"32px",gap:"2"},t==="solid"?e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -2px"}},e.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})):e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"0 -2px"}},e.createElement("path",{opacity:".05",d:"M6.78296 13.376C8.73904 9.95284 8.73904 5.04719 6.78296 1.62405L7.21708 1.37598C9.261 4.95283 9.261 10.0472 7.21708 13.624L6.78296 13.376Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".1",d:"M7.28204 13.4775C9.23929 9.99523 9.23929 5.00475 7.28204 1.52248L7.71791 1.2775C9.76067 4.9119 9.76067 10.0881 7.71791 13.7225L7.28204 13.4775Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".15",d:"M7.82098 13.5064C9.72502 9.99523 9.72636 5.01411 7.82492 1.50084L8.26465 1.26285C10.2465 4.92466 10.2451 10.085 8.26052 13.7448L7.82098 13.5064Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".2",d:"M8.41284 13.429C10.1952 9.92842 10.1957 5.07537 8.41435 1.57402L8.85999 1.34729C10.7139 4.99113 10.7133 10.0128 8.85841 13.6559L8.41284 13.429Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".25",d:"M9.02441 13.2956C10.6567 9.8379 10.6586 5.17715 9.03005 1.71656L9.48245 1.50366C11.1745 5.09919 11.1726 9.91629 9.47657 13.5091L9.02441 13.2956Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".3",d:"M9.66809 13.0655C11.1097 9.69572 11.1107 5.3121 9.67088 1.94095L10.1307 1.74457C11.6241 5.24121 11.6231 9.76683 10.1278 13.2622L9.66809 13.0655Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".35",d:"M10.331 12.7456C11.5551 9.52073 11.5564 5.49103 10.3347 2.26444L10.8024 2.0874C12.0672 5.42815 12.0659 9.58394 10.7985 12.9231L10.331 12.7456Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".4",d:"M11.0155 12.2986C11.9938 9.29744 11.9948 5.71296 11.0184 2.71067L11.4939 2.55603C12.503 5.6589 12.502 9.35178 11.4909 12.4535L11.0155 12.2986Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".45",d:"M11.7214 11.668C12.4254 9.01303 12.4262 5.99691 11.7237 3.34116L12.2071 3.21329C12.9318 5.95292 12.931 9.05728 12.2047 11.7961L11.7214 11.668Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{opacity:".5",d:"M12.4432 10.752C12.8524 8.63762 12.8523 6.36089 12.4429 4.2466L12.9338 4.15155C13.3553 6.32861 13.3554 8.66985 12.9341 10.847L12.4432 10.752Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}),e.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})),e.createElement(v,{size:"1",weight:"medium"},m(t)))))))),e.createElement(j,{style:{width:"100%"},onClick:oe},ne==="copied"?"Copied":"Copy Theme"))});ee.displayName="ThemePanelContent";function P(n){return e.createElement(i,{direction:"column",gap:"3",asChild:!0,...n},e.createElement("section",null,n.children))}function b(n){return e.createElement(F,{as:"h3",size:{initial:"1",sm:"2"},...n})}function ce(){let n=document.createElement("style");return n.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(n),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(n)},1)}}function m(n){return n.charAt(0).toUpperCase()+n.slice(1)}function de(n){let o=document.documentElement,r=o.classList.contains("light-theme"),u=o.classList.contains("dark-theme"),d=o.classList.contains("light"),h=o.classList.contains("dark");(r||u)&&(o.classList.remove("light-theme","dark-theme"),o.style.colorScheme=n,o.classList.add(`${n}-theme`)),(d||h)&&(o.classList.remove("light","dark"),o.style.colorScheme=n,o.classList.add(n)),!r&&!u&&!d&&!h&&(o.style.colorScheme=n,o.classList.add(n))}export{se as a,ee as b};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-25LBWKEV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p,b as R,c as n}from"./chunk-BALS3AVM.js";import{a as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p,b as R,c as n}from"./chunk-BALS3AVM.js";import{a as b}from"./chunk-COWZAUZR.js";import{a as d}from"./chunk-GSTOGDAJ.js";import{a as s}from"./chunk-6FLLFCBU.js";import{b as m}from"./chunk-JUY7CBSL.js";import{a as h}from"./chunk-OS3FCYZY.js";var v={};h(v,{Body:()=>c,Cell:()=>C,ColumnHeaderCell:()=>y,Header:()=>T,Root:()=>P,Row:()=>f,RowHeaderCell:()=>i});import*as e from"react";import t from"classnames";var P=e.forwardRef((o,l)=>{let{layout:a,...r}=p,{className:w,children:u,layout:H,...N}=s(o,r,d),E=m({value:H,className:p.layout.className,propValues:p.layout.values});return e.createElement("div",{ref:l,className:t("rt-TableRoot",w),...N},e.createElement(b,null,e.createElement("table",{className:t("rt-TableRootTable",E)},u)))});P.displayName="Table.Root";var T=e.forwardRef(({className:o,...l},a)=>e.createElement("thead",{...l,ref:a,className:t("rt-TableHeader",o)}));T.displayName="Table.Header";var c=e.forwardRef(({className:o,...l},a)=>e.createElement("tbody",{...l,ref:a,className:t("rt-TableBody",o)}));c.displayName="Table.Body";var f=e.forwardRef((o,l)=>{let{className:a,...r}=s(o,R);return e.createElement("tr",{...r,ref:l,className:t("rt-TableRow",a)})});f.displayName="Table.Row";var C=e.forwardRef((o,l)=>{let{className:a,...r}=s(o,n);return e.createElement("td",{className:t("rt-TableCell",a),ref:l,...r})});C.displayName="Table.Cell";var y=e.forwardRef((o,l)=>{let{className:a,...r}=s(o,n);return e.createElement("th",{className:t("rt-TableCell","rt-TableColumnHeaderCell",a),scope:"col",ref:l,...r})});y.displayName="Table.ColumnHeaderCell";var i=e.forwardRef((o,l)=>{let{className:a,...r}=s(o,n);return e.createElement("th",{className:t("rt-TableCell","rt-TableRowHeaderCell",a),scope:"row",ref:l,...r})});i.displayName="Table.RowHeaderCell";export{P as a,T as b,c,f as d,C as e,y as f,i as g,v as h};
|
|
2
|
+
//# sourceMappingURL=chunk-36A5BYCN.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as m}from"./chunk-4XGGX2V2.js";import{a as d}from"./chunk-5BWLY27A.js";import{a as v}from"./chunk-OS3FCYZY.js";var C={};v(C,{Button:()=>P,Content:()=>f,Item:()=>g,Root:()=>u,Viewport:()=>S,useMessageScroller:()=>y,useMessageScrollerScrollable:()=>w,useMessageScrollerVisibility:()=>B});import*as e from"react";import c from"classnames";import{MessageScroller as l,useMessageScroller as y,useMessageScrollerScrollable as w,useMessageScrollerVisibility as B}from"@shadcn/react/message-scroller";import{useComposedRefs as h}from"radix-ui/internal";var u=e.forwardRef(({autoScroll:o=!0,defaultScrollPosition:t="end",scrollEdgeThreshold:r,scrollMargin:s,className:a,children:n,...i},p)=>e.createElement(l.Provider,{autoScroll:o,defaultScrollPosition:t,...r!=null?{scrollEdgeThreshold:r}:{},...s!=null?{scrollMargin:s}:{}},e.createElement(l.Root,{...i,ref:p,className:c("rt-MessageScrollerRoot",a)},n)));u.displayName="MessageScroller.Root";var S=e.forwardRef(({className:o,"aria-label":t,fade:r=!0,...s},a)=>{let n=d(r),i=h(a,n);return e.createElement(l.Viewport,{"aria-label":t??"",...s,ref:i,"data-fade":r?"":void 0,className:c("rt-MessageScrollerViewport",o)})});S.displayName="MessageScroller.Viewport";var f=e.forwardRef(({className:o,...t},r)=>e.createElement(l.Content,{...t,ref:r,className:c("rt-MessageScrollerContent",o)}));f.displayName="MessageScroller.Content";var g=e.forwardRef(({className:o,...t},r)=>e.createElement(l.Item,{...t,ref:r,className:c("rt-MessageScrollerItem",o)}));g.displayName="MessageScroller.Item";var P=e.forwardRef(({direction:o="end",behavior:t,className:r,children:s,size:a="2",variant:n="surface",color:i="gray",radius:p="full","aria-label":M,...R},b)=>e.createElement(l.Button,{direction:o,...t?{behavior:t}:{},render:e.createElement(m,{...R,ref:b,size:a,variant:n,color:i,radius:p,"aria-label":M??(o==="end"?"Jump to the latest":"Jump to the first"),className:c("rt-MessageScrollerButton",r),"data-direction":o},s??e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:o==="start"?{transform:"rotate(180deg)"}:void 0},e.createElement("path",{d:"M7.5 2.5v10M3.5 8.5l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))}));P.displayName="MessageScroller.Button";export{y as a,w as b,B as c,u as d,S as e,f,g,P as h,C as i};
|
|
2
|
+
//# sourceMappingURL=chunk-4D2OAD6I.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/message-scroller.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\n/**\n * MessageScroller \u2014 a transcript that follows a conversation.\n *\n * The behaviour is shadcn/ui's Message Scroller primitive (`@shadcn/react/message-scroller`,\n * MIT, https://ui.shadcn.com). Streaming, anchoring a new turn, keeping your place when history\n * loads above, and jumping back to the latest are a body of edge cases nobody should rewrite, so\n * Kookie takes the primitive and adds only the surface: the parts, the class names, the button.\n *\n * Anatomy\n * ```tsx\n * <MessageScroller.Root>\n * <MessageScroller.Viewport aria-label=\"Conversation\">\n * <MessageScroller.Content>\n * <MessageScroller.Item messageId=\"u1\" scrollAnchor>\u2026</MessageScroller.Item>\n * <MessageScroller.Item messageId=\"a1\">\u2026</MessageScroller.Item>\n * </MessageScroller.Content>\n * </MessageScroller.Viewport>\n * <MessageScroller.Button aria-label=\"Jump to the latest\" />\n * </MessageScroller.Root>\n * ```\n *\n * The viewport is its own scroller. Kookie's `ScrollArea` is Radix's, and Radix cannot hand its\n * viewport element to another library, so the transcript scrolls natively with a thin scrollbar.\n *\n * Requires React 19, which the primitive needs.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport {\n MessageScroller as Primitive,\n useMessageScroller,\n useMessageScrollerScrollable,\n useMessageScrollerVisibility,\n type MessageScrollerDefaultScrollPosition,\n type MessageScrollerScrollOptions,\n type MessageScrollerScrollable,\n type MessageScrollerVisibilityState,\n} from '@shadcn/react/message-scroller';\n\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { IconButton, type IconButtonProps } from './icon-button.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\n\ninterface RootProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Keeps the newest content in view while the reader is at the end. Default `true`.\n * Once the reader scrolls up, the transcript stays where they are until they return.\n */\n autoScroll?: boolean;\n /** Where the transcript opens: `end` (default), `start`, or the last anchored message. */\n defaultScrollPosition?: MessageScrollerDefaultScrollPosition;\n /** Distance in pixels from the end that still counts as \"at the end\". */\n scrollEdgeThreshold?: number;\n /** Space in pixels kept above a message when one is scrolled to or anchored. */\n scrollMargin?: number;\n}\n\n/** Holds the scroll state. Everything else goes inside it. */\nconst Root = React.forwardRef<HTMLDivElement, RootProps>(\n ({ autoScroll = true, defaultScrollPosition = 'end', scrollEdgeThreshold, scrollMargin, className, children, ...props }, forwardedRef) => (\n <Primitive.Provider\n autoScroll={autoScroll}\n defaultScrollPosition={defaultScrollPosition}\n {...(scrollEdgeThreshold != null ? { scrollEdgeThreshold } : {})}\n {...(scrollMargin != null ? { scrollMargin } : {})}\n >\n <Primitive.Root {...props} ref={forwardedRef} className={classNames('rt-MessageScrollerRoot', className)}>\n {children}\n </Primitive.Root>\n </Primitive.Provider>\n ),\n);\nRoot.displayName = 'MessageScroller.Root';\n\ninterface ViewportProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Name of the transcript region, e.g. \"Conversation\". */\n 'aria-label'?: string;\n /** Keep the reader's place when older messages are added above. Default `true`. */\n preserveScrollOnPrepend?: boolean;\n /**\n * Fades messages toward the top and bottom edges while there is more past them. A floating\n * band over an edge (a toolbar, a goal tray, a composer) can set `--scroll-fade-start` or\n * `--scroll-fade-end` to its height, so messages fade as they pass under it. Default `true`.\n */\n fade?: boolean;\n}\n\n/** The scrolling element. */\nconst Viewport = React.forwardRef<HTMLDivElement, ViewportProps>(({ className, 'aria-label': label, fade = true, ...props }, forwardedRef) => {\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const ref = useComposedRefs(forwardedRef, setEdgesElement);\n return (\n // The primitive names an unnamed viewport \"Messages\", in English. An empty name is skipped by\n // accessible-name computation, so a transcript is only named when the app names it.\n <Primitive.Viewport\n aria-label={label ?? ''}\n {...props}\n ref={ref}\n data-fade={fade ? '' : undefined}\n className={classNames('rt-MessageScrollerViewport', className)}\n />\n );\n});\nViewport.displayName = 'MessageScroller.Viewport';\n\ntype ContentProps = React.ComponentPropsWithoutRef<'div'>;\n\n/** The list of messages, inside the viewport. */\nconst Content = React.forwardRef<HTMLDivElement, ContentProps>(({ className, ...props }, forwardedRef) => (\n <Primitive.Content {...props} ref={forwardedRef} className={classNames('rt-MessageScrollerContent', className)} />\n));\nContent.displayName = 'MessageScroller.Content';\n\ninterface ItemProps extends React.ComponentPropsWithoutRef<'div'> {\n /** A stable id, so the row can be scrolled to with `useMessageScroller().scrollToMessage`. */\n messageId?: string;\n /** Anchor this row near the top when it arrives. Set it on the person's own messages. */\n scrollAnchor?: boolean;\n}\n\n/** One row of the transcript. */\nconst Item = React.forwardRef<HTMLDivElement, ItemProps>(({ className, ...props }, forwardedRef) => (\n <Primitive.Item {...props} ref={forwardedRef} className={classNames('rt-MessageScrollerItem', className)} />\n));\nItem.displayName = 'MessageScroller.Item';\n\ntype ButtonProps = Omit<IconButtonProps, 'aria-label' | 'aria-labelledby'> & {\n /** Accessible name, in your words. Default \"Jump to the latest\". */\n 'aria-label'?: string;\n /** `end` jumps to the latest message (default); `start` to the first. */\n direction?: 'start' | 'end';\n /** Scroll behaviour of the jump. Default `smooth`. */\n behavior?: ScrollBehavior;\n};\n\n/**\n * Jumps back to the latest message. It renders only while the reader is away from the end.\n * Place it inside `Root`, after the viewport. It sits over the viewport's bottom edge.\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ direction = 'end', behavior, className, children, size = '2', variant = 'surface', color = 'gray', radius = 'full', 'aria-label': label, ...props }, forwardedRef) => (\n <Primitive.Button\n direction={direction}\n {...(behavior ? { behavior } : {})}\n render={\n <IconButton\n {...props}\n ref={forwardedRef}\n size={size}\n variant={variant}\n color={color}\n radius={radius}\n aria-label={label ?? (direction === 'end' ? 'Jump to the latest' : 'Jump to the first')}\n className={classNames('rt-MessageScrollerButton', className)}\n data-direction={direction}\n >\n {children ?? (\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" aria-hidden style={direction === 'start' ? { transform: 'rotate(180deg)' } : undefined}>\n <path d=\"M7.5 2.5v10M3.5 8.5l4 4 4-4\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )}\n </IconButton>\n }\n />\n ),\n);\nButton.displayName = 'MessageScroller.Button';\n\nexport { Root, Viewport, Content, Item, Button, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility };\nexport type {\n RootProps as MessageScrollerRootProps,\n ViewportProps as MessageScrollerViewportProps,\n ContentProps as MessageScrollerContentProps,\n ItemProps as MessageScrollerItemProps,\n ButtonProps as MessageScrollerButtonProps,\n MessageScrollerDefaultScrollPosition,\n MessageScrollerScrollOptions,\n MessageScrollerScrollable,\n MessageScrollerVisibilityState,\n};\n"],
|
|
5
|
+
"mappings": "wHAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,YAAAC,EAAA,SAAAC,EAAA,SAAAC,EAAA,aAAAC,EAAA,uBAAAC,EAAA,iCAAAC,EAAA,iCAAAC,IA6BA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OACE,mBAAmBC,EACnB,sBAAAL,EACA,gCAAAC,EACA,gCAAAC,MAKK,iCAEP,OAAS,mBAAAI,MAAuB,oBAoBhC,IAAMC,EAAa,aACjB,CAAC,CAAE,WAAAC,EAAa,GAAM,sBAAAC,EAAwB,MAAO,oBAAAC,EAAqB,aAAAC,EAAc,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IACvH,gBAACC,EAAU,SAAV,CACC,WAAYR,EACZ,sBAAuBC,EACtB,GAAIC,GAAuB,KAAO,CAAE,oBAAAA,CAAoB,EAAI,CAAC,EAC7D,GAAIC,GAAgB,KAAO,CAAE,aAAAA,CAAa,EAAI,CAAC,GAEhD,gBAACK,EAAU,KAAV,CAAgB,GAAGF,EAAO,IAAKC,EAAc,UAAWE,EAAW,yBAA0BL,CAAS,GACpGC,CACH,CACF,CAEJ,EACAN,EAAK,YAAc,uBAgBnB,IAAMW,EAAiB,aAA0C,CAAC,CAAE,UAAAN,EAAW,aAAcO,EAAO,KAAAC,EAAO,GAAM,GAAGN,CAAM,EAAGC,IAAiB,CAC5I,IAAMM,EAAkBC,EAA+BF,CAAI,EACrDG,EAAMC,EAAgBT,EAAcM,CAAe,EACzD,OAGE,gBAACL,EAAU,SAAV,CACC,aAAYG,GAAS,GACpB,GAAGL,EACJ,IAAKS,EACL,YAAWH,EAAO,GAAK,OACvB,UAAWH,EAAW,6BAA8BL,CAAS,EAC/D,CAEJ,CAAC,EACDM,EAAS,YAAc,2BAKvB,IAAMO,EAAgB,aAAyC,CAAC,CAAE,UAAAb,EAAW,GAAGE,CAAM,EAAGC,IACvF,gBAACC,EAAU,QAAV,CAAmB,GAAGF,EAAO,IAAKC,EAAc,UAAWE,EAAW,4BAA6BL,CAAS,EAAG,CACjH,EACDa,EAAQ,YAAc,0BAUtB,IAAMC,EAAa,aAAsC,CAAC,CAAE,UAAAd,EAAW,GAAGE,CAAM,EAAGC,IACjF,gBAACC,EAAU,KAAV,CAAgB,GAAGF,EAAO,IAAKC,EAAc,UAAWE,EAAW,yBAA0BL,CAAS,EAAG,CAC3G,EACDc,EAAK,YAAc,uBAenB,IAAMC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAY,MAAO,SAAAC,EAAU,UAAAjB,EAAW,SAAAC,EAAU,KAAAiB,EAAO,IAAK,QAAAC,EAAU,UAAW,MAAAC,EAAQ,OAAQ,OAAAC,EAAS,OAAQ,aAAcd,EAAO,GAAGL,CAAM,EAAGC,IACtJ,gBAACC,EAAU,OAAV,CACC,UAAWY,EACV,GAAIC,EAAW,CAAE,SAAAA,CAAS,EAAI,CAAC,EAChC,OACE,gBAACK,EAAA,CACE,GAAGpB,EACJ,IAAKC,EACL,KAAMe,EACN,QAASC,EACT,MAAOC,EACP,OAAQC,EACR,aAAYd,IAAUS,IAAc,MAAQ,qBAAuB,qBACnE,UAAWX,EAAW,2BAA4BL,CAAS,EAC3D,iBAAgBgB,GAEff,GACC,gBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,cAAW,GAAC,MAAOe,IAAc,QAAU,CAAE,UAAW,gBAAiB,EAAI,QACvI,gBAAC,QAAK,EAAE,8BAA8B,OAAO,eAAe,YAAY,MAAM,cAAc,QAAQ,eAAe,QAAQ,CAC7H,CAEJ,EAEJ,CAEJ,EACAD,EAAO,YAAc",
|
|
6
|
+
"names": ["message_scroller_exports", "__export", "Button", "Content", "Item", "Root", "Viewport", "useMessageScroller", "useMessageScrollerScrollable", "useMessageScrollerVisibility", "React", "classNames", "Primitive", "useComposedRefs", "Root", "autoScroll", "defaultScrollPosition", "scrollEdgeThreshold", "scrollMargin", "className", "children", "props", "forwardedRef", "Primitive", "classNames", "Viewport", "label", "fade", "setEdgesElement", "useScrollEdges", "ref", "useComposedRefs", "Content", "Item", "Button", "direction", "behavior", "size", "variant", "color", "radius", "IconButton"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as x}from"./chunk-2CMM7MEL.js";import{a as q}from"./chunk-VR7ZAFYN.js";import{a as j,b as O,c as _,e as k,f as U}from"./chunk-PHC3QBV3.js";import{a as F,b as K,c as $}from"./chunk-WHFJ4JUN.js";import{a as V}from"./chunk-CTA5ODAO.js";import{d as W}from"./chunk-IX5HIHVI.js";import{a as B}from"./chunk-KMPE7TJ6.js";import{b as G}from"./chunk-SEY4NA45.js";import{b as L}from"./chunk-FWB47YCH.js";import{a as E}from"./chunk-E67CIG6A.js";import{a as H}from"./chunk-6FLLFCBU.js";import{a as le}from"./chunk-OS3FCYZY.js";var fe={};le(fe,{Content:()=>Y,Footer:()=>ee,Group:()=>ce,GroupContent:()=>ue,GroupLabel:()=>de,Header:()=>Z,Menu:()=>re,MenuButton:()=>oe,MenuItem:()=>ae,MenuSub:()=>ne,MenuSubContent:()=>ie,MenuSubTrigger:()=>se,Root:()=>Q,Search:()=>pe,Separator:()=>te});import*as e from"react";import d from"classnames";import*as S from"@radix-ui/react-accordion";var J=e.createContext(null);function g(){return e.useContext(J)}var Q=e.forwardRef((t,a)=>{let o=G(),{size:r=x.size.default,variant:s=x.variant.default,menuVariant:c=x.menuVariant.default,layout:u=x.layout.default,presentation:l,panelBackground:R,color:i}=t,{className:p,children:m,...v}=H(t,x),{asChild:T,panelBackground:M,presentation:C,...P}=v,h=i||o.accentColor,n=l==="thin"?"rail":l==="expanded"?"panel":u||"panel",f=typeof r=="object"?r.initial||"2":r,y=e.useMemo(()=>({size:f,menuVariant:c,presentation:l,color:h}),[f,c,l,h]);return e.createElement("div",{...P,ref:a,"data-accent-color":h,className:d("rt-SidebarRoot",p)},e.createElement(J.Provider,{value:y},e.createElement("div",{className:d("rt-SidebarContainer",`rt-variant-${s}`,`rt-r-size-${f}`,`rt-menu-variant-${c}`,n&&`rt-layout-${n}`),"data-accent-color":h,"data-panel-background":R,"data-presentation":l,"data-layout":n},m)))});Q.displayName="Sidebar.Root";var Y=e.forwardRef(({className:t,children:a,role:o="navigation","aria-label":r="Main navigation",id:s,...c},u)=>{let l=g(),R=l?.size??"2",i=l?.menuVariant??"soft";return e.createElement(V,{type:"hover"},e.createElement("div",{...c,ref:u,id:s,role:o,"aria-label":r,className:d("rt-BaseMenuContent","rt-SidebarContent",`rt-r-size-${R}`,`rt-menu-variant-${i}`,t)},e.createElement("div",{className:"rt-BaseMenuViewport"},a)))});Y.displayName="Sidebar.Content";var Z=e.forwardRef(({className:t,asContainer:a=!0,...o},r)=>{let s=g(),c=s?.size??"2",u=s?.menuVariant??"soft";return e.createElement("div",{...o,ref:r,className:d("rt-SidebarHeader",`rt-r-size-${c}`,`rt-menu-variant-${u}`,{"rt-SidebarHeader--container":a},t)})});Z.displayName="Sidebar.Header";var ee=e.forwardRef(({className:t,asContainer:a=!0,...o},r)=>{let s=g(),c=s?.size??"2",u=s?.menuVariant??"soft";return e.createElement("div",{...o,ref:r,className:d("rt-SidebarFooter",`rt-r-size-${c}`,`rt-menu-variant-${u}`,{"rt-SidebarFooter--container":a},t)})});ee.displayName="Sidebar.Footer";var te=e.forwardRef(({className:t,...a},o)=>e.createElement(q,{...a,ref:o,className:d("rt-SidebarSeparator",t)}));te.displayName="Sidebar.Separator";var re=e.forwardRef(({className:t,...a},o)=>e.createElement("ul",{...a,ref:o,className:d("rt-SidebarMenu",t)}));re.displayName="Sidebar.Menu";var ae=e.forwardRef(({className:t,...a},o)=>e.createElement("li",{...a,ref:o,className:d("rt-SidebarMenuItem",t)}));ae.displayName="Sidebar.MenuItem";function me(t){let a=[],o=[];return e.Children.forEach(t,r=>{if(typeof r=="string"||typeof r=="number")o.push(e.createElement("span",{key:o.length,className:"rt-SidebarMenuLabel"},r));else if(e.isValidElement(r)){let s=r;s.type==="svg"||s.props&&s.props.icon||typeof s.type=="function"&&(s.type.displayName?.includes("Icon")||s.type.name?.includes("Icon"))?a.push(r):o.push(r)}else r&&o.push(r)}),{icons:a,labels:o}}function A(t){if(typeof t=="string"||typeof t=="number")return e.createElement("span",{className:"rt-SidebarMenuLabel"},t);if(Array.isArray(t))return t.map((a,o)=>e.createElement(e.Fragment,{key:o},A(a)));if(e.isValidElement(t)){let a=t,o=a.props&&a.props.className||"";if(typeof a.type=="string"&&o.split(" ").includes("rt-SidebarMenuLabel"))return a;let s=A(a.props?.children);return e.cloneElement(a,{...a.props},s)}return t}var oe=e.forwardRef(({asChild:t=!1,isActive:a=!1,shortcut:o,badge:r,className:s,children:c,onKeyDown:u,...l},R)=>{let i=g(),p=i?.size??"2",m=i?.presentation==="thin",v=t?L:"button",T=e.useCallback(n=>{if(n.key==="ArrowDown"||n.key==="ArrowUp"){let f=n.currentTarget.closest(".rt-SidebarContent, .rt-SidebarSearchPopover"),y=f?Array.from(f.querySelectorAll(".rt-SidebarMenuButton")).filter(N=>N.offsetParent!==null):[],b=y.indexOf(n.currentTarget),D=y[b+(n.key==="ArrowDown"?1:-1)];b!==-1&&D&&(n.preventDefault(),D.focus())}u?.(n)},[u]),M=e.useMemo(()=>A(c),[c]),{icons:C,labels:P}=e.useMemo(()=>m?me(c):{icons:[],labels:[]},[m,c]),h=e.useMemo(()=>{if(!t)return null;try{let n=e.Children.only(M),f=n.props?.children,y=e.createElement(e.Fragment,null,f,r&&e.createElement("div",{className:"rt-SidebarMenuBadge"},typeof r=="string"?e.createElement(B,{size:p,variant:"soft"},r):e.createElement(B,{size:r.size||p,variant:r.variant||"soft",color:r.color,radius:r.radius},r.content)),o&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-SidebarMenuShortcut"},e.createElement(E,{size:p},o)));return e.cloneElement(n,{...n.props},y)}catch{return M}},[t,M,r,o,p]);return e.createElement(v,{...l,ref:R,"aria-current":a?"page":void 0,className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton",s),"data-active":a||void 0,onKeyDown:T},t?h:m&&C.length>0?e.createElement(e.Fragment,null,e.createElement("span",{className:"rt-SidebarMenuIconWrapper"},C),P.map((n,f)=>e.createElement(e.Fragment,{key:f},typeof n=="string"||typeof n=="number"?e.createElement("span",{className:"rt-SidebarMenuLabel"},n):n))):e.createElement(e.Fragment,null,M,r&&e.createElement("div",{className:"rt-SidebarMenuBadge"},typeof r=="string"?e.createElement(B,{size:p,variant:"soft"},r):e.createElement(B,{size:r.size||p,variant:r.variant||"soft",color:r.color,radius:r.radius},r.content)),o&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-SidebarMenuShortcut"},e.createElement(E,{size:p},o))))});oe.displayName="Sidebar.MenuButton";var I=e.createContext("accordion"),ne=e.forwardRef(({defaultOpen:t=!1,children:a,...o},r)=>(g()?.presentation==="thin"?"dropdown":"accordion")==="dropdown"?e.createElement("div",{...o,ref:r},e.createElement(j,null,e.createElement(I.Provider,{value:"dropdown"},a))):e.createElement("div",{...o,ref:r},e.createElement(I.Provider,{value:"accordion"},e.createElement(S.Root,{type:"single",collapsible:!0,defaultValue:t?"item":void 0},e.createElement(S.Item,{value:"item"},a)))));ne.displayName="Sidebar.MenuSub";var se=e.forwardRef(({asChild:t=!1,className:a,children:o,...r},s)=>e.useContext(I)==="dropdown"?e.createElement(O,null,e.createElement("button",{...r,ref:s,type:"button","aria-haspopup":"menu",className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton","rt-SidebarMenuSubTrigger",a)},o)):e.createElement(S.Header,{asChild:!0},e.createElement("div",null,e.createElement(S.Trigger,{...r,ref:s,asChild:t,className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton","rt-SidebarMenuSubTrigger",a)},t?o:e.createElement(e.Fragment,null,o,e.createElement(W,{className:d("rt-BaseMenuSubTriggerIcon","rt-SidebarMenuSubTriggerIcon")}))))));se.displayName="Sidebar.MenuSubTrigger";var ie=e.forwardRef(({className:t,children:a,...o},r)=>{let s=g();if(e.useContext(I)==="dropdown"){let u=i=>{if(Array.isArray(i))return i.map((p,m)=>e.createElement(e.Fragment,{key:m},u(p)));if(e.isValidElement(i)){if(i.type?.displayName==="Sidebar.MenuButton")return i.props?.children;let m=i.props?.children;if(m!==void 0)return e.cloneElement(i,{...i.props,children:u(m)})}return i},l=e.Children.map(a,(i,p)=>{if(e.isValidElement(i)&&i.type?.displayName==="Sidebar.MenuItem"){let m=i.props?.children,v=u(m);return e.createElement(k,{key:p,asChild:!0},v)}return e.createElement(k,{key:p,asChild:!0},u(i))}),R=s?.size==="3"?"2":s?.size;return e.createElement(_,{size:R,variant:s?.menuVariant,className:d(t)},e.createElement(U,null,l))}return e.createElement(S.Content,{...o,ref:r,className:d("rt-SidebarMenuSubContent",t)},e.createElement("div",{className:"rt-SidebarMenuSubList"},a))});ie.displayName="Sidebar.MenuSubContent";var ce=e.forwardRef(({className:t,...a},o)=>e.createElement("div",{...a,ref:o,className:d("rt-BaseMenuGroup","rt-SidebarGroup",t)}));ce.displayName="Sidebar.Group";var de=e.forwardRef(({asChild:t=!1,className:a,...o},r)=>e.createElement(t?L:"div",{...o,ref:r,className:d("rt-BaseMenuLabel","rt-SidebarGroupLabel",a)}));de.displayName="Sidebar.GroupLabel";var ue=e.forwardRef(({className:t,...a},o)=>e.createElement("div",{...a,ref:o,className:d("rt-SidebarGroupContent",t)}));ue.displayName="Sidebar.GroupContent";var z=({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"})),X=({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"})),pe=e.forwardRef(({value:t,onValueChange:a,placeholder:o="Search...",children:r,className:s,...c},u)=>{let R=g()?.presentation==="thin",i=e.useRef(null),p=e.useRef(null),v=`${e.useId()}-results`,T=e.useRef(t);T.current=t;let M=e.useRef(a);M.current=a;let C=o.replace(/\.+$/,""),P=e.useCallback(n=>{n.key==="Escape"&&T.current&&(n.preventDefault(),n.stopPropagation(),M.current(""),i.current?.focus())},[]),h=e.useCallback(n=>{let f=p.current;if(!f)return;let y=f.querySelector('[role="group"]');if(!y)return;let b=Array.from(y.querySelectorAll("a, button"));if(b.length===0)return;let D=document.activeElement,N=D===i.current,w=b.indexOf(D);if(n.key.length===1&&!n.ctrlKey&&!n.metaKey&&!n.altKey&&!N&&w!==-1){i.current?.focus();return}switch(n.key){case"ArrowDown":{n.preventDefault(),N||w===-1?b[0]?.focus():w<b.length-1&&b[w+1]?.focus();break}case"ArrowUp":{n.preventDefault(),w<=0?i.current?.focus():b[w-1]?.focus();break}case"Home":{N||(n.preventDefault(),b[0]?.focus());break}case"End":{N||(n.preventDefault(),b[b.length-1]?.focus());break}}},[]);return R?e.createElement("div",{...c,ref:u,className:d("rt-SidebarSearch","rt-SidebarSearch--thin",s)},e.createElement(F,null,e.createElement(K,null,e.createElement("button",{type:"button",className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton","rt-SidebarSearchTrigger"),"aria-label":C},e.createElement("span",{className:"rt-SidebarMenuIconWrapper"},e.createElement(z,null)),e.createElement("span",{className:"rt-SidebarMenuLabel"},"Search"))),e.createElement($,{side:"right",align:"start",size:"2",width:"280px","aria-label":C},e.createElement("div",{ref:p,className:"rt-SidebarSearchPopover",role:"search",onKeyDown:h},e.createElement("div",{className:"rt-SidebarSearchInputWrapper"},e.createElement(z,{className:"rt-SidebarSearchIcon"}),e.createElement("input",{ref:i,type:"search",className:"rt-SidebarSearchInput",value:t,onChange:n=>a(n.target.value),onKeyDown:P,placeholder:o,"aria-label":C,"aria-controls":r?v:void 0,autoFocus:!0}),t&&e.createElement("button",{type:"button",className:"rt-reset rt-SidebarSearchClear",onClick:()=>{a(""),i.current?.focus()},"aria-label":"Clear search"},e.createElement(X,null))),r&&e.createElement("div",{id:v,role:"group","aria-label":"Search results"},r))))):e.createElement("div",{...c,ref:u,className:d("rt-SidebarSearch","rt-SidebarSearch--expanded",s),role:"search"},e.createElement("div",{className:"rt-SidebarSearchInputWrapper"},e.createElement(z,{className:"rt-SidebarSearchIcon"}),e.createElement("input",{ref:i,type:"search",className:"rt-SidebarSearchInput",value:t,onChange:n=>a(n.target.value),onKeyDown:P,placeholder:o,"aria-label":C}),t&&e.createElement("button",{type:"button",className:"rt-reset rt-SidebarSearchClear",onClick:()=>{a(""),i.current?.focus()},"aria-label":"Clear search"},e.createElement(X,null))))});pe.displayName="Sidebar.Search";export{Q as a,Y as b,Z as c,ee as d,te as e,re as f,ae as g,oe as h,ne as i,se as j,ie as k,ce as l,de as m,ue as n,pe as o,fe as p};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as x}from"./chunk-2CMM7MEL.js";import{a as q}from"./chunk-VR7ZAFYN.js";import{a as j,b as O,c as _,e as k,f as U}from"./chunk-MZXHKM4V.js";import{a as F,b as K,c as $}from"./chunk-WHFJ4JUN.js";import{a as V}from"./chunk-COWZAUZR.js";import{d as W}from"./chunk-IX5HIHVI.js";import{a as B}from"./chunk-KMPE7TJ6.js";import{b as G}from"./chunk-SEY4NA45.js";import{b as L}from"./chunk-FWB47YCH.js";import{a as E}from"./chunk-E67CIG6A.js";import{a as H}from"./chunk-6FLLFCBU.js";import{a as le}from"./chunk-OS3FCYZY.js";var fe={};le(fe,{Content:()=>Y,Footer:()=>ee,Group:()=>ce,GroupContent:()=>ue,GroupLabel:()=>de,Header:()=>Z,Menu:()=>re,MenuButton:()=>oe,MenuItem:()=>ae,MenuSub:()=>ne,MenuSubContent:()=>ie,MenuSubTrigger:()=>se,Root:()=>Q,Search:()=>pe,Separator:()=>te});import*as e from"react";import d from"classnames";import*as S from"@radix-ui/react-accordion";var J=e.createContext(null);function g(){return e.useContext(J)}var Q=e.forwardRef((t,a)=>{let o=G(),{size:r=x.size.default,variant:s=x.variant.default,menuVariant:c=x.menuVariant.default,layout:u=x.layout.default,presentation:l,panelBackground:R,color:i}=t,{className:p,children:m,...v}=H(t,x),{asChild:T,panelBackground:M,presentation:C,...P}=v,h=i||o.accentColor,n=l==="thin"?"rail":l==="expanded"?"panel":u||"panel",f=typeof r=="object"?r.initial||"2":r,y=e.useMemo(()=>({size:f,menuVariant:c,presentation:l,color:h}),[f,c,l,h]);return e.createElement("div",{...P,ref:a,"data-accent-color":h,className:d("rt-SidebarRoot",p)},e.createElement(J.Provider,{value:y},e.createElement("div",{className:d("rt-SidebarContainer",`rt-variant-${s}`,`rt-r-size-${f}`,`rt-menu-variant-${c}`,n&&`rt-layout-${n}`),"data-accent-color":h,"data-panel-background":R,"data-presentation":l,"data-layout":n},m)))});Q.displayName="Sidebar.Root";var Y=e.forwardRef(({className:t,children:a,role:o="navigation","aria-label":r="Main navigation",id:s,...c},u)=>{let l=g(),R=l?.size??"2",i=l?.menuVariant??"soft";return e.createElement(V,{type:"hover"},e.createElement("div",{...c,ref:u,id:s,role:o,"aria-label":r,className:d("rt-BaseMenuContent","rt-SidebarContent",`rt-r-size-${R}`,`rt-menu-variant-${i}`,t)},e.createElement("div",{className:"rt-BaseMenuViewport"},a)))});Y.displayName="Sidebar.Content";var Z=e.forwardRef(({className:t,asContainer:a=!0,...o},r)=>{let s=g(),c=s?.size??"2",u=s?.menuVariant??"soft";return e.createElement("div",{...o,ref:r,className:d("rt-SidebarHeader",`rt-r-size-${c}`,`rt-menu-variant-${u}`,{"rt-SidebarHeader--container":a},t)})});Z.displayName="Sidebar.Header";var ee=e.forwardRef(({className:t,asContainer:a=!0,...o},r)=>{let s=g(),c=s?.size??"2",u=s?.menuVariant??"soft";return e.createElement("div",{...o,ref:r,className:d("rt-SidebarFooter",`rt-r-size-${c}`,`rt-menu-variant-${u}`,{"rt-SidebarFooter--container":a},t)})});ee.displayName="Sidebar.Footer";var te=e.forwardRef(({className:t,...a},o)=>e.createElement(q,{...a,ref:o,className:d("rt-SidebarSeparator",t)}));te.displayName="Sidebar.Separator";var re=e.forwardRef(({className:t,...a},o)=>e.createElement("ul",{...a,ref:o,className:d("rt-SidebarMenu",t)}));re.displayName="Sidebar.Menu";var ae=e.forwardRef(({className:t,...a},o)=>e.createElement("li",{...a,ref:o,className:d("rt-SidebarMenuItem",t)}));ae.displayName="Sidebar.MenuItem";function me(t){let a=[],o=[];return e.Children.forEach(t,r=>{if(typeof r=="string"||typeof r=="number")o.push(e.createElement("span",{key:o.length,className:"rt-SidebarMenuLabel"},r));else if(e.isValidElement(r)){let s=r;s.type==="svg"||s.props&&s.props.icon||typeof s.type=="function"&&(s.type.displayName?.includes("Icon")||s.type.name?.includes("Icon"))?a.push(r):o.push(r)}else r&&o.push(r)}),{icons:a,labels:o}}function A(t){if(typeof t=="string"||typeof t=="number")return e.createElement("span",{className:"rt-SidebarMenuLabel"},t);if(Array.isArray(t))return t.map((a,o)=>e.createElement(e.Fragment,{key:o},A(a)));if(e.isValidElement(t)){let a=t,o=a.props&&a.props.className||"";if(typeof a.type=="string"&&o.split(" ").includes("rt-SidebarMenuLabel"))return a;let s=A(a.props?.children);return e.cloneElement(a,{...a.props},s)}return t}var oe=e.forwardRef(({asChild:t=!1,isActive:a=!1,shortcut:o,badge:r,className:s,children:c,onKeyDown:u,...l},R)=>{let i=g(),p=i?.size??"2",m=i?.presentation==="thin",v=t?L:"button",T=e.useCallback(n=>{if(n.key==="ArrowDown"||n.key==="ArrowUp"){let f=n.currentTarget.closest(".rt-SidebarContent, .rt-SidebarSearchPopover"),y=f?Array.from(f.querySelectorAll(".rt-SidebarMenuButton")).filter(N=>N.offsetParent!==null):[],b=y.indexOf(n.currentTarget),D=y[b+(n.key==="ArrowDown"?1:-1)];b!==-1&&D&&(n.preventDefault(),D.focus())}u?.(n)},[u]),M=e.useMemo(()=>A(c),[c]),{icons:C,labels:P}=e.useMemo(()=>m?me(c):{icons:[],labels:[]},[m,c]),h=e.useMemo(()=>{if(!t)return null;try{let n=e.Children.only(M),f=n.props?.children,y=e.createElement(e.Fragment,null,f,r&&e.createElement("div",{className:"rt-SidebarMenuBadge"},typeof r=="string"?e.createElement(B,{size:p,variant:"soft"},r):e.createElement(B,{size:r.size||p,variant:r.variant||"soft",color:r.color,radius:r.radius},r.content)),o&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-SidebarMenuShortcut"},e.createElement(E,{size:p},o)));return e.cloneElement(n,{...n.props},y)}catch{return M}},[t,M,r,o,p]);return e.createElement(v,{...l,ref:R,"aria-current":a?"page":void 0,className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton",s),"data-active":a||void 0,onKeyDown:T},t?h:m&&C.length>0?e.createElement(e.Fragment,null,e.createElement("span",{className:"rt-SidebarMenuIconWrapper"},C),P.map((n,f)=>e.createElement(e.Fragment,{key:f},typeof n=="string"||typeof n=="number"?e.createElement("span",{className:"rt-SidebarMenuLabel"},n):n))):e.createElement(e.Fragment,null,M,r&&e.createElement("div",{className:"rt-SidebarMenuBadge"},typeof r=="string"?e.createElement(B,{size:p,variant:"soft"},r):e.createElement(B,{size:r.size||p,variant:r.variant||"soft",color:r.color,radius:r.radius},r.content)),o&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-SidebarMenuShortcut"},e.createElement(E,{size:p},o))))});oe.displayName="Sidebar.MenuButton";var I=e.createContext("accordion"),ne=e.forwardRef(({defaultOpen:t=!1,children:a,...o},r)=>(g()?.presentation==="thin"?"dropdown":"accordion")==="dropdown"?e.createElement("div",{...o,ref:r},e.createElement(j,null,e.createElement(I.Provider,{value:"dropdown"},a))):e.createElement("div",{...o,ref:r},e.createElement(I.Provider,{value:"accordion"},e.createElement(S.Root,{type:"single",collapsible:!0,defaultValue:t?"item":void 0},e.createElement(S.Item,{value:"item"},a)))));ne.displayName="Sidebar.MenuSub";var se=e.forwardRef(({asChild:t=!1,className:a,children:o,...r},s)=>e.useContext(I)==="dropdown"?e.createElement(O,null,e.createElement("button",{...r,ref:s,type:"button","aria-haspopup":"menu",className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton","rt-SidebarMenuSubTrigger",a)},o)):e.createElement(S.Header,{asChild:!0},e.createElement("div",null,e.createElement(S.Trigger,{...r,ref:s,asChild:t,className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton","rt-SidebarMenuSubTrigger",a)},t?o:e.createElement(e.Fragment,null,o,e.createElement(W,{className:d("rt-BaseMenuSubTriggerIcon","rt-SidebarMenuSubTriggerIcon")}))))));se.displayName="Sidebar.MenuSubTrigger";var ie=e.forwardRef(({className:t,children:a,...o},r)=>{let s=g();if(e.useContext(I)==="dropdown"){let u=i=>{if(Array.isArray(i))return i.map((p,m)=>e.createElement(e.Fragment,{key:m},u(p)));if(e.isValidElement(i)){if(i.type?.displayName==="Sidebar.MenuButton")return i.props?.children;let m=i.props?.children;if(m!==void 0)return e.cloneElement(i,{...i.props,children:u(m)})}return i},l=e.Children.map(a,(i,p)=>{if(e.isValidElement(i)&&i.type?.displayName==="Sidebar.MenuItem"){let m=i.props?.children,v=u(m);return e.createElement(k,{key:p,asChild:!0},v)}return e.createElement(k,{key:p,asChild:!0},u(i))}),R=s?.size==="3"?"2":s?.size;return e.createElement(_,{size:R,variant:s?.menuVariant,className:d(t)},e.createElement(U,null,l))}return e.createElement(S.Content,{...o,ref:r,className:d("rt-SidebarMenuSubContent",t)},e.createElement("div",{className:"rt-SidebarMenuSubList"},a))});ie.displayName="Sidebar.MenuSubContent";var ce=e.forwardRef(({className:t,...a},o)=>e.createElement("div",{...a,ref:o,className:d("rt-BaseMenuGroup","rt-SidebarGroup",t)}));ce.displayName="Sidebar.Group";var de=e.forwardRef(({asChild:t=!1,className:a,...o},r)=>e.createElement(t?L:"div",{...o,ref:r,className:d("rt-BaseMenuLabel","rt-SidebarGroupLabel",a)}));de.displayName="Sidebar.GroupLabel";var ue=e.forwardRef(({className:t,...a},o)=>e.createElement("div",{...a,ref:o,className:d("rt-SidebarGroupContent",t)}));ue.displayName="Sidebar.GroupContent";var z=({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"})),X=({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"})),pe=e.forwardRef(({value:t,onValueChange:a,placeholder:o="Search...",children:r,className:s,...c},u)=>{let R=g()?.presentation==="thin",i=e.useRef(null),p=e.useRef(null),v=`${e.useId()}-results`,T=e.useRef(t);T.current=t;let M=e.useRef(a);M.current=a;let C=o.replace(/\.+$/,""),P=e.useCallback(n=>{n.key==="Escape"&&T.current&&(n.preventDefault(),n.stopPropagation(),M.current(""),i.current?.focus())},[]),h=e.useCallback(n=>{let f=p.current;if(!f)return;let y=f.querySelector('[role="group"]');if(!y)return;let b=Array.from(y.querySelectorAll("a, button"));if(b.length===0)return;let D=document.activeElement,N=D===i.current,w=b.indexOf(D);if(n.key.length===1&&!n.ctrlKey&&!n.metaKey&&!n.altKey&&!N&&w!==-1){i.current?.focus();return}switch(n.key){case"ArrowDown":{n.preventDefault(),N||w===-1?b[0]?.focus():w<b.length-1&&b[w+1]?.focus();break}case"ArrowUp":{n.preventDefault(),w<=0?i.current?.focus():b[w-1]?.focus();break}case"Home":{N||(n.preventDefault(),b[0]?.focus());break}case"End":{N||(n.preventDefault(),b[b.length-1]?.focus());break}}},[]);return R?e.createElement("div",{...c,ref:u,className:d("rt-SidebarSearch","rt-SidebarSearch--thin",s)},e.createElement(F,null,e.createElement(K,null,e.createElement("button",{type:"button",className:d("rt-reset","rt-BaseMenuItem","rt-SidebarMenuButton","rt-SidebarSearchTrigger"),"aria-label":C},e.createElement("span",{className:"rt-SidebarMenuIconWrapper"},e.createElement(z,null)),e.createElement("span",{className:"rt-SidebarMenuLabel"},"Search"))),e.createElement($,{side:"right",align:"start",size:"2",width:"280px","aria-label":C},e.createElement("div",{ref:p,className:"rt-SidebarSearchPopover",role:"search",onKeyDown:h},e.createElement("div",{className:"rt-SidebarSearchInputWrapper"},e.createElement(z,{className:"rt-SidebarSearchIcon"}),e.createElement("input",{ref:i,type:"search",className:"rt-SidebarSearchInput",value:t,onChange:n=>a(n.target.value),onKeyDown:P,placeholder:o,"aria-label":C,"aria-controls":r?v:void 0,autoFocus:!0}),t&&e.createElement("button",{type:"button",className:"rt-reset rt-SidebarSearchClear",onClick:()=>{a(""),i.current?.focus()},"aria-label":"Clear search"},e.createElement(X,null))),r&&e.createElement("div",{id:v,role:"group","aria-label":"Search results"},r))))):e.createElement("div",{...c,ref:u,className:d("rt-SidebarSearch","rt-SidebarSearch--expanded",s),role:"search"},e.createElement("div",{className:"rt-SidebarSearchInputWrapper"},e.createElement(z,{className:"rt-SidebarSearchIcon"}),e.createElement("input",{ref:i,type:"search",className:"rt-SidebarSearchInput",value:t,onChange:n=>a(n.target.value),onKeyDown:P,placeholder:o,"aria-label":C}),t&&e.createElement("button",{type:"button",className:"rt-reset rt-SidebarSearchClear",onClick:()=>{a(""),i.current?.focus()},"aria-label":"Clear search"},e.createElement(X,null))))});pe.displayName="Sidebar.Search";export{Q as a,Y as b,Z as c,ee as d,te as e,re as f,ae as g,oe as h,ne as i,se as j,ie as k,ce as l,de as m,ue as n,pe as o,fe as p};
|
|
2
|
+
//# sourceMappingURL=chunk-53SZ4Y23.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as o from"react";function f(l){let[e,a]=o.useState(null);return o.useEffect(()=>{if(!l||!e)return;let t=0,c=()=>{t=0;let n=Math.max(0,e.scrollTop),u=Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop);e.style.setProperty("--scroll-overflow-start",`${n}px`),e.style.setProperty("--scroll-overflow-end",`${u}px`)},r=()=>{t||(t=requestAnimationFrame(c))};c(),e.addEventListener("scroll",r,{passive:!0});let s=typeof ResizeObserver>"u"?null:new ResizeObserver(r);s?.observe(e);for(let n of Array.from(e.children))s?.observe(n);let i=typeof MutationObserver>"u"?null:new MutationObserver(r);return i?.observe(e,{childList:!0}),()=>{t&&cancelAnimationFrame(t),e.removeEventListener("scroll",r),s?.disconnect(),i?.disconnect(),e.style.removeProperty("--scroll-overflow-start"),e.style.removeProperty("--scroll-overflow-end")}},[l,e]),a}export{f as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5BWLY27A.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/hooks/use-scroll-edges.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\n\n/**\n * Publishes how much content is hidden past each block edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (px) on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, element.scrollHeight - element.clientHeight - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QAWhB,SAASC,EAAsCC,EAAkB,CACtE,GAAM,CAACC,EAASC,CAAU,EAAU,WAAmB,IAAI,EAE3D,OAAM,YAAU,IAAM,CACpB,GAAI,CAACF,GAAW,CAACC,EAAS,OAC1B,IAAIE,EAAQ,EACNC,EAAQ,IAAM,CAClBD,EAAQ,EACR,IAAME,EAAQ,KAAK,IAAI,EAAGJ,EAAQ,SAAS,EACrCK,EAAM,KAAK,IAAI,EAAGL,EAAQ,aAAeA,EAAQ,aAAeA,EAAQ,SAAS,EACvFA,EAAQ,MAAM,YAAY,0BAA2B,GAAGI,CAAK,IAAI,EACjEJ,EAAQ,MAAM,YAAY,wBAAyB,GAAGK,CAAG,IAAI,CAC/D,EACMC,EAAW,IAAM,CAChBJ,IAAOA,EAAQ,sBAAsBC,CAAK,EACjD,EACAA,EAAM,EACNH,EAAQ,iBAAiB,SAAUM,EAAU,CAAE,QAAS,EAAK,CAAC,EAC9D,IAAMC,EAAW,OAAO,eAAmB,IAAc,KAAO,IAAI,eAAeD,CAAQ,EAC3FC,GAAU,QAAQP,CAAO,EACzB,QAAWQ,KAAS,MAAM,KAAKR,EAAQ,QAAQ,EAAGO,GAAU,QAAQC,CAAK,EACzE,IAAMC,EAAY,OAAO,iBAAqB,IAAc,KAAO,IAAI,iBAAiBH,CAAQ,EAChG,OAAAG,GAAW,QAAQT,EAAS,CAAE,UAAW,EAAK,CAAC,EACxC,IAAM,CACPE,GAAO,qBAAqBA,CAAK,EACrCF,EAAQ,oBAAoB,SAAUM,CAAQ,EAC9CC,GAAU,WAAW,EACrBE,GAAW,WAAW,EACtBT,EAAQ,MAAM,eAAe,yBAAyB,EACtDA,EAAQ,MAAM,eAAe,uBAAuB,CACtD,CACF,EAAG,CAACD,EAASC,CAAO,CAAC,EAEdC,CACT",
|
|
6
|
+
"names": ["React", "useScrollEdges", "enabled", "element", "setElement", "frame", "write", "start", "end", "schedule", "observer", "child", "mutations"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as S}from"./chunk-5GXFBLBJ.js";import{a as u}from"./chunk-UBOOUDS4.js";import{a as e}from"./chunk-XPRPYCII.js";import{a as d}from"./chunk-5BWLY27A.js";import{a as f}from"./chunk-PS6NEG5A.js";import{a as n}from"./chunk-E23RKOQJ.js";import{b as t}from"./chunk-JUY7CBSL.js";import*as r from"react";import a from"classnames";import{ScrollArea as o}from"radix-ui";import{useComposedRefs as E}from"radix-ui/internal";var T=r.forwardRef((P,A)=>{let{rest:v,...y}=S(P),[R,g]=u(y),{asChild:s,children:N,className:b,style:h,type:i,scrollHideDelay:w=i!=="scroll"?0:void 0,dir:M,size:p=e.size.default,radius:m=e.radius.default,scrollbars:l=e.scrollbars.default,fade:c=e.fade.default,...C}=v,z=d(c),V=E(A,z);return r.createElement(o.Root,{type:i,scrollHideDelay:w,className:a("rt-ScrollAreaRoot",R,b),"data-fade":c?"":void 0,style:n(g,h),asChild:s},f({asChild:s,children:N},D=>r.createElement(r.Fragment,null,r.createElement(o.Viewport,{...C,ref:V,className:"rt-ScrollAreaViewport"},D),r.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),l!=="vertical"?r.createElement(o.Scrollbar,{"data-radius":m,orientation:"horizontal",className:a("rt-ScrollAreaScrollbar",t({className:"rt-r-size",value:p,propValues:e.size.values}))},r.createElement(o.Thumb,{className:"rt-ScrollAreaThumb"})):null,l!=="horizontal"?r.createElement(o.Scrollbar,{"data-radius":m,orientation:"vertical",className:a("rt-ScrollAreaScrollbar",t({className:"rt-r-size",value:p,propValues:e.size.values}))},r.createElement(o.Thumb,{className:"rt-ScrollAreaThumb"})):null,l==="both"?r.createElement(o.Corner,{className:"rt-ScrollAreaCorner"}):null)))});T.displayName="ScrollArea";export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-COWZAUZR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/scroll-area.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { extractMarginProps } from '../helpers/extract-margin-props.js';\nimport { getMarginStyles } from '../helpers/get-margin-styles.js';\nimport { getResponsiveClassNames } from '../helpers/get-responsive-styles.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { mergeStyles } from '../helpers/merge-styles.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n MarginProps,\n ScrollAreaOwnProps {}\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const { rest: marginRest, ...marginProps } = extractMarginProps(props);\n const [marginClassNames, marginCustomProperties] = getMarginStyles(marginProps);\n\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n size = scrollAreaPropDefs.size.default,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = marginRest;\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement);\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n className={classNames('rt-ScrollAreaRoot', marginClassNames, className)}\n data-fade={fade ? '' : undefined}\n style={mergeStyles(marginCustomProperties, style)}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n {...viewportProps}\n ref={viewportRef}\n className=\"rt-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"rt-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className={classNames(\n 'rt-ScrollAreaScrollbar',\n getResponsiveClassNames({\n className: 'rt-r-size',\n value: size,\n propValues: scrollAreaPropDefs.size.values,\n }),\n )}\n >\n <ScrollAreaPrimitive.Thumb className=\"rt-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className={classNames(\n 'rt-ScrollAreaScrollbar',\n getResponsiveClassNames({\n className: 'rt-r-size',\n value: size,\n propValues: scrollAreaPropDefs.size.values,\n }),\n )}\n >\n <ScrollAreaPrimitive.Thumb className=\"rt-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"rt-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n"],
|
|
5
|
+
"mappings": "wRAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,cAAcC,MAA2B,WAClD,OAAS,mBAAAC,MAAuB,oBAqBhC,IAAMC,EAAmB,aAA+C,CAACC,EAAOC,IAAiB,CAC/F,GAAM,CAAE,KAAMC,EAAY,GAAGC,CAAY,EAAIC,EAAmBJ,CAAK,EAC/D,CAACK,EAAkBC,CAAsB,EAAIC,EAAgBJ,CAAW,EAExE,CACJ,QAAAK,EACA,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,KAAAC,EACA,gBAAAC,EAAkBD,IAAS,SAAW,EAAI,OAC1C,IAAAE,EACA,KAAAC,EAAOC,EAAmB,KAAK,QAC/B,OAAAC,EAASD,EAAmB,OAAO,QACnC,WAAAE,EAAaF,EAAmB,WAAW,QAC3C,KAAAG,EAAOH,EAAmB,KAAK,QAC/B,GAAGI,CACL,EAAIlB,EACEmB,EAAkBC,EAA+BH,CAAI,EACrDI,EAAcC,EAAgBvB,EAAcoB,CAAe,EAEjE,OACE,gBAACI,EAAoB,KAApB,CACC,KAAMb,EACN,gBAAiBC,EACjB,UAAWa,EAAW,oBAAqBrB,EAAkBK,CAAS,EACtE,YAAWS,EAAO,GAAK,OACvB,MAAOQ,EAAYrB,EAAwBK,CAAK,EAChD,QAASH,GAERoB,EAAW,CAAE,QAAApB,EAAS,SAAAC,CAAS,EAAIA,GAClC,gCACE,gBAACgB,EAAoB,SAApB,CACE,GAAGL,EACJ,IAAKG,EACL,UAAU,yBAETd,CACH,EAEA,gBAAC,OAAI,UAAU,iCAAiC,EAE/CS,IAAe,WACd,gBAACO,EAAoB,UAApB,CACC,cAAaR,EACb,YAAY,aACZ,UAAWS,EACT,yBACAG,EAAwB,CACtB,UAAW,YACX,MAAOd,EACP,WAAYC,EAAmB,KAAK,MACtC,CAAC,CACH,GAEA,gBAACS,EAAoB,MAApB,CAA0B,UAAU,qBAAqB,CAC5D,EACE,KAEHP,IAAe,aACd,gBAACO,EAAoB,UAApB,CACC,cAAaR,EACb,YAAY,WACZ,UAAWS,EACT,yBACAG,EAAwB,CACtB,UAAW,YACX,MAAOd,EACP,WAAYC,EAAmB,KAAK,MACtC,CAAC,CACH,GAEA,gBAACS,EAAoB,MAApB,CAA0B,UAAU,qBAAqB,CAC5D,EACE,KAEHP,IAAe,OACd,gBAACO,EAAoB,OAApB,CAA2B,UAAU,sBAAsB,EAC1D,IACN,CACD,CACH,CAEJ,CAAC,EACD1B,EAAW,YAAc",
|
|
6
|
+
"names": ["React", "classNames", "ScrollAreaPrimitive", "useComposedRefs", "ScrollArea", "props", "forwardedRef", "marginRest", "marginProps", "extractMarginProps", "marginClassNames", "marginCustomProperties", "getMarginStyles", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "size", "scrollAreaPropDefs", "radius", "scrollbars", "fade", "viewportProps", "setEdgesElement", "useScrollEdges", "viewportRef", "useComposedRefs", "ScrollAreaPrimitive", "classNames", "mergeStyles", "getSubtree", "getResponsiveClassNames"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V}from"./chunk-CTA5ODAO.js";import{b as oe,c as ne,d as K,e as re,f as te}from"./chunk-IX5HIHVI.js";import{a as ee}from"./chunk-MJJ7XDIP.js";import{c as W}from"./chunk-7RQNB63F.js";import{b as L,c as z}from"./chunk-SEY4NA45.js";import{a as x}from"./chunk-5TXQLK4G.js";import{b as y,c as E,d as H,e as U,f as Y}from"./chunk-3KSGRY6I.js";import{b as N,c as B,d as q,e as k,f as O}from"./chunk-ZOY43B55.js";import{a as T}from"./chunk-6FLLFCBU.js";import{a as P,b,c as X,d as $,e as G,f as J,g as Q,h as Z,i as _}from"./chunk-JSW6J6RS.js";import{a as Te}from"./chunk-OS3FCYZY.js";var Ge={};Te(Ge,{CheckboxItem:()=>Me,Content:()=>de,Group:()=>me,Item:()=>ce,Label:()=>le,RadioGroup:()=>we,RadioItem:()=>De,Root:()=>pe,Separator:()=>Re,Sub:()=>fe,SubContent:()=>ge,SubTrigger:()=>Pe,Trigger:()=>ue,TriggerIcon:()=>ve});import*as e from"react";import d from"classnames";import{DropdownMenu as u,Slot as xe}from"radix-ui";import{useCallbackRef as ae}from"radix-ui/internal";var ie=e.createContext(!1),pe=o=>{let{open:n,defaultOpen:r=!1,onOpenChange:p}=o,[a,t]=e.useState(r),i=n??a,s=ae(p),l=e.useCallback(m=>{t(m),s(m)},[s]);return e.createElement(ie.Provider,{value:i},e.createElement(u.Root,{...o,onOpenChange:l}))};pe.displayName="DropdownMenu.Root";var ue=e.forwardRef(({children:o,...n},r)=>e.createElement(u.Trigger,{...n,ref:r,asChild:!0},ee(o)));ue.displayName="DropdownMenu.Trigger";var A=e.createContext({}),Ee={ltr:"ArrowLeft",rtl:"ArrowRight"},Ne={ltr:"ArrowRight",rtl:"ArrowLeft"};function Be(o){return o instanceof HTMLElement&&(o.isContentEditable||o.tagName==="INPUT"||o.tagName==="TEXTAREA")}function se(o){return o?.closest("[dir]")?.getAttribute("dir")==="rtl"?"rtl":"ltr"}var de=e.forwardRef((o,n)=>{let r=L();x(o.panelBackground);let p=B(o.material,o.panelBackground,r),{size:a=y.size.default,variant:t=y.variant.default}=o,{className:i,children:s,color:l,container:m,forceMount:w,material:c,panelBackground:S,submenuBehavior:v,virtualized:I=!1,onEscapeKeyDown:R,onKeyDown:h,...g}=T(o,y),D=l||r.accentColor,f=N(v,"cascade"),F=f==="drill-down",Ie=e.useContext(ie),C=X(),he=M=>{R?.(M),!(M.defaultPrevented||!F||C.getDepth()===0)&&(M.preventDefault(),C.pop("keyboard"))},ye=M=>{h?.(M),!(M.defaultPrevented||!F||C.getDepth()===0)&&(Be(M.target)||M.key===Ee[se(M.currentTarget)]&&(M.preventDefault(),C.pop("keyboard")))},Se=e.useMemo(()=>({size:a,variant:t,color:D,material:p}),[a,t,D,p]),j=e.createElement(W,{size:a},e.createElement(A.Provider,{value:Se},e.createElement($,{store:C,behavior:f,open:Ie},s)));return e.createElement(u.Portal,{container:m,forceMount:w},e.createElement(z,{asChild:!0},e.createElement(u.Content,{"data-accent-color":D,"data-material":p,"data-panel-background":p,align:"start",sideOffset:4,collisionPadding:10,...g,onEscapeKeyDown:he,onKeyDown:ye,asChild:!1,ref:n,className:d("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",i)},I?e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport","rt-virtualized")},j):e.createElement(V,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport")},j)))))});de.displayName="DropdownMenu.Content";var le=e.forwardRef(({className:o,...n},r)=>e.useContext(P)?e.createElement(u.Label,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuLabel","rt-DropdownMenuLabel",o)}):null);le.displayName="DropdownMenu.Label";var ce=e.forwardRef((o,n)=>{let{className:r,children:p,color:a=H.color.default,shortcut:t,...i}=o;return e.useContext(P)?e.createElement(u.Item,{"data-accent-color":a,"aria-keyshortcuts":t?k(t):void 0,...i,ref:n,className:d("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},e.createElement(xe.Slottable,null,p),t&&e.createElement(O,{shortcut:t,className:"rt-DropdownMenuShortcut"})):null});ce.displayName="DropdownMenu.Item";var me=e.forwardRef(({className:o,...n},r)=>e.createElement(u.Group,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuGroup","rt-DropdownMenuGroup",o)}));me.displayName="DropdownMenu.Group";var we=e.forwardRef(({className:o,...n},r)=>e.createElement(u.RadioGroup,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",o)}));we.displayName="DropdownMenu.RadioGroup";var De=e.forwardRef((o,n)=>{let{children:r,className:p,color:a=Y.color.default,...t}=o;return e.useContext(P)?e.createElement(u.RadioItem,{...t,asChild:!1,ref:n,"data-accent-color":a,className:d("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",p)},r,e.createElement(u.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},e.createElement(te,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"}))):null});De.displayName="DropdownMenu.RadioItem";var Me=e.forwardRef((o,n)=>{let{children:r,className:p,shortcut:a,color:t=U.color.default,...i}=o;return e.useContext(P)?e.createElement(u.CheckboxItem,{"aria-keyshortcuts":a?k(a):void 0,...i,asChild:!1,ref:n,"data-accent-color":t,className:d("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",p)},r,e.createElement(u.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},e.createElement(oe,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})),a&&e.createElement(O,{shortcut:a,className:"rt-DropdownMenuShortcut"})):null});Me.displayName="DropdownMenu.CheckboxItem";var fe=({label:o="Back",open:n,defaultOpen:r,onOpenChange:p,children:a})=>{let t=b(),i=e.useId(),s=e.useMemo(()=>({id:i,label:o}),[i,o]),l=G(t,i)!=="closed";e.useLayoutEffect(()=>{!t||n===void 0||(n&&!t.isOpen(i)?t.push(i,null):!n&&t.isOpen(i)&&t.close(i))},[t,n,i]);let m=e.useRef(r);e.useLayoutEffect(()=>{t&&m.current&&n===void 0&&t.push(i,null)},[]);let w=ae(p),c=e.useRef(l);return e.useEffect(()=>{!t||c.current===l||(c.current=l,w(l))},[t,l,w]),e.createElement(Z.Provider,{value:s},e.createElement(u.Sub,{open:n,defaultOpen:r,onOpenChange:t?void 0:p},a))};fe.displayName="DropdownMenu.Sub";var Pe=e.forwardRef((o,n)=>{let{className:r,children:p,onKeyDown:a,...t}=o,i=b(),s=_(),l=e.useContext(P);if(i&&s){if(!l)return null;let m=c=>{c.preventDefault(),i.push(s.id)},w=c=>{a?.(c),!(c.defaultPrevented||t.disabled)&&c.key===Ne[se(c.currentTarget)]&&(c.preventDefault(),i.push(s.id,"keyboard"))};return e.createElement(u.Item,{"aria-haspopup":"menu",...t,"data-drill-down-trigger":s.id,"data-drill-down-name":t.textValue,onSelect:m,onKeyDown:w,ref:n,className:d("rt-reset","rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger","rt-DropdownMenuDrillDownSubTrigger",r)},p,e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(K,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubTriggerIcon"})))}return e.createElement(u.SubTrigger,{...t,onKeyDown:a,asChild:!1,ref:n,className:d("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},p,e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(K,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubTriggerIcon"})))});Pe.displayName="DropdownMenu.SubTrigger";var Re=e.forwardRef(({className:o,...n},r)=>e.useContext(P)?e.createElement(u.Separator,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",o)}):null);Re.displayName="DropdownMenu.Separator";function ke({label:o,name:n}){let r=b(),p=e.useCallback(i=>{i.preventDefault(),r?.pop()},[r]),a=typeof o=="string"?o:n,t=a&&a!=="Back"?`Back from ${a}`:void 0;return e.createElement(u.Item,{"aria-label":t,textValue:a||"Back",onSelect:p,className:d("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem","rt-DropdownMenuDrillDownBackItem")},e.createElement(re,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuDrillDownBackIcon"}),e.createElement("span",{className:"rt-DropdownMenuDrillDownBackLabel"},o))}function Oe(o){let{loop:n,onEscapeKeyDown:r,onPointerDownOutside:p,onFocusOutside:a,onInteractOutside:t,sideOffset:i,alignOffset:s,avoidCollisions:l,collisionBoundary:m,collisionPadding:w,arrowPadding:c,sticky:S,hideWhenDetached:v,updatePositionStrategy:I,...R}=o;return R}var ge=e.forwardRef((o,n)=>{let r=b(),p=_();return r&&p?e.createElement(be,{...o,ref:n,store:r,sub:p}):e.createElement(Ce,{...o,ref:n})});ge.displayName="DropdownMenu.SubContent";var Ce=e.forwardRef((o,n)=>{let r=e.useContext(A),p=L();x(o.panelBackground);let a=o.size??r.size,t=o.variant??r.variant,i=o.color??r.color,s=o.material??o.panelBackground??r.material??B(void 0,void 0,p),{className:l,children:m,container:w,forceMount:c,color:S,material:v,panelBackground:I,virtualized:R=!1,...h}=T({...o,size:a,variant:t},E),g=N(a,E.size.default),D=e.useMemo(()=>({size:a,variant:t,color:i,material:s}),[a,t,i,s]),f=e.createElement(W,{size:a},e.createElement(A.Provider,{value:D},m));return e.createElement(u.Portal,{container:w,forceMount:c},e.createElement(z,{asChild:!0},e.createElement(u.SubContent,{"data-accent-color":i,"data-material":s,"data-panel-background":s,alignOffset:q(g,p.scaling),sideOffset:1,collisionPadding:10,...h,asChild:!1,ref:n,className:d("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},R?e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport","rt-virtualized")},f):e.createElement(V,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport")},f)))))});Ce.displayName="DropdownMenu.CascadeSubContent";var be=e.forwardRef(({store:o,sub:n,...r},p)=>{let a=G(o,n.id),t=J(o,n.id),i=Q(a==="top"?o:null);if(a==="closed")return null;let{className:s,children:l,container:m,forceMount:w,virtualized:c,size:S,variant:v,color:I,material:R,panelBackground:h,...g}=Oe(r),D=a==="top",f=t?.name||(typeof n.label=="string"?n.label:"");return e.createElement("div",{role:"group","aria-label":f||void 0,...g,ref:p,"data-drill-down-panel":n.id,"data-drill-down-active":D?!0:void 0,"data-animation-direction":D?i??void 0:void 0,className:d("rt-DropdownMenuDrillDownPanel",s)},D&&e.createElement(e.Fragment,null,e.createElement(ke,{label:n.label,name:f}),e.createElement(u.Separator,{className:"rt-BaseMenuSeparator rt-DropdownMenuSeparator"})),e.createElement(P.Provider,{value:D},l))});be.displayName="DropdownMenu.DrillDownPanel";var ve=e.forwardRef(({className:o,...n},r)=>e.createElement(ne,{...n,ref:r,className:d("rt-DropdownMenuTriggerIcon",o)}));ve.displayName="DropdownMenu.TriggerIcon";export{pe as a,ue as b,de as c,le as d,ce as e,me as f,we as g,De as h,Me as i,fe as j,Pe as k,Re as l,ge as m,ve as n,Ge as o};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as V}from"./chunk-COWZAUZR.js";import{b as oe,c as ne,d as K,e as re,f as te}from"./chunk-IX5HIHVI.js";import{a as ee}from"./chunk-MJJ7XDIP.js";import{c as W}from"./chunk-7RQNB63F.js";import{b as L,c as z}from"./chunk-SEY4NA45.js";import{a as x}from"./chunk-5TXQLK4G.js";import{b as y,c as E,d as H,e as U,f as Y}from"./chunk-3KSGRY6I.js";import{b as N,c as B,d as q,e as k,f as O}from"./chunk-ZOY43B55.js";import{a as T}from"./chunk-6FLLFCBU.js";import{a as P,b,c as X,d as $,e as G,f as J,g as Q,h as Z,i as _}from"./chunk-JSW6J6RS.js";import{a as Te}from"./chunk-OS3FCYZY.js";var Ge={};Te(Ge,{CheckboxItem:()=>Me,Content:()=>de,Group:()=>me,Item:()=>ce,Label:()=>le,RadioGroup:()=>we,RadioItem:()=>De,Root:()=>pe,Separator:()=>Re,Sub:()=>fe,SubContent:()=>ge,SubTrigger:()=>Pe,Trigger:()=>ue,TriggerIcon:()=>ve});import*as e from"react";import d from"classnames";import{DropdownMenu as u,Slot as xe}from"radix-ui";import{useCallbackRef as ae}from"radix-ui/internal";var ie=e.createContext(!1),pe=o=>{let{open:n,defaultOpen:r=!1,onOpenChange:p}=o,[a,t]=e.useState(r),i=n??a,s=ae(p),l=e.useCallback(m=>{t(m),s(m)},[s]);return e.createElement(ie.Provider,{value:i},e.createElement(u.Root,{...o,onOpenChange:l}))};pe.displayName="DropdownMenu.Root";var ue=e.forwardRef(({children:o,...n},r)=>e.createElement(u.Trigger,{...n,ref:r,asChild:!0},ee(o)));ue.displayName="DropdownMenu.Trigger";var A=e.createContext({}),Ee={ltr:"ArrowLeft",rtl:"ArrowRight"},Ne={ltr:"ArrowRight",rtl:"ArrowLeft"};function Be(o){return o instanceof HTMLElement&&(o.isContentEditable||o.tagName==="INPUT"||o.tagName==="TEXTAREA")}function se(o){return o?.closest("[dir]")?.getAttribute("dir")==="rtl"?"rtl":"ltr"}var de=e.forwardRef((o,n)=>{let r=L();x(o.panelBackground);let p=B(o.material,o.panelBackground,r),{size:a=y.size.default,variant:t=y.variant.default}=o,{className:i,children:s,color:l,container:m,forceMount:w,material:c,panelBackground:S,submenuBehavior:v,virtualized:I=!1,onEscapeKeyDown:R,onKeyDown:h,...g}=T(o,y),D=l||r.accentColor,f=N(v,"cascade"),F=f==="drill-down",Ie=e.useContext(ie),C=X(),he=M=>{R?.(M),!(M.defaultPrevented||!F||C.getDepth()===0)&&(M.preventDefault(),C.pop("keyboard"))},ye=M=>{h?.(M),!(M.defaultPrevented||!F||C.getDepth()===0)&&(Be(M.target)||M.key===Ee[se(M.currentTarget)]&&(M.preventDefault(),C.pop("keyboard")))},Se=e.useMemo(()=>({size:a,variant:t,color:D,material:p}),[a,t,D,p]),j=e.createElement(W,{size:a},e.createElement(A.Provider,{value:Se},e.createElement($,{store:C,behavior:f,open:Ie},s)));return e.createElement(u.Portal,{container:m,forceMount:w},e.createElement(z,{asChild:!0},e.createElement(u.Content,{"data-accent-color":D,"data-material":p,"data-panel-background":p,align:"start",sideOffset:4,collisionPadding:10,...g,onEscapeKeyDown:he,onKeyDown:ye,asChild:!1,ref:n,className:d("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",i)},I?e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport","rt-virtualized")},j):e.createElement(V,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport")},j)))))});de.displayName="DropdownMenu.Content";var le=e.forwardRef(({className:o,...n},r)=>e.useContext(P)?e.createElement(u.Label,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuLabel","rt-DropdownMenuLabel",o)}):null);le.displayName="DropdownMenu.Label";var ce=e.forwardRef((o,n)=>{let{className:r,children:p,color:a=H.color.default,shortcut:t,...i}=o;return e.useContext(P)?e.createElement(u.Item,{"data-accent-color":a,"aria-keyshortcuts":t?k(t):void 0,...i,ref:n,className:d("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},e.createElement(xe.Slottable,null,p),t&&e.createElement(O,{shortcut:t,className:"rt-DropdownMenuShortcut"})):null});ce.displayName="DropdownMenu.Item";var me=e.forwardRef(({className:o,...n},r)=>e.createElement(u.Group,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuGroup","rt-DropdownMenuGroup",o)}));me.displayName="DropdownMenu.Group";var we=e.forwardRef(({className:o,...n},r)=>e.createElement(u.RadioGroup,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",o)}));we.displayName="DropdownMenu.RadioGroup";var De=e.forwardRef((o,n)=>{let{children:r,className:p,color:a=Y.color.default,...t}=o;return e.useContext(P)?e.createElement(u.RadioItem,{...t,asChild:!1,ref:n,"data-accent-color":a,className:d("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",p)},r,e.createElement(u.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},e.createElement(te,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"}))):null});De.displayName="DropdownMenu.RadioItem";var Me=e.forwardRef((o,n)=>{let{children:r,className:p,shortcut:a,color:t=U.color.default,...i}=o;return e.useContext(P)?e.createElement(u.CheckboxItem,{"aria-keyshortcuts":a?k(a):void 0,...i,asChild:!1,ref:n,"data-accent-color":t,className:d("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",p)},r,e.createElement(u.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},e.createElement(oe,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})),a&&e.createElement(O,{shortcut:a,className:"rt-DropdownMenuShortcut"})):null});Me.displayName="DropdownMenu.CheckboxItem";var fe=({label:o="Back",open:n,defaultOpen:r,onOpenChange:p,children:a})=>{let t=b(),i=e.useId(),s=e.useMemo(()=>({id:i,label:o}),[i,o]),l=G(t,i)!=="closed";e.useLayoutEffect(()=>{!t||n===void 0||(n&&!t.isOpen(i)?t.push(i,null):!n&&t.isOpen(i)&&t.close(i))},[t,n,i]);let m=e.useRef(r);e.useLayoutEffect(()=>{t&&m.current&&n===void 0&&t.push(i,null)},[]);let w=ae(p),c=e.useRef(l);return e.useEffect(()=>{!t||c.current===l||(c.current=l,w(l))},[t,l,w]),e.createElement(Z.Provider,{value:s},e.createElement(u.Sub,{open:n,defaultOpen:r,onOpenChange:t?void 0:p},a))};fe.displayName="DropdownMenu.Sub";var Pe=e.forwardRef((o,n)=>{let{className:r,children:p,onKeyDown:a,...t}=o,i=b(),s=_(),l=e.useContext(P);if(i&&s){if(!l)return null;let m=c=>{c.preventDefault(),i.push(s.id)},w=c=>{a?.(c),!(c.defaultPrevented||t.disabled)&&c.key===Ne[se(c.currentTarget)]&&(c.preventDefault(),i.push(s.id,"keyboard"))};return e.createElement(u.Item,{"aria-haspopup":"menu",...t,"data-drill-down-trigger":s.id,"data-drill-down-name":t.textValue,onSelect:m,onKeyDown:w,ref:n,className:d("rt-reset","rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger","rt-DropdownMenuDrillDownSubTrigger",r)},p,e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(K,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubTriggerIcon"})))}return e.createElement(u.SubTrigger,{...t,onKeyDown:a,asChild:!1,ref:n,className:d("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},p,e.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},e.createElement(K,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubTriggerIcon"})))});Pe.displayName="DropdownMenu.SubTrigger";var Re=e.forwardRef(({className:o,...n},r)=>e.useContext(P)?e.createElement(u.Separator,{...n,asChild:!1,ref:r,className:d("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",o)}):null);Re.displayName="DropdownMenu.Separator";function ke({label:o,name:n}){let r=b(),p=e.useCallback(i=>{i.preventDefault(),r?.pop()},[r]),a=typeof o=="string"?o:n,t=a&&a!=="Back"?`Back from ${a}`:void 0;return e.createElement(u.Item,{"aria-label":t,textValue:a||"Back",onSelect:p,className:d("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem","rt-DropdownMenuDrillDownBackItem")},e.createElement(re,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuDrillDownBackIcon"}),e.createElement("span",{className:"rt-DropdownMenuDrillDownBackLabel"},o))}function Oe(o){let{loop:n,onEscapeKeyDown:r,onPointerDownOutside:p,onFocusOutside:a,onInteractOutside:t,sideOffset:i,alignOffset:s,avoidCollisions:l,collisionBoundary:m,collisionPadding:w,arrowPadding:c,sticky:S,hideWhenDetached:v,updatePositionStrategy:I,...R}=o;return R}var ge=e.forwardRef((o,n)=>{let r=b(),p=_();return r&&p?e.createElement(be,{...o,ref:n,store:r,sub:p}):e.createElement(Ce,{...o,ref:n})});ge.displayName="DropdownMenu.SubContent";var Ce=e.forwardRef((o,n)=>{let r=e.useContext(A),p=L();x(o.panelBackground);let a=o.size??r.size,t=o.variant??r.variant,i=o.color??r.color,s=o.material??o.panelBackground??r.material??B(void 0,void 0,p),{className:l,children:m,container:w,forceMount:c,color:S,material:v,panelBackground:I,virtualized:R=!1,...h}=T({...o,size:a,variant:t},E),g=N(a,E.size.default),D=e.useMemo(()=>({size:a,variant:t,color:i,material:s}),[a,t,i,s]),f=e.createElement(W,{size:a},e.createElement(A.Provider,{value:D},m));return e.createElement(u.Portal,{container:w,forceMount:c},e.createElement(z,{asChild:!0},e.createElement(u.SubContent,{"data-accent-color":i,"data-material":s,"data-panel-background":s,alignOffset:q(g,p.scaling),sideOffset:1,collisionPadding:10,...h,asChild:!1,ref:n,className:d("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",l)},R?e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport","rt-virtualized")},f):e.createElement(V,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:d("rt-BaseMenuViewport","rt-DropdownMenuViewport")},f)))))});Ce.displayName="DropdownMenu.CascadeSubContent";var be=e.forwardRef(({store:o,sub:n,...r},p)=>{let a=G(o,n.id),t=J(o,n.id),i=Q(a==="top"?o:null);if(a==="closed")return null;let{className:s,children:l,container:m,forceMount:w,virtualized:c,size:S,variant:v,color:I,material:R,panelBackground:h,...g}=Oe(r),D=a==="top",f=t?.name||(typeof n.label=="string"?n.label:"");return e.createElement("div",{role:"group","aria-label":f||void 0,...g,ref:p,"data-drill-down-panel":n.id,"data-drill-down-active":D?!0:void 0,"data-animation-direction":D?i??void 0:void 0,className:d("rt-DropdownMenuDrillDownPanel",s)},D&&e.createElement(e.Fragment,null,e.createElement(ke,{label:n.label,name:f}),e.createElement(u.Separator,{className:"rt-BaseMenuSeparator rt-DropdownMenuSeparator"})),e.createElement(P.Provider,{value:D},l))});be.displayName="DropdownMenu.DrillDownPanel";var ve=e.forwardRef(({className:o,...n},r)=>e.createElement(ne,{...n,ref:r,className:d("rt-DropdownMenuTriggerIcon",o)}));ve.displayName="DropdownMenu.TriggerIcon";export{pe as a,ue as b,de as c,le as d,ce as e,me as f,we as g,De as h,Me as i,fe as j,Pe as k,Re as l,ge as m,ve as n,Ge as o};
|
|
2
|
+
//# sourceMappingURL=chunk-MZXHKM4V.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as B}from"./chunk-COWZAUZR.js";import{b as O,d as _,f as A}from"./chunk-IX5HIHVI.js";import{a as V}from"./chunk-MJJ7XDIP.js";import{c as k}from"./chunk-7RQNB63F.js";import{b as T,c as N}from"./chunk-SEY4NA45.js";import{a as b}from"./chunk-5TXQLK4G.js";import{c as m,d as W,e as D,f as L}from"./chunk-3KSGRY6I.js";import{b as v,c as S,d as g,e as h,f as y}from"./chunk-ZOY43B55.js";import{a as I}from"./chunk-6FLLFCBU.js";import{a as ne}from"./chunk-OS3FCYZY.js";var re={};ne(re,{CheckboxItem:()=>X,Content:()=>q,Group:()=>J,Item:()=>H,Label:()=>K,RadioGroup:()=>Q,RadioItem:()=>U,Root:()=>j,Separator:()=>ee,Sub:()=>Y,SubContent:()=>$,SubTrigger:()=>Z,Trigger:()=>F});import*as e from"react";import s from"classnames";import{ContextMenu as a,Slot as G}from"radix-ui";var j=t=>e.createElement(a.Root,{...t});j.displayName="ContextMenu.Root";var F=e.forwardRef(({children:t,...n},o)=>e.createElement(a.Trigger,{...n,ref:o,asChild:!0},V(t)));F.displayName="ContextMenu.Trigger";var E=e.createContext({}),q=e.forwardRef((t,n)=>{let o=T();b(t.panelBackground);let i=S(t.material,t.panelBackground,o),{size:r=m.size.default,variant:u=m.variant.default}=t,{className:C,children:p,color:x,container:M,forceMount:d,material:w,panelBackground:te,submenuBehavior:oe,virtualized:z=!1,...P}=I(t,m),c=x||o.accentColor,f=v(r,m.size.default),R=e.useMemo(()=>({size:r,variant:u,color:c,material:i}),[r,u,c,i]),l=e.createElement(k,{size:r},e.createElement(E.Provider,{value:R},p));return e.createElement(a.Portal,{container:M,forceMount:d},e.createElement(N,{asChild:!0},e.createElement(a.Content,{"data-accent-color":c,"data-material":i,"data-panel-background":i,alignOffset:g(f,o.scaling),collisionPadding:10,...P,asChild:!1,ref:n,className:s("rt-PopperContent","rt-BaseMenuContent","rt-ContextMenuContent",C)},z?e.createElement("div",{className:s("rt-BaseMenuViewport","rt-ContextMenuViewport","rt-virtualized")},l):e.createElement(B,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("rt-BaseMenuViewport","rt-ContextMenuViewport")},l)))))});q.displayName="ContextMenu.Content";var K=e.forwardRef(({className:t,...n},o)=>e.createElement(a.Label,{...n,asChild:!1,ref:o,className:s("rt-BaseMenuLabel","rt-ContextMenuLabel",t)}));K.displayName="ContextMenu.Label";var H=e.forwardRef((t,n)=>{let{className:o,children:i,color:r=W.color.default,shortcut:u,...C}=t;return e.createElement(a.Item,{"data-accent-color":r,"aria-keyshortcuts":u?h(u):void 0,...C,ref:n,className:s("rt-reset","rt-BaseMenuItem","rt-ContextMenuItem",o)},e.createElement(G.Slottable,null,i),u&&e.createElement(y,{shortcut:u,className:"rt-ContextMenuShortcut"}))});H.displayName="ContextMenu.Item";var J=e.forwardRef(({className:t,...n},o)=>e.createElement(a.Group,{...n,asChild:!1,ref:o,className:s("rt-BaseMenuGroup","rt-ContextMenuGroup",t)}));J.displayName="ContextMenu.Group";var Q=e.forwardRef(({className:t,...n},o)=>e.createElement(a.RadioGroup,{...n,asChild:!1,ref:o,className:s("rt-BaseMenuRadioGroup","rt-ContextMenuRadioGroup",t)}));Q.displayName="ContextMenu.RadioGroup";var U=e.forwardRef((t,n)=>{let{children:o,className:i,color:r=L.color.default,...u}=t;return e.createElement(a.RadioItem,{...u,asChild:!1,ref:n,"data-accent-color":r,className:s("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-ContextMenuItem","rt-ContextMenuRadioItem",i)},e.createElement(G.Slottable,null,o),e.createElement(a.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},e.createElement(A,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})))});U.displayName="ContextMenu.RadioItem";var X=e.forwardRef((t,n)=>{let{children:o,className:i,shortcut:r,color:u=D.color.default,...C}=t;return e.createElement(a.CheckboxItem,{"aria-keyshortcuts":r?h(r):void 0,...C,asChild:!1,ref:n,"data-accent-color":u,className:s("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-ContextMenuItem","rt-ContextMenuCheckboxItem",i)},e.createElement(G.Slottable,null,o),e.createElement(a.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-ContextMenuItemIndicator"},e.createElement(O,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),r&&e.createElement(y,{shortcut:r,className:"rt-ContextMenuShortcut"}))});X.displayName="ContextMenu.CheckboxItem";var Y=t=>e.createElement(a.Sub,{...t});Y.displayName="ContextMenu.Sub";var Z=e.forwardRef((t,n)=>{let{className:o,children:i,...r}=t;return e.createElement(a.SubTrigger,{...r,asChild:!1,ref:n,className:s("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-ContextMenuItem","rt-ContextMenuSubTrigger",o)},i,e.createElement("div",{className:"rt-BaseMenuShortcut rt-ContextMenuShortcut"},e.createElement(_,{className:"rt-BaseMenuSubTriggerIcon rt-ContextMenuSubTriggerIcon"})))});Z.displayName="ContextMenu.SubTrigger";var $=e.forwardRef((t,n)=>{let o=e.useContext(E),i=T();b(t.panelBackground);let r=t.size??o.size,u=t.variant??o.variant,C=t.color??o.color,p=t.material??t.panelBackground??o.material??S(void 0,void 0,i),{className:x,children:M,container:d,forceMount:w,color:te,material:oe,panelBackground:z,virtualized:P=!1,...c}=I({...t,size:r,variant:u},m),f=v(r,m.size.default),R=e.useMemo(()=>({size:r,variant:u,color:C,material:p}),[r,u,C,p]),l=e.createElement(k,{size:r},e.createElement(E.Provider,{value:R},M));return e.createElement(a.Portal,{container:d,forceMount:w},e.createElement(N,{asChild:!0},e.createElement(a.SubContent,{"data-accent-color":C,"data-material":p,"data-panel-background":p,alignOffset:g(f,i.scaling),sideOffset:1,collisionPadding:10,...c,asChild:!1,ref:n,className:s("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-ContextMenuContent","rt-ContextMenuSubContent",x)},P?e.createElement("div",{className:s("rt-BaseMenuViewport","rt-ContextMenuViewport","rt-virtualized")},l):e.createElement(B,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("rt-BaseMenuViewport","rt-ContextMenuViewport")},l)))))});$.displayName="ContextMenu.SubContent";var ee=e.forwardRef(({className:t,...n},o)=>e.createElement(a.Separator,{...n,asChild:!1,ref:o,className:s("rt-BaseMenuSeparator","rt-ContextMenuSeparator",t)}));ee.displayName="ContextMenu.Separator";export{j as a,F as b,q as c,K as d,H as e,J as f,Q as g,U as h,X as i,Y as j,Z as k,$ as l,ee as m,re as n};
|
|
2
|
+
//# sourceMappingURL=chunk-PQKJNRMR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as rt}from"./chunk-RJP5QUXO.js";import{a as je}from"./chunk-4XGGX2V2.js";import{a as nt}from"./chunk-CTA5ODAO.js";import{g as tt,j as at}from"./chunk-IX5HIHVI.js";import{a as me}from"./chunk-5WRCK4R7.js";import{a as et}from"./chunk-HF5WY5YE.js";import{a as de}from"./chunk-FHOCUZDR.js";import{a as Be}from"./chunk-AGAQC4HH.js";import{b as U}from"./chunk-FWB47YCH.js";import{a as Ot}from"./chunk-OS3FCYZY.js";var $t={};Ot($t,{AttachTrigger:()=>ft,Attachment:()=>Ue,AttachmentsRow:()=>ht,InlineEnd:()=>pt,InlineStart:()=>mt,Root:()=>ut,Row:()=>bt,RowEnd:()=>Ct,RowStart:()=>Rt,Send:()=>gt,Textarea:()=>dt});import*as e from"react";import L from"classnames";import{LazyMotion as Ft,MotionConfig as Ht,domAnimation as zt,m as he}from"motion/react";import{useComposedRefs as it}from"radix-ui/internal";import{useDropzone as It}from"react-dropzone";var Ve=typeof window<"u"?e.useLayoutEffect:e.useEffect;function ot(n,s){let{placeholder:r}=n;if(!r){s();return}n.placeholder="";try{s()}finally{n.placeholder=r}}var fe={layout:{type:"spring",visualDuration:.15,bounce:.1}},ct=e.createContext(null),$e=e.createContext(""),K=()=>{let n=e.useContext(ct);if(!n)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return n},pe=n=>Array.isArray(n)?n:typeof n=="string"?n.split(",").map(s=>s.trim()).filter(Boolean):[],Dt=(n,s)=>{if(s.length===0)return!0;let r=n.type.toLowerCase(),d=n.name.toLowerCase();for(let f of s){let i=f.toLowerCase();if(i.includes("/")){let[b,c]=i.split("/"),[C,p]=r.split("/");if(b==="*"||b===C&&(c==="*"||c===p))return!0}else if(i.startsWith(".")&&d.endsWith(i))return!0}return!1},Bt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,lt=(n,s)=>(s||"").toLowerCase().startsWith("image/")||Bt.test(n),We=n=>n.trim().length>0,st=(n,s)=>`${n} ${s}${n===1?"":"s"}`,jt=0,Vt=()=>`chatbar-attachment-${Date.now()}-${++jt}`,ut=e.forwardRef((n,s)=>{let{className:r,style:d,children:f,value:i,defaultValue:b="",onValueChange:c,open:C,defaultOpen:p=!1,onOpenChange:S,expandOn:A="both",minLines:h=3,maxLines:B=6,sendMode:H="whenDirty",disabled:l,readOnly:g,onSubmit:k,size:P="2",variant:E,color:M,radius:z,panelBackground:v,material:N,width:j,maxWidth:re,attachments:y,defaultAttachments:I,onAttachmentsChange:_,accept:be,multiple:F=!0,maxAttachments:G,maxFileSize:q,paste:D=!0,pasteAccept:O,clearOnSubmit:Y=!0,onAttachmentReject:Ee,dropzone:oe=!0,apiRef:Te,onBlurCapture:Re,notices:Ce,context:ge,...Le}=n,t=N||v,R=i!=null,[w,se]=e.useState(b),V=R?i:w,X=C!=null,[ke,ie]=e.useState(p),Q=X?C:ke,Z="attachments"in n,[Ke,vt]=e.useState(()=>I??[]),ce=e.useMemo(()=>Z?y??[]:Ke,[Z,y,Ke]),[_e,yt]=e.useState({text:"",id:0}),le=e.useCallback(a=>yt(o=>({text:a,id:o.id+1})),[]),Ge=e.useRef(null),xt=it(s,Ge),Me=e.useRef(null),Ne=e.useRef(null),ue=e.useRef(!1),ve=e.useRef(!1),ye=e.useRef(void 0),Oe=e.useRef(null),qe=pe(be).join(","),Fe=pe(O).join(","),He=e.useMemo(()=>pe(qe),[qe]),Pt=e.useMemo(()=>Fe?pe(Fe):He,[Fe,He]),Ye={value:V,attachments:ce,accepts:He,pasteAccepts:Pt,multiple:F,maxAttachments:G,maxFileSize:q,disabled:l,readOnly:g,expandOn:A,isValueControlled:R,isOpenControlled:X,isAttachmentsControlled:Z,onValueChange:c,onOpenChange:S,onAttachmentsChange:_,onAttachmentReject:Ee,onSubmit:k},x=e.useRef(Ye);x.current=Ye;let ze=e.useRef(null),W=e.useCallback(()=>ze.current??x.current.attachments,[]),ee=e.useCallback(a=>{x.current.isOpenControlled||ie(a),x.current.onOpenChange?.(a)},[]),xe=e.useCallback(a=>{x.current.isValueControlled||se(a),x.current.onValueChange?.(a)},[]),te=e.useCallback(a=>{ze.current=a,queueMicrotask(()=>{ze.current=null}),x.current.isAttachmentsControlled||vt(a),x.current.onAttachmentsChange?.(a)},[]),Pe=e.useRef(new Set),ae=e.useCallback((a,o,u=x.current.multiple)=>{let m=x.current;if(m.disabled||m.readOnly||a.length===0)return 0;let $=W(),J=[],ne=[],Mt=typeof m.maxAttachments=="number"?Math.max(m.maxAttachments-$.length,0):1/0,Nt=u?1/0:1;for(let T of a){if(J.length>=Mt||J.length>=Nt){ne.push({file:T,reason:"count"});continue}if(typeof m.maxFileSize=="number"&&T.size>m.maxFileSize){ne.push({file:T,reason:"size"});continue}if(!Dt(T,o)){ne.push({file:T,reason:"type"});continue}let De=lt(T.name,T.type)?URL.createObjectURL(T):void 0;De&&Pe.current.add(De),J.push({id:Vt(),name:T.name,size:T.size,type:T.type,file:T,url:De,status:"idle"})}let Se=[];return J.length>0&&(te($.concat(J)),m.expandOn!=="none"&&ee(!0),Se.push(`${st(J.length,"file")} attached.`)),ne.length>0&&(m.onAttachmentReject?.(ne),Se.push(`${st(ne.length,"file")} could not be attached.`)),Se.length>0&&le(Se.join(" ")),J.length},[W,te,ee,le]),Ae=e.useCallback(a=>ae(a,x.current.accepts),[ae]),Xe=e.useCallback(a=>ae(a,x.current.pasteAccepts),[ae]),Je=e.useCallback(a=>{let o=W(),u=o.find(m=>m.id===a);u&&(te(o.filter(m=>m.id!==a)),le(`Removed ${u.name}.`))},[W,te,le]),Qe=e.useCallback(a=>{let o=x.current;if(o.disabled||o.readOnly)return!1;let u=W();if(!We(o.value)&&u.length===0)return!1;let m={value:o.value,attachments:u};if(a&&o.onSubmit)for(let $ of u)$.url&&Pe.current.delete($.url);return o.onSubmit?.(m),a&&(xe(""),te([])),!0},[W,xe,te]);e.useEffect(()=>{let a=Pe.current;if(a.size===0)return;let o=new Set(ce.map(u=>u.url));for(let u of Array.from(a))o.has(u)||(URL.revokeObjectURL(u),a.delete(u))},[ce]),e.useEffect(()=>{let a=Pe.current;return()=>{if(!x.current.isAttachmentsControlled){for(let o of Array.from(a))URL.revokeObjectURL(o);a.clear()}}},[]);let we=e.useCallback(a=>{let o=x.current,u=Ne.current;if(clearTimeout(ye.current),ve.current=!1,!u||o.disabled||o.readOnly)return;let m=a?.accept!=null?pe(a.accept):o.accepts,$=a?.multiple??o.multiple;Oe.current={patterns:m,multiple:$},u.accept=m.join(","),u.multiple=$,ue.current=!0,u.click(),setTimeout(()=>{document.hasFocus()&&(ue.current=!1)},1e3)},[]),Ze=e.useCallback(()=>{ve.current=!0,clearTimeout(ye.current),ye.current=setTimeout(()=>{ve.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(ye.current),[]),e.useEffect(()=>{let a=Ne.current,o=()=>{ue.current=!1};return window.addEventListener("focus",o),a?.addEventListener("cancel",o),()=>{window.removeEventListener("focus",o),a?.removeEventListener("cancel",o)}},[]);let At=e.useCallback(a=>{let o=a.currentTarget,u=Array.from(o.files??[]),m=Oe.current;ae(u,m?.patterns??x.current.accepts,m?.multiple),ue.current=!1,Oe.current=null,o.value=""},[ae]),wt=e.useCallback(a=>{Re?.(a);let o=x.current,u=Ge.current;if(!u||o.expandOn==="none")return;let m=a.relatedTarget;m&&u.contains(m)||ue.current||ve.current||!We(o.value)&&W().length===0&&ee(!1)},[Re,ee,W]),St=e.useCallback(a=>{Ae(a)},[Ae]),{getRootProps:Et,isDragActive:Tt}=It({onDrop:St,onDragEnter:()=>le(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!oe||l||g}),Ie=oe&&Tt;e.useImperativeHandle(Te,()=>({focusTextarea:()=>Me.current?.focus({preventScroll:!0}),openFilePicker:()=>we()}),[we]);let Lt=e.useCallback(a=>{if(l||a.pointerType==="mouse"&&a.button!==0)return;let o=a.target;o instanceof Element&&o.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(a.preventDefault(),Me.current?.focus({preventScroll:!0}))},[l]),kt=e.useMemo(()=>({open:Q,setOpen:ee,setValue:xe,size:P,expandOn:A,minLines:h,maxLines:B,sendMode:H,disabled:l,readOnly:g,paste:D,clearOnSubmit:Y,multiple:F,textareaRef:Me,attachments:ce,removeAttachment:Je,submit:Qe,appendFiles:Ae,appendFilesFromPaste:Xe,openFilePicker:we,beginFilePickerPress:Ze}),[Q,ee,xe,P,A,h,B,H,l,g,D,Y,F,ce,Je,Qe,Ae,Xe,we,Ze]);return e.createElement(ct.Provider,{value:kt},e.createElement($e.Provider,{value:V},e.createElement(Ft,{features:zt},e.createElement(Ht,{reducedMotion:"user"},e.createElement("div",{...Le,ref:xt,className:L("rt-ChatbarRoot",`rt-r-size-${P}`,r),style:{position:"relative",width:j,maxWidth:re,...d},"data-state":Q?"open":"closed","data-disabled":l?"":void 0,"data-readonly":g?"":void 0,"data-drop-active":Ie?"":void 0,"data-accent-color":M,"data-radius":z,"data-panel-background":t,"data-material":t,onBlurCapture:wt},e.createElement("input",{ref:Ne,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:At}),Ce?e.createElement("div",{className:"rt-ChatbarNotices"},e.createElement(rt.Provider,{value:P},Ce)):null,e.createElement("div",{...oe?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement(he.div,{className:L("rt-ChatbarBox",`rt-variant-${E??"surface"}`),style:{position:"relative"},"data-accent-color":M,"data-radius":z,"data-panel-background":t,"data-material":t,layout:!0,transition:fe},e.createElement(he.div,{className:"rt-ChatbarGrid",layout:"position",transition:fe},f),Ie&&e.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"rt-ChatbarDropContent"},e.createElement(me,{emphasis:"medium",size:P,weight:"medium"},"Drop files here to attach"))))),ge?e.createElement(me,{as:"div",size:P==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},ge):null,e.createElement(Be,{role:"status","aria-live":"polite"},Ie?"Drop files here to attach.":e.createElement("span",{key:_e.id},_e.text)))))))});ut.displayName="Chatbar.Root";var dt=e.forwardRef((n,s)=>{let{className:r,style:d,asChild:f,onFocus:i,onChange:b,onPaste:c,onKeyDown:C,onCompositionStart:p,onCompositionEnd:S,submitOnEnter:A=!1,...h}=n,B=K(),H=e.useContext($e),{open:l,minLines:g,maxLines:k,expandOn:P,disabled:E,readOnly:M,setOpen:z,setValue:v,textareaRef:N,paste:j,appendFilesFromPaste:re,size:y,submit:I,clearOnSubmit:_}=B,be=it(s,N),F=e.useRef(0),G=e.useRef(0),q=e.useRef(!1),D=e.useRef({open:l,minLines:g,maxLines:k});Ve(()=>{D.current={open:l,minLines:g,maxLines:k}},[l,g,k]);let O=e.useCallback(()=>{let t=N.current;if(!t)return;let R=window.getComputedStyle(t);F.current=parseFloat(R.lineHeight)||20,G.current=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0)},[N]),Y=e.useCallback((t,R)=>{let{minLines:w,maxLines:se}=D.current,V=F.current,X=G.current,ke=Math.ceil((R?w:1)*V)+X,ie=Math.ceil((R?se:1)*V)+X,Q=Math.max(t.scrollHeight,ke);t.style.height=`${Math.min(Q,ie)}px`;let Z=Q>ie;t.style.overflowY=Z?"auto":"hidden",t.style.maxHeight=Z?`${ie}px`:"none"},[]);Ve(()=>{O()},[O,y]),Ve(()=>{let t=N.current;t&&(F.current===0&&O(),ot(t,()=>{t.style.height="auto";let R=l;if(!l&&(P==="overflow"||P==="both")){let w=Math.ceil(F.current)+G.current;t.scrollHeight>w+1&&(R=!0,z(!0))}Y(t,R)}))},[H,l,P,g,k,y,z,N,O,Y]),e.useEffect(()=>{let t=N.current;if(!t||typeof ResizeObserver>"u")return;let R=-1,w=new ResizeObserver(se=>{let V=se[0]?.contentRect.width??0;if(V===R)return;let X=R===-1;R=V,!X&&(O(),ot(t,()=>{t.style.height="auto",Y(t,D.current.open)}))});return w.observe(t),()=>w.disconnect()},[N,O,Y]),e.useEffect(()=>{},[]);let Ee=e.useCallback(t=>{i?.(t),!(E||M)&&(P==="focus"||P==="both")&&!l&&z(!0)},[E,M,P,l,z,i]),oe=e.useCallback(t=>{v(t.currentTarget.value),b?.(t)},[v,b]),Te=e.useCallback(t=>{if(c?.(t),t.defaultPrevented||!j||E||M)return;let R=Array.from(t.clipboardData?.items??[]).filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(w=>!!w);R.length!==0&&re(R)>0&&t.preventDefault()},[j,E,M,c,re]),Re=e.useCallback(t=>{q.current=!0,p?.(t)},[p]),Ce=e.useCallback(t=>{q.current=!1,S?.(t)},[S]),ge=e.useCallback(t=>{C?.(t),!(t.defaultPrevented||!A)&&(t.key!=="Enter"||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey||q.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||(t.preventDefault(),I(_)))},[A,C,I,_]),Le=f?U:"textarea";return e.createElement(he.div,{className:L("rt-ChatbarField","rt-ChatbarTextarea",r),layout:"position",transition:fe},e.createElement(Le,{...h,ref:be,className:"rt-ChatbarInput",value:H,onChange:oe,onFocus:Ee,onPaste:Te,onKeyDown:ge,onCompositionStart:Re,onCompositionEnd:Ce,disabled:E,readOnly:M,rows:l?g:1,spellCheck:h.spellCheck??!0,autoCorrect:h.autoCorrect??"on",style:d}))});dt.displayName="Chatbar.Textarea";var mt=e.forwardRef((n,s)=>{let{children:r,asChild:d,className:f,...i}=n;return K().open?null:e.createElement(d?U:"div",{...i,ref:s,className:L("rt-ChatbarInlineStart",f)},r)});mt.displayName="Chatbar.InlineStart";var pt=e.forwardRef((n,s)=>{let{children:r,asChild:d,className:f,...i}=n;return K().open?null:e.createElement(d?U:"div",{...i,ref:s,className:L("rt-ChatbarInlineEnd",f)},r)});pt.displayName="Chatbar.InlineEnd";var ht=e.forwardRef((n,s)=>{let{asChild:r,forceMount:d,renderAttachment:f,className:i,...b}=n,c=K();if(c.attachments.length===0&&!d)return null;let C=r?U:"div";return e.createElement(he.div,{layout:"position",transition:fe},e.createElement(C,{...b,ref:s,className:L("rt-ChatbarAttachmentsRow",i),role:"list","aria-label":b["aria-label"]??"Attachments"},e.createElement(nt,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},e.createElement(de,{align:"center",gap:"2",minWidth:"fit-content"},c.attachments.map(p=>e.createElement(Ue,{key:p.id,attachment:p,asChild:!!f},f?.(p)))))))});ht.displayName="Chatbar.AttachmentsRow";var Wt={uploading:"uploading",error:"failed to upload"},Ue=e.forwardRef((n,s)=>{let{attachment:r,asChild:d,className:f,children:i,...b}=n,c=K(),C=d?U:"div",p=!!r.url&<(r.name,r.type),S=`${Math.ceil(r.size/1024)} KB`,A=r.status?Wt[r.status]:void 0,h=c.disabled||c.readOnly,B=H=>{let l=H.currentTarget.closest('[role="listitem"]'),g=l?.parentElement?Array.from(l.parentElement.children):[],k=l?g.indexOf(l):-1,E=(g[k+1]??g[k-1])?.querySelector(".rt-ChatbarAttachmentRemove");E?E.focus():c.textareaRef.current?.focus({preventScroll:!0}),c.removeAttachment(r.id)};return e.createElement(C,{...b,ref:s,className:L("rt-ChatbarAttachment",f),role:"listitem","data-kind":p?"image":"file","data-status":r.status,title:r.name},i??e.createElement(de,{align:"center",gap:"2",pr:p?void 0:"6"},e.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},p?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:r.url,alt:""}):e.createElement(at,null)),p?e.createElement(Be,null,r.name,", ",S,A?`, ${A}`:""):e.createElement(de,{direction:"column",gap:"0",minWidth:"0"},e.createElement(me,{size:c.size,weight:"medium",truncate:!0},r.name),e.createElement(me,{size:"1",color:r.status==="error"?"red":void 0,emphasis:r.status==="error"?void 0:"medium"},S,A?` \xB7 ${A}`:"")),!h&&e.createElement(je,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${r.name}`,size:"1",variant:"classic",color:"gray",onClick:B},e.createElement(tt,null))))});Ue.displayName="Chatbar.Attachment";var ft=e.forwardRef((n,s)=>{let{asChild:r,accept:d,multiple:f,disabled:i,onPointerDown:b,onClick:c,...C}=n,p=K(),S=i||p.disabled||p.readOnly;return e.createElement(r?U:"button",{...C,ref:s,className:L("rt-ChatbarAttachTrigger",C.className),type:C.type??"button","aria-label":C["aria-label"]??"Add attachments",disabled:S,onPointerDown:h=>{b?.(h),!S&&!h.defaultPrevented&&p.beginFilePickerPress()},onClick:h=>{c?.(h),!(S||h.defaultPrevented)&&p.openFilePicker({accept:d,multiple:f})}})});ft.displayName="Chatbar.AttachTrigger";var bt=e.forwardRef((n,s)=>{let{asChild:r,children:d,className:f,...i}=n;if(!K().open)return null;let c=r?U:"div";return e.createElement(he.div,{layout:"position",transition:fe},e.createElement(c,{...i,ref:s,className:L("rt-ChatbarRow",f)},e.createElement(de,{align:"center",justify:"between",width:"100%"},d)))});bt.displayName="Chatbar.Row";var Rt=e.forwardRef((n,s)=>{let{className:r,...d}=n;return e.createElement("div",{...d,ref:s,className:L("rt-ChatbarRowStart",r)})});Rt.displayName="Chatbar.RowStart";var Ct=e.forwardRef((n,s)=>{let{className:r,...d}=n;return e.createElement("div",{...d,ref:s,className:L("rt-ChatbarRowEnd",r)})});Ct.displayName="Chatbar.RowEnd";var gt=e.forwardRef((n,s)=>{let{asChild:r,clearOnSend:d,disabled:f,children:i,style:b,className:c,size:C,variant:p,tabIndex:S,onClick:A,status:h="ready",onStop:B,onRetry:H,stopLabel:l="Stop",retryLabel:g="Retry",stopIcon:k,retryIcon:P,"aria-label":E,"aria-labelledby":M,...z}=n,v=K(),N=e.useContext($e),j=We(N)||v.attachments.length>0,y=j?"send":h==="submitted"||h==="streaming"?"stop":h==="error"?"retry":"send";if(v.sendMode==="never"&&y==="send")return null;let I=y!=="send"||v.sendMode==="always"||j,_=y==="send"?f||v.disabled||v.readOnly||!j:f||v.disabled,F=y==="stop"?{"aria-label":l}:y==="retry"?{"aria-label":g}:M?{"aria-labelledby":M}:{"aria-label":E??"Send"},G=D=>{if(A?.(D),D.defaultPrevented||_)return;if(y==="stop"){B?.();return}if(y==="retry"){H?.();return}let O=d??v.clearOnSubmit;v.submit(O)&&O&&v.textareaRef.current?.focus({preventScroll:!0})},q=y==="stop"?k??(h==="submitted"?e.createElement(et,{size:v.size}):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):y==="retry"?P??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):i??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(je,{...z,ref:s,size:C??v.size,variant:p??(v.open||y!=="send"?"solid":"ghost"),disabled:_,className:L("rt-ChatbarSend",c),style:{opacity:I?1:0,pointerEvents:I?void 0:"none",...b},"aria-hidden":I?void 0:!0,tabIndex:I?S:-1,asChild:r,onClick:G,"data-status":h,"data-mode":y,...F},q)});gt.displayName="Chatbar.Send";export{ut as a,dt as b,mt as c,pt as d,ht as e,Ue as f,ft as g,bt as h,Rt as i,Ct as j,gt as k,$t as l};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as rt}from"./chunk-RJP5QUXO.js";import{a as je}from"./chunk-4XGGX2V2.js";import{a as nt}from"./chunk-COWZAUZR.js";import{g as tt,j as at}from"./chunk-IX5HIHVI.js";import{a as me}from"./chunk-5WRCK4R7.js";import{a as et}from"./chunk-HF5WY5YE.js";import{a as de}from"./chunk-FHOCUZDR.js";import{a as Be}from"./chunk-AGAQC4HH.js";import{b as U}from"./chunk-FWB47YCH.js";import{a as Ot}from"./chunk-OS3FCYZY.js";var $t={};Ot($t,{AttachTrigger:()=>ft,Attachment:()=>Ue,AttachmentsRow:()=>ht,InlineEnd:()=>pt,InlineStart:()=>mt,Root:()=>ut,Row:()=>bt,RowEnd:()=>Ct,RowStart:()=>Rt,Send:()=>gt,Textarea:()=>dt});import*as e from"react";import L from"classnames";import{LazyMotion as Ft,MotionConfig as Ht,domAnimation as zt,m as he}from"motion/react";import{useComposedRefs as it}from"radix-ui/internal";import{useDropzone as It}from"react-dropzone";var Ve=typeof window<"u"?e.useLayoutEffect:e.useEffect;function ot(n,s){let{placeholder:r}=n;if(!r){s();return}n.placeholder="";try{s()}finally{n.placeholder=r}}var fe={layout:{type:"spring",visualDuration:.15,bounce:.1}},ct=e.createContext(null),$e=e.createContext(""),K=()=>{let n=e.useContext(ct);if(!n)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return n},pe=n=>Array.isArray(n)?n:typeof n=="string"?n.split(",").map(s=>s.trim()).filter(Boolean):[],Dt=(n,s)=>{if(s.length===0)return!0;let r=n.type.toLowerCase(),d=n.name.toLowerCase();for(let f of s){let i=f.toLowerCase();if(i.includes("/")){let[b,c]=i.split("/"),[C,p]=r.split("/");if(b==="*"||b===C&&(c==="*"||c===p))return!0}else if(i.startsWith(".")&&d.endsWith(i))return!0}return!1},Bt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,lt=(n,s)=>(s||"").toLowerCase().startsWith("image/")||Bt.test(n),We=n=>n.trim().length>0,st=(n,s)=>`${n} ${s}${n===1?"":"s"}`,jt=0,Vt=()=>`chatbar-attachment-${Date.now()}-${++jt}`,ut=e.forwardRef((n,s)=>{let{className:r,style:d,children:f,value:i,defaultValue:b="",onValueChange:c,open:C,defaultOpen:p=!1,onOpenChange:S,expandOn:A="both",minLines:h=3,maxLines:B=6,sendMode:H="whenDirty",disabled:l,readOnly:g,onSubmit:k,size:P="2",variant:E,color:M,radius:z,panelBackground:v,material:N,width:j,maxWidth:re,attachments:y,defaultAttachments:I,onAttachmentsChange:_,accept:be,multiple:F=!0,maxAttachments:G,maxFileSize:q,paste:D=!0,pasteAccept:O,clearOnSubmit:Y=!0,onAttachmentReject:Ee,dropzone:oe=!0,apiRef:Te,onBlurCapture:Re,notices:Ce,context:ge,...Le}=n,t=N||v,R=i!=null,[w,se]=e.useState(b),V=R?i:w,X=C!=null,[ke,ie]=e.useState(p),Q=X?C:ke,Z="attachments"in n,[Ke,vt]=e.useState(()=>I??[]),ce=e.useMemo(()=>Z?y??[]:Ke,[Z,y,Ke]),[_e,yt]=e.useState({text:"",id:0}),le=e.useCallback(a=>yt(o=>({text:a,id:o.id+1})),[]),Ge=e.useRef(null),xt=it(s,Ge),Me=e.useRef(null),Ne=e.useRef(null),ue=e.useRef(!1),ve=e.useRef(!1),ye=e.useRef(void 0),Oe=e.useRef(null),qe=pe(be).join(","),Fe=pe(O).join(","),He=e.useMemo(()=>pe(qe),[qe]),Pt=e.useMemo(()=>Fe?pe(Fe):He,[Fe,He]),Ye={value:V,attachments:ce,accepts:He,pasteAccepts:Pt,multiple:F,maxAttachments:G,maxFileSize:q,disabled:l,readOnly:g,expandOn:A,isValueControlled:R,isOpenControlled:X,isAttachmentsControlled:Z,onValueChange:c,onOpenChange:S,onAttachmentsChange:_,onAttachmentReject:Ee,onSubmit:k},x=e.useRef(Ye);x.current=Ye;let ze=e.useRef(null),W=e.useCallback(()=>ze.current??x.current.attachments,[]),ee=e.useCallback(a=>{x.current.isOpenControlled||ie(a),x.current.onOpenChange?.(a)},[]),xe=e.useCallback(a=>{x.current.isValueControlled||se(a),x.current.onValueChange?.(a)},[]),te=e.useCallback(a=>{ze.current=a,queueMicrotask(()=>{ze.current=null}),x.current.isAttachmentsControlled||vt(a),x.current.onAttachmentsChange?.(a)},[]),Pe=e.useRef(new Set),ae=e.useCallback((a,o,u=x.current.multiple)=>{let m=x.current;if(m.disabled||m.readOnly||a.length===0)return 0;let $=W(),J=[],ne=[],Mt=typeof m.maxAttachments=="number"?Math.max(m.maxAttachments-$.length,0):1/0,Nt=u?1/0:1;for(let T of a){if(J.length>=Mt||J.length>=Nt){ne.push({file:T,reason:"count"});continue}if(typeof m.maxFileSize=="number"&&T.size>m.maxFileSize){ne.push({file:T,reason:"size"});continue}if(!Dt(T,o)){ne.push({file:T,reason:"type"});continue}let De=lt(T.name,T.type)?URL.createObjectURL(T):void 0;De&&Pe.current.add(De),J.push({id:Vt(),name:T.name,size:T.size,type:T.type,file:T,url:De,status:"idle"})}let Se=[];return J.length>0&&(te($.concat(J)),m.expandOn!=="none"&&ee(!0),Se.push(`${st(J.length,"file")} attached.`)),ne.length>0&&(m.onAttachmentReject?.(ne),Se.push(`${st(ne.length,"file")} could not be attached.`)),Se.length>0&&le(Se.join(" ")),J.length},[W,te,ee,le]),Ae=e.useCallback(a=>ae(a,x.current.accepts),[ae]),Xe=e.useCallback(a=>ae(a,x.current.pasteAccepts),[ae]),Je=e.useCallback(a=>{let o=W(),u=o.find(m=>m.id===a);u&&(te(o.filter(m=>m.id!==a)),le(`Removed ${u.name}.`))},[W,te,le]),Qe=e.useCallback(a=>{let o=x.current;if(o.disabled||o.readOnly)return!1;let u=W();if(!We(o.value)&&u.length===0)return!1;let m={value:o.value,attachments:u};if(a&&o.onSubmit)for(let $ of u)$.url&&Pe.current.delete($.url);return o.onSubmit?.(m),a&&(xe(""),te([])),!0},[W,xe,te]);e.useEffect(()=>{let a=Pe.current;if(a.size===0)return;let o=new Set(ce.map(u=>u.url));for(let u of Array.from(a))o.has(u)||(URL.revokeObjectURL(u),a.delete(u))},[ce]),e.useEffect(()=>{let a=Pe.current;return()=>{if(!x.current.isAttachmentsControlled){for(let o of Array.from(a))URL.revokeObjectURL(o);a.clear()}}},[]);let we=e.useCallback(a=>{let o=x.current,u=Ne.current;if(clearTimeout(ye.current),ve.current=!1,!u||o.disabled||o.readOnly)return;let m=a?.accept!=null?pe(a.accept):o.accepts,$=a?.multiple??o.multiple;Oe.current={patterns:m,multiple:$},u.accept=m.join(","),u.multiple=$,ue.current=!0,u.click(),setTimeout(()=>{document.hasFocus()&&(ue.current=!1)},1e3)},[]),Ze=e.useCallback(()=>{ve.current=!0,clearTimeout(ye.current),ye.current=setTimeout(()=>{ve.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(ye.current),[]),e.useEffect(()=>{let a=Ne.current,o=()=>{ue.current=!1};return window.addEventListener("focus",o),a?.addEventListener("cancel",o),()=>{window.removeEventListener("focus",o),a?.removeEventListener("cancel",o)}},[]);let At=e.useCallback(a=>{let o=a.currentTarget,u=Array.from(o.files??[]),m=Oe.current;ae(u,m?.patterns??x.current.accepts,m?.multiple),ue.current=!1,Oe.current=null,o.value=""},[ae]),wt=e.useCallback(a=>{Re?.(a);let o=x.current,u=Ge.current;if(!u||o.expandOn==="none")return;let m=a.relatedTarget;m&&u.contains(m)||ue.current||ve.current||!We(o.value)&&W().length===0&&ee(!1)},[Re,ee,W]),St=e.useCallback(a=>{Ae(a)},[Ae]),{getRootProps:Et,isDragActive:Tt}=It({onDrop:St,onDragEnter:()=>le(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!oe||l||g}),Ie=oe&&Tt;e.useImperativeHandle(Te,()=>({focusTextarea:()=>Me.current?.focus({preventScroll:!0}),openFilePicker:()=>we()}),[we]);let Lt=e.useCallback(a=>{if(l||a.pointerType==="mouse"&&a.button!==0)return;let o=a.target;o instanceof Element&&o.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(a.preventDefault(),Me.current?.focus({preventScroll:!0}))},[l]),kt=e.useMemo(()=>({open:Q,setOpen:ee,setValue:xe,size:P,expandOn:A,minLines:h,maxLines:B,sendMode:H,disabled:l,readOnly:g,paste:D,clearOnSubmit:Y,multiple:F,textareaRef:Me,attachments:ce,removeAttachment:Je,submit:Qe,appendFiles:Ae,appendFilesFromPaste:Xe,openFilePicker:we,beginFilePickerPress:Ze}),[Q,ee,xe,P,A,h,B,H,l,g,D,Y,F,ce,Je,Qe,Ae,Xe,we,Ze]);return e.createElement(ct.Provider,{value:kt},e.createElement($e.Provider,{value:V},e.createElement(Ft,{features:zt},e.createElement(Ht,{reducedMotion:"user"},e.createElement("div",{...Le,ref:xt,className:L("rt-ChatbarRoot",`rt-r-size-${P}`,r),style:{position:"relative",width:j,maxWidth:re,...d},"data-state":Q?"open":"closed","data-disabled":l?"":void 0,"data-readonly":g?"":void 0,"data-drop-active":Ie?"":void 0,"data-accent-color":M,"data-radius":z,"data-panel-background":t,"data-material":t,onBlurCapture:wt},e.createElement("input",{ref:Ne,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:At}),Ce?e.createElement("div",{className:"rt-ChatbarNotices"},e.createElement(rt.Provider,{value:P},Ce)):null,e.createElement("div",{...oe?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement(he.div,{className:L("rt-ChatbarBox",`rt-variant-${E??"surface"}`),style:{position:"relative"},"data-accent-color":M,"data-radius":z,"data-panel-background":t,"data-material":t,layout:!0,transition:fe},e.createElement(he.div,{className:"rt-ChatbarGrid",layout:"position",transition:fe},f),Ie&&e.createElement("div",{className:"rt-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"rt-ChatbarDropContent"},e.createElement(me,{emphasis:"medium",size:P,weight:"medium"},"Drop files here to attach"))))),ge?e.createElement(me,{as:"div",size:P==="3"?"2":"1",emphasis:"medium",className:"rt-ChatbarContext"},ge):null,e.createElement(Be,{role:"status","aria-live":"polite"},Ie?"Drop files here to attach.":e.createElement("span",{key:_e.id},_e.text)))))))});ut.displayName="Chatbar.Root";var dt=e.forwardRef((n,s)=>{let{className:r,style:d,asChild:f,onFocus:i,onChange:b,onPaste:c,onKeyDown:C,onCompositionStart:p,onCompositionEnd:S,submitOnEnter:A=!1,...h}=n,B=K(),H=e.useContext($e),{open:l,minLines:g,maxLines:k,expandOn:P,disabled:E,readOnly:M,setOpen:z,setValue:v,textareaRef:N,paste:j,appendFilesFromPaste:re,size:y,submit:I,clearOnSubmit:_}=B,be=it(s,N),F=e.useRef(0),G=e.useRef(0),q=e.useRef(!1),D=e.useRef({open:l,minLines:g,maxLines:k});Ve(()=>{D.current={open:l,minLines:g,maxLines:k}},[l,g,k]);let O=e.useCallback(()=>{let t=N.current;if(!t)return;let R=window.getComputedStyle(t);F.current=parseFloat(R.lineHeight)||20,G.current=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0)},[N]),Y=e.useCallback((t,R)=>{let{minLines:w,maxLines:se}=D.current,V=F.current,X=G.current,ke=Math.ceil((R?w:1)*V)+X,ie=Math.ceil((R?se:1)*V)+X,Q=Math.max(t.scrollHeight,ke);t.style.height=`${Math.min(Q,ie)}px`;let Z=Q>ie;t.style.overflowY=Z?"auto":"hidden",t.style.maxHeight=Z?`${ie}px`:"none"},[]);Ve(()=>{O()},[O,y]),Ve(()=>{let t=N.current;t&&(F.current===0&&O(),ot(t,()=>{t.style.height="auto";let R=l;if(!l&&(P==="overflow"||P==="both")){let w=Math.ceil(F.current)+G.current;t.scrollHeight>w+1&&(R=!0,z(!0))}Y(t,R)}))},[H,l,P,g,k,y,z,N,O,Y]),e.useEffect(()=>{let t=N.current;if(!t||typeof ResizeObserver>"u")return;let R=-1,w=new ResizeObserver(se=>{let V=se[0]?.contentRect.width??0;if(V===R)return;let X=R===-1;R=V,!X&&(O(),ot(t,()=>{t.style.height="auto",Y(t,D.current.open)}))});return w.observe(t),()=>w.disconnect()},[N,O,Y]),e.useEffect(()=>{},[]);let Ee=e.useCallback(t=>{i?.(t),!(E||M)&&(P==="focus"||P==="both")&&!l&&z(!0)},[E,M,P,l,z,i]),oe=e.useCallback(t=>{v(t.currentTarget.value),b?.(t)},[v,b]),Te=e.useCallback(t=>{if(c?.(t),t.defaultPrevented||!j||E||M)return;let R=Array.from(t.clipboardData?.items??[]).filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(w=>!!w);R.length!==0&&re(R)>0&&t.preventDefault()},[j,E,M,c,re]),Re=e.useCallback(t=>{q.current=!0,p?.(t)},[p]),Ce=e.useCallback(t=>{q.current=!1,S?.(t)},[S]),ge=e.useCallback(t=>{C?.(t),!(t.defaultPrevented||!A)&&(t.key!=="Enter"||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey||q.current||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||(t.preventDefault(),I(_)))},[A,C,I,_]),Le=f?U:"textarea";return e.createElement(he.div,{className:L("rt-ChatbarField","rt-ChatbarTextarea",r),layout:"position",transition:fe},e.createElement(Le,{...h,ref:be,className:"rt-ChatbarInput",value:H,onChange:oe,onFocus:Ee,onPaste:Te,onKeyDown:ge,onCompositionStart:Re,onCompositionEnd:Ce,disabled:E,readOnly:M,rows:l?g:1,spellCheck:h.spellCheck??!0,autoCorrect:h.autoCorrect??"on",style:d}))});dt.displayName="Chatbar.Textarea";var mt=e.forwardRef((n,s)=>{let{children:r,asChild:d,className:f,...i}=n;return K().open?null:e.createElement(d?U:"div",{...i,ref:s,className:L("rt-ChatbarInlineStart",f)},r)});mt.displayName="Chatbar.InlineStart";var pt=e.forwardRef((n,s)=>{let{children:r,asChild:d,className:f,...i}=n;return K().open?null:e.createElement(d?U:"div",{...i,ref:s,className:L("rt-ChatbarInlineEnd",f)},r)});pt.displayName="Chatbar.InlineEnd";var ht=e.forwardRef((n,s)=>{let{asChild:r,forceMount:d,renderAttachment:f,className:i,...b}=n,c=K();if(c.attachments.length===0&&!d)return null;let C=r?U:"div";return e.createElement(he.div,{layout:"position",transition:fe},e.createElement(C,{...b,ref:s,className:L("rt-ChatbarAttachmentsRow",i),role:"list","aria-label":b["aria-label"]??"Attachments"},e.createElement(nt,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},e.createElement(de,{align:"center",gap:"2",minWidth:"fit-content"},c.attachments.map(p=>e.createElement(Ue,{key:p.id,attachment:p,asChild:!!f},f?.(p)))))))});ht.displayName="Chatbar.AttachmentsRow";var Wt={uploading:"uploading",error:"failed to upload"},Ue=e.forwardRef((n,s)=>{let{attachment:r,asChild:d,className:f,children:i,...b}=n,c=K(),C=d?U:"div",p=!!r.url&<(r.name,r.type),S=`${Math.ceil(r.size/1024)} KB`,A=r.status?Wt[r.status]:void 0,h=c.disabled||c.readOnly,B=H=>{let l=H.currentTarget.closest('[role="listitem"]'),g=l?.parentElement?Array.from(l.parentElement.children):[],k=l?g.indexOf(l):-1,E=(g[k+1]??g[k-1])?.querySelector(".rt-ChatbarAttachmentRemove");E?E.focus():c.textareaRef.current?.focus({preventScroll:!0}),c.removeAttachment(r.id)};return e.createElement(C,{...b,ref:s,className:L("rt-ChatbarAttachment",f),role:"listitem","data-kind":p?"image":"file","data-status":r.status,title:r.name},i??e.createElement(de,{align:"center",gap:"2",pr:p?void 0:"6"},e.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},p?e.createElement("img",{className:"rt-ChatbarAttachmentImage",src:r.url,alt:""}):e.createElement(at,null)),p?e.createElement(Be,null,r.name,", ",S,A?`, ${A}`:""):e.createElement(de,{direction:"column",gap:"0",minWidth:"0"},e.createElement(me,{size:c.size,weight:"medium",truncate:!0},r.name),e.createElement(me,{size:"1",color:r.status==="error"?"red":void 0,emphasis:r.status==="error"?void 0:"medium"},S,A?` \xB7 ${A}`:"")),!h&&e.createElement(je,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${r.name}`,size:"1",variant:"classic",color:"gray",onClick:B},e.createElement(tt,null))))});Ue.displayName="Chatbar.Attachment";var ft=e.forwardRef((n,s)=>{let{asChild:r,accept:d,multiple:f,disabled:i,onPointerDown:b,onClick:c,...C}=n,p=K(),S=i||p.disabled||p.readOnly;return e.createElement(r?U:"button",{...C,ref:s,className:L("rt-ChatbarAttachTrigger",C.className),type:C.type??"button","aria-label":C["aria-label"]??"Add attachments",disabled:S,onPointerDown:h=>{b?.(h),!S&&!h.defaultPrevented&&p.beginFilePickerPress()},onClick:h=>{c?.(h),!(S||h.defaultPrevented)&&p.openFilePicker({accept:d,multiple:f})}})});ft.displayName="Chatbar.AttachTrigger";var bt=e.forwardRef((n,s)=>{let{asChild:r,children:d,className:f,...i}=n;if(!K().open)return null;let c=r?U:"div";return e.createElement(he.div,{layout:"position",transition:fe},e.createElement(c,{...i,ref:s,className:L("rt-ChatbarRow",f)},e.createElement(de,{align:"center",justify:"between",width:"100%"},d)))});bt.displayName="Chatbar.Row";var Rt=e.forwardRef((n,s)=>{let{className:r,...d}=n;return e.createElement("div",{...d,ref:s,className:L("rt-ChatbarRowStart",r)})});Rt.displayName="Chatbar.RowStart";var Ct=e.forwardRef((n,s)=>{let{className:r,...d}=n;return e.createElement("div",{...d,ref:s,className:L("rt-ChatbarRowEnd",r)})});Ct.displayName="Chatbar.RowEnd";var gt=e.forwardRef((n,s)=>{let{asChild:r,clearOnSend:d,disabled:f,children:i,style:b,className:c,size:C,variant:p,tabIndex:S,onClick:A,status:h="ready",onStop:B,onRetry:H,stopLabel:l="Stop",retryLabel:g="Retry",stopIcon:k,retryIcon:P,"aria-label":E,"aria-labelledby":M,...z}=n,v=K(),N=e.useContext($e),j=We(N)||v.attachments.length>0,y=j?"send":h==="submitted"||h==="streaming"?"stop":h==="error"?"retry":"send";if(v.sendMode==="never"&&y==="send")return null;let I=y!=="send"||v.sendMode==="always"||j,_=y==="send"?f||v.disabled||v.readOnly||!j:f||v.disabled,F=y==="stop"?{"aria-label":l}:y==="retry"?{"aria-label":g}:M?{"aria-labelledby":M}:{"aria-label":E??"Send"},G=D=>{if(A?.(D),D.defaultPrevented||_)return;if(y==="stop"){B?.();return}if(y==="retry"){H?.();return}let O=d??v.clearOnSubmit;v.submit(O)&&O&&v.textareaRef.current?.focus({preventScroll:!0})},q=y==="stop"?k??(h==="submitted"?e.createElement(et,{size:v.size}):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):y==="retry"?P??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):i??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(je,{...z,ref:s,size:C??v.size,variant:p??(v.open||y!=="send"?"solid":"ghost"),disabled:_,className:L("rt-ChatbarSend",c),style:{opacity:I?1:0,pointerEvents:I?void 0:"none",...b},"aria-hidden":I?void 0:!0,tabIndex:I?S:-1,asChild:r,onClick:G,"data-status":h,"data-mode":y,...F},q)});gt.displayName="Chatbar.Send";export{ut as a,dt as b,mt as c,pt as d,ht as e,Ue as f,ft as g,bt as h,Rt as i,Ct as j,gt as k,$t as l};
|
|
2
|
+
//# sourceMappingURL=chunk-QK5RBHKV.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as s}from"./chunk-KRJTW535.js";import{a as e}from"./chunk-NZJGC6ZW.js";var o=["1","2","3"],r=["vertical","horizontal","both"],l={...e,size:{type:"enum",className:"rt-r-size",values:o,default:"1",responsive:!0},...s,scrollbars:{type:"enum",values:r,default:"both"},fade:{type:"boolean",default:!1}};export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XPRPYCII.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/scroll-area.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n};\n\nexport { scrollAreaPropDefs };\n"],
|
|
5
|
-
"mappings": "gFAKA,IAAMA,EAAQ,CAAC,IAAK,IAAK,GAAG,EACtBC,EAAmB,CAAC,WAAY,aAAc,MAAM,EAEpDC,EAAqB,CACzB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQH,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,GAAGI,EACH,WAAY,CAAE,KAAM,OAAQ,OAAQH,EAAkB,QAAS,MAAO,
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3'] as const;\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n"],
|
|
5
|
+
"mappings": "gFAKA,IAAMA,EAAQ,CAAC,IAAK,IAAK,GAAG,EACtBC,EAAmB,CAAC,WAAY,aAAc,MAAM,EAEpDC,EAAqB,CACzB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQH,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,GAAGI,EACH,WAAY,CAAE,KAAM,OAAQ,OAAQH,EAAkB,QAAS,MAAO,EAOtE,KAAM,CAAE,KAAM,UAAW,QAAS,EAAM,CAC1C",
|
|
6
6
|
"names": ["sizes", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"../chunk-QK5RBHKV.js";import"../chunk-RJP5QUXO.js";import"../chunk-4XGGX2V2.js";import"../chunk-COWZAUZR.js";import"../chunk-5GXFBLBJ.js";import"../chunk-UBOOUDS4.js";import"../chunk-XPRPYCII.js";import"../chunk-5BWLY27A.js";import"../chunk-IX5HIHVI.js";import"../chunk-73QGEY2I.js";import"../chunk-2N2AQNJH.js";import"../chunk-PS6NEG5A.js";import"../chunk-OLAWVEAI.js";import"../chunk-BPVVFHYD.js";import"../chunk-5WRCK4R7.js";import"../chunk-4XKK32M4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-ZWZGUBL4.js";import"../chunk-SEY4NA45.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-XYVLQDGR.js";import"../chunk-ZZLZGHZQ.js";import"../chunk-HF5WY5YE.js";import"../chunk-3KB2XWBE.js";import"../chunk-FHOCUZDR.js";import"../chunk-SMGDH54W.js";import"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import"../chunk-SNR5VFWG.js";import"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-JFWMAYEH.js";import"../chunk-KRJTW535.js";import"../chunk-GSTOGDAJ.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-ZNK6AH2G.js";import"../chunk-OS3FCYZY.js";export{g as AttachTrigger,f as Attachment,e as AttachmentsRow,d as InlineEnd,c as InlineStart,a as Root,h as Row,j as RowEnd,i as RowStart,k as Send,b as Textarea};
|
|
2
2
|
//# sourceMappingURL=chatbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"../chunk-
|
|
1
|
+
"use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"../chunk-PQKJNRMR.js";import"../chunk-OA7C34MJ.js";import"../chunk-COWZAUZR.js";import"../chunk-5GXFBLBJ.js";import"../chunk-UBOOUDS4.js";import"../chunk-XPRPYCII.js";import"../chunk-5BWLY27A.js";import"../chunk-IX5HIHVI.js";import"../chunk-PS6NEG5A.js";import"../chunk-MJJ7XDIP.js";import"../chunk-7RQNB63F.js";import"../chunk-SEY4NA45.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-XYVLQDGR.js";import"../chunk-5TXQLK4G.js";import"../chunk-KRJTW535.js";import"../chunk-3KSGRY6I.js";import"../chunk-ZOY43B55.js";import"../chunk-E67CIG6A.js";import"../chunk-ARIV4AT5.js";import"../chunk-3XSB7YIM.js";import"../chunk-YA5DF67M.js";import"../chunk-GSTOGDAJ.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-ZNK6AH2G.js";import"../chunk-OS3FCYZY.js";export{i as CheckboxItem,c as Content,f as Group,e as Item,d as Label,g as RadioGroup,h as RadioItem,a as Root,m as Separator,j as Sub,l as SubContent,k as SubTrigger,b as Trigger};
|
|
2
2
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-
|
|
1
|
+
"use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-MZXHKM4V.js";import"../chunk-WOR3JCLX.js";import"../chunk-COWZAUZR.js";import"../chunk-5GXFBLBJ.js";import"../chunk-UBOOUDS4.js";import"../chunk-XPRPYCII.js";import"../chunk-5BWLY27A.js";import"../chunk-IX5HIHVI.js";import"../chunk-PS6NEG5A.js";import"../chunk-MJJ7XDIP.js";import"../chunk-7RQNB63F.js";import"../chunk-SEY4NA45.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-XYVLQDGR.js";import"../chunk-5TXQLK4G.js";import"../chunk-KRJTW535.js";import"../chunk-3KSGRY6I.js";import"../chunk-ZOY43B55.js";import"../chunk-E67CIG6A.js";import"../chunk-ARIV4AT5.js";import"../chunk-3XSB7YIM.js";import"../chunk-YA5DF67M.js";import"../chunk-GSTOGDAJ.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-ZNK6AH2G.js";import"../chunk-JSW6J6RS.js";import"../chunk-OS3FCYZY.js";export{i as CheckboxItem,c as Content,f as Group,e as Item,d as Label,g as RadioGroup,h as RadioItem,a as Root,l as Separator,j as Sub,m as SubContent,k as SubTrigger,b as Trigger,n as TriggerIcon};
|
|
2
2
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-JKS2YXMS.js";import{f as ua}from"../chunk-47LMOIW3.js";import{a as va}from"../chunk-ERY5TH2M.js";import"../chunk-4WVNMGI5.js";import{a as wa}from"../chunk-YWENWZOU.js";import{c as pa}from"../chunk-ALWNS44Q.js";import{a as qa,b as ra}from"../chunk-
|
|
1
|
+
import"../chunk-JKS2YXMS.js";import{f as ua}from"../chunk-47LMOIW3.js";import{a as va}from"../chunk-ERY5TH2M.js";import"../chunk-4WVNMGI5.js";import{a as wa}from"../chunk-YWENWZOU.js";import{c as pa}from"../chunk-ALWNS44Q.js";import{a as qa,b as ra}from"../chunk-25LBWKEV.js";import{a as sa}from"../chunk-X3JM2565.js";import{a as ta}from"../chunk-65GAANJD.js";import"../chunk-VK7RNXUO.js";import"../chunk-EE54S7YV.js";import{c as la}from"../chunk-K3UAS7RW.js";import{h as ma}from"../chunk-36A5BYCN.js";import"../chunk-BALS3AVM.js";import{e as na}from"../chunk-VNH7BJOA.js";import"../chunk-TZTUPQYK.js";import{a as oa}from"../chunk-EPTYNVCU.js";import"../chunk-CLMOWP5T.js";import"../chunk-MN3XALXD.js";import{a as ja}from"../chunk-43A5GUSI.js";import"../chunk-XI5YXUCK.js";import{a as ka}from"../chunk-KJUDZCYK.js";import"../chunk-AF6XKU3W.js";import"../chunk-AUV6B4AH.js";import{h as ya}from"../chunk-PYHEBG5I.js";import{p as xa}from"../chunk-53SZ4Y23.js";import"../chunk-2CMM7MEL.js";import{a as ia}from"../chunk-VZSQATP6.js";import"../chunk-OJU5GCDZ.js";import{c as ea}from"../chunk-FG7XM7KJ.js";import{h as ga}from"../chunk-VHECAEUP.js";import"../chunk-EBQZ3Z22.js";import{a as ha}from"../chunk-VR7ZAFYN.js";import"../chunk-CRSHBENJ.js";import{g as za}from"../chunk-QWVU2TW4.js";import"../chunk-ADXZNG4F.js";import"../chunk-2EQWBT2S.js";import{a as fa}from"../chunk-OGXZHAQL.js";import"../chunk-NIX6Z3JG.js";import"../chunk-FC2DBBJ3.js";import{c as ba}from"../chunk-2I7QRVJ5.js";import{a as ca}from"../chunk-CIYF56YS.js";import"../chunk-STPMPY3X.js";import{a as da}from"../chunk-FHEHX7CE.js";import{a as Z}from"../chunk-XEZXKPLE.js";import{a as _}from"../chunk-CDG5WH4U.js";import"../chunk-5XV4QEP5.js";import{a as $}from"../chunk-GLERJXVS.js";import"../chunk-MCQCG6AS.js";import{c as aa}from"../chunk-CRTH5LNU.js";import"../chunk-OWMA6GTG.js";import"../chunk-VLTXI4A7.js";import{a as X}from"../chunk-YBSRX63K.js";import"../chunk-AGSSWWFI.js";import{i as Aa}from"../chunk-4D2OAD6I.js";import{e as Y}from"../chunk-7UHKEJ7Q.js";import"../chunk-Y3A6ZU24.js";import{a as V}from"../chunk-IHK3H2OM.js";import{a as U}from"../chunk-S5C5YRBS.js";import"../chunk-IBF5U4QW.js";import"../chunk-L6UXAITB.js";import"../chunk-GFOSP3PZ.js";import{a as W}from"../chunk-CSKZZOI2.js";import"../chunk-JAMLW534.js";import{d as T}from"../chunk-MEO7MJMQ.js";import"../chunk-VJSZG35J.js";import{g as Q}from"../chunk-DSJY5RI3.js";import"../chunk-MHANZINI.js";import{o as R}from"../chunk-MZXHKM4V.js";import"../chunk-WOR3JCLX.js";import{a as S}from"../chunk-7FC7HF76.js";import"../chunk-4JQZUQY7.js";import{l as M}from"../chunk-T4OR62DQ.js";import{g as L}from"../chunk-WHFJ4JUN.js";import"../chunk-72AHPGPN.js";import"../chunk-RDAMYQFF.js";import{a as N}from"../chunk-4ME6O27S.js";import"../chunk-PPNWGWN3.js";import{n as O}from"../chunk-PQKJNRMR.js";import"../chunk-OA7C34MJ.js";import{e as P}from"../chunk-RNTCHVFI.js";import"../chunk-NIIEIZKQ.js";import{c as H}from"../chunk-BW5CO4PZ.js";import{a as G}from"../chunk-VX6ARMWP.js";import{c as I}from"../chunk-OMGZG52I.js";import"../chunk-V32EP3S7.js";import"../chunk-5SNHUVDA.js";import{a as J}from"../chunk-KFR3CK24.js";import"../chunk-UICSVJ3B.js";import{a as K}from"../chunk-N4GTDLRD.js";import"../chunk-KZWNGWIM.js";import{d as v}from"../chunk-CKMMUHKE.js";import"../chunk-OGVKSYLL.js";import{a as w}from"../chunk-JDGJSNWT.js";import"../chunk-OO652UQW.js";import{l as F}from"../chunk-QK5RBHKV.js";import{b as D,c as E}from"../chunk-RJP5QUXO.js";import{a as x}from"../chunk-4XGGX2V2.js";import{a as C}from"../chunk-COWZAUZR.js";import"../chunk-5GXFBLBJ.js";import"../chunk-UBOOUDS4.js";import"../chunk-XPRPYCII.js";import"../chunk-5BWLY27A.js";import{a as y,b as z,c as A,d as B}from"../chunk-IX5HIHVI.js";import{a as u}from"../chunk-73QGEY2I.js";import"../chunk-2N2AQNJH.js";import"../chunk-667BKCUG.js";import"../chunk-HAGKI7NA.js";import{a as p}from"../chunk-HJU4I34X.js";import"../chunk-PS6NEG5A.js";import"../chunk-QFPHEY77.js";import{a as r}from"../chunk-KMPE7TJ6.js";import{a as q}from"../chunk-OLAWVEAI.js";import"../chunk-BPVVFHYD.js";import"../chunk-QQ62LO3X.js";import{a as s}from"../chunk-MS5J4MF6.js";import{a as t}from"../chunk-4YFJWXL2.js";import"../chunk-FGORMEAO.js";import"../chunk-ROSWI2CL.js";import{a as j}from"../chunk-ERNM3KVF.js";import{f as k}from"../chunk-Y5RCH23Z.js";import"../chunk-EDKQURDU.js";import{h as n}from"../chunk-LXWPEDPZ.js";import{a as l}from"../chunk-GO7OHBHW.js";import"../chunk-PZ7OYATT.js";import"../chunk-MJJ7XDIP.js";import{a as m}from"../chunk-5WRCK4R7.js";import"../chunk-4XKK32M4.js";import"../chunk-G2CKYO2I.js";import"../chunk-AXUDFYLY.js";import"../chunk-KNQBAOMV.js";import"../chunk-FD2TR343.js";import"../chunk-WYADYDPN.js";import"../chunk-ZE2KAVXW.js";import"../chunk-ZWZGUBL4.js";import"../chunk-XKBLNVOD.js";import"../chunk-GCUGJXI2.js";import{a as o}from"../chunk-Y7LT3F6R.js";import"../chunk-7RQNB63F.js";import{a as g,b as h,c as i}from"../chunk-SEY4NA45.js";import"../chunk-WAURCNAS.js";import"../chunk-F22ZRNWL.js";import"../chunk-XYVLQDGR.js";import"../chunk-YAQBIO2B.js";import"../chunk-AGNIFHOE.js";import"../chunk-HCNO7PX6.js";import"../chunk-GMHA5CFH.js";import"../chunk-A2XVR7GL.js";import"../chunk-BZZXXZ3O.js";import"../chunk-2LYX5S7H.js";import"../chunk-HWQ3NTJP.js";import"../chunk-3J6AUDID.js";import"../chunk-ZZLZGHZQ.js";import{a as d}from"../chunk-HF5WY5YE.js";import"../chunk-3KB2XWBE.js";import{a as c}from"../chunk-FHOCUZDR.js";import"../chunk-SMGDH54W.js";import{a as e}from"../chunk-AGAQC4HH.js";import"../chunk-5T6K7VPP.js";import"../chunk-SNR5VFWG.js";import{b as a,c as b}from"../chunk-FWB47YCH.js";import"../chunk-K53W3ELO.js";import"../chunk-TTFUM47A.js";import"../chunk-VX44UTQ5.js";import"../chunk-ERGJN7FJ.js";import"../chunk-5TXQLK4G.js";import"../chunk-JFWMAYEH.js";import"../chunk-KRJTW535.js";import"../chunk-F6V7GBNQ.js";import"../chunk-3KSGRY6I.js";import"../chunk-ZOY43B55.js";import{a as f}from"../chunk-E67CIG6A.js";import"../chunk-ARIV4AT5.js";import"../chunk-3XSB7YIM.js";import"../chunk-YA5DF67M.js";import"../chunk-GSTOGDAJ.js";import"../chunk-6FLLFCBU.js";import"../chunk-AX5S56DS.js";import"../chunk-E23RKOQJ.js";import"../chunk-JUY7CBSL.js";import"../chunk-WRWNN2NW.js";import"../chunk-QM3RCK5P.js";import"../chunk-RZCX6IBE.js";import"../chunk-NZJGC6ZW.js";import"../chunk-WMGIFPI2.js";import"../chunk-CFNESRYI.js";import"../chunk-ZNK6AH2G.js";import"../chunk-JSW6J6RS.js";import"../chunk-OS3FCYZY.js";export{j as AccessibleIcon,k as Accordion,n as AlertDialog,o as AspectRatio,p as Avatar,r as Badge,s as Blockquote,t as Box,u as Button,v as Callout,w as Card,F as Chatbar,J as Checkbox,H as CheckboxCards,I as CheckboxGroup,A as ChevronDownIcon,K as Code,M as Combobox,E as Confirmation,N as Container,O as ContextMenu,P as DataList,Q as Dialog,R as DropdownMenu,S as Em,c as Flex,G as Grid,l as Heading,T as HoverCard,x as IconButton,V as Image,W as Inset,f as Kbd,X as Link,Aa as MessageScroller,Y as Navbar,D as Notice,L as Popover,Z as Portal,_ as Progress,$ as Quote,ca as Radio,aa as RadioCards,ba as RadioGroup,da as Reset,C as ScrollArea,fa as Section,ea as SegmentedControl,ga as Select,ha as Separator,za as Sheet,ya as Shell,xa as Sidebar,U as Skeleton,ia as Slider,a as Slot,b as Slottable,d as Spinner,ja as Strong,ka as Switch,la as TabNav,ma as Table,na as Tabs,m as Text,oa as TextArea,pa as TextField,i as Theme,g as ThemeContext,qa as ThemePanel,ra as ThemePanelContent,z as ThickCheckIcon,B as ThickChevronRightIcon,y as ThickDividerHorizontalIcon,sa as ToggleButton,ta as ToggleIconButton,ua as Toolbar,q as Tooltip,va as UserCard,wa as VirtualMenu,e as VisuallyHidden,h as useThemeContext};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|