@norconsult-digital-public/isypixel 2.0.2-canary.4 → 2.0.2-canary.5
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/docs/web-components/ip-avatar/llm.md +165 -0
- package/dist/llm.md +11 -10
- package/dist/types/components/ip-avatar/ip-avatar.d.ts +97 -0
- package/dist/types/components.d.ts +347 -0
- package/dist/types/home/runner/work/pixel/pixel/.stencil/utils/abbreviate-name.d.ts +2 -0
- package/dist/types/home/runner/work/pixel/pixel/.stencil/utils/get-initials.d.ts +2 -0
- package/dist/types/home/runner/work/pixel/pixel/.stencil/utils/icons.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/web-components/components/index.js +1 -1
- package/dist/web-components/components/ip-avatar.d.ts +11 -0
- package/dist/web-components/components/ip-avatar.js +1 -0
- package/dist/web-components/components/ip-button.js +1 -1
- package/dist/web-components/components/ip-icon-button.js +1 -1
- package/dist/web-components/components/ip-main-menu-group.js +1 -1
- package/dist/web-components/components/ip-main-menu-item.js +1 -1
- package/dist/web-components/components/ip-main-menu-section.js +1 -1
- package/dist/web-components/components/ip-main-menu-toggle.js +1 -1
- package/dist/web-components/components/ip-main-menu.js +1 -1
- package/dist/web-components/components/ip-tooltip.js +1 -1
- package/dist/web-components/components/{p-C46ykm0B.js → p-B1x6AHw9.js} +1 -1
- package/dist/web-components/components/{p-DZvuo-De.js → p-B7DtfC4M.js} +1 -1
- package/dist/web-components/components/{p-Cdum_HLu.js → p-C7Kf2aED.js} +1 -1
- package/dist/web-components/components/p-CAPVXUZ_.js +1 -0
- package/dist/web-components/components/{p-bEbVkEjw.js → p-CPd0stBB.js} +1 -1
- package/dist/web-components/components/{p-C5JgSR21.js → p-CSHQqNXM.js} +1 -1
- package/dist/web-components/components/{p-CfZcYTNP.js → p-CWbwcDHB.js} +1 -1
- package/dist/web-components/components/p-DpQ72I9n.js +1 -0
- package/dist/web-components/components/{p-xFc88Xk9.js → p-DrSqAb5O.js} +1 -1
- package/dist/web-components/components/{p-BVCpLJHm.js → p-uroVS1GL.js} +1 -1
- package/dist/web-components/generated/angular/components.d.ts +131 -0
- package/dist/web-components/generated/angular/components.js +176 -0
- package/dist/web-components/generated/angular/components.ts +148 -0
- package/dist/web-components/generated/angular/index.d.ts +1 -1
- package/dist/web-components/generated/angular/index.js +1 -0
- package/dist/web-components/generated/angular/index.ts +1 -0
- package/dist/web-components/generated/react/components.d.ts +7 -1
- package/dist/web-components/generated/react/components.js +12 -0
- package/dist/web-components/generated/react/components.ts +19 -1
- package/dist/web-components/generated/svelte/components.d.ts +2 -0
- package/dist/web-components/generated/vue/components.d.ts +1 -0
- package/dist/web-components/generated/vue/components.js +36 -0
- package/dist/web-components/generated/vue/components.ts +38 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
- package/dist/web-components/components/p-Cjml7mZs.js +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# ip-avatar
|
|
2
|
+
|
|
3
|
+
A theme-aware user avatar. It shows a profile image with a fallback chain (primary image → fallback image → initials → silhouette), an optional one- or two-line label (name + caption), a configurable ring, a forced or automatic loading state, and four positional corner slots. It is domain-agnostic: status, signing, and responsibility semantics are not baked in — consumers place and style their own markers via the corner slots.
|
|
4
|
+
|
|
5
|
+
**Storybook:** https://pixel.isy.no/storybook/?path=/docs/core-ui-ip-avatar-usage--docs
|
|
6
|
+
|
|
7
|
+
> This component requires ISY Pixel global styles to render correctly. Always remind the user to verify that styles are imported in their global stylesheet. See `llm.md` in the package root for style import options.
|
|
8
|
+
|
|
9
|
+
## Attributes
|
|
10
|
+
|
|
11
|
+
| Attribute | Type | Default | Values | Description |
|
|
12
|
+
| ----------------------- | ------- | ------------ | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| `name` | string | `""` | Any string | Full name. Used as the image `alt`, the source for initials/abbreviation, and the tooltip text. |
|
|
14
|
+
| `alt-name` | string | `undefined` | Any string | Explicit short/alternative name shown when `mode="alt-name"`. When unset, the name is abbreviated. |
|
|
15
|
+
| `caption` | string | `undefined` | Any string | Secondary line shown beneath the name, e.g. a role or title. |
|
|
16
|
+
| `placeholder` | string | `undefined` | Any string | Text shown beside the avatar when there is no name, e.g. an unselected-resource hint. |
|
|
17
|
+
| `src` | string | `undefined` | Any image URL | Primary profile image URL, tried first in the fallback chain. |
|
|
18
|
+
| `fallback-src` | string | `undefined` | Any image URL | Fallback image URL, used when `src` is missing or fails to load. |
|
|
19
|
+
| `mode` | string | `"fullname"` | `"fullname"`, `"alt-name"`, `"firstname"`, `"lastname"`, `"initials"`, `"image-only"` | Which name representation is shown as visible text beside the avatar. |
|
|
20
|
+
| `fallback` | string | `"auto"` | `"auto"`, `"initials"`, `"silhouette"` | Circle content when there is no image. `auto` shows initials when a name is set, silhouette when nameless. |
|
|
21
|
+
| `label-position` | string | `"right"` | `"top"`, `"right"`, `"bottom"`, `"left"` | Placement of the text label relative to the circle. |
|
|
22
|
+
| `gap` | string | `undefined` | Any CSS length | Overrides the gap between the avatar and the label. Defaults scale with `size`. |
|
|
23
|
+
| `size` | string | `"medium"` | `"small"`, `"medium"`, `"large"`, `"custom"` | Avatar size: `small` 40px, `medium` 50px (42px image), `large` 64px. Use `custom` with `custom-size`. |
|
|
24
|
+
| `custom-size` | string | `undefined` | Any CSS length | Diameter when `size="custom"`, applied to both width and height so the avatar stays circular. |
|
|
25
|
+
| `image-loading` | string | `"lazy"` | `"lazy"`, `"eager"` | Native image loading strategy forwarded to the inner `<img>`. |
|
|
26
|
+
| `loading` | boolean | `false` | `true`, `false` | Forces the loading indicator regardless of image state, e.g. before `src` is known. |
|
|
27
|
+
| `ring-variant` | string | `"default"` | `"default"`, `"brand"`, `"success"`, `"warning"`, `"error"`, `"custom"` | Predefined, theme-aware ring colour. Use `custom` together with `ring-color` for a raw colour. |
|
|
28
|
+
| `ring-color` | string | `undefined` | Any CSS colour | Raw ring colour, applied only when `ring-variant="custom"`. Does not adapt to light/dark. |
|
|
29
|
+
| `ring-style` | string | `"solid"` | `"solid"`, `"dashed"`, `"dotted"` | Line style of the ring. |
|
|
30
|
+
| `ring-gap` | string | `undefined` | Any CSS length | Gap between the ring and the content. Defaults to a small constant (2px). |
|
|
31
|
+
| `striped` | boolean | `false` | `true`, `false` | Overlays subtle diagonal stripes on the no-image background (initials / silhouette). |
|
|
32
|
+
| `clickable` | boolean | `false` | `true`, `false` | Makes the avatar interactive: focusable, keyboard-activatable, and emits `ipClick`. |
|
|
33
|
+
| `selected` | boolean | `false` | `true`, `false` | Applies the selected (active) container styling, e.g. for the chosen item in a list. |
|
|
34
|
+
| `disabled` | boolean | `false` | `true`, `false` | Greys out the avatar and, when `clickable`, prevents activation. |
|
|
35
|
+
| `full-width` | boolean | `false` | `true`, `false` | Stretches the avatar to fill the row, so stacked avatars span the full width. |
|
|
36
|
+
| `maintain-label-height` | boolean | `false` | `true`, `false` | Keeps both label lines at a constant height even when empty, so avatars in a row stay aligned. |
|
|
37
|
+
| `disable-tooltip` | boolean | `false` | `true`, `false` | Disables the built-in tooltip entirely. |
|
|
38
|
+
| `tooltip-position` | string | `"top"` | `"top"`, `"right"`, `"bottom"`, `"left"` | Placement of the tooltip, forwarded to `ip-tooltip`. |
|
|
39
|
+
| `tooltip-size` | string | `"medium"` | `"small"`, `"medium"`, `"large"` | Size of the tooltip, forwarded to `ip-tooltip`. |
|
|
40
|
+
| `tooltip-variant` | string | `"default"` | `"default"`, `"onLight"`, `"onDark"` | Colour variant of the tooltip, forwarded to `ip-tooltip`. |
|
|
41
|
+
|
|
42
|
+
**Fallback chain** — `src` is tried first. When it fails to load, `fallback-src` is tried next. When both are missing or fail, the avatar shows the user's initials (when a name is set) or a silhouette glyph. `fallback` can force `initials` or `silhouette`. Each image failure emits `ipImageError` with the failed URL.
|
|
43
|
+
|
|
44
|
+
**Tooltip content** — The tooltip surfaces the full `name` whenever the visible text differs from it (e.g. `firstname`, `lastname`, `initials`, or an abbreviated `alt-name`). When the visible text already equals the full name — in `mode="fullname"`, or in `mode="alt-name"` for a name short enough that abbreviation leaves it unchanged — the tooltip is auto-disabled unless custom `tooltip` slot content is provided.
|
|
45
|
+
|
|
46
|
+
## Slots
|
|
47
|
+
|
|
48
|
+
| Slot | Description |
|
|
49
|
+
| -------------- | --------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `top-left` | Adornment anchored to the top-left corner of the circle. The consumer supplies and styles it. |
|
|
51
|
+
| `top-right` | Adornment anchored to the top-right corner. |
|
|
52
|
+
| `bottom-left` | Adornment anchored to the bottom-left corner. |
|
|
53
|
+
| `bottom-right` | Adornment anchored to the bottom-right corner, e.g. a status badge. |
|
|
54
|
+
| `tooltip` | Optional override of the tooltip content. Defaults to the derived name when not provided. |
|
|
55
|
+
|
|
56
|
+
## Events
|
|
57
|
+
|
|
58
|
+
| Event | Payload | When |
|
|
59
|
+
| -------------- | --------------------- | ------------------------------------------------------------------------------------ |
|
|
60
|
+
| `ipImageError` | `string` (failed src) | An image fails to load and the component advances down the fallback chain. |
|
|
61
|
+
| `ipClick` | `void` | A `clickable` avatar is activated by mouse or keyboard. Not emitted when `disabled`. |
|
|
62
|
+
|
|
63
|
+
## Accessibility
|
|
64
|
+
|
|
65
|
+
- The image uses `name` as its `alt`. When the initials fallback is shown, `name` is exposed to assistive technology via visually hidden text and the initials/silhouette are marked `aria-hidden`.
|
|
66
|
+
- While an image loads or `loading` is set, the media sets `aria-busy="true"` and renders visually hidden loading text. Initials/silhouette are the final state, never a stuck spinner.
|
|
67
|
+
- When `clickable`, the avatar exposes `role="button"`, is focusable (`tabindex="0"`), shows a `:focus-visible` ring, and is activated with Enter or Space.
|
|
68
|
+
- When `disabled`, a clickable avatar sets `aria-disabled="true"`, drops out of the tab order, and blocks `ipClick`.
|
|
69
|
+
- A `clickable` avatar with no visible label derives its accessible name from `name` (falling back to `placeholder`). When using `mode="image-only"` (or no name/placeholder) on a clickable avatar, supply an accessible name yourself via the `tooltip` slot or a wrapping label, or the button is announced unnamed.
|
|
70
|
+
|
|
71
|
+
## Design tokens
|
|
72
|
+
|
|
73
|
+
> The avatar reuses generic semantic tokens as theme-aware stand-ins; a dedicated avatar token family (background, foreground, ring, container hover/selected) does not exist yet. Avatar sizes are literal pixel values for the same reason. These are marked `//TODO` in the SCSS and will be replaced once design adds the avatar tokens.
|
|
74
|
+
|
|
75
|
+
| SCSS variable | Role |
|
|
76
|
+
| ------------------------------------------------------------ | ----------------------------------------------------------------- |
|
|
77
|
+
| `$ip_color_surface_primary_default` | Ring layer background behind the ring gap |
|
|
78
|
+
| `$ip_color_text_primary_blue` | Foreground colour: initials, silhouette, loader, and default ring |
|
|
79
|
+
| `$ip_color_border_opaque_15` | No-image background behind initials / silhouette |
|
|
80
|
+
| `$ip_color_border_opaque_10` | Clickable container hover background and the stripe overlay |
|
|
81
|
+
| `$ip_color_border_opaque_20` | Selected container background |
|
|
82
|
+
| `$ip_color_button_focus_default` | Focus ring when `clickable` |
|
|
83
|
+
| `$ip_color_brand_accent_primary_default` | Ring colour for `ring-variant="brand"` |
|
|
84
|
+
| `$ip_color_extended_green-500` | Ring colour for `ring-variant="success"` |
|
|
85
|
+
| `$ip_color_extended_yellow-500` | Ring colour for `ring-variant="warning"` |
|
|
86
|
+
| `$ip_color_extended_red-500` | Ring colour for `ring-variant="error"` |
|
|
87
|
+
| `$ip_color_text_primary_black` | Label (name) text colour |
|
|
88
|
+
| `$ip_radius_size_small` | Framed container and focus-ring radius |
|
|
89
|
+
| `$ip_spacing_space_050` / `$ip_spacing_space_200` | Framed container padding |
|
|
90
|
+
| `$ip_spacing_space_100` / `_200` / `_300` | Avatar↔label gap defaults for small / medium / large |
|
|
91
|
+
| `$ip_typography_body_font_size_small` / `_medium` / `_large` | Initials and label font size per size |
|
|
92
|
+
| `$ip_typography_body_line_height_compact` | Line height for the name and caption lines |
|
|
93
|
+
| `$ip_typography_font_family_primary` | Font family for initials and label |
|
|
94
|
+
| `$ip_typography_font_weight_bold_700` | Initials font weight |
|
|
95
|
+
| `$ip_typography_font_weight_light_300` | Caption and placeholder font weight (italic) |
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
### HTML
|
|
100
|
+
|
|
101
|
+
> Attribute names must be **kebab-case** in HTML: use `fallback-src`, not `fallbackSrc`.
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import '@norconsult-digital-public/isypixel/web-components/ip-avatar.js';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<ip-avatar name="Alexander Wangsvik" caption="Elkraft, ingeniør" src="/users/alexander.jpg" fallback-src="/users/default.png">
|
|
109
|
+
<span slot="bottom-right" class="badge">✓</span>
|
|
110
|
+
</ip-avatar>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### React
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import { IpAvatar } from '@norconsult-digital-public/isypixel/web-components/react';
|
|
117
|
+
|
|
118
|
+
<IpAvatar name='Alexander Wangsvik' caption='Elkraft, ingeniør' src='/users/alexander.jpg' fallbackSrc='/users/default.png' onIpClick={() => {}} />;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Vue
|
|
122
|
+
|
|
123
|
+
```vue
|
|
124
|
+
<script setup lang="ts">
|
|
125
|
+
import { IpAvatar } from '@norconsult-digital-public/isypixel/web-components/vue';
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<template>
|
|
129
|
+
<IpAvatar name="Alexander Wangsvik" caption="Elkraft, ingeniør" src="/users/alexander.jpg" fallback-src="/users/default.png" />
|
|
130
|
+
</template>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Angular
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
import { IpAvatar } from '@norconsult-digital-public/isypixel/web-components/angular';
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<ip-avatar name="Alexander Wangsvik" caption="Elkraft, ingeniør" [src]="imageUrl" ring-variant="brand" (ipClick)="onSelect()"></ip-avatar>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Svelte
|
|
144
|
+
|
|
145
|
+
```svelte
|
|
146
|
+
<script lang="ts">
|
|
147
|
+
import '@norconsult-digital-public/isypixel/web-components/ip-avatar.js';
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<ip-avatar name="Alexander Wangsvik" caption="Elkraft, ingeniør" src="/users/alexander.jpg" fallback-src="/users/default.png"></ip-avatar>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Blazor
|
|
154
|
+
|
|
155
|
+
> Attribute names must be **kebab-case** in Blazor HTML.
|
|
156
|
+
|
|
157
|
+
Copy `ip-avatar.js` to `wwwroot/lib/isypixel/components/` at build time. See `llm.md` in the package root for the MSBuild target.
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<script type="module" src="lib/isypixel/components/ip-avatar.js"></script>
|
|
161
|
+
|
|
162
|
+
<ip-avatar name="Alexander Wangsvik" caption="Elkraft, ingeniør" src="/users/alexander.jpg" fallback-src="/users/default.png"></ip-avatar>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- Boolean attributes such as `clickable`, `disabled`, `striped`, and `disable-tooltip` must be set as `clickable="true"` (string value) — Blazor does not reliably render bare boolean attributes on custom elements.
|
package/dist/llm.md
CHANGED
|
@@ -169,16 +169,17 @@ In `index.html` `<body>`:
|
|
|
169
169
|
|
|
170
170
|
## Components
|
|
171
171
|
|
|
172
|
-
| Component | Description
|
|
173
|
-
| ---------------------- |
|
|
174
|
-
| `ip-button` | Clickable button with visual variants, loading state, and icon slot
|
|
175
|
-
| `ip-icon-button` | Circular icon-only button with CSS ripple, visual variants, and loading state
|
|
176
|
-
| `ip-tooltip` | Tooltip that wraps a trigger and shows non-interactive content on hover, focus, and Escape
|
|
177
|
-
| `ip-
|
|
178
|
-
| `ip-main-menu
|
|
179
|
-
| `ip-main-menu-
|
|
180
|
-
| `ip-main-menu-
|
|
181
|
-
| `ip-main-menu-
|
|
172
|
+
| Component | Description | Docs |
|
|
173
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
174
|
+
| `ip-button` | Clickable button with visual variants, loading state, and icon slot | `docs/web-components/ip-button/llm.md` |
|
|
175
|
+
| `ip-icon-button` | Circular icon-only button with CSS ripple, visual variants, and loading state | `docs/web-components/ip-icon-button/llm.md` |
|
|
176
|
+
| `ip-tooltip` | Tooltip that wraps a trigger and shows non-interactive content on hover, focus, and Escape | `docs/web-components/ip-tooltip/llm.md` |
|
|
177
|
+
| `ip-avatar` | Theme-aware avatar with image/fallback/initials/silhouette chain, label, ring, loader, corner slots, and tooltip | `docs/web-components/ip-avatar/llm.md` |
|
|
178
|
+
| `ip-main-menu` | Sidebar navigation wrapper with expanded/auto-hide/collapsed desktop modes and mobile drawer | `docs/web-components/ip-main-menu/llm.md` |
|
|
179
|
+
| `ip-main-menu-toggle` | Hamburger button for the top bar that opens the `ip-main-menu` mobile drawer via a shared store | `docs/web-components/ip-main-menu-toggle/llm.md` |
|
|
180
|
+
| `ip-main-menu-section` | Semantic section wrapper that groups navigation items with an optional visible label | `docs/web-components/ip-main-menu-section/llm.md` |
|
|
181
|
+
| `ip-main-menu-group` | Collapsible group of navigation items with label, icon, and animated chevron | `docs/web-components/ip-main-menu-group/llm.md` |
|
|
182
|
+
| `ip-main-menu-item` | Individual navigation item; renders as `<a>` when `href` is provided, otherwise as `<button>` | `docs/web-components/ip-main-menu-item/llm.md` |
|
|
182
183
|
|
|
183
184
|
## Services
|
|
184
185
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { EventEmitter, JSX } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class IpAvatar {
|
|
3
|
+
/** User's full name. Used as the image `alt`, the source for every name representation, and the tooltip text. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Alternative (typically shortened) name shown when `mode="alt-name"`. When unset, the name is abbreviated automatically. */
|
|
6
|
+
altName: string | undefined;
|
|
7
|
+
/** Caption line shown beneath the name, e.g. a role or title. */
|
|
8
|
+
caption: string | undefined;
|
|
9
|
+
/** Text shown beside the avatar when there is no name, e.g. an unselected-resource hint. */
|
|
10
|
+
placeholder: string | undefined;
|
|
11
|
+
/** Primary profile image URL, tried first in the fallback chain. */
|
|
12
|
+
src: string | undefined;
|
|
13
|
+
/** Fallback image URL, used when `src` is missing or fails to load. */
|
|
14
|
+
fallbackSrc: string | undefined;
|
|
15
|
+
/** Which name representation, if any, is displayed as visible text beside the avatar. */
|
|
16
|
+
mode: 'fullname' | 'alt-name' | 'firstname' | 'lastname' | 'initials' | 'image-only';
|
|
17
|
+
/** What to show inside the circle when there is no image: `auto` derives initials from the name (silhouette when nameless), `initials` forces initials, `silhouette` forces the person glyph. */
|
|
18
|
+
fallback: 'auto' | 'initials' | 'silhouette';
|
|
19
|
+
/** Position of the text label relative to the avatar circle. */
|
|
20
|
+
labelPosition: 'top' | 'right' | 'bottom' | 'left';
|
|
21
|
+
/** Overrides the gap between the avatar and the label. Any CSS length; defaults scale with `size`. */
|
|
22
|
+
gap: string | undefined;
|
|
23
|
+
/** Avatar size. Use `custom` together with `customSize` for an arbitrary size. */
|
|
24
|
+
size: 'small' | 'medium' | 'large' | 'custom';
|
|
25
|
+
/** Diameter of the avatar when `size="custom"`. Any CSS length, e.g. `64px` or `4rem`. Applied to both width and height so the avatar stays circular. */
|
|
26
|
+
customSize: string | undefined;
|
|
27
|
+
/** Native image loading strategy forwarded to the inner `<img>`. */
|
|
28
|
+
imageLoading: 'lazy' | 'eager';
|
|
29
|
+
/** Forces the loading spinner regardless of image state — for showing a pending avatar before `src` is known. */
|
|
30
|
+
loading: boolean;
|
|
31
|
+
/** Predefined, theme-aware ring colour. Use `custom` together with `ringColor` for a raw colour. */
|
|
32
|
+
ringVariant: 'default' | 'brand' | 'success' | 'warning' | 'error' | 'custom';
|
|
33
|
+
/** Raw CSS colour for the ring, applied only when `ringVariant="custom"`. Does not adapt to light/dark. */
|
|
34
|
+
ringColor: string | undefined;
|
|
35
|
+
/** Line style of the ring around the circle. */
|
|
36
|
+
ringStyle: 'solid' | 'dashed' | 'dotted';
|
|
37
|
+
/** Gap between the ring and the content (image/initials). Any CSS length; defaults to a small constant. */
|
|
38
|
+
ringGap: string | undefined;
|
|
39
|
+
/** Makes the avatar interactive: focusable, keyboard-activatable, and emits `ipClick`. */
|
|
40
|
+
clickable: boolean;
|
|
41
|
+
/** Applies the selected (active) container styling, e.g. for the chosen item in a list. */
|
|
42
|
+
selected: boolean;
|
|
43
|
+
/** Stretches the avatar to fill the available width, so stacked avatars span the full row. */
|
|
44
|
+
fullWidth: boolean;
|
|
45
|
+
/** Keeps the name and caption lines at a constant height even when empty, so avatars in a row stay aligned regardless of which carry a name/caption. */
|
|
46
|
+
maintainLabelHeight: boolean;
|
|
47
|
+
/** Overlays subtle diagonal stripes on the no-image background (initials / silhouette). */
|
|
48
|
+
striped: boolean;
|
|
49
|
+
/** Greys out the avatar and, when `clickable`, prevents activation. */
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
/** Disables the built-in tooltip entirely. */
|
|
52
|
+
disableTooltip: boolean;
|
|
53
|
+
/** Placement of the tooltip, forwarded to `ip-tooltip`. */
|
|
54
|
+
tooltipPosition: 'top' | 'right' | 'bottom' | 'left';
|
|
55
|
+
/** Size of the tooltip, forwarded to `ip-tooltip`. */
|
|
56
|
+
tooltipSize: 'small' | 'medium' | 'large';
|
|
57
|
+
/** Colour variant of the tooltip, forwarded to `ip-tooltip`. */
|
|
58
|
+
tooltipVariant: 'default' | 'onLight' | 'onDark';
|
|
59
|
+
/** Index into the resolved source chain — advances when an image fails to load. */
|
|
60
|
+
private srcIndex;
|
|
61
|
+
/** Tracks whether the current image is still loading, to show the spinner. */
|
|
62
|
+
private isLoading;
|
|
63
|
+
/** Tracks whether the consumer slotted custom tooltip content, so the tooltip stays enabled even without a derived name. */
|
|
64
|
+
private hasTooltipSlot;
|
|
65
|
+
/** Emitted with the failed src each time an image fails to load and the fallback chain advances. */
|
|
66
|
+
imageError: EventEmitter<string>;
|
|
67
|
+
/** Emitted when a clickable, non-disabled avatar is activated by mouse or keyboard. */
|
|
68
|
+
clickEvent: EventEmitter<void>;
|
|
69
|
+
/** Whitespace-separated words of the name, with empty entries removed. */
|
|
70
|
+
private get nameWords();
|
|
71
|
+
/** Resolved image source chain in priority order, skipping any that are not set and de-duplicating so an identical URL is never retried (which would never fire a second load error). */
|
|
72
|
+
private get sources();
|
|
73
|
+
/** The image source currently being displayed, or an empty string once the chain is exhausted. */
|
|
74
|
+
private get currentSrc();
|
|
75
|
+
/** The name representation displayed as visible text beside the avatar, per the active mode. */
|
|
76
|
+
private get visibleName();
|
|
77
|
+
/** The full name surfaced by the tooltip — shown only when the visible text is not already the full name. */
|
|
78
|
+
private get tooltipName();
|
|
79
|
+
componentWillLoad(): void;
|
|
80
|
+
/** Restarts the fallback chain from the primary source — runs on load and whenever a source prop changes. */
|
|
81
|
+
resetImageState(): void;
|
|
82
|
+
/** Marks the image as loaded so the spinner is removed. */
|
|
83
|
+
private handleImageLoad;
|
|
84
|
+
/** Advances down the fallback chain on load failure, emitting the failed src; falls back to initials or silhouette once exhausted. */
|
|
85
|
+
private handleImageError;
|
|
86
|
+
/** Emits ipClick when the avatar is clickable and not disabled. */
|
|
87
|
+
private handleActivate;
|
|
88
|
+
/** Activates the avatar on Enter or Space, mirroring native button keyboard behaviour. */
|
|
89
|
+
private handleKeyDown;
|
|
90
|
+
/** Tracks custom tooltip slot content so the tooltip is not auto-disabled when the consumer provides their own. */
|
|
91
|
+
private handleTooltipSlotChange;
|
|
92
|
+
/** Whether the initials fallback should render: forced by `fallback`, or chosen automatically when a name is present. */
|
|
93
|
+
private get showsInitials();
|
|
94
|
+
/** Renders the image, the initials fallback, or the silhouette placeholder depending on what is available. */
|
|
95
|
+
private renderMediaContent;
|
|
96
|
+
render(): JSX.Element;
|
|
97
|
+
}
|