@carto/meridian-ds 3.0.2-alpha.e0198a6.235 → 3.0.2-alpha.e34a00a.237
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/ai-metadata/generated/metadata.json +261 -0
- package/dist/bin/meridian-ds-mcp.js +212 -0
- package/dist/components/index.cjs +2 -119
- package/dist/components/index.js +3 -120
- package/dist/types/components/Button/Button.d.ts +10 -0
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Button/Button.metadata.d.ts +20 -0
- package/dist/types/components/Button/Button.metadata.d.ts.map +1 -0
- package/dist/types/components/IconButton/IconButton.d.ts +45 -2
- package/dist/types/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/types/components/IconButton/IconButton.metadata.d.ts +16 -0
- package/dist/types/components/IconButton/IconButton.metadata.d.ts.map +1 -0
- package/dist/types/components/SplitButton/SplitButton.d.ts +31 -0
- package/dist/types/components/SplitButton/SplitButton.d.ts.map +1 -1
- package/dist/types/components/SplitButton/SplitButton.metadata.d.ts +10 -0
- package/dist/types/components/SplitButton/SplitButton.metadata.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +15 -4
- package/dist/types/components/IconWrapper/IconWrapper.d.ts +0 -46
- package/dist/types/components/IconWrapper/IconWrapper.d.ts.map +0 -1
- package/dist/types/components/IconWrapper/IconWrapper.figma.d.ts +0 -11
- package/dist/types/components/IconWrapper/IconWrapper.figma.d.ts.map +0 -1
- package/dist/types/components/IconWrapper/IconWrapper.stories.d.ts +0 -86
- package/dist/types/components/IconWrapper/IconWrapper.stories.d.ts.map +0 -1
- package/dist/types/components/IconWrapper/index.d.ts +0 -3
- package/dist/types/components/IconWrapper/index.d.ts.map +0 -1
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "3.0.2-alpha.e34a00a.237",
|
|
3
|
+
"conventions": "# Meridian usage conventions (for code-generating agents)\n\nSystem-level rules an agent should apply across all components. These are the\ncross-cutting opinions that don't belong to any single component, so they live\nhere once instead of being copied into every component's metadata.\n\n## Choosing a component\n\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.\n- Resolve \"which component\" by reading each one's `description` + `keywords`,\n then confirm with its `alternatives`. Don't infer selection from prop lists.\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\n with a tooltip explaining the requirement.\n\n## Props\n\n- Exact props, types, and JSDoc come from the package's type declarations —\n `import` the component and let your IDE/tsc show the signature. Don't guess a\n prop name; the compiler validates it.\n- A component's curation lists the high-value inherited MUI props worth knowing\n (`curation.mui`, e.g. `color`/`variant`/`size`); the rest of MUI's surface is\n available but rarely needed.\n- Never pass `sx`/inline styles to restyle a component; use its documented props\n and the theme tokens.\n\n## Examples\n\n- Canonical, tested usage lives in the component's Storybook stories. Call\n `meridian_get_examples` for a component to get that source — never invent example\n code when a story exists.\n",
|
|
4
|
+
"components": [
|
|
5
|
+
{
|
|
6
|
+
"name": "Button",
|
|
7
|
+
"description": "Standard action button for user-triggered actions. Supports loading state and rendering as an external link.",
|
|
8
|
+
"curation": {
|
|
9
|
+
"keywords": [
|
|
10
|
+
"button",
|
|
11
|
+
"action",
|
|
12
|
+
"submit",
|
|
13
|
+
"cta",
|
|
14
|
+
"call to action",
|
|
15
|
+
"primary action",
|
|
16
|
+
"click"
|
|
17
|
+
],
|
|
18
|
+
"mui": [
|
|
19
|
+
"color",
|
|
20
|
+
"variant",
|
|
21
|
+
"size",
|
|
22
|
+
"startIcon",
|
|
23
|
+
"endIcon",
|
|
24
|
+
"fullWidth",
|
|
25
|
+
"disabled",
|
|
26
|
+
"href"
|
|
27
|
+
],
|
|
28
|
+
"alternatives": [
|
|
29
|
+
{
|
|
30
|
+
"when": "The action is icon-only with no text label",
|
|
31
|
+
"use": "IconButton"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"when": "One primary action plus a menu of related actions",
|
|
35
|
+
"use": "SplitButton"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"when": "Navigating to a URL rather than triggering an action",
|
|
39
|
+
"use": "Link"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"when": "Toggling an on/off state",
|
|
43
|
+
"use": "ToggleButton",
|
|
44
|
+
"mui": true
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"gotchas": [
|
|
48
|
+
"Set `loading` during async work; pair with `loadingPosition` to keep a start/end icon visible.",
|
|
49
|
+
"For external links set `external` + `href` — it opens in a new tab and appends an external icon."
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"examples": [
|
|
53
|
+
{
|
|
54
|
+
"name": "Playground",
|
|
55
|
+
"id": "button--playground",
|
|
56
|
+
"code": "export const Playground = {\n render: PlaygroundTemplate,\n args: { children: 'Button text' },\n parameters: {\n ...interactiveStoryParameters,\n },\n}"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Guide",
|
|
60
|
+
"id": "button--guide",
|
|
61
|
+
"code": "export const Guide = {\n render: DocTemplate,\n parameters: {\n ...documentationStoryParameters,\n },\n}"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "Variants",
|
|
65
|
+
"id": "button--variants",
|
|
66
|
+
"code": "export const Variants = {\n render: AllVariantsTemplate,\n}"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "Colors",
|
|
70
|
+
"id": "button--colors",
|
|
71
|
+
"code": "export const Colors = {\n render: AllColorsTemplate,\n}"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "Behavior",
|
|
75
|
+
"id": "button--behavior",
|
|
76
|
+
"code": "export const Behavior = {\n render: BehaviorTemplate,\n args: { children: 'Button text' },\n}"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "ExternalLink",
|
|
80
|
+
"id": "button--external-link",
|
|
81
|
+
"code": "export const ExternalLink = {\n render: ExternalLinkTemplate,\n args: {\n children: 'External Button',\n href: 'https://carto.com',\n external: true,\n },\n}"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "PseudoHover",
|
|
85
|
+
"id": "button--pseudo-hover",
|
|
86
|
+
"code": "export const PseudoHover = {\n render: AllColorsTemplate,\n ...pseudoStory({ hover: true }),\n}"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "PseudoFocusVisible",
|
|
90
|
+
"id": "button--pseudo-focus-visible",
|
|
91
|
+
"code": "export const PseudoFocusVisible = {\n render: AllColorsTemplate,\n ...pseudoStory({ focusVisible: PSEUDO_SELECTORS.buttonBase }),\n}"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "IconButton",
|
|
97
|
+
"description": "Compact icon-only button for actions where a label would add noise (toolbars, table rows, close affordances). Supports tooltip, loading state, and multiple visual variants. Always provide an accessible label via tooltip or aria-label.",
|
|
98
|
+
"curation": {
|
|
99
|
+
"keywords": [
|
|
100
|
+
"icon button",
|
|
101
|
+
"icon action",
|
|
102
|
+
"icon click",
|
|
103
|
+
"icon-only",
|
|
104
|
+
"toolbar button",
|
|
105
|
+
"close button",
|
|
106
|
+
"delete icon",
|
|
107
|
+
"edit icon",
|
|
108
|
+
"round button"
|
|
109
|
+
],
|
|
110
|
+
"mui": [
|
|
111
|
+
"color",
|
|
112
|
+
"disabled",
|
|
113
|
+
"size"
|
|
114
|
+
],
|
|
115
|
+
"alternatives": [
|
|
116
|
+
{
|
|
117
|
+
"when": "The action benefits from a visible text label",
|
|
118
|
+
"use": "Button"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"when": "The control toggles between selected/unselected states",
|
|
122
|
+
"use": "ToggleButton",
|
|
123
|
+
"mui": true
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"gotchas": [
|
|
127
|
+
"Always provide `tooltip` (or an aria-label) — an icon-only button has no accessible name otherwise; the tooltip works even when disabled.",
|
|
128
|
+
"The `active` prop is deprecated; use ToggleButton for on/off state.",
|
|
129
|
+
"Use `loading` for async actions — it swaps the icon for a spinner and disables the button."
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"examples": [
|
|
133
|
+
{
|
|
134
|
+
"name": "Playground",
|
|
135
|
+
"id": "icon-button--playground",
|
|
136
|
+
"code": "export const Playground = {\n render: PlaygroundTemplate,\n args: { label: 'Icon Button' },\n parameters: {\n ...interactiveStoryParameters,\n },\n}"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "Tooltip",
|
|
140
|
+
"id": "icon-button--tooltip",
|
|
141
|
+
"code": "export const Tooltip = {\n render: TooltipsTemplate,\n argTypes: {\n tooltip: { table: { disable: true } },\n tooltipPlacement: { table: { disable: true } },\n disabled: { table: { disable: true } },\n },\n}"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "InteractionTooltipEnabled",
|
|
145
|
+
"id": "icon-button--interaction-tooltip-enabled",
|
|
146
|
+
"code": "export const InteractionTooltipEnabled = {\n render: (args: IconButtonProps) => (\n <Box mt={6}>\n <IconButton {...args} icon={<CheckCircleOutlined />} tooltip='Save' />\n </Box>\n ),\n tags: ['interaction'],\n argTypes: disabledTooltipArgTypes,\n parameters: {\n ...chromaticTransitionDelay,\n },\n play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {\n const canvas = within(canvasElement)\n const button = canvas.getByRole('button', { name: 'Save' })\n await expect(button).toBeEnabled()\n await expectTooltipOnHover(button, /^Save$/)\n },\n}"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "InteractionTooltipDisabled",
|
|
150
|
+
"id": "icon-button--interaction-tooltip-disabled",
|
|
151
|
+
"code": "export const InteractionTooltipDisabled = {\n render: (args: IconButtonProps) => (\n <Box mt={6}>\n <IconButton\n {...args}\n icon={<CheckCircleOutlined />}\n disabled\n tooltip='Delete'\n tooltipPlacement='bottom'\n />\n </Box>\n ),\n tags: ['interaction'],\n argTypes: disabledTooltipArgTypes,\n parameters: {\n ...chromaticTransitionDelay,\n docs: {\n description: {\n story:\n 'A disabled IconButton still surfaces its tooltip — MUI wraps disabled buttons in a span so hover events reach the Tooltip. `tooltipPlacement=\"bottom\"` shifts the tooltip below the button.',\n },\n },\n },\n play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {\n const canvas = within(canvasElement)\n const button = canvas.getByRole('button', { name: 'Delete' })\n await expect(button).toBeDisabled()\n await expectTooltipOnHover(button, /^Delete$/)\n },\n}"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "Variants",
|
|
155
|
+
"id": "icon-button--variants",
|
|
156
|
+
"code": "export const Variants = {\n render: VariantTemplate,\n}"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "Colors",
|
|
160
|
+
"id": "icon-button--colors",
|
|
161
|
+
"code": "export const Colors = {\n render: ColorsTemplate,\n argTypes: {\n color: { table: { disable: true } },\n },\n}"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "AccessibilityGuide",
|
|
165
|
+
"id": "icon-button--accessibility-guide",
|
|
166
|
+
"code": "export const AccessibilityGuide = {\n render: AccessibilityGuideTemplate,\n parameters: {\n controls: { disable: true },\n docs: {\n description: {\n story: 'Guidelines for making IconButtons accessible and testable.',\n },\n canvas: { sourceState: 'hidden' },\n },\n chromatic: { disableSnapshot: true },\n },\n}"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "PseudoHover",
|
|
170
|
+
"id": "icon-button--pseudo-hover",
|
|
171
|
+
"code": "export const PseudoHover = {\n render: ColorsTemplate,\n ...pseudoStory({ hover: true }),\n}"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "PseudoFocusVisible",
|
|
175
|
+
"id": "icon-button--pseudo-focus-visible",
|
|
176
|
+
"code": "export const PseudoFocusVisible = {\n render: ColorsTemplate,\n ...pseudoStory({ focusVisible: PSEUDO_SELECTORS.buttonBase }),\n}"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "SplitButton",
|
|
182
|
+
"description": "Button paired with a dropdown of related alternative actions. The first option is the default click action; the dropdown exposes the rest. Use when there is one primary action plus a small set of close variants (e.g. Save / Save as / Save and close).",
|
|
183
|
+
"curation": {
|
|
184
|
+
"keywords": [
|
|
185
|
+
"dropdown",
|
|
186
|
+
"dropdown button",
|
|
187
|
+
"button group",
|
|
188
|
+
"action dropdown",
|
|
189
|
+
"menu",
|
|
190
|
+
"picker",
|
|
191
|
+
"chooser",
|
|
192
|
+
"select action",
|
|
193
|
+
"split button",
|
|
194
|
+
"action menu",
|
|
195
|
+
"more actions",
|
|
196
|
+
"export options"
|
|
197
|
+
],
|
|
198
|
+
"alternatives": [
|
|
199
|
+
{
|
|
200
|
+
"when": "There is only one action",
|
|
201
|
+
"use": "Button"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"when": "The action is icon-only",
|
|
205
|
+
"use": "IconButton"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"when": "Selecting a value rather than triggering an action",
|
|
209
|
+
"use": "SelectField"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"gotchas": [
|
|
213
|
+
"Pass `options` as an array of `{ label }` objects; `onClick` receives the chosen option.",
|
|
214
|
+
"Visual props (`variant`, `size`, `loading`) mirror Button."
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
"examples": [
|
|
218
|
+
{
|
|
219
|
+
"name": "Playground",
|
|
220
|
+
"id": "split-button--playground",
|
|
221
|
+
"code": "export const Playground = {\n render: PlaygroundTemplate,\n parameters: {\n ...interactiveStoryParameters,\n },\n}"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "Interaction",
|
|
225
|
+
"id": "split-button--interaction",
|
|
226
|
+
"code": "export const Interaction = {\n render: PlaygroundTemplate,\n tags: ['interaction', '!autodocs'],\n play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {\n const canvas = within(canvasElement)\n\n // Main action shows the currently selected option label (first by default).\n await expect(canvas.getByRole('button', { name: 'Item 1' })).toBeVisible()\n\n // Toggle button uses the translated `Show options` aria-label.\n const toggle = canvas.getByRole('button', { name: /show options/i })\n await expectTooltipOnHover(toggle, /^Show options$/)\n\n await userEvent.click(toggle)\n const menu = await screen.findByRole('menu')\n await waitFor(() => expect(menu).toBeVisible())\n\n await userEvent.click(\n within(menu).getByRole('menuitem', { name: 'Item 2' }),\n )\n await waitFor(() =>\n expect(screen.queryByRole('menu')).not.toBeInTheDocument(),\n )\n await expect(canvas.getByRole('button', { name: 'Item 2' })).toBeVisible()\n },\n}"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "InteractionDisabledTooltip",
|
|
230
|
+
"id": "split-button--interaction-disabled-tooltip",
|
|
231
|
+
"code": "export const InteractionDisabledTooltip = {\n render: PlaygroundTemplate,\n tags: ['interaction', '!autodocs'],\n args: { disabled: true },\n parameters: {\n ...chromaticTransitionDelay,\n docs: {\n description: {\n story:\n 'A disabled SplitButton still surfaces its toggle tooltip — the toggle Button is wrapped in a span so MUI Tooltip can listen to events even when the underlying button is disabled.',\n },\n },\n },\n play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {\n const canvas = within(canvasElement)\n const toggle = canvas.getByRole('button', { name: /show options/i })\n await expect(toggle).toBeDisabled()\n await expectTooltipOnHover(toggle, /^Show options$/)\n },\n}"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "Guide",
|
|
235
|
+
"id": "split-button--guide",
|
|
236
|
+
"code": "export const Guide = {\n render: DocTemplate,\n parameters: {\n ...documentationStoryParameters,\n },\n}"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "Variants",
|
|
240
|
+
"id": "split-button--variants",
|
|
241
|
+
"code": "export const Variants = {\n render: AllVariantsTemplate,\n}"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "States",
|
|
245
|
+
"id": "split-button--states",
|
|
246
|
+
"code": "export const States = {\n render: StatesTemplate,\n}"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "Colors",
|
|
250
|
+
"id": "split-button--colors",
|
|
251
|
+
"code": "export const Colors = {\n render: AllColorsTemplate,\n}"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "PseudoHover",
|
|
255
|
+
"id": "split-button--pseudo-hover",
|
|
256
|
+
"code": "export const PseudoHover = {\n render: AllVariantsAndColorsTemplate,\n ...pseudoStory({ hover: true }),\n}"
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// ai-metadata/mcp/server.ts
|
|
4
|
+
import * as fs from "fs";
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
import { createRequire } from "module";
|
|
8
|
+
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
function resolveBundlePath() {
|
|
10
|
+
if (process.env.MERIDIAN_DS_METADATA) return process.env.MERIDIAN_DS_METADATA;
|
|
11
|
+
try {
|
|
12
|
+
return createRequire(import.meta.url).resolve("@carto/meridian-ds/metadata");
|
|
13
|
+
} catch {
|
|
14
|
+
let dir = __dirname;
|
|
15
|
+
for (let i = 0; i < 6; i++) {
|
|
16
|
+
const candidate = path.join(
|
|
17
|
+
dir,
|
|
18
|
+
"ai-metadata",
|
|
19
|
+
"generated",
|
|
20
|
+
"metadata.json"
|
|
21
|
+
);
|
|
22
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
23
|
+
dir = path.dirname(dir);
|
|
24
|
+
}
|
|
25
|
+
return path.resolve(__dirname, "..", "generated", "metadata.json");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
var DOCS = [];
|
|
29
|
+
var CONVENTIONS = "";
|
|
30
|
+
var VERSION = "0.0.0";
|
|
31
|
+
var TOOLS = [
|
|
32
|
+
{
|
|
33
|
+
name: "meridian_list_components",
|
|
34
|
+
description: "List all Meridian components with their description, search keywords, and example count. Start here: the catalog is small, so read it and pick the component whose description/keywords match your need.",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {},
|
|
38
|
+
additionalProperties: false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "meridian_get_component",
|
|
43
|
+
description: "Curation for one component \u2014 when to use it, alternatives, gotchas, the high-value inherited MUI props worth knowing (curation.mui), and its example story ids. Props & exact types come from the package .d.ts (import the component; your IDE/tsc has them). Call meridian_get_examples for example code.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
name: { type: "string", description: 'Component name, e.g. "Button"' }
|
|
48
|
+
},
|
|
49
|
+
required: ["name"],
|
|
50
|
+
additionalProperties: false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "meridian_get_examples",
|
|
55
|
+
description: "Real, copy-able example code for a component (one entry per Storybook story: name, id, source), shipped in the package.",
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: "object",
|
|
58
|
+
properties: {
|
|
59
|
+
name: { type: "string", description: 'Component name, e.g. "Button"' }
|
|
60
|
+
},
|
|
61
|
+
required: ["name"],
|
|
62
|
+
additionalProperties: false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "meridian_get_conventions",
|
|
67
|
+
description: "System-wide Meridian usage conventions an agent should apply when generating code (selection, a11y, props, examples).",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {},
|
|
71
|
+
additionalProperties: false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
var find = (name) => DOCS.find((d) => d.name.toLowerCase() === String(name).toLowerCase());
|
|
76
|
+
var notFound = (name) => ({
|
|
77
|
+
error: `Unknown component "${name}". Available: ${DOCS.map((d) => d.name).join(", ")}`
|
|
78
|
+
});
|
|
79
|
+
function listComponents() {
|
|
80
|
+
return DOCS.map((d) => ({
|
|
81
|
+
name: d.name,
|
|
82
|
+
description: d.description,
|
|
83
|
+
keywords: d.curation.keywords ?? [],
|
|
84
|
+
examples: d.examples.length
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
function getComponent(name) {
|
|
88
|
+
const doc = find(name);
|
|
89
|
+
if (!doc) return notFound(name);
|
|
90
|
+
return {
|
|
91
|
+
name: doc.name,
|
|
92
|
+
description: doc.description,
|
|
93
|
+
curation: doc.curation,
|
|
94
|
+
props: {
|
|
95
|
+
note: "Own props + exact types/JSDoc come from the package's type declarations \u2014 `import { " + doc.name + " } from '@carto/meridian-ds/components'` and your IDE/tsc shows the full signature. High-value inherited MUI props are in `curation.mui` (e.g. color, variant, size).",
|
|
96
|
+
promotedMuiProps: doc.curation.mui ?? []
|
|
97
|
+
},
|
|
98
|
+
examples: {
|
|
99
|
+
note: "Call meridian_get_examples for the source code of these stories.",
|
|
100
|
+
storyIds: doc.examples.map((e) => e.id)
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function getComponentExamples(name) {
|
|
105
|
+
const doc = find(name);
|
|
106
|
+
if (!doc) return notFound(name);
|
|
107
|
+
return { component: doc.name, examples: doc.examples };
|
|
108
|
+
}
|
|
109
|
+
function callTool(name, args) {
|
|
110
|
+
switch (name) {
|
|
111
|
+
case "meridian_list_components":
|
|
112
|
+
return listComponents();
|
|
113
|
+
case "meridian_get_component":
|
|
114
|
+
return getComponent(String(args.name ?? ""));
|
|
115
|
+
case "meridian_get_examples":
|
|
116
|
+
return getComponentExamples(String(args.name ?? ""));
|
|
117
|
+
case "meridian_get_conventions":
|
|
118
|
+
return { conventions: CONVENTIONS };
|
|
119
|
+
default:
|
|
120
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function send(msg) {
|
|
124
|
+
process.stdout.write(JSON.stringify(msg) + "\n");
|
|
125
|
+
}
|
|
126
|
+
function handle(req) {
|
|
127
|
+
const { id, method, params } = req;
|
|
128
|
+
const reply = (result) => send({ jsonrpc: "2.0", id, result });
|
|
129
|
+
switch (method) {
|
|
130
|
+
case "initialize":
|
|
131
|
+
return reply({
|
|
132
|
+
protocolVersion: "2024-11-05",
|
|
133
|
+
capabilities: { tools: {} },
|
|
134
|
+
serverInfo: { name: "meridian-design-system", version: VERSION }
|
|
135
|
+
});
|
|
136
|
+
case "notifications/initialized":
|
|
137
|
+
return;
|
|
138
|
+
// notification, no response
|
|
139
|
+
case "ping":
|
|
140
|
+
return reply({});
|
|
141
|
+
case "tools/list":
|
|
142
|
+
return reply({ tools: TOOLS });
|
|
143
|
+
case "tools/call":
|
|
144
|
+
try {
|
|
145
|
+
const result = callTool(params?.name, params?.arguments ?? {});
|
|
146
|
+
return reply({
|
|
147
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
148
|
+
});
|
|
149
|
+
} catch (err) {
|
|
150
|
+
return reply({
|
|
151
|
+
content: [{ type: "text", text: `Error: ${err.message}` }],
|
|
152
|
+
isError: true
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
default:
|
|
156
|
+
if (id !== void 0) {
|
|
157
|
+
send({
|
|
158
|
+
jsonrpc: "2.0",
|
|
159
|
+
id,
|
|
160
|
+
error: { code: -32601, message: `Method not found: ${method}` }
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function load() {
|
|
166
|
+
const bundlePath = resolveBundlePath();
|
|
167
|
+
if (!fs.existsSync(bundlePath)) {
|
|
168
|
+
throw new Error(
|
|
169
|
+
`metadata bundle not found at ${bundlePath}. In the Meridian repo run \`yarn metadata:build\`; in a consumer it ships with @carto/meridian-ds.`
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
const bundle = JSON.parse(
|
|
173
|
+
fs.readFileSync(bundlePath, "utf8")
|
|
174
|
+
);
|
|
175
|
+
DOCS = bundle.components;
|
|
176
|
+
CONVENTIONS = bundle.conventions;
|
|
177
|
+
VERSION = bundle.version;
|
|
178
|
+
process.stderr.write(
|
|
179
|
+
`[meridian-design-system] v${VERSION} ready: ${DOCS.map((d) => d.name).join(", ")}
|
|
180
|
+
`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function main() {
|
|
184
|
+
load();
|
|
185
|
+
let buf = "";
|
|
186
|
+
process.stdin.setEncoding("utf8");
|
|
187
|
+
process.stdin.on("data", (chunk) => {
|
|
188
|
+
buf += chunk;
|
|
189
|
+
let nl;
|
|
190
|
+
while ((nl = buf.indexOf("\n")) >= 0) {
|
|
191
|
+
const line = buf.slice(0, nl).trim();
|
|
192
|
+
buf = buf.slice(nl + 1);
|
|
193
|
+
if (!line) continue;
|
|
194
|
+
try {
|
|
195
|
+
handle(JSON.parse(line));
|
|
196
|
+
} catch (err) {
|
|
197
|
+
process.stderr.write(
|
|
198
|
+
`[meridian-design-system] bad message: ${err.message}
|
|
199
|
+
`
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
process.stdin.on("end", () => process.exit(0));
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
main();
|
|
208
|
+
} catch (err) {
|
|
209
|
+
process.stderr.write(`[meridian-design-system] fatal: ${err}
|
|
210
|
+
`);
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
@@ -4755,7 +4755,7 @@ const Root$1 = material.styled(material.Stack, {
|
|
|
4755
4755
|
height: contentHeight,
|
|
4756
4756
|
minHeight: contentHeight
|
|
4757
4757
|
}));
|
|
4758
|
-
const IconWrapper
|
|
4758
|
+
const IconWrapper = material.styled(material.Box, {
|
|
4759
4759
|
shouldForwardProp: (prop) => prop !== "size" && prop !== "iconSize" && prop !== "iconColor"
|
|
4760
4760
|
})(({ size, iconSize, iconColor, theme }) => {
|
|
4761
4761
|
const finalIconSize = iconSize ?? (size === "small" ? theme.spacing(5) : theme.spacing(6));
|
|
@@ -4830,7 +4830,7 @@ function _EmptyState({
|
|
|
4830
4830
|
"data-icon-size": iconSize,
|
|
4831
4831
|
"data-icon-color": iconColor ?? "null",
|
|
4832
4832
|
children: [
|
|
4833
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper
|
|
4833
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { size, iconSize, iconColor, children: icon }),
|
|
4834
4834
|
hasAnyTextContent && /* @__PURE__ */ jsxRuntime.jsxs(TextContent, { contentWidth, children: [
|
|
4835
4835
|
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4836
4836
|
paletteUtils.Typography,
|
|
@@ -4986,122 +4986,6 @@ function _Avatar({
|
|
|
4986
4986
|
);
|
|
4987
4987
|
}
|
|
4988
4988
|
const Avatar = React.forwardRef(_Avatar);
|
|
4989
|
-
const BACKGROUND_ALPHA = 0.2;
|
|
4990
|
-
const PADDED_ICON_SIZE = {
|
|
4991
|
-
12: paletteUtils.ICON_SIZE_SMALL,
|
|
4992
|
-
18: paletteUtils.ICON_SIZE_SMALL,
|
|
4993
|
-
24: paletteUtils.ICON_SIZE_MEDIUM,
|
|
4994
|
-
32: paletteUtils.ICON_SIZE_MEDIUM,
|
|
4995
|
-
40: paletteUtils.ICON_SIZE_LARGE,
|
|
4996
|
-
48: paletteUtils.ICON_SIZE_LARGE
|
|
4997
|
-
};
|
|
4998
|
-
const NAMED_SCHEMES = ["default", "primary", "secondary"];
|
|
4999
|
-
function isNamedScheme(color) {
|
|
5000
|
-
return NAMED_SCHEMES.includes(color);
|
|
5001
|
-
}
|
|
5002
|
-
function radiusFor(shape, theme) {
|
|
5003
|
-
if (shape === "circular") return "50%";
|
|
5004
|
-
if (shape === "rounded") return theme.spacing(0.5);
|
|
5005
|
-
return 0;
|
|
5006
|
-
}
|
|
5007
|
-
function colorStyles({
|
|
5008
|
-
color,
|
|
5009
|
-
background,
|
|
5010
|
-
disabled,
|
|
5011
|
-
theme
|
|
5012
|
-
}) {
|
|
5013
|
-
if (disabled) {
|
|
5014
|
-
return {
|
|
5015
|
-
color: theme.palette.text.disabled,
|
|
5016
|
-
...background && {
|
|
5017
|
-
backgroundColor: theme.palette.action.disabledBackground
|
|
5018
|
-
}
|
|
5019
|
-
};
|
|
5020
|
-
}
|
|
5021
|
-
if (isNamedScheme(color)) {
|
|
5022
|
-
const scheme = {
|
|
5023
|
-
default: {
|
|
5024
|
-
icon: theme.palette.text.secondary,
|
|
5025
|
-
bg: theme.palette.default.background
|
|
5026
|
-
},
|
|
5027
|
-
primary: {
|
|
5028
|
-
icon: theme.palette.primary.main,
|
|
5029
|
-
bg: theme.palette.primary.background
|
|
5030
|
-
},
|
|
5031
|
-
secondary: {
|
|
5032
|
-
icon: theme.palette.secondary.dark,
|
|
5033
|
-
bg: theme.palette.secondary.background
|
|
5034
|
-
}
|
|
5035
|
-
}[color];
|
|
5036
|
-
return {
|
|
5037
|
-
color: scheme.icon,
|
|
5038
|
-
...background && { backgroundColor: scheme.bg }
|
|
5039
|
-
};
|
|
5040
|
-
}
|
|
5041
|
-
return {
|
|
5042
|
-
color,
|
|
5043
|
-
...background && { backgroundColor: material.alpha(color, BACKGROUND_ALPHA) }
|
|
5044
|
-
};
|
|
5045
|
-
}
|
|
5046
|
-
const IconWrapperRoot = material.styled("span", {
|
|
5047
|
-
shouldForwardProp: (prop) => !["size", "shape", "color", "background", "padding", "border"].includes(
|
|
5048
|
-
prop
|
|
5049
|
-
)
|
|
5050
|
-
})(({ theme, size, shape, color, background, padding, border, disabled }) => {
|
|
5051
|
-
const iconSize = padding ? PADDED_ICON_SIZE[size] : `${size}px`;
|
|
5052
|
-
return {
|
|
5053
|
-
display: "inline-flex",
|
|
5054
|
-
alignItems: "center",
|
|
5055
|
-
justifyContent: "center",
|
|
5056
|
-
boxSizing: "border-box",
|
|
5057
|
-
flexShrink: 0,
|
|
5058
|
-
width: size,
|
|
5059
|
-
height: size,
|
|
5060
|
-
borderRadius: radiusFor(shape, theme),
|
|
5061
|
-
...border && { border: `1px solid ${theme.palette.divider}` },
|
|
5062
|
-
...colorStyles({ color, background, disabled: !!disabled, theme }),
|
|
5063
|
-
"& svg": {
|
|
5064
|
-
width: iconSize,
|
|
5065
|
-
height: iconSize,
|
|
5066
|
-
fontSize: iconSize,
|
|
5067
|
-
color: "inherit",
|
|
5068
|
-
fill: "currentColor"
|
|
5069
|
-
}
|
|
5070
|
-
};
|
|
5071
|
-
});
|
|
5072
|
-
function _IconWrapper({
|
|
5073
|
-
children,
|
|
5074
|
-
size = 24,
|
|
5075
|
-
shape = "rounded",
|
|
5076
|
-
color = "default",
|
|
5077
|
-
background = false,
|
|
5078
|
-
padding = false,
|
|
5079
|
-
border = false,
|
|
5080
|
-
disabled = false,
|
|
5081
|
-
...otherProps
|
|
5082
|
-
}, ref) {
|
|
5083
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5084
|
-
IconWrapperRoot,
|
|
5085
|
-
{
|
|
5086
|
-
ref,
|
|
5087
|
-
size,
|
|
5088
|
-
shape,
|
|
5089
|
-
color,
|
|
5090
|
-
background,
|
|
5091
|
-
padding,
|
|
5092
|
-
border,
|
|
5093
|
-
disabled,
|
|
5094
|
-
"aria-disabled": disabled,
|
|
5095
|
-
"data-name": "icon-wrapper",
|
|
5096
|
-
"data-size": size,
|
|
5097
|
-
"data-shape": shape,
|
|
5098
|
-
...otherProps,
|
|
5099
|
-
children
|
|
5100
|
-
}
|
|
5101
|
-
);
|
|
5102
|
-
}
|
|
5103
|
-
const IconWrapper = React.forwardRef(_IconWrapper);
|
|
5104
|
-
IconWrapper.displayName = "IconWrapper";
|
|
5105
4989
|
const StyledMenu = material.styled(material.Menu, {
|
|
5106
4990
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
5107
4991
|
})(({ extended, width, height }) => ({
|
|
@@ -7166,7 +7050,6 @@ exports.EllipsisWithTooltip = EllipsisWithTooltip;
|
|
|
7166
7050
|
exports.EmptyState = EmptyState;
|
|
7167
7051
|
exports.FilterDropdown = FilterDropdown;
|
|
7168
7052
|
exports.FilterDropdownMenuItem = FilterDropdownMenuItem;
|
|
7169
|
-
exports.IconWrapper = IconWrapper;
|
|
7170
7053
|
exports.LabelWithIndicator = LabelWithIndicator;
|
|
7171
7054
|
exports.ListItemIcon = ListItemIcon;
|
|
7172
7055
|
exports.ListItemRightContent = ListItemRightContent;
|
package/dist/components/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement,
|
|
|
3
3
|
import { styled, Box, Button as Button$1, CircularProgress as CircularProgress$1, Tooltip, 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 as ListItemText$1, ToggleButtonGroup as ToggleButtonGroup$1, Stack, Autocomplete as Autocomplete$1, Divider, ListItemIcon as ListItemIcon$1, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar as Toolbar$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip as Chip$1, 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, ListSubheader as ListSubheader$1, Typography as Typography$1, Popover } from "@mui/material";
|
|
4
4
|
import { ListItemAvatar, ListItemSecondaryAction } from "@mui/material";
|
|
5
5
|
import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, ArrowBackOutlined, Check, TodayOutlined, StopCircleOutlined, ArrowUpwardOutlined } from "@mui/icons-material";
|
|
6
|
-
import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, o as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, l as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, p as useImperativeIntl, b as ICON_SIZE_MEDIUM,
|
|
6
|
+
import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, o as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, l as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, p as useImperativeIntl, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles, r as resolvePalettePath } from "../palette-utils-gZwK5wCD.js";
|
|
7
7
|
import { a } from "../palette-utils-gZwK5wCD.js";
|
|
8
8
|
import { S as ScreenReaderOnly, A as Alert$1, u as useListContextProps } from "../ListItem-CW7C1948.js";
|
|
9
9
|
import { L, a as a2, b, c, d } from "../ListItem-CW7C1948.js";
|
|
@@ -4739,7 +4739,7 @@ const Root$1 = styled(Stack, {
|
|
|
4739
4739
|
height: contentHeight,
|
|
4740
4740
|
minHeight: contentHeight
|
|
4741
4741
|
}));
|
|
4742
|
-
const IconWrapper
|
|
4742
|
+
const IconWrapper = styled(Box, {
|
|
4743
4743
|
shouldForwardProp: (prop) => prop !== "size" && prop !== "iconSize" && prop !== "iconColor"
|
|
4744
4744
|
})(({ size, iconSize, iconColor, theme }) => {
|
|
4745
4745
|
const finalIconSize = iconSize ?? (size === "small" ? theme.spacing(5) : theme.spacing(6));
|
|
@@ -4814,7 +4814,7 @@ function _EmptyState({
|
|
|
4814
4814
|
"data-icon-size": iconSize,
|
|
4815
4815
|
"data-icon-color": iconColor ?? "null",
|
|
4816
4816
|
children: [
|
|
4817
|
-
icon && /* @__PURE__ */ jsx(IconWrapper
|
|
4817
|
+
icon && /* @__PURE__ */ jsx(IconWrapper, { size, iconSize, iconColor, children: icon }),
|
|
4818
4818
|
hasAnyTextContent && /* @__PURE__ */ jsxs(TextContent, { contentWidth, children: [
|
|
4819
4819
|
title && /* @__PURE__ */ jsx(
|
|
4820
4820
|
Typography,
|
|
@@ -4970,122 +4970,6 @@ function _Avatar({
|
|
|
4970
4970
|
);
|
|
4971
4971
|
}
|
|
4972
4972
|
const Avatar = forwardRef(_Avatar);
|
|
4973
|
-
const BACKGROUND_ALPHA = 0.2;
|
|
4974
|
-
const PADDED_ICON_SIZE = {
|
|
4975
|
-
12: ICON_SIZE_SMALL,
|
|
4976
|
-
18: ICON_SIZE_SMALL,
|
|
4977
|
-
24: ICON_SIZE_MEDIUM,
|
|
4978
|
-
32: ICON_SIZE_MEDIUM,
|
|
4979
|
-
40: ICON_SIZE_LARGE,
|
|
4980
|
-
48: ICON_SIZE_LARGE
|
|
4981
|
-
};
|
|
4982
|
-
const NAMED_SCHEMES = ["default", "primary", "secondary"];
|
|
4983
|
-
function isNamedScheme(color) {
|
|
4984
|
-
return NAMED_SCHEMES.includes(color);
|
|
4985
|
-
}
|
|
4986
|
-
function radiusFor(shape, theme) {
|
|
4987
|
-
if (shape === "circular") return "50%";
|
|
4988
|
-
if (shape === "rounded") return theme.spacing(0.5);
|
|
4989
|
-
return 0;
|
|
4990
|
-
}
|
|
4991
|
-
function colorStyles({
|
|
4992
|
-
color,
|
|
4993
|
-
background,
|
|
4994
|
-
disabled,
|
|
4995
|
-
theme
|
|
4996
|
-
}) {
|
|
4997
|
-
if (disabled) {
|
|
4998
|
-
return {
|
|
4999
|
-
color: theme.palette.text.disabled,
|
|
5000
|
-
...background && {
|
|
5001
|
-
backgroundColor: theme.palette.action.disabledBackground
|
|
5002
|
-
}
|
|
5003
|
-
};
|
|
5004
|
-
}
|
|
5005
|
-
if (isNamedScheme(color)) {
|
|
5006
|
-
const scheme = {
|
|
5007
|
-
default: {
|
|
5008
|
-
icon: theme.palette.text.secondary,
|
|
5009
|
-
bg: theme.palette.default.background
|
|
5010
|
-
},
|
|
5011
|
-
primary: {
|
|
5012
|
-
icon: theme.palette.primary.main,
|
|
5013
|
-
bg: theme.palette.primary.background
|
|
5014
|
-
},
|
|
5015
|
-
secondary: {
|
|
5016
|
-
icon: theme.palette.secondary.dark,
|
|
5017
|
-
bg: theme.palette.secondary.background
|
|
5018
|
-
}
|
|
5019
|
-
}[color];
|
|
5020
|
-
return {
|
|
5021
|
-
color: scheme.icon,
|
|
5022
|
-
...background && { backgroundColor: scheme.bg }
|
|
5023
|
-
};
|
|
5024
|
-
}
|
|
5025
|
-
return {
|
|
5026
|
-
color,
|
|
5027
|
-
...background && { backgroundColor: alpha(color, BACKGROUND_ALPHA) }
|
|
5028
|
-
};
|
|
5029
|
-
}
|
|
5030
|
-
const IconWrapperRoot = styled("span", {
|
|
5031
|
-
shouldForwardProp: (prop) => !["size", "shape", "color", "background", "padding", "border"].includes(
|
|
5032
|
-
prop
|
|
5033
|
-
)
|
|
5034
|
-
})(({ theme, size, shape, color, background, padding, border, disabled }) => {
|
|
5035
|
-
const iconSize = padding ? PADDED_ICON_SIZE[size] : `${size}px`;
|
|
5036
|
-
return {
|
|
5037
|
-
display: "inline-flex",
|
|
5038
|
-
alignItems: "center",
|
|
5039
|
-
justifyContent: "center",
|
|
5040
|
-
boxSizing: "border-box",
|
|
5041
|
-
flexShrink: 0,
|
|
5042
|
-
width: size,
|
|
5043
|
-
height: size,
|
|
5044
|
-
borderRadius: radiusFor(shape, theme),
|
|
5045
|
-
...border && { border: `1px solid ${theme.palette.divider}` },
|
|
5046
|
-
...colorStyles({ color, background, disabled: !!disabled, theme }),
|
|
5047
|
-
"& svg": {
|
|
5048
|
-
width: iconSize,
|
|
5049
|
-
height: iconSize,
|
|
5050
|
-
fontSize: iconSize,
|
|
5051
|
-
color: "inherit",
|
|
5052
|
-
fill: "currentColor"
|
|
5053
|
-
}
|
|
5054
|
-
};
|
|
5055
|
-
});
|
|
5056
|
-
function _IconWrapper({
|
|
5057
|
-
children,
|
|
5058
|
-
size = 24,
|
|
5059
|
-
shape = "rounded",
|
|
5060
|
-
color = "default",
|
|
5061
|
-
background = false,
|
|
5062
|
-
padding = false,
|
|
5063
|
-
border = false,
|
|
5064
|
-
disabled = false,
|
|
5065
|
-
...otherProps
|
|
5066
|
-
}, ref) {
|
|
5067
|
-
return /* @__PURE__ */ jsx(
|
|
5068
|
-
IconWrapperRoot,
|
|
5069
|
-
{
|
|
5070
|
-
ref,
|
|
5071
|
-
size,
|
|
5072
|
-
shape,
|
|
5073
|
-
color,
|
|
5074
|
-
background,
|
|
5075
|
-
padding,
|
|
5076
|
-
border,
|
|
5077
|
-
disabled,
|
|
5078
|
-
"aria-disabled": disabled,
|
|
5079
|
-
"data-name": "icon-wrapper",
|
|
5080
|
-
"data-size": size,
|
|
5081
|
-
"data-shape": shape,
|
|
5082
|
-
...otherProps,
|
|
5083
|
-
children
|
|
5084
|
-
}
|
|
5085
|
-
);
|
|
5086
|
-
}
|
|
5087
|
-
const IconWrapper = forwardRef(_IconWrapper);
|
|
5088
|
-
IconWrapper.displayName = "IconWrapper";
|
|
5089
4973
|
const StyledMenu = styled(Menu$2, {
|
|
5090
4974
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
5091
4975
|
})(({ extended, width, height }) => ({
|
|
@@ -7133,7 +7017,6 @@ export {
|
|
|
7133
7017
|
FilterDropdown,
|
|
7134
7018
|
FilterDropdownMenuItem,
|
|
7135
7019
|
IconButton,
|
|
7136
|
-
IconWrapper,
|
|
7137
7020
|
LabelWithIndicator,
|
|
7138
7021
|
L as Link,
|
|
7139
7022
|
a2 as List,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ButtonProps as MUIButtonProps } from '@mui/material';
|
|
2
2
|
export type ButtonProps = MUIButtonProps<React.ElementType, {
|
|
3
|
+
/**
|
|
4
|
+
* Link target attribute when button is used as a link (e.g., '_blank' for new tab)
|
|
5
|
+
*/
|
|
3
6
|
target?: string;
|
|
7
|
+
/**
|
|
8
|
+
* If true, shows a loading spinner. Also disables the button.
|
|
9
|
+
*/
|
|
4
10
|
loading?: boolean;
|
|
5
11
|
/**
|
|
6
12
|
* Controls where the spinner appears:
|
|
@@ -24,8 +30,12 @@ export type ButtonProps = MUIButtonProps<React.ElementType, {
|
|
|
24
30
|
* Defaults to the intl token 'c4r.button.opensInNewTab' if not provided.
|
|
25
31
|
*/
|
|
26
32
|
screenReaderText?: string | React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* ID of element that describes the button for screen readers
|
|
35
|
+
*/
|
|
27
36
|
'aria-describedby'?: string;
|
|
28
37
|
}>;
|
|
38
|
+
/** Standard action button for user-triggered actions. Supports loading state and rendering as an external link. */
|
|
29
39
|
declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
30
40
|
export default Button;
|
|
31
41
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,IAAI,cAAc,EAK9B,MAAM,eAAe,CAAA;AAuBtB,MAAM,MAAM,WAAW,GAAG,cAAc,CACtC,KAAK,CAAC,WAAW,EACjB;IACE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,IAAI,cAAc,EAK9B,MAAM,eAAe,CAAA;AAuBtB,MAAM,MAAM,WAAW,GAAG,cAAc,CACtC,KAAK,CAAC,WAAW,EACjB;IACE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CACF,CAAA;AAmGD,mHAAmH;AACnH,QAAA,MAAM,MAAM,wHAAsB,CAAA;AAClC,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated, irreducible judgment for Button. Everything else (props, types,
|
|
3
|
+
* defaults, examples) is derived — do NOT restate it here.
|
|
4
|
+
*/
|
|
5
|
+
declare const curation: {
|
|
6
|
+
keywords: string[];
|
|
7
|
+
mui: string[];
|
|
8
|
+
alternatives: ({
|
|
9
|
+
when: string;
|
|
10
|
+
use: string;
|
|
11
|
+
mui?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
when: string;
|
|
14
|
+
use: string;
|
|
15
|
+
mui: true;
|
|
16
|
+
})[];
|
|
17
|
+
gotchas: string[];
|
|
18
|
+
};
|
|
19
|
+
export default curation;
|
|
20
|
+
//# sourceMappingURL=Button.metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.metadata.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.metadata.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,QAAA,MAAM,QAAQ;;;;;;;;;;;;;CAqCM,CAAA;AAEpB,eAAe,QAAQ,CAAA"}
|
|
@@ -1,25 +1,68 @@
|
|
|
1
1
|
import { ReactNode, MouseEvent } from 'react';
|
|
2
2
|
import { IconButtonProps as MuiIconButtonProps, TooltipProps } from '@mui/material';
|
|
3
3
|
export type IconButtonProps = Omit<MuiIconButtonProps, 'ref'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Callback fired when the button is clicked
|
|
6
|
+
*/
|
|
4
7
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* If true, displays the button in an active/selected state with primary color and background.
|
|
10
|
+
* @deprecated Use ToggleButton component instead
|
|
11
|
+
*/
|
|
6
12
|
active?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The icon to display in the button. Use commonly understood icons (edit, delete, close, etc.) so the action is recognizable.
|
|
15
|
+
*/
|
|
7
16
|
icon: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Visual style of the button
|
|
19
|
+
*/
|
|
8
20
|
variant?: 'contained' | 'outlined' | 'icon';
|
|
21
|
+
/**
|
|
22
|
+
* Text to display in tooltip on hover. Highly recommended for accessibility. Works also in disabled state.
|
|
23
|
+
*/
|
|
9
24
|
tooltip?: TooltipProps['title'];
|
|
25
|
+
/**
|
|
26
|
+
* Placement of the tooltip relative to the button
|
|
27
|
+
*/
|
|
10
28
|
tooltipPlacement?: TooltipProps['placement'];
|
|
29
|
+
/**
|
|
30
|
+
* If true, shows a loading spinner instead of the icon. Also disables the button.
|
|
31
|
+
*/
|
|
11
32
|
loading?: boolean;
|
|
12
33
|
/** Add support for React Router's 'to' prop */
|
|
13
34
|
to?: string;
|
|
14
35
|
};
|
|
36
|
+
/** Compact icon-only button for actions where a label would add noise (toolbars, table rows, close affordances). Supports tooltip, loading state, and multiple visual variants. Always provide an accessible label via tooltip or aria-label. */
|
|
15
37
|
declare const IconButton: import('react').ForwardRefExoticComponent<Omit<MuiIconButtonProps, "ref"> & {
|
|
38
|
+
/**
|
|
39
|
+
* Callback fired when the button is clicked
|
|
40
|
+
*/
|
|
16
41
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* If true, displays the button in an active/selected state with primary color and background.
|
|
44
|
+
* @deprecated Use ToggleButton component instead
|
|
45
|
+
*/
|
|
18
46
|
active?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The icon to display in the button. Use commonly understood icons (edit, delete, close, etc.) so the action is recognizable.
|
|
49
|
+
*/
|
|
19
50
|
icon: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Visual style of the button
|
|
53
|
+
*/
|
|
20
54
|
variant?: "contained" | "outlined" | "icon";
|
|
55
|
+
/**
|
|
56
|
+
* Text to display in tooltip on hover. Highly recommended for accessibility. Works also in disabled state.
|
|
57
|
+
*/
|
|
21
58
|
tooltip?: TooltipProps["title"];
|
|
59
|
+
/**
|
|
60
|
+
* Placement of the tooltip relative to the button
|
|
61
|
+
*/
|
|
22
62
|
tooltipPlacement?: TooltipProps["placement"];
|
|
63
|
+
/**
|
|
64
|
+
* If true, shows a loading spinner instead of the icon. Also disables the button.
|
|
65
|
+
*/
|
|
23
66
|
loading?: boolean;
|
|
24
67
|
/** Add support for React Router's 'to' prop */
|
|
25
68
|
to?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,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;IACxD;;;OAGG;aACM,OAAO;IAChB;;OAEG;UACG,SAAS;IACf;;OAEG;cACO,WAAW,GAAG,UAAU,GAAG,MAAM;IAC3C;;OAEG;cACO,YAAY,CAAC,OAAO,CAAC;IAC/B;;OAEG;uBACgB,YAAY,CAAC,WAAW,CAAC;IAC5C;;OAEG;cACO,OAAO;IACjB,+CAA+C;SAC1C,MAAM;qDA+EiE,CAAA;AAC9E,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const curation: {
|
|
2
|
+
keywords: string[];
|
|
3
|
+
mui: string[];
|
|
4
|
+
alternatives: ({
|
|
5
|
+
when: string;
|
|
6
|
+
use: string;
|
|
7
|
+
mui?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
when: string;
|
|
10
|
+
use: string;
|
|
11
|
+
mui: true;
|
|
12
|
+
})[];
|
|
13
|
+
gotchas: string[];
|
|
14
|
+
};
|
|
15
|
+
export default curation;
|
|
16
|
+
//# sourceMappingURL=IconButton.metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.metadata.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton/IconButton.metadata.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;CA2BM,CAAA;AAEpB,eAAe,QAAQ,CAAA"}
|
|
@@ -5,13 +5,37 @@ type SplitButtonOption = {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
7
|
export type SplitButtonProps<T extends SplitButtonOption = SplitButtonOption> = {
|
|
8
|
+
/**
|
|
9
|
+
* Array of options for the dropdown menu. Each option must have a label.
|
|
10
|
+
*/
|
|
8
11
|
options: T[];
|
|
12
|
+
/**
|
|
13
|
+
* Callback fired when the main button is clicked. Receives the currently selected option.
|
|
14
|
+
*/
|
|
9
15
|
onClick: (option: T) => void;
|
|
16
|
+
/**
|
|
17
|
+
* If true, shows loading spinner in the main button
|
|
18
|
+
*/
|
|
10
19
|
loading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Position of the loading spinner
|
|
22
|
+
*/
|
|
11
23
|
loadingPosition?: ButtonProps['loadingPosition'];
|
|
24
|
+
/**
|
|
25
|
+
* If true, the entire button is disabled
|
|
26
|
+
*/
|
|
12
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Visual style of the button
|
|
30
|
+
*/
|
|
13
31
|
variant?: ButtonProps['variant'];
|
|
32
|
+
/**
|
|
33
|
+
* Size of the button
|
|
34
|
+
*/
|
|
14
35
|
size?: ButtonProps['size'];
|
|
36
|
+
/**
|
|
37
|
+
* Theme color for the button
|
|
38
|
+
*/
|
|
15
39
|
color?: ButtonProps['color'];
|
|
16
40
|
/**
|
|
17
41
|
* If `true`, the dropdown starts expanded on mount. Uncontrolled: this
|
|
@@ -25,9 +49,16 @@ export type SplitButtonProps<T extends SplitButtonOption = SplitButtonOption> =
|
|
|
25
49
|
* translated value of `c4r.button.showOptions`.
|
|
26
50
|
*/
|
|
27
51
|
toggleAriaLabel?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Test ID for testing purposes
|
|
54
|
+
*/
|
|
28
55
|
'data-testid'?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Accessible label for the button group
|
|
58
|
+
*/
|
|
29
59
|
'aria-label'?: string;
|
|
30
60
|
};
|
|
61
|
+
/** Button paired with a dropdown of related alternative actions. The first option is the default click action; the dropdown exposes the rest. Use when there is one primary action plus a small set of close variants (e.g. Save / Save as / Save and close). */
|
|
31
62
|
export default function SplitButton<T extends SplitButtonOption = SplitButtonOption>({ options, disabled, loading, loadingPosition, onClick, variant, size, color, defaultOpen, toggleAriaLabel, ...otherProps }: SplitButtonProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
32
63
|
export {};
|
|
33
64
|
//# sourceMappingURL=SplitButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.d.ts","sourceRoot":"","sources":["../../../../src/components/SplitButton/SplitButton.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAA;AAiB/C,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,IAC1E;IACE,OAAO,EAAE,CAAC,EAAE,CAAA;IACZ,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAEH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAC/C,EACA,OAAO,EACP,QAAQ,EACR,OAAO,EACP,eAAe,EACf,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,WAAW,EACX,eAAe,EACf,GAAG,UAAU,EACd,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CA4HrB"}
|
|
1
|
+
{"version":3,"file":"SplitButton.d.ts","sourceRoot":"","sources":["../../../../src/components/SplitButton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d,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CA4HrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitButton.metadata.d.ts","sourceRoot":"","sources":["../../../../src/components/SplitButton/SplitButton.metadata.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ;;;;;;;CA2BM,CAAA;AAEpB,eAAe,QAAQ,CAAA"}
|
|
@@ -22,7 +22,6 @@ export * from './TooltipData';
|
|
|
22
22
|
export * from './AccordionGroup';
|
|
23
23
|
export * from './Alert';
|
|
24
24
|
export * from './Avatar';
|
|
25
|
-
export * from './IconWrapper';
|
|
26
25
|
export * from './FilterDropdown';
|
|
27
26
|
export * from './Menu';
|
|
28
27
|
export * from './MessageField';
|
|
@@ -59,7 +58,6 @@ export type * from './TooltipData';
|
|
|
59
58
|
export type * from './AccordionGroup';
|
|
60
59
|
export type * from './Alert';
|
|
61
60
|
export type * from './Avatar';
|
|
62
|
-
export type * from './IconWrapper';
|
|
63
61
|
export type * from './FilterDropdown';
|
|
64
62
|
export type * from './Menu';
|
|
65
63
|
export type * from './MessageField';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B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A;AAClC,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,QAAQ,CAAA;AAC3B,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,SAAS,CAAA;AAC5B,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,QAAQ,CAAA;AAC3B,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,OAAO,CAAA;AAC1B,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,QAAQ,CAAA;AAC3B,mBAAmB,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carto/meridian-ds",
|
|
3
|
-
"version": "3.0.2-alpha.
|
|
3
|
+
"version": "3.0.2-alpha.e34a00a.237",
|
|
4
4
|
"description": "CARTO Meridian Design System",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "vite build",
|
|
8
|
+
"build:mcp": "npx esbuild ai-metadata/mcp/server.ts --bundle --platform=node --format=esm --outfile=dist/bin/meridian-ds-mcp.js --banner:js='#!/usr/bin/env node'",
|
|
8
9
|
"build:clean": "yarn run clean:all && yarn install && yarn run build && yarn run test",
|
|
9
10
|
"dev": "vite",
|
|
10
11
|
"test": "LC_ALL=\"en_US.UTF-8\" vitest run --typecheck",
|
|
@@ -14,6 +15,10 @@
|
|
|
14
15
|
"test:interaction:watch": "vitest watch --project=storybook",
|
|
15
16
|
"coverage": "LC_ALL=\"en_US.UTF-8\" vitest --coverage",
|
|
16
17
|
"coverage:ui": "LC_ALL=\"en_US.UTF-8\" vitest --coverage --ui",
|
|
18
|
+
"metadata:build": "tsx ai-metadata/src/build.ts",
|
|
19
|
+
"metadata:validate": "tsx ai-metadata/src/validate.ts",
|
|
20
|
+
"metadata:eval": "tsx ai-metadata/src/eval.ts",
|
|
21
|
+
"metadata:mcp": "tsx ai-metadata/mcp/server.ts",
|
|
17
22
|
"lint": "eslint . --ext .ts,.tsx",
|
|
18
23
|
"format": "prettier --write .",
|
|
19
24
|
"ts-check": "tsc -p tsconfig.json --noEmit",
|
|
@@ -29,7 +34,7 @@
|
|
|
29
34
|
"postversion:commit": "node scripts/postversion-commit.js",
|
|
30
35
|
"postversion:push": "git push && git push --tags",
|
|
31
36
|
"prepare": "husky",
|
|
32
|
-
"prepack": "yarn clean:build && yarn build",
|
|
37
|
+
"prepack": "yarn clean:build && yarn build && yarn metadata:build && yarn build:mcp",
|
|
33
38
|
"figma:connect": "bash -c '[ -f .env ] && source .env; export FIGMA_ACCESS_TOKEN; figma connect --token=$FIGMA_ACCESS_TOKEN \"$@\"' --",
|
|
34
39
|
"figma:publish": "bash -c '[ -f .env ] && source .env; export FIGMA_ACCESS_TOKEN; figma connect publish --token=$FIGMA_ACCESS_TOKEN \"$@\"' --",
|
|
35
40
|
"figma:validate": "yarn figma:validate:code && yarn figma:validate:live",
|
|
@@ -80,6 +85,7 @@
|
|
|
80
85
|
"eslint-config-prettier": "9.1.0",
|
|
81
86
|
"eslint-plugin-github": "^5.1.8",
|
|
82
87
|
"eslint-plugin-import": "^2.31.0",
|
|
88
|
+
"eslint-plugin-jsdoc": "^63.0.2",
|
|
83
89
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
84
90
|
"eslint-plugin-prettier": "^5.4.0",
|
|
85
91
|
"eslint-plugin-react": "7.35.0",
|
|
@@ -141,13 +147,18 @@
|
|
|
141
147
|
"types": "./dist/types/widgets/index.d.ts",
|
|
142
148
|
"import": "./dist/widgets/index.js",
|
|
143
149
|
"require": "./dist/widgets/index.cjs"
|
|
144
|
-
}
|
|
150
|
+
},
|
|
151
|
+
"./metadata": "./ai-metadata/generated/metadata.json"
|
|
152
|
+
},
|
|
153
|
+
"bin": {
|
|
154
|
+
"meridian-ds-mcp": "./dist/bin/meridian-ds-mcp.js"
|
|
145
155
|
},
|
|
146
156
|
"publishConfig": {
|
|
147
157
|
"access": "public"
|
|
148
158
|
},
|
|
149
159
|
"files": [
|
|
150
|
-
"dist"
|
|
160
|
+
"dist",
|
|
161
|
+
"ai-metadata/generated/metadata.json"
|
|
151
162
|
],
|
|
152
163
|
"keywords": [
|
|
153
164
|
"carto",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type IconWrapperShape = 'rounded' | 'square' | 'circular';
|
|
3
|
-
export type IconWrapperSize = 12 | 18 | 24 | 32 | 40 | 48;
|
|
4
|
-
export type IconWrapperColor = 'default' | 'primary' | 'secondary' | (string & {});
|
|
5
|
-
export type IconWrapperProps = Omit<React.HTMLProps<HTMLSpanElement>, 'as' | 'size' | 'color' | 'ref'> & {
|
|
6
|
-
/** The icon to render. Any SvgIcon, custom Meridian icon, or node. */
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
/** Outer footprint in pixels. */
|
|
9
|
-
size?: IconWrapperSize;
|
|
10
|
-
/** Shape of the background/border frame. */
|
|
11
|
-
shape?: IconWrapperShape;
|
|
12
|
-
/**
|
|
13
|
-
* Predefined scheme (`default` | `primary` | `secondary`) or any CSS color.
|
|
14
|
-
* A custom color also tints the background at 20%.
|
|
15
|
-
*/
|
|
16
|
-
color?: IconWrapperColor;
|
|
17
|
-
/** Render a filled background. */
|
|
18
|
-
background?: boolean;
|
|
19
|
-
/** Reserve space around the icon (smaller icon centered in the footprint). */
|
|
20
|
-
padding?: boolean;
|
|
21
|
-
/** Render a 1px divider border. */
|
|
22
|
-
border?: boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
};
|
|
25
|
-
declare const IconWrapper: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLProps<HTMLSpanElement>, "color" | "size" | "ref" | "as"> & {
|
|
26
|
-
/** The icon to render. Any SvgIcon, custom Meridian icon, or node. */
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
/** Outer footprint in pixels. */
|
|
29
|
-
size?: IconWrapperSize;
|
|
30
|
-
/** Shape of the background/border frame. */
|
|
31
|
-
shape?: IconWrapperShape;
|
|
32
|
-
/**
|
|
33
|
-
* Predefined scheme (`default` | `primary` | `secondary`) or any CSS color.
|
|
34
|
-
* A custom color also tints the background at 20%.
|
|
35
|
-
*/
|
|
36
|
-
color?: IconWrapperColor;
|
|
37
|
-
/** Render a filled background. */
|
|
38
|
-
background?: boolean;
|
|
39
|
-
/** Reserve space around the icon (smaller icon centered in the footprint). */
|
|
40
|
-
padding?: boolean;
|
|
41
|
-
/** Render a 1px divider border. */
|
|
42
|
-
border?: boolean;
|
|
43
|
-
disabled?: boolean;
|
|
44
|
-
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
45
|
-
export default IconWrapper;
|
|
46
|
-
//# sourceMappingURL=IconWrapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,OAAO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example: figma.TemplateStringResult;
|
|
6
|
-
metadata: {
|
|
7
|
-
nestable: boolean;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
|
11
|
-
//# sourceMappingURL=IconWrapper.figma.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconWrapper.figma.d.ts","sourceRoot":"","sources":["../../../../src/components/IconWrapper/IconWrapper.figma.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;;;;;;;;;AAuDzB,wBAgBC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { default as IconWrapper, IconWrapperColor, IconWrapperShape, IconWrapperSize } from './IconWrapper';
|
|
2
|
-
type IconWrapperStoryArgs = React.ComponentProps<typeof IconWrapper> & {
|
|
3
|
-
customColor?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const options: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLProps<HTMLSpanElement>, "color" | "size" | "ref" | "as"> & {
|
|
8
|
-
children: import('react').ReactNode;
|
|
9
|
-
size?: IconWrapperSize;
|
|
10
|
-
shape?: IconWrapperShape;
|
|
11
|
-
color?: IconWrapperColor;
|
|
12
|
-
background?: boolean;
|
|
13
|
-
padding?: boolean;
|
|
14
|
-
border?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
17
|
-
tags: string[];
|
|
18
|
-
args: {
|
|
19
|
-
size: 24;
|
|
20
|
-
shape: "rounded";
|
|
21
|
-
color: "default";
|
|
22
|
-
background: true;
|
|
23
|
-
padding: true;
|
|
24
|
-
border: false;
|
|
25
|
-
disabled: false;
|
|
26
|
-
};
|
|
27
|
-
argTypes: {
|
|
28
|
-
size: {
|
|
29
|
-
control: "select";
|
|
30
|
-
options: IconWrapperSize[];
|
|
31
|
-
};
|
|
32
|
-
shape: {
|
|
33
|
-
control: "select";
|
|
34
|
-
options: IconWrapperShape[];
|
|
35
|
-
};
|
|
36
|
-
color: {
|
|
37
|
-
control: "select";
|
|
38
|
-
options: IconWrapperColor[];
|
|
39
|
-
};
|
|
40
|
-
customColor: {
|
|
41
|
-
control: "color";
|
|
42
|
-
name: string;
|
|
43
|
-
};
|
|
44
|
-
background: {
|
|
45
|
-
control: "boolean";
|
|
46
|
-
};
|
|
47
|
-
padding: {
|
|
48
|
-
control: "boolean";
|
|
49
|
-
};
|
|
50
|
-
border: {
|
|
51
|
-
control: "boolean";
|
|
52
|
-
};
|
|
53
|
-
disabled: {
|
|
54
|
-
control: "boolean";
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
parameters: {
|
|
58
|
-
design: {
|
|
59
|
-
type: string;
|
|
60
|
-
url: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export default options;
|
|
65
|
-
export declare const Playground: {
|
|
66
|
-
render: ({ customColor, color, ...args }: IconWrapperStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
67
|
-
};
|
|
68
|
-
export declare const Sizes: {
|
|
69
|
-
render: () => import("react/jsx-runtime").JSX.Element;
|
|
70
|
-
};
|
|
71
|
-
export declare const Shapes: {
|
|
72
|
-
render: () => import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
};
|
|
74
|
-
export declare const Colors: {
|
|
75
|
-
render: () => import("react/jsx-runtime").JSX.Element;
|
|
76
|
-
};
|
|
77
|
-
export declare const States: {
|
|
78
|
-
render: () => import("react/jsx-runtime").JSX.Element;
|
|
79
|
-
};
|
|
80
|
-
export declare const Border: {
|
|
81
|
-
render: () => import("react/jsx-runtime").JSX.Element;
|
|
82
|
-
};
|
|
83
|
-
export declare const Backgrounds: {
|
|
84
|
-
render: () => import("react/jsx-runtime").JSX.Element;
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=IconWrapper.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconWrapper.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/IconWrapper/IconWrapper.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,WAAW,EAAE,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EAChB,MAAM,eAAe,CAAA;AAUtB,KAAK,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,GAAG;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ByB,CAAA;AACtC,eAAe,OAAO,CAAA;AAEtB,eAAO,MAAM,UAAU;8CACqB,oBAAoB;CAK/D,CAAA;AAED,eAAO,MAAM,KAAK;;CAejB,CAAA;AAED,eAAO,MAAM,MAAM;;CAelB,CAAA;AAED,eAAO,MAAM,MAAM;;CAuBlB,CAAA;AAED,eAAO,MAAM,MAAM;;CAqBlB,CAAA;AAED,eAAO,MAAM,MAAM;;CAqBlB,CAAA;AAED,eAAO,MAAM,WAAW;;CA6BvB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/IconWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,mBAAmB,eAAe,CAAA"}
|