@alfadocs/ui-kit-debug 1.56.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{address-fields-BfjxS05Z.js → address-fields-CJtu7LQU.js} +2 -2
- package/dist/_chunks/{address-fields-BfjxS05Z.js.map → address-fields-CJtu7LQU.js.map} +1 -1
- package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js → ai-credits-notice-ktklr8fy.js} +2 -2
- package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js.map → ai-credits-notice-ktklr8fy.js.map} +1 -1
- package/dist/_chunks/ai-permission-notice-DyuEGwAt.js +206 -0
- package/dist/_chunks/ai-permission-notice-DyuEGwAt.js.map +1 -0
- package/dist/_chunks/alia-sidebar-dybRpWml.js +1284 -0
- package/dist/_chunks/alia-sidebar-dybRpWml.js.map +1 -0
- package/dist/_chunks/{anamnesis-summary-rows-CQ-XGr0T.js → anamnesis-summary-rows-M-FUkw9p.js} +6 -6
- package/dist/_chunks/{anamnesis-summary-rows-CQ-XGr0T.js.map → anamnesis-summary-rows-M-FUkw9p.js.map} +1 -1
- package/dist/_chunks/{app-frame-B-0O9CrU.js → app-frame-CqmDh2v5.js} +2 -2
- package/dist/_chunks/{app-frame-B-0O9CrU.js.map → app-frame-CqmDh2v5.js.map} +1 -1
- package/dist/_chunks/{appointment-peek-BIZaDeCi.js → appointment-peek-WvNbE4JG.js} +2 -2
- package/dist/_chunks/{appointment-peek-BIZaDeCi.js.map → appointment-peek-WvNbE4JG.js.map} +1 -1
- package/dist/_chunks/{appointment-timeline-DmqYEIT9.js → appointment-timeline-Z0494xO-.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DmqYEIT9.js.map → appointment-timeline-Z0494xO-.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-DmDcXw0c.js → balance-badge-cell-CGoJZlKf.js} +3 -3
- package/dist/_chunks/{balance-badge-cell-DmDcXw0c.js.map → balance-badge-cell-CGoJZlKf.js.map} +1 -1
- package/dist/_chunks/{booking-WyNGKPE2.js → booking-CiFSAMR-.js} +4 -4
- package/dist/_chunks/{booking-WyNGKPE2.js.map → booking-CiFSAMR-.js.map} +1 -1
- package/dist/_chunks/{calculator-dialog-pCPWta7h.js → calculator-dialog-CzQv03p0.js} +2 -2
- package/dist/_chunks/{calculator-dialog-pCPWta7h.js.map → calculator-dialog-CzQv03p0.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-Du2ryaI-.js → calendar-workspace-DNHzjG7O.js} +19 -19
- package/dist/_chunks/calendar-workspace-DNHzjG7O.js.map +1 -0
- package/dist/_chunks/{care-plan-card-Ddjh5Doc.js → care-plan-card-DxrRLRdW.js} +2 -2
- package/dist/_chunks/{care-plan-card-Ddjh5Doc.js.map → care-plan-card-DxrRLRdW.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-DUX_SVvF.js → care-plan-header-BMwZIgHJ.js} +2 -2
- package/dist/_chunks/{care-plan-header-DUX_SVvF.js.map → care-plan-header-BMwZIgHJ.js.map} +1 -1
- package/dist/_chunks/{chart-HsF1KHbx.js → chart-ZMkX-Gqy.js} +338 -341
- package/dist/_chunks/chart-ZMkX-Gqy.js.map +1 -0
- package/dist/_chunks/{city-input-BC_nYINn.js → city-input-3J3bz9EO.js} +2 -2
- package/dist/_chunks/{city-input-BC_nYINn.js.map → city-input-3J3bz9EO.js.map} +1 -1
- package/dist/_chunks/{clinical-note-card-14JIoUR0.js → clinical-note-card-hx939bvw.js} +2 -2
- package/dist/_chunks/{clinical-note-card-14JIoUR0.js.map → clinical-note-card-hx939bvw.js.map} +1 -1
- package/dist/_chunks/{color-picker-BRQ4Y9SO.js → color-picker-BsggJovx.js} +128 -123
- package/dist/_chunks/color-picker-BsggJovx.js.map +1 -0
- package/dist/_chunks/{contact-card-CmK05vNb.js → contact-card-fHBMwEsx.js} +2 -2
- package/dist/_chunks/{contact-card-CmK05vNb.js.map → contact-card-fHBMwEsx.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-Ci8lBQ6a.js → contact-profile-card-CMyBYgRR.js} +2 -2
- package/dist/_chunks/{contact-profile-card-Ci8lBQ6a.js.map → contact-profile-card-CMyBYgRR.js.map} +1 -1
- package/dist/_chunks/{control-room-rail-Tx2jW250.js → control-room-rail-CJ85HkS2.js} +2 -2
- package/dist/_chunks/{control-room-rail-Tx2jW250.js.map → control-room-rail-CJ85HkS2.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js → cycle-calculator-Cww9DzIa.js} +2 -2
- package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js.map → cycle-calculator-Cww9DzIa.js.map} +1 -1
- package/dist/_chunks/dashboard-grid-Cs7cJAsA.js +933 -0
- package/dist/_chunks/dashboard-grid-Cs7cJAsA.js.map +1 -0
- package/dist/_chunks/{data-table-D8fuhqO1.js → data-table-Yn5xiGzs.js} +3 -3
- package/dist/_chunks/{data-table-D8fuhqO1.js.map → data-table-Yn5xiGzs.js.map} +1 -1
- package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js → data-table-tabs-CHYAAeHy.js} +2 -2
- package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js.map → data-table-tabs-CHYAAeHy.js.map} +1 -1
- package/dist/_chunks/{date-picker-wRAcq2lt.js → date-picker-BSZuKo13.js} +69 -62
- package/dist/_chunks/date-picker-BSZuKo13.js.map +1 -0
- package/dist/_chunks/{date-range-picker-CtUOI38x.js → date-range-picker-CFk-5O3R.js} +176 -171
- package/dist/_chunks/date-range-picker-CFk-5O3R.js.map +1 -0
- package/dist/_chunks/{date-time-picker-CLeLKuv9.js → date-time-picker-CjxTkblD.js} +92 -85
- package/dist/_chunks/date-time-picker-CjxTkblD.js.map +1 -0
- package/dist/_chunks/{dialog-CUzbnKLw.js → dialog-Dn-iQ0Jp.js} +2 -2
- package/dist/_chunks/{dialog-CUzbnKLw.js.map → dialog-Dn-iQ0Jp.js.map} +1 -1
- package/dist/_chunks/{document-preview-uoTekVR7.js → document-preview-CHGGG0l_.js} +2 -2
- package/dist/_chunks/{document-preview-uoTekVR7.js.map → document-preview-CHGGG0l_.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-CSjklbyw.js → due-date-calculator-D_qFUiHp.js} +2 -2
- package/dist/_chunks/{due-date-calculator-CSjklbyw.js.map → due-date-calculator-D_qFUiHp.js.map} +1 -1
- package/dist/_chunks/{entity-summary-DcB0fIiv.js → entity-summary-CWcCSThK.js} +2 -2
- package/dist/_chunks/{entity-summary-DcB0fIiv.js.map → entity-summary-CWcCSThK.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BicuUA2K.js → face-scheme-DSKDdIsb.js} +2 -2
- package/dist/_chunks/{face-scheme-BicuUA2K.js.map → face-scheme-DSKDdIsb.js.map} +1 -1
- package/dist/_chunks/{file-manager-Cc_uO8r2.js → file-manager-DEtkQR1F.js} +4 -4
- package/dist/_chunks/{file-manager-Cc_uO8r2.js.map → file-manager-DEtkQR1F.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-DEx-M_QR.js → forgot-password-form-CEqOmNuX.js} +2 -2
- package/dist/_chunks/{forgot-password-form-DEx-M_QR.js.map → forgot-password-form-CEqOmNuX.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-DqVeJke2.js → gestational-age-calculator-CZi43xKG.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-DqVeJke2.js.map → gestational-age-calculator-CZi43xKG.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js → hcg-doubling-Ccvh7OaU.js} +2 -2
- package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js.map → hcg-doubling-Ccvh7OaU.js.map} +1 -1
- package/dist/_chunks/{header-settings-ge_3gYEq.js → header-settings-BMcCx2LC.js} +2 -2
- package/dist/_chunks/{header-settings-ge_3gYEq.js.map → header-settings-BMcCx2LC.js.map} +1 -1
- package/dist/_chunks/{heatmap-Gf9r7Tn1.js → heatmap-DiyOSQk9.js} +2 -2
- package/dist/_chunks/{heatmap-Gf9r7Tn1.js.map → heatmap-DiyOSQk9.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-fV-Apf72.js → help-me-write-templates-CM1p6qkm.js} +3 -3
- package/dist/_chunks/{help-me-write-templates-fV-Apf72.js.map → help-me-write-templates-CM1p6qkm.js.map} +1 -1
- package/dist/_chunks/{hover-card-BnTueNS2.js → hover-card-U_ZYoh1n.js} +201 -187
- package/dist/_chunks/hover-card-U_ZYoh1n.js.map +1 -0
- package/dist/_chunks/{icon-picker-DWrqmI1c.js → icon-picker-rOFTawXk.js} +3 -3
- package/dist/_chunks/{icon-picker-DWrqmI1c.js.map → icon-picker-rOFTawXk.js.map} +1 -1
- package/dist/_chunks/{info-tip-B0jmIt6M.js → info-tip-CJpNpzZe.js} +2 -2
- package/dist/_chunks/{info-tip-B0jmIt6M.js.map → info-tip-CJpNpzZe.js.map} +1 -1
- package/dist/_chunks/{kit-extensions-Byfxy6sy.js → kit-extensions-DYVxWcqv.js} +4 -4
- package/dist/_chunks/{kit-extensions-Byfxy6sy.js.map → kit-extensions-DYVxWcqv.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-TeJNvymP.js → link-cell-renderer-C1wOyxDF.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-TeJNvymP.js.map → link-cell-renderer-C1wOyxDF.js.map} +1 -1
- package/dist/_chunks/link-gRw3NtOt.js +137 -0
- package/dist/_chunks/link-gRw3NtOt.js.map +1 -0
- package/dist/_chunks/{list-RRN2TJ_7.js → list-CNnn7DOD.js} +75 -73
- package/dist/_chunks/list-CNnn7DOD.js.map +1 -0
- package/dist/_chunks/{locale-picker-DfNSdOpy.js → locale-picker-BGfrZyTw.js} +2 -2
- package/dist/_chunks/{locale-picker-DfNSdOpy.js.map → locale-picker-BGfrZyTw.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-DmZ1B0lB.js → login-dev-card-CIim81VB.js} +2 -2
- package/dist/_chunks/{login-dev-card-DmZ1B0lB.js.map → login-dev-card-CIim81VB.js.map} +1 -1
- package/dist/_chunks/marketplace-app-shell-CSDmGLPW.js +613 -0
- package/dist/_chunks/marketplace-app-shell-CSDmGLPW.js.map +1 -0
- package/dist/_chunks/{message-tray-BB95DA82.js → message-tray-DmU0poD7.js} +76 -69
- package/dist/_chunks/message-tray-DmU0poD7.js.map +1 -0
- package/dist/_chunks/{nav-grid-BqCPH8sm.js → nav-grid-Byx8PxuB.js} +2 -2
- package/dist/_chunks/{nav-grid-BqCPH8sm.js.map → nav-grid-Byx8PxuB.js.map} +1 -1
- package/dist/_chunks/navigation-dismiss-B1mcW1CT.js +9 -0
- package/dist/_chunks/navigation-dismiss-B1mcW1CT.js.map +1 -0
- package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js +89 -0
- package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js.map +1 -0
- package/dist/_chunks/{note-attachment-I1NLoeRZ.js → note-attachment-Bt2cddsZ.js} +2 -2
- package/dist/_chunks/{note-attachment-I1NLoeRZ.js.map → note-attachment-Bt2cddsZ.js.map} +1 -1
- package/dist/_chunks/{note-timeline-CsY8YOE7.js → note-timeline-CX9nAgAR.js} +2 -2
- package/dist/_chunks/{note-timeline-CsY8YOE7.js.map → note-timeline-CX9nAgAR.js.map} +1 -1
- package/dist/_chunks/{notes-panel-DceRhthG.js → notes-panel-DHLHsxpW.js} +4 -4
- package/dist/_chunks/{notes-panel-DceRhthG.js.map → notes-panel-DHLHsxpW.js.map} +1 -1
- package/dist/_chunks/{notification-tray-__sJXnsz.js → notification-tray-DPU-Xg0i.js} +83 -76
- package/dist/_chunks/notification-tray-DPU-Xg0i.js.map +1 -0
- package/dist/_chunks/{panel-subview-BT-Apwgb.js → panel-subview-D4o6ar6_.js} +61 -47
- package/dist/_chunks/panel-subview-D4o6ar6_.js.map +1 -0
- package/dist/_chunks/{patient-details-DsTtjpuX.js → patient-details-BCaVuaXz.js} +2 -2
- package/dist/_chunks/{patient-details-DsTtjpuX.js.map → patient-details-BCaVuaXz.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BvZ9luz-.js → patient-field-row-jcRSTrp4.js} +7 -7
- package/dist/_chunks/{patient-field-row-BvZ9luz-.js.map → patient-field-row-jcRSTrp4.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-9nQWTQf6.js → patient-summary-card-kQIfPQOE.js} +4 -4
- package/dist/_chunks/{patient-summary-card-9nQWTQf6.js.map → patient-summary-card-kQIfPQOE.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-DiHovmUL.js → payment-automation-upsell-C4wHOxsp.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-DiHovmUL.js.map → payment-automation-upsell-C4wHOxsp.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-CwDpwXUC.js → payment-request-card-DAniJNLX.js} +2 -2
- package/dist/_chunks/{payment-request-card-CwDpwXUC.js.map → payment-request-card-DAniJNLX.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-C3minW5b.js → pdf-viewer-CNQxa4tv.js} +396 -391
- package/dist/_chunks/pdf-viewer-CNQxa4tv.js.map +1 -0
- package/dist/_chunks/{phone-input-DxkHMYmu.js → phone-input-O9camxkq.js} +156 -151
- package/dist/_chunks/phone-input-O9camxkq.js.map +1 -0
- package/dist/_chunks/popover-BG75rYjN.js +367 -0
- package/dist/_chunks/popover-BG75rYjN.js.map +1 -0
- package/dist/_chunks/{practice-results-Dhbo-fc_.js → practice-results-D07wgCqV.js} +2 -2
- package/dist/_chunks/{practice-results-Dhbo-fc_.js.map → practice-results-D07wgCqV.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-Bfu0Cq4H.js → pregnancy-dating-BFzv9g1N.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-Bfu0Cq4H.js.map → pregnancy-dating-BFzv9g1N.js.map} +1 -1
- package/dist/_chunks/{product-hub-panel-BSSiGGG4.js → product-hub-panel-DCYX0rPG.js} +103 -96
- package/dist/_chunks/product-hub-panel-DCYX0rPG.js.map +1 -0
- package/dist/_chunks/{public-footer-CxpG6J1M.js → public-footer-ZWTEG1Rq.js} +2 -2
- package/dist/_chunks/{public-footer-CxpG6J1M.js.map → public-footer-ZWTEG1Rq.js.map} +1 -1
- package/dist/_chunks/{public-header.agent-pr2hyiND.js → public-header.agent-C1SlVSYt.js} +2 -2
- package/dist/_chunks/{public-header.agent-pr2hyiND.js.map → public-header.agent-C1SlVSYt.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-DkUokbEa.js → radiograph-panel.agent-DyqbTECc.js} +4 -4
- package/dist/_chunks/{radiograph-panel.agent-DkUokbEa.js.map → radiograph-panel.agent-DyqbTECc.js.map} +1 -1
- package/dist/_chunks/{registration-form-D7iNqMBF.js → registration-form-DrSR9Sjk.js} +4 -4
- package/dist/_chunks/{registration-form-D7iNqMBF.js.map → registration-form-DrSR9Sjk.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-CkFfmA3v.js → rich-text-editor-UgXri8h6.js} +490 -485
- package/dist/_chunks/rich-text-editor-UgXri8h6.js.map +1 -0
- package/dist/_chunks/{scroll-area-ZtFCv9K7.js → scroll-area-CY5SLYNw.js} +104 -74
- package/dist/_chunks/scroll-area-CY5SLYNw.js.map +1 -0
- package/dist/_chunks/{search-bar-DQJS0wJN.js → search-bar-mA4bPe3t.js} +294 -255
- package/dist/_chunks/search-bar-mA4bPe3t.js.map +1 -0
- package/dist/_chunks/{sheet-C7SwIxwB.js → sheet-Dtjk0CVv.js} +3 -3
- package/dist/_chunks/{sheet-C7SwIxwB.js.map → sheet-Dtjk0CVv.js.map} +1 -1
- package/dist/_chunks/sidebar-D4Wllqfz.js +2029 -0
- package/dist/_chunks/sidebar-D4Wllqfz.js.map +1 -0
- package/dist/_chunks/{sign-document-B6HlyCGV.js → sign-document-D4iHS_Ug.js} +2 -2
- package/dist/_chunks/{sign-document-B6HlyCGV.js.map → sign-document-D4iHS_Ug.js.map} +1 -1
- package/dist/_chunks/{signature-request-DhbpB9N9.js → signature-request-dAVgE0_5.js} +3 -3
- package/dist/_chunks/{signature-request-DhbpB9N9.js.map → signature-request-dAVgE0_5.js.map} +1 -1
- package/dist/_chunks/{signed-out-frame-B2GTIeqA.js → signed-out-frame-DOJpobp8.js} +3 -3
- package/dist/_chunks/{signed-out-frame-B2GTIeqA.js.map → signed-out-frame-DOJpobp8.js.map} +1 -1
- package/dist/_chunks/{state-backed-text-input-DECQy5aA.js → state-backed-text-input-Cgh4ms3p.js} +2 -2
- package/dist/_chunks/{state-backed-text-input-DECQy5aA.js.map → state-backed-text-input-Cgh4ms3p.js.map} +1 -1
- package/dist/_chunks/{task-editor-ByyRu29Y.js → task-editor-BflEZmcF.js} +7 -6
- package/dist/_chunks/task-editor-BflEZmcF.js.map +1 -0
- package/dist/_chunks/{tool-rail-Bwyuw_Ot.js → tool-rail-CTq1KwxW.js} +115 -114
- package/dist/_chunks/{tool-rail-Bwyuw_Ot.js.map → tool-rail-CTq1KwxW.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-JsDM48tf.js → use-appointment-details-read-izwoXh-G.js} +8 -8
- package/dist/_chunks/{use-appointment-details-read-JsDM48tf.js.map → use-appointment-details-read-izwoXh-G.js.map} +1 -1
- package/dist/_chunks/use-state-backed-input-DhRQo6gM.js +57 -0
- package/dist/_chunks/use-state-backed-input-DhRQo6gM.js.map +1 -0
- package/dist/_chunks/{voice-control-panel-Bg1eklL0.js → voice-control-panel-an-bpQfF.js} +3 -3
- package/dist/_chunks/{voice-control-panel-Bg1eklL0.js.map → voice-control-panel-an-bpQfF.js.map} +1 -1
- package/dist/_chunks/{widget-picker-DXYBMTfe.js → widget-picker-DlJOgYrZ.js} +80 -57
- package/dist/_chunks/widget-picker-DlJOgYrZ.js.map +1 -0
- package/dist/agent-catalog.json +3 -3
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/_shared/navigation-dismiss.d.ts +8 -0
- package/dist/components/_shared/navigation-dismiss.d.ts.map +1 -0
- package/dist/components/_shared/non-modal-tab-exit.d.ts +15 -4
- package/dist/components/_shared/non-modal-tab-exit.d.ts.map +1 -1
- package/dist/components/_shared/use-state-backed-input.d.ts +3 -2
- package/dist/components/_shared/use-state-backed-input.d.ts.map +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-credits-notice/index.js +1 -1
- package/dist/components/ai-permission-notice/ai-permission-notice.d.ts +32 -0
- package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -1
- package/dist/components/ai-permission-notice/index.d.ts +1 -1
- package/dist/components/ai-permission-notice/index.d.ts.map +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/app-frame/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/chart/chart.d.ts +5 -5
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/contact-card/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/cycle-calculator/index.js +1 -1
- package/dist/components/dashboard-grid/dashboard-grid.d.ts +33 -8
- package/dist/components/dashboard-grid/dashboard-grid.d.ts.map +1 -1
- package/dist/components/dashboard-grid/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.d.ts.map +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/due-date-calculator/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/file-manager/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-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/info-tip/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/link.d.ts +5 -3
- package/dist/components/link/link.d.ts.map +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts.map +1 -1
- package/dist/components/nav-grid/index.js +1 -1
- package/dist/components/note-timeline/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/panel-subview/panel-subview.d.ts.map +1 -1
- package/dist/components/patient-details/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/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +1 -1
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/product-hub-tray/product-hub-tray.d.ts.map +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts +6 -5
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-bar/search-bar.d.ts +1 -1
- package/dist/components/search-bar/search-bar.d.ts.map +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.d.ts +1 -1
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/sidebar-move.d.ts +88 -0
- package/dist/components/sidebar/sidebar-move.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +26 -1
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/task-editor/task-editor.d.ts.map +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/components/widget-picker/widget-picker.d.ts.map +1 -1
- package/dist/host-compat.css +2 -1
- package/dist/i18n/locales/ar.d.ts +24 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +26 -2
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +24 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +26 -2
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +24 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +26 -2
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +24 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +26 -2
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +24 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +26 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +24 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +26 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +24 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +26 -2
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +24 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +26 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +24 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +26 -2
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +24 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +26 -2
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +24 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +26 -2
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +24 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +26 -2
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +24 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +26 -2
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +24 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +26 -2
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +24 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +26 -2
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +24 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +26 -2
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +24 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +26 -2
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +24 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +26 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +204 -203
- package/dist/locales/ar.json +26 -2
- package/dist/locales/de.json +26 -2
- package/dist/locales/el.json +26 -2
- package/dist/locales/en.json +26 -2
- package/dist/locales/es.json +26 -2
- package/dist/locales/fr.json +26 -2
- package/dist/locales/hi.json +26 -2
- package/dist/locales/it.json +26 -2
- package/dist/locales/ja.json +26 -2
- package/dist/locales/nl.json +26 -2
- package/dist/locales/pl.json +26 -2
- package/dist/locales/pt.json +26 -2
- package/dist/locales/ro.json +26 -2
- package/dist/locales/ru.json +26 -2
- package/dist/locales/sq.json +26 -2
- package/dist/locales/sv.json +26 -2
- package/dist/locales/tr.json +26 -2
- package/dist/locales/zh.json +26 -2
- package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts +10 -13
- package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/alia-chat-surface.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/alia-popout.d.ts +5 -3
- package/dist/patterns/alia-assistant/alia-popout.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/index.d.ts +2 -0
- package/dist/patterns/alia-assistant/index.d.ts.map +1 -1
- package/dist/patterns/alia-assistant/index.js +6 -5
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +40 -10
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts.map +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signed-out-frame/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/ai-permission-notice-5vpblPCx.js +0 -171
- package/dist/_chunks/ai-permission-notice-5vpblPCx.js.map +0 -1
- package/dist/_chunks/alia-sidebar-DOei4Iyu.js +0 -1183
- package/dist/_chunks/alia-sidebar-DOei4Iyu.js.map +0 -1
- package/dist/_chunks/calendar-workspace-Du2ryaI-.js.map +0 -1
- package/dist/_chunks/chart-HsF1KHbx.js.map +0 -1
- package/dist/_chunks/color-picker-BRQ4Y9SO.js.map +0 -1
- package/dist/_chunks/dashboard-grid-DfEY2qci.js +0 -844
- package/dist/_chunks/dashboard-grid-DfEY2qci.js.map +0 -1
- package/dist/_chunks/date-picker-wRAcq2lt.js.map +0 -1
- package/dist/_chunks/date-range-picker-CtUOI38x.js.map +0 -1
- package/dist/_chunks/date-time-picker-CLeLKuv9.js.map +0 -1
- package/dist/_chunks/hover-card-BnTueNS2.js.map +0 -1
- package/dist/_chunks/link-2HokYuIi.js +0 -130
- package/dist/_chunks/link-2HokYuIi.js.map +0 -1
- package/dist/_chunks/list-RRN2TJ_7.js.map +0 -1
- package/dist/_chunks/marketplace-app-shell-Dcx-JEjg.js +0 -541
- package/dist/_chunks/marketplace-app-shell-Dcx-JEjg.js.map +0 -1
- package/dist/_chunks/message-tray-BB95DA82.js.map +0 -1
- package/dist/_chunks/non-modal-tab-exit-D2Bd93Bq.js +0 -65
- package/dist/_chunks/non-modal-tab-exit-D2Bd93Bq.js.map +0 -1
- package/dist/_chunks/notification-tray-__sJXnsz.js.map +0 -1
- package/dist/_chunks/panel-subview-BT-Apwgb.js.map +0 -1
- package/dist/_chunks/pdf-viewer-C3minW5b.js.map +0 -1
- package/dist/_chunks/phone-input-DxkHMYmu.js.map +0 -1
- package/dist/_chunks/popover-BI3oV3eY.js +0 -305
- package/dist/_chunks/popover-BI3oV3eY.js.map +0 -1
- package/dist/_chunks/product-hub-panel-BSSiGGG4.js.map +0 -1
- package/dist/_chunks/rich-text-editor-CkFfmA3v.js.map +0 -1
- package/dist/_chunks/scroll-area-ZtFCv9K7.js.map +0 -1
- package/dist/_chunks/search-bar-DQJS0wJN.js.map +0 -1
- package/dist/_chunks/sidebar-DLsG2AIk.js +0 -1349
- package/dist/_chunks/sidebar-DLsG2AIk.js.map +0 -1
- package/dist/_chunks/task-editor-ByyRu29Y.js.map +0 -1
- package/dist/_chunks/use-state-backed-input-C7ESmxKB.js +0 -59
- package/dist/_chunks/use-state-backed-input-C7ESmxKB.js.map +0 -1
- package/dist/_chunks/widget-picker-DXYBMTfe.js.map +0 -1
|
@@ -5,7 +5,7 @@ import { useTranslation as K } from "react-i18next";
|
|
|
5
5
|
import { C as M } from "./country-select-DF5Bd_mn.js";
|
|
6
6
|
import { P as U } from "./province-select-Bd20Z9Br.js";
|
|
7
7
|
import { P as W } from "./postal-code-input-CfZOnIkW.js";
|
|
8
|
-
import { C as Y } from "./city-input-
|
|
8
|
+
import { C as Y } from "./city-input-3J3bz9EO.js";
|
|
9
9
|
import { T as z } from "./text-input-CaG9ApoE.js";
|
|
10
10
|
import { F as y } from "./form-field-Ani72sVY.js";
|
|
11
11
|
import { A as G } from "./address-autocomplete-bPR2mNBt.js";
|
|
@@ -295,4 +295,4 @@ export {
|
|
|
295
295
|
te as A,
|
|
296
296
|
X as a
|
|
297
297
|
};
|
|
298
|
-
//# sourceMappingURL=address-fields-
|
|
298
|
+
//# sourceMappingURL=address-fields-CJtu7LQU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-fields-BfjxS05Z.js","sources":["../../src/components/address-fields/address-fields.agent.ts","../../src/components/address-fields/address-fields.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { StructuredAddress } from '../address-autocomplete';\n\nexport interface AddressFieldsHandle {\n getValue: () => StructuredAddress;\n setValue: (value: StructuredAddress) => void;\n setField: (field: keyof StructuredAddress, value: string) => void;\n}\n\nconst ADDRESS_PROPERTIES = {\n street: { type: 'string' },\n city: { type: 'string' },\n postcode: { type: 'string' },\n province: { type: 'string', description: 'UPPERCASED province code.' },\n country: { type: 'string', description: 'ISO alpha-2, lowercased.' },\n formatted: { type: 'string' },\n} as const;\n\nexport const addressFieldsAgent: AgentAdapter<AddressFieldsHandle> = {\n id: 'address-fields',\n // `set_value` only — a structured address form sets discrete fields; it does\n // no granular in-place rich-text editing, so `edit_inline` does not apply.\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'object',\n descriptionKey: 'ui.agent.addressFields.state.value',\n description:\n 'The current structured address: { street, city, postcode, province, country, formatted }.',\n read: (handle) => handle.getValue(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: StructuredAddress }',\n argsSchema: {\n type: 'object',\n properties: {\n value: { type: 'object', properties: ADDRESS_PROPERTIES },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.addressFields.actions.setValue',\n description: 'Replace the entire address.',\n invoke: (handle, args: { value: StructuredAddress }) => {\n handle.setValue(args.value);\n },\n },\n set_field: {\n // Contact-data write (street/city/postcode/etc.), not clinical PHI —\n // consistent with PhoneInput / EmailInput / FiscalCodeInput, which all\n // treat identifying contact data as `write`.\n safety: 'write',\n argsType:\n \"{ field: 'street' | 'city' | 'postcode' | 'province' | 'country'; value: string }\",\n argsSchema: {\n type: 'object',\n properties: {\n field: {\n type: 'string',\n enum: ['street', 'city', 'postcode', 'province', 'country'],\n },\n value: { type: 'string' },\n },\n required: ['field', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.addressFields.actions.setField',\n description:\n 'Set a single address field. Setting `country` also clears the now-stale province.',\n examples: [\n {\n args: { field: 'country', value: 'it' },\n note: 'Set the country to Italy.',\n },\n ],\n invoke: (\n handle,\n args: { field: keyof StructuredAddress; value: string },\n ) => {\n handle.setField(args.field, args.value);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'address-fields' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n type ChangeEvent,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CountrySelect } from '../country-select/country-select';\nimport { ProvinceSelect } from '../province-select/province-select';\nimport { PostalCodeInput } from '../postal-code-input/postal-code-input';\nimport { CityInput, type CityLoaderContext } from '../city-input/city-input';\nimport { TextInput } from '../text-input';\nimport { FormField } from '../form-field/form-field';\nimport {\n AddressAutocomplete,\n type GetSuggestions,\n type StructuredAddress,\n} from '../address-autocomplete';\nimport type { OptionShape } from '../_shared/option';\nimport { useAgentRegistration } from '../../agent';\nimport {\n addressFieldsAgent,\n type AddressFieldsHandle,\n} from './address-fields.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* */\n/* A shippable composite that wires the address fields together and */\n/* emits a single StructuredAddress. Country drives the rest: it re-keys */\n/* the province dataset, swaps the postcode rule, and re-orders the */\n/* fields. An optional \"find address\" bar fans an AddressAutocomplete */\n/* selection out into the individual fields. */\n/* ------------------------------------------------------------------ */\n\nexport type AddressFieldKey = 'street' | 'city' | 'postcode' | 'province';\n\nconst EMPTY_ADDRESS: StructuredAddress = {\n street: '',\n city: '',\n postcode: '',\n province: '',\n country: '',\n formatted: '',\n};\n\n// Minimal country-keyed field-order map — NOT a libaddressinput port.\n// Extend with another entry when a country needs a different order.\nconst FIELD_ORDER: Record<string, AddressFieldKey[]> = {\n it: ['street', 'postcode', 'city', 'province'],\n};\nconst DEFAULT_ORDER: AddressFieldKey[] = [\n 'street',\n 'city',\n 'postcode',\n 'province',\n];\n\n// Fields that span the full width in the grid layout.\nconst WIDE_CELLS = new Set<string>(['findbar', 'country', 'street']);\n\nconst layoutVariants = cva('', {\n variants: {\n layout: {\n stacked: 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n grid: 'ds:grid ds:grid-cols-2 ds:gap-[var(--spacing-md)]',\n },\n },\n defaultVariants: { layout: 'stacked' },\n});\n\nexport interface AddressFieldsProps {\n /** The controlled address value. */\n value?: StructuredAddress;\n /** Fires with the next full address on any field change. */\n onChange?: (next: StructuredAddress) => void;\n /**\n * Which address-line fields to render, in order. The country picker\n * always renders first. Default resolves from the selected country.\n */\n fields?: AddressFieldKey[];\n /** Async city suggestion loader, forwarded to CityInput. */\n loadCities?: (\n query: string,\n ctx: CityLoaderContext,\n ) => Promise<OptionShape[]>;\n /** Float these countries to the top of the country picker. */\n popularCountries?: string[];\n /** Enable the \"find address\" bar — provide a Places API key… */\n apiKey?: string;\n /** …or a mock/real suggestion injector (wins over apiKey, like AddressAutocomplete). */\n getSuggestions?: GetSuggestions;\n layout?: 'stacked' | 'grid';\n /** Marks fields as required: `true` for every field shown, or a list\n * of the ones that are (a province is mandatory in some countries\n * only). The host still validates. */\n required?: boolean | readonly (AddressFieldKey | 'country')[];\n /** An error message per field, shown under it. The host validates and\n * decides when to show each one. */\n errors?: Partial<Record<AddressFieldKey | 'country', string>>;\n /** Whether a field's message raises `role=\"alert\"`, per field; each\n * does unless set to `false`. Turn it off for messages shown together,\n * such as by a refused submit, so they are not all announced at once. */\n announceErrors?: Partial<Record<AddressFieldKey | 'country', boolean>>;\n disabled?: boolean;\n id?: string;\n className?: string;\n}\n\nexport const AddressFields = forwardRef<HTMLDivElement, AddressFieldsProps>(\n function AddressFields(\n {\n value,\n onChange,\n fields,\n loadCities,\n popularCountries,\n apiKey,\n getSuggestions,\n layout = 'stacked',\n required,\n errors,\n announceErrors,\n disabled,\n id,\n className,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const address = value ?? EMPTY_ADDRESS;\n const country = address.country;\n\n const valueRef = useRef(address);\n useEffect(() => {\n valueRef.current = address;\n }, [address]);\n\n const update = useCallback(\n (patch: Partial<StructuredAddress>) => {\n /* A browser fills every field in one go, faster than the host\n re-renders: each change must build on the one before it. */\n const next = { ...valueRef.current, ...patch };\n valueRef.current = next;\n onChange?.(next);\n },\n [onChange],\n );\n\n // Find-bar selection fans the looked-up address out into every field.\n const handleFind = useCallback(\n (found: StructuredAddress) =>\n onChange?.({ ...valueRef.current, ...found }),\n [onChange],\n );\n\n const agentHandle = useMemo<AddressFieldsHandle>(\n () => ({\n getValue: () => valueRef.current,\n setValue: (next) => onChange?.(next),\n setField: (field, fieldValue) => {\n const patch: Partial<StructuredAddress> = { [field]: fieldValue };\n // Mirror the UI path: changing country re-keys the stale province.\n if (field === 'country') patch.province = '';\n onChange?.({ ...valueRef.current, ...patch });\n },\n }),\n [onChange],\n );\n useAgentRegistration(addressFieldsAgent, agentHandle, id);\n\n const order =\n fields ?? FIELD_ORDER[country?.toLowerCase() ?? ''] ?? DEFAULT_ORDER;\n\n const isRequired = (key: AddressFieldKey | 'country'): boolean =>\n required === true || (Array.isArray(required) && required.includes(key));\n\n const showFindBar = Boolean(apiKey || getSuggestions);\n\n // The composite's own adapter (`address-fields`) is the agent-addressable\n // surface; the child inputs below are deliberately rendered without an\n // `id`, so they register un-scoped rather than competing for handles.\n const fieldNode = (key: AddressFieldKey | 'country'): ReactNode => {\n switch (key) {\n case 'country':\n return (\n <FormField\n label={t('inputs.addressFields.country', 'Country')}\n required={isRequired('country')}\n error={errors?.country}\n announceError={announceErrors?.country ?? true}\n >\n <CountrySelect\n // cmdk names its input itself, so the label is passed too.\n aria-label={t('inputs.addressFields.country', 'Country')}\n value={country}\n // Country drives the rest — re-key province on change.\n onValueChange={(next) =>\n update({ country: next, province: '' })\n }\n popularCountries={popularCountries}\n disabled={disabled}\n />\n </FormField>\n );\n case 'street':\n return (\n <FormField\n label={t('inputs.addressFields.street', 'Street')}\n required={isRequired('street')}\n error={errors?.street}\n announceError={announceErrors?.street ?? true}\n >\n <TextInput\n value={address.street}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n update({ street: event.target.value })\n }\n autoComplete=\"address-line1\"\n disabled={disabled}\n />\n </FormField>\n );\n case 'city':\n return (\n <FormField\n label={t('inputs.addressFields.city', 'City')}\n required={isRequired('city')}\n error={errors?.city}\n announceError={announceErrors?.city ?? true}\n >\n <CityInput\n value={address.city}\n onValueChange={(next) => update({ city: next })}\n loadCities={loadCities}\n country={country}\n province={address.province}\n disabled={disabled}\n />\n </FormField>\n );\n case 'postcode':\n return (\n <FormField\n label={t('inputs.addressFields.postcode', 'Postcode')}\n required={isRequired('postcode')}\n error={errors?.postcode}\n announceError={announceErrors?.postcode ?? true}\n >\n <PostalCodeInput\n value={address.postcode}\n onValueChange={(next) => update({ postcode: next })}\n country={country}\n disabled={disabled}\n />\n </FormField>\n );\n case 'province':\n return (\n <FormField\n label={t('inputs.addressFields.province', 'Province')}\n required={isRequired('province')}\n error={errors?.province}\n announceError={announceErrors?.province ?? true}\n >\n <ProvinceSelect\n aria-label={t('inputs.addressFields.province', 'Province')}\n value={address.province}\n onValueChange={(next) => update({ province: next })}\n country={country}\n disabled={disabled}\n />\n </FormField>\n );\n }\n };\n\n const cell = (key: string, node: ReactNode): ReactNode =>\n layout === 'grid' ? (\n <div\n key={key}\n data-address-field={key}\n className={WIDE_CELLS.has(key) ? 'ds:col-span-2' : undefined}\n >\n {node}\n </div>\n ) : (\n <div key={key} data-address-field={key}>\n {node}\n </div>\n );\n\n const children: ReactNode[] = [];\n if (showFindBar) {\n children.push(\n cell(\n 'findbar',\n <FormField label={t('inputs.addressFields.find', 'Find address')}>\n <AddressAutocomplete\n apiKey={apiKey}\n getSuggestions={getSuggestions}\n regionCodes={country ? [country] : undefined}\n disabled={disabled}\n onSelect={handleFind}\n />\n </FormField>,\n ),\n );\n }\n children.push(cell('country', fieldNode('country')));\n for (const key of order) children.push(cell(key, fieldNode(key)));\n\n return (\n <div\n ref={ref}\n data-component=\"address-fields\"\n data-component-id={id}\n className={[layoutVariants({ layout }), className]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n );\n },\n);\n\nAddressFields.displayName = 'AddressFields';\n"],"names":["ADDRESS_PROPERTIES","addressFieldsAgent","handle","args","EMPTY_ADDRESS","FIELD_ORDER","DEFAULT_ORDER","WIDE_CELLS","layoutVariants","cva","AddressFields","forwardRef","value","onChange","fields","loadCities","popularCountries","apiKey","getSuggestions","layout","required","errors","announceErrors","disabled","id","className","ref","t","useTranslation","address","country","valueRef","useRef","useEffect","update","useCallback","patch","next","handleFind","found","agentHandle","useMemo","field","fieldValue","useAgentRegistration","order","isRequired","key","showFindBar","fieldNode","jsx","FormField","CountrySelect","TextInput","event","CityInput","PostalCodeInput","ProvinceSelect","cell","node","children","AddressAutocomplete"],"mappings":";;;;;;;;;;;;AASA,MAAMA,IAAqB;AAAA,EACzB,QAAQ,EAAE,MAAM,SAAA;AAAA,EAChB,MAAM,EAAE,MAAM,SAAA;AAAA,EACd,UAAU,EAAE,MAAM,SAAA;AAAA,EAClB,UAAU,EAAE,MAAM,UAAU,aAAa,4BAAA;AAAA,EACzC,SAAS,EAA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AC,OAAA,EAAc,sBAAoBH,GAChC,eADOA,CAEV,GAGEa,IAAwB,CAAA;AAC9B,IAAIZ,KACFY,EAAS;AAAA,MACPF;AAAA,QACE;AAAA,0BACCP,GAAA,EAAU,OAAOxB,EAAE,6BAA6B,cAAc,GAC7D,UAAA,gBAAAuB;AAAA,UAACW;AAAA,UAAA;AAAA,YACC,QAAA5C;AAAA,YACA,gBAAAC;AAAA,YACA,aAAaY,IAAU,CAACA,CAAO,IAAI;AAAA,YACnC,UAAAP;AAAA,YACA,UAAUe;AAAA,UAAA;AAAA,QAAA,EACZ,CACF;AAAA,MAAA;AAAA,IACF,GAGJsB,EAAS,KAAKF,EAAK,WAAWT,EAAU,SAAS,CAAC,CAAC;AACnD,eAAWF,KAAOF,EAAO,CAAAe,EAAS,KAAKF,EAAKX,GAAKE,EAAUF,CAAG,CAAC,CAAC;AAEhE,WACE,gBAAAG;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAxB;AAAA,QACA,kBAAe;AAAA,QACf,qBAAmBF;AAAA,QACnB,WAAW,CAAChB,GAAe,EAAE,QAAAW,GAAQ,GAAGM,CAAS,EAC9C,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,QAEV,UAAAmC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEAlD,GAAc,cAAc;"}
|
|
1
|
+
{"version":3,"file":"address-fields-CJtu7LQU.js","sources":["../../src/components/address-fields/address-fields.agent.ts","../../src/components/address-fields/address-fields.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { StructuredAddress } from '../address-autocomplete';\n\nexport interface AddressFieldsHandle {\n getValue: () => StructuredAddress;\n setValue: (value: StructuredAddress) => void;\n setField: (field: keyof StructuredAddress, value: string) => void;\n}\n\nconst ADDRESS_PROPERTIES = {\n street: { type: 'string' },\n city: { type: 'string' },\n postcode: { type: 'string' },\n province: { type: 'string', description: 'UPPERCASED province code.' },\n country: { type: 'string', description: 'ISO alpha-2, lowercased.' },\n formatted: { type: 'string' },\n} as const;\n\nexport const addressFieldsAgent: AgentAdapter<AddressFieldsHandle> = {\n id: 'address-fields',\n // `set_value` only — a structured address form sets discrete fields; it does\n // no granular in-place rich-text editing, so `edit_inline` does not apply.\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'object',\n descriptionKey: 'ui.agent.addressFields.state.value',\n description:\n 'The current structured address: { street, city, postcode, province, country, formatted }.',\n read: (handle) => handle.getValue(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: StructuredAddress }',\n argsSchema: {\n type: 'object',\n properties: {\n value: { type: 'object', properties: ADDRESS_PROPERTIES },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.addressFields.actions.setValue',\n description: 'Replace the entire address.',\n invoke: (handle, args: { value: StructuredAddress }) => {\n handle.setValue(args.value);\n },\n },\n set_field: {\n // Contact-data write (street/city/postcode/etc.), not clinical PHI —\n // consistent with PhoneInput / EmailInput / FiscalCodeInput, which all\n // treat identifying contact data as `write`.\n safety: 'write',\n argsType:\n \"{ field: 'street' | 'city' | 'postcode' | 'province' | 'country'; value: string }\",\n argsSchema: {\n type: 'object',\n properties: {\n field: {\n type: 'string',\n enum: ['street', 'city', 'postcode', 'province', 'country'],\n },\n value: { type: 'string' },\n },\n required: ['field', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.addressFields.actions.setField',\n description:\n 'Set a single address field. Setting `country` also clears the now-stale province.',\n examples: [\n {\n args: { field: 'country', value: 'it' },\n note: 'Set the country to Italy.',\n },\n ],\n invoke: (\n handle,\n args: { field: keyof StructuredAddress; value: string },\n ) => {\n handle.setField(args.field, args.value);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'address-fields' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n type ChangeEvent,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CountrySelect } from '../country-select/country-select';\nimport { ProvinceSelect } from '../province-select/province-select';\nimport { PostalCodeInput } from '../postal-code-input/postal-code-input';\nimport { CityInput, type CityLoaderContext } from '../city-input/city-input';\nimport { TextInput } from '../text-input';\nimport { FormField } from '../form-field/form-field';\nimport {\n AddressAutocomplete,\n type GetSuggestions,\n type StructuredAddress,\n} from '../address-autocomplete';\nimport type { OptionShape } from '../_shared/option';\nimport { useAgentRegistration } from '../../agent';\nimport {\n addressFieldsAgent,\n type AddressFieldsHandle,\n} from './address-fields.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* */\n/* A shippable composite that wires the address fields together and */\n/* emits a single StructuredAddress. Country drives the rest: it re-keys */\n/* the province dataset, swaps the postcode rule, and re-orders the */\n/* fields. An optional \"find address\" bar fans an AddressAutocomplete */\n/* selection out into the individual fields. */\n/* ------------------------------------------------------------------ */\n\nexport type AddressFieldKey = 'street' | 'city' | 'postcode' | 'province';\n\nconst EMPTY_ADDRESS: StructuredAddress = {\n street: '',\n city: '',\n postcode: '',\n province: '',\n country: '',\n formatted: '',\n};\n\n// Minimal country-keyed field-order map — NOT a libaddressinput port.\n// Extend with another entry when a country needs a different order.\nconst FIELD_ORDER: Record<string, AddressFieldKey[]> = {\n it: ['street', 'postcode', 'city', 'province'],\n};\nconst DEFAULT_ORDER: AddressFieldKey[] = [\n 'street',\n 'city',\n 'postcode',\n 'province',\n];\n\n// Fields that span the full width in the grid layout.\nconst WIDE_CELLS = new Set<string>(['findbar', 'country', 'street']);\n\nconst layoutVariants = cva('', {\n variants: {\n layout: {\n stacked: 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n grid: 'ds:grid ds:grid-cols-2 ds:gap-[var(--spacing-md)]',\n },\n },\n defaultVariants: { layout: 'stacked' },\n});\n\nexport interface AddressFieldsProps {\n /** The controlled address value. */\n value?: StructuredAddress;\n /** Fires with the next full address on any field change. */\n onChange?: (next: StructuredAddress) => void;\n /**\n * Which address-line fields to render, in order. The country picker\n * always renders first. Default resolves from the selected country.\n */\n fields?: AddressFieldKey[];\n /** Async city suggestion loader, forwarded to CityInput. */\n loadCities?: (\n query: string,\n ctx: CityLoaderContext,\n ) => Promise<OptionShape[]>;\n /** Float these countries to the top of the country picker. */\n popularCountries?: string[];\n /** Enable the \"find address\" bar — provide a Places API key… */\n apiKey?: string;\n /** …or a mock/real suggestion injector (wins over apiKey, like AddressAutocomplete). */\n getSuggestions?: GetSuggestions;\n layout?: 'stacked' | 'grid';\n /** Marks fields as required: `true` for every field shown, or a list\n * of the ones that are (a province is mandatory in some countries\n * only). The host still validates. */\n required?: boolean | readonly (AddressFieldKey | 'country')[];\n /** An error message per field, shown under it. The host validates and\n * decides when to show each one. */\n errors?: Partial<Record<AddressFieldKey | 'country', string>>;\n /** Whether a field's message raises `role=\"alert\"`, per field; each\n * does unless set to `false`. Turn it off for messages shown together,\n * such as by a refused submit, so they are not all announced at once. */\n announceErrors?: Partial<Record<AddressFieldKey | 'country', boolean>>;\n disabled?: boolean;\n id?: string;\n className?: string;\n}\n\nexport const AddressFields = forwardRef<HTMLDivElement, AddressFieldsProps>(\n function AddressFields(\n {\n value,\n onChange,\n fields,\n loadCities,\n popularCountries,\n apiKey,\n getSuggestions,\n layout = 'stacked',\n required,\n errors,\n announceErrors,\n disabled,\n id,\n className,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const address = value ?? EMPTY_ADDRESS;\n const country = address.country;\n\n const valueRef = useRef(address);\n useEffect(() => {\n valueRef.current = address;\n }, [address]);\n\n const update = useCallback(\n (patch: Partial<StructuredAddress>) => {\n /* A browser fills every field in one go, faster than the host\n re-renders: each change must build on the one before it. */\n const next = { ...valueRef.current, ...patch };\n valueRef.current = next;\n onChange?.(next);\n },\n [onChange],\n );\n\n // Find-bar selection fans the looked-up address out into every field.\n const handleFind = useCallback(\n (found: StructuredAddress) =>\n onChange?.({ ...valueRef.current, ...found }),\n [onChange],\n );\n\n const agentHandle = useMemo<AddressFieldsHandle>(\n () => ({\n getValue: () => valueRef.current,\n setValue: (next) => onChange?.(next),\n setField: (field, fieldValue) => {\n const patch: Partial<StructuredAddress> = { [field]: fieldValue };\n // Mirror the UI path: changing country re-keys the stale province.\n if (field === 'country') patch.province = '';\n onChange?.({ ...valueRef.current, ...patch });\n },\n }),\n [onChange],\n );\n useAgentRegistration(addressFieldsAgent, agentHandle, id);\n\n const order =\n fields ?? FIELD_ORDER[country?.toLowerCase() ?? ''] ?? DEFAULT_ORDER;\n\n const isRequired = (key: AddressFieldKey | 'country'): boolean =>\n required === true || (Array.isArray(required) && required.includes(key));\n\n const showFindBar = Boolean(apiKey || getSuggestions);\n\n // The composite's own adapter (`address-fields`) is the agent-addressable\n // surface; the child inputs below are deliberately rendered without an\n // `id`, so they register un-scoped rather than competing for handles.\n const fieldNode = (key: AddressFieldKey | 'country'): ReactNode => {\n switch (key) {\n case 'country':\n return (\n <FormField\n label={t('inputs.addressFields.country', 'Country')}\n required={isRequired('country')}\n error={errors?.country}\n announceError={announceErrors?.country ?? true}\n >\n <CountrySelect\n // cmdk names its input itself, so the label is passed too.\n aria-label={t('inputs.addressFields.country', 'Country')}\n value={country}\n // Country drives the rest — re-key province on change.\n onValueChange={(next) =>\n update({ country: next, province: '' })\n }\n popularCountries={popularCountries}\n disabled={disabled}\n />\n </FormField>\n );\n case 'street':\n return (\n <FormField\n label={t('inputs.addressFields.street', 'Street')}\n required={isRequired('street')}\n error={errors?.street}\n announceError={announceErrors?.street ?? true}\n >\n <TextInput\n value={address.street}\n onChange={(event: ChangeEvent<HTMLInputElement>) =>\n update({ street: event.target.value })\n }\n autoComplete=\"address-line1\"\n disabled={disabled}\n />\n </FormField>\n );\n case 'city':\n return (\n <FormField\n label={t('inputs.addressFields.city', 'City')}\n required={isRequired('city')}\n error={errors?.city}\n announceError={announceErrors?.city ?? true}\n >\n <CityInput\n value={address.city}\n onValueChange={(next) => update({ city: next })}\n loadCities={loadCities}\n country={country}\n province={address.province}\n disabled={disabled}\n />\n </FormField>\n );\n case 'postcode':\n return (\n <FormField\n label={t('inputs.addressFields.postcode', 'Postcode')}\n required={isRequired('postcode')}\n error={errors?.postcode}\n announceError={announceErrors?.postcode ?? true}\n >\n <PostalCodeInput\n value={address.postcode}\n onValueChange={(next) => update({ postcode: next })}\n country={country}\n disabled={disabled}\n />\n </FormField>\n );\n case 'province':\n return (\n <FormField\n label={t('inputs.addressFields.province', 'Province')}\n required={isRequired('province')}\n error={errors?.province}\n announceError={announceErrors?.province ?? true}\n >\n <ProvinceSelect\n aria-label={t('inputs.addressFields.province', 'Province')}\n value={address.province}\n onValueChange={(next) => update({ province: next })}\n country={country}\n disabled={disabled}\n />\n </FormField>\n );\n }\n };\n\n const cell = (key: string, node: ReactNode): ReactNode =>\n layout === 'grid' ? (\n <div\n key={key}\n data-address-field={key}\n className={WIDE_CELLS.has(key) ? 'ds:col-span-2' : undefined}\n >\n {node}\n </div>\n ) : (\n <div key={key} data-address-field={key}>\n {node}\n </div>\n );\n\n const children: ReactNode[] = [];\n if (showFindBar) {\n children.push(\n cell(\n 'findbar',\n <FormField label={t('inputs.addressFields.find', 'Find address')}>\n <AddressAutocomplete\n apiKey={apiKey}\n getSuggestions={getSuggestions}\n regionCodes={country ? [country] : undefined}\n disabled={disabled}\n onSelect={handleFind}\n />\n </FormField>,\n ),\n );\n }\n children.push(cell('country', fieldNode('country')));\n for (const key of order) children.push(cell(key, fieldNode(key)));\n\n return (\n <div\n ref={ref}\n data-component=\"address-fields\"\n data-component-id={id}\n className={[layoutVariants({ layout }), className]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n );\n },\n);\n\nAddressFields.displayName = 'AddressFields';\n"],"names":["ADDRESS_PROPERTIES","addressFieldsAgent","handle","args","EMPTY_ADDRESS","FIELD_ORDER","DEFAULT_ORDER","WIDE_CELLS","layoutVariants","cva","AddressFields","forwardRef","value","onChange","fields","loadCities","popularCountries","apiKey","getSuggestions","layout","required","errors","announceErrors","disabled","id","className","ref","t","useTranslation","address","country","valueRef","useRef","useEffect","update","useCallback","patch","next","handleFind","found","agentHandle","useMemo","field","fieldValue","useAgentRegistration","order","isRequired","key","showFindBar","fieldNode","jsx","FormField","CountrySelect","TextInput","event","CityInput","PostalCodeInput","ProvinceSelect","cell","node","children","AddressAutocomplete"],"mappings":";;;;;;;;;;;;AASA,MAAMA,IAAqB;AAAA,EACzB,QAAQ,EAAE,MAAM,SAAA;AAAA,EAChB,MAAM,EAAE,MAAM,SAAA;AAAA,EACd,UAAU,EAAE,MAAM,SAAA;AAAA,EAClB,UAAU,EAAE,MAAM,UAAU,aAAa,4BAAA;AAAA,EACzC,SAAS,EAAE,MAAM,UAAU,aAAa,2BAAA;AAAA,EACxC,WAAW,EAAE,MAAM,SAAA;AACrB,GAEaC,IAAwD;AAAA,EACnE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO,EAAE,MAAM,UAAU,YAAYF,EAAA;AAAA,QAAmB;AAAA,QAE1D,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACE,GAAQC,MAAuC;AACtD,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,WAAW;AAAA;AAAA;AAAA;AAAA,MAIT,QAAQ;AAAA,MACR,UACE;AAAA,MACF,YAAY;AAAA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,IAAA;AAAA,EAGP;AACF;AAEAlD,GAAc,cAAc;"}
|
|
@@ -4,7 +4,7 @@ import { c as v } from "./index-D2ZczOXr.js";
|
|
|
4
4
|
import { useTranslation as x } from "react-i18next";
|
|
5
5
|
import { B as l } from "./button-Bn16lcFM.js";
|
|
6
6
|
import { P as y } from "./progress-D_g_Sl2g.js";
|
|
7
|
-
import { H as o } from "./hover-card-
|
|
7
|
+
import { H as o } from "./hover-card-U_ZYoh1n.js";
|
|
8
8
|
const w = v("ds:flex ds:flex-col ds:items-start", {
|
|
9
9
|
variants: {
|
|
10
10
|
mode: {
|
|
@@ -87,4 +87,4 @@ k.displayName = "AiCreditsNotice";
|
|
|
87
87
|
export {
|
|
88
88
|
k as A
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=ai-credits-notice-
|
|
90
|
+
//# sourceMappingURL=ai-credits-notice-ktklr8fy.js.map
|
package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js.map → ai-credits-notice-ktklr8fy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-credits-notice-BoNJtOuE.js","sources":["../../src/components/ai-credits-notice/ai-credits-notice.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { HoverCard } from '../hover-card';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsNotice */\n/* */\n/* The body of the hover card every AI action trigger in the kit shows: */\n/* AI features cost nothing extra today ('included'), or — once paid */\n/* credit bundles ship with a free tier underneath — a nudge toward */\n/* them ('bundles'). The host decides which by passing `mode`; nothing */\n/* here reaches a backend or owns the upsell page itself — `onViewBundles` */\n/* is a seam, not a router. */\n/* */\n/* Renders INSIDE a `HoverCard.Content` (it uses `HoverCard.Eyebrow` / */\n/* `.Heading` / `.Body` / `.Footer`, the same composition `AppointmentPeek` */\n/* uses) — it never renders its own `HoverCard.Root`/`Trigger`. Callers */\n/* wrap it: `<HoverCard><HoverCard.Trigger asChild>{button}</HoverCard.Trigger>` */\n/* `<HoverCard.Content side=\"bottom\" align=\"start\" size=\"sm\"><AiCreditsNotice … /></HoverCard.Content></HoverCard>`. */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:items-start', {\n variants: {\n mode: {\n included: '',\n bundles: '',\n },\n },\n defaultVariants: {\n mode: 'included',\n },\n});\n\n/** The practice's current AI allowance, when the host tracks one. */\nexport interface AiCreditsNoticeAllowance {\n /** AI actions left in the current period. */\n remaining: number;\n /** The monthly cap. */\n limit: number;\n /** When the allowance next resets. Omit if unknown. */\n resetsOn?: Date;\n}\n\ninterface AiCreditsNoticeSharedProps {\n /**\n * The practice's current AI allowance. In `included` mode it renders as an\n * optional usage line + meter; in `bundles` mode it drives the heading\n * (\"{{remaining}} of {{limit}} credits\") and the free-tier line in the\n * body. Omit either mode's allowance to fall back to a generic line.\n */\n allowance?: AiCreditsNoticeAllowance;\n className?: string;\n}\n\nexport interface AiCreditsNoticeIncludedProps extends AiCreditsNoticeSharedProps {\n mode: 'included';\n /** Shows a quiet \"Learn more\" link — wire it once the credits upsell page ships. */\n onLearnMore?: () => void;\n /**\n * Shows a quiet \"Don't show again\" link. The host decides what \"again\"\n * means — typically stop rendering `aiCreditsNotice` on the editor for the\n * rest of this mount, and persist the choice if it should survive a\n * reload (see the component's docs for a `usePersistentState` example).\n * Use a storage key scoped to the mode: switching from `included` to\n * `bundles` is a different message and should show once more.\n */\n onDismiss?: () => void;\n}\n\nexport interface AiCreditsNoticeBundlesProps extends AiCreditsNoticeSharedProps {\n mode: 'bundles';\n /** Opens the host's AI-credits bundle picker. The kit never builds that page itself. */\n onViewBundles: () => void;\n /** Shows a quiet \"What each action costs\" link. */\n onSeeCosts?: () => void;\n /** Shows a quiet \"Don't show again\" link. See the `included` prop of the\n * same name — the same mode-scoped-key guidance applies here too. */\n onDismiss?: () => void;\n}\n\nexport type AiCreditsNoticeProps =\n | AiCreditsNoticeIncludedProps\n | AiCreditsNoticeBundlesProps;\n\n/* Every callback either mode can carry, all optional at once. The footer\n reads them from `props`; this shape exists only so the component can\n destructure them OUT of the `rest` it spreads onto the root `<div>`.\n React resolves any `on[A-Z]…` prop as a DOM event, so leaving them in\n `rest` logged \"Unknown event handler property: onLearnMore\" (and one per\n sibling) on every render — and the editor renders this card on every AI\n trigger, so the warnings repeated on every hover (caught in review on\n #180). A cast, not four narrowed reads: `props` is a discriminated union\n and TypeScript refuses `onViewBundles` off the `included` arm. */\ntype AiCreditsNoticeCallbacks = Partial<\n Pick<AiCreditsNoticeIncludedProps, 'onLearnMore' | 'onDismiss'> &\n Pick<AiCreditsNoticeBundlesProps, 'onViewBundles' | 'onSeeCosts'>\n>;\n\nexport const AiCreditsNotice = forwardRef<\n HTMLDivElement,\n AiCreditsNoticeProps & Omit<HTMLAttributes<HTMLDivElement>, 'className'>\n>((props, ref) => {\n const { t, i18n } = useTranslation('ui');\n // Two steps, not one. The first reads straight off `props` so that\n // `mode === 'included'` below still narrows `props` itself (TypeScript's\n // aliased-discriminant narrowing) — destructuring off a cast breaks that\n // link and the footer's `props.onLearnMore` stops compiling. The second\n // strips the callbacks out of what is left, so `rest` reaches the DOM node\n // carrying only real HTML attributes. See `AiCreditsNoticeCallbacks`.\n const { allowance, className, mode, ...restWithCallbacks } = props;\n const {\n onLearnMore: _onLearnMore,\n onDismiss: _onDismiss,\n onViewBundles: _onViewBundles,\n onSeeCosts: _onSeeCosts,\n ...rest\n } = restWithCallbacks as typeof restWithCallbacks & AiCreditsNoticeCallbacks;\n\n // A `limit` of 0 (a host still loading, or a plan with no allowance at\n // all) would divide by zero in the Progress meter — treat it the same as\n // no allowance rather than rendering a broken 0/0 meter.\n const hasUsableAllowance = Boolean(allowance && allowance.limit > 0);\n\n const resetsOnText =\n hasUsableAllowance && allowance?.resetsOn\n ? new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'long',\n }).format(allowance.resetsOn)\n : undefined;\n\n const allowanceLine = hasUsableAllowance\n ? t('aiCreditsNotice.included.allowance', {\n remaining: allowance!.remaining,\n limit: allowance!.limit,\n })\n : undefined;\n\n // `hasUsableAllowance`, not a bare `allowance` check: a host still loading\n // sends `{ remaining: 0, limit: 0 }`, which read literally becomes \"0 of 0\n // credits\" and \"the free tier includes 0 actions a month\" — two sentences\n // that are wrong rather than merely vague. `included` already treated a\n // zero limit as no allowance; `bundles` now agrees and falls back to the\n // generic lines (caught in review on #180).\n const heading =\n mode === 'included'\n ? t('aiCreditsNotice.included.heading')\n : hasUsableAllowance\n ? t('aiCreditsNotice.bundles.headingWithAllowance', {\n remaining: allowance!.remaining,\n limit: allowance!.limit,\n })\n : t('aiCreditsNotice.bundles.eyebrow');\n\n const body =\n mode === 'included'\n ? t('aiCreditsNotice.included.body')\n : hasUsableAllowance\n ? t('aiCreditsNotice.bundles.body', { limit: allowance!.limit })\n : t('aiCreditsNotice.bundles.bodyGeneric');\n\n return (\n <div\n {...rest}\n ref={ref}\n // AFTER `rest`, not before: these are the required agent-readiness DOM\n // hooks (see 26-agent-readiness.mdx §A3) and must always win over\n // anything a caller passes through the HTMLAttributes spread — a\n // caller-supplied `data-component` must never be able to replace the\n // component's own marker.\n data-component=\"ai-credits-notice\"\n data-mode={mode}\n className={rootVariants({ mode, className })}\n >\n <HoverCard.Eyebrow>\n {mode === 'included'\n ? t('aiCreditsNotice.included.eyebrow')\n : t('aiCreditsNotice.bundles.eyebrow')}\n </HoverCard.Eyebrow>\n <HoverCard.Heading>{heading}</HoverCard.Heading>\n <HoverCard.Body>\n <p className=\"ds:m-0\">{body}</p>\n {mode === 'included' && hasUsableAllowance ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label\">{allowanceLine}</span>\n </div>\n <Progress\n value={Math.max(0, allowance!.limit - allowance!.remaining)}\n max={allowance!.limit}\n size=\"sm\"\n ariaLabel={t('aiCreditsNotice.included.eyebrow')}\n ariaValueText={allowanceLine}\n />\n {resetsOnText ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('aiCreditsNotice.included.resetsOn', { date: resetsOnText })}\n </p>\n ) : null}\n </div>\n ) : null}\n </HoverCard.Body>\n {mode === 'included' ? (\n props.onLearnMore || props.onDismiss ? (\n <HoverCard.Footer>\n {props.onDismiss ? (\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={props.onDismiss}\n className=\"ds:me-auto\"\n >\n {t('aiCreditsNotice.dismiss')}\n </Button>\n ) : null}\n {props.onLearnMore ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onLearnMore}>\n {t('aiCreditsNotice.included.learnMore')}\n </Button>\n ) : null}\n </HoverCard.Footer>\n ) : null\n ) : (\n <HoverCard.Footer>\n {props.onSeeCosts || props.onDismiss ? (\n <div className=\"ds:me-auto ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {props.onSeeCosts ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onSeeCosts}>\n {t('aiCreditsNotice.bundles.seeCosts')}\n </Button>\n ) : null}\n {props.onDismiss ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onDismiss}>\n {t('aiCreditsNotice.dismiss')}\n </Button>\n ) : null}\n </div>\n ) : null}\n <Button intent=\"tonal\" size=\"sm\" onClick={props.onViewBundles}>\n {t('aiCreditsNotice.bundles.viewBundles')}\n </Button>\n </HoverCard.Footer>\n )}\n </div>\n );\n});\nAiCreditsNotice.displayName = 'AiCreditsNotice';\n"],"names":["rootVariants","cva","AiCreditsNotice","forwardRef","props","ref","t","i18n","useTranslation","allowance","className","mode","restWithCallbacks","_onLearnMore","_onDismiss","_onViewBundles","_onSeeCosts","rest","hasUsableAllowance","resetsOnText","allowanceLine","heading","body","jsxs","jsx","HoverCard","Prog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B,EAACG,GAAA,EAAO,QAAO,QAAO,MAAK,MAAK,SAASvB,EAAM,aAC5C,UAAAE,EAAE,oCAAoC,GACzC,IACE;AAAA,QAAA,EAAA,CACN,IACE,OAEJ,gBAAAiB,EAACE,EAAU,QAAV,EACE,UAAA;AAAA,UAAArB,EAAM,cAAcA,EAAM,YACzB,gBAAAmB,EAAC,OAAA,EAAI,WAAU,iEACZ,UAAA;AAAA,YAAAnB,EAAM,aACL,gBAAAoB,EAACG,GAAA,EAAO,QAAO,QAAO,MAAK,MAAK,SAASvB,EAAM,YAC5C,UAAAE,EAAE,kCAAkC,GACvC,IACE;AAAA,YACHF,EAAM,YACL,gBAAAoB,EAACG,GAAA,EAAO,QAAO,QAAO,MAAK,MAAK,SAASvB,EAAM,WAC5C,UAAAE,EAAE,yBAAyB,GAC9B,IACE;AAAA,UAAA,EAAA,CACN,IACE;AAAA,UACJ,gBAAAkB,EAACG,GAAA,EAAO,QAAO,SAAQ,MAAK,MAAK,SAASvB,EAAM,eAC7C,UAAAE,EAAE,qCAAqC,EAAA,CAC1C;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AACDJ,EAAgB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"ai-credits-notice-ktklr8fy.js","sources":["../../src/components/ai-credits-notice/ai-credits-notice.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { HoverCard } from '../hover-card';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsNotice */\n/* */\n/* The body of the hover card every AI action trigger in the kit shows: */\n/* AI features cost nothing extra today ('included'), or — once paid */\n/* credit bundles ship with a free tier underneath — a nudge toward */\n/* them ('bundles'). The host decides which by passing `mode`; nothing */\n/* here reaches a backend or owns the upsell page itself — `onViewBundles` */\n/* is a seam, not a router. */\n/* */\n/* Renders INSIDE a `HoverCard.Content` (it uses `HoverCard.Eyebrow` / */\n/* `.Heading` / `.Body` / `.Footer`, the same composition `AppointmentPeek` */\n/* uses) — it never renders its own `HoverCard.Root`/`Trigger`. Callers */\n/* wrap it: `<HoverCard><HoverCard.Trigger asChild>{button}</HoverCard.Trigger>` */\n/* `<HoverCard.Content side=\"bottom\" align=\"start\" size=\"sm\"><AiCreditsNotice … /></HoverCard.Content></HoverCard>`. */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:items-start', {\n variants: {\n mode: {\n included: '',\n bundles: '',\n },\n },\n defaultVariants: {\n mode: 'included',\n },\n});\n\n/** The practice's current AI allowance, when the host tracks one. */\nexport interface AiCreditsNoticeAllowance {\n /** AI actions left in the current period. */\n remaining: number;\n /** The monthly cap. */\n limit: number;\n /** When the allowance next resets. Omit if unknown. */\n resetsOn?: Date;\n}\n\ninterface AiCreditsNoticeSharedProps {\n /**\n * The practice's current AI allowance. In `included` mode it renders as an\n * optional usage line + meter; in `bundles` mode it drives the heading\n * (\"{{remaining}} of {{limit}} credits\") and the free-tier line in the\n * body. Omit either mode's allowance to fall back to a generic line.\n */\n allowance?: AiCreditsNoticeAllowance;\n className?: string;\n}\n\nexport interface AiCreditsNoticeIncludedProps extends AiCreditsNoticeSharedProps {\n mode: 'included';\n /** Shows a quiet \"Learn more\" link — wire it once the credits upsell page ships. */\n onLearnMore?: () => void;\n /**\n * Shows a quiet \"Don't show again\" link. The host decides what \"again\"\n * means — typically stop rendering `aiCreditsNotice` on the editor for the\n * rest of this mount, and persist the choice if it should survive a\n * reload (see the component's docs for a `usePersistentState` example).\n * Use a storage key scoped to the mode: switching from `included` to\n * `bundles` is a different message and should show once more.\n */\n onDismiss?: () => void;\n}\n\nexport interface AiCreditsNoticeBundlesProps extends AiCreditsNoticeSharedProps {\n mode: 'bundles';\n /** Opens the host's AI-credits bundle picker. The kit never builds that page itself. */\n onViewBundles: () => void;\n /** Shows a quiet \"What each action costs\" link. */\n onSeeCosts?: () => void;\n /** Shows a quiet \"Don't show again\" link. See the `included` prop of the\n * same name — the same mode-scoped-key guidance applies here too. */\n onDismiss?: () => void;\n}\n\nexport type AiCreditsNoticeProps =\n | AiCreditsNoticeIncludedProps\n | AiCreditsNoticeBundlesProps;\n\n/* Every callback either mode can carry, all optional at once. The footer\n reads them from `props`; this shape exists only so the component can\n destructure them OUT of the `rest` it spreads onto the root `<div>`.\n React resolves any `on[A-Z]…` prop as a DOM event, so leaving them in\n `rest` logged \"Unknown event handler property: onLearnMore\" (and one per\n sibling) on every render — and the editor renders this card on every AI\n trigger, so the warnings repeated on every hover (caught in review on\n #180). A cast, not four narrowed reads: `props` is a discriminated union\n and TypeScript refuses `onViewBundles` off the `included` arm. */\ntype AiCreditsNoticeCallbacks = Partial<\n Pick<AiCreditsNoticeIncludedProps, 'onLearnMore' | 'onDismiss'> &\n Pick<AiCreditsNoticeBundlesProps, 'onViewBundles' | 'onSeeCosts'>\n>;\n\nexport const AiCreditsNotice = forwardRef<\n HTMLDivElement,\n AiCreditsNoticeProps & Omit<HTMLAttributes<HTMLDivElement>, 'className'>\n>((props, ref) => {\n const { t, i18n } = useTranslation('ui');\n // Two steps, not one. The first reads straight off `props` so that\n // `mode === 'included'` below still narrows `props` itself (TypeScript's\n // aliased-discriminant narrowing) — destructuring off a cast breaks that\n // link and the footer's `props.onLearnMore` stops compiling. The second\n // strips the callbacks out of what is left, so `rest` reaches the DOM node\n // carrying only real HTML attributes. See `AiCreditsNoticeCallbacks`.\n const { allowance, className, mode, ...restWithCallbacks } = props;\n const {\n onLearnMore: _onLearnMore,\n onDismiss: _onDismiss,\n onViewBundles: _onViewBundles,\n onSeeCosts: _onSeeCosts,\n ...rest\n } = restWithCallbacks as typeof restWithCallbacks & AiCreditsNoticeCallbacks;\n\n // A `limit` of 0 (a host still loading, or a plan with no allowance at\n // all) would divide by zero in the Progress meter — treat it the same as\n // no allowance rather than rendering a broken 0/0 meter.\n const hasUsableAllowance = Boolean(allowance && allowance.limit > 0);\n\n const resetsOnText =\n hasUsableAllowance && allowance?.resetsOn\n ? new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'long',\n }).format(allowance.resetsOn)\n : undefined;\n\n const allowanceLine = hasUsableAllowance\n ? t('aiCreditsNotice.included.allowance', {\n remaining: allowance!.remaining,\n limit: allowance!.limit,\n })\n : undefined;\n\n // `hasUsableAllowance`, not a bare `allowance` check: a host still loading\n // sends `{ remaining: 0, limit: 0 }`, which read literally becomes \"0 of 0\n // credits\" and \"the free tier includes 0 actions a month\" — two sentences\n // that are wrong rather than merely vague. `included` already treated a\n // zero limit as no allowance; `bundles` now agrees and falls back to the\n // generic lines (caught in review on #180).\n const heading =\n mode === 'included'\n ? t('aiCreditsNotice.included.heading')\n : hasUsableAllowance\n ? t('aiCreditsNotice.bundles.headingWithAllowance', {\n remaining: allowance!.remaining,\n limit: allowance!.limit,\n })\n : t('aiCreditsNotice.bundles.eyebrow');\n\n const body =\n mode === 'included'\n ? t('aiCreditsNotice.included.body')\n : hasUsableAllowance\n ? t('aiCreditsNotice.bundles.body', { limit: allowance!.limit })\n : t('aiCreditsNotice.bundles.bodyGeneric');\n\n return (\n <div\n {...rest}\n ref={ref}\n // AFTER `rest`, not before: these are the required agent-readiness DOM\n // hooks (see 26-agent-readiness.mdx §A3) and must always win over\n // anything a caller passes through the HTMLAttributes spread — a\n // caller-supplied `data-component` must never be able to replace the\n // component's own marker.\n data-component=\"ai-credits-notice\"\n data-mode={mode}\n className={rootVariants({ mode, className })}\n >\n <HoverCard.Eyebrow>\n {mode === 'included'\n ? t('aiCreditsNotice.included.eyebrow')\n : t('aiCreditsNotice.bundles.eyebrow')}\n </HoverCard.Eyebrow>\n <HoverCard.Heading>{heading}</HoverCard.Heading>\n <HoverCard.Body>\n <p className=\"ds:m-0\">{body}</p>\n {mode === 'included' && hasUsableAllowance ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label\">{allowanceLine}</span>\n </div>\n <Progress\n value={Math.max(0, allowance!.limit - allowance!.remaining)}\n max={allowance!.limit}\n size=\"sm\"\n ariaLabel={t('aiCreditsNotice.included.eyebrow')}\n ariaValueText={allowanceLine}\n />\n {resetsOnText ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('aiCreditsNotice.included.resetsOn', { date: resetsOnText })}\n </p>\n ) : null}\n </div>\n ) : null}\n </HoverCard.Body>\n {mode === 'included' ? (\n props.onLearnMore || props.onDismiss ? (\n <HoverCard.Footer>\n {props.onDismiss ? (\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={props.onDismiss}\n className=\"ds:me-auto\"\n >\n {t('aiCreditsNotice.dismiss')}\n </Button>\n ) : null}\n {props.onLearnMore ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onLearnMore}>\n {t('aiCreditsNotice.included.learnMore')}\n </Button>\n ) : null}\n </HoverCard.Footer>\n ) : null\n ) : (\n <HoverCard.Footer>\n {props.onSeeCosts || props.onDismiss ? (\n <div className=\"ds:me-auto ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {props.onSeeCosts ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onSeeCosts}>\n {t('aiCreditsNotice.bundles.seeCosts')}\n </Button>\n ) : null}\n {props.onDismiss ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onDismiss}>\n {t('aiCreditsNotice.dismiss')}\n </Button>\n ) : null}\n </div>\n ) : null}\n <Button intent=\"tonal\" size=\"sm\" onClick={props.onViewBundles}>\n {t('aiCreditsNotice.bundles.viewBundles')}\n </Button>\n </HoverCard.Footer>\n )}\n </div>\n );\n});\nAiCreditsNotice.displayName = 'AiCreditsNotice';\n"],"names":["rootVariants","cva","AiCreditsNotice","forwardRef","props","ref","t","i18n","useTranslation","allowance","className","mode","restWithCallbacks","_onLearnMore","_onDismiss","_onViewBundles","_onSeeCosts","rest","hasUsableAllowance","resetsOnText","allowanceLine","heading","body","jsxs","jsx","HoverCard","Progress","Button"],"mappings":";;;;;;;AAwBA,MAAMA,IAAeC,EAAI,sCAAsC;AAAA,EAC7D,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,UAAU;AAAA,MACV,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC,GAmEYC,IAAkBC,EAG7B,CAACC,GAAOC,MAAQ;AAChB,QAAM,EAAE,GAAAC,GAAG,MAAAC,MAASC,EAAe,IAAI,GAOjC,EAAE,WAAAC,GAAW,WAAAC,GAAW,MAAAC,GAAM,GAAGC,MAAsBR,GACvD;AAAA,IACJ,aAAaS;AAAA,IACb,WAAWC;AAAA,IACX,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,GAAGC;AAAA,EAAA,IACDL,GAKEM,IAAqB,GAAQT,KAAaA,EAAU,QAAQ,IAE5DU,IACJD,MAAsBT,KAAA,QAAAA,EAAW,YAC7B,IAAI,KAAK,eAAeF,EAAK,UAAU;AAAA,IACrC,KAAK;AAAA,IACL,OAAO;AAAA,EAAA,CACR,EAAE,OAAOE,EAAU,QAAQ,IAC5B,QAEAW,IAAgBF,IAClBZ,EAAE,sCAAsC;AAAA,IACtC,WAAWG,EAAW;AAAA,IACtB,OAAOA,EAAW;AAAA,EAAA,CACnB,IACD,QAQEY,IACJV,MAAS,aACLL,EAAE,kCAAkC,IACpCY,IACEZ,EAAE,gDAAgD;AAAA,IAChD,WAAWG,EAAW;AAAA,IACtB,OAAOA,EAAW;AAAA,EAAA,CACnB,IACDH,EAAE,iCAAiC,GAErCgB,IACJX,MAAS,aACLL,EAAE,+BAA+B,IACjCY,IACEZ,EAAE,gCAAgC,EAAE,OAAOG,EAAW,MAAA,CAAO,IAC7DH,EAAE,qCAAqC;AAE/C,SACE,gBAAAiB;AAA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M;AAAA,cACf,WAAU;AAAA,cAET,YAAE,yBAAyB;AAAA,YAAA;AAAA,UAAA,IAE5B;AAAA,UACHA,EAAM,cACL,gBAAAoB,EAACG,GAAA,EAAO,QAAO,QAAO,MAAK,MAAK,SAASvB,EAAM,aAC5C,UAAAE,EAAE,oCAAoC,GACzC,IACE;AAAA,QAAA,EAAA,CACN,IACE,OAEJ,gBAAAiB,EAACE,EAAU,QAAV,EACE,UAAA;AAAA,UAAArB,EAAM,cAAcA,EAAM,YACzB,gBAAAmB,EAAC,OAAA,EAAI,WAAU,iEACZ,UAAA;AAAA,YAAAnB,EAAM,aACL,gBAAAoB,EAACG,GAAA,EAAO,QAAO,QAAO,MAAK,MAAK,SAASvB,EAAM,YAC5C,UAAAE,EAAE,kCAAkC,GACvC,IACE;AAAA,YACHF,EAAM,YACL,gBAAAoB,EAACG,GAAA,EAAO,QAAO,QAAO,MAAK,MAAK,SAASvB,EAAM,WAC5C,UAAAE,EAAE,yBAAyB,GAC9B,IACE;AAAA,UAAA,EAAA,CACN,IACE;AAAA,UACJ,gBAAAkB,EAACG,GAAA,EAAO,QAAO,SAAQ,MAAK,MAAK,SAASvB,EAAM,eAC7C,UAAAE,EAAE,qCAAqC,EAAA,CAC1C;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AACDJ,EAAgB,cAAc;"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useState as C, useRef as E, useMemo as F } from "react";
|
|
3
|
+
import { c as M } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as P } from "react-i18next";
|
|
5
|
+
import { A as g } from "./alert-BhCstf2h.js";
|
|
6
|
+
import { B as D } from "./badge-hnBt8o7n.js";
|
|
7
|
+
import { B as H } from "./button-Bn16lcFM.js";
|
|
8
|
+
import { C as J } from "./checkbox--ndmyokr.js";
|
|
9
|
+
import { S as U } from "./spinner-CoflYlEx.js";
|
|
10
|
+
import { T as W } from "./timestamp-DPLDWdxA.js";
|
|
11
|
+
import { u as _ } from "./registry-DvAUVLHh.js";
|
|
12
|
+
const $ = {
|
|
13
|
+
id: "ai-consent-banner",
|
|
14
|
+
capabilities: [],
|
|
15
|
+
state: {
|
|
16
|
+
consentState: {
|
|
17
|
+
type: "'granted' | 'required' | 'pending'",
|
|
18
|
+
descriptionKey: "ui.agent.aiConsentBanner.state.consentState",
|
|
19
|
+
description: "Current consent state. Structural only — never the grantee identity.",
|
|
20
|
+
read: (i) => i.getState()
|
|
21
|
+
},
|
|
22
|
+
armed: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
descriptionKey: "ui.agent.aiConsentBanner.state.armed",
|
|
25
|
+
description: "Whether the consent confirmation checkbox is ticked (required state only).",
|
|
26
|
+
read: (i) => i.isArmed()
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
actions: {},
|
|
30
|
+
domHooks: {
|
|
31
|
+
root: {
|
|
32
|
+
attr: "data-component",
|
|
33
|
+
value: "ai-consent-banner",
|
|
34
|
+
description: "Marks the AiConsentBanner root region."
|
|
35
|
+
},
|
|
36
|
+
instanceId: {
|
|
37
|
+
attr: "data-component-id",
|
|
38
|
+
sourceProp: "id",
|
|
39
|
+
description: "Sourced from the id prop. Required to address a specific banner from the agent."
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, O = M("ds:w-full ds:text-[color:var(--foreground)]", {
|
|
43
|
+
variants: {
|
|
44
|
+
state: {
|
|
45
|
+
granted: "",
|
|
46
|
+
required: "",
|
|
47
|
+
pending: ""
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
state: "required"
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
function x(i, c) {
|
|
55
|
+
return c ? "pending" : i ? "granted" : "required";
|
|
56
|
+
}
|
|
57
|
+
const q = {
|
|
58
|
+
"patient-record": {
|
|
59
|
+
descriptionRequired: {
|
|
60
|
+
key: "aiConsentBanner.description.required",
|
|
61
|
+
fallback: "AI assistance requires recorded consent before it can run."
|
|
62
|
+
},
|
|
63
|
+
descriptionGranted: {
|
|
64
|
+
key: "aiConsentBanner.description.granted",
|
|
65
|
+
fallback: "AI assistance is enabled for this record."
|
|
66
|
+
},
|
|
67
|
+
confirmLabel: {
|
|
68
|
+
key: "aiConsentBanner.confirmLabel",
|
|
69
|
+
fallback: "I confirm consent has been obtained for AI assistance."
|
|
70
|
+
},
|
|
71
|
+
notAllowed: {
|
|
72
|
+
key: "aiConsentBanner.notAllowed",
|
|
73
|
+
fallback: "You do not have permission to grant AI assistance consent."
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"practice-statistics": {
|
|
77
|
+
descriptionRequired: {
|
|
78
|
+
key: "aiConsentBanner.practiceStatistics.description.required",
|
|
79
|
+
fallback: "AI assistance needs consent before it can read this practice's statistics. It uses aggregate figures only, never patient data."
|
|
80
|
+
},
|
|
81
|
+
descriptionGranted: {
|
|
82
|
+
key: "aiConsentBanner.practiceStatistics.description.granted",
|
|
83
|
+
fallback: "AI assistance can read this practice's statistics. It uses aggregate figures only, never patient data."
|
|
84
|
+
},
|
|
85
|
+
confirmLabel: {
|
|
86
|
+
key: "aiConsentBanner.practiceStatistics.confirmLabel",
|
|
87
|
+
fallback: "I may decide for this practice, and I agree to AI assistance reading its statistics."
|
|
88
|
+
},
|
|
89
|
+
notAllowed: {
|
|
90
|
+
key: "aiConsentBanner.practiceStatistics.notAllowed",
|
|
91
|
+
fallback: "You do not have permission to grant AI assistance consent for this practice."
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, Q = z(
|
|
95
|
+
({
|
|
96
|
+
id: i,
|
|
97
|
+
granted: c,
|
|
98
|
+
grantedAt: p,
|
|
99
|
+
grantedBy: h,
|
|
100
|
+
canGrant: L = !0,
|
|
101
|
+
pending: b = !1,
|
|
102
|
+
onGrantConsent: S,
|
|
103
|
+
headingLevel: I = 5,
|
|
104
|
+
subject: k = "patient-record",
|
|
105
|
+
copy: e,
|
|
106
|
+
"aria-label": w,
|
|
107
|
+
className: R,
|
|
108
|
+
...G
|
|
109
|
+
}, N) => {
|
|
110
|
+
const { t } = P("ui"), s = x(c, b), r = (l) => (l == null ? void 0 : l.trim()) || void 0, o = q[k] ?? q["patient-record"], a = {
|
|
111
|
+
title: r(e == null ? void 0 : e.title) || t("aiConsentBanner.title", "AI assistance consent"),
|
|
112
|
+
descriptionRequired: r(e == null ? void 0 : e.descriptionRequired) || t(o.descriptionRequired.key, o.descriptionRequired.fallback),
|
|
113
|
+
descriptionGranted: r(e == null ? void 0 : e.descriptionGranted) || t(o.descriptionGranted.key, o.descriptionGranted.fallback),
|
|
114
|
+
confirmLabel: r(e == null ? void 0 : e.confirmLabel) || t(o.confirmLabel.key, o.confirmLabel.fallback),
|
|
115
|
+
grantButton: r(e == null ? void 0 : e.grantButton) || t("aiConsentBanner.grantButton", "Grant consent"),
|
|
116
|
+
notAllowed: r(e == null ? void 0 : e.notAllowed) || t(o.notAllowed.key, o.notAllowed.fallback),
|
|
117
|
+
badgeGranted: r(e == null ? void 0 : e.badgeGranted) || t("aiConsentBanner.badge.granted", "Consent granted"),
|
|
118
|
+
pendingLabel: r(e == null ? void 0 : e.pendingLabel) || t("aiConsentBanner.pendingLabel", "Saving consent…")
|
|
119
|
+
}, m = [
|
|
120
|
+
k,
|
|
121
|
+
a.confirmLabel,
|
|
122
|
+
a.descriptionRequired
|
|
123
|
+
].join("\0"), [T, A] = C(!1), [B, V] = C(m);
|
|
124
|
+
B !== m && (V(m), A(!1));
|
|
125
|
+
const f = T && B === m, v = E(f);
|
|
126
|
+
v.current = f;
|
|
127
|
+
const K = F(
|
|
128
|
+
() => ({
|
|
129
|
+
getState: () => x(c, b),
|
|
130
|
+
isArmed: () => v.current
|
|
131
|
+
}),
|
|
132
|
+
[c, b]
|
|
133
|
+
);
|
|
134
|
+
_($, K, i);
|
|
135
|
+
const Y = r(w) || r(e == null ? void 0 : e.title) || t("aiConsentBanner.regionLabel", "AI assistance consent"), j = s === "granted" ? "success" : "info";
|
|
136
|
+
let u;
|
|
137
|
+
return s === "granted" ? u = /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
138
|
+
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
139
|
+
/* @__PURE__ */ n(D, { variant: "success", children: a.badgeGranted }),
|
|
140
|
+
p !== void 0 ? /* @__PURE__ */ d("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: [
|
|
141
|
+
t("aiConsentBanner.grantedAtPrefix", "Granted"),
|
|
142
|
+
" ",
|
|
143
|
+
/* @__PURE__ */ n(W, { value: p, format: "relative", shape: "inline" })
|
|
144
|
+
] }) : null
|
|
145
|
+
] }),
|
|
146
|
+
h ? /* @__PURE__ */ n("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: t("aiConsentBanner.grantedBy", {
|
|
147
|
+
name: h,
|
|
148
|
+
defaultValue: "By {{name}}"
|
|
149
|
+
}) }) : null
|
|
150
|
+
] }) : s === "pending" ? u = /* @__PURE__ */ d("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
151
|
+
/* @__PURE__ */ n(U, { variant: "pulse", size: "sm", label: a.pendingLabel }),
|
|
152
|
+
/* @__PURE__ */ n("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: a.pendingLabel })
|
|
153
|
+
] }) : u = L ? /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
154
|
+
/* @__PURE__ */ n(
|
|
155
|
+
J,
|
|
156
|
+
{
|
|
157
|
+
checked: f,
|
|
158
|
+
onCheckedChange: (l) => A(l === !0),
|
|
159
|
+
label: a.confirmLabel
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ n(g.Action, { children: /* @__PURE__ */ n(
|
|
163
|
+
H,
|
|
164
|
+
{
|
|
165
|
+
intent: "primary",
|
|
166
|
+
size: "sm",
|
|
167
|
+
disabled: !f,
|
|
168
|
+
onClick: S,
|
|
169
|
+
children: a.grantButton
|
|
170
|
+
}
|
|
171
|
+
) })
|
|
172
|
+
] }) : /* @__PURE__ */ n("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a.notAllowed }), /* @__PURE__ */ n(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
ref: N,
|
|
176
|
+
role: "region",
|
|
177
|
+
"aria-label": Y,
|
|
178
|
+
"aria-busy": s === "pending" ? !0 : void 0,
|
|
179
|
+
"data-component": "ai-consent-banner",
|
|
180
|
+
"data-component-id": i,
|
|
181
|
+
"data-state": s,
|
|
182
|
+
id: i,
|
|
183
|
+
className: O({ state: s, className: R }),
|
|
184
|
+
...G,
|
|
185
|
+
children: /* @__PURE__ */ d(
|
|
186
|
+
g,
|
|
187
|
+
{
|
|
188
|
+
variant: j,
|
|
189
|
+
icon: s === "pending" ? null : void 0,
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ n(g.Title, { as: `h${I}`, children: a.title }),
|
|
192
|
+
/* @__PURE__ */ n(g.Description, { children: s === "granted" ? a.descriptionGranted : a.descriptionRequired }),
|
|
193
|
+
u
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
Q.displayName = "AiConsentBanner";
|
|
202
|
+
export {
|
|
203
|
+
Q as A,
|
|
204
|
+
$ as a
|
|
205
|
+
};
|
|
206
|
+
//# sourceMappingURL=ai-permission-notice-DyuEGwAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-permission-notice-DyuEGwAt.js","sources":["../../src/components/ai-permission-notice/ai-permission-notice.agent.ts","../../src/components/ai-permission-notice/ai-permission-notice.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AiConsentBanner. */\n/* */\n/* Read-only structural surface: the current consent state and whether */\n/* the grant affordance is armed. Identifiers / structural state ONLY — */\n/* never the grantee's name or any PHI. The real consent gate lives */\n/* server-side; this adapter does not expose a grant action so an agent */\n/* cannot consent on a user's behalf. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AiConsentBannerHandle } from './ai-permission-notice';\n\nexport const aiConsentBannerAgent: AgentAdapter<AiConsentBannerHandle> = {\n id: 'ai-consent-banner',\n capabilities: [],\n state: {\n consentState: {\n type: \"'granted' | 'required' | 'pending'\",\n descriptionKey: 'ui.agent.aiConsentBanner.state.consentState',\n description:\n 'Current consent state. Structural only — never the grantee identity.',\n read: (handle) => handle.getState(),\n },\n armed: {\n type: 'boolean',\n descriptionKey: 'ui.agent.aiConsentBanner.state.armed',\n description:\n 'Whether the consent confirmation checkbox is ticked (required state only).',\n read: (handle) => handle.isArmed(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-consent-banner',\n description: 'Marks the AiConsentBanner root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific banner from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Alert } from '../alert/alert';\nimport { Badge } from '../badge/badge';\nimport { Button } from '../button/button';\nimport { Checkbox } from '../checkbox/checkbox';\nimport { Spinner } from '../spinner/spinner';\nimport { Timestamp } from '../timestamp/timestamp';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { aiConsentBannerAgent } from './ai-permission-notice.agent';\n\n/* -------------------------------------------------------------------- */\n/* AiConsentBanner */\n/* */\n/* Presentational AI-consent gate surfaced above an AI-assisted surface */\n/* (e.g. Alfascribe consultation transcription). The SERVER owns the */\n/* real gate — this component only reflects the consent record and lets */\n/* the operator initiate a grant; it never enforces access itself. */\n/* */\n/* Three states drive the Alert variant + body: */\n/* - granted → success Alert with a Badge + when/who it was granted. */\n/* - required → info Alert with a Checkbox-gated Grant Button. */\n/* - pending → info Alert in a disabled, Spinner-busy state while the */\n/* server persists the grant. */\n/* */\n/* All kit text flows through useTranslation('ui') against the */\n/* `aiConsentBanner.*` namespace. `subject` picks the kit-owned wording */\n/* preset; `copy` lets a host replace single strings with its own text. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n state: {\n granted: '',\n required: '',\n pending: '',\n },\n },\n defaultVariants: {\n state: 'required',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* State derivation */\n/* -------------------------------------------------------------------- */\n\nexport type AiConsentState = NonNullable<\n VariantProps<typeof rootVariants>['state']\n>;\n\n/** Heading levels `AiConsentBanner.headingLevel` accepts. */\nexport type AiConsentBannerHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Pending wins over granted/required so the busy state is never masked. */\nfunction deriveState(granted: boolean, pending: boolean): AiConsentState {\n if (pending) return 'pending';\n return granted ? 'granted' : 'required';\n}\n\n/* -------------------------------------------------------------------- */\n/* Subject presets */\n/* -------------------------------------------------------------------- */\n\n/** What the consent covers; each subject has kit-owned, translated wording.\n * `'patient-record'` (default) is one patient's record. `'practice-statistics'`\n * is the practice's aggregate figures (totals, rates), never patient data. */\nexport type AiConsentSubject = 'patient-record' | 'practice-statistics';\n\ntype AiConsentSubjectField =\n | 'descriptionRequired'\n | 'descriptionGranted'\n | 'confirmLabel'\n | 'notAllowed';\n\n/* Only these four strings differ by subject; the rest share one key each. */\nconst SUBJECT_KEYS = {\n 'patient-record': {\n descriptionRequired: {\n key: 'aiConsentBanner.description.required',\n fallback: 'AI assistance requires recorded consent before it can run.',\n },\n descriptionGranted: {\n key: 'aiConsentBanner.description.granted',\n fallback: 'AI assistance is enabled for this record.',\n },\n confirmLabel: {\n key: 'aiConsentBanner.confirmLabel',\n fallback: 'I confirm consent has been obtained for AI assistance.',\n },\n notAllowed: {\n key: 'aiConsentBanner.notAllowed',\n fallback: 'You do not have permission to grant AI assistance consent.',\n },\n },\n 'practice-statistics': {\n descriptionRequired: {\n key: 'aiConsentBanner.practiceStatistics.description.required',\n fallback:\n \"AI assistance needs consent before it can read this practice's statistics. It uses aggregate figures only, never patient data.\",\n },\n descriptionGranted: {\n key: 'aiConsentBanner.practiceStatistics.description.granted',\n fallback:\n \"AI assistance can read this practice's statistics. It uses aggregate figures only, never patient data.\",\n },\n confirmLabel: {\n key: 'aiConsentBanner.practiceStatistics.confirmLabel',\n fallback:\n 'I may decide for this practice, and I agree to AI assistance reading its statistics.',\n },\n notAllowed: {\n key: 'aiConsentBanner.practiceStatistics.notAllowed',\n fallback:\n 'You do not have permission to grant AI assistance consent for this practice.',\n },\n },\n} as const satisfies Record<\n AiConsentSubject,\n Record<AiConsentSubjectField, { key: string; fallback: string }>\n>;\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/**\n * Patient AI-consent gate for an AI surface that sends patient data to a\n * service: the RichTextEditor's Help-me-write action and dictation mics, and\n * the VoiceControlPanel's microphone. Omit entirely for today's ungated\n * behaviour — no existing host breaks.\n *\n * Present and `granted: false`: the affordances stay visible (this never\n * hides a control), but using one shows the kit's `AiConsentBanner` instead\n * of starting the AI action. When `granted` flips `true` after a Grant click\n * in that banner, the surface resumes exactly the action it gated; when it\n * flips for any other reason (another patient, another tab) it only closes\n * the banner.\n *\n * Present and `granted: true`: normal behaviour.\n */\nexport interface AiConsentGate {\n /** Whether AI consent has already been recorded for the current patient. */\n granted: boolean;\n /** When consent was granted — passed straight to `AiConsentBanner`. */\n grantedAt?: string | number | Date;\n /** Who granted consent — passed straight to `AiConsentBanner`. */\n grantedBy?: string;\n /** Whether the signed-in reader may grant consent. Default `true`; treated\n * as `false` when `onGrant` is absent, so no dead Grant control shows. */\n canGrant?: boolean;\n /** The grant is being persisted server-side (host-driven busy state). */\n pending?: boolean;\n /**\n * Fired when the reader confirms the grant in the banner. A returned\n * promise drives the banner's own pending/Spinner state until it settles,\n * in addition to (or absent) a host-supplied `pending`.\n */\n onGrant?: () => void | Promise<void>;\n}\n\n/** Host-translated strings; the host owns their wording and translation.\n * Each one replaces the `subject` preset for that string only. Plain text,\n * not i18n keys: interpolate any values (a practice name) before passing. */\nexport interface AiConsentBannerCopy {\n /** Banner heading. */\n title?: string;\n /** Description in the required and pending states. */\n descriptionRequired?: string;\n /** Description in the granted state. */\n descriptionGranted?: string;\n /** Label of the confirmation checkbox. */\n confirmLabel?: string;\n /** Label of the Grant button. */\n grantButton?: string;\n /** Note shown instead of the grant controls when `canGrant` is false. */\n notAllowed?: string;\n /** Badge text in the granted state. */\n badgeGranted?: string;\n /** Busy text (and Spinner label) in the pending state. */\n pendingLabel?: string;\n}\n\n/** Agent-readiness curated handle. Exposes the structural consent state only. */\nexport interface AiConsentBannerHandle {\n /** Current derived state: 'granted' | 'required' | 'pending'. */\n getState: () => AiConsentState;\n /** Whether the Grant affordance is currently armed (checkbox ticked). */\n isArmed: () => boolean;\n}\n\nexport interface AiConsentBannerProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'role'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific banner. Mirrored to the\n * real DOM `id`.\n */\n id?: string;\n /** Whether consent has already been granted. Server-sourced. */\n granted: boolean;\n /**\n * When consent was granted — ISO-8601 string, ms-epoch, or Date. Rendered\n * via `Timestamp` in the granted state.\n */\n grantedAt?: string | number | Date;\n /** Who granted consent (operator display name / role). Granted state only. */\n grantedBy?: string;\n /**\n * Whether the current user is allowed to grant consent. When `false`, the\n * required-state Grant affordance is hidden and a not-allowed note shows.\n * Default `true`.\n */\n canGrant?: boolean;\n /** The grant is being persisted server-side — shows the busy Spinner state. */\n pending?: boolean;\n /** Fired when the operator confirms the consent grant. */\n onGrantConsent?: () => void;\n /**\n * Heading level for the banner's own title, so it can be nested under a\n * host section's heading without skipping levels (axe `heading-order`).\n * Additive: default `5` matches the banner's original, unconditional\n * `<h5>` — every existing consumer is unaffected.\n */\n headingLevel?: AiConsentBannerHeadingLevel;\n /** What the consent covers; picks the kit's translated wording. Default\n * `'patient-record'`, which renders exactly as before this prop existed. */\n subject?: AiConsentSubject;\n /** Host-translated strings; the host owns their wording and translation.\n * Each key overrides only its own string. `title` also names the region,\n * unless `aria-label` is passed. */\n copy?: Partial<AiConsentBannerCopy>;\n /** Override the region's accessible name. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const AiConsentBanner = forwardRef<HTMLDivElement, AiConsentBannerProps>(\n (\n {\n id,\n granted,\n grantedAt,\n grantedBy,\n canGrant = true,\n pending = false,\n onGrantConsent,\n headingLevel = 5,\n subject = 'patient-record',\n copy,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const state = deriveState(granted, pending);\n\n // A host string wins over the preset for that string only. A blank or\n // whitespace-only one counts as missing, so no control loses its name.\n const own = (value?: string) => value?.trim() || undefined;\n // An unknown subject from an untyped host falls back to the default.\n const keys = SUBJECT_KEYS[subject] ?? SUBJECT_KEYS['patient-record'];\n const text = {\n title:\n own(copy?.title) || t('aiConsentBanner.title', 'AI assistance consent'),\n descriptionRequired:\n own(copy?.descriptionRequired) ||\n t(keys.descriptionRequired.key, keys.descriptionRequired.fallback),\n descriptionGranted:\n own(copy?.descriptionGranted) ||\n t(keys.descriptionGranted.key, keys.descriptionGranted.fallback),\n confirmLabel:\n own(copy?.confirmLabel) ||\n t(keys.confirmLabel.key, keys.confirmLabel.fallback),\n grantButton:\n own(copy?.grantButton) ||\n t('aiConsentBanner.grantButton', 'Grant consent'),\n notAllowed:\n own(copy?.notAllowed) ||\n t(keys.notAllowed.key, keys.notAllowed.fallback),\n badgeGranted:\n own(copy?.badgeGranted) ||\n t('aiConsentBanner.badge.granted', 'Consent granted'),\n pendingLabel:\n own(copy?.pendingLabel) ||\n t('aiConsentBanner.pendingLabel', 'Saving consent…'),\n };\n\n // Grant stays disabled until the checkbox is ticked. Any change of subject\n // or statement unticks it, even back to an earlier one, so a tick only\n // confirms what was on screen when it was given.\n const statement = [\n subject,\n text.confirmLabel,\n text.descriptionRequired,\n ].join('\\u0000');\n const [ticked, setTicked] = useState(false);\n const [tickedFor, setTickedFor] = useState(statement);\n if (tickedFor !== statement) {\n setTickedFor(statement);\n setTicked(false);\n }\n const armed = ticked && tickedFor === statement;\n\n const armedRef = useRef(armed);\n armedRef.current = armed;\n\n const handle = useMemo<AiConsentBannerHandle>(\n () => ({\n getState: () => deriveState(granted, pending),\n isArmed: () => armedRef.current,\n }),\n [granted, pending],\n );\n useAgentRegistration(aiConsentBannerAgent, handle, id);\n\n // A host title also names the region, so the name matches the heading.\n const resolvedAriaLabel =\n own(ariaLabel) ||\n own(copy?.title) ||\n t('aiConsentBanner.regionLabel', 'AI assistance consent');\n\n // Alert variant per state: granted → success, required/pending → info.\n const alertVariant = state === 'granted' ? 'success' : 'info';\n\n let body: React.ReactNode;\n if (state === 'granted') {\n body = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Badge variant=\"success\">{text.badgeGranted}</Badge>\n {grantedAt !== undefined ? (\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('aiConsentBanner.grantedAtPrefix', 'Granted')}{' '}\n <Timestamp value={grantedAt} format=\"relative\" shape=\"inline\" />\n </span>\n ) : null}\n </div>\n {grantedBy ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t('aiConsentBanner.grantedBy', {\n name: grantedBy,\n defaultValue: 'By {{name}}',\n })}\n </p>\n ) : null}\n </div>\n );\n } else if (state === 'pending') {\n body = (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Spinner variant=\"pulse\" size=\"sm\" label={text.pendingLabel} />\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {text.pendingLabel}\n </span>\n </div>\n );\n } else {\n // required\n body = canGrant ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <Checkbox\n checked={armed}\n onCheckedChange={(next) => setTicked(next === true)}\n label={text.confirmLabel}\n />\n <Alert.Action>\n <Button\n intent=\"primary\"\n size=\"sm\"\n disabled={!armed}\n onClick={onGrantConsent}\n >\n {text.grantButton}\n </Button>\n </Alert.Action>\n </div>\n ) : (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {text.notAllowed}\n </p>\n );\n }\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-busy={state === 'pending' ? true : undefined}\n data-component=\"ai-consent-banner\"\n data-component-id={id}\n data-state={state}\n id={id}\n className={rootVariants({ state, className })}\n {...rest}\n >\n <Alert\n variant={alertVariant}\n icon={state === 'pending' ? null : undefined}\n >\n <Alert.Title as={`h${headingLevel}` as const}>\n {text.title}\n </Alert.Title>\n <Alert.Description>\n {state === 'granted'\n ? text.descriptionGranted\n : text.descriptionRequired}\n </Alert.Description>\n {body}\n </Alert>\n </div>\n );\n },\n);\n\nAiConsentBanner.displayName = 'AiConsentBanner';\n"],"names":["aiConsentBannerAgent","handle","rootVariants","cva","deriveState","granted","pending","SUBJECT_KEYS","AiConsentBanner","forwardRef","id","grantedAt","grantedBy","canGrant","onGrantConsent","headingLevel","subject","copy","ariaLabel","className","rest","ref","useTranslation","state","own","value","keys","text","statement","ticked","setTicked","useState","tickedFor","setTickedFor","armed","armedRef","useRef","useMemo","useAgentRegistration","resolvedAriaLabel","alertVariant","body","jsxs","jsx","Badge","Timestamp","Spinner","Checkbox","next","Alert","Button"],"mappings":";;;;;;;;;;;AAaO,MAAMA,IAA4D;AAAA,EACvE,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,EACnC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,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,aACE;AAAA,IAAA;AAAA,EACJ;AAEJ,GCLMC,IAAeC,EAAI,+CAA+C;AAAA,EACtE,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,OAAO;AAAA,EAAA;AAEX,CAAC;AAcD,SAASC,EAAYC,GAAkBC,GAAkC;AACvE,SAAIA,IAAgB,YACbD,IAAU,YAAY;AAC/B;AAkBA,MAAME,IAAe;AAAA,EACnB,kBAAkB;AAAA,IAChB,qBAAqB;AAAA,MACnB,KAAK;AAAA,MACL,UAAU;AAAA,IAAA;AAAA,IAEZ,oBAAoB;AAAA,MAClB,KAAK;AAAA,MACL,UAAU;AAAA,IAAA;AAAA,IAEZ,cAAc;AA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