@iress-oss/ids-mcp-server 0.0.1-dev.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/LICENSE.txt +201 -0
- package/README.md +93 -0
- package/dist/componentHandlers.js +241 -0
- package/dist/componentHandlers.test.js +380 -0
- package/dist/config.js +16 -0
- package/dist/index.js +53 -0
- package/dist/iressHandlers.js +144 -0
- package/dist/iressHandlers.test.js +316 -0
- package/dist/resourceHandlers.js +67 -0
- package/dist/resourceHandlers.test.js +352 -0
- package/dist/searchHandlers.js +287 -0
- package/dist/searchHandlers.test.js +524 -0
- package/dist/toolHandler.js +31 -0
- package/dist/toolHandler.test.js +369 -0
- package/dist/tools.js +165 -0
- package/dist/types.js +4 -0
- package/dist/utils.js +59 -0
- package/dist/utils.test.js +286 -0
- package/generated/docs/components-alert-docs.md +130 -0
- package/generated/docs/components-autocomplete-docs.md +754 -0
- package/generated/docs/components-autocomplete-recipes-docs.md +104 -0
- package/generated/docs/components-badge-docs.md +148 -0
- package/generated/docs/components-button-docs.md +362 -0
- package/generated/docs/components-button-recipes-docs.md +76 -0
- package/generated/docs/components-buttongroup-docs.md +310 -0
- package/generated/docs/components-card-docs.md +494 -0
- package/generated/docs/components-card-recipes-docs.md +89 -0
- package/generated/docs/components-checkbox-docs.md +193 -0
- package/generated/docs/components-checkboxgroup-docs.md +692 -0
- package/generated/docs/components-checkboxgroup-recipes-docs.md +119 -0
- package/generated/docs/components-col-docs.md +466 -0
- package/generated/docs/components-combobox-docs.md +1016 -0
- package/generated/docs/components-container-docs.md +91 -0
- package/generated/docs/components-divider-docs.md +176 -0
- package/generated/docs/components-expander-docs.md +215 -0
- package/generated/docs/components-field-docs.md +675 -0
- package/generated/docs/components-filter-docs.md +1109 -0
- package/generated/docs/components-form-docs.md +2442 -0
- package/generated/docs/components-form-recipes-docs.md +892 -0
- package/generated/docs/components-hide-docs.md +265 -0
- package/generated/docs/components-icon-docs.md +553 -0
- package/generated/docs/components-inline-docs.md +868 -0
- package/generated/docs/components-input-docs.md +335 -0
- package/generated/docs/components-input-recipes-docs.md +140 -0
- package/generated/docs/components-inputcurrency-docs.md +157 -0
- package/generated/docs/components-inputcurrency-recipes-docs.md +116 -0
- package/generated/docs/components-label-docs.md +135 -0
- package/generated/docs/components-menu-docs.md +704 -0
- package/generated/docs/components-menu-menuitem-docs.md +193 -0
- package/generated/docs/components-modal-docs.md +587 -0
- package/generated/docs/components-navbar-docs.md +291 -0
- package/generated/docs/components-navbar-recipes-docs.md +413 -0
- package/generated/docs/components-panel-docs.md +380 -0
- package/generated/docs/components-placeholder-docs.md +27 -0
- package/generated/docs/components-popover-docs.md +464 -0
- package/generated/docs/components-popover-recipes-docs.md +245 -0
- package/generated/docs/components-progress-docs.md +104 -0
- package/generated/docs/components-radio-docs.md +107 -0
- package/generated/docs/components-radiogroup-docs.md +683 -0
- package/generated/docs/components-readonly-docs.md +89 -0
- package/generated/docs/components-richselect-docs.md +2433 -0
- package/generated/docs/components-row-docs.md +877 -0
- package/generated/docs/components-select-docs.md +456 -0
- package/generated/docs/components-skeleton-docs.md +214 -0
- package/generated/docs/components-skeleton-recipes-docs.md +76 -0
- package/generated/docs/components-skiplink-docs.md +66 -0
- package/generated/docs/components-slideout-docs.md +538 -0
- package/generated/docs/components-slider-docs.md +346 -0
- package/generated/docs/components-spinner-docs.md +59 -0
- package/generated/docs/components-stack-docs.md +265 -0
- package/generated/docs/components-table-ag-grid-docs.md +2666 -0
- package/generated/docs/components-table-docs.md +1305 -0
- package/generated/docs/components-tabset-docs.md +341 -0
- package/generated/docs/components-tabset-tab-docs.md +86 -0
- package/generated/docs/components-tag-docs.md +115 -0
- package/generated/docs/components-text-docs.md +394 -0
- package/generated/docs/components-toaster-docs.md +294 -0
- package/generated/docs/components-toaster-toast-docs.md +157 -0
- package/generated/docs/components-toggle-docs.md +158 -0
- package/generated/docs/components-tooltip-docs.md +311 -0
- package/generated/docs/components-validationmessage-docs.md +241 -0
- package/generated/docs/contact-us-docs.md +27 -0
- package/generated/docs/extensions-editor-docs.md +288 -0
- package/generated/docs/extensions-editor-recipes-docs.md +39 -0
- package/generated/docs/foundations-accessibility-docs.md +62 -0
- package/generated/docs/foundations-colours-docs.md +257 -0
- package/generated/docs/foundations-consistency-docs.md +52 -0
- package/generated/docs/foundations-content-docs.md +23 -0
- package/generated/docs/foundations-introduction-docs.md +17 -0
- package/generated/docs/foundations-principles-docs.md +70 -0
- package/generated/docs/foundations-typography-docs.md +191 -0
- package/generated/docs/foundations-user-experience-docs.md +63 -0
- package/generated/docs/foundations-visual-design-docs.md +46 -0
- package/generated/docs/frequently-asked-questions-docs.md +53 -0
- package/generated/docs/get-started-develop-docs.md +48 -0
- package/generated/docs/get-started-using-storybook-docs.md +68 -0
- package/generated/docs/guidelines.md +812 -0
- package/generated/docs/introduction-docs.md +43 -0
- package/generated/docs/patterns-loading-docs.md +1304 -0
- package/generated/docs/resources-changelog-docs.md +6 -0
- package/generated/docs/resources-code-katas-docs.md +29 -0
- package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +437 -0
- package/generated/docs/themes-available-themes-docs.md +66 -0
- package/generated/docs/themes-introduction-docs.md +121 -0
- package/generated/docs/themes-tokens-docs.md +1200 -0
- package/generated/docs/versions-docs.md +17 -0
- package/package.json +81 -0
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
[](#text)Text
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
The `IressText` component allows you to set typographic styles either on one element, or a block on HTML elements.
|
|
8
|
+
|
|
9
|
+
The quick brown fox jumps over the lazy dog
|
|
10
|
+
|
|
11
|
+
Hide code
|
|
12
|
+
|
|
13
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
14
|
+
|
|
15
|
+
<IressText\>
|
|
16
|
+
The quick brown fox jumps over the lazy dog
|
|
17
|
+
</IressText\>
|
|
18
|
+
|
|
19
|
+
Copy
|
|
20
|
+
|
|
21
|
+
[](#usage)Usage
|
|
22
|
+
---------------
|
|
23
|
+
|
|
24
|
+
### [](#the-element-prop)The `element` prop
|
|
25
|
+
|
|
26
|
+
With the `element` prop you can select which HTML element you would like the text component to render as.
|
|
27
|
+
|
|
28
|
+
It renders as a `div` by default, but can also be set to any standard typography element.
|
|
29
|
+
|
|
30
|
+
This is a p element.
|
|
31
|
+
|
|
32
|
+
This is a div element.
|
|
33
|
+
|
|
34
|
+
This is a span element.
|
|
35
|
+
|
|
36
|
+
This is a h1 element.
|
|
37
|
+
=====================
|
|
38
|
+
|
|
39
|
+
This is a h2 element.
|
|
40
|
+
---------------------
|
|
41
|
+
|
|
42
|
+
### This is a h3 element.
|
|
43
|
+
|
|
44
|
+
#### This is a h4 element.
|
|
45
|
+
|
|
46
|
+
##### This is a h5 element.
|
|
47
|
+
|
|
48
|
+
###### This is a h6 element.
|
|
49
|
+
|
|
50
|
+
`This is a code element.`
|
|
51
|
+
|
|
52
|
+
> This is a blockquote element.
|
|
53
|
+
|
|
54
|
+
This is a caption element.This is a cite element.This is a small element.
|
|
55
|
+
|
|
56
|
+
Hide code
|
|
57
|
+
|
|
58
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
59
|
+
|
|
60
|
+
<IressStack gutter\="md"\>
|
|
61
|
+
<IressText element\="p"\>
|
|
62
|
+
This is a p element. </IressText\>
|
|
63
|
+
<IressText element\="div"\>
|
|
64
|
+
This is a div element. </IressText\>
|
|
65
|
+
<IressText element\="span"\>
|
|
66
|
+
This is a span element. </IressText\>
|
|
67
|
+
<IressText element\="h1"\>
|
|
68
|
+
This is a h1 element. </IressText\>
|
|
69
|
+
<IressText element\="h2"\>
|
|
70
|
+
This is a h2 element. </IressText\>
|
|
71
|
+
<IressText element\="h3"\>
|
|
72
|
+
This is a h3 element. </IressText\>
|
|
73
|
+
<IressText element\="h4"\>
|
|
74
|
+
This is a h4 element. </IressText\>
|
|
75
|
+
<IressText element\="h5"\>
|
|
76
|
+
This is a h5 element. </IressText\>
|
|
77
|
+
<IressText element\="h6"\>
|
|
78
|
+
This is a h6 element. </IressText\>
|
|
79
|
+
<IressText element\="code"\>
|
|
80
|
+
This is a code element. </IressText\>
|
|
81
|
+
<IressText element\="blockquote"\>
|
|
82
|
+
This is a blockquote element. </IressText\>
|
|
83
|
+
<IressText element\="caption"\>
|
|
84
|
+
This is a caption element. </IressText\>
|
|
85
|
+
<IressText element\="cite"\>
|
|
86
|
+
This is a cite element. </IressText\>
|
|
87
|
+
<IressText element\="small"\>
|
|
88
|
+
This is a small element. </IressText\>
|
|
89
|
+
</IressStack\>
|
|
90
|
+
|
|
91
|
+
Copy
|
|
92
|
+
|
|
93
|
+
### [](#the-variant-prop)The `variant` prop
|
|
94
|
+
|
|
95
|
+
The `variant` prop allows you alter the default styling of the element that it selected.
|
|
96
|
+
|
|
97
|
+
For example, in order to maintain the semantic structure of headings, you may need to style a `h2` element like a `h4`. Or you may want to style your heading using one of our display text formats.
|
|
98
|
+
|
|
99
|
+
This is the blockquote variant.
|
|
100
|
+
|
|
101
|
+
This is the body variant.
|
|
102
|
+
|
|
103
|
+
This is the bold variant.
|
|
104
|
+
|
|
105
|
+
This is the code variant.
|
|
106
|
+
|
|
107
|
+
This is the display variant.
|
|
108
|
+
|
|
109
|
+
This is the display1 variant.
|
|
110
|
+
|
|
111
|
+
This is the display2 variant.
|
|
112
|
+
|
|
113
|
+
This is the display3 variant.
|
|
114
|
+
|
|
115
|
+
This is the display4 variant.
|
|
116
|
+
|
|
117
|
+
This is the h1 variant.
|
|
118
|
+
|
|
119
|
+
This is the h2 variant.
|
|
120
|
+
|
|
121
|
+
This is the h3 variant.
|
|
122
|
+
|
|
123
|
+
This is the h4 variant.
|
|
124
|
+
|
|
125
|
+
This is the h5 variant.
|
|
126
|
+
|
|
127
|
+
This is the h6 variant.
|
|
128
|
+
|
|
129
|
+
This is the italic variant.
|
|
130
|
+
|
|
131
|
+
This is the lead variant.
|
|
132
|
+
|
|
133
|
+
This is the small variant.
|
|
134
|
+
|
|
135
|
+
This is the cite variant.
|
|
136
|
+
|
|
137
|
+
This is the caption variant.
|
|
138
|
+
|
|
139
|
+
Hide code
|
|
140
|
+
|
|
141
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
142
|
+
|
|
143
|
+
<IressStack gutter\="md"\>
|
|
144
|
+
<IressText variant\="blockquote"\>
|
|
145
|
+
This is the blockquote variant. </IressText\>
|
|
146
|
+
<IressText variant\="body"\>
|
|
147
|
+
This is the body variant. </IressText\>
|
|
148
|
+
<IressText variant\="bold"\>
|
|
149
|
+
This is the bold variant. </IressText\>
|
|
150
|
+
<IressText variant\="code"\>
|
|
151
|
+
This is the code variant. </IressText\>
|
|
152
|
+
<IressText variant\="display"\>
|
|
153
|
+
This is the display variant. </IressText\>
|
|
154
|
+
<IressText variant\="display1"\>
|
|
155
|
+
This is the display1 variant. </IressText\>
|
|
156
|
+
<IressText variant\="display2"\>
|
|
157
|
+
This is the display2 variant. </IressText\>
|
|
158
|
+
<IressText variant\="display3"\>
|
|
159
|
+
This is the display3 variant. </IressText\>
|
|
160
|
+
<IressText variant\="display4"\>
|
|
161
|
+
This is the display4 variant. </IressText\>
|
|
162
|
+
<IressText variant\="h1"\>
|
|
163
|
+
This is the h1 variant. </IressText\>
|
|
164
|
+
<IressText variant\="h2"\>
|
|
165
|
+
This is the h2 variant. </IressText\>
|
|
166
|
+
<IressText variant\="h3"\>
|
|
167
|
+
This is the h3 variant. </IressText\>
|
|
168
|
+
<IressText variant\="h4"\>
|
|
169
|
+
This is the h4 variant. </IressText\>
|
|
170
|
+
<IressText variant\="h5"\>
|
|
171
|
+
This is the h5 variant. </IressText\>
|
|
172
|
+
<IressText variant\="h6"\>
|
|
173
|
+
This is the h6 variant. </IressText\>
|
|
174
|
+
<IressText variant\="italic"\>
|
|
175
|
+
This is the italic variant. </IressText\>
|
|
176
|
+
<IressText variant\="lead"\>
|
|
177
|
+
This is the lead variant. </IressText\>
|
|
178
|
+
<IressText variant\="small"\>
|
|
179
|
+
This is the small variant. </IressText\>
|
|
180
|
+
<IressText variant\="cite"\>
|
|
181
|
+
This is the cite variant. </IressText\>
|
|
182
|
+
<IressText variant\="caption"\>
|
|
183
|
+
This is the caption variant. </IressText\>
|
|
184
|
+
</IressStack\>
|
|
185
|
+
|
|
186
|
+
Copy
|
|
187
|
+
|
|
188
|
+
### [](#the-mode-prop)The `mode` prop
|
|
189
|
+
|
|
190
|
+
The `mode` prop can be used to set the colour of the text to these predefined mode colours: Body, Muted, Primary, Info, Success, Warning, Danger, Positive and Negative.
|
|
191
|
+
|
|
192
|
+
This is danger mode.
|
|
193
|
+
|
|
194
|
+
This is info mode.
|
|
195
|
+
|
|
196
|
+
This is muted mode.
|
|
197
|
+
|
|
198
|
+
This is primary mode.
|
|
199
|
+
|
|
200
|
+
This is success mode.
|
|
201
|
+
|
|
202
|
+
This is warning mode.
|
|
203
|
+
|
|
204
|
+
This is positive mode.
|
|
205
|
+
|
|
206
|
+
This is negative mode.
|
|
207
|
+
|
|
208
|
+
Nested text mode demonstration:
|
|
209
|
+
|
|
210
|
+
I am nested, and return to the original colour
|
|
211
|
+
|
|
212
|
+
Hide code
|
|
213
|
+
|
|
214
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
215
|
+
|
|
216
|
+
<IressStack gutter\="md"\>
|
|
217
|
+
<IressText mode\="danger"\>
|
|
218
|
+
This is danger mode. </IressText\>
|
|
219
|
+
<IressText mode\="info"\>
|
|
220
|
+
This is info mode. </IressText\>
|
|
221
|
+
<IressText mode\="muted"\>
|
|
222
|
+
This is muted mode. </IressText\>
|
|
223
|
+
<IressText mode\="primary"\>
|
|
224
|
+
This is primary mode. </IressText\>
|
|
225
|
+
<IressText mode\="success"\>
|
|
226
|
+
This is success mode. </IressText\>
|
|
227
|
+
<IressText mode\="warning"\>
|
|
228
|
+
This is warning mode. </IressText\>
|
|
229
|
+
<IressText mode\="positive"\>
|
|
230
|
+
This is positive mode. </IressText\>
|
|
231
|
+
<IressText mode\="negative"\>
|
|
232
|
+
This is negative mode. </IressText\>
|
|
233
|
+
<IressText mode\="danger"\>
|
|
234
|
+
Nested text mode demonstration:{' '}
|
|
235
|
+
<IressText\>
|
|
236
|
+
I am nested, and return to the original colour </IressText\>
|
|
237
|
+
</IressText\>
|
|
238
|
+
</IressStack\>
|
|
239
|
+
|
|
240
|
+
Copy
|
|
241
|
+
|
|
242
|
+
### [](#the-align-prop)The `align` prop
|
|
243
|
+
|
|
244
|
+
The `align` prop can be used to set the text's alignment.
|
|
245
|
+
|
|
246
|
+
The quick brown fox jumps over the lazy dog
|
|
247
|
+
|
|
248
|
+
The quick brown fox jumps over the lazy dog
|
|
249
|
+
|
|
250
|
+
The quick brown fox jumps over the lazy dog
|
|
251
|
+
|
|
252
|
+
The quick brown fox jumps over the lazy dog
|
|
253
|
+
|
|
254
|
+
The quick brown fox jumps over the lazy dog
|
|
255
|
+
|
|
256
|
+
Hide code
|
|
257
|
+
|
|
258
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
259
|
+
|
|
260
|
+
<IressStack gutter\="md"\>
|
|
261
|
+
<IressText align\="inherit"\>
|
|
262
|
+
The quick brown fox jumps over the lazy dog </IressText\>
|
|
263
|
+
<IressText align\="left"\>
|
|
264
|
+
The quick brown fox jumps over the lazy dog </IressText\>
|
|
265
|
+
<IressText align\="center"\>
|
|
266
|
+
The quick brown fox jumps over the lazy dog </IressText\>
|
|
267
|
+
<IressText align\="right"\>
|
|
268
|
+
The quick brown fox jumps over the lazy dog </IressText\>
|
|
269
|
+
<IressText align\="justify"\>
|
|
270
|
+
The quick brown fox jumps over the lazy dog </IressText\>
|
|
271
|
+
</IressStack\>
|
|
272
|
+
|
|
273
|
+
Copy
|
|
274
|
+
|
|
275
|
+
[](#behaviour)Behaviour
|
|
276
|
+
-----------------------
|
|
277
|
+
|
|
278
|
+
### [](#headings-with-icons)Headings with icons
|
|
279
|
+
|
|
280
|
+
Icons can be added to a heading by simply including the icon as a direct child of the heading, as below.
|
|
281
|
+
|
|
282
|
+
The icon inherits the font size from the heading, so there is no need to set a size on the icon. If the icon is the first or last child of the heading, it will have some inline spacing added to save you from having to use the `IressInline` component.
|
|
283
|
+
|
|
284
|
+
H1 heading with icons
|
|
285
|
+
=====================
|
|
286
|
+
|
|
287
|
+
H2 heading with icons
|
|
288
|
+
---------------------
|
|
289
|
+
|
|
290
|
+
### H3 heading with icons
|
|
291
|
+
|
|
292
|
+
#### H4 heading with icons
|
|
293
|
+
|
|
294
|
+
##### H5 heading with icons
|
|
295
|
+
|
|
296
|
+
###### H6 heading with icons
|
|
297
|
+
|
|
298
|
+
Hide code
|
|
299
|
+
|
|
300
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
301
|
+
|
|
302
|
+
<IressStack\>
|
|
303
|
+
<IressText element\="h1"\>
|
|
304
|
+
<IressIcon name\="smile-wink" />
|
|
305
|
+
<span\>
|
|
306
|
+
H1 heading with icons </span\>
|
|
307
|
+
<IressIcon name\="smile-wink" />
|
|
308
|
+
</IressText\>
|
|
309
|
+
<IressText element\="h2"\>
|
|
310
|
+
<IressIcon name\="smile-wink" />
|
|
311
|
+
<span\>
|
|
312
|
+
H2 heading with icons </span\>
|
|
313
|
+
<IressIcon name\="smile-wink" />
|
|
314
|
+
</IressText\>
|
|
315
|
+
<IressText element\="h3"\>
|
|
316
|
+
<IressIcon name\="smile-wink" />
|
|
317
|
+
<span\>
|
|
318
|
+
H3 heading with icons </span\>
|
|
319
|
+
<IressIcon name\="smile-wink" />
|
|
320
|
+
</IressText\>
|
|
321
|
+
<IressText element\="h4"\>
|
|
322
|
+
<IressIcon name\="smile-wink" />
|
|
323
|
+
<span\>
|
|
324
|
+
H4 heading with icons </span\>
|
|
325
|
+
<IressIcon name\="smile-wink" />
|
|
326
|
+
</IressText\>
|
|
327
|
+
<IressText element\="h5"\>
|
|
328
|
+
<IressIcon name\="smile-wink" />
|
|
329
|
+
<span\>
|
|
330
|
+
H5 heading with icons </span\>
|
|
331
|
+
<IressIcon name\="smile-wink" />
|
|
332
|
+
</IressText\>
|
|
333
|
+
<IressText element\="h6"\>
|
|
334
|
+
<IressIcon name\="smile-wink" />
|
|
335
|
+
<span\>
|
|
336
|
+
H6 heading with icons </span\>
|
|
337
|
+
<IressIcon name\="smile-wink" />
|
|
338
|
+
</IressText\>
|
|
339
|
+
</IressStack\>
|
|
340
|
+
|
|
341
|
+
Copy
|
|
342
|
+
|
|
343
|
+
### [](#block-of-typographic-content)Block of typographic content
|
|
344
|
+
|
|
345
|
+
If you just need to style a block of typography content, you can just wrap the entire block of HTML with the text component.
|
|
346
|
+
|
|
347
|
+
Heading text
|
|
348
|
+
------------
|
|
349
|
+
|
|
350
|
+
This is just raw HTML inside the text component. This is just raw HTML inside the text component.
|
|
351
|
+
|
|
352
|
+
> Nisi optio dolore debitis porro ex quis odio atque, ut obcaecati dolorem enim molestiae eum voluptatem excepturi quisquam. Someone in latin
|
|
353
|
+
|
|
354
|
+
You can also use dividers inside blocks to separate content.
|
|
355
|
+
|
|
356
|
+
* * *
|
|
357
|
+
|
|
358
|
+
Just like the one above.
|
|
359
|
+
|
|
360
|
+
Hide code
|
|
361
|
+
|
|
362
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
363
|
+
|
|
364
|
+
<IressText\>
|
|
365
|
+
<h2\>
|
|
366
|
+
Heading text </h2\>
|
|
367
|
+
<p\>
|
|
368
|
+
This is just raw HTML inside the text component. This is just raw HTML inside the text component. </p\>
|
|
369
|
+
<blockquote\>
|
|
370
|
+
Nisi optio dolore debitis porro ex quis odio atque, ut obcaecati dolorem enim molestiae eum voluptatem excepturi quisquam.{' '}
|
|
371
|
+
<cite\>
|
|
372
|
+
Someone in latin </cite\>
|
|
373
|
+
</blockquote\>
|
|
374
|
+
<p\>
|
|
375
|
+
You can also use dividers inside blocks to separate content. </p\>
|
|
376
|
+
<hr />
|
|
377
|
+
<p\>
|
|
378
|
+
Just like the one above. </p\>
|
|
379
|
+
</IressText\>
|
|
380
|
+
|
|
381
|
+
Copy
|
|
382
|
+
|
|
383
|
+
On this page
|
|
384
|
+
|
|
385
|
+
* [Overview](#overview)
|
|
386
|
+
* [Props](#props)
|
|
387
|
+
* [Usage](#usage)
|
|
388
|
+
* [The element prop](#the-element-prop)
|
|
389
|
+
* [The variant prop](#the-variant-prop)
|
|
390
|
+
* [The mode prop](#the-mode-prop)
|
|
391
|
+
* [The align prop](#the-align-prop)
|
|
392
|
+
* [Behaviour](#behaviour)
|
|
393
|
+
* [Headings with icons](#headings-with-icons)
|
|
394
|
+
* [Block of typographic content](#block-of-typographic-content)
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
[](#toaster)Toaster
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Toaster provide users with important, time-sensitive information.
|
|
8
|
+
|
|
9
|
+
`IressToasterProvider` does not change the position on each render, it can only be done on the initial render.
|
|
10
|
+
|
|
11
|
+
Show toast using provider
|
|
12
|
+
|
|
13
|
+
Hide code
|
|
14
|
+
|
|
15
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
IressButton,
|
|
19
|
+
IressToasterProvider,
|
|
20
|
+
IressToasterProviderProps,
|
|
21
|
+
useToaster,
|
|
22
|
+
} from '@iress-oss/ids-components';
|
|
23
|
+
const ToastWithTrigger \= () \=> {
|
|
24
|
+
const toaster \= useToaster();
|
|
25
|
+
return (
|
|
26
|
+
<IressButton
|
|
27
|
+
onClick\={() \=>
|
|
28
|
+
toaster.error({
|
|
29
|
+
heading: 'Error',
|
|
30
|
+
children:
|
|
31
|
+
'Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.',
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
\>
|
|
35
|
+
Show toast using provider </IressButton\>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
export const SimpleToasterExample \= () \=> (
|
|
39
|
+
<IressToasterProvider \>
|
|
40
|
+
<ToastWithTrigger />
|
|
41
|
+
</IressToasterProvider\>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
Copy
|
|
45
|
+
|
|
46
|
+
[](#controlling-toasts)Controlling toasts
|
|
47
|
+
-----------------------------------------
|
|
48
|
+
|
|
49
|
+
### [](#using-the-iresstoasterprovider)Using the `IressToasterProvider`
|
|
50
|
+
|
|
51
|
+
The recommended way to create toasts is by using the `<IressToasterProvider />` alongside the `useToaster` hook. By using the `success`, `info` and `error` methods from the hook, you can trigger toasts in your application.
|
|
52
|
+
|
|
53
|
+
To use, wrap your `<App/>` or the component that you want to use the `useToaster` hook with `<IressToasterProvider />`.
|
|
54
|
+
|
|
55
|
+
`IressToasterProvider` does not change the position on each render, it can only be done on the initial render.
|
|
56
|
+
|
|
57
|
+
Show toast using provider
|
|
58
|
+
|
|
59
|
+
Hide code
|
|
60
|
+
|
|
61
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
62
|
+
|
|
63
|
+
import {
|
|
64
|
+
IressButton,
|
|
65
|
+
IressToasterProvider,
|
|
66
|
+
IressToasterProviderProps,
|
|
67
|
+
useToaster,
|
|
68
|
+
} from '@iress-oss/ids-components';
|
|
69
|
+
const ToastWithTrigger \= () \=> {
|
|
70
|
+
const toaster \= useToaster();
|
|
71
|
+
return (
|
|
72
|
+
<IressButton
|
|
73
|
+
onClick\={() \=>
|
|
74
|
+
toaster.error({
|
|
75
|
+
heading: 'Error',
|
|
76
|
+
children:
|
|
77
|
+
'Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.',
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
\>
|
|
81
|
+
Show toast using provider </IressButton\>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
export const SimpleToasterExample \= () \=> (
|
|
85
|
+
<IressToasterProvider \>
|
|
86
|
+
<ToastWithTrigger />
|
|
87
|
+
</IressToasterProvider\>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
Copy
|
|
91
|
+
|
|
92
|
+
[](#examples)Examples
|
|
93
|
+
---------------------
|
|
94
|
+
|
|
95
|
+
### [](#status)Status
|
|
96
|
+
|
|
97
|
+
The toast offers three status that set a distinctive colour and icon. They can be set using the `status` prop. Their different use cases are described here.
|
|
98
|
+
|
|
99
|
+
successerrorinfo
|
|
100
|
+
|
|
101
|
+
Hide code
|
|
102
|
+
|
|
103
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
104
|
+
|
|
105
|
+
import {
|
|
106
|
+
IressButton,
|
|
107
|
+
IressInline,
|
|
108
|
+
IressToastProps,
|
|
109
|
+
IressToasterProps,
|
|
110
|
+
IressToasterProvider,
|
|
111
|
+
TOAST\_STATUS,
|
|
112
|
+
useToaster,
|
|
113
|
+
} from '@iress-oss/ids-components';
|
|
114
|
+
const ToastWithTrigger \= ({ status }: Pick<IressToastProps, 'status'\>) \=> {
|
|
115
|
+
const toaster \= useToaster();
|
|
116
|
+
return (
|
|
117
|
+
<IressButton
|
|
118
|
+
onClick\={() \=>
|
|
119
|
+
toaster\[status\]({ children: \`Hello, I am a ${status} toast\` })
|
|
120
|
+
}
|
|
121
|
+
\>
|
|
122
|
+
{status}
|
|
123
|
+
</IressButton\>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
export const ToastStatuses \= (args: IressToasterProps) \=> (
|
|
127
|
+
<IressToasterProvider \>
|
|
128
|
+
<IressInline gutter\="sm"\>
|
|
129
|
+
{TOAST\_STATUS.map((status) \=> (
|
|
130
|
+
<ToastWithTrigger status\={status} />
|
|
131
|
+
))}
|
|
132
|
+
</IressInline\>
|
|
133
|
+
</IressToasterProvider\>
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
Copy
|
|
137
|
+
|
|
138
|
+
### [](#timeout)Timeout
|
|
139
|
+
|
|
140
|
+
By default, toasts will time out after six seconds, after which they will animate out of view. This can be customised using the `timeout` prop when created using the `useToaster` hook.
|
|
141
|
+
|
|
142
|
+
Timeouts must be set in milliseconds; as an example, if you want a timeout of five seconds, set the timeout to 5000.
|
|
143
|
+
|
|
144
|
+
1000ms timeout
|
|
145
|
+
|
|
146
|
+
Hide code
|
|
147
|
+
|
|
148
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
149
|
+
|
|
150
|
+
import {
|
|
151
|
+
IressButton,
|
|
152
|
+
IressToasterProvider,
|
|
153
|
+
IressToasterProviderProps,
|
|
154
|
+
useToaster,
|
|
155
|
+
} from '@iress-oss/ids-components';
|
|
156
|
+
const ToastWithTrigger \= () \=> {
|
|
157
|
+
const toaster \= useToaster();
|
|
158
|
+
return (
|
|
159
|
+
<IressButton
|
|
160
|
+
onClick\={() \=>
|
|
161
|
+
toaster.success({
|
|
162
|
+
children: 'This is a really quick toast',
|
|
163
|
+
timeout: 1000,
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
\>
|
|
167
|
+
1000ms timeout </IressButton\>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
export const ToasterTimeout \= () \=> (
|
|
171
|
+
<IressToasterProvider \>
|
|
172
|
+
<ToastWithTrigger />
|
|
173
|
+
</IressToasterProvider\>
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
Copy
|
|
177
|
+
|
|
178
|
+
### [](#position)Position
|
|
179
|
+
|
|
180
|
+
By default, the `IressToaster`'s `position` is set to `bottom-end`, but there may be occasions when you need toasts to appear in a different part of the screen. This can be controlled with the `position` prop on the `IressToasterProvider` component, or as the first argument to `useToaster`. There are 6 positions to choose from.
|
|
181
|
+
|
|
182
|
+
**Note:** The toast position should be consistent across your app. For this reason, the position is set on the `IressToastProvider` or the `useToaster` hook, and not on the individual toasts.
|
|
183
|
+
|
|
184
|
+
top-starttop-centertop-end
|
|
185
|
+
|
|
186
|
+
Toaster positions
|
|
187
|
+
|
|
188
|
+
bottom-startbottom-centerbottom-end
|
|
189
|
+
|
|
190
|
+
Hide code
|
|
191
|
+
|
|
192
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
193
|
+
|
|
194
|
+
import {
|
|
195
|
+
IressButton,
|
|
196
|
+
IressInline,
|
|
197
|
+
IressPanel,
|
|
198
|
+
IressStack,
|
|
199
|
+
IressText,
|
|
200
|
+
IressToasterProps,
|
|
201
|
+
IressToasterProvider,
|
|
202
|
+
IressToasterProviderProps,
|
|
203
|
+
IressToastProps,
|
|
204
|
+
useToaster,
|
|
205
|
+
} from '@iress-oss/ids-components';
|
|
206
|
+
import { useState } from 'react';
|
|
207
|
+
const DEFAULT\_TOAST: IressToastProps \= {
|
|
208
|
+
children: 'Message sent successfully',
|
|
209
|
+
heading: 'Success',
|
|
210
|
+
status: 'success',
|
|
211
|
+
};
|
|
212
|
+
const Toaster \= () \=> {
|
|
213
|
+
const \[position, setPosition\] \=
|
|
214
|
+
useState<IressToasterProps\['position'\]\>('bottom-end');
|
|
215
|
+
const { status, ...toast } \= DEFAULT\_TOAST;
|
|
216
|
+
const toaster \= useToaster(position);
|
|
217
|
+
const changePosition \= (position: IressToasterProps\['position'\]) \=> {
|
|
218
|
+
setPosition(position);
|
|
219
|
+
queueMicrotask(() \=> toaster\[status\](toast));
|
|
220
|
+
};
|
|
221
|
+
return (
|
|
222
|
+
<div style\={{ padding: '80px 150px' }}\>
|
|
223
|
+
<IressStack gutter\="md"\>
|
|
224
|
+
<IressInline horizontalAlign\="between" gutter\="sm"\>
|
|
225
|
+
<IressButton onClick\={() \=> changePosition('top-start')}\>
|
|
226
|
+
top-start </IressButton\>
|
|
227
|
+
<IressButton onClick\={() \=> changePosition('top-center')}\>
|
|
228
|
+
top-center </IressButton\>
|
|
229
|
+
<IressButton onClick\={() \=> changePosition('top-end')}\>
|
|
230
|
+
top-end </IressButton\>
|
|
231
|
+
</IressInline\>
|
|
232
|
+
<IressPanel background\="transparent" padding\="lg"\>
|
|
233
|
+
<IressText align\="center"\>Toaster positions</IressText\>
|
|
234
|
+
</IressPanel\>
|
|
235
|
+
<IressInline horizontalAlign\="between"\>
|
|
236
|
+
<IressButton onClick\={() \=> changePosition('bottom-start')}\>
|
|
237
|
+
bottom-start </IressButton\>
|
|
238
|
+
<IressButton onClick\={() \=> changePosition('bottom-center')}\>
|
|
239
|
+
bottom-center </IressButton\>
|
|
240
|
+
<IressButton onClick\={() \=> changePosition('bottom-end')}\>
|
|
241
|
+
bottom-end </IressButton\>
|
|
242
|
+
</IressInline\>
|
|
243
|
+
</IressStack\>
|
|
244
|
+
</div\>
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
export const ToasterPositionExamples \= () \=> (
|
|
248
|
+
<IressToasterProvider \>
|
|
249
|
+
<Toaster />
|
|
250
|
+
</IressToasterProvider\>
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
Copy
|
|
254
|
+
|
|
255
|
+
[](#migrating-to-version-5)Migrating to version 5
|
|
256
|
+
-------------------------------------------------
|
|
257
|
+
|
|
258
|
+
### [](#adding-the-provider)Adding the provider
|
|
259
|
+
|
|
260
|
+
For your components to work as previously, you will need to set up the `IressToasterProvider` at the root of your application. This will allow you to use the `useToaster` hook to trigger toasts from anywhere in your application using the status and props of the toast.
|
|
261
|
+
|
|
262
|
+
\[data-radix-scroll-area-viewport\] {
|
|
263
|
+
scrollbar-width: none;
|
|
264
|
+
-ms-overflow-style: none;
|
|
265
|
+
-webkit-overflow-scrolling: touch;
|
|
266
|
+
}
|
|
267
|
+
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
268
|
+
display: none;
|
|
269
|
+
}
|
|
270
|
+
:where(\[data-radix-scroll-area-viewport\]) {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: column;
|
|
273
|
+
align-items: stretch;
|
|
274
|
+
}
|
|
275
|
+
:where(\[data-radix-scroll-area-content\]) {
|
|
276
|
+
flex-grow: 1;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const App \= () \=> <IressToasterProvider\>Rest of app here</IressToasterProvider\>;
|
|
280
|
+
|
|
281
|
+
Copy
|
|
282
|
+
|
|
283
|
+
On this page
|
|
284
|
+
|
|
285
|
+
* [Overview](#overview)
|
|
286
|
+
* [Props](#props)
|
|
287
|
+
* [Controlling toasts](#controlling-toasts)
|
|
288
|
+
* [Using the IressToasterProvider](#using-the-iresstoasterprovider)
|
|
289
|
+
* [Examples](#examples)
|
|
290
|
+
* [Status](#status)
|
|
291
|
+
* [Timeout](#timeout)
|
|
292
|
+
* [Position](#position)
|
|
293
|
+
* [Migrating to version 5](#migrating-to-version-5)
|
|
294
|
+
* [Adding the provider](#adding-the-provider)
|