@coinbase/cds-mcp-server 8.52.0 → 8.52.2
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 +8 -0
- package/mcp-docs/mobile/components/AreaChart.txt +12 -222
- package/mcp-docs/mobile/components/BarChart.txt +222 -333
- package/mcp-docs/mobile/components/CartesianChart.txt +6 -3
- package/mcp-docs/mobile/components/Checkbox.txt +2 -2
- package/mcp-docs/mobile/components/Chip.txt +74 -29
- package/mcp-docs/mobile/components/LineChart.txt +54 -134
- package/mcp-docs/mobile/components/Point.txt +1 -0
- package/mcp-docs/mobile/components/Radio.txt +2 -2
- package/mcp-docs/mobile/components/Scrubber.txt +2 -1
- package/mcp-docs/mobile/components/XAxis.txt +54 -1
- package/mcp-docs/mobile/components/YAxis.txt +3 -1
- package/mcp-docs/mobile/routes.txt +1 -1
- package/mcp-docs/web/components/AreaChart.txt +26 -118
- package/mcp-docs/web/components/BarChart.txt +228 -116
- package/mcp-docs/web/components/CartesianChart.txt +6 -3
- package/mcp-docs/web/components/Checkbox.txt +2 -2
- package/mcp-docs/web/components/Chip.txt +74 -29
- package/mcp-docs/web/components/FocusTrap.txt +2 -1
- package/mcp-docs/web/components/FullscreenModal.txt +2 -2
- package/mcp-docs/web/components/FullscreenModalLayout.txt +2 -2
- package/mcp-docs/web/components/LineChart.txt +42 -2
- package/mcp-docs/web/components/Modal.txt +67 -2
- package/mcp-docs/web/components/Point.txt +1 -0
- package/mcp-docs/web/components/Radio.txt +2 -2
- package/mcp-docs/web/components/ReferenceLine.txt +1 -1
- package/mcp-docs/web/components/Scrubber.txt +2 -1
- package/mcp-docs/web/components/Tray.txt +69 -2
- package/mcp-docs/web/components/XAxis.txt +55 -2
- package/mcp-docs/web/components/YAxis.txt +4 -2
- package/mcp-docs/web/routes.txt +1 -1
- package/package.json +1 -1
|
@@ -172,10 +172,10 @@ function MultipleCheckboxes() {
|
|
|
172
172
|
| `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | Background color of the overlay (element being interacted with). |
|
|
173
173
|
| `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | Border color of the element. |
|
|
174
174
|
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
175
|
-
| `borderWidth` | `((BorderWidth \| { base?: BorderWidth; phone?: BorderWidth \| undefined; tablet?: BorderWidth \| undefined; desktop?: BorderWidth \| undefined; }) & BorderWidth) \| undefined` | No | `100` |
|
|
175
|
+
| `borderWidth` | `((BorderWidth \| { base?: BorderWidth; phone?: BorderWidth \| undefined; tablet?: BorderWidth \| undefined; desktop?: BorderWidth \| undefined; }) & BorderWidth) \| undefined` | No | `100` | Sets the border width of the checkbox. |
|
|
176
176
|
| `children` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label for the control option. |
|
|
177
177
|
| `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
|
|
178
|
-
| `controlColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `fgInverse` | Sets the checked/active color of the
|
|
178
|
+
| `controlColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `fgInverse` | Sets the checked/active color of the checkbox. |
|
|
179
179
|
| `elevation` | `0 \| 1 \| 2` | No | `-` | - |
|
|
180
180
|
| `iconStyle` | `CSSProperties` | No | `-` | Style for the icon element |
|
|
181
181
|
| `indeterminate` | `boolean` | No | `-` | Enable indeterminate state. Useful when you want to indicate that sub-items of a control are partially filled. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chip
|
|
2
2
|
|
|
3
|
-
A compact,
|
|
3
|
+
A compact content element for tags, filters, and selections.
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
@@ -10,60 +10,46 @@ import { Chip } from '@coinbase/cds-web/chips/Chip'
|
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Basics
|
|
14
|
+
|
|
15
|
+
Render a Chip with text. Without `onClick`, it displays as a static pill. With `onClick`, it becomes a button. Use `disabled` to prevent interaction on an otherwise interactive chip.
|
|
14
16
|
|
|
15
17
|
```tsx live
|
|
16
18
|
function Example() {
|
|
17
19
|
return (
|
|
18
|
-
<HStack gap={2}>
|
|
20
|
+
<HStack gap={2} flexWrap="wrap">
|
|
19
21
|
<Chip>Basic Chip</Chip>
|
|
20
|
-
<Chip disabled>Disabled Chip</Chip>
|
|
21
22
|
<Chip onClick={() => alert('Clicked!')}>Interactive Chip</Chip>
|
|
23
|
+
<Chip disabled onClick={() => alert('Clicked!')}>
|
|
24
|
+
Disabled Chip
|
|
25
|
+
</Chip>
|
|
22
26
|
</HStack>
|
|
23
27
|
);
|
|
24
28
|
}
|
|
25
29
|
```
|
|
26
30
|
|
|
27
|
-
###
|
|
28
|
-
|
|
29
|
-
```tsx live
|
|
30
|
-
function Example() {
|
|
31
|
-
return (
|
|
32
|
-
<VStack gap={2}>
|
|
33
|
-
<HStack gap={2}>
|
|
34
|
-
<Chip compact>Compact</Chip>
|
|
35
|
-
<Chip inverted>Inverted</Chip>
|
|
36
|
-
<Chip maxWidth={100} numberOfLines={1}>
|
|
37
|
-
Long text that should truncate nicely
|
|
38
|
-
</Chip>
|
|
39
|
-
</HStack>
|
|
40
|
-
</VStack>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### With Icons and Images
|
|
31
|
+
### Icons and Images
|
|
46
32
|
|
|
47
33
|
```tsx live
|
|
48
34
|
function Example() {
|
|
49
35
|
return (
|
|
50
36
|
<VStack gap={2}>
|
|
51
|
-
<HStack gap={2}>
|
|
37
|
+
<HStack gap={2} flexWrap="wrap">
|
|
52
38
|
<Chip start={<Icon name="star" />}>With Start Icon</Chip>
|
|
53
|
-
<Chip end={<Icon name="
|
|
54
|
-
<Chip start={<Icon name="star" />} end={<Icon name="
|
|
39
|
+
<Chip end={<Icon name="caretDown" />}>With End Icon</Chip>
|
|
40
|
+
<Chip start={<Icon name="star" />} end={<Icon name="caretDown" />}>
|
|
55
41
|
Both Icons
|
|
56
42
|
</Chip>
|
|
57
43
|
</HStack>
|
|
58
|
-
<HStack gap={2}>
|
|
44
|
+
<HStack gap={2} flexWrap="wrap">
|
|
59
45
|
<Chip
|
|
60
|
-
start={<RemoteImage source={assets.btc.imageUrl} width={
|
|
46
|
+
start={<RemoteImage source={assets.btc.imageUrl} width={24} height={24} shape="circle" />}
|
|
61
47
|
onClick={() => alert('BTC selected')}
|
|
62
48
|
>
|
|
63
49
|
BTC
|
|
64
50
|
</Chip>
|
|
65
51
|
<Chip
|
|
66
|
-
start={<RemoteImage source={assets.eth.imageUrl} width={
|
|
52
|
+
start={<RemoteImage source={assets.eth.imageUrl} width={24} height={24} shape="circle" />}
|
|
67
53
|
onClick={() => alert('ETH selected')}
|
|
68
54
|
>
|
|
69
55
|
ETH
|
|
@@ -74,6 +60,65 @@ function Example() {
|
|
|
74
60
|
}
|
|
75
61
|
```
|
|
76
62
|
|
|
63
|
+
### Styling
|
|
64
|
+
|
|
65
|
+
#### Color
|
|
66
|
+
|
|
67
|
+
Use `invertColorScheme` to invert foreground and background for emphasis.
|
|
68
|
+
|
|
69
|
+
```tsx live
|
|
70
|
+
function Example() {
|
|
71
|
+
return (
|
|
72
|
+
<HStack gap={2} flexWrap="wrap">
|
|
73
|
+
<Chip>Default</Chip>
|
|
74
|
+
<Chip invertColorScheme>Inverted</Chip>
|
|
75
|
+
</HStack>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Compact
|
|
81
|
+
|
|
82
|
+
Use `compact` for smaller chips with reduced padding.
|
|
83
|
+
|
|
84
|
+
```tsx live
|
|
85
|
+
function Example() {
|
|
86
|
+
return (
|
|
87
|
+
<HStack gap={2} flexWrap="wrap">
|
|
88
|
+
<Chip>Default</Chip>
|
|
89
|
+
<Chip compact>Compact</Chip>
|
|
90
|
+
</HStack>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Accessibility
|
|
96
|
+
|
|
97
|
+
When using `onClick`, provide an `accessibilityLabel` for screen readers, especially when the label text alone is ambiguous or when the chip has non-text content.
|
|
98
|
+
|
|
99
|
+
```tsx live
|
|
100
|
+
function Example() {
|
|
101
|
+
return (
|
|
102
|
+
<HStack gap={2} flexWrap="wrap">
|
|
103
|
+
<Chip
|
|
104
|
+
accessibilityLabel="Select Bitcoin"
|
|
105
|
+
onClick={() => alert('BTC')}
|
|
106
|
+
start={<RemoteImage source={assets.btc.imageUrl} width={24} height={24} shape="circle" />}
|
|
107
|
+
>
|
|
108
|
+
BTC
|
|
109
|
+
</Chip>
|
|
110
|
+
<Chip
|
|
111
|
+
accessibilityLabel="Filter by category"
|
|
112
|
+
end={<Icon name="caretDown" />}
|
|
113
|
+
onClick={() => alert('Filter')}
|
|
114
|
+
>
|
|
115
|
+
Category
|
|
116
|
+
</Chip>
|
|
117
|
+
</HStack>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
77
122
|
## Props
|
|
78
123
|
|
|
79
124
|
| Prop | Type | Required | Default | Description |
|
|
@@ -140,11 +140,12 @@ function Example() {
|
|
|
140
140
|
| Prop | Type | Required | Default | Description |
|
|
141
141
|
| --- | --- | --- | --- | --- |
|
|
142
142
|
| `autoFocusDelay` | `number` | No | `undefined` | The amount of time in milliseconds to wait before auto-focusing the first focusable element. |
|
|
143
|
+
| `disableArrowKeyNavigation` | `boolean` | No | `false` | If true, the focus trap will not allow arrow key navigation. |
|
|
143
144
|
| `disableAutoFocus` | `boolean` | No | `false` | If true, the focus trap will not automatically shift focus to itself when it opens, and replace it to the last focused element when it closes. |
|
|
144
145
|
| `disableFocusTrap` | `boolean` | No | `-` | Disables the focus trap to allow normal keyboard navigation. |
|
|
145
146
|
| `disableTypeFocus` | `boolean` | No | `-` | Use for editable Search Input components to ensure focus is correctly applied |
|
|
146
147
|
| `focusTabIndexElements` | `boolean` | No | `false` | If true, the focus trap will include all elements with tabIndex values in the list of focusable elements. |
|
|
147
|
-
| `includeTriggerInFocusTrap` | `boolean` | No |
|
|
148
|
+
| `includeTriggerInFocusTrap` | `boolean` | No | `false` | If true, the focus trap will include the trigger in the focus trap. |
|
|
148
149
|
| `onEscPress` | `(() => void)` | No | `-` | - |
|
|
149
150
|
| `respectNegativeTabIndex` | `boolean` | No | `false` | If true, the focus trap will respect negative tabIndex values, removing them from the list of focusable elements. |
|
|
150
151
|
| `restoreFocusOnUnmount` | `boolean` | No | `false` | If true, the focus trap will restore focus to the previously focused element when it unmounts. |
|
|
@@ -147,9 +147,9 @@ For more complex layouts, including three-column structures with custom headers
|
|
|
147
147
|
| `closeAccessibilityLabel` | `string` | No | `-` | Sets an accessible label for the close button. On web, maps to aria-label and defines a string value that labels an interactive element. On mobile, VoiceOver will read this string when a user selects the associated element. |
|
|
148
148
|
| `contentContainerClassName` | `string` | No | `-` | Class applied to the content container element |
|
|
149
149
|
| `contentStyle` | `CSSProperties` | No | `-` | Apply styles to content. |
|
|
150
|
-
| `disableFocusTrap` | `boolean` | No |
|
|
150
|
+
| `disableFocusTrap` | `boolean` | No | `-` | Disables the focus trap to allow normal keyboard navigation. |
|
|
151
151
|
| `disablePortal` | `boolean` | No | `-` | Disable React portal integration |
|
|
152
|
-
| `focusTabIndexElements` | `boolean` | No | `false
|
|
152
|
+
| `focusTabIndexElements` | `boolean` | No | `false` | If true, the focus trap will include all elements with tabIndex values in the list of focusable elements. |
|
|
153
153
|
| `hideDivider` | `boolean` | No | `false` | Hide header bottom divider |
|
|
154
154
|
| `logo` | `ReactElement` | No | `-` | The logo to display |
|
|
155
155
|
| `onDidClose` | `((() => void) & (() => void))` | No | `-` | Callback fired after the component is closed. |
|
|
@@ -371,9 +371,9 @@ function ThreeColumnExample() {
|
|
|
371
371
|
| `onRequestClose` | `() => void` | Yes | `-` | Callback function fired when modal is closed. |
|
|
372
372
|
| `visible` | `boolean` | Yes | `false false` | Controls visibility of the Modal |
|
|
373
373
|
| `accessibilityLabelledBy` | `string` | No | `-` | On web, maps to aria-labelledby and lists the id(s) of the element(s) that label the element on which the attribute is set. On mobile (Android only), a reference to another element nativeID used to build complex forms. |
|
|
374
|
-
| `disableFocusTrap` | `boolean` | No |
|
|
374
|
+
| `disableFocusTrap` | `boolean` | No | `-` | Disables the focus trap to allow normal keyboard navigation. |
|
|
375
375
|
| `disablePortal` | `boolean` | No | `-` | Disable React portal integration |
|
|
376
|
-
| `focusTabIndexElements` | `boolean` | No | `false
|
|
376
|
+
| `focusTabIndexElements` | `boolean` | No | `false` | If true, the focus trap will include all elements with tabIndex values in the list of focusable elements. |
|
|
377
377
|
| `key` | `Key \| null` | No | `-` | - |
|
|
378
378
|
| `onDidClose` | `((() => void) & (() => void))` | No | `-` | Callback fired after the component is closed. |
|
|
379
379
|
| `ref` | `RefObject<HTMLDivElement> \| ((instance: HTMLDivElement \| null) => void) \| null` | No | `-` | - |
|
|
@@ -29,6 +29,45 @@ The only prop required is `series`, which takes an array of series objects. Each
|
|
|
29
29
|
/>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
### Layout
|
|
33
|
+
|
|
34
|
+
Lines can be rendered horizontally or vertically by setting the `layout` prop.
|
|
35
|
+
|
|
36
|
+
```jsx live
|
|
37
|
+
function HorizontalLine() {
|
|
38
|
+
const dataset = [
|
|
39
|
+
{ month: 'Jan', seoul: 21 },
|
|
40
|
+
{ month: 'Feb', seoul: 28 },
|
|
41
|
+
{ month: 'Mar', seoul: 41 },
|
|
42
|
+
{ month: 'Apr', seoul: 73 },
|
|
43
|
+
{ month: 'May', seoul: 99 },
|
|
44
|
+
{ month: 'June', seoul: 144 },
|
|
45
|
+
{ month: 'July', seoul: 319 },
|
|
46
|
+
{ month: 'Aug', seoul: 249 },
|
|
47
|
+
{ month: 'Sept', seoul: 131 },
|
|
48
|
+
{ month: 'Oct', seoul: 55 },
|
|
49
|
+
{ month: 'Nov', seoul: 48 },
|
|
50
|
+
{ month: 'Dec', seoul: 25 },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<LineChart
|
|
55
|
+
height={400}
|
|
56
|
+
layout="horizontal"
|
|
57
|
+
series={[
|
|
58
|
+
{ id: 'seoul', data: dataset.map((d) => d.seoul), color: 'var(--color-accentBoldBlue)' },
|
|
59
|
+
]}
|
|
60
|
+
showXAxis
|
|
61
|
+
showYAxis
|
|
62
|
+
xAxis={{ label: 'rainfall (mm)' }}
|
|
63
|
+
yAxis={{
|
|
64
|
+
data: dataset.map((d) => d.month),
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
32
71
|
LineChart also supports multiple lines, interaction, and axes.
|
|
33
72
|
Other props, such as `areaType` can be applied to the chart as a whole or per series.
|
|
34
73
|
|
|
@@ -1973,6 +2012,7 @@ function ForecastAssetPrice() {
|
|
|
1973
2012
|
| `inset` | `number \| Partial<ChartInset>` | No | `-` | Inset around the entire chart (outside the axes). |
|
|
1974
2013
|
| `justifyContent` | `ResponsiveProp<left \| right \| center \| normal \| start \| end \| flex-start \| flex-end \| space-between \| space-around \| space-evenly \| stretch>` | No | `-` | - |
|
|
1975
2014
|
| `key` | `Key \| null` | No | `-` | - |
|
|
2015
|
+
| `layout` | `horizontal \| vertical` | No | `'vertical'` | Chart layout - describes the direction bars/areas grow. - vertical (default): Bars grow vertically. X is category axis, Y is value axis. - horizontal: Bars grow horizontally. Y is category axis, X is value axis. |
|
|
1976
2016
|
| `left` | `ResponsiveProp<Left<string \| number>>` | No | `-` | - |
|
|
1977
2017
|
| `legend` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Whether to show the legend or a custom legend element. - true renders the default Legend component - A React element renders that element as the legend - false or omitted hides the legend |
|
|
1978
2018
|
| `legendAccessibilityLabel` | `string` | No | `'Legend'` | Accessibility label for the legend group. |
|
|
@@ -2027,8 +2067,8 @@ function ForecastAssetPrice() {
|
|
|
2027
2067
|
| `userSelect` | `ResponsiveProp<text \| none \| all \| auto>` | No | `-` | - |
|
|
2028
2068
|
| `visibility` | `ResponsiveProp<hidden \| visible>` | No | `-` | - |
|
|
2029
2069
|
| `width` | `ResponsiveProp<Width<string \| number>>` | No | `-` | - |
|
|
2030
|
-
| `xAxis` | `(Partial<
|
|
2031
|
-
| `yAxis` | `(Partial<
|
|
2070
|
+
| `xAxis` | `(Partial<CartesianAxisConfigProps> & SharedProps & { bandGridLinePlacement?: AxisBandPlacement; bandTickMarkPlacement?: AxisBandPlacement \| undefined; label?: string \| undefined; labelGap?: number \| undefined; minTickLabelGap?: number \| undefined; requestedTickCount?: number \| undefined; showGrid?: boolean \| undefined; showLine?: boolean \| undefined; showTickMarks?: boolean \| undefined; tickMarkSize?: number \| undefined; ticks?: number[] \| ((value: number) => boolean) \| undefined; tickMarkLabelGap?: number \| undefined; tickInterval?: number \| undefined; tickMinStep?: number \| undefined; tickMaxStep?: number \| undefined; } & { className?: string \| undefined; classNames?: { root?: string \| undefined; label?: string \| undefined; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined; style?: CSSProperties \| undefined; styles?: { root?: CSSProperties \| undefined; label?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined; GridLineComponent?: LineComponent \| undefined; LineComponent?: LineComponent \| undefined; TickMarkLineComponent?: LineComponent \| undefined; tickLabelFormatter?: ((value: number) => ChartTextChildren) \| undefined; TickLabelComponent?: AxisTickLabelComponent \| undefined; } & { axisId?: string \| undefined; position?: top \| bottom \| undefined; height?: number \| undefined; }) \| undefined` | No | `-` | Configuration for x-axis. Accepts axis config and axis props. To show the axis, set showXAxis to true. |
|
|
2071
|
+
| `yAxis` | `(Partial<CartesianAxisConfigProps> & SharedProps & { bandGridLinePlacement?: AxisBandPlacement; bandTickMarkPlacement?: AxisBandPlacement \| undefined; label?: string \| undefined; labelGap?: number \| undefined; minTickLabelGap?: number \| undefined; requestedTickCount?: number \| undefined; showGrid?: boolean \| undefined; showLine?: boolean \| undefined; showTickMarks?: boolean \| undefined; tickMarkSize?: number \| undefined; ticks?: number[] \| ((value: number) => boolean) \| undefined; tickMarkLabelGap?: number \| undefined; tickInterval?: number \| undefined; tickMinStep?: number \| undefined; tickMaxStep?: number \| undefined; } & { className?: string \| undefined; classNames?: { root?: string \| undefined; label?: string \| undefined; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined; style?: CSSProperties \| undefined; styles?: { root?: CSSProperties \| undefined; label?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined; GridLineComponent?: LineComponent \| undefined; LineComponent?: LineComponent \| undefined; TickMarkLineComponent?: LineComponent \| undefined; tickLabelFormatter?: ((value: number) => ChartTextChildren) \| undefined; TickLabelComponent?: AxisTickLabelComponent \| undefined; } & { axisId?: string \| undefined; position?: left \| right \| undefined; width?: number \| undefined; }) \| undefined` | No | `-` | Configuration for y-axis. Accepts axis config and axis props. To show the axis, set showYAxis to true. |
|
|
2032
2072
|
| `zIndex` | `inherit \| auto \| revert \| -moz-initial \| initial \| revert-layer \| unset` | No | `-` | - |
|
|
2033
2073
|
|
|
2034
2074
|
|
|
@@ -162,6 +162,70 @@ function ChainedModalsExample() {
|
|
|
162
162
|
}
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
### Scrollable Modal Content
|
|
166
|
+
|
|
167
|
+
If the Modal has content which is expected to overflow and doesn't have focusable elements, set the following props to ensure the scrollable content can be navigated using keyboard arrows:
|
|
168
|
+
|
|
169
|
+
- `focusTabIndexElements`: `true`
|
|
170
|
+
- `disableArrowKeyNavigation`: `true`
|
|
171
|
+
|
|
172
|
+
As well, assign a `tabIndex` greater than or equal to `0` to the ModalBody so that the overflow can be reached via keyboard.
|
|
173
|
+
|
|
174
|
+
```jsx live
|
|
175
|
+
function Example() {
|
|
176
|
+
const [visible, setVisible] = useState(false);
|
|
177
|
+
return (
|
|
178
|
+
<>
|
|
179
|
+
<Button onClick={() => setVisible(true)}>Open Modal</Button>
|
|
180
|
+
<Modal
|
|
181
|
+
focusTabIndexElements
|
|
182
|
+
disableArrowKeyNavigation
|
|
183
|
+
onRequestClose={() => setVisible(false)}
|
|
184
|
+
visible={visible}
|
|
185
|
+
>
|
|
186
|
+
<ModalHeader
|
|
187
|
+
backAccessibilityLabel="Back"
|
|
188
|
+
closeAccessibilityLabel="Close"
|
|
189
|
+
onBackButtonClick={() => setVisible(false)}
|
|
190
|
+
testID="Basic Modal Test ID"
|
|
191
|
+
title="Basic Modal"
|
|
192
|
+
/>
|
|
193
|
+
<ModalBody tabIndex={0} testID="modal-body">
|
|
194
|
+
<VStack>
|
|
195
|
+
<Text font="title1" paddingBottom={10}>
|
|
196
|
+
This tray has content which will overflow.
|
|
197
|
+
</Text>
|
|
198
|
+
<Text font="title1" paddingBottom={10}>
|
|
199
|
+
To enable keyboard scrolling, certain props have to be set.
|
|
200
|
+
</Text>
|
|
201
|
+
<Text font="title1" paddingBottom={10}>
|
|
202
|
+
Otherwise, the content won't be viewable to users who navigate using a keyboard.
|
|
203
|
+
</Text>
|
|
204
|
+
<Text font="title1" paddingBottom={10}>
|
|
205
|
+
It's important to account for this to ensure an accessible experience.
|
|
206
|
+
</Text>
|
|
207
|
+
<Text font="title1" paddingBottom={10}>
|
|
208
|
+
Here's some text that is in the overflow and needs to be scrolled to.
|
|
209
|
+
</Text>
|
|
210
|
+
<Text font="title1" paddingBottom={10}>
|
|
211
|
+
Here's some more text to help more easily showcase scrolling.
|
|
212
|
+
</Text>
|
|
213
|
+
</VStack>
|
|
214
|
+
</ModalBody>
|
|
215
|
+
<ModalFooter
|
|
216
|
+
primaryAction={<Button onClick={() => setVisible(false)}>Save</Button>}
|
|
217
|
+
secondaryAction={
|
|
218
|
+
<Button onClick={() => setVisible(false)} variant="secondary">
|
|
219
|
+
Cancel
|
|
220
|
+
</Button>
|
|
221
|
+
}
|
|
222
|
+
/>
|
|
223
|
+
</Modal>
|
|
224
|
+
</>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
165
229
|
## Props
|
|
166
230
|
|
|
167
231
|
| Prop | Type | Required | Default | Description |
|
|
@@ -199,7 +263,8 @@ function ChainedModalsExample() {
|
|
|
199
263
|
| `dangerouslyDisableResponsiveness` | `boolean` | No | `false` | Disable responsiveness so it maintains the same UI across different viewports. |
|
|
200
264
|
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
201
265
|
| `dangerouslySetPosition` | `static \| relative \| fixed \| absolute \| sticky` | No | `-` | Set the position for the modal dialogue |
|
|
202
|
-
| `
|
|
266
|
+
| `disableArrowKeyNavigation` | `boolean` | No | `false` | If true, the focus trap will not allow arrow key navigation. |
|
|
267
|
+
| `disableFocusTrap` | `boolean` | No | `-` | Disables the focus trap to allow normal keyboard navigation. |
|
|
203
268
|
| `disableOverlayPress` | `boolean` | No | `false` | Disable overlay click that closes the Modal |
|
|
204
269
|
| `disablePortal` | `boolean` | No | `-` | Disable React portal integration |
|
|
205
270
|
| `display` | `ResponsiveProp<grid \| revert \| none \| block \| inline \| inline-block \| flex \| inline-flex \| inline-grid \| contents \| flow-root \| list-item>` | No | `-` | - |
|
|
@@ -209,7 +274,7 @@ function ChainedModalsExample() {
|
|
|
209
274
|
| `flexGrow` | `inherit \| revert \| -moz-initial \| initial \| revert-layer \| unset` | No | `-` | - |
|
|
210
275
|
| `flexShrink` | `inherit \| revert \| -moz-initial \| initial \| revert-layer \| unset` | No | `-` | - |
|
|
211
276
|
| `flexWrap` | `ResponsiveProp<nowrap \| wrap \| wrap-reverse>` | No | `-` | - |
|
|
212
|
-
| `focusTabIndexElements` | `boolean` | No | `false` |
|
|
277
|
+
| `focusTabIndexElements` | `boolean` | No | `false` | If true, the focus trap will include all elements with tabIndex values in the list of focusable elements. |
|
|
213
278
|
| `font` | `ResponsiveProp<FontFamily \| inherit>` | No | `-` | - |
|
|
214
279
|
| `fontFamily` | `ResponsiveProp<FontFamily \| inherit>` | No | `-` | - |
|
|
215
280
|
| `fontSize` | `ResponsiveProp<FontSize \| inherit>` | No | `-` | - |
|
|
@@ -575,6 +575,7 @@ function ScatterplotWithCustomLabels() {
|
|
|
575
575
|
| `x` | `string \| number` | No | `-` | - |
|
|
576
576
|
| `x1` | `string \| number` | No | `-` | - |
|
|
577
577
|
| `x2` | `string \| number` | No | `-` | - |
|
|
578
|
+
| `xAxisId` | `string` | No | `first x-axis defined in chart props.` | Optional X-axis id to specify which axis to plot along. |
|
|
578
579
|
| `xChannelSelector` | `string` | No | `-` | - |
|
|
579
580
|
| `xHeight` | `string \| number` | No | `-` | - |
|
|
580
581
|
| `xlinkActuate` | `string` | No | `-` | - |
|
|
@@ -203,10 +203,10 @@ function CustomStyledRadio() {
|
|
|
203
203
|
| `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | Background color of the overlay (element being interacted with). |
|
|
204
204
|
| `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | Border color of the element. |
|
|
205
205
|
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
206
|
-
| `borderWidth` | `
|
|
206
|
+
| `borderWidth` | `((BorderWidth \| { base?: BorderWidth; phone?: BorderWidth \| undefined; tablet?: BorderWidth \| undefined; desktop?: BorderWidth \| undefined; }) & BorderWidth) \| undefined` | No | `100` | Sets the border width of the radio. |
|
|
207
207
|
| `children` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label for the control option. |
|
|
208
208
|
| `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `black` | - |
|
|
209
|
-
| `controlColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `bgPrimary` | Sets the checked/active color of the
|
|
209
|
+
| `controlColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `bgPrimary` | Sets the checked/active color of the radio. |
|
|
210
210
|
| `elevation` | `0 \| 1 \| 2` | No | `-` | - |
|
|
211
211
|
| `iconStyle` | `CSSProperties` | No | `-` | Style for the icon element |
|
|
212
212
|
| `indeterminate` | `boolean` | No | `-` | Enable indeterminate state. Useful when you want to indicate that sub-items of a control are partially filled. |
|
|
@@ -645,7 +645,7 @@ function DraggablePriceTarget() {
|
|
|
645
645
|
| `beaconStroke` | `string` | No | `'var(--color-bg)'` | Stroke color of the scrubber beacon circle. |
|
|
646
646
|
| `beaconTransitions` | `{ enter?: Transition$1 \| null; update?: Transition$1 \| null \| undefined; pulse?: Transition$1 \| undefined; pulseRepeatDelay?: number \| undefined; } \| undefined` | No | `-` | Transition configuration for the scrubber beacon. |
|
|
647
647
|
| `classNames` | `{ overlay?: string; beacon?: string \| undefined; line?: string \| undefined; label?: string \| undefined; beaconLabel?: string \| undefined; } \| undefined` | No | `-` | Custom class names for individual elements of the Scrubber component |
|
|
648
|
-
| `hideBeaconLabels` | `boolean` | No |
|
|
648
|
+
| `hideBeaconLabels` | `boolean` | No | `true in horizontal layout, false in vertical layout.` | Hides the beacon labels while keeping the line label visible (if provided). |
|
|
649
649
|
| `hideLine` | `boolean` | No | `-` | Hides the scrubber line. |
|
|
650
650
|
| `hideOverlay` | `boolean` | No | `-` | Hides the overlay rect which obscures data beyond the scrubber position. |
|
|
651
651
|
| `idlePulse` | `boolean` | No | `-` | Pulse the beacons while at rest. |
|
|
@@ -87,6 +87,7 @@ All series will be scrubbed by default. You can set `seriesIds` to show only spe
|
|
|
87
87
|
|
|
88
88
|
Setting `label` on a series will display a label to the side of the scrubber beacon, and
|
|
89
89
|
setting `label` on Scrubber displays a label above the scrubber line.
|
|
90
|
+
In `layout="horizontal"`, beacon labels are intentionally hidden to avoid overlap with scrubber beacons.
|
|
90
91
|
|
|
91
92
|
```jsx live
|
|
92
93
|
<LineChart
|
|
@@ -922,7 +923,7 @@ function MatchupBeaconLabels() {
|
|
|
922
923
|
| `beaconStroke` | `string` | No | `'var(--color-bg)'` | Stroke color of the scrubber beacon circle. |
|
|
923
924
|
| `beaconTransitions` | `{ enter?: Transition$1 \| null; update?: Transition$1 \| null \| undefined; pulse?: Transition$1 \| undefined; pulseRepeatDelay?: number \| undefined; } \| undefined` | No | `-` | Transition configuration for the scrubber beacon. |
|
|
924
925
|
| `classNames` | `{ overlay?: string; beacon?: string \| undefined; line?: string \| undefined; label?: string \| undefined; beaconLabel?: string \| undefined; } \| undefined` | No | `-` | Custom class names for individual elements of the Scrubber component |
|
|
925
|
-
| `hideBeaconLabels` | `boolean` | No |
|
|
926
|
+
| `hideBeaconLabels` | `boolean` | No | `true in horizontal layout, false in vertical layout.` | Hides the beacon labels while keeping the line label visible (if provided). |
|
|
926
927
|
| `hideLine` | `boolean` | No | `-` | Hides the scrubber line. |
|
|
927
928
|
| `hideOverlay` | `boolean` | No | `-` | Hides the overlay rect which obscures data beyond the scrubber position. |
|
|
928
929
|
| `idlePulse` | `boolean` | No | `-` | Pulse the beacons while at rest. |
|
|
@@ -498,6 +498,72 @@ function ReducedMotionTray() {
|
|
|
498
498
|
}
|
|
499
499
|
```
|
|
500
500
|
|
|
501
|
+
#### Scrollable content and keyboard navigation
|
|
502
|
+
|
|
503
|
+
If the Tray has content which is expected to overflow and doesn't have focusable elements, set the following props to ensure the scrollable content can be navigated using keyboard arrows:
|
|
504
|
+
|
|
505
|
+
- `focusTabIndexElements`: `true`
|
|
506
|
+
- `disableArrowKeyNavigation`: `true`
|
|
507
|
+
|
|
508
|
+
As well, assign a `tabIndex` greater than or equal to `0` to the Tray's content so that the overflow can be reached via keyboard.
|
|
509
|
+
|
|
510
|
+
```jsx live
|
|
511
|
+
function ScrollableTray() {
|
|
512
|
+
const [visible, setVisible] = useState(false);
|
|
513
|
+
const { isPhone } = useBreakpoints();
|
|
514
|
+
const handleOpen = () => setVisible(true);
|
|
515
|
+
const handleClose = () => setVisible(false);
|
|
516
|
+
|
|
517
|
+
return (
|
|
518
|
+
<VStack gap={2}>
|
|
519
|
+
<Button onClick={handleOpen}>Open Tray</Button>
|
|
520
|
+
{visible && (
|
|
521
|
+
<Tray
|
|
522
|
+
focusTabIndexElements
|
|
523
|
+
disableArrowKeyNavigation
|
|
524
|
+
pin={isPhone ? 'bottom' : 'right'}
|
|
525
|
+
showHandleBar={isPhone}
|
|
526
|
+
onCloseComplete={handleClose}
|
|
527
|
+
title="Scrollable Tray"
|
|
528
|
+
footer={({ handleClose }) => (
|
|
529
|
+
<PageFooter
|
|
530
|
+
borderedTop
|
|
531
|
+
justifyContent={isPhone ? 'center' : 'flex-end'}
|
|
532
|
+
action={
|
|
533
|
+
<Button block={isPhone} onClick={handleClose}>
|
|
534
|
+
Close
|
|
535
|
+
</Button>
|
|
536
|
+
}
|
|
537
|
+
/>
|
|
538
|
+
)}
|
|
539
|
+
>
|
|
540
|
+
<VStack tabIndex={0}>
|
|
541
|
+
<Text font="title1" paddingBottom={10}>
|
|
542
|
+
This tray has content which will overflow.
|
|
543
|
+
</Text>
|
|
544
|
+
<Text font="title1" paddingBottom={10}>
|
|
545
|
+
To enable keyboard scrolling, certain props have to be set.
|
|
546
|
+
</Text>
|
|
547
|
+
<Text font="title1" paddingBottom={10}>
|
|
548
|
+
Otherwise, the content won't be viewable to users who navigate using a keyboard.
|
|
549
|
+
</Text>
|
|
550
|
+
<Text font="title1" paddingBottom={10}>
|
|
551
|
+
It's important to account for this to ensure an accessible experience.
|
|
552
|
+
</Text>
|
|
553
|
+
<Text font="title1" paddingBottom={10}>
|
|
554
|
+
Here's some text that is in the overflow and needs to be scrolled to.
|
|
555
|
+
</Text>
|
|
556
|
+
<Text font="title1" paddingBottom={10}>
|
|
557
|
+
Here's some more text to help more easily showcase scrolling.
|
|
558
|
+
</Text>
|
|
559
|
+
</VStack>
|
|
560
|
+
</Tray>
|
|
561
|
+
)}
|
|
562
|
+
</VStack>
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
```
|
|
566
|
+
|
|
501
567
|
### Styling
|
|
502
568
|
|
|
503
569
|
The Tray component exposes `styles` and `classNames` props for customizing various parts of the component. Available keys include: `root`, `overlay`, `container`, `header`, `title`, `content`, `footer`, `handleBar`, `handleBarHandle`, and `closeButton`.
|
|
@@ -1186,7 +1252,8 @@ function ResponsiveTrayExample() {
|
|
|
1186
1252
|
| `classNames` | `{ readonly root?: string; readonly overlay?: string \| undefined; readonly container?: string \| undefined; readonly header?: string \| undefined; readonly title?: string \| undefined; readonly content?: string \| undefined; readonly handleBar?: string \| undefined; readonly handleBarHandle?: string \| undefined; readonly closeButton?: string \| undefined; } \| undefined` | No | `-` | - |
|
|
1187
1253
|
| `closeAccessibilityHint` | `string` | No | `-` | Sets an accessible hint or description for the close button. On web, maps to aria-describedby and lists the id(s) of the element(s) that describe the element on which the attribute is set. On mobile, a string that helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label. |
|
|
1188
1254
|
| `closeAccessibilityLabel` | `string` | No | `-` | Sets an accessible label for the close button. On web, maps to aria-label and defines a string value that labels an interactive element. On mobile, VoiceOver will read this string when a user selects the associated element. |
|
|
1189
|
-
| `
|
|
1255
|
+
| `disableArrowKeyNavigation` | `boolean` | No | `false` | If true, the focus trap will not allow arrow key navigation. |
|
|
1256
|
+
| `focusTabIndexElements` | `boolean` | No | `false` | If true, the focus trap will include all elements with tabIndex values in the list of focusable elements. |
|
|
1190
1257
|
| `footer` | `ReactNode \| TrayRenderChildren` | No | `-` | ReactNode to render as the Drawer footer. Can be a ReactNode or a function that receives { handleClose }. |
|
|
1191
1258
|
| `header` | `ReactNode \| TrayRenderChildren` | No | `-` | ReactNode to render as the Drawer header. Can be a ReactNode or a function that receives { handleClose }. |
|
|
1192
1259
|
| `hideCloseButton` | `boolean` | No | ``true` when handlebar is shown, false otherwise.` | Hide the close icon on the top right. |
|
|
@@ -1199,7 +1266,7 @@ function ResponsiveTrayExample() {
|
|
|
1199
1266
|
| `preventDismiss` | `boolean` | No | `-` | Prevents a user from dismissing the tray by pressing the overlay or swiping |
|
|
1200
1267
|
| `reduceMotion` | `boolean` | No | `-` | When true, the tray will use opacity animation instead of transform animation. This is useful for supporting reduced motion for accessibility. |
|
|
1201
1268
|
| `ref` | `((instance: TrayRefProps \| null) => void) \| RefObject<TrayRefProps> \| null` | No | `-` | - |
|
|
1202
|
-
| `restoreFocusOnUnmount` | `boolean` | No | `true` | If true, the focus trap will restore focus to the previously focused element when it unmounts.
|
|
1269
|
+
| `restoreFocusOnUnmount` | `boolean` | No | `true` | If true, the focus trap will restore focus to the previously focused element when it unmounts. |
|
|
1203
1270
|
| `role` | `dialog \| alertdialog` | No | `-` | WAI-ARIA Roles |
|
|
1204
1271
|
| `showHandleBar` | `boolean` | No | `-` | Show a handle bar indicator at the top of the tray. The handle bar is positioned inside the tray content area. |
|
|
1205
1272
|
| `styles` | `{ readonly root?: CSSProperties; readonly overlay?: CSSProperties \| undefined; readonly container?: CSSProperties \| undefined; readonly header?: CSSProperties \| undefined; readonly title?: CSSProperties \| undefined; readonly content?: CSSProperties \| undefined; readonly handleBar?: CSSProperties \| undefined; readonly handleBarHandle?: CSSProperties \| undefined; readonly closeButton?: CSSProperties \| undefined; } \| undefined` | No | `-` | - |
|
|
@@ -34,6 +34,58 @@ The XAxis component provides a horizontal axis for charts with automatic tick ge
|
|
|
34
34
|
</CartesianChart>
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
### Multiple X Axes (Horizontal Layout)
|
|
38
|
+
|
|
39
|
+
When `layout="horizontal"`, you can configure multiple x-axes and bind each series to an axis with `xAxisId`.
|
|
40
|
+
Use `XAxis`'s `axisId` prop to render each axis configuration.
|
|
41
|
+
|
|
42
|
+
```jsx live
|
|
43
|
+
<CartesianChart
|
|
44
|
+
enableScrubbing
|
|
45
|
+
height={300}
|
|
46
|
+
layout="horizontal"
|
|
47
|
+
series={[
|
|
48
|
+
{
|
|
49
|
+
id: 'temperature',
|
|
50
|
+
label: 'Temperature',
|
|
51
|
+
data: [72, 68, 74, 70],
|
|
52
|
+
color: 'var(--color-accentBoldBlue)',
|
|
53
|
+
xAxisId: 'temperature-axis',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'volume',
|
|
57
|
+
label: 'Volume',
|
|
58
|
+
data: [1200, 900, 1500, 1100],
|
|
59
|
+
color: 'var(--color-accentBoldOrange)',
|
|
60
|
+
xAxisId: 'volume-axis',
|
|
61
|
+
},
|
|
62
|
+
]}
|
|
63
|
+
xAxis={[
|
|
64
|
+
{
|
|
65
|
+
id: 'temperature-axis',
|
|
66
|
+
domain: { min: 60, max: 80 },
|
|
67
|
+
domainLimit: 'strict',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'volume-axis',
|
|
71
|
+
domain: { min: 0, max: 2000 },
|
|
72
|
+
domainLimit: 'strict',
|
|
73
|
+
},
|
|
74
|
+
]}
|
|
75
|
+
yAxis={{
|
|
76
|
+
scaleType: 'band',
|
|
77
|
+
data: ['Mon', 'Tue', 'Wed', 'Thu'],
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<YAxis showLine showTickMarks />
|
|
81
|
+
<XAxis axisId="temperature-axis" label="Temp (F)" position="bottom" showLine />
|
|
82
|
+
<XAxis axisId="volume-axis" label="Volume" position="top" showLine />
|
|
83
|
+
<Line seriesId="temperature" />
|
|
84
|
+
<Line seriesId="volume" />
|
|
85
|
+
<Scrubber />
|
|
86
|
+
</CartesianChart>
|
|
87
|
+
```
|
|
88
|
+
|
|
37
89
|
### Axis Config
|
|
38
90
|
|
|
39
91
|
Properties related to the scale of an axis are set on the Chart component. This includes `scaleType`, `domain`, `domainLimit`, `range`, `data`, and `categoryPadding`.
|
|
@@ -769,6 +821,7 @@ function CustomTickLabelExample() {
|
|
|
769
821
|
| `LineComponent` | `LineComponent` | No | `SolidLine` | Component to render the axis line. |
|
|
770
822
|
| `TickLabelComponent` | `AxisTickLabelComponent` | No | `DefaultAxisTickLabel` | Component to render tick labels. Allows for custom styling and formatting that works cross-platform. |
|
|
771
823
|
| `TickMarkLineComponent` | `LineComponent` | No | `SolidLine` | Component to render the tick marks. |
|
|
824
|
+
| `axisId` | `string` | No | `-` | The ID of the axis to render. Defaults to defaultAxisId if not specified. |
|
|
772
825
|
| `bandGridLinePlacement` | `end \| start \| middle \| edges` | No | `'edges'` | Placement of grid lines relative to each band. Options: start, middle, end, edges |
|
|
773
826
|
| `bandTickMarkPlacement` | `end \| start \| middle \| edges` | No | `'middle'` | Placement of tick marks relative to each band. Options: start, middle, end, edges |
|
|
774
827
|
| `className` | `string` | No | `-` | Custom className for the axis. |
|
|
@@ -778,7 +831,7 @@ function CustomTickLabelExample() {
|
|
|
778
831
|
| `labelGap` | `number` | No | `4` | Gap between the tick labels and the axis label. |
|
|
779
832
|
| `minTickLabelGap` | `number` | No | `4` | Minimum gap between tick labels. Labels will be hidden if they are closer than this gap. |
|
|
780
833
|
| `position` | `top \| bottom` | No | `'bottom'` | The position of the axis relative to the charts drawing area. |
|
|
781
|
-
| `requestedTickCount` | `number` | No | `5
|
|
834
|
+
| `requestedTickCount` | `number` | No | `5 for value axes by layout: - X axis when chart layout is horizontal - Y axis when chart layout is vertical` | Requested number of ticks to display. This value is passed into d3 and may not be respected. |
|
|
782
835
|
| `showGrid` | `boolean` | No | `-` | Whether to show grid lines at each tick position. |
|
|
783
836
|
| `showLine` | `boolean` | No | `-` | Whether to show the axis line. |
|
|
784
837
|
| `showTickMarks` | `boolean` | No | `-` | Whether to show tick marks on the axis. |
|
|
@@ -786,7 +839,7 @@ function CustomTickLabelExample() {
|
|
|
786
839
|
| `styles` | `{ root?: CSSProperties; label?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the axis. |
|
|
787
840
|
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
|
|
788
841
|
| `tickInterval` | `number` | No | `32 (for x-axis)` | Interval at which to show ticks. When provided, calculates tick count based on available space. |
|
|
789
|
-
| `tickLabelFormatter` | `((value: number) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. |
|
|
842
|
+
| `tickLabelFormatter` | `((value: number) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. For band scales with string data, the value will be the string label (e.g., Jan, Feb). For numeric scales, the value will be the number. |
|
|
790
843
|
| `tickMarkLabelGap` | `number` | No | `2 for x-axis, 8 for y-axis` | Space between the axis tick mark and labels. If tick marks are not shown, this is the gap between the axis and the chart. |
|
|
791
844
|
| `tickMarkSize` | `number` | No | `4` | Size of the tick marks. |
|
|
792
845
|
| `tickMaxStep` | `number` | No | `-` | Maximum step size for tick generation. Prevents the step from being larger than this value. |
|