@carto/meridian-ds 2.6.0 → 2.6.1-alpha-searchfield.4

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 (137) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{Alert-DHd9hCGz.js → Alert-1-pacqlp.js} +3 -13
  3. package/dist/{Alert-DOeOwxOe.cjs → Alert-N-6EugaP.cjs} +2 -12
  4. package/dist/{MenuItem-CYJN2OVU.cjs → MenuItem-BPvH70wa.cjs} +1 -1
  5. package/dist/{MenuItem-MUmADf3e.js → MenuItem-GpTpLidu.js} +1 -1
  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 +557 -169
  11. package/dist/components/index.js +557 -169
  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 +643 -558
  15. package/dist/custom-icons/index.js +643 -558
  16. package/dist/theme/index.cjs +14 -4
  17. package/dist/theme/index.js +15 -5
  18. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts +1 -0
  19. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts.map +1 -1
  20. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts +1 -1
  21. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts.map +1 -1
  22. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts +1 -1
  23. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
  24. package/dist/types/components/Autocomplete/CreatableAutocomplete/useCreatableAutocomplete.d.ts.map +1 -1
  25. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts +1 -1
  26. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts.map +1 -1
  27. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts +1 -1
  28. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts.map +1 -1
  29. package/dist/types/components/Autocomplete/MultipleAutocomplete/useMultipleAutocomplete.d.ts.map +1 -1
  30. package/dist/types/components/Autocomplete/types.d.ts +13 -1
  31. package/dist/types/components/Autocomplete/types.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/Dialog/Dialog/Dialog.stories.d.ts +48 -0
  52. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts.map +1 -1
  53. package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts.map +1 -1
  54. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts +2 -0
  55. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts.map +1 -0
  56. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts +1 -1
  57. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
  58. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts +14 -0
  59. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts.map +1 -1
  60. package/dist/types/components/Dialog/types.d.ts +6 -0
  61. package/dist/types/components/Dialog/types.d.ts.map +1 -1
  62. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts +1 -1
  63. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts.map +1 -1
  64. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts +48 -0
  65. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts.map +1 -1
  66. package/dist/types/components/FilterDropdown/types.d.ts +8 -0
  67. package/dist/types/components/FilterDropdown/types.d.ts.map +1 -1
  68. package/dist/types/components/Menu/MenuItemFilter/MenuItemFilter.d.ts.map +1 -1
  69. package/dist/types/components/Menu/types.d.ts +1 -0
  70. package/dist/types/components/Menu/types.d.ts.map +1 -1
  71. package/dist/types/components/PasswordField/PasswordField.d.ts +10 -1
  72. package/dist/types/components/PasswordField/PasswordField.d.ts.map +1 -1
  73. package/dist/types/components/PasswordField/PasswordField.stories.d.ts +10 -1
  74. package/dist/types/components/PasswordField/PasswordField.stories.d.ts.map +1 -1
  75. package/dist/types/components/SearchField/SearchField.d.ts +4 -0
  76. package/dist/types/components/SearchField/SearchField.d.ts.map +1 -0
  77. package/dist/types/components/SearchField/SearchField.stories.d.ts +114 -0
  78. package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -0
  79. package/dist/types/components/SearchField/SearchField.styled.d.ts +23 -0
  80. package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -0
  81. package/dist/types/components/SearchField/SearchField.test.d.ts +2 -0
  82. package/dist/types/components/SearchField/SearchField.test.d.ts.map +1 -0
  83. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts +19 -0
  84. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts.map +1 -0
  85. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts +14 -0
  86. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts.map +1 -0
  87. package/dist/types/components/SearchField/index.d.ts +3 -0
  88. package/dist/types/components/SearchField/index.d.ts.map +1 -0
  89. package/dist/types/components/SearchField/types.d.ts +72 -0
  90. package/dist/types/components/SearchField/types.d.ts.map +1 -0
  91. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
  92. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts +22 -2
  93. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts.map +1 -1
  94. package/dist/types/components/SelectField/types.d.ts +4 -0
  95. package/dist/types/components/SelectField/types.d.ts.map +1 -1
  96. package/dist/types/components/Snackbar/Snackbar.d.ts +2 -1
  97. package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
  98. package/dist/types/components/Snackbar/Snackbar.stories.d.ts +15 -0
  99. package/dist/types/components/Snackbar/Snackbar.stories.d.ts.map +1 -1
  100. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +3 -0
  101. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
  102. package/dist/types/components/UploadField/useFileUpload.d.ts +4 -1
  103. package/dist/types/components/UploadField/useFileUpload.d.ts.map +1 -1
  104. package/dist/types/components/index.d.ts +2 -0
  105. package/dist/types/components/index.d.ts.map +1 -1
  106. package/dist/types/custom-icons/FoldersStackedOutlined.d.ts +4 -0
  107. package/dist/types/custom-icons/FoldersStackedOutlined.d.ts.map +1 -0
  108. package/dist/types/custom-icons/RedoAlt.d.ts +4 -0
  109. package/dist/types/custom-icons/RedoAlt.d.ts.map +1 -0
  110. package/dist/types/custom-icons/SelectFeature.d.ts.map +1 -1
  111. package/dist/types/custom-icons/UndoAlt.d.ts +4 -0
  112. package/dist/types/custom-icons/UndoAlt.d.ts.map +1 -0
  113. package/dist/types/custom-icons/index.d.ts +3 -0
  114. package/dist/types/custom-icons/index.d.ts.map +1 -1
  115. package/dist/types/localization/en.d.ts +1 -0
  116. package/dist/types/localization/en.d.ts.map +1 -1
  117. package/dist/types/localization/es.d.ts +1 -0
  118. package/dist/types/localization/es.d.ts.map +1 -1
  119. package/dist/types/localization/id.d.ts +1 -0
  120. package/dist/types/localization/id.d.ts.map +1 -1
  121. package/dist/types/localization/index.d.ts +3 -0
  122. package/dist/types/localization/index.d.ts.map +1 -1
  123. package/dist/types/theme/carto-theme.d.ts.map +1 -1
  124. package/dist/types/theme/components/layout.d.ts +3 -0
  125. package/dist/types/theme/components/layout.d.ts.map +1 -0
  126. package/dist/types/theme/components/navigation.d.ts.map +1 -1
  127. package/dist/types/utils/useTranslationWithFallback.d.ts +39 -0
  128. package/dist/types/utils/useTranslationWithFallback.d.ts.map +1 -0
  129. package/dist/types/utils/useTranslationWithFallback.test.d.ts +2 -0
  130. package/dist/types/utils/useTranslationWithFallback.test.d.ts.map +1 -0
  131. package/dist/widgets/index.cjs +8 -7
  132. package/dist/widgets/index.js +4 -3
  133. package/package.json +1 -1
  134. package/dist/types/utils/useTranslationFallback.d.ts +0 -20
  135. package/dist/types/utils/useTranslationFallback.d.ts.map +0 -1
  136. package/dist/types/utils/useTranslationFallback.test.d.ts +0 -2
  137. 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-DjvM17Vb.cjs");
8
+ const Alert$1 = require("../Alert-N-6EugaP.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-BPvH70wa.cjs");
13
12
  require("cartocolor");
14
13
  const reactWindow = require("react-window");
15
14
  const reactCodemirror2 = require("react-codemirror2");
@@ -37,10 +36,12 @@ require("codemirror/addon/fold/indent-fold.js");
37
36
  require("codemirror/addon/fold/markdown-fold.js");
38
37
  require("codemirror/addon/fold/comment-fold.js");
39
38
  const ClickAwayListener = require("@mui/material/ClickAwayListener");
39
+ const reactIntl = require("react-intl");
40
40
  const DatePicker$1 = require("@mui/x-date-pickers/DatePicker");
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");
44
+ const Search = require("../Search-CMWbM9nD.cjs");
44
45
  const DOMPurify = require("dompurify");
45
46
  const IndicatorIcon = material.styled(material.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 = Alert$1.useTranslationFallback(
73
+ const screenReaderTextValue = cssUtils.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 = React.forwardRef(_LabelWithIndicator);
285
- function _PasswordField({ InputProps, size = "small", disabled, ...otherProps }, ref) {
286
- const intl = reactIntl.useIntl();
287
- const intlConfig = cssUtils.useImperativeIntl(intl);
286
+ function _PasswordField({
287
+ InputProps,
288
+ size = "small",
289
+ disabled,
290
+ showPasswordText,
291
+ hidePasswordText,
292
+ ...otherProps
293
+ }, ref) {
294
+ const showPasswordLabel = cssUtils.useTranslationWithFallback(
295
+ "c4r.form.showPassword",
296
+ showPasswordText
297
+ );
298
+ const hidePasswordLabel = cssUtils.useTranslationWithFallback(
299
+ "c4r.form.hidePassword",
300
+ hidePasswordText
301
+ );
288
302
  const [showPassword, setShowPassword] = React.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__ */ jsxRuntime.jsx(
294
306
  material.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__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.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 = reactIntl.useIntl();
529
- const intlConfig = cssUtils.useImperativeIntl(intl);
541
+ const selectAllLabel = cssUtils.useTranslationWithFallback(
542
+ "c4r.form.selectAll",
543
+ selectAllText
544
+ );
530
545
  return /* @__PURE__ */ jsxRuntime.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 = reactIntl.useIntl();
621
- const intlConfig = cssUtils.useImperativeIntl(intl);
622
- const counterText = `${currentOptions.length} ${intlConfig.formatMessage({
623
- id: "c4r.form.selected"
624
- })}`;
639
+ const allSelectedLabel = cssUtils.useTranslationWithFallback(
640
+ "c4r.form.allSelected",
641
+ allSelectedText
642
+ );
643
+ const noneSelectedLabel = cssUtils.useTranslationWithFallback(
644
+ "c4r.form.noneSelected",
645
+ noneSelectedText
646
+ );
647
+ const selectedLabel = cssUtils.useTranslationWithFallback(
648
+ "c4r.form.selected",
649
+ selectedText
650
+ );
651
+ const counterText = `${currentOptions.length} ${selectedLabel}`;
625
652
  const renderValue = React.useMemo(() => {
626
653
  if (areAllSelected) {
627
654
  return /* @__PURE__ */ jsxRuntime.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] = 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
- });
913
+ const _copyText = cssUtils.useTranslationWithFallback("c4r.button.copy", copyText);
914
+ const copyTooltipText = copyText === null ? null : _copyText;
915
+ const copySuccessMessage = cssUtils.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__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {});
895
928
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
896
929
  /* @__PURE__ */ jsxRuntime.jsx(
897
930
  material.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__ */ jsxRuntime.jsxs(
903
937
  material.Box,
904
938
  {
@@ -914,9 +948,9 @@ const _CopiableComponent = ({
914
948
  {
915
949
  ...buttonProps,
916
950
  disabled,
917
- icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.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__ */ jsxRuntime.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 = reactIntl.useIntl();
983
- const intlConfig = cssUtils.useImperativeIntl(intl);
984
- const [showText, setShowText] = React.useState(false);
1019
+ const [showPassword, setShowPassword] = React.useState(false);
985
1020
  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
- });
1021
+ const inputType = !password ? "text" : showPassword ? "text" : "password";
1022
+ const showTextLabel = cssUtils.useTranslationWithFallback(
1023
+ "c4r.button.show",
1024
+ showTextProp
1025
+ );
1026
+ const hideTextLabel = cssUtils.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
  cssUtils.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__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}),
1005
- tooltip: showTextLabel,
1006
- "aria-label": showTextLabel
1045
+ icon: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}),
1046
+ tooltip: currentLabel,
1047
+ "aria-label": currentLabel
1007
1048
  }
1008
1049
  ) });
1009
1050
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1273,10 +1314,12 @@ function useCreatableAutocomplete({
1273
1314
  newItemIcon,
1274
1315
  multiple
1275
1316
  }) {
1276
- const intl = reactIntl.useIntl();
1277
- const intlConfig = cssUtils.useImperativeIntl(intl);
1278
1317
  const filter = material.createFilterOptions();
1279
1318
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1319
+ const addLabel = cssUtils.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 = 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
1382
  const [multipleValue, setMultipleValue] = React.useState(
1346
1383
  Array.isArray(value) ? value : value ? [value] : []
1347
1384
  );
1348
1385
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1386
+ const defaultCounterText = cssUtils.useTranslationWithFallback(
1387
+ "c4r.form.selected",
1388
+ counterText
1389
+ );
1390
+ const defaultAllSelectedText = cssUtils.useTranslationWithFallback(
1391
+ "c4r.form.allSelected",
1392
+ allSelectedText
1393
+ );
1349
1394
  React.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 = cssUtils.MENU_LIST_MAX_SIZE,
1524
+ selectAllText,
1479
1525
  ...otherProps
1480
1526
  }, ref) {
1481
1527
  const childrenArray = React.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__ */ jsxRuntime.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__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
@@ -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
  ]
@@ -4852,6 +4945,9 @@ function _FilterDropdown({
4852
4945
  responsive,
4853
4946
  tooltipLabel,
4854
4947
  tooltipPlacement,
4948
+ tooltipProps,
4949
+ buttonProps,
4950
+ iconButtonProps,
4855
4951
  slotProps,
4856
4952
  MenuListProps,
4857
4953
  ...props
@@ -4889,14 +4985,30 @@ function _FilterDropdown({
4889
4985
  "data-color": buttonColor
4890
4986
  };
4891
4987
  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,
4988
+ /* @__PURE__ */ jsxRuntime.jsx(
4989
+ material.Tooltip,
4894
4990
  {
4895
- ...commonButtonProps,
4896
- endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
4897
- children: menuLabel
4991
+ title: tooltipLabel,
4992
+ placement: tooltipPlacement,
4993
+ ...tooltipProps,
4994
+ children: /* @__PURE__ */ jsxRuntime.jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsxRuntime.jsx(
4995
+ cssUtils.IconButton,
4996
+ {
4997
+ ...commonButtonProps,
4998
+ icon,
4999
+ ...iconButtonProps
5000
+ }
5001
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
5002
+ Button,
5003
+ {
5004
+ ...commonButtonProps,
5005
+ endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
5006
+ ...buttonProps,
5007
+ children: menuLabel
5008
+ }
5009
+ ) })
4898
5010
  }
4899
- ) }) }),
5011
+ ),
4900
5012
  /* @__PURE__ */ jsxRuntime.jsxs(
4901
5013
  Menu,
4902
5014
  {
@@ -4946,6 +5058,280 @@ function _FilterDropdown({
4946
5058
  const FilterDropdown = React.forwardRef(
4947
5059
  _FilterDropdown
4948
5060
  );
5061
+ const SearchIcon = material.styled(Search.Search, {
5062
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
5063
+ })(
5064
+ ({ theme, minimized, disabled }) => ({
5065
+ cursor: !disabled && minimized ? "pointer" : "inherit",
5066
+ width: cssUtils.ICON_SIZE_MEDIUM,
5067
+ height: cssUtils.ICON_SIZE_MEDIUM,
5068
+ path: {
5069
+ fillOpacity: 1,
5070
+ fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
5071
+ }
5072
+ })
5073
+ );
5074
+ const ClearSearchIcon = material.styled(iconsMaterial.Cancel)(({ theme }) => ({
5075
+ color: `${theme.palette.text.hint} !important`
5076
+ }));
5077
+ const LoadingSearchIcon = material.styled(material.CircularProgress)(({ theme }) => ({
5078
+ svg: {
5079
+ color: `${theme.palette.primary.main} !important`
5080
+ }
5081
+ }));
5082
+ const SearchInputAdornment = material.styled(material.InputAdornment, {
5083
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
5084
+ })(
5085
+ ({ theme, minimized, expanded }) => ({
5086
+ // Start adornment
5087
+ "&.MuiInputAdornment-positionStart": {
5088
+ marginLeft: minimized ? theme.spacing(1) : void 0
5089
+ },
5090
+ // End adornment
5091
+ "&.MuiInputAdornment-positionEnd": {
5092
+ minWidth: theme.spacing(4),
5093
+ "&.MuiInputAdornment-sizeSmall": {
5094
+ minWidth: theme.spacing(3)
5095
+ }
5096
+ },
5097
+ ...expanded && !minimized && {
5098
+ "&.MuiInputAdornment-root": {
5099
+ minWidth: theme.spacing(9),
5100
+ "&.MuiInputAdornment-sizeSmall": {
5101
+ minWidth: theme.spacing(7)
5102
+ }
5103
+ }
5104
+ }
5105
+ })
5106
+ );
5107
+ const SearchFieldBase = material.styled(material.TextField, {
5108
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused" && prop !== "emphasis"
5109
+ })(({ theme, emphasis = "filled", minimized, isInputFocused }) => ({
5110
+ "&.MuiTextField-root .MuiInputBase-root": {
5111
+ paddingRight: theme.spacing(1),
5112
+ transition: theme.transitions.create("width", {
5113
+ easing: theme.transitions.easing.easeInOut,
5114
+ duration: theme.transitions.duration.shortest
5115
+ }),
5116
+ "&.MuiInputBase-sizeSmall": {
5117
+ paddingRight: theme.spacing(0.5)
5118
+ },
5119
+ "&:before": {
5120
+ border: "none !important",
5121
+ "&:hover": {
5122
+ border: "none !important"
5123
+ }
5124
+ },
5125
+ // Input
5126
+ "& .MuiInputBase-input": {
5127
+ pointerEvents: isInputFocused ? "auto" : "none"
5128
+ // Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
5129
+ },
5130
+ // Error state
5131
+ "&.Mui-error": {
5132
+ "&::after": {
5133
+ borderColor: "transparent !important"
5134
+ }
5135
+ },
5136
+ ...minimized && {
5137
+ display: "flex",
5138
+ alignItems: "center",
5139
+ justifyContent: "center",
5140
+ padding: 0,
5141
+ width: theme.spacing(6),
5142
+ cursor: "pointer",
5143
+ "& .MuiInputBase-input": {
5144
+ display: "none"
5145
+ },
5146
+ "&.MuiInputBase-sizeSmall": {
5147
+ width: theme.spacing(4)
5148
+ }
5149
+ }
5150
+ },
5151
+ // Variants
5152
+ ...emphasis === "filled" && {
5153
+ "& .MuiInputBase-root": {
5154
+ backgroundColor: minimized ? "inherit !important" : void 0,
5155
+ // not disabled
5156
+ "&:not(.Mui-disabled):hover": {
5157
+ backgroundColor: `${theme.palette.action.hover} !important`
5158
+ }
5159
+ }
5160
+ },
5161
+ ...emphasis === "transparent" && {
5162
+ "& .MuiInputBase-root": {
5163
+ backgroundColor: "transparent !important",
5164
+ "&:hover": {
5165
+ backgroundColor: "transparent"
5166
+ },
5167
+ "&.Mui-disabled": {
5168
+ backgroundColor: "transparent"
5169
+ }
5170
+ }
5171
+ },
5172
+ ...emphasis === "floating" && {
5173
+ "& .MuiInputBase-root": {
5174
+ backgroundColor: `${theme.palette.background.paper} !important`,
5175
+ boxShadow: theme.shadows[1],
5176
+ "&:hover": {
5177
+ backgroundColor: theme.palette.background.paper
5178
+ },
5179
+ "&.Mui-disabled": {
5180
+ backgroundColor: theme.palette.background.paper
5181
+ }
5182
+ }
5183
+ }
5184
+ }));
5185
+ const SearchFieldEndAdornment = ({
5186
+ disabled,
5187
+ showClearButton = true,
5188
+ loading,
5189
+ size,
5190
+ endAdornment,
5191
+ clearButton,
5192
+ clearButtonLabel,
5193
+ onClear
5194
+ }) => {
5195
+ if (!showClearButton && !endAdornment && !loading) {
5196
+ return null;
5197
+ }
5198
+ return /* @__PURE__ */ jsxRuntime.jsx(
5199
+ SearchInputAdornment,
5200
+ {
5201
+ position: "end",
5202
+ expanded: Boolean(endAdornment && showClearButton),
5203
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
5204
+ material.Stack,
5205
+ {
5206
+ direction: "row",
5207
+ spacing: 1,
5208
+ sx: {
5209
+ alignItems: "center"
5210
+ },
5211
+ children: [
5212
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSearchIcon, { size: cssUtils.ICON_SIZE_MEDIUM }) : showClearButton ? clearButton ?? /* @__PURE__ */ jsxRuntime.jsx(
5213
+ cssUtils.IconButton,
5214
+ {
5215
+ onClick: onClear,
5216
+ size,
5217
+ color: "default",
5218
+ disabled,
5219
+ tooltip: clearButtonLabel,
5220
+ "aria-label": String(clearButtonLabel),
5221
+ icon: /* @__PURE__ */ jsxRuntime.jsx(ClearSearchIcon, {})
5222
+ }
5223
+ ) : null,
5224
+ endAdornment
5225
+ ]
5226
+ }
5227
+ )
5228
+ }
5229
+ );
5230
+ };
5231
+ const SearchFieldStartAdornment = ({
5232
+ minimized,
5233
+ loading,
5234
+ startAdornment,
5235
+ disabled
5236
+ }) => {
5237
+ return /* @__PURE__ */ jsxRuntime.jsx(SearchInputAdornment, { position: "start", minimized, children: loading && minimized ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSearchIcon, { size: cssUtils.ICON_SIZE_MEDIUM }) : startAdornment || /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { disabled, minimized }) });
5238
+ };
5239
+ function _SearchField({
5240
+ value,
5241
+ defaultValue,
5242
+ placeholder,
5243
+ disabled,
5244
+ minimized = false,
5245
+ loading = false,
5246
+ variant = "filled",
5247
+ size = "small",
5248
+ InputProps,
5249
+ inputProps,
5250
+ startAdornment,
5251
+ endAdornment,
5252
+ onFocus,
5253
+ onBlur,
5254
+ onChange,
5255
+ onClick,
5256
+ onResetSearch,
5257
+ showClearButton = true,
5258
+ clearButtonLabel,
5259
+ clearButton,
5260
+ ...otherProps
5261
+ }, ref) {
5262
+ const [isInputFocused, setIsInputFocused] = React.useState(false);
5263
+ const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
5264
+ const clearButtonLabelValue = cssUtils.useTranslationWithFallback(
5265
+ "c4r.button.clear",
5266
+ clearButtonLabel
5267
+ );
5268
+ const handleFocus = (event) => {
5269
+ setIsInputFocused(true);
5270
+ onFocus == null ? void 0 : onFocus(event);
5271
+ };
5272
+ const handleBlur = (event) => {
5273
+ setIsInputFocused(false);
5274
+ onBlur == null ? void 0 : onBlur(event);
5275
+ };
5276
+ const handleClear = () => {
5277
+ onResetSearch == null ? void 0 : onResetSearch();
5278
+ onChange == null ? void 0 : onChange({ target: { value: "" } });
5279
+ };
5280
+ return /* @__PURE__ */ jsxRuntime.jsx(
5281
+ SearchFieldBase,
5282
+ {
5283
+ value: minimized ? "" : value,
5284
+ defaultValue,
5285
+ placeholder: minimized ? "" : placeholder,
5286
+ onChange,
5287
+ onClick,
5288
+ variant: "filled",
5289
+ emphasis: variant,
5290
+ size,
5291
+ focused: false,
5292
+ isInputFocused,
5293
+ disabled,
5294
+ minimized,
5295
+ InputProps: {
5296
+ onFocus: handleFocus,
5297
+ onBlur: handleBlur,
5298
+ startAdornment: /* @__PURE__ */ jsxRuntime.jsx(
5299
+ SearchFieldStartAdornment,
5300
+ {
5301
+ minimized,
5302
+ loading,
5303
+ disabled,
5304
+ startAdornment
5305
+ }
5306
+ ),
5307
+ endAdornment: !minimized && /* @__PURE__ */ jsxRuntime.jsx(
5308
+ SearchFieldEndAdornment,
5309
+ {
5310
+ disabled,
5311
+ loading,
5312
+ showClearButton: clearButtonVisibility,
5313
+ clearButton,
5314
+ clearButtonLabel: clearButtonLabelValue,
5315
+ onClear: handleClear,
5316
+ size,
5317
+ endAdornment
5318
+ }
5319
+ ),
5320
+ ...InputProps
5321
+ },
5322
+ inputProps: {
5323
+ role: "searchbox",
5324
+ ...inputProps
5325
+ },
5326
+ role: "search",
5327
+ "data-variant": variant,
5328
+ "data-name": "search-field",
5329
+ ref,
5330
+ ...otherProps
5331
+ }
5332
+ );
5333
+ }
5334
+ const SearchField = React.forwardRef(_SearchField);
4949
5335
  const MAX_WIDTH = 480;
4950
5336
  const SnackbarRoot = material.styled(material.Snackbar)(({ theme }) => ({
4951
5337
  bottom: theme.spacing(2),
@@ -5050,10 +5436,13 @@ function Snackbar({
5050
5436
  onClose = () => void 0,
5051
5437
  autoWidth,
5052
5438
  icon,
5439
+ closeTooltipText,
5053
5440
  ...rest
5054
5441
  }) {
5055
- const intl = reactIntl.useIntl();
5056
- const intlConfig = cssUtils.useImperativeIntl(intl);
5442
+ const closeTooltipLabel = cssUtils.useTranslationWithFallback(
5443
+ "c4r.button.close",
5444
+ closeTooltipText
5445
+ );
5057
5446
  const isNeutral = severity === "neutral";
5058
5447
  const disabledIcon = icon === false || isNeutral && !icon;
5059
5448
  const disabledAutoHide = autoHideDuration === null;
@@ -5094,9 +5483,7 @@ function Snackbar({
5094
5483
  color: "default",
5095
5484
  onClick: (e) => onClose(e, "timeout"),
5096
5485
  icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.CloseOutlined, {}),
5097
- tooltip: intlConfig.formatMessage({
5098
- id: "c4r.button.close"
5099
- })
5486
+ tooltip: closeTooltipLabel
5100
5487
  }
5101
5488
  ) })
5102
5489
  ]
@@ -5419,10 +5806,26 @@ function useFileUpload({
5419
5806
  files,
5420
5807
  multiple,
5421
5808
  placeholder,
5422
- uploadInputRef
5809
+ uploadInputRef,
5810
+ filesSelectedText,
5811
+ dragPlaceholderText,
5812
+ dragActivePlaceholderText
5423
5813
  }) {
5424
- const intl = reactIntl.useIntl();
5425
- const intlConfig = cssUtils.useImperativeIntl(intl);
5814
+ const filesSelectedLabel = cssUtils.useTranslationWithFallback(
5815
+ "c4r.form.filesSelected",
5816
+ filesSelectedText,
5817
+ { count: (files == null ? void 0 : files.length) ?? 0 }
5818
+ );
5819
+ const dragPlaceholderLabel = cssUtils.useTranslationWithFallback(
5820
+ "c4r.form.dragPlaceholder",
5821
+ dragPlaceholderText,
5822
+ { count: multiple ? 0 : 1 }
5823
+ );
5824
+ const dragActivePlaceholderLabel = cssUtils.useTranslationWithFallback(
5825
+ "c4r.form.dragActivePlaceholder",
5826
+ dragActivePlaceholderText,
5827
+ { count: multiple ? 0 : 1 }
5828
+ );
5426
5829
  const [filesText, setFilesText] = React.useState("");
5427
5830
  const [dragOver, setDragOver] = React.useState(false);
5428
5831
  React.useEffect(() => {
@@ -5431,14 +5834,9 @@ function useFileUpload({
5431
5834
  } else if (files.length === 1) {
5432
5835
  setFilesText(files[0].name);
5433
5836
  } else {
5434
- setFilesText(
5435
- intlConfig.formatMessage(
5436
- { id: "c4r.form.filesSelected" },
5437
- { count: files.length }
5438
- )
5439
- );
5837
+ setFilesText(filesSelectedLabel);
5440
5838
  }
5441
- }, [files, intlConfig]);
5839
+ }, [files, filesSelectedLabel]);
5442
5840
  const handleBrowse = () => {
5443
5841
  var _a;
5444
5842
  (_a = uploadInputRef.current) == null ? void 0 : _a.click();
@@ -5478,22 +5876,11 @@ function useFileUpload({
5478
5876
  onChange == null ? void 0 : onChange([]);
5479
5877
  };
5480
5878
  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
5879
  if (dragOver) {
5491
- placeholderText = dragPlaceholder;
5492
- } else {
5493
- placeholderText = placeholder ?? defaultPlaceholder;
5880
+ return dragActivePlaceholderLabel;
5494
5881
  }
5495
- return placeholderText;
5496
- }, [dragOver, multiple, placeholder, intlConfig]);
5882
+ return placeholder ?? dragPlaceholderLabel;
5883
+ }, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
5497
5884
  const inputEvents = {
5498
5885
  onDragOver: handleDragOver,
5499
5886
  onDragLeave: handleDragLeave,
@@ -5720,12 +6107,12 @@ function _EllipsisWithTooltip({
5720
6107
  );
5721
6108
  }
5722
6109
  const EllipsisWithTooltip = React.forwardRef(_EllipsisWithTooltip);
5723
- exports.Alert = Alert$1.Alert;
5724
- exports.Link = Alert$1.Link;
5725
- exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
5726
6110
  exports.IconButton = cssUtils.IconButton;
5727
6111
  exports.TablePaginationActions = cssUtils.TablePaginationActions;
5728
6112
  exports.Typography = cssUtils.Typography;
6113
+ exports.Alert = Alert$1.Alert;
6114
+ exports.Link = Alert$1.Link;
6115
+ exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
5729
6116
  exports.MenuItem = MenuItem.MenuItem;
5730
6117
  exports.AUTOCOMPLETE_GROUP_HEADER_PROPERTY = AUTOCOMPLETE_GROUP_HEADER_PROPERTY;
5731
6118
  exports.AccordionGroup = AccordionGroup;
@@ -5769,6 +6156,7 @@ exports.MenuList = MenuList;
5769
6156
  exports.MultipleAutocomplete = MultipleAutocomplete;
5770
6157
  exports.MultipleSelectField = MultipleSelectField;
5771
6158
  exports.PasswordField = PasswordField;
6159
+ exports.SearchField = SearchField;
5772
6160
  exports.SelectField = SelectField;
5773
6161
  exports.Snackbar = Snackbar;
5774
6162
  exports.SplitButton = SplitButton;