@grasco/profile-picture 0.1.0
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 +385 -0
- package/dist/angular.cjs +353 -0
- package/dist/angular.cjs.map +1 -0
- package/dist/angular.d.cts +132 -0
- package/dist/angular.d.ts +132 -0
- package/dist/angular.js +353 -0
- package/dist/angular.js.map +1 -0
- package/dist/index.cjs +885 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +389 -0
- package/dist/index.d.ts +389 -0
- package/dist/index.js +885 -0
- package/dist/index.js.map +1 -0
- package/dist/standalone.d.ts +260 -0
- package/dist/standalone.standalone.js +952 -0
- package/dist/standalone.standalone.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/svelte.cjs +353 -0
- package/dist/svelte.cjs.map +1 -0
- package/dist/svelte.d.cts +132 -0
- package/dist/svelte.d.ts +132 -0
- package/dist/svelte.js +353 -0
- package/dist/svelte.js.map +1 -0
- package/dist/vue.cjs +353 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.cts +132 -0
- package/dist/vue.d.ts +132 -0
- package/dist/vue.js +353 -0
- package/dist/vue.js.map +1 -0
- package/package.json +130 -0
- package/tailwind.safelist.js +90 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Profile Picture Component - Type Definitions
|
|
6
|
+
* Apple-inspired design system with modern 2025 aesthetics
|
|
7
|
+
*/
|
|
8
|
+
type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
9
|
+
type Variant = "circle" | "rounded" | "squircle" | "square";
|
|
10
|
+
type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
11
|
+
type LoadingStrategy = "lazy" | "eager";
|
|
12
|
+
type PlaceholderType = "shimmer" | "pulse" | "blur" | "skeleton" | "none";
|
|
13
|
+
type PresenceStatus = "online" | "away" | "busy" | "offline" | "dnd";
|
|
14
|
+
interface PresenceConfig {
|
|
15
|
+
/** Current status */
|
|
16
|
+
status: PresenceStatus;
|
|
17
|
+
/** Show animated ring */
|
|
18
|
+
animate?: boolean;
|
|
19
|
+
/** Ring thickness (1-3) */
|
|
20
|
+
thickness?: 1 | 2 | 3;
|
|
21
|
+
}
|
|
22
|
+
interface RibbonConfig {
|
|
23
|
+
/** Text displayed on the ribbon */
|
|
24
|
+
text: string;
|
|
25
|
+
/** Position of the ribbon */
|
|
26
|
+
position?: Position;
|
|
27
|
+
/** Text color (CSS color) */
|
|
28
|
+
color?: string;
|
|
29
|
+
/** Background color (CSS color or gradient) */
|
|
30
|
+
bgColor?: string;
|
|
31
|
+
/** Icon before text (emoji or symbol) */
|
|
32
|
+
icon?: string;
|
|
33
|
+
}
|
|
34
|
+
interface BadgeConfig {
|
|
35
|
+
/** Badge content (text, number, or empty for dot) */
|
|
36
|
+
content?: string | number;
|
|
37
|
+
/** Position of the badge */
|
|
38
|
+
position?: Position;
|
|
39
|
+
/** Text/icon color */
|
|
40
|
+
color?: string;
|
|
41
|
+
/** Background color */
|
|
42
|
+
bgColor?: string;
|
|
43
|
+
/** Enable pulse animation */
|
|
44
|
+
pulse?: boolean;
|
|
45
|
+
/** Enable glow effect */
|
|
46
|
+
glow?: boolean;
|
|
47
|
+
/** Max value to display (shows 99+ if exceeded) */
|
|
48
|
+
max?: number;
|
|
49
|
+
}
|
|
50
|
+
interface GlowConfig {
|
|
51
|
+
/** Glow color (defaults to border or bg color) */
|
|
52
|
+
color?: string;
|
|
53
|
+
/** Intensity (0-1) */
|
|
54
|
+
intensity?: number;
|
|
55
|
+
/** Animate the glow */
|
|
56
|
+
animate?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface RingConfig {
|
|
59
|
+
/** Show ring */
|
|
60
|
+
show: boolean;
|
|
61
|
+
/** Ring color or gradient */
|
|
62
|
+
color?: string;
|
|
63
|
+
/** Gradient colors for multi-color ring */
|
|
64
|
+
gradient?: string[];
|
|
65
|
+
/** Ring width */
|
|
66
|
+
width?: number;
|
|
67
|
+
/** Gap between ring and avatar */
|
|
68
|
+
gap?: number;
|
|
69
|
+
/** Animate (rotate for gradient) */
|
|
70
|
+
animate?: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface InteractionConfig {
|
|
73
|
+
/** Enable hover effects */
|
|
74
|
+
hoverable?: boolean;
|
|
75
|
+
/** Enable press/click effects */
|
|
76
|
+
pressable?: boolean;
|
|
77
|
+
/** Show focus ring on focus */
|
|
78
|
+
focusable?: boolean;
|
|
79
|
+
/** Cursor style */
|
|
80
|
+
cursor?: "pointer" | "default" | "zoom-in";
|
|
81
|
+
}
|
|
82
|
+
type ShadowPreset = "none" | "sm" | "md" | "lg" | "glow";
|
|
83
|
+
|
|
84
|
+
declare class ProfilePicture extends LitElement {
|
|
85
|
+
private static stylesInjected;
|
|
86
|
+
protected createRenderRoot(): this;
|
|
87
|
+
private static injectStylesOnce;
|
|
88
|
+
src: string;
|
|
89
|
+
alt: string;
|
|
90
|
+
size: Size | string;
|
|
91
|
+
variant: Variant;
|
|
92
|
+
shadow: ShadowPreset;
|
|
93
|
+
border: boolean;
|
|
94
|
+
borderWidth: 1 | 2 | 3 | 4;
|
|
95
|
+
borderColor: string;
|
|
96
|
+
bgColor?: string;
|
|
97
|
+
bgGradient?: string;
|
|
98
|
+
ring?: RingConfig;
|
|
99
|
+
presence?: PresenceConfig;
|
|
100
|
+
glow?: GlowConfig;
|
|
101
|
+
ribbon?: RibbonConfig;
|
|
102
|
+
badge?: BadgeConfig;
|
|
103
|
+
loading: LoadingStrategy;
|
|
104
|
+
placeholder: PlaceholderType;
|
|
105
|
+
placeholderColor: string;
|
|
106
|
+
fallback?: string;
|
|
107
|
+
interactive?: InteractionConfig;
|
|
108
|
+
private isLoaded;
|
|
109
|
+
private hasError;
|
|
110
|
+
private previousSrc;
|
|
111
|
+
private get pixelSize();
|
|
112
|
+
protected willUpdate(changedProperties: Map<string, unknown>): void;
|
|
113
|
+
private handleLoad;
|
|
114
|
+
private handleError;
|
|
115
|
+
private getContainerStyles;
|
|
116
|
+
private renderPlaceholder;
|
|
117
|
+
private renderFallback;
|
|
118
|
+
private renderImage;
|
|
119
|
+
private renderRing;
|
|
120
|
+
private renderPresence;
|
|
121
|
+
private renderBadge;
|
|
122
|
+
private renderRibbon;
|
|
123
|
+
render(): lit_html.TemplateResult<1>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare global {
|
|
127
|
+
interface HTMLElementTagNameMap {
|
|
128
|
+
"profile-picture": ProfilePicture;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type { BadgeConfig, LoadingStrategy, PlaceholderType, Position, RibbonConfig, Size, Variant };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Profile Picture Component - Type Definitions
|
|
6
|
+
* Apple-inspired design system with modern 2025 aesthetics
|
|
7
|
+
*/
|
|
8
|
+
type Size = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
9
|
+
type Variant = "circle" | "rounded" | "squircle" | "square";
|
|
10
|
+
type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
11
|
+
type LoadingStrategy = "lazy" | "eager";
|
|
12
|
+
type PlaceholderType = "shimmer" | "pulse" | "blur" | "skeleton" | "none";
|
|
13
|
+
type PresenceStatus = "online" | "away" | "busy" | "offline" | "dnd";
|
|
14
|
+
interface PresenceConfig {
|
|
15
|
+
/** Current status */
|
|
16
|
+
status: PresenceStatus;
|
|
17
|
+
/** Show animated ring */
|
|
18
|
+
animate?: boolean;
|
|
19
|
+
/** Ring thickness (1-3) */
|
|
20
|
+
thickness?: 1 | 2 | 3;
|
|
21
|
+
}
|
|
22
|
+
interface RibbonConfig {
|
|
23
|
+
/** Text displayed on the ribbon */
|
|
24
|
+
text: string;
|
|
25
|
+
/** Position of the ribbon */
|
|
26
|
+
position?: Position;
|
|
27
|
+
/** Text color (CSS color) */
|
|
28
|
+
color?: string;
|
|
29
|
+
/** Background color (CSS color or gradient) */
|
|
30
|
+
bgColor?: string;
|
|
31
|
+
/** Icon before text (emoji or symbol) */
|
|
32
|
+
icon?: string;
|
|
33
|
+
}
|
|
34
|
+
interface BadgeConfig {
|
|
35
|
+
/** Badge content (text, number, or empty for dot) */
|
|
36
|
+
content?: string | number;
|
|
37
|
+
/** Position of the badge */
|
|
38
|
+
position?: Position;
|
|
39
|
+
/** Text/icon color */
|
|
40
|
+
color?: string;
|
|
41
|
+
/** Background color */
|
|
42
|
+
bgColor?: string;
|
|
43
|
+
/** Enable pulse animation */
|
|
44
|
+
pulse?: boolean;
|
|
45
|
+
/** Enable glow effect */
|
|
46
|
+
glow?: boolean;
|
|
47
|
+
/** Max value to display (shows 99+ if exceeded) */
|
|
48
|
+
max?: number;
|
|
49
|
+
}
|
|
50
|
+
interface GlowConfig {
|
|
51
|
+
/** Glow color (defaults to border or bg color) */
|
|
52
|
+
color?: string;
|
|
53
|
+
/** Intensity (0-1) */
|
|
54
|
+
intensity?: number;
|
|
55
|
+
/** Animate the glow */
|
|
56
|
+
animate?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface RingConfig {
|
|
59
|
+
/** Show ring */
|
|
60
|
+
show: boolean;
|
|
61
|
+
/** Ring color or gradient */
|
|
62
|
+
color?: string;
|
|
63
|
+
/** Gradient colors for multi-color ring */
|
|
64
|
+
gradient?: string[];
|
|
65
|
+
/** Ring width */
|
|
66
|
+
width?: number;
|
|
67
|
+
/** Gap between ring and avatar */
|
|
68
|
+
gap?: number;
|
|
69
|
+
/** Animate (rotate for gradient) */
|
|
70
|
+
animate?: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface InteractionConfig {
|
|
73
|
+
/** Enable hover effects */
|
|
74
|
+
hoverable?: boolean;
|
|
75
|
+
/** Enable press/click effects */
|
|
76
|
+
pressable?: boolean;
|
|
77
|
+
/** Show focus ring on focus */
|
|
78
|
+
focusable?: boolean;
|
|
79
|
+
/** Cursor style */
|
|
80
|
+
cursor?: "pointer" | "default" | "zoom-in";
|
|
81
|
+
}
|
|
82
|
+
type ShadowPreset = "none" | "sm" | "md" | "lg" | "glow";
|
|
83
|
+
|
|
84
|
+
declare class ProfilePicture extends LitElement {
|
|
85
|
+
private static stylesInjected;
|
|
86
|
+
protected createRenderRoot(): this;
|
|
87
|
+
private static injectStylesOnce;
|
|
88
|
+
src: string;
|
|
89
|
+
alt: string;
|
|
90
|
+
size: Size | string;
|
|
91
|
+
variant: Variant;
|
|
92
|
+
shadow: ShadowPreset;
|
|
93
|
+
border: boolean;
|
|
94
|
+
borderWidth: 1 | 2 | 3 | 4;
|
|
95
|
+
borderColor: string;
|
|
96
|
+
bgColor?: string;
|
|
97
|
+
bgGradient?: string;
|
|
98
|
+
ring?: RingConfig;
|
|
99
|
+
presence?: PresenceConfig;
|
|
100
|
+
glow?: GlowConfig;
|
|
101
|
+
ribbon?: RibbonConfig;
|
|
102
|
+
badge?: BadgeConfig;
|
|
103
|
+
loading: LoadingStrategy;
|
|
104
|
+
placeholder: PlaceholderType;
|
|
105
|
+
placeholderColor: string;
|
|
106
|
+
fallback?: string;
|
|
107
|
+
interactive?: InteractionConfig;
|
|
108
|
+
private isLoaded;
|
|
109
|
+
private hasError;
|
|
110
|
+
private previousSrc;
|
|
111
|
+
private get pixelSize();
|
|
112
|
+
protected willUpdate(changedProperties: Map<string, unknown>): void;
|
|
113
|
+
private handleLoad;
|
|
114
|
+
private handleError;
|
|
115
|
+
private getContainerStyles;
|
|
116
|
+
private renderPlaceholder;
|
|
117
|
+
private renderFallback;
|
|
118
|
+
private renderImage;
|
|
119
|
+
private renderRing;
|
|
120
|
+
private renderPresence;
|
|
121
|
+
private renderBadge;
|
|
122
|
+
private renderRibbon;
|
|
123
|
+
render(): lit_html.TemplateResult<1>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare global {
|
|
127
|
+
interface HTMLElementTagNameMap {
|
|
128
|
+
"profile-picture": ProfilePicture;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type { BadgeConfig, LoadingStrategy, PlaceholderType, Position, RibbonConfig, Size, Variant };
|
package/dist/angular.js
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import {LitElement,nothing,html}from'lit';import {property,state,customElement}from'lit/decorators.js';import {styleMap}from'lit/directives/style-map.js';var H=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var a=(t,r,e,n)=>{for(var i=n>1?void 0:n?W(r,e):r,p=t.length-1,l;p>=0;p--)(l=t[p])&&(i=(n?l(r,e,i):l(i))||i);return n&&i&&H(r,e,i),i};var C="grasco-profile-picture-styles",x=false;function k(){if(x||typeof document>"u")return;if(document.getElementById(C)){x=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){x=true;return}let r=Y();if(!r)return;let e=document.createElement("link");e.id=C,e.rel="stylesheet",e.href=r,document.head.appendChild(e),x=true;}function Y(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let r=import.meta.url;if(r)return `${r.substring(0,r.lastIndexOf("/")+1)}styles.css`}catch{}let t=document.currentScript;if(t?.src){let r=new URL(t.src);return `${r.href.substring(0,r.href.lastIndexOf("/")+1)}styles.css`}return null}var w={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},z={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},$={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",glow:"0 0 20px 0 rgba(99, 102, 241, 0.3)"},c={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var m={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"};function f(...t){return t.filter(Boolean).join(" ")}function y(t){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(t)}function R(t){return {"top-left":"np:top-0 np:left-0","top-right":"np:top-0 np:right-0","bottom-left":"np:bottom-0 np:left-0","bottom-right":"np:bottom-0 np:right-0"}[t]}function I(t){return {"top-left":"np:-rotate-45 np:-translate-x-1/4 np:-translate-y-1/2","top-right":"np:rotate-45 np:translate-x-1/4 np:-translate-y-1/2","bottom-left":"np:rotate-45 np:-translate-x-1/4 np:translate-y-1/2","bottom-right":"np:-rotate-45 np:translate-x-1/4 np:translate-y-1/2"}[t]}function A(t){let e=t.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].slice(0,1).toUpperCase():(e[0][0]+e[e.length-1][0]).toUpperCase()}function S(t){return Math.round(t*.38)}function E(t,r){let n=Math.max(r?18:10,Math.round(t*(r?.32:.22))),i=Math.round(n*.6);return {size:n,fontSize:i}}function M(t,r){return Math.max(8,Math.round(t*.25))+(r-1)*2}function L(t,r){return typeof t=="string"?t:r&&t>r?`${r}+`:t.toString()}function D(t){return t.length===0?"transparent":t.length===1?t[0]:`conic-gradient(${t.map((e,n)=>{let i=n/t.length*360,p=(n+1)/t.length*360;return `${e} ${i}deg ${p}deg`}).join(", ")})`}function q(t){let r=0;for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);r=(r<<5)-r+n,r&=r;}return Math.abs(r)}function F(t){let r=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)"],e=q(t)%r.length;return r[e]}function B(t){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[t]}function T(t,r){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4"}[t],style:{borderColor:r,borderStyle:"solid"}}}function G(t,r){return r?{className:"",style:{background:r}}:t?t.includes("gradient")?{className:"",style:{background:t}}:{className:"",style:{backgroundColor:t}}:{className:"np:bg-gray-100"}}function U(t){return {boxShadow:$[t]}}var Z={shimmer:`
|
|
2
|
+
@keyframes pp-shimmer {
|
|
3
|
+
0% { transform: translateX(-100%); }
|
|
4
|
+
100% { transform: translateX(100%); }
|
|
5
|
+
}`,pulse:`
|
|
6
|
+
@keyframes pp-pulse {
|
|
7
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
8
|
+
50% { opacity: 0.7; transform: scale(0.98); }
|
|
9
|
+
}`,skeleton:`
|
|
10
|
+
@keyframes pp-skeleton {
|
|
11
|
+
0%, 100% { opacity: 1; }
|
|
12
|
+
50% { opacity: 0.5; }
|
|
13
|
+
}`,badgeBounce:`
|
|
14
|
+
@keyframes pp-badge-bounce {
|
|
15
|
+
0% { transform: scale(0) translateY(10px); opacity: 0; }
|
|
16
|
+
50% { transform: scale(1.2) translateY(-2px); }
|
|
17
|
+
100% { transform: scale(1) translateY(0); opacity: 1; }
|
|
18
|
+
}`,ringRotate:`
|
|
19
|
+
@keyframes pp-ring-rotate {
|
|
20
|
+
from { transform: rotate(0deg); }
|
|
21
|
+
to { transform: rotate(360deg); }
|
|
22
|
+
}`,presencePulse:`
|
|
23
|
+
@keyframes pp-presence-pulse {
|
|
24
|
+
0%, 100% { box-shadow: 0 0 0 0 currentColor; }
|
|
25
|
+
50% { box-shadow: 0 0 0 4px transparent; }
|
|
26
|
+
}`,glow:`
|
|
27
|
+
@keyframes pp-glow {
|
|
28
|
+
0%, 100% { box-shadow: 0 0 20px 0 var(--pp-glow-color, rgba(99, 102, 241, 0.3)); }
|
|
29
|
+
50% { box-shadow: 0 0 30px 5px var(--pp-glow-color, rgba(99, 102, 241, 0.5)); }
|
|
30
|
+
}`,fadeIn:`
|
|
31
|
+
@keyframes pp-fade-in {
|
|
32
|
+
from { opacity: 0; }
|
|
33
|
+
to { opacity: 1; }
|
|
34
|
+
}`,scaleIn:`
|
|
35
|
+
@keyframes pp-scale-in {
|
|
36
|
+
0% { transform: scale(0.8); opacity: 0; }
|
|
37
|
+
50% { transform: scale(1.05); }
|
|
38
|
+
100% { transform: scale(1); opacity: 1; }
|
|
39
|
+
}`},_=Object.values(Z).join(`
|
|
40
|
+
`),K=`
|
|
41
|
+
/* Profile Picture Component Styles */
|
|
42
|
+
.pp-container {
|
|
43
|
+
--pp-transition-duration: 200ms;
|
|
44
|
+
--pp-transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
45
|
+
--pp-spring-timing: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
46
|
+
position: relative;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
user-select: none;
|
|
51
|
+
-webkit-user-select: none;
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Inner container for image clipping - allows badges/rings to overflow */
|
|
56
|
+
.pp-inner {
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset: 0;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
border-radius: inherit;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Interactive states */
|
|
64
|
+
.pp-interactive {
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
transition: transform var(--pp-transition-duration) var(--pp-spring-timing),
|
|
67
|
+
box-shadow var(--pp-transition-duration) var(--pp-transition-timing);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.pp-interactive:hover {
|
|
71
|
+
transform: scale(1.05);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pp-interactive:active {
|
|
75
|
+
transform: scale(0.95);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.pp-interactive:focus-visible {
|
|
79
|
+
outline: none;
|
|
80
|
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Image styles */
|
|
84
|
+
.pp-image {
|
|
85
|
+
position: absolute;
|
|
86
|
+
inset: 0;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
object-fit: cover;
|
|
90
|
+
transition: opacity var(--pp-transition-duration) var(--pp-transition-timing);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pp-image-loading {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pp-image-loaded {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Fallback styles */
|
|
102
|
+
.pp-fallback {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
color: rgba(255, 255, 255, 0.9);
|
|
110
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
111
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
|
|
112
|
+
letter-spacing: 0.02em;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.pp-fallback-icon {
|
|
116
|
+
color: rgba(156, 163, 175, 0.8);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Shimmer placeholder */
|
|
120
|
+
.pp-shimmer {
|
|
121
|
+
position: absolute;
|
|
122
|
+
inset: 0;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.pp-shimmer::after {
|
|
127
|
+
content: '';
|
|
128
|
+
position: absolute;
|
|
129
|
+
inset: 0;
|
|
130
|
+
background: linear-gradient(
|
|
131
|
+
90deg,
|
|
132
|
+
transparent 0%,
|
|
133
|
+
rgba(255, 255, 255, 0.4) 50%,
|
|
134
|
+
transparent 100%
|
|
135
|
+
);
|
|
136
|
+
animation: pp-shimmer 1.5s infinite;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Pulse placeholder */
|
|
140
|
+
.pp-pulse {
|
|
141
|
+
animation: pp-pulse 2s ease-in-out infinite;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Skeleton placeholder */
|
|
145
|
+
.pp-skeleton {
|
|
146
|
+
background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
|
|
147
|
+
background-size: 200% 100%;
|
|
148
|
+
animation: pp-skeleton 1.5s ease-in-out infinite;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Badge styles */
|
|
152
|
+
.pp-badge {
|
|
153
|
+
position: absolute;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
border-radius: 9999px;
|
|
158
|
+
font-weight: 600;
|
|
159
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
|
|
160
|
+
line-height: 1;
|
|
161
|
+
animation: pp-badge-bounce 0.4s var(--pp-spring-timing);
|
|
162
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
|
163
|
+
border: 2px solid white;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.pp-badge-pulse {
|
|
167
|
+
animation: pp-badge-bounce 0.4s var(--pp-spring-timing),
|
|
168
|
+
pp-presence-pulse 2s ease-in-out infinite 0.4s;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.pp-badge-glow {
|
|
172
|
+
box-shadow: 0 0 10px 2px var(--pp-badge-glow-color, currentColor);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Ribbon styles */
|
|
176
|
+
.pp-ribbon-container {
|
|
177
|
+
position: absolute;
|
|
178
|
+
z-index: 10;
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.pp-ribbon {
|
|
183
|
+
position: absolute;
|
|
184
|
+
width: 100%;
|
|
185
|
+
text-align: center;
|
|
186
|
+
font-weight: 600;
|
|
187
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
|
|
188
|
+
text-transform: uppercase;
|
|
189
|
+
letter-spacing: 0.05em;
|
|
190
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Ring effect (Instagram-style) */
|
|
194
|
+
.pp-ring {
|
|
195
|
+
position: absolute;
|
|
196
|
+
inset: -4px;
|
|
197
|
+
border-radius: inherit;
|
|
198
|
+
padding: 3px;
|
|
199
|
+
background: var(--pp-ring-color, linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888));
|
|
200
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
201
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
202
|
+
-webkit-mask-composite: xor;
|
|
203
|
+
mask-composite: exclude;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.pp-ring-animated {
|
|
207
|
+
animation: pp-ring-rotate 3s linear infinite;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Presence indicator */
|
|
211
|
+
.pp-presence {
|
|
212
|
+
position: absolute;
|
|
213
|
+
bottom: 0;
|
|
214
|
+
right: 0;
|
|
215
|
+
border-radius: 9999px;
|
|
216
|
+
border: 2px solid white;
|
|
217
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.pp-presence-animated {
|
|
221
|
+
animation: pp-presence-pulse 2s ease-in-out infinite;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Glow effect */
|
|
225
|
+
.pp-glow {
|
|
226
|
+
animation: pp-glow 2s ease-in-out infinite;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Reduced motion support */
|
|
230
|
+
@media (prefers-reduced-motion: reduce) {
|
|
231
|
+
.pp-container,
|
|
232
|
+
.pp-interactive,
|
|
233
|
+
.pp-image,
|
|
234
|
+
.pp-shimmer::after,
|
|
235
|
+
.pp-pulse,
|
|
236
|
+
.pp-skeleton,
|
|
237
|
+
.pp-badge,
|
|
238
|
+
.pp-ring-animated,
|
|
239
|
+
.pp-presence-animated,
|
|
240
|
+
.pp-glow {
|
|
241
|
+
animation: none !important;
|
|
242
|
+
transition: none !important;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
`,O=`${_}
|
|
246
|
+
${K}`,j=`
|
|
247
|
+
@keyframes np-shimmer {
|
|
248
|
+
0% { background-position: -200% 0; }
|
|
249
|
+
100% { background-position: 200% 0; }
|
|
250
|
+
}
|
|
251
|
+
.np-shimmer {
|
|
252
|
+
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
|
|
253
|
+
background-size: 200% 100%;
|
|
254
|
+
animation: np-shimmer 1.5s infinite;
|
|
255
|
+
}
|
|
256
|
+
`;function N(t,r=.3){if(y(t)){let e=Number.parseInt(t.slice(1,3),16),n=Number.parseInt(t.slice(3,5),16),i=Number.parseInt(t.slice(5,7),16);return `0 0 20px 0 rgba(${e}, ${n}, ${i}, ${r})`}return `0 0 20px 0 ${t}`}var o=class extends LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=c.size;this.variant=c.variant;this.shadow=c.shadow;this.border=false;this.borderWidth=c.borderWidth;this.borderColor=c.borderColor;this.loading=c.loading;this.placeholder=c.placeholder;this.placeholderColor=c.placeholderColor;this.isLoaded=false;this.hasError=false;this.previousSrc="";}createRenderRoot(){return o.injectStylesOnce(),this}static injectStylesOnce(){if(o.stylesInjected||typeof document>"u")return;let e=document.createElement("style");e.textContent=O,document.head.appendChild(e),o.stylesInjected=true;}get pixelSize(){let e=this.size;return typeof e=="number"?e:w[e]??w[c.size]}willUpdate(e){e.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src);}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}getContainerStyles(){let e=G(this.bgColor,this.bgGradient),n=this.border?T(this.borderWidth,this.borderColor):null,i=U(this.shadow),p={};if(this.glow){let u=this.glow.color??this.borderColor??"#6366f1";p={"--pp-glow-color":u,boxShadow:N(u,this.glow.intensity??.3)};}let l=this.interactive?.hoverable||this.interactive?.pressable;return {classes:f("pp-container",B(this.variant),e.className,n?.className,l&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:m[this.variant],...e.style,...n?.style,...i,...p,cursor:this.interactive?.cursor??(l?"pointer":"default")}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return nothing;let e={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return html`
|
|
257
|
+
${this.placeholder==="shimmer"?html`<style>${j}</style>`:nothing}
|
|
258
|
+
<div
|
|
259
|
+
class=${f("np:absolute np:inset-0",e)}
|
|
260
|
+
style=${styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
|
|
261
|
+
</div>
|
|
262
|
+
`}renderFallback(){if(this.fallback)return html`
|
|
263
|
+
<span
|
|
264
|
+
class="pp-fallback"
|
|
265
|
+
style=${styleMap({fontSize:`${S(this.pixelSize)}px`})}>
|
|
266
|
+
${this.fallback}
|
|
267
|
+
</span>
|
|
268
|
+
`;if(this.alt){let n=F(this.alt);return html`
|
|
269
|
+
<div
|
|
270
|
+
class="pp-fallback np:absolute np:inset-0"
|
|
271
|
+
style=${styleMap({background:this.bgColor??n,fontSize:`${S(this.pixelSize)}px`})}>
|
|
272
|
+
${A(this.alt)}
|
|
273
|
+
</div>
|
|
274
|
+
`}let e=this.pixelSize*.5;return html`
|
|
275
|
+
<svg
|
|
276
|
+
class="pp-fallback-icon"
|
|
277
|
+
style="width: ${e}px; height: ${e}px;"
|
|
278
|
+
fill="currentColor"
|
|
279
|
+
viewBox="0 0 24 24">
|
|
280
|
+
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
|
|
281
|
+
</svg>
|
|
282
|
+
`}renderImage(){return this.hasError||!this.src?this.renderFallback():html`
|
|
283
|
+
<img
|
|
284
|
+
src=${this.src}
|
|
285
|
+
alt=${this.alt}
|
|
286
|
+
loading=${this.loading}
|
|
287
|
+
decoding="async"
|
|
288
|
+
@load=${this.handleLoad}
|
|
289
|
+
@error=${this.handleError}
|
|
290
|
+
class=${f("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
|
|
291
|
+
draggable="false" />
|
|
292
|
+
`}renderRing(){if(!this.ring?.show)return nothing;let e=this.ring.width??3,n=this.ring.gap??3,i=e+n,p;return this.ring.gradient&&this.ring.gradient.length>0?p=D(this.ring.gradient):p=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)",html`
|
|
293
|
+
<div
|
|
294
|
+
class=${f("pp-ring",this.ring.animate&&"pp-ring-animated")}
|
|
295
|
+
style=${styleMap({inset:`-${i}px`,padding:`${e}px`,background:p,borderRadius:m[this.variant]})}>
|
|
296
|
+
</div>
|
|
297
|
+
`}renderPresence(){if(!this.presence)return nothing;let e=this.presence.thickness??2,n=M(this.pixelSize,e),i=z[this.presence.status],p=Math.max(0,this.pixelSize*.02);return html`
|
|
298
|
+
<div
|
|
299
|
+
class=${f("pp-presence",this.presence.animate&&"pp-presence-animated")}
|
|
300
|
+
style=${styleMap({width:`${n}px`,height:`${n}px`,backgroundColor:i,bottom:`${p}px`,right:`${p}px`,color:i})}
|
|
301
|
+
title=${this.presence.status}>
|
|
302
|
+
</div>
|
|
303
|
+
`}renderBadge(){if(!this.badge)return nothing;let e=this.badge.position??"bottom-right",n=this.badge.content!==void 0,{size:i,fontSize:p}=E(this.pixelSize,n),l=this.badge.bgColor??"#22c55e",u=this.badge.color??"#ffffff",v=n&&this.badge.content!==void 0?L(this.badge.content,this.badge.max):null,h={"top-left":{top:"-4px",left:"-4px"},"top-right":{top:"-4px",right:"-4px"},"bottom-left":{bottom:"-4px",left:"-4px"},"bottom-right":{bottom:"-4px",right:"-4px"}};return html`
|
|
304
|
+
<div
|
|
305
|
+
class=${f("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow")}
|
|
306
|
+
style=${styleMap({width:n?"auto":`${i}px`,minWidth:`${i}px`,height:`${i}px`,padding:n?"0 6px":"0",fontSize:`${p}px`,backgroundColor:l,color:u,"--pp-badge-glow-color":l,...h[e]})}>
|
|
307
|
+
${v??nothing}
|
|
308
|
+
</div>
|
|
309
|
+
`}renderRibbon(){if(!this.ribbon)return nothing;let e=this.ribbon.position??"top-right",n=this.ribbon.bgColor??"#ef4444",i=this.ribbon.color??"#ffffff",p=y(n)?{backgroundColor:n}:{background:n},l={color:i},u=this.pixelSize*.9,v=this.pixelSize*.4,h=Math.max(8,this.pixelSize*.11);return html`
|
|
310
|
+
<div
|
|
311
|
+
class=${f("pp-ribbon-container",R(e))}
|
|
312
|
+
style=${styleMap({width:`${u}px`,height:`${v}px`})}>
|
|
313
|
+
<div
|
|
314
|
+
class=${f("pp-ribbon np:origin-center np:transform",I(e))}
|
|
315
|
+
style=${styleMap({fontSize:`${h}px`,padding:`${h*.3}px 0`,...p,...l})}>
|
|
316
|
+
${this.ribbon.icon?html`<span style="margin-right: 2px">${this.ribbon.icon}</span>`:nothing}
|
|
317
|
+
${this.ribbon.text}
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
`}render(){let e=this.getContainerStyles(),n=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return html`
|
|
321
|
+
<div
|
|
322
|
+
class=${e.classes}
|
|
323
|
+
style=${styleMap(e.styles)}
|
|
324
|
+
tabindex=${n??nothing}
|
|
325
|
+
role=${this.interactive?.pressable?"button":nothing}
|
|
326
|
+
aria-label=${this.alt||nothing}
|
|
327
|
+
data-profile-picture>
|
|
328
|
+
|
|
329
|
+
<!-- Ring Effect (behind everything) -->
|
|
330
|
+
${this.renderRing()}
|
|
331
|
+
|
|
332
|
+
<!-- Inner container for image clipping -->
|
|
333
|
+
<div
|
|
334
|
+
class="pp-inner"
|
|
335
|
+
style=${styleMap({borderRadius:m[this.variant]})}>
|
|
336
|
+
<!-- Placeholder -->
|
|
337
|
+
${this.renderPlaceholder()}
|
|
338
|
+
|
|
339
|
+
<!-- Main Image or Fallback -->
|
|
340
|
+
${this.renderImage()}
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
<!-- Ribbon -->
|
|
344
|
+
${this.renderRibbon()}
|
|
345
|
+
|
|
346
|
+
<!-- Badge -->
|
|
347
|
+
${this.renderBadge()}
|
|
348
|
+
|
|
349
|
+
<!-- Presence Indicator -->
|
|
350
|
+
${this.renderPresence()}
|
|
351
|
+
</div>
|
|
352
|
+
`}};o.stylesInjected=false,a([property({type:String})],o.prototype,"src",2),a([property({type:String})],o.prototype,"alt",2),a([property({type:String})],o.prototype,"size",2),a([property({type:String})],o.prototype,"variant",2),a([property({type:String})],o.prototype,"shadow",2),a([property({type:Boolean})],o.prototype,"border",2),a([property({type:Number,attribute:"border-width"})],o.prototype,"borderWidth",2),a([property({type:String,attribute:"border-color"})],o.prototype,"borderColor",2),a([property({type:String,attribute:"bg-color"})],o.prototype,"bgColor",2),a([property({type:String,attribute:"bg-gradient"})],o.prototype,"bgGradient",2),a([property({type:Object,attribute:false})],o.prototype,"ring",2),a([property({type:Object,attribute:false})],o.prototype,"presence",2),a([property({type:Object,attribute:false})],o.prototype,"glow",2),a([property({type:Object,attribute:false})],o.prototype,"ribbon",2),a([property({type:Object,attribute:false})],o.prototype,"badge",2),a([property({type:String})],o.prototype,"loading",2),a([property({type:String})],o.prototype,"placeholder",2),a([property({type:String,attribute:"placeholder-color"})],o.prototype,"placeholderColor",2),a([property({type:String})],o.prototype,"fallback",2),a([property({type:Object,attribute:false})],o.prototype,"interactive",2),a([state()],o.prototype,"isLoaded",2),a([state()],o.prototype,"hasError",2),o=a([customElement("profile-picture")],o);k();//# sourceMappingURL=angular.js.map
|
|
353
|
+
//# sourceMappingURL=angular.js.map
|