@grasco/profile-picture 0.1.2 → 0.1.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/README.md +4 -0
- package/dist/angular.cjs +1 -370
- package/dist/angular.cjs.map +1 -1
- package/dist/angular.d.cts +188 -2
- package/dist/angular.d.ts +188 -2
- package/dist/angular.js +1 -370
- package/dist/angular.js.map +1 -1
- package/dist/index.cjs +246 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +130 -43
- package/dist/index.d.ts +130 -43
- package/dist/index.js +246 -110
- package/dist/index.js.map +1 -1
- package/dist/standalone.d.ts +9 -2
- package/dist/standalone.standalone.js +280 -144
- package/dist/standalone.standalone.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/svelte.cjs +1 -370
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +188 -2
- package/dist/svelte.d.ts +188 -2
- package/dist/svelte.js +1 -370
- package/dist/svelte.js.map +1 -1
- package/dist/vue.cjs +1 -370
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +188 -2
- package/dist/vue.d.ts +188 -2
- package/dist/vue.js +1 -370
- package/dist/vue.js.map +1 -1
- package/package.json +9 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import * as lit_html from 'lit-html';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Profile Picture Component - Type Definitions
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
10
10
|
type Variant = "circle" | "rounded" | "squircle" | "square";
|
|
11
|
-
type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
11
|
+
type Position = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
12
12
|
type LoadingStrategy = "lazy" | "eager";
|
|
13
13
|
type PlaceholderType = "shimmer" | "pulse" | "blur" | "skeleton" | "none";
|
|
14
14
|
type PresenceStatus = "online" | "away" | "busy" | "offline" | "dnd";
|
|
@@ -41,6 +41,8 @@ interface BadgeConfig {
|
|
|
41
41
|
color?: string;
|
|
42
42
|
/** Background color */
|
|
43
43
|
bgColor?: string;
|
|
44
|
+
/** Border radius (CSS value, e.g., "8px", "50%", "9999px") */
|
|
45
|
+
borderRadius?: string;
|
|
44
46
|
/** Enable pulse animation */
|
|
45
47
|
pulse?: boolean;
|
|
46
48
|
/** Enable glow effect */
|
|
@@ -87,6 +89,56 @@ interface InteractionConfig {
|
|
|
87
89
|
cursor?: "pointer" | "default" | "zoom-in";
|
|
88
90
|
}
|
|
89
91
|
type ShadowPreset = "none" | "sm" | "md" | "lg" | "glow";
|
|
92
|
+
/**
|
|
93
|
+
* Base props interface shared across all framework wrappers.
|
|
94
|
+
* This ensures type consistency between React, Vue, Svelte, and Angular.
|
|
95
|
+
*/
|
|
96
|
+
interface ProfilePictureProps$1 {
|
|
97
|
+
/** Image source URL */
|
|
98
|
+
src?: string;
|
|
99
|
+
/** Alt text for accessibility and fallback initials */
|
|
100
|
+
alt?: string;
|
|
101
|
+
/** External customer ID for CDN image loading */
|
|
102
|
+
extCustomerId?: string;
|
|
103
|
+
/** Predefined size or custom pixel value */
|
|
104
|
+
size?: Size | number;
|
|
105
|
+
/** Shape variant */
|
|
106
|
+
variant?: Variant;
|
|
107
|
+
/** Shadow preset */
|
|
108
|
+
shadow?: ShadowPreset;
|
|
109
|
+
/** Enable border */
|
|
110
|
+
border?: boolean;
|
|
111
|
+
/** Border width in pixels */
|
|
112
|
+
borderWidth?: 1 | 2 | 3 | 4 | 5 | 6 | 8;
|
|
113
|
+
/** Border color (CSS color value) */
|
|
114
|
+
borderColor?: string;
|
|
115
|
+
/** Rotation angle in degrees */
|
|
116
|
+
rotation?: number;
|
|
117
|
+
/** Background color (CSS color value) */
|
|
118
|
+
bgColor?: string;
|
|
119
|
+
/** Background gradient (CSS gradient value) */
|
|
120
|
+
bgGradient?: string;
|
|
121
|
+
/** Glow effect configuration */
|
|
122
|
+
glow?: GlowConfig;
|
|
123
|
+
/** Ring effect configuration (Instagram-style) */
|
|
124
|
+
ring?: RingConfig;
|
|
125
|
+
/** Presence indicator configuration */
|
|
126
|
+
presence?: PresenceConfig;
|
|
127
|
+
/** Ribbon configuration */
|
|
128
|
+
ribbon?: RibbonConfig;
|
|
129
|
+
/** Badge configuration */
|
|
130
|
+
badge?: BadgeConfig;
|
|
131
|
+
/** Loading strategy */
|
|
132
|
+
loading?: LoadingStrategy;
|
|
133
|
+
/** Placeholder type while loading */
|
|
134
|
+
placeholder?: PlaceholderType;
|
|
135
|
+
/** Placeholder background color */
|
|
136
|
+
placeholderColor?: string;
|
|
137
|
+
/** Custom fallback text (overrides initials from alt) */
|
|
138
|
+
fallback?: string;
|
|
139
|
+
/** Interactive behavior configuration */
|
|
140
|
+
interactive?: InteractionConfig;
|
|
141
|
+
}
|
|
90
142
|
/** Direction for stacking avatars */
|
|
91
143
|
type StackDirection = "ltr" | "rtl";
|
|
92
144
|
/** Tooltip position relative to avatar */
|
|
@@ -162,6 +214,27 @@ interface ProfilePictureGroupProps$1 {
|
|
|
162
214
|
animated?: boolean;
|
|
163
215
|
}
|
|
164
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Profile Picture Component - Utility Functions
|
|
219
|
+
* Apple-inspired design system utilities
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Get CDN size label from pixel size (rounds up to next available size)
|
|
224
|
+
* CDN sizes: 80, 120, 240, 480, 960
|
|
225
|
+
*/
|
|
226
|
+
declare function getCdnSizeLabel(pixelSize: number): "80" | "120" | "240" | "480" | "960";
|
|
227
|
+
/**
|
|
228
|
+
* Detect theme (dark/light) from background color using luminance calculation
|
|
229
|
+
* Returns 'light' for non-hex colors or when luminance > 0.5
|
|
230
|
+
*/
|
|
231
|
+
declare function detectThemeFromColor(bgColor?: string): "dark" | "light";
|
|
232
|
+
/**
|
|
233
|
+
* Construct CDN URL for profile picture
|
|
234
|
+
* Format: {baseUrl}/api/profile-picture/cdn/{extId}_{size}_{theme}.webp?hostname={hostname}
|
|
235
|
+
*/
|
|
236
|
+
declare function constructCdnUrl(baseUrl: string, extCustomerId: string, sizeLabel: "80" | "120" | "240" | "480" | "960", theme: "dark" | "light", hostname: string): string;
|
|
237
|
+
|
|
165
238
|
declare class ProfilePicture$1 extends LitElement {
|
|
166
239
|
private static stylesInjected;
|
|
167
240
|
private static cdnBaseUrl;
|
|
@@ -237,27 +310,6 @@ declare global {
|
|
|
237
310
|
}
|
|
238
311
|
}
|
|
239
312
|
|
|
240
|
-
/**
|
|
241
|
-
* Profile Picture Component - Utility Functions
|
|
242
|
-
* Apple-inspired design system utilities
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Get CDN size label from pixel size (rounds up to next available size)
|
|
247
|
-
* CDN sizes: 80, 120, 240, 480, 960
|
|
248
|
-
*/
|
|
249
|
-
declare function getCdnSizeLabel(pixelSize: number): "80" | "120" | "240" | "480" | "960";
|
|
250
|
-
/**
|
|
251
|
-
* Detect theme (dark/light) from background color using luminance calculation
|
|
252
|
-
* Returns 'light' for non-hex colors or when luminance > 0.5
|
|
253
|
-
*/
|
|
254
|
-
declare function detectThemeFromColor(bgColor?: string): "dark" | "light";
|
|
255
|
-
/**
|
|
256
|
-
* Construct CDN URL for profile picture
|
|
257
|
-
* Format: {baseUrl}/api/profile-picture/cdn/{extId}_{size}_{theme}.webp?hostname={hostname}
|
|
258
|
-
*/
|
|
259
|
-
declare function constructCdnUrl(baseUrl: string, extCustomerId: string, sizeLabel: "80" | "120" | "240" | "480" | "960", theme: "dark" | "light", hostname: string): string;
|
|
260
|
-
|
|
261
313
|
declare class ProfilePictureGroup$1 extends LitElement {
|
|
262
314
|
protected createRenderRoot(): this;
|
|
263
315
|
max: 4;
|
|
@@ -276,6 +328,8 @@ declare class ProfilePictureGroup$1 extends LitElement {
|
|
|
276
328
|
private tooltipData;
|
|
277
329
|
private tooltipTimeout;
|
|
278
330
|
private slotObserver;
|
|
331
|
+
private portalContainer;
|
|
332
|
+
private counterRef;
|
|
279
333
|
private get pixelSize();
|
|
280
334
|
private get tooltipEnabled();
|
|
281
335
|
private get tooltipPosition();
|
|
@@ -287,6 +341,9 @@ declare class ProfilePictureGroup$1 extends LitElement {
|
|
|
287
341
|
disconnectedCallback(): void;
|
|
288
342
|
private setupSlotObserver;
|
|
289
343
|
private updateUsers;
|
|
344
|
+
private createPortal;
|
|
345
|
+
private destroyPortal;
|
|
346
|
+
private updatePortalContent;
|
|
290
347
|
private handleAvatarClick;
|
|
291
348
|
private handleAvatarHover;
|
|
292
349
|
private handleAvatarLeave;
|
|
@@ -301,9 +358,9 @@ declare class ProfilePictureGroup$1 extends LitElement {
|
|
|
301
358
|
private renderCounter;
|
|
302
359
|
private renderAddButton;
|
|
303
360
|
private renderTooltip;
|
|
304
|
-
private renderDropdown;
|
|
305
361
|
private renderDropdownItem;
|
|
306
362
|
private formatStatus;
|
|
363
|
+
protected updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
307
364
|
render(): lit_html.TemplateResult<1>;
|
|
308
365
|
}
|
|
309
366
|
|
|
@@ -363,6 +420,8 @@ interface ProfilePictureGroupProps {
|
|
|
363
420
|
addButtonLabel?: string;
|
|
364
421
|
/** Enable hover lift animation (default: true) */
|
|
365
422
|
animated?: boolean;
|
|
423
|
+
/** Alternating rotation amount in degrees (0 = no rotation) */
|
|
424
|
+
rotationAmount?: number;
|
|
366
425
|
/** Called when an avatar is clicked */
|
|
367
426
|
onAvatarClick?: (user: GroupUserData) => void;
|
|
368
427
|
/** Called when hovering over an avatar */
|
|
@@ -413,32 +472,60 @@ declare const ProfilePictureGroup: React.ForwardRefExoticComponent<ProfilePictur
|
|
|
413
472
|
* ```
|
|
414
473
|
*/
|
|
415
474
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
border?: boolean;
|
|
422
|
-
borderWidth?: 1 | 2 | 3 | 4;
|
|
423
|
-
borderColor?: string;
|
|
424
|
-
bgColor?: string;
|
|
425
|
-
bgGradient?: string;
|
|
426
|
-
ribbon?: RibbonConfig;
|
|
427
|
-
badge?: BadgeConfig;
|
|
428
|
-
loading?: LoadingStrategy;
|
|
429
|
-
placeholder?: PlaceholderType;
|
|
430
|
-
placeholderColor?: string;
|
|
431
|
-
fallback?: string;
|
|
475
|
+
/**
|
|
476
|
+
* React-specific props extending the core ProfilePictureProps
|
|
477
|
+
*/
|
|
478
|
+
interface ProfilePictureProps extends ProfilePictureProps$1 {
|
|
479
|
+
/** Called when image loads successfully */
|
|
432
480
|
onLoad?: () => void;
|
|
481
|
+
/** Called when image fails to load */
|
|
433
482
|
onError?: () => void;
|
|
483
|
+
/** Called when CDN image fails to load */
|
|
484
|
+
onCdnError?: (detail: {
|
|
485
|
+
error: string;
|
|
486
|
+
}) => void;
|
|
487
|
+
/** Additional CSS class names */
|
|
434
488
|
className?: string;
|
|
489
|
+
/** Inline styles */
|
|
435
490
|
style?: React.CSSProperties;
|
|
436
491
|
}
|
|
437
492
|
/**
|
|
438
493
|
* ProfilePicture React Component
|
|
439
494
|
*
|
|
440
|
-
* Type-safe wrapper around the profile-picture web component
|
|
495
|
+
* Type-safe wrapper around the profile-picture web component.
|
|
496
|
+
* Uses ref as a prop (React 19+ pattern).
|
|
441
497
|
*/
|
|
442
|
-
declare
|
|
498
|
+
declare function ProfilePicture({ src, alt, extCustomerId, size, variant, shadow, border, borderWidth, borderColor, rotation, bgColor, bgGradient, glow, ring, presence, ribbon, badge, loading, placeholder, placeholderColor, fallback, interactive, onLoad, onError, onCdnError, className, style, ref, }: ProfilePictureProps & {
|
|
499
|
+
ref?: React.Ref<HTMLElement>;
|
|
500
|
+
}): React.ReactElement<{
|
|
501
|
+
ref: React.RefObject<HTMLElement>;
|
|
502
|
+
src: string | undefined;
|
|
503
|
+
alt: string | undefined;
|
|
504
|
+
"ext-customer-id": string | undefined;
|
|
505
|
+
size: number | Size | undefined;
|
|
506
|
+
variant: Variant | undefined;
|
|
507
|
+
shadow: ShadowPreset | undefined;
|
|
508
|
+
border: true | undefined;
|
|
509
|
+
"border-width": 1 | 2 | 3 | 4 | 5 | 6 | 8 | undefined;
|
|
510
|
+
"border-color": string | undefined;
|
|
511
|
+
rotation: number | undefined;
|
|
512
|
+
"bg-color": string | undefined;
|
|
513
|
+
"bg-gradient": string | undefined;
|
|
514
|
+
glow: string | undefined;
|
|
515
|
+
ring: string | undefined;
|
|
516
|
+
presence: string | undefined;
|
|
517
|
+
ribbon: string | undefined;
|
|
518
|
+
badge: string | undefined;
|
|
519
|
+
loading: LoadingStrategy | undefined;
|
|
520
|
+
placeholder: PlaceholderType | undefined;
|
|
521
|
+
"placeholder-color": string | undefined;
|
|
522
|
+
fallback: string | undefined;
|
|
523
|
+
interactive: string | undefined;
|
|
524
|
+
class: string | undefined;
|
|
525
|
+
style: React.CSSProperties | undefined;
|
|
526
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
527
|
+
declare namespace ProfilePicture {
|
|
528
|
+
var displayName: string;
|
|
529
|
+
}
|
|
443
530
|
|
|
444
|
-
export { type BadgeConfig, type DropdownConfig, type GroupUserData, type LoadingStrategy, type PlaceholderType, type Position, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps
|
|
531
|
+
export { type BadgeConfig, type ProfilePictureGroupProps$1 as CoreProfilePictureGroupProps, type ProfilePictureProps$1 as CoreProfilePictureProps, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RibbonConfig, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, constructCdnUrl, detectThemeFromColor, getCdnSizeLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import * as lit_html from 'lit-html';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Profile Picture Component - Type Definitions
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
10
10
|
type Variant = "circle" | "rounded" | "squircle" | "square";
|
|
11
|
-
type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
11
|
+
type Position = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
12
12
|
type LoadingStrategy = "lazy" | "eager";
|
|
13
13
|
type PlaceholderType = "shimmer" | "pulse" | "blur" | "skeleton" | "none";
|
|
14
14
|
type PresenceStatus = "online" | "away" | "busy" | "offline" | "dnd";
|
|
@@ -41,6 +41,8 @@ interface BadgeConfig {
|
|
|
41
41
|
color?: string;
|
|
42
42
|
/** Background color */
|
|
43
43
|
bgColor?: string;
|
|
44
|
+
/** Border radius (CSS value, e.g., "8px", "50%", "9999px") */
|
|
45
|
+
borderRadius?: string;
|
|
44
46
|
/** Enable pulse animation */
|
|
45
47
|
pulse?: boolean;
|
|
46
48
|
/** Enable glow effect */
|
|
@@ -87,6 +89,56 @@ interface InteractionConfig {
|
|
|
87
89
|
cursor?: "pointer" | "default" | "zoom-in";
|
|
88
90
|
}
|
|
89
91
|
type ShadowPreset = "none" | "sm" | "md" | "lg" | "glow";
|
|
92
|
+
/**
|
|
93
|
+
* Base props interface shared across all framework wrappers.
|
|
94
|
+
* This ensures type consistency between React, Vue, Svelte, and Angular.
|
|
95
|
+
*/
|
|
96
|
+
interface ProfilePictureProps$1 {
|
|
97
|
+
/** Image source URL */
|
|
98
|
+
src?: string;
|
|
99
|
+
/** Alt text for accessibility and fallback initials */
|
|
100
|
+
alt?: string;
|
|
101
|
+
/** External customer ID for CDN image loading */
|
|
102
|
+
extCustomerId?: string;
|
|
103
|
+
/** Predefined size or custom pixel value */
|
|
104
|
+
size?: Size | number;
|
|
105
|
+
/** Shape variant */
|
|
106
|
+
variant?: Variant;
|
|
107
|
+
/** Shadow preset */
|
|
108
|
+
shadow?: ShadowPreset;
|
|
109
|
+
/** Enable border */
|
|
110
|
+
border?: boolean;
|
|
111
|
+
/** Border width in pixels */
|
|
112
|
+
borderWidth?: 1 | 2 | 3 | 4 | 5 | 6 | 8;
|
|
113
|
+
/** Border color (CSS color value) */
|
|
114
|
+
borderColor?: string;
|
|
115
|
+
/** Rotation angle in degrees */
|
|
116
|
+
rotation?: number;
|
|
117
|
+
/** Background color (CSS color value) */
|
|
118
|
+
bgColor?: string;
|
|
119
|
+
/** Background gradient (CSS gradient value) */
|
|
120
|
+
bgGradient?: string;
|
|
121
|
+
/** Glow effect configuration */
|
|
122
|
+
glow?: GlowConfig;
|
|
123
|
+
/** Ring effect configuration (Instagram-style) */
|
|
124
|
+
ring?: RingConfig;
|
|
125
|
+
/** Presence indicator configuration */
|
|
126
|
+
presence?: PresenceConfig;
|
|
127
|
+
/** Ribbon configuration */
|
|
128
|
+
ribbon?: RibbonConfig;
|
|
129
|
+
/** Badge configuration */
|
|
130
|
+
badge?: BadgeConfig;
|
|
131
|
+
/** Loading strategy */
|
|
132
|
+
loading?: LoadingStrategy;
|
|
133
|
+
/** Placeholder type while loading */
|
|
134
|
+
placeholder?: PlaceholderType;
|
|
135
|
+
/** Placeholder background color */
|
|
136
|
+
placeholderColor?: string;
|
|
137
|
+
/** Custom fallback text (overrides initials from alt) */
|
|
138
|
+
fallback?: string;
|
|
139
|
+
/** Interactive behavior configuration */
|
|
140
|
+
interactive?: InteractionConfig;
|
|
141
|
+
}
|
|
90
142
|
/** Direction for stacking avatars */
|
|
91
143
|
type StackDirection = "ltr" | "rtl";
|
|
92
144
|
/** Tooltip position relative to avatar */
|
|
@@ -162,6 +214,27 @@ interface ProfilePictureGroupProps$1 {
|
|
|
162
214
|
animated?: boolean;
|
|
163
215
|
}
|
|
164
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Profile Picture Component - Utility Functions
|
|
219
|
+
* Apple-inspired design system utilities
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Get CDN size label from pixel size (rounds up to next available size)
|
|
224
|
+
* CDN sizes: 80, 120, 240, 480, 960
|
|
225
|
+
*/
|
|
226
|
+
declare function getCdnSizeLabel(pixelSize: number): "80" | "120" | "240" | "480" | "960";
|
|
227
|
+
/**
|
|
228
|
+
* Detect theme (dark/light) from background color using luminance calculation
|
|
229
|
+
* Returns 'light' for non-hex colors or when luminance > 0.5
|
|
230
|
+
*/
|
|
231
|
+
declare function detectThemeFromColor(bgColor?: string): "dark" | "light";
|
|
232
|
+
/**
|
|
233
|
+
* Construct CDN URL for profile picture
|
|
234
|
+
* Format: {baseUrl}/api/profile-picture/cdn/{extId}_{size}_{theme}.webp?hostname={hostname}
|
|
235
|
+
*/
|
|
236
|
+
declare function constructCdnUrl(baseUrl: string, extCustomerId: string, sizeLabel: "80" | "120" | "240" | "480" | "960", theme: "dark" | "light", hostname: string): string;
|
|
237
|
+
|
|
165
238
|
declare class ProfilePicture$1 extends LitElement {
|
|
166
239
|
private static stylesInjected;
|
|
167
240
|
private static cdnBaseUrl;
|
|
@@ -237,27 +310,6 @@ declare global {
|
|
|
237
310
|
}
|
|
238
311
|
}
|
|
239
312
|
|
|
240
|
-
/**
|
|
241
|
-
* Profile Picture Component - Utility Functions
|
|
242
|
-
* Apple-inspired design system utilities
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Get CDN size label from pixel size (rounds up to next available size)
|
|
247
|
-
* CDN sizes: 80, 120, 240, 480, 960
|
|
248
|
-
*/
|
|
249
|
-
declare function getCdnSizeLabel(pixelSize: number): "80" | "120" | "240" | "480" | "960";
|
|
250
|
-
/**
|
|
251
|
-
* Detect theme (dark/light) from background color using luminance calculation
|
|
252
|
-
* Returns 'light' for non-hex colors or when luminance > 0.5
|
|
253
|
-
*/
|
|
254
|
-
declare function detectThemeFromColor(bgColor?: string): "dark" | "light";
|
|
255
|
-
/**
|
|
256
|
-
* Construct CDN URL for profile picture
|
|
257
|
-
* Format: {baseUrl}/api/profile-picture/cdn/{extId}_{size}_{theme}.webp?hostname={hostname}
|
|
258
|
-
*/
|
|
259
|
-
declare function constructCdnUrl(baseUrl: string, extCustomerId: string, sizeLabel: "80" | "120" | "240" | "480" | "960", theme: "dark" | "light", hostname: string): string;
|
|
260
|
-
|
|
261
313
|
declare class ProfilePictureGroup$1 extends LitElement {
|
|
262
314
|
protected createRenderRoot(): this;
|
|
263
315
|
max: 4;
|
|
@@ -276,6 +328,8 @@ declare class ProfilePictureGroup$1 extends LitElement {
|
|
|
276
328
|
private tooltipData;
|
|
277
329
|
private tooltipTimeout;
|
|
278
330
|
private slotObserver;
|
|
331
|
+
private portalContainer;
|
|
332
|
+
private counterRef;
|
|
279
333
|
private get pixelSize();
|
|
280
334
|
private get tooltipEnabled();
|
|
281
335
|
private get tooltipPosition();
|
|
@@ -287,6 +341,9 @@ declare class ProfilePictureGroup$1 extends LitElement {
|
|
|
287
341
|
disconnectedCallback(): void;
|
|
288
342
|
private setupSlotObserver;
|
|
289
343
|
private updateUsers;
|
|
344
|
+
private createPortal;
|
|
345
|
+
private destroyPortal;
|
|
346
|
+
private updatePortalContent;
|
|
290
347
|
private handleAvatarClick;
|
|
291
348
|
private handleAvatarHover;
|
|
292
349
|
private handleAvatarLeave;
|
|
@@ -301,9 +358,9 @@ declare class ProfilePictureGroup$1 extends LitElement {
|
|
|
301
358
|
private renderCounter;
|
|
302
359
|
private renderAddButton;
|
|
303
360
|
private renderTooltip;
|
|
304
|
-
private renderDropdown;
|
|
305
361
|
private renderDropdownItem;
|
|
306
362
|
private formatStatus;
|
|
363
|
+
protected updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
307
364
|
render(): lit_html.TemplateResult<1>;
|
|
308
365
|
}
|
|
309
366
|
|
|
@@ -363,6 +420,8 @@ interface ProfilePictureGroupProps {
|
|
|
363
420
|
addButtonLabel?: string;
|
|
364
421
|
/** Enable hover lift animation (default: true) */
|
|
365
422
|
animated?: boolean;
|
|
423
|
+
/** Alternating rotation amount in degrees (0 = no rotation) */
|
|
424
|
+
rotationAmount?: number;
|
|
366
425
|
/** Called when an avatar is clicked */
|
|
367
426
|
onAvatarClick?: (user: GroupUserData) => void;
|
|
368
427
|
/** Called when hovering over an avatar */
|
|
@@ -413,32 +472,60 @@ declare const ProfilePictureGroup: React.ForwardRefExoticComponent<ProfilePictur
|
|
|
413
472
|
* ```
|
|
414
473
|
*/
|
|
415
474
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
border?: boolean;
|
|
422
|
-
borderWidth?: 1 | 2 | 3 | 4;
|
|
423
|
-
borderColor?: string;
|
|
424
|
-
bgColor?: string;
|
|
425
|
-
bgGradient?: string;
|
|
426
|
-
ribbon?: RibbonConfig;
|
|
427
|
-
badge?: BadgeConfig;
|
|
428
|
-
loading?: LoadingStrategy;
|
|
429
|
-
placeholder?: PlaceholderType;
|
|
430
|
-
placeholderColor?: string;
|
|
431
|
-
fallback?: string;
|
|
475
|
+
/**
|
|
476
|
+
* React-specific props extending the core ProfilePictureProps
|
|
477
|
+
*/
|
|
478
|
+
interface ProfilePictureProps extends ProfilePictureProps$1 {
|
|
479
|
+
/** Called when image loads successfully */
|
|
432
480
|
onLoad?: () => void;
|
|
481
|
+
/** Called when image fails to load */
|
|
433
482
|
onError?: () => void;
|
|
483
|
+
/** Called when CDN image fails to load */
|
|
484
|
+
onCdnError?: (detail: {
|
|
485
|
+
error: string;
|
|
486
|
+
}) => void;
|
|
487
|
+
/** Additional CSS class names */
|
|
434
488
|
className?: string;
|
|
489
|
+
/** Inline styles */
|
|
435
490
|
style?: React.CSSProperties;
|
|
436
491
|
}
|
|
437
492
|
/**
|
|
438
493
|
* ProfilePicture React Component
|
|
439
494
|
*
|
|
440
|
-
* Type-safe wrapper around the profile-picture web component
|
|
495
|
+
* Type-safe wrapper around the profile-picture web component.
|
|
496
|
+
* Uses ref as a prop (React 19+ pattern).
|
|
441
497
|
*/
|
|
442
|
-
declare
|
|
498
|
+
declare function ProfilePicture({ src, alt, extCustomerId, size, variant, shadow, border, borderWidth, borderColor, rotation, bgColor, bgGradient, glow, ring, presence, ribbon, badge, loading, placeholder, placeholderColor, fallback, interactive, onLoad, onError, onCdnError, className, style, ref, }: ProfilePictureProps & {
|
|
499
|
+
ref?: React.Ref<HTMLElement>;
|
|
500
|
+
}): React.ReactElement<{
|
|
501
|
+
ref: React.RefObject<HTMLElement>;
|
|
502
|
+
src: string | undefined;
|
|
503
|
+
alt: string | undefined;
|
|
504
|
+
"ext-customer-id": string | undefined;
|
|
505
|
+
size: number | Size | undefined;
|
|
506
|
+
variant: Variant | undefined;
|
|
507
|
+
shadow: ShadowPreset | undefined;
|
|
508
|
+
border: true | undefined;
|
|
509
|
+
"border-width": 1 | 2 | 3 | 4 | 5 | 6 | 8 | undefined;
|
|
510
|
+
"border-color": string | undefined;
|
|
511
|
+
rotation: number | undefined;
|
|
512
|
+
"bg-color": string | undefined;
|
|
513
|
+
"bg-gradient": string | undefined;
|
|
514
|
+
glow: string | undefined;
|
|
515
|
+
ring: string | undefined;
|
|
516
|
+
presence: string | undefined;
|
|
517
|
+
ribbon: string | undefined;
|
|
518
|
+
badge: string | undefined;
|
|
519
|
+
loading: LoadingStrategy | undefined;
|
|
520
|
+
placeholder: PlaceholderType | undefined;
|
|
521
|
+
"placeholder-color": string | undefined;
|
|
522
|
+
fallback: string | undefined;
|
|
523
|
+
interactive: string | undefined;
|
|
524
|
+
class: string | undefined;
|
|
525
|
+
style: React.CSSProperties | undefined;
|
|
526
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
527
|
+
declare namespace ProfilePicture {
|
|
528
|
+
var displayName: string;
|
|
529
|
+
}
|
|
443
530
|
|
|
444
|
-
export { type BadgeConfig, type DropdownConfig, type GroupUserData, type LoadingStrategy, type PlaceholderType, type Position, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps
|
|
531
|
+
export { type BadgeConfig, type ProfilePictureGroupProps$1 as CoreProfilePictureGroupProps, type ProfilePictureProps$1 as CoreProfilePictureProps, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RibbonConfig, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, constructCdnUrl, detectThemeFromColor, getCdnSizeLabel };
|