efficient-shell 13.25.0 → 14.0.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 +8 -4
- package/dist/{Browser-W2WVSAEN.js → Browser-FYVRNXOL.js} +13 -13
- package/dist/Calculator-7CY2CRGB.js +29 -0
- package/dist/{CurrencyConverter-VH4UVYLO.js → CurrencyConverter-FXWM3DBQ.js} +9 -9
- package/dist/{Files-6QZFFGSH.js → Files-VDQYQSDZ.js} +85 -85
- package/dist/{Notepad-YU4HIJD2.js → Notepad-J3Z3CYEC.js} +9 -9
- package/dist/PomodoroTimer-RPGWT26T.js +91 -0
- package/dist/{Preview-H7N2MMAI.js → Preview-ISEPDV3A.js} +37 -37
- package/dist/Sidebar-2TYZENQL.js +44 -0
- package/dist/{Stock-YL732PKW.js → Stock-TUPZORQN.js} +4 -4
- package/dist/{Weather-3CBRXNNM.js → Weather-URCO6JML.js} +23 -23
- package/dist/{WorldClock-LONNWCRG.js → WorldClock-EBBUWG5L.js} +6 -6
- package/dist/ai/index.js +92 -92
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-XVMCSUAV.js → chunk-22SVN2ZM.js} +1 -1
- package/dist/{chunk-ZDFMYAQB.js → chunk-24BF22NF.js} +1 -1
- package/dist/{chunk-JIJZBM25.js → chunk-2RLWGWOU.js} +13 -13
- package/dist/{chunk-VP2IQJUD.js → chunk-2SOGTOUQ.js} +4 -4
- package/dist/{chunk-4VFEPP2W.js → chunk-2XDO7FZC.js} +13 -13
- package/dist/{chunk-SLEA47VA.js → chunk-3L7BEEBW.js} +1 -1
- package/dist/{chunk-GZRNOIEE.js → chunk-3ZJAQSFS.js} +3 -3
- package/dist/{chunk-BQQEQCSK.js → chunk-47BGAQWD.js} +1 -1
- package/dist/{chunk-7AVPMO4F.js → chunk-4BRVZAIW.js} +1 -1
- package/dist/chunk-4DNPUG3T.js +7 -0
- package/dist/{chunk-VKZC3NPM.js → chunk-5O4HMXPQ.js} +2 -2
- package/dist/{chunk-JLSXDYS4.js → chunk-5SQHRDFC.js} +2 -2
- package/dist/{chunk-LQIHBIXG.js → chunk-6AYAB5FN.js} +5 -5
- package/dist/{chunk-VGUB7LPF.js → chunk-6IP4Q3AT.js} +52 -52
- package/dist/{chunk-527WMFTR.js → chunk-6RU2PGQK.js} +1 -1
- package/dist/{chunk-UVPDEGIA.js → chunk-6X32SWQI.js} +1 -1
- package/dist/{chunk-A5FC4LR7.js → chunk-7D2QZ6JA.js} +1 -1
- package/dist/{chunk-77N3REYY.js → chunk-7KNVO46D.js} +2 -2
- package/dist/{chunk-2YHS5E27.js → chunk-7OVMWXFM.js} +1 -1
- package/dist/{chunk-LC2UF3AA.js → chunk-7WF6LFOJ.js} +1 -1
- package/dist/{chunk-IJG4UEKF.js → chunk-A3VLZZHJ.js} +8 -8
- package/dist/{chunk-LG6NDTHZ.js → chunk-AH5MLH54.js} +1 -1
- package/dist/chunk-AJPQJ7TC.js +6 -0
- package/dist/{chunk-TNALBYLY.js → chunk-ALZHFQRX.js} +1 -1
- package/dist/{chunk-S5MTTJ3F.js → chunk-AZZ4NO2D.js} +12 -12
- package/dist/{chunk-P4VOUPRF.js → chunk-CHDGSJLV.js} +6 -6
- package/dist/{chunk-VY6OQRZA.js → chunk-CJ4OEY3T.js} +1 -1
- package/dist/{chunk-Q36KB5RQ.js → chunk-CXEELIRW.js} +11 -11
- package/dist/{chunk-MZ3JADHG.js → chunk-DBBOD5QW.js} +1 -1
- package/dist/chunk-DBQNYJZ6.js +1 -0
- package/dist/{chunk-65BW43PF.js → chunk-DNPAYNNU.js} +1 -1
- package/dist/{chunk-TTRLYWP4.js → chunk-DO6P6LYU.js} +1 -1
- package/dist/chunk-DOJSWVBX.js +6 -0
- package/dist/chunk-DTFX624I.js +8 -0
- package/dist/chunk-E57C7NBA.js +2 -0
- package/dist/{chunk-D5PXRJHA.js → chunk-EBODRYXS.js} +14 -14
- package/dist/{chunk-YDJ5IZOU.js → chunk-EDRELF6L.js} +1 -1
- package/dist/{chunk-M3HTP2N6.js → chunk-EHNW3UNC.js} +6 -6
- package/dist/{chunk-AH2NEKEN.js → chunk-EHSK43WG.js} +8 -8
- package/dist/{chunk-VMAIZU5S.js → chunk-EN3GYSCE.js} +1 -1
- package/dist/{chunk-TTYTOLVV.js → chunk-EOYKUV2U.js} +1 -1
- package/dist/chunk-FFPIT2LB.js +3 -0
- package/dist/{chunk-TD3ZQD5R.js → chunk-G3TC2GIA.js} +1 -1
- package/dist/{chunk-UQV4TSWB.js → chunk-GTZML3V3.js} +1 -1
- package/dist/{chunk-JYR4V4AG.js → chunk-GUUBFQ6L.js} +2 -2
- package/dist/{chunk-K42FXX7J.js → chunk-GVAVIYE6.js} +1 -1
- package/dist/{chunk-2Y4AH7NC.js → chunk-GY7MJTIZ.js} +1 -1
- package/dist/{chunk-XYXCZIJY.js → chunk-HAEZUUDT.js} +3 -3
- package/dist/{chunk-J5W63XNR.js → chunk-HTBACICQ.js} +6 -6
- package/dist/{chunk-5URXJCNC.js → chunk-HX5QSQ2C.js} +1 -1
- package/dist/{chunk-VLBLDSA6.js → chunk-I7WAOKU2.js} +2 -2
- package/dist/{chunk-LLDGRPLF.js → chunk-ION3XGLN.js} +1 -1
- package/dist/{chunk-EXDSYFHB.js → chunk-ISWTJBOA.js} +1 -1
- package/dist/{chunk-BUFAJJDZ.js → chunk-IVEM2BPC.js} +1 -1
- package/dist/{chunk-D4432YRW.js → chunk-IZ6D4KGR.js} +1 -1
- package/dist/{chunk-KC2EQCBE.js → chunk-JPVD3VS7.js} +6 -6
- package/dist/{chunk-C7Z3ZMJH.js → chunk-KE7P74XM.js} +13 -13
- package/dist/chunk-KEFNQEXZ.js +1 -0
- package/dist/{chunk-DUEEAP4Y.js → chunk-LPL7BWGG.js} +1 -1
- package/dist/{chunk-JVENCUUG.js → chunk-LRMDLZMM.js} +4 -4
- package/dist/chunk-M5IZ7QLQ.js +7 -0
- package/dist/{chunk-MCLVTQSF.js → chunk-MEDOESQD.js} +8 -8
- package/dist/chunk-MEP6CZJ3.js +2 -0
- package/dist/{chunk-ZYKY4Z7R.js → chunk-MKHOXO5O.js} +1 -1
- package/dist/chunk-MNZAAQLH.js +15 -0
- package/dist/{chunk-DTRJLQWO.js → chunk-MPC3CHAO.js} +1 -1
- package/dist/{chunk-7PAZO65L.js → chunk-MXRF5YVN.js} +5 -5
- package/dist/{chunk-NWS5G7FE.js → chunk-MYH5H43C.js} +1 -1
- package/dist/{chunk-5OHFBS2B.js → chunk-NC5FIFAY.js} +1 -1
- package/dist/chunk-NDCS4COQ.js +11 -0
- package/dist/{chunk-IJ4JX6WP.js → chunk-NHALP3MW.js} +4 -4
- package/dist/{chunk-R5WBDXI2.js → chunk-OYQWBJ37.js} +1 -1
- package/dist/{chunk-UU42O5ON.js → chunk-P3XXFQG5.js} +1 -1
- package/dist/{chunk-YBE66FBR.js → chunk-P5J7G7OV.js} +1 -1
- package/dist/{chunk-4L5YRMJ4.js → chunk-PEA5Y6DD.js} +9 -9
- package/dist/{chunk-DPFEQQQU.js → chunk-POBVGDZP.js} +1 -1
- package/dist/{chunk-RFWBNKKB.js → chunk-PPHGBEJA.js} +10 -10
- package/dist/{chunk-IMH5H47S.js → chunk-PTLVNC3V.js} +6 -6
- package/dist/chunk-PU2GJVMG.js +1 -0
- package/dist/{chunk-TJG76Y7I.js → chunk-PWERFHOU.js} +9 -9
- package/dist/{chunk-ZFWCTHR4.js → chunk-PWON7O3N.js} +6 -6
- package/dist/{chunk-6MFKKTCE.js → chunk-Q7FPGOUY.js} +24 -24
- package/dist/{chunk-M4REKOGO.js → chunk-QCLKRFL4.js} +5 -5
- package/dist/{chunk-N4LMFGRI.js → chunk-R36VZ35L.js} +6 -6
- package/dist/{chunk-CCZHSISF.js → chunk-REFPTKRD.js} +2 -2
- package/dist/{chunk-THAPVKEJ.js → chunk-RTK77DMP.js} +11 -11
- package/dist/{chunk-PWOVSR7N.js → chunk-RXCBSQA2.js} +2 -2
- package/dist/{chunk-JDLJ7DHV.js → chunk-S4RFJTGR.js} +1 -1
- package/dist/{chunk-D5HFWOW7.js → chunk-SP4S4HUJ.js} +16 -16
- package/dist/{chunk-P73ZJ6QR.js → chunk-T46I4YOI.js} +1 -1
- package/dist/{chunk-VY3UA6AR.js → chunk-TAHHZGRH.js} +1 -1
- package/dist/{chunk-FBZUEZK7.js → chunk-TTD2M6RF.js} +1 -1
- package/dist/{chunk-AAJSE5HA.js → chunk-U6W3OU2X.js} +1 -1
- package/dist/{chunk-RB3BMRNA.js → chunk-U75MSD4F.js} +1 -1
- package/dist/{chunk-XC2GUCTG.js → chunk-UGA5NGW4.js} +1 -1
- package/dist/chunk-UZESZ3EB.js +1 -0
- package/dist/chunk-VUBDHFG5.js +4 -0
- package/dist/{chunk-K4KUGKWP.js → chunk-W4IH3BE3.js} +21 -21
- package/dist/{chunk-B5KX7PDG.js → chunk-W6REY3SV.js} +3 -3
- package/dist/{chunk-WZWSFYXJ.js → chunk-WBUAO7T7.js} +1 -1
- package/dist/{chunk-P6H2B635.js → chunk-WNFZYTWW.js} +9 -9
- package/dist/{chunk-HPKQYUQT.js → chunk-WYAKASF3.js} +1 -1
- package/dist/{chunk-C5OPAULN.js → chunk-XGEN76DG.js} +1 -1
- package/dist/{chunk-ZKILZFUI.js → chunk-XIX72C7K.js} +1 -1
- package/dist/{chunk-3AUN7JSM.js → chunk-XJK6VNXV.js} +1 -1
- package/dist/{chunk-26KHYLJN.js → chunk-XLPUIGMO.js} +1 -1
- package/dist/{chunk-VQBKRBBR.js → chunk-XNKNX5L3.js} +1 -1
- package/dist/chunk-Y2M5PP2C.js +28 -0
- package/dist/{chunk-66NJCU4W.js → chunk-Y5RTVKMB.js} +8 -8
- package/dist/{chunk-JXJNQHPY.js → chunk-Y5YVKUM4.js} +19 -19
- package/dist/{chunk-5CHJA4RL.js → chunk-Y6FULJWJ.js} +7 -7
- package/dist/chunk-Y7D2CZ4H.js +13 -0
- package/dist/chunk-YTLUSBDY.js +14 -0
- package/dist/{chunk-2YUAR2EH.js → chunk-YX3JD6PA.js} +5 -5
- package/dist/{chunk-3WUVYXCF.js → chunk-ZA6ANC2D.js} +5 -5
- package/dist/{chunk-5ZOYYL46.js → chunk-ZEGCKIAL.js} +3 -3
- package/dist/chunk-ZSVU44OB.js +6 -0
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/data/useColumnConfig.js +1 -1
- package/dist/data/useSort.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.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/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/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/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/dropdownPosition.js +1 -1
- package/dist/hooks/index.d.ts +15 -14
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +43 -2
- package/dist/index.js +126 -126
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.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/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.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/Kbd.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/Popover.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/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/ShellPrefs.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/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.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.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-PKAM5ERT.js +0 -29
- package/dist/PomodoroTimer-PBSAKRX5.js +0 -91
- package/dist/Sidebar-HAIHWIJD.js +0 -44
- package/dist/chunk-2AEYVQ2R.js +0 -2
- package/dist/chunk-3GJVTK4H.js +0 -11
- package/dist/chunk-3TD3GH53.js +0 -7
- package/dist/chunk-44ERJYNW.js +0 -6
- package/dist/chunk-AAFPAQXH.js +0 -13
- package/dist/chunk-EX3DARI3.js +0 -7
- package/dist/chunk-F2RAIGCG.js +0 -6
- package/dist/chunk-FLQXMCB3.js +0 -8
- package/dist/chunk-N6PMH6DU.js +0 -6
- package/dist/chunk-O5ZBRG2G.js +0 -1
- package/dist/chunk-PP3WUT2G.js +0 -15
- package/dist/chunk-PWX64YBI.js +0 -28
- package/dist/chunk-RJVIKGHJ.js +0 -4
- package/dist/chunk-SRI2D23Y.js +0 -14
- package/dist/chunk-UTISUEO4.js +0 -2
- package/dist/chunk-UVHXVSB2.js +0 -1
- package/dist/chunk-WCCS4VFE.js +0 -1
- package/dist/chunk-ZDXRSY2Y.js +0 -1
- package/dist/chunk-ZISKHQZY.js +0 -3
- /package/dist/{chunk-4BYJABCX.js → chunk-5YTZBYG4.js} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-Q2RNFBYS.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-
|
|
1
|
+
import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-Q2RNFBYS.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-G3TC2GIA.js";import{useBrowserLayoutEffect as l}from"./chunk-PU2GJVMG.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
|
|
2
2
|
return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
3
3
|
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
|
|
4
|
-
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:
|
|
5
|
-
return h("th",{scope:"col",...
|
|
4
|
+
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:I,rowHref:R,onRowPress:T,linkAs:G,emptyText:A,selection:F,footer:P,virtualized:E,stackOnNarrow:L=!1,stackBelow:O,className:D=""}){const K=s(),W=A??K.table.empty,Q=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),V=L&&!E,Z=V?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),J=e=>V?{role:e}:{},U=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[Y,q]=i(0),X=E?.overscan??6,_=E?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/E.rowHeight)-X);q(e=>e===t?e:t)}:void 0,ee=E?Math.ceil(E.height/E.rowHeight)+2*X:v.length,te=E?Math.min(Y,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=E?te*E.rowHeight:0,ne=E?(v.length-re)*E.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!E)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=Z.flatMap(e=>m(e)?e.columns:[e]),he=Z.some(m),ue=/* @__PURE__ */new Map;if(V)for(const e of Z)if(m(e))for(const t of e.columns)ue.set(t,U(e.title,e.label));const me=e=>{const t=U(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(F?.selected??[]),ge=F?v.map((e,t)=>Q(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=F?36:0,we=de.length+(F?1:0),xe=de.some(e=>"left"===e.fixed),ve=V&&!F&&de.some(e=>e.cardCorner),ke=G??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
|
|
5
|
+
return h("th",{scope:"col",...J("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...E?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",a?E?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":E?"sticky z-10 bg-gray-50":"",V&&d?"rosh-dt-sort":"",V?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":V?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
|
|
6
6
|
/* @__PURE__ */h(n,{children:e.title}),
|
|
7
7
|
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
|
|
8
|
-
/* @__PURE__ */c("div",{onScroll:_,style:
|
|
8
|
+
/* @__PURE__ */c("div",{onScroll:_,style:E?{maxHeight:E.height}:void 0,className:`relative overflow-x-auto ${E?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${V?" rosh-dt-scroll":""}`.trim(),children:[B&&
|
|
9
9
|
/* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
10
10
|
/* @__PURE__ */h(r,{className:"h-6 w-6"}),
|
|
11
11
|
/* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
|
|
12
|
-
/* @__PURE__ */c("table",{...
|
|
13
|
-
/* @__PURE__ */c("thead",{...
|
|
14
|
-
/* @__PURE__ */c("tr",{ref:le,...
|
|
15
|
-
/* @__PURE__ */h("tbody",{...
|
|
16
|
-
return c("tr",{...u(n),...
|
|
17
|
-
return h("td",{...
|
|
18
|
-
return h("td",{...
|
|
19
|
-
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},
|
|
20
|
-
return h("div",
|
|
12
|
+
/* @__PURE__ */c("table",{...J("table"),className:(V?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
|
+
/* @__PURE__ */c("thead",{...J("rowgroup"),className:V?"rosh-dt-head":void 0,children:[
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...J("row"),className:"border-b border-gray-200 bg-gray-50",children:[F&&/* @__PURE__ */h("th",{scope:"col",...J("columnheader"),rowSpan:he?2:void 0,style:{width:36,...E?{top:0}:{}},className:[Ne,o,xe||E?"sticky z-20 bg-gray-50":"",xe?"left-0":"",V?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!F)return;const e=new Set(ge);F.onChange(pe?F.selected.filter(t=>!e.has(t)):[...F.selected,...ge.filter(e=>!fe.has(e))])}})}),Z.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...J("columnheader"),colSpan:e.columns.length,style:E?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",E?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...J("row"),className:"border-b border-gray-200 bg-gray-50",children:Z.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
|
+
/* @__PURE__ */h("tbody",{...J("rowgroup"),className:V?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((t,r)=>{const o=te+r,n=I?.(t,o),l=!!n?.current,s=R?.(t,o),i=void 0===s&&T?()=>T(t,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(e=>e.render?e.render(t,o,m):e.dataIndex?t[e.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
|
+
return c("tr",{...u(n),...J("row"),style:E?{height:E.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[V?F?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",V&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(t,o)??"",n?.className??""].filter(Boolean).join(" "),children:[F&&(()=>{const r=Q(t,o);/* @__PURE__ */
|
|
17
|
+
return h("td",{...J("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",V?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{F&&F.onChange(fe.has(e)?F.selected.filter(t=>t!==e):[...F.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=V&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
18
|
+
return h("td",{...J("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",V?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],V?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:V?
|
|
19
|
+
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},Q(t,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...J("row"),className:V?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...J("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:W})})})]}),P]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:V?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(t,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
|
|
20
|
+
return h("div",V?void 0!==O&&O>0&&40!==O?{className:`rosh-dt-at ${D}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/O*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:O/40*100+"%"},children:Se})})}:{className:`rosh-dt-stack ${D}`.trim(),children:Se}:{className:D,children:Se})}export{x as DataTable};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as r}from"./chunk-
|
|
2
|
-
return s("div",{id:
|
|
3
|
-
/* @__PURE__ */d("div",{className:"w-30 shrink-0",children:/* @__PURE__ */d(e,{value:v,onChange:b,min:g,max:x,step:w,...r(w),placeholder:y,prefix:/* @__PURE__ */d("span",{"data-radius-mark":"","aria-hidden":"true",children:
|
|
4
|
-
/* @__PURE__ */d("div",{ref:
|
|
1
|
+
import{InputNumber_default as e,stepRounding as r}from"./chunk-I7WAOKU2.js";import{IconButton_default as a}from"./chunk-MYH5H43C.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{useState as t,useRef as o}from"react";import{jsxs as s,jsx as d}from"react/jsx-runtime";var u={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function m({label:m,value:f,corners:p,onChange:h,radius:v=null,onRadiusChange:b,radiusLabel:k,radiusMin:g=0,radiusMax:x,radiusStep:w=1,radiusPlaceholder:y,radiusUnit:A,units:j,disabled:R=!1,disabledReason:C,id:N,className:K=""}){const M=l(),D=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)}(p),[I,S]=t(0),H=o(null);/* @__PURE__ */
|
|
2
|
+
return s("div",{id:N,role:"group","aria-label":m,className:`flex min-w-0 flex-wrap items-center gap-2 ${K}`.trim(),children:[b&&
|
|
3
|
+
/* @__PURE__ */d("div",{className:"w-30 shrink-0",children:/* @__PURE__ */d(e,{value:v,onChange:b,min:g,max:x,step:w,...r(w),placeholder:y,prefix:/* @__PURE__ */d("span",{"data-radius-mark":"","aria-hidden":"true",children:M.corners.radiusMark}),suffix:A??M.corners.unit,units:j,steppers:"compact",disabled:R,"aria-label":k??M.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */d("div",{ref:H,"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(H.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:D.map((e,r)=>{const l=f.includes(e.value),t=R||!0===e.disabled,o=t&&(!0===e.disabled&&e.title||(R?C:void 0))||void 0,s=/* @__PURE__ */d(a,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":t||void 0,disabledReason:o,"data-corner":e.value,size:"sm",tabIndex:r===I?0:-1,onFocus:()=>S(r),onClick:()=>{t||h(l?f.filter(r=>r!==e.value):[...f,e.value])},children:/* @__PURE__ */d(i,{name:"corner",strokeWidth:2,className:["h-4 w-4",u[e.value]??""].filter(Boolean).join(" ")})},e.value);return o?s:/* @__PURE__ */d(n,{content:e.title??e.label,children:s},e.value)})})]})}export{m as CornersInput};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
2
|
-
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
3
|
-
return m(p.Provider,{value:
|
|
1
|
+
import{Dialog as e}from"./chunk-ZSVU44OB.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={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"})}},C=t({variant:"secondary"}),P=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
|
|
2
|
+
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),F=a(null),E=a(0),T=a([]),$=a(null),D=a(null),R=u(e=>{F.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),S=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++E.current,options:r,resolve:e};null===F.current?R(n):T.current.push(n)})},[R]),[V,W]=c(!1),[Z,B]=c({message:""}),[H,K]=c(""),O=a(),Q=u(e=>(B(e),K(""),W(!0),new Promise(e=>{O.current=e})),[]),[U,Y]=c(!1),[G,I]=c({}),[J,q]=c(""),z=a(),A=u(e=>{const r="string"==typeof e?{message:e}:e;return I(r),q(r.defaultValue??""),Y(!0),new Promise(e=>{z.current=e})},[]);d(()=>{b=S,y=Q,N=A},[S,Q,A]);const M=(e,r)=>{if(F.current!==e)return;const n=k.current,t=T.current.shift();t?R(t):(F.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{W(!1),K(""),O.current?.(e)},_=e=>{if(e){const e=J.trim();if(!e&&!G.allowEmpty)return Y(!1),void z.current?.(null);Y(!1),z.current?.(e)}else Y(!1),z.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===Z.variant?"warning":"danger"],te=Z.confirmWord,oe=null==te||H===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
|
|
3
|
+
return m(p.Provider,{value:S,children:[r,
|
|
4
4
|
/* @__PURE__ */h(e,{open:t,onClose:()=>M(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
5
|
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>M(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
6
6
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>M(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
@@ -8,17 +8,17 @@ return m(p.Provider,{value:D,children:[r,
|
|
|
8
8
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
9
|
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
10
|
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
11
|
-
/* @__PURE__ */h(e,{open:
|
|
12
|
-
/* @__PURE__ */h("button",{ref:
|
|
13
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??
|
|
11
|
+
/* @__PURE__ */h(e,{open:V,onClose:()=>X(!1),initialFocus:null!=te?void 0:D,footer:/* @__PURE__ */m(f,{children:[
|
|
12
|
+
/* @__PURE__ */h("button",{ref:D,type:"button",onClick:()=>X(!1),className:C,children:Z.cancelLabel||le.destructiveCancel}),
|
|
13
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??Z.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
14
14
|
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
15
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
16
|
-
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:
|
|
17
|
-
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:
|
|
16
|
+
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:Z.title||le.destructiveTitle}),
|
|
17
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:Z.message}),null!=te&&/* @__PURE__ */m(f,{children:[
|
|
18
18
|
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
19
19
|
/* @__PURE__ */h("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:te}),se]}),
|
|
20
|
-
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:
|
|
21
|
-
/* @__PURE__ */m(e,{open:
|
|
22
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:
|
|
23
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!
|
|
24
|
-
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:
|
|
20
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:H,onChange:e=>K(e.target.value),onKeyDown:e=>{"Enter"===e.key&&H===te&&X(!0)},placeholder:te,className:`mt-2 ${L} focus:border-red-500`})]})]})]})}),
|
|
21
|
+
/* @__PURE__ */m(e,{open:U,onClose:()=>_(!1),title:G.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
|
|
22
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:G.cancelLabel||le.cancel}),
|
|
23
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!G.allowEmpty&&!J.trim(),className:P,children:G.confirmLabel||le.ok})]}),children:[G.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:G.message}),
|
|
24
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:J,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:G.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{F as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
1
|
+
import{Tooltip as e}from"./chunk-AJPQJ7TC.js";import{Fragment as r}from"react";import{jsx as l,jsxs as a}from"react/jsx-runtime";var i="58px",t="--picture-tiles-columns";function o(e){let r=0;for(const l of e)for(const e of l.label.split(/\s+/))r=Math.max(r,[...e].length);return r}function s({options:t,value:s,onChange:n,onClear:c,columns:u,captions:p=!1,label:d,className:b="","aria-labelledby":m}){const f=p?{"--picture-tiles-min":i,"--picture-tiles-longest-word":o(t),...u?{"--picture-tiles-default-columns":u}:{}}:{gridTemplateColumns:u?`repeat(${u}, minmax(0, 1fr))`:`repeat(auto-fill, minmax(${i}, 1fr))`};/* @__PURE__ */
|
|
2
2
|
return l("div",{role:"group","aria-label":m?void 0:d,"aria-labelledby":m,style:f,className:`${p?"rosh-picture-tiles rosh-one-height-rows"+(u?"":" rosh-picture-tiles-fit"):"grid"} gap-(--space-8) ${b}`.replace(/\s+/g," ").trim(),children:t.map(i=>{const t=i.value===s,o=/* @__PURE__ */a("button",{type:"button","aria-pressed":t,"aria-label":p?void 0:i.label,disabled:i.disabled||void 0,onClick:()=>{t?c?.():n(i.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${p?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${t?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[i.picture,p&&/* @__PURE__ */l("span",{className:"max-w-full text-center text-2xs leading-4 break-normal",children:i.label})]});return p?/* @__PURE__ */l(r,{children:o},i.value):/* @__PURE__ */l(e,{content:i.label,describe:!1,className:"relative flex min-w-0",children:o},i.value)})})}export{t as PICTURE_TILES_COLUMNS_VAR,s as PictureTiles};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-
|
|
2
|
-
return l(e,{className:k,disabled:N,triggerLabel:
|
|
1
|
+
import{Popover as e}from"./chunk-VUBDHFG5.js";import{IconButton_default as r}from"./chunk-MYH5H43C.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as a}from"./chunk-AJPQJ7TC.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as i}from"react";import{jsx as l,jsxs as o,Fragment as s}from"react/jsx-runtime";var c={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]},u={alignItems:"flex-start",paddingTop:"var(--space-8)",paddingBottom:"var(--space-4)"};function d({value:d,onChange:m,options:h,label:p,emptyValue:f,columns:g=5,cell:v,header:w,onPreview:b,tooltips:x=!0,disabled:N=!1,className:k=""}){const j=t(),y=j.iconPicker,A=j.iconNames,C=e=>e.label??A[e.value]??e.value,D=i([]),H=Math.max(0,h.findIndex(e=>e.value===d)),I=h[H],M=I?.value===f,P=i(null);/* @__PURE__ */
|
|
2
|
+
return l(e,{className:k,disabled:N,triggerLabel:I?y.button(p,C(I)):p,"aria-label":p,initialFocus:P,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */l("span",M||!I?{className:"text-sm",children:I?C(I):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:I.icon}),
|
|
3
3
|
/* @__PURE__ */l(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */o(s,{children:["function"==typeof w?w({close:e}):w,
|
|
4
|
-
/* @__PURE__ */l("div",{role:"listbox","aria-label":p,className:v?"grid gap-1 rosh-one-height-rows":"grid gap-1",style:{gridTemplateColumns:`repeat(${g}, ${v?.width??"2rem"})`},children:h.map((n,t)=>{const i=n.value===d,o=/* @__PURE__ */l(r,{ref:e=>{
|
|
4
|
+
/* @__PURE__ */l("div",{role:"listbox","aria-label":p,className:v?"grid gap-1 rosh-one-height-rows":"grid gap-1",style:{gridTemplateColumns:`repeat(${g}, ${v?.width??"2rem"})`},children:h.map((n,t)=>{const i=n.value===d,o=/* @__PURE__ */l(r,{ref:e=>{D.current[t]=e,t===H&&(P.current=e)},role:"option","aria-selected":i,"aria-label":C(n),pressed:i,tabIndex:t===H?0:-1,onKeyDown:e=>((e,r)=>{const n=c[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/g)+n[0],t=e%g+n[1];if(a<0||t<0||t>=g)return;const i=a*g+t;if(!(i>=h.length)){for(const[e,r]of D.current.entries())r?.setAttribute("tabindex",e===i?"0":"-1");D.current[i]?.focus()}})(t,e),onClick:()=>{m(n.value),e()},onMouseEnter:b?e=>b(n.value,e.currentTarget):void 0,style:v?{width:v.width,height:"auto",minHeight:v.height,...v.words?u:null}:void 0,children:/* @__PURE__ */l("span",{"aria-hidden":"true",className:v?"inline-flex":"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})},n.value);return x?/* @__PURE__ */l(a,{content:C(n),children:o},n.value):o})})]})})}export{d as IconPicker};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-W6REY3SV.js";import{Button_default as a}from"./chunk-MEP6CZJ3.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-OSMRYND3.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-OSMRYND3.js";import{Button_default as t}from"./chunk-MEP6CZJ3.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-24BF22NF.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as a}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as i}from"./chunk-TZFACUMR.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const N=n().charts,w=m(),M=y??(e=>h(e,w)),F=j??N.nothingToBreakDown,$=c(null),B=o($),C=v??B,[R,z]=u(null),{highlighted:A}=l(),D=e(p,C,d);if(0===D.length)/* @__PURE__ */
|
|
2
|
+
return s("div",{className:b,ref:$,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:F})});const G=k??r(0),H=Math.max(...D.map(e=>e.value),1),Q=e=>34+e/H*62,V=e=>`color-mix(in oklab, ${G} ${Q(e).toFixed(0)}%, ${i.surface})`,Y=e=>Q(e)>=55?i.surface:i.label,E=R??A,I=R?D.find(e=>e.key===R):void 0;/* @__PURE__ */
|
|
3
|
+
return f("div",{className:`relative ${b??""}`,ref:$,children:[
|
|
4
|
+
/* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${C} ${d}`,role:"img","aria-label":N.treemap(p.length),onMouseLeave:()=>z(null),children:D.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
|
|
5
|
+
return f("g",{opacity:E&&E!==e.key?.55:1,onMouseEnter:()=>z(e.key),children:[
|
|
6
|
+
/* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:V(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:Y(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:Y(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:M(e.value)})]},e.key)})}),I&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(a,{title:I.label,rows:[{key:"value",label:N.value,color:V(I.value),value:M(I.value)}]})}),
|
|
7
|
+
/* @__PURE__ */s(t,{caption:N.treemap(p.length),head:[N.tableItem,N.value],rows:D.map(e=>[e.label,M(e.value)])})]})}export{p as TreemapChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-XNKNX5L3.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-RTK77DMP.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),A=a(),[j,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),T=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!T.current&&D&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const N=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),P=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:P,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:N,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
2
|
-
return s(e,{content:z??
|
|
1
|
+
import{Tooltip as e}from"./chunk-AJPQJ7TC.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,N=t().resizeHandle,k=o(null),M=o({onResize:d,min:f,max:p,side:m});M.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const C=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>C,[C]);const R=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),C())},D="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",I="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",T=P?`absolute inset-x-0 ${D} z-10 flex h-2`:`absolute inset-y-0 ${D} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:z??N.hint,side:I,delay:600,className:`${T} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??N.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void C();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=M.current;o(l(r.width,t,s,n,i))},onPointerUp:R,onPointerCancel:R,onLostPointerCapture:()=>{k.current&&C()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${D} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${D} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-XYVFJLAU.js";import{IconButton_default as r}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-XYVFJLAU.js";import{IconButton_default as r}from"./chunk-MYH5H43C.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-I2NVBDKH.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:
|
|
4
|
-
return m("div",{id:
|
|
3
|
+
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:H=""}){const[B,R]=i(!1),T=o(null),V=a().copy;c(()=>()=>{T.current&&clearTimeout(T.current)},[]);const D=l(async()=>{await e(t)?(R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{R(!1),T.current=null},2e3),v?.(t)):n.error(V.failed)},[t,v,V]),{box:I,button:L}=p[g],S=!k;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:S?void 0:j,"aria-describedby":S?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[N],I,H].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
5
|
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:t,children:y??t}),!k&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?V.copyLabel(x):V.copy,"aria-describedby":
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?V.copyLabel(x):V.copy,"aria-describedby":C,onClick:D,className:`${L} text-gray-400`,children:/* @__PURE__ */s(B?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:B?V.copied:""})]})]})}export{y as Snippet};
|