@iress-oss/ids-mcp-server 5.15.0 → 6.0.0-alpha.1
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/package.json +28 -46
- package/generated/docs/components-alert-docs.md +0 -130
- package/generated/docs/components-autocomplete-docs.md +0 -754
- package/generated/docs/components-autocomplete-recipes-docs.md +0 -104
- package/generated/docs/components-badge-docs.md +0 -148
- package/generated/docs/components-button-docs.md +0 -362
- package/generated/docs/components-button-recipes-docs.md +0 -76
- package/generated/docs/components-buttongroup-docs.md +0 -310
- package/generated/docs/components-card-docs.md +0 -494
- package/generated/docs/components-card-recipes-docs.md +0 -89
- package/generated/docs/components-checkbox-docs.md +0 -193
- package/generated/docs/components-checkboxgroup-docs.md +0 -692
- package/generated/docs/components-checkboxgroup-recipes-docs.md +0 -119
- package/generated/docs/components-col-docs.md +0 -466
- package/generated/docs/components-combobox-docs.md +0 -1016
- package/generated/docs/components-container-docs.md +0 -91
- package/generated/docs/components-divider-docs.md +0 -176
- package/generated/docs/components-expander-docs.md +0 -215
- package/generated/docs/components-field-docs.md +0 -675
- package/generated/docs/components-filter-docs.md +0 -1109
- package/generated/docs/components-form-docs.md +0 -2410
- package/generated/docs/components-form-recipes-docs.md +0 -886
- package/generated/docs/components-hide-docs.md +0 -265
- package/generated/docs/components-icon-docs.md +0 -553
- package/generated/docs/components-inline-docs.md +0 -868
- package/generated/docs/components-input-docs.md +0 -335
- package/generated/docs/components-input-recipes-docs.md +0 -140
- package/generated/docs/components-inputcurrency-docs.md +0 -157
- package/generated/docs/components-inputcurrency-recipes-docs.md +0 -116
- package/generated/docs/components-label-docs.md +0 -135
- package/generated/docs/components-menu-docs.md +0 -704
- package/generated/docs/components-menu-menuitem-docs.md +0 -193
- package/generated/docs/components-modal-docs.md +0 -587
- package/generated/docs/components-navbar-docs.md +0 -291
- package/generated/docs/components-navbar-recipes-docs.md +0 -413
- package/generated/docs/components-panel-docs.md +0 -380
- package/generated/docs/components-placeholder-docs.md +0 -27
- package/generated/docs/components-popover-docs.md +0 -464
- package/generated/docs/components-popover-recipes-docs.md +0 -245
- package/generated/docs/components-progress-docs.md +0 -104
- package/generated/docs/components-provider-docs.md +0 -105
- package/generated/docs/components-radio-docs.md +0 -107
- package/generated/docs/components-radiogroup-docs.md +0 -683
- package/generated/docs/components-readonly-docs.md +0 -89
- package/generated/docs/components-richselect-docs.md +0 -2433
- package/generated/docs/components-row-docs.md +0 -877
- package/generated/docs/components-select-docs.md +0 -456
- package/generated/docs/components-skeleton-docs.md +0 -214
- package/generated/docs/components-skeleton-recipes-docs.md +0 -76
- package/generated/docs/components-skiplink-docs.md +0 -66
- package/generated/docs/components-slideout-docs.md +0 -538
- package/generated/docs/components-slider-docs.md +0 -346
- package/generated/docs/components-spinner-docs.md +0 -59
- package/generated/docs/components-stack-docs.md +0 -265
- package/generated/docs/components-table-ag-grid-docs.md +0 -1074
- package/generated/docs/components-table-docs.md +0 -1305
- package/generated/docs/components-tabset-docs.md +0 -341
- package/generated/docs/components-tabset-tab-docs.md +0 -86
- package/generated/docs/components-tag-docs.md +0 -115
- package/generated/docs/components-text-docs.md +0 -394
- package/generated/docs/components-toaster-docs.md +0 -345
- package/generated/docs/components-toaster-toast-docs.md +0 -157
- package/generated/docs/components-toggle-docs.md +0 -158
- package/generated/docs/components-tooltip-docs.md +0 -311
- package/generated/docs/components-validationmessage-docs.md +0 -241
- package/generated/docs/contact-us-docs.md +0 -27
- package/generated/docs/extensions-editor-docs.md +0 -288
- package/generated/docs/extensions-editor-recipes-docs.md +0 -39
- package/generated/docs/foundations-accessibility-docs.md +0 -62
- package/generated/docs/foundations-colours-docs.md +0 -257
- package/generated/docs/foundations-consistency-docs.md +0 -52
- package/generated/docs/foundations-content-docs.md +0 -23
- package/generated/docs/foundations-introduction-docs.md +0 -17
- package/generated/docs/foundations-principles-docs.md +0 -70
- package/generated/docs/foundations-typography-docs.md +0 -191
- package/generated/docs/foundations-user-experience-docs.md +0 -63
- package/generated/docs/foundations-visual-design-docs.md +0 -46
- package/generated/docs/frequently-asked-questions-docs.md +0 -53
- package/generated/docs/get-started-develop-docs.md +0 -209
- package/generated/docs/get-started-using-storybook-docs.md +0 -68
- package/generated/docs/guidelines.md +0 -812
- package/generated/docs/introduction-docs.md +0 -43
- package/generated/docs/patterns-loading-docs.md +0 -1304
- package/generated/docs/resources-changelog-docs.md +0 -6
- package/generated/docs/resources-code-katas-docs.md +0 -29
- package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +0 -437
- package/generated/docs/themes-available-themes-docs.md +0 -66
- package/generated/docs/themes-introduction-docs.md +0 -121
- package/generated/docs/themes-tokens-docs.md +0 -1200
- package/generated/docs/versions-docs.md +0 -17
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -1,345 +0,0 @@
|
|
|
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
|
-
### [](#closing-toasts-via-the-provider)Closing toasts via the provider
|
|
93
|
-
|
|
94
|
-
If you want to dismiss a toast programmatically, you can use the `close` method from the `useToaster` hook. This method takes a toast ID as an argument, which is returned when you create a toast using the `useToaster` hook.
|
|
95
|
-
|
|
96
|
-
Show toast using provider
|
|
97
|
-
|
|
98
|
-
Hide code
|
|
99
|
-
|
|
100
|
-
\[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; }
|
|
101
|
-
|
|
102
|
-
import {
|
|
103
|
-
IressButton,
|
|
104
|
-
IressInline,
|
|
105
|
-
IressToasterProvider,
|
|
106
|
-
IressToasterProviderProps,
|
|
107
|
-
useToaster,
|
|
108
|
-
} from '@iress-oss/ids-components';
|
|
109
|
-
import { useState } from 'react';
|
|
110
|
-
const ToastWithTrigger \= () \=> {
|
|
111
|
-
const toaster \= useToaster();
|
|
112
|
-
const \[lastToastId, setLastToastId\] \= useState<string | null\>(null);
|
|
113
|
-
return (
|
|
114
|
-
<IressInline gutter\="sm"\>
|
|
115
|
-
<IressButton onClick={() \=> {
|
|
116
|
-
const toastId \= toaster.error({
|
|
117
|
-
heading: 'Error',
|
|
118
|
-
children:
|
|
119
|
-
'Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.',
|
|
120
|
-
onClose: () \=> {
|
|
121
|
-
setLastToastId(null);
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
setLastToastId(toastId);
|
|
125
|
-
}}
|
|
126
|
-
> Show toast using provider </IressButton\>
|
|
127
|
-
{lastToastId && (
|
|
128
|
-
<IressButton onClick\={() \=> toaster.close(lastToastId)}\>
|
|
129
|
-
Close the last toast opened </IressButton\>
|
|
130
|
-
)}
|
|
131
|
-
</IressInline\>
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
export const CloseToastViaProvider \= () \=> (
|
|
135
|
-
<IressToasterProvider \>
|
|
136
|
-
<ToastWithTrigger />
|
|
137
|
-
</IressToasterProvider\>
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
Copy
|
|
141
|
-
|
|
142
|
-
[](#examples)Examples
|
|
143
|
-
---------------------
|
|
144
|
-
|
|
145
|
-
### [](#status)Status
|
|
146
|
-
|
|
147
|
-
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.
|
|
148
|
-
|
|
149
|
-
successerrorinfo
|
|
150
|
-
|
|
151
|
-
Hide code
|
|
152
|
-
|
|
153
|
-
\[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; }
|
|
154
|
-
|
|
155
|
-
import {
|
|
156
|
-
IressButton,
|
|
157
|
-
IressInline,
|
|
158
|
-
IressToastProps,
|
|
159
|
-
IressToasterProps,
|
|
160
|
-
IressToasterProvider,
|
|
161
|
-
TOAST\_STATUS,
|
|
162
|
-
useToaster,
|
|
163
|
-
} from '@iress-oss/ids-components';
|
|
164
|
-
const ToastWithTrigger \= ({ status }: Pick<IressToastProps, 'status'\>) \=> {
|
|
165
|
-
const toaster \= useToaster();
|
|
166
|
-
return (
|
|
167
|
-
<IressButton
|
|
168
|
-
onClick\={() \=>
|
|
169
|
-
toaster\[status\]({ children: \`Hello, I am a ${status} toast\` })
|
|
170
|
-
}
|
|
171
|
-
\>
|
|
172
|
-
{status}
|
|
173
|
-
</IressButton\>
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
export const ToastStatuses \= (args: IressToasterProps) \=> (
|
|
177
|
-
<IressToasterProvider \>
|
|
178
|
-
<IressInline gutter\="sm"\>
|
|
179
|
-
{TOAST\_STATUS.map((status) \=> (
|
|
180
|
-
<ToastWithTrigger status\={status} />
|
|
181
|
-
))}
|
|
182
|
-
</IressInline\>
|
|
183
|
-
</IressToasterProvider\>
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
Copy
|
|
187
|
-
|
|
188
|
-
### [](#timeout)Timeout
|
|
189
|
-
|
|
190
|
-
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.
|
|
191
|
-
|
|
192
|
-
Timeouts must be set in milliseconds; as an example, if you want a timeout of five seconds, set the timeout to 5000.
|
|
193
|
-
|
|
194
|
-
1000ms timeout
|
|
195
|
-
|
|
196
|
-
Hide code
|
|
197
|
-
|
|
198
|
-
\[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; }
|
|
199
|
-
|
|
200
|
-
import {
|
|
201
|
-
IressButton,
|
|
202
|
-
IressToasterProvider,
|
|
203
|
-
IressToasterProviderProps,
|
|
204
|
-
useToaster,
|
|
205
|
-
} from '@iress-oss/ids-components';
|
|
206
|
-
const ToastWithTrigger \= () \=> {
|
|
207
|
-
const toaster \= useToaster();
|
|
208
|
-
return (
|
|
209
|
-
<IressButton
|
|
210
|
-
onClick\={() \=>
|
|
211
|
-
toaster.success({
|
|
212
|
-
children: 'This is a really quick toast',
|
|
213
|
-
timeout: 1000,
|
|
214
|
-
})
|
|
215
|
-
}
|
|
216
|
-
\>
|
|
217
|
-
1000ms timeout </IressButton\>
|
|
218
|
-
);
|
|
219
|
-
};
|
|
220
|
-
export const ToasterTimeout \= () \=> (
|
|
221
|
-
<IressToasterProvider \>
|
|
222
|
-
<ToastWithTrigger />
|
|
223
|
-
</IressToasterProvider\>
|
|
224
|
-
);
|
|
225
|
-
|
|
226
|
-
Copy
|
|
227
|
-
|
|
228
|
-
### [](#position)Position
|
|
229
|
-
|
|
230
|
-
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.
|
|
231
|
-
|
|
232
|
-
**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.
|
|
233
|
-
|
|
234
|
-
top-starttop-centertop-end
|
|
235
|
-
|
|
236
|
-
Toaster positions
|
|
237
|
-
|
|
238
|
-
bottom-startbottom-centerbottom-end
|
|
239
|
-
|
|
240
|
-
Hide code
|
|
241
|
-
|
|
242
|
-
\[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; }
|
|
243
|
-
|
|
244
|
-
import {
|
|
245
|
-
IressButton,
|
|
246
|
-
IressInline,
|
|
247
|
-
IressPanel,
|
|
248
|
-
IressStack,
|
|
249
|
-
IressText,
|
|
250
|
-
IressToasterProps,
|
|
251
|
-
IressToasterProvider,
|
|
252
|
-
IressToasterProviderProps,
|
|
253
|
-
IressToastProps,
|
|
254
|
-
useToaster,
|
|
255
|
-
} from '@iress-oss/ids-components';
|
|
256
|
-
import { useState } from 'react';
|
|
257
|
-
const DEFAULT\_TOAST: IressToastProps \= {
|
|
258
|
-
children: 'Message sent successfully',
|
|
259
|
-
heading: 'Success',
|
|
260
|
-
status: 'success',
|
|
261
|
-
};
|
|
262
|
-
const Toaster \= () \=> {
|
|
263
|
-
const \[position, setPosition\] \=
|
|
264
|
-
useState<IressToasterProps\['position'\]\>('bottom-end');
|
|
265
|
-
const { status, ...toast } \= DEFAULT\_TOAST;
|
|
266
|
-
const toaster \= useToaster(position);
|
|
267
|
-
const changePosition \= (position: IressToasterProps\['position'\]) \=> {
|
|
268
|
-
setPosition(position);
|
|
269
|
-
queueMicrotask(() \=> toaster\[status\](toast));
|
|
270
|
-
};
|
|
271
|
-
return (
|
|
272
|
-
<div style\={{ padding: '80px 150px' }}\>
|
|
273
|
-
<IressStack gutter\="md"\>
|
|
274
|
-
<IressInline horizontalAlign\="between" gutter\="sm"\>
|
|
275
|
-
<IressButton onClick\={() \=> changePosition('top-start')}\>
|
|
276
|
-
top-start </IressButton\>
|
|
277
|
-
<IressButton onClick\={() \=> changePosition('top-center')}\>
|
|
278
|
-
top-center </IressButton\>
|
|
279
|
-
<IressButton onClick\={() \=> changePosition('top-end')}\>
|
|
280
|
-
top-end </IressButton\>
|
|
281
|
-
</IressInline\>
|
|
282
|
-
<IressPanel background\="transparent" padding\="lg"\>
|
|
283
|
-
<IressText align\="center"\>Toaster positions</IressText\>
|
|
284
|
-
</IressPanel\>
|
|
285
|
-
<IressInline horizontalAlign\="between"\>
|
|
286
|
-
<IressButton onClick\={() \=> changePosition('bottom-start')}\>
|
|
287
|
-
bottom-start </IressButton\>
|
|
288
|
-
<IressButton onClick\={() \=> changePosition('bottom-center')}\>
|
|
289
|
-
bottom-center </IressButton\>
|
|
290
|
-
<IressButton onClick\={() \=> changePosition('bottom-end')}\>
|
|
291
|
-
bottom-end </IressButton\>
|
|
292
|
-
</IressInline\>
|
|
293
|
-
</IressStack\>
|
|
294
|
-
</div\>
|
|
295
|
-
);
|
|
296
|
-
};
|
|
297
|
-
export const ToasterPositionExamples \= () \=> (
|
|
298
|
-
<IressToasterProvider \>
|
|
299
|
-
<Toaster />
|
|
300
|
-
</IressToasterProvider\>
|
|
301
|
-
);
|
|
302
|
-
|
|
303
|
-
Copy
|
|
304
|
-
|
|
305
|
-
[](#migrating-to-version-5)Migrating to version 5
|
|
306
|
-
-------------------------------------------------
|
|
307
|
-
|
|
308
|
-
### [](#adding-the-provider)Adding the provider
|
|
309
|
-
|
|
310
|
-
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.
|
|
311
|
-
|
|
312
|
-
\[data-radix-scroll-area-viewport\] {
|
|
313
|
-
scrollbar-width: none;
|
|
314
|
-
-ms-overflow-style: none;
|
|
315
|
-
-webkit-overflow-scrolling: touch;
|
|
316
|
-
}
|
|
317
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
318
|
-
display: none;
|
|
319
|
-
}
|
|
320
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
321
|
-
display: flex;
|
|
322
|
-
flex-direction: column;
|
|
323
|
-
align-items: stretch;
|
|
324
|
-
}
|
|
325
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
326
|
-
flex-grow: 1;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
const App \= () \=> <IressToasterProvider\>Rest of app here</IressToasterProvider\>;
|
|
330
|
-
|
|
331
|
-
Copy
|
|
332
|
-
|
|
333
|
-
On this page
|
|
334
|
-
|
|
335
|
-
* [Overview](#overview)
|
|
336
|
-
* [Props](#props)
|
|
337
|
-
* [Controlling toasts](#controlling-toasts)
|
|
338
|
-
* [Using the IressToasterProvider](#using-the-iresstoasterprovider)
|
|
339
|
-
* [Closing toasts via the provider](#closing-toasts-via-the-provider)
|
|
340
|
-
* [Examples](#examples)
|
|
341
|
-
* [Status](#status)
|
|
342
|
-
* [Timeout](#timeout)
|
|
343
|
-
* [Position](#position)
|
|
344
|
-
* [Migrating to version 5](#migrating-to-version-5)
|
|
345
|
-
* [Adding the provider](#adding-the-provider)
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
[](#toast)Toast
|
|
2
|
-
===============
|
|
3
|
-
|
|
4
|
-
Overview
|
|
5
|
-
--------
|
|
6
|
-
|
|
7
|
-
Toast are a compact way to provide users with important information, usually within a toaster.
|
|
8
|
-
|
|
9
|
-
This documentation is for the standalone `IressToast` component, and has been exposed for complex use cases where you are unable to use the `useToaster` hook. For most use cases, please use the hook and provider documented at [Toaster documentation](./?path=/docs/components-toaster--docs).
|
|
10
|
-
|
|
11
|
-
Error
|
|
12
|
-
-----
|
|
13
|
-
|
|
14
|
-
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
15
|
-
|
|
16
|
-
Hide code
|
|
17
|
-
|
|
18
|
-
\[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; }
|
|
19
|
-
|
|
20
|
-
<IressToast
|
|
21
|
-
heading\="Error"
|
|
22
|
-
status\="error"
|
|
23
|
-
\>
|
|
24
|
-
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
25
|
-
</IressToast\>
|
|
26
|
-
|
|
27
|
-
Copy
|
|
28
|
-
|
|
29
|
-
[](#examples)Examples
|
|
30
|
-
---------------------
|
|
31
|
-
|
|
32
|
-
### [](#status)Status
|
|
33
|
-
|
|
34
|
-
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.
|
|
35
|
-
|
|
36
|
-
Success
|
|
37
|
-
-------
|
|
38
|
-
|
|
39
|
-
Use to communicate that an action has been successfully completed, such as saving changes in a form.
|
|
40
|
-
|
|
41
|
-
Error
|
|
42
|
-
-----
|
|
43
|
-
|
|
44
|
-
Error toasts are useful for when a user has tried to submit some data but the submit has failed, due to an api error or loss of internet connection, for example.
|
|
45
|
-
|
|
46
|
-
Info
|
|
47
|
-
----
|
|
48
|
-
|
|
49
|
-
Ideal for conveying updates or notifications that do not require immediate action, as well as gently inform users about events or changes within an application or interface.
|
|
50
|
-
|
|
51
|
-
Hide code
|
|
52
|
-
|
|
53
|
-
\[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; }
|
|
54
|
-
|
|
55
|
-
<IressStack gutter\="lg"\>
|
|
56
|
-
<IressToast
|
|
57
|
-
heading\="Success"
|
|
58
|
-
status\="success"
|
|
59
|
-
\>
|
|
60
|
-
Use to communicate that an action has been successfully completed, such as saving changes in a form. </IressToast\>
|
|
61
|
-
<IressToast
|
|
62
|
-
heading\="Error"
|
|
63
|
-
status\="error"
|
|
64
|
-
\>
|
|
65
|
-
Error toasts are useful for when a user has tried to submit some data but the submit has failed, due to an api error or loss of internet connection, for example. </IressToast\>
|
|
66
|
-
<IressToast
|
|
67
|
-
heading\="Info"
|
|
68
|
-
status\="info"
|
|
69
|
-
\>
|
|
70
|
-
Ideal for conveying updates or notifications that do not require immediate action, as well as gently inform users about events or changes within an application or interface. </IressToast\>
|
|
71
|
-
</IressStack\>
|
|
72
|
-
|
|
73
|
-
Copy
|
|
74
|
-
|
|
75
|
-
### [](#heading)Heading
|
|
76
|
-
|
|
77
|
-
Use the `heading` prop to add a header to the toast. The header can be any component you like, but it is designed to support a simple heading element. If provided a string, it will display a `<h2 />` element with the string as its content.
|
|
78
|
-
|
|
79
|
-
**Note:** `headingText` and `headingLevel` props have been replaced with the `heading` render prop to give you more control over the `heading` element and its content. To use the previous behaviour, you can pass a string which will automatically create a `h2` element, or pass a `h*` element with the text as a child.
|
|
80
|
-
|
|
81
|
-
Toast with a h2 tag
|
|
82
|
-
-------------------
|
|
83
|
-
|
|
84
|
-
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
85
|
-
|
|
86
|
-
Hide code
|
|
87
|
-
|
|
88
|
-
\[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; }
|
|
89
|
-
|
|
90
|
-
<IressToast
|
|
91
|
-
heading\={<h2\>Toast with a h2 tag</h2\>}
|
|
92
|
-
status\="error"
|
|
93
|
-
\>
|
|
94
|
-
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
95
|
-
</IressToast\>
|
|
96
|
-
|
|
97
|
-
Copy
|
|
98
|
-
|
|
99
|
-
### [](#footer)Footer
|
|
100
|
-
|
|
101
|
-
The `footer` prop allows for content to be placed below the header and body of the alert. This can be useful for displaying call to actions.
|
|
102
|
-
|
|
103
|
-
Error
|
|
104
|
-
-----
|
|
105
|
-
|
|
106
|
-
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
107
|
-
|
|
108
|
-
Try Again
|
|
109
|
-
|
|
110
|
-
Hide code
|
|
111
|
-
|
|
112
|
-
\[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; }
|
|
113
|
-
|
|
114
|
-
<IressToast
|
|
115
|
-
actions\={<IressButton key\="test" mode\="danger"\>Try Again</IressButton\>}
|
|
116
|
-
heading\="Error"
|
|
117
|
-
status\="error"
|
|
118
|
-
\>
|
|
119
|
-
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
120
|
-
</IressToast\>
|
|
121
|
-
|
|
122
|
-
Copy
|
|
123
|
-
|
|
124
|
-
### [](#dismiss-button)Dismiss Button
|
|
125
|
-
|
|
126
|
-
Dismiss Button is on the top right corner and it's showing/hiding based on `dismissible` prop.
|
|
127
|
-
|
|
128
|
-
**Note:** When it's `true`, `onClose` event is going to be available.
|
|
129
|
-
|
|
130
|
-
Information
|
|
131
|
-
-----------
|
|
132
|
-
|
|
133
|
-
Information toast with dismiss button
|
|
134
|
-
|
|
135
|
-
Hide code
|
|
136
|
-
|
|
137
|
-
\[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; }
|
|
138
|
-
|
|
139
|
-
<IressToast
|
|
140
|
-
dismissible
|
|
141
|
-
heading\="Information"
|
|
142
|
-
status\="info"
|
|
143
|
-
\>
|
|
144
|
-
Information toast with dismiss button
|
|
145
|
-
</IressToast\>
|
|
146
|
-
|
|
147
|
-
Copy
|
|
148
|
-
|
|
149
|
-
On this page
|
|
150
|
-
|
|
151
|
-
* [Overview](#overview)
|
|
152
|
-
* [Props](#props)
|
|
153
|
-
* [Examples](#examples)
|
|
154
|
-
* [Status](#status)
|
|
155
|
-
* [Heading](#heading)
|
|
156
|
-
* [Footer](#footer)
|
|
157
|
-
* [Dismiss Button](#dismiss-button)
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
[](#toggle)Toggle
|
|
2
|
-
=================
|
|
3
|
-
|
|
4
|
-
Overview
|
|
5
|
-
--------
|
|
6
|
-
|
|
7
|
-
Toggles allow users to turn things on or off. When toggled, the associated change happens straight away.
|
|
8
|
-
|
|
9
|
-
Toggle
|
|
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
|
-
<IressToggle
|
|
16
|
-
layout\="inline"
|
|
17
|
-
\>
|
|
18
|
-
Toggle
|
|
19
|
-
</IressToggle\>
|
|
20
|
-
|
|
21
|
-
Copy
|
|
22
|
-
|
|
23
|
-
[](#usage)Usage
|
|
24
|
-
---------------
|
|
25
|
-
|
|
26
|
-
Toggles are typically on / off switches, similar to a household light switch. They allow users to choose between two mutually exclusive options, and will always have a default value.
|
|
27
|
-
|
|
28
|
-
The `IressToggle` component should only be used for actions that happen immediately, for example switching a device's WiFi connection on or off.
|
|
29
|
-
|
|
30
|
-
Don't use Toggles in forms
|
|
31
|
-
--------------------------
|
|
32
|
-
|
|
33
|
-
Toggles shouldn’t be used as part of a form as they don’t have the correct semantics, and won’t submit a value when the form data is submitted. If you need a toggleable component in a form, use a checkbox or radio group instead.
|
|
34
|
-
|
|
35
|
-
### [](#labels)Labels
|
|
36
|
-
|
|
37
|
-
Toggles should always have a label, which is set via its `children`.
|
|
38
|
-
|
|
39
|
-
Toggle
|
|
40
|
-
|
|
41
|
-
Hide code
|
|
42
|
-
|
|
43
|
-
\[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; }
|
|
44
|
-
|
|
45
|
-
<IressToggle
|
|
46
|
-
layout\="inline"
|
|
47
|
-
\>
|
|
48
|
-
Toggle
|
|
49
|
-
</IressToggle\>
|
|
50
|
-
|
|
51
|
-
Copy
|
|
52
|
-
|
|
53
|
-
### [](#hidden-labels)Hidden labels
|
|
54
|
-
|
|
55
|
-
Labels can be hidden via the `hiddenLabel` prop; this will hide the label from view, but it'll still be available to screen reader users.
|
|
56
|
-
|
|
57
|
-
Toggle
|
|
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
|
-
<IressToggle
|
|
64
|
-
hiddenLabel
|
|
65
|
-
layout\="inline"
|
|
66
|
-
\>
|
|
67
|
-
Toggle
|
|
68
|
-
</IressToggle\>
|
|
69
|
-
|
|
70
|
-
Copy
|
|
71
|
-
|
|
72
|
-
### [](#checked)Checked
|
|
73
|
-
|
|
74
|
-
The on / off state of the toggle can be controlled by setting the `checked` prop.
|
|
75
|
-
|
|
76
|
-
Toggle
|
|
77
|
-
|
|
78
|
-
Hide code
|
|
79
|
-
|
|
80
|
-
\[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; }
|
|
81
|
-
|
|
82
|
-
<IressToggle
|
|
83
|
-
checked
|
|
84
|
-
layout\="inline"
|
|
85
|
-
\>
|
|
86
|
-
Toggle
|
|
87
|
-
</IressToggle\>
|
|
88
|
-
|
|
89
|
-
Copy
|
|
90
|
-
|
|
91
|
-
### [](#layout)Layout
|
|
92
|
-
|
|
93
|
-
The `layout` prop allows you to control the position of the label in relation to the control. The default layout is `inline`, but you can also choose the following options:',
|
|
94
|
-
|
|
95
|
-
* `inline-between` similar to inline, but this positions the label and control at opposite ends of their container
|
|
96
|
-
* `inline-reverse` renders the label after the control instead of before the control
|
|
97
|
-
* `stack` positions the label above the control
|
|
98
|
-
|
|
99
|
-
Toggle
|
|
100
|
-
|
|
101
|
-
Toggle
|
|
102
|
-
|
|
103
|
-
Toggle
|
|
104
|
-
|
|
105
|
-
Toggle
|
|
106
|
-
|
|
107
|
-
Hide code
|
|
108
|
-
|
|
109
|
-
\[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; }
|
|
110
|
-
|
|
111
|
-
<IressRow gutter\="lg"\>
|
|
112
|
-
<IressCol span\="12"\>
|
|
113
|
-
<IressPanel background\="alt"\>
|
|
114
|
-
<IressToggle
|
|
115
|
-
layout\="inline"
|
|
116
|
-
\>
|
|
117
|
-
Toggle </IressToggle\>
|
|
118
|
-
</IressPanel\>
|
|
119
|
-
</IressCol\>
|
|
120
|
-
<IressCol span\="12"\>
|
|
121
|
-
<IressPanel background\="alt"\>
|
|
122
|
-
<IressToggle
|
|
123
|
-
checked
|
|
124
|
-
layout\="inline-between"
|
|
125
|
-
\>
|
|
126
|
-
Toggle </IressToggle\>
|
|
127
|
-
</IressPanel\>
|
|
128
|
-
</IressCol\>
|
|
129
|
-
<IressCol span\="12"\>
|
|
130
|
-
<IressPanel background\="alt"\>
|
|
131
|
-
<IressToggle
|
|
132
|
-
layout\="inline-reverse"
|
|
133
|
-
\>
|
|
134
|
-
Toggle </IressToggle\>
|
|
135
|
-
</IressPanel\>
|
|
136
|
-
</IressCol\>
|
|
137
|
-
<IressCol span\="12"\>
|
|
138
|
-
<IressPanel background\="alt"\>
|
|
139
|
-
<IressToggle
|
|
140
|
-
checked
|
|
141
|
-
layout\="stack"
|
|
142
|
-
\>
|
|
143
|
-
Toggle </IressToggle\>
|
|
144
|
-
</IressPanel\>
|
|
145
|
-
</IressCol\>
|
|
146
|
-
</IressRow\>
|
|
147
|
-
|
|
148
|
-
Copy
|
|
149
|
-
|
|
150
|
-
On this page
|
|
151
|
-
|
|
152
|
-
* [Overview](#overview)
|
|
153
|
-
* [Props](#props)
|
|
154
|
-
* [Usage](#usage)
|
|
155
|
-
* [Labels](#labels)
|
|
156
|
-
* [Hidden labels](#hidden-labels)
|
|
157
|
-
* [Checked](#checked)
|
|
158
|
-
* [Layout](#layout)
|