@alfadocs/ui-kit-debug 0.37.0 → 0.38.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/Alfadocs_Logo_Mark-7o3L3WBI.js +56 -0
- package/dist/_chunks/Alfadocs_Logo_Mark-7o3L3WBI.js.map +1 -0
- package/dist/_chunks/{alia-sidebar-BEoMl6UL.js → alia-sidebar-DXsYPinm.js} +2 -2
- package/dist/_chunks/{alia-sidebar-BEoMl6UL.js.map → alia-sidebar-DXsYPinm.js.map} +1 -1
- package/dist/_chunks/{ar-D1RwVZFj.js → ar-Cn_NxqkN.js} +2 -2
- package/dist/_chunks/{ar-D1RwVZFj.js.map → ar-Cn_NxqkN.js.map} +1 -1
- package/dist/_chunks/bmi-BxD-tFzU.js +32 -0
- package/dist/_chunks/bmi-BxD-tFzU.js.map +1 -0
- package/dist/_chunks/bmi-calculator-BRUru9QX.js +213 -0
- package/dist/_chunks/bmi-calculator-BRUru9QX.js.map +1 -0
- package/dist/_chunks/{booking-DqXsd1Mv.js → booking-DK_BPHnQ.js} +4 -4
- package/dist/_chunks/{booking-DqXsd1Mv.js.map → booking-DK_BPHnQ.js.map} +1 -1
- package/dist/_chunks/calculator-dialog-B74fqpFZ.js +40 -0
- package/dist/_chunks/calculator-dialog-B74fqpFZ.js.map +1 -0
- package/dist/_chunks/{chat-message-D53_fH2w.js → chat-message-ASgGtj-L.js} +30 -39
- package/dist/_chunks/chat-message-ASgGtj-L.js.map +1 -0
- package/dist/_chunks/{contact-profile-card-BA6fgS45.js → contact-profile-card-DHyuAPXM.js} +14 -13
- package/dist/_chunks/{contact-profile-card-BA6fgS45.js.map → contact-profile-card-DHyuAPXM.js.map} +1 -1
- package/dist/_chunks/cycle-calculator-B5Uj9QeT.js +185 -0
- package/dist/_chunks/cycle-calculator-B5Uj9QeT.js.map +1 -0
- package/dist/_chunks/{date-picker-CXFpu-qY.js → date-picker-CvQfs6Xh.js} +2 -2
- package/dist/_chunks/{date-picker-CXFpu-qY.js.map → date-picker-CvQfs6Xh.js.map} +1 -1
- package/dist/_chunks/{date-range-picker-I-q5rifj.js → date-range-picker-U9fn1g9d.js} +3 -3
- package/dist/_chunks/{date-range-picker-I-q5rifj.js.map → date-range-picker-U9fn1g9d.js.map} +1 -1
- package/dist/_chunks/{date-time-picker-CqpGPlcH.js → date-time-picker-Cva0ZCWw.js} +2 -2
- package/dist/_chunks/{date-time-picker-CqpGPlcH.js.map → date-time-picker-Cva0ZCWw.js.map} +1 -1
- package/dist/_chunks/{de-HTQ4b4-J.js → de-BMM2H7Bs.js} +2 -2
- package/dist/_chunks/{de-HTQ4b4-J.js.map → de-BMM2H7Bs.js.map} +1 -1
- package/dist/_chunks/dependent-selector-CRWgieHm.js +324 -0
- package/dist/_chunks/dependent-selector-CRWgieHm.js.map +1 -0
- package/dist/_chunks/document-scanner-CdHQ6lTN.js +702 -0
- package/dist/_chunks/document-scanner-CdHQ6lTN.js.map +1 -0
- package/dist/_chunks/due-date-calculator-CUspKSTw.js +171 -0
- package/dist/_chunks/due-date-calculator-CUspKSTw.js.map +1 -0
- package/dist/_chunks/{editable-currency-cell-renderer-DnjwZNZP.js → editable-currency-cell-renderer-DGKuRNVG.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-DnjwZNZP.js.map → editable-currency-cell-renderer-DGKuRNVG.js.map} +1 -1
- package/dist/_chunks/{el-Dr1pjuDq.js → el-BYPonAaK.js} +2 -2
- package/dist/_chunks/{el-Dr1pjuDq.js.map → el-BYPonAaK.js.map} +1 -1
- package/dist/_chunks/{es-CvyTjLS0.js → es-CMkVCQ4F.js} +2 -2
- package/dist/_chunks/{es-CvyTjLS0.js.map → es-CMkVCQ4F.js.map} +1 -1
- package/dist/_chunks/{file-upload-CdozCPct.js → file-upload-CnzRcErt.js} +2 -1
- package/dist/_chunks/{file-upload-CdozCPct.js.map → file-upload-CnzRcErt.js.map} +1 -1
- package/dist/_chunks/fiscal-code-input-BZ0FxwUl.js +540 -0
- package/dist/_chunks/fiscal-code-input-BZ0FxwUl.js.map +1 -0
- package/dist/_chunks/{fr-CS7aqaFR.js → fr-BcuWxqft.js} +2 -2
- package/dist/_chunks/{fr-CS7aqaFR.js.map → fr-BcuWxqft.js.map} +1 -1
- package/dist/_chunks/gestation-BXEgDGmP.js +50 -0
- package/dist/_chunks/gestation-BXEgDGmP.js.map +1 -0
- package/dist/_chunks/gestational-age-calculator-CsQ05qDy.js +165 -0
- package/dist/_chunks/gestational-age-calculator-CsQ05qDy.js.map +1 -0
- package/dist/_chunks/heart-C0faivFf.js +20 -0
- package/dist/_chunks/heart-C0faivFf.js.map +1 -0
- package/dist/_chunks/{hi-3uy8KpsH.js → hi-wkq_rQAh.js} +2 -2
- package/dist/_chunks/{hi-3uy8KpsH.js.map → hi-wkq_rQAh.js.map} +1 -1
- package/dist/_chunks/image-C6RM5hfF.js +16 -0
- package/dist/_chunks/image-C6RM5hfF.js.map +1 -0
- package/dist/_chunks/insert-result-yJ0QavoN.js +133 -0
- package/dist/_chunks/insert-result-yJ0QavoN.js.map +1 -0
- package/dist/_chunks/{isSameWeek-DRpMibi9.js → isSameWeek-Bim5ftRd.js} +2 -2
- package/dist/_chunks/{isSameWeek-DRpMibi9.js.map → isSameWeek-Bim5ftRd.js.map} +1 -1
- package/dist/_chunks/{it-B_RF5VSw.js → it-GiQrQ9p4.js} +3 -3
- package/dist/_chunks/{it-B_RF5VSw.js.map → it-GiQrQ9p4.js.map} +1 -1
- package/dist/_chunks/{ja-C1mEYy35.js → ja-qfYg3Rua.js} +2 -2
- package/dist/_chunks/{ja-C1mEYy35.js.map → ja-qfYg3Rua.js.map} +1 -1
- package/dist/_chunks/{logo-_Z-jLq80.js → logo-yituK7sE.js} +42 -91
- package/dist/_chunks/logo-yituK7sE.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-DXHxy9dj.js → marketplace-app-shell-BnClrL2B.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-DXHxy9dj.js.map → marketplace-app-shell-BnClrL2B.js.map} +1 -1
- package/dist/_chunks/{nl-Dl7lO2t3.js → nl-xOogO4sZ.js} +2 -2
- package/dist/_chunks/{nl-Dl7lO2t3.js.map → nl-xOogO4sZ.js.map} +1 -1
- package/dist/_chunks/{patient-shell-CDvMw_Nk.js → patient-shell-Bz3CdO84.js} +2 -2
- package/dist/_chunks/{patient-shell-CDvMw_Nk.js.map → patient-shell-Bz3CdO84.js.map} +1 -1
- package/dist/_chunks/{pl-Dgsogljx.js → pl-GnOW6eGK.js} +3 -3
- package/dist/_chunks/{pl-Dgsogljx.js.map → pl-GnOW6eGK.js.map} +1 -1
- package/dist/_chunks/{practice-results-BFM_lyUs.js → practice-results-C8ciLQap.js} +3 -2
- package/dist/_chunks/{practice-results-BFM_lyUs.js.map → practice-results-C8ciLQap.js.map} +1 -1
- package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js +209 -0
- package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js.map +1 -0
- package/dist/_chunks/{privacy-lock-DD-wHxBg.js → privacy-lock-BmX_gkvt.js} +2 -2
- package/dist/_chunks/{privacy-lock-DD-wHxBg.js.map → privacy-lock-BmX_gkvt.js.map} +1 -1
- package/dist/_chunks/{pt-Dm2JF4bc.js → pt-_bV5b5RW.js} +2 -2
- package/dist/_chunks/{pt-Dm2JF4bc.js.map → pt-_bV5b5RW.js.map} +1 -1
- package/dist/_chunks/{public-footer.agent-Cjfe5jus.js → public-footer.agent-zw1vFin_.js} +2 -2
- package/dist/_chunks/{public-footer.agent-Cjfe5jus.js.map → public-footer.agent-zw1vFin_.js.map} +1 -1
- package/dist/_chunks/qr-code-DNXhi6se.js +568 -0
- package/dist/_chunks/qr-code-DNXhi6se.js.map +1 -0
- package/dist/_chunks/{react-day-picker-DYDdR8Vv.js → react-day-picker-CdtIiKjx.js} +24 -24
- package/dist/_chunks/{react-day-picker-DYDdR8Vv.js.map → react-day-picker-CdtIiKjx.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-CHmr9Bz8.js → rich-text-editor-DLbg2852.js} +114 -124
- package/dist/_chunks/rich-text-editor-DLbg2852.js.map +1 -0
- package/dist/_chunks/{ro-BXFZ_xIX.js → ro-BEcyh5Nj.js} +2 -2
- package/dist/_chunks/{ro-BXFZ_xIX.js.map → ro-BEcyh5Nj.js.map} +1 -1
- package/dist/_chunks/rotate-ccw-BWANpitO.js +15 -0
- package/dist/_chunks/rotate-ccw-BWANpitO.js.map +1 -0
- package/dist/_chunks/{ru-BPQkNRRV.js → ru-Bi86hqMf.js} +3 -3
- package/dist/_chunks/{ru-BPQkNRRV.js.map → ru-Bi86hqMf.js.map} +1 -1
- package/dist/_chunks/session-countdown-LPnhTHjn.js +214 -0
- package/dist/_chunks/session-countdown-LPnhTHjn.js.map +1 -0
- package/dist/_chunks/{shield-check-BhHyReu8.js → shield-check-C73ma9Cs.js} +8 -24
- package/dist/_chunks/shield-check-C73ma9Cs.js.map +1 -0
- package/dist/_chunks/{sign-in-with-alfadocs-button-BI0fVonM.js → sign-in-with-alfadocs-button-DeHBFRNS.js} +2 -2
- package/dist/_chunks/{sign-in-with-alfadocs-button-BI0fVonM.js.map → sign-in-with-alfadocs-button-DeHBFRNS.js.map} +1 -1
- package/dist/_chunks/social-sign-in-button-X54ySJr1.js +243 -0
- package/dist/_chunks/social-sign-in-button-X54ySJr1.js.map +1 -0
- package/dist/_chunks/{sq-ChTlGFcJ.js → sq-BujHSAWu.js} +2 -2
- package/dist/_chunks/{sq-ChTlGFcJ.js.map → sq-BujHSAWu.js.map} +1 -1
- package/dist/_chunks/subDays-_T9YeKPX.js +8 -0
- package/dist/_chunks/{subDays-D-WYRpdW.js.map → subDays-_T9YeKPX.js.map} +1 -1
- package/dist/_chunks/{sv-Do_gs6ir.js → sv-C8AeDrTA.js} +2 -2
- package/dist/_chunks/{sv-Do_gs6ir.js.map → sv-C8AeDrTA.js.map} +1 -1
- package/dist/_chunks/{tr-da_UnkYH.js → tr-CMSs_Vgf.js} +2 -2
- package/dist/_chunks/{tr-da_UnkYH.js.map → tr-CMSs_Vgf.js.map} +1 -1
- package/dist/_chunks/unit-converter-EUwO6QYq.js +168 -0
- package/dist/_chunks/unit-converter-EUwO6QYq.js.map +1 -0
- package/dist/_chunks/wallet-pay-button-DK4ESYge.js +250 -0
- package/dist/_chunks/wallet-pay-button-DK4ESYge.js.map +1 -0
- package/dist/_chunks/{zh-CN-C9qi5oak.js → zh-CN-eXB-PFu4.js} +3 -3
- package/dist/_chunks/{zh-CN-C9qi5oak.js.map → zh-CN-eXB-PFu4.js.map} +1 -1
- package/dist/agent-catalog.json +203 -1
- package/dist/brand/provider-marks/apple-pay.d.ts +12 -0
- package/dist/brand/provider-marks/apple-pay.d.ts.map +1 -0
- package/dist/brand/provider-marks/apple.d.ts +12 -0
- package/dist/brand/provider-marks/apple.d.ts.map +1 -0
- package/dist/brand/provider-marks/google-pay.d.ts +12 -0
- package/dist/brand/provider-marks/google-pay.d.ts.map +1 -0
- package/dist/brand/provider-marks/google.d.ts +13 -0
- package/dist/brand/provider-marks/google.d.ts.map +1 -0
- package/dist/components/_shared/insert-result.d.ts +47 -0
- package/dist/components/_shared/insert-result.d.ts.map +1 -0
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +3 -0
- package/dist/components/bmi-calculator/bmi-calculator.d.ts.map +1 -1
- package/dist/components/bmi-calculator/index.js +6 -5
- package/dist/components/bmi-calculator/index.js.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/calculator-dialog.d.ts +26 -0
- package/dist/components/calculator-dialog/calculator-dialog.d.ts.map +1 -0
- package/dist/components/calculator-dialog/index.d.ts +3 -0
- package/dist/components/calculator-dialog/index.d.ts.map +1 -0
- package/dist/components/calculator-dialog/index.js +5 -0
- package/dist/components/calculator-dialog/index.js.map +1 -0
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +21 -0
- package/dist/components/cycle-calculator/cycle-calculator.d.ts.map +1 -0
- package/dist/components/cycle-calculator/cycle.d.ts +37 -0
- package/dist/components/cycle-calculator/cycle.d.ts.map +1 -0
- package/dist/components/cycle-calculator/index.d.ts +4 -0
- package/dist/components/cycle-calculator/index.d.ts.map +1 -0
- package/dist/components/cycle-calculator/index.js +7 -0
- package/dist/components/cycle-calculator/index.js.map +1 -0
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dependent-selector/dependent-selector.agent.d.ts +4 -0
- package/dist/components/dependent-selector/dependent-selector.agent.d.ts.map +1 -0
- package/dist/components/dependent-selector/dependent-selector.d.ts +72 -0
- package/dist/components/dependent-selector/dependent-selector.d.ts.map +1 -0
- package/dist/components/dependent-selector/index.d.ts +4 -0
- package/dist/components/dependent-selector/index.d.ts.map +1 -0
- package/dist/components/dependent-selector/index.js +6 -0
- package/dist/components/dependent-selector/index.js.map +1 -0
- package/dist/components/document-scanner/document-scanner.agent.d.ts +4 -0
- package/dist/components/document-scanner/document-scanner.agent.d.ts.map +1 -0
- package/dist/components/document-scanner/document-scanner.d.ts +93 -0
- package/dist/components/document-scanner/document-scanner.d.ts.map +1 -0
- package/dist/components/document-scanner/index.d.ts +4 -0
- package/dist/components/document-scanner/index.d.ts.map +1 -0
- package/dist/components/document-scanner/index.js +6 -0
- package/dist/components/document-scanner/index.js.map +1 -0
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +3 -0
- package/dist/components/due-date-calculator/due-date-calculator.d.ts.map +1 -1
- package/dist/components/due-date-calculator/gestation.d.ts +16 -0
- package/dist/components/due-date-calculator/gestation.d.ts.map +1 -1
- package/dist/components/due-date-calculator/index.d.ts +1 -1
- package/dist/components/due-date-calculator/index.d.ts.map +1 -1
- package/dist/components/due-date-calculator/index.js +10 -7
- package/dist/components/due-date-calculator/index.js.map +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/fiscal-code-input/calculate-codice-fiscale.d.ts +24 -0
- package/dist/components/fiscal-code-input/calculate-codice-fiscale.d.ts.map +1 -0
- package/dist/components/fiscal-code-input/fiscal-code-input.agent.d.ts +4 -0
- package/dist/components/fiscal-code-input/fiscal-code-input.agent.d.ts.map +1 -0
- package/dist/components/fiscal-code-input/fiscal-code-input.d.ts +61 -0
- package/dist/components/fiscal-code-input/fiscal-code-input.d.ts.map +1 -0
- package/dist/components/fiscal-code-input/index.d.ts +6 -0
- package/dist/components/fiscal-code-input/index.d.ts.map +1 -0
- package/dist/components/fiscal-code-input/index.js +11 -0
- package/dist/components/fiscal-code-input/index.js.map +1 -0
- package/dist/components/fiscal-code-input/is-valid-codice-fiscale.d.ts +21 -0
- package/dist/components/fiscal-code-input/is-valid-codice-fiscale.d.ts.map +1 -0
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +27 -0
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts.map +1 -0
- package/dist/components/gestational-age-calculator/index.d.ts +3 -0
- package/dist/components/gestational-age-calculator/index.d.ts.map +1 -0
- package/dist/components/gestational-age-calculator/index.js +5 -0
- package/dist/components/gestational-age-calculator/index.js.map +1 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.d.ts +4 -0
- package/dist/components/pregnancy-weight-gain/index.d.ts.map +1 -0
- package/dist/components/pregnancy-weight-gain/index.js +9 -0
- package/dist/components/pregnancy-weight-gain/index.js.map +1 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +19 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts.map +1 -0
- package/dist/components/pregnancy-weight-gain/weight-gain.d.ts +41 -0
- package/dist/components/pregnancy-weight-gain/weight-gain.d.ts.map +1 -0
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/qr-code/index.d.ts +5 -0
- package/dist/components/qr-code/index.d.ts.map +1 -0
- package/dist/components/qr-code/index.js +8 -0
- package/dist/components/qr-code/index.js.map +1 -0
- package/dist/components/qr-code/qr-code.agent.d.ts +3 -0
- package/dist/components/qr-code/qr-code.agent.d.ts.map +1 -0
- package/dist/components/qr-code/qr-code.d.ts +59 -0
- package/dist/components/qr-code/qr-code.d.ts.map +1 -0
- package/dist/components/qr-code/qr-encode.d.ts +46 -0
- package/dist/components/qr-code/qr-encode.d.ts.map +1 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/session-countdown/index.d.ts +4 -0
- package/dist/components/session-countdown/index.d.ts.map +1 -0
- package/dist/components/session-countdown/index.js +6 -0
- package/dist/components/session-countdown/index.js.map +1 -0
- package/dist/components/session-countdown/session-countdown.agent.d.ts +3 -0
- package/dist/components/session-countdown/session-countdown.agent.d.ts.map +1 -0
- package/dist/components/session-countdown/session-countdown.d.ts +38 -0
- package/dist/components/session-countdown/session-countdown.d.ts.map +1 -0
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/social-sign-in-button/index.d.ts +3 -0
- package/dist/components/social-sign-in-button/index.d.ts.map +1 -0
- package/dist/components/social-sign-in-button/index.js +5 -0
- package/dist/components/social-sign-in-button/index.js.map +1 -0
- package/dist/components/social-sign-in-button/social-sign-in-button.d.ts +56 -0
- package/dist/components/social-sign-in-button/social-sign-in-button.d.ts.map +1 -0
- package/dist/components/unit-converter/index.d.ts +4 -0
- package/dist/components/unit-converter/index.d.ts.map +1 -0
- package/dist/components/unit-converter/index.js +9 -0
- package/dist/components/unit-converter/index.js.map +1 -0
- package/dist/components/unit-converter/unit-converter.d.ts +21 -0
- package/dist/components/unit-converter/unit-converter.d.ts.map +1 -0
- package/dist/components/unit-converter/units.d.ts +18 -0
- package/dist/components/unit-converter/units.d.ts.map +1 -0
- package/dist/components/wallet-pay-button/index.d.ts +3 -0
- package/dist/components/wallet-pay-button/index.d.ts.map +1 -0
- package/dist/components/wallet-pay-button/index.js +5 -0
- package/dist/components/wallet-pay-button/index.js.map +1 -0
- package/dist/components/wallet-pay-button/wallet-pay-button.d.ts +63 -0
- package/dist/components/wallet-pay-button/wallet-pay-button.d.ts.map +1 -0
- package/dist/i18n/locales/ar.d.ts +252 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +249 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +252 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +249 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +252 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +249 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +252 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +252 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +252 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +249 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +252 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +249 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +252 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +249 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +252 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +249 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +252 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +245 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +252 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +249 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +252 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +249 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +252 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +252 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +252 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +249 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +252 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +249 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +252 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +249 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +252 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +249 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +252 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +249 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +252 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +245 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +587 -535
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +252 -0
- package/dist/locales/de.json +252 -0
- package/dist/locales/el.json +252 -0
- package/dist/locales/en.json +252 -0
- package/dist/locales/es.json +252 -0
- package/dist/locales/fr.json +252 -0
- package/dist/locales/hi.json +252 -0
- package/dist/locales/it.json +252 -0
- package/dist/locales/ja.json +252 -0
- package/dist/locales/nl.json +252 -0
- package/dist/locales/pl.json +252 -0
- package/dist/locales/pt.json +252 -0
- package/dist/locales/ro.json +252 -0
- package/dist/locales/ru.json +252 -0
- package/dist/locales/sq.json +252 -0
- package/dist/locales/sv.json +252 -0
- package/dist/locales/tr.json +252 -0
- package/dist/locales/zh.json +252 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +49 -1
- package/dist/_chunks/bmi-calculator-DQD5_nE-.js +0 -214
- package/dist/_chunks/bmi-calculator-DQD5_nE-.js.map +0 -1
- package/dist/_chunks/chat-message-D53_fH2w.js.map +0 -1
- package/dist/_chunks/due-date-calculator-kf9U_g7O.js +0 -173
- package/dist/_chunks/due-date-calculator-kf9U_g7O.js.map +0 -1
- package/dist/_chunks/logo-_Z-jLq80.js.map +0 -1
- package/dist/_chunks/rich-text-editor-CHmr9Bz8.js.map +0 -1
- package/dist/_chunks/shield-check-BhHyReu8.js.map +0 -1
- package/dist/_chunks/subDays-D-WYRpdW.js +0 -8
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { jsxs as k, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as H, useEffect as b, useMemo as v, useRef as W, useState as X } from "react";
|
|
3
|
+
import { c as Z } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as $ } from "react-i18next";
|
|
5
|
+
import { B as G } from "./button-DD_0Xdmr.js";
|
|
6
|
+
import { P as J } from "./progress-kzIRcdaq.js";
|
|
7
|
+
import { L as Q } from "./live-region-C41SO3cA.js";
|
|
8
|
+
import { u as Y } from "./registry-nPAVE19X.js";
|
|
9
|
+
import { C as E } from "./circle-x-Du2CmjaU.js";
|
|
10
|
+
import { T as nn } from "./triangle-alert-CBPUIzQo.js";
|
|
11
|
+
import { c as en } from "./createLucideIcon-CrFbzy84.js";
|
|
12
|
+
/**
|
|
13
|
+
* @license lucide-react v1.8.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
const on = [
|
|
19
|
+
["line", { x1: "10", x2: "14", y1: "2", y2: "2", key: "14vaq8" }],
|
|
20
|
+
["line", { x1: "12", x2: "15", y1: "14", y2: "11", key: "17fdiu" }],
|
|
21
|
+
["circle", { cx: "12", cy: "14", r: "8", key: "1e1u0o" }]
|
|
22
|
+
], sn = en("timer", on), rn = {
|
|
23
|
+
id: "session-countdown",
|
|
24
|
+
capabilities: [],
|
|
25
|
+
state: {},
|
|
26
|
+
actions: {},
|
|
27
|
+
domHooks: {
|
|
28
|
+
root: {
|
|
29
|
+
attr: "data-component",
|
|
30
|
+
value: "session-countdown",
|
|
31
|
+
description: 'Marks the element as a kit SessionCountdown banner. The root also emits `data-tone="running" | "warning" | "expired"` (derived from the remaining time). The accessible remaining-time announcement is surfaced via the region\'s aria-label and a nested polite live region.'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, g = 1e3, h = 60 * g, tn = 15 * h, an = 2 * h, dn = Z(
|
|
35
|
+
[
|
|
36
|
+
"ds:break-words",
|
|
37
|
+
"ds:flex ds:w-full ds:flex-col",
|
|
38
|
+
"ds:rounded-[var(--radius-md)]",
|
|
39
|
+
"ds:border ds:border-[length:var(--border-width-sm)]"
|
|
40
|
+
].join(" "),
|
|
41
|
+
{
|
|
42
|
+
variants: {
|
|
43
|
+
size: {
|
|
44
|
+
sm: "ds:p-[var(--spacing-sm)] ds:gap-[var(--spacing-xs)]",
|
|
45
|
+
md: "ds:p-[var(--spacing-md)] ds:gap-[var(--spacing-sm)]",
|
|
46
|
+
lg: "ds:p-[var(--spacing-lg)] ds:gap-[var(--spacing-sm)]"
|
|
47
|
+
},
|
|
48
|
+
// Internal-only — derived from remaining time, never surfaced to Controls.
|
|
49
|
+
tone: {
|
|
50
|
+
running: [
|
|
51
|
+
"ds:border-[color:var(--info)]",
|
|
52
|
+
"ds:bg-[color-mix(in_srgb,var(--info)_10%,transparent)]",
|
|
53
|
+
"ds:text-[color:var(--info-foreground)]"
|
|
54
|
+
].join(" "),
|
|
55
|
+
warning: [
|
|
56
|
+
"ds:border-[color:var(--warning)]",
|
|
57
|
+
"ds:bg-[color-mix(in_srgb,var(--warning)_10%,transparent)]",
|
|
58
|
+
"ds:text-[color:var(--warning-foreground)]"
|
|
59
|
+
].join(" "),
|
|
60
|
+
expired: [
|
|
61
|
+
"ds:border-[color:var(--error)]",
|
|
62
|
+
"ds:bg-[color-mix(in_srgb,var(--error)_10%,transparent)]",
|
|
63
|
+
"ds:text-[color:var(--error-foreground)]",
|
|
64
|
+
// The tonal Restart button inherits the error tint via the
|
|
65
|
+
// established Alert child-selector trick — contrast-validated.
|
|
66
|
+
"ds:[&_[data-intent=tonal]]:bg-[color:var(--error-foreground)]",
|
|
67
|
+
"ds:[&_[data-intent=tonal]]:text-[color:var(--background)]"
|
|
68
|
+
].join(" ")
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
size: "md",
|
|
73
|
+
tone: "running"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
), cn = {
|
|
77
|
+
sm: "ds:size-4",
|
|
78
|
+
md: "ds:size-5",
|
|
79
|
+
lg: "ds:size-6"
|
|
80
|
+
};
|
|
81
|
+
function ln(n, e) {
|
|
82
|
+
return n <= 0 ? "expired" : n <= e ? "warning" : "running";
|
|
83
|
+
}
|
|
84
|
+
function un(n) {
|
|
85
|
+
return n <= 0 ? 0 : n <= 30 * g ? 10 : n <= 60 * g ? 30 : Math.floor(n / h) * 60;
|
|
86
|
+
}
|
|
87
|
+
function mn(n) {
|
|
88
|
+
return n instanceof Date ? n.getTime() : typeof n == "number" ? n : new Date(n).getTime();
|
|
89
|
+
}
|
|
90
|
+
function fn(n, e, d) {
|
|
91
|
+
const [w, s] = X(() => Date.now()), c = n !== void 0;
|
|
92
|
+
return b(() => {
|
|
93
|
+
if (c || e === void 0 || (s(Date.now()), e - Date.now() <= 0)) return;
|
|
94
|
+
const a = window.setInterval(
|
|
95
|
+
() => {
|
|
96
|
+
const l = Date.now();
|
|
97
|
+
s(l), e - l <= 0 && window.clearInterval(a);
|
|
98
|
+
},
|
|
99
|
+
Math.max(1, d)
|
|
100
|
+
);
|
|
101
|
+
return () => window.clearInterval(a);
|
|
102
|
+
}, [c, e, d]), c ? Math.max(0, n) : e === void 0 ? 0 : Math.max(0, e - w);
|
|
103
|
+
}
|
|
104
|
+
const gn = H(
|
|
105
|
+
({
|
|
106
|
+
remainingMs: n,
|
|
107
|
+
expiresAt: e,
|
|
108
|
+
totalMs: d = tn,
|
|
109
|
+
warnAtMs: w = an,
|
|
110
|
+
size: s = "md",
|
|
111
|
+
showProgress: c = !1,
|
|
112
|
+
onExpire: a,
|
|
113
|
+
onRestart: l,
|
|
114
|
+
restarting: x = !1,
|
|
115
|
+
tickMs: L = 1e3,
|
|
116
|
+
locale: M,
|
|
117
|
+
label: D,
|
|
118
|
+
className: I,
|
|
119
|
+
id: C,
|
|
120
|
+
...j
|
|
121
|
+
}, R) => {
|
|
122
|
+
const { t: o, i18n: A } = $(), y = M ?? A.language ?? "en";
|
|
123
|
+
b(() => {
|
|
124
|
+
}, [n, e]);
|
|
125
|
+
const F = v(
|
|
126
|
+
() => n === void 0 && e !== void 0 ? mn(e) : void 0,
|
|
127
|
+
[n, e]
|
|
128
|
+
), i = fn(n, F, L), u = ln(i, w), r = u === "expired", f = W(!1);
|
|
129
|
+
b(() => {
|
|
130
|
+
i <= 0 && !f.current && (f.current = !0, a == null || a()), i > 0 && f.current && (f.current = !1);
|
|
131
|
+
}, [i, a]);
|
|
132
|
+
const p = v(
|
|
133
|
+
() => new Intl.NumberFormat(y, { maximumFractionDigits: 0 }),
|
|
134
|
+
[y]
|
|
135
|
+
), _ = Math.ceil(i / g), N = Math.floor(_ / 60), S = _ % 60, B = N > 0 ? o("sessionCountdown.timeMinutesSeconds", {
|
|
136
|
+
minutes: p.format(N),
|
|
137
|
+
seconds: p.format(S)
|
|
138
|
+
}) : o("sessionCountdown.timeSecondsOnly", {
|
|
139
|
+
seconds: p.format(S)
|
|
140
|
+
}), m = un(i), T = v(() => m <= 0 ? o("sessionCountdown.expiredAnnouncement") : m < 60 ? o("sessionCountdown.secondsRemaining", { count: m }) : o("sessionCountdown.minutesRemaining", { count: m / 60 }), [m, o]), O = o("sessionCountdown.expiredAnnouncement"), z = D ?? (r ? void 0 : o("sessionCountdown.ariaLabel", { time: T })), U = dn({
|
|
141
|
+
size: s,
|
|
142
|
+
tone: u,
|
|
143
|
+
className: I
|
|
144
|
+
}), K = r ? "alert" : "timer";
|
|
145
|
+
Y(rn, null, C);
|
|
146
|
+
const P = r ? E : u === "warning" ? nn : sn, V = Math.min(d, Math.max(0, d - i)), q = o(r ? "sessionCountdown.expired" : u === "warning" ? "sessionCountdown.warning" : "sessionCountdown.remainingBanner", { time: B });
|
|
147
|
+
return /* @__PURE__ */ k(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
ref: R,
|
|
151
|
+
id: C,
|
|
152
|
+
role: K,
|
|
153
|
+
"aria-label": z,
|
|
154
|
+
"data-component": "session-countdown",
|
|
155
|
+
"data-tone": u,
|
|
156
|
+
className: U,
|
|
157
|
+
...j,
|
|
158
|
+
children: [
|
|
159
|
+
r ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: O }) : null,
|
|
160
|
+
/* @__PURE__ */ k("div", { className: "ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
161
|
+
/* @__PURE__ */ t("span", { className: `ds:shrink-0 ${cn[s]}`, children: /* @__PURE__ */ t(P, { "aria-hidden": "true", className: "ds:size-full" }) }),
|
|
162
|
+
/* @__PURE__ */ t(
|
|
163
|
+
"p",
|
|
164
|
+
{
|
|
165
|
+
className: [
|
|
166
|
+
"ds:min-w-0 ds:flex-1",
|
|
167
|
+
s === "lg" ? "type-body" : "type-body-sm"
|
|
168
|
+
].join(" "),
|
|
169
|
+
"aria-hidden": "true",
|
|
170
|
+
children: q
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
r && l ? /* @__PURE__ */ t(
|
|
174
|
+
G,
|
|
175
|
+
{
|
|
176
|
+
type: "button",
|
|
177
|
+
intent: "tonal",
|
|
178
|
+
size: s === "lg" ? "lg" : "md",
|
|
179
|
+
loading: x,
|
|
180
|
+
disabled: x,
|
|
181
|
+
onClick: l,
|
|
182
|
+
className: "ds:shrink-0",
|
|
183
|
+
children: o("sessionCountdown.restart")
|
|
184
|
+
}
|
|
185
|
+
) : null
|
|
186
|
+
] }),
|
|
187
|
+
c && !r ? (
|
|
188
|
+
// Elapsed fraction flows through the existing Progress API
|
|
189
|
+
// (value/max) — never a hand-rolled inline-width bar. The bar
|
|
190
|
+
// is aria-hidden: the timer region already conveys remaining
|
|
191
|
+
// time, so a second progressbar would double-announce.
|
|
192
|
+
/* @__PURE__ */ t("div", { "aria-hidden": "true", className: "ds:w-full", children: /* @__PURE__ */ t(
|
|
193
|
+
J,
|
|
194
|
+
{
|
|
195
|
+
value: V,
|
|
196
|
+
max: d,
|
|
197
|
+
shape: "bar",
|
|
198
|
+
size: s,
|
|
199
|
+
ariaLabel: o("sessionCountdown.progressLabel")
|
|
200
|
+
}
|
|
201
|
+
) })
|
|
202
|
+
) : null,
|
|
203
|
+
/* @__PURE__ */ t(Q, { politeness: "polite", atomic: !0, children: r ? "" : T })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
gn.displayName = "SessionCountdown";
|
|
210
|
+
export {
|
|
211
|
+
gn as S,
|
|
212
|
+
rn as s
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=session-countdown-LPnhTHjn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-countdown-LPnhTHjn.js","sources":["../../node_modules/lucide-react/dist/esm/icons/timer.js","../../src/components/session-countdown/session-countdown.agent.ts","../../src/components/session-countdown/session-countdown.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"line\", { x1: \"10\", x2: \"14\", y1: \"2\", y2: \"2\", key: \"14vaq8\" }],\n [\"line\", { x1: \"12\", x2: \"15\", y1: \"14\", y2: \"11\", key: \"17fdiu\" }],\n [\"circle\", { cx: \"12\", cy: \"14\", r: \"8\", key: \"1e1u0o\" }]\n];\nconst Timer = createLucideIcon(\"timer\", __iconNode);\n\nexport { __iconNode, Timer as default };\n//# sourceMappingURL=timer.js.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — SessionCountdown. */\n/* */\n/* A live status surface that renders the remaining time of a check-in */\n/* session and escalates tone toward expiry. Pure presentation — it owns */\n/* no consumer-actionable state (the deadline lives with the consumer */\n/* via `remainingMs` / `expiresAt`, and the only interactive element is */\n/* the consumer-wired Restart button). So this adapter registers only */\n/* the canonical `data-component=\"session-countdown\"` DOM hook; the root */\n/* also exposes `data-tone` so a future MCP UI bridge can read the */\n/* running / warning / expired state without parsing the visible digits. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\nexport const sessionCountdownAgent: AgentAdapter = {\n id: 'session-countdown',\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'session-countdown',\n description:\n 'Marks the element as a kit SessionCountdown banner. The root also emits `data-tone=\"running\" | \"warning\" | \"expired\"` (derived from the remaining time). The accessible remaining-time announcement is surfaced via the region\\'s aria-label and a nested polite live region.',\n },\n },\n};\n","import {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { TriangleAlert, CircleX, Timer } from 'lucide-react';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { LiveRegion } from '../live-region';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { sessionCountdownAgent } from './session-countdown.agent';\n\n/* ------------------------------------------------------------------ */\n/* Constants */\n/* ------------------------------------------------------------------ */\n\nconst SECOND_MS = 1000;\nconst MINUTE_MS = 60 * SECOND_MS;\nconst DEFAULT_TOTAL_MS = 15 * MINUTE_MS; // 900_000 — HTP-5118 check-in window\nconst DEFAULT_WARN_AT_MS = 2 * MINUTE_MS; // 120_000 — final 2 minutes\n\n/* ------------------------------------------------------------------ */\n/* CVA — public axis: size (sm | md | lg). The component renders the */\n/* banner as its sole presentation (the former `inline` variant was */\n/* removed — see breaking change note). */\n/* */\n/* `tone` (running | warning | expired) is DERIVED internally from the */\n/* remaining time and is NOT a consumer-set prop (see spec / synthesis */\n/* recommendedAdjustment). It still flows through the CVA recipe as an */\n/* internal variant key so the tone colours stay token-driven and */\n/* mirror Alert's info / warning / error surfaces. */\n/* ------------------------------------------------------------------ */\n\nconst countdownVariants = cva(\n [\n 'ds:break-words',\n 'ds:flex ds:w-full ds:flex-col',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:border ds:border-[length:var(--border-width-sm)]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:p-[var(--spacing-sm)] ds:gap-[var(--spacing-xs)]',\n md: 'ds:p-[var(--spacing-md)] ds:gap-[var(--spacing-sm)]',\n lg: 'ds:p-[var(--spacing-lg)] ds:gap-[var(--spacing-sm)]',\n },\n // Internal-only — derived from remaining time, never surfaced to Controls.\n tone: {\n running: [\n 'ds:border-[color:var(--info)]',\n 'ds:bg-[color-mix(in_srgb,var(--info)_10%,transparent)]',\n 'ds:text-[color:var(--info-foreground)]',\n ].join(' '),\n warning: [\n 'ds:border-[color:var(--warning)]',\n 'ds:bg-[color-mix(in_srgb,var(--warning)_10%,transparent)]',\n 'ds:text-[color:var(--warning-foreground)]',\n ].join(' '),\n expired: [\n 'ds:border-[color:var(--error)]',\n 'ds:bg-[color-mix(in_srgb,var(--error)_10%,transparent)]',\n 'ds:text-[color:var(--error-foreground)]',\n // The tonal Restart button inherits the error tint via the\n // established Alert child-selector trick — contrast-validated.\n 'ds:[&_[data-intent=tonal]]:bg-[color:var(--error-foreground)]',\n 'ds:[&_[data-intent=tonal]]:text-[color:var(--background)]',\n ].join(' '),\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'running',\n },\n },\n);\n\nconst ICON_SIZE_CLASS = {\n sm: 'ds:size-4',\n md: 'ds:size-5',\n lg: 'ds:size-6',\n} as const;\n\n/* ------------------------------------------------------------------ */\n/* Derived tone */\n/* ------------------------------------------------------------------ */\n\ntype Tone = 'running' | 'warning' | 'expired';\n\nfunction deriveTone(remaining: number, warnAtMs: number): Tone {\n if (remaining <= 0) return 'expired';\n if (remaining <= warnAtMs) return 'warning';\n return 'running';\n}\n\n/* ------------------------------------------------------------------ */\n/* Announcement bucketing */\n/* */\n/* The visual digits update every second, but AT must hear only coarse */\n/* buckets to avoid flooding: minute boundaries while remaining > 60s, */\n/* then once at 30s and 10s, then expiry. We key the polite */\n/* announcement on the bucket — NOT on the per-second value — so NVDA */\n/* / VoiceOver never interrupt themselves continuously. */\n/* */\n/* The returned value is the count spoken to AT, in SECONDS, and is */\n/* FLOORED to the threshold the user has actually crossed into so the */\n/* announcement never claims MORE time than truly remains (a deadline */\n/* countdown must round down, never up). e.g. at 45s the bucket is 30 */\n/* — \"30 seconds remaining\" — never \"60 seconds\". Above 60s we floor */\n/* to whole minutes (4m37s → 4 minutes), so it re-keys on each minute */\n/* boundary while staying truthful. */\n/* ------------------------------------------------------------------ */\n\nfunction announcementBucket(remaining: number): number {\n if (remaining <= 0) return 0;\n if (remaining <= 30 * SECOND_MS) return 10;\n if (remaining <= 60 * SECOND_MS) return 30;\n // Coarse minute bucket above 60s: 60, 120, 180 … (in seconds), floored\n // so the spoken minute count is always <= the true remaining time.\n return Math.floor(remaining / MINUTE_MS) * 60;\n}\n\n/* ------------------------------------------------------------------ */\n/* Time math */\n/* ------------------------------------------------------------------ */\n\nfunction toEpoch(value: number | string | Date): number {\n if (value instanceof Date) return value.getTime();\n if (typeof value === 'number') return value;\n return new Date(value).getTime();\n}\n\n/**\n * Internal-tick hook for the `expiresAt` path. Returns the live remaining\n * milliseconds (clamped >= 0) and re-renders every `tickMs` until expiry.\n * When `controlledRemaining` is supplied it is the source of truth and the\n * timer never starts — the deterministic path for stories / tests.\n */\nfunction useRemainingMs(\n controlledRemaining: number | undefined,\n expiresAtEpoch: number | undefined,\n tickMs: number,\n): number {\n const [now, setNow] = useState<number>(() => Date.now());\n\n const isControlled = controlledRemaining !== undefined;\n\n useEffect(() => {\n if (isControlled || expiresAtEpoch === undefined) return;\n // Re-sync on mount so a late mount / clock-skew reads correctly.\n setNow(Date.now());\n if (expiresAtEpoch - Date.now() <= 0) return; // already expired — no timer\n const id = window.setInterval(\n () => {\n const current = Date.now();\n setNow(current);\n if (expiresAtEpoch - current <= 0) {\n window.clearInterval(id);\n }\n },\n Math.max(1, tickMs),\n );\n return () => window.clearInterval(id);\n }, [isControlled, expiresAtEpoch, tickMs]);\n\n if (isControlled) return Math.max(0, controlledRemaining);\n if (expiresAtEpoch === undefined) return 0;\n return Math.max(0, expiresAtEpoch - now);\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\ntype CountdownVariantProps = Pick<\n VariantProps<typeof countdownVariants>,\n 'size'\n>;\n\nexport interface SessionCountdownProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'role'>, CountdownVariantProps {\n /** Controlled remaining milliseconds. Source of truth; no internal tick. */\n remainingMs?: number;\n /** Absolute deadline (ms-epoch, ISO string, or Date). Ticks internally. */\n expiresAt?: number | string | Date;\n /** Full session duration in ms — progress denominator. Default 900000. */\n totalMs?: number;\n /** Remaining threshold (ms) at/below which tone escalates to warning. */\n warnAtMs?: number;\n /** Type / padding scale. Default `md`. */\n size?: 'sm' | 'md' | 'lg';\n /** Determinate Progress bar of elapsed fraction. */\n showProgress?: boolean;\n /** Fired exactly once when remaining crosses to 0. Idempotent. */\n onExpire?: () => void;\n /** Restart CTA handler (expired banner). Omit → no button rendered. */\n onRestart?: () => void;\n /** Restart in flight — disables + spins the Restart button. */\n restarting?: boolean;\n /** Internal tick cadence (ms) for the `expiresAt` path. Default 1000. */\n tickMs?: number;\n /** Locale override for number formatting. Falls back to i18n.language. */\n locale?: string;\n /** Override the accessible name of the timer region. */\n label?: string;\n /** Merged onto the outermost element. CVA-composed, never inline style. */\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* SessionCountdown */\n/* ------------------------------------------------------------------ */\n\nexport const SessionCountdown = forwardRef<\n HTMLDivElement,\n SessionCountdownProps\n>(\n (\n {\n remainingMs,\n expiresAt,\n totalMs = DEFAULT_TOTAL_MS,\n warnAtMs = DEFAULT_WARN_AT_MS,\n size = 'md',\n showProgress = false,\n onExpire,\n onRestart,\n restarting = false,\n tickMs = 1000,\n locale: localeProp,\n label,\n className,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const locale = localeProp ?? i18n.language ?? 'en';\n\n // DEV warning when both controlled + deadline are passed; remainingMs wins.\n useEffect(() => {\n if (\n import.meta.env.DEV &&\n remainingMs !== undefined &&\n expiresAt !== undefined\n ) {\n console.warn(\n 'SessionCountdown: both `remainingMs` and `expiresAt` provided; `remainingMs` wins and the deadline is ignored.',\n );\n }\n }, [remainingMs, expiresAt]);\n\n const expiresAtEpoch = useMemo(\n () =>\n remainingMs === undefined && expiresAt !== undefined\n ? toEpoch(expiresAt)\n : undefined,\n [remainingMs, expiresAt],\n );\n\n const remaining = useRemainingMs(remainingMs, expiresAtEpoch, tickMs);\n const tone = deriveTone(remaining, warnAtMs);\n const isExpired = tone === 'expired';\n\n /* ── onExpire — fire exactly once via a ref guard ─────────────── */\n const expireFiredRef = useRef(false);\n useEffect(() => {\n if (remaining <= 0 && !expireFiredRef.current) {\n expireFiredRef.current = true;\n onExpire?.();\n }\n // Allow a fresh expiry if the timer is restarted (remaining climbs > 0).\n if (remaining > 0 && expireFiredRef.current) {\n expireFiredRef.current = false;\n }\n }, [remaining, onExpire]);\n\n /* ── Number formatting (Intl, no deps) ────────────────────────── */\n const nf = useMemo(\n () => new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }),\n [locale],\n );\n const totalSeconds = Math.ceil(remaining / SECOND_MS);\n const minutes = Math.floor(totalSeconds / 60);\n const seconds = totalSeconds % 60;\n\n // Visible compact time string. Under 60s we drop the minutes segment.\n const timeText =\n minutes > 0\n ? t('sessionCountdown.timeMinutesSeconds', {\n minutes: nf.format(minutes),\n seconds: nf.format(seconds),\n })\n : t('sessionCountdown.timeSecondsOnly', {\n seconds: nf.format(seconds),\n });\n\n /* ── Coarse announcement (decoupled from the per-second tick) ─── */\n const bucket = announcementBucket(remaining);\n const announcement = useMemo(() => {\n if (bucket <= 0) {\n return t('sessionCountdown.expiredAnnouncement');\n }\n // Sub-minute buckets (30, 10) speak seconds; whole-minute buckets\n // (60, 120, …) speak minutes. The bucket is already floored so the\n // spoken count never exceeds the true remaining time.\n if (bucket < 60) {\n return t('sessionCountdown.secondsRemaining', { count: bucket });\n }\n return t('sessionCountdown.minutesRemaining', { count: bucket / 60 });\n }, [bucket, t]);\n\n // Clean, standalone expiry announcement — surfaced verbatim (NOT folded\n // into the ariaLabel template, which would double-interpolate into\n // \"Session expires in Session expired.\").\n const expiredAnnouncement = t('sessionCountdown.expiredAnnouncement');\n\n // Accessible name for the region:\n // - running / warning → the terse ariaLabel template (\"Session expires\n // in 5 minutes remaining\"), refreshed only when the bucket changes.\n // - expired → no aria-label; the root becomes role=\"alert\" and takes its\n // accessible name from the real `expiredAnnouncement` text node inside\n // it, so screen readers that announce a live region's TEXT (not its\n // aria-label) still voice the expiry. A `label` override wins in all\n // states.\n const regionLabel =\n label ??\n (isExpired\n ? undefined\n : t('sessionCountdown.ariaLabel', { time: announcement }));\n\n const composedClass = countdownVariants({\n size,\n tone,\n className,\n });\n\n // role escalation modelled on Alert: timer while running / warning,\n // alert (implicitly an assertive live region) on expiry. The root does\n // NOT carry `aria-live` while running — the per-second visual value is\n // aria-hidden and the coarse running announcements come from the nested\n // polite LiveRegion. On expiry the root's `role=\"alert\"` carries a real\n // (non-aria-hidden) text node with `expiredAnnouncement`, so the message\n // is announced via live-region TEXT rather than an aria-label-only name\n // — reliable across NVDA / VoiceOver — and exactly once (the text does\n // not change on later ticks). The nested polite region is emptied on\n // expiry so the two regions never double-announce.\n const role = isExpired ? 'alert' : 'timer';\n\n useAgentRegistration(sessionCountdownAgent, null, id);\n\n /* ── banner ───────────────────────────────────────────────────── */\n const Icon = isExpired\n ? CircleX\n : tone === 'warning'\n ? TriangleAlert\n : Timer;\n const elapsed = Math.min(totalMs, Math.max(0, totalMs - remaining));\n\n const messageKey = isExpired\n ? 'sessionCountdown.expired'\n : tone === 'warning'\n ? 'sessionCountdown.warning'\n : 'sessionCountdown.remainingBanner';\n const message = t(messageKey, { time: timeText });\n\n return (\n <div\n ref={ref}\n id={id}\n role={role}\n aria-label={regionLabel}\n data-component=\"session-countdown\"\n data-tone={tone}\n className={composedClass}\n {...rest}\n >\n {/* On expiry the root is role=\"alert\"; this real (non-aria-hidden)\n sr-only text node gives the alert its announced content and\n accessible name (the visible banner sentence stays aria-hidden so\n it is not read twice). It appears once, on the expiry render, so\n the message is voiced exactly once and stays quiet on later ticks. */}\n {isExpired ? (\n <span className=\"ds:sr-only\">{expiredAnnouncement}</span>\n ) : null}\n <div className=\"ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className={`ds:shrink-0 ${ICON_SIZE_CLASS[size]}`}>\n <Icon aria-hidden=\"true\" className=\"ds:size-full\" />\n </span>\n <p\n className={[\n 'ds:min-w-0 ds:flex-1',\n size === 'lg' ? 'type-body' : 'type-body-sm',\n ].join(' ')}\n aria-hidden=\"true\"\n >\n {message}\n </p>\n {isExpired && onRestart ? (\n <Button\n type=\"button\"\n intent=\"tonal\"\n size={size === 'lg' ? 'lg' : 'md'}\n loading={restarting}\n disabled={restarting}\n onClick={onRestart}\n className=\"ds:shrink-0\"\n >\n {t('sessionCountdown.restart')}\n </Button>\n ) : null}\n </div>\n\n {showProgress && !isExpired ? (\n // Elapsed fraction flows through the existing Progress API\n // (value/max) — never a hand-rolled inline-width bar. The bar\n // is aria-hidden: the timer region already conveys remaining\n // time, so a second progressbar would double-announce.\n <div aria-hidden=\"true\" className=\"ds:w-full\">\n <Progress\n value={elapsed}\n max={totalMs}\n shape=\"bar\"\n size={size}\n ariaLabel={t('sessionCountdown.progressLabel')}\n />\n </div>\n ) : null}\n\n {/* Coarse running announcement, keyed on the bucket. Polite\n (role=\"status\"). Suppressed on expiry — the root alert above\n carries the expiry message, so the two never double-announce. */}\n <LiveRegion politeness=\"polite\" atomic>\n {isExpired ? '' : announcement}\n </LiveRegion>\n </div>\n );\n },\n);\n\nSessionCountdown.displayName = 'SessionCountdown';\n"],"names":["__iconNode","Timer","createLucideIcon","sessionCountdownAgent","SECOND_MS","MINUTE_MS","DEFAULT_TOTAL_MS","DEFAULT_WARN_AT_MS","countdownVariants","cva","ICON_SIZE_CLASS","deriveTone","remaining","warnAtMs","announcementBucket","toEpoch","value","useRemainingMs","controlledRemaining","expiresAtEpoch","tickMs","now","setNow","useState","isControlled","useEffect","id","current","SessionCountdown","forwardRef","remainingMs","expiresAt","totalMs","size","showProgress","onExpire","onRestart","restarting","localeProp","label","className","rest","ref","t","i18n","useTranslation","locale","useMemo","tone","isExpired","expireFiredRef","useRef","nf","totalSeconds","minutes","seconds","timeText","bucket","announcement","expiredAnnouncement","regionLabel","composedClass","role","useAgentRegistration","Icon","CircleX","TriangleAlert","elapsed","message","jsxs","jsx","Button","Progress","LiveRegion"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -1,40 +1,25 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as e } from "./createLucideIcon-CrFbzy84.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v1.8.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
9
|
-
[
|
|
10
|
-
"path",
|
|
11
|
-
{
|
|
12
|
-
d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",
|
|
13
|
-
key: "mvr1a0"
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
], d = a("heart", e);
|
|
17
|
-
/**
|
|
18
|
-
* @license lucide-react v1.8.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/
|
|
23
|
-
const t = [
|
|
8
|
+
const a = [
|
|
24
9
|
["path", { d: "m5 8 6 6", key: "1wu5hv" }],
|
|
25
10
|
["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
|
|
26
11
|
["path", { d: "M2 5h12", key: "or177f" }],
|
|
27
12
|
["path", { d: "M7 2h1", key: "1t2jsx" }],
|
|
28
13
|
["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
|
|
29
14
|
["path", { d: "M14 18h6", key: "1m8k6r" }]
|
|
30
|
-
],
|
|
15
|
+
], t = e("languages", a);
|
|
31
16
|
/**
|
|
32
17
|
* @license lucide-react v1.8.0 - ISC
|
|
33
18
|
*
|
|
34
19
|
* This source code is licensed under the ISC license.
|
|
35
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
21
|
*/
|
|
37
|
-
const
|
|
22
|
+
const d = [
|
|
38
23
|
[
|
|
39
24
|
"path",
|
|
40
25
|
{
|
|
@@ -43,10 +28,9 @@ const c = [
|
|
|
43
28
|
}
|
|
44
29
|
],
|
|
45
30
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
46
|
-
],
|
|
31
|
+
], c = e("shield-check", d);
|
|
47
32
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
n as S
|
|
33
|
+
t as L,
|
|
34
|
+
c as S
|
|
51
35
|
};
|
|
52
|
-
//# sourceMappingURL=shield-check-
|
|
36
|
+
//# sourceMappingURL=shield-check-C73ma9Cs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shield-check-C73ma9Cs.js","sources":["../../node_modules/lucide-react/dist/esm/icons/languages.js","../../node_modules/lucide-react/dist/esm/icons/shield-check.js"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m5 8 6 6\", key: \"1wu5hv\" }],\n [\"path\", { d: \"m4 14 6-6 2-3\", key: \"1k1g8d\" }],\n [\"path\", { d: \"M2 5h12\", key: \"or177f\" }],\n [\"path\", { d: \"M7 2h1\", key: \"1t2jsx\" }],\n [\"path\", { d: \"m22 22-5-10-5 10\", key: \"don7ne\" }],\n [\"path\", { d: \"M14 18h6\", key: \"1m8k6r\" }]\n];\nconst Languages = createLucideIcon(\"languages\", __iconNode);\n\nexport { __iconNode, Languages as default };\n//# sourceMappingURL=languages.js.map\n","/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\",\n key: \"oel41y\"\n }\n ],\n [\"path\", { d: \"m9 12 2 2 4-4\", key: \"dzmm74\" }]\n];\nconst ShieldCheck = createLucideIcon(\"shield-check\", __iconNode);\n\nexport { __iconNode, ShieldCheck as default };\n//# sourceMappingURL=shield-check.js.map\n"],"names":["__iconNode","Languages","createLucideIcon","ShieldCheck"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,iBAAiB,KAAK,SAAQ,CAAE;AAAA,EAC9C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,UAAU,KAAK,SAAQ,CAAE;AAAA,EACvC,CAAC,QAAQ,EAAE,GAAG,oBAAoB,KAAK,SAAQ,CAAE;AAAA,EACjD,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAC3C,GACMC,IAAYC,EAAiB,aAAaF,CAAU;ACjB1D;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,iBAAiB,KAAK,SAAQ,CAAE;AAChD,GACMG,IAAcD,EAAiB,gBAAgBF,CAAU;","x_google_ignoreList":[0,1]}
|
|
@@ -2,7 +2,7 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as L, useRef as c, useEffect as b } from "react";
|
|
3
3
|
import { useTranslation as y } from "react-i18next";
|
|
4
4
|
import { B as E } from "./button-DD_0Xdmr.js";
|
|
5
|
-
import { L as I } from "./logo-
|
|
5
|
+
import { L as I } from "./logo-yituK7sE.js";
|
|
6
6
|
import { S as g } from "./spinner-CCByyvcb.js";
|
|
7
7
|
const A = /* @__PURE__ */ new Set([
|
|
8
8
|
"primary",
|
|
@@ -46,4 +46,4 @@ B.displayName = "SignInWithAlfadocsButton";
|
|
|
46
46
|
export {
|
|
47
47
|
B as S
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=sign-in-with-alfadocs-button-
|
|
49
|
+
//# sourceMappingURL=sign-in-with-alfadocs-button-DeHBFRNS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-with-alfadocs-button-
|
|
1
|
+
{"version":3,"file":"sign-in-with-alfadocs-button-DeHBFRNS.js","sources":["../../src/components/sign-in-with-alfadocs-button/sign-in-with-alfadocs-button.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button, type ButtonProps } from '../button';\nimport { Logo } from '../logo';\nimport { Spinner } from '../spinner';\n\n// A provider-style button (\"Sign in with AlfaDocs\"). Wraps the Button\n// primitive so it inherits the full intent / size / asChild / endIcon /\n// forced-colors / focus-ring contract for free.\n//\n// The only differences from a plain Button are:\n// 1. A sensible default label resolved from the\n// `ui.auth.continueWithAlfadocs` translation key.\n// 2. The AlfaDocs brand mark rendered as the leading icon.\n// 3. Loading swaps the mark for the kit's `Spinner` (pulse variant)\n// rather than Button's hand-rolled SVG — visually consistent with\n// every other loading affordance in the kit.\n//\n// `destructive` is intentionally omitted — there is no \"delete the\n// user's account\" sign-in flow that this button represents.\n\ntype AllowedIntent = Exclude<NonNullable<ButtonProps['intent']>, 'destructive'>;\n\n// Intents that paint the button surface and use a foreground-tinted\n// text colour. The mark needs to inherit `currentColor` here so it\n// reads against the coloured surface; on transparent intents the\n// mark's own brand violet contrasts naturally with the foreground\n// text.\nconst FILLED_INTENTS = new Set<AllowedIntent>([\n 'primary',\n 'secondary',\n 'tonal',\n]);\n\nexport interface SignInWithAlfadocsButtonProps extends Omit<\n ButtonProps,\n 'startIcon' | 'children' | 'intent'\n> {\n /**\n * Visual intent. Inherits the Button intent set with `destructive`\n * omitted (no \"destroy account\" sign-in flow exists).\n */\n intent?: AllowedIntent;\n /**\n * Override the visible label. When omitted, the component reads\n * `ui.auth.continueWithAlfadocs` (English fallback: \"Continue with\n * AlfaDocs\"). Pass a node to render e.g. \"Sign in with AlfaDocs\" or a\n * fully-translated string.\n */\n label?: ReactNode;\n /**\n * Fired when the component detects the user has cancelled an\n * in-flight sign-in — typically by pressing the browser back button\n * after the OAuth redirect, which restores the page from bfcache\n * with `loading` still true. Wire this to your loading-state\n * setter so the button returns to idle:\n *\n * ```tsx\n * <SignInWithAlfadocsButton\n * loading={signingIn}\n * onLoadingCancelled={() => setSigningIn(false)}\n * onClick={() => { setSigningIn(true); window.location = oauthUrl }}\n * />\n * ```\n *\n * Without this, your `loading` state would survive the back\n * navigation and the button would appear permanently stuck. Only\n * fires when `loading` is currently true; never fires on first mount.\n */\n onLoadingCancelled?: () => void;\n}\n\nexport const SignInWithAlfadocsButton = forwardRef<\n HTMLButtonElement,\n SignInWithAlfadocsButtonProps\n>(\n (\n {\n intent = 'primary',\n size,\n loading = false,\n disabled,\n label,\n onLoadingCancelled,\n type = 'button',\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const resolvedLabel =\n label ?? t('auth.continueWithAlfadocs', 'Continue with AlfaDocs');\n const logoTone = FILLED_INTENTS.has(intent) ? 'inherit' : 'auto';\n const resolvedSize = size ?? 'md';\n\n // Stash the latest values in refs so the `pageshow` listener can\n // read them without re-binding on every render. Only one listener\n // attaches for the lifetime of the component.\n const loadingRef = useRef(loading);\n const onCancelRef = useRef(onLoadingCancelled);\n loadingRef.current = loading;\n onCancelRef.current = onLoadingCancelled;\n\n useEffect(() => {\n const onPageShow = (event: PageTransitionEvent) => {\n // `event.persisted` is true when the page was restored from\n // the back/forward cache — the canonical signal for \"user\n // navigated away and came back without a fresh load.\" If the\n // button thinks it's still loading, that means an OAuth\n // redirect was started but never completed.\n if (event.persisted && loadingRef.current && onCancelRef.current) {\n onCancelRef.current();\n }\n };\n window.addEventListener('pageshow', onPageShow);\n return () => window.removeEventListener('pageshow', onPageShow);\n }, []);\n\n // We don't forward `loading` to Button — Button would render its\n // own inline SVG and hide the label. Instead we keep the label\n // visible, swap the leading icon for the kit's Spinner, and\n // reproduce the disabled / aria-busy contract manually.\n return (\n <Button\n ref={ref}\n type={type}\n intent={intent}\n size={size}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-component=\"sign-in-with-alfadocs-button\"\n startIcon={\n loading ? (\n <Spinner size={resolvedSize} variant=\"pulse\" />\n ) : (\n <Logo variant=\"mark\" size=\"sm\" tone={logoTone} decorative />\n )\n }\n {...props}\n >\n {resolvedLabel}\n </Button>\n );\n },\n);\n\nSignInWithAlfadocsButton.displayName = 'SignInWithAlfadocsButton';\n"],"names":["FILLED_INTENTS","SignInWithAlfadocsButton","forwardRef","intent","size","loading","disabled","label","onLoadingCancelled","type","props","ref","t","useTranslation","resolvedLabel","logoTone","resolvedSize","loadingRef","useRef","onCancelRef","useEffect","onPageShow","event","jsx","Button","Spinner","Logo"],"mappings":";;;;;;AA4BA,MAAMA,wBAAqB,IAAmB;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAwCYC,IAA2BC;AAAA,EAItC,CACE;AAAA,IACE,QAAAC,IAAS;AAAA,IACT,MAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IACJP,KAASK,EAAE,6BAA6B,wBAAwB,GAC5DG,IAAWf,EAAe,IAAIG,CAAM,IAAI,YAAY,QACpDa,IAAeZ,KAAQ,MAKvBa,IAAaC,EAAOb,CAAO,GAC3Bc,IAAcD,EAAOV,CAAkB;AAC7C,WAAAS,EAAW,UAAUZ,GACrBc,EAAY,UAAUX,GAEtBY,EAAU,MAAM;AACd,YAAMC,IAAa,CAACC,MAA+B;AAMjD,QAAIA,EAAM,aAAaL,EAAW,WAAWE,EAAY,WACvDA,EAAY,QAAA;AAAA,MAEhB;AACA,oBAAO,iBAAiB,YAAYE,CAAU,GACvC,MAAM,OAAO,oBAAoB,YAAYA,CAAU;AAAA,IAChE,GAAG,CAAA,CAAE,GAOH,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAb;AAAA,QACA,MAAAF;AAAA,QACA,QAAAN;AAAA,QACA,MAAAC;AAAA,QACA,UAAUE,KAAYD;AAAA,QACtB,aAAWA,KAAW;AAAA,QACtB,kBAAe;AAAA,QACf,WACEA,IACE,gBAAAkB,EAACE,KAAQ,MAAMT,GAAc,SAAQ,QAAA,CAAQ,IAE7C,gBAAAO,EAACG,GAAA,EAAK,SAAQ,QAAO,MAAK,MAAK,MAAMX,GAAU,YAAU,IAAC;AAAA,QAG7D,GAAGL;AAAA,QAEH,UAAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEAb,EAAyB,cAAc;"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { jsx as s, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useRef as p, useEffect as N } from "react";
|
|
3
|
+
import { c as n } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as j } from "react-i18next";
|
|
5
|
+
import { S as V } from "./spinner-CCByyvcb.js";
|
|
6
|
+
function A({ className: e }) {
|
|
7
|
+
return /* @__PURE__ */ s(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
focusable: "false",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "currentColor",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
className: e,
|
|
16
|
+
children: /* @__PURE__ */ s("path", { d: "M17.05 12.536c-.024-2.51 2.05-3.715 2.143-3.774-1.168-1.708-2.985-1.942-3.63-1.967-1.546-.157-3.018.91-3.802.91-.783 0-1.99-.888-3.273-.864-1.684.025-3.236.978-4.102 2.485-1.748 3.03-.448 7.513 1.255 9.97.832 1.203 1.825 2.552 3.127 2.504 1.255-.05 1.73-.81 3.247-.81 1.518 0 1.945.81 3.273.786 1.351-.025 2.206-1.227 3.03-2.434.955-1.394 1.348-2.745 1.372-2.815-.03-.013-2.633-1.01-2.66-4.001m-2.48-7.343c.692-.838 1.158-2.002 1.03-3.163-.997.04-2.205.664-2.92 1.502-.64.742-1.2 1.927-1.05 3.066 1.112.086 2.247-.566 2.94-1.405" })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function v({ className: e }) {
|
|
21
|
+
return /* @__PURE__ */ m(
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
focusable: "false",
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
className: e,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ s(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
fill: "#4285F4",
|
|
34
|
+
d: "M23.52 12.273c0-.851-.076-1.67-.218-2.455H12v4.642h6.458a5.52 5.52 0 0 1-2.394 3.622v3.01h3.878c2.269-2.09 3.578-5.166 3.578-8.819z"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ s(
|
|
38
|
+
"path",
|
|
39
|
+
{
|
|
40
|
+
fill: "#34A853",
|
|
41
|
+
d: "M12 24c3.24 0 5.956-1.075 7.942-2.908l-3.878-3.01c-1.075.72-2.45 1.146-4.064 1.146-3.125 0-5.77-2.11-6.714-4.946H1.276v3.106A11.995 11.995 0 0 0 12 24z"
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ s(
|
|
45
|
+
"path",
|
|
46
|
+
{
|
|
47
|
+
fill: "#FBBC05",
|
|
48
|
+
d: "M5.286 14.282A7.213 7.213 0 0 1 4.91 12c0-.792.136-1.562.376-2.282V6.612H1.276A11.995 11.995 0 0 0 0 12c0 1.936.464 3.768 1.276 5.388l4.01-3.106z"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ s(
|
|
52
|
+
"path",
|
|
53
|
+
{
|
|
54
|
+
fill: "#EA4335",
|
|
55
|
+
d: "M12 4.773c1.762 0 3.344.605 4.589 1.794l3.442-3.442C17.951 1.19 15.235 0 12 0A11.995 11.995 0 0 0 1.276 6.612l4.01 3.106C6.23 6.882 8.875 4.773 12 4.773z"
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
const M = n(
|
|
63
|
+
[
|
|
64
|
+
"ds:relative ds:inline-flex ds:items-center ds:justify-center",
|
|
65
|
+
"ds:font-medium ds:whitespace-nowrap",
|
|
66
|
+
"ds:rounded-[var(--radius-md)]",
|
|
67
|
+
"ds:gap-[var(--spacing-sm)]",
|
|
68
|
+
"ds:border ds:border-solid",
|
|
69
|
+
"ds:active:opacity-90",
|
|
70
|
+
"ds:transition-[background-color,box-shadow,opacity]",
|
|
71
|
+
"ds:duration-[var(--animation-duration)]",
|
|
72
|
+
// Focus ring is `var(--ring)` (the kit primary), NEVER the brand
|
|
73
|
+
// surface colour — painting the ring in the brand hue on a brand
|
|
74
|
+
// surface makes it invisible. Same rule WhatsAppButton codifies.
|
|
75
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
76
|
+
"ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
77
|
+
// Windows High Contrast Mode strips brand fills — repaint a solid
|
|
78
|
+
// border edge + swap the focus ring to CanvasText so the affordance
|
|
79
|
+
// stays identifiable.
|
|
80
|
+
"ds:forced-colors:border-[ButtonBorder]",
|
|
81
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
82
|
+
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
|
|
83
|
+
"ds:aria-busy:cursor-wait",
|
|
84
|
+
"ds:motion-reduce:transition-none"
|
|
85
|
+
].join(" "),
|
|
86
|
+
{
|
|
87
|
+
variants: {
|
|
88
|
+
provider: {
|
|
89
|
+
apple: "",
|
|
90
|
+
google: ""
|
|
91
|
+
},
|
|
92
|
+
appearance: {
|
|
93
|
+
light: "",
|
|
94
|
+
dark: ""
|
|
95
|
+
},
|
|
96
|
+
size: {
|
|
97
|
+
// Heights mirror Button (sm 32 / md 40 / lg 48). `sm` (32px) and
|
|
98
|
+
// `md` (40px) both fall below `--min-target-size` (44 base / 48
|
|
99
|
+
// accessible), so each adds the ::before pseudo-element touch-
|
|
100
|
+
// target expansion to reach the minimum on mobile, collapsing
|
|
101
|
+
// above the `sm:` breakpoint. This component is the patient
|
|
102
|
+
// check-in (HTP-5104) mobile sign-in surface and `md` is the
|
|
103
|
+
// DEFAULT size rendered there, so it MUST meet WCAG 2.5.5 at both
|
|
104
|
+
// theme levels — unlike Button/WhatsApp, we do not leave md short.
|
|
105
|
+
// `lg` (48px) already meets the minimum natively.
|
|
106
|
+
sm: [
|
|
107
|
+
"ds:h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)] ds:[&_svg]:size-4",
|
|
108
|
+
"ds:min-h-[var(--min-target-size)] ds:sm:min-h-0",
|
|
109
|
+
'ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:sm:before:hidden'
|
|
110
|
+
].join(" "),
|
|
111
|
+
md: [
|
|
112
|
+
"ds:h-10 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5",
|
|
113
|
+
"ds:min-h-[var(--min-target-size)] ds:sm:min-h-0",
|
|
114
|
+
'ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:sm:before:hidden'
|
|
115
|
+
].join(" "),
|
|
116
|
+
lg: "ds:h-12 ds:ps-5 ds:pe-5 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
compoundVariants: [
|
|
120
|
+
/* Apple — light: white surface, black logo + text. */
|
|
121
|
+
{
|
|
122
|
+
provider: "apple",
|
|
123
|
+
appearance: "light",
|
|
124
|
+
class: "ds:bg-[var(--brand-apple-light)] ds:text-[var(--brand-apple-light-foreground)] ds:border-[var(--brand-apple-light-border)] ds:hover:bg-[var(--brand-apple-light-hover)]"
|
|
125
|
+
},
|
|
126
|
+
/* Apple — dark: black surface, white logo + text. */
|
|
127
|
+
{
|
|
128
|
+
provider: "apple",
|
|
129
|
+
appearance: "dark",
|
|
130
|
+
class: "ds:bg-[var(--brand-apple-dark)] ds:text-[var(--brand-apple-dark-foreground)] ds:border-[var(--brand-apple-dark)] ds:hover:bg-[var(--brand-apple-dark-hover)]"
|
|
131
|
+
},
|
|
132
|
+
/* Google — light: white/neutral surface, grey text. */
|
|
133
|
+
{
|
|
134
|
+
provider: "google",
|
|
135
|
+
appearance: "light",
|
|
136
|
+
class: "ds:bg-[var(--brand-google-light)] ds:text-[var(--brand-google-light-foreground)] ds:border-[var(--brand-google-light-border)] ds:hover:bg-[var(--brand-google-light-hover)]"
|
|
137
|
+
},
|
|
138
|
+
/* Google — dark: Google-blue surface, white text. */
|
|
139
|
+
{
|
|
140
|
+
provider: "google",
|
|
141
|
+
appearance: "dark",
|
|
142
|
+
class: "ds:bg-[var(--brand-google-dark)] ds:text-[var(--brand-google-dark-foreground)] ds:border-[var(--brand-google-dark)] ds:hover:bg-[var(--brand-google-dark-hover)]"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
defaultVariants: {
|
|
146
|
+
appearance: "light",
|
|
147
|
+
size: "md"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
), _ = {
|
|
151
|
+
sm: "md",
|
|
152
|
+
md: "lg",
|
|
153
|
+
lg: "lg"
|
|
154
|
+
}, C = n(
|
|
155
|
+
"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
|
|
156
|
+
{
|
|
157
|
+
variants: {
|
|
158
|
+
size: {
|
|
159
|
+
sm: "ds:size-4",
|
|
160
|
+
md: "ds:size-5",
|
|
161
|
+
lg: "ds:size-6"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
defaultVariants: { size: "md" }
|
|
165
|
+
}
|
|
166
|
+
), E = n(
|
|
167
|
+
"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
|
|
168
|
+
{
|
|
169
|
+
variants: {
|
|
170
|
+
appearance: {
|
|
171
|
+
light: "",
|
|
172
|
+
dark: "ds:rounded-[var(--radius-sm)] ds:bg-[var(--brand-google-tile)]"
|
|
173
|
+
},
|
|
174
|
+
size: {
|
|
175
|
+
sm: "ds:[&_svg]:size-4",
|
|
176
|
+
md: "ds:[&_svg]:size-5",
|
|
177
|
+
lg: "ds:[&_svg]:size-6"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
compoundVariants: [
|
|
181
|
+
{ appearance: "dark", size: "sm", class: "ds:p-1" },
|
|
182
|
+
{ appearance: "dark", size: "md", class: "ds:p-1.5" },
|
|
183
|
+
{ appearance: "dark", size: "lg", class: "ds:p-2" }
|
|
184
|
+
],
|
|
185
|
+
defaultVariants: { appearance: "light", size: "md" }
|
|
186
|
+
}
|
|
187
|
+
), I = y(
|
|
188
|
+
({
|
|
189
|
+
provider: e,
|
|
190
|
+
appearance: r = "light",
|
|
191
|
+
size: d = "md",
|
|
192
|
+
loading: a = !1,
|
|
193
|
+
disabled: u,
|
|
194
|
+
label: b,
|
|
195
|
+
onLoadingCancelled: i,
|
|
196
|
+
type: f = "button",
|
|
197
|
+
className: h,
|
|
198
|
+
...z
|
|
199
|
+
}, k) => {
|
|
200
|
+
const { t } = j(), l = d ?? "md", w = b ?? t(`socialSignInButton.${e}`), c = p(a), o = p(i);
|
|
201
|
+
c.current = a, o.current = i, N(() => {
|
|
202
|
+
const g = (B) => {
|
|
203
|
+
B.persisted && c.current && o.current && o.current();
|
|
204
|
+
};
|
|
205
|
+
return window.addEventListener("pageshow", g), () => window.removeEventListener("pageshow", g);
|
|
206
|
+
}, []);
|
|
207
|
+
const x = [
|
|
208
|
+
M({ provider: e, appearance: r, size: d }),
|
|
209
|
+
h
|
|
210
|
+
].filter(Boolean).join(" "), S = e === "apple" ? /* @__PURE__ */ s(A, { className: "ds:shrink-0" }) : r === "dark" ? /* @__PURE__ */ s("span", { className: E({ appearance: r, size: d }), children: /* @__PURE__ */ s(v, {}) }) : /* @__PURE__ */ s(v, { className: "ds:shrink-0" });
|
|
211
|
+
return /* @__PURE__ */ m(
|
|
212
|
+
"button",
|
|
213
|
+
{
|
|
214
|
+
ref: k,
|
|
215
|
+
type: f,
|
|
216
|
+
disabled: u || a,
|
|
217
|
+
"aria-busy": a || void 0,
|
|
218
|
+
"data-component": "social-sign-in-button",
|
|
219
|
+
"data-provider": e,
|
|
220
|
+
"data-appearance": r,
|
|
221
|
+
className: x,
|
|
222
|
+
...z,
|
|
223
|
+
children: [
|
|
224
|
+
a ? /* @__PURE__ */ s("span", { className: C({ size: l }), children: /* @__PURE__ */ s(
|
|
225
|
+
V,
|
|
226
|
+
{
|
|
227
|
+
size: _[l],
|
|
228
|
+
variant: "pulse",
|
|
229
|
+
className: "ds:size-full",
|
|
230
|
+
label: t("socialSignInButton.loading")
|
|
231
|
+
}
|
|
232
|
+
) }) : S,
|
|
233
|
+
/* @__PURE__ */ s("span", { children: w })
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
I.displayName = "SocialSignInButton";
|
|
240
|
+
export {
|
|
241
|
+
I as S
|
|
242
|
+
};
|
|
243
|
+
//# sourceMappingURL=social-sign-in-button-X54ySJr1.js.map
|