efficient-shell 13.24.1 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -7
- package/dist/{Browser-P6CXFZWM.js → Browser-FYVRNXOL.js} +14 -14
- package/dist/Calculator-7CY2CRGB.js +29 -0
- package/dist/{CurrencyConverter-VH4UVYLO.js → CurrencyConverter-FXWM3DBQ.js} +9 -9
- package/dist/{Files-NTJ4WI6F.js → Files-VDQYQSDZ.js} +79 -79
- package/dist/{Notepad-GIRH6KIR.js → Notepad-J3Z3CYEC.js} +8 -8
- package/dist/PomodoroTimer-RPGWT26T.js +91 -0
- package/dist/{Preview-A4NPS775.js → Preview-ISEPDV3A.js} +22 -22
- package/dist/Sidebar-2TYZENQL.js +44 -0
- package/dist/{Stock-YL732PKW.js → Stock-TUPZORQN.js} +4 -4
- package/dist/{Weather-3CBRXNNM.js → Weather-URCO6JML.js} +23 -23
- package/dist/{WorldClock-LONNWCRG.js → WorldClock-EBBUWG5L.js} +6 -6
- package/dist/ai/index.js +92 -92
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-XVMCSUAV.js → chunk-22SVN2ZM.js} +1 -1
- package/dist/{chunk-ZDFMYAQB.js → chunk-24BF22NF.js} +1 -1
- package/dist/{chunk-JIJZBM25.js → chunk-2RLWGWOU.js} +13 -13
- package/dist/{chunk-VP2IQJUD.js → chunk-2SOGTOUQ.js} +4 -4
- package/dist/{chunk-4VFEPP2W.js → chunk-2XDO7FZC.js} +13 -13
- package/dist/{chunk-SLEA47VA.js → chunk-3L7BEEBW.js} +1 -1
- package/dist/{chunk-GZRNOIEE.js → chunk-3ZJAQSFS.js} +3 -3
- package/dist/{chunk-BQQEQCSK.js → chunk-47BGAQWD.js} +1 -1
- package/dist/{chunk-7AVPMO4F.js → chunk-4BRVZAIW.js} +1 -1
- package/dist/chunk-4DNPUG3T.js +7 -0
- package/dist/{chunk-VKZC3NPM.js → chunk-5O4HMXPQ.js} +2 -2
- package/dist/{chunk-JLSXDYS4.js → chunk-5SQHRDFC.js} +2 -2
- package/dist/{chunk-LQIHBIXG.js → chunk-6AYAB5FN.js} +5 -5
- package/dist/{chunk-VGUB7LPF.js → chunk-6IP4Q3AT.js} +52 -52
- package/dist/{chunk-527WMFTR.js → chunk-6RU2PGQK.js} +1 -1
- package/dist/{chunk-UVPDEGIA.js → chunk-6X32SWQI.js} +1 -1
- package/dist/{chunk-A5FC4LR7.js → chunk-7D2QZ6JA.js} +1 -1
- package/dist/{chunk-3OPPTU4V.js → chunk-7KNVO46D.js} +2 -2
- package/dist/{chunk-2YHS5E27.js → chunk-7OVMWXFM.js} +1 -1
- package/dist/{chunk-LC2UF3AA.js → chunk-7WF6LFOJ.js} +1 -1
- package/dist/{chunk-IJG4UEKF.js → chunk-A3VLZZHJ.js} +8 -8
- package/dist/{chunk-LG6NDTHZ.js → chunk-AH5MLH54.js} +1 -1
- package/dist/chunk-AJPQJ7TC.js +6 -0
- package/dist/{chunk-TNALBYLY.js → chunk-ALZHFQRX.js} +1 -1
- package/dist/{chunk-S5MTTJ3F.js → chunk-AZZ4NO2D.js} +12 -12
- package/dist/{chunk-P4VOUPRF.js → chunk-CHDGSJLV.js} +6 -6
- package/dist/{chunk-VY6OQRZA.js → chunk-CJ4OEY3T.js} +1 -1
- package/dist/{chunk-Q36KB5RQ.js → chunk-CXEELIRW.js} +11 -11
- package/dist/{chunk-MZ3JADHG.js → chunk-DBBOD5QW.js} +1 -1
- package/dist/chunk-DBQNYJZ6.js +1 -0
- package/dist/{chunk-65BW43PF.js → chunk-DNPAYNNU.js} +1 -1
- package/dist/{chunk-TTRLYWP4.js → chunk-DO6P6LYU.js} +1 -1
- package/dist/chunk-DOJSWVBX.js +6 -0
- package/dist/chunk-DTFX624I.js +8 -0
- package/dist/chunk-E57C7NBA.js +2 -0
- package/dist/{chunk-D5PXRJHA.js → chunk-EBODRYXS.js} +14 -14
- package/dist/{chunk-YDJ5IZOU.js → chunk-EDRELF6L.js} +1 -1
- package/dist/{chunk-M3HTP2N6.js → chunk-EHNW3UNC.js} +6 -6
- package/dist/{chunk-AH2NEKEN.js → chunk-EHSK43WG.js} +8 -8
- package/dist/{chunk-VMAIZU5S.js → chunk-EN3GYSCE.js} +1 -1
- package/dist/{chunk-TTYTOLVV.js → chunk-EOYKUV2U.js} +1 -1
- package/dist/chunk-FFPIT2LB.js +3 -0
- package/dist/{chunk-TD3ZQD5R.js → chunk-G3TC2GIA.js} +1 -1
- package/dist/{chunk-UQV4TSWB.js → chunk-GTZML3V3.js} +1 -1
- package/dist/{chunk-JYR4V4AG.js → chunk-GUUBFQ6L.js} +2 -2
- package/dist/{chunk-K42FXX7J.js → chunk-GVAVIYE6.js} +1 -1
- package/dist/{chunk-2Y4AH7NC.js → chunk-GY7MJTIZ.js} +1 -1
- package/dist/{chunk-XYXCZIJY.js → chunk-HAEZUUDT.js} +3 -3
- package/dist/{chunk-J5W63XNR.js → chunk-HTBACICQ.js} +6 -6
- package/dist/{chunk-5URXJCNC.js → chunk-HX5QSQ2C.js} +1 -1
- package/dist/{chunk-VLBLDSA6.js → chunk-I7WAOKU2.js} +2 -2
- package/dist/{chunk-LLDGRPLF.js → chunk-ION3XGLN.js} +1 -1
- package/dist/{chunk-EXDSYFHB.js → chunk-ISWTJBOA.js} +1 -1
- package/dist/{chunk-BUFAJJDZ.js → chunk-IVEM2BPC.js} +1 -1
- package/dist/{chunk-D4432YRW.js → chunk-IZ6D4KGR.js} +1 -1
- package/dist/{chunk-KC2EQCBE.js → chunk-JPVD3VS7.js} +6 -6
- package/dist/{chunk-C7Z3ZMJH.js → chunk-KE7P74XM.js} +13 -13
- package/dist/chunk-KEFNQEXZ.js +1 -0
- package/dist/{chunk-DUEEAP4Y.js → chunk-LPL7BWGG.js} +1 -1
- package/dist/chunk-M5IZ7QLQ.js +7 -0
- package/dist/{chunk-MCLVTQSF.js → chunk-MEDOESQD.js} +8 -8
- package/dist/chunk-MEP6CZJ3.js +2 -0
- package/dist/{chunk-ZYKY4Z7R.js → chunk-MKHOXO5O.js} +1 -1
- package/dist/chunk-MNZAAQLH.js +15 -0
- package/dist/{chunk-DTRJLQWO.js → chunk-MPC3CHAO.js} +1 -1
- package/dist/{chunk-7PAZO65L.js → chunk-MXRF5YVN.js} +5 -5
- package/dist/{chunk-NWS5G7FE.js → chunk-MYH5H43C.js} +1 -1
- package/dist/{chunk-5OHFBS2B.js → chunk-NC5FIFAY.js} +1 -1
- package/dist/chunk-NDCS4COQ.js +11 -0
- package/dist/{chunk-IJ4JX6WP.js → chunk-NHALP3MW.js} +4 -4
- package/dist/{chunk-R5WBDXI2.js → chunk-OYQWBJ37.js} +1 -1
- package/dist/{chunk-UU42O5ON.js → chunk-P3XXFQG5.js} +1 -1
- package/dist/{chunk-YBE66FBR.js → chunk-P5J7G7OV.js} +1 -1
- package/dist/{chunk-4L5YRMJ4.js → chunk-PEA5Y6DD.js} +9 -9
- package/dist/{chunk-DPFEQQQU.js → chunk-POBVGDZP.js} +1 -1
- package/dist/{chunk-RFWBNKKB.js → chunk-PPHGBEJA.js} +10 -10
- package/dist/{chunk-IMH5H47S.js → chunk-PTLVNC3V.js} +6 -6
- package/dist/chunk-PU2GJVMG.js +1 -0
- package/dist/{chunk-LUARJHUK.js → chunk-PWERFHOU.js} +9 -9
- package/dist/{chunk-ZFWCTHR4.js → chunk-PWON7O3N.js} +6 -6
- package/dist/{chunk-6MFKKTCE.js → chunk-Q7FPGOUY.js} +24 -24
- package/dist/{chunk-M4REKOGO.js → chunk-QCLKRFL4.js} +5 -5
- package/dist/{chunk-N4LMFGRI.js → chunk-R36VZ35L.js} +6 -6
- package/dist/{chunk-CCZHSISF.js → chunk-REFPTKRD.js} +2 -2
- package/dist/{chunk-THAPVKEJ.js → chunk-RTK77DMP.js} +11 -11
- package/dist/{chunk-PWOVSR7N.js → chunk-RXCBSQA2.js} +2 -2
- package/dist/{chunk-JDLJ7DHV.js → chunk-S4RFJTGR.js} +1 -1
- package/dist/{chunk-D5HFWOW7.js → chunk-SP4S4HUJ.js} +16 -16
- package/dist/{chunk-P73ZJ6QR.js → chunk-T46I4YOI.js} +1 -1
- package/dist/{chunk-VY3UA6AR.js → chunk-TAHHZGRH.js} +1 -1
- package/dist/{chunk-FBZUEZK7.js → chunk-TTD2M6RF.js} +1 -1
- package/dist/{chunk-OE7BXD3M.js → chunk-U6W3OU2X.js} +1 -1
- package/dist/{chunk-RB3BMRNA.js → chunk-U75MSD4F.js} +1 -1
- package/dist/{chunk-XC2GUCTG.js → chunk-UGA5NGW4.js} +1 -1
- package/dist/chunk-UZESZ3EB.js +1 -0
- package/dist/chunk-VUBDHFG5.js +4 -0
- package/dist/{chunk-K4KUGKWP.js → chunk-W4IH3BE3.js} +21 -21
- package/dist/{chunk-B5KX7PDG.js → chunk-W6REY3SV.js} +3 -3
- package/dist/{chunk-WZWSFYXJ.js → chunk-WBUAO7T7.js} +1 -1
- package/dist/{chunk-7N6CVTWO.js → chunk-WNFZYTWW.js} +9 -9
- package/dist/{chunk-HPKQYUQT.js → chunk-WYAKASF3.js} +1 -1
- package/dist/{chunk-C5OPAULN.js → chunk-XGEN76DG.js} +1 -1
- package/dist/{chunk-ZKILZFUI.js → chunk-XIX72C7K.js} +1 -1
- package/dist/{chunk-3AUN7JSM.js → chunk-XJK6VNXV.js} +1 -1
- package/dist/{chunk-26KHYLJN.js → chunk-XLPUIGMO.js} +1 -1
- package/dist/{chunk-VQBKRBBR.js → chunk-XNKNX5L3.js} +1 -1
- package/dist/chunk-Y2M5PP2C.js +28 -0
- package/dist/{chunk-66NJCU4W.js → chunk-Y5RTVKMB.js} +8 -8
- package/dist/{chunk-JXJNQHPY.js → chunk-Y5YVKUM4.js} +19 -19
- package/dist/{chunk-5CHJA4RL.js → chunk-Y6FULJWJ.js} +7 -7
- package/dist/chunk-Y7D2CZ4H.js +13 -0
- package/dist/chunk-YTLUSBDY.js +14 -0
- package/dist/{chunk-2YUAR2EH.js → chunk-YX3JD6PA.js} +5 -5
- package/dist/{chunk-3WUVYXCF.js → chunk-ZA6ANC2D.js} +5 -5
- package/dist/{chunk-5ZOYYL46.js → chunk-ZEGCKIAL.js} +3 -3
- package/dist/chunk-ZSVU44OB.js +6 -0
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/data/useColumnConfig.js +1 -1
- package/dist/data/useSort.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/dropdownPosition.js +1 -1
- package/dist/hooks/index.d.ts +15 -14
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/index.d.ts +43 -2
- package/dist/index.js +86 -86
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/Kbd.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/ShellPrefs.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-PKAM5ERT.js +0 -29
- package/dist/PomodoroTimer-PBSAKRX5.js +0 -91
- package/dist/Sidebar-HAIHWIJD.js +0 -44
- package/dist/chunk-2AEYVQ2R.js +0 -2
- package/dist/chunk-3GJVTK4H.js +0 -11
- package/dist/chunk-3TD3GH53.js +0 -7
- package/dist/chunk-44ERJYNW.js +0 -6
- package/dist/chunk-AAFPAQXH.js +0 -13
- package/dist/chunk-EX3DARI3.js +0 -7
- package/dist/chunk-F2RAIGCG.js +0 -6
- package/dist/chunk-FLQXMCB3.js +0 -8
- package/dist/chunk-I52YJ3QD.js +0 -1
- package/dist/chunk-N6PMH6DU.js +0 -6
- package/dist/chunk-PP3WUT2G.js +0 -15
- package/dist/chunk-RJVIKGHJ.js +0 -4
- package/dist/chunk-SRI2D23Y.js +0 -14
- package/dist/chunk-UTISUEO4.js +0 -2
- package/dist/chunk-UVHXVSB2.js +0 -1
- package/dist/chunk-WCCS4VFE.js +0 -1
- package/dist/chunk-ZDXRSY2Y.js +0 -1
- package/dist/chunk-ZISKHQZY.js +0 -3
- package/dist/chunk-ZVNU3WJ3.js +0 -28
- /package/dist/{chunk-4BYJABCX.js → chunk-5YTZBYG4.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-EBODRYXS.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-W6REY3SV.js";import{Button_default as o}from"./chunk-MEP6CZJ3.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-EDRELF6L.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{OneLineLabel as r}from"./chunk-G3TC2GIA.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tabs as e}from"./chunk-
|
|
1
|
+
import{Tabs as e}from"./chunk-NHALP3MW.js";import{Card as a}from"./chunk-RKSCB5BJ.js";import{StatusBadgeProvider as r,StatusBadge as t}from"./chunk-EDRELF6L.js";import{Button_default as l}from"./chunk-MEP6CZJ3.js";import{useState as i}from"react";import{jsx as d,jsxs as s}from"react/jsx-runtime";var n={featured:"success",new:"active",draft:"draft"},c=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,a)=>({id:a,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][a],tag:["featured","new","draft"][a%3],bg:e}));function m(){const[m,g]=i("all"),f="all"===m?c:c.filter(e=>e.tag===m);/* @__PURE__ */
|
|
2
2
|
return d(r,{groups:n,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */s("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
3
3
|
/* @__PURE__ */s("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-6IP4Q3AT.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-UZESZ3EB.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-NRHG4R2Q.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.5.1",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.1",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,S]=a(b.partOf);/* @__PURE__ */
|
|
2
2
|
return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
|
|
4
4
|
/* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
|
|
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
|
|
7
7
|
/* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
|
|
9
|
-
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),S]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Button_default as e}from"./chunk-
|
|
1
|
+
import{Button_default as e}from"./chunk-MEP6CZJ3.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
3
3
|
/* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
4
4
|
/* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as n}from"./chunk-
|
|
1
|
+
import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-NRHG4R2Q.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
|
|
2
2
|
return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
|
|
3
3
|
/* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
|
|
4
4
|
/* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-
|
|
2
|
-
return N("input",{ref:
|
|
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
3
|
return k("div",{ref:le,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */N("input",{ref:
|
|
5
|
-
/* @__PURE__ */k("button",{ref:se,type:"button",...ve,id:
|
|
6
|
-
/* @__PURE__ */N("span",{className:`min-w-0 truncate whitespace-nowrap ${_?"text-ink-strongest":t}`,children:_?
|
|
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:_?
|
|
8
|
-
/* @__PURE__ */k("div",{ref:de,id:ue,role:"dialog","aria-label":
|
|
9
|
-
/* @__PURE__ */N(e,{value:_||null,min:ee||null,max:re||null,weekStartsOn:
|
|
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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{IconButton_default as o}from"./chunk-
|
|
1
|
+
import{IconButton_default as o}from"./chunk-MYH5H43C.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as e}from"./chunk-NRHG4R2Q.js";import{jsx as a}from"react/jsx-runtime";function s({onClose:s,className:i,label:t}){const n=e().dialog;/* @__PURE__ */
|
|
2
2
|
return a(o,{variant:"ghost",onClick:s,"aria-label":t??n.close,className:i,children:/* @__PURE__ */a(r,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})})}export{s as CloseButton};
|
|
@@ -0,0 +1,6 @@
|
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-EFKJLUYP.js";import{Tooltip as r}from"./chunk-
|
|
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
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
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
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};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var
|
|
3
|
-
return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${
|
|
4
|
-
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
1
|
+
import{Popover as e}from"./chunk-VUBDHFG5.js";import{InputNumber_default as r}from"./chunk-I7WAOKU2.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-AJPQJ7TC.js";import{useShellStrings as h}from"./chunk-NRHG4R2Q.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var P={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:K,id:S,className:T=""}){const U=h().color,O=k(z),H=e=>{const r=k(e);N||r===O||j?.(r)},L=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:O},E=a(f??""),[W,Y]=p(()=>n(e||E||"")),q=b(e);m(()=>{e!==q.current&&(q.current=e,e?Y(n(e)):E&&Y(n(E)))},[e]);const J=a=>{N||a===e||(q.current=a,r(a))},X=e=>{const r=a(e);r&&(Y(n(r)),J(r))},F=e=>{Y(e),J(o(e))},[G,Q]=p(!1),V=b(W);V.current=W;const Z=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,V.current);"end"===x?(Q(!0),Y(a)):F(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,V.current);"end"===x?Y(a):F(a)},onPointerUp:r=>{"end"===x&&G&&(Q(!1),F(e(r,V.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=G?o(W):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||E||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${T}`.trim(),onKeyDown:e=>{"Escape"===e.key&&K&&(e.preventDefault(),e.stopPropagation(),K())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":U.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:U.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":U.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(q.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
|
|
4
|
+
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>X(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*W.v),"aria-valuetext":U.squareValue(Math.round(100*W.s),Math.round(100*W.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=A(W,e.key,e.shiftKey);r&&(e.preventDefault(),F(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:W.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(W.s),top:ae(1-W.v),...P}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(W.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=I(W.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),F({...W,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:W.h/360*100+"%",background:o({h:W.h,s:1,v:1}),...P}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":O,"aria-valuetext":`${O}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=M(O,e.key,e.shiftKey);null!==r&&(e.preventDefault(),H(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),H(L(e)))},onPointerMove:e=>{!N&&1&e.buttons&&H(L(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${O}%`,...C(te||"black",O),...P}})}),
|
|
7
7
|
/* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
|
|
8
|
-
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?
|
|
9
|
-
/* @__PURE__ */v(B,{value:re,placeholder:!e&&E?t(E):void 0,onChange:
|
|
10
|
-
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function
|
|
11
|
-
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function
|
|
8
|
+
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?O:null)}),
|
|
9
|
+
/* @__PURE__ */v(B,{value:re,placeholder:!e&&E?t(E):void 0,onChange:X,label:U.hex(i),disabled:N}),j&&/* @__PURE__ */v(R,{value:O,onChange:H,label:U.opacity(i),disabled:N})]})]})}var K={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},S={sm:"h-6",md:"h-8",lg:"h-10"},T=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function B({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${T} ${S[c]} ${h}`.trim():u({size:c,className:`${K[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
10
|
+
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function R({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
11
|
+
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function U({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,A=k(p),I=f(),P=a(s??""),M=r||P||"",K=r?t(r):P?t(P):D.none;
|
|
12
12
|
/* @__PURE__ */
|
|
13
13
|
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
14
|
-
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(
|
|
15
|
-
/* @__PURE__ */v(B,{value:r,placeholder:!r&&
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(M,b?A:null)}),triggerLabel:D.swatch(o,K),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:I,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
|
|
15
|
+
/* @__PURE__ */v(B,{value:r,placeholder:!r&&P?t(P):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(R,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{U as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,B as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,I as stepHue,M as stepOpacity,A as stepSquare};
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
2
|
-
return v("div",{ref:
|
|
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":""} ${
|
|
4
|
-
/* @__PURE__ */b("span",{className:"truncate",children:B(e)}),!C&&/* @__PURE__ */b("button",{type:"button","aria-label":
|
|
5
|
-
/* @__PURE__ */b("input",{id:
|
|
6
|
-
/* @__PURE__ */b("div",{ref:
|
|
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
7
|
/* @__PURE__ */b("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */b(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getActiveModalId as t}from"./chunk-F3ZOO23R.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{useBrowserLayoutEffect as n}from"./chunk-
|
|
1
|
+
import{getActiveModalId as t}from"./chunk-F3ZOO23R.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{useBrowserLayoutEffect as n}from"./chunk-PU2GJVMG.js";import{createContext as i,useContext as o,useRef as r,useState as u}from"react";var l=i(void 0),d=l.Provider;function s(t){const e=o(l);return t?void 0===e?document.body:e:null}function h(t,e){if("undefined"==typeof Element||!(t instanceof Element))return!1;const n=t.closest("[data-overlay-layer]");return null!==n&&!e?.contains(n)}var c="[data-modal-panel], [data-popup-panel]",f=16;function a(t,e){const n=Math.max(0,t.left),i=Math.max(0,t.top),o=Math.min(e.width,t.left+t.width),r=Math.min(e.height,t.top+t.height);return o-n<1||r-i<1?null:{left:n,top:i,width:o-n,height:r-i}}function w(t,e,n){return n<e?e:Math.min(Math.max(t,e),n)}function v(){return{width:window.innerWidth,height:window.innerHeight}}function p(t,e){const i=r(null),o=r(!1);t&&!o.current&&(i.current="undefined"==typeof document?null:document.activeElement),o.current=t;const[l,d]=u(null);return n(()=>{if(!t)return void d(null);const n=(o=e.current,r=i.current,o?.parentElement?.closest(c)??r?.closest(c)??null);var o,r;if(!n)return void d(null);const u=()=>{const t=n.getBoundingClientRect(),e=v(),i=a({left:t.left,top:t.top,width:t.width,height:t.height},e),o=null!==i&&i.width>=e.width-1&&i.height>=e.height-1;d(t=>{const e=o?null:i;return t===e||t&&e&&t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height?t:e})};u(),window.addEventListener("resize",u);const l="undefined"==typeof ResizeObserver?null:new ResizeObserver(u);return l?.observe(n),()=>{window.removeEventListener("resize",u),l?.disconnect()}},[t,e]),l}function b(t,e){const[i,o]=u(null);return n(()=>{const n=e.current;if(!t||!n)return void o(null);const i=()=>{const e=function(t,e,n,i=16){return{left:w(t.left+t.width/2-e.width/2,i,n.width-i-e.width),top:w(t.top+t.height/2-e.height/2,i,n.height-i-e.height)}}(t,{width:n.offsetWidth,height:n.offsetHeight},v());o(t=>t&&t.left===e.left&&t.top===e.top?t:e)};i(),window.addEventListener("resize",i);const r="undefined"==typeof ResizeObserver?null:new ResizeObserver(i);return r?.observe(n),()=>{window.removeEventListener("resize",i),r?.disconnect()}},[t,e]),i}var m=/* @__PURE__ */new WeakMap;function g(t){if(!t)return null;const e=t.closest("[data-overlay-layer]");return e?m.get(e)??null:t.closest("[data-modal-panel]")}var x={host:null,box:null,z:0,hidden:!1};function z(t,e){const i=r(null),o=r(!1);t&&!o.current&&(i.current="undefined"==typeof document?null:document.activeElement),o.current=t;const[l,d]=u(x);return n(()=>{if(!t)return void d(x);const n=(o=e.current,r=i.current,g(o?.parentElement)??g(r));var o,r;if(!n)return void d(x);const u=()=>{const t=n.getBoundingClientRect(),e=getComputedStyle(n),i=a({left:t.left,top:t.top,width:t.width,height:t.height},{width:window.innerWidth,height:window.innerHeight}),o=Number.parseInt(e.zIndex,10),r={host:n,box:i,z:Number.isFinite(o)?o:0,hidden:null===i||"none"===e.display||"hidden"===e.visibility};d(t=>{return n=r,(e=t).host===n.host&&e.z===n.z&&e.hidden===n.hidden&&(e.box===n.box||null!==e.box&&null!==n.box&&e.box.left===n.box.left&&e.box.top===n.box.top&&e.box.width===n.box.width&&e.box.height===n.box.height)?t:r;var e,n})};u(),window.addEventListener("resize",u);const l="undefined"==typeof ResizeObserver?null:new ResizeObserver(u);l?.observe(n);const s="undefined"==typeof MutationObserver?null:new MutationObserver(u);return s?.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{window.removeEventListener("resize",u),l?.disconnect(),s?.disconnect()}},[t,e]),l}function y(e,n){const i=r(null);return i.current=i=>function(t,e,n,i){const o=t.host;if(!o)return!1;if(n&&e?.contains(n))return!1;const r=o.getAttribute("data-modal-id");if(i&&r&&i!==r)return!0;const u=g(n);return null!==u&&u!==o&&!o.contains(u)}(e,n,i,t()),n&&function(t,e){m.set(t,e)}(n,e.host),i}function E(t){return t.host?{zIndex:t.z+1,...t.hidden?{visibility:"hidden"}:{}}:{zIndex:e.overlay}}function M(t){if(!t.host||!t.box)return null;const{left:e,top:n,width:i,height:o}=t.box;return{left:e,top:n,width:i,height:o}}function O(t){return null!==t.host&&!t.host.hasAttribute("data-window-tab")}export{d as OverlayLayerProvider,f as POPUP_GUTTER,h as isInOverlayOver,E as popupLayerStyle,O as scrimHasCorners,s as useOverlayTarget,b as usePanelPosition,p as usePopupAnchor,z as usePopupLevel,y as usePopupLevelBindings,M as windowScrimStyle};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-P5J7G7OV.js";import{ItemCount as n}from"./chunk-7WF6LFOJ.js";import{GROUP_COLORS as o}from"./chunk-EDRELF6L.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{OneLineLabel as s}from"./chunk-G3TC2GIA.js";import{Tooltip as l}from"./chunk-AJPQJ7TC.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{useShellStrings as d}from"./chunk-NRHG4R2Q.js";import{useRef as u,useCallback as p,useId as m,isValidElement as f}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var b='[role="treeitem"]';function v(e){return[...e.querySelectorAll(b)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":t,children:r,className:a="",rootProps:n}){const o=u(null);c(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(b)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??v(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=p(e=>{n?.onKeyDown?.(e);const t=o.current,r=e.target.closest?.(b);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=v(t),i=a.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),l=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(b))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=a[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?l(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return h("div",{...n,ref:o,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:r})}function x({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
3
3
|
return h("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var k=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),w=`${k} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!f(e)&&"label"in e}function A(e){if(null==e||!1===e||"number"==typeof e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(N)?e:N(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */h("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${k} ${o[e.tone]}`:w,children:e.label},t)):/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:e})}function j({children:e,count:t,countLabel:r,expanded:a,onToggle:o}){const i=void 0!==a,l=
|
|
4
4
|
/* @__PURE__ */h("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */h(s,{children:e})}),c="number"==typeof t?/* @__PURE__ */h(n,{count:t,label:r,showZero:!0}):null!=t&&!1!==t&&/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:t}),d="text-xs font-semibold uppercase tracking-wide text-ink-faint";return i?/* @__PURE__ */h("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */g("button",{type:"button","aria-expanded":a,onClick:o,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-ink-strongest","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",d].join(" "),children:[
|
|
5
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:
|
|
6
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var
|
|
7
|
-
return g("div",{...
|
|
8
|
-
/* @__PURE__ */h(t,{marker:"tree",hint:
|
|
9
|
-
/* @__PURE__ */h("span",
|
|
10
|
-
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[
|
|
11
|
-
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=
|
|
5
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:P(!!a)}),l,c]})}):/* @__PURE__ */g("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${d}`,children:[
|
|
6
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var P=e=>/* @__PURE__ */h(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),$={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function D({label:o,level:i=1,icon:l,preview:c,selected:d=!1,tone:u,expanded:p,onToggle:f,onSelect:b,muted:v=!1,badge:y,count:x,countLabel:k,actions:w,actionsPinned:N=!1,actionsOverlay:j=!0,rename:D,drop:C,dragging:K=!1,draggable:I=!1,dragHint:E,onMove:L,rowProps:G,className:R=""}){const S=void 0!==p,H=m(),J=x??("number"==typeof y?y:void 0),O=[G?.["aria-describedby"],L?H:void 0].filter(Boolean).join(" ")||void 0,T="shared"===u?"text-[color:var(--status-success-soft-ink)]":null,W=d?T?`bg-[var(--status-success-soft)] ${T}`:"bg-accent-tint text-blue-700":"into"===C?`bg-accent-tint ${T??"text-ink-strongest"}`:`${T??"text-ink"} hover:bg-gray-100`;/* @__PURE__ */
|
|
7
|
+
return g("div",{...G,role:"treeitem","aria-level":i,"aria-selected":d,"aria-expanded":S?p:void 0,"data-tone":u,tabIndex:d?0:-1,"aria-keyshortcuts":G?.["aria-keyshortcuts"]??(L?e:void 0),"aria-describedby":O,"data-drop":C,"data-draggable":I||void 0,onKeyDown:e=>{if(G?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=a(e);t&&L?(e.preventDefault(),L(t)):"Enter"!==e.key&&" "!==e.key||!b?("ArrowRight"===e.key&&S&&!p&&f||"ArrowLeft"===e.key&&S&&p&&f)&&(e.preventDefault(),f()):(e.preventDefault(),b())},onClick:e=>{G?.onClick?.(e),e.defaultPrevented||b?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",I?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",W,"into"===C?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",K?"opacity-40":"",R].filter(Boolean).join(" "),children:["before"===C&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===C&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),I&&
|
|
8
|
+
/* @__PURE__ */h(t,{marker:"tree",hint:E,dragging:K,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
+
/* @__PURE__ */h("span",S?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),f?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:P(!!p)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=l&&/* @__PURE__ */h("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(v?"text-ink-faintest":""),children:l}),
|
|
10
|
+
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[D??
|
|
11
|
+
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=J&&/* @__PURE__ */h(n,{count:J,label:k,active:d,showZero:!0,className:"ml-auto"}),null!=w&&!j&&/* @__PURE__ */h("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`${null!=J?"":"ml-auto "}flex shrink-0 items-center gap-0.5 transition-opacity ${N||v?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"}`,children:w})]}),null!=w&&j&&
|
|
12
12
|
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:$,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(N||v||d?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),
|
|
15
|
+
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),L&&/* @__PURE__ */h(r,{id:H})]})}function C({onAdd:e,label:t,drop:r=!1,slotProps:a}){const n=d().tree,o=r?n.dropHere:t??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return h("div",{...a,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */g("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function
|
|
17
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function K({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=d().tree,o=t??n.insertHere,s=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return g("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
19
19
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
20
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${s}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,
|
|
20
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${s}`}),e&&/* @__PURE__ */h(l,{content:o,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */h("button",{type:"button","aria-label":o,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */h(i,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}export{y as Tree,C as TreeEmptySlot,x as TreeGroup,j as TreeGroupLabel,D as TreeRow,K as TreeSeam};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-M5IZ7QLQ.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
|
|
2
2
|
return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
|
|
3
3
|
return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
4
4
|
/* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dismissPopups as o}from"./chunk-PGN5ME7B.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";function m(m){r(()=>{m&&o()},[m])}export{m as useDismissPopupsOnOpen};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatMoney as e}from"./chunk-OJI4ROSD.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-P5TSGXL4.js";import{ChartFrame as a}from"./chunk-A6TOHNJY.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{TH_ONE_LINE as s}from"./chunk-
|
|
1
|
+
import{formatMoney as e}from"./chunk-OJI4ROSD.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-P5TSGXL4.js";import{ChartFrame as a}from"./chunk-A6TOHNJY.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{TH_ONE_LINE as s}from"./chunk-G3TC2GIA.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
|
|
2
2
|
/* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
|
|
3
3
|
/* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
|
|
4
4
|
/* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{StatCard as e,Card as a}from"./chunk-RKSCB5BJ.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-6EGZ4PV4.js";import{Avatar as s}from"./chunk-SCNQK5NF.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-
|
|
1
|
+
import{StatCard as e,Card as a}from"./chunk-RKSCB5BJ.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-6EGZ4PV4.js";import{Avatar as s}from"./chunk-SCNQK5NF.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-EDRELF6L.js";import{Button_default as c}from"./chunk-MEP6CZJ3.js";import{TH_ONE_LINE as n}from"./chunk-G3TC2GIA.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
@@ -0,0 +1,6 @@
|
|
|
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};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as i,usePopupLevel as t,usePopupLevelBindings as r,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as d}from"./chunk-CJ4OEY3T.js";import{CloseButton as s}from"./chunk-AH5MLH54.js";import{useDiscardGuard as a}from"./chunk-5YTZBYG4.js";import{dialogA11y as m}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as p,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as u,DESCRIPTION_TEXT as f,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{useHydrated as y}from"./chunk-KEFNQEXZ.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useRef as x,useId as w,useState as g,useEffect as k}from"react";import{createPortal as N}from"react-dom";import{jsxs as j,Fragment as C,jsx as W}from"react/jsx-runtime";var Y={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Z={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function B(e,i){const t=window.innerHeight-(i.top+i.height);if("bottom"===e)return{left:i.left,width:i.width,bottom:t};const r={top:i.top,height:i.height};return"left"===e?{...r,left:i.left}:{...r,right:window.innerWidth-(i.left+i.width)}}function H({open:H,onClose:$,side:D="right",size:E="md",title:T,description:G,footer:J,children:Q,blocking:U=!1,dirty:z=!1,initialFocus:A,"aria-label":F,"aria-labelledby":O,"aria-describedby":V,className:I=""}){const K=x(null),L=w(),M=w(),X=w(),q=e(y()),[P,R]=g(null),S=a({open:H,dirty:z,onClose:$,title:T,layer:P}),_=x(null),ee=i(H&&null!==q,_),ie=t(H&&null!==q,_),te=r(ie,P),re=o(ie),oe=null!==ie.host;if(c(H),p(K,H&&null!==q,A,te),h(H),k(()=>{if(H)return v(()=>!te.current?.(document.activeElement)&&(U||S(),!0),()=>K.current)},[H,U,S,te]),!H||!q)return null;const ne="bottom"===D,le={...ne?{maxHeight:"85vh"}:{},...ee?B(D,ee):{}};/* @__PURE__ */
|
|
2
|
+
return j(C,{children:[/* @__PURE__ */W("span",{ref:_,hidden:!0,"data-popup-anchor":""}),N(
|
|
3
|
+
/* @__PURE__ */W(n,{value:P,children:/* @__PURE__ */j("div",{ref:R,className:oe?"fixed inset-0 pointer-events-none":"fixed inset-0",style:d(ie),role:"presentation","data-overlay-layer":"",children:[
|
|
4
|
+
/* @__PURE__ */W("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(oe?"pointer-events-auto"+(l(ie)?" rounded-(--radius-window)":""):"inset-0"),style:re??void 0,hidden:oe&&!re,onClick:U?void 0:S,"aria-hidden":"true","data-popup-scrim":oe?"window":"system"}),
|
|
5
|
+
/* @__PURE__ */j("div",{ref:K,...m({modal:!0,titleId:T?X:void 0,labelledBy:O,label:F}),"aria-describedby":V??(G?M:Q?L:void 0),"data-drawer-side":D,"data-popup-panel":"",style:le,className:[`fixed flex flex-col ${b}`,oe?"pointer-events-auto":"",ne?"":`w-full max-w-full ${Y[E]}`,ee?"":Z[D],ne?"rounded-t-xl":"",I].filter(Boolean).join(" "),children:[T?/* @__PURE__ */j("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
|
+
/* @__PURE__ */j("div",{className:"min-w-0",children:[
|
|
7
|
+
/* @__PURE__ */W("h2",{id:X,className:u,children:T}),G&&/* @__PURE__ */W("p",{id:M,className:`mt-0.5 ${f}`,children:G})]}),!U&&/* @__PURE__ */W(s,{onClose:S})]}):!U&&/* @__PURE__ */W("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */W(s,{onClose:S})}),
|
|
8
|
+
/* @__PURE__ */j("div",{id:L,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[G&&!T&&/* @__PURE__ */W("p",{id:M,className:`mb-3 ${f} ${U?"":"pr-8"}`.trim(),children:G}),Q]}),J&&/* @__PURE__ */W("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:J})]})]})}),q)]})}export{H as Drawer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-Q7FPGOUY.js";import{toDayMs as i,fmtSliderDate as t}from"./chunk-5CFERCYW.js";import{DAY_MS as a}from"./chunk-JRQMX4PK.js";import{useBrowserValueOnce as l}from"./chunk-KEFNQEXZ.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-NRHG4R2Q.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const j=l(Date.now,null),M=[],C=[],x=o().timeline,N=r();for(const e of p){const n=i(e.date??null);null===n?C.push({key:e.key,label:e.label,kind:e.kind}):M.push({...e,ms:n})}M.sort((e,n)=>e.ms-n.ms);const K=i(g??null);let O,Q,R=!0;0===M.length?(Q=K??j??0,O=Q-30*a,R=null!==K||null!==j):(O=M[0].ms,Q=K??M[M.length-1].ms,Q-O<a&&(Q=O+a));const w=M.length>0?Math.max(0,Math.round((Q-O)/a)):0,E=u??(w>0?x.duration(w):void 0),F=[M.length>0?x.started(t(M[0].ms,N)):void 0,E,C.length>0?x.reached(M.length,p.length):void 0],H=M.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),L={};for(const e of M)e.phase&&(L[e.phase]=L[e.phase]||[]).push(e.ms);const D=Object.entries(L).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),G="rail"===v,P=R&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:G?"spread":"compressed",labels:G?"none":"lanes",items:H,pending:C,phases:D,startMs:O,endMs:Q,todayMs:j??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:x.milestones(m)})});/* @__PURE__ */
|
|
2
|
+
return h("div",G?{className:"shrink-0","data-timeline-variant":"rail",children:P}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:F,children:P})})}export{m as MilestoneTimeline};
|