@carto/meridian-ds 2.6.1 → 2.7.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 (171) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{Alert-DHd9hCGz.js → Alert-BfDnWlbD.js} +5 -41
  3. package/dist/{Alert-DOeOwxOe.cjs → Alert-CPvYAHO_.cjs} +4 -40
  4. package/dist/{MenuItem-MUmADf3e.js → MenuItem-D90EfuGS.js} +12 -3
  5. package/dist/{MenuItem-CYJN2OVU.cjs → MenuItem-ZSYcQBtg.cjs} +12 -3
  6. package/dist/{SwatchSquare-CaaLsjAC.js → Search-C7wkXu3f.js} +4 -23
  7. package/dist/{SwatchSquare-B8PIY3Rd.cjs → Search-CMWbM9nD.cjs} +3 -22
  8. package/dist/SwatchSquare-B6KYVoqV.js +24 -0
  9. package/dist/SwatchSquare-DuXPIL7t.cjs +23 -0
  10. package/dist/components/index.cjs +616 -235
  11. package/dist/components/index.js +616 -235
  12. package/dist/{css-utils-WejOmkiI.js → css-utils-BHYA7By_.js} +32 -13
  13. package/dist/{css-utils-CCi3p7os.cjs → css-utils-DjvM17Vb.cjs} +30 -11
  14. package/dist/custom-icons/index.cjs +774 -611
  15. package/dist/custom-icons/index.js +774 -611
  16. package/dist/theme/index.cjs +75 -7
  17. package/dist/theme/index.js +77 -9
  18. package/dist/types/components/Alert/Alert.d.ts.map +1 -1
  19. package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
  20. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts +1 -0
  21. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts.map +1 -1
  22. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts +1 -1
  23. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts.map +1 -1
  24. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts +1 -1
  25. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
  26. package/dist/types/components/Autocomplete/CreatableAutocomplete/useCreatableAutocomplete.d.ts.map +1 -1
  27. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts +1 -1
  28. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts.map +1 -1
  29. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts +1 -1
  30. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts.map +1 -1
  31. package/dist/types/components/Autocomplete/MultipleAutocomplete/useMultipleAutocomplete.d.ts.map +1 -1
  32. package/dist/types/components/Autocomplete/types.d.ts +13 -1
  33. package/dist/types/components/Autocomplete/types.d.ts.map +1 -1
  34. package/dist/types/components/Avatar/Avatar.d.ts +0 -2
  35. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  36. package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts +7 -1
  37. package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts.map +1 -1
  38. package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts +5 -1
  39. package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts.map +1 -1
  40. package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts +3 -1
  41. package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts.map +1 -1
  42. package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts +5 -1
  43. package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts.map +1 -1
  44. package/dist/types/components/CopiableComponent/CopiableComponent.d.ts.map +1 -1
  45. package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts +3 -0
  46. package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts.map +1 -1
  47. package/dist/types/components/CopiableComponent/types.d.ts +8 -1
  48. package/dist/types/components/CopiableComponent/types.d.ts.map +1 -1
  49. package/dist/types/components/CopiableInputText/CopiableInputText.d.ts +9 -3
  50. package/dist/types/components/CopiableInputText/CopiableInputText.d.ts.map +1 -1
  51. package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts +28 -3
  52. package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts.map +1 -1
  53. package/dist/types/components/CopiableInputText/types.d.ts +4 -1
  54. package/dist/types/components/CopiableInputText/types.d.ts.map +1 -1
  55. package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts +1 -1
  56. package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts.map +1 -1
  57. package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts +3 -0
  58. package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts.map +1 -1
  59. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts +1 -1
  60. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  61. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts +3 -0
  62. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -1
  63. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts +1 -1
  64. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  65. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts +3 -0
  66. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
  67. package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts +1 -1
  68. package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts.map +1 -1
  69. package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts +3 -0
  70. package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts.map +1 -1
  71. package/dist/types/components/DatePickers/types.d.ts +7 -0
  72. package/dist/types/components/DatePickers/types.d.ts.map +1 -1
  73. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts +48 -0
  74. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts.map +1 -1
  75. package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts.map +1 -1
  76. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts +2 -0
  77. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts.map +1 -0
  78. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts +1 -1
  79. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
  80. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts +14 -0
  81. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts.map +1 -1
  82. package/dist/types/components/Dialog/types.d.ts +6 -0
  83. package/dist/types/components/Dialog/types.d.ts.map +1 -1
  84. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts +1 -1
  85. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts.map +1 -1
  86. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts +48 -0
  87. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts.map +1 -1
  88. package/dist/types/components/FilterDropdown/types.d.ts +8 -0
  89. package/dist/types/components/FilterDropdown/types.d.ts.map +1 -1
  90. package/dist/types/components/Menu/Menu/Menu.stories.d.ts +16 -7
  91. package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
  92. package/dist/types/components/Menu/MenuItem/MenuItem.d.ts.map +1 -1
  93. package/dist/types/components/Menu/MenuItemFilter/MenuItemFilter.d.ts.map +1 -1
  94. package/dist/types/components/Menu/types.d.ts +1 -0
  95. package/dist/types/components/Menu/types.d.ts.map +1 -1
  96. package/dist/types/components/PasswordField/PasswordField.d.ts +10 -1
  97. package/dist/types/components/PasswordField/PasswordField.d.ts.map +1 -1
  98. package/dist/types/components/PasswordField/PasswordField.stories.d.ts +10 -1
  99. package/dist/types/components/PasswordField/PasswordField.stories.d.ts.map +1 -1
  100. package/dist/types/components/SearchField/SearchField.d.ts +4 -0
  101. package/dist/types/components/SearchField/SearchField.d.ts.map +1 -0
  102. package/dist/types/components/SearchField/SearchField.stories.d.ts +111 -0
  103. package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -0
  104. package/dist/types/components/SearchField/SearchField.styled.d.ts +23 -0
  105. package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -0
  106. package/dist/types/components/SearchField/SearchField.test.d.ts +2 -0
  107. package/dist/types/components/SearchField/SearchField.test.d.ts.map +1 -0
  108. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts +19 -0
  109. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts.map +1 -0
  110. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts +14 -0
  111. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts.map +1 -0
  112. package/dist/types/components/SearchField/index.d.ts +3 -0
  113. package/dist/types/components/SearchField/index.d.ts.map +1 -0
  114. package/dist/types/components/SearchField/types.d.ts +72 -0
  115. package/dist/types/components/SearchField/types.d.ts.map +1 -0
  116. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
  117. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts +22 -2
  118. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts.map +1 -1
  119. package/dist/types/components/SelectField/types.d.ts +4 -0
  120. package/dist/types/components/SelectField/types.d.ts.map +1 -1
  121. package/dist/types/components/Snackbar/Snackbar.d.ts +2 -1
  122. package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
  123. package/dist/types/components/Snackbar/Snackbar.stories.d.ts +15 -0
  124. package/dist/types/components/Snackbar/Snackbar.stories.d.ts.map +1 -1
  125. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +3 -0
  126. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
  127. package/dist/types/components/UploadField/useFileUpload.d.ts +4 -1
  128. package/dist/types/components/UploadField/useFileUpload.d.ts.map +1 -1
  129. package/dist/types/components/index.d.ts +2 -0
  130. package/dist/types/components/index.d.ts.map +1 -1
  131. package/dist/types/custom-icons/ApiAccessToken.d.ts +4 -0
  132. package/dist/types/custom-icons/ApiAccessToken.d.ts.map +1 -0
  133. package/dist/types/custom-icons/ApiBaseUrl.d.ts +4 -0
  134. package/dist/types/custom-icons/ApiBaseUrl.d.ts.map +1 -0
  135. package/dist/types/custom-icons/AppCredentials.d.ts +4 -0
  136. package/dist/types/custom-icons/AppCredentials.d.ts.map +1 -0
  137. package/dist/types/custom-icons/M2mOauthClient.d.ts +4 -0
  138. package/dist/types/custom-icons/M2mOauthClient.d.ts.map +1 -0
  139. package/dist/types/custom-icons/SpaOauthClient.d.ts +4 -0
  140. package/dist/types/custom-icons/SpaOauthClient.d.ts.map +1 -0
  141. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts +4 -0
  142. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts.map +1 -0
  143. package/dist/types/custom-icons/index.d.ts +6 -0
  144. package/dist/types/custom-icons/index.d.ts.map +1 -1
  145. package/dist/types/localization/en.d.ts +1 -0
  146. package/dist/types/localization/en.d.ts.map +1 -1
  147. package/dist/types/localization/es.d.ts +1 -0
  148. package/dist/types/localization/es.d.ts.map +1 -1
  149. package/dist/types/localization/id.d.ts +1 -0
  150. package/dist/types/localization/id.d.ts.map +1 -1
  151. package/dist/types/localization/index.d.ts +3 -0
  152. package/dist/types/localization/index.d.ts.map +1 -1
  153. package/dist/types/theme/carto-theme.d.ts.map +1 -1
  154. package/dist/types/theme/components/data-display.d.ts.map +1 -1
  155. package/dist/types/theme/components/feedback.d.ts.map +1 -1
  156. package/dist/types/theme/components/layout.d.ts +3 -0
  157. package/dist/types/theme/components/layout.d.ts.map +1 -0
  158. package/dist/types/theme/components/navigation.d.ts.map +1 -1
  159. package/dist/types/theme/types.d.ts +11 -0
  160. package/dist/types/theme/types.d.ts.map +1 -1
  161. package/dist/types/utils/useTranslationWithFallback.d.ts +39 -0
  162. package/dist/types/utils/useTranslationWithFallback.d.ts.map +1 -0
  163. package/dist/types/utils/useTranslationWithFallback.test.d.ts +2 -0
  164. package/dist/types/utils/useTranslationWithFallback.test.d.ts.map +1 -0
  165. package/dist/widgets/index.cjs +8 -7
  166. package/dist/widgets/index.js +4 -3
  167. package/package.json +1 -1
  168. package/dist/types/utils/useTranslationFallback.d.ts +0 -20
  169. package/dist/types/utils/useTranslationFallback.d.ts.map +0 -1
  170. package/dist/types/utils/useTranslationFallback.test.d.ts +0 -2
  171. package/dist/types/utils/useTranslationFallback.test.d.ts.map +0 -1
@@ -1,15 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle } from "react";
3
- import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
3
+ import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Stack, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
4
4
  import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, Check, TodayOutlined } from "@mui/icons-material";
5
- import { u as useTranslationFallback, S as ScreenReaderOnly, A as Alert$1 } from "../Alert-DHd9hCGz.js";
6
- import { L } from "../Alert-DHd9hCGz.js";
7
- import { T as Typography, c as ICON_SIZE_SMALL, u as useImperativeIntl, i as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, h as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-WejOmkiI.js";
8
- import { a } from "../css-utils-WejOmkiI.js";
5
+ import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, i as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, h as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, j as useImperativeIntl, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-BHYA7By_.js";
6
+ import { a } from "../css-utils-BHYA7By_.js";
7
+ import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-BfDnWlbD.js";
8
+ import { L } from "../Alert-BfDnWlbD.js";
9
9
  import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
10
10
  import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
11
- import { useIntl } from "react-intl";
12
- import { M as MenuItem$1 } from "../MenuItem-MUmADf3e.js";
11
+ import { M as MenuItem$1 } from "../MenuItem-D90EfuGS.js";
13
12
  import "cartocolor";
14
13
  import { FixedSizeList } from "react-window";
15
14
  import { Controlled, UnControlled } from "react-codemirror2";
@@ -38,9 +37,11 @@ import "codemirror/addon/fold/markdown-fold.js";
38
37
  import "codemirror/addon/fold/comment-fold.js";
39
38
  import ClickAwayListener$1 from "@mui/material/ClickAwayListener";
40
39
  import { DatePicker as DatePicker$1 } from "@mui/x-date-pickers/DatePicker";
40
+ import { useIntl } from "react-intl";
41
41
  import { PickersDay as PickersDay$1 } from "@mui/x-date-pickers";
42
42
  import { TimePicker as TimePicker$1 } from "@mui/x-date-pickers/TimePicker";
43
43
  import { DateTimePicker as DateTimePicker$1 } from "@mui/x-date-pickers/DateTimePicker";
44
+ import { S as Search } from "../Search-C7wkXu3f.js";
44
45
  import DOMPurify from "dompurify";
45
46
  const IndicatorIcon = styled(Box)({
46
47
  position: "absolute",
@@ -69,7 +70,7 @@ function _Button({
69
70
  "aria-describedby": ariaDescribedby,
70
71
  ...otherProps
71
72
  }, ref) {
72
- const screenReaderTextValue = useTranslationFallback(
73
+ const screenReaderTextValue = useTranslationWithFallback(
73
74
  "c4r.button.opensInNewTab",
74
75
  screenReaderText
75
76
  );
@@ -282,14 +283,25 @@ function _LabelWithIndicator({
282
283
  );
283
284
  }
284
285
  const LabelWithIndicator = forwardRef(_LabelWithIndicator);
285
- function _PasswordField({ InputProps, size = "small", disabled, ...otherProps }, ref) {
286
- const intl = useIntl();
287
- const intlConfig = useImperativeIntl(intl);
286
+ function _PasswordField({
287
+ InputProps,
288
+ size = "small",
289
+ disabled,
290
+ showPasswordText,
291
+ hidePasswordText,
292
+ ...otherProps
293
+ }, ref) {
294
+ const showPasswordLabel = useTranslationWithFallback(
295
+ "c4r.form.showPassword",
296
+ showPasswordText
297
+ );
298
+ const hidePasswordLabel = useTranslationWithFallback(
299
+ "c4r.form.hidePassword",
300
+ hidePasswordText
301
+ );
288
302
  const [showPassword, setShowPassword] = useState(false);
289
303
  const handleClickShowPassword = () => setShowPassword(!showPassword);
290
- const showPasswordLabel = intlConfig.formatMessage({
291
- id: `c4r.form.${showPassword ? "hidePassword" : "showPassword"}`
292
- });
304
+ const label = showPassword ? hidePasswordLabel : showPasswordLabel;
293
305
  return /* @__PURE__ */ jsx(
294
306
  TextField,
295
307
  {
@@ -311,8 +323,8 @@ function _PasswordField({ InputProps, size = "small", disabled, ...otherProps },
311
323
  disabled,
312
324
  onClick: handleClickShowPassword,
313
325
  icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOffOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOutlined, {}),
314
- tooltip: showPasswordLabel,
315
- "aria-label": showPasswordLabel
326
+ tooltip: label,
327
+ "aria-label": label
316
328
  }
317
329
  ) })
318
330
  },
@@ -522,11 +534,14 @@ function _MenuItemFilter({
522
534
  areAnySelected,
523
535
  selectAll,
524
536
  selectAllDisabled,
537
+ selectAllText,
525
538
  "aria-label": ariaLabel,
526
539
  "data-testid": dataTestId
527
540
  }, ref) {
528
- const intl = useIntl();
529
- const intlConfig = useImperativeIntl(intl);
541
+ const selectAllLabel = useTranslationWithFallback(
542
+ "c4r.form.selectAll",
543
+ selectAllText
544
+ );
530
545
  return /* @__PURE__ */ jsx(
531
546
  StyledMenuItem$1,
532
547
  {
@@ -554,7 +569,7 @@ function _MenuItemFilter({
554
569
  disabled: selectAllDisabled
555
570
  }
556
571
  ),
557
- intlConfig.formatMessage({ id: "c4r.form.selectAll" })
572
+ selectAllLabel
558
573
  ]
559
574
  }
560
575
  )
@@ -601,6 +616,10 @@ function _MultipleSelectField({
601
616
  selectAllDisabled,
602
617
  tooltipPlacement,
603
618
  variant,
619
+ allSelectedText,
620
+ noneSelectedText,
621
+ selectedText,
622
+ selectAllText,
604
623
  ...props
605
624
  }, ref) {
606
625
  const {
@@ -617,11 +636,19 @@ function _MultipleSelectField({
617
636
  });
618
637
  const isSmall = size === "small";
619
638
  const paddingSize = isSmall || variant === "standard" ? 0 : 2;
620
- const intl = useIntl();
621
- const intlConfig = useImperativeIntl(intl);
622
- const counterText = `${currentOptions.length} ${intlConfig.formatMessage({
623
- id: "c4r.form.selected"
624
- })}`;
639
+ const allSelectedLabel = useTranslationWithFallback(
640
+ "c4r.form.allSelected",
641
+ allSelectedText
642
+ );
643
+ const noneSelectedLabel = useTranslationWithFallback(
644
+ "c4r.form.noneSelected",
645
+ noneSelectedText
646
+ );
647
+ const selectedLabel = useTranslationWithFallback(
648
+ "c4r.form.selected",
649
+ selectedText
650
+ );
651
+ const counterText = `${currentOptions.length} ${selectedLabel}`;
625
652
  const renderValue = useMemo(() => {
626
653
  if (areAllSelected) {
627
654
  return /* @__PURE__ */ jsx(
@@ -631,7 +658,7 @@ function _MultipleSelectField({
631
658
  variant: isSmall ? "body2" : "body1",
632
659
  color: "textPrimary",
633
660
  ml: paddingSize,
634
- children: intlConfig.formatMessage({ id: "c4r.form.allSelected" })
661
+ children: allSelectedLabel
635
662
  }
636
663
  );
637
664
  }
@@ -654,16 +681,17 @@ function _MultipleSelectField({
654
681
  variant: isSmall ? "body2" : "body1",
655
682
  color: "text.hint",
656
683
  ml: paddingSize,
657
- children: placeholder ?? intlConfig.formatMessage({ id: "c4r.form.noneSelected" })
684
+ children: placeholder ?? noneSelectedLabel
658
685
  }
659
686
  );
660
687
  }, [
661
688
  areAllSelected,
662
689
  areAnySelected,
690
+ allSelectedLabel,
663
691
  counterText,
664
692
  currentOptions,
665
- intlConfig,
666
693
  isSmall,
694
+ noneSelectedLabel,
667
695
  paddingSize,
668
696
  placeholder,
669
697
  showCounter
@@ -704,7 +732,8 @@ function _MultipleSelectField({
704
732
  areAllSelected,
705
733
  areAnySelected,
706
734
  selectAll,
707
- selectAllDisabled
735
+ selectAllDisabled,
736
+ selectAllText
708
737
  }
709
738
  )
710
739
  }
@@ -871,19 +900,22 @@ const _CopiableComponent = ({
871
900
  copiedText,
872
901
  button,
873
902
  buttonLabel,
903
+ buttonIcon,
874
904
  buttonProps,
875
905
  ariaLabel,
876
906
  dataTestId,
877
907
  tooltipPlacement = "top",
908
+ tooltipProps,
909
+ snackbarProps,
878
910
  ...props
879
911
  }, ref) => {
880
912
  const [open, setOpen] = useState(false);
881
- const intl = useIntl();
882
- const intlConfig = useImperativeIntl(intl);
883
- const copyTooltipText = copyText === null ? null : copyText || intlConfig.formatMessage({ id: "c4r.button.copy" });
884
- const copySuccessMessage = copiedText || intlConfig.formatMessage({
885
- id: "c4r.notifications.copiedToClipboard"
886
- });
913
+ const _copyText = useTranslationWithFallback("c4r.button.copy", copyText);
914
+ const copyTooltipText = copyText === null ? null : _copyText;
915
+ const copySuccessMessage = useTranslationWithFallback(
916
+ "c4r.notifications.copiedToClipboard",
917
+ copiedText
918
+ );
887
919
  const { copy } = useCopyValue(copyTooltipText, copySuccessMessage);
888
920
  const handleClick = (e) => {
889
921
  e.preventDefault();
@@ -892,6 +924,7 @@ const _CopiableComponent = ({
892
924
  setOpen(true);
893
925
  }).catch(console.error);
894
926
  };
927
+ const copyIcon = buttonIcon ?? /* @__PURE__ */ jsx(ContentCopyOutlined, {});
895
928
  return /* @__PURE__ */ jsxs(Fragment, { children: [
896
929
  /* @__PURE__ */ jsx(
897
930
  Tooltip,
@@ -899,6 +932,7 @@ const _CopiableComponent = ({
899
932
  title: copyTooltipText,
900
933
  leaveDelay: 0,
901
934
  placement: tooltipPlacement,
935
+ ...tooltipProps,
902
936
  children: /* @__PURE__ */ jsxs(
903
937
  Box,
904
938
  {
@@ -914,9 +948,9 @@ const _CopiableComponent = ({
914
948
  {
915
949
  ...buttonProps,
916
950
  disabled,
917
- icon: /* @__PURE__ */ jsx(ContentCopyOutlined, {}),
951
+ icon: copyIcon,
918
952
  "data-testid": dataTestId,
919
- "aria-label": ariaLabel || buttonLabel || copyTooltipText || intlConfig.formatMessage({ id: "c4r.button.copy" }),
953
+ "aria-label": ariaLabel || buttonLabel || (copyTooltipText ?? ""),
920
954
  sx: {
921
955
  display: "flex"
922
956
  }
@@ -930,10 +964,11 @@ const _CopiableComponent = ({
930
964
  /* @__PURE__ */ jsx(
931
965
  Snackbar,
932
966
  {
933
- open,
934
967
  autoWidth: true,
935
968
  closeable: false,
936
969
  autoHideDuration: 4e3,
970
+ ...snackbarProps,
971
+ open,
937
972
  onClose: () => setOpen(false),
938
973
  children: copySuccessMessage
939
974
  }
@@ -977,16 +1012,22 @@ function _CopiableInputText({
977
1012
  size = "small",
978
1013
  onFocus,
979
1014
  onBlur,
1015
+ showText: showTextProp,
1016
+ hideText: hideTextProp,
980
1017
  ...rest
981
1018
  }, ref) {
982
- const intl = useIntl();
983
- const intlConfig = useImperativeIntl(intl);
984
- const [showText, setShowText] = useState(false);
1019
+ const [showPassword, setShowPassword] = useState(false);
985
1020
  const [isInputFocused, setIsInputFocused] = useState(false);
986
- const inputType = !password ? "text" : showText ? "text" : "password";
987
- const showTextLabel = intlConfig.formatMessage({
988
- id: showText ? "c4r.button.hide" : "c4r.button.show"
989
- });
1021
+ const inputType = !password ? "text" : showPassword ? "text" : "password";
1022
+ const showTextLabel = useTranslationWithFallback(
1023
+ "c4r.button.show",
1024
+ showTextProp
1025
+ );
1026
+ const hideTextLabel = useTranslationWithFallback(
1027
+ "c4r.button.hide",
1028
+ hideTextProp
1029
+ );
1030
+ const currentLabel = showPassword ? hideTextLabel : showTextLabel;
990
1031
  const handleFocus = (event) => {
991
1032
  setIsInputFocused(true);
992
1033
  onFocus == null ? void 0 : onFocus(event);
@@ -999,11 +1040,11 @@ function _CopiableInputText({
999
1040
  IconButton,
1000
1041
  {
1001
1042
  edge: variant !== "standard" ? "end" : void 0,
1002
- onClick: () => setShowText(!showText),
1043
+ onClick: () => setShowPassword(!showPassword),
1003
1044
  size,
1004
- icon: showText ? /* @__PURE__ */ jsx(VisibilityOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOffOutlined, {}),
1005
- tooltip: showTextLabel,
1006
- "aria-label": showTextLabel
1045
+ icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOffOutlined, {}),
1046
+ tooltip: currentLabel,
1047
+ "aria-label": currentLabel
1007
1048
  }
1008
1049
  ) });
1009
1050
  return /* @__PURE__ */ jsx(
@@ -1273,10 +1314,12 @@ function useCreatableAutocomplete({
1273
1314
  newItemIcon,
1274
1315
  multiple
1275
1316
  }) {
1276
- const intl = useIntl();
1277
- const intlConfig = useImperativeIntl(intl);
1278
1317
  const filter = createFilterOptions();
1279
1318
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1319
+ const addLabel = useTranslationWithFallback(
1320
+ "c4r.form.add",
1321
+ typeof newItemLabel === "string" ? newItemLabel : void 0
1322
+ );
1280
1323
  const creatableFilterOptions = (options, params) => {
1281
1324
  const filtered = filter(
1282
1325
  options,
@@ -1290,10 +1333,8 @@ function useCreatableAutocomplete({
1290
1333
  let newItemText;
1291
1334
  if (typeof newItemLabel === "function") {
1292
1335
  newItemText = newItemLabel(inputValue);
1293
- } else if (newItemLabel) {
1294
- newItemText = `${newItemLabel} "${inputValue}"`;
1295
1336
  } else {
1296
- newItemText = `${intlConfig.formatMessage({ id: "c4r.form.add" })} "${inputValue}"`;
1337
+ newItemText = `${addLabel} "${inputValue}"`;
1297
1338
  }
1298
1339
  filtered.push({
1299
1340
  inputValue,
@@ -1338,14 +1379,18 @@ function useMultipleAutocomplete({
1338
1379
  counterText,
1339
1380
  allSelectedText
1340
1381
  }) {
1341
- const intl = useIntl();
1342
- const intlConfig = useImperativeIntl(intl);
1343
- const defaultCounterText = counterText || intlConfig.formatMessage({ id: "c4r.form.selected" });
1344
- const defaultAllSelectedText = allSelectedText || intlConfig.formatMessage({ id: "c4r.form.allSelected" });
1345
1382
  const [multipleValue, setMultipleValue] = useState(
1346
1383
  Array.isArray(value) ? value : value ? [value] : []
1347
1384
  );
1348
1385
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1386
+ const defaultCounterText = useTranslationWithFallback(
1387
+ "c4r.form.selected",
1388
+ counterText
1389
+ );
1390
+ const defaultAllSelectedText = useTranslationWithFallback(
1391
+ "c4r.form.allSelected",
1392
+ allSelectedText
1393
+ );
1349
1394
  useEffect(() => {
1350
1395
  const newValue = Array.isArray(value) ? value : value ? [value] : [];
1351
1396
  setMultipleValue(newValue);
@@ -1476,6 +1521,7 @@ function _AutocompleteList({
1476
1521
  extended,
1477
1522
  itemHeight,
1478
1523
  maxListHeight = MENU_LIST_MAX_SIZE,
1524
+ selectAllText,
1479
1525
  ...otherProps
1480
1526
  }, ref) {
1481
1527
  const childrenArray = useMemo(() => {
@@ -1551,7 +1597,8 @@ function _AutocompleteList({
1551
1597
  {
1552
1598
  areAllSelected: !!allSelected,
1553
1599
  areAnySelected: !!someSelected,
1554
- selectAll: handleSelectAll
1600
+ selectAll: handleSelectAll,
1601
+ selectAllText
1555
1602
  }
1556
1603
  ),
1557
1604
  /* @__PURE__ */ jsx(
@@ -1582,6 +1629,7 @@ function _CreatableAutocomplete({
1582
1629
  counterFormatter,
1583
1630
  counterText,
1584
1631
  allSelectedText,
1632
+ selectAllText,
1585
1633
  options = [],
1586
1634
  value,
1587
1635
  onChange,
@@ -1632,7 +1680,8 @@ function _CreatableAutocomplete({
1632
1680
  multiple,
1633
1681
  itemHeight,
1634
1682
  maxListHeight,
1635
- extended
1683
+ extended,
1684
+ selectAllText
1636
1685
  };
1637
1686
  const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
1638
1687
  return /* @__PURE__ */ jsx(
@@ -1671,6 +1720,7 @@ function _MultipleAutocomplete({
1671
1720
  counterFormatter,
1672
1721
  counterText,
1673
1722
  allSelectedText,
1723
+ selectAllText,
1674
1724
  options,
1675
1725
  value,
1676
1726
  onChange,
@@ -1712,7 +1762,8 @@ function _MultipleAutocomplete({
1712
1762
  multiple: true,
1713
1763
  itemHeight,
1714
1764
  maxListHeight,
1715
- extended
1765
+ extended,
1766
+ selectAllText
1716
1767
  };
1717
1768
  const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
1718
1769
  return /* @__PURE__ */ jsx(
@@ -1853,6 +1904,7 @@ function SecondaryText({ text }) {
1853
1904
  }
1854
1905
  const Root$4 = styled(AppBar$1)(({ theme }) => ({
1855
1906
  backgroundColor: theme.palette.brand.appBarMain,
1907
+ userSelect: "none",
1856
1908
  "& .MuiTypography-root": {
1857
1909
  color: theme.palette.brand.appBarContrastText
1858
1910
  },
@@ -1918,16 +1970,24 @@ const Footer = styled(Box, {
1918
1970
  function CodeAreaFooter({
1919
1971
  onClickFooter,
1920
1972
  buttonFooterLabelId,
1973
+ buttonFooterText,
1921
1974
  disabledButtonFooter,
1922
1975
  withGutter = true,
1923
1976
  showSnackbar,
1924
1977
  onCloseSnackbar,
1925
1978
  loading,
1926
1979
  disabled,
1980
+ changesSavedText,
1927
1981
  ...props
1928
1982
  }) {
1929
- const intl = useIntl();
1930
- const intlConfig = useImperativeIntl(intl);
1983
+ const buttonFooterLabel = useTranslationWithFallback(
1984
+ buttonFooterLabelId || "c4r.button.save",
1985
+ buttonFooterText
1986
+ );
1987
+ const changesSavedLabel = useTranslationWithFallback(
1988
+ "c4r.notifications.changesSaved",
1989
+ changesSavedText
1990
+ );
1931
1991
  if (!onClickFooter) return null;
1932
1992
  return /* @__PURE__ */ jsxs(
1933
1993
  Footer,
@@ -1945,9 +2005,7 @@ function CodeAreaFooter({
1945
2005
  loading,
1946
2006
  onClick: onClickFooter,
1947
2007
  disabled: disabled || disabledButtonFooter,
1948
- children: intlConfig.formatMessage({
1949
- id: buttonFooterLabelId || "c4r.button.save"
1950
- })
2008
+ children: buttonFooterLabel
1951
2009
  }
1952
2010
  ),
1953
2011
  /* @__PURE__ */ jsx(
@@ -1958,9 +2016,7 @@ function CodeAreaFooter({
1958
2016
  closeable: false,
1959
2017
  autoHideDuration: 4e3,
1960
2018
  onClose: onCloseSnackbar,
1961
- children: intlConfig.formatMessage({
1962
- id: "c4r.notifications.changesSaved"
1963
- })
2019
+ children: changesSavedLabel
1964
2020
  }
1965
2021
  )
1966
2022
  ]
@@ -1982,10 +2038,12 @@ function CodeAreaHeader({
1982
2038
  disabled,
1983
2039
  copyValue,
1984
2040
  onClickExpand,
1985
- size
2041
+ size,
2042
+ showOptionsTooltipText,
2043
+ copyText,
2044
+ expandText,
2045
+ copiedText
1986
2046
  }) {
1987
- const intl = useIntl();
1988
- const intlConfig = useImperativeIntl(intl);
1989
2047
  const showExpandButton = !!onClickExpand;
1990
2048
  const showCopyButton = copyValue !== void 0;
1991
2049
  const showMenu = showExpandButton && showCopyButton;
@@ -1993,6 +2051,19 @@ function CodeAreaHeader({
1993
2051
  const [openSnackbar, setOpenSnackbar] = useState(false);
1994
2052
  const [anchorEl, setAnchorEl] = useState(null);
1995
2053
  const open = Boolean(anchorEl);
2054
+ const showOptionsTooltipLabel = useTranslationWithFallback(
2055
+ "c4r.button.showOptions",
2056
+ showOptionsTooltipText
2057
+ );
2058
+ const copyLabel = useTranslationWithFallback("c4r.button.copy", copyText);
2059
+ const expandLabel = useTranslationWithFallback(
2060
+ "c4r.button.expand",
2061
+ expandText
2062
+ );
2063
+ const copiedLabel = useTranslationWithFallback(
2064
+ "c4r.notifications.copiedToClipboard",
2065
+ copiedText
2066
+ );
1996
2067
  const openDropdown = (event) => {
1997
2068
  setAnchorEl(event.currentTarget);
1998
2069
  };
@@ -2020,7 +2091,7 @@ function CodeAreaHeader({
2020
2091
  size,
2021
2092
  icon: /* @__PURE__ */ jsx(MoreVertOutlined, {}),
2022
2093
  disabled,
2023
- tooltip: intlConfig.formatMessage({ id: `c4r.button.showOptions` }),
2094
+ tooltip: showOptionsTooltipLabel,
2024
2095
  tooltipPlacement: "top",
2025
2096
  "aria-controls": open ? "basic-menu" : void 0,
2026
2097
  "aria-haspopup": "true",
@@ -2042,11 +2113,11 @@ function CodeAreaHeader({
2042
2113
  children: [
2043
2114
  /* @__PURE__ */ jsxs(MenuItem$1, { onClick: handleCopy, disabled, id: "copy", children: [
2044
2115
  /* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ContentCopyOutlined, {}) }),
2045
- /* @__PURE__ */ jsx(ListItemText, { children: intlConfig.formatMessage({ id: `c4r.button.copy` }) })
2116
+ /* @__PURE__ */ jsx(ListItemText, { children: copyLabel })
2046
2117
  ] }),
2047
2118
  /* @__PURE__ */ jsxs(MenuItem$1, { onClick: onClickExpand, disabled, id: "expand", children: [
2048
2119
  /* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(OpenDiagonallyRight, {}) }),
2049
- /* @__PURE__ */ jsx(ListItemText, { children: intlConfig.formatMessage({ id: `c4r.button.expand` }) })
2120
+ /* @__PURE__ */ jsx(ListItemText, { children: expandLabel })
2050
2121
  ] })
2051
2122
  ]
2052
2123
  }
@@ -2060,9 +2131,7 @@ function CodeAreaHeader({
2060
2131
  closeable: false,
2061
2132
  autoHideDuration: 4e3,
2062
2133
  onClose: () => setOpenSnackbar(false),
2063
- children: intlConfig.formatMessage({
2064
- id: "c4r.notifications.copiedToClipboard"
2065
- })
2134
+ children: copiedLabel
2066
2135
  }
2067
2136
  )
2068
2137
  ] });
@@ -2074,7 +2143,9 @@ function CodeAreaHeader({
2074
2143
  disabled,
2075
2144
  value: copyValue,
2076
2145
  button: true,
2077
- buttonProps: { size }
2146
+ buttonProps: { size },
2147
+ copyText,
2148
+ copiedText
2078
2149
  }
2079
2150
  ),
2080
2151
  showExpandButton && /* @__PURE__ */ jsx(
@@ -2085,7 +2156,7 @@ function CodeAreaHeader({
2085
2156
  onClick: onClickExpand,
2086
2157
  icon: /* @__PURE__ */ jsx(OpenDiagonallyRight, {}),
2087
2158
  disabled,
2088
- tooltip: intlConfig.formatMessage({ id: `c4r.button.expand` }),
2159
+ tooltip: expandLabel,
2089
2160
  tooltipPlacement: "top"
2090
2161
  }
2091
2162
  )
@@ -3134,10 +3205,13 @@ function DialogHeader({
3134
3205
  secondaryActions,
3135
3206
  "aria-label": ariaLabel,
3136
3207
  closeIcon,
3208
+ closeTooltipText,
3137
3209
  ...otherProps
3138
3210
  }) {
3139
- const intl = useIntl();
3140
- const intlConfig = useImperativeIntl(intl);
3211
+ const closeTooltipLabel = useTranslationWithFallback(
3212
+ "c4r.button.close",
3213
+ closeTooltipText
3214
+ );
3141
3215
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3142
3216
  /* @__PURE__ */ jsxs(DialogTitle, { component: "div", "data-name": "dialog-header", ...otherProps, children: [
3143
3217
  /* @__PURE__ */ jsxs(Main$1, { children: [
@@ -3157,14 +3231,7 @@ function DialogHeader({
3157
3231
  ] }),
3158
3232
  /* @__PURE__ */ jsxs(ItemsWrapper$1, { children: [
3159
3233
  secondaryActions,
3160
- onClose && /* @__PURE__ */ jsx(
3161
- Tooltip,
3162
- {
3163
- title: intlConfig.formatMessage({ id: "c4r.button.close" }),
3164
- placement: "left",
3165
- children: /* @__PURE__ */ jsx(IconButton$1, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsx(CloseIcon, { "data-testid": "CloseIcon" }) })
3166
- }
3167
- )
3234
+ onClose && /* @__PURE__ */ jsx(Tooltip, { title: closeTooltipLabel, placement: "left", children: /* @__PURE__ */ jsx(IconButton$1, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsx(CloseIcon, { "data-testid": "CloseIcon" }) }) })
3168
3235
  ] })
3169
3236
  ] }),
3170
3237
  children
@@ -3173,42 +3240,56 @@ function DialogHeader({
3173
3240
  ] });
3174
3241
  }
3175
3242
  const Content$4 = styled(DialogContent$1, {
3176
- shouldForwardProp: (prop) => !["scrollableContent", "withGutter", "withBottomGutter"].includes(prop)
3177
- })(({ theme, scrollableContent, withGutter, withBottomGutter }) => ({
3178
- display: "flex",
3179
- flexDirection: "column",
3180
- gap: theme.spacing(3),
3181
- padding: 0,
3182
- ...theme.typography.body2,
3183
- color: theme.palette.text.secondary,
3184
- ".MuiAlert-root": {
3185
- minHeight: "auto"
3186
- },
3187
- ...scrollableContent && {
3188
- borderBottom: `1px solid ${theme.palette.divider}`,
3189
- "+ .MuiDivider-root": {
3190
- display: "none"
3191
- }
3192
- },
3193
- ...withGutter && {
3194
- padding: ` ${theme.spacing(1, 2, 0)} !important`,
3195
- ".MuiDialog-paperFullScreen &": {
3196
- padding: `${theme.spacing(2, 2, 0)} !important`
3197
- }
3198
- },
3199
- ...withBottomGutter && {
3200
- paddingBottom: `${theme.spacing(3)} !important`,
3201
- ".MuiDialog-paperFullScreen &": {
3202
- paddingBottom: `${theme.spacing(3)} !important`
3243
+ shouldForwardProp: (prop) => ![
3244
+ "scrollableContent",
3245
+ "withGutter",
3246
+ "withBottomGutter",
3247
+ "spacing"
3248
+ ].includes(prop)
3249
+ })(
3250
+ ({
3251
+ theme,
3252
+ scrollableContent,
3253
+ withGutter,
3254
+ withBottomGutter,
3255
+ spacing = 3
3256
+ }) => ({
3257
+ display: "flex",
3258
+ flexDirection: "column",
3259
+ gap: theme.spacing(spacing),
3260
+ padding: 0,
3261
+ ...theme.typography.body2,
3262
+ color: theme.palette.text.secondary,
3263
+ ".MuiAlert-root": {
3264
+ minHeight: "auto"
3265
+ },
3266
+ ...scrollableContent && {
3267
+ borderBottom: `1px solid ${theme.palette.divider}`,
3268
+ "+ .MuiDivider-root": {
3269
+ display: "none"
3270
+ }
3271
+ },
3272
+ ...withGutter && {
3273
+ padding: ` ${theme.spacing(1, 2, 0)} !important`,
3274
+ ".MuiDialog-paperFullScreen &": {
3275
+ padding: `${theme.spacing(2, 2, 0)} !important`
3276
+ }
3277
+ },
3278
+ ...withBottomGutter && {
3279
+ paddingBottom: `${theme.spacing(3)} !important`,
3280
+ ".MuiDialog-paperFullScreen &": {
3281
+ paddingBottom: `${theme.spacing(3)} !important`
3282
+ }
3203
3283
  }
3204
- }
3205
- }));
3284
+ })
3285
+ );
3206
3286
  function _DialogContent({
3207
3287
  children,
3208
3288
  scrollableContent,
3209
3289
  hasFooterAlert,
3210
3290
  withGutter = true,
3211
3291
  withBottomGutter = true,
3292
+ spacing,
3212
3293
  onScroll,
3213
3294
  ...props
3214
3295
  }, ref) {
@@ -3256,6 +3337,7 @@ function _DialogContent({
3256
3337
  scrollableContent,
3257
3338
  withGutter,
3258
3339
  withBottomGutter: withBottomGutter && withGutter,
3340
+ spacing,
3259
3341
  "data-name": "dialog-content",
3260
3342
  ...props,
3261
3343
  children
@@ -3583,15 +3665,30 @@ function CodeAreaDialogConfirmation({
3583
3665
  onClose,
3584
3666
  onCancel,
3585
3667
  cancelLabelId,
3668
+ cancelText,
3586
3669
  cancelButton,
3587
3670
  closeButton,
3588
3671
  contentLabelId,
3672
+ contentText,
3589
3673
  titleLabelId,
3674
+ titleText,
3590
3675
  severity = "warning",
3591
- content
3676
+ content,
3677
+ leaveText
3592
3678
  }) {
3593
- const intl = useIntl();
3594
- const intlConfig = useImperativeIntl(intl);
3679
+ const titleLabel = useTranslationWithFallback(
3680
+ titleLabelId || "c4r.dialog.confirmation.title",
3681
+ titleText
3682
+ );
3683
+ const cancelLabel = useTranslationWithFallback(
3684
+ cancelLabelId || "c4r.button.cancel",
3685
+ cancelText
3686
+ );
3687
+ const leaveLabel = useTranslationWithFallback("c4r.button.leave", leaveText);
3688
+ const contentLabel = useTranslationWithFallback(
3689
+ contentLabelId || "c4r.dialog.confirmation.content",
3690
+ contentText
3691
+ );
3595
3692
  if (!onClose || !onCancel) {
3596
3693
  return null;
3597
3694
  }
@@ -3600,20 +3697,12 @@ function CodeAreaDialogConfirmation({
3600
3697
  {
3601
3698
  opened: true,
3602
3699
  severity,
3603
- title: intlConfig.formatMessage({
3604
- id: titleLabelId || "c4r.dialog.confirmation.title"
3605
- }),
3700
+ title: titleLabel,
3606
3701
  actions: /* @__PURE__ */ jsxs(Fragment, { children: [
3607
- onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsx(Button, { onClick: onCancel, children: intlConfig.formatMessage({
3608
- id: cancelLabelId || "c4r.button.cancel"
3609
- }) })),
3610
- onClose && (closeButton ? closeButton : /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: onClose, children: intlConfig.formatMessage({
3611
- id: "c4r.button.leave"
3612
- }) }))
3702
+ onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsx(Button, { onClick: onCancel, children: cancelLabel })),
3703
+ onClose && (closeButton ? closeButton : /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: onClose, children: leaveLabel }))
3613
3704
  ] }),
3614
- children: content ? content : intlConfig.formatMessage({
3615
- id: contentLabelId || "c4r.dialog.confirmation.content"
3616
- })
3705
+ children: content ?? contentLabel
3617
3706
  }
3618
3707
  );
3619
3708
  }
@@ -3630,6 +3719,7 @@ function CodeAreaDialog({
3630
3719
  showConfirmation,
3631
3720
  onCancelConfirm,
3632
3721
  onCloseConfirm,
3722
+ confirmationDialogTexts,
3633
3723
  footerProps,
3634
3724
  saveLoading,
3635
3725
  showSaveSnackbar,
@@ -3694,7 +3784,11 @@ function CodeAreaDialog({
3694
3784
  {
3695
3785
  onClose: onCloseConfirm ?? onClose,
3696
3786
  onCancel: onCancelConfirm,
3697
- cancelLabelId: "c4r.button.keepEditing"
3787
+ cancelLabelId: "c4r.button.keepEditing",
3788
+ titleText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.titleText,
3789
+ contentText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.contentText,
3790
+ cancelText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.cancelText,
3791
+ leaveText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.leaveText
3698
3792
  }
3699
3793
  )
3700
3794
  ]
@@ -3862,10 +3956,13 @@ function DatePicker({
3862
3956
  readOnly,
3863
3957
  "aria-label": ariaLabel,
3864
3958
  "data-testid": dataTestId,
3959
+ chooseDateAriaLabel,
3865
3960
  ...props
3866
3961
  }) {
3867
- const intl = useIntl();
3868
- const intlConfig = useImperativeIntl(intl);
3962
+ const chooseDateText = useTranslationWithFallback(
3963
+ "c4r.form.chooseDate",
3964
+ chooseDateAriaLabel
3965
+ );
3869
3966
  return (
3870
3967
  // Don't remove className, it's used for styling
3871
3968
  /* @__PURE__ */ jsx(Box, { className: "CartoDatePicker-root", "data-testid": "date-picker", children: /* @__PURE__ */ jsx(
@@ -3910,16 +4007,7 @@ function DatePicker({
3910
4007
  },
3911
4008
  slots: {
3912
4009
  clearButton: (props2) => /* @__PURE__ */ jsx(ClearButton, { ...props2, size, variant }),
3913
- openPickerButton: (props2) => /* @__PURE__ */ jsx(
3914
- IconButton$1,
3915
- {
3916
- ...props2,
3917
- size,
3918
- "aria-label": intlConfig.formatMessage({
3919
- id: "c4r.form.chooseDate"
3920
- })
3921
- }
3922
- ),
4010
+ openPickerButton: (props2) => /* @__PURE__ */ jsx(IconButton$1, { ...props2, size, "aria-label": chooseDateText }),
3923
4011
  ...slots
3924
4012
  },
3925
4013
  disableOpenPicker: !showCalendar,
@@ -4148,12 +4236,14 @@ function DateRangePicker({
4148
4236
  variant = "outlined",
4149
4237
  startProps,
4150
4238
  endProps,
4239
+ startDateLabel,
4240
+ endDateLabel,
4241
+ startDateCalendarAriaLabel,
4242
+ endDateCalendarAriaLabel,
4151
4243
  "aria-label": ariaLabel,
4152
4244
  "data-testid": dataTestId,
4153
4245
  ...props
4154
4246
  }) {
4155
- const intl = useIntl();
4156
- const intlConfig = useImperativeIntl(intl);
4157
4247
  const [isEndDateOpen, setIsEndDateOpen] = useState(false);
4158
4248
  const [isStartDateOpen, setIsStartDateOpen] = useState(false);
4159
4249
  const [startDate, setStartDate] = useState(
@@ -4164,6 +4254,22 @@ function DateRangePicker({
4164
4254
  (endProps == null ? void 0 : endProps.value) ?? (startProps == null ? void 0 : startProps.value) ?? /* @__PURE__ */ new Date()
4165
4255
  );
4166
4256
  const hasError = error ?? (startProps == null ? void 0 : startProps.error) ?? (endProps == null ? void 0 : endProps.error);
4257
+ const _startDateLabel = useTranslationWithFallback(
4258
+ "c4r.form.startDate",
4259
+ startDateLabel
4260
+ );
4261
+ const _endDateLabel = useTranslationWithFallback(
4262
+ "c4r.form.endDate",
4263
+ endDateLabel
4264
+ );
4265
+ const startCalendarAriaLabel = useTranslationWithFallback(
4266
+ "c4r.form.startDateCalendar",
4267
+ startDateCalendarAriaLabel
4268
+ );
4269
+ const endCalendarAriaLabel = useTranslationWithFallback(
4270
+ "c4r.form.endDateCalendar",
4271
+ endDateCalendarAriaLabel
4272
+ );
4167
4273
  const handleStartDateChange = (value, context) => {
4168
4274
  setStartDate(value);
4169
4275
  if (startProps == null ? void 0 : startProps.onChange) {
@@ -4217,13 +4323,11 @@ function DateRangePicker({
4217
4323
  ...startProps,
4218
4324
  value: (startProps == null ? void 0 : startProps.value) ?? startDate,
4219
4325
  maxDate: endDate ?? void 0,
4220
- label: (startProps == null ? void 0 : startProps.label) ?? intlConfig.formatMessage({ id: "c4r.form.startDate" }),
4326
+ label: (startProps == null ? void 0 : startProps.label) ?? _startDateLabel,
4221
4327
  slotProps: {
4222
4328
  popper: {
4223
4329
  placement: "bottom-start",
4224
- "aria-label": intlConfig.formatMessage({
4225
- id: "c4r.form.startDateCalendar"
4226
- })
4330
+ "aria-label": startCalendarAriaLabel
4227
4331
  },
4228
4332
  ...startProps == null ? void 0 : startProps.slotProps
4229
4333
  },
@@ -4258,9 +4362,7 @@ function DateRangePicker({
4258
4362
  minDate: startDate ?? void 0,
4259
4363
  slotProps: {
4260
4364
  popper: {
4261
- "aria-label": intlConfig.formatMessage({
4262
- id: "c4r.form.endDateCalendar"
4263
- })
4365
+ "aria-label": endCalendarAriaLabel
4264
4366
  },
4265
4367
  ...endProps == null ? void 0 : endProps.slotProps
4266
4368
  },
@@ -4276,7 +4378,7 @@ function DateRangePicker({
4276
4378
  ),
4277
4379
  ...endProps == null ? void 0 : endProps.slots
4278
4380
  },
4279
- label: (endProps == null ? void 0 : endProps.label) ?? intlConfig.formatMessage({ id: "c4r.form.endDate" }),
4381
+ label: (endProps == null ? void 0 : endProps.label) ?? _endDateLabel,
4280
4382
  error: (endProps == null ? void 0 : endProps.error) ?? error,
4281
4383
  open: isEndDateOpen,
4282
4384
  onOpen: handleEndDateOpen,
@@ -4336,12 +4438,16 @@ function TimePicker({
4336
4438
  ampm = true,
4337
4439
  views = ["hours", "minutes"],
4338
4440
  format,
4441
+ openPickerAriaLabel,
4339
4442
  "data-testid": dataTestId,
4340
4443
  "aria-label": ariaLabel,
4341
4444
  ...props
4342
4445
  }) {
4343
- const intl = useIntl();
4344
- const intlConfig = useImperativeIntl(intl);
4446
+ const fieldLabel = useTranslationWithFallback("c4r.form.time", label);
4447
+ const chooseDateAriaLabel = useTranslationWithFallback(
4448
+ "c4r.form.chooseDate",
4449
+ openPickerAriaLabel
4450
+ );
4345
4451
  const inputRef = useRef(null);
4346
4452
  const [inputWidth, setInputWidth] = useState(0);
4347
4453
  useEffect(() => {
@@ -4375,7 +4481,7 @@ function TimePicker({
4375
4481
  label: /* @__PURE__ */ jsx(
4376
4482
  LabelWithIndicator,
4377
4483
  {
4378
- label: label ?? intlConfig.formatMessage({ id: "c4r.form.time" }),
4484
+ label: fieldLabel,
4379
4485
  type,
4380
4486
  icon: labelHelpTooltip && /* @__PURE__ */ jsx(Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsx(HelpOutline, { htmlColor: "text.secondary" }) })
4381
4487
  }
@@ -4415,9 +4521,7 @@ function TimePicker({
4415
4521
  {
4416
4522
  ...props2,
4417
4523
  size,
4418
- "aria-label": intlConfig.formatMessage({
4419
- id: "c4r.form.chooseDate"
4420
- })
4524
+ "aria-label": chooseDateAriaLabel
4421
4525
  }
4422
4526
  ),
4423
4527
  ...slots
@@ -4447,12 +4551,16 @@ function DateTimePicker({
4447
4551
  ampm = true,
4448
4552
  views = ["hours", "minutes"],
4449
4553
  format,
4554
+ openPickerAriaLabel,
4450
4555
  "data-testid": dataTestId,
4451
4556
  "aria-label": ariaLabel,
4452
4557
  ...props
4453
4558
  }) {
4454
- const intl = useIntl();
4455
- const intlConfig = useImperativeIntl(intl);
4559
+ const fieldLabel = useTranslationWithFallback("c4r.form.time", label);
4560
+ const chooseDateAriaLabel = useTranslationWithFallback(
4561
+ "c4r.form.chooseDate",
4562
+ openPickerAriaLabel
4563
+ );
4456
4564
  return /* @__PURE__ */ jsx(
4457
4565
  DateFieldContainer,
4458
4566
  {
@@ -4469,7 +4577,7 @@ function DateTimePicker({
4469
4577
  label: /* @__PURE__ */ jsx(
4470
4578
  LabelWithIndicator,
4471
4579
  {
4472
- label: label ?? intlConfig.formatMessage({ id: "c4r.form.time" }),
4580
+ label: fieldLabel,
4473
4581
  type,
4474
4582
  icon: labelHelpTooltip && /* @__PURE__ */ jsx(Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsx(HelpOutline, { htmlColor: "text.secondary" }) })
4475
4583
  }
@@ -4501,9 +4609,7 @@ function DateTimePicker({
4501
4609
  {
4502
4610
  ...props2,
4503
4611
  size,
4504
- "aria-label": intlConfig.formatMessage({
4505
- id: "c4r.form.chooseDate"
4506
- })
4612
+ "aria-label": chooseDateAriaLabel
4507
4613
  }
4508
4614
  ),
4509
4615
  ...slots
@@ -4616,37 +4722,6 @@ function _AccordionGroup({
4616
4722
  );
4617
4723
  }
4618
4724
  const AccordionGroup = forwardRef(_AccordionGroup);
4619
- const sizes = {
4620
- large: 5,
4621
- medium: 4,
4622
- small: 3,
4623
- xsmall: 2.25
4624
- };
4625
- const StyledAvatar = styled(Avatar$1, {
4626
- shouldForwardProp: (prop) => prop !== "size" && prop !== "disabled"
4627
- })(({ theme, size = "medium", disabled = false }) => ({
4628
- width: theme.spacing(sizes[size]),
4629
- height: theme.spacing(sizes[size]),
4630
- ...theme.typography.subtitle1,
4631
- ...size === "large" && {
4632
- ...theme.typography.h6
4633
- },
4634
- ...size === "small" && {
4635
- ...theme.typography.caption,
4636
- fontWeight: 500
4637
- },
4638
- ...size === "xsmall" && {
4639
- ...theme.typography.caption,
4640
- fontWeight: 500,
4641
- svg: {
4642
- width: ICON_SIZE_SMALL,
4643
- height: ICON_SIZE_SMALL
4644
- }
4645
- },
4646
- ...disabled && {
4647
- opacity: 0.6
4648
- }
4649
- }));
4650
4725
  function _Avatar({
4651
4726
  size,
4652
4727
  disabled,
@@ -4655,7 +4730,7 @@ function _Avatar({
4655
4730
  ...otherProps
4656
4731
  }, ref) {
4657
4732
  return /* @__PURE__ */ jsx(
4658
- StyledAvatar,
4733
+ Avatar$1,
4659
4734
  {
4660
4735
  ...otherProps,
4661
4736
  ref,
@@ -4852,6 +4927,9 @@ function _FilterDropdown({
4852
4927
  responsive,
4853
4928
  tooltipLabel,
4854
4929
  tooltipPlacement,
4930
+ tooltipProps,
4931
+ buttonProps,
4932
+ iconButtonProps,
4855
4933
  slotProps,
4856
4934
  MenuListProps,
4857
4935
  ...props
@@ -4889,14 +4967,30 @@ function _FilterDropdown({
4889
4967
  "data-color": buttonColor
4890
4968
  };
4891
4969
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4892
- /* @__PURE__ */ jsx(Tooltip, { title: tooltipLabel, placement: tooltipPlacement, children: /* @__PURE__ */ jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsx(IconButton, { ...commonButtonProps, icon }) : /* @__PURE__ */ jsx(
4893
- Button,
4970
+ /* @__PURE__ */ jsx(
4971
+ Tooltip,
4894
4972
  {
4895
- ...commonButtonProps,
4896
- endIcon: isOpen ? /* @__PURE__ */ jsx(ArrowUp, {}) : /* @__PURE__ */ jsx(ArrowDown, {}),
4897
- children: menuLabel
4973
+ title: tooltipLabel,
4974
+ placement: tooltipPlacement,
4975
+ ...tooltipProps,
4976
+ children: /* @__PURE__ */ jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsx(
4977
+ IconButton,
4978
+ {
4979
+ ...commonButtonProps,
4980
+ icon,
4981
+ ...iconButtonProps
4982
+ }
4983
+ ) : /* @__PURE__ */ jsx(
4984
+ Button,
4985
+ {
4986
+ ...commonButtonProps,
4987
+ endIcon: isOpen ? /* @__PURE__ */ jsx(ArrowUp, {}) : /* @__PURE__ */ jsx(ArrowDown, {}),
4988
+ ...buttonProps,
4989
+ children: menuLabel
4990
+ }
4991
+ ) })
4898
4992
  }
4899
- ) }) }),
4993
+ ),
4900
4994
  /* @__PURE__ */ jsxs(
4901
4995
  Menu,
4902
4996
  {
@@ -4946,6 +5040,291 @@ function _FilterDropdown({
4946
5040
  const FilterDropdown = forwardRef(
4947
5041
  _FilterDropdown
4948
5042
  );
5043
+ const SearchIcon = styled(Search, {
5044
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
5045
+ })(
5046
+ ({ theme, minimized, disabled }) => ({
5047
+ cursor: !disabled && minimized ? "pointer" : "inherit",
5048
+ width: ICON_SIZE_MEDIUM,
5049
+ height: ICON_SIZE_MEDIUM,
5050
+ path: {
5051
+ fillOpacity: 1,
5052
+ fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
5053
+ }
5054
+ })
5055
+ );
5056
+ const ClearSearchIcon = styled(Cancel)(({ theme }) => ({
5057
+ color: `${theme.palette.text.hint} !important`
5058
+ }));
5059
+ const LoadingSearchIcon = styled(CircularProgress)(({ theme }) => ({
5060
+ svg: {
5061
+ color: `${theme.palette.primary.main} !important`
5062
+ }
5063
+ }));
5064
+ const SearchInputAdornment = styled(InputAdornment, {
5065
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
5066
+ })(
5067
+ ({ theme, minimized, expanded }) => ({
5068
+ // Start adornment
5069
+ transition: theme.transitions.create(["width", "margin"], {
5070
+ easing: theme.transitions.easing.easeInOut,
5071
+ duration: theme.transitions.duration.short
5072
+ }),
5073
+ "&.MuiInputAdornment-positionStart": {
5074
+ marginLeft: minimized ? theme.spacing(1) : void 0
5075
+ },
5076
+ // End adornment
5077
+ "&.MuiInputAdornment-positionEnd": {
5078
+ minWidth: theme.spacing(4),
5079
+ "&.MuiInputAdornment-sizeSmall": {
5080
+ minWidth: theme.spacing(3)
5081
+ }
5082
+ },
5083
+ ...expanded && !minimized && {
5084
+ "&.MuiInputAdornment-root": {
5085
+ minWidth: theme.spacing(9),
5086
+ "&.MuiInputAdornment-sizeSmall": {
5087
+ minWidth: theme.spacing(7)
5088
+ }
5089
+ }
5090
+ }
5091
+ })
5092
+ );
5093
+ const SearchFieldBase = styled(TextField, {
5094
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused" && prop !== "emphasis"
5095
+ })(({ theme, emphasis = "filled", minimized, isInputFocused }) => ({
5096
+ "&.MuiTextField-root .MuiInputBase-root": {
5097
+ paddingRight: theme.spacing(1),
5098
+ transition: theme.transitions.create(["width", "padding"], {
5099
+ easing: theme.transitions.easing.easeInOut,
5100
+ duration: theme.transitions.duration.standard
5101
+ }),
5102
+ "&.MuiInputBase-sizeSmall": {
5103
+ paddingRight: theme.spacing(0.5)
5104
+ },
5105
+ "&:before": {
5106
+ border: "none !important",
5107
+ "&:hover": {
5108
+ border: "none !important"
5109
+ }
5110
+ },
5111
+ // Input
5112
+ "& .MuiInputBase-input": {
5113
+ pointerEvents: isInputFocused ? "auto" : "none",
5114
+ // Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
5115
+ transition: theme.transitions.create("width", {
5116
+ easing: theme.transitions.easing.easeInOut,
5117
+ duration: theme.transitions.duration.standard
5118
+ })
5119
+ },
5120
+ // Error state
5121
+ "&.Mui-error": {
5122
+ "&::after": {
5123
+ borderColor: "transparent !important"
5124
+ }
5125
+ },
5126
+ ...minimized && {
5127
+ display: "flex",
5128
+ alignItems: "center",
5129
+ padding: 0,
5130
+ width: theme.spacing(6),
5131
+ cursor: "pointer",
5132
+ "& .MuiInputBase-input": {
5133
+ width: 0
5134
+ },
5135
+ "&.MuiInputBase-sizeSmall": {
5136
+ padding: 0,
5137
+ width: theme.spacing(4)
5138
+ }
5139
+ }
5140
+ },
5141
+ // Variants
5142
+ ...emphasis === "filled" && {
5143
+ "& .MuiInputBase-root": {
5144
+ backgroundColor: minimized ? "transparent !important" : void 0,
5145
+ "&:hover": {
5146
+ backgroundColor: `${theme.palette.action.hover} !important`
5147
+ },
5148
+ // not disabled
5149
+ "&:not(.Mui-disabled):hover": {
5150
+ backgroundColor: `${theme.palette.action.hover} !important`
5151
+ }
5152
+ }
5153
+ },
5154
+ ...emphasis === "transparent" && {
5155
+ "& .MuiInputBase-root": {
5156
+ backgroundColor: "transparent !important",
5157
+ "&:hover": {
5158
+ backgroundColor: minimized ? `${theme.palette.action.hover} !important` : "transparent !important"
5159
+ },
5160
+ "&.Mui-disabled": {
5161
+ backgroundColor: "transparent !important"
5162
+ }
5163
+ }
5164
+ },
5165
+ ...emphasis === "floating" && {
5166
+ "& .MuiInputBase-root": {
5167
+ backgroundColor: `${theme.palette.background.paper} !important`,
5168
+ boxShadow: theme.shadows[1],
5169
+ "&:hover": {
5170
+ backgroundColor: minimized ? `${theme.palette.action.hover} !important` : `${theme.palette.background.paper} !important`
5171
+ },
5172
+ "&.Mui-disabled": {
5173
+ backgroundColor: `${theme.palette.background.paper} !important`
5174
+ }
5175
+ }
5176
+ }
5177
+ }));
5178
+ const SearchFieldEndAdornment = ({
5179
+ disabled,
5180
+ showClearButton = true,
5181
+ loading,
5182
+ size,
5183
+ endAdornment,
5184
+ clearButton,
5185
+ clearButtonLabel,
5186
+ onClear
5187
+ }) => {
5188
+ if (!showClearButton && !endAdornment && !loading) {
5189
+ return null;
5190
+ }
5191
+ return /* @__PURE__ */ jsx(
5192
+ SearchInputAdornment,
5193
+ {
5194
+ position: "end",
5195
+ expanded: Boolean(endAdornment && showClearButton),
5196
+ children: /* @__PURE__ */ jsxs(
5197
+ Stack,
5198
+ {
5199
+ direction: "row",
5200
+ spacing: 1,
5201
+ sx: {
5202
+ alignItems: "center"
5203
+ },
5204
+ children: [
5205
+ loading ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : showClearButton ? clearButton ?? /* @__PURE__ */ jsx(
5206
+ IconButton,
5207
+ {
5208
+ onClick: onClear,
5209
+ size,
5210
+ color: "default",
5211
+ disabled,
5212
+ tooltip: clearButtonLabel,
5213
+ "aria-label": clearButtonLabel,
5214
+ icon: /* @__PURE__ */ jsx(ClearSearchIcon, {})
5215
+ }
5216
+ ) : null,
5217
+ endAdornment
5218
+ ]
5219
+ }
5220
+ )
5221
+ }
5222
+ );
5223
+ };
5224
+ const SearchFieldStartAdornment = ({
5225
+ minimized,
5226
+ loading,
5227
+ startAdornment,
5228
+ disabled
5229
+ }) => {
5230
+ return /* @__PURE__ */ jsx(SearchInputAdornment, { position: "start", minimized, children: loading && minimized ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : startAdornment || /* @__PURE__ */ jsx(SearchIcon, { disabled, minimized }) });
5231
+ };
5232
+ function _SearchField({
5233
+ value,
5234
+ defaultValue,
5235
+ placeholder,
5236
+ disabled,
5237
+ minimized = false,
5238
+ loading = false,
5239
+ variant = "filled",
5240
+ size = "small",
5241
+ InputProps,
5242
+ inputProps,
5243
+ startAdornment,
5244
+ endAdornment,
5245
+ onFocus,
5246
+ onBlur,
5247
+ onChange,
5248
+ onClick,
5249
+ onResetSearch,
5250
+ showClearButton = true,
5251
+ clearButtonLabel,
5252
+ clearButton,
5253
+ ...otherProps
5254
+ }, ref) {
5255
+ const [isInputFocused, setIsInputFocused] = useState(false);
5256
+ const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
5257
+ const clearButtonLabelValue = useTranslationWithFallback(
5258
+ "c4r.button.clear",
5259
+ clearButtonLabel
5260
+ );
5261
+ const handleFocus = (event) => {
5262
+ setIsInputFocused(true);
5263
+ onFocus == null ? void 0 : onFocus(event);
5264
+ };
5265
+ const handleBlur = (event) => {
5266
+ setIsInputFocused(false);
5267
+ onBlur == null ? void 0 : onBlur(event);
5268
+ };
5269
+ const handleClear = () => {
5270
+ onResetSearch == null ? void 0 : onResetSearch();
5271
+ onChange == null ? void 0 : onChange({ target: { value: "" } });
5272
+ };
5273
+ return /* @__PURE__ */ jsx(
5274
+ SearchFieldBase,
5275
+ {
5276
+ defaultValue,
5277
+ value: minimized ? "" : value,
5278
+ placeholder: minimized ? "" : placeholder,
5279
+ onChange,
5280
+ onClick,
5281
+ variant: "filled",
5282
+ emphasis: variant,
5283
+ size,
5284
+ focused: false,
5285
+ isInputFocused,
5286
+ disabled,
5287
+ minimized,
5288
+ InputProps: {
5289
+ onFocus: handleFocus,
5290
+ onBlur: handleBlur,
5291
+ startAdornment: /* @__PURE__ */ jsx(
5292
+ SearchFieldStartAdornment,
5293
+ {
5294
+ minimized,
5295
+ loading,
5296
+ disabled,
5297
+ startAdornment
5298
+ }
5299
+ ),
5300
+ endAdornment: !minimized && /* @__PURE__ */ jsx(
5301
+ SearchFieldEndAdornment,
5302
+ {
5303
+ disabled,
5304
+ loading,
5305
+ showClearButton: clearButtonVisibility,
5306
+ clearButton,
5307
+ clearButtonLabel: clearButtonLabelValue,
5308
+ onClear: handleClear,
5309
+ size,
5310
+ endAdornment
5311
+ }
5312
+ ),
5313
+ ...InputProps
5314
+ },
5315
+ inputProps: {
5316
+ role: "searchbox",
5317
+ ...inputProps
5318
+ },
5319
+ role: "search",
5320
+ "data-variant": variant,
5321
+ "data-name": "search-field",
5322
+ ref,
5323
+ ...otherProps
5324
+ }
5325
+ );
5326
+ }
5327
+ const SearchField = forwardRef(_SearchField);
4949
5328
  const MAX_WIDTH = 480;
4950
5329
  const SnackbarRoot = styled(Snackbar$1)(({ theme }) => ({
4951
5330
  bottom: theme.spacing(2),
@@ -5050,10 +5429,13 @@ function Snackbar({
5050
5429
  onClose = () => void 0,
5051
5430
  autoWidth,
5052
5431
  icon,
5432
+ closeTooltipText,
5053
5433
  ...rest
5054
5434
  }) {
5055
- const intl = useIntl();
5056
- const intlConfig = useImperativeIntl(intl);
5435
+ const closeTooltipLabel = useTranslationWithFallback(
5436
+ "c4r.button.close",
5437
+ closeTooltipText
5438
+ );
5057
5439
  const isNeutral = severity === "neutral";
5058
5440
  const disabledIcon = icon === false || isNeutral && !icon;
5059
5441
  const disabledAutoHide = autoHideDuration === null;
@@ -5094,9 +5476,7 @@ function Snackbar({
5094
5476
  color: "default",
5095
5477
  onClick: (e) => onClose(e, "timeout"),
5096
5478
  icon: /* @__PURE__ */ jsx(CloseOutlined, {}),
5097
- tooltip: intlConfig.formatMessage({
5098
- id: "c4r.button.close"
5099
- })
5479
+ tooltip: closeTooltipLabel
5100
5480
  }
5101
5481
  ) })
5102
5482
  ]
@@ -5419,10 +5799,26 @@ function useFileUpload({
5419
5799
  files,
5420
5800
  multiple,
5421
5801
  placeholder,
5422
- uploadInputRef
5802
+ uploadInputRef,
5803
+ filesSelectedText,
5804
+ dragPlaceholderText,
5805
+ dragActivePlaceholderText
5423
5806
  }) {
5424
- const intl = useIntl();
5425
- const intlConfig = useImperativeIntl(intl);
5807
+ const filesSelectedLabel = useTranslationWithFallback(
5808
+ "c4r.form.filesSelected",
5809
+ filesSelectedText,
5810
+ { count: (files == null ? void 0 : files.length) ?? 0 }
5811
+ );
5812
+ const dragPlaceholderLabel = useTranslationWithFallback(
5813
+ "c4r.form.dragPlaceholder",
5814
+ dragPlaceholderText,
5815
+ { count: multiple ? 0 : 1 }
5816
+ );
5817
+ const dragActivePlaceholderLabel = useTranslationWithFallback(
5818
+ "c4r.form.dragActivePlaceholder",
5819
+ dragActivePlaceholderText,
5820
+ { count: multiple ? 0 : 1 }
5821
+ );
5426
5822
  const [filesText, setFilesText] = useState("");
5427
5823
  const [dragOver, setDragOver] = useState(false);
5428
5824
  useEffect(() => {
@@ -5431,14 +5827,9 @@ function useFileUpload({
5431
5827
  } else if (files.length === 1) {
5432
5828
  setFilesText(files[0].name);
5433
5829
  } else {
5434
- setFilesText(
5435
- intlConfig.formatMessage(
5436
- { id: "c4r.form.filesSelected" },
5437
- { count: files.length }
5438
- )
5439
- );
5830
+ setFilesText(filesSelectedLabel);
5440
5831
  }
5441
- }, [files, intlConfig]);
5832
+ }, [files, filesSelectedLabel]);
5442
5833
  const handleBrowse = () => {
5443
5834
  var _a;
5444
5835
  (_a = uploadInputRef.current) == null ? void 0 : _a.click();
@@ -5478,22 +5869,11 @@ function useFileUpload({
5478
5869
  onChange == null ? void 0 : onChange([]);
5479
5870
  };
5480
5871
  const getPlaceholder = useMemo(() => {
5481
- const defaultPlaceholder = intlConfig.formatMessage(
5482
- { id: `c4r.form.dragPlaceholder` },
5483
- { count: multiple ? 0 : 1 }
5484
- );
5485
- const dragPlaceholder = intlConfig.formatMessage(
5486
- { id: `c4r.form.dragActivePlaceholder` },
5487
- { count: multiple ? 0 : 1 }
5488
- );
5489
- let placeholderText = "";
5490
5872
  if (dragOver) {
5491
- placeholderText = dragPlaceholder;
5492
- } else {
5493
- placeholderText = placeholder ?? defaultPlaceholder;
5873
+ return dragActivePlaceholderLabel;
5494
5874
  }
5495
- return placeholderText;
5496
- }, [dragOver, multiple, placeholder, intlConfig]);
5875
+ return placeholder ?? dragPlaceholderLabel;
5876
+ }, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
5497
5877
  const inputEvents = {
5498
5878
  onDragOver: handleDragOver,
5499
5879
  onDragLeave: handleDragLeave,
@@ -5768,6 +6148,7 @@ export {
5768
6148
  MultipleSelectField,
5769
6149
  PasswordField,
5770
6150
  ScreenReaderOnly,
6151
+ SearchField,
5771
6152
  SelectField,
5772
6153
  Snackbar,
5773
6154
  SplitButton,