@iress-oss/ids-mcp-server 6.0.0-alpha.1-canary-20251204032753-fe18cab → 6.0.0-alpha.1-canary-20251204040305-3639454
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/generated/docs/components_components-alert-docs.md +1054 -0
- package/generated/docs/components_components-autocomplete-docs.md +3304 -0
- package/generated/docs/components_components-autocomplete-recipes-docs.md +98 -0
- package/generated/docs/components_components-badge-docs.md +312 -0
- package/generated/docs/components_components-button-docs.md +2339 -0
- package/generated/docs/components_components-buttongroup-docs.md +980 -0
- package/generated/docs/components_components-card-docs.md +1970 -0
- package/generated/docs/components_components-checkbox-docs.md +1083 -0
- package/generated/docs/components_components-checkboxgroup-docs.md +1597 -0
- package/generated/docs/components_components-checkboxgroup-recipes-docs.md +209 -0
- package/generated/docs/components_components-col-docs.md +755 -0
- package/generated/docs/components_components-container-docs.md +172 -0
- package/generated/docs/components_components-divider-docs.md +235 -0
- package/generated/docs/components_components-expander-docs.md +428 -0
- package/generated/docs/components_components-field-docs.md +3345 -0
- package/generated/docs/components_components-filter-docs.md +4091 -0
- package/generated/docs/components_components-hide-docs.md +450 -0
- package/generated/docs/components_components-icon-docs.md +1017 -0
- package/generated/docs/components_components-image-docs.md +168 -0
- package/generated/docs/components_components-inline-docs.md +1962 -0
- package/generated/docs/components_components-input-docs.md +1388 -0
- package/generated/docs/components_components-input-recipes-docs.md +349 -0
- package/generated/docs/components_components-inputcurrency-docs.md +636 -0
- package/generated/docs/components_components-inputcurrency-recipes-docs.md +208 -0
- package/generated/docs/components_components-introduction-docs.md +448 -0
- package/generated/docs/components_components-label-docs.md +229 -0
- package/generated/docs/components_components-link-docs.md +454 -0
- package/generated/docs/components_components-menu-docs.md +2219 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +1455 -0
- package/generated/docs/components_components-modal-docs.md +2002 -0
- package/generated/docs/components_components-panel-docs.md +342 -0
- package/generated/docs/components_components-placeholder-docs.md +98 -0
- package/generated/docs/components_components-popover-docs.md +1631 -0
- package/generated/docs/components_components-popover-recipes-docs.md +537 -0
- package/generated/docs/components_components-progress-docs.md +128 -0
- package/generated/docs/components_components-provider-docs.md +123 -0
- package/generated/docs/components_components-radio-docs.md +499 -0
- package/generated/docs/components_components-radiogroup-docs.md +1573 -0
- package/generated/docs/components_components-readonly-docs.md +277 -0
- package/generated/docs/components_components-richselect-docs.md +6101 -0
- package/generated/docs/components_components-row-docs.md +2172 -0
- package/generated/docs/components_components-select-docs.md +1110 -0
- package/generated/docs/components_components-skeleton-docs.md +467 -0
- package/generated/docs/components_components-skeleton-recipes-docs.md +110 -0
- package/generated/docs/components_components-skiplink-docs.md +220 -0
- package/generated/docs/components_components-slideout-docs.md +1910 -0
- package/generated/docs/components_components-slider-docs.md +1284 -0
- package/generated/docs/components_components-spinner-docs.md +90 -0
- package/generated/docs/components_components-stack-docs.md +730 -0
- package/generated/docs/components_components-table-docs.md +4038 -0
- package/generated/docs/components_components-tabset-docs.md +955 -0
- package/generated/docs/components_components-tabset-tab-docs.md +342 -0
- package/generated/docs/components_components-tag-docs.md +410 -0
- package/generated/docs/components_components-text-docs.md +593 -0
- package/generated/docs/components_components-toaster-docs.md +451 -0
- package/generated/docs/components_components-toggle-docs.md +513 -0
- package/generated/docs/components_components-tooltip-docs.md +564 -0
- package/generated/docs/components_components-validationmessage-docs.md +608 -0
- package/generated/docs/components_contact-us-docs.md +9 -0
- package/generated/docs/components_foundations-accessibility-docs.md +33 -0
- package/generated/docs/components_foundations-consistency-docs.md +44 -0
- package/generated/docs/components_foundations-content-docs.md +18 -0
- package/generated/docs/components_foundations-introduction-docs.md +17 -0
- package/generated/docs/components_foundations-principles-docs.md +60 -0
- package/generated/docs/components_foundations-responsive-layout-docs.md +2692 -0
- package/generated/docs/components_foundations-user-experience-docs.md +53 -0
- package/generated/docs/components_foundations-visual-design-docs.md +39 -0
- package/generated/docs/components_foundations-z-index-stacking-docs.md +288 -0
- package/generated/docs/components_frequently-asked-questions-docs.md +44 -0
- package/generated/docs/components_get-started-develop-docs.md +47 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +85 -0
- package/generated/docs/components_patterns-form-docs.md +2469 -0
- package/generated/docs/components_patterns-form-recipes-docs.md +1597 -0
- package/generated/docs/components_patterns-introduction-docs.md +31 -0
- package/generated/docs/components_patterns-loading-docs.md +1908 -0
- package/generated/docs/components_patterns-shadow-docs.md +195 -0
- package/generated/docs/components_resources-code-katas-docs.md +25 -0
- package/generated/docs/components_resources-introduction-docs.md +28 -0
- package/generated/docs/components_resources-mcp-server-docs.md +23 -0
- package/generated/docs/components_resources-migration-guides-from-v4-to-v5-docs.md +142 -0
- package/generated/docs/components_styling-props-colour-docs.md +91 -0
- package/generated/docs/components_styling-props-elevation-docs.md +69 -0
- package/generated/docs/components_styling-props-radius-docs.md +63 -0
- package/generated/docs/components_styling-props-reference-docs.md +160 -0
- package/generated/docs/components_styling-props-screen-readers-docs.md +66 -0
- package/generated/docs/components_styling-props-sizing-docs.md +217 -0
- package/generated/docs/components_styling-props-spacing-docs.md +545 -0
- package/generated/docs/components_styling-props-typography-docs.md +66 -0
- package/generated/docs/components_versions-docs.md +14 -0
- package/generated/docs/guidelines.md +3083 -0
- package/generated/docs/introduction-docs.md +37 -0
- package/generated/docs/tokens_colour-docs.md +479 -0
- package/generated/docs/tokens_elevation-docs.md +39 -0
- package/generated/docs/tokens_introduction-docs.md +150 -0
- package/generated/docs/tokens_radius-docs.md +67 -0
- package/generated/docs/tokens_spacing-docs.md +87 -0
- package/generated/docs/tokens_typography-docs.md +305 -0
- package/package.json +2 -2
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
Skeleton
|
|
2
|
+
========
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Skeletons can increase perceived performance for users. As opposed to spinners, skeletons make it feel as though things are happening/loading immediately, then the information is incrementally displayed on the screen.
|
|
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
|
+
[](./iframe.html?id=components-skeleton--default)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<IressSkeleton />
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Props
|
|
26
|
+
-----
|
|
27
|
+
|
|
28
|
+
| Name | Description | Default | Control |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| height |
|
|
31
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
32
|
+
|
|
33
|
+
unknown
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
| \- | Set object |
|
|
38
|
+
| mode |
|
|
39
|
+
|
|
40
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
41
|
+
|
|
42
|
+
TMode
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
| \- | Set object |
|
|
47
|
+
| textStyle |
|
|
48
|
+
|
|
49
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
50
|
+
|
|
51
|
+
IressCSSProps\['textStyle'\]
|
|
52
|
+
|
|
53
|
+
| \- | Set object |
|
|
54
|
+
| width |
|
|
55
|
+
|
|
56
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
57
|
+
|
|
58
|
+
string
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
| \- | Set string |
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
|
|
67
|
+
### Modes
|
|
68
|
+
|
|
69
|
+
The `mode` prop can be set to `text` (default), `rect` or `circle`.
|
|
70
|
+
|
|
71
|
+
[](./iframe.html?id=components-skeleton--mode)
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
<IressStack gap\="md"\>
|
|
76
|
+
<IressSkeleton mode\="text" />
|
|
77
|
+
<IressSkeleton
|
|
78
|
+
height\="100px"
|
|
79
|
+
mode\="rect"
|
|
80
|
+
/>
|
|
81
|
+
<IressSkeleton
|
|
82
|
+
height\="100px"
|
|
83
|
+
mode\="circle"
|
|
84
|
+
width\="100px"
|
|
85
|
+
/>
|
|
86
|
+
</IressStack\>
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Props
|
|
91
|
+
|
|
92
|
+
| Name | Description | Default | Control |
|
|
93
|
+
| --- | --- | --- | --- |
|
|
94
|
+
| height |
|
|
95
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
96
|
+
|
|
97
|
+
unknown
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
| \- | \- |
|
|
102
|
+
| mode |
|
|
103
|
+
|
|
104
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
105
|
+
|
|
106
|
+
TMode
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
| \- | \- |
|
|
111
|
+
| textStyle |
|
|
112
|
+
|
|
113
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
114
|
+
|
|
115
|
+
IressCSSProps\['textStyle'\]
|
|
116
|
+
|
|
117
|
+
| \- | Set object |
|
|
118
|
+
| width |
|
|
119
|
+
|
|
120
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
121
|
+
|
|
122
|
+
string
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
| \- | \- |
|
|
127
|
+
|
|
128
|
+
### Text
|
|
129
|
+
|
|
130
|
+
`text` mode allows you to use `IressSkeleton` in place of `IressText` and keep the same sizing. To achieve this you can use `text` mode in conjunction with the `textVariant` prop.
|
|
131
|
+
|
|
132
|
+
`text` also accepts the width prop but does not use the `height` prop like other modes. The height is achieved through font size and line height.
|
|
133
|
+
|
|
134
|
+
[](./iframe.html?id=components-skeleton--text)
|
|
135
|
+
|
|
136
|
+
Toggle load
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
import { useState } from 'react';
|
|
141
|
+
import {
|
|
142
|
+
IressButton,
|
|
143
|
+
IressSkeleton,
|
|
144
|
+
type IressSkeletonProps,
|
|
145
|
+
IressStack,
|
|
146
|
+
IressText,
|
|
147
|
+
} from '@iress-oss/ids-components';
|
|
148
|
+
import { TEXT\_STYLES } from '@theme-preset/tokens/textStyles';
|
|
149
|
+
export const SkeletonText \= () \=> {
|
|
150
|
+
const \[loading, setLoading\] \= useState(true);
|
|
151
|
+
return (
|
|
152
|
+
<IressStack gap\="md"\>
|
|
153
|
+
<IressButton onClick\={() \=> setLoading(!loading)}\>
|
|
154
|
+
Toggle load </IressButton\>
|
|
155
|
+
<IressStack gap\="md"\>
|
|
156
|
+
{TEXT\_STYLES.map((textStyle) \=> \[
|
|
157
|
+
loading && <IressSkeleton {...{
|
|
158
|
+
mode: 'text',
|
|
159
|
+
}} textStyle\={textStyle} />,
|
|
160
|
+
!loading && <IressText textStyle\={textStyle}\>{textStyle}</IressText\>,
|
|
161
|
+
\])}
|
|
162
|
+
</IressStack\>
|
|
163
|
+
</IressStack\>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### Props
|
|
170
|
+
|
|
171
|
+
| Name | Description | Default | Control |
|
|
172
|
+
| --- | --- | --- | --- |
|
|
173
|
+
| height |
|
|
174
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
175
|
+
|
|
176
|
+
unknown
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
| \- | Set object |
|
|
181
|
+
| mode |
|
|
182
|
+
|
|
183
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
184
|
+
|
|
185
|
+
TMode
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
| \- |
|
|
190
|
+
|
|
191
|
+
"text"
|
|
192
|
+
|
|
193
|
+
|
|
|
194
|
+
| textStyle |
|
|
195
|
+
|
|
196
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
197
|
+
|
|
198
|
+
IressCSSProps\['textStyle'\]
|
|
199
|
+
|
|
200
|
+
| \- | Set object |
|
|
201
|
+
| textVariant |
|
|
202
|
+
|
|
203
|
+
\-
|
|
204
|
+
|
|
205
|
+
| \- | \- |
|
|
206
|
+
| width |
|
|
207
|
+
|
|
208
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
209
|
+
|
|
210
|
+
string
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
| \- | Set string |
|
|
215
|
+
|
|
216
|
+
### Rect
|
|
217
|
+
|
|
218
|
+
`rect` mode allows you to use `IressSkeleton` in place of block elements, a good example would be in place of images.
|
|
219
|
+
|
|
220
|
+
`rect` accepts both `width` and `height` props for sizing. It will default to 100% width and 100px height.
|
|
221
|
+
|
|
222
|
+
[](./iframe.html?id=components-skeleton--rect)
|
|
223
|
+
|
|
224
|
+
Toggle load
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
import { useState } from 'react';
|
|
229
|
+
import {
|
|
230
|
+
IressButton,
|
|
231
|
+
IressPlaceholder,
|
|
232
|
+
IressSkeleton,
|
|
233
|
+
type IressSkeletonProps,
|
|
234
|
+
IressStack,
|
|
235
|
+
} from '@iress-oss/ids-components';
|
|
236
|
+
export const SkeletonRect \= (<'rect'\>) \=> {
|
|
237
|
+
const \[loading, setLoading\] \= useState(true);
|
|
238
|
+
return (
|
|
239
|
+
<IressStack gap\="md"\>
|
|
240
|
+
<IressButton onClick\={() \=> setLoading(!loading)}\>
|
|
241
|
+
Toggle load </IressButton\>
|
|
242
|
+
{loading && <IressSkeleton {...{
|
|
243
|
+
mode: 'rect',
|
|
244
|
+
width: '250',
|
|
245
|
+
height: '150',
|
|
246
|
+
}} />}
|
|
247
|
+
{!loading && <IressPlaceholder {...{
|
|
248
|
+
mode: 'rect',
|
|
249
|
+
width: '250',
|
|
250
|
+
height: '150',
|
|
251
|
+
}}\>Image</IressPlaceholder\>}
|
|
252
|
+
</IressStack\>
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### Props
|
|
259
|
+
|
|
260
|
+
| Name | Description | Default | Control |
|
|
261
|
+
| --- | --- | --- | --- |
|
|
262
|
+
| height |
|
|
263
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
264
|
+
|
|
265
|
+
unknown
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
| \- |
|
|
270
|
+
|
|
271
|
+
"150"
|
|
272
|
+
|
|
273
|
+
|
|
|
274
|
+
| mode |
|
|
275
|
+
|
|
276
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
277
|
+
|
|
278
|
+
TMode
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
| \- |
|
|
283
|
+
|
|
284
|
+
"rect"
|
|
285
|
+
|
|
286
|
+
|
|
|
287
|
+
| textStyle |
|
|
288
|
+
|
|
289
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
290
|
+
|
|
291
|
+
IressCSSProps\['textStyle'\]
|
|
292
|
+
|
|
293
|
+
| \- | Set object |
|
|
294
|
+
| width |
|
|
295
|
+
|
|
296
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
297
|
+
|
|
298
|
+
string
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
| \- | 250 |
|
|
303
|
+
|
|
304
|
+
### Circle
|
|
305
|
+
|
|
306
|
+
`circle` mode allows you to use `IressSkeleton` in place of circular elements, a good example would be for profile images.
|
|
307
|
+
|
|
308
|
+
`circle` accepts both `width` and `height` props for sizing. It will default to 100% width and 100px height.
|
|
309
|
+
|
|
310
|
+
[](./iframe.html?id=components-skeleton--circle)
|
|
311
|
+
|
|
312
|
+
Toggle load
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
import { useState } from 'react';
|
|
317
|
+
import {
|
|
318
|
+
IressButton,
|
|
319
|
+
IressPlaceholder,
|
|
320
|
+
IressSkeleton,
|
|
321
|
+
type IressSkeletonProps,
|
|
322
|
+
IressStack,
|
|
323
|
+
} from '@iress-oss/ids-components';
|
|
324
|
+
export const SkeletonCircle \= (<'circle'\>) \=> {
|
|
325
|
+
const \[loading, setLoading\] \= useState(true);
|
|
326
|
+
return (
|
|
327
|
+
<IressStack gap\="md"\>
|
|
328
|
+
<IressButton onClick\={() \=> setLoading(!loading)}\>
|
|
329
|
+
Toggle load </IressButton\>
|
|
330
|
+
{loading && <IressSkeleton {...{
|
|
331
|
+
mode: 'circle',
|
|
332
|
+
width: '150',
|
|
333
|
+
height: '150',
|
|
334
|
+
}} />}
|
|
335
|
+
{!loading && (
|
|
336
|
+
<IressPlaceholder {...{
|
|
337
|
+
mode: 'circle',
|
|
338
|
+
width: '150',
|
|
339
|
+
height: '150',
|
|
340
|
+
}} style\={{ borderRadius: '50%' }}\>
|
|
341
|
+
Image </IressPlaceholder\>
|
|
342
|
+
)}
|
|
343
|
+
</IressStack\>
|
|
344
|
+
);
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### Props
|
|
350
|
+
|
|
351
|
+
| Name | Description | Default | Control |
|
|
352
|
+
| --- | --- | --- | --- |
|
|
353
|
+
| height |
|
|
354
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
355
|
+
|
|
356
|
+
unknown
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
| \- |
|
|
361
|
+
|
|
362
|
+
"150"
|
|
363
|
+
|
|
364
|
+
|
|
|
365
|
+
| mode |
|
|
366
|
+
|
|
367
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
368
|
+
|
|
369
|
+
TMode
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
| \- |
|
|
374
|
+
|
|
375
|
+
"circle"
|
|
376
|
+
|
|
377
|
+
|
|
|
378
|
+
| textStyle |
|
|
379
|
+
|
|
380
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
381
|
+
|
|
382
|
+
IressCSSProps\['textStyle'\]
|
|
383
|
+
|
|
384
|
+
| \- | Set object |
|
|
385
|
+
| width |
|
|
386
|
+
|
|
387
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
388
|
+
|
|
389
|
+
string
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
| \- | 150 |
|
|
394
|
+
|
|
395
|
+
### Size
|
|
396
|
+
|
|
397
|
+
`width` and `height` props can be used to match the layout of the loaded content.
|
|
398
|
+
|
|
399
|
+
These props accept any unit of dimension, but if no unit is provided it will default to pixels.
|
|
400
|
+
|
|
401
|
+
**Note:** `height` will be ignored for text mode as this is calculated using the `IressText` component.
|
|
402
|
+
|
|
403
|
+
[](./iframe.html?id=components-skeleton--size)
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
<IressInline gap\="md"\>
|
|
408
|
+
<IressSkeleton
|
|
409
|
+
height\="150"
|
|
410
|
+
mode\="rect"
|
|
411
|
+
width\="150"
|
|
412
|
+
/>
|
|
413
|
+
<IressSkeleton
|
|
414
|
+
height\="150"
|
|
415
|
+
mode\="circle"
|
|
416
|
+
width\="150"
|
|
417
|
+
/>
|
|
418
|
+
<IressSkeleton
|
|
419
|
+
height\="150"
|
|
420
|
+
mode\="text"
|
|
421
|
+
width\="150"
|
|
422
|
+
/>
|
|
423
|
+
</IressInline\>
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
#### Props
|
|
428
|
+
|
|
429
|
+
| Name | Description | Default | Control |
|
|
430
|
+
| --- | --- | --- | --- |
|
|
431
|
+
| height |
|
|
432
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
433
|
+
|
|
434
|
+
unknown
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
| \- |
|
|
439
|
+
|
|
440
|
+
"150"
|
|
441
|
+
|
|
442
|
+
|
|
|
443
|
+
| mode |
|
|
444
|
+
|
|
445
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
446
|
+
|
|
447
|
+
TMode
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
| \- | \- |
|
|
452
|
+
| textStyle |
|
|
453
|
+
|
|
454
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
455
|
+
|
|
456
|
+
IressCSSProps\['textStyle'\]
|
|
457
|
+
|
|
458
|
+
| \- | Set object |
|
|
459
|
+
| width |
|
|
460
|
+
|
|
461
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
462
|
+
|
|
463
|
+
string
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
| \- | 150 |
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Recipes
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
`IressCard`
|
|
5
|
+
-----------
|
|
6
|
+
|
|
7
|
+
A common use case of the skeleton component is within a card component. Below are some examples of how you might use `IressSkeleton` within `IressCard`.
|
|
8
|
+
|
|
9
|
+
[](./iframe.html?id=components-skeleton-recipes--card)
|
|
10
|
+
|
|
11
|
+
Toggle load
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import {
|
|
17
|
+
IressButton,
|
|
18
|
+
IressCard,
|
|
19
|
+
IressSkeleton,
|
|
20
|
+
IressStack,
|
|
21
|
+
IressText,
|
|
22
|
+
} from '@iress-oss/ids-components';
|
|
23
|
+
const CARD\_LINE\_SIZES \= \['100%', '91%', '95%', '89%', '83%'\];
|
|
24
|
+
const CardLoading \= () \=> (
|
|
25
|
+
<IressCard
|
|
26
|
+
heading\={<IressSkeleton textStyle\="typography.heading.4" width\="75%" />}
|
|
27
|
+
media\={<IressSkeleton mode\="rect" height\="200" />}
|
|
28
|
+
stretch
|
|
29
|
+
\>
|
|
30
|
+
<IressStack gap\="md"\>
|
|
31
|
+
<IressStack gap\="xs"\>
|
|
32
|
+
{CARD\_LINE\_SIZES.map((size) \=> (
|
|
33
|
+
<IressSkeleton key\={\`${size}\-1\`} width\={size} />
|
|
34
|
+
))}
|
|
35
|
+
</IressStack\>
|
|
36
|
+
<IressStack gap\="xs"\>
|
|
37
|
+
{CARD\_LINE\_SIZES.map((size) \=> (
|
|
38
|
+
<IressSkeleton key\={\`${size}\-2\`} width\={size} />
|
|
39
|
+
))}
|
|
40
|
+
</IressStack\>
|
|
41
|
+
</IressStack\>
|
|
42
|
+
</IressCard\>
|
|
43
|
+
);
|
|
44
|
+
const CardItem \= () \=> (
|
|
45
|
+
<IressCard
|
|
46
|
+
heading\={<h4\>This is the card heading</h4\>}
|
|
47
|
+
media\={
|
|
48
|
+
<img
|
|
49
|
+
src\="https://www.iress.com/media/images/media-contact.width-600.png"
|
|
50
|
+
alt\=""
|
|
51
|
+
/>
|
|
52
|
+
}
|
|
53
|
+
\>
|
|
54
|
+
<IressText element\="p"\>
|
|
55
|
+
Non cupiditate, libero ex, voluptates ea ipsum deleniti sequi sed eveniet ab enim sunt itaque qui ullam, adipisci quo expedita laboriosam deserunt? </IressText\>
|
|
56
|
+
<IressText element\="p"\>
|
|
57
|
+
Impedit, quasi voluptas quae quibusdam officiis corporis. Distinctio et aspernatur quo atque non enim, recusandae at, eum dicta ullam commodi modi debitis. </IressText\>
|
|
58
|
+
</IressCard\>
|
|
59
|
+
);
|
|
60
|
+
export const SkeletonCard \= () \=> {
|
|
61
|
+
const \[loading, setLoading\] \= useState(true);
|
|
62
|
+
return (
|
|
63
|
+
<IressStack gap\="md"\>
|
|
64
|
+
<IressButton onClick\={() \=> setLoading(!loading)}\>
|
|
65
|
+
Toggle load </IressButton\>
|
|
66
|
+
{loading && <CardLoading />}
|
|
67
|
+
{!loading && <CardItem />}
|
|
68
|
+
</IressStack\>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Props
|
|
75
|
+
|
|
76
|
+
| Name | Description | Default | Control |
|
|
77
|
+
| --- | --- | --- | --- |
|
|
78
|
+
| height |
|
|
79
|
+
Sets the height of the skeleton bones. If no unit is specified it will default to pixels. Not allowed when in `text` mode.
|
|
80
|
+
|
|
81
|
+
unknown
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
| \- | Set object |
|
|
86
|
+
| mode |
|
|
87
|
+
|
|
88
|
+
Mode of the skeleton. `rect` and `circle` must have `width` and `height` specified. `text` works with `textStyle`.
|
|
89
|
+
|
|
90
|
+
TMode
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
| \- | Set object |
|
|
95
|
+
| textStyle |
|
|
96
|
+
|
|
97
|
+
Use `textStyle` to specify what the Skeleton should emulate. If set to `h1` a non-break space with the same font-size and line-height of a h1 will be rendered.
|
|
98
|
+
|
|
99
|
+
IressCSSProps\['textStyle'\]
|
|
100
|
+
|
|
101
|
+
| \- | Set object |
|
|
102
|
+
| width |
|
|
103
|
+
|
|
104
|
+
Sets the width of the skeleton bones. If no unit is specified it will default to pixels.
|
|
105
|
+
|
|
106
|
+
string
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
| \- | Set string |
|