@mieweb/ui 0.10.0-dev.3 → 0.10.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/agent/mieweb-ui.instructions.md +90 -1
- package/dist/CsvBlock-FX5YNGNE.cjs +17 -0
- package/dist/{CsvBlock-ROJCKJDP.cjs.map → CsvBlock-FX5YNGNE.cjs.map} +1 -1
- package/dist/CsvBlock-VLMG7GUO.js +8 -0
- package/dist/{CsvBlock-UWPMTLE2.js.map → CsvBlock-VLMG7GUO.js.map} +1 -1
- package/dist/HtmlPreviewBlock-5JE7L3GR.js +8 -0
- package/dist/{HtmlPreviewBlock-ME5U3XNS.js.map → HtmlPreviewBlock-5JE7L3GR.js.map} +1 -1
- package/dist/HtmlPreviewBlock-UO37JQ3K.cjs +17 -0
- package/dist/{HtmlPreviewBlock-DWFN6EUB.cjs.map → HtmlPreviewBlock-UO37JQ3K.cjs.map} +1 -1
- package/dist/Input-yN516s5_.d.cts +3 -0
- package/dist/Input-yN516s5_.d.ts +3 -0
- package/dist/MermaidBlock-3XHFBAMV.js +8 -0
- package/dist/{MermaidBlock-2B6CPD6Y.js.map → MermaidBlock-3XHFBAMV.js.map} +1 -1
- package/dist/MermaidBlock-RZ75RPZA.cjs +17 -0
- package/dist/{MermaidBlock-D2UC5M55.cjs.map → MermaidBlock-RZ75RPZA.cjs.map} +1 -1
- package/dist/SurveyBlock-MUVJ3JUI.js +8 -0
- package/dist/{SurveyBlock-4DO62RBT.js.map → SurveyBlock-MUVJ3JUI.js.map} +1 -1
- package/dist/SurveyBlock-VH47YXZC.cjs +17 -0
- package/dist/{SurveyBlock-4CD4AYMJ.cjs.map → SurveyBlock-VH47YXZC.cjs.map} +1 -1
- package/dist/ag-grid.d.cts +142 -1
- package/dist/ag-grid.d.ts +142 -1
- package/dist/brands/bluehive.cjs +3 -3
- package/dist/brands/bluehive.css +3 -0
- package/dist/brands/bluehive.js +1 -1
- package/dist/brands/index.cjs +14 -14
- package/dist/brands/index.js +4 -4
- package/dist/{chunk-JYZW2PZS.cjs → chunk-254QK722.cjs} +7 -7
- package/dist/chunk-254QK722.cjs.map +1 -0
- package/dist/{chunk-VKELAMAZ.js → chunk-2JICT4A2.js} +27 -11
- package/dist/chunk-2JICT4A2.js.map +1 -0
- package/dist/{chunk-VPWJCJCX.cjs → chunk-35Y4ILCU.cjs} +7 -7
- package/dist/{chunk-VPWJCJCX.cjs.map → chunk-35Y4ILCU.cjs.map} +1 -1
- package/dist/{chunk-G3JX3UAU.cjs → chunk-3KPDQG5O.cjs} +5 -5
- package/dist/{chunk-G3JX3UAU.cjs.map → chunk-3KPDQG5O.cjs.map} +1 -1
- package/dist/{chunk-Y5HFM7LO.js → chunk-3RXZWHCU.js} +4 -4
- package/dist/{chunk-Y5HFM7LO.js.map → chunk-3RXZWHCU.js.map} +1 -1
- package/dist/chunk-3YBS4WUQ.js +52 -0
- package/dist/chunk-3YBS4WUQ.js.map +1 -0
- package/dist/{chunk-WNJRS7Y7.cjs → chunk-3ZWCIPFT.cjs} +4 -2
- package/dist/chunk-3ZWCIPFT.cjs.map +1 -0
- package/dist/chunk-4HC2IBOX.js +258 -0
- package/dist/chunk-4HC2IBOX.js.map +1 -0
- package/dist/chunk-4IS3QCOQ.cjs +453 -0
- package/dist/chunk-4IS3QCOQ.cjs.map +1 -0
- package/dist/chunk-4NCDU5IG.cjs +56 -0
- package/dist/chunk-4NCDU5IG.cjs.map +1 -0
- package/dist/{chunk-E4IBHYJ7.cjs → chunk-6N6LIAUJ.cjs} +9 -9
- package/dist/{chunk-E4IBHYJ7.cjs.map → chunk-6N6LIAUJ.cjs.map} +1 -1
- package/dist/{chunk-3M7TAXNR.js → chunk-6ZPTZTKN.js} +3 -3
- package/dist/{chunk-3M7TAXNR.js.map → chunk-6ZPTZTKN.js.map} +1 -1
- package/dist/{chunk-MWVW4APN.cjs → chunk-7UTBDFFL.cjs} +4 -4
- package/dist/{chunk-MWVW4APN.cjs.map → chunk-7UTBDFFL.cjs.map} +1 -1
- package/dist/{chunk-FJ7YPVKV.js → chunk-7X6R3JIA.js} +3 -3
- package/dist/{chunk-FJ7YPVKV.js.map → chunk-7X6R3JIA.js.map} +1 -1
- package/dist/{chunk-GOALNQZ2.js → chunk-7YO7DNUV.js} +4 -83
- package/dist/chunk-7YO7DNUV.js.map +1 -0
- package/dist/{chunk-P2CA3XGI.js → chunk-7ZV67VZE.js} +4 -4
- package/dist/{chunk-P2CA3XGI.js.map → chunk-7ZV67VZE.js.map} +1 -1
- package/dist/chunk-ADW7ZYCY.cjs +2707 -0
- package/dist/chunk-ADW7ZYCY.cjs.map +1 -0
- package/dist/{chunk-2G75X6TS.cjs → chunk-AHHFFXJR.cjs} +3 -3
- package/dist/{chunk-2G75X6TS.cjs.map → chunk-AHHFFXJR.cjs.map} +1 -1
- package/dist/{chunk-VILW53UZ.js → chunk-BIQ7GSO2.js} +3 -3
- package/dist/{chunk-VILW53UZ.js.map → chunk-BIQ7GSO2.js.map} +1 -1
- package/dist/chunk-BM35CACB.js +148 -0
- package/dist/chunk-BM35CACB.js.map +1 -0
- package/dist/chunk-BNH4SXJB.js +874 -0
- package/dist/chunk-BNH4SXJB.js.map +1 -0
- package/dist/{chunk-XEAT7XJG.cjs → chunk-BUT6MF5K.cjs} +29 -13
- package/dist/chunk-BUT6MF5K.cjs.map +1 -0
- package/dist/{chunk-UAMXCMST.cjs → chunk-CFI3TQMA.cjs} +3 -3
- package/dist/{chunk-UAMXCMST.cjs.map → chunk-CFI3TQMA.cjs.map} +1 -1
- package/dist/{chunk-J5CSLNCN.cjs → chunk-COM7RNZU.cjs} +2 -2
- package/dist/{chunk-J5CSLNCN.cjs.map → chunk-COM7RNZU.cjs.map} +1 -1
- package/dist/{chunk-XI34EGK5.cjs → chunk-CPPUT74P.cjs} +9 -9
- package/dist/{chunk-XI34EGK5.cjs.map → chunk-CPPUT74P.cjs.map} +1 -1
- package/dist/{chunk-ACCAXVOG.js → chunk-CRS2CQWM.js} +134 -56
- package/dist/chunk-CRS2CQWM.js.map +1 -0
- package/dist/{chunk-OE5CKRUC.js → chunk-D22GE27K.js} +4 -4
- package/dist/{chunk-OE5CKRUC.js.map → chunk-D22GE27K.js.map} +1 -1
- package/dist/chunk-DXEPYK3I.cjs +92 -0
- package/dist/chunk-DXEPYK3I.cjs.map +1 -0
- package/dist/{chunk-ZGRCSNPK.js → chunk-E2PBPQGS.js} +4 -4
- package/dist/{chunk-ZGRCSNPK.js.map → chunk-E2PBPQGS.js.map} +1 -1
- package/dist/{chunk-5JJ2DAE4.js → chunk-ENMXHZNE.js} +3 -3
- package/dist/{chunk-5JJ2DAE4.js.map → chunk-ENMXHZNE.js.map} +1 -1
- package/dist/{chunk-XCP454Q6.js → chunk-F4N67NAF.js} +12 -3
- package/dist/chunk-F4N67NAF.js.map +1 -0
- package/dist/chunk-FBCDYTWM.js +385 -0
- package/dist/chunk-FBCDYTWM.js.map +1 -0
- package/dist/{chunk-VU6UTJRM.js → chunk-FIKO4WR6.js} +3 -3
- package/dist/{chunk-VU6UTJRM.js.map → chunk-FIKO4WR6.js.map} +1 -1
- package/dist/{chunk-DEDN5HAG.js → chunk-FZURBQJ2.js} +3 -3
- package/dist/{chunk-DEDN5HAG.js.map → chunk-FZURBQJ2.js.map} +1 -1
- package/dist/{chunk-JHULS3EC.js → chunk-GBUVIGD5.js} +89 -3
- package/dist/chunk-GBUVIGD5.js.map +1 -0
- package/dist/chunk-GU5OS7JJ.cjs +281 -0
- package/dist/chunk-GU5OS7JJ.cjs.map +1 -0
- package/dist/{chunk-V7D3YGUV.js → chunk-GVLNXPJX.js} +4 -4
- package/dist/{chunk-V7D3YGUV.js.map → chunk-GVLNXPJX.js.map} +1 -1
- package/dist/chunk-GVM6DTR5.js +90 -0
- package/dist/chunk-GVM6DTR5.js.map +1 -0
- package/dist/{chunk-SQHMGT4W.js → chunk-GW4RFJZ5.js} +7 -7
- package/dist/chunk-GW4RFJZ5.js.map +1 -0
- package/dist/{chunk-3QEVGSFG.cjs → chunk-GYXUS65N.cjs} +5 -5
- package/dist/{chunk-3QEVGSFG.cjs.map → chunk-GYXUS65N.cjs.map} +1 -1
- package/dist/{chunk-WGPLUCBD.js → chunk-H2IAMSHK.js} +3 -3
- package/dist/{chunk-WGPLUCBD.js.map → chunk-H2IAMSHK.js.map} +1 -1
- package/dist/{chunk-JID7AZTO.cjs → chunk-H3ROMJYI.cjs} +4 -4
- package/dist/{chunk-JID7AZTO.cjs.map → chunk-H3ROMJYI.cjs.map} +1 -1
- package/dist/{chunk-GD7EBGC4.cjs → chunk-HC3NAN55.cjs} +19 -19
- package/dist/{chunk-GD7EBGC4.cjs.map → chunk-HC3NAN55.cjs.map} +1 -1
- package/dist/{chunk-7ZXAQTV4.cjs → chunk-HIZWOAWY.cjs} +8 -8
- package/dist/{chunk-7ZXAQTV4.cjs.map → chunk-HIZWOAWY.cjs.map} +1 -1
- package/dist/{chunk-NV2CWBI2.cjs → chunk-IEY3ZJIT.cjs} +12 -3
- package/dist/chunk-IEY3ZJIT.cjs.map +1 -0
- package/dist/chunk-IT775BYG.js +179 -0
- package/dist/chunk-IT775BYG.js.map +1 -0
- package/dist/chunk-IYWG72DM.js +166 -0
- package/dist/chunk-IYWG72DM.js.map +1 -0
- package/dist/{chunk-2YCERQWC.js → chunk-JBIGSP2T.js} +6 -6
- package/dist/{chunk-2YCERQWC.js.map → chunk-JBIGSP2T.js.map} +1 -1
- package/dist/{chunk-IX6KFB3K.cjs → chunk-JELTRRR5.cjs} +9 -9
- package/dist/{chunk-IX6KFB3K.cjs.map → chunk-JELTRRR5.cjs.map} +1 -1
- package/dist/{chunk-YQDA366U.js → chunk-JHG3ELS2.js} +2 -2
- package/dist/{chunk-YQDA366U.js.map → chunk-JHG3ELS2.js.map} +1 -1
- package/dist/{chunk-WWJIW2IH.cjs → chunk-JSXIB6EJ.cjs} +4 -4
- package/dist/{chunk-WWJIW2IH.cjs.map → chunk-JSXIB6EJ.cjs.map} +1 -1
- package/dist/{chunk-WNM7IZJ7.js → chunk-K34DXMLZ.js} +7 -7
- package/dist/{chunk-WNM7IZJ7.js.map → chunk-K34DXMLZ.js.map} +1 -1
- package/dist/{chunk-FXO5ARBB.cjs → chunk-KDW6BD4O.cjs} +4 -4
- package/dist/{chunk-FXO5ARBB.cjs.map → chunk-KDW6BD4O.cjs.map} +1 -1
- package/dist/{chunk-Z5V7SAZ4.js → chunk-KFEN2SRZ.js} +3 -3
- package/dist/{chunk-Z5V7SAZ4.js.map → chunk-KFEN2SRZ.js.map} +1 -1
- package/dist/{chunk-2QKBTPUC.cjs → chunk-KGKBZN3T.cjs} +8 -8
- package/dist/{chunk-2QKBTPUC.cjs.map → chunk-KGKBZN3T.cjs.map} +1 -1
- package/dist/{chunk-UV2FVNWT.cjs → chunk-LFPJ3OUM.cjs} +5 -5
- package/dist/{chunk-UV2FVNWT.cjs.map → chunk-LFPJ3OUM.cjs.map} +1 -1
- package/dist/{chunk-WNAA6CLE.cjs → chunk-LHBWRMNC.cjs} +94 -2
- package/dist/chunk-LHBWRMNC.cjs.map +1 -0
- package/dist/{chunk-JI244Y7C.js → chunk-MLAWXPRY.js} +190 -5
- package/dist/chunk-MLAWXPRY.js.map +1 -0
- package/dist/chunk-N7C4OEP7.cjs +356 -0
- package/dist/chunk-N7C4OEP7.cjs.map +1 -0
- package/dist/{chunk-WNZAYBVB.cjs → chunk-NKV76R65.cjs} +48 -48
- package/dist/{chunk-WNZAYBVB.cjs.map → chunk-NKV76R65.cjs.map} +1 -1
- package/dist/{chunk-PYJDVWXM.js → chunk-NUB5HRKS.js} +3 -3
- package/dist/{chunk-PYJDVWXM.js.map → chunk-NUB5HRKS.js.map} +1 -1
- package/dist/{chunk-LL6IWKI3.js → chunk-OW3SQJ7P.js} +3 -3
- package/dist/{chunk-LL6IWKI3.js.map → chunk-OW3SQJ7P.js.map} +1 -1
- package/dist/{chunk-5GUOOLPR.cjs → chunk-P5CMZZRZ.cjs} +5 -5
- package/dist/{chunk-5GUOOLPR.cjs.map → chunk-P5CMZZRZ.cjs.map} +1 -1
- package/dist/{chunk-3T7QGLNB.js → chunk-PJEL5ZZV.js} +4 -2
- package/dist/chunk-PJEL5ZZV.js.map +1 -0
- package/dist/{chunk-H4ZXMQQW.js → chunk-QOVJ6Z6R.js} +3 -3
- package/dist/{chunk-H4ZXMQQW.js.map → chunk-QOVJ6Z6R.js.map} +1 -1
- package/dist/{chunk-U42F3HLE.cjs → chunk-QURJVPRH.cjs} +190 -5
- package/dist/chunk-QURJVPRH.cjs.map +1 -0
- package/dist/{chunk-X4XPNTCZ.cjs → chunk-R5Z7AOVU.cjs} +136 -58
- package/dist/chunk-R5Z7AOVU.cjs.map +1 -0
- package/dist/{chunk-TMMVIUUN.js → chunk-R6KPWIGO.js} +4 -4
- package/dist/{chunk-TMMVIUUN.js.map → chunk-R6KPWIGO.js.map} +1 -1
- package/dist/{chunk-22CYDCXA.js → chunk-RM2HPQIC.js} +105 -14
- package/dist/chunk-RM2HPQIC.js.map +1 -0
- package/dist/{chunk-ENKFJJZX.js → chunk-SD7ONW6S.js} +6 -6
- package/dist/{chunk-ENKFJJZX.js.map → chunk-SD7ONW6S.js.map} +1 -1
- package/dist/{chunk-RJ6NTJHC.js → chunk-SRMTRD7F.js} +3 -3
- package/dist/{chunk-RJ6NTJHC.js.map → chunk-SRMTRD7F.js.map} +1 -1
- package/dist/chunk-T4JYUICS.js +2657 -0
- package/dist/chunk-T4JYUICS.js.map +1 -0
- package/dist/{chunk-7ZDPD5ZX.cjs → chunk-T4L7Q5FA.cjs} +7 -7
- package/dist/{chunk-7ZDPD5ZX.cjs.map → chunk-T4L7Q5FA.cjs.map} +1 -1
- package/dist/{chunk-NJ6MY6V5.js → chunk-T5BBZQ66.js} +3 -3
- package/dist/{chunk-NJ6MY6V5.js.map → chunk-T5BBZQ66.js.map} +1 -1
- package/dist/{chunk-2IZLKPUW.js → chunk-THLIL6PY.js} +3 -3
- package/dist/{chunk-2IZLKPUW.js.map → chunk-THLIL6PY.js.map} +1 -1
- package/dist/{chunk-SGFYA22I.cjs → chunk-TJCX4OML.cjs} +8 -8
- package/dist/{chunk-SGFYA22I.cjs.map → chunk-TJCX4OML.cjs.map} +1 -1
- package/dist/{chunk-N6IY47YA.cjs → chunk-TTSSUOEV.cjs} +8 -8
- package/dist/{chunk-N6IY47YA.cjs.map → chunk-TTSSUOEV.cjs.map} +1 -1
- package/dist/{chunk-5MCBWTIF.cjs → chunk-TYE5K5WV.cjs} +4 -4
- package/dist/{chunk-5MCBWTIF.cjs.map → chunk-TYE5K5WV.cjs.map} +1 -1
- package/dist/{chunk-VOKVG3ER.js → chunk-UBSH27C2.js} +4 -4
- package/dist/{chunk-VOKVG3ER.js.map → chunk-UBSH27C2.js.map} +1 -1
- package/dist/{chunk-TAXD5ADA.cjs → chunk-UEDTZYGI.cjs} +3 -3
- package/dist/{chunk-TAXD5ADA.cjs.map → chunk-UEDTZYGI.cjs.map} +1 -1
- package/dist/{chunk-UQ3VVR6A.cjs → chunk-UPWIJC6I.cjs} +3 -3
- package/dist/{chunk-UQ3VVR6A.cjs.map → chunk-UPWIJC6I.cjs.map} +1 -1
- package/dist/{chunk-S7WCHDBO.js → chunk-VCI2Y7ST.js} +3 -3
- package/dist/{chunk-S7WCHDBO.js.map → chunk-VCI2Y7ST.js.map} +1 -1
- package/dist/chunk-VINZZQBD.cjs +323 -0
- package/dist/chunk-VINZZQBD.cjs.map +1 -0
- package/dist/{chunk-OD47TTAW.cjs → chunk-VOQJHSXN.cjs} +9 -9
- package/dist/{chunk-OD47TTAW.cjs.map → chunk-VOQJHSXN.cjs.map} +1 -1
- package/dist/chunk-VPTASZ2O.cjs +171 -0
- package/dist/chunk-VPTASZ2O.cjs.map +1 -0
- package/dist/chunk-WXFGHDTV.cjs +896 -0
- package/dist/chunk-WXFGHDTV.cjs.map +1 -0
- package/dist/{chunk-VNYW4C4J.cjs → chunk-X6A27RGO.cjs} +4 -84
- package/dist/chunk-X6A27RGO.cjs.map +1 -0
- package/dist/chunk-XBTKZCZF.js +333 -0
- package/dist/chunk-XBTKZCZF.js.map +1 -0
- package/dist/chunk-XDIMTPZU.cjs +202 -0
- package/dist/chunk-XDIMTPZU.cjs.map +1 -0
- package/dist/chunk-XDU65GLW.js +21 -0
- package/dist/chunk-XDU65GLW.js.map +1 -0
- package/dist/chunk-XI74P5F2.cjs +424 -0
- package/dist/chunk-XI74P5F2.cjs.map +1 -0
- package/dist/{chunk-WIAQQNFU.cjs → chunk-XRVMYT5G.cjs} +106 -13
- package/dist/chunk-XRVMYT5G.cjs.map +1 -0
- package/dist/chunk-XVW5DPPP.js +429 -0
- package/dist/chunk-XVW5DPPP.js.map +1 -0
- package/dist/chunk-Y4E2WRUR.cjs +188 -0
- package/dist/chunk-Y4E2WRUR.cjs.map +1 -0
- package/dist/chunk-Y4QNLW7W.js +300 -0
- package/dist/chunk-Y4QNLW7W.js.map +1 -0
- package/dist/{chunk-6EN3IQQI.cjs → chunk-YRHBSSQ3.cjs} +6 -6
- package/dist/{chunk-6EN3IQQI.cjs.map → chunk-YRHBSSQ3.cjs.map} +1 -1
- package/dist/{chunk-KZFBQ7GY.js → chunk-YU55JD35.js} +3 -3
- package/dist/{chunk-KZFBQ7GY.js.map → chunk-YU55JD35.js.map} +1 -1
- package/dist/chunk-YW2AKBLS.cjs +23 -0
- package/dist/chunk-YW2AKBLS.cjs.map +1 -0
- package/dist/{chunk-ELPW32ZI.cjs → chunk-ZTMYKAVU.cjs} +45 -45
- package/dist/{chunk-ELPW32ZI.cjs.map → chunk-ZTMYKAVU.cjs.map} +1 -1
- package/dist/{chunk-3QGS6CXD.js → chunk-ZYL4SNOR.js} +3 -3
- package/dist/{chunk-3QGS6CXD.js.map → chunk-ZYL4SNOR.js.map} +1 -1
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/index.cjs +6 -5
- package/dist/components/AlertDialog/index.d.cts +28 -3
- package/dist/components/AlertDialog/index.d.ts +28 -3
- package/dist/components/AlertDialog/index.js +5 -4
- package/dist/components/AudioRecorder/index.d.cts +2 -2
- package/dist/components/AudioRecorder/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.d.cts +8 -2
- package/dist/components/Autocomplete/index.d.ts +8 -2
- package/dist/components/Avatar/index.d.cts +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/BoardView/index.cjs +24 -0
- package/dist/components/BoardView/index.cjs.map +1 -0
- package/dist/components/BoardView/index.d.cts +41 -0
- package/dist/components/BoardView/index.d.ts +41 -0
- package/dist/components/BoardView/index.js +7 -0
- package/dist/components/BoardView/index.js.map +1 -0
- package/dist/components/Button/index.cjs +4 -3
- package/dist/components/Button/index.d.cts +2 -1
- package/dist/components/Button/index.d.ts +2 -1
- package/dist/components/Button/index.js +2 -1
- package/dist/components/CalendarView/index.cjs +23 -0
- package/dist/components/CalendarView/index.cjs.map +1 -0
- package/dist/components/CalendarView/index.d.cts +39 -0
- package/dist/components/CalendarView/index.d.ts +39 -0
- package/dist/components/CalendarView/index.js +10 -0
- package/dist/components/CalendarView/index.js.map +1 -0
- package/dist/components/Card/index.d.cts +3 -3
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Collapsible/index.cjs +6 -6
- package/dist/components/Collapsible/index.js +3 -3
- package/dist/components/CountryCodeDropdown/index.cjs +5 -5
- package/dist/components/CountryCodeDropdown/index.js +2 -2
- package/dist/components/CustomizableDashboard/index.cjs +10 -9
- package/dist/components/CustomizableDashboard/index.js +3 -2
- package/dist/components/Dropdown/index.cjs +10 -10
- package/dist/components/Dropdown/index.d.cts +2 -1
- package/dist/components/Dropdown/index.d.ts +2 -1
- package/dist/components/Dropdown/index.js +3 -3
- package/dist/components/FloatingWindow/index.cjs +5 -4
- package/dist/components/FloatingWindow/index.js +3 -2
- package/dist/components/GanttView/index.cjs +20 -0
- package/dist/components/GanttView/index.cjs.map +1 -0
- package/dist/components/GanttView/index.d.cts +36 -0
- package/dist/components/GanttView/index.d.ts +36 -0
- package/dist/components/GanttView/index.js +7 -0
- package/dist/components/GanttView/index.js.map +1 -0
- package/dist/components/GlossaryTooltip/index.cjs +3 -3
- package/dist/components/GlossaryTooltip/index.js +2 -2
- package/dist/components/KeyboardShortcutsOverlay/index.cjs +5 -5
- package/dist/components/KeyboardShortcutsOverlay/index.js +3 -3
- package/dist/components/ListView/index.cjs +23 -0
- package/dist/components/ListView/index.cjs.map +1 -0
- package/dist/components/ListView/index.d.cts +124 -0
- package/dist/components/ListView/index.d.ts +124 -0
- package/dist/components/ListView/index.js +10 -0
- package/dist/components/ListView/index.js.map +1 -0
- package/dist/components/Markdown/index.cjs +20 -19
- package/dist/components/Markdown/index.js +8 -7
- package/dist/components/MediaEditor/index.cjs +15 -14
- package/dist/components/MediaEditor/index.d.cts +91 -2
- package/dist/components/MediaEditor/index.d.ts +91 -2
- package/dist/components/MediaEditor/index.js +10 -9
- package/dist/components/MediaFeed/index.cjs +26 -0
- package/dist/components/MediaFeed/index.cjs.map +1 -0
- package/dist/components/MediaFeed/index.d.cts +104 -0
- package/dist/components/MediaFeed/index.d.ts +104 -0
- package/dist/components/MediaFeed/index.js +17 -0
- package/dist/components/MediaFeed/index.js.map +1 -0
- package/dist/components/MediaPlayer/index.cjs +7 -6
- package/dist/components/MediaPlayer/index.d.cts +19 -1
- package/dist/components/MediaPlayer/index.d.ts +19 -1
- package/dist/components/MediaPlayer/index.js +4 -3
- package/dist/components/MegaMenu/index.cjs +6 -5
- package/dist/components/MegaMenu/index.js +3 -2
- package/dist/components/Modal/index.cjs +10 -10
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Pagination/index.d.cts +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PhoneInput/index.d.cts +36 -3
- package/dist/components/PhoneInput/index.d.ts +36 -3
- package/dist/components/Progress/index.d.cts +1 -1
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/Q/index.d.cts +2 -2
- package/dist/components/Q/index.d.ts +2 -2
- package/dist/components/QuickAction/index.d.cts +1 -1
- package/dist/components/QuickAction/index.d.ts +1 -1
- package/dist/components/RadialExplorer/index.cjs +5 -4
- package/dist/components/RadialExplorer/index.js +4 -3
- package/dist/components/RecordButton/index.d.cts +1 -1
- package/dist/components/RecordButton/index.d.ts +1 -1
- package/dist/components/RichTextEditor/index.cjs +9 -8
- package/dist/components/RichTextEditor/index.d.cts +7 -2
- package/dist/components/RichTextEditor/index.d.ts +7 -2
- package/dist/components/RichTextEditor/index.js +6 -5
- package/dist/components/ScrollArea/index.d.cts +1 -1
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/SectionSpyNav/index.cjs +4 -3
- package/dist/components/SectionSpyNav/index.js +3 -2
- package/dist/components/Select/index.cjs +4 -4
- package/dist/components/Select/index.d.cts +1 -2
- package/dist/components/Select/index.d.ts +1 -2
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/SliderCalculator/index.cjs +4 -4
- package/dist/components/SliderCalculator/index.js +2 -2
- package/dist/components/SourceTip/index.cjs +3 -3
- package/dist/components/SourceTip/index.js +2 -2
- package/dist/components/Spinner/index.d.cts +2 -2
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/SuperChat/index.cjs +1406 -823
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.d.cts +126 -8
- package/dist/components/SuperChat/index.d.ts +126 -8
- package/dist/components/SuperChat/index.js +1398 -815
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +6 -6
- package/dist/components/SuperChat/plugins/index.d.cts +2 -3
- package/dist/components/SuperChat/plugins/index.d.ts +2 -3
- package/dist/components/SuperChat/plugins/index.js +5 -5
- package/dist/components/Text/index.d.cts +3 -3
- package/dist/components/Text/index.d.ts +3 -3
- package/dist/components/Textarea/index.d.cts +1 -2
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/ThemeProvider/index.cjs +9 -9
- package/dist/components/ThemeProvider/index.d.cts +3 -1
- package/dist/components/ThemeProvider/index.d.ts +3 -1
- package/dist/components/ThemeProvider/index.js +3 -3
- package/dist/components/Tooltip/index.cjs +3 -3
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/TranscriptView/index.d.cts +85 -4
- package/dist/components/TranscriptView/index.d.ts +85 -4
- package/dist/components/ViewSet/index.cjs +24 -0
- package/dist/components/ViewSet/index.cjs.map +1 -0
- package/dist/components/ViewSet/index.d.cts +200 -0
- package/dist/components/ViewSet/index.d.ts +200 -0
- package/dist/components/ViewSet/index.js +15 -0
- package/dist/components/ViewSet/index.js.map +1 -0
- package/dist/components/ViewSwitcher/index.cjs +20 -0
- package/dist/components/ViewSwitcher/index.cjs.map +1 -0
- package/dist/components/ViewSwitcher/index.d.cts +4 -0
- package/dist/components/ViewSwitcher/index.d.ts +4 -0
- package/dist/components/ViewSwitcher/index.js +7 -0
- package/dist/components/ViewSwitcher/index.js.map +1 -0
- package/dist/datavis.cjs +3 -2
- package/dist/datavis.cjs.map +1 -1
- package/dist/datavis.d.cts +167 -13
- package/dist/datavis.d.ts +167 -13
- package/dist/datavis.js +2 -1
- package/dist/datavis.js.map +1 -1
- package/dist/deck.cjs +3360 -0
- package/dist/deck.cjs.map +1 -0
- package/dist/deck.d.cts +712 -0
- package/dist/deck.d.ts +712 -0
- package/dist/deck.js +3316 -0
- package/dist/deck.js.map +1 -0
- package/dist/esheet.cjs +14 -13
- package/dist/esheet.cjs.map +1 -1
- package/dist/esheet.d.cts +183 -1
- package/dist/esheet.d.ts +183 -1
- package/dist/esheet.js +11 -10
- package/dist/esheet.js.map +1 -1
- package/dist/globe.cjs +2 -2
- package/dist/globe.js +1 -1
- package/dist/hooks/index.cjs +60 -27
- package/dist/hooks/index.d.cts +590 -31
- package/dist/hooks/index.d.ts +590 -31
- package/dist/hooks/index.js +6 -5
- package/dist/icons-wBacj6BW.d.cts +142 -0
- package/dist/icons-wBacj6BW.d.ts +142 -0
- package/dist/index-DoYYWsNc.d.cts +127 -0
- package/dist/index-DoYYWsNc.d.ts +127 -0
- package/dist/index.cjs +1420 -1048
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8796 -482
- package/dist/index.d.ts +8796 -482
- package/dist/index.js +368 -232
- package/dist/index.js.map +1 -1
- package/dist/kerebron.cjs +58 -19
- package/dist/kerebron.cjs.map +1 -1
- package/dist/kerebron.css +115 -0
- package/dist/kerebron.d.cts +37 -0
- package/dist/kerebron.d.ts +37 -0
- package/dist/kerebron.js +58 -19
- package/dist/kerebron.js.map +1 -1
- package/dist/maps.cjs +160 -0
- package/dist/maps.cjs.map +1 -0
- package/dist/maps.d.cts +42 -0
- package/dist/maps.d.ts +42 -0
- package/dist/maps.js +138 -0
- package/dist/maps.js.map +1 -0
- package/dist/motion.cjs +7 -7
- package/dist/motion.d.cts +186 -2
- package/dist/motion.d.ts +186 -2
- package/dist/motion.js +2 -2
- package/dist/q.d.cts +25 -3
- package/dist/q.d.ts +25 -3
- package/dist/styles/effects.css +133 -0
- package/dist/styles/init.css +3 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/templates.cjs +156 -0
- package/dist/templates.cjs.map +1 -0
- package/dist/templates.d.cts +734 -0
- package/dist/templates.d.ts +734 -0
- package/dist/templates.js +11 -0
- package/dist/templates.js.map +1 -0
- package/dist/types-Cx1FHLq2.d.cts +548 -0
- package/dist/types-Cx1FHLq2.d.ts +548 -0
- package/dist/types-DsdZvEI1.d.cts +92 -0
- package/dist/types-DsdZvEI1.d.ts +92 -0
- package/dist/utils/index.d.cts +13 -2
- package/dist/utils/index.d.ts +13 -2
- package/package.json +62 -13
- package/dist/Animated-XmH6k8pZ.d.cts +0 -188
- package/dist/Animated-XmH6k8pZ.d.ts +0 -188
- package/dist/CsvBlock-ROJCKJDP.cjs +0 -16
- package/dist/CsvBlock-UWPMTLE2.js +0 -7
- package/dist/HtmlPreviewBlock-DWFN6EUB.cjs +0 -16
- package/dist/HtmlPreviewBlock-ME5U3XNS.js +0 -7
- package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
- package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
- package/dist/MermaidBlock-2B6CPD6Y.js +0 -7
- package/dist/MermaidBlock-D2UC5M55.cjs +0 -16
- package/dist/SurveyBlock-4CD4AYMJ.cjs +0 -16
- package/dist/SurveyBlock-4DO62RBT.js +0 -7
- package/dist/chunk-22CYDCXA.js.map +0 -1
- package/dist/chunk-3T7QGLNB.js.map +0 -1
- package/dist/chunk-6HFFWEM3.cjs +0 -22
- package/dist/chunk-6HFFWEM3.cjs.map +0 -1
- package/dist/chunk-ACCAXVOG.js.map +0 -1
- package/dist/chunk-GOALNQZ2.js.map +0 -1
- package/dist/chunk-HB7C7NB5.js +0 -20
- package/dist/chunk-HB7C7NB5.js.map +0 -1
- package/dist/chunk-JHULS3EC.js.map +0 -1
- package/dist/chunk-JI244Y7C.js.map +0 -1
- package/dist/chunk-JYZW2PZS.cjs.map +0 -1
- package/dist/chunk-NV2CWBI2.cjs.map +0 -1
- package/dist/chunk-SQHMGT4W.js.map +0 -1
- package/dist/chunk-U42F3HLE.cjs.map +0 -1
- package/dist/chunk-VKELAMAZ.js.map +0 -1
- package/dist/chunk-VNYW4C4J.cjs.map +0 -1
- package/dist/chunk-WIAQQNFU.cjs.map +0 -1
- package/dist/chunk-WNAA6CLE.cjs.map +0 -1
- package/dist/chunk-WNJRS7Y7.cjs.map +0 -1
- package/dist/chunk-X4XPNTCZ.cjs.map +0 -1
- package/dist/chunk-XCP454Q6.js.map +0 -1
- package/dist/chunk-XEAT7XJG.cjs.map +0 -1
- package/dist/html-MdxqSzjD.d.cts +0 -13
- package/dist/html-MdxqSzjD.d.ts +0 -13
- package/dist/orderRows-BUJYgSc7.d.cts +0 -221
- package/dist/orderRows-BUJYgSc7.d.ts +0 -221
- package/dist/transcript-Cg7uSW-C.d.cts +0 -84
- package/dist/transcript-Cg7uSW-C.d.ts +0 -84
- package/dist/types-B97JNRNQ.d.cts +0 -251
- package/dist/types-CnPEwzlp.d.cts +0 -254
- package/dist/types-CnPEwzlp.d.ts +0 -254
- package/dist/types-gZXrfLj6.d.ts +0 -251
- package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
- package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
- package/dist/useTheme-B9SWu6ui.d.cts +0 -24
- package/dist/useTheme-B9SWu6ui.d.ts +0 -24
- package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
- package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SourceTip/SourceTip.tsx"],"names":["React","useAnchoredPosition","useEscapeKey","jsxs","cn","createPortal","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAM,aAAA,GAAgB,GAAA;AA8Bf,SAAS,SAAA,CAAU;AAAA,EACxB,OAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA,GAAU,QAAA;AAAA,EACV,QAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA,GAAY;AACd,CAAA,EAAmB;AACjB,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAUA,0BAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAUA,0BAAS,KAAK,CAAA;AAChD,EAAA,MAAM,KAAA,GAAcA,wBAA6C,IAAI,CAAA;AAGrE,EAAA,MAAM,iBAAA,GAA0BA,wBAAO,KAAK,CAAA;AAE5C,EAAA,MAAM,EA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BAAA;AAAA,0BAxBG,CAAA,EAAG,CAAA,CAAE,KAAK,CAAA,CAAA,EAAI,CAAC,CAAA;AAAA,yBA2BvB,CAAA,EACH;AAAA;AAAA;AAAA;AACF,iBAAA,EAEJ;AAAA,eAAA,EAEJ;AAAA;AAAA,WACF;AAAA,UACA,QAAA,CAAS;AAAA;AACX;AAAA;AAAA,GACJ;AAEJ","file":"chunk-2G75X6TS.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\nimport { useAnchoredPosition } from '../../hooks/useAnchoredPosition';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/** One line of provenance shown in the card. */\nexport interface TipSource {\n /** One-line label — statute name or source title. Truncated on render. */\n label: string;\n /** Source URL. Omit for a provenance line that isn't linkable. */\n url?: string;\n /** Secondary label shown at the end (publisher / host / year). */\n sub?: string;\n}\n\nexport interface SourceTipProps {\n /** The claim this card explains — the card's heading. */\n heading: string;\n /** Free-text provenance, for facts no public URL can verify. */\n note?: string;\n /** Linked (or unlinked) one-line sources. */\n sources?: TipSource[];\n /** Eyebrow above the heading. Defaults to \"Source\". */\n eyebrow?: string;\n /** The visible trigger. */\n children: React.ReactNode;\n className?: string;\n /**\n * Underline the trigger with a dashed rule marking a hoverable claim.\n * Leave off in table cells, which signal hoverability by their own\n * treatment rather than by underlining every cell.\n */\n underline?: boolean;\n}\n\nconst HIDE_GRACE_MS = 180;\n\n// =============================================================================\n// SourceTip\n// =============================================================================\n\n/**\n * A hover card answering \"what backs this claim?\" — an eyebrow + heading,\n * optional free-text provenance, and a list of one-line source links.\n * Suits stat tiles, table cells, and inline facts where a numbered footnote\n * would be overkill.\n *\n * The trigger and card are phrasing content (`span`/`a` only), so it is\n * valid inside `<p>` prose and table cells. The card portals to `body` with\n * fixed positioning, flipping and clamping to stay in the viewport. On\n * touch, a tap pins the card; Escape or an outside tap closes it. A pinned\n * card behaves as a non-modal dialog — focus moves into it so its source\n * links are keyboard-reachable, and returns to the trigger on close.\n *\n * @example\n * ```tsx\n * <SourceTip\n * heading=\"OSHA recordable rate\"\n * sources={[{ label: 'BLS SOII 2023', url: 'https://www.bls.gov/iif/', sub: 'BLS' }]}\n * underline\n * >\n * 2.4 per 100 FTE\n * </SourceTip>\n * ```\n */\nexport function SourceTip({\n heading,\n note,\n sources,\n eyebrow = 'Source',\n children,\n className,\n underline = false,\n}: SourceTipProps) {\n const [open, setOpen] = React.useState(false);\n const [pinned, setPinned] = React.useState(false);\n const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // True while close() restores focus to the trigger, so the trigger's\n // focus-show doesn't immediately reopen a card the user just dismissed.\n const suppressFocusShow = React.useRef(false);\n\n const { anchorRef, floatingRef, style } = useAnchoredPosition<\n HTMLSpanElement,\n HTMLSpanElement\n >({\n open,\n placement: 'top',\n offset: 10,\n viewportPadding: 8,\n allowFlip: true,\n });\n\n const clearHideTimer = () => {\n if (timer.current) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n };\n\n const show = React.useCallback(() => {\n clearHideTimer();\n setOpen(true);\n }, []);\n\n const scheduleHide = React.useCallback(() => {\n if (pinned) return;\n clearHideTimer();\n timer.current = setTimeout(() => setOpen(false), HIDE_GRACE_MS);\n }, [pinned]);\n\n const close = React.useCallback(() => {\n clearHideTimer();\n setPinned(false);\n setOpen(false);\n // Return focus to the trigger if it was inside the card.\n if (floatingRef.current?.contains(document.activeElement)) {\n suppressFocusShow.current = true;\n anchorRef.current?.focus();\n }\n }, [anchorRef, floatingRef]);\n\n React.useEffect(() => () => clearHideTimer(), []);\n\n // A pinned card is a non-modal dialog: move focus into it so its links\n // are reachable by keyboard.\n React.useEffect(() => {\n if (pinned) floatingRef.current?.focus();\n }, [pinned, floatingRef]);\n\n useEscapeKey(close, open);\n\n // Pinned cards close on an outside tap; hover cards close on their own.\n React.useEffect(() => {\n if (!open || !pinned) return;\n const onPointer = (e: Event) => {\n const t = e.target as Node;\n if (anchorRef.current?.contains(t) || floatingRef.current?.contains(t))\n return;\n close();\n };\n document.addEventListener('mousedown', onPointer);\n document.addEventListener('touchstart', onPointer);\n return () => {\n document.removeEventListener('mousedown', onPointer);\n document.removeEventListener('touchstart', onPointer);\n };\n }, [open, pinned, close, anchorRef, floatingRef]);\n\n // Touch has no hover: tap pins the card instead of falling through.\n const onTriggerClick = () => {\n const coarse =\n typeof window !== 'undefined' &&\n window.matchMedia('(hover: none)').matches;\n if (!coarse) return;\n togglePin();\n };\n\n const togglePin = () => {\n if (pinned) close();\n else {\n setPinned(true);\n show();\n }\n };\n\n const onTriggerKeyDown = (e: React.KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n togglePin();\n }\n };\n\n // Focus lives on the dialog container once pinned, so Enter/Space there\n // (not on a link inside) must also unpin — the trigger no longer has focus.\n const onDialogKeyDown = (e: React.KeyboardEvent<HTMLSpanElement>) => {\n if (e.target !== e.currentTarget) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n close();\n }\n };\n\n const onTriggerFocus = () => {\n if (suppressFocusShow.current) {\n suppressFocusShow.current = false;\n return;\n }\n show();\n };\n\n const onBlurCapture = (e: React.FocusEvent<HTMLSpanElement>) => {\n const next = e.relatedTarget as Node | null;\n if (\n next &&\n (anchorRef.current?.contains(next) || floatingRef.current?.contains(next))\n )\n return;\n scheduleHide();\n };\n\n const hasSources = Boolean(sources && sources.length > 0);\n\n return (\n <span\n ref={anchorRef}\n className={cn(\n 'cursor-help',\n underline &&\n 'decoration-primary-400/70 underline decoration-dashed underline-offset-4',\n className\n )}\n onMouseEnter={show}\n onMouseLeave={scheduleHide}\n onFocus={onTriggerFocus}\n onBlur={onBlurCapture}\n onClick={onTriggerClick}\n onKeyDown={onTriggerKeyDown}\n tabIndex={0}\n role=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-label={`${heading} — show source`}\n >\n {children}\n {open &&\n createPortal(\n /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- keyboard dismissal on a focused non-modal dialog container is the WAI-ARIA pattern; links inside keep their own semantics */\n <span\n ref={floatingRef}\n role=\"dialog\"\n aria-label={heading}\n tabIndex={-1}\n onMouseEnter={show}\n onMouseLeave={scheduleHide}\n onBlurCapture={onBlurCapture}\n onKeyDown={onDialogKeyDown}\n className=\"focus-visible:ring-ring z-50 block w-80 rounded-lg outline-none focus-visible:ring-2\"\n style={style}\n >\n <span className=\"border-border bg-card block overflow-hidden rounded-lg border text-start font-normal tracking-normal normal-case shadow-xl ring-1 ring-black/5 dark:ring-white/10\">\n <span className=\"from-primary-700 to-primary-600 block bg-gradient-to-br px-3.5 py-2.5\">\n <span className=\"text-primary-100/90 block text-[10px] font-bold tracking-wide uppercase\">\n {eyebrow}\n </span>\n <span className=\"mt-0.5 block text-sm leading-snug font-semibold text-white\">\n {heading}\n </span>\n </span>\n\n {(note || hasSources) && (\n <span className=\"block px-3.5 py-2.5\">\n {note && (\n <span className=\"text-muted-foreground block text-[13px] leading-relaxed\">\n {note}\n </span>\n )}\n {hasSources && (\n <span\n className={cn(\n 'block',\n note &&\n 'border-border mt-2.5 border-t border-dashed pt-2.5'\n )}\n >\n <span className=\"text-muted-foreground block text-[10px] font-bold tracking-wide uppercase\">\n {sources!.length === 1\n ? 'Source'\n : `${sources!.length} sources`}\n </span>\n <span className=\"block max-h-52 overflow-y-auto\">\n {sources!.map((s, i) => (\n <span\n key={`${s.label}-${i}`}\n className=\"mt-1.5 flex items-center gap-2\"\n >\n <span\n aria-hidden=\"true\"\n className=\"bg-primary-400 h-1.5 w-1.5 shrink-0 rounded-full\"\n />\n {s.url ? (\n <a\n href={s.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-primary-600 hover:text-primary-500 dark:text-primary-400 dark:hover:text-primary-300 min-w-0 flex-1 truncate text-xs font-semibold\"\n >\n {s.label}\n </a>\n ) : (\n <span className=\"text-muted-foreground min-w-0 flex-1 truncate text-xs\">\n {s.label}\n </span>\n )}\n {s.sub && (\n <span className=\"text-muted-foreground/70 shrink-0 text-[11px]\">\n {s.sub}\n </span>\n )}\n </span>\n ))}\n </span>\n </span>\n )}\n </span>\n )}\n </span>\n </span>,\n document.body\n )}\n </span>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/SourceTip/SourceTip.tsx"],"names":["React","useAnchoredPosition","useEscapeKey","jsxs","cn","createPortal","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAM,aAAA,GAAgB,GAAA;AA8Bf,SAAS,SAAA,CAAU;AAAA,EACxB,OAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA,GAAU,QAAA;AAAA,EACV,QAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA,GAAY;AACd,CAAA,EAAmB;AACjB,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAUA,0BAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAUA,0BAAS,KAAK,CAAA;AAChD,EAAA,MAAM,KAAA,GAAcA,wBAA6C,IAAI,CAAA;AAGrE,EAAA,MAAM,iBAAA,GAA0BA,wBAAO,KAAK,CAAA;AAE5C,EAAA,MAAM,EAAE,SAAA,EAAW,WAAA,EAAa,KAAA,KAAUC,qCAAA,CAGxC;AAAA,IACA,IAAA;AAAA,IACA,SAAA,EAAW,KAAA;AAAA,IACX,MAAA,EAAQ,EAAA;AAAA,IACR,eAAA,EAAiB,CAAA;AAAA,IACjB,SAAA,EAAW;AAAA,GACZ,CAAA;AAED,EAAA,MAAM,iBAAiB,MAAM;AAC3B,IAAA,IAAI,MAAM,OAAA,EAAS;AACjB,MAAA,YAAA,CAAa,MAAM,OAAO,CAAA;AAC1B,MAAA,KAAA,CAAM,OAAA,GAAU,IAAA;AAAA,IAClB;AAAA,EACF,CAA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AA,KAAW,IACjB,QAAA,GACA,CAAA,EAAG,OAAA,CAAS,MAAM,CAAA,QAAA,CAAA,EACxB,CAAA;AAAA,wCACAA,cAAA,CAAC,UAAK,SAAA,EAAU,gCAAA,EACb,kBAAS,GAAA,CAAI,CAAC,GAAG,CAAA,qBAChBH,eAAA;AAAA,0BAAC,MAAA;AAAA,0BAAA;AAAA,4BAEC,SAAA,EAAU,gCAAA;AAAA,4BAEV,QAAA,EAAA;AAAA,8CAAAG,cAAA;AAAA,gCAAC,MAAA;AAAA,gCAAA;AAAA,kCACC,aAAA,EAAY,MAAA;AAAA,kCACZ,SAAA,EAAU;AAAA;AAAA,+BACZ;AAAA,8BACC,EAAE,GAAA,mBACDA,cAAA;AAAA,gCAAC,GAAA;AAAA,gCAAA;AAAA,kCACC,MAAM,CAAA,CAAE,GAAA;AAAA,kCACR,MAAA,EAAO,QAAA;AAAA,kCACP,GAAA,EAAI,qBAAA;AAAA,kCACJ,SAAA,EAAU,yIAAA;AAAA,kCAET,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA,kDAGLA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,uDAAA,EACb,YAAE,KAAA,EACL,CAAA;AAAA,8BAED,EAAE,GAAA,oBACDA,cAAA,CAAC,UAAK,SAAA,EAAU,+CAAA,EACb,YAAE,GAAA,EACL;AAAA;AAAA,2BAAA;AAAA,0BAxBG,CAAA,EAAG,CAAA,CAAE,KAAK,CAAA,CAAA,EAAI,CAAC,CAAA;AAAA,yBA2BvB,CAAA,EACH;AAAA;AAAA;AAAA;AACF,iBAAA,EAEJ;AAAA,eAAA,EAEJ;AAAA;AAAA,WACF;AAAA,UACA,QAAA,CAAS;AAAA;AACX;AAAA;AAAA,GACJ;AAEJ","file":"chunk-AHHFFXJR.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\nimport { useAnchoredPosition } from '../../hooks/useAnchoredPosition';\nimport { useEscapeKey } from '../../hooks/useEscapeKey';\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/** One line of provenance shown in the card. */\nexport interface TipSource {\n /** One-line label — statute name or source title. Truncated on render. */\n label: string;\n /** Source URL. Omit for a provenance line that isn't linkable. */\n url?: string;\n /** Secondary label shown at the end (publisher / host / year). */\n sub?: string;\n}\n\nexport interface SourceTipProps {\n /** The claim this card explains — the card's heading. */\n heading: string;\n /** Free-text provenance, for facts no public URL can verify. */\n note?: string;\n /** Linked (or unlinked) one-line sources. */\n sources?: TipSource[];\n /** Eyebrow above the heading. Defaults to \"Source\". */\n eyebrow?: string;\n /** The visible trigger. */\n children: React.ReactNode;\n className?: string;\n /**\n * Underline the trigger with a dashed rule marking a hoverable claim.\n * Leave off in table cells, which signal hoverability by their own\n * treatment rather than by underlining every cell.\n */\n underline?: boolean;\n}\n\nconst HIDE_GRACE_MS = 180;\n\n// =============================================================================\n// SourceTip\n// =============================================================================\n\n/**\n * A hover card answering \"what backs this claim?\" — an eyebrow + heading,\n * optional free-text provenance, and a list of one-line source links.\n * Suits stat tiles, table cells, and inline facts where a numbered footnote\n * would be overkill.\n *\n * The trigger and card are phrasing content (`span`/`a` only), so it is\n * valid inside `<p>` prose and table cells. The card portals to `body` with\n * fixed positioning, flipping and clamping to stay in the viewport. On\n * touch, a tap pins the card; Escape or an outside tap closes it. A pinned\n * card behaves as a non-modal dialog — focus moves into it so its source\n * links are keyboard-reachable, and returns to the trigger on close.\n *\n * @example\n * ```tsx\n * <SourceTip\n * heading=\"OSHA recordable rate\"\n * sources={[{ label: 'BLS SOII 2023', url: 'https://www.bls.gov/iif/', sub: 'BLS' }]}\n * underline\n * >\n * 2.4 per 100 FTE\n * </SourceTip>\n * ```\n */\nexport function SourceTip({\n heading,\n note,\n sources,\n eyebrow = 'Source',\n children,\n className,\n underline = false,\n}: SourceTipProps) {\n const [open, setOpen] = React.useState(false);\n const [pinned, setPinned] = React.useState(false);\n const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // True while close() restores focus to the trigger, so the trigger's\n // focus-show doesn't immediately reopen a card the user just dismissed.\n const suppressFocusShow = React.useRef(false);\n\n const { anchorRef, floatingRef, style } = useAnchoredPosition<\n HTMLSpanElement,\n HTMLSpanElement\n >({\n open,\n placement: 'top',\n offset: 10,\n viewportPadding: 8,\n allowFlip: true,\n });\n\n const clearHideTimer = () => {\n if (timer.current) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n };\n\n const show = React.useCallback(() => {\n clearHideTimer();\n setOpen(true);\n }, []);\n\n const scheduleHide = React.useCallback(() => {\n if (pinned) return;\n clearHideTimer();\n timer.current = setTimeout(() => setOpen(false), HIDE_GRACE_MS);\n }, [pinned]);\n\n const close = React.useCallback(() => {\n clearHideTimer();\n setPinned(false);\n setOpen(false);\n // Return focus to the trigger if it was inside the card.\n if (floatingRef.current?.contains(document.activeElement)) {\n suppressFocusShow.current = true;\n anchorRef.current?.focus();\n }\n }, [anchorRef, floatingRef]);\n\n React.useEffect(() => () => clearHideTimer(), []);\n\n // A pinned card is a non-modal dialog: move focus into it so its links\n // are reachable by keyboard.\n React.useEffect(() => {\n if (pinned) floatingRef.current?.focus();\n }, [pinned, floatingRef]);\n\n useEscapeKey(close, open);\n\n // Pinned cards close on an outside tap; hover cards close on their own.\n React.useEffect(() => {\n if (!open || !pinned) return;\n const onPointer = (e: Event) => {\n const t = e.target as Node;\n if (anchorRef.current?.contains(t) || floatingRef.current?.contains(t))\n return;\n close();\n };\n document.addEventListener('mousedown', onPointer);\n document.addEventListener('touchstart', onPointer);\n return () => {\n document.removeEventListener('mousedown', onPointer);\n document.removeEventListener('touchstart', onPointer);\n };\n }, [open, pinned, close, anchorRef, floatingRef]);\n\n // Touch has no hover: tap pins the card instead of falling through.\n const onTriggerClick = () => {\n const coarse =\n typeof window !== 'undefined' &&\n window.matchMedia('(hover: none)').matches;\n if (!coarse) return;\n togglePin();\n };\n\n const togglePin = () => {\n if (pinned) close();\n else {\n setPinned(true);\n show();\n }\n };\n\n const onTriggerKeyDown = (e: React.KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n togglePin();\n }\n };\n\n // Focus lives on the dialog container once pinned, so Enter/Space there\n // (not on a link inside) must also unpin — the trigger no longer has focus.\n const onDialogKeyDown = (e: React.KeyboardEvent<HTMLSpanElement>) => {\n if (e.target !== e.currentTarget) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n close();\n }\n };\n\n const onTriggerFocus = () => {\n if (suppressFocusShow.current) {\n suppressFocusShow.current = false;\n return;\n }\n show();\n };\n\n const onBlurCapture = (e: React.FocusEvent<HTMLSpanElement>) => {\n const next = e.relatedTarget as Node | null;\n if (\n next &&\n (anchorRef.current?.contains(next) || floatingRef.current?.contains(next))\n )\n return;\n scheduleHide();\n };\n\n const hasSources = Boolean(sources && sources.length > 0);\n\n return (\n <span\n ref={anchorRef}\n className={cn(\n 'cursor-help',\n underline &&\n 'decoration-primary-400/70 underline decoration-dashed underline-offset-4',\n className\n )}\n onMouseEnter={show}\n onMouseLeave={scheduleHide}\n onFocus={onTriggerFocus}\n onBlur={onBlurCapture}\n onClick={onTriggerClick}\n onKeyDown={onTriggerKeyDown}\n tabIndex={0}\n role=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-label={`${heading} — show source`}\n >\n {children}\n {open &&\n createPortal(\n /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- keyboard dismissal on a focused non-modal dialog container is the WAI-ARIA pattern; links inside keep their own semantics */\n <span\n ref={floatingRef}\n role=\"dialog\"\n aria-label={heading}\n tabIndex={-1}\n onMouseEnter={show}\n onMouseLeave={scheduleHide}\n onBlurCapture={onBlurCapture}\n onKeyDown={onDialogKeyDown}\n className=\"focus-visible:ring-ring z-50 block w-80 rounded-lg outline-none focus-visible:ring-2\"\n style={style}\n >\n <span className=\"border-border bg-card block overflow-hidden rounded-lg border text-start font-normal tracking-normal normal-case shadow-xl ring-1 ring-black/5 dark:ring-white/10\">\n <span className=\"from-primary-700 to-primary-600 block bg-gradient-to-br px-3.5 py-2.5\">\n <span className=\"text-primary-100/90 block text-[10px] font-bold tracking-wide uppercase\">\n {eyebrow}\n </span>\n <span className=\"mt-0.5 block text-sm leading-snug font-semibold text-white\">\n {heading}\n </span>\n </span>\n\n {(note || hasSources) && (\n <span className=\"block px-3.5 py-2.5\">\n {note && (\n <span className=\"text-muted-foreground block text-[13px] leading-relaxed\">\n {note}\n </span>\n )}\n {hasSources && (\n <span\n className={cn(\n 'block',\n note &&\n 'border-border mt-2.5 border-t border-dashed pt-2.5'\n )}\n >\n <span className=\"text-muted-foreground block text-[10px] font-bold tracking-wide uppercase\">\n {sources!.length === 1\n ? 'Source'\n : `${sources!.length} sources`}\n </span>\n <span className=\"block max-h-52 overflow-y-auto\">\n {sources!.map((s, i) => (\n <span\n key={`${s.label}-${i}`}\n className=\"mt-1.5 flex items-center gap-2\"\n >\n <span\n aria-hidden=\"true\"\n className=\"bg-primary-400 h-1.5 w-1.5 shrink-0 rounded-full\"\n />\n {s.url ? (\n <a\n href={s.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-primary-600 hover:text-primary-500 dark:text-primary-400 dark:hover:text-primary-300 min-w-0 flex-1 truncate text-xs font-semibold\"\n >\n {s.label}\n </a>\n ) : (\n <span className=\"text-muted-foreground min-w-0 flex-1 truncate text-xs\">\n {s.label}\n </span>\n )}\n {s.sub && (\n <span className=\"text-muted-foreground/70 shrink-0 text-[11px]\">\n {s.sub}\n </span>\n )}\n </span>\n ))}\n </span>\n </span>\n )}\n </span>\n )}\n </span>\n </span>,\n document.body\n )}\n </span>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Modal, ModalHeader, ModalTitle, ModalClose, ModalBody, ModalFooter } from './chunk-
|
|
1
|
+
import { Modal, ModalHeader, ModalTitle, ModalClose, ModalBody, ModalFooter } from './chunk-ENMXHZNE.js';
|
|
2
2
|
import { cn } from './chunk-TQONQSJO.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Keyboard } from 'lucide-react';
|
|
@@ -101,5 +101,5 @@ function KeyboardShortcutsOverlay({
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
export { Kbd, KeyboardShortcutsOverlay };
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-BIQ7GSO2.js.map
|
|
105
|
+
//# sourceMappingURL=chunk-BIQ7GSO2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/KeyboardShortcutsOverlay/KeyboardShortcutsOverlay.tsx"],"names":["Kbd","Fragment"],"mappings":";;;;;;AAqBO,IAAM,GAAA,GAAY,iBAAkC,SAASA,IAAAA,CAClE,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EACtB,GAAA,EACA;AACA,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,EAAA;AAAA,QACT,2FAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AA+BD,SAAS,IAAA,CAAK;AAAA,EACZ,IAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,MAAM,IAAA,GAAO,MAAM,OAAA,CAAQ,IAAI,IAAI,IAAA,GAAO,IAAA,CAAK,MAAM,KAAK,CAAA;AAC1D,EAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,kCAAA,EACb,QAAA,EAAA,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,qBACZ,IAAA,CAAO,KAAA,CAAA,QAAA,EAAN,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,OAAK,QAAA,EAAA,CAAA,EAAE,CAAA;AAAA,IACP,CAAA,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,KAAA;AAAA,MAEZ,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,WAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,IAAA,CAAC,UAAA,EAAA,EAAW,WAAU,iCAAA,EACpB,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,QAAA,EAAA,EAAS,aAAA,EAAY,MAAA,EAAO,SAAA,EAAU,0BAAA,EAA2B,CAAA;AAAA,YACjE;AAAA,WAAA,EACH,CAAA;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA,SAAA,EACd,CAAA;AAAA,wBACA,IAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAU,qBAAA,EAClB,QAAA,EAAA;AAAA,UAAA,SAAA,oBACC,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,SAAA;AAAA,cACA;AAAA;AAAA,WACF;AAAA,UAED,QAAQ,GAAA,CAAI,CAAC,0BACZ,IAAA,CAAC,KAAA,EAAA,EAAsB,WAAU,qBAAA,EAC/B,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,qEAAA,EACX,QAAA,EAAA,KAAA,CAAM,KAAA,EACT,CAAA;AAAA,4BACA,GAAA;AAAA,cAAC,YAAA;AAAA,cAAA;AAAA,gBACC,WAAW,KAAA,CAAM,SAAA;AAAA,gBACjB;AAAA;AAAA;AACF,WAAA,EAAA,EAPQ,KAAA,CAAM,KAQhB,CACD;AAAA,SAAA,EACH,CAAA;AAAA,QACC,MAAA,wBACE,WAAA,EAAA,EAAY,SAAA,EAAU,oDACrB,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAM,kBAAO,CAAA,EAChB;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-BIQ7GSO2.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Keyboard } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport {\n Modal,\n ModalHeader,\n ModalTitle,\n ModalClose,\n ModalBody,\n ModalFooter,\n} from '../Modal';\n\n// =============================================================================\n// Kbd\n// =============================================================================\n\nexport type KbdProps = React.HTMLAttributes<HTMLElement>;\n\n/** A keyboard-key chip: `<Kbd>⌘K</Kbd>`. */\nexport const Kbd = React.forwardRef<HTMLElement, KbdProps>(function Kbd(\n { className, ...props },\n ref\n) {\n return (\n <kbd\n ref={ref}\n className={cn(\n 'border-border bg-muted text-foreground rounded border px-1.5 py-0.5 font-mono text-[11px]',\n className\n )}\n {...props}\n />\n );\n});\n\n// =============================================================================\n// KeyboardShortcutsOverlay\n// =============================================================================\n\nexport interface ShortcutDef {\n /** Key or alternatives — `\"j\"`, `[\"j\", \"↓\"]`, `\"⌘K\"`. */\n keys: string | string[];\n description: string;\n}\n\nexport interface ShortcutGroup {\n title: string;\n shortcuts: ShortcutDef[];\n}\n\nexport interface KeyboardShortcutsOverlayProps {\n open: boolean;\n onClose: () => void;\n /** Flat list of shortcuts, or use `groups` for sectioned help. */\n shortcuts?: ShortcutDef[];\n /** Sectioned shortcuts with group headings. */\n groups?: ShortcutGroup[];\n title?: string;\n /** Footer hint. Pass `null` to hide it. */\n hint?: React.ReactNode | null;\n /** Joins key alternatives (default \"or\"), overridable for i18n. */\n alternativesLabel?: string;\n}\n\nfunction Keys({\n keys,\n alternativesLabel,\n}: {\n keys: string | string[];\n alternativesLabel: string;\n}) {\n const list = Array.isArray(keys) ? keys : keys.split(' / ');\n return (\n <span className=\"flex shrink-0 items-center gap-1\">\n {list.map((k, i) => (\n <React.Fragment key={`${k}-${i}`}>\n <Kbd>{k}</Kbd>\n {i < list.length - 1 && (\n <span className=\"text-muted-foreground mx-0.5 text-xs\">\n {alternativesLabel}\n </span>\n )}\n </React.Fragment>\n ))}\n </span>\n );\n}\n\nfunction ShortcutList({\n shortcuts,\n alternativesLabel,\n}: {\n shortcuts: ShortcutDef[];\n alternativesLabel: string;\n}) {\n return (\n <ul className=\"flex list-none flex-col gap-2 p-0\">\n {shortcuts.map((s) => (\n <li\n key={`${s.description}-${String(s.keys)}`}\n className=\"text-foreground flex items-center justify-between gap-4 text-sm\"\n >\n <span className=\"min-w-0\">{s.description}</span>\n <Keys keys={s.keys} alternativesLabel={alternativesLabel} />\n </li>\n ))}\n </ul>\n );\n}\n\n/**\n * The `?` keyboard-shortcuts help dialog: a list of shortcut rows\n * (optionally grouped) with `Kbd` chips for each key. Pairs with the\n * `useKeyboardShortcut` hook, which handles the binding — this component\n * only renders the help.\n *\n * @example\n * ```tsx\n * const [open, setOpen] = useState(false);\n * useKeyboardShortcut('?', () => setOpen((v) => !v), {\n * modifiers: { shift: true },\n * });\n *\n * <KeyboardShortcutsOverlay\n * open={open}\n * onClose={() => setOpen(false)}\n * shortcuts={[\n * { keys: ['j', '↓'], description: 'Next record' },\n * { keys: '⌘K', description: 'Command palette' },\n * ]}\n * />\n * ```\n */\nexport function KeyboardShortcutsOverlay({\n open,\n onClose,\n shortcuts,\n groups,\n title = 'Keyboard shortcuts',\n hint,\n alternativesLabel = 'or',\n}: KeyboardShortcutsOverlayProps) {\n const defaultHint = (\n <>\n Press <Kbd>?</Kbd> anytime to toggle this help\n </>\n );\n const footer = hint === null ? null : (hint ?? defaultHint);\n\n return (\n <Modal\n open={open}\n onOpenChange={(o) => {\n if (!o) onClose();\n }}\n size=\"sm\"\n aria-label={title}\n >\n <ModalHeader>\n <ModalTitle className=\"flex items-center gap-2 text-sm\">\n <Keyboard aria-hidden=\"true\" className=\"text-primary-500 h-4 w-4\" />\n {title}\n </ModalTitle>\n <ModalClose />\n </ModalHeader>\n <ModalBody className=\"flex flex-col gap-4\">\n {shortcuts && (\n <ShortcutList\n shortcuts={shortcuts}\n alternativesLabel={alternativesLabel}\n />\n )}\n {groups?.map((group) => (\n <div key={group.title} className=\"flex flex-col gap-2\">\n <h3 className=\"text-muted-foreground text-xs font-semibold tracking-wide uppercase\">\n {group.title}\n </h3>\n <ShortcutList\n shortcuts={group.shortcuts}\n alternativesLabel={alternativesLabel}\n />\n </div>\n ))}\n </ModalBody>\n {footer && (\n <ModalFooter className=\"text-muted-foreground justify-center text-[11px]\">\n <span>{footer}</span>\n </ModalFooter>\n )}\n </Modal>\n );\n}\n"]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/useStickToBottom.ts
|
|
4
|
+
function pinToBottom(el) {
|
|
5
|
+
el.scrollTop = el.scrollHeight;
|
|
6
|
+
}
|
|
7
|
+
function useStickToBottom({
|
|
8
|
+
threshold = 100,
|
|
9
|
+
disabled = false
|
|
10
|
+
} = {}) {
|
|
11
|
+
const containerRef = React.useRef(null);
|
|
12
|
+
const contentRef = React.useRef(null);
|
|
13
|
+
const [isAtBottom, setIsAtBottom] = React.useState(true);
|
|
14
|
+
const pinnedRef = React.useRef(true);
|
|
15
|
+
const readingRef = React.useRef(false);
|
|
16
|
+
const anchorTargetRef = React.useRef(null);
|
|
17
|
+
const anchorDistanceRef = React.useRef(Infinity);
|
|
18
|
+
const [containerEl, setContainerEl] = React.useState(
|
|
19
|
+
null
|
|
20
|
+
);
|
|
21
|
+
const [contentEl, setContentEl] = React.useState(null);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (containerRef.current !== containerEl)
|
|
24
|
+
setContainerEl(containerRef.current);
|
|
25
|
+
if (contentRef.current !== contentEl) setContentEl(contentRef.current);
|
|
26
|
+
});
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
if (disabled) return;
|
|
29
|
+
const el = containerEl;
|
|
30
|
+
if (!el) return;
|
|
31
|
+
const handleScroll = () => {
|
|
32
|
+
const anchorTarget = anchorTargetRef.current;
|
|
33
|
+
if (anchorTarget != null) {
|
|
34
|
+
const distance = Math.abs(el.scrollTop - anchorTarget);
|
|
35
|
+
if (distance < 2) {
|
|
36
|
+
anchorTargetRef.current = null;
|
|
37
|
+
} else if (distance > anchorDistanceRef.current + 1) {
|
|
38
|
+
anchorTargetRef.current = null;
|
|
39
|
+
} else {
|
|
40
|
+
anchorDistanceRef.current = distance;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const atBottom = el.scrollHeight - el.scrollTop - el.clientHeight <= threshold;
|
|
45
|
+
if (!atBottom) readingRef.current = false;
|
|
46
|
+
pinnedRef.current = atBottom && !readingRef.current;
|
|
47
|
+
setIsAtBottom(atBottom);
|
|
48
|
+
};
|
|
49
|
+
if (pinnedRef.current) pinToBottom(el);
|
|
50
|
+
handleScroll();
|
|
51
|
+
el.addEventListener("scroll", handleScroll, { passive: true });
|
|
52
|
+
return () => el.removeEventListener("scroll", handleScroll);
|
|
53
|
+
}, [containerEl, threshold, disabled]);
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
if (disabled) return;
|
|
56
|
+
const el = containerEl;
|
|
57
|
+
if (!el || typeof globalThis.ResizeObserver === "undefined") return;
|
|
58
|
+
const observer = new globalThis.ResizeObserver(() => {
|
|
59
|
+
if (pinnedRef.current) {
|
|
60
|
+
pinToBottom(el);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (anchorTargetRef.current != null) return;
|
|
64
|
+
const atBottom = el.scrollHeight - el.scrollTop - el.clientHeight <= threshold;
|
|
65
|
+
if (!atBottom) readingRef.current = false;
|
|
66
|
+
setIsAtBottom(atBottom);
|
|
67
|
+
});
|
|
68
|
+
observer.observe(el);
|
|
69
|
+
if (contentEl) observer.observe(contentEl);
|
|
70
|
+
return () => observer.disconnect();
|
|
71
|
+
}, [containerEl, contentEl, threshold, disabled]);
|
|
72
|
+
const scrollToBottom = React.useCallback(
|
|
73
|
+
(behavior = "auto") => {
|
|
74
|
+
const el = containerRef.current;
|
|
75
|
+
if (!el) return;
|
|
76
|
+
readingRef.current = false;
|
|
77
|
+
anchorTargetRef.current = null;
|
|
78
|
+
pinnedRef.current = true;
|
|
79
|
+
setIsAtBottom(true);
|
|
80
|
+
if (typeof el.scrollTo === "function") {
|
|
81
|
+
el.scrollTo({ top: el.scrollHeight, behavior });
|
|
82
|
+
} else {
|
|
83
|
+
pinToBottom(el);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
[]
|
|
87
|
+
);
|
|
88
|
+
const anchorToTurnStart = React.useCallback(
|
|
89
|
+
(target, behavior = "auto") => {
|
|
90
|
+
const el = containerRef.current;
|
|
91
|
+
if (!el) return;
|
|
92
|
+
readingRef.current = true;
|
|
93
|
+
pinnedRef.current = false;
|
|
94
|
+
const top = Math.min(
|
|
95
|
+
target.getBoundingClientRect().top - el.getBoundingClientRect().top + el.scrollTop,
|
|
96
|
+
el.scrollHeight - el.clientHeight
|
|
97
|
+
);
|
|
98
|
+
if (Math.abs(el.scrollTop - top) < 2) return;
|
|
99
|
+
anchorTargetRef.current = top;
|
|
100
|
+
anchorDistanceRef.current = Infinity;
|
|
101
|
+
if (typeof el.scrollTo === "function") {
|
|
102
|
+
el.scrollTo({ top, behavior });
|
|
103
|
+
} else {
|
|
104
|
+
el.scrollTop = top;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
[]
|
|
108
|
+
);
|
|
109
|
+
const followIfPinned = React.useCallback(
|
|
110
|
+
(behavior = "auto") => {
|
|
111
|
+
if (!pinnedRef.current) return false;
|
|
112
|
+
scrollToBottom(behavior);
|
|
113
|
+
return true;
|
|
114
|
+
},
|
|
115
|
+
[scrollToBottom]
|
|
116
|
+
);
|
|
117
|
+
const stopFollowing = React.useCallback(() => {
|
|
118
|
+
readingRef.current = true;
|
|
119
|
+
pinnedRef.current = false;
|
|
120
|
+
}, []);
|
|
121
|
+
return {
|
|
122
|
+
containerRef,
|
|
123
|
+
contentRef,
|
|
124
|
+
isAtBottom,
|
|
125
|
+
scrollToBottom,
|
|
126
|
+
anchorToTurnStart,
|
|
127
|
+
followIfPinned,
|
|
128
|
+
stopFollowing
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function useStreamEndedBelowFold(newest, isAtBottom, onEnded, onEndedAtBottom) {
|
|
132
|
+
const streamingIdRef = React.useRef(null);
|
|
133
|
+
React.useEffect(() => {
|
|
134
|
+
if (newest?.status === "streaming") {
|
|
135
|
+
streamingIdRef.current = newest.id;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (streamingIdRef.current && newest?.id === streamingIdRef.current) {
|
|
139
|
+
streamingIdRef.current = null;
|
|
140
|
+
if (!isAtBottom) onEnded();
|
|
141
|
+
else onEndedAtBottom?.();
|
|
142
|
+
}
|
|
143
|
+
}, [newest, isAtBottom, onEnded, onEndedAtBottom]);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { useStickToBottom, useStreamEndedBelowFold };
|
|
147
|
+
//# sourceMappingURL=chunk-BM35CACB.js.map
|
|
148
|
+
//# sourceMappingURL=chunk-BM35CACB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useStickToBottom.ts"],"names":[],"mappings":";;;AAyDA,SAAS,YAAY,EAAA,EAAiB;AACpC,EAAA,EAAA,CAAG,YAAY,EAAA,CAAG,YAAA;AACpB;AAmCO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,SAAA,GAAY,GAAA;AAAA,EACZ,QAAA,GAAW;AACb,CAAA,GAA6B,EAAC,EAA2B;AACvD,EAAA,MAAM,YAAA,GAAqB,aAAuB,IAAI,CAAA;AACtD,EAAA,MAAM,UAAA,GAAmB,aAAuB,IAAI,CAAA;AACpD,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAU,eAAS,IAAI,CAAA;AAGvD,EAAA,MAAM,SAAA,GAAkB,aAAO,IAAI,CAAA;AAMnC,EAAA,MAAM,UAAA,GAAmB,aAAO,KAAK,CAAA;AAKrC,EAAA,MAAM,eAAA,GAAwB,aAAsB,IAAI,CAAA;AACxD,EAAA,MAAM,iBAAA,GAA0B,aAAO,QAAQ,CAAA;AAM/C,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAU,KAAA,CAAA,QAAA;AAAA,IAC1C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MAAA,EAAQ,UAAA,EAAY,OAAA,EAAS,eAAe,CAAC,CAAA;AACnD","file":"chunk-BM35CACB.js","sourcesContent":["import * as React from 'react';\n\n/**\n * Options for {@link useStickToBottom}.\n */\nexport interface UseStickToBottomOptions {\n /**\n * Distance from the bottom (px) within which the user still counts as \"at\n * the bottom\" — small offsets from rounding or momentum scrolling shouldn't\n * break pinning.\n */\n threshold?: number;\n /**\n * Disable all behavior (listeners and observers detach). Useful when the\n * scroll container anchors somewhere other than the bottom (e.g. a\n * newest-first feed).\n */\n disabled?: boolean;\n}\n\nexport interface UseStickToBottomReturn {\n /** Attach to the scrollable container. */\n containerRef: React.RefObject<HTMLDivElement | null>;\n /**\n * Attach to the element wrapping the container's content. Its growth (e.g.\n * a streaming message) re-pins the scroll while the user is at the bottom.\n */\n contentRef: React.RefObject<HTMLDivElement | null>;\n /** Whether the user is currently at (or within `threshold` of) the bottom. */\n isAtBottom: boolean;\n /** Scroll to the bottom and resume pinning. */\n scrollToBottom: (behavior?: ScrollBehavior) => void;\n /**\n * Scroll so `target`'s top aligns with the viewport top and enter “reading”\n * mode: content growing past the fold no longer auto-follows, so the reader\n * consumes the response at their own pace (the ChatGPT/Claude send UX).\n * Following resumes when they explicitly return to the bottom — a\n * jump-to-bottom click (`scrollToBottom`) or scrolling there by hand.\n */\n anchorToTurnStart: (target: HTMLElement, behavior?: ScrollBehavior) => void;\n /**\n * Scroll to the bottom only while actually following (at the bottom and not\n * in reading mode). Returns whether it scrolled — hosts use this to decide\n * between following an appended message and raising a “new messages” hint.\n */\n followIfPinned: (behavior?: ScrollBehavior) => boolean;\n /**\n * Hold the current position: enter reading mode without scrolling, so an\n * incoming stream fills below the fold instead of pushing the view up.\n * Call right after a streaming message appends (optionally after revealing\n * its first line with `followIfPinned`). Following resumes exactly as after\n * `anchorToTurnStart`: an explicit `scrollToBottom` or the reader returning\n * to the bottom by hand.\n */\n stopFollowing: () => void;\n}\n\nfunction pinToBottom(el: HTMLElement) {\n el.scrollTop = el.scrollHeight;\n}\n\n/**\n * Keeps a scroll container pinned to its bottom edge while the user is there,\n * and — crucially — leaves the scroll position alone once they scroll up.\n *\n * Designed for chat threads with streaming responses:\n * - While the user is at the bottom, content growth (new tokens, new\n * messages) and container resizes (on-screen keyboard, growing composer)\n * keep the newest content in view via a `ResizeObserver` on both the\n * content and the container.\n * - Once the user scrolls up, nothing moves until they return to the bottom\n * themselves or the host calls `scrollToBottom` (e.g. a jump-to-bottom\n * button, or an outgoing message from the local user).\n *\n * The hook only pins; *when* to force a scroll (own message sent, thread\n * switched) stays a host decision through `scrollToBottom`,\n * `anchorToTurnStart` (ChatGPT-style: scroll a fresh turn to the viewport top\n * and pause following while the reader digests the reply), and\n * `followIfPinned` (follow an append only while actually at the bottom).\n *\n * @example\n * ```tsx\n * const { containerRef, contentRef, isAtBottom, scrollToBottom } =\n * useStickToBottom();\n * return (\n * <div className=\"relative min-h-0 flex-1\">\n * <div ref={containerRef} className=\"h-full overflow-y-auto\">\n * <div ref={contentRef}>{rows}</div>\n * </div>\n * {!isAtBottom && <JumpToBottom onClick={() => scrollToBottom('smooth')} />}\n * </div>\n * );\n * ```\n */\nexport function useStickToBottom({\n threshold = 100,\n disabled = false,\n}: UseStickToBottomOptions = {}): UseStickToBottomReturn {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const [isAtBottom, setIsAtBottom] = React.useState(true);\n // Mirror of `isAtBottom` readable synchronously from observer callbacks\n // without re-subscribing them on every scroll.\n const pinnedRef = React.useRef(true);\n // “Reading” mode (entered via `anchorToTurnStart`): the viewport sits at the\n // reserved space below a fresh turn — geometrically the bottom — but growth\n // must NOT follow. Cleared once the position genuinely leaves the bottom\n // (content outgrew the reserve or the user scrolled up), after which the\n // normal pin-at-bottom rules apply again.\n const readingRef = React.useRef(false);\n // In-flight anchor animation: a smooth `anchorToTurnStart` fires scroll\n // events that are neither the user's nor at the bottom — they must not end\n // reading mode or re-pin. Cleared on arrival at the target, or when the\n // distance to it grows (the user grabbed the scroll mid-animation).\n const anchorTargetRef = React.useRef<number | null>(null);\n const anchorDistanceRef = React.useRef(Infinity);\n\n // Hosts can re-attach the refs to new DOM nodes without remounting (e.g.\n // SuperChat swapping its plain thread for the virtualized one when the\n // conversation grows). Mirror the current nodes into state so the listener\n // and observer effects below re-bind whenever the target changes.\n const [containerEl, setContainerEl] = React.useState<HTMLDivElement | null>(\n null\n );\n const [contentEl, setContentEl] = React.useState<HTMLDivElement | null>(null);\n // Intentionally dep-less: ref mutations don't trigger renders, so this must\n // check after every render. The inequality guards make it settle immediately.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n React.useEffect(() => {\n if (containerRef.current !== containerEl)\n setContainerEl(containerRef.current);\n if (contentRef.current !== contentEl) setContentEl(contentRef.current);\n });\n\n // Track the user's position: at (or near) the bottom means \"pinned\".\n React.useEffect(() => {\n if (disabled) return;\n const el = containerEl;\n if (!el) return;\n\n const handleScroll = () => {\n const anchorTarget = anchorTargetRef.current;\n if (anchorTarget != null) {\n const distance = Math.abs(el.scrollTop - anchorTarget);\n if (distance < 2) {\n anchorTargetRef.current = null; // arrived — handle normally\n } else if (distance > anchorDistanceRef.current + 1) {\n anchorTargetRef.current = null; // user took over mid-animation\n } else {\n anchorDistanceRef.current = distance;\n return; // the animation's own events don't change pinning\n }\n }\n const atBottom =\n el.scrollHeight - el.scrollTop - el.clientHeight <= threshold;\n if (!atBottom) readingRef.current = false;\n pinnedRef.current = atBottom && !readingRef.current;\n setIsAtBottom(atBottom);\n };\n\n // A freshly attached node starts at `scrollTop` 0 — re-assert carried-over\n // pinning (e.g. across SuperChat's plain ⇄ virtualized swap) instead of\n // letting the initial read demote a pinned reader to \"scrolled up\".\n if (pinnedRef.current) pinToBottom(el);\n handleScroll(); // initial position\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, [containerEl, threshold, disabled]);\n\n // While pinned, follow growth of the content (streaming tokens, appended\n // rows) and shrinking of the container (on-screen keyboard, composer\n // growing) so the newest content stays in view. While unpinned this\n // observer never touches the scroll position.\n React.useEffect(() => {\n if (disabled) return;\n const el = containerEl;\n if (!el || typeof globalThis.ResizeObserver === 'undefined') return;\n\n const observer = new globalThis.ResizeObserver(() => {\n if (pinnedRef.current) {\n pinToBottom(el);\n return;\n }\n // Mid-anchor-animation the position is transient — judge nothing yet.\n if (anchorTargetRef.current != null) return;\n // Not following: growth can still silently carry the position away from\n // the bottom (no scroll event fires), so recompute the state here — it\n // drives the jump-to-bottom affordance and ends reading mode once the\n // response outgrows its reserved space.\n const atBottom =\n el.scrollHeight - el.scrollTop - el.clientHeight <= threshold;\n if (!atBottom) readingRef.current = false;\n setIsAtBottom(atBottom);\n });\n observer.observe(el);\n if (contentEl) observer.observe(contentEl);\n return () => observer.disconnect();\n }, [containerEl, contentEl, threshold, disabled]);\n\n const scrollToBottom = React.useCallback(\n (behavior: ScrollBehavior = 'auto') => {\n const el = containerRef.current;\n if (!el) return;\n // Pin immediately so a concurrent stream keeps following while a\n // smooth scroll animates down.\n readingRef.current = false;\n anchorTargetRef.current = null;\n pinnedRef.current = true;\n setIsAtBottom(true);\n if (typeof el.scrollTo === 'function') {\n el.scrollTo({ top: el.scrollHeight, behavior });\n } else {\n pinToBottom(el); // jsdom fallback\n }\n },\n []\n );\n\n const anchorToTurnStart = React.useCallback(\n (target: HTMLElement, behavior: ScrollBehavior = 'auto') => {\n const el = containerRef.current;\n if (!el) return;\n readingRef.current = true;\n pinnedRef.current = false;\n // Clamp to the reachable range so the “arrived” check always resolves.\n const top = Math.min(\n target.getBoundingClientRect().top -\n el.getBoundingClientRect().top +\n el.scrollTop,\n el.scrollHeight - el.clientHeight\n );\n // Already there: `scrollTo` emits no scroll event, so tracking an\n // in-flight animation would swallow observer updates forever.\n if (Math.abs(el.scrollTop - top) < 2) return;\n anchorTargetRef.current = top;\n anchorDistanceRef.current = Infinity;\n if (typeof el.scrollTo === 'function') {\n el.scrollTo({ top, behavior });\n } else {\n el.scrollTop = top; // jsdom fallback\n }\n },\n []\n );\n\n const followIfPinned = React.useCallback(\n (behavior: ScrollBehavior = 'auto') => {\n if (!pinnedRef.current) return false;\n scrollToBottom(behavior);\n return true;\n },\n [scrollToBottom]\n );\n\n const stopFollowing = React.useCallback(() => {\n readingRef.current = true;\n pinnedRef.current = false;\n }, []);\n\n return {\n containerRef,\n contentRef,\n isAtBottom,\n scrollToBottom,\n anchorToTurnStart,\n followIfPinned,\n stopFollowing,\n };\n}\n\n/**\n * Companion to {@link useStickToBottom}: fires `onEnded` when the newest\n * message finishes streaming while the reader is away from the bottom — the\n * end of the reply landed below the fold, so the jump-to-bottom button should\n * upgrade to its “new messages” hint. When the whole reply fit above the fold\n * (the reader is still at the bottom), `onEndedAtBottom` fires instead so the\n * host can exit the stream's hold and resume following (`scrollToBottom`).\n */\nexport function useStreamEndedBelowFold(\n newest: { id: string; status?: string } | undefined,\n isAtBottom: boolean,\n onEnded: () => void,\n onEndedAtBottom?: () => void\n) {\n const streamingIdRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n if (newest?.status === 'streaming') {\n streamingIdRef.current = newest.id;\n return;\n }\n if (streamingIdRef.current && newest?.id === streamingIdRef.current) {\n streamingIdRef.current = null;\n if (!isAtBottom) onEnded();\n else onEndedAtBottom?.();\n }\n }, [newest, isAtBottom, onEnded, onEndedAtBottom]);\n}\n"]}
|