@proximus/lavender-carousel 2.0.0-alpha.1 → 2.0.0-alpha.100

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.
@@ -1,15 +1,13 @@
1
- import { AttributeBreakpointHandlerDelegate } from '@proximus/lavender-common';
2
1
  import '@proximus/lavender-layout';
3
2
  import '@proximus/lavender-button-icon';
4
3
  import '@proximus/lavender-icon';
5
4
  import './AppleSeed.ts';
6
5
  import { type AppleSeed } from './AppleSeed.ts';
6
+ export declare const CAROUSEL_ITEM_CONNECTED_EVENT = "px-carousel-item-connected";
7
7
  export declare class Carousel extends HTMLElement {
8
- visibleItemsAttributeDelegate: AttributeBreakpointHandlerDelegate;
8
+ #private;
9
9
  template: string;
10
10
  constructor();
11
- static get observedAttributes(): string[];
12
- attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
13
11
  connectedCallback(): void;
14
12
  private onScroll;
15
13
  private handleNextPrevious;
@@ -26,4 +24,5 @@ export declare class Carousel extends HTMLElement {
26
24
  export declare class CarouselItem extends HTMLElement {
27
25
  template: string;
28
26
  constructor();
27
+ connectedCallback(): void;
29
28
  }
package/dist/index.es.js CHANGED
@@ -1,19 +1,19 @@
1
- var q = (r) => {
2
- throw TypeError(r);
1
+ var W = (s) => {
2
+ throw TypeError(s);
3
3
  };
4
- var W = (r, t, e) => t.has(r) || q("Cannot " + e);
5
- var d = (r, t, e) => (W(r, t, "read from private field"), e ? e.call(r) : t.get(r)), m = (r, t, e) => t.has(r) ? q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), C = (r, t, e, i) => (W(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e);
6
- import { WithExtraAttributes as T, AttributeBreakpointHandlerDelegate as F, gapValues as _, checkName as rt, backgroundColorValues as ot, PxElement as st, transferAccessibilityAttributes as at, iconSizeValuesKC as nt, cssTokenBreakpoints as lt } from "@proximus/lavender-common";
7
- const ct = ":host{display:block}:host *{box-sizing:border-box}.carousel{overflow:hidden;display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;gap:var(--px-spacing-default-desktop)}@media only screen and (max-width: 768px){.carousel{gap:var(--px-spacing-default-mobile)}}#appleseed-container{margin-inline:var(--px-spacing-s-mobile)}@media only screen and (max-width: 768px){#button-icons{display:none}}.carousel::-webkit-scrollbar{display:none}", dt = "::slotted(*){border-radius:var(--px-radius-main)}:host{scroll-snap-align:start;align-items:center;justify-content:center;flex:1 0 var( --px-carousel-min-width-desktop, var(--px-carousel-min-width-all-desktop) );border-radius:var(--px-radius-main);background:#fff;overflow:hidden}@media screen and (max-width: 768px){:host{scroll-snap-align:center;flex:1 0 var( --px-carousel-min-width-mobile, var(--px-carousel-min-width-all-mobile) )!important}}@media screen and (min-width: 768px) and (max-width: 1024px){:host{flex:1 0 var( --px-carousel-min-width-tablet, var(--px-carousel-min-width-all-tablet) )!important}}", pt = ':host{display:block}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value);overflow-x:var(--overflow-x-all)}@media only screen and (max-width: 47.9375em){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 48em){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media only screen and (min-width: 48em) and (max-width: 64em){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 64.0625em){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media only screen and (min-width: 90.0625em){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', B = new CSSStyleSheet();
8
- B.replaceSync(pt);
9
- const ut = [
4
+ var j = (s, t, e) => t.has(s) || W("Cannot " + e);
5
+ var p = (s, t, e) => (j(s, t, "read from private field"), e ? e.call(s) : t.get(s)), x = (s, t, e) => t.has(s) ? W("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), E = (s, t, e, i) => (j(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), T = (s, t, e) => (j(s, t, "access private method"), e);
6
+ import { WithExtraAttributes as M, AttributeBreakpointHandlerDelegate as ot, gapValues as rt, checkName as nt, log as f, backgroundColorValues as lt, PxElement as ct, accessibilityAttributes as pt, iconSizeValuesKC as dt } from "@proximus/lavender-common";
7
+ const ut = ':host{display:block;--px-carousel-visible-items: 1;--px-carousel-gap-default: var(--px-spacing-default-desktop)}:host *{box-sizing:border-box}:host([visible-items="1"]){--px-carousel-visible-items: 1}:host([visible-items="2"]){--px-carousel-visible-items: 2}:host([visible-items="3"]){--px-carousel-visible-items: 3}:host([visible-items="4"]){--px-carousel-visible-items: 4}:host([visible-items="5"]){--px-carousel-visible-items: 5}:host([visible-items="6"]){--px-carousel-visible-items: 6}:host([visible-items="7"]){--px-carousel-visible-items: 7}:host([visible-items="8"]){--px-carousel-visible-items: 8}:host([visible-items="9"]){--px-carousel-visible-items: 9}:host([visible-items--mobile="1"]){--px-carousel-visible-items--mobile: 1}:host([visible-items--mobile="2"]){--px-carousel-visible-items--mobile: 2}:host([visible-items--mobile="3"]){--px-carousel-visible-items--mobile: 3}:host([visible-items--mobile="4"]){--px-carousel-visible-items--mobile: 4}:host([visible-items--mobile="5"]){--px-carousel-visible-items--mobile: 5}:host([visible-items--mobile="6"]){--px-carousel-visible-items--mobile: 6}:host([visible-items--mobile="7"]){--px-carousel-visible-items--mobile: 7}:host([visible-items--mobile="8"]){--px-carousel-visible-items--mobile: 8}:host([visible-items--mobile="9"]){--px-carousel-visible-items--mobile: 9}:host([visible-items--tablet="1"]){--px-carousel-visible-items--tablet: 1}:host([visible-items--tablet="2"]){--px-carousel-visible-items--tablet: 2}:host([visible-items--tablet="3"]){--px-carousel-visible-items--tablet: 3}:host([visible-items--tablet="4"]){--px-carousel-visible-items--tablet: 4}:host([visible-items--tablet="5"]){--px-carousel-visible-items--tablet: 5}:host([visible-items--tablet="6"]){--px-carousel-visible-items--tablet: 6}:host([visible-items--tablet="7"]){--px-carousel-visible-items--tablet: 7}:host([visible-items--tablet="8"]){--px-carousel-visible-items--tablet: 8}:host([visible-items--tablet="9"]){--px-carousel-visible-items--tablet: 9}:host([visible-items--laptop="1"]){--px-carousel-visible-items--laptop: 1}:host([visible-items--laptop="2"]){--px-carousel-visible-items--laptop: 2}:host([visible-items--laptop="3"]){--px-carousel-visible-items--laptop: 3}:host([visible-items--laptop="4"]){--px-carousel-visible-items--laptop: 4}:host([visible-items--laptop="5"]){--px-carousel-visible-items--laptop: 5}:host([visible-items--laptop="6"]){--px-carousel-visible-items--laptop: 6}:host([visible-items--laptop="7"]){--px-carousel-visible-items--laptop: 7}:host([visible-items--laptop="8"]){--px-carousel-visible-items--laptop: 8}:host([visible-items--laptop="9"]){--px-carousel-visible-items--laptop: 9}:host([visible-items--desktop="1"]){--px-carousel-visible-items--desktop: 1}:host([visible-items--desktop="2"]){--px-carousel-visible-items--desktop: 2}:host([visible-items--desktop="3"]){--px-carousel-visible-items--desktop: 3}:host([visible-items--desktop="4"]){--px-carousel-visible-items--desktop: 4}:host([visible-items--desktop="5"]){--px-carousel-visible-items--desktop: 5}:host([visible-items--desktop="6"]){--px-carousel-visible-items--desktop: 6}:host([visible-items--desktop="7"]){--px-carousel-visible-items--desktop: 7}:host([visible-items--desktop="8"]){--px-carousel-visible-items--desktop: 8}:host([visible-items--desktop="9"]){--px-carousel-visible-items--desktop: 9}:host([gap="default"]){--px-carousel-gap-default: var(--px-spacing-default-desktop)}:host([gap="s"]){--px-carousel-gap-default: var(--px-spacing-s-desktop)}:host([gap="xs"]){--px-carousel-gap-default: var(--px-spacing-xs-desktop)}:host([gap="2xs"]){--px-carousel-gap-default: var(--px-spacing-2xs-desktop)}:host([gap="l"]){--px-carousel-gap-default: var(--px-spacing-l-desktop)}:host([gap="none"]){--px-carousel-gap-default: 0}:host([gap--mobile="default"]){--px-carousel-gap-default--mobile: var(--px-spacing-default-mobile)}:host([gap--mobile="s"]){--px-carousel-gap-default--mobile: var(--px-spacing-s-mobile)}:host([gap--mobile="xs"]){--px-carousel-gap-default--mobile: var(--px-spacing-xs-mobile)}:host([gap--mobile="2xs"]){--px-carousel-gap-default--mobile: var(--px-spacing-2xs-mobile)}:host([gap--mobile="l"]){--px-carousel-gap-default--mobile: var(--px-spacing-l-mobile)}:host([gap--mobile="none"]){--px-carousel-gap-default--mobile: 0}:host([gap--tablet="default"]){--px-carousel-gap-default--tablet: var(--px-spacing-default-tablet)}:host([gap--tablet="s"]){--px-carousel-gap-default--tablet: var(--px-spacing-s-tablet)}:host([gap--tablet="xs"]){--px-carousel-gap-default--tablet: var(--px-spacing-xs-tablet)}:host([gap--tablet="2xs"]){--px-carousel-gap-default--tablet: var(--px-spacing-2xs-tablet)}:host([gap--tablet="l"]){--px-carousel-gap-default--tablet: var(--px-spacing-l-tablet)}:host([gap--tablet="none"]){--px-carousel-gap-default--tablet: 0}:host([gap--laptop="default"]){--px-carousel-gap-default--laptop: var(--px-spacing-default-laptop)}:host([gap--laptop="s"]){--px-carousel-gap-default--laptop: var(--px-spacing-s-laptop)}:host([gap--laptop="xs"]){--px-carousel-gap-default--laptop: var(--px-spacing-xs-laptop)}:host([gap--laptop="2xs"]){--px-carousel-gap-default--laptop: var(--px-spacing-2xs-laptop)}:host([gap--laptop="l"]){--px-carousel-gap-default--laptop: var(--px-spacing-l-laptop)}:host([gap--laptop="none"]){--px-carousel-gap-default--laptop: 0}:host([gap--desktop="default"]){--px-carousel-gap-default--desktop: var(--px-spacing-default-desktop)}:host([gap--desktop="s"]){--px-carousel-gap-default--desktop: var(--px-spacing-s-desktop)}:host([gap--desktop="xs"]){--px-carousel-gap-default--desktop: var(--px-spacing-xs-desktop)}:host([gap--desktop="2xs"]){--px-carousel-gap-default--desktop: var(--px-spacing-2xs-desktop)}:host([gap--desktop="l"]){--px-carousel-gap-default--desktop: var(--px-spacing-l-desktop)}:host([gap--desktop="none"]){--px-carousel-gap-default--desktop: 0}.carousel{overflow:hidden;display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;gap:var(--px-carousel-gap-default--desktop, var(--px-carousel-gap-default))}@media screen and (max-width: 48rem){.carousel{gap:var(--px-carousel-gap-default--mobile, var(--px-carousel-gap-default))}}@media screen and (min-width: 48.0625rem) and (max-width: 64rem){.carousel{gap:var(--px-carousel-gap-default--tablet, var(--px-carousel-gap-default))}}@media screen and (min-width: 64.0625rem) and (max-width: 90rem){.carousel{gap:var(--px-carousel-gap-default--laptop, var(--px-carousel-gap-default))}}#appleseed-container{margin-inline:var(--px-spacing-s-mobile)}@media screen and (max-width: 48rem){#button-icons{display:none}}.carousel::-webkit-scrollbar{display:none}', ht = "::slotted(*){border-radius:var(--px-radius-main);height:100%}.carousel-item{height:100%}:host{scroll-snap-align:start;align-items:center;justify-content:center;border-radius:var(--px-radius-main);background:#fff;overflow:hidden;--visible-items: var( --px-carousel-visible-items--desktop, var(--px-carousel-visible-items, 1) );--spacing: var( --px-carousel-gap-default--desktop, var(--px-carousel-gap-default, var(--px-spacing-s-desktop)) );min-width:calc((100% - max(var(--visible-items),2) * var(--spacing)) / var(--visible-items) - 64px / max(var(--visible-items),2))}@media screen and (max-width: 48rem){:host{--visible-items: var( --px-carousel-visible-items--mobile, var(--px-carousel-visible-items, 1) );--spacing: var( --px-carousel-gap-default--mobile, var(--px-carousel-gap-default, var(--px-spacing-s-mobile)) )}}@media screen and (min-width: 48.0625rem) and (max-width: 64rem){:host{--visible-items: var( --px-carousel-visible-items--tablet, var(--px-carousel-visible-items, 1) );--spacing: var( --px-carousel-gap-default--tablet, var(--px-carousel-gap-default, var(--px-spacing-s-desktop)) )}}@media screen and (min-width: 64.0625rem) and (max-width: 90rem){:host{--visible-items: var( --px-carousel-visible-items--laptop, var(--px-carousel-visible-items, 1) );--spacing: var( --px-carousel-gap-default--laptop, var(--px-carousel-gap-default, var(--px-spacing-s-desktop)) )}}@media screen and (max-width: 48rem){:host{scroll-snap-align:center;flex:1 0 var( --px-carousel-min-width-mobile, var(--px-carousel-min-width-all-mobile) )!important}}@media screen and (min-width: 48rem) and (max-width: 64rem){:host{flex:1 0 var( --px-carousel-min-width-tablet, var(--px-carousel-min-width-all-tablet) )!important}}", bt = ':host{display:block}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-mobile) - var(--host-gap--mobile))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value);overflow-x:var(--overflow-x-all)}@media screen and (max-width: 47.938rem){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media screen and (min-width: 48rem){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-tablet) - var(--host-gap--tablet))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media screen and (min-width: 48rem) and (max-width: 64rem){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media screen and (min-width: 64.0625rem){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-laptop) - var(--host-gap--laptop))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media screen and (min-width: 64.0625rem) and (max-width: 90rem){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media screen and (min-width: 90.0625rem){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host ::slotted(px-h1[auto-spacing]),:host ::slotted(px-h2[auto-spacing]),:host ::slotted(px-h3[auto-spacing]),:host ::slotted(px-h4[auto-spacing]),:host ::slotted(px-h5[auto-spacing]),:host ::slotted(px-h6[auto-spacing]){margin-bottom:calc(var(--px-spacing-heading-to-content-desktop) - var(--host-gap--desktop))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', G = new CSSStyleSheet();
8
+ G.replaceSync(bt);
9
+ const gt = [
10
10
  "",
11
11
  "default",
12
12
  "row",
13
13
  "row-reverse",
14
14
  "column",
15
15
  "column-reverse"
16
- ], ht = [
16
+ ], vt = [
17
17
  "",
18
18
  "default",
19
19
  "stretch",
@@ -21,7 +21,7 @@ const ut = [
21
21
  "flex-end",
22
22
  "center",
23
23
  "baseline"
24
- ], bt = [
24
+ ], xt = [
25
25
  "",
26
26
  "default",
27
27
  "flex-start",
@@ -30,10 +30,10 @@ const ut = [
30
30
  "space-between",
31
31
  "space-around",
32
32
  "space-evenly"
33
- ], gt = ["", "default", "nowrap", "wrap", "wrap-reverse"], vt = ["", "visible", "hidden", "scroll", "auto"];
34
- class E extends T {
33
+ ], mt = ["", "default", "nowrap", "wrap", "wrap-reverse"], ft = ["", "visible", "hidden", "scroll", "auto"];
34
+ class P extends M {
35
35
  constructor() {
36
- super(B), this.overflowXAttributeDelegate = new F(
36
+ super(G), this.overflowXAttributeDelegate = new ot(
37
37
  this,
38
38
  "overflow-x",
39
39
  (t) => t,
@@ -87,7 +87,7 @@ class E extends T {
87
87
  case "gap--tablet":
88
88
  case "gap--laptop":
89
89
  case "gap--desktop":
90
- this.updateFlexProperties(t, e, i, _);
90
+ this.updateFlexProperties(t, e, i, rt);
91
91
  break;
92
92
  case "justify-content":
93
93
  case "justify-content--mobile":
@@ -98,7 +98,7 @@ class E extends T {
98
98
  t,
99
99
  e,
100
100
  i,
101
- bt
101
+ xt
102
102
  );
103
103
  break;
104
104
  case "align-items":
@@ -106,37 +106,39 @@ class E extends T {
106
106
  case "align-items--tablet":
107
107
  case "align-items--laptop":
108
108
  case "align-items--desktop":
109
- this.updateFlexProperties(t, e, i, ht);
109
+ this.updateFlexProperties(t, e, i, vt);
110
110
  break;
111
111
  case "wrap":
112
112
  case "wrap--mobile":
113
113
  case "wrap--tablet":
114
114
  case "wrap--laptop":
115
115
  case "wrap--desktop":
116
- this.updateFlexProperties(t, e, i, gt);
116
+ this.updateFlexProperties(t, e, i, mt);
117
117
  break;
118
118
  case "direction":
119
119
  case "direction--mobile":
120
120
  case "direction--tablet":
121
121
  case "direction--laptop":
122
122
  case "direction--desktop":
123
- this.updateFlexProperties(t, e, i, ut);
123
+ this.updateFlexProperties(t, e, i, gt);
124
124
  break;
125
125
  case "overflow-x":
126
126
  case "overflow-x--mobile":
127
127
  case "overflow-x--tablet":
128
128
  case "overflow-x--laptop":
129
129
  case "overflow-x--desktop":
130
- this.updateOverflowX(t, e, i, vt);
130
+ this.updateOverflowX(t, e, i, ft);
131
131
  break;
132
132
  default:
133
133
  super.attributeChangedCallback(t, e, i);
134
134
  break;
135
135
  }
136
136
  }
137
- updateOverflowX(t, e, i, o) {
138
- if (!rt(o, i)) {
139
- console.error(`${i} is not an allowed ${t} value`);
137
+ updateOverflowX(t, e, i, a) {
138
+ if (!nt(a, i)) {
139
+ f(
140
+ `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
141
+ );
140
142
  return;
141
143
  }
142
144
  this.overflowXAttributeDelegate.attributeChangedCallback(
@@ -145,23 +147,28 @@ class E extends T {
145
147
  i
146
148
  );
147
149
  }
148
- updateFlexProperties(t, e, i, o) {
149
- this.checkName(o, i) || console.error(`${i} is not a valid value for ${o}`);
150
- const n = t.indexOf("--") > -1, l = n ? t.split("--")[0] : t, a = [];
151
- if (!n)
152
- this.getAttribute(l + "--mobile") || a.push("mobile"), this.getAttribute(l + "--tablet") || a.push("tablet"), this.getAttribute(l + "--laptop") || a.push("laptop"), this.getAttribute(l + "--desktop") || a.push("desktop"), a.forEach((c) => {
153
- this.updateStyle(l, c, e, o), this.updateStyle(l, c, i, o);
150
+ updateFlexProperties(t, e, i, a) {
151
+ this.checkName(a, i) || f(
152
+ `${i} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
153
+ );
154
+ const r = t.indexOf("--") > -1, o = r ? t.split("--")[0] : t, l = [];
155
+ if (!r)
156
+ this.getAttribute(o + "--mobile") || l.push("mobile"), this.getAttribute(o + "--tablet") || l.push("tablet"), this.getAttribute(o + "--laptop") || l.push("laptop"), this.getAttribute(o + "--desktop") || l.push("desktop"), l.forEach((c) => {
157
+ this.updateStyle(o, c, e, a), this.updateStyle(o, c, i, a);
154
158
  });
155
159
  else {
156
160
  const c = t.split("--")[1];
157
- this.updateStyle(l, c, e, o), this.updateStyle(l, c, i, o);
161
+ this.updateStyle(o, c, e, a), this.updateStyle(o, c, i, a);
158
162
  }
159
163
  }
160
- updateStyle(t, e, i, o) {
161
- i && (t === "gap" && o && o.includes(i) ? this.$el.style.setProperty(
164
+ updateStyle(t, e, i, a) {
165
+ i && (t === "gap" && a && a.includes(i) ? (this.$el.style.setProperty(
162
166
  `--flex-${t}--${e}-value`,
163
167
  `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
164
- ) : this.$el.style.setProperty(
168
+ ), this.style.setProperty(
169
+ `--host-gap--${e}`,
170
+ `var(--px-spacing-${i}-${e === "laptop" ? "desktop" : e})`
171
+ )) : this.$el.style.setProperty(
165
172
  `--flex-${t}--${e}-value`,
166
173
  i
167
174
  ));
@@ -350,8 +357,8 @@ class E extends T {
350
357
  return this.shadowRoot.querySelector(".flex-container");
351
358
  }
352
359
  }
353
- customElements.get("px-stack") || customElements.define("px-stack", E);
354
- class ft extends E {
360
+ customElements.get("px-stack") || customElements.define("px-stack", P);
361
+ class kt extends P {
355
362
  constructor() {
356
363
  super();
357
364
  }
@@ -359,8 +366,8 @@ class ft extends E {
359
366
  super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
360
367
  }
361
368
  }
362
- customElements.get("px-vstack") || customElements.define("px-vstack", ft);
363
- class xt extends E {
369
+ customElements.get("px-vstack") || customElements.define("px-vstack", kt);
370
+ class wt extends P {
364
371
  constructor() {
365
372
  super();
366
373
  }
@@ -368,19 +375,25 @@ class xt extends E {
368
375
  super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
369
376
  }
370
377
  }
371
- customElements.get("px-hstack") || customElements.define("px-hstack", xt);
372
- class mt extends HTMLElement {
378
+ customElements.get("px-hstack") || customElements.define("px-hstack", wt);
379
+ class yt extends HTMLElement {
373
380
  constructor() {
374
- super();
381
+ super(), this.isZeroSized = !1, this.growValue = "1", this.isVertical = !1;
375
382
  }
376
383
  static get observedAttributes() {
377
- return ["grow"];
384
+ return ["grow", "nogap"];
378
385
  }
379
386
  attributeChangedCallback(t, e, i) {
380
- t === "grow" && (this.style.flexGrow = i);
387
+ t === "grow" && (this.growValue = i || "1", this.isZeroSized || (this.style.flexGrow = this.growValue), this.scheduleRecheck());
381
388
  }
382
389
  connectedCallback() {
383
- this.style.flexGrow = this.getAttribute("grow") || "1";
390
+ this.growValue = this.getAttribute("grow") || "1", this.style.flexGrow = this.growValue, this.nogap && (this.resizeObserver = new ResizeObserver(() => {
391
+ this.handleSizeChange();
392
+ }), this.isVertical = this.parentElement.localName === "px-vstack" || this.parentElement.style.flexDirection === "column", this.resizeObserver.observe(this), this.scheduleRecheck());
393
+ }
394
+ disconnectedCallback() {
395
+ var t;
396
+ (t = this.resizeObserver) == null || t.disconnect(), this.recheckHandle && (cancelAnimationFrame(this.recheckHandle), this.recheckHandle = void 0);
384
397
  }
385
398
  get grow() {
386
399
  return this.getAttribute("grow");
@@ -388,13 +401,34 @@ class mt extends HTMLElement {
388
401
  set grow(t) {
389
402
  this.setAttribute("grow", t);
390
403
  }
404
+ scheduleRecheck() {
405
+ this.recheckHandle && cancelAnimationFrame(this.recheckHandle), this.recheckHandle = requestAnimationFrame(() => {
406
+ this.recheckHandle = void 0, this.recalculateVisibility();
407
+ });
408
+ }
409
+ recalculateVisibility() {
410
+ this.isConnected && (this.style.display = "", this.style.flexGrow = this.growValue, this.handleSizeChange());
411
+ }
412
+ handleSizeChange() {
413
+ const t = this.getBoundingClientRect(), e = t.width === 0 && !this.isVertical || t.height === 0 && this.isVertical;
414
+ this.isZeroSized !== e && (this.isZeroSized = e, this.updateParticipation());
415
+ }
416
+ updateParticipation() {
417
+ this.isZeroSized ? (this.style.display = "none", this.style.flexGrow = "0") : (this.style.display = "", this.style.flexGrow = this.growValue);
418
+ }
419
+ get nogap() {
420
+ return this.hasAttribute("nogap");
421
+ }
422
+ set nogap(t) {
423
+ t ? this.setAttribute("nogap", "") : this.removeAttribute("nogap");
424
+ }
391
425
  }
392
- customElements.get("px-spacer") || customElements.define("px-spacer", mt);
393
- const kt = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", G = new CSSStyleSheet();
394
- G.replaceSync(kt);
395
- class yt extends T {
426
+ customElements.get("px-spacer") || customElements.define("px-spacer", yt);
427
+ const At = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5rem}", Z = new CSSStyleSheet();
428
+ Z.replaceSync(At);
429
+ class $t extends M {
396
430
  constructor() {
397
- super(G), this.template = (t) => `
431
+ super(Z), this.template = (t) => `
398
432
  <px-container border-radius="none" padding="none">
399
433
  <px-vstack>
400
434
  <px-container id="header-container" border-radius="none">
@@ -571,7 +605,7 @@ class yt extends T {
571
605
  case "background-color":
572
606
  this.$bodyContainer.setAttribute(
573
607
  "background-color",
574
- ot.indexOf(i) > 0 ? i : "none"
608
+ lt.indexOf(i) > 0 ? i : "none"
575
609
  );
576
610
  break;
577
611
  case "padding-vertical":
@@ -591,23 +625,24 @@ class yt extends T {
591
625
  this.$headerContainer.paddingLeft = t, this.$headerContainer.paddingRight = t, this.$bodyContainer.paddingLeft = t, this.$bodyContainer.paddingRight = t, this.$contactContainer.paddingLeft = t, this.$contactContainer.paddingRight = t, this.$footerContainer.paddingLeft = t, this.$footerContainer.paddingRight = t, this.$imageContainer.paddingLeft = t, this.$imageContainer.paddingRight = t;
592
626
  }
593
627
  }
594
- customElements.get("px-page") === void 0 && customElements.define("px-page", yt);
595
- const wt = ".btn-icon{font-size:var(--px-font-size-base);display:inline-flex;width:var(--px-size-l);height:var(--px-size-l);vertical-align:middle;align-items:center;justify-content:center;cursor:pointer;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition);background:var(--px-color-background-container-primary-default);color:var(--px-color-icon-brand-inverted);border-radius:var(--px-radius-pill);padding:var(--px-padding-xs-mobile);border:var(--px-size-border-m) solid transparent}.btn-icon,.btn-icon *{box-sizing:border-box}.btn-icon ::slotted(px-icon){line-height:0}.btn-icon:hover:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-bordered-default);color:var(--px-color-icon-brand-default);border-color:var(--px-color-border-state-hover-default)}.btn-icon:active:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-active-inverted);color:var(--px-color-icon-state-active-default);border-color:var(--px-color-border-state-active-default)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}.btn-icon[disabled],.btn-icon[aria-disabled=true]{background:var(--px-color-background-state-disabled-default);color:var(--px-color-icon-state-disabled-default);cursor:default;pointer-events:none}.btn-icon.btn-icon--state-loading{background:var(--px-color-background-state-disabled-default);color:var(--px-color-icon-brand-default);cursor:inherit}.btn-icon--size-small{padding:var(--px-padding-2xs-mobile);width:var(--px-size-m);height:var(--px-size-m)}.btn-icon--variant-secondary{background-color:var(--px-color-background-container-secondary-default);color:var(--px-color-icon-brand-default)}.btn-icon--variant-naked{background-color:transparent;color:var(--px-color-icon-brand-default);width:auto;height:auto}:host([inverted]) .btn-icon{background:var(--px-color-background-container-primary-inverted);color:var(--px-color-icon-brand-default)}:host([inverted]) .btn-icon:hover:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-bordered-inverted);color:var(--px-color-icon-brand-inverted);border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]) .btn-icon:active:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-default);color:var(--px-color-icon-state-active-inverted);border-color:var(--px-color-border-state-active-inverted)}:host([inverted]) .btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .btn-icon[disabled],:host([inverted]) .btn-icon[aria-disabled=true]{background:var(--px-color-background-state-disabled-inverted);color:var(--px-color-icon-state-disabled-inverted)}:host([inverted]) .btn-icon.btn-icon--state-loading{background:var(--px-color-background-state-disabled-inverted);color:var(--px-color-icon-brand-inverted);border-color:transparent}:host([inverted]) .btn-icon.btn-icon--variant-naked{background-color:transparent;color:var(--px-color-icon-brand-inverted)}:host([inverted]) .btn-icon--variant-secondary{background-color:var(--px-color-background-container-secondary-inverted);color:var(--px-color-icon-brand-inverted)}@media only screen and (min-width: 768px){.btn-icon{padding:var(--px-padding-xs-desktop)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}.btn-icon--size-small{padding:var(--px-padding-2xs-desktop)}}@media only screen and (min-width: 1025px){.btn-icon{padding:var(--px-padding-xs-desktop)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}.btn-icon--size-small{padding:var(--px-padding-2xs-desktop)}}", U = new CSSStyleSheet();
596
- U.replaceSync(wt);
597
- const At = ["", "default", "small"], $t = [
628
+ customElements.get("px-page") === void 0 && customElements.define("px-page", $t);
629
+ const St = ".btn-icon{font-size:var(--px-font-size-base);display:inline-flex;width:var(--px-size-l);height:var(--px-size-l);vertical-align:middle;align-items:center;justify-content:center;cursor:pointer;--btn-transition: all .2s ease-in-out 0s;transition:var(--btn-transition);background:var(--px-color-background-container-primary-default);color:var(--px-color-icon-brand-inverted);border-radius:var(--px-radius-pill);padding:var(--px-padding-xs-mobile);border:var(--px-size-border-m) solid transparent}.btn-icon,.btn-icon *{box-sizing:border-box}.btn-icon ::slotted(px-icon){line-height:0}.btn-icon:hover:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-bordered-default);color:var(--px-color-icon-brand-default);border-color:var(--px-color-border-state-hover-default)}.btn-icon:active:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-active-inverted);color:var(--px-color-icon-state-active-default);border-color:var(--px-color-border-state-active-default)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-mobile);outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default)}.btn-icon[disabled],.btn-icon[aria-disabled=true]{background:var(--px-color-background-state-disabled-default);color:var(--px-color-icon-state-disabled-default);cursor:default;pointer-events:none}.btn-icon.btn-icon--state-loading{background:var(--px-color-background-state-disabled-default);color:var(--px-color-icon-brand-default);cursor:inherit}.btn-icon--size-small{padding:var(--px-padding-2xs-mobile);width:var(--px-size-m);height:var(--px-size-m)}.btn-icon--variant-secondary{background-color:var(--px-color-background-container-secondary-default);color:var(--px-color-icon-brand-default)}.btn-icon--variant-naked{background-color:transparent;color:var(--px-color-icon-brand-default);width:auto;height:auto}:host([inverted]) .btn-icon{background:var(--px-color-background-container-primary-inverted);color:var(--px-color-icon-brand-default)}:host([inverted]) .btn-icon:hover:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-bordered-inverted);color:var(--px-color-icon-brand-inverted);border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]) .btn-icon:active:not([disabled],[aria-disabled=true],.btn-icon--state-loading){background:var(--px-color-background-state-hover-default);color:var(--px-color-icon-state-active-inverted);border-color:var(--px-color-border-state-active-inverted)}:host([inverted]) .btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-color:var(--px-color-border-focus-outline-inverted)}:host([inverted]) .btn-icon[disabled],:host([inverted]) .btn-icon[aria-disabled=true]{background:var(--px-color-background-state-disabled-inverted);color:var(--px-color-icon-state-disabled-inverted)}:host([inverted]) .btn-icon.btn-icon--state-loading{background:var(--px-color-background-state-disabled-inverted);color:var(--px-color-icon-brand-inverted);border-color:transparent}:host([inverted]) .btn-icon.btn-icon--variant-naked{background-color:transparent;color:var(--px-color-icon-brand-inverted)}:host([inverted]) .btn-icon--variant-secondary{background-color:var(--px-color-background-container-secondary-inverted);color:var(--px-color-icon-brand-inverted)}@media screen and (min-width: 48rem){.btn-icon{padding:var(--px-padding-xs-desktop)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}.btn-icon--size-small{padding:var(--px-padding-2xs-desktop)}}@media screen and (min-width: 64.0625rem){.btn-icon{padding:var(--px-padding-xs-desktop)}.btn-icon:focus-visible:not([disabled],[aria-disabled=true]){outline-offset:var(--px-focus-offset-desktop);outline-width:var(--px-focus-outline-desktop)}.btn-icon--size-small{padding:var(--px-padding-2xs-desktop)}}", B = new CSSStyleSheet();
630
+ B.replaceSync(St);
631
+ const Ct = ["", "default", "small"], zt = [
598
632
  "",
599
633
  "default",
600
634
  "secondary",
601
635
  "naked"
602
- ], R = class R extends st {
636
+ ], $ = class $ extends ct {
603
637
  constructor() {
604
- super(U), this.template = () => "<slot></slot>";
605
- const t = document.createElement(this.nativeName);
638
+ super(B), this.template = () => "<slot></slot>";
639
+ const t = document.createElement($.nativeName);
606
640
  t.classList.add("btn-icon"), t.innerHTML = this.template(), this.shadowRoot.appendChild(t);
607
641
  }
608
642
  static get observedAttributes() {
609
643
  return [
610
644
  ...super.observedAttributes,
645
+ ...pt,
611
646
  "inverted",
612
647
  "loading",
613
648
  "size",
@@ -616,7 +651,6 @@ const At = ["", "default", "small"], $t = [
616
651
  ];
617
652
  }
618
653
  connectedCallback() {
619
- super.connectedCallback();
620
654
  const t = this.querySelector("px-icon");
621
655
  if (t) {
622
656
  const e = t.getAttribute("size"), i = t.getAttribute("color");
@@ -624,7 +658,6 @@ const At = ["", "default", "small"], $t = [
624
658
  this.$el.focus();
625
659
  }), e || t.setAttribute("size", "s"), this.size === "small" && t.setAttribute("size", "xs"), i || t.setAttribute("color", "inherit");
626
660
  }
627
- at(this, this.$el, !1);
628
661
  }
629
662
  attributeChangedCallback(t, e, i) {
630
663
  if (e !== i)
@@ -653,10 +686,14 @@ const At = ["", "default", "small"], $t = [
653
686
  this.$el.classList.toggle("btn-icon--state-loading");
654
687
  }
655
688
  updateSize(t, e) {
656
- this.checkName(At, e) ? (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--size-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--size-${e}`)) : console.error(`${e} is not a valid size value`);
689
+ this.checkName(Ct, e) ? (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--size-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--size-${e}`)) : f(
690
+ `${e} is not a valid size value for ${this.tagName.toLowerCase()}`
691
+ );
657
692
  }
658
693
  updateVariant(t, e) {
659
- this.checkName($t, e) ? (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--variant-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--variant-${e}`)) : console.error(`${e} is not a valid variant value`);
694
+ this.checkName(zt, e) ? (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`btn-icon--variant-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`btn-icon--variant-${e}`)) : f(
695
+ `${e} is not a valid variant value for ${this.tagName.toLowerCase()}`
696
+ );
660
697
  }
661
698
  get inverted() {
662
699
  return this.getAttribute("inverted");
@@ -689,10 +726,10 @@ const At = ["", "default", "small"], $t = [
689
726
  t ? this.setAttribute("aria-expanded", t) : this.removeAttribute("aria-expanded");
690
727
  }
691
728
  };
692
- R.nativeName = "button";
693
- let L = R;
694
- customElements.get("px-button-icon") || customElements.define("px-button-icon", L);
695
- class St extends HTMLElement {
729
+ $.nativeName = "button";
730
+ let I = $;
731
+ customElements.get("px-button-icon") || customElements.define("px-button-icon", I);
732
+ class Lt extends HTMLElement {
696
733
  constructor() {
697
734
  super();
698
735
  }
@@ -725,9 +762,10 @@ class St extends HTMLElement {
725
762
  t && t.remove();
726
763
  }
727
764
  }
728
- customElements.get("px-icon-set") || customElements.define("px-icon-set", St);
729
- const Ct = [
765
+ customElements.get("px-icon-set") || customElements.define("px-icon-set", Lt);
766
+ const jt = [
730
767
  "Brand",
768
+ "Accent",
731
769
  "Neutral",
732
770
  "Dimmed",
733
771
  "PurposeSuccess",
@@ -738,57 +776,58 @@ const Ct = [
738
776
  "StateHover",
739
777
  "StateActive",
740
778
  "StateDisabled"
741
- ], zt = ["Inherit", ...Ct].map(
742
- (r) => r.replace(/([A-Z])/g, "-$1").toLowerCase().slice(1)
743
- ), jt = ":host{display:inline-flex;flex-direction:column;justify-content:center}svg{font-size:var(--px-size-icon-s);line-height:var(--px-font-line-height-xs);width:1em;height:1em;color:var(--px-color-icon-brand-default)}.inherit{color:inherit}.brand{color:var(--px-color-icon-brand-default)}.neutral{color:var(--px-color-icon-neutral-default)}.dimmed{color:var(--px-color-icon-dimmed-default)}.purpose-success{color:var(--px-color-icon-purpose-success-default)}.purpose-warning{color:var(--px-color-icon-purpose-warning-default)}.purpose-error{color:var(--px-color-icon-purpose-error-default)}.purpose-unlimited{color:var(--px-color-icon-purpose-unlimited-default)}.purpose-promo{color:var(--px-color-icon-purpose-promo-default)}.state-hover:hover{color:var(--px-color-icon-state-hover-default)}.state-active:active{color:var(--px-color-icon-state-active-default)}.state-disabled{color:var(--px-color-icon-state-disabled-default)}:host([inverted]) svg{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .inherit{color:inherit}:host([inverted]) .brand{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .neutral{color:var(--px-color-icon-neutral-inverted)}:host([inverted]) .dimmed{color:var(--px-color-icon-dimmed-inverted)}:host([inverted]) .purpose-success{color:var(--px-color-icon-purpose-success-inverted)}:host([inverted]) .purpose-warning{color:var(--px-color-icon-purpose-warning-inverted)}:host([inverted]) .purpose-error{color:var(--px-color-icon-purpose-error-inverted)}:host([inverted]) .purpose-unlimited{color:var(--px-color-icon-purpose-unlimited-inverted)}:host([inverted]) .purpose-promo{color:var(--px-color-icon-purpose-promo-inverted)}:host([inverted]) .state-hover:hover{color:var(--px-color-icon-state-hover-inverted)}:host([inverted]) .state-active:active{color:var(--px-color-icon-state-active-inverted)}:host([inverted]) .state-disabled{color:var(--px-color-icon-state-disabled-inverted)}.size-xs{font-size:var(--px-size-icon-xs)}.size-s{font-size:var(--px-size-icon-s)}.size-m{font-size:var(--px-size-icon-m)}.size-l{font-size:var(--px-size-icon-l)}.size-xl{font-size:var(--px-size-icon-xl)}", K = new CSSStyleSheet();
744
- K.replaceSync(jt);
745
- const Lt = [
746
- "name",
747
- "size",
748
- "color",
749
- "aria-label",
750
- "inverted",
751
- "from",
752
- "disabled"
753
- ];
754
- var h, p, w;
755
- class Tt extends T {
779
+ ], Et = ["Inherit", ...jt].map(
780
+ (s) => s.replace(/([A-Z])/g, "-$1").toLowerCase().slice(1)
781
+ ), Tt = ":host{display:inline-flex;flex-direction:column;justify-content:center}svg{font-size:var(--px-size-icon-s);line-height:var(--px-font-line-height-xs);width:1em;height:1em;color:var(--px-color-icon-accent-default)}.inherit{color:inherit}.brand{color:var(--px-color-icon-brand-default)}.accent{color:var(--px-color-icon-accent-default)}.neutral{color:var(--px-color-icon-neutral-default)}.dimmed{color:var(--px-color-icon-dimmed-default)}.purpose-success{color:var(--px-color-icon-purpose-success-default)}.purpose-warning{color:var(--px-color-icon-purpose-warning-default)}.purpose-error{color:var(--px-color-icon-purpose-error-default)}.purpose-unlimited{color:var(--px-color-icon-purpose-unlimited-default)}.purpose-promo{color:var(--px-color-icon-purpose-promo-default)}.state-hover:hover{color:var(--px-color-icon-state-hover-default)}.state-active:active{color:var(--px-color-icon-state-active-default)}.state-disabled{color:var(--px-color-icon-state-disabled-default)}:host([inverted]) svg{color:var(--px-color-icon-accent-inverted)}:host([inverted]) .inherit{color:inherit}:host([inverted]) .brand{color:var(--px-color-icon-brand-inverted)}:host([inverted]) .accent{color:var(--px-color-icon-accent-inverted)}:host([inverted]) .neutral{color:var(--px-color-icon-neutral-inverted)}:host([inverted]) .dimmed{color:var(--px-color-icon-dimmed-inverted)}:host([inverted]) .purpose-success{color:var(--px-color-icon-purpose-success-inverted)}:host([inverted]) .purpose-warning{color:var(--px-color-icon-purpose-warning-inverted)}:host([inverted]) .purpose-error{color:var(--px-color-icon-purpose-error-inverted)}:host([inverted]) .purpose-unlimited{color:var(--px-color-icon-purpose-unlimited-inverted)}:host([inverted]) .purpose-promo{color:var(--px-color-icon-purpose-promo-inverted)}:host([inverted]) .state-hover:hover{color:var(--px-color-icon-state-hover-inverted)}:host([inverted]) .state-active:active{color:var(--px-color-icon-state-active-inverted)}:host([inverted]) .state-disabled{color:var(--px-color-icon-state-disabled-inverted)}.size-xs{font-size:var(--px-size-icon-xs)}.size-s{font-size:var(--px-size-icon-s)}.size-m{font-size:var(--px-size-icon-m)}.size-l{font-size:var(--px-size-icon-l)}.size-xl{font-size:var(--px-size-icon-xl)}", U = new CSSStyleSheet();
782
+ U.replaceSync(Tt);
783
+ var h, d, S;
784
+ class Rt extends M {
756
785
  constructor(...e) {
757
786
  var i;
758
- super(...e, K);
759
- m(this, h);
760
- m(this, p);
761
- m(this, w, () => `<svg aria-hidden="true">
762
- <use xlink:href="#icon-${this.name}"></use>
787
+ super(...e, U);
788
+ x(this, h);
789
+ x(this, d);
790
+ x(this, S, () => `<svg aria-hidden="true">
791
+ <use></use>
763
792
  </svg>`);
764
- this.shadowRoot.innerHTML = d(this, w).call(this), C(this, p, (i = this.attachInternals) == null ? void 0 : i.call(this)), d(this, p) && (d(this, p).role = "img");
793
+ this.shadowRoot.innerHTML = p(this, S).call(this), E(this, d, (i = this.attachInternals) == null ? void 0 : i.call(this)), p(this, d) && (p(this, d).role = "img");
765
794
  }
766
795
  static get observedAttributes() {
767
- return [...super.observedAttributes, ...Lt];
796
+ return [
797
+ ...super.observedAttributes,
798
+ "name",
799
+ "size",
800
+ "color",
801
+ "aria-label",
802
+ "inverted",
803
+ "from",
804
+ "disabled"
805
+ ];
768
806
  }
769
- attributeChangedCallback(e, i, o) {
770
- if (i !== o)
807
+ attributeChangedCallback(e, i, a) {
808
+ if (i !== a)
771
809
  switch (e) {
772
810
  case "name":
773
- this.updateName(i, o);
811
+ this.updateName(i, a);
774
812
  break;
775
813
  case "size":
776
- this.updateAttribute(e, i, o, nt);
814
+ this.updateAttribute(e, i, a, dt);
777
815
  break;
778
816
  case "color":
779
- this.updateAttribute(e, i, o, zt);
817
+ this.updateAttribute(e, i, a, Et);
780
818
  break;
781
819
  case "disabled":
782
820
  this.color = "state-disabled";
783
821
  break;
784
822
  case "aria-label":
785
- if (!d(this, p))
823
+ if (!p(this, d))
786
824
  return;
787
- o ? d(this, p).ariaHidden = "false" : d(this, p).ariaHidden = "true";
825
+ a ? (p(this, d).ariaHidden = "false", this.ariaHidden = "false") : (p(this, d).ariaHidden = "true", this.ariaHidden = "true");
788
826
  break;
789
827
  }
790
828
  }
791
829
  connectedCallback() {
830
+ this.role = "img";
792
831
  const e = document.querySelectorAll("px-icon-set");
793
832
  e || console.log("<px-icon-set> component not found");
794
833
  for (const i of e) {
@@ -796,20 +835,22 @@ class Tt extends T {
796
835
  console.error("Icon name or src not found");
797
836
  continue;
798
837
  }
799
- i.getAttribute("name") === this.from && i.getAttribute("type") !== "font" && (C(this, h, i.getAttribute("src")), this.$el.firstElementChild.setAttribute(
800
- "xlink:href",
801
- `${d(this, h)}#icon-${this.name}`
838
+ i.getAttribute("name") === this.from && i.getAttribute("type") !== "font" && (E(this, h, i.getAttribute("src")), this.$el.firstElementChild.setAttribute(
839
+ "href",
840
+ `${p(this, h)}#icon-${this.name}`
802
841
  ));
803
842
  }
804
- !this.ariaLabel && d(this, p) && (d(this, p).ariaHidden = "true");
843
+ !this.ariaLabel && p(this, d) && (p(this, d).ariaHidden = "true", this.ariaHidden = "true");
805
844
  }
806
- updateAttribute(e, i, o, n) {
807
- i !== null && i !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${i}`) : this.$el.classList.toggle(i)), o !== null && o !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${o}`) : this.$el.classList.toggle(o)), this.checkName(n, o) || console.error(`${o} is not an allowed ${e} value`);
845
+ updateAttribute(e, i, a, r) {
846
+ i !== null && i !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${i}`) : this.$el.classList.toggle(i)), a !== null && a !== "" && (e === "size" ? this.$el.classList.toggle(`${e}-${a}`) : this.$el.classList.toggle(a)), this.checkName(r, a) || f(
847
+ `${a} is not an allowed ${e} value for ${this.tagName.toLowerCase()}`
848
+ );
808
849
  }
809
850
  updateName(e, i) {
810
- d(this, h) && this.$el.firstElementChild.setAttribute(
811
- "xlink:href",
812
- `${d(this, h)}#icon-${i}`
851
+ p(this, h) && this.$el.firstElementChild.setAttribute(
852
+ "href",
853
+ `${p(this, h)}#icon-${i}`
813
854
  );
814
855
  }
815
856
  get $el() {
@@ -858,20 +899,20 @@ class Tt extends T {
858
899
  this.setAttribute("disabled", e);
859
900
  }
860
901
  }
861
- h = new WeakMap(), p = new WeakMap(), w = new WeakMap();
862
- customElements.get("px-icon") || customElements.define("px-icon", Tt);
863
- const Et = ":host{--px-appleseed-size-l: 14px;--px-appleseed-size-m: 10px;--px-appleseed-size-s: 6px;--px-appleseed-size-xs: 4px}.container{display:flex}.container:has(#seed-0.appleseed-6-plus[active]) :nth-child(4)>div,.container:has(#seed-1.appleseed-6-plus[active]) :nth-child(4)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.container:has(#seed-0.appleseed-6-plus[active]) :nth-child(5)>div,.container:has(#seed-1.appleseed-6-plus[active]) :nth-child(5)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(2)>div,.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(4)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(1)>div,.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(5)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-3.appleseed-6-plus[active]) :nth-child(1)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-3.appleseed-6-plus[active]) :nth-child(2)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.container:has(#seed-3.appleseed-6-plus[active]) :nth-child(5)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-4.appleseed-6-plus[active]) :nth-child(1)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-4.appleseed-6-plus[active]) :nth-child(2)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.appleseed{width:var(--px-size-icon-m);height:var(--px-size-icon-m);display:flex;justify-content:center;align-items:center}@media only screen and (max-width: 47.938em){.appleseed{width:var(--px-size-icon-s);height:var(--px-size-icon-s)}}.appleseed-6-plus>div,.appleseed-6-minus>div{box-shadow:inset 0 0 0 var(--px-size-border-s) var(--px-color-border-brand-default);border-radius:var(--px-radius-main);height:var(--px-appleseed-size-m);width:var(--px-appleseed-size-m)}.appleseed-6-plus[active]>div,.appleseed-6-minus[active]>div{width:var(--px-appleseed-size-l);height:var(--px-appleseed-size-l);background-color:var(--px-color-icon-brand-default)}", Z = new CSSStyleSheet();
864
- Z.replaceSync(Et);
865
- class It extends HTMLElement {
902
+ h = new WeakMap(), d = new WeakMap(), S = new WeakMap();
903
+ customElements.get("px-icon") || customElements.define("px-icon", Rt);
904
+ const It = ":host{--px-appleseed-size-l: 14px;--px-appleseed-size-m: 10px;--px-appleseed-size-s: 6px;--px-appleseed-size-xs: 4px}.container{display:flex}.container:has(#seed-0.appleseed-6-plus[active]) :nth-child(4)>div,.container:has(#seed-1.appleseed-6-plus[active]) :nth-child(4)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.container:has(#seed-0.appleseed-6-plus[active]) :nth-child(5)>div,.container:has(#seed-1.appleseed-6-plus[active]) :nth-child(5)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(2)>div,.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(4)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(1)>div,.container:has(#seed-2.appleseed-6-plus[active]) :nth-child(5)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-3.appleseed-6-plus[active]) :nth-child(1)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-3.appleseed-6-plus[active]) :nth-child(2)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.container:has(#seed-3.appleseed-6-plus[active]) :nth-child(5)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-4.appleseed-6-plus[active]) :nth-child(1)>div{width:var(--px-appleseed-size-xs);height:var(--px-appleseed-size-xs)}.container:has(#seed-4.appleseed-6-plus[active]) :nth-child(2)>div{width:var(--px-appleseed-size-s);height:var(--px-appleseed-size-s)}.appleseed{width:var(--px-size-icon-m);height:var(--px-size-icon-m);display:flex;justify-content:center;align-items:center}@media screen and (max-width: 47.938rem){.appleseed{width:var(--px-size-icon-s);height:var(--px-size-icon-s)}}.appleseed-6-plus>div,.appleseed-6-minus>div{box-shadow:inset 0 0 0 var(--px-size-border-s) var(--px-color-border-brand-default);border-radius:var(--px-radius-main);height:var(--px-appleseed-size-m);width:var(--px-appleseed-size-m)}.appleseed-6-plus[active]>div,.appleseed-6-minus[active]>div{width:var(--px-appleseed-size-l);height:var(--px-appleseed-size-l);background-color:var(--px-color-icon-brand-default)}", K = new CSSStyleSheet();
905
+ K.replaceSync(It);
906
+ class Ht extends HTMLElement {
866
907
  constructor() {
867
908
  super(), this.template = (t, e) => `<div class="container">
868
909
  ${Array.from(
869
910
  { length: Math.min(t, 5) },
870
- (i, o) => `<div id="seed-${o}" ${e === o ? "active" : ""} class="appleseed ${t > 5 ? "appleseed-6-plus" : "appleseed-6-minus"}">
911
+ (i, a) => `<div id="seed-${a}" ${e === a ? "active" : ""} class="appleseed ${t > 5 ? "appleseed-6-plus" : "appleseed-6-minus"}">
871
912
  <div></div>
872
913
  </div>`
873
914
  ).join("")}
874
- </div>`, this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [Z], this.shadowRoot.innerHTML = this.template(this.amount, this.active);
915
+ </div>`, this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [K], this.shadowRoot.innerHTML = this.template(this.amount, this.active);
875
916
  }
876
917
  static get observedAttributes() {
877
918
  return ["amount", "active"];
@@ -904,135 +945,133 @@ class It extends HTMLElement {
904
945
  return parseInt(this.getAttribute("active")) || 0;
905
946
  }
906
947
  }
907
- customElements.get("px-appleseed") || customElements.define("px-appleseed", It);
908
- function k(r) {
909
- var t = typeof r;
910
- return r != null && (t == "object" || t == "function");
948
+ customElements.get("px-appleseed") || customElements.define("px-appleseed", Ht);
949
+ function y(s) {
950
+ var t = typeof s;
951
+ return s != null && (t == "object" || t == "function");
911
952
  }
912
- var Rt = typeof global == "object" && global && global.Object === Object && global, Mt = typeof self == "object" && self && self.Object === Object && self, J = Rt || Mt || Function("return this")(), z = function() {
953
+ var Mt = typeof global == "object" && global && global.Object === Object && global, Pt = typeof self == "object" && self && self.Object === Object && self, J = Mt || Pt || Function("return this")(), R = function() {
913
954
  return J.Date.now();
914
- }, Pt = /\s/;
915
- function Dt(r) {
916
- for (var t = r.length; t-- && Pt.test(r.charAt(t)); )
955
+ }, Ot = /\s/;
956
+ function Nt(s) {
957
+ for (var t = s.length; t-- && Ot.test(s.charAt(t)); )
917
958
  ;
918
959
  return t;
919
960
  }
920
- var Ht = /^\s+/;
921
- function qt(r) {
922
- return r && r.slice(0, Dt(r) + 1).replace(Ht, "");
961
+ var qt = /^\s+/;
962
+ function Dt(s) {
963
+ return s && s.slice(0, Nt(s) + 1).replace(qt, "");
923
964
  }
924
- var y = J.Symbol, Q = Object.prototype, Wt = Q.hasOwnProperty, Ot = Q.toString, f = y ? y.toStringTag : void 0;
925
- function Nt(r) {
926
- var t = Wt.call(r, f), e = r[f];
965
+ var A = J.Symbol, Q = Object.prototype, Wt = Q.hasOwnProperty, Xt = Q.toString, m = A ? A.toStringTag : void 0;
966
+ function Ft(s) {
967
+ var t = Wt.call(s, m), e = s[m];
927
968
  try {
928
- r[f] = void 0;
969
+ s[m] = void 0;
929
970
  var i = !0;
930
971
  } catch {
931
972
  }
932
- var o = Ot.call(r);
933
- return i && (t ? r[f] = e : delete r[f]), o;
973
+ var a = Xt.call(s);
974
+ return i && (t ? s[m] = e : delete s[m]), a;
934
975
  }
935
- var Xt = Object.prototype, Ft = Xt.toString;
936
- function _t(r) {
937
- return Ft.call(r);
976
+ var _t = Object.prototype, Gt = _t.toString;
977
+ function Zt(s) {
978
+ return Gt.call(s);
938
979
  }
939
- var Bt = "[object Null]", Gt = "[object Undefined]", O = y ? y.toStringTag : void 0;
940
- function Ut(r) {
941
- return r == null ? r === void 0 ? Gt : Bt : O && O in Object(r) ? Nt(r) : _t(r);
980
+ var Bt = "[object Null]", Ut = "[object Undefined]", X = A ? A.toStringTag : void 0;
981
+ function Kt(s) {
982
+ return s == null ? s === void 0 ? Ut : Bt : X && X in Object(s) ? Ft(s) : Zt(s);
942
983
  }
943
- function Kt(r) {
944
- return r != null && typeof r == "object";
984
+ function Jt(s) {
985
+ return s != null && typeof s == "object";
945
986
  }
946
- var Zt = "[object Symbol]";
947
- function Jt(r) {
948
- return typeof r == "symbol" || Kt(r) && Ut(r) == Zt;
987
+ var Qt = "[object Symbol]";
988
+ function Yt(s) {
989
+ return typeof s == "symbol" || Jt(s) && Kt(s) == Qt;
949
990
  }
950
- var N = NaN, Qt = /^[-+]0x[0-9a-f]+$/i, Yt = /^0b[01]+$/i, Vt = /^0o[0-7]+$/i, te = parseInt;
951
- function X(r) {
952
- if (typeof r == "number")
953
- return r;
954
- if (Jt(r))
955
- return N;
956
- if (k(r)) {
957
- var t = typeof r.valueOf == "function" ? r.valueOf() : r;
958
- r = k(t) ? t + "" : t;
959
- }
960
- if (typeof r != "string")
961
- return r === 0 ? r : +r;
962
- r = qt(r);
963
- var e = Yt.test(r);
964
- return e || Vt.test(r) ? te(r.slice(2), e ? 2 : 8) : Qt.test(r) ? N : +r;
991
+ var F = NaN, Vt = /^[-+]0x[0-9a-f]+$/i, te = /^0b[01]+$/i, ee = /^0o[0-7]+$/i, ie = parseInt;
992
+ function _(s) {
993
+ if (typeof s == "number")
994
+ return s;
995
+ if (Yt(s))
996
+ return F;
997
+ if (y(s)) {
998
+ var t = typeof s.valueOf == "function" ? s.valueOf() : s;
999
+ s = y(t) ? t + "" : t;
1000
+ }
1001
+ if (typeof s != "string")
1002
+ return s === 0 ? s : +s;
1003
+ s = Dt(s);
1004
+ var e = te.test(s);
1005
+ return e || ee.test(s) ? ie(s.slice(2), e ? 2 : 8) : Vt.test(s) ? F : +s;
965
1006
  }
966
- var ee = "Expected a function", ie = Math.max, re = Math.min;
967
- function oe(r, t, e) {
968
- var i, o, n, l, a, c, b = 0, M = !1, g = !1, A = !0;
969
- if (typeof r != "function")
970
- throw new TypeError(ee);
971
- t = X(t) || 0, k(e) && (M = !!e.leading, g = "maxWait" in e, n = g ? ie(X(e.maxWait) || 0, t) : n, A = "trailing" in e ? !!e.trailing : A);
972
- function $(s) {
973
- var u = i, v = o;
974
- return i = o = void 0, b = s, l = r.apply(v, u), l;
975
- }
976
- function V(s) {
977
- return b = s, a = setTimeout(x, t), M ? $(s) : l;
978
- }
979
- function tt(s) {
980
- var u = s - c, v = s - b, H = t - u;
981
- return g ? re(H, n - v) : H;
982
- }
983
- function P(s) {
984
- var u = s - c, v = s - b;
985
- return c === void 0 || u >= t || u < 0 || g && v >= n;
986
- }
987
- function x() {
988
- var s = z();
989
- if (P(s))
990
- return D(s);
991
- a = setTimeout(x, tt(s));
992
- }
993
- function D(s) {
994
- return a = void 0, A && i ? $(s) : (i = o = void 0, l);
995
- }
996
- function et() {
997
- a !== void 0 && clearTimeout(a), b = 0, i = c = o = a = void 0;
998
- }
999
- function it() {
1000
- return a === void 0 ? l : D(z());
1001
- }
1002
- function S() {
1003
- var s = z(), u = P(s);
1004
- if (i = arguments, o = this, c = s, u) {
1005
- if (a === void 0)
1006
- return V(c);
1007
+ var se = "Expected a function", ae = Math.max, oe = Math.min;
1008
+ function re(s, t, e) {
1009
+ var i, a, r, o, l, c, b = 0, O = !1, g = !1, C = !0;
1010
+ if (typeof s != "function")
1011
+ throw new TypeError(se);
1012
+ t = _(t) || 0, y(e) && (O = !!e.leading, g = "maxWait" in e, r = g ? ae(_(e.maxWait) || 0, t) : r, C = "trailing" in e ? !!e.trailing : C);
1013
+ function z(n) {
1014
+ var u = i, v = a;
1015
+ return i = a = void 0, b = n, o = s.apply(v, u), o;
1016
+ }
1017
+ function et(n) {
1018
+ return b = n, l = setTimeout(w, t), O ? z(n) : o;
1019
+ }
1020
+ function it(n) {
1021
+ var u = n - c, v = n - b, D = t - u;
1022
+ return g ? oe(D, r - v) : D;
1023
+ }
1024
+ function N(n) {
1025
+ var u = n - c, v = n - b;
1026
+ return c === void 0 || u >= t || u < 0 || g && v >= r;
1027
+ }
1028
+ function w() {
1029
+ var n = R();
1030
+ if (N(n))
1031
+ return q(n);
1032
+ l = setTimeout(w, it(n));
1033
+ }
1034
+ function q(n) {
1035
+ return l = void 0, C && i ? z(n) : (i = a = void 0, o);
1036
+ }
1037
+ function st() {
1038
+ l !== void 0 && clearTimeout(l), b = 0, i = c = a = l = void 0;
1039
+ }
1040
+ function at() {
1041
+ return l === void 0 ? o : q(R());
1042
+ }
1043
+ function L() {
1044
+ var n = R(), u = N(n);
1045
+ if (i = arguments, a = this, c = n, u) {
1046
+ if (l === void 0)
1047
+ return et(c);
1007
1048
  if (g)
1008
- return clearTimeout(a), a = setTimeout(x, t), $(c);
1049
+ return clearTimeout(l), l = setTimeout(w, t), z(c);
1009
1050
  }
1010
- return a === void 0 && (a = setTimeout(x, t)), l;
1051
+ return l === void 0 && (l = setTimeout(w, t)), o;
1011
1052
  }
1012
- return S.cancel = et, S.flush = it, S;
1053
+ return L.cancel = st, L.flush = at, L;
1013
1054
  }
1014
- var se = "Expected a function";
1015
- function ae(r, t, e) {
1016
- var i = !0, o = !0;
1017
- if (typeof r != "function")
1018
- throw new TypeError(se);
1019
- return k(e) && (i = "leading" in e ? !!e.leading : i, o = "trailing" in e ? !!e.trailing : o), oe(r, t, {
1055
+ var ne = "Expected a function";
1056
+ function le(s, t, e) {
1057
+ var i = !0, a = !0;
1058
+ if (typeof s != "function")
1059
+ throw new TypeError(ne);
1060
+ return y(e) && (i = "leading" in e ? !!e.leading : i, a = "trailing" in e ? !!e.trailing : a), re(s, t, {
1020
1061
  leading: i,
1021
1062
  maxWait: t,
1022
- trailing: o
1063
+ trailing: a
1023
1064
  });
1024
1065
  }
1025
- const I = new CSSStyleSheet();
1026
- I.replaceSync(ct);
1027
- const ne = (r, t, e) => `:host([${r}${e ? `--${e}` : ""}='${t}']) .carousel`, le = "px-spacing", j = (r) => (t, e) => `calc(((100% - ${Math.max(parseInt(t), 2)} * ( var(--px-spacing-${r}-${e}))) / ${t}) - ( 64px / ${Math.max(parseInt(t), 2)}))`;
1066
+ const Y = new CSSStyleSheet();
1067
+ Y.replaceSync(ut);
1068
+ const V = "px-carousel-item-connected";
1069
+ var k, H;
1028
1070
  class ce extends HTMLElement {
1029
1071
  constructor() {
1030
- super(), this.visibleItemsAttributeDelegate = new F(
1031
- this,
1032
- "visible-items",
1033
- j("s"),
1034
- "--px-carousel-min-width"
1035
- ), this.template = `<px-vstack gap="default">
1072
+ super();
1073
+ x(this, k);
1074
+ this.template = `<px-vstack gap="default">
1036
1075
  <div class="carousel">
1037
1076
  <slot></slot>
1038
1077
  </div>
@@ -1052,49 +1091,19 @@ class ce extends HTMLElement {
1052
1091
  </px-hstack>
1053
1092
  </px-hstack>
1054
1093
  </px-vstack>`, this.onScroll = () => {
1055
- const t = this.$carousel.scrollLeft, e = this.$carousel.scrollWidth, i = this.$carousel.clientWidth;
1056
- let o = 0;
1057
- window.innerWidth < 768 ? o = Math.round(
1058
- t / (e - i) * (this.itemNumbers - 1)
1059
- ) : Math.ceil(t + i) + 10 >= e ? o = this.itemNumbers - 1 : o = Math.floor(t / this.$firstItem.offsetWidth + 1) - 1;
1060
- let n = o;
1061
- this.itemNumbers > 5 && (o > 2 && o < this.itemNumbers - 2 ? n = 2 : o === this.itemNumbers - 2 ? n = 3 : o === this.itemNumbers - 1 && (n = 4)), this.$appleseed.setAttribute("active", `${n}`), this.handleNextPrevious();
1062
- }, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [
1063
- I,
1064
- lt(
1065
- "gap",
1066
- ne,
1067
- _,
1068
- le
1069
- )
1070
- ];
1071
- }
1072
- static get observedAttributes() {
1073
- return ["visible-items"];
1074
- }
1075
- attributeChangedCallback(t, e, i) {
1076
- if (e !== i)
1077
- switch (t) {
1078
- case "gap":
1079
- case "gap--mobile":
1080
- case "gap--tablet":
1081
- case "gap--desktop":
1082
- this.visibleItemsAttributeDelegate.attributeValue = j(i);
1083
- break;
1084
- default:
1085
- this.visibleItemsAttributeDelegate.attributeChangedCallback(
1086
- t,
1087
- e,
1088
- i
1089
- );
1090
- }
1094
+ const e = this.$carousel.scrollLeft, i = this.$carousel.scrollWidth, a = this.$carousel.clientWidth;
1095
+ let r = 0;
1096
+ window.innerWidth < 768 ? r = Math.round(
1097
+ e / (i - a) * (this.itemNumbers - 1)
1098
+ ) : Math.ceil(e + a) + 10 >= i ? r = this.itemNumbers - 1 : r = Math.floor(e / this.$firstItem.offsetWidth + 1) - 1;
1099
+ let o = r;
1100
+ this.itemNumbers > 5 && (r > 2 && r < this.itemNumbers - 2 ? o = 2 : r === this.itemNumbers - 2 ? o = 3 : r === this.itemNumbers - 1 && (o = 4)), this.$appleseed.setAttribute("active", `${o}`), this.handleNextPrevious();
1101
+ }, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [Y];
1091
1102
  }
1092
1103
  connectedCallback() {
1093
- this.visibleItemsAttributeDelegate.init("1"), this.visibleItemsAttributeDelegate.attributeValue = j(
1094
- this.getAttribute("gap") || "s"
1095
- ), requestAnimationFrame(() => {
1096
- this.handleAppleSeedDisplay();
1097
- }), this.$appleseed.setAttribute("amount", `${this.itemNumbers}`), this.$carousel.addEventListener("scroll", ae(this.onScroll, 500)), this.$previous.addEventListener("click", () => {
1104
+ this.addEventListener(V, () => {
1105
+ T(this, k, H).call(this);
1106
+ }), T(this, k, H).call(this), this.$carousel.addEventListener("scroll", le(this.onScroll, 500)), this.$previous.addEventListener("click", () => {
1098
1107
  this.$carousel.scrollLeft -= this.$carousel.clientWidth;
1099
1108
  }), this.$next.addEventListener("click", () => {
1100
1109
  this.$carousel.scrollLeft += this.$carousel.clientWidth;
@@ -1103,8 +1112,8 @@ class ce extends HTMLElement {
1103
1112
  });
1104
1113
  }
1105
1114
  handleNextPrevious() {
1106
- const t = this.$carousel.scrollLeft, e = this.$carousel.scrollWidth, i = this.$carousel.clientWidth;
1107
- t === 0 ? this.$previous.setAttribute("disabled", "") : this.$previous.removeAttribute("disabled"), t + i >= e ? this.$next.setAttribute("disabled", "") : this.$next.removeAttribute("disabled");
1115
+ const e = this.$carousel.scrollLeft, i = this.$carousel.scrollWidth, a = this.$carousel.clientWidth;
1116
+ e === 0 ? this.$previous.setAttribute("disabled", "") : this.$previous.removeAttribute("disabled"), e + a >= i ? this.$next.setAttribute("disabled", "") : this.$next.removeAttribute("disabled");
1108
1117
  }
1109
1118
  handleAppleSeedDisplay() {
1110
1119
  this.isScrolling() ? this.$appleseedContainer.style.display = "block" : this.$appleseedContainer.style.display = "none";
@@ -1134,20 +1143,34 @@ class ce extends HTMLElement {
1134
1143
  return this.querySelectorAll("px-carousel-item").length;
1135
1144
  }
1136
1145
  }
1146
+ k = new WeakSet(), H = function() {
1147
+ this.$appleseed.setAttribute("amount", `${this.itemNumbers}`), requestAnimationFrame(() => {
1148
+ this.handleAppleSeedDisplay();
1149
+ });
1150
+ };
1137
1151
  customElements.get("px-carousel") || customElements.define("px-carousel", ce);
1138
- const Y = new CSSStyleSheet();
1139
- Y.replaceSync(dt);
1140
- class de extends HTMLElement {
1152
+ const tt = new CSSStyleSheet();
1153
+ tt.replaceSync(ht);
1154
+ class pe extends HTMLElement {
1141
1155
  constructor() {
1142
1156
  super(), this.template = `
1143
1157
  <div class="carousel-item">
1144
1158
  <slot></slot>
1145
- </div>`, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [I, Y];
1159
+ </div>`, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [tt];
1160
+ }
1161
+ connectedCallback() {
1162
+ this.dispatchEvent(
1163
+ new CustomEvent(V, {
1164
+ bubbles: !0,
1165
+ composed: !0
1166
+ })
1167
+ );
1146
1168
  }
1147
1169
  }
1148
- customElements.get("px-carousel-item") || customElements.define("px-carousel-item", de);
1170
+ customElements.get("px-carousel-item") || customElements.define("px-carousel-item", pe);
1149
1171
  export {
1150
- It as AppleSeed,
1172
+ Ht as AppleSeed,
1173
+ V as CAROUSEL_ITEM_CONNECTED_EVENT,
1151
1174
  ce as Carousel,
1152
- de as CarouselItem
1175
+ pe as CarouselItem
1153
1176
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-carousel",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.100",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "clean": "rm -rf dist",
14
14
  "build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
15
15
  "test": "vitest run --coverage",
16
- "wc-manifest": "cem analyze --globs \"src/*\" --config ../custom-elements-manifest.config.js --outdir dist"
16
+ "wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"