@carto/meridian-ds 2.6.1 → 2.7.0-alpha-loader.1

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 (180) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{Alert-DHd9hCGz.js → Alert-BZPM5zpX.js} +5 -41
  3. package/dist/{Alert-DOeOwxOe.cjs → Alert-C4W0H_uN.cjs} +4 -40
  4. package/dist/{MenuItem-CYJN2OVU.cjs → MenuItem-CgF4QdGi.cjs} +12 -3
  5. package/dist/{MenuItem-MUmADf3e.js → MenuItem-DRUK149i.js} +12 -3
  6. package/dist/{SwatchSquare-CaaLsjAC.js → Search-C7wkXu3f.js} +4 -23
  7. package/dist/{SwatchSquare-B8PIY3Rd.cjs → Search-CMWbM9nD.cjs} +3 -22
  8. package/dist/SwatchSquare-B6KYVoqV.js +24 -0
  9. package/dist/SwatchSquare-DuXPIL7t.cjs +23 -0
  10. package/dist/components/index.cjs +678 -235
  11. package/dist/components/index.js +678 -235
  12. package/dist/{css-utils-CCi3p7os.cjs → css-utils-CH7es90t.cjs} +45 -11
  13. package/dist/{css-utils-WejOmkiI.js → css-utils-CjUBRJVK.js} +47 -13
  14. package/dist/custom-icons/index.cjs +774 -611
  15. package/dist/custom-icons/index.js +774 -611
  16. package/dist/theme/index.cjs +75 -7
  17. package/dist/theme/index.js +77 -9
  18. package/dist/types/components/Alert/Alert.d.ts.map +1 -1
  19. package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
  20. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts +1 -0
  21. package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts.map +1 -1
  22. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts +1 -1
  23. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts.map +1 -1
  24. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts +1 -1
  25. package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
  26. package/dist/types/components/Autocomplete/CreatableAutocomplete/useCreatableAutocomplete.d.ts.map +1 -1
  27. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts +1 -1
  28. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts.map +1 -1
  29. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts +1 -1
  30. package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts.map +1 -1
  31. package/dist/types/components/Autocomplete/MultipleAutocomplete/useMultipleAutocomplete.d.ts.map +1 -1
  32. package/dist/types/components/Autocomplete/types.d.ts +13 -1
  33. package/dist/types/components/Autocomplete/types.d.ts.map +1 -1
  34. package/dist/types/components/Avatar/Avatar.d.ts +0 -2
  35. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  36. package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts +7 -1
  37. package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts.map +1 -1
  38. package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts +5 -1
  39. package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts.map +1 -1
  40. package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts +3 -1
  41. package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts.map +1 -1
  42. package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts +5 -1
  43. package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts.map +1 -1
  44. package/dist/types/components/CopiableComponent/CopiableComponent.d.ts.map +1 -1
  45. package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts +3 -0
  46. package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts.map +1 -1
  47. package/dist/types/components/CopiableComponent/types.d.ts +8 -1
  48. package/dist/types/components/CopiableComponent/types.d.ts.map +1 -1
  49. package/dist/types/components/CopiableInputText/CopiableInputText.d.ts +9 -3
  50. package/dist/types/components/CopiableInputText/CopiableInputText.d.ts.map +1 -1
  51. package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts +28 -3
  52. package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts.map +1 -1
  53. package/dist/types/components/CopiableInputText/types.d.ts +4 -1
  54. package/dist/types/components/CopiableInputText/types.d.ts.map +1 -1
  55. package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts +1 -1
  56. package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts.map +1 -1
  57. package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts +3 -0
  58. package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts.map +1 -1
  59. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts +1 -1
  60. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  61. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts +3 -0
  62. package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -1
  63. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts +1 -1
  64. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  65. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts +3 -0
  66. package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
  67. package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts +1 -1
  68. package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts.map +1 -1
  69. package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts +3 -0
  70. package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts.map +1 -1
  71. package/dist/types/components/DatePickers/types.d.ts +7 -0
  72. package/dist/types/components/DatePickers/types.d.ts.map +1 -1
  73. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts +48 -0
  74. package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts.map +1 -1
  75. package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts.map +1 -1
  76. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts +2 -0
  77. package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts.map +1 -0
  78. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts +1 -1
  79. package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
  80. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts +14 -0
  81. package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts.map +1 -1
  82. package/dist/types/components/Dialog/types.d.ts +6 -0
  83. package/dist/types/components/Dialog/types.d.ts.map +1 -1
  84. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts +1 -1
  85. package/dist/types/components/FilterDropdown/FilterDropdown.d.ts.map +1 -1
  86. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts +48 -0
  87. package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts.map +1 -1
  88. package/dist/types/components/FilterDropdown/types.d.ts +8 -0
  89. package/dist/types/components/FilterDropdown/types.d.ts.map +1 -1
  90. package/dist/types/components/Loader/Loader.d.ts +10 -0
  91. package/dist/types/components/Loader/Loader.d.ts.map +1 -0
  92. package/dist/types/components/Loader/Loader.stories.d.ts +54 -0
  93. package/dist/types/components/Loader/Loader.stories.d.ts.map +1 -0
  94. package/dist/types/components/Loader/Loader.test.d.ts +2 -0
  95. package/dist/types/components/Loader/Loader.test.d.ts.map +1 -0
  96. package/dist/types/components/Loader/index.d.ts +3 -0
  97. package/dist/types/components/Loader/index.d.ts.map +1 -0
  98. package/dist/types/components/Menu/Menu/Menu.stories.d.ts +16 -7
  99. package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
  100. package/dist/types/components/Menu/MenuItem/MenuItem.d.ts.map +1 -1
  101. package/dist/types/components/Menu/MenuItemFilter/MenuItemFilter.d.ts.map +1 -1
  102. package/dist/types/components/Menu/types.d.ts +1 -0
  103. package/dist/types/components/Menu/types.d.ts.map +1 -1
  104. package/dist/types/components/PasswordField/PasswordField.d.ts +10 -1
  105. package/dist/types/components/PasswordField/PasswordField.d.ts.map +1 -1
  106. package/dist/types/components/PasswordField/PasswordField.stories.d.ts +10 -1
  107. package/dist/types/components/PasswordField/PasswordField.stories.d.ts.map +1 -1
  108. package/dist/types/components/SearchField/SearchField.d.ts +4 -0
  109. package/dist/types/components/SearchField/SearchField.d.ts.map +1 -0
  110. package/dist/types/components/SearchField/SearchField.stories.d.ts +111 -0
  111. package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -0
  112. package/dist/types/components/SearchField/SearchField.styled.d.ts +23 -0
  113. package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -0
  114. package/dist/types/components/SearchField/SearchField.test.d.ts +2 -0
  115. package/dist/types/components/SearchField/SearchField.test.d.ts.map +1 -0
  116. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts +19 -0
  117. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts.map +1 -0
  118. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts +14 -0
  119. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts.map +1 -0
  120. package/dist/types/components/SearchField/index.d.ts +3 -0
  121. package/dist/types/components/SearchField/index.d.ts.map +1 -0
  122. package/dist/types/components/SearchField/types.d.ts +72 -0
  123. package/dist/types/components/SearchField/types.d.ts.map +1 -0
  124. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
  125. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts +22 -2
  126. package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts.map +1 -1
  127. package/dist/types/components/SelectField/types.d.ts +4 -0
  128. package/dist/types/components/SelectField/types.d.ts.map +1 -1
  129. package/dist/types/components/Snackbar/Snackbar.d.ts +2 -1
  130. package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
  131. package/dist/types/components/Snackbar/Snackbar.stories.d.ts +15 -0
  132. package/dist/types/components/Snackbar/Snackbar.stories.d.ts.map +1 -1
  133. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +3 -0
  134. package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
  135. package/dist/types/components/UploadField/useFileUpload.d.ts +4 -1
  136. package/dist/types/components/UploadField/useFileUpload.d.ts.map +1 -1
  137. package/dist/types/components/index.d.ts +4 -0
  138. package/dist/types/components/index.d.ts.map +1 -1
  139. package/dist/types/custom-icons/ApiAccessToken.d.ts +4 -0
  140. package/dist/types/custom-icons/ApiAccessToken.d.ts.map +1 -0
  141. package/dist/types/custom-icons/ApiBaseUrl.d.ts +4 -0
  142. package/dist/types/custom-icons/ApiBaseUrl.d.ts.map +1 -0
  143. package/dist/types/custom-icons/AppCredentials.d.ts +4 -0
  144. package/dist/types/custom-icons/AppCredentials.d.ts.map +1 -0
  145. package/dist/types/custom-icons/M2mOauthClient.d.ts +4 -0
  146. package/dist/types/custom-icons/M2mOauthClient.d.ts.map +1 -0
  147. package/dist/types/custom-icons/SpaOauthClient.d.ts +4 -0
  148. package/dist/types/custom-icons/SpaOauthClient.d.ts.map +1 -0
  149. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts +4 -0
  150. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts.map +1 -0
  151. package/dist/types/custom-icons/index.d.ts +6 -0
  152. package/dist/types/custom-icons/index.d.ts.map +1 -1
  153. package/dist/types/localization/en.d.ts +6 -0
  154. package/dist/types/localization/en.d.ts.map +1 -1
  155. package/dist/types/localization/es.d.ts +6 -0
  156. package/dist/types/localization/es.d.ts.map +1 -1
  157. package/dist/types/localization/id.d.ts +6 -0
  158. package/dist/types/localization/id.d.ts.map +1 -1
  159. package/dist/types/localization/index.d.ts +18 -0
  160. package/dist/types/localization/index.d.ts.map +1 -1
  161. package/dist/types/theme/carto-theme.d.ts.map +1 -1
  162. package/dist/types/theme/components/data-display.d.ts.map +1 -1
  163. package/dist/types/theme/components/feedback.d.ts.map +1 -1
  164. package/dist/types/theme/components/layout.d.ts +3 -0
  165. package/dist/types/theme/components/layout.d.ts.map +1 -0
  166. package/dist/types/theme/components/navigation.d.ts.map +1 -1
  167. package/dist/types/theme/types.d.ts +11 -0
  168. package/dist/types/theme/types.d.ts.map +1 -1
  169. package/dist/types/utils/useTranslationWithFallback.d.ts +39 -0
  170. package/dist/types/utils/useTranslationWithFallback.d.ts.map +1 -0
  171. package/dist/types/utils/useTranslationWithFallback.test.d.ts +2 -0
  172. package/dist/types/utils/useTranslationWithFallback.test.d.ts.map +1 -0
  173. package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.styled.d.ts +5 -5
  174. package/dist/widgets/index.cjs +8 -7
  175. package/dist/widgets/index.js +4 -3
  176. package/package.json +1 -1
  177. package/dist/types/utils/useTranslationFallback.d.ts +0 -20
  178. package/dist/types/utils/useTranslationFallback.d.ts.map +0 -1
  179. package/dist/types/utils/useTranslationFallback.test.d.ts +0 -2
  180. 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-CH7es90t.cjs");
8
+ const Alert$1 = require("../Alert-C4W0H_uN.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-CgF4QdGi.cjs");
13
12
  require("cartocolor");
14
13
  const reactWindow = require("react-window");
15
14
  const reactCodemirror2 = require("react-codemirror2");
@@ -38,9 +37,11 @@ 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");
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
  }
@@ -847,6 +876,64 @@ function _ToggleButtonGroup({
847
876
  );
848
877
  }
849
878
  const ToggleButtonGroup = React.forwardRef(_ToggleButtonGroup);
879
+ const StyledGrid = material.styled(material.Grid, {
880
+ shouldForwardProp: (prop) => prop !== "fullHeight" && prop !== "height"
881
+ })(({ fullHeight, theme }) => ({
882
+ display: "flex",
883
+ flexDirection: "column",
884
+ alignItems: "center",
885
+ justifyContent: "center",
886
+ gap: theme.spacing(1.5),
887
+ ...fullHeight && {
888
+ flex: 1,
889
+ height: "100%",
890
+ width: "100%"
891
+ }
892
+ }));
893
+ function _Loader({
894
+ label,
895
+ secondLabel,
896
+ color = "primary",
897
+ fullHeight,
898
+ ...otherProps
899
+ }, ref) {
900
+ const labelText = cssUtils.useTranslationWithFallback("c4r.utils.loader.label", label);
901
+ const hasAnyLabel = labelText || secondLabel;
902
+ return /* @__PURE__ */ jsxRuntime.jsxs(
903
+ StyledGrid,
904
+ {
905
+ container: true,
906
+ fullHeight,
907
+ ...otherProps,
908
+ ref,
909
+ "aria-busy": true,
910
+ "data-name": "loader",
911
+ "data-full-height": fullHeight,
912
+ children: [
913
+ /* @__PURE__ */ jsxRuntime.jsx(
914
+ material.CircularProgress,
915
+ {
916
+ color,
917
+ "aria-labelledby": hasAnyLabel ? "loader-label" : void 0
918
+ }
919
+ ),
920
+ hasAnyLabel && /* @__PURE__ */ jsxRuntime.jsxs(material.Stack, { direction: "column", alignItems: "center", children: [
921
+ labelText && /* @__PURE__ */ jsxRuntime.jsx(cssUtils.Typography, { variant: "body2", color: "textSecondary", id: "loader-label", children: labelText }),
922
+ secondLabel && /* @__PURE__ */ jsxRuntime.jsx(
923
+ cssUtils.Typography,
924
+ {
925
+ variant: "body2",
926
+ color: "textSecondary",
927
+ id: labelText ? void 0 : "loader-label",
928
+ children: secondLabel
929
+ }
930
+ )
931
+ ] })
932
+ ]
933
+ }
934
+ );
935
+ }
936
+ const Loader = React.forwardRef(_Loader);
850
937
  async function copyString(value) {
851
938
  return await navigator.clipboard.writeText(value);
852
939
  }
@@ -871,19 +958,22 @@ const _CopiableComponent = ({
871
958
  copiedText,
872
959
  button,
873
960
  buttonLabel,
961
+ buttonIcon,
874
962
  buttonProps,
875
963
  ariaLabel,
876
964
  dataTestId,
877
965
  tooltipPlacement = "top",
966
+ tooltipProps,
967
+ snackbarProps,
878
968
  ...props
879
969
  }, ref) => {
880
970
  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
- });
971
+ const _copyText = cssUtils.useTranslationWithFallback("c4r.button.copy", copyText);
972
+ const copyTooltipText = copyText === null ? null : _copyText;
973
+ const copySuccessMessage = cssUtils.useTranslationWithFallback(
974
+ "c4r.notifications.copiedToClipboard",
975
+ copiedText
976
+ );
887
977
  const { copy } = useCopyValue(copyTooltipText, copySuccessMessage);
888
978
  const handleClick = (e) => {
889
979
  e.preventDefault();
@@ -892,6 +982,7 @@ const _CopiableComponent = ({
892
982
  setOpen(true);
893
983
  }).catch(console.error);
894
984
  };
985
+ const copyIcon = buttonIcon ?? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {});
895
986
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
896
987
  /* @__PURE__ */ jsxRuntime.jsx(
897
988
  material.Tooltip,
@@ -899,6 +990,7 @@ const _CopiableComponent = ({
899
990
  title: copyTooltipText,
900
991
  leaveDelay: 0,
901
992
  placement: tooltipPlacement,
993
+ ...tooltipProps,
902
994
  children: /* @__PURE__ */ jsxRuntime.jsxs(
903
995
  material.Box,
904
996
  {
@@ -914,9 +1006,9 @@ const _CopiableComponent = ({
914
1006
  {
915
1007
  ...buttonProps,
916
1008
  disabled,
917
- icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {}),
1009
+ icon: copyIcon,
918
1010
  "data-testid": dataTestId,
919
- "aria-label": ariaLabel || buttonLabel || copyTooltipText || intlConfig.formatMessage({ id: "c4r.button.copy" }),
1011
+ "aria-label": ariaLabel || buttonLabel || (copyTooltipText ?? ""),
920
1012
  sx: {
921
1013
  display: "flex"
922
1014
  }
@@ -930,10 +1022,11 @@ const _CopiableComponent = ({
930
1022
  /* @__PURE__ */ jsxRuntime.jsx(
931
1023
  Snackbar,
932
1024
  {
933
- open,
934
1025
  autoWidth: true,
935
1026
  closeable: false,
936
1027
  autoHideDuration: 4e3,
1028
+ ...snackbarProps,
1029
+ open,
937
1030
  onClose: () => setOpen(false),
938
1031
  children: copySuccessMessage
939
1032
  }
@@ -977,16 +1070,22 @@ function _CopiableInputText({
977
1070
  size = "small",
978
1071
  onFocus,
979
1072
  onBlur,
1073
+ showText: showTextProp,
1074
+ hideText: hideTextProp,
980
1075
  ...rest
981
1076
  }, ref) {
982
- const intl = reactIntl.useIntl();
983
- const intlConfig = cssUtils.useImperativeIntl(intl);
984
- const [showText, setShowText] = React.useState(false);
1077
+ const [showPassword, setShowPassword] = React.useState(false);
985
1078
  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
- });
1079
+ const inputType = !password ? "text" : showPassword ? "text" : "password";
1080
+ const showTextLabel = cssUtils.useTranslationWithFallback(
1081
+ "c4r.button.show",
1082
+ showTextProp
1083
+ );
1084
+ const hideTextLabel = cssUtils.useTranslationWithFallback(
1085
+ "c4r.button.hide",
1086
+ hideTextProp
1087
+ );
1088
+ const currentLabel = showPassword ? hideTextLabel : showTextLabel;
990
1089
  const handleFocus = (event) => {
991
1090
  setIsInputFocused(true);
992
1091
  onFocus == null ? void 0 : onFocus(event);
@@ -999,11 +1098,11 @@ function _CopiableInputText({
999
1098
  cssUtils.IconButton,
1000
1099
  {
1001
1100
  edge: variant !== "standard" ? "end" : void 0,
1002
- onClick: () => setShowText(!showText),
1101
+ onClick: () => setShowPassword(!showPassword),
1003
1102
  size,
1004
- icon: showText ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}),
1005
- tooltip: showTextLabel,
1006
- "aria-label": showTextLabel
1103
+ icon: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOutlined, {}) : /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.VisibilityOffOutlined, {}),
1104
+ tooltip: currentLabel,
1105
+ "aria-label": currentLabel
1007
1106
  }
1008
1107
  ) });
1009
1108
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1273,10 +1372,12 @@ function useCreatableAutocomplete({
1273
1372
  newItemIcon,
1274
1373
  multiple
1275
1374
  }) {
1276
- const intl = reactIntl.useIntl();
1277
- const intlConfig = cssUtils.useImperativeIntl(intl);
1278
1375
  const filter = material.createFilterOptions();
1279
1376
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1377
+ const addLabel = cssUtils.useTranslationWithFallback(
1378
+ "c4r.form.add",
1379
+ typeof newItemLabel === "string" ? newItemLabel : void 0
1380
+ );
1280
1381
  const creatableFilterOptions = (options, params) => {
1281
1382
  const filtered = filter(
1282
1383
  options,
@@ -1290,10 +1391,8 @@ function useCreatableAutocomplete({
1290
1391
  let newItemText;
1291
1392
  if (typeof newItemLabel === "function") {
1292
1393
  newItemText = newItemLabel(inputValue);
1293
- } else if (newItemLabel) {
1294
- newItemText = `${newItemLabel} "${inputValue}"`;
1295
1394
  } else {
1296
- newItemText = `${intlConfig.formatMessage({ id: "c4r.form.add" })} "${inputValue}"`;
1395
+ newItemText = `${addLabel} "${inputValue}"`;
1297
1396
  }
1298
1397
  filtered.push({
1299
1398
  inputValue,
@@ -1338,14 +1437,18 @@ function useMultipleAutocomplete({
1338
1437
  counterText,
1339
1438
  allSelectedText
1340
1439
  }) {
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
1440
  const [multipleValue, setMultipleValue] = React.useState(
1346
1441
  Array.isArray(value) ? value : value ? [value] : []
1347
1442
  );
1348
1443
  const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
1444
+ const defaultCounterText = cssUtils.useTranslationWithFallback(
1445
+ "c4r.form.selected",
1446
+ counterText
1447
+ );
1448
+ const defaultAllSelectedText = cssUtils.useTranslationWithFallback(
1449
+ "c4r.form.allSelected",
1450
+ allSelectedText
1451
+ );
1349
1452
  React.useEffect(() => {
1350
1453
  const newValue = Array.isArray(value) ? value : value ? [value] : [];
1351
1454
  setMultipleValue(newValue);
@@ -1476,6 +1579,7 @@ function _AutocompleteList({
1476
1579
  extended,
1477
1580
  itemHeight,
1478
1581
  maxListHeight = cssUtils.MENU_LIST_MAX_SIZE,
1582
+ selectAllText,
1479
1583
  ...otherProps
1480
1584
  }, ref) {
1481
1585
  const childrenArray = React.useMemo(() => {
@@ -1551,7 +1655,8 @@ function _AutocompleteList({
1551
1655
  {
1552
1656
  areAllSelected: !!allSelected,
1553
1657
  areAnySelected: !!someSelected,
1554
- selectAll: handleSelectAll
1658
+ selectAll: handleSelectAll,
1659
+ selectAllText
1555
1660
  }
1556
1661
  ),
1557
1662
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1582,6 +1687,7 @@ function _CreatableAutocomplete({
1582
1687
  counterFormatter,
1583
1688
  counterText,
1584
1689
  allSelectedText,
1690
+ selectAllText,
1585
1691
  options = [],
1586
1692
  value,
1587
1693
  onChange,
@@ -1632,7 +1738,8 @@ function _CreatableAutocomplete({
1632
1738
  multiple,
1633
1739
  itemHeight,
1634
1740
  maxListHeight,
1635
- extended
1741
+ extended,
1742
+ selectAllText
1636
1743
  };
1637
1744
  const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
1638
1745
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1671,6 +1778,7 @@ function _MultipleAutocomplete({
1671
1778
  counterFormatter,
1672
1779
  counterText,
1673
1780
  allSelectedText,
1781
+ selectAllText,
1674
1782
  options,
1675
1783
  value,
1676
1784
  onChange,
@@ -1712,7 +1820,8 @@ function _MultipleAutocomplete({
1712
1820
  multiple: true,
1713
1821
  itemHeight,
1714
1822
  maxListHeight,
1715
- extended
1823
+ extended,
1824
+ selectAllText
1716
1825
  };
1717
1826
  const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
1718
1827
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1853,6 +1962,7 @@ function SecondaryText({ text }) {
1853
1962
  }
1854
1963
  const Root$4 = material.styled(material.AppBar)(({ theme }) => ({
1855
1964
  backgroundColor: theme.palette.brand.appBarMain,
1965
+ userSelect: "none",
1856
1966
  "& .MuiTypography-root": {
1857
1967
  color: theme.palette.brand.appBarContrastText
1858
1968
  },
@@ -1918,16 +2028,24 @@ const Footer = material.styled(material.Box, {
1918
2028
  function CodeAreaFooter({
1919
2029
  onClickFooter,
1920
2030
  buttonFooterLabelId,
2031
+ buttonFooterText,
1921
2032
  disabledButtonFooter,
1922
2033
  withGutter = true,
1923
2034
  showSnackbar,
1924
2035
  onCloseSnackbar,
1925
2036
  loading,
1926
2037
  disabled,
2038
+ changesSavedText,
1927
2039
  ...props
1928
2040
  }) {
1929
- const intl = reactIntl.useIntl();
1930
- const intlConfig = cssUtils.useImperativeIntl(intl);
2041
+ const buttonFooterLabel = cssUtils.useTranslationWithFallback(
2042
+ buttonFooterLabelId || "c4r.button.save",
2043
+ buttonFooterText
2044
+ );
2045
+ const changesSavedLabel = cssUtils.useTranslationWithFallback(
2046
+ "c4r.notifications.changesSaved",
2047
+ changesSavedText
2048
+ );
1931
2049
  if (!onClickFooter) return null;
1932
2050
  return /* @__PURE__ */ jsxRuntime.jsxs(
1933
2051
  Footer,
@@ -1945,9 +2063,7 @@ function CodeAreaFooter({
1945
2063
  loading,
1946
2064
  onClick: onClickFooter,
1947
2065
  disabled: disabled || disabledButtonFooter,
1948
- children: intlConfig.formatMessage({
1949
- id: buttonFooterLabelId || "c4r.button.save"
1950
- })
2066
+ children: buttonFooterLabel
1951
2067
  }
1952
2068
  ),
1953
2069
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1958,9 +2074,7 @@ function CodeAreaFooter({
1958
2074
  closeable: false,
1959
2075
  autoHideDuration: 4e3,
1960
2076
  onClose: onCloseSnackbar,
1961
- children: intlConfig.formatMessage({
1962
- id: "c4r.notifications.changesSaved"
1963
- })
2077
+ children: changesSavedLabel
1964
2078
  }
1965
2079
  )
1966
2080
  ]
@@ -1982,10 +2096,12 @@ function CodeAreaHeader({
1982
2096
  disabled,
1983
2097
  copyValue,
1984
2098
  onClickExpand,
1985
- size
2099
+ size,
2100
+ showOptionsTooltipText,
2101
+ copyText,
2102
+ expandText,
2103
+ copiedText
1986
2104
  }) {
1987
- const intl = reactIntl.useIntl();
1988
- const intlConfig = cssUtils.useImperativeIntl(intl);
1989
2105
  const showExpandButton = !!onClickExpand;
1990
2106
  const showCopyButton = copyValue !== void 0;
1991
2107
  const showMenu = showExpandButton && showCopyButton;
@@ -1993,6 +2109,19 @@ function CodeAreaHeader({
1993
2109
  const [openSnackbar, setOpenSnackbar] = React.useState(false);
1994
2110
  const [anchorEl, setAnchorEl] = React.useState(null);
1995
2111
  const open = Boolean(anchorEl);
2112
+ const showOptionsTooltipLabel = cssUtils.useTranslationWithFallback(
2113
+ "c4r.button.showOptions",
2114
+ showOptionsTooltipText
2115
+ );
2116
+ const copyLabel = cssUtils.useTranslationWithFallback("c4r.button.copy", copyText);
2117
+ const expandLabel = cssUtils.useTranslationWithFallback(
2118
+ "c4r.button.expand",
2119
+ expandText
2120
+ );
2121
+ const copiedLabel = cssUtils.useTranslationWithFallback(
2122
+ "c4r.notifications.copiedToClipboard",
2123
+ copiedText
2124
+ );
1996
2125
  const openDropdown = (event) => {
1997
2126
  setAnchorEl(event.currentTarget);
1998
2127
  };
@@ -2020,7 +2149,7 @@ function CodeAreaHeader({
2020
2149
  size,
2021
2150
  icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.MoreVertOutlined, {}),
2022
2151
  disabled,
2023
- tooltip: intlConfig.formatMessage({ id: `c4r.button.showOptions` }),
2152
+ tooltip: showOptionsTooltipLabel,
2024
2153
  tooltipPlacement: "top",
2025
2154
  "aria-controls": open ? "basic-menu" : void 0,
2026
2155
  "aria-haspopup": "true",
@@ -2042,11 +2171,11 @@ function CodeAreaHeader({
2042
2171
  children: [
2043
2172
  /* @__PURE__ */ jsxRuntime.jsxs(MenuItem.MenuItem, { onClick: handleCopy, disabled, id: "copy", children: [
2044
2173
  /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopyOutlined, {}) }),
2045
- /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: intlConfig.formatMessage({ id: `c4r.button.copy` }) })
2174
+ /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: copyLabel })
2046
2175
  ] }),
2047
2176
  /* @__PURE__ */ jsxRuntime.jsxs(MenuItem.MenuItem, { onClick: onClickExpand, disabled, id: "expand", children: [
2048
2177
  /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.OpenDiagonallyRight, {}) }),
2049
- /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: intlConfig.formatMessage({ id: `c4r.button.expand` }) })
2178
+ /* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { children: expandLabel })
2050
2179
  ] })
2051
2180
  ]
2052
2181
  }
@@ -2060,9 +2189,7 @@ function CodeAreaHeader({
2060
2189
  closeable: false,
2061
2190
  autoHideDuration: 4e3,
2062
2191
  onClose: () => setOpenSnackbar(false),
2063
- children: intlConfig.formatMessage({
2064
- id: "c4r.notifications.copiedToClipboard"
2065
- })
2192
+ children: copiedLabel
2066
2193
  }
2067
2194
  )
2068
2195
  ] });
@@ -2074,7 +2201,9 @@ function CodeAreaHeader({
2074
2201
  disabled,
2075
2202
  value: copyValue,
2076
2203
  button: true,
2077
- buttonProps: { size }
2204
+ buttonProps: { size },
2205
+ copyText,
2206
+ copiedText
2078
2207
  }
2079
2208
  ),
2080
2209
  showExpandButton && /* @__PURE__ */ jsxRuntime.jsx(
@@ -2085,7 +2214,7 @@ function CodeAreaHeader({
2085
2214
  onClick: onClickExpand,
2086
2215
  icon: /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.OpenDiagonallyRight, {}),
2087
2216
  disabled,
2088
- tooltip: intlConfig.formatMessage({ id: `c4r.button.expand` }),
2217
+ tooltip: expandLabel,
2089
2218
  tooltipPlacement: "top"
2090
2219
  }
2091
2220
  )
@@ -3134,10 +3263,13 @@ function DialogHeader({
3134
3263
  secondaryActions,
3135
3264
  "aria-label": ariaLabel,
3136
3265
  closeIcon,
3266
+ closeTooltipText,
3137
3267
  ...otherProps
3138
3268
  }) {
3139
- const intl = reactIntl.useIntl();
3140
- const intlConfig = cssUtils.useImperativeIntl(intl);
3269
+ const closeTooltipLabel = cssUtils.useTranslationWithFallback(
3270
+ "c4r.button.close",
3271
+ closeTooltipText
3272
+ );
3141
3273
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3142
3274
  /* @__PURE__ */ jsxRuntime.jsxs(DialogTitle, { component: "div", "data-name": "dialog-header", ...otherProps, children: [
3143
3275
  /* @__PURE__ */ jsxRuntime.jsxs(Main$1, { children: [
@@ -3157,14 +3289,7 @@ function DialogHeader({
3157
3289
  ] }),
3158
3290
  /* @__PURE__ */ jsxRuntime.jsxs(ItemsWrapper$1, { children: [
3159
3291
  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
- )
3292
+ 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
3293
  ] })
3169
3294
  ] }),
3170
3295
  children
@@ -3173,42 +3298,56 @@ function DialogHeader({
3173
3298
  ] });
3174
3299
  }
3175
3300
  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`
3301
+ shouldForwardProp: (prop) => ![
3302
+ "scrollableContent",
3303
+ "withGutter",
3304
+ "withBottomGutter",
3305
+ "spacing"
3306
+ ].includes(prop)
3307
+ })(
3308
+ ({
3309
+ theme,
3310
+ scrollableContent,
3311
+ withGutter,
3312
+ withBottomGutter,
3313
+ spacing = 3
3314
+ }) => ({
3315
+ display: "flex",
3316
+ flexDirection: "column",
3317
+ gap: theme.spacing(spacing),
3318
+ padding: 0,
3319
+ ...theme.typography.body2,
3320
+ color: theme.palette.text.secondary,
3321
+ ".MuiAlert-root": {
3322
+ minHeight: "auto"
3323
+ },
3324
+ ...scrollableContent && {
3325
+ borderBottom: `1px solid ${theme.palette.divider}`,
3326
+ "+ .MuiDivider-root": {
3327
+ display: "none"
3328
+ }
3329
+ },
3330
+ ...withGutter && {
3331
+ padding: ` ${theme.spacing(1, 2, 0)} !important`,
3332
+ ".MuiDialog-paperFullScreen &": {
3333
+ padding: `${theme.spacing(2, 2, 0)} !important`
3334
+ }
3335
+ },
3336
+ ...withBottomGutter && {
3337
+ paddingBottom: `${theme.spacing(3)} !important`,
3338
+ ".MuiDialog-paperFullScreen &": {
3339
+ paddingBottom: `${theme.spacing(3)} !important`
3340
+ }
3203
3341
  }
3204
- }
3205
- }));
3342
+ })
3343
+ );
3206
3344
  function _DialogContent({
3207
3345
  children,
3208
3346
  scrollableContent,
3209
3347
  hasFooterAlert,
3210
3348
  withGutter = true,
3211
3349
  withBottomGutter = true,
3350
+ spacing,
3212
3351
  onScroll,
3213
3352
  ...props
3214
3353
  }, ref) {
@@ -3256,6 +3395,7 @@ function _DialogContent({
3256
3395
  scrollableContent,
3257
3396
  withGutter,
3258
3397
  withBottomGutter: withBottomGutter && withGutter,
3398
+ spacing,
3259
3399
  "data-name": "dialog-content",
3260
3400
  ...props,
3261
3401
  children
@@ -3583,15 +3723,30 @@ function CodeAreaDialogConfirmation({
3583
3723
  onClose,
3584
3724
  onCancel,
3585
3725
  cancelLabelId,
3726
+ cancelText,
3586
3727
  cancelButton,
3587
3728
  closeButton,
3588
3729
  contentLabelId,
3730
+ contentText,
3589
3731
  titleLabelId,
3732
+ titleText,
3590
3733
  severity = "warning",
3591
- content
3734
+ content,
3735
+ leaveText
3592
3736
  }) {
3593
- const intl = reactIntl.useIntl();
3594
- const intlConfig = cssUtils.useImperativeIntl(intl);
3737
+ const titleLabel = cssUtils.useTranslationWithFallback(
3738
+ titleLabelId || "c4r.dialog.confirmation.title",
3739
+ titleText
3740
+ );
3741
+ const cancelLabel = cssUtils.useTranslationWithFallback(
3742
+ cancelLabelId || "c4r.button.cancel",
3743
+ cancelText
3744
+ );
3745
+ const leaveLabel = cssUtils.useTranslationWithFallback("c4r.button.leave", leaveText);
3746
+ const contentLabel = cssUtils.useTranslationWithFallback(
3747
+ contentLabelId || "c4r.dialog.confirmation.content",
3748
+ contentText
3749
+ );
3595
3750
  if (!onClose || !onCancel) {
3596
3751
  return null;
3597
3752
  }
@@ -3600,20 +3755,12 @@ function CodeAreaDialogConfirmation({
3600
3755
  {
3601
3756
  opened: true,
3602
3757
  severity,
3603
- title: intlConfig.formatMessage({
3604
- id: titleLabelId || "c4r.dialog.confirmation.title"
3605
- }),
3758
+ title: titleLabel,
3606
3759
  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
- }) }))
3760
+ onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCancel, children: cancelLabel })),
3761
+ onClose && (closeButton ? closeButton : /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "contained", onClick: onClose, children: leaveLabel }))
3613
3762
  ] }),
3614
- children: content ? content : intlConfig.formatMessage({
3615
- id: contentLabelId || "c4r.dialog.confirmation.content"
3616
- })
3763
+ children: content ?? contentLabel
3617
3764
  }
3618
3765
  );
3619
3766
  }
@@ -3630,6 +3777,7 @@ function CodeAreaDialog({
3630
3777
  showConfirmation,
3631
3778
  onCancelConfirm,
3632
3779
  onCloseConfirm,
3780
+ confirmationDialogTexts,
3633
3781
  footerProps,
3634
3782
  saveLoading,
3635
3783
  showSaveSnackbar,
@@ -3694,7 +3842,11 @@ function CodeAreaDialog({
3694
3842
  {
3695
3843
  onClose: onCloseConfirm ?? onClose,
3696
3844
  onCancel: onCancelConfirm,
3697
- cancelLabelId: "c4r.button.keepEditing"
3845
+ cancelLabelId: "c4r.button.keepEditing",
3846
+ titleText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.titleText,
3847
+ contentText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.contentText,
3848
+ cancelText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.cancelText,
3849
+ leaveText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.leaveText
3698
3850
  }
3699
3851
  )
3700
3852
  ]
@@ -3862,10 +4014,13 @@ function DatePicker({
3862
4014
  readOnly,
3863
4015
  "aria-label": ariaLabel,
3864
4016
  "data-testid": dataTestId,
4017
+ chooseDateAriaLabel,
3865
4018
  ...props
3866
4019
  }) {
3867
- const intl = reactIntl.useIntl();
3868
- const intlConfig = cssUtils.useImperativeIntl(intl);
4020
+ const chooseDateText = cssUtils.useTranslationWithFallback(
4021
+ "c4r.form.chooseDate",
4022
+ chooseDateAriaLabel
4023
+ );
3869
4024
  return (
3870
4025
  // Don't remove className, it's used for styling
3871
4026
  /* @__PURE__ */ jsxRuntime.jsx(material.Box, { className: "CartoDatePicker-root", "data-testid": "date-picker", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -3910,16 +4065,7 @@ function DatePicker({
3910
4065
  },
3911
4066
  slots: {
3912
4067
  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
- ),
4068
+ openPickerButton: (props2) => /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { ...props2, size, "aria-label": chooseDateText }),
3923
4069
  ...slots
3924
4070
  },
3925
4071
  disableOpenPicker: !showCalendar,
@@ -4148,12 +4294,14 @@ function DateRangePicker({
4148
4294
  variant = "outlined",
4149
4295
  startProps,
4150
4296
  endProps,
4297
+ startDateLabel,
4298
+ endDateLabel,
4299
+ startDateCalendarAriaLabel,
4300
+ endDateCalendarAriaLabel,
4151
4301
  "aria-label": ariaLabel,
4152
4302
  "data-testid": dataTestId,
4153
4303
  ...props
4154
4304
  }) {
4155
- const intl = reactIntl.useIntl();
4156
- const intlConfig = cssUtils.useImperativeIntl(intl);
4157
4305
  const [isEndDateOpen, setIsEndDateOpen] = React.useState(false);
4158
4306
  const [isStartDateOpen, setIsStartDateOpen] = React.useState(false);
4159
4307
  const [startDate, setStartDate] = React.useState(
@@ -4164,6 +4312,22 @@ function DateRangePicker({
4164
4312
  (endProps == null ? void 0 : endProps.value) ?? (startProps == null ? void 0 : startProps.value) ?? /* @__PURE__ */ new Date()
4165
4313
  );
4166
4314
  const hasError = error ?? (startProps == null ? void 0 : startProps.error) ?? (endProps == null ? void 0 : endProps.error);
4315
+ const _startDateLabel = cssUtils.useTranslationWithFallback(
4316
+ "c4r.form.startDate",
4317
+ startDateLabel
4318
+ );
4319
+ const _endDateLabel = cssUtils.useTranslationWithFallback(
4320
+ "c4r.form.endDate",
4321
+ endDateLabel
4322
+ );
4323
+ const startCalendarAriaLabel = cssUtils.useTranslationWithFallback(
4324
+ "c4r.form.startDateCalendar",
4325
+ startDateCalendarAriaLabel
4326
+ );
4327
+ const endCalendarAriaLabel = cssUtils.useTranslationWithFallback(
4328
+ "c4r.form.endDateCalendar",
4329
+ endDateCalendarAriaLabel
4330
+ );
4167
4331
  const handleStartDateChange = (value, context) => {
4168
4332
  setStartDate(value);
4169
4333
  if (startProps == null ? void 0 : startProps.onChange) {
@@ -4217,13 +4381,11 @@ function DateRangePicker({
4217
4381
  ...startProps,
4218
4382
  value: (startProps == null ? void 0 : startProps.value) ?? startDate,
4219
4383
  maxDate: endDate ?? void 0,
4220
- label: (startProps == null ? void 0 : startProps.label) ?? intlConfig.formatMessage({ id: "c4r.form.startDate" }),
4384
+ label: (startProps == null ? void 0 : startProps.label) ?? _startDateLabel,
4221
4385
  slotProps: {
4222
4386
  popper: {
4223
4387
  placement: "bottom-start",
4224
- "aria-label": intlConfig.formatMessage({
4225
- id: "c4r.form.startDateCalendar"
4226
- })
4388
+ "aria-label": startCalendarAriaLabel
4227
4389
  },
4228
4390
  ...startProps == null ? void 0 : startProps.slotProps
4229
4391
  },
@@ -4258,9 +4420,7 @@ function DateRangePicker({
4258
4420
  minDate: startDate ?? void 0,
4259
4421
  slotProps: {
4260
4422
  popper: {
4261
- "aria-label": intlConfig.formatMessage({
4262
- id: "c4r.form.endDateCalendar"
4263
- })
4423
+ "aria-label": endCalendarAriaLabel
4264
4424
  },
4265
4425
  ...endProps == null ? void 0 : endProps.slotProps
4266
4426
  },
@@ -4276,7 +4436,7 @@ function DateRangePicker({
4276
4436
  ),
4277
4437
  ...endProps == null ? void 0 : endProps.slots
4278
4438
  },
4279
- label: (endProps == null ? void 0 : endProps.label) ?? intlConfig.formatMessage({ id: "c4r.form.endDate" }),
4439
+ label: (endProps == null ? void 0 : endProps.label) ?? _endDateLabel,
4280
4440
  error: (endProps == null ? void 0 : endProps.error) ?? error,
4281
4441
  open: isEndDateOpen,
4282
4442
  onOpen: handleEndDateOpen,
@@ -4336,12 +4496,16 @@ function TimePicker({
4336
4496
  ampm = true,
4337
4497
  views = ["hours", "minutes"],
4338
4498
  format,
4499
+ openPickerAriaLabel,
4339
4500
  "data-testid": dataTestId,
4340
4501
  "aria-label": ariaLabel,
4341
4502
  ...props
4342
4503
  }) {
4343
- const intl = reactIntl.useIntl();
4344
- const intlConfig = cssUtils.useImperativeIntl(intl);
4504
+ const fieldLabel = cssUtils.useTranslationWithFallback("c4r.form.time", label);
4505
+ const chooseDateAriaLabel = cssUtils.useTranslationWithFallback(
4506
+ "c4r.form.chooseDate",
4507
+ openPickerAriaLabel
4508
+ );
4345
4509
  const inputRef = React.useRef(null);
4346
4510
  const [inputWidth, setInputWidth] = React.useState(0);
4347
4511
  React.useEffect(() => {
@@ -4375,7 +4539,7 @@ function TimePicker({
4375
4539
  label: /* @__PURE__ */ jsxRuntime.jsx(
4376
4540
  LabelWithIndicator,
4377
4541
  {
4378
- label: label ?? intlConfig.formatMessage({ id: "c4r.form.time" }),
4542
+ label: fieldLabel,
4379
4543
  type,
4380
4544
  icon: labelHelpTooltip && /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.HelpOutline, { htmlColor: "text.secondary" }) })
4381
4545
  }
@@ -4415,9 +4579,7 @@ function TimePicker({
4415
4579
  {
4416
4580
  ...props2,
4417
4581
  size,
4418
- "aria-label": intlConfig.formatMessage({
4419
- id: "c4r.form.chooseDate"
4420
- })
4582
+ "aria-label": chooseDateAriaLabel
4421
4583
  }
4422
4584
  ),
4423
4585
  ...slots
@@ -4447,12 +4609,16 @@ function DateTimePicker({
4447
4609
  ampm = true,
4448
4610
  views = ["hours", "minutes"],
4449
4611
  format,
4612
+ openPickerAriaLabel,
4450
4613
  "data-testid": dataTestId,
4451
4614
  "aria-label": ariaLabel,
4452
4615
  ...props
4453
4616
  }) {
4454
- const intl = reactIntl.useIntl();
4455
- const intlConfig = cssUtils.useImperativeIntl(intl);
4617
+ const fieldLabel = cssUtils.useTranslationWithFallback("c4r.form.time", label);
4618
+ const chooseDateAriaLabel = cssUtils.useTranslationWithFallback(
4619
+ "c4r.form.chooseDate",
4620
+ openPickerAriaLabel
4621
+ );
4456
4622
  return /* @__PURE__ */ jsxRuntime.jsx(
4457
4623
  DateFieldContainer,
4458
4624
  {
@@ -4469,7 +4635,7 @@ function DateTimePicker({
4469
4635
  label: /* @__PURE__ */ jsxRuntime.jsx(
4470
4636
  LabelWithIndicator,
4471
4637
  {
4472
- label: label ?? intlConfig.formatMessage({ id: "c4r.form.time" }),
4638
+ label: fieldLabel,
4473
4639
  type,
4474
4640
  icon: labelHelpTooltip && /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.HelpOutline, { htmlColor: "text.secondary" }) })
4475
4641
  }
@@ -4501,9 +4667,7 @@ function DateTimePicker({
4501
4667
  {
4502
4668
  ...props2,
4503
4669
  size,
4504
- "aria-label": intlConfig.formatMessage({
4505
- id: "c4r.form.chooseDate"
4506
- })
4670
+ "aria-label": chooseDateAriaLabel
4507
4671
  }
4508
4672
  ),
4509
4673
  ...slots
@@ -4616,37 +4780,6 @@ function _AccordionGroup({
4616
4780
  );
4617
4781
  }
4618
4782
  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
4783
  function _Avatar({
4651
4784
  size,
4652
4785
  disabled,
@@ -4655,7 +4788,7 @@ function _Avatar({
4655
4788
  ...otherProps
4656
4789
  }, ref) {
4657
4790
  return /* @__PURE__ */ jsxRuntime.jsx(
4658
- StyledAvatar,
4791
+ material.Avatar,
4659
4792
  {
4660
4793
  ...otherProps,
4661
4794
  ref,
@@ -4852,6 +4985,9 @@ function _FilterDropdown({
4852
4985
  responsive,
4853
4986
  tooltipLabel,
4854
4987
  tooltipPlacement,
4988
+ tooltipProps,
4989
+ buttonProps,
4990
+ iconButtonProps,
4855
4991
  slotProps,
4856
4992
  MenuListProps,
4857
4993
  ...props
@@ -4889,14 +5025,30 @@ function _FilterDropdown({
4889
5025
  "data-color": buttonColor
4890
5026
  };
4891
5027
  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,
5028
+ /* @__PURE__ */ jsxRuntime.jsx(
5029
+ material.Tooltip,
4894
5030
  {
4895
- ...commonButtonProps,
4896
- endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
4897
- children: menuLabel
5031
+ title: tooltipLabel,
5032
+ placement: tooltipPlacement,
5033
+ ...tooltipProps,
5034
+ children: /* @__PURE__ */ jsxRuntime.jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsxRuntime.jsx(
5035
+ cssUtils.IconButton,
5036
+ {
5037
+ ...commonButtonProps,
5038
+ icon,
5039
+ ...iconButtonProps
5040
+ }
5041
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
5042
+ Button,
5043
+ {
5044
+ ...commonButtonProps,
5045
+ endIcon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(OpenDiagonallyRight.ArrowUp, {}) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
5046
+ ...buttonProps,
5047
+ children: menuLabel
5048
+ }
5049
+ ) })
4898
5050
  }
4899
- ) }) }),
5051
+ ),
4900
5052
  /* @__PURE__ */ jsxRuntime.jsxs(
4901
5053
  Menu,
4902
5054
  {
@@ -4946,6 +5098,294 @@ function _FilterDropdown({
4946
5098
  const FilterDropdown = React.forwardRef(
4947
5099
  _FilterDropdown
4948
5100
  );
5101
+ const SearchIcon = material.styled(Search.Search, {
5102
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
5103
+ })(
5104
+ ({ theme, minimized, disabled }) => ({
5105
+ cursor: !disabled && minimized ? "pointer" : "inherit",
5106
+ width: cssUtils.ICON_SIZE_MEDIUM,
5107
+ height: cssUtils.ICON_SIZE_MEDIUM,
5108
+ path: {
5109
+ fillOpacity: 1,
5110
+ fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
5111
+ }
5112
+ })
5113
+ );
5114
+ const ClearSearchIcon = material.styled(iconsMaterial.Cancel)(({ theme }) => ({
5115
+ color: `${theme.palette.text.hint} !important`
5116
+ }));
5117
+ const LoadingSearchIcon = material.styled(material.CircularProgress)(({ theme }) => ({
5118
+ svg: {
5119
+ color: `${theme.palette.primary.main} !important`
5120
+ }
5121
+ }));
5122
+ const SearchInputAdornment = material.styled(material.InputAdornment, {
5123
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
5124
+ })(
5125
+ ({ theme, minimized, expanded }) => ({
5126
+ // Start adornment
5127
+ transition: theme.transitions.create(["width", "margin"], {
5128
+ easing: theme.transitions.easing.easeInOut,
5129
+ duration: theme.transitions.duration.short
5130
+ }),
5131
+ "&.MuiInputAdornment-positionStart": {
5132
+ marginLeft: minimized ? theme.spacing(2) : void 0,
5133
+ "&.MuiInputAdornment-sizeSmall": {
5134
+ marginLeft: minimized ? theme.spacing(1) : void 0
5135
+ }
5136
+ },
5137
+ // End adornment
5138
+ "&.MuiInputAdornment-positionEnd": {
5139
+ minWidth: theme.spacing(4),
5140
+ "&.MuiInputAdornment-sizeSmall": {
5141
+ minWidth: theme.spacing(3)
5142
+ }
5143
+ },
5144
+ ...expanded && !minimized && {
5145
+ "&.MuiInputAdornment-root": {
5146
+ minWidth: theme.spacing(9),
5147
+ "&.MuiInputAdornment-sizeSmall": {
5148
+ minWidth: theme.spacing(7)
5149
+ }
5150
+ }
5151
+ }
5152
+ })
5153
+ );
5154
+ const SearchFieldBase = material.styled(material.TextField, {
5155
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused" && prop !== "emphasis"
5156
+ })(({ theme, emphasis = "filled", minimized, isInputFocused }) => ({
5157
+ "&.MuiTextField-root .MuiInputBase-root": {
5158
+ paddingRight: theme.spacing(1),
5159
+ transition: theme.transitions.create(["width", "padding"], {
5160
+ easing: theme.transitions.easing.easeInOut,
5161
+ duration: theme.transitions.duration.standard
5162
+ }),
5163
+ "&.MuiInputBase-sizeSmall": {
5164
+ paddingRight: theme.spacing(0.5)
5165
+ },
5166
+ "&:before": {
5167
+ border: "none !important",
5168
+ "&:hover": {
5169
+ border: "none !important"
5170
+ }
5171
+ },
5172
+ // Input
5173
+ "& .MuiInputBase-input": {
5174
+ pointerEvents: isInputFocused ? "auto" : "none",
5175
+ // Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
5176
+ transition: theme.transitions.create("width", {
5177
+ easing: theme.transitions.easing.easeInOut,
5178
+ duration: theme.transitions.duration.standard
5179
+ })
5180
+ },
5181
+ // Error state
5182
+ "&.Mui-error": {
5183
+ "&::after": {
5184
+ borderColor: "transparent !important"
5185
+ }
5186
+ },
5187
+ ...minimized && {
5188
+ display: "flex",
5189
+ alignItems: "center",
5190
+ padding: 0,
5191
+ width: theme.spacing(6),
5192
+ cursor: "pointer",
5193
+ "& .MuiInputBase-input": {
5194
+ width: 0
5195
+ },
5196
+ "&.MuiInputBase-sizeSmall": {
5197
+ padding: 0,
5198
+ width: theme.spacing(4)
5199
+ }
5200
+ }
5201
+ },
5202
+ // Variants
5203
+ ...emphasis === "filled" && {
5204
+ "& .MuiInputBase-root": {
5205
+ backgroundColor: minimized ? "transparent !important" : void 0,
5206
+ "&:hover": {
5207
+ backgroundColor: `${theme.palette.action.hover} !important`
5208
+ },
5209
+ // not disabled
5210
+ "&:not(.Mui-disabled):hover": {
5211
+ backgroundColor: `${theme.palette.action.hover} !important`
5212
+ }
5213
+ }
5214
+ },
5215
+ ...emphasis === "transparent" && {
5216
+ "& .MuiInputBase-root": {
5217
+ backgroundColor: "transparent !important",
5218
+ "&:hover": {
5219
+ backgroundColor: minimized ? `${theme.palette.action.hover} !important` : "transparent !important"
5220
+ },
5221
+ "&.Mui-disabled": {
5222
+ backgroundColor: "transparent !important"
5223
+ }
5224
+ }
5225
+ },
5226
+ ...emphasis === "floating" && {
5227
+ "& .MuiInputBase-root": {
5228
+ backgroundColor: `${theme.palette.background.paper} !important`,
5229
+ boxShadow: theme.shadows[1],
5230
+ "&:hover": {
5231
+ backgroundColor: minimized ? `${theme.palette.action.hover} !important` : `${theme.palette.background.paper} !important`
5232
+ },
5233
+ "&.Mui-disabled": {
5234
+ backgroundColor: `${theme.palette.background.paper} !important`
5235
+ }
5236
+ }
5237
+ }
5238
+ }));
5239
+ const SearchFieldEndAdornment = ({
5240
+ disabled,
5241
+ showClearButton = true,
5242
+ loading,
5243
+ size,
5244
+ endAdornment,
5245
+ clearButton,
5246
+ clearButtonLabel,
5247
+ onClear
5248
+ }) => {
5249
+ if (!showClearButton && !endAdornment && !loading) {
5250
+ return null;
5251
+ }
5252
+ return /* @__PURE__ */ jsxRuntime.jsx(
5253
+ SearchInputAdornment,
5254
+ {
5255
+ position: "end",
5256
+ expanded: Boolean(endAdornment && showClearButton),
5257
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
5258
+ material.Stack,
5259
+ {
5260
+ direction: "row",
5261
+ spacing: 1,
5262
+ sx: {
5263
+ alignItems: "center"
5264
+ },
5265
+ children: [
5266
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSearchIcon, { size: cssUtils.ICON_SIZE_MEDIUM }) : showClearButton ? clearButton ?? /* @__PURE__ */ jsxRuntime.jsx(
5267
+ cssUtils.IconButton,
5268
+ {
5269
+ onClick: onClear,
5270
+ size,
5271
+ color: "default",
5272
+ disabled,
5273
+ tooltip: clearButtonLabel,
5274
+ "aria-label": clearButtonLabel,
5275
+ icon: /* @__PURE__ */ jsxRuntime.jsx(ClearSearchIcon, {})
5276
+ }
5277
+ ) : null,
5278
+ endAdornment
5279
+ ]
5280
+ }
5281
+ )
5282
+ }
5283
+ );
5284
+ };
5285
+ const SearchFieldStartAdornment = ({
5286
+ minimized,
5287
+ loading,
5288
+ startAdornment,
5289
+ disabled
5290
+ }) => {
5291
+ 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 }) });
5292
+ };
5293
+ function _SearchField({
5294
+ value,
5295
+ defaultValue,
5296
+ placeholder,
5297
+ disabled,
5298
+ minimized = false,
5299
+ loading = false,
5300
+ variant = "filled",
5301
+ size = "small",
5302
+ InputProps,
5303
+ inputProps,
5304
+ startAdornment,
5305
+ endAdornment,
5306
+ onFocus,
5307
+ onBlur,
5308
+ onChange,
5309
+ onClick,
5310
+ onResetSearch,
5311
+ showClearButton = true,
5312
+ clearButtonLabel,
5313
+ clearButton,
5314
+ ...otherProps
5315
+ }, ref) {
5316
+ const [isInputFocused, setIsInputFocused] = React.useState(false);
5317
+ const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
5318
+ const clearButtonLabelValue = cssUtils.useTranslationWithFallback(
5319
+ "c4r.button.clear",
5320
+ clearButtonLabel
5321
+ );
5322
+ const handleFocus = (event) => {
5323
+ setIsInputFocused(true);
5324
+ onFocus == null ? void 0 : onFocus(event);
5325
+ };
5326
+ const handleBlur = (event) => {
5327
+ setIsInputFocused(false);
5328
+ onBlur == null ? void 0 : onBlur(event);
5329
+ };
5330
+ const handleClear = () => {
5331
+ onResetSearch == null ? void 0 : onResetSearch();
5332
+ onChange == null ? void 0 : onChange({ target: { value: "" } });
5333
+ };
5334
+ return /* @__PURE__ */ jsxRuntime.jsx(
5335
+ SearchFieldBase,
5336
+ {
5337
+ defaultValue,
5338
+ value: minimized ? "" : value,
5339
+ placeholder: minimized ? "" : placeholder,
5340
+ onChange,
5341
+ onClick,
5342
+ variant: "filled",
5343
+ emphasis: variant,
5344
+ size,
5345
+ focused: false,
5346
+ isInputFocused,
5347
+ disabled,
5348
+ minimized,
5349
+ InputProps: {
5350
+ onFocus: handleFocus,
5351
+ onBlur: handleBlur,
5352
+ startAdornment: /* @__PURE__ */ jsxRuntime.jsx(
5353
+ SearchFieldStartAdornment,
5354
+ {
5355
+ minimized,
5356
+ loading,
5357
+ disabled,
5358
+ startAdornment
5359
+ }
5360
+ ),
5361
+ endAdornment: !minimized && /* @__PURE__ */ jsxRuntime.jsx(
5362
+ SearchFieldEndAdornment,
5363
+ {
5364
+ disabled,
5365
+ loading,
5366
+ showClearButton: clearButtonVisibility,
5367
+ clearButton,
5368
+ clearButtonLabel: clearButtonLabelValue,
5369
+ onClear: handleClear,
5370
+ size,
5371
+ endAdornment
5372
+ }
5373
+ ),
5374
+ ...InputProps
5375
+ },
5376
+ inputProps: {
5377
+ role: "searchbox",
5378
+ ...inputProps
5379
+ },
5380
+ role: "search",
5381
+ "data-variant": variant,
5382
+ "data-name": "search-field",
5383
+ ref,
5384
+ ...otherProps
5385
+ }
5386
+ );
5387
+ }
5388
+ const SearchField = React.forwardRef(_SearchField);
4949
5389
  const MAX_WIDTH = 480;
4950
5390
  const SnackbarRoot = material.styled(material.Snackbar)(({ theme }) => ({
4951
5391
  bottom: theme.spacing(2),
@@ -5050,10 +5490,13 @@ function Snackbar({
5050
5490
  onClose = () => void 0,
5051
5491
  autoWidth,
5052
5492
  icon,
5493
+ closeTooltipText,
5053
5494
  ...rest
5054
5495
  }) {
5055
- const intl = reactIntl.useIntl();
5056
- const intlConfig = cssUtils.useImperativeIntl(intl);
5496
+ const closeTooltipLabel = cssUtils.useTranslationWithFallback(
5497
+ "c4r.button.close",
5498
+ closeTooltipText
5499
+ );
5057
5500
  const isNeutral = severity === "neutral";
5058
5501
  const disabledIcon = icon === false || isNeutral && !icon;
5059
5502
  const disabledAutoHide = autoHideDuration === null;
@@ -5094,9 +5537,7 @@ function Snackbar({
5094
5537
  color: "default",
5095
5538
  onClick: (e) => onClose(e, "timeout"),
5096
5539
  icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.CloseOutlined, {}),
5097
- tooltip: intlConfig.formatMessage({
5098
- id: "c4r.button.close"
5099
- })
5540
+ tooltip: closeTooltipLabel
5100
5541
  }
5101
5542
  ) })
5102
5543
  ]
@@ -5419,10 +5860,26 @@ function useFileUpload({
5419
5860
  files,
5420
5861
  multiple,
5421
5862
  placeholder,
5422
- uploadInputRef
5863
+ uploadInputRef,
5864
+ filesSelectedText,
5865
+ dragPlaceholderText,
5866
+ dragActivePlaceholderText
5423
5867
  }) {
5424
- const intl = reactIntl.useIntl();
5425
- const intlConfig = cssUtils.useImperativeIntl(intl);
5868
+ const filesSelectedLabel = cssUtils.useTranslationWithFallback(
5869
+ "c4r.form.filesSelected",
5870
+ filesSelectedText,
5871
+ { count: (files == null ? void 0 : files.length) ?? 0 }
5872
+ );
5873
+ const dragPlaceholderLabel = cssUtils.useTranslationWithFallback(
5874
+ "c4r.form.dragPlaceholder",
5875
+ dragPlaceholderText,
5876
+ { count: multiple ? 0 : 1 }
5877
+ );
5878
+ const dragActivePlaceholderLabel = cssUtils.useTranslationWithFallback(
5879
+ "c4r.form.dragActivePlaceholder",
5880
+ dragActivePlaceholderText,
5881
+ { count: multiple ? 0 : 1 }
5882
+ );
5426
5883
  const [filesText, setFilesText] = React.useState("");
5427
5884
  const [dragOver, setDragOver] = React.useState(false);
5428
5885
  React.useEffect(() => {
@@ -5431,14 +5888,9 @@ function useFileUpload({
5431
5888
  } else if (files.length === 1) {
5432
5889
  setFilesText(files[0].name);
5433
5890
  } else {
5434
- setFilesText(
5435
- intlConfig.formatMessage(
5436
- { id: "c4r.form.filesSelected" },
5437
- { count: files.length }
5438
- )
5439
- );
5891
+ setFilesText(filesSelectedLabel);
5440
5892
  }
5441
- }, [files, intlConfig]);
5893
+ }, [files, filesSelectedLabel]);
5442
5894
  const handleBrowse = () => {
5443
5895
  var _a;
5444
5896
  (_a = uploadInputRef.current) == null ? void 0 : _a.click();
@@ -5478,22 +5930,11 @@ function useFileUpload({
5478
5930
  onChange == null ? void 0 : onChange([]);
5479
5931
  };
5480
5932
  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
5933
  if (dragOver) {
5491
- placeholderText = dragPlaceholder;
5492
- } else {
5493
- placeholderText = placeholder ?? defaultPlaceholder;
5934
+ return dragActivePlaceholderLabel;
5494
5935
  }
5495
- return placeholderText;
5496
- }, [dragOver, multiple, placeholder, intlConfig]);
5936
+ return placeholder ?? dragPlaceholderLabel;
5937
+ }, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
5497
5938
  const inputEvents = {
5498
5939
  onDragOver: handleDragOver,
5499
5940
  onDragLeave: handleDragLeave,
@@ -5720,12 +6161,12 @@ function _EllipsisWithTooltip({
5720
6161
  );
5721
6162
  }
5722
6163
  const EllipsisWithTooltip = React.forwardRef(_EllipsisWithTooltip);
5723
- exports.Alert = Alert$1.Alert;
5724
- exports.Link = Alert$1.Link;
5725
- exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
5726
6164
  exports.IconButton = cssUtils.IconButton;
5727
6165
  exports.TablePaginationActions = cssUtils.TablePaginationActions;
5728
6166
  exports.Typography = cssUtils.Typography;
6167
+ exports.Alert = Alert$1.Alert;
6168
+ exports.Link = Alert$1.Link;
6169
+ exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
5729
6170
  exports.MenuItem = MenuItem.MenuItem;
5730
6171
  exports.AUTOCOMPLETE_GROUP_HEADER_PROPERTY = AUTOCOMPLETE_GROUP_HEADER_PROPERTY;
5731
6172
  exports.AccordionGroup = AccordionGroup;
@@ -5763,12 +6204,14 @@ exports.EllipsisWithTooltip = EllipsisWithTooltip;
5763
6204
  exports.FilterDropdown = FilterDropdown;
5764
6205
  exports.FilterDropdownMenuItem = FilterDropdownMenuItem;
5765
6206
  exports.LabelWithIndicator = LabelWithIndicator;
6207
+ exports.Loader = Loader;
5766
6208
  exports.Menu = Menu;
5767
6209
  exports.MenuItemFilter = MenuItemFilter;
5768
6210
  exports.MenuList = MenuList;
5769
6211
  exports.MultipleAutocomplete = MultipleAutocomplete;
5770
6212
  exports.MultipleSelectField = MultipleSelectField;
5771
6213
  exports.PasswordField = PasswordField;
6214
+ exports.SearchField = SearchField;
5772
6215
  exports.SelectField = SelectField;
5773
6216
  exports.Snackbar = Snackbar;
5774
6217
  exports.SplitButton = SplitButton;