@alfadocs/ui-kit-debug 1.104.0 → 1.105.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/{ai-credits-exhausted-notice-CwZnSACy.js → ai-credits-exhausted-notice-Lws3113e.js} +2 -2
- package/dist/_chunks/{ai-credits-exhausted-notice-CwZnSACy.js.map → ai-credits-exhausted-notice-Lws3113e.js.map} +1 -1
- package/dist/_chunks/{ai-permission-notice-VNh3W57L.js → ai-permission-notice-BkgcGmu8.js} +2 -2
- package/dist/_chunks/{ai-permission-notice-VNh3W57L.js.map → ai-permission-notice-BkgcGmu8.js.map} +1 -1
- package/dist/_chunks/{alert-9kEwDza3.js → alert-C4WKViaS.js} +59 -50
- package/dist/_chunks/alert-C4WKViaS.js.map +1 -0
- package/dist/_chunks/{anamnesis-summary-rows-B9HqOGd7.js → anamnesis-summary-rows-QhbDdY7b.js} +4 -4
- package/dist/_chunks/{anamnesis-summary-rows-B9HqOGd7.js.map → anamnesis-summary-rows-QhbDdY7b.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-BOm2FgEu.js → audio-recorder-BlDozxdU.js} +2 -2
- package/dist/_chunks/{audio-recorder-BOm2FgEu.js.map → audio-recorder-BlDozxdU.js.map} +1 -1
- package/dist/_chunks/{auth-form-parts-B3GWChvG.js → auth-form-parts-DVHfqnp6.js} +2 -2
- package/dist/_chunks/{auth-form-parts-B3GWChvG.js.map → auth-form-parts-DVHfqnp6.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-DGFm2jfP.js → balance-badge-cell-wJ6cTD_h.js} +3 -3
- package/dist/_chunks/{balance-badge-cell-DGFm2jfP.js.map → balance-badge-cell-wJ6cTD_h.js.map} +1 -1
- package/dist/_chunks/{calendar-appointment-editor-dialog-DqyATSh3.js → calendar-appointment-editor-dialog-D8DblVjW.js} +8 -8
- package/dist/_chunks/{calendar-appointment-editor-dialog-DqyATSh3.js.map → calendar-appointment-editor-dialog-D8DblVjW.js.map} +1 -1
- package/dist/_chunks/{care-plan-card-YWKV8Kjq.js → care-plan-card-DMjlYlFc.js} +2 -2
- package/dist/_chunks/{care-plan-card-YWKV8Kjq.js.map → care-plan-card-DMjlYlFc.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-CApivtMW.js → care-plan-entry-card-3hguBW45.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-CApivtMW.js.map → care-plan-entry-card-3hguBW45.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-uExd3pKC.js → contact-profile-card-CAL66GaH.js} +120 -111
- package/dist/_chunks/contact-profile-card-CAL66GaH.js.map +1 -0
- package/dist/_chunks/{data-table-C5uN4ato.js → data-table-zXBxFYpJ.js} +761 -715
- package/dist/_chunks/data-table-zXBxFYpJ.js.map +1 -0
- package/dist/_chunks/{date-range-picker-B_j4VQlV.js → date-range-picker-DCADIR8o.js} +2 -2
- package/dist/_chunks/{date-range-picker-B_j4VQlV.js.map → date-range-picker-DCADIR8o.js.map} +1 -1
- package/dist/_chunks/{date-time-picker-cwsWiB4q.js → date-time-picker-CT2bC7-A.js} +2 -2
- package/dist/_chunks/{date-time-picker-cwsWiB4q.js.map → date-time-picker-CT2bC7-A.js.map} +1 -1
- package/dist/_chunks/{document-preview-U8H6tnDJ.js → document-preview-BalyZqnn.js} +2 -2
- package/dist/_chunks/{document-preview-U8H6tnDJ.js.map → document-preview-BalyZqnn.js.map} +1 -1
- package/dist/_chunks/{document-scanner-Bf3VUp00.js → document-scanner-5p-Uu8dy.js} +2 -2
- package/dist/_chunks/{document-scanner-Bf3VUp00.js.map → document-scanner-5p-Uu8dy.js.map} +1 -1
- package/dist/_chunks/{entity-summary-BKfR4Vws.js → entity-summary-BbqqYqF1.js} +2 -2
- package/dist/_chunks/{entity-summary-BKfR4Vws.js.map → entity-summary-BbqqYqF1.js.map} +1 -1
- package/dist/_chunks/{error-summary-mGxIyDAY.js → error-summary-DxNhwf_G.js} +2 -2
- package/dist/_chunks/{error-summary-mGxIyDAY.js.map → error-summary-DxNhwf_G.js.map} +1 -1
- package/dist/_chunks/{face-scheme-DdVLQ5dP.js → face-scheme-e2M2HJGz.js} +2 -2
- package/dist/_chunks/{face-scheme-DdVLQ5dP.js.map → face-scheme-e2M2HJGz.js.map} +1 -1
- package/dist/_chunks/{file-manager-CnGBVX_q.js → file-manager-BDKe59sg.js} +2 -2
- package/dist/_chunks/{file-manager-CnGBVX_q.js.map → file-manager-BDKe59sg.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-CeTb5p-x.js → forgot-password-form-vfCO2-Tt.js} +4 -4
- package/dist/_chunks/{forgot-password-form-CeTb5p-x.js.map → forgot-password-form-vfCO2-Tt.js.map} +1 -1
- package/dist/_chunks/{freemium-paywall-CM0zQSDE.js → freemium-paywall-BDeq9QWR.js} +2 -2
- package/dist/_chunks/{freemium-paywall-CM0zQSDE.js.map → freemium-paywall-BDeq9QWR.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-CXcDKQqC.js → gestational-age-calculator-AnaH00nk.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CXcDKQqC.js.map → gestational-age-calculator-AnaH00nk.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-BJFR3onB.js → hcg-doubling-DdyUt4gz.js} +2 -2
- package/dist/_chunks/{hcg-doubling-BJFR3onB.js.map → hcg-doubling-DdyUt4gz.js.map} +1 -1
- package/dist/_chunks/{heatmap-Cz0Krieg.js → heatmap-D4qqpCEj.js} +1550 -1547
- package/dist/_chunks/{heatmap-Cz0Krieg.js.map → heatmap-D4qqpCEj.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-ra5a__Yy.js → help-me-write-templates-YmceSxf5.js} +3 -3
- package/dist/_chunks/{help-me-write-templates-ra5a__Yy.js.map → help-me-write-templates-YmceSxf5.js.map} +1 -1
- package/dist/_chunks/info-tip-C-MPkShR.js +266 -0
- package/dist/_chunks/info-tip-C-MPkShR.js.map +1 -0
- package/dist/_chunks/{kit-extensions-C4o_tFN4.js → kit-extensions-BOnTM4Yf.js} +3 -3
- package/dist/_chunks/{kit-extensions-C4o_tFN4.js.map → kit-extensions-BOnTM4Yf.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-BRek9kz7.js → link-cell-renderer-C8vfCOEp.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-BRek9kz7.js.map → link-cell-renderer-C8vfCOEp.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-D5BV5j1i.js → login-dev-card-Cz1Clugq.js} +3 -3
- package/dist/_chunks/{login-dev-card-D5BV5j1i.js.map → login-dev-card-Cz1Clugq.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-BsctSegT.js → marketplace-app-shell-C-4QF6mp.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-BsctSegT.js.map → marketplace-app-shell-C-4QF6mp.js.map} +1 -1
- package/dist/_chunks/{notes-panel-BjTpaz8d.js → notes-panel-SlzUL8in.js} +4 -4
- package/dist/_chunks/{notes-panel-BjTpaz8d.js.map → notes-panel-SlzUL8in.js.map} +1 -1
- package/dist/_chunks/{notice-group-DkYzKyAZ.js → notice-group-B-trhof8.js} +3 -3
- package/dist/_chunks/{notice-group-DkYzKyAZ.js.map → notice-group-B-trhof8.js.map} +1 -1
- package/dist/_chunks/{patient-details-BXM3dRKb.js → patient-details-wMgTFtpp.js} +2 -2
- package/dist/_chunks/{patient-details-BXM3dRKb.js.map → patient-details-wMgTFtpp.js.map} +1 -1
- package/dist/_chunks/{patient-field-row--dCDO5oB.js → patient-field-row-Bhm2Ig1P.js} +2 -2
- package/dist/_chunks/{patient-field-row--dCDO5oB.js.map → patient-field-row-Bhm2Ig1P.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-DB7fv-Tr.js → patient-summary-card-DMdPPG3n.js} +2 -2
- package/dist/_chunks/{patient-summary-card-DB7fv-Tr.js.map → patient-summary-card-DMdPPG3n.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-BPF0c-5D.js → payment-automation-upsell-u5EuFyCY.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-BPF0c-5D.js.map → payment-automation-upsell-u5EuFyCY.js.map} +1 -1
- package/dist/_chunks/{payment-form-PBuh8PIa.js → payment-form-C-s1x-bU.js} +2 -2
- package/dist/_chunks/{payment-form-PBuh8PIa.js.map → payment-form-C-s1x-bU.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-DlceXkfW.js → pdf-viewer-BnBKdx0y.js} +2 -2
- package/dist/_chunks/{pdf-viewer-DlceXkfW.js.map → pdf-viewer-BnBKdx0y.js.map} +1 -1
- package/dist/_chunks/{practice-profile-hero-BAvGdQmt.js → practice-profile-hero-Bb4YyxHA.js} +31 -29
- package/dist/_chunks/practice-profile-hero-Bb4YyxHA.js.map +1 -0
- package/dist/_chunks/{practice-results-ChBP9x2r.js → practice-results-BXz01sti.js} +485 -445
- package/dist/_chunks/practice-results-BXz01sti.js.map +1 -0
- package/dist/_chunks/{pregnancy-dating-D0Kf9s7s.js → pregnancy-dating-D6dLkMpl.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-D0Kf9s7s.js.map → pregnancy-dating-D6dLkMpl.js.map} +1 -1
- package/dist/_chunks/{progress-notice-DiHWZ8Ms.js → progress-notice-F7ao70ZP.js} +2 -2
- package/dist/_chunks/{progress-notice-DiHWZ8Ms.js.map → progress-notice-F7ao70ZP.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-BQ95uFCd.js → radiograph-panel.agent-0ngF2sGS.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-BQ95uFCd.js.map → radiograph-panel.agent-0ngF2sGS.js.map} +1 -1
- package/dist/_chunks/{registration-form-JzzTomhd.js → registration-form-CEJRUS9G.js} +3 -3
- package/dist/_chunks/{registration-form-JzzTomhd.js.map → registration-form-CEJRUS9G.js.map} +1 -1
- package/dist/_chunks/{reserved.agent-BxD0gnbt.js → reserved.agent-C-C9cvO5.js} +2 -2
- package/dist/_chunks/{reserved.agent-BxD0gnbt.js.map → reserved.agent-C-C9cvO5.js.map} +1 -1
- package/dist/_chunks/{reset-password-form-DDdGEoIL.js → reset-password-form-B0acanDD.js} +4 -4
- package/dist/_chunks/{reset-password-form-DDdGEoIL.js.map → reset-password-form-B0acanDD.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-F04przIt.js → rich-text-editor-C3nANKZt.js} +2 -2
- package/dist/_chunks/{rich-text-editor-F04przIt.js.map → rich-text-editor-C3nANKZt.js.map} +1 -1
- package/dist/_chunks/{send-registration-link-form-DHCQpA4C.js → send-registration-link-form-Nn0jf65G.js} +3 -3
- package/dist/_chunks/{send-registration-link-form-DHCQpA4C.js.map → send-registration-link-form-Nn0jf65G.js.map} +1 -1
- package/dist/_chunks/{sign-document-B5qZhthO.js → sign-document-CQZVzfpk.js} +2 -2
- package/dist/_chunks/{sign-document-B5qZhthO.js.map → sign-document-CQZVzfpk.js.map} +1 -1
- package/dist/_chunks/{signature-request-DB6kePIm.js → signature-request-DtLph5Z4.js} +3 -3
- package/dist/_chunks/{signature-request-DB6kePIm.js.map → signature-request-DtLph5Z4.js.map} +1 -1
- package/dist/_chunks/{switch-D--x7n6h.js → switch-DO6uC4HJ.js} +40 -36
- package/dist/_chunks/switch-DO6uC4HJ.js.map +1 -0
- package/dist/_chunks/{task-editor-BiPGFXtB.js → task-editor-CmXcj6cC.js} +4 -4
- package/dist/_chunks/{task-editor-BiPGFXtB.js.map → task-editor-CmXcj6cC.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-iVeuu9a8.js → tasks-panel-CFo5uIHx.js} +3 -3
- package/dist/_chunks/{tasks-panel-iVeuu9a8.js.map → tasks-panel-CFo5uIHx.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-jZRbAidE.js → theme-toggle-Czq3K9jB.js} +2 -2
- package/dist/_chunks/{theme-toggle-jZRbAidE.js.map → theme-toggle-Czq3K9jB.js.map} +1 -1
- package/dist/_chunks/{time-picker-DSt-ns5F.js → time-picker-DDr5vhwQ.js} +344 -332
- package/dist/_chunks/time-picker-DDr5vhwQ.js.map +1 -0
- package/dist/_chunks/{tooth-scheme-Bd7xECuj.js → tooth-scheme-C-ALCHaV.js} +2 -2
- package/dist/_chunks/{tooth-scheme-Bd7xECuj.js.map → tooth-scheme-C-ALCHaV.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-CmqGGYCy.js → use-appointment-details-read-VI26Z-pc.js} +3 -3
- package/dist/_chunks/{use-appointment-details-read-CmqGGYCy.js.map → use-appointment-details-read-VI26Z-pc.js.map} +1 -1
- package/dist/_chunks/{voice-control-panel-BGJjUwnY.js → voice-control-panel-B0TUZAiP.js} +3 -3
- package/dist/_chunks/{voice-control-panel-BGJjUwnY.js.map → voice-control-panel-B0TUZAiP.js.map} +1 -1
- package/dist/_chunks/{warning-stack-3S7e2q07.js → warning-stack-Dx7cpj10.js} +2 -2
- package/dist/_chunks/{warning-stack-3S7e2q07.js.map → warning-stack-Dx7cpj10.js.map} +1 -1
- package/dist/_chunks/week-availability-CsTiwtYj.js +318 -0
- package/dist/_chunks/week-availability-CsTiwtYj.js.map +1 -0
- package/dist/_chunks/weekly-hours-editor-BsVsgeOc.js +252 -0
- package/dist/_chunks/weekly-hours-editor-BsVsgeOc.js.map +1 -0
- package/dist/_chunks/{workflow-map-B1jf6QaB.js → workflow-map-DWk-rZse.js} +2 -2
- package/dist/_chunks/{workflow-map-B1jf6QaB.js.map → workflow-map-DWk-rZse.js.map} +1 -1
- package/dist/_chunks/{workflow-webhook-action-B_52rH7O.js → workflow-webhook-action-DILFqAVd.js} +2 -2
- package/dist/_chunks/{workflow-webhook-action-B_52rH7O.js.map → workflow-webhook-action-DILFqAVd.js.map} +1 -1
- package/dist/ag-grid.css +5 -1
- package/dist/agent-catalog.json +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/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +8 -0
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/data-table/data-table.d.ts +6 -0
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/header-min-width.d.ts +21 -0
- package/dist/components/data-table/header-min-width.d.ts.map +1 -0
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/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/entity-summary/index.js +1 -1
- package/dist/components/error-summary/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/heatmap/heatmap.d.ts +5 -0
- package/dist/components/heatmap/heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/info-tip/index.js +1 -1
- package/dist/components/info-tip/info-tip.d.ts +10 -0
- package/dist/components/info-tip/info-tip.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notice-group/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/practice-profile-hero/index.js +1 -1
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +7 -0
- 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 +13 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/progress-notice/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/switch.d.ts +2 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/task-editor/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/time-picker/index.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/tooth-scheme/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/week-availability/index.d.ts +3 -0
- package/dist/components/week-availability/index.d.ts.map +1 -0
- package/dist/components/week-availability/index.js +10 -0
- package/dist/components/week-availability/index.js.map +1 -0
- package/dist/components/week-availability/week-availability.d.ts +68 -0
- package/dist/components/week-availability/week-availability.d.ts.map +1 -0
- package/dist/components/weekly-hours-editor/index.d.ts +3 -0
- package/dist/components/weekly-hours-editor/index.d.ts.map +1 -0
- package/dist/components/weekly-hours-editor/index.js +9 -0
- package/dist/components/weekly-hours-editor/index.js.map +1 -0
- package/dist/components/weekly-hours-editor/weekly-hours-editor.d.ts +42 -0
- package/dist/components/weekly-hours-editor/weekly-hours-editor.d.ts.map +1 -0
- package/dist/components/workflow/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/i18n/locales/ar.d.ts +34 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +34 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +34 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +34 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +34 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +34 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +34 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +34 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +34 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +34 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +34 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +34 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +34 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +34 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +34 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +34 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +34 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +34 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +34 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +34 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +34 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +34 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +34 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +34 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +34 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +34 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +34 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +34 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +34 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +34 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +34 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +34 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +34 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +34 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +34 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +34 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +879 -866
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +34 -0
- package/dist/locales/de.json +34 -0
- package/dist/locales/el.json +34 -0
- package/dist/locales/en.json +34 -0
- package/dist/locales/es.json +34 -0
- package/dist/locales/fr.json +34 -0
- package/dist/locales/hi.json +34 -0
- package/dist/locales/it.json +34 -0
- package/dist/locales/ja.json +34 -0
- package/dist/locales/nl.json +34 -0
- package/dist/locales/pl.json +34 -0
- package/dist/locales/pt.json +34 -0
- package/dist/locales/ro.json +34 -0
- package/dist/locales/ru.json +34 -0
- package/dist/locales/sq.json +34 -0
- package/dist/locales/sv.json +34 -0
- package/dist/locales/tr.json +34 -0
- package/dist/locales/zh.json +34 -0
- 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/reset-password-form/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/workflow-webhook-action/index.js +1 -1
- package/dist/tokens.css +3 -1
- package/package.json +9 -1
- package/dist/_chunks/alert-9kEwDza3.js.map +0 -1
- package/dist/_chunks/contact-profile-card-uExd3pKC.js.map +0 -1
- package/dist/_chunks/data-table-C5uN4ato.js.map +0 -1
- package/dist/_chunks/info-tip-1Xsq9GLi.js +0 -230
- package/dist/_chunks/info-tip-1Xsq9GLi.js.map +0 -1
- package/dist/_chunks/practice-profile-hero-BAvGdQmt.js.map +0 -1
- package/dist/_chunks/practice-results-ChBP9x2r.js.map +0 -1
- package/dist/_chunks/switch-D--x7n6h.js.map +0 -1
- package/dist/_chunks/time-picker-DSt-ns5F.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { forwardRef as dn, useId as P, useState as y, useEffect as f, useMemo as
|
|
|
3
3
|
import { c as cn } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as ln } from "react-i18next";
|
|
5
5
|
import { u as un } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
6
|
-
import { A as C } from "./alert-
|
|
6
|
+
import { A as C } from "./alert-C4WKViaS.js";
|
|
7
7
|
import { B as fn } from "./button-DohK_Ak_.js";
|
|
8
8
|
import { I as mn } from "./icon-button-S8_weU3g.js";
|
|
9
9
|
import { X as gn } from "./x-B5YnXwCz.js";
|
|
@@ -270,4 +270,4 @@ Nn.displayName = "WarningStack";
|
|
|
270
270
|
export {
|
|
271
271
|
Nn as W
|
|
272
272
|
};
|
|
273
|
-
//# sourceMappingURL=warning-stack-
|
|
273
|
+
//# sourceMappingURL=warning-stack-Dx7cpj10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warning-stack-3S7e2q07.js","sources":["../../src/components/warning-stack/warning-stack.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type MutableRefObject,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown, X } from 'lucide-react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { Alert, type AlertProps } from '../alert/alert';\nimport { Button } from '../button/button';\nimport { IconButton } from '../button/icon-button';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface WarningStackItem {\n id: string;\n variant?: AlertProps['variant'];\n title: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n actions?: ReactNode;\n dismissible?: boolean;\n}\n\n/** Empty-collapse fold phases (no-`emptyState` path only). See the fold\n * state machine in the component body. */\ntype FoldPhase = 'open' | 'settling' | 'closing' | 'closed';\n\nconst stackVariants = cva(\n [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-lg)]',\n 'ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]',\n '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:p-[var(--spacing-md)]',\n ].join(' '),\n {\n variants: {\n // `stretch: true` fills the parent layout cell — mirrors the `stretch`\n // prop on `Card` so a WarningStack rendered next to a Card in a grid\n // row ends up at matching height.\n stretch: {\n true: 'ds:h-full ds:self-stretch',\n false: '',\n },\n },\n defaultVariants: {\n stretch: false,\n },\n },\n);\n\n// Single column by default; two columns once the stack itself is wide\n// enough (container query — viewport width lies when the stack sits in\n// a narrow grid cell). A trailing odd item spans both columns so the\n// grid never ends on a half-width hole, which also keeps a lone item\n// full-width exactly as before.\n// 768px, not the `@3xl` rem alias: container-query `rem` resolves against the\n// host's root font-size, so a non-16px root silently moves the threshold.\nconst LIST_CLASSES = [\n 'ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)]',\n 'ds:@[768px]/warning-stack:grid-cols-2',\n 'ds:@[768px]/warning-stack:[&>li:nth-child(odd):last-child]:col-span-full',\n].join(' ');\n\nconst TOGGLE_CLASSES = [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:self-start',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Empty-collapse animation */\n/* */\n/* When the stack empties (every notice dismissed) and no `emptyState` */\n/* is supplied, the whole region folds away instead of leaving a hole. */\n/* The grid `1fr → 0fr` track is the only CSS-only way to animate to/ */\n/* from `height: auto`; JS-measured `max-height` is barred by the */\n/* no-inline-styles constraint. The outer wrapper owns the height */\n/* track; the inner wrapper owns the cross-fade + overflow clip. */\n/* ------------------------------------------------------------------ */\n\n/** Floor for how long the folding region stays mounted after it empties, so a\n * screen reader can voice the cleared count even when `--animation-duration`\n * is 0ms (accessible themes). The region is already visually collapsed, so\n * this window is imperceptible. */\nconst MIN_FOLD_UNMOUNT_MS = 250;\n\n/** Reads `--animation-duration` (ms) so the unmount timer matches the\n * CSS transition. Falls back to 200ms when it can't be resolved. */\nfunction readAnimationDurationMs(): number {\n if (typeof window === 'undefined') return 200;\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('--animation-duration');\n const trimmed = raw.trim();\n const n = parseFloat(trimmed);\n if (!Number.isFinite(n)) return 200;\n return trimmed.endsWith('ms') ? n : n * 1000;\n}\n\n/** Outer height-collapse track. Always a grid so the `grid-template-rows`\n * transition has a stable from/to; only the row size flips. */\nfunction collapseTrackClass(collapsed: boolean, stretch: boolean): string {\n return [\n 'ds:grid ds:transition-[grid-template-rows]',\n 'ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n collapsed ? 'ds:grid-rows-[0fr]' : 'ds:grid-rows-[1fr]',\n stretch ? 'ds:h-full ds:self-stretch' : '',\n ]\n .filter(Boolean)\n .join(' ');\n}\n\n/** Inner cross-fade layer. `min-h-0` lets the grid item shrink below its\n * content; `overflow-hidden` (only while animating) clips the fold so the\n * card's resting drop-shadow isn't clipped at rest. */\nfunction collapseInnerClass(collapsed: boolean, closing: boolean): string {\n return [\n 'ds:min-h-0',\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n collapsed ? 'ds:opacity-0 ds:overflow-hidden' : 'ds:opacity-100',\n closing ? 'ds:pointer-events-none' : '',\n ]\n .filter(Boolean)\n .join(' ');\n}\n\nexport interface WarningStackProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role' | 'title'>,\n VariantProps<typeof stackVariants> {\n /** Items rendered inside the stack. */\n items: WarningStackItem[];\n /** Fill the parent layout cell — use in a dashboard grid row so the\n * stack ends up with matching height to sibling Cards. */\n stretch?: boolean;\n /** Visible title rendered as an `<h2>` above the stack. Also labels the\n * region for assistive tech. When omitted, the region is labelled via a\n * visually hidden heading using `ariaLabel` (or the default \"Warnings\"). */\n title?: ReactNode;\n /** Optional short description rendered under the title. */\n description?: ReactNode;\n /** Cap on visible items before a \"Show N more\" toggle appears. Defaults to\n * `2`; pass a larger number (or `Infinity`) to show more before collapsing. */\n maxVisible?: number;\n /** Whether the stack starts collapsed when items exceed `maxVisible`. */\n defaultCollapsed?: boolean;\n /** Fires when a dismissible item's close control is activated. */\n onDismiss?: (item: WarningStackItem) => void;\n /** Whether the whole-stack close control is shown at the header's inline-end.\n * Defaults to `true` — the tray is closable. Set `false` for stacks that\n * carry notices which must not be bulk-cleared (e.g. hard compliance blocks). */\n closable?: boolean;\n /** Fires when the whole-stack close control is activated, after every\n * currently-visible notice has been dismissed (folding the region away).\n * Optional — the fold happens internally regardless; supply this only to\n * mirror the bulk dismissal into the consumer's own store. */\n onDismissAll?: () => void;\n /** Accessible label for the whole-stack close control. Defaults to the\n * localised \"Dismiss all notices\". */\n dismissAllLabel?: string;\n /** Accessible label for the region when `title` is not set. */\n ariaLabel?: string;\n /** Optional node rendered when the stack has zero items. */\n emptyState?: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const WarningStack = forwardRef<HTMLDivElement, WarningStackProps>(\n (\n {\n items,\n title,\n description,\n maxVisible = 2,\n defaultCollapsed = true,\n onDismiss,\n closable = true,\n onDismissAll,\n dismissAllLabel,\n stretch = false,\n ariaLabel,\n emptyState,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const labelId = useId();\n const listId = useId();\n\n // Track dismissed ids internally so the <li> unmounts even when the\n // consumer doesn't mirror dismissal into `items` — otherwise the list\n // keeps a ghost entry (and the two-column grid a blank cell). Pruned\n // when an id leaves `items`, so a re-pushed item renders again.\n const [dismissedIds, setDismissedIds] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n useEffect(() => {\n setDismissedIds((prev) => {\n if (prev.size === 0) return prev;\n const ids = new Set(items.map((item) => item.id));\n const next = new Set([...prev].filter((id) => ids.has(id)));\n return next.size === prev.size ? prev : next;\n });\n }, [items]);\n\n const liveItems = useMemo(\n () => items.filter((item) => !dismissedIds.has(item.id)),\n [items, dismissedIds],\n );\n\n const overflow = maxVisible !== undefined && liveItems.length > maxVisible;\n const [collapsed, setCollapsed] = useState(defaultCollapsed);\n\n // Live-region announces the count when items change.\n const liveRef = useRef<HTMLDivElement>(null);\n const lastCountRef = useRef<number>(liveItems.length);\n\n useEffect(() => {\n if (!liveRef.current) return;\n const prev = lastCountRef.current;\n const next = liveItems.length;\n if (prev !== next) {\n liveRef.current.textContent = t('warningStack.countChanged', {\n count: next,\n defaultValue: '{{count}} warnings to review',\n });\n }\n lastCountRef.current = next;\n }, [liveItems.length, t]);\n\n const visible = useMemo(() => {\n if (!overflow || !collapsed) return liveItems;\n return liveItems.slice(0, maxVisible);\n }, [liveItems, overflow, collapsed, maxVisible]);\n\n const hiddenCount = overflow ? liveItems.length - (maxVisible ?? 0) : 0;\n\n /* ----- Empty-collapse phase ------------------------------------- */\n const hasItems = liveItems.length > 0;\n const hasEmptyState = emptyState != null;\n // There is something to show whenever a live notice remains, or an\n // empty state has been supplied to fill the region in its place.\n const present = hasItems || hasEmptyState;\n\n // Only the no-`emptyState` path animates the fold. It runs in two beats\n // so the height transition has a stable start: a CSS transition can't\n // interpolate when the element's content changes in the same commit as\n // the track flip, so `settling` first re-renders the emptied region at\n // full height (track still open), then `closing` flips the track to 0fr\n // on the next frame — now the browser animates from a real height.\n // open → settling → closing → closed (unmounted, until a notice lands)\n const [phase, setPhase] = useState<FoldPhase>(present ? 'open' : 'closed');\n // Drives the expand-in when a notice lands after the region had folded.\n const [entering, setEntering] = useState(false);\n\n useIsomorphicLayoutEffect(() => {\n if (present) {\n if (phase !== 'open') {\n // Replay the expand only when re-appearing from a collapsed state.\n if (phase === 'closing' || phase === 'closed') setEntering(true);\n setPhase('open');\n }\n } else if (phase === 'open') {\n setPhase('settling');\n }\n }, [present, phase]);\n\n // settling → closing: flip the track shut one frame after the emptied\n // region has painted at full height, so the collapse actually animates.\n useEffect(() => {\n if (phase !== 'settling') return;\n const raf = window.requestAnimationFrame(() => setPhase('closing'));\n return () => window.cancelAnimationFrame(raf);\n }, [phase]);\n\n // closing → closed: unmount once the collapse transition has run. The\n // delay is floored so the polite live region (which lives in this subtree)\n // survives long enough for assistive tech to voice the cleared count\n // before the node is removed — otherwise an accessible theme, where\n // `--animation-duration` is 0ms, would unmount in the same frame and\n // swallow the announcement. The region is already collapsed to zero\n // height by then, so the extra mounted time is invisible.\n useEffect(() => {\n if (phase !== 'closing') return;\n const delay = Math.max(readAnimationDurationMs(), MIN_FOLD_UNMOUNT_MS);\n const id = window.setTimeout(() => setPhase('closed'), delay);\n return () => window.clearTimeout(id);\n }, [phase]);\n\n // Expand-in: clear the collapsed start-state on the next frame so the\n // grid track animates open instead of snapping to full height.\n useEffect(() => {\n if (!entering) return;\n const raf = window.requestAnimationFrame(() => setEntering(false));\n return () => window.cancelAnimationFrame(raf);\n }, [entering]);\n\n const closing = phase === 'closing';\n const animCollapsed = closing || entering;\n const mounted = present || phase === 'settling' || phase === 'closing';\n\n // Focus hand-off: dismissing unmounts the focused close button, which\n // would otherwise drop focus to <body> (WCAG 2.4.3). Aim for the\n // dismiss control now occupying the same list position (the next\n // item), else the last remaining one, else the region itself.\n const sectionRef = useRef<HTMLElement | null>(null);\n const setSectionRef = useCallback(\n (node: HTMLElement | null) => {\n sectionRef.current = node;\n if (typeof ref === 'function') {\n ref(node as HTMLDivElement | null);\n } else if (ref) {\n (ref as MutableRefObject<HTMLDivElement | null>).current =\n node as HTMLDivElement | null;\n }\n },\n [ref],\n );\n const pendingFocusIndexRef = useRef<number | null>(null);\n // No dependency array on purpose: this runs after every render but is\n // gated by `pendingFocusIndexRef`, which is only non-null on the render\n // that immediately follows a dismissal. Don't \"fix\" it to `[liveItems]`.\n useEffect(() => {\n if (pendingFocusIndexRef.current === null) return;\n const index = pendingFocusIndexRef.current;\n pendingFocusIndexRef.current = null;\n const section = sectionRef.current;\n if (!section) return;\n const dismissControls = Array.from(\n section.querySelectorAll<HTMLButtonElement>('[data-alert-dismiss]'),\n );\n const target =\n dismissControls[Math.min(index, dismissControls.length - 1)];\n if (target) target.focus();\n // Last notice gone: only land focus on the region if it survives the\n // dismissal (an emptyState keeps it mounted). When the stack folds\n // away entirely there is no stable target here — the consumer owns\n // re-homing focus (see the dashboard pattern) and the live region\n // announces the cleared count.\n else if (hasEmptyState) section.focus();\n });\n\n const handleDismiss = useCallback(\n (item: WarningStackItem, index: number) => (open: boolean) => {\n if (open) return;\n pendingFocusIndexRef.current = index;\n setDismissedIds((prev) => new Set(prev).add(item.id));\n onDismiss?.(item);\n },\n [onDismiss],\n );\n\n // Whole-stack close: dismiss every currently-visible notice in one go,\n // which empties `liveItems` and folds the region away. Focus re-homing on\n // the fold is the consumer's responsibility (same as the last-item case) —\n // there's no surviving in-component target once the header unmounts.\n const handleDismissAll = useCallback(() => {\n setDismissedIds((prev) => {\n const next = new Set(prev);\n for (const item of liveItems) next.add(item.id);\n return next;\n });\n onDismissAll?.();\n }, [liveItems, onDismissAll]);\n\n const toggle = useCallback(() => setCollapsed((c) => !c), []);\n\n const regionLabel = ariaLabel ?? t('warningStack.regionLabel', 'Warnings');\n\n // Title block: a visible header when `title` is provided; otherwise a\n // visually hidden heading so the region still has a programmatic name.\n // A `<div>` rather than `<header>` wrapper keeps the `<header>` element's\n // implicit banner role from leaking out of the region. The whole-stack\n // close control (when enabled) sits at the inline-end of this row.\n const titleBlock = title ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h2\n id={labelId}\n className=\"ds:text-start type-title-section ds:text-[var(--foreground)]\"\n >\n {title}\n </h2>\n {description ? (\n <p className=\"ds:text-start type-body-sm ds:text-[var(--muted-foreground)]\">\n {description}\n </p>\n ) : null}\n </div>\n ) : (\n <h2 id={labelId} className=\"ds:sr-only\">\n {regionLabel}\n </h2>\n );\n\n const showStackClose = closable && hasItems;\n const header = showStackClose ? (\n <div className=\"ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]\">\n {titleBlock}\n <IconButton\n type=\"button\"\n icon={<X aria-hidden=\"true\" />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={\n dismissAllLabel ??\n t('warningStack.dismissAll', 'Dismiss all notices')\n }\n onClick={handleDismissAll}\n // Pull flush to the card's inline-end padding edge, and never let\n // the button compress when the title wraps.\n className=\"ds:-me-[var(--spacing-2xs)] ds:shrink-0\"\n />\n </div>\n ) : (\n titleBlock\n );\n\n // Fully folded away (or cold-start empty with no emptyState): render\n // nothing. Matches the long-standing \"empty + no emptyState → null\"\n // contract, now reached via the fold-out animation rather than instantly.\n if (!mounted) return null;\n\n return (\n // Outer: height-collapse track. Carries the bounding marker so it is\n // the cascade-reset boundary even mid-fold.\n <div\n data-component=\"warning-stack\"\n className={collapseTrackClass(animCollapsed, stretch)}\n >\n {/* Inner: cross-fade + overflow clip while folding. */}\n <div className={collapseInnerClass(animCollapsed, closing)}>\n <section\n ref={setSectionRef}\n aria-labelledby={labelId}\n // Programmatically focusable so a surviving region can take the\n // last dismissal's focus (see the focus hand-off above).\n tabIndex={-1}\n className={[stackVariants({ stretch }), className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n {header}\n {/* The live region announces the count as it changes. Omitted in\n emptyState mode, where the empty state itself communicates. */}\n {!hasEmptyState ? (\n <div\n ref={liveRef}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n />\n ) : null}\n {hasItems ? (\n <>\n {/* Container-type lives on this wrapper (never on the flex\n section itself) so the list can query its own inline size. */}\n <div className=\"ds:@container/warning-stack\">\n <ul\n id={listId}\n className={LIST_CLASSES}\n // Neutral wording — the list mixes warnings with info\n // notices and promo offers.\n aria-label={t('warningStack.listLabel', 'Notices')}\n >\n {visible.map((item, index) => {\n const variant = item.variant ?? 'warning';\n return (\n // `data-warning-id` is the per-notice agent hook: it\n // makes one warning addressable in the DOM, and its\n // dismiss control is the nested `[data-alert-dismiss]`.\n <li key={item.id} data-warning-id={item.id}>\n <Alert\n variant={variant}\n dismissible={item.dismissible}\n icon={item.icon}\n onOpenChange={handleDismiss(item, index)}\n // Compact: clamp title/description so a notice stays\n // a predictable height — keeps the tray tight and\n // side-by-side cards even.\n clamp\n // Fill the row so side-by-side alerts equalise height.\n className=\"ds:h-full\"\n >\n {/* `as=\"h3\"` keeps a clean heading ladder — the\n stack's h2 labels the region, then each item's\n h3 rises from it. */}\n <Alert.Title as=\"h3\">{item.title}</Alert.Title>\n {item.description ? (\n <Alert.Description>\n {item.description}\n </Alert.Description>\n ) : null}\n {item.actions ? (\n <Alert.Action>{item.actions}</Alert.Action>\n ) : null}\n </Alert>\n </li>\n );\n })}\n </ul>\n </div>\n\n {overflow ? (\n <Button\n type=\"button\"\n intent=\"link\"\n size=\"sm\"\n aria-expanded={!collapsed}\n aria-controls={listId}\n onClick={toggle}\n className={TOGGLE_CLASSES}\n >\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n 'ds:size-4 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n collapsed ? '' : 'ds:rotate-180',\n ].join(' ')}\n />\n {collapsed\n ? t('warningStack.showMore', {\n count: hiddenCount,\n defaultValue: 'Show {{count}} more warnings',\n })\n : t('warningStack.showLess', 'Show less')}\n </Button>\n ) : null}\n </>\n ) : (\n emptyState\n )}\n </section>\n </div>\n </div>\n );\n },\n);\n\nWarningStack.displayName = 'WarningStack';\n"],"names":["stackVariants","cva","LIST_CLASSES","TOGGLE_CLASSES","MIN_FOLD_UNMOUNT_MS","readAnimationDurationMs","trimmed","n","collapseTrackClass","collapsed","stretch","collapseInnerClass","closing","WarningStack","forwardRef","items","title","description","maxVisible","defaultCollapsed","onDismiss","closable","onDismissAll","dismissAllLabel","ariaLabel","emptyState","className","rest","ref","t","useTranslation","labelId","useId","listId","dismissedIds","setDismissedIds","useState","useEffect","prev","ids","item","next","id","liveItems","useMemo","overflow","setCollapsed","liveRef","useRef","lastCountRef","visible","hiddenCount","hasItems","hasEmptyState","present","phase","setPhase","entering","setEntering","useIsomorphicLayoutEffect","raf","delay","animCollapsed","mounted","sectionRef","setSectionRef","useCallback","node","pendingFocusIndexRef","index","section","dismissControls","target","handleDismiss","open","handleDismissAll","toggle","c","regionLabel","titleBlock","jsxs","jsx","header","IconButton","X","Fragment","variant","Alert","Button","ChevronDown"],"mappings":";;;;;;;;;;AAsCA,MAAMA,KAAgBC;AAAA,EACpB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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,oBAACQ;AAAA,oBAAA;AAAA,sBACC,MAAK;AAAA,sBACL,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,iBAAe,CAAC/E;AAAA,sBAChB,iBAAewB;AAAA,sBACf,SAAS2C;AAAA,sBACT,WAAWzE;AAAA,sBAEX,UAAA;AAAA,wBAAA,gBAAA8E;AAAA,0BAACQ;AAAA,0BAAA;AAAA,4BACC,eAAY;AAAA,4BACZ,WAAW;AAAA,8BACT;AAAA,8BACAhF,IAAY,KAAK;AAAA,4BAAA,EACjB,KAAK,GAAG;AAAA,0BAAA;AAAA,wBAAA;AAAA,wBAEXA,IACGoB,EAAE,yBAAyB;AAAA,0BACzB,OAAOsB;AAAA,0BACP,cAAc;AAAA,wBAAA,CACf,IACDtB,EAAE,yBAAyB,WAAW;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAAA,IAE1C;AAAA,gBAAA,EAAA,CACN,IAEAJ;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,EAEJ,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,QAjHiB;AAAA,EAoHvB;AACF;AAEAZ,GAAa,cAAc;"}
|
|
1
|
+
{"version":3,"file":"warning-stack-Dx7cpj10.js","sources":["../../src/components/warning-stack/warning-stack.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type MutableRefObject,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown, X } from 'lucide-react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { Alert, type AlertProps } from '../alert/alert';\nimport { Button } from '../button/button';\nimport { IconButton } from '../button/icon-button';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface WarningStackItem {\n id: string;\n variant?: AlertProps['variant'];\n title: ReactNode;\n description?: ReactNode;\n icon?: ReactNode;\n actions?: ReactNode;\n dismissible?: boolean;\n}\n\n/** Empty-collapse fold phases (no-`emptyState` path only). See the fold\n * state machine in the component body. */\ntype FoldPhase = 'open' | 'settling' | 'closing' | 'closed';\n\nconst stackVariants = cva(\n [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-lg)]',\n 'ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]',\n '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:p-[var(--spacing-md)]',\n ].join(' '),\n {\n variants: {\n // `stretch: true` fills the parent layout cell — mirrors the `stretch`\n // prop on `Card` so a WarningStack rendered next to a Card in a grid\n // row ends up at matching height.\n stretch: {\n true: 'ds:h-full ds:self-stretch',\n false: '',\n },\n },\n defaultVariants: {\n stretch: false,\n },\n },\n);\n\n// Single column by default; two columns once the stack itself is wide\n// enough (container query — viewport width lies when the stack sits in\n// a narrow grid cell). A trailing odd item spans both columns so the\n// grid never ends on a half-width hole, which also keeps a lone item\n// full-width exactly as before.\n// 768px, not the `@3xl` rem alias: container-query `rem` resolves against the\n// host's root font-size, so a non-16px root silently moves the threshold.\nconst LIST_CLASSES = [\n 'ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)]',\n 'ds:@[768px]/warning-stack:grid-cols-2',\n 'ds:@[768px]/warning-stack:[&>li:nth-child(odd):last-child]:col-span-full',\n].join(' ');\n\nconst TOGGLE_CLASSES = [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:self-start',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Empty-collapse animation */\n/* */\n/* When the stack empties (every notice dismissed) and no `emptyState` */\n/* is supplied, the whole region folds away instead of leaving a hole. */\n/* The grid `1fr → 0fr` track is the only CSS-only way to animate to/ */\n/* from `height: auto`; JS-measured `max-height` is barred by the */\n/* no-inline-styles constraint. The outer wrapper owns the height */\n/* track; the inner wrapper owns the cross-fade + overflow clip. */\n/* ------------------------------------------------------------------ */\n\n/** Floor for how long the folding region stays mounted after it empties, so a\n * screen reader can voice the cleared count even when `--animation-duration`\n * is 0ms (accessible themes). The region is already visually collapsed, so\n * this window is imperceptible. */\nconst MIN_FOLD_UNMOUNT_MS = 250;\n\n/** Reads `--animation-duration` (ms) so the unmount timer matches the\n * CSS transition. Falls back to 200ms when it can't be resolved. */\nfunction readAnimationDurationMs(): number {\n if (typeof window === 'undefined') return 200;\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('--animation-duration');\n const trimmed = raw.trim();\n const n = parseFloat(trimmed);\n if (!Number.isFinite(n)) return 200;\n return trimmed.endsWith('ms') ? n : n * 1000;\n}\n\n/** Outer height-collapse track. Always a grid so the `grid-template-rows`\n * transition has a stable from/to; only the row size flips. */\nfunction collapseTrackClass(collapsed: boolean, stretch: boolean): string {\n return [\n 'ds:grid ds:transition-[grid-template-rows]',\n 'ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n collapsed ? 'ds:grid-rows-[0fr]' : 'ds:grid-rows-[1fr]',\n stretch ? 'ds:h-full ds:self-stretch' : '',\n ]\n .filter(Boolean)\n .join(' ');\n}\n\n/** Inner cross-fade layer. `min-h-0` lets the grid item shrink below its\n * content; `overflow-hidden` (only while animating) clips the fold so the\n * card's resting drop-shadow isn't clipped at rest. */\nfunction collapseInnerClass(collapsed: boolean, closing: boolean): string {\n return [\n 'ds:min-h-0',\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n collapsed ? 'ds:opacity-0 ds:overflow-hidden' : 'ds:opacity-100',\n closing ? 'ds:pointer-events-none' : '',\n ]\n .filter(Boolean)\n .join(' ');\n}\n\nexport interface WarningStackProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role' | 'title'>,\n VariantProps<typeof stackVariants> {\n /** Items rendered inside the stack. */\n items: WarningStackItem[];\n /** Fill the parent layout cell — use in a dashboard grid row so the\n * stack ends up with matching height to sibling Cards. */\n stretch?: boolean;\n /** Visible title rendered as an `<h2>` above the stack. Also labels the\n * region for assistive tech. When omitted, the region is labelled via a\n * visually hidden heading using `ariaLabel` (or the default \"Warnings\"). */\n title?: ReactNode;\n /** Optional short description rendered under the title. */\n description?: ReactNode;\n /** Cap on visible items before a \"Show N more\" toggle appears. Defaults to\n * `2`; pass a larger number (or `Infinity`) to show more before collapsing. */\n maxVisible?: number;\n /** Whether the stack starts collapsed when items exceed `maxVisible`. */\n defaultCollapsed?: boolean;\n /** Fires when a dismissible item's close control is activated. */\n onDismiss?: (item: WarningStackItem) => void;\n /** Whether the whole-stack close control is shown at the header's inline-end.\n * Defaults to `true` — the tray is closable. Set `false` for stacks that\n * carry notices which must not be bulk-cleared (e.g. hard compliance blocks). */\n closable?: boolean;\n /** Fires when the whole-stack close control is activated, after every\n * currently-visible notice has been dismissed (folding the region away).\n * Optional — the fold happens internally regardless; supply this only to\n * mirror the bulk dismissal into the consumer's own store. */\n onDismissAll?: () => void;\n /** Accessible label for the whole-stack close control. Defaults to the\n * localised \"Dismiss all notices\". */\n dismissAllLabel?: string;\n /** Accessible label for the region when `title` is not set. */\n ariaLabel?: string;\n /** Optional node rendered when the stack has zero items. */\n emptyState?: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const WarningStack = forwardRef<HTMLDivElement, WarningStackProps>(\n (\n {\n items,\n title,\n description,\n maxVisible = 2,\n defaultCollapsed = true,\n onDismiss,\n closable = true,\n onDismissAll,\n dismissAllLabel,\n stretch = false,\n ariaLabel,\n emptyState,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const labelId = useId();\n const listId = useId();\n\n // Track dismissed ids internally so the <li> unmounts even when the\n // consumer doesn't mirror dismissal into `items` — otherwise the list\n // keeps a ghost entry (and the two-column grid a blank cell). Pruned\n // when an id leaves `items`, so a re-pushed item renders again.\n const [dismissedIds, setDismissedIds] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n useEffect(() => {\n setDismissedIds((prev) => {\n if (prev.size === 0) return prev;\n const ids = new Set(items.map((item) => item.id));\n const next = new Set([...prev].filter((id) => ids.has(id)));\n return next.size === prev.size ? prev : next;\n });\n }, [items]);\n\n const liveItems = useMemo(\n () => items.filter((item) => !dismissedIds.has(item.id)),\n [items, dismissedIds],\n );\n\n const overflow = maxVisible !== undefined && liveItems.length > maxVisible;\n const [collapsed, setCollapsed] = useState(defaultCollapsed);\n\n // Live-region announces the count when items change.\n const liveRef = useRef<HTMLDivElement>(null);\n const lastCountRef = useRef<number>(liveItems.length);\n\n useEffect(() => {\n if (!liveRef.current) return;\n const prev = lastCountRef.current;\n const next = liveItems.length;\n if (prev !== next) {\n liveRef.current.textContent = t('warningStack.countChanged', {\n count: next,\n defaultValue: '{{count}} warnings to review',\n });\n }\n lastCountRef.current = next;\n }, [liveItems.length, t]);\n\n const visible = useMemo(() => {\n if (!overflow || !collapsed) return liveItems;\n return liveItems.slice(0, maxVisible);\n }, [liveItems, overflow, collapsed, maxVisible]);\n\n const hiddenCount = overflow ? liveItems.length - (maxVisible ?? 0) : 0;\n\n /* ----- Empty-collapse phase ------------------------------------- */\n const hasItems = liveItems.length > 0;\n const hasEmptyState = emptyState != null;\n // There is something to show whenever a live notice remains, or an\n // empty state has been supplied to fill the region in its place.\n const present = hasItems || hasEmptyState;\n\n // Only the no-`emptyState` path animates the fold. It runs in two beats\n // so the height transition has a stable start: a CSS transition can't\n // interpolate when the element's content changes in the same commit as\n // the track flip, so `settling` first re-renders the emptied region at\n // full height (track still open), then `closing` flips the track to 0fr\n // on the next frame — now the browser animates from a real height.\n // open → settling → closing → closed (unmounted, until a notice lands)\n const [phase, setPhase] = useState<FoldPhase>(present ? 'open' : 'closed');\n // Drives the expand-in when a notice lands after the region had folded.\n const [entering, setEntering] = useState(false);\n\n useIsomorphicLayoutEffect(() => {\n if (present) {\n if (phase !== 'open') {\n // Replay the expand only when re-appearing from a collapsed state.\n if (phase === 'closing' || phase === 'closed') setEntering(true);\n setPhase('open');\n }\n } else if (phase === 'open') {\n setPhase('settling');\n }\n }, [present, phase]);\n\n // settling → closing: flip the track shut one frame after the emptied\n // region has painted at full height, so the collapse actually animates.\n useEffect(() => {\n if (phase !== 'settling') return;\n const raf = window.requestAnimationFrame(() => setPhase('closing'));\n return () => window.cancelAnimationFrame(raf);\n }, [phase]);\n\n // closing → closed: unmount once the collapse transition has run. The\n // delay is floored so the polite live region (which lives in this subtree)\n // survives long enough for assistive tech to voice the cleared count\n // before the node is removed — otherwise an accessible theme, where\n // `--animation-duration` is 0ms, would unmount in the same frame and\n // swallow the announcement. The region is already collapsed to zero\n // height by then, so the extra mounted time is invisible.\n useEffect(() => {\n if (phase !== 'closing') return;\n const delay = Math.max(readAnimationDurationMs(), MIN_FOLD_UNMOUNT_MS);\n const id = window.setTimeout(() => setPhase('closed'), delay);\n return () => window.clearTimeout(id);\n }, [phase]);\n\n // Expand-in: clear the collapsed start-state on the next frame so the\n // grid track animates open instead of snapping to full height.\n useEffect(() => {\n if (!entering) return;\n const raf = window.requestAnimationFrame(() => setEntering(false));\n return () => window.cancelAnimationFrame(raf);\n }, [entering]);\n\n const closing = phase === 'closing';\n const animCollapsed = closing || entering;\n const mounted = present || phase === 'settling' || phase === 'closing';\n\n // Focus hand-off: dismissing unmounts the focused close button, which\n // would otherwise drop focus to <body> (WCAG 2.4.3). Aim for the\n // dismiss control now occupying the same list position (the next\n // item), else the last remaining one, else the region itself.\n const sectionRef = useRef<HTMLElement | null>(null);\n const setSectionRef = useCallback(\n (node: HTMLElement | null) => {\n sectionRef.current = node;\n if (typeof ref === 'function') {\n ref(node as HTMLDivElement | null);\n } else if (ref) {\n (ref as MutableRefObject<HTMLDivElement | null>).current =\n node as HTMLDivElement | null;\n }\n },\n [ref],\n );\n const pendingFocusIndexRef = useRef<number | null>(null);\n // No dependency array on purpose: this runs after every render but is\n // gated by `pendingFocusIndexRef`, which is only non-null on the render\n // that immediately follows a dismissal. Don't \"fix\" it to `[liveItems]`.\n useEffect(() => {\n if (pendingFocusIndexRef.current === null) return;\n const index = pendingFocusIndexRef.current;\n pendingFocusIndexRef.current = null;\n const section = sectionRef.current;\n if (!section) return;\n const dismissControls = Array.from(\n section.querySelectorAll<HTMLButtonElement>('[data-alert-dismiss]'),\n );\n const target =\n dismissControls[Math.min(index, dismissControls.length - 1)];\n if (target) target.focus();\n // Last notice gone: only land focus on the region if it survives the\n // dismissal (an emptyState keeps it mounted). When the stack folds\n // away entirely there is no stable target here — the consumer owns\n // re-homing focus (see the dashboard pattern) and the live region\n // announces the cleared count.\n else if (hasEmptyState) section.focus();\n });\n\n const handleDismiss = useCallback(\n (item: WarningStackItem, index: number) => (open: boolean) => {\n if (open) return;\n pendingFocusIndexRef.current = index;\n setDismissedIds((prev) => new Set(prev).add(item.id));\n onDismiss?.(item);\n },\n [onDismiss],\n );\n\n // Whole-stack close: dismiss every currently-visible notice in one go,\n // which empties `liveItems` and folds the region away. Focus re-homing on\n // the fold is the consumer's responsibility (same as the last-item case) —\n // there's no surviving in-component target once the header unmounts.\n const handleDismissAll = useCallback(() => {\n setDismissedIds((prev) => {\n const next = new Set(prev);\n for (const item of liveItems) next.add(item.id);\n return next;\n });\n onDismissAll?.();\n }, [liveItems, onDismissAll]);\n\n const toggle = useCallback(() => setCollapsed((c) => !c), []);\n\n const regionLabel = ariaLabel ?? t('warningStack.regionLabel', 'Warnings');\n\n // Title block: a visible header when `title` is provided; otherwise a\n // visually hidden heading so the region still has a programmatic name.\n // A `<div>` rather than `<header>` wrapper keeps the `<header>` element's\n // implicit banner role from leaking out of the region. The whole-stack\n // close control (when enabled) sits at the inline-end of this row.\n const titleBlock = title ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <h2\n id={labelId}\n className=\"ds:text-start type-title-section ds:text-[var(--foreground)]\"\n >\n {title}\n </h2>\n {description ? (\n <p className=\"ds:text-start type-body-sm ds:text-[var(--muted-foreground)]\">\n {description}\n </p>\n ) : null}\n </div>\n ) : (\n <h2 id={labelId} className=\"ds:sr-only\">\n {regionLabel}\n </h2>\n );\n\n const showStackClose = closable && hasItems;\n const header = showStackClose ? (\n <div className=\"ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]\">\n {titleBlock}\n <IconButton\n type=\"button\"\n icon={<X aria-hidden=\"true\" />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={\n dismissAllLabel ??\n t('warningStack.dismissAll', 'Dismiss all notices')\n }\n onClick={handleDismissAll}\n // Pull flush to the card's inline-end padding edge, and never let\n // the button compress when the title wraps.\n className=\"ds:-me-[var(--spacing-2xs)] ds:shrink-0\"\n />\n </div>\n ) : (\n titleBlock\n );\n\n // Fully folded away (or cold-start empty with no emptyState): render\n // nothing. Matches the long-standing \"empty + no emptyState → null\"\n // contract, now reached via the fold-out animation rather than instantly.\n if (!mounted) return null;\n\n return (\n // Outer: height-collapse track. Carries the bounding marker so it is\n // the cascade-reset boundary even mid-fold.\n <div\n data-component=\"warning-stack\"\n className={collapseTrackClass(animCollapsed, stretch)}\n >\n {/* Inner: cross-fade + overflow clip while folding. */}\n <div className={collapseInnerClass(animCollapsed, closing)}>\n <section\n ref={setSectionRef}\n aria-labelledby={labelId}\n // Programmatically focusable so a surviving region can take the\n // last dismissal's focus (see the focus hand-off above).\n tabIndex={-1}\n className={[stackVariants({ stretch }), className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n {header}\n {/* The live region announces the count as it changes. Omitted in\n emptyState mode, where the empty state itself communicates. */}\n {!hasEmptyState ? (\n <div\n ref={liveRef}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n />\n ) : null}\n {hasItems ? (\n <>\n {/* Container-type lives on this wrapper (never on the flex\n section itself) so the list can query its own inline size. */}\n <div className=\"ds:@container/warning-stack\">\n <ul\n id={listId}\n className={LIST_CLASSES}\n // Neutral wording — the list mixes warnings with info\n // notices and promo offers.\n aria-label={t('warningStack.listLabel', 'Notices')}\n >\n {visible.map((item, index) => {\n const variant = item.variant ?? 'warning';\n return (\n // `data-warning-id` is the per-notice agent hook: it\n // makes one warning addressable in the DOM, and its\n // dismiss control is the nested `[data-alert-dismiss]`.\n <li key={item.id} data-warning-id={item.id}>\n <Alert\n variant={variant}\n dismissible={item.dismissible}\n icon={item.icon}\n onOpenChange={handleDismiss(item, index)}\n // Compact: clamp title/description so a notice stays\n // a predictable height — keeps the tray tight and\n // side-by-side cards even.\n clamp\n // Fill the row so side-by-side alerts equalise height.\n className=\"ds:h-full\"\n >\n {/* `as=\"h3\"` keeps a clean heading ladder — the\n stack's h2 labels the region, then each item's\n h3 rises from it. */}\n <Alert.Title as=\"h3\">{item.title}</Alert.Title>\n {item.description ? (\n <Alert.Description>\n {item.description}\n </Alert.Description>\n ) : null}\n {item.actions ? (\n <Alert.Action>{item.actions}</Alert.Action>\n ) : null}\n </Alert>\n </li>\n );\n })}\n </ul>\n </div>\n\n {overflow ? (\n <Button\n type=\"button\"\n intent=\"link\"\n size=\"sm\"\n aria-expanded={!collapsed}\n aria-controls={listId}\n onClick={toggle}\n className={TOGGLE_CLASSES}\n >\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n 'ds:size-4 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n collapsed ? '' : 'ds:rotate-180',\n ].join(' ')}\n />\n {collapsed\n ? t('warningStack.showMore', {\n count: hiddenCount,\n defaultValue: 'Show {{count}} more warnings',\n })\n : t('warningStack.showLess', 'Show less')}\n </Button>\n ) : null}\n </>\n ) : (\n emptyState\n )}\n </section>\n </div>\n </div>\n );\n },\n);\n\nWarningStack.displayName = 'WarningStack';\n"],"names":["stackVariants","cva","LIST_CLASSES","TOGGLE_CLASSES","MIN_FOLD_UNMOUNT_MS","readAnimationDurationMs","trimmed","n","collapseTrackClass","collapsed","stretch","collapseInnerClass","closing","WarningStack","forwardRef","items","title","description","maxVisible","defaultCollapsed","onDismiss","closable","onDismissAll","dismissAllLabel","ariaLabel","emptyState","className","rest","ref","t","useTranslation","labelId","useId","listId","dismissedIds","setDismissedIds","useState","useEffect","prev","ids","item","next","id","liveItems","useMemo","overflow","setCollapsed","liveRef","useRef","lastCountRef","visible","hiddenCount","hasItems","hasEmptyState","present","phase","setPhase","entering","setEntering","useIsomorphicLayoutEffect","raf","delay","animCollapsed","mounted","sectionRef","setSectionRef","useCallback","node","pendingFocusIndexRef","index","section","dismissControls","target","handleDismiss","open","handleDismissAll","toggle","c","regionLabel","titleBlock","jsxs","jsx","header","IconButton","X","Fragment","variant","Alert","Button","ChevronDown"],"mappings":";;;;;;;;;;AAsCA,MAAMA,KAAgBC;AAAA,EACpB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA,MAIR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GASMC,KAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG,GAEJC,KAAiB;AAAA,EACrB;AACF,EAAE,KAAK,GAAG,GAiBJC,KAAsB;AAI5B,SAASC,KAAkC;AACzC,MAAI,OAAO,SAAW,IAAa,QAAO;AAI1C,QAAMC,IAHM,OACT,iBAAiB,SAAS,eAAe,EACzC,iBAAiB,sBAAsB,EACtB,KAAA,GACdC,IAAI,WAAWD,CAAO;AAC5B,SAAK,OAAO,SAASC,CAAC,IACfD,EAAQ,SAAS,IAAI,IAAIC,IAAIA,IAAI,MADR;AAElC;AAIA,SAASC,GAAmBC,GAAoBC,GAA0B;AACxE,SAAO;AAAA,IACL;AAAA,IACA;AA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EAZ,GAAa,cAAc;"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as sa, useMemo as u } from "react";
|
|
3
|
+
import { c as i } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ea } from "react-i18next";
|
|
5
|
+
import { f as ta } from "./intl-locale-FWh-Y5_3.js";
|
|
6
|
+
import { i as na } from "./is-development-CLUAnsU7.js";
|
|
7
|
+
import { E as ra } from "./empty-state-DwJ5YNzz.js";
|
|
8
|
+
const $ = 6, S = [1, 2, 3, 4, 5, 6, 7], y = (r, n, e) => Math.min(e, Math.max(n, r));
|
|
9
|
+
function I(r) {
|
|
10
|
+
const n = (r ?? []).filter((a) => Number.isFinite(a.from) && Number.isFinite(a.to)).map((a) => ({ from: y(a.from, 0, 1440), to: y(a.to, 0, 1440) })).filter((a) => a.to > a.from).sort((a, o) => a.from - o.from), e = [];
|
|
11
|
+
for (const a of n) {
|
|
12
|
+
const o = e[e.length - 1];
|
|
13
|
+
o && a.from <= o.to ? o.to = Math.max(o.to, a.to) : e.push({ ...a });
|
|
14
|
+
}
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
function oa(r) {
|
|
18
|
+
if (r.length === 0) return [8, 20];
|
|
19
|
+
let n = Math.floor(Math.min(...r.map((a) => a.from)) / 60), e = Math.ceil(Math.max(...r.map((a) => a.to)) / 60);
|
|
20
|
+
return e - n < 4 && (e = Math.min(24, n + 4), n = Math.max(0, e - 4)), [n, e];
|
|
21
|
+
}
|
|
22
|
+
function ia(r, n) {
|
|
23
|
+
const e = n[0] * 60, a = n[1] * 60, o = y(r.from, e, a), v = y(r.to, e, a);
|
|
24
|
+
return v <= o || a <= e ? null : {
|
|
25
|
+
start: (o - e) / (a - e) * 100,
|
|
26
|
+
size: (v - o) / (a - e) * 100
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function la(r, n, e) {
|
|
30
|
+
const a = [
|
|
31
|
+
...S.slice(n - 1),
|
|
32
|
+
...S.slice(0, n - 1)
|
|
33
|
+
];
|
|
34
|
+
return e ? a.filter(
|
|
35
|
+
(o) => r.some(
|
|
36
|
+
(v) => v.days.some((N) => N.weekday === o && I(N.spans).length)
|
|
37
|
+
)
|
|
38
|
+
) : a;
|
|
39
|
+
}
|
|
40
|
+
const K = [
|
|
41
|
+
"ds:bg-[var(--category-1)]",
|
|
42
|
+
"ds:bg-[var(--category-2)]",
|
|
43
|
+
"ds:bg-[var(--category-3)]",
|
|
44
|
+
"ds:bg-[var(--category-4)]",
|
|
45
|
+
"ds:bg-[var(--category-5)]",
|
|
46
|
+
"ds:bg-[var(--category-6)]"
|
|
47
|
+
], E = "ds:bg-[var(--muted-foreground)]", da = i(
|
|
48
|
+
"ds:@container ds:flex ds:w-full ds:min-w-0 ds:max-w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-[color:var(--foreground)]"
|
|
49
|
+
), ca = i(
|
|
50
|
+
"ds:m-0 ds:flex ds:list-none ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:p-0 type-meta ds:text-[color:var(--muted-foreground)]"
|
|
51
|
+
), ma = i(
|
|
52
|
+
"ds:inline-block ds:size-[var(--spacing-sm)] ds:shrink-0 ds:rounded-[var(--radius-sm)] ds:forced-colors:[forced-color-adjust:none]"
|
|
53
|
+
), pa = i(
|
|
54
|
+
[
|
|
55
|
+
"ds:grid ds:items-center ds:gap-x-[var(--spacing-xs)] ds:gap-y-[var(--spacing-xs)] ds:@[640px]:gap-x-[var(--spacing-sm)]",
|
|
56
|
+
"ds:grid-cols-[repeat(var(--wa-days),minmax(0,1fr))]",
|
|
57
|
+
"ds:@[640px]:grid-cols-[calc(var(--spacing-xl)*4)_repeat(var(--wa-days),minmax(0,1fr))_auto]"
|
|
58
|
+
].join(" ")
|
|
59
|
+
), fa = i(
|
|
60
|
+
[
|
|
61
|
+
"ds:grid ds:gap-x-[var(--spacing-xs)] ds:@[640px]:gap-x-[var(--spacing-sm)]",
|
|
62
|
+
"ds:grid-cols-[repeat(var(--wa-days),minmax(0,1fr))]",
|
|
63
|
+
"ds:@[640px]:grid-cols-[calc(var(--spacing-xl)*4)_repeat(var(--wa-days),minmax(0,1fr))_auto]"
|
|
64
|
+
].join(" ")
|
|
65
|
+
), ua = i(
|
|
66
|
+
"ds:col-span-full ds:min-w-0 ds:text-start ds:font-semibold ds:break-words ds:@[640px]:col-span-1"
|
|
67
|
+
), ga = i(
|
|
68
|
+
"ds:col-span-full ds:flex ds:justify-end ds:gap-[var(--spacing-xs)] ds:@[640px]:col-span-1"
|
|
69
|
+
), va = i(
|
|
70
|
+
[
|
|
71
|
+
"ds:inline-flex ds:min-h-[var(--min-target-size)] ds:max-w-full ds:items-center ds:rounded-[var(--radius-sm)] ds:bg-transparent ds:p-0 ds:text-start ds:font-semibold ds:text-[color:var(--foreground)] ds:underline-offset-2 ds:hover:underline",
|
|
72
|
+
"ds:focus-visible:outline-2 ds:focus-visible:outline-offset-2 ds:focus-visible:outline-[var(--focus-ring)]",
|
|
73
|
+
"ds:forced-colors:focus-visible:outline-[Highlight]"
|
|
74
|
+
].join(" ")
|
|
75
|
+
), ha = i(
|
|
76
|
+
"ds:relative ds:block ds:h-[var(--spacing-md)] ds:w-full ds:overflow-hidden ds:rounded-[var(--radius-sm)] ds:bg-[var(--muted)]"
|
|
77
|
+
), ya = i(
|
|
78
|
+
"ds:absolute ds:inset-y-0 ds:start-[var(--wa-start)] ds:w-[var(--wa-size)] ds:min-w-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:forced-colors:[forced-color-adjust:none]"
|
|
79
|
+
), xa = i(
|
|
80
|
+
"ds:hidden ds:justify-between ds:font-normal ds:text-[color:var(--muted-foreground)] ds:tabular-nums ds:@[640px]:flex"
|
|
81
|
+
), ba = i(
|
|
82
|
+
"ds:m-0 type-meta ds:text-[color:var(--muted-foreground)] ds:@[640px]:hidden"
|
|
83
|
+
);
|
|
84
|
+
function w(r, n) {
|
|
85
|
+
return r.format(new Date(Date.UTC(2024, 0, 1, 0, n)));
|
|
86
|
+
}
|
|
87
|
+
const wa = sa(function({
|
|
88
|
+
rows: n,
|
|
89
|
+
tones: e = [],
|
|
90
|
+
hourRange: a,
|
|
91
|
+
hideEmptyDays: o = !1,
|
|
92
|
+
weekStartsOn: v = 1,
|
|
93
|
+
legend: N = !0,
|
|
94
|
+
onRowSelect: C,
|
|
95
|
+
locale: O,
|
|
96
|
+
className: P,
|
|
97
|
+
..._
|
|
98
|
+
}, Y) {
|
|
99
|
+
const { t: m, i18n: F } = ea("ui"), c = ta(
|
|
100
|
+
O ?? F.resolvedLanguage ?? F.language
|
|
101
|
+
), k = u(
|
|
102
|
+
() => new Intl.DateTimeFormat(c, {
|
|
103
|
+
hour: "numeric",
|
|
104
|
+
minute: "2-digit",
|
|
105
|
+
timeZone: "UTC"
|
|
106
|
+
}),
|
|
107
|
+
[c]
|
|
108
|
+
), G = u(
|
|
109
|
+
() => new Intl.DateTimeFormat(c, { hour: "numeric", timeZone: "UTC" }),
|
|
110
|
+
[c]
|
|
111
|
+
), X = u(
|
|
112
|
+
() => new Intl.DateTimeFormat(c, { weekday: "short", timeZone: "UTC" }),
|
|
113
|
+
[c]
|
|
114
|
+
), L = u(
|
|
115
|
+
() => new Intl.DateTimeFormat(c, { weekday: "long", timeZone: "UTC" }),
|
|
116
|
+
[c]
|
|
117
|
+
), q = u(
|
|
118
|
+
() => new Intl.ListFormat(c, { type: "unit", style: "short" }),
|
|
119
|
+
[c]
|
|
120
|
+
), A = u(() => {
|
|
121
|
+
const s = n.map((p) => {
|
|
122
|
+
const d = /* @__PURE__ */ new Map();
|
|
123
|
+
for (const g of p.days) d.set(g.weekday, g);
|
|
124
|
+
return { row: p, byDay: d };
|
|
125
|
+
}), l = s.flatMap(
|
|
126
|
+
({ row: p }) => p.days.flatMap((d) => I(d.spans))
|
|
127
|
+
);
|
|
128
|
+
return { normalised: s, hasHours: l.length > 0, fit: oa(l) };
|
|
129
|
+
}, [n]), J = u(
|
|
130
|
+
() => new Map(e.map((s, l) => [s.id, l])),
|
|
131
|
+
[e]
|
|
132
|
+
);
|
|
133
|
+
na() && e.length > $ && console.warn(
|
|
134
|
+
`WeekAvailability: ${e.length} tones given; only the first ${$} get a colour.`
|
|
135
|
+
);
|
|
136
|
+
const [h, x] = u(() => {
|
|
137
|
+
const s = a ? [
|
|
138
|
+
y(Math.floor(a[0]), 0, 23),
|
|
139
|
+
y(Math.ceil(a[1]), 1, 24)
|
|
140
|
+
] : A.fit;
|
|
141
|
+
return s[1] > s[0] ? s : [s[0], s[0] + 1];
|
|
142
|
+
}, [a, A.fit]), T = la(n, v, o), D = (s) => w(G, s * 60), Q = (s) => m("weekAvailability.span", {
|
|
143
|
+
from: w(k, s.from),
|
|
144
|
+
to: w(k, s.to)
|
|
145
|
+
}), U = {
|
|
146
|
+
ref: Y,
|
|
147
|
+
"data-component": "week-availability",
|
|
148
|
+
className: [da(), P].filter(Boolean).join(" "),
|
|
149
|
+
..._
|
|
150
|
+
};
|
|
151
|
+
if (n.length === 0 || !A.hasHours || T.length === 0)
|
|
152
|
+
return /* @__PURE__ */ t("div", { ...U, children: /* @__PURE__ */ t(
|
|
153
|
+
ra,
|
|
154
|
+
{
|
|
155
|
+
variant: "no-results",
|
|
156
|
+
size: "sm",
|
|
157
|
+
title: m("weekAvailability.empty.title"),
|
|
158
|
+
description: m("weekAvailability.empty.description")
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
161
|
+
const W = { "--wa-days": T.length }, R = h + Math.round((x - h) / 2), aa = x - h >= 6;
|
|
162
|
+
return /* @__PURE__ */ f("div", { ...U, children: [
|
|
163
|
+
N && e.length > 0 ? /* @__PURE__ */ t(
|
|
164
|
+
"ul",
|
|
165
|
+
{
|
|
166
|
+
"aria-label": m("weekAvailability.legend"),
|
|
167
|
+
"data-week-availability-legend": "",
|
|
168
|
+
className: ca(),
|
|
169
|
+
children: e.map((s, l) => /* @__PURE__ */ f(
|
|
170
|
+
"li",
|
|
171
|
+
{
|
|
172
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ t(
|
|
175
|
+
"span",
|
|
176
|
+
{
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
"data-tone": s.id,
|
|
179
|
+
className: [ma(), K[l] ?? E].join(
|
|
180
|
+
" "
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
s.label
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
s.id
|
|
188
|
+
))
|
|
189
|
+
}
|
|
190
|
+
) : null,
|
|
191
|
+
/* @__PURE__ */ t("p", { className: ba(), children: m("weekAvailability.range", {
|
|
192
|
+
from: w(k, h * 60),
|
|
193
|
+
to: w(k, x * 60)
|
|
194
|
+
}) }),
|
|
195
|
+
/* @__PURE__ */ f(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
role: "table",
|
|
199
|
+
"aria-label": _["aria-label"],
|
|
200
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ t("div", { role: "rowgroup", children: /* @__PURE__ */ f("div", { role: "row", style: W, className: fa(), children: [
|
|
203
|
+
/* @__PURE__ */ t(
|
|
204
|
+
"span",
|
|
205
|
+
{
|
|
206
|
+
role: "columnheader",
|
|
207
|
+
className: "ds:sr-only ds:@[640px]:not-sr-only",
|
|
208
|
+
children: /* @__PURE__ */ t("span", { className: "ds:sr-only", children: m("weekAvailability.rows") })
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
T.map((s) => {
|
|
212
|
+
const l = new Date(Date.UTC(2024, 0, s));
|
|
213
|
+
return /* @__PURE__ */ f(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
role: "columnheader",
|
|
217
|
+
className: "ds:min-w-0 ds:text-center type-meta ds:font-semibold ds:text-[color:var(--foreground)]",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ t("span", { className: "ds:sr-only", children: L.format(l) }),
|
|
220
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: X.format(l) }),
|
|
221
|
+
/* @__PURE__ */ f("span", { "aria-hidden": "true", className: xa(), children: [
|
|
222
|
+
/* @__PURE__ */ t("span", { children: D(h) }),
|
|
223
|
+
aa ? /* @__PURE__ */ t("span", { children: D(R) }) : null,
|
|
224
|
+
/* @__PURE__ */ t("span", { children: D(x) })
|
|
225
|
+
] })
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
s
|
|
229
|
+
);
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: "ds:hidden ds:@[640px]:block" })
|
|
232
|
+
] }) }),
|
|
233
|
+
/* @__PURE__ */ t(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
role: "rowgroup",
|
|
237
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
238
|
+
children: A.normalised.map(({ row: s, byDay: l }) => /* @__PURE__ */ f(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
role: "row",
|
|
242
|
+
"data-row-id": s.id,
|
|
243
|
+
style: W,
|
|
244
|
+
className: pa(),
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ t("div", { role: "rowheader", className: ua(), children: C ? /* @__PURE__ */ t(
|
|
247
|
+
"button",
|
|
248
|
+
{
|
|
249
|
+
type: "button",
|
|
250
|
+
className: va(),
|
|
251
|
+
onClick: () => C(s.id),
|
|
252
|
+
children: s.label
|
|
253
|
+
}
|
|
254
|
+
) : s.label }),
|
|
255
|
+
T.map((p) => {
|
|
256
|
+
const d = l.get(p), g = I(d == null ? void 0 : d.spans), z = (d == null ? void 0 : d.tone) ?? s.tone, M = z ? J.get(z) : void 0, b = M === void 0 ? void 0 : e[M], V = L.format(new Date(Date.UTC(2024, 0, p))), B = q.format(g.map(Q)), H = g.length === 0 ? m("weekAvailability.cellClosed", { day: V }) : b ? m("weekAvailability.cell", {
|
|
257
|
+
day: V,
|
|
258
|
+
hours: B,
|
|
259
|
+
tone: b.label
|
|
260
|
+
}) : m("weekAvailability.cellNoTone", {
|
|
261
|
+
day: V,
|
|
262
|
+
hours: B
|
|
263
|
+
});
|
|
264
|
+
return /* @__PURE__ */ f(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
role: "cell",
|
|
268
|
+
"data-weekday": p,
|
|
269
|
+
"data-tone": g.length > 0 ? b == null ? void 0 : b.id : void 0,
|
|
270
|
+
title: H,
|
|
271
|
+
className: "ds:min-w-0",
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ t("span", { className: "ds:sr-only", children: H }),
|
|
274
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: ha(), children: g.map((Z) => {
|
|
275
|
+
const j = ia(Z, [h, x]);
|
|
276
|
+
return j ? /* @__PURE__ */ t(
|
|
277
|
+
"span",
|
|
278
|
+
{
|
|
279
|
+
"data-span": "",
|
|
280
|
+
className: [
|
|
281
|
+
ya(),
|
|
282
|
+
M !== void 0 ? K[M] ?? E : E
|
|
283
|
+
].join(" "),
|
|
284
|
+
style: {
|
|
285
|
+
"--wa-start": `${j.start}%`,
|
|
286
|
+
"--wa-size": `${j.size}%`
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
Z.from
|
|
290
|
+
) : null;
|
|
291
|
+
}) })
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
p
|
|
295
|
+
);
|
|
296
|
+
}),
|
|
297
|
+
s.actions ? /* @__PURE__ */ t("div", { role: "cell", className: ga(), children: s.actions }) : /* @__PURE__ */ t("span", { role: "cell", className: "ds:hidden ds:@[640px]:block" })
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
s.id
|
|
301
|
+
))
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] });
|
|
308
|
+
});
|
|
309
|
+
wa.displayName = "WeekAvailability";
|
|
310
|
+
export {
|
|
311
|
+
$ as W,
|
|
312
|
+
wa as a,
|
|
313
|
+
oa as f,
|
|
314
|
+
I as n,
|
|
315
|
+
ia as s,
|
|
316
|
+
la as v
|
|
317
|
+
};
|
|
318
|
+
//# sourceMappingURL=week-availability-CsTiwtYj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"week-availability-CsTiwtYj.js","sources":["../../src/components/week-availability/week-availability.tsx"],"sourcesContent":["import {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { formatLocale } from '../_shared/intl-locale';\nimport { isDevelopment } from '../_shared/is-development';\nimport { EmptyState } from '../empty-state';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\n/** ISO weekday: 1 Monday to 7 Sunday. */\nexport type WeekAvailabilityWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7;\n\n/** One open period, in minutes from midnight (9:00 is 540). */\nexport interface WeekAvailabilitySpan {\n from: number;\n to: number;\n}\n\n/** A named group the consumer defines, for example where the hours came from. */\nexport interface WeekAvailabilityTone {\n id: string;\n label: string;\n}\n\nexport interface WeekAvailabilityDay {\n weekday: WeekAvailabilityWeekday;\n /** Open periods. None, or an empty list, means closed. */\n spans: readonly WeekAvailabilitySpan[];\n /** Overrides the row's `tone` for this day. */\n tone?: string;\n}\n\nexport interface WeekAvailabilityRow {\n id: string;\n /** Who or what the hours belong to: the studio, a chair, an operator. */\n label: string;\n /** A weekday that is missing from `days` is closed. */\n days: readonly WeekAvailabilityDay[];\n /** Tone id for every day that does not set its own. */\n tone?: string;\n /** Controls at the end of the row, for example a \"Correggi\" button. */\n actions?: ReactNode;\n}\n\nexport interface WeekAvailabilityProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n rows: readonly WeekAvailabilityRow[];\n /**\n * The tones the rows use. The first six take the categorical colours in\n * order, so a tone keeps its colour whatever the rows show. Any after the\n * sixth is painted neutral.\n */\n tones?: readonly WeekAvailabilityTone[];\n /** Hours shown on every strip, `[start, end]` from 0 to 24. Default: fit the data. */\n hourRange?: readonly [number, number];\n /** Leave out weekdays that have no hours in any row. Default false. */\n hideEmptyDays?: boolean;\n /** First weekday of the week, ISO. Default 1 (Monday). */\n weekStartsOn?: WeekAvailabilityWeekday;\n /** Show the built-in legend of tones. Default true. */\n legend?: boolean;\n /** Makes each row label a button that reports its id. */\n onRowSelect?: (rowId: string) => void;\n /** Overrides the active language for weekday names and times. */\n locale?: string;\n /** Accessible name for the table. */\n 'aria-label'?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Pure helpers */\n/* ------------------------------------------------------------------ */\n\nexport const WEEK_AVAILABILITY_MAX_TONES = 6;\nconst WEEKDAYS: readonly WeekAvailabilityWeekday[] = [1, 2, 3, 4, 5, 6, 7];\n\nconst clamp = (n: number, lo: number, hi: number) =>\n Math.min(hi, Math.max(lo, n));\n\n/** Spans that are valid, inside a day and in order, with overlaps merged. */\nexport function normaliseSpans(\n spans: readonly WeekAvailabilitySpan[] | undefined,\n): WeekAvailabilitySpan[] {\n const sorted = (spans ?? [])\n .filter((s) => Number.isFinite(s.from) && Number.isFinite(s.to))\n .map((s) => ({ from: clamp(s.from, 0, 1440), to: clamp(s.to, 0, 1440) }))\n .filter((s) => s.to > s.from)\n .sort((a, b) => a.from - b.from);\n const merged: WeekAvailabilitySpan[] = [];\n for (const s of sorted) {\n const last = merged[merged.length - 1];\n if (last && s.from <= last.to) last.to = Math.max(last.to, s.to);\n else merged.push({ ...s });\n }\n return merged;\n}\n\n/** Whole hours that cover every span, at least 4 apart, within 0 to 24. */\nexport function fitHourRange(\n spans: readonly WeekAvailabilitySpan[],\n): [number, number] {\n if (spans.length === 0) return [8, 20];\n let start = Math.floor(Math.min(...spans.map((s) => s.from)) / 60);\n let end = Math.ceil(Math.max(...spans.map((s) => s.to)) / 60);\n if (end - start < 4) {\n end = Math.min(24, start + 4);\n start = Math.max(0, end - 4);\n }\n return [start, end];\n}\n\n/** Where a span sits on a strip, as percentages of its width. */\nexport function spanPlacement(\n span: WeekAvailabilitySpan,\n range: readonly [number, number],\n): { start: number; size: number } | null {\n const lo = range[0] * 60;\n const hi = range[1] * 60;\n const from = clamp(span.from, lo, hi);\n const to = clamp(span.to, lo, hi);\n if (to <= from || hi <= lo) return null;\n return {\n start: ((from - lo) / (hi - lo)) * 100,\n size: ((to - from) / (hi - lo)) * 100,\n };\n}\n\n/** The weekdays to show, in week order. */\nexport function visibleWeekdays(\n rows: readonly WeekAvailabilityRow[],\n weekStartsOn: WeekAvailabilityWeekday,\n hideEmptyDays: boolean,\n): WeekAvailabilityWeekday[] {\n const ordered = [\n ...WEEKDAYS.slice(weekStartsOn - 1),\n ...WEEKDAYS.slice(0, weekStartsOn - 1),\n ];\n if (!hideEmptyDays) return ordered;\n return ordered.filter((wd) =>\n rows.some((r) =>\n r.days.some((d) => d.weekday === wd && normaliseSpans(d.spans).length),\n ),\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Static class tables (Tailwind needs literal class names) */\n/* ------------------------------------------------------------------ */\n\nconst TONE_BG = [\n 'ds:bg-[var(--category-1)]',\n 'ds:bg-[var(--category-2)]',\n 'ds:bg-[var(--category-3)]',\n 'ds:bg-[var(--category-4)]',\n 'ds:bg-[var(--category-5)]',\n 'ds:bg-[var(--category-6)]',\n] as const;\nconst TONE_NEUTRAL = 'ds:bg-[var(--muted-foreground)]';\n\nconst rootVariants = cva(\n 'ds:@container ds:flex ds:w-full ds:min-w-0 ds:max-w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-[color:var(--foreground)]',\n);\n\nconst legendVariants = cva(\n 'ds:m-0 ds:flex ds:list-none ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:p-0 type-meta ds:text-[color:var(--muted-foreground)]',\n);\n\nconst swatchVariants = cva(\n 'ds:inline-block ds:size-[var(--spacing-sm)] ds:shrink-0 ds:rounded-[var(--radius-sm)] ds:forced-colors:[forced-color-adjust:none]',\n);\n\n// Narrow (a side panel, a phone): the label and actions take a line above\n// the day cells. From 640px: label, days and actions share one line. Thresholds\n// are px because rem in a container query follows the host root font size.\nconst rowVariants = cva(\n [\n 'ds:grid ds:items-center ds:gap-x-[var(--spacing-xs)] ds:gap-y-[var(--spacing-xs)] ds:@[640px]:gap-x-[var(--spacing-sm)]',\n 'ds:grid-cols-[repeat(var(--wa-days),minmax(0,1fr))]',\n 'ds:@[640px]:grid-cols-[calc(var(--spacing-xl)*4)_repeat(var(--wa-days),minmax(0,1fr))_auto]',\n ].join(' '),\n);\n\nconst headerRowVariants = cva(\n [\n 'ds:grid ds:gap-x-[var(--spacing-xs)] ds:@[640px]:gap-x-[var(--spacing-sm)]',\n 'ds:grid-cols-[repeat(var(--wa-days),minmax(0,1fr))]',\n 'ds:@[640px]:grid-cols-[calc(var(--spacing-xl)*4)_repeat(var(--wa-days),minmax(0,1fr))_auto]',\n ].join(' '),\n);\n\nconst labelVariants = cva(\n 'ds:col-span-full ds:min-w-0 ds:text-start ds:font-semibold ds:break-words ds:@[640px]:col-span-1',\n);\n\nconst actionsVariants = cva(\n 'ds:col-span-full ds:flex ds:justify-end ds:gap-[var(--spacing-xs)] ds:@[640px]:col-span-1',\n);\n\nconst labelButtonVariants = cva(\n [\n 'ds:inline-flex ds:min-h-[var(--min-target-size)] ds:max-w-full ds:items-center ds:rounded-[var(--radius-sm)] ds:bg-transparent ds:p-0 ds:text-start ds:font-semibold ds:text-[color:var(--foreground)] ds:underline-offset-2 ds:hover:underline',\n 'ds:focus-visible:outline-2 ds:focus-visible:outline-offset-2 ds:focus-visible:outline-[var(--focus-ring)]',\n 'ds:forced-colors:focus-visible:outline-[Highlight]',\n ].join(' '),\n);\n\nconst stripVariants = cva(\n 'ds:relative ds:block ds:h-[var(--spacing-md)] ds:w-full ds:overflow-hidden ds:rounded-[var(--radius-sm)] ds:bg-[var(--muted)]',\n);\n\nconst barVariants = cva(\n 'ds:absolute ds:inset-y-0 ds:start-[var(--wa-start)] ds:w-[var(--wa-size)] ds:min-w-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:forced-colors:[forced-color-adjust:none]',\n);\n\n// Hour labels sit over each cell only once it is wide enough to hold them;\n// below that a single caption names the range.\nconst axisVariants = cva(\n 'ds:hidden ds:justify-between ds:font-normal ds:text-[color:var(--muted-foreground)] ds:tabular-nums ds:@[640px]:flex',\n);\nconst rangeVariants = cva(\n 'ds:m-0 type-meta ds:text-[color:var(--muted-foreground)] ds:@[640px]:hidden',\n);\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nfunction minutesLabel(fmt: Intl.DateTimeFormat, minutes: number): string {\n return fmt.format(new Date(Date.UTC(2024, 0, 1, 0, minutes)));\n}\n\nexport const WeekAvailability = forwardRef<\n HTMLDivElement,\n WeekAvailabilityProps\n>(function WeekAvailability(\n {\n rows,\n tones = [],\n hourRange,\n hideEmptyDays = false,\n weekStartsOn = 1,\n legend = true,\n onRowSelect,\n locale: localeProp,\n className,\n ...rest\n },\n ref,\n) {\n const { t, i18n } = useTranslation('ui');\n const locale = formatLocale(\n localeProp ?? i18n.resolvedLanguage ?? i18n.language,\n );\n\n const fmt = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n minute: '2-digit',\n timeZone: 'UTC',\n }),\n [locale],\n );\n const hourFmt = useMemo(\n () => new Intl.DateTimeFormat(locale, { hour: 'numeric', timeZone: 'UTC' }),\n [locale],\n );\n const shortDay = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' }),\n [locale],\n );\n const longDay = useMemo(\n () => new Intl.DateTimeFormat(locale, { weekday: 'long', timeZone: 'UTC' }),\n [locale],\n );\n const list = useMemo(\n () => new Intl.ListFormat(locale, { type: 'unit', style: 'short' }),\n [locale],\n );\n\n const model = useMemo(() => {\n const normalised = rows.map((row) => {\n const byDay = new Map<number, WeekAvailabilityDay>();\n for (const d of row.days) byDay.set(d.weekday, d);\n return { row, byDay };\n });\n const all = normalised.flatMap(({ row }) =>\n row.days.flatMap((d) => normaliseSpans(d.spans)),\n );\n return { normalised, hasHours: all.length > 0, fit: fitHourRange(all) };\n }, [rows]);\n\n const toneIndex = useMemo(\n () => new Map(tones.map((tone, i) => [tone.id, i] as const)),\n [tones],\n );\n\n if (isDevelopment() && tones.length > WEEK_AVAILABILITY_MAX_TONES) {\n console.warn(\n `WeekAvailability: ${tones.length} tones given; only the first ${WEEK_AVAILABILITY_MAX_TONES} get a colour.`,\n );\n }\n\n const [start, end] = useMemo(() => {\n const given = hourRange\n ? ([\n clamp(Math.floor(hourRange[0]), 0, 23),\n clamp(Math.ceil(hourRange[1]), 1, 24),\n ] as const)\n : model.fit;\n return given[1] > given[0] ? given : ([given[0], given[0] + 1] as const);\n }, [hourRange, model.fit]);\n\n const weekdays = visibleWeekdays(rows, weekStartsOn, hideEmptyDays);\n const hourLabel = (h: number) => minutesLabel(hourFmt, h * 60);\n const spanText = (s: WeekAvailabilitySpan) =>\n t('weekAvailability.span', {\n from: minutesLabel(fmt, s.from),\n to: minutesLabel(fmt, s.to),\n });\n\n const rootProps = {\n ref,\n 'data-component': 'week-availability',\n className: [rootVariants(), className].filter(Boolean).join(' '),\n ...rest,\n };\n\n if (rows.length === 0 || !model.hasHours || weekdays.length === 0) {\n return (\n <div {...rootProps}>\n <EmptyState\n variant=\"no-results\"\n size=\"sm\"\n title={t('weekAvailability.empty.title')}\n description={t('weekAvailability.empty.description')}\n />\n </div>\n );\n }\n\n const gridStyle = { '--wa-days': weekdays.length } as CSSProperties;\n const mid = start + Math.round((end - start) / 2);\n const midVisible = end - start >= 6;\n\n return (\n <div {...rootProps}>\n {legend && tones.length > 0 ? (\n <ul\n aria-label={t('weekAvailability.legend')}\n data-week-availability-legend=\"\"\n className={legendVariants()}\n >\n {tones.map((tone, i) => (\n <li\n key={tone.id}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n >\n <span\n aria-hidden=\"true\"\n data-tone={tone.id}\n className={[swatchVariants(), TONE_BG[i] ?? TONE_NEUTRAL].join(\n ' ',\n )}\n />\n {tone.label}\n </li>\n ))}\n </ul>\n ) : null}\n\n <p className={rangeVariants()}>\n {t('weekAvailability.range', {\n from: minutesLabel(fmt, start * 60),\n to: minutesLabel(fmt, end * 60),\n })}\n </p>\n\n <div\n role=\"table\"\n aria-label={rest['aria-label']}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <div role=\"rowgroup\">\n {/* eslint-disable-next-line react/forbid-dom-props -- custom property setter per 23-constraints (--wa-days) */}\n <div role=\"row\" style={gridStyle} className={headerRowVariants()}>\n <span\n role=\"columnheader\"\n className=\"ds:sr-only ds:@[640px]:not-sr-only\"\n >\n <span className=\"ds:sr-only\">{t('weekAvailability.rows')}</span>\n </span>\n {weekdays.map((wd) => {\n const date = new Date(Date.UTC(2024, 0, wd));\n return (\n <div\n key={wd}\n role=\"columnheader\"\n className=\"ds:min-w-0 ds:text-center type-meta ds:font-semibold ds:text-[color:var(--foreground)]\"\n >\n <span className=\"ds:sr-only\">{longDay.format(date)}</span>\n <span aria-hidden=\"true\">{shortDay.format(date)}</span>\n <span aria-hidden=\"true\" className={axisVariants()}>\n <span>{hourLabel(start)}</span>\n {midVisible ? <span>{hourLabel(mid)}</span> : null}\n <span>{hourLabel(end)}</span>\n </span>\n </div>\n );\n })}\n <span aria-hidden=\"true\" className=\"ds:hidden ds:@[640px]:block\" />\n </div>\n </div>\n\n <div\n role=\"rowgroup\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n {model.normalised.map(({ row, byDay }) => (\n <div\n key={row.id}\n role=\"row\"\n data-row-id={row.id}\n // eslint-disable-next-line react/forbid-dom-props -- custom property setter per 23-constraints (--wa-days)\n style={gridStyle}\n className={rowVariants()}\n >\n <div role=\"rowheader\" className={labelVariants()}>\n {onRowSelect ? (\n <button\n type=\"button\"\n className={labelButtonVariants()}\n onClick={() => onRowSelect(row.id)}\n >\n {row.label}\n </button>\n ) : (\n row.label\n )}\n </div>\n {weekdays.map((wd) => {\n const day = byDay.get(wd);\n const spans = normaliseSpans(day?.spans);\n const toneId = day?.tone ?? row.tone;\n const index = toneId ? toneIndex.get(toneId) : undefined;\n const tone = index === undefined ? undefined : tones[index];\n const name = longDay.format(new Date(Date.UTC(2024, 0, wd)));\n const hours = list.format(spans.map(spanText));\n const text =\n spans.length === 0\n ? t('weekAvailability.cellClosed', { day: name })\n : tone\n ? t('weekAvailability.cell', {\n day: name,\n hours,\n tone: tone.label,\n })\n : t('weekAvailability.cellNoTone', {\n day: name,\n hours,\n });\n return (\n <div\n key={wd}\n role=\"cell\"\n data-weekday={wd}\n data-tone={spans.length > 0 ? tone?.id : undefined}\n title={text}\n className=\"ds:min-w-0\"\n >\n <span className=\"ds:sr-only\">{text}</span>\n <span aria-hidden=\"true\" className={stripVariants()}>\n {spans.map((s) => {\n const place = spanPlacement(s, [start, end]);\n if (!place) return null;\n return (\n <span\n key={s.from}\n data-span=\"\"\n className={[\n barVariants(),\n index !== undefined\n ? (TONE_BG[index] ?? TONE_NEUTRAL)\n : TONE_NEUTRAL,\n ].join(' ')}\n // eslint-disable-next-line react/forbid-dom-props -- custom property setter per 23-constraints; the rule that reads it lives in barVariants\n style={\n {\n '--wa-start': `${place.start}%`,\n '--wa-size': `${place.size}%`,\n } as CSSProperties\n }\n />\n );\n })}\n </span>\n </div>\n );\n })}\n {row.actions ? (\n <div role=\"cell\" className={actionsVariants()}>\n {row.actions}\n </div>\n ) : (\n <span role=\"cell\" className=\"ds:hidden ds:@[640px]:block\" />\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n});\n\nWeekAvailability.displayName = 'WeekAvailability';\n"],"names":["WEEK_AVAILABILITY_MAX_TONES","WEEKDAYS","clamp","n","lo","hi","normaliseSpans","spans","sorted","s","b","merged","last","fitHourRange","start","end","spanPlacement","span","range","from","to","visibleWeekdays","rows","weekStartsOn","hideEmptyDays","ordered","wd","r","d","TONE_BG","TONE_NEUTRAL","rootVariants","cva","legendVariants","swatchVariants","rowVariants","headerRowVariants","labelVariants","actionsVariants","labelButtonVariants","stripVariants","barVariants","axisVariants","rangeVariants","minutesLabel","fmt","minutes","WeekAvailability","forwardRef","tones","hourRange","legend","onRowSelect","localeProp","className","rest","ref","t","i18n","useTranslation","locale","formatLocale","useMemo","hourFmt","shortDay","longDay","list","model","normalised","row","byDay","all","toneIndex","tone","i","isDevelopment","given","weekdays","hourLabel","h","spanText","rootProps","jsx","EmptyState","gridStyle","mid","midVisible","jsxs","date","day","toneId","index","name","hours","text","place"],"mappings":";;;;;;;AAmFO,MAAMA,IAA8B,GACrCC,IAA+C,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAEnEC,IAAQ,CAACC,GAAWC,GAAYC,MACpC,KAAK,IAAIA,GAAI,KAAK,IAAID,GAAID,CAAC,CAAC;AAGvB,SAASG,EACdC,GACwB;AACxB,QAAMC,KAAUD,KAAS,CAAA,GACtB,OAAO,CAACE,MAAM,OAAO,SAASA,EAAE,IAAI,KAAK,OAAO,SAASA,EAAE,EAAE,CAAC,EAC9D,IAAI,CAACA,OAAO,EAAE,MAAMP,EAAMO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAIP,EAAMO,EAAE,IAAI,GAAG,IAAI,EAAA,EAAI,EACvE,OAAO,CAACA,MAAMA,EAAE,KAAKA,EAAE,IAAI,EAC3B,KAAK,CAAC,GAAGC,MAAM,EAAE,OAAOA,EAAE,IAAI,GAC3BC,IAAiC,CAAA;A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