@coinbase/cds-mcp-server 8.23.0 → 8.25.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.
- package/CHANGELOG.md +8 -0
- package/mcp-docs/mobile/components/DatePicker.txt +35 -0
- package/mcp-docs/mobile/components/SelectAlpha.txt +33 -0
- package/mcp-docs/mobile/components/Tag.txt +24 -40
- package/mcp-docs/mobile/components/TextInput.txt +20 -0
- package/mcp-docs/web/components/DatePicker.txt +35 -0
- package/mcp-docs/web/components/SelectAlpha.txt +33 -0
- package/mcp-docs/web/components/Tag.txt +88 -46
- package/mcp-docs/web/components/TextInput.txt +23 -0
- package/mcp-docs/web/components/Tooltip.txt +24 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.25.0 ((12/1/2025, 07:38 AM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.24.0 ((12/1/2025, 06:51 AM PST))
|
|
16
|
+
|
|
17
|
+
This is an artificial version bump with no new change.
|
|
18
|
+
|
|
11
19
|
## 8.23.0 ((12/1/2025, 06:33 AM PST))
|
|
12
20
|
|
|
13
21
|
This is an artificial version bump with no new change.
|
|
@@ -36,6 +36,40 @@ function Example() {
|
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
### Custom Label
|
|
40
|
+
|
|
41
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can use the `labelNode` prop.
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
function Example() {
|
|
45
|
+
const [date, setDate] = useState(null);
|
|
46
|
+
const [error, setError] = useState(null);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<DatePicker
|
|
50
|
+
date={date}
|
|
51
|
+
error={error}
|
|
52
|
+
onChangeDate={setDate}
|
|
53
|
+
onErrorDate={setError}
|
|
54
|
+
label="Birthdate"
|
|
55
|
+
labelNode={
|
|
56
|
+
<HStack alignItems="center" gap={1}>
|
|
57
|
+
<InputLabel>Birthdate</InputLabel>
|
|
58
|
+
<Tooltip content="This will be visible to other users.">
|
|
59
|
+
<Icon color="fgMuted" name="info" size="xs" />
|
|
60
|
+
</Tooltip>
|
|
61
|
+
</HStack>
|
|
62
|
+
}
|
|
63
|
+
calendarIconButtonAccessibilityLabel="Birthdate calendar"
|
|
64
|
+
nextArrowAccessibilityLabel="Next month"
|
|
65
|
+
previousArrowAccessibilityLabel="Previous month"
|
|
66
|
+
helperTextErrorIconAccessibilityLabel="Error"
|
|
67
|
+
invalidDateError="Please enter a valid date"
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
39
73
|
### Invalid dates
|
|
40
74
|
|
|
41
75
|
Always provide the `invalidDateError` prop for when users type an impossible date like 99/99/2000.
|
|
@@ -420,6 +454,7 @@ function Example() {
|
|
|
420
454
|
| `keyboardAppearance` | `light \| default \| dark` | No | `-` | Determines the color of the keyboard. |
|
|
421
455
|
| `keyboardType` | `default \| url \| number-pad \| decimal-pad \| numeric \| email-address \| phone-pad \| visible-password \| ascii-capable \| numbers-and-punctuation \| name-phone-pad \| twitter \| web-search` | No | `-` | enum(default, numeric, email-address, ascii-capable, numbers-and-punctuation, url, number-pad, phone-pad, name-phone-pad, decimal-pad, twitter, web-search, visible-password) Determines which keyboard to open, e.g.numeric. The following values work across platforms: - default - numeric - email-address - phone-pad The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search The following values work on Android: - visible-password |
|
|
422
456
|
| `label` | `string` | No | `-` | Short messageArea indicating purpose of input |
|
|
457
|
+
| `labelNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | React node to render label. Takes precedence over label. |
|
|
423
458
|
| `labelVariant` | `inside \| outside` | No | `'outside'` | The variant of the label. Only used when compact is not true. |
|
|
424
459
|
| `lineBreakStrategyIOS` | `none \| standard \| hangul-word \| push-out` | No | `-` | Set line break strategy on iOS. |
|
|
425
460
|
| `maxDate` | `Date` | No | `-` | Maximum date allowed to be selected, inclusive. Dates after the maxDate are disabled. All navigation to months after the maxDate is disabled. |
|
|
@@ -1131,6 +1131,39 @@ function CustomClassNamesExamples() {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
```
|
|
1133
1133
|
|
|
1134
|
+
### Custom Label
|
|
1135
|
+
|
|
1136
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can pass a React Node to the `label` prop.
|
|
1137
|
+
|
|
1138
|
+
```jsx
|
|
1139
|
+
function CustomLabelExample() {
|
|
1140
|
+
const [value, setValue] = useState('1');
|
|
1141
|
+
|
|
1142
|
+
const options = [
|
|
1143
|
+
{ value: '1', label: 'Option 1' },
|
|
1144
|
+
{ value: '2', label: 'Option 2' },
|
|
1145
|
+
{ value: '3', label: 'Option 3' },
|
|
1146
|
+
];
|
|
1147
|
+
|
|
1148
|
+
return (
|
|
1149
|
+
<Select
|
|
1150
|
+
label={
|
|
1151
|
+
<HStack alignItems="center" gap={1}>
|
|
1152
|
+
Custom Label
|
|
1153
|
+
<Tooltip content="This will be visible to other users.">
|
|
1154
|
+
<Icon color="fgMuted" name="info" size="xs" />
|
|
1155
|
+
</Tooltip>
|
|
1156
|
+
</HStack>
|
|
1157
|
+
}
|
|
1158
|
+
value={value}
|
|
1159
|
+
onChange={setValue}
|
|
1160
|
+
options={options}
|
|
1161
|
+
placeholder="Select an option"
|
|
1162
|
+
/>
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
```
|
|
1166
|
+
|
|
1134
1167
|
### Custom components
|
|
1135
1168
|
|
|
1136
1169
|
Select is highly customizable. Use the _Component_ props to customize the various subcomponents in Select.
|
|
@@ -10,51 +10,43 @@ import { Tag } from '@coinbase/cds-mobile/tag/Tag'
|
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Basics
|
|
14
14
|
|
|
15
|
-
Informational
|
|
15
|
+
Informational tags (default) are used to note a characteristic or state of an object. Promotional tags for editorial, ephemeral communication.
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
|
-
<HStack
|
|
19
|
-
<Tag colorScheme="green">
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<Tag colorScheme="
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<HStack>
|
|
19
|
+
<Tag intent="informational" colorScheme="green">
|
|
20
|
+
Green
|
|
21
|
+
</Tag>
|
|
22
|
+
<Tag intent="promotional" colorScheme="green">
|
|
23
|
+
Green
|
|
24
|
+
</Tag>
|
|
25
25
|
</HStack>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
###
|
|
28
|
+
### Emphasis
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
You can control the visual prominence of the Tag using the `emphasis` prop. By default, informational tags are low emphasis and promotional tags are high emphasis.
|
|
31
31
|
|
|
32
32
|
```jsx
|
|
33
|
-
<HStack
|
|
34
|
-
<Tag
|
|
35
|
-
Green
|
|
36
|
-
</Tag>
|
|
37
|
-
<Tag intent="promotional" colorScheme="blue">
|
|
38
|
-
Blue
|
|
39
|
-
</Tag>
|
|
40
|
-
<Tag intent="promotional" colorScheme="yellow">
|
|
41
|
-
Yellow
|
|
33
|
+
<HStack>
|
|
34
|
+
<Tag emphasis="high" colorScheme="green">
|
|
35
|
+
High Green
|
|
42
36
|
</Tag>
|
|
43
37
|
<Tag intent="promotional" colorScheme="purple">
|
|
44
|
-
Purple
|
|
38
|
+
High Purple
|
|
45
39
|
</Tag>
|
|
46
|
-
<Tag
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<Tag intent="promotional" colorScheme="gray">
|
|
50
|
-
Gray
|
|
40
|
+
<Tag colorScheme="green">Low Green</Tag>
|
|
41
|
+
<Tag intent="promotional" emphasis="low" colorScheme="purple">
|
|
42
|
+
Low Purple
|
|
51
43
|
</Tag>
|
|
52
44
|
</HStack>
|
|
53
45
|
```
|
|
54
46
|
|
|
55
|
-
###
|
|
47
|
+
### Composed Examples
|
|
56
48
|
|
|
57
|
-
|
|
49
|
+
#### Account Status
|
|
58
50
|
|
|
59
51
|
```jsx
|
|
60
52
|
<HStack justifyContent="space-between" gap="2" alignItems="center">
|
|
@@ -69,18 +61,7 @@ To get a better idea of what it workng with Tags is like, we've created some exa
|
|
|
69
61
|
</HStack>
|
|
70
62
|
```
|
|
71
63
|
|
|
72
|
-
|
|
73
|
-
<HStack justifyContent="space-between" gap="2" alignItems="center">
|
|
74
|
-
<VStack gap={0.5}>
|
|
75
|
-
<HStack gap={1}>
|
|
76
|
-
<TextHeadline as="p">Tax account status</TextHeadline>
|
|
77
|
-
<Tag colorScheme="red">Not verified</Tag>
|
|
78
|
-
</HStack>
|
|
79
|
-
<TextBody as="p">Verify your info for tax reporting purposes.</TextBody>
|
|
80
|
-
</VStack>
|
|
81
|
-
<Button>Get started</Button>
|
|
82
|
-
</HStack>
|
|
83
|
-
```
|
|
64
|
+
#### Margin Ratio
|
|
84
65
|
|
|
85
66
|
```jsx
|
|
86
67
|
function MarginExample() {
|
|
@@ -155,6 +136,8 @@ function MarginExample() {
|
|
|
155
136
|
}
|
|
156
137
|
```
|
|
157
138
|
|
|
139
|
+
#### List Cell Integration
|
|
140
|
+
|
|
158
141
|
```jsx
|
|
159
142
|
<Box justifyContent="center">
|
|
160
143
|
<Group divider={Divider} width="420px" bordered borderRadius={300} background elevation={1}>
|
|
@@ -232,6 +215,7 @@ function MarginExample() {
|
|
|
232
215
|
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
233
216
|
| `display` | `flex \| none` | No | `-` | - |
|
|
234
217
|
| `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
|
|
218
|
+
| `emphasis` | `low \| high` | No | `'low' when informational intent, 'high' when promotional intent` | Specify the emphasis of the Tag. |
|
|
235
219
|
| `flexBasis` | `string \| number` | No | `-` | - |
|
|
236
220
|
| `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
|
|
237
221
|
| `flexGrow` | `number` | No | `-` | - |
|
|
@@ -323,6 +323,25 @@ When using the `inside` label variant, you should always include a `placeholder`
|
|
|
323
323
|
/>
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
+
#### Custom Label
|
|
327
|
+
|
|
328
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can use the `labelNode` prop.
|
|
329
|
+
|
|
330
|
+
```jsx
|
|
331
|
+
<TextInput
|
|
332
|
+
label="Display name"
|
|
333
|
+
labelNode={
|
|
334
|
+
<HStack alignItems="center" gap={1}>
|
|
335
|
+
<InputLabel>Display name</InputLabel>
|
|
336
|
+
<Tooltip content="This will be visible to other users.">
|
|
337
|
+
<Icon active color="fg" name="info" size="xs" />
|
|
338
|
+
</Tooltip>
|
|
339
|
+
</HStack>
|
|
340
|
+
}
|
|
341
|
+
placeholder="Satoshi Nakamoto"
|
|
342
|
+
/>
|
|
343
|
+
```
|
|
344
|
+
|
|
326
345
|
### Example of Input Objects placed at the End
|
|
327
346
|
|
|
328
347
|
Here are some examples and best practices when using end content in a TextField.
|
|
@@ -648,6 +667,7 @@ function TextInputKeyboardExample() {
|
|
|
648
667
|
| `keyboardAppearance` | `light \| default \| dark` | No | `-` | Determines the color of the keyboard. |
|
|
649
668
|
| `keyboardType` | `default \| url \| number-pad \| decimal-pad \| numeric \| email-address \| phone-pad \| visible-password \| ascii-capable \| numbers-and-punctuation \| name-phone-pad \| twitter \| web-search` | No | `-` | enum(default, numeric, email-address, ascii-capable, numbers-and-punctuation, url, number-pad, phone-pad, name-phone-pad, decimal-pad, twitter, web-search, visible-password) Determines which keyboard to open, e.g.numeric. The following values work across platforms: - default - numeric - email-address - phone-pad The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search The following values work on Android: - visible-password |
|
|
650
669
|
| `label` | `string` | No | `-` | Short messageArea indicating purpose of input |
|
|
670
|
+
| `labelNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | React node to render label. Takes precedence over label. |
|
|
651
671
|
| `labelVariant` | `inside \| outside` | No | `'outside'` | The variant of the label. Only used when compact is not true. |
|
|
652
672
|
| `lineBreakStrategyIOS` | `none \| standard \| hangul-word \| push-out` | No | `-` | Set line break strategy on iOS. |
|
|
653
673
|
| `maxFontSizeMultiplier` | `number \| null` | No | `-` | Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: - null/undefined (default): inherit from the parent node or the global default (0) - 0: no max, ignore parent/global default - >= 1: sets the maxFontSizeMultiplier of this node to this value |
|
|
@@ -36,6 +36,40 @@ function Example() {
|
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
### Custom Label
|
|
40
|
+
|
|
41
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can use the `labelNode` prop.
|
|
42
|
+
|
|
43
|
+
```jsx live
|
|
44
|
+
function Example() {
|
|
45
|
+
const [date, setDate] = useState(null);
|
|
46
|
+
const [error, setError] = useState(null);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<DatePicker
|
|
50
|
+
date={date}
|
|
51
|
+
error={error}
|
|
52
|
+
onChangeDate={setDate}
|
|
53
|
+
onErrorDate={setError}
|
|
54
|
+
label="Birthdate"
|
|
55
|
+
labelNode={
|
|
56
|
+
<HStack alignItems="center" gap={1}>
|
|
57
|
+
<InputLabel>Birthdate</InputLabel>
|
|
58
|
+
<Tooltip content="This will be visible to other users.">
|
|
59
|
+
<Icon active color="fg" name="info" size="xs" tabIndex={0} />
|
|
60
|
+
</Tooltip>
|
|
61
|
+
</HStack>
|
|
62
|
+
}
|
|
63
|
+
calendarIconButtonAccessibilityLabel="Birthdate calendar"
|
|
64
|
+
nextArrowAccessibilityLabel="Next month"
|
|
65
|
+
previousArrowAccessibilityLabel="Previous month"
|
|
66
|
+
helperTextErrorIconAccessibilityLabel="Error"
|
|
67
|
+
invalidDateError="Please enter a valid date"
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
39
73
|
### Invalid dates
|
|
40
74
|
|
|
41
75
|
Always provide the `invalidDateError` prop for when users type an impossible date like 99/99/2000.
|
|
@@ -475,6 +509,7 @@ function Example() {
|
|
|
475
509
|
| `invalidDateError` | `string` | No | `'Please enter a valid date'` | Error text to display when an impossible date is selected, e.g. 99/99/2000. This should always be defined for accessibility. Also displays when a date is selected that is more than 100 years before the minDate, or more than 100 years after the maxDate. |
|
|
476
510
|
| `key` | `Key \| null` | No | `-` | - |
|
|
477
511
|
| `label` | `string` | No | `-` | Short messageArea indicating purpose of input |
|
|
512
|
+
| `labelNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | React node to render label. Takes precedence over label. |
|
|
478
513
|
| `labelVariant` | `inside \| outside` | No | `'outside'` | The variant of the label. Only used when compact is not true. |
|
|
479
514
|
| `maxDate` | `Date` | No | `-` | Maximum date allowed to be selected, inclusive. Dates after the maxDate are disabled. All navigation to months after the maxDate is disabled. |
|
|
480
515
|
| `minDate` | `Date` | No | `-` | Minimum date allowed to be selected, inclusive. Dates before the minDate are disabled. All navigation to months before the minDate is disabled. |
|
|
@@ -1037,6 +1037,39 @@ function CustomClassNamesExamples() {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
```
|
|
1039
1039
|
|
|
1040
|
+
### Custom Label
|
|
1041
|
+
|
|
1042
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can pass a React Node to the `label` prop.
|
|
1043
|
+
|
|
1044
|
+
```jsx live
|
|
1045
|
+
function CustomLabelExample() {
|
|
1046
|
+
const [value, setValue] = useState('1');
|
|
1047
|
+
|
|
1048
|
+
const options = [
|
|
1049
|
+
{ value: '1', label: 'Option 1' },
|
|
1050
|
+
{ value: '2', label: 'Option 2' },
|
|
1051
|
+
{ value: '3', label: 'Option 3' },
|
|
1052
|
+
];
|
|
1053
|
+
|
|
1054
|
+
return (
|
|
1055
|
+
<Select
|
|
1056
|
+
label={
|
|
1057
|
+
<HStack alignItems="center" gap={1}>
|
|
1058
|
+
Custom Label
|
|
1059
|
+
<Tooltip content="This will be visible to other users.">
|
|
1060
|
+
<Icon active color="fg" name="info" size="xs" tabIndex={0} />
|
|
1061
|
+
</Tooltip>
|
|
1062
|
+
</HStack>
|
|
1063
|
+
}
|
|
1064
|
+
value={value}
|
|
1065
|
+
onChange={setValue}
|
|
1066
|
+
options={options}
|
|
1067
|
+
placeholder="Select an option"
|
|
1068
|
+
/>
|
|
1069
|
+
);
|
|
1070
|
+
}
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1040
1073
|
### Custom components
|
|
1041
1074
|
|
|
1042
1075
|
Select is highly customizable. Use the _Component_ props to customize the various subcomponents in Select.
|
|
@@ -10,51 +10,101 @@ import { Tag } from '@coinbase/cds-web/tag/Tag'
|
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### Basics
|
|
14
14
|
|
|
15
|
-
Informational
|
|
15
|
+
Informational tags (default) are used to note a characteristic or state of an object. Promotional tags for editorial, ephemeral communication.
|
|
16
16
|
|
|
17
17
|
```jsx live
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
18
|
+
<VStack gap={2}>
|
|
19
|
+
<HStack gap={2} wrap>
|
|
20
|
+
<Tag intent="informational" colorScheme="green">
|
|
21
|
+
Green
|
|
22
|
+
</Tag>
|
|
23
|
+
<Tag intent="informational" colorScheme="blue">
|
|
24
|
+
Blue
|
|
25
|
+
</Tag>
|
|
26
|
+
<Tag intent="informational" colorScheme="yellow">
|
|
27
|
+
Yellow
|
|
28
|
+
</Tag>
|
|
29
|
+
<Tag intent="informational" colorScheme="purple">
|
|
30
|
+
Purple
|
|
31
|
+
</Tag>
|
|
32
|
+
<Tag intent="informational" colorScheme="red">
|
|
33
|
+
Red
|
|
34
|
+
</Tag>
|
|
35
|
+
<Tag intent="informational" colorScheme="gray">
|
|
36
|
+
Gray
|
|
37
|
+
</Tag>
|
|
38
|
+
</HStack>
|
|
39
|
+
<HStack gap={2} wrap>
|
|
40
|
+
<Tag intent="promotional" colorScheme="green">
|
|
41
|
+
Green
|
|
42
|
+
</Tag>
|
|
43
|
+
<Tag intent="promotional" colorScheme="blue">
|
|
44
|
+
Blue
|
|
45
|
+
</Tag>
|
|
46
|
+
<Tag intent="promotional" colorScheme="yellow">
|
|
47
|
+
Yellow
|
|
48
|
+
</Tag>
|
|
49
|
+
<Tag intent="promotional" colorScheme="purple">
|
|
50
|
+
Purple
|
|
51
|
+
</Tag>
|
|
52
|
+
<Tag intent="promotional" colorScheme="red">
|
|
53
|
+
Red
|
|
54
|
+
</Tag>
|
|
55
|
+
<Tag intent="promotional" colorScheme="gray">
|
|
56
|
+
Gray
|
|
57
|
+
</Tag>
|
|
58
|
+
</HStack>
|
|
59
|
+
</VStack>
|
|
26
60
|
```
|
|
27
61
|
|
|
28
|
-
###
|
|
62
|
+
### Emphasis
|
|
29
63
|
|
|
30
|
-
|
|
64
|
+
You can control the visual prominence of the Tag using the `emphasis` prop. By default, informational tags are low emphasis and promotional tags are high emphasis.
|
|
31
65
|
|
|
32
66
|
```jsx live
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</
|
|
67
|
+
<VStack gap={2}>
|
|
68
|
+
<HStack gap={2} wrap>
|
|
69
|
+
<Tag emphasis="high" colorScheme="green">
|
|
70
|
+
High Green
|
|
71
|
+
</Tag>
|
|
72
|
+
<Tag emphasis="high" colorScheme="blue">
|
|
73
|
+
High Blue
|
|
74
|
+
</Tag>
|
|
75
|
+
<Tag emphasis="high" colorScheme="yellow">
|
|
76
|
+
High Yellow
|
|
77
|
+
</Tag>
|
|
78
|
+
<Tag intent="promotional" colorScheme="purple">
|
|
79
|
+
High Purple
|
|
80
|
+
</Tag>
|
|
81
|
+
<Tag intent="promotional" colorScheme="red">
|
|
82
|
+
High Red
|
|
83
|
+
</Tag>
|
|
84
|
+
<Tag intent="promotional" colorScheme="gray">
|
|
85
|
+
High Gray
|
|
86
|
+
</Tag>
|
|
87
|
+
</HStack>
|
|
88
|
+
<HStack gap={2} wrap>
|
|
89
|
+
<Tag colorScheme="green">Low Green</Tag>
|
|
90
|
+
<Tag colorScheme="blue">Low Blue</Tag>
|
|
91
|
+
<Tag colorScheme="yellow">Low Yellow</Tag>
|
|
92
|
+
<Tag intent="promotional" emphasis="low" colorScheme="purple">
|
|
93
|
+
Low Purple
|
|
94
|
+
</Tag>
|
|
95
|
+
<Tag intent="promotional" emphasis="low" colorScheme="red">
|
|
96
|
+
Low Red
|
|
97
|
+
</Tag>
|
|
98
|
+
<Tag intent="promotional" emphasis="low" colorScheme="gray">
|
|
99
|
+
Low Gray
|
|
100
|
+
</Tag>
|
|
101
|
+
</HStack>
|
|
102
|
+
</VStack>
|
|
53
103
|
```
|
|
54
104
|
|
|
55
|
-
###
|
|
105
|
+
### Composed Examples
|
|
56
106
|
|
|
57
|
-
|
|
107
|
+
#### Account Status
|
|
58
108
|
|
|
59
109
|
```jsx live
|
|
60
110
|
<HStack justifyContent="space-between" gap="2" alignItems="center">
|
|
@@ -69,18 +119,7 @@ To get a better idea of what it workng with Tags is like, we've created some exa
|
|
|
69
119
|
</HStack>
|
|
70
120
|
```
|
|
71
121
|
|
|
72
|
-
|
|
73
|
-
<HStack justifyContent="space-between" gap="2" alignItems="center">
|
|
74
|
-
<VStack gap={0.5}>
|
|
75
|
-
<HStack gap={1}>
|
|
76
|
-
<TextHeadline as="p">Tax account status</TextHeadline>
|
|
77
|
-
<Tag colorScheme="red">Not verified</Tag>
|
|
78
|
-
</HStack>
|
|
79
|
-
<TextBody as="p">Verify your info for tax reporting purposes.</TextBody>
|
|
80
|
-
</VStack>
|
|
81
|
-
<Button>Get started</Button>
|
|
82
|
-
</HStack>
|
|
83
|
-
```
|
|
122
|
+
#### Margin Ratio
|
|
84
123
|
|
|
85
124
|
```jsx live
|
|
86
125
|
function MarginExample() {
|
|
@@ -155,6 +194,8 @@ function MarginExample() {
|
|
|
155
194
|
}
|
|
156
195
|
```
|
|
157
196
|
|
|
197
|
+
#### List Cell Integration
|
|
198
|
+
|
|
158
199
|
```jsx live
|
|
159
200
|
<Box justifyContent="center">
|
|
160
201
|
<Group divider={Divider} width="420px" bordered borderRadius={300} background elevation={1}>
|
|
@@ -232,6 +273,7 @@ function MarginExample() {
|
|
|
232
273
|
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
233
274
|
| `display` | `ResponsiveProp<grid \| revert \| none \| block \| inline \| inline-block \| flex \| inline-flex \| inline-grid \| contents \| flow-root \| list-item>` | No | `-` | - |
|
|
234
275
|
| `elevation` | `0 \| 1 \| 2` | No | `-` | - |
|
|
276
|
+
| `emphasis` | `low \| high` | No | `'low' when informational intent, 'high' when promotional intent` | Specify the emphasis of the Tag. |
|
|
235
277
|
| `flexBasis` | `ResponsiveProp<FlexBasis<string \| number>>` | No | `-` | - |
|
|
236
278
|
| `flexDirection` | `ResponsiveProp<column \| row \| row-reverse \| column-reverse>` | No | `-` | - |
|
|
237
279
|
| `flexGrow` | `inherit \| revert \| -moz-initial \| initial \| revert-layer \| unset` | No | `-` | - |
|
|
@@ -266,6 +266,28 @@ When using the `inside` label variant, you should always include a `placeholder`
|
|
|
266
266
|
</VStack>
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
+
#### Custom Label
|
|
270
|
+
|
|
271
|
+
If you need to render a custom label (e.g. a label with a tooltip), you can use the `labelNode` prop.
|
|
272
|
+
|
|
273
|
+
```jsx live
|
|
274
|
+
<TextInput
|
|
275
|
+
id="display-name-tooltip"
|
|
276
|
+
label="Display name"
|
|
277
|
+
labelNode={
|
|
278
|
+
<InputLabel htmlFor="display-name-tooltip">
|
|
279
|
+
<HStack alignItems="center" gap={1}>
|
|
280
|
+
Display name
|
|
281
|
+
<Tooltip content="This will be visible to other users.">
|
|
282
|
+
<Icon active color="fg" name="info" size="xs" tabIndex={0} />
|
|
283
|
+
</Tooltip>
|
|
284
|
+
</HStack>
|
|
285
|
+
</InputLabel>
|
|
286
|
+
}
|
|
287
|
+
placeholder="Satoshi Nakamoto"
|
|
288
|
+
/>
|
|
289
|
+
```
|
|
290
|
+
|
|
269
291
|
#### StartContent & EndContent
|
|
270
292
|
|
|
271
293
|
##### Examples of Input Objects placed at the Start
|
|
@@ -635,6 +657,7 @@ function TextInputKeyboardExample() {
|
|
|
635
657
|
| `inputNode` | `ReactElement` | No | `-` | Customize the element which the input area will be rendered as. Adds ability to render the input area as a <textarea />, <input /> etc... By default, the input area will be rendered as an <input />. |
|
|
636
658
|
| `key` | `Key \| null` | No | `-` | - |
|
|
637
659
|
| `label` | `string` | No | `-` | Short messageArea indicating purpose of input |
|
|
660
|
+
| `labelNode` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | React node to render label. Takes precedence over label. |
|
|
638
661
|
| `labelVariant` | `inside \| outside` | No | `'outside'` | The variant of the label. Only used when compact is not true. |
|
|
639
662
|
| `onChange` | `ChangeEventHandler<HTMLInputElement>` | No | `-` | - |
|
|
640
663
|
| `onClick` | `(MouseEventHandler<Element> & MouseEventHandler<HTMLInputElement>)` | No | `-` | Callback fired when pressed/clicked |
|
|
@@ -51,13 +51,13 @@ function TooltipPosition() {
|
|
|
51
51
|
<Box position="relative">
|
|
52
52
|
Set your default display currency.
|
|
53
53
|
<Tooltip content="I am not centered horizontally">
|
|
54
|
-
<Icon active color="fg" name="info" paddingStart={1} position="absolute" />
|
|
54
|
+
<Icon active color="fg" name="info" paddingStart={1} position="absolute" tabIndex={0} />
|
|
55
55
|
</Tooltip>
|
|
56
56
|
</Box>
|
|
57
57
|
<Box position="relative">
|
|
58
58
|
Set your default display currency.
|
|
59
59
|
<Tooltip content="I am centered horizontally" position="absolute">
|
|
60
|
-
<Icon active color="fg" name="info" paddingStart={1} />
|
|
60
|
+
<Icon active color="fg" name="info" paddingStart={1} tabIndex={0} />
|
|
61
61
|
</Tooltip>
|
|
62
62
|
</Box>
|
|
63
63
|
</VStack>
|
|
@@ -81,6 +81,28 @@ function TooltipColorSchemeOptOut() {
|
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
### Tooltip in TextInput
|
|
85
|
+
|
|
86
|
+
You can use tooltips within `TextInput` to provide more context.
|
|
87
|
+
|
|
88
|
+
```jsx live
|
|
89
|
+
<TextInput
|
|
90
|
+
id="tooltip-input-example"
|
|
91
|
+
label="Display name"
|
|
92
|
+
labelNode={
|
|
93
|
+
<InputLabel htmlFor="tooltip-input-example">
|
|
94
|
+
<HStack alignItems="center" gap={1}>
|
|
95
|
+
Display name
|
|
96
|
+
<Tooltip content="This will be visible to other users.">
|
|
97
|
+
<Icon active color="fg" name="info" size="xs" tabIndex={0} />
|
|
98
|
+
</Tooltip>
|
|
99
|
+
</HStack>
|
|
100
|
+
</InputLabel>
|
|
101
|
+
}
|
|
102
|
+
placeholder="Satoshi Nakamoto"
|
|
103
|
+
/>
|
|
104
|
+
```
|
|
105
|
+
|
|
84
106
|
## Props
|
|
85
107
|
|
|
86
108
|
| Prop | Type | Required | Default | Description |
|