efficient-shell 12.18.0 → 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/dist/{Browser-U6V2IAOZ.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-QL6GDJGG.js +141 -0
- package/dist/{Notepad-F3Z4ZFVY.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-HSW3BKA5.js → Preview-76X3G42U.js} +34 -34
- 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/{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-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-4KXATGI3.js → chunk-B4GCTNGM.js} +5 -5
- 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-Y6E7IRK2.js → chunk-DK5SXOXJ.js} +1 -1
- package/dist/{chunk-Z62RBVEJ.js → chunk-DTSOYFQE.js} +1 -1
- 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-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-3A6FYWFQ.js → chunk-HOEHV2J5.js} +1 -1
- 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-GJLN4NRB.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-35CKKH2S.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-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-DQMRPTGY.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/PositionInput.js +1 -1
- package/dist/forms/RenameField.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 +492 -492
- 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/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/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.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/Files-V67UDEO6.js +0 -141
- package/dist/chunk-25QDSYH5.js +0 -13
- package/dist/chunk-3PSLQJWR.js +0 -1
- package/dist/chunk-5QYKF7NK.js +0 -27
- package/dist/chunk-L7MWAC2P.js +0 -6
- package/dist/chunk-PMBCQWJW.js +0 -4
- package/dist/chunk-PZSVISYY.js +0 -28
- package/dist/chunk-QBWMWK2W.js +0 -7
- package/dist/chunk-RMKC5POE.js +0 -3
- package/dist/chunk-S3OCHYGE.js +0 -14
- package/dist/chunk-VJXPT53M.js +0 -19
- 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,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,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,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{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:[
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-XZXFUZIK.js";import{Tooltip as t}from"./chunk-SOZCWT6I.js";import{useShellStrings as n}from"./chunk-JSHMIMAJ.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,S=p??(x?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):x?j.backToDefault:j.backToAuto,g=m??(b?j.tip(S,T):S);
|
|
2
2
|
/* @__PURE__ */
|
|
3
|
-
return r(t,{content:
|
|
4
|
-
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":
|
|
5
|
-
/* @__PURE__ */a("span",{id:y,hidden:!0,children:
|
|
3
|
+
return r(t,{content:g,describe:!1,children:[
|
|
4
|
+
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":S,"aria-describedby":y,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
|
|
5
|
+
/* @__PURE__ */a("span",{id:y,hidden:!0,children:T})]})}export{o as SettingReset};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-SFULX4E3.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
|
|
2
2
|
return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
|
|
3
3
|
return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
4
4
|
/* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-OOWPLQD5.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */p(t,{side:m,width:
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-OOWPLQD5.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-XZXFUZIK.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:W="bg-white"}){const j="right"===m,z=i().sidebar,C=a(),D=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[I,P]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),M=null!=l||null!=n,E=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:I},children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${M?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),M?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
3
|
+
/* @__PURE__ */p(t,{side:m,width:I,onResize:P,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${W}`,children:u});/* @__PURE__ */
|
|
4
4
|
return f("div",C?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
-
/* @__PURE__ */p(g,{phone:D,top:l,fallback:z.sections}),
|
|
6
|
-
/* @__PURE__ */p(v,{phone:D,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:
|
|
5
|
+
/* @__PURE__ */p(g,{phone:D,top:l,fallback:z.sections}),K,
|
|
6
|
+
/* @__PURE__ */p(v,{phone:D,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:E,K,j?E:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
|
|
7
7
|
return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
8
8
|
/* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
9
9
|
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-CEIIQRK5.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-CEIIQRK5.js";import{Select_default as l}from"./chunk-TM4CRQ3W.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-N3R6N7LG.js";import{Input_default as c}from"./chunk-6RK6R3RY.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|