efficient-shell 8.34.0 → 8.35.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 +9 -0
- package/dist/{Browser-QBAMRKYI.js → Browser-ERZNOFN7.js} +14 -14
- package/dist/Calculator-NXIOZMML.js +29 -0
- package/dist/{CurrencyConverter-S7LG5PMX.js → CurrencyConverter-57WUTV4H.js} +12 -12
- package/dist/{Documents-E3GMXALJ.js → Documents-POWS4L44.js} +19 -19
- package/dist/{Files-2DWPYRM5.js → Files-O44UH6ZF.js} +43 -43
- package/dist/{Notepad-VQ66RWLT.js → Notepad-66ZCGUHC.js} +10 -10
- package/dist/PdfViewer-KSLOYXMD.js +1 -0
- package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-GLYNCO4H.js} +17 -17
- package/dist/{Preview-VZYFOH2U.js → Preview-WZDFVBNJ.js} +23 -23
- package/dist/Sidebar-QQFJJWE2.js +43 -0
- package/dist/{Spreadsheet-4KXRJSHT.js → Spreadsheet-OYAVNRCT.js} +14 -14
- package/dist/{Stock-VNFYS73L.js → Stock-CIHUZOQS.js} +7 -7
- package/dist/{Weather-DS4YZ6SH.js → Weather-UKLNJ3VF.js} +13 -13
- package/dist/{WorldClock-7S4TITSF.js → WorldClock-OZ3I7D2M.js} +6 -6
- package/dist/ai/index.d.ts +47 -9
- package/dist/ai/index.js +38 -33
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-L3NYH4QV.js → chunk-2AHHM4SK.js} +39 -39
- package/dist/{chunk-Z2YGQBLZ.js → chunk-2C6IG7LG.js} +1 -1
- package/dist/{chunk-7CFH6Y4T.js → chunk-2F7ZOMKK.js} +1 -1
- package/dist/chunk-2PWZNFFP.js +19 -0
- package/dist/{chunk-KIBL6M3T.js → chunk-2SHYR3RA.js} +4 -3
- package/dist/{chunk-G433MKIN.js → chunk-2U2GJCSP.js} +5 -5
- package/dist/{chunk-ZN3O2KJ7.js → chunk-2WL3Q7VW.js} +12 -12
- package/dist/{chunk-EYX6KLCZ.js → chunk-37CCKGHU.js} +1 -1
- package/dist/{chunk-XWLWG4HS.js → chunk-4GVH4ZUH.js} +1 -1
- package/dist/{chunk-GIM2422N.js → chunk-4HCRZHIX.js} +1 -1
- package/dist/{chunk-MXHEREC6.js → chunk-4MO375G3.js} +3 -3
- package/dist/{chunk-3BPF6PP3.js → chunk-4RNF6MNW.js} +2 -2
- package/dist/chunk-5FCEBKT2.js +7 -0
- package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
- package/dist/{chunk-KNVE7CMS.js → chunk-5OX6KXWY.js} +1 -1
- package/dist/{chunk-PNQ4EYYM.js → chunk-5YELPBUT.js} +3 -3
- package/dist/{chunk-QDOTMA3W.js → chunk-64ZHCEZN.js} +1 -1
- package/dist/{chunk-Y2D2YMFY.js → chunk-6ANFVX4M.js} +12 -12
- package/dist/{chunk-T5SEGUCJ.js → chunk-7ACSSYEZ.js} +13 -13
- package/dist/{chunk-GI7FOLDX.js → chunk-ACW3J77L.js} +1 -1
- package/dist/{chunk-ERMZ75FO.js → chunk-AF7R2MV4.js} +1 -1
- package/dist/{chunk-QQK3XS6H.js → chunk-AZU7YOES.js} +8 -8
- package/dist/{chunk-NFR4QZL2.js → chunk-BHMUOWAE.js} +4 -4
- package/dist/{chunk-TFMC2WAS.js → chunk-BKZGI76S.js} +1 -1
- package/dist/{chunk-UB4BTRSB.js → chunk-BYCOB6WT.js} +1 -1
- package/dist/chunk-BZMZTPS6.js +1 -0
- package/dist/chunk-CAMLFCGY.js +29 -0
- package/dist/{chunk-LCM5U6BY.js → chunk-CCPNMYCK.js} +1 -1
- package/dist/{chunk-RAAUW5OZ.js → chunk-DG2WU3BU.js} +2 -2
- package/dist/chunk-DIN3EFOM.js +14 -0
- package/dist/{chunk-WJ3XSJ6B.js → chunk-EBC4XFL2.js} +1 -1
- package/dist/{chunk-37JDUDCO.js → chunk-ECCUEG3J.js} +1 -1
- package/dist/{chunk-4C4SQ4YW.js → chunk-EM6BEHAD.js} +8 -8
- package/dist/{chunk-W5M6P4DZ.js → chunk-ETF7LAYZ.js} +5 -5
- package/dist/{chunk-LEC4SZIV.js → chunk-EVB35JP5.js} +1 -1
- package/dist/{chunk-FL2PUQX7.js → chunk-EW6FRPFJ.js} +1 -1
- package/dist/{chunk-JCMP5KMS.js → chunk-EZY4CO4A.js} +6 -6
- package/dist/{chunk-PJCVNFWM.js → chunk-FKZEGBLK.js} +10 -10
- package/dist/{chunk-DTSCO7VM.js → chunk-FMKTVZAO.js} +1 -1
- package/dist/{chunk-IZCODCSC.js → chunk-FTKKGGOQ.js} +1 -1
- package/dist/{chunk-FFJVCLGH.js → chunk-G2MJTE6X.js} +11 -11
- package/dist/{chunk-EZGY6CFN.js → chunk-GK3QH63P.js} +1 -1
- package/dist/{chunk-3WC6ITJ3.js → chunk-H33Z4ZIY.js} +6 -6
- package/dist/{chunk-CPXHU3Y2.js → chunk-HAIMJAI4.js} +2 -2
- package/dist/chunk-HMHL27AU.js +6 -0
- package/dist/{chunk-RSO67DWS.js → chunk-I4VD5D43.js} +4 -4
- package/dist/{chunk-BIYL7CEI.js → chunk-IFDW5QW6.js} +2 -2
- package/dist/{chunk-4AAGZQX7.js → chunk-IHEEJO5S.js} +1 -1
- package/dist/{chunk-WQNIXV4T.js → chunk-IUCIYWTT.js} +8 -8
- package/dist/chunk-JBQWR4SX.js +8 -0
- package/dist/{chunk-AX7KPMDV.js → chunk-JDKRQG7X.js} +2 -2
- package/dist/{chunk-LBLV64XG.js → chunk-JUGPTBMS.js} +1 -1
- package/dist/{chunk-BUGAWNOC.js → chunk-JVIOAZHW.js} +4 -4
- package/dist/{chunk-B2XDNBR3.js → chunk-L3G3YHVN.js} +1 -1
- package/dist/{chunk-ZEKM6HAA.js → chunk-M2AIC7IK.js} +2 -2
- package/dist/{chunk-KDZUWQEG.js → chunk-M2KV4WKR.js} +1 -1
- package/dist/{chunk-H3BC4KDE.js → chunk-M2LLVSBR.js} +1 -1
- package/dist/{chunk-SAKHGHF5.js → chunk-MC43PRTL.js} +1 -1
- package/dist/{chunk-USYNZGY4.js → chunk-MICWRC72.js} +7 -7
- package/dist/{chunk-WTY3SXO7.js → chunk-MY755PTJ.js} +1 -1
- package/dist/chunk-NKZNPYDB.js +3 -0
- package/dist/{chunk-YSFLXPUS.js → chunk-NUSSZJF2.js} +5 -5
- package/dist/{chunk-RGBX3EVC.js → chunk-O2YAB6WK.js} +8 -8
- package/dist/{chunk-3J5QUHPO.js → chunk-OFKWTOXK.js} +3 -3
- package/dist/{chunk-ZT5Y5JZB.js → chunk-P42YNSKI.js} +4 -4
- package/dist/{chunk-KKSW5IZ7.js → chunk-PCKYNZ5Y.js} +5 -5
- package/dist/{chunk-YW2DH6YQ.js → chunk-QPWD5CCS.js} +5 -5
- package/dist/{chunk-RUQEB2ZC.js → chunk-R4C3GGCS.js} +3 -3
- package/dist/{chunk-3V5Z2BJY.js → chunk-RB2F65YJ.js} +12 -12
- package/dist/{chunk-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
- package/dist/{chunk-XC55NMXR.js → chunk-S4IW5OL3.js} +1 -1
- package/dist/{chunk-PBMZJXSZ.js → chunk-S4J4B7LY.js} +5 -5
- package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
- package/dist/{chunk-BQ2IPQNR.js → chunk-SWHRP52Y.js} +1 -1
- package/dist/{chunk-NWP6IJYK.js → chunk-TANR67XF.js} +2 -2
- package/dist/{chunk-4F3IKYUO.js → chunk-TOVHLONK.js} +6 -6
- package/dist/{chunk-JOIWDQRJ.js → chunk-TRD22FC7.js} +6 -6
- package/dist/{chunk-YGZMD6TZ.js → chunk-TTY62G5D.js} +16 -16
- package/dist/{chunk-YCQVEJOT.js → chunk-TW6WYYBC.js} +2 -2
- package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
- package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
- package/dist/{chunk-V4KQUOUP.js → chunk-WKRFD4E4.js} +8 -8
- package/dist/{chunk-PDXD6DT7.js → chunk-WME5DFB6.js} +1 -1
- package/dist/{chunk-OSA24YH6.js → chunk-WSPO4N72.js} +14 -14
- package/dist/{chunk-3C67XRVJ.js → chunk-XB2YPUKR.js} +8 -8
- package/dist/{chunk-VB7Z3HXO.js → chunk-XDDTFV32.js} +1 -1
- package/dist/{chunk-UQBPKZUR.js → chunk-XZL3HCWH.js} +1 -1
- package/dist/{chunk-CRYEG7OT.js → chunk-YBB56N6X.js} +1 -1
- package/dist/{chunk-FRPNTDP4.js → chunk-ZNCU3UIW.js} +4 -4
- package/dist/{chunk-ZOSIPTXM.js → chunk-ZNXBKFV7.js} +5 -5
- package/dist/{chunk-RCMP37VO.js → chunk-ZRHQGFO5.js} +3 -3
- package/dist/{chunk-MEFXMUWI.js → chunk-ZXSMSVLU.js} +3 -3
- package/dist/data/ListLoadError.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/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +139 -139
- package/dist/map/index.js +6 -6
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-4JDJKSA7.js +0 -29
- package/dist/PdfViewer-67VBUIRD.js +0 -1
- package/dist/Sidebar-YB4OVUG5.js +0 -43
- package/dist/chunk-3JJFBUK6.js +0 -3
- package/dist/chunk-57SJKYA4.js +0 -29
- package/dist/chunk-AS4CTEZD.js +0 -8
- package/dist/chunk-HSOREHQB.js +0 -1
- package/dist/chunk-JJXFPGX4.js +0 -6
- package/dist/chunk-LYYR5DSP.js +0 -14
- package/dist/chunk-RERNKFEW.js +0 -19
- package/dist/chunk-W7S56JZ7.js +0 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return f("div",{role:"group","aria-label":P?void 0:N,"aria-labelledby":P,"aria-describedby":
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-HAIMJAI4.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{Tooltip as l}from"./chunk-22S6LG6D.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useId as s,useRef as c,useState as d,useEffect as u,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,t,r)=>Math.min(r,Math.max(t,e)),v=e=>e.reduce((e,t)=>e+t,0),g=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var y,b="w-0.5",w=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var x=["text-blue-700","text-gray-600"];function k({count:k,value:C,onChange:$,label:N,"aria-labelledby":P,readOnly:j=!1,disabled:M=!1,footer:z=!0,className:A=""}){const R=a().widths,S=s(),B=p(Math.round(k)||1,1,n),D=e(C,B),E=D??[...t[B]??[]],I=[...E,100-v(E)],O=j||M,K=c(null),T=c({onChange:$,shown:E,locked:O,n:B,stored:D});T.current={onChange:$,shown:E,locked:O,n:B,stored:D};const G=t=>{const{onChange:r,shown:n,locked:o,n:i}=T.current;if(o)return!1;const l=e(t,i);return!(!l||g(l,n))&&(r(l),!0)},H=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=p(Math.round(n),r,o-r),i[t+1]=o-i[t],G(i.slice(0,-1))&&(ie.current=null)},L=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=I[e]+I[e+1],i="ArrowRight"===t.key?I[e]+n:"ArrowLeft"===t.key?I[e]-n:"PageUp"===t.key?I[e]+10:"PageDown"===t.key?I[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),H(I,e,i))},U=c(null),[F,J]=d(null),V=()=>{U.current=null,J(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>V,[]);const W=e=>t=>{if(0!==t.button||O)return;t.preventDefault();const r=K.current?.getBoundingClientRect().width??0;r<=0||(U.current={i:e,x:t.clientX,width:r,from:I,moved:!1,pointer:t.pointerId},J(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},X=e=>{const t=U.current;if(!t)return;if(0===e.buttons)return void V();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}H(t.from,t.i,t.from[t.i]+r/t.width*100)},q=e=>{const t=U.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),V())},Q=(e,t)=>{const{shown:n}=T.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=p(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-v(n)],e,t);return G(o.slice(0,-1))?o:null},[Y,Z]=d(0);u(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Z(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const _=c(null),[ee,te]=d(null),[re,ne]=d([]),oe=(e,t)=>te(r=>t?e:r===e?null:r),ie=c(null),le=(e,t)=>{const r=ie.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=T.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:g(l,a))||n(r.stored),!0},ae=I.join(",");u(()=>{const e=null===ee?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===y&&(y=document.createElement("canvas").getContext("2d")),!y)return[];const o=y;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(_.current,ee);ne(t=>g(t,e)?t:e)},[ee,ae,Y]);const se=I.slice(0,-1).map((e,t)=>v(I.slice(0,t+1)));/* @__PURE__ */
|
|
2
|
+
return f("div",{role:"group","aria-label":P?void 0:N,"aria-labelledby":P,"aria-describedby":B>1?S:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${A}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */f("div",{ref:_,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
-
/* @__PURE__ */m("div",{ref:
|
|
5
|
-
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),
|
|
6
|
-
return m("div",{className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${i+e/2}% - ${l} / 2), calc(100% - ${l}))`,width:l},children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
7
|
-
/* @__PURE__ */m("span",{id:
|
|
8
|
-
/* @__PURE__ */m(i,{variant:"secondary",size:"sm",disabled:
|
|
4
|
+
/* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:I.map((e,t)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${x[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===B&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
5
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),B>1&&I.map((e,t)=>/* @__PURE__ */f(h,{children:[(()=>{const n=ee===t,i=v(I.slice(0,t)),l=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return m("div",{className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${i+e/2}% - ${l} / 2), calc(100% - ${l}))`,width:l},children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>Y>0&&Y*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(B-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:j,disabled:M,"aria-label":R.column(t+1),"aria-describedby":S,"data-widths-label":"",onChange:e=>{null===e||le(t,e)||Q(t,e)},onRevert:e=>((e,t)=>{T.current.locked||null===t||le(e,t)||Q(e,t)})(t,e),onFocus:()=>{ie.current={column:t,share:e,stored:T.current.stored},oe(t,!0)},onBlur:()=>oe(t,!1),className:`absolute inset-0 text-xs font-medium ${x[t%2]} ${re.includes(t)&&!n?"opacity-0":""}`})})})(),t<B-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${se[t]}%`},children:/* @__PURE__ */m(l,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":I[t],"aria-valuemin":r,"aria-valuemax":I[t]+I[t+1]-r,"aria-valuetext":R.dividerValue(t+1,I[t],t+2,I[t+1]),"aria-disabled":O||void 0,onKeyDown:O?void 0:L(t),onPointerDown:W(t),onPointerMove:X,onPointerUp:q,onPointerCancel:q,onLostPointerCapture:()=>{U.current&&V()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(O?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(O?`${b} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${F===t?"w-1":w}`)})})})})]},t))]}),B>1&&!z&&/* @__PURE__ */m("span",{id:S,className:"sr-only",children:R.hint(B,r)}),B>1&&z&&/* @__PURE__ */m("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */f("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
|
|
7
|
+
/* @__PURE__ */m("span",{id:S,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:R.hint(B,r)}),
|
|
8
|
+
/* @__PURE__ */m(i,{variant:"secondary",size:"sm",disabled:O,onClick:()=>{O||void 0===C||$(void 0)},className:"shrink-0",children:R.reset})]})})]})}export{k as WidthsBar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{useShellStrings as r}from"./chunk-E6UCGCOC.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-5FCEBKT2.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{iconButtonClasses as n}from"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{Tooltip as a}from"./chunk-22S6LG6D.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:R,align:W="end",side:z="bottom",menuMinWidth:L,linkAs:A,block:B=!1,className:D=""},F){const I=g&&(null!=N&&""!==N&&!1!==N)&&!v,S=x&&null!=j&&""!==j&&!1!==j,$=o(),E=/* @__PURE__ */t(i,{ref:F,type:b,variant:f,size:p,loading:v,leftIcon:k,block:B,disabled:g&&!I,"aria-disabled":!!I||void 0,disabledReason:I?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),K=B?"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:[B?"flex w-full":"inline-flex","items-stretch",D].filter(Boolean).join(" "),children:[null==w||""===w||I?E:/* @__PURE__ */t(a,{content:w,className:K,children:E}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:S?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":S?$:void 0,items:h,align:W,side:z,minWidth:L,linkAs:A,disabled:x&&!S,"aria-disabled":S,onOpenChange:y,footer:C,footerLabel:R,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:M,strokeWidth:2,"aria-hidden":"true"})})}),S&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-5PY4H4ZJ.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-4NXMMWL6.js";import{Icon as n}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-5PY4H4ZJ.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-4NXMMWL6.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:B=""}){const[T,
|
|
4
|
-
return m("div",{id:
|
|
3
|
+
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:B=""}){const[T,A]=i(!1),H=o(null),L=a().copy;c(()=>()=>{H.current&&clearTimeout(H.current)},[]);const M=l(async()=>{await e(n)?(A(!0),H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{A(!1),H.current=null},2e3),v?.(n)):t.error(L.failed)},[n,v,L]),{box:R,button:Y}=p[g],z=!k;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:z?void 0:j,"aria-describedby":z?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[N],R,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
5
|
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!k&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:T?
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?L.copyLabel(x):L.copy,"aria-describedby":C,onClick:M,className:`${Y} text-gray-400`,children:/* @__PURE__ */s(T?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:T?L.copied:""})]})]})}export{y as Snippet};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-FMKTVZAO.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as i}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{buttonClasses as c}from"./chunk-K7U4RWXJ.js";import{Icon as m}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as f}from"./chunk-E6UCGCOC.js";import{useRef as p,useState as x,useCallback as b,useEffect as g}from"react";import{createPortal as k}from"react-dom";import{jsx as w,jsxs as v,Fragment as y}from"react/jsx-runtime";var N=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function C(e){return e.kind?e.kind:r(e.url)?"video":N.test(e.url)?"file":"image"}var j="flex items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",U=e=>e.stopPropagation();function A({images:r,startIndex:N=0,onClose:A,onIndexChange:L,onOpenFile:R}){const $=f().lightbox,z=u(),D=p(null),I=p(null),[J,W]=x(N),E=r.length,F=z&&E>0,G=b(e=>{if(E<2)return;const t=((J+e)%E+E)%E;W(t),L?.(t)},[J,E,L]);if(i(F),l(D,F,I),a(F),g(()=>{if(F)return h(()=>(A(),!0),()=>D.current)},[F,A]),g(()=>{if(!F)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[F,G]),!F)return null;const K=r[Math.min(J,E-1)],O=C(K),V=K.caption||n(K.url);let M;return M="video"===O?/* @__PURE__ */w("video",{src:K.url,controls:!0,playsInline:!0,"aria-label":V,onClick:U,className:`${e} rounded-lg bg-black`}):"file"===O?/* @__PURE__ */v("div",{onClick:U,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-white px-10 py-8 text-center text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */w(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */w("span",{className:"max-w-[60ch] break-all text-sm font-medium text-gray-700",children:
|
|
4
|
-
/* @__PURE__ */v("div",{ref:
|
|
3
|
+
/* @__PURE__ */w("span",{className:"max-w-[60ch] break-all text-sm font-medium text-gray-700",children:V}),R?/* @__PURE__ */w(s,{size:"sm",onClick:()=>R(K),children:$.openFile}):/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:c({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */w(t,{src:K.url,alt:V,className:`${e} object-contain`,frameClassName:"rounded-lg"}),k(
|
|
4
|
+
/* @__PURE__ */v("div",{ref:D,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:d.overlay},onClick:A,children:[M,
|
|
5
5
|
/* @__PURE__ */v("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:U,children:[
|
|
6
|
-
/* @__PURE__ */w("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-white tabular-nums",children:$.counter(
|
|
7
|
-
/* @__PURE__ */w("button",{ref:
|
|
8
|
-
/* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),
|
|
9
|
-
/* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),
|
|
6
|
+
/* @__PURE__ */w("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-white tabular-nums",children:$.counter(J+1,E)}),
|
|
7
|
+
/* @__PURE__ */w("button",{ref:I,type:"button",onClick:A,"aria-label":$.close,className:`${j} h-8 w-8`,children:/* @__PURE__ */w(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),E>1&&/* @__PURE__ */v(y,{children:[
|
|
8
|
+
/* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),G(-1)},"aria-label":$.previous,className:`${j} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */w(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),G(1)},"aria-label":$.next,className:`${j} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */w(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
10
|
/* @__PURE__ */v("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:U,children:[
|
|
11
|
-
/* @__PURE__ */w("span",{className:"min-w-0 break-words text-center text-sm text-white/85",children:
|
|
11
|
+
/* @__PURE__ */w("span",{className:"min-w-0 break-words text-center text-sm text-white/85",children:V}),"file"!==O&&/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-white/70 underline decoration-white/30 underline-offset-2 hover:text-white",children:$.openOriginal})]})]}),document.body)}export{A as ImageLightbox,C as lightboxKind};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[
|
|
1
|
+
import{Segmented as e}from"./chunk-N6DTTOB6.js";import{ColorPicker as t}from"./chunk-G2MJTE6X.js";import{InputNumber_default as l}from"./chunk-HAIMJAI4.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{jsxs as a,Fragment as o,jsx as s}from"react/jsx-runtime";var i=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},S=(e,t,r,a,o,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(l,{value:a,onChange:i,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":t})}),C=n.map(j),O="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,A=null===O&&C.some(e=>null!==e),H=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",I=e=>j(e)??("number"==typeof d.width?d.width:null),T=d.style??u.style;/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[S("left",b.sides.left,h.left,I("left"),String(u.sides.left),e=>k("left",e)),S("top",b.sides.top,h.top,I("top"),String(u.sides.top),e=>k("top",e)),S("right",b.sides.right,h.right,I("right"),String(u.sides.right),e=>k("right",e)),S("bottom",b.sides.bottom,h.bottom,I("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):S("all",b.width,h.all,O,A?"–":H,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{block:!0,size:"sm",label:b.style,value:T,onChange:e=>{x||m({...d,style:e})},options:i.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
|
|
3
3
|
/* @__PURE__ */s("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
|
|
4
|
-
/* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(
|
|
4
|
+
/* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"sm",disabled:x})})]})}export{i as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-VU6VPKM3.js";import{
|
|
1
|
+
import{Card as e}from"./chunk-VU6VPKM3.js";import{FormField as t}from"./chunk-MVQBVPWP.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-GX2GSDJP.js";import{Button_default as a}from"./chunk-4IU5BSVE.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
5
5
|
/* @__PURE__ */c("h1",{className:"text-lg font-semibold text-gray-900",children:h.title}),
|
|
6
6
|
/* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:h.subtitle})]}),
|
|
7
|
-
/* @__PURE__ */c(e,{children:/* @__PURE__ */n("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===m&&/* @__PURE__ */c(
|
|
8
|
-
/* @__PURE__ */c(
|
|
9
|
-
/* @__PURE__ */c(
|
|
7
|
+
/* @__PURE__ */c(e,{children:/* @__PURE__ */n("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===m&&/* @__PURE__ */c(t,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */c(l,{id:"au-name",placeholder:"Alice Nguyen"})}),
|
|
8
|
+
/* @__PURE__ */c(t,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */c(l,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==m&&/* @__PURE__ */c(t,{label:"Password",htmlFor:"au-pass",hint:"register"===m?"At least 8 characters.":void 0,children:/* @__PURE__ */c(l,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===m&&/* @__PURE__ */n("div",{className:"flex items-center justify-between",children:[
|
|
9
|
+
/* @__PURE__ */c(r,{checked:u,onChange:d,label:"Remember me"}),
|
|
10
10
|
/* @__PURE__ */c("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
11
11
|
/* @__PURE__ */c(a,{type:"submit",block:!0,children:h.cta})]})}),
|
|
12
12
|
/* @__PURE__ */c("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */n(s,"register"===m?{children:["Already have an account? ",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-KZHPX4FM.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */p(t,{side:m,width:
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-KZHPX4FM.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-E6UCGCOC.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:C=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:j="bg-white"}){const z="right"===m,O=i().sidebar,P=a(),R=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[W,D]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),E=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:W},children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${E?"overflow-hidden":"overflow-y-auto"} ${C}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),E?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
3
|
+
/* @__PURE__ */p(t,{side:m,width:W,onResize:D,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:O.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${j}`,children:u});/* @__PURE__ */
|
|
4
4
|
return f("div",P?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
-
/* @__PURE__ */p(g,{phone:
|
|
6
|
-
/* @__PURE__ */p(v,{phone:
|
|
5
|
+
/* @__PURE__ */p(g,{phone:R,top:l,fallback:O.sections}),K,
|
|
6
|
+
/* @__PURE__ */p(v,{phone:R,bottom:n,label:O.sections,closeLabel:O.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[z?null:I,K,z?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
|
|
7
7
|
return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
8
8
|
/* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
9
9
|
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-
|
|
2
|
-
return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:w,"aria-label":j,"aria-labelledby":C,"aria-describedby":
|
|
1
|
+
import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
|
|
2
|
+
return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:w,"aria-label":j,"aria-labelledby":C,"aria-describedby":W,className:L=""}){const U=n(null),z=d(),A=d(),D=d();if(r(o),i(U,o,w),t(o),c(()=>{if(o)return l(()=>(N||a(),!0),()=>U.current)},[o,N,a]),!o)return null;const G="bottom"===p,R=G?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"fixed inset-0",style:{zIndex:s.overlay},role:"presentation",children:[
|
|
4
4
|
/* @__PURE__ */h("div",{className:"fixed inset-0 bg-black/30",onClick:N?void 0:a,"aria-hidden":"true"}),
|
|
5
|
-
/* @__PURE__ */m("div",{ref:U,...e({modal:!0,titleId:g?D:void 0,labelledBy:C,label:j}),"aria-describedby":
|
|
5
|
+
/* @__PURE__ */m("div",{ref:U,...e({modal:!0,titleId:g?D:void 0,labelledBy:C,label:j}),"aria-describedby":W??(y?A:k?z:void 0),"data-drawer-side":p,style:R,className:["fixed flex flex-col bg-white shadow-xl",G?"":`w-full max-w-full ${f[x]}`,u[p],G?"rounded-t-xl":"",L].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
6
|
/* @__PURE__ */m("div",{className:"min-w-0",children:[
|
|
7
|
-
/* @__PURE__ */h("h2",{id:D,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:
|
|
8
|
-
/* @__PURE__ */m("div",{id:z,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:
|
|
7
|
+
/* @__PURE__ */h("h2",{id:D,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:A,className:"mt-0.5 text-sm text-gray-500",children:y})]}),!N&&/* @__PURE__ */h(b,{onClose:a})]}):!N&&/* @__PURE__ */h("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */h(b,{onClose:a})}),
|
|
8
|
+
/* @__PURE__ */m("div",{id:z,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:A,className:("mb-3 text-sm text-gray-500 "+(N?"":"pr-8")).trim(),children:y}),k]}),v&&/* @__PURE__ */h("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:v})]})]})}export{p as Drawer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-RNBM5JZI.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{Icon as n}from"./chunk-
|
|
2
|
-
return i(e,{className:v,disabled:f,triggerLabel:C?b.button(d,x(C)):d,"aria-label":d,initialFocus:
|
|
1
|
+
import{Popover as e}from"./chunk-RNBM5JZI.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{Tooltip as a}from"./chunk-22S6LG6D.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{useRef as t}from"react";import{jsx as i,jsxs as o}from"react/jsx-runtime";var s={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function c({value:c,onChange:m,options:u,label:d,emptyValue:h,columns:p=5,disabled:f=!1,className:v=""}){const g=l(),b=g.iconPicker,N=g.iconNames,x=e=>e.label??N[e.value]??e.value,w=t([]),k=Math.max(0,u.findIndex(e=>e.value===c)),C=u[k],A=C?.value===h,j=t(null);/* @__PURE__ */
|
|
2
|
+
return i(e,{className:v,disabled:f,triggerLabel:C?b.button(d,x(C)):d,"aria-label":d,initialFocus:j,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */i("span",A||!C?{className:"text-sm",children:C?x(C):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:C.icon}),
|
|
3
3
|
/* @__PURE__ */i(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */i("div",{role:"listbox","aria-label":d,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${p}, 2rem)`},children:u.map((n,l)=>{const t=n.value===c;/* @__PURE__ */
|
|
4
|
-
return i(a,{content:x(n),children:/* @__PURE__ */i(r,{ref:e=>{w.current[l]=e,l===k&&(
|
|
4
|
+
return i(a,{content:x(n),children:/* @__PURE__ */i(r,{ref:e=>{w.current[l]=e,l===k&&(j.current=e)},role:"option","aria-selected":t,"aria-label":x(n),pressed:t,tabIndex:l===k?0:-1,onKeyDown:e=>((e,r)=>{const n=s[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/p)+n[0],l=e%p+n[1];if(a<0||l<0||l>=p)return;const t=a*p+l;if(!(t>=u.length)){for(const[e,r]of w.current.entries())r?.setAttribute("tabindex",e===t?"0":"-1");w.current[t]?.focus()}})(l,e),onClick:()=>{m(n.value),e()},children:/* @__PURE__ */i("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}export{c as IconPicker};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-
|
|
2
|
-
return u("div",{className:
|
|
1
|
+
import{calendarNames as e,firstDayOfWeek as t}from"./chunk-5OTS2G3M.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{useBrowserValue as a}from"./chunk-D65T4H6J.js";import{useShellStrings as n,useShellLocale as o}from"./chunk-E6UCGCOC.js";import{useMemo as l,useState as i,useRef as s,useEffect as c}from"react";import{jsxs as u,jsx as g,Fragment as d}from"react/jsx-runtime";var h=e=>String(e).padStart(2,"0"),m="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function b(e){return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function f(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var y=e=>`${e.getFullYear()}-${h(e.getMonth()+1)}`;var v=()=>b(/* @__PURE__ */new Date);var p=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),x=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function w({value:h,endValue:w,mode:N="single",onSelect:D,min:M,max:Y,month:k,defaultMonth:F,onMonthChange:C,weekStartsOn:j,quickJump:A=!0,markedDates:S,readOnly:$=!1,"aria-label":q,className:O=""}){const P=l(()=>new Set(S??[]),[S]),E=f(h),H=a(v,null),K=f(H),R=n().calendar,T=o(),U=e(T),G=a(()=>t(T),0),J=j??G,W=()=>{if(!K)return null;const e=y(K);return M&&e<M.slice(0,7)?M.slice(0,7):Y&&e>Y.slice(0,7)?Y.slice(0,7):e},[B,I]=i(()=>F||(E?y(E):W())),L=k??B??W(),V=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,K),[z,Q]=i(()=>h??H),X=s(null),Z=s(!1),[_,ee]=i("days"),te=l(()=>V?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(V,J):[],[L,J]),re=e=>!!M&&e<M||!!Y&&e>Y,ae=z??H,ne=te.some(e=>b(e)===ae),oe=V?te.find(e=>e.getMonth()===V.getMonth())??te[0]:null,le=ne&&ae?ae:oe?b(oe):"";if(c(()=>{Z.current&&(Z.current=!1,X.current?.querySelector('[data-active="true"]')?.focus())},[le,L]),!V)/* @__PURE__ */
|
|
2
|
+
return u("div",{className:O,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */g("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(V.getFullYear()+12*e,V.getMonth(),1):"months"===_?new Date(V.getFullYear()+e,V.getMonth(),1):x(V,e),se=e=>{const t=y(e);void 0===k&&
|
|
5
|
-
return u("div",{className:
|
|
4
|
+
/* @__PURE__ */g("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */g("div",0===t?{className:"py-1 text-xs",children:" "}:{className:m,children:/* @__PURE__ */g("span",{className:"aspect-square"})},t))})]});const ie=e=>"years"===_?new Date(V.getFullYear()+12*e,V.getMonth(),1):"months"===_?new Date(V.getFullYear()+e,V.getMonth(),1):x(V,e),se=e=>{const t=y(e);void 0===k&&I(t),C?.(t)},ce=q??U.monthYear(V.getFullYear(),V.getMonth());/* @__PURE__ */
|
|
5
|
+
return u("div",{className:O,children:[
|
|
6
6
|
/* @__PURE__ */u("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
8
|
-
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children
|
|
9
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":
|
|
10
|
-
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?
|
|
11
|
-
/* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly"
|
|
12
|
-
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+
|
|
13
|
-
/* @__PURE__ */g("div",{role:"columnheader","aria-label":
|
|
14
|
-
return g("div",{role:"gridcell","aria-selected":a,"aria-label"
|
|
7
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?R.previousYears:"months"===_?R.previousYear:R.previousMonth,onClick:()=>se(ie(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */g("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:A?/* @__PURE__ */u(d,{children:["years"!==_&&/* @__PURE__ */g("button",{type:"button","aria-label":R.chooseMonth(U.months[V.getMonth()]),onClick:()=>ee(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:U.months[V.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":R.chooseYear(V.getFullYear()),onClick:()=>ee(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:V.getFullYear()})]}):/* @__PURE__ */g("span",{children:U.monthYear(V.getFullYear(),V.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */g("button",{type:"button","aria-label":"years"===_?R.nextYears:"months"===_?R.nextYear:R.nextMonth,onClick:()=>se(ie(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */g(r,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":R.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:U.monthsShort.map((e,t)=>/* @__PURE__ */g("button",{type:"button","aria-pressed":t===V.getMonth(),onClick:()=>{se(new Date(V.getFullYear(),t,1)),ee("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===V.getMonth()?"bg-blue-600 font-semibold text-white":K&&t===K.getMonth()&&V.getFullYear()===K.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===_&&/* @__PURE__ */g("div",{role:"group","aria-label":R.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=V.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */g("button",{type:"button","aria-pressed":e===V.getFullYear(),onClick:()=>{se(new Date(e,V.getMonth(),1)),ee("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===V.getFullYear()?"bg-blue-600 font-semibold text-white":e===K?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */u("div",{ref:X,role:"grid","aria-label":ce,className:"space-y-1","aria-readonly":$||void 0,onKeyDown:e=>{const t=f(le)??K??V,r={ArrowLeft:()=>p(t,-1),ArrowRight:()=>p(t,1),ArrowUp:()=>p(t,-7),ArrowDown:()=>p(t,7),Home:()=>p(t,-(t.getDay()-J+7)%7),End:()=>p(t,6-(t.getDay()-J+7)%7),PageUp:()=>x(t,e.shiftKey?-12:-1),PageDown:()=>x(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),Z.current=!0,Q(b(a)),void(y(a)!==L&&se(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$||re(le)||D(le))},hidden:"days"!==_,children:[
|
|
12
|
+
/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+J)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */g("div",{role:"columnheader","aria-label":U.weekdays[e],className:"py-1",children:/* @__PURE__ */g("abbr",{title:U.weekdays[e],className:"no-underline",children:U.weekdaysShort[e]})},e))}),Array.from({length:6},(e,t)=>/* @__PURE__ */g("div",{role:"row",className:`${m} text-center text-sm`,children:te.slice(7*t,7*t+7).map(e=>{const t=b(e),r=e.getMonth()!==V.getMonth(),a=t===h||"range"===N&&t===w,n=(e=>!("range"!==N||!h||!w)&&e>h&&e<w)(t),o=re(t),l=U.longDate(e.getFullYear(),e.getMonth(),e.getDate()),i=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"cursor-not-allowed text-gray-300":a?"bg-blue-600 font-semibold text-white":n?"bg-blue-100 text-blue-800":r?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),t!==H||a?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),s=P.has(t)&&/* @__PURE__ */g("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(a?"bg-white":r?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return g("div",{role:"gridcell","aria-selected":a,"aria-label":$?l:void 0,children:$?/* @__PURE__ */u("span",{"aria-hidden":"true",className:`grid place-items-center ${i(!1)}`,children:[e.getDate(),s]}):/* @__PURE__ */u("button",{type:"button","data-active":t===le,tabIndex:t===le?0:-1,disabled:o,"aria-label":l,"aria-current":t===H?"date":void 0,onClick:()=>{Q(t),D(t)},className:i(!0),children:[e.getDate(),s]})},t)})},t))]})]})}export{w as Calendar,f as fromKey,b as toKey};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e,fromKey as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:
|
|
3
|
-
/* @__PURE__ */N(e,{mode:"range",min:
|
|
4
|
-
return v("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */v("div",{className:`${
|
|
6
|
-
/* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{
|
|
1
|
+
import{Calendar as e,fromKey as t}from"./chunk-RB2F65YJ.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-PF3ANJFI.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-E6UCGCOC.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${$(e.getMonth()+1)}`,$=e=>String(e).padStart(2,"0");function M(e){return`${e.getFullYear()}-${$(e.getMonth()+1)}-${$(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:M(new Date(r,n,t.getDate()-14)),to:M(a)};case"lastMonth":return{from:M(l(1)),to:M(o)};case"last3Months":return{from:M(l(3)),to:M(o)};case"last6Months":return{from:M(l(6)),to:M(o)};case"last12Months":return{from:M(l(12)),to:M(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function R({from:$,to:M,onChange:R,formatDisplay:O,clearable:J,required:T=!1,name:Y,id:H,"aria-labelledby":B,"aria-label":E,weekStartsOn:G,placeholder:L,fullWidth:U=!1,min:A,max:I,disabled:q=!1,allowOpenEnd:P=!1}){const z=p().dateRange,K=h(),V=O??(K?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(K):S),X=L??z.placeholder,Z=J??!T,[Q,_]=f(!1),[ee,te]=f($),[re,ne]=f(M),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Q,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Q||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Q||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!H&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!E||!!B||Ne,$e=/* @__PURE__ */new Date,[Me,De]=f(()=>$?C(j($)):W($e,A,I)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,$e),A,I)),je=e=>e?V(e):"";x(()=>{if(!Q)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Q]),x(()=>{q&&_(!1)},[q]);const Se=()=>{R("",""),_(!1)},Fe=$&&M?`${je($)} — ${je(M)}`:$?z.fromOnly(je($)):M?z.toOnly(je(M)):"",Re=o(K),Oe=e=>{const r=t(e);return r?Re.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Je=$&&M?z.range(Oe($),Oe(M)):$?z.fromOnly(Oe($)):M?z.toOnly(Oe(M)):X,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Ye=/* @__PURE__ */v(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,$e);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?z[e]:void 0,children:he?ye?z[e]:z[`${e}Short`]:z[e]},e)),
|
|
2
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:z.custom})]}),He=(e,t)=>P?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Be=e=>P&&le===e?" ring-1 ring-blue-400":"",Ee=
|
|
3
|
+
/* @__PURE__ */N(e,{mode:"range",min:A,max:I,value:ee||null,endValue:re||null,month:Me,onMonthChange:De,onSelect:e=>{oe("Custom"),P?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:G,"aria-label":z.dialog});/* @__PURE__ */
|
|
4
|
+
return v("div",{className:"relative"+(U?" w-full":""),ref:se,children:[
|
|
5
|
+
/* @__PURE__ */v("div",{className:`${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${$||M?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{q||(te($),ne(M),oe(null),ie($&&!M?"to":"from"),De($?C(j($)):W($e,A,I)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Q,id:H,disabled:q||void 0,"aria-label":E,"aria-labelledby":B,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Q?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */N(i,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */N("span",{className:"truncate",children:Fe||
|
|
9
|
-
/* @__PURE__ */N("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */N("input",{type:"hidden",name:
|
|
11
|
-
/* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":
|
|
12
|
-
/* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
13
|
-
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:
|
|
14
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${
|
|
15
|
-
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:
|
|
16
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${
|
|
17
|
-
/* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
8
|
+
/* @__PURE__ */N("span",{className:"truncate",children:Fe||X})]}),Z&&!q&&($||M)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":z.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Je}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:z.required}),Y&&/* @__PURE__ */v(w,{children:[
|
|
9
|
+
/* @__PURE__ */N("input",{type:"hidden",name:Y.from,value:$,disabled:q||void 0}),
|
|
10
|
+
/* @__PURE__ */N("input",{type:"hidden",name:Y.to,value:M,disabled:q||void 0})]}),Q&&y(
|
|
11
|
+
/* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":z.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
|
|
12
|
+
/* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[He("from",/* @__PURE__ */v(w,{children:[
|
|
13
|
+
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:z.from}),
|
|
14
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Be("from")}`,children:ee?je(ee):z.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),He("to",/* @__PURE__ */v(w,{children:[
|
|
15
|
+
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:z.to}),
|
|
16
|
+
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Be("to")}`,children:re?je(re):z.end})]}))]}),he?/* @__PURE__ */v(w,{children:[We.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:z.lastHeading}),
|
|
17
|
+
/* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ye,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:z[e]},e))]})]}),
|
|
18
18
|
/* @__PURE__ */N("div",{className:"w-full",children:Ee})]}):
|
|
19
19
|
/* @__PURE__ */v("div",{ref:be,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */N("div",{className:"w-64",children:Ee}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:
|
|
21
|
-
/* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[
|
|
22
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:
|
|
23
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>{
|
|
20
|
+
/* @__PURE__ */N("div",{className:"w-64",children:Ee}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ye})]}),
|
|
21
|
+
/* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[Z&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:l({variant:"ghost"}),children:z.clear}),
|
|
22
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:z.cancel}),
|
|
23
|
+
/* @__PURE__ */N("button",{type:"button",onClick:()=>{R(ee,re),_(!1)},disabled:P?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:z.apply})]})]}),document.body)]})}export{R as DateRangePicker,D as presetRange,M as toISODate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-2AHHM4SK.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,5 +1,5 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:C,suffix:L,showInput:N=!0,emptyLabel:j,placeholderValue:
|
|
3
|
-
return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${
|
|
4
|
-
/* @__PURE__ */m("input",{id:
|
|
5
|
-
/* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-HAIMJAI4.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-L65BESIE.js";import{useShellStrings as n}from"./chunk-E6UCGCOC.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:C,suffix:L,showInput:N=!0,emptyLabel:j,placeholderValue:A,stepFrom:E,label:M,"aria-labelledby":K,valueText:I,id:D,disabled:R,size:B="md",className:O="",auto:U}){const V=n(),W=o(),q=t(),G=U??q,H=o(),J=D??W,P=$??h(z),T=k??c,Q=C??S,X=void 0!==j||void 0!==A,Y=E??A,Z=p(r??A??c,c,S),_=d(null),[ee,te]=l(null),ie=Boolean(L);w(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,N]);const ne=e=>I?I(e):"string"==typeof L?`${e.toFixed(P)} ${L}`:void 0,re=null==r?j??(null!=A?ne(A)??String(A):void 0):ne(r),le=`calc(${b([c.toFixed(P),S.toFixed(P),r?.toFixed(P),j,A?.toFixed(P)])}ch + ${(ee?.frame??10+(ie?x:v))+2}px)`,ae=s(g),oe=o(),de=ae?.set;w(()=>{de&&de(oe,N?le:null)},[de,oe,le,N]),u(()=>()=>de?.(oe,null),[de,oe]);const se=i();/* @__PURE__ */
|
|
3
|
+
return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${O}`.trim(),children:[
|
|
4
|
+
/* @__PURE__ */m("input",{id:J,type:"range",min:c,max:S,step:z,value:Z,disabled:R,"aria-label":K?void 0:M,"aria-labelledby":K,"aria-valuetext":re,"aria-describedby":G?H: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 i=e.shiftKey&&null!=F;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(y((r??Y??Z)+t*(i?F??z:z),c,S,P))},onChange:e=>a(y(Number(e.target.value),c,S,P)),className:`min-w-24 flex-1 ${se?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===B?"h-1":"h-1.5"}`}),N&&
|
|
5
|
+
/* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<T||e>Q||a(e):X&&a(null)},min:T,max:Q,step:z,shiftStep:F,stepFrom:Y,precision:P,snap:!0,allowEmpty:X,suffix:L,disabled:R,placeholder:j??(null!=A?A.toFixed(P):void 0),size:se?void 0:"sm",auto:G,"aria-label":M?V.slider.value(M):void 0,"aria-labelledby":M?void 0:K})}),G&&/* @__PURE__ */m("span",{id:H,hidden:!0,children:V.settingView.auto})]})}export{z as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2SHYR3RA.js";import{useShellStrings as r}from"./chunk-E6UCGCOC.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";var s={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},c={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},a={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function i({tone:r}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"error",...t});default:/* @__PURE__ */
|