efficient-shell 12.2.0 → 12.3.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 +23 -0
- package/dist/{Browser-UK645CZ3.js → Browser-OE7IMID6.js} +14 -14
- package/dist/Calculator-W6YA44OY.js +29 -0
- package/dist/{CurrencyConverter-XNWE5MQW.js → CurrencyConverter-TLI6PVRE.js} +8 -8
- package/dist/Files-5WRVSC5R.js +121 -0
- package/dist/{Notepad-JP52QKUC.js → Notepad-TUW4JP7M.js} +10 -10
- package/dist/PdfViewer-GFQAIHDP.js +1 -0
- package/dist/{PomodoroTimer-SBV43YX6.js → PomodoroTimer-FPGRFPNT.js} +68 -68
- package/dist/{Preview-TKEDKVNI.js → Preview-BJRRRU4N.js} +23 -23
- package/dist/Sidebar-ROMFJHCD.js +44 -0
- package/dist/{Stock-GODZPUR3.js → Stock-P7D5WNKC.js} +3 -3
- package/dist/{Weather-2IIV4CFT.js → Weather-OUHUYBZ6.js} +18 -18
- package/dist/{WorldClock-JW4MLMCB.js → WorldClock-WXIV2KC6.js} +7 -7
- package/dist/ai/index.d.ts +9 -1
- package/dist/ai/index.js +79 -79
- 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/FlowChart.d.ts +25 -0
- package/dist/charts/FlowChart.js +2 -0
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.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/charts/flowSpec.d.ts +94 -0
- package/dist/charts/flowSpec.js +1 -0
- package/dist/{chunk-CTW2OKYS.js → chunk-2B4EKAZL.js} +2 -2
- package/dist/{chunk-YRZP7JN4.js → chunk-2KNVUOWJ.js} +16 -16
- package/dist/{chunk-VGWYAYHB.js → chunk-3QYAYBJE.js} +3 -3
- package/dist/{chunk-FOTDGSY5.js → chunk-45IVWLKF.js} +1 -1
- package/dist/chunk-4DZVWK7U.js +7 -0
- package/dist/{chunk-5V6SA77P.js → chunk-53WYJ5LZ.js} +11 -11
- package/dist/{chunk-CC42UKIT.js → chunk-54K2ADBT.js} +1 -1
- package/dist/{chunk-VFBBGLRA.js → chunk-5BV2WW74.js} +13 -13
- package/dist/{chunk-LUSIZ2BK.js → chunk-5LZTYOYD.js} +7 -7
- package/dist/{chunk-GJJKWGBX.js → chunk-67JHJO6V.js} +10 -10
- package/dist/{chunk-VZLYB5LX.js → chunk-6DZGOGB2.js} +1 -1
- package/dist/chunk-6GDZUW3L.js +6 -0
- package/dist/{chunk-JCUG572K.js → chunk-6JDR6T4U.js} +1 -1
- package/dist/{chunk-PKNHSZWK.js → chunk-6JKSRXZM.js} +3 -3
- package/dist/{chunk-BXZNMSTZ.js → chunk-6NHPL5JL.js} +1 -1
- package/dist/{chunk-7EK7JNR4.js → chunk-6TLSXBKC.js} +1 -1
- package/dist/{chunk-NHBDLW52.js → chunk-6Y2BQI44.js} +1 -1
- package/dist/{chunk-XQUXL75F.js → chunk-74LZVJND.js} +1 -1
- package/dist/{chunk-GFBQ53WN.js → chunk-7HIHQR3X.js} +1 -1
- package/dist/{chunk-56ESGDIC.js → chunk-7JY3YYN4.js} +4 -4
- package/dist/{chunk-VQPZDZ3R.js → chunk-7TZRICMH.js} +4 -4
- package/dist/{chunk-EEVKJJ5S.js → chunk-AANXPLMA.js} +4 -4
- package/dist/{chunk-YKHAI5IZ.js → chunk-ASQX3GXB.js} +5 -5
- package/dist/chunk-AUZKIL62.js +23 -0
- package/dist/{chunk-4RTDZSGH.js → chunk-B3PNZBZM.js} +18 -18
- package/dist/{chunk-7ZYEDXZX.js → chunk-BGJMDP6J.js} +1 -1
- package/dist/{chunk-DSHEOC2O.js → chunk-CVLWJBR5.js} +1 -1
- package/dist/chunk-DCICBH2L.js +3 -0
- package/dist/chunk-DICWZEGH.js +2 -0
- package/dist/{chunk-UDJLRTQB.js → chunk-DNLRUZGS.js} +1 -1
- package/dist/{chunk-ACNDPAAT.js → chunk-DONZDILI.js} +1 -1
- package/dist/{chunk-J5ISQYVM.js → chunk-DPUM3H5N.js} +1 -1
- package/dist/{chunk-ZACNIKIQ.js → chunk-DULMOL3I.js} +1 -1
- package/dist/{chunk-CQCMJHDM.js → chunk-F245EG2A.js} +5 -5
- package/dist/{chunk-BFA5U5JF.js → chunk-F44E76EC.js} +11 -11
- package/dist/chunk-FAERBT6Y.js +1 -0
- package/dist/{chunk-Z43XVU2P.js → chunk-FGCIEJPP.js} +1 -1
- package/dist/{chunk-AQULCKKZ.js → chunk-FPRQB5W6.js} +11 -11
- package/dist/{chunk-KHVECW4M.js → chunk-FPZBHNZU.js} +6 -6
- package/dist/{chunk-27XV4TAU.js → chunk-GR43CABV.js} +2 -2
- package/dist/{chunk-LLBH6PHE.js → chunk-GYDCXCJT.js} +1 -1
- package/dist/{chunk-VW7W6LCV.js → chunk-H6PFTU3L.js} +1 -1
- package/dist/{chunk-SCCAMJB4.js → chunk-HE767CVB.js} +1 -1
- package/dist/{chunk-M7DFM2N7.js → chunk-HRMG2WMW.js} +63 -63
- package/dist/{chunk-L75RBQFH.js → chunk-IL56C56I.js} +2 -2
- package/dist/{chunk-VPYD7UJM.js → chunk-IMRGGJIJ.js} +3 -3
- package/dist/chunk-IWFWPFYQ.js +13 -0
- package/dist/chunk-IXAYZNOZ.js +11 -0
- package/dist/{chunk-DU5IBIZQ.js → chunk-JYGUTY6R.js} +1 -1
- package/dist/{chunk-DKUF7BD5.js → chunk-KDWK5WGU.js} +1 -1
- package/dist/{chunk-CKURTHGW.js → chunk-KT5LLPUV.js} +1 -1
- package/dist/chunk-KZD2AFH2.js +13 -0
- package/dist/{chunk-MKP2HSWX.js → chunk-KZNJXV5I.js} +3 -3
- package/dist/{chunk-QBD7V4TK.js → chunk-LBMC6GR5.js} +1 -1
- package/dist/{chunk-XARBHOEZ.js → chunk-LDEFEPPL.js} +1 -1
- package/dist/{chunk-ONYPN3JY.js → chunk-LGK47SEN.js} +11 -11
- package/dist/{chunk-ESDWHHQY.js → chunk-LKVS4WCZ.js} +1 -1
- package/dist/chunk-M3OEWPXZ.js +1 -0
- package/dist/chunk-M3PUAGXJ.js +9 -0
- package/dist/{chunk-BXZSLRNO.js → chunk-MQKUGIN7.js} +12 -12
- package/dist/{chunk-63QLZYMN.js → chunk-NDLXD4EY.js} +5 -5
- package/dist/{chunk-2OMM2AG3.js → chunk-NEAT7BIP.js} +1 -1
- package/dist/{chunk-HS4EWT6L.js → chunk-NHNRNT4T.js} +2 -2
- package/dist/{chunk-NZYI4XV5.js → chunk-NRLTGGCS.js} +5 -5
- package/dist/chunk-NSOAHIQZ.js +11 -0
- package/dist/{chunk-TTSZSLQL.js → chunk-O6H2ZD32.js} +7 -7
- package/dist/{chunk-XBDHRMQI.js → chunk-OR5HUQSB.js} +9 -9
- package/dist/{chunk-FWUXYNWF.js → chunk-OY3JH66O.js} +4 -4
- package/dist/chunk-P3BLJCTQ.js +19 -0
- package/dist/{chunk-SX5CSXZO.js → chunk-P4L74UA5.js} +2 -2
- package/dist/chunk-PA273FZF.js +9 -0
- package/dist/{chunk-5THF6BJS.js → chunk-PFMZL3ZG.js} +2 -2
- package/dist/{chunk-PXIP246B.js → chunk-PT77FC5X.js} +1 -1
- package/dist/{chunk-AJ5NU7UH.js → chunk-Q2MW334M.js} +1 -1
- package/dist/{chunk-ORLQUGIN.js → chunk-QA33EHHO.js} +4 -4
- package/dist/{chunk-GRB4LKZC.js → chunk-QOQ6GXVA.js} +5 -5
- package/dist/{chunk-4UGFNTZ3.js → chunk-RQ4UIWWD.js} +11 -11
- package/dist/{chunk-2DOMIOYR.js → chunk-RYBYTUGZ.js} +1 -1
- package/dist/{chunk-JCTOQOVO.js → chunk-S6BGMLXI.js} +1 -1
- package/dist/chunk-SEJAT3UE.js +1 -0
- package/dist/{chunk-7F4U43YN.js → chunk-SGNJ7I7P.js} +4 -4
- package/dist/{chunk-ZYFBV4C7.js → chunk-SKFFBBAG.js} +2 -2
- package/dist/{chunk-FEJFGFPF.js → chunk-SPJIFRNY.js} +6 -6
- package/dist/{chunk-QN56R4V4.js → chunk-SSUZAOGI.js} +10 -10
- package/dist/{chunk-CENTHUBD.js → chunk-SYDGCECZ.js} +8 -8
- package/dist/{chunk-5F6KJAF3.js → chunk-THASH6OO.js} +13 -13
- package/dist/{chunk-I7H3OIYX.js → chunk-TKXUDCOI.js} +1 -1
- package/dist/{chunk-ZG3RF2VE.js → chunk-U7PXMVIY.js} +1 -1
- package/dist/chunk-UCIOCS4X.js +2 -0
- package/dist/{chunk-MRFNJZRR.js → chunk-UIWGVOFH.js} +8 -4
- package/dist/{chunk-HB2XXIQG.js → chunk-UMQLDWSS.js} +6 -6
- package/dist/chunk-VF53GD6D.js +5 -0
- package/dist/{chunk-CRU2BNEM.js → chunk-XGVMOV3O.js} +7 -7
- package/dist/{chunk-LOEOCZCN.js → chunk-Y4RERPFN.js} +1 -1
- package/dist/{chunk-ZUBTNUVE.js → chunk-Y7ANTS5W.js} +1 -1
- package/dist/chunk-YAQ5RF3H.js +28 -0
- package/dist/{chunk-ANSQT5ZS.js → chunk-ZATTQ3FX.js} +1 -1
- package/dist/{chunk-CRB5GM4W.js → chunk-ZDO62V4I.js} +1 -1
- package/dist/{chunk-HICNRXYB.js → chunk-ZICLAMMR.js} +1 -1
- package/dist/{chunk-IRZ6XM5A.js → chunk-ZXNJSSRV.js} +1 -1
- package/dist/{chunk-6XC3XX7F.js → chunk-ZZ67Q5HJ.js} +6 -6
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.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/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.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.d.ts +2 -0
- package/dist/index.js +516 -516
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.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/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-6XGTP5OQ.js +0 -29
- package/dist/Files-LVZNO6EQ.js +0 -121
- package/dist/PdfViewer-ZI3QOG4G.js +0 -1
- package/dist/Sidebar-XVVZJ7PR.js +0 -44
- package/dist/chunk-2T7MZ77B.js +0 -3
- package/dist/chunk-A2ZEGD2S.js +0 -11
- package/dist/chunk-AJO55X66.js +0 -6
- package/dist/chunk-BD4OHYQB.js +0 -13
- package/dist/chunk-BPECY7I7.js +0 -13
- package/dist/chunk-CWTY4GTU.js +0 -5
- package/dist/chunk-FUUJJ7OH.js +0 -7
- package/dist/chunk-GEZ45J4Z.js +0 -2
- package/dist/chunk-GGSPY3Q4.js +0 -23
- package/dist/chunk-HFDSKCPL.js +0 -1
- package/dist/chunk-HGZZXA2N.js +0 -9
- package/dist/chunk-HTDZ3XAJ.js +0 -9
- package/dist/chunk-HY3JYAUH.js +0 -19
- package/dist/chunk-UE54EN4C.js +0 -2
- package/dist/chunk-UVEHJRPE.js +0 -1
- package/dist/chunk-YAD7TML2.js +0 -28
- /package/dist/{chunk-MXK7A6ZM.js → chunk-K5A62ZS5.js} +0 -0
- /package/dist/{chunk-C4XV42QP.js → chunk-R3K2BNFF.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as t}from"./chunk-
|
|
1
|
+
import{Icon as t}from"./chunk-UIWGVOFH.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
|
|
2
2
|
/* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
|
|
3
3
|
/* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
|
|
4
4
|
return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-4DZVWK7U.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{inputClasses as n,PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{iconButtonClasses as i}from"./chunk-UQYNPYF4.js";import{Tooltip as a}from"./chunk-NJN5IKWO.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(a,{content:s,describe:!1,children:m?/* @__PURE__ */o(e,{"aria-label":s,trigger:l,items:m,triggerClassName:i({size:
|
|
5
|
-
/* @__PURE__ */o("input",{ref:f,"aria-invalid":e||void 0,readOnly:u,className:
|
|
3
|
+
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:n,size:t}){const{label:s,icon:l,onClick:c,menu:m}=n;/* @__PURE__ */
|
|
4
|
+
return o(a,{content:s,describe:!1,children:m?/* @__PURE__ */o(e,{"aria-label":s,trigger:l,items:m,triggerClassName:i({size:t})}):/* @__PURE__ */o(r,{"aria-label":s,size:t,onClick:c,children:l})})}var f=s(function({invalid:e,leftIcon:r,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const N=s??"md",g=`${r?"pl-10":""} ${a?m[N]:i?"pr-10":""}`.trim(),v=
|
|
5
|
+
/* @__PURE__ */o("input",{ref:f,"aria-invalid":e||void 0,readOnly:u,className:n({invalid:e,size:s,readOnly:u,className:[g,c].filter(Boolean).join(" ")}),...h});return r||i||a?/* @__PURE__ */l("div",{className:"relative",children:[r&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${t}`,children:r}),v,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:N})}):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,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:
|
|
3
|
-
/* @__PURE__ */c("input",{id:
|
|
4
|
-
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-SKFFBBAG.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({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 c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:F,precision:z,inputMin:k,inputMax:N,suffix:j,showInput:M=!0,emptyLabel:$,placeholderValue:A,stepFrom:K,label:L,"aria-labelledby":C,valueText:D,id:B,disabled:E,size:R="md",boxSize:W="sm",className:P="",auto:T}){const V=n(),q=o(),G=t(),H=T??G,I=o(),J=B??q,O=z??p(S),U=k??w,Q=N??g,X=void 0!==$||void 0!==A,Y=K??A,Z=f(r??A??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{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,M]);const ne=e=>D?D(e):"string"==typeof j?`${e.toFixed(O)} ${j}`:void 0,re=null==r?$??(null!=A?ne(A)??String(A):void 0):ne(r),le=`calc(${x([w.toFixed(O),g.toFixed(O),r?.toFixed(O),$,A?.toFixed(O)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,M?le:null)},[de,oe,le,M]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${P}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */c("input",{id:J,type:"range",min:w,max:g,step:S,value:Z,disabled:E,"aria-label":C?void 0:L,"aria-labelledby":C,"aria-valuetext":re,"aria-describedby":H?I: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(b((r??Y??Z)+t*(i?F??S:S),w,g,O))},onChange:e=>a(b(Number(e.target.value),w,g,O)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===R?"h-1":"h-1.5")}),M&&
|
|
4
|
+
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<U||e>Q||a(e):X&&a(null)},min:U,max:Q,step:S,shiftStep:F,stepFrom:Y,precision:O,snap:!0,allowEmpty:X,suffix:j,disabled:E,placeholder:$??(null!=A?A.toFixed(O):void 0),size:W,auto:H,"aria-label":L?V.slider.value(L):void 0,"aria-labelledby":L?void 0:C})}),H&&/* @__PURE__ */c("span",{id:I,hidden:!0,children:V.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return t("div",{id:
|
|
3
|
-
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:
|
|
4
|
-
/* @__PURE__ */s("div",{ref:
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-SKFFBBAG.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{Icon as a}from"./chunk-UIWGVOFH.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{useState as l,useRef as o}from"react";import{jsxs as t,jsx as s}from"react/jsx-runtime";var d={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function u({label:u,value:m,corners:f,onChange:p,radius:h=null,onRadiusChange:v,radiusLabel:b,radiusMin:k=0,radiusMax:g,radiusStep:x=1,radiusPlaceholder:w,disabled:y=!1,disabledReason:A,id:N,className:j=""}){const K=n(),C=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(f),[L,M]=l(0),R=o(null);/* @__PURE__ */
|
|
2
|
+
return t("div",{id:N,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${j}`.trim(),children:[v&&
|
|
3
|
+
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:K.corners.radiusMark}),suffix:K.corners.unit,steppers:"compact",disabled:y,"aria-label":b??K.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */s("div",{ref:R,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(R.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:C.map((e,n)=>{const l=m.includes(e.value),o=y||!0===e.disabled,t=o&&(!0===e.disabled&&e.title||(y?A:void 0))||void 0,c=/* @__PURE__ */s(r,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":o||void 0,disabledReason:t,"data-corner":e.value,size:"sm",tabIndex:n===L?0:-1,onFocus:()=>M(n),onClick:()=>{o||p(l?m.filter(r=>r!==e.value):[...m,e.value])},children:/* @__PURE__ */s(a,{name:"corner",strokeWidth:2,className:["h-4 w-4",d[e.value]??""].filter(Boolean).join(" ")})},e.value);return t?c:/* @__PURE__ */s(i,{content:e.title??e.label,children:c},e.value)})})]})}export{u as CornersInput};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":
|
|
3
|
-
/* @__PURE__ */t(
|
|
4
|
-
/* @__PURE__ */t(
|
|
5
|
-
return c(d,{children:[u?/* @__PURE__ */t(
|
|
1
|
+
import{OneLineLabel as e}from"./chunk-WGLHB6WE.js";import{swallowPress as i,describedByWith as r,OffWithReason as a}from"./chunk-TE6R53YD.js";import{Icon as o}from"./chunk-UIWGVOFH.js";import{Tooltip as s}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
|
|
2
|
+
return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":r(b,u?m:void 0),onClick:u?i:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
|
|
3
|
+
/* @__PURE__ */t(o,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
4
|
+
/* @__PURE__ */t(e,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
|
|
5
|
+
return c(d,{children:[u?/* @__PURE__ */t(a,{reason:n.disabledReason,id:m,children:f}):/* @__PURE__ */t(s,{content:n.shown?w.shownHint:w.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:f}),p]},n.id)})})}export{b as DisplayChips};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{Calendar as e}from"./chunk-LGK47SEN.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-7JY3YYN4.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{buttonClasses as u}from"./chunk-UQYNPYF4.js";import{Icon as h}from"./chunk-UIWGVOFH.js";import{onOverlayOpen as p}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as f}from"./chunk-62LW225J.js";import{useDropdownPosition as g}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-43MCNASD.js";import{useState as w,useRef as N,useId as k,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as j,jsx as D}from"react/jsx-runtime";var Y=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],$=t;function F(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function O(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var H=/* @__PURE__ */new Map;function L({from:t,to:n,onChange:m,formatDisplay:$,clearable:L,required:G=!1,name:B,id:E,"aria-labelledby":J,"aria-label":T,weekStartsOn:U,placeholder:A,fullWidth:I=!1,min:R,max:q,disabled:K=!1,allowOpenEnd:P=!1}){const V=v().dateRange,Z=y(),z=$??(Z?function(e){let t=H.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),H.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(Z):O),Q=A??V.placeholder,X=L??!G,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=N(null),de=N(null),me=N(null),ue=k(),he=k(),pe=k(),[fe,ge]=w(!1),be=g(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=N(null),ve=N(null),[ye,we]=w(!0);b(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const Ne=N(null);b(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==Ne.current&&Ne.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;Ne.current=e,e>r+.5&&ge(!0)}});const[ke,Ce]=w(!1);b(()=>{const e=!!E&&(de.current?.labels?.length??0)>0;e!==ke&&Ce(e)});const Me=!!T||!!J||ke,We=/* @__PURE__ */new Date,[je,De]=w(()=>t?t.slice(0,7):S(We,R,q)),Ye=Y.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,We),R,q)),$e=e=>e?z(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=p(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{K&&ee(!1)},[K]);const Fe=()=>{m("",""),ee(!1)},Se=X&&!K&&Boolean(t||n),Oe=t&&n?`${$e(t)} — ${$e(n)}`:t?V.fromOnly($e(t)):n?V.toOnly($e(n)):"",He=d(Z),Le=e=>{const t=r(e);return t?He.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ge=t&&n?V.range(Le(t),Le(n)):t?V.fromOnly(Le(t)):n?V.toOnly(Le(n)):Q,Be=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ee=/* @__PURE__ */W(j,{children:[Ye.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,We);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Be(e),"aria-label":fe?V[e]:void 0,children:fe?ye?V[e]:V[`${e}Short`]:V[e]},e)),
|
|
2
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Be("Custom"),children:V.custom})]}),Je=(e,t)=>P?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Te=e=>P&&ie===e?" ring-1 ring-blue-400":"",Ue=
|
|
3
|
+
/* @__PURE__ */D(e,{mode:"range",min:R,max:q,value:te||null,endValue:ne||null,month:je,onMonthChange:De,onSelect:e=>{le("Custom"),P?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:U,"aria-label":V.dialog});/* @__PURE__ */
|
|
4
|
+
return W("div",{className:"relative"+(I?" w-full":""),ref:ce,children:[
|
|
5
|
+
/* @__PURE__ */W("div",{className:`relative ${I?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${K?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{K||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(We,R,q)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:E,disabled:K||void 0,"aria-label":T,"aria-labelledby":J,"aria-describedby":[Me?he:void 0,G?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(I?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
|
+
/* @__PURE__ */D(h,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
+
/* @__PURE__ */D("span",{className:"truncate",children:Oe||Q})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:V.clearRange,icon:/* @__PURE__ */D(h,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Ge}),G&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:V.required}),B&&/* @__PURE__ */W(j,{children:[
|
|
9
|
+
/* @__PURE__ */D("input",{type:"hidden",name:B.from,value:t,disabled:K||void 0}),
|
|
10
|
+
/* @__PURE__ */D("input",{type:"hidden",name:B.to,value:n,disabled:K||void 0})]}),_&&M(
|
|
11
|
+
/* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":V.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:f.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
|
|
12
|
+
/* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Je("from",/* @__PURE__ */W(j,{children:[
|
|
13
|
+
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:V.from}),
|
|
14
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Te("from")}`,children:te?$e(te):V.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Je("to",/* @__PURE__ */W(j,{children:[
|
|
15
|
+
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:V.to}),
|
|
16
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Te("to")}`,children:ne?$e(ne):V.end})]}))]}),fe?/* @__PURE__ */W(j,{children:[Ye.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:V.lastHeading}),
|
|
17
|
+
/* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ee,Ye.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */D("div",{className:"w-full",children:Ue})]}):
|
|
19
|
+
/* @__PURE__ */W("div",{ref:xe,className:"flex w-max gap-4",children:[
|
|
20
|
+
/* @__PURE__ */D("div",{className:"w-64",children:Ue}),Ye.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ee})]}),
|
|
21
|
+
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */D("button",{type:"button",onClick:Fe,className:u({variant:"ghost"}),children:V.clear}),
|
|
22
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:u({variant:"secondary"}),children:V.cancel}),
|
|
23
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:P?!te&&!ne:!te||!ne,className:u({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{L as DateRangePicker,F as presetRange,$ as toISODate};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
2
|
-
return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
3
|
-
return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
4
|
-
return d(f.Provider,{value:
|
|
5
|
-
/* @__PURE__ */m(e,{open:r,onClose:()=>
|
|
6
|
-
/* @__PURE__ */m("button",{ref:
|
|
7
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
1
|
+
import{Dialog as e}from"./chunk-VF53GD6D.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-UIWGVOFH.js";import{useShellStrings as n,splitAround as o}from"./chunk-43MCNASD.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function P(){/* @__PURE__ */
|
|
2
|
+
return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F(){/* @__PURE__ */
|
|
3
|
+
return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),j=a(null),D=a(0),E=a([]),T=a(null),W=a(null),$=c(e=>{j.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),V=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++D.current,options:t,resolve:e};null===j.current?$(r):E.current.push(r)})},[$]),[G,K]=s(!1),[U,Y]=s({message:""}),[A,H]=s(""),I=a(),M=c(e=>(Y(e),H(""),K(!0),new Promise(e=>{I.current=e})),[]),[O,Q]=s(!1),[S,q]=s({}),[z,B]=s(""),J=a(),R=c(e=>{const t="string"==typeof e?{message:e}:e;return q(t),B(t.defaultValue??""),Q(!0),new Promise(e=>{J.current=e})},[]);u(()=>{g=V,v=M,x=R},[V,M,R]);const X=(e,t)=>{if(j.current!==e)return;const r=N.current,n=E.current.shift();n?$(n):(j.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{K(!1),H(""),I.current?.(e)},_=e=>{if(e){const e=z.trim();if(!e&&!S.allowEmpty)return Q(!1),void J.current?.(null);Q(!1),J.current?.(e)}else Q(!1),J.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===U.variant?"warning":"danger"],ne=U.confirmWord,oe=null==ne||A===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
|
|
4
|
+
return d(f.Provider,{value:V,children:[t,
|
|
5
|
+
/* @__PURE__ */m(e,{open:r,onClose:()=>X(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
|
|
6
|
+
/* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>X(p,!1),className:w,children:i.cancelLabel||le.cancel}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>X(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
8
8
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
9
9
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
10
10
|
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
|
|
11
11
|
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
|
|
12
|
-
/* @__PURE__ */d(e,{open:
|
|
13
|
-
/* @__PURE__ */m("button",{ref
|
|
14
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
12
|
+
/* @__PURE__ */d(e,{open:G,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:W,footer:/* @__PURE__ */d(h,{children:[
|
|
13
|
+
/* @__PURE__ */m("button",{ref:W,type:"button",onClick:()=>Z(!1),className:w,children:U.cancelLabel||le.destructiveCancel}),
|
|
14
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??U.confirmLabel??le.destructiveConfirm})]}),children:[
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(F,{})}),
|
|
16
16
|
/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
17
17
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
18
18
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
19
|
-
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:
|
|
20
|
-
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:
|
|
19
|
+
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:U.title||le.destructiveTitle}),
|
|
20
|
+
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:U.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
|
|
21
21
|
/* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
22
22
|
/* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
|
|
23
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:A,onChange:e=>
|
|
24
|
-
/* @__PURE__ */d(e,{open:
|
|
25
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:
|
|
26
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!
|
|
27
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:
|
|
23
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:A,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key&&A===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
|
|
24
|
+
/* @__PURE__ */d(e,{open:O,onClose:()=>_(!1),title:S.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
|
|
25
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:S.cancelLabel||le.cancel}),
|
|
26
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!S.allowEmpty&&!z.trim(),className:C,children:S.confirmLabel||le.ok})]}),children:[S.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:S.message}),
|
|
27
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:S.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{j as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{mediaMoveSubmenu as e}from"./chunk-32WEY6O5.js";import{optionNoteClass as n}from"./chunk-URHGHXDN.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{mediaMoveSubmenu as e}from"./chunk-32WEY6O5.js";import{optionNoteClass as n}from"./chunk-URHGHXDN.js";import{Icon as r}from"./chunk-UIWGVOFH.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
|
|
2
2
|
/* @__PURE__ */l("span",{children:e}),
|
|
3
3
|
/* @__PURE__ */l("span",{className:n(),children:r})]}):e}function t(n,r){const{words:d,denied:l}=r,a=[],t=(e,n,r,d={})=>{if(!r)return;const o=d.deny?l[d.deny]:void 0;a.push({key:e,label:i(n,o),icon:d.icon,danger:d.danger,disabled:!!o||!!d.off,onSelect:r})},c=(n,d,i,t)=>{const c=r.move;c&&a.push(e({count:d,kind:i,head:t,icon:o("folder"),disabled:!!l.move,targets:r.moveTargets(n),onPick:e=>c(n,e.key===s?null:e.key)},r.media))},h=e=>{a.length&&a.push({type:"divider",key:e})};switch(n.kind){case"folder":{const e={kind:"folder",id:n.id};if(t("new",d.newSubfolder,r.newSubfolder&&(()=>r.newSubfolder(n.id)),{icon:o("folder-plus"),deny:"newFolder"}),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"folder",id:n.id})),{icon:o("edit"),deny:"rename"}),c(e,1,"file",!1),r.deleteFolder){h("d-delete");const e=!l.deleteFolder&&!!r.folderNotEmpty?.(n.id);a.push({key:"delete-folder",label:i(d.deleteFolder,l.deleteFolder??(e?d.folderNotEmpty:void 0)),icon:o("trash"),danger:!0,disabled:!!l.deleteFolder||e,onSelect:()=>r.deleteFolder(n.id)})}return a}case"files":{const{ids:e}=n,l=1===e.length,i={kind:"files",ids:e};l||a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),c(i,e.length,r.kindOf(e),!0),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"file",id:e[0]})),{icon:o("edit"),deny:"rename",off:!l}),t("replace",d.replace,r.replace&&(()=>r.replace(e[0])),{icon:o("swap"),deny:"replace",off:!l}),t("copy",d.copyUrl,()=>r.copyUrl(e[0]),{icon:o("copy"),off:!l});const s=l?r.urlOf(e[0]):void 0;return s&&a.push({type:"link",key:"open",label:d.openOriginal,href:s,icon:o("external")}),r.trash&&(h("d-trash"),t("trash",l?d.moveToTrash:d.moveFilesToTrash(e.length),()=>r.trash(i),{icon:o("trash"),danger:!0,deny:"trash"})),a}case"trashed":{const{ids:e}=n;return e.length>1&&a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),t("restore",d.restore,r.restore&&(()=>r.restore(e)),{icon:o("undo"),deny:"restore"}),r.deleteForever&&(h("d-delete"),t("delete",d.deleteForever,()=>r.deleteForever(e),{icon:o("trash"),danger:!0,deny:"deleteForever"})),a}case"product-node":case"render":return a.push({type:"label",key:"read-only",label:d.readOnlyMenu}),t("design",d.openInDesign,r.openInDesign&&(()=>r.openInDesign({kind:n.kind,id:n.id})),{icon:o("external")}),"render"===n.kind&&t("copy",d.copyUrl,()=>r.copyUrl(n.id),{icon:o("copy")}),a;default:return a}}var s="__all-files__";export{s as ROOT_KEY,t as mediaLibraryMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-SKFFBBAG.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as r}from"./chunk-UIWGVOFH.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const N=s[f],b=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
|
|
2
2
|
return t("div",{"data-side":a.join("-"),className:"min-w-0",children:/* @__PURE__ */t(e,{value:"mixed"===d?null:d,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(a,e),min:h,max:p,step:u,snap:!0,precision:0,steppers:"compact",readOnly:g,placeholder:f,prefix:o,suffix:c.unit,"aria-label":n})})};/* @__PURE__ */
|
|
3
3
|
return t("div",{role:"group","aria-label":a,"data-sides":d?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */n(o,d?{children:[b(["left"],c.sides.left,N.left),b(["top"],c.sides.top,N.top),b(["right"],c.sides.right,N.right),b(["bottom"],c.sides.bottom,N.bottom)]}:{children:[b(["left","right"],c.horizontal,N.horizontal),b(["top","bottom"],c.vertical,N.vertical)]})})}function p({each:e,onChange:r,label:n,disabled:o}){/* @__PURE__ */
|
|
4
4
|
return t(i,{content:n,children:/* @__PURE__ */t(a,{size:"md","aria-label":n,"aria-pressed":e,disabled:o,onClick:()=>r(!e),children:l})})}export{p as SidesEachToggle,h as SidesInput,c as sidesStartEach};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-4DZVWK7U.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-UIWGVOFH.js";import{Tooltip as a}from"./chunk-NJN5IKWO.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:N=!1,disabledReason:g,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:W,menuFooterLabel:C,align:F="end",side:O="bottom",menuMinWidth:V,linkAs:z,block:I=!1,className:D=""},L){const R=N&&(null!=g&&""!==g&&!1!==g)&&!v,U=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:L,type:b,variant:f,size:p,loading:v,leftIcon:k,block:I,disabled:N&&!R,"aria-disabled":!!R||void 0,disabledReason:R?g:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),K=I?"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:[I?"flex w-full":"inline-flex","items-stretch",D].filter(Boolean).join(" "),children:[null==w||""===w||R?A:/* @__PURE__ */t(a,{content:w,className:K,children:A}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:U?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":U?$:void 0,items:h,align:F,side:O,minWidth:V,linkAs:z,disabled:x&&!U,"aria-disabled":U,onOpenChange:y,footer:W,footerLabel:C,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"})})}),U&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{CartesianPlot as o}from"./chunk-P4L74UA5.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-43MCNASD.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const A=e().charts,L=i(),v=d??(t=>Number.isInteger(t)?m(t,L):n(t,1,L)),w=x??(t=>m(t,L)),M=g??A.countAxis,N=k??A.distribution,C=h??r(c??[],s),P=a(0,b,f),R=C.map(t=>v(t.from)),U=C.map(t=>t.count);/* @__PURE__ */
|
|
2
|
+
return l(o,{labels:R,values:U,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:w,yAxisLabel:M,className:y,emptyLabel:j,ariaLabel:A.histogram(N,C.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${v(C[o].from)} – ${v(C[o].to)}`,rows:[{key:"count",label:A.observations,color:P,value:w(C[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:C.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:P,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-UIWGVOFH.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */l("button",{type:"button",onClick:()=>{h(!x),d?.(!x)},"aria-expanded":x,"aria-controls":x?g:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
|
|
3
3
|
/* @__PURE__ */n(e,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(x?"rotate-90":"")}),
|
|
4
4
|
/* @__PURE__ */n("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:t})]}),x&&/* @__PURE__ */n("ol",{id:g,"aria-label":m,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:p})]})}var o={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},d={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function m({status:a}){switch(a){case"active":/* @__PURE__ */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-HRMG2WMW.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{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-UIWGVOFH.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
|
|
2
2
|
return t("ol",{"aria-label":l,className:`grid items-start ${s}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((i,l)=>{const s=l<c?"complete":l===c?"current":"upcoming",o="complete"===s&&!!n,m=/* @__PURE__ */t("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===s?"bg-blue-600 text-white":"","current"===s?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===s?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===s?/* @__PURE__ */t(a,{}):l+1}),d=/* @__PURE__ */r("span",{className:"min-w-0 text-center",children:[
|
|
3
3
|
/* @__PURE__ */t("span",{className:"block text-sm font-medium "+("upcoming"===s?"text-gray-400":"text-gray-900"),children:i.label}),i.description&&/* @__PURE__ */t("span",{className:"block text-xs text-gray-500",children:i.description})]});/* @__PURE__ */
|
|
4
4
|
return r("li",{"aria-current":"current"===s?"step":void 0,className:"relative flex min-w-0 justify-center",children:[l<e.length-1&&/* @__PURE__ */t("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(l<c?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),o?/* @__PURE__ */r("button",{type:"button",onClick:()=>n?.(i.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[m,d]}):/* @__PURE__ */r("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[m,d]})]},i.id)})})}export{i as Stepper};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-53WYJ5LZ.js";import{Avatar as t}from"./chunk-NHWDB7R6.js";import{ItemCount as r}from"./chunk-RXHTIJ64.js";import{Button_default as a}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Segmented as e}from"./chunk-S4FPYCUU.js";import{ImageFocusPoint as a}from"./chunk-53EW4M5S.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-LBMC6GR5.js";import{TransferProgress as u}from"./chunk-HNQKXOFU.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-7KIDOIPY.js";import{Icon as p}from"./chunk-UIWGVOFH.js";import{useShellStrings as b}from"./chunk-43MCNASD.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:U,label:C,hint:F,error:O,required:P,className:$,accept:z="image/*",maxSizeBytes:H,fit:I="cover",height:S=112,placeholder:B,cta:K,acceptHint:W,showFilename:q=!0,allowReplace:D=!0,allowRemove:M=!0,replaceLabel:Y,removeLabel:A,busy:G=!1,busyLabel:V,choosingLabel:_,pickFailedLabel:E,progress:Q,disabled:X=!1,kind:J,onKindChange:T,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=K??ie.cta,oe=J??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof A&&A?A:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=G||ne,me=ne&&!G?_??ie.choosing:V??ie.uploading,he=O??(se?E??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=X||ue,ke=!!w&&(t(w,z)||w===ve),Ne=B??o(z,ie),je=Y??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{R?pe(e):U?U(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:z,maxSizeBytes:H,acceptHint:W,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ue=w?r(w):"",Ce=!ke&&!!ee,Fe=X||!D&&!M?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[D&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
|
|
2
2
|
/* @__PURE__ */N(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
-
/* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),
|
|
4
|
-
/* @__PURE__ */N(
|
|
3
|
+
/* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),M&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:S},children:[Ce?
|
|
4
|
+
/* @__PURE__ */N(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:I}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:I,objectPosition:Z||void 0}}),q&&w&&/* @__PURE__ */N(n,{children:Ue}),Fe,ue&&/* @__PURE__ */N(l,{label:me,progress:Q,rounded:"rounded-md"})]}),Pe=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":P||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:Q}):/* @__PURE__ */k(j,{children:[
|
|
5
5
|
/* @__PURE__ */N("span",{className:"text-ink-faintest",children:/* @__PURE__ */N(s,{})}),
|
|
6
6
|
/* @__PURE__ */N("span",{className:"px-3 text-xs text-ink-faint",children:Ne}),
|
|
7
|
-
/* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),
|
|
8
|
-
return k(i,{label:
|
|
7
|
+
/* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),W&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:W})]})});/* @__PURE__ */
|
|
8
|
+
return k(i,{label:C,htmlFor:be,hint:F,error:he,required:P,className:$,children:[T&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(e,{value:oe,onChange:e=>T(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),w?Oe:Pe,!R&&/* @__PURE__ */N("input",{...we.inputProps}),
|
|
9
9
|
/* @__PURE__ */N(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-
|
|
2
|
-
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&B}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&B})}var
|
|
3
|
-
return x("button",{ref:f,id:u,role:"radio"===
|
|
1
|
+
import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-UIWGVOFH.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{glassStyle as l,GLASS_DIVIDER as c}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function T(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function M(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),H=d(!1);function L({children:e,style:n,className:a="",onClose:c,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const T=i(),M=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),c?.()},root:p}},[b,x,c]);g(()=>{if(!c)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&c()},t=e=>{"Escape"===e.key&&c()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(c),o=s(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[c,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const H=W(),L=/(^|[\s:])!?z-/.test(a),j=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===H?"py-1":"large"===H?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...L?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...l(),...n},children:/* @__PURE__ */k($.Provider,{value:M,children:e})});return u?T?w(j,document.body):null:j}function j(e,t,n,r=!1){const o=W(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var B=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function D({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&B}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&B})}var F=u(function({onClick:t,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:d,id:u,onMouseEnter:h},f){const g=p($),y=m(),b=null!=s&&!1!==s,w=`${u??y}-label`,N=`${u??y}-note`,C=p(H),E=j(o,i,r),T=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return x("button",{ref:f,id:u,role:"radio"===T?"menuitemradio":"checkbox"===T?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":T?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{t?.(),g&&g.depth>0&&"checkbox"!==T&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:E.className,style:E.style,children:[T&&/* @__PURE__ */k(D,{kind:T,checked:!!l}),b?
|
|
4
4
|
/* @__PURE__ */x("span",{className:"block min-w-0 flex-1 py-2",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(
|
|
5
|
+
/* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(P,{children:c}),
|
|
6
6
|
/* @__PURE__ */k("span",{id:w,className:"min-w-0",children:n})]}),
|
|
7
|
-
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(
|
|
8
|
-
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var
|
|
7
|
+
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(P,{children:c}),n]})]})});function P({children:e}){/* @__PURE__ */
|
|
8
|
+
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var R=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function A(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function I(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function z({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:c=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),H=h(),L=h(!1),B=`${N}-menu`;g(()=>()=>clearTimeout(H.current),[]);const D=f?.depth??0,F=f?.path[D],P=!!F&&F.key===N&&!o,z=b(e=>{if(!f||o||!C.current)return;clearTimeout(H.current),L.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=D>0&&(f.path[D-1]?.flipped??!1),a=M(r.left,r.right,c,window.innerWidth,4,i);f.open(D,{key:N,y:t.top,...a})},[f,o,D,N,c]),S=e=>{f?.closeBelow(D),C.current?.focus()};g(()=>{if(P)return s(e=>"Escape"===e.key&&(!(f&&f.path.length>D+1)&&(S(),!0)),()=>E.current)}),a(()=>{if(!P||!F)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=D>0&&(f?.path[D-1]?.flipped??!1),o=e.offsetWidth||c,i=M(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=T(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{P&&L.current&&(L.current=!1,I(E.current)[0]?.focus())},[P]);const U=y(()=>f&&{...f,depth:D+1},[f,D]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=j(!1,o,i,P),G=W();/* @__PURE__ */
|
|
9
9
|
return x(v,{children:[
|
|
10
|
-
/* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":
|
|
11
|
-
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),
|
|
12
|
-
/* @__PURE__ */k("div",{ref:E,id:B,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===
|
|
10
|
+
/* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-controls":P?B:void 0,disabled:o,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;P?t&&I(E.current)[0]?.focus():z(t)},...u,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),z(!0))},onMouseEnter:()=>{u?.onMouseEnter?.(),o||(f.cancelClose(),P?f.closeBelow(D+1):(clearTimeout(H.current),H.current=setTimeout(()=>z(!1),120)))},onMouseLeave:()=>{clearTimeout(H.current),f.scheduleClose(D)},children:[n,
|
|
11
|
+
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),R]}),P&&w(
|
|
12
|
+
/* @__PURE__ */k("div",{ref:E,id:B,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===G?"py-1":"large"===G?"py-2":"py-1"),style:{left:F.left,top:F.y,minWidth:c,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:A(f.root.current)+D+1,animation:(F.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...l()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=I(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),S())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(H.current)},onMouseLeave:()=>f.scheduleClose(D+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function S(){const e=W();/* @__PURE__ */
|
|
13
13
|
return k("div",{className:`border-t ${c} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function U(){const e=W(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function q({children:e}){/* @__PURE__ */
|
|
14
|
-
return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function
|
|
15
|
-
return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{D as MenuCheckMark,
|
|
14
|
+
return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function G({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
15
|
+
return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{D as MenuCheckMark,G as MenuIcon,H as MenuSemanticsContext,L as PopupMenu,S as PopupMenuDivider,F as PopupMenuItem,q as PopupMenuLabel,z as PopupSubmenu,T as clampMenuTop,C as closeMenuBelow,j as itemLook,M as menuPanelLeft,U as menuTextRowStyle,N as openMenuLevel,E as resolveMenuLevels};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={nodes:16,edges:30,label:40,note:30,edgeLabel:16,title:80},e=["step","decision","start","end"],n=t=>"object"==typeof t&&null!==t&&!Array.isArray(t),o=(t,e)=>"string"==typeof t&&""!==t.trim()&&t.trim().length<=e?t.trim():void 0;function r(r){let s;try{s=JSON.parse(r)}catch{return null}if(!n(s)||!Array.isArray(s.nodes)||!Array.isArray(s.edges))return null;if(s.nodes.length<2||s.nodes.length>t.nodes)return null;if(0===s.edges.length||s.edges.length>t.edges)return null;const i=[],l=/* @__PURE__ */new Set;for(const r of s.nodes){if(!n(r))return null;const s="number"==typeof r.id?String(r.id):o(r.id,40),a=o(r.label,t.label);if(!s||!a||l.has(s))return null;const c=void 0===r.kind?"step":r.kind;if(!e.includes(c))return null;const h={id:s,label:a,kind:c};if(void 0!==r.note){const e=o(r.note,t.note);if(!e)return null;h.note=e}l.add(s),i.push(h)}const a=[],c=/* @__PURE__ */new Set;for(const e of s.edges){if(!n(e))return null;const r="number"==typeof e.from?String(e.from):o(e.from,40),s="number"==typeof e.to?String(e.to):o(e.to,40);if(!(r&&s&&l.has(r)&&l.has(s)&&r!==s))return null;const i=`${r}\0${s}`;if(c.has(i))return null;c.add(i);const h={from:r,to:s};if(void 0!==e.label){const n=o(e.label,t.edgeLabel);if(!n)return null;h.label=n}a.push(h)}const h={nodes:i,edges:a},f=o(s.title,t.title);return f&&(h.title=f),h}var s={columns:4,boxWidth:136,boxHeight:52,decisionHeight:72,columnGap:28,rowGap:56,stackGap:16,margin:24,lineChars:20};function i(t,e=s.lineChars){if(t.length<=e)return[t];const n=t.split(/\s+/);let o="",r=0;for(;r<n.length&&(""===o||`${o} ${n[r]}`.length<=e);)o=""===o?n[r]:`${o} ${n[r]}`,r+=1;const i=n.slice(r).join(" ");return i?[o,i]:[o]}function l(t){const e=s,n=function(t){const e=t.nodes.map(t=>t.id),n=new Map(e.map(t=>[t,[]]));for(const e of t.edges)n.get(e.from).push(e.to);const o=/* @__PURE__ */new Map,r=/* @__PURE__ */new Set,s=t=>{o.set(t,1);for(const e of n.get(t))1===o.get(e)?r.add(`${t}\0${e}`):o.get(e)||s(e);o.set(t,2)};for(const t of e)o.get(t)||s(t);const i=t.edges.filter(t=>!r.has(`${t.from}\0${t.to}`)),l=new Map(e.map(t=>[t,0]));for(let t=0;t<e.length;t+=1){let t=!1;for(const e of i){const n=l.get(e.from)+1;n>l.get(e.to)&&(l.set(e.to,n),t=!0)}if(!t)break}return l}(t),o=Math.max(...n.values())+1,r=Math.ceil(o/e.columns),l=Array.from({length:o},()=>[]);for(const e of t.nodes)l[n.get(e.id)].push(e);const a=t=>"decision"===t.kind?e.decisionHeight:e.boxHeight,c=t=>{const n=l[t];return n.reduce((t,e)=>t+a(e),0)+e.stackGap*(n.length-1)},h=Array.from({length:r},(t,n)=>Math.max(...l.slice(n*e.columns,(n+1)*e.columns).map((t,o)=>c(n*e.columns+o)))),f=[];let u=e.margin;for(const t of h)f.push(u),u+=t+e.rowGap;const d=u-e.rowGap+e.margin,g=2*e.margin+e.columns*e.boxWidth+(e.columns-1)*e.columnGap,m=t=>{const n=Math.floor(t/e.columns),o=t%e.columns;return n%2==0?o:e.columns-1-o},p=/* @__PURE__ */new Map;for(let t=0;t<o;t+=1){const n=Math.floor(t/e.columns),o=e.margin+m(t)*(e.boxWidth+e.columnGap);let r=f[n]+(h[n]-c(t))/2;for(const n of l[t]){const s=a(n);p.set(n.id,{...n,x:o,y:r,width:e.boxWidth,height:s,lines:i(n.label),rank:t}),r+=s+e.stackGap}}const y=t=>Math.floor(t.rank/e.columns),b=t=>t.y+t.height/2,k=t=>t.x+t.width/2,x=t=>f[t]+h[t]+e.rowGap/2,w=t.edges.map(t=>{const n=p.get(t.from),o=p.get(t.to);let r;if(o.rank===n.rank+1&&y(n)===y(o)){const t=m(o.rank)>m(n.rank),e=t?n.x+n.width:n.x,s=t?o.x:o.x+o.width,i=b(n),l=b(o),a=(e+s)/2;r=i===l?[[e,i],[s,l]]:[[e,i],[a,i],[a,l],[s,l]]}else if(o.rank===n.rank+1){const t=x(y(n));r=[[k(n),n.y+n.height],[k(n),t],[k(o),t],[k(o),o.y]]}else if(o.rank>n.rank){const t=x(y(n));r=y(o)>y(n)?[[k(n),n.y+n.height],[k(n),t],[k(o)+6,t],[k(o)+6,o.y]]:[[k(n),n.y+n.height],[k(n),t],[k(o),t],[k(o),o.y+o.height]]}else{const t=x(y(n)),s=0===y(o)?e.margin/2:x(y(o)-1),i=e.margin/2;r=y(o)===y(n)?[[k(n)-6,n.y+n.height],[k(n)-6,t],[k(o)-6,t],[k(o)-6,o.y+o.height]]:[[k(n)-6,n.y+n.height],[k(n)-6,t],[i,t],[i,s],[k(o)-6,s],[k(o)-6,o.y]]}const s={...t,points:r};if(t.label){const[t,e]=r.slice(-2);s.labelAt=t[0]===e[0]?[t[0]+4,(t[1]+e[1])/2+4]:[(t[0]+e[0])/2-8,t[1]-4]}return s}),M=Math.max(...w.flatMap(t=>t.points.map(([,t])=>t)));return{width:g,height:Math.max(d,M+e.margin/2),nodes:t.nodes.map(t=>p.get(t.id)),edges:w}}export{s as FLOW_LAYOUT,t as FLOW_SPEC_LIMITS,l as layoutFlow,r as parseFlowSpec,i as wrapLabel};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-IL56C56I.js";import{Button_default as n}from"./chunk-EOVXFXVV.js";import{useShellStrings as i}from"./chunk-43MCNASD.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:
|
|
3
|
-
return w("div",{id:K,className:`flex w-56 flex-col gap-3 ${
|
|
4
|
-
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:
|
|
1
|
+
import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-SKFFBBAG.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-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-43MCNASD.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 N(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 C({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:C({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(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 S({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:C=!1,opacity:z,onOpacityChange:S,onClose:j,id:K,className:B=""}){const R=h().color,U=k(z),L=e=>{const r=k(e);C||r===U||S?.(r)},W=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:U},E=a(f??""),[H,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 F=a=>{C||a===e||(q.current=a,r(a))},J=e=>{const r=a(e);r&&(Y(n(r)),F(r))},X=e=>{Y(e),F(o(e))},[G,V]=p(!1),Z=b(H);Z.current=H;const Q=e=>({onPointerDown:r=>{if(C||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Z.current);"end"===x?(V(!0),Y(a)):X(a)},onPointerMove:r=>{if(C||!(1&r.buttons))return;const a=e(r,Z.current);"end"===x?Y(a):X(a)},onPointerUp:r=>{"end"===x&&G&&(V(!1),X(e(r,Z.current)))}}),_=Q((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Q((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=G?o(H):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||E||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:K,className:`flex w-56 flex-col gap-3 ${C?"opacity-60":""} ${B}`.trim(),onKeyDown:e=>{"Escape"===e.key&&j&&(e.preventDefault(),e.stopPropagation(),j())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":R.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:R.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":R.clear,selected:""===e,disabled:C,onClick:()=>{C||""===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
|
+
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:C,onClick:()=>J(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*H.v),"aria-valuetext":R.squareValue(Math.round(100*H.s),Math.round(100*H.v)),"aria-disabled":C||void 0,"data-color-square":"",onKeyDown:e=>{if(C)return;const r=A(H,e.key,e.shiftKey);r&&(e.preventDefault(),X(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:H.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(H.s),top:ae(1-H.v),...M}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(H.h),"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-hue":"",onKeyDown:e=>{if(C)return;const r=I(H.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),X({...H,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:H.h/360*100+"%",background:o({h:H.h,s:1,v:1}),...M}})}),S&&/* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":U,"aria-valuetext":`${U}%`,"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-opacity":"",onKeyDown:e=>{if(C)return;const r=P(U,e.key,e.shiftKey);null!==r&&(e.preventDefault(),L(r))},onPointerDown:e=>{C||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),L(W(e)))},onPointerMove:e=>{!C&&1&e.buttons&&L(W(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:`${U}%`,...N(te||"black",U),...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:
|
|
9
|
-
/* @__PURE__ */v(T,{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:N(te,S?U:null)}),
|
|
9
|
+
/* @__PURE__ */v(T,{value:re,placeholder:!e&&E?t(E):void 0,onChange:J,label:R.hex(i),disabled:C}),S&&/* @__PURE__ */v(O,{value:U,onChange:L,label:R.opacity(i),disabled:C})]})]})}var j={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)]"},K={sm:"h-6",md:"h-8",lg:"h-10"},B=["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 T({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?`${B} ${K[c]} ${h}`.trim():u({size:c,className:`${j[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 O({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 R({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||"",
|
|
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 R({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||"",j=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:
|
|
15
|
-
/* @__PURE__ */v(T,{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(O,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(P,b?A:null)}),triggerLabel:D.swatch(o,j),triggerClassName:C({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(S,{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(T,{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(O,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,S as ColorPickerPanel,$ as ColorSwatch,T as HexInput,y as NO_COLOR_FILL,k as clampOpacity,N as colorFill,C as colorSwatchClasses,I as stepHue,P as stepOpacity,A as stepSquare};
|