efficient-shell 15.8.0 → 15.9.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 +1 -1
- package/dist/{Browser-5QLDJ74Z.js → Browser-FEZ2X7B5.js} +16 -16
- package/dist/{Calculator-6WNTZLWL.js → Calculator-MBHZSFJ6.js} +22 -22
- package/dist/{CurrencyConverter-C4KCZWUM.js → CurrencyConverter-7FPB7WJE.js} +10 -10
- package/dist/{Files-VFRXPQLV.js → Files-DHTF6LGF.js} +59 -59
- package/dist/{Notepad-S5JMXH2O.js → Notepad-KS37VSPL.js} +9 -9
- package/dist/{PdfViewer-AIAVQYZ6.js → PdfViewer-KS2BCFSA.js} +1 -1
- package/dist/PomodoroTimer-TYSJOYDJ.js +91 -0
- package/dist/{Preview-HTFTEL7K.js → Preview-NXCA3X4S.js} +28 -28
- package/dist/Sidebar-IU4EG3D3.js +44 -0
- package/dist/{Stock-LIOPTQG5.js → Stock-Y74YC25V.js} +3 -3
- package/dist/{Weather-K3BVAFRV.js → Weather-EO4LYAPA.js} +22 -22
- package/dist/{WorldClock-RHAHXLW4.js → WorldClock-3E3KLHSD.js} +7 -7
- package/dist/ai/index.js +37 -37
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.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-LFUXWZV7.js → chunk-2EBHJGMM.js} +1 -1
- package/dist/chunk-37FQVY2O.js +2 -0
- package/dist/{chunk-VHBRVW5O.js → chunk-3OK5VZOU.js} +3 -3
- package/dist/{chunk-UYM7562M.js → chunk-43YU7YWL.js} +2 -2
- package/dist/{chunk-XYVFJLAU.js → chunk-452LT77I.js} +1 -1
- package/dist/chunk-4YH7U7WL.js +1 -0
- package/dist/{chunk-KERCZSIA.js → chunk-54WCVNJJ.js} +1 -1
- package/dist/{chunk-OK2J6WSC.js → chunk-6ZQC6XFU.js} +1 -1
- package/dist/{chunk-A3RD7AQ2.js → chunk-7AF5JGRM.js} +1 -1
- package/dist/{chunk-RIA6KKIB.js → chunk-7EPCBDS5.js} +6 -6
- package/dist/{chunk-4NTAZLT3.js → chunk-7KUHILEA.js} +3 -3
- package/dist/chunk-ATTQTQJI.js +14 -0
- package/dist/chunk-AYTGYEOI.js +8 -0
- package/dist/{chunk-S6C7X6CR.js → chunk-AZANUXJT.js} +16 -16
- package/dist/{chunk-QSFQTMWV.js → chunk-BGLUOC7W.js} +1 -1
- package/dist/{chunk-D7MRZZVV.js → chunk-BYTQRQ5P.js} +1 -1
- package/dist/{chunk-DVKOVZJ2.js → chunk-DFI5EHSV.js} +12 -12
- package/dist/{chunk-GUUBFQ6L.js → chunk-DYJQIZX2.js} +2 -2
- package/dist/{chunk-KTI4ZJVX.js → chunk-GNB6KUCT.js} +1 -1
- package/dist/chunk-GURLMAZM.js +3 -0
- package/dist/{chunk-YFVQKS5U.js → chunk-GYY7GS2I.js} +1 -1
- package/dist/{chunk-GUOAPXUY.js → chunk-GZ57F6PN.js} +4 -4
- package/dist/{chunk-EA423N2F.js → chunk-HPDNKHIO.js} +2 -2
- package/dist/chunk-IDH323EU.js +6 -0
- package/dist/{chunk-5OXQ5M5S.js → chunk-JKO4JZPO.js} +1 -1
- package/dist/{chunk-YEDAXZYO.js → chunk-JU6VBLTU.js} +1 -1
- package/dist/{chunk-ZVKUOJNS.js → chunk-JUGRSO5J.js} +1 -1
- package/dist/{chunk-PCNFY6EK.js → chunk-LH7ZKPHJ.js} +12 -12
- package/dist/{chunk-5QHNDAZ6.js → chunk-LLXI57MB.js} +1 -1
- package/dist/chunk-LRASKGEZ.js +4 -0
- package/dist/chunk-LYGIOJ3J.js +1 -0
- package/dist/{chunk-V62FEHS4.js → chunk-MDXZ7YAC.js} +1 -1
- package/dist/{chunk-62UNBUTU.js → chunk-NO5BMPT5.js} +1 -1
- package/dist/{chunk-3AVXNZY5.js → chunk-NPBRNEMR.js} +1 -1
- package/dist/{chunk-WGDVYCQX.js → chunk-OHRKENEP.js} +21 -21
- package/dist/{chunk-JRKD7SD3.js → chunk-OLXUMB2V.js} +16 -16
- package/dist/chunk-ONUNFTZD.js +11 -0
- package/dist/{chunk-KIIZNION.js → chunk-OX7Q5PPR.js} +5 -5
- package/dist/{chunk-ASNRA3ZL.js → chunk-P7X4PWJJ.js} +1 -1
- package/dist/chunk-PLJB4H3G.js +1 -0
- package/dist/{chunk-UMIRPFQJ.js → chunk-QD7IODP2.js} +1 -1
- package/dist/{chunk-NM7U42KL.js → chunk-QO2CN2ND.js} +8 -8
- package/dist/{chunk-QSOBETAI.js → chunk-QY2DGLCJ.js} +6 -6
- package/dist/chunk-R7OZ2AQD.js +6 -0
- package/dist/{chunk-U7PA4KNZ.js → chunk-RBOGLXMV.js} +8 -8
- package/dist/{chunk-OEWBWKKD.js → chunk-SWH3IEUT.js} +9 -9
- package/dist/{chunk-LGVVXYW7.js → chunk-SYASK4QG.js} +1 -1
- package/dist/{chunk-YXMXATYP.js → chunk-THVE54FN.js} +1 -1
- package/dist/{chunk-TEYG2W7A.js → chunk-TM5NQTFA.js} +2 -2
- package/dist/{chunk-FQ3SYDKI.js → chunk-US7F3NC3.js} +1 -1
- package/dist/{chunk-XZKVGJIB.js → chunk-V77UETV3.js} +1 -1
- package/dist/{chunk-I2NVBDKH.js → chunk-VLT4ZEHT.js} +1 -1
- package/dist/chunk-WUNZBM53.js +28 -0
- package/dist/{chunk-GD5NGS6D.js → chunk-XNPCOWOO.js} +45 -45
- package/dist/{chunk-EULBBS5L.js → chunk-XOEYCDWT.js} +1 -1
- package/dist/{chunk-QJ3X2PHY.js → chunk-YCA2XXAB.js} +1 -1
- package/dist/{chunk-AKEED2BC.js → chunk-YQKNRT7L.js} +1 -1
- package/dist/{chunk-QYOIS4BN.js → chunk-ZKWAWQ74.js} +3 -3
- package/dist/{chunk-RRWQBWLW.js → chunk-ZV2ZAHZV.js} +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.d.ts +1 -0
- package/dist/forms/Button.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/DateRangePicker.js +1 -1
- package/dist/forms/IconButton.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/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SearchInput.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/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/buttonStyles.d.ts +8 -1
- package/dist/forms/buttonStyles.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +172 -172
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.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/Popover.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/toast.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/ErrorBoundary.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/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/PomodoroTimer-BGTCWT53.js +0 -91
- package/dist/Sidebar-KAALEIIX.js +0 -44
- package/dist/chunk-345FP3IX.js +0 -4
- package/dist/chunk-5RCKE4X2.js +0 -6
- package/dist/chunk-6FOLK4HD.js +0 -1
- package/dist/chunk-A4ROXNUF.js +0 -2
- package/dist/chunk-APFDZ2HG.js +0 -1
- package/dist/chunk-DEV3ZHPP.js +0 -8
- package/dist/chunk-E4WVF6AS.js +0 -28
- package/dist/chunk-MQNSKFZY.js +0 -11
- package/dist/chunk-OHPDB4UN.js +0 -14
- package/dist/chunk-QXEZBS3H.js +0 -6
- package/dist/chunk-R6YVKP6D.js +0 -3
- package/dist/chunk-UQYNPYF4.js +0 -1
- /package/dist/{chunk-TEQ5ZPAL.js → chunk-NQWORKZD.js} +0 -0
package/dist/charts/FlowChart.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{DEFAULT_FLOW_CHART_LABELS,FlowChart as default,flowDescription,flowFileName}from"../chunk-
|
|
2
|
+
export{DEFAULT_FLOW_CHART_LABELS,FlowChart as default,flowDescription,flowFileName}from"../chunk-2EBHJGMM.js";import"../chunk-FAERBT6Y.js";import"../chunk-37FQVY2O.js";import"../chunk-TSZPGDU3.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-CIZAUBWA.js";import"../chunk-PGN5ME7B.js";import"../chunk-5QRHQCRG.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-3FININUU.js";import"../chunk-LYGIOJ3J.js";import"../chunk-MRJKZWWV.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-37FQVY2O.js";import{Icon as n}from"./chunk-ISVODSRP.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:[
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isAriaDisabled as e,swallowPress as a,describedByWith as r,OffWithReason as i}from"./chunk-TSZPGDU3.js";import{SpinnerRing as s}from"./chunk-R2VKEMZH.js";import{useRowControlSize as l}from"./chunk-3FININUU.js";import{buttonClasses as d}from"./chunk-LYGIOJ3J.js";import{forwardRef as n,useId as o}from"react";import{jsxs as t,jsx as c}from"react/jsx-runtime";var m=n(function({variant:n="primary",size:m="md",loading:p=!1,leftIcon:b,rightIcon:f,block:u=!1,disabled:h,type:k="button",children:x,className:N="",disabledReason:y,onClick:j,pressed:v,"aria-disabled":I,"aria-describedby":g,...U},w){const z=l(m)??"md",C=o(),G=h||p,J=null!=y&&""!==y,R=G&&J,Z=!G&&e(I),D=Z&&J,E=R||D?C:void 0,F=/* @__PURE__ */t("button",{ref:w,type:k,disabled:G,"aria-busy":p||void 0,"aria-disabled":!!Z||I,"aria-describedby":r(g,E),onClick:Z?a:j,className:d({variant:n,size:z,block:u,pressed:v??(!0===U["aria-pressed"]||"true"===U["aria-pressed"]),className:N}),...U,children:[p?/* @__PURE__ */c(s,{className:"h-3.5 w-3.5",ink:""}):b,x,!p&&f]});return D?/* @__PURE__ */c(i,{reason:y,id:C,block:u,children:F}):R?/* @__PURE__ */t("span",{className:u?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[F,
|
|
2
|
+
/* @__PURE__ */c("span",{id:E,className:"text-xs text-red-600",children:y})]}):F});export{m as Button_default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{MediaUploadField as e}from"./chunk-KJ4CHRRC.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-
|
|
1
|
+
import{MediaUploadField as e}from"./chunk-KJ4CHRRC.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-37FQVY2O.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[R,L]=l(null),[U,C]=l(""),[H,F]=l(""),[I,O]=l(!1),[A,G]=l(!1),B=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),E=t().brandAsset,P=U||d||g||"",S=R?null:d?o:h,$=R?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const z=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
|
|
2
2
|
return n("section",{"aria-label":E.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
4
|
-
/* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;z();const r=URL.createObjectURL(e);
|
|
4
|
+
/* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;z();const r=URL.createObjectURL(e);j.current=r,L(e),C(r),F("")},label:p,hint:H||E.usedFor(b),error:H||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:I||A,disabled:k}),
|
|
5
5
|
/* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
6
|
-
/* @__PURE__ */c(a,{onClick:async()=>{if(
|
|
6
|
+
/* @__PURE__ */c(a,{onClick:async()=>{if(R&&!k&&!I){O(!0),F("");try{await x(R),z(),L(null),C("")}catch(e){F(e instanceof Error?e.message:E.saveFailed(B,p))}finally{O(!1)}}},disabled:!R||k,loading:I,children:E.save(B,p)}),(R||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!A){if(R)return z(),L(null),C(""),void F("");if(d){G(!0),F("");try{await f()}catch(e){F(e instanceof Error?e.message:E.removeFailed(B,p))}finally{G(!1)}}}},disabled:k,loading:A,children:R?E.discard:E.remove(B,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":E.previews(p),children:[
|
|
7
7
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:E.preview}),
|
|
8
8
|
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:P,alt:E.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:$,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
9
9
|
return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CloseGlyph as e}from"./chunk-TAIH2VIW.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-
|
|
1
|
+
import{CloseGlyph as e}from"./chunk-TAIH2VIW.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-4YH7U7WL.js";import{Button_default as s}from"./chunk-37FQVY2O.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-NRHG4R2Q.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|
|
@@ -6,7 +6,7 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
|
|
|
6
6
|
return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
|
|
7
7
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:n.name,children:n.name}),
|
|
8
8
|
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:t(n.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(n.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${n.name}-${n.size}-${s}`)})})}function b({onClick:e,count:t=0,variant:n="button",label:r,disabled:i=!1}){const l=c().files,o=r??l.attach,p=t>0?`${o} (${t})`:o;return"icon"===n?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
|
|
9
|
-
/* @__PURE__ */d(a,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),t>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:
|
|
9
|
+
/* @__PURE__ */d(a,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),t>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=n({accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
|
|
10
10
|
/* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
|
|
11
11
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
12
12
|
/* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toast_default as t}from"./chunk-
|
|
1
|
+
import{toast_default as t}from"./chunk-VLT4ZEHT.js";import{currentShellStrings as e}from"./chunk-NRHG4R2Q.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isAriaDisabled as e,swallowPress as r,describedByWith as i,OffWithReason as a}from"./chunk-TSZPGDU3.js";import{useRowControlSize as s}from"./chunk-3FININUU.js";import{iconButtonClasses as d}from"./chunk-LYGIOJ3J.js";import{forwardRef as o,useId as n}from"react";import{jsx as t}from"react/jsx-runtime";var c=o(function({children:o,variant:c="ghost",size:l="md",type:m="button",className:p="",pressed:b,disabledReason:u,ink:f,disabled:h,onClick:k,"aria-disabled":v,"aria-describedby":N,...j},y){const I=s(l)??"md",U=n(),x=(Boolean(h)||e(v))&&null!=u&&""!==u,z=x||e(v),C=/* @__PURE__ */t("button",{ref:y,type:m,className:d({variant:c,size:I,pressed:b??(!0===j["aria-pressed"]||"true"===j["aria-pressed"]),ink:f,className:p}),...j,disabled:x?void 0:h,"aria-disabled":!!z||v,"aria-describedby":i(N,x?U:void 0),onClick:z?r:k,children:o});return x?/* @__PURE__ */t(a,{reason:u,id:U,children:C}):C});export{c as IconButton_default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-37FQVY2O.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-BYTQRQ5P.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{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-W7HTHKN2.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-W7HTHKN2.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-BYTQRQ5P.js";import{Button_default as s}from"./chunk-37FQVY2O.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:[
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(
|
|
3
|
-
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:
|
|
4
|
-
/* @__PURE__ */f(n,{content:xe?.cut?me: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__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp
|
|
5
|
-
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-TM5NQTFA.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-CIZAUBWA.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(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"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var F=o(null);function z({children:e}){const[t,n]=l({}),r=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}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
|
|
2
|
+
return f(F.Provider,{value:i,children:e})}function N({value:o,onChange:a,min:y,max:z,step:N=1,shiftStep:k,precision:L,inputMin:R,inputMax:j,suffix:C,units:E,onCommit:M,showInput:$=!0,emptyLabel:A,placeholderValue:B,stepFrom:K,label:W,"aria-labelledby":O,valueText:P,id:U,disabled:V,size:q="md",boxSize:D="sm",className:H="",auto:T}){const G=i(),I=u(),Q=s(o);r(()=>{Q.current=o},[o]);const J=s(o),Z=e=>{Q.current=e,a(e)},X=()=>{J.current=Q.current},Y=()=>{M&&Q.current!==J.current&&(J.current=Q.current,M(Q.current))},_=s(null),ee=s(Y);ee.current=Y;const te=Boolean(M);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=T??ne,ie=u(),oe=U??I,le=L??h(N),ae=R??y,ue=j??z,se=void 0!==A||void 0!==B,ce=K??B,de=p(o??B??y,y,z),fe=[y.toFixed(le),z.toFixed(le),o?.toFixed(le),A,B?.toFixed(le)],me=null!=o?o.toFixed(le):A||(null!=B?B.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(C);r(()=>{if(!$)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=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,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(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=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,$,D]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>P?P(e):"string"==typeof C?`${e.toFixed(le)} ${C}`:void 0,we=null==o?A??(null!=B?ye(B)??String(B):void 0):ye(o),Se=x[D],Fe=fe.filter(e=>Boolean(e)),ze=void 0===me?-1:Fe.indexOf(me),Ne=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,ke=d(F),Le=u(),Re=ke?.set;return r(()=>{Re&&Re(Le,$?Ne:null)},[Re,Le,Ne,$]),c(()=>()=>Re?.(Le,null),[Re,Le]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${H}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:N,value:de,disabled:V,"aria-label":O?void 0:W,"aria-labelledby":O,"aria-valuetext":we,"aria-describedby":re?ie: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!=k;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();Z(S((o??ce??de)+t*(n?k??N:N),y,z,le)),Y()},ref:_,onFocus:M&&X,onPointerDown:M&&X,onChange:e=>Z(S(Number(e.target.value),y,z,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===q?"h-1":"h-1.5")}),$&&
|
|
4
|
+
/* @__PURE__ */f(n,{content:xe?.cut?me: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__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:M&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&Y()}),onFocus:M&&X,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:ke?.width??Ne,...xe?{fontSize:xe.fontSize}:{}},children:[
|
|
5
|
+
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:Fe.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===ze?"":void 0,style:g,children:e},t))}),
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||Z(e):se&&Z(null)},min:ae,max:ue,step:N,shiftStep:k,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:C,units:E,onBlur:M&&Y,disabled:V,placeholder:A??(null!=B?B.toFixed(le):void 0),size:D,auto:re,"aria-label":W?G.slider.value(W):void 0,"aria-labelledby":W?void 0:O})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:G.settingView.auto})]})}export{N as Slider,z as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{IconPicker as e}from"./chunk-
|
|
2
|
-
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[C("left",w.sides.left,u.left,
|
|
3
|
-
/* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{
|
|
1
|
+
import{IconPicker as e}from"./chunk-ZKWAWQ74.js";import{ColorPicker as t}from"./chunk-LH7ZKPHJ.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-TM5NQTFA.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j,units:S}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},C=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,units:S,"aria-label":t})}),H=d.map(k),T="number"==typeof m.width?m.width:H.every(e=>null!==e&&e===H[0])?H[0]:null,W=null===T&&H.some(e=>null!==e),A=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",I=e=>k(e)??("number"==typeof m.width?m.width:null),J=m.style??f.style;/* @__PURE__ */
|
|
2
|
+
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[C("left",w.sides.left,u.left,I("left"),String(f.sides.left),e=>O("left",e)),C("top",w.sides.top,u.top,I("top"),String(f.sides.top),e=>O("top",e)),C("right",w.sides.right,u.right,I("right"),String(f.sides.right),e=>O("right",e)),C("bottom",w.sides.bottom,u.bottom,I("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):C("all",w.width,u.all,T,W?"–":A,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:J,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
|
|
3
|
+
/* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-DFI5EHSV.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-W7HTHKN2.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-BYTQRQ5P.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-37FQVY2O.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-NRHG4R2Q.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:E}=t,T=void 0!==t.onApply,$=u().link,z=y.isSafe??k,A=d(),D=c(null),Q=c(null),[R,Y]=p({url:n}),H=T?R.url:n,[P,S]=p(!1),[K,U]=p(null),[V,W]=p(null),[B,M]=p(!1),G=c(null),I=c(()=>{});I.current=T?t.onCancel:()=>{},m(()=>{if(T)return s(e=>{const a=D.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(I.current(),!0)},()=>D.current)},[T]),m(()=>{if(!T)return;const e=Q.current;e?(e.focus(),e.select()):D.current?.querySelector("button, input")?.focus()},[]);const L=o??[{value:b,label:$.address,target:{type:"text"}}],Z=K&&K.against===H?K.kind:y.kindOf(H),q=L.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===Z),X=q.find(e=>"text"===e.target.type),J=q.find(e=>e.value===Z)??X??q[0];if(!J)return null;const _="text"!==J.target.type,ee=_?y.targetOf(H):H,ae=h(J.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:$.unavailable(e)}),re="select"===J.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(H):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=V&&V.against===H?V.text:H,se=_?H:j?j(oe.trim()).trim():oe.trim(),ue=T&&j?se:oe,de=!_&&""!==ue.trim()&&!z(ue),ce=de&&(!T||P);_&&B&&M(!1);const pe=(e,a)=>{T?Y({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{U(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{S(!1);const a=e.trim();a?z(e)?(W({text:e,against:a}),me(a)):W({text:e,against:H}):(W({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===Q.current||G.current?.contains(a)))return;if(M(!1),T||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!T||!se)return;if(!_&&de)return void S(!0);const e=_&&R.url===se?R.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
+
return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
+
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===J.target.type)ke=/* @__PURE__ */f(r,{ref:Q,id:`${A}-address`,size:"sm",type:"text",invalid:ce,"aria-label":$.address,"aria-describedby":ce?`${A}-why`:void 0,placeholder:F??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>M(!0),onBlur:ge,onKeyDown:j&&!T?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===J.target.type?J.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):J.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:J.target.placeholder},...be(e,ee)];ke=xe(J.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe($.linkType,J.value,q.map(e=>({value:e.value,label:e.label})),e=>{W(null),S(!1);const a=q.find(a=>a.value===e);if(!a||"text"===a.target.type)return void U({kind:e,against:H});const l=h(a.target)[0];U({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&B&&!C&&"text"===J.target.type&&/* @__PURE__ */f("div",{ref:G,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe($.filter,ne?.param??"",[{value:"",label:$.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe($.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${A}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),J.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:J.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!T)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:D,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:D,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${A}-address`,className:a({inline:!0}),children:$.title}),ye,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:$.remove}):null,
|
|
7
|
+
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>I.current(),children:$.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
|
+
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
+
/* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
+
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
+
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as i,usePopupLevel as r,usePopupLevelBindings as t,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as a}from"./chunk-CJ4OEY3T.js";import{CloseButton as d}from"./chunk-LLXI57MB.js";import{useDiscardGuard as s}from"./chunk-NQWORKZD.js";import{dialogA11y as c}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as m}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as p,useScrollLock as u}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as h,DESCRIPTION_TEXT as f,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{createShellPortal as v}from"./chunk-5QRHQCRG.js";import{useHydrated as y}from"./chunk-KEFNQEXZ.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useRef as k,useId as N,useState as j,useEffect as w}from"react";import{jsxs as g,Fragment as C,jsx as Q}from"react/jsx-runtime";function W({open:W,onClose:Z,side:B="bottom",title:D,description:E,footer:H,children:Y,blocking:$=!1,dirty:G=!1,initialFocus:J,"aria-label":O,"aria-labelledby":R,"aria-describedby":T,className:U=""}){const F=k(null),I=N(),K=N(),L=N(),V=e(y()),[X,z]=j(null),A=s({open:W,dirty:G,onClose:Z,title:D,layer:X}),M=k(null),q=i(W&&null!==V,M),P=r(W&&null!==V,M),S=t(P,X),_=o(P),ee=null!==P.host;if(m(W),p(F,W&&null!==V,J,S),u(W),w(()=>{if(W)return x(()=>!S.current?.(document.activeElement)&&($||A(),!0),()=>F.current)},[W,$,A,S]),!W||!V)return null;const ie={maxHeight:"85vh",...q?(re=q,{left:re.left,width:re.width,bottom:window.innerHeight-(re.top+re.height)}):{}};var re;/* @__PURE__ */
|
|
2
|
+
return g(C,{children:[/* @__PURE__ */Q("span",{ref:M,hidden:!0,"data-popup-anchor":""}),v(
|
|
3
|
+
/* @__PURE__ */Q(n,{value:X,children:/* @__PURE__ */g("div",{ref:z,className:ee?"fixed inset-0 pointer-events-none":"fixed inset-0",style:a(P),role:"presentation","data-overlay-layer":"",children:[
|
|
4
|
+
/* @__PURE__ */Q("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(ee?"pointer-events-auto"+(l(P)?" rounded-(--radius-window)":""):"inset-0"),style:_??void 0,hidden:ee&&!_,onClick:$?void 0:A,"aria-hidden":"true","data-popup-scrim":ee?"window":"system"}),
|
|
5
|
+
/* @__PURE__ */g("div",{ref:F,...c({modal:!0,titleId:D?L:void 0,labelledBy:R,label:O}),"aria-describedby":T??(E?K:Y?I:void 0),"data-drawer-side":B,"data-popup-panel":"",style:ie,className:[`fixed flex flex-col ${b}`,ee?"pointer-events-auto":"",q?"":"inset-x-0 bottom-0","rounded-t-xl",U].filter(Boolean).join(" "),children:[D?/* @__PURE__ */g("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
|
+
/* @__PURE__ */g("div",{className:"min-w-0",children:[
|
|
7
|
+
/* @__PURE__ */Q("h2",{id:L,className:h,children:D}),E&&/* @__PURE__ */Q("p",{id:K,className:`mt-0.5 ${f}`,children:E})]}),!$&&/* @__PURE__ */Q(d,{onClose:A})]}):!$&&/* @__PURE__ */Q("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */Q(d,{onClose:A})}),
|
|
8
|
+
/* @__PURE__ */g("div",{id:I,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[E&&!D&&/* @__PURE__ */Q("p",{id:K,className:`mb-3 ${f} ${$?"":"pr-8"}`.trim(),children:E}),Y]}),H&&/* @__PURE__ */Q("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:H})]})]})}),V)]})}export{W as Drawer};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-PPHGBEJA.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-
|
|
2
|
-
/* @__PURE__ */H("button",{type:"button",onClick:()=>se("Custom"),className:
|
|
3
|
-
/* @__PURE__ */H(e,{mode:"range",min:
|
|
4
|
-
return W("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */W("div",{className:`relative ${
|
|
6
|
-
/* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{U||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),He(d?d.slice(0,7):
|
|
1
|
+
import{Calendar as e}from"./chunk-PPHGBEJA.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-BYTQRQ5P.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{createShellPortal as g}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as b}from"./chunk-62LW225J.js";import{useDropdownPosition as x}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as v}from"./chunk-PU2GJVMG.js";import{buttonClasses as y}from"./chunk-LYGIOJ3J.js";import{glassStyle as w}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N,useShellLocale as k}from"./chunk-NRHG4R2Q.js";import{useState as C,useRef as j,useId as M,useEffect as D}from"react";import{jsxs as W,Fragment as $,jsx as H}from"react/jsx-runtime";var R=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=d;function F(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function G(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function S(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var O=/* @__PURE__ */new Map;function P({from:d,to:u,onChange:h,formatDisplay:Y,clearable:P,required:T=!1,name:I,id:J,"aria-labelledby":L,"aria-label":Q,weekStartsOn:A,placeholder:B,fullWidth:E=!1,min:V,max:q,disabled:U=!1,allowOpenEnd:Z=!1}){const K=N().dateRange,z=k(),X=Y??(z?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 r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(z):S),_=B??K.placeholder,ee=P??!T,[te,re]=C(!1),[ne,ae]=C(d),[oe,ie]=C(u),[le,se]=C(null),[ce,de]=C("from"),me=j(null),ue=j(null),he=j(null),pe=M(),fe=M(),ge=M(),[be,xe]=C(!1),ve=x(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=j(null),we=j(null),[Ne,ke]=C(!0);v(()=>{const e=we.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==Ne&&ke(o)});const Ce=j(null);v(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[je,Me]=C(!1);v(()=>{const e=!!J&&(ue.current?.labels?.length??0)>0;e!==je&&Me(e)});const De=!!Q||!!L||je,We=m(s())??/* @__PURE__ */new Date(0),[$e,He]=C(()=>d?d.slice(0,7):G(We,V,q)),Re=R.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,We),V,q)),Ye=e=>e?X(e):"";D(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),D(()=>{U&&re(!1)},[U]);const Fe=()=>{h("",""),re(!1)},Ge=ee&&!U&&Boolean(d||u),Se=d&&u?`${Ye(d)} — ${Ye(u)}`:d?K.fromOnly(Ye(d)):u?K.toOnly(Ye(u)):"",Oe=c(z),Pe=e=>{const t=m(e);return t?Oe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Te=d&&u?K.range(Pe(d),Pe(u)):d?K.fromOnly(Pe(d)):u?K.toOnly(Pe(u)):_,Ie=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===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 "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Je=/* @__PURE__ */W($,{children:[Re.map(e=>/* @__PURE__ */H("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,We);ae(t.from),ie(t.to),se(e),He(t.from.slice(0,7))})(e),className:Ie(e),"aria-label":be?K[e]:void 0,children:be?Ne?K[e]:K[`${e}Short`]:K[e]},e)),
|
|
2
|
+
/* @__PURE__ */H("button",{type:"button",onClick:()=>se("Custom"),className:Ie("Custom"),children:K.custom})]}),Le=(e,t)=>Z?/* @__PURE__ */H("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */H("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Qe=e=>Z&&ce===e?" ring-1 ring-blue-400":"",Ae=
|
|
3
|
+
/* @__PURE__ */H(e,{mode:"range",min:V,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:He,onSelect:e=>{se("Custom"),Z?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:A,"aria-label":K.dialog});/* @__PURE__ */
|
|
4
|
+
return W("div",{className:"relative"+(E?" w-full":""),ref:me,children:[
|
|
5
|
+
/* @__PURE__ */W("div",{className:`relative ${E?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Ge?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${U?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{U||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),He(d?d.slice(0,7):G(We,V,q)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:J,disabled:U||void 0,"aria-label":Q,"aria-labelledby":L,"aria-describedby":[De?fe:void 0,T?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(E?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */H(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */H("span",{className:"truncate",children:
|
|
9
|
-
/* @__PURE__ */H("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */H("input",{type:"hidden",name:
|
|
8
|
+
/* @__PURE__ */H("span",{className:"truncate",children:Se||_})]}),Ge&&/* @__PURE__ */H(n,{children:/* @__PURE__ */H(a,{action:{label:K.clearRange,icon:/* @__PURE__ */H(p,{name:"close"}),onClick:Fe}})})]}),De&&/* @__PURE__ */H("span",{id:fe,className:"sr-only",children:Te}),T&&/* @__PURE__ */H("span",{id:ge,className:"sr-only",children:K.required}),I&&/* @__PURE__ */W($,{children:[
|
|
9
|
+
/* @__PURE__ */H("input",{type:"hidden",name:I.from,value:d,disabled:U||void 0}),
|
|
10
|
+
/* @__PURE__ */H("input",{type:"hidden",name:I.to,value:u,disabled:U||void 0})]}),te&&g(
|
|
11
11
|
/* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":K.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:b.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...w()},children:[
|
|
12
|
-
/* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
12
|
+
/* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Le("from",/* @__PURE__ */W($,{children:[
|
|
13
13
|
/* @__PURE__ */H("span",{className:"text-xs font-medium text-gray-500",children:K.from}),
|
|
14
|
-
/* @__PURE__ */H("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"}${
|
|
14
|
+
/* @__PURE__ */H("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"}${Qe("from")}`,children:ne?Ye(ne):K.start})]})),!be&&/* @__PURE__ */H("span",{className:"text-gray-300",children:"—"}),Le("to",/* @__PURE__ */W($,{children:[
|
|
15
15
|
/* @__PURE__ */H("span",{className:"text-xs font-medium text-gray-500",children:K.to}),
|
|
16
|
-
/* @__PURE__ */H("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
17
|
-
/* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
18
|
-
/* @__PURE__ */H("div",{className:"w-full",children:
|
|
16
|
+
/* @__PURE__ */H("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Qe("to")}`,children:oe?Ye(oe):K.end})]}))]}),be?/* @__PURE__ */W($,{children:[Re.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!Ne&&/* @__PURE__ */H("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:K.lastHeading}),
|
|
17
|
+
/* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Je,Re.map(e=>/* @__PURE__ */H("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:K[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */H("div",{className:"w-full",children:Ae})]}):
|
|
19
19
|
/* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */H("div",{className:"w-64",children:
|
|
20
|
+
/* @__PURE__ */H("div",{className:"w-64",children:Ae}),Re.length>0&&/* @__PURE__ */H("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Je})]}),
|
|
21
21
|
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */H("button",{type:"button",onClick:Fe,className:y({variant:"ghost"}),children:K.clear}),
|
|
22
22
|
/* @__PURE__ */H("button",{type:"button",onClick:()=>re(!1),className:y({variant:"secondary"}),children:K.cancel}),
|
|
23
|
-
/* @__PURE__ */H("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:
|
|
23
|
+
/* @__PURE__ */H("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:Z?!ne&&!oe:!ne||!oe,className:y({variant:"primary"}),children:K.apply})]})]}),document.body)]})}export{P as DateRangePicker,F as presetRange,Y as toISODate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-OSMRYND3.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-OSMRYND3.js";import{Button_default as t}from"./chunk-37FQVY2O.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{inputClasses as r,PLACEHOLDER_INK as e}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-NJY4HPNB.js";import{IconButton_default as t}from"./chunk-
|
|
1
|
+
import{inputClasses as r,PLACEHOLDER_INK as e}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-NJY4HPNB.js";import{IconButton_default as t}from"./chunk-4YH7U7WL.js";import{Tooltip as i}from"./chunk-CIZAUBWA.js";import{useRowControlSize as a}from"./chunk-3FININUU.js";import{iconButtonClasses as s}from"./chunk-LYGIOJ3J.js";import{forwardRef as o}from"react";import{jsx as l,jsxs as c}from"react/jsx-runtime";var m={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},p={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function d({children:r}){/* @__PURE__ */
|
|
2
2
|
return l("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:r})}function u({action:r,size:e="md"}){/* @__PURE__ */
|
|
3
3
|
return l(f,{action:r,size:m[e]})}var h=["","pr-8","pr-16"];function f({action:r,size:e}){const{label:a,icon:o,onClick:c,menu:m}=r;/* @__PURE__ */
|
|
4
4
|
return l(i,{content:a,describe:!1,children:m?/* @__PURE__ */l(n,{"aria-label":a,trigger:o,items:m,triggerClassName:s({size:e})}):/* @__PURE__ */l(t,{"aria-label":a,size:e,onClick:c,children:o})})}var N=o(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:s,size:o,className:m="",readOnly:h,...f},N){const g=a(o),v=g??"md",j=`${t?"pl-10":""} ${s?p[v]:i?"pr-10":""}`.trim(),k=
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-GML6FVPA.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */A("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */A("span",{ref:
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */A(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */A(p,{name:"close"}),onClick:()=>{ie([]),
|
|
6
|
-
/* @__PURE__ */
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-GML6FVPA.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-BYTQRQ5P.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-37FQVY2O.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-CIZAUBWA.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{createShellPortal as g}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as v}from"./chunk-62LW225J.js";import{useDropdownPosition as w,MENU_MAX_HEIGHT as y}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as x}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as k}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as j,glassStyle as $}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N}from"./chunk-NRHG4R2Q.js";import{useState as D,useId as C,useRef as R,useMemo as S,useEffect as W}from"react";import{jsxs as M,jsx as A}from"react/jsx-runtime";function F(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var E=["right-2","right-8","right-16"],H=[8,32,64];function T(T){const{options:z,placeholder:L,emptyOptionLabel:O,className:G="",disabled:Q,id:Y,filter:I=!1,allowFreeText:U=!1,freeTextOption:V,onSearchChange:B,loading:P=!1,error:Z,onRetry:J,rightAdornment:K,endAction:X,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=T,re=!0===T.multiple,le=T.multiple?T.value:T.value?[T.value]:[],oe=T.multiple?"":T.value,ie=e=>{T.multiple?T.onChange(e):T.onChange(e[0]??"")},ae=le.length>0,se=I&&ae&&!Q,ce=re||I,ue=null!=V,de=U||ue,[he,pe]=D(!1),[me,fe]=D(-1),be=C(),ge=Y??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=D(""),ke=N(),je=O??ke.select.none,$e=e=>{xe(e),fe(-1),B?.(e)},Ne=R(null),De=R(null),Ce=R(null),Re=R(null),Se=R(he);Se.current=he;const We=R(!1),Me=e=>{Se.current&&(Se.current=!1,e&&U&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),$e(""))},Ae=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?$e(""):fe(t));ie([e.value]),Me(!1)}},[Fe,Ee]=D(null);x(()=>{if(!K||he)return void Ee(null);const e=Re.current?.offsetWidth??0;Ee(e?e+H[Qe]+6:null)});const He=w(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),Te=S(()=>t(z),[z]),ze=le.join("\0"),Le=S(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Te)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Te,ze,de]),Oe=Le.join(", "),Ge=_&&ae&&!Q,Qe=(Ge?1:0)+(X?1:0),[Ye,Ie]=D(null),Ue=R(null),Ve=R(""),Be=R(()=>{});Be.current=()=>{const e=De.current,t=Ue.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Le.join("\0")}`;if(o===Ve.current)return;Ve.current=o;let i=null;r>0&&Le.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=F(Le,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ie(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},x(()=>{Be.current()}),W(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Be.current());return t.observe(e),()=>t.disconnect()},[re]);const Pe=Le.length,Ze=!re||!Ye||Ye.shown>=Pe?Oe:0===Ye.shown?ke.select.selectedCount(Pe):`${Le.slice(0,Ye.shown).join(", ")} +${Pe-Ye.shown}`,Je=re&&null!==Ye&&(Ye.shown<Pe||Ye.cut),Ke=he&&ae&&ce;W(()=>{if(!he)return;const e=e=>{const t=e.target;Ne.current?.contains(t)||Ce.current?.contains(t)||Me(!0)};document.addEventListener("mousedown",e);const t=b(()=>Me(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,U,ye,ze,T.onChange]),W(()=>{if(he)return k(e=>!("Escape"!==e.key||!Se.current)&&(Me(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Xe=S(()=>{const e=/* @__PURE__ */new Set;return n(z,t=>!e.has(t.value)&&(e.add(t.value),!0))},[z]),qe=S(()=>{if(B)return Xe;const e=ye.trim().toLowerCase();return e?n(Xe,t=>r(t,e)):Xe},[Xe,ye,B]),_e=S(()=>t(qe),[qe]),et=ye.trim(),tt=S(()=>ue&&et?Te.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Te,ze]),nt=S(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
|
|
2
|
+
return M("div",{ref:Ne,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Ne.current?.contains(t)||Ce.current?.contains(t))||We.current||document.activeElement!==De.current&&Me(!0)},children:[(rt=/* @__PURE__ */A("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Ze,onChange:e=>{$e(e.target.value),pe(!0)},onFocus:()=>{Q||($e(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(Q)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Ae(nt[me],me):1!==_e.length||_e[0].disabled?U&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),$e("")):(ie([et]),Me(!1),De.current?.blur())):Ae(_e[0],0)):"Escape"===t.key?(Me(!1),De.current?.blur()):"Tab"===t.key&&Me(!0)},placeholder:Ke?Ze:L||je,className:`${se?u:d} ${G} ${a[Qe]}${Q?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Ke?" rosh-field-shows-choice":""}`,style:Fe?{paddingRight:Fe}:void 0,disabled:Q}),re?/* @__PURE__ */A(f,{content:!he&&Je?Oe:null,className:"block",children:rt}):rt),re&&
|
|
3
|
+
/* @__PURE__ */A("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */A("span",{ref:Ue,className:"whitespace-pre"})}),Qe>0&&
|
|
4
|
+
/* @__PURE__ */M(s,{children:[Ge&&
|
|
5
|
+
/* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */A(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */A(p,{name:"close"}),onClick:()=>{ie([]),Me(!1)}}})}),X&&/* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */A(c,{action:X})})]}),K&&!he&&/* @__PURE__ */A("div",{ref:Re,className:`absolute top-1/2 -translate-y-1/2 ${E[Qe]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:K}),he&&g(
|
|
6
|
+
/* @__PURE__ */M("div",{ref:Ce,onMouseDownCapture:()=>{We.current=!0,setTimeout(()=>{We.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:v.popup,left:He?.left,right:He?.right,top:He?.top,bottom:He?.bottom,minWidth:He?.minWidth,width:He?.width,...ce&&{maxWidth:He?.maxWidth},visibility:He?void 0:"hidden",...$()},children:[re&&ae&&_&&!Q&&
|
|
7
7
|
/* @__PURE__ */A("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${j}`,children:ke.select.clearAll}),P?
|
|
8
|
-
/* @__PURE__ */A(m,{size:"sm",padding:"py-2",label:ke.search.searching}):
|
|
9
|
-
/* @__PURE__ */A("span",{className:"min-w-0 flex-1",children:
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */A("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */A(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&
|
|
13
|
-
/* @__PURE__ */A("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Ae(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${j}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:
|
|
8
|
+
/* @__PURE__ */A(m,{size:"sm",padding:"py-2",label:ke.search.searching}):Z?/* @__PURE__ */M("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
9
|
+
/* @__PURE__ */A("span",{className:"min-w-0 flex-1",children:Z}),J&&/* @__PURE__ */A(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:J,className:"shrink-0",children:ke.list.retry})]}):null,
|
|
10
|
+
/* @__PURE__ */M("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:He?.maxHeight??y},children:[0===nt.length?P||Z?null:/* @__PURE__ */A("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
|
|
11
|
+
return M("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Ae(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */A(o,{selected:n}),
|
|
12
|
+
/* @__PURE__ */A("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */A(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&V&&
|
|
13
|
+
/* @__PURE__ */A("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Ae(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${j}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:V(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{T as SearchableSelect,F as fitChoice};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-POBVGDZP.js";import{toast_default as n}from"./chunk-
|
|
2
|
-
return(new Date).toISOString()}var
|
|
1
|
+
import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-POBVGDZP.js";import{toast_default as n}from"./chunk-VLT4ZEHT.js";import{useSyncExternalStore as o,useCallback as a,useMemo as r}from"react";var i=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],c=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}];function l(e=/* @__PURE__ */new Date){return t(e)??""}function s(t=/* @__PURE__ */new Date){return`pomodoro-day-${l(t)}`}var u={focus:1500,short:300,long:900},d="bell",f=100,m=1,h="none",g=50,p={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},k={running:!1,remaining:u.focus,mode:"focus",total:u.focus,streak:0,count:"undefined"!=typeof localStorage?function(t=/* @__PURE__ */new Date){const e=l(t);if(!e)return 0;try{const n=localStorage.getItem(s(t)),o=null===n?localStorage.getItem(`pomodoro-${e}`):null;return parseInt(n??o??"0",10)||0}catch{return 0}}():0},w=null,M=/* @__PURE__ */new Set,S=t=>{k={...k,...t},M.forEach(t=>t())};function b(){return k}function y(t){return M.add(t),()=>{M.delete(t)}}function v(t){u=t,k.running||k.remaining!==k.total||S({remaining:t[k.mode],total:t[k.mode]})}function T(t){d=t}function A(t,e){f=Math.max(0,Math.min(100,Math.round(t))),m=Math.max(1,Math.min(5,Math.round(e)))}function I(t){p={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function x(t,e){h=t,g=Math.max(0,Math.min(100,Math.round(e))),k.running&&"focus"===k.mode?(j(),R()):"none"!==t&&0!==g||j()}function B(){k.running||(S({running:!0}),w=setInterval(C,1e3),"focus"===k.mode&&R())}function P(){(k.running||null!==w)&&(null!==w&&(clearInterval(w),w=null),S({running:!1}),j())}function N(t){P(),S({mode:t,remaining:u[t],total:u[t]})}function C(){k.remaining<=1?function(){null!==w&&(clearInterval(w),w=null);j(),D(d,{volume:f,repeat:m});const t="focus"===k.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{n.info(t)}catch{}if("focus"===k.mode){const t=k.streak+1,e=k.count+1;(t=>{try{l()&&localStorage.setItem(s(),String(t))}catch{}})(e);const n=t%p.longBreakInterval===0?"long":"short";S({running:!1,streak:t,count:e,mode:n,remaining:u[n],total:u[n]}),p.autoStartBreaks&&setTimeout(()=>B(),50)}else S({running:!1,mode:"focus",remaining:u.focus,total:u.focus}),p.autoStartPomodoros&&setTimeout(()=>B(),50)}():S({remaining:k.remaining-1})}function D(t=d,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>_(t,n),2500*e)}function _(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var O=null,V={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function G(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!O&&"none"!==h&&0!==g)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=G(e,h);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=g/100*V[h],o.connect(a).connect(e.destination),o.start(),O={ctx:e,src:o,gain:a}}catch{}}function j(){if(O){try{O.src.stop()}catch{}try{O.ctx.close()}catch{}O=null}}function F(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=G(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*V[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var H="pomodoro_tasks",E="pomodoro_tasks_migrated";function L(){return Math.random().toString(36).slice(2,11)}function W(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var Z=null,$=[],q=!1,J=null,K=/* @__PURE__ */new Set;function z(){for(const t of K)t()}function Q(t){$=t,z()}function U(){const t=Z;return t?J=t.list().then(e=>{Z===t&&($=e,q=!0,z())}).catch(()=>{Z===t&&(q=!0,z())}).finally(()=>{J=null}):($=[],q=!0,z(),Promise.resolve())}function X(t){Z=t,$=[],q=!1,t?U():z()}function Y(t){return K.add(t),!Z||q||J||U(),()=>{K.delete(t)}}function tt(){return $}function et(){const t=function(){const{prefs:t,save:n}=e(),o=r(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=a(t=>{n({todo_tasks:t})},[n]),c=a(t=>{const e=L(),n=W(),a={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...o,a]),e},[o,i]),l=a((t,e)=>{i(o.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:W()}:n))},[o,i]),s=a(t=>{i(o.filter(e=>e.id!==t))},[o,i]),u=a(t=>{const e=o.find(e=>e.id===t);e&&l(t,{done:!e.done})},[o,l]);return{tasks:o,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),n=o(Y,tt,tt),i=a(e=>{const n=Z;if(!n)return t.addTask(e);const o="tmp-"+L(),a=W(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return Q([...$,r]),n.create({...e,name:e.name.trim()}).then(t=>Q($.map(e=>e.id===o?{...r,...t}:e))).catch(()=>Q($.filter(t=>t.id!==o))),o},[t]),c=a((e,n)=>{const o=Z;if(!o)return t.updateTask(e,n);Q($.map(t=>t.id===e?{...t,...n,id:e,updatedAt:W()}:t)),o.update(e,n).catch(()=>{U()})},[t]),l=a(e=>{const n=Z;if(!n)return t.removeTask(e);const o=$;Q($.filter(t=>t.id!==e)),n.remove(e).catch(()=>Q(o))},[t]),s=a(e=>{if(!Z)return t.toggleDone(e);const n=$.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=a(e=>{Z||t.setAllTasks(e)},[t]);return null===Z?t:{tasks:n,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function nt(t,e){try{if(localStorage.getItem(E))return;const n=localStorage.getItem(H);if(!n)return void localStorage.setItem(E,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(H),void localStorage.setItem(E,"1");const a=W(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||L(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(H),localStorage.setItem(E,"1")}catch{try{localStorage.setItem(E,"1")}catch{}}}export{i as ALARM_OPTIONS,c as FOCUS_SOUND_OPTIONS,b as getPomoSnapshot,nt as migratePomodoroTasksOnce,D as playAlarm,P as pomoPause,B as pomoStart,N as pomoSwitchMode,l as pomodoroToday,F as previewFocusSound,T as setPomoAlarm,A as setPomoAlarmConfig,I as setPomoBehaviour,v as setPomoDurations,x as setPomoFocusSound,X as setShellTodoProvider,y as subscribePomo,et as useTodoTasks};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-W7HTHKN2.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-W7HTHKN2.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-BYTQRQ5P.js";import{Button_default as o}from"./chunk-37FQVY2O.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-NJY4HPNB.js";import{Button_default as i}from"./chunk-37FQVY2O.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as r}from"./chunk-CIZAUBWA.js";import{iconButtonClasses as a}from"./chunk-LYGIOJ3J.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:I,align:O="end",side:W="bottom",menuMinWidth:z,linkAs:A,block:L=!1,className:R=""},B){const D=g&&(null!=N&&""!==N&&!1!==N)&&!v,F=x&&null!=j&&""!==j&&!1!==j,J=o(),Y=/* @__PURE__ */t(i,{ref:B,type:b,variant:f,size:p,loading:v,leftIcon:k,block:L,disabled:g&&!D,"aria-disabled":!!D||void 0,disabledReason:D?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),$=L?"relative flex min-w-0 flex-1":"relative inline-flex",M=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[L?"flex w-full":"inline-flex","items-stretch",R].filter(Boolean).join(" "),children:[null==w||""===w||D?Y:/* @__PURE__ */t(r,{content:w,className:$,children:Y}),
|
|
3
|
+
/* @__PURE__ */t(r,{content:F?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":F?J:void 0,items:h,align:O,side:W,minWidth:z,linkAs:A,disabled:x&&!F,"aria-disabled":F,onOpenChange:y,footer:C,footerLabel:I,triggerClassName:a({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(n,{name:"chevron-down",className:M,strokeWidth:2,"aria-hidden":"true"})})}),F&&/* @__PURE__ */t("span",{id:J,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|