@womp/kookie-ui 0.9.1 → 0.11.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 +145 -26
- package/dist/cjs/components/app-bar.d.ts +49 -0
- package/dist/cjs/components/app-bar.d.ts.map +1 -0
- package/dist/cjs/components/app-bar.js +2 -0
- package/dist/cjs/components/app-bar.js.map +7 -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.d.ts +2 -1
- package/dist/cjs/components/index.d.ts.map +1 -1
- 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/components/toolbar.d.ts +88 -36
- package/dist/cjs/components/toolbar.d.ts.map +1 -1
- package/dist/cjs/components/toolbar.js +4 -1
- package/dist/cjs/components/toolbar.js.map +4 -4
- package/dist/cjs/components/toolbar.props.d.ts +28 -0
- package/dist/cjs/components/toolbar.props.d.ts.map +1 -0
- package/dist/cjs/components/toolbar.props.js +2 -0
- package/dist/cjs/components/toolbar.props.js.map +7 -0
- 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-ABSKRHVM.js → chunk-36A5BYCN.js} +2 -2
- package/dist/esm/{chunk-73QGEY2I.js → chunk-3R4YLW4A.js} +2 -2
- package/dist/esm/{chunk-ZZLZGHZQ.js → chunk-4LDVSTXI.js} +2 -2
- package/dist/esm/{chunk-YQRSAP46.js → chunk-53SZ4Y23.js} +2 -2
- package/dist/esm/chunk-54JFIP5S.js +2 -0
- package/dist/esm/chunk-54JFIP5S.js.map +7 -0
- package/dist/esm/chunk-5BWLY27A.js +2 -0
- package/dist/esm/chunk-5BWLY27A.js.map +7 -0
- package/dist/esm/{chunk-X3JM2565.js → chunk-6G3MPL4A.js} +2 -2
- package/dist/esm/{chunk-DSJY5RI3.js → chunk-7JJT42J2.js} +2 -2
- package/dist/esm/chunk-C7EVYSWK.js +1 -0
- package/dist/esm/chunk-COWZAUZR.js +2 -0
- package/dist/esm/chunk-COWZAUZR.js.map +7 -0
- package/dist/esm/{chunk-ERY5TH2M.js → chunk-CYU6BLZ5.js} +2 -2
- package/dist/esm/{chunk-MWIIGYAJ.js → chunk-D6PHTHF2.js} +2 -2
- package/dist/esm/{chunk-YTD3AJAU.js → chunk-ENLFKWYV.js} +2 -2
- package/dist/esm/{chunk-4XGGX2V2.js → chunk-ISOLUTZF.js} +2 -2
- package/dist/esm/{chunk-LXWPEDPZ.js → chunk-IYCPYN4Z.js} +2 -2
- package/dist/esm/{chunk-RJP5QUXO.js → chunk-L5PID6BU.js} +2 -2
- package/dist/esm/{chunk-BW5CO4PZ.js → chunk-METRW4HG.js} +2 -2
- package/dist/esm/{chunk-PYHEBG5I.js → chunk-MJOXEUBT.js} +2 -2
- package/dist/esm/{chunk-PHC3QBV3.js → chunk-MZXHKM4V.js} +2 -2
- package/dist/esm/chunk-OIUCV5HK.js +2 -0
- package/dist/esm/chunk-OIUCV5HK.js.map +7 -0
- package/dist/esm/{chunk-NIM7DIVH.js → chunk-PQKJNRMR.js} +2 -2
- package/dist/esm/{chunk-65GAANJD.js → chunk-UYCPDGWA.js} +2 -2
- package/dist/esm/chunk-XLMTTSRO.js +2 -0
- package/dist/esm/chunk-XLMTTSRO.js.map +7 -0
- package/dist/esm/chunk-XPRPYCII.js +2 -0
- package/dist/esm/{chunk-5KICSAT7.js.map → chunk-XPRPYCII.js.map} +2 -2
- package/dist/esm/{chunk-QWVU2TW4.js → chunk-ZK7A2MZZ.js} +2 -2
- package/dist/esm/chunk-ZUOK3KFY.js +2 -0
- package/dist/esm/chunk-ZUOK3KFY.js.map +7 -0
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/app-bar.d.ts +49 -0
- package/dist/esm/components/app-bar.d.ts.map +1 -0
- package/dist/esm/components/app-bar.js +2 -0
- package/dist/esm/components/app-bar.js.map +7 -0
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-cards.js +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/icon-button.js +1 -1
- package/dist/esm/components/index.d.ts +2 -1
- package/dist/esm/components/index.d.ts.map +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/notice.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/sheet.js +1 -1
- package/dist/esm/components/shell.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/components/toggle-button.js +1 -1
- package/dist/esm/components/toggle-icon-button.js +1 -1
- package/dist/esm/components/toolbar.d.ts +88 -36
- package/dist/esm/components/toolbar.d.ts.map +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/toolbar.props.d.ts +28 -0
- package/dist/esm/components/toolbar.props.d.ts.map +1 -0
- package/dist/esm/components/toolbar.props.js +2 -0
- package/dist/esm/components/toolbar.props.js.map +7 -0
- package/dist/esm/components/user-card.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 +1 -1
- package/src/components/app-bar.css +204 -0
- package/src/components/app-bar.tsx +256 -0
- package/src/components/index.css +2 -0
- package/src/components/index.tsx +13 -1
- 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/components/toolbar.css +87 -160
- package/src/components/toolbar.props.tsx +27 -0
- package/src/components/toolbar.tsx +259 -193
- package/src/hooks/use-scroll-edges.ts +46 -0
- package/src/styles/tokens/color.css +19 -0
- package/styles.css +159 -26
- package/tokens/base.css +14 -0
- package/tokens.css +14 -0
- package/dist/esm/chunk-47LMOIW3.js +0 -2
- package/dist/esm/chunk-47LMOIW3.js.map +0 -7
- 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-JKS2YXMS.js +0 -1
- package/dist/esm/chunk-W4WWN3RC.js +0 -2
- package/dist/esm/chunk-W4WWN3RC.js.map +0 -7
- /package/dist/esm/{chunk-ABSKRHVM.js.map → chunk-36A5BYCN.js.map} +0 -0
- /package/dist/esm/{chunk-73QGEY2I.js.map → chunk-3R4YLW4A.js.map} +0 -0
- /package/dist/esm/{chunk-ZZLZGHZQ.js.map → chunk-4LDVSTXI.js.map} +0 -0
- /package/dist/esm/{chunk-YQRSAP46.js.map → chunk-53SZ4Y23.js.map} +0 -0
- /package/dist/esm/{chunk-X3JM2565.js.map → chunk-6G3MPL4A.js.map} +0 -0
- /package/dist/esm/{chunk-DSJY5RI3.js.map → chunk-7JJT42J2.js.map} +0 -0
- /package/dist/esm/{chunk-JKS2YXMS.js.map → chunk-C7EVYSWK.js.map} +0 -0
- /package/dist/esm/{chunk-ERY5TH2M.js.map → chunk-CYU6BLZ5.js.map} +0 -0
- /package/dist/esm/{chunk-MWIIGYAJ.js.map → chunk-D6PHTHF2.js.map} +0 -0
- /package/dist/esm/{chunk-YTD3AJAU.js.map → chunk-ENLFKWYV.js.map} +0 -0
- /package/dist/esm/{chunk-4XGGX2V2.js.map → chunk-ISOLUTZF.js.map} +0 -0
- /package/dist/esm/{chunk-LXWPEDPZ.js.map → chunk-IYCPYN4Z.js.map} +0 -0
- /package/dist/esm/{chunk-RJP5QUXO.js.map → chunk-L5PID6BU.js.map} +0 -0
- /package/dist/esm/{chunk-BW5CO4PZ.js.map → chunk-METRW4HG.js.map} +0 -0
- /package/dist/esm/{chunk-PYHEBG5I.js.map → chunk-MJOXEUBT.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-65GAANJD.js.map → chunk-UYCPDGWA.js.map} +0 -0
- /package/dist/esm/{chunk-QWVU2TW4.js.map → chunk-ZK7A2MZZ.js.map} +0 -0
|
@@ -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
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-2N2AQNJH.js";import{a as d}from"./chunk-OLAWVEAI.js";import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-2N2AQNJH.js";import{a as d}from"./chunk-OLAWVEAI.js";import{a as p}from"./chunk-4LDVSTXI.js";import*as r from"react";import h from"classnames";var w=r.forwardRef(({className:b,style:s,tooltip:a,tooltipSide:m="top",tooltipAlign:B="center",tooltipDelayDuration:y,tooltipDisableHoverableContent:g,overrideStyles:e,...v},O)=>{let{tooltipId:R,hasTooltip:S,accessibilityProps:P}=f(a),u=r.useMemo(()=>{if(!e)return;let c={},o=(n,t)=>{t!==void 0&&(c[n]=t)},i=(n,t)=>{t&&(o(`--button-override-${n}color`,t.color),o(`--button-override-${n}background`,t.background),o(`--button-override-${n}background-color`,t.backgroundColor),o(`--button-override-${n}box-shadow`,t.boxShadow),o(`--button-override-${n}filter`,t.filter),o(`--button-override-${n}outline`,t.outline),o(`--button-override-${n}outline-offset`,t.outlineOffset),o(`--button-override-${n}opacity`,t.opacity))};return i("",e.normal),i("hover-",e.hover),i("active-",e.active),i("pressed-",e.pressed),i("open-",e.open),i("disabled-",e.disabled),e.focus&&(o("--button-override-focus-outline",e.focus.outline),o("--button-override-focus-outline-offset",e.focus.outlineOffset)),c},[e]),C=r.useMemo(()=>u?{...u,...s}:s,[u,s]),l=r.createElement(p,{...v,...P,ref:O,className:h("rt-Button",b),style:C});return S?r.createElement(d,{content:a,side:m,align:B,delayDuration:y,disableHoverableContent:g,id:R},l):l});w.displayName="Button";export{w as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3R4YLW4A.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-HF5WY5YE.js";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-HF5WY5YE.js";import{a as B}from"./chunk-AGAQC4HH.js";import{a as b,c as P}from"./chunk-5T6K7VPP.js";import{a as c}from"./chunk-FHOCUZDR.js";import{a as y}from"./chunk-5TXQLK4G.js";import{a as i}from"./chunk-JFWMAYEH.js";import{a as m}from"./chunk-GSTOGDAJ.js";import{a as u}from"./chunk-6FLLFCBU.js";import*as e from"react";import S from"classnames";import{Slot as j}from"radix-ui";var I=e.forwardRef((o,g)=>{let{size:h=i.size.default}=o,{className:R,children:t,asChild:n,as:a,color:x,radius:C,material:k,panelBackground:w,flush:D,disabled:p=o.loading,...d}=u(o,i,m);y(o.panelBackground);let l=k??w,E=n?j.Root:a||"button",T=n||!a||["button","input","textarea","select"].includes(a),v=!n&&(!a||a==="button"),M="type"in d,z=e.useId(),s=o.loading?`${z}-loading`:void 0,r=e.useMemo(()=>typeof t=="string"?t:e.isValidElement(t)&&typeof t.props?.children=="string"?t.props.children:"button",[t]),N=e.useMemo(()=>o.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":s,"aria-label":`${r} (loading)`}:{},[o.loading,s,r]);return e.createElement(E,{"data-disabled":p||void 0,"data-accent-color":x,"data-radius":C,"data-material":l,"data-panel-background":l,"data-flush":D?"true":void 0,...d,...N,ref:g,className:S("rt-reset","rt-BaseButton",R),...T&&{disabled:p},...v&&!M?{type:"button"}:{}},o.loading?e.createElement(e.Fragment,null,e.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},t),e.createElement(B,null,e.createElement("span",{id:s},r," is loading, please wait..."),t),e.createElement(c,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},e.createElement("span",null,e.createElement(f,{size:b(h,P),"aria-hidden":"true"})))):t)});I.displayName="BaseButton";export{I as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4LDVSTXI.js.map
|
|
@@ -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{a as u}from"./chunk-JDGJSNWT.js";import{a as h}from"./chunk-GO7OHBHW.js";import{a as A}from"./chunk-FHOCUZDR.js";import*as e from"react";import f from"classnames";var R=e.forwardRef((o,t)=>{let{anchor:p="top",floating:r=!1,offset:s="2",size:n="1",variant:i="ghost",material:x,className:b,style:y,children:v,...N}=o,B=p==="top"||p==="bottom",d=e.useRef(null),L=e.useCallback(a=>{d.current=a,typeof t=="function"?t(a):t&&(t.current=a)},[t]);e.useEffect(()=>{let a=d.current;if(!a)return;let l=a.parentElement;if(!l)return;let g=()=>{let c=B?a.offsetHeight:a.offsetWidth;if(r){let F=getComputedStyle(a),z=parseFloat(F.marginTop)||0;c+=z*2}B?(l.style.setProperty("--rt-app-bar-height",`${c}px`),l.style.setProperty("--rt-toolbar-height",`${c}px`)):(l.style.setProperty("--rt-app-bar-width",`${c}px`),l.style.setProperty("--rt-toolbar-width",`${c}px`))};g();let P=new ResizeObserver(g);return P.observe(a),()=>P.disconnect()},[B,r]);let H=r?{margin:`var(--space-${s})`,...y}:y;return e.createElement(u,{ref:L,size:n,variant:i,material:x,"data-anchor":p,"data-floating":r||void 0,className:f("rt-AppBar",b),style:H,...N},e.createElement("div",{className:"rt-AppBarInner"},v))});R.displayName="AppBar.Root";var S=e.forwardRef(({gap:o="2",align:t="center",className:p,children:r,...s},n)=>e.createElement(A,{ref:n,align:t,gap:o,className:f("rt-AppBarSection","rt-AppBarLeft",p),...s},r));S.displayName="AppBar.Left";var T=e.forwardRef(({gap:o="2",align:t="center",justify:p="center",className:r,children:s,...n},i)=>e.createElement(A,{ref:i,align:t,justify:p,gap:o,className:f("rt-AppBarSection","rt-AppBarCenter",r),...n},s));T.displayName="AppBar.Center";var C=e.forwardRef(({gap:o="2",align:t="center",justify:p="end",className:r,children:s,...n},i)=>e.createElement(A,{ref:i,align:t,justify:p,gap:o,className:f("rt-AppBarSection","rt-AppBarRight",r),...n},s));C.displayName="AppBar.Right";var E=e.forwardRef(({className:o,size:t="2",weight:p="medium",truncate:r=!0,children:s,...n},i)=>e.createElement(h,{ref:i,size:t,weight:p,truncate:r,className:f("rt-AppBarTitle",o),...n},s));E.displayName="AppBar.Title";var m=R;m.Root=R;m.Left=S;m.Center=T;m.Right=C;m.Title=E;export{R as a,S as b,T as c,C as d,E as e,m as f};
|
|
2
|
+
//# sourceMappingURL=chunk-54JFIP5S.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/app-bar.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Card } from './card.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\n\nimport type { CardProps } from './card.js';\nimport type { FlexProps } from './flex.js';\n\n// ============================================================================\n// AppBar Root\n// ============================================================================\n\ntype AppBarRootElement = React.ElementRef<'div'>;\ntype Anchor = 'top' | 'bottom' | 'left' | 'right';\ntype SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ninterface AppBarRootProps extends Omit<CardProps, 'asChild'> {\n /**\n * Which edge to anchor to. Sets position: sticky and the appropriate edge.\n * @default \"top\"\n */\n anchor?: Anchor;\n /**\n * Floating mode adds margin from edges for a detached look with absolute positioning.\n * When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.\n * @default false\n */\n floating?: boolean;\n /**\n * Margin offset from edges when floating. Uses space scale values.\n * @default \"2\"\n */\n offset?: SpaceScale;\n}\n\n/**\n * An app bar: the band anchored to one edge of a pane, with left, center and right sections\n * and a title. It publishes its height (or width) to its parent as `--rt-app-bar-height`\n * (`--rt-app-bar-width`) so content can pad itself clear of it.\n *\n * This component was called `Toolbar` until 0.11.0. It is not a `role=\"toolbar\"`: for a row of\n * controls with one tab stop and arrow-key navigation, use `Toolbar`.\n */\nconst AppBarRoot = React.forwardRef<AppBarRootElement, AppBarRootProps>(\n (props, forwardedRef) => {\n const {\n anchor = 'top',\n floating = false,\n offset = '2',\n size = '1',\n variant = 'ghost',\n material,\n className,\n style,\n children,\n ...restProps\n } = props;\n\n const isHorizontal = anchor === 'top' || anchor === 'bottom';\n const internalRef = React.useRef<HTMLDivElement>(null);\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Expose height/width as CSS variable on parent element\n React.useEffect(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const parent = element.parentElement;\n if (!parent) return;\n\n const update = () => {\n let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;\n\n // For floating mode, include the margin in the total space\n if (floating) {\n const computedStyle = getComputedStyle(element);\n const margin = parseFloat(computedStyle.marginTop) || 0;\n dimension += margin * 2;\n }\n\n // `--rt-toolbar-*` are the names this bar published while it was called Toolbar.\n // They are still written so existing layouts keep their offset; prefer `--rt-app-bar-*`.\n if (isHorizontal) {\n parent.style.setProperty('--rt-app-bar-height', `${dimension}px`);\n parent.style.setProperty('--rt-toolbar-height', `${dimension}px`);\n } else {\n parent.style.setProperty('--rt-app-bar-width', `${dimension}px`);\n parent.style.setProperty('--rt-toolbar-width', `${dimension}px`);\n }\n };\n\n update();\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [isHorizontal, floating]);\n\n const computedStyle = floating\n ? { margin: `var(--space-${offset})`, ...style }\n : style;\n\n return (\n <Card\n ref={mergedRef}\n size={size}\n variant={variant}\n material={material}\n data-anchor={anchor}\n data-floating={floating || undefined}\n className={classNames('rt-AppBar', className)}\n style={computedStyle}\n {...restProps}\n >\n <div className=\"rt-AppBarInner\">\n {children}\n </div>\n </Card>\n );\n },\n);\nAppBarRoot.displayName = 'AppBar.Root';\n\n// ============================================================================\n// AppBar Left (for horizontal) / Start (alias)\n// ============================================================================\n\ntype AppBarSectionElement = React.ElementRef<'div'>;\ntype AppBarSectionProps = FlexProps;\n\nconst AppBarLeft = React.forwardRef<AppBarSectionElement, AppBarSectionProps>(\n ({ gap = '2', align = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n gap={gap}\n className={classNames('rt-AppBarSection', 'rt-AppBarLeft', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nAppBarLeft.displayName = 'AppBar.Left';\n\n// ============================================================================\n// AppBar Center\n// ============================================================================\n\nconst AppBarCenter = React.forwardRef<AppBarSectionElement, AppBarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-AppBarSection', 'rt-AppBarCenter', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nAppBarCenter.displayName = 'AppBar.Center';\n\n// ============================================================================\n// AppBar Right (for horizontal) / End (alias)\n// ============================================================================\n\nconst AppBarRight = React.forwardRef<AppBarSectionElement, AppBarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'end', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-AppBarSection', 'rt-AppBarRight', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nAppBarRight.displayName = 'AppBar.Right';\n\n// ============================================================================\n// AppBar Title\n// ============================================================================\n\ntype AppBarTitleElement = React.ElementRef<typeof Heading>;\ntype AppBarTitleProps = React.ComponentPropsWithoutRef<typeof Heading>;\n\nconst AppBarTitle = React.forwardRef<AppBarTitleElement, AppBarTitleProps>(\n ({ className, size = '2', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (\n <Heading\n ref={forwardedRef}\n size={size}\n weight={weight}\n truncate={truncate}\n className={classNames('rt-AppBarTitle', className)}\n {...props}\n >\n {children}\n </Heading>\n ),\n);\nAppBarTitle.displayName = 'AppBar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst AppBar = AppBarRoot as typeof AppBarRoot & {\n Root: typeof AppBarRoot;\n Left: typeof AppBarLeft;\n Center: typeof AppBarCenter;\n Right: typeof AppBarRight;\n Title: typeof AppBarTitle;\n};\n\nAppBar.Root = AppBarRoot;\nAppBar.Left = AppBarLeft;\nAppBar.Center = AppBarCenter;\nAppBar.Right = AppBarRight;\nAppBar.Title = AppBarTitle;\n\nexport {\n AppBar,\n AppBarRoot as Root,\n AppBarLeft as Left,\n AppBarCenter as Center,\n AppBarRight as Right,\n AppBarTitle as Title,\n};\nexport type {\n AppBarRootProps as RootProps,\n AppBarSectionProps as LeftProps,\n AppBarSectionProps as CenterProps,\n AppBarSectionProps as RightProps,\n AppBarTitleProps as TitleProps,\n};\n"],
|
|
5
|
+
"mappings": "wHAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aA4CvB,IAAMC,EAAmB,aACvB,CAACC,EAAOC,IAAiB,CACvB,GAAM,CACJ,OAAAC,EAAS,MACT,SAAAC,EAAW,GACX,OAAAC,EAAS,IACT,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAIX,EAEEY,EAAeV,IAAW,OAASA,IAAW,SAC9CW,EAAoB,SAAuB,IAAI,EAG/CC,EAAkB,cACrBC,GAAgC,CAC9BF,EAA8D,QAAUE,EACrE,OAAOd,GAAiB,WAC1BA,EAAac,CAAI,EACRd,IACTA,EAAa,QAAUc,EAE3B,EACA,CAACd,CAAY,CACf,EAGM,YAAU,IAAM,CACpB,IAAMe,EAAUH,EAAY,QAC5B,GAAI,CAACG,EAAS,OAEd,IAAMC,EAASD,EAAQ,cACvB,GAAI,CAACC,EAAQ,OAEb,IAAMC,EAAS,IAAM,CACnB,IAAIC,EAAYP,EAAeI,EAAQ,aAAeA,EAAQ,YAG9D,GAAIb,EAAU,CACZ,IAAMiB,EAAgB,iBAAiBJ,CAAO,EACxCK,EAAS,WAAWD,EAAc,SAAS,GAAK,EACtDD,GAAaE,EAAS,CACxB,CAIIT,GACFK,EAAO,MAAM,YAAY,sBAAuB,GAAGE,CAAS,IAAI,EAChEF,EAAO,MAAM,YAAY,sBAAuB,GAAGE,CAAS,IAAI,IAEhEF,EAAO,MAAM,YAAY,qBAAsB,GAAGE,CAAS,IAAI,EAC/DF,EAAO,MAAM,YAAY,qBAAsB,GAAGE,CAAS,IAAI,EAEnE,EAEAD,EAAO,EAEP,IAAMI,EAAiB,IAAI,eAAeJ,CAAM,EAChD,OAAAI,EAAe,QAAQN,CAAO,EAEvB,IAAMM,EAAe,WAAW,CACzC,EAAG,CAACV,EAAcT,CAAQ,CAAC,EAE3B,IAAMiB,EAAgBjB,EAClB,CAAE,OAAQ,eAAeC,CAAM,IAAK,GAAGK,CAAM,EAC7CA,EAEJ,OACE,gBAACc,EAAA,CACC,IAAKT,EACL,KAAMT,EACN,QAASC,EACT,SAAUC,EACV,cAAaL,EACb,gBAAeC,GAAY,OAC3B,UAAWqB,EAAW,YAAahB,CAAS,EAC5C,MAAOY,EACN,GAAGT,GAEJ,gBAAC,OAAI,UAAU,kBACZD,CACH,CACF,CAEJ,CACF,EACAX,EAAW,YAAc,cASzB,IAAM0B,EAAmB,aACvB,CAAC,CAAE,IAAAC,EAAM,IAAK,MAAAC,EAAQ,SAAU,UAAAnB,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IAC/D,gBAAC2B,EAAA,CACC,IAAK3B,EACL,MAAO0B,EACP,IAAKD,EACL,UAAWF,EAAW,mBAAoB,gBAAiBhB,CAAS,EACnE,GAAGR,GAEHU,CACH,CAEJ,EACAe,EAAW,YAAc,cAMzB,IAAMI,EAAqB,aACzB,CAAC,CAAE,IAAAH,EAAM,IAAK,MAAAC,EAAQ,SAAU,QAAAG,EAAU,SAAU,UAAAtB,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IACnF,gBAAC2B,EAAA,CACC,IAAK3B,EACL,MAAO0B,EACP,QAASG,EACT,IAAKJ,EACL,UAAWF,EAAW,mBAAoB,kBAAmBhB,CAAS,EACrE,GAAGR,GAEHU,CACH,CAEJ,EACAmB,EAAa,YAAc,gBAM3B,IAAME,EAAoB,aACxB,CAAC,CAAE,IAAAL,EAAM,IAAK,MAAAC,EAAQ,SAAU,QAAAG,EAAU,MAAO,UAAAtB,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IAChF,gBAAC2B,EAAA,CACC,IAAK3B,EACL,MAAO0B,EACP,QAASG,EACT,IAAKJ,EACL,UAAWF,EAAW,mBAAoB,iBAAkBhB,CAAS,EACpE,GAAGR,GAEHU,CACH,CAEJ,EACAqB,EAAY,YAAc,eAS1B,IAAMC,EAAoB,aACxB,CAAC,CAAE,UAAAxB,EAAW,KAAAH,EAAO,IAAK,OAAA4B,EAAS,SAAU,SAAAC,EAAW,GAAM,SAAAxB,EAAU,GAAGV,CAAM,EAAGC,IAClF,gBAACkC,EAAA,CACC,IAAKlC,EACL,KAAMI,EACN,OAAQ4B,EACR,SAAUC,EACV,UAAWV,EAAW,iBAAkBhB,CAAS,EAChD,GAAGR,GAEHU,CACH,CAEJ,EACAsB,EAAY,YAAc,eAM1B,IAAMI,EAASrC,EAQfqC,EAAO,KAAOrC,EACdqC,EAAO,KAAOX,EACdW,EAAO,OAASP,EAChBO,EAAO,MAAQL,EACfK,EAAO,MAAQJ",
|
|
6
|
+
"names": ["React", "classNames", "AppBarRoot", "props", "forwardedRef", "anchor", "floating", "offset", "size", "variant", "material", "className", "style", "children", "restProps", "isHorizontal", "internalRef", "mergedRef", "node", "element", "parent", "update", "dimension", "computedStyle", "margin", "resizeObserver", "Card", "classNames", "AppBarLeft", "gap", "align", "Flex", "AppBarCenter", "justify", "AppBarRight", "AppBarTitle", "weight", "truncate", "Heading", "AppBar"]
|
|
7
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-VK7RNXUO.js";import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-VK7RNXUO.js";import{a as n}from"./chunk-3R4YLW4A.js";import*as e from"react";import{Toggle as f}from"radix-ui";var m=e.forwardRef(({pressed:o,onPressedChange:r,defaultPressed:a,children:t,...g},p)=>{let l=e.useCallback(()=>typeof t=="string"?t:e.isValidElement(t)&&typeof t.props?.children=="string"?t.props.children:"Toggle button",[t]),{handlePressedChange:u}=s({pressed:o,onPressedChange:r,getAccessibleName:l,componentName:"ToggleButton"});return e.createElement(f.Root,{pressed:o,onPressedChange:u,defaultPressed:a,asChild:!0},e.createElement(n,{...g,ref:p},t))});m.displayName="ToggleButton";export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6G3MPL4A.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as v}from"./chunk-MHANZINI.js";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as v}from"./chunk-MHANZINI.js";import{a as g}from"./chunk-MJJ7XDIP.js";import{a as y}from"./chunk-5WRCK4R7.js";import{a as u}from"./chunk-GCUGJXI2.js";import{a as C}from"./chunk-GO7OHBHW.js";import{c as d}from"./chunk-SEY4NA45.js";import{a as P}from"./chunk-5TXQLK4G.js";import{a as n}from"./chunk-6FLLFCBU.js";import{a as O}from"./chunk-OS3FCYZY.js";var I={};O(I,{Close:()=>k,Content:()=>E,Description:()=>B,Root:()=>R,Title:()=>h,Trigger:()=>T});import*as e from"react";import S from"classnames";import{Dialog as r}from"radix-ui";var R=t=>e.createElement(r.Root,{...t,modal:!0});R.displayName="Dialog.Root";var T=e.forwardRef(({children:t,...o},a)=>e.createElement(r.Trigger,{...o,ref:a,asChild:!0},g(t)));T.displayName="Dialog.Trigger";var{align:A,panelBackground:K,material:_,...j}=u,q={align:A},z={panelBackground:K},F={material:_},E=e.forwardRef(({align:t,...o},a)=>{let{className:x}=n({align:t},q),{panelBackground:N}=n({panelBackground:o.panelBackground},z),{material:b}=n({material:o.material},F);P(o.panelBackground);let m=b??N,{className:M,forceMount:w,container:H,panelBackground:V,material:$,...W}=n(o,j),c=e.useRef(null),L=e.useMemo(()=>i=>{c.current=i,typeof a=="function"?a(i):a&&(a.current=i)},[a]);return v(),e.useEffect(()=>{if(typeof window>"u")return;let i=c.current;if(!i)return;let l=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let p=l[0],D=l[l.length-1],f=s=>{s.key==="Tab"&&(s.shiftKey?document.activeElement===p&&(s.preventDefault(),D.focus()):document.activeElement===D&&(s.preventDefault(),p.focus()))};return i.addEventListener("keydown",f),p.focus(),()=>{i.removeEventListener("keydown",f)}},[]),e.createElement(r.Portal,{container:H,forceMount:w},e.createElement(d,{asChild:!0},e.createElement(r.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},e.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},e.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${x}`},e.createElement(r.Content,{...W,ref:L,className:S("rt-BaseDialogContent","rt-DialogContent",M),"data-material":m,"data-panel-background":m,tabIndex:-1,role:"dialog","aria-modal":"true",onCloseAutoFocus:i=>{i.preventDefault(),document.body.style.pointerEvents=""}}),e.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});E.displayName="Dialog.Content";var h=e.forwardRef((t,o)=>e.createElement(r.Title,{asChild:!0},e.createElement(C,{size:"5",mb:"3",trim:"start",...t,asChild:!1,ref:o})));h.displayName="Dialog.Title";var B=e.forwardRef((t,o)=>e.createElement(r.Description,{asChild:!0},e.createElement(y,{as:"p",size:"3",...t,asChild:!1,ref:o})));B.displayName="Dialog.Description";var k=e.forwardRef(({children:t,...o},a)=>e.createElement(r.Close,{...o,ref:a,asChild:!0},g(t)));k.displayName="Dialog.Close";export{R as a,T as b,E as c,h as d,B as e,k as f,I as g};
|
|
2
|
+
//# sourceMappingURL=chunk-7JJT42J2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-C7EVYSWK.js.map
|
|
@@ -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 l}from"./chunk-4WVNMGI5.js";import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-4WVNMGI5.js";import{a as f}from"./chunk-HJU4I34X.js";import{a as d}from"./chunk-PS6NEG5A.js";import{a as o}from"./chunk-5WRCK4R7.js";import{a as c}from"./chunk-JDGJSNWT.js";import{b as m}from"./chunk-SEY4NA45.js";import{a as t}from"./chunk-FHOCUZDR.js";import{a as i}from"./chunk-GSTOGDAJ.js";import{a as p}from"./chunk-6FLLFCBU.js";import*as r from"react";import M from"classnames";var N=r.forwardRef((e,u)=>{let C=m(),P=e.panelBackground??C.panelBackground,{asChild:s,children:y,className:v,src:g,fallback:h,name:x,description:n,avatarVariant:z,radius:U,color:k,panelBackground:b,flush:R,...T}=p(e,l,i),B={1:{avatar:"1",name:"1",description:"0"},2:{avatar:"2",name:"2",description:"1"},3:{avatar:"3",name:"3",description:"2"},4:{avatar:"4",name:"4",description:"3"}},D=e.size||"2",a=B[D],w=r.createElement(t,{align:"center",gap:"3"},r.createElement(f,{size:a.avatar,variant:z,radius:U,src:g,fallback:h,color:k}),r.createElement(t,{direction:"column",gap:"0",style:{minWidth:0}},r.createElement(o,{size:a.name,weight:"medium",truncate:!0},x),n&&r.createElement(o,{size:a.description,emphasis:"medium",truncate:!0},n)));return r.createElement(c,{...T,asChild:s,size:e.size,variant:e.variant,panelBackground:P,flush:R,ref:u,className:M("rt-UserCard",v)},d({asChild:s,children:y},w))});N.displayName="UserCard";export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CYU6BLZ5.js.map
|
|
@@ -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
|
|
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 T}from"./chunk-4YFJWXL2.js";import{a as W}from"./chunk-ISOLUTZF.js";import{a as U}from"./chunk-COWZAUZR.js";import{a as j}from"./chunk-3R4YLW4A.js";import{a as R}from"./chunk-OLAWVEAI.js";import{a as D}from"./chunk-ERNM3KVF.js";import{a as v}from"./chunk-5WRCK4R7.js";import{a as F}from"./chunk-GO7OHBHW.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-D6PHTHF2.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-L5PID6BU.js";import{a as je}from"./chunk-ISOLUTZF.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 Be}from"./chunk-AGAQC4HH.js";import{a as de}from"./chunk-FHOCUZDR.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-ENLFKWYV.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as l}from"./chunk-2N2AQNJH.js";import{a as r}from"./chunk-OLAWVEAI.js";import{a}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-2N2AQNJH.js";import{a as r}from"./chunk-OLAWVEAI.js";import{a}from"./chunk-4LDVSTXI.js";import*as t from"react";import R from"classnames";var P=t.forwardRef(({className:i,tooltip:o,tooltipSide:s="top",tooltipAlign:c="center",tooltipDelayDuration:p,tooltipDisableHoverableContent:b,...e},u)=>{let{tooltipId:m,hasTooltip:d,accessibilityProps:B}=l(o),y="aria-label"in e&&e["aria-label"],f="aria-labelledby"in e&&e["aria-labelledby"],I="children"in e&&e.children;!y&&!f&&!I&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
|
|
2
2
|
- aria-label prop with descriptive text
|
|
3
3
|
- aria-labelledby prop referencing a label element
|
|
4
4
|
- or visible text children`);let n=t.createElement(a,{...e,...B,ref:u,className:R("rt-IconButton",i)});return d?t.createElement(r,{content:o,side:s,align:c,delayDuration:p,disableHoverableContent:b,id:m},n):n});P.displayName="IconButton";export{P as a};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-ISOLUTZF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-MJJ7XDIP.js";import{a as C}from"./chunk-5WRCK4R7.js";import{a as d}from"./chunk-XKBLNVOD.js";import{a as u}from"./chunk-GO7OHBHW.js";import{c as P}from"./chunk-SEY4NA45.js";import{a as f}from"./chunk-5TXQLK4G.js";import{a}from"./chunk-6FLLFCBU.js";import{a as L}from"./chunk-OS3FCYZY.js";var I={};L(I,{Action:()=>h,Cancel:()=>x,Content:()=>v,Description:()=>E,Root:()=>y,Title:()=>T,Trigger:()=>R});import*as e from"react";import O from"classnames";import{AlertDialog as l}from"radix-ui";var y=o=>e.createElement(l.Root,{...o});y.displayName="AlertDialog.Root";var R=e.forwardRef(({children:o,...t},r)=>e.createElement(l.Trigger,{...t,ref:r,asChild:!0},c(o)));R.displayName="AlertDialog.Trigger";var{align:S,panelBackground:K,material:_,...j}=d,q={align:S},z={panelBackground:K},F={material:_},v=e.forwardRef(({align:o,...t},r)=>{let{className:N}=a({align:o},q),{panelBackground:k}=a({panelBackground:t.panelBackground},z),{material:B}=a({material:t.material},F);f(t.panelBackground);let g=B??k,{className:b,forceMount:w,container:M,panelBackground:V,material:$,...W}=a(t,j),m=e.useRef(null),H=e.useMemo(()=>i=>{m.current=i,typeof r=="function"?r(i):r&&(r.current=i)},[r]);return e.useEffect(()=>{if(typeof window>"u")return;let i=m.current;if(!i)return;let n=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(n.length===0)return;let p=n[0],D=n[n.length-1],A=s=>{s.key==="Tab"&&(s.shiftKey?document.activeElement===p&&(s.preventDefault(),D.focus()):document.activeElement===D&&(s.preventDefault(),p.focus()))};return i.addEventListener("keydown",A),p.focus(),()=>{i.removeEventListener("keydown",A)}},[]),e.createElement(l.Portal,{container:M,forceMount:w},e.createElement(P,{asChild:!0},e.createElement(l.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},e.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},e.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${N}`},e.createElement(l.Content,{...W,ref:H,className:O("rt-BaseDialogContent","rt-AlertDialogContent",b),"data-material":g,"data-panel-background":g,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description",onCloseAutoFocus:i=>{i.preventDefault(),document.body.style.pointerEvents=""}}),e.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});v.displayName="AlertDialog.Content";var T=e.forwardRef((o,t)=>e.createElement(l.Title,{asChild:!0},e.createElement(u,{size:"5",mb:"3",trim:"start",...o,asChild:!1,ref:t})));T.displayName="AlertDialog.Title";var E=e.forwardRef((o,t)=>e.createElement(l.Description,{asChild:!0},e.createElement(C,{as:"p",size:"3",...o,asChild:!1,ref:t})));E.displayName="AlertDialog.Description";var h=e.forwardRef(({children:o,...t},r)=>e.createElement(l.Action,{...t,ref:r,asChild:!0},c(o)));h.displayName="AlertDialog.Action";var x=e.forwardRef(({children:o,...t},r)=>e.createElement(l.Cancel,{...t,ref:r,asChild:!0},c(o)));x.displayName="AlertDialog.Cancel";export{y as a,R as b,v as c,T as d,E as e,h as f,x as g,I as h};
|
|
2
|
+
//# sourceMappingURL=chunk-IYCPYN4Z.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R}from"./chunk-ISOLUTZF.js";import{a as m}from"./chunk-3R4YLW4A.js";import{a as N}from"./chunk-5WRCK4R7.js";import*as t from"react";import C from"classnames";var u=t.createContext(void 0),f=t.forwardRef(({kind:c,size:e="2",color:o="gray",material:s,className:i,children:l,trailing:a,leading:n,...r},d)=>t.createElement("div",{role:"status","aria-live":"polite",...r,ref:d,className:C("rt-NoticeRoot",`rt-r-size-${e}`,i),"data-kind":c,"data-accent-color":o,"data-material":s},n?t.createElement("span",{className:"rt-NoticeIcon","aria-hidden":!0},n):null,t.createElement(N,{as:"div",size:e,className:"rt-NoticeText"},l),a));f.displayName="Strip";var g=t.forwardRef(({icon:c,action:e,onDismiss:o,dismissLabel:s="Dismiss",size:i,...l},a)=>{let n=t.useContext(u),r=i??n??"2";return t.createElement(f,{...l,size:r,ref:a,kind:"notice",leading:c,trailing:e||o?t.createElement("span",{className:"rt-NoticeActions"},e,o?t.createElement(R,{size:r,variant:"ghost",color:"gray","aria-label":s,className:"rt-NoticeDismiss",onClick:o},t.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},t.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null})});g.displayName="Notice";var v=t.forwardRef(({confirmLabel:c,cancelLabel:e="Not now",onConfirm:o,onCancel:s,busy:i=!1,size:l,color:a="gray",...n},r)=>{let d=t.useContext(u),p=l??d??"2";return t.createElement(f,{...n,size:p,color:a,ref:r,kind:"confirmation",trailing:t.createElement("span",{className:"rt-NoticeActions"},t.createElement(m,{size:p,variant:"ghost",color:"gray",disabled:i,onClick:s},e),t.createElement(m,{size:p,variant:"solid",color:a,loading:i,onClick:o},c))})});v.displayName="Confirmation";export{u as a,g as b,v as c};
|
|
2
|
+
//# sourceMappingURL=chunk-L5PID6BU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as v}from"./chunk-VX6ARMWP.js";import{a as d,e as l,f as u,g as R}from"./chunk-V32EP3S7.js";import{b as P}from"./chunk-IX5HIHVI.js";import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as v}from"./chunk-VX6ARMWP.js";import{a as f}from"./chunk-667BKCUG.js";import{a as d,e as l,f as u,g as R}from"./chunk-V32EP3S7.js";import{b as P}from"./chunk-IX5HIHVI.js";import{b}from"./chunk-SEY4NA45.js";import{a as k}from"./chunk-F6V7GBNQ.js";import{a as h}from"./chunk-GSTOGDAJ.js";import{a as m}from"./chunk-6FLLFCBU.js";import{a as z}from"./chunk-OS3FCYZY.js";var _={};z(_,{Item:()=>N,Root:()=>I});import*as o from"react";import x from"classnames";import{Context as D}from"radix-ui/internal";var y="CheckboxCards",[S]=D.createContextScope(y,[d]),G=d(),[B,E]=S(y),I=o.forwardRef((r,s)=>{let a=b(),c=r.panelBackground??a.panelBackground,{__scopeCheckboxCards:t,className:p,color:e,panelBackground:C,...i}=m(r,f,h),n=G(t);return o.createElement(B,{scope:t,size:r.size,variant:r.variant},o.createElement(v,{asChild:!0},o.createElement(l,{...n,"data-accent-color":e,"data-panel-background":c,...i,ref:s,className:x("rt-CheckboxCardsRoot",p)})))});I.displayName="CheckboxCards.Root";var N=o.forwardRef(({__scopeCheckboxCards:r,children:s,className:a,style:c,...t},p)=>{let e=E("CheckboxCardsItem",r),C=G(r),{className:i}=m({size:e?.size,variant:e?.variant||"solid"},k),n=e?.variant?`rt-variant-${e.variant}`:void 0,g=e?.size?`rt-r-size-${e.size}`:void 0;return o.createElement("label",{className:x("rt-BaseCard","rt-CheckboxCardsItem",n,g,a),style:c},s,o.createElement(u,{...C,...t,ref:p,className:x("rt-reset","rt-BaseCheckboxRoot","rt-CheckboxCardCheckbox",i)},o.createElement(R,{...C,asChild:!0,className:"rt-BaseCheckboxIndicator"},o.createElement(P,null))))});N.displayName="CheckboxCards.Item";export{I as a,N as b,_ as c};
|
|
2
|
+
//# sourceMappingURL=chunk-METRW4HG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as we}from"./chunk-2EQWBT2S.js";import{a as xe,b as He}from"./chunk-ADXZNG4F.js";import{a as ze}from"./chunk-ROSWI2CL.js";import{a as Le}from"./chunk-YAQBIO2B.js";import{a as Te}from"./chunk-AGNIFHOE.js";import{a as Re,b as ne}from"./chunk-HCNO7PX6.js";import{a as re,b as se,c as ie}from"./chunk-GMHA5CFH.js";import{e as oe,f as he,h as Pe,i as Q,j as ve,k as le,l as ae,n as ge,o as Y}from"./chunk-A2XVR7GL.js";import{a as be,b as Se}from"./chunk-BZZXXZ3O.js";import{a as me}from"./chunk-HWQ3NTJP.js";import{a as _,b as Ee,c as Ce,d as ye,g as Me}from"./chunk-3J6AUDID.js";import{a as fe}from"./chunk-3XSB7YIM.js";import{a as Ve}from"./chunk-OS3FCYZY.js";var Ke={};Ve(Ke,{Bottom:()=>Le,Content:()=>Fe,Header:()=>Oe,Inspector:()=>Te,Left:()=>Ae,Panel:()=>pe,Rail:()=>De,Root:()=>Ie,Sidebar:()=>ze,Trigger:()=>Be,useResponsivePresentation:()=>we,useShell:()=>He,useSidebarMode:()=>xe});import*as e from"react";import $ from"classnames";import{useComposedRefs as ue}from"radix-ui/internal";var ce=0;function Ne(r){ce=Math.max(0,ce+r);let s=document.documentElement;ce>0?s.setAttribute("data-rt-shell-lock",""):s.removeAttribute("data-rt-shell-lock")}var de="data-rt-shell-inert",Ue=30;function K(r,s){return s===null||s===r||s===r.body||s===r.documentElement}function ke(r,s,i){for(let d of r.querySelectorAll("[data-shell-trigger][aria-controls]"))if(!(d.getAttribute("aria-controls")!==s||d.closest("[inert]"))&&!(i&&!i.some(h=>h.contains(d))))return d;return null}var Ie=e.forwardRef(({className:r,children:s,height:i="full",style:d,onKeyDown:h,onFocus:I,...H},w)=>{let[u]=e.useState(he),m=e.useCallback(t=>Pe(u,t),[u]);e.useSyncExternalStore(m,()=>u.version,()=>0);let p=e.useRef(null),b=ue(w,p),[S,E]=e.useState(()=>new Set),T=e.useCallback(t=>{E(n=>n.has(t)?n:new Set(n).add(t))},[]),C=e.useCallback(t=>{E(n=>{if(!n.has(t))return n;let l=new Set(n);return l.delete(t),l})},[]),P=e.useMemo(()=>({registerInset:T,unregisterInset:C}),[T,C]),f=e.useCallback(()=>{for(let t of u.entries.values())t.overlayLive&&t.setValue("closed","dismiss")},[u]),g=e.useCallback(()=>[...u.entries.values()].filter(t=>t.overlayLive&&t.el).map(t=>({name:t.name,id:t.id,el:t.el})),[u]),v=[...u.entries.values()].filter(t=>t.overlayLive&&t.el).length,B=i!=="full"&&i!=="auto",y=e.useCallback(()=>{let t=p.current;if(!t)return;let n=g().map(l=>l.el);for(let l of t.children){if(!(l instanceof HTMLElement)||l.classList.contains("rt-ShellScrim"))continue;let a=n.some(M=>l===M||l.contains(M));n.length===0||a?l.hasAttribute(de)&&(l.removeAttribute(de),l.inert=!1):l.inert||(l.setAttribute(de,""),l.inert=!0)}},[g]),N=e.useRef(null),O=e.useRef([]),q=e.useRef(null),A=e.useRef(!1),z=e.useRef(0),D=e.useCallback(()=>{z.current&&cancelAnimationFrame(z.current),z.current=0},[]),j=e.useCallback((t,n)=>{D();let l=0,a=()=>{if(z.current=0,!!t.isConnected){if(n(t.ownerDocument.activeElement)){t.focus({preventScroll:!0});return}l+=1,l<Ue&&(z.current=requestAnimationFrame(a))}};z.current=requestAnimationFrame(a)},[D]);e.useEffect(()=>()=>{D(),A.current&&(A.current=!1,Ne(-1))},[D]),e.useEffect(()=>{let t=p.current;if(!t)return;let n=t.ownerDocument,l=g(),a=l.map(o=>o.el),M=!B&&l.length>0;M!==A.current&&(A.current=M,Ne(M?1:-1));let U=O.current;O.current=l;let k=U.filter(o=>{if(a.includes(o.el))return!1;let c=u.entries.get(o.name);return!o.el.isConnected||!c||c.el!==o.el||c.value==="closed"}),F=o=>o!==null&&k.some(c=>c.el.contains(o));if(U.length===0&&l.length>0){let o=n.activeElement,c=o instanceof HTMLElement&&!K(n,o)&&!a.some(R=>R.contains(o))?o:null;if(c&&!t.contains(c)){let R=q.current;R&&R.isConnected&&!a.some(J=>J.contains(R))&&(c=R)}N.current=c}if(y(),l.length===0){let o=N.current;if(N.current=null,k.length===0)return;let R=(L=>L!==null&&L.isConnected&&!L.closest("[inert]")&&!F(L))(o)?o:null;for(let L of k)R??(R=ke(n,L.id));if(!R)return;let J=L=>K(n,L)||F(L);J(n.activeElement)?R.focus({preventScroll:!0}):j(R,J);return}if(k.length>0){let o=n.activeElement;if(K(n,o)||F(o)){let c=null;for(let R of k)c??(c=ke(n,R.id,a));(c??a[a.length-1]).focus({preventScroll:!0})}}let W=a.filter(o=>!U.some(c=>c.el===o)),te=n.activeElement;W.length>0&&!a.some(o=>o.contains(te))&&(W[0].focus({preventScroll:!0}),j(W[0],o=>K(n,o)||o instanceof Element&&o.closest("[inert]")!==null))}),e.useEffect(()=>{let t=p.current;if(!t||v===0||typeof MutationObserver>"u")return;let n=new MutationObserver(y);return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]}),()=>n.disconnect()},[v,y]);let G=t=>{h?.(t),!(t.key!=="Escape"||t.defaultPrevented||v===0)&&(f(),t.stopPropagation())};e.useEffect(()=>{let t=p.current;if(!t||v===0)return;let n=t.ownerDocument,l=a=>{a.key!=="Escape"||a.defaultPrevented||!K(n,a.target)||f()};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[v,f]);let Z=t=>{I?.(t),t.target instanceof HTMLElement&&p.current?.contains(t.target)&&(q.current=t.target)},x=u.entries.get("rail"),X=x!==void 0&&x.value!==void 0&&x.value!=="closed"?S.has("rail")?`calc(${x.size}px + 2 * var(--shell-inset-gap))`:`${x.size}px`:void 0,V=i==="full"?{}:i==="auto"?{height:"auto"}:typeof i=="number"?{height:`${i}px`}:{height:i};return e.createElement(ve.Provider,{value:u},e.createElement(ge.Provider,{value:P},e.createElement("div",{...H,ref:b,className:$("rt-ShellRoot",r),"data-height":i==="auto"?"auto":void 0,"data-has-inset":S.size>0||void 0,"data-overlay-live":v>0||void 0,onKeyDown:G,onFocus:Z,style:{...V,...X?{"--shell-rail-offset":X}:{},...d}},s,e.createElement("div",{className:"rt-ShellScrim","aria-hidden":!0,onClick:f}))))});Ie.displayName="Shell.Root";var Oe=e.forwardRef(({className:r,height:s=64,style:i,...d},h)=>e.createElement("header",{...d,ref:h,className:$("rt-ShellHeader",r),style:{...i,"--shell-header-height":`${s}px`}}));Oe.displayName="Shell.Header";var Ae=e.forwardRef(({children:r},s)=>(e.useEffect(()=>{},[]),e.createElement(e.Fragment,null,r)));Ae.displayName="Shell.Left";var We={controlled:"open",default:"defaultOpen"},De=e.forwardRef((r,s)=>{let{className:i,presentation:d,expandedSize:h=64,collapsible:I,onExpand:H,onCollapse:w,children:u,style:m,open:p,defaultOpen:b,onOpenChange:S,inset:E,id:T,...C}=r,{table:P,attributes:f}=ie(d,"fixed"),g=re({name:"rail",label:"Rail",propNames:We,id:T,controlled:_(p),defaultValue:_(b),presentationTable:P,builtIn:Ee,onChange:(B,y)=>S?.(B!=="closed",{reason:y}),onExpand:H,onCollapse:w,size:h});Y("rail",E);let v=ue(s,g.setElement);return e.createElement("div",{...C,id:g.id,ref:v,className:$("rt-ShellPane","rt-ShellRail",i),...se(g,f),"data-inset":E||void 0,tabIndex:g.overlaying?-1:C.tabIndex,style:{...m,"--rail-size":`${h}px`}},e.createElement("div",{className:"rt-ShellRailContent"},u))});De.displayName="Shell.Rail";var _e={controlled:"open",default:"defaultOpen"},pe=e.forwardRef((r,s)=>{let{className:i,presentation:d,defaultOpen:h,open:I,onOpenChange:H,size:w,defaultSize:u,expandedSize:m=288,minSize:p=100,maxSize:b=800,resizable:S=!1,collapsible:E=!0,onExpand:T,onCollapse:C,onResize:P,onResizeStart:f,onResizeEnd:g,snapPoints:v,snapTolerance:B,collapseThreshold:y,paneId:N,persistence:O,children:q,style:A,onSizeChange:z,sizeUpdate:D,sizeUpdateMs:j=50,inset:G,id:Z,...x}=r,ee=le("Shell.Panel"),X=ae(ee,"rail"),V=ie(d,"fixed"),t=d===void 0,n=t?X?.presentationTable??oe:V.table,l=t?{"data-presentation-follows":""}:V.attributes,a=re({name:"panel",label:"Panel",propNames:_e,id:Z,controlled:_(I),defaultValue:_(h),presentationTable:n,builtIn:Ce,onChange:(o,c)=>H?.(o!=="closed",{reason:c}),onExpand:T,onCollapse:C,size:m});Y("panel",G),e.useEffect(()=>{(v!==void 0||y!==void 0||N!==void 0||O!==void 0)&&void 0},[v,y,N,O]);let M=e.useRef(null),U=ue(s,a.setElement,M),k=be({name:"panel",elementId:a.id,elementRef:M,cssVarName:"--panel-size",orientation:"vertical",edge:"end",growth:ye,expandedSize:m,minSize:p,maxSize:b,resizable:S,collapsible:E,size:w,defaultSize:u,onSizeChange:z,sizeUpdate:D,sizeUpdateMs:j,onResize:P,onResizeStart:f,onResizeEnd:g,snapPoints:v,snapTolerance:B,collapseThreshold:y,paneId:N,persistence:O,overlaying:a.overlaying,overlayingNow:()=>(t?ee.entries.get("rail")?.presentationTable??oe:V.table)[fe()]==="overlay",requestCollapse:()=>a.setValue("closed","toggle"),requestToggle:()=>a.toggle("toggle")}),{handles:F,content:W}=Se(q,ne),te=S&&a.shown!==!1&&!a.overlaying?e.createElement(me.Provider,{value:k},F.length>0?F:e.createElement(Re,null)):null;return e.createElement("div",{...Me(x),id:a.id,ref:U,className:$("rt-ShellPane","rt-ShellPanel",i),...se(a,l),"data-inset":G||void 0,tabIndex:a.overlaying?-1:x.tabIndex,style:{...A,"--panel-expanded-size":`${m}px`}},e.createElement("div",{className:"rt-ShellPanelContent"},W),te)});pe.displayName="Shell.Panel";pe.Handle=ne;var Fe=e.forwardRef(({className:r,inset:s,...i},d)=>(Y("content",s),e.createElement("main",{...i,ref:d,className:$("rt-ShellContent",r),"data-inset":s||void 0})));Fe.displayName="Shell.Content";var Be=e.forwardRef(({target:r,action:s="toggle",peekOnHover:i,onClick:d,onMouseEnter:h,onMouseLeave:I,children:H,...w},u)=>{let m=le("Shell.Trigger");e.useEffect(()=>{r==="left"&&void 0,i&&void 0},[r,i]);let p=r==="left"?"rail":r,b=ae(m,p),S=b?.value===void 0?void 0:b.value!=="closed",E=P=>{if(d?.(P),P.defaultPrevented)return;let f=m.entries.get(p);f&&(m.peek===p&&Q(m,null),s==="toggle"?f.toggle("toggle"):s==="expand"?f.setValue("open","toggle"):f.setValue("closed","toggle"))},T=P=>{if(h?.(P),!i)return;let f=m.entries.get(p);f&&f.value==="closed"&&f.presentation!=="overlay"&&Q(m,p)},C=P=>{I?.(P),i&&m.peek===p&&Q(m,null)};return e.createElement("button",{type:"button","aria-controls":b?.id,"aria-expanded":S,...w,ref:u,onClick:E,onMouseEnter:T,onMouseLeave:C,"data-shell-trigger":r,"data-shell-action":s},H)});Be.displayName="Shell.Trigger";export{Ie as a,Oe as b,Ae as c,De as d,pe as e,Fe as f,Be as g,Ke as h};
|
|
2
|
+
//# sourceMappingURL=chunk-MJOXEUBT.js.map
|