@alfadocs/ui-kit-debug 0.30.5 → 0.31.2
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/_chunks/{accordion-CNcodXuO.js → accordion-bSU21uTV.js} +3 -3
- package/dist/_chunks/{accordion-CNcodXuO.js.map → accordion-bSU21uTV.js.map} +1 -1
- package/dist/_chunks/{agenda-card-DO9_yogb.js → agenda-card-UJA6Arbs.js} +3 -3
- package/dist/_chunks/{agenda-card-DO9_yogb.js.map → agenda-card-UJA6Arbs.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-WLbfMip6.js → agenda-tray-1fAxNOMz.js} +4 -4
- package/dist/_chunks/{agenda-tray-WLbfMip6.js.map → agenda-tray-1fAxNOMz.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-BXlwNnWe.js → ai-prompt-input-C6sCr1Vi.js} +11 -10
- package/dist/_chunks/ai-prompt-input-C6sCr1Vi.js.map +1 -0
- package/dist/_chunks/{alia-sidebar-C-232sD7.js → alia-sidebar-BEoMl6UL.js} +9 -9
- package/dist/_chunks/{alia-sidebar-C-232sD7.js.map → alia-sidebar-BEoMl6UL.js.map} +1 -1
- package/dist/_chunks/ar-CEpIJtcO.js +399 -0
- package/dist/_chunks/ar-CEpIJtcO.js.map +1 -0
- package/dist/_chunks/{audio-recorder-DL800PE_.js → audio-recorder-C1rhKhSN.js} +114 -114
- package/dist/_chunks/audio-recorder-C1rhKhSN.js.map +1 -0
- package/dist/_chunks/audio-visualiser-l6zPd0AG.js +162 -0
- package/dist/_chunks/audio-visualiser-l6zPd0AG.js.map +1 -0
- package/dist/_chunks/{autocomplete-CUh0f7Dj.js → autocomplete-DIgdhCGJ.js} +2 -2
- package/dist/_chunks/{autocomplete-CUh0f7Dj.js.map → autocomplete-DIgdhCGJ.js.map} +1 -1
- package/dist/_chunks/{avatar-D_H4emLo.js → avatar-BNQNhoyL.js} +19 -18
- package/dist/_chunks/avatar-BNQNhoyL.js.map +1 -0
- package/dist/_chunks/{badge-CIjQ1Us1.js → badge-CptERaHx.js} +2 -2
- package/dist/_chunks/{badge-CIjQ1Us1.js.map → badge-CptERaHx.js.map} +1 -1
- package/dist/_chunks/{booking-Cw92aqo3.js → booking-BIZ9GSer.js} +149 -160
- package/dist/_chunks/booking-BIZ9GSer.js.map +1 -0
- package/dist/_chunks/{breadcrumb--YI7lcHA.js → breadcrumb-CLlhx7qo.js} +2 -2
- package/dist/_chunks/{breadcrumb--YI7lcHA.js.map → breadcrumb-CLlhx7qo.js.map} +1 -1
- package/dist/_chunks/{button-group-Bh2g_Ng-.js → button-group-Ciq6J4IW.js} +15 -14
- package/dist/_chunks/button-group-Ciq6J4IW.js.map +1 -0
- package/dist/_chunks/{calendar-WWNx448i.js → calendar-YHFknAGv.js} +22 -22
- package/dist/_chunks/{calendar-WWNx448i.js.map → calendar-YHFknAGv.js.map} +1 -1
- package/dist/_chunks/calendar-clock-CYkcqdwl.js +19 -0
- package/dist/_chunks/calendar-clock-CYkcqdwl.js.map +1 -0
- package/dist/_chunks/{carousel.agent-C2Icc9_T.js → carousel.agent-DrX96W-1.js} +2 -2
- package/dist/_chunks/{carousel.agent-C2Icc9_T.js.map → carousel.agent-DrX96W-1.js.map} +1 -1
- package/dist/_chunks/{chart-BLvFl169.js → chart-DLkVn_ex.js} +2 -2
- package/dist/_chunks/{chart-BLvFl169.js.map → chart-DLkVn_ex.js.map} +1 -1
- package/dist/_chunks/{chat-container-izziXViv.js → chat-container-ogB4OskO.js} +24 -23
- package/dist/_chunks/chat-container-ogB4OskO.js.map +1 -0
- package/dist/_chunks/{chat-input-cyl_y9bh.js → chat-input-CQe7nR_v.js} +132 -118
- package/dist/_chunks/chat-input-CQe7nR_v.js.map +1 -0
- package/dist/_chunks/{chat-message-fg221-yx.js → chat-message-D53_fH2w.js} +2 -2
- package/dist/_chunks/{chat-message-fg221-yx.js.map → chat-message-D53_fH2w.js.map} +1 -1
- package/dist/_chunks/{checkbox-Dgp_cfUr.js → checkbox-DRcOdmXv.js} +3 -3
- package/dist/_chunks/{checkbox-Dgp_cfUr.js.map → checkbox-DRcOdmXv.js.map} +1 -1
- package/dist/_chunks/{checkbox-group-eVowqKcT.js → checkbox-group-CpUwlHug.js} +3 -3
- package/dist/_chunks/{checkbox-group-eVowqKcT.js.map → checkbox-group-CpUwlHug.js.map} +1 -1
- package/dist/_chunks/{collapsible-hHiyZp0b.js → collapsible-CERONory.js} +2 -2
- package/dist/_chunks/{collapsible-hHiyZp0b.js.map → collapsible-CERONory.js.map} +1 -1
- package/dist/_chunks/{color-picker-Bm-gzpsh.js → color-picker-9tL7pz5y.js} +192 -181
- package/dist/_chunks/color-picker-9tL7pz5y.js.map +1 -0
- package/dist/_chunks/{combobox-Da9eq00i.js → combobox-BC-DFx8G.js} +31 -30
- package/dist/_chunks/combobox-BC-DFx8G.js.map +1 -0
- package/dist/_chunks/{command-palette-11BieSNq.js → command-palette-BiPAAno-.js} +125 -123
- package/dist/_chunks/command-palette-BiPAAno-.js.map +1 -0
- package/dist/_chunks/{copy-field-BAF4mt9h.js → copy-field-CCq7j6Zc.js} +2 -2
- package/dist/_chunks/{copy-field-BAF4mt9h.js.map → copy-field-CCq7j6Zc.js.map} +1 -1
- package/dist/_chunks/{date-picker-D0Ry1dMz.js → date-picker-B94HAV4A.js} +4 -4
- package/dist/_chunks/{date-picker-D0Ry1dMz.js.map → date-picker-B94HAV4A.js.map} +1 -1
- package/dist/_chunks/{date-range-picker-DYgHzMOo.js → date-range-picker-D4dgDlLU.js} +73 -73
- package/dist/_chunks/date-range-picker-D4dgDlLU.js.map +1 -0
- package/dist/_chunks/{date-time-picker-CGmGtcyc.js → date-time-picker-D1GEzf8p.js} +5 -5
- package/dist/_chunks/{date-time-picker-CGmGtcyc.js.map → date-time-picker-D1GEzf8p.js.map} +1 -1
- package/dist/_chunks/de-Dfbeau59.js +477 -0
- package/dist/_chunks/de-Dfbeau59.js.map +1 -0
- package/dist/_chunks/{description-list-CWjnaDGn.js → description-list-BEbK2g93.js} +2 -2
- package/dist/_chunks/{description-list-CWjnaDGn.js.map → description-list-BEbK2g93.js.map} +1 -1
- package/dist/_chunks/{dialog-C-lTGVkB.js → dialog-Cee13rHU.js} +3 -3
- package/dist/_chunks/{dialog-C-lTGVkB.js.map → dialog-Cee13rHU.js.map} +1 -1
- package/dist/_chunks/{dropdown-menu-DZxwF23X.js → dropdown-menu-BC5ZdOMo.js} +3 -3
- package/dist/_chunks/{dropdown-menu-DZxwF23X.js.map → dropdown-menu-BC5ZdOMo.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-CztRy_21.js → editable-currency-cell-renderer-BpicmolK.js} +308 -322
- package/dist/_chunks/editable-currency-cell-renderer-BpicmolK.js.map +1 -0
- package/dist/_chunks/el-Dro3J7CP.js +373 -0
- package/dist/_chunks/el-Dro3J7CP.js.map +1 -0
- package/dist/_chunks/{email-input-DvJ_kPKL.js → email-input-lQivsFrw.js} +3 -3
- package/dist/_chunks/{email-input-DvJ_kPKL.js.map → email-input-lQivsFrw.js.map} +1 -1
- package/dist/_chunks/es-Dvg8u70B.js +373 -0
- package/dist/_chunks/es-Dvg8u70B.js.map +1 -0
- package/dist/_chunks/{file-upload-DxAQprcU.js → file-upload-CdozCPct.js} +226 -233
- package/dist/_chunks/file-upload-CdozCPct.js.map +1 -0
- package/dist/_chunks/fr-VOGjBSPP.js +338 -0
- package/dist/_chunks/fr-VOGjBSPP.js.map +1 -0
- package/dist/_chunks/{freemium-paywall-B9c8Ylww.js → freemium-paywall-D1N02Oam.js} +4 -4
- package/dist/_chunks/{freemium-paywall-B9c8Ylww.js.map → freemium-paywall-D1N02Oam.js.map} +1 -1
- package/dist/_chunks/{header-DDj7uGD-.js → header-CTZWX-tm.js} +2 -2
- package/dist/_chunks/{header-DDj7uGD-.js.map → header-CTZWX-tm.js.map} +1 -1
- package/dist/_chunks/hi-BSDxWU_y.js +433 -0
- package/dist/_chunks/hi-BSDxWU_y.js.map +1 -0
- package/dist/_chunks/{icon-button-DPEqBKBQ.js → icon-button-CKEOrN37.js} +2 -2
- package/dist/_chunks/{icon-button-DPEqBKBQ.js.map → icon-button-CKEOrN37.js.map} +1 -1
- package/dist/_chunks/{icon-button-group-DeV3FpNY.js → icon-button-group-C48khLE0.js} +23 -22
- package/dist/_chunks/icon-button-group-C48khLE0.js.map +1 -0
- package/dist/_chunks/{isSameDay-DHG8Xade.js → isSameDay-DUEiAT0G.js} +2 -2
- package/dist/_chunks/{isSameDay-DHG8Xade.js.map → isSameDay-DUEiAT0G.js.map} +1 -1
- package/dist/_chunks/isSameWeek-Dfzu29cW.js +14 -0
- package/dist/_chunks/isSameWeek-Dfzu29cW.js.map +1 -0
- package/dist/_chunks/it-CuonvcI_.js +401 -0
- package/dist/_chunks/it-CuonvcI_.js.map +1 -0
- package/dist/_chunks/ja-DO57gIOT.js +366 -0
- package/dist/_chunks/ja-DO57gIOT.js.map +1 -0
- package/dist/_chunks/{key-value-pair-BvDY3zuc.js → key-value-pair-C8DaR3Xs.js} +2 -2
- package/dist/_chunks/{key-value-pair-BvDY3zuc.js.map → key-value-pair-C8DaR3Xs.js.map} +1 -1
- package/dist/_chunks/{list-BdvDctBz.js → list-BOwqwy03.js} +44 -43
- package/dist/_chunks/list-BOwqwy03.js.map +1 -0
- package/dist/_chunks/{locale-picker-CY89MChR.js → locale-picker-D99UyZVJ.js} +4 -4
- package/dist/_chunks/{locale-picker-CY89MChR.js.map → locale-picker-D99UyZVJ.js.map} +1 -1
- package/dist/_chunks/{map-view-DyB8tr6c.js → map-view-WEWqXzof.js} +569 -557
- package/dist/_chunks/{map-view-DyB8tr6c.js.map → map-view-WEWqXzof.js.map} +1 -1
- package/dist/_chunks/{message-card-D6iyPacd.js → message-card-BbRhZkDI.js} +3 -3
- package/dist/_chunks/{message-card-D6iyPacd.js.map → message-card-BbRhZkDI.js.map} +1 -1
- package/dist/_chunks/{message-tray-Bh-0ra-Y.js → message-tray-B762TKuv.js} +11 -10
- package/dist/_chunks/message-tray-B762TKuv.js.map +1 -0
- package/dist/_chunks/{multi-select-dSe6Xtc4.js → multi-select-DOLO3K_z.js} +26 -25
- package/dist/_chunks/multi-select-DOLO3K_z.js.map +1 -0
- package/dist/_chunks/{navigation-menu-CyS1fBJ7.js → navigation-menu-C6lBYVv9.js} +3 -3
- package/dist/_chunks/{navigation-menu-CyS1fBJ7.js.map → navigation-menu-C6lBYVv9.js.map} +1 -1
- package/dist/_chunks/nl-DjPaaWaW.js +326 -0
- package/dist/_chunks/nl-DjPaaWaW.js.map +1 -0
- package/dist/_chunks/{notification-card-vaMaA7Wa.js → notification-card-DMdO4g54.js} +2 -2
- package/dist/_chunks/{notification-card-vaMaA7Wa.js.map → notification-card-DMdO4g54.js.map} +1 -1
- package/dist/_chunks/{notification-tray-Cnum6LwM.js → notification-tray-Dl3FTleW.js} +17 -16
- package/dist/_chunks/notification-tray-Dl3FTleW.js.map +1 -0
- package/dist/_chunks/{number-input-BZXu6bPY.js → number-input-Dj5L3pXK.js} +2 -2
- package/dist/_chunks/{number-input-BZXu6bPY.js.map → number-input-Dj5L3pXK.js.map} +1 -1
- package/dist/_chunks/{otp-input-BDF_iNpa.js → otp-input-BEg_sn8A.js} +2 -2
- package/dist/_chunks/{otp-input-BDF_iNpa.js.map → otp-input-BEg_sn8A.js.map} +1 -1
- package/dist/_chunks/{pagination-BWaXF7W0.js → pagination-DQOgnxxw.js} +2 -2
- package/dist/_chunks/{pagination-BWaXF7W0.js.map → pagination-DQOgnxxw.js.map} +1 -1
- package/dist/_chunks/{parseISO-Dk4xa7q6.js → parseISO-DEpUNwxZ.js} +2 -2
- package/dist/_chunks/{parseISO-Dk4xa7q6.js.map → parseISO-DEpUNwxZ.js.map} +1 -1
- package/dist/_chunks/{patient-search-ZpHN-pgJ.js → patient-search-hFiYbqcl.js} +8 -8
- package/dist/_chunks/{patient-search-ZpHN-pgJ.js.map → patient-search-hFiYbqcl.js.map} +1 -1
- package/dist/_chunks/{patient-shell-CYaNkbA1.js → patient-shell-CDvMw_Nk.js} +6 -6
- package/dist/_chunks/{patient-shell-CYaNkbA1.js.map → patient-shell-CDvMw_Nk.js.map} +1 -1
- package/dist/_chunks/{payment-form-Ds3rxvad.js → payment-form-D5rgnZu7.js} +2 -2
- package/dist/_chunks/{payment-form-Ds3rxvad.js.map → payment-form-D5rgnZu7.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-CIuaocnq.js → pdf-viewer-DvtEHcEP.js} +347 -320
- package/dist/_chunks/{pdf-viewer-CIuaocnq.js.map → pdf-viewer-DvtEHcEP.js.map} +1 -1
- package/dist/_chunks/{phone-input-DKSHX7NQ.js → phone-input-DfZbPPvh.js} +217 -201
- package/dist/_chunks/phone-input-DfZbPPvh.js.map +1 -0
- package/dist/_chunks/pl-Cl4lOx2N.js +514 -0
- package/dist/_chunks/pl-Cl4lOx2N.js.map +1 -0
- package/dist/_chunks/{popover-BfHSBEKq.js → popover-Devce-tT.js} +3 -3
- package/dist/_chunks/{popover-BfHSBEKq.js.map → popover-Devce-tT.js.map} +1 -1
- package/dist/_chunks/practice-results-JQunxBIg.js +1618 -0
- package/dist/_chunks/practice-results-JQunxBIg.js.map +1 -0
- package/dist/_chunks/{privacy-lock-C6Ra5m3p.js → privacy-lock-DD-wHxBg.js} +3 -3
- package/dist/_chunks/{privacy-lock-C6Ra5m3p.js.map → privacy-lock-DD-wHxBg.js.map} +1 -1
- package/dist/_chunks/{progress-B-PSO5OS.js → progress-kzIRcdaq.js} +11 -10
- package/dist/_chunks/progress-kzIRcdaq.js.map +1 -0
- package/dist/_chunks/pt-D7qO5CzD.js +370 -0
- package/dist/_chunks/pt-D7qO5CzD.js.map +1 -0
- package/dist/_chunks/{public-footer.agent-Bc99tE5Z.js → public-footer.agent-Bh0rnx4i.js} +21 -14
- package/dist/_chunks/public-footer.agent-Bh0rnx4i.js.map +1 -0
- package/dist/_chunks/{public-header.agent-B-B0WDAi.js → public-header.agent-B2dDg2_d.js} +3 -3
- package/dist/_chunks/{public-header.agent-B-B0WDAi.js.map → public-header.agent-B2dDg2_d.js.map} +1 -1
- package/dist/_chunks/{radio-i4ogu3cq.js → radio-TWf9Q-mp.js} +2 -2
- package/dist/_chunks/{radio-i4ogu3cq.js.map → radio-TWf9Q-mp.js.map} +1 -1
- package/dist/_chunks/{radio-group-CTlGc36r.js → radio-group-BcF92GEF.js} +4 -4
- package/dist/_chunks/{radio-group-CTlGc36r.js.map → radio-group-BcF92GEF.js.map} +1 -1
- package/dist/_chunks/{react-day-picker-D3yzgvDB.js → react-day-picker-DsjfS7uI.js} +662 -615
- package/dist/_chunks/{react-day-picker-D3yzgvDB.js.map → react-day-picker-DsjfS7uI.js.map} +1 -1
- package/dist/_chunks/recaptcha-widget-CFYyLSEX.js +221 -0
- package/dist/_chunks/recaptcha-widget-CFYyLSEX.js.map +1 -0
- package/dist/_chunks/refresh-cw-CC8jSKMr.js +17 -0
- package/dist/_chunks/refresh-cw-CC8jSKMr.js.map +1 -0
- package/dist/_chunks/registry-nPAVE19X.js +21 -0
- package/dist/_chunks/registry-nPAVE19X.js.map +1 -0
- package/dist/_chunks/{resizable-COV-cnth.js → resizable-3vzqDlg6.js} +29 -28
- package/dist/_chunks/resizable-3vzqDlg6.js.map +1 -0
- package/dist/_chunks/{reviews-panel-bKEUKSic.js → reviews-panel-yanuBZs-.js} +4 -4
- package/dist/_chunks/{reviews-panel-bKEUKSic.js.map → reviews-panel-yanuBZs-.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-J-wAz9eN.js → rich-text-editor-CHmr9Bz8.js} +2 -2
- package/dist/_chunks/{rich-text-editor-J-wAz9eN.js.map → rich-text-editor-CHmr9Bz8.js.map} +1 -1
- package/dist/_chunks/ro-CP2-VJ_O.js +361 -0
- package/dist/_chunks/ro-CP2-VJ_O.js.map +1 -0
- package/dist/_chunks/ru-RPn9_Lpq.js +561 -0
- package/dist/_chunks/ru-RPn9_Lpq.js.map +1 -0
- package/dist/_chunks/{scroll-area-DEDU-lp-.js → scroll-area-BWqCkEGz.js} +2 -2
- package/dist/_chunks/{scroll-area-DEDU-lp-.js.map → scroll-area-BWqCkEGz.js.map} +1 -1
- package/dist/_chunks/{search-bar-BRMW1-WG.js → search-bar-CP6wUJFY.js} +3 -3
- package/dist/_chunks/{search-bar-BRMW1-WG.js.map → search-bar-CP6wUJFY.js.map} +1 -1
- package/dist/_chunks/{search-input-CIA6pPfn.js → search-input-C1C3jQpD.js} +24 -23
- package/dist/_chunks/search-input-C1C3jQpD.js.map +1 -0
- package/dist/_chunks/{select-C92AT_OZ.js → select-hsCaJSX3.js} +3 -3
- package/dist/_chunks/{select-C92AT_OZ.js.map → select-hsCaJSX3.js.map} +1 -1
- package/dist/_chunks/{sheet-D8Yl0nKR.js → sheet-BV-yuLE2.js} +3 -3
- package/dist/_chunks/{sheet-D8Yl0nKR.js.map → sheet-BV-yuLE2.js.map} +1 -1
- package/dist/_chunks/{sidebar-DkyC6GvS.js → sidebar-BbR8f6oe.js} +3 -3
- package/dist/_chunks/{sidebar-DkyC6GvS.js.map → sidebar-BbR8f6oe.js.map} +1 -1
- package/dist/_chunks/{signature-capture-DjMlFOzS.js → signature-capture-C-fF71xI.js} +213 -205
- package/dist/_chunks/signature-capture-C-fF71xI.js.map +1 -0
- package/dist/_chunks/{slider-CfEzeseL.js → slider-BHWzXdjt.js} +3 -3
- package/dist/_chunks/{slider-CfEzeseL.js.map → slider-BHWzXdjt.js.map} +1 -1
- package/dist/_chunks/{slot-grid-Q94gVmhn.js → slot-grid-Dz13dH82.js} +4 -4
- package/dist/_chunks/{slot-grid-Q94gVmhn.js.map → slot-grid-Dz13dH82.js.map} +1 -1
- package/dist/_chunks/smile-BSYLAHy6.js +17 -0
- package/dist/_chunks/smile-BSYLAHy6.js.map +1 -0
- package/dist/_chunks/{sparkline-B5Ms55PZ.js → sparkline-DEROcSl0.js} +2 -2
- package/dist/_chunks/{sparkline-B5Ms55PZ.js.map → sparkline-DEROcSl0.js.map} +1 -1
- package/dist/_chunks/sq-AQvefouo.js +355 -0
- package/dist/_chunks/sq-AQvefouo.js.map +1 -0
- package/dist/_chunks/{stepper-progress-jFY8BSf7.js → stepper-progress-DDjq5nei.js} +16 -15
- package/dist/_chunks/stepper-progress-DDjq5nei.js.map +1 -0
- package/dist/_chunks/streaming-text-GH07yIYh.js +127 -0
- package/dist/_chunks/streaming-text-GH07yIYh.js.map +1 -0
- package/dist/_chunks/sv-zkx9eBtD.js +376 -0
- package/dist/_chunks/sv-zkx9eBtD.js.map +1 -0
- package/dist/_chunks/{switch-D916VW86.js → switch-BJ6HD3Mn.js} +2 -2
- package/dist/_chunks/{switch-D916VW86.js.map → switch-BJ6HD3Mn.js.map} +1 -1
- package/dist/_chunks/{tabs-aEQfQV3x.js → tabs-BpPYVme_.js} +4 -4
- package/dist/_chunks/{tabs-aEQfQV3x.js.map → tabs-BpPYVme_.js.map} +1 -1
- package/dist/_chunks/{tag-bBPAvXyh.js → tag-CyoaEmf_.js} +2 -2
- package/dist/_chunks/{tag-bBPAvXyh.js.map → tag-CyoaEmf_.js.map} +1 -1
- package/dist/_chunks/{task-tray-6NlryfMJ.js → task-tray-DRK0b0Qb.js} +3 -3
- package/dist/_chunks/{task-tray-6NlryfMJ.js.map → task-tray-DRK0b0Qb.js.map} +1 -1
- package/dist/_chunks/{text-area-D5GAe8pV.js → text-area-BIx0tZ05.js} +27 -26
- package/dist/_chunks/text-area-BIx0tZ05.js.map +1 -0
- package/dist/_chunks/{text-input-CakysYnD.js → text-input-BaClJL8Y.js} +2 -2
- package/dist/_chunks/{text-input-CakysYnD.js.map → text-input-BaClJL8Y.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-JoeMs_ws.js → theme-toggle-DpC28kt5.js} +6 -6
- package/dist/_chunks/{theme-toggle-JoeMs_ws.js.map → theme-toggle-DpC28kt5.js.map} +1 -1
- package/dist/_chunks/{time-picker-DeVZkIY2.js → time-picker-B5umYwfv.js} +2 -2
- package/dist/_chunks/{time-picker-DeVZkIY2.js.map → time-picker-B5umYwfv.js.map} +1 -1
- package/dist/_chunks/{timeline-CR7HjZCK.js → timeline-D0Wo7v_o.js} +3 -3
- package/dist/_chunks/{timeline-CR7HjZCK.js.map → timeline-D0Wo7v_o.js.map} +1 -1
- package/dist/_chunks/{toast.agent-DVpKt38p.js → toast.agent-WHHfw5VX.js} +322 -320
- package/dist/_chunks/{toast.agent-DVpKt38p.js.map → toast.agent-WHHfw5VX.js.map} +1 -1
- package/dist/_chunks/{tooltip-ClJd0ciy.js → tooltip-DvmfrNvB.js} +29 -20
- package/dist/_chunks/tooltip-DvmfrNvB.js.map +1 -0
- package/dist/_chunks/{tooth-scheme-3mITSXiZ.js → tooth-scheme-CxlsLjfN.js} +2 -2
- package/dist/_chunks/{tooth-scheme-3mITSXiZ.js.map → tooth-scheme-CxlsLjfN.js.map} +1 -1
- package/dist/_chunks/tr-Dmr412Ac.js +378 -0
- package/dist/_chunks/tr-Dmr412Ac.js.map +1 -0
- package/dist/_chunks/{transaction-chip-z9ENE50O.js → transaction-chip-B8ujzowA.js} +47 -60
- package/dist/_chunks/transaction-chip-B8ujzowA.js.map +1 -0
- package/dist/_chunks/{transcript-panel-QUQ9XJmf.js → transcript-panel-DyhTpAP7.js} +21 -20
- package/dist/_chunks/transcript-panel-DyhTpAP7.js.map +1 -0
- package/dist/_chunks/{use-direction-D6rvvG9G.js → use-direction-Dp8h70PP.js} +7 -6
- package/dist/_chunks/use-direction-Dp8h70PP.js.map +1 -0
- package/dist/_chunks/use-isomorphic-layout-effect-BGfaCOP1.js +6 -0
- package/dist/_chunks/use-isomorphic-layout-effect-BGfaCOP1.js.map +1 -0
- package/dist/_chunks/use-media-query-CcAx5SMM.js +16 -0
- package/dist/_chunks/use-media-query-CcAx5SMM.js.map +1 -0
- package/dist/_chunks/{use-password-requirements-E0sSfx5X.js → use-password-requirements-DsgduV1x.js} +3 -3
- package/dist/_chunks/{use-password-requirements-E0sSfx5X.js.map → use-password-requirements-DsgduV1x.js.map} +1 -1
- package/dist/_chunks/use-scroll-to-first-error-4Za-u5Nw.js +43 -0
- package/dist/_chunks/use-scroll-to-first-error-4Za-u5Nw.js.map +1 -0
- package/dist/_chunks/{workflow-map-DlWBJJBt.js → workflow-map-BSvQS3be.js} +6 -6
- package/dist/_chunks/{workflow-map-DlWBJJBt.js.map → workflow-map-BSvQS3be.js.map} +1 -1
- package/dist/_chunks/zh-CN-DxVt64Zk.js +388 -0
- package/dist/_chunks/zh-CN-DxVt64Zk.js.map +1 -0
- package/dist/agent/registry.d.ts +1 -6
- package/dist/agent/registry.d.ts.map +1 -1
- package/dist/agent-catalog.json +42 -1
- package/dist/components/_shared/date-locale.d.ts +7 -2
- package/dist/components/_shared/date-locale.d.ts.map +1 -1
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/_shared/index.d.ts.map +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/audio-recorder/audio-recorder.d.ts.map +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/audio-visualiser.d.ts.map +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-container/chat-container.d.ts.map +1 -1
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/chat-input/chat-input.d.ts.map +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts.map +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/cell-renderers/color-dot-cell-renderer.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +6 -6
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +10 -0
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/practice-results/index.d.ts +4 -0
- package/dist/components/practice-results/index.d.ts.map +1 -0
- package/dist/components/practice-results/index.js +6 -0
- package/dist/components/practice-results/index.js.map +1 -0
- package/dist/components/practice-results/practice-results.agent.d.ts +4 -0
- package/dist/components/practice-results/practice-results.agent.d.ts.map +1 -0
- package/dist/components/practice-results/practice-results.d.ts +159 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -0
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-footer/public-footer.d.ts.map +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/recaptcha-widget/recaptcha-widget.d.ts.map +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/resizable/resizable.d.ts.map +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/signature-capture/signature-capture.d.ts.map +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/stepper-progress/index.js +1 -1
- package/dist/components/stepper-progress/stepper-progress.d.ts.map +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/streaming-text/streaming-text.d.ts.map +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-area/text-area.d.ts.map +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/transcript-panel/transcript-panel.d.ts.map +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.js +69 -66
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-debounced-value.d.ts.map +1 -1
- package/dist/hooks/use-direction.d.ts.map +1 -1
- package/dist/hooks/use-focus-trap.d.ts.map +1 -1
- package/dist/hooks/use-scroll-to-first-error.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +92 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +82 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +92 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +81 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +92 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +82 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +92 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +92 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +92 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +81 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +92 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +81 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +92 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +82 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +92 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +81 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +92 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +82 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +92 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +81 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +92 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +82 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +92 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +83 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +92 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +82 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +92 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +82 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +92 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +82 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +92 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +82 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +92 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +82 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +92 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +82 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +532 -528
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +92 -0
- package/dist/locales/de.json +92 -0
- package/dist/locales/el.json +92 -0
- package/dist/locales/en.json +92 -0
- package/dist/locales/es.json +92 -0
- package/dist/locales/fr.json +92 -0
- package/dist/locales/hi.json +92 -0
- package/dist/locales/it.json +92 -0
- package/dist/locales/ja.json +92 -0
- package/dist/locales/nl.json +92 -0
- package/dist/locales/pl.json +92 -0
- package/dist/locales/pt.json +92 -0
- package/dist/locales/ro.json +92 -0
- package/dist/locales/ru.json +92 -0
- package/dist/locales/sq.json +92 -0
- package/dist/locales/sv.json +92 -0
- package/dist/locales/tr.json +92 -0
- package/dist/locales/zh.json +92 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +5 -2
- package/dist/_chunks/ai-prompt-input-BXlwNnWe.js.map +0 -1
- package/dist/_chunks/audio-recorder-DL800PE_.js.map +0 -1
- package/dist/_chunks/audio-visualiser-I-T4Z7EU.js +0 -145
- package/dist/_chunks/audio-visualiser-I-T4Z7EU.js.map +0 -1
- package/dist/_chunks/avatar-D_H4emLo.js.map +0 -1
- package/dist/_chunks/booking-Cw92aqo3.js.map +0 -1
- package/dist/_chunks/button-group-Bh2g_Ng-.js.map +0 -1
- package/dist/_chunks/chat-container-izziXViv.js.map +0 -1
- package/dist/_chunks/chat-input-cyl_y9bh.js.map +0 -1
- package/dist/_chunks/color-picker-Bm-gzpsh.js.map +0 -1
- package/dist/_chunks/combobox-Da9eq00i.js.map +0 -1
- package/dist/_chunks/command-palette-11BieSNq.js.map +0 -1
- package/dist/_chunks/date-range-picker-DYgHzMOo.js.map +0 -1
- package/dist/_chunks/editable-currency-cell-renderer-CztRy_21.js.map +0 -1
- package/dist/_chunks/file-upload-DxAQprcU.js.map +0 -1
- package/dist/_chunks/icon-button-group-DeV3FpNY.js.map +0 -1
- package/dist/_chunks/list-BdvDctBz.js.map +0 -1
- package/dist/_chunks/message-tray-Bh-0ra-Y.js.map +0 -1
- package/dist/_chunks/multi-select-dSe6Xtc4.js.map +0 -1
- package/dist/_chunks/notification-tray-Cnum6LwM.js.map +0 -1
- package/dist/_chunks/phone-input-DKSHX7NQ.js.map +0 -1
- package/dist/_chunks/progress-B-PSO5OS.js.map +0 -1
- package/dist/_chunks/public-footer.agent-Bc99tE5Z.js.map +0 -1
- package/dist/_chunks/recaptcha-widget-BtBNb6tB.js +0 -192
- package/dist/_chunks/recaptcha-widget-BtBNb6tB.js.map +0 -1
- package/dist/_chunks/registry-C9nwlNyL.js +0 -21
- package/dist/_chunks/registry-C9nwlNyL.js.map +0 -1
- package/dist/_chunks/resizable-COV-cnth.js.map +0 -1
- package/dist/_chunks/search-input-CIA6pPfn.js.map +0 -1
- package/dist/_chunks/signature-capture-DjMlFOzS.js.map +0 -1
- package/dist/_chunks/stepper-progress-jFY8BSf7.js.map +0 -1
- package/dist/_chunks/streaming-text-BgjCTVOw.js +0 -105
- package/dist/_chunks/streaming-text-BgjCTVOw.js.map +0 -1
- package/dist/_chunks/text-area-D5GAe8pV.js.map +0 -1
- package/dist/_chunks/tooltip-ClJd0ciy.js.map +0 -1
- package/dist/_chunks/transaction-chip-z9ENE50O.js.map +0 -1
- package/dist/_chunks/transcript-panel-QUQ9XJmf.js.map +0 -1
- package/dist/_chunks/use-direction-D6rvvG9G.js.map +0 -1
- package/dist/_chunks/use-scroll-to-first-error-BrK7dKB_.js +0 -55
- package/dist/_chunks/use-scroll-to-first-error-BrK7dKB_.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-ClJd0ciy.js","sources":["../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { type ReactElement, useRef, useEffect, useState } from 'react';\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { cva } from 'class-variance-authority';\n\n/* ------------------------------------------------------------------ */\n/* useDirection — reads the closest [dir] ancestor at render time */\n/* ------------------------------------------------------------------ */\n\nfunction useDirection(ref: React.RefObject<HTMLElement | null>): 'ltr' | 'rtl' {\n const [dir, setDir] = useState<'ltr' | 'rtl'>(() => {\n if (typeof document === 'undefined') return 'ltr';\n return (document.documentElement.dir as 'ltr' | 'rtl') || 'ltr';\n });\n\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const closest = el.closest('[dir]');\n const resolved =\n closest?.getAttribute('dir') ?? document.documentElement.dir ?? 'ltr';\n setDir(resolved === 'rtl' ? 'rtl' : 'ltr');\n }, [ref]);\n\n return dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA — tooltip content */\n/* ------------------------------------------------------------------ */\n\nconst tooltipContentVariants = cva(\n [\n 'ds:z-[var(--z-tooltip)]',\n 'ds:max-w-[240px]',\n 'ds:overflow-hidden ds:rounded-[var(--radius-sm)]',\n // High-contrast solid tooltip surface — inverted vs the page so it\n // reads against any background (gradient washes, coloured cards,\n // images). The `[var(...)]` syntax is the same one every other\n // floating surface in the kit uses; the previous `bg-foreground` /\n // `text-background` shorthand was emitting transparent backgrounds\n // in some consumer bundles where the Tailwind theme inline wasn't\n // resolving the named utility. See 0.30.3 follow-up issue 4b.\n 'ds:bg-[var(--foreground)] ds:text-[var(--background)]',\n 'ds:shadow-[var(--shadow-md)]',\n // Forced-colours users (Windows High Contrast) lose `bg-/text-`\n // entirely — emit a CanvasText border so the tooltip is still\n // visible.\n 'ds:forced-colors:[outline:1px_solid_CanvasText]',\n 'ds:ps-3 ds:pe-3 ds:py-1.5 type-meta',\n 'ds:break-normal ds:[overflow-wrap:anywhere]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=left]:slide-in-from-right-2',\n 'ds:data-[side=right]:slide-in-from-left-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Logical → physical side mapping */\n/* ------------------------------------------------------------------ */\n\ntype LogicalSide = 'top' | 'end' | 'bottom' | 'start';\ntype PhysicalSide = 'top' | 'right' | 'bottom' | 'left';\n\nfunction resolvePhysicalSide(\n logical: LogicalSide,\n dir: 'ltr' | 'rtl',\n): PhysicalSide {\n switch (logical) {\n case 'top':\n return 'top';\n case 'bottom':\n return 'bottom';\n case 'start':\n return dir === 'rtl' ? 'right' : 'left';\n case 'end':\n return dir === 'rtl' ? 'left' : 'right';\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* TooltipProvider */\n/* ------------------------------------------------------------------ */\n\nexport interface TooltipProviderProps {\n children: React.ReactNode;\n /** Open delay in ms. Default 700. */\n delayDuration?: number;\n /** Skip delay when moving between triggers. Default 300. */\n skipDelayDuration?: number;\n}\n\nexport const TooltipProvider: React.FC<TooltipProviderProps> = ({\n children,\n delayDuration = 700,\n skipDelayDuration = 300,\n}) => (\n <RadixTooltip.Provider\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n >\n {children}\n </RadixTooltip.Provider>\n);\n\nTooltipProvider.displayName = 'TooltipProvider';\n\n/* ------------------------------------------------------------------ */\n/* Tooltip */\n/* ------------------------------------------------------------------ */\n\nexport interface TooltipProps {\n /** The tooltip text — required. */\n label: string;\n /** The trigger element. */\n children: ReactElement;\n /** Logical side. Default 'top'. Mapped to Radix physical side based on dir. */\n side?: LogicalSide;\n /** Alignment along the side axis. Default 'center'. */\n align?: 'start' | 'center' | 'end';\n /** Gap between trigger and tooltip. Default 4. */\n sideOffset?: number;\n /** Open delay override for this instance. */\n delayDuration?: number;\n /** Controlled open state. */\n open?: boolean;\n /** Callback when open state changes. */\n onOpenChange?: (open: boolean) => void;\n}\n\nexport const Tooltip: React.FC<TooltipProps> = ({\n label,\n children,\n side = 'top',\n align = 'center',\n sideOffset = 4,\n delayDuration,\n open,\n onOpenChange,\n}) => {\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const dir = useDirection(triggerRef as React.RefObject<HTMLElement | null>);\n const physicalSide = resolvePhysicalSide(side, dir);\n\n return (\n <RadixTooltip.Root\n delayDuration={delayDuration}\n open={open}\n onOpenChange={onOpenChange}\n >\n <RadixTooltip.Trigger asChild ref={triggerRef}>\n {children}\n </RadixTooltip.Trigger>\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n className={tooltipContentVariants()}\n side={physicalSide}\n align={align}\n sideOffset={sideOffset}\n data-component=\"tooltip\"\n >\n {label}\n <RadixTooltip.Arrow className=\"ds:fill-foreground\" />\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n </RadixTooltip.Root>\n );\n};\n\nTooltip.displayName = 'Tooltip';\n"],"names":["useDirection","ref","dir","setDir","useState","useEffect","el","closest","resolved","tooltipContentVariants","cva","resolvePhysicalSide","logical","TooltipProvider","children","delayDuration","skipDelayDuration","jsx","RadixTooltip","Tooltip","label","side","align","sideOffset","open","onOpenChange","triggerRef","useRef","physicalSide","jsxs"],"mappings":";;;;AAQA,SAASA,EAAaC,GAAyD;AAC7E,QAAM,CAACC,GAAKC,CAAM,IAAIC,EAAwB,MACxC,OAAO,WAAa,MAAoB,QACpC,SAAS,gBAAgB,OAAyB,KAC3D;AAED,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAKL,EAAI;AACf,QAAI,CAACK,EAAI;AACT,UAAMC,IAAUD,EAAG,QAAQ,OAAO,GAC5BE,KACJD,KAAA,gBAAAA,EAAS,aAAa,WAAU,SAAS,gBAAgB,OAAO;AAClE,IAAAJ,EAAOK,MAAa,QAAQ,QAAQ,KAAK;AAAA,EAC3C,GAAG,CAACP,CAAG,CAAC,GAEDC;AACT;AAMA,MAAMO,IAAyBC;AAAA,EAC7B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AACZ;AASA,SAASC,EACPC,GACAV,GACc;AACd,UAAQU,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAOV,MAAQ,QAAQ,UAAU;AAAA,IACnC,KAAK;AACH,aAAOA,MAAQ,QAAQ,SAA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9ENE50O.js","sources":["../../node_modules/lucide-react/dist/esm/icons/arrow-down-left.js","../../node_modules/lucide-react/dist/esm/icons/arrow-up-right.js","../../node_modules/lucide-react/dist/esm/icons/calendar-clock.js","../../src/components/transaction-chip/transaction-chip.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M17 7 7 17\", key: \"15tmo1\" }],\n [\"path\", { d: \"M17 17H7V7\", key: \"1org7z\" }]\n];\nconst ArrowDownLeft = createLucideIcon(\"arrow-down-left\", __iconNode);\n\nexport { __iconNode, ArrowDownLeft as default };\n//# sourceMappingURL=arrow-down-left.js.map\n","/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M7 7h10v10\", key: \"1tivn9\" }],\n [\"path\", { d: \"M7 17 17 7\", key: \"1vkiza\" }]\n];\nconst ArrowUpRight = createLucideIcon(\"arrow-up-right\", __iconNode);\n\nexport { __iconNode, ArrowUpRight as default };\n//# sourceMappingURL=arrow-up-right.js.map\n","/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M16 14v2.2l1.6 1\", key: \"fo4ql5\" }],\n [\"path\", { d: \"M16 2v4\", key: \"4m81vk\" }],\n [\"path\", { d: \"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5\", key: \"1osxxc\" }],\n [\"path\", { d: \"M3 10h5\", key: \"r794hk\" }],\n [\"path\", { d: \"M8 2v4\", key: \"1cmpym\" }],\n [\"circle\", { cx: \"16\", cy: \"16\", r: \"6\", key: \"qoo3c4\" }]\n];\nconst CalendarClock = createLucideIcon(\"calendar-clock\", __iconNode);\n\nexport { __iconNode, CalendarClock as default };\n//# sourceMappingURL=calendar-clock.js.map\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n ArrowDownLeft,\n ArrowUpRight,\n CalendarClock,\n Check,\n FileText,\n type LucideIcon,\n} from 'lucide-react';\n\n/* ------------------------------------------------------------------ */\n/* State vocabulary */\n/* ------------------------------------------------------------------ */\n\nexport type TransactionState =\n | 'debt'\n | 'credit'\n | 'to-invoice'\n | 'to-deliver'\n | 'settled';\n\n// State → translation-key segment. Hyphenated state names are flattened to\n// camelCase so the i18next bundle stays consistent with the rest of `ui.*`.\nconst STATE_KEY: Record<TransactionState, string> = {\n debt: 'debt',\n credit: 'credit',\n 'to-invoice': 'toInvoice',\n 'to-deliver': 'toDeliver',\n settled: 'settled',\n};\n\nconst STATE_ICON: Record<TransactionState, LucideIcon> = {\n debt: ArrowDownLeft,\n credit: ArrowUpRight,\n 'to-invoice': FileText,\n 'to-deliver': CalendarClock,\n settled: Check,\n};\n\n// U+2212 MINUS SIGN — matches PR alfadocs/platform#523's typographic minus.\n// Hyphen-minus would render visually narrower next to the currency glyph.\nconst STATE_SIGN: Record<TransactionState, '' | '+' | '−'> = {\n debt: '−',\n credit: '+',\n 'to-invoice': '',\n 'to-deliver': '',\n settled: '',\n};\n\n// Multiplier used when composing the screen-reader announcement so SR users\n// hear the signed amount Intl produces (\"minus one thousand…\") rather than\n// the magnitude plus a separate sign glyph.\nconst SIGN_MULTIPLIER: Record<TransactionState, -1 | 1> = {\n debt: -1,\n credit: 1,\n 'to-invoice': 1,\n 'to-deliver': 1,\n settled: 1,\n};\n\nconst DEFAULT_CURRENCY = 'EUR';\n\n/* ------------------------------------------------------------------ */\n/* CVA — chip root */\n/* ------------------------------------------------------------------ */\n\nconst chipVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-full)] ds:border',\n 'ds:whitespace-nowrap ds:align-middle',\n 'ds:focus-visible:outline-none',\n 'ds:focus-visible:ring-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:ring-[color:var(--ring)]',\n 'ds:focus-visible:ring-offset-[length:var(--focus-ring-offset)]',\n ].join(' '),\n {\n variants: {\n state: {\n // Text uses the deeper `*-foreground` token (matching Badge / Tag) so\n // small chip text clears WCAG AA (4.5:1) against the 10% tinted\n // background. The surface and border use the lighter alias.\n debt: 'ds:bg-destructive/10 ds:text-[color:var(--error-foreground)] ds:border-destructive/20',\n credit:\n 'ds:bg-success/10 ds:text-[color:var(--success-foreground)] ds:border-success/20',\n // The orange \"to-invoice\" tint has no kit-wide semantic alias — see\n // src/tokens/index.css §Transaction-chip-scoped tokens. The component\n // owns the alias because the customer-anchored \"Da fatturare\" orange\n // is distinct from `--warning` (yellow) and from `--destructive`.\n 'to-invoice':\n 'ds:bg-transaction-chip-to-invoice/10 ds:text-[color:var(--transaction-chip-to-invoice-foreground)] ds:border-transaction-chip-to-invoice/20',\n 'to-deliver':\n 'ds:bg-info/10 ds:text-[color:var(--info-foreground)] ds:border-info/20',\n settled: 'ds:bg-muted/30 ds:text-muted-foreground ds:border-muted/40',\n },\n size: {\n // Heights tuned for table-cell density (sm), default app surfaces (md),\n // and header / summary cards (lg). `--type-eyebrow-size` flows into the\n // optional label span, keeping its typography in step with the chip.\n sm: 'ds:h-5 ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-2xs)] ds:[--type-eyebrow-size:var(--font-size-2xs)]',\n md: 'ds:h-6 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-xs)] ds:[--type-eyebrow-size:var(--font-size-2xs)]',\n lg: 'ds:h-7 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-sm)] ds:[--type-eyebrow-size:var(--font-size-xs)]',\n },\n bold: {\n // `settled` is the terminal resting state — see compound variant below.\n true: 'ds:font-semibold',\n false: 'ds:font-medium',\n },\n },\n defaultVariants: {\n state: 'debt',\n size: 'md',\n bold: true,\n },\n compoundVariants: [\n // `settled` always renders at the lighter weight, regardless of the\n // resolved default. Mirrors PR #523's follow-up where the resting branch\n // dropped from bold to medium to recede visually.\n { state: 'settled', class: 'ds:font-medium' },\n ],\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* CVA — icon wrapper */\n/* ------------------------------------------------------------------ */\n\n// `ArrowDownLeft` (debt) and `ArrowUpRight` (credit) are direction-encoded\n// glyphs — their physical orientation carries the semantic (\"money coming\n// in\" / \"money going out\"). PRS §05 RTL: directional icons flip in RTL.\n// The non-directional glyphs (FileText, CalendarClock, Check) are unaffected.\nconst iconWrapperVariants = cva(\n 'ds:shrink-0 ds:[&>svg]:block ds:rtl:[&>svg]:-scale-x-100',\n {\n variants: {\n size: {\n sm: 'ds:[&>svg]:size-3',\n md: 'ds:[&>svg]:size-3.5',\n lg: 'ds:[&>svg]:size-4',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface TransactionChipProps\n extends\n Omit<HTMLAttributes<HTMLSpanElement>, 'children'>,\n Pick<VariantProps<typeof chipVariants>, 'size'> {\n /** Financial state — drives colour, icon, sign, and label. */\n state: TransactionState;\n /**\n * Magnitude of the amount as a non-negative number. The sign is rendered\n * separately based on `state` — callers must never pass a negative value.\n */\n amount: number;\n /**\n * ISO 4217 currency code. Defaults to `EUR` for the Italian-anchored\n * release. Required at the type level so consumers can't silently render\n * a different currency than they intended.\n */\n currency?: string;\n /** BCP 47 locale override. Defaults to the active i18next language. */\n locale?: string;\n /** Render the state label (e.g. \"Da incassare\") before the amount. */\n showLabel?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const TransactionChip = forwardRef<\n HTMLSpanElement,\n TransactionChipProps\n>(\n (\n {\n state,\n amount,\n currency = DEFAULT_CURRENCY,\n locale,\n size = 'md',\n showLabel = false,\n className,\n 'aria-label': ariaLabelProp,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n const StateIcon = STATE_ICON[state];\n const sign = STATE_SIGN[state];\n const magnitude = Math.abs(amount);\n\n // The visible amount is rendered without a sign; the leading sign glyph\n // (or its absence) is owned by the state, not the formatter.\n const formattedAmount = new Intl.NumberFormat(activeLocale, {\n style: 'currency',\n currency,\n signDisplay: 'never',\n }).format(magnitude);\n\n // The accessible name uses Intl's own signed output so screen readers\n // announce the locale-correct \"minus\" / \"negative\" phrasing instead of\n // skipping the U+2212 glyph or speaking it as \"hyphen\".\n const stateLabel = t(`financial.state.${STATE_KEY[state]}`);\n const signedAmountForSR = new Intl.NumberFormat(activeLocale, {\n style: 'currency',\n currency,\n signDisplay: state === 'debt' ? 'always' : 'auto',\n }).format(magnitude * SIGN_MULTIPLIER[state]);\n const ariaLabel =\n ariaLabelProp ??\n t('financial.aria.label', {\n state: stateLabel,\n amount: signedAmountForSR,\n });\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n data-component=\"transaction-chip\"\n data-state={state}\n className={chipVariants({\n state,\n size,\n bold: state !== 'settled',\n className,\n })}\n {...rest}\n >\n <span aria-hidden=\"true\" className={iconWrapperVariants({ size })}>\n <StateIcon />\n </span>\n {showLabel && (\n <span aria-hidden=\"true\" className=\"type-eyebrow\">\n {stateLabel}\n </span>\n )}\n {sign && (\n <span\n aria-hidden=\"true\"\n className=\"ds:[font-variant-numeric:var(--font-feature-tabular)]\"\n >\n {sign}\n </span>\n )}\n <span\n aria-hidden=\"true\"\n className=\"ds:[font-variant-numeric:var(--font-feature-tabular)]\"\n >\n {formattedAmount}\n </span>\n </span>\n );\n },\n);\n\nTransactionChip.displayName = 'TransactionChip';\n"],"names":["__iconNode","ArrowDownLeft","createLucideIcon","ArrowUpRight","CalendarClock","STATE_KEY","STATE_ICON","FileText","Check","STATE_SIGN","SIGN_MULTIPLIER","DEFAULT_CURRENCY","chipVariants","cva","iconWrapperVariants","TransactionChip","forwardRef","state","amount","currency","locale","size","showLabel","className","ariaLabelProp","rest","ref","t","i18n","useTranslation","activeLocale","StateIcon","sign","magnitude","formattedAmount","stateLabel","signedAmountForSR","ariaLabel","jsxs","jsx"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,IAAgBC,EAAiB,mBAAmBF,CAAU;ACbpE;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMG,IAAeD,EAAiB,kBAAkBF,CAAU;ACblE;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,oBAAoB,KAAK,SAAQ,CAAE;AAAA,EACjD,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,gEAAgE,KAAK,SAAQ,CAAE;AAAA,EAC7F,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,UAAU,KAAK,SAAQ,CAAE;AAAA,EACvC,CAAC,UAAU,EAAE,IAAI,MA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,QACZ,WAAWL,EAAa;AAAA,UACtB,OAAAK;AAAA,UACA,MAAAI;AAAA,UACA,MAAMJ,MAAU;AAAA,UAChB,WAAAM;AAAA,QAAA,CACD;AAAA,QACA,GAAGE;AAAA,QAEJ,UAAA;AAAA,UAAA,gBAAAc,EAAC,QAAA,EAAK,eAAY,QAAO,WAAWzB,EAAoB,EAAE,MAAAO,EAAA,CAAM,GAC9D,UAAA,gBAAAkB,EAACR,GAAA,CAAA,CAAU,EAAA,CACb;AAAA,UACCT,KACC,gBAAAiB,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,gBAChC,UAAAJ,GACH;AAAA,UAEDH,KACC,gBAAAO;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,cAET,UAAAP;AAAA,YAAA;AAAA,UAAA;AAAA,UAGL,gBAAAO;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,cAET,UAAAL;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAnB,EAAgB,cAAc;","x_google_ignoreList":[0,1,2]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transcript-panel-QUQ9XJmf.js","sources":["../../src/components/transcript-panel/transcript-panel.agent.ts","../../src/components/transcript-panel/transcript-panel.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — TranscriptPanel. */\n/* */\n/* `data-turn-id` carries the line's stable index (opaque id) — never */\n/* the dictated text. Transcript content frequently contains PHI; the */\n/* DOM hook MUST NOT leak it. See PRS §26 §6.1. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { TranscriptPanelHandle } from './transcript-panel';\n\nexport const transcriptPanelAgent: AgentAdapter<TranscriptPanelHandle> = {\n id: 'transcript-panel',\n capabilities: ['select_single'],\n state: {\n selectedTurn: {\n type: 'string | null',\n descriptionKey: 'ui.agent.transcriptPanel.state.selectedTurn',\n description:\n 'Opaque id (line index) of the currently-active turn, or null when none is active.',\n read: (handle) => handle.getSelectedTurn(),\n },\n },\n actions: {\n focus_turn: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.agent.transcriptPanel.actions.focusTurn',\n description: 'Scroll the given turn into view and focus its seek button.',\n invoke: (handle, args: { id: string }) => {\n handle.focusTurn(args.id);\n },\n },\n copy_turn: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.agent.transcriptPanel.actions.copyTurn',\n description: \"Copy the given turn's text to the clipboard.\",\n invoke: (handle, args: { id: string }) => handle.copyTurn(args.id),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'transcript-panel',\n description: 'Marks the TranscriptPanel wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-turn-id',\n description:\n \"Stable opaque turn id (line index). Never carries the turn's dictated text.\",\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useCallback,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { transcriptPanelAgent } from './transcript-panel.agent';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { SearchInput } from '../search-input';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface TranscriptLine {\n speaker: string;\n text: string;\n /** Seconds, floating-point — matches HTMLMediaElement.currentTime. */\n start: number;\n end: number;\n /** 0..1 — rendered with a dotted underline when below 0.6. */\n confidence?: number;\n}\n\n/** Curated imperative handle for agent / external automation. */\nexport interface TranscriptPanelHandle {\n /** Opaque id (line index) of the active turn, or null. */\n getSelectedTurn: () => string | null;\n /** Scroll the turn with the given id into view and focus its seek button. */\n focusTurn: (id: string) => void;\n /** Copy the turn's text to the clipboard. */\n copyTurn: (id: string) => Promise<void> | void;\n}\n\nexport interface TranscriptPanelProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof rootVariants> {\n lines: TranscriptLine[];\n /** Current playback time in seconds — drives the active line highlight. */\n currentTime?: number;\n onSeek?: (seconds: number) => void;\n /** Show the search bar. */\n searchable?: boolean;\n}\n\nconst rootVariants = cva(\n [\n 'ds:flex ds:flex-col ds:w-full ds:min-h-0',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-background',\n 'ds:focus-within:border-[color:var(--primary)]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst VIRTUALIZATION_THRESHOLD = 100;\nconst SPEAKER_SLOT_COUNT = 8;\n\nfunction formatTime(seconds: number, locale: string): string {\n const total = Math.max(0, Math.floor(seconds));\n const m = Math.floor(total / 60);\n const s = total % 60;\n const fmt = (n: number) =>\n new Intl.NumberFormat(locale, { minimumIntegerDigits: 2 }).format(n);\n return `${fmt(m)}:${fmt(s)}`;\n}\n\n/** ISO-8601 duration (PT#M#S) for <time datetime=\"...\">. */\nfunction secondsToIsoDuration(seconds: number): string {\n const total = Math.max(0, Math.floor(seconds));\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `PT${m}M${s}S`;\n}\n\n/** Deterministic speaker slot (0..7) based on name hash. */\nfunction speakerSlot(name: string): number {\n let hash = 0;\n for (let i = 0; i < name.length; i += 1) {\n hash = (hash * 31 + name.charCodeAt(i)) | 0;\n }\n return Math.abs(hash) % SPEAKER_SLOT_COUNT;\n}\n\n/** Per-slot background classes. Indices align with the speaker palette tokens\n * in tokens/index.css. Static strings so Tailwind can pick them up at build. */\nconst SPEAKER_BG_CLASSES = [\n 'ds:bg-[color:var(--transcript-speaker-1)]',\n 'ds:bg-[color:var(--transcript-speaker-2)]',\n 'ds:bg-[color:var(--transcript-speaker-3)]',\n 'ds:bg-[color:var(--transcript-speaker-4)]',\n 'ds:bg-[color:var(--transcript-speaker-5)]',\n 'ds:bg-[color:var(--transcript-speaker-6)]',\n 'ds:bg-[color:var(--transcript-speaker-7)]',\n 'ds:bg-[color:var(--transcript-speaker-8)]',\n] as const;\n\n/** Escape a literal string for safe use inside a RegExp. */\nfunction escapeRegExp(input: string): string {\n return input.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\ninterface HighlightedTextProps {\n text: string;\n query: string;\n}\n\n/** Renders text with <mark> wrapping around case-insensitive matches.\n * No dangerouslySetInnerHTML — splits text nodes only. */\nfunction HighlightedText({ text, query }: HighlightedTextProps): ReactNode {\n if (!query) return text;\n const escaped = escapeRegExp(query);\n const parts = text.split(new RegExp(`(${escaped})`, 'gi'));\n return parts.map((part, i) =>\n part.toLocaleLowerCase() === query.toLocaleLowerCase() ? (\n <mark\n key={i}\n className=\"ds:bg-[color:var(--warning)]/30 ds:text-[color:var(--foreground)] ds:rounded-[var(--radius-sm)]\"\n >\n {part}\n </mark>\n ) : (\n <Fragment key={i}>{part}</Fragment>\n ),\n );\n}\n\nexport const TranscriptPanel = forwardRef<HTMLDivElement, TranscriptPanelProps>(\n (\n {\n lines,\n currentTime = 0,\n onSeek,\n searchable = true,\n size = 'md',\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const [query, setQuery] = useState('');\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const searchInputRef = useRef<HTMLInputElement | null>(null);\n const searchId = useId();\n\n /* Active-line index */\n const activeIndex = useMemo(() => {\n if (!Number.isFinite(currentTime)) return -1;\n for (let i = 0; i < lines.length; i += 1) {\n const line = lines[i];\n if (line.start <= currentTime && currentTime < line.end) return i;\n }\n return -1;\n }, [lines, currentTime]);\n\n /* Match count for search */\n const matchCount = useMemo(() => {\n if (!query) return 0;\n let count = 0;\n const needle = query.toLocaleLowerCase();\n for (const line of lines) {\n const hay = line.text.toLocaleLowerCase();\n let idx = hay.indexOf(needle);\n while (idx !== -1) {\n count += 1;\n idx = hay.indexOf(needle, idx + needle.length);\n }\n }\n return count;\n }, [lines, query]);\n\n /* Ctrl/Cmd+F shortcut — focuses the search field when focus is within. */\n const handleRootKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n if (\n (e.metaKey || e.ctrlKey) &&\n e.key.toLowerCase() === 'f' &&\n searchable\n ) {\n e.preventDefault();\n searchInputRef.current?.focus();\n }\n },\n [searchable],\n );\n\n /* Virtualisation above 100 lines */\n const virtualized = lines.length > VIRTUALIZATION_THRESHOLD;\n const virtualizer = useVirtualizer({\n count: virtualized ? lines.length : 0,\n getScrollElement: () => scrollRef.current,\n estimateSize: () => 48,\n overscan: 8,\n getItemKey: (i) => i,\n });\n\n /* Auto-scroll active line into view when it changes. */\n useLayoutEffect(() => {\n if (activeIndex < 0) return;\n const scroller = scrollRef.current;\n if (!scroller) return;\n const target = scroller.querySelector(\n `[data-line-index=\"${activeIndex}\"]`,\n ) as HTMLElement | null;\n if (!target) return;\n const prefersReducedMotion =\n typeof window !== 'undefined' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n target.scrollIntoView({\n block: 'center',\n behavior: prefersReducedMotion ? 'auto' : 'smooth',\n });\n }, [activeIndex]);\n\n const renderLine = useCallback(\n (\n line: TranscriptLine,\n index: number,\n extras?: {\n liRef?: (node: HTMLLIElement | null) => void;\n dataIndex?: number;\n // Style is an inline-style escape hatch — virtualizer offsets\n // cannot be expressed as static Tailwind. See 23-constraints §4.\n style?: CSSProperties;\n absolutePositioning?: boolean;\n },\n ) => {\n const isActive = index === activeIndex;\n const slot = speakerSlot(line.speaker);\n const lowConfidence =\n typeof line.confidence === 'number' && line.confidence < 0.6;\n return (\n <li\n key={index}\n ref={extras?.liRef}\n data-line-index={index}\n data-turn-id={String(index)}\n data-index={extras?.dataIndex}\n aria-current={isActive ? 'true' : undefined}\n // eslint-disable-next-line react/forbid-dom-props -- virtualizer translateY offset, runtime-computed\n style={extras?.style}\n className={[\n 'ds:flex ds:items-start ds:gap-[var(--spacing-sm)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n isActive\n ? 'ds:bg-[color:var(--accent)]/12 ds:border-s-[3px] ds:border-[color:var(--primary)]'\n : 'ds:border-s-[3px] ds:border-transparent',\n extras?.absolutePositioning\n ? 'ds:absolute ds:start-0 ds:end-0 ds:top-0 ds:w-full'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <button\n type=\"button\"\n onClick={() => onSeek?.(line.start)}\n aria-label={t('chat.transcript.seekTo', {\n time: formatTime(line.start, i18n.language),\n })}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:font-[family-name:var(--font-mono)]',\n 'type-meta',\n 'ds:tabular-nums',\n 'ds:text-[color:var(--muted-foreground)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]',\n // WCAG 2.5.5 target size: 44×44 default, 48×48 in accessible\n // themes — matches the DS `--min-target-size` token.\n 'ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]',\n 'ds:hover:bg-muted/20',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n >\n <time dir=\"ltr\" dateTime={secondsToIsoDuration(line.start)}>\n {formatTime(line.start, i18n.language)}\n </time>\n </button>\n <div className=\"ds:flex-1 ds:min-w-0\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className={`ds:inline-block ds:size-2 ds:rounded-[var(--radius-full)] ${SPEAKER_BG_CLASSES[slot]}`}\n />\n <strong className=\"type-title-item\">\n {t('chat.transcript.speaker', { name: line.speaker })}\n </strong>\n {lowConfidence ? (\n <span className=\"type-meta ds:italic ds:text-[color:var(--muted-foreground)]\">\n ({t('chat.transcript.lowConfidence')})\n </span>\n ) : null}\n </div>\n <span\n dir=\"auto\"\n className={[\n 'ds:block',\n lowConfidence\n ? 'ds:underline ds:decoration-dotted ds:decoration-[color:var(--muted-foreground)]'\n : '',\n ].join(' ')}\n >\n <HighlightedText text={line.text} query={query} />\n </span>\n </div>\n </li>\n );\n },\n [activeIndex, i18n.language, onSeek, query, t],\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n\n const agentHandle = useMemo<TranscriptPanelHandle>(\n () => ({\n getSelectedTurn: () => (activeIndex >= 0 ? String(activeIndex) : null),\n focusTurn: (id: string) => {\n const target = scrollRef.current?.querySelector(\n `[data-turn-id=\"${id}\"]`,\n ) as HTMLElement | null;\n if (!target) return;\n target.scrollIntoView({ block: 'center', behavior: 'auto' });\n const btn = target.querySelector(\n 'button',\n ) as HTMLButtonElement | null;\n btn?.focus();\n },\n copyTurn: (id: string) => {\n const index = Number.parseInt(id, 10);\n if (!Number.isFinite(index)) return;\n const line = lines[index];\n if (!line) return;\n if (typeof navigator !== 'undefined' && navigator.clipboard) {\n return navigator.clipboard.writeText(line.text);\n }\n },\n }),\n [activeIndex, lines],\n );\n useAgentRegistration(\n transcriptPanelAgent,\n agentHandle,\n rest.id as string | undefined,\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- root keyboard shortcuts (j/k navigation, /) bubble up from focused descendants\n <div\n ref={rootRef}\n onKeyDown={handleRootKeyDown}\n data-component=\"transcript-panel\"\n data-component-id={rest.id}\n className={rootVariants({ size, className })}\n {...rest}\n >\n {searchable ? (\n <div className=\"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)] ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:border-b ds:border-border\">\n <SearchInput\n ref={searchInputRef}\n id={searchId}\n placeholder={t('chat.transcript.search')}\n aria-label={t('chat.transcript.search')}\n aria-keyshortcuts=\"Meta+F Control+F\"\n debounceMs={150}\n onChange={(v) => setQuery(v)}\n size=\"sm\"\n />\n {query ? (\n <span\n role=\"status\"\n aria-live=\"polite\"\n className=\"type-meta ds:text-[color:var(--muted-foreground)] ds:tabular-nums\"\n >\n {matchCount === 0\n ? t('chat.transcript.noMatches')\n : t('chat.transcript.matchCount', { count: matchCount })}\n </span>\n ) : null}\n </div>\n ) : null}\n\n <div\n ref={scrollRef}\n className=\"ds:flex-1 ds:min-h-0 ds:overflow-y-auto ds:overflow-x-hidden\"\n >\n {virtualized ? (\n <ol\n className=\"ds:relative ds:list-none ds:ps-0 ds:m-0\"\n // eslint-disable-next-line react/forbid-dom-props -- virtualizer total size, runtime-computed\n style={{ blockSize: `${virtualizer.getTotalSize()}px` }}\n >\n {virtualizer.getVirtualItems().map((vi) => {\n const line = lines[vi.index];\n if (!line) return null;\n // Put the measureElement ref on the <li> directly — a <div>\n // child of <ol> is invalid and breaks list semantics for\n // assistive tech.\n return renderLine(line, vi.index, {\n liRef: virtualizer.measureElement,\n dataIndex: vi.index,\n style: { transform: `translateY(${vi.start}px)` },\n absolutePositioning: true,\n });\n })}\n </ol>\n ) : (\n <ol className=\"ds:list-none ds:ps-0 ds:m-0\">\n {lines.map((line, index) => renderLine(line, index))}\n </ol>\n )}\n </div>\n </div>\n );\n },\n);\n\nTranscriptPanel.displayName = 'TranscriptPanel';\n"],"names":["transcriptPanelAgent","handle","args","rootVariants","cva","VIRTUALIZATION_THRESHOLD","SPEAKER_SLOT_COUNT","formatTime","seconds","locale","total","m","s","fmt","n","secondsToIsoDuration","speakerSlot","name","hash","i","SPEAKER_BG_CLASSES","escapeRegExp","input","HighlightedText","text","query","escaped","part","jsx","Fragment","TranscriptPanel","forwardRef","lines","currentTime","onSeek","searchable","size","className","rest","ref","t","i18n","useTranslation","setQuery","useState","scrollRef","useRef","searchInputRef","searchId","useId","activeIndex","useMemo","line","matchCount","count","needle","hay","idx","handleRootKeyDown","useCallback","_a","virtualized","virtualizer","useVirtualizer","useLayoutEffect","scroller","target","prefersReducedMotion","renderLine","index","extras","isActive","slot","lowConfidence","jsxs","rootRef","useImperativeHandle","agentHandle","id","btn","useAgentRegistration","SearchInput","v","vi"],"mappings":";;;;;;;AAWO,MAAMA,IAA4D;AAAA,EACvE,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe;AAAA,EAC9B,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,gBAAA;AAAA,IAAgB;AAAA,EAC3C;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,UAAUC,EAAK,EAAE;AAAA,MAC1B;AAAA,IAAA;AAAA,IAEF,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,GAAQC,MAAyBD,EAAO,SAASC,EAAK,EAAE;AAAA,IAAA;AAAA,EACnE;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAA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IACC,gBAAAG;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAU;AAAA,gBACV,WAAU;AAAA,gBAET,UAAAyB,MAAe,IACZb,EAAE,2BAA2B,IAC7BA,EAAE,8BAA8B,EAAE,OAAOa,EAAA,CAAY;AAAA,cAAA;AAAA,YAAA,IAEzD;AAAA,UAAA,EAAA,CACN,IACE;AAAA,UAEJ,gBAAAzB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAKiB;AAAA,cACL,WAAU;AAAA,cAET,UAAAgB,IACC,gBAAAjC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBAEV,OAAO,EAAE,WAAW,GAAGkC,EAAY,aAAA,CAAc,KAAA;AAAA,kBAEhD,UAAAA,EAAY,gBAAA,EAAkB,IAAI,CAACqB,MAAO;AACzC,0BAAM/B,IAAOpB,EAAMmD,EAAG,KAAK;AAC3B,2BAAK/B,IAIEgB,EAAWhB,GAAM+B,EAAG,OAAO;AAAA,sBAChC,OAAOrB,EAAY;AAAA,sBACnB,WAAWqB,EAAG;AAAA,sBACd,OAAO,EAAE,WAAW,cAAcA,EAAG,KAAK,MAAA;AAAA,sBAC1C,qBAAqB;AAAA,oBAAA,CACtB,IATiB;AAAA,kBAUpB,CAAC;AAAA,gBAAA;AAAA,cAAA,IAGH,gBAAAvD,EAAC,MAAA,EAAG,WAAU,+BACX,UAAAI,EAAM,IAAI,CAACoB,GAAMiB,MAAUD,EAAWhB,GAAMiB,CAAK,CAAC,EAAA,CACrD;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAvC,GAAgB,cAAc;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-direction-D6rvvG9G.js","sources":["../../src/hooks/use-direction.ts"],"sourcesContent":["import { useLayoutEffect, useState, type RefObject } from 'react';\n\nexport type Direction = 'ltr' | 'rtl';\n\nconst initialDocumentDir = (): Direction => {\n if (typeof document === 'undefined') return 'ltr';\n return document.documentElement.getAttribute('dir') === 'rtl' ? 'rtl' : 'ltr';\n};\n\n/**\n * Resolves the effective writing direction for `ref`'s element by walking its\n * ancestor chain and reacting to `dir` attribute mutations along the way.\n *\n * Radix primitives default to `dir=\"ltr\"` when no `DirectionProvider` is\n * present and then stamp `dir=\"ltr\"` onto the rendered element — which\n * overrides any inherited `dir=\"rtl\"` from a parent. Pass the result of this\n * hook to the primitive's `dir` prop so the logical layout flips correctly.\n */\nexport function useDirection(ref: RefObject<HTMLElement | null>): Direction {\n const [dir, setDir] = useState<Direction>(initialDocumentDir);\n\n useLayoutEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n // Read from the parent so Radix's own `dir=\"ltr\"` stamp on `element`\n // (which overrides the inherited direction) doesn't feed back into us.\n const source = element.parentElement ?? element;\n\n const read = () => {\n const computed = window.getComputedStyle(source).direction;\n setDir(computed === 'rtl' ? 'rtl' : 'ltr');\n };\n\n read();\n\n const observer = new MutationObserver(read);\n let node: Element | null = source;\n while (node) {\n observer.observe(node, { attributes: true, attributeFilter: ['dir'] });\n node = node.parentElement;\n }\n\n return () => observer.disconnect();\n }, [ref]);\n\n return dir;\n}\n\n/**\n * Resolves the document-level writing direction. Use for components whose\n * Root is a pure context provider (no DOM element to ref) — e.g. Radix\n * DropdownMenu/ContextMenu/Menubar Roots.\n */\nexport function useDocumentDirection(): Direction {\n const [dir, setDir] = useState<Direction>(initialDocumentDir);\n\n useLayoutEffect(() => {\n if (typeof document === 'undefined') return;\n const read = () => {\n const value = document.documentElement.getAttribute('dir');\n setDir(value === 'rtl' ? 'rtl' : 'ltr');\n };\n read();\n const observer = new MutationObserver(read);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n });\n return () => observer.disconnect();\n }, []);\n\n return dir;\n}\n"],"names":["initialDocumentDir","useDirection","ref","dir","setDir","useState","useLayoutEffect","element","source","read","computed","observer","node","useDocument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
|
|
|
1
|
-
import { useState as h, useEffect as w, useRef as m } from "react";
|
|
2
|
-
function v(e) {
|
|
3
|
-
const [i, r] = h(() => typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(e).matches);
|
|
4
|
-
return w(() => {
|
|
5
|
-
if (typeof window > "u" || typeof window.matchMedia != "function")
|
|
6
|
-
return;
|
|
7
|
-
const n = window.matchMedia(e);
|
|
8
|
-
r(n.matches);
|
|
9
|
-
const t = (u) => r(u.matches);
|
|
10
|
-
return typeof n.addEventListener == "function" ? (n.addEventListener("change", t), () => n.removeEventListener("change", t)) : (n.addListener(t), () => n.removeListener(t));
|
|
11
|
-
}, [e]), i;
|
|
12
|
-
}
|
|
13
|
-
function p(e) {
|
|
14
|
-
return e != null && e.current ? e.current : typeof document > "u" ? null : document;
|
|
15
|
-
}
|
|
16
|
-
function S(e, i) {
|
|
17
|
-
const r = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : (
|
|
18
|
-
// SSR / jsdom fallback — drop every character that's
|
|
19
|
-
// significant in a CSS attribute selector. Conservative but
|
|
20
|
-
// robust enough for the test environment.
|
|
21
|
-
e.replace(/["'\\[\]]/g, "")
|
|
22
|
-
), n = `[data-error-anchor="${r}"], [name="${r}"], [name$="[${r}]"]`, t = Array.from(i.querySelectorAll(n));
|
|
23
|
-
return t.length === 0 ? null : t.find((f) => f.offsetParent !== null) ?? t[0];
|
|
24
|
-
}
|
|
25
|
-
function E(e, i, r = {}) {
|
|
26
|
-
const {
|
|
27
|
-
scope: n,
|
|
28
|
-
scrollOptions: t = { behavior: "smooth", block: "center" },
|
|
29
|
-
focus: u = !0,
|
|
30
|
-
skipInitialMount: f = !0
|
|
31
|
-
} = r, l = m(!0), c = m(null), o = i.find((s) => !!e[s]) ?? null;
|
|
32
|
-
w(() => {
|
|
33
|
-
if (l.current && (l.current = !1, f)) {
|
|
34
|
-
c.current = o;
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (!o) {
|
|
38
|
-
c.current = null;
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (o === c.current || typeof window > "u") return;
|
|
42
|
-
const s = window.requestAnimationFrame(() => {
|
|
43
|
-
const d = p(n);
|
|
44
|
-
if (!d) return;
|
|
45
|
-
const a = S(o, d);
|
|
46
|
-
a && (a.scrollIntoView(t), u && a.focus({ preventScroll: !0 }), c.current = o);
|
|
47
|
-
});
|
|
48
|
-
return () => window.cancelAnimationFrame(s);
|
|
49
|
-
}, [o]);
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
E as a,
|
|
53
|
-
v as u
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=use-scroll-to-first-error-BrK7dKB_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-to-first-error-BrK7dKB_.js","sources":["../../src/hooks/use-media-query.ts","../../src/hooks/use-scroll-to-first-error.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * Subscribe to an arbitrary media query and return whether it currently\n * matches. Useful for responsive components that need to branch on\n * viewport size without hand-rolling `matchMedia` plumbing.\n *\n * SSR-safe: returns `false` when `window` is undefined. The effect is\n * client-only, so hydration mismatches are avoided without a null\n * sentinel at the type level.\n *\n * Mirrors the shape of `usePrefersReducedMotion` — Safari < 14 fallback\n * via `addListener` / `removeListener` is included.\n *\n * @example\n * const isMobile = useMediaQuery('(max-width: 640px)');\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = useState<boolean>(() => {\n if (\n typeof window === 'undefined' ||\n typeof window.matchMedia !== 'function'\n ) {\n return false;\n }\n return window.matchMedia(query).matches;\n });\n\n useEffect(() => {\n if (\n typeof window === 'undefined' ||\n typeof window.matchMedia !== 'function'\n ) {\n return;\n }\n const mql = window.matchMedia(query);\n // Re-sync in case the query (or the OS state) changed between the\n // initial useState read and the first effect.\n setMatches(mql.matches);\n const onChange = (ev: MediaQueryListEvent) => setMatches(ev.matches);\n if (typeof mql.addEventListener === 'function') {\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }\n mql.addListener(onChange);\n return () => mql.removeListener(onChange);\n }, [query]);\n\n return matches;\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface UseScrollToFirstErrorOptions {\n /**\n * Limits the DOM query to this element. Useful when the page renders\n * more than one form, or when an unrelated component happens to share\n * a field name. Defaults to `document`.\n */\n scope?: RefObject<HTMLElement | null>;\n /**\n * Forwarded to `scrollIntoView`. Defaults to\n * `{ behavior: 'smooth', block: 'center' }`. Pass\n * `{ behavior: 'auto' }` (or omit `behavior`) on consumers that\n * respect `prefers-reduced-motion` upstream — the kit doesn't shadow\n * the user's motion preference inside the hook, since some consumers\n * deliberately keep a near-instant snap for power-user form flows.\n */\n scrollOptions?: ScrollIntoViewOptions;\n /**\n * Move keyboard focus to the errored field after scrolling. Default\n * `true`. The focus call uses `preventScroll: true` so the smooth\n * scroll the hook just did isn't replaced by a snap.\n *\n * Setting this `false` defeats the keyboard-user side of WCAG 3.3.1\n * — the viewport will scroll but the active element stays on the\n * submit button, forcing a Shift+Tab back into the form. Only flip\n * this off when an upstream concern (e.g. a custom error summary\n * panel that owns its own focus) is taking responsibility.\n */\n focus?: boolean;\n /**\n * On the very first render, do nothing even if `errors` already has\n * entries. Default `true`. Without this the hook would yank the\n * viewport whenever a form is hydrated with server-rendered errors\n * from a no-JS fallback path — bad UX, since the user landed on the\n * page and hasn't asked for any movement yet. Set `false` only when\n * the consumer explicitly wants the initial-mount scroll (rare).\n */\n skipInitialMount?: boolean;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\nfunction getScopeRoot(\n scope: RefObject<HTMLElement | null> | undefined,\n): ParentNode | null {\n if (scope?.current) return scope.current;\n if (typeof document === 'undefined') return null;\n return document;\n}\n\n/**\n * Resolve the DOM element to scroll/focus for a given errored field\n * name. The match order is:\n *\n * 1. `[data-error-anchor=\"<name>\"]` — the consumer's explicit hook,\n * used for Radix-based fields (Checkbox / Select / Switch) where\n * the named `<input>` is hidden behind a visible `<button>`.\n * Consumers set this on the trigger.\n * 2. `[name=\"<name>\"]` — the literal field name.\n * 3. `[name$=\"[<name>]\"]` — Symfony form-prefixed names like\n * `privacy_generator[fiscal_code]`. Suffix match keeps the hook\n * consumer-agnostic; no need to thread the form prefix through.\n *\n * Returns the first visible element among the matches. \"Visible\" here\n * means `offsetParent !== null` — that's the cheap heuristic Radix's\n * hidden inputs (display:none-equivalent positioning) fail and the\n * visible triggers pass. Falls back to the first match if every match\n * is hidden, so a field can still be scrolled into view even when the\n * trigger uses a non-standard layout.\n */\nfunction findErrorElement(name: string, root: ParentNode): HTMLElement | null {\n // `CSS.escape` is load-bearing here, not cosmetic. The Symfony\n // suffix-match arm embeds `name` inside `[name$=\"[${safe}]\"]`, so a\n // field name containing `]` would otherwise close the attribute\n // selector early and turn the rest of the string into stray\n // selector tokens. We don't expect adversarial input in practice\n // (server-controlled field names), but a server returning a `]`\n // in a 422 payload shouldn't be able to break the query.\n const safe =\n typeof CSS !== 'undefined' && typeof CSS.escape === 'function'\n ? CSS.escape(name)\n : // SSR / jsdom fallback — drop every character that's\n // significant in a CSS attribute selector. Conservative but\n // robust enough for the test environment.\n name.replace(/[\"'\\\\[\\]]/g, '');\n const selector =\n `[data-error-anchor=\"${safe}\"], ` +\n `[name=\"${safe}\"], ` +\n `[name$=\"[${safe}]\"]`;\n\n const matches = Array.from(root.querySelectorAll<HTMLElement>(selector));\n if (matches.length === 0) return null;\n\n const visible = matches.find((el) => el.offsetParent !== null);\n return visible ?? matches[0];\n}\n\n/* -------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------- */\n\n/**\n * Scrolls the first errored field into view and (by default) focuses\n * it, after `errors` changes. Backs the standard AlfaDocs rebrand\n * validation-error UX: after a 422 with `{ errors: { field: message } }`\n * is rendered inline, the user shouldn't be left staring at red labels\n * they can't see. Implements WCAG 3.3.1 / 3.3.3.\n *\n * The hook is stateless and never mutates the DOM beyond the\n * `scrollIntoView` + `focus` calls.\n *\n * @example\n * const fieldOrder = ['firstName', 'email', 'fiscalCode'] as const;\n * const [errors, setErrors] = useState<Record<string, string>>({});\n * useScrollToFirstError(errors, fieldOrder);\n *\n * @example Radix-based field\n * <Checkbox data-error-anchor=\"consent\" name=\"consent\" />\n * // hook scrolls to the visible <button>, not Radix's hidden input.\n *\n * @example Scoped to one form\n * const formRef = useRef<HTMLFormElement>(null);\n * useScrollToFirstError(errors, fieldOrder, { scope: formRef });\n */\nexport function useScrollToFirstError(\n errors: Readonly<Record<string, string | undefined>>,\n fieldOrder: ReadonlyArray<string>,\n options: UseScrollToFirstErrorOptions = {},\n): void {\n const {\n scope,\n scrollOptions = { behavior: 'smooth', block: 'center' },\n focus = true,\n skipInitialMount = true,\n } = options;\n\n const isInitialMount = useRef(true);\n\n // Track the previous \"first errored field name\" so a re-render that\n // leaves the same field errored doesn't re-scroll. We intentionally\n // depend on the resolved name (not the whole errors object) — that\n // way callers can mutate `errors` shape freely as long as the head\n // of the validation list is stable, which is the typical pattern\n // after a server returns the same 422 twice in a row.\n const lastScrolledFieldRef = useRef<string | null>(null);\n\n // Resolve the first errored field by visual order. A field is\n // \"errored\" iff its key has a truthy string value — the kit's form\n // contract is `Record<string, string | undefined>` where `undefined`\n // / missing keys mean \"no error\".\n const firstErroredField =\n fieldOrder.find((name) => Boolean(errors[name])) ?? null;\n\n useEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n if (skipInitialMount) {\n // Record what we skipped so the next render doesn't try to\n // scroll to a field that was already errored at mount.\n lastScrolledFieldRef.current = firstErroredField;\n return;\n }\n }\n\n if (!firstErroredField) {\n lastScrolledFieldRef.current = null;\n return;\n }\n\n if (firstErroredField === lastScrolledFieldRef.current) return;\n\n if (typeof window === 'undefined') return;\n\n // rAF defers the scroll until after the browser has laid out the\n // freshly-rendered error labels. Calling scrollIntoView synchronously\n // inside useEffect would fire before the new DOM is painted on\n // some browsers, leaving the viewport pointing at the old layout.\n const handle = window.requestAnimationFrame(() => {\n const root = getScopeRoot(scope);\n if (!root) return;\n const el = findErrorElement(firstErroredField, root);\n if (!el) return;\n\n el.scrollIntoView(scrollOptions);\n if (focus) {\n // preventScroll: true so the browser doesn't override the\n // smooth scroll above with a snap to put the element at the\n // top of the viewport.\n el.focus({ preventScroll: true });\n }\n lastScrolledFieldRef.current = firstErroredField;\n });\n\n return () => window.cancelAnimationFrame(handle);\n // `scrollOptions` / `focus` / `scope` / `skipInitialMount` are\n // option bag values — re-running on their identity change would\n // be surprising. The hook re-fires only when the field at the\n // head of the errored list changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [firstErroredField]);\n}\n"],"names":["useMediaQuery","query","matches","setMatches","useState","useEffect","mql","onChange","ev","getScopeRoot","scope","findErrorElement","name","root","safe","selector","el","useScrollToFirstError","errors","fieldOrder","options","scrollOptions","focus","skipInitialMount","isInitialMount","useRef","lastScrolledFieldRef","firstErroredField","handle"],"mappings":";AAiBO,SAASA,EAAcC,GAAwB;AACpD,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAkB,MAE5C,OAAO,SAAW,OAClB,OAAO,OAAO,cAAe,aAEtB,KAEF,OAAO,WAAWH,CAAK,EAAE,OACjC;AAED,SAAAI,EAAU,MAAM;AACd,QACE,OAAO,SAAW,OAClB,OAAO,OAAO,cAAe;AAE7B;AAEF,UAAMC,IAAM,OAAO,WAAWL,CAAK;AAGnC,IAAAE,EAAWG,EAAI,OAAO;AACtB,UAAMC,IAAW,CAACC,MAA4BL,EAAWK,EAAG,OAAO;AACnE,WAAI,OAAOF,EAAI,oBAAqB,cAClCA,EAAI,iBAAiB,UAAUC,CAAQ,GAChC,MAAMD,EAAI,oBAAoB,UAAUC,CAAQ,MAEzDD,EAAI,YAAYC,CAAQ,GACjB,MAAMD,EAAI,eAAeC,CAAQ;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