@carto/meridian-ds 2.6.1-alpha-searchfield.6 → 2.6.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/{Alert-BfDnWlbD.js → Alert-1A6BG2aO.js} +1 -1
  3. package/dist/{Alert-CPvYAHO_.cjs → Alert-eVzJvC47.cjs} +1 -1
  4. package/dist/{MenuItem-BPvH70wa.cjs → MenuItem-6ZIV5V7a.cjs} +1 -1
  5. package/dist/{MenuItem-GpTpLidu.js → MenuItem-DgHhHW-j.js} +1 -1
  6. package/dist/{Search-CMWbM9nD.cjs → SwatchSquare-B8PIY3Rd.cjs} +22 -3
  7. package/dist/{Search-C7wkXu3f.js → SwatchSquare-CaaLsjAC.js} +23 -4
  8. package/dist/components/index.cjs +3 -278
  9. package/dist/components/index.js +6 -281
  10. package/dist/{css-utils-DjvM17Vb.cjs → css-utils-BNXxLCyb.cjs} +0 -3
  11. package/dist/{css-utils-BHYA7By_.js → css-utils-lmkjeCdF.js} +0 -3
  12. package/dist/custom-icons/index.cjs +773 -612
  13. package/dist/custom-icons/index.js +773 -612
  14. package/dist/theme/index.cjs +3 -12
  15. package/dist/theme/index.js +4 -13
  16. package/dist/types/components/index.d.ts +0 -2
  17. package/dist/types/components/index.d.ts.map +1 -1
  18. package/dist/types/custom-icons/ApiAccessToken.d.ts +4 -0
  19. package/dist/types/custom-icons/ApiAccessToken.d.ts.map +1 -0
  20. package/dist/types/custom-icons/ApiBaseUrl.d.ts +4 -0
  21. package/dist/types/custom-icons/ApiBaseUrl.d.ts.map +1 -0
  22. package/dist/types/custom-icons/AppCredentials.d.ts +4 -0
  23. package/dist/types/custom-icons/AppCredentials.d.ts.map +1 -0
  24. package/dist/types/custom-icons/M2mOauthClient.d.ts +4 -0
  25. package/dist/types/custom-icons/M2mOauthClient.d.ts.map +1 -0
  26. package/dist/types/custom-icons/SpaOauthClient.d.ts +4 -0
  27. package/dist/types/custom-icons/SpaOauthClient.d.ts.map +1 -0
  28. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts +4 -0
  29. package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts.map +1 -0
  30. package/dist/types/custom-icons/index.d.ts +6 -0
  31. package/dist/types/custom-icons/index.d.ts.map +1 -1
  32. package/dist/types/localization/en.d.ts +0 -1
  33. package/dist/types/localization/en.d.ts.map +1 -1
  34. package/dist/types/localization/es.d.ts +0 -1
  35. package/dist/types/localization/es.d.ts.map +1 -1
  36. package/dist/types/localization/id.d.ts +0 -1
  37. package/dist/types/localization/id.d.ts.map +1 -1
  38. package/dist/types/localization/index.d.ts +0 -3
  39. package/dist/types/localization/index.d.ts.map +1 -1
  40. package/dist/types/theme/carto-theme.d.ts.map +1 -1
  41. package/dist/widgets/index.cjs +7 -8
  42. package/dist/widgets/index.js +3 -4
  43. package/package.json +3 -2
  44. package/dist/SwatchSquare-B6KYVoqV.js +0 -24
  45. package/dist/SwatchSquare-DuXPIL7t.cjs +0 -23
  46. package/dist/types/components/SearchField/SearchField.d.ts +0 -4
  47. package/dist/types/components/SearchField/SearchField.d.ts.map +0 -1
  48. package/dist/types/components/SearchField/SearchField.stories.d.ts +0 -111
  49. package/dist/types/components/SearchField/SearchField.stories.d.ts.map +0 -1
  50. package/dist/types/components/SearchField/SearchField.styled.d.ts +0 -23
  51. package/dist/types/components/SearchField/SearchField.styled.d.ts.map +0 -1
  52. package/dist/types/components/SearchField/SearchField.test.d.ts +0 -2
  53. package/dist/types/components/SearchField/SearchField.test.d.ts.map +0 -1
  54. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts +0 -19
  55. package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts.map +0 -1
  56. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts +0 -14
  57. package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts.map +0 -1
  58. package/dist/types/components/SearchField/index.d.ts +0 -3
  59. package/dist/types/components/SearchField/index.d.ts.map +0 -1
  60. package/dist/types/components/SearchField/types.d.ts +0 -72
  61. package/dist/types/components/SearchField/types.d.ts.map +0 -1
  62. package/dist/types/theme/components/layout.d.ts +0 -3
  63. package/dist/types/theme/components/layout.d.ts.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle } from "react";
3
- import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Stack, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
3
+ import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
4
4
  import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, Check, TodayOutlined } from "@mui/icons-material";
5
- import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, i as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, h as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, j as useImperativeIntl, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-BHYA7By_.js";
6
- import { a } from "../css-utils-BHYA7By_.js";
7
- import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-BfDnWlbD.js";
8
- import { L } from "../Alert-BfDnWlbD.js";
5
+ import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, i as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, h as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, j as useImperativeIntl, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-lmkjeCdF.js";
6
+ import { a } from "../css-utils-lmkjeCdF.js";
7
+ import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-1A6BG2aO.js";
8
+ import { L } from "../Alert-1A6BG2aO.js";
9
9
  import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
10
10
  import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
11
- import { M as MenuItem$1 } from "../MenuItem-GpTpLidu.js";
11
+ import { M as MenuItem$1 } from "../MenuItem-DgHhHW-j.js";
12
12
  import "cartocolor";
13
13
  import { FixedSizeList } from "react-window";
14
14
  import { Controlled, UnControlled } from "react-codemirror2";
@@ -41,7 +41,6 @@ import { useIntl } from "react-intl";
41
41
  import { PickersDay as PickersDay$1 } from "@mui/x-date-pickers";
42
42
  import { TimePicker as TimePicker$1 } from "@mui/x-date-pickers/TimePicker";
43
43
  import { DateTimePicker as DateTimePicker$1 } from "@mui/x-date-pickers/DateTimePicker";
44
- import { S as Search } from "../Search-C7wkXu3f.js";
45
44
  import DOMPurify from "dompurify";
46
45
  const IndicatorIcon = styled(Box)({
47
46
  position: "absolute",
@@ -5040,279 +5039,6 @@ function _FilterDropdown({
5040
5039
  const FilterDropdown = forwardRef(
5041
5040
  _FilterDropdown
5042
5041
  );
5043
- const SearchIcon = styled(Search, {
5044
- shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
5045
- })(
5046
- ({ theme, minimized, disabled }) => ({
5047
- cursor: !disabled && minimized ? "pointer" : "inherit",
5048
- width: ICON_SIZE_MEDIUM,
5049
- height: ICON_SIZE_MEDIUM,
5050
- path: {
5051
- fillOpacity: 1,
5052
- fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
5053
- }
5054
- })
5055
- );
5056
- const ClearSearchIcon = styled(Cancel)(({ theme }) => ({
5057
- color: `${theme.palette.text.hint} !important`
5058
- }));
5059
- const LoadingSearchIcon = styled(CircularProgress)(({ theme }) => ({
5060
- svg: {
5061
- color: `${theme.palette.primary.main} !important`
5062
- }
5063
- }));
5064
- const SearchInputAdornment = styled(InputAdornment, {
5065
- shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
5066
- })(
5067
- ({ theme, minimized, expanded }) => ({
5068
- // Start adornment
5069
- "&.MuiInputAdornment-positionStart": {
5070
- marginLeft: minimized ? theme.spacing(1) : void 0
5071
- },
5072
- // End adornment
5073
- "&.MuiInputAdornment-positionEnd": {
5074
- minWidth: theme.spacing(4),
5075
- "&.MuiInputAdornment-sizeSmall": {
5076
- minWidth: theme.spacing(3)
5077
- }
5078
- },
5079
- ...expanded && !minimized && {
5080
- "&.MuiInputAdornment-root": {
5081
- minWidth: theme.spacing(9),
5082
- "&.MuiInputAdornment-sizeSmall": {
5083
- minWidth: theme.spacing(7)
5084
- }
5085
- }
5086
- }
5087
- })
5088
- );
5089
- const SearchFieldBase = styled(TextField, {
5090
- shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused" && prop !== "emphasis"
5091
- })(({ theme, emphasis = "filled", minimized, isInputFocused }) => ({
5092
- "&.MuiTextField-root .MuiInputBase-root": {
5093
- paddingRight: theme.spacing(1),
5094
- transition: theme.transitions.create("width", {
5095
- easing: theme.transitions.easing.easeInOut,
5096
- duration: theme.transitions.duration.shortest
5097
- }),
5098
- "&.MuiInputBase-sizeSmall": {
5099
- paddingRight: theme.spacing(0.5)
5100
- },
5101
- "&:before": {
5102
- border: "none !important",
5103
- "&:hover": {
5104
- border: "none !important"
5105
- }
5106
- },
5107
- // Input
5108
- "& .MuiInputBase-input": {
5109
- pointerEvents: isInputFocused ? "auto" : "none"
5110
- // Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
5111
- },
5112
- // Error state
5113
- "&.Mui-error": {
5114
- "&::after": {
5115
- borderColor: "transparent !important"
5116
- }
5117
- },
5118
- ...minimized && {
5119
- display: "flex",
5120
- alignItems: "center",
5121
- justifyContent: "center",
5122
- padding: 0,
5123
- width: theme.spacing(6),
5124
- cursor: "pointer",
5125
- "& .MuiInputBase-input": {
5126
- display: "none"
5127
- },
5128
- "&.MuiInputBase-sizeSmall": {
5129
- width: theme.spacing(4)
5130
- }
5131
- }
5132
- },
5133
- // Variants
5134
- ...emphasis === "filled" && {
5135
- "& .MuiInputBase-root": {
5136
- // not disabled
5137
- "&:not(.Mui-disabled):hover": {
5138
- backgroundColor: `${theme.palette.action.hover} !important`
5139
- }
5140
- }
5141
- },
5142
- ...emphasis === "transparent" && {
5143
- "& .MuiInputBase-root": {
5144
- backgroundColor: "transparent !important",
5145
- "&:hover": {
5146
- backgroundColor: minimized ? `${theme.palette.action.hover} !important` : "transparent !important"
5147
- },
5148
- "&.Mui-disabled": {
5149
- backgroundColor: "transparent !important"
5150
- }
5151
- }
5152
- },
5153
- ...emphasis === "floating" && {
5154
- "& .MuiInputBase-root": {
5155
- backgroundColor: `${theme.palette.background.paper} !important`,
5156
- boxShadow: theme.shadows[1],
5157
- "&:hover": {
5158
- backgroundColor: minimized ? `${theme.palette.action.hover} !important` : `${theme.palette.background.paper} !important`
5159
- },
5160
- "&.Mui-disabled": {
5161
- backgroundColor: `${theme.palette.background.paper} !important`
5162
- }
5163
- }
5164
- }
5165
- }));
5166
- const SearchFieldEndAdornment = ({
5167
- disabled,
5168
- showClearButton = true,
5169
- loading,
5170
- size,
5171
- endAdornment,
5172
- clearButton,
5173
- clearButtonLabel,
5174
- onClear
5175
- }) => {
5176
- if (!showClearButton && !endAdornment && !loading) {
5177
- return null;
5178
- }
5179
- return /* @__PURE__ */ jsx(
5180
- SearchInputAdornment,
5181
- {
5182
- position: "end",
5183
- expanded: Boolean(endAdornment && showClearButton),
5184
- children: /* @__PURE__ */ jsxs(
5185
- Stack,
5186
- {
5187
- direction: "row",
5188
- spacing: 1,
5189
- sx: {
5190
- alignItems: "center"
5191
- },
5192
- children: [
5193
- loading ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : showClearButton ? clearButton ?? /* @__PURE__ */ jsx(
5194
- IconButton,
5195
- {
5196
- onClick: onClear,
5197
- size,
5198
- color: "default",
5199
- disabled,
5200
- tooltip: clearButtonLabel,
5201
- "aria-label": clearButtonLabel,
5202
- icon: /* @__PURE__ */ jsx(ClearSearchIcon, {})
5203
- }
5204
- ) : null,
5205
- endAdornment
5206
- ]
5207
- }
5208
- )
5209
- }
5210
- );
5211
- };
5212
- const SearchFieldStartAdornment = ({
5213
- minimized,
5214
- loading,
5215
- startAdornment,
5216
- disabled
5217
- }) => {
5218
- return /* @__PURE__ */ jsx(SearchInputAdornment, { position: "start", minimized, children: loading && minimized ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : startAdornment || /* @__PURE__ */ jsx(SearchIcon, { disabled, minimized }) });
5219
- };
5220
- function _SearchField({
5221
- value,
5222
- defaultValue,
5223
- placeholder,
5224
- disabled,
5225
- minimized = false,
5226
- loading = false,
5227
- variant = "filled",
5228
- size = "small",
5229
- InputProps,
5230
- inputProps,
5231
- startAdornment,
5232
- endAdornment,
5233
- onFocus,
5234
- onBlur,
5235
- onChange,
5236
- onClick,
5237
- onResetSearch,
5238
- showClearButton = true,
5239
- clearButtonLabel,
5240
- clearButton,
5241
- ...otherProps
5242
- }, ref) {
5243
- const [isInputFocused, setIsInputFocused] = useState(false);
5244
- const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
5245
- const clearButtonLabelValue = useTranslationWithFallback(
5246
- "c4r.button.clear",
5247
- clearButtonLabel
5248
- );
5249
- const handleFocus = (event) => {
5250
- setIsInputFocused(true);
5251
- onFocus == null ? void 0 : onFocus(event);
5252
- };
5253
- const handleBlur = (event) => {
5254
- setIsInputFocused(false);
5255
- onBlur == null ? void 0 : onBlur(event);
5256
- };
5257
- const handleClear = () => {
5258
- onResetSearch == null ? void 0 : onResetSearch();
5259
- onChange == null ? void 0 : onChange({ target: { value: "" } });
5260
- };
5261
- return /* @__PURE__ */ jsx(
5262
- SearchFieldBase,
5263
- {
5264
- value: minimized ? "" : value,
5265
- defaultValue,
5266
- placeholder: minimized ? "" : placeholder,
5267
- onChange,
5268
- onClick,
5269
- variant: "filled",
5270
- emphasis: variant,
5271
- size,
5272
- focused: false,
5273
- isInputFocused,
5274
- disabled,
5275
- minimized,
5276
- InputProps: {
5277
- onFocus: handleFocus,
5278
- onBlur: handleBlur,
5279
- startAdornment: /* @__PURE__ */ jsx(
5280
- SearchFieldStartAdornment,
5281
- {
5282
- minimized,
5283
- loading,
5284
- disabled,
5285
- startAdornment
5286
- }
5287
- ),
5288
- endAdornment: !minimized && /* @__PURE__ */ jsx(
5289
- SearchFieldEndAdornment,
5290
- {
5291
- disabled,
5292
- loading,
5293
- showClearButton: clearButtonVisibility,
5294
- clearButton,
5295
- clearButtonLabel: clearButtonLabelValue,
5296
- onClear: handleClear,
5297
- size,
5298
- endAdornment
5299
- }
5300
- ),
5301
- ...InputProps
5302
- },
5303
- inputProps: {
5304
- role: "searchbox",
5305
- ...inputProps
5306
- },
5307
- role: "search",
5308
- "data-variant": variant,
5309
- "data-name": "search-field",
5310
- ref,
5311
- ...otherProps
5312
- }
5313
- );
5314
- }
5315
- const SearchField = forwardRef(_SearchField);
5316
5042
  const MAX_WIDTH = 480;
5317
5043
  const SnackbarRoot = styled(Snackbar$1)(({ theme }) => ({
5318
5044
  bottom: theme.spacing(2),
@@ -6136,7 +5862,6 @@ export {
6136
5862
  MultipleSelectField,
6137
5863
  PasswordField,
6138
5864
  ScreenReaderOnly,
6139
- SearchField,
6140
5865
  SelectField,
6141
5866
  Snackbar,
6142
5867
  SplitButton,
@@ -818,7 +818,6 @@ const en = {
818
818
  copy: "Copy",
819
819
  save: "Save",
820
820
  add: "Add",
821
- clear: "Clear",
822
821
  showOptions: "Show options",
823
822
  hide: "Hide",
824
823
  show: "Show",
@@ -968,7 +967,6 @@ const es = {
968
967
  copy: "Copiar",
969
968
  save: "Guardar",
970
969
  add: "Añadir",
971
- clear: "Borrar",
972
970
  showOptions: "Mostrar opciones",
973
971
  hide: "Ocultar",
974
972
  show: "Mostrar",
@@ -1116,7 +1114,6 @@ const id = {
1116
1114
  copy: "Salin",
1117
1115
  save: "Simpan",
1118
1116
  add: "Tambah",
1119
- clear: "Bersihkan",
1120
1117
  showOptions: "Tampilkan opsi",
1121
1118
  hide: "Sembunyikan",
1122
1119
  show: "Tampilkan",
@@ -817,7 +817,6 @@ const en = {
817
817
  copy: "Copy",
818
818
  save: "Save",
819
819
  add: "Add",
820
- clear: "Clear",
821
820
  showOptions: "Show options",
822
821
  hide: "Hide",
823
822
  show: "Show",
@@ -967,7 +966,6 @@ const es = {
967
966
  copy: "Copiar",
968
967
  save: "Guardar",
969
968
  add: "Añadir",
970
- clear: "Borrar",
971
969
  showOptions: "Mostrar opciones",
972
970
  hide: "Ocultar",
973
971
  show: "Mostrar",
@@ -1115,7 +1113,6 @@ const id = {
1115
1113
  copy: "Salin",
1116
1114
  save: "Simpan",
1117
1115
  add: "Tambah",
1118
- clear: "Bersihkan",
1119
1116
  showOptions: "Tampilkan opsi",
1120
1117
  hide: "Sembunyikan",
1121
1118
  show: "Tampilkan",