efficient-shell 10.16.0 → 10.17.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/dist/{Browser-RI5X7GMK.js → Browser-Q5BYSSW3.js} +14 -14
- package/dist/Calculator-6NJNSIRN.js +29 -0
- package/dist/{CurrencyConverter-2GUEE7ZR.js → CurrencyConverter-42IHLJVV.js} +8 -8
- package/dist/{Documents-GI346UL5.js → Documents-GGEPMWB5.js} +21 -21
- package/dist/Files-OVNXUYOV.js +88 -0
- package/dist/{Notepad-HRZKLHO3.js → Notepad-L2LOWTSE.js} +10 -10
- package/dist/{PdfViewer-LU5JKHSG.js → PdfViewer-Y3SAVADX.js} +1 -1
- package/dist/{PomodoroTimer-QYCTTTPZ.js → PomodoroTimer-PD7POYX5.js} +68 -68
- package/dist/{Preview-LSGN5GN7.js → Preview-HM2Z3EJO.js} +25 -25
- package/dist/Sidebar-2HHICMZZ.js +44 -0
- package/dist/{Spreadsheet-7JBZY6KJ.js → Spreadsheet-2E4TQ64O.js} +13 -13
- package/dist/{Stock-ZVQT25IE.js → Stock-IABQRSXZ.js} +3 -3
- package/dist/{Weather-RAUDLLVU.js → Weather-4QPYOENN.js} +22 -22
- package/dist/{WorldClock-2XBWZ6SZ.js → WorldClock-3ZVRBLEW.js} +6 -6
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +80 -80
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.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/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.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/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-W6URVLQF.js → chunk-22RQC4EW.js} +14 -14
- package/dist/chunk-26RTJKHD.js +2 -0
- package/dist/{chunk-F2R3UFNQ.js → chunk-2E2SUEEE.js} +1 -1
- package/dist/chunk-2H6YNMBE.js +14 -0
- package/dist/{chunk-7HTRLRVO.js → chunk-2YSGXZOL.js} +50 -50
- package/dist/{chunk-M22B3Y5Y.js → chunk-3IUPYCW3.js} +1 -1
- package/dist/{chunk-JGTGQGHY.js → chunk-3PR5YMWZ.js} +1 -1
- package/dist/{chunk-MNSKGMVZ.js → chunk-3UXXA2CS.js} +8 -8
- package/dist/{chunk-XDBG4HPV.js → chunk-4EZIWLJJ.js} +1 -1
- package/dist/{chunk-E3753CWP.js → chunk-4HBSQGRI.js} +1 -1
- package/dist/{chunk-EZEYKCI6.js → chunk-4ULRP4Y4.js} +1 -1
- package/dist/{chunk-LDE5IV2M.js → chunk-54NMFQMW.js} +4 -4
- package/dist/{chunk-DRDYZ633.js → chunk-5QGBVTGS.js} +2 -2
- package/dist/{chunk-57HN6MPC.js → chunk-5SIOCKCK.js} +2 -2
- package/dist/{chunk-ISJPW2FZ.js → chunk-5TDQPZDB.js} +10 -10
- package/dist/chunk-5TQLUPZD.js +6 -0
- package/dist/{chunk-D7F442OZ.js → chunk-5WYRAJ5F.js} +1 -1
- package/dist/chunk-67MQ5S32.js +8 -0
- package/dist/chunk-6JSXIEH2.js +4 -0
- package/dist/{chunk-ULXCDM7Y.js → chunk-6V4INP7J.js} +10 -10
- package/dist/{chunk-7NBSBGLX.js → chunk-77AQNJE2.js} +8 -8
- package/dist/{chunk-Y3R267FV.js → chunk-77MOYIQW.js} +10 -10
- package/dist/{chunk-AKM6JBMD.js → chunk-7ELJQL7J.js} +1 -1
- package/dist/chunk-7INZ7O3A.js +5 -0
- package/dist/{chunk-UPQW4GCT.js → chunk-7TZV6G2F.js} +1 -1
- package/dist/{chunk-X6BFVDB4.js → chunk-7VBXIIEC.js} +2 -2
- package/dist/{chunk-UWIZX3RK.js → chunk-A42MKJA3.js} +1 -1
- package/dist/{chunk-DKGZPVLL.js → chunk-AFYLVV74.js} +1 -1
- package/dist/{chunk-H4HB5OET.js → chunk-AWKJZSTO.js} +1 -1
- package/dist/{chunk-H32EQG5Z.js → chunk-AYDW63LV.js} +9 -9
- package/dist/chunk-B23RG53S.js +14 -0
- package/dist/chunk-B3CN55UI.js +2 -0
- package/dist/{chunk-CPZ42W2B.js → chunk-C6Y7B73Q.js} +1 -1
- package/dist/{chunk-QP4UPCXQ.js → chunk-C764JODK.js} +1 -1
- package/dist/{chunk-LEDUD23S.js → chunk-CLTRQ7AQ.js} +1 -1
- package/dist/chunk-CUHUZBFH.js +29 -0
- package/dist/chunk-CXYHFGUY.js +9 -0
- package/dist/{chunk-TM33D3CE.js → chunk-DCRLJMQ6.js} +1 -1
- package/dist/{chunk-AOK3BHRT.js → chunk-DGZAQXTW.js} +4 -4
- package/dist/{chunk-UYRITNQW.js → chunk-DHIQ46C5.js} +1 -1
- package/dist/{chunk-IOJNSX4N.js → chunk-DQQKG46I.js} +7 -7
- package/dist/chunk-DYNJ2H6R.js +8 -0
- package/dist/{chunk-INNIWRVU.js → chunk-E6GDAV5R.js} +2 -2
- package/dist/{chunk-N3TOHWFF.js → chunk-ECJKIPWU.js} +1 -1
- package/dist/chunk-EJUNGVK2.js +22 -0
- package/dist/{chunk-3EJ64VKE.js → chunk-EN5NXWT6.js} +1 -1
- package/dist/{chunk-MCDM2G4W.js → chunk-EOWUUOVE.js} +1 -1
- package/dist/{chunk-7TNAOZZ2.js → chunk-EPY34L26.js} +1 -1
- package/dist/{chunk-PVZGSCCB.js → chunk-FACWYKL6.js} +6 -6
- package/dist/{chunk-6AS5PHHK.js → chunk-FKRPQDFX.js} +17 -17
- package/dist/{chunk-QHOBK35Y.js → chunk-FOFZI62F.js} +1 -1
- package/dist/{chunk-7ZP64SC7.js → chunk-FS6EOU4G.js} +1 -1
- package/dist/chunk-GDQJBQ5B.js +1 -0
- package/dist/{chunk-YOSUCCHG.js → chunk-GEP4FROW.js} +3 -3
- package/dist/chunk-HJCUDXLV.js +1 -0
- package/dist/{chunk-S6FBMSFU.js → chunk-HJW67KA7.js} +2 -2
- package/dist/{chunk-7X5FABQS.js → chunk-HV47GP2C.js} +1 -1
- package/dist/{chunk-74OUAR6L.js → chunk-I33SVQ7P.js} +6 -6
- package/dist/{chunk-KJ4CBZEQ.js → chunk-IMDGMUE3.js} +1 -1
- package/dist/{chunk-HNBGLF4B.js → chunk-JFV5CQN4.js} +1 -1
- package/dist/{chunk-7MSC3Z5H.js → chunk-JH4ZCPHW.js} +8 -8
- package/dist/chunk-JIGFR7Z3.js +11 -0
- package/dist/chunk-JNQKBN5M.js +7 -0
- package/dist/{chunk-OOLPDASG.js → chunk-JSG2AKCG.js} +1 -1
- package/dist/{chunk-6RX4PVBU.js → chunk-JTMEFXRL.js} +1 -1
- package/dist/{chunk-4QJOEHM6.js → chunk-JYIH2EBG.js} +1 -1
- package/dist/chunk-K4JQ3FQI.js +2 -0
- package/dist/{chunk-ULAGXDOL.js → chunk-LXL2UCUR.js} +1 -1
- package/dist/{chunk-I2XGPTCN.js → chunk-LYHJHUQH.js} +1 -1
- package/dist/{chunk-JSGQWVYH.js → chunk-MJGK6QTO.js} +7 -7
- package/dist/{chunk-PYAJCN2Q.js → chunk-MNNZGO2E.js} +1 -1
- package/dist/{chunk-XTCXX5LJ.js → chunk-MS5APD3V.js} +1 -1
- package/dist/chunk-MUXGWDEH.js +2 -0
- package/dist/{chunk-PCFBDXLN.js → chunk-N6CS2FO2.js} +1 -1
- package/dist/{chunk-2SY76NFO.js → chunk-NFB7PARJ.js} +4 -4
- package/dist/{chunk-K4ANB6AF.js → chunk-NNZFC4O7.js} +1 -1
- package/dist/{chunk-MHB52H2Y.js → chunk-NU5HN3FZ.js} +12 -12
- package/dist/{chunk-QYSEYYV7.js → chunk-NVD4AI5Y.js} +1 -1
- package/dist/{chunk-AJO72CPB.js → chunk-O47HKK6E.js} +2 -2
- package/dist/{chunk-BJXDOM2N.js → chunk-OBJGUJIE.js} +1 -1
- package/dist/{chunk-AUWTGM65.js → chunk-OH5L6HYW.js} +3 -3
- package/dist/{chunk-WINNA7LS.js → chunk-OORL6BIG.js} +1 -1
- package/dist/{chunk-KTA77U3P.js → chunk-OP5DOO3K.js} +4 -4
- package/dist/{chunk-ZURB2DCM.js → chunk-OPN4I565.js} +1 -1
- package/dist/{chunk-7SMV6G4Z.js → chunk-ORIXCEKO.js} +1 -1
- package/dist/{chunk-TOVKWNI2.js → chunk-P3RXXWXN.js} +6 -6
- package/dist/{chunk-ON67HF5K.js → chunk-PCTOL2FX.js} +8 -8
- package/dist/{chunk-XZGGJHJC.js → chunk-PLK2WHZG.js} +17 -17
- package/dist/{chunk-QDQ347RL.js → chunk-PW52RXPI.js} +1 -1
- package/dist/chunk-QDKAA3HR.js +2 -0
- package/dist/chunk-QHPVAXHR.js +6 -0
- package/dist/chunk-QO5E33DH.js +8 -0
- package/dist/{chunk-7HLC352T.js → chunk-QRYSL6QU.js} +16 -16
- package/dist/{chunk-LPXMHYTM.js → chunk-QVZKRROQ.js} +1 -1
- package/dist/{chunk-EXJXOKUU.js → chunk-QYL26AB4.js} +1 -1
- package/dist/{chunk-SDQIXE5M.js → chunk-RBBIAIPH.js} +8 -8
- package/dist/{chunk-TVH7IZQ4.js → chunk-REWKL7MX.js} +2 -2
- package/dist/{chunk-L4IW77TD.js → chunk-RT4WOEVS.js} +4 -4
- package/dist/{chunk-SG4LO2AN.js → chunk-RUGQO7YF.js} +11 -11
- package/dist/{chunk-MTEFYFUO.js → chunk-RVRDDTEG.js} +1 -1
- package/dist/{chunk-D4I3U7UE.js → chunk-RXCGE2AY.js} +1 -1
- package/dist/{chunk-UDRMZ22J.js → chunk-S74LKSUB.js} +1 -1
- package/dist/{chunk-QYRMFGES.js → chunk-SAP4YI2Y.js} +1 -1
- package/dist/{chunk-CKKUFDZ3.js → chunk-SDDV3UCN.js} +18 -18
- package/dist/{chunk-KEPJWZJZ.js → chunk-SL77N7VT.js} +3 -3
- package/dist/chunk-SLU45G5J.js +19 -0
- package/dist/{chunk-5RE6R3XC.js → chunk-SXNQHIBY.js} +1 -1
- package/dist/{chunk-GGK27H67.js → chunk-TGGUYAWA.js} +1 -1
- package/dist/chunk-TGXO3CDO.js +2 -0
- package/dist/chunk-TLMFVEMC.js +9 -0
- package/dist/{chunk-MQU3PZUS.js → chunk-TMMNCXQT.js} +1 -1
- package/dist/{chunk-CQV3VSI2.js → chunk-UDKTAG57.js} +1 -1
- package/dist/{chunk-UTWJKSET.js → chunk-UEISJFZH.js} +5 -5
- package/dist/{chunk-CBEKJTXU.js → chunk-UYRMW5MO.js} +5 -5
- package/dist/{chunk-RLJHRDDW.js → chunk-V6Y4OC6K.js} +8 -8
- package/dist/{chunk-W5CJD54C.js → chunk-VAK5FQXH.js} +1 -1
- package/dist/{chunk-WB4P4QE2.js → chunk-VDUXPMOQ.js} +1 -1
- package/dist/{chunk-O7DW2BKY.js → chunk-VHF3CJVO.js} +28 -28
- package/dist/{chunk-KTVXPGGB.js → chunk-VIQ6OME2.js} +8 -8
- package/dist/{chunk-7UTPXU6K.js → chunk-VN4KSRZ5.js} +1 -1
- package/dist/{chunk-RPYFOQM2.js → chunk-VQCSHJEF.js} +2 -2
- package/dist/chunk-VWIYC2NB.js +13 -0
- package/dist/chunk-WRQ4A5QY.js +1 -0
- package/dist/{chunk-3LDXURVU.js → chunk-WTYQF7XJ.js} +2 -2
- package/dist/{chunk-GPJO34QP.js → chunk-WYFMSL4Q.js} +8 -8
- package/dist/{chunk-FEQDZTZ7.js → chunk-XCHAU2UN.js} +6 -6
- package/dist/chunk-XGJQVIEG.js +2 -0
- package/dist/{chunk-VTFZ6W2D.js → chunk-XLWMM53L.js} +1 -1
- package/dist/{chunk-VKKK4WLS.js → chunk-XQZL6JDD.js} +6 -6
- package/dist/{chunk-JEH5EVIG.js → chunk-XSJHN2GD.js} +1 -1
- package/dist/{chunk-BNJWZAQE.js → chunk-XYBI57KO.js} +12 -12
- package/dist/{chunk-3AH524CN.js → chunk-XYECIBVX.js} +1 -1
- package/dist/{chunk-LO5T2K4B.js → chunk-Y62TTKSY.js} +3 -3
- package/dist/{chunk-6C6TRDNI.js → chunk-YG2TWBDH.js} +1 -1
- package/dist/{chunk-SHKBDFSE.js → chunk-YILGAEW3.js} +1 -1
- package/dist/chunk-YJ5IHIAI.js +2 -0
- package/dist/{chunk-FWVC4A2O.js → chunk-YJXS7BR5.js} +1 -1
- package/dist/{chunk-NBVHJZVS.js → chunk-YQFGRYEF.js} +12 -12
- package/dist/{chunk-4G2C6J4I.js → chunk-YSDPFDAG.js} +1 -1
- package/dist/{chunk-B7UCXROE.js → chunk-Z5A4EY2R.js} +1 -1
- package/dist/{chunk-ZW3IDCP2.js → chunk-ZGOHRLXG.js} +1 -1
- package/dist/{chunk-5UYZ75F3.js → chunk-ZHAWOZA7.js} +11 -11
- package/dist/{chunk-IKNG7EFQ.js → chunk-ZQKA2XKH.js} +8 -8
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.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/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.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/PositionInput.js +1 -1
- package/dist/forms/Select.d.ts +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/TagInput.js +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +2 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +4 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +2 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +2 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/SeparatorSlashIcon.d.ts +8 -0
- package/dist/icons/glyphs/SeparatorSlashIcon.js +1 -0
- package/dist/icons/glyphs/SeparatorTriangleIcon.d.ts +8 -0
- package/dist/icons/glyphs/SeparatorTriangleIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/SeparatorSlashMiniIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorSlashMiniIcon.js +1 -0
- package/dist/icons/looks/SeparatorSlashSolidIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorSlashSolidIcon.js +1 -0
- package/dist/icons/looks/SeparatorTriangleMiniIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorTriangleMiniIcon.js +1 -0
- package/dist/icons/looks/SeparatorTriangleSolidIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorTriangleSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +172 -172
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +7 -7
- package/dist/{names-Bmx_9y41.d.ts → names-CkQuQ47O.d.ts} +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.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/ContainerFillChart.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.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/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.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/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +6 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-Y566OMJZ.js +0 -29
- package/dist/Files-UA23KXN7.js +0 -88
- package/dist/Sidebar-2P26444H.js +0 -44
- package/dist/chunk-2JG5JU4M.js +0 -8
- package/dist/chunk-4PAWQEXM.js +0 -1
- package/dist/chunk-7XYTJPWW.js +0 -29
- package/dist/chunk-COJYPNKF.js +0 -2
- package/dist/chunk-DWR7MYQU.js +0 -7
- package/dist/chunk-EU3JZGV2.js +0 -14
- package/dist/chunk-JJW43QPS.js +0 -9
- package/dist/chunk-LCJRTJXT.js +0 -13
- package/dist/chunk-LU6NA4RU.js +0 -5
- package/dist/chunk-M4K6FLIY.js +0 -1
- package/dist/chunk-PJQGYKN6.js +0 -11
- package/dist/chunk-PN65IIYN.js +0 -8
- package/dist/chunk-Q6YNMNUH.js +0 -6
- package/dist/chunk-RCPFUDPS.js +0 -4
- package/dist/chunk-RRUHQLUY.js +0 -14
- package/dist/chunk-TMNAHOJ7.js +0 -9
- package/dist/chunk-UBMY23AG.js +0 -6
- package/dist/chunk-VNACNNCJ.js +0 -19
- package/dist/chunk-W35N7SL3.js +0 -8
- package/dist/chunk-W4OBVKN4.js +0 -1
- package/dist/chunk-WMEYNKXZ.js +0 -22
- package/dist/chunk-ZZVE64OI.js +0 -2
- /package/dist/{chunk-6V6ANLHW.js → chunk-Y2AGVGOP.js} +0 -0
package/dist/bin/ui-check.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{execFileSync as e}from"child_process";import{createRequire as t}from"module";import{join as n}from"path";import{existsSync as i,readFileSync as o,writeFileSync as s,readdirSync as r}from"fs";var a=["button","input","range","textarea","select","dialog","title","portal","native","dark","hex","radius","spacing","font-size","z-index","shadow","kit","icon","svg","kit-dep","chart","chart-dep","ellipsis-label","colour"],l=e=>"string"==typeof e&&a.includes(e),c=["kit-dep","chart-dep"],d=e=>c.includes(e),u=a.filter(e=>!d(e)),h={button:{counts:"a raw <button>",instead:"Button or IconButton from efficient-shell/ui"},input:{counts:"a raw <input> (not hidden, not a range)",instead:"Input, InputNumber, Checkbox, Radio or Switch from efficient-shell/ui"},range:{counts:'a raw <input type="range">',instead:"Slider from efficient-shell/ui"},textarea:{counts:"a raw <textarea>",instead:"Textarea from efficient-shell/ui"},select:{counts:"a raw <select>",instead:"Select or SearchableSelect from efficient-shell/ui"},dialog:{counts:'a raw <dialog>, or role="dialog" / role="alertdialog" on a raw element',instead:"Dialog or Modal from efficient-shell"},title:{counts:"a title= on a raw element (the browser's own tooltip)",instead:"Tooltip from efficient-shell/ui (harness UI-17)"},portal:{counts:"a createPortal(…) call (a layer the file floats itself)",instead:"Popover, PopupMenu, DropdownMenu, Tooltip or Dialog from efficient-shell/ui"},native:{counts:"window.confirm / alert / prompt, or a bare call that resolves to one",instead:"confirm, confirmDestructive, prompt or toast from efficient-shell (harness UI-20)"},dark:{counts:"a dark: variant in a class string",instead:"the light Tailwind class alone; the shell remaps it in dark mode (harness UI-7)"},hex:{counts:"a hex colour literal in a .tsx string",instead:"a colour role from efficient-shell: its utility or var(--role), COLOUR_ROLES lists them (harness FT-1; the colour kind counts palette classes too)"},radius:{counts:"a literal corner radius (an arbitrary-value radius class, or an inline borderRadius)",instead:"a radius utility from the scale or a role token such as rounded-(--radius-control); the theme sets how round they are (harness UI-7)"},spacing:{counts:"a padding, margin or gap off the scale (6px, 10px, 14px …) or written as a literal length (an arbitrary-value class, an inline style)",instead:"a step of the scale 2/4/8/12/16/20/24/32/40/48 — a Tailwind step, or a role such as var(--space-control-x) (owner ruling 2026-10-12)"},"font-size":{counts:"a literal font size (an arbitrary-value text class, an inline fontSize)",instead:"a type step 9/11/12/14/16/18/20/24/30 — Tailwind's 3xs … 3xl text steps (owner ruling 2026-10-12)"},"z-index":{counts:"a stack order above 30 written as a number (a z utility, an arbitrary value, an inline zIndex)",instead:"a named layer: Z_LAYERS (efficient-shell/ui) in code, its --z-* custom property in markup"},shadow:{counts:"a literal shadow, or a shadow size that is not an elevation level (md, 2xl, xs)",instead:"an elevation: the sm / lg / xl utilities, or var(--elevation-panel) and its siblings (owner ruling 2026-10-12)"},kit:{counts:"an import of a second UI kit",instead:"the component from efficient-shell/ui, or fold it into the shell (harness FT-3)"},icon:{counts:"an import of an icon package",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24)"},svg:{counts:"an <svg> element written in JSX: an icon drawn in place",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24). A chart, an illustration or a mark a host supplies stays on the baseline"},"kit-dep":{counts:"a UI kit or icon package declared in package.json (not one the shell entries imported here need)",instead:"remove the dependency once nothing imports it (harness FT-3)"},chart:{counts:"an import of a second chart library",instead:"a chart from efficient-shell/ui (ChartFrame, TimeSeriesChart, ColumnChart, RankedBars, PieChart, FunnelChart, ScatterChart, …), or add the chart there: one chart system (harness FT-3)"},"chart-dep":{counts:"a chart library declared in package.json",instead:"remove the dependency once nothing imports it (harness FT-3)"},"ellipsis-label":{counts:'a button, link or menu label that ends in "…" or "..."',instead:'the label without the dots, saying what it does ("Extend trial"): "…" means only "the words are cut" (owner ruling 2026-10-14)'},colour:{counts:"a literal colour, in a script string or a stylesheet: a hex, an rgb() / hsl() / oklch() value, a Tailwind palette class (a hue and a step, or white / black), a --color-<hue>-<step> variable, or a named colour in a colour property — a var() fallback included",instead:"a colour role from efficient-shell: its utility (the text, background or border utility of ink, ink-faint, surface, line, accent-fill, accent-text, danger-text, status-danger-line …) or var(--role); COLOUR_ROLES lists them. A merchant site reads the site theme (owner ruling 2026-10-23)"}},p=["@headlessui/","@radix-ui/","@mui/","@chakra-ui/","@mantine/","@floating-ui/","antd","react-aria","react-aria-","react-bootstrap","react-select","react-colorful","react-tooltip","react-hot-toast","react-toastify","sonner"],f=["@heroicons/","@tabler/icons","@tabler/icons-","@phosphor-icons/","@fortawesome/","@iconify/","@radix-ui/react-icons","@mui/icons-material","lucide","lucide-react","simple-icons","react-icons","react-feather"],g=["recharts","chart.js","react-chartjs-2","d3","d3-","@nivo/","victory","victory-","echarts","echarts-for-react","apexcharts","react-apexcharts","@visx/","highcharts","highcharts-react-official","plotly.js","plotly.js-dist","react-plotly.js","lightweight-charts","@antv/g2","@antv/g2plot","chartist","billboard.js","c3","uplot"],m={"efficient-shell":["@headlessui/react"]};function w(e,t){return t.some(t=>t.endsWith("/")||t.endsWith("-")?e.startsWith(t):e===t||e.startsWith(`${t}/`))}function k(e){return w(e,f)?"icon":w(e,p)?"kit":w(e,g)?"chart":null}function x(e){const t=k(e);return"kit"===t||"icon"===t?"kit-dep":"chart"===t?"chart-dep":null}var b=/[.+^$()|[\]\\]/g;function $(e){let t="",n=0;for(let i=0;i<e.length;i++){const o=e[i];"*"===o?"*"===e[i+1]?"/"===e[i+2]?(t+="(?:[^/]+/)*",i+=2):(t+=".*",i+=1):t+="[^/]*":"?"===o?t+="[^/]":"{"===o?(t+="(?:",n+=1):"}"===o&&n>0?(t+=")",n-=1):t+=","===o&&n>0?"|":o.replace(b,"\\$&")}if(0!==n)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${t}$`)}function y(e){const t=e.map($);return e=>t.some(t=>t.test(e))}var v=new Set(["node_modules",".git"]),S=new Set(["dist","coverage",".next",".turbo"]);function j(e){const t=e.search(/[*?{]/),n=-1===t?e:e.slice(0,t),i=n.lastIndexOf("/");return-1===i?"":n.slice(0,i)}function I(e,t){const i=y(t),o=[...new Set(t.map(j))].sort(),s=o.filter(e=>!o.some(t=>t!==e&&(""===t||e.startsWith(`${t}/`)))),a=new Set,l=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?v.has(e.name)||""===t&&S.has(e.name)||l(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)l(e);return[...a].sort(L)}var L=(e,t)=>e<t?-1:e>t?1:0,R=class extends Error{},A=(e,t)=>`${e}:${t}`;function z(e){const t=e.lastIndexOf(":");return{file:e.slice(0,t),kind:e.slice(t+1)}}var E=e=>a.indexOf(e);function C(e,t){const n=z(e),i=z(t);return L(n.file,i.file)||E(n.kind)-E(i.kind)}function T(e,t="ui-kit.baseline.json"){let n;try{n=JSON.parse(e)}catch(e){throw new R(`${t} is not valid JSON: ${e.message}`)}const i=e=>{throw new R(`${t}: ${e}. The tool writes this file; do not edit it by hand.`)};if("object"!=typeof n||null===n||Array.isArray(n))return i("must be a JSON object");const o=n;if(1!==o.schema)return i("number"==typeof o.schema&&o.schema>1?`"schema": ${o.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');if(!Array.isArray(o.kinds)||o.kinds.some(e=>"string"!=typeof e))return i('"kinds" must be a list');const s=o.kinds.filter(l);if("object"!=typeof o.counts||null===o.counts||Array.isArray(o.counts))return i('"counts" must be an object');const r=new Map;for(const[e,t]of Object.entries(o.counts)){const{file:n,kind:o}=z(e);if(!n||!o)return i(`"${e}" is not "<file>:<kind>"`);if("number"!=typeof t||!Number.isInteger(t)||t<1)return i(`"${e}" must be a whole number, 1 or more (a line that reaches 0 is deleted)`);l(o)&&r.set(e,t)}return{kinds:s,counts:r}}function M(e){const t=a.filter(t=>e.kinds.includes(t)),n=[...e.counts.keys()].filter(t=>(e.counts.get(t)??0)>0).sort(C).map(t=>` ${JSON.stringify(t)}: ${e.counts.get(t)}`);return["{",' "schema": 1,',` "kinds": [${t.map(e=>JSON.stringify(e)).join(", ")}],`,n.length?` "counts": {\n${n.join(",\n")}\n }`:' "counts": {}',"}",""].join("\n")}function B(e){const t={};for(const[n,i]of e){const{kind:e}=z(n);l(e)&&(t[e]=(t[e]??0)+i)}return t}var P=class extends Error{},O=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),D=new Set(["$schema","schema","kinds","include","exclude","includeImporting","output","allow"]);var N="package.json",F=[2,4,8,12,16,20,24,32,40,48];function J(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&F.includes(4*t)}var U=new Set(["iframe","frame","object","embed"]),W=new Set(["href","xlinkHref","to","id","key","htmlFor"]),q=/(?<![&\w])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,_=/(?<![\w-])rounded(?:-(?:[trblse]|tl|tr|br|bl|ss|se|ee|es))?-\[([^\]]*)\]/g,G=/^border(?:(?:Top|Bottom)(?:Left|Right)|(?:Start|End)(?:Start|End))?Radius$/,K=/^(?:inherit|initial|unset|revert)$|var\(|^(?:50|100)%$|^(?:999|9999)(?:px)?$/,H=/(?<![\w-])-?(?:p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|space-x|space-y)-(\d+(?:\.\d+)?|px|\[[^\]]*\])(?![\w.[/-])/g,Q=/(?<![\w-])text-\[(?:length:)?(\d*\.?\d+(?:px|rem|em|%))\]/g,V=/(?<![\w-])z-(\d+|\[[^\]]*\])(?![\w.[/-])/g,X=/(?<![\w-])shadow-(xs|2xs|md|2xl|\[[^\]]*\])(?![\w.[/-])/g,Z=/var\(|^(?:inherit|initial|unset|revert|revert-layer|none|auto)$/,Y=/^(?:(?:padding|margin)(?:Top|Right|Bottom|Left|Inline|Block|InlineStart|InlineEnd|BlockStart|BlockEnd)?|gap|rowGap|columnGap)$/,ee=new Set([0,...F]),te=/(?<![\w-])dark:(?=[\w[\-!@*(])/g,ne="slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose",ie="(?:50|[1-9]00|950)",oe=new RegExp(`(?<![\\w-])(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|inset-ring|outline|divide|fill|stroke|from|via|to|shadow|inset-shadow|drop-shadow|accent|caret|decoration|placeholder)-(?:(?:${ne})-${ie}|white|black)(?:\\/[\\w.]+)?(?![\\w-])`,"g"),se=new RegExp(`--color-(?:(?:${ne})-${ie}|white|black)(?![\\w-])`,"g"),re=/(?<![\w-])(?:rgba?|hsla?|hwb|oklch|oklab|lab|lch)\(\s*[\d.]/g,ae=/(?<![\w-])(?:white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|maroon|navy|teal|olive|lime|aqua|fuchsia|brown|gold|beige|ivory|tan|crimson|coral|salmon|indigo|violet)(?![\w-])/gi,le=/^(?:color|background(?:Color)?|border(?:Top|Right|Bottom|Left|Inline|Block)?(?:Color)?|outline(?:Color)?|fill|stroke|caretColor|accentColor|textDecorationColor|boxShadow|textShadow)$/,ce=/(?<![&a-zA-Z0-9])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,de=e=>[...e.matchAll(ce)].length+[...e.matchAll(re)].length+[...e.matchAll(oe)].length+[...e.matchAll(se)].length,ue=new Set(["button","a","option","Button","IconButton","SplitButton","Link","NavLink","PopupMenuItem","PopupMenuLabel","DropdownMenuItem","MenuItem","ContextMenuItem"]),he=/(?:…|\.\.\.|…)\s*$/,pe=new RegExp("\\p{L}","u"),fe=new RegExp("\\p{L}[\\p{L}-]*","u"),ge={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"],zhStarts:["正在"],zhEnds:["中"]},placeholder:{},prompt:{}},me=new Set((ge.busy?.words??[]).map(e=>e.toLowerCase())),we=new Set(["label","aria-label",...ge.placeholder?[]:["placeholder","searchPlaceholder","emptyOptionLabel","blankLabel"]]),ke=(e,t)=>{if(!he.test(t)||!pe.test(e))return!1;const n=e.match(fe)?.[0]?.toLowerCase();if(n&&me.has(n))return!1;const i=e.replace(he,"").trim(),o=ge.busy;return!(o&&(o.zhStarts.some(e=>i.startsWith(e))||o.zhEnds.some(e=>i.endsWith(e))))},xe=new Set(["confirm","alert","prompt"]),be=new Set(["window","globalThis","self"]);var $e=e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"),ye=e=>/\.(?:css|scss)$/.test(e),ve=/^(?:color|background(?:-color)?|border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?(?:-color)?|outline(?:-color)?|fill|stroke|caret-color|accent-color|text-decoration(?:-color)?|box-shadow|text-shadow|column-rule(?:-color)?)$/;function Se(e,t){if(!t.includes("colour"))return{};const n=e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g," ")),i=[],o=e=>n.slice(0,e).split("\n").length;let s=0,r=0;for(let e=0;e<n.length;e++){const t=n[e];if("{"===t||"}"===t||";"===t){const a=n.slice(r,e);if("{"!==t&&s>0){const e=r+(a.length-a.trimStart().length),t=a.trim(),n=t.indexOf(":");if(t.startsWith("@apply"))for(let n=[...t.matchAll(oe)].length;n>0;n--)i.push(o(e));else if(n>0){const s=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1);if(!/^(?:-webkit-)?mask/.test(s)){const t=de(r)+(ve.test(s)?[...r.matchAll(ae)].length:0);for(let n=0;n<t;n++)i.push(o(e))}}}"{"===t?s++:"}"===t&&(s=Math.max(0,s-1)),r=e+1}}return i.length?{colour:i}:{}}function je(e,t,n,i,o){const s=new Set(i),r=e.createSourceFile(t,n,e.ScriptTarget.Latest,!0,function(e,t){return t.endsWith(".tsx")?e.ScriptKind.TSX:t.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(t)?e.ScriptKind.JS:e.ScriptKind.TS}(e,t)),a={},l=/\.[jt]sx$/.test(t),c=e=>r.getLineAndCharacterOfPosition(e).line+1,d=(e,t)=>{s.has(e)&&(a[e]??=[]).push(c(t.getStart(r)))},u=(t,n)=>t.attributes.properties.find(t=>e.isJsxAttribute(t)&&t.name.getText(r)===n),h=t=>{const n=t?.initializer;if(n)return e.isStringLiteral(n)?n.text:e.isJsxExpression(n)&&n.expression&&e.isStringLiteralLike(n.expression)?n.expression.text:void 0},p=new Set;if(s.has("native")){const t=n=>{if(n)if(e.isIdentifier(n))xe.has(n.text)&&p.add(n.text);else if(e.isObjectBindingPattern(n)||e.isArrayBindingPattern(n))for(const i of n.elements)e.isBindingElement(i)&&t(i.name)},n=i=>{(e.isImportClause(i)||e.isImportSpecifier(i)||e.isNamespaceImport(i)||e.isVariableDeclaration(i)||e.isParameter(i)||e.isFunctionDeclaration(i))&&t(i.name),e.forEachChild(i,n)};n(r)}const f=t=>t&&e.isStringLiteralLike(t)?t.text:void 0,g=(e,t)=>{e&&("efficient-shell"===e||e.startsWith("efficient-shell/"))&&o?.add(e);const n=e?k(e):null;n&&d(n,t)},m=(e,t,n)=>{if(s.has("dark"))for(const n of e.matchAll(te))d("dark",t);if(s.has("radius"))for(const n of e.matchAll(_))K.test(n[1].trim())||d("radius",t);if(n&&l&&s.has("hex"))for(const n of e.matchAll(q))d("hex",t);if(n&&s.has("colour"))for(let n=de(e);n>0;n--)d("colour",t);if(s.has("spacing"))for(const n of e.matchAll(H)){const e=n[1];(e.startsWith("[")?Z.test(e.slice(1,-1).trim()):J(e))||d("spacing",t)}if(s.has("font-size"))for(const n of e.matchAll(Q))d("font-size",t);if(s.has("z-index"))for(const n of e.matchAll(V)){const e=n[1].startsWith("[")?n[1].slice(1,-1).trim():n[1];/^\d+$/.test(e)&&Number(e)>30&&d("z-index",t)}if(s.has("shadow"))for(const n of e.matchAll(X))n[1].startsWith("[")&&Z.test(n[1].slice(1,-1).trim())||d("shadow",t)},w=(t,n,i)=>{const o=e.isStringLiteralLike(n)?n.text.trim():void 0;if(s.has("colour")&&void 0!==o&&le.test(t))for(const e of o.matchAll(ae))d("colour",i);if(s.has("spacing")&&Y.test(t))e.isNumericLiteral(n)?ee.has(Number(n.text))||d("spacing",i):void 0!==o&&!Z.test(o)&&(e=>[...e.matchAll(/(-?\d*\.?\d+)(px|rem|em)\b/g)].map(e=>Math.abs(Number(e[1]))*("px"===e[2]?1:16)))(o).some(e=>!ee.has(e))&&d("spacing",i);else if(s.has("font-size")&&"fontSize"===t)(e.isNumericLiteral(n)||void 0!==o&&!Z.test(o)&&!/^(?:smaller|larger)$/.test(o))&&d("font-size",i);else if(s.has("z-index")&&"zIndex"===t){const t=[],o=n=>{e.isNumericLiteral(n)||e.isStringLiteralLike(n)&&/^\d+$/.test(n.text.trim())?t.push(Number(n.text)):e.forEachChild(n,o)};o(n);for(const e of t)e>30&&d("z-index",i)}else s.has("shadow")&&"boxShadow"===t&&(void 0===o||""===o||Z.test(o)||d("shadow",i))},x=(t,n)=>{if(e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)){const e=t.tagName.getText(r);if(/^[a-z]/.test(e)){const n=h(u(t,"type"));"svg"===e&&d("svg",t),"button"===e?d("button",t):"select"===e?d("select",t):"textarea"===e?d("textarea",t):"input"===e&&("range"===n?d("range",t):"hidden"!==n&&d("input",t));const i=h(u(t,"role"));"dialog"!==e&&"dialog"!==i&&"alertdialog"!==i||d("dialog",t),!U.has(e)&&u(t,"title")&&d("title",t)}}else if(e.isCallExpression(t)){const n=t.expression;e.isIdentifier(n)?"createPortal"===n.text?d("portal",t):xe.has(n.text)&&!p.has(n.text)?d("native",t):"require"===n.text&&g(f(t.arguments[0]),t):e.isPropertyAccessExpression(n)?"createPortal"===n.name.text?d("portal",t):xe.has(n.name.text)&&e.isIdentifier(n.expression)&&be.has(n.expression.text)&&d("native",t):n.kind===e.SyntaxKind.ImportKeyword&&g(f(t.arguments[0]),t)}else{if(e.isImportDeclaration(t)||e.isExportDeclaration(t))return void g(f(t.moduleSpecifier),t);if(e.isPropertyAssignment(t)){const n=e.isIdentifier(t.name)||e.isStringLiteralLike(t.name)?t.name.text:"",i=t.initializer;w(n,i,t),s.has("radius")&&G.test(n)&&(e.isNumericLiteral(i)?K.test(i.text)||d("radius",t):e.isStringLiteralLike(i)&&!K.test(i.text.trim())&&d("radius",t))}else if(e.isStringLiteralLike(t))m(t.text,t,n);else if(e.isTemplateExpression(t)){m(t.head.text,t.head,n);for(const e of t.templateSpans)m(e.literal.text,e.literal,n)}}e.isJsxAttribute(t)&&W.has(t.name.getText(r))?e.forEachChild(t,e=>x(e,!1)):e.forEachChild(t,e=>x(e,n))};return x(r,!0),s.has("ellipsis-label")&&function(e,t,n){const i=new Set,o=(e,t)=>{i.has(e)||(i.add(e),n(t))},s=n=>{if(n)if(e.isStringLiteralLike(n))ke(n.text,n.text)&&o(n,n.getStart(t));else if(e.isTemplateExpression(n)){const e=[n.head.text,...n.templateSpans.map(e=>e.literal.text)];ke(e.join(" "),e[e.length-1])&&o(n,n.getStart(t))}else e.isConditionalExpression(n)?(s(n.whenTrue),s(n.whenFalse)):e.isBinaryExpression(n)?(s(n.left),s(n.right)):e.isParenthesizedExpression(n)||e.isAsExpression(n)||e.isJsxExpression(n)?s(n.expression):e.isCallExpression(n)&&Ie.has(Le(n.expression))&&n.arguments[0]&&s(n.arguments[0])},r=n=>{for(const i of n)if(e.isJsxText(i)){const e=i.getText(t);ke(e,e)&&o(i,i.getStart(t)+(e.length-e.trimStart().length))}else e.isJsxExpression(i)?s(i.expression):(e.isJsxElement(i)||e.isJsxFragment(i))&&r(i.children)},a=(n,i)=>{const o=n.attributes.properties.find(n=>e.isJsxAttribute(n)&&n.name.getText(t)===i),s=o?.initializer;return s&&e.isStringLiteral(s)?s.text:s&&e.isJsxExpression(s)&&s.expression&&e.isStringLiteralLike(s.expression)?s.expression.text:void 0},l=t=>t.properties.some(t=>e.isPropertyAssignment(t)&&(e.isIdentifier(t.name)||e.isStringLiteralLike(t.name))&&"value"===t.name.text&&e.isStringLiteralLike(t.initializer)&&""===t.initializer.text),c=n=>{if(e.isJsxElement(n)){const e=n.openingElement,i=e.tagName.getText(t),o="option"===i&&ge.prompt&&""===a(e,"value");ue.has(i)&&!o&&r(n.children)}else if(e.isJsxAttribute(n))we.has(n.name.getText(t))&&s(n.initializer);else if(e.isPropertyAssignment(n)){const t=e.isIdentifier(n.name)||e.isStringLiteralLike(n.name)?n.name.text:"",i=ge.prompt&&e.isObjectLiteralExpression(n.parent)&&l(n.parent);we.has(t)&&!i&&s(n.initializer)}e.forEachChild(n,c)};c(t)}(e,r,e=>(a["ellipsis-label"]??=[]).push(c(e))),a}var Ie=new Set(["say","t"]),Le=e=>{const t=e.getText();return t.slice(t.lastIndexOf(".")+1)};function Re(e){const t={};for(const[n,i]of Object.entries(e))i.length&&(t[n]=i.length);return t}function Ae(e,t,n){const i=e.createSourceFile(t,n,e.ScriptTarget.Latest,!1),o=[];for(const t of i.statements)(e.isImportDeclaration(t)||e.isExportDeclaration(t))&&t.moduleSpecifier&&e.isStringLiteralLike(t.moduleSpecifier)&&o.push(t.moduleSpecifier.text);return o}var ze=(e,t)=>e.some(e=>t.some(t=>t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t));var Ee=e=>new Map(e.allow.map(e=>[A(e.file,e.kind),e.count]));function Ce(e,t){return e.kinds.filter(e=>t.kinds.includes(e))}var Te=(e,t,n)=>{if("kit-dep"===n)return` (${e.kitDeps.join(", ")})`;if("chart-dep"===n)return` (${e.chartDeps.join(", ")})`;const i=e.hits.get(t)?.[n]??[];if(0===i.length)return"";const o=i.slice(0,12).join(", ");return` (line${1===i.length?"":"s"} ${o}${i.length>12?", …":""})`};function Me(e,t,n){const i=Ee(e),o=new Map;for(const[e,s]of t.counts){const{kind:t}=z(e);if(!l(t)||!n.includes(t))continue;const r=s-(i.get(e)??0);r>0&&o.set(e,r)}return{kinds:a.filter(e=>n.includes(e)),counts:o}}function Be(e,t){let n=0;for(const i of new Set([...e.keys(),...t.keys()]))(e.get(i)??0)!==(t.get(i)??0)&&(n+=1);return n}var Pe="\n// <button> in a comment is not a button, and <svg> in one is not a drawing\n/* nor is <input title=\"x\"> in this one, or dark:bg-black, or #fff */\nimport { createPortal } from 'react-dom';\nimport { Dialog } from '@headlessui/react';\nimport { TrashIcon } from '@heroicons/react/24/outline';\nimport type { Icon } from 'lucide-react';\nimport { Button, confirm } from 'efficient-shell';\nexport { Slot } from '@radix-ui/react-slot';\nexport { CheckIcon } from '@radix-ui/react-icons';\nimport { LineChart } from 'recharts';\nimport 'd3-scale';\nexport { VictoryPie } from 'victory';\nimport { BarChart } from '@mui/x-charts';\nimport Tree from 'react-d3-tree';\nimport { TimeSeriesChart } from 'efficient-shell/ui';\n// import 'chart.js' in a comment is not an import, and 'echarts' in a string is not one either\nconst chartLabel = 'd3-array';\n\nconst a = <button title=\"Says what it does\">x</button>;\nconst b = <input type=\"range\" />;\nconst c = <input type=\"text\" />;\nconst c2 = <input type={\"hidden\"} name=\"csrf\" />;\nconst c3 = <input type=\"hidden\" />;\nconst c4 = <input type={kind} />;\nconst d = <select />;\nconst d2 = <textarea />;\nconst e = <div role=\"dialog\" />;\nconst e2 = <dialog open />;\nconst e3 = <section role={'alertdialog'} />;\nconst f = <iframe title=\"Preview\" />;\nconst f2 = <object title=\"Chart\" />;\nconst g = <Button title=\"a prop, not a tooltip\" role=\"dialog\" />;\nconst g2 = (\n <button\n type=\"button\"\n title={hint}\n >\n y\n </button>\n);\nconst h = ReactDOM.createPortal(a, document.body);\nconst i = createPortal(a, document.body);\n\nasync function leave() {\n if (window.confirm('Sure?')) return;\n globalThis.alert('No');\n alert('native: nothing binds the name');\n prompt('native too');\n await confirm('the shell: the import binds it');\n record.confirm('a method, not the popup');\n}\n\nconst j = <div className=\"bg-white dark:bg-black dark:hover:text-white is-dark:no\" />;\nconst k = clsx('text-gray-900', on && 'dark:text-gray-100');\nconst l = <span style={{ color: '#fff', background: \"#12ab34\" }} className={`border-[#0a0b0c80] ${x}`} />;\nconst m = <a href=\"#faded\" id=\"#bad\" key=\"#abc\" to=\"#face\">skip</a>;\nconst n = <label htmlFor={'#dead'}>skip</label>;\nconst o = <span>Ӓ and BG#00340 and #12345 and #added are not colours</span>;\nconst p = 'entity  ref BG#00340';\nconst q = <use xlinkHref=\"#abc\" fill=\"url(#fed)\" />;\nconst t = <div className=\"rounded-[4px] rounded-t-[0.5rem] hover:rounded-[2px] rounded-lg rounded-(--radius-card) rounded-[inherit] rounded-[var(--r)]\" />;\nconst u = <div style={{ borderRadius: 6, borderTopLeftRadius: '3px', borderBottomRightRadius: '50%', borderEndEndRadius: 'var(--radius-card)' }} />;\nconst v = <i style={{ borderRadius: 9999 }} />;\nconst w = <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 4h16\" /></svg>;\nconst w2 = <Svg viewBox=\"0 0 24 24\" />;\nconst w3 = '<svg viewBox=\"0 0 1 1\"></svg> in a string is not an element';\nconst r = lazy(() => import('@mui/material'));\nconst s = require('react-select');\nconst s2 = require('chart.js/auto');\nconst s3 = import('@nivo/line');\n",Oe={button:2,input:2,range:1,textarea:1,select:1,dialog:3,title:2,portal:2,native:4,dark:3,hex:3,radius:5,kit:5,icon:3,svg:1,chart:5,colour:8},De={kit:1,dark:1,portal:1,radius:2,chart:1,colour:2},Ne=(...e)=>e.join("-"),Fe=`\nconst s1 = <i className="${[Ne("px","2.5"),Ne("py","1.5"),"md:"+Ne("gap","1.5"),"-"+Ne("mt","1.5"),Ne("p","[10px]")].join(" ")}" />;\nconst s2 = <i className="${[Ne("p","0"),Ne("px","px"),Ne("p","0.5"),Ne("p","3"),Ne("gap-x","4"),Ne("p","12"),Ne("p","(--space-12)"),Ne("p","[var(--space-12)]"),Ne("space-x","reverse"),Ne("top","1.5")].join(" ")}" />;\nconst s3 = <i style={{ padding: 6, marginTop: '10px', gap: 8, margin: '0 auto', paddingInline: 'var(--space-12)' }} />;\nconst f1 = <i className="${[Ne("text","[11px]"),Ne("text","[0.8rem]"),Ne("text","xs"),Ne("text","[#fff]"),Ne("text","(--text-2xs)")].join(" ")}" />;\nconst f2 = <i style={{ fontSize: 12 }} />;\nconst f3 = { fontSize: 'var(--x)', font: 'inherit' };\nconst z1 = <i className="${[Ne("z","[9999]"),Ne("z","50"),Ne("z","10"),Ne("z","30"),"-"+Ne("z","10"),Ne("z","auto"),Ne("z","(--z-popup)"),Ne("z","[var(--z-popup)]")].join(" ")}" />;\nconst z2 = { zIndex: on ? 2020 : 2010 };\nconst z3 = { zIndex: Z_LAYERS.popup, top: 9999 };\nconst h1 = <i className="${[Ne("shadow","[0_1px_2px_#000]"),Ne("shadow","md"),"shadow",Ne("shadow","lg"),Ne("shadow","(--elevation-panel)"),Ne("shadow","black/20"),Ne("drop-shadow","md")].join(" ")}" />;\nconst h2 = { boxShadow: '0 1px 2px rgba(0,0,0,.1)' };\nconst h3 = { boxShadow: 'none', outline: 'var(--elevation-raised)' };\n`,Je={spacing:7,"font-size":3,"z-index":4,shadow:3,hex:1,colour:4},Ue={colour:4},We={"ellipsis-label":9},qe=e=>a.filter(t=>e[t]).map(t=>`${t} ${e[t]}`).join(", ")||"nothing";var _e="ui-kit.config.json",Ge="ui-kit.baseline.json",Ke="efficient-shell-ui-check",He=`${Ke}: every surface a person operates takes its UI from efficient-shell (harness UI-24).\n\n ${Ke} check this repository against ${Ge}\n ${Ke} --print print today's counts as a baseline, and change nothing\n ${Ke} --summary print totals per kind and per folder, as Markdown\n ${Ke} --json print the result as JSON\n ${Ke} --update lower the lines whose counts fell, and delete the ones at zero\n ${Ke} --update --allow-move also follow a renamed or split file (no total may rise)\n ${Ke} --init write the first ${Ge}\n ${Ke} --init --kind <kind> take the baseline for a kind just added to "kinds"\n ${Ke} --no-base do not compare with the pull request's base branch\n\nKinds: ${a.join(", ")}\nReads ${_e} in the current directory.`;var Qe=(e,t)=>`${e} ${t}${1===e?"":"s"}`,Ve=(e,t)=>{const n=B(e);return t.map(e=>`${e} ${n[e]??0}`).join(" · ")};process.exitCode=function(e,t){const r=function(e){const t={print:!1,summary:!1,json:!1,update:!1,allowMove:!1,init:!1,noBase:!1,help:!1,version:!1,kinds:[]};for(let n=0;n<e.length;n++){const i=e[n];if("--print"===i)t.print=!0;else if("--summary"===i)t.summary=!0;else if("--json"===i)t.json=!0;else if("--update"===i)t.update=!0;else if("--allow-move"===i)t.allowMove=!0;else if("--init"===i)t.init=!0;else if("--no-base"===i)t.noBase=!0;else if("--help"===i||"-h"===i)t.help=!0;else if("--version"===i||"-v"===i)t.version=!0;else if("--kind"===i){const i=e[++n];if(!i)return"--kind needs a kind after it";t.kinds.push(...i.split(","))}else{if(!i.startsWith("--kind="))return`unknown argument "${i}"`;t.kinds.push(...i.slice(7).split(","))}}return t.allowMove&&!t.update?"--allow-move goes with --update":t.kinds.length&&!t.init?"--kind goes with --init":[t.print,t.summary,t.update,t.init].filter(Boolean).length>1?"choose one of --print, --summary, --update and --init":t}(e);if("string"==typeof r)return t.err(`${Ke}: ${r}\n\n${He}`),2;if(r.help)return t.out(He),0;if(r.version)return t.out(t.version),0;const c=e=>(r.json?t.out(JSON.stringify({tool:Ke,version:t.version,ok:!1,failures:[e]},null,2)):t.err(`${Ke}: ${e}`),1),p=n(t.cwd,_e);if(!i(p))return c(`no ${_e} in ${t.cwd}. Run it from the repository root; the harness has the template.`);let f,g;try{f=function(e,t="ui-kit.config.json"){const n=[],i=e=>{n.push(e)},o=(e,t,{required:n=!1}={})=>{if(void 0===e&&!n)return[];if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||""===e))return i(`${t} must be a list of non-empty strings`),[];n&&0===e.length&&i(`${t} must name at least one entry`);for(const n of e)(n.startsWith("/")||n.startsWith("./")||n.includes("\\")||n.split("/").includes(".."))&&i(`${t}: "${n}" must be a path from the repository root, written with / (no ./, .. or \\)`);return e},s=(e,t)=>"string"!=typeof e||e.trim().length<10?(i(`${t} needs a "reason" a reviewer can read (a sentence, not a word)`),""):e,r=(e,t)=>void 0===e?[]:!Array.isArray(e)||e.some(e=>!O(e))?(i(`${t} must be a list of objects`),[]):e;if(!O(e))throw new P(`${t}: must be a JSON object`);for(const t of Object.keys(e))D.has(t)||i(`unknown key "${t}"`);1!==e.schema&&i("number"==typeof e.schema&&e.schema>1?`"schema": ${e.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');const c=[];if(Array.isArray(e.kinds)&&0!==e.kinds.length)for(const t of e.kinds)l(t)?c.includes(t)?i(`"kinds": "${t}" is listed twice`):c.push(t):i(`"kinds": unknown kind ${JSON.stringify(t)} (this efficient-shell knows: ${a.join(", ")})`);else i(`"kinds" must list the kinds this repository checks, from: ${a.join(", ")}`);const d=o(e.include,'"include"'),u=o(e.exclude,'"exclude"'),h=r(e.includeImporting,'"includeImporting"').map((e,t)=>({files:o(e.files,`"includeImporting"[${t}].files`,{required:!0}),modules:o(e.modules,`"includeImporting"[${t}].modules`,{required:!0}),reason:s(e.reason,`"includeImporting"[${t}]`)}));0===d.length&&0===h.length&&i('"include" must name the files that are operator UI (for example ["src/**/*.tsx"])');const p=r(e.output,'"output"').map((e,t)=>({files:o(e.files,`"output"[${t}].files`,{required:!0}),reason:s(e.reason,`"output"[${t}]`)})),f=[],g=new Set;if(r(e.allow,'"allow"').forEach((e,t)=>{const n=`"allow"[${t}]`,[r]=o([e.file],`${n}.file`),d=s(e.reason,n);if(!l(e.kind))return void i(`${n}.kind must be one of: ${a.join(", ")}`);if(c.includes(e.kind)||i(`${n}: kind "${e.kind}" is not in "kinds"`),"number"!=typeof e.count||!Number.isInteger(e.count)||e.count<1)return void i(`${n}.count must be a whole number, 1 or more`);if(!r)return;const u=`${r}:${e.kind}`;g.has(u)&&i(`${n}: ${r} already has an allow entry for "${e.kind}"`),g.add(u),f.push({file:r,kind:e.kind,count:e.count,reason:d})}),n.length)throw new P(`${t}:\n - ${n.join("\n - ")}`);return{schema:1,kinds:a.filter(e=>c.includes(e)),include:d,exclude:u,includeImporting:h,output:p,allow:f}}(JSON.parse(o(p,"utf8")),_e)}catch(e){return c(e instanceof P?e.message:`${_e} is not valid JSON: ${e.message}`)}try{g=t.loadTypeScript()}catch{return c('this check reads the TypeScript AST and found no "typescript" package here. Install it as a devDependency.')}const w=function(e){const t=[],n=u,i=[["fixture.tsx",Pe,Oe],["fixture.ts","\nimport { toast } from 'sonner';\nimport { extent } from 'd3-array';\nexport const tone = { warn: '#f59e0b' };\nexport const cls = 'ring-1 dark:ring-white rounded-[3px]';\nexport const box = { borderRadius: '0.25rem', radius: 4 };\nexport function ask(confirm: (message: string) => boolean) {\n return confirm('a parameter binds the name');\n}\nexport const mount = (node: unknown) => ReactDOM.createPortal(node, document.body);\n",De],["tokens.tsx",Fe,Je],["labels.tsx","\n// <Button>Save…</Button> in a comment is not a label\nconst l1 = <Button>Extend trial…</Button>;\nconst l2 = <PopupMenuItem onClick={go}><span>Read from a PDF...</span></PopupMenuItem>;\nconst l3 = <Button>{busy ? 'Saving…' : 'Duplicate site…'}</Button>;\nconst l4 = <Item label=\"Translate…\" aria-label={'More…'} />;\nconst l5 = [{ label: 'Reject…' }, { value: CUSTOM, label: 'Custom…' }];\nconst l6 = <option value={CUSTOM}>Different address…</option>;\nconst l7 = <PopupMenuLabel>{say(\"Duplicate to page…\")}</PopupMenuLabel>;\nconst n7 = <Button>{t('team:menu.remove')}</Button>;\nconst n1 = <Button>{`${name.slice(0, 9)}…`}</Button>;\nconst n2 = <p>Loading weather…</p>;\nconst n3 = <Input placeholder=\"Search…\" />;\nconst n4 = <option value=\"\">Pick a carrier…</option>;\nconst n5 = [{ value: '', label: 'Select…' }];\nconst n6 = <Button>Extend trial</Button>;\n",We]];for(const[o,s,r]of i){const i=Re(je(e,o,s,n));n.some(e=>(i[e]??0)!==(r[e]??0))&&t.push(`${o}: read ${qe(i)}; it holds ${qe(r)}`)}const o=Re(Se('\n/* #fff in a comment */\n.a:hover { color: #111; border: 1px solid white; }\n[data-x="#fff"] { mask-image: linear-gradient(#000, transparent); color: var(--ink); }\n.b { --mine: rgb(0 0 0 / .5); background: var(--surface, #fff); }\n',n));n.some(e=>(o[e]??0)!==(Ue[e]??0))&&t.push(`style.css: read ${qe(o)}; it holds ${qe(Ue)}`);const s=Re(je(e,"fixture.tsx",Pe,["button"]));return"button"!==Object.keys(s).join()&&t.push(`asked for button alone, the reader reported ${qe(s)}`),t}(g);if(w.length)return c(`the reader misread its own fixtures with typescript ${g.version}, so nothing it says about this repository can be trusted:\n - `+w.join("\n - "));const k=function(e,t,s){const r=[],a=y(s.exclude),l=y(s.output.flatMap(e=>e.files)),c=new Map,u=e=>{let i=c.get(e);return void 0===i&&c.set(e,i=o(n(t,e),"utf8")),i},h=(e,n)=>{for(const i of e)0===I(t,[i]).length&&r.push(`${n}: "${i}" matches no file. Delete the line, or fix the path.`)};h(s.include,'"include"'),s.output.forEach((e,t)=>h(e.files,`"output"[${t}]`)),s.includeImporting.forEach((e,t)=>h(e.files,`"includeImporting"[${t}]`));const p=new Set,f=s.kinds.includes("colour"),g=e=>($e(e)||f&&ye(e))&&!a(e)&&!l(e);for(const e of I(t,s.include))g(e)&&p.add(e);for(const n of s.includeImporting)for(const i of I(t,n.files))g(i)&&$e(i)&&!p.has(i)&&ze(Ae(e,i,u(i)),n.modules)&&p.add(i);const w=[...p].sort(),k=s.kinds.filter(e=>!d(e)),b=new Map,$=new Map,v=new Set;for(const t of w){const n=ye(t)?Se(u(t),k):je(e,t,u(t),k,v);let i=!1;for(const e of k){const o=n[e]?.length??0;o&&($.set(A(t,e),o),i=!0)}i&&b.set(t,n)}let S=[],j=[],L=[];const R=s.kinds.filter(d);if(R.length){const e=n(t,N);if(i(e)){const t=JSON.parse(o(e,"utf8")),n=["dependencies","peerDependencies","optionalDependencies"].flatMap(e=>Object.keys(t[e]??{})),i=new Set([...v].flatMap(e=>m[e]??[])),r=[...new Set(n)].sort();if(s.kinds.includes("kit-dep")){const e=r.filter(e=>"kit-dep"===x(e));S=e.filter(e=>!i.has(e)),j=e.filter(e=>i.has(e)),S.length&&$.set(A(N,"kit-dep"),S.length)}s.kinds.includes("chart-dep")&&(L=r.filter(e=>"chart-dep"===x(e)),L.length&&$.set(A(N,"chart-dep"),L.length))}else for(const e of R)r.push(`"kinds" includes "${e}", and there is no ${N} here to read.`)}for(const e of s.allow)(d(e.kind)?e.file===N:p.has(e.file))||r.push(`"allow": ${e.file} (${e.kind}) is not a file this check reads. Delete the entry, or fix the path.`);return{files:w,hits:b,counts:$,kitDeps:S,shellPeers:j,chartDeps:L,problems:r}}(g,t.cwd,f);if(0===k.files.length)return c(`read no files. "include" in ${_e} matches nothing, so a pass would mean nothing.`);const b=n(t.cwd,Ge),$=r.json,v=e=>{$||t.out(e)};if(r.print)return t.out(M(Me(f,k,f.kinds)).trimEnd()),0;if(r.summary){for(const e of function(e,t){const n=new Map,i=new Map;for(const[e,o]of t.counts){const{file:t,kind:s}=z(e);if(!l(s))continue;const r=n.get(s)??{count:0,files:new Set};r.count+=o,r.files.add(t),n.set(s,r);const a=t.split("/"),c=a.length>2?a.slice(0,2).join("/"):2===a.length?a[0]:".",d=i.get(c)??{};d[s]=(d[s]??0)+o,i.set(c,d)}const o=e.kinds.filter(e=>n.has(e)),s=[`**UI kit check (harness UI-24):** ${new Set([...t.counts.keys()].map(e=>z(e).file)).size} of ${Qe(t.files.length,"file")} still draw UI of their own.`,"","| Kind | Count | Files | The shell has |","|---|---:|---:|---|",...e.kinds.map(e=>{const t=n.get(e);return`| \`${e}\` | ${t?.count??0} | ${t?.files.size??0} | ${h[e].instead} |`})];if(o.length&&i.size){const e=e=>o.reduce((t,n)=>t+(e[n]??0),0),t=[...i].sort((t,n)=>e(n[1])-e(t[1])||(t[0]<n[0]?-1:1));s.push("",`| Folder | ${o.map(e=>`\`${e}\``).join(" | ")} | Total |`,`|---|${o.map(()=>"---:").join("|")}|---:|`,...t.map(([t,n])=>`| \`${t}\` | ${o.map(e=>n[e]??0).join(" | ")} | ${e(n)} |`))}return s}(f,k))t.out(e);return 0}let S=null;if(i(b))try{S=T(o(b,"utf8"),Ge)}catch(e){return c(e instanceof R?e.message:String(e))}if(r.init){const e=r.kinds.filter(e=>!l(e)||!f.kinds.includes(e));if(e.length)return c(`--kind ${e.join(", ")}: not in "kinds" in ${_e}. Add it there first.`);const t=r.kinds;if(S){if(0===t.length)return c(`${Ge} already exists, and --init would overwrite what it holds. It is for the adoption pull request only. To start checking a kind, add it to "kinds" and run --init --kind <kind>.`);const e=t.filter(e=>S.kinds.includes(e));if(e.length)return c(`the baseline was already taken for ${e.join(", ")}. Its lines only go down; use --update.`);const n=Me(f,k,t);S={kinds:[...S.kinds,...t],counts:new Map([...S.counts,...n.counts])}}else{if(t.length)return c(`there is no ${Ge} yet. Run --init on its own first.`);S=Me(f,k,f.kinds)}s(b,M(S)),v(`${Ke}: wrote ${Ge} (${Qe(S.counts.size,"line")}: ${Ve(S.counts,S.kinds)})`)}if(!S)return c(`no ${Ge}. This repository has not adopted the check yet: run ${Ke} --init, and commit the file.`);if(r.update){const e=function(e,t,n,{allowMove:i=!1}={}){const o=Ce(e,t),s=Me(e,n,o),r=new Map([...t.counts].filter(([e])=>o.includes(z(e).kind)));if(i){const e=B(r),n=B(s.counts),i=o.filter(t=>(n[t]??0)>(e[t]??0)).map(t=>`${t}: ${n[t]??0} across the repository, and the baseline holds ${e[t]??0}`);return i.length?{baseline:t,lowered:0,refused:i}:{baseline:s,lowered:Be(r,s.counts),refused:[]}}const a=new Map;for(const[e,t]of r){const n=Math.min(t,s.counts.get(e)??0);n>0&&a.set(e,n)}return{baseline:{kinds:o,counts:a},lowered:Be(r,a),refused:[]}}(f,S,k,{allowMove:r.allowMove});if(e.refused.length)return c(`--allow-move follows code that moved, and this is more of it than before:\n - ${e.refused.join("\n - ")}\nNothing was written.`);S=e.baseline,s(b,M(S)),v(`${Ke}: ${e.lowered?`changed ${Qe(e.lowered,"line")} in`:"nothing to change in"} ${Ge}`)}const j=function(e,t,n){const i=[],o=[],s=[...n.problems],r=Ee(e),a=new Set(Ce(e,t)),c=e.kinds.filter(e=>!t.kinds.includes(e));c.length&&s.push(`"kinds" names ${c.map(e=>`"${e}"`).join(", ")}, and the baseline was never taken for ${1===c.length?"it":"them"}. Run: efficient-shell-ui-check --init ${c.map(e=>`--kind ${e}`).join(" ")}`);const d=t.kinds.filter(t=>!e.kinds.includes(t));d.length&&o.push(`the baseline still carries ${d.map(e=>`"${e}"`).join(", ")}, which "kinds" no longer names`);const u=new Set([...n.counts.keys(),...t.counts.keys(),...r.keys()]);for(const e of[...u].sort(C)){const{file:c,kind:d}=z(e);if(!l(d)||!a.has(d))continue;const u=n.counts.get(e)??0,p=r.get(e)??0,f=t.counts.get(e)??0;u>p+f?i.push(`${c}: ${d} ${u}, and its line allows ${p+f}${Te(n,c,d)}. ${h[d].counts} is counted; use ${h[d].instead}.`):u<p?s.push(`${c}: ${d} ${u}, and "allow" in ui-kit.config.json says ${p}. ${0===u?"Delete the entry":`Lower its count to ${u}`}: an exception does not outlive what it excused.`):u<p+f&&o.push(`${c}: ${d} ${u}, and its line says ${p+f}`)}return{grown:i,shrunk:o,other:s,updateFixes:0===i.length&&0===s.length&&o.length>0}}(f,S,k),L=r.noBase?{problems:[],note:""}:function(e,t,n){const i=e.env.GITHUB_BASE_REF;if(!i)return{problems:[],note:""};const o=e.git(["rev-parse","--show-prefix"]);if(null===o)return{problems:[],note:"not a git checkout; the base branch was not compared"};const s=`origin/${i}`;if(null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])&&(e.git(["fetch","--no-tags","--depth=1","origin",`+refs/heads/${i}:refs/remotes/origin/${i}`]),null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])))return{problems:[],note:`${s} could not be fetched; the base branch was not compared`};const r=e.git(["show",`${s}:${o.trim()}${Ge}`]);if(null===r)return{problems:[],note:`${s} has no ${Ge} yet (adoption)`};let a;try{a=T(r,`${s}:${Ge}`)}catch{return{problems:[],note:`${s}'s ${Ge} could not be read; the base branch was not compared`}}const l=B(a.counts),c=B(t.counts);return{problems:n.filter(e=>a.kinds.includes(e)&&(c[e]??0)>(l[e]??0)).map(e=>`${Ge} holds ${c[e]??0} of "${e}", and ${s} holds ${l[e]??0}. The baseline only goes down: use ${h[e].instead}. A count that is meant to stay goes in "allow" in ${_e}, with its reason.`),note:`compared with ${s}`}}(t,S,f.kinds),E=f.kinds.filter(e=>S.kinds.includes(e)),F=`${Ke} --update`,J=[...j.other,...j.grown,...j.shrunk.map(e=>`${e}. Run: ${F}`),...L.problems],U=0===J.length;if(r.json){const e=new Map(f.allow.map(e=>[`${e.file}:${e.kind}`,e.count]));return t.out(JSON.stringify({tool:Ke,version:t.version,ok:U,schema:f.schema,kinds:f.kinds,files:k.files.length,counts:B(k.counts),baseline:B(S.counts),allowed:B(e),kitDeps:k.kitDeps,shellPeers:k.shellPeers,chartDeps:k.chartDeps,failures:J},null,2)),U?0:1}t.out(`UI kit check (harness UI-24), efficient-shell ${t.version}\n`);const W=(e,n,i="")=>{if(0===n.length)return t.out(` ok ${e}`);t.err(` FAIL ${e}`);for(const e of n)t.err(` ${e}`);i&&t.err(` ${i}`)};t.out(` ok the reader reads its own fixtures (typescript ${g.version})`),t.out(` ok read ${Qe(k.files.length,"file")}`),W(`${_e} and ${Ge} describe this repository`,j.other),W("no file draws more of its own UI than its line allows",j.grown),W("every line is exact: a count that fell is a line to lower",j.shrunk,`Run: ${F}${j.updateFixes?"":" (after the failures above are fixed)"}`),L.note&&W(`the baseline is no higher than the base branch (${L.note})`,L.problems);const q=new Set([...k.counts.keys()].map(e=>z(e).file));return t.out(` ok PROGRESS: ${q.size} of ${Qe(k.files.length,"file")} still draw UI of their own: `+Ve(k.counts,E)),t.out(""),U?t.out("UI kit check: ok"):t.err(`UI kit check: FAILED (${Qe(J.length,"problem")})`),U?0:1}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>function(e){for(const i of[n(process.cwd(),"package.json"),e])try{return t(i)("typescript")}catch{}throw new Error("typescript is not installed")}(import.meta.url),git:function(t){try{return e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:6e4,maxBuffer:67108864})}catch{return null}},version:"10.16.0"});
|
|
2
|
+
import{execFileSync as e}from"child_process";import{createRequire as t}from"module";import{join as n}from"path";import{existsSync as i,readFileSync as o,writeFileSync as s,readdirSync as r}from"fs";var a=["button","input","range","textarea","select","dialog","title","portal","native","dark","hex","radius","spacing","font-size","z-index","shadow","kit","icon","svg","kit-dep","chart","chart-dep","ellipsis-label","colour"],l=e=>"string"==typeof e&&a.includes(e),c=["kit-dep","chart-dep"],d=e=>c.includes(e),u=a.filter(e=>!d(e)),h={button:{counts:"a raw <button>",instead:"Button or IconButton from efficient-shell/ui"},input:{counts:"a raw <input> (not hidden, not a range)",instead:"Input, InputNumber, Checkbox, Radio or Switch from efficient-shell/ui"},range:{counts:'a raw <input type="range">',instead:"Slider from efficient-shell/ui"},textarea:{counts:"a raw <textarea>",instead:"Textarea from efficient-shell/ui"},select:{counts:"a raw <select>",instead:"Select or SearchableSelect from efficient-shell/ui"},dialog:{counts:'a raw <dialog>, or role="dialog" / role="alertdialog" on a raw element',instead:"Dialog or Modal from efficient-shell"},title:{counts:"a title= on a raw element (the browser's own tooltip)",instead:"Tooltip from efficient-shell/ui (harness UI-17)"},portal:{counts:"a createPortal(…) call (a layer the file floats itself)",instead:"Popover, PopupMenu, DropdownMenu, Tooltip or Dialog from efficient-shell/ui"},native:{counts:"window.confirm / alert / prompt, or a bare call that resolves to one",instead:"confirm, confirmDestructive, prompt or toast from efficient-shell (harness UI-20)"},dark:{counts:"a dark: variant in a class string",instead:"the light Tailwind class alone; the shell remaps it in dark mode (harness UI-7)"},hex:{counts:"a hex colour literal in a .tsx string",instead:"a colour role from efficient-shell: its utility or var(--role), COLOUR_ROLES lists them (harness FT-1; the colour kind counts palette classes too)"},radius:{counts:"a literal corner radius (an arbitrary-value radius class, or an inline borderRadius)",instead:"a radius utility from the scale or a role token such as rounded-(--radius-control); the theme sets how round they are (harness UI-7)"},spacing:{counts:"a padding, margin or gap off the scale (6px, 10px, 14px …) or written as a literal length (an arbitrary-value class, an inline style)",instead:"a step of the scale 2/4/8/12/16/20/24/32/40/48 — a Tailwind step, or a role such as var(--space-control-x) (owner ruling 2026-10-12)"},"font-size":{counts:"a literal font size (an arbitrary-value text class, an inline fontSize)",instead:"a type step 9/11/12/14/16/18/20/24/30 — Tailwind's 3xs … 3xl text steps (owner ruling 2026-10-12)"},"z-index":{counts:"a stack order above 30 written as a number (a z utility, an arbitrary value, an inline zIndex)",instead:"a named layer: Z_LAYERS (efficient-shell/ui) in code, its --z-* custom property in markup"},shadow:{counts:"a literal shadow, or a shadow size that is not an elevation level (md, 2xl, xs)",instead:"an elevation: the sm / lg / xl utilities, or var(--elevation-panel) and its siblings (owner ruling 2026-10-12)"},kit:{counts:"an import of a second UI kit",instead:"the component from efficient-shell/ui, or fold it into the shell (harness FT-3)"},icon:{counts:"an import of an icon package",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24)"},svg:{counts:"an <svg> element written in JSX: an icon drawn in place",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24). A chart, an illustration or a mark a host supplies stays on the baseline"},"kit-dep":{counts:"a UI kit or icon package declared in package.json (not one the shell entries imported here need)",instead:"remove the dependency once nothing imports it (harness FT-3)"},chart:{counts:"an import of a second chart library",instead:"a chart from efficient-shell/ui (ChartFrame, TimeSeriesChart, ColumnChart, RankedBars, PieChart, FunnelChart, ScatterChart, …), or add the chart there: one chart system (harness FT-3)"},"chart-dep":{counts:"a chart library declared in package.json",instead:"remove the dependency once nothing imports it (harness FT-3)"},"ellipsis-label":{counts:'a button, link or menu label that ends in "…" or "..."',instead:'the label without the dots, saying what it does ("Extend trial"): "…" means only "the words are cut" (owner ruling 2026-10-14)'},colour:{counts:"a literal colour, in a script string or a stylesheet: a hex, an rgb() / hsl() / oklch() value, a Tailwind palette class (a hue and a step, or white / black), a --color-<hue>-<step> variable, or a named colour in a colour property — a var() fallback included",instead:"a colour role from efficient-shell: its utility (the text, background or border utility of ink, ink-faint, surface, line, accent-fill, accent-text, danger-text, status-danger-line …) or var(--role); COLOUR_ROLES lists them. A merchant site reads the site theme (owner ruling 2026-10-23)"}},p=["@headlessui/","@radix-ui/","@mui/","@chakra-ui/","@mantine/","@floating-ui/","antd","react-aria","react-aria-","react-bootstrap","react-select","react-colorful","react-tooltip","react-hot-toast","react-toastify","sonner"],f=["@heroicons/","@tabler/icons","@tabler/icons-","@phosphor-icons/","@fortawesome/","@iconify/","@radix-ui/react-icons","@mui/icons-material","lucide","lucide-react","simple-icons","react-icons","react-feather"],g=["recharts","chart.js","react-chartjs-2","d3","d3-","@nivo/","victory","victory-","echarts","echarts-for-react","apexcharts","react-apexcharts","@visx/","highcharts","highcharts-react-official","plotly.js","plotly.js-dist","react-plotly.js","lightweight-charts","@antv/g2","@antv/g2plot","chartist","billboard.js","c3","uplot"],m={"efficient-shell":["@headlessui/react"]};function w(e,t){return t.some(t=>t.endsWith("/")||t.endsWith("-")?e.startsWith(t):e===t||e.startsWith(`${t}/`))}function k(e){return w(e,f)?"icon":w(e,p)?"kit":w(e,g)?"chart":null}function x(e){const t=k(e);return"kit"===t||"icon"===t?"kit-dep":"chart"===t?"chart-dep":null}var b=/[.+^$()|[\]\\]/g;function $(e){let t="",n=0;for(let i=0;i<e.length;i++){const o=e[i];"*"===o?"*"===e[i+1]?"/"===e[i+2]?(t+="(?:[^/]+/)*",i+=2):(t+=".*",i+=1):t+="[^/]*":"?"===o?t+="[^/]":"{"===o?(t+="(?:",n+=1):"}"===o&&n>0?(t+=")",n-=1):t+=","===o&&n>0?"|":o.replace(b,"\\$&")}if(0!==n)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${t}$`)}function y(e){const t=e.map($);return e=>t.some(t=>t.test(e))}var v=new Set(["node_modules",".git"]),S=new Set(["dist","coverage",".next",".turbo"]);function j(e){const t=e.search(/[*?{]/),n=-1===t?e:e.slice(0,t),i=n.lastIndexOf("/");return-1===i?"":n.slice(0,i)}function I(e,t){const i=y(t),o=[...new Set(t.map(j))].sort(),s=o.filter(e=>!o.some(t=>t!==e&&(""===t||e.startsWith(`${t}/`)))),a=new Set,l=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?v.has(e.name)||""===t&&S.has(e.name)||l(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)l(e);return[...a].sort(L)}var L=(e,t)=>e<t?-1:e>t?1:0,R=class extends Error{},A=(e,t)=>`${e}:${t}`;function z(e){const t=e.lastIndexOf(":");return{file:e.slice(0,t),kind:e.slice(t+1)}}var E=e=>a.indexOf(e);function C(e,t){const n=z(e),i=z(t);return L(n.file,i.file)||E(n.kind)-E(i.kind)}function T(e,t="ui-kit.baseline.json"){let n;try{n=JSON.parse(e)}catch(e){throw new R(`${t} is not valid JSON: ${e.message}`)}const i=e=>{throw new R(`${t}: ${e}. The tool writes this file; do not edit it by hand.`)};if("object"!=typeof n||null===n||Array.isArray(n))return i("must be a JSON object");const o=n;if(1!==o.schema)return i("number"==typeof o.schema&&o.schema>1?`"schema": ${o.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');if(!Array.isArray(o.kinds)||o.kinds.some(e=>"string"!=typeof e))return i('"kinds" must be a list');const s=o.kinds.filter(l);if("object"!=typeof o.counts||null===o.counts||Array.isArray(o.counts))return i('"counts" must be an object');const r=new Map;for(const[e,t]of Object.entries(o.counts)){const{file:n,kind:o}=z(e);if(!n||!o)return i(`"${e}" is not "<file>:<kind>"`);if("number"!=typeof t||!Number.isInteger(t)||t<1)return i(`"${e}" must be a whole number, 1 or more (a line that reaches 0 is deleted)`);l(o)&&r.set(e,t)}return{kinds:s,counts:r}}function M(e){const t=a.filter(t=>e.kinds.includes(t)),n=[...e.counts.keys()].filter(t=>(e.counts.get(t)??0)>0).sort(C).map(t=>` ${JSON.stringify(t)}: ${e.counts.get(t)}`);return["{",' "schema": 1,',` "kinds": [${t.map(e=>JSON.stringify(e)).join(", ")}],`,n.length?` "counts": {\n${n.join(",\n")}\n }`:' "counts": {}',"}",""].join("\n")}function B(e){const t={};for(const[n,i]of e){const{kind:e}=z(n);l(e)&&(t[e]=(t[e]??0)+i)}return t}var P=class extends Error{},O=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),D=new Set(["$schema","schema","kinds","include","exclude","includeImporting","output","allow"]);var N="package.json",F=[2,4,8,12,16,20,24,32,40,48];function J(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&F.includes(4*t)}var U=new Set(["iframe","frame","object","embed"]),W=new Set(["href","xlinkHref","to","id","key","htmlFor"]),q=/(?<![&\w])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,_=/(?<![\w-])rounded(?:-(?:[trblse]|tl|tr|br|bl|ss|se|ee|es))?-\[([^\]]*)\]/g,G=/^border(?:(?:Top|Bottom)(?:Left|Right)|(?:Start|End)(?:Start|End))?Radius$/,K=/^(?:inherit|initial|unset|revert)$|var\(|^(?:50|100)%$|^(?:999|9999)(?:px)?$/,H=/(?<![\w-])-?(?:p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|space-x|space-y)-(\d+(?:\.\d+)?|px|\[[^\]]*\])(?![\w.[/-])/g,Q=/(?<![\w-])text-\[(?:length:)?(\d*\.?\d+(?:px|rem|em|%))\]/g,V=/(?<![\w-])z-(\d+|\[[^\]]*\])(?![\w.[/-])/g,X=/(?<![\w-])shadow-(xs|2xs|md|2xl|\[[^\]]*\])(?![\w.[/-])/g,Z=/var\(|^(?:inherit|initial|unset|revert|revert-layer|none|auto)$/,Y=/^(?:(?:padding|margin)(?:Top|Right|Bottom|Left|Inline|Block|InlineStart|InlineEnd|BlockStart|BlockEnd)?|gap|rowGap|columnGap)$/,ee=new Set([0,...F]),te=/(?<![\w-])dark:(?=[\w[\-!@*(])/g,ne="slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose",ie="(?:50|[1-9]00|950)",oe=new RegExp(`(?<![\\w-])(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|inset-ring|outline|divide|fill|stroke|from|via|to|shadow|inset-shadow|drop-shadow|accent|caret|decoration|placeholder)-(?:(?:${ne})-${ie}|white|black)(?:\\/[\\w.]+)?(?![\\w-])`,"g"),se=new RegExp(`--color-(?:(?:${ne})-${ie}|white|black)(?![\\w-])`,"g"),re=/(?<![\w-])(?:rgba?|hsla?|hwb|oklch|oklab|lab|lch)\(\s*[\d.]/g,ae=/(?<![\w-])(?:white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|maroon|navy|teal|olive|lime|aqua|fuchsia|brown|gold|beige|ivory|tan|crimson|coral|salmon|indigo|violet)(?![\w-])/gi,le=/^(?:color|background(?:Color)?|border(?:Top|Right|Bottom|Left|Inline|Block)?(?:Color)?|outline(?:Color)?|fill|stroke|caretColor|accentColor|textDecorationColor|boxShadow|textShadow)$/,ce=/(?<![&a-zA-Z0-9])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,de=e=>[...e.matchAll(ce)].length+[...e.matchAll(re)].length+[...e.matchAll(oe)].length+[...e.matchAll(se)].length,ue=new Set(["button","a","option","Button","IconButton","SplitButton","Link","NavLink","PopupMenuItem","PopupMenuLabel","DropdownMenuItem","MenuItem","ContextMenuItem"]),he=/(?:…|\.\.\.|…)\s*$/,pe=new RegExp("\\p{L}","u"),fe=new RegExp("\\p{L}[\\p{L}-]*","u"),ge={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"],zhStarts:["正在"],zhEnds:["中"]},placeholder:{},prompt:{}},me=new Set((ge.busy?.words??[]).map(e=>e.toLowerCase())),we=new Set(["label","aria-label",...ge.placeholder?[]:["placeholder","searchPlaceholder","emptyOptionLabel","blankLabel"]]),ke=(e,t)=>{if(!he.test(t)||!pe.test(e))return!1;const n=e.match(fe)?.[0]?.toLowerCase();if(n&&me.has(n))return!1;const i=e.replace(he,"").trim(),o=ge.busy;return!(o&&(o.zhStarts.some(e=>i.startsWith(e))||o.zhEnds.some(e=>i.endsWith(e))))},xe=new Set(["confirm","alert","prompt"]),be=new Set(["window","globalThis","self"]);var $e=e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"),ye=e=>/\.(?:css|scss)$/.test(e),ve=/^(?:color|background(?:-color)?|border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?(?:-color)?|outline(?:-color)?|fill|stroke|caret-color|accent-color|text-decoration(?:-color)?|box-shadow|text-shadow|column-rule(?:-color)?)$/;function Se(e,t){if(!t.includes("colour"))return{};const n=e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g," ")),i=[],o=e=>n.slice(0,e).split("\n").length;let s=0,r=0;for(let e=0;e<n.length;e++){const t=n[e];if("{"===t||"}"===t||";"===t){const a=n.slice(r,e);if("{"!==t&&s>0){const e=r+(a.length-a.trimStart().length),t=a.trim(),n=t.indexOf(":");if(t.startsWith("@apply"))for(let n=[...t.matchAll(oe)].length;n>0;n--)i.push(o(e));else if(n>0){const s=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1);if(!/^(?:-webkit-)?mask/.test(s)){const t=de(r)+(ve.test(s)?[...r.matchAll(ae)].length:0);for(let n=0;n<t;n++)i.push(o(e))}}}"{"===t?s++:"}"===t&&(s=Math.max(0,s-1)),r=e+1}}return i.length?{colour:i}:{}}function je(e,t,n,i,o){const s=new Set(i),r=e.createSourceFile(t,n,e.ScriptTarget.Latest,!0,function(e,t){return t.endsWith(".tsx")?e.ScriptKind.TSX:t.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(t)?e.ScriptKind.JS:e.ScriptKind.TS}(e,t)),a={},l=/\.[jt]sx$/.test(t),c=e=>r.getLineAndCharacterOfPosition(e).line+1,d=(e,t)=>{s.has(e)&&(a[e]??=[]).push(c(t.getStart(r)))},u=(t,n)=>t.attributes.properties.find(t=>e.isJsxAttribute(t)&&t.name.getText(r)===n),h=t=>{const n=t?.initializer;if(n)return e.isStringLiteral(n)?n.text:e.isJsxExpression(n)&&n.expression&&e.isStringLiteralLike(n.expression)?n.expression.text:void 0},p=new Set;if(s.has("native")){const t=n=>{if(n)if(e.isIdentifier(n))xe.has(n.text)&&p.add(n.text);else if(e.isObjectBindingPattern(n)||e.isArrayBindingPattern(n))for(const i of n.elements)e.isBindingElement(i)&&t(i.name)},n=i=>{(e.isImportClause(i)||e.isImportSpecifier(i)||e.isNamespaceImport(i)||e.isVariableDeclaration(i)||e.isParameter(i)||e.isFunctionDeclaration(i))&&t(i.name),e.forEachChild(i,n)};n(r)}const f=t=>t&&e.isStringLiteralLike(t)?t.text:void 0,g=(e,t)=>{e&&("efficient-shell"===e||e.startsWith("efficient-shell/"))&&o?.add(e);const n=e?k(e):null;n&&d(n,t)},m=(e,t,n)=>{if(s.has("dark"))for(const n of e.matchAll(te))d("dark",t);if(s.has("radius"))for(const n of e.matchAll(_))K.test(n[1].trim())||d("radius",t);if(n&&l&&s.has("hex"))for(const n of e.matchAll(q))d("hex",t);if(n&&s.has("colour"))for(let n=de(e);n>0;n--)d("colour",t);if(s.has("spacing"))for(const n of e.matchAll(H)){const e=n[1];(e.startsWith("[")?Z.test(e.slice(1,-1).trim()):J(e))||d("spacing",t)}if(s.has("font-size"))for(const n of e.matchAll(Q))d("font-size",t);if(s.has("z-index"))for(const n of e.matchAll(V)){const e=n[1].startsWith("[")?n[1].slice(1,-1).trim():n[1];/^\d+$/.test(e)&&Number(e)>30&&d("z-index",t)}if(s.has("shadow"))for(const n of e.matchAll(X))n[1].startsWith("[")&&Z.test(n[1].slice(1,-1).trim())||d("shadow",t)},w=(t,n,i)=>{const o=e.isStringLiteralLike(n)?n.text.trim():void 0;if(s.has("colour")&&void 0!==o&&le.test(t))for(const e of o.matchAll(ae))d("colour",i);if(s.has("spacing")&&Y.test(t))e.isNumericLiteral(n)?ee.has(Number(n.text))||d("spacing",i):void 0!==o&&!Z.test(o)&&(e=>[...e.matchAll(/(-?\d*\.?\d+)(px|rem|em)\b/g)].map(e=>Math.abs(Number(e[1]))*("px"===e[2]?1:16)))(o).some(e=>!ee.has(e))&&d("spacing",i);else if(s.has("font-size")&&"fontSize"===t)(e.isNumericLiteral(n)||void 0!==o&&!Z.test(o)&&!/^(?:smaller|larger)$/.test(o))&&d("font-size",i);else if(s.has("z-index")&&"zIndex"===t){const t=[],o=n=>{e.isNumericLiteral(n)||e.isStringLiteralLike(n)&&/^\d+$/.test(n.text.trim())?t.push(Number(n.text)):e.forEachChild(n,o)};o(n);for(const e of t)e>30&&d("z-index",i)}else s.has("shadow")&&"boxShadow"===t&&(void 0===o||""===o||Z.test(o)||d("shadow",i))},x=(t,n)=>{if(e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)){const e=t.tagName.getText(r);if(/^[a-z]/.test(e)){const n=h(u(t,"type"));"svg"===e&&d("svg",t),"button"===e?d("button",t):"select"===e?d("select",t):"textarea"===e?d("textarea",t):"input"===e&&("range"===n?d("range",t):"hidden"!==n&&d("input",t));const i=h(u(t,"role"));"dialog"!==e&&"dialog"!==i&&"alertdialog"!==i||d("dialog",t),!U.has(e)&&u(t,"title")&&d("title",t)}}else if(e.isCallExpression(t)){const n=t.expression;e.isIdentifier(n)?"createPortal"===n.text?d("portal",t):xe.has(n.text)&&!p.has(n.text)?d("native",t):"require"===n.text&&g(f(t.arguments[0]),t):e.isPropertyAccessExpression(n)?"createPortal"===n.name.text?d("portal",t):xe.has(n.name.text)&&e.isIdentifier(n.expression)&&be.has(n.expression.text)&&d("native",t):n.kind===e.SyntaxKind.ImportKeyword&&g(f(t.arguments[0]),t)}else{if(e.isImportDeclaration(t)||e.isExportDeclaration(t))return void g(f(t.moduleSpecifier),t);if(e.isPropertyAssignment(t)){const n=e.isIdentifier(t.name)||e.isStringLiteralLike(t.name)?t.name.text:"",i=t.initializer;w(n,i,t),s.has("radius")&&G.test(n)&&(e.isNumericLiteral(i)?K.test(i.text)||d("radius",t):e.isStringLiteralLike(i)&&!K.test(i.text.trim())&&d("radius",t))}else if(e.isStringLiteralLike(t))m(t.text,t,n);else if(e.isTemplateExpression(t)){m(t.head.text,t.head,n);for(const e of t.templateSpans)m(e.literal.text,e.literal,n)}}e.isJsxAttribute(t)&&W.has(t.name.getText(r))?e.forEachChild(t,e=>x(e,!1)):e.forEachChild(t,e=>x(e,n))};return x(r,!0),s.has("ellipsis-label")&&function(e,t,n){const i=new Set,o=(e,t)=>{i.has(e)||(i.add(e),n(t))},s=n=>{if(n)if(e.isStringLiteralLike(n))ke(n.text,n.text)&&o(n,n.getStart(t));else if(e.isTemplateExpression(n)){const e=[n.head.text,...n.templateSpans.map(e=>e.literal.text)];ke(e.join(" "),e[e.length-1])&&o(n,n.getStart(t))}else e.isConditionalExpression(n)?(s(n.whenTrue),s(n.whenFalse)):e.isBinaryExpression(n)?(s(n.left),s(n.right)):e.isParenthesizedExpression(n)||e.isAsExpression(n)||e.isJsxExpression(n)?s(n.expression):e.isCallExpression(n)&&Ie.has(Le(n.expression))&&n.arguments[0]&&s(n.arguments[0])},r=n=>{for(const i of n)if(e.isJsxText(i)){const e=i.getText(t);ke(e,e)&&o(i,i.getStart(t)+(e.length-e.trimStart().length))}else e.isJsxExpression(i)?s(i.expression):(e.isJsxElement(i)||e.isJsxFragment(i))&&r(i.children)},a=(n,i)=>{const o=n.attributes.properties.find(n=>e.isJsxAttribute(n)&&n.name.getText(t)===i),s=o?.initializer;return s&&e.isStringLiteral(s)?s.text:s&&e.isJsxExpression(s)&&s.expression&&e.isStringLiteralLike(s.expression)?s.expression.text:void 0},l=t=>t.properties.some(t=>e.isPropertyAssignment(t)&&(e.isIdentifier(t.name)||e.isStringLiteralLike(t.name))&&"value"===t.name.text&&e.isStringLiteralLike(t.initializer)&&""===t.initializer.text),c=n=>{if(e.isJsxElement(n)){const e=n.openingElement,i=e.tagName.getText(t),o="option"===i&&ge.prompt&&""===a(e,"value");ue.has(i)&&!o&&r(n.children)}else if(e.isJsxAttribute(n))we.has(n.name.getText(t))&&s(n.initializer);else if(e.isPropertyAssignment(n)){const t=e.isIdentifier(n.name)||e.isStringLiteralLike(n.name)?n.name.text:"",i=ge.prompt&&e.isObjectLiteralExpression(n.parent)&&l(n.parent);we.has(t)&&!i&&s(n.initializer)}e.forEachChild(n,c)};c(t)}(e,r,e=>(a["ellipsis-label"]??=[]).push(c(e))),a}var Ie=new Set(["say","t"]),Le=e=>{const t=e.getText();return t.slice(t.lastIndexOf(".")+1)};function Re(e){const t={};for(const[n,i]of Object.entries(e))i.length&&(t[n]=i.length);return t}function Ae(e,t,n){const i=e.createSourceFile(t,n,e.ScriptTarget.Latest,!1),o=[];for(const t of i.statements)(e.isImportDeclaration(t)||e.isExportDeclaration(t))&&t.moduleSpecifier&&e.isStringLiteralLike(t.moduleSpecifier)&&o.push(t.moduleSpecifier.text);return o}var ze=(e,t)=>e.some(e=>t.some(t=>t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t));var Ee=e=>new Map(e.allow.map(e=>[A(e.file,e.kind),e.count]));function Ce(e,t){return e.kinds.filter(e=>t.kinds.includes(e))}var Te=(e,t,n)=>{if("kit-dep"===n)return` (${e.kitDeps.join(", ")})`;if("chart-dep"===n)return` (${e.chartDeps.join(", ")})`;const i=e.hits.get(t)?.[n]??[];if(0===i.length)return"";const o=i.slice(0,12).join(", ");return` (line${1===i.length?"":"s"} ${o}${i.length>12?", …":""})`};function Me(e,t,n){const i=Ee(e),o=new Map;for(const[e,s]of t.counts){const{kind:t}=z(e);if(!l(t)||!n.includes(t))continue;const r=s-(i.get(e)??0);r>0&&o.set(e,r)}return{kinds:a.filter(e=>n.includes(e)),counts:o}}function Be(e,t){let n=0;for(const i of new Set([...e.keys(),...t.keys()]))(e.get(i)??0)!==(t.get(i)??0)&&(n+=1);return n}var Pe="\n// <button> in a comment is not a button, and <svg> in one is not a drawing\n/* nor is <input title=\"x\"> in this one, or dark:bg-black, or #fff */\nimport { createPortal } from 'react-dom';\nimport { Dialog } from '@headlessui/react';\nimport { TrashIcon } from '@heroicons/react/24/outline';\nimport type { Icon } from 'lucide-react';\nimport { Button, confirm } from 'efficient-shell';\nexport { Slot } from '@radix-ui/react-slot';\nexport { CheckIcon } from '@radix-ui/react-icons';\nimport { LineChart } from 'recharts';\nimport 'd3-scale';\nexport { VictoryPie } from 'victory';\nimport { BarChart } from '@mui/x-charts';\nimport Tree from 'react-d3-tree';\nimport { TimeSeriesChart } from 'efficient-shell/ui';\n// import 'chart.js' in a comment is not an import, and 'echarts' in a string is not one either\nconst chartLabel = 'd3-array';\n\nconst a = <button title=\"Says what it does\">x</button>;\nconst b = <input type=\"range\" />;\nconst c = <input type=\"text\" />;\nconst c2 = <input type={\"hidden\"} name=\"csrf\" />;\nconst c3 = <input type=\"hidden\" />;\nconst c4 = <input type={kind} />;\nconst d = <select />;\nconst d2 = <textarea />;\nconst e = <div role=\"dialog\" />;\nconst e2 = <dialog open />;\nconst e3 = <section role={'alertdialog'} />;\nconst f = <iframe title=\"Preview\" />;\nconst f2 = <object title=\"Chart\" />;\nconst g = <Button title=\"a prop, not a tooltip\" role=\"dialog\" />;\nconst g2 = (\n <button\n type=\"button\"\n title={hint}\n >\n y\n </button>\n);\nconst h = ReactDOM.createPortal(a, document.body);\nconst i = createPortal(a, document.body);\n\nasync function leave() {\n if (window.confirm('Sure?')) return;\n globalThis.alert('No');\n alert('native: nothing binds the name');\n prompt('native too');\n await confirm('the shell: the import binds it');\n record.confirm('a method, not the popup');\n}\n\nconst j = <div className=\"bg-white dark:bg-black dark:hover:text-white is-dark:no\" />;\nconst k = clsx('text-gray-900', on && 'dark:text-gray-100');\nconst l = <span style={{ color: '#fff', background: \"#12ab34\" }} className={`border-[#0a0b0c80] ${x}`} />;\nconst m = <a href=\"#faded\" id=\"#bad\" key=\"#abc\" to=\"#face\">skip</a>;\nconst n = <label htmlFor={'#dead'}>skip</label>;\nconst o = <span>Ӓ and BG#00340 and #12345 and #added are not colours</span>;\nconst p = 'entity  ref BG#00340';\nconst q = <use xlinkHref=\"#abc\" fill=\"url(#fed)\" />;\nconst t = <div className=\"rounded-[4px] rounded-t-[0.5rem] hover:rounded-[2px] rounded-lg rounded-(--radius-card) rounded-[inherit] rounded-[var(--r)]\" />;\nconst u = <div style={{ borderRadius: 6, borderTopLeftRadius: '3px', borderBottomRightRadius: '50%', borderEndEndRadius: 'var(--radius-card)' }} />;\nconst v = <i style={{ borderRadius: 9999 }} />;\nconst w = <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 4h16\" /></svg>;\nconst w2 = <Svg viewBox=\"0 0 24 24\" />;\nconst w3 = '<svg viewBox=\"0 0 1 1\"></svg> in a string is not an element';\nconst r = lazy(() => import('@mui/material'));\nconst s = require('react-select');\nconst s2 = require('chart.js/auto');\nconst s3 = import('@nivo/line');\n",Oe={button:2,input:2,range:1,textarea:1,select:1,dialog:3,title:2,portal:2,native:4,dark:3,hex:3,radius:5,kit:5,icon:3,svg:1,chart:5,colour:8},De={kit:1,dark:1,portal:1,radius:2,chart:1,colour:2},Ne=(...e)=>e.join("-"),Fe=`\nconst s1 = <i className="${[Ne("px","2.5"),Ne("py","1.5"),"md:"+Ne("gap","1.5"),"-"+Ne("mt","1.5"),Ne("p","[10px]")].join(" ")}" />;\nconst s2 = <i className="${[Ne("p","0"),Ne("px","px"),Ne("p","0.5"),Ne("p","3"),Ne("gap-x","4"),Ne("p","12"),Ne("p","(--space-12)"),Ne("p","[var(--space-12)]"),Ne("space-x","reverse"),Ne("top","1.5")].join(" ")}" />;\nconst s3 = <i style={{ padding: 6, marginTop: '10px', gap: 8, margin: '0 auto', paddingInline: 'var(--space-12)' }} />;\nconst f1 = <i className="${[Ne("text","[11px]"),Ne("text","[0.8rem]"),Ne("text","xs"),Ne("text","[#fff]"),Ne("text","(--text-2xs)")].join(" ")}" />;\nconst f2 = <i style={{ fontSize: 12 }} />;\nconst f3 = { fontSize: 'var(--x)', font: 'inherit' };\nconst z1 = <i className="${[Ne("z","[9999]"),Ne("z","50"),Ne("z","10"),Ne("z","30"),"-"+Ne("z","10"),Ne("z","auto"),Ne("z","(--z-popup)"),Ne("z","[var(--z-popup)]")].join(" ")}" />;\nconst z2 = { zIndex: on ? 2020 : 2010 };\nconst z3 = { zIndex: Z_LAYERS.popup, top: 9999 };\nconst h1 = <i className="${[Ne("shadow","[0_1px_2px_#000]"),Ne("shadow","md"),"shadow",Ne("shadow","lg"),Ne("shadow","(--elevation-panel)"),Ne("shadow","black/20"),Ne("drop-shadow","md")].join(" ")}" />;\nconst h2 = { boxShadow: '0 1px 2px rgba(0,0,0,.1)' };\nconst h3 = { boxShadow: 'none', outline: 'var(--elevation-raised)' };\n`,Je={spacing:7,"font-size":3,"z-index":4,shadow:3,hex:1,colour:4},Ue={colour:4},We={"ellipsis-label":9},qe=e=>a.filter(t=>e[t]).map(t=>`${t} ${e[t]}`).join(", ")||"nothing";var _e="ui-kit.config.json",Ge="ui-kit.baseline.json",Ke="efficient-shell-ui-check",He=`${Ke}: every surface a person operates takes its UI from efficient-shell (harness UI-24).\n\n ${Ke} check this repository against ${Ge}\n ${Ke} --print print today's counts as a baseline, and change nothing\n ${Ke} --summary print totals per kind and per folder, as Markdown\n ${Ke} --json print the result as JSON\n ${Ke} --update lower the lines whose counts fell, and delete the ones at zero\n ${Ke} --update --allow-move also follow a renamed or split file (no total may rise)\n ${Ke} --init write the first ${Ge}\n ${Ke} --init --kind <kind> take the baseline for a kind just added to "kinds"\n ${Ke} --no-base do not compare with the pull request's base branch\n\nKinds: ${a.join(", ")}\nReads ${_e} in the current directory.`;var Qe=(e,t)=>`${e} ${t}${1===e?"":"s"}`,Ve=(e,t)=>{const n=B(e);return t.map(e=>`${e} ${n[e]??0}`).join(" · ")};process.exitCode=function(e,t){const r=function(e){const t={print:!1,summary:!1,json:!1,update:!1,allowMove:!1,init:!1,noBase:!1,help:!1,version:!1,kinds:[]};for(let n=0;n<e.length;n++){const i=e[n];if("--print"===i)t.print=!0;else if("--summary"===i)t.summary=!0;else if("--json"===i)t.json=!0;else if("--update"===i)t.update=!0;else if("--allow-move"===i)t.allowMove=!0;else if("--init"===i)t.init=!0;else if("--no-base"===i)t.noBase=!0;else if("--help"===i||"-h"===i)t.help=!0;else if("--version"===i||"-v"===i)t.version=!0;else if("--kind"===i){const i=e[++n];if(!i)return"--kind needs a kind after it";t.kinds.push(...i.split(","))}else{if(!i.startsWith("--kind="))return`unknown argument "${i}"`;t.kinds.push(...i.slice(7).split(","))}}return t.allowMove&&!t.update?"--allow-move goes with --update":t.kinds.length&&!t.init?"--kind goes with --init":[t.print,t.summary,t.update,t.init].filter(Boolean).length>1?"choose one of --print, --summary, --update and --init":t}(e);if("string"==typeof r)return t.err(`${Ke}: ${r}\n\n${He}`),2;if(r.help)return t.out(He),0;if(r.version)return t.out(t.version),0;const c=e=>(r.json?t.out(JSON.stringify({tool:Ke,version:t.version,ok:!1,failures:[e]},null,2)):t.err(`${Ke}: ${e}`),1),p=n(t.cwd,_e);if(!i(p))return c(`no ${_e} in ${t.cwd}. Run it from the repository root; the harness has the template.`);let f,g;try{f=function(e,t="ui-kit.config.json"){const n=[],i=e=>{n.push(e)},o=(e,t,{required:n=!1}={})=>{if(void 0===e&&!n)return[];if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||""===e))return i(`${t} must be a list of non-empty strings`),[];n&&0===e.length&&i(`${t} must name at least one entry`);for(const n of e)(n.startsWith("/")||n.startsWith("./")||n.includes("\\")||n.split("/").includes(".."))&&i(`${t}: "${n}" must be a path from the repository root, written with / (no ./, .. or \\)`);return e},s=(e,t)=>"string"!=typeof e||e.trim().length<10?(i(`${t} needs a "reason" a reviewer can read (a sentence, not a word)`),""):e,r=(e,t)=>void 0===e?[]:!Array.isArray(e)||e.some(e=>!O(e))?(i(`${t} must be a list of objects`),[]):e;if(!O(e))throw new P(`${t}: must be a JSON object`);for(const t of Object.keys(e))D.has(t)||i(`unknown key "${t}"`);1!==e.schema&&i("number"==typeof e.schema&&e.schema>1?`"schema": ${e.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');const c=[];if(Array.isArray(e.kinds)&&0!==e.kinds.length)for(const t of e.kinds)l(t)?c.includes(t)?i(`"kinds": "${t}" is listed twice`):c.push(t):i(`"kinds": unknown kind ${JSON.stringify(t)} (this efficient-shell knows: ${a.join(", ")})`);else i(`"kinds" must list the kinds this repository checks, from: ${a.join(", ")}`);const d=o(e.include,'"include"'),u=o(e.exclude,'"exclude"'),h=r(e.includeImporting,'"includeImporting"').map((e,t)=>({files:o(e.files,`"includeImporting"[${t}].files`,{required:!0}),modules:o(e.modules,`"includeImporting"[${t}].modules`,{required:!0}),reason:s(e.reason,`"includeImporting"[${t}]`)}));0===d.length&&0===h.length&&i('"include" must name the files that are operator UI (for example ["src/**/*.tsx"])');const p=r(e.output,'"output"').map((e,t)=>({files:o(e.files,`"output"[${t}].files`,{required:!0}),reason:s(e.reason,`"output"[${t}]`)})),f=[],g=new Set;if(r(e.allow,'"allow"').forEach((e,t)=>{const n=`"allow"[${t}]`,[r]=o([e.file],`${n}.file`),d=s(e.reason,n);if(!l(e.kind))return void i(`${n}.kind must be one of: ${a.join(", ")}`);if(c.includes(e.kind)||i(`${n}: kind "${e.kind}" is not in "kinds"`),"number"!=typeof e.count||!Number.isInteger(e.count)||e.count<1)return void i(`${n}.count must be a whole number, 1 or more`);if(!r)return;const u=`${r}:${e.kind}`;g.has(u)&&i(`${n}: ${r} already has an allow entry for "${e.kind}"`),g.add(u),f.push({file:r,kind:e.kind,count:e.count,reason:d})}),n.length)throw new P(`${t}:\n - ${n.join("\n - ")}`);return{schema:1,kinds:a.filter(e=>c.includes(e)),include:d,exclude:u,includeImporting:h,output:p,allow:f}}(JSON.parse(o(p,"utf8")),_e)}catch(e){return c(e instanceof P?e.message:`${_e} is not valid JSON: ${e.message}`)}try{g=t.loadTypeScript()}catch{return c('this check reads the TypeScript AST and found no "typescript" package here. Install it as a devDependency.')}const w=function(e){const t=[],n=u,i=[["fixture.tsx",Pe,Oe],["fixture.ts","\nimport { toast } from 'sonner';\nimport { extent } from 'd3-array';\nexport const tone = { warn: '#f59e0b' };\nexport const cls = 'ring-1 dark:ring-white rounded-[3px]';\nexport const box = { borderRadius: '0.25rem', radius: 4 };\nexport function ask(confirm: (message: string) => boolean) {\n return confirm('a parameter binds the name');\n}\nexport const mount = (node: unknown) => ReactDOM.createPortal(node, document.body);\n",De],["tokens.tsx",Fe,Je],["labels.tsx","\n// <Button>Save…</Button> in a comment is not a label\nconst l1 = <Button>Extend trial…</Button>;\nconst l2 = <PopupMenuItem onClick={go}><span>Read from a PDF...</span></PopupMenuItem>;\nconst l3 = <Button>{busy ? 'Saving…' : 'Duplicate site…'}</Button>;\nconst l4 = <Item label=\"Translate…\" aria-label={'More…'} />;\nconst l5 = [{ label: 'Reject…' }, { value: CUSTOM, label: 'Custom…' }];\nconst l6 = <option value={CUSTOM}>Different address…</option>;\nconst l7 = <PopupMenuLabel>{say(\"Duplicate to page…\")}</PopupMenuLabel>;\nconst n7 = <Button>{t('team:menu.remove')}</Button>;\nconst n1 = <Button>{`${name.slice(0, 9)}…`}</Button>;\nconst n2 = <p>Loading weather…</p>;\nconst n3 = <Input placeholder=\"Search…\" />;\nconst n4 = <option value=\"\">Pick a carrier…</option>;\nconst n5 = [{ value: '', label: 'Select…' }];\nconst n6 = <Button>Extend trial</Button>;\n",We]];for(const[o,s,r]of i){const i=Re(je(e,o,s,n));n.some(e=>(i[e]??0)!==(r[e]??0))&&t.push(`${o}: read ${qe(i)}; it holds ${qe(r)}`)}const o=Re(Se('\n/* #fff in a comment */\n.a:hover { color: #111; border: 1px solid white; }\n[data-x="#fff"] { mask-image: linear-gradient(#000, transparent); color: var(--ink); }\n.b { --mine: rgb(0 0 0 / .5); background: var(--surface, #fff); }\n',n));n.some(e=>(o[e]??0)!==(Ue[e]??0))&&t.push(`style.css: read ${qe(o)}; it holds ${qe(Ue)}`);const s=Re(je(e,"fixture.tsx",Pe,["button"]));return"button"!==Object.keys(s).join()&&t.push(`asked for button alone, the reader reported ${qe(s)}`),t}(g);if(w.length)return c(`the reader misread its own fixtures with typescript ${g.version}, so nothing it says about this repository can be trusted:\n - `+w.join("\n - "));const k=function(e,t,s){const r=[],a=y(s.exclude),l=y(s.output.flatMap(e=>e.files)),c=new Map,u=e=>{let i=c.get(e);return void 0===i&&c.set(e,i=o(n(t,e),"utf8")),i},h=(e,n)=>{for(const i of e)0===I(t,[i]).length&&r.push(`${n}: "${i}" matches no file. Delete the line, or fix the path.`)};h(s.include,'"include"'),s.output.forEach((e,t)=>h(e.files,`"output"[${t}]`)),s.includeImporting.forEach((e,t)=>h(e.files,`"includeImporting"[${t}]`));const p=new Set,f=s.kinds.includes("colour"),g=e=>($e(e)||f&&ye(e))&&!a(e)&&!l(e);for(const e of I(t,s.include))g(e)&&p.add(e);for(const n of s.includeImporting)for(const i of I(t,n.files))g(i)&&$e(i)&&!p.has(i)&&ze(Ae(e,i,u(i)),n.modules)&&p.add(i);const w=[...p].sort(),k=s.kinds.filter(e=>!d(e)),b=new Map,$=new Map,v=new Set;for(const t of w){const n=ye(t)?Se(u(t),k):je(e,t,u(t),k,v);let i=!1;for(const e of k){const o=n[e]?.length??0;o&&($.set(A(t,e),o),i=!0)}i&&b.set(t,n)}let S=[],j=[],L=[];const R=s.kinds.filter(d);if(R.length){const e=n(t,N);if(i(e)){const t=JSON.parse(o(e,"utf8")),n=["dependencies","peerDependencies","optionalDependencies"].flatMap(e=>Object.keys(t[e]??{})),i=new Set([...v].flatMap(e=>m[e]??[])),r=[...new Set(n)].sort();if(s.kinds.includes("kit-dep")){const e=r.filter(e=>"kit-dep"===x(e));S=e.filter(e=>!i.has(e)),j=e.filter(e=>i.has(e)),S.length&&$.set(A(N,"kit-dep"),S.length)}s.kinds.includes("chart-dep")&&(L=r.filter(e=>"chart-dep"===x(e)),L.length&&$.set(A(N,"chart-dep"),L.length))}else for(const e of R)r.push(`"kinds" includes "${e}", and there is no ${N} here to read.`)}for(const e of s.allow)(d(e.kind)?e.file===N:p.has(e.file))||r.push(`"allow": ${e.file} (${e.kind}) is not a file this check reads. Delete the entry, or fix the path.`);return{files:w,hits:b,counts:$,kitDeps:S,shellPeers:j,chartDeps:L,problems:r}}(g,t.cwd,f);if(0===k.files.length)return c(`read no files. "include" in ${_e} matches nothing, so a pass would mean nothing.`);const b=n(t.cwd,Ge),$=r.json,v=e=>{$||t.out(e)};if(r.print)return t.out(M(Me(f,k,f.kinds)).trimEnd()),0;if(r.summary){for(const e of function(e,t){const n=new Map,i=new Map;for(const[e,o]of t.counts){const{file:t,kind:s}=z(e);if(!l(s))continue;const r=n.get(s)??{count:0,files:new Set};r.count+=o,r.files.add(t),n.set(s,r);const a=t.split("/"),c=a.length>2?a.slice(0,2).join("/"):2===a.length?a[0]:".",d=i.get(c)??{};d[s]=(d[s]??0)+o,i.set(c,d)}const o=e.kinds.filter(e=>n.has(e)),s=[`**UI kit check (harness UI-24):** ${new Set([...t.counts.keys()].map(e=>z(e).file)).size} of ${Qe(t.files.length,"file")} still draw UI of their own.`,"","| Kind | Count | Files | The shell has |","|---|---:|---:|---|",...e.kinds.map(e=>{const t=n.get(e);return`| \`${e}\` | ${t?.count??0} | ${t?.files.size??0} | ${h[e].instead} |`})];if(o.length&&i.size){const e=e=>o.reduce((t,n)=>t+(e[n]??0),0),t=[...i].sort((t,n)=>e(n[1])-e(t[1])||(t[0]<n[0]?-1:1));s.push("",`| Folder | ${o.map(e=>`\`${e}\``).join(" | ")} | Total |`,`|---|${o.map(()=>"---:").join("|")}|---:|`,...t.map(([t,n])=>`| \`${t}\` | ${o.map(e=>n[e]??0).join(" | ")} | ${e(n)} |`))}return s}(f,k))t.out(e);return 0}let S=null;if(i(b))try{S=T(o(b,"utf8"),Ge)}catch(e){return c(e instanceof R?e.message:String(e))}if(r.init){const e=r.kinds.filter(e=>!l(e)||!f.kinds.includes(e));if(e.length)return c(`--kind ${e.join(", ")}: not in "kinds" in ${_e}. Add it there first.`);const t=r.kinds;if(S){if(0===t.length)return c(`${Ge} already exists, and --init would overwrite what it holds. It is for the adoption pull request only. To start checking a kind, add it to "kinds" and run --init --kind <kind>.`);const e=t.filter(e=>S.kinds.includes(e));if(e.length)return c(`the baseline was already taken for ${e.join(", ")}. Its lines only go down; use --update.`);const n=Me(f,k,t);S={kinds:[...S.kinds,...t],counts:new Map([...S.counts,...n.counts])}}else{if(t.length)return c(`there is no ${Ge} yet. Run --init on its own first.`);S=Me(f,k,f.kinds)}s(b,M(S)),v(`${Ke}: wrote ${Ge} (${Qe(S.counts.size,"line")}: ${Ve(S.counts,S.kinds)})`)}if(!S)return c(`no ${Ge}. This repository has not adopted the check yet: run ${Ke} --init, and commit the file.`);if(r.update){const e=function(e,t,n,{allowMove:i=!1}={}){const o=Ce(e,t),s=Me(e,n,o),r=new Map([...t.counts].filter(([e])=>o.includes(z(e).kind)));if(i){const e=B(r),n=B(s.counts),i=o.filter(t=>(n[t]??0)>(e[t]??0)).map(t=>`${t}: ${n[t]??0} across the repository, and the baseline holds ${e[t]??0}`);return i.length?{baseline:t,lowered:0,refused:i}:{baseline:s,lowered:Be(r,s.counts),refused:[]}}const a=new Map;for(const[e,t]of r){const n=Math.min(t,s.counts.get(e)??0);n>0&&a.set(e,n)}return{baseline:{kinds:o,counts:a},lowered:Be(r,a),refused:[]}}(f,S,k,{allowMove:r.allowMove});if(e.refused.length)return c(`--allow-move follows code that moved, and this is more of it than before:\n - ${e.refused.join("\n - ")}\nNothing was written.`);S=e.baseline,s(b,M(S)),v(`${Ke}: ${e.lowered?`changed ${Qe(e.lowered,"line")} in`:"nothing to change in"} ${Ge}`)}const j=function(e,t,n){const i=[],o=[],s=[...n.problems],r=Ee(e),a=new Set(Ce(e,t)),c=e.kinds.filter(e=>!t.kinds.includes(e));c.length&&s.push(`"kinds" names ${c.map(e=>`"${e}"`).join(", ")}, and the baseline was never taken for ${1===c.length?"it":"them"}. Run: efficient-shell-ui-check --init ${c.map(e=>`--kind ${e}`).join(" ")}`);const d=t.kinds.filter(t=>!e.kinds.includes(t));d.length&&o.push(`the baseline still carries ${d.map(e=>`"${e}"`).join(", ")}, which "kinds" no longer names`);const u=new Set([...n.counts.keys(),...t.counts.keys(),...r.keys()]);for(const e of[...u].sort(C)){const{file:c,kind:d}=z(e);if(!l(d)||!a.has(d))continue;const u=n.counts.get(e)??0,p=r.get(e)??0,f=t.counts.get(e)??0;u>p+f?i.push(`${c}: ${d} ${u}, and its line allows ${p+f}${Te(n,c,d)}. ${h[d].counts} is counted; use ${h[d].instead}.`):u<p?s.push(`${c}: ${d} ${u}, and "allow" in ui-kit.config.json says ${p}. ${0===u?"Delete the entry":`Lower its count to ${u}`}: an exception does not outlive what it excused.`):u<p+f&&o.push(`${c}: ${d} ${u}, and its line says ${p+f}`)}return{grown:i,shrunk:o,other:s,updateFixes:0===i.length&&0===s.length&&o.length>0}}(f,S,k),L=r.noBase?{problems:[],note:""}:function(e,t,n){const i=e.env.GITHUB_BASE_REF;if(!i)return{problems:[],note:""};const o=e.git(["rev-parse","--show-prefix"]);if(null===o)return{problems:[],note:"not a git checkout; the base branch was not compared"};const s=`origin/${i}`;if(null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])&&(e.git(["fetch","--no-tags","--depth=1","origin",`+refs/heads/${i}:refs/remotes/origin/${i}`]),null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])))return{problems:[],note:`${s} could not be fetched; the base branch was not compared`};const r=e.git(["show",`${s}:${o.trim()}${Ge}`]);if(null===r)return{problems:[],note:`${s} has no ${Ge} yet (adoption)`};let a;try{a=T(r,`${s}:${Ge}`)}catch{return{problems:[],note:`${s}'s ${Ge} could not be read; the base branch was not compared`}}const l=B(a.counts),c=B(t.counts);return{problems:n.filter(e=>a.kinds.includes(e)&&(c[e]??0)>(l[e]??0)).map(e=>`${Ge} holds ${c[e]??0} of "${e}", and ${s} holds ${l[e]??0}. The baseline only goes down: use ${h[e].instead}. A count that is meant to stay goes in "allow" in ${_e}, with its reason.`),note:`compared with ${s}`}}(t,S,f.kinds),E=f.kinds.filter(e=>S.kinds.includes(e)),F=`${Ke} --update`,J=[...j.other,...j.grown,...j.shrunk.map(e=>`${e}. Run: ${F}`),...L.problems],U=0===J.length;if(r.json){const e=new Map(f.allow.map(e=>[`${e.file}:${e.kind}`,e.count]));return t.out(JSON.stringify({tool:Ke,version:t.version,ok:U,schema:f.schema,kinds:f.kinds,files:k.files.length,counts:B(k.counts),baseline:B(S.counts),allowed:B(e),kitDeps:k.kitDeps,shellPeers:k.shellPeers,chartDeps:k.chartDeps,failures:J},null,2)),U?0:1}t.out(`UI kit check (harness UI-24), efficient-shell ${t.version}\n`);const W=(e,n,i="")=>{if(0===n.length)return t.out(` ok ${e}`);t.err(` FAIL ${e}`);for(const e of n)t.err(` ${e}`);i&&t.err(` ${i}`)};t.out(` ok the reader reads its own fixtures (typescript ${g.version})`),t.out(` ok read ${Qe(k.files.length,"file")}`),W(`${_e} and ${Ge} describe this repository`,j.other),W("no file draws more of its own UI than its line allows",j.grown),W("every line is exact: a count that fell is a line to lower",j.shrunk,`Run: ${F}${j.updateFixes?"":" (after the failures above are fixed)"}`),L.note&&W(`the baseline is no higher than the base branch (${L.note})`,L.problems);const q=new Set([...k.counts.keys()].map(e=>z(e).file));return t.out(` ok PROGRESS: ${q.size} of ${Qe(k.files.length,"file")} still draw UI of their own: `+Ve(k.counts,E)),t.out(""),U?t.out("UI kit check: ok"):t.err(`UI kit check: FAILED (${Qe(J.length,"problem")})`),U?0:1}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>function(e){for(const i of[n(process.cwd(),"package.json"),e])try{return t(i)("typescript")}catch{}throw new Error("typescript is not installed")}(import.meta.url),git:function(t){try{return e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:6e4,maxBuffer:67108864})}catch{return null}},version:"10.17.0"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BoxPlotChart as default}from"../chunk-
|
|
1
|
+
export{BoxPlotChart as default}from"../chunk-O47HKK6E.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CandlestickChart as default}from"../chunk-
|
|
1
|
+
export{CandlestickChart as default}from"../chunk-XLWMM53L.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{CartesianPlot as default}from"../chunk-
|
|
2
|
+
export{CartesianPlot as default}from"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ChartBrush as default}from"../chunk-
|
|
2
|
+
export{ChartBrush as default}from"../chunk-E6GDAV5R.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ChartFrame as default}from"../chunk-
|
|
1
|
+
export{ChartFrame as default}from"../chunk-VAK5FQXH.js";import"../chunk-3IUPYCW3.js";import"../chunk-CNYAHYE6.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ChartSkeleton as default}from"../chunk-
|
|
2
|
+
export{ChartSkeleton as default}from"../chunk-3IUPYCW3.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ChordChart as default,foldChord}from"../chunk-
|
|
2
|
+
export{ChordChart as default,foldChord}from"../chunk-67MQ5S32.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ColumnChart as default}from"../chunk-
|
|
2
|
+
export{ColumnChart as default}from"../chunk-UYRMW5MO.js";import"../chunk-465RRWBY.js";import"../chunk-3IUPYCW3.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{FunnelChart as default}from"../chunk-
|
|
2
|
+
export{FunnelChart as default}from"../chunk-2H6YNMBE.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{HeatmapChart as default}from"../chunk-
|
|
2
|
+
export{HeatmapChart as default}from"../chunk-JIGFR7Z3.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{HistogramChart as default}from"../chunk-
|
|
1
|
+
export{HistogramChart as default}from"../chunk-QDKAA3HR.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/Meter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Meter as default}from"../chunk-
|
|
1
|
+
export{Meter as default}from"../chunk-OH5L6HYW.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/PieChart.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{PieChart as default}from"../chunk-
|
|
2
|
+
export{PieChart as default}from"../chunk-VWIYC2NB.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-
|
|
2
|
+
export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-77MOYIQW.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{RadialBarChart as default}from"../chunk-
|
|
2
|
+
export{RadialBarChart as default}from"../chunk-ZQKA2XKH.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{RangeChart as default}from"../chunk-
|
|
1
|
+
export{RangeChart as default}from"../chunk-VQCSHJEF.js";import"../chunk-VFC6QUEN.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{RankedBars as default}from"../chunk-
|
|
1
|
+
export{RankedBars as default}from"../chunk-SL77N7VT.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SankeyChart as default}from"../chunk-
|
|
2
|
+
export{SankeyChart as default}from"../chunk-TLMFVEMC.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SCATTER_SERIES_CAP,ScatterChart as default}from"../chunk-
|
|
2
|
+
export{SCATTER_SERIES_CAP,ScatterChart as default}from"../chunk-DYNJ2H6R.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/SpecChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SpecChart as default}from"../chunk-
|
|
1
|
+
export{SpecChart as default}from"../chunk-PW52RXPI.js";import"../chunk-GEYM4WN3.js";import"../chunk-Y3JW2GW5.js";import"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";import"../chunk-EJUNGVK2.js";import"../chunk-E6GDAV5R.js";import"../chunk-CK2YOGUS.js";import"../chunk-VAK5FQXH.js";import"../chunk-VFC6QUEN.js";import"../chunk-UYRMW5MO.js";import"../chunk-465RRWBY.js";import"../chunk-3IUPYCW3.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/StatTile.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{StatTile as default}from"../chunk-
|
|
1
|
+
export{StatTile as default}from"../chunk-JFV5CQN4.js";import"../chunk-CKCDGSTC.js";import"../chunk-TZFACUMR.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SunburstChart as default}from"../chunk-
|
|
2
|
+
export{SunburstChart as default}from"../chunk-6JSXIEH2.js";import"../chunk-TKJBZIHT.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{TimeSeriesChart as default}from"../chunk-
|
|
2
|
+
export{TimeSeriesChart as default}from"../chunk-EJUNGVK2.js";import"../chunk-E6GDAV5R.js";import"../chunk-CK2YOGUS.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-3IUPYCW3.js";import"../chunk-CNYAHYE6.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{TreemapChart as default}from"../chunk-
|
|
2
|
+
export{TreemapChart as default}from"../chunk-MJGK6QTO.js";import"../chunk-46BYGPGD.js";import"../chunk-TKJBZIHT.js";import"../chunk-CNYAHYE6.js";import"../chunk-MVZRZTQP.js";import"../chunk-6XBWM453.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{WaterfallChart as default}from"../chunk-
|
|
1
|
+
export{WaterfallChart as default}from"../chunk-NFB7PARJ.js";import"../chunk-G4GVLK44.js";import"../chunk-F27JJHNJ.js";import"../chunk-QO5E33DH.js";import"../chunk-C764JODK.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-GDQJBQ5B.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-
|
|
1
|
+
import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-LXL2UCUR.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-MVZRZTQP.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.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:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:T,rowHref:
|
|
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:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:T,rowHref:I,onRowPress:L,linkAs:R,emptyText:D,selection:P,footer:A,virtualized:E,stackOnNarrow:F=!1,stackBelow:O,className:Z=""}){const K=s(),Q=D??K.table.empty,W=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),G=F&&!E,J=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}]:[]}),U=e=>G?{role:e}:{},V=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[X,q]=i(0),Y=E?.overscan??6,_=E?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/E.rowHeight)-Y);q(e=>e===t?e:t)}:void 0,ee=E?Math.ceil(E.height/E.rowHeight)+2*Y:v.length,te=E?Math.min(X,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=E?te*E.rowHeight:0,ne=E?(v.length-re)*E.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!E)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=J.flatMap(e=>m(e)?e.columns:[e]),he=J.some(m),ue=/* @__PURE__ */new Map;if(G)for(const e of J)if(m(e))for(const t of e.columns)ue.set(t,V(e.title,e.label));const me=e=>{const t=V(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(P?.selected??[]),ge=P?v.map((e,t)=>W(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=P?36:0,we=de.length+(P?1:0),xe=de.some(e=>"left"===e.fixed),ve=G&&!P&&de.some(e=>e.cardCorner),ke=R??"a",Ne=`${p[S]} ${"sm"===S?"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",...U("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...E?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?E?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":E?"sticky z-10 bg-gray-50":"",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
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}),$e=/* @__PURE__ */c(d,{children:[
|
|
8
|
-
/* @__PURE__ */c("div",{onScroll:_,style:
|
|
8
|
+
/* @__PURE__ */c("div",{onScroll:_,style:E?{maxHeight:E.height}:void 0,className:`relative overflow-x-auto ${E?"overflow-y-auto":""} ${$?"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
|
-
/* @__PURE__ */h("span",{className:"sr-only",children:
|
|
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",
|
|
11
|
+
/* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
|
|
12
|
+
/* @__PURE__ */c("table",{...U("table"),className:(G?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
|
+
/* @__PURE__ */c("thead",{...U("rowgroup"),className:G?"rosh-dt-head":void 0,children:[
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...U("row"),className:"border-b border-gray-200 bg-gray-50",children:[P&&/* @__PURE__ */h("th",{scope:"col",...U("columnheader"),rowSpan:he?2:void 0,style:{width:36,...E?{top:0}:{}},className:[Ne,o,xe||E?"sticky z-20 bg-gray-50":"",xe?"left-0":"",G?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!P)return;const e=new Set(ge);P.onChange(pe?P.selected.filter(t=>!e.has(t)):[...P.selected,...ge.filter(e=>!fe.has(e))])}})}),J.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...U("columnheader"),colSpan:e.columns.length,style:E?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",E?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...U("row"),className:"border-b border-gray-200 bg-gray-50",children:J.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
|
+
/* @__PURE__ */h("tbody",{...U("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((t,r)=>{const o=te+r,n=T?.(t,o),l=!!n?.current,s=I?.(t,o),i=void 0===s&&L?()=>L(t,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(e=>e.render?e.render(t,o,m):e.dataIndex?t[e.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
|
+
return c("tr",{...u(n),...U("row"),style:E?{height:E.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[G?P?"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":"",H?.(t,o)??"",n?.className??""].filter(Boolean).join(" "),children:[P&&(()=>{const r=W(t,o);/* @__PURE__ */
|
|
17
|
+
return h("td",{...U("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(e,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{P&&P.onChange(fe.has(e)?P.selected.filter(t=>t!==e):[...P.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",{...U("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)})]},W(t,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...U("row"),className:G?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...U("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:Q})})})]}),A]}),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(t,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
|
|
20
|
+
return h("div",G?void 0!==O&&O>0&&40!==O?{className:`rosh-dt-at ${Z}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/O*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:O/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${Z}`.trim(),children:$e}:{className:Z,children:$e})}export{x as DataTable};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";function e({size:e=18,...t}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:/* @__PURE__ */r("path",{d:"M15 4.5 9 19.5"})})}export{e as SeparatorSlashIcon};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-2UO47XB4.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{useShellStrings as t}from"./chunk-GDQJBQ5B.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const L=o().charts,N=i(),S=y??(e=>h(e,N)),j=A??L.noStages,z=c(),[V,w]=m(null),{highlighted:B}=e(),C=s(null),F=l(C,560),W=$??F;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const Z=b??a(0),E=p??54*x.length,G=Math.max(...x.map(e=>e.value),1),H="bars"===v,Q=H?Math.round(Math.min(132,Math.max(80,.24*W))):Math.round(Math.min(168,Math.max(104,.38*W))),R=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},U=e=>{const t=R(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,N)}`:""}},Y=H?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=U(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,D=W-Q-Y,J=Math.max(H?2:0,Math.min(M,D)),K=e=>Math.max(J,D*Math.max(0,e/G)),O=e=>K(e)/2,P=Q+D/2,T=e=>46+e/Math.max(1,x.length-1)*54,X=e=>`color-mix(in oklab, ${Z} ${T(e).toFixed(0)}%, ${n.surface})`,q=e=>T(e)>=55?n.surface:n.label,I=(e,t)=>null!==V?V!==e:null!==B&&B!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
|
|
2
|
+
return f("div",{className:`relative ${k??""}`,ref:C,children:[
|
|
3
|
+
/* @__PURE__ */f("svg",{width:"100%",height:E,viewBox:`0 0 ${W} ${E}`,role:"img","aria-labelledby":z,onMouseLeave:()=>w(null),children:[
|
|
4
|
+
/* @__PURE__ */d("title",{id:z,children:L.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*E/x.length+g/2,a=(t+1)*E/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,N),i=.62*o.length*12+12;if(H){const u=Q,h=u+K(e.value),{count:c,drop:m}=U(t);/* @__PURE__ */
|
|
5
|
+
return f("g",{opacity:I(t,e.key)?.45:1,onMouseEnter:()=>w(t),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:X(t)}),
|
|
7
|
+
/* @__PURE__ */d("text",{x:Q-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:q(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
|
|
8
|
+
/* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
|
|
9
|
+
/* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=O(e.value),c="cone"===v?O(x[t+1]?.value??e.value):h,m=R(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:I(t,e.key)?.45:1,onMouseEnter:()=>w(t),children:[
|
|
11
|
+
/* @__PURE__ */d("path",{d:`M${P-h},${l} L${P+h},${l} L${P+c},${a} L${P-c},${a} Z`,fill:X(t)}),
|
|
12
|
+
/* @__PURE__ */d("text",{x:Q-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
|
|
13
|
+
/* @__PURE__ */f("text",{x:Q-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,N)}`:""]}),
|
|
14
|
+
/* @__PURE__ */d("text",{x:s?P:P+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?q(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:L.count,color:X(V),value:S(_.value)},{key:"share",label:L.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,N)},...V>0&&x[V-1].value>0?[{key:"drop",label:L.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,N)}`}]:[]]})})]})}export{x as FunnelChart};
|