@carto/meridian-ds 4.1.0 → 4.1.1-alpha.5403cc9.295
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 +3 -0
- package/dist/{TablePaginationActions-XEVsnuDF.js → TablePaginationActions-BvKjTAmB.js} +1 -1
- package/dist/bin/meridian-ds-mcp.js +73 -0
- package/dist/components/index.js +3 -3
- package/dist/conventions.md +3 -1
- package/dist/icons-screenshot.webp +0 -0
- package/dist/metadata.json +2613 -3
- package/dist/{palette-utils-F7dMdI2q.js → palette-utils-d-9NY8qw.js} +3 -3
- package/dist/theme/index.cjs +75 -75
- package/dist/theme/index.js +78 -78
- package/dist/types/components/List/List.metadata.d.ts.map +1 -1
- package/dist/types/custom-icons/__docs__/icon-keywords.d.ts +284 -0
- package/dist/types/custom-icons/__docs__/icon-keywords.d.ts.map +1 -0
- package/dist/types/theme/base-theme-options.d.ts +1775 -0
- package/dist/types/theme/base-theme-options.d.ts.map +1 -0
- package/dist/types/theme/carto-theme.d.ts +1803 -1804
- package/dist/types/theme/carto-theme.d.ts.map +1 -1
- package/dist/widgets/index.js +1 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- feat(ai-metadata): serve custom-icon and theme-token knowledge to AI agents — new `meridian_list_icons` and `meridian_get_tokens` MCP tools (icons searchable by curated keywords; tokens projected straight from the composed theme: palette / typography / spacing / shape / breakpoints / shadows), plus surfaced List `direction`/`spacing` props [#463](https://github.com/CartoDB/meridian-ds/pull/463) [sc-559510] [sc-559550]
|
|
6
|
+
- feat: add Claude AI PR review workflow (sc-561354) [#471](https://github.com/CartoDB/meridian-ds/pull/471)
|
|
7
|
+
|
|
5
8
|
## 4.0
|
|
6
9
|
|
|
7
10
|
### 4.1.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-
|
|
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";
|
|
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";
|
|
@@ -32,6 +32,9 @@ function resolveBundlePath() {
|
|
|
32
32
|
}
|
|
33
33
|
var DOCS = [];
|
|
34
34
|
var KNOWN = [];
|
|
35
|
+
var ICONS = [];
|
|
36
|
+
var TOKENS;
|
|
37
|
+
var SCREENSHOTS = {};
|
|
35
38
|
var CONVENTIONS = "";
|
|
36
39
|
var VERSION = "0.0.0";
|
|
37
40
|
var TOOLS = [
|
|
@@ -80,6 +83,38 @@ var TOOLS = [
|
|
|
80
83
|
properties: {},
|
|
81
84
|
additionalProperties: false
|
|
82
85
|
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "meridian_list_icons",
|
|
89
|
+
description: "List every Meridian custom icon by name, with search keywords where curated (e.g. Bigquery \u2192 warehouse/database). There's no search tool \u2014 match by meaning against the name + keywords. Import the one you pick from '@carto/meridian-ds/custom-icons' and render it as `<Name />`. All icons share one prop type (CustomIconProps): MUI SvgIconProps \u2014 `color`, `fontSize`, `sx`, \u2026 \u2014 plus `width`/`height`; the result's `props` field has the details and the .d.ts pointer. Prefer a Meridian custom icon over an ad-hoc SVG or a MUI icon.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {},
|
|
93
|
+
additionalProperties: false
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "meridian_get_tokens",
|
|
98
|
+
description: "The design tokens (exact values) to reference instead of hardcoding: palette (semantic text/background/action/divider, the intents, and the color scales), the typography ramp (per-variant fontSize/fontWeight/lineHeight/letterSpacing), spacing base, shape.borderRadius, breakpoints, and shadows. Use these with the rules in meridian_get_conventions (which says to use tokens, not raw hex/px) \u2014 this tool supplies the actual values. Projected from the theme, so it always matches the installed Meridian version. These are theme-level tokens (the global palette/type/spacing scale); for a component's internal spacing (e.g. Button padding, List row gap) use meridian_get_component, not this.",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: "object",
|
|
101
|
+
properties: {},
|
|
102
|
+
additionalProperties: false
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "meridian_get_screenshot",
|
|
107
|
+
description: "Returns the filesystem path to a labeled reference screenshot. name='icons' is a grid of EVERY custom icon (each glyph captioned with its import name). Read that image to visually confirm an icon you shortlisted from meridian_list_icons, or to match one in a design you're implementing, then use its exact name. Deliberately returns a path (not an inline image) \u2014 portable, cheap per call, and reusable by a consumer app's picker. Requires a runtime that can read images (e.g. Claude Code); headless/non-multimodal callers can skip it. Call with no name to list the available screenshots.",
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
name: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Which screenshot to return (e.g. 'icons'). Omit to list the available ones."
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
additionalProperties: false
|
|
117
|
+
}
|
|
83
118
|
}
|
|
84
119
|
];
|
|
85
120
|
var find = (name) => DOCS.find((d) => d.name.toLowerCase() === String(name).toLowerCase());
|
|
@@ -250,10 +285,33 @@ Fetch any with meridian_get_examples(storyId):
|
|
|
250
285
|
}
|
|
251
286
|
return md;
|
|
252
287
|
}
|
|
288
|
+
function getScreenshot(name) {
|
|
289
|
+
const available = Object.keys(SCREENSHOTS);
|
|
290
|
+
const shot = name ? SCREENSHOTS[name] : void 0;
|
|
291
|
+
if (!shot || !fs.existsSync(shot.path))
|
|
292
|
+
return name ? {
|
|
293
|
+
error: `No screenshot named "${name}". Available: ${available.join(", ") || "(none \u2014 run `yarn metadata:screenshots` and rebuild)"}.`
|
|
294
|
+
} : { available };
|
|
295
|
+
return { path: shot.path, count: shot.count, hint: shot.hint };
|
|
296
|
+
}
|
|
297
|
+
function listIcons() {
|
|
298
|
+
return {
|
|
299
|
+
note: "Import from '@carto/meridian-ds/custom-icons' and render as <Name />. Match by name or keywords \u2014 there's no search tool. To see the glyphs, call meridian_get_screenshot({name:'icons'}) and Read the returned image path.",
|
|
300
|
+
props: "Every icon is an identical forwardRef component sharing one prop type, CustomIconProps: MUI SvgIconProps \u2014 color, fontSize ('small'|'medium'|'large'|'inherit'), sx, htmlColor, titleAccess \u2014 plus width/height (number|string) to override the fontSize-based size. Prefer color/fontSize for theming/sizing; width/height only for a specific px size. The exact type ships at node_modules/@carto/meridian-ds/dist/types/custom-icons/types.d.ts (the per-icon <Name>.d.ts is identical boilerplate \u2014 no icon-specific props).",
|
|
301
|
+
count: ICONS.length,
|
|
302
|
+
icons: ICONS
|
|
303
|
+
};
|
|
304
|
+
}
|
|
253
305
|
function callTool(name, args) {
|
|
254
306
|
switch (name) {
|
|
255
307
|
case "meridian_list_components":
|
|
256
308
|
return listComponents();
|
|
309
|
+
case "meridian_list_icons":
|
|
310
|
+
return listIcons();
|
|
311
|
+
case "meridian_get_tokens":
|
|
312
|
+
return TOKENS ?? { error: "No tokens in this bundle." };
|
|
313
|
+
case "meridian_get_screenshot":
|
|
314
|
+
return getScreenshot(String(args.name ?? ""));
|
|
257
315
|
case "meridian_get_component":
|
|
258
316
|
return getComponent(String(args.name ?? ""));
|
|
259
317
|
case "meridian_get_examples":
|
|
@@ -276,6 +334,9 @@ Flow:
|
|
|
276
334
|
2. meridian_list_components \u2014 read the (small) catalog and pick by description + keywords. There is no search tool; match by meaning (the model already knows "picker" \u2248 "dropdown" \u2248 "select").
|
|
277
335
|
3. meridian_get_component(name) \u2014 when to use it, its decisionTree (conditions that point to a different component), and the high-value inherited MUI props worth knowing (curation.mui; some carry an aiHint). It also returns the example story ids.
|
|
278
336
|
4. meridian_get_examples(name[, storyId]) \u2014 real, copy-able example code. With no storyId: the lead usage story and the notable stories in full plus a list of the rest; pass a storyId for one story's full code.
|
|
337
|
+
5. meridian_list_icons \u2014 when you need an icon, list the custom icons and match by name/keyword; import from '@carto/meridian-ds/custom-icons' and render as <Name />.
|
|
338
|
+
6. meridian_get_tokens \u2014 exact palette/typography/spacing/shape/breakpoint/shadow values to use instead of hardcoding (the conventions say use tokens; this gives the values).
|
|
339
|
+
7. meridian_get_screenshot \u2014 a labeled reference image (name='icons' \u2192 every icon); Read the returned path to visually confirm a shortlisted icon or match one from a design (image-capable runtimes only).
|
|
279
340
|
|
|
280
341
|
Three tiers of components, by how much each carries (all are real and importable \u2014 always prefer one over a bare MUI equivalent): CURATED (most) have full when-to-use / decisionTree / promoted-prop guidance; LISTED (flagged "documented": false, with example stories) carry no curation yet \u2014 lean on get_examples + the .d.ts; KNOWN (flagged "documented": false, no stories) are real components not yet documented \u2014 get_component/get_examples point you at their type declarations (.d.ts).
|
|
281
342
|
|
|
@@ -334,6 +395,18 @@ function load() {
|
|
|
334
395
|
);
|
|
335
396
|
DOCS = bundle.components;
|
|
336
397
|
KNOWN = bundle.knownComponents ?? [];
|
|
398
|
+
ICONS = bundle.icons ?? [];
|
|
399
|
+
TOKENS = bundle.tokens;
|
|
400
|
+
SCREENSHOTS = Object.fromEntries(
|
|
401
|
+
Object.entries(bundle.screenshots ?? {}).map(([key, s]) => [
|
|
402
|
+
key,
|
|
403
|
+
{
|
|
404
|
+
path: path.join(path.dirname(bundlePath), s.file),
|
|
405
|
+
count: s.count,
|
|
406
|
+
hint: s.hint
|
|
407
|
+
}
|
|
408
|
+
])
|
|
409
|
+
);
|
|
337
410
|
CONVENTIONS = bundle.conventions;
|
|
338
411
|
VERSION = bundle.version;
|
|
339
412
|
process.stderr.write(
|
package/dist/components/index.js
CHANGED
|
@@ -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-
|
|
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";
|
|
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-
|
|
10
|
-
import { T } from "../TablePaginationActions-
|
|
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";
|
|
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";
|
package/dist/conventions.md
CHANGED
|
@@ -21,6 +21,8 @@ Meridian is the source of truth: when an existing codebase pattern contradicts M
|
|
|
21
21
|
- Source icons from Meridian's custom-icons first, then `@mui/icons-material`;
|
|
22
22
|
add a local SVG only when neither has an equivalent. Don't duplicate an icon
|
|
23
23
|
the design system already ships.
|
|
24
|
+
- 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`).
|
|
25
|
+
- 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.
|
|
24
26
|
- Use the standard icon sizes — small 12px, medium (default) 18px, large 24px;
|
|
25
27
|
a value off this scale (e.g. 16, 20) needs design sign-off. Prefer the
|
|
26
28
|
outlined variants.
|
|
@@ -47,7 +49,7 @@ Meridian is the source of truth: when an existing codebase pattern contradicts M
|
|
|
47
49
|
|
|
48
50
|
## Styling
|
|
49
51
|
|
|
50
|
-
- 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.
|
|
52
|
+
- 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`.
|
|
51
53
|
- Text uses `<Typography variant=…>` (with the `weight` prop for emphasis), never hardcoded `fontSize`/`fontWeight`/`lineHeight`/`fontFamily`.
|
|
52
54
|
- 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.
|
|
53
55
|
- `sx` is the right tool for one-off layout/spacing on primitives (`Box`/`Grid`/`Stack`), not the deprecated MUI system props
|
|
Binary file
|