@carto/meridian-ds 2.6.1 → 2.6.2-alpha.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 (134) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{Alert-DHd9hCGz.js → Alert-1A6BG2aO.js} +5 -41
  3. package/dist/{Alert-DOeOwxOe.cjs → Alert-eVzJvC47.cjs} +4 -40
  4. package/dist/{MenuItem-CYJN2OVU.cjs → MenuItem-6ZIV5V7a.cjs} +1 -1
  5. package/dist/{MenuItem-MUmADf3e.js → MenuItem-DgHhHW-j.js} +1 -1
  6. package/dist/components/index.cjs +329 -235
  7. package/dist/components/index.js +328 -234
  8. package/dist/{css-utils-CCi3p7os.cjs → css-utils-BNXxLCyb.cjs} +27 -11
  9. package/dist/{css-utils-WejOmkiI.js → css-utils-lmkjeCdF.js} +29 -13
  10. package/dist/custom-icons/index.cjs +771 -609
  11. package/dist/custom-icons/index.js +771 -609
  12. package/dist/theme/index.cjs +61 -5
  13. package/dist/theme/index.js +63 -7
  14. package/dist/types/components/Alert/Alert.d.ts.map +1 -1
  15. package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
  16. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts +1 -0
  17. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts.map +1 -1
  18. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts +1 -1
  19. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts.map +1 -1
  20. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts +1 -1
  21. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
  22. package/dist/types/components/Autocomplete/CreatableAutocomplete/useCreatableAutocomplete.d.ts.map +1 -1
  23. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts +1 -1
  24. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts.map +1 -1
  25. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts +1 -1
  26. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts.map +1 -1
  27. package/dist/types/components/Autocomplete/MultipleAutocomplete/useMultipleAutocomplete.d.ts.map +1 -1
  28. package/dist/types/components/Autocomplete/types.d.ts +13 -1
  29. package/dist/types/components/Autocomplete/types.d.ts.map +1 -1
  30. package/dist/types/components/Avatar/Avatar.d.ts +0 -2
  31. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  32. package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts +7 -1
  33. package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts.map +1 -1
  34. package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts +5 -1
  35. package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts.map +1 -1
  36. package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts +3 -1
  37. package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts.map +1 -1
  38. package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts +5 -1
  39. package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts.map +1 -1
  40. package/dist/types/components/CopiableComponent/CopiableComponent.d.ts.map +1 -1
  41. package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts +3 -0
  42. package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts.map +1 -1
  43. package/dist/types/components/CopiableComponent/types.d.ts +8 -1
  44. package/dist/types/components/CopiableComponent/types.d.ts.map +1 -1
  45. package/dist/types/components/CopiableInputText/CopiableInputText.d.ts +9 -3
  46. package/dist/types/components/CopiableInputText/CopiableInputText.d.ts.map +1 -1
  47. package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts +28 -3
  48. package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts.map +1 -1
  49. package/dist/types/components/CopiableInputText/types.d.ts +4 -1
  50. package/dist/types/components/CopiableInputText/types.d.ts.map +1 -1
  51. package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts +1 -1
  52. package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts.map +1 -1
  53. package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts +3 -0
  54. package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts.map +1 -1
  55. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts +1 -1
  56. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  57. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts +3 -0
  58. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -1
  59. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts +1 -1
  60. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  61. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts +3 -0
  62. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
  63. package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts +1 -1
  64. package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts.map +1 -1
  65. package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts +3 -0
  66. package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts.map +1 -1
  67. package/dist/types/components/DatePickers/types.d.ts +7 -0
  68. package/dist/types/components/DatePickers/types.d.ts.map +1 -1
  69. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts +48 -0
  70. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts.map +1 -1
  71. package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts.map +1 -1
  72. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts +2 -0
  73. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts.map +1 -0
  74. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts +1 -1
  75. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
  76. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts +14 -0
  77. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts.map +1 -1
  78. package/dist/types/components/Dialog/types.d.ts +6 -0
  79. package/dist/types/components/Dialog/types.d.ts.map +1 -1
  80. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts +1 -1
  81. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts.map +1 -1
  82. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts +48 -0
  83. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts.map +1 -1
  84. package/dist/types/components/FilterDropdown/types.d.ts +8 -0
  85. package/dist/types/components/FilterDropdown/types.d.ts.map +1 -1
  86. package/dist/types/components/Menu/MenuItemFilter/MenuItemFilter.d.ts.map +1 -1
  87. package/dist/types/components/Menu/types.d.ts +1 -0
  88. package/dist/types/components/Menu/types.d.ts.map +1 -1
  89. package/dist/types/components/PasswordField/PasswordField.d.ts +10 -1
  90. package/dist/types/components/PasswordField/PasswordField.d.ts.map +1 -1
  91. package/dist/types/components/PasswordField/PasswordField.stories.d.ts +10 -1
  92. package/dist/types/components/PasswordField/PasswordField.stories.d.ts.map +1 -1
  93. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
  94. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts +22 -2
  95. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts.map +1 -1
  96. package/dist/types/components/SelectField/types.d.ts +4 -0
  97. package/dist/types/components/SelectField/types.d.ts.map +1 -1
  98. package/dist/types/components/Snackbar/Snackbar.d.ts +2 -1
  99. package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
  100. package/dist/types/components/Snackbar/Snackbar.stories.d.ts +15 -0
  101. package/dist/types/components/Snackbar/Snackbar.stories.d.ts.map +1 -1
  102. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +3 -0
  103. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
  104. package/dist/types/components/UploadField/useFileUpload.d.ts +4 -1
  105. package/dist/types/components/UploadField/useFileUpload.d.ts.map +1 -1
  106. package/dist/types/custom-icons/ApiAccessToken.d.ts +4 -0
  107. package/dist/types/custom-icons/ApiAccessToken.d.ts.map +1 -0
  108. package/dist/types/custom-icons/ApiBaseUrl.d.ts +4 -0
  109. package/dist/types/custom-icons/ApiBaseUrl.d.ts.map +1 -0
  110. package/dist/types/custom-icons/AppCredentials.d.ts +4 -0
  111. package/dist/types/custom-icons/AppCredentials.d.ts.map +1 -0
  112. package/dist/types/custom-icons/M2mOauthClient.d.ts +4 -0
  113. package/dist/types/custom-icons/M2mOauthClient.d.ts.map +1 -0
  114. package/dist/types/custom-icons/SpaOauthClient.d.ts +4 -0
  115. package/dist/types/custom-icons/SpaOauthClient.d.ts.map +1 -0
  116. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts +4 -0
  117. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts.map +1 -0
  118. package/dist/types/custom-icons/index.d.ts +6 -0
  119. package/dist/types/custom-icons/index.d.ts.map +1 -1
  120. package/dist/types/theme/components/data-display.d.ts.map +1 -1
  121. package/dist/types/theme/components/feedback.d.ts.map +1 -1
  122. package/dist/types/theme/types.d.ts +11 -0
  123. package/dist/types/theme/types.d.ts.map +1 -1
  124. package/dist/types/utils/useTranslationWithFallback.d.ts +39 -0
  125. package/dist/types/utils/useTranslationWithFallback.d.ts.map +1 -0
  126. package/dist/types/utils/useTranslationWithFallback.test.d.ts +2 -0
  127. package/dist/types/utils/useTranslationWithFallback.test.d.ts.map +1 -0
  128. package/dist/widgets/index.cjs +2 -2
  129. package/dist/widgets/index.js +2 -2
  130. package/package.json +3 -2
  131. package/dist/types/utils/useTranslationFallback.d.ts +0 -20
  132. package/dist/types/utils/useTranslationFallback.d.ts.map +0 -1
  133. package/dist/types/utils/useTranslationFallback.test.d.ts +0 -2
  134. package/dist/types/utils/useTranslationFallback.test.d.ts.map +0 -1
@@ -4,12 +4,11 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const material = require("@mui/material");
6
6
  const iconsMaterial = require("@mui/icons-material");
7
- const Alert$1 = require("../Alert-DOeOwxOe.cjs");
8
- const cssUtils = require("../css-utils-CCi3p7os.cjs");
7
+ const cssUtils = require("../css-utils-BNXxLCyb.cjs");
8
+ const Alert$1 = require("../Alert-eVzJvC47.cjs");
9
9
  const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
10
10
  const OpenDiagonallyRight = require("../OpenDiagonallyRight-CpL4ROwg.cjs");
11
- const reactIntl = require("react-intl");
12
- const MenuItem = require("../MenuItem-CYJN2OVU.cjs");
11
+ const MenuItem = require("../MenuItem-6ZIV5V7a.cjs");
13
12
  require("cartocolor");
14
13
  const reactWindow = require("react-window");
15
14
  const reactCodemirror2 = require("react-codemirror2");
@@ -38,6 +37,7 @@ require("codemirror/addon/fold/markdown-fold.js");
38
37
  require("codemirror/addon/fold/comment-fold.js");
39
38
  const ClickAwayListener = require("@mui/material/ClickAwayListener");
40
39
  const DatePicker$1 = require("@mui/x-date-pickers/DatePicker");
40
+ const reactIntl = require("react-intl");
41
41
  const xDatePickers = require("@mui/x-date-pickers");
42
42
  const TimePicker$1 = require("@mui/x-date-pickers/TimePicker");
43
43
  const DateTimePicker$1 = require("@mui/x-date-pickers/DateTimePicker");
@@ -69,7 +69,7 @@ function _Button({
69
69
  "aria-describedby": ariaDescribedby,
70
70
  ...otherProps
71
71
  }, ref) {
72
- const screenReaderTextValue = Alert$1.useTranslationFallback(
72
+ const screenReaderTextValue = cssUtils.useTranslationWithFallback(
73
73
  "c4r.button.opensInNewTab",
74
74
  screenReaderText
75
75
  );
@@ -282,14 +282,25 @@ function _LabelWithIndicator({
282
282
  );
283
283
  }
284
284
  const LabelWithIndicator = React.forwardRef(_LabelWithIndicator);
285
- function _PasswordField({ InputProps, size = "small", disabled, ...otherProps }, ref) {
286
- const intl = reactIntl.useIntl();
287
- const intlConfig = cssUtils.useImperativeIntl(intl);
285
+ function _PasswordField({
286
+ InputProps,
287
+ size = "small",
288
+ disabled,
289
+ showPasswordText,
290
+ hidePasswordText,
291
+ ...otherProps
292
+ }, ref) {
293
+ const showPasswordLabel = cssUtils.useTranslationWithFallback(
294
+ "c4r.form.showPassword",
295
+ showPasswordText
296
+ );
297
+ const hidePasswordLabel = cssUtils.useTranslationWithFallback(
298
+ "c4r.form.hidePassword",
299
+ hidePasswordText
300
+ );
288
301
  const [showPassword, setShowPassword] = React.useState(false);
289
302
  const handleClickShowPassword = () => setShowPassword(!showPassword);
290
- const showPasswordLabel = intlConfig.formatMessage({
291
- id: `c4r.form.${showPassword ? "hidePassword" : "showPassword"}`
292
- });
303
+ const label = showPassword ? hidePasswordLabel : showPasswordLabel;
293
304
  return /* @__PURE__ */ jsxRuntime.jsx(
294
305
  material.TextField,
295
306
  {
@@ -311,8 +322,8 @@ function _PasswordField({ InputProps, size = "small", disabled, ...otherProps },
311
322
  disabled,
312
323
  onClick: handleClickShowPassword,
313
324
  icon: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}),
314
- tooltip: showPasswordLabel,
315
- "aria-label": showPasswordLabel
325
+ tooltip: label,
326
+ "aria-label": label
316
327
  }
317
328
  ) })
318
329
  },
@@ -522,11 +533,14 @@ function _MenuItemFilter({
522
533
  areAnySelected,
523
534
  selectAll,
524
535
  selectAllDisabled,
536
+ selectAllText,
525
537
  "aria-label": ariaLabel,
526
538
  "data-testid": dataTestId
527
539
  }, ref) {
528
- const intl = reactIntl.useIntl();
529
- const intlConfig = cssUtils.useImperativeIntl(intl);
540
+ const selectAllLabel = cssUtils.useTranslationWithFallback(
541
+ "c4r.form.selectAll",
542
+ selectAllText
543
+ );
530
544
  return /* @__PURE__ */ jsxRuntime.jsx(
531
545
  StyledMenuItem$1,
532
546
  {
@@ -554,7 +568,7 @@ function _MenuItemFilter({
554
568
  disabled: selectAllDisabled
555
569
  }
556
570
  ),
557
- intlConfig.formatMessage({ id: "c4r.form.selectAll" })
571
+ selectAllLabel
558
572
  ]
559
573
  }
560
574
  )
@@ -601,6 +615,10 @@ function _MultipleSelectField({
601
615
  selectAllDisabled,
602
616
  tooltipPlacement,
603
617
  variant,
618
+ allSelectedText,
619
+ noneSelectedText,
620
+ selectedText,
621
+ selectAllText,
604
622
  ...props
605
623
  }, ref) {
606
624
  const {
@@ -617,11 +635,19 @@ function _MultipleSelectField({
617
635
  });
618
636
  const isSmall = size === "small";
619
637
  const paddingSize = isSmall || variant === "standard" ? 0 : 2;
620
- const intl = reactIntl.useIntl();
621
- const intlConfig = cssUtils.useImperativeIntl(intl);
622
- const counterText = `${currentOptions.length} ${intlConfig.formatMessage({
623
- id: "c4r.form.selected"
624
- })}`;
638
+ const allSelectedLabel = cssUtils.useTranslationWithFallback(
639
+ "c4r.form.allSelected",
640
+ allSelectedText
641
+ );
642
+ const noneSelectedLabel = cssUtils.useTranslationWithFallback(
643
+ "c4r.form.noneSelected",
644
+ noneSelectedText
645
+ );
646
+ const selectedLabel = cssUtils.useTranslationWithFallback(
647
+ "c4r.form.selected",
648
+ selectedText
649
+ );
650
+ const counterText = `${currentOptions.length} ${selectedLabel}`;
625
651
  const renderValue = React.useMemo(() => {
626
652
  if (areAllSelected) {
627
653
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -631,7 +657,7 @@ function _MultipleSelectField({
631
657
  variant: isSmall ? "body2" : "body1",
632
658
  color: "textPrimary",
633
659
  ml: paddingSize,
634
- children: intlConfig.formatMessage({ id: "c4r.form.allSelected" })
660
+ children: allSelectedLabel
635
661
  }
636
662
  );
637
663
  }
@@ -654,16 +680,17 @@ function _MultipleSelectField({
654
680
  variant: isSmall ? "body2" : "body1",
655
681
  color: "text.hint",
656
682
  ml: paddingSize,
657
- children: placeholder ?? intlConfig.formatMessage({ id: "c4r.form.noneSelected" })
683
+ children: placeholder ?? noneSelectedLabel
658
684
  }
659
685
  );
660
686
  }, [
661
687
  areAllSelected,
662
688
  areAnySelected,
689
+ allSelectedLabel,
663
690
  counterText,
664
691
  currentOptions,
665
- intlConfig,
666
692
  isSmall,
693
+ noneSelectedLabel,
667
694
  paddingSize,
668
695
  placeholder,
669
696
  showCounter
@@ -704,7 +731,8 @@ function _MultipleSelectField({
704
731
  areAllSelected,
705
732
  areAnySelected,
706
733
  selectAll,
707
- selectAllDisabled
734
+ selectAllDisabled,
735
+ selectAllText
708
736
  }
709
737
  )
710
738
  }
@@ -871,19 +899,22 @@ const _CopiableComponent = ({
871
899
  copiedText,
872
900
  button,
873
901
  buttonLabel,
902
+ buttonIcon,
874
903
  buttonProps,
875
904
  ariaLabel,
876
905
  dataTestId,
877
906
  tooltipPlacement = "top",
907
+ tooltipProps,
908
+ snackbarProps,
878
909
  ...props
879
910
  }, ref) => {
880
911
  const [open, setOpen] = React.useState(false);
881
- const intl = reactIntl.useIntl();
882
- const intlConfig = cssUtils.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
- });
912
+ const _copyText = cssUtils.useTranslationWithFallback("c4r.button.copy", copyText);
913
+ const copyTooltipText = copyText === null ? null : _copyText;
914
+ const copySuccessMessage = cssUtils.useTranslationWithFallback(
915
+ "c4r.notifications.copiedToClipboard",
916
+ copiedText
917
+ );
887
918
  const { copy } = useCopyValue(copyTooltipText, copySuccessMessage);
888
919
  const handleClick = (e) => {
889
920
  e.preventDefault();
@@ -892,6 +923,7 @@ const _CopiableComponent = ({
892
923
  setOpen(true);
893
924
  }).catch(console.error);
894
925
  };
926
+ const copyIcon = buttonIcon ?? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {});
895
927
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
896
928
  /* @__PURE__ */ jsxRuntime.jsx(
897
929
  material.Tooltip,
@@ -899,6 +931,7 @@ const _CopiableComponent = ({
899
931
  title: copyTooltipText,
900
932
  leaveDelay: 0,
901
933
  placement: tooltipPlacement,
934
+ ...tooltipProps,
902
935
  children: /* @__PURE__ */ jsxRuntime.jsxs(
903
936
  material.Box,
904
937
  {
@@ -914,9 +947,9 @@ const _CopiableComponent = ({
914
947
  {
915
948
  ...buttonProps,
916
949
  disabled,
917
- icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {}),
950
+ icon: copyIcon,
918
951
  "data-testid": dataTestId,
919
- "aria-label": ariaLabel || buttonLabel || copyTooltipText || intlConfig.formatMessage({ id: "c4r.button.copy" }),
952
+ "aria-label": ariaLabel || buttonLabel || (copyTooltipText ?? ""),
920
953
  sx: {
921
954
  display: "flex"
922
955
  }
@@ -930,10 +963,11 @@ const _CopiableComponent = ({
930
963
  /* @__PURE__ */ jsxRuntime.jsx(
931
964
  Snackbar,
932
965
  {
933
- open,
934
966
  autoWidth: true,
935
967
  closeable: false,
936
968
  autoHideDuration: 4e3,
969
+ ...snackbarProps,
970
+ open,
937
971
  onClose: () => setOpen(false),
938
972
  children: copySuccessMessage
939
973
  }
@@ -977,16 +1011,22 @@ function _CopiableInputText({
977
1011
  size = "small",
978
1012
  onFocus,
979
1013
  onBlur,
1014
+ showText: showTextProp,
1015
+ hideText: hideTextProp,
980
1016
  ...rest
981
1017
  }, ref) {
982
- const intl = reactIntl.useIntl();
983
- const intlConfig = cssUtils.useImperativeIntl(intl);
984
- const [showText, setShowText] = React.useState(false);
1018
+ const [showPassword, setShowPassword] = React.useState(false);
985
1019
  const [isInputFocused, setIsInputFocused] = React.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
- });
1020
+ const inputType = !password ? "text" : showPassword ? "text" : "password";
1021
+ const showTextLabel = cssUtils.useTranslationWithFallback(
1022
+ "c4r.button.show",
1023
+ showTextProp
1024
+ );
1025
+ const hideTextLabel = cssUtils.useTranslationWithFallback(
1026
+ "c4r.button.hide",
1027
+ hideTextProp
1028
+ );
1029
+ const currentLabel = showPassword ? hideTextLabel : showTextLabel;
990
1030
  const handleFocus = (event) => {
991
1031
  setIsInputFocused(true);
992
1032
  onFocus == null ? void 0 : onFocus(event);
@@ -999,11 +1039,11 @@ function _CopiableInputText({
999
1039
  cssUtils.IconButton,
1000
1040
  {
1001
1041
  edge: variant !== "standard" ? "end" : void 0,
1002
- onClick: () => setShowText(!showText),
1042
+ onClick: () => setShowPassword(!showPassword),
1003
1043
  size,
1004
- icon: showText ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}),
1005
- tooltip: showTextLabel,
1006
- "aria-label": showTextLabel
1044
+ icon: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}),
1045
+ tooltip: currentLabel,
1046
+ "aria-label": currentLabel
1007
1047
  }
1008
1048
  ) });
1009
1049
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1273,10 +1313,12 @@ function useCreatableAutocomplete({
1273
1313
  newItemIcon,
1274
1314
  multiple
1275
1315
  }) {
1276
- const intl = reactIntl.useIntl();
1277
- const intlConfig = cssUtils.useImperativeIntl(intl);
1278
1316
  const filter = material.createFilterOptions();
1279
1317
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1318
+ const addLabel = cssUtils.useTranslationWithFallback(
1319
+ "c4r.form.add",
1320
+ typeof newItemLabel === "string" ? newItemLabel : void 0
1321
+ );
1280
1322
  const creatableFilterOptions = (options, params) => {
1281
1323
  const filtered = filter(
1282
1324
  options,
@@ -1290,10 +1332,8 @@ function useCreatableAutocomplete({
1290
1332
  let newItemText;
1291
1333
  if (typeof newItemLabel === "function") {
1292
1334
  newItemText = newItemLabel(inputValue);
1293
- } else if (newItemLabel) {
1294
- newItemText = `${newItemLabel} "${inputValue}"`;
1295
1335
  } else {
1296
- newItemText = `${intlConfig.formatMessage({ id: "c4r.form.add" })} "${inputValue}"`;
1336
+ newItemText = `${addLabel} "${inputValue}"`;
1297
1337
  }
1298
1338
  filtered.push({
1299
1339
  inputValue,
@@ -1338,14 +1378,18 @@ function useMultipleAutocomplete({
1338
1378
  counterText,
1339
1379
  allSelectedText
1340
1380
  }) {
1341
- const intl = reactIntl.useIntl();
1342
- const intlConfig = cssUtils.useImperativeIntl(intl);
1343
- const defaultCounterText = counterText || intlConfig.formatMessage({ id: "c4r.form.selected" });
1344
- const defaultAllSelectedText = allSelectedText || intlConfig.formatMessage({ id: "c4r.form.allSelected" });
1345
1381
  const [multipleValue, setMultipleValue] = React.useState(
1346
1382
  Array.isArray(value) ? value : value ? [value] : []
1347
1383
  );
1348
1384
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1385
+ const defaultCounterText = cssUtils.useTranslationWithFallback(
1386
+ "c4r.form.selected",
1387
+ counterText
1388
+ );
1389
+ const defaultAllSelectedText = cssUtils.useTranslationWithFallback(
1390
+ "c4r.form.allSelected",
1391
+ allSelectedText
1392
+ );
1349
1393
  React.useEffect(() => {
1350
1394
  const newValue = Array.isArray(value) ? value : value ? [value] : [];
1351
1395
  setMultipleValue(newValue);
@@ -1476,6 +1520,7 @@ function _AutocompleteList({
1476
1520
  extended,
1477
1521
  itemHeight,
1478
1522
  maxListHeight = cssUtils.MENU_LIST_MAX_SIZE,
1523
+ selectAllText,
1479
1524
  ...otherProps
1480
1525
  }, ref) {
1481
1526
  const childrenArray = React.useMemo(() => {
@@ -1551,7 +1596,8 @@ function _AutocompleteList({
1551
1596
  {
1552
1597
  areAllSelected: !!allSelected,
1553
1598
  areAnySelected: !!someSelected,
1554
- selectAll: handleSelectAll
1599
+ selectAll: handleSelectAll,
1600
+ selectAllText
1555
1601
  }
1556
1602
  ),
1557
1603
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1582,6 +1628,7 @@ function _CreatableAutocomplete({
1582
1628
  counterFormatter,
1583
1629
  counterText,
1584
1630
  allSelectedText,
1631
+ selectAllText,
1585
1632
  options = [],
1586
1633
  value,
1587
1634
  onChange,
@@ -1632,7 +1679,8 @@ function _CreatableAutocomplete({
1632
1679
  multiple,
1633
1680
  itemHeight,
1634
1681
  maxListHeight,
1635
- extended
1682
+ extended,
1683
+ selectAllText
1636
1684
  };
1637
1685
  const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
1638
1686
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1671,6 +1719,7 @@ function _MultipleAutocomplete({
1671
1719
  counterFormatter,
1672
1720
  counterText,
1673
1721
  allSelectedText,
1722
+ selectAllText,
1674
1723
  options,
1675
1724
  value,
1676
1725
  onChange,
@@ -1712,7 +1761,8 @@ function _MultipleAutocomplete({
1712
1761
  multiple: true,
1713
1762
  itemHeight,
1714
1763
  maxListHeight,
1715
- extended
1764
+ extended,
1765
+ selectAllText
1716
1766
  };
1717
1767
  const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
1718
1768
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1853,6 +1903,7 @@ function SecondaryText({ text }) {
1853
1903
  }
1854
1904
  const Root$4 = material.styled(material.AppBar)(({ theme }) => ({
1855
1905
  backgroundColor: theme.palette.brand.appBarMain,
1906
+ userSelect: "none",
1856
1907
  "& .MuiTypography-root": {
1857
1908
  color: theme.palette.brand.appBarContrastText
1858
1909
  },
@@ -1918,16 +1969,24 @@ const Footer = material.styled(material.Box, {
1918
1969
  function CodeAreaFooter({
1919
1970
  onClickFooter,
1920
1971
  buttonFooterLabelId,
1972
+ buttonFooterText,
1921
1973
  disabledButtonFooter,
1922
1974
  withGutter = true,
1923
1975
  showSnackbar,
1924
1976
  onCloseSnackbar,
1925
1977
  loading,
1926
1978
  disabled,
1979
+ changesSavedText,
1927
1980
  ...props
1928
1981
  }) {
1929
- const intl = reactIntl.useIntl();
1930
- const intlConfig = cssUtils.useImperativeIntl(intl);
1982
+ const buttonFooterLabel = cssUtils.useTranslationWithFallback(
1983
+ buttonFooterLabelId || "c4r.button.save",
1984
+ buttonFooterText
1985
+ );
1986
+ const changesSavedLabel = cssUtils.useTranslationWithFallback(
1987
+ "c4r.notifications.changesSaved",
1988
+ changesSavedText
1989
+ );
1931
1990
  if (!onClickFooter) return null;
1932
1991
  return /* @__PURE__ */ jsxRuntime.jsxs(
1933
1992
  Footer,
@@ -1945,9 +2004,7 @@ function CodeAreaFooter({
1945
2004
  loading,
1946
2005
  onClick: onClickFooter,
1947
2006
  disabled: disabled || disabledButtonFooter,
1948
- children: intlConfig.formatMessage({
1949
- id: buttonFooterLabelId || "c4r.button.save"
1950
- })
2007
+ children: buttonFooterLabel
1951
2008
  }
1952
2009
  ),
1953
2010
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1958,9 +2015,7 @@ function CodeAreaFooter({
1958
2015
  closeable: false,
1959
2016
  autoHideDuration: 4e3,
1960
2017
  onClose: onCloseSnackbar,
1961
- children: intlConfig.formatMessage({
1962
- id: "c4r.notifications.changesSaved"
1963
- })
2018
+ children: changesSavedLabel
1964
2019
  }
1965
2020
  )
1966
2021
  ]
@@ -1982,10 +2037,12 @@ function CodeAreaHeader({
1982
2037
  disabled,
1983
2038
  copyValue,
1984
2039
  onClickExpand,
1985
- size
2040
+ size,
2041
+ showOptionsTooltipText,
2042
+ copyText,
2043
+ expandText,
2044
+ copiedText
1986
2045
  }) {
1987
- const intl = reactIntl.useIntl();
1988
- const intlConfig = cssUtils.useImperativeIntl(intl);
1989
2046
  const showExpandButton = !!onClickExpand;
1990
2047
  const showCopyButton = copyValue !== void 0;
1991
2048
  const showMenu = showExpandButton && showCopyButton;
@@ -1993,6 +2050,19 @@ function CodeAreaHeader({
1993
2050
  const [openSnackbar, setOpenSnackbar] = React.useState(false);
1994
2051
  const [anchorEl, setAnchorEl] = React.useState(null);
1995
2052
  const open = Boolean(anchorEl);
2053
+ const showOptionsTooltipLabel = cssUtils.useTranslationWithFallback(
2054
+ "c4r.button.showOptions",
2055
+ showOptionsTooltipText
2056
+ );
2057
+ const copyLabel = cssUtils.useTranslationWithFallback("c4r.button.copy", copyText);
2058
+ const expandLabel = cssUtils.useTranslationWithFallback(
2059
+ "c4r.button.expand",
2060
+ expandText
2061
+ );
2062
+ const copiedLabel = cssUtils.useTranslationWithFallback(
2063
+ "c4r.notifications.copiedToClipboard",
2064
+ copiedText
2065
+ );
1996
2066
  const openDropdown = (event) => {
1997
2067
  setAnchorEl(event.currentTarget);
1998
2068
  };
@@ -2020,7 +2090,7 @@ function CodeAreaHeader({
2020
2090
  size,
2021
2091
  icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.MoreVertOutlined, {}),
2022
2092
  disabled,
2023
- tooltip: intlConfig.formatMessage({ id: `c4r.button.showOptions` }),
2093
+ tooltip: showOptionsTooltipLabel,
2024
2094
  tooltipPlacement: "top",
2025
2095
  "aria-controls": open ? "basic-menu" : void 0,
2026
2096
  "aria-haspopup": "true",
@@ -2042,11 +2112,11 @@ function CodeAreaHeader({
2042
2112
  children: [
2043
2113
  /* @__PURE__ */ jsxRuntime.jsxs(MenuItem.MenuItem, { onClick: handleCopy, disabled, id: "copy", children: [
2044
2114
  /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {}) }),
2045
- /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: intlConfig.formatMessage({ id: `c4r.button.copy` }) })
2115
+ /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: copyLabel })
2046
2116
  ] }),
2047
2117
  /* @__PURE__ */ jsxRuntime.jsxs(MenuItem.MenuItem, { onClick: onClickExpand, disabled, id: "expand", children: [
2048
2118
  /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.OpenDiagonallyRight, {}) }),
2049
- /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: intlConfig.formatMessage({ id: `c4r.button.expand` }) })
2119
+ /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: expandLabel })
2050
2120
  ] })
2051
2121
  ]
2052
2122
  }
@@ -2060,9 +2130,7 @@ function CodeAreaHeader({
2060
2130
  closeable: false,
2061
2131
  autoHideDuration: 4e3,
2062
2132
  onClose: () => setOpenSnackbar(false),
2063
- children: intlConfig.formatMessage({
2064
- id: "c4r.notifications.copiedToClipboard"
2065
- })
2133
+ children: copiedLabel
2066
2134
  }
2067
2135
  )
2068
2136
  ] });
@@ -2074,7 +2142,9 @@ function CodeAreaHeader({
2074
2142
  disabled,
2075
2143
  value: copyValue,
2076
2144
  button: true,
2077
- buttonProps: { size }
2145
+ buttonProps: { size },
2146
+ copyText,
2147
+ copiedText
2078
2148
  }
2079
2149
  ),
2080
2150
  showExpandButton && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2085,7 +2155,7 @@ function CodeAreaHeader({
2085
2155
  onClick: onClickExpand,
2086
2156
  icon: /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.OpenDiagonallyRight, {}),
2087
2157
  disabled,
2088
- tooltip: intlConfig.formatMessage({ id: `c4r.button.expand` }),
2158
+ tooltip: expandLabel,
2089
2159
  tooltipPlacement: "top"
2090
2160
  }
2091
2161
  )
@@ -3134,10 +3204,13 @@ function DialogHeader({
3134
3204
  secondaryActions,
3135
3205
  "aria-label": ariaLabel,
3136
3206
  closeIcon,
3207
+ closeTooltipText,
3137
3208
  ...otherProps
3138
3209
  }) {
3139
- const intl = reactIntl.useIntl();
3140
- const intlConfig = cssUtils.useImperativeIntl(intl);
3210
+ const closeTooltipLabel = cssUtils.useTranslationWithFallback(
3211
+ "c4r.button.close",
3212
+ closeTooltipText
3213
+ );
3141
3214
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3142
3215
  /* @__PURE__ */ jsxRuntime.jsxs(DialogTitle, { component: "div", "data-name": "dialog-header", ...otherProps, children: [
3143
3216
  /* @__PURE__ */ jsxRuntime.jsxs(Main$1, { children: [
@@ -3157,14 +3230,7 @@ function DialogHeader({
3157
3230
  ] }),
3158
3231
  /* @__PURE__ */ jsxRuntime.jsxs(ItemsWrapper$1, { children: [
3159
3232
  secondaryActions,
3160
- onClose && /* @__PURE__ */ jsxRuntime.jsx(
3161
- material.Tooltip,
3162
- {
3163
- title: intlConfig.formatMessage({ id: "c4r.button.close" }),
3164
- placement: "left",
3165
- children: /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { "data-testid": "CloseIcon" }) })
3166
- }
3167
- )
3233
+ onClose && /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: closeTooltipLabel, placement: "left", children: /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { "data-testid": "CloseIcon" }) }) })
3168
3234
  ] })
3169
3235
  ] }),
3170
3236
  children
@@ -3173,42 +3239,56 @@ function DialogHeader({
3173
3239
  ] });
3174
3240
  }
3175
3241
  const Content$4 = material.styled(material.DialogContent, {
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`
3242
+ shouldForwardProp: (prop) => ![
3243
+ "scrollableContent",
3244
+ "withGutter",
3245
+ "withBottomGutter",
3246
+ "spacing"
3247
+ ].includes(prop)
3248
+ })(
3249
+ ({
3250
+ theme,
3251
+ scrollableContent,
3252
+ withGutter,
3253
+ withBottomGutter,
3254
+ spacing = 3
3255
+ }) => ({
3256
+ display: "flex",
3257
+ flexDirection: "column",
3258
+ gap: theme.spacing(spacing),
3259
+ padding: 0,
3260
+ ...theme.typography.body2,
3261
+ color: theme.palette.text.secondary,
3262
+ ".MuiAlert-root": {
3263
+ minHeight: "auto"
3264
+ },
3265
+ ...scrollableContent && {
3266
+ borderBottom: `1px solid ${theme.palette.divider}`,
3267
+ "+ .MuiDivider-root": {
3268
+ display: "none"
3269
+ }
3270
+ },
3271
+ ...withGutter && {
3272
+ padding: ` ${theme.spacing(1, 2, 0)} !important`,
3273
+ ".MuiDialog-paperFullScreen &": {
3274
+ padding: `${theme.spacing(2, 2, 0)} !important`
3275
+ }
3276
+ },
3277
+ ...withBottomGutter && {
3278
+ paddingBottom: `${theme.spacing(3)} !important`,
3279
+ ".MuiDialog-paperFullScreen &": {
3280
+ paddingBottom: `${theme.spacing(3)} !important`
3281
+ }
3203
3282
  }
3204
- }
3205
- }));
3283
+ })
3284
+ );
3206
3285
  function _DialogContent({
3207
3286
  children,
3208
3287
  scrollableContent,
3209
3288
  hasFooterAlert,
3210
3289
  withGutter = true,
3211
3290
  withBottomGutter = true,
3291
+ spacing,
3212
3292
  onScroll,
3213
3293
  ...props
3214
3294
  }, ref) {
@@ -3256,6 +3336,7 @@ function _DialogContent({
3256
3336
  scrollableContent,
3257
3337
  withGutter,
3258
3338
  withBottomGutter: withBottomGutter && withGutter,
3339
+ spacing,
3259
3340
  "data-name": "dialog-content",
3260
3341
  ...props,
3261
3342
  children
@@ -3583,15 +3664,30 @@ function CodeAreaDialogConfirmation({
3583
3664
  onClose,
3584
3665
  onCancel,
3585
3666
  cancelLabelId,
3667
+ cancelText,
3586
3668
  cancelButton,
3587
3669
  closeButton,
3588
3670
  contentLabelId,
3671
+ contentText,
3589
3672
  titleLabelId,
3673
+ titleText,
3590
3674
  severity = "warning",
3591
- content
3675
+ content,
3676
+ leaveText
3592
3677
  }) {
3593
- const intl = reactIntl.useIntl();
3594
- const intlConfig = cssUtils.useImperativeIntl(intl);
3678
+ const titleLabel = cssUtils.useTranslationWithFallback(
3679
+ titleLabelId || "c4r.dialog.confirmation.title",
3680
+ titleText
3681
+ );
3682
+ const cancelLabel = cssUtils.useTranslationWithFallback(
3683
+ cancelLabelId || "c4r.button.cancel",
3684
+ cancelText
3685
+ );
3686
+ const leaveLabel = cssUtils.useTranslationWithFallback("c4r.button.leave", leaveText);
3687
+ const contentLabel = cssUtils.useTranslationWithFallback(
3688
+ contentLabelId || "c4r.dialog.confirmation.content",
3689
+ contentText
3690
+ );
3595
3691
  if (!onClose || !onCancel) {
3596
3692
  return null;
3597
3693
  }
@@ -3600,20 +3696,12 @@ function CodeAreaDialogConfirmation({
3600
3696
  {
3601
3697
  opened: true,
3602
3698
  severity,
3603
- title: intlConfig.formatMessage({
3604
- id: titleLabelId || "c4r.dialog.confirmation.title"
3605
- }),
3699
+ title: titleLabel,
3606
3700
  actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3607
- onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCancel, children: intlConfig.formatMessage({
3608
- id: cancelLabelId || "c4r.button.cancel"
3609
- }) })),
3610
- onClose && (closeButton ? closeButton : /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "contained", onClick: onClose, children: intlConfig.formatMessage({
3611
- id: "c4r.button.leave"
3612
- }) }))
3701
+ onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCancel, children: cancelLabel })),
3702
+ onClose && (closeButton ? closeButton : /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "contained", onClick: onClose, children: leaveLabel }))
3613
3703
  ] }),
3614
- children: content ? content : intlConfig.formatMessage({
3615
- id: contentLabelId || "c4r.dialog.confirmation.content"
3616
- })
3704
+ children: content ?? contentLabel
3617
3705
  }
3618
3706
  );
3619
3707
  }
@@ -3630,6 +3718,7 @@ function CodeAreaDialog({
3630
3718
  showConfirmation,
3631
3719
  onCancelConfirm,
3632
3720
  onCloseConfirm,
3721
+ confirmationDialogTexts,
3633
3722
  footerProps,
3634
3723
  saveLoading,
3635
3724
  showSaveSnackbar,
@@ -3694,7 +3783,11 @@ function CodeAreaDialog({
3694
3783
  {
3695
3784
  onClose: onCloseConfirm ?? onClose,
3696
3785
  onCancel: onCancelConfirm,
3697
- cancelLabelId: "c4r.button.keepEditing"
3786
+ cancelLabelId: "c4r.button.keepEditing",
3787
+ titleText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.titleText,
3788
+ contentText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.contentText,
3789
+ cancelText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.cancelText,
3790
+ leaveText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.leaveText
3698
3791
  }
3699
3792
  )
3700
3793
  ]
@@ -3862,10 +3955,13 @@ function DatePicker({
3862
3955
  readOnly,
3863
3956
  "aria-label": ariaLabel,
3864
3957
  "data-testid": dataTestId,
3958
+ chooseDateAriaLabel,
3865
3959
  ...props
3866
3960
  }) {
3867
- const intl = reactIntl.useIntl();
3868
- const intlConfig = cssUtils.useImperativeIntl(intl);
3961
+ const chooseDateText = cssUtils.useTranslationWithFallback(
3962
+ "c4r.form.chooseDate",
3963
+ chooseDateAriaLabel
3964
+ );
3869
3965
  return (
3870
3966
  // Don't remove className, it's used for styling
3871
3967
  /* @__PURE__ */ jsxRuntime.jsx(material.Box, { className: "CartoDatePicker-root", "data-testid": "date-picker", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -3910,16 +4006,7 @@ function DatePicker({
3910
4006
  },
3911
4007
  slots: {
3912
4008
  clearButton: (props2) => /* @__PURE__ */ jsxRuntime.jsx(ClearButton, { ...props2, size, variant }),
3913
- openPickerButton: (props2) => /* @__PURE__ */ jsxRuntime.jsx(
3914
- material.IconButton,
3915
- {
3916
- ...props2,
3917
- size,
3918
- "aria-label": intlConfig.formatMessage({
3919
- id: "c4r.form.chooseDate"
3920
- })
3921
- }
3922
- ),
4009
+ openPickerButton: (props2) => /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { ...props2, size, "aria-label": chooseDateText }),
3923
4010
  ...slots
3924
4011
  },
3925
4012
  disableOpenPicker: !showCalendar,
@@ -4148,12 +4235,14 @@ function DateRangePicker({
4148
4235
  variant = "outlined",
4149
4236
  startProps,
4150
4237
  endProps,
4238
+ startDateLabel,
4239
+ endDateLabel,
4240
+ startDateCalendarAriaLabel,
4241
+ endDateCalendarAriaLabel,
4151
4242
  "aria-label": ariaLabel,
4152
4243
  "data-testid": dataTestId,
4153
4244
  ...props
4154
4245
  }) {
4155
- const intl = reactIntl.useIntl();
4156
- const intlConfig = cssUtils.useImperativeIntl(intl);
4157
4246
  const [isEndDateOpen, setIsEndDateOpen] = React.useState(false);
4158
4247
  const [isStartDateOpen, setIsStartDateOpen] = React.useState(false);
4159
4248
  const [startDate, setStartDate] = React.useState(
@@ -4164,6 +4253,22 @@ function DateRangePicker({
4164
4253
  (endProps == null ? void 0 : endProps.value) ?? (startProps == null ? void 0 : startProps.value) ?? /* @__PURE__ */ new Date()
4165
4254
  );
4166
4255
  const hasError = error ?? (startProps == null ? void 0 : startProps.error) ?? (endProps == null ? void 0 : endProps.error);
4256
+ const _startDateLabel = cssUtils.useTranslationWithFallback(
4257
+ "c4r.form.startDate",
4258
+ startDateLabel
4259
+ );
4260
+ const _endDateLabel = cssUtils.useTranslationWithFallback(
4261
+ "c4r.form.endDate",
4262
+ endDateLabel
4263
+ );
4264
+ const startCalendarAriaLabel = cssUtils.useTranslationWithFallback(
4265
+ "c4r.form.startDateCalendar",
4266
+ startDateCalendarAriaLabel
4267
+ );
4268
+ const endCalendarAriaLabel = cssUtils.useTranslationWithFallback(
4269
+ "c4r.form.endDateCalendar",
4270
+ endDateCalendarAriaLabel
4271
+ );
4167
4272
  const handleStartDateChange = (value, context) => {
4168
4273
  setStartDate(value);
4169
4274
  if (startProps == null ? void 0 : startProps.onChange) {
@@ -4217,13 +4322,11 @@ function DateRangePicker({
4217
4322
  ...startProps,
4218
4323
  value: (startProps == null ? void 0 : startProps.value) ?? startDate,
4219
4324
  maxDate: endDate ?? void 0,
4220
- label: (startProps == null ? void 0 : startProps.label) ?? intlConfig.formatMessage({ id: "c4r.form.startDate" }),
4325
+ label: (startProps == null ? void 0 : startProps.label) ?? _startDateLabel,
4221
4326
  slotProps: {
4222
4327
  popper: {
4223
4328
  placement: "bottom-start",
4224
- "aria-label": intlConfig.formatMessage({
4225
- id: "c4r.form.startDateCalendar"
4226
- })
4329
+ "aria-label": startCalendarAriaLabel
4227
4330
  },
4228
4331
  ...startProps == null ? void 0 : startProps.slotProps
4229
4332
  },
@@ -4258,9 +4361,7 @@ function DateRangePicker({
4258
4361
  minDate: startDate ?? void 0,
4259
4362
  slotProps: {
4260
4363
  popper: {
4261
- "aria-label": intlConfig.formatMessage({
4262
- id: "c4r.form.endDateCalendar"
4263
- })
4364
+ "aria-label": endCalendarAriaLabel
4264
4365
  },
4265
4366
  ...endProps == null ? void 0 : endProps.slotProps
4266
4367
  },
@@ -4276,7 +4377,7 @@ function DateRangePicker({
4276
4377
  ),
4277
4378
  ...endProps == null ? void 0 : endProps.slots
4278
4379
  },
4279
- label: (endProps == null ? void 0 : endProps.label) ?? intlConfig.formatMessage({ id: "c4r.form.endDate" }),
4380
+ label: (endProps == null ? void 0 : endProps.label) ?? _endDateLabel,
4280
4381
  error: (endProps == null ? void 0 : endProps.error) ?? error,
4281
4382
  open: isEndDateOpen,
4282
4383
  onOpen: handleEndDateOpen,
@@ -4336,12 +4437,16 @@ function TimePicker({
4336
4437
  ampm = true,
4337
4438
  views = ["hours", "minutes"],
4338
4439
  format,
4440
+ openPickerAriaLabel,
4339
4441
  "data-testid": dataTestId,
4340
4442
  "aria-label": ariaLabel,
4341
4443
  ...props
4342
4444
  }) {
4343
- const intl = reactIntl.useIntl();
4344
- const intlConfig = cssUtils.useImperativeIntl(intl);
4445
+ const fieldLabel = cssUtils.useTranslationWithFallback("c4r.form.time", label);
4446
+ const chooseDateAriaLabel = cssUtils.useTranslationWithFallback(
4447
+ "c4r.form.chooseDate",
4448
+ openPickerAriaLabel
4449
+ );
4345
4450
  const inputRef = React.useRef(null);
4346
4451
  const [inputWidth, setInputWidth] = React.useState(0);
4347
4452
  React.useEffect(() => {
@@ -4375,7 +4480,7 @@ function TimePicker({
4375
4480
  label: /* @__PURE__ */ jsxRuntime.jsx(
4376
4481
  LabelWithIndicator,
4377
4482
  {
4378
- label: label ?? intlConfig.formatMessage({ id: "c4r.form.time" }),
4483
+ label: fieldLabel,
4379
4484
  type,
4380
4485
  icon: labelHelpTooltip && /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.HelpOutline, { htmlColor: "text.secondary" }) })
4381
4486
  }
@@ -4415,9 +4520,7 @@ function TimePicker({
4415
4520
  {
4416
4521
  ...props2,
4417
4522
  size,
4418
- "aria-label": intlConfig.formatMessage({
4419
- id: "c4r.form.chooseDate"
4420
- })
4523
+ "aria-label": chooseDateAriaLabel
4421
4524
  }
4422
4525
  ),
4423
4526
  ...slots
@@ -4447,12 +4550,16 @@ function DateTimePicker({
4447
4550
  ampm = true,
4448
4551
  views = ["hours", "minutes"],
4449
4552
  format,
4553
+ openPickerAriaLabel,
4450
4554
  "data-testid": dataTestId,
4451
4555
  "aria-label": ariaLabel,
4452
4556
  ...props
4453
4557
  }) {
4454
- const intl = reactIntl.useIntl();
4455
- const intlConfig = cssUtils.useImperativeIntl(intl);
4558
+ const fieldLabel = cssUtils.useTranslationWithFallback("c4r.form.time", label);
4559
+ const chooseDateAriaLabel = cssUtils.useTranslationWithFallback(
4560
+ "c4r.form.chooseDate",
4561
+ openPickerAriaLabel
4562
+ );
4456
4563
  return /* @__PURE__ */ jsxRuntime.jsx(
4457
4564
  DateFieldContainer,
4458
4565
  {
@@ -4469,7 +4576,7 @@ function DateTimePicker({
4469
4576
  label: /* @__PURE__ */ jsxRuntime.jsx(
4470
4577
  LabelWithIndicator,
4471
4578
  {
4472
- label: label ?? intlConfig.formatMessage({ id: "c4r.form.time" }),
4579
+ label: fieldLabel,
4473
4580
  type,
4474
4581
  icon: labelHelpTooltip && /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.HelpOutline, { htmlColor: "text.secondary" }) })
4475
4582
  }
@@ -4501,9 +4608,7 @@ function DateTimePicker({
4501
4608
  {
4502
4609
  ...props2,
4503
4610
  size,
4504
- "aria-label": intlConfig.formatMessage({
4505
- id: "c4r.form.chooseDate"
4506
- })
4611
+ "aria-label": chooseDateAriaLabel
4507
4612
  }
4508
4613
  ),
4509
4614
  ...slots
@@ -4616,37 +4721,6 @@ function _AccordionGroup({
4616
4721
  );
4617
4722
  }
4618
4723
  const AccordionGroup = React.forwardRef(_AccordionGroup);
4619
- const sizes = {
4620
- large: 5,
4621
- medium: 4,
4622
- small: 3,
4623
- xsmall: 2.25
4624
- };
4625
- const StyledAvatar = material.styled(material.Avatar, {
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: cssUtils.ICON_SIZE_SMALL,
4643
- height: cssUtils.ICON_SIZE_SMALL
4644
- }
4645
- },
4646
- ...disabled && {
4647
- opacity: 0.6
4648
- }
4649
- }));
4650
4724
  function _Avatar({
4651
4725
  size,
4652
4726
  disabled,
@@ -4655,7 +4729,7 @@ function _Avatar({
4655
4729
  ...otherProps
4656
4730
  }, ref) {
4657
4731
  return /* @__PURE__ */ jsxRuntime.jsx(
4658
- StyledAvatar,
4732
+ material.Avatar,
4659
4733
  {
4660
4734
  ...otherProps,
4661
4735
  ref,
@@ -4852,6 +4926,9 @@ function _FilterDropdown({
4852
4926
  responsive,
4853
4927
  tooltipLabel,
4854
4928
  tooltipPlacement,
4929
+ tooltipProps,
4930
+ buttonProps,
4931
+ iconButtonProps,
4855
4932
  slotProps,
4856
4933
  MenuListProps,
4857
4934
  ...props
@@ -4889,14 +4966,30 @@ function _FilterDropdown({
4889
4966
  "data-color": buttonColor
4890
4967
  };
4891
4968
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4892
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: tooltipLabel, placement: tooltipPlacement, children: /* @__PURE__ */ jsxRuntime.jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsxRuntime.jsx(cssUtils.IconButton, { ...commonButtonProps, icon }) : /* @__PURE__ */ jsxRuntime.jsx(
4893
- Button,
4969
+ /* @__PURE__ */ jsxRuntime.jsx(
4970
+ material.Tooltip,
4894
4971
  {
4895
- ...commonButtonProps,
4896
- endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
4897
- children: menuLabel
4972
+ title: tooltipLabel,
4973
+ placement: tooltipPlacement,
4974
+ ...tooltipProps,
4975
+ children: /* @__PURE__ */ jsxRuntime.jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsxRuntime.jsx(
4976
+ cssUtils.IconButton,
4977
+ {
4978
+ ...commonButtonProps,
4979
+ icon,
4980
+ ...iconButtonProps
4981
+ }
4982
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
4983
+ Button,
4984
+ {
4985
+ ...commonButtonProps,
4986
+ endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
4987
+ ...buttonProps,
4988
+ children: menuLabel
4989
+ }
4990
+ ) })
4898
4991
  }
4899
- ) }) }),
4992
+ ),
4900
4993
  /* @__PURE__ */ jsxRuntime.jsxs(
4901
4994
  Menu,
4902
4995
  {
@@ -5050,10 +5143,13 @@ function Snackbar({
5050
5143
  onClose = () => void 0,
5051
5144
  autoWidth,
5052
5145
  icon,
5146
+ closeTooltipText,
5053
5147
  ...rest
5054
5148
  }) {
5055
- const intl = reactIntl.useIntl();
5056
- const intlConfig = cssUtils.useImperativeIntl(intl);
5149
+ const closeTooltipLabel = cssUtils.useTranslationWithFallback(
5150
+ "c4r.button.close",
5151
+ closeTooltipText
5152
+ );
5057
5153
  const isNeutral = severity === "neutral";
5058
5154
  const disabledIcon = icon === false || isNeutral && !icon;
5059
5155
  const disabledAutoHide = autoHideDuration === null;
@@ -5094,9 +5190,7 @@ function Snackbar({
5094
5190
  color: "default",
5095
5191
  onClick: (e) => onClose(e, "timeout"),
5096
5192
  icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.CloseOutlined, {}),
5097
- tooltip: intlConfig.formatMessage({
5098
- id: "c4r.button.close"
5099
- })
5193
+ tooltip: closeTooltipLabel
5100
5194
  }
5101
5195
  ) })
5102
5196
  ]
@@ -5419,10 +5513,26 @@ function useFileUpload({
5419
5513
  files,
5420
5514
  multiple,
5421
5515
  placeholder,
5422
- uploadInputRef
5516
+ uploadInputRef,
5517
+ filesSelectedText,
5518
+ dragPlaceholderText,
5519
+ dragActivePlaceholderText
5423
5520
  }) {
5424
- const intl = reactIntl.useIntl();
5425
- const intlConfig = cssUtils.useImperativeIntl(intl);
5521
+ const filesSelectedLabel = cssUtils.useTranslationWithFallback(
5522
+ "c4r.form.filesSelected",
5523
+ filesSelectedText,
5524
+ { count: (files == null ? void 0 : files.length) ?? 0 }
5525
+ );
5526
+ const dragPlaceholderLabel = cssUtils.useTranslationWithFallback(
5527
+ "c4r.form.dragPlaceholder",
5528
+ dragPlaceholderText,
5529
+ { count: multiple ? 0 : 1 }
5530
+ );
5531
+ const dragActivePlaceholderLabel = cssUtils.useTranslationWithFallback(
5532
+ "c4r.form.dragActivePlaceholder",
5533
+ dragActivePlaceholderText,
5534
+ { count: multiple ? 0 : 1 }
5535
+ );
5426
5536
  const [filesText, setFilesText] = React.useState("");
5427
5537
  const [dragOver, setDragOver] = React.useState(false);
5428
5538
  React.useEffect(() => {
@@ -5431,14 +5541,9 @@ function useFileUpload({
5431
5541
  } else if (files.length === 1) {
5432
5542
  setFilesText(files[0].name);
5433
5543
  } else {
5434
- setFilesText(
5435
- intlConfig.formatMessage(
5436
- { id: "c4r.form.filesSelected" },
5437
- { count: files.length }
5438
- )
5439
- );
5544
+ setFilesText(filesSelectedLabel);
5440
5545
  }
5441
- }, [files, intlConfig]);
5546
+ }, [files, filesSelectedLabel]);
5442
5547
  const handleBrowse = () => {
5443
5548
  var _a;
5444
5549
  (_a = uploadInputRef.current) == null ? void 0 : _a.click();
@@ -5478,22 +5583,11 @@ function useFileUpload({
5478
5583
  onChange == null ? void 0 : onChange([]);
5479
5584
  };
5480
5585
  const getPlaceholder = React.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
5586
  if (dragOver) {
5491
- placeholderText = dragPlaceholder;
5492
- } else {
5493
- placeholderText = placeholder ?? defaultPlaceholder;
5587
+ return dragActivePlaceholderLabel;
5494
5588
  }
5495
- return placeholderText;
5496
- }, [dragOver, multiple, placeholder, intlConfig]);
5589
+ return placeholder ?? dragPlaceholderLabel;
5590
+ }, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
5497
5591
  const inputEvents = {
5498
5592
  onDragOver: handleDragOver,
5499
5593
  onDragLeave: handleDragLeave,
@@ -5720,12 +5814,12 @@ function _EllipsisWithTooltip({
5720
5814
  );
5721
5815
  }
5722
5816
  const EllipsisWithTooltip = React.forwardRef(_EllipsisWithTooltip);
5723
- exports.Alert = Alert$1.Alert;
5724
- exports.Link = Alert$1.Link;
5725
- exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
5726
5817
  exports.IconButton = cssUtils.IconButton;
5727
5818
  exports.TablePaginationActions = cssUtils.TablePaginationActions;
5728
5819
  exports.Typography = cssUtils.Typography;
5820
+ exports.Alert = Alert$1.Alert;
5821
+ exports.Link = Alert$1.Link;
5822
+ exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
5729
5823
  exports.MenuItem = MenuItem.MenuItem;
5730
5824
  exports.AUTOCOMPLETE_GROUP_HEADER_PROPERTY = AUTOCOMPLETE_GROUP_HEADER_PROPERTY;
5731
5825
  exports.AccordionGroup = AccordionGroup;