@proximus/lavender-container 2.0.0-alpha.16 → 2.0.0-alpha.161

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,5 +1,7 @@
1
- import { VerticallyExtendedElement } from '@proximus/lavender-common';
2
- export declare class Container extends VerticallyExtendedElement<HTMLDivElement> {
1
+ import { WithExtraAttributes } from '@proximus/lavender-common';
2
+ export declare const anchorSpacingValues: string[];
3
+ export declare const subgridRowsValues: string[];
4
+ export declare class Container extends WithExtraAttributes {
3
5
  static nativeName: string;
4
6
  private template;
5
7
  private _bgObserver;
@@ -23,6 +25,9 @@ export declare class Container extends VerticallyExtendedElement<HTMLDivElement>
23
25
  };
24
26
  updateAnchorOffset(oldValue: string, newValue: string, attrValue: string[]): void;
25
27
  addAnchorClass(): void;
28
+ updateAnchorSpacing(oldValue: string, newValue: string, attrValue: string[]): void;
29
+ updateSubgridRows(attrName: string, oldValue: string, newValue: string, attrValues: string[]): void;
30
+ get $el(): HTMLElement;
26
31
  get $slotAnchor(): HTMLSlotElement;
27
32
  get padding(): string;
28
33
  set padding(value: string);
@@ -134,6 +139,18 @@ export declare class Container extends VerticallyExtendedElement<HTMLDivElement>
134
139
  set boxShadow(value: string);
135
140
  get anchorOffset(): string;
136
141
  set anchorOffset(value: string);
137
- get inverted(): string;
138
- set inverted(value: string);
142
+ get anchorSpacing(): string;
143
+ set anchorSpacing(value: string);
144
+ get inverted(): boolean;
145
+ set inverted(value: boolean);
146
+ get subgridRows(): string;
147
+ set subgridRows(value: string);
148
+ get subgridGap(): string;
149
+ set subgridGap(value: string);
150
+ get subgridGapMobile(): string;
151
+ set subgridGapMobile(value: string);
152
+ get subgridGapTablet(): string;
153
+ set subgridGapTablet(value: string);
154
+ get subgridGapLaptop(): string;
155
+ set subgridGapLaptop(value: string);
139
156
  }
package/dist/index.es.js CHANGED
@@ -1,60 +1,87 @@
1
- import { cssTokenBreakpoints as a, paddingValues as d, VerticallyExtendedElement as h, boxShadowValues as k, backgroundSizeValues as m, noBorderRadiusValues as f, borderRadiusValues as v, borderSideValues as A, borderValues as y, gradientValues as x, log as b, backgroundColorValues as $, borderColorValues as L, checkName as B } from "@proximus/lavender-common";
2
- const C = ':host{display:block}.container{font-family:var(--px-font-family);background-color:var(--background-color);border-radius:var(--px-radius-main);box-sizing:border-box;height:100%}:host([background-image]) .container{background-image:var(--background-image)}:host([background-gradient]) .container{background-image:var(--background-gradient)}:host([inverted]) .container{background-color:var(--background-color-inverted);color:var(--px-color-text-neutral-inverted)}.border-none{border:none}.border-s{border:var(--px-size-border-s) solid var(--border-color)}.border-m{border:var(--px-size-border-m) solid var(--border-color)}.border-l{border:var(--px-size-border-l) solid var(--border-color)}.border-side-top{border-bottom-style:none;border-right-style:none;border-left-style:none}.border-side-right{border-top-style:none;border-bottom-style:none;border-left-style:none}.border-side-bottom{border-top-style:none;border-right-style:none;border-left-style:none}.border-side-left{border-top-style:none;border-right-style:none;border-bottom-style:none}.border-side-block{border-inline-style:none}.border-side-inline{border-block-style:none}:host([inverted]) .border-s,:host([inverted]) .border-m,:host([inverted]) .border-l{border-color:var(--border-color-inverted)}.border-radius-main{border-radius:var(--px-radius-main)}.border-radius-pill{border-radius:var(--px-radius-pill)}.no-border-radius-top{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all,.border-radius-none{border-radius:var(--px-radius-none)}.bgimg{background-repeat:no-repeat}.background-size-cover{background-size:cover;background-position:center center}.background-size-contain{background-size:contain}.box-shadow-none{box-shadow:none}.box-shadow-s{box-shadow:0 1px 2px #2525251f}.box-shadow-m{box-shadow:0 4px 6px -1px #25252514}.box-shadow-l{box-shadow:0 10px 15px -3px #25252514}.box-shadow-xl{box-shadow:0 20px 25px -5px #25252514}.anchored{position:relative}::slotted([slot="anchor-right"]),::slotted([slot="anchor-left"]),::slotted([slot="anchor-full"]){position:absolute;top:0}::slotted([slot="anchor-right"]),::slotted([slot="anchor-left"]){transform:translateY(-50%);z-index:3}::slotted([slot="anchor-right"]){right:var( --container-anchor-offset--mobile, var( --container-padding-right, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-left"]){left:var( --container-anchor-offset--mobile, var( --container-padding-left, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-full"]){transform:translateY(-100%);right:0;left:0;text-align:center;z-index:2}::slotted(px-vstack:only-of-type),::slotted(px-hstack:only-of-type),::slotted(px-stack:only-of-type),::slotted(px-grid:only-of-type){height:100%}.border-s ::slotted([slot="anchor-full"]){right:calc(var(--px-size-border-s) * -1);left:calc(var(--px-size-border-s) * -1)}.border-m ::slotted([slot="anchor-full"]){right:calc(var(--px-size-border-m) * -1);left:calc(var(--px-size-border-m) * -1)}.border-l ::slotted([slot="anchor-full"]){right:calc(var(--px-size-border-l) * -1);left:calc(var(--px-size-border-l) * -1)}@media only screen and (max-width: 47.938em){.container{background-color:var(--background-color--mobile, var(--background-color))}:host([background-image--mobile]) .container{background-image:var(--background-image--mobile, var(--background-image))}:host([background-gradient--mobile]) .container{background-image:var( --background-gradient--mobile, var(--background-gradient) )}:host([inverted]) .container{background-color:var( --background-color-inverted--mobile, var(--background-color-inverted) )}.border-side-top--mobile{border-top-style:solid;border-right-style:none;border-bottom-style:none;border-left-style:none}.border-side-right--mobile{border-top-style:none;border-right-style:solid;border-bottom-style:none;border-left-style:none}.border-side-bottom--mobile{border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none}.border-side-left--mobile{border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:solid}.border-side-block--mobile{border-inline-style:none;border-block-style:solid}.border-side-inline--mobile{border-block-style:none;border-inline-style:solid}.no-border-radius-top--mobile{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--mobile{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--mobile{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--mobile{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--mobile{border-radius:var(--px-radius-none)}}@media only screen and (min-width: 48em) and (max-width: 64em){.container{background-color:var(--background-color--tablet, var(--background-color))}:host([background-image--tablet]) .container{background-image:var(--background-image--tablet, var(--background-image))}:host([background-gradient--tablet]) .container{background-image:var( --background-gradient--tablet, var(--background-gradient) )}:host([inverted]) .container{background-color:var( --background-color-inverted--tablet, var(--background-color-inverted) )}.no-border-radius-top--tablet{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--tablet{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--tablet{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--tablet{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--tablet{border-radius:var(--px-radius-none)}.border-side-top--tablet{border-top-style:solid;border-right-style:none;border-bottom-style:none;border-left-style:none}.border-side-right--tablet{border-top-style:none;border-right-style:solid;border-bottom-style:none;border-left-style:none}.border-side-bottom--tablet{border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none}.border-side-left--tablet{border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:solid}.border-side-block--tablet{border-inline-style:none;border-block-style:solid}.border-side-inline--tablet{border-block-style:none;border-inline-style:solid}::slotted([slot="anchor-right"]){right:var( --container-anchor-offset--tablet, var( --container-padding-right, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-left"]){left:var( --container-anchor-offset--tablet, var( --container-padding-left, var(--container-padding-inline, var(--container-padding)) ) )}}@media only screen and (min-width: 64.0625em){.container{background-color:var(--background-color--laptop, var(--background-color))}:host([background-image--laptop]) .container{background-image:var(--background-image--laptop, var(--background-image))}:host([background-gradient--laptop]) .container{background-image:var( --background-gradient--laptop, var(--background-gradient) )}:host([inverted]) .container{background-color:var( --background-color-inverted--laptop, var(--background-color-inverted) )}.no-border-radius-top--laptop{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--laptop{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--laptop{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--laptop{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--laptop{border-radius:var(--px-radius-none)}::slotted([slot="anchor-right"]){right:var( --container-anchor-offset--laptop, var( --container-padding-right, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-left"]){left:var( --container-anchor-offset--laptop, var( --container-padding-left, var(--container-padding-inline, var(--container-padding)) ) )}.border-side-top--laptop{border-top-style:solid;border-right-style:none;border-bottom-style:none;border-left-style:none}.border-side-right--laptop{border-top-style:none;border-right-style:solid;border-bottom-style:none;border-left-style:none}.border-side-bottom--laptop{border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none}.border-side-left--laptop{border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:solid}.border-side-block--laptop{border-inline-style:none;border-block-style:solid}.border-side-inline--laptop{border-block-style:none;border-inline-style:solid}}', u = new CSSStyleSheet();
3
- u.replaceSync(C);
4
- const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s = "px-padding", T = [
1
+ import { cssTokenBreakpoints as a, paddingValues as d, gapValues as f, WithExtraAttributes as A, boxShadowValues as y, backgroundSizeValues as x, noBorderRadiusValues as $, borderRadiusValues as w, borderSideValues as L, borderValues as B, gradientValues as c, log as s, backgroundColorValues as h, borderColorValues as v, checkName as g } from "@proximus/lavender-common";
2
+ const C = ':host{display:block}.container{font-family:var(--px-font-family);background-color:var(--background-color);border-radius:var(--px-radius-main);box-sizing:border-box;height:100%}:host([background-image]) .container{background-image:var(--background-image)}:host([background-gradient]) .container{background-image:var(--background-gradient)}:host([inverted]) .container{background-color:var(--background-color-inverted);color:var(--px-color-text-neutral-inverted)}.border-none{border:none}.border-s{border:var(--px-size-border-s) solid var(--border-color)}.border-m{border:var(--px-size-border-m) solid var(--border-color)}.border-l{border:var(--px-size-border-l) solid var(--border-color)}.border-side-top{border-bottom-style:none;border-right-style:none;border-left-style:none}.border-side-right{border-top-style:none;border-bottom-style:none;border-left-style:none}.border-side-bottom{border-top-style:none;border-right-style:none;border-left-style:none}.border-side-left{border-top-style:none;border-right-style:none;border-bottom-style:none}.border-side-block{border-inline-style:none}.border-side-inline{border-block-style:none}:host([inverted]) .border-s,:host([inverted]) .border-m,:host([inverted]) .border-l{border-color:var(--border-color-inverted)}.border-radius-main{border-radius:var(--px-radius-main)}.border-radius-pill{border-radius:var(--px-radius-pill)}.no-border-radius-top{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all,.border-radius-none{border-radius:var(--px-radius-none)}.bgimg{background-repeat:no-repeat}.background-size-cover{background-size:cover;background-position:center center}.background-size-contain{background-size:contain}.box-shadow-none{box-shadow:none}.box-shadow-s{box-shadow:0 1px 2px #2525251f}.box-shadow-m{box-shadow:0 4px 6px -1px #25252514}.box-shadow-l{box-shadow:0 10px 15px -3px #25252514}.box-shadow-xl{box-shadow:0 20px 25px -5px #25252514}.anchored{position:relative}::slotted([slot="anchor-right"]),::slotted([slot="anchor-left"]),::slotted([slot="anchor-full"]){position:absolute;top:0}::slotted([slot="anchor-right"]),::slotted([slot="anchor-left"]){transform:translateY(-50%);z-index:3}::slotted([slot="anchor-right"]){right:var( --container-anchor-offset--mobile, var( --container-padding-right, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-left"]){left:var( --container-anchor-offset--mobile, var( --container-padding-left, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-full"]){transform:translateY(-100%);right:0;left:0;text-align:center;z-index:2}::slotted(px-vstack:only-of-type),::slotted(px-hstack:only-of-type),::slotted(px-stack:only-of-type),::slotted(px-grid:only-of-type){height:100%}:host([anchor-spacing]){margin-top:var(--container-anchor-spacing--mobile)}.border-s ::slotted([slot="anchor-full"]){right:calc(var(--px-size-border-s) * -1);left:calc(var(--px-size-border-s) * -1)}.border-m ::slotted([slot="anchor-full"]){right:calc(var(--px-size-border-m) * -1);left:calc(var(--px-size-border-m) * -1)}.border-l ::slotted([slot="anchor-full"]){right:calc(var(--px-size-border-l) * -1);left:calc(var(--px-size-border-l) * -1)}:host([subgrid-rows]){display:contents}:host([subgrid-rows]) .container{display:grid;grid-template-rows:subgrid;grid-row:span var(--subgrid-rows)}:host([subgrid-rows]):host([grow]) .container{flex-grow:var(--grow-value)}:host([subgrid-rows]):host([shrink]) .container{flex-shrink:var(--shrink-value)}:host([subgrid-rows]):host([basis]) .container{flex-basis:var(--basis-value)}:host([subgrid-rows]):host([align-self]) .container{align-self:var(--align-self-value)}:host([subgrid-rows]):host([col-span]) .container{grid-column:span var(--col-span-value) / span var(--col-span-value)}:host([subgrid-rows]):host([justify-self]) .container{justify-self:var(--justify-self-value)}:host([subgrid-rows]):host([order]) .container{order:var(--order-value)}:host([subgrid-rows]):host([anchor-spacing]) .container{margin-top:var(--container-anchor-spacing--mobile)}@media screen and (max-width: 47.938rem){.container{background-color:var(--background-color--mobile, var(--background-color))}:host([background-image--mobile]) .container{background-image:var(--background-image--mobile, var(--background-image))}:host([background-gradient--mobile]) .container{background-image:var( --background-gradient--mobile, var(--background-gradient) )}:host([inverted]) .container{background-color:var( --background-color-inverted--mobile, var(--background-color-inverted) )}.border-side-top--mobile{border-top-style:solid;border-right-style:none;border-bottom-style:none;border-left-style:none}.border-side-right--mobile{border-top-style:none;border-right-style:solid;border-bottom-style:none;border-left-style:none}.border-side-bottom--mobile{border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none}.border-side-left--mobile{border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:solid}.border-side-block--mobile{border-inline-style:none;border-block-style:solid}.border-side-inline--mobile{border-block-style:none;border-inline-style:solid}.no-border-radius-top--mobile{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--mobile{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--mobile{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--mobile{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--mobile{border-radius:var(--px-radius-none)}:host([subgrid-rows]):host([grow--mobile]) .container{flex-grow:var(--grow--mobile-value)}:host([subgrid-rows]):host([shrink--mobile]) .container{flex-shrink:var(--shrink--mobile-value)}:host([subgrid-rows]):host([basis--mobile]) .container{flex-basis:var(--basis--mobile-value)}:host([subgrid-rows]):host([align-self--mobile]) .container{align-self:var(--align-self--mobile-value)}:host([subgrid-rows]):host([col-span--mobile]) .container{grid-column:span var(--col-span--mobile-value) / span var(--col-span--mobile-value)}:host([subgrid-rows]):host([justify-self--mobile]) .container{justify-self:var(--justify-self--mobile-value)}:host([subgrid-rows]):host([order--mobile]) .container{order:var(--order--mobile-value)}}@media screen and (min-width: 48rem) and (max-width: 64rem){.container{background-color:var(--background-color--tablet, var(--background-color))}:host([background-image--tablet]) .container{background-image:var(--background-image--tablet, var(--background-image))}:host([background-gradient--tablet]) .container{background-image:var( --background-gradient--tablet, var(--background-gradient) )}:host([inverted]) .container{background-color:var( --background-color-inverted--tablet, var(--background-color-inverted) )}.no-border-radius-top--tablet{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--tablet{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--tablet{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--tablet{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--tablet{border-radius:var(--px-radius-none)}.border-side-top--tablet{border-top-style:solid;border-right-style:none;border-bottom-style:none;border-left-style:none}.border-side-right--tablet{border-top-style:none;border-right-style:solid;border-bottom-style:none;border-left-style:none}.border-side-bottom--tablet{border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none}.border-side-left--tablet{border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:solid}.border-side-block--tablet{border-inline-style:none;border-block-style:solid}.border-side-inline--tablet{border-block-style:none;border-inline-style:solid}::slotted([slot="anchor-right"]){right:var( --container-anchor-offset--tablet, var( --container-padding-right, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-left"]){left:var( --container-anchor-offset--tablet, var( --container-padding-left, var(--container-padding-inline, var(--container-padding)) ) )}:host([anchor-spacing]){margin-top:var(--container-anchor-spacing--tablet)}:host([subgrid-rows]):host([col-span--tablet]) .container{grid-column:span var(--col-span--tablet-value) / span var(--col-span--tablet-value)}:host([subgrid-rows]):host([grow--tablet]) .container{flex-grow:var(--grow--tablet-value)}:host([subgrid-rows]):host([shrink--tablet]) .container{flex-shrink:var(--shrink--tablet-value)}:host([subgrid-rows]):host([basis--tablet]) .container{flex-basis:var(--basis--tablet-value)}:host([subgrid-rows]):host([align-self--tablet]) .container{align-self:var(--align-self--tablet-value)}:host([subgrid-rows]):host([justify-self--tablet]) .container{justify-self:var(--justify-self--tablet-value)}:host([subgrid-rows]):host([order--tablet]) .container{order:var(--order--tablet-value)}:host([subgrid-rows]):host([anchor-spacing]) .container{margin-top:var(--container-anchor-spacing--tablet)}}@media screen and (min-width: 64.0625rem) and (max-width: 90rem){:host([anchor-spacing]){margin-top:var(--container-anchor-spacing--laptop)}:host([subgrid-rows]):host([col-span--laptop]) .container{grid-column:span var(--col-span--laptop-value) / span var(--col-span--laptop-value)}:host([subgrid-rows]):host([grow--laptop]) .container{flex-grow:var(--grow--laptop-value)}:host([subgrid-rows]):host([shrink--laptop]) .container{flex-shrink:var(--shrink--laptop-value)}:host([subgrid-rows]):host([basis--laptop]) .container{flex-basis:var(--basis--laptop-value)}:host([subgrid-rows]):host([align-self--laptop]) .container{align-self:var(--align-self--laptop-value)}:host([subgrid-rows]):host([justify-self--laptop]) .container{justify-self:var(--justify-self--laptop-value)}:host([subgrid-rows]):host([order--laptop]) .container{order:var(--order--laptop-value)}:host([subgrid-rows]):host([anchor-spacing]) .container{margin-top:var(--container-anchor-spacing--laptop)}}@media screen and (min-width: 64.0625rem){.container{background-color:var(--background-color--laptop, var(--background-color))}:host([background-image--laptop]) .container{background-image:var(--background-image--laptop, var(--background-image))}:host([background-gradient--laptop]) .container{background-image:var( --background-gradient--laptop, var(--background-gradient) )}:host([inverted]) .container{background-color:var( --background-color-inverted--laptop, var(--background-color-inverted) )}.no-border-radius-top--laptop{border-top-left-radius:var(--px-radius-none);border-top-right-radius:var(--px-radius-none)}.no-border-radius-right--laptop{border-top-right-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-bottom--laptop{border-bottom-left-radius:var(--px-radius-none);border-bottom-right-radius:var(--px-radius-none)}.no-border-radius-left--laptop{border-top-left-radius:var(--px-radius-none);border-bottom-left-radius:var(--px-radius-none)}.no-border-radius-all--laptop{border-radius:var(--px-radius-none)}::slotted([slot="anchor-right"]){right:var( --container-anchor-offset--laptop, var( --container-padding-right, var(--container-padding-inline, var(--container-padding)) ) )}::slotted([slot="anchor-left"]){left:var( --container-anchor-offset--laptop, var( --container-padding-left, var(--container-padding-inline, var(--container-padding)) ) )}:host([anchor-spacing]){margin-top:var(--container-anchor-spacing--laptop)}.border-side-top--laptop{border-top-style:solid;border-right-style:none;border-bottom-style:none;border-left-style:none}.border-side-right--laptop{border-top-style:none;border-right-style:solid;border-bottom-style:none;border-left-style:none}.border-side-bottom--laptop{border-top-style:none;border-right-style:none;border-bottom-style:solid;border-left-style:none}.border-side-left--laptop{border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:solid}.border-side-block--laptop{border-inline-style:none;border-block-style:solid}.border-side-inline--laptop{border-block-style:none;border-inline-style:solid}}@media screen and (min-width: 90.0625rem){:host([anchor-spacing]){margin-top:var(--container-anchor-spacing--desktop)}:host([subgrid-rows]):host([col-span--desktop]) .container{grid-column:span var(--col-span--desktop-value) / span var(--col-span--desktop-value)}:host([subgrid-rows]):host([grow--desktop]) .container{flex-grow:var(--grow--desktop-value)}:host([subgrid-rows]):host([shrink--desktop]) .container{flex-shrink:var(--shrink--desktop-value)}:host([subgrid-rows]):host([basis--desktop]) .container{flex-basis:var(--basis--desktop-value)}:host([subgrid-rows]):host([align-self--desktop]) .container{align-self:var(--align-self--desktop-value)}:host([subgrid-rows]):host([justify-self--desktop]) .container{justify-self:var(--justify-self--desktop-value)}:host([subgrid-rows]):host([order--desktop]) .container{order:var(--order--desktop-value)}:host([subgrid-rows]):host([anchor-spacing]) .container{margin-top:var(--container-anchor-spacing--desktop)}}', k = new CSSStyleSheet();
3
+ k.replaceSync(C);
4
+ const S = [
5
+ "top-patch",
6
+ "top-neighbor-patch",
7
+ "top-ribbon",
8
+ "top-neighbor-ribbon",
9
+ "top-patch-and-neighbor-ribbon"
10
+ ], T = [
11
+ "1",
12
+ "2",
13
+ "3",
14
+ "4",
15
+ "5",
16
+ "6",
17
+ "7",
18
+ "8",
19
+ "9",
20
+ "10",
21
+ "11",
22
+ "12"
23
+ ], n = (m, t, r) => `:host([${m}${r ? `--${r}` : ""}='${t}']) .container`, b = "px-padding", R = [
5
24
  a(
6
25
  "padding",
7
26
  n,
8
27
  d,
9
- s,
28
+ b,
10
29
  "--container-padding"
11
30
  ),
12
31
  a(
13
32
  "padding-inline",
14
33
  n,
15
34
  d,
16
- s
35
+ b
17
36
  ),
18
37
  a(
19
38
  "padding-block",
20
39
  n,
21
40
  d,
22
- s
41
+ b
23
42
  ),
24
43
  a(
25
44
  "padding-top",
26
45
  n,
27
46
  d,
28
- s
47
+ b
29
48
  ),
30
49
  a(
31
50
  "padding-right",
32
51
  n,
33
52
  d,
34
- s,
53
+ b,
35
54
  "--container-padding-right"
36
55
  ),
37
56
  a(
38
57
  "padding-bottom",
39
58
  n,
40
59
  d,
41
- s
60
+ b
42
61
  ),
43
62
  a(
44
63
  "padding-left",
45
64
  n,
46
65
  d,
47
- s,
66
+ b,
48
67
  "--container-padding-left"
68
+ ),
69
+ a(
70
+ "gap",
71
+ n,
72
+ f,
73
+ "px-spacing",
74
+ void 0,
75
+ "subgrid-gap"
49
76
  )
50
- ], p = class p extends h {
77
+ ], u = class u extends A {
51
78
  constructor() {
52
- super(u, ...T), this.template = () => `<div class="container">
79
+ super(k, ...R), this.template = () => `<div class="container">
53
80
  <slot></slot>
54
81
  <slot name="anchor-left"></slot>
55
82
  <slot name="anchor-right"></slot>
56
83
  <slot name="anchor-full"></slot>
57
- </div>`, this._bgObserver = null, this._isInViewport = !1, this.shadowRoot.innerHTML = this.template();
84
+ </div>`, this._bgObserver = null, this._isInViewport = !1, this.contentObserver = null, this.shadowRoot.innerHTML = this.template();
58
85
  }
59
86
  static get observedAttributes() {
60
87
  return [
@@ -86,48 +113,50 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
86
113
  "background-position",
87
114
  "box-shadow",
88
115
  "anchor-offset",
89
- "inverted"
116
+ "anchor-spacing",
117
+ "inverted",
118
+ "subgrid-rows"
90
119
  ];
91
120
  }
92
121
  connectedCallback() {
93
- super.connectedCallback(), this.padding || (this.padding = "m"), this.backgroundColor || (this.backgroundColor = "surface-light"), this.borderColor || (this.borderColor = "main"), this.$slotAnchor && this.addAnchorClass(), this.contentObserver = new MutationObserver(() => {
122
+ this.padding || (this.padding = "m"), this.backgroundColor || (this.backgroundColor = "surface-light"), this.borderColor || (this.borderColor = "main"), this.$slotAnchor && this.addAnchorClass(), this.contentObserver = new MutationObserver(() => {
94
123
  this.$slotAnchor && this.addAnchorClass();
95
124
  }), this.contentObserver.observe(this, {
96
125
  childList: !0,
97
126
  subtree: !0,
98
127
  characterData: !0
99
128
  }), this._bgObserver = new IntersectionObserver((t) => {
100
- t.forEach((e) => {
101
- var r;
102
- e.isIntersecting && (this._isInViewport = !0, this._loadBackgroundImages(), (r = this._bgObserver) == null || r.disconnect());
129
+ t.forEach((r) => {
130
+ var e;
131
+ r.isIntersecting && (this._isInViewport = !0, this._loadBackgroundImages(), (e = this._bgObserver) == null || e.disconnect());
103
132
  });
104
133
  }), this._bgObserver.observe(this.$el);
105
134
  }
106
135
  disconnectedCallback() {
107
- var t;
108
- (t = this._bgObserver) == null || t.disconnect(), this.contentObserver.disconnect();
136
+ var t, r;
137
+ (t = this._bgObserver) == null || t.disconnect(), (r = this.contentObserver) == null || r.disconnect();
109
138
  }
110
- attributeChangedCallback(t, e, r) {
111
- if (e !== r)
139
+ attributeChangedCallback(t, r, e) {
140
+ if (r !== e)
112
141
  switch (t) {
113
142
  case "border":
114
- this.updateAttribute(t, e, r, y);
143
+ this.updateAttribute(t, r, e, B);
115
144
  break;
116
145
  case "border-color":
117
- this.updateBorderColor(t, r);
146
+ this.updateBorderColor(t, e);
118
147
  break;
119
148
  case "border-side":
120
149
  case "border-side--mobile":
121
150
  case "border-side--tablet":
122
151
  case "border-side--laptop":
123
- this.updateAttribute(t, e, r, A);
152
+ this.updateAttribute(t, r, e, L);
124
153
  break;
125
154
  case "border-radius":
126
155
  this.updateAttribute(
127
156
  t,
128
- e,
129
157
  r,
130
- v
158
+ e,
159
+ w
131
160
  );
132
161
  break;
133
162
  case "no-border-radius":
@@ -136,48 +165,59 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
136
165
  case "no-border-radius--laptop":
137
166
  this.updateNoBorderRadius(
138
167
  t,
139
- e,
140
168
  r,
141
- f
169
+ e,
170
+ $
142
171
  );
143
172
  break;
144
173
  case "background-color":
145
174
  case "background-color--mobile":
146
175
  case "background-color--tablet":
147
176
  case "background-color--laptop":
148
- this.updateBackgroundColor(t, r);
177
+ this.updateBackgroundColor(t, e);
149
178
  break;
150
179
  case "background-gradient":
151
180
  case "background-gradient--mobile":
152
181
  case "background-gradient--tablet":
153
182
  case "background-gradient--laptop":
154
- this.updateGradient(t, r);
183
+ this.updateGradient(t, e);
155
184
  break;
156
185
  case "background-size":
157
186
  this.updateAttribute(
158
187
  t,
159
- e,
160
188
  r,
161
- m
189
+ e,
190
+ x
162
191
  );
163
192
  break;
164
193
  case "background-image":
165
194
  case "background-image--mobile":
166
195
  case "background-image--tablet":
167
196
  case "background-image--laptop":
168
- this._isInViewport && this.updateBackgroundImg(t, r);
197
+ this._isInViewport && this.updateBackgroundImg(t, e);
169
198
  break;
170
199
  case "background-position":
171
- r !== null && r !== "" && (this.$el.style.backgroundPosition = r);
200
+ e !== null && e !== "" && (this.$el.style.backgroundPosition = e);
172
201
  break;
173
202
  case "box-shadow":
174
- this.updateAttribute(t, e, r, k);
203
+ this.updateAttribute(t, r, e, y);
175
204
  break;
176
205
  case "anchor-offset":
177
- this.updateAnchorOffset(e, r, d);
206
+ this.updateAnchorOffset(r, e, d);
207
+ break;
208
+ case "anchor-spacing":
209
+ this.updateAnchorSpacing(r, e, S);
210
+ break;
211
+ case "subgrid-rows":
212
+ this.updateSubgridRows(
213
+ t,
214
+ r,
215
+ e,
216
+ T
217
+ );
178
218
  break;
179
219
  default:
180
- super.attributeChangedCallback(t, e, r);
220
+ super.attributeChangedCallback(t, r, e);
181
221
  break;
182
222
  }
183
223
  }
@@ -187,97 +227,97 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
187
227
  "background-image--mobile",
188
228
  "background-image--tablet",
189
229
  "background-image--laptop"
190
- ].forEach((e) => {
191
- const r = this.getAttribute(e);
192
- r && this.updateBackgroundImg(e, r);
230
+ ].forEach((r) => {
231
+ const e = this.getAttribute(r);
232
+ e && this.updateBackgroundImg(r, e);
193
233
  });
194
234
  }
195
- updateBackgroundImg(t, e) {
196
- this.$el.style.setProperty(`--${t}`, `url("${e}")`);
235
+ updateBackgroundImg(t, r) {
236
+ this.$el.style.setProperty(`--${t}`, `url("${r}")`);
197
237
  }
198
- updateGradient(t, e) {
199
- if (this.checkName(x, e)) {
200
- const r = this.splitAttrNameFromBreakpoint(t);
201
- t = r.attrName;
202
- const i = r.breakpoint;
238
+ updateGradient(t, r) {
239
+ if (this.checkName(c, r)) {
240
+ const e = this.splitAttrNameFromBreakpoint(t);
241
+ t = e.attrName;
242
+ const i = e.breakpoint;
203
243
  this.$el.style.setProperty(
204
244
  `--${t}${i}`,
205
- `linear-gradient(var(--px-color-background-gradient-${e}))`
245
+ `linear-gradient(var(--px-color-background-gradient-${r}))`
206
246
  );
207
247
  } else
208
- b(
209
- `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
248
+ s(
249
+ `"${r}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${c.join('", "')}".`
210
250
  );
211
251
  }
212
- updateBackgroundColor(t, e) {
213
- const r = e.startsWith("surface-");
214
- if (this.checkName($, e)) {
252
+ updateBackgroundColor(t, r) {
253
+ const e = r.startsWith("surface-");
254
+ if (this.checkName(h, r)) {
215
255
  const i = this.splitAttrNameFromBreakpoint(t), o = i.breakpoint;
216
256
  this.$el.style.setProperty(
217
257
  `--${i.attrName}${o}`,
218
- `var(--px-color-background-${e}${r ? "" : "-default"})`
258
+ `var(--px-color-background-${r}${e ? "" : "-default"})`
219
259
  ), this.$el.style.setProperty(
220
260
  `--${i.attrName}-inverted${o}`,
221
- `var(--px-color-background-${e}${r ? "" : "-inverted"})`
261
+ `var(--px-color-background-${r}${e ? "" : "-inverted"})`
222
262
  );
223
263
  } else
224
- b(
225
- `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
264
+ s(
265
+ `"${r}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${h.join('", "')}".`
226
266
  );
227
267
  }
228
- updateBorderColor(t, e) {
229
- this.checkName(L, e) ? (this.$el.style.setProperty(
268
+ updateBorderColor(t, r) {
269
+ this.checkName(v, r) ? (this.$el.style.setProperty(
230
270
  `--${t}`,
231
- `var(--px-color-border-${e}-default)`
271
+ `var(--px-color-border-${r}-default)`
232
272
  ), this.$el.style.setProperty(
233
273
  `--${t}-inverted`,
234
- `var(--px-color-border-${e}-inverted)`
235
- )) : b(
236
- `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
274
+ `var(--px-color-border-${r}-inverted)`
275
+ )) : s(
276
+ `"${r}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${v.join('", "')}".`
237
277
  );
238
278
  }
239
- updateNoBorderRadius(t, e, r, i) {
240
- if (!this.checkName(i, r))
241
- b(
242
- `${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
279
+ updateNoBorderRadius(t, r, e, i) {
280
+ if (!this.checkName(i, e))
281
+ s(
282
+ `"${e}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join('", "')}".`
243
283
  );
244
284
  else {
245
285
  const o = this.splitAttrNameFromBreakpoint(t), l = o.breakpoint;
246
- e !== null && e !== "" && this.$el.classList.toggle(
247
- `${o.attrName}-${e}${l}`
248
- ), r !== null && r !== "" && this.$el.classList.toggle(
286
+ r !== null && r !== "" && this.$el.classList.toggle(
249
287
  `${o.attrName}-${r}${l}`
288
+ ), e !== null && e !== "" && this.$el.classList.toggle(
289
+ `${o.attrName}-${e}${l}`
250
290
  );
251
291
  }
252
292
  }
253
- updateAttribute(t, e, r, i) {
254
- if (!this.checkName(i, r))
255
- b(
256
- `${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
293
+ updateAttribute(t, r, e, i) {
294
+ if (!this.checkName(i, e))
295
+ s(
296
+ `"${e}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join('", "')}".`
257
297
  );
258
298
  else {
259
299
  const o = this.splitAttrNameFromBreakpoint(t), l = o.breakpoint;
260
- e !== null && e !== "" && this.$el.classList.toggle(
261
- `${o.attrName}-${e}${l}`
262
- ), r !== null && r !== "" && this.$el.classList.toggle(
300
+ r !== null && r !== "" && this.$el.classList.toggle(
263
301
  `${o.attrName}-${r}${l}`
302
+ ), e !== null && e !== "" && this.$el.classList.toggle(
303
+ `${o.attrName}-${e}${l}`
264
304
  );
265
305
  }
266
306
  }
267
307
  splitAttrNameFromBreakpoint(t) {
268
- let e = "";
308
+ let r = "";
269
309
  if (["--mobile", "--tablet", "--laptop"].some(
270
- (r) => t.includes(r)
310
+ (e) => t.includes(e)
271
311
  )) {
272
- const r = t.split("--");
273
- t = r[0], e = `--${r[1]}`;
312
+ const e = t.split("--");
313
+ t = e[0], r = `--${e[1]}`;
274
314
  }
275
- return { attrName: t, breakpoint: e };
315
+ return { attrName: t, breakpoint: r };
276
316
  }
277
- updateAnchorOffset(t, e, r) {
278
- if (!B(r, e)) {
279
- b(
280
- `${e} is not a valid anchor-offset value for ${this.tagName.toLowerCase()}`
317
+ updateAnchorOffset(t, r, e) {
318
+ if (!g(e, r)) {
319
+ s(
320
+ `"${r}" is not a valid anchor-offset value for ${this.tagName.toLowerCase()}. Allowed values are: "${e.join('", "')}".`
281
321
  );
282
322
  return;
283
323
  }
@@ -293,11 +333,44 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
293
333
  `var(--px-padding-${o}-laptop)`
294
334
  ));
295
335
  };
296
- i(t), i(e);
336
+ i(t), i(r);
297
337
  }
298
338
  addAnchorClass() {
299
339
  this.$el.classList.contains("anchored") || this.$el.classList.add("anchored");
300
340
  }
341
+ updateAnchorSpacing(t, r, e) {
342
+ if (!g(e, r)) {
343
+ s(
344
+ `"${r}" is not a valid anchor-spacing value for ${this.tagName.toLowerCase()}. Allowed values are: "${e.join('", "')}".`
345
+ );
346
+ return;
347
+ }
348
+ const i = (o) => {
349
+ o !== null && o !== "" && o !== "default" && (this.style.setProperty(
350
+ "--container-anchor-spacing--mobile",
351
+ `var(--px-spacing-${o}-mobile)`
352
+ ), this.style.setProperty(
353
+ "--container-anchor-spacing--tablet",
354
+ `var(--px-spacing-${o}-tablet)`
355
+ ), this.style.setProperty(
356
+ "--container-anchor-spacing--laptop",
357
+ `var(--px-spacing-${o}-laptop)`
358
+ ), this.style.setProperty(
359
+ "--container-anchor-spacing--desktop",
360
+ `var(--px-spacing-${o}-desktop)`
361
+ ));
362
+ };
363
+ i(t), i(r);
364
+ }
365
+ updateSubgridRows(t, r, e, i) {
366
+ g(i, e) ? this.style.setProperty(`--${t}`, e) : s(
367
+ `"${e}" is not a valid ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join('", "')}".`
368
+ );
369
+ }
370
+ get $el() {
371
+ var t;
372
+ return (t = this == null ? void 0 : this.shadowRoot) == null ? void 0 : t.querySelector(".container");
373
+ }
301
374
  get $slotAnchor() {
302
375
  return this.querySelector('[slot^="anchor"]');
303
376
  }
@@ -631,16 +704,54 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
631
704
  set anchorOffset(t) {
632
705
  this.setAttribute("anchor-offset", t);
633
706
  }
707
+ get anchorSpacing() {
708
+ return this.getAttribute("anchor-spacing");
709
+ }
710
+ set anchorSpacing(t) {
711
+ this.setAttribute("anchor-spacing", t);
712
+ }
634
713
  get inverted() {
635
- return this.getAttribute("inverted");
714
+ return this.hasAttribute("inverted");
636
715
  }
637
716
  set inverted(t) {
638
- this.setAttribute("inverted", t);
717
+ t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
718
+ }
719
+ get subgridRows() {
720
+ return this.getAttribute("subgrid-rows");
721
+ }
722
+ set subgridRows(t) {
723
+ this.setAttribute("subgrid-rows", t);
724
+ }
725
+ get subgridGap() {
726
+ return this.getAttribute("subgrid-gap");
727
+ }
728
+ set subgridGap(t) {
729
+ this.setAttribute("subgrid-gap", t);
730
+ }
731
+ get subgridGapMobile() {
732
+ return this.getAttribute("subgrid-gap--mobile");
733
+ }
734
+ set subgridGapMobile(t) {
735
+ this.setAttribute("subgrid-gap--mobile", t);
736
+ }
737
+ get subgridGapTablet() {
738
+ return this.getAttribute("subgrid-gap--tablet");
739
+ }
740
+ set subgridGapTablet(t) {
741
+ this.setAttribute("subgrid-gap--tablet", t);
742
+ }
743
+ get subgridGapLaptop() {
744
+ return this.getAttribute("subgrid-gap--laptop");
745
+ }
746
+ set subgridGapLaptop(t) {
747
+ this.setAttribute("subgrid-gap--laptop", t);
639
748
  }
640
749
  };
641
- p.nativeName = "div";
642
- let g = p;
643
- customElements.get("px-container") || customElements.define("px-container", g);
750
+ u.nativeName = "div";
751
+ let p = u;
752
+ customElements.get("px-container") || customElements.define("px-container", p);
644
753
  export {
645
- g as Container
754
+ p as Container,
755
+ S as anchorSpacingValues,
756
+ T as subgridRowsValues
646
757
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-container",
3
- "version": "2.0.0-alpha.16",
3
+ "version": "2.0.0-alpha.161",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"
@@ -11,7 +11,7 @@
11
11
  "clean": "rm -rf dist",
12
12
  "build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
13
13
  "test": "vitest run --coverage",
14
- "wc-manifest": "cem analyze --globs \"src/*\" --config ../custom-elements-manifest.config.js --outdir dist"
14
+ "wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
15
15
  },
16
16
  "publishConfig": {
17
17
  "access": "public"