@proximus/lavender-container 2.0.0-alpha.7 → 2.0.0-alpha.73

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 { PxElement } from '@proximus/lavender-common';
2
- export declare class Container extends PxElement<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 PxElement<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 PxElement<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,61 +1,87 @@
1
- import { PxElement as c, cssTokenBreakpoints as a, paddingValues as d, boxShadowValues as h, backgroundSizeValues as k, noBorderRadiusValues as m, borderRadiusValues as f, borderSideValues as v, borderValues as A, gradientValues as y, backgroundColorValues as x, borderColorValues as $, checkName as B } from "@proximus/lavender-common";
2
- const L = ':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}}', p = new CSSStyleSheet();
3
- p.replaceSync(L);
4
- const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s = "px-padding", g = class g extends c {
1
+ import { cssTokenBreakpoints as a, paddingValues as d, gapValues as k, WithExtraAttributes as v, boxShadowValues as m, backgroundSizeValues as f, noBorderRadiusValues as A, borderRadiusValues as y, borderSideValues as x, borderValues as $, gradientValues as w, log as s, backgroundColorValues as L, borderColorValues as B, 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)}@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)}: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 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)) ) )}: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)}}@media only screen and (min-width: 1025px) and (max-width: 1440px){: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)}}@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)) ) )}: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: 1441px){: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)}}', c = new CSSStyleSheet();
3
+ c.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 = (h, t, e) => `:host([${h}${e ? `--${e}` : ""}='${t}']) .container`, b = "px-padding", R = [
24
+ a(
25
+ "padding",
26
+ n,
27
+ d,
28
+ b,
29
+ "--container-padding"
30
+ ),
31
+ a(
32
+ "padding-inline",
33
+ n,
34
+ d,
35
+ b
36
+ ),
37
+ a(
38
+ "padding-block",
39
+ n,
40
+ d,
41
+ b
42
+ ),
43
+ a(
44
+ "padding-top",
45
+ n,
46
+ d,
47
+ b
48
+ ),
49
+ a(
50
+ "padding-right",
51
+ n,
52
+ d,
53
+ b,
54
+ "--container-padding-right"
55
+ ),
56
+ a(
57
+ "padding-bottom",
58
+ n,
59
+ d,
60
+ b
61
+ ),
62
+ a(
63
+ "padding-left",
64
+ n,
65
+ d,
66
+ b,
67
+ "--container-padding-left"
68
+ ),
69
+ a(
70
+ "gap",
71
+ n,
72
+ k,
73
+ "px-spacing",
74
+ void 0,
75
+ "subgrid-gap"
76
+ )
77
+ ], u = class u extends v {
5
78
  constructor() {
6
- super(
7
- p,
8
- a(
9
- "padding",
10
- n,
11
- d,
12
- s,
13
- "--container-padding"
14
- ),
15
- a(
16
- "padding-inline",
17
- n,
18
- d,
19
- s
20
- ),
21
- a(
22
- "padding-block",
23
- n,
24
- d,
25
- s
26
- ),
27
- a(
28
- "padding-top",
29
- n,
30
- d,
31
- s
32
- ),
33
- a(
34
- "padding-right",
35
- n,
36
- d,
37
- s,
38
- "--container-padding-right"
39
- ),
40
- a(
41
- "padding-bottom",
42
- n,
43
- d,
44
- s
45
- ),
46
- a(
47
- "padding-left",
48
- n,
49
- d,
50
- s,
51
- "--container-padding-left"
52
- )
53
- ), this.template = () => `<div class="container">
79
+ super(c, ...R), this.template = () => `<div class="container">
54
80
  <slot></slot>
55
81
  <slot name="anchor-left"></slot>
56
82
  <slot name="anchor-right"></slot>
57
83
  <slot name="anchor-full"></slot>
58
- </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();
59
85
  }
60
86
  static get observedAttributes() {
61
87
  return [
@@ -87,11 +113,13 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
87
113
  "background-position",
88
114
  "box-shadow",
89
115
  "anchor-offset",
90
- "inverted"
116
+ "anchor-spacing",
117
+ "inverted",
118
+ "subgrid-rows"
91
119
  ];
92
120
  }
93
121
  connectedCallback() {
94
- 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(() => {
95
123
  this.$slotAnchor && this.addAnchorClass();
96
124
  }), this.contentObserver.observe(this, {
97
125
  childList: !0,
@@ -105,14 +133,14 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
105
133
  }), this._bgObserver.observe(this.$el);
106
134
  }
107
135
  disconnectedCallback() {
108
- var t;
109
- (t = this._bgObserver) == null || t.disconnect(), this.contentObserver.disconnect();
136
+ var t, e;
137
+ (t = this._bgObserver) == null || t.disconnect(), (e = this.contentObserver) == null || e.disconnect();
110
138
  }
111
139
  attributeChangedCallback(t, e, r) {
112
140
  if (e !== r)
113
141
  switch (t) {
114
142
  case "border":
115
- this.updateAttribute(t, e, r, A);
143
+ this.updateAttribute(t, e, r, $);
116
144
  break;
117
145
  case "border-color":
118
146
  this.updateBorderColor(t, r);
@@ -121,14 +149,14 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
121
149
  case "border-side--mobile":
122
150
  case "border-side--tablet":
123
151
  case "border-side--laptop":
124
- this.updateAttribute(t, e, r, v);
152
+ this.updateAttribute(t, e, r, x);
125
153
  break;
126
154
  case "border-radius":
127
155
  this.updateAttribute(
128
156
  t,
129
157
  e,
130
158
  r,
131
- f
159
+ y
132
160
  );
133
161
  break;
134
162
  case "no-border-radius":
@@ -139,7 +167,7 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
139
167
  t,
140
168
  e,
141
169
  r,
142
- m
170
+ A
143
171
  );
144
172
  break;
145
173
  case "background-color":
@@ -159,7 +187,7 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
159
187
  t,
160
188
  e,
161
189
  r,
162
- k
190
+ f
163
191
  );
164
192
  break;
165
193
  case "background-image":
@@ -172,11 +200,22 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
172
200
  r !== null && r !== "" && (this.$el.style.backgroundPosition = r);
173
201
  break;
174
202
  case "box-shadow":
175
- this.updateAttribute(t, e, r, h);
203
+ this.updateAttribute(t, e, r, m);
176
204
  break;
177
205
  case "anchor-offset":
178
206
  this.updateAnchorOffset(e, r, d);
179
207
  break;
208
+ case "anchor-spacing":
209
+ this.updateAnchorSpacing(e, r, S);
210
+ break;
211
+ case "subgrid-rows":
212
+ this.updateSubgridRows(
213
+ t,
214
+ e,
215
+ r,
216
+ T
217
+ );
218
+ break;
180
219
  default:
181
220
  super.attributeChangedCallback(t, e, r);
182
221
  break;
@@ -197,7 +236,7 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
197
236
  this.$el.style.setProperty(`--${t}`, `url("${e}")`);
198
237
  }
199
238
  updateGradient(t, e) {
200
- if (this.checkName(y, e)) {
239
+ if (this.checkName(w, e)) {
201
240
  const r = this.splitAttrNameFromBreakpoint(t);
202
241
  t = r.attrName;
203
242
  const i = r.breakpoint;
@@ -206,11 +245,13 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
206
245
  `linear-gradient(var(--px-color-background-gradient-${e}))`
207
246
  );
208
247
  } else
209
- console.error(`${e} is not an allowed background-gradient value`);
248
+ s(
249
+ `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
250
+ );
210
251
  }
211
252
  updateBackgroundColor(t, e) {
212
253
  const r = e.startsWith("surface-");
213
- if (this.checkName(x, e)) {
254
+ if (this.checkName(L, e)) {
214
255
  const i = this.splitAttrNameFromBreakpoint(t), o = i.breakpoint;
215
256
  this.$el.style.setProperty(
216
257
  `--${i.attrName}${o}`,
@@ -220,38 +261,46 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
220
261
  `var(--px-color-background-${e}${r ? "" : "-inverted"})`
221
262
  );
222
263
  } else
223
- console.error(`${e} is not an allowed ${t} value`);
264
+ s(
265
+ `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
266
+ );
224
267
  }
225
268
  updateBorderColor(t, e) {
226
- this.checkName($, e) ? (this.$el.style.setProperty(
269
+ this.checkName(B, e) ? (this.$el.style.setProperty(
227
270
  `--${t}`,
228
271
  `var(--px-color-border-${e}-default)`
229
272
  ), this.$el.style.setProperty(
230
273
  `--${t}-inverted`,
231
274
  `var(--px-color-border-${e}-inverted)`
232
- )) : console.error(`${e} is not an allowed ${t} value`);
275
+ )) : s(
276
+ `${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
277
+ );
233
278
  }
234
279
  updateNoBorderRadius(t, e, r, i) {
235
280
  if (!this.checkName(i, r))
236
- console.error(`${r} is not an allowed ${t} value`);
281
+ s(
282
+ `${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
283
+ );
237
284
  else {
238
- const o = this.splitAttrNameFromBreakpoint(t), b = o.breakpoint;
285
+ const o = this.splitAttrNameFromBreakpoint(t), l = o.breakpoint;
239
286
  e !== null && e !== "" && this.$el.classList.toggle(
240
- `${o.attrName}-${e}${b}`
287
+ `${o.attrName}-${e}${l}`
241
288
  ), r !== null && r !== "" && this.$el.classList.toggle(
242
- `${o.attrName}-${r}${b}`
289
+ `${o.attrName}-${r}${l}`
243
290
  );
244
291
  }
245
292
  }
246
293
  updateAttribute(t, e, r, i) {
247
294
  if (!this.checkName(i, r))
248
- console.error(`${r} is not an allowed ${t} value`);
295
+ s(
296
+ `${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
297
+ );
249
298
  else {
250
- const o = this.splitAttrNameFromBreakpoint(t), b = o.breakpoint;
299
+ const o = this.splitAttrNameFromBreakpoint(t), l = o.breakpoint;
251
300
  e !== null && e !== "" && this.$el.classList.toggle(
252
- `${o.attrName}-${e}${b}`
301
+ `${o.attrName}-${e}${l}`
253
302
  ), r !== null && r !== "" && this.$el.classList.toggle(
254
- `${o.attrName}-${r}${b}`
303
+ `${o.attrName}-${r}${l}`
255
304
  );
256
305
  }
257
306
  }
@@ -266,8 +315,10 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
266
315
  return { attrName: t, breakpoint: e };
267
316
  }
268
317
  updateAnchorOffset(t, e, r) {
269
- if (!B(r, e)) {
270
- console.error(`${e} is not a valid anchor-offset value`);
318
+ if (!g(r, e)) {
319
+ s(
320
+ `${e} is not a valid anchor-offset value for ${this.tagName.toLowerCase()}`
321
+ );
271
322
  return;
272
323
  }
273
324
  const i = (o) => {
@@ -287,6 +338,36 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
287
338
  addAnchorClass() {
288
339
  this.$el.classList.contains("anchored") || this.$el.classList.add("anchored");
289
340
  }
341
+ updateAnchorSpacing(t, e, r) {
342
+ if (!g(r, e)) {
343
+ s(
344
+ `${e} is not a valid anchor-spacing value for ${this.tagName.toLowerCase()}`
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
+ ));
359
+ };
360
+ i(t), i(e);
361
+ }
362
+ updateSubgridRows(t, e, r, i) {
363
+ g(i, r) ? this.style.setProperty(`--${t}`, r) : s(
364
+ `${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
365
+ );
366
+ }
367
+ get $el() {
368
+ var t;
369
+ return (t = this == null ? void 0 : this.shadowRoot) == null ? void 0 : t.querySelector(".container");
370
+ }
290
371
  get $slotAnchor() {
291
372
  return this.querySelector('[slot^="anchor"]');
292
373
  }
@@ -620,16 +701,54 @@ const n = (u, t, e) => `:host([${u}${e ? `--${e}` : ""}='${t}']) .container`, s
620
701
  set anchorOffset(t) {
621
702
  this.setAttribute("anchor-offset", t);
622
703
  }
704
+ get anchorSpacing() {
705
+ return this.getAttribute("anchor-spacing");
706
+ }
707
+ set anchorSpacing(t) {
708
+ this.setAttribute("anchor-spacing", t);
709
+ }
623
710
  get inverted() {
624
- return this.getAttribute("inverted");
711
+ return this.hasAttribute("inverted");
625
712
  }
626
713
  set inverted(t) {
627
- this.setAttribute("inverted", t);
714
+ t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
715
+ }
716
+ get subgridRows() {
717
+ return this.getAttribute("subgrid-rows");
718
+ }
719
+ set subgridRows(t) {
720
+ this.setAttribute("subgrid-rows", t);
721
+ }
722
+ get subgridGap() {
723
+ return this.getAttribute("subgrid-gap");
724
+ }
725
+ set subgridGap(t) {
726
+ this.setAttribute("subgrid-gap", t);
727
+ }
728
+ get subgridGapMobile() {
729
+ return this.getAttribute("subgrid-gap--mobile");
730
+ }
731
+ set subgridGapMobile(t) {
732
+ this.setAttribute("subgrid-gap--mobile", t);
733
+ }
734
+ get subgridGapTablet() {
735
+ return this.getAttribute("subgrid-gap--tablet");
736
+ }
737
+ set subgridGapTablet(t) {
738
+ this.setAttribute("subgrid-gap--tablet", t);
739
+ }
740
+ get subgridGapLaptop() {
741
+ return this.getAttribute("subgrid-gap--laptop");
742
+ }
743
+ set subgridGapLaptop(t) {
744
+ this.setAttribute("subgrid-gap--laptop", t);
628
745
  }
629
746
  };
630
- g.nativeName = "div";
631
- let l = g;
632
- customElements.get("px-container") || customElements.define("px-container", l);
747
+ u.nativeName = "div";
748
+ let p = u;
749
+ customElements.get("px-container") || customElements.define("px-container", p);
633
750
  export {
634
- l as Container
751
+ p as Container,
752
+ S as anchorSpacingValues,
753
+ T as subgridRowsValues
635
754
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-container",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.0.0-alpha.73",
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"