@iress-oss/ids-components 6.0.0-beta.2 → 6.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/components/tag.md +43 -3
- package/.ai/skills/figma-to-ids.md +136 -61
- package/.ai/skills/ui-translation.md +98 -72
- package/README.md +16 -1
- package/dist/{Autocomplete-JZcorz66.js → Autocomplete-CuUjmIAw.js} +66 -63
- package/dist/Shadow-DdGxqWgh.js +56 -0
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/Icon/helpers/getMaterialSymbolsList.js +1 -1
- package/dist/components/Menu/Menu.js +4 -7
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/components/SelectOptions.js +2 -2
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Slider/components/SliderTicks.js +2 -2
- package/dist/components/Tag/Tag.d.ts +15 -23
- package/dist/components/Tag/Tag.js +28 -31
- package/dist/components/Tag/Tag.styles.d.ts +8 -9
- package/dist/components/Tag/Tag.styles.js +26 -14
- package/dist/index.d-BJM5_ZcV.js +4 -0
- package/dist/main.js +3 -3
- package/dist/patterns/ContextualMenu/ContextualMenu.d.ts +1 -1
- package/dist/patterns/ContextualMenu/ContextualMenu.js +22 -21
- package/dist/patterns/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useAutocompleteSearch-Dl1-OeQy.js → useAutocompleteSearch-BJ_hhoKp.js} +3 -3
- package/package.json +10 -10
- package/dist/Shadow-BGGBsmrn.js +0 -56
- package/dist/index.d-Dsa3mJDa.js +0 -4
|
@@ -31,10 +31,10 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
31
31
|
| Select dropdown (static or async) | `IressField` + `IressSelect` | `<IressField label="Country"><IressSelect>...</IressSelect></IressField>` — supports static options and async loading via an `options` function |
|
|
32
32
|
| Freetext input with suggestions | `IressField` + `IressAutocomplete` | `<IressField label="Search"><IressAutocomplete /></IressField>` — allows any text input; suggestions are optional |
|
|
33
33
|
| Currency input | `IressField` + `IressInputCurrency` | `<IressField label="Amount"><IressInputCurrency /></IressField>` |
|
|
34
|
-
| Checkbox | `IressCheckbox` | `<IressCheckbox
|
|
35
|
-
| Checkbox group | `IressCheckboxGroup` | `<
|
|
36
|
-
| Radio buttons | `IressRadioGroup` + `IressRadio` | `<
|
|
37
|
-
| Toggle switch | `IressToggle` | `<IressToggle
|
|
34
|
+
| Checkbox | `IressCheckbox` | `<IressCheckbox value="agree">I agree</IressCheckbox>` |
|
|
35
|
+
| Checkbox group | `IressCheckboxGroup` | `<IressField label="Options"><IressCheckboxGroup name="opts"><IressCheckbox value="a">A</IressCheckbox><IressCheckbox value="b">B</IressCheckbox></IressCheckboxGroup></IressField>` |
|
|
36
|
+
| Radio buttons | `IressRadioGroup` + `IressRadio` | `<IressField label="Choice"><IressRadioGroup><IressRadio value="yes">Yes</IressRadio><IressRadio value="no">No</IressRadio></IressRadioGroup></IressField>` |
|
|
37
|
+
| Toggle switch | `IressToggle` | `<IressToggle>Enable</IressToggle>` |
|
|
38
38
|
| Slider / range | `IressSlider` | `<IressSlider min={0} max={100} />` |
|
|
39
39
|
| Read-only display | `IressReadonly` | `<IressReadonly label="Status" value="Active" />` — supports `actions` prop for inline action buttons (e.g. edit toggle). Use `variant="locked"` when the value is read-only due to permissions |
|
|
40
40
|
|
|
@@ -47,8 +47,8 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
47
47
|
|
|
48
48
|
| Description | IDS Component | Example |
|
|
49
49
|
| -------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------- |
|
|
50
|
-
| Vertical stack (items stacked top-to-bottom) | `IressStack` | `<IressStack gap="
|
|
51
|
-
| Horizontal row (items side-by-side) | `IressInline` | `<IressInline gap="
|
|
50
|
+
| Vertical stack (items stacked top-to-bottom) | `IressStack` | `<IressStack gap="md">...</IressStack>` |
|
|
51
|
+
| Horizontal row (items side-by-side) | `IressInline` | `<IressInline gap="sm">...</IressInline>` |
|
|
52
52
|
| Grid columns | `IressRow` + `IressCol` | `<IressRow><IressCol span={{ xs: 12, md: 6 }}>...</IressCol><IressCol span={{ xs: 12, md: 6 }}>...</IressCol></IressRow>` |
|
|
53
53
|
| Container with max-width | `IressContainer` | `<IressContainer>...</IressContainer>` |
|
|
54
54
|
| Divider / separator | `IressDivider` | `<IressDivider />` |
|
|
@@ -60,14 +60,14 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
60
60
|
| -------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
61
61
|
| Text / paragraph | `IressText` | `<IressText>Body text</IressText>` |
|
|
62
62
|
| Heading | `IressText element="h2"` | `<IressText element="h2">Heading</IressText>` |
|
|
63
|
-
| Card / panel | `IressCard` or `IressPanel` | `<IressCard
|
|
63
|
+
| Card / panel | `IressCard` or `IressPanel` | `<IressCard heading={<h3>Title</h3>}>Content</IressCard>` |
|
|
64
64
|
| Alert / notification | `IressAlert` | `<IressAlert status="success">Saved!</IressAlert>` |
|
|
65
65
|
| Loading spinner | `IressSpinner` | `<IressSpinner />` |
|
|
66
66
|
| Skeleton loader | `IressSkeleton` | `<IressSkeleton height="20px" width="200px" />` |
|
|
67
67
|
| Progress bar | `IressProgress` | `<IressProgress value={75} max={100} />` |
|
|
68
68
|
| Image | `IressImage` | `<IressImage src="..." alt="..." />` |
|
|
69
69
|
| Icon | `IressIcon` | `<IressIcon name="settings" />` |
|
|
70
|
-
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`
|
|
70
|
+
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`; use `bordered` for visible-border style; use `element="button"` for clickable tag, `element="a"` for link tag; `onClick` alone also auto-renders as `<button>` |
|
|
71
71
|
| Pill | `IressPill` | `<IressPill>Category</IressPill>` |
|
|
72
72
|
| Tooltip | `IressTooltip` | `<IressTooltip content="Help text"><IressButton>Hover me</IressButton></IressTooltip>` |
|
|
73
73
|
|
|
@@ -89,11 +89,11 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
89
89
|
|
|
90
90
|
| Description | IDS Component | Example |
|
|
91
91
|
| ----------- | ------------- | ------------------------------------------------------------------------------------------------------- |
|
|
92
|
-
| Data table | `IressTable` | `<IressTable
|
|
92
|
+
| Data table | `IressTable` | `<IressTable caption="Users" rows={users} columns={columns} />` — data-driven via `rows` and `columns` props |
|
|
93
93
|
3. **Verify component capabilities** — Before recommending a component, read its `.ai/components/<name>.md` doc (in `node_modules/@iress-oss/ids-components/.ai/components/`) to verify it supports the required features (async, filtering, validation, etc.)
|
|
94
|
-
4. **Apply layout** — Wrap elements in `IressStack` (vertical), `IressInline` (horizontal), or `IressRow`/`IressCol` (grid). Always make grids responsive with `span={{ xs: 12, md: ... }}`
|
|
94
|
+
4. **Apply layout** — Wrap elements in `IressStack` (vertical), `IressInline` (horizontal), or `IressRow`/`IressCol` (grid) only when needed. Check whether the parent component already provides layout (e.g. card footer, modal actions, button group) before adding wrappers. Never wrap a single child in a layout component. Always make grids responsive with `span={{ xs: 12, md: ... }}`
|
|
95
95
|
5. **Add responsive behaviour** — Even if the description only mentions desktop, stack columns on mobile and relocate secondary content to `IressSlideout` or collapsible sections
|
|
96
|
-
6. **Apply styling** — Use styling props for spacing, colour, and typography.
|
|
96
|
+
6. **Apply styling** — Use styling props for spacing, colour, and typography. Spacing tokens must include the category prefix: `gap="spacing.4"`, `p="spacing.6"`. Alias tokens (`"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`) are also valid. Never use bare numbers like `gap="4"`.
|
|
97
97
|
|
|
98
98
|
# Styling Props (IressCSSProps)
|
|
99
99
|
|
|
@@ -190,10 +190,10 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
190
190
|
| Select dropdown (static or async) | `IressField` + `IressSelect` | `<IressField label="Country"><IressSelect>...</IressSelect></IressField>` — supports static options and async loading via an `options` function |
|
|
191
191
|
| Freetext input with suggestions | `IressField` + `IressAutocomplete` | `<IressField label="Search"><IressAutocomplete /></IressField>` — allows any text input; suggestions are optional |
|
|
192
192
|
| Currency input | `IressField` + `IressInputCurrency` | `<IressField label="Amount"><IressInputCurrency /></IressField>` |
|
|
193
|
-
| Checkbox | `IressCheckbox` | `<IressCheckbox
|
|
194
|
-
| Checkbox group | `IressCheckboxGroup` | `<
|
|
195
|
-
| Radio buttons | `IressRadioGroup` + `IressRadio` | `<
|
|
196
|
-
| Toggle switch | `IressToggle` | `<IressToggle
|
|
193
|
+
| Checkbox | `IressCheckbox` | `<IressCheckbox value="agree">I agree</IressCheckbox>` |
|
|
194
|
+
| Checkbox group | `IressCheckboxGroup` | `<IressField label="Options"><IressCheckboxGroup name="opts"><IressCheckbox value="a">A</IressCheckbox><IressCheckbox value="b">B</IressCheckbox></IressCheckboxGroup></IressField>` |
|
|
195
|
+
| Radio buttons | `IressRadioGroup` + `IressRadio` | `<IressField label="Choice"><IressRadioGroup><IressRadio value="yes">Yes</IressRadio><IressRadio value="no">No</IressRadio></IressRadioGroup></IressField>` |
|
|
196
|
+
| Toggle switch | `IressToggle` | `<IressToggle>Enable</IressToggle>` |
|
|
197
197
|
| Slider / range | `IressSlider` | `<IressSlider min={0} max={100} />` |
|
|
198
198
|
| Read-only display | `IressReadonly` | `<IressReadonly label="Status" value="Active" />` — supports `actions` prop for inline action buttons (e.g. edit toggle). Use `variant="locked"` when the value is read-only due to permissions |
|
|
199
199
|
|
|
@@ -206,8 +206,8 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
206
206
|
|
|
207
207
|
| Description | IDS Component | Example |
|
|
208
208
|
| -------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------- |
|
|
209
|
-
| Vertical stack (items stacked top-to-bottom) | `IressStack` | `<IressStack gap="
|
|
210
|
-
| Horizontal row (items side-by-side) | `IressInline` | `<IressInline gap="
|
|
209
|
+
| Vertical stack (items stacked top-to-bottom) | `IressStack` | `<IressStack gap="md">...</IressStack>` |
|
|
210
|
+
| Horizontal row (items side-by-side) | `IressInline` | `<IressInline gap="sm">...</IressInline>` |
|
|
211
211
|
| Grid columns | `IressRow` + `IressCol` | `<IressRow><IressCol span={{ xs: 12, md: 6 }}>...</IressCol><IressCol span={{ xs: 12, md: 6 }}>...</IressCol></IressRow>` |
|
|
212
212
|
| Container with max-width | `IressContainer` | `<IressContainer>...</IressContainer>` |
|
|
213
213
|
| Divider / separator | `IressDivider` | `<IressDivider />` |
|
|
@@ -219,14 +219,14 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
219
219
|
| -------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
220
220
|
| Text / paragraph | `IressText` | `<IressText>Body text</IressText>` |
|
|
221
221
|
| Heading | `IressText element="h2"` | `<IressText element="h2">Heading</IressText>` |
|
|
222
|
-
| Card / panel | `IressCard` or `IressPanel` | `<IressCard
|
|
222
|
+
| Card / panel | `IressCard` or `IressPanel` | `<IressCard heading={<h3>Title</h3>}>Content</IressCard>` |
|
|
223
223
|
| Alert / notification | `IressAlert` | `<IressAlert status="success">Saved!</IressAlert>` |
|
|
224
224
|
| Loading spinner | `IressSpinner` | `<IressSpinner />` |
|
|
225
225
|
| Skeleton loader | `IressSkeleton` | `<IressSkeleton height="20px" width="200px" />` |
|
|
226
226
|
| Progress bar | `IressProgress` | `<IressProgress value={75} max={100} />` |
|
|
227
227
|
| Image | `IressImage` | `<IressImage src="..." alt="..." />` |
|
|
228
228
|
| Icon | `IressIcon` | `<IressIcon name="settings" />` |
|
|
229
|
-
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`
|
|
229
|
+
| Tag / badge | `IressTag` | `<IressTag>New</IressTag>`; use `bordered` for visible-border style; use `element="button"` for clickable tag, `element="a"` for link tag; `onClick` alone also auto-renders as `<button>` |
|
|
230
230
|
| Pill | `IressPill` | `<IressPill>Category</IressPill>` |
|
|
231
231
|
| Tooltip | `IressTooltip` | `<IressTooltip content="Help text"><IressButton>Hover me</IressButton></IressTooltip>` |
|
|
232
232
|
|
|
@@ -248,7 +248,7 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
248
248
|
|
|
249
249
|
| Description | IDS Component | Example |
|
|
250
250
|
| ----------- | ------------- | ------------------------------------------------------------------------------------------------------- |
|
|
251
|
-
| Data table | `IressTable` | `<IressTable
|
|
251
|
+
| Data table | `IressTable` | `<IressTable caption="Users" rows={users} columns={columns} />` — data-driven via `rows` and `columns` props |
|
|
252
252
|
|
|
253
253
|
## Styling Props
|
|
254
254
|
|
|
@@ -355,7 +355,7 @@ import {
|
|
|
355
355
|
|
|
356
356
|
function LoginForm() {
|
|
357
357
|
return (
|
|
358
|
-
<IressStack gap="
|
|
358
|
+
<IressStack gap="md">
|
|
359
359
|
<IressField label="Email" htmlFor="email" required>
|
|
360
360
|
<IressInput id="email" type="email" placeholder="Enter your email" />
|
|
361
361
|
</IressField>
|
|
@@ -377,30 +377,20 @@ function LoginForm() {
|
|
|
377
377
|
### "A card with a title, description, and two action buttons"
|
|
378
378
|
|
|
379
379
|
```tsx
|
|
380
|
-
import {
|
|
381
|
-
IressCard,
|
|
382
|
-
IressButton,
|
|
383
|
-
IressInline,
|
|
384
|
-
IressText,
|
|
385
|
-
} from '@iress-oss/ids-components';
|
|
380
|
+
import { IressCard, IressButton, IressInline } from '@iress-oss/ids-components';
|
|
386
381
|
|
|
387
382
|
function ActionCard() {
|
|
388
383
|
return (
|
|
389
|
-
<IressCard
|
|
390
|
-
<
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
<IressCard.Body>
|
|
394
|
-
<IressText>
|
|
395
|
-
This is the card description with supporting details.
|
|
396
|
-
</IressText>
|
|
397
|
-
</IressCard.Body>
|
|
398
|
-
<IressCard.Footer>
|
|
399
|
-
<IressInline gap="2">
|
|
384
|
+
<IressCard
|
|
385
|
+
heading={<h3>Card Title</h3>}
|
|
386
|
+
footer={
|
|
387
|
+
<IressInline gap="sm">
|
|
400
388
|
<IressButton mode="primary">Confirm</IressButton>
|
|
401
389
|
<IressButton mode="secondary">Cancel</IressButton>
|
|
402
390
|
</IressInline>
|
|
403
|
-
|
|
391
|
+
}
|
|
392
|
+
>
|
|
393
|
+
This is the card description with supporting details.
|
|
404
394
|
</IressCard>
|
|
405
395
|
);
|
|
406
396
|
}
|
|
@@ -417,19 +407,22 @@ import {
|
|
|
417
407
|
IressButton,
|
|
418
408
|
IressText,
|
|
419
409
|
IressDivider,
|
|
410
|
+
IressField,
|
|
420
411
|
} from '@iress-oss/ids-components';
|
|
421
412
|
|
|
422
413
|
function SettingsPage() {
|
|
423
414
|
return (
|
|
424
|
-
<IressStack gap="
|
|
415
|
+
<IressStack gap="lg">
|
|
425
416
|
<IressText element="h2">Settings</IressText>
|
|
426
|
-
<IressToggle
|
|
417
|
+
<IressToggle>Enable notifications</IressToggle>
|
|
427
418
|
<IressDivider />
|
|
428
|
-
<
|
|
429
|
-
<
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
419
|
+
<IressField label="Notification types">
|
|
420
|
+
<IressCheckboxGroup name="notification-types">
|
|
421
|
+
<IressCheckbox value="email">Email</IressCheckbox>
|
|
422
|
+
<IressCheckbox value="sms">SMS</IressCheckbox>
|
|
423
|
+
<IressCheckbox value="push">Push</IressCheckbox>
|
|
424
|
+
</IressCheckboxGroup>
|
|
425
|
+
</IressField>
|
|
433
426
|
<IressDivider />
|
|
434
427
|
<IressButton mode="primary">Save settings</IressButton>
|
|
435
428
|
</IressStack>
|
|
@@ -442,8 +435,8 @@ function SettingsPage() {
|
|
|
442
435
|
Note: even though the description doesn't mention mobile, the sidebar is secondary content — on mobile it should move into a slideout so the main content gets focus.
|
|
443
436
|
|
|
444
437
|
```tsx
|
|
438
|
+
import { useState } from 'react';
|
|
445
439
|
import {
|
|
446
|
-
useState,
|
|
447
440
|
IressRow,
|
|
448
441
|
IressCol,
|
|
449
442
|
IressStack,
|
|
@@ -460,18 +453,13 @@ function Dashboard() {
|
|
|
460
453
|
const [navOpen, setNavOpen] = useState(false);
|
|
461
454
|
|
|
462
455
|
const nav = (
|
|
463
|
-
<IressCard>
|
|
464
|
-
|
|
465
|
-
<IressStack gap="2">
|
|
466
|
-
<IressText weight="strong">Navigation</IressText>
|
|
467
|
-
<IressText>Menu items here</IressText>
|
|
468
|
-
</IressStack>
|
|
469
|
-
</IressCard.Body>
|
|
456
|
+
<IressCard heading={<h3>Navigation</h3>}>
|
|
457
|
+
Menu items here
|
|
470
458
|
</IressCard>
|
|
471
459
|
);
|
|
472
460
|
|
|
473
461
|
return isMobile ? (
|
|
474
|
-
<IressStack gap="
|
|
462
|
+
<IressStack gap="md">
|
|
475
463
|
<IressButton
|
|
476
464
|
mode="secondary"
|
|
477
465
|
icon="menu"
|
|
@@ -480,9 +468,7 @@ function Dashboard() {
|
|
|
480
468
|
Menu
|
|
481
469
|
</IressButton>
|
|
482
470
|
<IressCard>
|
|
483
|
-
<
|
|
484
|
-
<IressText element="h2">Main Content</IressText>
|
|
485
|
-
</IressCard.Body>
|
|
471
|
+
<IressText element="h2">Main Content</IressText>
|
|
486
472
|
</IressCard>
|
|
487
473
|
<IressSlideout
|
|
488
474
|
heading="Navigation"
|
|
@@ -497,9 +483,7 @@ function Dashboard() {
|
|
|
497
483
|
<IressCol span={3}>{nav}</IressCol>
|
|
498
484
|
<IressCol span={9}>
|
|
499
485
|
<IressCard>
|
|
500
|
-
<
|
|
501
|
-
<IressText element="h2">Main Content</IressText>
|
|
502
|
-
</IressCard.Body>
|
|
486
|
+
<IressText element="h2">Main Content</IressText>
|
|
503
487
|
</IressCard>
|
|
504
488
|
</IressCol>
|
|
505
489
|
</IressRow>
|
|
@@ -509,18 +493,60 @@ function Dashboard() {
|
|
|
509
493
|
|
|
510
494
|
## Best Practices
|
|
511
495
|
|
|
512
|
-
1. **
|
|
513
|
-
2. **
|
|
514
|
-
3. **Use
|
|
515
|
-
4. **Use
|
|
516
|
-
5. **Use
|
|
517
|
-
6. **
|
|
518
|
-
7. **
|
|
519
|
-
8. **
|
|
520
|
-
9. **
|
|
521
|
-
10. **
|
|
522
|
-
11. **
|
|
496
|
+
1. **Minimise component nesting** — Use the fewest components possible to achieve the layout. Every wrapper component should earn its place. Before adding `IressInline` or `IressStack`, check whether the parent component already handles the layout (e.g. `IressCard` has `heading` and `footer` props; `IressModal` has `actions`; `IressButtonGroup` handles horizontal button layout). See the "Unnecessary layout wrappers" section in Common Mistakes below.
|
|
497
|
+
2. **Always wrap in IressProvider** — Required at the root of your app for fonts and CSS variables. `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, and `IressIconProvider` — do not add these separately. If using `IressShadow`, no additional providers are needed as it includes `IressProvider` internally.
|
|
498
|
+
3. **Use IressField for all form inputs** — Provides consistent labels, hints, and validation display
|
|
499
|
+
4. **Use IressStack/IressInline only when needed** — Prefer these over custom CSS flex/grid, but don't add them when the parent already provides spacing or layout
|
|
500
|
+
5. **Use correct spacing token format** — Always prefix with the token category: `gap="spacing.4"`, `p="spacing.6"`. Alias tokens (`"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`) are also valid. Never use bare numbers like `gap="4"`.
|
|
501
|
+
6. **Use semantic button modes** — One `primary` per section, `secondary` for most actions
|
|
502
|
+
7. **Always include labels** — All form inputs need accessible labels via `IressField`
|
|
503
|
+
8. **Use status for feedback** — `IressAlert` for inline messages, `IressModal status="danger"` for confirmation dialogs, `status` prop on buttons for danger/success
|
|
504
|
+
9. **Prefer IDS components** — Use `IressText` instead of raw `<p>`, `IressButton` instead of `<button>`
|
|
505
|
+
10. **Native elements inside `IressText` are OK** — When rendering CMS content, markdown output, or other unstructured data sources, it is acceptable to nest native HTML elements (e.g. `<p>`, `<strong>`, `<a>`, `<ul>`) inside `IressText`. This lets `IressText` provide consistent typography while allowing flexible inner content structure.
|
|
506
|
+
11. **Always make grid layouts responsive** — When using `IressRow`/`IressCol`, use responsive `span` values (e.g. `span={{ xs: 12, md: 6 }}`) so columns stack on mobile instead of overflowing
|
|
507
|
+
12. **Check the component docs** — Read the specific component doc for detailed props and patterns (`node_modules/@iress-oss/ids-components/.ai/components/`)
|
|
523
508
|
|
|
524
509
|
## Common Mistakes
|
|
525
510
|
|
|
511
|
+
### Unnecessary layout wrappers
|
|
512
|
+
|
|
513
|
+
The most common mistake is wrapping children in `IressInline` or `IressStack` when it adds no value. Every wrapper must serve a purpose — if removing it produces the same result, remove it.
|
|
514
|
+
|
|
515
|
+
```tsx
|
|
516
|
+
// ❌ Unnecessary nesting — IressStack wrapping a single child
|
|
517
|
+
<IressStack gap="md">
|
|
518
|
+
<IressInline gap="sm">
|
|
519
|
+
<IressButton mode="primary">Save</IressButton>
|
|
520
|
+
<IressButton mode="secondary">Cancel</IressButton>
|
|
521
|
+
</IressInline>
|
|
522
|
+
</IressStack>
|
|
523
|
+
|
|
524
|
+
// ✅ Single group of buttons only needs IressInline
|
|
525
|
+
<IressInline gap="sm">
|
|
526
|
+
<IressButton mode="primary">Save</IressButton>
|
|
527
|
+
<IressButton mode="secondary">Cancel</IressButton>
|
|
528
|
+
</IressInline>
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
```tsx
|
|
532
|
+
// ❌ Wrapping content that's already a single block
|
|
533
|
+
<IressStack gap="md">
|
|
534
|
+
<IressText element="h2">Title</IressText>
|
|
535
|
+
</IressStack>
|
|
536
|
+
|
|
537
|
+
// ✅ No wrapper needed for a single element
|
|
538
|
+
<IressText element="h2">Title</IressText>
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
**When to use layout wrappers:**
|
|
542
|
+
- `IressStack` — when you have 2+ block-level siblings that need vertical spacing between them
|
|
543
|
+
- `IressInline` — when you have 2+ elements that need to sit side-by-side (e.g. buttons in a card `footer`, action bars)
|
|
544
|
+
|
|
545
|
+
**When NOT to use them:**
|
|
546
|
+
- The parent component already handles layout (modal `actions` prop, button group)
|
|
547
|
+
- There's only one child — a wrapper around a single child adds nothing
|
|
548
|
+
- You're nesting `IressInline` inside `IressInline` or `IressStack` inside `IressStack` without changing gap/alignment — flatten instead
|
|
549
|
+
|
|
550
|
+
### Other common anti-patterns
|
|
551
|
+
|
|
526
552
|
For the full list of common anti-patterns (disabled buttons, redundant textStyle, legacy slot attributes, raw HTML, hardcoded values), read the Common Mistakes guide at `node_modules/@iress-oss/ids-components/.ai/guides/foundations-common-mistakes.md` (requires `@iress-oss/ids-components` to be installed).
|
package/README.md
CHANGED
|
@@ -10,11 +10,26 @@ This is the component library for the Iress Design System (IDS). You can use thi
|
|
|
10
10
|
|
|
11
11
|
## Set up the component library
|
|
12
12
|
|
|
13
|
-
1. Install using: `yarn add @iress-oss/ids-components`
|
|
13
|
+
1. Install using: `yarn add @iress-oss/ids-components@beta`
|
|
14
14
|
2. Import the styles: `import '@iress-oss/ids-components/dist/style.css'`
|
|
15
15
|
3. Import the components: `import { IressButton, IressText } from '@iress-oss/ids-components'`
|
|
16
16
|
4. Use the components: `<IressButton>Click me</IressButton>`
|
|
17
17
|
|
|
18
|
+
> **Note:** IDS v6 is currently in beta — install with the `@beta` tag as shown above.
|
|
19
|
+
>
|
|
20
|
+
> If you need to use design tokens directly in your application code (for custom CSS or inline styles), also install the tokens package:
|
|
21
|
+
>
|
|
22
|
+
> ```bash
|
|
23
|
+
> yarn add @iress-oss/ids-tokens@beta
|
|
24
|
+
> ```
|
|
25
|
+
>
|
|
26
|
+
> Then import the CSS variables stylesheet and use `cssVars` in your code:
|
|
27
|
+
>
|
|
28
|
+
> ```ts
|
|
29
|
+
> import '@iress-oss/ids-tokens/build/css-vars.css';
|
|
30
|
+
> import { cssVars } from '@iress-oss/ids-tokens';
|
|
31
|
+
> ```
|
|
32
|
+
|
|
18
33
|
## Contributing
|
|
19
34
|
|
|
20
35
|
The component library is part of the Iress Design System (IDS) monorepo. Please refer to the root [README](../../README.md) for more information on contributing to IDS.
|