@commercetools/nimbus 0.0.0-canary-20250919154858 → 0.0.0-canary-20250922152719
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.d.ts +2 -2
- package/dist/chunks/{accordion-CyaEB05t.es.js → accordion-CSSdv9jZ.es.js} +2 -2
- package/dist/chunks/{accordion-CyaEB05t.es.js.map → accordion-CSSdv9jZ.es.js.map} +1 -1
- package/dist/chunks/{accordion-CVM_3Y8u.cjs.js → accordion-xYvGyXy-.cjs.js} +2 -2
- package/dist/chunks/{accordion-CVM_3Y8u.cjs.js.map → accordion-xYvGyXy-.cjs.js.map} +1 -1
- package/dist/chunks/{alert-CQzbVGQM.es.js → alert-BRDuEo75.es.js} +2 -2
- package/dist/chunks/{alert-CQzbVGQM.es.js.map → alert-BRDuEo75.es.js.map} +1 -1
- package/dist/chunks/{alert-B1X_ycTY.cjs.js → alert-CWTCM8-i.cjs.js} +2 -2
- package/dist/chunks/{alert-B1X_ycTY.cjs.js.map → alert-CWTCM8-i.cjs.js.map} +1 -1
- package/dist/chunks/{button-DnZz51Rh.es.js → button-DRMpnb-1.es.js} +2 -2
- package/dist/chunks/{button-DnZz51Rh.es.js.map → button-DRMpnb-1.es.js.map} +1 -1
- package/dist/chunks/{button-RUSyHGQV.cjs.js → button-Dbf1b0F4.cjs.js} +2 -2
- package/dist/chunks/{button-RUSyHGQV.cjs.js.map → button-Dbf1b0F4.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-DhN7hRLB.cjs.js → calendar-CrTvsDQH.cjs.js} +2 -2
- package/dist/chunks/{calendar-DhN7hRLB.cjs.js.map → calendar-CrTvsDQH.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-CrxxYJd-.es.js → calendar-DnQnMOcs.es.js} +4 -4
- package/dist/chunks/{calendar-CrxxYJd-.es.js.map → calendar-DnQnMOcs.es.js.map} +1 -1
- package/dist/chunks/{checkbox-CAvlAkX5.cjs.js → checkbox-Bv0NXUyX.cjs.js} +2 -2
- package/dist/chunks/{checkbox-CAvlAkX5.cjs.js.map → checkbox-Bv0NXUyX.cjs.js.map} +1 -1
- package/dist/chunks/{checkbox-BxRZ9dqc.es.js → checkbox-CdSHDZgM.es.js} +2 -2
- package/dist/chunks/{checkbox-BxRZ9dqc.es.js.map → checkbox-CdSHDZgM.es.js.map} +1 -1
- package/dist/chunks/combobox-C9pPDZQn.cjs.js +2 -0
- package/dist/chunks/combobox-C9pPDZQn.cjs.js.map +1 -0
- package/dist/chunks/{combobox-Bjv3GWGo.es.js → combobox-Dmn2vxIz.es.js} +991 -970
- package/dist/chunks/combobox-Dmn2vxIz.es.js.map +1 -0
- package/dist/chunks/{data-table-9C4ViaHW.es.js → data-table-CBr4TLyH.es.js} +6 -6
- package/dist/chunks/{data-table-9C4ViaHW.es.js.map → data-table-CBr4TLyH.es.js.map} +1 -1
- package/dist/chunks/{data-table-BoRy4kuE.cjs.js → data-table-DIsDZ5JZ.cjs.js} +2 -2
- package/dist/chunks/{data-table-BoRy4kuE.cjs.js.map → data-table-DIsDZ5JZ.cjs.js.map} +1 -1
- package/dist/chunks/date-input-CoAPdZTG.es.js +21 -0
- package/dist/chunks/date-input-CoAPdZTG.es.js.map +1 -0
- package/dist/chunks/date-input-DYC1t1e-.cjs.js +2 -0
- package/dist/chunks/date-input-DYC1t1e-.cjs.js.map +1 -0
- package/dist/chunks/date-picker-BVrTKhZ_.es.js +219 -0
- package/dist/chunks/date-picker-BVrTKhZ_.es.js.map +1 -0
- package/dist/chunks/date-picker-_7Gh_ROw.cjs.js +2 -0
- package/dist/chunks/date-picker-_7Gh_ROw.cjs.js.map +1 -0
- package/dist/chunks/{date-range-picker-CsUWSzSC.es.js → date-range-picker-D55giMLZ.es.js} +88 -91
- package/dist/chunks/date-range-picker-D55giMLZ.es.js.map +1 -0
- package/dist/chunks/date-range-picker-D7pPpSEj.cjs.js +2 -0
- package/dist/chunks/date-range-picker-D7pPpSEj.cjs.js.map +1 -0
- package/dist/chunks/{extractStyleProps-dSQoSYg8.cjs.js → extractStyleProps-CgqRiEwd.cjs.js} +2 -2
- package/dist/chunks/{extractStyleProps-dSQoSYg8.cjs.js.map → extractStyleProps-CgqRiEwd.cjs.js.map} +1 -1
- package/dist/chunks/{extractStyleProps-lz7NzsNX.es.js → extractStyleProps-DkXeCUuq.es.js} +2 -2
- package/dist/chunks/{extractStyleProps-lz7NzsNX.es.js.map → extractStyleProps-DkXeCUuq.es.js.map} +1 -1
- package/dist/chunks/{form-field-CPPobl2Z.es.js → form-field-DMs36b56.es.js} +2 -2
- package/dist/chunks/{form-field-CPPobl2Z.es.js.map → form-field-DMs36b56.es.js.map} +1 -1
- package/dist/chunks/{form-field-BoGSJF6d.cjs.js → form-field-cwK6KNEG.cjs.js} +2 -2
- package/dist/chunks/{form-field-BoGSJF6d.cjs.js.map → form-field-cwK6KNEG.cjs.js.map} +1 -1
- package/dist/chunks/{icon-button-CiBtEF0y.cjs.js → icon-button-0GLW7WtL.cjs.js} +2 -2
- package/dist/chunks/{icon-button-CiBtEF0y.cjs.js.map → icon-button-0GLW7WtL.cjs.js.map} +1 -1
- package/dist/chunks/{icon-button-N3Uzjv8o.es.js → icon-button-C_i4ydsN.es.js} +2 -2
- package/dist/chunks/{icon-button-N3Uzjv8o.es.js.map → icon-button-C_i4ydsN.es.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-BcrMgO27.es.js → icon-toggle-button-f03QyjEE.es.js} +2 -2
- package/dist/chunks/{icon-toggle-button-BcrMgO27.es.js.map → icon-toggle-button-f03QyjEE.es.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-DeiQ7jmM.cjs.js → icon-toggle-button-tJAqRjak.cjs.js} +2 -2
- package/dist/chunks/{icon-toggle-button-DeiQ7jmM.cjs.js.map → icon-toggle-button-tJAqRjak.cjs.js.map} +1 -1
- package/dist/chunks/{index-DwjTNyza.es.js → index-CRta5Y1_.es.js} +426 -300
- package/dist/chunks/index-CRta5Y1_.es.js.map +1 -0
- package/dist/chunks/index-DX8-EG6B.cjs.js +4 -0
- package/dist/chunks/index-DX8-EG6B.cjs.js.map +1 -0
- package/dist/chunks/{menu-vAP73jq6.es.js → menu-D5UbPSbm.es.js} +3 -3
- package/dist/chunks/{menu-vAP73jq6.es.js.map → menu-D5UbPSbm.es.js.map} +1 -1
- package/dist/chunks/{menu-n9jU7SCA.cjs.js → menu-cYj3HcOe.cjs.js} +2 -2
- package/dist/chunks/{menu-n9jU7SCA.cjs.js.map → menu-cYj3HcOe.cjs.js.map} +1 -1
- package/dist/chunks/{money-input-Dkl0TJ-w.es.js → money-input-CtG9FJDJ.es.js} +4 -4
- package/dist/chunks/{money-input-Dkl0TJ-w.es.js.map → money-input-CtG9FJDJ.es.js.map} +1 -1
- package/dist/chunks/{money-input-CZkI0cQZ.cjs.js → money-input-DXpiO23i.cjs.js} +2 -2
- package/dist/chunks/{money-input-CZkI0cQZ.cjs.js.map → money-input-DXpiO23i.cjs.js.map} +1 -1
- package/dist/chunks/multiline-text-input-DZaLPY2Z.es.js +193 -0
- package/dist/chunks/multiline-text-input-DZaLPY2Z.es.js.map +1 -0
- package/dist/chunks/multiline-text-input-XW9WrmJi.cjs.js +12 -0
- package/dist/chunks/multiline-text-input-XW9WrmJi.cjs.js.map +1 -0
- package/dist/chunks/{nimbus-provider-DQ1CPSp4.cjs.js → nimbus-provider--E4ETLbz.cjs.js} +2 -2
- package/dist/chunks/{nimbus-provider-DQ1CPSp4.cjs.js.map → nimbus-provider--E4ETLbz.cjs.js.map} +1 -1
- package/dist/chunks/{nimbus-provider-CH5x7sz1.es.js → nimbus-provider-BE3QFNWW.es.js} +2 -2
- package/dist/chunks/{nimbus-provider-CH5x7sz1.es.js.map → nimbus-provider-BE3QFNWW.es.js.map} +1 -1
- package/dist/chunks/number-input-C-suceSs.cjs.js +2 -0
- package/dist/chunks/{number-input-BCyiGbGY.cjs.js.map → number-input-C-suceSs.cjs.js.map} +1 -1
- package/dist/chunks/{number-input-CjBiCFF6.es.js → number-input-COfobs8H.es.js} +347 -339
- package/dist/chunks/{number-input-CjBiCFF6.es.js.map → number-input-COfobs8H.es.js.map} +1 -1
- package/dist/chunks/{pagination-CwZAtcMm.cjs.js → pagination-BM1xkmu9.cjs.js} +2 -2
- package/dist/chunks/{pagination-CwZAtcMm.cjs.js.map → pagination-BM1xkmu9.cjs.js.map} +1 -1
- package/dist/chunks/{pagination-BYCMJoWX.es.js → pagination-C5bOKHnF.es.js} +4 -4
- package/dist/chunks/{pagination-BYCMJoWX.es.js.map → pagination-C5bOKHnF.es.js.map} +1 -1
- package/dist/chunks/password-input-BXIl-f4z.es.js +54 -0
- package/dist/chunks/password-input-BXIl-f4z.es.js.map +1 -0
- package/dist/chunks/password-input-Br-DbsF2.cjs.js +2 -0
- package/dist/chunks/password-input-Br-DbsF2.cjs.js.map +1 -0
- package/dist/chunks/{progress-bar-DhG9TG8r.es.js → progress-bar-8RZO_7Pa.es.js} +2 -2
- package/dist/chunks/{progress-bar-DhG9TG8r.es.js.map → progress-bar-8RZO_7Pa.es.js.map} +1 -1
- package/dist/chunks/{progress-bar-C9ElCIQE.cjs.js → progress-bar-CGfPZTdv.cjs.js} +2 -2
- package/dist/chunks/{progress-bar-C9ElCIQE.cjs.js.map → progress-bar-CGfPZTdv.cjs.js.map} +1 -1
- package/dist/chunks/{radio-input-CV2Am_Ol.es.js → radio-input-CBsoUt1S.es.js} +3 -3
- package/dist/chunks/{radio-input-CV2Am_Ol.es.js.map → radio-input-CBsoUt1S.es.js.map} +1 -1
- package/dist/chunks/{radio-input-A7KxF_yz.cjs.js → radio-input-D7oHngVQ.cjs.js} +2 -2
- package/dist/chunks/{radio-input-A7KxF_yz.cjs.js.map → radio-input-D7oHngVQ.cjs.js.map} +1 -1
- package/dist/chunks/{range-calendar-Dyt9IoJ_.cjs.js → range-calendar-CWkeoOzl.cjs.js} +2 -2
- package/dist/chunks/{range-calendar-Dyt9IoJ_.cjs.js.map → range-calendar-CWkeoOzl.cjs.js.map} +1 -1
- package/dist/chunks/{range-calendar-BpFwP2wF.es.js → range-calendar-ZSiCkuoX.es.js} +4 -4
- package/dist/chunks/{range-calendar-BpFwP2wF.es.js.map → range-calendar-ZSiCkuoX.es.js.map} +1 -1
- package/dist/chunks/{rich-text-input-sQtbxyfd.cjs.js → rich-text-input-CxWC-yrf.cjs.js} +2 -2
- package/dist/chunks/{rich-text-input-sQtbxyfd.cjs.js.map → rich-text-input-CxWC-yrf.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-BBVWAH5I.es.js → rich-text-input-YYPcexom.es.js} +7 -7
- package/dist/chunks/{rich-text-input-BBVWAH5I.es.js.map → rich-text-input-YYPcexom.es.js.map} +1 -1
- package/dist/chunks/{select-BvwErOqX.es.js → select-Bj9NNlBG.es.js} +156 -146
- package/dist/chunks/{select-BvwErOqX.es.js.map → select-Bj9NNlBG.es.js.map} +1 -1
- package/dist/chunks/select-DA6mGi-n.cjs.js +2 -0
- package/dist/chunks/{select-BL0Jeztf.cjs.js.map → select-DA6mGi-n.cjs.js.map} +1 -1
- package/dist/chunks/{separator-BRUFpi9l.es.js → separator-BBcK9ROS.es.js} +2 -2
- package/dist/chunks/{separator-BRUFpi9l.es.js.map → separator-BBcK9ROS.es.js.map} +1 -1
- package/dist/chunks/{separator-DKPbB_lK.cjs.js → separator-CoMx0Mmv.cjs.js} +2 -2
- package/dist/chunks/{separator-DKPbB_lK.cjs.js.map → separator-CoMx0Mmv.cjs.js.map} +1 -1
- package/dist/chunks/{split-button-B4SnFetQ.es.js → split-button-C5RRpvG-.es.js} +5 -5
- package/dist/chunks/{split-button-B4SnFetQ.es.js.map → split-button-C5RRpvG-.es.js.map} +1 -1
- package/dist/chunks/{split-button-Cs4jynee.cjs.js → split-button-DS-OCnNN.cjs.js} +2 -2
- package/dist/chunks/{split-button-Cs4jynee.cjs.js.map → split-button-DS-OCnNN.cjs.js.map} +1 -1
- package/dist/chunks/{switch-CssXPh09.es.js → switch-CaNbdCzT.es.js} +3 -3
- package/dist/chunks/{switch-CssXPh09.es.js.map → switch-CaNbdCzT.es.js.map} +1 -1
- package/dist/chunks/{switch-DAVy_DYC.cjs.js → switch-uAVIHIFM.cjs.js} +2 -2
- package/dist/chunks/{switch-DAVy_DYC.cjs.js.map → switch-uAVIHIFM.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-BJ33FcVi.cjs.js → tag-group-BfVRqsqw.cjs.js} +2 -2
- package/dist/chunks/{tag-group-BJ33FcVi.cjs.js.map → tag-group-BfVRqsqw.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-JeqOcMyb.es.js → tag-group-Bs6sb_ky.es.js} +2 -2
- package/dist/chunks/{tag-group-JeqOcMyb.es.js.map → tag-group-Bs6sb_ky.es.js.map} +1 -1
- package/dist/chunks/text-input-Bm5P6cG3.es.js +48 -0
- package/dist/chunks/text-input-Bm5P6cG3.es.js.map +1 -0
- package/dist/chunks/text-input-DgYI0-uU.cjs.js +2 -0
- package/dist/chunks/text-input-DgYI0-uU.cjs.js.map +1 -0
- package/dist/chunks/time-input-BVrf5gCi.es.js +179 -0
- package/dist/chunks/time-input-BVrf5gCi.es.js.map +1 -0
- package/dist/chunks/time-input-DOacr-Lo.cjs.js +2 -0
- package/dist/chunks/time-input-DOacr-Lo.cjs.js.map +1 -0
- package/dist/chunks/{toggle-button-DSp3s7cp.es.js → toggle-button-Bg4ygY7u.es.js} +3 -3
- package/dist/chunks/{toggle-button-DSp3s7cp.es.js.map → toggle-button-Bg4ygY7u.es.js.map} +1 -1
- package/dist/chunks/{toggle-button-BCDj-UQB.cjs.js → toggle-button-CoA46qg6.cjs.js} +2 -2
- package/dist/chunks/{toggle-button-BCDj-UQB.cjs.js.map → toggle-button-CoA46qg6.cjs.js.map} +1 -1
- package/dist/chunks/{toolbar-_QcKjeZY.es.js → toolbar-BZFjOgau.es.js} +3 -3
- package/dist/chunks/{toolbar-_QcKjeZY.es.js.map → toolbar-BZFjOgau.es.js.map} +1 -1
- package/dist/chunks/{toolbar-DSpz9u4Z.cjs.js → toolbar-CRak3D0J.cjs.js} +2 -2
- package/dist/chunks/{toolbar-DSpz9u4Z.cjs.js.map → toolbar-CRak3D0J.cjs.js.map} +1 -1
- package/dist/combobox.d.ts +26 -1
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.es.js +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.es.js +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.es.js +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.es.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.es.js +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.es.js +1 -1
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +33 -33
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/date-input.cjs +1 -1
- package/dist/components/date-input.es.js +1 -1
- package/dist/components/date-picker.cjs +1 -1
- package/dist/components/date-picker.es.js +1 -1
- package/dist/components/date-range-picker.cjs +1 -1
- package/dist/components/date-range-picker.es.js +1 -1
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.es.js +1 -1
- package/dist/components/icon-button.cjs +1 -1
- package/dist/components/icon-button.es.js +1 -1
- package/dist/components/icon-toggle-button.cjs +1 -1
- package/dist/components/icon-toggle-button.es.js +1 -1
- package/dist/components/money-input.cjs +1 -1
- package/dist/components/money-input.es.js +1 -1
- package/dist/components/multiline-text-input.cjs +1 -1
- package/dist/components/multiline-text-input.es.js +1 -1
- package/dist/components/nimbus-provider.cjs +1 -1
- package/dist/components/nimbus-provider.es.js +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.es.js +1 -1
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.es.js +1 -1
- package/dist/components/password-input.cjs +1 -1
- package/dist/components/password-input.es.js +1 -1
- package/dist/components/progress-bar.cjs +1 -1
- package/dist/components/progress-bar.es.js +1 -1
- package/dist/components/radio-input.cjs +1 -1
- package/dist/components/radio-input.es.js +1 -1
- package/dist/components/range-calendar.cjs +1 -1
- package/dist/components/range-calendar.es.js +1 -1
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/rich-text-input.es.js +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.es.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.es.js +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/split-button.es.js +1 -1
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/tag-group.cjs +1 -1
- package/dist/components/tag-group.es.js +1 -1
- package/dist/components/text-input.cjs +1 -1
- package/dist/components/text-input.es.js +1 -1
- package/dist/components/time-input.cjs +1 -1
- package/dist/components/time-input.es.js +1 -1
- package/dist/components/toggle-button.cjs +1 -1
- package/dist/components/toggle-button.es.js +1 -1
- package/dist/components/toolbar.cjs +1 -1
- package/dist/components/toolbar.es.js +1 -1
- package/dist/components.d.ts +302 -114
- package/dist/data-table.d.ts +6 -6
- package/dist/date-input.d.ts +43 -10
- package/dist/date-picker.d.ts +46 -31
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +316 -128
- package/dist/index.es.js +36 -36
- package/dist/multiline-text-input.d.ts +49 -9
- package/dist/number-input.d.ts +50 -31
- package/dist/password-input.d.ts +59 -25
- package/dist/select.d.ts +19 -2
- package/dist/text-input.d.ts +53 -21
- package/dist/time-input.d.ts +48 -12
- package/package.json +5 -5
- package/dist/chunks/combobox-Bjv3GWGo.es.js.map +0 -1
- package/dist/chunks/combobox-DFEUqaQv.cjs.js +0 -2
- package/dist/chunks/combobox-DFEUqaQv.cjs.js.map +0 -1
- package/dist/chunks/date-input-BfX4o6R4.es.js +0 -16
- package/dist/chunks/date-input-BfX4o6R4.es.js.map +0 -1
- package/dist/chunks/date-input-sKLgo0X8.cjs.js +0 -2
- package/dist/chunks/date-input-sKLgo0X8.cjs.js.map +0 -1
- package/dist/chunks/date-picker-BviqgxDx.es.js +0 -222
- package/dist/chunks/date-picker-BviqgxDx.es.js.map +0 -1
- package/dist/chunks/date-picker-STd_oI72.cjs.js +0 -2
- package/dist/chunks/date-picker-STd_oI72.cjs.js.map +0 -1
- package/dist/chunks/date-range-picker-CsUWSzSC.es.js.map +0 -1
- package/dist/chunks/date-range-picker-cA84RzN7.cjs.js +0 -2
- package/dist/chunks/date-range-picker-cA84RzN7.cjs.js.map +0 -1
- package/dist/chunks/index-DebuynT7.cjs.js +0 -4
- package/dist/chunks/index-DebuynT7.cjs.js.map +0 -1
- package/dist/chunks/index-DwjTNyza.es.js.map +0 -1
- package/dist/chunks/multiline-text-input-B9RhT0Oy.es.js +0 -118
- package/dist/chunks/multiline-text-input-B9RhT0Oy.es.js.map +0 -1
- package/dist/chunks/multiline-text-input-BGT_-xyA.cjs.js +0 -12
- package/dist/chunks/multiline-text-input-BGT_-xyA.cjs.js.map +0 -1
- package/dist/chunks/number-input-BCyiGbGY.cjs.js +0 -2
- package/dist/chunks/password-input-BkTbfljJ.cjs.js +0 -2
- package/dist/chunks/password-input-BkTbfljJ.cjs.js.map +0 -1
- package/dist/chunks/password-input-BlU2h_8U.es.js +0 -67
- package/dist/chunks/password-input-BlU2h_8U.es.js.map +0 -1
- package/dist/chunks/select-BL0Jeztf.cjs.js +0 -2
- package/dist/chunks/text-input-Bu4lGoBD.es.js +0 -18
- package/dist/chunks/text-input-Bu4lGoBD.es.js.map +0 -1
- package/dist/chunks/text-input-DtMgT0KI.cjs.js +0 -2
- package/dist/chunks/text-input-DtMgT0KI.cjs.js.map +0 -1
- package/dist/chunks/time-input-D8D26IcA.es.js +0 -130
- package/dist/chunks/time-input-D8D26IcA.es.js.map +0 -1
- package/dist/chunks/time-input-D9Xmy3YQ.cjs.js +0 -2
- package/dist/chunks/time-input-D9Xmy3YQ.cjs.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { createSlotRecipeContext as h, useRecipe as g } from "@chakra-ui/react/styled-system";
|
|
3
|
+
import { d as n } from "./index-CRta5Y1_.es.js";
|
|
4
|
+
import { $ as x, a as S, b as $ } from "./DateField-Dm2Qlhbk.es.js";
|
|
5
|
+
import { e as D } from "./extractStyleProps-DkXeCUuq.es.js";
|
|
6
|
+
import { B as I } from "./box-DuBoAZvq.es.js";
|
|
7
|
+
const { withProvider: b, withContext: t } = /* @__PURE__ */ h({
|
|
8
|
+
recipe: n
|
|
9
|
+
}), P = /* @__PURE__ */ b("div", "root"), v = /* @__PURE__ */ t("div", "leadingElement"), C = /* @__PURE__ */ t("div", "trailingElement"), E = /* @__PURE__ */ t("div", "segmentGroup"), R = /* @__PURE__ */ t("div", "segment"), w = (i) => {
|
|
10
|
+
const c = g({ recipe: n }), { leadingElement: r, trailingElement: o, ...s } = i, [a, l] = c.splitVariantProps({ ...s }), [p, d] = D(l);
|
|
11
|
+
return /* @__PURE__ */ e(P, { ...a, ...p, asChild: !0, children: /* @__PURE__ */ e(x, { ...d, children: /* @__PURE__ */ e(E, { asChild: !0, children: /* @__PURE__ */ u(f, { children: [
|
|
12
|
+
r && /* @__PURE__ */ e(v, { children: r }),
|
|
13
|
+
/* @__PURE__ */ e(I, { flexGrow: "1", asChild: !0, children: /* @__PURE__ */ e(S, { children: (m) => /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ e($, { segment: m }) }) }) }),
|
|
14
|
+
o && /* @__PURE__ */ e(C, { children: o })
|
|
15
|
+
] }) }) }) });
|
|
16
|
+
};
|
|
17
|
+
w.displayName = "DateInput";
|
|
18
|
+
export {
|
|
19
|
+
w as D
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=date-input-CoAPdZTG.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-input-CoAPdZTG.es.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateInputRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateInputRootProps\n extends HTMLChakraProps<\"div\", DateInputRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateInputSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootProps\n>(\"div\", \"root\");\n\nexport const DateInputLeadingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"leadingElement\");\n\nexport const DateInputTrailingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trailingElement\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputLeadingElementSlot,\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n DateInputTrailingElementSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { Box } from \"@/components\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const { leadingElement, trailingElement, ...rest } = props;\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps({ ...rest });\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <DateInputSegmentGroupSlot asChild>\n <>\n {leadingElement && (\n <DateInputLeadingElementSlot>\n {leadingElement}\n </DateInputLeadingElementSlot>\n )}\n <Box flexGrow=\"1\" asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </Box>\n {trailingElement && (\n <DateInputTrailingElementSlot>\n {trailingElement}\n </DateInputTrailingElementSlot>\n )}\n </>\n </DateInputSegmentGroupSlot>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","dateInputSlotRecipe","DateInputRootSlot","DateInputLeadingElementSlot","DateInputTrailingElementSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","leadingElement","trailingElement","rest","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","jsxs","Fragment","Box","DateInputField","segment","DateSegment"],"mappings":";;;;;;AAyBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAMYC,IAAoB,gBAAAJ,EAG/B,OAAO,MAAM,GAEFK,IAA8B,gBAAAJ,EAGzC,OAAO,gBAAgB,GAEZK,IAA+B,gBAAAL,EAG1C,OAAO,iBAAiB,GAKbM,IAA4B,gBAAAN,EAGvC,OAAO,cAAc,GAKVO,IAAuB,gBAAAP,EAGlC,OAAO,SAAS,GCpCLQ,IAAY,CAACC,MAA0B;AAClD,QAAMC,IAASC,EAAU,EAAE,QAAQT,GAAqB,GAClD,EAAE,gBAAAU,GAAgB,iBAAAC,GAAiB,GAAGC,MAASL,GAC/C,CAACM,GAAaC,CAAe,IAAIN,EAAO,kBAAkB,EAAE,GAAGI,GAAM,GACrE,CAACG,GAAYC,CAAe,IAAIC,EAAkBH,CAAe;AAEvE,2BACGb,GAAA,EAAmB,GAAGY,GAAc,GAAGE,GAAY,SAAO,IACzD,UAAA,gBAAAG,EAACC,GAAA,EAAW,GAAGH,GACb,UAAA,gBAAAE,EAACd,GAAA,EAA0B,SAAO,IAChC,UAAA,gBAAAgB,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAX,KACC,gBAAAQ,EAAChB,KACE,UAAAQ,EAAA,CACH;AAAA,sBAEDY,GAAA,EAAI,UAAS,KAAI,SAAO,IACvB,4BAACC,GAAA,EACE,UAAA,CAACC,MACA,gBAAAN,EAACb,GAAA,EAAqB,SAAO,IAC3B,UAAA,gBAAAa,EAACO,KAAY,SAAAD,EAAA,CAAkB,GACjC,GAEJ,EAAA,CACF;AAAA,IACCb,KACC,gBAAAO,EAACf,GAAA,EACE,UAAAQ,EAAA,CACH;AAAA,EAAA,GAEJ,EAAA,CACF,GACF,GACF;AAEJ;AAEAL,EAAU,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),s=require("@chakra-ui/react/styled-system"),o=require("./index-DX8-EG6B.cjs.js"),n=require("./DateField-rweHHCKR.cjs.js"),S=require("./extractStyleProps-CgqRiEwd.cjs.js"),g=require("./box-CWni3A32.cjs.js"),{withProvider:j,withContext:t}=s.createSlotRecipeContext({recipe:o.dateInputSlotRecipe}),I=j("div","root"),f=t("div","leadingElement"),D=t("div","trailingElement"),$=t("div","segmentGroup"),P=t("div","segment"),c=l=>{const a=s.useRecipe({recipe:o.dateInputSlotRecipe}),{leadingElement:r,trailingElement:i,...d}=l,[p,u]=a.splitVariantProps({...d}),[x,h]=S.extractStyleProps(u);return e.jsx(I,{...p,...x,asChild:!0,children:e.jsx(n.$40825cdb76e74f70$export$d9781c7894a82487,{...h,children:e.jsx($,{asChild:!0,children:e.jsxs(e.Fragment,{children:[r&&e.jsx(f,{children:r}),e.jsx(g.Box,{flexGrow:"1",asChild:!0,children:e.jsx(n.$40825cdb76e74f70$export$7edc06cf1783b30f,{children:m=>e.jsx(P,{asChild:!0,children:e.jsx(n.$40825cdb76e74f70$export$336ab7fa954c4b5f,{segment:m})})})}),i&&e.jsx(D,{children:i})]})})})})};c.displayName="DateInput";exports.DateInput=c;
|
|
2
|
+
//# sourceMappingURL=date-input-DYC1t1e-.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-input-DYC1t1e-.cjs.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DateInputRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DateInputRootProps\n extends HTMLChakraProps<\"div\", DateInputRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: dateInputSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootProps\n>(\"div\", \"root\");\n\nexport const DateInputLeadingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"leadingElement\");\n\nexport const DateInputTrailingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trailingElement\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputLeadingElementSlot,\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n DateInputTrailingElementSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { Box } from \"@/components\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const { leadingElement, trailingElement, ...rest } = props;\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps({ ...rest });\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <DateInputSegmentGroupSlot asChild>\n <>\n {leadingElement && (\n <DateInputLeadingElementSlot>\n {leadingElement}\n </DateInputLeadingElementSlot>\n )}\n <Box flexGrow=\"1\" asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </Box>\n {trailingElement && (\n <DateInputTrailingElementSlot>\n {trailingElement}\n </DateInputTrailingElementSlot>\n )}\n </>\n </DateInputSegmentGroupSlot>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","dateInputSlotRecipe","DateInputRootSlot","DateInputLeadingElementSlot","DateInputTrailingElementSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","leadingElement","trailingElement","rest","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","jsxs","Fragment","Box","DateInputField","segment","DateSegment"],"mappings":"gQAyBM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,mBACV,CAAC,EAMYC,EAAoBJ,EAG/B,MAAO,MAAM,EAEFK,EAA8BJ,EAGzC,MAAO,gBAAgB,EAEZK,EAA+BL,EAG1C,MAAO,iBAAiB,EAKbM,EAA4BN,EAGvC,MAAO,cAAc,EAKVO,EAAuBP,EAGlC,MAAO,SAAS,ECpCLQ,EAAaC,GAA0B,CAClD,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQT,EAAAA,oBAAqB,EAClD,CAAE,eAAAU,EAAgB,gBAAAC,EAAiB,GAAGC,GAASL,EAC/C,CAACM,EAAaC,CAAe,EAAIN,EAAO,kBAAkB,CAAE,GAAGI,EAAM,EACrE,CAACG,EAAYC,CAAe,EAAIC,EAAAA,kBAAkBH,CAAe,EAEvE,aACGb,EAAA,CAAmB,GAAGY,EAAc,GAAGE,EAAY,QAAO,GACzD,SAAAG,EAAAA,IAACC,EAAAA,0CAAA,CAAW,GAAGH,EACb,SAAAE,MAACd,EAAA,CAA0B,QAAO,GAChC,SAAAgB,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAX,GACCQ,EAAAA,IAAChB,GACE,SAAAQ,CAAA,CACH,QAEDY,EAAAA,IAAA,CAAI,SAAS,IAAI,QAAO,GACvB,eAACC,4CAAA,CACE,SAACC,GACAN,EAAAA,IAACb,EAAA,CAAqB,QAAO,GAC3B,SAAAa,EAAAA,IAACO,EAAAA,2CAAY,QAAAD,CAAA,CAAkB,EACjC,EAEJ,CAAA,CACF,EACCb,GACCO,EAAAA,IAACf,EAAA,CACE,SAAAQ,CAAA,CACH,CAAA,EAEJ,CAAA,CACF,EACF,EACF,CAEJ,EAEAL,EAAU,YAAc"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createSlotRecipeContext as D, useSlotRecipe as v } from "@chakra-ui/react/styled-system";
|
|
3
|
+
import { h as x } from "./index-CRta5Y1_.es.js";
|
|
4
|
+
import { Close as y, CalendarMonth as C } from "@commercetools/nimbus-icons";
|
|
5
|
+
import { b as S, c as M } from "./DatePicker-kvQcWFTq.es.js";
|
|
6
|
+
import { $ as I, a as E } from "./Dialog-BH-H4BEe.es.js";
|
|
7
|
+
import { $ as H } from "./Group-Cfixd-fh.es.js";
|
|
8
|
+
import { e as N } from "./extractStyleProps-DkXeCUuq.es.js";
|
|
9
|
+
import { B as R } from "./box-DuBoAZvq.es.js";
|
|
10
|
+
import { I as T } from "./icon-button-C_i4ydsN.es.js";
|
|
11
|
+
import { D as V } from "./date-input-CoAPdZTG.es.js";
|
|
12
|
+
import { C as w } from "./calendar-DnQnMOcs.es.js";
|
|
13
|
+
import { T as z } from "./text-DfQpupDi.es.js";
|
|
14
|
+
import { T as B } from "./time-input-BVrf5gCi.es.js";
|
|
15
|
+
import { useContext as k, useRef as $, useEffect as F } from "react";
|
|
16
|
+
import { defineMessages as j, FormattedMessage as A, useIntl as G } from "react-intl";
|
|
17
|
+
import { Flex as L } from "@chakra-ui/react/flex";
|
|
18
|
+
import { $ as P } from "./Button-CNBS3n5a.es.js";
|
|
19
|
+
import { c as O, d as q } from "./utils-BkdW_cdL.es.js";
|
|
20
|
+
import { d as W } from "./DateField-Dm2Qlhbk.es.js";
|
|
21
|
+
const { withProvider: Z, withContext: h } = /* @__PURE__ */ D({
|
|
22
|
+
recipe: x
|
|
23
|
+
}), J = /* @__PURE__ */ Z("div", "root"), K = /* @__PURE__ */ h("div", "group"), Q = /* @__PURE__ */ h("div", "popover"), U = /* @__PURE__ */ h("div", "calendar"), u = /* @__PURE__ */ j({
|
|
24
|
+
clearInput: {
|
|
25
|
+
id: "Nimbus.DatePicker.clearInput",
|
|
26
|
+
description: "aria-label for clear input button in date picker",
|
|
27
|
+
defaultMessage: "Clear input value"
|
|
28
|
+
},
|
|
29
|
+
enterTime: {
|
|
30
|
+
id: "Nimbus.DatePicker.Time.enterTime",
|
|
31
|
+
description: "aria-label for time input field in date picker",
|
|
32
|
+
defaultMessage: "Enter time"
|
|
33
|
+
},
|
|
34
|
+
enterTimeHour: {
|
|
35
|
+
id: "Nimbus.DatePicker.Time.enterTimeHour",
|
|
36
|
+
description: "aria-label for hour-only time input in date picker",
|
|
37
|
+
defaultMessage: "Enter time (hour)"
|
|
38
|
+
},
|
|
39
|
+
enterTimeHourMinute: {
|
|
40
|
+
id: "Nimbus.DatePicker.Time.enterTimeHourMinute",
|
|
41
|
+
description: "aria-label for hour and minute time input in date picker",
|
|
42
|
+
defaultMessage: "Enter time (hour and minute)"
|
|
43
|
+
},
|
|
44
|
+
enterTimeHourMinuteSecond: {
|
|
45
|
+
id: "Nimbus.DatePicker.Time.enterTimeHourMinuteSecond",
|
|
46
|
+
description: "aria-label for full time input with seconds in date picker",
|
|
47
|
+
defaultMessage: "Enter time (hour, minute, and second)"
|
|
48
|
+
},
|
|
49
|
+
startTime: {
|
|
50
|
+
id: "Nimbus.DatePicker.Time.startTime",
|
|
51
|
+
description: "Label for start time in date picker",
|
|
52
|
+
defaultMessage: "Start time"
|
|
53
|
+
}
|
|
54
|
+
}), X = ({
|
|
55
|
+
hideTimeZone: o,
|
|
56
|
+
hourCycle: r
|
|
57
|
+
}) => {
|
|
58
|
+
const a = k(S), { granularity: n, dateValue: t } = a, s = $(null), l = $(t);
|
|
59
|
+
return n === "day" ? null : (F(() => {
|
|
60
|
+
let i;
|
|
61
|
+
if (t && l.current?.compare(t) !== 0) {
|
|
62
|
+
const c = s.current, d = document.activeElement;
|
|
63
|
+
c?.contains(d) && d?.getAttribute("role") === "spinbutton" || (i = setTimeout(() => {
|
|
64
|
+
c && c.querySelector(
|
|
65
|
+
'[role="spinbutton"]'
|
|
66
|
+
)?.focus();
|
|
67
|
+
}, 50));
|
|
68
|
+
}
|
|
69
|
+
return l.current = t, () => {
|
|
70
|
+
i && clearTimeout(i);
|
|
71
|
+
};
|
|
72
|
+
}, [t]), /* @__PURE__ */ b(
|
|
73
|
+
L,
|
|
74
|
+
{
|
|
75
|
+
ref: s,
|
|
76
|
+
borderTop: "solid-25",
|
|
77
|
+
borderColor: "neutral.3",
|
|
78
|
+
py: "300",
|
|
79
|
+
px: "400",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
gap: "200",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ e(z, { textStyle: "xs", fontWeight: "500", color: "neutral.12", children: /* @__PURE__ */ e(A, { ...u.startTime }) }),
|
|
85
|
+
/* @__PURE__ */ e(
|
|
86
|
+
B,
|
|
87
|
+
{
|
|
88
|
+
slot: "timeInput",
|
|
89
|
+
variant: "ghost",
|
|
90
|
+
size: "sm",
|
|
91
|
+
hideTimeZone: o,
|
|
92
|
+
hourCycle: r
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
));
|
|
98
|
+
}, Y = ({
|
|
99
|
+
children: o
|
|
100
|
+
}) => {
|
|
101
|
+
const r = G(), a = O(P) || {}, n = k(S), t = n?.dateValue === null, { timeValue: s, setTimeValue: l, granularity: i } = n, c = a?.isDisabled, d = () => {
|
|
102
|
+
switch (i) {
|
|
103
|
+
case "hour":
|
|
104
|
+
return r.formatMessage(u.enterTimeHour);
|
|
105
|
+
case "minute":
|
|
106
|
+
return r.formatMessage(u.enterTimeHourMinute);
|
|
107
|
+
case "second":
|
|
108
|
+
return r.formatMessage(u.enterTimeHourMinuteSecond);
|
|
109
|
+
default:
|
|
110
|
+
return r.formatMessage(u.enterTime);
|
|
111
|
+
}
|
|
112
|
+
}, f = {
|
|
113
|
+
/** toggles the calendar popover */
|
|
114
|
+
calendarToggle: {
|
|
115
|
+
...a,
|
|
116
|
+
onPress: (m) => {
|
|
117
|
+
const g = document?.activeElement;
|
|
118
|
+
g && g.blur(), a.onPress?.(m);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
/** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */
|
|
122
|
+
clear: {
|
|
123
|
+
onPress: () => n?.setValue(null),
|
|
124
|
+
"aria-label": r.formatMessage(u.clearInput),
|
|
125
|
+
isDisabled: c,
|
|
126
|
+
// Hide the button when there's no value
|
|
127
|
+
style: t ? { display: "none" } : void 0,
|
|
128
|
+
"aria-hidden": t ? !0 : void 0
|
|
129
|
+
}
|
|
130
|
+
}, p = {
|
|
131
|
+
timeInput: {
|
|
132
|
+
value: s,
|
|
133
|
+
onChange: (m) => {
|
|
134
|
+
m !== null && l(m);
|
|
135
|
+
},
|
|
136
|
+
granularity: i === "day" ? void 0 : i,
|
|
137
|
+
"aria-label": d()
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return /* @__PURE__ */ e(
|
|
141
|
+
q,
|
|
142
|
+
{
|
|
143
|
+
values: [
|
|
144
|
+
[
|
|
145
|
+
P,
|
|
146
|
+
{
|
|
147
|
+
slots: f
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
[W, { slots: p }]
|
|
151
|
+
],
|
|
152
|
+
children: o
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}, _ = (o) => {
|
|
156
|
+
const {
|
|
157
|
+
size: r = "md",
|
|
158
|
+
variant: a,
|
|
159
|
+
granularity: n = "day",
|
|
160
|
+
hideTimeZone: t,
|
|
161
|
+
hourCycle: s
|
|
162
|
+
} = o, l = v({ recipe: x }), [i, c] = l.splitVariantProps(o), [d, f] = N(c), p = r === "md" ? "xs" : "2xs", m = n === "day" ? o.shouldCloseOnSelect : !1;
|
|
163
|
+
return /* @__PURE__ */ e(J, { ...i, ...d, asChild: !0, children: /* @__PURE__ */ e(
|
|
164
|
+
M,
|
|
165
|
+
{
|
|
166
|
+
...f,
|
|
167
|
+
shouldCloseOnSelect: m,
|
|
168
|
+
children: /* @__PURE__ */ b(Y, { children: [
|
|
169
|
+
/* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
|
170
|
+
V,
|
|
171
|
+
{
|
|
172
|
+
size: r,
|
|
173
|
+
variant: a,
|
|
174
|
+
width: "full",
|
|
175
|
+
hideTimeZone: t,
|
|
176
|
+
hourCycle: s,
|
|
177
|
+
trailingElement: /* @__PURE__ */ b(R, { children: [
|
|
178
|
+
/* @__PURE__ */ e(
|
|
179
|
+
T,
|
|
180
|
+
{
|
|
181
|
+
tone: "primary",
|
|
182
|
+
variant: "ghost",
|
|
183
|
+
size: p,
|
|
184
|
+
slot: "clear",
|
|
185
|
+
children: /* @__PURE__ */ e(y, {})
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ e(
|
|
189
|
+
T,
|
|
190
|
+
{
|
|
191
|
+
tone: "primary",
|
|
192
|
+
variant: "ghost",
|
|
193
|
+
size: p,
|
|
194
|
+
slot: "calendarToggle",
|
|
195
|
+
children: /* @__PURE__ */ e(C, {})
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
199
|
+
}
|
|
200
|
+
) }) }),
|
|
201
|
+
/* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(I, { placement: "bottom end", children: /* @__PURE__ */ b(E, { children: [
|
|
202
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(w, {}) }),
|
|
203
|
+
/* @__PURE__ */ e(
|
|
204
|
+
X,
|
|
205
|
+
{
|
|
206
|
+
hideTimeZone: t,
|
|
207
|
+
hourCycle: s
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
] }) }) })
|
|
211
|
+
] })
|
|
212
|
+
}
|
|
213
|
+
) });
|
|
214
|
+
};
|
|
215
|
+
_.displayName = "DatePicker";
|
|
216
|
+
export {
|
|
217
|
+
_ as D
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=date-picker-BVrTKhZ_.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-BVrTKhZ_.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DatePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatePickerRootProps\n extends HTMLChakraProps<\"div\", DatePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: datePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","datePickerSlotRecipe","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAMYC,IAAqB,gBAAAJ,EAGhC,OAAO,MAAM,GAKFK,IAAsB,gBAAAJ,EAGjC,OAAO,OAAO,GAKHK,IAAwB,gBAAAL,EAGnC,OAAO,SAAS,GAKLM,IAAyB,gBAAAN,EAGpC,OAAO,UAAU,GC1DnBO,IAAe,gBAAAC,EAAe;AAAA,EAC5B,YAAY;AAAA,IACV,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,qBAAqB;AAAA,IACnB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AA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A,mCACGqD,GAAA,EAEC,UAAA;AAAA,cAAA,gBAAAtC;AAAA,gBAACuC;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAMN;AAAA,kBACN,MAAK;AAAA,kBAEL,4BAACO,GAAA,CAAA,CAAM;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGT,gBAAAxC;AAAA,gBAACuC;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,MAAMN;AAAA,kBACN,MAAK;AAAA,kBAEL,4BAACQ,GAAA,CAAA,CAAc;AAAA,gBAAA;AAAA,cAAA;AAAA,YACjB,EAAA,CACF;AAAA,UAAA;AAAA,QAAA,GAGN,EAAA,CACF;AAAA,QACA,gBAAAzC,EAACrB,KAAsB,SAAO,IAC5B,4BAAC+D,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAA5C,EAAC6C,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA3C,EAACpB,GAAA,EACC,UAAA,gBAAAoB,EAAC4C,GAAA,CAAA,CAAS,GACZ;AAAA,UACA,gBAAA5C;AAAA,YAACjB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAqC,EAAW,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),D=require("@chakra-ui/react/styled-system"),j=require("./index-DX8-EG6B.cjs.js"),P=require("@commercetools/nimbus-icons"),x=require("./DatePicker-e_53Dtsm.cjs.js"),T=require("./Dialog-K19USc7c.cjs.js"),C=require("./Group-MdeByg6t.cjs.js"),q=require("./extractStyleProps-CgqRiEwd.cjs.js"),I=require("./box-CWni3A32.cjs.js"),S=require("./icon-button-0GLW7WtL.cjs.js"),M=require("./date-input-DYC1t1e-.cjs.js"),R=require("./calendar-CrTvsDQH.cjs.js"),E=require("./text-CCW9kDT_.cjs.js"),H=require("./time-input-DOacr-Lo.cjs.js"),f=require("react"),h=require("react-intl"),N=require("@chakra-ui/react/flex"),k=require("./Button-BtJHe9xY.cjs.js"),y=require("./utils-BHdR5Nww.cjs.js"),V=require("./DateField-rweHHCKR.cjs.js"),{withProvider:B,withContext:g}=D.createSlotRecipeContext({recipe:j.datePickerSlotRecipe}),w=B("div","root"),z=g("div","group"),F=g("div","popover"),G=g("div","calendar"),m=h.defineMessages({clearInput:{id:"Nimbus.DatePicker.clearInput",description:"aria-label for clear input button in date picker",defaultMessage:"Clear input value"},enterTime:{id:"Nimbus.DatePicker.Time.enterTime",description:"aria-label for time input field in date picker",defaultMessage:"Enter time"},enterTimeHour:{id:"Nimbus.DatePicker.Time.enterTimeHour",description:"aria-label for hour-only time input in date picker",defaultMessage:"Enter time (hour)"},enterTimeHourMinute:{id:"Nimbus.DatePicker.Time.enterTimeHourMinute",description:"aria-label for hour and minute time input in date picker",defaultMessage:"Enter time (hour and minute)"},enterTimeHourMinuteSecond:{id:"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond",description:"aria-label for full time input with seconds in date picker",defaultMessage:"Enter time (hour, minute, and second)"},startTime:{id:"Nimbus.DatePicker.Time.startTime",description:"Label for start time in date picker",defaultMessage:"Start time"}}),A=({hideTimeZone:n,hourCycle:r})=>{const s=f.useContext(x.$06d5b8ec9ee5d538$export$50a10c048fdcdee9),{granularity:o,dateValue:t}=s,a=f.useRef(null),u=f.useRef(t);return o==="day"?null:(f.useEffect(()=>{let i;if(t&&u.current?.compare(t)!==0){const c=a.current,l=document.activeElement;c?.contains(l)&&l?.getAttribute("role")==="spinbutton"||(i=setTimeout(()=>{c&&c.querySelector('[role="spinbutton"]')?.focus()},50))}return u.current=t,()=>{i&&clearTimeout(i)}},[t]),e.jsxs(N.Flex,{ref:a,borderTop:"solid-25",borderColor:"neutral.3",py:"300",px:"400",alignItems:"center",justifyContent:"center",gap:"200",children:[e.jsx(E.Text,{textStyle:"xs",fontWeight:"500",color:"neutral.12",children:e.jsx(h.FormattedMessage,{...m.startTime})}),e.jsx(H.TimeInput,{slot:"timeInput",variant:"ghost",size:"sm",hideTimeZone:n,hourCycle:r})]}))},L=({children:n})=>{const r=h.useIntl(),s=y.$64fa3d84918910a7$export$fabf2dc03a41866e(k.$d2b4bc8c273e7be6$export$24d547caef80ccd1)||{},o=f.useContext(x.$06d5b8ec9ee5d538$export$50a10c048fdcdee9),t=o?.dateValue===null,{timeValue:a,setTimeValue:u,granularity:i}=o,c=s?.isDisabled,l=()=>{switch(i){case"hour":return r.formatMessage(m.enterTimeHour);case"minute":return r.formatMessage(m.enterTimeHourMinute);case"second":return r.formatMessage(m.enterTimeHourMinuteSecond);default:return r.formatMessage(m.enterTime)}},b={calendarToggle:{...s,onPress:d=>{const $=document?.activeElement;$&&$.blur(),s.onPress?.(d)}},clear:{onPress:()=>o?.setValue(null),"aria-label":r.formatMessage(m.clearInput),isDisabled:c,style:t?{display:"none"}:void 0,"aria-hidden":t?!0:void 0}},p={timeInput:{value:a,onChange:d=>{d!==null&&u(d)},granularity:i==="day"?void 0:i,"aria-label":l()}};return e.jsx(y.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[k.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:b}],[V.$40825cdb76e74f70$export$8e17ddc448e87c1e,{slots:p}]],children:n})},v=n=>{const{size:r="md",variant:s,granularity:o="day",hideTimeZone:t,hourCycle:a}=n,u=D.useSlotRecipe({recipe:j.datePickerSlotRecipe}),[i,c]=u.splitVariantProps(n),[l,b]=q.extractStyleProps(c),p=r==="md"?"xs":"2xs",d=o==="day"?n.shouldCloseOnSelect:!1;return e.jsx(w,{...i,...l,asChild:!0,children:e.jsx(x.$06d5b8ec9ee5d538$export$5109c6dd95d8fb00,{...b,shouldCloseOnSelect:d,children:e.jsxs(L,{children:[e.jsx(z,{asChild:!0,children:e.jsx(C.$a049562f99e7db0e$export$eb2fcfdbd7ba97d4,{children:e.jsx(M.DateInput,{size:r,variant:s,width:"full",hideTimeZone:t,hourCycle:a,trailingElement:e.jsxs(I.Box,{children:[e.jsx(S.IconButton,{tone:"primary",variant:"ghost",size:p,slot:"clear",children:e.jsx(P.Close,{})}),e.jsx(S.IconButton,{tone:"primary",variant:"ghost",size:p,slot:"calendarToggle",children:e.jsx(P.CalendarMonth,{})})]})})})}),e.jsx(F,{asChild:!0,children:e.jsx(T.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:"bottom end",children:e.jsxs(T.$de32f1b87079253c$export$3ddf2d174ce01153,{children:[e.jsx(G,{children:e.jsx(R.Calendar,{})}),e.jsx(A,{hideTimeZone:t,hourCycle:a})]})})})]})})})};v.displayName="DatePicker";exports.DatePicker=v;
|
|
2
|
+
//# sourceMappingURL=date-picker-_7Gh_ROw.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker-_7Gh_ROw.cjs.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface DatePickerRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface DatePickerRootProps\n extends HTMLChakraProps<\"div\", DatePickerRecipeProps> {}\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: datePickerSlotRecipe,\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","datePickerSlotRecipe","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":"kwBAyBM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,oBACV,CAAC,EAMYC,EAAqBJ,EAGhC,MAAO,MAAM,EAKFK,EAAsBJ,EAGjC,MAAO,OAAO,EAKHK,EAAwBL,EAGnC,MAAO,SAAS,EAKLM,EAAyBN,EAGpC,MAAO,UAAU,EC1DnBO,EAAeC,iBAAe,CAC5B,WAAY,CACV,GAAI,+BACJ,YAAa,mDACb,eAAgB,mBAAA,EAElB,UAAW,CACT,GAAI,mCACJ,YAAa,iDACb,eAAgB,YAAA,EAElB,cAAe,CACb,GAAI,uCACJ,YAAa,qDACb,eAAgB,mBAAA,EAElB,oBAAqB,CACnB,GAAI,6CACJ,YAAa,2DACb,eAAgB,8BAAA,EAElB,0BAA2B,CACzB,GAAI,mDACJ,YAAa,6DACb,eAAgB,uCAAA,EAElB,UAAW,CACT,GAAI,mCACJ,YAAa,sCACb,eAAgB,YAAA,CAEpB,CAAC,EC1BYC,EAAsB,CAAC,CAClC,aAAAC,EACA,UAAAC,CACF,IAAgC,CAC9B,MAAMC,EAAkBC,EAAAA,WAAWC,2CAAsB,EACnD,CAAE,Y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