@carto/meridian-ds 2.6.2-alpha.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +6 -3
  2. package/dist/{Alert-1A6BG2aO.js → Alert-BfDnWlbD.js} +1 -1
  3. package/dist/{Alert-eVzJvC47.cjs → Alert-CPvYAHO_.cjs} +1 -1
  4. package/dist/{MenuItem-DgHhHW-j.js → MenuItem-D90EfuGS.js} +12 -3
  5. package/dist/{MenuItem-6ZIV5V7a.cjs → MenuItem-ZSYcQBtg.cjs} +12 -3
  6. package/dist/{SwatchSquare-CaaLsjAC.js → Search-C7wkXu3f.js} +4 -23
  7. package/dist/{SwatchSquare-B8PIY3Rd.cjs → Search-CMWbM9nD.cjs} +3 -22
  8. package/dist/SwatchSquare-B6KYVoqV.js +24 -0
  9. package/dist/SwatchSquare-DuXPIL7t.cjs +23 -0
  10. package/dist/components/index.cjs +290 -3
  11. package/dist/components/index.js +293 -6
  12. package/dist/{css-utils-lmkjeCdF.js → css-utils-BHYA7By_.js} +3 -0
  13. package/dist/{css-utils-BNXxLCyb.cjs → css-utils-DjvM17Vb.cjs} +3 -0
  14. package/dist/custom-icons/index.cjs +3 -2
  15. package/dist/custom-icons/index.js +3 -2
  16. package/dist/theme/index.cjs +16 -4
  17. package/dist/theme/index.js +17 -5
  18. package/dist/types/components/Menu/Menu/Menu.stories.d.ts +16 -7
  19. package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
  20. package/dist/types/components/Menu/MenuItem/MenuItem.d.ts.map +1 -1
  21. package/dist/types/components/SearchField/SearchField.d.ts +4 -0
  22. package/dist/types/components/SearchField/SearchField.d.ts.map +1 -0
  23. package/dist/types/components/SearchField/SearchField.stories.d.ts +111 -0
  24. package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -0
  25. package/dist/types/components/SearchField/SearchField.styled.d.ts +23 -0
  26. package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -0
  27. package/dist/types/components/SearchField/SearchField.test.d.ts +2 -0
  28. package/dist/types/components/SearchField/SearchField.test.d.ts.map +1 -0
  29. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts +19 -0
  30. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts.map +1 -0
  31. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts +14 -0
  32. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts.map +1 -0
  33. package/dist/types/components/SearchField/index.d.ts +3 -0
  34. package/dist/types/components/SearchField/index.d.ts.map +1 -0
  35. package/dist/types/components/SearchField/types.d.ts +72 -0
  36. package/dist/types/components/SearchField/types.d.ts.map +1 -0
  37. package/dist/types/components/index.d.ts +2 -0
  38. package/dist/types/components/index.d.ts.map +1 -1
  39. package/dist/types/localization/en.d.ts +1 -0
  40. package/dist/types/localization/en.d.ts.map +1 -1
  41. package/dist/types/localization/es.d.ts +1 -0
  42. package/dist/types/localization/es.d.ts.map +1 -1
  43. package/dist/types/localization/id.d.ts +1 -0
  44. package/dist/types/localization/id.d.ts.map +1 -1
  45. package/dist/types/localization/index.d.ts +3 -0
  46. package/dist/types/localization/index.d.ts.map +1 -1
  47. package/dist/types/theme/carto-theme.d.ts.map +1 -1
  48. package/dist/types/theme/components/layout.d.ts +3 -0
  49. package/dist/types/theme/components/layout.d.ts.map +1 -0
  50. package/dist/types/theme/components/navigation.d.ts.map +1 -1
  51. package/dist/widgets/index.cjs +8 -7
  52. package/dist/widgets/index.js +4 -3
  53. package/package.json +2 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.0
6
+
7
+ ### 2.7.0
8
+
9
+ - New SearchField component [#308](https://github.com/CartoDB/meridian-ds/pull/308)
10
+ - Custom Icons: ApiAccessToken, ApiBaseUrl, AppCredentials, M2mOauthClient,SpaOauthClient, WorkflowApiEndpoint [#325](https://github.com/CartoDB/meridian-ds/pull/325)
5
11
  - Avatar: move size styles to the theme [#321](https://github.com/CartoDB/meridian-ds/pull/321)
6
12
  - Alert: move neutral styles to the theme [#320](https://github.com/CartoDB/meridian-ds/pull/320)
7
13
  - Handle empty buttonFooterLabelId in CodeAreaFooter [#323](https://github.com/CartoDB/meridian-ds/pull/323)
@@ -13,9 +19,6 @@
13
19
  - FilterDropdown: improve customization [#312](https://github.com/CartoDB/meridian-ds/pull/312)
14
20
  - CopiableComponent: improve customization [#311](https://github.com/CartoDB/meridian-ds/pull/311)
15
21
  - AppBar: disallow user selection of text [#324](https://github.com/CartoDB/meridian-ds/pull/324)
16
- - Custom Icons: ApiAccessToken, ApiBaseUrl, AppCredentials, M2mOauthClient,SpaOauthClient, WorkflowApiEndpoint [#325](https://github.com/CartoDB/meridian-ds/pull/325)
17
-
18
- ## 2.0
19
22
 
20
23
  ### 2.6.1
21
24
 
@@ -3,7 +3,7 @@ import { forwardRef, useState } from "react";
3
3
  import { styled, Link as Link$1, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
4
4
  import { OpenInNewOutlined } from "@mui/icons-material";
5
5
  import "cartocolor";
6
- import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, u as useTranslationWithFallback, T as Typography } from "./css-utils-lmkjeCdF.js";
6
+ import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, u as useTranslationWithFallback, T as Typography } from "./css-utils-BHYA7By_.js";
7
7
  const ScreenReaderOnly = styled("span")(() => ({
8
8
  position: "absolute",
9
9
  width: 1,
@@ -4,7 +4,7 @@ const React = require("react");
4
4
  const material = require("@mui/material");
5
5
  const iconsMaterial = require("@mui/icons-material");
6
6
  require("cartocolor");
7
- const cssUtils = require("./css-utils-BNXxLCyb.cjs");
7
+ const cssUtils = require("./css-utils-DjvM17Vb.cjs");
8
8
  const ScreenReaderOnly = material.styled("span")(() => ({
9
9
  position: "absolute",
10
10
  width: 1,
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { styled, MenuItem as MenuItem$1 } from "@mui/material";
4
- import { f as MENU_ITEM_SIZE_DENSE, h as MENU_ITEM_SIZE_EXTENDED } from "./css-utils-lmkjeCdF.js";
4
+ import { f as MENU_ITEM_SIZE_DENSE, h as MENU_ITEM_SIZE_EXTENDED } from "./css-utils-BHYA7By_.js";
5
5
  const StyledMenuItem = styled(MenuItem$1, {
6
6
  shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
7
7
  prop
@@ -108,10 +108,13 @@ const StyledMenuItem = styled(MenuItem$1, {
108
108
  zIndex: 2,
109
109
  minHeight: MENU_ITEM_SIZE_EXTENDED,
110
110
  marginBottom: theme.spacing(1),
111
- padding: theme.spacing(0.5, 1.5),
111
+ padding: theme.spacing(0.5, 0),
112
112
  backgroundColor: `${theme.palette.background.paper} !important`,
113
113
  borderBottom: `1px solid ${theme.palette.divider}`
114
114
  },
115
+ "&.MuiMenuItem-gutters": {
116
+ padding: theme.spacing(0.5, 1.5)
117
+ },
115
118
  ".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
116
119
  minHeight: MENU_ITEM_SIZE_EXTENDED,
117
120
  marginTop: 0,
@@ -128,6 +131,9 @@ const StyledMenuItem = styled(MenuItem$1, {
128
131
  ...dense && {
129
132
  "&.MuiButtonBase-root.MuiMenuItem-root": {
130
133
  minHeight: MENU_ITEM_SIZE_DENSE,
134
+ padding: theme.spacing(0.25, 0)
135
+ },
136
+ "&.MuiButtonBase-root.MuiMenuItem-gutters": {
131
137
  padding: theme.spacing(0.25, 1.5)
132
138
  }
133
139
  }
@@ -141,6 +147,7 @@ function _MenuItem({
141
147
  fixed,
142
148
  iconColor = "primary",
143
149
  dense,
150
+ disableGutters,
144
151
  ...props
145
152
  }, ref) {
146
153
  return /* @__PURE__ */ jsx(
@@ -156,11 +163,13 @@ function _MenuItem({
156
163
  dense,
157
164
  fixed,
158
165
  iconColor,
166
+ disableGutters,
159
167
  "data-destructive": destructive,
160
168
  "data-extended": extended,
161
169
  "data-dense": dense,
162
170
  "data-fixed": fixed,
163
- "data-icon-color": iconColor
171
+ "data-icon-color": iconColor,
172
+ "data-disable-gutters": disableGutters
164
173
  }
165
174
  );
166
175
  }
@@ -2,7 +2,7 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const React = require("react");
4
4
  const material = require("@mui/material");
5
- const cssUtils = require("./css-utils-BNXxLCyb.cjs");
5
+ const cssUtils = require("./css-utils-DjvM17Vb.cjs");
6
6
  const StyledMenuItem = material.styled(material.MenuItem, {
7
7
  shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
8
8
  prop
@@ -109,10 +109,13 @@ const StyledMenuItem = material.styled(material.MenuItem, {
109
109
  zIndex: 2,
110
110
  minHeight: cssUtils.MENU_ITEM_SIZE_EXTENDED,
111
111
  marginBottom: theme.spacing(1),
112
- padding: theme.spacing(0.5, 1.5),
112
+ padding: theme.spacing(0.5, 0),
113
113
  backgroundColor: `${theme.palette.background.paper} !important`,
114
114
  borderBottom: `1px solid ${theme.palette.divider}`
115
115
  },
116
+ "&.MuiMenuItem-gutters": {
117
+ padding: theme.spacing(0.5, 1.5)
118
+ },
116
119
  ".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
117
120
  minHeight: cssUtils.MENU_ITEM_SIZE_EXTENDED,
118
121
  marginTop: 0,
@@ -129,6 +132,9 @@ const StyledMenuItem = material.styled(material.MenuItem, {
129
132
  ...dense && {
130
133
  "&.MuiButtonBase-root.MuiMenuItem-root": {
131
134
  minHeight: cssUtils.MENU_ITEM_SIZE_DENSE,
135
+ padding: theme.spacing(0.25, 0)
136
+ },
137
+ "&.MuiButtonBase-root.MuiMenuItem-gutters": {
132
138
  padding: theme.spacing(0.25, 1.5)
133
139
  }
134
140
  }
@@ -142,6 +148,7 @@ function _MenuItem({
142
148
  fixed,
143
149
  iconColor = "primary",
144
150
  dense,
151
+ disableGutters,
145
152
  ...props
146
153
  }, ref) {
147
154
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -157,11 +164,13 @@ function _MenuItem({
157
164
  dense,
158
165
  fixed,
159
166
  iconColor,
167
+ disableGutters,
160
168
  "data-destructive": destructive,
161
169
  "data-extended": extended,
162
170
  "data-dense": dense,
163
171
  "data-fixed": fixed,
164
- "data-icon-color": iconColor
172
+ "data-icon-color": iconColor,
173
+ "data-disable-gutters": disableGutters
165
174
  }
166
175
  );
167
176
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { createSvgIcon } from "@mui/material";
4
- const Icon$1 = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
4
+ const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
5
5
  "path",
6
6
  {
7
7
  fill: "currentColor",
@@ -10,26 +10,8 @@ const Icon$1 = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000
10
10
  clipRule: "evenodd"
11
11
  }
12
12
  ) });
13
- const BaseSvgIcon$1 = createSvgIcon(Icon$1(), "Search");
13
+ const BaseSvgIcon = createSvgIcon(Icon(), "Search");
14
14
  function Search({ width, height, sx, ...props }, ref) {
15
- return /* @__PURE__ */ jsx(
16
- BaseSvgIcon$1,
17
- {
18
- ref,
19
- viewBox: "0 0 24 24",
20
- sx: {
21
- width,
22
- height: height || width,
23
- ...sx
24
- },
25
- ...props
26
- }
27
- );
28
- }
29
- const Search$1 = forwardRef(Search);
30
- const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
31
- const BaseSvgIcon = createSvgIcon(Icon(), "SwatchSquare");
32
- function SwatchSquare({ width, height, sx, ...props }, ref) {
33
15
  return /* @__PURE__ */ jsx(
34
16
  BaseSvgIcon,
35
17
  {
@@ -44,8 +26,7 @@ function SwatchSquare({ width, height, sx, ...props }, ref) {
44
26
  }
45
27
  );
46
28
  }
47
- const SwatchSquare$1 = forwardRef(SwatchSquare);
29
+ const Search$1 = forwardRef(Search);
48
30
  export {
49
- Search$1 as S,
50
- SwatchSquare$1 as a
31
+ Search$1 as S
51
32
  };
@@ -2,7 +2,7 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const React = require("react");
4
4
  const material = require("@mui/material");
5
- const Icon$1 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
5
+ const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
6
6
  "path",
7
7
  {
8
8
  fill: "currentColor",
@@ -11,26 +11,8 @@ const Icon$1 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.
11
11
  clipRule: "evenodd"
12
12
  }
13
13
  ) });
14
- const BaseSvgIcon$1 = material.createSvgIcon(Icon$1(), "Search");
14
+ const BaseSvgIcon = material.createSvgIcon(Icon(), "Search");
15
15
  function Search({ width, height, sx, ...props }, ref) {
16
- return /* @__PURE__ */ jsxRuntime.jsx(
17
- BaseSvgIcon$1,
18
- {
19
- ref,
20
- viewBox: "0 0 24 24",
21
- sx: {
22
- width,
23
- height: height || width,
24
- ...sx
25
- },
26
- ...props
27
- }
28
- );
29
- }
30
- const Search$1 = React.forwardRef(Search);
31
- const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
32
- const BaseSvgIcon = material.createSvgIcon(Icon(), "SwatchSquare");
33
- function SwatchSquare({ width, height, sx, ...props }, ref) {
34
16
  return /* @__PURE__ */ jsxRuntime.jsx(
35
17
  BaseSvgIcon,
36
18
  {
@@ -45,6 +27,5 @@ function SwatchSquare({ width, height, sx, ...props }, ref) {
45
27
  }
46
28
  );
47
29
  }
48
- const SwatchSquare$1 = React.forwardRef(SwatchSquare);
30
+ const Search$1 = React.forwardRef(Search);
49
31
  exports.Search = Search$1;
50
- exports.SwatchSquare = SwatchSquare$1;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { createSvgIcon } from "@mui/material";
4
+ const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
5
+ const BaseSvgIcon = createSvgIcon(Icon(), "SwatchSquare");
6
+ function SwatchSquare({ width, height, sx, ...props }, ref) {
7
+ return /* @__PURE__ */ jsx(
8
+ BaseSvgIcon,
9
+ {
10
+ ref,
11
+ viewBox: "0 0 24 24",
12
+ sx: {
13
+ width,
14
+ height: height || width,
15
+ ...sx
16
+ },
17
+ ...props
18
+ }
19
+ );
20
+ }
21
+ const SwatchSquare$1 = forwardRef(SwatchSquare);
22
+ export {
23
+ SwatchSquare$1 as S
24
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const material = require("@mui/material");
5
+ const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
6
+ const BaseSvgIcon = material.createSvgIcon(Icon(), "SwatchSquare");
7
+ function SwatchSquare({ width, height, sx, ...props }, ref) {
8
+ return /* @__PURE__ */ jsxRuntime.jsx(
9
+ BaseSvgIcon,
10
+ {
11
+ ref,
12
+ viewBox: "0 0 24 24",
13
+ sx: {
14
+ width,
15
+ height: height || width,
16
+ ...sx
17
+ },
18
+ ...props
19
+ }
20
+ );
21
+ }
22
+ const SwatchSquare$1 = React.forwardRef(SwatchSquare);
23
+ exports.SwatchSquare = SwatchSquare$1;
@@ -4,11 +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 cssUtils = require("../css-utils-BNXxLCyb.cjs");
8
- const Alert$1 = require("../Alert-eVzJvC47.cjs");
7
+ const cssUtils = require("../css-utils-DjvM17Vb.cjs");
8
+ const Alert$1 = require("../Alert-CPvYAHO_.cjs");
9
9
  const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
10
10
  const OpenDiagonallyRight = require("../OpenDiagonallyRight-CpL4ROwg.cjs");
11
- const MenuItem = require("../MenuItem-6ZIV5V7a.cjs");
11
+ const MenuItem = require("../MenuItem-ZSYcQBtg.cjs");
12
12
  require("cartocolor");
13
13
  const reactWindow = require("react-window");
14
14
  const reactCodemirror2 = require("react-codemirror2");
@@ -41,6 +41,7 @@ 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",
@@ -5039,6 +5040,291 @@ function _FilterDropdown({
5039
5040
  const FilterDropdown = React.forwardRef(
5040
5041
  _FilterDropdown
5041
5042
  );
5043
+ const SearchIcon = material.styled(Search.Search, {
5044
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
5045
+ })(
5046
+ ({ theme, minimized, disabled }) => ({
5047
+ cursor: !disabled && minimized ? "pointer" : "inherit",
5048
+ width: cssUtils.ICON_SIZE_MEDIUM,
5049
+ height: cssUtils.ICON_SIZE_MEDIUM,
5050
+ path: {
5051
+ fillOpacity: 1,
5052
+ fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
5053
+ }
5054
+ })
5055
+ );
5056
+ const ClearSearchIcon = material.styled(iconsMaterial.Cancel)(({ theme }) => ({
5057
+ color: `${theme.palette.text.hint} !important`
5058
+ }));
5059
+ const LoadingSearchIcon = material.styled(material.CircularProgress)(({ theme }) => ({
5060
+ svg: {
5061
+ color: `${theme.palette.primary.main} !important`
5062
+ }
5063
+ }));
5064
+ const SearchInputAdornment = material.styled(material.InputAdornment, {
5065
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
5066
+ })(
5067
+ ({ theme, minimized, expanded }) => ({
5068
+ // Start adornment
5069
+ transition: theme.transitions.create(["width", "margin"], {
5070
+ easing: theme.transitions.easing.easeInOut,
5071
+ duration: theme.transitions.duration.short
5072
+ }),
5073
+ "&.MuiInputAdornment-positionStart": {
5074
+ marginLeft: minimized ? theme.spacing(1) : void 0
5075
+ },
5076
+ // End adornment
5077
+ "&.MuiInputAdornment-positionEnd": {
5078
+ minWidth: theme.spacing(4),
5079
+ "&.MuiInputAdornment-sizeSmall": {
5080
+ minWidth: theme.spacing(3)
5081
+ }
5082
+ },
5083
+ ...expanded && !minimized && {
5084
+ "&.MuiInputAdornment-root": {
5085
+ minWidth: theme.spacing(9),
5086
+ "&.MuiInputAdornment-sizeSmall": {
5087
+ minWidth: theme.spacing(7)
5088
+ }
5089
+ }
5090
+ }
5091
+ })
5092
+ );
5093
+ const SearchFieldBase = material.styled(material.TextField, {
5094
+ shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused" && prop !== "emphasis"
5095
+ })(({ theme, emphasis = "filled", minimized, isInputFocused }) => ({
5096
+ "&.MuiTextField-root .MuiInputBase-root": {
5097
+ paddingRight: theme.spacing(1),
5098
+ transition: theme.transitions.create(["width", "padding"], {
5099
+ easing: theme.transitions.easing.easeInOut,
5100
+ duration: theme.transitions.duration.standard
5101
+ }),
5102
+ "&.MuiInputBase-sizeSmall": {
5103
+ paddingRight: theme.spacing(0.5)
5104
+ },
5105
+ "&:before": {
5106
+ border: "none !important",
5107
+ "&:hover": {
5108
+ border: "none !important"
5109
+ }
5110
+ },
5111
+ // Input
5112
+ "& .MuiInputBase-input": {
5113
+ pointerEvents: isInputFocused ? "auto" : "none",
5114
+ // Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
5115
+ transition: theme.transitions.create("width", {
5116
+ easing: theme.transitions.easing.easeInOut,
5117
+ duration: theme.transitions.duration.standard
5118
+ })
5119
+ },
5120
+ // Error state
5121
+ "&.Mui-error": {
5122
+ "&::after": {
5123
+ borderColor: "transparent !important"
5124
+ }
5125
+ },
5126
+ ...minimized && {
5127
+ display: "flex",
5128
+ alignItems: "center",
5129
+ padding: 0,
5130
+ width: theme.spacing(6),
5131
+ cursor: "pointer",
5132
+ "& .MuiInputBase-input": {
5133
+ width: 0
5134
+ },
5135
+ "&.MuiInputBase-sizeSmall": {
5136
+ padding: 0,
5137
+ width: theme.spacing(4)
5138
+ }
5139
+ }
5140
+ },
5141
+ // Variants
5142
+ ...emphasis === "filled" && {
5143
+ "& .MuiInputBase-root": {
5144
+ backgroundColor: minimized ? "transparent !important" : void 0,
5145
+ "&:hover": {
5146
+ backgroundColor: `${theme.palette.action.hover} !important`
5147
+ },
5148
+ // not disabled
5149
+ "&:not(.Mui-disabled):hover": {
5150
+ backgroundColor: `${theme.palette.action.hover} !important`
5151
+ }
5152
+ }
5153
+ },
5154
+ ...emphasis === "transparent" && {
5155
+ "& .MuiInputBase-root": {
5156
+ backgroundColor: "transparent !important",
5157
+ "&:hover": {
5158
+ backgroundColor: minimized ? `${theme.palette.action.hover} !important` : "transparent !important"
5159
+ },
5160
+ "&.Mui-disabled": {
5161
+ backgroundColor: "transparent !important"
5162
+ }
5163
+ }
5164
+ },
5165
+ ...emphasis === "floating" && {
5166
+ "& .MuiInputBase-root": {
5167
+ backgroundColor: `${theme.palette.background.paper} !important`,
5168
+ boxShadow: theme.shadows[1],
5169
+ "&:hover": {
5170
+ backgroundColor: minimized ? `${theme.palette.action.hover} !important` : `${theme.palette.background.paper} !important`
5171
+ },
5172
+ "&.Mui-disabled": {
5173
+ backgroundColor: `${theme.palette.background.paper} !important`
5174
+ }
5175
+ }
5176
+ }
5177
+ }));
5178
+ const SearchFieldEndAdornment = ({
5179
+ disabled,
5180
+ showClearButton = true,
5181
+ loading,
5182
+ size,
5183
+ endAdornment,
5184
+ clearButton,
5185
+ clearButtonLabel,
5186
+ onClear
5187
+ }) => {
5188
+ if (!showClearButton && !endAdornment && !loading) {
5189
+ return null;
5190
+ }
5191
+ return /* @__PURE__ */ jsxRuntime.jsx(
5192
+ SearchInputAdornment,
5193
+ {
5194
+ position: "end",
5195
+ expanded: Boolean(endAdornment && showClearButton),
5196
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
5197
+ material.Stack,
5198
+ {
5199
+ direction: "row",
5200
+ spacing: 1,
5201
+ sx: {
5202
+ alignItems: "center"
5203
+ },
5204
+ children: [
5205
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSearchIcon, { size: cssUtils.ICON_SIZE_MEDIUM }) : showClearButton ? clearButton ?? /* @__PURE__ */ jsxRuntime.jsx(
5206
+ cssUtils.IconButton,
5207
+ {
5208
+ onClick: onClear,
5209
+ size,
5210
+ color: "default",
5211
+ disabled,
5212
+ tooltip: clearButtonLabel,
5213
+ "aria-label": clearButtonLabel,
5214
+ icon: /* @__PURE__ */ jsxRuntime.jsx(ClearSearchIcon, {})
5215
+ }
5216
+ ) : null,
5217
+ endAdornment
5218
+ ]
5219
+ }
5220
+ )
5221
+ }
5222
+ );
5223
+ };
5224
+ const SearchFieldStartAdornment = ({
5225
+ minimized,
5226
+ loading,
5227
+ startAdornment,
5228
+ disabled
5229
+ }) => {
5230
+ return /* @__PURE__ */ 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 }) });
5231
+ };
5232
+ function _SearchField({
5233
+ value,
5234
+ defaultValue,
5235
+ placeholder,
5236
+ disabled,
5237
+ minimized = false,
5238
+ loading = false,
5239
+ variant = "filled",
5240
+ size = "small",
5241
+ InputProps,
5242
+ inputProps,
5243
+ startAdornment,
5244
+ endAdornment,
5245
+ onFocus,
5246
+ onBlur,
5247
+ onChange,
5248
+ onClick,
5249
+ onResetSearch,
5250
+ showClearButton = true,
5251
+ clearButtonLabel,
5252
+ clearButton,
5253
+ ...otherProps
5254
+ }, ref) {
5255
+ const [isInputFocused, setIsInputFocused] = React.useState(false);
5256
+ const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
5257
+ const clearButtonLabelValue = cssUtils.useTranslationWithFallback(
5258
+ "c4r.button.clear",
5259
+ clearButtonLabel
5260
+ );
5261
+ const handleFocus = (event) => {
5262
+ setIsInputFocused(true);
5263
+ onFocus == null ? void 0 : onFocus(event);
5264
+ };
5265
+ const handleBlur = (event) => {
5266
+ setIsInputFocused(false);
5267
+ onBlur == null ? void 0 : onBlur(event);
5268
+ };
5269
+ const handleClear = () => {
5270
+ onResetSearch == null ? void 0 : onResetSearch();
5271
+ onChange == null ? void 0 : onChange({ target: { value: "" } });
5272
+ };
5273
+ return /* @__PURE__ */ jsxRuntime.jsx(
5274
+ SearchFieldBase,
5275
+ {
5276
+ defaultValue,
5277
+ value: minimized ? "" : value,
5278
+ placeholder: minimized ? "" : placeholder,
5279
+ onChange,
5280
+ onClick,
5281
+ variant: "filled",
5282
+ emphasis: variant,
5283
+ size,
5284
+ focused: false,
5285
+ isInputFocused,
5286
+ disabled,
5287
+ minimized,
5288
+ InputProps: {
5289
+ onFocus: handleFocus,
5290
+ onBlur: handleBlur,
5291
+ startAdornment: /* @__PURE__ */ jsxRuntime.jsx(
5292
+ SearchFieldStartAdornment,
5293
+ {
5294
+ minimized,
5295
+ loading,
5296
+ disabled,
5297
+ startAdornment
5298
+ }
5299
+ ),
5300
+ endAdornment: !minimized && /* @__PURE__ */ jsxRuntime.jsx(
5301
+ SearchFieldEndAdornment,
5302
+ {
5303
+ disabled,
5304
+ loading,
5305
+ showClearButton: clearButtonVisibility,
5306
+ clearButton,
5307
+ clearButtonLabel: clearButtonLabelValue,
5308
+ onClear: handleClear,
5309
+ size,
5310
+ endAdornment
5311
+ }
5312
+ ),
5313
+ ...InputProps
5314
+ },
5315
+ inputProps: {
5316
+ role: "searchbox",
5317
+ ...inputProps
5318
+ },
5319
+ role: "search",
5320
+ "data-variant": variant,
5321
+ "data-name": "search-field",
5322
+ ref,
5323
+ ...otherProps
5324
+ }
5325
+ );
5326
+ }
5327
+ const SearchField = React.forwardRef(_SearchField);
5042
5328
  const MAX_WIDTH = 480;
5043
5329
  const SnackbarRoot = material.styled(material.Snackbar)(({ theme }) => ({
5044
5330
  bottom: theme.spacing(2),
@@ -5863,6 +6149,7 @@ exports.MenuList = MenuList;
5863
6149
  exports.MultipleAutocomplete = MultipleAutocomplete;
5864
6150
  exports.MultipleSelectField = MultipleSelectField;
5865
6151
  exports.PasswordField = PasswordField;
6152
+ exports.SearchField = SearchField;
5866
6153
  exports.SelectField = SelectField;
5867
6154
  exports.Snackbar = Snackbar;
5868
6155
  exports.SplitButton = SplitButton;