@commercetools/nimbus 2.4.0 → 2.5.0

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.
Files changed (73) hide show
  1. package/README.md +17 -12
  2. package/dist/chunks/accordion-6JxQb_15.cjs.js +2 -0
  3. package/dist/chunks/accordion-6JxQb_15.cjs.js.map +1 -0
  4. package/dist/chunks/accordion-KXi53sSd.es.js +84 -0
  5. package/dist/chunks/accordion-KXi53sSd.es.js.map +1 -0
  6. package/dist/chunks/accordion.content-DWXekiUB.cjs.js +2 -0
  7. package/dist/chunks/accordion.content-DWXekiUB.cjs.js.map +1 -0
  8. package/dist/chunks/accordion.content-I6FlZR6t.es.js +228 -0
  9. package/dist/chunks/accordion.content-I6FlZR6t.es.js.map +1 -0
  10. package/dist/chunks/alert-BYLSKkn9.cjs.js +2 -0
  11. package/dist/chunks/alert-BYLSKkn9.cjs.js.map +1 -0
  12. package/dist/chunks/alert-Npb00ttk.es.js +158 -0
  13. package/dist/chunks/alert-Npb00ttk.es.js.map +1 -0
  14. package/dist/chunks/{localized-field-rZG712BE.cjs.js → localized-field-CCpAn8pz.cjs.js} +2 -2
  15. package/dist/chunks/{localized-field-rZG712BE.cjs.js.map → localized-field-CCpAn8pz.cjs.js.map} +1 -1
  16. package/dist/chunks/{localized-field-y1Maik4X.es.js → localized-field-Dwq6C30C.es.js} +2 -2
  17. package/dist/chunks/{localized-field-y1Maik4X.es.js.map → localized-field-Dwq6C30C.es.js.map} +1 -1
  18. package/dist/chunks/{password-input-6omRqui-.cjs.js → password-input-BmIFKyL5.cjs.js} +2 -2
  19. package/dist/chunks/{password-input-6omRqui-.cjs.js.map → password-input-BmIFKyL5.cjs.js.map} +1 -1
  20. package/dist/chunks/{password-input-Bx-R47Zb.es.js → password-input-CThpVxA7.es.js} +2 -2
  21. package/dist/chunks/{password-input-Bx-R47Zb.es.js.map → password-input-CThpVxA7.es.js.map} +1 -1
  22. package/dist/chunks/{password-input-field-Buevk_ZR.cjs.js → password-input-field-BAHZJkVt.cjs.js} +2 -2
  23. package/dist/chunks/{password-input-field-Buevk_ZR.cjs.js.map → password-input-field-BAHZJkVt.cjs.js.map} +1 -1
  24. package/dist/chunks/{password-input-field-9j6mejHc.es.js → password-input-field-D-Nuq4vZ.es.js} +2 -2
  25. package/dist/chunks/{password-input-field-9j6mejHc.es.js.map → password-input-field-D-Nuq4vZ.es.js.map} +1 -1
  26. package/dist/chunks/{text-input-DMqogV2V.es.js → text-input-9W5v7FzD.es.js} +28 -28
  27. package/dist/chunks/{text-input-DMqogV2V.es.js.map → text-input-9W5v7FzD.es.js.map} +1 -1
  28. package/dist/chunks/text-input-B1upLZxw.cjs.js +2 -0
  29. package/dist/chunks/{text-input-BcnTka1I.cjs.js.map → text-input-B1upLZxw.cjs.js.map} +1 -1
  30. package/dist/chunks/{text-input-field-B9Ctttd2.es.js → text-input-field-BhKZgjWw.es.js} +2 -2
  31. package/dist/chunks/{text-input-field-B9Ctttd2.es.js.map → text-input-field-BhKZgjWw.es.js.map} +1 -1
  32. package/dist/chunks/{text-input-field-CcOUc96b.cjs.js → text-input-field-D_iawvje.cjs.js} +2 -2
  33. package/dist/chunks/{text-input-field-CcOUc96b.cjs.js.map → text-input-field-D_iawvje.cjs.js.map} +1 -1
  34. package/dist/components/accordion.cjs +1 -1
  35. package/dist/components/accordion.es.js +8 -7
  36. package/dist/components/accordion.es.js.map +1 -1
  37. package/dist/components/alert.cjs +1 -1
  38. package/dist/components/alert.es.js +4 -5
  39. package/dist/components/alert.es.js.map +1 -1
  40. package/dist/components/combobox/utils/test-utils.d.ts +19 -0
  41. package/dist/components/components.cjs +1 -1
  42. package/dist/components/components.es.js +6 -6
  43. package/dist/components/fields.cjs +1 -1
  44. package/dist/components/fields.es.js +2 -2
  45. package/dist/components/localized-field.cjs +1 -1
  46. package/dist/components/localized-field.es.js +1 -1
  47. package/dist/components/password-input-field.cjs +1 -1
  48. package/dist/components/password-input-field.es.js +1 -1
  49. package/dist/components/password-input.cjs +1 -1
  50. package/dist/components/password-input.es.js +1 -1
  51. package/dist/components/patterns.cjs +1 -1
  52. package/dist/components/patterns.es.js +2 -2
  53. package/dist/components/text-input-field.cjs +1 -1
  54. package/dist/components/text-input-field.es.js +1 -1
  55. package/dist/components/text-input.cjs +1 -1
  56. package/dist/components/text-input.es.js +1 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.cjs.map +1 -1
  59. package/dist/index.es.js +19 -19
  60. package/package.json +15 -15
  61. package/dist/chunks/accordion-BMvunDII.cjs.js +0 -2
  62. package/dist/chunks/accordion-BMvunDII.cjs.js.map +0 -1
  63. package/dist/chunks/accordion-CGL9rTeb.es.js +0 -308
  64. package/dist/chunks/accordion-CGL9rTeb.es.js.map +0 -1
  65. package/dist/chunks/alert-CGSkP1kI.cjs.js +0 -2
  66. package/dist/chunks/alert-CGSkP1kI.cjs.js.map +0 -1
  67. package/dist/chunks/alert-G0fQaS_Y.es.js +0 -85
  68. package/dist/chunks/alert-G0fQaS_Y.es.js.map +0 -1
  69. package/dist/chunks/alert.dismiss-button-B3btoWr3.cjs.js +0 -2
  70. package/dist/chunks/alert.dismiss-button-B3btoWr3.cjs.js.map +0 -1
  71. package/dist/chunks/alert.dismiss-button-BYbTqEqD.es.js +0 -77
  72. package/dist/chunks/alert.dismiss-button-BYbTqEqD.es.js.map +0 -1
  73. package/dist/chunks/text-input-BcnTka1I.cjs.js +0 -2
@@ -0,0 +1,158 @@
1
+ import { jsxs as A, jsx as s } from "react/jsx-runtime";
2
+ import { createSlotRecipeContext as u } from "@chakra-ui/react";
3
+ import { CheckCircleOutline as p, WarningAmber as g, Info as f, ErrorOutline as h, Clear as D } from "@commercetools/nimbus-icons";
4
+ import { I as v } from "./icon-button-DQaOMIAe.es.js";
5
+ import { n as r, u as x } from "./normalize-messages-BN9BAFXe.es.js";
6
+ const { withProvider: B, withContext: i } = /* @__PURE__ */ u({
7
+ key: "nimbusAlert"
8
+ }), M = /* @__PURE__ */ B(
9
+ "div",
10
+ "root"
11
+ ), R = /* @__PURE__ */ i(
12
+ "div",
13
+ "title"
14
+ ), y = /* @__PURE__ */ i("div", "description"), C = /* @__PURE__ */ i(
15
+ "div",
16
+ "icon"
17
+ ), I = /* @__PURE__ */ i(
18
+ "div",
19
+ "actions"
20
+ ), w = /* @__PURE__ */ i("div", "dismissButton"), N = (t) => {
21
+ switch (t) {
22
+ case "critical":
23
+ return /* @__PURE__ */ s(h, {});
24
+ case "info":
25
+ return /* @__PURE__ */ s(f, {});
26
+ case "warning":
27
+ return /* @__PURE__ */ s(g, {});
28
+ case "positive":
29
+ return /* @__PURE__ */ s(p, {});
30
+ default:
31
+ return null;
32
+ }
33
+ }, n = (t) => {
34
+ const { ref: e, children: d, ...o } = t;
35
+ return /* @__PURE__ */ A(M, { ref: e, ...o, role: "alert", children: [
36
+ /* @__PURE__ */ s(C, { alignItems: "flex-start", children: N(o.colorPalette) }),
37
+ d
38
+ ] });
39
+ };
40
+ n.displayName = "Alert.Root";
41
+ const l = ({ children: t, ...e }) => /* @__PURE__ */ s(R, { ...e, fontWeight: "600", children: t });
42
+ l.displayName = "Alert.Title";
43
+ const a = ({
44
+ children: t,
45
+ ...e
46
+ }) => /* @__PURE__ */ s(y, { ...e, children: t });
47
+ a.displayName = "Alert.Description";
48
+ const c = ({ children: t, ...e }) => /* @__PURE__ */ s(I, { ...e, children: t });
49
+ c.displayName = "Alert.Actions";
50
+ const _ = { dismiss: "Dismiss" }, $ = { dismiss: "Verwerfen" }, b = { dismiss: "Desechar" }, F = { dismiss: "Fermer" }, P = { dismiss: "Dispensar" }, T = {
51
+ en: /* @__PURE__ */ r(_),
52
+ de: /* @__PURE__ */ r($),
53
+ es: /* @__PURE__ */ r(b),
54
+ "fr-FR": /* @__PURE__ */ r(F),
55
+ "pt-BR": /* @__PURE__ */ r(P)
56
+ }, m = ({ ...t }) => {
57
+ const e = x(T);
58
+ return /* @__PURE__ */ s(w, { children: /* @__PURE__ */ s(
59
+ v,
60
+ {
61
+ "aria-label": e.format("dismiss"),
62
+ ...t,
63
+ variant: "ghost",
64
+ size: "2xs",
65
+ children: /* @__PURE__ */ s(D, { role: "img" })
66
+ }
67
+ ) });
68
+ };
69
+ m.displayName = "Alert.DismissButton";
70
+ const W = {
71
+ /**
72
+ * # Alert.Root
73
+ *
74
+ * The root component that provides context and configuration for the alert.
75
+ * Must wrap all alert parts (Title, Description, Actions, DismissButton) to coordinate their behavior.
76
+ *
77
+ * @example
78
+ * ```tsx
79
+ * <Alert.Root tone="info" variant="outlined">
80
+ * <Alert.Title>Title</Alert.Title>
81
+ * <Alert.Description>Description</Alert.Description>
82
+ * </Alert.Root>
83
+ * ```
84
+ */
85
+ Root: n,
86
+ /**
87
+ * # Alert.Title
88
+ *
89
+ * Displays the title text for the alert.
90
+ * Typically shown in bold to provide a clear heading for the alert message.
91
+ *
92
+ * @example
93
+ * ```tsx
94
+ * <Alert.Root tone="critical">
95
+ * <Alert.Title>Error Occurred</Alert.Title>
96
+ * </Alert.Root>
97
+ * ```
98
+ */
99
+ Title: l,
100
+ /**
101
+ * # Alert.Description
102
+ *
103
+ * Displays the descriptive text for the alert.
104
+ * Provides detailed information about the alert's purpose or the action required.
105
+ *
106
+ * @example
107
+ * ```tsx
108
+ * <Alert.Root tone="warning">
109
+ * <Alert.Title>Warning</Alert.Title>
110
+ * <Alert.Description>Please review the following items before proceeding.</Alert.Description>
111
+ * </Alert.Root>
112
+ * ```
113
+ */
114
+ Description: a,
115
+ /**
116
+ * # Alert.Actions
117
+ *
118
+ * Container for action buttons within the alert.
119
+ * Allows users to take actions directly from the alert message.
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * <Alert.Root tone="positive">
124
+ * <Alert.Title>Success</Alert.Title>
125
+ * <Alert.Description>Your changes have been saved.</Alert.Description>
126
+ * <Alert.Actions>
127
+ * <Button>View Details</Button>
128
+ * </Alert.Actions>
129
+ * </Alert.Root>
130
+ * ```
131
+ */
132
+ Actions: c,
133
+ /**
134
+ * # Alert.DismissButton
135
+ *
136
+ * Button to dismiss or close the alert.
137
+ * Provides users with the ability to manually remove the alert from view.
138
+ *
139
+ * @example
140
+ * ```tsx
141
+ * <Alert.Root tone="info">
142
+ * <Alert.Title>Notification</Alert.Title>
143
+ * <Alert.Description>You have new messages.</Alert.Description>
144
+ * <Alert.DismissButton onClick={() => console.log('Dismissed')} />
145
+ * </Alert.Root>
146
+ * ```
147
+ */
148
+ DismissButton: m
149
+ };
150
+ export {
151
+ W as A,
152
+ c as a,
153
+ a as b,
154
+ m as c,
155
+ n as d,
156
+ l as e
157
+ };
158
+ //# sourceMappingURL=alert-Npb00ttk.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-Npb00ttk.es.js","sources":["../../src/components/alert/alert.slots.tsx","../../src/components/alert/components/alert.root.tsx","../../src/components/alert/components/alert.title.tsx","../../src/components/alert/components/alert.description.tsx","../../src/components/alert/components/alert.actions.tsx","../../src/components/alert/intl/en.ts","../../src/components/alert/intl/de.ts","../../src/components/alert/intl/es.ts","../../src/components/alert/intl/fr-FR.ts","../../src/components/alert/intl/pt-BR.ts","../../src/components/alert/alert.messages.ts","../../src/components/alert/components/alert.dismiss-button.tsx","../../src/components/alert/alert.tsx"],"sourcesContent":["import { createSlotRecipeContext } from \"@chakra-ui/react\";\nimport type {\n AlertActionsSlotProps,\n AlertDescriptionProps,\n AlertDismissButtonProps,\n AlertIconSlotProps,\n AlertRootSlotProps,\n AlertTitleProps,\n} from \"./alert.types\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"nimbusAlert\",\n});\n\nexport const AlertRoot = withProvider<HTMLDivElement, AlertRootSlotProps>(\n \"div\",\n \"root\"\n);\n\nexport const AlertTitle = withContext<HTMLDivElement, AlertTitleProps>(\n \"div\",\n \"title\"\n);\n\nexport const AlertDescription = withContext<\n HTMLDivElement,\n AlertDescriptionProps\n>(\"div\", \"description\");\n\nexport const AlertIcon = withContext<HTMLDivElement, AlertIconSlotProps>(\n \"div\",\n \"icon\"\n);\n\nexport const AlertActions = withContext<HTMLDivElement, AlertActionsSlotProps>(\n \"div\",\n \"actions\"\n);\n\n// This is a div wrapper for layout placement - note that we expect it to receive `IconButton` props, but we use a `div`.\n// We then forward the consumer props to the interior `IconButton` component.\nexport const AlertDismissButton = withContext<\n HTMLDivElement,\n AlertDismissButtonProps\n>(\"div\", \"dismissButton\");\n","import { AlertRoot as AlertRootSlot, AlertIcon } from \"../alert.slots\";\nimport type { AlertProps, AlertRootComponent } from \"../alert.types\";\nimport {\n CheckCircleOutline,\n ErrorOutline,\n Info,\n WarningAmber,\n} from \"@commercetools/nimbus-icons\";\n\nconst getIconFromColorPalette = (colorPalette: AlertProps[\"colorPalette\"]) => {\n switch (colorPalette) {\n case \"critical\":\n return <ErrorOutline />;\n case \"info\":\n return <Info />;\n case \"warning\":\n return <WarningAmber />;\n case \"positive\":\n return <CheckCircleOutline />;\n default:\n return null;\n }\n};\n\n/**\n * Alert.Root - Provides feedback to the user about the status of an action or system event\n *\n * @supportsStyleProps\n */\nexport const AlertRoot: AlertRootComponent = (props) => {\n const { ref, children, ...restProps } = props;\n\n return (\n <AlertRootSlot ref={ref} {...restProps} role=\"alert\">\n <AlertIcon alignItems=\"flex-start\">\n {getIconFromColorPalette(restProps.colorPalette)}\n </AlertIcon>\n {children}\n </AlertRootSlot>\n );\n};\n\nAlertRoot.displayName = \"Alert.Root\";\n","import { AlertTitle as AlertTitleSlot } from \"../alert.slots\";\nimport type { AlertTitleProps } from \"../alert.types\";\n\n/**\n * Alert.Title - Displays the title text for the alert\n *\n * @supportsStyleProps\n */\nexport const AlertTitle = ({ children, ...props }: AlertTitleProps) => {\n return (\n <AlertTitleSlot {...props} fontWeight=\"600\">\n {children}\n </AlertTitleSlot>\n );\n};\n\nAlertTitle.displayName = \"Alert.Title\";\n","import { AlertDescription as AlertDescriptionSlot } from \"../alert.slots\";\nimport type { AlertDescriptionProps } from \"../alert.types\";\n\n/**\n * Alert.Description - Displays the description text for the alert\n *\n * @supportsStyleProps\n */\nexport const AlertDescription = ({\n children,\n ...props\n}: AlertDescriptionProps) => {\n return <AlertDescriptionSlot {...props}>{children}</AlertDescriptionSlot>;\n};\n\nAlertDescription.displayName = \"Alert.Description\";\n","import { AlertActions as AlertActionsSlot } from \"../alert.slots\";\nimport type { AlertActionsProps } from \"../alert.types\";\n\n/**\n * Alert.Actions - Container for action buttons within the alert\n *\n * @supportsStyleProps\n */\nexport const AlertActions = ({ children, ...props }: AlertActionsProps) => {\n return <AlertActionsSlot {...props}>{children}</AlertActionsSlot>;\n};\n\nAlertActions.displayName = \"Alert.Actions\";\n","/**\n * Pre-compiled en messages for Alert\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default { dismiss: `Dismiss` };\n","/**\n * Pre-compiled de messages for Alert\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default { dismiss: `Verwerfen` };\n","/**\n * Pre-compiled es messages for Alert\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default { dismiss: `Desechar` };\n","/**\n * Pre-compiled fr-FR messages for Alert\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default { dismiss: `Fermer` };\n","/**\n * Pre-compiled pt-BR messages for Alert\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default { dismiss: `Dispensar` };\n","/**\n * Pre-compiled localized messages for Alert component\n *\n * Generated by scripts/generate-dictionaries.ts\n * DO NOT EDIT MANUALLY\n *\n * @see https://react-spectrum.adobe.com/react-aria/internationalization.html\n */\n\nimport {\n type LocalizedString,\n type LocalizedStrings,\n} from \"@internationalized/string\";\nimport { normalizeMessages } from \"../../utils/normalize-messages\";\n\n// Pre-compiled message functions\nimport alertMessages_en from \"./intl/en\";\nimport alertMessages_de from \"./intl/de\";\nimport alertMessages_es from \"./intl/es\";\nimport alertMessages_fr from \"./intl/fr-FR\";\nimport alertMessages_pt from \"./intl/pt-BR\";\n\n// Raw LocalizedStrings object for use with useLocalizedStringFormatter hook\nexport const alertMessagesStrings: LocalizedStrings<string, LocalizedString> = {\n en: normalizeMessages(alertMessages_en),\n de: normalizeMessages(alertMessages_de),\n es: normalizeMessages(alertMessages_es),\n \"fr-FR\": normalizeMessages(alertMessages_fr),\n \"pt-BR\": normalizeMessages(alertMessages_pt),\n} as LocalizedStrings<string, LocalizedString>;\n\n/**\n * Available message keys for Alert component\n */\nexport type AlertMessageKey = \"dismiss\";\n","import { AlertDismissButton as AlertDismissButtonSlot } from \"../alert.slots\";\nimport type { AlertDismissButtonProps } from \"../alert.types\";\nimport { Clear } from \"@commercetools/nimbus-icons\";\nimport { IconButton } from \"../../icon-button\";\nimport { useLocalizedStringFormatter } from \"@/hooks\";\nimport { alertMessagesStrings } from \"../alert.messages\";\n\n/**\n * Alert.DismissButton - Button to dismiss or close the alert\n *\n * @supportsStyleProps\n */\nexport const AlertDismissButton = ({ ...props }: AlertDismissButtonProps) => {\n const msg = useLocalizedStringFormatter(alertMessagesStrings);\n\n return (\n <AlertDismissButtonSlot>\n <IconButton\n aria-label={msg.format(\"dismiss\")}\n {...props}\n variant=\"ghost\"\n size=\"2xs\"\n >\n <Clear role=\"img\" />\n </IconButton>\n </AlertDismissButtonSlot>\n );\n};\n\nAlertDismissButton.displayName = \"Alert.DismissButton\";\n","import {\n AlertTitle,\n AlertDescription,\n AlertActions,\n AlertDismissButton,\n AlertRoot,\n} from \"./components\";\n\n/**\n * Alert\n * ============================================================\n * Provides feedback to the user about the status of an action or system event\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/feedback/alert}\n *\n * @example\n * ```tsx\n * <Alert.Root tone=\"info\" variant=\"outlined\">\n * <Alert.Title>Information</Alert.Title>\n * <Alert.Description>This is an informational alert message.</Alert.Description>\n * </Alert.Root>\n * ```\n */\nexport const Alert = {\n /**\n * # Alert.Root\n *\n * The root component that provides context and configuration for the alert.\n * Must wrap all alert parts (Title, Description, Actions, DismissButton) to coordinate their behavior.\n *\n * @example\n * ```tsx\n * <Alert.Root tone=\"info\" variant=\"outlined\">\n * <Alert.Title>Title</Alert.Title>\n * <Alert.Description>Description</Alert.Description>\n * </Alert.Root>\n * ```\n */\n Root: AlertRoot,\n /**\n * # Alert.Title\n *\n * Displays the title text for the alert.\n * Typically shown in bold to provide a clear heading for the alert message.\n *\n * @example\n * ```tsx\n * <Alert.Root tone=\"critical\">\n * <Alert.Title>Error Occurred</Alert.Title>\n * </Alert.Root>\n * ```\n */\n Title: AlertTitle,\n /**\n * # Alert.Description\n *\n * Displays the descriptive text for the alert.\n * Provides detailed information about the alert's purpose or the action required.\n *\n * @example\n * ```tsx\n * <Alert.Root tone=\"warning\">\n * <Alert.Title>Warning</Alert.Title>\n * <Alert.Description>Please review the following items before proceeding.</Alert.Description>\n * </Alert.Root>\n * ```\n */\n Description: AlertDescription,\n /**\n * # Alert.Actions\n *\n * Container for action buttons within the alert.\n * Allows users to take actions directly from the alert message.\n *\n * @example\n * ```tsx\n * <Alert.Root tone=\"positive\">\n * <Alert.Title>Success</Alert.Title>\n * <Alert.Description>Your changes have been saved.</Alert.Description>\n * <Alert.Actions>\n * <Button>View Details</Button>\n * </Alert.Actions>\n * </Alert.Root>\n * ```\n */\n Actions: AlertActions,\n /**\n * # Alert.DismissButton\n *\n * Button to dismiss or close the alert.\n * Provides users with the ability to manually remove the alert from view.\n *\n * @example\n * ```tsx\n * <Alert.Root tone=\"info\">\n * <Alert.Title>Notification</Alert.Title>\n * <Alert.Description>You have new messages.</Alert.Description>\n * <Alert.DismissButton onClick={() => console.log('Dismissed')} />\n * </Alert.Root>\n * ```\n */\n DismissButton: AlertDismissButton,\n};\n\n// exports for internal use by react-docgen\nexport {\n AlertRoot as _AlertRoot,\n AlertTitle as _AlertTitle,\n AlertDescription as _AlertDescription,\n AlertActions as _AlertActions,\n AlertDismissButton as _AlertDismissButton,\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","AlertRoot","AlertTitle","AlertDescription","AlertIcon","AlertActions","AlertDismissButton","getIconFromColorPalette","colorPalette","ErrorOutline","Info","WarningAmber","CheckCircleOutline","props","ref","children","restProps","AlertRootSlot","jsx","AlertTitleSlot","AlertDescriptionSlot","AlertActionsSlot","alertMessages_en","alertMessages_de","alertMessages_es","alertMessages_fr","alertMessages_pt","alertMessagesStrings","normalizeMessages","msg","useLocalizedStringFormatter","AlertDismissButtonSlot","IconButton","Clear","Alert"],"mappings":";;;;;AAUA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAEYC,IAAY,gBAAAH;AAAA,EACvB;AAAA,EACA;AACF,GAEaI,IAAa,gBAAAH;AAAA,EACxB;AAAA,EACA;AACF,GAEaI,IAAmB,gBAAAJ,EAG9B,OAAO,aAAa,GAETK,IAAY,gBAAAL;AAAA,EACvB;AAAA,EACA;AACF,GAEaM,IAAe,gBAAAN;AAAA,EAC1B;AAAA,EACA;AACF,GAIaO,IAAqB,gBAAAP,EAGhC,OAAO,eAAe,GCnClBQ,IAA0B,CAACC,MAA6C;AAC5E,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,+BAAQC,GAAA,EAAa;AAAA,IACvB,KAAK;AACH,+BAAQC,GAAA,EAAK;AAAA,IACf,KAAK;AACH,+BAAQC,GAAA,EAAa;AAAA,IACvB,KAAK;AACH,+BAAQC,GAAA,EAAmB;AAAA,IAC7B;AACE,aAAO;AAAA,EAAA;AAEb,GAOaX,IAAgC,CAACY,MAAU;AACtD,QAAM,EAAE,KAAAC,GAAK,UAAAC,GAAU,GAAGC,MAAcH;AAExC,2BACGI,GAAA,EAAc,KAAAH,GAAW,GAAGE,GAAW,MAAK,SAC3C,UAAA;AAAA,IAAA,gBAAAE,EAACd,KAAU,YAAW,cACnB,UAAAG,EAAwBS,EAAU,YAAY,GACjD;AAAA,IACCD;AAAA,EAAA,GACH;AAEJ;AAEAd,EAAU,cA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAenB,MAAMjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcN,OAAOC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeP,aAAaC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBb,SAASE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBT,eAAeC;AACjB;"}
@@ -1,2 +1,2 @@
1
- "use strict";const s=require("react/jsx-runtime"),F=require("./normalize-messages-DtVffO09.cjs.js"),E=require("./money-input-DaAN91Cb.cjs.js"),v=require("./form-field-MU91QwOC.cjs.js"),_=require("react"),ne=require("./Dialog-B64GoQlm.cjs.js"),xe=require("./CollectionBuilder-CCexRz-1.cjs.js"),I=require("@commercetools/nimbus-icons"),he=require("./popover-T_D2VVND.cjs.js"),pe=require("@chakra-ui/react"),N=require("./icon-Ep1rnhRT.cjs.js"),Fe=require("./rich-text-input-m4_Uz1tN.cjs.js"),fe=require("./multiline-text-input-COs7r-ny.cjs.js"),be=require("./text-input-BcnTka1I.cjs.js"),re=require("./mergeProps-DD8aR8go.cjs.js"),je=require("./useField-DOT9H5ld.cjs.js"),oe=require("./field-errors-C8G94e3K.cjs.js"),D=require("./stack-CIN13EDn.cjs.js"),Le=require("./icon-button-CVdz2C9L.cjs.js"),te=require("./box-CWni3A32.cjs.js"),ve=require("./button-CkOEhYmQ.cjs.js"),Ie={hideCurrencies:"Hide all currencies",hideLanguages:"Hide all languages",infoBoxTriggerAriaLabel:"more info",missingRequiredField:"This field is required. Provide at least one value.",showCurrencies:"Show all currencies",showLanguages:"Show all languages"},Me={hideCurrencies:"Alle Währungen ausblenden",hideLanguages:"Alle Sprachen ausblenden",infoBoxTriggerAriaLabel:"Weitere Informationen",missingRequiredField:"Dies ist ein Pflichtfeld. Bitte geben Sie mindestens einen Wert an.",showCurrencies:"Alle Währungen anzeigen",showLanguages:"Alle Sprachen anzeigen"},qe={hideCurrencies:"Ocultar todas las monedas",hideLanguages:"Ocultar todas las monedas",infoBoxTriggerAriaLabel:"más información",missingRequiredField:"Este valor es necesario. Proporciona al menos un valor.",showCurrencies:"Mostrar todas las monedas",showLanguages:"Mostrar todos los idiomas"},ze={hideCurrencies:"Masquer toutes les devises",hideLanguages:"Masquer toutes les langues",infoBoxTriggerAriaLabel:"Plus d'informations",missingRequiredField:"Ce champ est requis. Indiquez au moins une valeur.",showCurrencies:"Afficher toutes les devises",showLanguages:"Afficher toutes les langues"},Ce={hideCurrencies:"Ocultar todas as ocorrências",hideLanguages:"Ocultar todos os idiomas",infoBoxTriggerAriaLabel:"mais informações",missingRequiredField:"Este campo é obrigatório. Forneça pelo menos um valor.",showCurrencies:"Mostrar todas as ocorrências",showLanguages:"Mostrar todos os idiomas"},ie={en:F.normalizeMessages(Ie),de:F.normalizeMessages(Me),es:F.normalizeMessages(qe),"fr-FR":F.normalizeMessages(ze),"pt-BR":F.normalizeMessages(Ce)},{withProvider:$e,withContext:m}=pe.createSlotRecipeContext({key:"nimbusLocalizedField"}),Se=$e("fieldset","root"),we=m("legend","label"),Ee=m("div","infoDialog"),ke=m("div","fieldsContainer"),Te=m("div","description"),Pe=m("div","error"),ye=m("div","toggleButtonContainer"),Ae=m("div","localeFieldRoot"),Be=m("div","localeFieldLabel"),Re=m("div","localeFieldInput"),He=()=>{const e=F.useLocalizedStringFormatter(ie);return s.jsx(v.FormField.Error,{children:e.format("missingRequiredField")})},f=(e,n)=>e&&n?`${e}.${n}`:void 0,W=e=>e.split("-")[0],Ve=(e,n)=>{const r=W(e),o=n.filter(l=>W(l)===r);return{unrelated:n.filter(l=>W(l)!==r),related:o}},De=(e,n)=>{const{related:r,unrelated:o}=Ve(e,n.filter(t=>t!==e));return[e,...r.sort(),...o.sort()]},We=(e,n)=>{const r=n.filter(o=>o!==e);return[e,...r.sort()]},_e=(e,n)=>e&&Object.keys(e).length>0&&n?Object.keys(e).some(r=>r!==n):!1,Ne=(e,n)=>Array.from(new Set([...e,...Object.keys(n)])).reduce((o,t)=>({...o,[t]:n?.[t]||""}),{}),Oe=e=>e?Object.values(e).every(n=>!n||n?.trim().length===0):!0,Ue=e=>(typeof e!="object"&&console.warn("Nimbus Localized Field - Warning: omitEmptyTranslations must be called with an object"),Object.entries(e).reduce((n,[r,o])=>o&&o.trim().length>0?{...n,[r]:o}:n,{})),Je=e=>e?Object.values(e).some(Boolean):!1;function Qe(e){return e}const Xe=(e,n)=>Object.values(e).map(r=>E.MoneyInput.convertToMoneyValue(r,n)),Ye=(e=[],n)=>e.reduce((r,o)=>{const t=E.MoneyInput.parseMoneyValue(o,n);return{...r,[t.currencyCode]:t}},{}),Ze=(e,n)=>Object.keys(e).filter(o=>E.MoneyInput.isHighPrecision(e[o],n)),Ge=e=>Object.keys(e).filter(r=>E.MoneyInput.isEmpty(e[r])),Ke=({type:e,size:n,localeOrCurrency:r,id:o,name:t,inputValue:l,description:M,warning:x,error:h,onChange:b,onBlur:q,onFocus:z,isRequired:C,isReadOnly:p,isDisabled:j,isInvalid:L,touched:a,...y})=>{let i;switch(e){case"text":default:i=be.TextInput;break;case"multiLine":i=fe.MultilineTextInput;break;case"money":i=E.MoneyInput;break;case"richText":i=Fe.RichTextInput;break}const $=e==="money"?l||{amount:"",currencyCode:r}:l||"",T=_.useCallback(d=>{const A={target:typeof d=="object"?{id:d.target.id,name:d.target.name,locale:void 0,currency:r,value:d.target.value}:{id:o,name:t,locale:r,currency:void 0,value:d}};b(A)},[o,t,r,b]);return s.jsx(Ae,{asChild:!0,children:s.jsxs(v.FormField.Root,{isDisabled:j,isReadOnly:p,isInvalid:(L||!!h)&&a,direction:"row",size:n,id:o,children:[s.jsx(Be,{display:e==="money"?"none":void 0,...j&&{"data-disabled":j},asChild:!0,children:s.jsx(v.FormField.Label,{children:r.toLocaleUpperCase()})}),s.jsx(v.FormField.Input,{children:s.jsx(Re,{"aria-required":C,asChild:!0,children:s.jsx(i,{...y,size:n,value:$,onChange:T,onBlur:d=>q?.(d,r),onFocus:d=>z?.(d,r),isRequired:C,isDisabled:j,isReadOnly:p,isInvalid:(L||!!h)&&a})})}),(M||x&&a)&&s.jsx(v.FormField.Description,{role:x&&a?"status":void 0,color:x&&a?"warning.11":void 0,display:"flex",gap:"100",alignItems:"center",children:x&&a?s.jsxs(s.Fragment,{children:[s.jsx(N.Icon,{colorPalette:"warning",children:s.jsx(I.WarningAmber,{})}),x]}):M}),h&&a&&s.jsx(v.FormField.Error,{children:h})]})})},es=({type:e="text",id:n,name:r,defaultLocaleOrCurrency:o,valuesByLocaleOrCurrency:t,placeholdersByLocaleOrCurrency:l,descriptionsByLocaleOrCurrency:M,warningsByLocaleOrCurrency:x,errorsByLocaleOrCurrency:h,label:b,hint:q,description:z,warning:C,warnings:p,renderWarning:j,error:L,errors:a,renderError:y,touched:i,isRequired:k,isDisabled:$,isReadOnly:T,onChange:d,onBlur:O,onFocus:A,defaultExpanded:ae=!1,displayAllLocalesOrCurrencies:U=!1,size:J,autoFocus:Q,["data-track-component"]:le,["data-testid"]:de,["data-test"]:ce,...ue})=>{const[c,X]=_.useState(U||ae),S=F.useLocalizedStringFormatter(ie),Y=re.$bdb11010cef70236$export$f680877a34711e37(),Z=re.$bdb11010cef70236$export$f680877a34711e37(),B=!!(L||a&&Object.values(a).some(u=>u===!0)),w=!!(C||p&&Object.values(p).some(Boolean)),P=!!(B&&i),{labelProps:G,fieldProps:K,descriptionProps:R,errorMessageProps:H}=je.$2baaea4c71418dea$export$294aa081a6c6f55d({id:n,label:b,description:z,errorMessage:L,isInvalid:P}),V=Object.keys(t),ge=_.useMemo(()=>(e==="money"?We(o,V):De(o,V)).reduce((se,g)=>{const me={localeOrCurrency:g,inputValue:t[g],placeholder:l?.[g],description:M?.[g],warning:x?.[g],error:h?.[g],...g===o&&Q?{autoFocus:Q}:{},isInvalid:P,isRequired:k,isDisabled:$,isReadOnly:T};return c||!c&&g===o?[...se,me]:se},[]),[t,l,M,x,h,o,c,P,k,$,T]),ee=(_e(h,o)||B)&&i;return ee&&!c&&X(!0),s.jsxs(Se,{...ue,...K,"aria-details":q?Z:void 0,type:e,size:J,name:r,children:[b&&s.jsxs(D.Stack,{direction:"row",gap:"0",children:[s.jsxs(we,{...G,children:[b,k&&s.jsx("sup",{"aria-hidden":"true",children:"*"})]}),q&&s.jsxs(ne.$de32f1b87079253c$export$2e1e1122cf0cba88,{children:[s.jsx(Le.IconButton,{id:Z,"aria-label":S.format("infoBoxTriggerAriaLabel"),size:"2xs",colorPalette:"info",variant:"link",children:s.jsx(I.HelpOutline,{})}),s.jsx(he.Popover,{padding:0,children:s.jsx(Ee,{asChild:!0,children:s.jsx(ne.$de32f1b87079253c$export$3ddf2d174ce01153,{children:s.jsx(te.Box,{p:"300",children:q})})})})]})]}),s.jsx(ke,{id:Y,"data-expanded":c,children:s.jsx(xe.$e1995378a142960e$export$fb8073518f34e6ec,{items:ge,children:u=>s.jsx(Ke,{...u,size:J,type:e,onChange:d,onBlur:O,onFocus:A,touched:i,id:f(K.id,u.localeOrCurrency),name:f(r,u.localeOrCurrency),"data-test":f(ce,u.localeOrCurrency),"data-testid":f(de,u.localeOrCurrency),"data-track-component":f(le,u.localeOrCurrency)})})}),!U&&V.length>1&&s.jsx(ye,{children:s.jsxs(ve.Button,{"aria-controls":Y,"aria-describedby":G.id,"aria-expanded":c,onPress:()=>X(!c),isDisabled:$||ee&&c,variant:"ghost",size:"2xs",colorPalette:"primary",children:[s.jsx(te.Box,{as:e==="money"?I.Payments:I.Language,display:"inline-flex",boxSize:"400",verticalAlign:"text-bottom",mr:"100"}),e==="money"?c?S.format("hideCurrencies"):S.format("showCurrencies"):c?S.format("hideLanguages"):S.format("showLanguages")]})}),(z||w&&i)&&s.jsx(Te,{role:w&&i?"status":void 0,color:w&&i?"warning.11":void 0,"aria-labelledby":`${R.id}-warning`,...R,children:w&&i?s.jsxs(s.Fragment,{children:[s.jsx(N.Icon,{colorPalette:"warning",children:s.jsx(I.WarningAmber,{})}),s.jsxs(D.Stack,{gap:"0",id:`${R.id}-warning`,children:[C,p&&w&&s.jsx(oe.FieldErrors,{errors:p,renderError:j,colorPalette:"warning",role:void 0})]})]}):z}),P&&s.jsxs(Pe,{"aria-labelledby":`${H.id}-error`,role:"alert",...H,children:[s.jsx(N.Icon,{children:s.jsx(I.ErrorOutline,{})}),s.jsxs(D.Stack,{gap:"0",id:`${H.id}-error`,children:[L,a&&B&&s.jsx(oe.FieldErrors,{errors:a,renderError:y,role:void 0})]})]})]})},ss=Object.assign(es,{getId:f,getName:f,isTouched:Je,isEmpty:Oe,createLocalizedString:Ne,omitEmptyTranslations:Ue,RequiredValueErrorMessage:He,toFieldErrors:Qe,convertToMoneyValues:Xe,parseMoneyValues:Ye,getHighPrecisionCurrencies:Ze,getEmptyCurrencies:Ge});exports.LocalizedField=ss;
2
- //# sourceMappingURL=localized-field-rZG712BE.cjs.js.map
1
+ "use strict";const s=require("react/jsx-runtime"),F=require("./normalize-messages-DtVffO09.cjs.js"),E=require("./money-input-DaAN91Cb.cjs.js"),v=require("./form-field-MU91QwOC.cjs.js"),_=require("react"),ne=require("./Dialog-B64GoQlm.cjs.js"),xe=require("./CollectionBuilder-CCexRz-1.cjs.js"),I=require("@commercetools/nimbus-icons"),he=require("./popover-T_D2VVND.cjs.js"),pe=require("@chakra-ui/react"),N=require("./icon-Ep1rnhRT.cjs.js"),Fe=require("./rich-text-input-m4_Uz1tN.cjs.js"),fe=require("./multiline-text-input-COs7r-ny.cjs.js"),be=require("./text-input-B1upLZxw.cjs.js"),re=require("./mergeProps-DD8aR8go.cjs.js"),je=require("./useField-DOT9H5ld.cjs.js"),oe=require("./field-errors-C8G94e3K.cjs.js"),D=require("./stack-CIN13EDn.cjs.js"),Le=require("./icon-button-CVdz2C9L.cjs.js"),te=require("./box-CWni3A32.cjs.js"),ve=require("./button-CkOEhYmQ.cjs.js"),Ie={hideCurrencies:"Hide all currencies",hideLanguages:"Hide all languages",infoBoxTriggerAriaLabel:"more info",missingRequiredField:"This field is required. Provide at least one value.",showCurrencies:"Show all currencies",showLanguages:"Show all languages"},Me={hideCurrencies:"Alle Währungen ausblenden",hideLanguages:"Alle Sprachen ausblenden",infoBoxTriggerAriaLabel:"Weitere Informationen",missingRequiredField:"Dies ist ein Pflichtfeld. Bitte geben Sie mindestens einen Wert an.",showCurrencies:"Alle Währungen anzeigen",showLanguages:"Alle Sprachen anzeigen"},qe={hideCurrencies:"Ocultar todas las monedas",hideLanguages:"Ocultar todas las monedas",infoBoxTriggerAriaLabel:"más información",missingRequiredField:"Este valor es necesario. Proporciona al menos un valor.",showCurrencies:"Mostrar todas las monedas",showLanguages:"Mostrar todos los idiomas"},ze={hideCurrencies:"Masquer toutes les devises",hideLanguages:"Masquer toutes les langues",infoBoxTriggerAriaLabel:"Plus d'informations",missingRequiredField:"Ce champ est requis. Indiquez au moins une valeur.",showCurrencies:"Afficher toutes les devises",showLanguages:"Afficher toutes les langues"},Ce={hideCurrencies:"Ocultar todas as ocorrências",hideLanguages:"Ocultar todos os idiomas",infoBoxTriggerAriaLabel:"mais informações",missingRequiredField:"Este campo é obrigatório. Forneça pelo menos um valor.",showCurrencies:"Mostrar todas as ocorrências",showLanguages:"Mostrar todos os idiomas"},ie={en:F.normalizeMessages(Ie),de:F.normalizeMessages(Me),es:F.normalizeMessages(qe),"fr-FR":F.normalizeMessages(ze),"pt-BR":F.normalizeMessages(Ce)},{withProvider:$e,withContext:m}=pe.createSlotRecipeContext({key:"nimbusLocalizedField"}),Se=$e("fieldset","root"),we=m("legend","label"),Ee=m("div","infoDialog"),ke=m("div","fieldsContainer"),Te=m("div","description"),Pe=m("div","error"),ye=m("div","toggleButtonContainer"),Ae=m("div","localeFieldRoot"),Be=m("div","localeFieldLabel"),Re=m("div","localeFieldInput"),He=()=>{const e=F.useLocalizedStringFormatter(ie);return s.jsx(v.FormField.Error,{children:e.format("missingRequiredField")})},f=(e,n)=>e&&n?`${e}.${n}`:void 0,W=e=>e.split("-")[0],Ve=(e,n)=>{const r=W(e),o=n.filter(l=>W(l)===r);return{unrelated:n.filter(l=>W(l)!==r),related:o}},De=(e,n)=>{const{related:r,unrelated:o}=Ve(e,n.filter(t=>t!==e));return[e,...r.sort(),...o.sort()]},We=(e,n)=>{const r=n.filter(o=>o!==e);return[e,...r.sort()]},_e=(e,n)=>e&&Object.keys(e).length>0&&n?Object.keys(e).some(r=>r!==n):!1,Ne=(e,n)=>Array.from(new Set([...e,...Object.keys(n)])).reduce((o,t)=>({...o,[t]:n?.[t]||""}),{}),Oe=e=>e?Object.values(e).every(n=>!n||n?.trim().length===0):!0,Ue=e=>(typeof e!="object"&&console.warn("Nimbus Localized Field - Warning: omitEmptyTranslations must be called with an object"),Object.entries(e).reduce((n,[r,o])=>o&&o.trim().length>0?{...n,[r]:o}:n,{})),Je=e=>e?Object.values(e).some(Boolean):!1;function Qe(e){return e}const Xe=(e,n)=>Object.values(e).map(r=>E.MoneyInput.convertToMoneyValue(r,n)),Ye=(e=[],n)=>e.reduce((r,o)=>{const t=E.MoneyInput.parseMoneyValue(o,n);return{...r,[t.currencyCode]:t}},{}),Ze=(e,n)=>Object.keys(e).filter(o=>E.MoneyInput.isHighPrecision(e[o],n)),Ge=e=>Object.keys(e).filter(r=>E.MoneyInput.isEmpty(e[r])),Ke=({type:e,size:n,localeOrCurrency:r,id:o,name:t,inputValue:l,description:M,warning:x,error:h,onChange:b,onBlur:q,onFocus:z,isRequired:C,isReadOnly:p,isDisabled:j,isInvalid:L,touched:a,...y})=>{let i;switch(e){case"text":default:i=be.TextInput;break;case"multiLine":i=fe.MultilineTextInput;break;case"money":i=E.MoneyInput;break;case"richText":i=Fe.RichTextInput;break}const $=e==="money"?l||{amount:"",currencyCode:r}:l||"",T=_.useCallback(d=>{const A={target:typeof d=="object"?{id:d.target.id,name:d.target.name,locale:void 0,currency:r,value:d.target.value}:{id:o,name:t,locale:r,currency:void 0,value:d}};b(A)},[o,t,r,b]);return s.jsx(Ae,{asChild:!0,children:s.jsxs(v.FormField.Root,{isDisabled:j,isReadOnly:p,isInvalid:(L||!!h)&&a,direction:"row",size:n,id:o,children:[s.jsx(Be,{display:e==="money"?"none":void 0,...j&&{"data-disabled":j},asChild:!0,children:s.jsx(v.FormField.Label,{children:r.toLocaleUpperCase()})}),s.jsx(v.FormField.Input,{children:s.jsx(Re,{"aria-required":C,asChild:!0,children:s.jsx(i,{...y,size:n,value:$,onChange:T,onBlur:d=>q?.(d,r),onFocus:d=>z?.(d,r),isRequired:C,isDisabled:j,isReadOnly:p,isInvalid:(L||!!h)&&a})})}),(M||x&&a)&&s.jsx(v.FormField.Description,{role:x&&a?"status":void 0,color:x&&a?"warning.11":void 0,display:"flex",gap:"100",alignItems:"center",children:x&&a?s.jsxs(s.Fragment,{children:[s.jsx(N.Icon,{colorPalette:"warning",children:s.jsx(I.WarningAmber,{})}),x]}):M}),h&&a&&s.jsx(v.FormField.Error,{children:h})]})})},es=({type:e="text",id:n,name:r,defaultLocaleOrCurrency:o,valuesByLocaleOrCurrency:t,placeholdersByLocaleOrCurrency:l,descriptionsByLocaleOrCurrency:M,warningsByLocaleOrCurrency:x,errorsByLocaleOrCurrency:h,label:b,hint:q,description:z,warning:C,warnings:p,renderWarning:j,error:L,errors:a,renderError:y,touched:i,isRequired:k,isDisabled:$,isReadOnly:T,onChange:d,onBlur:O,onFocus:A,defaultExpanded:ae=!1,displayAllLocalesOrCurrencies:U=!1,size:J,autoFocus:Q,["data-track-component"]:le,["data-testid"]:de,["data-test"]:ce,...ue})=>{const[c,X]=_.useState(U||ae),S=F.useLocalizedStringFormatter(ie),Y=re.$bdb11010cef70236$export$f680877a34711e37(),Z=re.$bdb11010cef70236$export$f680877a34711e37(),B=!!(L||a&&Object.values(a).some(u=>u===!0)),w=!!(C||p&&Object.values(p).some(Boolean)),P=!!(B&&i),{labelProps:G,fieldProps:K,descriptionProps:R,errorMessageProps:H}=je.$2baaea4c71418dea$export$294aa081a6c6f55d({id:n,label:b,description:z,errorMessage:L,isInvalid:P}),V=Object.keys(t),ge=_.useMemo(()=>(e==="money"?We(o,V):De(o,V)).reduce((se,g)=>{const me={localeOrCurrency:g,inputValue:t[g],placeholder:l?.[g],description:M?.[g],warning:x?.[g],error:h?.[g],...g===o&&Q?{autoFocus:Q}:{},isInvalid:P,isRequired:k,isDisabled:$,isReadOnly:T};return c||!c&&g===o?[...se,me]:se},[]),[t,l,M,x,h,o,c,P,k,$,T]),ee=(_e(h,o)||B)&&i;return ee&&!c&&X(!0),s.jsxs(Se,{...ue,...K,"aria-details":q?Z:void 0,type:e,size:J,name:r,children:[b&&s.jsxs(D.Stack,{direction:"row",gap:"0",children:[s.jsxs(we,{...G,children:[b,k&&s.jsx("sup",{"aria-hidden":"true",children:"*"})]}),q&&s.jsxs(ne.$de32f1b87079253c$export$2e1e1122cf0cba88,{children:[s.jsx(Le.IconButton,{id:Z,"aria-label":S.format("infoBoxTriggerAriaLabel"),size:"2xs",colorPalette:"info",variant:"link",children:s.jsx(I.HelpOutline,{})}),s.jsx(he.Popover,{padding:0,children:s.jsx(Ee,{asChild:!0,children:s.jsx(ne.$de32f1b87079253c$export$3ddf2d174ce01153,{children:s.jsx(te.Box,{p:"300",children:q})})})})]})]}),s.jsx(ke,{id:Y,"data-expanded":c,children:s.jsx(xe.$e1995378a142960e$export$fb8073518f34e6ec,{items:ge,children:u=>s.jsx(Ke,{...u,size:J,type:e,onChange:d,onBlur:O,onFocus:A,touched:i,id:f(K.id,u.localeOrCurrency),name:f(r,u.localeOrCurrency),"data-test":f(ce,u.localeOrCurrency),"data-testid":f(de,u.localeOrCurrency),"data-track-component":f(le,u.localeOrCurrency)})})}),!U&&V.length>1&&s.jsx(ye,{children:s.jsxs(ve.Button,{"aria-controls":Y,"aria-describedby":G.id,"aria-expanded":c,onPress:()=>X(!c),isDisabled:$||ee&&c,variant:"ghost",size:"2xs",colorPalette:"primary",children:[s.jsx(te.Box,{as:e==="money"?I.Payments:I.Language,display:"inline-flex",boxSize:"400",verticalAlign:"text-bottom",mr:"100"}),e==="money"?c?S.format("hideCurrencies"):S.format("showCurrencies"):c?S.format("hideLanguages"):S.format("showLanguages")]})}),(z||w&&i)&&s.jsx(Te,{role:w&&i?"status":void 0,color:w&&i?"warning.11":void 0,"aria-labelledby":`${R.id}-warning`,...R,children:w&&i?s.jsxs(s.Fragment,{children:[s.jsx(N.Icon,{colorPalette:"warning",children:s.jsx(I.WarningAmber,{})}),s.jsxs(D.Stack,{gap:"0",id:`${R.id}-warning`,children:[C,p&&w&&s.jsx(oe.FieldErrors,{errors:p,renderError:j,colorPalette:"warning",role:void 0})]})]}):z}),P&&s.jsxs(Pe,{"aria-labelledby":`${H.id}-error`,role:"alert",...H,children:[s.jsx(N.Icon,{children:s.jsx(I.ErrorOutline,{})}),s.jsxs(D.Stack,{gap:"0",id:`${H.id}-error`,children:[L,a&&B&&s.jsx(oe.FieldErrors,{errors:a,renderError:y,role:void 0})]})]})]})},ss=Object.assign(es,{getId:f,getName:f,isTouched:Je,isEmpty:Oe,createLocalizedString:Ne,omitEmptyTranslations:Ue,RequiredValueErrorMessage:He,toFieldErrors:Qe,convertToMoneyValues:Xe,parseMoneyValues:Ye,getHighPrecisionCurrencies:Ze,getEmptyCurrencies:Ge});exports.LocalizedField=ss;
2
+ //# sourceMappingURL=localized-field-CCpAn8pz.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"localized-field-rZG712BE.cjs.js","sources":["../../src/components/localized-field/intl/en.ts","../../src/components/localized-field/intl/de.ts","../../src/components/localized-field/intl/es.ts","../../src/components/localized-field/intl/fr-FR.ts","../../src/components/localized-field/intl/pt-BR.ts","../../src/components/localized-field/localized-field.messages.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":["/**\n * Pre-compiled en messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Hide all currencies`,\n hideLanguages: `Hide all languages`,\n infoBoxTriggerAriaLabel: `more info`,\n missingRequiredField: `This field is required. Provide at least one value.`,\n showCurrencies: `Show all currencies`,\n showLanguages: `Show all languages`,\n};\n","/**\n * Pre-compiled de messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Alle Währungen ausblenden`,\n hideLanguages: `Alle Sprachen ausblenden`,\n infoBoxTriggerAriaLabel: `Weitere Informationen`,\n missingRequiredField: `Dies ist ein Pflichtfeld. Bitte geben Sie mindestens einen Wert an.`,\n showCurrencies: `Alle Währungen anzeigen`,\n showLanguages: `Alle Sprachen anzeigen`,\n};\n","/**\n * Pre-compiled es messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Ocultar todas las monedas`,\n hideLanguages: `Ocultar todas las monedas`,\n infoBoxTriggerAriaLabel: `más información`,\n missingRequiredField: `Este valor es necesario. Proporciona al menos un valor.`,\n showCurrencies: `Mostrar todas las monedas`,\n showLanguages: `Mostrar todos los idiomas`,\n};\n","/**\n * Pre-compiled fr-FR messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Masquer toutes les devises`,\n hideLanguages: `Masquer toutes les langues`,\n infoBoxTriggerAriaLabel: `Plus d'informations`,\n missingRequiredField: `Ce champ est requis. Indiquez au moins une valeur.`,\n showCurrencies: `Afficher toutes les devises`,\n showLanguages: `Afficher toutes les langues`,\n};\n","/**\n * Pre-compiled pt-BR messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Ocultar todas as ocorrências`,\n hideLanguages: `Ocultar todos os idiomas`,\n infoBoxTriggerAriaLabel: `mais informações`,\n missingRequiredField: `Este campo é obrigatório. Forneça pelo menos um valor.`,\n showCurrencies: `Mostrar todas as ocorrências`,\n showLanguages: `Mostrar todos os idiomas`,\n};\n","/**\n * Pre-compiled localized messages for LocalizedField component\n *\n * Generated by scripts/generate-dictionaries.ts\n * DO NOT EDIT MANUALLY\n *\n * @see https://react-spectrum.adobe.com/react-aria/internationalization.html\n */\n\nimport {\n type LocalizedString,\n type LocalizedStrings,\n} from \"@internationalized/string\";\nimport { normalizeMessages } from \"../../utils/normalize-messages\";\n\n// Pre-compiled message functions\nimport localizedFieldMessages_en from \"./intl/en\";\nimport localizedFieldMessages_de from \"./intl/de\";\nimport localizedFieldMessages_es from \"./intl/es\";\nimport localizedFieldMessages_fr from \"./intl/fr-FR\";\nimport localizedFieldMessages_pt from \"./intl/pt-BR\";\n\n// Raw LocalizedStrings object for use with useLocalizedStringFormatter hook\nexport const localizedFieldMessagesStrings: LocalizedStrings<\n string,\n LocalizedString\n> = {\n en: normalizeMessages(localizedFieldMessages_en),\n de: normalizeMessages(localizedFieldMessages_de),\n es: normalizeMessages(localizedFieldMessages_es),\n \"fr-FR\": normalizeMessages(localizedFieldMessages_fr),\n \"pt-BR\": normalizeMessages(localizedFieldMessages_pt),\n} as LocalizedStrings<string, LocalizedString>;\n\n/**\n * Available message keys for LocalizedField component\n */\nexport type LocalizedFieldMessageKey =\n | \"hideCurrencies\"\n | \"hideLanguages\"\n | \"infoBoxTriggerAriaLabel\"\n | \"missingRequiredField\"\n | \"showCurrencies\"\n | \"showLanguages\";\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: \"nimbusLocalizedField\",\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 {\n FormField,\n type CurrencyCode,\n type MoneyInputValue,\n type MoneyValue,\n type FieldErrorsData,\n MoneyInput,\n} from \"@/components\";\nimport { useLocalizedStringFormatter } from \"@/hooks\";\nimport { localizedFieldMessagesStrings } from \"../localized-field.messages\";\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 const msg = useLocalizedStringFormatter(localizedFieldMessagesStrings);\n return (\n <FormField.Error>{msg.format(\"missingRequiredField\")}</FormField.Error>\n );\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 {\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 { useLocalizedStringFormatter } from \"@/hooks\";\nimport { localizedFieldMessagesStrings } from \"../localized-field.messages\";\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 msg = useLocalizedStringFormatter(localizedFieldMessagesStrings);\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={msg.format(\"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 ? msg.format(\"hideCurrencies\")\n : msg.format(\"showCurrencies\")\n : expanded\n ? msg.format(\"hideLanguages\")\n : msg.format(\"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":["localizedFieldMessages_en","localizedFieldMessages_de","localizedFieldMessages_es","localizedFieldMessages_fr","localizedFieldMessages_pt","localizedFieldMessagesStrings","normalizeMessages","withProvider","withContext","createSlotRecipeContext","LocalizedFieldRootSlot","LocalizedFieldLabelSlot","LocalizedFieldInfoDialogSlot","LocalizedFieldFieldsContainerSlot","LocalizedFieldDescriptionSlot","LocalizedFieldErrorSlot","LocalizedFieldToggleButtonContainerSlot","LocalizedFieldLocaleFieldRootSlot","LocalizedFieldLocaleFieldLabelSlot","LocalizedFieldLocaleFieldInputSlot","RequiredValueErrorMessage","msg","useLocalizedStringFormatter","FormField","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","jsx","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","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":"s2BAMAA,GAAe,CACb,eAAgB,sBAChB,cAAe,qBACf,wBAAyB,YACzB,qBAAsB,sDACtB,eAAgB,sBAChB,cAAe,oBACjB,ECPAC,GAAe,CACb,eAAgB,4BAChB,cAAe,2BACf,wBAAyB,wBACzB,qBAAsB,sEACtB,eAAgB,0BAChB,cAAe,wBACjB,ECPAC,GAAe,CACb,eAAgB,4BAChB,cAAe,4BACf,wBAAyB,kBACzB,qBAAsB,0DACtB,eAAgB,4BAChB,cAAe,2BACjB,ECPAC,GAAe,CACb,eAAgB,6BAChB,cAAe,6BACf,wBAAyB,sBACzB,qBAAs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AGT,EAAkB,EAAE,SACvC,SAAA,CAAApD,EACA/B,GAAU8E,GACT9B,EAAAA,IAACwD,GAAAA,YAAA,CACC,OAAAxG,EACA,YAAAgE,EACA,KAAM,MAAA,CAAA,CACR,CAAA,CAEJ,CAAA,CAAA,CAAA,CACF,CAAA,CAAA,CAIR,ECrUaV,GAAiB,OAAO,OAAOoD,GAAoB,CAE9D,MAAO5H,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
+ {"version":3,"file":"localized-field-CCpAn8pz.cjs.js","sources":["../../src/components/localized-field/intl/en.ts","../../src/components/localized-field/intl/de.ts","../../src/components/localized-field/intl/es.ts","../../src/components/localized-field/intl/fr-FR.ts","../../src/components/localized-field/intl/pt-BR.ts","../../src/components/localized-field/localized-field.messages.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":["/**\n * Pre-compiled en messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Hide all currencies`,\n hideLanguages: `Hide all languages`,\n infoBoxTriggerAriaLabel: `more info`,\n missingRequiredField: `This field is required. Provide at least one value.`,\n showCurrencies: `Show all currencies`,\n showLanguages: `Show all languages`,\n};\n","/**\n * Pre-compiled de messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Alle Währungen ausblenden`,\n hideLanguages: `Alle Sprachen ausblenden`,\n infoBoxTriggerAriaLabel: `Weitere Informationen`,\n missingRequiredField: `Dies ist ein Pflichtfeld. Bitte geben Sie mindestens einen Wert an.`,\n showCurrencies: `Alle Währungen anzeigen`,\n showLanguages: `Alle Sprachen anzeigen`,\n};\n","/**\n * Pre-compiled es messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Ocultar todas las monedas`,\n hideLanguages: `Ocultar todas las monedas`,\n infoBoxTriggerAriaLabel: `más información`,\n missingRequiredField: `Este valor es necesario. Proporciona al menos un valor.`,\n showCurrencies: `Mostrar todas las monedas`,\n showLanguages: `Mostrar todos los idiomas`,\n};\n","/**\n * Pre-compiled fr-FR messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Masquer toutes les devises`,\n hideLanguages: `Masquer toutes les langues`,\n infoBoxTriggerAriaLabel: `Plus d'informations`,\n missingRequiredField: `Ce champ est requis. Indiquez au moins une valeur.`,\n showCurrencies: `Afficher toutes les devises`,\n showLanguages: `Afficher toutes les langues`,\n};\n","/**\n * Pre-compiled pt-BR messages for LocalizedField\n * Generated by @internationalized/string-compiler\n * DO NOT EDIT MANUALLY\n */\n\nexport default {\n hideCurrencies: `Ocultar todas as ocorrências`,\n hideLanguages: `Ocultar todos os idiomas`,\n infoBoxTriggerAriaLabel: `mais informações`,\n missingRequiredField: `Este campo é obrigatório. Forneça pelo menos um valor.`,\n showCurrencies: `Mostrar todas as ocorrências`,\n showLanguages: `Mostrar todos os idiomas`,\n};\n","/**\n * Pre-compiled localized messages for LocalizedField component\n *\n * Generated by scripts/generate-dictionaries.ts\n * DO NOT EDIT MANUALLY\n *\n * @see https://react-spectrum.adobe.com/react-aria/internationalization.html\n */\n\nimport {\n type LocalizedString,\n type LocalizedStrings,\n} from \"@internationalized/string\";\nimport { normalizeMessages } from \"../../utils/normalize-messages\";\n\n// Pre-compiled message functions\nimport localizedFieldMessages_en from \"./intl/en\";\nimport localizedFieldMessages_de from \"./intl/de\";\nimport localizedFieldMessages_es from \"./intl/es\";\nimport localizedFieldMessages_fr from \"./intl/fr-FR\";\nimport localizedFieldMessages_pt from \"./intl/pt-BR\";\n\n// Raw LocalizedStrings object for use with useLocalizedStringFormatter hook\nexport const localizedFieldMessagesStrings: LocalizedStrings<\n string,\n LocalizedString\n> = {\n en: normalizeMessages(localizedFieldMessages_en),\n de: normalizeMessages(localizedFieldMessages_de),\n es: normalizeMessages(localizedFieldMessages_es),\n \"fr-FR\": normalizeMessages(localizedFieldMessages_fr),\n \"pt-BR\": normalizeMessages(localizedFieldMessages_pt),\n} as LocalizedStrings<string, LocalizedString>;\n\n/**\n * Available message keys for LocalizedField component\n */\nexport type LocalizedFieldMessageKey =\n | \"hideCurrencies\"\n | \"hideLanguages\"\n | \"infoBoxTriggerAriaLabel\"\n | \"missingRequiredField\"\n | \"showCurrencies\"\n | \"showLanguages\";\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: \"nimbusLocalizedField\",\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 {\n FormField,\n type CurrencyCode,\n type MoneyInputValue,\n type MoneyValue,\n type FieldErrorsData,\n MoneyInput,\n} from \"@/components\";\nimport { useLocalizedStringFormatter } from \"@/hooks\";\nimport { localizedFieldMessagesStrings } from \"../localized-field.messages\";\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 const msg = useLocalizedStringFormatter(localizedFieldMessagesStrings);\n return (\n <FormField.Error>{msg.format(\"missingRequiredField\")}</FormField.Error>\n );\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 {\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 { useLocalizedStringFormatter } from \"@/hooks\";\nimport { localizedFieldMessagesStrings } from \"../localized-field.messages\";\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 msg = useLocalizedStringFormatter(localizedFieldMessagesStrings);\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={msg.format(\"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 ? msg.format(\"hideCurrencies\")\n : msg.format(\"showCurrencies\")\n : expanded\n ? msg.format(\"hideLanguages\")\n : msg.format(\"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":["localizedFieldMessages_en","localizedFieldMessages_de","localizedFieldMessages_es","localizedFieldMessages_fr","localizedFieldMessages_pt","localizedFieldMessagesStrings","normalizeMessages","withProvider","withContext","createSlotRecipeContext","LocalizedFieldRootSlot","LocalizedFieldLabelSlot","LocalizedFieldInfoDialogSlot","LocalizedFieldFieldsContainerSlot","LocalizedFieldDescriptionSlot","LocalizedFieldErrorSlot","LocalizedFieldToggleButtonContainerSlot","LocalizedFieldLocaleFieldRootSlot","LocalizedFieldLocaleFieldLabelSlot","LocalizedFieldLocaleFieldInputSlot","RequiredValueErrorMessage","msg","useLocalizedStringFormatter","FormField","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","jsx","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","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":"s2BAMAA,GAAe,CACb,eAAgB,sBAChB,cAAe,qBACf,wBAAyB,YACzB,qBAAsB,sDACtB,eAAgB,sBAChB,cAAe,oBACjB,ECPAC,GAAe,CACb,eAAgB,4BAChB,cAAe,2BACf,wBAAyB,wBACzB,qBAAsB,sEACtB,eAAgB,0BAChB,cAAe,wBACjB,ECPAC,GAAe,CACb,eAAgB,4BAChB,cAAe,4BACf,wBAAyB,kBACzB,qBAAsB,0DACtB,eAAgB,4BAChB,cAAe,2BACjB,ECPAC,GAAe,CACb,eAAgB,6BAChB,cAAe,6BACf,wBAAyB,sBACzB,qBAAsB,qDACtB,eAAgB,8BAChB,cAAe,6BACjB,ECPAC,GAAe,CACb,eAAgB,+BAChB,cAAe,2BACf,wBAAyB,mBACzB,qBAAsB,yDACtB,eAAgB,+BAChB,cAAe,0BACjB,ECUaC,GAGT,CACF,GAAIC,EAAAA,kBAAkBN,EAAyB,EAC/C,GAAIM,EAAAA,kBAAkBL,EAAyB,EAC/C,GAAIK,EAAAA,kBAAkBJ,EAAyB,EAC/C,QAASI,EAAAA,kBAAkBH,EAAyB,EACpD,QAASG,EAAAA,kBAAkBF,EAAyB,CACtD,EClBM,CAAE,aAAAG,GAAc,YAAAC,CAAA,EAAgBC,2BAAwB,CAC5D,IAAK,sBACP,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,GAA0CR,EAGrD,M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,aAAa,UACjB,SAAAJ,MAACK,EAAAA,eAAa,EAChB,EACAJ,EAAAA,KAAC2C,EAAAA,OAAM,IAAI,IAAI,GAAI,GAAGV,EAAiB,EAAE,WACtC,SAAA,CAAApD,EACAgC,GAAYiB,GACX/B,EAAAA,IAACwD,GAAAA,YAAA,CACC,OAAQ1C,EACR,YAAaC,EACb,aAAa,UACb,KAAM,MAAA,CAAA,CACR,CAAA,CAEJ,CAAA,CAAA,CACF,EAEAlC,CAAA,CAAA,EAILS,GACCW,EAAAA,KAAC5E,GAAA,CAGC,kBAAiB,GAAG8G,EAAkB,EAAE,SACxC,KAAK,QACJ,GAAGA,EAEJ,SAAA,CAAAnC,EAAAA,IAACI,EAAAA,KAAA,CACC,SAAAJ,EAAAA,IAACyD,EAAAA,aAAA,CAAA,CAAa,EAChB,EACAxD,EAAAA,KAAC2C,EAAAA,OAAM,IAAI,IAAI,GAAI,GAAGT,EAAkB,EAAE,SACvC,SAAA,CAAApD,EACA/B,GAAU8E,GACT9B,EAAAA,IAACwD,GAAAA,YAAA,CACC,OAAAxG,EACA,YAAAgE,EACA,KAAM,MAAA,CAAA,CACR,CAAA,CAEJ,CAAA,CAAA,CAAA,CACF,CAAA,CAAA,CAIR,ECrUaV,GAAiB,OAAO,OAAOoD,GAAoB,CAE9D,MAAO5H,EACP,QAASA,EACT,UAAA4B,GACA,QAAAJ,GACA,sBAAAH,GACA,sBAAAK,GACA,0BAAA9B,GACA,cAAAkC,GACA,qBAAAC,GACA,iBAAAG,GACA,2BAAAI,GACA,mBAAAE,EACF,CAAC"}
@@ -11,7 +11,7 @@ import { createSlotRecipeContext as ze } from "@chakra-ui/react";
11
11
  import { I as _ } from "./icon-DIEEgcIZ.es.js";
12
12
  import { R as Se } from "./rich-text-input-Bo_zGUyj.es.js";
13
13
  import { M as we } from "./multiline-text-input-DZ31Npjo.es.js";
14
- import { T as je } from "./text-input-DMqogV2V.es.js";
14
+ import { T as je } from "./text-input-9W5v7FzD.es.js";
15
15
  import { a as oe } from "./mergeProps-B-cqsBhL.es.js";
16
16
  import { $ as Ee } from "./useField-BxLfE_kx.es.js";
17
17
  import { a as re } from "./field-errors-DYvB-OZF.es.js";
@@ -480,4 +480,4 @@ const no = (e, o) => Object.values(e).map((t) => k.convertToMoneyValue(t, o)), s
480
480
  export {
481
481
  Ao as L
482
482
  };
483
- //# sourceMappingURL=localized-field-y1Maik4X.es.js.map
483
+ //# sourceMappingURL=localized-field-Dwq6C30C.es.js.map