@commercetools/nimbus 2.0.1-rc3 → 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/{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-D7a9HHSH.cjs.js.map +1 -0
- package/dist/chunks/calendar-0Tr21POc.cjs.js +2 -0
- package/dist/chunks/calendar-0Tr21POc.cjs.js.map +1 -0
- package/dist/chunks/{calendar-lD6G93R9.es.js → calendar-okvAi9qK.es.js} +2 -2
- package/dist/chunks/calendar-okvAi9qK.es.js.map +1 -0
- 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-Cap8-3zj.es.js → date-input-BiOdvpWz.es.js} +2 -2
- 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-ChZ8H-MT.es.js → date-picker-EuMU6RtR.es.js} +5 -5
- package/dist/chunks/{date-picker-ChZ8H-MT.es.js.map → date-picker-EuMU6RtR.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-DGWMdcAN.es.js → date-range-picker-CL-QH8BW.es.js} +5 -5
- package/dist/chunks/{date-range-picker-DGWMdcAN.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/group-BqUFlw5R.cjs.js.map +1 -1
- package/dist/chunks/group-CWADf2vF.es.js.map +1 -1
- package/dist/chunks/icon-CenxuChf.es.js.map +1 -1
- package/dist/chunks/icon-D39U--jA.cjs.js.map +1 -1
- 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/kbd-BaeV_DL-.cjs.js.map +1 -1
- package/dist/chunks/kbd-CH9rYghB.es.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/popover-CfEq5G5-.cjs.js.map +1 -1
- package/dist/chunks/popover-DNaC7CwB.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-DBpl6y5i.es.js → range-calendar-PUt59Hda.es.js} +2 -2
- package/dist/chunks/range-calendar-PUt59Hda.es.js.map +1 -0
- package/dist/chunks/range-calendar-lhmomEF_.cjs.js +2 -0
- package/dist/chunks/range-calendar-lhmomEF_.cjs.js.map +1 -0
- package/dist/chunks/{rich-text-input-BC8CBVio.es.js → rich-text-input-Cm0M04n-.es.js} +6 -6
- package/dist/chunks/rich-text-input-Cm0M04n-.es.js.map +1 -0
- package/dist/chunks/{rich-text-input-Da5WFZ3l.cjs.js → rich-text-input-DqwZD5Di.cjs.js} +2 -2
- package/dist/chunks/rich-text-input-DqwZD5Di.cjs.js.map +1 -0
- 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-LENwoBTF.es.js.map +1 -0
- package/dist/chunks/{split-button-BO52sL7h.cjs.js → split-button-go3Ez6Ea.cjs.js} +2 -2
- package/dist/chunks/split-button-go3Ez6Ea.cjs.js.map +1 -0
- 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/tag-group-Btt0egzG.cjs.js.map +1 -1
- package/dist/chunks/tag-group-D2dgXSsV.es.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--a_qv-Jk.es.js → time-input-B6we5H7C.es.js} +2 -2
- 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/tooltip-BPTOkK7W.cjs.js.map +1 -1
- package/dist/chunks/tooltip-sgakxhiy.es.js.map +1 -1
- package/dist/components/accordion/accordion.slots.d.ts +1 -1
- package/dist/components/accordion/accordion.types.d.ts +4 -4
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.es.js +1 -1
- package/dist/components/calendar/calendar.slots.d.ts +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/collapsible-motion.slots.d.ts +1 -1
- package/dist/components/collapsible-motion.cjs +1 -1
- package/dist/components/collapsible-motion.es.js +1 -1
- package/dist/components/combobox/combobox.slots.d.ts +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/group/group.slots.d.ts +1 -1
- package/dist/components/icon/icon.slots.d.ts +1 -1
- package/dist/components/icon-toggle-button.cjs +1 -1
- package/dist/components/icon-toggle-button.es.js +1 -1
- package/dist/components/kbd/kbd.slots.d.ts +1 -1
- package/dist/components/localized-field.cjs +1 -1
- package/dist/components/localized-field.es.js +1 -1
- package/dist/components/menu/menu.slots.d.ts +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/popover/popover.slots.d.ts +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/range-calendar.slots.d.ts +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/rich-text-input.slots.d.ts +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/separator.slots.d.ts +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.es.js +1 -1
- package/dist/components/split-button/split-button.slots.d.ts +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/split-button.es.js +1 -1
- package/dist/components/switch/switch.slots.d.ts +1 -1
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/tabs/tabs.slots.d.ts +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.es.js +1 -1
- package/dist/components/tag-group/tag-group.slots.d.ts +1 -1
- package/dist/components/text-input.cjs +1 -1
- package/dist/components/text-input.es.js +1 -1
- package/dist/components/time-input.cjs +1 -1
- package/dist/components/time-input.es.js +1 -1
- package/dist/components/toggle-button.cjs +1 -1
- package/dist/components/toggle-button.es.js +1 -1
- package/dist/components/toolbar.cjs +1 -1
- package/dist/components/toolbar.es.js +1 -1
- package/dist/components/tooltip/tooltip.slots.d.ts +1 -1
- package/dist/components/tooltip/tooltip.types.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +197 -202
- package/dist/index.es.js.map +1 -1
- package/dist/type-utils/index.d.ts +2 -0
- package/dist/{components/utils/type-helpers.d.ts → type-utils/omit-props.d.ts} +5 -5
- package/dist/utils/extract-aria-attributes.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -3
- package/package.json +5 -5
- package/dist/chunks/accordion-B2FLWAh5.cjs.js +0 -2
- package/dist/chunks/accordion-B2FLWAh5.cjs.js.map +0 -1
- package/dist/chunks/accordion-CKDnNkVv.es.js.map +0 -1
- package/dist/chunks/calendar-V0KeNCQ3.cjs.js +0 -2
- package/dist/chunks/calendar-V0KeNCQ3.cjs.js.map +0 -1
- package/dist/chunks/calendar-lD6G93R9.es.js.map +0 -1
- 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-Cap8-3zj.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-DBpl6y5i.es.js.map +0 -1
- package/dist/chunks/range-calendar-_dZfAsdG.cjs.js +0 -2
- package/dist/chunks/range-calendar-_dZfAsdG.cjs.js.map +0 -1
- package/dist/chunks/rich-text-input-BC8CBVio.es.js.map +0 -1
- package/dist/chunks/rich-text-input-Da5WFZ3l.cjs.js.map +0 -1
- 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/split-button-BO52sL7h.cjs.js.map +0 -1
- package/dist/chunks/split-button-BxyZmuNi.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--a_qv-Jk.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/components/utils/index.d.ts +0 -4
- /package/dist/{utils → type-utils}/slot-types.d.ts +0 -0
- /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
|
@@ -4,7 +4,7 @@ import { k as v, h as N } from "./Dialog-Qpq4hk89.es.js";
|
|
|
4
4
|
import { createSlotRecipeContext as O, useSlotRecipe as H, chakra as B } from "@chakra-ui/react/styled-system";
|
|
5
5
|
import { l as m } from "./index-CtB71yr7.es.js";
|
|
6
6
|
import { a as I } from "./Button-Dx3xzN8n.es.js";
|
|
7
|
-
import { e as g } from "./
|
|
7
|
+
import { e as g } from "./extract-style-props-DYXEhLtq.es.js";
|
|
8
8
|
import { $ as M, a as F } from "./Modal-DZrVgGsJ.es.js";
|
|
9
9
|
import { H as k } from "./heading-BtazVUd5.es.js";
|
|
10
10
|
import { Close as E } from "@commercetools/nimbus-icons";
|
|
@@ -301,4 +301,4 @@ const we = {
|
|
|
301
301
|
export {
|
|
302
302
|
we as D
|
|
303
303
|
};
|
|
304
|
-
//# sourceMappingURL=drawer-
|
|
304
|
+
//# sourceMappingURL=drawer-CT5qAdLo.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-CT5qAdLo.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\";\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\";\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,OAA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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;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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("./extract-style-props-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-vgDYdzlq.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-vgDYdzlq.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\";\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\";\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":"6cAMM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,OAAQC,EAAAA,gBACV,CAAC,EAIYC,EAAiBJ,EAC5B,MACA,MACF,EAIaK,EAAoBJ,EAG/B,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,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-style-props-DYXEhLtq.es.js","sources":["../../src/utils/extract-style-props.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;"}
|
package/dist/chunks/{extractStyleProps-Dk3fpLyQ.cjs.js → extract-style-props-Dk3fpLyQ.cjs.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const c=require("./index-CRFg4Mhx.cjs.js");function o(e){const r={},s={...e};return Object.keys(e).forEach(t=>{Object.prototype.hasOwnProperty.call(e,t)&&c.system.isValidProperty(t)&&(r[t]=e[t],delete s[t])}),[r,s]}exports.extractStyleProps=o;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=extract-style-props-Dk3fpLyQ.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-style-props-Dk3fpLyQ.cjs.js","sources":["../../src/utils/extract-style-props.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-BqUFlw5R.cjs.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type {
|
|
1
|
+
{"version":3,"file":"group-BqUFlw5R.cjs.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { GroupRootSlotProps } from \"./group.types\";\n\nconst { withContext } = createRecipeContext({\n key: \"group\",\n});\n\n/**\n * Slot component that provides the styling context for the Group component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const GroupSlot: SlotComponent<typeof RaGroup, GroupRootSlotProps> =\n withContext<typeof RaGroup, GroupRootSlotProps>(RaGroup);\n","import { GroupSlot } from \"./group.slots\";\nimport type { GroupComponent } from \"./group.types\";\n\nexport const Group: GroupComponent = (props) => {\n const { ref, children, ...rest } = props;\n return (\n <GroupSlot ref={ref} {...rest}>\n {children}\n </GroupSlot>\n );\n};\n"],"names":["withContext","createRecipeContext","GroupSlot","RaGroup","Group","props","ref","children","rest","jsx"],"mappings":"qHAKM,CAAE,YAAAA,CAAA,EAAgBC,sBAAoB,CAC1C,IAAK,OACP,CAAC,EAMYC,EACXF,EAAgDG,2CAAO,ECX5CC,EAAyBC,GAAU,CAC9C,KAAM,CAAE,IAAAC,EAAK,SAAAC,EAAU,GAAGC,GAASH,EACnC,OACEI,EAAAA,IAACP,EAAA,CAAU,IAAAI,EAAW,GAAGE,EACtB,SAAAD,EACH,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-CWADf2vF.es.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type {
|
|
1
|
+
{"version":3,"file":"group-CWADf2vF.es.js","sources":["../../src/components/group/group.slots.tsx","../../src/components/group/group.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport { Group as RaGroup } from \"react-aria-components\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { GroupRootSlotProps } from \"./group.types\";\n\nconst { withContext } = createRecipeContext({\n key: \"group\",\n});\n\n/**\n * Slot component that provides the styling context for the Group component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const GroupSlot: SlotComponent<typeof RaGroup, GroupRootSlotProps> =\n withContext<typeof RaGroup, GroupRootSlotProps>(RaGroup);\n","import { GroupSlot } from \"./group.slots\";\nimport type { GroupComponent } from \"./group.types\";\n\nexport const Group: GroupComponent = (props) => {\n const { ref, children, ...rest } = props;\n return (\n <GroupSlot ref={ref} {...rest}>\n {children}\n </GroupSlot>\n );\n};\n"],"names":["withContext","createRecipeContext","GroupSlot","RaGroup","Group","props","ref","children","rest","jsx"],"mappings":";;;AAKA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB;AAAA,EAC1C,KAAK;AACP,CAAC,GAMYC,IACX,gBAAAF,EAAgDG,CAAO,GCX5CC,IAAwB,CAACC,MAAU;AAC9C,QAAM,EAAE,KAAAC,GAAK,UAAAC,GAAU,GAAGC,MAASH;AACnC,SACE,gBAAAI,EAACP,GAAA,EAAU,KAAAI,GAAW,GAAGE,GACtB,UAAAD,GACH;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-CenxuChf.es.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type {
|
|
1
|
+
{"version":3,"file":"icon-CenxuChf.es.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { IconRootSlotProps } from \"./icon.types\";\n\nconst { withContext } = createRecipeContext({ key: \"icon\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot: SlotComponent<SVGSVGElement, IconRootSlotProps> =\n withContext<SVGSVGElement, IconRootSlotProps>(\"svg\");\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["withContext","createRecipeContext","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":";;AAIA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,KAAK,QAAQ,GAM9CC,IACX,gBAAAF,EAA8C,KAAK,GCDxCG,IAAO,CAACC,MAAqB;AACxC,QAAM,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAcF;AAC9B,SAAO,gBAAAG,EAACL,KAAa,KAAAG,GAAU,SAAS,CAACC,EAAU,IAAK,GAAGA,GAAW;AACxE;AAEAH,EAAK,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-D39U--jA.cjs.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type {
|
|
1
|
+
{"version":3,"file":"icon-D39U--jA.cjs.js","sources":["../../src/components/icon/icon.slots.tsx","../../src/components/icon/icon.tsx"],"sourcesContent":["import { createRecipeContext } from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\nimport type { IconRootSlotProps } from \"./icon.types\";\n\nconst { withContext } = createRecipeContext({ key: \"icon\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const IconRootSlot: SlotComponent<SVGSVGElement, IconRootSlotProps> =\n withContext<SVGSVGElement, IconRootSlotProps>(\"svg\");\n","import { IconRootSlot } from \"./icon.slots\";\nimport type { IconProps } from \"./icon.types\";\n\n/**\n * # Icon\n *\n * displays icon components\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/media/icon}\n */\nexport const Icon = (props: IconProps) => {\n const { ref, ...restProps } = props;\n return <IconRootSlot ref={ref} asChild={!restProps.as} {...restProps} />;\n};\n\nIcon.displayName = \"Icon\";\n"],"names":["withContext","createRecipeContext","IconRootSlot","Icon","props","ref","restProps","jsx"],"mappings":"gFAIM,CAAE,YAAAA,CAAA,EAAgBC,EAAAA,oBAAoB,CAAE,IAAK,OAAQ,EAM9CC,EACXF,EAA8C,KAAK,ECDxCG,EAAQC,GAAqB,CACxC,KAAM,CAAE,IAAAC,EAAK,GAAGC,CAAA,EAAcF,EAC9B,OAAOG,EAAAA,IAACL,GAAa,IAAAG,EAAU,QAAS,CAACC,EAAU,GAAK,GAAGA,EAAW,CACxE,EAEAH,EAAK,YAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { T as l } from "./toggle-button-
|
|
2
|
+
import { T as l } from "./toggle-button-D3M4e72c.es.js";
|
|
3
3
|
const n = ({
|
|
4
4
|
"aria-label": o,
|
|
5
5
|
children: t,
|
|
@@ -10,4 +10,4 @@ n.displayName = "IconToggleButton";
|
|
|
10
10
|
export {
|
|
11
11
|
n as I
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=icon-toggle-button-
|
|
13
|
+
//# sourceMappingURL=icon-toggle-button-Bt_1Mdus.es.js.map
|
package/dist/chunks/{icon-toggle-button-Bi-9Obfx.es.js.map → icon-toggle-button-Bt_1Mdus.es.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-toggle-button-
|
|
1
|
+
{"version":3,"file":"icon-toggle-button-Bt_1Mdus.es.js","sources":["../../src/components/icon-toggle-button/icon-toggle-button.tsx"],"sourcesContent":["import { ToggleButton } from \"@/components/toggle-button\";\nimport type { IconToggleButtonProps } from \"./icon-toggle-button.types\";\n\n/**\n * # IconToggleButton\n * ============================================================\n * A toggle button with only an icon as child. It is based\n * on the regular `ToggleButton` component, but with a few adjustments.\n *\n */\nexport const IconToggleButton = ({\n \"aria-label\": ariaLabel,\n children,\n ref,\n ...props\n}: IconToggleButtonProps) => {\n return (\n <ToggleButton ref={ref} aria-label={ariaLabel} px={0} py={0} {...props}>\n {children}\n </ToggleButton>\n );\n};\n\nIconToggleButton.displayName = \"IconToggleButton\";\n"],"names":["IconToggleButton","ariaLabel","children","ref","props","jsx","ToggleButton"],"mappings":";;AAUO,MAAMA,IAAmB,CAAC;AAAA,EAC/B,cAAcC;AAAA,EACd,UAAAC;AAAA,EACA,KAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAACC,GAAA,EAAa,KAAAH,GAAU,cAAYF,GAAW,IAAI,GAAG,IAAI,GAAI,GAAGG,GAC9D,UAAAF,EAAA,CACH;AAIJF,EAAiB,cAAc;"}
|
package/dist/chunks/{icon-toggle-button-eLrsWehe.cjs.js → icon-toggle-button-Bv-FwWwz.cjs.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const l=require("react/jsx-runtime"),u=require("./toggle-button-
|
|
2
|
-
//# sourceMappingURL=icon-toggle-button-
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),u=require("./toggle-button-CLEgCPGX.cjs.js"),t=({"aria-label":o,children:e,ref:n,...g})=>l.jsx(u.ToggleButton,{ref:n,"aria-label":o,px:0,py:0,...g,children:e});t.displayName="IconToggleButton";exports.IconToggleButton=t;
|
|
2
|
+
//# sourceMappingURL=icon-toggle-button-Bv-FwWwz.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-toggle-button-
|
|
1
|
+
{"version":3,"file":"icon-toggle-button-Bv-FwWwz.cjs.js","sources":["../../src/components/icon-toggle-button/icon-toggle-button.tsx"],"sourcesContent":["import { ToggleButton } from \"@/components/toggle-button\";\nimport type { IconToggleButtonProps } from \"./icon-toggle-button.types\";\n\n/**\n * # IconToggleButton\n * ============================================================\n * A toggle button with only an icon as child. It is based\n * on the regular `ToggleButton` component, but with a few adjustments.\n *\n */\nexport const IconToggleButton = ({\n \"aria-label\": ariaLabel,\n children,\n ref,\n ...props\n}: IconToggleButtonProps) => {\n return (\n <ToggleButton ref={ref} aria-label={ariaLabel} px={0} py={0} {...props}>\n {children}\n </ToggleButton>\n );\n};\n\nIconToggleButton.displayName = \"IconToggleButton\";\n"],"names":["IconToggleButton","ariaLabel","children","ref","props","jsx","ToggleButton"],"mappings":"+FAUaA,EAAmB,CAAC,CAC/B,aAAcC,EACd,SAAAC,EACA,IAAAC,EACA,GAAGC,CACL,IAEIC,EAAAA,IAACC,EAAAA,aAAA,CAAa,IAAAH,EAAU,aAAYF,EAAW,GAAI,EAAG,GAAI,EAAI,GAAGG,EAC9D,SAAAF,CAAA,CACH,EAIJF,EAAiB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd-BaeV_DL-.cjs.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/utils
|
|
1
|
+
{"version":3,"file":"kbd-BaeV_DL-.cjs.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ntype KbdRecipeProps = RecipeProps<\"kbd\"> & UnstyledProp;\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\nexport type KbdRootSlotProps = HTMLChakraProps<\"kbd\", KbdRecipeProps>;\n\nconst { withContext } = createRecipeContext({ key: \"kbd\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const KbdRootSlot: SlotComponent<HTMLElement, KbdRootSlotProps> =\n withContext<HTMLElement, KbdRootSlotProps>(\"kbd\");\n","import { KeyboardContext, useContextProps } from \"react-aria-components\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { type KbdProps as ChakraKbdProps } from \"@chakra-ui/react/kbd\";\nimport { useRef } from \"react\";\nimport type React from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { KbdRootSlot } from \"./kbd.slots\";\n\nexport type KbdProps = Omit<ChakraKbdProps, \"slot\"> & {\n ref?: React.Ref<HTMLElement>;\n slot?: string | null | undefined;\n};\n\n/**\n * # Kbd\n *\n * Renders a keyboard shortcut or key combination, styled for visual clarity.\n * Typically used to visually represent keyboard keys.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/typography/kbd}\n */\nexport const Kbd = ({ ref: forwardedRef, slot, ...props }: KbdProps) => {\n const localRef = useRef<HTMLElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n const [rest] = useContextProps(props, ref, KeyboardContext);\n\n return <KbdRootSlot ref={ref} slot={slot || undefined} {...rest} />;\n};\n"],"names":["withContext","createRecipeContext","KbdRootSlot","Kbd","forwardedRef","slot","props","localRef","useRef","ref","useObjectRef","mergeRefs","rest","useContextProps","KeyboardContext"],"mappings":"kQAqBM,CAAE,YAAAA,CAAA,EAAgBC,EAAAA,oBAAoB,CAAE,IAAK,MAAO,EAM7CC,EACXF,EAA2C,KAAK,ECPrCG,EAAM,CAAC,CAAE,IAAKC,EAAc,KAAAC,EAAM,GAAGC,KAAsB,CACtE,MAAMC,EAAWC,EAAAA,OAAoB,IAAI,EACnCC,EAAMC,EAAAA,0CAAaC,EAAAA,UAAUJ,EAAUH,CAAY,CAAC,EACpD,CAACQ,CAAI,EAAIC,EAAAA,0CAAgBP,EAAOG,EAAKK,EAAAA,yCAAe,EAE1D,aAAQZ,EAAA,CAAY,IAAAO,EAAU,KAAMJ,GAAQ,OAAY,GAAGO,EAAM,CACnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd-CH9rYghB.es.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/utils
|
|
1
|
+
{"version":3,"file":"kbd-CH9rYghB.es.js","sources":["../../src/components/kbd/kbd.slots.ts","../../src/components/kbd/kbd.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { SlotComponent } from \"@/type-utils\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the svg element.\n */\ntype KbdRecipeProps = RecipeProps<\"kbd\"> & UnstyledProp;\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\nexport type KbdRootSlotProps = HTMLChakraProps<\"kbd\", KbdRecipeProps>;\n\nconst { withContext } = createRecipeContext({ key: \"kbd\" });\n\n/**\n * Root component that provides the styling context for the Icon component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const KbdRootSlot: SlotComponent<HTMLElement, KbdRootSlotProps> =\n withContext<HTMLElement, KbdRootSlotProps>(\"kbd\");\n","import { KeyboardContext, useContextProps } from \"react-aria-components\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport { type KbdProps as ChakraKbdProps } from \"@chakra-ui/react/kbd\";\nimport { useRef } from \"react\";\nimport type React from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { KbdRootSlot } from \"./kbd.slots\";\n\nexport type KbdProps = Omit<ChakraKbdProps, \"slot\"> & {\n ref?: React.Ref<HTMLElement>;\n slot?: string | null | undefined;\n};\n\n/**\n * # Kbd\n *\n * Renders a keyboard shortcut or key combination, styled for visual clarity.\n * Typically used to visually represent keyboard keys.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/typography/kbd}\n */\nexport const Kbd = ({ ref: forwardedRef, slot, ...props }: KbdProps) => {\n const localRef = useRef<HTMLElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n const [rest] = useContextProps(props, ref, KeyboardContext);\n\n return <KbdRootSlot ref={ref} slot={slot || undefined} {...rest} />;\n};\n"],"names":["withContext","createRecipeContext","KbdRootSlot","Kbd","forwardedRef","slot","props","localRef","useRef","ref","useObjectRef","mergeRefs","rest","useContextProps","KeyboardContext"],"mappings":";;;;;;;AAqBA,MAAM,EAAE,aAAAA,EAAA,IAAgB,gBAAAC,EAAoB,EAAE,KAAK,OAAO,GAM7CC,IACX,gBAAAF,EAA2C,KAAK,GCPrCG,IAAM,CAAC,EAAE,KAAKC,GAAc,MAAAC,GAAM,GAAGC,QAAsB;AACtE,QAAMC,IAAWC,EAAoB,IAAI,GACnCC,IAAMC,EAAaC,EAAUJ,GAAUH,CAAY,CAAC,GACpD,CAACQ,CAAI,IAAIC,EAAgBP,GAAOG,GAAKK,CAAe;AAE1D,2BAAQZ,GAAA,EAAY,KAAAO,GAAU,MAAMJ,KAAQ,QAAY,GAAGO,GAAM;AACnE;"}
|
|
@@ -6,12 +6,12 @@ import { g as xe } from "./CollectionBuilder-Wz-mnWjQ.es.js";
|
|
|
6
6
|
import { WarningAmber as ne, HelpOutline as Ie, Payments as $e, Language as Me, ErrorOutline as we } from "@commercetools/nimbus-icons";
|
|
7
7
|
import { P as Ce } from "./popover-DNaC7CwB.es.js";
|
|
8
8
|
import { createSlotRecipeContext as je } from "@chakra-ui/react";
|
|
9
|
-
import { M as S } from "./money-input-
|
|
9
|
+
import { M as S } from "./money-input-BqYBGLzc.es.js";
|
|
10
10
|
import { F as I } from "./form-field-BYlpCXdY.es.js";
|
|
11
|
-
import { R as Ee } from "./rich-text-input-
|
|
12
|
-
import { M as ke } from "./multiline-text-input-
|
|
11
|
+
import { R as Ee } from "./rich-text-input-Cm0M04n-.es.js";
|
|
12
|
+
import { M as ke } from "./multiline-text-input-AyyHGKY2.es.js";
|
|
13
13
|
import { I as W } from "./icon-CenxuChf.es.js";
|
|
14
|
-
import { T as ze } from "./text-input-
|
|
14
|
+
import { T as ze } from "./text-input-DNorjU50.es.js";
|
|
15
15
|
import { $ as te } from "./mergeProps-CzyOU2NE.es.js";
|
|
16
16
|
import { $ as Se } from "./useField-B0j4t47V.es.js";
|
|
17
17
|
import { F as ie } from "./field-errors-ClQprmQz.es.js";
|
|
@@ -467,4 +467,4 @@ const tt = (e, t) => Object.values(e).map((o) => S.convertToMoneyValue(o, t)), i
|
|
|
467
467
|
export {
|
|
468
468
|
kt as L
|
|
469
469
|
};
|
|
470
|
-
//# sourceMappingURL=localized-field-
|
|
470
|
+
//# sourceMappingURL=localized-field-Bp4N2Mvl.es.js.map
|
package/dist/chunks/{localized-field-D3G0Uy7Z.es.js.map → localized-field-Bp4N2Mvl.es.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localized-field-D3G0Uy7Z.es.js","sources":["../../src/components/localized-field/localized-field.i18n.ts","../../src/components/localized-field/localized-field.slots.tsx","../../src/components/localized-field/utils/localized-field.utils.tsx","../../src/components/localized-field/components/localized-field.locale-field.tsx","../../src/components/localized-field/components/localized-field.root.tsx","../../src/components/localized-field/localized-field.tsx"],"sourcesContent":["import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n missingRequiredField: {\n id: \"Nimbus.LocalizedField.missingRequiredField\",\n description: \"Error message for missing required value\",\n defaultMessage: \"This field is required. Provide at least one value.\",\n },\n infoBoxTriggerAriaLabel: {\n id: \"Nimbus.LocalizedField.infoBoxTriggerAriaLabel\",\n description: \"aria label for button that triggers more info dialog\",\n defaultMessage: \"more info\",\n },\n showLanguages: {\n id: \"Nimbus.LocalizedField.showLanguages\",\n description:\n \"Label for showing all language inputs when toggle button is pressed\",\n defaultMessage: \"Show all languages\",\n },\n hideLanguages: {\n id: \"Nimbus.LocalizedField.hideLanguages\",\n description:\n \"Label for hiding all language inputs when toggle button is pressed\",\n defaultMessage: \"Hide all languages\",\n },\n showCurrencies: {\n id: \"Nimbus.LocalizedField.showCurrencies\",\n description:\n \"Label for showing all currency inputs when toggle button is pressed\",\n defaultMessage: \"Show all currencies\",\n },\n hideCurrencies: {\n id: \"Nimbus.LocalizedField.hideCurrencies\",\n description:\n \"Label for hiding all currency inputs when toggle button is pressed\",\n defaultMessage: \"Hide all currencies\",\n },\n});\n","import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n LocalizedFieldRootSlotProps,\n LocalizedFieldLabelSlotProps,\n LocalizedFieldInfoDialogSlotProps,\n LocalizedFieldFieldsContainerSlotProps,\n LocalizedFieldDescriptionSlotProps,\n LocalizedFieldErrorSlotProps,\n LocalizedFieldToggleButtonContainerSlotProps,\n LocalizedFieldLocaleFieldRootSlotProps,\n LocalizedFieldLocaleFieldLabelSlotProps,\n LocalizedFieldLocaleFieldInputSlotProps,\n} from \"./localized-field.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"localizedField\",\n});\n\n// Root Slot\nexport const LocalizedFieldRootSlot = withProvider<\n HTMLFieldSetElement,\n LocalizedFieldRootSlotProps\n>(\"fieldset\", \"root\");\n\n// Label Slot\nexport const LocalizedFieldLabelSlot = withContext<\n HTMLLabelElement,\n LocalizedFieldLabelSlotProps\n>(\"legend\", \"label\");\n\n// InfoDialog Slot\nexport const LocalizedFieldInfoDialogSlot = withContext<\n HTMLDivElement,\n LocalizedFieldInfoDialogSlotProps\n>(\"div\", \"infoDialog\");\n\n// FieldsContainer Slot\nexport const LocalizedFieldFieldsContainerSlot = withContext<\n HTMLDivElement,\n LocalizedFieldFieldsContainerSlotProps\n>(\"div\", \"fieldsContainer\");\n\n// Description Slot\nexport const LocalizedFieldDescriptionSlot = withContext<\n HTMLDivElement,\n LocalizedFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport const LocalizedFieldErrorSlot = withContext<\n HTMLDivElement,\n LocalizedFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// ToggleButtonContainer Slot\nexport const LocalizedFieldToggleButtonContainerSlot = withContext<\n HTMLDivElement,\n LocalizedFieldToggleButtonContainerSlotProps\n>(\"div\", \"toggleButtonContainer\");\n\n// LocaleFieldRoot Slot\nexport const LocalizedFieldLocaleFieldRootSlot = withContext<\n HTMLDivElement,\n LocalizedFieldLocaleFieldRootSlotProps\n>(\"div\", \"localeFieldRoot\");\n\n// FieldLabel Slot\nexport const LocalizedFieldLocaleFieldLabelSlot = withContext<\n HTMLDivElement,\n LocalizedFieldLocaleFieldLabelSlotProps\n>(\"div\", \"localeFieldLabel\");\n\n// FieldInput Slot\nexport const LocalizedFieldLocaleFieldInputSlot = withContext<\n HTMLDivElement,\n LocalizedFieldLocaleFieldInputSlotProps\n>(\"div\", \"localeFieldInput\");\n","import { FormattedMessage } from \"react-intl\";\nimport {\n FormField,\n type TCurrencyCode,\n type TValue,\n type TMoneyValue,\n type TFieldErrors,\n MoneyInput,\n} from \"@/components\";\nimport messages from \"../localized-field.i18n\";\nimport type { LocalizedString } from \"../localized-field.types\";\n\ntype LanguagesSplitByDefaultLocale = {\n related: string[];\n unrelated: string[];\n};\n\ntype TouchedLocalizedString = { [locale: string]: boolean };\n\ntype CustomFormikErrors<Values> = {\n [K in keyof Values]?: TFieldErrors;\n};\n\nexport const RequiredValueErrorMessage = () => (\n <FormField.Error>\n <FormattedMessage {...messages.missingRequiredField} />\n </FormField.Error>\n);\n\nexport const getLocaleFieldAttribute = (\n fieldGroupAttr?: string,\n locale?: string\n): string | undefined =>\n fieldGroupAttr && locale ? `${fieldGroupAttr}.${locale}` : undefined;\n\n// gets the language tag of a given locale, e.g. `de` in `de-DE`\nexport const getLanguageForLocale = (locale: string): string =>\n locale.split(\"-\")[0];\n\n// splits the locales into two groups:\n// - the 'related' array contains locales with the same language tag as the default locale,\n// e.g. if the default locale is de-DE, related would be ['de-DE', 'de-CH']\n// - the 'unrelated' array contains locales with a different different language tag from the default locale\n//. e.g. if the default locale is de-DE, unrelated would be ['pt-BR', 'en-GB', 'zh-Hans']\nexport const splitLanguages = (\n defaultLocale: string,\n locales: string[]\n): LanguagesSplitByDefaultLocale => {\n const defaultLanguage = getLanguageForLocale(defaultLocale);\n const related = locales.filter(\n (locale) => getLanguageForLocale(locale) === defaultLanguage\n );\n const unrelated = locales.filter(\n (locale) => getLanguageForLocale(locale) !== defaultLanguage\n );\n return {\n unrelated,\n related,\n };\n};\n\n// sorts locales with the following priority:\n// - The selected locale is placed first (e.g pt-BR)\n// - All locales using the same language tag as the selected language\n// follow (e.g. pt, pt-PT). They are sorted alphabetically.\n// - All other locales follow, sorted alphabetically as well\nexport const sortLocalesByDefaultLocaleLanguage = (\n defaultLocale: string,\n allLocales: string[]\n): string[] => {\n const { related, unrelated } = splitLanguages(\n defaultLocale,\n allLocales.filter((locale: string) => locale !== defaultLocale)\n );\n\n return [defaultLocale, ...related.sort(), ...unrelated.sort()];\n};\n\nexport const sortCurrencies = (\n defaultCurrency: TCurrencyCode,\n allCurrencies: TCurrencyCode[]\n) => {\n const remainingCurrencies = allCurrencies.filter(\n (currency) => currency !== defaultCurrency\n );\n return [defaultCurrency, ...remainingCurrencies.sort()];\n};\n\nexport const getHasInvalidLocalizedFields = <TErrors extends object>(\n errors?: TErrors,\n defaultLocaleOrCurrency?: string\n): boolean => {\n if (errors && Object.keys(errors).length > 0 && defaultLocaleOrCurrency) {\n return Object.keys(errors).some(\n (localeOrCurrency) => localeOrCurrency !== defaultLocaleOrCurrency\n );\n }\n return false;\n};\n\nexport const createLocalizedString = (\n locales: string[],\n existingLocalizedString: LocalizedString\n): LocalizedString => {\n const localesInLocalizedString = Array.from(\n new Set([...locales, ...Object.keys(existingLocalizedString)])\n );\n\n return localesInLocalizedString.reduce<LocalizedString>(\n (localizedString, locale) => ({\n ...localizedString,\n [locale]: existingLocalizedString?.[locale] || \"\",\n }),\n {}\n );\n};\n\n// Note: I prefer `isLocalizedStringEmpty`, but keeping this as `isEmpty` for api consistency with UI Kit\nexport const isEmpty = (localizedString?: LocalizedString): boolean => {\n if (!localizedString) return true;\n return Object.values(localizedString).every(\n (value?: string) => !value || value?.trim().length === 0\n );\n};\n\nexport const omitEmptyTranslations = <Translations extends LocalizedString>(\n localizedString: Translations\n): LocalizedString => {\n // TODO: is it necessary to create a util that enforces a consistent warning/error format, e.g.\n // `<COMPONENT_NAME> - Warning: <WARNING_MESSAGE>`\n if (typeof localizedString !== \"object\") {\n console.warn(\n \"Nimbus Localized Field - Warning: omitEmptyTranslations must be called with an object\"\n );\n }\n\n return Object.entries(localizedString).reduce<LocalizedString>(\n (localizedStringWithoutEmptyTranslations, [locale, value]) => {\n if (value && value.trim().length > 0) {\n return {\n ...localizedStringWithoutEmptyTranslations,\n [locale]: value,\n };\n }\n return localizedStringWithoutEmptyTranslations;\n },\n {}\n );\n};\n\nexport const isTouched = (touched?: TouchedLocalizedString): boolean => {\n if (touched) {\n return Object.values(touched).some(Boolean);\n }\n return false;\n};\n\n/**\n * Use this function to convert the Formik `errors` object type to\n * our custom field errors type.\n * This is primarly useful when using TypeScript.\n */\nexport function toFieldErrors<FormValues>(\n errors: unknown\n): CustomFormikErrors<FormValues> {\n return errors as CustomFormikErrors<FormValues>;\n}\n\nexport const convertToMoneyValues = (\n values: TValue[],\n currency: string\n): Array<TMoneyValue | null> =>\n Object.values(values).map<TMoneyValue | null>((value) => {\n return MoneyInput.convertToMoneyValue(value, currency);\n });\n\nexport const parseMoneyValues = (\n moneyValues: TMoneyValue[] = [],\n locale: string\n): Record<TCurrencyCode, TValue> =>\n moneyValues.reduce<Record<TCurrencyCode, TValue>>(\n (allValues, moneyValue) => {\n const value = MoneyInput.parseMoneyValue(moneyValue, locale);\n return {\n ...allValues,\n [value.currencyCode]: value,\n };\n },\n {} as Record<TCurrencyCode, TValue>\n );\n\nexport const getHighPrecisionCurrencies = (\n values: Record<TCurrencyCode, TValue>,\n locale: string\n): TCurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as TCurrencyCode[];\n return typedCurrencyCodes.filter((currencyCode) =>\n MoneyInput.isHighPrecision(values[currencyCode], locale)\n );\n};\n\nexport const getEmptyCurrencies = (\n values: Record<TCurrencyCode, TValue>\n): TCurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as TCurrencyCode[];\n return typedCurrencyCodes.filter((currencyCode) =>\n MoneyInput.isEmpty(values[currencyCode])\n );\n};\n","import { useCallback } from \"react\";\nimport {\n FormField,\n Icon,\n TextInput,\n MoneyInput,\n type TCustomEvent,\n MultilineTextInput,\n RichTextInput,\n type TValue,\n type TCurrencyCode,\n} from \"@/components\";\nimport { WarningAmber } from \"@commercetools/nimbus-icons\";\nimport {\n LocalizedFieldLocaleFieldRootSlot,\n LocalizedFieldLocaleFieldInputSlot,\n LocalizedFieldLocaleFieldLabelSlot,\n} from \"../localized-field.slots\";\nimport type { LocalizedFieldLocaleFieldProps } from \"../localized-field.types\";\n\nexport const LocalizedFieldLocaleField = ({\n type,\n size,\n localeOrCurrency,\n id,\n name,\n inputValue: inputValueFromProps,\n description,\n warning,\n error,\n onChange,\n onBlur,\n onFocus,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n touched,\n ...otherProps\n}: LocalizedFieldLocaleFieldProps) => {\n let InputComponent:\n | typeof TextInput\n | typeof MultilineTextInput\n | typeof MoneyInput\n | typeof RichTextInput;\n switch (type) {\n case \"text\":\n default:\n InputComponent = TextInput;\n break;\n case \"multiLine\":\n InputComponent = MultilineTextInput;\n break;\n case \"money\":\n InputComponent = MoneyInput;\n break;\n case \"richText\":\n InputComponent = RichTextInput;\n break;\n }\n\n const getInputValue = () => {\n if (type === \"money\") {\n return inputValueFromProps\n ? (inputValueFromProps as TValue)\n : ({ amount: \"\", currencyCode: localeOrCurrency } as TValue);\n }\n return inputValueFromProps ? inputValueFromProps : \"\";\n };\n\n const inputValue = getInputValue();\n\n const handleChange = useCallback(\n (value: string | TCustomEvent | undefined) => {\n // The `MoneyInput` onChange event value is a custom value,\n // and the `MoneyInput` modifies the input id and name since it is in a `group`,\n // so we need to build a separate return object for the MoneInput to return\n // the expected values\n const isMoneyInputEvent = typeof value === \"object\";\n const changeValue = {\n target: isMoneyInputEvent\n ? {\n id: value.target.id,\n name: value.target.name,\n locale: undefined,\n currency: localeOrCurrency as TCurrencyCode,\n value: value.target.value,\n }\n : { id, name, locale: localeOrCurrency, currency: undefined, value },\n };\n onChange(changeValue);\n },\n [id, name, localeOrCurrency, onChange]\n );\n\n return (\n <LocalizedFieldLocaleFieldRootSlot asChild>\n <FormField.Root\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInvalid={(isInvalid || !!error) && touched}\n direction=\"row\"\n size={size}\n id={id}\n >\n <LocalizedFieldLocaleFieldLabelSlot\n display={type === \"money\" ? \"none\" : undefined}\n {...(isDisabled && { \"data-disabled\": isDisabled })}\n asChild\n >\n <FormField.Label>\n {localeOrCurrency.toLocaleUpperCase()}\n </FormField.Label>\n </LocalizedFieldLocaleFieldLabelSlot>\n <FormField.Input>\n <LocalizedFieldLocaleFieldInputSlot\n aria-required={isRequired}\n asChild\n >\n <InputComponent\n {...otherProps}\n size={size}\n value={inputValue as string & TValue}\n onChange={handleChange}\n onBlur={(e: React.FocusEvent | TCustomEvent) =>\n onBlur?.(e, localeOrCurrency)\n }\n onFocus={(e: React.FocusEvent | TCustomEvent) =>\n onFocus?.(e, localeOrCurrency)\n }\n isRequired={isRequired}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInvalid={(isInvalid || !!error) && touched}\n />\n </LocalizedFieldLocaleFieldInputSlot>\n </FormField.Input>\n {(description || (warning && touched)) && (\n <FormField.Description\n role={warning && touched ? \"status\" : undefined}\n color={warning && touched ? \"warning.11\" : undefined}\n display=\"flex\"\n gap=\"100\"\n alignItems=\"center\"\n >\n {warning && touched ? (\n <>\n <Icon colorPalette=\"warning\">\n <WarningAmber />\n </Icon>\n {warning}\n </>\n ) : (\n description\n )}\n </FormField.Description>\n )}\n {error && touched && <FormField.Error>{error}</FormField.Error>}\n </FormField.Root>\n </LocalizedFieldLocaleFieldRootSlot>\n );\n};\n","import { useState, useMemo } from \"react\";\nimport { useIntl } from \"react-intl\";\nimport {\n Collection as RaCollection,\n Dialog as RaDialog,\n DialogTrigger as RaDialogTrigger,\n} from \"react-aria-components\";\nimport { useField, useId } from \"react-aria\";\nimport {\n ErrorOutline,\n HelpOutline,\n Language,\n Payments,\n WarningAmber,\n} from \"@commercetools/nimbus-icons\";\nimport {\n Box,\n Button,\n FieldErrors,\n Icon,\n IconButton,\n Stack,\n type TCurrencyCode,\n} from \"@/components\";\nimport { Popover } from \"../../popover\";\nimport messages from \"../localized-field.i18n\";\nimport {\n LocalizedFieldRootSlot,\n LocalizedFieldLabelSlot,\n LocalizedFieldInfoDialogSlot,\n LocalizedFieldFieldsContainerSlot,\n LocalizedFieldDescriptionSlot,\n LocalizedFieldErrorSlot,\n LocalizedFieldToggleButtonContainerSlot,\n} from \"../localized-field.slots\";\nimport type {\n LocalizedFieldProps,\n MergedLocaleFieldData,\n LocalizedCurrency,\n} from \"../localized-field.types\";\n\nimport {\n getHasInvalidLocalizedFields,\n getLocaleFieldAttribute,\n sortCurrencies,\n sortLocalesByDefaultLocaleLanguage,\n} from \"../utils/localized-field.utils\";\nimport { LocalizedFieldLocaleField } from \"./localized-field.locale-field\";\n\nexport const LocalizedField = ({\n type = \"text\",\n id,\n name,\n defaultLocaleOrCurrency,\n valuesByLocaleOrCurrency,\n placeholdersByLocaleOrCurrency,\n descriptionsByLocaleOrCurrency,\n warningsByLocaleOrCurrency,\n errorsByLocaleOrCurrency,\n label,\n hint,\n description,\n warning,\n warnings,\n renderWarning,\n error,\n errors,\n renderError,\n touched,\n isRequired,\n isDisabled,\n isReadOnly,\n onChange,\n onBlur,\n onFocus,\n defaultExpanded = false,\n displayAllLocalesOrCurrencies = false,\n size,\n autoFocus,\n [\"data-track-component\"]: dataTrackComponent,\n [\"data-testid\"]: dataTestId,\n [\"data-test\"]: dataTest,\n // DOM & Style props for wrapper container\n ...rest\n}: LocalizedFieldProps) => {\n const [expanded, setExpanded] = useState(\n displayAllLocalesOrCurrencies || defaultExpanded\n );\n\n const { formatMessage } = useIntl();\n\n // Used to associate more info dialog with fieldset via `aria-controls`\n const localeFieldsContainerId = useId();\n // Used to associate more info dialog with fieldset via `aria-details`\n const moreDetailsButtonId = useId();\n\n // Either `error` exists, or there are `true` fields in the UI Kit compat `errors` object\n const hasError: boolean = Boolean(\n error || (errors && Object.values(errors).some((error) => error === true))\n );\n\n // Either `warning` exists, or there are `true` fields in the UI Kit compat `warnings` object\n const hasWarning: boolean = Boolean(\n warning || (warnings && Object.values(warnings).some(Boolean))\n );\n\n // FieldGroup is invalid if a non-field-specific error is passed and the group has been touched\n // When FieldGroup is invalid, all fields will display error styling without displaying a field-specific error message\n const isInvalid: boolean = !!(hasError && touched);\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n id,\n label,\n description,\n errorMessage: error,\n isInvalid,\n });\n\n // Array of locales/currencies to display as input fields\n const localizationKeys: string[] | TCurrencyCode[] = Object.keys(\n valuesByLocaleOrCurrency\n );\n\n // Merge all -ByLocaleOrCurrencies data for each field\n const allDataForFields = useMemo(() => {\n const sortedFieldData =\n type === \"money\"\n ? sortCurrencies(\n defaultLocaleOrCurrency as TCurrencyCode,\n localizationKeys as TCurrencyCode[]\n )\n : sortLocalesByDefaultLocaleLanguage(\n defaultLocaleOrCurrency,\n localizationKeys\n );\n\n return sortedFieldData.reduce(\n (allFieldData: MergedLocaleFieldData[], localizationKey) => {\n const allDataForLocale = {\n localeOrCurrency: localizationKey,\n inputValue:\n type === \"money\"\n ? (valuesByLocaleOrCurrency as LocalizedCurrency)[localizationKey]\n : (valuesByLocaleOrCurrency[localizationKey] as string),\n placeholder: placeholdersByLocaleOrCurrency?.[localizationKey],\n description: descriptionsByLocaleOrCurrency?.[localizationKey],\n warning: warningsByLocaleOrCurrency?.[localizationKey],\n error: errorsByLocaleOrCurrency?.[localizationKey],\n // autoFocus default/first locale field\n ...(localizationKey === defaultLocaleOrCurrency && autoFocus\n ? { autoFocus }\n : {}),\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n };\n if (\n expanded ||\n // Only display defaultLocaleOrInput field if fieldGroup is not expanded\n (!expanded && localizationKey === defaultLocaleOrCurrency)\n ) {\n return [...allFieldData, allDataForLocale];\n }\n return allFieldData;\n },\n []\n );\n }, [\n valuesByLocaleOrCurrency,\n placeholdersByLocaleOrCurrency,\n descriptionsByLocaleOrCurrency,\n warningsByLocaleOrCurrency,\n errorsByLocaleOrCurrency,\n defaultLocaleOrCurrency,\n expanded,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n ]);\n\n const groupHasInvalidLocalizedFields = getHasInvalidLocalizedFields(\n errorsByLocaleOrCurrency,\n defaultLocaleOrCurrency\n );\n\n const shouldExpandInvalidFields =\n (groupHasInvalidLocalizedFields || hasError) && touched;\n // If there are fields that are invalid, ensure that field group\n // shows all fields so that invalid field is visible\n if (shouldExpandInvalidFields && !expanded) {\n setExpanded(true);\n }\n\n return (\n <LocalizedFieldRootSlot\n {...rest}\n {...fieldProps}\n aria-details={hint ? moreDetailsButtonId : undefined}\n type={type}\n size={size}\n name={name}\n >\n {label && (\n <Stack direction=\"row\" gap=\"0\">\n <LocalizedFieldLabelSlot {...labelProps}>\n {label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </LocalizedFieldLabelSlot>\n {hint && (\n <RaDialogTrigger>\n <IconButton\n id={moreDetailsButtonId}\n aria-label={formatMessage(messages.infoBoxTriggerAriaLabel)}\n size=\"2xs\"\n tone=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n\n <Popover padding={0}>\n <LocalizedFieldInfoDialogSlot asChild>\n <RaDialog>\n <Box p=\"300\">{hint}</Box>\n </RaDialog>\n </LocalizedFieldInfoDialogSlot>\n </Popover>\n </RaDialogTrigger>\n )}\n </Stack>\n )}\n <LocalizedFieldFieldsContainerSlot\n id={localeFieldsContainerId}\n data-expanded={expanded}\n >\n <RaCollection items={allDataForFields}>\n {(item) => {\n return (\n <LocalizedFieldLocaleField\n {...item}\n size={size}\n type={type}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n touched={touched}\n // Format field attributes to match uikit pattern\n id={getLocaleFieldAttribute(\n fieldProps.id,\n item.localeOrCurrency\n )}\n name={getLocaleFieldAttribute(name, item.localeOrCurrency)}\n data-test={getLocaleFieldAttribute(\n dataTest,\n item.localeOrCurrency\n )}\n data-testid={getLocaleFieldAttribute(\n dataTestId,\n item.localeOrCurrency\n )}\n data-track-component={getLocaleFieldAttribute(\n dataTrackComponent,\n item.localeOrCurrency\n )}\n />\n );\n }}\n </RaCollection>\n </LocalizedFieldFieldsContainerSlot>\n\n {!displayAllLocalesOrCurrencies && localizationKeys.length > 1 && (\n <LocalizedFieldToggleButtonContainerSlot>\n <Button\n aria-controls={localeFieldsContainerId}\n aria-describedby={labelProps.id}\n aria-expanded={expanded}\n onPress={() => setExpanded(!expanded)}\n isDisabled={isDisabled || (shouldExpandInvalidFields && expanded)}\n variant=\"ghost\"\n size=\"2xs\"\n colorPalette=\"primary\"\n >\n <Box\n as={type === \"money\" ? Payments : Language}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n />\n {type === \"money\"\n ? expanded\n ? formatMessage(messages.hideCurrencies)\n : formatMessage(messages.showCurrencies)\n : expanded\n ? formatMessage(messages.hideLanguages)\n : formatMessage(messages.showLanguages)}\n </Button>\n </LocalizedFieldToggleButtonContainerSlot>\n )}\n {(description || (hasWarning && touched)) && (\n <LocalizedFieldDescriptionSlot\n role={hasWarning && touched ? \"status\" : undefined}\n color={hasWarning && touched ? \"warning.11\" : undefined}\n // In order to associate the warnings from both the warning and legacy warnings props with the fieldset,\n // we must associate, them to this element with aria-labelledby\n aria-labelledby={`${descriptionProps.id}-warning`}\n {...descriptionProps}\n >\n {/** Warnings are for compat with UI Kit localized fields */}\n {hasWarning && touched ? (\n <>\n <Icon colorPalette=\"warning\">\n <WarningAmber />\n </Icon>\n <Stack gap=\"0\" id={`${descriptionProps.id}-warning`}>\n {warning}\n {warnings && hasWarning && (\n <FieldErrors\n errors={warnings}\n renderError={renderWarning}\n colorPalette=\"warning\"\n role={undefined}\n />\n )}\n </Stack>\n </>\n ) : (\n description\n )}\n </LocalizedFieldDescriptionSlot>\n )}\n {isInvalid && (\n <LocalizedFieldErrorSlot\n // In order to associate the errors from both the error and legacy errors props with the fieldset,\n // we must associate them to this element with aria-labelledby.\n aria-labelledby={`${errorMessageProps.id}-error`}\n role=\"alert\"\n {...errorMessageProps}\n >\n <Icon>\n <ErrorOutline />\n </Icon>\n <Stack gap=\"0\" id={`${errorMessageProps.id}-error`}>\n {error}\n {errors && hasError && (\n <FieldErrors\n errors={errors}\n renderError={renderError}\n role={undefined}\n />\n )}\n </Stack>\n </LocalizedFieldErrorSlot>\n )}\n </LocalizedFieldRootSlot>\n );\n};\n","import { LocalizedField as LocalizedFieldRoot } from \"./components/localized-field.root\";\nimport {\n getLocaleFieldAttribute,\n createLocalizedString,\n isEmpty,\n omitEmptyTranslations,\n isTouched,\n RequiredValueErrorMessage,\n toFieldErrors,\n convertToMoneyValues,\n parseMoneyValues,\n getHighPrecisionCurrencies,\n getEmptyCurrencies,\n} from \"./utils/localized-field.utils\";\n\nexport const LocalizedField = Object.assign(LocalizedFieldRoot, {\n // Add util methods here for compat with uikit - see https://github.com/commercetools/ui-kit/blob/e97e0c7e8f3e9393981bf1949573212d7c571c90/packages/components/inputs/localized-text-input/src/localized-text-input.tsx#L396\n getId: getLocaleFieldAttribute,\n getName: getLocaleFieldAttribute,\n isTouched,\n isEmpty,\n createLocalizedString,\n omitEmptyTranslations,\n RequiredValueErrorMessage,\n toFieldErrors,\n convertToMoneyValues,\n parseMoneyValues,\n getHighPrecisionCurrencies,\n getEmptyCurrencies,\n});\n"],"names":["messages","defineMessages","withProvider","withContext","createSlotRecipeContext","LocalizedFieldRootSlot","LocalizedFieldLabelSlot","LocalizedFieldInfoDialogSlot","LocalizedFieldFieldsContainerSlot","LocalizedFieldDescriptionSlot","LocalizedFieldErrorSlot","LocalizedFieldToggleButtonContainerSlot","LocalizedFieldLocaleFieldRootSlot","LocalizedFieldLocaleFieldLabelSlot","LocalizedFieldLocaleFieldInputSlot","RequiredValueErrorMessage","jsx","FormField","FormattedMessage","getLocaleFieldAttribute","fieldGroupAttr","locale","getLanguageForLocale","splitLanguages","defaultLocale","locales","defaultLanguage","related","sortLocalesByDefaultLocaleLanguage","allLocales","unrelated","sortCurrencies","defaultCurrency","allCurrencies","remainingCurrencies","currency","getHasInvalidLocalizedFields","errors","defaultLocaleOrCurrency","localeOrCurrency","createLocalizedString","existingLocalizedString","localizedString","isEmpty","value","omitEmptyTranslations","localizedStringWithoutEmptyTranslations","isTouched","touched","toFieldErrors","convertToMoneyValues","values","MoneyInput","parseMoneyValues","moneyValues","allValues","moneyValue","getHighPrecisionCurrencies","currencyCode","getEmptyCurrencies","LocalizedFieldLocaleField","type","size","id","name","inputValueFromProps","description","warning","error","onChange","onBlur","onFocus","isRequired","isReadOnly","isDisabled","isInvalid","otherProps","InputComponent","TextInput","MultilineTextInput","RichTextInput","inputValue","handleChange","useCallback","changeValue","jsxs","e","Fragment","Icon","WarningAmber","LocalizedField","valuesByLocaleOrCurrency","placeholdersByLocaleOrCurrency","descriptionsByLocaleOrCurrency","warningsByLocaleOrCurrency","errorsByLocaleOrCurrency","label","hint","warnings","renderWarning","renderError","defaultExpanded","displayAllLocalesOrCurrencies","autoFocus","dataTrackComponent","dataTestId","dataTest","rest","expanded","setExpanded","useState","formatMessage","useIntl","localeFieldsContainerId","useId","moreDetailsButtonId","hasError","hasWarning","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","localizationKeys","allDataForFields","useMemo","allFieldData","localizationKey","allDataForLocale","shouldExpandInvalidFields","Stack","RaDialogTrigger","IconButton","HelpOutline","Popover","RaDialog","Box","RaCollection","item","Button","Payments","Language","FieldErrors","ErrorOutline","LocalizedFieldRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAAAA,IAAe,gBAAAC,GAAe;AAAA,EAC5B,sBAAsB;AAAA,IACpB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,yBAAyB;AAAA,IACvB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB,gBAAgB;AAAA,IACd,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB,gBAAgB;AAAA,IACd,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAEpB,CAAC,GCvBK,EAAE,cAAAC,IAAc,aAAAC,EAAA,IAAgB,gBAAAC,GAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAGYC,KAAyB,gBAAAH,GAGpC,YAAY,MAAM,GAGPI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ACC,gBAAAU;AAAA,UAAC3E;AAAA,UAAA;AAAA,YAGC,mBAAiB,GAAG+G,EAAkB,EAAE;AAAA,YACxC,MAAK;AAAA,YACJ,GAAGA;AAAA,YAEJ,UAAA;AAAA,cAAA,gBAAAzG,EAACwE,GAAA,EACC,UAAA,gBAAAxE,EAAC+H,IAAA,CAAA,CAAa,GAChB;AAAA,cACA,gBAAA1D,EAAC6C,KAAM,KAAI,KAAI,IAAI,GAAGT,EAAkB,EAAE,UACvC,UAAA;AAAA,gBAAArD;AAAA,gBACA/B,KAAU+E,KACT,gBAAApG;AAAA,kBAAC8H;AAAA,kBAAA;AAAA,oBACC,QAAAzG;AAAA,oBACA,aAAA+D;AAAA,oBACA,MAAM;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACR,EAAA,CAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAIR,GCxVaV,KAAiB,uBAAO,OAAOsD,IAAoB;AAAA;AAAA,EAE9D,OAAO7H;AAAA,EACP,SAASA;AAAA,EACT,WAAA4B;AAAA,EACA,SAAAJ;AAAA,EACA,uBAAAH;AAAA,EACA,uBAAAK;AAAA,EACA,2BAAA9B;AAAA,EACA,eAAAkC;AAAA,EACA,sBAAAC;AAAA,EACA,kBAAAG;AAAA,EACA,4BAAAI;AAAA,EACA,oBAAAE;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"localized-field-Bp4N2Mvl.es.js","sources":["../../src/components/localized-field/localized-field.i18n.ts","../../src/components/localized-field/localized-field.slots.tsx","../../src/components/localized-field/utils/localized-field.utils.tsx","../../src/components/localized-field/components/localized-field.locale-field.tsx","../../src/components/localized-field/components/localized-field.root.tsx","../../src/components/localized-field/localized-field.tsx"],"sourcesContent":["import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n missingRequiredField: {\n id: \"Nimbus.LocalizedField.missingRequiredField\",\n description: \"Error message for missing required value\",\n defaultMessage: \"This field is required. Provide at least one value.\",\n },\n infoBoxTriggerAriaLabel: {\n id: \"Nimbus.LocalizedField.infoBoxTriggerAriaLabel\",\n description: \"aria label for button that triggers more info dialog\",\n defaultMessage: \"more info\",\n },\n showLanguages: {\n id: \"Nimbus.LocalizedField.showLanguages\",\n description:\n \"Label for showing all language inputs when toggle button is pressed\",\n defaultMessage: \"Show all languages\",\n },\n hideLanguages: {\n id: \"Nimbus.LocalizedField.hideLanguages\",\n description:\n \"Label for hiding all language inputs when toggle button is pressed\",\n defaultMessage: \"Hide all languages\",\n },\n showCurrencies: {\n id: \"Nimbus.LocalizedField.showCurrencies\",\n description:\n \"Label for showing all currency inputs when toggle button is pressed\",\n defaultMessage: \"Show all currencies\",\n },\n hideCurrencies: {\n id: \"Nimbus.LocalizedField.hideCurrencies\",\n description:\n \"Label for hiding all currency inputs when toggle button is pressed\",\n defaultMessage: \"Hide all currencies\",\n },\n});\n","import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n LocalizedFieldRootSlotProps,\n LocalizedFieldLabelSlotProps,\n LocalizedFieldInfoDialogSlotProps,\n LocalizedFieldFieldsContainerSlotProps,\n LocalizedFieldDescriptionSlotProps,\n LocalizedFieldErrorSlotProps,\n LocalizedFieldToggleButtonContainerSlotProps,\n LocalizedFieldLocaleFieldRootSlotProps,\n LocalizedFieldLocaleFieldLabelSlotProps,\n LocalizedFieldLocaleFieldInputSlotProps,\n} from \"./localized-field.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"localizedField\",\n});\n\n// Root Slot\nexport const LocalizedFieldRootSlot = withProvider<\n HTMLFieldSetElement,\n LocalizedFieldRootSlotProps\n>(\"fieldset\", \"root\");\n\n// Label Slot\nexport const LocalizedFieldLabelSlot = withContext<\n HTMLLabelElement,\n LocalizedFieldLabelSlotProps\n>(\"legend\", \"label\");\n\n// InfoDialog Slot\nexport const LocalizedFieldInfoDialogSlot = withContext<\n HTMLDivElement,\n LocalizedFieldInfoDialogSlotProps\n>(\"div\", \"infoDialog\");\n\n// FieldsContainer Slot\nexport const LocalizedFieldFieldsContainerSlot = withContext<\n HTMLDivElement,\n LocalizedFieldFieldsContainerSlotProps\n>(\"div\", \"fieldsContainer\");\n\n// Description Slot\nexport const LocalizedFieldDescriptionSlot = withContext<\n HTMLDivElement,\n LocalizedFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport const LocalizedFieldErrorSlot = withContext<\n HTMLDivElement,\n LocalizedFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// ToggleButtonContainer Slot\nexport const LocalizedFieldToggleButtonContainerSlot = withContext<\n HTMLDivElement,\n LocalizedFieldToggleButtonContainerSlotProps\n>(\"div\", \"toggleButtonContainer\");\n\n// LocaleFieldRoot Slot\nexport const LocalizedFieldLocaleFieldRootSlot = withContext<\n HTMLDivElement,\n LocalizedFieldLocaleFieldRootSlotProps\n>(\"div\", \"localeFieldRoot\");\n\n// FieldLabel Slot\nexport const LocalizedFieldLocaleFieldLabelSlot = withContext<\n HTMLDivElement,\n LocalizedFieldLocaleFieldLabelSlotProps\n>(\"div\", \"localeFieldLabel\");\n\n// FieldInput Slot\nexport const LocalizedFieldLocaleFieldInputSlot = withContext<\n HTMLDivElement,\n LocalizedFieldLocaleFieldInputSlotProps\n>(\"div\", \"localeFieldInput\");\n","import { FormattedMessage } from \"react-intl\";\nimport {\n FormField,\n type TCurrencyCode,\n type TValue,\n type TMoneyValue,\n type TFieldErrors,\n MoneyInput,\n} from \"@/components\";\nimport messages from \"../localized-field.i18n\";\nimport type { LocalizedString } from \"../localized-field.types\";\n\ntype LanguagesSplitByDefaultLocale = {\n related: string[];\n unrelated: string[];\n};\n\ntype TouchedLocalizedString = { [locale: string]: boolean };\n\ntype CustomFormikErrors<Values> = {\n [K in keyof Values]?: TFieldErrors;\n};\n\nexport const RequiredValueErrorMessage = () => (\n <FormField.Error>\n <FormattedMessage {...messages.missingRequiredField} />\n </FormField.Error>\n);\n\nexport const getLocaleFieldAttribute = (\n fieldGroupAttr?: string,\n locale?: string\n): string | undefined =>\n fieldGroupAttr && locale ? `${fieldGroupAttr}.${locale}` : undefined;\n\n// gets the language tag of a given locale, e.g. `de` in `de-DE`\nexport const getLanguageForLocale = (locale: string): string =>\n locale.split(\"-\")[0];\n\n// splits the locales into two groups:\n// - the 'related' array contains locales with the same language tag as the default locale,\n// e.g. if the default locale is de-DE, related would be ['de-DE', 'de-CH']\n// - the 'unrelated' array contains locales with a different different language tag from the default locale\n//. e.g. if the default locale is de-DE, unrelated would be ['pt-BR', 'en-GB', 'zh-Hans']\nexport const splitLanguages = (\n defaultLocale: string,\n locales: string[]\n): LanguagesSplitByDefaultLocale => {\n const defaultLanguage = getLanguageForLocale(defaultLocale);\n const related = locales.filter(\n (locale) => getLanguageForLocale(locale) === defaultLanguage\n );\n const unrelated = locales.filter(\n (locale) => getLanguageForLocale(locale) !== defaultLanguage\n );\n return {\n unrelated,\n related,\n };\n};\n\n// sorts locales with the following priority:\n// - The selected locale is placed first (e.g pt-BR)\n// - All locales using the same language tag as the selected language\n// follow (e.g. pt, pt-PT). They are sorted alphabetically.\n// - All other locales follow, sorted alphabetically as well\nexport const sortLocalesByDefaultLocaleLanguage = (\n defaultLocale: string,\n allLocales: string[]\n): string[] => {\n const { related, unrelated } = splitLanguages(\n defaultLocale,\n allLocales.filter((locale: string) => locale !== defaultLocale)\n );\n\n return [defaultLocale, ...related.sort(), ...unrelated.sort()];\n};\n\nexport const sortCurrencies = (\n defaultCurrency: TCurrencyCode,\n allCurrencies: TCurrencyCode[]\n) => {\n const remainingCurrencies = allCurrencies.filter(\n (currency) => currency !== defaultCurrency\n );\n return [defaultCurrency, ...remainingCurrencies.sort()];\n};\n\nexport const getHasInvalidLocalizedFields = <TErrors extends object>(\n errors?: TErrors,\n defaultLocaleOrCurrency?: string\n): boolean => {\n if (errors && Object.keys(errors).length > 0 && defaultLocaleOrCurrency) {\n return Object.keys(errors).some(\n (localeOrCurrency) => localeOrCurrency !== defaultLocaleOrCurrency\n );\n }\n return false;\n};\n\nexport const createLocalizedString = (\n locales: string[],\n existingLocalizedString: LocalizedString\n): LocalizedString => {\n const localesInLocalizedString = Array.from(\n new Set([...locales, ...Object.keys(existingLocalizedString)])\n );\n\n return localesInLocalizedString.reduce<LocalizedString>(\n (localizedString, locale) => ({\n ...localizedString,\n [locale]: existingLocalizedString?.[locale] || \"\",\n }),\n {}\n );\n};\n\n// Note: I prefer `isLocalizedStringEmpty`, but keeping this as `isEmpty` for api consistency with UI Kit\nexport const isEmpty = (localizedString?: LocalizedString): boolean => {\n if (!localizedString) return true;\n return Object.values(localizedString).every(\n (value?: string) => !value || value?.trim().length === 0\n );\n};\n\nexport const omitEmptyTranslations = <Translations extends LocalizedString>(\n localizedString: Translations\n): LocalizedString => {\n // TODO: is it necessary to create a util that enforces a consistent warning/error format, e.g.\n // `<COMPONENT_NAME> - Warning: <WARNING_MESSAGE>`\n if (typeof localizedString !== \"object\") {\n console.warn(\n \"Nimbus Localized Field - Warning: omitEmptyTranslations must be called with an object\"\n );\n }\n\n return Object.entries(localizedString).reduce<LocalizedString>(\n (localizedStringWithoutEmptyTranslations, [locale, value]) => {\n if (value && value.trim().length > 0) {\n return {\n ...localizedStringWithoutEmptyTranslations,\n [locale]: value,\n };\n }\n return localizedStringWithoutEmptyTranslations;\n },\n {}\n );\n};\n\nexport const isTouched = (touched?: TouchedLocalizedString): boolean => {\n if (touched) {\n return Object.values(touched).some(Boolean);\n }\n return false;\n};\n\n/**\n * Use this function to convert the Formik `errors` object type to\n * our custom field errors type.\n * This is primarly useful when using TypeScript.\n */\nexport function toFieldErrors<FormValues>(\n errors: unknown\n): CustomFormikErrors<FormValues> {\n return errors as CustomFormikErrors<FormValues>;\n}\n\nexport const convertToMoneyValues = (\n values: TValue[],\n currency: string\n): Array<TMoneyValue | null> =>\n Object.values(values).map<TMoneyValue | null>((value) => {\n return MoneyInput.convertToMoneyValue(value, currency);\n });\n\nexport const parseMoneyValues = (\n moneyValues: TMoneyValue[] = [],\n locale: string\n): Record<TCurrencyCode, TValue> =>\n moneyValues.reduce<Record<TCurrencyCode, TValue>>(\n (allValues, moneyValue) => {\n const value = MoneyInput.parseMoneyValue(moneyValue, locale);\n return {\n ...allValues,\n [value.currencyCode]: value,\n };\n },\n {} as Record<TCurrencyCode, TValue>\n );\n\nexport const getHighPrecisionCurrencies = (\n values: Record<TCurrencyCode, TValue>,\n locale: string\n): TCurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as TCurrencyCode[];\n return typedCurrencyCodes.filter((currencyCode) =>\n MoneyInput.isHighPrecision(values[currencyCode], locale)\n );\n};\n\nexport const getEmptyCurrencies = (\n values: Record<TCurrencyCode, TValue>\n): TCurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as TCurrencyCode[];\n return typedCurrencyCodes.filter((currencyCode) =>\n MoneyInput.isEmpty(values[currencyCode])\n );\n};\n","import { useCallback } from \"react\";\nimport {\n FormField,\n Icon,\n TextInput,\n MoneyInput,\n type TCustomEvent,\n MultilineTextInput,\n RichTextInput,\n type TValue,\n type TCurrencyCode,\n} from \"@/components\";\nimport { WarningAmber } from \"@commercetools/nimbus-icons\";\nimport {\n LocalizedFieldLocaleFieldRootSlot,\n LocalizedFieldLocaleFieldInputSlot,\n LocalizedFieldLocaleFieldLabelSlot,\n} from \"../localized-field.slots\";\nimport type { LocalizedFieldLocaleFieldProps } from \"../localized-field.types\";\n\nexport const LocalizedFieldLocaleField = ({\n type,\n size,\n localeOrCurrency,\n id,\n name,\n inputValue: inputValueFromProps,\n description,\n warning,\n error,\n onChange,\n onBlur,\n onFocus,\n isRequired,\n isReadOnly,\n isDisabled,\n isInvalid,\n touched,\n ...otherProps\n}: LocalizedFieldLocaleFieldProps) => {\n let InputComponent:\n | typeof TextInput\n | typeof MultilineTextInput\n | typeof MoneyInput\n | typeof RichTextInput;\n switch (type) {\n case \"text\":\n default:\n InputComponent = TextInput;\n break;\n case \"multiLine\":\n InputComponent = MultilineTextInput;\n break;\n case \"money\":\n InputComponent = MoneyInput;\n break;\n case \"richText\":\n InputComponent = RichTextInput;\n break;\n }\n\n const getInputValue = () => {\n if (type === \"money\") {\n return inputValueFromProps\n ? (inputValueFromProps as TValue)\n : ({ amount: \"\", currencyCode: localeOrCurrency } as TValue);\n }\n return inputValueFromProps ? inputValueFromProps : \"\";\n };\n\n const inputValue = getInputValue();\n\n const handleChange = useCallback(\n (value: string | TCustomEvent | undefined) => {\n // The `MoneyInput` onChange event value is a custom value,\n // and the `MoneyInput` modifies the input id and name since it is in a `group`,\n // so we need to build a separate return object for the MoneInput to return\n // the expected values\n const isMoneyInputEvent = typeof value === \"object\";\n const changeValue = {\n target: isMoneyInputEvent\n ? {\n id: value.target.id,\n name: value.target.name,\n locale: undefined,\n currency: localeOrCurrency as TCurrencyCode,\n value: value.target.value,\n }\n : { id, name, locale: localeOrCurrency, currency: undefined, value },\n };\n onChange(changeValue);\n },\n [id, name, localeOrCurrency, onChange]\n );\n\n return (\n <LocalizedFieldLocaleFieldRootSlot asChild>\n <FormField.Root\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInvalid={(isInvalid || !!error) && touched}\n direction=\"row\"\n size={size}\n id={id}\n >\n <LocalizedFieldLocaleFieldLabelSlot\n display={type === \"money\" ? \"none\" : undefined}\n {...(isDisabled && { \"data-disabled\": isDisabled })}\n asChild\n >\n <FormField.Label>\n {localeOrCurrency.toLocaleUpperCase()}\n </FormField.Label>\n </LocalizedFieldLocaleFieldLabelSlot>\n <FormField.Input>\n <LocalizedFieldLocaleFieldInputSlot\n aria-required={isRequired}\n asChild\n >\n <InputComponent\n {...otherProps}\n size={size}\n value={inputValue as string & TValue}\n onChange={handleChange}\n onBlur={(e: React.FocusEvent | TCustomEvent) =>\n onBlur?.(e, localeOrCurrency)\n }\n onFocus={(e: React.FocusEvent | TCustomEvent) =>\n onFocus?.(e, localeOrCurrency)\n }\n isRequired={isRequired}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInvalid={(isInvalid || !!error) && touched}\n />\n </LocalizedFieldLocaleFieldInputSlot>\n </FormField.Input>\n {(description || (warning && touched)) && (\n <FormField.Description\n role={warning && touched ? \"status\" : undefined}\n color={warning && touched ? \"warning.11\" : undefined}\n display=\"flex\"\n gap=\"100\"\n alignItems=\"center\"\n >\n {warning && touched ? (\n <>\n <Icon colorPalette=\"warning\">\n <WarningAmber />\n </Icon>\n {warning}\n </>\n ) : (\n description\n )}\n </FormField.Description>\n )}\n {error && touched && <FormField.Error>{error}</FormField.Error>}\n </FormField.Root>\n </LocalizedFieldLocaleFieldRootSlot>\n );\n};\n","import { useState, useMemo } from \"react\";\nimport { useIntl } from \"react-intl\";\nimport {\n Collection as RaCollection,\n Dialog as RaDialog,\n DialogTrigger as RaDialogTrigger,\n} from \"react-aria-components\";\nimport { useField, useId } from \"react-aria\";\nimport {\n ErrorOutline,\n HelpOutline,\n Language,\n Payments,\n WarningAmber,\n} from \"@commercetools/nimbus-icons\";\nimport {\n Box,\n Button,\n FieldErrors,\n Icon,\n IconButton,\n Stack,\n type TCurrencyCode,\n} from \"@/components\";\nimport { Popover } from \"../../popover\";\nimport messages from \"../localized-field.i18n\";\nimport {\n LocalizedFieldRootSlot,\n LocalizedFieldLabelSlot,\n LocalizedFieldInfoDialogSlot,\n LocalizedFieldFieldsContainerSlot,\n LocalizedFieldDescriptionSlot,\n LocalizedFieldErrorSlot,\n LocalizedFieldToggleButtonContainerSlot,\n} from \"../localized-field.slots\";\nimport type {\n LocalizedFieldProps,\n MergedLocaleFieldData,\n LocalizedCurrency,\n} from \"../localized-field.types\";\n\nimport {\n getHasInvalidLocalizedFields,\n getLocaleFieldAttribute,\n sortCurrencies,\n sortLocalesByDefaultLocaleLanguage,\n} from \"../utils/localized-field.utils\";\nimport { LocalizedFieldLocaleField } from \"./localized-field.locale-field\";\n\nexport const LocalizedField = ({\n type = \"text\",\n id,\n name,\n defaultLocaleOrCurrency,\n valuesByLocaleOrCurrency,\n placeholdersByLocaleOrCurrency,\n descriptionsByLocaleOrCurrency,\n warningsByLocaleOrCurrency,\n errorsByLocaleOrCurrency,\n label,\n hint,\n description,\n warning,\n warnings,\n renderWarning,\n error,\n errors,\n renderError,\n touched,\n isRequired,\n isDisabled,\n isReadOnly,\n onChange,\n onBlur,\n onFocus,\n defaultExpanded = false,\n displayAllLocalesOrCurrencies = false,\n size,\n autoFocus,\n [\"data-track-component\"]: dataTrackComponent,\n [\"data-testid\"]: dataTestId,\n [\"data-test\"]: dataTest,\n // DOM & Style props for wrapper container\n ...rest\n}: LocalizedFieldProps) => {\n const [expanded, setExpanded] = useState(\n displayAllLocalesOrCurrencies || defaultExpanded\n );\n\n const { formatMessage } = useIntl();\n\n // Used to associate more info dialog with fieldset via `aria-controls`\n const localeFieldsContainerId = useId();\n // Used to associate more info dialog with fieldset via `aria-details`\n const moreDetailsButtonId = useId();\n\n // Either `error` exists, or there are `true` fields in the UI Kit compat `errors` object\n const hasError: boolean = Boolean(\n error || (errors && Object.values(errors).some((error) => error === true))\n );\n\n // Either `warning` exists, or there are `true` fields in the UI Kit compat `warnings` object\n const hasWarning: boolean = Boolean(\n warning || (warnings && Object.values(warnings).some(Boolean))\n );\n\n // FieldGroup is invalid if a non-field-specific error is passed and the group has been touched\n // When FieldGroup is invalid, all fields will display error styling without displaying a field-specific error message\n const isInvalid: boolean = !!(hasError && touched);\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n id,\n label,\n description,\n errorMessage: error,\n isInvalid,\n });\n\n // Array of locales/currencies to display as input fields\n const localizationKeys: string[] | TCurrencyCode[] = Object.keys(\n valuesByLocaleOrCurrency\n );\n\n // Merge all -ByLocaleOrCurrencies data for each field\n const allDataForFields = useMemo(() => {\n const sortedFieldData =\n type === \"money\"\n ? sortCurrencies(\n defaultLocaleOrCurrency as TCurrencyCode,\n localizationKeys as TCurrencyCode[]\n )\n : sortLocalesByDefaultLocaleLanguage(\n defaultLocaleOrCurrency,\n localizationKeys\n );\n\n return sortedFieldData.reduce(\n (allFieldData: MergedLocaleFieldData[], localizationKey) => {\n const allDataForLocale = {\n localeOrCurrency: localizationKey,\n inputValue:\n type === \"money\"\n ? (valuesByLocaleOrCurrency as LocalizedCurrency)[localizationKey]\n : (valuesByLocaleOrCurrency[localizationKey] as string),\n placeholder: placeholdersByLocaleOrCurrency?.[localizationKey],\n description: descriptionsByLocaleOrCurrency?.[localizationKey],\n warning: warningsByLocaleOrCurrency?.[localizationKey],\n error: errorsByLocaleOrCurrency?.[localizationKey],\n // autoFocus default/first locale field\n ...(localizationKey === defaultLocaleOrCurrency && autoFocus\n ? { autoFocus }\n : {}),\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n };\n if (\n expanded ||\n // Only display defaultLocaleOrInput field if fieldGroup is not expanded\n (!expanded && localizationKey === defaultLocaleOrCurrency)\n ) {\n return [...allFieldData, allDataForLocale];\n }\n return allFieldData;\n },\n []\n );\n }, [\n valuesByLocaleOrCurrency,\n placeholdersByLocaleOrCurrency,\n descriptionsByLocaleOrCurrency,\n warningsByLocaleOrCurrency,\n errorsByLocaleOrCurrency,\n defaultLocaleOrCurrency,\n expanded,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n ]);\n\n const groupHasInvalidLocalizedFields = getHasInvalidLocalizedFields(\n errorsByLocaleOrCurrency,\n defaultLocaleOrCurrency\n );\n\n const shouldExpandInvalidFields =\n (groupHasInvalidLocalizedFields || hasError) && touched;\n // If there are fields that are invalid, ensure that field group\n // shows all fields so that invalid field is visible\n if (shouldExpandInvalidFields && !expanded) {\n setExpanded(true);\n }\n\n return (\n <LocalizedFieldRootSlot\n {...rest}\n {...fieldProps}\n aria-details={hint ? moreDetailsButtonId : undefined}\n type={type}\n size={size}\n name={name}\n >\n {label && (\n <Stack direction=\"row\" gap=\"0\">\n <LocalizedFieldLabelSlot {...labelProps}>\n {label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </LocalizedFieldLabelSlot>\n {hint && (\n <RaDialogTrigger>\n <IconButton\n id={moreDetailsButtonId}\n aria-label={formatMessage(messages.infoBoxTriggerAriaLabel)}\n size=\"2xs\"\n tone=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n\n <Popover padding={0}>\n <LocalizedFieldInfoDialogSlot asChild>\n <RaDialog>\n <Box p=\"300\">{hint}</Box>\n </RaDialog>\n </LocalizedFieldInfoDialogSlot>\n </Popover>\n </RaDialogTrigger>\n )}\n </Stack>\n )}\n <LocalizedFieldFieldsContainerSlot\n id={localeFieldsContainerId}\n data-expanded={expanded}\n >\n <RaCollection items={allDataForFields}>\n {(item) => {\n return (\n <LocalizedFieldLocaleField\n {...item}\n size={size}\n type={type}\n onChange={onChange}\n onBlur={onBlur}\n onFocus={onFocus}\n touched={touched}\n // Format field attributes to match uikit pattern\n id={getLocaleFieldAttribute(\n fieldProps.id,\n item.localeOrCurrency\n )}\n name={getLocaleFieldAttribute(name, item.localeOrCurrency)}\n data-test={getLocaleFieldAttribute(\n dataTest,\n item.localeOrCurrency\n )}\n data-testid={getLocaleFieldAttribute(\n dataTestId,\n item.localeOrCurrency\n )}\n data-track-component={getLocaleFieldAttribute(\n dataTrackComponent,\n item.localeOrCurrency\n )}\n />\n );\n }}\n </RaCollection>\n </LocalizedFieldFieldsContainerSlot>\n\n {!displayAllLocalesOrCurrencies && localizationKeys.length > 1 && (\n <LocalizedFieldToggleButtonContainerSlot>\n <Button\n aria-controls={localeFieldsContainerId}\n aria-describedby={labelProps.id}\n aria-expanded={expanded}\n onPress={() => setExpanded(!expanded)}\n isDisabled={isDisabled || (shouldExpandInvalidFields && expanded)}\n variant=\"ghost\"\n size=\"2xs\"\n colorPalette=\"primary\"\n >\n <Box\n as={type === \"money\" ? Payments : Language}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n />\n {type === \"money\"\n ? expanded\n ? formatMessage(messages.hideCurrencies)\n : formatMessage(messages.showCurrencies)\n : expanded\n ? formatMessage(messages.hideLanguages)\n : formatMessage(messages.showLanguages)}\n </Button>\n </LocalizedFieldToggleButtonContainerSlot>\n )}\n {(description || (hasWarning && touched)) && (\n <LocalizedFieldDescriptionSlot\n role={hasWarning && touched ? \"status\" : undefined}\n color={hasWarning && touched ? \"warning.11\" : undefined}\n // In order to associate the warnings from both the warning and legacy warnings props with the fieldset,\n // we must associate, them to this element with aria-labelledby\n aria-labelledby={`${descriptionProps.id}-warning`}\n {...descriptionProps}\n >\n {/** Warnings are for compat with UI Kit localized fields */}\n {hasWarning && touched ? (\n <>\n <Icon colorPalette=\"warning\">\n <WarningAmber />\n </Icon>\n <Stack gap=\"0\" id={`${descriptionProps.id}-warning`}>\n {warning}\n {warnings && hasWarning && (\n <FieldErrors\n errors={warnings}\n renderError={renderWarning}\n colorPalette=\"warning\"\n role={undefined}\n />\n )}\n </Stack>\n </>\n ) : (\n description\n )}\n </LocalizedFieldDescriptionSlot>\n )}\n {isInvalid && (\n <LocalizedFieldErrorSlot\n // In order to associate the errors from both the error and legacy errors props with the fieldset,\n // we must associate them to this element with aria-labelledby.\n aria-labelledby={`${errorMessageProps.id}-error`}\n role=\"alert\"\n {...errorMessageProps}\n >\n <Icon>\n <ErrorOutline />\n </Icon>\n <Stack gap=\"0\" id={`${errorMessageProps.id}-error`}>\n {error}\n {errors && hasError && (\n <FieldErrors\n errors={errors}\n renderError={renderError}\n role={undefined}\n />\n )}\n </Stack>\n </LocalizedFieldErrorSlot>\n )}\n </LocalizedFieldRootSlot>\n );\n};\n","import { LocalizedField as LocalizedFieldRoot } from \"./components/localized-field.root\";\nimport {\n getLocaleFieldAttribute,\n createLocalizedString,\n isEmpty,\n omitEmptyTranslations,\n isTouched,\n RequiredValueErrorMessage,\n toFieldErrors,\n convertToMoneyValues,\n parseMoneyValues,\n getHighPrecisionCurrencies,\n getEmptyCurrencies,\n} from \"./utils/localized-field.utils\";\n\nexport const LocalizedField = Object.assign(LocalizedFieldRoot, {\n // Add util methods here for compat with uikit - see https://github.com/commercetools/ui-kit/blob/e97e0c7e8f3e9393981bf1949573212d7c571c90/packages/components/inputs/localized-text-input/src/localized-text-input.tsx#L396\n getId: getLocaleFieldAttribute,\n getName: getLocaleFieldAttribute,\n isTouched,\n isEmpty,\n createLocalizedString,\n omitEmptyTranslations,\n RequiredValueErrorMessage,\n toFieldErrors,\n convertToMoneyValues,\n parseMoneyValues,\n getHighPrecisionCurrencies,\n getEmptyCurrencies,\n});\n"],"names":["messages","defineMessages","withProvider","withContext","createSlotRecipeContext","LocalizedFieldRootSlot","LocalizedFieldLabelSlot","LocalizedFieldInfoDialogSlot","LocalizedFieldFieldsContainerSlot","LocalizedFieldDescriptionSlot","LocalizedFieldErrorSlot","LocalizedFieldToggleButtonContainerSlot","LocalizedFieldLocaleFieldRootSlot","LocalizedFieldLocaleFieldLabelSlot","LocalizedFieldLocaleFieldInputSlot","RequiredValueErrorMessage","jsx","FormField","FormattedMessage","getLocaleFieldAttribute","fieldGroupAttr","locale","getLanguageForLocale","splitLanguages","defaultLocale","locales","defaultLanguage","related","sortLocalesByDefaultLocaleLanguage","allLocales","unrelated","sortCurrencies","defaultCurrency","allCurrencies","remainingCurrencies","currency","getHasInvalidLocalizedFields","errors","defaultLocaleOrCurrency","localeOrCurrency","createLocalizedString","existingLocalizedString","localizedString","isEmpty","value","omitEmptyTranslations","localizedStringWithoutEmptyTranslations","isTouched","touched","toFieldErrors","convertToMoneyValues","values","MoneyInput","parseMoneyValues","moneyValues","allValues","moneyValue","getHighPrecisionCurrencies","currencyCode","getEmptyCurrencies","LocalizedFieldLocaleField","type","size","id","name","inputValueFromProps","description","warning","error","onChange","onBlur","onFocus","isRequired","isReadOnly","isDisabled","isInvalid","otherProps","InputComponent","TextInput","MultilineTextInput","RichTextInput","inputValue","handleChange","useCallback","changeValue","jsxs","e","Fragment","Icon","WarningAmber","LocalizedField","valuesByLocaleOrCurrency","placeholdersByLocaleOrCurrency","descriptionsByLocaleOrCurrency","warningsByLocaleOrCurrency","errorsByLocaleOrCurrency","label","hint","warnings","renderWarning","renderError","defaultExpanded","displayAllLocalesOrCurrencies","autoFocus","dataTrackComponent","dataTestId","dataTest","rest","expanded","setExpanded","useState","formatMessage","useIntl","localeFieldsContainerId","useId","moreDetailsButtonId","hasError","hasWarning","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","localizationKeys","allDataForFields","useMemo","allFieldData","localizationKey","allDataForLocale","shouldExpandInvalidFields","Stack","RaDialogTrigger","IconButton","HelpOutline","Popover","RaDialog","Box","RaCollection","item","Button","Payments","Language","FieldErrors","ErrorOutline","LocalizedFieldRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAAAA,IAAe,gBAAAC,GAAe;AAAA,EAC5B,sBAAsB;AAAA,IACpB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,yBAAyB;AAAA,IACvB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB,gBAAgB;AAAA,IACd,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAAA,EAElB,gBAAgB;AAAA,IACd,IAAI;AAAA,IACJ,aACE;AAAA,IACF,gBAAgB;AAAA,EAAA;AAEpB,CAAC,GCvBK,EAAE,cAAAC,IAAc,aAAAC,EAAA,IAAgB,gBAAAC,GAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAGYC,KAAyB,gBAAAH,GAGpC,YAAY,MAAM,GAGPI,KAA0B,gBAAAH,EAGrC,UAAU,OAAO,GAGNI,KAA+B,gBAAAJ,EAG1C,OAAO,YAAY,GAGRK,KAAoC,gBAAAL,EAG/C,OAAO,iBAAiB,GAGbM,KAAgC,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