efficient-shell 13.22.1 → 13.23.1
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 +48 -0
- package/dist/{Browser-ZNJ3OZSE.js → Browser-I2UVUUVV.js} +13 -13
- package/dist/{Calculator-BPQPQUZN.js → Calculator-PHIOJNTS.js} +20 -20
- package/dist/CodeEditor-VN76K3MD.js +1 -0
- package/dist/{CurrencyConverter-M4UJI6VQ.js → CurrencyConverter-WZXN6WTD.js} +5 -5
- package/dist/{Files-4HACSJ7C.js → Files-KA5Y6G4P.js} +62 -62
- package/dist/{Notepad-SK2E5VOK.js → Notepad-RSEI2F3I.js} +8 -8
- package/dist/{PomodoroTimer-BR5NOA24.js → PomodoroTimer-WVIAWG5E.js} +39 -39
- package/dist/{Preview-CLV2ZAU5.js → Preview-EPATSSFI.js} +7 -7
- package/dist/{Stock-LZ2QHPU4.js → Stock-SHKXRWJQ.js} +3 -3
- package/dist/{Weather-Q22ZW7ZQ.js → Weather-WMKWOPBU.js} +16 -16
- package/dist/{WorldClock-4MSSRLC7.js → WorldClock-GZYOF4B2.js} +4 -4
- package/dist/ai/index.js +52 -52
- 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/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/{chunk-GPU7LLTJ.js → chunk-2L4IOLOT.js} +1 -1
- package/dist/{chunk-7G5HKAGV.js → chunk-3WUVYXCF.js} +5 -5
- package/dist/{chunk-7N42VDGT.js → chunk-4L5YRMJ4.js} +12 -12
- package/dist/{chunk-P3JPSO3E.js → chunk-5CHJA4RL.js} +3 -3
- package/dist/{chunk-FE7H6RXE.js → chunk-65BW43PF.js} +2 -2
- package/dist/{chunk-UJY5RUZ5.js → chunk-6AETKYCP.js} +1 -1
- package/dist/{chunk-QRPPWLKU.js → chunk-6EGZ4PV4.js} +2 -2
- package/dist/{chunk-FMBUR4EU.js → chunk-7PYJEJDT.js} +1 -1
- package/dist/{chunk-JJYTN72U.js → chunk-CCZHSISF.js} +3 -3
- package/dist/{chunk-RM2I6DIF.js → chunk-CZS5UHOU.js} +1 -1
- package/dist/{chunk-3AMCLA5Q.js → chunk-GAEQYCLS.js} +1 -1
- package/dist/{chunk-DEE6FKE7.js → chunk-H2Q7G5D6.js} +33 -33
- package/dist/{chunk-QJUMBOL2.js → chunk-IMH5H47S.js} +6 -6
- package/dist/{chunk-R7CYBBJY.js → chunk-JIJZBM25.js} +6 -6
- package/dist/{chunk-LRMDLZMM.js → chunk-JVENCUUG.js} +4 -4
- package/dist/chunk-KH4AMHSI.js +1 -0
- package/dist/{chunk-BUMY4LIP.js → chunk-L4W5X3Q4.js} +3 -3
- package/dist/{chunk-PHYHKDSW.js → chunk-LM6MSGDW.js} +1 -1
- package/dist/chunk-M3HBGN5K.js +1 -0
- package/dist/chunk-MRFFOJCS.js +28 -0
- package/dist/chunk-N4FUMDAI.js +1 -0
- package/dist/{chunk-ZBGPAUOH.js → chunk-N4LMFGRI.js} +5 -5
- package/dist/{chunk-23YQNCZ4.js → chunk-NF5HSFZ3.js} +16 -16
- package/dist/{chunk-E4GF7M4S.js → chunk-OOND66P2.js} +5 -5
- package/dist/{chunk-EJJTDUN3.js → chunk-P5TSGXL4.js} +13 -13
- package/dist/{chunk-7N6CVTWO.js → chunk-P6H2B635.js} +1 -1
- package/dist/{chunk-6UGMQZTF.js → chunk-PI2W6MML.js} +1 -1
- package/dist/{chunk-3SKXWFGG.js → chunk-PP3WUT2G.js} +5 -5
- package/dist/{chunk-Z6J4KXY3.js → chunk-PWOVSR7N.js} +6 -6
- package/dist/{chunk-F3EBYHIE.js → chunk-S5MTTJ3F.js} +10 -10
- package/dist/{chunk-SAHRIE35.js → chunk-T7A3Y64S.js} +1 -1
- package/dist/{chunk-J5OAQAAD.js → chunk-TJBHFUWV.js} +4 -4
- package/dist/{chunk-LUARJHUK.js → chunk-TJG76Y7I.js} +8 -8
- package/dist/{chunk-SKVLTYGN.js → chunk-TT7KXS2Q.js} +1 -1
- package/dist/{chunk-JZ43635V.js → chunk-TTRLYWP4.js} +1 -1
- package/dist/{chunk-OFMZ6JM6.js → chunk-UR3J4WP6.js} +12 -12
- package/dist/{chunk-AFYLMXOJ.js → chunk-UU42O5ON.js} +5 -5
- package/dist/{chunk-QPVYBN4J.js → chunk-VLBLDSA6.js} +1 -1
- package/dist/{chunk-L744YF4X.js → chunk-VMAIZU5S.js} +1 -1
- package/dist/{chunk-6CFI4YGI.js → chunk-VP2IQJUD.js} +4 -4
- package/dist/{chunk-ONWFKCMB.js → chunk-VT5HWPE2.js} +9 -9
- package/dist/{chunk-5JUXMNUC.js → chunk-ZKILZFUI.js} +1 -1
- package/dist/{chunk-TSCJG6UM.js → chunk-ZMBGMEN5.js} +1 -1
- package/dist/code/index.d.ts +20 -0
- package/dist/code/index.js +2 -0
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.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/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/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/icons/brands.node.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.js +125 -125
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingRow.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/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +44 -0
- package/dist/version.js +1 -1
- package/package.json +46 -1
- package/dist/chunk-3SIHJWR2.js +0 -28
- package/dist/chunk-KBQXXPFK.js +0 -1
- package/dist/chunk-KUPN5WRE.js +0 -1
- package/dist/chunk-OTEAWX2C.js +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-RFWBNKKB.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__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:
|
|
3
|
-
/* @__PURE__ */Y(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:()=>{
|
|
1
|
+
import{Calendar as e}from"./chunk-RFWBNKKB.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-TJBHFUWV.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{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as x}from"./chunk-ZDXRSY2Y.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N,useShellLocale as w}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as C,useId as j,useEffect as M}from"react";import{createPortal as D}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var F=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],R=d;function S(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 H(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 O(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var B=/* @__PURE__ */new Map;function T({from:d,to:u,onChange:h,formatDisplay:R,clearable:T,required:V=!1,name:A,id:I,"aria-labelledby":L,"aria-label":U,weekStartsOn:E,placeholder:G,fullWidth:K=!1,min:P,max:q,disabled:J=!1,allowOpenEnd:Q=!1}){const Z=N().dateRange,X=w(),z=R??(X?function(e){let t=B.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),B.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}}(X):O),_=G??Z.placeholder,ee=T??!V,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=j(),fe=j(),ge=j(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),Ne=C(null),[we,ke]=k(!0);x(()=>{const e=Ne.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!==we&&ke(o)});const Ce=C(null);x(()=>{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]=k(!1);x(()=>{const e=!!I&&(ue.current?.labels?.length??0)>0;e!==je&&Me(e)});const De=!!U||!!L||je,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):H(We,P,q)),Fe=F.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(S(e,We),P,q)),Re=e=>e?z(e):"";M(()=>{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]),M(()=>{J&&re(!1)},[J]);const Se=()=>{h("",""),re(!1)},He=ee&&!J&&Boolean(d||u),Oe=d&&u?`${Re(d)} — ${Re(u)}`:d?Z.fromOnly(Re(d)):u?Z.toOnly(Re(u)):"",Be=c(X),Te=e=>{const t=m(e);return t?Be.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ve=d&&u?Z.range(Te(d),Te(u)):d?Z.fromOnly(Te(d)):u?Z.toOnly(Te(u)):_,Ae=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"),Ie=/* @__PURE__ */W($,{children:[Fe.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=S(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Ae(e),"aria-label":be?Z[e]:void 0,children:be?we?Z[e]:Z[`${e}Short`]:Z[e]},e)),
|
|
2
|
+
/* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Ae("Custom"),children:Z.custom})]}),Le=(e,t)=>Q?/* @__PURE__ */Y("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__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ue=e=>Q&&ce===e?" ring-1 ring-blue-400":"",Ee=
|
|
3
|
+
/* @__PURE__ */Y(e,{mode:"range",min:P,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),Q?"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:E,"aria-label":Z.dialog});/* @__PURE__ */
|
|
4
|
+
return W("div",{className:"relative"+(K?" w-full":""),ref:me,children:[
|
|
5
|
+
/* @__PURE__ */W("div",{className:`relative ${K?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${He?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}${J?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{J||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):H(We,P,q)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:I,disabled:J||void 0,"aria-label":U,"aria-labelledby":L,"aria-describedby":[De?fe:void 0,V?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(K?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */Y(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */Y("span",{className:"truncate",children:
|
|
9
|
-
/* @__PURE__ */Y("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */Y("input",{type:"hidden",name:
|
|
8
|
+
/* @__PURE__ */Y("span",{className:"truncate",children:Oe||_})]}),He&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:Z.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Se}})})]}),De&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ve}),V&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:Z.required}),A&&/* @__PURE__ */W($,{children:[
|
|
9
|
+
/* @__PURE__ */Y("input",{type:"hidden",name:A.from,value:d,disabled:J||void 0}),
|
|
10
|
+
/* @__PURE__ */Y("input",{type:"hidden",name:A.to,value:u,disabled:J||void 0})]}),te&&D(
|
|
11
11
|
/* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":Z.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.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",...y()},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__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.from}),
|
|
14
|
-
/* @__PURE__ */Y("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__ */Y("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"}${Ue("from")}`,children:ne?Re(ne):Z.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Le("to",/* @__PURE__ */W($,{children:[
|
|
15
15
|
/* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.to}),
|
|
16
|
-
/* @__PURE__ */Y("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:Ne,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
18
|
-
/* @__PURE__ */Y("div",{className:"w-full",children:
|
|
16
|
+
/* @__PURE__ */Y("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"}${Ue("to")}`,children:oe?Re(oe):Z.end})]}))]}),be?/* @__PURE__ */W($,{children:[Fe.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!we&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Z.lastHeading}),
|
|
17
|
+
/* @__PURE__ */W("div",{ref:Ne,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ie,Fe.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Z[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */Y("div",{className:"w-full",children:Ee})]}):
|
|
19
19
|
/* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */Y("div",{className:"w-64",children:
|
|
20
|
+
/* @__PURE__ */Y("div",{className:"w-64",children:Ee}),Fe.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ie})]}),
|
|
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__ */Y("button",{type:"button",onClick:Se,className:v({variant:"ghost"}),children:Z.clear}),
|
|
22
22
|
/* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:Z.cancel}),
|
|
23
|
-
/* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:
|
|
23
|
+
/* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:Q?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{T as DateRangePicker,S as presetRange,R as toISODate};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{angleScale as r}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,R=c(),w=y??(e=>m(e,R)),E=b??C.nothingToPlot,P=h(),[Q,T]=u(null),{highlighted:$}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:E});const F=v/2,H=v/2,I=v/2-10,U=x??Math.max(...g.map(e=>e.value),1),V="track"===k?Math.max(6,(I-.16*v)/g.length):0,W=Math.max(1,Math.floor((I-.16*v)/V||1)),Y="track"===k?g.slice(0,W):g,z=Math.min(j,Math.max(1,V-2)),A=r(Y.length,.03),B=null!==Q?Y[Q]:void 0;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
3
|
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":P,onMouseLeave:()=>T(null),children:[
|
|
4
4
|
/* @__PURE__ */p("title",{id:P,children:"track"===k?C.radialTrack(Y.length):C.radialCycle(Y.length)}),Y.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/U)),c=((e,t)=>null!==Q?Q!==e:null!==$&&$!==t)(r,l.key);if("track"===k){const o=I-r*V,m=o-V+z,h=-Math.PI/2;/* @__PURE__ */
|
|
5
|
-
return d("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),className:M?
|
|
6
|
-
/* @__PURE__ */p("path",{d:
|
|
7
|
-
/* @__PURE__ */p("path",{d:
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),children:/* @__PURE__ */p("path",{d:
|
|
5
|
+
return d("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
|
|
6
|
+
/* @__PURE__ */p("path",{d:e(F,H,m,o,h,h+f),fill:i.grid}),
|
|
7
|
+
/* @__PURE__ */p("path",{d:e(F,H,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
+
return p("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),children:/* @__PURE__ */p("path",{d:e(F,H,m,m+(I-m)*s,A(r),A(r)+A.step),fill:n})},l.key)})]}),B&&null!==Q&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(n,{title:B.label,rows:[{key:"value",label:C.value,color:o(Q,B.color,B.tone),value:w(B.value)}]})}),
|
|
9
9
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
10
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
11
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return U("div",{className:wt,ref:Rt,children:/* @__PURE__ */U(
|
|
1
|
+
import{ChartBrush as t}from"./chunk-SAMPXZF3.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-MEFB2KGF.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-LLSGIMLG.js";import{pairedAxes as x,niceAxis as v,niceMax as b,linearScale as M,axisGutter as N,bandScale as w,ladderScale as j}from"./chunk-2JWPNR2U.js";import{ChartTooltip as $}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as L,CHART_INK as V,STATUS_VARS as z}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as A}from"./chunk-TWVUQUUD.js";import{usePlotWidth as R}from"./chunk-MAFUXCPZ.js";import{useShellStrings as S,useShellLocale as W}from"./chunk-NRHG4R2Q.js";import{formatPercent as E,formatPlain as C}from"./chunk-C3QOHMR6.js";import{useRef as D,useState as F,useId as I,useEffect as T}from"react";import{jsx as U,jsxs as P}from"react/jsx-runtime";var B=12,G=16,O=26,Q=52,Y=t=>"number"==typeof t&&Number.isFinite(t);function H({series:H,labels:K,height:Z=200,stacked:X=!1,stackMode:J="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=S().charts,Lt=W(),Vt=rt??(t=>C(t,Lt)),zt=ot??Vt,At=jt??$t.noData,Rt=D(null),St=R(Rt),Wt=Nt??St,[Et,Ct]=F(null),[Dt,Ft]=F(null),{highlighted:It}=u(),Tt=I(),Ut=ut??Dt,Pt=p(ht&&Ut?Ut[1]-Ut[0]+1:K.length,pt);if(T(()=>{if(null!==Et)return A(t=>"Escape"===t.key&&(Ct(null),!0))},[Et]),kt)/* @__PURE__ */
|
|
2
|
+
return U("div",{className:wt,ref:Rt,children:/* @__PURE__ */U(h,{height:Z,width:Nt??St})});const Bt=K,Gt=ut??Dt??[0,Math.max(0,Bt.length-1)],[Ot,Qt]=Gt,Yt=t=>Pt.slice(ht?t.slice(Ot,Qt+1):t),Ht=lt?Yt(lt):void 0,Kt=H.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Y)).map(t=>({...t,data:Yt(t.data),pointTones:t.pointTones?Yt(t.pointTones):void 0})),Zt=t=>(ht?Ot:0)+(Pt.view?.[0]??0)+t;if(K=Yt(Bt),0===Kt.length||0===K.length)/* @__PURE__ */
|
|
3
3
|
return U("div",{className:wt,ref:Rt,children:/* @__PURE__ */U("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:Z},children:At})});const Xt=K.map((t,e)=>Kt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Jt=(t,e)=>Xt[e]>0?t/Xt[e]:null,qt=[];if(X){let t=K.map(()=>0);for(const e of Kt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===J?t.map((t,e)=>Jt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!X&&!_t&&void 0===et&&Kt.some(te)&&Kt.some(t=>!te(t)),ae=gt&&!X?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Kt.filter(t=>!te(t)):Kt).filter(t=>!re(t)),le=ee?Kt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=X?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?x([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:X&&"percent"===J||_t||void 0!==et?null:v(X?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=X&&"percent"===J?1:se?se.hi:et??b(Math.max(...ne,0)),me=X&&"percent"===J?t=>E(Math.round(100*t),0,Lt):Vt,he=_t?q:se?se.ticks:M([ce,de],{from:0,to:1}).ticks(at+1),ue=N(he.map(me),Q),fe=ie?N(ie.right.ticks.map(Vt),G):G,pe={left:ue,right:Math.max(ue+1,Wt-fe),top:B,bottom:Z-O},ge=w(K.length,{from:pe.left,to:pe.right}),ye=_t?j(q,{from:pe.bottom,to:pe.top}):null,ke=M([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Kt.filter(re),Me=Math.max(0,...K.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?M([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Le=t=>e=>{e.preventDefault(),Ct(e=>{const a=(e??0)+t;return Math.min(K.length-1,Math.max(0,a))})},Ve=Math.max(1,Math.ceil(K.length/Math.max(1,Math.floor(Wt/96))));/* @__PURE__ */
|
|
4
4
|
return P("div",{className:`relative ${wt??""}`,ref:Rt,children:[
|
|
5
5
|
/* @__PURE__ */P("svg",{width:"100%",height:Z,viewBox:`0 0 ${Wt} ${Z}`,role:"img","aria-label":$t.overIntervals(Kt.map(t=>t.label),K.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Ct(null),onBlur:()=>Ct(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Et&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Zt(Et));"ArrowRight"===t.key&&Le(1)(t),"ArrowLeft"===t.key&&Le(-1)(t)},children:[
|
|
6
6
|
/* @__PURE__ */U("defs",{children:/* @__PURE__ */U("clipPath",{id:Tt,children:/* @__PURE__ */U("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
-
/* @__PURE__ */U(
|
|
7
|
+
/* @__PURE__ */U(n,{id:Tt,fills:Kt.map((t,e)=>({color:L(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:X?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */U("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:V.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
8
|
/* @__PURE__ */U("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:V.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */U("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:V.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */U("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:V.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */U("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:V.label,children:nt}),
|
|
9
|
-
/* @__PURE__ */U("g",{clipPath:`url(#${Tt})`,mask:xt&&vt?`url(#${
|
|
10
|
-
return U("path",{d:
|
|
11
|
-
return U("rect",{x:ge.center(
|
|
12
|
-
return U("rect",{x:ge.center(c)-
|
|
13
|
-
return P("g",{opacity:
|
|
14
|
-
/* @__PURE__ */U("path",{d:y,fill:
|
|
15
|
-
/* @__PURE__ */U("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:
|
|
9
|
+
/* @__PURE__ */U("g",{clipPath:`url(#${Tt})`,mask:xt&&vt?`url(#${m(Tt)})`:void 0,children:Kt.map((t,e)=>{const n=L(t.slot,t.color,t.tone),m=t.mode??(X?"area":"line"),h=f(t.key,It);if("step"===m){const e=K.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Y(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return U("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=K.map((a,r)=>{const o=X?qt[e]?.[r]:t.data[r];return Y(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */U("g",{opacity:h??void 0,className:"rosh-viz-mark",children:K.map((o,l)=>{const i=t.data[l];if(!Y(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Kt[t]?.key)).reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
|
|
11
|
+
return U("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?z[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */U("g",{opacity:h??void 0,className:"rosh-viz-mark",children:K.map((l,c)=>{const d=X?qt[e]?.[c]:t.data[c];if(!Y(d))return null;const m=o(d);/* @__PURE__ */
|
|
12
|
+
return U("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=X&&e>0?K.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
|
|
13
|
+
return P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||X)&&
|
|
14
|
+
/* @__PURE__ */U("path",{d:y,fill:c(Tt,e,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */U("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??z[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
16
|
return P("g",{children:[
|
|
17
|
-
/* @__PURE__ */U("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */U("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Kt.map((t,
|
|
18
|
-
return P("g",{children:[
|
|
17
|
+
/* @__PURE__ */U("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */U("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Kt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=L(t.slot,t.color,t.tone),l=[...t.data].map(Y).lastIndexOf(!0),n="all"===r?K.map((t,e)=>e).filter(e=>Y(X?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return P("g",{children:[n.map(r=>{const n=X?qt[a]?.[r]:t.data[r];return Y(n)?/* @__PURE__ */U(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${K[r]}: ${t.label} ${Vt(n)}`},r):null}),st&&l>=0&&Y(X?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */U("text",{x:ge.center(l)-10,y:je(t)(X?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:V.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(X?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),K.map((t,e)=>e%Ve===0?/* @__PURE__ */U("text",{x:ge.center(e),y:Z-8,textAnchor:"middle",fontSize:11,fill:V.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */U("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:V.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
19
|
/* @__PURE__ */P("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
20
|
/* @__PURE__ */U("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:V.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
-
/* @__PURE__ */U("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:V.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(Me)})]}),Pt.drag&&/* @__PURE__ */U(g,{x0:ge(Pt.drag[0]),x1:ge(Pt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),K.map((t,e)=>/* @__PURE__ */U("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Ct(e),onPointerDown:()=>Pt.press(e),onPointerEnter:()=>Pt.over(e),onPointerUp:Pt.release,onClick:yt?()=>yt(Zt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Pt.view&&/* @__PURE__ */U(y,{from:Ht?.[0]??K[0],to:Ht?.at(-1)??K[K.length-1],count:K.length,total:X&&"percent"!==J?zt(Xt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Kt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=L(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=X||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Pt.clear}),ht&&Bt.length>2&&/* @__PURE__ */U(
|
|
21
|
+
/* @__PURE__ */U("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:V.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(Me)})]}),Pt.drag&&/* @__PURE__ */U(g,{x0:ge(Pt.drag[0]),x1:ge(Pt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),K.map((t,e)=>/* @__PURE__ */U("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Ct(e),onPointerDown:()=>Pt.press(e),onPointerEnter:()=>Pt.over(e),onPointerUp:Pt.release,onClick:yt?()=>yt(Zt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Pt.view&&/* @__PURE__ */U(y,{from:Ht?.[0]??K[0],to:Ht?.at(-1)??K[K.length-1],count:K.length,total:X&&"percent"!==J?zt(Xt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Kt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=L(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=X||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Pt.clear}),ht&&Bt.length>2&&/* @__PURE__ */U(t,{className:"mt-1",labels:Bt,width:Wt,data:H[0]?.data??[],range:Gt,onRangeChange:t=>{ft?ft(t):Ft(t)}}),null!==Et&&
|
|
22
22
|
/* @__PURE__ */U("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Et),ge.bandwidth,Wt),children:/* @__PURE__ */U($,{title:Ht?.[Et]??K[Et],rows:Kt.map((t,e)=>({key:t.key,label:t.label,color:L(t.slot,t.color,t.tone),value:Y(t.data[Et])?X&&"percent"===J?`${E(100*(Jt(t.data[Et],Et)??0),1,Lt)} · ${zt(t.data[Et])}`:zt(t.data[Et]):void 0})),footnote:X&&"percent"===J?$t.inBucket(zt(Xt[Et])):void 0})})]})}export{H as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-C5OPAULN.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:R,onResizeStart:_,onDragStart:z,onDragOver:P,onDrop:$,onDragEnd:I,toggleColumn:L,resetColumns:T,draggedIdx:A,dropGap:O}=t(f,S),{hasAnyPerm:E}=r(),G=i().columns,[Q,U]=c(!1),[W,Y]=c(!1),[B,F]=c(!1),H=m(null),J=k.length>0&&E(k);e(H,h(()=>{Q&&U(!1)},[Q]));const K=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:K,minWidth:"100%"},Z=m(null),q=h(e=>{const t=Z.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),X=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
|
|
2
2
|
return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
|
|
3
3
|
/* @__PURE__ */p("div",{ref:Z,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
4
4
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BrandVisaIcon as a}from"./chunk-WYDD26UO.js";import{BrandWechatIcon as r}from"./chunk-44F7JLNV.js";import{BrandPaypalIcon as n}from"./chunk-7P3DXO3E.js";import{
|
|
1
|
+
import{BrandVisaIcon as a}from"./chunk-WYDD26UO.js";import{BrandWechatIcon as r}from"./chunk-44F7JLNV.js";import{BrandPaypalIcon as n}from"./chunk-7P3DXO3E.js";import{BrandJcbIcon as p}from"./chunk-WH6NPZ6B.js";import{BrandKlarnaIcon as b}from"./chunk-DS6R5R3O.js";import{BrandMastercardIcon as d}from"./chunk-JMWKD4R5.js";import{BrandGooglepayIcon as e}from"./chunk-ZEN67DFI.js";import{BrandDinersclubIcon as s}from"./chunk-A5SPSAWW.js";import{BrandAlipayIcon as c}from"./chunk-SVUOPZCB.js";import{BrandAmericanexpressIcon as o}from"./chunk-PRJJK7VR.js";import{BrandApplepayIcon as i}from"./chunk-RAHDUMQ5.js";import{BrandAfterpayIcon as l}from"./chunk-BZR43D3G.js";var m={afterpay:"brand-afterpay",alipay:"brand-alipay",americanexpress:"brand-americanexpress",applepay:"brand-applepay",dinersclub:"brand-dinersclub",googlepay:"brand-googlepay",jcb:"brand-jcb",klarna:"brand-klarna",mastercard:"brand-mastercard",paypal:"brand-paypal",visa:"brand-visa",wechat:"brand-wechat"},t=new Set(["brand-afterpay","brand-alipay","brand-americanexpress","brand-applepay","brand-dinersclub","brand-googlepay","brand-jcb","brand-klarna","brand-mastercard","brand-paypal","brand-visa","brand-wechat"]),y=a=>"string"==typeof a&&t.has(a),f={"brand-afterpay":l,"brand-alipay":c,"brand-americanexpress":o,"brand-applepay":i,"brand-dinersclub":s,"brand-googlepay":e,"brand-jcb":p,"brand-klarna":b,"brand-mastercard":d,"brand-paypal":n,"brand-visa":a,"brand-wechat":r},h={"brand-afterpay":"Afterpay","brand-alipay":"Alipay","brand-americanexpress":"American Express","brand-applepay":"Apple Pay","brand-dinersclub":"Diners Club","brand-googlepay":"Google Pay","brand-jcb":"JCB","brand-klarna":"Klarna","brand-mastercard":"MasterCard","brand-paypal":"PayPal","brand-visa":"Visa","brand-wechat":"WeChat"};export{m as PAYMENT_BRAND,f as PAYMENT_BRAND_DRAWINGS,h as PAYMENT_BRAND_TITLES,y as isPaymentBrand};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:F}){const W=m().charts,C=c(),R=N??(e=>h(e,C)),w=F??W.nothingToCompare,A=p(),[Q,L]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
|
|
2
2
|
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const B=y/2,E=y/2,H=y/2-46,T=o(k.length),U=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...z.map(e=>e.values[t]??0).filter(Number.isFinite))),V=(e,t)=>{const r=Math.max(0,Math.min(1,t/U[e])),l=T.center(e)-T.step/2;return[B+H*r*Math.cos(l),E+H*r*Math.sin(l)]},Z=(e,t)=>null!==Q?Q!==e:null!==Y&&Y!==t,D=null!==Q?z[Q]:void 0;/* @__PURE__ */
|
|
3
3
|
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
4
|
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":A,onMouseLeave:()=>L(null),children:[
|
|
5
|
-
/* @__PURE__ */d("title",{id:A,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:M},(e,
|
|
5
|
+
/* @__PURE__ */d("title",{id:A,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=H*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:B,cy:E,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(B,E,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=V(t,U[t]);/* @__PURE__ */
|
|
6
6
|
return f("g",{children:[
|
|
7
7
|
/* @__PURE__ */d("line",{x1:B,y1:E,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */d("text",{x:B+(H+18)*Math.cos(T.center(t)-T.step/2),y:E+(H+18)*Math.sin(T.center(t)-T.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
-
/* @__PURE__ */d(
|
|
10
|
-
return f("g",{opacity:Z(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${
|
|
11
|
-
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:
|
|
9
|
+
/* @__PURE__ */d(r,{id:A,reveal:!!j&&"center-out"}),z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>V(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:Z(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(A)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
+
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),D&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:D.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(Q,3,D.color,D.tone),value:R(D.values[t]??0)}))})}),
|
|
12
12
|
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
13
|
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
14
|
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{CloseGlyph as e}from"./chunk-DTRJLQWO.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-NWS5G7FE.js";import{Button_default as s}from"./chunk-UTISUEO4.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,
|
|
5
|
-
/* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:
|
|
5
|
+
/* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:n,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=l(/* @__PURE__ */new Map);o(()=>{const e=new Set(n);for(const[t,n]of m.current)e.has(t)||(URL.revokeObjectURL(n),m.current.delete(t))},[n]),o(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===n.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:n.map((n,s)=>{const c=h(n);/* @__PURE__ */
|
|
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
|
-
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:
|
|
8
|
-
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n
|
|
9
|
-
/* @__PURE__ */d(
|
|
7
|
+
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:n.name,children:n.name}),
|
|
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:N,className:j="",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(()=>{N&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,N(L.rejections))},[L.rejections,N]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:j,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]}),
|
|
13
|
-
/* @__PURE__ */d(
|
|
13
|
+
/* @__PURE__ */d(r,{rejections:L.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-RJVIKGHJ.js";import{InputNumber_default as r}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function
|
|
3
|
-
return w("div",{id:
|
|
1
|
+
import{Popover as e}from"./chunk-RJVIKGHJ.js";import{InputNumber_default as r}from"./chunk-VLBLDSA6.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-F2RAIGCG.js";import{useShellStrings as h}from"./chunk-NRHG4R2Q.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function P(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:R,id:S,className:K=""}){const L=h().color,H=k(z),O=e=>{const r=k(e);N||r===H||j?.(r)},U=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:H},E=a(f??""),[G,Y]=p(()=>n(e||E||"")),q=b(e);m(()=>{e!==q.current&&(q.current=e,e?Y(n(e)):E&&Y(n(E)))},[e]);const J=a=>{N||a===e||(q.current=a,r(a))},V=e=>{const r=a(e);r&&(Y(n(r)),J(r))},W=e=>{Y(e),J(o(e))},[X,F]=p(!1),Q=b(G);Q.current=G;const Z=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===x?(F(!0),Y(a)):W(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,Q.current);"end"===x?Y(a):W(a)},onPointerUp:r=>{"end"===x&&X&&(F(!1),W(e(r,Q.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=X?o(G):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||E||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&R&&(e.preventDefault(),e.stopPropagation(),R())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":L.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:L.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":L.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(q.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
|
|
4
4
|
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>V(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*G.v),"aria-valuetext":L.squareValue(Math.round(100*G.s),Math.round(100*G.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=A(G,e.key,e.shiftKey);r&&(e.preventDefault(),W(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:G.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(G.s),top:ae(1-G.v),...M}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(G.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=I(G.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),W({...G,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:G.h/360*100+"%",background:o({h:G.h,s:1,v:1}),...M}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":L.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H,"aria-valuetext":`${H}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=P(H,e.key,e.shiftKey);null!==r&&(e.preventDefault(),O(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),O(U(e)))},onPointerMove:e=>{!N&&1&e.buttons&&O(U(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${H}%`,...C(te||"black",H),...M}})}),
|
|
7
7
|
/* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
|
|
8
|
-
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?
|
|
9
|
-
/* @__PURE__ */v(B,{value:re,placeholder:!e&&
|
|
8
|
+
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?H:null)}),
|
|
9
|
+
/* @__PURE__ */v(B,{value:re,placeholder:!e&&E?t(E):void 0,onChange:V,label:L.hex(i),disabled:N}),j&&/* @__PURE__ */v(T,{value:H,onChange:O,label:L.opacity(i),disabled:N})]})]})}var R={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},S={sm:"h-6",md:"h-8",lg:"h-10"},K=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function B({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${K} ${S[c]} ${h}`.trim():u({size:c,className:`${R[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
10
10
|
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function T({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
11
|
-
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function
|
|
11
|
+
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function L({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,A=k(p),I=f(),M=a(s??""),P=r||M||"",R=r?t(r):M?t(M):D.none;
|
|
12
12
|
/* @__PURE__ */
|
|
13
13
|
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
14
|
-
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(
|
|
15
|
-
/* @__PURE__ */v(B,{value:r,placeholder:!r&&
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(P,b?A:null)}),triggerLabel:D.swatch(o,R),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:I,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
|
|
15
|
+
/* @__PURE__ */v(B,{value:r,placeholder:!r&&M?t(M):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(T,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{L as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,B as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,I as stepHue,P as stepOpacity,A as stepSquare};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-D5PXRJHA.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-D5PXRJHA.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-TJBHFUWV.js";import{Button_default as s}from"./chunk-UTISUEO4.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,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{inputClasses as e,PLACEHOLDER_INK as r}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-NWS5G7FE.js";import{DropdownMenu as t}from"./chunk-EX3DARI3.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
|
|
2
2
|
return o("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:e})}function d({action:e,size:r="md"}){/* @__PURE__ */
|
|
3
|
-
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:
|
|
4
|
-
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(t,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:
|
|
5
|
-
/* @__PURE__ */o("input",{ref:f,"aria-invalid":
|
|
3
|
+
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:e,size:r}){const{label:s,icon:l,onClick:c,menu:m}=e;/* @__PURE__ */
|
|
4
|
+
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(t,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:r})}):/* @__PURE__ */o(n,{"aria-label":s,size:r,onClick:c,children:l})})}var f=s(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",N=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),v=
|
|
5
|
+
/* @__PURE__ */o("input",{ref:f,"aria-invalid":n||void 0,readOnly:u,className:e({invalid:n,size:s,readOnly:u,className:[N,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${r}`,children:t}),v,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):v});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{useTableNav as n}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as r}from"./chunk-G6DKCCWH.js";import{ListFooter as o}from"./chunk-U73K3ICC.js";import{ListLoadError as l}from"./chunk-2YHS5E27.js";import{ResizableTable as i}from"./chunk-
|
|
2
|
-
return x(l,{title:
|
|
3
|
-
/* @__PURE__ */x("div",{ref:Q}),Y&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{useTableNav as n}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as r}from"./chunk-G6DKCCWH.js";import{ListFooter as o}from"./chunk-U73K3ICC.js";import{ListLoadError as l}from"./chunk-2YHS5E27.js";import{ResizableTable as i}from"./chunk-P6H2B635.js";import{Checkbox_default as a}from"./chunk-CGZBDI6C.js";import{LoadingSpinner as c}from"./chunk-4PJFL26P.js";import{PopupMenu as d,PopupMenuLabel as s,PopupMenuItem as h,PopupMenuDivider as m}from"./chunk-THAPVKEJ.js";import{keepsNativeMenu as u}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{shellHttp as f}from"./chunk-STKJA4PV.js";import{toast_default as g}from"./chunk-I2NVBDKH.js";import{useShellStrings as y}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:N,emptyState:L,totalCount:$,isError:A,onRetry:K,errorTitle:P,errorMessage:T,tableId:E,columns:F,renderCell:H,getRowId:M=e=>e.id,sort:I,onSort:U,selected:D,setSelected:J,onRowClick:B,onRowHover:V,getRowClassName:O,footerLabel:W,footerExtra:_,footerExtraAfter:G,sentinelRef:Q,isFetchingNextPage:Y,saveDefaultPerms:Z,exportEndpoint:z,exportFilename:X="export.csv",contextActions:q}=S,[ee,te]=k(null),ne=b(null),re=y(),oe=re.entityList,le=e=>{J(t=>{const n=new Set(t),r=M(e);return n.has(r)?n.delete(r):n.add(r),n})},ie=()=>{J(e=>{const t=R.map(M),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ae=n(R,B,le,ie,(e,t)=>{J(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(M(R[n]));return r})},ne),ce=R.filter(e=>D.has(M(e))),de=()=>{const e=[...ne.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(M(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(F.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},se=()=>{te(null);const{header:t,body:n}=de();if(!n.length)return;const o=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${r(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${r(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(oe.copiedRows(n.length),o,l)},he=async()=>{te(null);const e=ce.map(M);if(!e.length||!z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(F.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${E}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return F.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=z.includes("?")?"&":"?";try{const n=await f.get(`${z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=X,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void g.notify(Number.isFinite(a)?oe.exportTruncated(a,e.length):oe.exportTruncatedUnknown(e.length));g.success(oe.exported(e.length))}catch{g.error(oe.exportFailed)}};if(N)/* @__PURE__ */return x(c,{});if(A&&0===R.length)/* @__PURE__ */
|
|
2
|
+
return x(l,{title:P,message:T,onRetry:K});if(0===R.length)/* @__PURE__ */return x(w,{children:L});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=D.size-ce.length,fe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(a,{"aria-label":re.table.selectAll,checked:me,indeterminate:ue,onChange:ie,style:{height:14,width:14}})},...F],ge=/* @__PURE__ */x(o,{selectedCount:ce.length,hiddenSelectedCount:pe,loadedCount:R.length,totalCount:$,label:W,isFetchingMore:Y,extra:_,extraAfter:G}),ye=Q?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:Q}),Y&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0!==$&&$>R.length;ke=/* @__PURE__ */C(d,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
4
|
/* @__PURE__ */x(s,{children:pe>0?re.list.selectedNotShown(a,pe):re.list.selected(a)}),
|
|
5
|
-
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),
|
|
5
|
+
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),B(r)},children:oe.open}),
|
|
6
6
|
/* @__PURE__ */x(m,{}),o&&/* @__PURE__ */x(h,{onClick:()=>{c(),e(oe.copiedText,o.text,o.html)},children:oe.copy}),l&&/* @__PURE__ */x(h,{onClick:()=>(t=>{te(null);const{keys:n,body:r}=de(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:oe.copyColumn(l.label)}),
|
|
7
7
|
/* @__PURE__ */x(h,{disabled:0===a,onClick:se,children:oe.copyRows(a)}),z&&/* @__PURE__ */x(h,{onClick:he,children:oe.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(m,{}),
|
|
8
8
|
/* @__PURE__ */x(h,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ce)},children:e.label})]},t)),
|
|
9
|
-
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),J(e=>/* @__PURE__ */new Set([...e,...R.map(
|
|
10
|
-
/* @__PURE__ */x(h,{onClick:()=>{c(),J(/* @__PURE__ */new Set)},children:oe.clearSelection}),
|
|
9
|
+
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),J(e=>/* @__PURE__ */new Set([...e,...R.map(M)]))},children:u?oe.selectAllLoaded(R.length):oe.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(h,{onClick:()=>{c(),J(/* @__PURE__ */new Set)},children:oe.clearSelection}),K&&/* @__PURE__ */x(h,{onClick:()=>{c(),K()},children:oe.refresh})]})}/* @__PURE__ */
|
|
11
11
|
return C("div",{className:"flex-1 flex flex-col mb-1 bg-white rounded-lg shadow overflow-hidden",children:[
|
|
12
|
-
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(i,{tableId:
|
|
13
|
-
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${
|
|
12
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(i,{tableId:E,columns:fe,sort:I,onSort:U,footer:ge,afterBody:ye,saveDefaultPerms:Z,children:e=>/* @__PURE__ */x("tbody",{ref:ne,className:"divide-y divide-gray-100",children:R.map((n,r)=>{const o=M(n);/* @__PURE__ */
|
|
13
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${O?.(n)??""}`,onClick:()=>B(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||u(e.target))return;e.preventDefault();const r=M(n);D.has(r)||J(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?F.find(e=>e.key===o)?.label:void 0;te({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:V?()=>V(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(a,{"aria-label":re.table.selectRow,checked:D.has(o),onChange:()=>le(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):H(n,e.key)},e.key))},o)})})})}),ke]})}export{S as EntityList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-H2Q7G5D6.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{StatCard as e,Card as a}from"./chunk-RKSCB5BJ.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-
|
|
1
|
+
import{StatCard as e,Card as a}from"./chunk-RKSCB5BJ.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-6EGZ4PV4.js";import{Avatar as s}from"./chunk-SCNQK5NF.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-YDJ5IZOU.js";import{Button_default as c}from"./chunk-UTISUEO4.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|