efficient-shell 13.14.0 → 13.16.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 +21 -2
- package/dist/Browser-4KWGT3FG.js +44 -0
- package/dist/Calculator-VURS4NAT.js +29 -0
- package/dist/CurrencyConverter-X5ENBDLK.js +21 -0
- package/dist/{Files-XLDCJ7DO.js → Files-NT76VUHQ.js} +64 -64
- package/dist/Notepad-6AMNAYQQ.js +24 -0
- package/dist/PomodoroTimer-KDXH5M3Q.js +91 -0
- package/dist/{Preview-24XTJDIR.js → Preview-QNJD5PVD.js} +27 -27
- package/dist/Sidebar-UCCVJFSY.js +44 -0
- package/dist/Stock-JR77FPOD.js +16 -0
- package/dist/{Weather-IWM5XTE5.js → Weather-MGSDU3M5.js} +18 -18
- package/dist/{WorldClock-35TNXAJM.js → WorldClock-GGAYPYIO.js} +7 -7
- package/dist/ai/index.js +44 -44
- 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/brand.css +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.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/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-UGEA3C5C.js → chunk-23LK4PLJ.js} +5 -5
- package/dist/{chunk-JNSRDEB6.js → chunk-2J3C2RR4.js} +10 -10
- package/dist/{chunk-PT4GMPUB.js → chunk-3SIRRK3F.js} +3 -3
- package/dist/{chunk-36UB4MJX.js → chunk-4G7PJ325.js} +1 -1
- package/dist/chunk-5URXJCNC.js +2 -0
- package/dist/{chunk-HVHIXX6O.js → chunk-6OGX7V7L.js} +10 -10
- package/dist/{chunk-WP43XYL6.js → chunk-6QH7I2V5.js} +2 -2
- package/dist/chunk-74SCWPQF.js +1 -0
- package/dist/{chunk-QTVE3OSD.js → chunk-75R3EKWZ.js} +7 -7
- package/dist/{chunk-G53Y6EPJ.js → chunk-7CBWSLCW.js} +13 -13
- package/dist/{chunk-DVVB2CY5.js → chunk-7I5RJPY7.js} +1 -1
- package/dist/{chunk-22N3KA7A.js → chunk-7IXU4YT4.js} +4 -4
- package/dist/{chunk-XEPA5J6K.js → chunk-A7VNKVZO.js} +4 -4
- package/dist/{chunk-JPKNVTTK.js → chunk-BNPWUCZX.js} +1 -1
- package/dist/{chunk-M5K4AX4E.js → chunk-BUFAJJDZ.js} +1 -1
- package/dist/{chunk-ALHYNNE2.js → chunk-BVX7LUAW.js} +6 -6
- package/dist/chunk-BWJZTHZ6.js +1 -0
- package/dist/chunk-BWQHABH7.js +4 -0
- package/dist/{chunk-G4D2WM3J.js → chunk-BZRFD4DK.js} +3 -3
- package/dist/{chunk-U6DRRCCG.js → chunk-C5OPAULN.js} +1 -1
- package/dist/{chunk-MEF4JVXP.js → chunk-CCLK2RPQ.js} +14 -14
- package/dist/{chunk-KC3EX26K.js → chunk-DPFEQQQU.js} +1 -1
- package/dist/{chunk-ZYU5HAIC.js → chunk-E7BQZL7X.js} +1 -1
- package/dist/{chunk-YM2Z4LZ2.js → chunk-EFVQQF6F.js} +17 -17
- package/dist/{chunk-GO2TZ35U.js → chunk-EJOKROMB.js} +1 -1
- package/dist/{chunk-4IYHQNKZ.js → chunk-ENDYHUUR.js} +1 -1
- package/dist/{chunk-4F3SUYN5.js → chunk-ETQ45TBW.js} +1 -1
- package/dist/chunk-EX3DARI3.js +7 -0
- package/dist/{chunk-JPCPO4MX.js → chunk-EZYXY67W.js} +8 -8
- package/dist/chunk-F2RAIGCG.js +6 -0
- package/dist/{chunk-ZDMZM7HD.js → chunk-FBZUEZK7.js} +2 -2
- package/dist/{chunk-GURY4WS5.js → chunk-FFRJ6QZK.js} +1 -1
- package/dist/{chunk-F5B5WOQ7.js → chunk-FKMARSJZ.js} +2 -2
- package/dist/chunk-FMLUQCFB.js +2 -0
- package/dist/{chunk-AWWNMSDN.js → chunk-FXSGIT53.js} +10 -10
- package/dist/{chunk-YMHCLK3F.js → chunk-FZYUTZEV.js} +10 -10
- package/dist/chunk-G2JPTPRS.js +13 -0
- package/dist/chunk-G5UGCAWN.js +17 -0
- package/dist/{chunk-DEYVAMJQ.js → chunk-GEITUFYK.js} +13 -13
- package/dist/chunk-GMLOMLCS.js +24 -0
- package/dist/{chunk-QNQLKGBC.js → chunk-GNXAVDZD.js} +1 -1
- package/dist/{chunk-6LS6Q77E.js → chunk-GUSENWAH.js} +1 -1
- package/dist/{chunk-YDQBELHJ.js → chunk-H5PSCQJ2.js} +6 -6
- package/dist/{chunk-LXPDURUL.js → chunk-HMOKKMIV.js} +2 -2
- package/dist/{chunk-RFR2K7JO.js → chunk-HPHDLN6E.js} +2 -2
- package/dist/{chunk-FUP2J2OX.js → chunk-IG3K6AGW.js} +1 -1
- package/dist/{chunk-I5EVMLPB.js → chunk-IJ4JX6WP.js} +4 -4
- package/dist/{chunk-RT77WNRB.js → chunk-IJJNJJ6I.js} +1 -1
- package/dist/chunk-IUQJGFEO.js +11 -0
- package/dist/{chunk-64PPKUJG.js → chunk-J4CVYOY3.js} +13 -13
- package/dist/{chunk-HTANBHNV.js → chunk-J4KPBR5B.js} +1 -1
- package/dist/{chunk-CUZQVBPC.js → chunk-JDLJ7DHV.js} +1 -1
- package/dist/{chunk-775K6APE.js → chunk-JFOMAXD2.js} +67 -67
- package/dist/chunk-JPE4TYRQ.js +14 -0
- package/dist/{chunk-4Q2CZ4US.js → chunk-JPSWWIBW.js} +6 -6
- package/dist/{chunk-XOQGBU25.js → chunk-K2FVP22A.js} +1 -1
- package/dist/{chunk-7RGHV3J5.js → chunk-KGAYYSFE.js} +6 -6
- package/dist/{chunk-KLUCEASW.js → chunk-KQCJWK55.js} +6 -6
- package/dist/{chunk-YNVH2EIE.js → chunk-L4ZQY4ZG.js} +3 -3
- package/dist/{chunk-PALWXHBQ.js → chunk-LKAGXURQ.js} +20 -20
- package/dist/chunk-LQCNIQ3I.js +8 -0
- package/dist/{chunk-RZJ63ZM4.js → chunk-MHQW6NAE.js} +11 -11
- package/dist/{chunk-VCR3RADH.js → chunk-MVOYVN3S.js} +1 -1
- package/dist/{chunk-N2FX4O3H.js → chunk-MZ3JADHG.js} +1 -1
- package/dist/chunk-N5KJLHYI.js +9 -0
- package/dist/{chunk-YBYJUBWE.js → chunk-NW5NSV7N.js} +2 -2
- package/dist/{chunk-SV5RRBVA.js → chunk-NWS5G7FE.js} +1 -1
- package/dist/{chunk-UXGNF3OG.js → chunk-OF5X4HKC.js} +1 -1
- package/dist/{chunk-YY7OFUT2.js → chunk-OIEFMLYI.js} +3 -3
- package/dist/{chunk-FMERX3PG.js → chunk-OLSA36VX.js} +2 -2
- package/dist/chunk-OMOAD5LL.js +1 -0
- package/dist/chunk-OXWBSZL2.js +23 -0
- package/dist/chunk-PBSCF2ML.js +15 -0
- package/dist/{chunk-2YK6ZB7C.js → chunk-PPLPDP6D.js} +1 -1
- package/dist/{chunk-GTT7LIWK.js → chunk-PY4DTB6Y.js} +1 -1
- package/dist/{chunk-QIPO4EVJ.js → chunk-Q4MOT7TY.js} +1 -1
- package/dist/chunk-QAAHFU2I.js +1 -0
- package/dist/{chunk-OYXA7SWV.js → chunk-QE2JX7D4.js} +1 -1
- package/dist/{chunk-7NO4IENQ.js → chunk-R5WBDXI2.js} +1 -1
- package/dist/{chunk-WIFK6TLB.js → chunk-RDETBXMP.js} +1 -1
- package/dist/{chunk-I6QVXM2M.js → chunk-RDVC32EV.js} +15 -15
- package/dist/chunk-RJVIKGHJ.js +4 -0
- package/dist/chunk-S25KELFW.js +11 -0
- package/dist/chunk-SF4IIV5Z.js +2 -0
- package/dist/{chunk-ZDYIVU5R.js → chunk-SHHRC5XK.js} +8 -8
- package/dist/{chunk-OBZZLLMQ.js → chunk-SLEA47VA.js} +1 -1
- package/dist/{chunk-F6UJLCMI.js → chunk-SUSJFGXN.js} +9 -9
- package/dist/{chunk-FTKLODQK.js → chunk-SXHV5OLA.js} +1 -1
- package/dist/{chunk-65FZQ572.js → chunk-SZFULV7I.js} +6 -6
- package/dist/{chunk-HZ7TUMNL.js → chunk-TB2ARUE2.js} +1 -1
- package/dist/{chunk-G67CJAQ2.js → chunk-TD3ZQD5R.js} +1 -1
- package/dist/chunk-THAPVKEJ.js +15 -0
- package/dist/{chunk-HNIIDDLJ.js → chunk-TNALBYLY.js} +1 -1
- package/dist/{chunk-6CDWPEND.js → chunk-TPKNHQIE.js} +8 -8
- package/dist/{chunk-EHM3ZVVT.js → chunk-UC5IC3AM.js} +4 -4
- package/dist/{chunk-VADWTS7H.js → chunk-UFWBPTCM.js} +5 -5
- package/dist/{chunk-EVYD6UFQ.js → chunk-UTISUEO4.js} +2 -2
- package/dist/chunk-UTQN5AIO.js +6 -0
- package/dist/chunk-UVHXVSB2.js +1 -0
- package/dist/{chunk-QMBMK6PP.js → chunk-VKZC3NPM.js} +2 -2
- package/dist/{chunk-UZFFSZFI.js → chunk-VQBKRBBR.js} +1 -1
- package/dist/{chunk-GLUJS42B.js → chunk-VY3UA6AR.js} +1 -1
- package/dist/{chunk-G3MJO3A6.js → chunk-W6NGPSMM.js} +13 -13
- package/dist/chunk-WCCS4VFE.js +1 -0
- package/dist/{chunk-JWLOERV5.js → chunk-WLBWACKP.js} +2 -2
- package/dist/{chunk-WLG7BE55.js → chunk-WRV6QKJN.js} +1 -1
- package/dist/{chunk-LHHJHTWP.js → chunk-WZWSFYXJ.js} +1 -1
- package/dist/{chunk-S6YEPA4I.js → chunk-X4E4RPFE.js} +5 -5
- package/dist/{chunk-M7W63T6H.js → chunk-XAT2MKNU.js} +8 -8
- package/dist/{chunk-QOYKBINM.js → chunk-XQVGBVHC.js} +1 -1
- package/dist/{chunk-E6FDUFPH.js → chunk-XVMCSUAV.js} +1 -1
- package/dist/chunk-XXTAMF3O.js +28 -0
- package/dist/{chunk-6HYO2W3O.js → chunk-YCXQDUTW.js} +5 -5
- package/dist/{chunk-WU2ZA6J2.js → chunk-YDJ5IZOU.js} +1 -1
- package/dist/{chunk-KBQNMQCK.js → chunk-YQ5JHHLE.js} +1 -1
- package/dist/{chunk-2GMYO6ET.js → chunk-YT5HMLC7.js} +1 -1
- package/dist/chunk-YTDMCUL7.js +14 -0
- package/dist/{chunk-G4PPHQ23.js → chunk-YWMCW5BN.js} +1 -1
- package/dist/{chunk-WF4A2HSB.js → chunk-ZCN5BU4U.js} +1 -1
- package/dist/{chunk-HY6CBG4M.js → chunk-ZDFMYAQB.js} +1 -1
- package/dist/chunk-ZDXRSY2Y.js +1 -0
- package/dist/chunk-ZISKHQZY.js +3 -0
- package/dist/{chunk-DVHRL3G6.js → chunk-ZVDYRXNP.js} +6 -6
- package/dist/{chunk-3DWVSQIJ.js → chunk-ZYKY4Z7R.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/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 +29 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useTheme.js +1 -1
- package/dist/icons/brands.node.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +3 -40
- package/dist/index.js +514 -514
- package/dist/map/index.js +7 -7
- 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/Card.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.d.ts +14 -4
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/Kbd.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/ShellPrefs.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +4 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
- package/dist/Browser-FJSOZLWR.js +0 -44
- package/dist/Calculator-ZHINQHFI.js +0 -29
- package/dist/CurrencyConverter-AAXS7RPC.js +0 -21
- package/dist/Notepad-NENKOSXJ.js +0 -24
- package/dist/PomodoroTimer-XKSYNHS7.js +0 -91
- package/dist/Sidebar-GYGYAXS2.js +0 -44
- package/dist/Stock-TCQSVSSY.js +0 -16
- package/dist/chunk-3DSGJIC7.js +0 -7
- package/dist/chunk-47UTEV3P.js +0 -23
- package/dist/chunk-4S3E3VJH.js +0 -11
- package/dist/chunk-64RHGJXK.js +0 -4
- package/dist/chunk-6AUQWWUA.js +0 -17
- package/dist/chunk-7KWYVQMX.js +0 -2
- package/dist/chunk-7QSDPSXP.js +0 -1
- package/dist/chunk-A7ZYFJ6V.js +0 -28
- package/dist/chunk-ASDYAASN.js +0 -3
- package/dist/chunk-D65T4H6J.js +0 -1
- package/dist/chunk-DQTYV6AC.js +0 -9
- package/dist/chunk-EV5BEEVO.js +0 -1
- package/dist/chunk-FHNQC2MA.js +0 -1
- package/dist/chunk-FQD6P6EZ.js +0 -4
- package/dist/chunk-GOAFMGUI.js +0 -15
- package/dist/chunk-IQDHVQAQ.js +0 -14
- package/dist/chunk-JGKDWDVM.js +0 -27
- package/dist/chunk-KY3KGRGC.js +0 -1
- package/dist/chunk-MHCNQKEK.js +0 -4
- package/dist/chunk-RDGXSAOD.js +0 -2
- package/dist/chunk-RIG5FEVS.js +0 -1
- package/dist/chunk-SNHBDP4X.js +0 -15
- package/dist/chunk-SOZCWT6I.js +0 -6
- package/dist/chunk-WWCAVO3R.js +0 -14
- package/dist/chunk-XMFJDT6Y.js +0 -13
- package/dist/chunk-XSHDPG45.js +0 -9
- package/dist/chunk-YUDBB7VC.js +0 -11
- /package/dist/{chunk-JR2HHKVP.js → chunk-FRCTA5FS.js} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{HEADING_TEXT as e}from"./chunk-BWJZTHZ6.js";import{useShellLocale as r}from"./chunk-IUVGHHR3.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useId as a,Children as n}from"react";import{jsxs as i,jsx as t}from"react/jsx-runtime";var l={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},s={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function c({children:r,header:d,description:c,footer:o,padded:m=!0,padding:u,headingLevel:b,headerActions:p,"aria-label":h,className:x="",bodyClassName:g="",style:f,tone:y="neutral"}){const N=l[u??(m?"md":"none")],v=a(),$=a(),w=null!=d&&null!=c&&""!==c,j=null!=b&&null!=d,k=`h${b}`,H=null!=h&&""!==h,A=j||H,B=A?"section":"div",C=`rounded-(--radius-card) border ${s[y]} bg-surface shadow-sm ${x}`.trim(),R=n.toArray(r).length>0,Z=R?"border-b border-line-subtle ":"",G="current"===y,I=G?"text-base font-semibold text-blue-700":e,J=G?"rounded-t-(--radius-card) bg-accent-tint ":"",L=`${Z}${J}${N.edge} ${I}`;/* @__PURE__ */
|
|
2
|
+
return i(B,{className:C,style:f,...H?{"aria-label":h}:j?{"aria-labelledby":v}:{},...w&&A?{"aria-describedby":$}:{},...G?{"aria-current":!0}:{},children:[w?
|
|
3
|
+
/* @__PURE__ */i("div",{className:`${Z}${J}${N.edge}`,children:[null!=p?/* @__PURE__ */i("div",{className:`flex items-center justify-between gap-3 ${I}`,children:[j?/* @__PURE__ */t(k,{id:v,children:d}):/* @__PURE__ */t("span",{children:d}),p]}):j?/* @__PURE__ */t(k,{id:v,className:I,children:d}):/* @__PURE__ */t("div",{className:I,children:d}),
|
|
4
|
+
/* @__PURE__ */t("p",{id:$,className:G?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:c})]}):null!=d&&(null!=p?
|
|
5
|
+
/* @__PURE__ */i("div",{className:`${L} flex items-center justify-between gap-3`,children:[j?/* @__PURE__ */t(k,{id:v,children:d}):/* @__PURE__ */t("span",{children:d}),p]}):j?
|
|
6
|
+
/* @__PURE__ */t(k,{id:v,className:L,children:d}):/* @__PURE__ */t("div",{className:L,children:d})),R&&/* @__PURE__ */t("div",{className:[N.body,g].filter(Boolean).join(" "),children:r}),o&&/* @__PURE__ */t("div",{className:`border-t border-gray-100 ${N.edge}`,children:o})]})}function o({label:e,value:a,icon:n,delta:l,className:s=""}){const c=r(),o="number"==typeof a&&c?d(a,c):a,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",u="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
|
|
7
|
+
return i("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
|
|
8
|
+
/* @__PURE__ */i("div",{className:"flex items-center justify-between text-ink-faint",children:[
|
|
9
|
+
/* @__PURE__ */t("span",{className:"text-xs font-medium uppercase tracking-wide",children:e}),n]}),
|
|
10
|
+
/* @__PURE__ */i("div",{className:"mt-2 flex items-baseline gap-2",children:[
|
|
11
|
+
/* @__PURE__ */t("span",{className:"text-2xl font-semibold text-gray-900",children:o}),l&&/* @__PURE__ */i("span",{className:`text-xs font-medium ${m}`,children:[u," ",l.value]})]})]})}export{c as Card,o as StatCard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getActiveModalId as t}from"./chunk-F3ZOO23R.js";import{Icon as e}from"./chunk-ISVODSRP.js";import{Z_LAYERS as n}from"./chunk-62LW225J.js";import{useBrowserLayoutEffect as i}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as o}from"./chunk-IUVGHHR3.js";import{createContext as r,useContext as u,useRef as s,useState as l}from"react";import{jsx as d}from"react/jsx-runtime";var h=r(void 0),c=h.Provider;function a(t){const e=u(h);return t?void 0===e?document.body:e:null}function f(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 w="[data-modal-panel], [data-popup-panel]",v=16;function p(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 m(t,e,n){return n<e?e:Math.min(Math.max(t,e),n)}function b(){return{width:window.innerWidth,height:window.innerHeight}}function g(t,e){const n=s(null),o=s(!1);t&&!o.current&&(n.current="undefined"==typeof document?null:document.activeElement),o.current=t;const[r,u]=l(null);return i(()=>{if(!t)return void u(null);const i=(o=e.current,r=n.current,o?.parentElement?.closest(w)??r?.closest(w)??null);var o,r;if(!i)return void u(null);const s=()=>{const t=i.getBoundingClientRect(),e=b(),n=p({left:t.left,top:t.top,width:t.width,height:t.height},e),o=null!==n&&n.width>=e.width-1&&n.height>=e.height-1;u(t=>{const e=o?null:n;return t===e||t&&e&&t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height?t:e})};s(),window.addEventListener("resize",s);const l="undefined"==typeof ResizeObserver?null:new ResizeObserver(s);return l?.observe(i),()=>{window.removeEventListener("resize",s),l?.disconnect()}},[t,e]),r}function x(t,e){const[n,o]=l(null);return i(()=>{const n=e.current;if(!t||!n)return void o(null);const i=()=>{const e=function(t,e,n,i=16){return{left:m(t.left+t.width/2-e.width/2,i,n.width-i-e.width),top:m(t.top+t.height/2-e.height/2,i,n.height-i-e.height)}}(t,{width:n.offsetWidth,height:n.offsetHeight},b());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]),n}var y=/* @__PURE__ */new WeakMap;function z(t){if(!t)return null;const e=t.closest("[data-overlay-layer]");return e?y.get(e)??null:t.closest("[data-modal-panel]")}var E={host:null,box:null,z:0,hidden:!1};function R(t,e){const n=s(null),o=s(!1);t&&!o.current&&(n.current="undefined"==typeof document?null:document.activeElement),o.current=t;const[r,u]=l(E);return i(()=>{if(!t)return void u(E);const i=(o=e.current,r=n.current,z(o?.parentElement)??z(r));var o,r;if(!i)return void u(E);const s=()=>{const t=i.getBoundingClientRect(),e=getComputedStyle(i),n=p({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:i,box:n,z:Number.isFinite(o)?o:0,hidden:null===n||"none"===e.display||"hidden"===e.visibility};u(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})};s(),window.addEventListener("resize",s);const l="undefined"==typeof ResizeObserver?null:new ResizeObserver(s);l?.observe(i);const d="undefined"==typeof MutationObserver?null:new MutationObserver(s);return d?.observe(i,{attributes:!0,attributeFilter:["style","class"]}),()=>{window.removeEventListener("resize",s),l?.disconnect(),d?.disconnect()}},[t,e]),r}function O(e,n){const i=s(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=z(n);return null!==u&&u!==o&&!o.contains(u)}(e,n,i,t()),n&&function(t,e){y.set(t,e)}(n,e.host),i}function k(t){return t.host?{zIndex:t.z+1,...t.hidden?{visibility:"hidden"}:{}}:{zIndex:n.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 L(t){return null!==t.host&&!t.host.hasAttribute("data-window-tab")}function j({onClose:t,className:n=""}){const i=o().dialog;/* @__PURE__ */
|
|
2
|
+
return d("button",{type:"button",onClick:t,"aria-label":i.close,className:(n?`${n} `:"")+"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */d(e,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}export{j as CloseButton,c as OverlayLayerProvider,v as POPUP_GUTTER,f as isInOverlayOver,k as popupLayerStyle,L as scrimHasCorners,a as useOverlayTarget,x as usePanelPosition,g as usePopupAnchor,R as usePopupLevel,O as usePopupLevelBindings,M as windowScrimStyle};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{copyToClipboard as e,selectionAt as t}from"./chunk-UFX7F3KG.js";import{useTableNav as n}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as r}from"./chunk-G6DKCCWH.js";import{ListFooter as o}from"./chunk-DO3DSSAW.js";import{ListLoadError as l}from"./chunk-
|
|
2
|
-
return x(l,{title:K,message:M,onRetry:
|
|
3
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-UFX7F3KG.js";import{useTableNav as n}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as r}from"./chunk-G6DKCCWH.js";import{ListFooter as o}from"./chunk-DO3DSSAW.js";import{ListLoadError as l}from"./chunk-MVOYVN3S.js";import{ResizableTable as i}from"./chunk-J4CVYOY3.js";import{Checkbox_default as a}from"./chunk-CGZBDI6C.js";import{LoadingSpinner as c}from"./chunk-4U5M37SF.js";import{PopupMenu as d,PopupMenuLabel as s,PopupMenuItem as h,PopupMenuDivider as m}from"./chunk-THAPVKEJ.js";import{keepsNativeMenu as u}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{shellHttp as f}from"./chunk-STKJA4PV.js";import{toast_default as g}from"./chunk-VQ35LXDC.js";import{useShellStrings as y}from"./chunk-IUVGHHR3.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:N,emptyState:L,totalCount:$,isError:A,onRetry:T,errorTitle:K,errorMessage:M,tableId:E,columns:F,renderCell:D,getRowId:P=e=>e.id,sort:U,onSort:V,selected:H,setSelected:I,onRowClick:O,onRowHover:J,getRowClassName:W,footerLabel:G,footerExtra:Y,footerExtraAfter:_,sentinelRef:B,isFetchingNextPage:Q,saveDefaultPerms:X,exportEndpoint:Z,exportFilename:z="export.csv",contextActions:q}=S,[ee,te]=k(null),ne=b(null),re=y(),oe=re.entityList,le=e=>{I(t=>{const n=new Set(t),r=P(e);return n.has(r)?n.delete(r):n.add(r),n})},ie=()=>{I(e=>{const t=R.map(P),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ae=n(R,O,le,ie,(e,t)=>{I(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(P(R[n]));return r})},ne),ce=R.filter(e=>H.has(P(e))),de=()=>{const e=[...ne.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&H.has(P(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(F.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},se=()=>{te(null);const{header:t,body:n}=de();if(!n.length)return;const o=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${r(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${r(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(oe.copiedRows(n.length),o,l)},he=async()=>{te(null);const e=ce.map(P);if(!e.length||!Z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(F.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${E}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return F.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=Z.includes("?")?"&":"?";try{const n=await f.get(`${Z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=z,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void g.notify(Number.isFinite(a)?oe.exportTruncated(a,e.length):oe.exportTruncatedUnknown(e.length));g.success(oe.exported(e.length))}catch{g.error(oe.exportFailed)}};if(N)/* @__PURE__ */return x(c,{});if(A&&0===R.length)/* @__PURE__ */
|
|
2
|
+
return x(l,{title:K,message:M,onRetry:T});if(0===R.length)/* @__PURE__ */return x(w,{children:L});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=H.size-ce.length,fe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(a,{"aria-label":re.table.selectAll,checked:me,indeterminate:ue,onChange:ie,style:{height:14,width:14}})},...F],ge=/* @__PURE__ */x(o,{selectedCount:ce.length,hiddenSelectedCount:pe,loadedCount:R.length,totalCount:$,label:G,isFetchingMore:Q,extra:Y,extraAfter:_}),ye=B?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:B}),Q&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0!==$&&$>R.length;ke=/* @__PURE__ */C(d,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
4
|
/* @__PURE__ */x(s,{children:pe>0?re.list.selectedNotShown(a,pe):re.list.selected(a)}),
|
|
5
5
|
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),O(r)},children:oe.open}),
|
|
6
6
|
/* @__PURE__ */x(m,{}),o&&/* @__PURE__ */x(h,{onClick:()=>{c(),e(oe.copiedText,o.text,o.html)},children:oe.copy}),l&&/* @__PURE__ */x(h,{onClick:()=>(t=>{te(null);const{keys:n,body:r}=de(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:oe.copyColumn(l.label)}),
|
|
7
|
-
/* @__PURE__ */x(h,{disabled:0===a,onClick:se,children:oe.copyRows(a)}),
|
|
7
|
+
/* @__PURE__ */x(h,{disabled:0===a,onClick:se,children:oe.copyRows(a)}),Z&&/* @__PURE__ */x(h,{onClick:he,children:oe.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(m,{}),
|
|
8
8
|
/* @__PURE__ */x(h,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ce)},children:e.label})]},t)),
|
|
9
|
-
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),
|
|
10
|
-
/* @__PURE__ */x(h,{onClick:()=>{c(),
|
|
9
|
+
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),I(e=>/* @__PURE__ */new Set([...e,...R.map(P)]))},children:u?oe.selectAllLoaded(R.length):oe.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(h,{onClick:()=>{c(),I(/* @__PURE__ */new Set)},children:oe.clearSelection}),T&&/* @__PURE__ */x(h,{onClick:()=>{c(),T()},children:oe.refresh})]})}/* @__PURE__ */
|
|
11
11
|
return C("div",{className:"flex-1 flex flex-col mb-1 bg-white rounded-lg shadow overflow-hidden",children:[
|
|
12
|
-
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(i,{tableId:
|
|
13
|
-
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":
|
|
12
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(i,{tableId:E,columns:fe,sort:U,onSort:V,footer:ge,afterBody:ye,saveDefaultPerms:X,children:e=>/* @__PURE__ */x("tbody",{ref:ne,className:"divide-y divide-gray-100",children:R.map((n,r)=>{const o=P(n);/* @__PURE__ */
|
|
13
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":H.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${W?.(n)??""}`,onClick:()=>O(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||u(e.target))return;e.preventDefault();const r=P(n);H.has(r)||I(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?F.find(e=>e.key===o)?.label:void 0;te({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:J?()=>J(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(a,{"aria-label":re.table.selectRow,checked:H.has(o),onChange:()=>le(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):D(n,e.key)},e.key))},o)})})})}),ke]})}export{S as EntityList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
1
|
+
import{Tooltip as e}from"./chunk-F2RAIGCG.js";import{Fragment as r}from"react";import{jsx as l,jsxs as a}from"react/jsx-runtime";var i="58px",t="--picture-tiles-columns";function o(e){let r=0;for(const l of e)for(const e of l.label.split(/\s+/))r=Math.max(r,[...e].length);return r}function s({options:t,value:s,onChange:n,onClear:c,columns:u,captions:p=!1,label:d,className:b="","aria-labelledby":m}){const f=p?{"--picture-tiles-min":i,"--picture-tiles-longest-word":o(t),...u?{"--picture-tiles-default-columns":u}:{}}:{gridTemplateColumns:u?`repeat(${u}, minmax(0, 1fr))`:`repeat(auto-fill, minmax(${i}, 1fr))`};/* @__PURE__ */
|
|
2
2
|
return l("div",{role:"group","aria-label":m?void 0:d,"aria-labelledby":m,style:f,className:`${p?"rosh-picture-tiles rosh-one-height-rows"+(u?"":" rosh-picture-tiles-fit"):"grid"} gap-(--space-8) ${b}`.replace(/\s+/g," ").trim(),children:t.map(i=>{const t=i.value===s,o=/* @__PURE__ */a("button",{type:"button","aria-pressed":t,"aria-label":p?void 0:i.label,disabled:i.disabled||void 0,onClick:()=>{t?c?.():n(i.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${p?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${t?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[i.picture,p&&/* @__PURE__ */l("span",{className:"max-w-full text-center text-2xs leading-4 break-normal",children:i.label})]});return p?/* @__PURE__ */l(r,{children:o},i.value):/* @__PURE__ */l(e,{content:i.label,describe:!1,className:"relative flex min-w-0",children:o},i.value)})})}export{t as PICTURE_TILES_COLUMNS_VAR,s as PictureTiles};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{textWidth as e}from"./chunk-UVCMV2TL.js";import{escapeHtml as t}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as n}from"./chunk-
|
|
2
|
-
return d("div",{...n,dangerouslySetInnerHTML:r})}function f({columns:t,data:f,onChange:p,onColumnsChange:b,fixedRows:y=!1,minRows:v=15,maxHeight:x="260px",cellStyles:M,onFocusChange:D,onSelectionChange:k}){const C=l(null),E=o().grid,[L
|
|
1
|
+
import{textWidth as e}from"./chunk-UVCMV2TL.js";import{escapeHtml as t}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as o}from"./chunk-IUVGHHR3.js";import{useRef as l,useState as c,useEffect as a,useCallback as s,useMemo as i}from"react";import{createPortal as u}from"react-dom";import{jsxs as h,jsx as d,Fragment as w}from"react/jsx-runtime";function m(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function g({text:e,...n}){const r=i(()=>({__html:t(e)}),[e]);/* @__PURE__ */
|
|
2
|
+
return d("div",{...n,dangerouslySetInnerHTML:r})}function f({columns:t,data:f,onChange:p,onColumnsChange:b,fixedRows:y=!1,minRows:v=15,maxHeight:x="260px",cellStyles:M,onFocusChange:D,onSelectionChange:k}){const C=l(null),E=o().grid,[L,S]=c(null);a(()=>{D?.(L)},[L,D]);const[$,z]=c({}),N=l(null),[A,R]=c({}),O=l(null),[K,T]=c(null),[P,F]=c(null),[H,I]=c(null),[Y,j]=c(null),[X,W]=c(null),q=l(null);r(()=>{const e=q.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;q.current=null;const t=C.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[X]);const[V,B]=c(null),[U,G]=c(null);a(()=>{k?.(V&&U?{anchor:V,end:U}:null)},[V,U,k]);const Z=l(!1),[_,Q]=c(null),J=l(!1),ee=l({a:null,e:null});ee.current={a:V,e:U};const te=V&&U&&(V.row!==U.row||V.col!==U.col),ne=[...f];if(!y)for(;ne.length<v;)ne.push(Array(t.length).fill(""));const re=s((e,n,r)=>{const o=ne.map(e=>[...e]);for(;o.length<=e;)o.push(Array(t.length).fill(""));for(;o[e].length<t.length;)o[e].push("");o[e][n]=r,p(o)},[ne,t.length,p]),oe=s((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(ne[e]?.[t]||"")){const r=ne.map(e=>[...e]);r[e]&&(r[e][t]=n,p(r))}}Z.current=!0,e.shiftKey&&V||B({row:t,col:n}),G({row:t,col:n})},[ne,p,V]),le=s((e,t)=>{Z.current&&G({row:e,col:t})},[]);a(()=>{const e=()=>{Z.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),a(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!V||!U)return;const t=window.getSelection();if(t&&t.toString().length>0&&!te)return;const n=Math.min(V.row,U.row),r=Math.max(V.row,U.row),o=Math.min(V.col,U.col),l=Math.max(V.col,U.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(ne[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[V,U,ne,te]),a(()=>{const e=e=>{if(!L)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!C.current?.contains(n))return;const r=e.clipboardData?.getData("text/plain");if(!r)return;e.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=ne.map(e=>[...e]);for(let e=0;e<o.length;e++){const n=L.row+e;for(;l.length<=n;)l.push(Array(t.length).fill(""));for(;l[n].length<t.length;)l[n].push("");for(let r=0;r<o[e].length;r++){const c=L.col+r;if(c>=t.length)break;t[c].readOnly||(l[n][c]=o[e][r].trim())}}p(y?l:m(l,t.length)),B({row:L.row,col:L.col}),G({row:Math.min(L.row+o.length-1,l.length-1),col:Math.min(L.col+(o[0]?.length||1)-1,t.length-1)})};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[L,ne,t,p,y]);const ce=s((e,n,r)=>{const o=e.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;e.preventDefault();const c=ne.map(e=>[...e]);for(let e=0;e<l.length;e++){const o=n+e;for(;c.length<=o;)c.push(Array(t.length).fill(""));for(;c[o].length<t.length;)c[o].push("");for(let n=0;n<l[e].length;n++){const a=r+n;if(a>=t.length)break;t[a].readOnly||(c[o][a]=l[e][n].trim())}}p(y?c:m(c,t.length))},[ne,t,p,y]),ae=s((e,n,r)=>{let o=n,l=r;if("Tab"===e.key)e.preventDefault(),l=e.shiftKey?r-1:r+1,l>=t.length&&(l=0,o=n+1),l<0&&(l=t.length-1,o=n-1);else if("Enter"===e.key)e.preventDefault(),o=e.shiftKey?n-1:n+1;else if("ArrowDown"===e.key)e.preventDefault(),o=n+1;else if("ArrowUp"===e.key)e.preventDefault(),o=n-1;else if("ArrowLeft"===e.key)e.preventDefault(),l=r-1;else{if("ArrowRight"!==e.key){if("Delete"===e.key||"Backspace"===e.key){const o=e.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(e.preventDefault(),re(n,r,"")));if(e.preventDefault(),V&&U){const e=Math.min(V.row,U.row),n=Math.max(V.row,U.row),r=Math.min(V.col,U.col),o=Math.max(V.col,U.col),l=ne.map(e=>[...e]);for(let c=e;c<=n;c++)for(let e=r;e<=o;e++)l[c]&&!t[e]?.readOnly&&(l[c][e]="");p(l)}else re(n,r,"");return}return}e.preventDefault(),l=r+1}for(;l>=0&&l<t.length&&t[l].readOnly;)l+="Tab"===e.key&&e.shiftKey?-1:1;if(o>=0&&o<ne.length&&l>=0&&l<t.length){const e=C.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),S({row:o,col:l}),W(null),B({row:o,col:l}),G({row:o,col:l}))}},[t,ne,ne.length,re,V,U,p]),se=s(e=>{if(!y&&e>=ne.length-2){const e=ne.map(e=>[...e]);for(let n=0;n<5;n++)e.push(Array(t.length).fill(""));p(e)}},[y,ne,t.length,p]),[ie,ue]=c(null);a(()=>{if(!ie)return;const e=()=>ue(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[ie]);const he=s(e=>{const n=ne.map(e=>[...e]);n.splice(e,0,Array(t.length).fill("")),p(n)},[ne,t.length,p]),de=s(e=>{if(ne.length<=1)return;const t=ne.filter((t,n)=>n!==e);p(t)},[ne,p]),we=s(e=>{const t=ne.map(t=>{const n=[...t];return n.splice(e,0,""),n});p(t)},[ne,p]),me=s(e=>{if(t.length<=1)return;const n=ne.map(t=>{const n=[...t];return n.splice(e,1),n});p(n)},[ne,t.length,p]),ge=s((e,t)=>{e.preventDefault(),y||ue({x:e.clientX,y:e.clientY,items:[{label:E.insertRowAbove,onClick:()=>{he(t),ue(null)}},{label:E.insertRowBelow,onClick:()=>{he(t+1),ue(null)}},{label:E.deleteRow(t+1),onClick:()=>{de(t),ue(null)}}]})},[y,he,de,E]),fe=s((e,n)=>{e.preventDefault(),y||ue({x:e.clientX,y:e.clientY,items:[{label:E.insertColumnLeft,onClick:()=>{we(n),ue(null)}},{label:E.insertColumnRight,onClick:()=>{we(n+1),ue(null)}},{label:E.deleteColumn(String(t[n]?.title||n+1)),onClick:()=>{me(n),ue(null)}}]})},[y,t,we,me,E]),pe=e=>$[e]??t[e]?.width??150;a(()=>{const e=e=>{if(!N.current)return;const t=e.clientX-N.current.startX,n=Math.max(40,N.current.startW+t);z(e=>({...e,[N.current.col]:n}))},n=()=>{if(N.current&&b){const e=t.map((e,t)=>({...e,width:$[t]??e.width}));e[N.current.col]={...e[N.current.col],width:$[N.current.col]??t[N.current.col].width},b(e)}N.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n)}},[t,$,b]);const be=e=>A[e]??28;a(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);R(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const ye=s(n=>{const r="12px ui-monospace, SFMono-Regular, Menlo, monospace";if(null===e("",r))return;let o=0;for(const t of ne){const l=String(t[n]??"").replace(/<[^>]*>/g,""),c=e(l,r)??0;c>o&&(o=c)}const l=e(t[n]?.title??"",r)??0;l>o&&(o=l);const c=Math.max(40,Math.ceil(o+24));if(z(e=>({...e,[n]:c})),b){const e=t.map((e,t)=>({...e,width:t===n?c:$[t]??e.width}));b(e)}},[ne,t,$,b]),ve=s(e=>{R(t=>{const n={...t};return delete n[e],n})},[]),xe=s(e=>{const{a:n,e:r}=ee.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;e.row>l?i=e.row:e.row<o&&(s=e.row),e.col>a?h=e.col:e.col<c&&(u=e.col);const d=l-o+1,w=a-c+1,m=ne.map(e=>[...e]);for(;m.length<=i;)m.push(Array(t.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}p(m),B({row:s,col:u}),G({row:i,col:h})},[ne,t.length,p]);a(()=>{const e=e=>{if(!J.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);Q({row:r,col:o})},t=()=>{J.current&&_&&xe(_),J.current=!1,Q(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[_,xe]);const Me=e=>{e.preventDefault(),e.stopPropagation(),J.current=!0,document.body.style.cursor="crosshair"},De=l(null),[ke,Ce]=c(0),[Ee,Le]=c(800);a(()=>{const e=De.current;if(!e)return;const t=()=>Le(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Se=ne.length>100,$e=Se?Math.max(0,Math.floor(ke/28)-20):0,ze=Se?Math.min(ne.length,Math.ceil((ke+Ee)/28)+20):ne.length,Ne=i(()=>ne.slice($e,ze),[ne,$e,ze]),Ae=28*$e,Re=28*(ne.length-ze),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
|
|
3
3
|
return h("div",{ref:De,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:x,height:x},onScroll:e=>Ce(e.target.scrollTop),children:[
|
|
4
4
|
/* @__PURE__ */h("table",{ref:C,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+t.reduce((e,n)=>e+pe(t.indexOf(n)),0)},children:[
|
|
5
5
|
/* @__PURE__ */h("colgroup",{children:[
|
|
6
6
|
/* @__PURE__ */d("col",{style:{width:36}}),t.map((e,t)=>/* @__PURE__ */d("col",{style:{width:pe(t)}},e.key))]}),
|
|
7
7
|
/* @__PURE__ */d("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */h("tr",{children:[
|
|
8
|
-
/* @__PURE__ */d("th",{className:`${n} ${
|
|
9
|
-
return h("th",{className:`${n} ${
|
|
10
|
-
/* @__PURE__ */d("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),
|
|
11
|
-
/* @__PURE__ */h("tbody",{children:[
|
|
8
|
+
/* @__PURE__ */d("th",{className:`${n} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),G({row:ne.length-1,col:t.length-1})},title:E.selectAll,children:"#"}),t.map((e,r)=>{const o=V&&U&&Math.min(V.col,U.col)<=r&&r<=Math.max(V.col,U.col)&&0===Math.min(V.row,U.row)&&Math.max(V.row,U.row)===ne.length-1;/* @__PURE__ */
|
|
9
|
+
return h("th",{className:`${n} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${Y===r?" !bg-blue-100":""}`,style:{width:pe(r)},draggable:!0,onDragStart:()=>(e=>I(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),j(t)})(e,r),onDrop:()=>(e=>{if(null===H||H===e)return I(null),void j(null);const n=ne.map(t=>{const n=[...t],[r]=n.splice(H,1);return n.splice(e,0,r),n});if(p(n),b){const n=[...t],[r]=n.splice(H,1);n.splice(e,0,r),b(n)}I(null),j(null)})(r),onDragEnd:()=>{I(null),j(null)},onClick:e=>{e.shiftKey&&V||B({row:0,col:r}),G({row:ne.length-1,col:r})},onContextMenu:e=>fe(e,r),children:[e.title,
|
|
10
|
+
/* @__PURE__ */d("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),N.current={col:t,startX:e.clientX,startW:pe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:E.resize})]},e.key)})]})}),
|
|
11
|
+
/* @__PURE__ */h("tbody",{children:[Ae>0&&/* @__PURE__ */d("tr",{style:{height:Ae}}),Ne.map((e,n)=>{const r=$e+n,o=V&&U&&Math.min(V.row,U.row)<=r&&r<=Math.max(V.row,U.row)&&0===Math.min(V.col,U.col)&&Math.max(V.col,U.col)===t.length-1;/* @__PURE__ */
|
|
12
12
|
return h("tr",{style:{height:be(r)},children:[
|
|
13
|
-
/* @__PURE__ */h("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${
|
|
14
|
-
/* @__PURE__ */d("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),
|
|
13
|
+
/* @__PURE__ */h("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${P===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),F(t)})(e,r),onDrop:()=>(e=>{if(null===K||K===e)return T(null),void F(null);const t=ne.map(e=>[...e]),[n]=t.splice(K,1);t.splice(e,0,n),p(t),T(null),F(null)})(r),onDragEnd:()=>{T(null),F(null)},onClick:e=>{e.shiftKey&&V||B({row:r,col:0}),G({row:r,col:t.length-1})},onContextMenu:e=>ge(e,r),children:[r+1,
|
|
14
|
+
/* @__PURE__ */d("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:be(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ve(r)},title:E.resize})]}),t.map((t,n)=>{const o=V&&U&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(V,U,r,n),l=X?.row===r&&X?.col===n&&!t.readOnly,c=L?.row===r&&L?.col===n,a=M?.[`${r}:${n}`],s=V&&U?Math.max(V.row,U.row):-1,i=V&&U?Math.max(V.col,U.col):-1,u=V&&U&&r===s&&n===i,w=J.current&&_&&V&&U&&(()=>{const e=Math.min(V.row,U.row),t=Math.max(V.row,U.row),o=Math.min(V.col,U.col),l=Math.max(V.col,U.col);let c=e,a=t,s=o,i=l;return _.row>t?a=_.row:_.row<e&&(c=_.row),_.col>l?i=_.col:_.col<o&&(s=_.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),m="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
|
|
15
15
|
return h("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${t.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){oe(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>le(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:e=>{e.target!==e.currentTarget||t.readOnly||W({row:r,col:n})},children:[
|
|
16
|
-
/* @__PURE__ */d(g,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===t.align?"text-right":"center"===t.align?"text-center":""} ${t.readOnly?"cursor-default":"cursor-cell"} font-mono ${m}${f}`,onMouseDown:e=>oe(e,r,n),onMouseEnter:()=>le(r,n),onDoubleClick:()=>{t.readOnly||W({row:r,col:n})},onFocus:()=>{
|
|
16
|
+
/* @__PURE__ */d(g,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===t.align?"text-right":"center"===t.align?"text-center":""} ${t.readOnly?"cursor-default":"cursor-cell"} font-mono ${m}${f}`,onMouseDown:e=>oe(e,r,n),onMouseEnter:()=>le(r,n),onDoubleClick:()=>{t.readOnly||W({row:r,col:n})},onFocus:()=>{S({row:r,col:n}),Z.current||(B({row:r,col:n}),G({row:r,col:n}))},onBlur:t=>{const o=t.currentTarget.textContent||"";o!==(e[n]||"")&&re(r,n,o),W(null)},onInput:()=>se(r),onPaste:e=>ce(e,r,n),onKeyDown:e=>{if(!(l||t.readOnly||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey))return e.preventDefault(),re(r,n,e.key),q.current={row:r,col:n},void W({row:r,col:n});ae(e,r,n)},text:e[n]||""}),u&&/* @__PURE__ */d("div",{onMouseDown:Me,title:E.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Re>0&&/* @__PURE__ */d("tr",{style:{height:Re}})]})]}),ie&&u(
|
|
17
17
|
/* @__PURE__ */h(w,{children:[
|
|
18
18
|
/* @__PURE__ */d("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ue(null)}),
|
|
19
19
|
/* @__PURE__ */d("div",{className:"fixed z-(--z-popup) bg-surface rounded-lg shadow-lg border border-line py-1 min-w-[160px]",style:{left:ie.x,top:ie.y},children:ie.items.map((e,t)=>/* @__PURE__ */d("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-ink hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{f as EditableGrid,m as withSpareRow};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as n}from"./chunk-
|
|
1
|
+
import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-IUVGHHR3.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,8 +1,8 @@
|
|
|
1
|
-
import{AccessibleTable as t}from"./chunk-
|
|
1
|
+
import{AccessibleTable as t}from"./chunk-ZDFMYAQB.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-IUVGHHR3.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),F=M??$.noFlows,[j,y]=c(null),{highlighted:E}=o(),C=h(u,f,x,$.other),{labels:I,matrix:A,otherIndex:Q,foldedCount:z}=C,H=(t,e)=>A[t]?.[e]??0,V=t=>t===Q?r.muted:a(t),L=C.totals,O=I.map((t,e)=>e).sort((t,e)=>L[e]-L[t]),R=O.reduce((t,e)=>t+L[e],0);if(R<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:F});const U=p/2,W=p/2,Y=p/2-44,B=Y-b,D=g*O.length,P=/* @__PURE__ */new Map;let T=-Math.PI/2;O.forEach((t,e)=>{const o=L[t]/R*(2*Math.PI-D);P.set(t,{start:T,end:T+o,slot:e}),T+=o+g});const Z=/* @__PURE__ */new Map,G=[];for(const t of O)for(const e of O){const o=H(t,e);if(o<=0)continue;const n=P.get(t),r=o/Math.max(1,L[t])*(n.end-n.start),a=Z.get(t)??0;Z.set(t,a+r),G.push({from:t,to:e,value:o,a:n.start+a+r/2,b:P.get(e).start+(P.get(e).end-P.get(e).start)/2})}const S=(t,e)=>[U+e*Math.cos(t),W+e*Math.sin(t)],q="arc"===j?.kind?j.index:void 0,J="ribbon"===j?.kind?G[j.index]:void 0;/* @__PURE__ */
|
|
2
2
|
return m("div",{className:`relative ${v??""}`,children:[
|
|
3
|
-
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(O.length),onMouseLeave:()=>
|
|
4
|
-
return d("path",{d:`M${o},${n} Q${U},${W} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/R*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>
|
|
5
|
-
return m("g",{onMouseEnter:()=>
|
|
3
|
+
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(O.length),onMouseLeave:()=>y(null),children:[G.map((t,e)=>{const[o,n]=S(t.a,B),[r,a]=S(t.b,B),l=V(t.from),i=((t,e)=>j?"ribbon"===j.kind?j.index===e:j.index===t.from||j.index===t.to:null!==E?I[t.from]===E||I[t.to]===E:null)(t,e);/* @__PURE__ */
|
|
4
|
+
return d("path",{d:`M${o},${n} Q${U},${W} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/R*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>y({kind:"ribbon",index:e})},`${I[t.from]}→${I[t.to]}`)}),O.map(t=>{const o=P.get(t),n=(o.start+o.end)/2,[a,l]=S(n,Y+16),i=(t=>j?"arc"===j.kind?j.index===t:G[j.index].from===t||G[j.index].to===t:null!==E?I[t]===E:null)(t);/* @__PURE__ */
|
|
5
|
+
return m("g",{onMouseEnter:()=>y({kind:"arc",index:t}),children:[
|
|
6
6
|
/* @__PURE__ */d("path",{d:e(U,W,B,Y,o.start,o.end),fill:V(t),fillOpacity:null===i||i?1:.45}),
|
|
7
|
-
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:I[t]})]},t)})]}),
|
|
8
|
-
/* @__PURE__ */d(t,{caption:$.chord(O.length),head:[$.tableFrom,$.tableTo,$.value],rows:
|
|
7
|
+
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:I[t]})]},t)})]}),z>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(z)}),void 0!==q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I[q],rows:[{key:"total",label:$.totalFlow,color:V(q),value:N(L[q])}]})}),J&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${I[J.from]} → ${I[J.to]}`,rows:[{key:"value",label:$.flow,color:V(J.from),value:N(J.value)}]})}),
|
|
8
|
+
/* @__PURE__ */d(t,{caption:$.chord(O.length),head:[$.tableFrom,$.tableTo,$.value],rows:G.map(t=>[I[t.from],I[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-
|
|
1
|
+
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-BUFAJJDZ.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{OneLineLabel as o}from"./chunk-TD3ZQD5R.js";import{Tooltip as s}from"./chunk-F2RAIGCG.js";import{useShellStrings as n}from"./chunk-IUVGHHR3.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
|
|
2
2
|
return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
|
|
3
3
|
/* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
4
4
|
/* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useInsideTooltip as e,Tooltip as n}from"./chunk-
|
|
1
|
+
import{useInsideTooltip as e,Tooltip as n}from"./chunk-F2RAIGCG.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i}from"./chunk-WCCS4VFE.js";import{useBrowserLayoutEffect as a}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{glassStyle as c,GLASS_DIVIDER as s}from"./chunk-5FYDNH4Y.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function M(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function T(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),j=d(!1);function D({children:e,style:n,className:a="",onClose:s,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const M=i(),T=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),s?.()},root:p}},[b,x,s]);g(()=>{if(!s)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&s()},t=e=>{"Escape"===e.key&&s()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(s),o=l(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[s,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const j=W(),D=/(^|[\s:])!?z-/.test(a),L=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===j?"py-1":"large"===j?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...D?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...c(),...n},children:/* @__PURE__ */k($.Provider,{value:T,children:e})});return u?M?w(L,document.body):null:L}function L(e,t,n,r=!1,o="kit"){const i=W(),a="tight"===i?"0.25rem":"large"===i?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${"none"===o?"":e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:a,paddingBottom:a,..."normal"===i?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var B=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function R({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&B}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&B})}var H=u(function({onClick:t,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:d,id:u,onMouseEnter:h},f){const g=p($),y=m(),b=null!=s&&!1!==s,w=`${u??y}-label`,N=`${u??y}-note`,C=p(j),E=L(o,i,r),M=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return x("button",{ref:f,id:u,role:"radio"===M?"menuitemradio":"checkbox"===M?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":M?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{t?.(),g&&g.depth>0&&"checkbox"!==M&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:E.className,style:E.style,children:[M&&/* @__PURE__ */k(R,{kind:M,checked:!!l}),b?
|
|
4
|
+
/* @__PURE__ */x("span",{className:"block min-w-0 flex-1 py-2",children:[
|
|
5
|
+
/* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(P,{children:c}),
|
|
6
|
+
/* @__PURE__ */k("span",{id:w,className:"min-w-0",children:n})]}),
|
|
7
|
+
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(P,{children:c}),n]})]})});function P({children:e}){/* @__PURE__ */
|
|
8
|
+
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var F=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function A(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function S(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:s=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),j=h(),D=h(!1),B=`${N}-menu`;g(()=>()=>clearTimeout(j.current),[]);const R=f?.depth??0,H=f?.path[R],P=!!H&&H.key===N&&!o,I=b(e=>{if(!f||o||!C.current)return;clearTimeout(j.current),D.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=R>0&&(f.path[R-1]?.flipped??!1),a=T(r.left,r.right,s,window.innerWidth,4,i);f.open(R,{key:N,y:t.top,...a})},[f,o,R,N,s]),z=e=>{f?.closeBelow(R),C.current?.focus()};g(()=>{if(P)return l(e=>"Escape"===e.key&&(!(f&&f.path.length>R+1)&&(z(),!0)),()=>E.current)}),a(()=>{if(!P||!H)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=R>0&&(f?.path[R-1]?.flipped??!1),o=e.offsetWidth||s,i=T(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=M(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{P&&D.current&&(D.current=!1,S(E.current)[0]?.focus())},[P]);const U=y(()=>f&&{...f,depth:R+1},[f,R]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=L(!1,o,i,P),V=W();/* @__PURE__ */
|
|
9
|
+
return x(v,{children:[
|
|
10
|
+
/* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-controls":P?B:void 0,disabled:o,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;P?t&&S(E.current)[0]?.focus():I(t)},...u,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),I(!0))},onMouseEnter:()=>{u?.onMouseEnter?.(),o||(f.cancelClose(),P?f.closeBelow(R+1):(clearTimeout(j.current),j.current=setTimeout(()=>I(!1),120)))},onMouseLeave:()=>{clearTimeout(j.current),f.scheduleClose(R)},children:[n,
|
|
11
|
+
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),F]}),P&&w(
|
|
12
|
+
/* @__PURE__ */k("div",{ref:E,id:B,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===V?"py-1":"large"===V?"py-2":"py-1"),style:{left:H.left,top:H.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:A(f.root.current)+R+1,animation:(H.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...c()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=S(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),z())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(j.current)},onMouseLeave:()=>f.scheduleClose(R+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function z(){const e=W();/* @__PURE__ */
|
|
13
|
+
return k("div",{className:`border-t ${s} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function U(){const e=W(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function q({children:e}){/* @__PURE__ */
|
|
14
|
+
return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function V({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
15
|
+
return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{R as MenuCheckMark,V as MenuIcon,j as MenuSemanticsContext,D as PopupMenu,z as PopupMenuDivider,H as PopupMenuItem,q as PopupMenuLabel,I as PopupSubmenu,M as clampMenuTop,C as closeMenuBelow,L as itemLook,T as menuPanelLeft,U as menuTextRowStyle,N as openMenuLevel,E as resolveMenuLevels};
|
|
@@ -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-F2RAIGCG.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,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...
|
|
3
|
-
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-YWMCW5BN.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-VFSAJMNX.js";import{ColoredBadge as u}from"./chunk-WRV6QKJN.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-F2RAIGCG.js";import{useShellStrings as h}from"./chunk-IUVGHHR3.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:C,dropType:T,onDropData:A,label:I,hint:F,error:S,required:O,className:P,accept:R="image/*",maxSizeBytes:z,maxFiles:L,fit:M="cover",thumbSize:$=96,placeholder:E,cta:H,acceptHint:W,showCover:B=!1,coverLabel:V,busy:G=!1,busyLabel:Q,progress:q,disabled:J=!1,readOnly:U=!1,selected:Y,onItemClick:X,onItemDoubleClick:Z,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=H??te.cta,ae=V??te.cover,ne=Q??te.uploading,le=g(),[ie,oe]=b(null),se=J||G,de=!(!k&&!N||se||U),ce=!!w&&!se&&!U,ue=!!j&&!se&&!U,me=!!K&&!J&&!ue,pe=!(!T||!A||se||U),fe=t(se),he=E??r(R,te),ge=d({accept:R,maxSizeBytes:z,maxFiles:L,acceptHint:W,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(T),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(T);t&&A(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Ke=null==Y?null:new Set(Y),Ce=!!X,Te=$<112,Ae=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,R),a=e.name??o(e.url),n=B&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||X(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Z?()=>Z(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);C?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&C?t=>C("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Ce?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),X(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:M}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:M}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
|
+
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Te?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
5
|
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ie=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Fe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),W&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:W})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:
|
|
11
|
-
return v(e,{label:I,labelId:I?`${le}-label`:void 0,htmlFor:le,hint:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":I?`${le}-label`:void 0,"aria-describedby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),W&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:W})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:G?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:I,labelId:I?`${le}-label`:void 0,htmlFor:le,hint:F,error:S,required:O,className:P,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":I?`${le}-label`:void 0,"aria-describedby":S?`${le}-error`:F?`${le}-hint`:void 0,"aria-busy":G||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Fe:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof I?I:te.files,className:"contents",children:p.map(Ae)}):p.map(Ae),Ie]}),G&&/* @__PURE__ */x(l,{label:ne,progress:q})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-5HFKVEWW.js";import{
|
|
1
|
+
import{CountBadge as e}from"./chunk-5HFKVEWW.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as n,SettingAutoContext as a}from"./chunk-2NMW66P5.js";import{useShellStrings as t}from"./chunk-IUVGHHR3.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:W,className:H=""}){const V=t();if(!i(j,P,W))return null;const A="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:V.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
|
|
2
2
|
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
|
|
3
|
-
/* @__PURE__ */s("span",{className:"sr-only",children:V.settingView.edited})]}):null,F=null!=f&&!1!==f;if("compact"===k){const e=m(u),
|
|
4
|
-
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),A]}),y=e=>/* @__PURE__ */s(
|
|
3
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:V.settingView.edited})]}):null,F=null!=f&&!1!==f;if("compact"===k){const e=m(u),i=m(h);if(!e&&!i)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),H&&c.push(H);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
|
|
4
|
+
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),A]}),y=e=>/* @__PURE__ */s(n.Provider,{value:t,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
|
|
5
5
|
return r("div",{className:c.join(" "),children:[
|
|
6
|
-
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),F&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),
|
|
6
|
+
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),F&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),i&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const I=c,T=void 0!==u||void 0===N&&null==h,q=null==u||""===u,z=y?"text-gray-500":"text-gray-800",B=q?"text-gray-400":y?"text-gray-500":"text-gray-900",C=`${I.text} font-medium ${z}`,E=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:C,children:l}):/* @__PURE__ */s("span",{id:g,className:C,children:l}),G=/* @__PURE__ */s(n.Provider,{value:g,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:q?b:u})}),K=[$?"border-t border-line-subtle first:border-t-0":"",I.pad,H].filter(Boolean).join(" "),L=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:N});/* @__PURE__ */
|
|
7
7
|
return r("div",F?{className:K,children:[
|
|
8
8
|
/* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
|
|
9
9
|
/* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${z}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),E,A]})}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(F.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:z,step:k=1,shiftStep:N,precision:
|
|
3
|
-
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:k,value:de,disabled:V,"aria-label":
|
|
4
|
-
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:$&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-FKMARSJZ.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var F=o(null);function z({children:e}){const[t,n]=l({}),r=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
|
|
2
|
+
return f(F.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:z,step:k=1,shiftStep:N,precision:R,inputMin:L,inputMax:j,suffix:C,units:E,onCommit:$,showInput:K=!0,emptyLabel:M,placeholderValue:A,stepFrom:B,label:W,"aria-labelledby":D,valueText:H,id:O,disabled:V,size:q="md",boxSize:I="sm",className:P="",auto:U}){const G=i(),T=u(),Y=s(o);r(()=>{Y.current=o},[o]);const Z=s(o),J=e=>{Y.current=e,a(e)},X=()=>{Z.current=Y.current},Q=()=>{$&&Y.current!==Z.current&&(Z.current=Y.current,$(Y.current))},_=s(null),ee=s(Q);ee.current=Q;const te=Boolean($);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=U??ne,ie=u(),oe=O??T,le=R??h(k),ae=L??y,ue=j??z,se=void 0!==M||void 0!==A,ce=B??A,de=p(o??A??y,y,z),fe=[y.toFixed(le),z.toFixed(le),o?.toFixed(le),M,A?.toFixed(le)],me=null!=o?o.toFixed(le):M||(null!=A?A.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(C);r(()=>{if(!K)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,K,I]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>H?H(e):"string"==typeof C?`${e.toFixed(le)} ${C}`:void 0,we=null==o?M??(null!=A?ye(A)??String(A):void 0):ye(o),Se=x[I],Fe=fe.filter(e=>Boolean(e)),ze=void 0===me?-1:Fe.indexOf(me),ke=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,Ne=d(F),Re=u(),Le=Ne?.set;return r(()=>{Le&&Le(Re,K?ke:null)},[Le,Re,ke,K]),c(()=>()=>Le?.(Re,null),[Le,Re]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${P}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:k,value:de,disabled:V,"aria-label":D?void 0:W,"aria-labelledby":D,"aria-valuetext":we,"aria-describedby":re?ie:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const n=e.shiftKey&&null!=N;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();J(S((o??ce??de)+t*(n?N??k:k),y,z,le)),Q()},ref:_,onFocus:$&&X,onPointerDown:$&&X,onChange:e=>J(S(Number(e.target.value),y,z,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===q?"h-1":"h-1.5")}),K&&
|
|
4
|
+
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:$&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&Q()}),onFocus:$&&X,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:Ne?.width??ke,...xe?{fontSize:xe.fontSize}:{}},children:[
|
|
5
5
|
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:Fe.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===ze?"":void 0,style:g,children:e},t))}),
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||J(e):se&&J(null)},min:ae,max:ue,step:k,shiftStep:N,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:C,units:E,onBlur:$&&Q,disabled:V,placeholder:M??(null!=A?A.toFixed(le):void 0),size:I,auto:re,"aria-label":W?G.slider.value(W):void 0,"aria-labelledby":W?void 0:D})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:G.settingView.auto})]})}export{k as Slider,z as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isAriaDisabled as e,swallowPress as a,describedByWith as r,OffWithReason as i}from"./chunk-
|
|
2
|
-
/* @__PURE__ */c("span",{id:Y,className:"text-xs text-red-600",children:N})]}):
|
|
1
|
+
import{isAriaDisabled as e,swallowPress as a,describedByWith as r,OffWithReason as i}from"./chunk-BUFAJJDZ.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,...w},z){const C=n(),F=u||m,I=null!=N&&""!==N,J=F&&I,R=!F&&e(g),U=R&&I,Y=J||U?C:void 0,Z=/* @__PURE__ */t("button",{ref:z,type:h,disabled:F,"aria-busy":m||void 0,"aria-disabled":!!R||g,"aria-describedby":r(j,Y),onClick:R?a:y,className:l({variant:d,size:o,block:f,pressed:v??(!0===w["aria-pressed"]||"true"===w["aria-pressed"]),className:x}),...w,children:[m?/* @__PURE__ */c(s,{className:"h-3.5 w-3.5",ink:""}):p,k,!m&&b]});return U?/* @__PURE__ */c(i,{reason:N,id:C,block:f,children:Z}):J?/* @__PURE__ */t("span",{className:f?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[Z,
|
|
2
|
+
/* @__PURE__ */c("span",{id:Y,className:"text-xs text-red-600",children:N})]}):Z});export{o as Button_default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as l,usePopupLevel as t,usePopupLevelBindings as i,windowScrimStyle as a,OverlayLayerProvider as o,scrimHasCorners as n,CloseButton as s,popupLayerStyle as d,POPUP_GUTTER as c}from"./chunk-SF4IIV5Z.js";import{useDiscardGuard as m}from"./chunk-FRCTA5FS.js";import{dialogA11y as p}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as u}from"./chunk-UVHXVSB2.js";import{useFocusTrap as f,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as x,DESCRIPTION_TEXT as v,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{useHydrated as w}from"./chunk-WCCS4VFE.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as $}from"./chunk-IUVGHHR3.js";import{useRef as g,useId as N,useState as j,useEffect as k}from"react";import{createPortal as C}from"react-dom";import{jsxs as V,Fragment as W,jsx as F}from"react/jsx-runtime";var H=`calc(100% - ${2*c}px)`,U="grid grid-cols-[minmax(0,1fr)_auto]",B="bg-black/30 backdrop-blur-sm",I={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl",full:"max-w-none"};function S({open:c,onClose:S,title:T,description:Z,role:A="dialog",children:D,footer:E,headerActions:G,blocking:_=!1,size:R="md",aside:Y=!1,dirty:z=!1,initialFocus:J,"aria-label":O,"aria-labelledby":Q,"aria-describedby":X,className:q=""}){const K=g(null),L=N(),M=N(),P=!_,ee="full"===R,re=ee||null!=G,le=Boolean(T||Z),te=N();$().dialog;const ie=e(w()),[ae,oe]=j(null),ne=m({open:c,dirty:z,onClose:S,title:T,layer:ae}),se=g(null),de=r(c&&null!==ie,se),ce=l(de,K),me=t(c&&null!==ie,se),pe=i(me,ae),ue=a(me),fe=null!==me.host;if(u(c),f(K,c&&null!==ie,J,pe),h(c),k(()=>{if(c)return y(()=>!pe.current?.(document.activeElement)&&(_||ne(),!0),()=>K.current)},[c,_,ne,pe]),!c||!ie)return null;/* @__PURE__ */
|
|
2
|
+
return V(W,{children:[/* @__PURE__ */F("span",{ref:se,hidden:!0,"data-popup-anchor":""}),C(
|
|
3
|
+
/* @__PURE__ */F(o,{value:ae,children:/* @__PURE__ */V("div",{ref:oe,className:"fixed inset-0"+(Y?" pointer-events-none opacity-0":fe?" pointer-events-none":""),style:d(me),role:"presentation","data-overlay-layer":"","data-aside":Y?"":void 0,children:[!fe&&/* @__PURE__ */F("div",{className:`fixed inset-0 ${B}`,"aria-hidden":"true","data-popup-scrim":"system"}),ue&&/* @__PURE__ */F("div",{className:`fixed ${B}${Y?"":" pointer-events-auto"}${n(me)?" rounded-(--radius-window)":""}`,style:ue,onClick:_?void 0:ne,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
+
/* @__PURE__ */F("div",{className:de?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:_||fe?void 0:e=>{e.target===e.currentTarget&&ne()},children:/* @__PURE__ */V("div",{ref:K,"data-popup-panel":"",style:de?{left:ce?.left??0,top:ce?.top??0,visibility:ce?void 0:"hidden",width:H,[ee?"height":"maxHeight"]:H}:void 0,...p({role:A,modal:!0,titleId:T?te:void 0,labelledBy:Q,label:O}),"aria-describedby":X??(Z?M:D?L:void 0),className:(ee?`${de?"absolute":"relative h-full w-full max-h-full"} ${I[R]} ${U} grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-(--radius-popup) ${b}`:`${de?"absolute":"relative max-h-full w-full"} ${I[R]}${re?` ${U} content-start gap-x-2`:""} overflow-y-auto overscroll-contain rounded-(--radius-card) ${b} p-6`)+`${fe&&!Y?" pointer-events-auto":""} ${q}`.trimEnd(),children:[ee?le&&
|
|
5
|
+
/* @__PURE__ */V("div",{className:"col-start-1 row-start-1 flex min-h-(--row-height-window-bar) flex-col justify-center border-b border-line py-2 pl-6 pr-4",children:[T&&/* @__PURE__ */F("h2",{id:te,className:x,children:T}),Z&&/* @__PURE__ */F("p",{id:M,className:`${T?"mt-1 ":""}${v}`,children:Z})]}):T&&/* @__PURE__ */F("h2",{id:te,className:`${re?"col-start-1 row-start-1 ":P?"pr-8 ":""}${x}`,children:T}),!ee&&Z&&/* @__PURE__ */F("p",{id:M,className:`${re?"col-start-1 ":""}${T?"mt-1":P&&!re?"pr-8":""} ${v}`.trim(),children:Z}),D&&/* @__PURE__ */F("div",{id:L,className:ee?"col-span-2 row-start-2 min-h-0 overflow-auto":(re?"col-span-2 ":"")+"mt-2 text-sm text-gray-600",children:D}),E&&/* @__PURE__ */F("div",{className:ee?"col-span-2 row-start-3 flex flex-wrap justify-end gap-3 border-t border-line px-6 py-4":(re?"col-span-2 ":"")+"mt-6 flex flex-wrap justify-end gap-3",children:E}),re?
|
|
6
|
+
/* @__PURE__ */V("div",{className:"col-start-2 row-start-1 flex items-center gap-1 "+(ee?(le?"border-b border-line ":"")+"pr-3":"-mr-3 -mt-3 self-start"),children:[G,P&&/* @__PURE__ */F(s,{onClose:ne})]}):P&&/* @__PURE__ */F(s,{onClose:ne,className:"absolute right-3 top-3"})]})})]})}),ie)]})}export{S as Dialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dismissPopups as o}from"./chunk-PGN5ME7B.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";function m(m){r(()=>{m&&o()},[m])}export{m as useDismissPopupsOnOpen};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-VQBKRBBR.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-THAPVKEJ.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as c}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:A=!0}){const D=s(null),L=a(),[j,S]=d(null),U=s(w);U.current=w,c(()=>{const e=D.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),R=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!D.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!R.current&&A&&(R.current=!0,h(D.current)[0]?.focus({preventScroll:!0}))},[j,A]),m(()=>{if(A)return;const e=e=>{if(D.current?.contains(document.activeElement))return;const t=h(D.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>D.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const Y=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(D.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:D,id:L,role:"menu","aria-label":b,"aria-describedby":y?t(y,L):void 0,"data-context-menu":"",onKeyDown:Y,children:[y&&e(y,{menuId:L,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-THAPVKEJ.js";import{jsx as r,jsxs as d}from"react/jsx-runtime";var s=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,o=(e,t)=>`${e}-status-${t}`;function c(e,t){return e.flatMap((e,i)=>"status"===e.type?[o(t,i)]:[]).join(" ")||void 0}var b={minHeight:"var(--space-32)",paddingTop:0,paddingBottom:0,paddingLeft:"var(--space-12)",paddingRight:"var(--space-12)"};function u(s,c){const{menuId:y,choose:m,toggle:p,followLink:h,rowProps:k=()=>({}),linkAs:f}=c,g=f??"a",v=(s,f)=>{if("divider"===s.type)/* @__PURE__ */
|
|
2
2
|
return r("div",{role:"separator",children:/* @__PURE__ */r(e,{})},s.key);if("label"===s.type)/* @__PURE__ */
|
|
3
3
|
return r("div",{id:`${y}-label-${f}`,children:/* @__PURE__ */r(t,{children:s.label})},s.key);if("status"===s.type)/* @__PURE__ */
|
|
4
4
|
return r("div",{id:o(y,f),className:"text-xs",style:i(),children:s.label},s.key);if("submenu"===s.type)/* @__PURE__ */
|