@commercetools/nimbus 2.0.1-rc4 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{DateField-DmPAxSnT.es.js → DateField-DZwn3cIj.es.js} +8 -8
- package/dist/chunks/{DateField-DmPAxSnT.es.js.map → DateField-DZwn3cIj.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-D8m8YbnD.es.js → DatePicker-B2Nf_0Sq.es.js} +6 -6
- package/dist/chunks/{DatePicker-D8m8YbnD.es.js.map → DatePicker-B2Nf_0Sq.es.js.map} +1 -1
- package/dist/chunks/{Heading-lYSFVV4F.es.js → Heading-DFiVmZUR.es.js} +2 -2
- package/dist/chunks/{Heading-lYSFVV4F.es.js.map → Heading-DFiVmZUR.es.js.map} +1 -1
- package/dist/chunks/{accordion-CKDnNkVv.es.js → accordion-CrISuCHH.es.js} +2 -2
- package/dist/chunks/accordion-CrISuCHH.es.js.map +1 -0
- package/dist/chunks/accordion-D7a9HHSH.cjs.js +2 -0
- package/dist/chunks/{accordion-B2FLWAh5.cjs.js.map → accordion-D7a9HHSH.cjs.js.map} +1 -1
- package/dist/chunks/calendar-0Tr21POc.cjs.js +2 -0
- package/dist/chunks/{calendar-V0KeNCQ3.cjs.js.map → calendar-0Tr21POc.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-BkGJAIae.es.js → calendar-okvAi9qK.es.js} +4 -4
- package/dist/chunks/{calendar-BkGJAIae.es.js.map → calendar-okvAi9qK.es.js.map} +1 -1
- package/dist/chunks/{checkbox-BB-WJdal.es.js → checkbox-Bp0eyZ6q.es.js} +2 -2
- package/dist/chunks/{checkbox-BB-WJdal.es.js.map → checkbox-Bp0eyZ6q.es.js.map} +1 -1
- package/dist/chunks/checkbox-QQkdNVJO.cjs.js +2 -0
- package/dist/chunks/{checkbox-Dod-yTj4.cjs.js.map → checkbox-QQkdNVJO.cjs.js.map} +1 -1
- package/dist/chunks/collapsible-motion-CykDlHn3.cjs.js +2 -0
- package/dist/chunks/collapsible-motion-CykDlHn3.cjs.js.map +1 -0
- package/dist/chunks/{collapsible-motion-CSrKjF8X.es.js → collapsible-motion-DPqgzRWq.es.js} +2 -2
- package/dist/chunks/collapsible-motion-DPqgzRWq.es.js.map +1 -0
- package/dist/chunks/combobox-Bntl4sYo.cjs.js +2 -0
- package/dist/chunks/{combobox-B5UxZWSX.cjs.js.map → combobox-Bntl4sYo.cjs.js.map} +1 -1
- package/dist/chunks/{combobox-D_7gr3DY.es.js → combobox-DYREbkL7.es.js} +2 -2
- package/dist/chunks/{combobox-D_7gr3DY.es.js.map → combobox-DYREbkL7.es.js.map} +1 -1
- package/dist/chunks/data-table-BhV1DJXJ.cjs.js +2 -0
- package/dist/chunks/{data-table-C51WU0Cc.cjs.js.map → data-table-BhV1DJXJ.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-ClMivKY1.es.js → data-table-TSza8b10.es.js} +4 -4
- package/dist/chunks/{data-table-ClMivKY1.es.js.map → data-table-TSza8b10.es.js.map} +1 -1
- package/dist/chunks/date-input-B84sXbjL.cjs.js +2 -0
- package/dist/chunks/date-input-B84sXbjL.cjs.js.map +1 -0
- package/dist/chunks/{date-input-B_EuP5sc.es.js → date-input-BiOdvpWz.es.js} +3 -3
- package/dist/chunks/date-input-BiOdvpWz.es.js.map +1 -0
- package/dist/chunks/date-picker-2SDD5gY9.cjs.js +2 -0
- package/dist/chunks/{date-picker-CZAoPNsT.cjs.js.map → date-picker-2SDD5gY9.cjs.js.map} +1 -1
- package/dist/chunks/{date-picker-DFpgLG1U.es.js → date-picker-EuMU6RtR.es.js} +7 -7
- package/dist/chunks/{date-picker-DFpgLG1U.es.js.map → date-picker-EuMU6RtR.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-DVuIeQQd.es.js → date-range-picker-CL-QH8BW.es.js} +7 -7
- package/dist/chunks/{date-range-picker-DVuIeQQd.es.js.map → date-range-picker-CL-QH8BW.es.js.map} +1 -1
- package/dist/chunks/date-range-picker-DmHmhMvU.cjs.js +2 -0
- package/dist/chunks/{date-range-picker-iENzosfN.cjs.js.map → date-range-picker-DmHmhMvU.cjs.js.map} +1 -1
- package/dist/chunks/{dialog-CKwC3dk3.cjs.js → dialog-BeKbQUsU.cjs.js} +2 -2
- package/dist/chunks/{dialog-CKwC3dk3.cjs.js.map → dialog-BeKbQUsU.cjs.js.map} +1 -1
- package/dist/chunks/{dialog-BwtIcIvd.es.js → dialog-C9Dn6GoU.es.js} +2 -2
- package/dist/chunks/{dialog-BwtIcIvd.es.js.map → dialog-C9Dn6GoU.es.js.map} +1 -1
- package/dist/chunks/{dialog.title-CP_ZeiK4.es.js → dialog.title-CfBfNT9q.es.js} +2 -2
- package/dist/chunks/dialog.title-CfBfNT9q.es.js.map +1 -0
- package/dist/chunks/dialog.title-CynBe3KN.cjs.js +2 -0
- package/dist/chunks/dialog.title-CynBe3KN.cjs.js.map +1 -0
- package/dist/chunks/{draggable-list-s43baxoM.es.js → draggable-list-3KlajQgQ.es.js} +3 -3
- package/dist/chunks/{draggable-list-s43baxoM.es.js.map → draggable-list-3KlajQgQ.es.js.map} +1 -1
- package/dist/chunks/{draggable-list-MGvr5-A-.cjs.js → draggable-list-uMR8JUsT.cjs.js} +2 -2
- package/dist/chunks/{draggable-list-MGvr5-A-.cjs.js.map → draggable-list-uMR8JUsT.cjs.js.map} +1 -1
- package/dist/chunks/{drawer-BJ4qvGnj.es.js → drawer-CT5qAdLo.es.js} +2 -2
- package/dist/chunks/drawer-CT5qAdLo.es.js.map +1 -0
- package/dist/chunks/drawer-vgDYdzlq.cjs.js +2 -0
- package/dist/chunks/drawer-vgDYdzlq.cjs.js.map +1 -0
- package/dist/chunks/{extractStyleProps-DYXEhLtq.es.js → extract-style-props-DYXEhLtq.es.js} +1 -1
- package/dist/chunks/extract-style-props-DYXEhLtq.es.js.map +1 -0
- package/dist/chunks/{extractStyleProps-Dk3fpLyQ.cjs.js → extract-style-props-Dk3fpLyQ.cjs.js} +1 -1
- package/dist/chunks/extract-style-props-Dk3fpLyQ.cjs.js.map +1 -0
- package/dist/chunks/{icon-toggle-button-Bi-9Obfx.es.js → icon-toggle-button-Bt_1Mdus.es.js} +2 -2
- package/dist/chunks/{icon-toggle-button-Bi-9Obfx.es.js.map → icon-toggle-button-Bt_1Mdus.es.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-eLrsWehe.cjs.js → icon-toggle-button-Bv-FwWwz.cjs.js} +2 -2
- package/dist/chunks/{icon-toggle-button-eLrsWehe.cjs.js.map → icon-toggle-button-Bv-FwWwz.cjs.js.map} +1 -1
- package/dist/chunks/{localized-field-D3G0Uy7Z.es.js → localized-field-Bp4N2Mvl.es.js} +5 -5
- package/dist/chunks/{localized-field-D3G0Uy7Z.es.js.map → localized-field-Bp4N2Mvl.es.js.map} +1 -1
- package/dist/chunks/{localized-field-C7Vribb2.cjs.js → localized-field-Cmwb6fmQ.cjs.js} +2 -2
- package/dist/chunks/{localized-field-C7Vribb2.cjs.js.map → localized-field-Cmwb6fmQ.cjs.js.map} +1 -1
- package/dist/chunks/menu-SXtkybBB.cjs.js +2 -0
- package/dist/chunks/menu-SXtkybBB.cjs.js.map +1 -0
- package/dist/chunks/{menu-D-vE6ZpM.es.js → menu-XKnGXngu.es.js} +2 -2
- package/dist/chunks/menu-XKnGXngu.es.js.map +1 -0
- package/dist/chunks/{money-input-sk0Slpeu.es.js → money-input-BqYBGLzc.es.js} +4 -4
- package/dist/chunks/{money-input-sk0Slpeu.es.js.map → money-input-BqYBGLzc.es.js.map} +1 -1
- package/dist/chunks/money-input-Cz8E18lq.cjs.js +2 -0
- package/dist/chunks/{money-input-Cu_J86Eu.cjs.js.map → money-input-Cz8E18lq.cjs.js.map} +1 -1
- package/dist/chunks/{multiline-text-input-CilSJJaO.es.js → multiline-text-input-AyyHGKY2.es.js} +2 -2
- package/dist/chunks/multiline-text-input-AyyHGKY2.es.js.map +1 -0
- package/dist/chunks/multiline-text-input-jGidPD3q.cjs.js +2 -0
- package/dist/chunks/multiline-text-input-jGidPD3q.cjs.js.map +1 -0
- package/dist/chunks/number-input-CynG_F-c.cjs.js +2 -0
- package/dist/chunks/{number-input-wMW-o4di.cjs.js.map → number-input-CynG_F-c.cjs.js.map} +1 -1
- package/dist/chunks/{number-input-CktMxOdZ.es.js → number-input-rotBI7ui.es.js} +2 -2
- package/dist/chunks/{number-input-CktMxOdZ.es.js.map → number-input-rotBI7ui.es.js.map} +1 -1
- package/dist/chunks/{pagination-BWdg8s6g.cjs.js → pagination-DdMhz-Ka.cjs.js} +2 -2
- package/dist/chunks/{pagination-BWdg8s6g.cjs.js.map → pagination-DdMhz-Ka.cjs.js.map} +1 -1
- package/dist/chunks/{pagination-Bcq69Nv3.es.js → pagination-Dqt0f5WQ.es.js} +3 -3
- package/dist/chunks/{pagination-Bcq69Nv3.es.js.map → pagination-Dqt0f5WQ.es.js.map} +1 -1
- package/dist/chunks/{password-input-6SMjhXSO.cjs.js → password-input-BVHKD6s2.cjs.js} +2 -2
- package/dist/chunks/{password-input-6SMjhXSO.cjs.js.map → password-input-BVHKD6s2.cjs.js.map} +1 -1
- package/dist/chunks/{password-input-6MO4I-2j.es.js → password-input-DRmX3C3I.es.js} +2 -2
- package/dist/chunks/{password-input-6MO4I-2j.es.js.map → password-input-DRmX3C3I.es.js.map} +1 -1
- package/dist/chunks/progress-bar-CmQaITmw.cjs.js +2 -0
- package/dist/chunks/progress-bar-CmQaITmw.cjs.js.map +1 -0
- package/dist/chunks/{progress-bar-DwuOjOcH.es.js → progress-bar-DGFMl3Vg.es.js} +2 -2
- package/dist/chunks/progress-bar-DGFMl3Vg.es.js.map +1 -0
- package/dist/chunks/radio-input-Cg5MZ21w.cjs.js +2 -0
- package/dist/chunks/{radio-input-Dp05SXja.cjs.js.map → radio-input-Cg5MZ21w.cjs.js.map} +1 -1
- package/dist/chunks/{radio-input-4jw6HUjC.es.js → radio-input-DPwU5M16.es.js} +2 -2
- package/dist/chunks/{radio-input-4jw6HUjC.es.js.map → radio-input-DPwU5M16.es.js.map} +1 -1
- package/dist/chunks/{range-calendar-D55DTDbA.es.js → range-calendar-PUt59Hda.es.js} +4 -4
- package/dist/chunks/{range-calendar-D55DTDbA.es.js.map → range-calendar-PUt59Hda.es.js.map} +1 -1
- package/dist/chunks/range-calendar-lhmomEF_.cjs.js +2 -0
- package/dist/chunks/{range-calendar-_dZfAsdG.cjs.js.map → range-calendar-lhmomEF_.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-BC8CBVio.es.js → rich-text-input-Cm0M04n-.es.js} +6 -6
- package/dist/chunks/{rich-text-input-BC8CBVio.es.js.map → rich-text-input-Cm0M04n-.es.js.map} +1 -1
- package/dist/chunks/{rich-text-input-Da5WFZ3l.cjs.js → rich-text-input-DqwZD5Di.cjs.js} +2 -2
- package/dist/chunks/{rich-text-input-Da5WFZ3l.cjs.js.map → rich-text-input-DqwZD5Di.cjs.js.map} +1 -1
- package/dist/chunks/search-input-BvJKOCVM.cjs.js +2 -0
- package/dist/chunks/{search-input-BefkmgPy.cjs.js.map → search-input-BvJKOCVM.cjs.js.map} +1 -1
- package/dist/chunks/{search-input-DJy2NHYW.es.js → search-input-C8cD1bnn.es.js} +2 -2
- package/dist/chunks/{search-input-DJy2NHYW.es.js.map → search-input-C8cD1bnn.es.js.map} +1 -1
- package/dist/chunks/select-DfuSGQSs.cjs.js +2 -0
- package/dist/chunks/{select-DMsU6bk9.cjs.js.map → select-DfuSGQSs.cjs.js.map} +1 -1
- package/dist/chunks/{select-BmMhTBo-.es.js → select-X1qJU5Yn.es.js} +2 -2
- package/dist/chunks/{select-BmMhTBo-.es.js.map → select-X1qJU5Yn.es.js.map} +1 -1
- package/dist/chunks/{separator-DJGUFG-o.es.js → separator-BHD3Ztot.es.js} +2 -2
- package/dist/chunks/separator-BHD3Ztot.es.js.map +1 -0
- package/dist/chunks/separator-FEY8A05K.cjs.js +2 -0
- package/dist/chunks/separator-FEY8A05K.cjs.js.map +1 -0
- package/dist/chunks/{split-button-BxyZmuNi.es.js → split-button-LENwoBTF.es.js} +2 -2
- package/dist/chunks/{split-button-BxyZmuNi.es.js.map → split-button-LENwoBTF.es.js.map} +1 -1
- package/dist/chunks/{split-button-BO52sL7h.cjs.js → split-button-go3Ez6Ea.cjs.js} +2 -2
- package/dist/chunks/{split-button-BO52sL7h.cjs.js.map → split-button-go3Ez6Ea.cjs.js.map} +1 -1
- package/dist/chunks/{switch-01hEhL9A.es.js → switch-BDRu376G.es.js} +2 -2
- package/dist/chunks/switch-BDRu376G.es.js.map +1 -0
- package/dist/chunks/switch-RPIMfaqs.cjs.js +2 -0
- package/dist/chunks/switch-RPIMfaqs.cjs.js.map +1 -0
- package/dist/chunks/{tabs-Dhte-RCe.es.js → tabs-BtWK-J_p.es.js} +2 -2
- package/dist/chunks/{tabs-Dhte-RCe.es.js.map → tabs-BtWK-J_p.es.js.map} +1 -1
- package/dist/chunks/tabs-CEB3Dfex.cjs.js +2 -0
- package/dist/chunks/{tabs-CJ0OAUSR.cjs.js.map → tabs-CEB3Dfex.cjs.js.map} +1 -1
- package/dist/chunks/text-input-CKGfCx6k.cjs.js +2 -0
- package/dist/chunks/text-input-CKGfCx6k.cjs.js.map +1 -0
- package/dist/chunks/{text-input-CSAODlCw.es.js → text-input-DNorjU50.es.js} +2 -2
- package/dist/chunks/text-input-DNorjU50.es.js.map +1 -0
- package/dist/chunks/{time-input-CUEnTp-4.es.js → time-input-B6we5H7C.es.js} +3 -3
- package/dist/chunks/time-input-B6we5H7C.es.js.map +1 -0
- package/dist/chunks/time-input-CweVZv1Q.cjs.js +2 -0
- package/dist/chunks/time-input-CweVZv1Q.cjs.js.map +1 -0
- package/dist/chunks/toggle-button-CLEgCPGX.cjs.js +2 -0
- package/dist/chunks/toggle-button-CLEgCPGX.cjs.js.map +1 -0
- package/dist/chunks/{toggle-button-awb1jBf8.es.js → toggle-button-D3M4e72c.es.js} +2 -2
- package/dist/chunks/toggle-button-D3M4e72c.es.js.map +1 -0
- package/dist/chunks/{toolbar-Dduysqqi.es.js → toolbar-Bn9pAwjU.es.js} +2 -2
- package/dist/chunks/toolbar-Bn9pAwjU.es.js.map +1 -0
- package/dist/chunks/toolbar-D3Jj83mp.cjs.js +2 -0
- package/dist/chunks/{toolbar-DV0l5MqA.cjs.js.map → toolbar-D3Jj83mp.cjs.js.map} +1 -1
- package/dist/chunks/{useDateFormatter-4Wq50fMI.es.js → useDateFormatter-C4zVAL_K.es.js} +3 -3
- package/dist/chunks/{useDateFormatter-4Wq50fMI.es.js.map → useDateFormatter-C4zVAL_K.es.js.map} +1 -1
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.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/collapsible-motion.cjs +1 -1
- package/dist/components/collapsible-motion.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 +1 -1
- 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/dialog.cjs +1 -1
- package/dist/components/dialog.es.js +1 -1
- package/dist/components/draggable-list.cjs +1 -1
- package/dist/components/draggable-list.es.js +1 -1
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.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/localized-field.cjs +1 -1
- package/dist/components/localized-field.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/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/scoped-search-input.cjs +1 -1
- package/dist/components/scoped-search-input.cjs.map +1 -1
- package/dist/components/scoped-search-input.es.js +3 -3
- package/dist/components/scoped-search-input.es.js.map +1 -1
- package/dist/components/search-input.cjs +1 -1
- package/dist/components/search-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/tabs.cjs +1 -1
- package/dist/components/tabs.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/index.cjs +1 -1
- package/dist/index.es.js +35 -35
- package/dist/utils/extract-aria-attributes.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -2
- package/package.json +5 -5
- package/dist/chunks/accordion-B2FLWAh5.cjs.js +0 -2
- package/dist/chunks/accordion-CKDnNkVv.es.js.map +0 -1
- package/dist/chunks/calendar-V0KeNCQ3.cjs.js +0 -2
- package/dist/chunks/checkbox-Dod-yTj4.cjs.js +0 -2
- package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js +0 -2
- package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js.map +0 -1
- package/dist/chunks/collapsible-motion-CSrKjF8X.es.js.map +0 -1
- package/dist/chunks/combobox-B5UxZWSX.cjs.js +0 -2
- package/dist/chunks/data-table-C51WU0Cc.cjs.js +0 -2
- package/dist/chunks/date-input-B_EuP5sc.es.js.map +0 -1
- package/dist/chunks/date-input-DvOM0DLT.cjs.js +0 -2
- package/dist/chunks/date-input-DvOM0DLT.cjs.js.map +0 -1
- package/dist/chunks/date-picker-CZAoPNsT.cjs.js +0 -2
- package/dist/chunks/date-range-picker-iENzosfN.cjs.js +0 -2
- package/dist/chunks/dialog.title-CP_ZeiK4.es.js.map +0 -1
- package/dist/chunks/dialog.title-DOPP47Zy.cjs.js +0 -2
- package/dist/chunks/dialog.title-DOPP47Zy.cjs.js.map +0 -1
- package/dist/chunks/drawer-BJ4qvGnj.es.js.map +0 -1
- package/dist/chunks/drawer-DzW9wBMk.cjs.js +0 -2
- package/dist/chunks/drawer-DzW9wBMk.cjs.js.map +0 -1
- package/dist/chunks/extractStyleProps-DYXEhLtq.es.js.map +0 -1
- package/dist/chunks/extractStyleProps-Dk3fpLyQ.cjs.js.map +0 -1
- package/dist/chunks/menu-D-vE6ZpM.es.js.map +0 -1
- package/dist/chunks/menu-DIepV2KZ.cjs.js +0 -2
- package/dist/chunks/menu-DIepV2KZ.cjs.js.map +0 -1
- package/dist/chunks/money-input-Cu_J86Eu.cjs.js +0 -2
- package/dist/chunks/multiline-text-input-B9TBDieZ.cjs.js +0 -2
- package/dist/chunks/multiline-text-input-B9TBDieZ.cjs.js.map +0 -1
- package/dist/chunks/multiline-text-input-CilSJJaO.es.js.map +0 -1
- package/dist/chunks/number-input-wMW-o4di.cjs.js +0 -2
- package/dist/chunks/progress-bar-Bhp7W6Eo.cjs.js +0 -2
- package/dist/chunks/progress-bar-Bhp7W6Eo.cjs.js.map +0 -1
- package/dist/chunks/progress-bar-DwuOjOcH.es.js.map +0 -1
- package/dist/chunks/radio-input-Dp05SXja.cjs.js +0 -2
- package/dist/chunks/range-calendar-_dZfAsdG.cjs.js +0 -2
- package/dist/chunks/search-input-BefkmgPy.cjs.js +0 -2
- package/dist/chunks/select-DMsU6bk9.cjs.js +0 -2
- package/dist/chunks/separator-CvRn_J0r.cjs.js +0 -2
- package/dist/chunks/separator-CvRn_J0r.cjs.js.map +0 -1
- package/dist/chunks/separator-DJGUFG-o.es.js.map +0 -1
- package/dist/chunks/switch-01hEhL9A.es.js.map +0 -1
- package/dist/chunks/switch-CdLhBEPq.cjs.js +0 -2
- package/dist/chunks/switch-CdLhBEPq.cjs.js.map +0 -1
- package/dist/chunks/tabs-CJ0OAUSR.cjs.js +0 -2
- package/dist/chunks/text-input-CSAODlCw.es.js.map +0 -1
- package/dist/chunks/text-input-DZdkCbdd.cjs.js +0 -2
- package/dist/chunks/text-input-DZdkCbdd.cjs.js.map +0 -1
- package/dist/chunks/time-input-CUEnTp-4.es.js.map +0 -1
- package/dist/chunks/time-input-zXykDANk.cjs.js +0 -2
- package/dist/chunks/time-input-zXykDANk.cjs.js.map +0 -1
- package/dist/chunks/toggle-button-DxMZsem4.cjs.js +0 -2
- package/dist/chunks/toggle-button-DxMZsem4.cjs.js.map +0 -1
- package/dist/chunks/toggle-button-awb1jBf8.es.js.map +0 -1
- package/dist/chunks/toolbar-DV0l5MqA.cjs.js +0 -2
- package/dist/chunks/toolbar-Dduysqqi.es.js.map +0 -1
- /package/dist/utils/{extractStyleProps.d.ts → extract-style-props.d.ts} +0 -0
- /package/dist/utils/{noop.d.ts → no-op.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.title-DOPP47Zy.cjs.js","sources":["../../src/components/dialog/dialog.slots.tsx","../../src/components/dialog/components/dialog.context.tsx","../../src/components/dialog/components/dialog.root.tsx","../../src/components/dialog/components/dialog.trigger.tsx","../../src/components/dialog/components/dialog.content.tsx","../../src/components/dialog/components/dialog.header.tsx","../../src/components/dialog/components/dialog.body.tsx","../../src/components/dialog/components/dialog.footer.tsx","../../src/components/dialog/dialog.i18n.ts","../../src/components/dialog/components/dialog.close-trigger.tsx","../../src/components/dialog/components/dialog.title.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n DialogBodySlotProps,\n DialogCloseTriggerSlotProps,\n DialogContentSlotProps,\n DialogFooterSlotProps,\n DialogHeaderSlotProps,\n DialogModalOverlaySlotProps,\n DialogModalSlotProps,\n DialogRootProps,\n DialogTitleSlotProps,\n DialogTriggerSlotProps,\n} from \"./dialog.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dialog\",\n});\n\n// Root slot - provides recipe context + config to all child components\nexport const DialogRootSlot = withProvider<HTMLDivElement, DialogRootProps>(\n \"div\",\n \"root\"\n);\n\n// Trigger slot - button that opens the dialog\nexport const DialogTriggerSlot = withContext<\n HTMLButtonElement,\n DialogTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Backdrop slot - overlay displayed behind the dialog\nexport const DialogModalOverlaySlot = withContext<\n HTMLDivElement,\n DialogModalOverlaySlotProps\n>(\"div\", \"modalOverlay\");\n\n// modal slot - positions the dialog content\n\nexport const DialogModalSlot = withContext<\n HTMLDivElement,\n DialogModalSlotProps\n>(\"div\", \"modal\");\n\n// Content slot - main dialog container\nexport const DialogContentSlot = withContext<\n HTMLDivElement,\n DialogContentSlotProps\n>(\"div\", \"content\");\n\n// Header slot - dialog header section\nexport const DialogHeaderSlot = withContext<HTMLElement, DialogHeaderSlotProps>(\n \"header\",\n \"header\"\n);\n\n// Body slot - dialog body content\nexport const DialogBodySlot = withContext<HTMLDivElement, DialogBodySlotProps>(\n \"div\",\n \"body\"\n);\n\n// Footer slot - dialog footer section with actions\nexport const DialogFooterSlot = withContext<HTMLElement, DialogFooterSlotProps>(\n \"footer\",\n \"footer\"\n);\n\n// Title slot - accessible dialog title\nexport const DialogTitleSlot = withContext<\n HTMLHeadingElement,\n DialogTitleSlotProps\n>(\"h2\", \"title\");\n\n// Close trigger slot - div container for positioning close button\nexport const DialogCloseTriggerSlot = withContext<\n HTMLDivElement,\n DialogCloseTriggerSlotProps\n>(\"div\", \"closeTrigger\");\n","import { createContext, useContext } from \"react\";\nimport type { DialogRootProps } from \"../dialog.types\";\n\n/**\n * Context value containing dialog configuration passed from Root to child components\n */\nexport type DialogContextValue = DialogRootProps;\n\nexport const DialogContext = createContext<DialogContextValue | undefined>(\n undefined\n);\n\n/**\n * Hook to access dialog configuration from DialogContext\n * @returns Dialog configuration from context\n * @throws Error if used outside of Dialog.Root\n */\nexport const useDialogRootContext = (): DialogContextValue => {\n const context = useContext(DialogContext);\n if (!context) {\n throw new Error(\"useDialogContext must be used within Dialog.Root\");\n }\n return context;\n};\n\n/**\n * Provider component that passes dialog configuration down to child components\n */\nexport const DialogProvider = ({\n children,\n value,\n}: {\n children: React.ReactNode;\n value: DialogContextValue;\n}) => {\n return <DialogContext value={value}>{children}</DialogContext>;\n};\n","import React from \"react\";\nimport { DialogTrigger as RaDialogTrigger } from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { DialogRootSlot } from \"../dialog.slots\";\nimport type { DialogRootProps } from \"../dialog.types\";\nimport { DialogProvider } from \"./dialog.context\";\n\nexport const DialogRoot = (props: DialogRootProps) => {\n const recipe = useSlotRecipe({ key: \"dialog\" });\n // Extract recipe props\n const [recipeProps] = recipe.splitVariantProps(props);\n // Extract props that are usable on RaDialogTrigger\n const { children, isOpen, onOpenChange, defaultOpen = false } = props;\n\n const content = <DialogRootSlot {...recipeProps}>{children}</DialogRootSlot>;\n\n // Check if any direct child is a Dialog.Trigger component\n // React Aria's DialogTrigger needs a pressable child, so we only use it when there's a trigger\n const hasDialogTrigger = React.Children.toArray(children).some((child) => {\n if (React.isValidElement(child) && typeof child.type === \"function\") {\n const displayName = (\n child.type as React.ComponentType & { displayName?: string }\n )?.displayName;\n return (\n displayName === \"DialogTrigger\" || displayName === \"Dialog.Trigger\"\n );\n }\n return false;\n });\n\n // Share all props (config + variant props) with the Dialog subcomponents\n return (\n <DialogProvider value={props}>\n {hasDialogTrigger ? (\n // When there's a Dialog.Trigger, use DialogTrigger for React Aria integration\n <RaDialogTrigger\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n defaultOpen={defaultOpen}\n >\n {content}\n </RaDialogTrigger>\n ) : (\n // When no Dialog.Trigger, skip using RaDialogTrigger to avoid console.warning's\n content\n )}\n </DialogProvider>\n );\n};\n\nDialogRoot.displayName = \"Dialog.Root\";\n","import { Button as RaButton } from \"react-aria-components\";\nimport { DialogTriggerSlot } from \"../dialog.slots\";\nimport type { DialogTriggerProps } from \"../dialog.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { chakra } from \"@chakra-ui/react/styled-system\";\n\nexport const DialogTrigger = ({\n ref: forwardedRef,\n children,\n asChild,\n ...props\n}: DialogTriggerProps) => {\n // If asChild is true, wrap children directly in RaButton with asChild\n if (asChild) {\n return (\n <chakra.button ref={forwardedRef} asChild {...props}>\n {children}\n </chakra.button>\n );\n }\n\n const [styleProps, restProps] = extractStyleProps(props);\n\n // Otherwise, wrap with both DialogTriggerSlot and RaButton\n // Only pass React Aria compatible props to avoid type conflicts\n return (\n <DialogTriggerSlot {...styleProps} asChild>\n <RaButton ref={forwardedRef} {...restProps}>\n {children}\n </RaButton>\n </DialogTriggerSlot>\n );\n};\n\nDialogTrigger.displayName = \"Dialog.Trigger\";\n","import {\n Modal as RaModal,\n ModalOverlay as RaModalOverlay,\n Dialog as RaDialog,\n} from \"react-aria-components\";\nimport {\n DialogModalOverlaySlot,\n DialogModalSlot,\n DialogContentSlot,\n} from \"../dialog.slots\";\nimport type { DialogContentProps } from \"../dialog.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useDialogRootContext } from \"./dialog.context\";\n\nexport const DialogContent = (props: DialogContentProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n // Get recipe configuration from context instead of props\n const {\n defaultOpen,\n isDismissable,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n isOpen,\n onOpenChange,\n } = useDialogRootContext();\n\n const modalProps = {\n defaultOpen,\n isDismissable,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n isOpen,\n onOpenChange,\n };\n\n const [styleProps] = extractStyleProps(restProps);\n\n return (\n <DialogModalOverlaySlot asChild>\n <RaModalOverlay {...modalProps}>\n <DialogModalSlot asChild>\n <RaModal>\n <DialogContentSlot asChild {...styleProps}>\n <RaDialog ref={forwardedRef}>{children}</RaDialog>\n </DialogContentSlot>\n </RaModal>\n </DialogModalSlot>\n </RaModalOverlay>\n </DialogModalOverlaySlot>\n );\n};\n\nDialogContent.displayName = \"Dialog.Content\";\n","import { DialogHeaderSlot } from \"../dialog.slots\";\nimport type { DialogHeaderProps } from \"../dialog.types\";\n\nexport const DialogHeader = (props: DialogHeaderProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DialogHeaderSlot ref={forwardedRef} {...restProps}>\n {children}\n </DialogHeaderSlot>\n );\n};\n\nDialogHeader.displayName = \"Dialog.Header\";\n","import { DialogBodySlot } from \"../dialog.slots\";\nimport type { DialogBodyProps } from \"../dialog.types\";\nimport { useDialogRootContext } from \"./dialog.context\";\n\nexport const DialogBody = (props: DialogBodyProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n const { scrollBehavior } = useDialogRootContext();\n\n const defaultProps = {\n /**\n * if scrollBehavior is set to \"inside\", set tabIndex to 0 to allow the body to\n * receive focus, effectively enabling scrolling via keyboard\n * arrow keys.\n */\n tabIndex: scrollBehavior === \"inside\" ? 0 : undefined,\n };\n\n return (\n <DialogBodySlot ref={forwardedRef} {...defaultProps} {...restProps}>\n {children}\n </DialogBodySlot>\n );\n};\n\nDialogBody.displayName = \"Dialog.Body\";\n","import { DialogFooterSlot } from \"../dialog.slots\";\nimport type { DialogFooterProps } from \"../dialog.types\";\n\nexport const DialogFooter = (props: DialogFooterProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DialogFooterSlot ref={forwardedRef} {...restProps}>\n {children}\n </DialogFooterSlot>\n );\n};\n\nDialogFooter.displayName = \"Dialog.Footer\";\n","import { defineMessages } from \"react-intl\";\n\nexport const messages = defineMessages({\n closeTrigger: {\n id: \"Nimbus.Dialog.closeTrigger\",\n description: \"aria-label for the default close trigger button\",\n defaultMessage: \"Close dialog\",\n },\n});\n","import { Close } from \"@commercetools/nimbus-icons\";\nimport { DialogCloseTriggerSlot } from \"../dialog.slots\";\nimport type { DialogCloseTriggerProps } from \"../dialog.types\";\nimport { IconButton } from \"@/components\";\nimport { messages } from \"../dialog.i18n\";\nimport { useIntl } from \"react-intl\";\n\nexport const DialogCloseTrigger = (props: DialogCloseTriggerProps) => {\n const { ref: forwardedRef, \"aria-label\": ariaLabel, ...restProps } = props;\n const intl = useIntl();\n\n return (\n <DialogCloseTriggerSlot>\n <IconButton\n ref={forwardedRef}\n slot=\"close\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label={ariaLabel || intl.formatMessage(messages.closeTrigger)}\n {...restProps}\n >\n <Close />\n </IconButton>\n </DialogCloseTriggerSlot>\n );\n};\n\nDialogCloseTrigger.displayName = \"Dialog.CloseTrigger\";\n","import { DialogTitleSlot } from \"../dialog.slots\";\nimport type { DialogTitleProps } from \"../dialog.types\";\nimport { Heading } from \"@/components\";\n\nexport const DialogTitle = (props: DialogTitleProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DialogTitleSlot asChild {...restProps}>\n <Heading ref={forwardedRef} slot=\"title\" as=\"h2\" textStyle=\"lg\">\n {children}\n </Heading>\n </DialogTitleSlot>\n );\n};\n\nDialogTitle.displayName = \"Dialog.Title\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DialogRootSlot","DialogTriggerSlot","DialogModalOverlaySlot","DialogModalSlot","DialogContentSlot","DialogHeaderSlot","DialogBodySlot","DialogFooterSlot","DialogTitleSlot","DialogCloseTriggerSlot","DialogContext","createContext","useDialogRootContext","context","useContext","DialogProvider","children","value","jsx","DialogRoot","props","recipe","useSlotRecipe","recipeProps","isOpen","onOpenChange","defaultOpen","content","hasDialogTrigger","React","child","displayName","RaDialogTrigger","DialogTrigger","forwardedRef","asChild","chakra","styleProps","restProps","extractStyleProps","RaButton","DialogContent","isDismissable","isKeyboardDismissDisabled","shouldCloseOnInteractOutside","modalProps","RaModalOverlay","RaModal","RaDialog","DialogHeader","DialogBody","scrollBehavior","defaultProps","DialogFooter","messages","defineMessages","DialogCloseTrigger","ariaLabel","intl","useIntl","IconButton","Close","DialogTitle","Heading"],"mappings":"ocAcM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,QACP,CAAC,EAGYC,EAAiBH,EAC5B,MACA,MACF,EAGaI,EAAoBH,EAG/B,SAAU,SAAS,EAGRI,EAAyBJ,EAGpC,MAAO,cAAc,EAIVK,EAAkBL,EAG7B,MAAO,OAAO,EAGHM,EAAoBN,EAG/B,MAAO,SAAS,EAGLO,EAAmBP,EAC9B,SACA,QACF,EAGaQ,EAAiBR,EAC5B,MACA,MACF,EAGaS,EAAmBT,EAC9B,SACA,QACF,EAGaU,EAAkBV,EAG7B,KAAM,OAAO,EAGFW,EAAyBX,EAGpC,MAAO,cAAc,ECrEVY,EAAgBC,EAAAA,cAC3B,MACF,EAOaC,EAAuB,IAA0B,CAC5D,MAAMC,EAAUC,EAAAA,WAAWJ,CAAa,EACxC,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,kDAAkD,EAEpE,OAAOA,CACT,EAKaE,EAAiB,CAAC,CAC7B,SAAAC,EACA,MAAAC,CACF,IAISC,EAAAA,IAACR,EAAA,CAAc,MA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AAKc,EAAc,SAAAlB,EAAU,GAAGsB,GAAclB,EAEtD,aACGb,EAAA,CAAiB,IAAK2B,EAAe,GAAGI,EACtC,SAAAtB,EACH,CAEJ,EAEAqC,EAAa,YAAc,gBCXpB,MAAMC,EAAWC,EAAAA,eAAe,CACrC,aAAc,CACZ,GAAI,6BACJ,YAAa,kDACb,eAAgB,cAAA,CAEpB,CAAC,ECDYC,EAAsBpC,GAAmC,CACpE,KAAM,CAAE,IAAKc,EAAc,aAAcuB,EAAW,GAAGnB,GAAclB,EAC/DsC,EAAOC,EAAAA,QAAA,EAEb,aACGlD,EAAA,CACC,SAAAS,EAAAA,IAAC0C,EAAAA,WAAA,CACC,IAAK1B,EACL,KAAK,QACL,KAAK,KACL,QAAQ,QACR,aAAYuB,GAAaC,EAAK,cAAcJ,EAAS,YAAY,EAChE,GAAGhB,EAEJ,eAACuB,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAEX,CAEJ,EAEAL,EAAmB,YAAc,sBCvB1B,MAAMM,EAAe1C,GAA4B,CACtD,KAAM,CAAE,IAAKc,EAAc,SAAAlB,EAAU,GAAGsB,GAAclB,EAEtD,aACGZ,EAAA,CAAgB,QAAO,GAAE,GAAG8B,EAC3B,SAAApB,EAAAA,IAAC6C,UAAA,CAAQ,IAAK7B,EAAc,KAAK,QAAQ,GAAG,KAAK,UAAU,KACxD,SAAAlB,EACH,EACF,CAEJ,EAEA8C,EAAY,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-BJ4qvGnj.es.js","sources":["../../src/components/drawer/drawer.slots.tsx","../../src/components/drawer/components/drawer.context.tsx","../../src/components/drawer/components/drawer.root.tsx","../../src/components/drawer/components/drawer.trigger.tsx","../../src/components/drawer/components/drawer.content.tsx","../../src/components/drawer/components/drawer.header.tsx","../../src/components/drawer/components/drawer.body.tsx","../../src/components/drawer/components/drawer.footer.tsx","../../src/components/drawer/components/drawer.title.tsx","../../src/components/drawer/drawer.i18n.ts","../../src/components/drawer/components/drawer.close-trigger.tsx","../../src/components/drawer/drawer.tsx"],"sourcesContent":["import {\n createSlotRecipeContext,\n type HTMLChakraProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { drawerSlotRecipe } from \"./drawer.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: drawerSlotRecipe,\n});\n\n// Root slot - provides recipe context + config to all child components\nexport type DrawerRootSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerRootSlot = withProvider<HTMLDivElement, DrawerRootSlotProps>(\n \"div\",\n \"root\"\n);\n\n// Trigger slot - button that opens the drawer\nexport type DrawerTriggerSlotProps = HTMLChakraProps<\"button\">;\nexport const DrawerTriggerSlot = withContext<\n HTMLButtonElement,\n DrawerTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Backdrop slot - overlay displayed behind the drawer\nexport type DrawerModalOverlaySlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerModalOverlaySlot = withContext<\n HTMLDivElement,\n DrawerModalOverlaySlotProps\n>(\"div\", \"modalOverlay\");\n\n// modal slot - positions the drawer content\nexport type DrawerModalSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerModalSlot = withContext<\n HTMLDivElement,\n DrawerModalSlotProps\n>(\"div\", \"modal\");\n\n// Content slot - main drawer container\nexport type DrawerContentSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerContentSlot = withContext<\n HTMLDivElement,\n DrawerContentSlotProps\n>(\"div\", \"content\");\n\n// Header slot - drawer header section\nexport type DrawerHeaderSlotProps = HTMLChakraProps<\"header\">;\nexport const DrawerHeaderSlot = withContext<HTMLElement, DrawerHeaderSlotProps>(\n \"header\",\n \"header\"\n);\n\n// Body slot - drawer body content\nexport type DrawerBodySlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerBodySlot = withContext<HTMLDivElement, DrawerBodySlotProps>(\n \"div\",\n \"body\"\n);\n\n// Footer slot - drawer footer section with actions\nexport type DrawerFooterSlotProps = HTMLChakraProps<\"footer\">;\nexport const DrawerFooterSlot = withContext<HTMLElement, DrawerFooterSlotProps>(\n \"footer\",\n \"footer\"\n);\n\n// Title slot - accessible drawer title\nexport type DrawerTitleSlotProps = HTMLChakraProps<\"h2\">;\nexport const DrawerTitleSlot = withContext<\n HTMLHeadingElement,\n DrawerTitleSlotProps\n>(\"h2\", \"title\");\n\n// Close trigger slot - div container for positioning close button\nexport type DrawerCloseTriggerSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerCloseTriggerSlot = withContext<\n HTMLDivElement,\n DrawerCloseTriggerSlotProps\n>(\"div\", \"closeTrigger\");\n","import { createContext, useContext } from \"react\";\nimport type { DrawerRootProps } from \"../drawer.types\";\n\n/**\n * Context value containing drawer configuration passed from Root to child components\n */\nexport type DrawerContextValue = DrawerRootProps;\n\nexport const DrawerContext = createContext<DrawerContextValue | undefined>(\n undefined\n);\n\n/**\n * Hook to access drawer configuration from DrawerContext\n * @returns Drawer configuration from context\n * @throws Error if used outside of Drawer.Root\n */\nexport const useDrawerRootContext = (): DrawerContextValue => {\n const context = useContext(DrawerContext);\n if (!context) {\n throw new Error(\"useDrawerContext must be used within Drawer.Root\");\n }\n return context;\n};\n\n/**\n * Provider component that passes drawer configuration down to child components\n */\nexport const DrawerProvider = ({\n children,\n value,\n}: {\n children: React.ReactNode;\n value: DrawerContextValue;\n}) => {\n return <DrawerContext value={value}>{children}</DrawerContext>;\n};\n","import React from \"react\";\nimport { DialogTrigger as RaDialogTrigger } from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { DrawerRootSlot } from \"../drawer.slots\";\nimport type { DrawerRootProps } from \"../drawer.types\";\nimport { DrawerProvider } from \"./drawer.context\";\nimport { drawerSlotRecipe } from \"../drawer.recipe\";\n\nexport const DrawerRoot = (props: DrawerRootProps) => {\n const recipe = useSlotRecipe({ recipe: drawerSlotRecipe });\n // Extract recipe props\n const [recipeProps] = recipe.splitVariantProps(props);\n // Extract props that are usable on RaDialogTrigger\n const { children, isOpen, onOpenChange, defaultOpen = false } = props;\n\n const content = <DrawerRootSlot {...recipeProps}>{children}</DrawerRootSlot>;\n\n // Check if any child is a Drawer.Trigger component\n // React Aria's DialogTrigger needs a pressable child, so we only use it when there's a trigger\n const hasDrawerTrigger = React.Children.toArray(children).some((child) => {\n if (React.isValidElement(child) && typeof child.type === \"function\") {\n const displayName = (\n child.type as React.ComponentType & { displayName?: string }\n )?.displayName;\n return (\n displayName === \"DrawerTrigger\" || displayName === \"Drawer.Trigger\"\n );\n }\n return false;\n });\n\n // Share all props (config + variant props) with the Drawer subcomponents\n return (\n <DrawerProvider value={props}>\n {hasDrawerTrigger ? (\n // When there's a Drawer.Trigger, use DialogTrigger for React Aria integration\n <RaDialogTrigger\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n defaultOpen={defaultOpen}\n >\n {content}\n </RaDialogTrigger>\n ) : (\n // When no Drawer.Trigger, skip DialogTrigger to avoid the warning\n content\n )}\n </DrawerProvider>\n );\n};\n\nDrawerRoot.displayName = \"Drawer.Root\";\n","import { Button as RaButton } from \"react-aria-components\";\nimport { DrawerTriggerSlot } from \"../drawer.slots\";\nimport type { DrawerTriggerProps } from \"../drawer.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { chakra } from \"@chakra-ui/react/styled-system\";\n\nexport const DrawerTrigger = ({\n ref: forwardedRef,\n children,\n asChild,\n ...props\n}: DrawerTriggerProps) => {\n // If asChild is true, wrap children directly in RaButton with asChild\n if (asChild) {\n return (\n <chakra.button ref={forwardedRef} asChild {...props}>\n {children}\n </chakra.button>\n );\n }\n\n const [styleProps, restProps] = extractStyleProps(props);\n\n // Otherwise, wrap with both DrawerTriggerSlot and RaButton\n // Only pass React Aria compatible props to avoid type conflicts\n return (\n <DrawerTriggerSlot {...styleProps} asChild>\n <RaButton ref={forwardedRef} {...restProps}>\n {children}\n </RaButton>\n </DrawerTriggerSlot>\n );\n};\n\nDrawerTrigger.displayName = \"Drawer.Trigger\";\n","import {\n Modal as RaModal,\n ModalOverlay as RaModalOverlay,\n Dialog as RaDialog,\n} from \"react-aria-components\";\nimport {\n DrawerModalOverlaySlot,\n DrawerModalSlot,\n DrawerContentSlot,\n} from \"../drawer.slots\";\nimport type { DrawerContentProps } from \"../drawer.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useDrawerRootContext } from \"./drawer.context\";\n\nexport const DrawerContent = (props: DrawerContentProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n // Get recipe configuration from context instead of props\n const {\n defaultOpen,\n isDismissable,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n isOpen,\n onOpenChange,\n } = useDrawerRootContext();\n\n const modalProps = {\n defaultOpen,\n isDismissable,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n isOpen,\n onOpenChange,\n };\n\n const [styleProps] = extractStyleProps(restProps);\n\n return (\n <DrawerModalOverlaySlot asChild>\n <RaModalOverlay {...modalProps}>\n <DrawerModalSlot asChild>\n <RaModal>\n <DrawerContentSlot asChild {...styleProps}>\n <RaDialog ref={forwardedRef}>{children}</RaDialog>\n </DrawerContentSlot>\n </RaModal>\n </DrawerModalSlot>\n </RaModalOverlay>\n </DrawerModalOverlaySlot>\n );\n};\n\nDrawerContent.displayName = \"Drawer.Content\";\n","import { DrawerHeaderSlot } from \"../drawer.slots\";\nimport type { DrawerHeaderProps } from \"../drawer.types\";\n\nexport const DrawerHeader = (props: DrawerHeaderProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DrawerHeaderSlot ref={forwardedRef} {...restProps}>\n {children}\n </DrawerHeaderSlot>\n );\n};\n\nDrawerHeader.displayName = \"Drawer.Header\";\n","import { DrawerBodySlot } from \"../drawer.slots\";\nimport type { DrawerBodyProps } from \"../drawer.types\";\n\nexport const DrawerBody = (props: DrawerBodyProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n const defaultProps = {\n /**\n * Set tabIndex to 0 to allow the body to receive focus,\n * effectively enabling scrolling via keyboard arrow keys.\n */\n tabIndex: 0,\n };\n\n return (\n <DrawerBodySlot ref={forwardedRef} {...defaultProps} {...restProps}>\n {children}\n </DrawerBodySlot>\n );\n};\n\nDrawerBody.displayName = \"Drawer.Body\";\n","import { DrawerFooterSlot } from \"../drawer.slots\";\nimport type { DrawerFooterProps } from \"../drawer.types\";\n\nexport const DrawerFooter = (props: DrawerFooterProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DrawerFooterSlot ref={forwardedRef} {...restProps}>\n {children}\n </DrawerFooterSlot>\n );\n};\n\nDrawerFooter.displayName = \"Drawer.Footer\";\n","import { DrawerTitleSlot } from \"../drawer.slots\";\nimport type { DrawerTitleProps } from \"../drawer.types\";\nimport { Heading } from \"@/components\";\n\nexport const DrawerTitle = (props: DrawerTitleProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DrawerTitleSlot asChild {...restProps}>\n <Heading ref={forwardedRef} slot=\"title\" as=\"h2\" textStyle=\"lg\">\n {children}\n </Heading>\n </DrawerTitleSlot>\n );\n};\n\nDrawerTitle.displayName = \"Drawer.Title\";\n","import { defineMessages } from \"react-intl\";\n\nexport const messages = defineMessages({\n closeTrigger: {\n id: \"Nimbus.Drawer.closeTrigger\",\n description: \"aria-label for the default close trigger button\",\n defaultMessage: \"Close drawer\",\n },\n});\n","import { Close } from \"@commercetools/nimbus-icons\";\nimport { DrawerCloseTriggerSlot } from \"../drawer.slots\";\nimport type { DrawerCloseTriggerProps } from \"../drawer.types\";\nimport { IconButton } from \"@/components\";\nimport { messages } from \"../drawer.i18n\";\nimport { useIntl } from \"react-intl\";\n\nexport const DrawerCloseTrigger = (props: DrawerCloseTriggerProps) => {\n const { ref: forwardedRef, \"aria-label\": ariaLabel, ...restProps } = props;\n const intl = useIntl();\n\n return (\n <DrawerCloseTriggerSlot>\n <IconButton\n ref={forwardedRef}\n slot=\"close\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label={ariaLabel || intl.formatMessage(messages.closeTrigger)}\n {...restProps}\n >\n <Close />\n </IconButton>\n </DrawerCloseTriggerSlot>\n );\n};\n\nDrawerCloseTrigger.displayName = \"Drawer.CloseTrigger\";\n","import { DrawerRoot } from \"./components/drawer.root\";\nimport { DrawerTrigger } from \"./components/drawer.trigger\";\nimport { DrawerContent } from \"./components/drawer.content\";\nimport { DrawerHeader } from \"./components/drawer.header\";\nimport { DrawerBody } from \"./components/drawer.body\";\nimport { DrawerFooter } from \"./components/drawer.footer\";\nimport { DrawerTitle } from \"./components/drawer.title\";\nimport { DrawerCloseTrigger } from \"./components/drawer.close-trigger\";\n\n/**\n * Drawer\n * ============================================================\n * A foundational drawer component for overlays that require user attention.\n * Built for accessibility and WCAG 2.1 AA compliance.\n *\n * Features:\n * - Controlled and uncontrolled modes\n * - Customizable placement, size, and animations\n * - Focus management and keyboard navigation\n * - Click-outside and Escape key dismissal\n * - Portal rendering support\n * - Backdrop overlay with animations\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content size=\"md\" placement=\"center\">\n * <Drawer.Header>\n * <Drawer.Title>Drawer Title</Drawer.Title>\n * <Drawer.CloseTrigger>×</Drawer.CloseTrigger>\n * </Drawer.Header>\n * <Drawer.Body>\n * Drawer content goes here\n * </Drawer.Body>\n * <Drawer.Footer>\n * <button>Cancel</button>\n * <button>Save</button>\n * </Drawer.Footer>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n * @see https://nimbus-documentation.vercel.app/components/feedback/drawer\n */\nexport const Drawer = {\n /**\n * # Drawer.Root\n *\n * The root component that provides context and state management for the drawer.\n * Handles accessibility and keyboard interaction.\n *\n * This component must wrap all drawer parts (Trigger, Content, etc.) and provides\n * the drawer open/close state and variant styling context.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Drawer Title</Drawer.Title>\n * </Drawer.Header>\n * <Drawer.Body>Drawer content</Drawer.Body>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n Root: DrawerRoot,\n /**\n * # Drawer.Trigger\n *\n * The trigger element that opens the drawer when activated.\n * Provides accessibility and keyboard support.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content>...</Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n Trigger: DrawerTrigger,\n /**\n * # Drawer.Content\n *\n * The main drawer content container that handles portalling, backdrop,\n * positioning, and content styling.\n *\n * This component creates the drawer overlay, positions the content, and provides\n * accessibility features like focus management and keyboard dismissal.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content size=\"md\" placement=\"center\">\n * <Drawer.Header>\n * <Drawer.Title>Title</Drawer.Title>\n * </Drawer.Header>\n * <Drawer.Body>Content</Drawer.Body>\n * <Drawer.Footer>Actions</Drawer.Footer>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n Content: DrawerContent,\n /**\n * # Drawer.Header\n *\n * The header section of the drawer content.\n * Typically contains the title and close button.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Drawer Title</Drawer.Title>\n * <Drawer.CloseTrigger />\n * </Drawer.Header>\n * <Drawer.Body>...</Drawer.Body>\n * </Drawer.Content>\n * ```\n */\n Header: DrawerHeader,\n /**\n * # Drawer.Body\n *\n * The main body content section of the drawer.\n * Contains the primary drawer content and handles overflow/scrolling.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>...</Drawer.Header>\n * <Drawer.Body>\n * <p>This is the main content of the drawer.</p>\n * </Drawer.Body>\n * <Drawer.Footer>...</Drawer.Footer>\n * </Drawer.Content>\n * ```\n */\n Body: DrawerBody,\n /**\n * # Drawer.Footer\n *\n * The footer section of the drawer, typically containing action buttons.\n * Provides consistent spacing and alignment for drawer actions.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>...</Drawer.Header>\n * <Drawer.Body>...</Drawer.Body>\n * <Drawer.Footer>\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Confirm</Button>\n * </Drawer.Footer>\n * </Drawer.Content>\n * ```\n */\n Footer: DrawerFooter,\n /**\n * # Drawer.Title\n *\n * The accessible title element for the drawer.\n * Provides proper accessibility and screen reader support.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Confirm Action</Drawer.Title>\n * </Drawer.Header>\n * <Drawer.Body>...</Drawer.Body>\n * </Drawer.Content>\n * ```\n */\n Title: DrawerTitle,\n /**\n * # Drawer.CloseTrigger\n *\n * A button that closes the drawer when activated.\n * Displays an IconButton with a close (X) icon by default.\n *\n * The component automatically handles the close behavior,\n * so no additional onPress handler is needed.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Title</Drawer.Title>\n * <Drawer.CloseTrigger aria-label=\"Close drawer\" />\n * </Drawer.Header>\n * <Drawer.Body>Content</Drawer.Body>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n CloseTrigger: DrawerCloseTrigger,\n};\n\n// Internal exports for react-docgen\nexport {\n DrawerRoot as _DrawerRoot,\n DrawerTrigger as _DrawerTrigger,\n DrawerContent as _DrawerContent,\n DrawerHeader as _DrawerHeader,\n DrawerBody as _DrawerBody,\n DrawerFooter as _DrawerFooter,\n DrawerTitle as _DrawerTitle,\n DrawerCloseTrigger as _DrawerCloseTrigger,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","drawerSlotRecipe","DrawerRootSlot","DrawerTriggerSlot","DrawerModalOverlaySlot","DrawerModalSlot","DrawerContentSlot","DrawerHeaderSlot","DrawerBodySlot","DrawerFooterSlot","DrawerTitleSlot","DrawerCloseTriggerSlot","DrawerContext","createContext","useDrawerRootContext","context","useContext","DrawerProvider","children","value","jsx","DrawerRoot","props","recipe","useSlotRecipe","recipeProps","isOpen","onOpenChange","defaultOpen","content","hasDrawerTrigger","React","child","displayName","RaDialogTrigger","DrawerTrigger","forwardedRef","asChild","chakra","styleProps","restProps","extractStyleProps","RaButton","DrawerContent","isDismissable","isKeyboardDismissDisabled","shouldCloseOnInteractOutside","modalProps","RaModalOverlay","RaModal","RaDialog","DrawerHeader","DrawerBody","DrawerFooter","DrawerTitle","Heading","messages","defineMessages","DrawerCloseTrigger","ariaLabel","intl","useIntl","IconButton","Close","Drawer"],"mappings":";;;;;;;;;;;;AAMA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,QAAQC;AACV,CAAC,GAIYC,IAAiB,gBAAAJ;AAAA,EAC5B;AAAA,EACA;AACF,GAIaK,IAAoB,gBAAAJ,EAG/B,UAAU,SAAS,GAIRK,IAAyB,gBAAAL,EAGpC,OAAO,cAAc,GAIVM,IAAkB,gBAAAN,EAG7B,OAAO,OAAO,GAIHO,IAAoB,gBAAAP,EAG/B,OAAO,SAAS,GAILQ,IAAmB,gBAAAR;AAAA,EAC9B;AAAA,EACA;AACF,GAIaS,IAAiB,gBAAAT;AAAA,EAC5B;AAAA,EACA;AACF,GAIaU,IAAmB,gBAAAV;AAAA,EAC9B;AAAA,EACA;AACF,GAIaW,IAAkB,gBAAAX,EAG7B,MAAM,OAAO,GAIFY,IAAyB,gBAAAZ,EAGpC,OAAO,cAAc,GCtEVa,IAAgB,gBAAAC;AAAA,EAC3B;AACF,GAOaC,IAAuB,MAA0B;AAC5D,QAAMC,IAAUC,EAAWJ,CAAa;AACxC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,kDAAkD;AAEpE,SAAOA;AACT,GAKaE,IAAiB,CAAC;AAAA,EAC7B,UA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBpB,MAAM3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeN,SAASc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBT,SAASQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBT,QAAQQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBR,MAAMC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBN,QAAQC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBR,OAAOC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBP,cAAcI;AAChB;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),u=require("react"),x=require("./Dialog-XGXh4NXU.cjs.js"),g=require("@chakra-ui/react/styled-system"),D=require("./index-CRFg4Mhx.cjs.js"),q=require("./Button-CFZnLKVR.cjs.js"),h=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),p=require("./Modal-CVOcKPNx.cjs.js"),N=require("./heading-BTacGwo9.cjs.js"),O=require("@commercetools/nimbus-icons"),y=require("react-intl"),B=require("./icon-button-vWPrT-bR.cjs.js"),{withProvider:I,withContext:a}=g.createSlotRecipeContext({recipe:D.drawerSlotRecipe}),M=I("div","root"),H=a("button","trigger"),F=a("div","modalOverlay"),E=a("div","modal"),V=a("div","content"),k=a("header","header"),z=a("div","body"),A=a("footer","footer"),K=a("h2","title"),L=a("div","closeTrigger"),C=u.createContext(void 0),G=()=>{const e=u.useContext(C);if(!e)throw new Error("useDrawerContext must be used within Drawer.Root");return e},J=({children:e,value:t})=>r.jsx(C,{value:t,children:e}),m=e=>{const t=g.useSlotRecipe({recipe:D.drawerSlotRecipe}),[s]=t.splitVariantProps(e),{children:o,isOpen:n,onOpenChange:i,defaultOpen:f=!1}=e,l=r.jsx(M,{...s,children:o}),w=u.Children.toArray(o).some(c=>{if(u.isValidElement(c)&&typeof c.type=="function"){const d=c.type?.displayName;return d==="DrawerTrigger"||d==="Drawer.Trigger"}return!1});return r.jsx(J,{value:e,children:w?r.jsx(x.$de32f1b87079253c$export$2e1e1122cf0cba88,{isOpen:n,onOpenChange:i,defaultOpen:f,children:l}):l})};m.displayName="Drawer.Root";const b=({ref:e,children:t,asChild:s,...o})=>{if(s)return r.jsx(g.chakra.button,{ref:e,asChild:!0,...o,children:t});const[n,i]=h.extractStyleProps(o);return r.jsx(H,{...n,asChild:!0,children:r.jsx(q.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{ref:e,...i,children:t})})};b.displayName="Drawer.Trigger";const j=e=>{const{ref:t,children:s,...o}=e,{defaultOpen:n,isDismissable:i,isKeyboardDismissDisabled:f,shouldCloseOnInteractOutside:l,isOpen:w,onOpenChange:c}=G(),d={defaultOpen:n,isDismissable:i,isKeyboardDismissDisabled:f,shouldCloseOnInteractOutside:l,isOpen:w,onOpenChange:c},[v]=h.extractStyleProps(o);return r.jsx(F,{asChild:!0,children:r.jsx(p.$f3f84453ead64de5$export$8948f78d83984c69,{...d,children:r.jsx(E,{asChild:!0,children:r.jsx(p.$f3f84453ead64de5$export$2b77a92f1a5ad772,{children:r.jsx(V,{asChild:!0,...v,children:r.jsx(x.$de32f1b87079253c$export$3ddf2d174ce01153,{ref:t,children:s})})})})})})};j.displayName="Drawer.Content";const S=e=>{const{ref:t,children:s,...o}=e;return r.jsx(k,{ref:t,...o,children:s})};S.displayName="Drawer.Header";const T=e=>{const{ref:t,children:s,...o}=e,n={tabIndex:0};return r.jsx(z,{ref:t,...n,...o,children:s})};T.displayName="Drawer.Body";const P=e=>{const{ref:t,children:s,...o}=e;return r.jsx(A,{ref:t,...o,children:s})};P.displayName="Drawer.Footer";const R=e=>{const{ref:t,children:s,...o}=e;return r.jsx(K,{asChild:!0,...o,children:r.jsx(N.Heading,{ref:t,slot:"title",as:"h2",textStyle:"lg",children:s})})};R.displayName="Drawer.Title";const Q=y.defineMessages({closeTrigger:{id:"Nimbus.Drawer.closeTrigger",description:"aria-label for the default close trigger button",defaultMessage:"Close drawer"}}),$=e=>{const{ref:t,"aria-label":s,...o}=e,n=y.useIntl();return r.jsx(L,{children:r.jsx(B.IconButton,{ref:t,slot:"close",size:"xs",variant:"ghost","aria-label":s||n.formatMessage(Q.closeTrigger),...o,children:r.jsx(O.Close,{})})})};$.displayName="Drawer.CloseTrigger";const U={Root:m,Trigger:b,Content:j,Header:S,Body:T,Footer:P,Title:R,CloseTrigger:$};exports.Drawer=U;
|
|
2
|
-
//# sourceMappingURL=drawer-DzW9wBMk.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-DzW9wBMk.cjs.js","sources":["../../src/components/drawer/drawer.slots.tsx","../../src/components/drawer/components/drawer.context.tsx","../../src/components/drawer/components/drawer.root.tsx","../../src/components/drawer/components/drawer.trigger.tsx","../../src/components/drawer/components/drawer.content.tsx","../../src/components/drawer/components/drawer.header.tsx","../../src/components/drawer/components/drawer.body.tsx","../../src/components/drawer/components/drawer.footer.tsx","../../src/components/drawer/components/drawer.title.tsx","../../src/components/drawer/drawer.i18n.ts","../../src/components/drawer/components/drawer.close-trigger.tsx","../../src/components/drawer/drawer.tsx"],"sourcesContent":["import {\n createSlotRecipeContext,\n type HTMLChakraProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { drawerSlotRecipe } from \"./drawer.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: drawerSlotRecipe,\n});\n\n// Root slot - provides recipe context + config to all child components\nexport type DrawerRootSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerRootSlot = withProvider<HTMLDivElement, DrawerRootSlotProps>(\n \"div\",\n \"root\"\n);\n\n// Trigger slot - button that opens the drawer\nexport type DrawerTriggerSlotProps = HTMLChakraProps<\"button\">;\nexport const DrawerTriggerSlot = withContext<\n HTMLButtonElement,\n DrawerTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Backdrop slot - overlay displayed behind the drawer\nexport type DrawerModalOverlaySlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerModalOverlaySlot = withContext<\n HTMLDivElement,\n DrawerModalOverlaySlotProps\n>(\"div\", \"modalOverlay\");\n\n// modal slot - positions the drawer content\nexport type DrawerModalSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerModalSlot = withContext<\n HTMLDivElement,\n DrawerModalSlotProps\n>(\"div\", \"modal\");\n\n// Content slot - main drawer container\nexport type DrawerContentSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerContentSlot = withContext<\n HTMLDivElement,\n DrawerContentSlotProps\n>(\"div\", \"content\");\n\n// Header slot - drawer header section\nexport type DrawerHeaderSlotProps = HTMLChakraProps<\"header\">;\nexport const DrawerHeaderSlot = withContext<HTMLElement, DrawerHeaderSlotProps>(\n \"header\",\n \"header\"\n);\n\n// Body slot - drawer body content\nexport type DrawerBodySlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerBodySlot = withContext<HTMLDivElement, DrawerBodySlotProps>(\n \"div\",\n \"body\"\n);\n\n// Footer slot - drawer footer section with actions\nexport type DrawerFooterSlotProps = HTMLChakraProps<\"footer\">;\nexport const DrawerFooterSlot = withContext<HTMLElement, DrawerFooterSlotProps>(\n \"footer\",\n \"footer\"\n);\n\n// Title slot - accessible drawer title\nexport type DrawerTitleSlotProps = HTMLChakraProps<\"h2\">;\nexport const DrawerTitleSlot = withContext<\n HTMLHeadingElement,\n DrawerTitleSlotProps\n>(\"h2\", \"title\");\n\n// Close trigger slot - div container for positioning close button\nexport type DrawerCloseTriggerSlotProps = HTMLChakraProps<\"div\">;\nexport const DrawerCloseTriggerSlot = withContext<\n HTMLDivElement,\n DrawerCloseTriggerSlotProps\n>(\"div\", \"closeTrigger\");\n","import { createContext, useContext } from \"react\";\nimport type { DrawerRootProps } from \"../drawer.types\";\n\n/**\n * Context value containing drawer configuration passed from Root to child components\n */\nexport type DrawerContextValue = DrawerRootProps;\n\nexport const DrawerContext = createContext<DrawerContextValue | undefined>(\n undefined\n);\n\n/**\n * Hook to access drawer configuration from DrawerContext\n * @returns Drawer configuration from context\n * @throws Error if used outside of Drawer.Root\n */\nexport const useDrawerRootContext = (): DrawerContextValue => {\n const context = useContext(DrawerContext);\n if (!context) {\n throw new Error(\"useDrawerContext must be used within Drawer.Root\");\n }\n return context;\n};\n\n/**\n * Provider component that passes drawer configuration down to child components\n */\nexport const DrawerProvider = ({\n children,\n value,\n}: {\n children: React.ReactNode;\n value: DrawerContextValue;\n}) => {\n return <DrawerContext value={value}>{children}</DrawerContext>;\n};\n","import React from \"react\";\nimport { DialogTrigger as RaDialogTrigger } from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { DrawerRootSlot } from \"../drawer.slots\";\nimport type { DrawerRootProps } from \"../drawer.types\";\nimport { DrawerProvider } from \"./drawer.context\";\nimport { drawerSlotRecipe } from \"../drawer.recipe\";\n\nexport const DrawerRoot = (props: DrawerRootProps) => {\n const recipe = useSlotRecipe({ recipe: drawerSlotRecipe });\n // Extract recipe props\n const [recipeProps] = recipe.splitVariantProps(props);\n // Extract props that are usable on RaDialogTrigger\n const { children, isOpen, onOpenChange, defaultOpen = false } = props;\n\n const content = <DrawerRootSlot {...recipeProps}>{children}</DrawerRootSlot>;\n\n // Check if any child is a Drawer.Trigger component\n // React Aria's DialogTrigger needs a pressable child, so we only use it when there's a trigger\n const hasDrawerTrigger = React.Children.toArray(children).some((child) => {\n if (React.isValidElement(child) && typeof child.type === \"function\") {\n const displayName = (\n child.type as React.ComponentType & { displayName?: string }\n )?.displayName;\n return (\n displayName === \"DrawerTrigger\" || displayName === \"Drawer.Trigger\"\n );\n }\n return false;\n });\n\n // Share all props (config + variant props) with the Drawer subcomponents\n return (\n <DrawerProvider value={props}>\n {hasDrawerTrigger ? (\n // When there's a Drawer.Trigger, use DialogTrigger for React Aria integration\n <RaDialogTrigger\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n defaultOpen={defaultOpen}\n >\n {content}\n </RaDialogTrigger>\n ) : (\n // When no Drawer.Trigger, skip DialogTrigger to avoid the warning\n content\n )}\n </DrawerProvider>\n );\n};\n\nDrawerRoot.displayName = \"Drawer.Root\";\n","import { Button as RaButton } from \"react-aria-components\";\nimport { DrawerTriggerSlot } from \"../drawer.slots\";\nimport type { DrawerTriggerProps } from \"../drawer.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { chakra } from \"@chakra-ui/react/styled-system\";\n\nexport const DrawerTrigger = ({\n ref: forwardedRef,\n children,\n asChild,\n ...props\n}: DrawerTriggerProps) => {\n // If asChild is true, wrap children directly in RaButton with asChild\n if (asChild) {\n return (\n <chakra.button ref={forwardedRef} asChild {...props}>\n {children}\n </chakra.button>\n );\n }\n\n const [styleProps, restProps] = extractStyleProps(props);\n\n // Otherwise, wrap with both DrawerTriggerSlot and RaButton\n // Only pass React Aria compatible props to avoid type conflicts\n return (\n <DrawerTriggerSlot {...styleProps} asChild>\n <RaButton ref={forwardedRef} {...restProps}>\n {children}\n </RaButton>\n </DrawerTriggerSlot>\n );\n};\n\nDrawerTrigger.displayName = \"Drawer.Trigger\";\n","import {\n Modal as RaModal,\n ModalOverlay as RaModalOverlay,\n Dialog as RaDialog,\n} from \"react-aria-components\";\nimport {\n DrawerModalOverlaySlot,\n DrawerModalSlot,\n DrawerContentSlot,\n} from \"../drawer.slots\";\nimport type { DrawerContentProps } from \"../drawer.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useDrawerRootContext } from \"./drawer.context\";\n\nexport const DrawerContent = (props: DrawerContentProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n // Get recipe configuration from context instead of props\n const {\n defaultOpen,\n isDismissable,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n isOpen,\n onOpenChange,\n } = useDrawerRootContext();\n\n const modalProps = {\n defaultOpen,\n isDismissable,\n isKeyboardDismissDisabled,\n shouldCloseOnInteractOutside,\n isOpen,\n onOpenChange,\n };\n\n const [styleProps] = extractStyleProps(restProps);\n\n return (\n <DrawerModalOverlaySlot asChild>\n <RaModalOverlay {...modalProps}>\n <DrawerModalSlot asChild>\n <RaModal>\n <DrawerContentSlot asChild {...styleProps}>\n <RaDialog ref={forwardedRef}>{children}</RaDialog>\n </DrawerContentSlot>\n </RaModal>\n </DrawerModalSlot>\n </RaModalOverlay>\n </DrawerModalOverlaySlot>\n );\n};\n\nDrawerContent.displayName = \"Drawer.Content\";\n","import { DrawerHeaderSlot } from \"../drawer.slots\";\nimport type { DrawerHeaderProps } from \"../drawer.types\";\n\nexport const DrawerHeader = (props: DrawerHeaderProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DrawerHeaderSlot ref={forwardedRef} {...restProps}>\n {children}\n </DrawerHeaderSlot>\n );\n};\n\nDrawerHeader.displayName = \"Drawer.Header\";\n","import { DrawerBodySlot } from \"../drawer.slots\";\nimport type { DrawerBodyProps } from \"../drawer.types\";\n\nexport const DrawerBody = (props: DrawerBodyProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n const defaultProps = {\n /**\n * Set tabIndex to 0 to allow the body to receive focus,\n * effectively enabling scrolling via keyboard arrow keys.\n */\n tabIndex: 0,\n };\n\n return (\n <DrawerBodySlot ref={forwardedRef} {...defaultProps} {...restProps}>\n {children}\n </DrawerBodySlot>\n );\n};\n\nDrawerBody.displayName = \"Drawer.Body\";\n","import { DrawerFooterSlot } from \"../drawer.slots\";\nimport type { DrawerFooterProps } from \"../drawer.types\";\n\nexport const DrawerFooter = (props: DrawerFooterProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DrawerFooterSlot ref={forwardedRef} {...restProps}>\n {children}\n </DrawerFooterSlot>\n );\n};\n\nDrawerFooter.displayName = \"Drawer.Footer\";\n","import { DrawerTitleSlot } from \"../drawer.slots\";\nimport type { DrawerTitleProps } from \"../drawer.types\";\nimport { Heading } from \"@/components\";\n\nexport const DrawerTitle = (props: DrawerTitleProps) => {\n const { ref: forwardedRef, children, ...restProps } = props;\n\n return (\n <DrawerTitleSlot asChild {...restProps}>\n <Heading ref={forwardedRef} slot=\"title\" as=\"h2\" textStyle=\"lg\">\n {children}\n </Heading>\n </DrawerTitleSlot>\n );\n};\n\nDrawerTitle.displayName = \"Drawer.Title\";\n","import { defineMessages } from \"react-intl\";\n\nexport const messages = defineMessages({\n closeTrigger: {\n id: \"Nimbus.Drawer.closeTrigger\",\n description: \"aria-label for the default close trigger button\",\n defaultMessage: \"Close drawer\",\n },\n});\n","import { Close } from \"@commercetools/nimbus-icons\";\nimport { DrawerCloseTriggerSlot } from \"../drawer.slots\";\nimport type { DrawerCloseTriggerProps } from \"../drawer.types\";\nimport { IconButton } from \"@/components\";\nimport { messages } from \"../drawer.i18n\";\nimport { useIntl } from \"react-intl\";\n\nexport const DrawerCloseTrigger = (props: DrawerCloseTriggerProps) => {\n const { ref: forwardedRef, \"aria-label\": ariaLabel, ...restProps } = props;\n const intl = useIntl();\n\n return (\n <DrawerCloseTriggerSlot>\n <IconButton\n ref={forwardedRef}\n slot=\"close\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label={ariaLabel || intl.formatMessage(messages.closeTrigger)}\n {...restProps}\n >\n <Close />\n </IconButton>\n </DrawerCloseTriggerSlot>\n );\n};\n\nDrawerCloseTrigger.displayName = \"Drawer.CloseTrigger\";\n","import { DrawerRoot } from \"./components/drawer.root\";\nimport { DrawerTrigger } from \"./components/drawer.trigger\";\nimport { DrawerContent } from \"./components/drawer.content\";\nimport { DrawerHeader } from \"./components/drawer.header\";\nimport { DrawerBody } from \"./components/drawer.body\";\nimport { DrawerFooter } from \"./components/drawer.footer\";\nimport { DrawerTitle } from \"./components/drawer.title\";\nimport { DrawerCloseTrigger } from \"./components/drawer.close-trigger\";\n\n/**\n * Drawer\n * ============================================================\n * A foundational drawer component for overlays that require user attention.\n * Built for accessibility and WCAG 2.1 AA compliance.\n *\n * Features:\n * - Controlled and uncontrolled modes\n * - Customizable placement, size, and animations\n * - Focus management and keyboard navigation\n * - Click-outside and Escape key dismissal\n * - Portal rendering support\n * - Backdrop overlay with animations\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content size=\"md\" placement=\"center\">\n * <Drawer.Header>\n * <Drawer.Title>Drawer Title</Drawer.Title>\n * <Drawer.CloseTrigger>×</Drawer.CloseTrigger>\n * </Drawer.Header>\n * <Drawer.Body>\n * Drawer content goes here\n * </Drawer.Body>\n * <Drawer.Footer>\n * <button>Cancel</button>\n * <button>Save</button>\n * </Drawer.Footer>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n * @see https://nimbus-documentation.vercel.app/components/feedback/drawer\n */\nexport const Drawer = {\n /**\n * # Drawer.Root\n *\n * The root component that provides context and state management for the drawer.\n * Handles accessibility and keyboard interaction.\n *\n * This component must wrap all drawer parts (Trigger, Content, etc.) and provides\n * the drawer open/close state and variant styling context.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Drawer Title</Drawer.Title>\n * </Drawer.Header>\n * <Drawer.Body>Drawer content</Drawer.Body>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n Root: DrawerRoot,\n /**\n * # Drawer.Trigger\n *\n * The trigger element that opens the drawer when activated.\n * Provides accessibility and keyboard support.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content>...</Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n Trigger: DrawerTrigger,\n /**\n * # Drawer.Content\n *\n * The main drawer content container that handles portalling, backdrop,\n * positioning, and content styling.\n *\n * This component creates the drawer overlay, positions the content, and provides\n * accessibility features like focus management and keyboard dismissal.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content size=\"md\" placement=\"center\">\n * <Drawer.Header>\n * <Drawer.Title>Title</Drawer.Title>\n * </Drawer.Header>\n * <Drawer.Body>Content</Drawer.Body>\n * <Drawer.Footer>Actions</Drawer.Footer>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n Content: DrawerContent,\n /**\n * # Drawer.Header\n *\n * The header section of the drawer content.\n * Typically contains the title and close button.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Drawer Title</Drawer.Title>\n * <Drawer.CloseTrigger />\n * </Drawer.Header>\n * <Drawer.Body>...</Drawer.Body>\n * </Drawer.Content>\n * ```\n */\n Header: DrawerHeader,\n /**\n * # Drawer.Body\n *\n * The main body content section of the drawer.\n * Contains the primary drawer content and handles overflow/scrolling.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>...</Drawer.Header>\n * <Drawer.Body>\n * <p>This is the main content of the drawer.</p>\n * </Drawer.Body>\n * <Drawer.Footer>...</Drawer.Footer>\n * </Drawer.Content>\n * ```\n */\n Body: DrawerBody,\n /**\n * # Drawer.Footer\n *\n * The footer section of the drawer, typically containing action buttons.\n * Provides consistent spacing and alignment for drawer actions.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>...</Drawer.Header>\n * <Drawer.Body>...</Drawer.Body>\n * <Drawer.Footer>\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Confirm</Button>\n * </Drawer.Footer>\n * </Drawer.Content>\n * ```\n */\n Footer: DrawerFooter,\n /**\n * # Drawer.Title\n *\n * The accessible title element for the drawer.\n * Provides proper accessibility and screen reader support.\n *\n * @example\n * ```tsx\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Confirm Action</Drawer.Title>\n * </Drawer.Header>\n * <Drawer.Body>...</Drawer.Body>\n * </Drawer.Content>\n * ```\n */\n Title: DrawerTitle,\n /**\n * # Drawer.CloseTrigger\n *\n * A button that closes the drawer when activated.\n * Displays an IconButton with a close (X) icon by default.\n *\n * The component automatically handles the close behavior,\n * so no additional onPress handler is needed.\n *\n * @example\n * ```tsx\n * <Drawer.Root>\n * <Drawer.Trigger>Open Drawer</Drawer.Trigger>\n * <Drawer.Content>\n * <Drawer.Header>\n * <Drawer.Title>Title</Drawer.Title>\n * <Drawer.CloseTrigger aria-label=\"Close drawer\" />\n * </Drawer.Header>\n * <Drawer.Body>Content</Drawer.Body>\n * </Drawer.Content>\n * </Drawer.Root>\n * ```\n */\n CloseTrigger: DrawerCloseTrigger,\n};\n\n// Internal exports for react-docgen\nexport {\n DrawerRoot as _DrawerRoot,\n DrawerTrigger as _DrawerTrigger,\n DrawerContent as _DrawerContent,\n DrawerHeader as _DrawerHeader,\n DrawerBody as _DrawerBody,\n DrawerFooter as _DrawerFooter,\n DrawerTitle as _DrawerTitle,\n DrawerCloseTrigger as _DrawerCloseTrigger,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","drawerSlotRecipe","DrawerRootSlot","DrawerTriggerSlot","DrawerModalOverlaySlot","DrawerModalSlot","DrawerContentSlot","DrawerHeaderSlot","DrawerBodySlot","DrawerFooterSlot","DrawerTitleSlot","DrawerCloseTriggerSlot","DrawerContext","createContext","useDrawerRootContext","context","useContext","DrawerProvider","children","value","jsx","DrawerRoot","props","recipe","useSlotRecipe","recipeProps","isOpen","onOpenChange","defaultOpen","content","hasDrawerTrigger","React","child","displayName","RaDialogTrigger","DrawerTrigger","forwardedRef","asChild","chakra","styleProps","restProps","extractStyleProps","RaButton","DrawerContent","isDismissable","isKeyboardDismissDisabled","shouldCloseOnInteractOutside","modalProps","RaModalOverlay","RaModal","RaDialog","DrawerHeader","DrawerBody","defaultProps","DrawerFooter","DrawerTitle","Heading","messages","defineMessages","DrawerCloseTrigger","ariaLabel","intl","useIntl","IconButton","Close","Drawer"],"mappings":"2cAMM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,gBACV,CAAC,EAIYC,EAAiBJ,EAC5B,MACA,MACF,EAIaK,EAAoBJ,EAG/B,SAAU,SAAS,EAIRK,EAAyBL,EAGpC,MAAO,cAAc,EAIVM,EAAkBN,EAG7B,MAAO,OAAO,EAIHO,EAAoBP,EAG/B,MAAO,SAAS,EAILQ,EAAmBR,EAC9B,SACA,QACF,EAIaS,EAAiBT,EAC5B,MACA,MACF,EAIaU,EAAmBV,EAC9B,SACA,QACF,EAIaW,EAAkBX,EAG7B,KAAM,OAAO,EAIFY,EAAyBZ,EAGpC,MAAO,cAAc,ECtEVa,EAAgBC,EAAAA,cAC3B,MACF,EAOaC,EAAuB,IAA0B,CAC5D,MAAMC,EAAUC,EAAAA,WAAWJ,CAAa,EACxC,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,kDAAkD,EAEpE,OAAOA,CACT,EAKaE,EAAiB,CAAC,CAC7B,SAAAC,EACA,MAAAC,CACF,IAISC,EAAA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GAAGsB,GAAclB,EAEtD,aACGb,EAAA,CAAiB,IAAK2B,EAAe,GAAGI,EACtC,SAAAtB,EACH,CAEJ,EAEAoC,EAAa,YAAc,gBCTpB,MAAMC,EAAejC,GAA4B,CACtD,KAAM,CAAE,IAAKc,EAAc,SAAAlB,EAAU,GAAGsB,GAAclB,EAEtD,aACGZ,EAAA,CAAgB,QAAO,GAAE,GAAG8B,EAC3B,SAAApB,EAAAA,IAACoC,UAAA,CAAQ,IAAKpB,EAAc,KAAK,QAAQ,GAAG,KAAK,UAAU,KACxD,SAAAlB,EACH,EACF,CAEJ,EAEAqC,EAAY,YAAc,eCdnB,MAAME,EAAWC,EAAAA,eAAe,CACrC,aAAc,CACZ,GAAI,6BACJ,YAAa,kDACb,eAAgB,cAAA,CAEpB,CAAC,ECDYC,EAAsBrC,GAAmC,CACpE,KAAM,CAAE,IAAKc,EAAc,aAAcwB,EAAW,GAAGpB,GAAclB,EAC/DuC,EAAOC,EAAAA,QAAA,EAEb,aACGnD,EAAA,CACC,SAAAS,EAAAA,IAAC2C,EAAAA,WAAA,CACC,IAAK3B,EACL,KAAK,QACL,KAAK,KACL,QAAQ,QACR,aAAYwB,GAAaC,EAAK,cAAcJ,EAAS,YAAY,EAChE,GAAGjB,EAEJ,eAACwB,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAEX,CAEJ,EAEAL,EAAmB,YAAc,sBCiB1B,MAAMM,EAAS,CAuBpB,KAAM5C,EAeN,QAASc,EAwBT,QAASQ,EAkBT,OAAQQ,EAkBR,KAAMC,EAmBN,OAAQE,EAiBR,MAAOC,EAwBP,aAAcI,CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractStyleProps-DYXEhLtq.es.js","sources":["../../src/utils/extractStyleProps.ts"],"sourcesContent":["import { system } from \"@/theme\";\n\n/**\n * Extracts chakra-ui style-props from an object, separating them from other props\n * @param props The props object to separate\n * @returns A tuple containing [styleProps, otherProps]\n */\nexport function extractStyleProps<T extends object>(\n props: T\n): [Record<string, unknown>, Omit<T, string>] {\n const styleProps: Record<string, unknown> = {};\n const otherProps = { ...props } as Record<string, unknown>;\n\n // Process only own properties\n Object.keys(props).forEach((key) => {\n if (\n Object.prototype.hasOwnProperty.call(props, key) &&\n system.isValidProperty(key)\n ) {\n styleProps[key] = props[key as keyof T];\n delete otherProps[key];\n }\n });\n\n return [styleProps, otherProps as Omit<T, string>];\n}\n"],"names":["extractStyleProps","props","styleProps","otherProps","key","system"],"mappings":";AAOO,SAASA,EACdC,GAC4C;AAC5C,QAAMC,IAAsC,CAAA,GACtCC,IAAa,EAAE,GAAGF,EAAA;AAGxB,gBAAO,KAAKA,CAAK,EAAE,QAAQ,CAACG,MAAQ;AAClC,IACE,OAAO,UAAU,eAAe,KAAKH,GAAOG,CAAG,KAC/CC,EAAO,gBAAgBD,CAAG,MAE1BF,EAAWE,CAAG,IAAIH,EAAMG,CAAc,GACtC,OAAOD,EAAWC,CAAG;AAAA,EAEzB,CAAC,GAEM,CAACF,GAAYC,CAA6B;AACnD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractStyleProps-Dk3fpLyQ.cjs.js","sources":["../../src/utils/extractStyleProps.ts"],"sourcesContent":["import { system } from \"@/theme\";\n\n/**\n * Extracts chakra-ui style-props from an object, separating them from other props\n * @param props The props object to separate\n * @returns A tuple containing [styleProps, otherProps]\n */\nexport function extractStyleProps<T extends object>(\n props: T\n): [Record<string, unknown>, Omit<T, string>] {\n const styleProps: Record<string, unknown> = {};\n const otherProps = { ...props } as Record<string, unknown>;\n\n // Process only own properties\n Object.keys(props).forEach((key) => {\n if (\n Object.prototype.hasOwnProperty.call(props, key) &&\n system.isValidProperty(key)\n ) {\n styleProps[key] = props[key as keyof T];\n delete otherProps[key];\n }\n });\n\n return [styleProps, otherProps as Omit<T, string>];\n}\n"],"names":["extractStyleProps","props","styleProps","otherProps","key","system"],"mappings":"wDAOO,SAASA,EACdC,EAC4C,CAC5C,MAAMC,EAAsC,CAAA,EACtCC,EAAa,CAAE,GAAGF,CAAA,EAGxB,cAAO,KAAKA,CAAK,EAAE,QAASG,GAAQ,CAEhC,OAAO,UAAU,eAAe,KAAKH,EAAOG,CAAG,GAC/CC,EAAAA,OAAO,gBAAgBD,CAAG,IAE1BF,EAAWE,CAAG,EAAIH,EAAMG,CAAc,EACtC,OAAOD,EAAWC,CAAG,EAEzB,CAAC,EAEM,CAACF,EAAYC,CAA6B,CACnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu-D-vE6ZpM.es.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type {\n MenuRootSlotProps,\n MenuTriggerSlotProps,\n MenuPopoverSlotProps,\n MenuContentSlotProps,\n MenuItemSlotProps,\n MenuSectionSlotProps,\n MenuSectionLabelSlotProps,\n MenuSubmenuSlotProps,\n} from \"./menu.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"menu\",\n});\n\n// Menu Root\nexport const MenuRootSlot: SlotComponent<HTMLDivElement, MenuRootSlotProps> =\n withProvider<HTMLDivElement, MenuRootSlotProps>(\"div\", \"root\");\n\n// Menu Trigger\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Section\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport const MenuSubmenuSlot = withContext<\n HTMLDivElement,\n MenuSubmenuSlotProps\n>(\"div\", \"submenu\");\n","import { createContext, useContext } from \"react\";\nimport type { MenuRootProps } from \"./../menu.types\";\nimport type { MenuTriggerProps as RaMenuTriggerProps } from \"react-aria-components\";\n\n// Context should contain all Menu props (excluding MenuTrigger-specific props)\nexport type MenuContextValue = Omit<\n MenuRootProps,\n keyof RaMenuTriggerProps | \"children\" | \"trigger\"\n>;\n\nconst MenuContext = createContext<MenuContextValue | undefined>(undefined);\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = () => {\n const context = useContext(MenuContext);\n return context;\n};\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { MenuTrigger as RaMenuTrigger } from \"react-aria-components\";\nimport type { MenuRootProps } from \"../menu.types\";\nimport { MenuRootSlot } from \"../menu.slots\";\nimport { MenuProvider } from \"./menu.context\";\n\nexport const MenuRoot = (props: MenuRootProps) => {\n const recipe = useSlotRecipe({ key: \"menu\" });\n const [recipeProps, functionalProps] = recipe.splitVariantProps(props);\n\n // Separate MenuTrigger props from Menu props\n const {\n children,\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...menuContextProps\n } = functionalProps;\n\n const menuTriggerProps = {\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n };\n\n return (\n <MenuRootSlot {...recipeProps} asChild>\n <RaMenuTrigger {...menuTriggerProps}>\n <MenuProvider value={menuContextProps}>{children}</MenuProvider>\n </RaMenuTrigger>\n </MenuRootSlot>\n );\n};\n\nMenuRoot.displayName = \"Menu.Root\";\n","import { Button } from \"react-aria-components\";\nimport { MenuTriggerSlot } from \"../menu.slots\";\nimport type { MenuTriggerProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuTrigger = ({\n children,\n asChild,\n ref,\n ...props\n}: MenuTriggerProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n /**\n * The user supplied a Button as the trigger\n */\n if (asChild) {\n // When asChild is true, apply styles to the child element\n return (\n <MenuTriggerSlot ref={ref} asChild {...styleProps}>\n {children as ReactNode}\n </MenuTriggerSlot>\n );\n }\n\n /**\n * The user did not supply a Button as trigger, use an unstyled button\n * to wrap which ever element the user supplied and make it a trigger\n */\n return (\n <MenuTriggerSlot asChild {...styleProps}>\n <Button ref={ref} {...restProps}>\n {children}\n </Button>\n </MenuTriggerSlot>\n );\n};\n\nMenuTrigger.displayName = \"Menu.Trigger\";\n","import { createContext, useContext } from \"react\";\n\nexport type MenuSectionContextValue = {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n};\n/**\n * Why is a second context (MenuSectionContext) needed?\n *\n * MenuSectionContext enables section-level config for menu items, such as\n * selection mode, which may differ from the global menu context. This allows\n * advanced menus where each section can have its own selection behavior\n * (e.g., one section is single-select, another is multi-select).\n * By scoping context to a section, menu items inherit settings from their\n * nearest section, falling back to the global menu context if not present.\n * This pattern improves flexibility and composability for complex menus,\n * and avoids prop drilling or awkward prop merging.\n */\n\nconst MenuSectionContext = createContext<MenuSectionContextValue | undefined>(\n undefined\n);\n\nexport const MenuSectionProvider = MenuSectionContext.Provider;\n\nexport const useMenuSectionContext = () => {\n return useContext(MenuSectionContext);\n};\n","import { Menu, Popover } from \"react-aria-components\";\nimport { MenuContentSlot, MenuPopoverSlot } from \"../menu.slots\";\nimport type { MenuContentProps } from \"../menu.types\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\n\nexport const MenuContent = ({\n children,\n placement: placementOverride,\n ref,\n}: MenuContentProps) => {\n const contextProps = useMenuContext();\n\n if (!contextProps) {\n throw new Error(\"Menu.Content must be used within Menu.Root\");\n }\n\n // Separate placement from other props since it's handled by Popover\n const { placement, ...menuProps } = contextProps;\n const finalPlacement = placementOverride || placement || \"bottom start\";\n\n return (\n <MenuSectionProvider value={{ selectionMode: menuProps.selectionMode }}>\n <MenuPopoverSlot asChild>\n <Popover placement={finalPlacement} offset={4} shouldFlip>\n <MenuContentSlot asChild>\n <Menu ref={ref} shouldFocusWrap autoFocus=\"first\" {...menuProps}>\n {children}\n </Menu>\n </MenuContentSlot>\n </Popover>\n </MenuPopoverSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuContent.displayName = \"Menu.Content\";\n","import { MenuItem as RaMenuItem } from \"react-aria-components\";\nimport { MenuItemSlot } from \"../menu.slots\";\nimport type { MenuItemProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { ChevronRight } from \"@commercetools/nimbus-icons\";\nimport { Icon } from \"@/components/icon\";\n\nexport const MenuItem = ({\n children,\n isCritical,\n ref,\n ...props\n}: MenuItemProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuItemSlot\n asChild\n {...styleProps}\n data-critical={isCritical ? \"\" : undefined}\n >\n <RaMenuItem ref={ref} {...restProps}>\n {({ hasSubmenu }) => (\n <>\n {children}\n {hasSubmenu && (\n <Icon slot=\"caretIcon\">\n <ChevronRight />\n </Icon>\n )}\n </>\n )}\n </RaMenuItem>\n </MenuItemSlot>\n );\n};\n\nMenuItem.displayName = \"Menu.Item\";\n","import { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":";;;;;;;;;;;AAaA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAGYC,IACX,gBAAAH,EAAgD,OAAO,MAAM,GAGlDI,IAAkB,gBAAAH,EAG7B,UAAU,SAAS,GAGRI,IAAkB,gBAAAJ,EAG7B,OAAO,SAAS,GAGLK,IAAkB,gBAAAL,EAG7B,OAAO,SAAS,GAGLM,IAAe,gBAAAN;AAAA,EAC1B;AAAA,EACA;AACF,GAGaO,IAAkB,gBAAAP,EAG7B,OAAO,SAAS,GAGLQ,IAAuB,gBAAAR,EAGlC,OAAO,cAAc,GC7CjBS,IAAc,gBAAAC,EAA4C,MAAS,GAE5DC,IAAeF,EAAY,UAE3BG,IAAiB,MACZC,EAAWJ,CAAW,GCT3BK,IAAW,CAACC,MAAyB;AAChD,QAAMC,IAASC,EAAc,EAAE,KAAK,QAAQ,GACtC,CAACC,GAAaC,CAAe,IAAIH,EAAO,kBAAkBD,CAAK,GAG/D;AAAA,IACJ,UAAAK;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDN;AASJ,2BACGjB,GAAA,EAAc,GAAGgB,GAAa,SAAO,IACpC,UAAA,gBAAAQ,EAACC,GAAA,EAAe,GATK;AAAA,IACvB,SAA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AAClB;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),N=require("@chakra-ui/react/styled-system"),u=require("./Dialog-XGXh4NXU.cjs.js"),w=require("@chakra-ui/react"),m=require("react"),F=require("./Button-CFZnLKVR.cjs.js"),a=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),K=require("@commercetools/nimbus-icons"),L=require("./icon-D39U--jA.cjs.js"),E=require("./CollectionBuilder-BiEelELF.cjs.js"),O=require("./Header-BmzdY2bW.cjs.js"),{withProvider:k,withContext:l}=w.createSlotRecipeContext({key:"menu"}),B=k("div","root"),$=l("button","trigger"),D=l("div","popover"),H=l("div","content"),V=l("div","item"),W=l("div","section"),z=l("div","sectionLabel"),j=m.createContext(void 0),A=j.Provider,f=()=>m.useContext(j),S=t=>{const n=N.useSlotRecipe({key:"menu"}),[c,r]=n.splitVariantProps(t),{children:s,trigger:o,isOpen:i,defaultOpen:p,onOpenChange:x,...b}=r,M={trigger:o,isOpen:i,defaultOpen:p,onOpenChange:x};return e.jsx(B,{...c,asChild:!0,children:e.jsx(u.$3674c52c6b3c5bce$export$27d2ad3c5815583e,{...M,children:e.jsx(A,{value:b,children:s})})})};S.displayName="Menu.Root";const h=({children:t,asChild:n,ref:c,...r})=>{const[s,o]=a.extractStyleProps(r);return n?e.jsx($,{ref:c,asChild:!0,...s,children:t}):e.jsx($,{asChild:!0,...s,children:e.jsx(F.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{ref:c,...o,children:t})})};h.displayName="Menu.Trigger";const G=m.createContext(void 0),v=G.Provider,d=({children:t,placement:n,ref:c})=>{const r=f();if(!r)throw new Error("Menu.Content must be used within Menu.Root");const{placement:s,...o}=r,i=n||s||"bottom start";return e.jsx(v,{value:{selectionMode:o.selectionMode},children:e.jsx(D,{asChild:!0,children:e.jsx(u.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:i,offset:4,shouldFlip:!0,children:e.jsx(H,{asChild:!0,children:e.jsx(u.$3674c52c6b3c5bce$export$d9b273488cd8ce6f,{ref:c,shouldFocusWrap:!0,autoFocus:"first",...o,children:t})})})})})};d.displayName="Menu.Content";const g=({children:t,isCritical:n,ref:c,...r})=>{const[s,o]=a.extractStyleProps(r);return e.jsx(V,{asChild:!0,...s,"data-critical":n?"":void 0,children:e.jsx(u.$3674c52c6b3c5bce$export$2ce376c2cc3355c8,{ref:c,...o,children:({hasSubmenu:i})=>e.jsxs(e.Fragment,{children:[t,i&&e.jsx(L.Icon,{slot:"caretIcon",children:e.jsx(K.ChevronRight,{})})]})})})};g.displayName="Menu.Item";const q=({children:t,ref:n,...c})=>{const[r,s]=a.extractStyleProps(c);return e.jsx(z,{asChild:!0,...r,children:e.jsx(O.$72a5793c14baf454$export$8b251419efc915eb,{ref:n,...s,children:t})})};q.displayName="Menu.SectionLabel";const P=({children:t,ref:n,label:c,items:r,...s})=>{const o=f(),{selectionMode:i=o?.selectionMode,selectedKeys:p=o?.selectedKeys,defaultSelectedKeys:x=o?.defaultSelectedKeys,onSelectionChange:b=o?.onSelectionChange,disallowEmptySelection:M=o?.disallowEmptySelection,...R}=s,[T,I]=a.extractStyleProps(R);return e.jsx(v,{value:{selectionMode:i},children:e.jsx(W,{asChild:!0,...T,children:e.jsxs(u.$3674c52c6b3c5bce$export$4b1545b4f2016d26,{ref:n,selectionMode:i,selectedKeys:p,defaultSelectedKeys:x,onSelectionChange:b,disallowEmptySelection:M,...I,children:[e.jsx(q,{children:c}),r?e.jsx(E.$e1995378a142960e$export$fb8073518f34e6ec,{items:r,children:t}):t]})})})};P.displayName="Menu.Section";const C=({children:t,...n})=>e.jsx(u.$3674c52c6b3c5bce$export$ecabc99eeffab7ca,{...n,children:t});C.displayName="Menu.SubmenuTrigger";const y=({children:t,...n})=>e.jsx(d,{...n,placement:"end",children:t});y.displayName="Menu.Submenu";const J={Root:S,Trigger:h,Content:d,Item:g,Section:P,Submenu:y,SubmenuTrigger:C};exports.Menu=J;exports.MenuContent=d;exports.MenuItem=g;exports.MenuRoot=S;exports.MenuSection=P;exports.MenuSubmenu=y;exports.MenuSubmenuTrigger=C;exports.MenuTrigger=h;
|
|
2
|
-
//# sourceMappingURL=menu-DIepV2KZ.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu-DIepV2KZ.cjs.js","sources":["../../src/components/menu/menu.slots.tsx","../../src/components/menu/components/menu.context.tsx","../../src/components/menu/components/menu.root.tsx","../../src/components/menu/components/menu.trigger.tsx","../../src/components/menu/components/menu.section-context.tsx","../../src/components/menu/components/menu.content.tsx","../../src/components/menu/components/menu.item.tsx","../../src/components/menu/components/menu.section-label.tsx","../../src/components/menu/components/menu.section.tsx","../../src/components/menu/components/menu.submenu-trigger.tsx","../../src/components/menu/components/menu.submenu.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type {\n MenuRootSlotProps,\n MenuTriggerSlotProps,\n MenuPopoverSlotProps,\n MenuContentSlotProps,\n MenuItemSlotProps,\n MenuSectionSlotProps,\n MenuSectionLabelSlotProps,\n MenuSubmenuSlotProps,\n} from \"./menu.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"menu\",\n});\n\n// Menu Root\nexport const MenuRootSlot: SlotComponent<HTMLDivElement, MenuRootSlotProps> =\n withProvider<HTMLDivElement, MenuRootSlotProps>(\"div\", \"root\");\n\n// Menu Trigger\nexport const MenuTriggerSlot = withContext<\n HTMLButtonElement,\n MenuTriggerSlotProps\n>(\"button\", \"trigger\");\n\n// Menu Popover\nexport const MenuPopoverSlot = withContext<\n HTMLDivElement,\n MenuPopoverSlotProps\n>(\"div\", \"popover\");\n\n// Menu Content\nexport const MenuContentSlot = withContext<\n HTMLDivElement,\n MenuContentSlotProps\n>(\"div\", \"content\");\n\n// Menu Item\nexport const MenuItemSlot = withContext<HTMLDivElement, MenuItemSlotProps>(\n \"div\",\n \"item\"\n);\n\n// Menu Section\nexport const MenuSectionSlot = withContext<\n HTMLDivElement,\n MenuSectionSlotProps\n>(\"div\", \"section\");\n\n// Menu Section Label\nexport const MenuSectionLabelSlot = withContext<\n HTMLDivElement,\n MenuSectionLabelSlotProps\n>(\"div\", \"sectionLabel\");\n\n// Menu Group Label\nexport const MenuSubmenuSlot = withContext<\n HTMLDivElement,\n MenuSubmenuSlotProps\n>(\"div\", \"submenu\");\n","import { createContext, useContext } from \"react\";\nimport type { MenuRootProps } from \"./../menu.types\";\nimport type { MenuTriggerProps as RaMenuTriggerProps } from \"react-aria-components\";\n\n// Context should contain all Menu props (excluding MenuTrigger-specific props)\nexport type MenuContextValue = Omit<\n MenuRootProps,\n keyof RaMenuTriggerProps | \"children\" | \"trigger\"\n>;\n\nconst MenuContext = createContext<MenuContextValue | undefined>(undefined);\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = () => {\n const context = useContext(MenuContext);\n return context;\n};\n","import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { MenuTrigger as RaMenuTrigger } from \"react-aria-components\";\nimport type { MenuRootProps } from \"../menu.types\";\nimport { MenuRootSlot } from \"../menu.slots\";\nimport { MenuProvider } from \"./menu.context\";\n\nexport const MenuRoot = (props: MenuRootProps) => {\n const recipe = useSlotRecipe({ key: \"menu\" });\n const [recipeProps, functionalProps] = recipe.splitVariantProps(props);\n\n // Separate MenuTrigger props from Menu props\n const {\n children,\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...menuContextProps\n } = functionalProps;\n\n const menuTriggerProps = {\n trigger,\n isOpen,\n defaultOpen,\n onOpenChange,\n };\n\n return (\n <MenuRootSlot {...recipeProps} asChild>\n <RaMenuTrigger {...menuTriggerProps}>\n <MenuProvider value={menuContextProps}>{children}</MenuProvider>\n </RaMenuTrigger>\n </MenuRootSlot>\n );\n};\n\nMenuRoot.displayName = \"Menu.Root\";\n","import { Button } from \"react-aria-components\";\nimport { MenuTriggerSlot } from \"../menu.slots\";\nimport type { MenuTriggerProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuTrigger = ({\n children,\n asChild,\n ref,\n ...props\n}: MenuTriggerProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n /**\n * The user supplied a Button as the trigger\n */\n if (asChild) {\n // When asChild is true, apply styles to the child element\n return (\n <MenuTriggerSlot ref={ref} asChild {...styleProps}>\n {children as ReactNode}\n </MenuTriggerSlot>\n );\n }\n\n /**\n * The user did not supply a Button as trigger, use an unstyled button\n * to wrap which ever element the user supplied and make it a trigger\n */\n return (\n <MenuTriggerSlot asChild {...styleProps}>\n <Button ref={ref} {...restProps}>\n {children}\n </Button>\n </MenuTriggerSlot>\n );\n};\n\nMenuTrigger.displayName = \"Menu.Trigger\";\n","import { createContext, useContext } from \"react\";\n\nexport type MenuSectionContextValue = {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n};\n/**\n * Why is a second context (MenuSectionContext) needed?\n *\n * MenuSectionContext enables section-level config for menu items, such as\n * selection mode, which may differ from the global menu context. This allows\n * advanced menus where each section can have its own selection behavior\n * (e.g., one section is single-select, another is multi-select).\n * By scoping context to a section, menu items inherit settings from their\n * nearest section, falling back to the global menu context if not present.\n * This pattern improves flexibility and composability for complex menus,\n * and avoids prop drilling or awkward prop merging.\n */\n\nconst MenuSectionContext = createContext<MenuSectionContextValue | undefined>(\n undefined\n);\n\nexport const MenuSectionProvider = MenuSectionContext.Provider;\n\nexport const useMenuSectionContext = () => {\n return useContext(MenuSectionContext);\n};\n","import { Menu, Popover } from \"react-aria-components\";\nimport { MenuContentSlot, MenuPopoverSlot } from \"../menu.slots\";\nimport type { MenuContentProps } from \"../menu.types\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\n\nexport const MenuContent = ({\n children,\n placement: placementOverride,\n ref,\n}: MenuContentProps) => {\n const contextProps = useMenuContext();\n\n if (!contextProps) {\n throw new Error(\"Menu.Content must be used within Menu.Root\");\n }\n\n // Separate placement from other props since it's handled by Popover\n const { placement, ...menuProps } = contextProps;\n const finalPlacement = placementOverride || placement || \"bottom start\";\n\n return (\n <MenuSectionProvider value={{ selectionMode: menuProps.selectionMode }}>\n <MenuPopoverSlot asChild>\n <Popover placement={finalPlacement} offset={4} shouldFlip>\n <MenuContentSlot asChild>\n <Menu ref={ref} shouldFocusWrap autoFocus=\"first\" {...menuProps}>\n {children}\n </Menu>\n </MenuContentSlot>\n </Popover>\n </MenuPopoverSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuContent.displayName = \"Menu.Content\";\n","import { MenuItem as RaMenuItem } from \"react-aria-components\";\nimport { MenuItemSlot } from \"../menu.slots\";\nimport type { MenuItemProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { ChevronRight } from \"@commercetools/nimbus-icons\";\nimport { Icon } from \"@/components/icon\";\n\nexport const MenuItem = ({\n children,\n isCritical,\n ref,\n ...props\n}: MenuItemProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuItemSlot\n asChild\n {...styleProps}\n data-critical={isCritical ? \"\" : undefined}\n >\n <RaMenuItem ref={ref} {...restProps}>\n {({ hasSubmenu }) => (\n <>\n {children}\n {hasSubmenu && (\n <Icon slot=\"caretIcon\">\n <ChevronRight />\n </Icon>\n )}\n </>\n )}\n </RaMenuItem>\n </MenuItemSlot>\n );\n};\n\nMenuItem.displayName = \"Menu.Item\";\n","import { Header } from \"react-aria-components\";\nimport { MenuSectionLabelSlot } from \"../menu.slots\";\nimport type { MenuSectionLabelProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * Used in MenuSection for rendering the `label` property.\n */\nexport const MenuSectionLabel = ({\n children,\n ref,\n ...props\n}: MenuSectionLabelProps) => {\n const [styleProps, restProps] = extractStyleProps(props);\n\n return (\n <MenuSectionLabelSlot asChild {...styleProps}>\n <Header ref={ref} {...restProps}>\n {children}\n </Header>\n </MenuSectionLabelSlot>\n );\n};\n\nMenuSectionLabel.displayName = \"Menu.SectionLabel\";\n","import {\n MenuSection as RaMenuSection,\n Collection,\n} from \"react-aria-components\";\nimport { MenuSectionSlot } from \"../menu.slots\";\nimport type { MenuSectionProps } from \"../menu.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { useMenuContext } from \"./menu.context\";\nimport { MenuSectionProvider } from \"./menu.section-context\";\nimport { MenuSectionLabel } from \"./menu.section-label\";\nimport type { ReactNode } from \"react\";\n\nexport const MenuSection = <T extends object = object>({\n children,\n ref,\n label,\n items,\n ...props\n}: MenuSectionProps<T>) => {\n const contextProps = useMenuContext();\n\n // Extract selection-related props before extracting style props\n const {\n selectionMode = contextProps?.selectionMode,\n selectedKeys = contextProps?.selectedKeys,\n defaultSelectedKeys = contextProps?.defaultSelectedKeys,\n onSelectionChange = contextProps?.onSelectionChange,\n disallowEmptySelection = contextProps?.disallowEmptySelection,\n ...restProps\n } = props;\n\n const [styleProps, otherProps] = extractStyleProps(restProps);\n\n return (\n <MenuSectionProvider value={{ selectionMode }}>\n <MenuSectionSlot asChild {...styleProps}>\n <RaMenuSection\n ref={ref}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n disallowEmptySelection={disallowEmptySelection}\n {...otherProps}\n >\n <MenuSectionLabel>{label}</MenuSectionLabel>\n {items ? (\n <Collection items={items}>{children}</Collection>\n ) : (\n (children as ReactNode)\n )}\n </RaMenuSection>\n </MenuSectionSlot>\n </MenuSectionProvider>\n );\n};\n\nMenuSection.displayName = \"Menu.Section\";\n","import { SubmenuTrigger as RaSubmenuTrigger } from \"react-aria-components\";\nimport type { MenuSubmenuTriggerProps } from \"../menu.types\";\n\nexport const MenuSubmenuTrigger = ({\n children,\n ...props\n}: MenuSubmenuTriggerProps) => {\n return <RaSubmenuTrigger {...props}>{children}</RaSubmenuTrigger>;\n};\n\nMenuSubmenuTrigger.displayName = \"Menu.SubmenuTrigger\";\n","import type { MenuSubmenuProps } from \"../menu.types\";\nimport { MenuContent } from \"./menu.content\";\n\nexport const MenuSubmenu = ({ children, ...props }: MenuSubmenuProps) => {\n return (\n <MenuContent {...props} placement=\"end\">\n {children}\n </MenuContent>\n );\n};\n\nMenuSubmenu.displayName = \"Menu.Submenu\";\n","import { MenuRoot } from \"./components/menu.root\";\nimport { MenuTrigger } from \"./components/menu.trigger\";\nimport { MenuContent } from \"./components/menu.content\";\nimport { MenuItem } from \"./components/menu.item\";\nimport { MenuSection } from \"./components/menu.section\";\nimport { MenuSubmenuTrigger } from \"./components/menu.submenu-trigger\";\nimport { MenuSubmenu } from \"./components/menu.submenu\";\n\n// Re-export types\nexport type * from \"./menu.types\";\n\nexport const Menu = {\n Root: MenuRoot,\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Section: MenuSection,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n};\n\n// Exports for internal use by react-docgen\nexport {\n MenuRoot as _MenuRoot,\n MenuTrigger as _MenuTrigger,\n MenuContent as _MenuContent,\n MenuItem as _MenuItem,\n MenuSection as _MenuSection,\n MenuSubmenuTrigger as _MenuSubmenuTrigger,\n MenuSubmenu as _MenuSubmenu,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","MenuRootSlot","MenuTriggerSlot","MenuPopoverSlot","MenuContentSlot","MenuItemSlot","MenuSectionSlot","MenuSectionLabelSlot","MenuContext","createContext","MenuProvider","useMenuContext","useContext","MenuRoot","props","recipe","useSlotRecipe","recipeProps","functionalProps","children","trigger","isOpen","defaultOpen","onOpenChange","menuContextProps","menuTriggerProps","jsx","RaMenuTrigger","MenuTrigger","asChild","ref","styleProps","restProps","extractStyleProps","Button","MenuSectionContext","MenuSectionProvider","MenuContent","placementOverride","contextProps","placement","menuProps","finalPlacement","Popover","Menu","MenuItem","isCritical","RaMenuItem","hasSubmenu","jsxs","Fragment","Icon","ChevronRight","MenuSectionLabel","Header","MenuSection","label","items","selectionMode","selectedKeys","defaultSelectedKeys","onSelectionChange","disallowEmptySelection","otherProps","RaMenuSection","Collection","MenuSubmenuTrigger","RaSubmenuTrigger","MenuSubmenu"],"mappings":"gbAaM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,MACP,CAAC,EAGYC,EACXH,EAAgD,MAAO,MAAM,EAGlDI,EAAkBH,EAG7B,SAAU,SAAS,EAGRI,EAAkBJ,EAG7B,MAAO,SAAS,EAGLK,EAAkBL,EAG7B,MAAO,SAAS,EAGLM,EAAeN,EAC1B,MACA,MACF,EAGaO,EAAkBP,EAG7B,MAAO,SAAS,EAGLQ,EAAuBR,EAGlC,MAAO,cAAc,EC7CjBS,EAAcC,EAAAA,cAA4C,MAAS,EAE5DC,EAAeF,EAAY,SAE3BG,EAAiB,IACZC,EAAAA,WAAWJ,CAAW,ECT3BK,EAAYC,GAAyB,CAChD,MAAMC,EAASC,EAAAA,cAAc,CAAE,IAAK,OAAQ,EACtC,CAACC,EAAaC,CAAe,EAAIH,EAAO,kBAAkBD,CAAK,EAG/D,CACJ,SAAAK,EACA,QAAAC,EACA,OAAAC,EACA,YAAAC,EACA,aAAAC,EACA,GAAGC,CAAA,EACDN,EAEEO,EAAmB,CACvB,QAAAL,EACA,OAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EAGF,aACGtB,EAAA,CAAc,GAAGgB,EAAa,QAAO,GACpC,SAAAS,EAAAA,IAACC,4CAAA,CAAe,GAAGF,EACjB,eAACf,EAAA,CAAa,MAAOc,EAAmB,SAAAL,CAAA,CAAS,EACnD,EACF,CAEJ,EAEAN,EAAS,YAAc,YC9BhB,MAAMe,EAAc,CAAC,CAC1B,SAAAT,EACA,QAAAU,EACA,IAAAC,EACA,GAAGhB,CACL,IAAwB,CACtB,KAAM,CAACiB,EAAYC,CAAS,EA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EACA,aAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACC,GAAGC,EAEJ,SAAA,CAAArC,EAAAA,IAAC2B,GAAkB,SAAAG,CAAA,CAAM,EACxBC,EACC/B,EAAAA,IAACuC,EAAAA,0CAAA,CAAW,MAAAR,EAAe,SAAAtC,EAAS,EAEnCA,CAAA,CAAA,CAAA,EAGP,CAAA,CACF,CAEJ,EAEAoC,EAAY,YAAc,eCtDnB,MAAMW,EAAqB,CAAC,CACjC,SAAA/C,EACA,GAAGL,CACL,IACSY,EAAAA,IAACyC,EAAAA,0CAAA,CAAkB,GAAGrD,EAAQ,SAAAK,CAAA,CAAS,EAGhD+C,EAAmB,YAAc,sBCP1B,MAAME,EAAc,CAAC,CAAE,SAAAjD,EAAU,GAAGL,WAEtCuB,EAAA,CAAa,GAAGvB,EAAO,UAAU,MAC/B,SAAAK,EACH,EAIJiD,EAAY,YAAc,eCAnB,MAAMxB,EAAO,CAClB,KAAM/B,EACN,QAASe,EACT,QAASS,EACT,KAAMQ,EACN,QAASU,EACT,QAASa,EACT,eAAgBF,CAClB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime"),s=require("react"),ui=require("@chakra-ui/react/styled-system"),N=require("react-intl"),li=require("@commercetools/nimbus-icons"),pi=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),di=require("@chakra-ui/react"),mi=require("./group-BqUFlw5R.cjs.js"),yi=require("./index-CRFg4Mhx.cjs.js"),A=require("./mergeProps-BA5Cwf5w.cjs.js"),Mi=require("./context-OoV8SSWX.cjs.js"),B=require("./select-DMsU6bk9.cjs.js"),hi=require("./number-input-wMW-o4di.cjs.js"),Ci=require("./make-element-focusable-oedzOY_M.cjs.js"),U=require("./tooltip-BPTOkK7W.cjs.js"),Si=require("./box-CWni3A32.cjs.js"),u={ADP:{fractionDigits:0},AED:{fractionDigits:2},AFA:{fractionDigits:2},AFN:{fractionDigits:2},ALL:{fractionDigits:2},AMD:{fractionDigits:2},ANG:{fractionDigits:2},AOA:{fractionDigits:2},ARS:{fractionDigits:2},ATS:{fractionDigits:2},AUD:{fractionDigits:2},AWG:{fractionDigits:2},AYM:{fractionDigits:2},AZM:{fractionDigits:2},AZN:{fractionDigits:2},BAM:{fractionDigits:2},BBD:{fractionDigits:2},BDT:{fractionDigits:2},BEF:{fractionDigits:0},BGL:{fractionDigits:2},BGN:{fractionDigits:2},BHD:{fractionDigits:3},BIF:{fractionDigits:0},BMD:{fractionDigits:2},BND:{fractionDigits:2},BOB:{fractionDigits:2},BOV:{fractionDigits:2},BRL:{fractionDigits:2},BSD:{fractionDigits:2},BTN:{fractionDigits:2},BWP:{fractionDigits:2},BYB:{fractionDigits:0},BYN:{fractionDigits:2},BYR:{fractionDigits:0},BZD:{fractionDigits:2},CAD:{fractionDigits:2},CDF:{fractionDigits:2},CHF:{fractionDigits:2},CLF:{fractionDigits:0},CLP:{fractionDigits:0},CNY:{fractionDigits:2},COP:{fractionDigits:2},CRC:{fractionDigits:2},CSD:{fractionDigits:2},CUC:{fractionDigits:2},CUP:{fractionDigits:2},CVE:{fractionDigits:2},CYP:{fractionDigits:2},CZK:{fractionDigits:2},DEM:{fractionDigits:2},DJF:{fractionDigits:0},DKK:{fractionDigits:2},DOP:{fractionDigits:2},DZD:{fractionDigits:2},EEK:{fractionDigits:2},EGP:{fractionDigits:2},ERN:{fractionDigits:2},ESP:{fractionDigits:0},ETB:{fractionDigits:2},EUR:{fractionDigits:2},FIM:{fractionDigits:2},FJD:{fractionDigits:2},FKP:{fractionDigits:2},FRF:{fractionDigits:2},GBP:{fractionDigits:2},GEL:{fractionDigits:2},GHC:{fractionDigits:2},GHS:{fractionDigits:2},GIP:{fractionDigits:2},GMD:{fractionDigits:2},GNF:{fractionDigits:0},GRD:{fractionDigits:0},GTQ:{fractionDigits:2},GWP:{fractionDigits:2},GYD:{fractionDigits:2},HKD:{fractionDigits:2},HNL:{fractionDigits:2},HRK:{fractionDigits:2},HTG:{fractionDigits:2},HUF:{fractionDigits:2},IDR:{fractionDigits:2},IEP:{fractionDigits:2},ILS:{fractionDigits:2},INR:{fractionDigits:2},IQD:{fractionDigits:3},IRR:{fractionDigits:2},ISK:{fractionDigits:0},ITL:{fractionDigits:0},JMD:{fractionDigits:2},JOD:{fractionDigits:3},JPY:{fractionDigits:0},KES:{fractionDigits:2},KGS:{fractionDigits:2},KHR:{fractionDigits:2},KMF:{fractionDigits:0},KPW:{fractionDigits:2},KRW:{fractionDigits:0},KWD:{fractionDigits:3},KYD:{fractionDigits:2},KZT:{fractionDigits:2},LAK:{fractionDigits:2},LBP:{fractionDigits:2},LKR:{fractionDigits:2},LRD:{fractionDigits:2},LSL:{fractionDigits:2},LTL:{fractionDigits:2},LUF:{fractionDigits:0},LVL:{fractionDigits:2},LYD:{fractionDigits:3},MAD:{fractionDigits:2},MDL:{fractionDigits:2},MGA:{fractionDigits:2},MGF:{fractionDigits:0},MKD:{fractionDigits:2},MMK:{fractionDigits:2},MNT:{fractionDigits:2},MOP:{fractionDigits:2},MRO:{fractionDigits:2},MTL:{fractionDigits:2},MUR:{fractionDigits:2},MVR:{fractionDigits:2},MWK:{fractionDigits:2},MXN:{fractionDigits:2},MXV:{fractionDigits:2},MYR:{fractionDigits:2},MZM:{fractionDigits:2},MZN:{fractionDigits:2},NAD:{fractionDigits:2},NGN:{fractionDigits:2},NIO:{fractionDigits:2},NLG:{fractionDigits:2},NOK:{fractionDigits:2},NPR:{fractionDigits:2},NZD:{fractionDigits:2},OMR:{fractionDigits:3},PAB:{fractionDigits:2},PEN:{fractionDigits:2},PGK:{fractionDigits:2},PHP:{fractionDigits:2},PKR:{fractionDigits:2},PLN:{fractionDigits:2},PTE:{fractionDigits:0},PYG:{fractionDigits:0},QAR:{fractionDigits:2},ROL:{fractionDigits:2},RON:{fractionDigits:2},RSD:{fractionDigits:2},RUB:{fractionDigits:2},RUR:{fractionDigits:2},RWF:{fractionDigits:0},SAR:{fractionDigits:2},SBD:{fractionDigits:2},SCR:{fractionDigits:2},SDD:{fractionDigits:2},SDG:{fractionDigits:2},SEK:{fractionDigits:2},SGD:{fractionDigits:2},SHP:{fractionDigits:2},SIT:{fractionDigits:2},SKK:{fractionDigits:2},SLL:{fractionDigits:2},SOS:{fractionDigits:2},SRD:{fractionDigits:2},SRG:{fractionDigits:2},SSP:{fractionDigits:2},STD:{fractionDigits:2},SVC:{fractionDigits:2},SYP:{fractionDigits:2},SZL:{fractionDigits:2},THB:{fractionDigits:2},TJS:{fractionDigits:2},TMM:{fractionDigits:2},TMT:{fractionDigits:2},TND:{fractionDigits:3},TOP:{fractionDigits:2},TPE:{fractionDigits:0},TRL:{fractionDigits:0},TRY:{fractionDigits:2},TTD:{fractionDigits:2},TWD:{fractionDigits:2},TZS:{fractionDigits:2},UAH:{fractionDigits:2},UGX:{fractionDigits:0},USD:{fractionDigits:2},USN:{fractionDigits:2},USS:{fractionDigits:2},UYU:{fractionDigits:2},UZS:{fractionDigits:2},VEB:{fractionDigits:2},VEF:{fractionDigits:2},VND:{fractionDigits:0},VUV:{fractionDigits:0},WST:{fractionDigits:2},XAF:{fractionDigits:0},XAG:{fractionDigits:-1},XAU:{fractionDigits:-1},XBA:{fractionDigits:-1},XBB:{fractionDigits:-1},XBC:{fractionDigits:-1},XBD:{fractionDigits:-1},XCD:{fractionDigits:2},XDR:{fractionDigits:-1},XFO:{fractionDigits:-1},XFU:{fractionDigits:-1},XOF:{fractionDigits:0},XPD:{fractionDigits:-1},XPF:{fractionDigits:0},XPT:{fractionDigits:-1},XSU:{fractionDigits:-1},XTS:{fractionDigits:-1},XUA:{fractionDigits:-1},XXX:{fractionDigits:-1},YER:{fractionDigits:2},YUM:{fractionDigits:2},ZAR:{fractionDigits:2},ZMK:{fractionDigits:2},ZMW:{fractionDigits:2},ZWD:{fractionDigits:2},ZWL:{fractionDigits:2},ZWN:{fractionDigits:2},ZWR:{fractionDigits:2}},{withProvider:bi,withContext:p}=di.createSlotRecipeContext({key:"moneyInput"}),Pi=bi(mi.Group,"root"),Ii=p("div","container"),Ri=p("div","currencySelect"),Ai=p("label","currencyLabel"),Bi=p("input","amountInput"),Ni=p("div","badge"),Li=(i,r,o)=>{if(!o)return null;const t=u[o];if(!t||i.length===0||i.trim()==="")return null;!r&&t.fractionDigits===0&&console.warn(`MoneyInput: A locale must be provided when currency has no fraction digits (${o})`);const e=parseFloat(i);if(isNaN(e))return null;const g=Math.trunc(Math.round(e*10**t.fractionDigits)),D=String(e).indexOf(".")===-1?0:String(e).length-String(e).indexOf(".")-1;return D>t.fractionDigits?{type:"highPrecision",currencyCode:o,centAmount:g,preciseAmount:parseInt(String(e).replace(".",""),10),fractionDigits:D}:{type:"centPrecision",currencyCode:o,centAmount:g,fractionDigits:t.fractionDigits}},Fi=i=>i.type==="highPrecision"?i.preciseAmount/10**i.fractionDigits:i.centAmount/10**u[i.currencyCode].fractionDigits,j=(i,r)=>Object.prototype.hasOwnProperty.call(i,r);function f(i,r){return i&&r?`${i}.${r}`:void 0}const H=(i,r)=>Li(typeof i.amount=="string"?i.amount.trim():"",r,i.currencyCode),xi=(i,r)=>{if(!i)return{currencyCode:"",amount:""};if(console.warn(typeof r=="string","MoneyInput.parseMoneyValue: A locale must be passed as the second argument"),console.warn(typeof i=="object","MoneyInput.parseMoneyValue: Value must be passed as an object or be undefined"),console.warn(typeof i.currencyCode=="string",'MoneyInput.parseMoneyValue: Value must contain "currencyCode"'),typeof i.currencyCode!="string")throw new Error('MoneyInput.parseMoneyValue: Value must contain "currencyCode"');if(console.warn(j(u,i.currencyCode),"MoneyInput.parseMoneyValue: Value must use known currency code"),!j(u,i.currencyCode))throw new Error("MoneyInput.parseMoneyValue: Value must use known currency code");console.warn(typeof i.centAmount=="number"||typeof i.preciseAmount=="number"&&typeof i.fractionDigits=="number",'MoneyInput.parseMoneyValue: Value must contain "amount"');const o=Fi(i),t=i.preciseAmount?i.fractionDigits:u[i.currencyCode].fractionDigits;return{amount:isNaN(o)?"":o.toLocaleString(r,{minimumFractionDigits:t}),currencyCode:i.currencyCode}},Z=i=>!i||i?.amount?.trim()===""||i?.currencyCode?.trim()==="",w=(i,r)=>Z(i)?!1:H(i,r)?.type==="highPrecision",b=N.defineMessages({currencySelectLabel:{id:"Nimbus.MoneyInput.currencySelectLabel",description:"aria-label for currency selection dropdown",defaultMessage:"Currency"},amountInputLabel:{id:"Nimbus.MoneyInput.amountInputLabel",description:"aria-label for amount input",defaultMessage:"Amount"},highPrecisionPrice:{id:"Nimbus.MoneyInput.highPrecisionPrice",description:"tooltip text for high precision price badge",defaultMessage:"High precision price"}}),a=i=>{const{id:r,name:o,value:t,currencies:e=[],onChange:g,onValueChange:D,onAmountChange:L,onCurrencyChange:F,onFocus:d,onBlur:m,isDisabled:l,isReadOnly:x,isInvalid:Y,isRequired:q,hasHighPrecisionBadge:T=!0,isCurrencyInputDisabled:V,placeholder:$="0.00",autoFocus:W,size:P,...k}=i,J=A.$bdb11010cef70236$export$f680877a34711e37(),I=r??J,{locale:G}=Mi.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),R=N.useIntl(),Q=t.amount?parseFloat(t.amount):void 0,z=!e||e.length===0,K=w(t,G||"en"),_=s.useMemo(()=>t.currencyCode?{minimumFractionDigits:u[t.currencyCode].fractionDigits,maximumFractionDigits:20,useGrouping:!0,style:"decimal"}:{},[t.currencyCode,G]),ii=ui.useSlotRecipe({recipe:yi.moneyInputRecipe}),[ti,ni]=ii.splitVariantProps({...k,size:P}),[ri,oi]=pi.extractStyleProps(ni),y=f(I,"amount"),M=f(I,"currencyCode"),h=f(o,"amount"),C=f(o,"currencyCode"),ci=s.useCallback(n=>{const S=n.toString();g?.({target:{id:y,name:h,value:S}});const fi={...t,amount:S};D?.(fi),L?.(S)},[g,D,L,t,I,o]),ei=s.useCallback(()=>{const n={target:{id:y,name:h,value:t.amount}};d?.(n)},[d,t.amount,r,o]),si=s.useCallback(()=>{const n={target:{id:y,name:h,value:t.amount}};m?.(n)},[m,t,r,o]),O=s.useCallback(n=>{g?.({target:{id:M,name:C,value:n}});const v={...t,currencyCode:n};D?.(v),F?.(n)},[g,D,F,t,r,o]),ai=s.useCallback(()=>{const n={target:{id:M,name:C,value:t.currencyCode}};d?.(n)},[d,t.currencyCode,r,o]),gi=s.useCallback(()=>{const n={target:{id:M,name:C,value:t.currencyCode}};m?.(n)},[m,t.currencyCode,r,o]),Di=s.useCallback(n=>{n&&typeof n=="string"&&O(n)},[O]),E=A.$bdb11010cef70236$export$f680877a34711e37(),X=A.$bdb11010cef70236$export$f680877a34711e37();return c.jsxs(Pi,{...ti,...ri,...oi,children:[c.jsxs(Ii,{children:[c.jsx(Ri,{children:z?c.jsx(Ai,{...l&&{"data-disabled":l},asChild:!0,children:c.jsx("label",{id:E,children:t.currencyCode})}):c.jsx(B.Select.Root,{id:M,name:C,selectedKey:t.currencyCode||null,onSelectionChange:Di,onFocus:ai,onBlur:gi,isDisabled:V||l||x,isClearable:!1,placeholder:"","aria-label":R.formatMessage(b.currencySelectLabel),size:P,children:c.jsx(B.Select.Options,{children:e.map(n=>c.jsx(B.Select.Option,{id:n,children:n},n))})})}),c.jsx(Bi,{"data-has-high-precision":T&&K,asChild:!0,children:c.jsx(hi.NumberInput,{id:y,name:h,value:Q,formatOptions:_,onChange:ci,onFocus:ei,onBlur:si,isDisabled:l,isReadOnly:x,isInvalid:Y,isRequired:q,placeholder:$,autoFocus:W,size:P,"aria-label":R.formatMessage(b.amountInputLabel),"aria-labelledby":E,"aria-describedby":X,step:void 0})})]}),T&&K&&c.jsx(Ni,{children:c.jsxs(U.Tooltip.Root,{delay:0,closeDelay:0,children:[c.jsx(Ci.MakeElementFocusable,{children:c.jsx(Si.Box,{as:li.HighPrecision,id:X,color:l?"neutral.8":"neutral.11","aria-label":R.formatMessage(b.highPrecisionPrice),transform:"translateX(-100px) translateY(2px)"})}),c.jsx(U.Tooltip.Content,{placement:"top",children:c.jsx(N.FormattedMessage,{...b.highPrecisionPrice})})]})})]})};a.getAmountInputId=i=>f(i,"amount");a.getCurrencyDropdownId=i=>f(i,"currencyCode");a.convertToMoneyValue=H;a.parseMoneyValue=xi;a.isEmpty=Z;a.isHighPrecision=w;a.displayName="MoneyInput";exports.MoneyInput=a;
|
|
2
|
-
//# sourceMappingURL=money-input-Cu_J86Eu.cjs.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),u=require("react"),d=require("@chakra-ui/react"),y=require("@chakra-ui/react/styled-system"),I=require("./TextArea-Y5635aIM.cjs.js"),T=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),b=require("./index-CRFg4Mhx.cjs.js"),$=require("./useObjectRef-dXOJdONs.cjs.js"),q=require("./useTextField-0jWzqKW2.cjs.js"),{withContext:p,withProvider:v}=d.createSlotRecipeContext({key:"multilineTextInput"}),S=v("div","root"),j=p("div","leadingElement"),w=p("textarea","textarea");function M(s,l={}){const{enabled:n=!1}=l,r=u.useCallback(()=>{const e=s.current;if(!e||!n)return;e.style.height="auto";const t=e.scrollHeight,a=window.getComputedStyle(e),o=parseInt(a.maxHeight,10),c=!isNaN(o)&&o>0?Math.min(t,o):t;e.style.height=`${c}px`},[n]);u.useEffect(()=>{const e=s.current;if(!e||!n)return;r();const t=()=>{r()};return e.addEventListener("input",t),()=>{e.removeEventListener("input",t)}},[r,n])}const x=s=>{const{ref:l,leadingElement:n,rows:r=1,autoGrow:e=!1,...t}=s,a=y.useRecipe({recipe:b.multilineTextInputRecipe}),o=u.useRef(null),c=$.$df56164dff5785e2$export$4338b53315abf666(d.mergeRefs(o,l)),[f,h]=a.splitVariantProps(t),[m,g]=T.extractStyleProps(h),{inputProps:P}=q.$2d73ec29415bd339$export$712718f7aec83d5(g,c);M(c,{enabled:e});const R={"data-disabled":t.isDisabled?"true":void 0,"data-invalid":t.isInvalid?"true":"false"};return i.jsx(S,{className:s?.className,...f,...m,...R,children:i.jsxs(i.Fragment,{children:[n&&i.jsx(j,{children:n}),i.jsx(w,{asChild:!0,children:i.jsx(I.$216918bed6669f72$export$f5c9f3c2c4054eec,{ref:c,rows:r,...P})})]})})};x.displayName="MultilineTextInput";exports.MultilineTextInput=x;
|
|
2
|
-
//# sourceMappingURL=multiline-text-input-B9TBDieZ.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiline-text-input-B9TBDieZ.cjs.js","sources":["../../src/components/multiline-text-input/multiline-text-input.slots.tsx","../../src/components/multiline-text-input/hooks/use-autogrow.ts","../../src/components/multiline-text-input/multiline-text-input.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n MultilineTextInputRootSlotProps,\n MultilineTextInputLeadingElementSlotProps,\n MultilineTextInputTextAreaSlotProps,\n} from \"./multiline-text-input.types\";\n\nconst { withContext, withProvider } = createSlotRecipeContext({\n key: \"multilineTextInput\",\n});\n\n/**\n * Root component that provides the styling context for the MultilineTextInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const MultilineTextInputRootSlot = withProvider<\n HTMLDivElement,\n MultilineTextInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const MultilineTextInputLeadingElementSlot = withContext<\n HTMLDivElement,\n MultilineTextInputLeadingElementSlotProps\n>(\"div\", \"leadingElement\");\n\nexport const MultilineTextInputTextAreaSlot = withContext<\n HTMLTextAreaElement,\n MultilineTextInputTextAreaSlotProps\n>(\"textarea\", \"textarea\");\n","import { useEffect, useCallback } from \"react\";\nimport type { RefObject } from \"react\";\n\ntype UseAutogrowOptions = {\n enabled?: boolean;\n};\n\n/**\n * Hook for managing textarea autogrow behavior\n *\n * @param ref - Reference to the textarea element\n * @param options - Configuration options\n * @param options.enabled - Whether autogrow is enabled\n * @returns void\n *\n * @internal\n */\nexport function useAutogrow(\n ref: RefObject<HTMLTextAreaElement | null>,\n options: UseAutogrowOptions = {}\n): void {\n const { enabled = false } = options;\n\n const adjustHeight = useCallback(() => {\n const textarea = ref.current;\n if (!textarea || !enabled) return;\n\n // Reset height to auto to get the correct scrollHeight\n textarea.style.height = \"auto\";\n\n // Calculate the new height based on content\n const contentHeight = textarea.scrollHeight;\n\n // Apply maxHeight constraint if specified\n const computedStyle = window.getComputedStyle(textarea);\n const maxHeightPxValue = parseInt(computedStyle.maxHeight, 10);\n\n // Check if maxHeight is a valid number and apply constraint\n const finalHeight =\n !isNaN(maxHeightPxValue) && maxHeightPxValue > 0\n ? Math.min(contentHeight, maxHeightPxValue)\n : contentHeight;\n\n // Set the new height\n textarea.style.height = `${finalHeight}px`;\n }, [enabled]);\n\n // Set up auto-grow behavior with event listeners\n useEffect(() => {\n const textarea = ref.current;\n if (!textarea || !enabled) return;\n\n // Initial adjustment\n adjustHeight();\n\n // Add input event listener for real-time adjustments\n const handleInput = () => {\n adjustHeight();\n };\n\n textarea.addEventListener(\"input\", handleInput);\n\n // Cleanup\n return () => {\n textarea.removeEventListener(\"input\", handleInput);\n };\n }, [adjustHeight, enabled]);\n}\n","import { useRef } from \"react\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { useObjectRef, useTextField } from \"react-aria\";\nimport { TextArea } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nimport {\n MultilineTextInputRootSlot,\n MultilineTextInputLeadingElementSlot,\n MultilineTextInputTextAreaSlot,\n} from \"./multiline-text-input.slots\";\nimport type { MultilineTextInputProps } from \"./multiline-text-input.types\";\nimport { multilineTextInputRecipe } from \"./multiline-text-input.recipe\";\nimport { useAutogrow } from \"./hooks\";\n\n/**\n * # Multiline Text Input\n *\n * A multiline text input component for capturing longer text content.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/forms/multiline-text-input}\n */\nexport const MultilineTextInput = (props: MultilineTextInputProps) => {\n const {\n ref: forwardedRef,\n leadingElement,\n rows = 1,\n autoGrow = false,\n ...restProps\n } = props; // The default `rows` attribute for a textarea is 2, so we need to override it\n const recipe = useRecipe({ recipe: multilineTextInputRecipe });\n\n const localRef = useRef<HTMLTextAreaElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n\n const [recipeProps, remainingProps] = recipe.splitVariantProps(restProps);\n const [styleProps, functionalProps] = extractStyleProps(remainingProps);\n const { inputProps } = useTextField<\"textarea\">(functionalProps, ref);\n\n // Use autogrow hook for auto-grow functionality\n useAutogrow(ref, { enabled: autoGrow });\n\n const additionalRootProps = {\n \"data-disabled\": restProps.isDisabled ? \"true\" : undefined,\n \"data-invalid\": restProps.isInvalid ? \"true\" : \"false\",\n };\n\n return (\n <MultilineTextInputRootSlot\n className={props?.className as string}\n {...recipeProps}\n {...styleProps}\n {...additionalRootProps}\n >\n <>\n {leadingElement && (\n <MultilineTextInputLeadingElementSlot>\n {leadingElement}\n </MultilineTextInputLeadingElementSlot>\n )}\n <MultilineTextInputTextAreaSlot asChild>\n <TextArea ref={ref} rows={rows} {...inputProps} />\n </MultilineTextInputTextAreaSlot>\n </>\n </MultilineTextInputRootSlot>\n );\n};\n\nMultilineTextInput.displayName = \"MultilineTextInput\";\n"],"names":["withContext","withProvider","createSlotRecipeContext","MultilineTextInputRootSlot","MultilineTextInputLeadingElementSlot","MultilineTextInputTextAreaSlot","useAutogrow","ref","options","enabled","adjustHeight","useCallback","textarea","contentHeight","computedStyle","maxHeightPxValue","finalHeight","useEffect","handleInput","MultilineTextInput","props","forwardedRef","leadingElement","rows","autoGrow","restProps","recipe","useRecipe","multilineTextInputRecipe","localRef","useRef","useObjectRef","mergeRefs","recipeProps","remainingProps","styleProps","functionalProps","extractStyleProps","inputProps","useTextField","additionalRootProps","jsx","jsxs","Fragment","TextArea"],"mappings":"qWAOM,CAAE,YAAAA,EAAa,aAAAC,CAAA,EAAiBC,0BAAwB,CAC5D,IAAK,oBACP,CAAC,EAMYC,EAA6BF,EAGxC,MAAO,MAAM,EAEFG,EAAuCJ,EAGlD,MAAO,gBAAgB,EAEZK,EAAiCL,EAG5C,WAAY,UAAU,ECXjB,SA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AA,CAAU,EAEtC,MAAMgB,EAAsB,CAC1B,gBAAiBf,EAAU,WAAa,OAAS,OACjD,eAAgBA,EAAU,UAAY,OAAS,OAAA,EAGjD,OACEgB,EAAAA,IAACtC,EAAA,CACC,UAAWiB,GAAO,UACjB,GAAGa,EACH,GAAGE,EACH,GAAGK,EAEJ,SAAAE,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAArB,GACCmB,EAAAA,IAACrC,GACE,SAAAkB,CAAA,CACH,EAEFmB,EAAAA,IAACpC,EAAA,CAA+B,QAAO,GACrC,SAAAoC,EAAAA,IAACG,EAAAA,2CAAS,IAAArC,EAAU,KAAAgB,EAAa,GAAGe,CAAA,CAAY,CAAA,CAClD,CAAA,CAAA,CACF,CAAA,CAAA,CAGN,EAEAnB,EAAmB,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiline-text-input-CilSJJaO.es.js","sources":["../../src/components/multiline-text-input/multiline-text-input.slots.tsx","../../src/components/multiline-text-input/hooks/use-autogrow.ts","../../src/components/multiline-text-input/multiline-text-input.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n MultilineTextInputRootSlotProps,\n MultilineTextInputLeadingElementSlotProps,\n MultilineTextInputTextAreaSlotProps,\n} from \"./multiline-text-input.types\";\n\nconst { withContext, withProvider } = createSlotRecipeContext({\n key: \"multilineTextInput\",\n});\n\n/**\n * Root component that provides the styling context for the MultilineTextInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const MultilineTextInputRootSlot = withProvider<\n HTMLDivElement,\n MultilineTextInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const MultilineTextInputLeadingElementSlot = withContext<\n HTMLDivElement,\n MultilineTextInputLeadingElementSlotProps\n>(\"div\", \"leadingElement\");\n\nexport const MultilineTextInputTextAreaSlot = withContext<\n HTMLTextAreaElement,\n MultilineTextInputTextAreaSlotProps\n>(\"textarea\", \"textarea\");\n","import { useEffect, useCallback } from \"react\";\nimport type { RefObject } from \"react\";\n\ntype UseAutogrowOptions = {\n enabled?: boolean;\n};\n\n/**\n * Hook for managing textarea autogrow behavior\n *\n * @param ref - Reference to the textarea element\n * @param options - Configuration options\n * @param options.enabled - Whether autogrow is enabled\n * @returns void\n *\n * @internal\n */\nexport function useAutogrow(\n ref: RefObject<HTMLTextAreaElement | null>,\n options: UseAutogrowOptions = {}\n): void {\n const { enabled = false } = options;\n\n const adjustHeight = useCallback(() => {\n const textarea = ref.current;\n if (!textarea || !enabled) return;\n\n // Reset height to auto to get the correct scrollHeight\n textarea.style.height = \"auto\";\n\n // Calculate the new height based on content\n const contentHeight = textarea.scrollHeight;\n\n // Apply maxHeight constraint if specified\n const computedStyle = window.getComputedStyle(textarea);\n const maxHeightPxValue = parseInt(computedStyle.maxHeight, 10);\n\n // Check if maxHeight is a valid number and apply constraint\n const finalHeight =\n !isNaN(maxHeightPxValue) && maxHeightPxValue > 0\n ? Math.min(contentHeight, maxHeightPxValue)\n : contentHeight;\n\n // Set the new height\n textarea.style.height = `${finalHeight}px`;\n }, [enabled]);\n\n // Set up auto-grow behavior with event listeners\n useEffect(() => {\n const textarea = ref.current;\n if (!textarea || !enabled) return;\n\n // Initial adjustment\n adjustHeight();\n\n // Add input event listener for real-time adjustments\n const handleInput = () => {\n adjustHeight();\n };\n\n textarea.addEventListener(\"input\", handleInput);\n\n // Cleanup\n return () => {\n textarea.removeEventListener(\"input\", handleInput);\n };\n }, [adjustHeight, enabled]);\n}\n","import { useRef } from \"react\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { useObjectRef, useTextField } from \"react-aria\";\nimport { TextArea } from \"react-aria-components\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\nimport {\n MultilineTextInputRootSlot,\n MultilineTextInputLeadingElementSlot,\n MultilineTextInputTextAreaSlot,\n} from \"./multiline-text-input.slots\";\nimport type { MultilineTextInputProps } from \"./multiline-text-input.types\";\nimport { multilineTextInputRecipe } from \"./multiline-text-input.recipe\";\nimport { useAutogrow } from \"./hooks\";\n\n/**\n * # Multiline Text Input\n *\n * A multiline text input component for capturing longer text content.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/forms/multiline-text-input}\n */\nexport const MultilineTextInput = (props: MultilineTextInputProps) => {\n const {\n ref: forwardedRef,\n leadingElement,\n rows = 1,\n autoGrow = false,\n ...restProps\n } = props; // The default `rows` attribute for a textarea is 2, so we need to override it\n const recipe = useRecipe({ recipe: multilineTextInputRecipe });\n\n const localRef = useRef<HTMLTextAreaElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n\n const [recipeProps, remainingProps] = recipe.splitVariantProps(restProps);\n const [styleProps, functionalProps] = extractStyleProps(remainingProps);\n const { inputProps } = useTextField<\"textarea\">(functionalProps, ref);\n\n // Use autogrow hook for auto-grow functionality\n useAutogrow(ref, { enabled: autoGrow });\n\n const additionalRootProps = {\n \"data-disabled\": restProps.isDisabled ? \"true\" : undefined,\n \"data-invalid\": restProps.isInvalid ? \"true\" : \"false\",\n };\n\n return (\n <MultilineTextInputRootSlot\n className={props?.className as string}\n {...recipeProps}\n {...styleProps}\n {...additionalRootProps}\n >\n <>\n {leadingElement && (\n <MultilineTextInputLeadingElementSlot>\n {leadingElement}\n </MultilineTextInputLeadingElementSlot>\n )}\n <MultilineTextInputTextAreaSlot asChild>\n <TextArea ref={ref} rows={rows} {...inputProps} />\n </MultilineTextInputTextAreaSlot>\n </>\n </MultilineTextInputRootSlot>\n );\n};\n\nMultilineTextInput.displayName = \"MultilineTextInput\";\n"],"names":["withContext","withProvider","createSlotRecipeContext","MultilineTextInputRootSlot","MultilineTextInputLeadingElementSlot","MultilineTextInputTextAreaSlot","useAutogrow","ref","options","enabled","adjustHeight","useCallback","textarea","contentHeight","computedStyle","maxHeightPxValue","finalHeight","useEffect","handleInput","MultilineTextInput","props","forwardedRef","leadingElement","rows","autoGrow","restProps","recipe","useRecipe","multilineTextInputRecipe","localRef","useRef","useObjectRef","mergeRefs","recipeProps","remainingProps","styleProps","functionalProps","extractStyleProps","inputProps","useTextField","additionalRootProps","jsx","jsxs","Fragment","TextArea"],"mappings":";;;;;;;;;AAOA,MAAM,EAAE,aAAAA,GAAa,cAAAC,EAAA,IAAiB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAA6B,gBAAAF,EAGxC,OAAO,MAAM,GAEFG,IAAuC,gBAAAJ,EAGlD,OAAO,gBAAgB,GAEZK,IAAiC,gBAAAL,EAG5C,YAAY,UAAU;ACXjB,SAASM,EACdC,GACAC,IAA8B,IACxB;AACN,QAAM,EAAE,SAAAC,IAAU,GAAA,IAAUD,GAEtBE,IAAeC,EAAY,MAAM;AACrC,UAAMC,IAAWL,EAAI;AACrB,QAAI,CAACK,KAAY,CAACH,EAAS;AAG3B,IAAAG,EAAS,MAAM,SAAS;AAGxB,UAAMC,IAAgBD,EAAS,cAGzBE,IAAgB,OAAO,iBAAiBF,CAAQ,GAChDG,IAAmB,SAASD,EAAc,WAAW,EAAE,GAGvDE,IACJ,CAAC,MAAMD,CAAgB,KAAKA,IAAmB,IAC3C,KAAK,IAAIF,GAAeE,CAAgB,IACxCF;AAGN,IAAAD,EAAS,MAAM,SAAS,GAAGI,CAAW;AAAA,EACxC,GAAG,CAACP,CAAO,CAAC;AAGZ,EAAAQ,EAAU,MAAM;AACd,UAAML,IAAWL,EAAI;AACrB,QAAI,CAACK,KAAY,CAACH,EAAS;AAG3B,IAAAC,EAAA;AAGA,UAAMQ,IAAc,MAAM;AACxB,MAAAR,EAAA;AAAA,IACF;AAEA,WAAAE,EAAS,iBAAiB,SAASM,CAAW,GAGvC,MAAM;AACX,MAAAN,EAAS,oBAAoB,SAASM,CAAW;AAAA,IACnD;AAAA,EACF,GAAG,CAACR,GAAcD,CAAO,CAAC;AAC5B;AC5CO,MAAMU,IAAqB,CAACC,MAAmC;AACpE,QAAM;AAAA,IACJ,KAAKC;AAAA,IACL,gBAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,GAAGC;AAAA,EAAA,IACDL,GACEM,IAASC,EAAU,EAAE,QAAQC,GAA0B,GAEvDC,IAAWC,EAA4B,IAAI,GAC3CvB,IAAMwB,EAAaC,EAAUH,GAAUR,CAAY,CAAC,GAEpD,CAACY,GAAaC,CAAc,IAAIR,EAAO,kBAAkBD,CAAS,GAClE,CAACU,GAAYC,CAAe,IAAIC,EAAkBH,CAAc,GAChE,EAAE,YAAAI,EAAA,IAAeC,EAAyBH,GAAiB7B,CAAG;AAGpE,EAAAD,EAAYC,GAAK,EAAE,SAASiB,EAAA,CAAU;AAEtC,QAAMgB,IAAsB;AAAA,IAC1B,iBAAiBf,EAAU,aAAa,SAAS;AAAA,IACjD,gBAAgBA,EAAU,YAAY,SAAS;AAAA,EAAA;AAGjD,SACE,gBAAAgB;AAAA,IAACtC;AAAA,IAAA;AAAA,MACC,WAAWiB,GAAO;AAAA,MACjB,GAAGa;AAAA,MACH,GAAGE;AAAA,MACH,GAAGK;AAAA,MAEJ,UAAA,gBAAAE,EAAAC,GAAA,EACG,UAAA;AAAA,QAAArB,KACC,gBAAAmB,EAACrC,KACE,UAAAkB,EAAA,CACH;AAAA,QAEF,gBAAAmB,EAACpC,GAAA,EAA+B,SAAO,IACrC,UAAA,gBAAAoC,EAACG,KAAS,KAAArC,GAAU,MAAAgB,GAAa,GAAGe,EAAA,CAAY,EAAA,CAClD;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAnB,EAAmB,cAAc;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const g=require("react/jsx-runtime"),s=require("react"),pe=require("@chakra-ui/react"),$a=require("@chakra-ui/react/styled-system"),de=require("@commercetools/nimbus-icons"),ma=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),xe=require("./Button-CFZnLKVR.cjs.js"),pa=require("./Input-_6sPm9s0.cjs.js"),xa=require("./index-CRFg4Mhx.cjs.js"),ve=require("react-intl"),va=require("./context-OoV8SSWX.cjs.js"),La=require("./useObjectRef-dXOJdONs.cjs.js"),Da=require("./useControlledState-D0L6S_5r.cjs.js"),L=require("./number-DHvo-MDe.cjs.js"),Le=require("./useFormValidation-STNSjSmx.cjs.js"),be=require("./NumberFormatter-DewVDY5w.cjs.js"),De=require("./useSpinButton-DA7sVP3T.cjs.js"),S=require("./mergeProps-BA5Cwf5w.cjs.js"),Fa=require("./filterDOMProps-WUskt27c.cjs.js"),Q=require("./platform-BDLy2vDY.cjs.js"),Na=require("./useFormReset--wPlnEOl.cjs.js"),Pa=require("./useFocus-DVHC9n4e.cjs.js"),ga=require("./useFocusWithin-CucqUylS.cjs.js"),Sa=require("./useEvent-CuUOU5WV.cjs.js"),Ba=require("./useTextField-0jWzqKW2.cjs.js"),Ea=require("./useLocalizedStringFormatter-sB0mFYtL.cjs.js"),fe=require("./useProgressBar-COda2Qef.cjs.js"),ha=require("./box-CWni3A32.cjs.js");function Ca(e,r){let{onScroll:a,isDisabled:l}=e,o=s.useCallback(i=>{i.ctrlKey||(i.preventDefault(),i.stopPropagation(),a&&a({deltaX:i.deltaX,deltaY:i.deltaY}))},[a]);Sa.$e9faafb641e167db$export$90fc3a17d93f704c(r,"wheel",l?void 0:o)}function $e(){return typeof window<"u"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function Va(e,r,a){let l=S.$8ae05eaa5c114e9c$export$7f54fc3180508a52(n=>{let t=a.current;if(!t)return;let f=null;switch(n.inputType){case"historyUndo":case"historyRedo":return;case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":f=t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteContentForward":f=t.selectionEnd===t.selectionStart?t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd+1):t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteContentBackward":f=t.selectionEnd===t.selectionStart?t.value.slice(0,t.selectionStart-1)+t.value.slice(t.selectionStart):t.value.slice(0,t.selectionStart)+t.value.slice(t.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":f=t.value.slice(t.selectionStart);break;default:n.data!=null&&(f=t.value.slice(0,t.selectionStart)+n.data+t.value.slice(t.selectionEnd));break}(f==null||!r.validate(f))&&n.preventDefault()});s.useEffect(()=>{if(!$e()||!a.current)return;let n=a.current;return n.addEventListener("beforeinput",l,!1),()=>{n.removeEventListener("beforeinput",l,!1)}},[a,l]);let o=$e()?null:n=>{let t=n.target.value.slice(0,n.target.selectionStart)+n.data+n.target.value.slice(n.target.selectionEnd);r.validate(t)||n.preventDefault()},{labelProps:i,inputProps:c,descriptionProps:x,errorMessageProps:d,...D}=Ba.$2d73ec29415bd339$export$712718f7aec83d5(e,a),F=s.useRef(null);return{inputProps:S.$3ef42575df84b30b$export$9d1611c77c2fe928(c,{onBeforeInput:o,onCompositionStart(){let{value:n,selectionStart:t,selectionEnd:f}=a.current;F.current={value:n,selectionStart:t,selectionEnd:f}},onCompositionEnd(){if(a.current&&!r.validate(a.current.value)){let{value:n,selectionStart:t,selectionEnd:f}=F.current;a.current.value=n,a.current.setSelectionRange(t,f),r.setInputValue(n)}}}),labelProps:i,descriptionProps:x,errorMessageProps:d,...D}}function ya(e){let{minValue:r,maxValue:a,step:l,formatOptions:o,value:i,defaultValue:c=NaN,onChange:x,locale:d,isDisabled:D,isReadOnly:F}=e;i===null&&(i=NaN),i!==void 0&&!isNaN(i)&&(l!==void 0&&!isNaN(l)?i=L.$9446cca9a3875146$export$cb6e0bb50bc19463(i,r,a,l):i=L.$9446cca9a3875146$export$7d15b64cf5a3a4c4(i,r,a)),isNaN(c)||(l!==void 0&&!isNaN(l)?c=L.$9446cca9a3875146$export$cb6e0bb50bc19463(c,r,a,l):c=L.$9446cca9a3875146$export$7d15b64cf5a3a4c4(c,r,a));let[n,t]=Da.$458b0a5536c1a7cf$export$40bfa8c7b0832715(i,isNaN(c)?NaN:c,x),[f]=s.useState(n),[N,v]=s.useState(()=>isNaN(n)?"":new be.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(d,o).format(n)),P=s.useMemo(()=>new De.$6c7bd7858deea686$export$cd11ab140839f11d(d,o),[d,o]),h=s.useMemo(()=>P.getNumberingSystem(N),[P,N]),B=s.useMemo(()=>new be.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(d,{...o,numberingSystem:h}),[d,o,h]),q=s.useMemo(()=>B.resolvedOptions(),[B]),$=s.useCallback(u=>isNaN(u)||u===null?"":B.format(u),[B]),E=Le.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:n}),m=l!==void 0&&!isNaN(l)?l:1;q.style==="percent"&&(l===void 0||isNaN(l))&&(m=.01);let[w,z]=s.useState(n),[k,U]=s.useState(d),[I,Z]=s.useState(o);(!Object.is(n,w)||d!==k||o!==I)&&(v($(n)),z(n),U(d),Z(o));let b=s.useMemo(()=>P.parse(N),[P,N]),A=()=>{if(!N.length){t(NaN),v(i===void 0?"":$(n));return}if(isNaN(b)){v($(n));return}let u;l===void 0||isNaN(l)?u=L.$9446cca9a3875146$export$7d15b64cf5a3a4c4(b,r,a):u=L.$9446cca9a3875146$export$cb6e0bb50bc19463(b,r,a,l),u=P.parse($(u)),t(u),v($(i===void 0?u:n)),E.commitValidation()},M=(u,W=0)=>{let C=b;if(isNaN(C)){let V=isNaN(W)?0:W;return L.$9446cca9a3875146$export$cb6e0bb50bc19463(V,r,a,m)}else{let V=L.$9446cca9a3875146$export$cb6e0bb50bc19463(C,r,a,m);return u==="+"&&V>C||u==="-"&&V<C?V:L.$9446cca9a3875146$export$cb6e0bb50bc19463(ee(u,C,m),r,a,m)}},O=()=>{let u=M("+",r);u===n&&v($(u)),t(u),E.commitValidation()},_=()=>{let u=M("-",a);u===n&&v($(u)),t(u),E.commitValidation()},T=()=>{a!=null&&(t(L.$9446cca9a3875146$export$cb6e0bb50bc19463(a,r,a,m)),E.commitValidation())},Y=()=>{r!=null&&(t(r),E.commitValidation())},K=s.useMemo(()=>!D&&!F&&(isNaN(b)||a===void 0||isNaN(a)||L.$9446cca9a3875146$export$cb6e0bb50bc19463(b,r,a,m)>b||ee("+",b,m)<=a),[D,F,r,a,m,b]),H=s.useMemo(()=>!D&&!F&&(isNaN(b)||r===void 0||isNaN(r)||L.$9446cca9a3875146$export$cb6e0bb50bc19463(b,r,a,m)<b||ee("-",b,m)>=r),[D,F,r,a,m,b]);return{...E,validate:u=>P.isValidPartialNumber(u,r,a),increment:O,incrementToMax:T,decrement:_,decrementToMin:Y,canIncrement:K,canDecrement:H,minValue:r,maxValue:a,numberValue:b,defaultNumberValue:isNaN(c)?f:c,setNumberValue:t,setInputValue:v,inputValue:N,commit:A}}function ee(e,r,a){let l=e==="+"?r+a:r-a;if(r%1!==0||a%1!==0){const o=r.toString().split("."),i=a.toString().split("."),c=o[1]&&o[1].length||0,x=i[1]&&i[1].length||0,d=Math.pow(10,Math.max(c,x));r=Math.round(r*d),a=Math.round(a*d),l=e==="+"?r+a:r-a,l/=d}return l}var Fe={};Fe={decrease:e=>`خفض ${e.fieldLabel}`,increase:e=>`زيادة ${e.fieldLabel}`,numberField:"حقل رقمي"};var Ne={};Ne={decrease:e=>`Намаляване ${e.fieldLabel}`,increase:e=>`Усилване ${e.fieldLabel}`,numberField:"Номер на полето"};var Pe={};Pe={decrease:e=>`Snížit ${e.fieldLabel}`,increase:e=>`Zvýšit ${e.fieldLabel}`,numberField:"Číselné pole"};var ge={};ge={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`Øg ${e.fieldLabel}`,numberField:"Talfelt"};var Se={};Se={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erhöhen`,numberField:"Nummernfeld"};var Be={};Be={decrease:e=>`Μείωση ${e.fieldLabel}`,increase:e=>`Αύξηση ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"};var Ee={};Ee={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"};var he={};he={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de número"};var Ce={};Ce={decrease:e=>`Vähenda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri väli"};var Ve={};Ve={decrease:e=>`Vähennä ${e.fieldLabel}`,increase:e=>`Lisää ${e.fieldLabel}`,numberField:"Numerokenttä"};var ye={};ye={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"};var Ie={};Ie={decrease:e=>`הקטן ${e.fieldLabel}`,increase:e=>`הגדל ${e.fieldLabel}`,numberField:"שדה מספר"};var Me={};Me={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Povećaj ${e.fieldLabel}`,numberField:"Polje broja"};var qe={};qe={decrease:e=>`${e.fieldLabel} csökkentése`,increase:e=>`${e.fieldLabel} növelése`,numberField:"Számmező"};var we={};we={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"};var ke={};ke={decrease:e=>`${e.fieldLabel}を縮小`,increase:e=>`${e.fieldLabel}を拡大`,numberField:"数値フィールド"};var Oe={};Oe={decrease:e=>`${e.fieldLabel} 감소`,increase:e=>`${e.fieldLabel} 증가`,numberField:"번호 필드"};var Re={};Re={decrease:e=>`Sumažinti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"};var je={};je={decrease:e=>`Samazināšana ${e.fieldLabel}`,increase:e=>`Palielināšana ${e.fieldLabel}`,numberField:"Skaitļu lauks"};var Ae={};Ae={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`Øk ${e.fieldLabel}`,numberField:"Tallfelt"};var Te={};Te={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"};var Ke={};Ke={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwiększ ${e.fieldLabel}`,numberField:"Pole numeru"};var We={};We={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de número"};var ze={};ze={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo numérico"};var Ue={};Ue={decrease:e=>`Scădere ${e.fieldLabel}`,increase:e=>`Creștere ${e.fieldLabel}`,numberField:"Câmp numeric"};var Ze={};Ze={decrease:e=>`Уменьшение ${e.fieldLabel}`,increase:e=>`Увеличение ${e.fieldLabel}`,numberField:"Числовое поле"};var _e={};_e={decrease:e=>`Znížiť ${e.fieldLabel}`,increase:e=>`Zvýšiť ${e.fieldLabel}`,numberField:"Číselné pole"};var Ye={};Ye={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Povečajte ${e.fieldLabel}`,numberField:"Številčno polje"};var He={};He={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Povećaj ${e.fieldLabel}`,numberField:"Polje broja"};var Ge={};Ge={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`Öka ${e.fieldLabel}`,numberField:"Nummerfält"};var Xe={};Xe={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} arttır`,numberField:"Sayı alanı"};var Je={};Je={decrease:e=>`Зменшити ${e.fieldLabel}`,increase:e=>`Збільшити ${e.fieldLabel}`,numberField:"Поле номера"};var Qe={};Qe={decrease:e=>`降低 ${e.fieldLabel}`,increase:e=>`提高 ${e.fieldLabel}`,numberField:"数字字段"};var ea={};ea={decrease:e=>`縮小 ${e.fieldLabel}`,increase:e=>`放大 ${e.fieldLabel}`,numberField:"數字欄位"};var aa={};aa={"ar-AE":Fe,"bg-BG":Ne,"cs-CZ":Pe,"da-DK":ge,"de-DE":Se,"el-GR":Be,"en-US":Ee,"es-ES":he,"et-EE":Ce,"fi-FI":Ve,"fr-FR":ye,"he-IL":Ie,"hr-HR":Me,"hu-HU":qe,"it-IT":we,"ja-JP":ke,"ko-KR":Oe,"lt-LT":Re,"lv-LV":je,"nb-NO":Ae,"nl-NL":Te,"pl-PL":Ke,"pt-BR":We,"pt-PT":ze,"ro-RO":Ue,"ru-RU":Ze,"sk-SK":_e,"sl-SI":Ye,"sr-SP":He,"sv-SE":Ge,"tr-TR":Xe,"uk-UA":Je,"zh-CN":Qe,"zh-TW":ea};function Ia(e){return e&&e.__esModule?e.default:e}function Ma(e,r,a){let{id:l,decrementAriaLabel:o,incrementAriaLabel:i,isDisabled:c,isReadOnly:x,isRequired:d,minValue:D,maxValue:F,autoFocus:n,label:t,formatOptions:f,onBlur:N=()=>{},onFocus:v,onFocusChange:P,onKeyDown:h,onKeyUp:B,description:q,errorMessage:$,isWheelDisabled:E,...m}=e,{increment:w,incrementToMax:z,decrement:k,decrementToMin:U,numberValue:I,inputValue:Z,commit:b,commitValidation:A}=r;const M=Ea.$fca6afa0e843324b$export$f12b703ca79dfbb1(Ia(aa),"@react-aria/numberfield");let O=S.$bdb11010cef70236$export$f680877a34711e37(l),{focusProps:_}=Pa.$a1ea59d68270f0dd$export$f8168d8dd8fd66e6({onBlur(){b()}}),T=fe.$a916eb452884faea$export$b7a616150fdb9f44(f),Y=s.useMemo(()=>T.resolvedOptions(),[T]),K=fe.$a916eb452884faea$export$b7a616150fdb9f44({...f,currencySign:void 0}),H=s.useMemo(()=>isNaN(I)?"":K.format(I),[K,I]),{spinButtonProps:ae,incrementButtonProps:u,decrementButtonProps:W}=De.$d2e8511e6f209edf$export$e908e06f4b8e3402({isDisabled:c,isReadOnly:x,isRequired:d,maxValue:F,minValue:D,onIncrement:w,onIncrementToMax:z,onDecrement:k,onDecrementToMin:U,value:I,textValue:H}),[C,V]=s.useState(!1),{focusWithinProps:ta}=ga.$9ab94262bd0047c7$export$420e68273165f4ec({isDisabled:c,onFocusWithinChange:V}),na=s.useCallback(p=>{Math.abs(p.deltaY)<=Math.abs(p.deltaX)||(p.deltaY>0?w():p.deltaY<0&&k())},[k,w]);Ca({onScroll:na,isDisabled:E||c||x||!C},a);var G;let re=((G=Y.maximumFractionDigits)!==null&&G!==void 0?G:0)>0,te=r.minValue===void 0||isNaN(r.minValue)||r.minValue<0,R="numeric";Q.$c87311424ea30a05$export$186c6964ca17d99()?te?R="text":re&&(R="decimal"):Q.$c87311424ea30a05$export$a11b0059900ceec8()&&(te?R="numeric":re&&(R="decimal"));let la=p=>{r.validate(p)&&r.setInputValue(p)},ia=Fa.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e),ne=s.useCallback(p=>{p.nativeEvent.isComposing||(p.key==="Enter"?(b(),A()):p.continuePropagation())},[b,A]),{isInvalid:le,validationErrors:ua,validationDetails:sa}=r.displayValidation,{labelProps:ie,inputProps:oa,descriptionProps:ca,errorMessageProps:da}=Va({...m,...ia,name:void 0,form:void 0,label:t,autoFocus:n,isDisabled:c,isReadOnly:x,isRequired:d,validate:void 0,[Le.$e5be200c675c3b3a$export$a763b9476acd3eb]:r,value:Z,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:O,type:"text",inputMode:R,onChange:la,onBlur:N,onFocus:v,onFocusChange:P,onKeyDown:s.useMemo(()=>S.$ff5963eb1fccf552$export$e08e3b67e392101e(ne,h),[ne,h]),onKeyUp:B,description:q,errorMessage:$},r,a);Na.$99facab73266f662$export$5add1d006293d136(a,r.defaultNumberValue,r.setNumberValue);let ue=S.$3ef42575df84b30b$export$9d1611c77c2fe928(ae,_,oa,{role:null,"aria-roledescription":Q.$c87311424ea30a05$export$fedb369cb70207f1()?null:M.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});e.validationBehavior==="native"&&(ue["aria-required"]=void 0);let se=p=>{var J;document.activeElement!==a.current&&(p.pointerType==="mouse"?(J=a.current)===null||J===void 0||J.focus():p.target.focus())},X=e["aria-label"]||(typeof e.label=="string"?e.label:""),y;X||(y=e.label!=null?ie.id:e["aria-labelledby"]);let oe=S.$bdb11010cef70236$export$f680877a34711e37(),ce=S.$bdb11010cef70236$export$f680877a34711e37(),ba=S.$3ef42575df84b30b$export$9d1611c77c2fe928(u,{"aria-label":i||M.format("increase",{fieldLabel:X}).trim(),id:y&&!i?oe:null,"aria-labelledby":y&&!i?`${oe} ${y}`:null,"aria-controls":O,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!r.canIncrement,onPressStart:se}),fa=S.$3ef42575df84b30b$export$9d1611c77c2fe928(W,{"aria-label":o||M.format("decrease",{fieldLabel:X}).trim(),id:y&&!o?ce:null,"aria-labelledby":y&&!o?`${ce} ${y}`:null,"aria-controls":O,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!r.canDecrement,onPressStart:se});return{groupProps:{...ta,role:"group","aria-disabled":c,"aria-invalid":le?"true":void 0},labelProps:ie,inputProps:ue,incrementButtonProps:ba,decrementButtonProps:fa,errorMessageProps:da,descriptionProps:ca,isInvalid:le,validationErrors:ua,validationDetails:sa}}const{withContext:j,withProvider:qa}=pe.createSlotRecipeContext({key:"numberInput"}),wa=qa("div","root"),ka=j("div","leadingElement"),Oa=j("div","trailingElement"),Ra=j(pa.$3985021b0ad6602f$export$f5b8910cec6cf069,"input"),ja=j(xe.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,"incrementButton"),Aa=j(xe.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,"decrementButton"),me=ve.defineMessages({decrement:{id:"Nimbus.NumberInput.decrement",description:"aria-label for the decrement button in number input",defaultMessage:"Decrement"},increment:{id:"Nimbus.NumberInput.increment",description:"aria-label for the increment button in number input",defaultMessage:"Increment"}}),ra=e=>{const{size:r,leadingElement:a,trailingElement:l,ref:o,...i}=e,{locale:c}=va.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),x=ve.useIntl(),d=s.useRef(null),D=La.$df56164dff5785e2$export$4338b53315abf666(pe.mergeRefs(d,o)),F=$a.useSlotRecipe({recipe:xa.numberInputRecipe}),[n,t]=F.splitVariantProps(i),[f,N]=ma.extractStyleProps(t),v={...N,locale:c,incrementAriaLabel:x.formatMessage(me.increment),decrementAriaLabel:x.formatMessage(me.decrement)},P=ya(v),{inputProps:h,incrementButtonProps:B,decrementButtonProps:q}=Ma(v,P,D),$={"data-invalid":e.isInvalid,"data-disabled":e.isDisabled};return g.jsxs(wa,{className:e?.className,...$,...n,...f,size:r,children:[a&&g.jsx(ka,{children:a}),g.jsx(Ra,{ref:D,...h,...$,name:e.name}),l&&g.jsx(Oa,{children:l}),g.jsxs(ha.Box,{position:"absolute",top:"0",right:"0",display:"flex",flexDirection:"column",height:"full",children:[g.jsx(ja,{...B,...$,children:g.jsx(de.KeyboardArrowUp,{})}),g.jsx(Aa,{...q,...$,children:g.jsx(de.KeyboardArrowDown,{})})]})]})};ra.displayName="NumberInput";exports.NumberInput=ra;
|
|
2
|
-
//# sourceMappingURL=number-input-wMW-o4di.cjs.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),k=require("react"),d=require("./Label-BgrYyYXn.cjs.js"),w=require("./ProgressBar-C9Y3C7_B.cjs.js"),u=require("@chakra-ui/react"),C=require("@chakra-ui/react/styled-system"),V=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),F=require("./useObjectRef-dXOJdONs.cjs.js"),H=require("@chakra-ui/react/flex"),L=require("./box-CWni3A32.cjs.js"),{withProvider:O,withContext:t}=u.createSlotRecipeContext({key:"progressBar"}),D=O("div","root"),G=t("div","track"),I=t("div","fill"),x=t("span","label"),f=t("span","value"),p=l=>{const{ref:h,value:o,minValue:b=0,maxValue:P=100,isDynamic:j=!0,isIndeterminate:r,label:s,formatOptions:g={style:"percent"},variant:m="solid",layout:i="stacked",colorPalette:$="primary",...y}=l,B=C.useSlotRecipe({key:"progressBar"}),[n,q]=B.splitVariantProps({variant:m,colorPalette:$,...l}),[R]=V.extractStyleProps(q),S=k.useRef(null),v=F.$df56164dff5785e2$export$4338b53315abf666(u.mergeRefs(S,h));return e.jsx(D,{...n,...R,...n,isDynamic:j,isIndeterminate:r,asChild:!0,children:e.jsx(w.$0393f8ab869a0f1a$export$c17561cb55d4db30,{ref:v,value:o,minValue:b,maxValue:P,isIndeterminate:r,formatOptions:g,...y,children:({percentage:a,valueText:c})=>e.jsxs(e.Fragment,{children:[i==="stacked"&&e.jsxs(H.Flex,{children:[s&&e.jsx(x,{asChild:!0,children:e.jsx(d.$01b77f81d0f07f68$export$b04be29aa201d4f5,{children:s})}),e.jsx(L.Box,{flexGrow:"1"}),s&&o&&e.jsx(f,{children:c})]}),i==="inline"&&s&&e.jsx(x,{lineHeight:"1",asChild:!0,children:e.jsx(d.$01b77f81d0f07f68$export$b04be29aa201d4f5,{children:s})}),e.jsx(G,{children:e.jsx(I,{style:{width:r?"40%":`${a}%`},"data-indeterminate":r,"data-complete":!r&&a!==void 0&&a>=100})}),i==="inline"&&o&&e.jsx(f,{lineHeight:"1",children:c})]})})})};p.displayName="ProgressBar";exports.ProgressBar=p;
|
|
2
|
-
//# sourceMappingURL=progress-bar-Bhp7W6Eo.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar-Bhp7W6Eo.cjs.js","sources":["../../src/components/progress-bar/progress-bar.slots.tsx","../../src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n ProgressBarRootSlotProps,\n ProgressBarTrackSlotProps,\n ProgressBarFillSlotProps,\n ProgressBarLabelSlotProps,\n ProgressBarValueSlotProps,\n} from \"./progress-bar.types.tsx\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"progressBar\",\n});\n\n// ProgressBar Root - Main container\nexport const ProgressBarRootSlot = withProvider<\n HTMLDivElement,\n ProgressBarRootSlotProps\n>(\"div\", \"root\");\n\n// ProgressBar Track - Background bar\nexport const ProgressBarTrackSlot = withContext<\n HTMLDivElement,\n ProgressBarTrackSlotProps\n>(\"div\", \"track\");\n\n// ProgressBar Fill - Progress indicator\nexport const ProgressBarFillSlot = withContext<\n HTMLDivElement,\n ProgressBarFillSlotProps\n>(\"div\", \"fill\");\n\n// ProgressBar Label - Label text\nexport const ProgressBarLabelSlot = withContext<\n HTMLSpanElement,\n ProgressBarLabelSlotProps\n>(\"span\", \"label\");\n\n// ProgressBar Value - Value text\nexport const ProgressBarValueSlot = withContext<\n HTMLSpanElement,\n ProgressBarValueSlotProps\n>(\"span\", \"value\");\n","import { useRef } from \"react\";\nimport {\n ProgressBar as RaProgressBar,\n Label as RaLabel,\n} from \"react-aria-components\";\nimport { useObjectRef } from \"react-aria\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { Flex, Box } from \"@/components\";\nimport {\n ProgressBarRootSlot,\n ProgressBarTrackSlot,\n ProgressBarFillSlot,\n ProgressBarLabelSlot,\n ProgressBarValueSlot,\n} from \"./progress-bar.slots\";\nimport type { ProgressBarProps } from \"./progress-bar.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * ProgressBar\n * ============================================================\n * Displays progress towards completion of a task or process\n *\n * Features:\n *\n * - Supports both determinate (with value) and indeterminate (loading) states\n * - Two visual variants: solid (gradient) and contrast (monochromatic)\n * - Three layouts: minimal, inline, and stacked\n * - Configurable value formatting with internationalization support\n * - Full accessibility support with ARIA attributes\n * - Allows forwarding refs to the underlying DOM element\n * - Accepts all native HTML div attributes\n * - Supports variants, sizes, etc. configured in the recipe\n * - Allows overriding styles by using style-props\n */\nexport const ProgressBar = (props: ProgressBarProps) => {\n const {\n ref: forwardedRef,\n value,\n minValue = 0,\n maxValue = 100,\n isDynamic = true,\n isIndeterminate,\n label,\n formatOptions = { style: \"percent\" },\n variant = \"solid\",\n layout = \"stacked\",\n colorPalette = \"primary\",\n ...rest\n } = props;\n\n const recipe = useSlotRecipe({ key: \"progressBar\" });\n const [recipeProps, remainingProps] = recipe.splitVariantProps({\n variant,\n colorPalette,\n ...props,\n });\n const [styleProps] = extractStyleProps(remainingProps);\n\n const localRef = useRef<HTMLDivElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n\n return (\n <ProgressBarRootSlot\n {...recipeProps}\n {...styleProps}\n {...recipeProps}\n isDynamic={isDynamic}\n isIndeterminate={isIndeterminate}\n asChild\n >\n <RaProgressBar\n ref={ref}\n value={value}\n minValue={minValue}\n maxValue={maxValue}\n isIndeterminate={isIndeterminate}\n formatOptions={formatOptions}\n {...rest}\n >\n {({ percentage, valueText }) => (\n <>\n {layout === \"stacked\" && (\n <Flex>\n {label && (\n <ProgressBarLabelSlot asChild>\n <RaLabel>{label}</RaLabel>\n </ProgressBarLabelSlot>\n )}\n <Box flexGrow=\"1\" />\n {label && value && (\n <ProgressBarValueSlot>{valueText}</ProgressBarValueSlot>\n )}\n </Flex>\n )}\n\n {layout === \"inline\" && label && (\n <ProgressBarLabelSlot lineHeight=\"1\" asChild>\n <RaLabel>{label}</RaLabel>\n </ProgressBarLabelSlot>\n )}\n\n <ProgressBarTrackSlot>\n <ProgressBarFillSlot\n style={{ width: isIndeterminate ? \"40%\" : `${percentage}%` }}\n data-indeterminate={isIndeterminate}\n data-complete={\n !isIndeterminate &&\n percentage !== undefined &&\n percentage >= 100\n }\n />\n </ProgressBarTrackSlot>\n\n {layout === \"inline\" && value && (\n <ProgressBarValueSlot lineHeight=\"1\">\n {valueText}\n </ProgressBarValueSlot>\n )}\n </>\n )}\n </RaProgressBar>\n </ProgressBarRootSlot>\n );\n};\n\nProgressBar.displayName = \"ProgressBar\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","ProgressBarRootSlot","ProgressBarTrackSlot","ProgressBarFillSlot","ProgressBarLabelSlot","ProgressBarValueSlot","ProgressBar","props","forwardedRef","value","minValue","maxValue","isDynamic","isIndeterminate","label","formatOptions","variant","layout","colorPalette","rest","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","extractStyleProps","localRef","useRef","ref","useObjectRef","mergeRefs","jsx","RaProgressBar","percentage","valueText","jsxs","Fragment","Flex","RaLabel","Box"],"mappings":"kYASM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,aACP,CAAC,EAGYC,EAAsBH,EAGjC,MAAO,MAAM,EAGFI,EAAuBH,EAGlC,MAAO,OAAO,EAGHI,EAAsBJ,EAGjC,MAAO,MAAM,EAGFK,EAAuBL,EAGlC,OAAQ,OAAO,EAGJM,EAAuBN,EAGlC,OAAQ,OAAO,ECLJO,EAAeC,GAA4B,CACtD,KAAM,CACJ,IAAKC,EACL,MAAAC,EACA,SAAAC,EAAW,EACX,SAAAC,EAAW,IACX,UAAAC,EAAY,GACZ,gBAAAC,EACA,MAAAC,EACA,cAAAC,EAAgB,CAAE,MAAO,SAAA,EACzB,QAAAC,EAAU,QACV,OAAAC,EAAS,UACT,aAAAC,EAAe,UACf,GAAGC,CAAA,EACDZ,EAEEa,EAASC,EAAAA,cAAc,CAAE,IAAK,cAAe,EAC7C,CAACC,EAAaC,CAAc,EAAIH,EAAO,kBAAkB,CAC7D,QAAAJ,EACA,aAAAE,EACA,GAAGX,CAAA,CACJ,EACK,CAACiB,CAAU,EAAIC,EAAAA,kBAAkBF,CAAc,EAE/CG,EAAWC,EAAAA,OAAuB,IAAI,EACtCC,EAAMC,EAAAA,0CAAaC,EAAAA,UAAUJ,EAAUlB,CAAY,CAAC,EAE1D,OACEuB,EAAAA,IAAC9B,EAAA,CACE,GAAGqB,EACH,GAAGE,EACH,GAAGF,EACJ,UAAAV,EACA,gBAAAC,EACA,QAAO,GAEP,SAAAkB,EAAAA,IAACC,EAAAA,0CAAA,CACC,IAAAJ,EACA,MAAAnB,EACA,SAAAC,EACA,SAAAC,EACA,gBAAAE,EACA,cAAAE,EACC,GAAGI,EAEH,SAAA,CAAC,CAAE,WAAAc,EAAY,UAAAC,CAAA,IACdC,OAAAC,EAAAA,SAAA,CACG,SAAA,CAAAnB,IAAW,kBACToB,EAAAA,KAAA,CACE,SAAA,CAAAvB,SACEV,EAAA,CAAqB,QAAO,GAC3B,SAAA2B,EAAAA,IAACO,EAAAA,0CAAA,CAAS,WAAM,CAAA,CAClB,EAEFP,EAAAA,IAACQ,EAAAA,IAAA,CAAI,SAAS,GAAA,CAAI,EACjBzB,GAASL,GACRsB,EAAAA,IAAC1B,EAAA,CAAsB,SAAA6B,CAAA,CAAU,CAAA,EAErC,EAGDjB,IAAW,UAAYH,GACtBiB,EAAAA,IAAC3B,EAAA,CAAqB,WAAW,IAAI,QAAO,GAC1C,SAAA2B,EAAAA,IAACO,EAAAA,0CAAA,CAAS,SAAAxB,CAAA,CAAM,EAClB,QAGDZ,EAAA,CACC,SAAA6B,EAAAA,IAAC5B,EAAA,CACC,MAAO,CAAE,MAAOU,EAAkB,MAAQ,GAAGoB,CAAU,GAAA,EACvD,qBAAoBpB,EACpB,gBACE,CAACA,GACDoB,IAAe,QACfA,GAAc,GAAA,CAAA,EAGpB,EAEChB,IAAW,UAAYR,SACrBJ,EAAA,CAAqB,WAAW,IAC9B,SAAA6B,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CAAA,CAEJ,CAAA,CAGN,EAEA5B,EAAY,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar-DwuOjOcH.es.js","sources":["../../src/components/progress-bar/progress-bar.slots.tsx","../../src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n ProgressBarRootSlotProps,\n ProgressBarTrackSlotProps,\n ProgressBarFillSlotProps,\n ProgressBarLabelSlotProps,\n ProgressBarValueSlotProps,\n} from \"./progress-bar.types.tsx\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"progressBar\",\n});\n\n// ProgressBar Root - Main container\nexport const ProgressBarRootSlot = withProvider<\n HTMLDivElement,\n ProgressBarRootSlotProps\n>(\"div\", \"root\");\n\n// ProgressBar Track - Background bar\nexport const ProgressBarTrackSlot = withContext<\n HTMLDivElement,\n ProgressBarTrackSlotProps\n>(\"div\", \"track\");\n\n// ProgressBar Fill - Progress indicator\nexport const ProgressBarFillSlot = withContext<\n HTMLDivElement,\n ProgressBarFillSlotProps\n>(\"div\", \"fill\");\n\n// ProgressBar Label - Label text\nexport const ProgressBarLabelSlot = withContext<\n HTMLSpanElement,\n ProgressBarLabelSlotProps\n>(\"span\", \"label\");\n\n// ProgressBar Value - Value text\nexport const ProgressBarValueSlot = withContext<\n HTMLSpanElement,\n ProgressBarValueSlotProps\n>(\"span\", \"value\");\n","import { useRef } from \"react\";\nimport {\n ProgressBar as RaProgressBar,\n Label as RaLabel,\n} from \"react-aria-components\";\nimport { useObjectRef } from \"react-aria\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { Flex, Box } from \"@/components\";\nimport {\n ProgressBarRootSlot,\n ProgressBarTrackSlot,\n ProgressBarFillSlot,\n ProgressBarLabelSlot,\n ProgressBarValueSlot,\n} from \"./progress-bar.slots\";\nimport type { ProgressBarProps } from \"./progress-bar.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\n\n/**\n * ProgressBar\n * ============================================================\n * Displays progress towards completion of a task or process\n *\n * Features:\n *\n * - Supports both determinate (with value) and indeterminate (loading) states\n * - Two visual variants: solid (gradient) and contrast (monochromatic)\n * - Three layouts: minimal, inline, and stacked\n * - Configurable value formatting with internationalization support\n * - Full accessibility support with ARIA attributes\n * - Allows forwarding refs to the underlying DOM element\n * - Accepts all native HTML div attributes\n * - Supports variants, sizes, etc. configured in the recipe\n * - Allows overriding styles by using style-props\n */\nexport const ProgressBar = (props: ProgressBarProps) => {\n const {\n ref: forwardedRef,\n value,\n minValue = 0,\n maxValue = 100,\n isDynamic = true,\n isIndeterminate,\n label,\n formatOptions = { style: \"percent\" },\n variant = \"solid\",\n layout = \"stacked\",\n colorPalette = \"primary\",\n ...rest\n } = props;\n\n const recipe = useSlotRecipe({ key: \"progressBar\" });\n const [recipeProps, remainingProps] = recipe.splitVariantProps({\n variant,\n colorPalette,\n ...props,\n });\n const [styleProps] = extractStyleProps(remainingProps);\n\n const localRef = useRef<HTMLDivElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n\n return (\n <ProgressBarRootSlot\n {...recipeProps}\n {...styleProps}\n {...recipeProps}\n isDynamic={isDynamic}\n isIndeterminate={isIndeterminate}\n asChild\n >\n <RaProgressBar\n ref={ref}\n value={value}\n minValue={minValue}\n maxValue={maxValue}\n isIndeterminate={isIndeterminate}\n formatOptions={formatOptions}\n {...rest}\n >\n {({ percentage, valueText }) => (\n <>\n {layout === \"stacked\" && (\n <Flex>\n {label && (\n <ProgressBarLabelSlot asChild>\n <RaLabel>{label}</RaLabel>\n </ProgressBarLabelSlot>\n )}\n <Box flexGrow=\"1\" />\n {label && value && (\n <ProgressBarValueSlot>{valueText}</ProgressBarValueSlot>\n )}\n </Flex>\n )}\n\n {layout === \"inline\" && label && (\n <ProgressBarLabelSlot lineHeight=\"1\" asChild>\n <RaLabel>{label}</RaLabel>\n </ProgressBarLabelSlot>\n )}\n\n <ProgressBarTrackSlot>\n <ProgressBarFillSlot\n style={{ width: isIndeterminate ? \"40%\" : `${percentage}%` }}\n data-indeterminate={isIndeterminate}\n data-complete={\n !isIndeterminate &&\n percentage !== undefined &&\n percentage >= 100\n }\n />\n </ProgressBarTrackSlot>\n\n {layout === \"inline\" && value && (\n <ProgressBarValueSlot lineHeight=\"1\">\n {valueText}\n </ProgressBarValueSlot>\n )}\n </>\n )}\n </RaProgressBar>\n </ProgressBarRootSlot>\n );\n};\n\nProgressBar.displayName = \"ProgressBar\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","ProgressBarRootSlot","ProgressBarTrackSlot","ProgressBarFillSlot","ProgressBarLabelSlot","ProgressBarValueSlot","ProgressBar","props","forwardedRef","value","minValue","maxValue","isDynamic","isIndeterminate","label","formatOptions","variant","layout","colorPalette","rest","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","extractStyleProps","localRef","useRef","ref","useObjectRef","mergeRefs","jsx","RaProgressBar","percentage","valueText","jsxs","Fragment","Flex","RaLabel","Box"],"mappings":";;;;;;;;;;AASA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAGYC,IAAsB,gBAAAH,EAGjC,OAAO,MAAM,GAGFI,IAAuB,gBAAAH,EAGlC,OAAO,OAAO,GAGHI,IAAsB,gBAAAJ,EAGjC,OAAO,MAAM,GAGFK,IAAuB,gBAAAL,EAGlC,QAAQ,OAAO,GAGJM,IAAuB,gBAAAN,EAGlC,QAAQ,OAAO,GCLJO,IAAc,CAACC,MAA4B;AACtD,QAAM;AAAA,IACJ,KAAKC;AAAA,IACL,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,WAAAC,IAAY;AAAA,IACZ,iBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC,IAAgB,EAAE,OAAO,UAAA;AAAA,IACzB,SAAAC,IAAU;AAAA,IACV,QAAAC,IAAS;AAAA,IACT,cAAAC,IAAe;AAAA,IACf,GAAGC;AAAA,EAAA,IACDZ,GAEEa,IAASC,EAAc,EAAE,KAAK,eAAe,GAC7C,CAACC,GAAaC,CAAc,IAAIH,EAAO,kBAAkB;AAAA,IAC7D,SAAAJ;AAAA,IACA,cAAAE;AAAA,IACA,GAAGX;AAAA,EAAA,CACJ,GACK,CAACiB,CAAU,IAAIC,EAAkBF,CAAc,GAE/CG,IAAWC,EAAuB,IAAI,GACtCC,IAA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B,EAAA,CACH;AAAA,UAAA,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;AAEA5B,EAAY,cAAc;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const I=require("react/jsx-runtime"),z=require("@chakra-ui/react/styled-system"),J=require("./index-CRFg4Mhx.cjs.js"),h=require("./utils-BHdR5Nww.cjs.js"),Q=require("./FieldError-DyGFfqST.cjs.js"),X=require("./Form-BuOomA4T.cjs.js"),Y=require("./Label-BgrYyYXn.cjs.js"),L=require("./SelectionIndicator-Cp3OYqg6.cjs.js"),Z=require("./Text-BWSfeB9p.cjs.js"),m=require("./mergeProps-BA5Cwf5w.cjs.js"),F=require("./filterDOMProps-WUskt27c.cjs.js"),ee=require("./useObjectRef-dXOJdONs.cjs.js"),o=require("react"),ae=require("./useFormReset--wPlnEOl.cjs.js"),w=require("./usePress-D5REDWI3.cjs.js"),ie=require("./useFocusable-Dv8K4Git.cjs.js"),N=require("./useFormValidation-STNSjSmx.cjs.js"),re=require("./utils-DUS_ZjvE.cjs.js"),te=require("./FocusScope-vogC4IAT.cjs.js"),de=require("./useFocusWithin-CucqUylS.cjs.js"),oe=require("./useField-C_piDZ9g.cjs.js"),le=require("./context-OoV8SSWX.cjs.js"),j=require("./useFocusRing-BuJmrp03.cjs.js"),ne=require("./useHover-271zEzph.cjs.js"),se=require("./VisuallyHidden-C1WQXLCm.cjs.js"),ce=require("./useControlledState-D0L6S_5r.cjs.js"),T=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),ue=require("@chakra-ui/react"),_=require("@commercetools/nimbus-icons"),W=new WeakMap;function fe(a,e,r){let{value:t,children:l,"aria-label":d,"aria-labelledby":u,onPressStart:i,onPressEnd:s,onPressChange:f,onPress:n,onPressUp:c,onClick:p}=a;const b=a.isDisabled||e.isDisabled;let V=l!=null,x=d!=null||u!=null;!V&&!x&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let R=e.selectedValue===t,D=S=>{S.stopPropagation(),e.setSelectedValue(t)},{pressProps:C,isPressed:g}=w.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:i,onPressEnd:s,onPressChange:f,onPress:n,onPressUp:c,onClick:p,isDisabled:b}),{pressProps:M,isPressed:P}=w.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:i,onPressEnd:s,onPressChange:f,onPressUp:c,onClick:p,isDisabled:b,onPress(S){var O;n?.(S),e.setSelectedValue(t),(O=r.current)===null||O===void 0||O.focus()}}),{focusableProps:$}=ie.$f645667febf57a63$export$4c014de7c8940b4c(m.$3ef42575df84b30b$export$9d1611c77c2fe928(a,{onFocus:()=>e.setLastFocusedValue(t)}),r),y=m.$3ef42575df84b30b$export$9d1611c77c2fe928(C,$),v=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a,{labelable:!0}),q=-1;e.selectedValue!=null?e.selectedValue===t&&(q=0):(e.lastFocusedValue===t||e.lastFocusedValue==null)&&(q=0),b&&(q=void 0);let{name:U,form:A,descriptionId:G,errorMessageId:K,validationBehavior:k}=W.get(e);return ae.$99facab73266f662$export$5add1d006293d136(r,e.defaultSelectedValue,e.setSelectedValue),N.$e93e671b31057976$export$b8473d3665f3a75a({validationBehavior:k},e,r),{labelProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(M,o.useMemo(()=>({onClick:S=>S.preventDefault(),onMouseDown:S=>S.preventDefault()}),[])),inputProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(v,{...y,type:"radio",name:U,form:A,tabIndex:q,disabled:b,required:e.isRequired&&k==="native",checked:R,value:t,onChange:D,"aria-describedby":[a["aria-describedby"],e.isInvalid?K:null,G].filter(Boolean).join(" ")||void 0}),isDisabled:b,isSelected:R,isPressed:g||P}}function $e(a,e){let{name:r,form:t,isReadOnly:l,isRequired:d,isDisabled:u,orientation:i="vertical",validationBehavior:s="aria"}=a,{direction:f}=le.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),{isInvalid:n,validationErrors:c,validationDetails:p}=e.displayValidation,{labelProps:b,fieldProps:V,descriptionProps:x,errorMessageProps:R}=oe.$2baaea4c71418dea$export$294aa081a6c6f55d({...a,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:a.errorMessage||c}),D=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(a,{labelable:!0}),{focusWithinProps:C}=de.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin(P){var $;($=a.onBlur)===null||$===void 0||$.call(a,P),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:a.onFocus,onFocusWithinChange:a.onFocusChange}),g=P=>{let $;switch(P.key){case"ArrowRight":f==="rtl"&&i!=="vertical"?$="prev":$="next";break;case"ArrowLeft":f==="rtl"&&i!=="vertical"?$="next":$="prev";break;case"ArrowDown":$="next";break;case"ArrowUp":$="prev";break;default:return}P.preventDefault();let y=te.$9bf71ea28793e738$export$2d6ec8fc375ceafa(P.currentTarget,{from:P.target,accept:q=>q instanceof re.$431fbd86ca7dc216$export$f21a1ffae260145a(q).HTMLInputElement&&q.type==="radio"}),v;$==="next"?(v=y.nextNode(),v||(y.currentNode=P.currentTarget,v=y.firstChild())):(v=y.previousNode(),v||(y.currentNode=P.currentTarget,v=y.lastChild())),v&&(v.focus(),e.setSelectedValue(v.value))},M=m.$bdb11010cef70236$export$f680877a34711e37(r);return W.set(e,{name:M,form:t,descriptionId:x.id,errorMessageId:R.id,validationBehavior:s}),{radioGroupProps:m.$3ef42575df84b30b$export$9d1611c77c2fe928(D,{role:"radiogroup",onKeyDown:g,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":a["aria-errormessage"],"aria-readonly":l||void 0,"aria-required":d||void 0,"aria-disabled":u||void 0,"aria-orientation":i,...V,...C}),labelProps:b,descriptionProps:x,errorMessageProps:R,isInvalid:n,validationErrors:c,validationDetails:p}}let be=Math.round(Math.random()*1e10),pe=0;function ve(a){let e=o.useMemo(()=>a.name||`radio-group-${be}-${++pe}`,[a.name]);var r;let[t,l]=ce.$458b0a5536c1a7cf$export$40bfa8c7b0832715(a.value,(r=a.defaultValue)!==null&&r!==void 0?r:null,a.onChange),[d]=o.useState(t),[u,i]=o.useState(null),s=N.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...a,value:t}),f=p=>{!a.isReadOnly&&!a.isDisabled&&(l(p),s.commitValidation())},n=s.displayValidation.isInvalid;var c;return{...s,name:e,selectedValue:t,defaultSelectedValue:a.value!==void 0?d:(c=a.defaultValue)!==null&&c!==void 0?c:null,setSelectedValue:f,lastFocusedValue:u,setLastFocusedValue:i,isDisabled:a.isDisabled||!1,isReadOnly:a.isReadOnly||!1,isRequired:a.isRequired||!1,validationState:a.validationState||(n?"invalid":null),isInvalid:n}}const Pe=o.createContext(null),xe=o.createContext(null),H=o.createContext(null),Re=o.forwardRef(function(e,r){[e,r]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(e,r,Pe);let{validationBehavior:t}=h.$64fa3d84918910a7$export$fabf2dc03a41866e(X.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var l,d;let u=(d=(l=e.validationBehavior)!==null&&l!==void 0?l:t)!==null&&d!==void 0?d:"native",i=ve({...e,validationBehavior:u}),[s,f]=h.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!e["aria-label"]&&!e["aria-labelledby"]),{radioGroupProps:n,labelProps:c,descriptionProps:p,errorMessageProps:b,...V}=$e({...e,label:f,validationBehavior:u},i),x=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,values:{orientation:e.orientation||"vertical",isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:"react-aria-RadioGroup"}),R=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return o.createElement("div",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(R,x,n),ref:r,slot:e.slot||void 0,"data-orientation":e.orientation||"vertical","data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},o.createElement(h.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[H,i],[Y.$01b77f81d0f07f68$export$75b6ee27786ba447,{...c,ref:s,elementType:"span"}],[Z.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:p,errorMessage:b}}],[Q.$ee014567cb39d3f0$export$ff05c3ac10437e03,V]]},o.createElement(L.$c8a5a149f625efcf$export$758399f318e6385a,null,x.children)))}),he=o.forwardRef(function(e,r){let{inputRef:t=null,...l}=e;[e,r]=h.$64fa3d84918910a7$export$29f1550f4b0d4415(l,r,xe);let d=o.useContext(H),u=ee.$df56164dff5785e2$export$4338b53315abf666(o.useMemo(()=>h.$5dc95899b306f630$export$c9058316764c140e(t,e.inputRef!==void 0?e.inputRef:null),[t,e.inputRef])),{labelProps:i,inputProps:s,isSelected:f,isDisabled:n,isPressed:c}=fe({...h.$64fa3d84918910a7$export$ef03459518577ad4(e),children:typeof e.children=="function"?!0:e.children},d,u),{isFocused:p,isFocusVisible:b,focusProps:V}=j.$f7dceffc5ad7768b$export$4e328f61c538687f(),x=n||d.isReadOnly,{hoverProps:R,isHovered:D}=ne.$6179b936705e76d3$export$ae780daf29e6d456({...e,isDisabled:x}),C=h.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-Radio",values:{isSelected:f,isPressed:c,isHovered:D,isFocused:p,isFocusVisible:b,isDisabled:n,isReadOnly:d.isReadOnly,isInvalid:d.isInvalid,isRequired:d.isRequired}}),g=F.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{global:!0});return delete g.id,delete g.onClick,o.createElement("label",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(g,i,R,C),ref:r,"data-selected":f||void 0,"data-pressed":c||void 0,"data-hovered":D||void 0,"data-focused":p||void 0,"data-focus-visible":b||void 0,"data-disabled":n||void 0,"data-readonly":d.isReadOnly||void 0,"data-invalid":d.isInvalid||void 0,"data-required":d.isRequired||void 0},o.createElement(se.$5c3e21d68f1c4674$export$439d29a4e110a164,{elementType:"span"},o.createElement("input",{...m.$3ef42575df84b30b$export$9d1611c77c2fe928(s,V),ref:u})),o.createElement(L.$1d5b8b8664671ef2$export$c9549807523555e0.Provider,{value:{isSelected:f}},C.children))}),{withProvider:me,withContext:ye}=ue.createSlotRecipeContext({key:"radioInput"}),qe=me("div","root"),Ie=ye("span","option"),E=a=>{const e=z.useSlotRecipe({recipe:J.radioInputSlotRecipe}),[r,t]=e.splitVariantProps(a),[l,d]=T.extractStyleProps(t);return I.jsx(qe,{...r,...l,asChild:!0,children:I.jsx(Re,{...d,children:a.children})})};E.displayName="RadioInputRoot";const B=({children:a,value:e,...r})=>{const[t,l]=T.extractStyleProps(r),{isFocused:d,focusProps:u}=j.$f7dceffc5ad7768b$export$4e328f61c538687f();return I.jsx(Ie,{...t,...u,"data-focus":d||void 0,asChild:!0,children:I.jsx(he,{value:e,...l,children:i=>{const s=typeof a=="function"?a({...i}):a;return I.jsxs(I.Fragment,{children:[i.isSelected?I.jsx(_.RadioButtonChecked,{}):I.jsx(_.RadioButtonUnchecked,{}),s]})}})})};B.displayName="RadioInputOption";const Ve={Root:E,Option:B};exports.RadioInput=Ve;exports.RadioInputOption=B;exports.RadioInputRoot=E;
|
|
2
|
-
//# sourceMappingURL=radio-input-Dp05SXja.cjs.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("./Heading-CCs6OF_m.cjs.js"),w=require("@chakra-ui/react"),$=require("react"),c=require("./useDateFormatter-BBcUQTYP.cjs.js"),m=require("./utils-BHdR5Nww.cjs.js"),R=require("./context-OoV8SSWX.cjs.js"),v=require("./box-CWni3A32.cjs.js"),h=require("@commercetools/nimbus-icons"),q=require("@chakra-ui/react/flex"),g=require("./stack-CIN13EDn.cjs.js"),D=require("./visually-hidden-tTYCAVoQ.cjs.js"),u=require("./icon-button-vWPrT-bR.cjs.js"),j=require("./text-CCW9kDT_.cjs.js"),P=require("./index-CRFg4Mhx.cjs.js"),I=require("@chakra-ui/react/styled-system"),T=require("./extractStyleProps-Dk3fpLyQ.cjs.js"),y=require("./Button-CFZnLKVR.cjs.js"),C=require("./Text-BWSfeB9p.cjs.js"),{withProvider:B,withContext:s}=w.createSlotRecipeContext({key:"rangeCalendar"}),H=B("div","root"),A=s("div","header"),F=s("div","grids"),G=s("div","monthTitle"),L=s("table","grid"),k=s("thead","gridHeader"),M=s("th","headerCell"),N=s("tbody","gridBody"),z=s("td","bodyCell"),K=()=>{const{locale:d}=R.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=m.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$233dd9682e1ad64b),t=$.useContext(a.$dfd62f934fc76fed$export$5e0fc348c00f87a0),r=n?.visibleDuration?.months||1,o=c.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),i=r>1;return e.jsx(F,{children:Array.from({length:r},(p,l)=>{const b=t.visibleRange.start.add({months:l}),f=new Intl.DateTimeFormat(d,{month:"long"}).format(b.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()));return e.jsxs(v.Box,{width:r==1?"full":"auto",children:[i&&e.jsx(G,{children:f}),e.jsx(L,{asChild:!0,children:e.jsxs(a.$dfd62f934fc76fed$export$5bd780d491cfc46c,{offset:{months:l},weekdayStyle:"short",children:[e.jsx(k,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$22e2d15eaa4d2377,{children:x=>e.jsx(M,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$ad2135cac3a11b3d,{children:x})})})}),e.jsx(N,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e11f8ba65d857bff,{children:x=>{const S=x.compare(o)===0;return e.jsx(z,{asChild:!0,"data-today":S,children:e.jsx(a.$dfd62f934fc76fed$export$5d847498420df57b,{date:x})})}})})]})})]},f)})})},V=()=>{const t=(m.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$233dd9682e1ad64b)?.visibleDuration?.months||1)>1;return e.jsx(A,{children:e.jsxs(q.Flex,{children:[e.jsxs(g.Stack,{direction:"row",alignItems:"center",children:[e.jsx(D.VisuallyHidden,{children:e.jsx(a.$5cb03073d3f54797$export$a8a3e93435678ff9,{})}),e.jsx(u.IconButton,{slot:t?"previous":"previous-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(h.KeyboardArrowLeft,{})}),e.jsx(j.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:t?"4000":"2000",textAlign:"center","aria-hidden":"true",slot:t?"monthRange":"month"}),e.jsx(u.IconButton,{slot:t?"next":"next-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(h.KeyboardArrowRight,{})})]}),e.jsx(v.Box,{flexGrow:"1"}),e.jsxs(g.Stack,{direction:"row",alignItems:"center",children:[e.jsx(u.IconButton,{slot:"previous-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(h.KeyboardArrowLeft,{})}),e.jsx(j.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:"1400",textAlign:"center","aria-hidden":"true",slot:"year"}),e.jsx(u.IconButton,{slot:"next-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx(h.KeyboardArrowRight,{})})]})]})})},W=({children:d})=>{const{locale:n}=R.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),t=$.useContext(y.$d2b4bc8c273e7be6$export$24d547caef80ccd1),r=$.useContext(C.$514c0188e459b4c0$export$9afb8bc826b033ea),o=$.useContext(a.$dfd62f934fc76fed$export$5e0fc348c00f87a0),i={"next-month":{onPress:()=>o.focusNextSection(),"aria-label":"Next month"},"previous-month":{onPress:()=>o.focusPreviousSection(),"aria-label":"Previous month"},"next-year":{onPress:()=>o.focusNextSection(!0),"aria-label":"Next year"},"previous-year":{onPress:()=>o.focusPreviousSection(!0),"aria-label":"Previous year"}},p=new Intl.DateTimeFormat(n,{month:"long"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),l=[new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.start.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.end.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))].join(" - "),b=new Intl.DateTimeFormat(n,{year:"numeric"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),f={month:{children:p},monthRange:{children:l},year:{children:b}};return e.jsx(m.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[y.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{...t,slots:{...t&&typeof t=="object"&&"slots"in t?t.slots:{},...i}}],[C.$514c0188e459b4c0$export$9afb8bc826b033ea,{...r,slots:{...r&&typeof r=="object"&&"slots"in r?r.slots:{},...f}}]],children:d})},_=d=>{const n=I.useRecipe({recipe:P.rangeCalendarSlotRecipe}),[t,r]=n.splitVariantProps(d),[o,i]=T.extractStyleProps(r);return e.jsx(H,{...t,...o,asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$a4f5c8b89d277a8d,{...i,children:e.jsxs(W,{children:[e.jsx(V,{}),e.jsx(K,{})]})})})};exports.RangeCalendar=_;
|
|
2
|
-
//# sourceMappingURL=range-calendar-_dZfAsdG.cjs.js.map
|