@grasco/profile-picture 0.1.2 → 0.1.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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var zt=require('react'),lit=require('lit'),decorators_js=require('lit/decorators.js'),styleMap_js=require('lit/directives/style-map.js');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var zt__default=/*#__PURE__*/_interopDefault(zt);var Rt=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var s=(r,n,t,e)=>{for(var o=e>1?void 0:e?Tt(n,t):n,a=r.length-1,p;a>=0;a--)(p=r[a])&&(o=(e?p(n,t,o):p(o))||o);return e&&o&&Rt(n,t,o),o};var rt="grasco-profile-picture-styles",M=false;function nt(){if(M||typeof document>"u")return;if(document.getElementById(rt)){M=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){M=true;return}let n=Ut();if(!n)return;let t=document.createElement("link");t.id=rt,t.rel="stylesheet",t.href=n,document.head.appendChild(t),M=true;}function Ut(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href));if(n)return `${n.substring(0,n.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let n=new URL(r.src);return `${n.href.substring(0,n.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var D={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},ot={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},it={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 R={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},S={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function x(...r){return r.filter(Boolean).join(" ")}function L(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function at(r){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"}[r]}function st(r){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"}[r]}function O(r){let t=r.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,1).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function X(r){return Math.round(r*.38)}function pt(r,n){let e=Math.max(n?18:10,Math.round(r*(n?.32:.22))),o=Math.round(e*.6);return {size:e,fontSize:o}}function dt(r,n){return Math.max(8,Math.round(r*.25))+(n-1)*2}function lt(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function ct(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((t,e)=>{let o=e/r.length*360,a=(e+1)/r.length*360;return `${t} ${o}deg ${a}deg`}).join(", ")})`}function Lt(r){let n=0;for(let t=0;t<r.length;t++){let e=r.charCodeAt(t);n=(n<<5)-n+e,n&=n;}return Math.abs(n)}function gt(r,n,t){let o=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${n} 0deg ${o}deg, ${t} ${o}deg 360deg)`}function F(r){let n=["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%)"],t=Lt(r)%n.length;return n[t]}function ut(r){return typeof r=="number"?r:D[r]??D[S.size]}function bt(r,n,t){let e=t?n-1:n;if(r<=e)return {visible:r,hidden:0,showCounter:false};let o=e-1,a=r-o;return {visible:o,hidden:a,showCounter:true}}function N(r,n,t,e,o){let a=o??n*(1-t);return r*a}function ft(r,n,t){return t==="ltr"?n-r:r+1}function ht(r,n,t,e){if(r===0)return 0;if(r===1)return n;let o=e??n*(1-t);return n+o*(r-1)}function mt(r){return r>99?"+99":`+${r}`}function Q(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function P(r){if(!(r&&L(r)))return "light";let n=r.replace("#","");n.length===3&&(n=n.split("").map(p=>p+p).join(""));let t=Number.parseInt(n.slice(0,2),16),e=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return (.299*t+.587*e+.114*o)/255>.5?"light":"dark"}function _(r,n,t,e,o){let a=r.endsWith("/")?r.slice(0,-1):r,p=`${n}_${t}_${e}.webp`;return `${a}/api/profile-picture/cdn/${p}?hostname=${o}`}function xt(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function vt(r,n){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:n,borderStyle:"solid"}}}function yt(r,n){return n?{className:"",style:{background:n}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function wt(r){return {boxShadow:it[r]}}var Bt={shimmer:`
1
+ 'use strict';var Le=require('react'),lit=require('lit'),decorators_js=require('lit/decorators.js'),styleMap_js=require('lit/directives/style-map.js');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Le__default=/*#__PURE__*/_interopDefault(Le);var Oe=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var s=(r,n,e,t)=>{for(var o=t>1?void 0:t?Ge(n,e):n,i=r.length-1,p;i>=0;i--)(p=r[i])&&(o=(t?p(n,e,o):p(o))||o);return t&&o&&Oe(n,e,o),o};var ee="grasco-profile-picture-styles",F=false,ue=false;function ge(){if(F||typeof document>"u")return;if(document.getElementById(ee)){F=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){F=true;return}ue||(ue=true,Fe());}function Fe(){(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>Ne());}function Ne(){if(F||typeof document>"u")return;if(document.getElementById(ee)){F=true;return}let r=He();if(!r)return;let n=document.createElement("link");n.id=ee,n.rel="stylesheet",n.href=r,document.head.appendChild(n),F=true;}function He(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href));if(n)return `${n.substring(0,n.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let n=new URL(r.src);return `${n.href.substring(0,n.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var N={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},fe={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},me={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)"},$={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var H={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},I={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function R(...r){return r.filter(Boolean).join(" ")}function te(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function J(r){let e=r.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.at(-1)?.[0]??"")).toUpperCase()}function re(r){return Math.round(r*.38)}function he(r,n){let e;if(n){let o=Math.round(r*.31);e=Math.min(24,Math.max(14,o));}else {let o=Math.round(r*.22);e=Math.min(14,Math.max(8,o));}let t=Math.max(9,Math.round(e*.55));return {size:e,fontSize:t}}function be(r,n){let e=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,e+(n-1)*2)}function xe(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function ve(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((e,t)=>{let o=t/r.length*360,i=(t+1)/r.length*360;return `${e} ${o}deg ${i}deg`}).join(", ")})`}function je(r){let n=0;for(let e=0;e<r.length;e++){let t=r.charCodeAt(e);n=(n<<5)-n+t,n&=n;}return Math.abs(n)}function we(r,n,e){let o=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${n} 0deg ${o}deg, ${e} ${o}deg 360deg)`}function Y(r){let n=["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=je(r)%n.length;return n[e]}function ye(r){return typeof r=="number"?r:N[r]??N[I.size]}function ne(r,n,e){let t=e?n-1:n;if(r<=t)return {visible:r,hidden:0,showCounter:false};let o=t-1,i=r-o;return {visible:o,hidden:i,showCounter:true}}function K(r,n,e,t,o){let i=o??n*(1-e);return r*i}function Ce(r,n,e){return e==="ltr"?n-r:r+1}function Se(r,n,e,t){if(r===0)return 0;if(r===1)return n;let o=t??n*(1-e);return n+o*(r-1)}function ke(r){return r>99?"+99":`+${r}`}function oe(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function ie(r){if(!(r&&te(r)))return "light";let n=r.replace("#","");n.length===3&&(n=n.split("").map(p=>p+p).join(""));let e=Number.parseInt(n.slice(0,2),16),t=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return (.299*e+.587*t+.114*o)/255>.5?"light":"dark"}function ae(r,n,e,t,o){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${n}_${e}_${t}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${o}`}function $e(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function Ie(r,n){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:n,borderStyle:"solid"}}}function Ee(r,n){return n?{className:"",style:{background:n}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function ze(r){return {boxShadow:me[r]}}var Pe={shimmer:`
2
2
  @keyframes pp-shimmer {
3
3
  0% { transform: translateX(-100%); }
4
4
  100% { transform: translateX(100%); }
@@ -36,8 +36,8 @@
36
36
  0% { transform: scale(0.8); opacity: 0; }
37
37
  50% { transform: scale(1.05); }
38
38
  100% { transform: scale(1); opacity: 1; }
39
- }`},Gt=Object.values(Bt).join(`
40
- `),Mt=`
39
+ }`},Ve=Object.values(Pe).join(`
40
+ `),We=`
41
41
  /* Profile Picture Component Styles */
42
42
  .pp-container {
43
43
  --pp-transition-duration: 200ms;
@@ -154,7 +154,6 @@
154
154
  display: flex;
155
155
  align-items: center;
156
156
  justify-content: center;
157
- border-radius: 9999px;
158
157
  font-weight: 600;
159
158
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
160
159
  line-height: 1;
@@ -183,24 +182,6 @@
183
182
  box-shadow: 0 0 10px 2px var(--pp-badge-glow-color, currentColor);
184
183
  }
185
184
 
186
- /* Ribbon styles */
187
- .pp-ribbon-container {
188
- position: absolute;
189
- z-index: 10;
190
- overflow: hidden;
191
- }
192
-
193
- .pp-ribbon {
194
- position: absolute;
195
- width: 100%;
196
- text-align: center;
197
- font-weight: 600;
198
- font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
199
- text-transform: uppercase;
200
- letter-spacing: 0.05em;
201
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
202
- }
203
-
204
185
  /* Ring effect (Instagram-style) */
205
186
  .pp-ring {
206
187
  position: absolute;
@@ -259,8 +240,8 @@
259
240
  transition: none !important;
260
241
  }
261
242
  }
262
- `,Ct=`${Gt}
263
- ${Mt}`,St=`
243
+ `,Te=`${Ve}
244
+ ${We}`,Ae=`
264
245
  @keyframes np-shimmer {
265
246
  0% { background-position: -200% 0; }
266
247
  100% { background-position: 200% 0; }
@@ -270,22 +251,22 @@ ${Mt}`,St=`
270
251
  background-size: 200% 100%;
271
252
  animation: np-shimmer 1.5s infinite;
272
253
  }
273
- `;function kt(r,n=.3){if(L(r)){let t=Number.parseInt(r.slice(1,3),16),e=Number.parseInt(r.slice(3,5),16),o=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${t}, ${e}, ${o}, ${n})`}return `0 0 20px 0 ${r}`}var Ot=`
254
+ `;function De(r,n=.3){if(te(r)){let e=Number.parseInt(r.slice(1,3),16),t=Number.parseInt(r.slice(3,5),16),o=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${e}, ${t}, ${o}, ${n})`}return `0 0 20px 0 ${r}`}var qe=`
274
255
  @keyframes ppg-tooltip-in {
275
256
  from {
276
257
  opacity: 0;
277
- transform: translateY(4px) scale(0.96);
258
+ transform: translateX(-50%) translateY(4px) scale(0.96);
278
259
  }
279
260
  to {
280
261
  opacity: 1;
281
- transform: translateY(0) scale(1);
262
+ transform: translateX(-50%) translateY(0) scale(1);
282
263
  }
283
264
  }
284
265
 
285
266
  @keyframes ppg-dropdown-in {
286
267
  from {
287
268
  opacity: 0;
288
- transform: translateY(-8px) scale(0.96);
269
+ transform: translateY(-6px) scale(0.95);
289
270
  }
290
271
  to {
291
272
  opacity: 1;
@@ -301,7 +282,27 @@ ${Mt}`,St=`
301
282
  transform: translateY(-4px) scale(1.08);
302
283
  }
303
284
  }
304
- `,Ft=`
285
+
286
+ @keyframes ppg-modal-in {
287
+ from {
288
+ opacity: 0;
289
+ transform: translate(-50%, -50%) scale(0.9);
290
+ }
291
+ to {
292
+ opacity: 1;
293
+ transform: translate(-50%, -50%) scale(1);
294
+ }
295
+ }
296
+
297
+ @keyframes ppg-backdrop-in {
298
+ from {
299
+ opacity: 0;
300
+ }
301
+ to {
302
+ opacity: 1;
303
+ }
304
+ }
305
+ `,Je=`
305
306
  /* Profile Picture Group Container */
306
307
  .ppg-container {
307
308
  --ppg-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
@@ -382,7 +383,7 @@ ${Mt}`,St=`
382
383
  }
383
384
 
384
385
  .ppg-counter:hover {
385
- background: #e8e8ed;
386
+ background: #ebebed;
386
387
  transform: scale(1.05);
387
388
  }
388
389
 
@@ -436,7 +437,7 @@ ${Mt}`,St=`
436
437
 
437
438
  /* Tooltip */
438
439
  .ppg-tooltip {
439
- position: fixed;
440
+ position: absolute;
440
441
  z-index: 9999;
441
442
  padding: 6px 12px;
442
443
  background: var(--ppg-tooltip-bg);
@@ -448,7 +449,8 @@ ${Mt}`,St=`
448
449
  box-shadow: var(--ppg-shadow-lg);
449
450
  pointer-events: none;
450
451
  white-space: nowrap;
451
- animation: ppg-tooltip-in 150ms ease-out;
452
+ transform: translateX(-50%);
453
+ animation: ppg-tooltip-in 150ms ease-out forwards;
452
454
  backdrop-filter: blur(20px);
453
455
  -webkit-backdrop-filter: blur(20px);
454
456
  }
@@ -477,111 +479,168 @@ ${Mt}`,St=`
477
479
  /* Dropdown */
478
480
  .ppg-dropdown {
479
481
  position: absolute;
480
- z-index: 1000;
481
- min-width: 200px;
482
- max-width: 280px;
482
+ z-index: 9998;
483
+ right: 0;
484
+ min-width: 220px;
485
+ max-width: 300px;
483
486
  background: var(--ppg-dropdown-bg);
484
- border-radius: var(--ppg-radius);
485
- box-shadow: var(--ppg-shadow-lg);
486
- border: 1px solid var(--ppg-border);
487
+ border-radius: 14px;
488
+ box-shadow:
489
+ 0 4px 24px rgba(0, 0, 0, 0.12),
490
+ 0 1px 4px rgba(0, 0, 0, 0.08),
491
+ 0 0 0 1px var(--ppg-border);
487
492
  overflow: hidden;
488
- animation: ppg-dropdown-in 200ms ease-out;
493
+ animation: ppg-dropdown-in 200ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
494
+ transform-origin: top right;
495
+ backdrop-filter: blur(20px);
496
+ -webkit-backdrop-filter: blur(20px);
489
497
  }
490
498
 
491
499
  .ppg-dropdown[data-position="bottom"] {
492
- top: calc(100% + 8px);
500
+ top: calc(100% + 10px);
493
501
  }
494
502
 
495
503
  .ppg-dropdown[data-position="top"] {
496
- bottom: calc(100% + 8px);
504
+ bottom: calc(100% + 10px);
505
+ transform-origin: bottom right;
506
+ }
507
+
508
+ /* Modal style for mobile */
509
+ .ppg-dropdown[data-position="modal"] {
510
+ transform-origin: center center;
511
+ animation: ppg-modal-in 250ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
512
+ border-radius: 20px;
513
+ }
514
+
515
+ .ppg-backdrop-visible {
516
+ background: rgba(0, 0, 0, 0.4);
517
+ animation: ppg-backdrop-in 200ms ease-out forwards;
497
518
  }
498
519
 
499
520
  .ppg-dropdown-header {
500
- padding: 12px 16px 8px;
501
- font-size: 12px;
521
+ padding: 14px 16px 10px;
522
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
523
+ font-size: 11px;
502
524
  font-weight: 600;
503
525
  color: #86868b;
504
526
  text-transform: uppercase;
505
- letter-spacing: 0.04em;
506
- border-bottom: 1px solid var(--ppg-border);
527
+ letter-spacing: 0.06em;
528
+ background: linear-gradient(to bottom, rgba(0,0,0,0.02), transparent);
507
529
  }
508
530
 
509
531
  .ppg-dropdown-list {
510
532
  overflow-y: auto;
511
- padding: 4px 0;
533
+ padding: 6px;
534
+ scrollbar-width: thin;
535
+ scrollbar-color: rgba(0,0,0,0.2) transparent;
536
+ }
537
+
538
+ .ppg-dropdown-list::-webkit-scrollbar {
539
+ width: 6px;
540
+ }
541
+
542
+ .ppg-dropdown-list::-webkit-scrollbar-track {
543
+ background: transparent;
544
+ }
545
+
546
+ .ppg-dropdown-list::-webkit-scrollbar-thumb {
547
+ background: rgba(0,0,0,0.15);
548
+ border-radius: 3px;
512
549
  }
513
550
 
514
551
  .ppg-dropdown-item {
515
552
  display: flex;
516
553
  align-items: center;
517
554
  gap: 12px;
518
- padding: 10px 16px;
555
+ padding: 10px 12px;
519
556
  cursor: pointer;
520
- transition: background-color var(--ppg-transition);
557
+ border-radius: 10px;
558
+ transition: all 150ms ease;
559
+ margin: 2px 0;
521
560
  }
522
561
 
523
562
  .ppg-dropdown-item:hover {
524
563
  background: var(--ppg-dropdown-hover);
564
+ transform: translateX(2px);
525
565
  }
526
566
 
527
567
  .ppg-dropdown-item:focus-visible {
528
568
  outline: none;
529
569
  background: var(--ppg-dropdown-hover);
570
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
571
+ }
572
+
573
+ .ppg-dropdown-item:active {
574
+ transform: scale(0.98);
530
575
  }
531
576
 
532
577
  .ppg-dropdown-avatar {
533
578
  flex-shrink: 0;
534
- width: 32px;
535
- height: 32px;
579
+ width: 36px;
580
+ height: 36px;
536
581
  border-radius: 9999px;
537
582
  object-fit: cover;
538
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
583
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
584
+ border: 2px solid rgba(255, 255, 255, 0.8);
539
585
  }
540
586
 
541
587
  .ppg-dropdown-avatar-fallback {
542
588
  flex-shrink: 0;
543
- width: 32px;
544
- height: 32px;
589
+ width: 36px;
590
+ height: 36px;
545
591
  border-radius: 9999px;
546
592
  display: flex;
547
593
  align-items: center;
548
594
  justify-content: center;
595
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
549
596
  font-size: 13px;
550
597
  font-weight: 600;
551
598
  color: white;
599
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
600
+ border: 2px solid rgba(255, 255, 255, 0.3);
552
601
  }
553
602
 
554
603
  .ppg-dropdown-info {
555
604
  flex: 1;
556
605
  min-width: 0;
606
+ padding-right: 4px;
607
+ text-align: left;
557
608
  }
558
609
 
559
610
  .ppg-dropdown-name {
611
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
560
612
  font-size: 14px;
561
613
  font-weight: 500;
562
614
  color: #1d1d1f;
563
615
  white-space: nowrap;
564
616
  overflow: hidden;
565
617
  text-overflow: ellipsis;
618
+ line-height: 1.3;
619
+ text-align: left;
566
620
  }
567
621
 
568
622
  .ppg-dropdown-status {
569
623
  display: flex;
570
624
  align-items: center;
571
- gap: 6px;
625
+ gap: 5px;
626
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
572
627
  font-size: 12px;
573
628
  color: #86868b;
574
629
  margin-top: 2px;
630
+ line-height: 1.2;
575
631
  }
576
632
 
577
633
  .ppg-dropdown-presence {
578
- width: 8px;
579
- height: 8px;
634
+ width: 7px;
635
+ height: 7px;
580
636
  border-radius: 9999px;
637
+ flex-shrink: 0;
638
+ box-shadow: 0 0 0 1.5px var(--ppg-dropdown-bg);
581
639
  }
582
640
 
583
641
  .ppg-dropdown-presence[data-status="online"] {
584
642
  background: #30D158;
643
+ box-shadow: 0 0 0 1.5px var(--ppg-dropdown-bg), 0 0 6px rgba(48, 209, 88, 0.5);
585
644
  }
586
645
 
587
646
  .ppg-dropdown-presence[data-status="away"] {
@@ -601,7 +660,7 @@ ${Mt}`,St=`
601
660
  .ppg-backdrop {
602
661
  position: fixed;
603
662
  inset: 0;
604
- z-index: 999;
663
+ z-index: 9997;
605
664
  }
606
665
 
607
666
  /* Reduced motion */
@@ -643,86 +702,111 @@ ${Mt}`,St=`
643
702
  box-shadow: 0 0 0 1.5px rgba(28, 28, 30, 0.95), var(--ppg-shadow-sm);
644
703
  }
645
704
 
705
+ .ppg-counter:hover {
706
+ background: #3a3a3c;
707
+ }
708
+
709
+ .ppg-dropdown {
710
+ background: rgba(44, 44, 46, 0.95);
711
+ box-shadow:
712
+ 0 4px 24px rgba(0, 0, 0, 0.4),
713
+ 0 1px 4px rgba(0, 0, 0, 0.2),
714
+ 0 0 0 1px rgba(255, 255, 255, 0.08);
715
+ }
716
+
646
717
  .ppg-dropdown-name {
647
718
  color: #ffffff;
648
719
  }
649
720
 
650
721
  .ppg-dropdown-header {
651
722
  color: #98989d;
723
+ background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent);
724
+ }
725
+
726
+ .ppg-dropdown-avatar {
727
+ border-color: rgba(255, 255, 255, 0.15);
728
+ }
729
+
730
+ .ppg-dropdown-avatar-fallback {
652
731
  border-color: rgba(255, 255, 255, 0.1);
653
732
  }
733
+
734
+ .ppg-dropdown-list {
735
+ scrollbar-color: rgba(255,255,255,0.35) transparent;
736
+ }
737
+
738
+ .ppg-dropdown-list::-webkit-scrollbar-thumb {
739
+ background: rgba(255,255,255,0.35);
740
+ }
741
+
742
+ .ppg-dropdown-presence {
743
+ box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95);
744
+ }
745
+
746
+ .ppg-dropdown-presence[data-status="online"] {
747
+ box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95), 0 0 6px rgba(48, 209, 88, 0.5);
748
+ }
654
749
  }
655
- `,$t=`${Ot}
656
- ${Ft}`;var i=class extends lit.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.rotation=0;this.loading=C.loading;this.placeholder=C.placeholder;this.placeholderColor=C.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static setCdnBaseUrl(t){i.cdnBaseUrl=t,i.instances.forEach(e=>{e.extCustomerId&&!e.cdnImageUrl&&(e.cdnLoadFailed=false,e.retryTimeoutId&&(clearTimeout(e.retryTimeoutId),e.retryTimeoutId=void 0),e.previousExtCustomerId||(e.previousExtCustomerId=e.extCustomerId),e.loadCdnImage());});}static getCdnBaseUrl(){return i.cdnBaseUrl}createRenderRoot(){return i.injectStylesOnce(),this}static injectStylesOnce(){if(i.stylesInjected||typeof document>"u")return;let t=document.createElement("style");t.textContent=Ct,document.head.appendChild(t),i.stylesInjected=true;}get pixelSize(){let t=this.size;return typeof t=="number"?t:D[t]??D[C.size]}connectedCallback(){super.connectedCallback(),i.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),i.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&i.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(t){super.updated(t),this.extCustomerId&&i.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(t){t.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(t.has("extCustomerId")||t.has("size")||t.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&i.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&i.cdnBaseUrl)){this.cdnLoadFailed=true;return}let t=Q(this.pixelSize),e=P(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=_(i.cdnBaseUrl,this.extCustomerId,t,e,o);}getContainerStyles(){let t=yt(this.bgColor,this.bgGradient),e=this.border?vt(this.borderWidth,this.borderColor):null,o=wt(this.shadow),a={};if(this.glow){let l=this.glow.color??this.borderColor??"#6366f1";a={"--pp-glow-color":l,boxShadow:kt(l,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:x("pp-container",xt(this.variant),t.className,e?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:R[this.variant],...t.style,...e?.style,...o,...a,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return lit.nothing;let t={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return lit.html`
657
- ${this.placeholder==="shimmer"?lit.html`<style>${St}</style>`:lit.nothing}
750
+ `,Re=`${qe}
751
+ ${Je}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=$.size;this.variant=$.variant;this.shadow=$.shadow;this.border=false;this.borderWidth=$.borderWidth;this.borderColor=$.borderColor;this.rotation=0;this.loading=$.loading;this.placeholder=$.placeholder;this.placeholderColor=$.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static setCdnBaseUrl(e){a.cdnBaseUrl=e,a.instances.forEach(t=>{t.extCustomerId&&!t.cdnImageUrl&&(t.cdnLoadFailed=false,t.retryTimeoutId&&(clearTimeout(t.retryTimeoutId),t.retryTimeoutId=void 0),t.previousExtCustomerId||(t.previousExtCustomerId=t.extCustomerId),t.loadCdnImage());});}static getCdnBaseUrl(){return a.cdnBaseUrl}createRenderRoot(){return a.injectStylesOnce(),this}static injectStylesOnce(){if(a.stylesInjected||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:t=>setTimeout(t,1))(()=>{if(a.stylesInjected)return;let t=document.createElement("style");t.textContent=Te,document.head.appendChild(t),a.stylesInjected=true;});}get pixelSize(){let e=this.size;return typeof e=="number"?e:N[e]??N[$.size]}connectedCallback(){super.connectedCallback(),a.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),a.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&a.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(e){super.updated(e),this.extCustomerId&&a.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(e){e.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(e.has("extCustomerId")||e.has("size")||e.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&a.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&a.cdnBaseUrl)){this.cdnLoadFailed=true;return}let e=oe(this.pixelSize),t=ie(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=ae(a.cdnBaseUrl,this.extCustomerId,e,t,o);}getContainerStyles(){let e=Ee(this.bgColor,this.bgGradient),t=this.border?Ie(this.borderWidth,this.borderColor):null,o=ze(this.shadow),i={};if(this.glow){let l=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":l,boxShadow:De(l,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:R("pp-container",$e(this.variant),e.className,t?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:H[this.variant],...e.style,...t?.style,...o,...i,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return lit.nothing;let e={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return lit.html`
752
+ ${this.placeholder==="shimmer"?lit.html`<style>${Ae}</style>`:lit.nothing}
658
753
  <div
659
- class=${x("np:absolute np:inset-0",t)}
754
+ class=${R("np:absolute np:inset-0",e)}
660
755
  style=${styleMap_js.styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
661
756
  </div>
662
757
  `}renderFallback(){if(this.fallback)return lit.html`
663
758
  <span
664
759
  class="pp-fallback"
665
- style=${styleMap_js.styleMap({fontSize:`${X(this.pixelSize)}px`})}>
760
+ style=${styleMap_js.styleMap({fontSize:`${re(this.pixelSize)}px`})}>
666
761
  ${this.fallback}
667
762
  </span>
668
- `;if(this.alt){let e=F(this.alt);return lit.html`
763
+ `;if(this.alt){let t=Y(this.alt);return lit.html`
669
764
  <div
670
765
  class="pp-fallback np:absolute np:inset-0"
671
- style=${styleMap_js.styleMap({background:this.bgColor??e,fontSize:`${X(this.pixelSize)}px`})}>
672
- ${O(this.alt)}
766
+ style=${styleMap_js.styleMap({background:this.bgColor??t,fontSize:`${re(this.pixelSize)}px`})}>
767
+ ${J(this.alt)}
673
768
  </div>
674
- `}let t=this.pixelSize*.5;return lit.html`
769
+ `}let e=this.pixelSize*.5;return lit.html`
675
770
  <svg
676
771
  class="pp-fallback-icon"
677
- style="width: ${t}px; height: ${t}px;"
772
+ style="width: ${e}px; height: ${e}px;"
678
773
  fill="currentColor"
679
774
  viewBox="0 0 24 24">
680
775
  <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" />
681
776
  </svg>
682
- `}renderImage(){let t=!!(this.extCustomerId&&i.cdnBaseUrl),e;return this.cdnImageUrl?e=this.cdnImageUrl:(!t||this.cdnLoadFailed)&&(e=this.src),this.hasError||!e?this.renderFallback():lit.html`
777
+ `}renderImage(){let e=!!(this.extCustomerId&&a.cdnBaseUrl),t;return this.cdnImageUrl?t=this.cdnImageUrl:(!e||this.cdnLoadFailed)&&(t=this.src),this.hasError||!t?this.renderFallback():lit.html`
683
778
  <img
684
- src=${e}
779
+ src=${t}
685
780
  alt=${this.alt}
686
781
  loading=${this.loading}
687
782
  decoding="async"
688
783
  @load=${this.handleLoad}
689
784
  @error=${this.handleError}
690
- class=${x("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
785
+ class=${R("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
691
786
  draggable="false" />
692
- `}renderRing(){if(!this.ring?.show)return lit.nothing;let t=this.ring.width??3,e=this.ring.gap??3,o=t+e,a,p=this.ring.progress!==void 0;if(p){let l=this.ring.progress??0,u=this.ring.color??"#30D158",b=this.ring.emptyColor??"#8E8E93";a=gt(l,u,b);}else this.ring.gradient&&this.ring.gradient.length>0?a=ct(this.ring.gradient):a=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return lit.html`
787
+ `}renderRing(){if(!this.ring?.show)return lit.nothing;let e=this.ring.width??3,t=this.ring.gap??3,o=e+t,i,p=this.ring.progress!==void 0;if(p){let l=this.ring.progress??0,f=this.ring.color??"#30D158",m=this.ring.emptyColor??"#8E8E93";i=we(l,f,m);}else this.ring.gradient&&this.ring.gradient.length>0?i=ve(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return lit.html`
693
788
  <div
694
- class=${x("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
695
- style=${styleMap_js.styleMap({inset:`-${o}px`,padding:`${t}px`,background:a,borderRadius:R[this.variant]})}>
789
+ class=${R("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
790
+ style=${styleMap_js.styleMap({inset:`-${o}px`,padding:`${e}px`,background:i,borderRadius:H[this.variant]})}>
696
791
  </div>
697
- `}renderPresence(){if(!this.presence)return lit.nothing;let t=this.presence.thickness??2,e=dt(this.pixelSize,t),o=ot[this.presence.status],a=Math.max(0,this.pixelSize*.02);return lit.html`
792
+ `}getCornerOffset(){let e=this.border?this.borderWidth:0,t=this.pixelSize*.08,i={circle:1,square:.5,rounded:.8,squircle:1.2}[this.variant];return Math.round(t*i-e*.5)}renderPresence(){if(!this.presence)return lit.nothing;let e=this.presence.thickness??2,t=be(this.pixelSize,e),o=fe[this.presence.status],i=this.getCornerOffset();return lit.html`
698
793
  <div
699
- class=${x("pp-presence",this.presence.animate&&"pp-presence-animated")}
700
- style=${styleMap_js.styleMap({width:`${e}px`,height:`${e}px`,backgroundColor:o,bottom:`${a}px`,right:`${a}px`,color:o})}
794
+ class=${R("pp-presence",this.presence.animate&&"pp-presence-animated")}
795
+ style=${styleMap_js.styleMap({width:`${t}px`,height:`${t}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
701
796
  title=${this.presence.status}>
702
797
  </div>
703
- `}renderBadge(){if(!this.badge)return lit.nothing;let t=this.badge.position??"bottom-right",e=this.badge.content!==void 0,o=this.badge.icon!==void 0,a=e||o,{size:p,fontSize:l}=pt(this.pixelSize,a),u=this.badge.bgColor??"#22c55e",b=this.badge.color??"#ffffff",h=e&&this.badge.content!==void 0?lt(this.badge.content,this.badge.max):null,k=o?this.badge.icon:null,$=l*.9,E={"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 lit.html`
798
+ `}renderBadge(){if(!this.badge)return lit.nothing;let e=this.badge.position??"bottom-right",t=this.badge.content!==void 0,o=this.badge.icon!==void 0,i=t||o,{size:p,fontSize:l}=he(this.pixelSize,i),f=this.badge.bgColor??"#22c55e",m=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",x=t&&this.badge.content!==void 0?xe(this.badge.content,this.badge.max):null,v=o?this.badge.icon:null,T=l*.9,c=`${-this.getCornerOffset()}px`,M={"top-left":{top:c,left:c},"top-center":{top:c,left:"50%",transform:"translateX(-50%)"},"top-right":{top:c,right:c},"bottom-left":{bottom:c,left:c},"bottom-center":{bottom:c,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:c,right:c}};return lit.html`
704
799
  <div
705
- class=${x("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
706
- style=${styleMap_js.styleMap({width:a?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:a?"0 6px":"0",fontSize:`${l}px`,backgroundColor:u,color:b,"--pp-badge-glow-color":u,gap:o&&e?"4px":"0",...E[t]})}>
707
- ${k?lit.html`<span class="pp-badge-icon" style=${styleMap_js.styleMap({fontSize:`${$}px`})}>${k}</span>`:lit.nothing}
708
- ${h??lit.nothing}
800
+ class=${R("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
801
+ style=${styleMap_js.styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${l}px`,backgroundColor:f,color:m,borderRadius:h,"--pp-badge-glow-color":f,gap:o&&t?"4px":"0",...M[e]})}>
802
+ ${v?lit.html`<span class="pp-badge-icon" style=${styleMap_js.styleMap({fontSize:`${T}px`})}>${v}</span>`:lit.nothing}
803
+ ${x??lit.nothing}
709
804
  </div>
710
- `}renderRibbon(){if(!this.ribbon)return lit.nothing;let t=this.ribbon.position??"top-right",e=this.ribbon.bgColor??"#ef4444",o=this.ribbon.color??"#ffffff",a=L(e)?{backgroundColor:e}:{background:e},p={color:o},l=this.pixelSize*.9,u=this.pixelSize*.4,b=Math.max(8,this.pixelSize*.11);return lit.html`
805
+ `}render(){let e=this.getContainerStyles(),t=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return lit.html`
711
806
  <div
712
- class=${x("pp-ribbon-container",at(t))}
713
- style=${styleMap_js.styleMap({width:`${l}px`,height:`${u}px`})}>
714
- <div
715
- class=${x("pp-ribbon np:origin-center np:transform",st(t))}
716
- style=${styleMap_js.styleMap({fontSize:`${b}px`,padding:`${b*.3}px 0`,...a,...p})}>
717
- ${this.ribbon.icon?lit.html`<span style="margin-right: 2px">${this.ribbon.icon}</span>`:lit.nothing}
718
- ${this.ribbon.text}
719
- </div>
720
- </div>
721
- `}render(){let t=this.getContainerStyles(),e=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return lit.html`
722
- <div
723
- class=${t.classes}
724
- style=${styleMap_js.styleMap(t.styles)}
725
- tabindex=${e??lit.nothing}
807
+ class=${e.classes}
808
+ style=${styleMap_js.styleMap(e.styles)}
809
+ tabindex=${t??lit.nothing}
726
810
  role=${this.interactive?.pressable?"button":lit.nothing}
727
811
  aria-label=${this.alt||lit.nothing}
728
812
  data-profile-picture>
@@ -733,7 +817,7 @@ ${Ft}`;var i=class extends lit.LitElement{constructor(){super(...arguments);this
733
817
  <!-- Inner container for image clipping -->
734
818
  <div
735
819
  class="pp-inner"
736
- style=${styleMap_js.styleMap({borderRadius:R[this.variant]})}>
820
+ style=${styleMap_js.styleMap({borderRadius:H[this.variant]})}>
737
821
  <!-- Placeholder -->
738
822
  ${this.renderPlaceholder()}
739
823
 
@@ -741,67 +825,113 @@ ${Ft}`;var i=class extends lit.LitElement{constructor(){super(...arguments);this
741
825
  ${this.renderImage()}
742
826
  </div>
743
827
 
744
- <!-- Ribbon -->
745
- ${this.renderRibbon()}
746
-
747
828
  <!-- Badge -->
748
829
  ${this.renderBadge()}
749
830
 
750
831
  <!-- Presence Indicator -->
751
832
  ${this.renderPresence()}
752
833
  </div>
753
- `}};i.stylesInjected=false,i.cdnBaseUrl="",i.instances=new Set,s([decorators_js.property({type:String})],i.prototype,"src",2),s([decorators_js.property({type:String})],i.prototype,"alt",2),s([decorators_js.property({type:String,attribute:"ext-customer-id"})],i.prototype,"extCustomerId",2),s([decorators_js.property({type:String})],i.prototype,"size",2),s([decorators_js.property({type:String})],i.prototype,"variant",2),s([decorators_js.property({type:String})],i.prototype,"shadow",2),s([decorators_js.property({type:Boolean})],i.prototype,"border",2),s([decorators_js.property({type:Number,attribute:"border-width"})],i.prototype,"borderWidth",2),s([decorators_js.property({type:String,attribute:"border-color"})],i.prototype,"borderColor",2),s([decorators_js.property({type:Number})],i.prototype,"rotation",2),s([decorators_js.property({type:String,attribute:"bg-color"})],i.prototype,"bgColor",2),s([decorators_js.property({type:String,attribute:"bg-gradient"})],i.prototype,"bgGradient",2),s([decorators_js.property({type:Object,attribute:"ring",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"ring",2),s([decorators_js.property({type:Object,attribute:"presence",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"presence",2),s([decorators_js.property({type:Object,attribute:"glow",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"glow",2),s([decorators_js.property({type:Object,attribute:"ribbon",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"ribbon",2),s([decorators_js.property({type:Object,attribute:"badge",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"badge",2),s([decorators_js.property({type:String})],i.prototype,"loading",2),s([decorators_js.property({type:String})],i.prototype,"placeholder",2),s([decorators_js.property({type:String,attribute:"placeholder-color"})],i.prototype,"placeholderColor",2),s([decorators_js.property({type:String})],i.prototype,"fallback",2),s([decorators_js.property({type:Object,attribute:"interactive",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],i.prototype,"interactive",2),s([decorators_js.state()],i.prototype,"isLoaded",2),s([decorators_js.state()],i.prototype,"hasError",2),s([decorators_js.state()],i.prototype,"cdnImageUrl",2),s([decorators_js.state()],i.prototype,"cdnLoadFailed",2),i=s([decorators_js.customElement("profile-picture")],i);var It=false;function Wt(){if(It||typeof document>"u")return;let r=document.createElement("style");r.textContent=$t,document.head.appendChild(r),It=true;}var g=class extends lit.LitElement{constructor(){super(...arguments);this.max=S.max;this.direction=S.direction;this.overlap=S.overlap;this.size=S.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=S.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.handleBackdropClick=()=>{this.dropdownOpen=false;};}createRenderRoot(){return Wt(),this}get pixelSize(){return ut(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??S.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??S.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()==="profile-picture"&&e.getAttribute("slot")!=="internal");this.users=t.map((e,o)=>{let a=e.getAttribute("border-width"),p=a?Number.parseInt(a,10):void 0;return {id:e.getAttribute("data-user-id")??void 0,name:e.getAttribute("alt")??`User ${o+1}`,src:e.getAttribute("src")??void 0,status:e.getAttribute("data-status")??void 0,element:e,index:o,variant:e.getAttribute("variant")??void 0,shadow:e.getAttribute("shadow")??void 0,border:e.hasAttribute("border"),borderWidth:p,borderColor:e.getAttribute("border-color")??void 0,bgColor:e.getAttribute("bg-color")??void 0,bgGradient:e.getAttribute("bg-gradient")??void 0}});for(let e of this.users)e.element&&(e.element.style.display="none");}handleAvatarClick(t){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarHover(t,e){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let o=e.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:t,rect:o.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(t){this.dropdownOpen=!this.dropdownOpen,this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:t,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(t){this.dropdownOpen=false,this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:t},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(t,e){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e());}renderAvatar(t,e,o){let a=N(e,this.pixelSize,this.overlap,this.direction,this.spacing),p=ft(e,o,this.direction),l=t.variant??"circle",u=t.shadow??"none",b=this.rotationAmount?e%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
834
+ `}};a.stylesInjected=false,a.cdnBaseUrl="",a.instances=new Set,s([decorators_js.property({type:String})],a.prototype,"src",2),s([decorators_js.property({type:String})],a.prototype,"alt",2),s([decorators_js.property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId",2),s([decorators_js.property({type:String})],a.prototype,"size",2),s([decorators_js.property({type:String})],a.prototype,"variant",2),s([decorators_js.property({type:String})],a.prototype,"shadow",2),s([decorators_js.property({type:Boolean})],a.prototype,"border",2),s([decorators_js.property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth",2),s([decorators_js.property({type:String,attribute:"border-color"})],a.prototype,"borderColor",2),s([decorators_js.property({type:Number})],a.prototype,"rotation",2),s([decorators_js.property({type:String,attribute:"bg-color"})],a.prototype,"bgColor",2),s([decorators_js.property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient",2),s([decorators_js.property({type:Object,attribute:"ring",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"ring",2),s([decorators_js.property({type:Object,attribute:"presence",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"presence",2),s([decorators_js.property({type:Object,attribute:"glow",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"glow",2),s([decorators_js.property({type:Object,attribute:"badge",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"badge",2),s([decorators_js.property({type:String})],a.prototype,"loading",2),s([decorators_js.property({type:String})],a.prototype,"placeholder",2),s([decorators_js.property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor",2),s([decorators_js.property({type:String})],a.prototype,"fallback",2),s([decorators_js.property({type:Object,attribute:"interactive",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):null}})],a.prototype,"interactive",2),s([decorators_js.state()],a.prototype,"isLoaded",2),s([decorators_js.state()],a.prototype,"hasError",2),s([decorators_js.state()],a.prototype,"cdnImageUrl",2),s([decorators_js.state()],a.prototype,"cdnLoadFailed",2),a=s([decorators_js.customElement("profile-picture")],a);var de=false;function Qe(){if(de||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>{if(de)return;let n=document.createElement("style");n.textContent=Re,document.head.appendChild(n),de=true;});}var g=class extends lit.LitElement{constructor(){super(...arguments);this.max=I.max;this.direction=I.direction;this.overlap=I.overlap;this.size=I.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=I.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.portalContainer=null;this.counterRef=null;this.handleBackdropClick=()=>{this.dropdownOpen=false,this.destroyPortal();};}createRenderRoot(){return Qe(),this}get pixelSize(){return ye(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??I.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??I.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout(),this.destroyPortal();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","ext-customer-id","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let e=Array.from(this.children).filter(t=>t.tagName.toLowerCase()==="profile-picture"&&t.getAttribute("slot")!=="internal");this.users=e.map((t,o)=>{let i=t.getAttribute("border-width"),p=i?Number.parseInt(i,10):void 0;return {id:t.getAttribute("data-user-id")??void 0,name:t.getAttribute("alt")??`User ${o+1}`,src:t.getAttribute("src")??void 0,extCustomerId:t.getAttribute("ext-customer-id")??void 0,status:t.getAttribute("data-status")??void 0,element:t,index:o,variant:t.getAttribute("variant")??void 0,shadow:t.getAttribute("shadow")??void 0,border:t.hasAttribute("border"),borderWidth:p,borderColor:t.getAttribute("border-color")??void 0,bgColor:t.getAttribute("bg-color")??void 0,bgGradient:t.getAttribute("bg-gradient")??void 0}});for(let t of this.users)t.element&&(t.element.style.display="none");}createPortal(){this.portalContainer||(this.portalContainer=document.createElement("div"),this.portalContainer.className="ppg-portal",this.portalContainer.style.cssText="position: fixed; z-index: 99999; pointer-events: none;",document.body.appendChild(this.portalContainer),document.body.style.overflow="hidden");}destroyPortal(){this.portalContainer&&(lit.render(lit.nothing,this.portalContainer),this.portalContainer.remove(),this.portalContainer=null,document.body.style.overflow="");}updatePortalContent(e){if(!(this.portalContainer&&this.counterRef))return;let t=this.counterRef.getBoundingClientRect(),o=10,i=280,p=Math.min(this.dropdownMaxHeight+60,e.length*56+60),l=window.innerWidth,f=window.innerHeight;if(l<480){let y=lit.html`
835
+ <div
836
+ class="ppg-backdrop ppg-backdrop-visible"
837
+ style="pointer-events: auto; background: rgba(0,0,0,0.5);"
838
+ @click=${this.handleBackdropClick}
839
+ aria-hidden="true"
840
+ ></div>
841
+ <div
842
+ class="ppg-dropdown ppg-dropdown-modal"
843
+ style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:"320px",maxHeight:"70vh"})}
844
+ data-position="modal"
845
+ role="menu"
846
+ aria-label="Hidden users"
847
+ >
848
+ <div class="ppg-dropdown-header">
849
+ ${e.length} more
850
+ </div>
851
+ <div
852
+ class="ppg-dropdown-list"
853
+ style=${styleMap_js.styleMap({maxHeight:"calc(70vh - 60px)"})}
854
+ >
855
+ ${e.map(A=>this.renderDropdownItem(A))}
856
+ </div>
857
+ </div>
858
+ `;lit.render(y,this.portalContainer);return}let h=f-t.bottom-o,x=t.top-o,v=l-t.left,T=t.right,b=this.dropdownPosition;b==="bottom"&&h<p&&x>h?b="top":b==="top"&&x<p&&h>x&&(b="bottom");let c;v>=i?c=t.left:T>=i?c=t.right-i:c=(l-i)/2,c=Math.max(8,Math.min(c,l-i-8));let M=b==="bottom"?t.bottom+o:void 0,U=b==="top"?f-t.top+o:void 0,j=lit.html`
859
+ <div
860
+ class="ppg-backdrop"
861
+ style="pointer-events: auto;"
862
+ @click=${this.handleBackdropClick}
863
+ aria-hidden="true"
864
+ ></div>
865
+ <div
866
+ class="ppg-dropdown ppg-dropdown-portal"
867
+ style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:M!==void 0?`${M}px`:"auto",bottom:U!==void 0?`${U}px`:"auto",left:`${c}px`,width:`${i}px`})}
868
+ data-position=${b}
869
+ role="menu"
870
+ aria-label="Hidden users"
871
+ >
872
+ <div class="ppg-dropdown-header">
873
+ ${e.length} more
874
+ </div>
875
+ <div
876
+ class="ppg-dropdown-list"
877
+ style=${styleMap_js.styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
878
+ >
879
+ ${e.map(y=>this.renderDropdownItem(y))}
880
+ </div>
881
+ </div>
882
+ `;lit.render(j,this.portalContainer);}handleAvatarClick(e){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:e},bubbles:true,composed:true}));}handleAvatarHover(e,t){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let o=t.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:e,rect:o.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:e},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(e){this.dropdownOpen=!this.dropdownOpen,this.dropdownOpen?(this.createPortal(),this.updatePortalContent(e)):this.destroyPortal(),this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:e,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(e){this.dropdownOpen=false,this.destroyPortal(),this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:e},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(e,t){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t());}renderAvatar(e,t,o){let i=K(t,this.pixelSize,this.overlap,this.direction,this.spacing),p=Ce(t,o,this.direction),l=e.variant??"circle",f=e.shadow??"none",m=this.rotationAmount?t%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
754
883
  <div
755
884
  class="ppg-avatar-wrapper"
756
- style=${styleMap_js.styleMap({left:`${a}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
885
+ style=${styleMap_js.styleMap({left:`${i}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
757
886
  tabindex="0"
758
887
  role="button"
759
- aria-label=${t.name}
760
- @click=${()=>this.handleAvatarClick(t)}
761
- @mouseenter=${h=>this.handleAvatarHover(t,h)}
888
+ aria-label=${e.name}
889
+ @click=${()=>this.handleAvatarClick(e)}
890
+ @mouseenter=${h=>this.handleAvatarHover(e,h)}
762
891
  @mouseleave=${this.handleAvatarLeave}
763
- @keydown=${h=>this.handleKeyDown(h,()=>this.handleAvatarClick(t))}
892
+ @keydown=${h=>this.handleKeyDown(h,()=>this.handleAvatarClick(e))}
764
893
  >
765
- ${this.renderProfilePicture(t,l,u,b)}
894
+ ${this.renderProfilePicture(e,l,f,m)}
766
895
  </div>
767
- `}renderProfilePicture(t,e,o,a){return lit.html`
896
+ `}renderProfilePicture(e,t,o,i){return lit.html`
768
897
  <profile-picture
769
- .src=${t.src??""}
770
- .alt=${t.name}
898
+ .src=${e.src??""}
899
+ .alt=${e.name}
771
900
  .size=${this.pixelSize}
772
- .variant=${e}
901
+ .variant=${t}
773
902
  .shadow=${o}
774
- .rotation=${a}
775
- ?border=${t.border}
776
- .borderWidth=${t.border?t.borderWidth??2:2}
777
- .borderColor=${t.border?t.borderColor??"#ffffff":"#ffffff"}
778
- .bgColor=${t.bgGradient?void 0:t.bgColor??"#ffffff"}
779
- .bgGradient=${t.bgGradient??void 0}
780
- data-user-id=${t.id??""}
781
- data-status=${t.status??""}
903
+ .rotation=${i}
904
+ .extCustomerId=${e.extCustomerId}
905
+ ?border=${e.border}
906
+ .borderWidth=${e.border?e.borderWidth??2:2}
907
+ .borderColor=${e.border?e.borderColor??"#ffffff":"#ffffff"}
908
+ .bgColor=${e.bgGradient?void 0:e.bgColor??"#ffffff"}
909
+ .bgGradient=${e.bgGradient??void 0}
910
+ data-user-id=${e.id??""}
911
+ data-status=${e.status??""}
782
912
  ></profile-picture>
783
- `}renderCounter(t,e){return lit.html`
913
+ `}renderCounter(e,t,o){return lit.html`
784
914
  <button
785
915
  class="ppg-counter"
786
- style=${styleMap_js.styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
787
- aria-label=${`${t} more users`}
916
+ style=${styleMap_js.styleMap({left:`${t}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
917
+ aria-label=${`${e} more users`}
788
918
  aria-expanded=${this.dropdownOpen}
789
919
  aria-haspopup="true"
790
- @click=${()=>this.handleCounterClick(this.users.slice(-t))}
920
+ @click=${()=>this.handleCounterClick(o)}
791
921
  >
792
- ${mt(t)}
922
+ ${ke(e)}
793
923
  </button>
794
- `}renderAddButton(t){let e=Math.round(this.pixelSize*.4);return lit.html`
924
+ `}renderAddButton(e){let t=Math.round(this.pixelSize*.4);return lit.html`
795
925
  <button
796
926
  class="ppg-add-button"
797
- style=${styleMap_js.styleMap({left:`${t}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
927
+ style=${styleMap_js.styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
798
928
  aria-label=${this.addButtonLabel}
799
929
  @click=${this.handleAddClick}
800
930
  >
801
931
  <svg
802
932
  class="ppg-add-icon"
803
- width=${e}
804
- height=${e}
933
+ width=${t}
934
+ height=${t}
805
935
  viewBox="0 0 24 24"
806
936
  fill="none"
807
937
  stroke="currentColor"
@@ -813,72 +943,54 @@ ${Ft}`;var i=class extends lit.LitElement{constructor(){super(...arguments);this
813
943
  <line x1="5" y1="12" x2="19" y2="12"></line>
814
944
  </svg>
815
945
  </button>
816
- `}renderTooltip(){if(!this.tooltipData)return lit.nothing;let{user:t,rect:e}=this.tooltipData,o=8,a,p;return this.tooltipPosition==="bottom"?(a=e.bottom+o,p=e.left+e.width/2):(a=e.top-o,p=e.left+e.width/2),lit.html`
946
+ `}renderTooltip(){if(!this.tooltipData)return lit.nothing;let{user:e,rect:t}=this.tooltipData,o=8,i=this.getBoundingClientRect(),p=t.left-i.left+t.width/2,l=t.top-i.top,f=t.bottom-i.top,m=this.tooltipPosition==="top";return lit.html`
817
947
  <div
818
948
  class="ppg-tooltip"
819
- style=${styleMap_js.styleMap({top:this.tooltipPosition==="top"?"auto":`${a}px`,bottom:this.tooltipPosition==="top"?`${window.innerHeight-e.top+o}px`:"auto",left:`${p}px`,transform:"translateX(-50%)"})}
949
+ style=${styleMap_js.styleMap({top:m?"auto":`${f+o}px`,bottom:m?`${i.height-l+o}px`:"auto",left:`${p}px`})}
820
950
  data-position=${this.tooltipPosition}
821
951
  role="tooltip"
822
952
  >
823
- ${t.name}
953
+ ${e.name}
824
954
  </div>
825
- `}renderDropdown(t){return this.dropdownOpen?lit.html`
826
- <div
827
- class="ppg-backdrop"
828
- @click=${this.handleBackdropClick}
829
- aria-hidden="true"
830
- ></div>
831
- <div
832
- class="ppg-dropdown"
833
- data-position=${this.dropdownPosition}
834
- role="menu"
835
- aria-label="Hidden users"
836
- >
837
- <div class="ppg-dropdown-header">
838
- ${t.length} more
839
- </div>
840
- <div
841
- class="ppg-dropdown-list"
842
- style=${styleMap_js.styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
843
- >
844
- ${t.map(e=>this.renderDropdownItem(e))}
845
- </div>
846
- </div>
847
- `:lit.nothing}renderDropdownItem(t){let e=F(t.name);return lit.html`
955
+ `}renderDropdownItem(e){let t=Y(e.name),o=e.src||e.extCustomerId;return lit.html`
848
956
  <div
849
957
  class="ppg-dropdown-item"
850
958
  role="menuitem"
851
959
  tabindex="0"
852
- @click=${()=>this.handleDropdownItemClick(t)}
853
- @keydown=${o=>this.handleKeyDown(o,()=>this.handleDropdownItemClick(t))}
960
+ @click=${()=>this.handleDropdownItemClick(e)}
961
+ @keydown=${i=>this.handleKeyDown(i,()=>this.handleDropdownItemClick(e))}
854
962
  >
855
- ${t.src?lit.html`<img
963
+ ${o?lit.html`<profile-picture
856
964
  class="ppg-dropdown-avatar"
857
- src=${t.src}
858
- alt=${t.name}
859
- />`:lit.html`<div
965
+ .src=${e.src??""}
966
+ .alt=${e.name}
967
+ .extCustomerId=${e.extCustomerId}
968
+ .size=${40}
969
+ variant="circle"
970
+ shadow="none"
971
+ ></profile-picture>`:lit.html`<div
860
972
  class="ppg-dropdown-avatar-fallback"
861
- style=${styleMap_js.styleMap({background:e})}
973
+ style=${styleMap_js.styleMap({background:t})}
862
974
  >
863
- ${O(t.name)}
975
+ ${J(e.name)}
864
976
  </div>`}
865
977
  <div class="ppg-dropdown-info">
866
- <div class="ppg-dropdown-name">${t.name}</div>
867
- ${this.showPresence&&t.status?lit.html`
978
+ <div class="ppg-dropdown-name">${e.name}</div>
979
+ ${this.showPresence&&e.status?lit.html`
868
980
  <div class="ppg-dropdown-status">
869
981
  <span
870
982
  class="ppg-dropdown-presence"
871
- data-status=${t.status}
983
+ data-status=${e.status}
872
984
  ></span>
873
- ${this.formatStatus(t.status)}
985
+ ${this.formatStatus(e.status)}
874
986
  </div>
875
987
  `:lit.nothing}
876
988
  </div>
877
989
  </div>
878
- `}formatStatus(t){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[t]??t}render(){let{visible:t,hidden:e,showCounter:o}=bt(this.users.length,this.max,this.showAddButton),a=this.direction==="ltr"?this.users.slice(0,t):this.users.slice(0,t).reverse(),p=this.users.slice(t),l=t;o&&l++,this.showAddButton&&l++;let u=ht(l,this.pixelSize,this.overlap,this.spacing),b=o?N(t,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=N(t+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return lit.html`
990
+ `}formatStatus(e){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[e]??e}updated(e){super.updated(e);let t=this.querySelector(".ppg-counter");if(t&&(this.counterRef=t),this.dropdownOpen&&this.portalContainer){let{visible:o}=ne(this.users.length,this.max,this.showAddButton),i=this.users.slice(o);this.updatePortalContent(i);}}render(){let{visible:e,hidden:t,showCounter:o}=ne(this.users.length,this.max,this.showAddButton),i=this.direction==="ltr"?this.users.slice(0,e):this.users.slice(0,e).reverse(),p=this.users.slice(e),l=e;o&&l++,this.showAddButton&&l++;let f=Se(l,this.pixelSize,this.overlap,this.spacing),m=o?K(e,this.pixelSize,this.overlap,this.direction,this.spacing):0,h=K(e+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return lit.html`
879
991
  <div
880
- class=${x("ppg-container",this.animated&&"ppg-animated")}
881
- style=${styleMap_js.styleMap({width:`${u}px`,height:`${this.pixelSize}px`})}
992
+ class=${R("ppg-container",this.animated&&"ppg-animated")}
993
+ style=${styleMap_js.styleMap({width:`${f}px`,height:`${this.pixelSize}px`})}
882
994
  role="group"
883
995
  aria-label="User avatars"
884
996
  >
@@ -886,19 +998,16 @@ ${Ft}`;var i=class extends lit.LitElement{constructor(){super(...arguments);this
886
998
  <slot style="display: none;"></slot>
887
999
 
888
1000
  <!-- Visible avatars -->
889
- ${a.map((k,$)=>this.renderAvatar(k,$,t))}
1001
+ ${i.map((x,v)=>this.renderAvatar(x,v,e))}
890
1002
 
891
1003
  <!-- Counter -->
892
- ${o?this.renderCounter(e,b):lit.nothing}
1004
+ ${o?this.renderCounter(t,m,p):lit.nothing}
893
1005
 
894
1006
  <!-- Add button -->
895
1007
  ${this.showAddButton?this.renderAddButton(h):lit.nothing}
896
1008
 
897
1009
  <!-- Tooltip -->
898
1010
  ${this.renderTooltip()}
899
-
900
- <!-- Dropdown -->
901
- ${o?this.renderDropdown(p):lit.nothing}
902
1011
  </div>
903
- `}};s([decorators_js.property({type:Number})],g.prototype,"max",2),s([decorators_js.property({type:String})],g.prototype,"direction",2),s([decorators_js.property({type:Number})],g.prototype,"overlap",2),s([decorators_js.property({type:String})],g.prototype,"size",2),s([decorators_js.property({type:Number})],g.prototype,"spacing",2),s([decorators_js.property({type:Object})],g.prototype,"tooltip",2),s([decorators_js.property({type:Object})],g.prototype,"dropdown",2),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],g.prototype,"showAddButton",2),s([decorators_js.property({type:String,attribute:"add-button-label"})],g.prototype,"addButtonLabel",2),s([decorators_js.property({type:Boolean})],g.prototype,"animated",2),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],g.prototype,"rotationAmount",2),s([decorators_js.state()],g.prototype,"users",2),s([decorators_js.state()],g.prototype,"dropdownOpen",2),s([decorators_js.state()],g.prototype,"tooltipData",2),g=s([decorators_js.customElement("profile-picture-group")],g);var et=zt__default.default.forwardRef(({max:r,direction:n,overlap:t,size:e,spacing:o,tooltip:a,dropdown:p,showAddButton:l,addButtonLabel:u,animated:b,onAvatarClick:h,onAvatarHover:k,onCounterClick:$,onDropdownItemClick:E,onAddClick:G,className:H,style:V,children:W},I)=>{let A=zt.useRef(null),Y=zt.useCallback(c=>{h?.(c.detail.user);},[h]),J=zt.useCallback(c=>{k?.(c.detail.user);},[k]),K=zt.useCallback(c=>{let U=c;$?.(U.detail.hiddenUsers,U.detail.open);},[$]),q=zt.useCallback(c=>{E?.(c.detail.user);},[E]),Z=zt.useCallback(()=>{G?.();},[G]);return zt.useEffect(()=>{let c=A.current;if(c)return c.addEventListener("avatar-click",Y),c.addEventListener("avatar-hover",J),c.addEventListener("counter-click",K),c.addEventListener("dropdown-item-click",q),c.addEventListener("add-click",Z),()=>{c.removeEventListener("avatar-click",Y),c.removeEventListener("avatar-hover",J),c.removeEventListener("counter-click",K),c.removeEventListener("dropdown-item-click",q),c.removeEventListener("add-click",Z);}},[Y,J,K,q,Z]),zt.useEffect(()=>{typeof I=="function"?I(A.current):I&&(I.current=A.current);},[I]),zt__default.default.createElement("profile-picture-group",{ref:A,max:r,direction:n,overlap:t,size:e,spacing:o,tooltip:a,dropdown:p,"show-add-button":l||void 0,"add-button-label":u,animated:b,class:H,style:V},W)});et.displayName="ProfilePictureGroup";var Dt=zt__default.default.forwardRef(({src:r,alt:n,size:t,variant:e,border:o,borderWidth:a,borderColor:p,bgColor:l,bgGradient:u,ribbon:b,badge:h,loading:k,placeholder:$,placeholderColor:E,fallback:G,onLoad:H,onError:V,className:W,style:I},A)=>zt__default.default.createElement("profile-picture",{ref:A,src:r,alt:n,size:t,variant:e,border:o,"border-width":a,"border-color":p,"bg-color":l,"bg-gradient":u,ribbon:b,badge:h,loading:k,placeholder:$,"placeholder-color":E,fallback:G,onLoad:H,onError:V,className:W,style:I}));Dt.displayName="ProfilePicture";nt();exports.ProfilePicture=Dt;exports.ProfilePictureGroup=et;exports.constructCdnUrl=_;exports.detectThemeFromColor=P;exports.getCdnSizeLabel=Q;//# sourceMappingURL=index.cjs.map
1012
+ `}};s([decorators_js.property({type:Number})],g.prototype,"max",2),s([decorators_js.property({type:String})],g.prototype,"direction",2),s([decorators_js.property({type:Number})],g.prototype,"overlap",2),s([decorators_js.property({type:String})],g.prototype,"size",2),s([decorators_js.property({type:Number})],g.prototype,"spacing",2),s([decorators_js.property({type:Object})],g.prototype,"tooltip",2),s([decorators_js.property({type:Object})],g.prototype,"dropdown",2),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],g.prototype,"showAddButton",2),s([decorators_js.property({type:String,attribute:"add-button-label"})],g.prototype,"addButtonLabel",2),s([decorators_js.property({type:Boolean})],g.prototype,"animated",2),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],g.prototype,"rotationAmount",2),s([decorators_js.state()],g.prototype,"users",2),s([decorators_js.state()],g.prototype,"dropdownOpen",2),s([decorators_js.state()],g.prototype,"tooltipData",2),g=s([decorators_js.customElement("profile-picture-group")],g);var le=Le__default.default.forwardRef(({max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i,dropdown:p,showAddButton:l,addButtonLabel:f,animated:m,rotationAmount:h,onAvatarClick:x,onAvatarHover:v,onCounterClick:T,onDropdownItemClick:b,onAddClick:c,className:M,style:U,children:j},y)=>{let A=Le.useRef(null),B=Le.useCallback(d=>{x?.(d.detail.user);},[x]),O=Le.useCallback(d=>{v?.(d.detail.user);},[v]),G=Le.useCallback(d=>{let k=d;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),P=Le.useCallback(d=>{b?.(d.detail.user);},[b]),V=Le.useCallback(()=>{c?.();},[c]);return Le.useEffect(()=>{let d=A.current;if(d)return d.addEventListener("avatar-click",B),d.addEventListener("avatar-hover",O),d.addEventListener("counter-click",G),d.addEventListener("dropdown-item-click",P),d.addEventListener("add-click",V),()=>{d.removeEventListener("avatar-click",B),d.removeEventListener("avatar-hover",O),d.removeEventListener("counter-click",G),d.removeEventListener("dropdown-item-click",P),d.removeEventListener("add-click",V);}},[B,O,G,P,V]),Le.useEffect(()=>{typeof y=="function"?y(A.current):y&&(y.current=A.current);},[y]),Le__default.default.createElement("profile-picture-group",{ref:A,max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i?JSON.stringify(i):void 0,dropdown:p?JSON.stringify(p):void 0,"show-add-button":l||void 0,"add-button-label":f,animated:m,"rotation-amount":h,class:M,style:U},j)});le.displayName="ProfilePictureGroup";function Be({src:r,alt:n,extCustomerId:e,size:t,variant:o,shadow:i,border:p,borderWidth:l,borderColor:f,rotation:m,bgColor:h,bgGradient:x,glow:v,ring:T,presence:b,badge:c,loading:M,placeholder:U,placeholderColor:j,fallback:y,interactive:A,onLoad:B,onError:O,onCdnError:G,className:P,style:V,ref:d}){let k=Le.useRef(null),Z=Le.useCallback(()=>{B?.();},[B]),Q=Le.useCallback(()=>{O?.();},[O]),_=Le.useCallback(D=>{G?.(D.detail);},[G]);return Le.useEffect(()=>{let D=k.current;if(D)return D.addEventListener("load",Z),D.addEventListener("error",Q),D.addEventListener("cdn-error",_),()=>{D.removeEventListener("load",Z),D.removeEventListener("error",Q),D.removeEventListener("cdn-error",_);}},[Z,Q,_]),Le.useEffect(()=>{typeof d=="function"?d(k.current):d&&(d.current=k.current);},[d]),Le__default.default.createElement("profile-picture",{ref:k,src:r,alt:n,"ext-customer-id":e,size:t,variant:o,shadow:i,border:p||void 0,"border-width":l,"border-color":f,rotation:m,"bg-color":h,"bg-gradient":x,glow:v?JSON.stringify(v):void 0,ring:T?JSON.stringify(T):void 0,presence:b?JSON.stringify(b):void 0,badge:c?JSON.stringify(c):void 0,loading:M,placeholder:U,"placeholder-color":j,fallback:y,interactive:A?JSON.stringify(A):void 0,class:P,style:V})}Be.displayName="ProfilePicture";ge();exports.ProfilePicture=Be;exports.ProfilePictureGroup=le;exports.constructCdnUrl=ae;exports.detectThemeFromColor=ie;exports.getCdnSizeLabel=oe;//# sourceMappingURL=index.cjs.map
904
1013
  //# sourceMappingURL=index.cjs.map