efficient-shell 12.17.1 → 12.19.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/README.md +3 -3
- package/dist/{Browser-A3JCQ6WZ.js → Browser-AUAKVIMA.js} +14 -14
- package/dist/Calculator-OUPD7SZV.js +29 -0
- package/dist/{CurrencyConverter-34AMD4W7.js → CurrencyConverter-CNGYEKE3.js} +9 -9
- package/dist/{Files-O5ZUWY44.js → Files-QL6GDJGG.js} +141 -141
- package/dist/{Notepad-ZIWRLVG5.js → Notepad-FFGF3MKM.js} +9 -9
- package/dist/{PdfViewer-F2TCC5UD.js → PdfViewer-UY5SRC63.js} +1 -1
- package/dist/{PomodoroTimer-6WR3UOOM.js → PomodoroTimer-I53C5QYM.js} +65 -65
- package/dist/{Preview-G2BMJF76.js → Preview-76X3G42U.js} +31 -31
- package/dist/{Sidebar-ADAIERCI.js → Sidebar-BKNCPUOE.js} +37 -37
- package/dist/{Stock-UAGSFAKY.js → Stock-JY3PJI2M.js} +2 -2
- package/dist/{Weather-G2VGEQX2.js → Weather-POQXLYFA.js} +17 -17
- package/dist/{WorldClock-43KK7OTT.js → WorldClock-FUJOPJ5G.js} +6 -6
- package/dist/ai/index.d.ts +59 -3
- package/dist/ai/index.js +110 -91
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/{chunk-OALFCXD6.js → chunk-2NZ7CVMW.js} +1 -1
- package/dist/{chunk-MFJHLC5M.js → chunk-34EBBZFK.js} +1 -1
- package/dist/{chunk-T3JSUBIF.js → chunk-34TQBJ7I.js} +1 -1
- package/dist/{chunk-EEAY7FJW.js → chunk-3CKYFCX4.js} +18 -18
- package/dist/{chunk-FQHPGREQ.js → chunk-3E3LR2PM.js} +12 -12
- package/dist/{chunk-KSMEWOCE.js → chunk-3J3FBYIZ.js} +1 -1
- package/dist/{chunk-JAVTQART.js → chunk-3JL4TCA7.js} +1 -1
- package/dist/{chunk-DVYBJOD3.js → chunk-436PJFHC.js} +10 -10
- package/dist/{chunk-JQWZ36JD.js → chunk-4PIQG2ZK.js} +1 -1
- package/dist/{chunk-DCNSQGHJ.js → chunk-4ZLFAXOC.js} +11 -11
- package/dist/{chunk-24LO6OH4.js → chunk-4ZRGMK7Y.js} +1 -1
- package/dist/{chunk-7ARBBWPQ.js → chunk-6FZ5JTBY.js} +2 -2
- package/dist/{chunk-7X2P6IH3.js → chunk-6GWYFUME.js} +5 -5
- package/dist/{chunk-ZKGUBIBT.js → chunk-6RK6R3RY.js} +1 -1
- package/dist/{chunk-XJW65EIG.js → chunk-7LTU5TJD.js} +1 -1
- package/dist/chunk-7U3BSTN2.js +1 -0
- package/dist/chunk-B4GCTNGM.js +9 -0
- package/dist/{chunk-XKJGJNY2.js → chunk-B4GRHE44.js} +3 -3
- package/dist/{chunk-ZE7OVMDM.js → chunk-BM2QIV64.js} +22 -22
- package/dist/{chunk-QPYVCG74.js → chunk-CCK2UWQ5.js} +10 -10
- package/dist/{chunk-WQ4YKWN2.js → chunk-CJHYOHMU.js} +1 -1
- package/dist/chunk-D2WJAF62.js +4 -0
- package/dist/{chunk-6TIJH2M6.js → chunk-DCCYUCBM.js} +1 -1
- package/dist/{chunk-JUFCEWE3.js → chunk-DG2TGWXI.js} +5 -5
- package/dist/{chunk-Y6E7IRK2.js → chunk-DK5SXOXJ.js} +1 -1
- package/dist/{chunk-Z62RBVEJ.js → chunk-DTSOYFQE.js} +1 -1
- package/dist/{chunk-VXDW6ZPG.js → chunk-EEB5XPWP.js} +2 -2
- package/dist/chunk-EFKJLUYP.js +2 -0
- package/dist/{chunk-I76W4ZNU.js → chunk-FBUFB536.js} +4 -4
- package/dist/{chunk-RMDVKQJE.js → chunk-FE5DH5OM.js} +2 -2
- package/dist/{chunk-LQVQX5B2.js → chunk-FQ4IRBMA.js} +1 -1
- package/dist/{chunk-W7DYKTHE.js → chunk-FTMCNC66.js} +1 -1
- package/dist/{chunk-RB7IU7ZK.js → chunk-FVKXDF2Q.js} +5 -5
- package/dist/chunk-GCTJIZTJ.js +2 -0
- package/dist/{chunk-LNZMA4PB.js → chunk-GEZM6ARD.js} +1 -1
- package/dist/{chunk-RAOM3WIQ.js → chunk-GLRRX4AL.js} +1 -1
- package/dist/chunk-HMT3MES3.js +27 -0
- package/dist/{chunk-QAS22BIS.js → chunk-HNIIDDLJ.js} +1 -1
- package/dist/{chunk-3A6FYWFQ.js → chunk-HOEHV2J5.js} +1 -1
- package/dist/{chunk-TW7SWDKZ.js → chunk-I5EVMLPB.js} +4 -4
- package/dist/{chunk-5MH5N76F.js → chunk-I7JU4IU3.js} +4 -4
- package/dist/{chunk-MBCUICY3.js → chunk-ILDPJ26Y.js} +1 -1
- package/dist/{chunk-XG5ER6GJ.js → chunk-JGRDG7CB.js} +5 -5
- package/dist/{chunk-HYPYNVQQ.js → chunk-JN5NUZ6D.js} +1 -1
- package/dist/chunk-JUXPKGO3.js +28 -0
- package/dist/{chunk-VYRVSTI6.js → chunk-KBI3T6UC.js} +9 -9
- package/dist/{chunk-UULBPDAH.js → chunk-KP2JYXEU.js} +8 -8
- package/dist/{chunk-H4ABSQS6.js → chunk-L543DFHF.js} +1 -1
- package/dist/chunk-LCEQIFPK.js +3 -0
- package/dist/{chunk-2DQHXJPM.js → chunk-LPPJNZQ6.js} +3 -3
- package/dist/{chunk-G3E4CD77.js → chunk-ME7XHU3P.js} +6 -6
- package/dist/{chunk-NKP5WCEA.js → chunk-MFEPLP7Y.js} +6 -6
- package/dist/{chunk-WYGUHCJ2.js → chunk-N32LNPPP.js} +8 -8
- package/dist/{chunk-YU52WMSH.js → chunk-N3R6N7LG.js} +1 -1
- package/dist/{chunk-ZQT3GNRU.js → chunk-NAN2IW2H.js} +2 -2
- package/dist/{chunk-ZTRKM3B5.js → chunk-OG53D3R5.js} +9 -9
- package/dist/{chunk-OFYNPYY2.js → chunk-OGWQABFP.js} +1 -1
- package/dist/{chunk-EDX55XGV.js → chunk-OLCRYT3N.js} +8 -8
- package/dist/chunk-OQ6TECLX.js +6 -0
- package/dist/{chunk-J2YURAQY.js → chunk-QG37GJP2.js} +6 -6
- package/dist/{chunk-42XSMAIK.js → chunk-QI4235JY.js} +1 -1
- package/dist/{chunk-JTGRLXZN.js → chunk-QMSINDXL.js} +1 -1
- package/dist/{chunk-H32UNWVU.js → chunk-QPSJYSET.js} +5 -5
- package/dist/{chunk-HJF4UZOA.js → chunk-QZCLHKCI.js} +8 -8
- package/dist/{chunk-3ZQT26GZ.js → chunk-R62JKPYY.js} +1 -1
- package/dist/{chunk-5DQE6RQJ.js → chunk-RKXCB5ZJ.js} +1 -1
- package/dist/{chunk-6A26HUVK.js → chunk-RY7JCGLI.js} +1 -1
- package/dist/{chunk-GOEHP2XM.js → chunk-S7MNRAYS.js} +4 -4
- package/dist/{chunk-YVHEKEHJ.js → chunk-SET3R227.js} +1 -1
- package/dist/chunk-SFULX4E3.js +7 -0
- package/dist/{chunk-YK64FFLW.js → chunk-SSNTJ3M4.js} +4 -4
- package/dist/{chunk-3FNBUOZK.js → chunk-SY66VJAI.js} +1 -1
- package/dist/{chunk-4I4WZHMV.js → chunk-T2TZBTSM.js} +1 -1
- package/dist/{chunk-2I7M4DCA.js → chunk-T6EB54LL.js} +1 -1
- package/dist/{chunk-ZICGXJUB.js → chunk-THLXDI76.js} +8 -8
- package/dist/{chunk-MJVFIH3J.js → chunk-TKUJUQK4.js} +9 -9
- package/dist/chunk-TM4CRQ3W.js +19 -0
- package/dist/chunk-TUPPFC74.js +14 -0
- package/dist/chunk-UP4HLGMZ.js +9 -0
- package/dist/{chunk-WLUJQLXG.js → chunk-UR2ECNBB.js} +1 -1
- package/dist/{chunk-OVD3ECM7.js → chunk-VLMBXPRM.js} +1 -1
- package/dist/{chunk-OHSRZLRD.js → chunk-VP2GI3UP.js} +2 -2
- package/dist/{chunk-MRLXGLNZ.js → chunk-VQ4X3OBR.js} +1 -1
- package/dist/{chunk-PDA77NNC.js → chunk-X34ZBXIU.js} +3 -3
- package/dist/{chunk-TKPUYQ3Q.js → chunk-XQNZJNEJ.js} +73 -73
- package/dist/{chunk-F37II2EH.js → chunk-XQWHKXLS.js} +13 -13
- package/dist/{chunk-B7EVVJHY.js → chunk-XVIJHDZ4.js} +3 -3
- package/dist/{chunk-JOAKKXTL.js → chunk-XZXFUZIK.js} +3 -2
- package/dist/{chunk-56XKHWNL.js → chunk-Y523KUQC.js} +1 -1
- package/dist/{chunk-ILIPEY3D.js → chunk-YI6SYUAK.js} +1 -1
- package/dist/{chunk-B2KQ3T7Q.js → chunk-YIUWX2IU.js} +6 -6
- package/dist/{chunk-PJE75B66.js → chunk-YRY64DQV.js} +1 -1
- package/dist/{chunk-I3TVRNUT.js → chunk-Z3CTYK3U.js} +1 -1
- package/dist/{chunk-YTZFWV2W.js → chunk-ZLKEPDJE.js} +1 -1
- package/dist/chunk-ZQ24H5UO.js +13 -0
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +500 -500
- package/dist/map/index.js +2 -2
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-4VBPCGRP.js +0 -29
- package/dist/chunk-25QDSYH5.js +0 -13
- package/dist/chunk-5QYKF7NK.js +0 -27
- package/dist/chunk-JDQGHQ2C.js +0 -2
- package/dist/chunk-L7MWAC2P.js +0 -6
- package/dist/chunk-LAOG7AED.js +0 -1
- package/dist/chunk-PMBCQWJW.js +0 -4
- package/dist/chunk-QBWMWK2W.js +0 -7
- package/dist/chunk-RMKC5POE.js +0 -3
- package/dist/chunk-S3OCHYGE.js +0 -14
- package/dist/chunk-UWLGKMH5.js +0 -9
- package/dist/chunk-VJXPT53M.js +0 -19
- package/dist/chunk-VPXAOSVH.js +0 -28
- package/dist/chunk-WCCGKDG6.js +0 -2
- package/dist/chunk-YFUY3VDW.js +0 -9
- /package/dist/{chunk-2VFSYSDS.js → chunk-5WK56FA3.js} +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Je("Custom"),children:
|
|
3
|
-
/* @__PURE__ */D(e,{mode:"range",min:
|
|
4
|
-
return
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
1
|
+
import{Calendar as e}from"./chunk-CCK2UWQ5.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-6RK6R3RY.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{Icon as u}from"./chunk-XZXFUZIK.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{buttonClasses as b}from"./chunk-UQYNPYF4.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-JSHMIMAJ.js";import{useState as w,useRef as k,useId as N,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as j,jsx as D}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=t;function F(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function H(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var O=/* @__PURE__ */new Map;function L({from:t,to:n,onChange:m,formatDisplay:Y,clearable:L,required:R=!1,name:J,id:U,"aria-labelledby":B,"aria-label":I,weekStartsOn:T,placeholder:A,fullWidth:E=!1,min:G,max:K,disabled:Z=!1,allowOpenEnd:q=!1}){const X=v().dateRange,P=y(),Q=Y??(P?function(e){let t=O.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),O.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(P):H),z=A??X.placeholder,V=L??!R,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=k(null),de=k(null),me=k(null),ue=N(),he=N(),pe=N(),[fe,ge]=w(!1),be=f(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=k(null),ve=k(null),[ye,we]=w(!0);g(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const ke=k(null);g(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==ke.current&&ke.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;ke.current=e,e>r+.5&&ge(!0)}});const[Ne,Ce]=w(!1);g(()=>{const e=!!U&&(de.current?.labels?.length??0)>0;e!==Ne&&Ce(e)});const Me=!!I||!!B||Ne,We=/* @__PURE__ */new Date,[je,De]=w(()=>t?t.slice(0,7):S(We,G,K)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,We),G,K)),Ye=e=>e?Q(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=h(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{Z&&ee(!1)},[Z]);const Fe=()=>{m("",""),ee(!1)},Se=V&&!Z&&Boolean(t||n),He=t&&n?`${Ye(t)} — ${Ye(n)}`:t?X.fromOnly(Ye(t)):n?X.toOnly(Ye(n)):"",Oe=d(P),Le=e=>{const t=r(e);return t?Oe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Re=t&&n?X.range(Le(t),Le(n)):t?X.fromOnly(Le(t)):n?X.toOnly(Le(n)):z,Je=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ue=/* @__PURE__ */W(j,{children:[$e.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,We);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Je(e),"aria-label":fe?X[e]:void 0,children:fe?ye?X[e]:X[`${e}Short`]:X[e]},e)),
|
|
2
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Je("Custom"),children:X.custom})]}),Be=(e,t)=>q?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ie=e=>q&&ie===e?" ring-1 ring-blue-400":"",Te=
|
|
3
|
+
/* @__PURE__ */D(e,{mode:"range",min:G,max:K,value:te||null,endValue:ne||null,month:je,onMonthChange:De,onSelect:e=>{le("Custom"),q?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:T,"aria-label":X.dialog});/* @__PURE__ */
|
|
4
|
+
return W("div",{className:"relative"+(E?" w-full":""),ref:ce,children:[
|
|
5
|
+
/* @__PURE__ */W("div",{className:`relative ${E?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${Z?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{Z||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(We,G,K)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:U,disabled:Z||void 0,"aria-label":I,"aria-labelledby":B,"aria-describedby":[Me?he:void 0,R?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(E?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */D(u,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */D("span",{className:"truncate",children:
|
|
9
|
-
/* @__PURE__ */D("input",{type:"hidden",name:J.from,value:t,disabled:
|
|
10
|
-
/* @__PURE__ */D("input",{type:"hidden",name:J.to,value:n,disabled:
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:
|
|
14
|
-
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
15
|
-
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:
|
|
16
|
-
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */D("div",{className:"w-full",children:
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */D("div",{className:"w-64",children:
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:b({variant:"secondary"}),children:
|
|
23
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:
|
|
8
|
+
/* @__PURE__ */D("span",{className:"truncate",children:He||z})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:X.clearRange,icon:/* @__PURE__ */D(u,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Re}),R&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:X.required}),J&&/* @__PURE__ */W(j,{children:[
|
|
9
|
+
/* @__PURE__ */D("input",{type:"hidden",name:J.from,value:t,disabled:Z||void 0}),
|
|
10
|
+
/* @__PURE__ */D("input",{type:"hidden",name:J.to,value:n,disabled:Z||void 0})]}),_&&M(
|
|
11
|
+
/* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":X.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:p.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
|
|
12
|
+
/* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Be("from",/* @__PURE__ */W(j,{children:[
|
|
13
|
+
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:X.from}),
|
|
14
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("from")}`,children:te?Ye(te):X.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Be("to",/* @__PURE__ */W(j,{children:[
|
|
15
|
+
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:X.to}),
|
|
16
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("to")}`,children:ne?Ye(ne):X.end})]}))]}),fe?/* @__PURE__ */W(j,{children:[$e.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:X.lastHeading}),
|
|
17
|
+
/* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ue,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:X[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */D("div",{className:"w-full",children:Te})]}):
|
|
19
|
+
/* @__PURE__ */W("div",{ref:xe,className:"flex w-max gap-4",children:[
|
|
20
|
+
/* @__PURE__ */D("div",{className:"w-64",children:Te}),$e.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ue})]}),
|
|
21
|
+
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[V&&/* @__PURE__ */D("button",{type:"button",onClick:Fe,className:b({variant:"ghost"}),children:X.clear}),
|
|
22
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:b({variant:"secondary"}),children:X.cancel}),
|
|
23
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:q?!te&&!ne:!te||!ne,className:b({variant:"primary"}),children:X.apply})]})]}),document.body)]})}export{L as DateRangePicker,F as presetRange,Y as toISODate};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-
|
|
1
|
+
import{fromDateKey as e,toMonthKey as t,toDateKey as r,fromMonthKey as a}from"./chunk-2HMNOLKX.js";import{calendarNames as n,firstDayOfWeek as o}from"./chunk-Y3JW2GW5.js";import{Icon as l}from"./chunk-XZXFUZIK.js";import{useBrowserValue as i}from"./chunk-D65T4H6J.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{useMemo as g,useState as u,useRef as d,useEffect as h}from"react";import{jsxs as m,jsx as f,Fragment as b}from"react/jsx-runtime";var y="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var v=()=>r(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:w,endValue:M,mode:D="single",onSelect:N,min:Y,max:k,month:F,defaultMonth:j,onMonthChange:A,weekStartsOn:C,quickJump:S=!0,markedDates:J,readOnly:K=!1,"aria-label":q,className:H=""}){const P=g(()=>new Set(J??[]),[J]),W=e(w),I=i(v,null),O=e(I),U=s().calendar,X=c(),$=n(X),E=i(()=>o(X),0),L=C??E,Z=()=>{if(!O)return null;const e=t(O);return Y&&e<Y.slice(0,7)?Y.slice(0,7):k&&e>k.slice(0,7)?k.slice(0,7):e},[B,G]=u(()=>j||(W?t(W):Z())),R=F??B??Z(),T=null===R?null:function(e,t){return a(e)??t}(R,O),[V,z]=u(()=>w??I),Q=d(null),_=d(!1),[ee,te]=u("days"),re=g(()=>T?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(T,L):[],[R,L]),ae=e=>!!Y&&e<Y||!!k&&e>k,ne=V??I,oe=re.some(e=>r(e)===ne),le=T?re.find(e=>e.getMonth()===T.getMonth())??re[0]:null,ie=oe&&ne?ne:le?r(le):"";if(h(()=>{_.current&&(_.current=!1,Q.current?.querySelector('[data-active="true"]')?.focus())},[ie,R]),!T)/* @__PURE__ */
|
|
2
2
|
return m("div",{className:H,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */f("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(
|
|
4
|
+
/* @__PURE__ */f("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */f("div",0===t?{className:"py-1 text-xs",children:" "}:{className:y,children:/* @__PURE__ */f("span",{className:"aspect-square"})},t))})]});const se=e=>"years"===ee?new Date(T.getFullYear()+12*e,T.getMonth(),1):"months"===ee?new Date(T.getFullYear()+e,T.getMonth(),1):x(T,e),ce=e=>{const r=t(e);void 0===F&&G(r),A?.(r)},ge=q??$.monthYear(T.getFullYear(),T.getMonth());/* @__PURE__ */
|
|
5
5
|
return m("div",{className:H,children:[
|
|
6
6
|
/* @__PURE__ */m("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee
|
|
8
|
-
/* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label"
|
|
9
|
-
/* @__PURE__ */f("button",{type:"button","aria-label"
|
|
10
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee
|
|
11
|
-
/* @__PURE__ */m("div",{ref:
|
|
12
|
-
/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+
|
|
13
|
-
/* @__PURE__ */f("div",{role:"columnheader","aria-label"
|
|
14
|
-
return f("div",{role:"gridcell","aria-selected":n,"aria-label":K?i:void 0,children:K?/* @__PURE__ */m("span",{"aria-hidden":"true",className:`grid place-items-center ${s(!1)}`,children:[e.getDate(),c]}):/* @__PURE__ */m("button",{type:"button","data-active":t===ie,tabIndex:t===ie?0:-1,disabled:l,"aria-label":i,"aria-current":t===
|
|
7
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?U.previousYears:"months"===ee?U.previousYear:U.previousMonth,onClick:()=>ce(se(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */f("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */m(b,{children:["years"!==ee&&/* @__PURE__ */f("button",{type:"button","aria-label":U.chooseMonth($.months[T.getMonth()]),onClick:()=>te(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:$.months[T.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":U.chooseYear(T.getFullYear()),onClick:()=>te(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:T.getFullYear()})]}):/* @__PURE__ */f("span",{children:$.monthYear(T.getFullYear(),T.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"years"===ee?U.nextYears:"months"===ee?U.nextYear:U.nextMonth,onClick:()=>ce(se(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f(l,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":U.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:$.monthsShort.map((e,t)=>/* @__PURE__ */f("button",{type:"button","aria-pressed":t===T.getMonth(),onClick:()=>{ce(new Date(T.getFullYear(),t,1)),te("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===T.getMonth()?"bg-blue-600 font-semibold text-white":O&&t===O.getMonth()&&T.getFullYear()===O.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */f("div",{role:"group","aria-label":U.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=T.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */f("button",{type:"button","aria-pressed":e===T.getFullYear(),onClick:()=>{ce(new Date(e,T.getMonth(),1)),te("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===T.getFullYear()?"bg-blue-600 font-semibold text-white":e===O?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */m("div",{ref:Q,role:"grid","aria-label":ge,className:"space-y-1","aria-readonly":K||void 0,onKeyDown:a=>{const n=e(ie)??O??T,o={ArrowLeft:()=>p(n,-1),ArrowRight:()=>p(n,1),ArrowUp:()=>p(n,-7),ArrowDown:()=>p(n,7),Home:()=>p(n,-(n.getDay()-L+7)%7),End:()=>p(n,6-(n.getDay()-L+7)%7),PageUp:()=>x(n,a.shiftKey?-12:-1),PageDown:()=>x(n,a.shiftKey?12:1)};if(o[a.key])return a.preventDefault(),l=o[a.key](),_.current=!0,z(r(l)),void(t(l)!==R&&ce(l));var l;"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),K||ae(ie)||N(ie))},hidden:"days"!==ee,children:[
|
|
12
|
+
/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,t)=>(t+L)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */f("div",{role:"columnheader","aria-label":$.weekdays[e],className:"py-1",children:/* @__PURE__ */f("abbr",{title:$.weekdays[e],className:"no-underline",children:$.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */f("div",{role:"row",className:`${y} text-center text-sm`,children:re.slice(7*t,7*t+7).map(e=>{const t=r(e),a=e.getMonth()!==T.getMonth(),n=t===w||"range"===D&&t===M,o=(e=>!("range"!==D||!w||!M)&&e>w&&e<M)(t),l=ae(t),i=$.longDate(e.getFullYear(),e.getMonth(),e.getDate()),s=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",l?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":o?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),t!==I||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),c=P.has(t)&&/* @__PURE__ */f("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return f("div",{role:"gridcell","aria-selected":n,"aria-label":K?i:void 0,children:K?/* @__PURE__ */m("span",{"aria-hidden":"true",className:`grid place-items-center ${s(!1)}`,children:[e.getDate(),c]}):/* @__PURE__ */m("button",{type:"button","data-active":t===ie,tabIndex:t===ie?0:-1,disabled:l,"aria-label":i,"aria-current":t===I?"date":void 0,onClick:()=>{z(t),N(t)},className:s(!0),children:[e.getDate(),c]})},t)})},t))]})]})}export{w as Calendar};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-XZXFUZIK.js";import{OneLineLabel as r}from"./chunk-G67CJAQ2.js";import{useShellStrings as s}from"./chunk-JSHMIMAJ.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,usePopupLevel as t,usePopupLevelBindings as a,windowScrimStyle as o,OverlayLayerProvider as l,scrimHasCorners as n,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as d}from"./chunk-5WK56FA3.js";import{dialogA11y as c}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as m}from"./chunk-7QSDPSXP.js";import{useFocusTrap as u,useScrollLock as p}from"./chunk-DWGYC7OD.js";import{Icon as f}from"./chunk-XZXFUZIK.js";import{useHydrated as h}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-JSHMIMAJ.js";import{useRef as b,useId as y,useState as g,useEffect as k}from"react";import{createPortal as w}from"react-dom";import{jsxs as j,Fragment as N,jsx as $}from"react/jsx-runtime";var C="bg-black/30 backdrop-blur-sm",W={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function D({open:D,onClose:F,title:I,description:S,role:U="dialog",children:A,footer:G,blocking:J=!1,size:T="md",aside:V=!1,dirty:X=!1,initialFocus:Z,"aria-label":E,"aria-labelledby":H,"aria-describedby":K,className:M=""}){const P=b(null),Q=y(),Y=y(),z=!J,B=y(),L=x().dialog,O=e(h()),[R,q]=g(null),_=d({open:D,dirty:X,onClose:F,title:I,layer:R}),ee=b(null),re=r(D&&null!==O,ee),ie=i(re,P),te=t(D&&null!==O,ee),ae=a(te,R),oe=o(te),le=null!==te.host;if(m(D),u(P,D&&null!==O,Z,ae),p(D),k(()=>{if(D)return v(()=>!ae.current?.(document.activeElement)&&(J||_(),!0),()=>P.current)},[D,J,_,ae]),!D||!O)return null;/* @__PURE__ */
|
|
2
|
+
return j(N,{children:[/* @__PURE__ */$("span",{ref:ee,hidden:!0,"data-popup-anchor":""}),w(
|
|
3
|
+
/* @__PURE__ */$(l,{value:R,children:/* @__PURE__ */j("div",{ref:q,className:"fixed inset-0"+(V?" pointer-events-none opacity-0":le?" pointer-events-none":""),style:s(te),role:"presentation","data-overlay-layer":"","data-aside":V?"":void 0,children:[!le&&/* @__PURE__ */$("div",{className:`fixed inset-0 ${C}`,"aria-hidden":"true","data-popup-scrim":"system"}),oe&&/* @__PURE__ */$("div",{className:`fixed ${C}${V?"":" pointer-events-auto"}${n(te)?" rounded-(--radius-window)":""}`,style:oe,onClick:J?void 0:_,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
+
/* @__PURE__ */$("div",{className:re?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:J||le?void 0:e=>{e.target===e.currentTarget&&_()},children:/* @__PURE__ */j("div",{ref:P,"data-popup-panel":"",style:re?{left:ie?.left??0,top:ie?.top??0,visibility:ie?void 0:"hidden"}:void 0,...c({role:U,modal:!0,titleId:I?B:void 0,labelledBy:H,label:E}),"aria-describedby":K??(S?Y:A?Q:void 0),className:`${re?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${W[T]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl${le&&!V?" pointer-events-auto":""} ${M}`.trim(),children:[I&&/* @__PURE__ */$("h2",{id:B,className:(z?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:I}),S&&/* @__PURE__ */$("p",{id:Y,className:((I?"mt-1":z?"pr-8":"")+" text-sm text-gray-500").trim(),children:S}),A&&/* @__PURE__ */$("div",{id:Q,className:"mt-2 text-sm text-gray-600",children:A}),G&&/* @__PURE__ */$("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:G}),z&&/* @__PURE__ */$("button",{type:"button",onClick:_,"aria-label":L.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */$(f,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),O)]})}export{D as Dialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-
|
|
1
|
+
import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-XZXFUZIK.js";import{CHART_INK as r,STATUS_VARS as o,SERIES_VARS as i}from"./chunk-TZFACUMR.js";import{useMemo as l,useRef as a,useId as c}from"react";import{jsxs as d,jsx as s}from"react/jsx-runtime";var h={downloadPng:"Download PNG",downloadSvg:"Download SVG",toPdf:"Add to the PDF"},m={label:"var(--ink-strong)",note:r.label,line:r.label},f={step:i[0],decision:o.warning,start:r.muted,end:r.muted};function u(e,t){return`${(e.title??"flowchart").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"flowchart"}.${t}`}function g(e){const t=new Map(e.nodes.map(e=>[e.id,e.label]));return e.edges.map(e=>`${t.get(e.from)} to ${t.get(e.to)}${e.label?` (${e.label})`:""}`).join("; ")}function w({node:e}){const t=f[e.kind],n=e.x+e.width/2,r=e.y+e.height/2,o=e.note?[...e.lines,e.note]:e.lines,i=r-15*(o.length-1)/2,l="decision"===e.kind?/* @__PURE__ */s("polygon",{points:`${n},${e.y} ${e.x+e.width},${r} ${n},${e.y+e.height} ${e.x},${r}`}):/* @__PURE__ */s("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:"step"===e.kind?4:e.height/2});/* @__PURE__ */
|
|
2
2
|
return d("g",{fill:t,fillOpacity:.14,stroke:t,strokeWidth:1,children:[l,o.map((t,r)=>{const l=void 0!==e.note&&r===o.length-1;/* @__PURE__ */
|
|
3
3
|
return s("text",{x:n,y:i+15*r,textAnchor:"middle",dominantBaseline:"central",fontSize:l?11:12.5,fontWeight:l?400:600,fill:l?m.note:m.label,fillOpacity:1,stroke:"none",children:t},r)})]})}function p(e){const t=e.cloneNode(!0),n=[e,...Array.from(e.querySelectorAll("*"))],r=[t,...Array.from(t.querySelectorAll("*"))],o=e.ownerDocument.defaultView;n.forEach((e,t)=>{for(const n of["fill","stroke"]){const i=e.getAttribute(n);i&&i.includes("var(")&&o&&r[t].setAttribute(n,o.getComputedStyle(e).getPropertyValue(n)||i)}});const i=o?.getComputedStyle(e).getPropertyValue("--viz-surface").trim();if(i){const n=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("fill",i),t.insertBefore(n,t.firstChild)}return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("font-family","system-ui, -apple-system, Segoe UI, sans-serif"),(new XMLSerializer).serializeToString(t)}function b(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function y({spec:r,labels:o,onToPdf:i,bare:f=!1,className:y}){const k={...h,...o},v=l(()=>e(r),[r]),x=a(null),$=r.title??"Flowchart",A=`flow-arrow-${c().replace(/:/g,"")}`;/* @__PURE__ */
|
|
4
4
|
return d("figure",{className:`my-2 ${y??""}`,children:[
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:M="polygon",rings:v=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),w=N??(e=>h(e,F)),A=C??W.nothingToCompare,R=p(),[H,L]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
|
|
2
2
|
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:A});const B=y/2,E=y/2,J=y/2-46,Q=o(k.length),S=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...z.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/S[e])),l=Q.center(e)-Q.step/2;return[B+J*r*Math.cos(l),E+J*r*Math.sin(l)]},U=(e,t)=>null!==H?H!==e:null!==Y&&Y!==t,V=null!==H?z[H]:void 0;/* @__PURE__ */
|
|
3
3
|
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
4
|
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":R,onMouseLeave:()=>L(null),children:[
|
|
5
|
-
/* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:v},(e,
|
|
5
|
+
/* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:v},(e,r)=>{const l=J*(r+1)/v;return"circle"===M?/* @__PURE__ */d("circle",{cx:B,cy:E,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(B,E,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,S[t]);/* @__PURE__ */
|
|
6
6
|
return f("g",{children:[
|
|
7
7
|
/* @__PURE__ */d("line",{x1:B,y1:E,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */d("text",{x:B+(J+18)*Math.cos(Q.center(t)-Q.step/2),y:E+(J+18)*Math.sin(Q.center(t)-Q.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
-
/* @__PURE__ */d(
|
|
10
|
-
return f("g",{opacity:U(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${
|
|
11
|
-
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:
|
|
9
|
+
/* @__PURE__ */d(r,{id:R,reveal:!!j&&"center-out"}),z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:U(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(R)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
+
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:V.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(H,3,V.color,V.tone),value:w(V.values[t]??0)}))})}),
|
|
12
12
|
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
13
|
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
14
|
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-XZXFUZIK.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";var s={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},c={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},a={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function i({tone:r}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"error",...t});default:/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{UnitMenu as e}from"./chunk-
|
|
1
|
+
import{UnitMenu as e}from"./chunk-SET3R227.js";import{InputNumber_default as a,stepRounding as t}from"./chunk-FE5DH5OM.js";import{IconButton_default as i}from"./chunk-SV5RRBVA.js";import{Icon as r}from"./chunk-XZXFUZIK.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{jsx as o,jsxs as d,Fragment as l}from"react/jsx-runtime";var s="h-3.5 w-3.5",m={padding:{top:/* @__PURE__ */o(r,{name:"padding-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */o(r,{name:"padding-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */o(r,{name:"padding-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */o(r,{name:"padding-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */o(r,{name:"padding-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */o(r,{name:"padding-left-right","aria-hidden":"true",className:s})},crop:{top:/* @__PURE__ */o(r,{name:"crop-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */o(r,{name:"crop-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */o(r,{name:"crop-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */o(r,{name:"crop-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */o(r,{name:"crop-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */o(r,{name:"crop-left-right","aria-hidden":"true",className:s})}},c=/* @__PURE__ */o(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var h=(e,a,t)=>null===e[t]?a[t]:String(e[t]);function p(e,a){const t=t=>h(e,a,t);return t("left")!==t("right")||t("top")!==t("bottom")}function u({label:i,value:r,onChange:n,each:s,placeholder:c,words:p,min:u=0,max:g=200,step:f=4,readOnly:b,glyphs:N="padding",units:v}){const x=m[N],C=(i,d,l)=>{const s=function(e,a){const t=a.map(a=>e[a]);return t.every(e=>e===t[0])?t[0]:"mixed"}(r,i),m=i.map(e=>h(r,c,e)),N="mixed"!==s&&m.every(e=>e===m[0])?m[0]:"–";/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-side":i.join("-"),className:"min-w-0",children:/* @__PURE__ */o(a,{value:"mixed"===s?null:s,onChange:e=>((e,a)=>{const t={...r};for(const i of e)t[i]=a;n(t)})(i,e),min:u,max:g,step:f,snap:!0,...t(f),steppers:"compact",readOnly:b,placeholder:N,prefix:l,suffix:p.unit,suffixControl:v&&/* @__PURE__ */o(e,{value:p.unit,options:v.options,onChange:v.onChange,label:v.label,disabled:b}),"aria-label":d})})};/* @__PURE__ */
|
|
3
3
|
return o("div",{role:"group","aria-label":i,"data-sides":s?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */d(l,s?{children:[C(["left"],p.sides.left,x.left),C(["top"],p.sides.top,x.top),C(["right"],p.sides.right,x.right),C(["bottom"],p.sides.bottom,x.bottom)]}:{children:[C(["left","right"],p.horizontal,x.horizontal),C(["top","bottom"],p.vertical,x.vertical)]})})}function g({each:e,onChange:a,label:t,disabled:r}){/* @__PURE__ */
|
|
4
4
|
return o(n,{content:t,children:/* @__PURE__ */o(i,{size:"md","aria-label":t,"aria-pressed":e,disabled:r,onClick:()=>a(!e),children:c})})}export{g as SidesEachToggle,u as SidesInput,p as sidesStartEach};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-XQWHKXLS.js";import{ChartFrame as a}from"./chunk-RBS3AWE7.js";import{ColumnChart as l}from"./chunk-GC4N4UQM.js";import{TH_ONE_LINE as s}from"./chunk-G67CJAQ2.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
5
5
|
/* @__PURE__ */i("th",{scope:"row",className:`${s} border-t border-gray-100 px-2 py-1 text-left font-normal text-gray-700`,children:e}),n.series.map((e,a)=>{const l=e.values[t];/* @__PURE__ */
|
|
6
6
|
return i("td",{className:"border-t border-gray-100 px-2 py-1 text-right tabular-nums text-gray-700",children:null===l?r:u(l)},a)})]},t))})]});/* @__PURE__ */
|
|
7
|
-
return i(
|
|
7
|
+
return i(a,{title:y,legend:b.map(e=>({key:e.key,label:e.label,swatch:"line"===n.type?"bar":"square"})),table:f,className:h,children:"line"===n.type?/* @__PURE__ */i(t,{series:b,labels:n.x,height:c,width:m,animate:d,dots:"all",formatValue:p,formatTooltipValue:u}):/* @__PURE__ */i(l,{series:b,labels:n.x,stacked:n.stacked,height:c,width:m,animate:d,formatValue:p,formatTooltipValue:u})})}export{n as SpecChart};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";var i={sm:"min-h-(--control-height-sm) px-(--space-control-x-sm) py-(--space-4) gap-(--space-icon-gap-sm) text-xs",md:"min-h-(--control-height-md) px-(--space-control-x) py-(--space-4) gap-(--space-icon-gap) text-sm",lg:"min-h-(--control-height-lg) px-(--space-control-x-lg) py-(--space-4) gap-(--space-icon-gap) text-sm",touch:"min-h-14 px-(--space-20) py-(--space-4) gap-(--space-icon-gap) text-base"},a="[&>[data-choice-icon]]:-my-(--space-4)";function c(e=!1,n=""){return["rosh-choice-track inline-flex max-w-full flex-wrap items-stretch gap-(--space-4) rounded-(--radius-card) bg-gray-100 p-(--space-4)",e?"w-full":"",n].filter(Boolean).join(" ")}function o({size:e="md",selected:n,disabled:t=!1,block:c=!1}){return["relative inline-flex min-w-min max-w-full items-center justify-center whitespace-normal break-normal text-center rounded-(--radius-control) font-medium transition-colors",i[e],a,n?"bg-accent-fill text-on-accent shadow-sm rosh-segmented-on":"text-gray-600 hover:text-ink-strongest",t?"cursor-not-allowed opacity-40":"cursor-pointer",c?"flex-1":""].filter(Boolean).join(" ")}function r(e=!1){return e?"relative inline-flex min-w-min max-w-full flex-1":"relative inline-flex min-w-min max-w-full"}function l({icon:i,label:a}){/* @__PURE__ */
|
|
2
|
+
return e(n,{children:[i?/* @__PURE__ */t("span",{"aria-hidden":"true","data-choice-icon":"",className:"inline-flex shrink-0",children:i}):null,a]})}export{l as ChoiceContent,o as choiceItemClass,r as choiceTipClass,c as choiceTrackClass};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(z.Provider,{value:r,children:e})}function k({value:o,onChange:a,min:w,max:F,step:k=1,shiftStep:N,precision:M,inputMin:
|
|
3
|
-
/* @__PURE__ */f("input",{id:
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-FE5DH5OM.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{createContext as o,useState as l,useMemo as a,useId as d,useRef as s,useContext as u,useEffect as c}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},w=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function y(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(w.test(t)?2:1),0)))}function S(e,t,n,i){return Number(m(e,t,n).toFixed(i))}var z=o(null);function F({children:e}){const[t,n]=l({}),i=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:i,width:e.length?`max(${e.join(", ")})`:null}},[t,i]);/* @__PURE__ */
|
|
2
|
+
return f(z.Provider,{value:r,children:e})}function k({value:o,onChange:a,min:w,max:F,step:k=1,shiftStep:N,precision:M,inputMin:j,inputMax:L,suffix:R,showInput:$=!0,emptyLabel:C,placeholderValue:E,stepFrom:O,label:W,"aria-labelledby":H,valueText:K,id:A,disabled:B,size:D="md",boxSize:q="sm",className:V="",auto:I}){const J=r(),T=d(),P=t(),U=I??P,Z=d(),G=A??T,Q=M??h(k),X=j??w,Y=L??F,_=void 0!==C||void 0!==E,ee=O??E,te=m(o??E??w,w,F),ne=[w.toFixed(Q),F.toFixed(Q),o?.toFixed(Q),C,E?.toFixed(Q)],ie=null!=o?o.toFixed(Q):C||(null!=E?E.toFixed(Q):void 0),re=s(null),oe=s(null),[le,ae]=l(null),de=s(null),se=Boolean(R);i(()=>{if(!$)return;const e=()=>{const e=re.current?.querySelector("input"),t=oe.current;if(!e||!t)return;const n=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(i<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const r=Math.ceil(t.getBoundingClientRect().width);if(r<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,d=de.current;if(de.current={box:d?.box??{frame:i,fontSize:n.fontSize,text:r,cut:a},room:l},d&&d.box.frame===i&&d.box.fontSize===n.fontSize&&d.box.text===r&&d.box.cut===a)return;const s={frame:i,fontSize:n.fontSize,text:r,cut:a};de.current={box:s,room:l},ae(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=re.current?.querySelector("input");t&&n.observe(t),oe.current&&n.observe(oe.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[se,$,q]),i(()=>{const e=de.current;if(!e)return;const t=e.box.text<=e.room+.5?null:oe.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const i={...e.box,cut:n};de.current={box:i,room:e.room},ae(i)},[ie]);const ue=e=>K?K(e):"string"==typeof R?`${e.toFixed(Q)} ${R}`:void 0,ce=null==o?C??(null!=E?ue(E)??String(E):void 0):ue(o),fe=x[q],pe=ne.filter(e=>Boolean(e)),me=void 0===ie?-1:pe.indexOf(ie),he=le?`${le.text+le.frame+2}px`:`calc(${y(ne)}ch + ${fe.left+(se?fe.unit:fe.plain)+2}px)`,xe=u(z),ve=d(),be=xe?.set;return i(()=>{be&&be(ve,$?he:null)},[be,ve,he,$]),c(()=>()=>be?.(ve,null),[be,ve]),/* @__PURE__ */p("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${V}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:G,type:"range",min:w,max:F,step:k,value:te,disabled:B,"aria-label":H?void 0:W,"aria-labelledby":H,"aria-valuetext":ce,"aria-describedby":U?Z:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const n=e.shiftKey&&null!=N;if(!n&&!(null==o&&null!=ee))return;e.preventDefault();a(S((o??ee??te)+t*(n?N??k:k),w,F,Q))},onChange:e=>a(S(Number(e.target.value),w,F,Q)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===D?"h-1":"h-1.5")}),$&&
|
|
4
4
|
/* @__PURE__ */f(n,{content:le?.cut?ie:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */p("div",{ref:re,"data-slider-box":"",className:`relative min-w-0 max-w-full shrink-0 ${fe.text}`,style:{position:"relative",width:xe?.width??he,...le?{fontSize:le.fontSize}:{}},children:[
|
|
5
5
|
/* @__PURE__ */f("span",{ref:oe,"data-slider-sizer":"","aria-hidden":"true",style:b,children:pe.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===me?"":void 0,style:g,children:e},t))}),
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<X||e>Y||a(e):_&&a(null)},min:X,max:Y,step:k,shiftStep:N,stepFrom:ee,precision:
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<X||e>Y||a(e):_&&a(null)},min:X,max:Y,step:k,shiftStep:N,stepFrom:ee,precision:Q,snap:!0,allowEmpty:_,suffix:R,disabled:B,placeholder:C??(null!=E?E.toFixed(Q):void 0),size:q,auto:U,"aria-label":W?J.slider.value(W):void 0,"aria-labelledby":W?void 0:H})]})}),U&&/* @__PURE__ */f("span",{id:Z,hidden:!0,children:J.settingView.auto})]})}export{k as Slider,F as SliderGroup,S as settleSliderValue,y as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{useSettingAuto as e}from"./chunk-2NMW66P5.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{Icon as n}from"./chunk-
|
|
2
|
-
return m("div",{className:"relative","data-number-box":"",style:S||
|
|
1
|
+
import{useSettingAuto as e}from"./chunk-2NMW66P5.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{Icon as n}from"./chunk-XZXFUZIK.js";import{useBrowserLayoutEffect as o}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as i}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-JSHMIMAJ.js";import{forwardRef as l,useId as c,useState as s,useRef as u,useCallback as d,useEffect as p}from"react";import{jsx as f,jsxs as m,Fragment as v}from"react/jsx-runtime";function h(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function b(e){return 0===h(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),g={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function y(e){const r=u(null),[t,n]=s(0);return o(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function w(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function k({dir:e,compact:t,label:o,disabled:i,onStep:a}){const l=u(a);l.current=a;const c=u({}),s=d(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);p(()=>s,[s]),p(()=>{i&&s()},[i,s]);const m=/* @__PURE__ */f(n,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),v={tabIndex:-1,"aria-label":o,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */f("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:m}):/* @__PURE__ */f(r,{size:"sm",...v,children:m})}var N=l(function({value:r,onChange:n,min:o,max:l,precision:b,step:N,shiftStep:j,disabled:E,readOnly:B,invalid:D,placeholder:C,size:M,prefix:S,suffix:$,suffixControl:F,id:K,name:O,className:U="",onBlur:P,onFocus:R,steppers:T,stepFrom:W,snap:z=!1,allowEmpty:A=!0,appearance:I="box",display:L,reportWhileTyping:V=!0,onRevert:Y,"aria-label":J,"aria-labelledby":X,"aria-describedby":Z,auto:H,...Q},q){const G="bare"===I,_=e(),ee=H??_,re=c(),te="string"==typeof $&&""!==$.trim()?$.trim():void 0,ne=e=>function(e,r,t=!1){let n=w(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,te,Boolean(F)),oe=Boolean($||F),ie=Object.fromEntries(Object.entries(Q).filter(([e])=>e.startsWith("data-"))),ae=a(),[le,ce]=s(()=>x(r,b)),se=u(le);se.current=le;const ue=u(null),de=d(e=>{ue.current=e,"function"==typeof q?q(e):q&&(q.current=e)},[q]),pe=u(r),fe=u(r);fe.current=r;const me=Boolean(E||B),ve=T??!1,he="compact"===ve,[be,xe]=y(S),[ge,ye]=y(Boolean(F)),we=he?g.compact:ve?g.steppers:g.plain;p(()=>{ne(se.current)!==r&&ce(x(r,b))},[r,b]);const ke=e=>{if(me)return;let r=(ne(se.current)??W??(C?ne(C):null)??0)+e;null!=o&&r<o&&(r=o),null!=l&&r>l&&(r=l);const t=b??String(N??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const i=x(r,b);se.current=i,ce(i),n(r),Me()},Ne=u(ke);Ne.current=ke;const je=u({unit:N??1,big:j??10*(N??1),locked:me});je.current={unit:N??1,big:j??10*(N??1),locked:me},p(()=>{const e=ue.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=je.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),Ne.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Ee,Be]=s(!1),[De,Ce]=s(0),Me=()=>{G&&Ce(e=>e+1)};p(()=>{G&&Ee&&document.activeElement===ue.current&&ue.current?.select()},[G,Ee,De]);const Se=u(!1);p(()=>{if(Ee&&!me)return i(e=>{if("Escape"!==e.key||document.activeElement!==ue.current)return!1;const r=pe.current;if(ne(se.current)===r)return!1;const t=x(r,b);return se.current=t,ce(t),fe.current!==r&&(Y??n)(r),Me(),!0})},[Ee,me,b,n,Y]);const $e=()=>{const e=ne(se.current);if(null==e){if(!A){const e=x(fe.current,b);return se.current=e,ce(e),fe.current}return se.current="",ce(""),null!==fe.current&&n(null),null}let r=e;const t=b??(z?Math.max(h(N??1),h(o??0)):void 0);z&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,N??1,o??0)),null!=o&&r<o&&(r=o),null!=l&&r>l&&(r=l),null!=t&&(r=Number(r.toFixed(t)));const i=x(r,b);return se.current=i,ce(i),r===e&&r===fe.current||n(r),r},Fe=/* @__PURE__ */f("input",{ref:de,id:K,"data-number-input":"",name:O,type:"text",inputMode:0===b?"numeric":"decimal",value:!Ee&&L?L(r):le,disabled:E,readOnly:B,placeholder:C,step:N,role:"spinbutton","aria-valuenow":r??void 0,"aria-valuemin":o,"aria-valuemax":l,"aria-valuetext":null==r?C||void 0:`${x(r,b)}${G&&te?te:""}`,"aria-describedby":[Z,ee?re:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":G?"bare":void 0,...ie,autoComplete:G?"off":void 0,spellCheck:!G&&void 0,"aria-invalid":D||void 0,"aria-label":J,"aria-labelledby":X,onChange:e=>(e=>{if(B)return;const r=w(e,te,Boolean(F));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(ce(e),!V)return;const t=ne(e);(null!==t||A)&&n(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!me)return pe.current=$e(),void Me();const r=N??1,t=j??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||me||(e.preventDefault(),ke(n))},onFocus:()=>{pe.current=fe.current,Be(!0),Se.current=!0,R?.()},onMouseUp:G?e=>{Se.current&&(Se.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Be(!1),Se.current=!1,$e(),P?.()},className:G?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Ee?"bg-surface":"bg-transparent",me?"cursor-default":"cursor-text",U].filter(Boolean).join(" "):t({invalid:D,size:M,readOnly:B,auto:ee,className:[S?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",F?"pr-(--rosh-number-suffix-room)":he?oe?"pr-10":"pr-6":ve?oe?"pr-24":"pr-16":oe?"pr-10":"","text-left tabular-nums",F&&!Ee?"text-ellipsis":"",U].filter(Boolean).join(" ")})}),Ke=ee?/* @__PURE__ */f("span",{id:re,hidden:!0,children:ae.settingView.auto}):null;if(G||!S&&!oe&&!ve)return Ke?/* @__PURE__ */m(v,{children:[Fe,Ke]}):Fe;const Oe=ne(le);/* @__PURE__ */
|
|
2
|
+
return m("div",{className:"relative","data-number-box":"",style:S||F?{...S?{"--rosh-number-prefix-width":`${xe}px`}:{},...F?{"--rosh-number-suffix-room":`max(${we.least}, calc(${we.right} + ${ye}px))`}:{}}:void 0,children:[S&&/* @__PURE__ */f("span",{ref:be,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:S}),Fe,Ke,F?/* @__PURE__ */f("span",{ref:ge,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:we.right},children:F}):$&&/* @__PURE__ */f("span",{className:`pointer-events-none absolute ${he?"right-6":ve?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:$}),ve&&(()=>{const e=/* @__PURE__ */f(k,{dir:-1,compact:he,label:ae.number.decrease,disabled:me||null!=o&&null!=Oe&&Oe<=o,onStep:e=>Ne.current(-(e?j??10*(N??1):N??1))}),r=/* @__PURE__ */f(k,{dir:1,compact:he,label:ae.number.increase,disabled:me||null!=l&&null!=Oe&&Oe>=l,onStep:e=>Ne.current(e?j??10*(N??1):N??1)});/* @__PURE__ */
|
|
3
3
|
return m("span",he?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{N as InputNumber_default,b as stepRounding};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-CJHYOHMU.js";import{Button_default as n}from"./chunk-EVYD6UFQ.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-THLXDI76.js";import{jsx as r,jsxs as d}from"react/jsx-runtime";var s=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,o=(e,t)=>`${e}-status-${t}`;function c(e,t){return e.flatMap((e,i)=>"status"===e.type?[o(t,i)]:[]).join(" ")||void 0}var b={minHeight:"var(--space-32)",paddingTop:0,paddingBottom:0,paddingLeft:"var(--space-12)",paddingRight:"var(--space-12)"};function u(s,c){const{menuId:y,choose:m,toggle:p,followLink:h,rowProps:k=()=>({}),linkAs:f}=c,g=f??"a",v=(s,f)=>{if("divider"===s.type)/* @__PURE__ */
|
|
2
2
|
return r("div",{role:"separator",children:/* @__PURE__ */r(e,{})},s.key);if("label"===s.type)/* @__PURE__ */
|
|
3
3
|
return r("div",{id:`${y}-label-${f}`,children:/* @__PURE__ */r(t,{children:s.label})},s.key);if("status"===s.type)/* @__PURE__ */
|
|
4
4
|
return r("div",{id:o(y,f),className:"text-xs",style:i(),children:s.label},s.key);if("submenu"===s.type)/* @__PURE__ */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{angleScale as r}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:M,animate:y=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),R=M??(e=>m(e,w)),E=b??C.nothingToPlot,I=h(),[P,T]=u(null),{highlighted:$}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:E});const A=v/2,F=v/2,H=v/2-10,J=x??Math.max(...g.map(e=>e.value),1),Q="track"===k?Math.max(6,(H-.16*v)/g.length):0,U=Math.max(1,Math.floor((H-.16*v)/Q||1)),V="track"===k?g.slice(0,U):g,W=Math.min(j,Math.max(1,Q-2)),Y=r(V.length,.03),z=null!==P?V[P]:void 0;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
3
|
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":I,onMouseLeave:()=>T(null),children:[
|
|
4
4
|
/* @__PURE__ */p("title",{id:I,children:"track"===k?C.radialTrack(V.length):C.radialCycle(V.length)}),V.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/J)),c=((e,t)=>null!==P?P!==e:null!==$&&$!==t)(r,l.key);if("track"===k){const o=H-r*Q,m=o-Q+W,h=-Math.PI/2;/* @__PURE__ */
|
|
5
|
-
return d("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),className:y?
|
|
6
|
-
/* @__PURE__ */p("path",{d:
|
|
7
|
-
/* @__PURE__ */p("path",{d:
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),children:/* @__PURE__ */p("path",{d:
|
|
5
|
+
return d("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),className:y?t.sweep:void 0,style:y?a(r,70):void 0,children:[
|
|
6
|
+
/* @__PURE__ */p("path",{d:e(A,F,m,o,h,h+f),fill:i.grid}),
|
|
7
|
+
/* @__PURE__ */p("path",{d:e(A,F,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
+
return p("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),children:/* @__PURE__ */p("path",{d:e(A,F,m,m+(H-m)*s,Y(r),Y(r)+Y.step),fill:n})},l.key)})]}),z&&null!==P&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(n,{title:z.label,rows:[{key:"value",label:C.value,color:o(P,z.color,z.tone),value:R(z.value)}]})}),
|
|
9
9
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
10
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
11
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Tooltip as e}from"./chunk-SOZCWT6I.js";import{jsx as a,jsxs as l}from"react/jsx-runtime";var r="58px";function i({options:i,value:s,onChange:o,onClear:n,columns:t,captions:c=!1,label:d,className:u="","aria-labelledby":b}){const p=t?{flex:`0 1 calc((100% - ${t-1} * var(--space-8)) / ${t})`}:{flex:`0 1 ${r}`};/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":b?void 0:d,"aria-labelledby":b,style:c?void 0:{gridTemplateColumns:t?`repeat(${t}, minmax(0, 1fr))`:`repeat(auto-fill, minmax(${r}, 1fr))`},className:`${c?"flex flex-wrap":"grid"} gap-(--space-8) ${u}`.replace(/\s+/g," ").trim(),children:i.map(r=>{const i=r.value===s,t=/* @__PURE__ */l("button",{type:"button","aria-pressed":i,"aria-label":c?void 0:r.label,disabled:r.disabled||void 0,onClick:()=>{i?n?.():o(r.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${c?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${i?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[r.picture,c&&/* @__PURE__ */a("span",{className:"max-w-full text-center text-2xs leading-4 break-normal",children:r.label})]});return c?/* @__PURE__ */a("div",{className:"flex min-w-min",style:p,children:t},r.value):/* @__PURE__ */a(e,{content:r.label,describe:!1,className:"relative flex min-w-0",children:t},r.value)})})}export{i as PictureTiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-6RK6R3RY.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
|
|
2
2
|
return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as t}from"./chunk-
|
|
1
|
+
import{Icon as t}from"./chunk-XZXFUZIK.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
|
|
2
2
|
/* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
|
|
3
3
|
/* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
|
|
4
4
|
return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{Dialog as e}from"./chunk-D2WJAF62.js";import{Icon as t}from"./chunk-XZXFUZIK.js";import{buttonClasses as r}from"./chunk-UQYNPYF4.js";import{useShellStrings as n,splitAround as o}from"./chunk-JSHMIMAJ.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:r({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:r({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:r({variant:"primary"})}},w=r({variant:"secondary"}),C=r({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function P(){/* @__PURE__ */
|
|
2
|
+
return m(t,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F(){/* @__PURE__ */
|
|
3
|
+
return m(t,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),j=a(null),E=a(0),T=a([]),W=a(null),$=a(null),D=c(e=>{j.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),J=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===j.current?D(r):T.current.push(r)})},[D]),[K,A]=s(!1),[I,M]=s({message:""}),[U,X]=s(""),Y=a(),Z=c(e=>(M(e),X(""),A(!0),new Promise(e=>{Y.current=e})),[]),[H,Q]=s(!1),[S,V]=s({}),[q,z]=s(""),B=a(),G=c(e=>{const t="string"==typeof e?{message:e}:e;return V(t),z(t.defaultValue??""),Q(!0),new Promise(e=>{B.current=e})},[]);u(()=>{g=J,v=Z,x=G},[J,Z,G]);const O=(e,t)=>{if(j.current!==e)return;const r=N.current,n=T.current.shift();n?D(n):(j.current=null,N.current=void 0,l(!1)),r?.(t)},R=e=>{A(!1),X(""),Y.current?.(e)},_=e=>{if(e){const e=q.trim();if(!e&&!S.allowEmpty)return Q(!1),void B.current?.(null);Q(!1),B.current?.(e)}else Q(!1),B.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===I.variant?"warning":"danger"],ne=I.confirmWord,oe=null==ne||U===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
|
|
4
|
+
return d(f.Provider,{value:J,children:[t,
|
|
5
|
+
/* @__PURE__ */m(e,{open:r,onClose:()=>O(p,!1),initialFocus:W,footer:/* @__PURE__ */d(h,{children:[
|
|
6
|
+
/* @__PURE__ */m("button",{ref:W,type:"button",onClick:()=>O(p,!1),className:w,children:i.cancelLabel||le.cancel}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>O(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
8
|
+
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
9
|
+
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
10
|
+
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
|
|
11
|
+
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
|
|
12
|
+
/* @__PURE__ */d(e,{open:K,onClose:()=>R(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
|
|
13
|
+
/* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>R(!1),className:w,children:I.cancelLabel||le.destructiveCancel}),
|
|
14
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>R(!0),disabled:!oe,className:re.button,children:ne??I.confirmLabel??le.destructiveConfirm})]}),children:[
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>R(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(F,{})}),
|
|
16
|
+
/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
17
|
+
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
18
|
+
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
19
|
+
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:I.title||le.destructiveTitle}),
|
|
20
|
+
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:I.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
|
|
21
|
+
/* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
22
|
+
/* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
|
|
23
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:U,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&U===ne&&R(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
|
|
24
|
+
/* @__PURE__ */d(e,{open:H,onClose:()=>_(!1),title:S.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
|
|
25
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:S.cancelLabel||le.cancel}),
|
|
26
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!S.allowEmpty&&!q.trim(),className:C,children:S.confirmLabel||le.ok})]}),children:[S.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:S.message}),
|
|
27
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:q,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:S.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{j as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-
|
|
1
|
+
import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-EFKJLUYP.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{useId as s}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";function t({value:t,onChange:c,options:d,name:b,size:u="md",block:m=!1,label:h,className:p="","aria-labelledby":v,"aria-describedby":f}){const g={"aria-label":v?void 0:h,"aria-labelledby":v,"aria-describedby":f},N=s(),y=e(m,p),k=l(m);/* @__PURE__ */
|
|
2
2
|
return n("div",b?{role:"radiogroup",...g,className:y,children:d.map(e=>{const l=`${N}-${e.value}`,s=e.value===t,d=/* @__PURE__ */o("label",{htmlFor:l,className:i({size:u,selected:s,disabled:e.disabled,block:m}),children:[
|
|
3
3
|
/* @__PURE__ */n("input",{id:l,type:"radio",name:b,value:e.value,checked:s,disabled:e.disabled,"aria-describedby":e.title?`${l}-note`:void 0,onChange:()=>c(e.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
|
|
4
4
|
/* @__PURE__ */n(a,{icon:e.icon,label:e.label}),e.title&&/* @__PURE__ */n("span",{id:`${l}-note`,className:"sr-only",children:e.title})]},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:d},e.value):d})}:{role:"group",...g,className:y,children:d.map(e=>{const l=e.value===t,s=/* @__PURE__ */n("button",{type:"button","aria-pressed":l,disabled:e.disabled,onClick:()=>c(e.value),className:i({size:u,selected:l,disabled:e.disabled,block:m}),children:/* @__PURE__ */n(a,{icon:e.icon,label:e.label})},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:s},e.value):s})})}export{t as Segmented};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-JGRDG7CB.js";import{Avatar as t}from"./chunk-WESNFWM4.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|