@commercetools/nimbus 0.0.0-canary-20251121163008 → 0.0.0-canary-20251126142302
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/{CollectionBuilder-ZlIN4SR4.es.js → CollectionBuilder-BnYe2z4W.es.js} +1 -19
- package/dist/chunks/{CollectionBuilder-ZlIN4SR4.es.js.map → CollectionBuilder-BnYe2z4W.es.js.map} +1 -1
- package/dist/chunks/{CollectionBuilder-BipvtvSl.cjs.js → CollectionBuilder-DjRx57vm.cjs.js} +2 -18
- package/dist/chunks/{CollectionBuilder-BipvtvSl.cjs.js.map → CollectionBuilder-DjRx57vm.cjs.js.map} +1 -1
- package/dist/chunks/{DatePicker-DeknOPX6.es.js → DatePicker-9m2POezC.es.js} +2 -2
- package/dist/chunks/{DatePicker-DeknOPX6.es.js.map → DatePicker-9m2POezC.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-DGLrUdLu.cjs.js → DatePicker-BGFu7oAQ.cjs.js} +2 -2
- package/dist/chunks/{DatePicker-DGLrUdLu.cjs.js.map → DatePicker-BGFu7oAQ.cjs.js.map} +1 -1
- package/dist/chunks/{Dialog-DUbUCf4o.es.js → Dialog-DcnmO0xr.es.js} +5 -5
- package/dist/chunks/{Dialog-DUbUCf4o.es.js.map → Dialog-DcnmO0xr.es.js.map} +1 -1
- package/dist/chunks/{Dialog-Ye_7tQZU.cjs.js → Dialog-flHBRP1h.cjs.js} +2 -2
- package/dist/chunks/{Dialog-Ye_7tQZU.cjs.js.map → Dialog-flHBRP1h.cjs.js.map} +1 -1
- package/dist/chunks/{Header-Bvo6aMcQ.es.js → Header-CliQVNVa.es.js} +3 -3
- package/dist/chunks/{Header-Bvo6aMcQ.es.js.map → Header-CliQVNVa.es.js.map} +1 -1
- package/dist/chunks/{Header-Bvl-gjeR.cjs.js → Header-CyskU0rw.cjs.js} +2 -2
- package/dist/chunks/{Header-Bvl-gjeR.cjs.js.map → Header-CyskU0rw.cjs.js.map} +1 -1
- package/dist/chunks/{ListBox-Dcnj8pHo.cjs.js → ListBox-BjV-0DWh.cjs.js} +2 -2
- package/dist/chunks/{ListBox-Dcnj8pHo.cjs.js.map → ListBox-BjV-0DWh.cjs.js.map} +1 -1
- package/dist/chunks/{ListBox-C8TVMFFY.es.js → ListBox-CcSs4yTw.es.js} +6 -6
- package/dist/chunks/{ListBox-C8TVMFFY.es.js.map → ListBox-CcSs4yTw.es.js.map} +1 -1
- package/dist/chunks/{Modal-CMJEwrBs.es.js → Modal-3QPNDzpi.es.js} +3 -3
- package/dist/chunks/{Modal-CMJEwrBs.es.js.map → Modal-3QPNDzpi.es.js.map} +1 -1
- package/dist/chunks/{Modal-DjOIA2BE.cjs.js → Modal-mFYEMNT-.cjs.js} +2 -2
- package/dist/chunks/{Modal-DjOIA2BE.cjs.js.map → Modal-mFYEMNT-.cjs.js.map} +1 -1
- package/dist/chunks/{SelectionManager-bgcDT3lR.es.js → SelectionManager-B0Cb1kHW.es.js} +2 -2
- package/dist/chunks/{SelectionManager-bgcDT3lR.es.js.map → SelectionManager-B0Cb1kHW.es.js.map} +1 -1
- package/dist/chunks/{SelectionManager-CCETIs4l.cjs.js → SelectionManager-D9tuw16C.cjs.js} +2 -2
- package/dist/chunks/{SelectionManager-CCETIs4l.cjs.js.map → SelectionManager-D9tuw16C.cjs.js.map} +1 -1
- package/dist/chunks/{Separator-DyU2njbj.cjs.js → Separator-BvA4UGuq.cjs.js} +2 -2
- package/dist/chunks/{Separator-DyU2njbj.cjs.js.map → Separator-BvA4UGuq.cjs.js.map} +1 -1
- package/dist/chunks/{Separator-BmVimNX_.es.js → Separator-DP89PKAS.es.js} +2 -2
- package/dist/chunks/{Separator-BmVimNX_.es.js.map → Separator-DP89PKAS.es.js.map} +1 -1
- package/dist/chunks/{combobox-BAOSfyZz.cjs.js → combobox-CPndQJhl.cjs.js} +2 -2
- package/dist/chunks/{combobox-BAOSfyZz.cjs.js.map → combobox-CPndQJhl.cjs.js.map} +1 -1
- package/dist/chunks/{combobox-D-sXUVsS.es.js → combobox-DVGJtTY-.es.js} +9 -9
- package/dist/chunks/{combobox-D-sXUVsS.es.js.map → combobox-DVGJtTY-.es.js.map} +1 -1
- package/dist/chunks/{data-table-q_xAC6Y4.cjs.js → data-table-DhijpIzD.cjs.js} +2 -2
- package/dist/chunks/{data-table-q_xAC6Y4.cjs.js.map → data-table-DhijpIzD.cjs.js.map} +1 -1
- package/dist/chunks/{data-table-VGdNqVuy.es.js → data-table-mOrhnFve.es.js} +11 -11
- package/dist/chunks/{data-table-VGdNqVuy.es.js.map → data-table-mOrhnFve.es.js.map} +1 -1
- package/dist/chunks/{date-picker-Bx4kkIdC.cjs.js → date-picker-B4MhmcwJ.cjs.js} +2 -2
- package/dist/chunks/{date-picker-Bx4kkIdC.cjs.js.map → date-picker-B4MhmcwJ.cjs.js.map} +1 -1
- package/dist/chunks/{date-picker-CRo_w6Jz.es.js → date-picker-DoN3I22T.es.js} +3 -3
- package/dist/chunks/{date-picker-CRo_w6Jz.es.js.map → date-picker-DoN3I22T.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-BcY8cXPH.cjs.js → date-range-picker-Bsu09Yvu.cjs.js} +2 -2
- package/dist/chunks/{date-range-picker-BcY8cXPH.cjs.js.map → date-range-picker-Bsu09Yvu.cjs.js.map} +1 -1
- package/dist/chunks/{date-range-picker-CrFq736s.es.js → date-range-picker-CY4y1m0B.es.js} +3 -3
- package/dist/chunks/{date-range-picker-CrFq736s.es.js.map → date-range-picker-CY4y1m0B.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-field-BDCEC-kA.cjs.js → date-range-picker-field-CgO9OoyB.cjs.js} +2 -2
- package/dist/chunks/{date-range-picker-field-BDCEC-kA.cjs.js.map → date-range-picker-field-CgO9OoyB.cjs.js.map} +1 -1
- package/dist/chunks/{date-range-picker-field-L56QHJs-.es.js → date-range-picker-field-_f1tY_ZQ.es.js} +3 -3
- package/dist/chunks/{date-range-picker-field-L56QHJs-.es.js.map → date-range-picker-field-_f1tY_ZQ.es.js.map} +1 -1
- package/dist/chunks/{dialog-BHTOGgtN.cjs.js → dialog-BiE3sKA_.cjs.js} +2 -2
- package/dist/chunks/{dialog-BHTOGgtN.cjs.js.map → dialog-BiE3sKA_.cjs.js.map} +1 -1
- package/dist/chunks/{dialog-DGko_UBT.es.js → dialog-g2eRAaPW.es.js} +3 -3
- package/dist/chunks/{dialog-DGko_UBT.es.js.map → dialog-g2eRAaPW.es.js.map} +1 -1
- package/dist/chunks/{draggable-list-Dk7BxgW-.es.js → draggable-list-CQ7h_F__.es.js} +9 -9
- package/dist/chunks/{draggable-list-Dk7BxgW-.es.js.map → draggable-list-CQ7h_F__.es.js.map} +1 -1
- package/dist/chunks/{draggable-list-BPM-ioyq.cjs.js → draggable-list-DArcamJL.cjs.js} +2 -2
- package/dist/chunks/{draggable-list-BPM-ioyq.cjs.js.map → draggable-list-DArcamJL.cjs.js.map} +1 -1
- package/dist/chunks/{drawer-DbQScPqa.cjs.js → drawer-80jf-a5D.cjs.js} +2 -2
- package/dist/chunks/{drawer-DbQScPqa.cjs.js.map → drawer-80jf-a5D.cjs.js.map} +1 -1
- package/dist/chunks/{drawer-BUiIQ9L5.es.js → drawer-CdfOinPU.es.js} +3 -3
- package/dist/chunks/{drawer-BUiIQ9L5.es.js.map → drawer-CdfOinPU.es.js.map} +1 -1
- package/dist/chunks/{form-field-CJHX6A4q.cjs.js → form-field-Ca3k84cH.cjs.js} +2 -2
- package/dist/chunks/{form-field-CJHX6A4q.cjs.js.map → form-field-Ca3k84cH.cjs.js.map} +1 -1
- package/dist/chunks/{form-field-CGjPf6rA.es.js → form-field-CzFcczIs.es.js} +2 -2
- package/dist/chunks/{form-field-CGjPf6rA.es.js.map → form-field-CzFcczIs.es.js.map} +1 -1
- package/dist/chunks/{localized-field-Cb0fyOZF.cjs.js → localized-field-BJXrxOc7.cjs.js} +2 -2
- package/dist/chunks/{localized-field-Cb0fyOZF.cjs.js.map → localized-field-BJXrxOc7.cjs.js.map} +1 -1
- package/dist/chunks/{localized-field-DFQ6Knzt.es.js → localized-field-Bq8xTkHi.es.js} +7 -7
- package/dist/chunks/{localized-field-DFQ6Knzt.es.js.map → localized-field-Bq8xTkHi.es.js.map} +1 -1
- package/dist/chunks/{menu-Ctsou8BQ.cjs.js → menu-8MZlyluP.cjs.js} +2 -2
- package/dist/chunks/{menu-Ctsou8BQ.cjs.js.map → menu-8MZlyluP.cjs.js.map} +1 -1
- package/dist/chunks/{menu-hZacrl0C.es.js → menu-xeJ9lZMo.es.js} +4 -4
- package/dist/chunks/{menu-hZacrl0C.es.js.map → menu-xeJ9lZMo.es.js.map} +1 -1
- package/dist/chunks/{money-input-BmRHEzuc.es.js → money-input-CdcKcoW7.es.js} +2 -2
- package/dist/chunks/{money-input-BmRHEzuc.es.js.map → money-input-CdcKcoW7.es.js.map} +1 -1
- package/dist/chunks/{money-input-Dg8WwuK4.cjs.js → money-input-DKK4IkDa.cjs.js} +2 -2
- package/dist/chunks/{money-input-Dg8WwuK4.cjs.js.map → money-input-DKK4IkDa.cjs.js.map} +1 -1
- package/dist/chunks/{money-input-field-Cj9jvBsE.cjs.js → money-input-field-dVccFP1i.cjs.js} +2 -2
- package/dist/chunks/{money-input-field-Cj9jvBsE.cjs.js.map → money-input-field-dVccFP1i.cjs.js.map} +1 -1
- package/dist/chunks/{money-input-field-Dec63VQv.es.js → money-input-field-vVLyfqtt.es.js} +3 -3
- package/dist/chunks/{money-input-field-Dec63VQv.es.js.map → money-input-field-vVLyfqtt.es.js.map} +1 -1
- package/dist/chunks/{number-input-field-D7aLGfzZ.es.js → number-input-field-BDAnY1HI.es.js} +2 -2
- package/dist/chunks/{number-input-field-D7aLGfzZ.es.js.map → number-input-field-BDAnY1HI.es.js.map} +1 -1
- package/dist/chunks/{number-input-field-BgCaRtnS.cjs.js → number-input-field-_SV3uOSQ.cjs.js} +2 -2
- package/dist/chunks/{number-input-field-BgCaRtnS.cjs.js.map → number-input-field-_SV3uOSQ.cjs.js.map} +1 -1
- package/dist/chunks/{pagination-DPEQK0Xq.es.js → pagination-Bw4PfQiy.es.js} +2 -2
- package/dist/chunks/{pagination-DPEQK0Xq.es.js.map → pagination-Bw4PfQiy.es.js.map} +1 -1
- package/dist/chunks/{pagination-CQ0roDut.cjs.js → pagination-DpIJKRGy.cjs.js} +2 -2
- package/dist/chunks/{pagination-CQ0roDut.cjs.js.map → pagination-DpIJKRGy.cjs.js.map} +1 -1
- package/dist/chunks/{popover-DY7ASSCU.cjs.js → popover-DHeke7qU.cjs.js} +2 -2
- package/dist/chunks/{popover-DY7ASSCU.cjs.js.map → popover-DHeke7qU.cjs.js.map} +1 -1
- package/dist/chunks/{popover-BAIwOPdC.es.js → popover-zNeVW5hN.es.js} +2 -2
- package/dist/chunks/{popover-BAIwOPdC.es.js.map → popover-zNeVW5hN.es.js.map} +1 -1
- package/dist/chunks/{rich-text-input-DAc5Qrg9.es.js → rich-text-input-D9-NrOjQ.es.js} +3 -10
- package/dist/chunks/{rich-text-input-DAc5Qrg9.es.js.map → rich-text-input-D9-NrOjQ.es.js.map} +1 -1
- package/dist/chunks/{rich-text-input-uQdozf3f.cjs.js → rich-text-input-v6nJvAeT.cjs.js} +2 -8
- package/dist/chunks/{rich-text-input-uQdozf3f.cjs.js.map → rich-text-input-v6nJvAeT.cjs.js.map} +1 -1
- package/dist/chunks/{scoped-search-input-D5GJjsyF.es.js → scoped-search-input-CJTn4Zz-.es.js} +2 -2
- package/dist/chunks/{scoped-search-input-D5GJjsyF.es.js.map → scoped-search-input-CJTn4Zz-.es.js.map} +1 -1
- package/dist/chunks/{scoped-search-input-Bjm-BowW.cjs.js → scoped-search-input-DR1UVqfn.cjs.js} +2 -2
- package/dist/chunks/{scoped-search-input-Bjm-BowW.cjs.js.map → scoped-search-input-DR1UVqfn.cjs.js.map} +1 -1
- package/dist/chunks/search-input-field-BOtCJu5U.cjs.js +2 -0
- package/dist/chunks/search-input-field-BOtCJu5U.cjs.js.map +1 -0
- package/dist/chunks/search-input-field-DjFWQe7R.es.js +51 -0
- package/dist/chunks/search-input-field-DjFWQe7R.es.js.map +1 -0
- package/dist/chunks/{select-CQwpSckj.es.js → select-DCLqY_H8.es.js} +7 -7
- package/dist/chunks/{select-CQwpSckj.es.js.map → select-DCLqY_H8.es.js.map} +1 -1
- package/dist/chunks/{select-muD4KBy_.cjs.js → select-noWcLHsw.cjs.js} +2 -2
- package/dist/chunks/{select-muD4KBy_.cjs.js.map → select-noWcLHsw.cjs.js.map} +1 -1
- package/dist/chunks/{separator-1ZNnZk9T.cjs.js → separator-DryRIJEa.cjs.js} +2 -2
- package/dist/chunks/{separator-1ZNnZk9T.cjs.js.map → separator-DryRIJEa.cjs.js.map} +1 -1
- package/dist/chunks/{separator-CxPOiV-V.es.js → separator-PVuFkBJX.es.js} +2 -2
- package/dist/chunks/{separator-CxPOiV-V.es.js.map → separator-PVuFkBJX.es.js.map} +1 -1
- package/dist/chunks/{split-button-jWOgks2W.cjs.js → split-button-C0ErPS5z.cjs.js} +2 -2
- package/dist/chunks/{split-button-jWOgks2W.cjs.js.map → split-button-C0ErPS5z.cjs.js.map} +1 -1
- package/dist/chunks/{split-button-Dtp64tp3.es.js → split-button-Rxsqp2QA.es.js} +2 -2
- package/dist/chunks/{split-button-Dtp64tp3.es.js.map → split-button-Rxsqp2QA.es.js.map} +1 -1
- package/dist/chunks/{tabs-DfNhZz7h.es.js → tabs-Dt3Dhaiq.es.js} +5 -5
- package/dist/chunks/{tabs-DfNhZz7h.es.js.map → tabs-Dt3Dhaiq.es.js.map} +1 -1
- package/dist/chunks/{tabs-CHNOmHyg.cjs.js → tabs-e-3yG4hI.cjs.js} +2 -2
- package/dist/chunks/{tabs-CHNOmHyg.cjs.js.map → tabs-e-3yG4hI.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-CaQdCaEc.es.js → tag-group-CklEK4eJ.es.js} +7 -7
- package/dist/chunks/{tag-group-CaQdCaEc.es.js.map → tag-group-CklEK4eJ.es.js.map} +1 -1
- package/dist/chunks/{tag-group-D5Mhaf6-.cjs.js → tag-group-D0NF_ay2.cjs.js} +2 -2
- package/dist/chunks/{tag-group-D5Mhaf6-.cjs.js.map → tag-group-D0NF_ay2.cjs.js.map} +1 -1
- package/dist/chunks/{text-input-field-DbicgCUY.cjs.js → text-input-field-D0MJSUw8.cjs.js} +2 -2
- package/dist/chunks/{text-input-field-DbicgCUY.cjs.js.map → text-input-field-D0MJSUw8.cjs.js.map} +1 -1
- package/dist/chunks/{text-input-field-CNXk82pQ.es.js → text-input-field-DeQ-WI6P.es.js} +2 -2
- package/dist/chunks/{text-input-field-CNXk82pQ.es.js.map → text-input-field-DeQ-WI6P.es.js.map} +1 -1
- package/dist/chunks/{useGridListItem-DAGp36bD.es.js → useGridListItem-CjGTTOtc.es.js} +3 -3
- package/dist/chunks/{useGridListItem-DAGp36bD.es.js.map → useGridListItem-CjGTTOtc.es.js.map} +1 -1
- package/dist/chunks/{useGridListItem-BETI-KGO.cjs.js → useGridListItem-Ck5JPksV.cjs.js} +2 -2
- package/dist/chunks/{useGridListItem-BETI-KGO.cjs.js.map → useGridListItem-Ck5JPksV.cjs.js.map} +1 -1
- package/dist/chunks/{useListState-QQtJHpsQ.cjs.js → useListState-BSrUXH20.cjs.js} +2 -2
- package/dist/chunks/{useListState-QQtJHpsQ.cjs.js.map → useListState-BSrUXH20.cjs.js.map} +1 -1
- package/dist/chunks/{useListState-BHLGQlP3.es.js → useListState-CRfmjiWx.es.js} +2 -2
- package/dist/chunks/{useListState-BHLGQlP3.es.js.map → useListState-CRfmjiWx.es.js.map} +1 -1
- package/dist/chunks/{useSingleSelectListState-B29G7the.es.js → useSingleSelectListState-DFR33TSw.es.js} +2 -2
- package/dist/chunks/{useSingleSelectListState-B29G7the.es.js.map → useSingleSelectListState-DFR33TSw.es.js.map} +1 -1
- package/dist/chunks/{useSingleSelectListState-CsD7W9nK.cjs.js → useSingleSelectListState-DnlbcBEG.cjs.js} +2 -2
- package/dist/chunks/{useSingleSelectListState-CsD7W9nK.cjs.js.map → useSingleSelectListState-DnlbcBEG.cjs.js.map} +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.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-picker.cjs +1 -1
- package/dist/components/date-picker.es.js +1 -1
- package/dist/components/date-range-picker-field.cjs +1 -1
- package/dist/components/date-range-picker-field.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/fields.cjs +1 -1
- package/dist/components/fields.es.js +7 -5
- package/dist/components/fields.es.js.map +1 -1
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.es.js +1 -1
- package/dist/components/localized-field.cjs +1 -1
- package/dist/components/localized-field.es.js +1 -1
- package/dist/components/money-input-field.cjs +1 -1
- package/dist/components/money-input-field.es.js +1 -1
- package/dist/components/money-input.cjs +1 -1
- package/dist/components/money-input.es.js +1 -1
- package/dist/components/number-input-field.cjs +1 -1
- package/dist/components/number-input-field.es.js +1 -1
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.es.js +1 -1
- package/dist/components/patterns.cjs +1 -1
- package/dist/components/patterns.es.js +7 -5
- package/dist/components/patterns.es.js.map +1 -1
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.es.js +1 -1
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/rich-text-input.es.js +1 -1
- package/dist/components/scoped-search-input.cjs +1 -1
- package/dist/components/scoped-search-input.es.js +1 -1
- package/dist/components/search-input-field.cjs +2 -0
- package/dist/components/search-input-field.cjs.map +1 -0
- package/dist/components/search-input-field.es.js +5 -0
- package/dist/components/search-input-field.es.js.map +1 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.es.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.es.js +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/split-button.es.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.es.js +1 -1
- package/dist/components/tag-group.cjs +1 -1
- package/dist/components/tag-group.es.js +1 -1
- package/dist/components/text-input-field.cjs +1 -1
- package/dist/components/text-input-field.es.js +1 -1
- package/dist/components/utils.cjs +1 -1
- package/dist/components/utils.cjs.map +1 -1
- package/dist/components/utils.es.js +0 -1
- package/dist/components/utils.es.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +231 -229
- package/dist/index.es.js.map +1 -1
- package/dist/patterns/fields/index.d.ts +1 -0
- package/dist/patterns/fields/search-input-field/index.d.ts +2 -0
- package/dist/patterns/fields/search-input-field/search-input-field.d.ts +30 -0
- package/dist/patterns/fields/search-input-field/search-input-field.types.d.ts +50 -0
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-CGjPf6rA.es.js","sources":["../../src/components/form-field/components/form-field.context.tsx","../../src/components/form-field/form-field.slots.tsx","../../src/components/form-field/components/form-field.root.tsx","../../src/components/form-field/components/form-field.label.tsx","../../src/components/form-field/components/form-field.input.tsx","../../src/components/form-field/components/form-field.description.tsx","../../src/components/form-field/components/form-field.error.tsx","../../src/components/form-field/components/form-field.info-box.tsx","../../src/components/form-field/form-field.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport type {\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldInputSlotProps,\n FormFieldLabelSlotProps,\n} from \"../form-field.types\";\n\nexport type FormFieldContextPayloadType = {\n label: ReactNode;\n labelSlotProps?: FormFieldLabelSlotProps;\n input: ReactNode;\n inputSlotProps?: FormFieldInputSlotProps;\n description: ReactNode;\n descriptionSlotProps?: FormFieldDescriptionSlotProps;\n error: ReactNode;\n errorSlotProps?: FormFieldErrorSlotProps;\n info: ReactNode;\n isInvalid?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n};\n\nexport type FormFieldContextType = {\n context: FormFieldContextPayloadType;\n setContext: React.Dispatch<React.SetStateAction<FormFieldContextPayloadType>>;\n};\n\nexport const FormFieldContext = createContext<FormFieldContextType>({\n context: {\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n },\n setContext: () => {},\n});\n","import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n FormFieldRootSlotProps,\n FormFieldLabelSlotProps,\n FormFieldInputSlotProps,\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldPopoverSlotProps,\n} from \"./form-field.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"formField\",\n});\n\n// Root slot\nexport const FormFieldRootSlot = withProvider<\n HTMLDivElement,\n FormFieldRootSlotProps\n>(\"div\", \"root\");\n\n// Label Slot\nexport const FormFieldLabelSlot = withContext<\n HTMLDivElement,\n FormFieldLabelSlotProps\n>(\"div\", \"label\");\n\n// Input Slot\nexport const FormFieldInputSlot = withContext<\n HTMLDivElement,\n FormFieldInputSlotProps\n>(\"div\", \"input\");\n\n// Description Slot\nexport const FormFieldDescriptionSlot = withContext<\n HTMLDivElement,\n FormFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport const FormFieldErrorSlot = withContext<\n HTMLDivElement,\n FormFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// Error Slot\nexport const FormFieldPopoverSlot = withContext<\n HTMLDivElement,\n FormFieldPopoverSlotProps\n>(\"div\", \"popover\");\n","import {\n Children,\n cloneElement,\n isValidElement,\n useEffect,\n useMemo,\n useState,\n useRef,\n} from \"react\";\nimport type { FormFieldProps } from \"../form-field.types\";\nimport { useField, useObjectRef } from \"react-aria\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport {\n FormFieldContext,\n type FormFieldContextPayloadType,\n} from \"./form-field.context\";\nimport {\n FormFieldDescriptionSlot,\n FormFieldErrorSlot,\n FormFieldInputSlot,\n FormFieldLabelSlot,\n FormFieldPopoverSlot,\n FormFieldRootSlot,\n} from \"../form-field.slots\";\nimport { Dialog, DialogTrigger, Popover } from \"react-aria-components\";\nimport { Box, IconButton } from \"@/components\";\nimport { ErrorOutline, HelpOutline } from \"@commercetools/nimbus-icons\";\n\n/**\n * # FormField.Root\n *\n * displays miscellaneous inputs in a FormField context\n *\n * @supportsStyleProps\n */\nexport const FormFieldRoot = function FormFieldRoot({\n ref: forwardedRef,\n id,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n children,\n ...props\n}: FormFieldProps) {\n const localRef = useRef<HTMLDivElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n const [context, setContext] = useState<FormFieldContextPayloadType>({\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n });\n\n const useFieldArgs: Parameters<typeof useField>[0] = useMemo(() => {\n const args: Parameters<typeof useField>[0] = {\n id,\n description: context.description,\n errorMessage: context.error,\n };\n\n if (context.label) {\n args.label = context.label;\n } else {\n // Context will always start out null, so we need to stub out some aria attributes\n // FIXME: This is a hack to get the form field to work, but it's not the best solution\n // FIXME: We should find a better way to handle this by redesigning the FormField component's structure\n args[\"aria-label\"] = \"empty-label\";\n args[\"aria-labelledby\"] = \"empty-label\";\n }\n\n return args;\n }, [id, context.description, context.error, context.label]);\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField(useFieldArgs);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }));\n }, [isInvalid, isRequired, isDisabled, isReadOnly]);\n\n const inputProps = useMemo(\n () => ({\n ...fieldProps,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }),\n [fieldProps, isInvalid, isRequired, isDisabled, isReadOnly]\n );\n\n const contextValue = useMemo(() => ({ context, setContext }), [context]);\n\n return (\n <FormFieldContext.Provider value={contextValue}>\n <FormFieldRootSlot ref={ref} {...props}>\n {context.label && (\n <FormFieldLabelSlot {...context.labelSlotProps}>\n <label {...labelProps}>\n {context.label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </label>\n {context.info && (\n <DialogTrigger>\n <Box\n as=\"span\"\n display=\"inline-block\"\n position=\"relative\"\n width=\"1ch\"\n height=\"1ch\"\n ml=\"200\"\n >\n <Box\n as=\"span\"\n display=\"inline-flex\"\n position=\"absolute\"\n top=\"50%\"\n right=\"50%\"\n transform=\"translate(50%, -50%)\"\n >\n <IconButton\n aria-label=\"__MORE INFO\"\n size=\"2xs\"\n colorPalette=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n </Box>\n </Box>\n <Popover>\n <FormFieldPopoverSlot asChild>\n <Dialog>\n <Box p=\"300\">{context.info}</Box>\n </Dialog>\n </FormFieldPopoverSlot>\n </Popover>\n </DialogTrigger>\n )}\n </FormFieldLabelSlot>\n )}\n {context.input && (\n <FormFieldInputSlot {...context.inputSlotProps}>\n {Children.map(context.input, (child) => {\n // Important: Check if the child is a valid React element before cloning.\n if (isValidElement(child)) {\n return cloneElement(child, inputProps);\n }\n // If it's not a valid element (e.g., text node, null, undefined), return it as is.\n return child;\n })}\n </FormFieldInputSlot>\n )}\n {context.description && (\n <FormFieldDescriptionSlot\n {...descriptionProps}\n {...context.descriptionSlotProps}\n >\n {context.description}\n </FormFieldDescriptionSlot>\n )}\n {isInvalid && context.error && (\n <FormFieldErrorSlot\n {...errorMessageProps}\n {...context.errorSlotProps}\n >\n <Box\n as={ErrorOutline}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n alignSelf=\"center\"\n />\n {context.error}\n </FormFieldErrorSlot>\n )}\n {children}\n </FormFieldRootSlot>\n </FormFieldContext.Provider>\n );\n};\n\nFormFieldRoot.displayName = \"FormField.Root\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldLabelSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Label - The label element for the form field\n *\n * @supportsStyleProps\n */\n// TODO: should this be wrapped in react-aria's `LabelContext` provider?, e.g. https://react-spectrum.adobe.com/react-aria/TextField.html#custom-children\nexport const FormFieldLabel = ({\n children,\n ...labelSlotProps\n}: FormFieldLabelSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n label: children,\n labelSlotProps,\n }));\n\n // Cleanup: clear label when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n label: null,\n labelSlotProps: undefined,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldLabel.displayName = \"FormField.Label\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldInputSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Input - The input wrapper element for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldInput = ({\n children,\n ...inputSlotProps\n}: FormFieldInputSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n input: children,\n inputSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldInput.displayName = \"FormField.Input\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldDescriptionSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Description - The description element for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldDescription = ({\n children,\n ...descriptionSlotProps\n}: FormFieldDescriptionSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n description: children,\n descriptionSlotProps,\n }));\n\n // Cleanup: clear description when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n description: null,\n descriptionSlotProps: undefined,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldDescription.displayName = \"FormField.Description\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldErrorSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Error - The error message element for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldError = ({\n children,\n ...errorSlotProps\n}: FormFieldErrorSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n error: children,\n errorSlotProps,\n }));\n\n // Cleanup: clear error when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n error: null,\n errorSlotProps: undefined,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldError.displayName = \"FormField.Error\";\n","import { useContext, useEffect, type ReactNode } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\n\ntype FormFieldInfoBoxProps = {\n /**\n * The content to display in the InfoBox\n */\n children: ReactNode;\n};\n\n/**\n * FormField.InfoBox - The info box popover content for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldInfoBox = ({ children }: FormFieldInfoBoxProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n info: children,\n }));\n\n // Cleanup: clear info when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n info: null,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldInfoBox.displayName = \"FormField.InfoBox\";\n","import {\n FormFieldRoot,\n FormFieldLabel,\n FormFieldInput,\n FormFieldDescription,\n FormFieldError,\n FormFieldInfoBox,\n} from \"./components\";\n\nexport const FormField = {\n /**\n * # FormField.Root\n *\n * The root container for the form field that provides context and state management\n * for all child components. Handles React Aria integration for accessibility,\n * manages field state (required, invalid, disabled, readonly), and coordinates\n * rendering of label, input, description, and error elements.\n *\n * @example\n * ```tsx\n * <FormField.Root isRequired isInvalid>\n * <FormField.Label>Username</FormField.Label>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * <FormField.Description>Enter your username</FormField.Description>\n * <FormField.Error>Username is required</FormField.Error>\n * </FormField.Root>\n * ```\n */\n Root: FormFieldRoot,\n\n /**\n * # FormField.Label\n *\n * The label element for the form field. Automatically associates with the input\n * via React Aria and displays a required indicator when the field is required.\n * Supports an optional info box trigger for additional field information.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>Email Address</FormField.Label>\n * <FormField.InfoBox>\n * Your email will be used for account notifications\n * </FormField.InfoBox>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * </FormField.Root>\n * ```\n */\n Label: FormFieldLabel,\n\n /**\n * # FormField.Input\n *\n * The input wrapper element that receives and displays the actual input component.\n * Automatically clones children and passes accessibility props, validation state,\n * and field attributes from React Aria.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>Password</FormField.Label>\n * <FormField.Input>\n * <PasswordInput />\n * </FormField.Input>\n * </FormField.Root>\n * ```\n */\n Input: FormFieldInput,\n\n /**\n * # FormField.Description\n *\n * The description element that provides helpful information about the field.\n * Automatically associates with the input via `aria-describedby` for screen readers.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>Username</FormField.Label>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * <FormField.Description>\n * Must be 3-20 characters, letters and numbers only\n * </FormField.Description>\n * </FormField.Root>\n * ```\n */\n Description: FormFieldDescription,\n\n /**\n * # FormField.Error\n *\n * The error message element that displays validation errors. Only visible when\n * the field is invalid. Automatically associates with the input via\n * `aria-errormessage` and includes an error icon.\n *\n * @example\n * ```tsx\n * <FormField.Root isInvalid>\n * <FormField.Label>Email</FormField.Label>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * <FormField.Error>Please enter a valid email address</FormField.Error>\n * </FormField.Root>\n * ```\n */\n Error: FormFieldError,\n\n /**\n * # FormField.InfoBox\n *\n * The info box content that appears in a popover when the help icon next to\n * the label is clicked. Use for additional context or instructions that don't\n * need to be visible by default.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>API Key</FormField.Label>\n * <FormField.InfoBox>\n * Your API key can be found in your account settings.\n * Keep it secure and never share it publicly.\n * </FormField.InfoBox>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * </FormField.Root>\n * ```\n */\n InfoBox: FormFieldInfoBox,\n};\n\nexport {\n FormFieldRoot as _FormFieldRoot,\n FormFieldLabel as _FormFieldLabel,\n FormFieldInput as _FormFieldInput,\n FormFieldDescription as _FormFieldDescription,\n FormFieldError as _FormFieldError,\n FormFieldInfoBox as _FormFieldInfoBox,\n};\n"],"names":["FormFieldContext","createContext","withProvider","withContext","createSlotRecipeContext","FormFieldRootSlot","FormFieldLabelSlot","FormFieldInputSlot","FormFieldDescriptionSlot","FormFieldErrorSlot","FormFieldPopoverSlot","FormFieldRoot","forwardedRef","id","isInvalid","isRequired","isDisabled","isReadOnly","children","props","localRef","useRef","ref","useObjectRef","mergeRefs","context","setContext","useState","useFieldArgs","useMemo","args","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","useEffect","prevContext","inputProps","contextValue","jsx","jsxs","DialogTrigger","Box","IconButton","HelpOutline","Popover","Dialog","Children","child","isValidElement","cloneElement","ErrorOutline","FormFieldLabel","labelSlotProps","useContext","FormFieldInput","inputSlotProps","FormFieldDescription","descriptionSlotProps","FormFieldError","errorSlotProps","FormFieldInfoBox","FormField"],"mappings":";;;;;;;;;AA6BO,MAAMA,IAAmB,gBAAAC,EAAoC;AAAA,EAClE,SAAS;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBN,OAAO0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBP,OAAOG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBP,aAAaE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBb,OAAOE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBP,SAASE;AACX;"}
|
|
1
|
+
{"version":3,"file":"form-field-CzFcczIs.es.js","sources":["../../src/components/form-field/components/form-field.context.tsx","../../src/components/form-field/form-field.slots.tsx","../../src/components/form-field/components/form-field.root.tsx","../../src/components/form-field/components/form-field.label.tsx","../../src/components/form-field/components/form-field.input.tsx","../../src/components/form-field/components/form-field.description.tsx","../../src/components/form-field/components/form-field.error.tsx","../../src/components/form-field/components/form-field.info-box.tsx","../../src/components/form-field/form-field.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport type {\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldInputSlotProps,\n FormFieldLabelSlotProps,\n} from \"../form-field.types\";\n\nexport type FormFieldContextPayloadType = {\n label: ReactNode;\n labelSlotProps?: FormFieldLabelSlotProps;\n input: ReactNode;\n inputSlotProps?: FormFieldInputSlotProps;\n description: ReactNode;\n descriptionSlotProps?: FormFieldDescriptionSlotProps;\n error: ReactNode;\n errorSlotProps?: FormFieldErrorSlotProps;\n info: ReactNode;\n isInvalid?: boolean;\n isRequired?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n};\n\nexport type FormFieldContextType = {\n context: FormFieldContextPayloadType;\n setContext: React.Dispatch<React.SetStateAction<FormFieldContextPayloadType>>;\n};\n\nexport const FormFieldContext = createContext<FormFieldContextType>({\n context: {\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n },\n setContext: () => {},\n});\n","import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n FormFieldRootSlotProps,\n FormFieldLabelSlotProps,\n FormFieldInputSlotProps,\n FormFieldDescriptionSlotProps,\n FormFieldErrorSlotProps,\n FormFieldPopoverSlotProps,\n} from \"./form-field.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"formField\",\n});\n\n// Root slot\nexport const FormFieldRootSlot = withProvider<\n HTMLDivElement,\n FormFieldRootSlotProps\n>(\"div\", \"root\");\n\n// Label Slot\nexport const FormFieldLabelSlot = withContext<\n HTMLDivElement,\n FormFieldLabelSlotProps\n>(\"div\", \"label\");\n\n// Input Slot\nexport const FormFieldInputSlot = withContext<\n HTMLDivElement,\n FormFieldInputSlotProps\n>(\"div\", \"input\");\n\n// Description Slot\nexport const FormFieldDescriptionSlot = withContext<\n HTMLDivElement,\n FormFieldDescriptionSlotProps\n>(\"div\", \"description\");\n\n// Error Slot\nexport const FormFieldErrorSlot = withContext<\n HTMLDivElement,\n FormFieldErrorSlotProps\n>(\"div\", \"error\");\n\n// Error Slot\nexport const FormFieldPopoverSlot = withContext<\n HTMLDivElement,\n FormFieldPopoverSlotProps\n>(\"div\", \"popover\");\n","import {\n Children,\n cloneElement,\n isValidElement,\n useEffect,\n useMemo,\n useState,\n useRef,\n} from \"react\";\nimport type { FormFieldProps } from \"../form-field.types\";\nimport { useField, useObjectRef } from \"react-aria\";\nimport { mergeRefs } from \"@chakra-ui/react\";\nimport {\n FormFieldContext,\n type FormFieldContextPayloadType,\n} from \"./form-field.context\";\nimport {\n FormFieldDescriptionSlot,\n FormFieldErrorSlot,\n FormFieldInputSlot,\n FormFieldLabelSlot,\n FormFieldPopoverSlot,\n FormFieldRootSlot,\n} from \"../form-field.slots\";\nimport { Dialog, DialogTrigger, Popover } from \"react-aria-components\";\nimport { Box, IconButton } from \"@/components\";\nimport { ErrorOutline, HelpOutline } from \"@commercetools/nimbus-icons\";\n\n/**\n * # FormField.Root\n *\n * displays miscellaneous inputs in a FormField context\n *\n * @supportsStyleProps\n */\nexport const FormFieldRoot = function FormFieldRoot({\n ref: forwardedRef,\n id,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n children,\n ...props\n}: FormFieldProps) {\n const localRef = useRef<HTMLDivElement>(null);\n const ref = useObjectRef(mergeRefs(localRef, forwardedRef));\n const [context, setContext] = useState<FormFieldContextPayloadType>({\n label: null,\n description: null,\n error: null,\n info: null,\n input: null,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n });\n\n const useFieldArgs: Parameters<typeof useField>[0] = useMemo(() => {\n const args: Parameters<typeof useField>[0] = {\n id,\n description: context.description,\n errorMessage: context.error,\n };\n\n if (context.label) {\n args.label = context.label;\n } else {\n // Context will always start out null, so we need to stub out some aria attributes\n // FIXME: This is a hack to get the form field to work, but it's not the best solution\n // FIXME: We should find a better way to handle this by redesigning the FormField component's structure\n args[\"aria-label\"] = \"empty-label\";\n args[\"aria-labelledby\"] = \"empty-label\";\n }\n\n return args;\n }, [id, context.description, context.error, context.label]);\n\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField(useFieldArgs);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }));\n }, [isInvalid, isRequired, isDisabled, isReadOnly]);\n\n const inputProps = useMemo(\n () => ({\n ...fieldProps,\n isInvalid,\n isRequired,\n isDisabled,\n isReadOnly,\n }),\n [fieldProps, isInvalid, isRequired, isDisabled, isReadOnly]\n );\n\n const contextValue = useMemo(() => ({ context, setContext }), [context]);\n\n return (\n <FormFieldContext.Provider value={contextValue}>\n <FormFieldRootSlot ref={ref} {...props}>\n {context.label && (\n <FormFieldLabelSlot {...context.labelSlotProps}>\n <label {...labelProps}>\n {context.label}\n {isRequired && <sup aria-hidden=\"true\">*</sup>}\n </label>\n {context.info && (\n <DialogTrigger>\n <Box\n as=\"span\"\n display=\"inline-block\"\n position=\"relative\"\n width=\"1ch\"\n height=\"1ch\"\n ml=\"200\"\n >\n <Box\n as=\"span\"\n display=\"inline-flex\"\n position=\"absolute\"\n top=\"50%\"\n right=\"50%\"\n transform=\"translate(50%, -50%)\"\n >\n <IconButton\n aria-label=\"__MORE INFO\"\n size=\"2xs\"\n colorPalette=\"info\"\n variant=\"link\"\n >\n <HelpOutline />\n </IconButton>\n </Box>\n </Box>\n <Popover>\n <FormFieldPopoverSlot asChild>\n <Dialog>\n <Box p=\"300\">{context.info}</Box>\n </Dialog>\n </FormFieldPopoverSlot>\n </Popover>\n </DialogTrigger>\n )}\n </FormFieldLabelSlot>\n )}\n {context.input && (\n <FormFieldInputSlot {...context.inputSlotProps}>\n {Children.map(context.input, (child) => {\n // Important: Check if the child is a valid React element before cloning.\n if (isValidElement(child)) {\n return cloneElement(child, inputProps);\n }\n // If it's not a valid element (e.g., text node, null, undefined), return it as is.\n return child;\n })}\n </FormFieldInputSlot>\n )}\n {context.description && (\n <FormFieldDescriptionSlot\n {...descriptionProps}\n {...context.descriptionSlotProps}\n >\n {context.description}\n </FormFieldDescriptionSlot>\n )}\n {isInvalid && context.error && (\n <FormFieldErrorSlot\n {...errorMessageProps}\n {...context.errorSlotProps}\n >\n <Box\n as={ErrorOutline}\n display=\"inline-flex\"\n boxSize=\"400\"\n verticalAlign=\"text-bottom\"\n mr=\"100\"\n alignSelf=\"center\"\n />\n {context.error}\n </FormFieldErrorSlot>\n )}\n {children}\n </FormFieldRootSlot>\n </FormFieldContext.Provider>\n );\n};\n\nFormFieldRoot.displayName = \"FormField.Root\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldLabelSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Label - The label element for the form field\n *\n * @supportsStyleProps\n */\n// TODO: should this be wrapped in react-aria's `LabelContext` provider?, e.g. https://react-spectrum.adobe.com/react-aria/TextField.html#custom-children\nexport const FormFieldLabel = ({\n children,\n ...labelSlotProps\n}: FormFieldLabelSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n label: children,\n labelSlotProps,\n }));\n\n // Cleanup: clear label when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n label: null,\n labelSlotProps: undefined,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldLabel.displayName = \"FormField.Label\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldInputSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Input - The input wrapper element for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldInput = ({\n children,\n ...inputSlotProps\n}: FormFieldInputSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n input: children,\n inputSlotProps,\n }));\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldInput.displayName = \"FormField.Input\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldDescriptionSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Description - The description element for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldDescription = ({\n children,\n ...descriptionSlotProps\n}: FormFieldDescriptionSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n description: children,\n descriptionSlotProps,\n }));\n\n // Cleanup: clear description when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n description: null,\n descriptionSlotProps: undefined,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldDescription.displayName = \"FormField.Description\";\n","import { useContext, useEffect } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\nimport type { FormFieldErrorSlotProps } from \"../form-field.types\";\n\n/**\n * FormField.Error - The error message element for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldError = ({\n children,\n ...errorSlotProps\n}: FormFieldErrorSlotProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n error: children,\n errorSlotProps,\n }));\n\n // Cleanup: clear error when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n error: null,\n errorSlotProps: undefined,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldError.displayName = \"FormField.Error\";\n","import { useContext, useEffect, type ReactNode } from \"react\";\nimport { FormFieldContext } from \"./form-field.context\";\n\ntype FormFieldInfoBoxProps = {\n /**\n * The content to display in the InfoBox\n */\n children: ReactNode;\n};\n\n/**\n * FormField.InfoBox - The info box popover content for the form field\n *\n * @supportsStyleProps\n */\nexport const FormFieldInfoBox = ({ children }: FormFieldInfoBoxProps) => {\n const { setContext } = useContext(FormFieldContext);\n\n useEffect(() => {\n setContext((prevContext) => ({\n ...prevContext,\n info: children,\n }));\n\n // Cleanup: clear info when component unmounts\n return () => {\n setContext((prevContext) => ({\n ...prevContext,\n info: null,\n }));\n };\n }, [children, setContext]);\n\n return null;\n};\n\nFormFieldInfoBox.displayName = \"FormField.InfoBox\";\n","import {\n FormFieldRoot,\n FormFieldLabel,\n FormFieldInput,\n FormFieldDescription,\n FormFieldError,\n FormFieldInfoBox,\n} from \"./components\";\n\nexport const FormField = {\n /**\n * # FormField.Root\n *\n * The root container for the form field that provides context and state management\n * for all child components. Handles React Aria integration for accessibility,\n * manages field state (required, invalid, disabled, readonly), and coordinates\n * rendering of label, input, description, and error elements.\n *\n * @example\n * ```tsx\n * <FormField.Root isRequired isInvalid>\n * <FormField.Label>Username</FormField.Label>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * <FormField.Description>Enter your username</FormField.Description>\n * <FormField.Error>Username is required</FormField.Error>\n * </FormField.Root>\n * ```\n */\n Root: FormFieldRoot,\n\n /**\n * # FormField.Label\n *\n * The label element for the form field. Automatically associates with the input\n * via React Aria and displays a required indicator when the field is required.\n * Supports an optional info box trigger for additional field information.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>Email Address</FormField.Label>\n * <FormField.InfoBox>\n * Your email will be used for account notifications\n * </FormField.InfoBox>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * </FormField.Root>\n * ```\n */\n Label: FormFieldLabel,\n\n /**\n * # FormField.Input\n *\n * The input wrapper element that receives and displays the actual input component.\n * Automatically clones children and passes accessibility props, validation state,\n * and field attributes from React Aria.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>Password</FormField.Label>\n * <FormField.Input>\n * <PasswordInput />\n * </FormField.Input>\n * </FormField.Root>\n * ```\n */\n Input: FormFieldInput,\n\n /**\n * # FormField.Description\n *\n * The description element that provides helpful information about the field.\n * Automatically associates with the input via `aria-describedby` for screen readers.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>Username</FormField.Label>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * <FormField.Description>\n * Must be 3-20 characters, letters and numbers only\n * </FormField.Description>\n * </FormField.Root>\n * ```\n */\n Description: FormFieldDescription,\n\n /**\n * # FormField.Error\n *\n * The error message element that displays validation errors. Only visible when\n * the field is invalid. Automatically associates with the input via\n * `aria-errormessage` and includes an error icon.\n *\n * @example\n * ```tsx\n * <FormField.Root isInvalid>\n * <FormField.Label>Email</FormField.Label>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * <FormField.Error>Please enter a valid email address</FormField.Error>\n * </FormField.Root>\n * ```\n */\n Error: FormFieldError,\n\n /**\n * # FormField.InfoBox\n *\n * The info box content that appears in a popover when the help icon next to\n * the label is clicked. Use for additional context or instructions that don't\n * need to be visible by default.\n *\n * @example\n * ```tsx\n * <FormField.Root>\n * <FormField.Label>API Key</FormField.Label>\n * <FormField.InfoBox>\n * Your API key can be found in your account settings.\n * Keep it secure and never share it publicly.\n * </FormField.InfoBox>\n * <FormField.Input>\n * <TextInput />\n * </FormField.Input>\n * </FormField.Root>\n * ```\n */\n InfoBox: FormFieldInfoBox,\n};\n\nexport {\n FormFieldRoot as _FormFieldRoot,\n FormFieldLabel as _FormFieldLabel,\n FormFieldInput as _FormFieldInput,\n FormFieldDescription as _FormFieldDescription,\n FormFieldError as _FormFieldError,\n FormFieldInfoBox as _FormFieldInfoBox,\n};\n"],"names":["FormFieldContext","createContext","withProvider","withContext","createSlotRecipeContext","FormFieldRootSlot","FormFieldLabelSlot","FormFieldInputSlot","FormFieldDescriptionSlot","FormFieldErrorSlot","FormFieldPopoverSlot","FormFieldRoot","forwardedRef","id","isInvalid","isRequired","isDisabled","isReadOnly","children","props","localRef","useRef","ref","useObjectRef","mergeRefs","context","setContext","useState","useFieldArgs","useMemo","args","labelProps","fieldProps","descriptionProps","errorMessageProps","useField","useEffect","prevContext","inputProps","contextValue","jsx","jsxs","DialogTrigger","Box","IconButton","HelpOutline","Popover","Dialog","Children","child","isValidElement","cloneElement","ErrorOutline","FormFieldLabel","labelSlotProps","useContext","FormFieldInput","inputSlotProps","FormFieldDescription","descriptionSlotProps","FormFieldError","errorSlotProps","FormFieldInfoBox","FormField"],"mappings":";;;;;;;;;AA6BO,MAAMA,IAAmB,gBAAAC,EAAoC;AAAA,EAClE,SAAS;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,YAAY,MAAM;AAAA,EAAC;AACrB,CAAC,GC5BK,EAAE,cAAAC,GAAc,aAAAC,EAAA,IAAgB,gBAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBP,OAAOG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBP,aAAaE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBb,OAAOE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBP,SAASE;AACX;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),J=require("react-intl"),S=require("./money-input-
|
|
2
|
-
//# sourceMappingURL=localized-field-
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),J=require("react-intl"),S=require("./money-input-DKK4IkDa.cjs.js"),L=require("./form-field-Ca3k84cH.cjs.js"),W=require("react"),ie=require("./Dialog-flHBRP1h.cjs.js"),xe=require("./CollectionBuilder-DjRx57vm.cjs.js"),I=require("@commercetools/nimbus-icons"),be=require("./popover-DHeke7qU.cjs.js"),he=require("@chakra-ui/react"),U=require("./icon-D39U--jA.cjs.js"),me=require("./rich-text-input-v6nJvAeT.cjs.js"),Fe=require("./multiline-text-input-BsqrmqVM.cjs.js"),je=require("./text-input-CHwtpRzk.cjs.js"),re=require("./mergeProps-CxnHrnow.cjs.js"),fe=require("./useField-lK6K_h1G.cjs.js"),se=require("./field-errors-D2re_C_c.cjs.js"),A=require("./stack-CIN13EDn.cjs.js"),Le=require("./icon-button-LnGKZj9k.cjs.js"),oe=require("./box-CWni3A32.cjs.js"),Ie=require("./button-DYT63YaG.cjs.js"),v=J.defineMessages({missingRequiredField:{id:"Nimbus.LocalizedField.missingRequiredField",description:"Error message for missing required value",defaultMessage:"This field is required. Provide at least one value."},infoBoxTriggerAriaLabel:{id:"Nimbus.LocalizedField.infoBoxTriggerAriaLabel",description:"aria label for button that triggers more info dialog",defaultMessage:"more info"},showLanguages:{id:"Nimbus.LocalizedField.showLanguages",description:"Label for showing all language inputs when toggle button is pressed",defaultMessage:"Show all languages"},hideLanguages:{id:"Nimbus.LocalizedField.hideLanguages",description:"Label for hiding all language inputs when toggle button is pressed",defaultMessage:"Hide all languages"},showCurrencies:{id:"Nimbus.LocalizedField.showCurrencies",description:"Label for showing all currency inputs when toggle button is pressed",defaultMessage:"Show all currencies"},hideCurrencies:{id:"Nimbus.LocalizedField.hideCurrencies",description:"Label for hiding all currency inputs when toggle button is pressed",defaultMessage:"Hide all currencies"}}),{withProvider:ve,withContext:p}=he.createSlotRecipeContext({key:"localizedField"}),$e=ve("fieldset","root"),qe=p("legend","label"),Me=p("div","infoDialog"),we=p("div","fieldsContainer"),Ce=p("div","description"),Ee=p("div","error"),ke=p("div","toggleButtonContainer"),Se=p("div","localeFieldRoot"),ze=p("div","localeFieldLabel"),ye=p("div","localeFieldInput"),Te=()=>t.jsx(L.FormField.Error,{children:t.jsx(J.FormattedMessage,{...v.missingRequiredField})}),m=(e,n)=>e&&n?`${e}.${n}`:void 0,D=e=>e.split("-")[0],Pe=(e,n)=>{const i=D(e),r=n.filter(l=>D(l)===i);return{unrelated:n.filter(l=>D(l)!==i),related:r}},Be=(e,n)=>{const{related:i,unrelated:r}=Pe(e,n.filter(s=>s!==e));return[e,...i.sort(),...r.sort()]},He=(e,n)=>{const i=n.filter(r=>r!==e);return[e,...i.sort()]},Ne=(e,n)=>e&&Object.keys(e).length>0&&n?Object.keys(e).some(i=>i!==n):!1,Ve=(e,n)=>Array.from(new Set([...e,...Object.keys(n)])).reduce((r,s)=>({...r,[s]:n?.[s]||""}),{}),Re=e=>e?Object.values(e).every(n=>!n||n?.trim().length===0):!0,Ae=e=>(typeof e!="object"&&console.warn("Nimbus Localized Field - Warning: omitEmptyTranslations must be called with an object"),Object.entries(e).reduce((n,[i,r])=>r&&r.trim().length>0?{...n,[i]:r}:n,{})),De=e=>e?Object.values(e).some(Boolean):!1;function We(e){return e}const Ue=(e,n)=>Object.values(e).map(i=>S.MoneyInput.convertToMoneyValue(i,n)),Je=(e=[],n)=>e.reduce((i,r)=>{const s=S.MoneyInput.parseMoneyValue(r,n);return{...i,[s.currencyCode]:s}},{}),Qe=(e,n)=>Object.keys(e).filter(r=>S.MoneyInput.isHighPrecision(e[r],n)),Xe=e=>Object.keys(e).filter(i=>S.MoneyInput.isEmpty(e[i])),Ye=({type:e,size:n,localeOrCurrency:i,id:r,name:s,inputValue:l,description:$,warning:x,error:b,onChange:F,onBlur:q,onFocus:M,isRequired:w,isReadOnly:h,isDisabled:j,isInvalid:f,touched:a,...P})=>{let o;switch(e){case"text":default:o=je.TextInput;break;case"multiLine":o=Fe.MultilineTextInput;break;case"money":o=S.MoneyInput;break;case"richText":o=me.RichTextInput;break}const C=e==="money"?l||{amount:"",currencyCode:i}:l||"",y=W.useCallback(d=>{const B={target:typeof d=="object"?{id:d.target.id,name:d.target.name,locale:void 0,currency:i,value:d.target.value}:{id:r,name:s,locale:i,currency:void 0,value:d}};F(B)},[r,s,i,F]);return t.jsx(Se,{asChild:!0,children:t.jsxs(L.FormField.Root,{isDisabled:j,isReadOnly:h,isInvalid:(f||!!b)&&a,direction:"row",size:n,id:r,children:[t.jsx(ze,{display:e==="money"?"none":void 0,...j&&{"data-disabled":j},asChild:!0,children:t.jsx(L.FormField.Label,{children:i.toLocaleUpperCase()})}),t.jsx(L.FormField.Input,{children:t.jsx(ye,{"aria-required":w,asChild:!0,children:t.jsx(o,{...P,size:n,value:C,onChange:y,onBlur:d=>q?.(d,i),onFocus:d=>M?.(d,i),isRequired:w,isDisabled:j,isReadOnly:h,isInvalid:(f||!!b)&&a})})}),($||x&&a)&&t.jsx(L.FormField.Description,{role:x&&a?"status":void 0,color:x&&a?"warning.11":void 0,display:"flex",gap:"100",alignItems:"center",children:x&&a?t.jsxs(t.Fragment,{children:[t.jsx(U.Icon,{colorPalette:"warning",children:t.jsx(I.WarningAmber,{})}),x]}):$}),b&&a&&t.jsx(L.FormField.Error,{children:b})]})})},Ze=({type:e="text",id:n,name:i,defaultLocaleOrCurrency:r,valuesByLocaleOrCurrency:s,placeholdersByLocaleOrCurrency:l,descriptionsByLocaleOrCurrency:$,warningsByLocaleOrCurrency:x,errorsByLocaleOrCurrency:b,label:F,hint:q,description:M,warning:w,warnings:h,renderWarning:j,error:f,errors:a,renderError:P,touched:o,isRequired:z,isDisabled:C,isReadOnly:y,onChange:d,onBlur:Q,onFocus:B,defaultExpanded:ae=!1,displayAllLocalesOrCurrencies:X=!1,size:Y,autoFocus:Z,["data-track-component"]:le,["data-testid"]:de,["data-test"]:ce,...ue})=>{const[c,_]=W.useState(X||ae),{formatMessage:E}=J.useIntl(),G=re.$bdb11010cef70236$export$f680877a34711e37(),O=re.$bdb11010cef70236$export$f680877a34711e37(),H=!!(f||a&&Object.values(a).some(u=>u===!0)),k=!!(w||h&&Object.values(h).some(Boolean)),T=!!(H&&o),{labelProps:K,fieldProps:ee,descriptionProps:N,errorMessageProps:V}=fe.$2baaea4c71418dea$export$294aa081a6c6f55d({id:n,label:F,description:M,errorMessage:f,isInvalid:T}),R=Object.keys(s),ge=W.useMemo(()=>(e==="money"?He(r,R):Be(r,R)).reduce((ne,g)=>{const pe={localeOrCurrency:g,inputValue:s[g],placeholder:l?.[g],description:$?.[g],warning:x?.[g],error:b?.[g],...g===r&&Z?{autoFocus:Z}:{},isInvalid:T,isRequired:z,isDisabled:C,isReadOnly:y};return c||!c&&g===r?[...ne,pe]:ne},[]),[s,l,$,x,b,r,c,T,z,C,y]),te=(Ne(b,r)||H)&&o;return te&&!c&&_(!0),t.jsxs($e,{...ue,...ee,"aria-details":q?O:void 0,type:e,size:Y,name:i,children:[F&&t.jsxs(A.Stack,{direction:"row",gap:"0",children:[t.jsxs(qe,{...K,children:[F,z&&t.jsx("sup",{"aria-hidden":"true",children:"*"})]}),q&&t.jsxs(ie.$de32f1b87079253c$export$2e1e1122cf0cba88,{children:[t.jsx(Le.IconButton,{id:O,"aria-label":E(v.infoBoxTriggerAriaLabel),size:"2xs",colorPalette:"info",variant:"link",children:t.jsx(I.HelpOutline,{})}),t.jsx(be.Popover,{padding:0,children:t.jsx(Me,{asChild:!0,children:t.jsx(ie.$de32f1b87079253c$export$3ddf2d174ce01153,{children:t.jsx(oe.Box,{p:"300",children:q})})})})]})]}),t.jsx(we,{id:G,"data-expanded":c,children:t.jsx(xe.$e1995378a142960e$export$fb8073518f34e6ec,{items:ge,children:u=>t.jsx(Ye,{...u,size:Y,type:e,onChange:d,onBlur:Q,onFocus:B,touched:o,id:m(ee.id,u.localeOrCurrency),name:m(i,u.localeOrCurrency),"data-test":m(ce,u.localeOrCurrency),"data-testid":m(de,u.localeOrCurrency),"data-track-component":m(le,u.localeOrCurrency)})})}),!X&&R.length>1&&t.jsx(ke,{children:t.jsxs(Ie.Button,{"aria-controls":G,"aria-describedby":K.id,"aria-expanded":c,onPress:()=>_(!c),isDisabled:C||te&&c,variant:"ghost",size:"2xs",colorPalette:"primary",children:[t.jsx(oe.Box,{as:e==="money"?I.Payments:I.Language,display:"inline-flex",boxSize:"400",verticalAlign:"text-bottom",mr:"100"}),E(e==="money"?c?v.hideCurrencies:v.showCurrencies:c?v.hideLanguages:v.showLanguages)]})}),(M||k&&o)&&t.jsx(Ce,{role:k&&o?"status":void 0,color:k&&o?"warning.11":void 0,"aria-labelledby":`${N.id}-warning`,...N,children:k&&o?t.jsxs(t.Fragment,{children:[t.jsx(U.Icon,{colorPalette:"warning",children:t.jsx(I.WarningAmber,{})}),t.jsxs(A.Stack,{gap:"0",id:`${N.id}-warning`,children:[w,h&&k&&t.jsx(se.FieldErrors,{errors:h,renderError:j,colorPalette:"warning",role:void 0})]})]}):M}),T&&t.jsxs(Ee,{"aria-labelledby":`${V.id}-error`,role:"alert",...V,children:[t.jsx(U.Icon,{children:t.jsx(I.ErrorOutline,{})}),t.jsxs(A.Stack,{gap:"0",id:`${V.id}-error`,children:[f,a&&H&&t.jsx(se.FieldErrors,{errors:a,renderError:P,role:void 0})]})]})]})},_e=Object.assign(Ze,{getId:m,getName:m,isTouched:De,isEmpty:Re,createLocalizedString:Ve,omitEmptyTranslations:Ae,RequiredValueErrorMessage:Te,toFieldErrors:We,convertToMoneyValues:Ue,parseMoneyValues:Je,getHighPrecisionCurrencies:Qe,getEmptyCurrencies:Xe});exports.LocalizedField=_e;
|
|
2
|
+
//# sourceMappingURL=localized-field-BJXrxOc7.cjs.js.map
|
package/dist/chunks/{localized-field-Cb0fyOZF.cjs.js.map → localized-field-BJXrxOc7.cjs.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localized-field-Cb0fyOZF.cjs.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 const messages = 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 CurrencyCode,\n type MoneyInputValue,\n type MoneyValue,\n type FieldErrorsData,\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]?: FieldErrorsData;\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: CurrencyCode,\n allCurrencies: CurrencyCode[]\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: MoneyInputValue[],\n currency: string\n): Array<MoneyValue | null> =>\n Object.values(values).map<MoneyValue | null>((value) => {\n return MoneyInput.convertToMoneyValue(value, currency);\n });\n\nexport const parseMoneyValues = (\n moneyValues: MoneyValue[] = [],\n locale: string\n): Record<CurrencyCode, MoneyInputValue> =>\n moneyValues.reduce<Record<CurrencyCode, MoneyInputValue>>(\n (allValues, moneyValue) => {\n const value = MoneyInput.parseMoneyValue(moneyValue, locale);\n return {\n ...allValues,\n [value.currencyCode]: value,\n };\n },\n {} as Record<CurrencyCode, MoneyInputValue>\n );\n\nexport const getHighPrecisionCurrencies = (\n values: Record<CurrencyCode, MoneyInputValue>,\n locale: string\n): CurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as CurrencyCode[];\n return typedCurrencyCodes.filter((currencyCode) =>\n MoneyInput.isHighPrecision(values[currencyCode], locale)\n );\n};\n\nexport const getEmptyCurrencies = (\n values: Record<CurrencyCode, MoneyInputValue>\n): CurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as CurrencyCode[];\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 CustomEvent,\n MultilineTextInput,\n RichTextInput,\n type MoneyInputValue,\n type CurrencyCode,\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\n/**\n * LocalizedFieldLocaleField - Individual locale or currency input field\n *\n * Renders a single input field for a specific locale or currency with integrated\n * label, description, warning, and error message display. Supports text, multiline,\n * richText, and money input types.\n *\n * @supportsStyleProps\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 MoneyInputValue)\n : ({ amount: \"\", currencyCode: localeOrCurrency } as MoneyInputValue);\n }\n return inputValueFromProps ? inputValueFromProps : \"\";\n };\n\n const inputValue = getInputValue();\n\n const handleChange = useCallback(\n (value: string | CustomEvent | 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 CurrencyCode,\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 & MoneyInputValue}\n onChange={handleChange}\n onBlur={(e: React.FocusEvent | CustomEvent) =>\n onBlur?.(e, localeOrCurrency)\n }\n onFocus={(e: React.FocusEvent | CustomEvent) =>\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 CurrencyCode,\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\n/**\n * LocalizedField - Root component for managing localized input fields\n *\n * Provides a fieldset container for multiple locale-specific or currency-specific input fields\n * with expand/collapse functionality and integrated validation display. Supports text, multiline,\n * richText, and money input types.\n *\n * @supportsStyleProps\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[] | CurrencyCode[] = 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 CurrencyCode,\n localizationKeys as CurrencyCode[]\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 colorPalette=\"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 { LocalizedFieldRoot } from \"./components\";\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\n/**\n * LocalizedField component with utility methods for managing localized input fields.\n *\n * This component provides a fieldset for managing multiple locale-specific or currency-specific\n * input fields with expand/collapse functionality and integrated validation display.\n *\n * **Utility Methods** (for compatibility with UI Kit):\n * - `getId` / `getName`: Format field attributes with locale suffix\n * - `isTouched`: Check if any locale field has been touched\n * - `isEmpty`: Check if all locale fields are empty\n * - `createLocalizedString`: Create empty localized string object\n * - `omitEmptyTranslations`: Remove empty translations from localized object\n * - `RequiredValueErrorMessage`: Standard error message component\n * - `toFieldErrors`: Convert errors to field error format\n * - `convertToMoneyValues` / `parseMoneyValues`: Money value conversion utilities\n * - `getHighPrecisionCurrencies` / `getEmptyCurrencies`: Currency utilities\n *\n * @example\n * ```tsx\n * <LocalizedField\n * type=\"text\"\n * label=\"Product Name\"\n * defaultLocaleOrCurrency=\"en\"\n * valuesByLocaleOrCurrency={{ en: \"Product\", de: \"Produkt\" }}\n * onChange={(e) => console.log(e.target.locale, e.target.value)}\n * />\n * ```\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":"40BAEaA,EAAWC,EAAAA,eAAe,CACrC,qBAAsB,CACpB,GAAI,6CACJ,YAAa,2CACb,eAAgB,qDAAA,EAElB,wBAAyB,CACvB,GAAI,gDACJ,YAAa,uDACb,eAAgB,WAAA,EAElB,cAAe,CACb,GAAI,sCACJ,YACE,sEACF,eAAgB,oBAAA,EAElB,cAAe,CACb,GAAI,sCACJ,YACE,qEACF,eAAgB,oBAAA,EAElB,e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,GACA,sBAAAH,GACA,sBAAAK,GACA,0BAAA9B,GACA,cAAAkC,GACA,qBAAAC,GACA,iBAAAG,GACA,2BAAAI,GACA,mBAAAE,EACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"localized-field-BJXrxOc7.cjs.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 const messages = 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 CurrencyCode,\n type MoneyInputValue,\n type MoneyValue,\n type FieldErrorsData,\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]?: FieldErrorsData;\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: CurrencyCode,\n allCurrencies: CurrencyCode[]\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: MoneyInputValue[],\n currency: string\n): Array<MoneyValue | null> =>\n Object.values(values).map<MoneyValue | null>((value) => {\n return MoneyInput.convertToMoneyValue(value, currency);\n });\n\nexport const parseMoneyValues = (\n moneyValues: MoneyValue[] = [],\n locale: string\n): Record<CurrencyCode, MoneyInputValue> =>\n moneyValues.reduce<Record<CurrencyCode, MoneyInputValue>>(\n (allValues, moneyValue) => {\n const value = MoneyInput.parseMoneyValue(moneyValue, locale);\n return {\n ...allValues,\n [value.currencyCode]: value,\n };\n },\n {} as Record<CurrencyCode, MoneyInputValue>\n );\n\nexport const getHighPrecisionCurrencies = (\n values: Record<CurrencyCode, MoneyInputValue>,\n locale: string\n): CurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as CurrencyCode[];\n return typedCurrencyCodes.filter((currencyCode) =>\n MoneyInput.isHighPrecision(values[currencyCode], locale)\n );\n};\n\nexport const getEmptyCurrencies = (\n values: Record<CurrencyCode, MoneyInputValue>\n): CurrencyCode[] => {\n const typedCurrencyCodes = Object.keys(values) as CurrencyCode[];\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 CustomEvent,\n MultilineTextInput,\n RichTextInput,\n type MoneyInputValue,\n type CurrencyCode,\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\n/**\n * LocalizedFieldLocaleField - Individual locale or currency input field\n *\n * Renders a single input field for a specific locale or currency with integrated\n * label, description, warning, and error message display. Supports text, multiline,\n * richText, and money input types.\n *\n * @supportsStyleProps\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 MoneyInputValue)\n : ({ amount: \"\", currencyCode: localeOrCurrency } as MoneyInputValue);\n }\n return inputValueFromProps ? inputValueFromProps : \"\";\n };\n\n const inputValue = getInputValue();\n\n const handleChange = useCallback(\n (value: string | CustomEvent | 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 CurrencyCode,\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 & MoneyInputValue}\n onChange={handleChange}\n onBlur={(e: React.FocusEvent | CustomEvent) =>\n onBlur?.(e, localeOrCurrency)\n }\n onFocus={(e: React.FocusEvent | CustomEvent) =>\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 CurrencyCode,\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\n/**\n * LocalizedField - Root component for managing localized input fields\n *\n * Provides a fieldset container for multiple locale-specific or currency-specific input fields\n * with expand/collapse functionality and integrated validation display. Supports text, multiline,\n * richText, and money input types.\n *\n * @supportsStyleProps\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[] | CurrencyCode[] = 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 CurrencyCode,\n localizationKeys as CurrencyCode[]\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 colorPalette=\"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 { LocalizedFieldRoot } from \"./components\";\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\n/**\n * LocalizedField component with utility methods for managing localized input fields.\n *\n * This component provides a fieldset for managing multiple locale-specific or currency-specific\n * input fields with expand/collapse functionality and integrated validation display.\n *\n * **Utility Methods** (for compatibility with UI Kit):\n * - `getId` / `getName`: Format field attributes with locale suffix\n * - `isTouched`: Check if any locale field has been touched\n * - `isEmpty`: Check if all locale fields are empty\n * - `createLocalizedString`: Create empty localized string object\n * - `omitEmptyTranslations`: Remove empty translations from localized object\n * - `RequiredValueErrorMessage`: Standard error message component\n * - `toFieldErrors`: Convert errors to field error format\n * - `convertToMoneyValues` / `parseMoneyValues`: Money value conversion utilities\n * - `getHighPrecisionCurrencies` / `getEmptyCurrencies`: Currency utilities\n *\n * @example\n * ```tsx\n * <LocalizedField\n * type=\"text\"\n * label=\"Product Name\"\n * defaultLocaleOrCurrency=\"en\"\n * valuesByLocaleOrCurrency={{ en: \"Product\", de: \"Produkt\" }}\n * onChange={(e) => console.log(e.target.locale, e.target.value)}\n * />\n * ```\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":"40BAEaA,EAAWC,EAAAA,eAAe,CACrC,qBAAsB,CACpB,GAAI,6CACJ,YAAa,2CACb,eAAgB,qDAAA,EAElB,wBAAyB,CACvB,GAAI,gDACJ,YAAa,uDACb,eAAgB,WAAA,EAElB,cAAe,CACb,GAAI,sCACJ,YACE,sEACF,eAAgB,oBAAA,EAElB,cAAe,CACb,GAAI,sCACJ,YACE,qEACF,eAAgB,oBAAA,EAElB,eAAgB,CACd,GAAI,uCACJ,YACE,sEACF,eAAgB,qBAAA,EAElB,eAAgB,CACd,GAAI,uCACJ,YACE,qEACF,eAAgB,qBAAA,CAEpB,CAAC,ECvBK,CAAE,aAAAC,GAAc,YAAAC,CAAA,EAAgBC,2BAAwB,CAC5D,IAAK,gBACP,CAAC,EAGYC,GAAyBH,GAGpC,WAAY,MAAM,EAGPI,GAA0BH,EAGrC,SAAU,OAAO,EAGNI,GAA+BJ,EAG1C,MAAO,YAAY,EAGRK,GAAoCL,EAG/C,MAAO,iBAAiB,EAGbM,GAAgCN,EAG3C,MAAO,aAAa,EAGTO,GAA0BP,EAGrC,MAAO,OAAO,EAGHQ,GAA0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AJ,EAAAA,KAAC6C,EAAAA,OAAM,IAAI,IAAI,GAAI,GAAGV,EAAiB,EAAE,WACtC,SAAA,CAAArD,EACA+B,GAAYmB,GACXrG,EAAAA,IAAC8H,GAAAA,YAAA,CACC,OAAQ5C,EACR,YAAaC,EACb,aAAa,UACb,KAAM,MAAA,CAAA,CACR,CAAA,CAEJ,CAAA,CAAA,CACF,EAEAjC,CAAA,CAAA,EAILS,GACCU,EAAAA,KAAC3E,GAAA,CAGC,kBAAiB,GAAG+G,EAAkB,EAAE,SACxC,KAAK,QACJ,GAAGA,EAEJ,SAAA,CAAAzG,EAAAA,IAACwE,EAAAA,KAAA,CACC,SAAAxE,EAAAA,IAAC+H,EAAAA,aAAA,CAAA,CAAa,EAChB,EACA1D,EAAAA,KAAC6C,EAAAA,OAAM,IAAI,IAAI,GAAI,GAAGT,EAAkB,EAAE,SACvC,SAAA,CAAArD,EACA/B,GAAU+E,GACTpG,EAAAA,IAAC8H,GAAAA,YAAA,CACC,OAAAzG,EACA,YAAA+D,EACA,KAAM,MAAA,CAAA,CACR,CAAA,CAEJ,CAAA,CAAA,CAAA,CACF,CAAA,CAAA,CAIR,ECrUaV,GAAiB,OAAO,OAAOsD,GAAoB,CAE9D,MAAO7H,EACP,QAASA,EACT,UAAA4B,GACA,QAAAJ,GACA,sBAAAH,GACA,sBAAAK,GACA,0BAAA9B,GACA,cAAAkC,GACA,qBAAAC,GACA,iBAAAG,GACA,2BAAAI,GACA,mBAAAE,EACF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as i, jsxs as c, Fragment as re } from "react/jsx-runtime";
|
|
2
2
|
import { defineMessages as me, FormattedMessage as pe, useIntl as fe } from "react-intl";
|
|
3
|
-
import { M as S } from "./money-input-
|
|
4
|
-
import { F as I } from "./form-field-
|
|
3
|
+
import { M as S } from "./money-input-CdcKcoW7.es.js";
|
|
4
|
+
import { F as I } from "./form-field-CzFcczIs.es.js";
|
|
5
5
|
import { useCallback as he, useState as be, useMemo as Fe } from "react";
|
|
6
|
-
import { k as Le, h as ve } from "./Dialog-
|
|
7
|
-
import { c as xe } from "./CollectionBuilder-
|
|
6
|
+
import { k as Le, h as ve } from "./Dialog-DcnmO0xr.es.js";
|
|
7
|
+
import { c as xe } from "./CollectionBuilder-BnYe2z4W.es.js";
|
|
8
8
|
import { WarningAmber as ne, HelpOutline as Ie, Payments as Me, Language as $e, ErrorOutline as we } from "@commercetools/nimbus-icons";
|
|
9
|
-
import { P as Ce } from "./popover-
|
|
9
|
+
import { P as Ce } from "./popover-zNeVW5hN.es.js";
|
|
10
10
|
import { createSlotRecipeContext as je } from "@chakra-ui/react";
|
|
11
11
|
import { I as W } from "./icon-CenxuChf.es.js";
|
|
12
|
-
import { R as Ee } from "./rich-text-input-
|
|
12
|
+
import { R as Ee } from "./rich-text-input-D9-NrOjQ.es.js";
|
|
13
13
|
import { M as ke } from "./multiline-text-input-CjtXIsaQ.es.js";
|
|
14
14
|
import { T as ze } from "./text-input-BsC8K75b.es.js";
|
|
15
15
|
import { a as te } from "./mergeProps-Dsl8k3Ig.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-Bq8xTkHi.es.js.map
|