@alfadocs/ui-kit-debug 1.5.0 → 1.6.1
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/{actions-cell-renderer-BD-jruqA.js → actions-cell-renderer-ALEAGO3j.js} +6 -6
- package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js.map → actions-cell-renderer-ALEAGO3j.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-CYR-znfE.js → agenda-tray-BweO8pDo.js} +3 -3
- package/dist/_chunks/{agenda-tray-CYR-znfE.js.map → agenda-tray-BweO8pDo.js.map} +1 -1
- package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js → ai-consent-banner-OggpS5hW.js} +2 -2
- package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js.map → ai-consent-banner-OggpS5hW.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-BgAubYKd.js → ai-prompt-input-DnbfEJnr.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-BgAubYKd.js.map → ai-prompt-input-DnbfEJnr.js.map} +1 -1
- package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js → alia-sidebar-BWcWZivN.js} +7 -7
- package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js.map → alia-sidebar-BWcWZivN.js.map} +1 -1
- package/dist/_chunks/{anamnesis-card-BylMLHYj.js → anamnesis-card-NTi4LLzI.js} +2 -2
- package/dist/_chunks/{anamnesis-card-BylMLHYj.js.map → anamnesis-card-NTi4LLzI.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js → anamnesis-summary-rows-F-cCmFAn.js} +7 -7
- package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js.map → anamnesis-summary-rows-F-cCmFAn.js.map} +1 -1
- package/dist/_chunks/{appointment-timeline-DT1uFp8z.js → appointment-timeline-CMPvzlGZ.js} +4 -4
- package/dist/_chunks/{appointment-timeline-DT1uFp8z.js.map → appointment-timeline-CMPvzlGZ.js.map} +1 -1
- package/dist/_chunks/{appointment-tray-DvyVK7um.js → appointment-tray-3c_FLxXJ.js} +3 -3
- package/dist/_chunks/{appointment-tray-DvyVK7um.js.map → appointment-tray-3c_FLxXJ.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-nVRN4PSK.js → audio-recorder-EWBCNIsd.js} +3 -3
- package/dist/_chunks/{audio-recorder-nVRN4PSK.js.map → audio-recorder-EWBCNIsd.js.map} +1 -1
- package/dist/_chunks/{bishop-score-BV1JAEMV.js → bishop-score-Cnu0xs-z.js} +2 -2
- package/dist/_chunks/{bishop-score-BV1JAEMV.js.map → bishop-score-Cnu0xs-z.js.map} +1 -1
- package/dist/_chunks/{bmi-calculator-CdR-RLFj.js → bmi-calculator-CcH6upht.js} +2 -2
- package/dist/_chunks/{bmi-calculator-CdR-RLFj.js.map → bmi-calculator-CcH6upht.js.map} +1 -1
- package/dist/_chunks/{booking-CGKof8QU.js → booking-CQMJUFG-.js} +556 -549
- package/dist/_chunks/booking-CQMJUFG-.js.map +1 -0
- package/dist/_chunks/{button-group-Be_In68J.js → button-group-CaxRJsNG.js} +2 -2
- package/dist/_chunks/{button-group-Be_In68J.js.map → button-group-CaxRJsNG.js.map} +1 -1
- package/dist/_chunks/{button-BvNtqHAS.js → button-nJaPh_HC.js} +68 -38
- package/dist/_chunks/button-nJaPh_HC.js.map +1 -0
- package/dist/_chunks/{care-plan-card-CehAU7F_.js → care-plan-card-DQjVRDxO.js} +2 -2
- package/dist/_chunks/{care-plan-card-CehAU7F_.js.map → care-plan-card-DQjVRDxO.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js → care-plan-entry-card-CMpoeNkb.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js.map → care-plan-entry-card-CMpoeNkb.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-_B0TTWT1.js → care-plan-header-CxYoq23f.js} +2 -2
- package/dist/_chunks/{care-plan-header-_B0TTWT1.js.map → care-plan-header-CxYoq23f.js.map} +1 -1
- package/dist/_chunks/{carousel.agent-pjORsMS8.js → carousel.agent-CLxdHEBP.js} +2 -2
- package/dist/_chunks/{carousel.agent-pjORsMS8.js.map → carousel.agent-CLxdHEBP.js.map} +1 -1
- package/dist/_chunks/{chart-Y-gso_Uz.js → chart-Bkr1Sh4o.js} +3 -3
- package/dist/_chunks/{chart-Y-gso_Uz.js.map → chart-Bkr1Sh4o.js.map} +1 -1
- package/dist/_chunks/{chat-input-BqI9GXQh.js → chat-input-BsB5Umpj.js} +2 -2
- package/dist/_chunks/{chat-input-BqI9GXQh.js.map → chat-input-BsB5Umpj.js.map} +1 -1
- package/dist/_chunks/{chat-message-DHNUbjXA.js → chat-message-DBQu10rs.js} +3 -3
- package/dist/_chunks/{chat-message-DHNUbjXA.js.map → chat-message-DBQu10rs.js.map} +1 -1
- package/dist/_chunks/{code-block-BONe9fJi.js → code-block-BIkpRLkl.js} +2 -2
- package/dist/_chunks/{code-block-BONe9fJi.js.map → code-block-BIkpRLkl.js.map} +1 -1
- package/dist/_chunks/{connection-status-NT8hUtYl.js → connection-status-DRZIcMqM.js} +3 -3
- package/dist/_chunks/{connection-status-NT8hUtYl.js.map → connection-status-DRZIcMqM.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-BxHiG8e6.js → contact-profile-card-CE9OJKcl.js} +2 -2
- package/dist/_chunks/{contact-profile-card-BxHiG8e6.js.map → contact-profile-card-CE9OJKcl.js.map} +1 -1
- package/dist/_chunks/{control-room-rail-DDyPDBji.js → control-room-rail-IH1eBjrK.js} +3 -3
- package/dist/_chunks/{control-room-rail-DDyPDBji.js.map → control-room-rail-IH1eBjrK.js.map} +1 -1
- package/dist/_chunks/{copy-field-B-DoMBH_.js → copy-field-fYKpl6aN.js} +2 -2
- package/dist/_chunks/{copy-field-B-DoMBH_.js.map → copy-field-fYKpl6aN.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-DJZYvNhw.js → cycle-calculator-DzgO1vzP.js} +2 -2
- package/dist/_chunks/{cycle-calculator-DJZYvNhw.js.map → cycle-calculator-DzgO1vzP.js.map} +1 -1
- package/dist/_chunks/{dashboard-grid-bd0QW2a8.js → dashboard-grid-BFtdHqfn.js} +2 -2
- package/dist/_chunks/{dashboard-grid-bd0QW2a8.js.map → dashboard-grid-BFtdHqfn.js.map} +1 -1
- package/dist/_chunks/{data-table-tabs-C8uDThT3.js → data-table-tabs-C1kRUzat.js} +3 -3
- package/dist/_chunks/{data-table-tabs-C8uDThT3.js.map → data-table-tabs-C1kRUzat.js.map} +1 -1
- package/dist/_chunks/{description-list-Ck7fKdt5.js → description-list-CjJqR8WK.js} +2 -2
- package/dist/_chunks/{description-list-Ck7fKdt5.js.map → description-list-CjJqR8WK.js.map} +1 -1
- package/dist/_chunks/{document-preview-Aae2yKvY.js → document-preview-oyx9RhCo.js} +2 -2
- package/dist/_chunks/{document-preview-Aae2yKvY.js.map → document-preview-oyx9RhCo.js.map} +1 -1
- package/dist/_chunks/{document-scanner-qNZLhH_r.js → document-scanner-C5Vrbu21.js} +2 -2
- package/dist/_chunks/{document-scanner-qNZLhH_r.js.map → document-scanner-C5Vrbu21.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js → due-date-calculator-wK8Tajzz.js} +2 -2
- package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js.map → due-date-calculator-wK8Tajzz.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js → editable-currency-cell-renderer-DYdzKpjL.js} +3 -3
- package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js.map → editable-currency-cell-renderer-DYdzKpjL.js.map} +1 -1
- package/dist/_chunks/{editor-overlay-DE-gxj9L.js → editor-overlay-DEc5yYwo.js} +2 -2
- package/dist/_chunks/{editor-overlay-DE-gxj9L.js.map → editor-overlay-DEc5yYwo.js.map} +1 -1
- package/dist/_chunks/{empty-state-Df0tM6Kn.js → empty-state-X0sVPfVo.js} +2 -2
- package/dist/_chunks/{empty-state-Df0tM6Kn.js.map → empty-state-X0sVPfVo.js.map} +1 -1
- package/dist/_chunks/{entity-summary-DBOI5di6.js → entity-summary-B_vO5Ur4.js} +3 -3
- package/dist/_chunks/{entity-summary-DBOI5di6.js.map → entity-summary-B_vO5Ur4.js.map} +1 -1
- package/dist/_chunks/{face-scheme-D7Pub04e.js → face-scheme-BfDi4YkW.js} +5 -5
- package/dist/_chunks/{face-scheme-D7Pub04e.js.map → face-scheme-BfDi4YkW.js.map} +1 -1
- package/dist/_chunks/{fetal-weight-jon6GIfQ.js → fetal-weight-Dqy0T1fP.js} +2 -2
- package/dist/_chunks/{fetal-weight-jon6GIfQ.js.map → fetal-weight-Dqy0T1fP.js.map} +1 -1
- package/dist/_chunks/{field-array-BQFX5OYi.js → field-array-BjkXZzSr.js} +3 -3
- package/dist/_chunks/{field-array-BQFX5OYi.js.map → field-array-BjkXZzSr.js.map} +1 -1
- package/dist/_chunks/{field-value-BbiDRyNh.js → field-value-DG8zaZvo.js} +4 -4
- package/dist/_chunks/{field-value-BbiDRyNh.js.map → field-value-DG8zaZvo.js.map} +1 -1
- package/dist/_chunks/{file-manager-CML_C6_h.js → file-manager-Cc_upjZX.js} +6 -6
- package/dist/_chunks/{file-manager-CML_C6_h.js.map → file-manager-Cc_upjZX.js.map} +1 -1
- package/dist/_chunks/{finished-terminal-BWNVh7Y8.js → finished-terminal-Br61Ip4e.js} +2 -2
- package/dist/_chunks/{finished-terminal-BWNVh7Y8.js.map → finished-terminal-Br61Ip4e.js.map} +1 -1
- package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js → fiscal-code-input-B_nYMSEM.js} +2 -2
- package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js.map → fiscal-code-input-B_nYMSEM.js.map} +1 -1
- package/dist/_chunks/{freemium-paywall-HG3pFvMp.js → freemium-paywall-DrXzYfv-.js} +2 -2
- package/dist/_chunks/{freemium-paywall-HG3pFvMp.js.map → freemium-paywall-DrXzYfv-.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js → gestational-age-calculator-C_uDAeP_.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js.map → gestational-age-calculator-C_uDAeP_.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-CC6TLtHd.js → hcg-doubling-BaXkJhT-.js} +2 -2
- package/dist/_chunks/{hcg-doubling-CC6TLtHd.js.map → hcg-doubling-BaXkJhT-.js.map} +1 -1
- package/dist/_chunks/{header-CimZS-J9.js → header-DUXRIPyM.js} +2 -2
- package/dist/_chunks/{header-CimZS-J9.js.map → header-DUXRIPyM.js.map} +1 -1
- package/dist/_chunks/{header-settings-C0zHLXJE.js → header-settings-CVC_davE.js} +4 -4
- package/dist/_chunks/{header-settings-C0zHLXJE.js.map → header-settings-CVC_davE.js.map} +1 -1
- package/dist/_chunks/{icon-button-9c9Gp41m.js → icon-button-DA2CAGHZ.js} +2 -2
- package/dist/_chunks/{icon-button-9c9Gp41m.js.map → icon-button-DA2CAGHZ.js.map} +1 -1
- package/dist/_chunks/{icon-button-group-DrvuWPGJ.js → icon-button-group-D6SVMteH.js} +2 -2
- package/dist/_chunks/{icon-button-group-DrvuWPGJ.js.map → icon-button-group-D6SVMteH.js.map} +1 -1
- package/dist/_chunks/{icon-picker-DXV3sDp1.js → icon-picker-ChzpCnZ-.js} +3 -3
- package/dist/_chunks/{icon-picker-DXV3sDp1.js.map → icon-picker-ChzpCnZ-.js.map} +1 -1
- package/dist/_chunks/{image-cropper-DWSnyLwW.js → image-cropper-C84NDTB7.js} +2 -2
- package/dist/_chunks/{image-cropper-DWSnyLwW.js.map → image-cropper-C84NDTB7.js.map} +1 -1
- package/dist/_chunks/{info-tip-C4mPSJbS.js → info-tip-C119cwQl.js} +2 -2
- package/dist/_chunks/{info-tip-C4mPSJbS.js.map → info-tip-C119cwQl.js.map} +1 -1
- package/dist/_chunks/{insert-result-98J1QEp7.js → insert-result-LCNTskNJ.js} +2 -2
- package/dist/_chunks/{insert-result-98J1QEp7.js.map → insert-result-LCNTskNJ.js.map} +1 -1
- package/dist/_chunks/{key-value-pair-DGkGlgCF.js → key-value-pair-BubG4fUa.js} +2 -2
- package/dist/_chunks/{key-value-pair-DGkGlgCF.js.map → key-value-pair-BubG4fUa.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js → link-cell-renderer-DH4JYpKU.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js.map → link-cell-renderer-DH4JYpKU.js.map} +1 -1
- package/dist/_chunks/{locale-picker-sI0HWgZy.js → locale-picker-BvbVjDQ-.js} +3 -3
- package/dist/_chunks/{locale-picker-sI0HWgZy.js.map → locale-picker-BvbVjDQ-.js.map} +1 -1
- package/dist/_chunks/{map-view-iwSDRW3t.js → map-view-CCAlC9IL.js} +2 -2
- package/dist/_chunks/{map-view-iwSDRW3t.js.map → map-view-CCAlC9IL.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js → marketplace-app-shell-Chfdia7m.js} +4 -4
- package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js.map → marketplace-app-shell-Chfdia7m.js.map} +1 -1
- package/dist/_chunks/{message-card-BCJ-Jgs6.js → message-card-D8GB4FdF.js} +3 -3
- package/dist/_chunks/{message-card-BCJ-Jgs6.js.map → message-card-D8GB4FdF.js.map} +1 -1
- package/dist/_chunks/{message-tray-DHtm_WaF.js → message-tray-CGIRQjx5.js} +4 -4
- package/dist/_chunks/{message-tray-DHtm_WaF.js.map → message-tray-CGIRQjx5.js.map} +1 -1
- package/dist/_chunks/{notes-panel-D6HKLLS-.js → notes-panel-DlnENphf.js} +3 -3
- package/dist/_chunks/{notes-panel-D6HKLLS-.js.map → notes-panel-DlnENphf.js.map} +1 -1
- package/dist/_chunks/{notification-card-CcMQn2RX.js → notification-card-CtrzoTUO.js} +3 -3
- package/dist/_chunks/{notification-card-CcMQn2RX.js.map → notification-card-CtrzoTUO.js.map} +1 -1
- package/dist/_chunks/{notification-tray-nr7dv-Q8.js → notification-tray-BiRzXHDf.js} +4 -4
- package/dist/_chunks/{notification-tray-nr7dv-Q8.js.map → notification-tray-BiRzXHDf.js.map} +1 -1
- package/dist/_chunks/{optical-prescription-DtzEqFQm.js → optical-prescription-Dj3Eh5Ok.js} +2 -2
- package/dist/_chunks/{optical-prescription-DtzEqFQm.js.map → optical-prescription-Dj3Eh5Ok.js.map} +1 -1
- package/dist/_chunks/{patient-details-rENrE_qY.js → patient-details-qnsqYBGQ.js} +5 -5
- package/dist/_chunks/{patient-details-rENrE_qY.js.map → patient-details-qnsqYBGQ.js.map} +1 -1
- package/dist/_chunks/{patient-search-NQemeJlL.js → patient-search-D5ufYoRc.js} +2 -2
- package/dist/_chunks/{patient-search-NQemeJlL.js.map → patient-search-D5ufYoRc.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DQJgOOrA.js → patient-summary-card-CBfuDvJ5.js} +3 -3
- package/dist/_chunks/{patient-summary-card-DQJgOOrA.js.map → patient-summary-card-CBfuDvJ5.js.map} +1 -1
- package/dist/_chunks/{patient-table-BubxfOWL.js → patient-table-DwshfVsQ.js} +3 -3
- package/dist/_chunks/{patient-table-BubxfOWL.js.map → patient-table-DwshfVsQ.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js → payment-automation-upsell-BBIG7NFL.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js.map → payment-automation-upsell-BBIG7NFL.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-CvhDzDNk.js → payment-request-card-BjjBMdsp.js} +3 -3
- package/dist/_chunks/{payment-request-card-CvhDzDNk.js.map → payment-request-card-BjjBMdsp.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-C0nNQKKK.js → periodontal-chart-BatZEFar.js} +2 -2
- package/dist/_chunks/{periodontal-chart-C0nNQKKK.js.map → periodontal-chart-BatZEFar.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js → periodontal-chart-card-BBpY_rBc.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js.map → periodontal-chart-card-BBpY_rBc.js.map} +1 -1
- package/dist/_chunks/{popover-Btj6N25H.js → popover-Cqcjx-Ny.js} +2 -2
- package/dist/_chunks/{popover-Btj6N25H.js.map → popover-Cqcjx-Ny.js.map} +1 -1
- package/dist/_chunks/practice-profile-hero-Bdd0bFqC.js +187 -0
- package/dist/_chunks/practice-profile-hero-Bdd0bFqC.js.map +1 -0
- package/dist/_chunks/{practice-results-DWUZRm2x.js → practice-results-F_Rf7c4H.js} +224 -210
- package/dist/_chunks/practice-results-F_Rf7c4H.js.map +1 -0
- package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js → pregnancy-dating-BVS_9YU2.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js.map → pregnancy-dating-BVS_9YU2.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js → pregnancy-weight-gain-CJwbs9W-.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js.map → pregnancy-weight-gain-CJwbs9W-.js.map} +1 -1
- package/dist/_chunks/{privacy-lock-SQYFRSuH.js → privacy-lock-CkAUo6Dz.js} +3 -3
- package/dist/_chunks/{privacy-lock-SQYFRSuH.js.map → privacy-lock-CkAUo6Dz.js.map} +1 -1
- package/dist/_chunks/{product-hub-panel-BjnD9pdl.js → product-hub-panel-BScCotGD.js} +3 -3
- package/dist/_chunks/{product-hub-panel-BjnD9pdl.js.map → product-hub-panel-BScCotGD.js.map} +1 -1
- package/dist/_chunks/{public-header.agent-DseNK2NQ.js → public-header.agent-kth2SdXn.js} +3 -3
- package/dist/_chunks/{public-header.agent-DseNK2NQ.js.map → public-header.agent-kth2SdXn.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js → radiograph-panel.agent-CiHwgISa.js} +4 -4
- package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js.map → radiograph-panel.agent-CiHwgISa.js.map} +1 -1
- package/dist/_chunks/{reviews-panel-Cd3SxJdW.js → reviews-panel-BKHEfqVQ.js} +4 -4
- package/dist/_chunks/{reviews-panel-Cd3SxJdW.js.map → reviews-panel-BKHEfqVQ.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-DGtn_4sb.js → rich-text-editor-DARnq_6N.js} +5 -5
- package/dist/_chunks/{rich-text-editor-DGtn_4sb.js.map → rich-text-editor-DARnq_6N.js.map} +1 -1
- package/dist/_chunks/{session-countdown-q4r5TlCo.js → session-countdown-QMsnRa1x.js} +2 -2
- package/dist/_chunks/{session-countdown-q4r5TlCo.js.map → session-countdown-QMsnRa1x.js.map} +1 -1
- package/dist/_chunks/{sheet-CD99CdXr.js → sheet-BSznOyJs.js} +2 -2
- package/dist/_chunks/{sheet-CD99CdXr.js.map → sheet-BSznOyJs.js.map} +1 -1
- package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js → sign-in-with-alfadocs-button-BLe_quy5.js} +2 -2
- package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js.map → sign-in-with-alfadocs-button-BLe_quy5.js.map} +1 -1
- package/dist/_chunks/{signature-request-C4UBfVRZ.js → signature-request-DXhpphlp.js} +4 -4
- package/dist/_chunks/{signature-request-C4UBfVRZ.js.map → signature-request-DXhpphlp.js.map} +1 -1
- package/dist/_chunks/{slot-grid-P_e9p5t5.js → slot-grid-BuZOKfcd.js} +4 -4
- package/dist/_chunks/{slot-grid-P_e9p5t5.js.map → slot-grid-BuZOKfcd.js.map} +1 -1
- package/dist/_chunks/{streaming-text-BuW7I0Zu.js → streaming-text-CvsjIQ7S.js} +2 -2
- package/dist/_chunks/{streaming-text-BuW7I0Zu.js.map → streaming-text-CvsjIQ7S.js.map} +1 -1
- package/dist/_chunks/{task-tray-BT288xoM.js → task-tray-CYG6rj2s.js} +3 -3
- package/dist/_chunks/{task-tray-BT288xoM.js.map → task-tray-CYG6rj2s.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-BBkZuejF.js → tasks-panel-Do5SFp-j.js} +5 -5
- package/dist/_chunks/{tasks-panel-BBkZuejF.js.map → tasks-panel-Do5SFp-j.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-Bi-CmV6M.js → theme-toggle-DuMhQNFS.js} +3 -3
- package/dist/_chunks/{theme-toggle-Bi-CmV6M.js.map → theme-toggle-DuMhQNFS.js.map} +1 -1
- package/dist/_chunks/{toast.agent-C44mtGrW.js → toast.agent-D1tdg6DS.js} +2 -2
- package/dist/_chunks/{toast.agent-C44mtGrW.js.map → toast.agent-D1tdg6DS.js.map} +1 -1
- package/dist/_chunks/{token-insert-menu-D8FgXl33.js → token-insert-menu-9Um0JinI.js} +2 -2
- package/dist/_chunks/{token-insert-menu-D8FgXl33.js.map → token-insert-menu-9Um0JinI.js.map} +1 -1
- package/dist/_chunks/{tool-rail-BF3F2Ihq.js → tool-rail-CHyUmulN.js} +2 -2
- package/dist/_chunks/{tool-rail-BF3F2Ihq.js.map → tool-rail-CHyUmulN.js.map} +1 -1
- package/dist/_chunks/{tooth-scheme-BPXE1_3N.js → tooth-scheme-WdyVymQ1.js} +3 -3
- package/dist/_chunks/{tooth-scheme-BPXE1_3N.js.map → tooth-scheme-WdyVymQ1.js.map} +1 -1
- package/dist/_chunks/{unit-converter-iDxlxKmm.js → unit-converter-BPumXMA6.js} +2 -2
- package/dist/_chunks/{unit-converter-iDxlxKmm.js.map → unit-converter-BPumXMA6.js.map} +1 -1
- package/dist/_chunks/{warning-stack-nczJf52p.js → warning-stack-DQz0Jyir.js} +3 -3
- package/dist/_chunks/{warning-stack-nczJf52p.js.map → warning-stack-DQz0Jyir.js.map} +1 -1
- package/dist/_chunks/{workflow-map-BVofnDYh.js → workflow-map-DE_ribRM.js} +5 -5
- package/dist/_chunks/{workflow-map-BVofnDYh.js.map → workflow-map-DE_ribRM.js.map} +1 -1
- package/dist/agent-catalog.json +33 -36
- package/dist/agent-i18n/en.json +6 -5
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/appointment-card/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +9 -0
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button/button.d.ts +10 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/connection-status/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dashboard-grid/index.js +1 -1
- package/dist/components/data-table/index.js +3 -3
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/editor-overlay/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/field-array/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/finished-terminal/index.js +1 -1
- package/dist/components/fiscal-code-input/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/image-cropper/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/info-tip/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/notes-panel/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/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/practice-profile-hero/index.d.ts +4 -0
- package/dist/components/practice-profile-hero/index.d.ts.map +1 -0
- package/dist/components/practice-profile-hero/index.js +6 -0
- package/dist/components/practice-profile-hero/index.js.map +1 -0
- package/dist/components/practice-profile-hero/practice-profile-hero.agent.d.ts +4 -0
- package/dist/components/practice-profile-hero/practice-profile-hero.agent.d.ts.map +1 -0
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +60 -0
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -0
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +15 -1
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/token-insert-menu/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/host-compat.css +1 -4
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +1 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +1 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +1 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +1 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +1 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +1 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +1 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +1 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +1 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +1 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +1 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +1 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +1 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +409 -406
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +1 -0
- package/dist/locales/de.json +1 -0
- package/dist/locales/el.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/hi.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/locales/ja.json +1 -0
- package/dist/locales/nl.json +1 -0
- package/dist/locales/pl.json +1 -0
- package/dist/locales/pt.json +1 -0
- package/dist/locales/ro.json +1 -0
- package/dist/locales/ru.json +1 -0
- package/dist/locales/sq.json +1 -0
- package/dist/locales/sv.json +1 -0
- package/dist/locales/tr.json +1 -0
- package/dist/locales/zh.json +1 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/booking-CGKof8QU.js.map +0 -1
- package/dist/_chunks/button-BvNtqHAS.js.map +0 -1
- package/dist/_chunks/practice-results-DWUZRm2x.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-cropper-DWSnyLwW.js","sources":["../../src/components/image-cropper/image-cropper.agent.ts","../../src/components/image-cropper/crop-geometry.ts","../../src/components/image-cropper/image-cropper.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ImageCropper. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. The crop is a */\n/* rectangular region pick, so `range_pick` is the closest capability in */\n/* the closed vocabulary. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ImageCropperHandle } from './image-cropper';\n\nconst RECT_SCHEMA = {\n type: 'object',\n properties: {\n x: { type: 'number', minimum: 0, maximum: 1 },\n y: { type: 'number', minimum: 0, maximum: 1 },\n width: { type: 'number', minimum: 0, maximum: 1 },\n height: { type: 'number', minimum: 0, maximum: 1 },\n },\n required: ['x', 'y', 'width', 'height'],\n} as const;\n\nexport const imageCropperAgent: AgentAdapter<ImageCropperHandle> = {\n id: 'image-cropper',\n capabilities: ['range_pick'],\n state: {\n crop: {\n type: 'object',\n descriptionKey: 'ui.agent.imageCropper.state.crop',\n description:\n 'Current crop rectangle in normalised [0,1] coordinates: { x, y, width, height }.',\n read: (handle) => handle.getCrop(),\n },\n },\n actions: {\n set_crop: {\n safety: 'write',\n argsType: '{ x: number; y: number; width: number; height: number }',\n argsSchema: RECT_SCHEMA,\n idempotent: true,\n descriptionKey: 'ui.agent.imageCropper.actions.setCrop',\n description:\n 'Set the crop rectangle (normalised [0,1]). Values are clamped to the image bounds and the minimum crop size.',\n invoke: (\n handle,\n args: { x: number; y: number; width: number; height: number },\n ) => {\n handle.setCrop(args);\n },\n },\n reset: {\n safety: 'write',\n idempotent: true,\n descriptionKey: 'ui.agent.imageCropper.actions.reset',\n description:\n 'Reset the crop to the centred default for the current aspect.',\n invoke: (handle) => {\n handle.reset();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'image-cropper',\n description: 'Marks the ImageCropper wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* -------------------------------------------------------------------- */\n/* Crop geometry — pure helpers shared by the component + its tests. */\n/* */\n/* A crop is stored in NORMALISED coordinates (0–1) relative to the */\n/* displayed image box, so it survives responsive resizes and is trivial */\n/* for a consumer to map onto the natural-resolution bitmap server-side. */\n/* -------------------------------------------------------------------- */\n\n/** Normalised crop rectangle (each field in the closed interval [0, 1]). */\nexport interface CropRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport const clamp01 = (v: number): number => Math.min(1, Math.max(0, v));\n\n/**\n * Clamp a rectangle so it stays within the unit box and never shrinks below\n * `minSize` on either axis.\n */\nexport function clampRect(rect: CropRect, minSize: number): CropRect {\n const width = Math.min(1, Math.max(minSize, rect.width));\n const height = Math.min(1, Math.max(minSize, rect.height));\n const x = Math.min(1 - width, Math.max(0, rect.x));\n const y = Math.min(1 - height, Math.max(0, rect.y));\n return { x, y, width, height };\n}\n\n/**\n * Coerce a rectangle's height to honour a pixel aspect ratio\n * (`width_px / height_px`), anchored at its top-inline-start corner. `boxW` /\n * `boxH` are the displayed image box's pixel dimensions. A non-positive aspect\n * or unmeasured box returns the rectangle unchanged.\n */\nexport function applyAspect(\n rect: CropRect,\n aspect: number | undefined,\n boxW: number,\n boxH: number,\n): CropRect {\n if (!aspect || aspect <= 0 || boxW <= 0 || boxH <= 0) return rect;\n // height_norm = (width_norm * boxW / aspect) / boxH\n const height = (rect.width * boxW) / aspect / boxH;\n return { ...rect, height };\n}\n\n/** A sensible centred default — an 80% box, aspect-coerced when one is set. */\nexport function defaultCrop(\n aspect: number | undefined,\n boxW: number,\n boxH: number,\n): CropRect {\n const base: CropRect = { x: 0.1, y: 0.1, width: 0.8, height: 0.8 };\n const withAspect = applyAspect(base, aspect, boxW, boxH);\n return clampRect(\n {\n ...withAspect,\n // Re-centre vertically after the aspect coercion.\n y: Math.max(0, (1 - withAspect.height) / 2),\n },\n 0.05,\n );\n}\n\n/** Round each field to whole percentages — used for the live-region readout. */\nexport function toPercent(rect: CropRect): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n return {\n x: Math.round(rect.x * 100),\n y: Math.round(rect.y * 100),\n width: Math.round(rect.width * 100),\n height: Math.round(rect.height * 100),\n };\n}\n","import {\n forwardRef,\n useCallback,\n useId,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { RotateCcw } from 'lucide-react';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { Button } from '../button';\nimport { imageCropperAgent } from './image-cropper.agent';\nimport {\n applyAspect,\n clampRect,\n defaultCrop,\n toPercent,\n type CropRect,\n} from './crop-geometry';\n\n/** Agent-readiness curated handle for ImageCropper. */\nexport interface ImageCropperHandle {\n getCrop: () => CropRect;\n setCrop: (rect: CropRect) => void;\n reset: () => void;\n focus: () => void;\n}\n\nexport interface ImageCropperProps {\n /** Source of the image to crop (object URL, data URL, or remote src). */\n src: string;\n /** Accessible description of the image being cropped (consumer-supplied). */\n alt: string;\n /** Pixel aspect ratio (width / height) to lock the crop to. Omit for free-form. */\n aspect?: number;\n /** Controlled crop rect in normalised [0,1] coordinates. Pair with onChange. */\n value?: CropRect;\n /** Uncontrolled initial crop rect. */\n defaultValue?: CropRect;\n /** Fires with the new normalised crop rect on every move/resize. */\n onChange?: (rect: CropRect) => void;\n /** Smallest crop edge as a fraction of the image (default 0.1). */\n minSize?: number;\n /** Normalised step applied per arrow-key press (default 0.02). */\n keyboardStep?: number;\n disabled?: boolean;\n id?: string;\n className?: string;\n 'aria-label'?: string;\n}\n\ntype Corner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n\ninterface DragState {\n mode: 'move' | 'resize';\n corner?: Corner;\n pointerX: number;\n pointerY: number;\n start: CropRect;\n boxW: number;\n boxH: number;\n}\n\nconst rootVariants = cva(\n ['ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]'].join(' '),\n);\n\n// dir=\"ltr\" on the crop surface: the crop rectangle lives in IMAGE-BITMAP\n// space (a physical x/y offset into the picture), never document text flow, so\n// `inset-inline-*` resolves to physical left/top here — the same value-space\n// rationale the kit's numeric inputs use for their `dir=\"ltr\"`. The crop is\n// never mirrored under an RTL UI.\n//\n// The disabled cue dims ONLY the image surface (no text lives here), never the\n// helper/Reset text — dimming text would drop it below the contrast floor.\nconst surfaceVariants = cva(\n 'ds:relative ds:inline-block ds:max-w-full ds:overflow-hidden ds:rounded-[var(--radius-md)] ds:bg-[var(--muted)] ds:select-none ds:touch-none',\n {\n variants: {\n disabled: {\n true: 'ds:opacity-60 ds:pointer-events-none',\n false: '',\n },\n },\n defaultVariants: { disabled: false },\n },\n);\n\nconst imageClass = 'ds:block ds:max-w-full ds:h-auto ds:pointer-events-none';\n\nconst cropBoxClass = [\n 'ds:absolute ds:box-border ds:cursor-move',\n 'ds:border-2 ds:border-[color:var(--ring)]',\n 'ds:shadow-[var(--shadow-md)]',\n 'ds:[inset-inline-start:var(--ic-x)] ds:[inset-block-start:var(--ic-y)]',\n 'ds:[inline-size:var(--ic-w)] ds:[block-size:var(--ic-h)]',\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].join(' ');\n\nconst handleBase =\n 'ds:absolute ds:size-[var(--spacing-md)] ds:rounded-full ds:bg-[var(--ring)] ds:border-2 ds:border-[color:var(--background)]';\n\nconst HANDLES: Array<{ corner: Corner; cls: string }> = [\n {\n corner: 'top-start',\n cls: 'ds:[inset-block-start:0] ds:[inset-inline-start:0]',\n },\n {\n corner: 'top-end',\n cls: 'ds:[inset-block-start:0] ds:[inset-inline-end:0]',\n },\n {\n corner: 'bottom-start',\n cls: 'ds:[inset-block-end:0] ds:[inset-inline-start:0]',\n },\n {\n corner: 'bottom-end',\n cls: 'ds:[inset-block-end:0] ds:[inset-inline-end:0]',\n },\n];\n\nfunction resizeByCorner(\n start: CropRect,\n corner: Corner,\n dxN: number,\n dyN: number,\n): CropRect {\n switch (corner) {\n case 'top-start':\n return {\n x: start.x + dxN,\n y: start.y + dyN,\n width: start.width - dxN,\n height: start.height - dyN,\n };\n case 'top-end':\n return {\n x: start.x,\n y: start.y + dyN,\n width: start.width + dxN,\n height: start.height - dyN,\n };\n case 'bottom-start':\n return {\n x: start.x + dxN,\n y: start.y,\n width: start.width - dxN,\n height: start.height + dyN,\n };\n case 'bottom-end':\n default:\n return {\n x: start.x,\n y: start.y,\n width: start.width + dxN,\n height: start.height + dyN,\n };\n }\n}\n\nexport const ImageCropper = forwardRef<HTMLDivElement, ImageCropperProps>(\n function ImageCropper(\n {\n src,\n alt,\n aspect,\n value,\n defaultValue,\n onChange,\n minSize = 0.1,\n keyboardStep = 0.02,\n disabled,\n id,\n className,\n 'aria-label': ariaLabel,\n },\n ref,\n ) {\n const { t } = useTranslation();\n const reactId = useId();\n const instructionsId = `${reactId}-instructions`;\n const liveId = `${reactId}-live`;\n\n const surfaceRef = useRef<HTMLDivElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const composedRootRef = composeRefs(ref, rootRef);\n const cropBoxRef = useRef<HTMLDivElement | null>(null);\n const dragRef = useRef<DragState | null>(null);\n const touchedRef = useRef(false);\n\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<CropRect>(() =>\n clampRect(defaultValue ?? defaultCrop(aspect, 0, 0), minSize),\n );\n const crop = isControlled\n ? clampRect(value as CropRect, minSize)\n : internal;\n\n const commit = useCallback(\n (next: CropRect) => {\n touchedRef.current = true;\n const clamped = clampRect(next, minSize);\n if (!isControlled) setInternal(clamped);\n onChange?.(clamped);\n },\n [isControlled, minSize, onChange],\n );\n\n const surfaceSize = (): { w: number; h: number } => {\n const r = surfaceRef.current?.getBoundingClientRect();\n return { w: r?.width ?? 0, h: r?.height ?? 0 };\n };\n\n // Re-centre / aspect-fit once the image lays out, but only while the crop\n // is still the untouched default in uncontrolled mode.\n const handleImageLoad = () => {\n if (touchedRef.current || isControlled || defaultValue) return;\n const { w, h } = surfaceSize();\n setInternal(defaultCrop(aspect, w, h));\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLElement>) => {\n dragRef.current = null;\n const el = event.currentTarget;\n if (el.hasPointerCapture?.(event.pointerId)) {\n el.releasePointerCapture(event.pointerId);\n }\n };\n\n const startMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (disabled) return;\n const { w, h } = surfaceSize();\n dragRef.current = {\n mode: 'move',\n pointerX: event.clientX,\n pointerY: event.clientY,\n start: crop,\n boxW: w,\n boxH: h,\n };\n event.currentTarget.setPointerCapture?.(event.pointerId);\n };\n\n const startResize = (\n event: ReactPointerEvent<HTMLSpanElement>,\n corner: Corner,\n ) => {\n if (disabled) return;\n event.stopPropagation();\n const { w, h } = surfaceSize();\n dragRef.current = {\n mode: 'resize',\n corner,\n pointerX: event.clientX,\n pointerY: event.clientY,\n start: crop,\n boxW: w,\n boxH: h,\n };\n // Capture on the crop box so move/up keep flowing while dragging a handle.\n cropBoxRef.current?.setPointerCapture?.(event.pointerId);\n };\n\n const handlePointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.boxW <= 0 || drag.boxH <= 0) return;\n const dxN = (event.clientX - drag.pointerX) / drag.boxW;\n const dyN = (event.clientY - drag.pointerY) / drag.boxH;\n if (drag.mode === 'move') {\n commit({ ...drag.start, x: drag.start.x + dxN, y: drag.start.y + dyN });\n } else if (drag.corner) {\n const raw = resizeByCorner(drag.start, drag.corner, dxN, dyN);\n commit(applyAspect(raw, aspect, drag.boxW, drag.boxH));\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const step = keyboardStep;\n const { w, h } = surfaceSize();\n let next: CropRect | null = null;\n if (event.shiftKey) {\n // Resize from the top-inline-start anchor.\n if (event.key === 'ArrowRight')\n next = { ...crop, width: crop.width + step };\n else if (event.key === 'ArrowLeft')\n next = { ...crop, width: crop.width - step };\n else if (event.key === 'ArrowDown')\n next = { ...crop, height: crop.height + step };\n else if (event.key === 'ArrowUp')\n next = { ...crop, height: crop.height - step };\n if (next) next = applyAspect(next, aspect, w, h);\n } else {\n if (event.key === 'ArrowRight') next = { ...crop, x: crop.x + step };\n else if (event.key === 'ArrowLeft')\n next = { ...crop, x: crop.x - step };\n else if (event.key === 'ArrowDown')\n next = { ...crop, y: crop.y + step };\n else if (event.key === 'ArrowUp') next = { ...crop, y: crop.y - step };\n }\n if (next) {\n event.preventDefault();\n commit(next);\n }\n };\n\n const reset = useCallback(() => {\n const { w, h } = surfaceSize();\n touchedRef.current = false;\n const next = defaultCrop(aspect, w, h);\n if (!isControlled) setInternal(next);\n onChange?.(next);\n }, [aspect, isControlled, onChange]);\n\n const agentHandle = useMemo<ImageCropperHandle>(\n () => ({\n getCrop: () => crop,\n setCrop: (rect) => commit(rect),\n reset,\n focus: () => cropBoxRef.current?.focus(),\n }),\n [crop, commit, reset],\n );\n useAgentRegistration(imageCropperAgent, agentHandle, id);\n\n const pct = toPercent(crop);\n const cropStyle = {\n // Inline style — permitted per 23-constraints §Runtime-computed dimensions\n // (CSS custom-property setters; the position/size rules live in CVA).\n '--ic-x': `${crop.x * 100}%`,\n '--ic-y': `${crop.y * 100}%`,\n '--ic-w': `${crop.width * 100}%`,\n '--ic-h': `${crop.height * 100}%`,\n } as CSSProperties;\n\n const cropLabel = ariaLabel ?? t('imageCropper.cropRegion');\n\n return (\n <div\n ref={composedRootRef}\n className={rootVariants({ className })}\n data-component=\"image-cropper\"\n data-component-id={id}\n >\n <div\n ref={surfaceRef}\n dir=\"ltr\"\n className={surfaceVariants({ disabled: Boolean(disabled) })}\n >\n <img\n src={src}\n alt={alt}\n className={imageClass}\n onLoad={handleImageLoad}\n />\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- crop box is a keyboard-operable adjustable region (arrows move, Shift+arrows resize) with an accessible name + instructions; pointer/keydown handlers are intentional (cf. resizable separator) */}\n <div\n ref={cropBoxRef}\n role=\"group\"\n tabIndex={disabled ? -1 : 0}\n aria-label={cropLabel}\n aria-describedby={instructionsId}\n aria-disabled={disabled || undefined}\n className={cropBoxClass}\n // eslint-disable-next-line react/forbid-dom-props -- runtime-computed crop geometry injected via --ic-x/y/w/h CSS variables (23-constraints §Runtime-computed dimensions); the inset/size rules live in the cropBox className\n style={cropStyle}\n onPointerDown={startMove}\n onPointerMove={handlePointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n onKeyDown={handleKeyDown}\n >\n {HANDLES.map(({ corner, cls }) => (\n <span\n key={corner}\n aria-hidden=\"true\"\n className={`${handleBase} ${cls}`}\n onPointerDown={(event) => startResize(event, corner)}\n />\n ))}\n </div>\n </div>\n\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p\n id={instructionsId}\n className=\"type-body-sm ds:text-muted-foreground\"\n >\n {t('imageCropper.instructions')}\n </p>\n <Button\n type=\"button\"\n intent=\"outline\"\n size=\"sm\"\n disabled={disabled}\n onClick={reset}\n >\n <RotateCcw aria-hidden=\"true\" className=\"ds:size-4\" />\n {t('imageCropper.reset')}\n </Button>\n </div>\n\n {/* Polite live region: announces the crop geometry as text so the\n verdict is never conveyed by the visual box alone. */}\n <p id={liveId} role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {t('imageCropper.announcement', {\n x: pct.x,\n y: pct.y,\n width: pct.width,\n height: pct.height,\n })}\n </p>\n </div>\n );\n },\n);\n\nImageCropper.displayName = 'ImageCropper';\n"],"names":["RECT_SCHEMA","imageCropperAgent","handle","args","clamp01","v","clampRect","rect","minSize","width","height","x","applyAspect","aspect","boxW","boxH","defaultCrop","withAspect","toPercent","rootVariants","cva","surfaceVariants","imageClass","cropBoxClass","handleBase","HANDLES","resizeByCorner","start","corner","dxN","dyN","ImageCropper","forwardRef","src","alt","value","defaultValue","onChange","keyboardStep","disabled","id","className","ariaLabel","ref","t","useTranslation","reactId","useId","instructionsId","liveId","surfaceRef","useRef","rootRef","composedRootRef","composeRefs","cropBoxRef","dragRef","touchedRef","isControlled","internal","setInternal","useState","crop","commit","useCallback","next","clamped","surfaceSize","r","_a","handleImageLoad","w","h","endDrag","event","el","startMove","_b","startResize","handlePointerMove","drag","raw","handleKeyDown","step","reset","agentHandle","useMemo","useAgentRegistration","pct","cropStyle","cropLabel","jsxs","jsx","cls","Button","RotateCcw"],"mappings":";;;;;;;;AAWA,MAAMA,KAAc;AAAA,EAClB,MAAM;AAAA,EACN,YAAY;AAAA,IACV,GAAG,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,IAC1C,GAAG,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,IAC1C,OAAO,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,IAC9C,QAAQ,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,EAAE;AAAA,EAEnD,UAAU,CAAC,KAAK,KAAK,SAAS,QAAQ;AACxC,GAEaC,KAAsD;AAAA,EACjE,IAAI;AAAA,EACJ,cAAc,CAAC,YAAY;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,EACnC;AAAA,EAEF,SAAS;AAAA,IACP,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAYF;AAAA,MACZ,YAAY;AAAA,MACZ,gBAAgB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AEAzD,GAAa,cAAc;"}
|
|
1
|
+
{"version":3,"file":"image-cropper-C84NDTB7.js","sources":["../../src/components/image-cropper/image-cropper.agent.ts","../../src/components/image-cropper/crop-geometry.ts","../../src/components/image-cropper/image-cropper.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ImageCropper. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. The crop is a */\n/* rectangular region pick, so `range_pick` is the closest capability in */\n/* the closed vocabulary. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ImageCropperHandle } from './image-cropper';\n\nconst RECT_SCHEMA = {\n type: 'object',\n properties: {\n x: { type: 'number', minimum: 0, maximum: 1 },\n y: { type: 'number', minimum: 0, maximum: 1 },\n width: { type: 'number', minimum: 0, maximum: 1 },\n height: { type: 'number', minimum: 0, maximum: 1 },\n },\n required: ['x', 'y', 'width', 'height'],\n} as const;\n\nexport const imageCropperAgent: AgentAdapter<ImageCropperHandle> = {\n id: 'image-cropper',\n capabilities: ['range_pick'],\n state: {\n crop: {\n type: 'object',\n descriptionKey: 'ui.agent.imageCropper.state.crop',\n description:\n 'Current crop rectangle in normalised [0,1] coordinates: { x, y, width, height }.',\n read: (handle) => handle.getCrop(),\n },\n },\n actions: {\n set_crop: {\n safety: 'write',\n argsType: '{ x: number; y: number; width: number; height: number }',\n argsSchema: RECT_SCHEMA,\n idempotent: true,\n descriptionKey: 'ui.agent.imageCropper.actions.setCrop',\n description:\n 'Set the crop rectangle (normalised [0,1]). Values are clamped to the image bounds and the minimum crop size.',\n invoke: (\n handle,\n args: { x: number; y: number; width: number; height: number },\n ) => {\n handle.setCrop(args);\n },\n },\n reset: {\n safety: 'write',\n idempotent: true,\n descriptionKey: 'ui.agent.imageCropper.actions.reset',\n description:\n 'Reset the crop to the centred default for the current aspect.',\n invoke: (handle) => {\n handle.reset();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'image-cropper',\n description: 'Marks the ImageCropper wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* -------------------------------------------------------------------- */\n/* Crop geometry — pure helpers shared by the component + its tests. */\n/* */\n/* A crop is stored in NORMALISED coordinates (0–1) relative to the */\n/* displayed image box, so it survives responsive resizes and is trivial */\n/* for a consumer to map onto the natural-resolution bitmap server-side. */\n/* -------------------------------------------------------------------- */\n\n/** Normalised crop rectangle (each field in the closed interval [0, 1]). */\nexport interface CropRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport const clamp01 = (v: number): number => Math.min(1, Math.max(0, v));\n\n/**\n * Clamp a rectangle so it stays within the unit box and never shrinks below\n * `minSize` on either axis.\n */\nexport function clampRect(rect: CropRect, minSize: number): CropRect {\n const width = Math.min(1, Math.max(minSize, rect.width));\n const height = Math.min(1, Math.max(minSize, rect.height));\n const x = Math.min(1 - width, Math.max(0, rect.x));\n const y = Math.min(1 - height, Math.max(0, rect.y));\n return { x, y, width, height };\n}\n\n/**\n * Coerce a rectangle's height to honour a pixel aspect ratio\n * (`width_px / height_px`), anchored at its top-inline-start corner. `boxW` /\n * `boxH` are the displayed image box's pixel dimensions. A non-positive aspect\n * or unmeasured box returns the rectangle unchanged.\n */\nexport function applyAspect(\n rect: CropRect,\n aspect: number | undefined,\n boxW: number,\n boxH: number,\n): CropRect {\n if (!aspect || aspect <= 0 || boxW <= 0 || boxH <= 0) return rect;\n // height_norm = (width_norm * boxW / aspect) / boxH\n const height = (rect.width * boxW) / aspect / boxH;\n return { ...rect, height };\n}\n\n/** A sensible centred default — an 80% box, aspect-coerced when one is set. */\nexport function defaultCrop(\n aspect: number | undefined,\n boxW: number,\n boxH: number,\n): CropRect {\n const base: CropRect = { x: 0.1, y: 0.1, width: 0.8, height: 0.8 };\n const withAspect = applyAspect(base, aspect, boxW, boxH);\n return clampRect(\n {\n ...withAspect,\n // Re-centre vertically after the aspect coercion.\n y: Math.max(0, (1 - withAspect.height) / 2),\n },\n 0.05,\n );\n}\n\n/** Round each field to whole percentages — used for the live-region readout. */\nexport function toPercent(rect: CropRect): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n return {\n x: Math.round(rect.x * 100),\n y: Math.round(rect.y * 100),\n width: Math.round(rect.width * 100),\n height: Math.round(rect.height * 100),\n };\n}\n","import {\n forwardRef,\n useCallback,\n useId,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { RotateCcw } from 'lucide-react';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { Button } from '../button';\nimport { imageCropperAgent } from './image-cropper.agent';\nimport {\n applyAspect,\n clampRect,\n defaultCrop,\n toPercent,\n type CropRect,\n} from './crop-geometry';\n\n/** Agent-readiness curated handle for ImageCropper. */\nexport interface ImageCropperHandle {\n getCrop: () => CropRect;\n setCrop: (rect: CropRect) => void;\n reset: () => void;\n focus: () => void;\n}\n\nexport interface ImageCropperProps {\n /** Source of the image to crop (object URL, data URL, or remote src). */\n src: string;\n /** Accessible description of the image being cropped (consumer-supplied). */\n alt: string;\n /** Pixel aspect ratio (width / height) to lock the crop to. Omit for free-form. */\n aspect?: number;\n /** Controlled crop rect in normalised [0,1] coordinates. Pair with onChange. */\n value?: CropRect;\n /** Uncontrolled initial crop rect. */\n defaultValue?: CropRect;\n /** Fires with the new normalised crop rect on every move/resize. */\n onChange?: (rect: CropRect) => void;\n /** Smallest crop edge as a fraction of the image (default 0.1). */\n minSize?: number;\n /** Normalised step applied per arrow-key press (default 0.02). */\n keyboardStep?: number;\n disabled?: boolean;\n id?: string;\n className?: string;\n 'aria-label'?: string;\n}\n\ntype Corner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n\ninterface DragState {\n mode: 'move' | 'resize';\n corner?: Corner;\n pointerX: number;\n pointerY: number;\n start: CropRect;\n boxW: number;\n boxH: number;\n}\n\nconst rootVariants = cva(\n ['ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]'].join(' '),\n);\n\n// dir=\"ltr\" on the crop surface: the crop rectangle lives in IMAGE-BITMAP\n// space (a physical x/y offset into the picture), never document text flow, so\n// `inset-inline-*` resolves to physical left/top here — the same value-space\n// rationale the kit's numeric inputs use for their `dir=\"ltr\"`. The crop is\n// never mirrored under an RTL UI.\n//\n// The disabled cue dims ONLY the image surface (no text lives here), never the\n// helper/Reset text — dimming text would drop it below the contrast floor.\nconst surfaceVariants = cva(\n 'ds:relative ds:inline-block ds:max-w-full ds:overflow-hidden ds:rounded-[var(--radius-md)] ds:bg-[var(--muted)] ds:select-none ds:touch-none',\n {\n variants: {\n disabled: {\n true: 'ds:opacity-60 ds:pointer-events-none',\n false: '',\n },\n },\n defaultVariants: { disabled: false },\n },\n);\n\nconst imageClass = 'ds:block ds:max-w-full ds:h-auto ds:pointer-events-none';\n\nconst cropBoxClass = [\n 'ds:absolute ds:box-border ds:cursor-move',\n 'ds:border-2 ds:border-[color:var(--ring)]',\n 'ds:shadow-[var(--shadow-md)]',\n 'ds:[inset-inline-start:var(--ic-x)] ds:[inset-block-start:var(--ic-y)]',\n 'ds:[inline-size:var(--ic-w)] ds:[block-size:var(--ic-h)]',\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].join(' ');\n\nconst handleBase =\n 'ds:absolute ds:size-[var(--spacing-md)] ds:rounded-full ds:bg-[var(--ring)] ds:border-2 ds:border-[color:var(--background)]';\n\nconst HANDLES: Array<{ corner: Corner; cls: string }> = [\n {\n corner: 'top-start',\n cls: 'ds:[inset-block-start:0] ds:[inset-inline-start:0]',\n },\n {\n corner: 'top-end',\n cls: 'ds:[inset-block-start:0] ds:[inset-inline-end:0]',\n },\n {\n corner: 'bottom-start',\n cls: 'ds:[inset-block-end:0] ds:[inset-inline-start:0]',\n },\n {\n corner: 'bottom-end',\n cls: 'ds:[inset-block-end:0] ds:[inset-inline-end:0]',\n },\n];\n\nfunction resizeByCorner(\n start: CropRect,\n corner: Corner,\n dxN: number,\n dyN: number,\n): CropRect {\n switch (corner) {\n case 'top-start':\n return {\n x: start.x + dxN,\n y: start.y + dyN,\n width: start.width - dxN,\n height: start.height - dyN,\n };\n case 'top-end':\n return {\n x: start.x,\n y: start.y + dyN,\n width: start.width + dxN,\n height: start.height - dyN,\n };\n case 'bottom-start':\n return {\n x: start.x + dxN,\n y: start.y,\n width: start.width - dxN,\n height: start.height + dyN,\n };\n case 'bottom-end':\n default:\n return {\n x: start.x,\n y: start.y,\n width: start.width + dxN,\n height: start.height + dyN,\n };\n }\n}\n\nexport const ImageCropper = forwardRef<HTMLDivElement, ImageCropperProps>(\n function ImageCropper(\n {\n src,\n alt,\n aspect,\n value,\n defaultValue,\n onChange,\n minSize = 0.1,\n keyboardStep = 0.02,\n disabled,\n id,\n className,\n 'aria-label': ariaLabel,\n },\n ref,\n ) {\n const { t } = useTranslation();\n const reactId = useId();\n const instructionsId = `${reactId}-instructions`;\n const liveId = `${reactId}-live`;\n\n const surfaceRef = useRef<HTMLDivElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const composedRootRef = composeRefs(ref, rootRef);\n const cropBoxRef = useRef<HTMLDivElement | null>(null);\n const dragRef = useRef<DragState | null>(null);\n const touchedRef = useRef(false);\n\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<CropRect>(() =>\n clampRect(defaultValue ?? defaultCrop(aspect, 0, 0), minSize),\n );\n const crop = isControlled\n ? clampRect(value as CropRect, minSize)\n : internal;\n\n const commit = useCallback(\n (next: CropRect) => {\n touchedRef.current = true;\n const clamped = clampRect(next, minSize);\n if (!isControlled) setInternal(clamped);\n onChange?.(clamped);\n },\n [isControlled, minSize, onChange],\n );\n\n const surfaceSize = (): { w: number; h: number } => {\n const r = surfaceRef.current?.getBoundingClientRect();\n return { w: r?.width ?? 0, h: r?.height ?? 0 };\n };\n\n // Re-centre / aspect-fit once the image lays out, but only while the crop\n // is still the untouched default in uncontrolled mode.\n const handleImageLoad = () => {\n if (touchedRef.current || isControlled || defaultValue) return;\n const { w, h } = surfaceSize();\n setInternal(defaultCrop(aspect, w, h));\n };\n\n const endDrag = (event: ReactPointerEvent<HTMLElement>) => {\n dragRef.current = null;\n const el = event.currentTarget;\n if (el.hasPointerCapture?.(event.pointerId)) {\n el.releasePointerCapture(event.pointerId);\n }\n };\n\n const startMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n if (disabled) return;\n const { w, h } = surfaceSize();\n dragRef.current = {\n mode: 'move',\n pointerX: event.clientX,\n pointerY: event.clientY,\n start: crop,\n boxW: w,\n boxH: h,\n };\n event.currentTarget.setPointerCapture?.(event.pointerId);\n };\n\n const startResize = (\n event: ReactPointerEvent<HTMLSpanElement>,\n corner: Corner,\n ) => {\n if (disabled) return;\n event.stopPropagation();\n const { w, h } = surfaceSize();\n dragRef.current = {\n mode: 'resize',\n corner,\n pointerX: event.clientX,\n pointerY: event.clientY,\n start: crop,\n boxW: w,\n boxH: h,\n };\n // Capture on the crop box so move/up keep flowing while dragging a handle.\n cropBoxRef.current?.setPointerCapture?.(event.pointerId);\n };\n\n const handlePointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current;\n if (!drag || drag.boxW <= 0 || drag.boxH <= 0) return;\n const dxN = (event.clientX - drag.pointerX) / drag.boxW;\n const dyN = (event.clientY - drag.pointerY) / drag.boxH;\n if (drag.mode === 'move') {\n commit({ ...drag.start, x: drag.start.x + dxN, y: drag.start.y + dyN });\n } else if (drag.corner) {\n const raw = resizeByCorner(drag.start, drag.corner, dxN, dyN);\n commit(applyAspect(raw, aspect, drag.boxW, drag.boxH));\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const step = keyboardStep;\n const { w, h } = surfaceSize();\n let next: CropRect | null = null;\n if (event.shiftKey) {\n // Resize from the top-inline-start anchor.\n if (event.key === 'ArrowRight')\n next = { ...crop, width: crop.width + step };\n else if (event.key === 'ArrowLeft')\n next = { ...crop, width: crop.width - step };\n else if (event.key === 'ArrowDown')\n next = { ...crop, height: crop.height + step };\n else if (event.key === 'ArrowUp')\n next = { ...crop, height: crop.height - step };\n if (next) next = applyAspect(next, aspect, w, h);\n } else {\n if (event.key === 'ArrowRight') next = { ...crop, x: crop.x + step };\n else if (event.key === 'ArrowLeft')\n next = { ...crop, x: crop.x - step };\n else if (event.key === 'ArrowDown')\n next = { ...crop, y: crop.y + step };\n else if (event.key === 'ArrowUp') next = { ...crop, y: crop.y - step };\n }\n if (next) {\n event.preventDefault();\n commit(next);\n }\n };\n\n const reset = useCallback(() => {\n const { w, h } = surfaceSize();\n touchedRef.current = false;\n const next = defaultCrop(aspect, w, h);\n if (!isControlled) setInternal(next);\n onChange?.(next);\n }, [aspect, isControlled, onChange]);\n\n const agentHandle = useMemo<ImageCropperHandle>(\n () => ({\n getCrop: () => crop,\n setCrop: (rect) => commit(rect),\n reset,\n focus: () => cropBoxRef.current?.focus(),\n }),\n [crop, commit, reset],\n );\n useAgentRegistration(imageCropperAgent, agentHandle, id);\n\n const pct = toPercent(crop);\n const cropStyle = {\n // Inline style — permitted per 23-constraints §Runtime-computed dimensions\n // (CSS custom-property setters; the position/size rules live in CVA).\n '--ic-x': `${crop.x * 100}%`,\n '--ic-y': `${crop.y * 100}%`,\n '--ic-w': `${crop.width * 100}%`,\n '--ic-h': `${crop.height * 100}%`,\n } as CSSProperties;\n\n const cropLabel = ariaLabel ?? t('imageCropper.cropRegion');\n\n return (\n <div\n ref={composedRootRef}\n className={rootVariants({ className })}\n data-component=\"image-cropper\"\n data-component-id={id}\n >\n <div\n ref={surfaceRef}\n dir=\"ltr\"\n className={surfaceVariants({ disabled: Boolean(disabled) })}\n >\n <img\n src={src}\n alt={alt}\n className={imageClass}\n onLoad={handleImageLoad}\n />\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- crop box is a keyboard-operable adjustable region (arrows move, Shift+arrows resize) with an accessible name + instructions; pointer/keydown handlers are intentional (cf. resizable separator) */}\n <div\n ref={cropBoxRef}\n role=\"group\"\n tabIndex={disabled ? -1 : 0}\n aria-label={cropLabel}\n aria-describedby={instructionsId}\n aria-disabled={disabled || undefined}\n className={cropBoxClass}\n // eslint-disable-next-line react/forbid-dom-props -- runtime-computed crop geometry injected via --ic-x/y/w/h CSS variables (23-constraints §Runtime-computed dimensions); the inset/size rules live in the cropBox className\n style={cropStyle}\n onPointerDown={startMove}\n onPointerMove={handlePointerMove}\n onPointerUp={endDrag}\n onPointerCancel={endDrag}\n onKeyDown={handleKeyDown}\n >\n {HANDLES.map(({ corner, cls }) => (\n <span\n key={corner}\n aria-hidden=\"true\"\n className={`${handleBase} ${cls}`}\n onPointerDown={(event) => startResize(event, corner)}\n />\n ))}\n </div>\n </div>\n\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p\n id={instructionsId}\n className=\"type-body-sm ds:text-muted-foreground\"\n >\n {t('imageCropper.instructions')}\n </p>\n <Button\n type=\"button\"\n intent=\"outline\"\n size=\"sm\"\n disabled={disabled}\n onClick={reset}\n >\n <RotateCcw aria-hidden=\"true\" className=\"ds:size-4\" />\n {t('imageCropper.reset')}\n </Button>\n </div>\n\n {/* Polite live region: announces the crop geometry as text so the\n verdict is never conveyed by the visual box alone. */}\n <p id={liveId} role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {t('imageCropper.announcement', {\n x: pct.x,\n y: pct.y,\n width: pct.width,\n height: pct.height,\n })}\n </p>\n </div>\n );\n },\n);\n\nImageCropper.displayName = 'ImageCropper';\n"],"names":["RECT_SCHEMA","imageCropperAgent","handle","args","clamp01","v","clampRect","rect","minSize","width","height","x","applyAspect","aspect","boxW","boxH","defaultCrop","withAspect","toPercent","rootVariants","cva","surfaceVariants","imageClass","cropBoxClass","handleBase","HANDLES","resizeByCorner","start","corner","dxN","dyN","ImageCropper","forwardRef","src","alt","value","defaultValue","onChange","keyboardStep","disabled","id","className","ariaLabel","ref","t","useTranslation","reactId","useId","instructionsId","liveId","surfaceRef","useRef","rootRef","composedRootRef","composeRefs","cropBoxRef","dragRef","touchedRef","isControlled","internal","setInternal","useState","crop","commit","useCallback","next","clamped","surfaceSize","r","_a","handleImageLoad","w","h","endDrag","event","el","startMove","_b","startResize","handlePointerMove","drag","raw","handleKeyDown","step","reset","agentHandle","useMemo","useAgentRegistration","pct","cropStyle","cropLabel","jsxs","jsx","cls","Button","RotateCcw"],"mappings":";;;;;;;;AAWA,MAAMA,KAAc;AAAA,EAClB,MAAM;AAAA,EACN,YAAY;AAAA,IACV,GAAG,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,IAC1C,GAAG,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,IAC1C,OAAO,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,IAC9C,QAAQ,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,EAAA;AAAA,EAAE;AAAA,EAEnD,UAAU,CAAC,KAAK,KAAK,SAAS,QAAQ;AACxC,GAEaC,KAAsD;AAAA,EACjE,IAAI;AAAA,EACJ,cAAc,CAAC,YAAY;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,EACnC;AAAA,EAEF,SAAS;AAAA,IACP,UAAU;AAAA,MACR,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAYF;AAAA,MACZ,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,QAAQ,CACNE,GACAC,MACG;AACH,QAAAD,EAA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/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as I, useState as O, useRef as m, useEffect as k, useMemo as z } from "react";
|
|
3
3
|
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as D } from "react-i18next";
|
|
5
|
-
import { P as o } from "./popover-
|
|
5
|
+
import { P as o } from "./popover-Cqcjx-Ny.js";
|
|
6
6
|
import { u as P } from "./registry-DvAUVLHh.js";
|
|
7
7
|
import { I as A } from "./info-CGn22peZ.js";
|
|
8
8
|
const R = {
|
|
@@ -163,4 +163,4 @@ export {
|
|
|
163
163
|
j as I,
|
|
164
164
|
R as i
|
|
165
165
|
};
|
|
166
|
-
//# sourceMappingURL=info-tip-
|
|
166
|
+
//# sourceMappingURL=info-tip-C119cwQl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-tip-C4mPSJbS.js","sources":["../../src/components/info-tip/info-tip.agent.ts","../../src/components/info-tip/info-tip.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { InfoTipHandle } from './info-tip';\n\nexport const infoTipAgent: AgentAdapter<InfoTipHandle> = {\n id: 'info-tip',\n capabilities: ['open', 'close'],\n state: {\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.infoTip.state.isOpen',\n description: 'True when the info tip card is currently open.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.infoTip.actions.open',\n description: 'Open the info tip card.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.infoTip.actions.close',\n description: 'Close the info tip card.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'info-tip',\n description: 'Marks the InfoTip trigger button.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop on InfoTip.',\n },\n },\n};\n","import {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Info } from 'lucide-react';\nimport { Popover } from '../popover';\nimport { useAgentRegistration } from '../../agent';\nimport { infoTipAgent } from './info-tip.agent';\n\n/* -------------------------------------------------------------------- */\n/* Trigger — a small circular, branded affordance: card surface inside */\n/* the circle, accent ring + accent \"i\" glyph, and a soft drop shadow. */\n/* The accent alias is safe here: `--accent` resolves to magenta-700 in */\n/* light mode (the AA-safe interactive step) and the dark accent on dark */\n/* surfaces — never reference a raw magenta ramp step. */\n/* -------------------------------------------------------------------- */\n\nconst infoTipTriggerVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[var(--card)]',\n 'ds:text-[var(--accent)]',\n // Single ring: the Lucide Info glyph draws its own accent circle, so the\n // trigger carries NO CSS border of its own (a border would read as a\n // second, concentric ring). The white circle comes from `bg-card` showing\n // through the glyph, lifted by the drop shadow.\n 'ds:shadow-[var(--shadow-sm)]',\n 'ds:cursor-pointer',\n 'ds:transition-[color,box-shadow] ds:motion-reduce:transition-none',\n 'ds:hover:text-[var(--accent-hover)] ds:hover:shadow-[var(--shadow-md)]',\n 'ds:data-[state=open]:text-[var(--accent-hover)] ds:data-[state=open]:shadow-[var(--shadow-md)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n // Both diameters sit below `--min-target-size` (44/48px), so each\n // re-uses IconButton's invisible `::before` hit-area expansion to a\n // full touch target on touch / small screens. From the `sm:`\n // breakpoint up the pointer is precise, so the expansion relaxes —\n // but the interactive target must never fall below WCAG 2.5.8's 24px:\n // • md (24px visual) already meets the 24px floor, so its `::before`\n // is hidden on desktop and the 24px circle IS the target.\n // • sm (20px visual) would fall to 20px if hidden — below the floor\n // — so instead of hiding, its `::before` shrinks to a persistent\n // `--spacing-lg` (24px) minimum that holds on desktop too.\n sm: 'ds:w-5 ds:h-5 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:inset-x-[calc((var(--spacing-lg)-100%)/-2)] ds:sm:before:inset-y-[calc((var(--spacing-lg)-100%)/-2)]',\n md: 'ds:w-6 ds:h-6 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n// Curated agent-readiness handle — see info-tip.agent.ts.\nexport interface InfoTipHandle {\n getIsOpen: () => boolean;\n open: () => void;\n close: () => void;\n}\n\nexport interface InfoTipProps {\n /** Body of the tip — explanatory text shown in the floating card. */\n content: ReactNode;\n /** Optional heading rendered above the body. */\n heading?: ReactNode;\n /**\n * Trigger diameter. Also maps the floating card width:\n * `sm` → `--popover-size-sm`, `md` → `--popover-size-md`.\n */\n size?: 'sm' | 'md';\n /** Logical side the card opens on. Default `'top'`. */\n side?: 'start' | 'top' | 'end' | 'bottom';\n /** Alignment along the side axis. Default `'center'`. */\n align?: 'start' | 'center' | 'end';\n /**\n * Accessible name for the trigger. Defaults to the translated\n * \"More information\" chrome string.\n */\n 'aria-label'?: string;\n /**\n * Opaque instance id — emitted as `data-component-id` on the trigger and\n * used to register the instance with the host agent registry.\n */\n id?: string;\n /** Extra classes merged onto the trigger button. */\n className?: string;\n}\n\n/**\n * InfoTip — a deliberate, branded \"more information\" affordance: a small\n * circular trigger that reveals an explanatory card on hover **and** click\n * (click also serves touch devices). Composes the kit Popover in\n * `openOn=\"hover-or-click\"` mode — hover intent, keyboard focus, Escape and\n * focus-return are all handled by the Popover/Radix layer.\n */\nexport const InfoTip = forwardRef<HTMLButtonElement, InfoTipProps>(\n (\n {\n content,\n heading,\n size = 'md',\n side = 'top',\n align = 'center',\n 'aria-label': ariaLabelProp,\n id,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n\n // Agent handle.\n const openRef = useRef(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const agentHandle = useMemo<InfoTipHandle>(\n () => ({\n getIsOpen: () => openRef.current,\n open: () => setOpen(true),\n close: () => setOpen(false),\n }),\n [],\n );\n useAgentRegistration(infoTipAgent, agentHandle, id);\n\n // Press bookkeeping. In hover-or-click mode the Popover opens as soon as\n // the trigger receives focus — which happens on pointerdown, BEFORE the\n // click event that Radix uses to toggle. Without intervention every\n // click/tap on a closed tip opens it (focus) and instantly toggles it\n // closed again (click). So each press (pointerdown, or Enter/Space)\n // snapshots the open state and the click handler consumes it: if the\n // press itself opened the card, swallow Radix's toggle so the card stays\n // open; if it was already open, let the toggle close it.\n //\n // `null` means \"no press recorded for this click\" — an orphan click\n // (programmatic .click(), or assistive tech dispatching click with no\n // pointer/key event). Those must fall through to Radix's default toggle\n // rather than read a stale snapshot, so the guard treats `null` as\n // \"don't suppress\" and every click clears the snapshot back to `null`.\n const pressStateRef = useRef<boolean | null>(null);\n const handlePressStart = () => {\n pressStateRef.current = openRef.current;\n };\n\n const ariaLabel =\n ariaLabelProp ?? t('infoTip.triggerLabel', 'More information');\n\n return (\n <Popover openOn=\"hover-or-click\" open={open} onOpenChange={setOpen}>\n <Popover.Trigger\n ref={ref}\n aria-label={ariaLabel}\n className={infoTipTriggerVariants({ size, className })}\n data-component=\"info-tip\"\n data-component-id={id}\n onPointerDown={handlePressStart}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n handlePressStart();\n }\n }}\n onClick={(event) => {\n // Consume this click's press snapshot. A genuine pointer/keyboard\n // press recorded `false`/`true` on press-start; an orphan click\n // with no preceding pointerdown/keydown finds `null` and is left\n // to Radix's default toggle.\n const wasOpenAtPressStart = pressStateRef.current;\n pressStateRef.current = null;\n if (wasOpenAtPressStart === false && openRef.current) {\n // This press opened the card via focus — keep it open and\n // skip Radix's click toggle.\n event.preventDefault();\n }\n }}\n >\n <Info\n aria-hidden=\"true\"\n // Fills the circle so the glyph's own ring IS the trigger's\n // visible edge and the drop shadow hugs it.\n className={size === 'sm' ? 'ds:size-5' : 'ds:size-6'}\n />\n </Popover.Trigger>\n <Popover.Content\n side={side}\n align={align}\n size={size === 'sm' ? 'sm' : 'md'}\n // The card is a Radix `role=\"dialog\"` surface, which axe requires\n // to have an accessible name (aria-dialog-name). With a heading,\n // Popover wires aria-labelledby; without one, fall back to the\n // trigger's label.\n aria-label={heading == null ? ariaLabel : undefined}\n // Toggletip focus contract: the card is explanatory text, never\n // interactive, so focus stays on the trigger for the whole\n // open/close cycle. Preventing the open move also keeps Escape\n // reliable — if Radix pulled focus into the card, closing would\n // refocus the trigger and re-fire the hover-mode focus handler,\n // reopening the card it just closed. Preventing the close move\n // keeps an unhover-close from stealing focus mid-task.\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n >\n {heading != null && <Popover.Heading>{heading}</Popover.Heading>}\n <Popover.Description>{content}</Popover.Description>\n </Popover.Content>\n </Popover>\n );\n },\n);\n\nInfoTip.displayName = 'InfoTip';\n"],"names":["infoTipAgent","handle","infoTipTriggerVariants","cva","InfoTip","forwardRef","content","heading","size","side","align","ariaLabelProp","id","className","ref","t","useTranslation","open","setOpen","useState","openRef","useRef","useEffect","agentHandle","useMemo","useAgentRegistration","pressStateRef","handlePressStart","ariaLabel","Popover","jsx","event","wasOpenAtPressStart","Info","jsxs"],"mappings":";;;;;;;AAGO,MAAMA,IAA4C;AAAA,EACvD,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,OAAO;AAAA,EAC9B,OAAO;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AM,eAAA;AAAA,UAEV;AAAA,UAEA,UAAA,gBAAAD;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cAGZ,WAAWzB,MAAS,OAAO,cAAc;AAAA,YAAA;AAAA,UAAA;AAAA,QAC3C;AAAA,MAAA;AAAA,MAEF,gBAAA0B;AAAA,QAACL,EAAQ;AAAA,QAAR;AAAA,UACC,MAAApB;AAAA,UACA,OAAAC;AAAA,UACA,MAAMF,MAAS,OAAO,OAAO;AAAA,UAK7B,cAAYD,KAAW,OAAOqB,IAAY;AAAA,UAQ1C,iBAAiB,CAACG,MAAUA,EAAM,eAAA;AAAA,UAClC,kBAAkB,CAACA,MAAUA,EAAM,eAAA;AAAA,UAElC,UAAA;AAAA,YAAAxB,KAAW,QAAQ,gBAAAuB,EAACD,EAAQ,SAAR,EAAiB,UAAAtB,GAAQ;AAAA,YAC9C,gBAAAuB,EAACD,EAAQ,aAAR,EAAqB,UAAAvB,EAAA,CAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAChC,GACF;AAAA,EAEJ;AACF;AAEAF,EAAQ,cAAc;"}
|
|
1
|
+
{"version":3,"file":"info-tip-C119cwQl.js","sources":["../../src/components/info-tip/info-tip.agent.ts","../../src/components/info-tip/info-tip.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { InfoTipHandle } from './info-tip';\n\nexport const infoTipAgent: AgentAdapter<InfoTipHandle> = {\n id: 'info-tip',\n capabilities: ['open', 'close'],\n state: {\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.infoTip.state.isOpen',\n description: 'True when the info tip card is currently open.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.infoTip.actions.open',\n description: 'Open the info tip card.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.infoTip.actions.close',\n description: 'Close the info tip card.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'info-tip',\n description: 'Marks the InfoTip trigger button.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop on InfoTip.',\n },\n },\n};\n","import {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Info } from 'lucide-react';\nimport { Popover } from '../popover';\nimport { useAgentRegistration } from '../../agent';\nimport { infoTipAgent } from './info-tip.agent';\n\n/* -------------------------------------------------------------------- */\n/* Trigger — a small circular, branded affordance: card surface inside */\n/* the circle, accent ring + accent \"i\" glyph, and a soft drop shadow. */\n/* The accent alias is safe here: `--accent` resolves to magenta-700 in */\n/* light mode (the AA-safe interactive step) and the dark accent on dark */\n/* surfaces — never reference a raw magenta ramp step. */\n/* -------------------------------------------------------------------- */\n\nconst infoTipTriggerVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[var(--card)]',\n 'ds:text-[var(--accent)]',\n // Single ring: the Lucide Info glyph draws its own accent circle, so the\n // trigger carries NO CSS border of its own (a border would read as a\n // second, concentric ring). The white circle comes from `bg-card` showing\n // through the glyph, lifted by the drop shadow.\n 'ds:shadow-[var(--shadow-sm)]',\n 'ds:cursor-pointer',\n 'ds:transition-[color,box-shadow] ds:motion-reduce:transition-none',\n 'ds:hover:text-[var(--accent-hover)] ds:hover:shadow-[var(--shadow-md)]',\n 'ds:data-[state=open]:text-[var(--accent-hover)] ds:data-[state=open]:shadow-[var(--shadow-md)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n // Both diameters sit below `--min-target-size` (44/48px), so each\n // re-uses IconButton's invisible `::before` hit-area expansion to a\n // full touch target on touch / small screens. From the `sm:`\n // breakpoint up the pointer is precise, so the expansion relaxes —\n // but the interactive target must never fall below WCAG 2.5.8's 24px:\n // • md (24px visual) already meets the 24px floor, so its `::before`\n // is hidden on desktop and the 24px circle IS the target.\n // • sm (20px visual) would fall to 20px if hidden — below the floor\n // — so instead of hiding, its `::before` shrinks to a persistent\n // `--spacing-lg` (24px) minimum that holds on desktop too.\n sm: 'ds:w-5 ds:h-5 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:inset-x-[calc((var(--spacing-lg)-100%)/-2)] ds:sm:before:inset-y-[calc((var(--spacing-lg)-100%)/-2)]',\n md: 'ds:w-6 ds:h-6 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n// Curated agent-readiness handle — see info-tip.agent.ts.\nexport interface InfoTipHandle {\n getIsOpen: () => boolean;\n open: () => void;\n close: () => void;\n}\n\nexport interface InfoTipProps {\n /** Body of the tip — explanatory text shown in the floating card. */\n content: ReactNode;\n /** Optional heading rendered above the body. */\n heading?: ReactNode;\n /**\n * Trigger diameter. Also maps the floating card width:\n * `sm` → `--popover-size-sm`, `md` → `--popover-size-md`.\n */\n size?: 'sm' | 'md';\n /** Logical side the card opens on. Default `'top'`. */\n side?: 'start' | 'top' | 'end' | 'bottom';\n /** Alignment along the side axis. Default `'center'`. */\n align?: 'start' | 'center' | 'end';\n /**\n * Accessible name for the trigger. Defaults to the translated\n * \"More information\" chrome string.\n */\n 'aria-label'?: string;\n /**\n * Opaque instance id — emitted as `data-component-id` on the trigger and\n * used to register the instance with the host agent registry.\n */\n id?: string;\n /** Extra classes merged onto the trigger button. */\n className?: string;\n}\n\n/**\n * InfoTip — a deliberate, branded \"more information\" affordance: a small\n * circular trigger that reveals an explanatory card on hover **and** click\n * (click also serves touch devices). Composes the kit Popover in\n * `openOn=\"hover-or-click\"` mode — hover intent, keyboard focus, Escape and\n * focus-return are all handled by the Popover/Radix layer.\n */\nexport const InfoTip = forwardRef<HTMLButtonElement, InfoTipProps>(\n (\n {\n content,\n heading,\n size = 'md',\n side = 'top',\n align = 'center',\n 'aria-label': ariaLabelProp,\n id,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n\n // Agent handle.\n const openRef = useRef(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const agentHandle = useMemo<InfoTipHandle>(\n () => ({\n getIsOpen: () => openRef.current,\n open: () => setOpen(true),\n close: () => setOpen(false),\n }),\n [],\n );\n useAgentRegistration(infoTipAgent, agentHandle, id);\n\n // Press bookkeeping. In hover-or-click mode the Popover opens as soon as\n // the trigger receives focus — which happens on pointerdown, BEFORE the\n // click event that Radix uses to toggle. Without intervention every\n // click/tap on a closed tip opens it (focus) and instantly toggles it\n // closed again (click). So each press (pointerdown, or Enter/Space)\n // snapshots the open state and the click handler consumes it: if the\n // press itself opened the card, swallow Radix's toggle so the card stays\n // open; if it was already open, let the toggle close it.\n //\n // `null` means \"no press recorded for this click\" — an orphan click\n // (programmatic .click(), or assistive tech dispatching click with no\n // pointer/key event). Those must fall through to Radix's default toggle\n // rather than read a stale snapshot, so the guard treats `null` as\n // \"don't suppress\" and every click clears the snapshot back to `null`.\n const pressStateRef = useRef<boolean | null>(null);\n const handlePressStart = () => {\n pressStateRef.current = openRef.current;\n };\n\n const ariaLabel =\n ariaLabelProp ?? t('infoTip.triggerLabel', 'More information');\n\n return (\n <Popover openOn=\"hover-or-click\" open={open} onOpenChange={setOpen}>\n <Popover.Trigger\n ref={ref}\n aria-label={ariaLabel}\n className={infoTipTriggerVariants({ size, className })}\n data-component=\"info-tip\"\n data-component-id={id}\n onPointerDown={handlePressStart}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n handlePressStart();\n }\n }}\n onClick={(event) => {\n // Consume this click's press snapshot. A genuine pointer/keyboard\n // press recorded `false`/`true` on press-start; an orphan click\n // with no preceding pointerdown/keydown finds `null` and is left\n // to Radix's default toggle.\n const wasOpenAtPressStart = pressStateRef.current;\n pressStateRef.current = null;\n if (wasOpenAtPressStart === false && openRef.current) {\n // This press opened the card via focus — keep it open and\n // skip Radix's click toggle.\n event.preventDefault();\n }\n }}\n >\n <Info\n aria-hidden=\"true\"\n // Fills the circle so the glyph's own ring IS the trigger's\n // visible edge and the drop shadow hugs it.\n className={size === 'sm' ? 'ds:size-5' : 'ds:size-6'}\n />\n </Popover.Trigger>\n <Popover.Content\n side={side}\n align={align}\n size={size === 'sm' ? 'sm' : 'md'}\n // The card is a Radix `role=\"dialog\"` surface, which axe requires\n // to have an accessible name (aria-dialog-name). With a heading,\n // Popover wires aria-labelledby; without one, fall back to the\n // trigger's label.\n aria-label={heading == null ? ariaLabel : undefined}\n // Toggletip focus contract: the card is explanatory text, never\n // interactive, so focus stays on the trigger for the whole\n // open/close cycle. Preventing the open move also keeps Escape\n // reliable — if Radix pulled focus into the card, closing would\n // refocus the trigger and re-fire the hover-mode focus handler,\n // reopening the card it just closed. Preventing the close move\n // keeps an unhover-close from stealing focus mid-task.\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n >\n {heading != null && <Popover.Heading>{heading}</Popover.Heading>}\n <Popover.Description>{content}</Popover.Description>\n </Popover.Content>\n </Popover>\n );\n },\n);\n\nInfoTip.displayName = 'InfoTip';\n"],"names":["infoTipAgent","handle","infoTipTriggerVariants","cva","InfoTip","forwardRef","content","heading","size","side","align","ariaLabelProp","id","className","ref","t","useTranslation","open","setOpen","useState","openRef","useRef","useEffect","agentHandle","useMemo","useAgentRegistration","pressStateRef","handlePressStart","ariaLabel","Popover","jsx","event","wasOpenAtPressStart","Info","jsxs"],"mappings":";;;;;;;AAGO,MAAMA,IAA4C;AAAA,EACvD,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,OAAO;AAAA,EAC9B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,KAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,MAAA;AAAA,MACT;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCvBMC,IAAyBC;AAAA,EAC7B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWJ,IA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AU;AACpB,aAAIA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,QACzCJ,EAAA;AAAA,UAEJ;AAAA,UACA,SAAS,CAACI,MAAU;AAKlB,kBAAMC,IAAsBN,EAAc;AAC1C,YAAAA,EAAc,UAAU,MACpBM,MAAwB,MAASZ,EAAQ,WAG3CW,EAAM,eAAA;AAAA,UAEV;AAAA,UAEA,UAAA,gBAAAD;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cAGZ,WAAWzB,MAAS,OAAO,cAAc;AAAA,YAAA;AAAA,UAAA;AAAA,QAC3C;AAAA,MAAA;AAAA,MAEF,gBAAA0B;AAAA,QAACL,EAAQ;AAAA,QAAR;AAAA,UACC,MAAApB;AAAA,UACA,OAAAC;AAAA,UACA,MAAMF,MAAS,OAAO,OAAO;AAAA,UAK7B,cAAYD,KAAW,OAAOqB,IAAY;AAAA,UAQ1C,iBAAiB,CAACG,MAAUA,EAAM,eAAA;AAAA,UAClC,kBAAkB,CAACA,MAAUA,EAAM,eAAA;AAAA,UAElC,UAAA;AAAA,YAAAxB,KAAW,QAAQ,gBAAAuB,EAACD,EAAQ,SAAR,EAAiB,UAAAtB,GAAQ;AAAA,YAC9C,gBAAAuB,EAACD,EAAQ,aAAR,EAAqB,UAAAvB,EAAA,CAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAChC,GACF;AAAA,EAEJ;AACF;AAEAF,EAAQ,cAAc;"}
|
|
@@ -2,7 +2,7 @@ import { jsxs as P, jsx as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as ht, useRef as St } from "react";
|
|
3
3
|
import { useTranslation as Dt } from "react-i18next";
|
|
4
4
|
import { c as Nt } from "./index-D2ZczOXr.js";
|
|
5
|
-
import { B as Gt } from "./button-
|
|
5
|
+
import { B as Gt } from "./button-nJaPh_HC.js";
|
|
6
6
|
import { L as Ht } from "./layers-DcAENmsZ.js";
|
|
7
7
|
import { I as Rt } from "./image-B_5MNK0x.js";
|
|
8
8
|
import { T as Pt } from "./type-ggmfVs23.js";
|
|
@@ -729,4 +729,4 @@ export {
|
|
|
729
729
|
En as b,
|
|
730
730
|
Yt as s
|
|
731
731
|
};
|
|
732
|
-
//# sourceMappingURL=insert-result-
|
|
732
|
+
//# sourceMappingURL=insert-result-LCNTskNJ.js.map
|