@carto/meridian-ds 2.7.0-alpha-loader.4 → 2.7.0-alpha-loader.6
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/dist/{Alert-BZPM5zpX.js → Alert-CHyETxuP.js} +1 -1
- package/dist/{Alert-C4W0H_uN.cjs → Alert-DyUCYGVG.cjs} +1 -1
- package/dist/{MenuItem-CgF4QdGi.cjs → MenuItem-BLZz_nSA.cjs} +1 -1
- package/dist/{MenuItem-DRUK149i.js → MenuItem-CM00TU3e.js} +1 -1
- package/dist/components/index.cjs +39 -13
- package/dist/components/index.js +47 -21
- package/dist/{css-utils-CH7es90t.cjs → css-utils-B9V_AMcv.cjs} +212 -1
- package/dist/{css-utils-CjUBRJVK.js → css-utils-Cr7ZvmiF.js} +216 -5
- package/dist/palette-utils-C5CHlLXB.cjs +93 -0
- package/dist/palette-utils-D99Ib0kC.js +77 -0
- package/dist/theme/index.cjs +21 -13
- package/dist/theme/index.js +13 -6
- package/dist/types/components/CircularProgress/CircularProgress.d.ts +19 -0
- package/dist/types/components/CircularProgress/CircularProgress.d.ts.map +1 -0
- package/dist/types/components/CircularProgress/CircularProgress.stories.d.ts +72 -0
- package/dist/types/components/CircularProgress/CircularProgress.stories.d.ts.map +1 -0
- package/dist/types/components/CircularProgress/CircularProgress.test.d.ts +2 -0
- package/dist/types/components/CircularProgress/CircularProgress.test.d.ts.map +1 -0
- package/dist/types/components/CircularProgress/index.d.ts +3 -0
- package/dist/types/components/CircularProgress/index.d.ts.map +1 -0
- package/dist/types/components/Loader/Loader.d.ts +5 -13
- package/dist/types/components/Loader/Loader.d.ts.map +1 -1
- package/dist/types/components/Loader/Loader.stories.d.ts +59 -11
- package/dist/types/components/Loader/Loader.stories.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/theme/components/forms.d.ts.map +1 -1
- package/dist/types/theme/components/stories/{Progress.stories.d.ts → LinearProgress.stories.d.ts} +12 -22
- package/dist/types/theme/components/stories/LinearProgress.stories.d.ts.map +1 -0
- package/dist/types/theme/types.d.ts +5 -0
- package/dist/types/theme/types.d.ts.map +1 -1
- package/dist/widgets/index.cjs +5 -5
- package/dist/widgets/index.js +3 -3
- package/package.json +2 -2
- package/dist/palette-utils-B9ybmwiI.cjs +0 -304
- package/dist/palette-utils-BHqJlHm9.js +0 -288
- package/dist/types/theme/components/stories/Progress.stories.d.ts.map +0 -1
|
@@ -1,9 +1,219 @@
|
|
|
1
|
+
import { alpha, Typography as Typography$1, styled, IconButton as IconButton$1, Tooltip, CircularProgress, Box } from "@mui/material";
|
|
1
2
|
import require$$0 from "react-is";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Typography as Typography$1, styled, IconButton as IconButton$1, Tooltip, CircularProgress, Box } from "@mui/material";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { KeyboardArrowLeftOutlined, KeyboardArrowRightOutlined } from "@mui/icons-material";
|
|
6
6
|
import { createIntlCache, createIntl, useIntl } from "react-intl";
|
|
7
|
+
const COLOR_BLACK = "#2C3032";
|
|
8
|
+
const COLOR_WHITE = "#FFFFFF";
|
|
9
|
+
const COLOR_UNUSED = "#e91e63";
|
|
10
|
+
const baseColors = {
|
|
11
|
+
common: {
|
|
12
|
+
black: COLOR_BLACK,
|
|
13
|
+
white: COLOR_WHITE
|
|
14
|
+
},
|
|
15
|
+
neutral: {
|
|
16
|
+
50: "#f8f9f9",
|
|
17
|
+
100: "#e1e3e4",
|
|
18
|
+
200: "#cbcdcf",
|
|
19
|
+
300: "#b4b8ba",
|
|
20
|
+
400: "#9da2a6",
|
|
21
|
+
500: "#868d91",
|
|
22
|
+
600: "#6f777c",
|
|
23
|
+
700: "#595f63",
|
|
24
|
+
800: "#43474a",
|
|
25
|
+
900: COLOR_BLACK,
|
|
26
|
+
A100: "#ddddde",
|
|
27
|
+
A200: "#b9babb",
|
|
28
|
+
A400: "#7c7e7f",
|
|
29
|
+
A700: "#16191A"
|
|
30
|
+
},
|
|
31
|
+
blue: {
|
|
32
|
+
100: "#B9DAF9",
|
|
33
|
+
200: "#5DB2F6",
|
|
34
|
+
300: "#358BE7",
|
|
35
|
+
400: "#036FE2",
|
|
36
|
+
500: "#024D9E"
|
|
37
|
+
},
|
|
38
|
+
green: {
|
|
39
|
+
300: "#6BE2AD",
|
|
40
|
+
400: "#47DB99",
|
|
41
|
+
500: "#31996B"
|
|
42
|
+
},
|
|
43
|
+
lightGreen: {
|
|
44
|
+
300: "#8CB24A",
|
|
45
|
+
400: "#709F1D",
|
|
46
|
+
500: "#435F11"
|
|
47
|
+
},
|
|
48
|
+
indigo: {
|
|
49
|
+
300: "#34689F",
|
|
50
|
+
400: "#024388",
|
|
51
|
+
500: "#012C5A"
|
|
52
|
+
},
|
|
53
|
+
orange: {
|
|
54
|
+
300: "#F4B134",
|
|
55
|
+
400: "#F29E02",
|
|
56
|
+
500: "#A96E01"
|
|
57
|
+
},
|
|
58
|
+
red: {
|
|
59
|
+
300: "#CD593B",
|
|
60
|
+
400: "#C1300B",
|
|
61
|
+
500: "#872107"
|
|
62
|
+
},
|
|
63
|
+
qualitative: {
|
|
64
|
+
// CARTO colors
|
|
65
|
+
// TODO: Related discussion https://app.shortcut.com/cartoteam/story/264834/
|
|
66
|
+
bold: {
|
|
67
|
+
0: "#7F3C8D",
|
|
68
|
+
1: "#11A579",
|
|
69
|
+
2: "#3969AC",
|
|
70
|
+
3: "#F2B701",
|
|
71
|
+
4: "#E73F74",
|
|
72
|
+
5: "#80BA5A",
|
|
73
|
+
6: "#E68310",
|
|
74
|
+
7: "#008695",
|
|
75
|
+
8: "#CF1C90",
|
|
76
|
+
9: "#f97b72",
|
|
77
|
+
10: "#4b4b8f",
|
|
78
|
+
11: "#A5AA99"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
shades: {
|
|
82
|
+
dark: {
|
|
83
|
+
90: alpha(COLOR_BLACK, 0.9),
|
|
84
|
+
60: alpha(COLOR_BLACK, 0.6),
|
|
85
|
+
40: alpha(COLOR_BLACK, 0.4),
|
|
86
|
+
25: alpha(COLOR_BLACK, 0.25),
|
|
87
|
+
12: alpha(COLOR_BLACK, 0.12),
|
|
88
|
+
8: alpha(COLOR_BLACK, 0.08),
|
|
89
|
+
4: alpha(COLOR_BLACK, 0.04)
|
|
90
|
+
},
|
|
91
|
+
light: {
|
|
92
|
+
90: alpha(COLOR_WHITE, 0.9),
|
|
93
|
+
60: alpha(COLOR_WHITE, 0.6),
|
|
94
|
+
40: alpha(COLOR_WHITE, 0.4),
|
|
95
|
+
25: alpha(COLOR_WHITE, 0.25),
|
|
96
|
+
12: alpha(COLOR_WHITE, 0.12),
|
|
97
|
+
8: alpha(COLOR_WHITE, 0.08),
|
|
98
|
+
4: alpha(COLOR_WHITE, 0.04)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const commonPalette = {
|
|
103
|
+
mode: "light",
|
|
104
|
+
contrastThreshold: 3,
|
|
105
|
+
tonalOffset: 0.2,
|
|
106
|
+
common: { ...baseColors.common },
|
|
107
|
+
primary: {
|
|
108
|
+
main: baseColors.blue[400],
|
|
109
|
+
dark: baseColors.blue[500],
|
|
110
|
+
light: baseColors.blue[300],
|
|
111
|
+
contrastText: baseColors.common.white,
|
|
112
|
+
background: alpha(baseColors.blue[400], 0.08),
|
|
113
|
+
relatedLight: "#EAF2FC",
|
|
114
|
+
relatedDark: COLOR_UNUSED
|
|
115
|
+
},
|
|
116
|
+
secondary: {
|
|
117
|
+
main: baseColors.green[400],
|
|
118
|
+
dark: baseColors.green[500],
|
|
119
|
+
light: baseColors.green[300],
|
|
120
|
+
contrastText: baseColors.common.black,
|
|
121
|
+
background: alpha(baseColors.green[400], 0.08),
|
|
122
|
+
relatedLight: "#EFFCF5",
|
|
123
|
+
relatedDark: COLOR_UNUSED
|
|
124
|
+
},
|
|
125
|
+
text: {
|
|
126
|
+
primary: baseColors.common.black,
|
|
127
|
+
secondary: baseColors.shades.dark[60],
|
|
128
|
+
disabled: baseColors.shades.dark[25],
|
|
129
|
+
hint: baseColors.shades.dark[40]
|
|
130
|
+
},
|
|
131
|
+
background: {
|
|
132
|
+
paper: baseColors.common.white,
|
|
133
|
+
default: baseColors.neutral[50]
|
|
134
|
+
},
|
|
135
|
+
action: {
|
|
136
|
+
active: baseColors.shades.dark[40],
|
|
137
|
+
hover: baseColors.shades.dark[8],
|
|
138
|
+
disabledBackground: baseColors.neutral[100],
|
|
139
|
+
disabled: baseColors.shades.dark[25],
|
|
140
|
+
selected: baseColors.shades.dark[12],
|
|
141
|
+
focus: baseColors.shades.dark[12],
|
|
142
|
+
activatedOpacity: 0.12,
|
|
143
|
+
hoverOpacity: 0.04,
|
|
144
|
+
selectedOpacity: 0.08,
|
|
145
|
+
disabledOpacity: 0.38,
|
|
146
|
+
focusOpacity: 0.12
|
|
147
|
+
},
|
|
148
|
+
info: {
|
|
149
|
+
main: baseColors.indigo[400],
|
|
150
|
+
dark: baseColors.indigo[500],
|
|
151
|
+
light: baseColors.indigo[300],
|
|
152
|
+
contrastText: baseColors.common.white,
|
|
153
|
+
relatedDark: "#0D2B4A",
|
|
154
|
+
relatedLight: "#E9EEF4",
|
|
155
|
+
background: COLOR_UNUSED
|
|
156
|
+
},
|
|
157
|
+
success: {
|
|
158
|
+
main: baseColors.lightGreen[400],
|
|
159
|
+
dark: baseColors.lightGreen[500],
|
|
160
|
+
light: baseColors.lightGreen[300],
|
|
161
|
+
contrastText: baseColors.common.white,
|
|
162
|
+
relatedDark: "#3D541A",
|
|
163
|
+
relatedLight: "#F2F5EB",
|
|
164
|
+
background: COLOR_UNUSED
|
|
165
|
+
},
|
|
166
|
+
warning: {
|
|
167
|
+
main: baseColors.orange[400],
|
|
168
|
+
dark: baseColors.orange[500],
|
|
169
|
+
light: baseColors.orange[300],
|
|
170
|
+
contrastText: baseColors.common.black,
|
|
171
|
+
relatedDark: "#78540F",
|
|
172
|
+
relatedLight: "#FEF6EA",
|
|
173
|
+
background: COLOR_UNUSED
|
|
174
|
+
},
|
|
175
|
+
error: {
|
|
176
|
+
main: baseColors.red[400],
|
|
177
|
+
light: baseColors.red[300],
|
|
178
|
+
dark: baseColors.red[500],
|
|
179
|
+
contrastText: baseColors.common.white,
|
|
180
|
+
relatedDark: "#622215",
|
|
181
|
+
relatedLight: "#F9EDEA",
|
|
182
|
+
background: COLOR_UNUSED
|
|
183
|
+
},
|
|
184
|
+
grey: {
|
|
185
|
+
...baseColors.neutral
|
|
186
|
+
},
|
|
187
|
+
divider: baseColors.shades.dark[12],
|
|
188
|
+
// Custom common colors
|
|
189
|
+
default: {
|
|
190
|
+
main: baseColors.neutral[100],
|
|
191
|
+
dark: baseColors.neutral[200],
|
|
192
|
+
light: baseColors.neutral[50],
|
|
193
|
+
outlinedBorder: baseColors.shades.dark[25],
|
|
194
|
+
background: baseColors.shades.dark[4],
|
|
195
|
+
relatedLight: COLOR_UNUSED,
|
|
196
|
+
relatedDark: COLOR_UNUSED,
|
|
197
|
+
contrastText: COLOR_UNUSED
|
|
198
|
+
},
|
|
199
|
+
brand: {
|
|
200
|
+
navyBlue: "#162945",
|
|
201
|
+
locationRed: "#EB1510",
|
|
202
|
+
predictionBlue: "#1785FB",
|
|
203
|
+
softBlue: "#F2F6F9",
|
|
204
|
+
appBarMain: "#162945",
|
|
205
|
+
appBarContrastText: baseColors.common.white
|
|
206
|
+
},
|
|
207
|
+
white: {
|
|
208
|
+
...baseColors.shades.light
|
|
209
|
+
},
|
|
210
|
+
black: {
|
|
211
|
+
...baseColors.shades.dark
|
|
212
|
+
},
|
|
213
|
+
qualitative: {
|
|
214
|
+
...baseColors.qualitative
|
|
215
|
+
}
|
|
216
|
+
};
|
|
7
217
|
function getDefaultExportFromCjs(x) {
|
|
8
218
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
9
219
|
}
|
|
@@ -5767,9 +5977,10 @@ export {
|
|
|
5767
5977
|
ellipsisStyles as e,
|
|
5768
5978
|
MENU_ITEM_SIZE_DENSE as f,
|
|
5769
5979
|
getSpacing as g,
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5980
|
+
commonPalette as h,
|
|
5981
|
+
MENU_ITEM_SIZE_EXTENDED as i,
|
|
5982
|
+
IconButton as j,
|
|
5983
|
+
useImperativeIntl as k,
|
|
5984
|
+
getDefaultExportFromCjs as l,
|
|
5774
5985
|
useTranslationWithFallback as u
|
|
5775
5986
|
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const cssUtils = require("./css-utils-B9V_AMcv.cjs");
|
|
3
|
+
const cartoColors = require("cartocolor");
|
|
4
|
+
function _interopNamespaceDefault(e) {
|
|
5
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
6
|
+
if (e) {
|
|
7
|
+
for (const k in e) {
|
|
8
|
+
if (k !== "default") {
|
|
9
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: () => e[k]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return Object.freeze(n);
|
|
19
|
+
}
|
|
20
|
+
const cartoColors__namespace = /* @__PURE__ */ _interopNamespaceDefault(cartoColors);
|
|
21
|
+
function getPaletteFromCartoColors(name, domainSize) {
|
|
22
|
+
var _a;
|
|
23
|
+
const palette = cartoColors__namespace[name];
|
|
24
|
+
let paletteIndex = domainSize;
|
|
25
|
+
if (!palette) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`Palette "${name}" not found. Expected a CARTOColors string`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
const palettesColorVariants = Object.keys(palette).filter((p) => p !== "tags").map(Number);
|
|
31
|
+
const longestPaletteIndex = Math.max(...palettesColorVariants);
|
|
32
|
+
const smallestPaletteIndex = Math.min(...palettesColorVariants);
|
|
33
|
+
if (!Number.isInteger(domainSize) || domainSize > longestPaletteIndex) {
|
|
34
|
+
paletteIndex = longestPaletteIndex;
|
|
35
|
+
} else if (domainSize < smallestPaletteIndex) {
|
|
36
|
+
paletteIndex = smallestPaletteIndex;
|
|
37
|
+
}
|
|
38
|
+
let colors = palette[paletteIndex];
|
|
39
|
+
if ((_a = palette.tags) == null ? void 0 : _a.includes("qualitative")) {
|
|
40
|
+
colors = colors == null ? void 0 : colors.slice(0, -1);
|
|
41
|
+
}
|
|
42
|
+
return colors;
|
|
43
|
+
}
|
|
44
|
+
function getPalette(colors, domainSize) {
|
|
45
|
+
if (typeof colors === "string") {
|
|
46
|
+
return getPaletteFromCartoColors(colors, domainSize);
|
|
47
|
+
} else {
|
|
48
|
+
return colors.map((c) => {
|
|
49
|
+
if (Array.isArray(c)) {
|
|
50
|
+
const [r, g, b] = c;
|
|
51
|
+
return rgbToHex(r, g, b);
|
|
52
|
+
} else {
|
|
53
|
+
return c;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function rgbToHex(r, g, b) {
|
|
59
|
+
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
60
|
+
}
|
|
61
|
+
function getCartoColorStylePropsForItem(theme, index) {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
const palette = (_b = (_a = cssUtils.commonPalette) == null ? void 0 : _a.qualitative) == null ? void 0 : _b.bold;
|
|
64
|
+
const colors = Object.values(palette ?? {});
|
|
65
|
+
const chosenIndex = index % colors.length;
|
|
66
|
+
return {
|
|
67
|
+
backgroundColor: colors[chosenIndex],
|
|
68
|
+
color: theme.palette.getContrastText(colors[chosenIndex])
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function getColorByCategory(category, {
|
|
72
|
+
palette,
|
|
73
|
+
fallbackColor,
|
|
74
|
+
colorMapping
|
|
75
|
+
}) {
|
|
76
|
+
const assignedColor = colorMapping[category];
|
|
77
|
+
if (assignedColor) {
|
|
78
|
+
return colorMapping[category];
|
|
79
|
+
}
|
|
80
|
+
if (!palette || palette.length === 0) {
|
|
81
|
+
return fallbackColor;
|
|
82
|
+
}
|
|
83
|
+
const nextFreeColorIndex = Math.min(
|
|
84
|
+
Object.keys(colorMapping).length,
|
|
85
|
+
palette.length - 1
|
|
86
|
+
);
|
|
87
|
+
const newColor = palette[nextFreeColorIndex];
|
|
88
|
+
colorMapping[category] = newColor;
|
|
89
|
+
return newColor;
|
|
90
|
+
}
|
|
91
|
+
exports.getCartoColorStylePropsForItem = getCartoColorStylePropsForItem;
|
|
92
|
+
exports.getColorByCategory = getColorByCategory;
|
|
93
|
+
exports.getPalette = getPalette;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { h as commonPalette } from "./css-utils-Cr7ZvmiF.js";
|
|
2
|
+
import * as cartoColors from "cartocolor";
|
|
3
|
+
function getPaletteFromCartoColors(name, domainSize) {
|
|
4
|
+
var _a;
|
|
5
|
+
const palette = cartoColors[name];
|
|
6
|
+
let paletteIndex = domainSize;
|
|
7
|
+
if (!palette) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`Palette "${name}" not found. Expected a CARTOColors string`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
const palettesColorVariants = Object.keys(palette).filter((p) => p !== "tags").map(Number);
|
|
13
|
+
const longestPaletteIndex = Math.max(...palettesColorVariants);
|
|
14
|
+
const smallestPaletteIndex = Math.min(...palettesColorVariants);
|
|
15
|
+
if (!Number.isInteger(domainSize) || domainSize > longestPaletteIndex) {
|
|
16
|
+
paletteIndex = longestPaletteIndex;
|
|
17
|
+
} else if (domainSize < smallestPaletteIndex) {
|
|
18
|
+
paletteIndex = smallestPaletteIndex;
|
|
19
|
+
}
|
|
20
|
+
let colors = palette[paletteIndex];
|
|
21
|
+
if ((_a = palette.tags) == null ? void 0 : _a.includes("qualitative")) {
|
|
22
|
+
colors = colors == null ? void 0 : colors.slice(0, -1);
|
|
23
|
+
}
|
|
24
|
+
return colors;
|
|
25
|
+
}
|
|
26
|
+
function getPalette(colors, domainSize) {
|
|
27
|
+
if (typeof colors === "string") {
|
|
28
|
+
return getPaletteFromCartoColors(colors, domainSize);
|
|
29
|
+
} else {
|
|
30
|
+
return colors.map((c) => {
|
|
31
|
+
if (Array.isArray(c)) {
|
|
32
|
+
const [r, g, b] = c;
|
|
33
|
+
return rgbToHex(r, g, b);
|
|
34
|
+
} else {
|
|
35
|
+
return c;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function rgbToHex(r, g, b) {
|
|
41
|
+
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
42
|
+
}
|
|
43
|
+
function getCartoColorStylePropsForItem(theme, index) {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
const palette = (_b = (_a = commonPalette) == null ? void 0 : _a.qualitative) == null ? void 0 : _b.bold;
|
|
46
|
+
const colors = Object.values(palette ?? {});
|
|
47
|
+
const chosenIndex = index % colors.length;
|
|
48
|
+
return {
|
|
49
|
+
backgroundColor: colors[chosenIndex],
|
|
50
|
+
color: theme.palette.getContrastText(colors[chosenIndex])
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function getColorByCategory(category, {
|
|
54
|
+
palette,
|
|
55
|
+
fallbackColor,
|
|
56
|
+
colorMapping
|
|
57
|
+
}) {
|
|
58
|
+
const assignedColor = colorMapping[category];
|
|
59
|
+
if (assignedColor) {
|
|
60
|
+
return colorMapping[category];
|
|
61
|
+
}
|
|
62
|
+
if (!palette || palette.length === 0) {
|
|
63
|
+
return fallbackColor;
|
|
64
|
+
}
|
|
65
|
+
const nextFreeColorIndex = Math.min(
|
|
66
|
+
Object.keys(colorMapping).length,
|
|
67
|
+
palette.length - 1
|
|
68
|
+
);
|
|
69
|
+
const newColor = palette[nextFreeColorIndex];
|
|
70
|
+
colorMapping[category] = newColor;
|
|
71
|
+
return newColor;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
getColorByCategory as a,
|
|
75
|
+
getPalette as b,
|
|
76
|
+
getCartoColorStylePropsForItem as g
|
|
77
|
+
};
|
package/dist/theme/index.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
-
const
|
|
5
|
+
const cssUtils = require("../css-utils-B9V_AMcv.cjs");
|
|
6
6
|
const jsxRuntime = require("react/jsx-runtime");
|
|
7
|
-
const cssUtils = require("../css-utils-CH7es90t.cjs");
|
|
8
7
|
const iconsMaterial = require("@mui/icons-material");
|
|
9
8
|
const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
|
|
10
9
|
const xDatePickers = require("@mui/x-date-pickers");
|
|
11
|
-
const MenuItem = require("../MenuItem-
|
|
10
|
+
const MenuItem = require("../MenuItem-BLZz_nSA.cjs");
|
|
11
|
+
const paletteUtils = require("../palette-utils-C5CHlLXB.cjs");
|
|
12
12
|
const themeShadows = [
|
|
13
13
|
"none",
|
|
14
14
|
// 0
|
|
@@ -2230,6 +2230,14 @@ const formsOverrides = {
|
|
|
2230
2230
|
defaultProps: {
|
|
2231
2231
|
size: 40,
|
|
2232
2232
|
thickness: 4
|
|
2233
|
+
},
|
|
2234
|
+
styleOverrides: {
|
|
2235
|
+
root: ({ theme: theme2 }) => ({
|
|
2236
|
+
// Not using standard ownerState to avoid MUI error trying to access non-existent theme.palette.neutral.main
|
|
2237
|
+
'&[data-color="neutral"]': {
|
|
2238
|
+
color: theme2.palette.text.hint
|
|
2239
|
+
}
|
|
2240
|
+
})
|
|
2233
2241
|
}
|
|
2234
2242
|
},
|
|
2235
2243
|
// Slider
|
|
@@ -3008,8 +3016,8 @@ const layoutOverrides = {
|
|
|
3008
3016
|
const CssBaseline = {
|
|
3009
3017
|
// Accessibility focus (keyboard only)
|
|
3010
3018
|
"*:focus-visible": {
|
|
3011
|
-
outline: `2px solid ${(_a =
|
|
3012
|
-
boxShadow: `0 0 0 4px ${(_b =
|
|
3019
|
+
outline: `2px solid ${(_a = cssUtils.commonPalette.primary) == null ? void 0 : _a.main} !important`,
|
|
3020
|
+
boxShadow: `0 0 0 4px ${(_b = cssUtils.commonPalette.primary) == null ? void 0 : _b.background} !important`,
|
|
3013
3021
|
borderRadius: "4px"
|
|
3014
3022
|
},
|
|
3015
3023
|
// Custom scrollbars
|
|
@@ -3028,7 +3036,7 @@ const CssBaseline = {
|
|
|
3028
3036
|
},
|
|
3029
3037
|
"*::-webkit-scrollbar-thumb": {
|
|
3030
3038
|
borderRadius: "3px",
|
|
3031
|
-
background: (_c =
|
|
3039
|
+
background: (_c = cssUtils.commonPalette.action) == null ? void 0 : _c.focus,
|
|
3032
3040
|
outline: "none"
|
|
3033
3041
|
},
|
|
3034
3042
|
// iOS Search clear button
|
|
@@ -3051,7 +3059,7 @@ const CssBaseline = {
|
|
|
3051
3059
|
textTransform: "none",
|
|
3052
3060
|
letterSpacing: "0.75px",
|
|
3053
3061
|
"& a": {
|
|
3054
|
-
color: (_d =
|
|
3062
|
+
color: (_d = cssUtils.commonPalette.primary) == null ? void 0 : _d.main
|
|
3055
3063
|
}
|
|
3056
3064
|
},
|
|
3057
3065
|
"&.mapboxgl-compact": {
|
|
@@ -3063,7 +3071,7 @@ const CssBaseline = {
|
|
|
3063
3071
|
bottom: cssUtils.getSpacing(0.5)
|
|
3064
3072
|
},
|
|
3065
3073
|
"& .mapboxgl-ctrl-attrib-button": {
|
|
3066
|
-
backgroundImage: `url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%3E%3Cg%3E%3Crect%20fill='none'%20height='24'%20width='24'%20x='0'/%3E%3C/g%3E%3Cg%3E%3Cg%3E%3Cg%3E%3Cpath%20d='M11.88,9.14c1.28,0.06,1.61,1.15,1.63,1.66h1.79c-0.08-1.98-1.49-3.19-3.45-3.19C9.64,7.61,8,9,8,12.14%20c0,1.94,0.93,4.24,3.84,4.24c2.22,0,3.41-1.65,3.44-2.95h-1.79c-0.03,0.59-0.45,1.38-1.63,1.44C10.55,14.83,10,13.81,10,12.14%20C10,9.25,11.28,9.16,11.88,9.14z%20M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z%20M12,20c-4.41,0-8-3.59-8-8%20s3.59-8,8-8s8,3.59,8,8S16.41,20,12,20z'%20fill='${(_e =
|
|
3074
|
+
backgroundImage: `url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%3E%3Cg%3E%3Crect%20fill='none'%20height='24'%20width='24'%20x='0'/%3E%3C/g%3E%3Cg%3E%3Cg%3E%3Cg%3E%3Cpath%20d='M11.88,9.14c1.28,0.06,1.61,1.15,1.63,1.66h1.79c-0.08-1.98-1.49-3.19-3.45-3.19C9.64,7.61,8,9,8,12.14%20c0,1.94,0.93,4.24,3.84,4.24c2.22,0,3.41-1.65,3.44-2.95h-1.79c-0.03,0.59-0.45,1.38-1.63,1.44C10.55,14.83,10,13.81,10,12.14%20C10,9.25,11.28,9.16,11.88,9.14z%20M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10S17.52,2,12,2z%20M12,20c-4.41,0-8-3.59-8-8%20s3.59-8,8-8s8,3.59,8,8S16.41,20,12,20z'%20fill='${(_e = cssUtils.commonPalette.text) == null ? void 0 : _e.secondary}'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,
|
|
3067
3075
|
backgroundColor: "rgba(255,255,255,.8)",
|
|
3068
3076
|
top: "auto",
|
|
3069
3077
|
bottom: 0,
|
|
@@ -3077,14 +3085,14 @@ const CssBaseline = {
|
|
|
3077
3085
|
padding: cssUtils.getSpacing(0.5, 1),
|
|
3078
3086
|
borderRadius: cssUtils.getSpacing(1.5),
|
|
3079
3087
|
marginRight: cssUtils.getSpacing(2.5),
|
|
3080
|
-
color: (_f =
|
|
3088
|
+
color: (_f = cssUtils.commonPalette.text) == null ? void 0 : _f.secondary
|
|
3081
3089
|
},
|
|
3082
3090
|
"&.mapboxgl-compact-show": {
|
|
3083
3091
|
"& .mapboxgl-ctrl-attrib-button": {
|
|
3084
3092
|
backgroundImage: `url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%3E%3Cpath%20d='M0%200h24v24H0z'%20fill='none'/%3E%3Cpath%20d='M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z'%20fill='white'/%3E%3C/svg%3E")`,
|
|
3085
|
-
backgroundColor: (_g =
|
|
3093
|
+
backgroundColor: (_g = cssUtils.commonPalette.common) == null ? void 0 : _g.black,
|
|
3086
3094
|
"&:not(:disabled):hover": {
|
|
3087
|
-
backgroundColor: (_h =
|
|
3095
|
+
backgroundColor: (_h = cssUtils.commonPalette.common) == null ? void 0 : _h.black
|
|
3088
3096
|
}
|
|
3089
3097
|
}
|
|
3090
3098
|
}
|
|
@@ -3129,7 +3137,7 @@ const cartoThemeOptions = {
|
|
|
3129
3137
|
}
|
|
3130
3138
|
}
|
|
3131
3139
|
},
|
|
3132
|
-
palette:
|
|
3140
|
+
palette: cssUtils.commonPalette,
|
|
3133
3141
|
shadows: themeShadows,
|
|
3134
3142
|
typography: themeTypography,
|
|
3135
3143
|
spacingValue: cssUtils.SPACING,
|
|
@@ -3185,7 +3193,6 @@ const cartoThemeOptions = {
|
|
|
3185
3193
|
}
|
|
3186
3194
|
};
|
|
3187
3195
|
const theme = material.responsiveFontSizes(material.createTheme(cartoThemeOptions));
|
|
3188
|
-
exports.getCartoColorStylePropsForItem = paletteUtils.getCartoColorStylePropsForItem;
|
|
3189
3196
|
exports.APPBAR_SIZE = cssUtils.APPBAR_SIZE;
|
|
3190
3197
|
exports.BREAKPOINTS = cssUtils.BREAKPOINTS;
|
|
3191
3198
|
exports.ICON_SIZE_LARGE = cssUtils.ICON_SIZE_LARGE;
|
|
@@ -3198,5 +3205,6 @@ exports.MENU_LIST_MAX_SIZE = cssUtils.MENU_LIST_MAX_SIZE;
|
|
|
3198
3205
|
exports.NOTIFICATION_DURATION_IN_MS = cssUtils.NOTIFICATION_DURATION_IN_MS;
|
|
3199
3206
|
exports.SPACING = cssUtils.SPACING;
|
|
3200
3207
|
exports.getSpacing = cssUtils.getSpacing;
|
|
3208
|
+
exports.getCartoColorStylePropsForItem = paletteUtils.getCartoColorStylePropsForItem;
|
|
3201
3209
|
exports.cartoThemeOptions = cartoThemeOptions;
|
|
3202
3210
|
exports.theme = theme;
|
package/dist/theme/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2
2
|
import { alpha, Tooltip, responsiveFontSizes, createTheme } from "@mui/material";
|
|
3
|
-
import { c as commonPalette } from "../
|
|
4
|
-
import {
|
|
3
|
+
import { T as Typography, a as TablePaginationActions, I as ICON_SIZE_LARGE, b as ICON_SIZE_MEDIUM, c as ICON_SIZE_SMALL, g as getSpacing, e as ellipsisStyles, M as MENU_ITEM_SIZE_DEFAULT, d as MENU_LIST_MAX_SIZE, f as MENU_ITEM_SIZE_DENSE, A as APPBAR_SIZE, h as commonPalette, B as BREAKPOINTS, S as SPACING } from "../css-utils-Cr7ZvmiF.js";
|
|
4
|
+
import { i, N } from "../css-utils-Cr7ZvmiF.js";
|
|
5
5
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
6
|
-
import { T as Typography, a as TablePaginationActions, I as ICON_SIZE_LARGE, b as ICON_SIZE_MEDIUM, c as ICON_SIZE_SMALL, g as getSpacing, e as ellipsisStyles, M as MENU_ITEM_SIZE_DEFAULT, d as MENU_LIST_MAX_SIZE, f as MENU_ITEM_SIZE_DENSE, A as APPBAR_SIZE, B as BREAKPOINTS, S as SPACING } from "../css-utils-CjUBRJVK.js";
|
|
7
|
-
import { h, N } from "../css-utils-CjUBRJVK.js";
|
|
8
6
|
import { Cancel, EventOutlined, ChevronRightOutlined, ChevronLeftOutlined, ExpandMoreOutlined, CheckCircleOutlined, InfoOutlined } from "@mui/icons-material";
|
|
9
7
|
import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
|
|
10
8
|
import { renderDigitalClockTimeView } from "@mui/x-date-pickers";
|
|
11
|
-
import { M as MenuItem } from "../MenuItem-
|
|
9
|
+
import { M as MenuItem } from "../MenuItem-CM00TU3e.js";
|
|
10
|
+
import { g } from "../palette-utils-D99Ib0kC.js";
|
|
12
11
|
const themeShadows = [
|
|
13
12
|
"none",
|
|
14
13
|
// 0
|
|
@@ -2230,6 +2229,14 @@ const formsOverrides = {
|
|
|
2230
2229
|
defaultProps: {
|
|
2231
2230
|
size: 40,
|
|
2232
2231
|
thickness: 4
|
|
2232
|
+
},
|
|
2233
|
+
styleOverrides: {
|
|
2234
|
+
root: ({ theme: theme2 }) => ({
|
|
2235
|
+
// Not using standard ownerState to avoid MUI error trying to access non-existent theme.palette.neutral.main
|
|
2236
|
+
'&[data-color="neutral"]': {
|
|
2237
|
+
color: theme2.palette.text.hint
|
|
2238
|
+
}
|
|
2239
|
+
})
|
|
2233
2240
|
}
|
|
2234
2241
|
},
|
|
2235
2242
|
// Slider
|
|
@@ -3193,7 +3200,7 @@ export {
|
|
|
3193
3200
|
ICON_SIZE_SMALL,
|
|
3194
3201
|
MENU_ITEM_SIZE_DEFAULT,
|
|
3195
3202
|
MENU_ITEM_SIZE_DENSE,
|
|
3196
|
-
|
|
3203
|
+
i as MENU_ITEM_SIZE_EXTENDED,
|
|
3197
3204
|
MENU_LIST_MAX_SIZE,
|
|
3198
3205
|
N as NOTIFICATION_DURATION_IN_MS,
|
|
3199
3206
|
SPACING,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CircularProgressProps as MuiCircularProgressProps } from '@mui/material';
|
|
2
|
+
export type CircularProgressProps = Omit<MuiCircularProgressProps, 'color' | 'ref'> & {
|
|
3
|
+
/**
|
|
4
|
+
* The color of the component.
|
|
5
|
+
* It supports primary, secondary, error, info, success, warning and neutral colors.
|
|
6
|
+
* @default 'primary'
|
|
7
|
+
*/
|
|
8
|
+
color?: MuiCircularProgressProps['color'] | 'neutral';
|
|
9
|
+
};
|
|
10
|
+
declare const CircularProgress: import('react').ForwardRefExoticComponent<Omit<MuiCircularProgressProps, "color" | "ref"> & {
|
|
11
|
+
/**
|
|
12
|
+
* The color of the component.
|
|
13
|
+
* It supports primary, secondary, error, info, success, warning and neutral colors.
|
|
14
|
+
* @default 'primary'
|
|
15
|
+
*/
|
|
16
|
+
color?: MuiCircularProgressProps["color"] | "neutral";
|
|
17
|
+
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
18
|
+
export default CircularProgress;
|
|
19
|
+
//# sourceMappingURL=CircularProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularProgress/CircularProgress.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,qBAAqB,IAAI,wBAAwB,EAClD,MAAM,eAAe,CAAA;AAEtB,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,wBAAwB,EACxB,OAAO,GAAG,KAAK,CAChB,GAAG;IACF;;;;OAIG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;CACtD,CAAA;AA+BD,QAAA,MAAM,gBAAgB;IArCpB;;;;OAIG;YACK,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAAS;mDAkCtD,CAAA;AACD,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CircularProgressProps } from './CircularProgress';
|
|
2
|
+
declare const options: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('@mui/material').CircularProgressProps, "color" | "ref"> & {
|
|
5
|
+
color?: import('@mui/material').CircularProgressProps["color"] | "neutral";
|
|
6
|
+
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
tags: string[];
|
|
8
|
+
argTypes: {
|
|
9
|
+
color: {
|
|
10
|
+
control: "select";
|
|
11
|
+
options: string[];
|
|
12
|
+
};
|
|
13
|
+
size: {
|
|
14
|
+
control: "select";
|
|
15
|
+
options: number[];
|
|
16
|
+
};
|
|
17
|
+
thickness: {
|
|
18
|
+
control: "number";
|
|
19
|
+
};
|
|
20
|
+
variant: {
|
|
21
|
+
control: "select";
|
|
22
|
+
options: string[];
|
|
23
|
+
};
|
|
24
|
+
value: {
|
|
25
|
+
control: "number";
|
|
26
|
+
if: {
|
|
27
|
+
arg: string;
|
|
28
|
+
eq: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
args: {
|
|
33
|
+
color: string;
|
|
34
|
+
size: number;
|
|
35
|
+
thickness: number;
|
|
36
|
+
variant: string;
|
|
37
|
+
};
|
|
38
|
+
parameters: {
|
|
39
|
+
design: {
|
|
40
|
+
type: string;
|
|
41
|
+
url: string;
|
|
42
|
+
};
|
|
43
|
+
status: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
chromatic: {
|
|
47
|
+
diffThreshold: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export default options;
|
|
52
|
+
export declare const Playground: {
|
|
53
|
+
render: (args: CircularProgressProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
parameters: {
|
|
55
|
+
chromatic: {
|
|
56
|
+
disableSnapshot: boolean;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const Color: {
|
|
61
|
+
render: (args: CircularProgressProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
};
|
|
63
|
+
export declare const Size: {
|
|
64
|
+
render: (args: CircularProgressProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
};
|
|
66
|
+
export declare const Thickness: {
|
|
67
|
+
render: (args: CircularProgressProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
};
|
|
69
|
+
export declare const Variant: {
|
|
70
|
+
render: (args: CircularProgressProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=CircularProgress.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularProgress/CircularProgress.stories.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAG5E,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDG,CAAA;AAChB,eAAe,OAAO,CAAA;AAsItB,eAAO,MAAM,UAAU;mBApIC,qBAAqB;;;;;;CAyI5C,CAAA;AAED,eAAO,MAAM,KAAK;mBAzIW,qBAAqB;CA2IjD,CAAA;AAED,eAAO,MAAM,IAAI;mBAtFW,qBAAqB;CAwFhD,CAAA;AAED,eAAO,MAAM,SAAS;mBAjEW,qBAAqB;CAmErD,CAAA;AAED,eAAO,MAAM,OAAO;mBA5CW,qBAAqB;CA8CnD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.test.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularProgress/CircularProgress.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularProgress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAChE,mBAAmB,oBAAoB,CAAA"}
|