@alfadocs/ui-kit-debug 1.67.0 → 1.68.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-CJtu7LQU.js → address-fields-BUPRs3n-.js} +3 -3
- package/dist/_chunks/{address-fields-CJtu7LQU.js.map → address-fields-BUPRs3n-.js.map} +1 -1
- package/dist/_chunks/{agenda-card-DR9gDdKp.js → agenda-card-BDuvreCe.js} +2 -2
- package/dist/_chunks/{agenda-card-DR9gDdKp.js.map → agenda-card-BDuvreCe.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-DGB1Zup-.js → agenda-tray-CfwylhWf.js} +3 -3
- package/dist/_chunks/{agenda-tray-DGB1Zup-.js.map → agenda-tray-CfwylhWf.js.map} +1 -1
- package/dist/_chunks/{ai-credits-exhausted-notice-DfAgfZDF.js → ai-credits-exhausted-notice-Bg8NpW2K.js} +2 -2
- package/dist/_chunks/{ai-credits-exhausted-notice-DfAgfZDF.js.map → ai-credits-exhausted-notice-Bg8NpW2K.js.map} +1 -1
- package/dist/_chunks/{ai-permission-notice-qsdm4Sx4.js → ai-permission-notice-C00i6VhY.js} +2 -2
- package/dist/_chunks/{ai-permission-notice-qsdm4Sx4.js.map → ai-permission-notice-C00i6VhY.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-DSGSe4LH.js → ai-prompt-input-DzgyoKyk.js} +141 -139
- package/dist/_chunks/ai-prompt-input-DzgyoKyk.js.map +1 -0
- package/dist/_chunks/{alert-DjsJMGRE.js → alert-9kEwDza3.js} +122 -112
- package/dist/_chunks/alert-9kEwDza3.js.map +1 -0
- package/dist/_chunks/{alia-sidebar-qe0quZkB.js → alia-sidebar-B06ZSOaF.js} +3 -3
- package/dist/_chunks/{alia-sidebar-qe0quZkB.js.map → alia-sidebar-B06ZSOaF.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-card-CMzBLTiN.js → anamnesis-summary-card-DQ3iE1gD.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-card-CMzBLTiN.js.map → anamnesis-summary-card-DQ3iE1gD.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BQ_EokKz.js → anamnesis-summary-rows-CNK0fIJk.js} +392 -388
- package/dist/_chunks/anamnesis-summary-rows-CNK0fIJk.js.map +1 -0
- package/dist/_chunks/{appointment-card-CL32sux-.js → appointment-card-5JMWi9_f.js} +2 -2
- package/dist/_chunks/{appointment-card-CL32sux-.js.map → appointment-card-5JMWi9_f.js.map} +1 -1
- package/dist/_chunks/{appointment-peek-B5mcDcXt.js → appointment-peek-D5XCfYKu.js} +2 -2
- package/dist/_chunks/{appointment-peek-B5mcDcXt.js.map → appointment-peek-D5XCfYKu.js.map} +1 -1
- package/dist/_chunks/{appointment-timeline-CCqjORFb.js → appointment-timeline-VFP6HoXT.js} +4 -4
- package/dist/_chunks/{appointment-timeline-CCqjORFb.js.map → appointment-timeline-VFP6HoXT.js.map} +1 -1
- package/dist/_chunks/{appointment-tray-qtpJt8e0.js → appointment-tray-B3PDER3I.js} +3 -3
- package/dist/_chunks/{appointment-tray-qtpJt8e0.js.map → appointment-tray-B3PDER3I.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-B11RR-rC.js → audio-recorder-4Ll0pwYK.js} +3 -3
- package/dist/_chunks/{audio-recorder-B11RR-rC.js.map → audio-recorder-4Ll0pwYK.js.map} +1 -1
- package/dist/_chunks/{auth-form-parts-DwUTH6YN.js → auth-form-parts-B40zvD-a.js} +2 -2
- package/dist/_chunks/{auth-form-parts-DwUTH6YN.js.map → auth-form-parts-B40zvD-a.js.map} +1 -1
- package/dist/_chunks/avatar-BPiPL7ND.js +199 -0
- package/dist/_chunks/avatar-BPiPL7ND.js.map +1 -0
- package/dist/_chunks/{balance-badge-cell-DZNthHO1.js → balance-badge-cell-BG3DMly4.js} +4 -4
- package/dist/_chunks/{balance-badge-cell-DZNthHO1.js.map → balance-badge-cell-BG3DMly4.js.map} +1 -1
- package/dist/_chunks/{bishop-score-CaNTrikJ.js → bishop-score-Df8nF1qg.js} +2 -2
- package/dist/_chunks/{bishop-score-CaNTrikJ.js.map → bishop-score-Df8nF1qg.js.map} +1 -1
- package/dist/_chunks/{booking-tTVxKPQY.js → booking-B1pDbERi.js} +377 -335
- package/dist/_chunks/booking-B1pDbERi.js.map +1 -0
- package/dist/_chunks/{calendar-BhN-jisv.js → calendar-BvOM8rG3.js} +2 -2
- package/dist/_chunks/{calendar-BhN-jisv.js.map → calendar-BvOM8rG3.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-MRrzcxAy.js → calendar-workspace-CYK1M83j.js} +18 -18
- package/dist/_chunks/{calendar-workspace-MRrzcxAy.js.map → calendar-workspace-CYK1M83j.js.map} +1 -1
- package/dist/_chunks/{chat-message-fRLZ95O5.js → chat-message-Be-9vIIQ.js} +2 -2
- package/dist/_chunks/{chat-message-fRLZ95O5.js.map → chat-message-Be-9vIIQ.js.map} +1 -1
- package/dist/_chunks/{clinical-note-card-BnFTIs6x.js → clinical-note-card-Caidqcwa.js} +2 -2
- package/dist/_chunks/{clinical-note-card-BnFTIs6x.js.map → clinical-note-card-Caidqcwa.js.map} +1 -1
- package/dist/_chunks/{color-picker-BsggJovx.js → color-picker-AcaWuKah.js} +99 -95
- package/dist/_chunks/color-picker-AcaWuKah.js.map +1 -0
- package/dist/_chunks/{combobox-U5yfO6o0.js → combobox-vF9O-QoG.js} +92 -83
- package/dist/_chunks/combobox-vF9O-QoG.js.map +1 -0
- package/dist/_chunks/{contact-profile-card-C4-OCshj.js → contact-profile-card-CAwwOqHl.js} +40 -40
- package/dist/_chunks/contact-profile-card-CAwwOqHl.js.map +1 -0
- package/dist/_chunks/{control-room-rail-DUerqHeo.js → control-room-rail-BB6rCDWI.js} +3 -3
- package/dist/_chunks/{control-room-rail-DUerqHeo.js.map → control-room-rail-BB6rCDWI.js.map} +1 -1
- package/dist/_chunks/{country-select-DF5Bd_mn.js → country-select-CSE2Zm_s.js} +2 -2
- package/dist/_chunks/{country-select-DF5Bd_mn.js.map → country-select-CSE2Zm_s.js.map} +1 -1
- package/dist/_chunks/dashboard-grid-7JzaiKnk.js +1487 -0
- package/dist/_chunks/dashboard-grid-7JzaiKnk.js.map +1 -0
- package/dist/_chunks/{data-table-COoCQ4n_.js → data-table-Cty4-Jht.js} +3 -3
- package/dist/_chunks/{data-table-COoCQ4n_.js.map → data-table-Cty4-Jht.js.map} +1 -1
- package/dist/_chunks/{dependent-selector-DBr1AhLg.js → dependent-selector-C4kOgO8b.js} +2 -2
- package/dist/_chunks/{dependent-selector-DBr1AhLg.js.map → dependent-selector-C4kOgO8b.js.map} +1 -1
- package/dist/_chunks/{document-preview-VyQOjFVL.js → document-preview-513f3iPn.js} +4 -4
- package/dist/_chunks/{document-preview-VyQOjFVL.js.map → document-preview-513f3iPn.js.map} +1 -1
- package/dist/_chunks/{document-scanner-CXH_GYh4.js → document-scanner-Bd3wbzpI.js} +2 -2
- package/dist/_chunks/{document-scanner-CXH_GYh4.js.map → document-scanner-Bd3wbzpI.js.map} +1 -1
- package/dist/_chunks/{editable-description-ChGNdYY8.js → editable-description-DnAFi360.js} +2 -2
- package/dist/_chunks/{editable-description-ChGNdYY8.js.map → editable-description-DnAFi360.js.map} +1 -1
- package/dist/_chunks/{entity-summary-Bj-Wxq7Y.js → entity-summary-C2B8yNmc.js} +4 -4
- package/dist/_chunks/{entity-summary-Bj-Wxq7Y.js.map → entity-summary-C2B8yNmc.js.map} +1 -1
- package/dist/_chunks/{error-summary-PUE5Zxp9.js → error-summary-mGxIyDAY.js} +2 -2
- package/dist/_chunks/{error-summary-PUE5Zxp9.js.map → error-summary-mGxIyDAY.js.map} +1 -1
- package/dist/_chunks/{face-scheme-DAD-mXzM.js → face-scheme-CSJdRNad.js} +248 -244
- package/dist/_chunks/{face-scheme-DAD-mXzM.js.map → face-scheme-CSJdRNad.js.map} +1 -1
- package/dist/_chunks/{file-manager-RiV7-OEE.js → file-manager-D4cPnRhL.js} +3 -3
- package/dist/_chunks/{file-manager-RiV7-OEE.js.map → file-manager-D4cPnRhL.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-CPOfRE0C.js → forgot-password-form-Dqi7R-NL.js} +4 -4
- package/dist/_chunks/{forgot-password-form-CPOfRE0C.js.map → forgot-password-form-Dqi7R-NL.js.map} +1 -1
- package/dist/_chunks/format-number-DdzqwMs1.js +13 -0
- package/dist/_chunks/format-number-DdzqwMs1.js.map +1 -0
- package/dist/_chunks/{freemium-paywall-6DO7noHX.js → freemium-paywall-C73C8Rgd.js} +2 -2
- package/dist/_chunks/{freemium-paywall-6DO7noHX.js.map → freemium-paywall-C73C8Rgd.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-CZYa2D6m.js → gestational-age-calculator-Du53p8MH.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CZYa2D6m.js.map → gestational-age-calculator-Du53p8MH.js.map} +1 -1
- package/dist/_chunks/{header-settings-BSH9Gk0J.js → header-settings-DlUbvAUx.js} +37 -36
- package/dist/_chunks/header-settings-DlUbvAUx.js.map +1 -0
- package/dist/_chunks/{heatmap-C1TeC7wT.js → heatmap-DbZIQg14.js} +4 -4
- package/dist/_chunks/{heatmap-C1TeC7wT.js.map → heatmap-DbZIQg14.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-Bw3Q58x-.js → help-me-write-templates-5WkUfvc_.js} +3 -3
- package/dist/_chunks/{help-me-write-templates-Bw3Q58x-.js.map → help-me-write-templates-5WkUfvc_.js.map} +1 -1
- package/dist/_chunks/{kit-extensions-DWs1UEXb.js → kit-extensions-CYvLL4ee.js} +3 -3
- package/dist/_chunks/{kit-extensions-DWs1UEXb.js.map → kit-extensions-CYvLL4ee.js.map} +1 -1
- package/dist/_chunks/length-token-DwMnGEYT.js +24 -0
- package/dist/_chunks/length-token-DwMnGEYT.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-CtTsvfPY.js → link-cell-renderer-DtIsQWDO.js} +4 -4
- package/dist/_chunks/{link-cell-renderer-CtTsvfPY.js.map → link-cell-renderer-DtIsQWDO.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-A-CL3mjt.js → login-dev-card-vEL-o5wq.js} +3 -3
- package/dist/_chunks/{login-dev-card-A-CL3mjt.js.map → login-dev-card-vEL-o5wq.js.map} +1 -1
- package/dist/_chunks/{map-view-BuVfJMEa.js → map-view-CtohteZD.js} +300 -191
- package/dist/_chunks/map-view-CtohteZD.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-DtSX8sYb.js → marketplace-app-shell-CcLQ0Dn-.js} +4 -4
- package/dist/_chunks/{marketplace-app-shell-DtSX8sYb.js.map → marketplace-app-shell-CcLQ0Dn-.js.map} +1 -1
- package/dist/_chunks/{message-card-A3mJNqfy.js → message-card-C_ksqIYM.js} +2 -2
- package/dist/_chunks/{message-card-A3mJNqfy.js.map → message-card-C_ksqIYM.js.map} +1 -1
- package/dist/_chunks/{message-tray-Ft6vSr71.js → message-tray-DCoQ4GQb.js} +3 -3
- package/dist/_chunks/{message-tray-Ft6vSr71.js.map → message-tray-DCoQ4GQb.js.map} +1 -1
- package/dist/_chunks/{multi-select-CMaAQQgb.js → multi-select-BOad3za9.js} +110 -98
- package/dist/_chunks/multi-select-BOad3za9.js.map +1 -0
- package/dist/_chunks/{muscle-scheme-YoN3rYXV.js → muscle-scheme-C66WlCxG.js} +2 -2
- package/dist/_chunks/{muscle-scheme-YoN3rYXV.js.map → muscle-scheme-C66WlCxG.js.map} +1 -1
- package/dist/_chunks/{note-timeline-DDqNU46n.js → note-timeline-KzL52MmB.js} +2 -2
- package/dist/_chunks/{note-timeline-DDqNU46n.js.map → note-timeline-KzL52MmB.js.map} +1 -1
- package/dist/_chunks/{notes-panel-IdsmqRFC.js → notes-panel-BXN46XkF.js} +6 -6
- package/dist/_chunks/{notes-panel-IdsmqRFC.js.map → notes-panel-BXN46XkF.js.map} +1 -1
- package/dist/_chunks/notice-group-DkYzKyAZ.js +291 -0
- package/dist/_chunks/notice-group-DkYzKyAZ.js.map +1 -0
- package/dist/_chunks/{notification-tray-BR3seWA7.js → notification-tray-Cp18MW5b.js} +2 -2
- package/dist/_chunks/{notification-tray-BR3seWA7.js.map → notification-tray-Cp18MW5b.js.map} +1 -1
- package/dist/_chunks/{operator-hero-3_RG4Dkj.js → operator-hero-6aAIQaFZ.js} +83 -66
- package/dist/_chunks/operator-hero-6aAIQaFZ.js.map +1 -0
- package/dist/_chunks/{optical-prescription-CxfMsbxi.js → optical-prescription-ulXnDbBe.js} +525 -509
- package/dist/_chunks/optical-prescription-ulXnDbBe.js.map +1 -0
- package/dist/_chunks/panel-header-CbtlTe85.js +190 -0
- package/dist/_chunks/panel-header-CbtlTe85.js.map +1 -0
- package/dist/_chunks/{panel-subview-yP4qIbKS.js → panel-subview-BPU7220K.js} +2 -2
- package/dist/_chunks/{panel-subview-yP4qIbKS.js.map → panel-subview-BPU7220K.js.map} +1 -1
- package/dist/_chunks/{patient-details-C-EWQTms.js → patient-details-C4Dyo7Ck.js} +4 -4
- package/dist/_chunks/{patient-details-C-EWQTms.js.map → patient-details-C4Dyo7Ck.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-lY-Tb5Mo.js → patient-field-row-DROvUkFu.js} +4 -4
- package/dist/_chunks/{patient-field-row-lY-Tb5Mo.js.map → patient-field-row-DROvUkFu.js.map} +1 -1
- package/dist/_chunks/{patient-search-DpAKidZ5.js → patient-search-BADdx3M1.js} +2 -2
- package/dist/_chunks/{patient-search-DpAKidZ5.js.map → patient-search-BADdx3M1.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-Bpto_VCD.js → patient-summary-card-CAimxbuI.js} +4 -4
- package/dist/_chunks/{patient-summary-card-Bpto_VCD.js.map → patient-summary-card-CAimxbuI.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-BQ307qEX.js → payment-automation-upsell-CiwF5UrC.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-BQ307qEX.js.map → payment-automation-upsell-CiwF5UrC.js.map} +1 -1
- package/dist/_chunks/{payment-form-XKtinW8r.js → payment-form-PBuh8PIa.js} +2 -2
- package/dist/_chunks/{payment-form-XKtinW8r.js.map → payment-form-PBuh8PIa.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-BvoVMjH4.js → pdf-viewer-gAsNUsA8.js} +2 -2
- package/dist/_chunks/{pdf-viewer-BvoVMjH4.js.map → pdf-viewer-gAsNUsA8.js.map} +1 -1
- package/dist/_chunks/{periodontal-risk-chart-CPy7CNFe.js → periodontal-risk-chart-B7S9OmPC.js} +97 -89
- package/dist/_chunks/periodontal-risk-chart-B7S9OmPC.js.map +1 -0
- package/dist/_chunks/practice-profile-hero-qfrsFQI_.js +236 -0
- package/dist/_chunks/practice-profile-hero-qfrsFQI_.js.map +1 -0
- package/dist/_chunks/{practice-results-BrUDDMXC.js → practice-results-BzThnpnm.js} +328 -298
- package/dist/_chunks/practice-results-BzThnpnm.js.map +1 -0
- package/dist/_chunks/{pregnancy-dating-B8wo4l_r.js → pregnancy-dating-EFcFUJkQ.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-B8wo4l_r.js.map → pregnancy-dating-EFcFUJkQ.js.map} +1 -1
- package/dist/_chunks/{privacy-mask-Ch7743uk.js → privacy-mask-CCz9zuIh.js} +2 -2
- package/dist/_chunks/{privacy-mask-Ch7743uk.js.map → privacy-mask-CCz9zuIh.js.map} +1 -1
- package/dist/_chunks/{product-hub-panel-C_ZosrBt.js → product-hub-panel-YuFbNPlT.js} +2 -2
- package/dist/_chunks/{product-hub-panel-C_ZosrBt.js.map → product-hub-panel-YuFbNPlT.js.map} +1 -1
- package/dist/_chunks/progress-notice-DiHWZ8Ms.js +279 -0
- package/dist/_chunks/progress-notice-DiHWZ8Ms.js.map +1 -0
- package/dist/_chunks/{province-select-Bd20Z9Br.js → province-select-CDjs5obD.js} +2 -2
- package/dist/_chunks/{province-select-Bd20Z9Br.js.map → province-select-CDjs5obD.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-8Ewv8-d7.js → radiograph-panel.agent-4UllIoTQ.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-8Ewv8-d7.js.map → radiograph-panel.agent-4UllIoTQ.js.map} +1 -1
- package/dist/_chunks/{rating-C1Vrmpsi.js → rating-CGYpg5dj.js} +43 -44
- package/dist/_chunks/rating-CGYpg5dj.js.map +1 -0
- package/dist/_chunks/{registration-form-BxwqUZzk.js → registration-form-1B0PTDal.js} +4 -4
- package/dist/_chunks/{registration-form-BxwqUZzk.js.map → registration-form-1B0PTDal.js.map} +1 -1
- package/dist/_chunks/{reviews-panel-AvsVgtJu.js → reviews-panel-CosDZyow.js} +29 -7
- package/dist/_chunks/reviews-panel-CosDZyow.js.map +1 -0
- package/dist/_chunks/{rich-text-editor-aCIoptbg.js → rich-text-editor-56dSsyZI.js} +3 -3
- package/dist/_chunks/{rich-text-editor-aCIoptbg.js.map → rich-text-editor-56dSsyZI.js.map} +1 -1
- package/dist/_chunks/{select-k4gBdS8N.js → select-4S-eYZUf.js} +244 -214
- package/dist/_chunks/select-4S-eYZUf.js.map +1 -0
- package/dist/_chunks/{sign-document-D1P1nUQA.js → sign-document-BiOTs1P4.js} +2 -2
- package/dist/_chunks/{sign-document-D1P1nUQA.js.map → sign-document-BiOTs1P4.js.map} +1 -1
- package/dist/_chunks/{signature-request-3u6TvRt2.js → signature-request-DAmNj_uq.js} +5 -5
- package/dist/_chunks/{signature-request-3u6TvRt2.js.map → signature-request-DAmNj_uq.js.map} +1 -1
- package/dist/_chunks/skeleton-tTWJpvAq.js +415 -0
- package/dist/_chunks/skeleton-tTWJpvAq.js.map +1 -0
- package/dist/_chunks/{slot-grid-dj5f6R2w.js → slot-grid-D_gix9mJ.js} +2 -2
- package/dist/_chunks/{slot-grid-dj5f6R2w.js.map → slot-grid-D_gix9mJ.js.map} +1 -1
- package/dist/_chunks/{tabs-2x3L13jn.js → tabs-BTj-2qMZ.js} +2 -2
- package/dist/_chunks/{tabs-2x3L13jn.js.map → tabs-BTj-2qMZ.js.map} +1 -1
- package/dist/_chunks/{task-card-BS7Uqevr.js → task-card-Ci2XbLmq.js} +2 -2
- package/dist/_chunks/{task-card-BS7Uqevr.js.map → task-card-Ci2XbLmq.js.map} +1 -1
- package/dist/_chunks/{task-editor-Bb5MMcid.js → task-editor-BomyxGoZ.js} +8 -8
- package/dist/_chunks/{task-editor-Bb5MMcid.js.map → task-editor-BomyxGoZ.js.map} +1 -1
- package/dist/_chunks/{task-tray-eQU4KJcA.js → task-tray-Dnc72nl-.js} +3 -3
- package/dist/_chunks/{task-tray-eQU4KJcA.js.map → task-tray-Dnc72nl-.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-BOb57Ysw.js → tasks-panel-ATz9JDy8.js} +6 -6
- package/dist/_chunks/{tasks-panel-BOb57Ysw.js.map → tasks-panel-ATz9JDy8.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-Ctb77x6O.js → theme-toggle-DT_Jn4DC.js} +147 -138
- package/dist/_chunks/theme-toggle-DT_Jn4DC.js.map +1 -0
- package/dist/_chunks/{timeline-DEIuHrWz.js → timeline-wUuTDFY_.js} +2 -2
- package/dist/_chunks/{timeline-DEIuHrWz.js.map → timeline-wUuTDFY_.js.map} +1 -1
- package/dist/_chunks/{tool-rail-C-03rH2I.js → tool-rail-C-M3eVdY.js} +2 -2
- package/dist/_chunks/{tool-rail-C-03rH2I.js.map → tool-rail-C-M3eVdY.js.map} +1 -1
- package/dist/_chunks/{transcript-panel-XudW5l6l.js → transcript-panel-CoHHpcFg.js} +2 -2
- package/dist/_chunks/{transcript-panel-XudW5l6l.js.map → transcript-panel-CoHHpcFg.js.map} +1 -1
- package/dist/_chunks/{treatment-receipt-Cpm8tqQN.js → treatment-receipt-pFqWFyD_.js} +2 -2
- package/dist/_chunks/{treatment-receipt-Cpm8tqQN.js.map → treatment-receipt-pFqWFyD_.js.map} +1 -1
- package/dist/_chunks/{unit-converter-BPZ0Ldkb.js → unit-converter-CIoTmCmP.js} +2 -2
- package/dist/_chunks/{unit-converter-BPZ0Ldkb.js.map → unit-converter-CIoTmCmP.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-CVSPoP5j.js → use-appointment-details-read-CUGfE0hV.js} +12 -12
- package/dist/_chunks/{use-appointment-details-read-CVSPoP5j.js.map → use-appointment-details-read-CUGfE0hV.js.map} +1 -1
- package/dist/_chunks/use-dismissed-CTOWqA0e.js +177 -0
- package/dist/_chunks/use-dismissed-CTOWqA0e.js.map +1 -0
- package/dist/_chunks/{voice-control-panel-BJIEbDq6.js → voice-control-panel-B8Lrk0C4.js} +4 -4
- package/dist/_chunks/{voice-control-panel-BJIEbDq6.js.map → voice-control-panel-B8Lrk0C4.js.map} +1 -1
- package/dist/_chunks/{warning-stack-BdY-0bd3.js → warning-stack-BhHUmRiD.js} +2 -2
- package/dist/_chunks/{warning-stack-BdY-0bd3.js.map → warning-stack-BhHUmRiD.js.map} +1 -1
- package/dist/_chunks/{workflow-map-CYbRD9ek.js → workflow-map-ln4_OG8A.js} +2 -2
- package/dist/_chunks/{workflow-map-CYbRD9ek.js.map → workflow-map-ln4_OG8A.js.map} +1 -1
- package/dist/agent-catalog.json +172 -4
- package/dist/agent-i18n/en.json +25 -1
- package/dist/components/_shared/format-number.d.ts +20 -0
- package/dist/components/_shared/format-number.d.ts.map +1 -0
- package/dist/components/_shared/length-token.d.ts +12 -0
- package/dist/components/_shared/length-token.d.ts.map +1 -0
- package/dist/components/_shared/option.d.ts +1 -0
- package/dist/components/_shared/option.d.ts.map +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-credits-notice/index.js +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/alert.d.ts +26 -0
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/anamnesis-summary-card/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- 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/audio-recorder/index.js +1 -1
- package/dist/components/avatar/avatar.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/chat-message/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/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/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/country-select/index.js +1 -1
- package/dist/components/dashboard-grid/dashboard-grid.agent.d.ts.map +1 -1
- package/dist/components/dashboard-grid/dashboard-grid.d.ts +20 -1
- 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/dependent-selector/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/editable-description/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/error-summary/index.js +1 -1
- package/dist/components/face-scheme/face-scheme.d.ts.map +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/header-settings/header-settings.d.ts.map +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/map-view/index.d.ts +1 -1
- package/dist/components/map-view/index.d.ts.map +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +51 -0
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/muscle-scheme/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/notice-group/index.d.ts +3 -0
- package/dist/components/notice-group/index.d.ts.map +1 -0
- package/dist/components/notice-group/index.js +6 -0
- package/dist/components/notice-group/index.js.map +1 -0
- package/dist/components/notice-group/notice-group.agent.d.ts +4 -0
- package/dist/components/notice-group/notice-group.agent.d.ts.map +1 -0
- package/dist/components/notice-group/notice-group.d.ts +43 -0
- package/dist/components/notice-group/notice-group.d.ts.map +1 -0
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/operator-hero/operator-hero.d.ts.map +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/optical-prescription/optical-prescription-data.d.ts +8 -8
- package/dist/components/optical-prescription/optical-prescription-data.d.ts.map +1 -1
- package/dist/components/optical-prescription/optical-prescription.d.ts.map +1 -1
- package/dist/components/panel-header/index.js +1 -1
- package/dist/components/panel-header/panel-header.d.ts +10 -0
- package/dist/components/panel-header/panel-header.d.ts.map +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/periodontal-risk-chart/index.js +1 -1
- package/dist/components/periodontal-risk-chart/periodontal-risk-chart.d.ts.map +1 -1
- package/dist/components/practice-profile-hero/index.js +1 -1
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +4 -1
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +10 -2
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/progress-notice/index.d.ts +3 -0
- package/dist/components/progress-notice/index.d.ts.map +1 -0
- package/dist/components/progress-notice/index.js +6 -0
- package/dist/components/progress-notice/index.js.map +1 -0
- package/dist/components/progress-notice/progress-notice.agent.d.ts +4 -0
- package/dist/components/progress-notice/progress-notice.agent.d.ts.map +1 -0
- package/dist/components/progress-notice/progress-notice.d.ts +81 -0
- package/dist/components/progress-notice/progress-notice.d.ts.map +1 -0
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rating/index.js +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +6 -0
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/skeleton/index.d.ts +1 -1
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/skeleton/skeleton.d.ts +41 -1
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/treatment-receipt/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +81 -76
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-dismissed.d.ts +58 -0
- package/dist/hooks/use-dismissed.d.ts.map +1 -0
- package/dist/i18n/locales/ar.d.ts +22 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +22 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +22 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +22 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +22 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +22 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +22 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +22 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +22 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +22 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +22 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +22 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +22 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +22 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +22 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +22 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +22 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +22 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +22 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +22 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +22 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +22 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +22 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +22 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +22 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +22 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +22 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +22 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +22 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +22 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +22 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +22 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +22 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +22 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +22 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +22 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1194 -1183
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +22 -0
- package/dist/locales/de.json +22 -0
- package/dist/locales/el.json +22 -0
- package/dist/locales/en.json +22 -0
- package/dist/locales/es.json +22 -0
- package/dist/locales/fr.json +22 -0
- package/dist/locales/hi.json +22 -0
- package/dist/locales/it.json +22 -0
- package/dist/locales/ja.json +22 -0
- package/dist/locales/nl.json +22 -0
- package/dist/locales/pl.json +22 -0
- package/dist/locales/pt.json +22 -0
- package/dist/locales/ro.json +22 -0
- package/dist/locales/ru.json +22 -0
- package/dist/locales/sq.json +22 -0
- package/dist/locales/sv.json +22 -0
- package/dist/locales/tr.json +22 -0
- package/dist/locales/zh.json +22 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts.map +1 -1
- 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 +2 -2
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +9 -1
- package/dist/_chunks/ai-prompt-input-DSGSe4LH.js.map +0 -1
- package/dist/_chunks/alert-DjsJMGRE.js.map +0 -1
- package/dist/_chunks/anamnesis-summary-rows-BQ_EokKz.js.map +0 -1
- package/dist/_chunks/avatar-WZY3eGE7.js +0 -123
- package/dist/_chunks/avatar-WZY3eGE7.js.map +0 -1
- package/dist/_chunks/booking-tTVxKPQY.js.map +0 -1
- package/dist/_chunks/color-picker-BsggJovx.js.map +0 -1
- package/dist/_chunks/combobox-U5yfO6o0.js.map +0 -1
- package/dist/_chunks/contact-profile-card-C4-OCshj.js.map +0 -1
- package/dist/_chunks/dashboard-grid-B2MB7SRS.js +0 -1428
- package/dist/_chunks/dashboard-grid-B2MB7SRS.js.map +0 -1
- package/dist/_chunks/header-settings-BSH9Gk0J.js.map +0 -1
- package/dist/_chunks/map-view-BuVfJMEa.js.map +0 -1
- package/dist/_chunks/multi-select-CMaAQQgb.js.map +0 -1
- package/dist/_chunks/operator-hero-3_RG4Dkj.js.map +0 -1
- package/dist/_chunks/optical-prescription-CxfMsbxi.js.map +0 -1
- package/dist/_chunks/panel-header-BJkaUwnl.js +0 -128
- package/dist/_chunks/panel-header-BJkaUwnl.js.map +0 -1
- package/dist/_chunks/periodontal-risk-chart-CPy7CNFe.js.map +0 -1
- package/dist/_chunks/practice-profile-hero-Dfc0F60y.js +0 -193
- package/dist/_chunks/practice-profile-hero-Dfc0F60y.js.map +0 -1
- package/dist/_chunks/practice-results-BrUDDMXC.js.map +0 -1
- package/dist/_chunks/rating-C1Vrmpsi.js.map +0 -1
- package/dist/_chunks/reviews-panel-AvsVgtJu.js.map +0 -1
- package/dist/_chunks/select-k4gBdS8N.js.map +0 -1
- package/dist/_chunks/skeleton-B1KTdJ4N.js +0 -116
- package/dist/_chunks/skeleton-B1KTdJ4N.js.map +0 -1
- package/dist/_chunks/theme-toggle-Ctb77x6O.js.map +0 -1
|
@@ -2,8 +2,8 @@ import { jsx as c } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as k, useRef as N, useEffect as O, useCallback as D, useMemo as B } from "react";
|
|
3
3
|
import { c as H } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as K } from "react-i18next";
|
|
5
|
-
import { C as M } from "./country-select-
|
|
6
|
-
import { P as U } from "./province-select-
|
|
5
|
+
import { C as M } from "./country-select-CSE2Zm_s.js";
|
|
6
|
+
import { P as U } from "./province-select-CDjs5obD.js";
|
|
7
7
|
import { P as W } from "./postal-code-input-CfZOnIkW.js";
|
|
8
8
|
import { C as Y } from "./city-input-3J3bz9EO.js";
|
|
9
9
|
import { T as z } from "./text-input-CaG9ApoE.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-BUPRs3n-.js.map
|
|
@@ -1 +1 @@
|
|
|
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,MAA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WxC,EAAW,IAAIwC,CAAG,IAAI,kBAAkB;AAAA,QAElD,UAAAY;AAAA,MAAA;AAAA,MAJIZ;AAAA,IAAA,IAOP,gBAAAG,EAAC,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-BUPRs3n-.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;AAA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,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;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as h } from "react";
|
|
3
3
|
import { c as x } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as y } from "react-i18next";
|
|
5
|
-
import { A as N } from "./avatar-
|
|
5
|
+
import { A as N } from "./avatar-BPiPL7ND.js";
|
|
6
6
|
import { B as C } from "./badge-BUk4RjTS.js";
|
|
7
7
|
import { i as w } from "./is-safe-url-DkETxeHz.js";
|
|
8
8
|
import { C as k } from "./chevron-right-I9AeSxH2.js";
|
|
@@ -144,4 +144,4 @@ z.displayName = "AgendaCard";
|
|
|
144
144
|
export {
|
|
145
145
|
z as A
|
|
146
146
|
};
|
|
147
|
-
//# sourceMappingURL=agenda-card-
|
|
147
|
+
//# sourceMappingURL=agenda-card-BDuvreCe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agenda-card-DR9gDdKp.js","sources":["../../src/components/agenda-card/agenda-card.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronRight } from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../badge/badge';\nimport { isSafeEntityUrl } from '../_shared/is-safe-url';\n\n// Back-compat alias — the URL guard now lives in the shared entity-card\n// helper. Existing consumers (and this dir's tests) import isSafeAgendaUrl.\nexport { isSafeEntityUrl as isSafeAgendaUrl } from '../_shared/is-safe-url';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport type AppointmentStatus =\n | 'confirmed'\n | 'pending'\n | 'cancelled'\n | 'absent';\n\nexport interface AgendaItem {\n /** Unique identifier for the appointment. */\n id: string;\n /** Display time string (e.g. \"09:00\"). Localised by the consumer. */\n time: string;\n /**\n * Localised date eyebrow (e.g. \"Thu 12 Jun\") rendered under the time —\n * for agendas spanning more than today (upcoming-appointments queues).\n */\n dateLabel?: string;\n /** Patient identity — drives the avatar's initials + accessible name. */\n patient: { name: string; avatarUrl?: string };\n /** Treatment / appointment type — short localised label. */\n treatment?: string;\n /**\n * Context line under the treatment (e.g. \"Dr. Bianchi · Chair 2\").\n * Localised and pre-joined by the consumer.\n */\n meta?: string;\n /** Free-text booking note — muted body line, clamped. */\n note?: string;\n /** Lifecycle state — drives a trailing status chip. */\n status?: AppointmentStatus;\n /** Optional deep link — when present the row is an anchor. */\n url?: string;\n}\n\nexport interface AgendaCardProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'role' | 'title'>,\n VariantProps<typeof agendaCardVariants> {\n /** The appointment to render. */\n item: AgendaItem;\n /** Visual density. */\n size?: 'sm' | 'md';\n /** Fires when the row is activated. */\n onActivate?: (item: AgendaItem) => void;\n /**\n * Trailing per-row action toolbar. Rendered above the stretched-link\n * overlay so the controls stay clickable inside an interactive row.\n */\n actions?: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst agendaCardVariants = cva(\n [\n 'ds:relative ds:flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:transition-colors',\n 'ds:motion-reduce:transition-none',\n 'ds:text-start ds:group',\n 'ds:forced-colors:border ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:p-[var(--spacing-sm)]',\n md: 'ds:p-[var(--spacing-md)]',\n },\n interactive: {\n true: 'ds:hover:bg-[color:var(--muted)]/40 ds:cursor-pointer',\n false: '',\n },\n },\n defaultVariants: {\n size: 'sm',\n interactive: false,\n },\n },\n);\n\nconst stretchedLinkClass = [\n 'ds:focus-visible:outline-none',\n \"ds:after:content-[''] ds:after:absolute ds:after:inset-0 ds:after:rounded-[var(--radius-sm)]\",\n 'ds:after:pointer-events-auto',\n 'ds:focus-visible:after:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:after:outline-solid',\n 'ds:focus-visible:after:outline-[color:var(--ring)]',\n 'ds:focus-visible:after:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:after:outline-[CanvasText]',\n].join(' ');\n\nconst STATUS_TONE: Record<AppointmentStatus, 'success' | 'warning' | 'error'> =\n {\n confirmed: 'success',\n pending: 'warning',\n cancelled: 'error',\n absent: 'error',\n };\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const AgendaCard = forwardRef<HTMLDivElement, AgendaCardProps>(\n ({ item, size = 'sm', onActivate, actions, className, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n const interactive = !!onActivate;\n const hasSafeUrl = !!item.url && isSafeEntityUrl(item.url);\n const baseLabel = t('agendaCard.itemLabel', {\n time: item.time,\n patient: item.patient.name,\n treatment: item.treatment ?? '',\n defaultValue: '{{time}} · {{patient}}{{treatment, prepend, \" · \"}}',\n });\n // dateLabel renders inside the aria-hidden time column, so it must be\n // prepended here or multi-day rows get identical accessible names.\n const ariaLabel = item.dateLabel\n ? `${item.dateLabel} · ${baseLabel}`\n : baseLabel;\n\n const titleNode = (\n <span className=\"ds:flex-1 ds:min-w-0 ds:truncate type-body-sm ds:text-[color:var(--foreground)]\">\n {item.patient.name}\n </span>\n );\n\n let activator: ReactNode;\n if (interactive && hasSafeUrl) {\n activator = (\n <a\n href={item.url}\n aria-label={ariaLabel}\n className={stretchedLinkClass + ' ds:contents'}\n onClick={(e) => {\n if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.shiftKey)\n return;\n onActivate?.(item);\n }}\n >\n {titleNode}\n </a>\n );\n } else if (interactive) {\n activator = (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n className={\n stretchedLinkClass +\n ' ds:contents ds:bg-transparent ds:border-0 ds:p-0 ds:text-start'\n }\n onClick={() => onActivate?.(item)}\n >\n {titleNode}\n </button>\n );\n } else {\n activator = titleNode;\n }\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n data-component=\"agenda-card\"\n data-component-id={item.id}\n data-status={item.status ?? 'confirmed'}\n className={agendaCardVariants({ size, interactive, className })}\n {...rest}\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:flex-col ds:w-12 ds:shrink-0 type-body-sm ds:font-medium ds:text-[color:var(--foreground)] ds:tabular-nums\"\n >\n {item.time}\n {item.dateLabel ? (\n <span className=\"type-eyebrow ds:font-normal ds:text-[color:var(--muted-foreground)]\">\n {item.dateLabel}\n </span>\n ) : null}\n </span>\n\n <Avatar\n name={item.patient.name}\n src={item.patient.avatarUrl}\n size={size === 'md' ? 'md' : 'sm'}\n className=\"ds:shrink-0\"\n aria-hidden=\"true\"\n role=\"presentation\"\n aria-label={undefined}\n />\n\n <div className=\"ds:flex-1 ds:min-w-0 ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {activator}\n {item.treatment ? (\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)] ds:truncate\">\n {item.treatment}\n </span>\n ) : null}\n {item.meta ? (\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)] ds:truncate\">\n {item.meta}\n </span>\n ) : null}\n {item.note ? (\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)] ds:line-clamp-2\">\n {item.note}\n </span>\n ) : null}\n </div>\n\n {actions ? (\n // Above the stretched-link overlay so the buttons stay clickable.\n <span className=\"ds:relative ds:z-[1] ds:flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:shrink-0\">\n {actions}\n </span>\n ) : null}\n\n {item.status && item.status !== 'confirmed' ? (\n <Badge\n variant={STATUS_TONE[item.status]}\n size=\"sm\"\n withDot\n className=\"ds:shrink-0\"\n >\n {t(`agendaCard.status.${item.status}`, item.status)}\n </Badge>\n ) : null}\n\n {interactive ? (\n <ChevronRight\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:opacity-0 ds:transition-opacity ds:motion-reduce:transition-none ds:group-hover:opacity-100 ds:group-focus-within:opacity-100 ds:rtl:rotate-180\"\n />\n ) : null}\n </div>\n );\n },\n);\n\nAgendaCard.displayName = 'AgendaCard';\n"],"names":["agendaCardVariants","cva","stretchedLinkClass","STATUS_TONE","AgendaCard","forwardRef","item","size","onActivate","actions","className","rest","ref","t","useTranslation","interactive","hasSafeUrl","isSafeEntityUrl","baseLabel","ariaLabel","titleNode","jsx","activator","e","jsxs","Avatar","Badge","ChevronRight"],"mappings":";;;;;;;;AAsEA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,aAAa;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEMC,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG,GAEJC,IACJ;AAAA,EACE,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AACV,GAMWC,IAAaC;AAAA,EACxB,CAAC,EAAE,MAAAC,GAAM,MAAAC,IAAO,MAAM,YAAAC,GAAY,SAAAC,GAAS,WAAAC,GAAW,GAAGC,EAAA,GAAQC,MAAQ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AA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA,IAEV;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAvB,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"agenda-card-BDuvreCe.js","sources":["../../src/components/agenda-card/agenda-card.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronRight } from 'lucide-react';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../badge/badge';\nimport { isSafeEntityUrl } from '../_shared/is-safe-url';\n\n// Back-compat alias — the URL guard now lives in the shared entity-card\n// helper. Existing consumers (and this dir's tests) import isSafeAgendaUrl.\nexport { isSafeEntityUrl as isSafeAgendaUrl } from '../_shared/is-safe-url';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport type AppointmentStatus =\n | 'confirmed'\n | 'pending'\n | 'cancelled'\n | 'absent';\n\nexport interface AgendaItem {\n /** Unique identifier for the appointment. */\n id: string;\n /** Display time string (e.g. \"09:00\"). Localised by the consumer. */\n time: string;\n /**\n * Localised date eyebrow (e.g. \"Thu 12 Jun\") rendered under the time —\n * for agendas spanning more than today (upcoming-appointments queues).\n */\n dateLabel?: string;\n /** Patient identity — drives the avatar's initials + accessible name. */\n patient: { name: string; avatarUrl?: string };\n /** Treatment / appointment type — short localised label. */\n treatment?: string;\n /**\n * Context line under the treatment (e.g. \"Dr. Bianchi · Chair 2\").\n * Localised and pre-joined by the consumer.\n */\n meta?: string;\n /** Free-text booking note — muted body line, clamped. */\n note?: string;\n /** Lifecycle state — drives a trailing status chip. */\n status?: AppointmentStatus;\n /** Optional deep link — when present the row is an anchor. */\n url?: string;\n}\n\nexport interface AgendaCardProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'role' | 'title'>,\n VariantProps<typeof agendaCardVariants> {\n /** The appointment to render. */\n item: AgendaItem;\n /** Visual density. */\n size?: 'sm' | 'md';\n /** Fires when the row is activated. */\n onActivate?: (item: AgendaItem) => void;\n /**\n * Trailing per-row action toolbar. Rendered above the stretched-link\n * overlay so the controls stay clickable inside an interactive row.\n */\n actions?: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst agendaCardVariants = cva(\n [\n 'ds:relative ds:flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:transition-colors',\n 'ds:motion-reduce:transition-none',\n 'ds:text-start ds:group',\n 'ds:forced-colors:border ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:p-[var(--spacing-sm)]',\n md: 'ds:p-[var(--spacing-md)]',\n },\n interactive: {\n true: 'ds:hover:bg-[color:var(--muted)]/40 ds:cursor-pointer',\n false: '',\n },\n },\n defaultVariants: {\n size: 'sm',\n interactive: false,\n },\n },\n);\n\nconst stretchedLinkClass = [\n 'ds:focus-visible:outline-none',\n \"ds:after:content-[''] ds:after:absolute ds:after:inset-0 ds:after:rounded-[var(--radius-sm)]\",\n 'ds:after:pointer-events-auto',\n 'ds:focus-visible:after:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:after:outline-solid',\n 'ds:focus-visible:after:outline-[color:var(--ring)]',\n 'ds:focus-visible:after:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:after:outline-[CanvasText]',\n].join(' ');\n\nconst STATUS_TONE: Record<AppointmentStatus, 'success' | 'warning' | 'error'> =\n {\n confirmed: 'success',\n pending: 'warning',\n cancelled: 'error',\n absent: 'error',\n };\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const AgendaCard = forwardRef<HTMLDivElement, AgendaCardProps>(\n ({ item, size = 'sm', onActivate, actions, className, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n const interactive = !!onActivate;\n const hasSafeUrl = !!item.url && isSafeEntityUrl(item.url);\n const baseLabel = t('agendaCard.itemLabel', {\n time: item.time,\n patient: item.patient.name,\n treatment: item.treatment ?? '',\n defaultValue: '{{time}} · {{patient}}{{treatment, prepend, \" · \"}}',\n });\n // dateLabel renders inside the aria-hidden time column, so it must be\n // prepended here or multi-day rows get identical accessible names.\n const ariaLabel = item.dateLabel\n ? `${item.dateLabel} · ${baseLabel}`\n : baseLabel;\n\n const titleNode = (\n <span className=\"ds:flex-1 ds:min-w-0 ds:truncate type-body-sm ds:text-[color:var(--foreground)]\">\n {item.patient.name}\n </span>\n );\n\n let activator: ReactNode;\n if (interactive && hasSafeUrl) {\n activator = (\n <a\n href={item.url}\n aria-label={ariaLabel}\n className={stretchedLinkClass + ' ds:contents'}\n onClick={(e) => {\n if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.shiftKey)\n return;\n onActivate?.(item);\n }}\n >\n {titleNode}\n </a>\n );\n } else if (interactive) {\n activator = (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n className={\n stretchedLinkClass +\n ' ds:contents ds:bg-transparent ds:border-0 ds:p-0 ds:text-start'\n }\n onClick={() => onActivate?.(item)}\n >\n {titleNode}\n </button>\n );\n } else {\n activator = titleNode;\n }\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n data-component=\"agenda-card\"\n data-component-id={item.id}\n data-status={item.status ?? 'confirmed'}\n className={agendaCardVariants({ size, interactive, className })}\n {...rest}\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:flex-col ds:w-12 ds:shrink-0 type-body-sm ds:font-medium ds:text-[color:var(--foreground)] ds:tabular-nums\"\n >\n {item.time}\n {item.dateLabel ? (\n <span className=\"type-eyebrow ds:font-normal ds:text-[color:var(--muted-foreground)]\">\n {item.dateLabel}\n </span>\n ) : null}\n </span>\n\n <Avatar\n name={item.patient.name}\n src={item.patient.avatarUrl}\n size={size === 'md' ? 'md' : 'sm'}\n className=\"ds:shrink-0\"\n aria-hidden=\"true\"\n role=\"presentation\"\n aria-label={undefined}\n />\n\n <div className=\"ds:flex-1 ds:min-w-0 ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n {activator}\n {item.treatment ? (\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)] ds:truncate\">\n {item.treatment}\n </span>\n ) : null}\n {item.meta ? (\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)] ds:truncate\">\n {item.meta}\n </span>\n ) : null}\n {item.note ? (\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)] ds:line-clamp-2\">\n {item.note}\n </span>\n ) : null}\n </div>\n\n {actions ? (\n // Above the stretched-link overlay so the buttons stay clickable.\n <span className=\"ds:relative ds:z-[1] ds:flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:shrink-0\">\n {actions}\n </span>\n ) : null}\n\n {item.status && item.status !== 'confirmed' ? (\n <Badge\n variant={STATUS_TONE[item.status]}\n size=\"sm\"\n withDot\n className=\"ds:shrink-0\"\n >\n {t(`agendaCard.status.${item.status}`, item.status)}\n </Badge>\n ) : null}\n\n {interactive ? (\n <ChevronRight\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:opacity-0 ds:transition-opacity ds:motion-reduce:transition-none ds:group-hover:opacity-100 ds:group-focus-within:opacity-100 ds:rtl:rotate-180\"\n />\n ) : null}\n </div>\n );\n },\n);\n\nAgendaCard.displayName = 'AgendaCard';\n"],"names":["agendaCardVariants","cva","stretchedLinkClass","STATUS_TONE","AgendaCard","forwardRef","item","size","onActivate","actions","className","rest","ref","t","useTranslation","interactive","hasSafeUrl","isSafeEntityUrl","baseLabel","ariaLabel","titleNode","jsx","activator","e","jsxs","Avatar","Badge","ChevronRight"],"mappings":";;;;;;;;AAsEA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,IACE;AAAA,IACA;AAAA,IACA;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AhB,EAAK,YACJ,gBAAAe,EAAC,QAAA,EAAK,WAAU,oEACb,UAAAf,EAAK,WACR,IACE;AAAA,YACHA,EAAK,OACJ,gBAAAe,EAAC,QAAA,EAAK,WAAU,oEACb,UAAAf,EAAK,MACR,IACE;AAAA,YACHA,EAAK,OACJ,gBAAAe,EAAC,QAAA,EAAK,WAAU,wEACb,UAAAf,EAAK,MACR,IACE;AAAA,UAAA,GACN;AAAA,UAECG;AAAA;AAAA,YAEC,gBAAAY,EAAC,QAAA,EAAK,WAAU,wFACb,UAAAZ,EAAA,CACH;AAAA,cACE;AAAA,UAEHH,EAAK,UAAUA,EAAK,WAAW,cAC9B,gBAAAe;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,SAASvB,EAAYG,EAAK,MAAM;AAAA,cAChC,MAAK;AAAA,cACL,SAAO;AAAA,cACP,WAAU;AAAA,cAET,YAAE,qBAAqBA,EAAK,MAAM,IAAIA,EAAK,MAAM;AAAA,YAAA;AAAA,UAAA,IAElD;AAAA,UAEHS,IACC,gBAAAM;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA,IAEV;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAvB,EAAW,cAAc;"}
|
|
@@ -3,9 +3,9 @@ import { forwardRef as _, useRef as w, useImperativeHandle as q, useMemo as B }
|
|
|
3
3
|
import { c as H } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as K } from "react-i18next";
|
|
5
5
|
import { I as M } from "./icon-button-C_1TgRiK.js";
|
|
6
|
-
import { S as A } from "./skeleton-
|
|
6
|
+
import { S as A } from "./skeleton-tTWJpvAq.js";
|
|
7
7
|
import { E as D } from "./empty-state-pL1qum99.js";
|
|
8
|
-
import { A as V } from "./agenda-card-
|
|
8
|
+
import { A as V } from "./agenda-card-BDuvreCe.js";
|
|
9
9
|
import { u as F } from "./registry-DvAUVLHh.js";
|
|
10
10
|
import { C as G } from "./calendar-days-BGWklvE-.js";
|
|
11
11
|
import { P as J } from "./plus-DzMQ_c6b.js";
|
|
@@ -212,4 +212,4 @@ export {
|
|
|
212
212
|
U as A,
|
|
213
213
|
L as a
|
|
214
214
|
};
|
|
215
|
-
//# sourceMappingURL=agenda-tray-
|
|
215
|
+
//# sourceMappingURL=agenda-tray-CfwylhWf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agenda-tray-DGB1Zup-.js","sources":["../../src/components/agenda-tray/agenda-tray.agent.ts","../../src/components/agenda-tray/agenda-tray.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AgendaTray. */\n/* */\n/* Tray-level surface: read appointment ids + lifecycle status (never */\n/* patient names / treatments), and route an activation through the */\n/* curated handle. AgendaTray is in-page (no open/close). */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AgendaTrayHandle } from './agenda-tray';\n\nexport const agendaTrayAgent: AgentAdapter<AgendaTrayHandle> = {\n id: 'agenda-tray',\n // `pick` (NON-persisting): select_item activates / opens an appointment by\n // firing onOpenAppointment — it does not store a \"selected\" value on the tray\n // (there is no selection state slot), so this is a pick, not select_single.\n capabilities: ['pick'],\n state: {\n items: {\n type: 'Array<{ id: string; status: string }>',\n descriptionKey: 'ui.agent.agendaTray.state.items',\n description:\n 'Currently-displayed appointments. Ids + status only — never patient identity.',\n read: (handle) => handle.getItems(),\n },\n },\n actions: {\n select_item: {\n // Activates (opens) an appointment — pure navigation, no data mutation.\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n descriptionKey: 'ui.agent.agendaTray.actions.selectItem',\n description: 'Activate the appointment with the given id.',\n examples: [\n { args: { id: 'appt-204' }, note: 'Open appointment appt-204.' },\n ],\n invoke: (handle, args: { id: string }) => {\n handle.selectItem(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'agenda-tray',\n description: 'Marks the AgendaTray wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific tray from the agent.',\n },\n item: {\n attr: 'data-appointment-id',\n description:\n 'Stable appointment id emitted on each rendered AgendaCard inside the tray.',\n },\n },\n};\n","import {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarDays, Plus } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { Skeleton } from '../skeleton/skeleton';\nimport { EmptyState } from '../empty-state/empty-state';\nimport { AgendaCard, type AgendaItem } from '../agenda-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { agendaTrayAgent } from './agenda-tray.agent';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst agendaTrayVariants = cva(\n [\n 'ds:flex ds:flex-col',\n 'ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)]',\n 'ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))] ds:border-[color:var(--card-border)]',\n 'ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]',\n 'ds:overflow-hidden',\n ].join(' '),\n {\n variants: {\n size: {\n sm: '',\n md: '',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\n/**\n * Curated imperative handle for AgendaTray. Exposed as the forwardRef\n * target so a future agent / MCP UI bridge can drive the tray without\n * touching the DOM. See `agenda-tray.agent.ts`.\n */\nexport interface AgendaTrayHandle {\n getItems: () => Array<{ id: string; status: string }>;\n selectItem: (id: string) => void;\n}\n\nexport interface AgendaTrayProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'onClick' | 'id'>,\n VariantProps<typeof agendaTrayVariants> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so\n * an agent / MCP UI bridge can address this specific tray.\n */\n id?: string;\n items: AgendaItem[];\n /** Section title — rendered in the header. Localised by the consumer. */\n title?: string;\n /** Optional small caption (e.g. localised date) shown next to the title. */\n caption?: string;\n size?: 'sm' | 'md';\n onOpenAppointment?: (item: AgendaItem) => void;\n onAddAppointment?: () => void;\n /** Localised label for the \"Add\" affordance. */\n addLabel?: string;\n loading?: boolean;\n emptyTitle?: string;\n emptyDescription?: string;\n /** Optional CTA wired into the empty state (EmptyState primaryAction). */\n emptyAction?: { label: string; onClick: () => void };\n /**\n * Pinned footer link (e.g. \"All upcoming appointments\"). Localised by\n * the consumer; rendered after the list, before the section closes.\n */\n viewAllLabel?: string;\n /** Fires when the footer link is activated. Required to render it. */\n onViewAll?: () => void;\n /**\n * Per-row trailing action toolbar, forwarded to each AgendaCard's\n * `actions` slot.\n */\n renderItemActions?: (item: AgendaItem) => ReactNode;\n /**\n * Constrain the list to the tray's own height and scroll inside it —\n * pair with a height/max-height on `className`. The scroll region is\n * keyboard-focusable so it stays operable without a pointer.\n */\n scrollable?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const AgendaTray = forwardRef<HTMLElement, AgendaTrayProps>(\n (\n {\n id,\n items,\n title,\n caption,\n size = 'sm',\n onOpenAppointment,\n onAddAppointment,\n addLabel,\n loading = false,\n emptyTitle,\n emptyDescription,\n emptyAction,\n viewAllLabel,\n onViewAll,\n renderItemActions,\n scrollable = false,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const heading = title ?? t('agendaTray.title', \"Today's appointments\");\n const resolvedAddLabel = addLabel ?? t('agendaTray.add', 'Add appointment');\n const isEmpty = !loading && items.length === 0;\n\n let body: ReactNode;\n if (loading) {\n body = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\">\n {[0, 1, 2].map((i) => (\n <Skeleton key={i} variant=\"rectangular\" height=\"2.5rem\" />\n ))}\n </div>\n );\n } else if (isEmpty) {\n body = (\n <div className=\"ds:p-[var(--spacing-md)]\">\n <EmptyState\n variant=\"first-use\"\n size=\"sm\"\n title={emptyTitle ?? t('agendaTray.empty.title', 'No appointments')}\n description={\n emptyDescription ??\n t(\n 'agendaTray.empty.description',\n 'New appointments will appear here.',\n )\n }\n primaryAction={emptyAction}\n />\n </div>\n );\n } else {\n body = (\n <ul\n className={[\n // flex-1 unconditionally so a footer pins to the tray's\n // bottom edge in equal-height grid rows.\n 'ds:flex ds:list-none ds:flex-col ds:flex-1 ds:min-h-0',\n // Keyboard-focusable when it scrolls (axe\n // scrollable-region-focusable) — pair with a height on the\n // tray's className.\n scrollable ? 'ds:overflow-y-auto' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- scrollable list must be keyboard focusable (axe scrollable-region-focusable)\n tabIndex={scrollable ? 0 : undefined}\n aria-label={scrollable ? heading : undefined}\n >\n {items.map((item) => (\n <AgendaCard\n key={item.id}\n item={item}\n size={size}\n onActivate={onOpenAppointment}\n actions={renderItemActions?.(item)}\n data-appointment-id={item.id}\n />\n ))}\n </ul>\n );\n }\n\n /* Curated imperative handle for agent integration. See\n * agenda-tray.agent.ts. */\n const itemsRef = useRef<AgendaItem[]>(items);\n itemsRef.current = items;\n\n const innerRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => innerRef.current as HTMLElement, []);\n\n const handle = useMemo<AgendaTrayHandle>(\n () => ({\n getItems: () =>\n itemsRef.current.map((i) => ({\n id: i.id,\n status: i.status ?? 'confirmed',\n })),\n selectItem: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onOpenAppointment?.(found);\n },\n }),\n [onOpenAppointment],\n );\n\n useAgentRegistration(agendaTrayAgent, handle, id);\n\n return (\n <section\n ref={innerRef}\n aria-label={heading}\n data-component=\"agenda-tray\"\n data-component-id={id}\n className={agendaTrayVariants({ size, className })}\n {...rest}\n >\n <header className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:min-w-0\">\n <h3 className=\"ds:m-0 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-card\">\n <CalendarDays aria-hidden=\"true\" className=\"ds:size-4\" />\n {heading}\n </h3>\n {caption ? (\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {caption}\n </span>\n ) : null}\n </div>\n {onAddAppointment ? (\n <IconButton\n icon={<Plus />}\n intent=\"outline\"\n size=\"sm\"\n aria-label={resolvedAddLabel}\n onClick={onAddAppointment}\n />\n ) : null}\n </header>\n {body}\n {viewAllLabel && onViewAll && !isEmpty && !loading ? (\n <footer className=\"ds:[border-block-start:var(--border-width-sm)_solid_var(--card-border)] ds:p-[var(--spacing-sm)]\">\n <button\n type=\"button\"\n onClick={onViewAll}\n className={[\n 'type-label ds:text-[color:var(--link)] ds:underline ds:underline-offset-2 ds:hover:no-underline',\n 'ds:rounded-[var(--radius-sm)] ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n >\n {viewAllLabel}\n </button>\n </footer>\n ) : null}\n </section>\n );\n },\n);\n\nAgendaTray.displayName = 'AgendaTray';\n"],"names":["agendaTrayAgent","handle","args","agendaTrayVariants","cva","AgendaTray","forwardRef","id","items","title","caption","size","onOpenAppointment","onAddAppointment","addLabel","loading","emptyTitle","emptyDescription","emptyAction","viewAllLabel","onViewAll","renderItemActions","scrollable","className","rest","ref","t","useTranslation","heading","resolvedAddLabel","isEmpty","body","jsx","i","Skeleton","EmptyState","item","AgendaCard","itemsRef","useRef","innerRef","useImperativeHandle","useMemo","targetId","found","useAgentRegistration","jsxs","CalendarDays","IconButton","Plus"],"mappings":";;;;;;;;;;;AAWO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAC,MAAM;AAAA,EACrB,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,aAAa;AAAA;AAAA,MAEX,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY,EAAE,IAAI,EAAE,MAAM,WAAS;AAAA,QACnC,UAAU,CAAC,IAAI;AAAA,MAAA;AAAA,MAEjB,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU;AAAA,QACR,EAAE,MAAM,EAAE,IAAI,WAAA,GAAc,MAAM,6BAAA;AAAA,MAA6B;AAAA,MAEjE,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,WAAWC,EAAK,EAAE;AAAA,MAC3B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aACE;AAAA,IAAA;AAAA,IAEJ,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aACE;AAAA,IAAA;AAAA,EACJ;AAEJ,GC1CMC,IAAqBC;AAAA,EACzB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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,QACf,qBAAmBrB;AAAA,QACnB,WAAWJ,EAAmB,EAAE,MAAAQ,GAAM,WAAAY,GAAW;AAAA,QAChD,GAAGC;AAAA,QAEJ,UAAA;AAAA,UAAA,gBAAAsB,EAAC,UAAA,EAAO,WAAU,kGAChB,UAAA;AAAA,YAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,8DACb,UAAA;AAAA,cAAA,gBAAAA,EAAC,MAAA,EAAG,WAAU,oFACZ,UAAA;AAAA,gBAAA,gBAAAd,EAACe,GAAA,EAAa,eAAY,QAAO,WAAU,aAAY;AAAA,gBACtDnB;AAAA,cAAA,GACH;AAAA,cACClB,IACC,gBAAAsB,EAAC,QAAA,EAAK,WAAU,wDACb,aACH,IACE;AAAA,YAAA,GACN;AAAA,YACCnB,IACC,gBAAAmB;AAAA,cAACgB;AAAA,cAAA;AAAA,gBACC,wBAAOC,GAAA,EAAK;AAAA,gBACZ,QAAO;AAAA,gBACP,MAAK;AAAA,gBACL,cAAYpB;AAAA,gBACZ,SAAShB;AAAA,cAAA;AAAA,YAAA,IAET;AAAA,UAAA,GACN;AAAA,UACCkB;AAAA,UACAZ,KAAgBC,KAAa,CAACU,KAAW,CAACf,IACzC,gBAAAiB,EAAC,UAAA,EAAO,WAAU,oGAChB,UAAA,gBAAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAASZ;AAAA,cACT,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA,EACA,KAAK,GAAG;AAAA,cAET,UAAAD;AAAA,YAAA;AAAA,UAAA,GAEL,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAd,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"agenda-tray-CfwylhWf.js","sources":["../../src/components/agenda-tray/agenda-tray.agent.ts","../../src/components/agenda-tray/agenda-tray.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AgendaTray. */\n/* */\n/* Tray-level surface: read appointment ids + lifecycle status (never */\n/* patient names / treatments), and route an activation through the */\n/* curated handle. AgendaTray is in-page (no open/close). */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AgendaTrayHandle } from './agenda-tray';\n\nexport const agendaTrayAgent: AgentAdapter<AgendaTrayHandle> = {\n id: 'agenda-tray',\n // `pick` (NON-persisting): select_item activates / opens an appointment by\n // firing onOpenAppointment — it does not store a \"selected\" value on the tray\n // (there is no selection state slot), so this is a pick, not select_single.\n capabilities: ['pick'],\n state: {\n items: {\n type: 'Array<{ id: string; status: string }>',\n descriptionKey: 'ui.agent.agendaTray.state.items',\n description:\n 'Currently-displayed appointments. Ids + status only — never patient identity.',\n read: (handle) => handle.getItems(),\n },\n },\n actions: {\n select_item: {\n // Activates (opens) an appointment — pure navigation, no data mutation.\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n descriptionKey: 'ui.agent.agendaTray.actions.selectItem',\n description: 'Activate the appointment with the given id.',\n examples: [\n { args: { id: 'appt-204' }, note: 'Open appointment appt-204.' },\n ],\n invoke: (handle, args: { id: string }) => {\n handle.selectItem(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'agenda-tray',\n description: 'Marks the AgendaTray wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific tray from the agent.',\n },\n item: {\n attr: 'data-appointment-id',\n description:\n 'Stable appointment id emitted on each rendered AgendaCard inside the tray.',\n },\n },\n};\n","import {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CalendarDays, Plus } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { Skeleton } from '../skeleton/skeleton';\nimport { EmptyState } from '../empty-state/empty-state';\nimport { AgendaCard, type AgendaItem } from '../agenda-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { agendaTrayAgent } from './agenda-tray.agent';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst agendaTrayVariants = cva(\n [\n 'ds:flex ds:flex-col',\n 'ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)]',\n 'ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))] ds:border-[color:var(--card-border)]',\n 'ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]',\n 'ds:overflow-hidden',\n ].join(' '),\n {\n variants: {\n size: {\n sm: '',\n md: '',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\n/**\n * Curated imperative handle for AgendaTray. Exposed as the forwardRef\n * target so a future agent / MCP UI bridge can drive the tray without\n * touching the DOM. See `agenda-tray.agent.ts`.\n */\nexport interface AgendaTrayHandle {\n getItems: () => Array<{ id: string; status: string }>;\n selectItem: (id: string) => void;\n}\n\nexport interface AgendaTrayProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'onClick' | 'id'>,\n VariantProps<typeof agendaTrayVariants> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so\n * an agent / MCP UI bridge can address this specific tray.\n */\n id?: string;\n items: AgendaItem[];\n /** Section title — rendered in the header. Localised by the consumer. */\n title?: string;\n /** Optional small caption (e.g. localised date) shown next to the title. */\n caption?: string;\n size?: 'sm' | 'md';\n onOpenAppointment?: (item: AgendaItem) => void;\n onAddAppointment?: () => void;\n /** Localised label for the \"Add\" affordance. */\n addLabel?: string;\n loading?: boolean;\n emptyTitle?: string;\n emptyDescription?: string;\n /** Optional CTA wired into the empty state (EmptyState primaryAction). */\n emptyAction?: { label: string; onClick: () => void };\n /**\n * Pinned footer link (e.g. \"All upcoming appointments\"). Localised by\n * the consumer; rendered after the list, before the section closes.\n */\n viewAllLabel?: string;\n /** Fires when the footer link is activated. Required to render it. */\n onViewAll?: () => void;\n /**\n * Per-row trailing action toolbar, forwarded to each AgendaCard's\n * `actions` slot.\n */\n renderItemActions?: (item: AgendaItem) => ReactNode;\n /**\n * Constrain the list to the tray's own height and scroll inside it —\n * pair with a height/max-height on `className`. The scroll region is\n * keyboard-focusable so it stays operable without a pointer.\n */\n scrollable?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const AgendaTray = forwardRef<HTMLElement, AgendaTrayProps>(\n (\n {\n id,\n items,\n title,\n caption,\n size = 'sm',\n onOpenAppointment,\n onAddAppointment,\n addLabel,\n loading = false,\n emptyTitle,\n emptyDescription,\n emptyAction,\n viewAllLabel,\n onViewAll,\n renderItemActions,\n scrollable = false,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const heading = title ?? t('agendaTray.title', \"Today's appointments\");\n const resolvedAddLabel = addLabel ?? t('agendaTray.add', 'Add appointment');\n const isEmpty = !loading && items.length === 0;\n\n let body: ReactNode;\n if (loading) {\n body = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\">\n {[0, 1, 2].map((i) => (\n <Skeleton key={i} variant=\"rectangular\" height=\"2.5rem\" />\n ))}\n </div>\n );\n } else if (isEmpty) {\n body = (\n <div className=\"ds:p-[var(--spacing-md)]\">\n <EmptyState\n variant=\"first-use\"\n size=\"sm\"\n title={emptyTitle ?? t('agendaTray.empty.title', 'No appointments')}\n description={\n emptyDescription ??\n t(\n 'agendaTray.empty.description',\n 'New appointments will appear here.',\n )\n }\n primaryAction={emptyAction}\n />\n </div>\n );\n } else {\n body = (\n <ul\n className={[\n // flex-1 unconditionally so a footer pins to the tray's\n // bottom edge in equal-height grid rows.\n 'ds:flex ds:list-none ds:flex-col ds:flex-1 ds:min-h-0',\n // Keyboard-focusable when it scrolls (axe\n // scrollable-region-focusable) — pair with a height on the\n // tray's className.\n scrollable ? 'ds:overflow-y-auto' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- scrollable list must be keyboard focusable (axe scrollable-region-focusable)\n tabIndex={scrollable ? 0 : undefined}\n aria-label={scrollable ? heading : undefined}\n >\n {items.map((item) => (\n <AgendaCard\n key={item.id}\n item={item}\n size={size}\n onActivate={onOpenAppointment}\n actions={renderItemActions?.(item)}\n data-appointment-id={item.id}\n />\n ))}\n </ul>\n );\n }\n\n /* Curated imperative handle for agent integration. See\n * agenda-tray.agent.ts. */\n const itemsRef = useRef<AgendaItem[]>(items);\n itemsRef.current = items;\n\n const innerRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => innerRef.current as HTMLElement, []);\n\n const handle = useMemo<AgendaTrayHandle>(\n () => ({\n getItems: () =>\n itemsRef.current.map((i) => ({\n id: i.id,\n status: i.status ?? 'confirmed',\n })),\n selectItem: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onOpenAppointment?.(found);\n },\n }),\n [onOpenAppointment],\n );\n\n useAgentRegistration(agendaTrayAgent, handle, id);\n\n return (\n <section\n ref={innerRef}\n aria-label={heading}\n data-component=\"agenda-tray\"\n data-component-id={id}\n className={agendaTrayVariants({ size, className })}\n {...rest}\n >\n <header className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:min-w-0\">\n <h3 className=\"ds:m-0 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-card\">\n <CalendarDays aria-hidden=\"true\" className=\"ds:size-4\" />\n {heading}\n </h3>\n {caption ? (\n <span className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {caption}\n </span>\n ) : null}\n </div>\n {onAddAppointment ? (\n <IconButton\n icon={<Plus />}\n intent=\"outline\"\n size=\"sm\"\n aria-label={resolvedAddLabel}\n onClick={onAddAppointment}\n />\n ) : null}\n </header>\n {body}\n {viewAllLabel && onViewAll && !isEmpty && !loading ? (\n <footer className=\"ds:[border-block-start:var(--border-width-sm)_solid_var(--card-border)] ds:p-[var(--spacing-sm)]\">\n <button\n type=\"button\"\n onClick={onViewAll}\n className={[\n 'type-label ds:text-[color:var(--link)] ds:underline ds:underline-offset-2 ds:hover:no-underline',\n 'ds:rounded-[var(--radius-sm)] ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n >\n {viewAllLabel}\n </button>\n </footer>\n ) : null}\n </section>\n );\n },\n);\n\nAgendaTray.displayName = 'AgendaTray';\n"],"names":["agendaTrayAgent","handle","args","agendaTrayVariants","cva","AgendaTray","forwardRef","id","items","title","caption","size","onOpenAppointment","onAddAppointment","addLabel","loading","emptyTitle","emptyDescription","emptyAction","viewAllLabel","onViewAll","renderItemActions","scrollable","className","rest","ref","t","useTranslation","heading","resolvedAddLabel","isEmpty","body","jsx","i","Skeleton","EmptyState","item","AgendaCard","itemsRef","useRef","innerRef","useImperativeHandle","useMemo","targetId","found","useAgentRegistration","jsxs","CalendarDays","IconButton","Plus"],"mappings":";;;;;;;;;;;AAWO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAC,MAAM;AAAA,EACrB,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,E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AAsB,EAAC,QAAA,EAAK,WAAU,wDACb,aACH,IACE;AAAA,YAAA,GACN;AAAA,YACCnB,IACC,gBAAAmB;AAAA,cAACgB;AAAA,cAAA;AAAA,gBACC,wBAAOC,GAAA,EAAK;AAAA,gBACZ,QAAO;AAAA,gBACP,MAAK;AAAA,gBACL,cAAYpB;AAAA,gBACZ,SAAShB;AAAA,cAAA;AAAA,YAAA,IAET;AAAA,UAAA,GACN;AAAA,UACCkB;AAAA,UACAZ,KAAgBC,KAAa,CAACU,KAAW,CAACf,IACzC,gBAAAiB,EAAC,UAAA,EAAO,WAAU,oGAChB,UAAA,gBAAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAASZ;AAAA,cACT,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA,EACA,KAAK,GAAG;AAAA,cAET,UAAAD;AAAA,YAAA;AAAA,UAAA,GAEL,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAd,EAAW,cAAc;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as S, useId as E } from "react";
|
|
3
3
|
import { c as x } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as A } from "react-i18next";
|
|
5
|
-
import { C as P, A as b } from "./alert-
|
|
5
|
+
import { C as P, A as b } from "./alert-9kEwDza3.js";
|
|
6
6
|
import { B as U } from "./button-D-MQxsA_.js";
|
|
7
7
|
import { P as _ } from "./progress-D_g_Sl2g.js";
|
|
8
8
|
import { f as j, n as F } from "./intl-locale-FWh-Y5_3.js";
|
|
@@ -284,4 +284,4 @@ export {
|
|
|
284
284
|
an as a,
|
|
285
285
|
$ as i
|
|
286
286
|
};
|
|
287
|
-
//# sourceMappingURL=ai-credits-exhausted-notice-
|
|
287
|
+
//# sourceMappingURL=ai-credits-exhausted-notice-Bg8NpW2K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-credits-exhausted-notice-DfAgfZDF.js","sources":["../../node_modules/lucide-react/dist/esm/icons/headset.mjs","../../src/components/ai-credits-notice/ai-credits-exhausted-notice.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z\",\n key: \"12oyoe\"\n }\n ],\n [\"path\", { d: \"M21 16v2a4 4 0 0 1-4 4h-5\", key: \"1x7m43\" }]\n];\nconst Headset = createLucideIcon(\"headset\", __iconNode);\n\nexport { __iconNode, Headset as default };\n//# sourceMappingURL=headset.mjs.map\n","import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n ArrowLeft,\n Astroid,\n CircleArrowUp,\n Headset,\n Hourglass,\n TrendingUp,\n} from 'lucide-react';\nimport { Alert, type AlertAnnounce } from '../alert';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { formatLocale, numberLocale } from '../_shared/intl-locale';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsExhaustedNotice and AiCreditsWarning */\n/* */\n/* The practice's AI credits, as the platform keeps them: a yearly */\n/* allowance that comes with the AI credits module and expires at the */\n/* end of the subscription term, then welcome and bought credits that */\n/* never expire. The kit never talks to a backend: the host passes what */\n/* it knows (`AiCreditsInfo`) and the next steps it can offer. */\n/* */\n/* - `AiCreditsExhaustedNotice`: the out-of-credits state. A promo */\n/* Alert with the allowance meter and one clear next step. Promoted */\n/* from the help-me-write-templates pattern, which re-exports it. */\n/* - `AiCreditsWarning`: the quiet, non-blocking lines: running low */\n/* (80% used), credits expiring, or out of credits at rest. */\n/* */\n/* The hover card every AI trigger can carry is `AiCreditsNotice`, in */\n/* the sibling file. */\n/* -------------------------------------------------------------------- */\n\n/** Credits that expire soon: the platform's yearly allowance at the end of\n * the subscription term. Welcome and bought credits never expire. */\nexport interface AiCreditsExpiring {\n /** How many credits expire. */\n amount: number;\n /** When they expire. */\n date: Date;\n}\n\n/** The practice's AI credits and the next steps the host can offer. All\n * optional: the kit shows only what it is given. */\nexport interface AiCreditsInfo {\n /** Credits left. */\n remaining?: number;\n /** The allowance `remaining` counts down from, for the meter. */\n limit?: number;\n /**\n * When a new allowance starts: \"renews on\". On the platform, the yearly\n * allowance at the subscription's renewal. Omit when it will not renew.\n */\n renewsOn?: Date;\n /** @deprecated Use `renewsOn`. Read the same way, as a renewal date. */\n resetsOn?: Date;\n /**\n * Credits that expire soon: \"expire on\". `AiCreditsWarning` shows it as\n * a quiet line; the out-of-credits notice never does (nothing is left to\n * expire).\n */\n expiring?: AiCreditsExpiring;\n /**\n * Shows the running-low line in `AiCreditsWarning`. Default: true when\n * 80% or more of `limit` is used and some credit is left. A host whose\n * balance mixes the yearly allowance with welcome or bought credits\n * passes it itself: 80% of one `limit` does not describe that balance.\n */\n runningLow?: boolean;\n /**\n * Shows a \"Buy AI credits\" button. Omit while the practice cannot buy\n * credits (on the platform, without the module and the pack page).\n */\n onBuyCredits?: () => void;\n /**\n * Shows an \"Enable the AI credits module\" button: the upgrade path for a\n * practice without the module.\n */\n onUpgrade?: () => void;\n /** Shows a \"Contact support\" button. */\n onContactSupport?: () => void;\n /** Shows a \"See what each action costs\" link. */\n onSeeCosts?: () => void;\n}\n\n/** Heading levels the notice title accepts. */\nexport type AiCreditsHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Share of `limit` used at which credits count as running low. */\nconst RUNNING_LOW_USED = 0.8;\n\n/** Whether `credits` are running low: the host's `runningLow`, else 80% or\n * more of `limit` used with some credit left. */\nexport function isAiCreditsRunningLow(credits?: AiCreditsInfo): boolean {\n if (!credits) return false;\n if (credits.runningLow !== undefined) return credits.runningLow;\n const { remaining, limit } = credits;\n if (remaining === undefined || limit === undefined || limit <= 0) {\n return false;\n }\n return remaining > 0 && limit - remaining >= limit * RUNNING_LOW_USED;\n}\n\n/** The renewal date, from `renewsOn` or the older `resetsOn`. */\nfunction renewalDate(credits?: AiCreditsInfo): Date | undefined {\n return credits?.renewsOn ?? credits?.resetsOn;\n}\n\n/** The kit's number and date formatting for the active UI language.\n * Credits can be fractional on the platform (0.1 is the minimum cost). */\nfunction useCreditsFormat() {\n const { i18n } = useTranslation('ui');\n const locale = formatLocale(i18n.language);\n const numbers = new Intl.NumberFormat(numberLocale(locale), {\n maximumFractionDigits: 1,\n });\n const dates = new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n return {\n number: (value: number) => numbers.format(value),\n date: (value: Date) => dates.format(value),\n };\n}\n\n// The kit's target size (44px, 48px in the accessible themes) on every\n// control, at every width. On a size `md` Button: size `sm` drops its\n// minimum height from 640px up.\nconst TARGET = 'ds:min-h-[var(--min-target-size)]';\n\n// The lead step's label wraps instead of truncating: a long translation\n// (\"Das KI-Guthaben-Modul aktivieren\") never loses words in a narrow\n// panel. The Button's own height and nowrap give way; the target stays.\nconst WRAPPING_LABEL = [\n TARGET,\n 'ds:!h-auto ds:!whitespace-normal ds:text-start ds:[overflow-wrap:anywhere]',\n 'ds:py-[var(--spacing-xs)]',\n].join(' ');\n\n// The text links: the notice's secondary steps and the quiet line's step.\n// Native buttons at the target size with the kit focus ring. `inherit`\n// takes the promo Alert's own text colour, which holds AA on its gradient\n// (the Button `link` intent's `--primary` does not); `link` is the `--link`\n// token, which holds AA on the card and popover surfaces in every theme,\n// as in AgendaTray's footer link.\nconst textLinkVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:min-h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-2xs)]',\n 'type-body-sm ds:font-medium ds:underline ds:underline-offset-2 ds:hover:no-underline ds:cursor-pointer',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:text-[color:LinkText]',\n ].join(' '),\n {\n variants: {\n tone: {\n inherit: 'ds:text-[color:inherit]',\n link: 'ds:text-[color:var(--link)]',\n },\n },\n defaultVariants: { tone: 'link' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsExhaustedNotice */\n/* -------------------------------------------------------------------- */\n\nconst noticeRootVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]',\n);\n\nconst metaClass =\n 'ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]';\n\nexport interface AiCreditsExhaustedNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** The allowance and the next steps the host can offer. */\n credits?: AiCreditsInfo;\n /** Shows a Back button under the notice. */\n onBack?: () => void;\n /** A quiet line under the notice, beside Back: what the user keeps. */\n footnote?: ReactNode;\n /** Heading level of the title. Default 2. */\n headingLevel?: AiCreditsHeadingLevel;\n /**\n * How the notice is announced when it appears. Default: the promo\n * Alert's polite status. Pass `'off'` when the host announces it.\n */\n announce?: AlertAnnounce;\n}\n\n/**\n * The out-of-credits state: what happened, the allowance, and the next\n * step. The first of buy, enable the module and contact support the host\n * passes is the main button; any others follow as links. With none, it\n * says when AI comes back, or plainly that it is unavailable and how to\n * get help: never a dead end.\n */\nexport const AiCreditsExhaustedNotice = forwardRef<\n HTMLDivElement,\n AiCreditsExhaustedNoticeProps\n>(\n (\n {\n credits,\n onBack,\n footnote,\n headingLevel = 2,\n announce,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const format = useCreditsFormat();\n const titleId = useId();\n const limit = credits?.limit;\n const remaining = credits?.remaining ?? 0;\n // A limit of 0 (a host still loading) would divide by zero in the meter.\n const remainingText =\n limit !== undefined && limit > 0\n ? t('aiCredits.remaining', {\n remaining: format.number(remaining),\n limit: format.number(limit),\n })\n : undefined;\n const renews = renewalDate(credits);\n const renewsText = renews ? format.date(renews) : undefined;\n\n // The first next step the host offers leads; the rest follow as links.\n const steps = [\n credits?.onBuyCredits\n ? {\n key: 'buy',\n label: t('aiCredits.buy'),\n icon: <TrendingUp aria-hidden=\"true\" />,\n onClick: credits.onBuyCredits,\n }\n : null,\n credits?.onUpgrade\n ? {\n key: 'upgrade',\n label: t('aiCredits.upgrade'),\n icon: <CircleArrowUp aria-hidden=\"true\" />,\n onClick: credits.onUpgrade,\n }\n : null,\n credits?.onContactSupport\n ? {\n key: 'support',\n label: t('aiCredits.contactSupport'),\n icon: <Headset aria-hidden=\"true\" />,\n onClick: credits.onContactSupport,\n }\n : null,\n ].filter((step) => step !== null);\n const lead = steps[0]?.key;\n\n // The body names the lead step. Without one, it says when AI comes\n // back, or that it is unavailable and how to get help.\n const body =\n lead === 'buy'\n ? t('aiCredits.bodyBuy')\n : lead === 'upgrade'\n ? t('aiCredits.bodyUpgrade')\n : lead === 'support'\n ? t('aiCredits.bodySupport')\n : renewsText\n ? t('aiCredits.bodyRenews', { date: renewsText })\n : t('aiCredits.bodyNone');\n // With a next step, the renewal date is a line of its own.\n const renewsLine = lead && renewsText ? renewsText : undefined;\n\n return (\n <div\n {...rest}\n ref={ref}\n // After `rest`: the marker always wins over a caller's attribute.\n data-component=\"ai-credits-exhausted-notice\"\n // Named by its title, so a host that moves focus here (the\n // VoiceControlPanel does) has it read from the title.\n role=\"group\"\n aria-labelledby={titleId}\n className={noticeRootVariants({ className })}\n >\n <Alert\n variant=\"promo\"\n announce={announce}\n icon={<Astroid aria-hidden=\"true\" />}\n // The focus ring takes the promo text colour, which holds 3:1 on\n // the promo tint in every theme (`--ring` does not on dark).\n className=\"ds:[--ring:var(--promo-foreground)]\"\n >\n <Alert.Title as={`h${headingLevel}` as const} id={titleId}>\n {t('aiCredits.title')}\n </Alert.Title>\n <Alert.Description>{body}</Alert.Description>\n {renewsLine ? (\n <p\n className=\"ds:m-0 ds:[margin-block-start:var(--spacing-2xs)] type-body-sm\"\n data-credits-renews=\"\"\n >\n {t('aiCredits.renewsOn', { date: renewsLine })}\n </p>\n ) : null}\n {remainingText && limit !== undefined ? (\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\">{t('aiCredits.meterLabel')}</span>\n <span className=\"type-label ds:ms-auto ds:tabular-nums\">\n {remainingText}\n </span>\n </div>\n <Progress\n value={Math.max(0, limit - remaining)}\n max={limit}\n size=\"sm\"\n ariaLabel={t('aiCredits.meterLabel')}\n ariaValueText={remainingText}\n />\n </div>\n ) : null}\n {steps.length > 0 || credits?.onSeeCosts ? (\n <Alert.Action>\n {steps.map((step, index) =>\n index === 0 ? (\n <Button\n key={step.key}\n intent=\"tonal\"\n size=\"md\"\n startIcon={step.icon}\n onClick={step.onClick}\n className={WRAPPING_LABEL}\n data-credits-action={step.key}\n >\n {step.label}\n </Button>\n ) : (\n <button\n key={step.key}\n type=\"button\"\n onClick={step.onClick}\n className={textLinkVariants({ tone: 'inherit' })}\n data-credits-action={step.key}\n >\n {step.label}\n </button>\n ),\n )}\n {credits?.onSeeCosts ? (\n <button\n type=\"button\"\n onClick={credits.onSeeCosts}\n className={textLinkVariants({ tone: 'inherit' })}\n data-credits-action=\"costs\"\n >\n {t('aiCredits.seeCosts')}\n </button>\n ) : null}\n </Alert.Action>\n ) : null}\n </Alert>\n {onBack || footnote ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {onBack ? (\n <Button\n intent=\"ghost\"\n startIcon={<ArrowLeft />}\n flipIconInRtl\n onClick={onBack}\n className={TARGET}\n >\n {t('aiCredits.back')}\n </Button>\n ) : null}\n {footnote ? <p className={metaClass}>{footnote}</p> : null}\n </div>\n ) : null}\n </div>\n );\n },\n);\nAiCreditsExhaustedNotice.displayName = 'AiCreditsExhaustedNotice';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsWarning */\n/* -------------------------------------------------------------------- */\n\nconst warningLineVariants = cva(\n 'ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-xs)] type-body-sm',\n {\n variants: {\n // Quiet: muted text and no tint, so it never competes with the\n // promo notice. Out of credits reads in the body colour.\n emphasis: {\n quiet: 'ds:text-[color:var(--muted-foreground)]',\n plain: 'ds:text-[color:var(--foreground)]',\n },\n },\n defaultVariants: { emphasis: 'quiet' },\n },\n);\n\nconst warningRootVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]',\n);\n\nconst warningIconClass = 'ds:size-4 ds:shrink-0';\n\nexport interface AiCreditsWarningProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** The allowance, the expiring credits and the next steps. */\n credits?: AiCreditsInfo;\n /**\n * Out of credits: one quiet line saying so, instead of the running-low\n * and expiring lines. The full notice is `AiCreditsExhaustedNotice`.\n */\n exhausted?: boolean;\n}\n\n/**\n * The quiet, non-blocking credit lines: running low (with the buy or\n * upgrade step as a link) and credits expiring, or out of credits at rest.\n * Renders nothing when none applies.\n */\nexport const AiCreditsWarning = forwardRef<\n HTMLDivElement,\n AiCreditsWarningProps\n>(({ credits, exhausted = false, className, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n const format = useCreditsFormat();\n const low = !exhausted && isAiCreditsRunningLow(credits);\n // Rounded as it is shown, so the plural matches the figure (\"1 AI\n // credit\", never \"1 AI credits\" for 0.96).\n const expiringAmount = credits?.expiring\n ? Math.round(credits.expiring.amount * 10) / 10\n : 0;\n const expiring =\n !exhausted && credits?.expiring && expiringAmount > 0\n ? credits.expiring\n : undefined;\n if (!exhausted && !low && !expiring) return null;\n\n const { remaining, limit } = credits ?? {};\n const lowText =\n remaining !== undefined && limit !== undefined && limit > 0\n ? t('aiCredits.runningLow', {\n remaining: format.number(remaining),\n limit: format.number(limit),\n })\n : remaining !== undefined\n ? t('aiCredits.runningLowCount', {\n remaining: format.number(remaining),\n })\n : t('aiCredits.runningLowPlain');\n // Before the wall, the way to more credits: buy, else enable the module.\n const step = credits?.onBuyCredits\n ? { label: t('aiCredits.buy'), onClick: credits.onBuyCredits }\n : credits?.onUpgrade\n ? { label: t('aiCredits.upgrade'), onClick: credits.onUpgrade }\n : undefined;\n\n return (\n <div\n {...rest}\n ref={ref}\n data-component=\"ai-credits-warning\"\n className={warningRootVariants({ className })}\n >\n {exhausted ? (\n <p\n className={warningLineVariants({ emphasis: 'plain' })}\n data-credits-line=\"exhausted\"\n >\n <Astroid aria-hidden=\"true\" className={warningIconClass} />\n <span>{t('aiCredits.title')}</span>\n </p>\n ) : null}\n {low ? (\n <p className={warningLineVariants()} data-credits-line=\"low\">\n <Astroid aria-hidden=\"true\" className={warningIconClass} />\n <span>{lowText}</span>\n {step ? (\n <button\n type=\"button\"\n onClick={step.onClick}\n className={textLinkVariants({ tone: 'link' })}\n >\n {step.label}\n </button>\n ) : null}\n </p>\n ) : null}\n {expiring ? (\n <p className={warningLineVariants()} data-credits-line=\"expiring\">\n <Hourglass aria-hidden=\"true\" className={warningIconClass} />\n <span>\n {t('aiCredits.expiring', {\n count: expiringAmount,\n amount: format.number(expiringAmount),\n date: format.date(expiring.date),\n })}\n </span>\n </p>\n ) : null}\n </div>\n );\n});\nAiCreditsWarning.displayName = 'AiCreditsWarning';\n"],"names":["__iconNode","Headset","createLucideIcon","RUNNING_LOW_USED","isAiCreditsRunningLow","credits","remaining","limit","renewalDate","useCreditsFormat","i18n","useTranslation","locale","formatLocale","numbers","numberLocale","dates","value","TARGET","WRAPPING_LABEL","textLinkVariants","cva","noticeRootVariants","metaClass","AiCreditsExhaustedNotice","forwardRef","onBack","footnote","headingLevel","announce","className","rest","ref","t","format","titleId","useId","remainingText","renews","renewsText","steps","jsx","TrendingUp","CircleArrowUp","step","lead","_a","body","renewsLine","jsxs","Alert","Astroid","Progress","index","Button","ArrowLeft","warningLineVariants","warningRootVariants","warningIconClass","AiCreditsWarning","exhausted","low","expiringAmount","expiring","lowText","Hourglass"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAC5D,GACMC,IAAUC,EAAiB,WAAWF,CAAU,GCwEhDG,IAAmB;AAIlB,SAASC,EAAsBC,GAAkC;AACtE,MAAI,CAACA,EAAS,QAAO;AACrB,MAAIA,EAAQ,eAAe,OAAW,QAAOA,EAAQ;AACrD,QAAM,EAAE,WAAAC,GAAW,OAAAC,EAAA,IAAUF;AAC7B,SAAIC,MAAc,UAAaC,MAAU,UAAaA,KAAS,IACtD,KAEFD,IAAY,KAAKC,IAAQD,KAAaC,IAAQJ;AACvD;AAGA,SAASK,EAAYH,GAA2C;AAC9D,UAAOA,KAAA,gBAAAA,EAAS,cAAYA,KAAA,gBAAAA,EAAS;AACvC;AAIA,SAASI,IAAmB;AAC1B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAe,IAAI,GAC9BC,IAASC,EAAaH,EAAK,QAAQ,GACnCI,IAAU,IAAI,KAAK,aAAaC,EAAaH,CAAM,GAAG;AAAA,IAC1D,uBAAuB;AAAA,EAAA,CACxB,GACKI,IAAQ,IAAI,KAAK,eAAeJ,GAAQ;AAAA,IAC5C,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MA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,EAAA,CACF,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,GAAiB,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ai-credits-exhausted-notice-Bg8NpW2K.js","sources":["../../node_modules/lucide-react/dist/esm/icons/headset.mjs","../../src/components/ai-credits-notice/ai-credits-exhausted-notice.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z\",\n key: \"12oyoe\"\n }\n ],\n [\"path\", { d: \"M21 16v2a4 4 0 0 1-4 4h-5\", key: \"1x7m43\" }]\n];\nconst Headset = createLucideIcon(\"headset\", __iconNode);\n\nexport { __iconNode, Headset as default };\n//# sourceMappingURL=headset.mjs.map\n","import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n ArrowLeft,\n Astroid,\n CircleArrowUp,\n Headset,\n Hourglass,\n TrendingUp,\n} from 'lucide-react';\nimport { Alert, type AlertAnnounce } from '../alert';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { formatLocale, numberLocale } from '../_shared/intl-locale';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsExhaustedNotice and AiCreditsWarning */\n/* */\n/* The practice's AI credits, as the platform keeps them: a yearly */\n/* allowance that comes with the AI credits module and expires at the */\n/* end of the subscription term, then welcome and bought credits that */\n/* never expire. The kit never talks to a backend: the host passes what */\n/* it knows (`AiCreditsInfo`) and the next steps it can offer. */\n/* */\n/* - `AiCreditsExhaustedNotice`: the out-of-credits state. A promo */\n/* Alert with the allowance meter and one clear next step. Promoted */\n/* from the help-me-write-templates pattern, which re-exports it. */\n/* - `AiCreditsWarning`: the quiet, non-blocking lines: running low */\n/* (80% used), credits expiring, or out of credits at rest. */\n/* */\n/* The hover card every AI trigger can carry is `AiCreditsNotice`, in */\n/* the sibling file. */\n/* -------------------------------------------------------------------- */\n\n/** Credits that expire soon: the platform's yearly allowance at the end of\n * the subscription term. Welcome and bought credits never expire. */\nexport interface AiCreditsExpiring {\n /** How many credits expire. */\n amount: number;\n /** When they expire. */\n date: Date;\n}\n\n/** The practice's AI credits and the next steps the host can offer. All\n * optional: the kit shows only what it is given. */\nexport interface AiCreditsInfo {\n /** Credits left. */\n remaining?: number;\n /** The allowance `remaining` counts down from, for the meter. */\n limit?: number;\n /**\n * When a new allowance starts: \"renews on\". On the platform, the yearly\n * allowance at the subscription's renewal. Omit when it will not renew.\n */\n renewsOn?: Date;\n /** @deprecated Use `renewsOn`. Read the same way, as a renewal date. */\n resetsOn?: Date;\n /**\n * Credits that expire soon: \"expire on\". `AiCreditsWarning` shows it as\n * a quiet line; the out-of-credits notice never does (nothing is left to\n * expire).\n */\n expiring?: AiCreditsExpiring;\n /**\n * Shows the running-low line in `AiCreditsWarning`. Default: true when\n * 80% or more of `limit` is used and some credit is left. A host whose\n * balance mixes the yearly allowance with welcome or bought credits\n * passes it itself: 80% of one `limit` does not describe that balance.\n */\n runningLow?: boolean;\n /**\n * Shows a \"Buy AI credits\" button. Omit while the practice cannot buy\n * credits (on the platform, without the module and the pack page).\n */\n onBuyCredits?: () => void;\n /**\n * Shows an \"Enable the AI credits module\" button: the upgrade path for a\n * practice without the module.\n */\n onUpgrade?: () => void;\n /** Shows a \"Contact support\" button. */\n onContactSupport?: () => void;\n /** Shows a \"See what each action costs\" link. */\n onSeeCosts?: () => void;\n}\n\n/** Heading levels the notice title accepts. */\nexport type AiCreditsHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Share of `limit` used at which credits count as running low. */\nconst RUNNING_LOW_USED = 0.8;\n\n/** Whether `credits` are running low: the host's `runningLow`, else 80% or\n * more of `limit` used with some credit left. */\nexport function isAiCreditsRunningLow(credits?: AiCreditsInfo): boolean {\n if (!credits) return false;\n if (credits.runningLow !== undefined) return credits.runningLow;\n const { remaining, limit } = credits;\n if (remaining === undefined || limit === undefined || limit <= 0) {\n return false;\n }\n return remaining > 0 && limit - remaining >= limit * RUNNING_LOW_USED;\n}\n\n/** The renewal date, from `renewsOn` or the older `resetsOn`. */\nfunction renewalDate(credits?: AiCreditsInfo): Date | undefined {\n return credits?.renewsOn ?? credits?.resetsOn;\n}\n\n/** The kit's number and date formatting for the active UI language.\n * Credits can be fractional on the platform (0.1 is the minimum cost). */\nfunction useCreditsFormat() {\n const { i18n } = useTranslation('ui');\n const locale = formatLocale(i18n.language);\n const numbers = new Intl.NumberFormat(numberLocale(locale), {\n maximumFractionDigits: 1,\n });\n const dates = new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n return {\n number: (value: number) => numbers.format(value),\n date: (value: Date) => dates.format(value),\n };\n}\n\n// The kit's target size (44px, 48px in the accessible themes) on every\n// control, at every width. On a size `md` Button: size `sm` drops its\n// minimum height from 640px up.\nconst TARGET = 'ds:min-h-[var(--min-target-size)]';\n\n// The lead step's label wraps instead of truncating: a long translation\n// (\"Das KI-Guthaben-Modul aktivieren\") never loses words in a narrow\n// panel. The Button's own height and nowrap give way; the target stays.\nconst WRAPPING_LABEL = [\n TARGET,\n 'ds:!h-auto ds:!whitespace-normal ds:text-start ds:[overflow-wrap:anywhere]',\n 'ds:py-[var(--spacing-xs)]',\n].join(' ');\n\n// The text links: the notice's secondary steps and the quiet line's step.\n// Native buttons at the target size with the kit focus ring. `inherit`\n// takes the promo Alert's own text colour, which holds AA on its gradient\n// (the Button `link` intent's `--primary` does not); `link` is the `--link`\n// token, which holds AA on the card and popover surfaces in every theme,\n// as in AgendaTray's footer link.\nconst textLinkVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:min-h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-2xs)]',\n 'type-body-sm ds:font-medium ds:underline ds:underline-offset-2 ds:hover:no-underline ds:cursor-pointer',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:text-[color:LinkText]',\n ].join(' '),\n {\n variants: {\n tone: {\n inherit: 'ds:text-[color:inherit]',\n link: 'ds:text-[color:var(--link)]',\n },\n },\n defaultVariants: { tone: 'link' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsExhaustedNotice */\n/* -------------------------------------------------------------------- */\n\nconst noticeRootVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]',\n);\n\nconst metaClass =\n 'ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]';\n\nexport interface AiCreditsExhaustedNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** The allowance and the next steps the host can offer. */\n credits?: AiCreditsInfo;\n /** Shows a Back button under the notice. */\n onBack?: () => void;\n /** A quiet line under the notice, beside Back: what the user keeps. */\n footnote?: ReactNode;\n /** Heading level of the title. Default 2. */\n headingLevel?: AiCreditsHeadingLevel;\n /**\n * How the notice is announced when it appears. Default: the promo\n * Alert's polite status. Pass `'off'` when the host announces it.\n */\n announce?: AlertAnnounce;\n}\n\n/**\n * The out-of-credits state: what happened, the allowance, and the next\n * step. The first of buy, enable the module and contact support the host\n * passes is the main button; any others follow as links. With none, it\n * says when AI comes back, or plainly that it is unavailable and how to\n * get help: never a dead end.\n */\nexport const AiCreditsExhaustedNotice = forwardRef<\n HTMLDivElement,\n AiCreditsExhaustedNoticeProps\n>(\n (\n {\n credits,\n onBack,\n footnote,\n headingLevel = 2,\n announce,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const format = useCreditsFormat();\n const titleId = useId();\n const limit = credits?.limit;\n const remaining = credits?.remaining ?? 0;\n // A limit of 0 (a host still loading) would divide by zero in the meter.\n const remainingText =\n limit !== undefined && limit > 0\n ? t('aiCredits.remaining', {\n remaining: format.number(remaining),\n limit: format.number(limit),\n })\n : undefined;\n const renews = renewalDate(credits);\n const renewsText = renews ? format.date(renews) : undefined;\n\n // The first next step the host offers leads; the rest follow as links.\n const steps = [\n credits?.onBuyCredits\n ? {\n key: 'buy',\n label: t('aiCredits.buy'),\n icon: <TrendingUp aria-hidden=\"true\" />,\n onClick: credits.onBuyCredits,\n }\n : null,\n credits?.onUpgrade\n ? {\n key: 'upgrade',\n label: t('aiCredits.upgrade'),\n icon: <CircleArrowUp aria-hidden=\"true\" />,\n onClick: credits.onUpgrade,\n }\n : null,\n credits?.onContactSupport\n ? {\n key: 'support',\n label: t('aiCredits.contactSupport'),\n icon: <Headset aria-hidden=\"true\" />,\n onClick: credits.onContactSupport,\n }\n : null,\n ].filter((step) => step !== null);\n const lead = steps[0]?.key;\n\n // The body names the lead step. Without one, it says when AI comes\n // back, or that it is unavailable and how to get help.\n const body =\n lead === 'buy'\n ? t('aiCredits.bodyBuy')\n : lead === 'upgrade'\n ? t('aiCredits.bodyUpgrade')\n : lead === 'support'\n ? t('aiCredits.bodySupport')\n : renewsText\n ? t('aiCredits.bodyRenews', { date: renewsText })\n : t('aiCredits.bodyNone');\n // With a next step, the renewal date is a line of its own.\n const renewsLine = lead && renewsText ? renewsText : undefined;\n\n return (\n <div\n {...rest}\n ref={ref}\n // After `rest`: the marker always wins over a caller's attribute.\n data-component=\"ai-credits-exhausted-notice\"\n // Named by its title, so a host that moves focus here (the\n // VoiceControlPanel does) has it read from the title.\n role=\"group\"\n aria-labelledby={titleId}\n className={noticeRootVariants({ className })}\n >\n <Alert\n variant=\"promo\"\n announce={announce}\n icon={<Astroid aria-hidden=\"true\" />}\n // The focus ring takes the promo text colour, which holds 3:1 on\n // the promo tint in every theme (`--ring` does not on dark).\n className=\"ds:[--ring:var(--promo-foreground)]\"\n >\n <Alert.Title as={`h${headingLevel}` as const} id={titleId}>\n {t('aiCredits.title')}\n </Alert.Title>\n <Alert.Description>{body}</Alert.Description>\n {renewsLine ? (\n <p\n className=\"ds:m-0 ds:[margin-block-start:var(--spacing-2xs)] type-body-sm\"\n data-credits-renews=\"\"\n >\n {t('aiCredits.renewsOn', { date: renewsLine })}\n </p>\n ) : null}\n {remainingText && limit !== undefined ? (\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\">{t('aiCredits.meterLabel')}</span>\n <span className=\"type-label ds:ms-auto ds:tabular-nums\">\n {remainingText}\n </span>\n </div>\n <Progress\n value={Math.max(0, limit - remaining)}\n max={limit}\n size=\"sm\"\n ariaLabel={t('aiCredits.meterLabel')}\n ariaValueText={remainingText}\n />\n </div>\n ) : null}\n {steps.length > 0 || credits?.onSeeCosts ? (\n <Alert.Action>\n {steps.map((step, index) =>\n index === 0 ? (\n <Button\n key={step.key}\n intent=\"tonal\"\n size=\"md\"\n startIcon={step.icon}\n onClick={step.onClick}\n className={WRAPPING_LABEL}\n data-credits-action={step.key}\n >\n {step.label}\n </Button>\n ) : (\n <button\n key={step.key}\n type=\"button\"\n onClick={step.onClick}\n className={textLinkVariants({ tone: 'inherit' })}\n data-credits-action={step.key}\n >\n {step.label}\n </button>\n ),\n )}\n {credits?.onSeeCosts ? (\n <button\n type=\"button\"\n onClick={credits.onSeeCosts}\n className={textLinkVariants({ tone: 'inherit' })}\n data-credits-action=\"costs\"\n >\n {t('aiCredits.seeCosts')}\n </button>\n ) : null}\n </Alert.Action>\n ) : null}\n </Alert>\n {onBack || footnote ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {onBack ? (\n <Button\n intent=\"ghost\"\n startIcon={<ArrowLeft />}\n flipIconInRtl\n onClick={onBack}\n className={TARGET}\n >\n {t('aiCredits.back')}\n </Button>\n ) : null}\n {footnote ? <p className={metaClass}>{footnote}</p> : null}\n </div>\n ) : null}\n </div>\n );\n },\n);\nAiCreditsExhaustedNotice.displayName = 'AiCreditsExhaustedNotice';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsWarning */\n/* -------------------------------------------------------------------- */\n\nconst warningLineVariants = cva(\n 'ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-xs)] type-body-sm',\n {\n variants: {\n // Quiet: muted text and no tint, so it never competes with the\n // promo notice. Out of credits reads in the body colour.\n emphasis: {\n quiet: 'ds:text-[color:var(--muted-foreground)]',\n plain: 'ds:text-[color:var(--foreground)]',\n },\n },\n defaultVariants: { emphasis: 'quiet' },\n },\n);\n\nconst warningRootVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]',\n);\n\nconst warningIconClass = 'ds:size-4 ds:shrink-0';\n\nexport interface AiCreditsWarningProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** The allowance, the expiring credits and the next steps. */\n credits?: AiCreditsInfo;\n /**\n * Out of credits: one quiet line saying so, instead of the running-low\n * and expiring lines. The full notice is `AiCreditsExhaustedNotice`.\n */\n exhausted?: boolean;\n}\n\n/**\n * The quiet, non-blocking credit lines: running low (with the buy or\n * upgrade step as a link) and credits expiring, or out of credits at rest.\n * Renders nothing when none applies.\n */\nexport const AiCreditsWarning = forwardRef<\n HTMLDivElement,\n AiCreditsWarningProps\n>(({ credits, exhausted = false, className, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n const format = useCreditsFormat();\n const low = !exhausted && isAiCreditsRunningLow(credits);\n // Rounded as it is shown, so the plural matches the figure (\"1 AI\n // credit\", never \"1 AI credits\" for 0.96).\n const expiringAmount = credits?.expiring\n ? Math.round(credits.expiring.amount * 10) / 10\n : 0;\n const expiring =\n !exhausted && credits?.expiring && expiringAmount > 0\n ? credits.expiring\n : undefined;\n if (!exhausted && !low && !expiring) return null;\n\n const { remaining, limit } = credits ?? {};\n const lowText =\n remaining !== undefined && limit !== undefined && limit > 0\n ? t('aiCredits.runningLow', {\n remaining: format.number(remaining),\n limit: format.number(limit),\n })\n : remaining !== undefined\n ? t('aiCredits.runningLowCount', {\n remaining: format.number(remaining),\n })\n : t('aiCredits.runningLowPlain');\n // Before the wall, the way to more credits: buy, else enable the module.\n const step = credits?.onBuyCredits\n ? { label: t('aiCredits.buy'), onClick: credits.onBuyCredits }\n : credits?.onUpgrade\n ? { label: t('aiCredits.upgrade'), onClick: credits.onUpgrade }\n : undefined;\n\n return (\n <div\n {...rest}\n ref={ref}\n data-component=\"ai-credits-warning\"\n className={warningRootVariants({ className })}\n >\n {exhausted ? (\n <p\n className={warningLineVariants({ emphasis: 'plain' })}\n data-credits-line=\"exhausted\"\n >\n <Astroid aria-hidden=\"true\" className={warningIconClass} />\n <span>{t('aiCredits.title')}</span>\n </p>\n ) : null}\n {low ? (\n <p className={warningLineVariants()} data-credits-line=\"low\">\n <Astroid aria-hidden=\"true\" className={warningIconClass} />\n <span>{lowText}</span>\n {step ? (\n <button\n type=\"button\"\n onClick={step.onClick}\n className={textLinkVariants({ tone: 'link' })}\n >\n {step.label}\n </button>\n ) : null}\n </p>\n ) : null}\n {expiring ? (\n <p className={warningLineVariants()} data-credits-line=\"expiring\">\n <Hourglass aria-hidden=\"true\" className={warningIconClass} />\n <span>\n {t('aiCredits.expiring', {\n count: expiringAmount,\n amount: format.number(expiringAmount),\n date: format.date(expiring.date),\n })}\n </span>\n </p>\n ) : null}\n </div>\n );\n});\nAiCreditsWarning.displayName = 'AiCreditsWarning';\n"],"names":["__iconNode","Headset","createLucideIcon","RUNNING_LOW_USED","isAiCreditsRunningLow","credits","remaining","limit","renewalDate","useCreditsFormat","i18n","useTranslation","locale","formatLocale","numbers","numberLocale","dates","value","TARGET","WRAPPING_LABEL","textLinkVariants","cva","noticeRootVariants","metaClass","AiCreditsExhaustedNotice","forwardRef","onBack","footnote","headingLevel","announce","className","rest","ref","t","format","titleId","useId","remainingText","renews","renewsText","steps","jsx","TrendingUp","CircleArrowUp","step","lead","_a","body","renewsLine","jsxs","Alert","Astroid","Progress","index","Button","ArrowLeft","warningLineVariants","warningRootVariants","warningIconClass","AiCreditsWarning","exhausted","low","expiringAmount","expiring","lowText","Hourglass"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAC5D,GACMC,IAAUC,EAAiB,WAAWF,CAAU,GCwEhDG,IAAmB;AAIlB,SAASC,EAAsBC,GAAkC;AACtE,MAAI,CAACA,EAAS,QAAO;AACrB,MAAIA,EAAQ,eAAe,OAAW,QAAOA,EAAQ;AACrD,QAAM,EAAE,WAAAC,GAAW,OAAAC,EAAA,IAAUF;AAC7B,SAAIC,MAAc,UAAaC,MAAU,UAAaA,KAAS,IACtD,KAEFD,IAAY,KAAKC,IAAQD,KAAaC,IAAQJ;AACvD;AAGA,SAASK,EAAYH,GAA2C;AAC9D,UAAOA,KAAA,gBAAAA,EAAS,cAAYA,KAAA,gBAAAA,EAAS;AACvC;AAIA,SAASI,IAAmB;AAC1B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAe,IAAI,GAC9BC,IAASC,EAAaH,EAAK,QAAQ,GACnCI,IAAU,IAAI,KAAK,aAAaC,EAAaH,CAAM,GAAG;AAAA,IAC1D,uBAAuB;AAAA,EAAA,CACxB,GACKI,IAAQ,IAAI,KAAK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EAAO,KAAK6B,EAAS,IAAI;AAAA,UAAA,CAChC,EAAA,CACH;AAAA,QAAA,EAAA,CACF,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,GAAiB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -2,7 +2,7 @@ import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as z, useState as C, useRef as E, useMemo as F } from "react";
|
|
3
3
|
import { c as M } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as P } from "react-i18next";
|
|
5
|
-
import { A as g } from "./alert-
|
|
5
|
+
import { A as g } from "./alert-9kEwDza3.js";
|
|
6
6
|
import { B as D } from "./badge-BUk4RjTS.js";
|
|
7
7
|
import { B as H } from "./button-D-MQxsA_.js";
|
|
8
8
|
import { C as J } from "./checkbox-BjDv-r3o.js";
|
|
@@ -203,4 +203,4 @@ export {
|
|
|
203
203
|
Q as A,
|
|
204
204
|
$ as a
|
|
205
205
|
};
|
|
206
|
-
//# sourceMappingURL=ai-permission-notice-
|
|
206
|
+
//# sourceMappingURL=ai-permission-notice-C00i6VhY.js.map
|