@iress-oss/ids-components 6.0.0-alpha.44 → 6.0.0-alpha.45
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/components/tag.md
CHANGED
|
@@ -27,10 +27,42 @@ Use tags for **categorization and selection** where users need to interact with
|
|
|
27
27
|
|
|
28
28
|
Tags are **interactive** - they can be clicked and deleted by users.
|
|
29
29
|
|
|
30
|
-
**Not sure?** If you need to display status or highlight information without user interaction, use [
|
|
30
|
+
**Not sure?** If you need to display status or highlight information without user interaction, use [Pill](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/docs/components_components-pill--docs) instead.
|
|
31
31
|
|
|
32
32
|
## Usage
|
|
33
33
|
|
|
34
|
+
### Mode
|
|
35
|
+
|
|
36
|
+
The `mode` prop controls the colour scheme of the tag. Use data palette colours (`10`-`90`) for non-semantic colour needs.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<IressInline gap="sm">
|
|
40
|
+
{BADGE_MODES.map((mode) => (
|
|
41
|
+
<IressTag key={mode} mode={mode}>
|
|
42
|
+
{mode}
|
|
43
|
+
</IressTag>
|
|
44
|
+
))}
|
|
45
|
+
</IressInline>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
[View "Mode" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-tag--mode)
|
|
49
|
+
|
|
50
|
+
### Status mode
|
|
51
|
+
|
|
52
|
+
Use semantic status values (`danger`, `info`, `success`, `warning`) when tags need to communicate a system status.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<IressInline gap="sm">
|
|
56
|
+
{STATUSES.map((status) => (
|
|
57
|
+
<IressTag key={status} mode={status}>
|
|
58
|
+
{status}
|
|
59
|
+
</IressTag>
|
|
60
|
+
))}
|
|
61
|
+
</IressInline>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
[View "Status" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-tag--status)
|
|
65
|
+
|
|
34
66
|
### Clickable tags
|
|
35
67
|
|
|
36
68
|
Tags can be made clickable by passing an `onClick` handler. This will apply hover styles to the tag to indicate it is clickable.
|
|
@@ -19,11 +19,11 @@ interface TagBaseProps {
|
|
|
19
19
|
*/
|
|
20
20
|
deleteButtonText?: string;
|
|
21
21
|
/**
|
|
22
|
-
* Style of the tag, based on the data colour palette.
|
|
23
|
-
* Can be a number (10-90)
|
|
22
|
+
* Style of the tag, based on the data colour palette (10-90) or system status colours (danger, info, success, warning).
|
|
23
|
+
* Can be a number (10-90), a string ('10'-'90'), or a system status ('danger', 'info', 'success', 'warning').
|
|
24
24
|
* @default '90'
|
|
25
25
|
*/
|
|
26
|
-
mode?: 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | '10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90';
|
|
26
|
+
mode?: 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | '10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90' | 'danger' | 'info' | 'success' | 'warning';
|
|
27
27
|
/**
|
|
28
28
|
* Callback triggered when the tag is deleted
|
|
29
29
|
*/
|
|
@@ -116,5 +116,33 @@ export declare const tag: import('../../styled-system/types').SlotRecipeRuntimeF
|
|
|
116
116
|
'--tag-color': "{colors.colour.data.bold.90}";
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
|
+
danger: {
|
|
120
|
+
root: {
|
|
121
|
+
'--tag-bg': "{colors.colour.system.danger.surface}";
|
|
122
|
+
'--tag-border': "{colors.colour.system.danger.surface}";
|
|
123
|
+
'--tag-color': "{colors.colour.system.danger.text}";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
info: {
|
|
127
|
+
root: {
|
|
128
|
+
'--tag-bg': "{colors.colour.system.info.surface}";
|
|
129
|
+
'--tag-border': "{colors.colour.system.info.surface}";
|
|
130
|
+
'--tag-color': "{colors.colour.system.info.text}";
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
success: {
|
|
134
|
+
root: {
|
|
135
|
+
'--tag-bg': "{colors.colour.system.success.surface}";
|
|
136
|
+
'--tag-border': "{colors.colour.system.success.surface}";
|
|
137
|
+
'--tag-color': "{colors.colour.system.success.text}";
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
warning: {
|
|
141
|
+
root: {
|
|
142
|
+
'--tag-bg': "{colors.colour.system.warning.surface}";
|
|
143
|
+
'--tag-border': "{colors.colour.system.warning.surface}";
|
|
144
|
+
'--tag-color': "{colors.colour.system.warning.text}";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
119
147
|
};
|
|
120
148
|
}>;
|
|
@@ -152,6 +152,34 @@ const t = o({
|
|
|
152
152
|
"--tag-border": "{colors.colour.data.subtle.90}",
|
|
153
153
|
"--tag-color": "{colors.colour.data.bold.90}"
|
|
154
154
|
}
|
|
155
|
+
},
|
|
156
|
+
danger: {
|
|
157
|
+
root: {
|
|
158
|
+
"--tag-bg": "{colors.colour.system.danger.surface}",
|
|
159
|
+
"--tag-border": "{colors.colour.system.danger.surface}",
|
|
160
|
+
"--tag-color": "{colors.colour.system.danger.text}"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
info: {
|
|
164
|
+
root: {
|
|
165
|
+
"--tag-bg": "{colors.colour.system.info.surface}",
|
|
166
|
+
"--tag-border": "{colors.colour.system.info.surface}",
|
|
167
|
+
"--tag-color": "{colors.colour.system.info.text}"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
success: {
|
|
171
|
+
root: {
|
|
172
|
+
"--tag-bg": "{colors.colour.system.success.surface}",
|
|
173
|
+
"--tag-border": "{colors.colour.system.success.surface}",
|
|
174
|
+
"--tag-color": "{colors.colour.system.success.text}"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
warning: {
|
|
178
|
+
root: {
|
|
179
|
+
"--tag-bg": "{colors.colour.system.warning.surface}",
|
|
180
|
+
"--tag-border": "{colors.colour.system.warning.surface}",
|
|
181
|
+
"--tag-color": "{colors.colour.system.warning.text}"
|
|
182
|
+
}
|
|
155
183
|
}
|
|
156
184
|
}
|
|
157
185
|
},
|