@iress-oss/ids-mcp-server 6.0.0-alpha.0 → 6.0.0-alpha.1-canary-20251204014525-3f0dce4
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/dist/searchHandlers.test.js +8 -2
- package/dist/toolHandler.test.js +9 -9
- package/dist/utils.test.js +6 -2
- package/package.json +32 -30
- package/generated/docs/components-alert-docs.md +0 -702
- package/generated/docs/components-autocomplete-docs.md +0 -1433
- package/generated/docs/components-autocomplete-recipes-docs.md +0 -104
- package/generated/docs/components-badge-docs.md +0 -531
- package/generated/docs/components-button-docs.md +0 -1442
- package/generated/docs/components-buttongroup-docs.md +0 -748
- package/generated/docs/components-card-docs.md +0 -944
- package/generated/docs/components-checkbox-docs.md +0 -694
- package/generated/docs/components-checkboxgroup-docs.md +0 -1087
- package/generated/docs/components-checkboxgroup-recipes-docs.md +0 -119
- package/generated/docs/components-col-docs.md +0 -881
- package/generated/docs/components-container-docs.md +0 -123
- package/generated/docs/components-divider-docs.md +0 -576
- package/generated/docs/components-expander-docs.md +0 -594
- package/generated/docs/components-field-docs.md +0 -2007
- package/generated/docs/components-filter-docs.md +0 -1322
- package/generated/docs/components-hide-docs.md +0 -702
- package/generated/docs/components-icon-docs.md +0 -816
- package/generated/docs/components-image-docs.md +0 -493
- package/generated/docs/components-inline-docs.md +0 -2003
- package/generated/docs/components-input-docs.md +0 -867
- package/generated/docs/components-input-recipes-docs.md +0 -140
- package/generated/docs/components-inputcurrency-docs.md +0 -689
- package/generated/docs/components-inputcurrency-recipes-docs.md +0 -115
- package/generated/docs/components-introduction-docs.md +0 -450
- package/generated/docs/components-label-docs.md +0 -562
- package/generated/docs/components-link-docs.md +0 -586
- package/generated/docs/components-menu-docs.md +0 -1146
- package/generated/docs/components-menu-menuitem-docs.md +0 -739
- package/generated/docs/components-modal-docs.md +0 -1346
- package/generated/docs/components-panel-docs.md +0 -600
- package/generated/docs/components-placeholder-docs.md +0 -446
- package/generated/docs/components-popover-docs.md +0 -1529
- package/generated/docs/components-popover-recipes-docs.md +0 -211
- package/generated/docs/components-progress-docs.md +0 -568
- package/generated/docs/components-provider-docs.md +0 -160
- package/generated/docs/components-radio-docs.md +0 -563
- package/generated/docs/components-radiogroup-docs.md +0 -1153
- package/generated/docs/components-readonly-docs.md +0 -535
- package/generated/docs/components-richselect-docs.md +0 -5836
- package/generated/docs/components-row-docs.md +0 -2354
- package/generated/docs/components-select-docs.md +0 -940
- package/generated/docs/components-skeleton-docs.md +0 -597
- package/generated/docs/components-skeleton-recipes-docs.md +0 -76
- package/generated/docs/components-skiplink-docs.md +0 -587
- package/generated/docs/components-slideout-docs.md +0 -1036
- package/generated/docs/components-slider-docs.md +0 -828
- package/generated/docs/components-spinner-docs.md +0 -450
- package/generated/docs/components-stack-docs.md +0 -923
- package/generated/docs/components-table-ag-grid-docs.md +0 -1444
- package/generated/docs/components-table-docs.md +0 -2327
- package/generated/docs/components-tabset-docs.md +0 -768
- package/generated/docs/components-tabset-tab-docs.md +0 -550
- package/generated/docs/components-tag-docs.md +0 -548
- package/generated/docs/components-text-docs.md +0 -585
- package/generated/docs/components-toaster-docs.md +0 -755
- package/generated/docs/components-toggle-docs.md +0 -614
- package/generated/docs/components-tooltip-docs.md +0 -747
- package/generated/docs/components-validationmessage-docs.md +0 -1161
- package/generated/docs/contact-us-docs.md +0 -27
- package/generated/docs/extensions-editor-docs.md +0 -1181
- package/generated/docs/extensions-editor-recipes-docs.md +0 -89
- package/generated/docs/foundations-accessibility-docs.md +0 -40
- package/generated/docs/foundations-consistency-docs.md +0 -52
- package/generated/docs/foundations-content-docs.md +0 -23
- package/generated/docs/foundations-grid-docs.md +0 -74
- package/generated/docs/foundations-introduction-docs.md +0 -19
- package/generated/docs/foundations-principles-docs.md +0 -70
- package/generated/docs/foundations-responsive-breakpoints-docs.md +0 -193
- package/generated/docs/foundations-tokens-colour-docs.md +0 -564
- package/generated/docs/foundations-tokens-elevation-docs.md +0 -155
- package/generated/docs/foundations-tokens-introduction-docs.md +0 -190
- package/generated/docs/foundations-tokens-radius-docs.md +0 -71
- package/generated/docs/foundations-tokens-spacing-docs.md +0 -89
- package/generated/docs/foundations-tokens-typography-docs.md +0 -322
- package/generated/docs/foundations-user-experience-docs.md +0 -63
- package/generated/docs/foundations-visual-design-docs.md +0 -46
- package/generated/docs/foundations-z-index-stacking-docs.md +0 -31
- 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 -2054
- package/generated/docs/introduction-docs.md +0 -87
- package/generated/docs/news-version-6-docs.md +0 -93
- package/generated/docs/patterns-form-docs.md +0 -3902
- package/generated/docs/patterns-form-recipes-docs.md +0 -1370
- package/generated/docs/patterns-introduction-docs.md +0 -24
- package/generated/docs/patterns-loading-docs.md +0 -4043
- package/generated/docs/resources-code-katas-docs.md +0 -29
- package/generated/docs/resources-introduction-docs.md +0 -38
- package/generated/docs/resources-mcp-server-docs.md +0 -27
- package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +0 -437
- package/generated/docs/styling-props-colour-docs.md +0 -172
- package/generated/docs/styling-props-elevation-docs.md +0 -88
- package/generated/docs/styling-props-radius-docs.md +0 -86
- package/generated/docs/styling-props-reference-docs.md +0 -160
- package/generated/docs/styling-props-screen-readers-docs.md +0 -71
- package/generated/docs/styling-props-sizing-docs.md +0 -627
- package/generated/docs/styling-props-spacing-docs.md +0 -2282
- package/generated/docs/styling-props-typography-docs.md +0 -121
- package/generated/docs/themes-available-themes-docs.md +0 -66
- package/generated/docs/themes-introduction-docs.md +0 -121
- package/generated/docs/versions-docs.md +0 -17
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -1,755 +0,0 @@
|
|
|
1
|
-
[](#toaster)Toaster
|
|
2
|
-
===================
|
|
3
|
-
|
|
4
|
-
Overview
|
|
5
|
-
--------
|
|
6
|
-
|
|
7
|
-
Toaster provide users with important, time-sensitive information.
|
|
8
|
-
|
|
9
|
-
* * *
|
|
10
|
-
|
|
11
|
-
Updated
|
|
12
|
-
|
|
13
|
-
**Recently updated**
|
|
14
|
-
|
|
15
|
-
This component has been recently updated with new props. The props have been marked as beta. Please tell us if there are any issues.
|
|
16
|
-
|
|
17
|
-
`IressToasterProvider` does not change the position on each render, it can only be done on the initial render.
|
|
18
|
-
|
|
19
|
-
Show toast using provider
|
|
20
|
-
|
|
21
|
-
Hide code
|
|
22
|
-
|
|
23
|
-
\[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; }
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
IressButton,
|
|
27
|
-
IressToasterProvider,
|
|
28
|
-
IressToasterProviderProps,
|
|
29
|
-
useToaster,
|
|
30
|
-
} from '@iress-oss/ids-components';
|
|
31
|
-
const ToastWithTrigger \= () \=> {
|
|
32
|
-
const toaster \= useToaster();
|
|
33
|
-
return (
|
|
34
|
-
<IressButton
|
|
35
|
-
onClick\={() \=>
|
|
36
|
-
toaster.error({
|
|
37
|
-
heading: 'Error',
|
|
38
|
-
content:
|
|
39
|
-
'Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.',
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
\>
|
|
43
|
-
Show toast using provider </IressButton\>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
export const SimpleToasterExample \= () \=> (
|
|
47
|
-
<IressToasterProvider \>
|
|
48
|
-
<ToastWithTrigger />
|
|
49
|
-
</IressToasterProvider\>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
Copy
|
|
53
|
-
|
|
54
|
-
[](#props)Props
|
|
55
|
-
---------------
|
|
56
|
-
|
|
57
|
-
| Name | Description | Default | Control |
|
|
58
|
-
| --- | --- | --- | --- |
|
|
59
|
-
| bg |
|
|
60
|
-
**`bg`** sets the background color of an element using the `background-color` css property using the color tokens in the design system.
|
|
61
|
-
|
|
62
|
-
We recommend using the following token values for best background contrast:
|
|
63
|
-
|
|
64
|
-
* `colour.primary.fill` for primary backgrounds that need to stand out
|
|
65
|
-
* `colour.primary.surface` for primary backgrounds that need to be less prominent
|
|
66
|
-
* `colour.neutral.10` for the base background color, normally white in light mode or shade of grey in dark mode
|
|
67
|
-
* `colour.neutral.20` for a slightly darker background color, used in neutral state components
|
|
68
|
-
* `colour.system.danger.fill` for error backgrounds that need to stand out
|
|
69
|
-
* `colour.system.danger.surface` for error backgrounds that need to be less prominent
|
|
70
|
-
* `colour.system.success.fill` for success backgrounds that need to stand out
|
|
71
|
-
* `colour.system.success.surface` for success backgrounds that need to be less prominent
|
|
72
|
-
* `colour.system.warning.fill` for warning backgrounds that need to stand out
|
|
73
|
-
* `colour.system.warning.surface` for warning backgrounds that need to be less prominent
|
|
74
|
-
* `colour.system.info.fill` for info backgrounds that need to stand out
|
|
75
|
-
* `colour.system.info.surface` for info backgrounds that need to be less prominent
|
|
76
|
-
|
|
77
|
-
ResponsiveProp<ColorToken> | undefined
|
|
78
|
-
|
|
79
|
-
| \- | Set object |
|
|
80
|
-
| borderRadius |
|
|
81
|
-
|
|
82
|
-
The **`border-radius`** CSS property rounds the corners of an element's outer border edge using the radius tokens in the design system.
|
|
83
|
-
|
|
84
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
85
|
-
| --- | --- | --- | --- | --- |
|
|
86
|
-
| **4** | **4** | **5** | **12** | **9** |
|
|
87
|
-
| 1 _\-x-_ | | 3 _\-x-_ | | |
|
|
88
|
-
|
|
89
|
-
ResponsiveProp<RadiusToken> | undefined
|
|
90
|
-
|
|
91
|
-
| \- | Set object |
|
|
92
|
-
| color |
|
|
93
|
-
|
|
94
|
-
The **`color`** CSS property sets the foreground color value of an element's text and text decorations using the colour tokens from the design system. It also sets the `currentcolor` value. `currentcolor` may be used as an indirect value on _other_ properties and is the default for other color properties, such as `border-color`.
|
|
95
|
-
|
|
96
|
-
We recommend using the following token values for best color contrast:
|
|
97
|
-
|
|
98
|
-
* `colour.primary.onFill` used on top of `colour.primary.fill` for primary text that needs to stand out
|
|
99
|
-
* `colour.primary.text` used on top of `colour.primary.surface` or `colour.neutral.10` for primary text that needs to be less prominent
|
|
100
|
-
* `colour.neutral.70` used on top of `colour.neutral.10` or `colour.neutral.20` for muted text
|
|
101
|
-
* `colour.neutral.80` used on top of `colour.neutral.10` or `colour.neutral.20` for standard text
|
|
102
|
-
* `colour.system.danger.onFill` used on top of `colour.system.danger.fill` for error text that needs to stand out
|
|
103
|
-
* `colour.system.danger.text` used on top of `colour.system.danger.surface` for error text that needs to be less prominent
|
|
104
|
-
* `colour.system.success.onFill` used on top of `colour.system.success.fill` for success text that needs to stand out
|
|
105
|
-
* `colour.system.success.text` used on top of `colour.system.success.surface` for success text that needs to be less prominent
|
|
106
|
-
* `colour.system.warning.onFill` used on top of `colour.system.warning.fill` for warning text that needs to stand out
|
|
107
|
-
* `colour.system.warning.text` used on top of `colour.system.warning.surface` for warning text that needs to be less prominent
|
|
108
|
-
* `colour.system.info.onFill` used on top of `colour.system.info.fill` for informative text that needs to stand out
|
|
109
|
-
* `colour.system.info.text` used on top of `colour.system.info.surface` for informative text that needs to be less prominent
|
|
110
|
-
|
|
111
|
-
ResponsiveProp<ColorToken> | undefined
|
|
112
|
-
|
|
113
|
-
| \- | Set object |
|
|
114
|
-
| container |
|
|
115
|
-
|
|
116
|
-
The container element to render the toaster into. By default, the toaster will render at the end of the document body.
|
|
117
|
-
|
|
118
|
-
FloatingUIContainerundefined
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
| \- | \- |
|
|
123
|
-
| focusable |
|
|
124
|
-
|
|
125
|
-
The `focusable` prop is used to apply the focus elevation when focused. It can be set to `true` to apply focus styles on focus, or `'within'` to apply focus styles when the element or any of its children are focused.
|
|
126
|
-
|
|
127
|
-
"true""within"undefined
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
| \- | Set object |
|
|
132
|
-
| hide |
|
|
133
|
-
|
|
134
|
-
Set **`hide`** to hide an element completely using `display: none`. It can also be set to an object of breakpoints to hide the element at specific breakpoints.
|
|
135
|
-
|
|
136
|
-
Hide on all breakpoints: `hide: true` Hide on specific breakpoints: `hide: { xs: false, sm: true, md: false, lg: true, xl: false, xxl: true }`
|
|
137
|
-
|
|
138
|
-
Notes:
|
|
139
|
-
|
|
140
|
-
* If you need to hide an element but allow it to be visible to screen readers, use the `srOnly` prop instead.
|
|
141
|
-
* Consider if you can conditionally render the element instead of hiding it.
|
|
142
|
-
|
|
143
|
-
ResponsiveProp<boolean> | undefined
|
|
144
|
-
|
|
145
|
-
| \- | Set object |
|
|
146
|
-
| id |
|
|
147
|
-
|
|
148
|
-
A unique identifier for the toaster provider. This is useful if you have multiple toaster providers in your application based on context.
|
|
149
|
-
|
|
150
|
-
stringundefined
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
| \- | Set object |
|
|
155
|
-
| layerStyle |
|
|
156
|
-
|
|
157
|
-
Elevate a layer by using a **`layerStyle`**. These are connected to the elevation tokens in the design system. They can be combined to create hierarchy and structure.
|
|
158
|
-
|
|
159
|
-
* `elevation.raised`: Raised elevations sit slightly higher than other content. They are reserved for cards that can be moved, such as Jira issue cards and Trello cards. In special circumstances, they can be used for cards as a way to provide additional heirarchy or emphasis.
|
|
160
|
-
* `elevation.floating`: Floating is the highest elevation available. It is reserved for a UI that sits over another UI, such as modals, dialogs, dropdown menus, floating toolbars, and floating single-action buttons.
|
|
161
|
-
* `elevation.overflow`: Overflow is a shadow indicating content has scrolled outside a view. It can be used for vertical or horizontal scroll. An example of overflow shadows is the horizontal scroll in tables on a Confluence page.
|
|
162
|
-
|
|
163
|
-
ResponsiveProp<"elevation.raised" | "elevation.floating" | "elevation.overflow" | "elevation.focus" | "elevation.focusCompact"> | undefined
|
|
164
|
-
|
|
165
|
-
| \- | Set object |
|
|
166
|
-
| m |
|
|
167
|
-
|
|
168
|
-
The **`m`** property is short for `margin`, and sets the margin area on all four sides of an element.
|
|
169
|
-
|
|
170
|
-
It uses the spacing tokens in the design system. You can also use the negative values to overlap elements or ignore padding based on the design requirements.
|
|
171
|
-
|
|
172
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
173
|
-
| --- | --- | --- | --- | --- |
|
|
174
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
175
|
-
|
|
176
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
177
|
-
|
|
178
|
-
| \- | Set object |
|
|
179
|
-
| maxWidth |
|
|
180
|
-
|
|
181
|
-
The **`max-width`** CSS property sets the maximum width of an element. It prevents the used value of the `width` property from becoming larger than the value specified by `max-width`.
|
|
182
|
-
|
|
183
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
184
|
-
| --- | --- | --- | --- | --- |
|
|
185
|
-
| **1** | **1** | **1** | **12** | **7** |
|
|
186
|
-
|
|
187
|
-
ResponsiveProp<"auto" | SizeToken | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | ... 8 more ... | "11/12"> | undefined
|
|
188
|
-
|
|
189
|
-
| \- | Set object |
|
|
190
|
-
| mb |
|
|
191
|
-
|
|
192
|
-
The **`mb`** property is short for `margin-bottom` and sets the margin area on the bottom side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
193
|
-
|
|
194
|
-
It uses the spacing tokens in the design system.
|
|
195
|
-
|
|
196
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
197
|
-
| --- | --- | --- | --- | --- |
|
|
198
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
199
|
-
|
|
200
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
201
|
-
|
|
202
|
-
| \- | Set object |
|
|
203
|
-
| ml |
|
|
204
|
-
|
|
205
|
-
The **`ml`** property is short for `margin-left` and sets the margin area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
206
|
-
|
|
207
|
-
It uses the spacing tokens in the design system.
|
|
208
|
-
|
|
209
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
210
|
-
| --- | --- | --- | --- | --- |
|
|
211
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
212
|
-
|
|
213
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
214
|
-
|
|
215
|
-
| \- | Set object |
|
|
216
|
-
| mr |
|
|
217
|
-
|
|
218
|
-
The **`mr`** property is short for `margin-right` and sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
219
|
-
|
|
220
|
-
It uses the spacing tokens in the design system.
|
|
221
|
-
|
|
222
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
223
|
-
| --- | --- | --- | --- | --- |
|
|
224
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
225
|
-
|
|
226
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
227
|
-
|
|
228
|
-
| \- | Set object |
|
|
229
|
-
| mt |
|
|
230
|
-
|
|
231
|
-
The **`mt`** property is short for `margin-top` and sets the margin area on the top side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
232
|
-
|
|
233
|
-
It uses the spacing tokens in the design system.
|
|
234
|
-
|
|
235
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
236
|
-
| --- | --- | --- | --- | --- |
|
|
237
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
238
|
-
|
|
239
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
240
|
-
|
|
241
|
-
| \- | Set object |
|
|
242
|
-
| mx |
|
|
243
|
-
|
|
244
|
-
The **`mx`** property is short for `margin-inline`. It is a shorthand property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
|
|
245
|
-
|
|
246
|
-
It uses the spacing tokens in the design system. You can also use the negative values to overlap elements or ignore padding based on the design requirements.
|
|
247
|
-
|
|
248
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
249
|
-
| --- | --- | --- | --- | --- |
|
|
250
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
251
|
-
|
|
252
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
253
|
-
|
|
254
|
-
| \- | Set object |
|
|
255
|
-
| my |
|
|
256
|
-
|
|
257
|
-
The **`my`** property is short for `margin-block`. It defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
|
|
258
|
-
|
|
259
|
-
It uses the spacing tokens in the design system. You can also use the negative values to overlap elements or ignore padding based on the design requirements.
|
|
260
|
-
|
|
261
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
262
|
-
| --- | --- | --- | --- | --- |
|
|
263
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
264
|
-
|
|
265
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
266
|
-
|
|
267
|
-
| \- | Set object |
|
|
268
|
-
| noGutter |
|
|
269
|
-
|
|
270
|
-
The **`noGutter`** property is used to remove the bottom margin from the last child of a component. This is useful when you want to avoid extra spacing at the end of a layout.
|
|
271
|
-
|
|
272
|
-
booleanundefined
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
| \- | Set object |
|
|
277
|
-
| p |
|
|
278
|
-
|
|
279
|
-
The **`p`** property is short for `padding`, and sets the padding area on all four sides of an element at once.
|
|
280
|
-
|
|
281
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
282
|
-
|
|
283
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
284
|
-
| --- | --- | --- | --- | --- |
|
|
285
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
286
|
-
|
|
287
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
288
|
-
|
|
289
|
-
| \- | Set object |
|
|
290
|
-
| pb |
|
|
291
|
-
|
|
292
|
-
The **`pb`** property is short for `padding-bottom` and sets the padding area on the bottom side of an element.
|
|
293
|
-
|
|
294
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
295
|
-
|
|
296
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
297
|
-
| --- | --- | --- | --- | --- |
|
|
298
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
299
|
-
|
|
300
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
301
|
-
|
|
302
|
-
| \- | Set object |
|
|
303
|
-
| pl |
|
|
304
|
-
|
|
305
|
-
The **`pl`** property is short for `padding-left` and sets the padding area on the left side of an element.
|
|
306
|
-
|
|
307
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
308
|
-
|
|
309
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
310
|
-
| --- | --- | --- | --- | --- |
|
|
311
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
312
|
-
|
|
313
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
314
|
-
|
|
315
|
-
| \- | Set object |
|
|
316
|
-
| position |
|
|
317
|
-
|
|
318
|
-
The position on the screen where the toast will appear.
|
|
319
|
-
|
|
320
|
-
"bottom-start""bottom-end""top-start""top-end""bottom-center""top-center"undefined
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
|
325
|
-
|
|
326
|
-
bottom-end
|
|
327
|
-
|
|
328
|
-
| Set object |
|
|
329
|
-
| pr |
|
|
330
|
-
|
|
331
|
-
The **`pr`** property is short for `padding-right` and sets the padding area on the right side of an element.
|
|
332
|
-
|
|
333
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
334
|
-
|
|
335
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
336
|
-
| --- | --- | --- | --- | --- |
|
|
337
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
338
|
-
|
|
339
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
340
|
-
|
|
341
|
-
| \- | Set object |
|
|
342
|
-
| pt |
|
|
343
|
-
|
|
344
|
-
The **`pt`** property is short for `padding-top` and sets the padding area on the top side of an element.
|
|
345
|
-
|
|
346
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
347
|
-
|
|
348
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
349
|
-
| --- | --- | --- | --- | --- |
|
|
350
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
351
|
-
|
|
352
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
353
|
-
|
|
354
|
-
| \- | Set object |
|
|
355
|
-
| px |
|
|
356
|
-
|
|
357
|
-
The **`px`** property is short for `padding-inline`. It is a shorthand property that defines both the logical inline start and end paddings of an element, which maps to physical paddings depending on the element's writing mode, directionality, and text orientation.
|
|
358
|
-
|
|
359
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
360
|
-
|
|
361
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
362
|
-
| --- | --- | --- | --- | --- |
|
|
363
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
364
|
-
|
|
365
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
366
|
-
|
|
367
|
-
| \- | Set object |
|
|
368
|
-
| py |
|
|
369
|
-
|
|
370
|
-
The **`py`** property is short for `padding-block`. It defines the logical block start and end paddings of an element, which maps to physical paddings depending on the element's writing mode, directionality, and text orientation.
|
|
371
|
-
|
|
372
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
373
|
-
|
|
374
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
375
|
-
| --- | --- | --- | --- | --- |
|
|
376
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
377
|
-
|
|
378
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
379
|
-
|
|
380
|
-
| \- | Set object |
|
|
381
|
-
| rowGap |
|
|
382
|
-
|
|
383
|
-
The **`row-gap`** CSS property sets the size of the gap (gutter) between an element's rows.
|
|
384
|
-
|
|
385
|
-
Note: It only has an effect when used as a direct child of a layout component, such as IressRow, IressStack or IressInline.
|
|
386
|
-
|
|
387
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
388
|
-
| --- | --- | --- | --- | --- |
|
|
389
|
-
| **47** | **52** | **10.1** | **16** | No |
|
|
390
|
-
|
|
391
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
392
|
-
|
|
393
|
-
| \- | Set object |
|
|
394
|
-
| srOnly |
|
|
395
|
-
|
|
396
|
-
Set **`srOnly`** to hide an element visually but still make it accessible to screen readers. It can also be set to an object of breakpoints to hide the element at specific breakpoints.
|
|
397
|
-
|
|
398
|
-
Hide on all breakpoints: `srOnly: true` Hide on specific breakpoints: `srOnly: { xs: false, sm: true, md: false, lg: true, xl: false, xxl: true }`
|
|
399
|
-
|
|
400
|
-
ResponsiveProp<boolean> | undefined
|
|
401
|
-
|
|
402
|
-
| \- | Set object |
|
|
403
|
-
| stretch |
|
|
404
|
-
|
|
405
|
-
The **`stretch`** property is used to stretch an element to fill the available space in its parent container. It sets the `height` property to `100%` and `alignSelf` to `stretch`, allowing the element to expand and contract based on the size of its parent.
|
|
406
|
-
|
|
407
|
-
booleanundefined
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
| \- | Set object |
|
|
412
|
-
| textAlign |
|
|
413
|
-
|
|
414
|
-
The **`text-align`** CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box.
|
|
415
|
-
|
|
416
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
417
|
-
| --- | --- | --- | --- | --- |
|
|
418
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
419
|
-
|
|
420
|
-
ResponsiveProp<"center" | "left" | "right" | "inherit" | "justify"> | undefined
|
|
421
|
-
|
|
422
|
-
| \- | Set object |
|
|
423
|
-
| textStyle |
|
|
424
|
-
|
|
425
|
-
Select the typography to be used using the **`textStyle`** prop. These are connected to the typography tokens in the design system.'
|
|
426
|
-
|
|
427
|
-
* `typography.body.sm` - Use for small components such as badges and disclaimers, as well as compact variations of tables and lists.
|
|
428
|
-
* `typography.body.md` - The most commonly used body text size, used for most text content in the product and the default state of all components in the design system.
|
|
429
|
-
* `typography.body.lg` - Use for tag lines, subtitles, and other large text content in the product.
|
|
430
|
-
* `typography.heading.1` - Use for the main page title to establish a clear hierarchy. There is typically only one H1 per screen, emphasising the primary purpose or context of the page.
|
|
431
|
-
* `typography.heading.2` - Use for primary section headings within a page to organise content and guide the user through key areas. Also suitable for large components—such as modals—where space allows and where it pairs well with body.md or body.lg.
|
|
432
|
-
* `typography.heading.3` - Use for sub-sections under H2s to further structure content and maintain a clear visual hierarchy. Ideal for breaking down complex sections into manageable parts.
|
|
433
|
-
* `typography.heading.4` - Use for supporting headings within content blocks or small components where space is limited—such as table headers, cards, or side panels. Provides structure without overwhelming the layout.
|
|
434
|
-
* `typography.heading.5` - Use for minor labels or titles in compact UI elements, such as cards, sidebars, or inline labels. Best used to emphasise supplementary information without drawing too much attention. Works well with body.sm and is ideal for subtle content like fine print. Use sparingly to preserve typographic hierarchy.
|
|
435
|
-
* `typography.code` - Used to display code snippets in the product, such as in the API documentation.
|
|
436
|
-
|
|
437
|
-
ResponsiveProp<"typography.heading.1" | "typography.heading.2" | "typography.heading.3" | "typography.heading.4" | "typography.heading.5" | "typography.body.sm" | "typography.body.sm.regular" | ... 10 more ... | "typography.code"> | undefined
|
|
438
|
-
|
|
439
|
-
| \- | Set object |
|
|
440
|
-
| width |
|
|
441
|
-
|
|
442
|
-
The **`width`** CSS property sets an element's width. By default, it sets the width of the content area, but if `box-sizing` is set to `border-box`, it sets the width of the border area.
|
|
443
|
-
|
|
444
|
-
This prop only allows widths available throughout the component library. To use a custom width, you need to use the `style` prop, or add a custom class to the element and use CSS.
|
|
445
|
-
|
|
446
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
447
|
-
| --- | --- | --- | --- | --- |
|
|
448
|
-
| **1** | **1** | **1** | **12** | **4** |
|
|
449
|
-
|
|
450
|
-
ResponsiveProp<"auto" | SizeToken | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | ... 8 more ... | "11/12"> | undefined
|
|
451
|
-
|
|
452
|
-
| \- | Set object |
|
|
453
|
-
|
|
454
|
-
[](#usage)Usage
|
|
455
|
-
---------------
|
|
456
|
-
|
|
457
|
-
To use the toaster, wrap your `<App/>` or the component that you want to use the toasts within with `<IressToasterProvider />`. This provides the context for the `useToaster` hook, which is used to trigger toasts in your application.
|
|
458
|
-
|
|
459
|
-
You can use the `success`, `info` and `error` methods from the hook to trigger toasts in your application.
|
|
460
|
-
|
|
461
|
-
`IressToasterProvider` does not change the position on each render, it can only be done on the initial render.
|
|
462
|
-
|
|
463
|
-
Show toast using provider
|
|
464
|
-
|
|
465
|
-
Hide code
|
|
466
|
-
|
|
467
|
-
\[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; }
|
|
468
|
-
|
|
469
|
-
import {
|
|
470
|
-
IressButton,
|
|
471
|
-
IressToasterProvider,
|
|
472
|
-
IressToasterProviderProps,
|
|
473
|
-
useToaster,
|
|
474
|
-
} from '@iress-oss/ids-components';
|
|
475
|
-
const ToastWithTrigger \= () \=> {
|
|
476
|
-
const toaster \= useToaster();
|
|
477
|
-
return (
|
|
478
|
-
<IressButton
|
|
479
|
-
onClick\={() \=>
|
|
480
|
-
toaster.error({
|
|
481
|
-
heading: 'Error',
|
|
482
|
-
content:
|
|
483
|
-
'Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.',
|
|
484
|
-
})
|
|
485
|
-
}
|
|
486
|
-
\>
|
|
487
|
-
Show toast using provider </IressButton\>
|
|
488
|
-
);
|
|
489
|
-
};
|
|
490
|
-
export const SimpleToasterExample \= () \=> (
|
|
491
|
-
<IressToasterProvider \>
|
|
492
|
-
<ToastWithTrigger />
|
|
493
|
-
</IressToasterProvider\>
|
|
494
|
-
);
|
|
495
|
-
|
|
496
|
-
Copy
|
|
497
|
-
|
|
498
|
-
### [](#closing-toasts-via-the-provider)Closing toasts via the provider
|
|
499
|
-
|
|
500
|
-
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.
|
|
501
|
-
|
|
502
|
-
Show toast using provider
|
|
503
|
-
|
|
504
|
-
Hide code
|
|
505
|
-
|
|
506
|
-
\[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; }
|
|
507
|
-
|
|
508
|
-
import {
|
|
509
|
-
IressButton,
|
|
510
|
-
IressInline,
|
|
511
|
-
IressToasterProvider,
|
|
512
|
-
IressToasterProviderProps,
|
|
513
|
-
useToaster,
|
|
514
|
-
} from '@iress-oss/ids-components';
|
|
515
|
-
import { useState } from 'react';
|
|
516
|
-
const ToastWithTrigger \= () \=> {
|
|
517
|
-
const toaster \= useToaster();
|
|
518
|
-
const \[lastToastId, setLastToastId\] \= useState<string | null\>(null);
|
|
519
|
-
return (
|
|
520
|
-
<IressInline gap\="sm"\>
|
|
521
|
-
<IressButton onClick={() \=> {
|
|
522
|
-
const toastId \= toaster.error({
|
|
523
|
-
heading: 'Error',
|
|
524
|
-
content:
|
|
525
|
-
'Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.',
|
|
526
|
-
onClose: () \=> {
|
|
527
|
-
setLastToastId(null);
|
|
528
|
-
},
|
|
529
|
-
});
|
|
530
|
-
setLastToastId(toastId);
|
|
531
|
-
}}
|
|
532
|
-
> Show toast using provider </IressButton\>
|
|
533
|
-
{lastToastId && (
|
|
534
|
-
<IressButton onClick\={() \=> toaster.close(lastToastId)}\>
|
|
535
|
-
Close the last toast opened </IressButton\>
|
|
536
|
-
)}
|
|
537
|
-
</IressInline\>
|
|
538
|
-
);
|
|
539
|
-
};
|
|
540
|
-
export const CloseToastViaProvider \= () \=> (
|
|
541
|
-
<IressToasterProvider \>
|
|
542
|
-
<ToastWithTrigger />
|
|
543
|
-
</IressToasterProvider\>
|
|
544
|
-
);
|
|
545
|
-
|
|
546
|
-
Copy
|
|
547
|
-
|
|
548
|
-
[](#examples)Examples
|
|
549
|
-
---------------------
|
|
550
|
-
|
|
551
|
-
### [](#status)Status
|
|
552
|
-
|
|
553
|
-
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.
|
|
554
|
-
|
|
555
|
-
errorinfosuccess
|
|
556
|
-
|
|
557
|
-
Hide code
|
|
558
|
-
|
|
559
|
-
\[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; }
|
|
560
|
-
|
|
561
|
-
import {
|
|
562
|
-
IressButton,
|
|
563
|
-
IressInline,
|
|
564
|
-
IressToasterProvider,
|
|
565
|
-
IressToasterProviderProps,
|
|
566
|
-
ToastStatus,
|
|
567
|
-
useToaster,
|
|
568
|
-
} from '@iress-oss/ids-components';
|
|
569
|
-
const ToastWithTrigger \= ({ status }: { status: ToastStatus }) \=> {
|
|
570
|
-
const toaster \= useToaster();
|
|
571
|
-
return (
|
|
572
|
-
<IressButton
|
|
573
|
-
onClick\={() \=>
|
|
574
|
-
toaster\[status\]({ content: \`Hello, I am a ${status} toast\` })
|
|
575
|
-
}
|
|
576
|
-
\>
|
|
577
|
-
{status}
|
|
578
|
-
</IressButton\>
|
|
579
|
-
);
|
|
580
|
-
};
|
|
581
|
-
export const ToastStatuses \= () \=> (
|
|
582
|
-
<IressToasterProvider \>
|
|
583
|
-
<IressInline gap\="sm"\>
|
|
584
|
-
<ToastWithTrigger status\="error" />
|
|
585
|
-
<ToastWithTrigger status\="info" />
|
|
586
|
-
<ToastWithTrigger status\="success" />
|
|
587
|
-
</IressInline\>
|
|
588
|
-
</IressToasterProvider\>
|
|
589
|
-
);
|
|
590
|
-
|
|
591
|
-
Copy
|
|
592
|
-
|
|
593
|
-
### [](#timeout)Timeout
|
|
594
|
-
|
|
595
|
-
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.
|
|
596
|
-
|
|
597
|
-
Timeouts must be set in milliseconds; as an example, if you want a timeout of five seconds, set the timeout to 5000.
|
|
598
|
-
|
|
599
|
-
1000ms timeout
|
|
600
|
-
|
|
601
|
-
Hide code
|
|
602
|
-
|
|
603
|
-
\[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; }
|
|
604
|
-
|
|
605
|
-
import {
|
|
606
|
-
IressButton,
|
|
607
|
-
IressToasterProvider,
|
|
608
|
-
IressToasterProviderProps,
|
|
609
|
-
useToaster,
|
|
610
|
-
} from '@iress-oss/ids-components';
|
|
611
|
-
const ToastWithTrigger \= () \=> {
|
|
612
|
-
const toaster \= useToaster();
|
|
613
|
-
return (
|
|
614
|
-
<IressButton
|
|
615
|
-
onClick\={() \=>
|
|
616
|
-
toaster.success({
|
|
617
|
-
content: 'This is a really quick toast',
|
|
618
|
-
timeout: 1000,
|
|
619
|
-
})
|
|
620
|
-
}
|
|
621
|
-
\>
|
|
622
|
-
1000ms timeout </IressButton\>
|
|
623
|
-
);
|
|
624
|
-
};
|
|
625
|
-
export const ToasterTimeout \= () \=> (
|
|
626
|
-
<IressToasterProvider \>
|
|
627
|
-
<ToastWithTrigger />
|
|
628
|
-
</IressToasterProvider\>
|
|
629
|
-
);
|
|
630
|
-
|
|
631
|
-
Copy
|
|
632
|
-
|
|
633
|
-
### [](#position)Position
|
|
634
|
-
|
|
635
|
-
By default, the `IressToasterProvider`'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.
|
|
636
|
-
|
|
637
|
-
**Note:** The toast position should be consistent based on context, so users can find them easily.
|
|
638
|
-
|
|
639
|
-
top-starttop-centertop-end
|
|
640
|
-
|
|
641
|
-
Toaster positions
|
|
642
|
-
|
|
643
|
-
bottom-startbottom-centerbottom-end
|
|
644
|
-
|
|
645
|
-
Hide code
|
|
646
|
-
|
|
647
|
-
\[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; }
|
|
648
|
-
|
|
649
|
-
import {
|
|
650
|
-
IressButton,
|
|
651
|
-
IressInline,
|
|
652
|
-
IressPanel,
|
|
653
|
-
IressStack,
|
|
654
|
-
IressText,
|
|
655
|
-
IressToasterProvider,
|
|
656
|
-
IressToasterProviderProps,
|
|
657
|
-
NewToast,
|
|
658
|
-
useToaster,
|
|
659
|
-
} from '@iress-oss/ids-components';
|
|
660
|
-
const DEFAULT\_TOAST: NewToast \= {
|
|
661
|
-
content: 'Message sent successfully',
|
|
662
|
-
heading: 'Success',
|
|
663
|
-
status: 'success',
|
|
664
|
-
};
|
|
665
|
-
const Toaster \= () \=> {
|
|
666
|
-
const topStart \= useToaster('top-start');
|
|
667
|
-
const topCenter \= useToaster('top-center');
|
|
668
|
-
const topEnd \= useToaster('top-end');
|
|
669
|
-
const bottomStart \= useToaster('bottom-start');
|
|
670
|
-
const bottomCenter \= useToaster('bottom-center');
|
|
671
|
-
const bottomEnd \= useToaster('bottom-end');
|
|
672
|
-
return (
|
|
673
|
-
<div style\={{ padding: '80px 150px' }}\>
|
|
674
|
-
<IressStack gap\="md"\>
|
|
675
|
-
<IressInline horizontalAlign\="between" gap\="sm"\>
|
|
676
|
-
<IressButton onClick\={() \=> topStart.success(DEFAULT\_TOAST)}\>
|
|
677
|
-
top-start </IressButton\>
|
|
678
|
-
<IressButton onClick\={() \=> topCenter.success(DEFAULT\_TOAST)}\>
|
|
679
|
-
top-center </IressButton\>
|
|
680
|
-
<IressButton onClick\={() \=> topEnd.success(DEFAULT\_TOAST)}\>
|
|
681
|
-
top-end </IressButton\>
|
|
682
|
-
</IressInline\>
|
|
683
|
-
<IressPanel bg\="transparent" p\="lg"\>
|
|
684
|
-
<IressText textAlign\="center"\>Toaster positions</IressText\>
|
|
685
|
-
</IressPanel\>
|
|
686
|
-
<IressInline horizontalAlign\="between"\>
|
|
687
|
-
<IressButton onClick\={() \=> bottomStart.success(DEFAULT\_TOAST)}\>
|
|
688
|
-
bottom-start </IressButton\>
|
|
689
|
-
<IressButton onClick\={() \=> bottomCenter.success(DEFAULT\_TOAST)}\>
|
|
690
|
-
bottom-center </IressButton\>
|
|
691
|
-
<IressButton onClick\={() \=> bottomEnd.success(DEFAULT\_TOAST)}\>
|
|
692
|
-
bottom-end </IressButton\>
|
|
693
|
-
</IressInline\>
|
|
694
|
-
</IressStack\>
|
|
695
|
-
</div\>
|
|
696
|
-
);
|
|
697
|
-
};
|
|
698
|
-
export const ToasterPositionExamples \= () \=> (
|
|
699
|
-
<IressToasterProvider id\="bottom-end" position\="bottom-end"\>
|
|
700
|
-
<IressToasterProvider id\="bottom-center" position\="bottom-center"\>
|
|
701
|
-
<IressToasterProvider id\="bottom-start" position\="bottom-start"\>
|
|
702
|
-
<IressToasterProvider id\="top-start" position\="top-start"\>
|
|
703
|
-
<IressToasterProvider id\="top-center" position\="top-center"\>
|
|
704
|
-
<IressToasterProvider id\="top-end" position\="top-end"\>
|
|
705
|
-
<Toaster />
|
|
706
|
-
</IressToasterProvider\>
|
|
707
|
-
</IressToasterProvider\>
|
|
708
|
-
</IressToasterProvider\>
|
|
709
|
-
</IressToasterProvider\>
|
|
710
|
-
</IressToasterProvider\>
|
|
711
|
-
</IressToasterProvider\>
|
|
712
|
-
);
|
|
713
|
-
|
|
714
|
-
Copy
|
|
715
|
-
|
|
716
|
-
[](#migrating-from-version-4-and-below)Migrating from version 4 and below
|
|
717
|
-
-------------------------------------------------------------------------
|
|
718
|
-
|
|
719
|
-
### [](#adding-the-provider)Adding the provider
|
|
720
|
-
|
|
721
|
-
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.
|
|
722
|
-
|
|
723
|
-
\[data-radix-scroll-area-viewport\] {
|
|
724
|
-
scrollbar-width: none;
|
|
725
|
-
-ms-overflow-style: none;
|
|
726
|
-
-webkit-overflow-scrolling: touch;
|
|
727
|
-
}
|
|
728
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
729
|
-
display: none;
|
|
730
|
-
}
|
|
731
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
732
|
-
display: flex;
|
|
733
|
-
flex-direction: column;
|
|
734
|
-
align-items: stretch;
|
|
735
|
-
}
|
|
736
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
737
|
-
flex-grow: 1;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
const App \= () \=> <IressToasterProvider\>Rest of app here</IressToasterProvider\>;
|
|
741
|
-
|
|
742
|
-
Copy
|
|
743
|
-
|
|
744
|
-
On this page
|
|
745
|
-
|
|
746
|
-
* [Overview](#overview)
|
|
747
|
-
* [Props](#props)
|
|
748
|
-
* [Usage](#usage)
|
|
749
|
-
* [Closing toasts via the provider](#closing-toasts-via-the-provider)
|
|
750
|
-
* [Examples](#examples)
|
|
751
|
-
* [Status](#status)
|
|
752
|
-
* [Timeout](#timeout)
|
|
753
|
-
* [Position](#position)
|
|
754
|
-
* [Migrating from version 4 and below](#migrating-from-version-4-and-below)
|
|
755
|
-
* [Adding the provider](#adding-the-provider)
|