@iress-oss/ids-components 6.0.0-beta.7 → 6.0.0-beta.8
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/avatar.md +178 -0
- package/.ai/components/input.md +1 -3
- package/.ai/index.json +9 -0
- package/.ai/skills/figma-to-ids.md +13 -2
- package/.ai/skills/ui-translation.md +4 -0
- package/dist/Shadow-Duhyx42v.js +57 -0
- package/dist/{Slideout-BHpB44El.js → Slideout-RnRSkJsj.js} +1 -1
- package/dist/{TableRows-4ZL_EFGz.js → TableRows-B3nZnazw.js} +1 -1
- package/dist/components/Alert/Alert.styles.d.ts +1 -1
- package/dist/components/Alert/Alert.styles.js +1 -1
- package/dist/components/Avatar/Avatar.d.ts +52 -0
- package/dist/components/Avatar/Avatar.js +55 -0
- package/dist/components/Avatar/Avatar.styles.d.ts +182 -0
- package/dist/components/Avatar/Avatar.styles.js +185 -0
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.d.ts +25 -0
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.js +28 -0
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.styles.d.ts +1 -0
- package/dist/components/Avatar/AvatarGroup/AvatarGroup.styles.js +30 -0
- package/dist/components/Avatar/index.d.ts +4 -0
- package/dist/components/Avatar/index.js +5 -0
- package/dist/components/Avatar/meta/Thumbnail.d.ts +2 -0
- package/dist/components/Avatar/meta/index.d.ts +7 -0
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/Icon/helpers/getMaterialSymbolsList.js +1 -1
- package/dist/components/Input/Input.styles.js +3 -3
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuItem/MenuItem.js +1 -1
- package/dist/components/Menu/MenuItem/MenuItem.styles.d.ts +10 -2
- package/dist/components/Menu/MenuItem/MenuItem.styles.js +9 -3
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.styles.js +1 -1
- package/dist/components/Popover/components/PopoverContent.js +1 -1
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +1 -1
- package/dist/components/Popover/hooks/useFloatingPopover.js +1 -1
- package/dist/components/Popover/hooks/usePopoverItem.js +1 -1
- package/dist/components/Popover/hooks/usePopoverNavigation.js +1 -1
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Radio/Radio.styles.js +1 -1
- package/dist/components/Readonly/Readonly.styles.js +3 -3
- package/dist/components/Select/SelectSearchInput/SelectSearchInput.styles.js +1 -1
- package/dist/components/Select/components/NativeSelect.styles.js +1 -1
- package/dist/components/Slideout/Slideout.js +1 -1
- package/dist/components/Slideout/hooks/usePushElement.js +1 -1
- package/dist/components/Slideout/index.js +1 -1
- package/dist/components/TabSet/Tab/Tab.js +1 -1
- package/dist/components/TabSet/Tab/Tab.styles.d.ts +2 -2
- package/dist/components/TabSet/Tab/Tab.styles.js +2 -2
- package/dist/components/TabSet/TabSet.js +1 -1
- package/dist/components/TabSet/TabSet.styles.js +2 -2
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/TableBody/TableBody.js +1 -1
- package/dist/components/Table/components/TableFilterButton.js +1 -1
- package/dist/components/Table/components/TableHeader.js +1 -1
- package/dist/components/Table/components/TableHeaderCell.js +1 -1
- package/dist/components/Table/components/TableRows.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Toaster/Toaster.js +1 -1
- package/dist/components/Toaster/components/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/enums.d.ts +2 -0
- package/dist/enums.js +1 -1
- package/dist/{floating-ui.react-JvHZyrqX.js → floating-ui.react-COiJC198.js} +1 -1
- package/dist/helpers/label-value/highlightQueryInLabel.js +1 -1
- package/dist/helpers/label-value/highlightQueryInLabelValue.js +1 -1
- package/dist/helpers/label-value/searchLabelValues.js +1 -1
- package/dist/{highlightQueryInLabel-M67urShz.js → highlightQueryInLabel-BLIy9JHT.js} +1 -1
- package/dist/index.d-CLYyYDIv.js +4 -0
- package/dist/{index.esm-DpGBtqhX.js → index.esm-CmxdHJYy.js} +45 -38
- package/dist/{main-CraNcMPy.js → main-BpD96KHv.js} +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +90 -86
- package/dist/patterns/Breadcrumbs/Breadcrumbs.styles.js +1 -1
- package/dist/patterns/ContextualMenu/ContextualMenu.styles.js +1 -1
- package/dist/patterns/DropdownMenu/DropdownMenu.styles.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/{tokens-DuvqF4DC.js → tokens-CG_Rn1W3.js} +2 -2
- package/llms.txt +1 -0
- package/package.json +17 -17
- package/dist/Shadow-BpeuxUhT.js +0 -57
- package/dist/index.d-DRtQ1Pfc.js +0 -4
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
Avatars display user identity in a circular frame, with optional badge and type indicators.
|
|
4
|
+
|
|
5
|
+
> **Component:** `import { IressAvatar } from '@iress-oss/ids-components'`
|
|
6
|
+
> **Storybook:** [Avatar in Storybook](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/docs/components_components-avatar--docs)
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { IressAvatar } from '@iress-oss/ids-components';
|
|
12
|
+
|
|
13
|
+
<IressAvatar>
|
|
14
|
+
BC
|
|
15
|
+
</IressAvatar>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
Use avatars to **represent users or entities** in your interface:
|
|
21
|
+
|
|
22
|
+
- Displaying user profile identity (initials, icons, or images)
|
|
23
|
+
- Showing assignment or ownership of items
|
|
24
|
+
- Indicating shared/joint entities with the `type` icon
|
|
25
|
+
- Stacking multiple users with `AvatarGroup`
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
### Badge
|
|
30
|
+
|
|
31
|
+
Pass a `badge` object with an `icon` name and optional `mode` colour to show an indicator at the top-right.
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<IressAvatar>
|
|
35
|
+
BC
|
|
36
|
+
</IressAvatar>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[View "WithBadge" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-avatar--with-badge)
|
|
40
|
+
|
|
41
|
+
### Badge with colour
|
|
42
|
+
|
|
43
|
+
The badge `mode` accepts any value from the data palette (10-90) or system status spectrum (`danger`, `info`, `success`, `warning`).
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<IressAvatar>
|
|
47
|
+
BC
|
|
48
|
+
</IressAvatar>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
[View "WithBadgeColor" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-avatar--with-badge-color)
|
|
52
|
+
|
|
53
|
+
### Type
|
|
54
|
+
|
|
55
|
+
Pass a `type` object with an `icon` name to display a secondary circle at the bottom-right, useful for indicating shared entities or roles.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<IressAvatar>
|
|
59
|
+
J&C
|
|
60
|
+
</IressAvatar>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
[View "WithType" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-avatar--with-type)
|
|
64
|
+
|
|
65
|
+
### Mode
|
|
66
|
+
|
|
67
|
+
The `mode` prop controls the avatar's background and text colour using the data palette (10-90) or system status colours.
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<IressInline gap="xs">
|
|
71
|
+
<IressAvatar mode={10}>
|
|
72
|
+
10
|
|
73
|
+
</IressAvatar>
|
|
74
|
+
<IressAvatar mode={20}>
|
|
75
|
+
20
|
|
76
|
+
</IressAvatar>
|
|
77
|
+
<IressAvatar mode={30}>
|
|
78
|
+
30
|
|
79
|
+
</IressAvatar>
|
|
80
|
+
<IressAvatar mode={40}>
|
|
81
|
+
40
|
|
82
|
+
</IressAvatar>
|
|
83
|
+
<IressAvatar mode={50}>
|
|
84
|
+
<IressIcon name="star" filled aria-label="I am a star" />
|
|
85
|
+
</IressAvatar>
|
|
86
|
+
</IressInline>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
[View "Mode" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-avatar--mode)
|
|
90
|
+
|
|
91
|
+
### Compact
|
|
92
|
+
|
|
93
|
+
Set `compact={true}` for a smaller avatar with a white stroke border, designed for stacking.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<IressAvatar compact>
|
|
97
|
+
MT
|
|
98
|
+
</IressAvatar>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
[View "Compact" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-avatar--compact)
|
|
102
|
+
|
|
103
|
+
## Avatar Group
|
|
104
|
+
|
|
105
|
+
Use `IressAvatarGroup` to stack multiple avatars with proper overlap and z-ordering. The first avatar appears in the foreground.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<IressAvatarGroup compact>
|
|
109
|
+
<IressAvatar mode={30}>MT</IressAvatar>
|
|
110
|
+
<IressAvatar mode={20}>HM</IressAvatar>
|
|
111
|
+
<IressAvatar mode={50}>TL</IressAvatar>
|
|
112
|
+
</IressAvatarGroup>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
[View "Compact" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-group--compact)
|
|
116
|
+
|
|
117
|
+
### Max avatars
|
|
118
|
+
|
|
119
|
+
Set `max` to limit visible avatars. An overflow indicator shows the remaining count.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<IressAvatarGroup compact max={3}>
|
|
123
|
+
<IressAvatar mode={30}>MT</IressAvatar>
|
|
124
|
+
<IressAvatar mode={20}>HM</IressAvatar>
|
|
125
|
+
<IressAvatar mode={50}>TL</IressAvatar>
|
|
126
|
+
<IressAvatar mode={10}>JD</IressAvatar>
|
|
127
|
+
<IressAvatar mode={40}>AB</IressAvatar>
|
|
128
|
+
</IressAvatarGroup>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
[View "MaxAvatars" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-group--max-avatars)
|
|
132
|
+
|
|
133
|
+
### Custom overflow label
|
|
134
|
+
|
|
135
|
+
Pass a render prop to `overflowLabel` for full control over the overflow indicator.
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<IressAvatarGroup
|
|
139
|
+
compact
|
|
140
|
+
max={2}
|
|
141
|
+
overflowLabel={(count) => `+${count} awesome users`}
|
|
142
|
+
>
|
|
143
|
+
<IressAvatar mode={30}>MT</IressAvatar>
|
|
144
|
+
<IressAvatar mode={20}>HM</IressAvatar>
|
|
145
|
+
<IressAvatar mode={50}>TL</IressAvatar>
|
|
146
|
+
<IressAvatar mode={10}>JD</IressAvatar>
|
|
147
|
+
</IressAvatarGroup>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
[View "CustomOverflowLabel" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-group--custom-overflow-label)
|
|
151
|
+
|
|
152
|
+
## Testing
|
|
153
|
+
|
|
154
|
+
Query avatars by their accessible role and label:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
// Accessible name defaults to text content
|
|
158
|
+
// <IressAvatar>LS</IressAvatar>
|
|
159
|
+
const avatar = screen.getByRole('img', { name: 'LS' });
|
|
160
|
+
|
|
161
|
+
// Or use aria-label for a custom accessible name
|
|
162
|
+
// <IressAvatar aria-label="Luke Skywalker">LS</IressAvatar>
|
|
163
|
+
const avatar = screen.getByRole('img', { name: 'Luke Skywalker' });
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Props
|
|
167
|
+
|
|
168
|
+
- **Type:** `IressAvatarProps`
|
|
169
|
+
- **Type declarations:** `@iress-oss/ids-components/dist/components/Avatar/Avatar.d.ts`
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import type { IressAvatarProps } from '@iress-oss/ids-components';
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
*View interactive examples: [https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/docs/components_components-avatar--docs](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/docs/components_components-avatar--docs)*
|
package/.ai/components/input.md
CHANGED
package/.ai/index.json
CHANGED
|
@@ -30,6 +30,15 @@
|
|
|
30
30
|
"category": "component",
|
|
31
31
|
"storybookUrl": "https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/docs/components_components-autocomplete-recipes--docs"
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Avatar",
|
|
35
|
+
"description": "Avatars display user identity in a circular frame, with optional badge and type indicators.",
|
|
36
|
+
"path": "components/avatar.md",
|
|
37
|
+
"category": "component",
|
|
38
|
+
"storybookUrl": "https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/docs/components_components-avatar--docs",
|
|
39
|
+
"propsType": "IressAvatarProps",
|
|
40
|
+
"typeDeclPath": "dist/components/Avatar/Avatar.d.ts"
|
|
41
|
+
},
|
|
33
42
|
{
|
|
34
43
|
"name": "Button",
|
|
35
44
|
"description": "A button is a clickable item used to perform an action.",
|
|
@@ -109,6 +109,8 @@ When mapping Figma components to IDS, read references/component-mapping.md for t
|
|
|
109
109
|
| Table | `IressTable` | Data-driven: `rows`, `columns`, `caption` props |
|
|
110
110
|
| Tag | `IressTag` | `bordered` for visible border; `element="button"` for clickable, `element="a"` for link; `onClick` alone also auto-renders as button |
|
|
111
111
|
| Pill | `IressPill` | |
|
|
112
|
+
| Avatar | `IressAvatar` | `mode` for colour, `badge` for status indicator, `type` for secondary icon |
|
|
113
|
+
| CompactAvatar | `IressAvatarGroup` + `IressAvatar compact` | `max` limits visible; `overflowLabel` render prop for overflow |
|
|
112
114
|
| Tooltip | `IressTooltip` | |
|
|
113
115
|
| Icon | `IressIcon name="..."` | Material Symbols name |
|
|
114
116
|
| Divider | `IressDivider` | |
|
|
@@ -134,8 +136,8 @@ Map Figma fill/stroke colours to IDS colour tokens:
|
|
|
134
136
|
| Neutral/10 `#FFFFFF` | `colour.neutral.10` | `--iress-colour-neutral-10` |
|
|
135
137
|
| Neutral/20 `#F5F6F8` | `colour.neutral.20` | `--iress-colour-neutral-20` |
|
|
136
138
|
| Neutral/30 `#E2E6EA` | `colour.neutral.30` | `--iress-colour-neutral-30` |
|
|
137
|
-
| Neutral/80 `#
|
|
138
|
-
| Neutral/90 `#141F4D` | `colour.neutral.90`
|
|
139
|
+
| Neutral/80 `#141F4D` | `colour.neutral.80` | `--iress-colour-neutral-80` |
|
|
140
|
+
| Neutral/90 `#141F4D` | `colour.neutral.90` (alias) | `--iress-colour-neutral-90` |
|
|
139
141
|
| Success/Fill `#37C49C` | `colour.system.success.fill` | `--iress-colour-system-success-fill` |
|
|
140
142
|
| Danger/Fill `#C21010` | `colour.system.danger.fill` | `--iress-colour-system-danger-fill` |
|
|
141
143
|
| Warning/Fill `#F0AD03` | `colour.system.warning.fill` | `--iress-colour-system-warning-fill` |
|
|
@@ -161,6 +163,10 @@ IDS base spacing unit = 4px (0.25rem). Map Figma pixel values:
|
|
|
161
163
|
|
|
162
164
|
> For values not on the 4px grid, round to the nearest token value.
|
|
163
165
|
|
|
166
|
+
> **Neutral alias note:** `colour.neutral.90` is a backwards-compatible alias
|
|
167
|
+
> of `colour.neutral.80`. Prefer `colour.neutral.80` in generated IDS code, but
|
|
168
|
+
> map either Figma `Neutral/80` or `Neutral/90` to the same `#141F4D` value.
|
|
169
|
+
|
|
164
170
|
## Border Radius
|
|
165
171
|
|
|
166
172
|
| Figma px | IDS Token | System Usage |
|
|
@@ -193,6 +199,11 @@ Prefer semantic HTML elements via the `element` prop — they convey meaning to
|
|
|
193
199
|
|
|
194
200
|
> **Tip:** When translating Figma frames that contain mixed or unstructured text (e.g. CMS content, markdown, rich text blocks), wrap the content in `IressText` and nest native HTML elements (`<p>`, `<strong>`, `<a>`, `<ul>`, etc.) inside it. This is an allowed pattern that lets `IressText` apply consistent typography while preserving the original content structure.
|
|
195
201
|
|
|
202
|
+
For neutral text colours, treat `colour.neutral.90` as a backwards-compatible
|
|
203
|
+
alias of `colour.neutral.80` (both resolve to `#141F4D`). Prefer
|
|
204
|
+
`colour.neutral.80` in new IDS implementations, but handle either token name
|
|
205
|
+
when translating older Figma files.
|
|
206
|
+
|
|
196
207
|
## Translation Examples
|
|
197
208
|
|
|
198
209
|
### Figma: Login Form Frame
|
|
@@ -69,6 +69,8 @@ Translate natural language UI descriptions into IDS (Iress Design System) compon
|
|
|
69
69
|
| Icon | `IressIcon` | `<IressIcon name="settings" />` |
|
|
70
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
|
+
| Avatar | `IressAvatar` | `<IressAvatar aria-label="Jane Doe" mode={10}>JD</IressAvatar>`; use `badge` for status indicators, `type` for secondary icons |
|
|
73
|
+
| Avatar group | `IressAvatarGroup` | `<IressAvatarGroup compact max={3}><IressAvatar>...</IressAvatar></IressAvatarGroup>`; stacks avatars with overlap and overflow |
|
|
72
74
|
| Tooltip | `IressTooltip` | `<IressTooltip content="Help text"><IressButton>Hover me</IressButton></IressTooltip>` |
|
|
73
75
|
|
|
74
76
|
## Overlays & Navigation
|
|
@@ -228,6 +230,8 @@ When you need to find the right IDS component for a UI element, read references/
|
|
|
228
230
|
| Icon | `IressIcon` | `<IressIcon name="settings" />` |
|
|
229
231
|
| 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
232
|
| Pill | `IressPill` | `<IressPill>Category</IressPill>` |
|
|
233
|
+
| Avatar | `IressAvatar` | `<IressAvatar aria-label="Jane Doe" mode={10}>JD</IressAvatar>`; use `badge` for status indicators, `type` for secondary icons |
|
|
234
|
+
| Avatar group | `IressAvatarGroup` | `<IressAvatarGroup compact max={3}><IressAvatar>...</IressAvatar></IressAvatarGroup>`; stacks avatars with overlap and overflow |
|
|
231
235
|
| Tooltip | `IressTooltip` | `<IressTooltip content="Help text"><IressButton>Hover me</IressButton></IressTooltip>` |
|
|
232
236
|
|
|
233
237
|
## Overlays & Navigation
|