@carto/meridian-ds 4.2.0 → 4.2.1-alpha.693ea7c.297

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - chore(deps): upgrade MUI core to v6 + prep peers/react-is [sc-563129] [#484](https://github.com/CartoDB/meridian-ds/pull/484)
6
+
5
7
  ## 4.0
6
8
 
7
9
  ### 4.2.0
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { styled, MenuItem as MenuItem$1, Tooltip, CircularProgress, IconButton as IconButton$1, Box } from "@mui/material";
4
- import { d as MENU_ITEM_SIZE_DENSE, M as MENU_ITEM_SIZE_EXTENDED, e as ICON_SIZE_LARGE, a as ICON_SIZE_MEDIUM, I as ICON_SIZE_SMALL } from "./palette-utils-d-9NY8qw.js";
4
+ import { d as MENU_ITEM_SIZE_DENSE, M as MENU_ITEM_SIZE_EXTENDED, e as ICON_SIZE_LARGE, a as ICON_SIZE_MEDIUM, I as ICON_SIZE_SMALL } from "./palette-utils-Ccd-r_Nr.js";
5
5
  import { KeyboardArrowLeftOutlined, KeyboardArrowRightOutlined } from "@mui/icons-material";
6
6
  import { useIntl } from "react-intl";
7
7
  import { u as useImperativeIntl } from "./useImperativeIntl-BUw_LXAO.js";
@@ -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 paletteUtils = require("./palette-utils-DX1R_i9N.cjs");
5
+ const paletteUtils = require("./palette-utils-Dt4yj7Pv.cjs");
6
6
  const iconsMaterial = require("@mui/icons-material");
7
7
  const reactIntl = require("react-intl");
8
8
  const useImperativeIntl = require("./useImperativeIntl-lvkv1UNL.cjs");
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const material = require("@mui/material");
6
- const paletteUtils = require("../palette-utils-DX1R_i9N.cjs");
6
+ const paletteUtils = require("../palette-utils-Dt4yj7Pv.cjs");
7
7
  const iconsMaterial = require("@mui/icons-material");
8
8
  const ArrowDown = require("../ArrowDown-84Oc8r9k.cjs");
9
9
  const ReactWindow = require("react-window");
10
- const TablePaginationActions = require("../TablePaginationActions-WuqMxOyM.cjs");
10
+ const TablePaginationActions = require("../TablePaginationActions-Dp3-3n1D.cjs");
11
11
  const Search = require("../Search-BsaXrSzs.cjs");
12
12
  require("cartocolor");
13
13
  const reactCodemirror2 = require("react-codemirror2");
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle, createContext, useContext } from "react";
3
3
  import { styled, Button as Button$1, Box, CircularProgress as CircularProgress$1, Tooltip, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, FormControl, InputLabel, FormHelperText, Select, Checkbox, Link as Link$1, ListItemText as ListItemText$1, IconButton as IconButton$1, ToggleButtonGroup as ToggleButtonGroup$1, Stack, Autocomplete as Autocomplete$1, Divider, ListItemIcon as ListItemIcon$1, createFilterOptions, alpha, useTheme, Toolbar as Toolbar$1, AppBar as AppBar$1, Dialog as Dialog$1, Chip as Chip$1, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, Fade, AlertTitle, Alert as Alert$2, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Portal, Snackbar as Snackbar$1, List as List$2, ListItemButton as ListItemButton$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Typography as Typography$1, Popover } from "@mui/material";
4
4
  import { ListItemAvatar, ListItemSecondaryAction } from "@mui/material";
5
- import { T as Typography, I as ICON_SIZE_SMALL, a as ICON_SIZE_MEDIUM, M as MENU_ITEM_SIZE_EXTENDED, b as MENU_ITEM_SIZE_DEFAULT, c as MENU_LIST_MAX_SIZE, d as MENU_ITEM_SIZE_DENSE, A as APPBAR_SIZE, e as ICON_SIZE_LARGE, N as NOTIFICATION_DURATION_IN_MS, L as LIST_MAX_SIZE, f as LIST_ITEM_SIZE_DENSE, g as LIST_ITEM_SIZE_DEFAULT, h as LIST_OVERSCAN_ITEMS_COUNT, F as FontWeight, r as resolvePalettePath } from "../palette-utils-d-9NY8qw.js";
5
+ import { T as Typography, I as ICON_SIZE_SMALL, a as ICON_SIZE_MEDIUM, M as MENU_ITEM_SIZE_EXTENDED, b as MENU_ITEM_SIZE_DEFAULT, c as MENU_LIST_MAX_SIZE, d as MENU_ITEM_SIZE_DENSE, A as APPBAR_SIZE, e as ICON_SIZE_LARGE, N as NOTIFICATION_DURATION_IN_MS, L as LIST_MAX_SIZE, f as LIST_ITEM_SIZE_DENSE, g as LIST_ITEM_SIZE_DEFAULT, h as LIST_OVERSCAN_ITEMS_COUNT, F as FontWeight, r as resolvePalettePath } from "../palette-utils-Ccd-r_Nr.js";
6
6
  import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, ArrowBackOutlined, CloseOutlined, Check, TodayOutlined, StopCircleOutlined, ArrowUpwardOutlined } from "@mui/icons-material";
7
7
  import { F as ForwardedComponent$1 } from "../ArrowDown-Bho9Ssnw.js";
8
8
  import * as ReactWindow from "react-window";
9
- import { u as useTranslationWithFallback, I as IconButton, M as MenuItem$1, g as getThemeColor, e as ellipsisStyles, S as SVG_SELECTOR } from "../TablePaginationActions-BvKjTAmB.js";
10
- import { T } from "../TablePaginationActions-BvKjTAmB.js";
9
+ import { u as useTranslationWithFallback, I as IconButton, M as MenuItem$1, g as getThemeColor, e as ellipsisStyles, S as SVG_SELECTOR } from "../TablePaginationActions-DTpwmDwH.js";
10
+ import { T } from "../TablePaginationActions-DTpwmDwH.js";
11
11
  import { F as ForwardedComponent, a as ForwardedComponent$2, b as ForwardedComponent$3, c as ForwardedComponent$4 } from "../Search-DXfTNnxj.js";
12
12
  import "cartocolor";
13
13
  import { Controlled, UnControlled } from "react-codemirror2";
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.2.0",
2
+ "version": "4.2.1-alpha.693ea7c.297",
3
3
  "conventions": "# Meridian usage conventions (for code-generating agents)\n\nSystem-level rules an agent should apply across all components.\n\nMeridian is the source of truth: when an existing codebase pattern contradicts Meridian, follow Meridian — don't replicate the contradicting local pattern.\n\n## Choosing a component\n\n- Don't hand-roll what the design system already provides. Before writing a\n custom component, a styled wrapper, or a block of primitives (a modal,\n chip/tag, card, empty state, dropdown, tooltip, copy-to-clipboard input,\n etc.), confirm no Meridian component covers it — reuse or extend the existing one instead of rebuilding it.\n- Prefer a Meridian component over a bare MUI one whenever a Meridian wrapper\n exists — the wrappers carry CARTO theming, a11y defaults, and narrowed APIs. MUI is correct for layout primitives (`Box`/`Grid`/`Stack`/`Container`) and for gaps Meridian doesn't fill (e.g. date pickers); \"prefer Meridian\" is not \"never MUI\".\n- Resolve \"which component\" by reading each one's `description` + `keywords`,\n then confirm with its `decisionTree` (the conditions that point elsewhere) and `limitations` (what it lacks — check before you downgrade to it).\n Don't infer selection from prop lists.\n\n## Icons\n\n- Source icons from Meridian's custom-icons first, then `@mui/icons-material`;\n add a local SVG only when neither has an equivalent. Don't duplicate an icon\n the design system already ships.\n- Find the right custom icon with `meridian_list_icons` — match by name or keyword (e.g. \"warehouse\" → `Bigquery`), import it from `@carto/meridian-ds/custom-icons`, and render `<Name />`. Every icon shares one prop type, `CustomIconProps` (MUI `SvgIconProps` — `color`/`fontSize`/`sx` — plus `width`/`height`).\n- To confirm a shortlisted icon by sight (or match an icon in a design you're implementing), call `meridian_get_screenshot` with `name: 'icons'` and Read the returned image path — a labeled grid of every icon.\n- Use the standard icon sizes — small 12px, medium (default) 18px, large 24px;\n a value off this scale (e.g. 16, 20) needs design sign-off. Prefer the\n outlined variants.\n- A new SVG must inherit, not bake in: set `fill='currentColor'` so it takes\n the parent's color, and use the standard size — don't hardcode\n color/opacity/dimensions.\n- For an icon color outside the palette `color` set, pass a theme token via\n `htmlColor` (e.g. `htmlColor={theme.palette.text.secondary}`) — never a\n hardcoded hex.\n\n## Accessibility\n\n- Any icon-only control needs an accessible name: `tooltip` or `aria-label`.\n- Don't disable a control without telling the user why — pair a disabled action with a tooltip explaining the requirement.\n- An `aria-label` must be human-readable text describing the control, not a test id in disguise — use a separate test hook for that.\n- User-facing strings (labels, `aria-label`, placeholders, messages) go through the app's i18n layer, not hardcoded literals.\n\n## Props\n\n- Two sources, both pinned to the installed `@carto/meridian-ds`: **exact props / types / JSDoc** come from the package's **type declarations** — read the `<Name>.d.ts` directly — while the **`meridian-design-system` MCP** (`meridian_*` tools) covers what types can't: which component, when, gotchas, and real examples.\n- A component's curation lists the high-value inherited MUI props worth knowing (`curation.mui`, e.g. `color`/`variant`/`size`); the rest of MUI's surface is available but rarely needed.\n- Don't use `sx`/inline styles to override a Meridian component's visual design (colors, typography, borders, sizing) — use its documented props and the theme tokens. (`sx` for layout/spacing on primitives is fine — see Styling.)\n- If no prop covers the visual change you need, treat it as a design-system gap: request the variant/behavior upstream in Meridian rather than permanently overriding the component locally — a local `styled()` of a Meridian component is a smell, not a fix.\n\n## Styling\n\n- Use theme tokens, never hardcoded values: colors from the palette (`text.*`, `background.*`, `divider`, semantic `*.main`) and spacing from the theme spacing scale — no raw hex/rgb or pixel literals for color or spacing. Use integer steps on the spacing scale (`theme.spacing(n)`, or `sx` numeric spacing like `px: 2` / `mt: 3` which resolve to it) — not fractional steps or raw px. Get the exact values — palette keys, spacing base, type ramp, `shape.borderRadius`, breakpoints, shadows — from `meridian_get_tokens`.\n- Text uses `<Typography variant=…>` (with the `weight` prop for emphasis), never hardcoded `fontSize`/`fontWeight`/`lineHeight`/`fontFamily`.\n- Meridian's type scale is custom and does not match MUI defaults (e.g. `body2`/`caption` differ from MUI's sizes, and there are Meridian-only variants like `code1`/`code2`/`code3` and `overlineDelicate`). Pick the variant by role from Typography's variant list (`meridian_get_examples('Typography')`) — don't assume a px size or map px → variant yourself.\n- `sx` is the right tool for one-off layout/spacing on primitives (`Box`/`Grid`/`Stack`), not the deprecated MUI system props\n (`<Box px={2}>` → `<Box sx={{ px: 2 }}>`). This is layout, distinct from restyling a Meridian component (see Props).\n\n## Examples\n\n- Never invent example code when a story exists — use the component's real story source (`meridian_get_examples`). The lead Usage story is the copy-paste starting point; the later stories are illustrative (variants, edge cases) and may carry story-arg shells, so don't copy one wholesale as your baseline.\n",
4
4
  "components": [
5
5
  {
@@ -0,0 +1,357 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Typography as Typography$1, alpha } from "@mui/material";
3
+ import { forwardRef } from "react";
4
+ import { createSpacing } from "@mui/system";
5
+ import * as cartoColors from "cartocolor";
6
+ const FontWeight = {
7
+ regular: 400,
8
+ medium: 500,
9
+ strong: 600
10
+ };
11
+ function _Typography({ italic, weight, style, children, ...otherProps }, ref) {
12
+ const fontConfiguration = {
13
+ fontWeight: FontWeight[weight],
14
+ fontStyle: italic ? "italic" : void 0
15
+ };
16
+ return /* @__PURE__ */ jsx(
17
+ Typography$1,
18
+ {
19
+ ...otherProps,
20
+ ref,
21
+ style: {
22
+ ...fontConfiguration,
23
+ ...style
24
+ },
25
+ "data-name": "typography",
26
+ children
27
+ }
28
+ );
29
+ }
30
+ const Typography = forwardRef(_Typography);
31
+ const SPACING = 8;
32
+ const BREAKPOINTS = {
33
+ XS: 320,
34
+ SM: 600,
35
+ MD: 960,
36
+ LG: 1280,
37
+ XL: 1600
38
+ };
39
+ const getSpacing = createSpacing(SPACING);
40
+ const ICON_SIZE_SMALL = getSpacing(1.5);
41
+ const ICON_SIZE_MEDIUM = getSpacing(2.25);
42
+ const ICON_SIZE_LARGE = getSpacing(3);
43
+ const APPBAR_SIZE = getSpacing(6);
44
+ const NOTIFICATION_DURATION_IN_MS = 6e3;
45
+ const MENU_LIST_MAX_SIZE = 312;
46
+ const MENU_ITEM_SIZE_DENSE = 24;
47
+ const MENU_ITEM_SIZE_DEFAULT = 32;
48
+ const MENU_ITEM_SIZE_EXTENDED = 48;
49
+ const LIST_ITEM_MIN_SIZE = 32;
50
+ const LIST_ITEM_SIZE_DENSE = 52;
51
+ const LIST_ITEM_SIZE_DEFAULT = 68;
52
+ const LIST_MAX_SIZE = 312;
53
+ const LIST_OVERSCAN_ITEMS_COUNT = 5;
54
+ const COLOR_BLACK = "#2C3032";
55
+ const COLOR_WHITE = "#FFFFFF";
56
+ const COLOR_UNUSED = "#e91e63";
57
+ const baseColors = {
58
+ common: {
59
+ black: COLOR_BLACK,
60
+ white: COLOR_WHITE
61
+ },
62
+ neutral: {
63
+ 50: "#f8f9f9",
64
+ 100: "#e1e3e4",
65
+ 200: "#cbcdcf",
66
+ 300: "#b4b8ba",
67
+ 400: "#9da2a6",
68
+ 500: "#868d91",
69
+ 600: "#6f777c",
70
+ 700: "#595f63",
71
+ 800: "#43474a",
72
+ 900: COLOR_BLACK,
73
+ A100: "#ddddde",
74
+ A200: "#b9babb",
75
+ A400: "#7c7e7f",
76
+ A700: "#16191A"
77
+ },
78
+ blue: {
79
+ 300: "#358BE7",
80
+ 400: "#036FE2",
81
+ 500: "#024D9E"
82
+ },
83
+ green: {
84
+ 300: "#6BE2AD",
85
+ 400: "#47DB99",
86
+ 500: "#31996B"
87
+ },
88
+ lightGreen: {
89
+ 300: "#8CB24A",
90
+ 400: "#709F1D",
91
+ 500: "#435F11"
92
+ },
93
+ indigo: {
94
+ 300: "#34689F",
95
+ 400: "#024388",
96
+ 500: "#012C5A"
97
+ },
98
+ orange: {
99
+ 300: "#F4B134",
100
+ 400: "#F29E02",
101
+ 500: "#A96E01"
102
+ },
103
+ red: {
104
+ 300: "#CD593B",
105
+ 400: "#C1300B",
106
+ 500: "#872107"
107
+ },
108
+ qualitative: {
109
+ // CARTO colors
110
+ // TODO: Related discussion https://app.shortcut.com/cartoteam/story/264834/
111
+ bold: {
112
+ 0: "#7F3C8D",
113
+ 1: "#11A579",
114
+ 2: "#3969AC",
115
+ 3: "#F2B701",
116
+ 4: "#E73F74",
117
+ 5: "#80BA5A",
118
+ 6: "#E68310",
119
+ 7: "#008695",
120
+ 8: "#CF1C90",
121
+ 9: "#f97b72",
122
+ 10: "#4b4b8f",
123
+ 11: "#A5AA99"
124
+ }
125
+ },
126
+ shades: {
127
+ dark: {
128
+ 90: alpha(COLOR_BLACK, 0.9),
129
+ 60: alpha(COLOR_BLACK, 0.6),
130
+ 40: alpha(COLOR_BLACK, 0.4),
131
+ 25: alpha(COLOR_BLACK, 0.25),
132
+ 12: alpha(COLOR_BLACK, 0.12),
133
+ 8: alpha(COLOR_BLACK, 0.08),
134
+ 4: alpha(COLOR_BLACK, 0.04)
135
+ },
136
+ light: {
137
+ 90: alpha(COLOR_WHITE, 0.9),
138
+ 60: alpha(COLOR_WHITE, 0.6),
139
+ 40: alpha(COLOR_WHITE, 0.4),
140
+ 25: alpha(COLOR_WHITE, 0.25),
141
+ 12: alpha(COLOR_WHITE, 0.12),
142
+ 8: alpha(COLOR_WHITE, 0.08),
143
+ 4: alpha(COLOR_WHITE, 0.04)
144
+ }
145
+ }
146
+ };
147
+ const commonPalette = {
148
+ mode: "light",
149
+ contrastThreshold: 3,
150
+ tonalOffset: 0.2,
151
+ common: { ...baseColors.common },
152
+ primary: {
153
+ main: baseColors.blue[400],
154
+ dark: baseColors.blue[500],
155
+ light: baseColors.blue[300],
156
+ contrastText: baseColors.common.white,
157
+ background: alpha(baseColors.blue[400], 0.08),
158
+ relatedLight: "#EAF2FC",
159
+ relatedDark: COLOR_UNUSED
160
+ },
161
+ secondary: {
162
+ main: baseColors.green[400],
163
+ dark: baseColors.green[500],
164
+ light: baseColors.green[300],
165
+ contrastText: baseColors.common.black,
166
+ background: alpha(baseColors.green[400], 0.08),
167
+ relatedLight: "#EFFCF5",
168
+ relatedDark: COLOR_UNUSED
169
+ },
170
+ text: {
171
+ primary: baseColors.common.black,
172
+ secondary: alpha(COLOR_BLACK, 0.7),
173
+ disabled: baseColors.shades.dark[25],
174
+ hint: baseColors.shades.dark[40]
175
+ },
176
+ background: {
177
+ paper: baseColors.common.white,
178
+ default: baseColors.neutral[50]
179
+ },
180
+ action: {
181
+ active: baseColors.shades.dark[40],
182
+ hover: baseColors.shades.dark[8],
183
+ disabledBackground: baseColors.neutral[100],
184
+ disabled: baseColors.shades.dark[25],
185
+ selected: baseColors.shades.dark[12],
186
+ focus: baseColors.shades.dark[12],
187
+ activatedOpacity: 0.12,
188
+ hoverOpacity: 0.04,
189
+ selectedOpacity: 0.08,
190
+ disabledOpacity: 0.38,
191
+ focusOpacity: 0.12
192
+ },
193
+ info: {
194
+ main: baseColors.indigo[400],
195
+ dark: baseColors.indigo[500],
196
+ light: baseColors.indigo[300],
197
+ contrastText: baseColors.common.white,
198
+ relatedDark: "#0D2B4A",
199
+ relatedLight: "#E9EEF4",
200
+ background: COLOR_UNUSED
201
+ },
202
+ success: {
203
+ main: baseColors.lightGreen[400],
204
+ dark: baseColors.lightGreen[500],
205
+ light: baseColors.lightGreen[300],
206
+ contrastText: baseColors.common.white,
207
+ relatedDark: "#3D541A",
208
+ relatedLight: "#F2F5EB",
209
+ background: COLOR_UNUSED
210
+ },
211
+ warning: {
212
+ main: baseColors.orange[400],
213
+ dark: baseColors.orange[500],
214
+ light: baseColors.orange[300],
215
+ contrastText: baseColors.common.black,
216
+ relatedDark: "#78540F",
217
+ relatedLight: "#FEF6EA",
218
+ background: COLOR_UNUSED
219
+ },
220
+ error: {
221
+ main: baseColors.red[400],
222
+ light: baseColors.red[300],
223
+ dark: baseColors.red[500],
224
+ contrastText: baseColors.common.white,
225
+ relatedDark: "#622215",
226
+ relatedLight: "#F9EDEA",
227
+ background: COLOR_UNUSED
228
+ },
229
+ grey: {
230
+ ...baseColors.neutral
231
+ },
232
+ divider: baseColors.shades.dark[12],
233
+ // Custom common colors
234
+ default: {
235
+ main: baseColors.neutral[100],
236
+ dark: baseColors.neutral[200],
237
+ light: baseColors.neutral[50],
238
+ outlinedBorder: baseColors.shades.dark[25],
239
+ background: baseColors.shades.dark[4],
240
+ relatedLight: COLOR_UNUSED,
241
+ relatedDark: COLOR_UNUSED,
242
+ contrastText: COLOR_UNUSED
243
+ },
244
+ neutral: {
245
+ main: baseColors.neutral[100],
246
+ dark: baseColors.neutral[200],
247
+ light: baseColors.neutral[50],
248
+ background: baseColors.shades.dark[4],
249
+ relatedLight: COLOR_UNUSED,
250
+ relatedDark: COLOR_UNUSED,
251
+ contrastText: COLOR_UNUSED
252
+ },
253
+ brand: {
254
+ navyBlue: "#162945",
255
+ locationRed: "#EB1510",
256
+ predictionBlue: "#1785FB",
257
+ softBlue: "#F2F6F9",
258
+ appBarMain: "#162945",
259
+ appBarContrastText: baseColors.common.white
260
+ },
261
+ white: {
262
+ ...baseColors.shades.light
263
+ },
264
+ black: {
265
+ ...baseColors.shades.dark
266
+ },
267
+ qualitative: {
268
+ ...baseColors.qualitative
269
+ }
270
+ };
271
+ function getPaletteFromCartoColors(name, domainSize) {
272
+ var _a;
273
+ const palette = cartoColors[name];
274
+ let paletteIndex = domainSize;
275
+ if (!palette) {
276
+ throw new Error(
277
+ `Palette "${name}" not found. Expected a CARTOColors string`
278
+ );
279
+ }
280
+ const palettesColorVariants = Object.keys(palette).filter((p) => p !== "tags").map(Number);
281
+ const longestPaletteIndex = Math.max(...palettesColorVariants);
282
+ const smallestPaletteIndex = Math.min(...palettesColorVariants);
283
+ if (!Number.isInteger(domainSize) || domainSize > longestPaletteIndex) {
284
+ paletteIndex = longestPaletteIndex;
285
+ } else if (domainSize < smallestPaletteIndex) {
286
+ paletteIndex = smallestPaletteIndex;
287
+ }
288
+ let colors = palette[paletteIndex];
289
+ if ((_a = palette.tags) == null ? void 0 : _a.includes("qualitative")) {
290
+ colors = colors == null ? void 0 : colors.slice(0, -1);
291
+ }
292
+ return colors;
293
+ }
294
+ function getPalette(colors, domainSize) {
295
+ if (typeof colors === "string") {
296
+ return getPaletteFromCartoColors(colors, domainSize);
297
+ } else {
298
+ return colors.map((c) => {
299
+ if (Array.isArray(c)) {
300
+ const [r, g, b] = c;
301
+ return rgbToHex(r, g, b);
302
+ } else {
303
+ return c;
304
+ }
305
+ });
306
+ }
307
+ }
308
+ function rgbToHex(r, g, b) {
309
+ return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
310
+ }
311
+ function getCartoColorStylePropsForItem(theme, index) {
312
+ var _a;
313
+ const palette = (_a = commonPalette == null ? void 0 : commonPalette.qualitative) == null ? void 0 : _a.bold;
314
+ const colors = Object.values(palette ?? {});
315
+ const chosenIndex = index % colors.length;
316
+ return {
317
+ backgroundColor: colors[chosenIndex],
318
+ color: theme.palette.getContrastText(colors[chosenIndex])
319
+ };
320
+ }
321
+ const resolvePalettePath = (theme, path, fallback) => {
322
+ const resolvedValue = path.split(".").reduce((acc, part) => {
323
+ if (acc && typeof acc === "object" && part in acc) {
324
+ return acc[part];
325
+ }
326
+ return void 0;
327
+ }, theme.palette);
328
+ if (typeof resolvedValue === "string") {
329
+ return resolvedValue;
330
+ }
331
+ return theme.palette.text.secondary;
332
+ };
333
+ export {
334
+ APPBAR_SIZE as A,
335
+ BREAKPOINTS as B,
336
+ FontWeight as F,
337
+ ICON_SIZE_SMALL as I,
338
+ LIST_MAX_SIZE as L,
339
+ MENU_ITEM_SIZE_EXTENDED as M,
340
+ NOTIFICATION_DURATION_IN_MS as N,
341
+ SPACING as S,
342
+ Typography as T,
343
+ ICON_SIZE_MEDIUM as a,
344
+ MENU_ITEM_SIZE_DEFAULT as b,
345
+ MENU_LIST_MAX_SIZE as c,
346
+ MENU_ITEM_SIZE_DENSE as d,
347
+ ICON_SIZE_LARGE as e,
348
+ LIST_ITEM_SIZE_DENSE as f,
349
+ LIST_ITEM_SIZE_DEFAULT as g,
350
+ LIST_OVERSCAN_ITEMS_COUNT as h,
351
+ commonPalette as i,
352
+ getSpacing as j,
353
+ LIST_ITEM_MIN_SIZE as k,
354
+ getCartoColorStylePropsForItem as l,
355
+ getPalette as m,
356
+ resolvePalettePath as r
357
+ };