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
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{MediaUploadField as e}from"./chunk-
|
|
2
|
-
return n("section",{"aria-label":
|
|
1
|
+
import{MediaUploadField as e}from"./chunk-IUQJGFEO.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useShellStrings as t}from"./chunk-IUVGHHR3.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[U,L]=l(null),[R,I]=l(""),[H,O]=l(""),[C,E]=l(!1),[F,G]=l(!1),A=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),S=t().brandAsset,B=R||d||g||"",P=U?null:d?o:h,$=U?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const z=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
|
|
2
|
+
return n("section",{"aria-label":S.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
4
|
-
/* @__PURE__ */c(e,{value:
|
|
4
|
+
/* @__PURE__ */c(e,{value:B,onChange:()=>{},onFile:e=>{if(k)return;z();const r=URL.createObjectURL(e);j.current=r,L(e),I(r),O("")},label:p,hint:H||S.usedFor(b),error:H||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:C||F,disabled:k}),
|
|
5
5
|
/* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
6
|
-
/* @__PURE__ */c(a,{onClick:async()=>{if(
|
|
7
|
-
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:
|
|
8
|
-
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:
|
|
6
|
+
/* @__PURE__ */c(a,{onClick:async()=>{if(U&&!k&&!C){E(!0),O("");try{await x(U),z(),L(null),I("")}catch(e){O(e instanceof Error?e.message:S.saveFailed(A,p))}finally{E(!1)}}},disabled:!U||k,loading:C,children:S.save(A,p)}),(U||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!F){if(U)return z(),L(null),I(""),void O("");if(d){G(!0),O("");try{await f()}catch(e){O(e instanceof Error?e.message:S.removeFailed(A,p))}finally{G(!1)}}}},disabled:k,loading:F,children:U?S.discard:S.remove(A,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":S.previews(p),children:[
|
|
7
|
+
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:S.preview}),
|
|
8
|
+
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:B,alt:S.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:$,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
9
9
|
return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
10
10
|
/* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
11
11
|
/* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t="text-base font-semibold text-ink-strongest",e="text-sm text-ink-faint",a="bg-surface shadow-(--elevation-dialog)";export{e as DESCRIPTION_TEXT,t as HEADING_TEXT,a as PANEL_SURFACE};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-IUVGHHR3.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,F]=u(null),{highlighted:I}=r(),A=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",A),0===A.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const C=Math.max(...A.map(e=>e.depth))+1,E=f/2,H=f/2,L=(f/2-8-b)/C,Q=A.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),R=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,V=e=>null!==w?e.id===w:null===I||e.branchKey===I,z=w?A.find(e=>e.id===w):void 0,B=e=>c(e.value/Q*100,1,$);/* @__PURE__ */
|
|
2
|
+
return d("div",{className:`relative ${g??""}`,children:[
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(Q),C),onMouseLeave:()=>F(null),children:[A.map(e=>/* @__PURE__ */s("path",{d:t(E,H,b+e.depth*L+v/2,b+(e.depth+1)*L-v/2,e.start,e.end),fill:R(e),fillOpacity:V(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>F(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:E,y:H+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),z&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:z.label,rows:[{key:"value",label:M.value,color:R(z),value:j(z.value)},{key:"share",label:M.share,color:a.muted,value:B(z)}]})}),
|
|
4
|
+
/* @__PURE__ */s(e,{caption:M.sunburst(j(Q),C),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:A.map(e=>[e.depth+1,e.label,j(e.value),B(e)])})]})}export{f as SunburstChart};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-SXHV5OLA.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-WCCS4VFE.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),C=c(null),I=c(l);I.current=l,s(()=>{if(j&&d)return j.report(S,()=>I.current,C.current)},[j,d,S]);const L=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
5
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
-
return m("button",1===k?{ref:
|
|
6
|
+
return m("button",1===k?{ref:C,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:L})}:{ref:C,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:L})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useDefaultColumnConfig as e}from"./chunk-ULJQYXHB.js";import{useShellPrefs as t}from"./chunk-
|
|
1
|
+
import{useDefaultColumnConfig as e}from"./chunk-ULJQYXHB.js";import{useShellPrefs as t}from"./chunk-DPFEQQQU.js";import{useState as n,useRef as r,useCallback as i,useEffect as d}from"react";function l(e,t){return e.length===t.length&&e.every((e,n)=>e.key===t[n].key&&e.width===t[n].width&&!!e.hidden==!!t[n].hidden)}function o(e){const t=e.findIndex(e=>"_select"===e.key);if(t>=0){const[n]=e.splice(t,1);n.hidden=!1,e.unshift(n)}return e}function u(u,c){const{prefs:s,save:a}=t(),f=`columns_${u}`,y=s[f],{defaultConfig:h}=e(u),[k,m]=n(()=>{const e="undefined"==typeof window?null:localStorage.getItem(`col-config-${u}`);if(e)try{const t=JSON.parse(e),n=new Set(t.map(e=>e.key));return o([...t.filter(e=>c.some(t=>t.key===e.key)),...c.filter(e=>!n.has(e.key)).map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden}))])}catch{}return o(c.map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden})))}),[p,g]=n(null),[w,v]=n(null),S=r(null),x=r(!1),I=r(y);I.current=y;const W=r(null),D=r(a);D.current=a;const A=i(e=>{x.current=!0,localStorage.setItem(`col-config-${u}`,JSON.stringify(e)),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{D.current({[f]:e})},1e3)},[u,f]);d(()=>{if(x.current||!Array.isArray(y))return;const e=new Set(y.map(e=>e.key)),t=o([...y.filter(e=>c.some(t=>t.key===e.key)).map(e=>({...e})),...c.filter(t=>!e.has(t.key)).map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden}))]);m(e=>l(e,t)?e:t),localStorage.setItem(`col-config-${u}`,JSON.stringify(t))},[u,y]),d(()=>{if(x.current||Array.isArray(I.current))return;const e=h?.visible_columns;if(!Array.isArray(e)||0===e.length)return;const t=new Set(e),n=o(c.map(e=>({key:e.key,width:e.defaultWidth||150,hidden:!t.has(e.key)})));m(e=>l(e,n)?e:n),localStorage.setItem(`col-config-${u}`,JSON.stringify(n))},[u,h]);const C=r(/* @__PURE__ */new Map);d(()=>{m(e=>function(e,t,n){const r=new Set(t.map(e=>e.key)),i=new Set(e.map(e=>e.key)),d=t.filter(e=>!i.has(e.key)),l=e.filter(e=>"_select"===e.key||r.has(e.key));if(!d.length&&l.length===e.length)return e;for(const t of e)"_select"===t.key||r.has(t.key)||n.set(t.key,t);const u=[...l];for(const e of d){let r=-1;for(let n=t.indexOf(e)-1;n>=0;n-=1){const e=u.findIndex(e=>e.key===t[n].key);if(e>=0){r=e;break}}u.splice(r+1,0,n.get(e.key)??{key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden}),n.delete(e.key)}return o(u)}(e,c,C.current))},[c]);const E=k.filter(e=>!e.hidden),H=i((e,t)=>{t.preventDefault(),t.stopPropagation();const n=E[e],r=k.findIndex(e=>e.key===n.key),i=c.find(e=>e.key===k[r].key)?.minWidth??0;S.current={idx:r,startX:t.clientX,startWidth:Math.max(k[r].width,i)};const d=e=>{if(!S.current)return;const{idx:t,startX:n,startWidth:r}=S.current,i=c.find(e=>e.key===k[t].key)?.minWidth||30,d=Math.max(i,r+e.clientX-n);m(e=>{const n=[...e];return n[t]={...n[t],width:d},n})},l=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",l),S.current=null,m(e=>(A(e),e))};document.addEventListener("mousemove",d),document.addEventListener("mouseup",l)},[k,E,c,A]),O=i(e=>{g(e)},[]),X=i((e,t)=>{if(t.preventDefault(),null===p)return;const n=t.currentTarget.getBoundingClientRect();let r=t.clientX<n.left+n.width/2?e:e+1;const i=k.filter(e=>!e.hidden);"_select"===i[0]?.key&&0===r&&(r=1),v(r)},[p,k]),_=i((e,t)=>(t.preventDefault(),null===p||null===w||w===p||w===p+1?(g(null),void v(null)):(m(e=>{const t=e.filter(e=>!e.hidden),n=t[p];if(!n)return e;const r=e.findIndex(e=>e.key===n.key);let i;i=w<t.length?e.findIndex(e=>e.key===t[w].key):e.findIndex(e=>e.key===t[t.length-1].key)+1;const d=[...e],[l]=d.splice(r,1);return d.splice(i>r?i-1:i,0,l),A(d),d}),g(null),void v(null))),[p,w,A]),J=i(()=>{g(null),v(null)},[]),L=i(e=>{m(t=>{const n=t.map(t=>t.key===e?{...t,hidden:!t.hidden}:t);return 0===n.filter(e=>!e.hidden).length?t:(A(n),n)})},[A]),$=i(()=>{const e=o(c.map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden})));m(e),A(e)},[c,A]);return{orderedColumns:E.map(e=>{const t=c.find(t=>t.key===e.key);return{...t,width:Math.max(e.width,t?.minWidth??0)}}).filter(Boolean),allColumns:k.map(e=>{const t=c.find(t=>t.key===e.key);return{key:e.key,label:t?.label||e.key,hidden:!!e.hidden}}),onResizeStart:H,onDragStart:O,onDragOver:X,onDrop:_,onDragEnd:J,toggleColumn:L,resetColumns:$,draggedIdx:p,dropGap:w}}export{u as useColumnConfig};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{Pagination as e}from"./chunk-223XYIIH.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-
|
|
1
|
+
import{Pagination as e}from"./chunk-223XYIIH.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-TD3ZQD5R.js";import{useBrowserLayoutEffect as l}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as s}from"./chunk-IUVGHHR3.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
|
|
2
2
|
return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
3
3
|
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
|
|
4
|
-
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:
|
|
5
|
-
return h("th",{scope:"col",...
|
|
4
|
+
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:H,rowClassName:z,onRow:I,rowHref:R,onRowPress:T,linkAs:D,emptyText:A,selection:E,footer:F,virtualized:L,stackOnNarrow:O=!1,stackBelow:P,className:Z=""}){const K=s(),W=A??K.table.empty,Y=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),G=O&&!L,V=G?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),X=e=>G?{role:e}:{},Q=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[U,q]=i(0),J=L?.overscan??6,_=L?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/L.rowHeight)-J);q(e=>e===t?e:t)}:void 0,ee=L?Math.ceil(L.height/L.rowHeight)+2*J:v.length,te=L?Math.min(U,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=L?te*L.rowHeight:0,ne=L?(v.length-re)*L.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!L)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=V.flatMap(e=>m(e)?e.columns:[e]),he=V.some(m),ue=/* @__PURE__ */new Map;if(G)for(const e of V)if(m(e))for(const t of e.columns)ue.set(t,Q(e.title,e.label));const me=e=>{const t=Q(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(E?.selected??[]),ge=E?v.map((e,t)=>Y(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=E?36:0,we=de.length+(E?1:0),xe=de.some(e=>"left"===e.fixed),ve=G&&!E&&de.some(e=>e.cardCorner),ke=D??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
|
|
5
|
+
return h("th",{scope:"col",...X("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...L?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",a?L?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":L?"sticky z-10 bg-gray-50":"",G&&d?"rosh-dt-sort":"",G?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":G?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
|
|
6
6
|
/* @__PURE__ */h(n,{children:e.title}),
|
|
7
|
-
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),
|
|
8
|
-
/* @__PURE__ */c("div",{onScroll:_,style:L?{maxHeight:L.height}:void 0,className:`relative overflow-x-auto ${L?"overflow-y-auto":""} ${
|
|
7
|
+
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
|
|
8
|
+
/* @__PURE__ */c("div",{onScroll:_,style:L?{maxHeight:L.height}:void 0,className:`relative overflow-x-auto ${L?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${G?" rosh-dt-scroll":""}`.trim(),children:[B&&
|
|
9
9
|
/* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
10
10
|
/* @__PURE__ */h(r,{className:"h-6 w-6"}),
|
|
11
11
|
/* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
|
|
12
|
-
/* @__PURE__ */c("table",{...
|
|
13
|
-
/* @__PURE__ */c("thead",{...
|
|
14
|
-
/* @__PURE__ */c("tr",{ref:le,...
|
|
15
|
-
/* @__PURE__ */h("tbody",{...
|
|
16
|
-
return c("tr",{...u(n),...
|
|
17
|
-
return h("td",{...
|
|
18
|
-
return h("td",{...
|
|
19
|
-
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},
|
|
20
|
-
return h("div",
|
|
12
|
+
/* @__PURE__ */c("table",{...X("table"),className:(G?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:H?{minWidth:H}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
|
+
/* @__PURE__ */c("thead",{...X("rowgroup"),className:G?"rosh-dt-head":void 0,children:[
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...X("row"),className:"border-b border-gray-200 bg-gray-50",children:[E&&/* @__PURE__ */h("th",{scope:"col",...X("columnheader"),rowSpan:he?2:void 0,style:{width:36,...L?{top:0}:{}},className:[Ne,o,xe||L?"sticky z-20 bg-gray-50":"",xe?"left-0":"",G?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!E)return;const e=new Set(ge);E.onChange(pe?E.selected.filter(t=>!e.has(t)):[...E.selected,...ge.filter(e=>!fe.has(e))])}})}),V.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...X("columnheader"),colSpan:e.columns.length,style:L?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",L?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...X("row"),className:"border-b border-gray-200 bg-gray-50",children:V.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
|
+
/* @__PURE__ */h("tbody",{...X("rowgroup"),className:G?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=I?.(e,o),l=!!n?.current,s=R?.(e,o),i=void 0===s&&T?()=>T(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
|
+
return c("tr",{...u(n),...X("row"),style:L?{height:L.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[G?E?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",G&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",z?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[E&&(()=>{const r=Y(e,o);/* @__PURE__ */
|
|
17
|
+
return h("td",{...X("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",G?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{E&&E.onChange(fe.has(e)?E.selected.filter(t=>t!==e):[...E.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=G&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
18
|
+
return h("td",{...X("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",G?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],G?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:G?
|
|
19
|
+
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},Y(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...X("row"),className:G?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...X("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:W})})})]}),F]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:G?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
|
|
20
|
+
return h("div",G?void 0!==P&&P>0&&40!==P?{className:`rosh-dt-at ${Z}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/P*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:P/40*100+"%"},children:Se})})}:{className:`rosh-dt-stack ${Z}`.trim(),children:Se}:{className:Z,children:Se})}export{x as DataTable};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useBrowserState as r}from"./chunk-
|
|
1
|
+
import{useBrowserState as r}from"./chunk-WCCS4VFE.js";import{createContext as t,useCallback as e,useContext as n,useMemo as c}from"react";import{jsx as o}from"react/jsx-runtime";var s=t(null);function a({value:r,children:t}){/* @__PURE__ */
|
|
2
2
|
return o(s.Provider,{value:r,children:t})}function u(t="react-os-shell:prefs",n){const[c,o]=r(()=>{try{const r=JSON.parse(localStorage.getItem(t)||"{}");return{...n??{},...r}}catch{return{...n??{}}}},{...n??{}});return{prefs:c,save:e(r=>{o(e=>{const n={...e,...r};try{localStorage.setItem(t,JSON.stringify(n))}catch{}return n})},[t])}}var f={prefs:{},save:()=>{}};function i(){return n(s)??f}function l(){const{prefs:r,save:t}=i(),n=e(r=>{const e=t(r);return e&&"function"==typeof e.then?e.catch(()=>{}):e},[t]);return c(()=>({prefs:r,save:n}),[r,n])}export{a as ShellPrefsProvider,u as useLocalStoragePrefs,l as useShellPrefs,i as useShellPrefsAdapter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-UTISUEO4.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useShellStrings as r}from"./chunk-IUVGHHR3.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
|
|
2
2
|
return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
|
|
3
3
|
/* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
|
|
4
4
|
/* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as n}from"./chunk-BG3C4ALM.js";import{ItemCount as t}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as n}from"./chunk-BG3C4ALM.js";import{ItemCount as t}from"./chunk-SXHV5OLA.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-THAPVKEJ.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useShellStrings as a}from"./chunk-IUVGHHR3.js";import{useState as s,useMemo as d,useEffect as c,useRef as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as g}from"react/jsx-runtime";function h(e){const n=[];let t=0;for(;t<e.length;){const r=e[t].group;let i=t;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;n.push(i>t?{group:r,start:t,end:i}:{start:t,end:t}),t=i+1}return n}function k(e,n){return e.find(e=>n>=e.start&&n<=e.end)}function b(e,n,t,r){const i=e.findIndex(e=>e.key===n.key);let l=e.findIndex(e=>e.key===t);if(i<0||l<0)return null;const o=h(e),a=k(o,i),s="group"===n.kind&&void 0!==a.group?e.slice(a.start,a.end+1).map(e=>e.key):[n.key];if(s.includes(t))return null;const d=k(o,l);if("tab"===n.kind&&void 0!==a.group){if(d!==a)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,n,t,r){const i=b(e,n,t,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),o=l.indexOf(i.key)+("after"===i.side?1:0),a=[...l.slice(0,o),...i.moving,...l.slice(o)];return a.every((n,t)=>n===e[t].key)?null:a}var v="flex-[0_100_15rem] [contain-intrinsic-inline-size:15rem]",N=v,w="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500",C="pointer-events-none absolute bottom-0 size-2 [background:inherit]";function $(){/* @__PURE__ */
|
|
2
2
|
return p(g,{children:[
|
|
3
3
|
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -left-2 [mask-image:radial-gradient(circle_at_0_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`}),
|
|
4
4
|
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -right-2 [mask-image:radial-gradient(circle_at_100%_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`})]})}function I(){/* @__PURE__ */
|
|
5
5
|
return y(o,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function z({text:t,label:r,copiedLabel:i}){const{copied:l,copy:o}=e(t);/* @__PURE__ */
|
|
6
|
-
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:C,onClose:j,onCloseMany:D,label:
|
|
6
|
+
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:C,onClose:j,onCloseMany:D,label:A,className:T,activeClassName:M,end:E,afterPinned:R,onIconMenu:B,menuItems:O,sizing:G="even",tall:K=!1,onReorder:L,groupInfo:S}){const H=a().pageTabs,V=a().count,[P,X]=s(null),F=K?"h-[34px]":"h-8",W=d(()=>e.map(e=>({key:e.key,group:S?e.group:void 0})),[e,S]),J=d(()=>h(W),[W]),U=d(()=>{const t=e.findIndex(e=>e.key===n);return J.find(e=>void 0!==e.group&&t>=e.start&&t<=e.end)?.group},[J,e,n]),[Y,q]=s(()=>U??null),Q=t=>{const r=J.find(e=>e.group===t);if(!r)return;const i=e.findIndex(e=>e.key===n),l=i>=r.start&&i<=r.end;if(Y!==t)l||C(e[r.start].key),q(t);else{if(l){const n=e[r.end+1]??e[r.start-1];n&&C(n.key)}q(null)}};c(()=>{void 0!==U&&q(U)},[n]);const Z=d(()=>{const n=[];for(const t of J)for(let r=t.start;r<=t.end;r++)void 0!==t.group&&t.group!==Y||n.push(e[r]);return n},[J,Y,e]),ee=u(null),[ne,te]=s(null),re=(n,t)=>L?{draggable:!0,onDragStart:t=>{ee.current=n,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.find(e=>e.key===n.key)?.title??"")},onDragOver:e=>{const r=ee.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=t!==n.key||"tab"===n.kind?e.clientX<i.left+i.width/2?"before":"after":"before",o=x(W,r,t,l)?b(W,r,t,l):null;if(!o)return void(ne&&te(null));e.preventDefault(),e.dataTransfer.dropEffect="move";const a=e=>W.find(n=>n.key===e)?.group,s="tab"===r.kind&&void 0!==a(r.key)&&a(r.key)===a(o.key);ne?.key===o.key&&ne.side===o.side&&ne.inGroup===s||te({key:o.key,side:o.side,inGroup:s})},onDrop:e=>{const n=ee.current;if(!n||!ne)return;e.preventDefault();const t=x(W,n,ne.key,ne.side);ee.current=null,te(null),t&&L(t)},onDragEnd:()=>{ee.current=null,te(null)}}:{},ie=d(()=>new Set(J.filter(e=>void 0!==e.group&&S).map(n=>e[n.start].key)),[J,e,S]),le=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),oe=e=>ne?.key===e&&!("before"===ne.side&&ie.has(e)&&!ne.inGroup)&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le(ne.side)}),ae=e.length;c(()=>{if(!n)return;const e=document.getElementById(f(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,n,ae]);const se=R?Z.findIndex(e=>!e.pinned):-1,de=Z.some(e=>e.key===n)?n:Z[0]?.key,ce=e=>{const n=Z[(e+Z.length)%Z.length];n&&document.getElementById(f(n.key,"tab"))?.focus()},ue=(e,n)=>{const t=Z[e+n];if(!L||!t)return;const r=x(W,{kind:"tab",key:Z[e].key},t.key,n<0?"before":"after");r&&(L(r),setTimeout(()=>document.getElementById(f(Z[e].key,"tab"))?.focus(),0))},me=P?e.find(e=>e.key===P.key):void 0,fe=me&&O?O(me.key):[],pe=me?e.indexOf(me):-1,ye=e=>e.some(e=>!e.pinned),ge=e=>()=>{X(null),e()},he=(e,t)=>!!t&&e.key!==n&&t.key!==n,ke=(e,t)=>{const r=e.key===n,i=e.pinned?"auto":r?"active-full"===G?"15rem":e.copy||B&&e.icon?"minmax(4.25rem,20rem)":"minmax(4.25rem,15rem)":"minmax(4rem,15rem)";return he(e,t)?["auto",i]:[i]},be=(e,t)=>{const r=e.key===n,i=!!e.dirty,l=e.icon,a=r?M??"z-[1] border-transparent bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=he(e,t),d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":k?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===de?0:-1,title:e.title,onClick:()=>C(e.key)},c={onContextMenu:n=>((e,n)=>{e.preventDefault(),X({x:e.clientX,y:e.clientY,key:n.key})})(n,e),onAuxClick:n=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),j(n.key))})(n,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
|
|
7
7
|
/* @__PURE__ */p("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[l,i&&!r&&!e.pinned&&
|
|
8
|
-
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),g=r&&!!
|
|
8
|
+
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),g=r&&!!B&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${F} ${l?"w-10":""} ${a}`,...c,...re({kind:"tab",key:e.key},e.key),children:[oe(e.key),r&&/* @__PURE__ */y($,{}),
|
|
9
9
|
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-lg ${l?"w-full":"px-3"} ${w}`,children:[u,
|
|
10
10
|
/* @__PURE__ */y("span",{className:l?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */p(m,{children:[s&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
11
|
-
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${
|
|
12
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":
|
|
11
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${F} ${"active-full"===G&&r?"":"@container"} ${"active-full"===G?r?"flex-[0_0_15rem] min-w-0":N:r&&(e.copy||g)?"flex-[0_100_20rem]":v} ${r?"active-full"===G?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${a}`,...c,...re({kind:"tab",key:e.key},e.key),children:[oe(e.key),r&&/* @__PURE__ */y($,{}),g&&
|
|
12
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":H.tabMenu,title:H.tabMenu,onClick:n=>{const t=n.currentTarget.getBoundingClientRect();B?.(e.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${w}`,children:u}),
|
|
13
13
|
/* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-lg pr-1 text-left ${g?"pl-2":"pl-3"} ${w} ${r?g?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!g&&u,
|
|
14
|
-
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===
|
|
15
|
-
/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
16
|
-
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
17
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":
|
|
14
|
+
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===G&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
|
|
15
|
+
/* @__PURE__ */y("span",{role:"img","aria-label":H.favorite,title:H.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(o,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(_,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y(z,{text:e.copy,label:H.copy(e.copy),copiedLabel:H.copied}),
|
|
16
|
+
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":H.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
17
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":H.closeTab?.(e.title)??`${H.close} ${e.title}`,onClick:()=>j(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(I,{})})]})]})]},e.key)},xe=[];let ve,Ne=0,we=!R;for(const r of J){const i=Z.filter(n=>{const t=e.indexOf(n);return t>=r.start&&t<=r.end});if(we||Ne!==se||(we=!0,xe.push(/* @__PURE__ */y(m,{children:R},"rosh-after-pinned")),ve=void 0),Ne+=i.length,void 0===r.group||!S){for(const e of i)xe.push(be(e,ve)),ve=e;continue}ve=void 0;const l=r.group,a=S(l),s=r.end-r.start+1,d=Y===l,c=e[r.start].key,u=i.some(e=>e.key===n)?"shrink":"shrink-[100]",f=["auto",...i.flatMap((e,n)=>ke(e,n>0?i[n-1]:void 0))];xe.push(
|
|
18
18
|
/* @__PURE__ */p("div",{role:"group","aria-label":a.label,"data-tab-group":l,className:`relative mx-1 grid grid-flow-col items-end first:ml-0 ${u}`,style:{gridTemplateColumns:f.join(" ")},children:[
|
|
19
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:
|
|
19
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:H.groupToggle(a.label,s),onClick:()=>Q(l),...re({kind:"group",key:c},c),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${w}`,children:[
|
|
20
20
|
/* @__PURE__ */y(o,{name:d?"chevron-right":"chevron-down","aria-hidden":"true",className:"size-3",strokeWidth:2}),a.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:a.icon}),
|
|
21
21
|
/* @__PURE__ */y("span",{className:d?"sr-only":"max-w-[12rem] truncate",children:a.label}),
|
|
22
|
-
/* @__PURE__ */y(t,{count:s,label:
|
|
23
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return we||xe.push(/* @__PURE__ */y(m,{children:
|
|
22
|
+
/* @__PURE__ */y(t,{count:s,label:V.tabs(s),active:!0})]}),ne?.key===c&&"before"===ne.side&&!ne.inGroup&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le("before")}),i.map((e,n)=>be(e,n>0?i[n-1]:void 0)),
|
|
23
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return we||xe.push(/* @__PURE__ */y(m,{children:R},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:T??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
24
24
|
/* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
25
|
-
/* @__PURE__ */y("div",{role:"tablist","aria-label":
|
|
25
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":A,onKeyDown:e=>{const n=Z.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(Z.length-1);else{if("Delete"!==e.key||Z[n].pinned)return;j(Z[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:xe}),E&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:E}),P&&me&&/* @__PURE__ */p(r,{portal:!0,style:{left:P.x,top:P.y},onClose:()=>X(null),children:[fe.length>0&&/* @__PURE__ */p(g,{children:[fe.map((e,n)=>/* @__PURE__ */p(i,{onClick:ge(e.onSelect),children:[e.icon,e.label]},n)),
|
|
26
26
|
/* @__PURE__ */y(l,{})]}),
|
|
27
|
-
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:ge(()=>j(me.key)),children:
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:ge(()=>j(me.key)),children:H.close}),
|
|
28
28
|
/* @__PURE__ */y(l,{}),
|
|
29
|
-
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:ge(()=>D("others",me.key)),children:
|
|
30
|
-
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:ge(()=>D("right",me.key)),children:
|
|
31
|
-
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:ge(()=>D("all",null)),children:
|
|
29
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:ge(()=>D("others",me.key)),children:H.closeOthers}),
|
|
30
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:ge(()=>D("right",me.key)),children:H.closeRight}),
|
|
31
|
+
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:ge(()=>D("all",null)),children:H.closeAll})]})]})}export{j as TabStrip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as a}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e,stepRounding as a}from"./chunk-FKMARSJZ.js";import{IconButton_default as r}from"./chunk-NWS5G7FE.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-F2RAIGCG.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */n(i,{name:"padding-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"padding-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"padding-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"padding-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"padding-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"padding-left-right","aria-hidden":"true",className:l})},crop:{top:/* @__PURE__ */n(i,{name:"crop-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"crop-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"crop-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"crop-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"crop-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"crop-left-right","aria-hidden":"true",className:l})}},m=/* @__PURE__ */new Set(["ArrowUp","ArrowDown","PageUp","PageDown"]),p=e=>{m.has(e.key)&&(e.preventDefault(),e.stopPropagation())},c=e=>e.stopPropagation(),h=/* @__PURE__ */n(i,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var u=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function g(e,a){const r=r=>u(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function f({label:r,value:i,onChange:t,each:l,placeholder:m,words:h,min:g=0,max:f=200,step:b=4,readOnly:v,glyphs:N="padding",units:y,sideDisplay:w}){const x=s[N],C=(e,a)=>{const r={...i};for(const i of e)r[i]=a;t(r)},j=(r,t,o)=>{const d=r.map(e=>w?.[e]?.word),l=d[0]&&d.every(e=>e===d[0])?d[0]:void 0;if(l)/* @__PURE__ */
|
|
2
2
|
return n("div",{"data-side":r.join("-"),className:"min-w-0",onKeyDownCapture:p,onWheelCapture:c,children:/* @__PURE__ */n(e,{value:null,onChange:e=>C(r,e),min:g,max:f,step:b,snap:!0,...a(b),readOnly:v,placeholder:l,display:()=>l,reportWhileTyping:!1,prefix:o,"aria-label":t})});const s=d.some(Boolean)?"mixed":function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(i,r),N=r.map(e=>u(i,m,e)),x="mixed"!==s&&N.every(e=>e===N[0])?N[0]:"–";/* @__PURE__ */
|
|
3
3
|
return n("div",{"data-side":r.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>C(r,e),min:g,max:f,step:b,snap:!0,...a(b),steppers:"compact",readOnly:v,placeholder:x,prefix:o,suffix:h.unit,units:y,"aria-label":t})})};/* @__PURE__ */
|
|
4
4
|
return n("div",{role:"group","aria-label":r,"data-sides":l?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,l?{children:[j(["left"],h.sides.left,x.left),j(["top"],h.sides.top,x.top),j(["right"],h.sides.right,x.right),j(["bottom"],h.sides.bottom,x.bottom)]}:{children:[j(["left","right"],h.horizontal,x.horizontal),j(["top","bottom"],h.vertical,x.vertical)]})})}function b({each:e,onChange:a,label:i,disabled:o}){/* @__PURE__ */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-UTISUEO4.js";import{useShellStrings as n}from"./chunk-IUVGHHR3.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellLanguage as e}from"./chunk-IOLUF3UL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-
|
|
1
|
+
import{useShellLanguage as e}from"./chunk-IOLUF3UL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-GEITUFYK.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{useShellStrings as l}from"./chunk-IUVGHHR3.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
3
3
|
/* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */s("div",{children:[
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-VQBKRBBR.js";import{useTabLayer as n,focusableIn as o}from"./chunk-DWGYC7OD.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-THAPVKEJ.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as p}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k="inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",w=/(^|[\s:])!?z-/,D={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function A({trigger:A,items:j,align:E="end",side:K="bottom","aria-label":W,className:$="",triggerClassName:C,menuClassName:S="",minWidth:L=180,linkAs:H,disabled:N,id:B,"aria-describedby":R,"aria-disabled":T=!1,onOpenChange:U,footer:I,footerLabel:Y}){const[V,q]=m(!1),[M,P]=m(-1),z=h(null),G=h(null),J=h(null),O=h(null),Q=h(null),X=null!=I&&!1!==I,Z=h({text:"",at:0}),F=g(),_=g(),ee=B??_,te=h(U);te.current=U;const re=h(V);re.current=V;const ne=v(e=>{q(!1),re.current&&(re.current=!1,te.current?.(!1)),e&&G.current?.focus()},[]),oe=(t,r)=>{const n=j.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(j[i]))return i}return-1},ie=()=>J.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!V)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||ie()?.contains(t))return;const r=ie()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||ne(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ne(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[V,ne]);const ae=v(()=>{const e=ie(),t=G.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:E,side:K});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=E},[E,K]);p(()=>{V&&ae()}),b(()=>{if(V)return u(()=>G.current,ae)},[V,ae]),b(()=>{if(!V)return;const t=J.current,r=e(j[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[V,M]),b(()=>{if(V)return f(e=>"Escape"===e.key&&(ne(!0),!0),()=>O.current)},[V,ne]),n(O,V&&X);const le=h(null),se=t=>{const r=j.findIndex(t=>"radio"===t.type&&"colour"===t.mark&&t.checked&&e(t));return r>=0?r:"first"===t?oe(0,1):oe(j.length-1,-1)},de=e=>{P(se(e)),q(!0),re.current||(re.current=!0,le.current=e,U?.(!0))};p(()=>{const e=le.current;if(!V||!e)return;le.current=null;const t=se(e);t!==M&&P(t)});const ce=t(j,F),ue="function"==typeof I?I({close:()=>ne(!0)}):I,pe={...w.test(S)?{}:{zIndex:s.popup},minWidth:L};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:z,className:`relative inline-flex ${$}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:G,id:ee,type:"button","aria-haspopup":"menu","aria-expanded":V,"aria-controls":V?F:void 0,"aria-label":W,"aria-describedby":R,"aria-disabled":T||void 0,disabled:N,onClick:()=>{T||(V?ne(!1):de("first"))},onKeyDown:e=>{T||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),de("first")):"ArrowUp"===e.key&&(e.preventDefault(),de("last")))},className:C??`${k} ${W?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"}`,children:A}),V&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:S,style:pe,children:/* @__PURE__ */y("div",{ref:O,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:J,id:F,role:"menu","aria-orientation":"vertical","aria-label":W,"aria-labelledby":W?void 0:ee,"aria-describedby":ce,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),P(oe(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),P(oe(M-1,-1));else if("Home"===t.key)t.preventDefault(),P(oe(0,1));else if("End"===t.key)t.preventDefault(),P(oe(j.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Q.current?o(Q.current)[0]:void 0;e?e.focus({preventScroll:!0}):ne(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-Z.current.at<500?Z.current.text+n:n;Z.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=J.current,d=j.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(j[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void P(n)}})(t)},children:r(j,{menuId:F,choose:e=>{e.disabled||(ne(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>ne(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||Q.current?.contains(document.activeElement)||P(e)}}),linkAs:H})}),X&&/* @__PURE__ */y("div",{ref:Q,role:"group","aria-label":Y,"data-dropdown-footer":"",onKeyDown:e=>{const t=Q.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=J.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??J.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),ne(!0))},children:[
|
|
6
|
+
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
|
+
/* @__PURE__ */x("div",{style:D,children:ue})]})]})})]})}export{A as DropdownMenu,k as TRIGGER_CLASS};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-
|
|
2
|
-
return N("input",{ref:
|
|
1
|
+
import{Calendar as e}from"./chunk-FZYUTZEV.js";import{inputClasses as r,PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{calendarNames as a,userToday as n}from"./chunk-NHKT5IH6.js";import{fromDateKey as i,toDateKey as o}from"./chunk-JRQMX4PK.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as u}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as c}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useShellStrings as p,useShellLocale as f}from"./chunk-IUVGHHR3.js";import{forwardRef as b,useState as h,useRef as v,useId as g,useEffect as y}from"react";import{createPortal as x}from"react-dom";import{jsx as N,jsxs as k}from"react/jsx-runtime";var j=/^\d{4}-\d{2}-\d{2}$/,w=/^(aria|data)-/,D=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function F(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":o(e);if(j.test(e))return e;const r=new Date(e);return Number.isNaN(r.getTime())?"":o(r)}function Y(e,r){const t=i(e);return t?r.longDate(t.getFullYear(),t.getMonth(),t.getDate()):""}var I=b(function({value:o,onChange:b,min:j,max:I,invalid:S,size:$,native:C,weekStartsOn:E,className:R="","aria-label":U,"aria-describedby":q,"aria-labelledby":B,id:O,name:T,disabled:V,placeholder:W,required:z,clearable:H,form:P,title:Z,tabIndex:A,autoFocus:L,onFocus:M,onBlur:G,formatDisplay:J,...K},Q){const X=H??!z,_=F(o),ee=F(j),re=F(I),te=p().datePicker,ae=f(),ne=a(ae),[ie,oe]=h(!1),le=v(null),se=v(null),de=v(null),ue=g(),ce=g(),me=g(),pe=u(se,ie,{popupRef:de}),[fe,be]=h(!1);c(()=>{const e=!!O&&(se.current?.labels?.length??0)>0;e!==fe&&be(e)});const he=!U&&(!!B||fe);if(y(()=>{if(!ie)return;const e=e=>{const r=e.target;le.current?.contains(r)||de.current?.contains(r)||oe(!1)};document.addEventListener("pointerdown",e,!0);const r=s(()=>oe(!1));return()=>{document.removeEventListener("pointerdown",e,!0),r()}},[ie]),y(()=>{if(ie)return m(e=>"Escape"===e.key&&(oe(!1),se.current?.focus(),!0),()=>de.current)},[ie]),C)/* @__PURE__ */
|
|
2
|
+
return N("input",{ref:Q,type:"date",lang:ae,id:O,name:T,disabled:V,"aria-label":U,"aria-describedby":q,"aria-invalid":S||void 0,value:_,min:ee||void 0,max:re||void 0,onChange:e=>b?.(i(e.target.value)),className:r({invalid:S,size:$,className:R}),"aria-labelledby":B,required:z,form:P,title:Z,tabIndex:A,autoFocus:L,onFocus:M,onBlur:G,...K});const ve=Object.fromEntries(Object.entries(K).filter(([e])=>w.test(e)&&!D.has(e))),ge=K["aria-required"],ye=!!z||!0===ge||"true"===ge,xe=[he?ce:void 0,ye?me:void 0,q].filter(Boolean).join(" ")||void 0,Ne=n(),ke=!!Ne&&(!ee||Ne>=ee)&&(!re||Ne<=re),je=W??te.placeholder;/* @__PURE__ */
|
|
3
3
|
return k("div",{ref:le,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */N("input",{ref:
|
|
5
|
-
/* @__PURE__ */k("button",{ref:se,type:"button",...ve,id:
|
|
6
|
-
/* @__PURE__ */N("span",{className:`min-w-0 truncate whitespace-nowrap ${_?"text-ink-strongest":t}`,children:_?
|
|
7
|
-
/* @__PURE__ */N(l,{name:"date",className:`h-4 w-4 shrink-0 ${t}`,strokeWidth:"1.75","aria-hidden":"true"})]}),he&&/* @__PURE__ */N("span",{id:ce,className:"sr-only",children:_?
|
|
8
|
-
/* @__PURE__ */k("div",{ref:de,id:ue,role:"dialog","aria-label":
|
|
9
|
-
/* @__PURE__ */N(e,{value:_||null,min:ee||null,max:re||null,weekStartsOn:
|
|
4
|
+
/* @__PURE__ */N("input",{ref:Q,type:"hidden",name:T,form:P,value:_}),
|
|
5
|
+
/* @__PURE__ */k("button",{ref:se,type:"button",...ve,id:O,disabled:V,title:Z,tabIndex:A,autoFocus:L,onFocus:M,onBlur:G,"aria-haspopup":"dialog","aria-expanded":ie,"aria-controls":ie?ue:void 0,"aria-labelledby":B,"aria-describedby":xe,"aria-label":U?`${U}${_?`, ${Y(_,ne)}`:""}`:void 0,onClick:()=>oe(e=>!e),className:`${r({invalid:S,size:$,className:R})} flex items-center justify-between gap-2 text-left`,children:[
|
|
6
|
+
/* @__PURE__ */N("span",{className:`min-w-0 truncate whitespace-nowrap ${_?"text-ink-strongest":t}`,children:_?J?J(_):Y(_,ne):je}),
|
|
7
|
+
/* @__PURE__ */N(l,{name:"date",className:`h-4 w-4 shrink-0 ${t}`,strokeWidth:"1.75","aria-hidden":"true"})]}),he&&/* @__PURE__ */N("span",{id:ce,className:"sr-only",children:_?Y(_,ne):je}),ye&&/* @__PURE__ */N("span",{id:me,className:"sr-only",children:te.required}),ie&&x(
|
|
8
|
+
/* @__PURE__ */k("div",{ref:de,id:ue,role:"dialog","aria-label":U??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:d.popup,left:pe?.left,right:pe?.right,top:pe?.top,bottom:pe?.bottom,maxWidth:pe?.maxWidth,visibility:pe?void 0:"hidden"},children:[
|
|
9
|
+
/* @__PURE__ */N(e,{value:_||null,min:ee||null,max:re||null,weekStartsOn:E,onSelect:e=>{oe(!1),se.current?.focus(),b?.(i(e))}}),(X||ke)&&/* @__PURE__ */k("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[X&&/* @__PURE__ */N("button",{type:"button",onClick:()=>{oe(!1),se.current?.focus(),b?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),ke&&/* @__PURE__ */N("button",{type:"button",onClick:()=>{oe(!1),se.current?.focus(),b?.(i(Ne))},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{I as DatePicker_default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as c}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as s,escapeSurfaceAbove as d}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as h}from"./chunk-5FYDNH4Y.js";import{createContext as u,useContext as p,useState as m,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=u(!1),W=()=>p(j),H={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:u,side:p="top",delay:W=200,children:N,className:T="relative inline-flex",describe:B=!0,open:M}){const[Y,D]=m(!1),R=(M??Y)&&!(null==u||!1===u||""===u),[U,z]=m(null),C=f(void 0),E=f(null),P=f(null),$=x(),A=f(!1),F=()=>{window.clearTimeout(C.current),A.current||E.current?.querySelector('[aria-haspopup][aria-expanded="true"]')||(C.current=window.setTimeout(()=>D(!0),W))},L=()=>{window.clearTimeout(C.current),D(!1)},S=t=>{t.currentTarget.contains(t.target)&&(A.current=!0,L())},V=()=>{A.current=!1,L()};w(()=>()=>window.clearTimeout(C.current),[]),c(()=>{if(!R)return void z(null);const t=()=>{const t=E.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void L();const u=a(h,d,p,r,12),m=l(h,u,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:u.left-h.left,top:u.top-h.top,maxWidth:c,maxHeight:s,side:u.side,arrow:m&&{left:m.x-h.left,top:m.y-h.top}};z(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>E.current,t)},[R,p,u]),w(()=>{if(!R)return;const e=s(t=>"Escape"===t.key&&(L(),!d(E.current))),r=t(L);return()=>{e(),r()}},[R]);const q=R&&B?$:void 0,G=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],q].filter(Boolean).join(" ")||void 0}):N,I=R?h():void 0;/* @__PURE__ */
|
|
2
|
+
return y("span",{ref:E,className:T,"aria-describedby":g(N)?void 0:q,onMouseEnter:F,onMouseLeave:V,onFocus:t=>{if(!t.currentTarget.contains(t.target))return;let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&F()},onBlur:V,onPointerDown:S,onClick:S,children:[
|
|
3
|
+
/* @__PURE__ */k(j.Provider,{value:!0,children:G}),R&&v(
|
|
4
|
+
/* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...U?.anchor},children:[
|
|
5
|
+
/* @__PURE__ */k("span",{ref:P,id:$,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-ink-strong ${U?"":H[p]}`,style:{...I,...U&&{left:U.left,top:U.top,maxWidth:U.maxWidth,maxHeight:U.maxHeight}},children:u}),(!U||U.arrow)&&
|
|
6
|
+
/* @__PURE__ */k("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":U?.side??p,style:{background:I?.background,"--rosh-tooltip-edge":I?.border,...U?.arrow&&{left:U.arrow.left,top:U.arrow.top}}})]}),document.body)]})}export{N as Tooltip,W as useInsideTooltip};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useHydrated as e}from"./chunk-
|
|
2
|
-
return t("kbd",{className:[b[n],p[r],i].filter(Boolean).join(" "),children:o})}export{a as ALT,T as ALT_SHIFT_D,c as ALT_SHIFT_E,M as ALT_SHIFT_N,u as CMD_A,s as CMD_DOT,d as CMD_ENTER,m as CMD_K,f as CMD_S,
|
|
1
|
+
import{useHydrated as e}from"./chunk-WCCS4VFE.js";import{jsx as t}from"react/jsx-runtime";var r="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),n={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},i=r?0:1,o=n.MOD[i],a=n.ALT[i],l="⇧",_="⏎",d=n.CMD_ENTER[i],f=n.CMD_S[i],m=n.CMD_K[i],s=n.CMD_DOT[i],u=n.CMD_A[i],C=n.CMD_Z[i],D=n.CMD_SHIFT_Z[i],T=n.ALT_SHIFT_D[i],c=n.ALT_SHIFT_E[i],M=n.ALT_SHIFT_N[i],A=new Map(r?Object.values(n).map(([e,t])=>[e,t]):[]);function S(t){return e()?t:A.get(t)??t}var b={neutral:"inline-flex items-center justify-center rounded border border-line bg-surface-sunken font-medium text-ink-faint",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},p={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function x({keys:e,size:r="md",tone:n="neutral",className:i=""}){const o=S(e);/* @__PURE__ */
|
|
2
|
+
return t("kbd",{className:[b[n],p[r],i].filter(Boolean).join(" "),children:o})}export{a as ALT,T as ALT_SHIFT_D,c as ALT_SHIFT_E,M as ALT_SHIFT_N,u as CMD_A,s as CMD_DOT,d as CMD_ENTER,m as CMD_K,f as CMD_S,D as CMD_SHIFT_Z,C as CMD_Z,_ as ENTER,x as Kbd,o as MOD,l as SHIFT,r as isMac,S as useShortcutLabel};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-WRV6QKJN.js";import{Button_default as n}from"./chunk-UTISUEO4.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{unitBox as e}from"./chunk-
|
|
2
|
-
return v("div",{className:"relative","data-number-box":"",style
|
|
1
|
+
import{unitBox as e}from"./chunk-XQVGBVHC.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{IconButton_default as t}from"./chunk-NWS5G7FE.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-IUVGHHR3.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:n,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":n,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(t,{size:"sm",...v,children:u})}var j=c(function({value:t,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:E,disabled:D,readOnly:B,invalid:S,placeholder:C,size:$,prefix:F,suffix:O,suffixControl:M,units:P,id:R,name:U,className:V="",onBlur:W,onFocus:K,steppers:Y,stepFrom:z,snap:I=!1,allowEmpty:L=!0,appearance:T="box",display:A,reportWhileTyping:G=!0,onRevert:H,"aria-label":X,"aria-labelledby":Q,"aria-describedby":Z,auto:q,...J},_){const ee="bare"===T,re=M??("string"==typeof O?e(O,P,D||B):void 0),te=r(),ne=q??te,oe=s(),ie="string"==typeof O&&""!==O.trim()?O.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(O||re),ce=Object.fromEntries(Object.entries(J).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(t,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(t),he=d(t);he.current=t;const be=Boolean(D||B),ge=Y??!1,xe="compact"===ge,[ye,we]=w(F),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==t&&de(x(t,g))},[t,g]);const Ee=e=>{if(be)return;let r=(ae(pe.current)??z??(C?ae(C):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Oe()},De=d(Ee);De.current=Ee;const Be=d({unit:j??1,big:E??10*(j??1),locked:be});Be.current={unit:j??1,big:E??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),De.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Se,Ce]=u(!1),[$e,Fe]=u(0),Oe=()=>{ee&&Fe(e=>e+1)};f(()=>{ee&&Se&&document.activeElement===fe.current&&fe.current?.select()},[ee,Se,$e]);const Me=d(!1);f(()=>{if(Se&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(H??o)(r),Oe(),!0})},[Se,be,g,o,H]);const Pe=()=>{const e=ae(pe.current);if(null==e){if(!L){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(I?Math.max(b(j??1),b(i??0)):void 0);I&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Re=/* @__PURE__ */m("input",{ref:me,id:R,"data-number-input":"",name:U,type:"text",inputMode:0===g?"numeric":"decimal",value:!Se&&A?A(t):ue,disabled:D,readOnly:B,placeholder:C,step:j,role:"spinbutton","aria-valuenow":t??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==t?C||void 0:`${x(t,g)}${ee&&ie?ie:""}`,"aria-describedby":[Z,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":S||void 0,"aria-label":X,"aria-labelledby":Q,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!G)return;const t=ae(e);(null!==t||L)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Pe(),void Oe();const r=j??1,t=E??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),Ee(n))},onFocus:()=>{ve.current=he.current,Ce(!0),Me.current=!0,K?.()},onMouseUp:ee?e=>{Me.current&&(Me.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Ce(!1),Me.current=!1,Pe(),W?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Se?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",V].filter(Boolean).join(" "):n({invalid:S,size:$,readOnly:B,auto:ne,className:[F?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Se?"text-ellipsis":"",V].filter(Boolean).join(" ")})}),Ue=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!F&&!le&&!ge)return Ue?/* @__PURE__ */v(h,{children:[Re,Ue]}):Re;const Ve=ae(ue);/* @__PURE__ */
|
|
2
|
+
return v("div",{className:"relative","data-number-box":"",style:F||re?{...F?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[F&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:F}),Re,Ue,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):O&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:O}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Ve&&Ve<=i,onStep:e=>De.current(-(e?E??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Ve&&Ve>=c,onStep:e=>De.current(e?E??10*(j??1):j??1)});/* @__PURE__ */
|
|
3
3
|
return v("span",xe?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{j as InputNumber_default,g as stepRounding};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-LKAGXURQ.js";import{toDayMs as i,fmtSliderDate as t}from"./chunk-5CFERCYW.js";import{DAY_MS as a}from"./chunk-JRQMX4PK.js";import{useBrowserValueOnce as l}from"./chunk-WCCS4VFE.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-IUVGHHR3.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const j=l(Date.now,null),C=[],M=[],x=o().timeline,H=r();for(const e of p){const n=i(e.date??null);null===n?M.push({key:e.key,label:e.label,kind:e.kind}):C.push({...e,ms:n})}C.sort((e,n)=>e.ms-n.ms);const K=i(g??null);let L,R,w=!0;0===C.length?(R=K??j??0,L=R-30*a,w=null!==K||null!==j):(L=C[0].ms,R=K??C[C.length-1].ms,R-L<a&&(R=L+a));const N=C.length>0?Math.max(0,Math.round((R-L)/a)):0,O=u??(N>0?x.duration(N):void 0),D=[C.length>0?x.started(t(C[0].ms,H)):void 0,O,M.length>0?x.reached(C.length,p.length):void 0],E=C.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),F={};for(const e of C)e.phase&&(F[e.phase]=F[e.phase]||[]).push(e.ms);const G=Object.entries(F).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),Q="rail"===v,S=w&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:Q?"spread":"compressed",labels:Q?"none":"lanes",items:E,pending:M,phases:G,startMs:L,endMs:R,todayMs:j??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:x.milestones(m)})});/* @__PURE__ */
|
|
2
|
+
return h("div",Q?{className:"shrink-0","data-timeline-variant":"rail",children:S}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:D,children:S})})}export{m as MilestoneTimeline};
|