@czi-sds/mcp 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,49 +3,70 @@
3
3
  "props": {
4
4
  "color": {
5
5
  "defaultValue": "neutral",
6
- "description": "The tag's intent, given either as one of the six names or as CSS colors: [label color, background color]: the icon stays white [label color, background color, icon color]",
6
+ "description": "One of the seven intents, or CSS colors for a tag the intents do not\ncover: `[label, background]` or `[label, background, icon]`. The icon\ntakes the label color when the third value is left out.",
7
7
  "isRequired": false,
8
- "type": "\"info\" | \"negative\" | \"notice\" | \"positive\" | \"neutral\" | \"beta\" | [string, string] | [string, string, string]"
8
+ "type": "\"info\" | \"accent\" | \"negative\" | \"notice\" | \"positive\" | \"beta\" | \"neutral\" | [string, string] | [string, string, string]"
9
9
  },
10
- "hover": {
11
- "defaultValue": true,
12
- "description": "Whether the tag responds to the pointer with a darker fill and a pointer cursor. False removes the tag from pointer events altogether, which also keeps a surrounding Tooltip from opening.",
10
+ "disabled": {
11
+ "defaultValue": false,
12
+ "description": "Greys the tag out. On a clickable tag or a link it also takes the tag out\nof the tab order.",
13
13
  "isRequired": false,
14
14
  "type": "boolean"
15
15
  },
16
+ "href": {
17
+ "description": "Turns the tag into a link. It renders as an `<a>` unless `component`\nsays otherwise, as with a router's link component.",
18
+ "isRequired": false,
19
+ "type": "string"
20
+ },
16
21
  "icon": {
17
- "description": "Icon element.",
22
+ "description": "An icon on the leading edge, usually a Phosphor or `@czi-sds/icons` icon.\nThe tag draws it at its own icon size and color.",
18
23
  "isRequired": false,
19
24
  "type": "ReactElement"
20
25
  },
26
+ "iconOnly": {
27
+ "defaultValue": false,
28
+ "description": "Draws only the icon, in a square tag. The label is hidden from view but\nstays the tag's accessible name. Has no effect without an icon.",
29
+ "isRequired": false,
30
+ "type": "boolean"
31
+ },
21
32
  "label": {
22
33
  "defaultValue": "- (required)",
23
- "description": "The tag's text, and its accessible name. It is cut off with an ellipsis\nrather than wrapped, so keep it to a word or two.",
34
+ "description": "The tag's text, and its accessible name. It is cut off with an ellipsis\nrather than wrapped, so keep it to a word or two. An icon-only tag still\nneeds it: the text is hidden from view but read by screen readers.",
24
35
  "isRequired": true,
25
36
  "type": "string"
26
37
  },
27
38
  "onClick": {
28
- "description": "MUI's prop. Makes the tag a button: a tab stop that answers Enter and Space.",
39
+ "description": "MUI's prop. Makes the tag a button: a tab stop that answers Enter and Space, with hover and pressed states.",
29
40
  "isRequired": false,
30
41
  "type": "function"
31
42
  },
32
- "sdsSize": {
33
- "defaultValue": "s",
34
- "description": "The size of the tag: an 11px label with a 12px icon, or a 13px label with a 24px icon. A large tag has to have an icon.",
43
+ "sdsStyle": {
44
+ "defaultValue": "solid",
45
+ "description": "`solid` fills the tag with the intent color. `outline` tints the fill and\ndraws the label, the icons and a 1px border in the intent color.",
46
+ "isRequired": false,
47
+ "type": "\"outline\" | \"solid\""
48
+ },
49
+ "showLinkIcon": {
50
+ "defaultValue": false,
51
+ "description": "Adds an arrow after the label to say the tag leads somewhere. Usually\npaired with `href`, though a tag can be a link without it.",
35
52
  "isRequired": false,
36
- "type": "\"s\" | \"l\""
53
+ "type": "boolean"
37
54
  },
38
- "sdsStyle": {
39
- "defaultValue": "square",
40
- "description": "The shape of the tag. The design guidance treats rounded as the default for the system, so it is usually worth passing.",
55
+ "size": {
56
+ "defaultValue": "medium",
57
+ "description": "`medium` is 24px tall with a 13px label and 12px icons, `small` is 20px\ntall with a 10px label and 10px icons.",
41
58
  "isRequired": false,
42
- "type": "\"square\" | \"rounded\""
59
+ "type": "\"small\" | \"medium\""
43
60
  },
44
- "sdsType": {
45
- "defaultValue": "primary",
46
- "description": "primary fills the tag with the intent color and sets the label white. secondary tints the fill and keeps the label and a 1px border in the intent color.",
61
+ "target": {
62
+ "description": "Where the link opens. `_blank` also sets `rel=\"noopener noreferrer\"`.",
47
63
  "isRequired": false,
48
- "type": "\"primary\" | \"secondary\""
64
+ "type": "string & {} | \"_self\" | \"_blank\" | \"_parent\" | \"_top\""
65
+ },
66
+ "rel": {
67
+ "description": "The link's relationship to the current page.",
68
+ "isRequired": false,
69
+ "type": "string"
49
70
  },
50
71
  "onDelete": {
51
72
  "description": "Callback fired when the delete icon is clicked.\nIf set, the delete icon will be shown.",
@@ -2,13 +2,11 @@
2
2
  "TagFilter": {
3
3
  "props": {
4
4
  "label": {
5
- "defaultValue": "- (required)",
6
5
  "description": "The filter's text. Cut off with an ellipsis when there is not room for it.",
7
6
  "isRequired": true,
8
7
  "type": "string"
9
8
  },
10
9
  "onDelete": {
11
- "defaultValue": "- (required)",
12
10
  "description": "Runs when the X is clicked or activated, and when Backspace or Delete is\npressed on the tag. Drop the filter from your state here; the component\ndoes not remove itself.",
13
11
  "isRequired": true,
14
12
  "type": "(event: any) => void"
@@ -0,0 +1,40 @@
1
+ {
2
+ "TagLegacy": {
3
+ "props": {
4
+ "color": {
5
+ "isRequired": false,
6
+ "type": "\"info\" | \"negative\" | \"notice\" | \"positive\" | \"beta\" | \"neutral\" | [string, string] | [string, string, string]"
7
+ },
8
+ "hover": {
9
+ "isRequired": false,
10
+ "type": "boolean"
11
+ },
12
+ "icon": {
13
+ "description": "Icon element.",
14
+ "isRequired": false,
15
+ "type": "ReactElement"
16
+ },
17
+ "label": {
18
+ "description": "The tag's text, and its accessible name. It is cut off with an ellipsis\nrather than wrapped, so keep it to a word or two.",
19
+ "isRequired": true,
20
+ "type": "string"
21
+ },
22
+ "onClick": {
23
+ "isRequired": false,
24
+ "type": "function"
25
+ },
26
+ "sdsSize": {
27
+ "isRequired": false,
28
+ "type": "\"s\" | \"l\""
29
+ },
30
+ "sdsStyle": {
31
+ "isRequired": false,
32
+ "type": "\"square\" | \"rounded\""
33
+ },
34
+ "sdsType": {
35
+ "isRequired": false,
36
+ "type": "\"primary\" | \"secondary\""
37
+ }
38
+ }
39
+ }
40
+ }
@@ -17,6 +17,11 @@
17
17
  "isRequired": false,
18
18
  "type": "\"bottom\" | \"left\" | \"right\" | \"top\" | \"auto\" | \"auto-start\" | \"auto-end\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\""
19
19
  },
20
+ "subtitle": {
21
+ "description": "A smaller, dimmer second line under the title, for a detail such as how to use what the tooltip points at.",
22
+ "isRequired": false,
23
+ "type": "ReactNode"
24
+ },
20
25
  "textAlign": {
21
26
  "defaultValue": "center, or left when wide",
22
27
  "description": "Overrides the alignment the width would pick.",
@@ -34,11 +39,6 @@
34
39
  "isRequired": false,
35
40
  "type": "\"default\" | \"wide\""
36
41
  },
37
- "subtitle": {
38
- "description": "A smaller, dimmer second line under the title, for a detail such as how to use what the tooltip points at.",
39
- "isRequired": false,
40
- "type": "ReactNode"
41
- },
42
42
  "arrow": {
43
43
  "defaultValue": false,
44
44
  "description": "If `true`, adds an arrow to the tooltip.",
@@ -6,6 +6,11 @@
6
6
  "isRequired": false,
7
7
  "type": "string | Element"
8
8
  },
9
+ "data": {
10
+ "description": "The sections, drawn in order and separated by dividers. A section's label heads it, its dataRows fill it, and disabled greys the whole block.",
11
+ "isRequired": false,
12
+ "type": "{ label?: string | undefined; dataRows: { label: string; value: string | number; }[]; disabled?: boolean | undefined; }[]"
13
+ },
9
14
  "itemAlign": {
10
15
  "defaultValue": "right",
11
16
  "description": "Which side of its column each value sits on. Right lines numbers up with each other.",
@@ -17,11 +22,6 @@
17
22
  "description": "Whether section labels are drawn. False hides all of them; the dividers between sections stay.",
18
23
  "isRequired": false,
19
24
  "type": "boolean"
20
- },
21
- "data": {
22
- "description": "The sections, drawn in order and separated by dividers. A section's label heads it, its dataRows fill it, and disabled greys the whole block.",
23
- "isRequired": false,
24
- "type": "{ label?: string | undefined; dataRows: { label: string; value: string | number; }[]; disabled?: boolean | undefined; }[]"
25
25
  }
26
26
  }
27
27
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@czi-sds/mcp",
3
3
  "description": "The official MCP server for SDS",
4
- "version": "0.20.1",
4
+ "version": "0.21.0",
5
5
  "main": "dist/stdio.js",
6
6
  "files": [
7
7
  "dist",
@@ -66,5 +66,5 @@
66
66
  "turndown": "^7.2.4",
67
67
  "typescript": "^5.9.2"
68
68
  },
69
- "gitHead": "52f0027db4ead40a4a311a27aefd762ed8823d47"
69
+ "gitHead": "d38c18e3aca773081cb5c0413dbfefb10da774b8"
70
70
  }
@@ -1,131 +0,0 @@
1
- # TagFilter
2
-
3
- ## Source Code
4
-
5
- The component's source code in the SDS codebase can be found [here](https://github.com/chanzuckerberg/sci-components/blob/main/packages/components/src/core/TagFilter/index.tsx).
6
-
7
- ## Import
8
-
9
- **React TypeScript**
10
-
11
- ```tsx
12
- import { TagFilter } from "@czi-sds/components";
13
- ```
14
-
15
- ## Code examples
16
-
17
- ### Default TagFilter
18
-
19
- A row of applied filters, each removing itself from the page's state through `onDelete`. The row is a named group, which gives the identical "Delete Tag" buttons some context.
20
-
21
- **Example: DefaultTagFilter**
22
-
23
- ```tsx
24
- // TagFilter is the tag that comes off: onDelete is required, and removing the tag
25
- // from your own state is what makes it disappear. Everything about how it looks is
26
- // fixed (the accent fill, the square shape, and the small X), so there are no
27
- // style props to pass.
28
- //
29
- // Both the tag and its X are focusable, so each filter is two tab stops: Backspace
30
- // or Delete on the tag removes it, and so does Enter on the X.
31
-
32
- import {
33
- TagFilter,
34
- fontBodyXs,
35
- getSemanticColors,
36
- getSpaces,
37
- type CommonThemeProps,
38
- } from "@czi-sds/components";
39
- import styled from "@emotion/styled";
40
- import { useState } from "react";
41
-
42
- const FILTERS = ["Homo sapiens", "Lung", "10x 3' v3", "Healthy"];
43
-
44
- const Row = styled.div<CommonThemeProps>`
45
- ${(props) => {
46
- const spaces = getSpaces(props);
47
-
48
- return `
49
- display: flex;
50
- flex-wrap: wrap;
51
- gap: ${spaces?.s}px;
52
- margin-bottom: ${spaces?.m}px;
53
- min-height: 28px;
54
- `;
55
- }}
56
- `;
57
-
58
- const Readout = styled.p<CommonThemeProps>`
59
- ${fontBodyXs}
60
-
61
- ${(props) => {
62
- const semanticColors = getSemanticColors(props);
63
-
64
- return `
65
- color: ${semanticColors?.base?.textSecondary};
66
- margin: 0;
67
- `;
68
- }}
69
- `;
70
-
71
- function App() {
72
- const [filters, setFilters] = useState(FILTERS);
73
-
74
- return (
75
- <div className="app">
76
- <Row aria-label="Applied filters" role="group">
77
- {filters.map((filter) => (
78
- <TagFilter
79
- key={filter}
80
- label={filter}
81
- onDelete={() =>
82
- setFilters((current) => current.filter((item) => item !== filter))
83
- }
84
- />
85
- ))}
86
- </Row>
87
-
88
- <Readout>
89
- {filters.length > 0
90
- ? `${filters.length} of ${FILTERS.length} filters applied`
91
- : "No filters applied"}
92
- </Readout>
93
- </div>
94
- );
95
- }
96
-
97
- export default App;
98
- ```
99
-
100
- ## SDS vs MUI
101
-
102
- TagFilter is built on the SDS Tag, and so on MUI's Chip, but it exists for one job: showing which Filters are applied and letting them be taken off again. It has one appearance and no style props:
103
-
104
- - **onDelete is required.** MUI treats it as the switch that decides whether a chip can be deleted; here the delete control is always there, so the handler has to be. Removing the tag from your own state is what makes it disappear.
105
-
106
- - **The look is fixed:** the accent fill, the square shape, the small semibold label and the 12px X. Tag's `sdsStyle`, `sdsType`, `sdsSize` and `color` are not part of the type, and MUI's `variant` is not either.
107
-
108
- - **The X cannot be swapped:** SDS applies its own `deleteIcon` (an SDS Button holding the XMark icon) after your props, so a `deleteIcon` of your own is ignored without a warning.
109
-
110
- ## MUI Documentation
111
-
112
- Documentation for the underlying MUI component can be found [here](https://mui.com/material-ui/react-chip/).
113
-
114
- ## Behavior and accessibility
115
-
116
- - There are two ways to remove a filter, and both are reachable from the keyboard: the X is a button that answers Enter, and the tag itself answers Backspace and Delete. That also means each filter tag is two tab stops.
117
-
118
- - The X button is named "Delete Tag" on every filter tag, and the name cannot be changed. The label beside it is read as plain text rather than as part of the button, so a row of filters is worth wrapping in a group with a name of its own, to say what the buttons are removing. The example below uses `role="group"` with an `aria-label`.
119
-
120
- - The tag carries `role="none presentation"`, so it contributes no semantics of its own. Adding an `onClick` does not change that: the tag becomes clickable to the pointer while still announcing nothing, so leave the clicking to the X.
121
-
122
- - Like a Tag, a filter tag does not wrap: a long filter value is cut off with an ellipsis. Keep the values short, or shorten them yourself so the part that survives is the part that matters.
123
-
124
- ## Props
125
-
126
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
127
-
128
- | Name | Type | Default | Description |
129
- | ---------- | ---------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
130
- | `label` | `string` | - (required) | The filter's text. Cut off with an ellipsis when there is not room for it. |
131
- | `onDelete` | `function` | - (required) | Runs when the X is clicked or activated, and when Backspace or Delete is pressed on the tag. Drop the filter from your state here; the component does not remove itself. **Signature:** `function(event: SyntheticEvent) => void` |