efficient-shell 15.1.0 → 15.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Browser-QK2CCZTR.js +44 -0
- package/dist/Calculator-DB4U2KXJ.js +29 -0
- package/dist/CurrencyConverter-D5MWU2M2.js +21 -0
- package/dist/{Files-QNAN5FCH.js → Files-6WMIQAVD.js} +93 -93
- package/dist/Notepad-FKSRP7R6.js +24 -0
- package/dist/PdfViewer-AIAVQYZ6.js +1 -0
- package/dist/{PomodoroTimer-LJ6VBFGX.js → PomodoroTimer-U62N64F6.js} +22 -22
- package/dist/{Preview-I35MWZBC.js → Preview-2GS2CWRA.js} +15 -15
- package/dist/Sidebar-KAALEIIX.js +44 -0
- package/dist/{Stock-USRT7FDU.js → Stock-DUXAE4DY.js} +4 -4
- package/dist/{Weather-CMA5QQYM.js → Weather-XXPZTLY7.js} +22 -22
- package/dist/{WorldClock-WQ3XGK2J.js → WorldClock-6ANSNTXU.js} +7 -7
- package/dist/ai/index.js +118 -118
- 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-ULSVYSVN.js → chunk-26ZOXLE6.js} +1 -1
- package/dist/chunk-2RLUG5ID.js +1 -0
- package/dist/chunk-345FP3IX.js +4 -0
- package/dist/{chunk-HTBACICQ.js → chunk-35Q7ZMQD.js} +6 -6
- package/dist/{chunk-IZ6D4KGR.js → chunk-3AVXNZY5.js} +3 -3
- package/dist/chunk-3FININUU.js +1 -0
- package/dist/{chunk-ZEGCKIAL.js → chunk-3H476JWK.js} +3 -3
- package/dist/chunk-422SFOQU.js +28 -0
- package/dist/chunk-4KPOTWYF.js +92 -0
- package/dist/{chunk-GVAVIYE6.js → chunk-4MDSZSLC.js} +1 -1
- package/dist/{chunk-UYUNREAL.js → chunk-4NTAZLT3.js} +3 -3
- package/dist/{chunk-NC5FIFAY.js → chunk-52RSW6TO.js} +1 -1
- package/dist/{chunk-P5J7G7OV.js → chunk-5B7CLXHC.js} +1 -1
- package/dist/{chunk-Y5YVKUM4.js → chunk-5LB7LCEG.js} +17 -17
- package/dist/{chunk-JPVD3VS7.js → chunk-5LG6TOV6.js} +6 -6
- package/dist/{chunk-7D2QZ6JA.js → chunk-5OXQ5M5S.js} +1 -1
- package/dist/{chunk-AH5MLH54.js → chunk-5QHNDAZ6.js} +1 -1
- package/dist/chunk-5QRHQCRG.js +2 -0
- package/dist/chunk-5RCKE4X2.js +6 -0
- package/dist/{chunk-2RLWGWOU.js → chunk-5Y2JZL3I.js} +13 -13
- package/dist/{chunk-DO6P6LYU.js → chunk-62UNBUTU.js} +1 -1
- package/dist/chunk-A4ROXNUF.js +2 -0
- package/dist/{chunk-EDRELF6L.js → chunk-ABIWAS5K.js} +1 -1
- package/dist/{chunk-TBDILJ6G.js → chunk-AKEED2BC.js} +1 -1
- package/dist/chunk-APFDZ2HG.js +1 -0
- package/dist/{chunk-XJK6VNXV.js → chunk-ASNRA3ZL.js} +1 -1
- package/dist/{chunk-Y5RTVKMB.js → chunk-B4Y5NGHR.js} +8 -8
- package/dist/{chunk-CXEELIRW.js → chunk-BTMZ5MUY.js} +10 -10
- package/dist/chunk-C4TG6XS4.js +19 -0
- package/dist/chunk-C75ICYHF.js +2 -0
- package/dist/{chunk-EHPY3BFC.js → chunk-CGX2IGQO.js} +1 -1
- package/dist/chunk-CIZAUBWA.js +6 -0
- package/dist/{chunk-DNPAYNNU.js → chunk-CMEPDSYB.js} +1 -1
- package/dist/chunk-D7MRZZVV.js +5 -0
- package/dist/chunk-DEV3ZHPP.js +8 -0
- package/dist/chunk-DN6NGGP5.js +8 -0
- package/dist/{chunk-UGA5NGW4.js → chunk-E43VGO66.js} +1 -1
- package/dist/{chunk-O7A7PH3R.js → chunk-EJ5NIA42.js} +1 -1
- package/dist/{chunk-NHALP3MW.js → chunk-EJMCK7E3.js} +4 -4
- package/dist/{chunk-U75MSD4F.js → chunk-EULBBS5L.js} +1 -1
- package/dist/{chunk-G3TC2GIA.js → chunk-FAPZFMS3.js} +1 -1
- package/dist/chunk-FGP2IOFN.js +15 -0
- package/dist/{chunk-DBBOD5QW.js → chunk-FHTL7ZZR.js} +1 -1
- package/dist/chunk-GGNQEZ2D.js +9 -0
- package/dist/{chunk-XFN4DOXP.js → chunk-GL3D5EOZ.js} +3 -3
- package/dist/{chunk-2SOGTOUQ.js → chunk-GUOAPXUY.js} +4 -4
- package/dist/{chunk-EHNW3UNC.js → chunk-HU5FTTW2.js} +8 -8
- package/dist/{chunk-HAEZUUDT.js → chunk-INQQUAIO.js} +3 -3
- package/dist/{chunk-6RU2PGQK.js → chunk-JA4I5BEB.js} +1 -1
- package/dist/{chunk-SP4S4HUJ.js → chunk-JGN27L4Q.js} +3 -3
- package/dist/{chunk-QCLKRFL4.js → chunk-JIHDUZJZ.js} +3 -3
- package/dist/chunk-JRKD7SD3.js +24 -0
- package/dist/{chunk-RA5G4K3N.js → chunk-JWS77LQE.js} +1 -1
- package/dist/{chunk-T46I4YOI.js → chunk-KERCZSIA.js} +1 -1
- package/dist/{chunk-ZA6ANC2D.js → chunk-KIIZNION.js} +4 -4
- package/dist/{chunk-Y6FULJWJ.js → chunk-KJ4CHRRC.js} +7 -7
- package/dist/{chunk-6X32SWQI.js → chunk-L2WQOJ3T.js} +1 -1
- package/dist/{chunk-OYQWBJ37.js → chunk-LFUXWZV7.js} +1 -1
- package/dist/{chunk-7OVMWXFM.js → chunk-LGVVXYW7.js} +1 -1
- package/dist/{chunk-5O4HMXPQ.js → chunk-MF7OELXP.js} +2 -2
- package/dist/chunk-MQNSKFZY.js +11 -0
- package/dist/chunk-NJY4HPNB.js +7 -0
- package/dist/{chunk-2TNG32QT.js → chunk-NM7U42KL.js} +8 -8
- package/dist/{chunk-F7J7XRVI.js → chunk-NZNPU2GD.js} +1 -1
- package/dist/{chunk-BUUAALHH.js → chunk-OEWBWKKD.js} +20 -20
- package/dist/{chunk-3L7BEEBW.js → chunk-OHWP24DL.js} +1 -1
- package/dist/{chunk-WYAKASF3.js → chunk-OK2J6WSC.js} +1 -1
- package/dist/chunk-P56YLT73.js +15 -0
- package/dist/{chunk-EEAOFYW5.js → chunk-PCNFY6EK.js} +10 -10
- package/dist/{chunk-XNKNX5L3.js → chunk-PM6HY5BH.js} +1 -1
- package/dist/{chunk-7WF6LFOJ.js → chunk-PO2KNVCC.js} +1 -1
- package/dist/chunk-PRN2QDX6.js +7 -0
- package/dist/{chunk-YX3JD6PA.js → chunk-QE2F4YQQ.js} +7 -7
- package/dist/{chunk-4BRVZAIW.js → chunk-QSFQTMWV.js} +1 -1
- package/dist/{chunk-6AYAB5FN.js → chunk-QSOBETAI.js} +5 -5
- package/dist/chunk-QXEZBS3H.js +6 -0
- package/dist/{chunk-3ZJAQSFS.js → chunk-QYOIS4BN.js} +3 -3
- package/dist/chunk-R6YVKP6D.js +3 -0
- package/dist/chunk-R72SBGYR.js +9 -0
- package/dist/{chunk-R36VZ35L.js → chunk-RIA6KKIB.js} +5 -5
- package/dist/{chunk-24BF22NF.js → chunk-RTZFWH5U.js} +1 -1
- package/dist/chunk-S6C7X6CR.js +23 -0
- package/dist/{chunk-XIX72C7K.js → chunk-SJUEGYT2.js} +1 -1
- package/dist/{chunk-ION3XGLN.js → chunk-TAB3K2WF.js} +1 -1
- package/dist/{chunk-MPC3CHAO.js → chunk-TAIH2VIW.js} +1 -1
- package/dist/chunk-TALQMTCE.js +4 -0
- package/dist/{chunk-I7WAOKU2.js → chunk-TEYG2W7A.js} +2 -2
- package/dist/{chunk-JU722M5V.js → chunk-TMXMIRWG.js} +8 -8
- package/dist/{chunk-IVEM2BPC.js → chunk-TSZPGDU3.js} +1 -1
- package/dist/{chunk-EOYKUV2U.js → chunk-TTUUXGEW.js} +1 -1
- package/dist/{chunk-4SFWQPOB.js → chunk-TXGVSWH6.js} +13 -13
- package/dist/{chunk-EHSK43WG.js → chunk-U7PA4KNZ.js} +8 -8
- package/dist/{chunk-RXCBSQA2.js → chunk-UYM7562M.js} +2 -2
- package/dist/chunk-V4BA3FGC.js +14 -0
- package/dist/{chunk-P3XXFQG5.js → chunk-V62FEHS4.js} +1 -1
- package/dist/{chunk-MKHOXO5O.js → chunk-VB4ZPIZF.js} +1 -1
- package/dist/{chunk-PTLVNC3V.js → chunk-VHBRVW5O.js} +6 -6
- package/dist/{chunk-5SQHRDFC.js → chunk-WNHDYTTI.js} +2 -2
- package/dist/chunk-WR3SULZW.js +13 -0
- package/dist/chunk-WSQ73CRR.js +2 -0
- package/dist/{chunk-GY7MJTIZ.js → chunk-XMBMI27I.js} +1 -1
- package/dist/{chunk-4RF3C523.js → chunk-XSMVWJV3.js} +1 -1
- package/dist/{chunk-EN3GYSCE.js → chunk-YEDAXZYO.js} +1 -1
- package/dist/{chunk-TFQC67XR.js → chunk-YGNJIOOH.js} +9 -9
- package/dist/{chunk-47BGAQWD.js → chunk-YXMXATYP.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ListToolbar.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.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/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/SearchInput.js +1 -1
- package/dist/forms/Segmented.d.ts +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/index.d.ts +1 -1
- package/dist/index.js +511 -511
- package/dist/map/index.js +11 -11
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/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/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.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/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/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.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-MILMPZK2.js +0 -44
- package/dist/Calculator-MW7S4UKX.js +0 -29
- package/dist/CurrencyConverter-P3HQXUX2.js +0 -21
- package/dist/Notepad-VXENTPT2.js +0 -24
- package/dist/PdfViewer-FWGHFO4N.js +0 -1
- package/dist/Sidebar-2TYZENQL.js +0 -44
- package/dist/chunk-2XDO7FZC.js +0 -24
- package/dist/chunk-4DNPUG3T.js +0 -7
- package/dist/chunk-A3VLZZHJ.js +0 -9
- package/dist/chunk-AJPQJ7TC.js +0 -6
- package/dist/chunk-ALZHFQRX.js +0 -4
- package/dist/chunk-B34UWI47.js +0 -1
- package/dist/chunk-CHDGSJLV.js +0 -8
- package/dist/chunk-DOJSWVBX.js +0 -6
- package/dist/chunk-EBODRYXS.js +0 -19
- package/dist/chunk-FFPIT2LB.js +0 -3
- package/dist/chunk-HX5QSQ2C.js +0 -2
- package/dist/chunk-KETNB4NQ.js +0 -2
- package/dist/chunk-M5IZ7QLQ.js +0 -7
- package/dist/chunk-MEP6CZJ3.js +0 -2
- package/dist/chunk-MNZAAQLH.js +0 -15
- package/dist/chunk-MYH5H43C.js +0 -1
- package/dist/chunk-NDCS4COQ.js +0 -11
- package/dist/chunk-OJYEGB74.js +0 -28
- package/dist/chunk-PWON7O3N.js +0 -9
- package/dist/chunk-RTK77DMP.js +0 -15
- package/dist/chunk-SYUCEN76.js +0 -92
- package/dist/chunk-VUBDHFG5.js +0 -4
- package/dist/chunk-W4IH3BE3.js +0 -23
- package/dist/chunk-W6REY3SV.js +0 -5
- package/dist/chunk-WBZO6WRU.js +0 -8
- package/dist/chunk-Y7D2CZ4H.js +0 -13
- package/dist/chunk-YTLUSBDY.js +0 -14
- package/dist/chunk-ZSVU44OB.js +0 -6
- /package/dist/{chunk-5YTZBYG4.js → chunk-TEQ5ZPAL.js} +0 -0
package/dist/Browser-MILMPZK2.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import{InputEndActionButton as e}from"./chunk-W6REY3SV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-XFN4DOXP.js";import{WindowTitle as n}from"./chunk-SYUCEN76.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-2XDO7FZC.js";import"./chunk-ZSVU44OB.js";import"./chunk-EIFNESXS.js";import"./chunk-7WF6LFOJ.js";import"./chunk-CJ4OEY3T.js";import"./chunk-AH5MLH54.js";import"./chunk-5YTZBYG4.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-6X32SWQI.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-B34UWI47.js";import"./chunk-M5IZ7QLQ.js";import"./chunk-XNKNX5L3.js";import"./chunk-DWGYC7OD.js";import"./chunk-MYH5H43C.js";import"./chunk-EDRELF6L.js";import"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-MEP6CZJ3.js";import"./chunk-IVEM2BPC.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G3TC2GIA.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var p="react-os-shell:browser-bookmarks",d="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(p);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(d)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,R]=l(w),[W,S]=l([w]),[T,P]=l(0),[z,D]=l(0),[E,H]=l(x),[L,M]=l(!1),[Y,J]=l(null),U=i(null),Z=i(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(E))}catch{}},[E]);const F=e=>{const t=f(e);t&&(v(t),R(t),S(e=>{const o=e.slice(0,T+1);return o.push(t),o}),P(e=>e+1),M(!1))},G=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},O=()=>{const e=Y?.trim();e?(H(t=>[...t,{label:e,url:w}]),J(null)):J(null)};c(()=>{if(null===Y)return;U.current?.focus(),U.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||J(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==Y]);const X=e=>{H(t=>t.filter((t,o)=>o!==e))},B=T>0,I=T<W.length-1,Q=E.some(e=>e.url===w),V="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
|
|
2
|
-
return m("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
3
|
-
/* @__PURE__ */u(n,{title:`Browser - ${j(w)}`}),
|
|
4
|
-
/* @__PURE__ */u(r,{app:"browser"}),
|
|
5
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
|
|
6
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(T>0){const e=T-1;P(e),v(W[e]),R(W[e]),M(!1)}},disabled:!B,className:V,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(T<W.length-1){const e=T+1;P(e),v(W[e]),R(W[e]),M(!1)}},disabled:!I,className:V,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
-
/* @__PURE__ */u("button",{onClick:()=>D(e=>e+1),className:V,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
-
/* @__PURE__ */u("button",{onClick:()=>F(b),className:V,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
-
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),F(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
|
|
11
|
-
/* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
|
|
12
|
-
/* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
|
|
13
|
-
/* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>R(w)}})})]})}),
|
|
14
|
-
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>Q?X(E.findIndex(e=>e.url===w)):void J(j(w)),className:V+" "+(Q?"text-yellow-500":""),title:Q?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:Q?"currentColor":"none",strokeWidth:1.5})}),
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:G,className:V,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>M(e=>!e),className:V,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==Y&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
|
|
17
|
-
/* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
|
|
18
|
-
/* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
|
|
19
|
-
/* @__PURE__ */u("input",{ref:U,type:"text",value:Y,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"===e.key?O():"Escape"===e.key&&J(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
|
|
20
|
-
/* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>J(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:O,disabled:!Y.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
|
|
23
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===E.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),E.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>F(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&X(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
|
|
24
|
-
/* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
|
|
25
|
-
/* @__PURE__ */u("div",{className:"flex-1"}),
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(d,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
|
|
27
|
-
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(N,{url:w,iframeKey:z,iframeRef:Z,openExternal:G,showHelp:L,dismissHelp:()=>M(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,p]=l(!1);c(()=>{p(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
|
|
28
|
-
/* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
|
|
29
|
-
/* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[j(e)," can't be embedded"]}),
|
|
30
|
-
/* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|
|
31
|
-
/* @__PURE__ */u("span",{className:"font-mono text-xs",children:"X-Frame-Options"})," ","or ",
|
|
32
|
-
/* @__PURE__ */u("span",{className:"font-mono text-xs",children:"Content-Security-Policy"})," header that refuses iframe embedding. The browser blocks the load before our app can do anything about it."]}),
|
|
33
|
-
/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-2",children:[
|
|
34
|
-
/* @__PURE__ */m("button",{onClick:r,className:"px-4 py-2 bg-blue-500 text-white text-sm rounded hover:bg-blue-600 inline-flex items-center gap-2",children:[
|
|
35
|
-
/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5}),"Open in a new tab"]}),
|
|
36
|
-
/* @__PURE__ */u("button",{onClick:()=>p(!0),className:"text-xs text-gray-500 hover:text-gray-800 underline",children:"Try loading it here anyway"})]})]})}):/* @__PURE__ */m(h,{children:[
|
|
37
|
-
/* @__PURE__ */u("iframe",{ref:o,src:e,className:"absolute inset-0 w-full h-full bg-white",sandbox:"allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-modals",referrerPolicy:"no-referrer-when-downgrade"},t+e),n&&/* @__PURE__ */m("div",{className:"absolute top-2 right-2 max-w-sm bg-white border border-gray-200 rounded-md shadow-lg p-3 text-xs text-gray-700 z-10",children:[
|
|
38
|
-
/* @__PURE__ */u("div",{className:"font-medium text-gray-900 mb-1",children:"Why is this page blank?"}),
|
|
39
|
-
/* @__PURE__ */m("p",{className:"mb-2",children:["Most major sites (Google, GitHub, banks, news) refuse to be embedded in an iframe via ",
|
|
40
|
-
/* @__PURE__ */u("span",{className:"font-mono",children:"X-Frame-Options"})," or Content Security Policy. There's no workaround — the browser blocks the load before our app can do anything."]}),
|
|
41
|
-
/* @__PURE__ */m("p",{children:["Hit the ",
|
|
42
|
-
/* @__PURE__ */u("span",{className:"font-medium",children:"↗"})," button to open the page in a real new tab. Sites that ",
|
|
43
|
-
/* @__PURE__ */u("em",{children:"do"})," allow embedding (Wikipedia, DevDocs, your own apps) work fine in here."]}),
|
|
44
|
-
/* @__PURE__ */u("button",{onClick:s,className:"mt-2 text-2xs text-blue-600 hover:underline",children:"Got it"})]})]})}export{v as default};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-F7J7XRVI.js";import{useWidgetSettings as n}from"./chunk-SYUCEN76.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-2XDO7FZC.js";import"./chunk-ZSVU44OB.js";import"./chunk-EIFNESXS.js";import"./chunk-7WF6LFOJ.js";import"./chunk-CJ4OEY3T.js";import"./chunk-AH5MLH54.js";import"./chunk-5YTZBYG4.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-6X32SWQI.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-M5IZ7QLQ.js";import"./chunk-XNKNX5L3.js";import"./chunk-DWGYC7OD.js";import"./chunk-MYH5H43C.js";import"./chunk-EDRELF6L.js";import"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-MEP6CZJ3.js";import"./chunk-IVEM2BPC.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G3TC2GIA.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[j,b]=c(null),[g,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,T]=c(!1),[$,E]=c(()=>t(h)),[F,J]=c(!1),[P,M]=c($),S=i(null);n(o(()=>{M({...$}),J(!0)},[$]));const Z=o(t=>{y(""),k(e=>g||"0"===e?(N(!1),"."===t?"0.":t):"."===t&&e.includes(".")?e:e+t)},[g]),D=o(()=>{k("0"),d(null),b(null),N(!1)},[]),H=o((t,e,n)=>{switch(n){case"+":return t+e;case"-":return t-e;case"×":return t*e;case"÷":return 0===e?0:t/e;default:return e}},[]),R=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=H(p,e,j);k(String(t)),d(t),f(n=>[`${p} ${j} ${e} = ${t}`,...n].slice(0,20))}else d(e);b(t),N(!0)},[m,p,j,g,H]),W=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=H(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),y(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,H]),G=o(()=>{k(t=>String(parseFloat(t)/100))},[]),X=o(()=>{k(t=>t.startsWith("-")?t.slice(1):"0"===t?t:"-"+t)},[]);s(()=>{const t=t=>{const e=t.target.tagName;"INPUT"!==e&&"TEXTAREA"!==e&&"SELECT"!==e&&(t.key>="0"&&t.key<="9"?Z(t.key):"."===t.key?Z("."):"+"===t.key?R("+"):"-"===t.key?R("-"):"*"===t.key?R("×"):"/"===t.key?(t.preventDefault(),R("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&S.current?.contains(t.target)&&t.preventDefault(),W()):"Escape"===t.key?D():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&G())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[Z,R,W,D,G]);const Y="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",B=`${Y} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,Q=`${Y} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,V=`${Y} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,w=`${Y} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
-
return l(a,{children:[
|
|
3
|
-
/* @__PURE__ */l("div",{ref:S,className:"flex flex-col h-full",style:{opacity:$.activeOpacity/100,backdropFilter:$.activeBlur>0?`blur(${$.activeBlur}px)`:void 0},children:[
|
|
4
|
-
/* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((t,e)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:t},e))}),(C||j&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:C||`${p} ${j} ${g?"":m}`}),
|
|
6
|
-
/* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),T(!0),setTimeout(()=>T(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
-
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(t=>{const e=parseFloat(t);return isNaN(e)||t.endsWith(".")||t.endsWith(".0")||Math.abs(e)<1e15&&t.length<16?t:e.toExponential(6)})(m)})]})]}),
|
|
9
|
-
/* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
-
/* @__PURE__ */u("button",{onClick:D,className:V,children:"AC"}),
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:X,className:V,children:"+/−"}),
|
|
12
|
-
/* @__PURE__ */u("button",{onClick:G,className:V,children:"%"}),
|
|
13
|
-
/* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${Q} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("7"),className:B,children:"7"}),
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("8"),className:B,children:"8"}),
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("9"),className:B,children:"9"}),
|
|
17
|
-
/* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${Q} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("4"),className:B,children:"4"}),
|
|
19
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("5"),className:B,children:"5"}),
|
|
20
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("6"),className:B,children:"6"}),
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${Q} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("1"),className:B,children:"1"}),
|
|
23
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("2"),className:B,children:"2"}),
|
|
24
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("3"),className:B,children:"3"}),
|
|
25
|
-
/* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${Q} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("0"),className:`${B} col-span-2`,children:"0"}),
|
|
27
|
-
/* @__PURE__ */u("button",{onClick:()=>Z("."),className:B,children:"."}),
|
|
28
|
-
/* @__PURE__ */u("button",{onClick:W,className:w,children:"="})]})]}),
|
|
29
|
-
/* @__PURE__ */u(e,{open:F,onClose:()=>J(!1),title:"Calculator Settings",appearance:P,onAppearanceChange:M,onSave:()=>{E(P),localStorage.setItem(h,JSON.stringify(P)),J(!1)}})]})}export{m as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-F7J7XRVI.js";import{useWidgetSettings as r}from"./chunk-SYUCEN76.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-2XDO7FZC.js";import"./chunk-ZSVU44OB.js";import"./chunk-EIFNESXS.js";import"./chunk-7WF6LFOJ.js";import"./chunk-CJ4OEY3T.js";import"./chunk-AH5MLH54.js";import"./chunk-5YTZBYG4.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-6X32SWQI.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-M5IZ7QLQ.js";import"./chunk-XNKNX5L3.js";import"./chunk-DWGYC7OD.js";import"./chunk-MYH5H43C.js";import"./chunk-EDRELF6L.js";import"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-MEP6CZJ3.js";import"./chunk-IVEM2BPC.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G3TC2GIA.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function j(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function g(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(g),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,P]=s([]),[U,R]=s(f),[H,Y]=s("USD"),[B,M]=s("CNY");r(o(()=>{P([...u]),R({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,j(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
|
-
return i(a,{children:[
|
|
3
|
-
/* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
|
|
4
|
-
return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
|
|
5
|
-
/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
6
|
-
/* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
|
|
7
|
-
/* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
|
|
8
|
-
/* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
|
|
9
|
-
/* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
|
|
10
|
-
/* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
|
|
11
|
-
/* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
|
|
12
|
-
/* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:U,onAppearanceChange:R,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),v(!1)},children:/* @__PURE__ */i("div",{children:[
|
|
13
|
-
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
|
|
14
|
-
/* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
|
|
15
|
-
/* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
|
-
/* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
|
|
17
|
-
/* @__PURE__ */m("button",{onClick:()=>P(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
18
|
-
/* @__PURE__ */m("select",{value:H,onChange:t=>Y(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
19
|
-
/* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */m("select",{value:B,onChange:t=>M(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:()=>{H!==B&&J.length<4&&P(t=>[...t,[H,B]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
|
package/dist/Notepad-VXENTPT2.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{getNumberingConfigs as e}from"./chunk-ULSVYSVN.js";import{SidebarLayout as t}from"./chunk-JU722M5V.js";import"./chunk-QWK6DRSN.js";import"./chunk-5SQHRDFC.js";import{timeAgo as r}from"./chunk-OJI4ROSD.js";import"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-XFN4DOXP.js";import{useWindowManager as o,client_default as i}from"./chunk-SYUCEN76.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-2XDO7FZC.js";import"./chunk-ZSVU44OB.js";import"./chunk-EIFNESXS.js";import"./chunk-7WF6LFOJ.js";import"./chunk-CJ4OEY3T.js";import"./chunk-AH5MLH54.js";import"./chunk-5YTZBYG4.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-6X32SWQI.js";import"./chunk-SH7PJC4P.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-B34UWI47.js";import"./chunk-M5IZ7QLQ.js";import"./chunk-XNKNX5L3.js";import"./chunk-DWGYC7OD.js";import"./chunk-MYH5H43C.js";import"./chunk-EDRELF6L.js";import"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-MEP6CZJ3.js";import"./chunk-IVEM2BPC.js";import{Icon as s}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G3TC2GIA.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import{toast_default as l}from"./chunk-I2NVBDKH.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as k,jsx as g}from"react/jsx-runtime";var x=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var y={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=c(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),T=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=y[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}T.current=e},[v]);const w=j.notepad_notes||[],[C,_]=d(null),[S,D]=d(""),[X,P]=d(""),[W,J]=d("yellow"),[H,M]=d(!1),[O,R]=d(!1),Z=a(null),F=a();p(()=>{if(!C&&w.length>0){const e=w[0];_(e.id),D(e.title),P(e.content),J(e.color)}},[w.length]);const I=m(e=>{N({notepad_notes:e})},[N]),U=m(()=>{if(!C||!H)return;const e=w.map(e=>e.id===C?{...e,title:S,content:X,color:W,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);I(e),M(!1)},[C,H,S,X,W,w,I]);p(()=>{if(H)return F.current&&clearTimeout(F.current),F.current=setTimeout(U,800),()=>{F.current&&clearTimeout(F.current)}},[H,U]),p(()=>()=>{H&&U()},[]);const V=e=>{H&&U(),_(e.id),D(e.title),P(e.content),J(e.color),M(!1),R(!1)},$=e=>{const t=X.slice(0,e),r=X.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=X.slice(e+r[0].length);P(t+n+o),M(!0)},Q=async(e,t)=>{const r=T.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):l.error(`${n} not found`)}catch{l.error(`Failed to look up ${n}`)}},Y="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",B=/* @__PURE__ */h(k,{children:[
|
|
2
|
-
/* @__PURE__ */g("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{H&&U();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...w];I(t),_(e.id),D(""),P(""),J("yellow"),M(!1),R(!0),setTimeout(()=>Z.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
|
|
3
|
-
/* @__PURE__ */g(s,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
|
|
4
|
-
/* @__PURE__ */g("div",{className:"flex-1 overflow-y-auto",children:0===w.length?/* @__PURE__ */g("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):w.map(e=>{const t=(n=e.color,x.find(e=>e.key===n)||x[0]);var n;/* @__PURE__ */
|
|
5
|
-
return h("button",{onClick:()=>V(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(C===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
|
|
6
|
-
/* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
|
|
7
|
-
/* @__PURE__ */g("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
|
|
8
|
-
/* @__PURE__ */g("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
|
|
9
|
-
/* @__PURE__ */g("p",{className:"text-xs text-ink-faintest mt-0.5 truncate ml-5",children:e.content.replace(/\[[ xX]?\]/g,"").slice(0,60)||"Empty note"}),
|
|
10
|
-
/* @__PURE__ */g("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
|
|
11
|
-
return h("div",{className:"h-full",children:[
|
|
12
|
-
/* @__PURE__ */g(n,{app:"notepad"}),
|
|
13
|
-
/* @__PURE__ */g(t,{sidebar:B,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:C?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
|
|
14
|
-
/* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
|
|
15
|
-
/* @__PURE__ */g("input",{value:S,onChange:e=>{D(e.target.value),M(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
|
|
16
|
-
/* @__PURE__ */g("div",{className:"flex gap-1",children:x.map(e=>/* @__PURE__ */g("button",{onClick:()=>{J(e.key),M(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${W===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
|
|
17
|
-
/* @__PURE__ */g("button",{onClick:()=>(e=>{const t=w.filter(t=>t.id!==e);if(I(t),C===e){const e=t[0];e?V(e):(_(null),D(""),P(""))}})(C),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */g(s,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),O?/* @__PURE__ */g("textarea",{ref:Z,value:X,onChange:e=>{P(e.target.value),M(!0)},onBlur:()=>{R(!1),H&&U()},placeholder:Y,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */g("div",{onClick:()=>{R(!0),setTimeout(()=>Z.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:X?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let l;for(;null!==(l=c.exec(e));){const e=l[1],t=l[2];if(T.current[e]){const n=l.index,o=l[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */g("button",{onClick:()=>Q(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(l=b.exec(e));){const e="x"===l[1]||"X"===l[1],t=l.index,n=a+t;i.push({idx:t,len:l[0].length,render:()=>/* @__PURE__ */g("button",{onClick:()=>$(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */g(s,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */g("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */g("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */g("span",{children:""},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
|
|
18
|
-
return g("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(X):/* @__PURE__ */g("p",{className:"text-gray-300 whitespace-pre-line",children:Y})}),
|
|
19
|
-
/* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
|
|
20
|
-
/* @__PURE__ */g("span",{children:"[] checkbox"}),
|
|
21
|
-
/* @__PURE__ */g("span",{children:"SO#35001 entity link"}),
|
|
22
|
-
/* @__PURE__ */g("span",{className:"ml-auto",children:O?"Editing":"Click to edit"})]})]}):/* @__PURE__ */g("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
|
|
23
|
-
/* @__PURE__ */g(s,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
|
|
24
|
-
/* @__PURE__ */g("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{PdfViewer as default,pageFitScale,pdfWasmParams}from"./chunk-BUUAALHH.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-M6UKCZHT.js";import"./chunk-I2NVBDKH.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";
|
package/dist/Sidebar-2TYZENQL.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-AQH6MAYK.js";import{ResizeHandle as l}from"./chunk-5SQHRDFC.js";import{openGlobalSearch as s}from"./chunk-EHNW3UNC.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{RAIL_MENU_GAP as p,navSections as b,startMenuCategories as f,RAIL_W as g,TAB_STRIP_H as x,RAIL_COLLAPSED_INSET as k,RAIL_MAX_W as y,RAIL_MIN_W as v,navIcons as N,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import{CloseButton as w}from"./chunk-AH5MLH54.js";import"./chunk-DBQNYJZ6.js";import"./chunk-2QY5BJLA.js";import"./chunk-MYH5H43C.js";import{PopupMenu as C,PopupMenuItem as S,PopupMenuDivider as H}from"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-IVEM2BPC.js";import{Icon as $}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as L}from"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useMemo as A,useState as z,useRef as T,useEffect as W,isValidElement as M,cloneElement as I}from"react";import{jsx as R,jsxs as Q,Fragment as K}from"react/jsx-runtime";var D="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),P=150,E=250;function J(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+p,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var O=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),Y="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",B="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function U({open:e,children:t}){const r=T(null);return W(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */R("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */R("div",{className:"min-h-0 overflow-hidden",children:t})})}function F({open:e}){/* @__PURE__ */
|
|
2
|
-
return R($,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function G({dir:e}){/* @__PURE__ */
|
|
3
|
-
return R($,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function Z({className:e}){/* @__PURE__ */
|
|
4
|
-
return R($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var V=e=>.75+1.75*e+"rem";function X({width:p,openWidth:P=g,collapsed:E,onToggleCollapsed:X,onResize:_,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=b,navIcons:ce=N,sectionIcons:de=j,categories:me=f,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=L().layout,{hasAnyPerm:ke}=e(),ye=A(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=z(()=>t(r(n))),je=A(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),we=(e,t=je)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Ce,Se]=z(!1),He=T(null),$e=E&&!le,[Le,Ae]=z(!1),ze=T("pointer"),Te=T(void 0),We=T(!1),Me=T(null),Ie=()=>{clearTimeout(Te.current),Te.current=void 0},Re=e=>{Ie(),ze.current=e,Ae(!0)},Qe=()=>{Ie(),Ae(!1)};W(()=>{Ie(),Ae(!1)},[E]),W(()=>()=>Ie(),[]),W(()=>{if(!Le)return;const e=e=>{const t=e.target;t&&(Me.current?.contains(t)||t.closest?.('[data-popup-menu-tree], [role="menu"]'))||(Ie(),Ae(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[Le]);const Ke=E&&!Le,De=E&&Le?P:p,Pe=(e,t)=>{Qe(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Ee=(e,t)=>{const r=t[e];/* @__PURE__ */
|
|
5
|
-
return R("span",{className:B,"aria-hidden":"true",children:r&&M(r)?I(r,{className:"size-[18px]"}):r})},Je=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Oe=(e,t,r=je)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
|
|
6
|
-
return Q("div",{children:[
|
|
7
|
-
/* @__PURE__ */Q("button",{type:"button",onClick:()=>we(a,r),"aria-expanded":o,className:O(l,!1),style:t>0?{paddingLeft:V(t)}:void 0,children:[0===t&&Ee(e.to,ce),
|
|
8
|
-
/* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:i}),
|
|
9
|
-
/* @__PURE__ */R(F,{open:o})]}),
|
|
10
|
-
/* @__PURE__ */R(U,{open:o,children:/* @__PURE__ */R("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Oe(e,t+1,Je(n)))})}),e.dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:V(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
|
|
11
|
-
return Q("div",{children:[
|
|
12
|
-
/* @__PURE__ */Q("button",{type:"button",onClick:t=>Pe(e,t),onAuxClick:t=>{1===t.button&&Pe(e,t)},"aria-current":a?"page":void 0,className:O(a,!1),style:t>0?{paddingLeft:V(t)}:void 0,children:[0===t&&Ee(e.to,ce),
|
|
13
|
-
/* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:V(t)},"aria-hidden":"true"})]},e.to)},Ye=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */R("span",{className:B,"aria-hidden":"true",children:e.icon}):Ee(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(Ke)/* @__PURE__ */
|
|
14
|
-
return Q("div",{children:[
|
|
15
|
-
/* @__PURE__ */R("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||we(e.label),Re("tap")},className:O(a,!0),children:n}),o&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
|
|
16
|
-
return Q("div",{children:[
|
|
17
|
-
/* @__PURE__ */Q("button",{type:"button",onClick:()=>we(e.label),"aria-expanded":l,"aria-controls":s,className:O(!l&&a,!1),children:[n,
|
|
18
|
-
/* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:i}),
|
|
19
|
-
/* @__PURE__ */R(F,{open:l})]}),
|
|
20
|
-
/* @__PURE__ */R(U,{open:l,children:/* @__PURE__ */R("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Oe(e,1,Je(r)))})}),o&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Be=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Ue=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Fe=re?.avatar_url?/* @__PURE__ */R("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */R("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ue}),Ge=Ce?He.current?.getBoundingClientRect():void 0,Ze=Ke?"":"px-3",Ve=Ke?{paddingInline:k}:void 0,Xe=`${E?xe.expandSidebar:xe.collapseSidebar} (${D?"⌘":"Ctrl"} .)`,_e=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:X,label:E?xe.expandSidebar:xe.collapseSidebar,title:Xe},qe=/* @__PURE__ */Q(K,{children:[he&&/* @__PURE__ */R(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!Ke&&/* @__PURE__ */Q("span",{className:"min-w-0 text-left leading-tight",children:[
|
|
21
|
-
/* @__PURE__ */R("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */R("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),et=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
|
|
22
|
-
return Q("aside",{ref:Me,"aria-label":xe.navLabel,"data-rail-peek":Le?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${E?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${Le?"rounded-r-(--radius-panel)":""}`,style:{width:De,boxShadow:Le?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(We.current=!0,$e&&(Le?Ie():(Ie(),Te.current=setTimeout(()=>Re("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(We.current=!1,$e&&(Ie(),Le&&!Ce&&"pointer"===ze.current&&(Te.current=setTimeout(Qe,250))))},onFocus:e=>{$e&&!Le&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&Re("focus")},onBlur:e=>{if(!Le||"focus"!==ze.current)return;const t=e.relatedTarget;t&&Me.current?.contains(t)||Ce||We.current||Qe()},onKeyDown:e=>{"Escape"===e.key&&Le&&Qe()},children:[
|
|
23
|
-
/* @__PURE__ */Q("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Ke?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:x},children:[_e?/* @__PURE__ */R("button",{type:"button",onClick:_e.run,"aria-label":_e.label,title:_e.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Ke?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */R("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */R(w,{onClose:le,label:xe.closeMenu}):E?Le&&
|
|
24
|
-
/* @__PURE__ */R("button",{type:"button",onClick:()=>{Qe(),X()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${D?"⌘":"Ctrl"} .)`,className:Y,children:/* @__PURE__ */R(G,{dir:"right"})}):/* @__PURE__ */R("button",{type:"button",onClick:X,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${D?"⌘":"Ctrl"} .)`,className:Y,children:/* @__PURE__ */R(G,{dir:"left"})})]}),
|
|
25
|
-
/* @__PURE__ */R("div",{className:`shrink-0 pt-3 ${Ze}`,style:Ve,children:Ke?/* @__PURE__ */R("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${D?"⌘K":"Ctrl K"})`,className:O(!1,!0),children:/* @__PURE__ */R(Z,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */Q("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
|
|
26
|
-
/* @__PURE__ */R(Z,{className:"size-3.5 text-gray-500"}),
|
|
27
|
-
/* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
|
|
28
|
-
/* @__PURE__ */R("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:D?"⌘K":"Ctrl K"})]})}),
|
|
29
|
-
/* @__PURE__ */Q("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ze} ${Ke?"space-y-1":"space-y-0.5"}`,style:Ve,children:[Ke&&/* @__PURE__ */R("button",{type:"button",onClick:X,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${D?"⌘":"Ctrl"} .)`,className:`${O(!1,!0)} mb-3`,children:/* @__PURE__ */R(G,{dir:"right"})}),ye.topItems.map(e=>{if(!Ke)return Oe(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
|
|
30
|
-
return Q("div",{children:[
|
|
31
|
-
/* @__PURE__ */R("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Pe(e,r);const n=`child:${e.to}`;ve.has(n)||we(n),Re("tap")},className:O(r,!0),children:Ee(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Ye(e,!1)),ye.systemSections.map(e=>Ye(e,!1)),ye.virtualSections.map(e=>Ye(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Ye(e,!1))]}),
|
|
32
|
-
/* @__PURE__ */R("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ze}`,style:Ve,children:/* @__PURE__ */Q("button",{ref:He,type:"button",onClick:()=>Se(e=>!e),"aria-haspopup":"menu","aria-expanded":Ce,"aria-label":Ke?xe.accountMenu(Be):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Ke?"justify-center py-2":"px-2 py-2"),children:[Fe,!Ke&&/* @__PURE__ */Q("span",{className:"min-w-0 flex-1 text-left",children:[
|
|
33
|
-
/* @__PURE__ */R("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Be}),ne?.email&&Be!==ne.email&&/* @__PURE__ */R("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),_&&!E&&!le&&/* @__PURE__ */R(l,{side:"left",width:p,onResize:_,min:v,max:y,defaultWidth:g,storageKey:i,label:xe.resizeSidebar}),Ce&&Ge&&/* @__PURE__ */Q(C,{portal:!0,minWidth:224,onClose:()=>{Se(!1),Le&&"pointer"===ze.current&&!We.current&&Qe()},style:J(De,Ge,window.innerHeight),children:[Ke&&/* @__PURE__ */Q("div",{className:"border-b border-line px-3 py-3",children:[
|
|
34
|
-
/* @__PURE__ */R("p",{className:"truncate text-sm font-semibold text-gray-800",children:Be}),ne?.email&&/* @__PURE__ */R("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
|
|
35
|
-
/* @__PURE__ */Q(S,{onClick:()=>{Se(!1),Qe(),ee("/profile",!1)},children:[
|
|
36
|
-
/* @__PURE__ */R($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */Q(S,{onClick:()=>{Se(!1),Pe(e)},children:[
|
|
37
|
-
/* @__PURE__ */R("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */Q(S,{onClick:()=>{Se(!1),Qe(),oe()},children:[
|
|
38
|
-
/* @__PURE__ */R($,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
|
|
39
|
-
/* @__PURE__ */R(H,{}),ae&&/* @__PURE__ */Q(K,{children:[
|
|
40
|
-
/* @__PURE__ */Q(S,{onClick:()=>{Se(!1),Qe(),ae()},children:[
|
|
41
|
-
/* @__PURE__ */R($,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
|
|
42
|
-
/* @__PURE__ */R(H,{})]}),
|
|
43
|
-
/* @__PURE__ */Q(S,{danger:!0,onClick:()=>{Se(!1),Qe(),ie()},children:[
|
|
44
|
-
/* @__PURE__ */R($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{E as RAIL_PEEK_CLOSE_MS,P as RAIL_PEEK_OPEN_MS,J as accountMenuPosition,X as default};
|
package/dist/chunk-2XDO7FZC.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
/* @__PURE__ */h(e,{open:t,onClose:()=>M(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
|
-
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>M(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
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:[
|
|
7
|
-
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
8
|
-
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
|
-
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
|
-
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
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
|
-
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
|
-
/* @__PURE__ */m("div",{className:"flex-1",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
|
-
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
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: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};
|
package/dist/chunk-4DNPUG3T.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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};
|
package/dist/chunk-A3VLZZHJ.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-PPHGBEJA.js";import{inputClasses as r,PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{calendarNames as a,userToday as n}from"./chunk-NHKT5IH6.js";import{fromDateKey as i,toDateKey as o}from"./chunk-JRQMX4PK.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as u}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useShellStrings as p,useShellLocale as f}from"./chunk-NRHG4R2Q.js";import{forwardRef as b,useState as h,useRef as v,useId as g,useEffect as y}from"react";import{createPortal as x}from"react-dom";import{jsx as N,jsxs as k}from"react/jsx-runtime";var j=/^\d{4}-\d{2}-\d{2}$/,w=/^(aria|data)-/,D=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function F(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":o(e);if(j.test(e))return e;const r=new Date(e);return Number.isNaN(r.getTime())?"":o(r)}function H(e,r){const t=i(e);return t?r.longDate(t.getFullYear(),t.getMonth(),t.getDate()):""}var P=b(function({value:o,onChange:b,min:j,max:P,invalid:$,size:B,native:C,weekStartsOn:E,className:G="","aria-label":I,"aria-describedby":R,"aria-labelledby":S,id:q,name:O,disabled:T,placeholder:W,required:z,clearable:J,form:M,title:U,tabIndex:Y,autoFocus:A,onFocus:L,onBlur:Q,formatDisplay:V,...K},Z){const X=J??!z,_=F(o),ee=F(j),re=F(P),te=p().datePicker,ae=f(),ne=a(ae),[ie,oe]=h(!1),le=v(null),se=v(null),de=v(null),ue=g(),ce=g(),me=g(),pe=u(se,ie,{popupRef:de}),[fe,be]=h(!1);c(()=>{const e=!!q&&(se.current?.labels?.length??0)>0;e!==fe&&be(e)});const he=!I&&(!!S||fe);if(y(()=>{if(!ie)return;const e=e=>{const r=e.target;le.current?.contains(r)||de.current?.contains(r)||oe(!1)};document.addEventListener("pointerdown",e,!0);const r=s(()=>oe(!1));return()=>{document.removeEventListener("pointerdown",e,!0),r()}},[ie]),y(()=>{if(ie)return m(e=>"Escape"===e.key&&(oe(!1),se.current?.focus(),!0),()=>de.current)},[ie]),C)/* @__PURE__ */
|
|
2
|
-
return N("input",{ref:Z,type:"date",lang:ae,id:q,name:O,disabled:T,"aria-label":I,"aria-describedby":R,"aria-invalid":$||void 0,value:_,min:ee||void 0,max:re||void 0,onChange:e=>b?.(i(e.target.value)),className:r({invalid:$,size:B,className:G}),"aria-labelledby":S,required:z,form:M,title:U,tabIndex:Y,autoFocus:A,onFocus:L,onBlur:Q,...K});const ve=Object.fromEntries(Object.entries(K).filter(([e])=>w.test(e)&&!D.has(e))),ge=K["aria-required"],ye=!!z||!0===ge||"true"===ge,xe=[he?ce:void 0,ye?me:void 0,R].filter(Boolean).join(" ")||void 0,Ne=n(),ke=!!Ne&&(!ee||Ne>=ee)&&(!re||Ne<=re),je=W??te.placeholder;/* @__PURE__ */
|
|
3
|
-
return k("div",{ref:le,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */N("input",{ref:Z,type:"hidden",name:O,form:M,value:_}),
|
|
5
|
-
/* @__PURE__ */k("button",{ref:se,type:"button",...ve,id:q,disabled:T,title:U,tabIndex:Y,autoFocus:A,onFocus:L,onBlur:Q,"aria-haspopup":"dialog","aria-expanded":ie,"aria-controls":ie?ue:void 0,"aria-labelledby":S,"aria-describedby":xe,"aria-label":I?`${I}${_?`, ${H(_,ne)}`:""}`:void 0,onClick:()=>oe(e=>!e),className:`${r({invalid:$,size:B,className:G})} flex items-center justify-between gap-2 text-left`,children:[
|
|
6
|
-
/* @__PURE__ */N("span",{className:`min-w-0 truncate whitespace-nowrap ${_?"text-ink-strongest":t}`,children:_?V?V(_):H(_,ne):je}),
|
|
7
|
-
/* @__PURE__ */N(l,{name:"date",className:`h-4 w-4 shrink-0 ${t}`,strokeWidth:"1.75","aria-hidden":"true"})]}),he&&/* @__PURE__ */N("span",{id:ce,className:"sr-only",children:_?H(_,ne):je}),ye&&/* @__PURE__ */N("span",{id:me,className:"sr-only",children:te.required}),ie&&x(
|
|
8
|
-
/* @__PURE__ */k("div",{ref:de,id:ue,role:"dialog","aria-label":I??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:d.popup,left:pe?.left,right:pe?.right,top:pe?.top,bottom:pe?.bottom,maxWidth:pe?.maxWidth,visibility:pe?void 0:"hidden"},children:[
|
|
9
|
-
/* @__PURE__ */N(e,{value:_||null,min:ee||null,max:re||null,weekStartsOn:E,onSelect:e=>{oe(!1),se.current?.focus(),b?.(i(e))}}),(X||ke)&&/* @__PURE__ */k("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[X&&/* @__PURE__ */N("button",{type:"button",onClick:()=>{oe(!1),se.current?.focus(),b?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),ke&&/* @__PURE__ */N("button",{type:"button",onClick:()=>{oe(!1),se.current?.focus(),b?.(i(Ne))},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{P as DatePicker_default};
|
package/dist/chunk-AJPQJ7TC.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as s,escapeSurfaceAbove as d}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as h}from"./chunk-5FYDNH4Y.js";import{createContext as u,useContext as p,useState as m,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var H=u(!1),j=()=>p(H),T={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function W({content:u,side:p="top",delay:j=200,children:W,className:N="relative inline-flex",describe:M=!0,open:B}){const[G,P]=m(!1),U=(B??G)&&!(null==u||!1===u||""===u),[z,C]=m(null),D=f(void 0),E=f(null),R=f(null),$=x(),F=f(!1),J=()=>{window.clearTimeout(D.current),F.current||E.current?.querySelector('[aria-haspopup][aria-expanded="true"]')||(D.current=window.setTimeout(()=>P(!0),j))},L=()=>{window.clearTimeout(D.current),P(!1)},V=t=>{t.currentTarget.contains(t.target)&&(F.current=!0,L())},Y=()=>{F.current=!1,L()};w(()=>()=>window.clearTimeout(D.current),[]),c(()=>{if(!U)return void C(null);const t=()=>{const t=E.current,e=R.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void L();const u=a(h,d,p,r,12),m=l(h,u,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:u.left-h.left,top:u.top-h.top,maxWidth:c,maxHeight:s,side:u.side,arrow:m&&{left:m.x-h.left,top:m.y-h.top}};C(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>E.current,t)},[U,p,u]),w(()=>{if(!U)return;const e=s(t=>"Escape"===t.key&&(L(),!d(E.current))),r=t(L);return()=>{e(),r()}},[U]);const q=U&&M?$:void 0,A=g(W)?b(W,{"aria-describedby":[W.props["aria-describedby"],q].filter(Boolean).join(" ")||void 0}):W,I=U?h():void 0;/* @__PURE__ */
|
|
2
|
-
return y("span",{ref:E,className:N,"aria-describedby":g(W)?void 0:q,onMouseEnter:J,onMouseLeave:Y,onFocus:t=>{if(!t.currentTarget.contains(t.target))return;let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&J()},onBlur:Y,onPointerDown:V,onClick:V,children:[
|
|
3
|
-
/* @__PURE__ */k(H.Provider,{value:!0,children:A}),U&&v(
|
|
4
|
-
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...z?.anchor},children:[
|
|
5
|
-
/* @__PURE__ */k("span",{ref:R,id:$,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-ink-strong ${z?"":T[p]}`,style:{...I,...z&&{left:z.left,top:z.top,maxWidth:z.maxWidth,maxHeight:z.maxHeight}},children:u}),(!z||z.arrow)&&
|
|
6
|
-
/* @__PURE__ */k("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":z?.side??p,style:{background:I?.background,"--rosh-tooltip-edge":I?.border,...z?.arrow&&{left:z.arrow.left,top:z.arrow.top}}})]}),document.body)]})}export{W as Tooltip,j as useInsideTooltip};
|
package/dist/chunk-ALZHFQRX.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-EFKJLUYP.js";import{Tooltip as r}from"./chunk-AJPQJ7TC.js";import{useId as s}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";function t({value:t,onChange:c,options:d,name:b,size:u="md",block:m=!1,label:h,className:p="","aria-labelledby":v,"aria-describedby":f}){const g={"aria-label":v?void 0:h,"aria-labelledby":v,"aria-describedby":f},N=s(),y=e(m,p),k=l(m);/* @__PURE__ */
|
|
2
|
-
return n("div",b?{role:"radiogroup",...g,className:y,children:d.map(e=>{const l=`${N}-${e.value}`,s=e.value===t,d=/* @__PURE__ */o("label",{htmlFor:l,className:i({size:u,selected:s,disabled:e.disabled,block:m}),children:[
|
|
3
|
-
/* @__PURE__ */n("input",{id:l,type:"radio",name:b,value:e.value,checked:s,disabled:e.disabled,"aria-describedby":e.title?`${l}-note`:void 0,onChange:()=>c(e.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
|
|
4
|
-
/* @__PURE__ */n(a,{icon:e.icon,label:e.label}),e.title&&/* @__PURE__ */n("span",{id:`${l}-note`,className:"sr-only",children:e.title})]},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:d},e.value):d})}:{role:"group",...g,className:y,children:d.map(e=>{const l=e.value===t,s=/* @__PURE__ */n("button",{type:"button","aria-pressed":l,disabled:e.disabled,onClick:()=>c(e.value),className:i({size:u,selected:l,disabled:e.disabled,block:m}),children:/* @__PURE__ */n(a,{icon:e.icon,label:e.label})},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:k,children:s},e.value):s})})}export{t as Segmented};
|
package/dist/chunk-B34UWI47.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="15.1.0",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-CHDGSJLV.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as r}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as n}from"./chunk-EDRELF6L.js";import{Tooltip as o}from"./chunk-AJPQJ7TC.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-TAHHZGRH.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-NRHG4R2Q.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as v,jsx as b,Fragment as x}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${n.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:n,onChange:y,options:k=[],placeholder:D,allowFreeText:N=!1,invalid:j,disabled:C,id:L,className:A="",tone:E,tooltip:T,split:$,reorderable:H=!1}){const[Y,M]=m(!1),[R,W]=m(null),[F,I]=m(""),J=d(),G=h(null),K=h(null),P=h(null),S=a(G,Y),B=e=>k.find(t=>t.value===e)?.label??e,Q=p(()=>{const t=new Set(n),r=[],o=F.trim().toLowerCase();for(const n of k)t.has(n.value)||(t.add(n.value),o&&!e(n,o)||r.push(n));return r},[k,n,F]),Z=e=>{const t=[...n];for(const r of e){const e=r.trim();if(!e)continue;const n=e.toLowerCase(),o=k.find(t=>t.value===e||t.label.toLowerCase()===n)?.value,l=o??(N?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==n.length&&y(t)},z=e=>{e&&!n.includes(e)?(y([...n,e]),I("")):I("")},O=e=>y(n.filter(t=>t!==e)),U=H&&!C,q=(e,t)=>{if(e===t||t<0||t>=n.length)return;const r=[...n],[o]=r.splice(e,1);r.splice(t,0,o),y(r)},V=()=>{const e=F.trim();if($&&e)return Z(e.split($)),void I("");N&&e?z(e):I("")},X=h(()=>{});X.current=()=>{V(),M(!1)},f(()=>{if(!Y)return;const e=e=>{const t=e.target;G.current?.contains(t)||P.current?.contains(t)||(V(),M(!1))};document.addEventListener("mousedown",e);const t=l(()=>X.current());return()=>{document.removeEventListener("mousedown",e),t()}});const _=k.length>0;/* @__PURE__ */
|
|
2
|
-
return v("div",{ref:G,className:"relative",children:[
|
|
3
|
-
/* @__PURE__ */v("div",{onMouseDown:e=>{C||e.target.closest("button")||(e.preventDefault(),K.current?.focus())},className:r({invalid:j,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${C?"bg-gray-50 cursor-not-allowed":""} ${A}`}),children:[n.map((e,t)=>{const r=E?.(e),l=w[r??"accent"],i=U?{draggable:!0,tabIndex:0,"aria-label":J.select.reorderItem?.(B(e),t+1,n.length)??B(e),onDragStart:r=>{r.dataTransfer.effectAllowed="move",r.dataTransfer.setData("text/plain",e),W(t)},onDragOver:e=>{null!=R&&e.preventDefault()},onDrop:e=>{null!=R&&(e.preventDefault(),q(R,t),W(null))},onDragEnd:()=>W(null),onKeyDown:e=>{e.target===e.currentTarget&&("ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),q(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<n.length-1&&(e.preventDefault(),q(t,t+1)))}}:{},a=/* @__PURE__ */v("span",{"data-tag-chip":"","data-tone":r,...i,className:`${l.chip}${U?" cursor-grab rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]":""}${R===t?" opacity-50":""}`,children:[
|
|
4
|
-
/* @__PURE__ */b("span",{className:"truncate",children:B(e)}),!C&&/* @__PURE__ */b("button",{type:"button","aria-label":J.select.removeItem?.(B(e))??`${J.select.remove} ${B(e)}`,onClick:()=>O(e),className:l.remove,children:"×"})]},e),s=T?.(e);return null==s?a:/* @__PURE__ */b(o,{content:s,className:"relative inline-flex max-w-full",children:a},e)}),
|
|
5
|
-
/* @__PURE__ */b("input",{id:L,ref:K,type:"text",autoComplete:"off",role:"combobox","aria-expanded":Y&&_,"aria-invalid":j||void 0,disabled:C,value:F,placeholder:0===n.length?D:void 0,onChange:e=>{(e=>{if($){const t=e.split($);if(t.length>1)return Z(t.slice(0,-1)),void I(t[t.length-1])}I(e)})(e.target.value),M(!0)},onFocus:()=>{!C&&_&&M(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&N){t.preventDefault();const r=F.trim(),n=r?Q.filter(t=>e(t,r.toLowerCase())):[];1===n.length?z(n[0].value):V()}else"Backspace"===t.key&&""===F&&n.length>0?O(n[n.length-1]):"Escape"===t.key?(M(!1),I(""),K.current?.blur()):"Tab"===t.key&&(V(),M(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),Y&&_&&g(
|
|
6
|
-
/* @__PURE__ */b("div",{ref:P,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:S?.left,right:S?.right,top:S?.top,bottom:S?.bottom,minWidth:S?.minWidth,maxWidth:S?.maxWidth??s,width:"max-content",visibility:S?void 0:"hidden",...u()},children:/* @__PURE__ */b("div",{className:"overflow-y-auto",style:{maxHeight:S?.maxHeight??c},children:0===Q.length?/* @__PURE__ */b("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&n.length>=k.length?J.select.allSelected:J.select.noMatches}):Q.map(e=>/* @__PURE__ */b("button",{type:"button",onMouseDown:t=>{t.preventDefault(),z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */v(x,{children:[
|
|
7
|
-
/* @__PURE__ */b("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
|
-
/* @__PURE__ */b(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
package/dist/chunk-DOJSWVBX.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-72UHB4JU.js";import{IconButton_default as a}from"./chunk-MYH5H43C.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
-
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":R,windows:j,className:A="",layout:S="grid"}){const q=s().textToolbar,B=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!B.words&&!B.paragraph)return null;const H=m(n,k,x,B.cells.paragraph),I=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,U=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:I(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:I(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,$=l(q),L=e.map(e=>[e,$[e],r(e)]),T=C?e.filter(e=>C.allow.includes(e)):[],J=C&&T.includes(C.value)?C.value:T[0],K=[["none",q.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",q.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",q.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],O=x&&H?g(q.clear,/* @__PURE__ */i(a,{className:I(!1),"aria-label":q.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,P=/* @__PURE__ */t(d,{children:[U("bold",q.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),U("italic",q.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),U("underline",q.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),U("strike",q.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(q.color,/* @__PURE__ */i(a,{pressed:k.open,className:I(k.open,"rosh-tb-color"),"aria-label":q.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,U("link",q.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),U("sup",q.sup,/* @__PURE__ */i(o,{name:"superscript"})),U("sub",q.sub,/* @__PURE__ */i(o,{name:"subscript"})),U("code",q.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===H?O:null]}),Q=/* @__PURE__ */t(d,{children:[C&&T.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.alignment,onKeyDown:e=>p(e,T,e=>C.onChange(e)),children:L.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:I(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===J?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(q.bullet,/* @__PURE__ */i(a,{className:I("bullet"===D.pressed),"aria-label":q.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(q.number,/* @__PURE__ */i(a,{className:I("number"===D.pressed),"aria-label":q.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,U("quote",q.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.letterCase,onKeyDown:e=>p(e,K.map(([e])=>e),e=>M.onChange(e)),children:K.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:I(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===H?O:null]}),E="row"===S,G=E?" is-row":B.flow?" is-flow":B.oneRow?" is-one-row":B.words&&void 0===N&&"words"!==H?" is-eight":"",V=b(n,Boolean(k)),Y={"--rosh-tb-color-col":String(V.color),"--rosh-tb-link-col":String(V.link),...E?{"--rosh-tb-cells":String(B.cells.words+B.cells.paragraph),"--rosh-tb-groupgap":B.words&&B.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let z;return z=E?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[B.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:P}):null,B.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:Q}):null]}):B.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[P,
|
|
3
|
-
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),Q]}):B.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
-
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:P}),
|
|
5
|
-
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:Q})]}):/* @__PURE__ */t(d,{children:[B.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==H?" is-eight":""),children:P}):null,B.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:Q}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${G} ${A}`.trim(),style:Y,children:[
|
|
6
|
-
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":R??q.formatting,children:z}),j]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
package/dist/chunk-EBODRYXS.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-K5YT5PMJ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-ISVODSRP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as g}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-NRHG4R2Q.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as H,useCallback as j,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as I}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),H=f??D,j=w(),S=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,H?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:H,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
|
|
2
|
-
/* @__PURE__ */E(z,{items:r})]});return H?/* @__PURE__ */C(I,{children:[S,
|
|
3
|
-
/* @__PURE__ */E("span",{id:j,hidden:!0,children:$.settingView.auto})]}):S});function z({items:e}){const t=e=>/* @__PURE__ */E("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
-
return E(I,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=N(function({value:l,onChange:u,options:N,placeholder:R,invalid:A,className:P="",id:V,disabled:K,size:U,touchSize:G,title:M,multiple:Y,renderOption:B,renderValue:W,valueText:F,readOnly:L=!1,footer:J,changed:q=!1,auto:Q,"aria-describedby":X,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!J?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,He=d(),je=Q??He,Se=`${ke}-auto`,Te=[X,q?De:void 0,je?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=H(()=>n(N),[N]),Ee=Y?l:[],Ie=u,Oe=f(oe,re,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[Re]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,Re]);const ze=Y?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ae=Y?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ce[ze].label:void 0,Pe=!Y&&ze>=0?Ce[ze].lang:void 0,Ve=Y?Ce.filter(e=>Ee.includes(e.value)):ze>=0?[Ce[ze]]:[],Ke=W&&Ve.length?W(Ve):void 0,Ue=void 0!==Ke&&F?F(Ve):void 0,Ge=j((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Me=j(()=>{K||L||(ae(ze>=0?ze:e(Ce)),ie(!0))},[K,L,Ce,ze]),Ye=j(e=>{const t=Ce[e];if(t&&!t.disabled){if(Y){const r=l;return Ie(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ie(t.value),Ge()}},[Ce,Y,l,Ie,Ge]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Ge(),!0),ue)},[re,Ge]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ge(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ge(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ge]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Be=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:ze,n=t(Ce,r.buffer,i);n<0||(re?ae(n):Y?(ae(n),ie(!0)):Ye(n))},[re,ne,ze,Ce,Ye,Y]),We=re?a(N,(e,t)=>{const r=(i=e.value,Y?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
-
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||B?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Ye(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${Y?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[Y&&/* @__PURE__ */E(o,{selected:r}),B?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:B(e,{selected:r,active:n})}):Y?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
-
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
|
-
/* @__PURE__ */C(I,{children:[
|
|
8
|
-
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Fe=void 0!==Ke?
|
|
9
|
-
/* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
-
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ke}),
|
|
11
|
-
/* @__PURE__ */E("span",{lang:void 0===Ue?Pe:void 0,className:"sr-only",children:Ue??Ae})]}):/* @__PURE__ */E("span",{lang:Pe,className:`block truncate ${void 0===Ae?c:""}`,children:Ae??R??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Je=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":Y||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Le,maxHeight:fe}:Le,children:We}),qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Je,
|
|
12
|
-
/* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ge(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(J?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Ge());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ge()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */E(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
-
/* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
|
|
14
|
-
return C("div",{ref:le,className:"relative",children:[
|
|
15
|
-
/* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:M,disabled:K,"aria-readonly":L||void 0,onClick:()=>re?Ge():Me(),onKeyDown:t=>{if(!K&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Me());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Me());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),Ye(ne)));case" ":return t.preventDefault(),void(re?Ye(ne):Me());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Ge()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Ge(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Be(t.key))}},className:s({invalid:A,size:U,readOnly:L,auto:je,className:`${L?"":"pr-8 "}text-left ${P}`.trim()}),children:q?
|
|
16
|
-
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Fe,
|
|
17
|
-
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Fe}),q&&/* @__PURE__ */E("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */E("span",{id:Se,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */E(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
-
/* @__PURE__ */C("select",{ref:te,value:l,multiple:Y||void 0,onChange:e=>Ie(Y?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:K,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!Y&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:R}),
|
|
19
|
-
/* @__PURE__ */E(z,{items:N})]}),re&&T(qe,document.body)]})}),P=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */E(R,{ref:r,...t,size:n}):/* @__PURE__ */E(A,{ref:r,...t}):/* @__PURE__ */E(A,{ref:r,...t,size:n})});export{R as NativeSelect,P as Select_default};
|
package/dist/chunk-FFPIT2LB.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-M5IZ7QLQ.js";import{Button_default as i}from"./chunk-MEP6CZJ3.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as r}from"./chunk-AJPQJ7TC.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:z,align:I="end",side:L="bottom",menuMinWidth:M,linkAs:P,block:Q=!1,className:R=""},W){const A=g&&(null!=N&&""!==N&&!1!==N)&&!v,D=x&&null!=j&&""!==j&&!1!==j,F=o(),J=/* @__PURE__ */t(i,{ref:W,type:b,variant:f,size:p,loading:v,leftIcon:k,block:Q,disabled:g&&!A,"aria-disabled":!!A||void 0,disabledReason:A?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),O=Q?"relative flex min-w-0 flex-1":"relative inline-flex",$=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
-
return s("div",{className:[Q?"flex w-full":"inline-flex","items-stretch",R].filter(Boolean).join(" "),children:[null==w||""===w||A?J:/* @__PURE__ */t(r,{content:w,className:O,children:J}),
|
|
3
|
-
/* @__PURE__ */t(r,{content:D?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":D?F:void 0,items:h,align:I,side:L,minWidth:M,linkAs:P,disabled:x&&!D,"aria-disabled":D,onOpenChange:y,footer:C,footerLabel:z,triggerClassName:a({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(n,{name:"chevron-down",className:$,strokeWidth:2,"aria-hidden":"true"})})}),D&&/* @__PURE__ */t("span",{id:F,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
package/dist/chunk-HX5QSQ2C.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-TAHHZGRH.js";import{useHydrated as o}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as i}from"./chunk-PU2GJVMG.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as f}from"react/jsx-runtime";var l=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const j=o(),v=c(null),H=c(p);H.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=v.current,n=H.current();if(!t||!n)return;const o=(k.current??l)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{j&&y()}),u(()=>{if(!j)return;const t=n(()=>H.current(),y),e=v.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[j,y]);return j&&p()?d(
|
|
2
|
-
/* @__PURE__ */f("div",{ref:v,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
|
package/dist/chunk-KETNB4NQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";function e({children:e,className:i=""}){/* @__PURE__ */
|
|
2
|
-
return r("div",{"data-list-toolbar":"",className:`flex min-h-(--row-height-window-bar) shrink-0 flex-wrap items-center gap-2 border-b border-line px-3 py-2 ${i}`.trim(),children:e})}export{e as ListToolbar};
|
package/dist/chunk-M5IZ7QLQ.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-XNKNX5L3.js";import{useTabLayer as n,focusableIn as o}from"./chunk-DWGYC7OD.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-RTK77DMP.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as p}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k="inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",w=/(^|[\s:])!?z-/,D={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function j({trigger:j,items:K,align:W="end",side:$="bottom","aria-label":A,className:C="",triggerClassName:E,menuClassName:H="",minWidth:L=180,linkAs:N,disabled:S,id:T,"aria-describedby":U,"aria-disabled":G=!1,onOpenChange:I,footer:M,footerLabel:P}){const[R,q]=m(!1),[B,z]=m(-1),J=h(null),O=h(null),V=h(null),X=h(null),Y=h(null),Q=null!=M&&!1!==M,Z=h({text:"",at:0}),F=g(),_=g(),ee=T??_,te=h(I);te.current=I;const re=h(R);re.current=R;const ne=v(e=>{q(!1),re.current&&(re.current=!1,te.current?.(!1)),e&&O.current?.focus()},[]),oe=(t,r)=>{const n=K.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(K[i]))return i}return-1},ie=()=>V.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!R)return;const e=e=>{const t=e.target;if(J.current?.contains(t)||ie()?.contains(t))return;const r=ie()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||ne(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ne(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[R,ne]);const ae=v(()=>{const e=ie(),t=O.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:W,side:$});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=W},[W,$]);p(()=>{R&&ae()}),b(()=>{if(R)return u(()=>O.current,ae)},[R,ae]),b(()=>{if(!R)return;const t=V.current,r=e(K[B])?t?.querySelector(`[data-dropdown-index="${B}"]`):null;(r??t)?.focus({preventScroll:!0})},[R,B]),b(()=>{if(R)return f(e=>"Escape"===e.key&&(ne(!0),!0),()=>X.current)},[R,ne]),n(X,R&&Q);const le=h(null),se=t=>{const r=K.findIndex(t=>"radio"===t.type&&"colour"===t.mark&&t.checked&&e(t));return r>=0?r:"first"===t?oe(0,1):oe(K.length-1,-1)},de=e=>{z(se(e)),q(!0),re.current||(re.current=!0,le.current=e,I?.(!0))};p(()=>{const e=le.current;if(!R||!e)return;le.current=null;const t=se(e);t!==B&&z(t)});const ce=t(K,F),ue="function"==typeof M?M({close:()=>ne(!0)}):M,pe={...w.test(H)?{}:{zIndex:s.popup},minWidth:L};/* @__PURE__ */
|
|
2
|
-
return y("div",{ref:J,className:`relative inline-flex ${C}`.trim(),children:[
|
|
3
|
-
/* @__PURE__ */x("button",{ref:O,id:ee,type:"button","aria-haspopup":"menu","aria-expanded":R,"aria-controls":R?F:void 0,"aria-label":A,"aria-describedby":U,"aria-disabled":G||void 0,disabled:S,onClick:()=>{G||(R?ne(!1):de("first"))},onKeyDown:e=>{G||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),de("first")):"ArrowUp"===e.key&&(e.preventDefault(),de("last")))},className:E??`${k} ${A?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"}`,children:j}),R&&
|
|
4
|
-
/* @__PURE__ */x(i,{portal:!0,className:H,style:pe,children:/* @__PURE__ */y("div",{ref:X,children:[
|
|
5
|
-
/* @__PURE__ */x("div",{ref:V,id:F,role:"menu","aria-orientation":"vertical","aria-label":A,"aria-labelledby":A?void 0:ee,"aria-describedby":ce,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),z(oe(B+1,1));else if("ArrowUp"===t.key)t.preventDefault(),z(oe(B-1,-1));else if("Home"===t.key)t.preventDefault(),z(oe(0,1));else if("End"===t.key)t.preventDefault(),z(oe(K.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Y.current?o(Y.current)[0]:void 0;e?e.focus({preventScroll:!0}):ne(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-Z.current.at<500?Z.current.text+n:n;Z.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?B+1:Math.max(B,0),s=V.current,d=K.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(K[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void z(n)}})(t)},children:r(K,{menuId:F,choose:e=>{e.disabled||(ne(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>ne(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===B?0:-1,onMouseEnter:()=>{t.disabled||Y.current?.contains(document.activeElement)||z(e)}}),linkAs:N})}),Q&&/* @__PURE__ */y("div",{ref:Y,role:"group","aria-label":P,"data-dropdown-footer":"",onKeyDown:e=>{const t=Y.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=V.current?.querySelector(`[data-dropdown-index="${B}"]`);return void(t??V.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),ne(!0))},children:[
|
|
6
|
-
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
|
-
/* @__PURE__ */x("div",{style:D,children:ue})]})]})})]})}export{j as DropdownMenu,k as TRIGGER_CLASS};
|
package/dist/chunk-MEP6CZJ3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{isAriaDisabled as e,swallowPress as a,describedByWith as r,OffWithReason as i}from"./chunk-IVEM2BPC.js";import{SpinnerRing as s}from"./chunk-R2VKEMZH.js";import{buttonClasses as l}from"./chunk-UQYNPYF4.js";import{forwardRef as d,useId as n}from"react";import{jsxs as t,jsx as c}from"react/jsx-runtime";var o=d(function({variant:d="primary",size:o="md",loading:m=!1,leftIcon:p,rightIcon:b,block:f=!1,disabled:u,type:h="button",children:k,className:x="",disabledReason:N,onClick:y,pressed:v,"aria-disabled":g,"aria-describedby":j,...C},I){const w=n(),z=u||m,E=null!=N&&""!==N,M=z&&E,P=!z&&e(g),R=P&&E,V=M||R?w:void 0,Y=/* @__PURE__ */t("button",{ref:I,type:h,disabled:z,"aria-busy":m||void 0,"aria-disabled":!!P||g,"aria-describedby":r(j,V),onClick:P?a:y,className:l({variant:d,size:o,block:f,pressed:v??(!0===C["aria-pressed"]||"true"===C["aria-pressed"]),className:x}),...C,children:[m?/* @__PURE__ */c(s,{className:"h-3.5 w-3.5",ink:""}):p,k,!m&&b]});return R?/* @__PURE__ */c(i,{reason:N,id:w,block:f,children:Y}):M?/* @__PURE__ */t("span",{className:f?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[Y,
|
|
2
|
-
/* @__PURE__ */c("span",{id:V,className:"text-xs text-red-600",children:N})]}):Y});export{o as Button_default};
|
package/dist/chunk-MNZAAQLH.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-24BF22NF.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:N=4,formatValue:M,animate:j=!0,className:F,emptyLabel:$}){const W=m().charts,C=c(),R=M??(e=>h(e,C)),w=$??W.nothingToCompare,A=p(),[L,Q]=u(null),{highlighted:z}=a(),B=x;if(k.length<3||0===B.length)/* @__PURE__ */
|
|
2
|
-
return d("p",{className:`text-sm text-gray-500 ${F??""}`,children:w});const E=y/2,H=y/2,T=y/2-46,U=o(k.length),V=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...B.map(e=>e.values[t]??0).filter(Number.isFinite))),Y=(e,t)=>{const r=Math.max(0,Math.min(1,t/V[e])),l=U.center(e)-U.step/2;return[E+T*r*Math.cos(l),H+T*r*Math.sin(l)]},O=(e,t)=>null!==L?L!==e:null!==z&&z!==t,S=null!==L?B[L]:void 0;/* @__PURE__ */
|
|
3
|
-
return f("div",{className:`relative ${F??""}`,children:[
|
|
4
|
-
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":A,onMouseLeave:()=>Q(null),children:[
|
|
5
|
-
/* @__PURE__ */d("title",{id:A,children:W.acrossMeasures(B.map(e=>e.label),k.length)}),Array.from({length:N},(e,r)=>{const l=T*(r+1)/N;return"circle"===v?/* @__PURE__ */d("circle",{cx:E,cy:H,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(E,H,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=Y(t,V[t]);/* @__PURE__ */
|
|
6
|
-
return f("g",{children:[
|
|
7
|
-
/* @__PURE__ */d("line",{x1:E,y1:H,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
-
/* @__PURE__ */d("text",{x:E+(T+18)*Math.cos(U.center(t)-U.step/2),y:H+(T+18)*Math.sin(U.center(t)-U.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
-
/* @__PURE__ */d(r,{id:A,reveal:!!j&&"center-out"}),B.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>Y(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
-
return f("g",{opacity:O(t,e.key)?.3:1,onMouseEnter:()=>Q(t),mask:j?`url(#${l(A)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
-
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:S.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(L,3,S.color,S.tone),value:R(S.values[t]??0)}))})}),
|
|
12
|
-
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:B.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
|
-
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
-
/* @__PURE__ */d(e,{caption:W.acrossMeasures(B.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:B.map(e=>[e.label,...k.map((t,r)=>R(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|
package/dist/chunk-MYH5H43C.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isAriaDisabled as e,swallowPress as r,describedByWith as a,OffWithReason as i}from"./chunk-IVEM2BPC.js";import{iconButtonClasses as s}from"./chunk-UQYNPYF4.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},N){const j=n(),C=(Boolean(f)||e(k))&&null!=p&&""!==p,x=C||e(k),z=/* @__PURE__ */o("button",{ref:N,type:l,className:s({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:C?void 0:f,"aria-disabled":!!x||k,"aria-describedby":a(v,C?j:void 0),onClick:x?r:h,children:d});return C?/* @__PURE__ */o(i,{reason:p,id:j,children:z}):z});export{t as IconButton_default};
|