ivt 0.7.3 → 0.7.4
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/accordion/index.mjs +13 -15
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/accordion-table/index.mjs +26 -28
- package/dist/accordion-table/index.mjs.map +1 -1
- package/dist/alert/index.mjs +3 -3
- package/dist/alert-dialog/index.mjs +15 -17
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/aspect-ratio/index.mjs +42 -3
- package/dist/aspect-ratio/index.mjs.map +1 -1
- package/dist/auto-complete-multi-select/index.mjs +31 -33
- package/dist/auto-complete-multi-select/index.mjs.map +1 -1
- package/dist/avatar/index.mjs +130 -8
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.mjs +3 -3
- package/dist/base/index.mjs +57 -142
- package/dist/base/index.mjs.map +1 -1
- package/dist/breadcrumb/index.mjs +5 -5
- package/dist/button/index.mjs +3 -3
- package/dist/button-group/index.mjs +3 -4
- package/dist/button-group/index.mjs.map +1 -1
- package/dist/calendar/index.mjs +9 -9
- package/dist/card/index.mjs +3 -3
- package/dist/carousel/index.mjs +4 -4
- package/dist/chart/index.mjs +2869 -1282
- package/dist/chart/index.mjs.map +1 -1
- package/dist/checkbox/index.mjs +12 -14
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chunks/AutoComplete-qFuwmV53.mjs +95 -0
- package/dist/chunks/AutoComplete-qFuwmV53.mjs.map +1 -0
- package/dist/chunks/{CalendarRange-C6BJ_i8D.mjs → CalendarRange-Ce7PiNfq.mjs} +8 -8
- package/dist/chunks/{CalendarRange-C6BJ_i8D.mjs.map → CalendarRange-Ce7PiNfq.mjs.map} +1 -1
- package/dist/chunks/{ComboboxField-DFqOZmlN.mjs → ComboboxField-DaRpRraW.mjs} +9 -9
- package/dist/chunks/{ComboboxField-DFqOZmlN.mjs.map → ComboboxField-DaRpRraW.mjs.map} +1 -1
- package/dist/chunks/{Container-BFnURH_3.mjs → Container-DwaAaEiC.mjs} +2 -2
- package/dist/chunks/{Container-BFnURH_3.mjs.map → Container-DwaAaEiC.mjs.map} +1 -1
- package/dist/chunks/{DeleteConfirmationModal-3tgFcxyU.mjs → DeleteConfirmationModal-BwTbbBAw.mjs} +4 -4
- package/dist/chunks/{DeleteConfirmationModal-3tgFcxyU.mjs.map → DeleteConfirmationModal-BwTbbBAw.mjs.map} +1 -1
- package/dist/chunks/{ListItem-Dhdqegoz.mjs → ListItem-zxS4CZdq.mjs} +4 -4
- package/dist/chunks/{ListItem-Dhdqegoz.mjs.map → ListItem-zxS4CZdq.mjs.map} +1 -1
- package/dist/chunks/{TooltipIndicator-tYIvoK3x.mjs → TooltipIndicator-CwGGAeRz.mjs} +4 -4
- package/dist/chunks/{TooltipIndicator-tYIvoK3x.mjs.map → TooltipIndicator-CwGGAeRz.mjs.map} +1 -1
- package/dist/chunks/{_commonjsHelpers-CDajFLDm.mjs → _commonjsHelpers-B2Be7UYW.mjs} +1 -1
- package/dist/chunks/_commonjsHelpers-B2Be7UYW.mjs.map +1 -0
- package/dist/chunks/{accordion-Dig0Vyew.mjs → accordion-D4JVALAO.mjs} +9 -11
- package/dist/chunks/{accordion-Dig0Vyew.mjs.map → accordion-D4JVALAO.mjs.map} +1 -1
- package/dist/chunks/{alert-CtNiMMMm.mjs → alert-D-E6nsVK.mjs} +2 -2
- package/dist/chunks/{alert-CtNiMMMm.mjs.map → alert-D-E6nsVK.mjs.map} +1 -1
- package/dist/chunks/{badge-CMepcgQ2.mjs → badge-C6mkl9yr.mjs} +2 -2
- package/dist/chunks/{badge-CMepcgQ2.mjs.map → badge-C6mkl9yr.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-ByJyReDu.mjs → bundle-mjs-B1dpl-bk.mjs} +228 -154
- package/dist/chunks/bundle-mjs-B1dpl-bk.mjs.map +1 -0
- package/dist/chunks/{button-DHQrVlqk.mjs → button-DsgJkgEz.mjs} +2 -2
- package/dist/chunks/{button-DHQrVlqk.mjs.map → button-DsgJkgEz.mjs.map} +1 -1
- package/dist/chunks/{calendar-DtKpXGXO.mjs → calendar-Co99lCn4.mjs} +550 -166
- package/dist/chunks/calendar-Co99lCn4.mjs.map +1 -0
- package/dist/chunks/{calendar-days-5V8H0_Qn.mjs → calendar-days-BF4GDmMr.mjs} +2 -2
- package/dist/chunks/{calendar-days-5V8H0_Qn.mjs.map → calendar-days-BF4GDmMr.mjs.map} +1 -1
- package/dist/chunks/{card-DgO3JDtX.mjs → card-Cuo7NL8y.mjs} +2 -2
- package/dist/chunks/{card-DgO3JDtX.mjs.map → card-Cuo7NL8y.mjs.map} +1 -1
- package/dist/chunks/{check-yo43z6YO.mjs → check-CzKqQLNR.mjs} +2 -2
- package/dist/chunks/{check-yo43z6YO.mjs.map → check-CzKqQLNR.mjs.map} +1 -1
- package/dist/chunks/{checkbox-B3xoUcaP.mjs → checkbox-C7RUdsIS.mjs} +9 -11
- package/dist/chunks/{checkbox-B3xoUcaP.mjs.map → checkbox-C7RUdsIS.mjs.map} +1 -1
- package/dist/chunks/{chevron-down-gO34wzc7.mjs → chevron-down-CZjN_vyX.mjs} +2 -2
- package/dist/chunks/{chevron-down-gO34wzc7.mjs.map → chevron-down-CZjN_vyX.mjs.map} +1 -1
- package/dist/chunks/{chevron-left-DGlHB7Nw.mjs → chevron-left-BpfBwM4S.mjs} +2 -2
- package/dist/chunks/{chevron-left-DGlHB7Nw.mjs.map → chevron-left-BpfBwM4S.mjs.map} +1 -1
- package/dist/chunks/{chevron-right-B6bwFEdI.mjs → chevron-right-uq-O8rwC.mjs} +2 -2
- package/dist/chunks/{chevron-right-B6bwFEdI.mjs.map → chevron-right-uq-O8rwC.mjs.map} +1 -1
- package/dist/chunks/{chevrons-up-down-StzXyb6Z.mjs → chevrons-up-down-DKM8h8j_.mjs} +2 -2
- package/dist/chunks/{chevrons-up-down-StzXyb6Z.mjs.map → chevrons-up-down-DKM8h8j_.mjs.map} +1 -1
- package/dist/chunks/{command-BUHV178P.mjs → command-CAS791lb.mjs} +8 -8
- package/dist/chunks/{command-BUHV178P.mjs.map → command-CAS791lb.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-BrIj5xiA.mjs → createLucideIcon-xkRZC0aJ.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-BrIj5xiA.mjs.map → createLucideIcon-xkRZC0aJ.mjs.map} +1 -1
- package/dist/chunks/{date-re6oTh_O.mjs → date-DYEUxjwi.mjs} +2 -2
- package/dist/chunks/{date-re6oTh_O.mjs.map → date-DYEUxjwi.mjs.map} +1 -1
- package/dist/chunks/{dialog-CsH0QGEc.mjs → dialog-Dt_M700u.mjs} +4 -4
- package/dist/chunks/{dialog-CsH0QGEc.mjs.map → dialog-Dt_M700u.mjs.map} +1 -1
- package/dist/chunks/{ellipsis-BED2L1d7.mjs → ellipsis-BcRZkfZw.mjs} +2 -2
- package/dist/chunks/{ellipsis-BED2L1d7.mjs.map → ellipsis-BcRZkfZw.mjs.map} +1 -1
- package/dist/chunks/{form-B4-N-eE1.mjs → form-CJnoOgoH.mjs} +299 -150
- package/dist/chunks/form-CJnoOgoH.mjs.map +1 -0
- package/dist/chunks/{format-C24_9AKp.mjs → format-BSPAt__h.mjs} +1 -1
- package/dist/chunks/{format-C24_9AKp.mjs.map → format-BSPAt__h.mjs.map} +1 -1
- package/dist/chunks/{format-numbers-CksgR7yb.mjs → format-numbers-BpGX211b.mjs} +2 -6
- package/dist/chunks/format-numbers-BpGX211b.mjs.map +1 -0
- package/dist/chunks/{hover-card-Dke495v-.mjs → hover-card-DKMcpBnt.mjs} +9 -11
- package/dist/chunks/{hover-card-Dke495v-.mjs.map → hover-card-DKMcpBnt.mjs.map} +1 -1
- package/dist/chunks/{index-Bn9j4jd_.mjs → index-0DBJW078.mjs} +2 -2
- package/dist/chunks/{index-Bn9j4jd_.mjs.map → index-0DBJW078.mjs.map} +1 -1
- package/dist/chunks/{index-DmwGzaYt.mjs → index-7wUPkpwA.mjs} +9 -11
- package/dist/chunks/{index-DmwGzaYt.mjs.map → index-7wUPkpwA.mjs.map} +1 -1
- package/dist/chunks/{index-BrOFvz7z.mjs → index-9921_a2g.mjs} +1 -1
- package/dist/chunks/{index-BrOFvz7z.mjs.map → index-9921_a2g.mjs.map} +1 -1
- package/dist/chunks/{index-DjiiXdCh.mjs → index-B49Rv10M.mjs} +1 -1
- package/dist/chunks/{index-DjiiXdCh.mjs.map → index-B49Rv10M.mjs.map} +1 -1
- package/dist/chunks/{index-7SNyMh-j.mjs → index-B8pOe-bI.mjs} +13 -15
- package/dist/chunks/{index-7SNyMh-j.mjs.map → index-B8pOe-bI.mjs.map} +1 -1
- package/dist/chunks/{index-VN9qcZ4P.mjs → index-B8zlei3I.mjs} +1 -1
- package/dist/chunks/{index-VN9qcZ4P.mjs.map → index-B8zlei3I.mjs.map} +1 -1
- package/dist/chunks/{index-DmLyVVSA.mjs → index-BpZD69GD.mjs} +2 -2
- package/dist/chunks/{index-DmLyVVSA.mjs.map → index-BpZD69GD.mjs.map} +1 -1
- package/dist/chunks/{index-C-ZwjB4k.mjs → index-BtdTgi0_.mjs} +1 -1
- package/dist/chunks/{index-C-ZwjB4k.mjs.map → index-BtdTgi0_.mjs.map} +1 -1
- package/dist/chunks/{index-C8cUOEOO.mjs → index-Cm5-jAR7.mjs} +38 -2
- package/dist/chunks/index-Cm5-jAR7.mjs.map +1 -0
- package/dist/chunks/{index-DHpiwknP.mjs → index-CsC-dafu.mjs} +3 -3
- package/dist/chunks/{index-DHpiwknP.mjs.map → index-CsC-dafu.mjs.map} +1 -1
- package/dist/chunks/{index-rXTYYoI9.mjs → index-CuEeN4AG.mjs} +6 -7
- package/dist/chunks/{index-rXTYYoI9.mjs.map → index-CuEeN4AG.mjs.map} +1 -1
- package/dist/chunks/{index-BElPX9xn.mjs → index-CvWc6WZ4.mjs} +7 -9
- package/dist/chunks/{index-BElPX9xn.mjs.map → index-CvWc6WZ4.mjs.map} +1 -1
- package/dist/chunks/{index-D7mBTwC1.mjs → index-DSBOi0JP.mjs} +4 -5
- package/dist/chunks/{index-D7mBTwC1.mjs.map → index-DSBOi0JP.mjs.map} +1 -1
- package/dist/chunks/{index-B8RPmvRI.mjs → index-DWtzT31F.mjs} +2 -2
- package/dist/chunks/{index-B8RPmvRI.mjs.map → index-DWtzT31F.mjs.map} +1 -1
- package/dist/chunks/{index-DLAC_TU-.mjs → index-DaifcY5X.mjs} +7 -9
- package/dist/chunks/{index-DLAC_TU-.mjs.map → index-DaifcY5X.mjs.map} +1 -1
- package/dist/chunks/{index-DIkcxop-.mjs → index-DjoMuta5.mjs} +1 -1
- package/dist/chunks/{index-DIkcxop-.mjs.map → index-DjoMuta5.mjs.map} +1 -1
- package/dist/chunks/{index-DY9hLs8O.mjs → index-Dn87UbZu.mjs} +2 -2
- package/dist/chunks/{index-DY9hLs8O.mjs.map → index-Dn87UbZu.mjs.map} +1 -1
- package/dist/chunks/{index-BKxnMSY9.mjs → index-G8uUqzC7.mjs} +12 -2
- package/dist/chunks/index-G8uUqzC7.mjs.map +1 -0
- package/dist/chunks/{index-CFaMr67I.mjs → index-SJQIKyxi.mjs} +1 -1
- package/dist/chunks/{index-CFaMr67I.mjs.map → index-SJQIKyxi.mjs.map} +1 -1
- package/dist/chunks/{index-BP00_xoF.mjs → index-fcmnzZn6.mjs} +12 -5
- package/dist/chunks/index-fcmnzZn6.mjs.map +1 -0
- package/dist/chunks/{index-BXScVxAr.mjs → index-zv8c0UAU.mjs} +3 -3
- package/dist/chunks/{index-BXScVxAr.mjs.map → index-zv8c0UAU.mjs.map} +1 -1
- package/dist/chunks/index.module-B_Z75X1e.mjs +73 -0
- package/dist/chunks/index.module-B_Z75X1e.mjs.map +1 -0
- package/dist/chunks/{input-Beaky41D.mjs → input-NILUGijL.mjs} +2 -2
- package/dist/chunks/{input-Beaky41D.mjs.map → input-NILUGijL.mjs.map} +1 -1
- package/dist/chunks/input-otp-b-7MmY2H.mjs +455 -0
- package/dist/chunks/input-otp-b-7MmY2H.mjs.map +1 -0
- package/dist/chunks/{label-n_pPs58q.mjs → label-81mjh4Q4.mjs} +44 -3
- package/dist/chunks/label-81mjh4Q4.mjs.map +1 -0
- package/dist/chunks/{loader-circle-CEDL1CbD.mjs → loader-circle-sGBNpyP3.mjs} +2 -2
- package/dist/chunks/{loader-circle-CEDL1CbD.mjs.map → loader-circle-sGBNpyP3.mjs.map} +1 -1
- package/dist/chunks/{menubar-C8VLP8-v.mjs → menubar-Dz5biTZv.mjs} +11 -13
- package/dist/chunks/{menubar-C8VLP8-v.mjs.map → menubar-Dz5biTZv.mjs.map} +1 -1
- package/dist/chunks/{multi-select-fLsOx7-e.mjs → multi-select-DeW-tL6j.mjs} +13 -13
- package/dist/chunks/{multi-select-fLsOx7-e.mjs.map → multi-select-DeW-tL6j.mjs.map} +1 -1
- package/dist/chunks/{pagination-iwqbmQ5Q.mjs → pagination-0W2Kek6Z.mjs} +6 -6
- package/dist/chunks/{pagination-iwqbmQ5Q.mjs.map → pagination-0W2Kek6Z.mjs.map} +1 -1
- package/dist/chunks/{popover-Cpht2GgQ.mjs → popover-ChoMUAP9.mjs} +11 -13
- package/dist/chunks/{popover-Cpht2GgQ.mjs.map → popover-ChoMUAP9.mjs.map} +1 -1
- package/dist/chunks/progress-zrBdDKEV.mjs +223 -0
- package/dist/chunks/progress-zrBdDKEV.mjs.map +1 -0
- package/dist/chunks/radio-group-r3ejuIom.mjs +258 -0
- package/dist/chunks/radio-group-r3ejuIom.mjs.map +1 -0
- package/dist/chunks/{react-number-format.es-CcgVtYyo.mjs → react-number-format.es-rRpdCutF.mjs} +1 -1
- package/dist/chunks/{react-number-format.es-CcgVtYyo.mjs.map → react-number-format.es-rRpdCutF.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DuO1U-ha.mjs → scroll-area-DjtXX0pm.mjs} +9 -11
- package/dist/chunks/{scroll-area-DuO1U-ha.mjs.map → scroll-area-DjtXX0pm.mjs.map} +1 -1
- package/dist/chunks/{select-D5DzfQ8s.mjs → select-CICQavYx.mjs} +5 -5
- package/dist/chunks/{select-D5DzfQ8s.mjs.map → select-CICQavYx.mjs.map} +1 -1
- package/dist/chunks/{separator-DHnqygnd.mjs → separator-CL28DVoA.mjs} +44 -3
- package/dist/chunks/separator-CL28DVoA.mjs.map +1 -0
- package/dist/chunks/{sheet-CXvwS4r9.mjs → sheet-BIN5Bwkz.mjs} +4 -4
- package/dist/chunks/{sheet-CXvwS4r9.mjs.map → sheet-BIN5Bwkz.mjs.map} +1 -1
- package/dist/chunks/{skeleton-CuuvHTlE.mjs → skeleton-DEo09dsp.mjs} +2 -2
- package/dist/chunks/{skeleton-CuuvHTlE.mjs.map → skeleton-DEo09dsp.mjs.map} +1 -1
- package/dist/chunks/slider-C_afdOBq.mjs +588 -0
- package/dist/chunks/slider-C_afdOBq.mjs.map +1 -0
- package/dist/chunks/{sortable-Dc-PXgOX.mjs → sortable-Hz2p-hG_.mjs} +3 -3
- package/dist/chunks/{sortable-Dc-PXgOX.mjs.map → sortable-Hz2p-hG_.mjs.map} +1 -1
- package/dist/chunks/styles-DQr_CtBg.mjs +6 -0
- package/dist/chunks/styles-DQr_CtBg.mjs.map +1 -0
- package/dist/chunks/switch-CoxjUYji.mjs +138 -0
- package/dist/chunks/switch-CoxjUYji.mjs.map +1 -0
- package/dist/chunks/{table-CsRWNDTp.mjs → table-CaTzvnGO.mjs} +2 -2
- package/dist/chunks/{table-CsRWNDTp.mjs.map → table-CaTzvnGO.mjs.map} +1 -1
- package/dist/chunks/{tabs-Bw6ByWDS.mjs → tabs-DbcqE74l.mjs} +9 -10
- package/dist/chunks/{tabs-Bw6ByWDS.mjs.map → tabs-DbcqE74l.mjs.map} +1 -1
- package/dist/chunks/{textarea-C7CkvJ9p.mjs → textarea-C99bTFre.mjs} +2 -2
- package/dist/chunks/{textarea-C7CkvJ9p.mjs.map → textarea-C99bTFre.mjs.map} +1 -1
- package/dist/chunks/{toggle-BRsNuICy.mjs → toggle-x7-6JYvP.mjs} +4 -5
- package/dist/chunks/{toggle-BRsNuICy.mjs.map → toggle-x7-6JYvP.mjs.map} +1 -1
- package/dist/chunks/{tooltip-DXG_UtcS.mjs → tooltip-aCFcTWvT.mjs} +11 -13
- package/dist/chunks/{tooltip-DXG_UtcS.mjs.map → tooltip-aCFcTWvT.mjs.map} +1 -1
- package/dist/chunks/{trash-2-DSHxuneu.mjs → trash-2-BRTBRPsE.mjs} +2 -2
- package/dist/chunks/{trash-2-DSHxuneu.mjs.map → trash-2-BRTBRPsE.mjs.map} +1 -1
- package/dist/chunks/{triangle-alert-8sDAvjNW.mjs → triangle-alert-DEr_0gbo.mjs} +2 -2
- package/dist/chunks/{triangle-alert-8sDAvjNW.mjs.map → triangle-alert-DEr_0gbo.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-WVUvgLYj.mjs → tslib.es6-9fTryOSE.mjs} +1 -1
- package/dist/chunks/{tslib.es6-WVUvgLYj.mjs.map → tslib.es6-9fTryOSE.mjs.map} +1 -1
- package/dist/chunks/{utils-BqIRZT53.mjs → utils-M7D-rn0u.mjs} +2 -2
- package/dist/chunks/{utils-BqIRZT53.mjs.map → utils-M7D-rn0u.mjs.map} +1 -1
- package/dist/chunks/{wand-sparkles-BjK8VloB.mjs → wand-sparkles-cr6EaHA_.mjs} +2 -2
- package/dist/chunks/{wand-sparkles-BjK8VloB.mjs.map → wand-sparkles-cr6EaHA_.mjs.map} +1 -1
- package/dist/chunks/{x-D7oIZ9hK.mjs → x-Heb3hHKJ.mjs} +2 -2
- package/dist/chunks/{x-D7oIZ9hK.mjs.map → x-Heb3hHKJ.mjs.map} +1 -1
- package/dist/collapsible/index.mjs +8 -10
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.mjs +25 -27
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.mjs +19 -21
- package/dist/command/index.mjs.map +1 -1
- package/dist/context-menu/index.mjs +21 -23
- package/dist/context-menu/index.mjs.map +1 -1
- package/dist/dash/index.mjs +25 -26
- package/dist/dash/index.mjs.map +1 -1
- package/dist/data-table/index.mjs +33 -35
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/date-picker/index.mjs +26 -28
- package/dist/date-picker/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +18 -20
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/drawer/index.mjs +15 -17
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown-menu/index.mjs +21 -23
- package/dist/dropdown-menu/index.mjs.map +1 -1
- package/dist/dropzone/index.mjs +16 -18
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/editable-table/index.mjs +18 -20
- package/dist/editable-table/index.mjs.map +1 -1
- package/dist/empty/index.mjs +2 -2
- package/dist/field/index.mjs +4 -5
- package/dist/field/index.mjs.map +1 -1
- package/dist/form/index.mjs +4 -5
- package/dist/form/index.mjs.map +1 -1
- package/dist/form-fields/index.mjs +27 -29
- package/dist/form-fields/index.mjs.map +1 -1
- package/dist/form-layout/index.d.ts +85 -0
- package/dist/form-layout/index.mjs +534 -0
- package/dist/form-layout/index.mjs.map +1 -0
- package/dist/hover-card/index.mjs +14 -16
- package/dist/hover-card/index.mjs.map +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +3 -3
- package/dist/input-group/index.mjs +5 -5
- package/dist/input-otp/index.mjs +5 -455
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/item/index.mjs +3 -4
- package/dist/item/index.mjs.map +1 -1
- package/dist/ivt.css +1 -1
- package/dist/kbd/index.mjs +2 -2
- package/dist/label/index.mjs +3 -4
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.mjs +22 -24
- package/dist/layout/index.mjs.map +1 -1
- package/dist/menubar/index.mjs +22 -24
- package/dist/menubar/index.mjs.map +1 -1
- package/dist/multi-input-list/index.mjs +28 -30
- package/dist/multi-input-list/index.mjs.map +1 -1
- package/dist/multi-select/index.mjs +32 -34
- package/dist/multi-select/index.mjs.map +1 -1
- package/dist/navigation-menu/index.mjs +15 -17
- package/dist/navigation-menu/index.mjs.map +1 -1
- package/dist/pagination/index.mjs +8 -8
- package/dist/popover/index.mjs +17 -19
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.mjs +3 -5
- package/dist/progress/index.mjs.map +1 -1
- package/dist/radio-group/index.mjs +18 -264
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/resizable/index.mjs +3 -3
- package/dist/scroll-area/index.mjs +10 -12
- package/dist/scroll-area/index.mjs.map +1 -1
- package/dist/select/index.mjs +6 -6
- package/dist/separator/index.mjs +3 -4
- package/dist/separator/index.mjs.map +1 -1
- package/dist/shared/index.mjs +5 -5
- package/dist/sheet/index.mjs +18 -20
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.mjs +26 -28
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/skeleton/index.mjs +3 -3
- package/dist/skeleton-component/index.mjs +4 -4
- package/dist/slider/index.mjs +14 -591
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sortable/index.mjs +4 -4
- package/dist/spinner/index.mjs +4 -4
- package/dist/switch/index.mjs +11 -141
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.mjs +3 -3
- package/dist/table-filter/index.mjs +53 -54
- package/dist/table-filter/index.mjs.map +1 -1
- package/dist/tabs/index.mjs +14 -16
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.mjs +3 -3
- package/dist/toast/index.mjs +13 -15
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toggle/index.mjs +6 -7
- package/dist/toggle/index.mjs.map +1 -1
- package/dist/toggle-group/index.mjs +11 -13
- package/dist/toggle-group/index.mjs.map +1 -1
- package/dist/tooltip/index.mjs +16 -18
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +6 -1
- package/dist/chunks/_commonjsHelpers-CDajFLDm.mjs.map +0 -1
- package/dist/chunks/bundle-mjs-ByJyReDu.mjs.map +0 -1
- package/dist/chunks/calendar-DtKpXGXO.mjs.map +0 -1
- package/dist/chunks/form-B4-N-eE1.mjs.map +0 -1
- package/dist/chunks/format-numbers-CksgR7yb.mjs.map +0 -1
- package/dist/chunks/index-5s6ltgHF.mjs +0 -40
- package/dist/chunks/index-5s6ltgHF.mjs.map +0 -1
- package/dist/chunks/index-BKxnMSY9.mjs.map +0 -1
- package/dist/chunks/index-BP00_xoF.mjs.map +0 -1
- package/dist/chunks/index-C8cUOEOO.mjs.map +0 -1
- package/dist/chunks/index-DUoETH03.mjs +0 -12
- package/dist/chunks/index-DUoETH03.mjs.map +0 -1
- package/dist/chunks/index.module-acmtZqFz.mjs +0 -68
- package/dist/chunks/index.module-acmtZqFz.mjs.map +0 -1
- package/dist/chunks/label-n_pPs58q.mjs.map +0 -1
- package/dist/chunks/progress-CZnyHYXZ.mjs +0 -99
- package/dist/chunks/progress-CZnyHYXZ.mjs.map +0 -1
- package/dist/chunks/separator-DHnqygnd.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { createContext, useContext, useCallback, useRef, useLayoutEffect, useState, useEffect, useMemo } from 'react';
|
|
3
|
-
import { c as cn } from './utils-
|
|
4
|
-
import { t as toDate, c as constructFrom, j as addDays, y as normalizeDates, z as startOfDay, g as getDefaultOptions,
|
|
5
|
-
import { C as ChevronLeft } from './chevron-left-
|
|
6
|
-
import { C as ChevronRight } from './chevron-right-
|
|
7
|
-
import { C as ChevronDown } from './chevron-down-
|
|
8
|
-
import { b as buttonVariants, B as Button$1 } from './button-
|
|
3
|
+
import { c as cn } from './utils-M7D-rn0u.mjs';
|
|
4
|
+
import { t as toDate, c as constructFrom, j as addDays, y as normalizeDates, z as startOfDay, g as getDefaultOptions, l as enUS$1, f as format, A as differenceInCalendarDays, i as getISOWeek, h as getWeek, B as isDate, e as startOfISOWeek, s as startOfWeek, C as startOfYear } from './format-BSPAt__h.mjs';
|
|
5
|
+
import { C as ChevronLeft } from './chevron-left-BpfBwM4S.mjs';
|
|
6
|
+
import { C as ChevronRight } from './chevron-right-uq-O8rwC.mjs';
|
|
7
|
+
import { C as ChevronDown } from './chevron-down-CZjN_vyX.mjs';
|
|
8
|
+
import { b as buttonVariants, B as Button$1 } from './button-DsgJkgEz.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* The {@link addMonths} function options.
|
|
@@ -1182,6 +1182,74 @@ const FOUR_WEEKS = 4;
|
|
|
1182
1182
|
return endDate;
|
|
1183
1183
|
}
|
|
1184
1184
|
|
|
1185
|
+
/** English (United States) locale extended with DayPicker-specific translations. */ const enUS = {
|
|
1186
|
+
...enUS$1,
|
|
1187
|
+
labels: {
|
|
1188
|
+
labelDayButton: (date, modifiers, options, dateLib)=>{
|
|
1189
|
+
let formatDate;
|
|
1190
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
1191
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
1192
|
+
} else {
|
|
1193
|
+
formatDate = (d, pattern)=>format(d, pattern, {
|
|
1194
|
+
locale: enUS$1,
|
|
1195
|
+
...options
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
let label = formatDate(date, "PPPP");
|
|
1199
|
+
if (modifiers.today) label = `Today, ${label}`;
|
|
1200
|
+
if (modifiers.selected) label = `${label}, selected`;
|
|
1201
|
+
return label;
|
|
1202
|
+
},
|
|
1203
|
+
labelMonthDropdown: "Choose the Month",
|
|
1204
|
+
labelNext: "Go to the Next Month",
|
|
1205
|
+
labelPrevious: "Go to the Previous Month",
|
|
1206
|
+
labelWeekNumber: (weekNumber)=>`Week ${weekNumber}`,
|
|
1207
|
+
labelYearDropdown: "Choose the Year",
|
|
1208
|
+
labelGrid: (date, options, dateLib)=>{
|
|
1209
|
+
let formatDate;
|
|
1210
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
1211
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
1212
|
+
} else {
|
|
1213
|
+
formatDate = (d, pattern)=>format(d, pattern, {
|
|
1214
|
+
locale: enUS$1,
|
|
1215
|
+
...options
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
return formatDate(date, "LLLL yyyy");
|
|
1219
|
+
},
|
|
1220
|
+
labelGridcell: (date, modifiers, options, dateLib)=>{
|
|
1221
|
+
let formatDate;
|
|
1222
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
1223
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
1224
|
+
} else {
|
|
1225
|
+
formatDate = (d, pattern)=>format(d, pattern, {
|
|
1226
|
+
locale: enUS$1,
|
|
1227
|
+
...options
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
let label = formatDate(date, "PPPP");
|
|
1231
|
+
if (modifiers?.today) {
|
|
1232
|
+
label = `Today, ${label}`;
|
|
1233
|
+
}
|
|
1234
|
+
return label;
|
|
1235
|
+
},
|
|
1236
|
+
labelNav: "Navigation bar",
|
|
1237
|
+
labelWeekNumberHeader: "Week Number",
|
|
1238
|
+
labelWeekday: (date, options, dateLib)=>{
|
|
1239
|
+
let formatDate;
|
|
1240
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
1241
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
1242
|
+
} else {
|
|
1243
|
+
formatDate = (d, pattern)=>format(d, pattern, {
|
|
1244
|
+
locale: enUS$1,
|
|
1245
|
+
...options
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
return formatDate(date, "cccc");
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
};
|
|
1252
|
+
|
|
1185
1253
|
/**
|
|
1186
1254
|
* A wrapper class around [date-fns](http://date-fns.org) that provides utility
|
|
1187
1255
|
* methods for date manipulation and formatting.
|
|
@@ -1661,6 +1729,9 @@ DateLib.yearFirstLocales = new Set([
|
|
|
1661
1729
|
this.displayMonth = displayMonth;
|
|
1662
1730
|
this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));
|
|
1663
1731
|
this.dateLib = dateLib;
|
|
1732
|
+
this.isoDate = dateLib.format(date, "yyyy-MM-dd");
|
|
1733
|
+
this.displayMonthId = dateLib.format(displayMonth, "yyyy-MM");
|
|
1734
|
+
this.dateMonthId = dateLib.format(date, "yyyy-MM");
|
|
1664
1735
|
}
|
|
1665
1736
|
}
|
|
1666
1737
|
|
|
@@ -2309,7 +2380,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
2309
2380
|
return isSameDay(date, matcher);
|
|
2310
2381
|
}
|
|
2311
2382
|
if (isDatesArray(matcher, dateLib)) {
|
|
2312
|
-
return matcher.
|
|
2383
|
+
return matcher.some((matcherDate)=>isSameDay(date, matcherDate));
|
|
2313
2384
|
}
|
|
2314
2385
|
if (isDateRange(matcher)) {
|
|
2315
2386
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -2358,7 +2429,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
2358
2429
|
* @param dateLib The date library to use for date manipulation.
|
|
2359
2430
|
* @returns A function that retrieves the modifiers for a given `CalendarDay`.
|
|
2360
2431
|
*/ function createGetModifiers(days, props, navStart, navEnd, dateLib) {
|
|
2361
|
-
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today } = props;
|
|
2432
|
+
const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today = dateLib.today() } = props;
|
|
2362
2433
|
const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter } = dateLib;
|
|
2363
2434
|
const computedNavStart = navStart && startOfMonth(navStart);
|
|
2364
2435
|
const computedNavEnd = navEnd && endOfMonth(navEnd);
|
|
@@ -2378,7 +2449,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
2378
2449
|
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
|
|
2379
2450
|
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || isBeforeNavStart || isAfterNavEnd || // Broadcast calendar will show outside days as default
|
|
2380
2451
|
!broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
|
|
2381
|
-
const isToday = isSameDay(date, today
|
|
2452
|
+
const isToday = isSameDay(date, today);
|
|
2382
2453
|
if (isOutside) internalModifiersMap.outside.push(day);
|
|
2383
2454
|
if (isDisabled) internalModifiersMap.disabled.push(day);
|
|
2384
2455
|
if (isHidden) internalModifiersMap.hidden.push(day);
|
|
@@ -2661,116 +2732,6 @@ var defaultFormatters = /*#__PURE__*/Object.freeze({
|
|
|
2661
2732
|
};
|
|
2662
2733
|
}
|
|
2663
2734
|
|
|
2664
|
-
/**
|
|
2665
|
-
* Returns the months to show in the dropdown.
|
|
2666
|
-
*
|
|
2667
|
-
* This function generates a list of months for the current year, formatted
|
|
2668
|
-
* using the provided formatter, and determines whether each month should be
|
|
2669
|
-
* disabled based on the navigation range.
|
|
2670
|
-
*
|
|
2671
|
-
* @param displayMonth The currently displayed month.
|
|
2672
|
-
* @param navStart The start date for navigation.
|
|
2673
|
-
* @param navEnd The end date for navigation.
|
|
2674
|
-
* @param formatters The formatters to use for formatting the month labels.
|
|
2675
|
-
* @param dateLib The date library to use for date manipulation.
|
|
2676
|
-
* @returns An array of dropdown options representing the months, or `undefined`
|
|
2677
|
-
* if no months are available.
|
|
2678
|
-
*/ function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
2679
|
-
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth } = dateLib;
|
|
2680
|
-
const months = eachMonthOfInterval({
|
|
2681
|
-
start: startOfYear(displayMonth),
|
|
2682
|
-
end: endOfYear(displayMonth)
|
|
2683
|
-
});
|
|
2684
|
-
const options = months.map((month)=>{
|
|
2685
|
-
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
2686
|
-
const value = getMonth(month);
|
|
2687
|
-
const disabled = navStart && month < startOfMonth(navStart) || navEnd && month > startOfMonth(navEnd) || false;
|
|
2688
|
-
return {
|
|
2689
|
-
value,
|
|
2690
|
-
label,
|
|
2691
|
-
disabled
|
|
2692
|
-
};
|
|
2693
|
-
});
|
|
2694
|
-
return options;
|
|
2695
|
-
}
|
|
2696
|
-
|
|
2697
|
-
/**
|
|
2698
|
-
* Returns the computed style for a day based on its modifiers.
|
|
2699
|
-
*
|
|
2700
|
-
* This function merges the base styles for the day with any styles associated
|
|
2701
|
-
* with active modifiers.
|
|
2702
|
-
*
|
|
2703
|
-
* @param dayModifiers The modifiers applied to the day.
|
|
2704
|
-
* @param styles The base styles for the calendar elements.
|
|
2705
|
-
* @param modifiersStyles The styles associated with specific modifiers.
|
|
2706
|
-
* @returns The computed style for the day.
|
|
2707
|
-
*/ function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
2708
|
-
let style = {
|
|
2709
|
-
...styles?.[UI.Day]
|
|
2710
|
-
};
|
|
2711
|
-
Object.entries(dayModifiers).filter(([, active])=>active === true).forEach(([modifier])=>{
|
|
2712
|
-
style = {
|
|
2713
|
-
...style,
|
|
2714
|
-
...modifiersStyles?.[modifier]
|
|
2715
|
-
};
|
|
2716
|
-
});
|
|
2717
|
-
return style;
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
|
-
/**
|
|
2721
|
-
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
2722
|
-
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
2723
|
-
*
|
|
2724
|
-
* @param dateLib The date library to use for date manipulation.
|
|
2725
|
-
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
2726
|
-
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
2727
|
-
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
2728
|
-
* @returns An array of 7 dates representing the weekdays.
|
|
2729
|
-
*/ function getWeekdays(dateLib, ISOWeek, broadcastCalendar) {
|
|
2730
|
-
const today = dateLib.today();
|
|
2731
|
-
const start = ISOWeek ? dateLib.startOfISOWeek(today) : dateLib.startOfWeek(today);
|
|
2732
|
-
const days = [];
|
|
2733
|
-
for(let i = 0; i < 7; i++){
|
|
2734
|
-
const day = dateLib.addDays(start, i);
|
|
2735
|
-
days.push(day);
|
|
2736
|
-
}
|
|
2737
|
-
return days;
|
|
2738
|
-
}
|
|
2739
|
-
|
|
2740
|
-
/**
|
|
2741
|
-
* Returns the years to display in the dropdown.
|
|
2742
|
-
*
|
|
2743
|
-
* This function generates a list of years between the navigation start and end
|
|
2744
|
-
* dates, formatted using the provided formatter.
|
|
2745
|
-
*
|
|
2746
|
-
* @param navStart The start date for navigation.
|
|
2747
|
-
* @param navEnd The end date for navigation.
|
|
2748
|
-
* @param formatters The formatters to use for formatting the year labels.
|
|
2749
|
-
* @param dateLib The date library to use for date manipulation.
|
|
2750
|
-
* @param reverse If true, reverses the order of the years (descending).
|
|
2751
|
-
* @returns An array of dropdown options representing the years, or `undefined`
|
|
2752
|
-
* if `navStart` or `navEnd` is not provided.
|
|
2753
|
-
*/ function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
2754
|
-
if (!navStart) return undefined;
|
|
2755
|
-
if (!navEnd) return undefined;
|
|
2756
|
-
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
2757
|
-
const firstNavYear = startOfYear(navStart);
|
|
2758
|
-
const lastNavYear = endOfYear(navEnd);
|
|
2759
|
-
const years = eachYearOfInterval({
|
|
2760
|
-
start: firstNavYear,
|
|
2761
|
-
end: lastNavYear
|
|
2762
|
-
});
|
|
2763
|
-
if (reverse) years.reverse();
|
|
2764
|
-
return years.map((year)=>{
|
|
2765
|
-
const label = formatters.formatYearDropdown(year, dateLib);
|
|
2766
|
-
return {
|
|
2767
|
-
value: getYear(year),
|
|
2768
|
-
label,
|
|
2769
|
-
disabled: false
|
|
2770
|
-
};
|
|
2771
|
-
});
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
2735
|
/**
|
|
2775
2736
|
* Generates the ARIA label for a day button.
|
|
2776
2737
|
*
|
|
@@ -2857,6 +2818,7 @@ var defaultFormatters = /*#__PURE__*/Object.freeze({
|
|
|
2857
2818
|
return "";
|
|
2858
2819
|
}
|
|
2859
2820
|
|
|
2821
|
+
const defaultLabel = "Go to the Next Month";
|
|
2860
2822
|
/**
|
|
2861
2823
|
* Generates the ARIA label for the "next month" button.
|
|
2862
2824
|
*
|
|
@@ -2866,8 +2828,8 @@ var defaultFormatters = /*#__PURE__*/Object.freeze({
|
|
|
2866
2828
|
* @returns The ARIA label for the "next month" button.
|
|
2867
2829
|
* @group Labels
|
|
2868
2830
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
2869
|
-
*/ function labelNext(_month) {
|
|
2870
|
-
return
|
|
2831
|
+
*/ function labelNext(_month, _options) {
|
|
2832
|
+
return defaultLabel;
|
|
2871
2833
|
}
|
|
2872
2834
|
|
|
2873
2835
|
/**
|
|
@@ -2951,6 +2913,297 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
|
2951
2913
|
labelYearDropdown: labelYearDropdown
|
|
2952
2914
|
});
|
|
2953
2915
|
|
|
2916
|
+
const resolveLabel = (defaultLabel, customLabel, localeLabel)=>{
|
|
2917
|
+
if (customLabel) return customLabel;
|
|
2918
|
+
if (localeLabel) {
|
|
2919
|
+
return typeof localeLabel === "function" ? localeLabel : (..._args)=>localeLabel;
|
|
2920
|
+
}
|
|
2921
|
+
return defaultLabel;
|
|
2922
|
+
};
|
|
2923
|
+
/**
|
|
2924
|
+
* Merges custom labels from the props with the default labels.
|
|
2925
|
+
*
|
|
2926
|
+
* When available, uses the locale-provided translation for `labelNext`.
|
|
2927
|
+
*
|
|
2928
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
2929
|
+
* @param options Options from the date library, used to resolve locale
|
|
2930
|
+
* translations.
|
|
2931
|
+
* @returns The merged labels object with locale-aware defaults.
|
|
2932
|
+
*/ function getLabels(customLabels, options) {
|
|
2933
|
+
const localeLabels = options.locale?.labels ?? {};
|
|
2934
|
+
return {
|
|
2935
|
+
...defaultLabels,
|
|
2936
|
+
...customLabels ?? {},
|
|
2937
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
|
|
2938
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
2939
|
+
labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
|
|
2940
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
|
|
2941
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
2942
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
2943
|
+
labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
|
|
2944
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
|
|
2945
|
+
labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
|
|
2946
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
2947
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday)
|
|
2948
|
+
};
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
/**
|
|
2952
|
+
* Returns the months to show in the dropdown.
|
|
2953
|
+
*
|
|
2954
|
+
* This function generates a list of months for the current year, formatted
|
|
2955
|
+
* using the provided formatter, and determines whether each month should be
|
|
2956
|
+
* disabled based on the navigation range.
|
|
2957
|
+
*
|
|
2958
|
+
* @param displayMonth The currently displayed month.
|
|
2959
|
+
* @param navStart The start date for navigation.
|
|
2960
|
+
* @param navEnd The end date for navigation.
|
|
2961
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
2962
|
+
* @param dateLib The date library to use for date manipulation.
|
|
2963
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
2964
|
+
* if no months are available.
|
|
2965
|
+
*/ function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
2966
|
+
const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth } = dateLib;
|
|
2967
|
+
const months = eachMonthOfInterval({
|
|
2968
|
+
start: startOfYear(displayMonth),
|
|
2969
|
+
end: endOfYear(displayMonth)
|
|
2970
|
+
});
|
|
2971
|
+
const options = months.map((month)=>{
|
|
2972
|
+
const label = formatters.formatMonthDropdown(month, dateLib);
|
|
2973
|
+
const value = getMonth(month);
|
|
2974
|
+
const disabled = navStart && month < startOfMonth(navStart) || navEnd && month > startOfMonth(navEnd) || false;
|
|
2975
|
+
return {
|
|
2976
|
+
value,
|
|
2977
|
+
label,
|
|
2978
|
+
disabled
|
|
2979
|
+
};
|
|
2980
|
+
});
|
|
2981
|
+
return options;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
/**
|
|
2985
|
+
* Returns the computed style for a day based on its modifiers.
|
|
2986
|
+
*
|
|
2987
|
+
* This function merges the base styles for the day with any styles associated
|
|
2988
|
+
* with active modifiers.
|
|
2989
|
+
*
|
|
2990
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
2991
|
+
* @param styles The base styles for the calendar elements.
|
|
2992
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
2993
|
+
* @returns The computed style for the day.
|
|
2994
|
+
*/ function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
2995
|
+
let style = {
|
|
2996
|
+
...styles?.[UI.Day]
|
|
2997
|
+
};
|
|
2998
|
+
Object.entries(dayModifiers).filter(([, active])=>active === true).forEach(([modifier])=>{
|
|
2999
|
+
style = {
|
|
3000
|
+
...style,
|
|
3001
|
+
...modifiersStyles?.[modifier]
|
|
3002
|
+
};
|
|
3003
|
+
});
|
|
3004
|
+
return style;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
/**
|
|
3008
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
3009
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
3010
|
+
*
|
|
3011
|
+
* @param dateLib The date library to use for date manipulation.
|
|
3012
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
3013
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
3014
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
3015
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
3016
|
+
*/ function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
3017
|
+
const referenceToday = today ?? dateLib.today();
|
|
3018
|
+
const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
|
|
3019
|
+
const days = [];
|
|
3020
|
+
for(let i = 0; i < 7; i++){
|
|
3021
|
+
const day = dateLib.addDays(start, i);
|
|
3022
|
+
days.push(day);
|
|
3023
|
+
}
|
|
3024
|
+
return days;
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* Returns the years to display in the dropdown.
|
|
3029
|
+
*
|
|
3030
|
+
* This function generates a list of years between the navigation start and end
|
|
3031
|
+
* dates, formatted using the provided formatter.
|
|
3032
|
+
*
|
|
3033
|
+
* @param navStart The start date for navigation.
|
|
3034
|
+
* @param navEnd The end date for navigation.
|
|
3035
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
3036
|
+
* @param dateLib The date library to use for date manipulation.
|
|
3037
|
+
* @param reverse If true, reverses the order of the years (descending).
|
|
3038
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
3039
|
+
* if `navStart` or `navEnd` is not provided.
|
|
3040
|
+
*/ function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
|
|
3041
|
+
if (!navStart) return undefined;
|
|
3042
|
+
if (!navEnd) return undefined;
|
|
3043
|
+
const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
|
|
3044
|
+
const firstNavYear = startOfYear(navStart);
|
|
3045
|
+
const lastNavYear = endOfYear(navEnd);
|
|
3046
|
+
const years = eachYearOfInterval({
|
|
3047
|
+
start: firstNavYear,
|
|
3048
|
+
end: lastNavYear
|
|
3049
|
+
});
|
|
3050
|
+
if (reverse) years.reverse();
|
|
3051
|
+
return years.map((year)=>{
|
|
3052
|
+
const label = formatters.formatYearDropdown(year, dateLib);
|
|
3053
|
+
return {
|
|
3054
|
+
value: getYear(year),
|
|
3055
|
+
label,
|
|
3056
|
+
disabled: false
|
|
3057
|
+
};
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
|
|
3061
|
+
/**
|
|
3062
|
+
* Creates `dateLib` overrides that keep all calendar math at noon in the target
|
|
3063
|
+
* time zone. This avoids second-level offset changes (e.g., historical zones
|
|
3064
|
+
* with +03:41:12) from pushing dates backward across midnight.
|
|
3065
|
+
*/ function createNoonOverrides(timeZone, options = {}) {
|
|
3066
|
+
const { weekStartsOn, locale } = options;
|
|
3067
|
+
const fallbackWeekStartsOn = weekStartsOn ?? locale?.options?.weekStartsOn ?? 0;
|
|
3068
|
+
// Keep all internal math anchored at noon in the target zone to avoid
|
|
3069
|
+
// historical second-level offsets from crossing midnight.
|
|
3070
|
+
const toNoonTZDate = (date)=>{
|
|
3071
|
+
const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
|
|
3072
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
3073
|
+
};
|
|
3074
|
+
// Convert a value into a host `Date` that represents the same calendar day
|
|
3075
|
+
// as the target-zone noon. This is useful for helpers (e.g., date-fns week
|
|
3076
|
+
// utilities) that expect local `Date` instances rather than `TZDate`s.
|
|
3077
|
+
const toCalendarDate = (date)=>{
|
|
3078
|
+
const zoned = toNoonTZDate(date);
|
|
3079
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
3080
|
+
};
|
|
3081
|
+
return {
|
|
3082
|
+
today: ()=>{
|
|
3083
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
3084
|
+
},
|
|
3085
|
+
newDate: (year, monthIndex, date)=>{
|
|
3086
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
3087
|
+
},
|
|
3088
|
+
startOfDay: (date)=>{
|
|
3089
|
+
return toNoonTZDate(date);
|
|
3090
|
+
},
|
|
3091
|
+
startOfWeek: (date, options)=>{
|
|
3092
|
+
const base = toNoonTZDate(date);
|
|
3093
|
+
const weekStartsOnValue = options?.weekStartsOn ?? fallbackWeekStartsOn;
|
|
3094
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
3095
|
+
base.setDate(base.getDate() - diff);
|
|
3096
|
+
return base;
|
|
3097
|
+
},
|
|
3098
|
+
startOfISOWeek: (date)=>{
|
|
3099
|
+
const base = toNoonTZDate(date);
|
|
3100
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
3101
|
+
base.setDate(base.getDate() - diff);
|
|
3102
|
+
return base;
|
|
3103
|
+
},
|
|
3104
|
+
startOfMonth: (date)=>{
|
|
3105
|
+
const base = toNoonTZDate(date);
|
|
3106
|
+
base.setDate(1);
|
|
3107
|
+
return base;
|
|
3108
|
+
},
|
|
3109
|
+
startOfYear: (date)=>{
|
|
3110
|
+
const base = toNoonTZDate(date);
|
|
3111
|
+
base.setMonth(0, 1);
|
|
3112
|
+
return base;
|
|
3113
|
+
},
|
|
3114
|
+
endOfWeek: (date, options)=>{
|
|
3115
|
+
const base = toNoonTZDate(date);
|
|
3116
|
+
const weekStartsOnValue = options?.weekStartsOn ?? fallbackWeekStartsOn;
|
|
3117
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
3118
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
3119
|
+
base.setDate(base.getDate() + diff);
|
|
3120
|
+
return base;
|
|
3121
|
+
},
|
|
3122
|
+
endOfISOWeek: (date)=>{
|
|
3123
|
+
const base = toNoonTZDate(date);
|
|
3124
|
+
const diff = (7 - base.getDay()) % 7;
|
|
3125
|
+
base.setDate(base.getDate() + diff);
|
|
3126
|
+
return base;
|
|
3127
|
+
},
|
|
3128
|
+
endOfMonth: (date)=>{
|
|
3129
|
+
const base = toNoonTZDate(date);
|
|
3130
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
3131
|
+
return base;
|
|
3132
|
+
},
|
|
3133
|
+
endOfYear: (date)=>{
|
|
3134
|
+
const base = toNoonTZDate(date);
|
|
3135
|
+
base.setMonth(11, 31);
|
|
3136
|
+
return base;
|
|
3137
|
+
},
|
|
3138
|
+
eachMonthOfInterval: (interval)=>{
|
|
3139
|
+
const start = toNoonTZDate(interval.start);
|
|
3140
|
+
const end = toNoonTZDate(interval.end);
|
|
3141
|
+
const result = [];
|
|
3142
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
3143
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
3144
|
+
while(cursor.getFullYear() * 12 + cursor.getMonth() <= endKey){
|
|
3145
|
+
result.push(new TZDate(cursor, timeZone));
|
|
3146
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
3147
|
+
}
|
|
3148
|
+
return result;
|
|
3149
|
+
},
|
|
3150
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
3151
|
+
// mutate the same TZDate, and return it.
|
|
3152
|
+
addDays: (date, amount)=>{
|
|
3153
|
+
const base = toNoonTZDate(date);
|
|
3154
|
+
base.setDate(base.getDate() + amount);
|
|
3155
|
+
return base;
|
|
3156
|
+
},
|
|
3157
|
+
addWeeks: (date, amount)=>{
|
|
3158
|
+
const base = toNoonTZDate(date);
|
|
3159
|
+
base.setDate(base.getDate() + amount * 7);
|
|
3160
|
+
return base;
|
|
3161
|
+
},
|
|
3162
|
+
addMonths: (date, amount)=>{
|
|
3163
|
+
const base = toNoonTZDate(date);
|
|
3164
|
+
base.setMonth(base.getMonth() + amount);
|
|
3165
|
+
return base;
|
|
3166
|
+
},
|
|
3167
|
+
addYears: (date, amount)=>{
|
|
3168
|
+
const base = toNoonTZDate(date);
|
|
3169
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
3170
|
+
return base;
|
|
3171
|
+
},
|
|
3172
|
+
eachYearOfInterval: (interval)=>{
|
|
3173
|
+
const start = toNoonTZDate(interval.start);
|
|
3174
|
+
const end = toNoonTZDate(interval.end);
|
|
3175
|
+
const years = [];
|
|
3176
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
3177
|
+
while(cursor.getFullYear() <= end.getFullYear()){
|
|
3178
|
+
years.push(new TZDate(cursor, timeZone));
|
|
3179
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
3180
|
+
}
|
|
3181
|
+
return years;
|
|
3182
|
+
},
|
|
3183
|
+
getWeek: (date, options)=>{
|
|
3184
|
+
const base = toCalendarDate(date);
|
|
3185
|
+
return getWeek(base, {
|
|
3186
|
+
weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
|
|
3187
|
+
firstWeekContainsDate: options?.firstWeekContainsDate ?? locale?.options?.firstWeekContainsDate ?? 1
|
|
3188
|
+
});
|
|
3189
|
+
},
|
|
3190
|
+
getISOWeek: (date)=>{
|
|
3191
|
+
const base = toCalendarDate(date);
|
|
3192
|
+
return getISOWeek(base);
|
|
3193
|
+
},
|
|
3194
|
+
differenceInCalendarDays: (dateLeft, dateRight)=>{
|
|
3195
|
+
const left = toCalendarDate(dateLeft);
|
|
3196
|
+
const right = toCalendarDate(dateRight);
|
|
3197
|
+
return differenceInCalendarDays(left, right);
|
|
3198
|
+
},
|
|
3199
|
+
differenceInCalendarMonths: (dateLeft, dateRight)=>{
|
|
3200
|
+
const left = toCalendarDate(dateLeft);
|
|
3201
|
+
const right = toCalendarDate(dateRight);
|
|
3202
|
+
return differenceInCalendarMonths(left, right);
|
|
3203
|
+
}
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
|
|
2954
3207
|
const asHtmlElement = (element)=>{
|
|
2955
3208
|
if (element instanceof HTMLElement) return element;
|
|
2956
3209
|
return null;
|
|
@@ -3114,15 +3367,16 @@ const queryWeekdaysEl = (element)=>asHtmlElement(element.querySelector("[data-an
|
|
|
3114
3367
|
const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};
|
|
3115
3368
|
const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;
|
|
3116
3369
|
const startWeekFirstDate = broadcastCalendar ? startOfBroadcastWeek(firstMonth, dateLib) : ISOWeek ? startOfISOWeek(firstMonth) : startOfWeek(firstMonth);
|
|
3117
|
-
const
|
|
3118
|
-
|
|
3370
|
+
const displayMonthsWeekEnd = broadcastCalendar ? endOfBroadcastWeek(lastMonth) : ISOWeek ? endOfISOWeek(endOfMonth(lastMonth)) : endOfWeek(endOfMonth(lastMonth));
|
|
3371
|
+
// If maxDate is set, clamp the grid to the end of that week.
|
|
3372
|
+
const constraintWeekEnd = maxDate && (broadcastCalendar ? endOfBroadcastWeek(maxDate) : ISOWeek ? endOfISOWeek(maxDate) : endOfWeek(maxDate));
|
|
3373
|
+
// Pick the earliest week end between the displayed months and the constraint.
|
|
3374
|
+
const gridEndDate = constraintWeekEnd && isAfter(displayMonthsWeekEnd, constraintWeekEnd) ? constraintWeekEnd : displayMonthsWeekEnd;
|
|
3375
|
+
const nOfDays = differenceInCalendarDays(gridEndDate, startWeekFirstDate);
|
|
3119
3376
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
|
3120
3377
|
const dates = [];
|
|
3121
3378
|
for(let i = 0; i <= nOfDays; i++){
|
|
3122
3379
|
const date = addDays(startWeekFirstDate, i);
|
|
3123
|
-
if (maxDate && isAfter(date, maxDate)) {
|
|
3124
|
-
break;
|
|
3125
|
-
}
|
|
3126
3380
|
dates.push(date);
|
|
3127
3381
|
}
|
|
3128
3382
|
// If fixed weeks is enabled, add the extra dates to the array
|
|
@@ -3430,13 +3684,47 @@ const queryWeekdaysEl = (element)=>asHtmlElement(element.querySelector("[data-an
|
|
|
3430
3684
|
}, [
|
|
3431
3685
|
props.timeZone
|
|
3432
3686
|
]);
|
|
3433
|
-
/** The months displayed in the calendar. */
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3687
|
+
/** The months displayed in the calendar. */ // biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
3688
|
+
const { months, weeks, days, previousMonth, nextMonth } = useMemo(()=>{
|
|
3689
|
+
const displayMonths = getDisplayMonths(firstMonth, navEnd, {
|
|
3690
|
+
numberOfMonths: props.numberOfMonths
|
|
3691
|
+
}, dateLib);
|
|
3692
|
+
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
3693
|
+
ISOWeek: props.ISOWeek,
|
|
3694
|
+
fixedWeeks: props.fixedWeeks,
|
|
3695
|
+
broadcastCalendar: props.broadcastCalendar
|
|
3696
|
+
}, dateLib);
|
|
3697
|
+
const months = getMonths(displayMonths, dates, {
|
|
3698
|
+
broadcastCalendar: props.broadcastCalendar,
|
|
3699
|
+
fixedWeeks: props.fixedWeeks,
|
|
3700
|
+
ISOWeek: props.ISOWeek,
|
|
3701
|
+
reverseMonths: props.reverseMonths
|
|
3702
|
+
}, dateLib);
|
|
3703
|
+
const weeks = getWeeks(months);
|
|
3704
|
+
const days = getDays(months);
|
|
3705
|
+
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
3706
|
+
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
3707
|
+
return {
|
|
3708
|
+
months,
|
|
3709
|
+
weeks,
|
|
3710
|
+
days,
|
|
3711
|
+
previousMonth,
|
|
3712
|
+
nextMonth
|
|
3713
|
+
};
|
|
3714
|
+
}, [
|
|
3715
|
+
dateLib,
|
|
3716
|
+
firstMonth.getTime(),
|
|
3717
|
+
navEnd?.getTime(),
|
|
3718
|
+
navStart?.getTime(),
|
|
3719
|
+
props.disableNavigation,
|
|
3720
|
+
props.broadcastCalendar,
|
|
3721
|
+
props.endMonth?.getTime(),
|
|
3722
|
+
props.fixedWeeks,
|
|
3723
|
+
props.ISOWeek,
|
|
3724
|
+
props.numberOfMonths,
|
|
3725
|
+
props.pagedNavigation,
|
|
3726
|
+
props.reverseMonths
|
|
3727
|
+
]);
|
|
3440
3728
|
const { disableNavigation, onMonthChange } = props;
|
|
3441
3729
|
const isDayInCalendar = (day)=>weeks.some((week)=>week.days.some((d)=>d.isEqualTo(day)));
|
|
3442
3730
|
const goToMonth = (date)=>{
|
|
@@ -4042,6 +4330,72 @@ var FocusTargetPriority;
|
|
|
4042
4330
|
}
|
|
4043
4331
|
}
|
|
4044
4332
|
|
|
4333
|
+
/**
|
|
4334
|
+
* Convert a {@link Date} or {@link TZDate} instance to the given time zone.
|
|
4335
|
+
* Reuses the same instance when it is already a {@link TZDate} using the target
|
|
4336
|
+
* time zone to avoid extra allocations.
|
|
4337
|
+
*/ function toTimeZone(date, timeZone) {
|
|
4338
|
+
if (date instanceof TZDate && date.timeZone === timeZone) {
|
|
4339
|
+
return date;
|
|
4340
|
+
}
|
|
4341
|
+
return new TZDate(date, timeZone);
|
|
4342
|
+
}
|
|
4343
|
+
|
|
4344
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
4345
|
+
return toTimeZone(date, timeZone);
|
|
4346
|
+
}
|
|
4347
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
4348
|
+
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
4349
|
+
return matcher;
|
|
4350
|
+
}
|
|
4351
|
+
if (matcher instanceof Date) {
|
|
4352
|
+
return toZoneNoon(matcher, timeZone);
|
|
4353
|
+
}
|
|
4354
|
+
if (Array.isArray(matcher)) {
|
|
4355
|
+
return matcher.map((value)=>value instanceof Date ? toZoneNoon(value, timeZone) : value);
|
|
4356
|
+
}
|
|
4357
|
+
if (isDateRange(matcher)) {
|
|
4358
|
+
return {
|
|
4359
|
+
...matcher,
|
|
4360
|
+
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
4361
|
+
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to
|
|
4362
|
+
};
|
|
4363
|
+
}
|
|
4364
|
+
if (isDateInterval(matcher)) {
|
|
4365
|
+
return {
|
|
4366
|
+
before: toZoneNoon(matcher.before, timeZone),
|
|
4367
|
+
after: toZoneNoon(matcher.after, timeZone)
|
|
4368
|
+
};
|
|
4369
|
+
}
|
|
4370
|
+
if (isDateAfterType(matcher)) {
|
|
4371
|
+
return {
|
|
4372
|
+
after: toZoneNoon(matcher.after, timeZone)
|
|
4373
|
+
};
|
|
4374
|
+
}
|
|
4375
|
+
if (isDateBeforeType(matcher)) {
|
|
4376
|
+
return {
|
|
4377
|
+
before: toZoneNoon(matcher.before, timeZone)
|
|
4378
|
+
};
|
|
4379
|
+
}
|
|
4380
|
+
return matcher;
|
|
4381
|
+
}
|
|
4382
|
+
/**
|
|
4383
|
+
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
4384
|
+
*
|
|
4385
|
+
* @param matchers - The matcher or matchers to convert.
|
|
4386
|
+
* @param timeZone - The target IANA time zone.
|
|
4387
|
+
* @returns The converted matcher(s).
|
|
4388
|
+
* @group Utilities
|
|
4389
|
+
*/ function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
4390
|
+
if (!matchers) {
|
|
4391
|
+
return matchers;
|
|
4392
|
+
}
|
|
4393
|
+
if (Array.isArray(matchers)) {
|
|
4394
|
+
return matchers.map((matcher)=>convertMatcher(matcher, timeZone));
|
|
4395
|
+
}
|
|
4396
|
+
return convertMatcher(matchers, timeZone);
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4045
4399
|
/**
|
|
4046
4400
|
* Renders the DayPicker calendar component.
|
|
4047
4401
|
*
|
|
@@ -4051,58 +4405,79 @@ var FocusTargetPriority;
|
|
|
4051
4405
|
* @see https://daypicker.dev
|
|
4052
4406
|
*/ function DayPicker(initialProps) {
|
|
4053
4407
|
let props = initialProps;
|
|
4054
|
-
|
|
4408
|
+
const timeZone = props.timeZone;
|
|
4409
|
+
if (timeZone) {
|
|
4055
4410
|
props = {
|
|
4056
|
-
...initialProps
|
|
4411
|
+
...initialProps,
|
|
4412
|
+
timeZone
|
|
4057
4413
|
};
|
|
4058
4414
|
if (props.today) {
|
|
4059
|
-
props.today =
|
|
4415
|
+
props.today = toTimeZone(props.today, timeZone);
|
|
4060
4416
|
}
|
|
4061
4417
|
if (props.month) {
|
|
4062
|
-
props.month =
|
|
4418
|
+
props.month = toTimeZone(props.month, timeZone);
|
|
4063
4419
|
}
|
|
4064
4420
|
if (props.defaultMonth) {
|
|
4065
|
-
props.defaultMonth =
|
|
4421
|
+
props.defaultMonth = toTimeZone(props.defaultMonth, timeZone);
|
|
4066
4422
|
}
|
|
4067
4423
|
if (props.startMonth) {
|
|
4068
|
-
props.startMonth =
|
|
4424
|
+
props.startMonth = toTimeZone(props.startMonth, timeZone);
|
|
4069
4425
|
}
|
|
4070
4426
|
if (props.endMonth) {
|
|
4071
|
-
props.endMonth =
|
|
4427
|
+
props.endMonth = toTimeZone(props.endMonth, timeZone);
|
|
4072
4428
|
}
|
|
4073
4429
|
if (props.mode === "single" && props.selected) {
|
|
4074
|
-
props.selected =
|
|
4430
|
+
props.selected = toTimeZone(props.selected, timeZone);
|
|
4075
4431
|
} else if (props.mode === "multiple" && props.selected) {
|
|
4076
|
-
props.selected = props.selected?.map((date)=>
|
|
4432
|
+
props.selected = props.selected?.map((date)=>toTimeZone(date, timeZone));
|
|
4077
4433
|
} else if (props.mode === "range" && props.selected) {
|
|
4078
4434
|
props.selected = {
|
|
4079
|
-
from: props.selected.from ?
|
|
4080
|
-
to: props.selected.to ?
|
|
4435
|
+
from: props.selected.from ? toTimeZone(props.selected.from, timeZone) : props.selected.from,
|
|
4436
|
+
to: props.selected.to ? toTimeZone(props.selected.to, timeZone) : props.selected.to
|
|
4081
4437
|
};
|
|
4082
4438
|
}
|
|
4439
|
+
if (props.disabled !== undefined) {
|
|
4440
|
+
props.disabled = convertMatchersToTimeZone(props.disabled, timeZone);
|
|
4441
|
+
}
|
|
4442
|
+
if (props.hidden !== undefined) {
|
|
4443
|
+
props.hidden = convertMatchersToTimeZone(props.hidden, timeZone);
|
|
4444
|
+
}
|
|
4445
|
+
if (props.modifiers) {
|
|
4446
|
+
const nextModifiers = {};
|
|
4447
|
+
Object.keys(props.modifiers).forEach((key)=>{
|
|
4448
|
+
nextModifiers[key] = convertMatchersToTimeZone(props.modifiers?.[key], timeZone);
|
|
4449
|
+
});
|
|
4450
|
+
props.modifiers = nextModifiers;
|
|
4451
|
+
}
|
|
4083
4452
|
}
|
|
4084
4453
|
const { components, formatters, labels, dateLib, locale, classNames } = useMemo(()=>{
|
|
4085
4454
|
const locale = {
|
|
4086
4455
|
...enUS,
|
|
4087
4456
|
...props.locale
|
|
4088
4457
|
};
|
|
4458
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
4459
|
+
const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
|
|
4460
|
+
weekStartsOn,
|
|
4461
|
+
locale
|
|
4462
|
+
}) : undefined;
|
|
4463
|
+
const overrides = props.dateLib && noonOverrides ? {
|
|
4464
|
+
...noonOverrides,
|
|
4465
|
+
...props.dateLib
|
|
4466
|
+
} : props.dateLib ?? noonOverrides;
|
|
4089
4467
|
const dateLib = new DateLib({
|
|
4090
4468
|
locale,
|
|
4091
|
-
weekStartsOn
|
|
4469
|
+
weekStartsOn,
|
|
4092
4470
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
4093
4471
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
4094
4472
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
4095
4473
|
timeZone: props.timeZone,
|
|
4096
4474
|
numerals: props.numerals
|
|
4097
|
-
},
|
|
4475
|
+
}, overrides);
|
|
4098
4476
|
return {
|
|
4099
4477
|
dateLib,
|
|
4100
4478
|
components: getComponents(props.components),
|
|
4101
4479
|
formatters: getFormatters(props.formatters),
|
|
4102
|
-
labels:
|
|
4103
|
-
...defaultLabels,
|
|
4104
|
-
...props.labels
|
|
4105
|
-
},
|
|
4480
|
+
labels: getLabels(props.labels, dateLib.options),
|
|
4106
4481
|
locale,
|
|
4107
4482
|
classNames: {
|
|
4108
4483
|
...getDefaultClassNames(),
|
|
@@ -4119,11 +4494,18 @@ var FocusTargetPriority;
|
|
|
4119
4494
|
props.timeZone,
|
|
4120
4495
|
props.numerals,
|
|
4121
4496
|
props.dateLib,
|
|
4497
|
+
props.noonSafe,
|
|
4122
4498
|
props.components,
|
|
4123
4499
|
props.formatters,
|
|
4124
4500
|
props.labels,
|
|
4125
4501
|
props.classNames
|
|
4126
4502
|
]);
|
|
4503
|
+
if (!props.today) {
|
|
4504
|
+
props = {
|
|
4505
|
+
...props,
|
|
4506
|
+
today: dateLib.today()
|
|
4507
|
+
};
|
|
4508
|
+
}
|
|
4127
4509
|
const { captionLayout, mode, navLayout, numberOfMonths = 1, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;
|
|
4128
4510
|
const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown } = formatters;
|
|
4129
4511
|
const calendar = useCalendar(props, dateLib);
|
|
@@ -4132,9 +4514,11 @@ var FocusTargetPriority;
|
|
|
4132
4514
|
const { isSelected, select, selected: selectedValue } = useSelection(props, dateLib) ?? {};
|
|
4133
4515
|
const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (()=>false), dateLib);
|
|
4134
4516
|
const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelPrevious, labelNext, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } = labels;
|
|
4135
|
-
const weekdays = useMemo(()=>getWeekdays(dateLib, props.ISOWeek), [
|
|
4517
|
+
const weekdays = useMemo(()=>getWeekdays(dateLib, props.ISOWeek, props.broadcastCalendar, props.today), [
|
|
4136
4518
|
dateLib,
|
|
4137
|
-
props.ISOWeek
|
|
4519
|
+
props.ISOWeek,
|
|
4520
|
+
props.broadcastCalendar,
|
|
4521
|
+
props.today
|
|
4138
4522
|
]);
|
|
4139
4523
|
const isInteractive = mode !== undefined || onDayClick !== undefined;
|
|
4140
4524
|
const handlePreviousClick = useCallback(()=>{
|
|
@@ -4159,6 +4543,9 @@ var FocusTargetPriority;
|
|
|
4159
4543
|
e.preventDefault();
|
|
4160
4544
|
e.stopPropagation();
|
|
4161
4545
|
setFocused(day);
|
|
4546
|
+
if (m.disabled) {
|
|
4547
|
+
return;
|
|
4548
|
+
}
|
|
4162
4549
|
select?.(day.date, m, e);
|
|
4163
4550
|
onDayClick?.(day.date, m, e);
|
|
4164
4551
|
}, [
|
|
@@ -4401,8 +4788,7 @@ var FocusTargetPriority;
|
|
|
4401
4788
|
whiteSpace: "nowrap",
|
|
4402
4789
|
wordWrap: "normal"
|
|
4403
4790
|
}
|
|
4404
|
-
}, formatCaption(calendarMonth.date, dateLib.options, dateLib))) :
|
|
4405
|
-
React__default.createElement(components.CaptionLabel, {
|
|
4791
|
+
}, formatCaption(calendarMonth.date, dateLib.options, dateLib))) : React__default.createElement(components.CaptionLabel, {
|
|
4406
4792
|
className: classNames[UI.CaptionLabel],
|
|
4407
4793
|
role: "status",
|
|
4408
4794
|
"aria-live": "polite"
|
|
@@ -4458,8 +4844,7 @@ var FocusTargetPriority;
|
|
|
4458
4844
|
key: week.weekNumber,
|
|
4459
4845
|
style: styles?.[UI.Week],
|
|
4460
4846
|
week: week
|
|
4461
|
-
}, showWeekNumber &&
|
|
4462
|
-
React__default.createElement(components.WeekNumber, {
|
|
4847
|
+
}, showWeekNumber && React__default.createElement(components.WeekNumber, {
|
|
4463
4848
|
week: week,
|
|
4464
4849
|
style: styles?.[UI.WeekNumber],
|
|
4465
4850
|
"aria-label": labelWeekNumber(week.weekNumber, {
|
|
@@ -4483,9 +4868,8 @@ var FocusTargetPriority;
|
|
|
4483
4868
|
const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
|
|
4484
4869
|
const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
|
|
4485
4870
|
const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell(date, modifiers, dateLib.options, dateLib) : undefined;
|
|
4486
|
-
return(
|
|
4487
|
-
|
|
4488
|
-
key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`,
|
|
4871
|
+
return React__default.createElement(components.Day, {
|
|
4872
|
+
key: `${day.isoDate}_${day.displayMonthId}`,
|
|
4489
4873
|
day: day,
|
|
4490
4874
|
modifiers: modifiers,
|
|
4491
4875
|
className: className.join(" "),
|
|
@@ -4493,8 +4877,8 @@ var FocusTargetPriority;
|
|
|
4493
4877
|
role: "gridcell",
|
|
4494
4878
|
"aria-selected": modifiers.selected || undefined,
|
|
4495
4879
|
"aria-label": ariaLabel,
|
|
4496
|
-
"data-day":
|
|
4497
|
-
"data-month": day.outside ?
|
|
4880
|
+
"data-day": day.isoDate,
|
|
4881
|
+
"data-month": day.outside ? day.dateMonthId : undefined,
|
|
4498
4882
|
"data-selected": modifiers.selected || undefined,
|
|
4499
4883
|
"data-disabled": modifiers.disabled || undefined,
|
|
4500
4884
|
"data-hidden": modifiers.hidden || undefined,
|
|
@@ -4507,7 +4891,8 @@ var FocusTargetPriority;
|
|
|
4507
4891
|
type: "button",
|
|
4508
4892
|
day: day,
|
|
4509
4893
|
modifiers: modifiers,
|
|
4510
|
-
disabled: modifiers.disabled || undefined,
|
|
4894
|
+
disabled: !modifiers.focused && modifiers.disabled || undefined,
|
|
4895
|
+
"aria-disabled": modifiers.focused && modifiers.disabled || undefined,
|
|
4511
4896
|
tabIndex: isFocusTarget(day) ? 0 : -1,
|
|
4512
4897
|
"aria-label": labelDayButton(date, modifiers, dateLib.options, dateLib),
|
|
4513
4898
|
onClick: handleDayClick(day, modifiers),
|
|
@@ -4516,11 +4901,10 @@ var FocusTargetPriority;
|
|
|
4516
4901
|
onKeyDown: handleDayKeyDown(day, modifiers),
|
|
4517
4902
|
onMouseEnter: handleDayMouseEnter(day, modifiers),
|
|
4518
4903
|
onMouseLeave: handleDayMouseLeave(day, modifiers)
|
|
4519
|
-
}, formatDay(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay(day.date, dateLib.options, dateLib))
|
|
4904
|
+
}, formatDay(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay(day.date, dateLib.options, dateLib));
|
|
4520
4905
|
}));
|
|
4521
4906
|
}))));
|
|
4522
|
-
})), props.footer &&
|
|
4523
|
-
React__default.createElement(components.Footer, {
|
|
4907
|
+
})), props.footer && React__default.createElement(components.Footer, {
|
|
4524
4908
|
className: classNames[UI.Footer],
|
|
4525
4909
|
style: styles?.[UI.Footer],
|
|
4526
4910
|
role: "status",
|
|
@@ -4635,4 +5019,4 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
4635
5019
|
}
|
|
4636
5020
|
|
|
4637
5021
|
export { Calendar as C, CalendarDayButton as a, addMonths as b };
|
|
4638
|
-
//# sourceMappingURL=calendar-
|
|
5022
|
+
//# sourceMappingURL=calendar-Co99lCn4.mjs.map
|