@proximus/lavender-container 2.0.0-alpha.49 → 2.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Container.d.ts +4 -0
- package/dist/index.es.js +84 -47
- package/package.json +1 -1
package/dist/Container.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VerticallyExtendedElement } from '@proximus/lavender-common';
|
|
2
|
+
export declare const anchorSpacingValues: string[];
|
|
2
3
|
export declare class Container extends VerticallyExtendedElement<HTMLDivElement> {
|
|
3
4
|
static nativeName: string;
|
|
4
5
|
private template;
|
|
@@ -23,6 +24,7 @@ export declare class Container extends VerticallyExtendedElement<HTMLDivElement>
|
|
|
23
24
|
};
|
|
24
25
|
updateAnchorOffset(oldValue: string, newValue: string, attrValue: string[]): void;
|
|
25
26
|
addAnchorClass(): void;
|
|
27
|
+
updateAnchorSpacing(oldValue: string, newValue: string, attrValue: string[]): void;
|
|
26
28
|
get $slotAnchor(): HTMLSlotElement;
|
|
27
29
|
get padding(): string;
|
|
28
30
|
set padding(value: string);
|
|
@@ -134,6 +136,8 @@ export declare class Container extends VerticallyExtendedElement<HTMLDivElement>
|
|
|
134
136
|
set boxShadow(value: string);
|
|
135
137
|
get anchorOffset(): string;
|
|
136
138
|
set anchorOffset(value: string);
|
|
139
|
+
get anchorSpacing(): string;
|
|
140
|
+
set anchorSpacing(value: string);
|
|
137
141
|
get inverted(): string;
|
|
138
142
|
set inverted(value: string);
|
|
139
143
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import { cssTokenBreakpoints as
|
|
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();
|
|
1
|
+
import { cssTokenBreakpoints as d, paddingValues as a, VerticallyExtendedElement as k, boxShadowValues as m, backgroundSizeValues as f, noBorderRadiusValues as v, borderRadiusValues as A, borderSideValues as y, borderValues as x, gradientValues as $, log as n, backgroundColorValues as L, borderColorValues as B, checkName as c } 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)}@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)) ) )}:host([anchor-spacing]){margin-top:var(--container-anchor-spacing--tablet)}}@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}}', u = new CSSStyleSheet();
|
|
3
3
|
u.replaceSync(C);
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const S = [
|
|
5
|
+
"has-patch",
|
|
6
|
+
"neighbor-has-patch",
|
|
7
|
+
"has-ribbon",
|
|
8
|
+
"neighbor-has-ribbon"
|
|
9
|
+
], s = (h, t, e) => `:host([${h}${e ? `--${e}` : ""}='${t}']) .container`, b = "px-padding", T = [
|
|
10
|
+
d(
|
|
6
11
|
"padding",
|
|
7
|
-
n,
|
|
8
|
-
d,
|
|
9
12
|
s,
|
|
13
|
+
a,
|
|
14
|
+
b,
|
|
10
15
|
"--container-padding"
|
|
11
16
|
),
|
|
12
|
-
|
|
17
|
+
d(
|
|
13
18
|
"padding-inline",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
s,
|
|
20
|
+
a,
|
|
21
|
+
b
|
|
17
22
|
),
|
|
18
|
-
|
|
23
|
+
d(
|
|
19
24
|
"padding-block",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
s,
|
|
26
|
+
a,
|
|
27
|
+
b
|
|
23
28
|
),
|
|
24
|
-
|
|
29
|
+
d(
|
|
25
30
|
"padding-top",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
s,
|
|
32
|
+
a,
|
|
33
|
+
b
|
|
29
34
|
),
|
|
30
|
-
|
|
35
|
+
d(
|
|
31
36
|
"padding-right",
|
|
32
|
-
n,
|
|
33
|
-
d,
|
|
34
37
|
s,
|
|
38
|
+
a,
|
|
39
|
+
b,
|
|
35
40
|
"--container-padding-right"
|
|
36
41
|
),
|
|
37
|
-
|
|
42
|
+
d(
|
|
38
43
|
"padding-bottom",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
s,
|
|
45
|
+
a,
|
|
46
|
+
b
|
|
42
47
|
),
|
|
43
|
-
|
|
48
|
+
d(
|
|
44
49
|
"padding-left",
|
|
45
|
-
n,
|
|
46
|
-
d,
|
|
47
50
|
s,
|
|
51
|
+
a,
|
|
52
|
+
b,
|
|
48
53
|
"--container-padding-left"
|
|
49
54
|
)
|
|
50
|
-
], p = class p extends
|
|
55
|
+
], p = class p extends k {
|
|
51
56
|
constructor() {
|
|
52
57
|
super(u, ...T), this.template = () => `<div class="container">
|
|
53
58
|
<slot></slot>
|
|
@@ -86,6 +91,7 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
86
91
|
"background-position",
|
|
87
92
|
"box-shadow",
|
|
88
93
|
"anchor-offset",
|
|
94
|
+
"anchor-spacing",
|
|
89
95
|
"inverted"
|
|
90
96
|
];
|
|
91
97
|
}
|
|
@@ -111,7 +117,7 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
111
117
|
if (e !== r)
|
|
112
118
|
switch (t) {
|
|
113
119
|
case "border":
|
|
114
|
-
this.updateAttribute(t, e, r,
|
|
120
|
+
this.updateAttribute(t, e, r, x);
|
|
115
121
|
break;
|
|
116
122
|
case "border-color":
|
|
117
123
|
this.updateBorderColor(t, r);
|
|
@@ -120,14 +126,14 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
120
126
|
case "border-side--mobile":
|
|
121
127
|
case "border-side--tablet":
|
|
122
128
|
case "border-side--laptop":
|
|
123
|
-
this.updateAttribute(t, e, r,
|
|
129
|
+
this.updateAttribute(t, e, r, y);
|
|
124
130
|
break;
|
|
125
131
|
case "border-radius":
|
|
126
132
|
this.updateAttribute(
|
|
127
133
|
t,
|
|
128
134
|
e,
|
|
129
135
|
r,
|
|
130
|
-
|
|
136
|
+
A
|
|
131
137
|
);
|
|
132
138
|
break;
|
|
133
139
|
case "no-border-radius":
|
|
@@ -138,7 +144,7 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
138
144
|
t,
|
|
139
145
|
e,
|
|
140
146
|
r,
|
|
141
|
-
|
|
147
|
+
v
|
|
142
148
|
);
|
|
143
149
|
break;
|
|
144
150
|
case "background-color":
|
|
@@ -158,7 +164,7 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
158
164
|
t,
|
|
159
165
|
e,
|
|
160
166
|
r,
|
|
161
|
-
|
|
167
|
+
f
|
|
162
168
|
);
|
|
163
169
|
break;
|
|
164
170
|
case "background-image":
|
|
@@ -171,10 +177,13 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
171
177
|
r !== null && r !== "" && (this.$el.style.backgroundPosition = r);
|
|
172
178
|
break;
|
|
173
179
|
case "box-shadow":
|
|
174
|
-
this.updateAttribute(t, e, r,
|
|
180
|
+
this.updateAttribute(t, e, r, m);
|
|
175
181
|
break;
|
|
176
182
|
case "anchor-offset":
|
|
177
|
-
this.updateAnchorOffset(e, r,
|
|
183
|
+
this.updateAnchorOffset(e, r, a);
|
|
184
|
+
break;
|
|
185
|
+
case "anchor-spacing":
|
|
186
|
+
this.updateAnchorSpacing(e, r, S);
|
|
178
187
|
break;
|
|
179
188
|
default:
|
|
180
189
|
super.attributeChangedCallback(t, e, r);
|
|
@@ -196,7 +205,7 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
196
205
|
this.$el.style.setProperty(`--${t}`, `url("${e}")`);
|
|
197
206
|
}
|
|
198
207
|
updateGradient(t, e) {
|
|
199
|
-
if (this.checkName(
|
|
208
|
+
if (this.checkName($, e)) {
|
|
200
209
|
const r = this.splitAttrNameFromBreakpoint(t);
|
|
201
210
|
t = r.attrName;
|
|
202
211
|
const i = r.breakpoint;
|
|
@@ -205,13 +214,13 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
205
214
|
`linear-gradient(var(--px-color-background-gradient-${e}))`
|
|
206
215
|
);
|
|
207
216
|
} else
|
|
208
|
-
|
|
217
|
+
n(
|
|
209
218
|
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
210
219
|
);
|
|
211
220
|
}
|
|
212
221
|
updateBackgroundColor(t, e) {
|
|
213
222
|
const r = e.startsWith("surface-");
|
|
214
|
-
if (this.checkName(
|
|
223
|
+
if (this.checkName(L, e)) {
|
|
215
224
|
const i = this.splitAttrNameFromBreakpoint(t), o = i.breakpoint;
|
|
216
225
|
this.$el.style.setProperty(
|
|
217
226
|
`--${i.attrName}${o}`,
|
|
@@ -221,24 +230,24 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
221
230
|
`var(--px-color-background-${e}${r ? "" : "-inverted"})`
|
|
222
231
|
);
|
|
223
232
|
} else
|
|
224
|
-
|
|
233
|
+
n(
|
|
225
234
|
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
226
235
|
);
|
|
227
236
|
}
|
|
228
237
|
updateBorderColor(t, e) {
|
|
229
|
-
this.checkName(
|
|
238
|
+
this.checkName(B, e) ? (this.$el.style.setProperty(
|
|
230
239
|
`--${t}`,
|
|
231
240
|
`var(--px-color-border-${e}-default)`
|
|
232
241
|
), this.$el.style.setProperty(
|
|
233
242
|
`--${t}-inverted`,
|
|
234
243
|
`var(--px-color-border-${e}-inverted)`
|
|
235
|
-
)) :
|
|
244
|
+
)) : n(
|
|
236
245
|
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
237
246
|
);
|
|
238
247
|
}
|
|
239
248
|
updateNoBorderRadius(t, e, r, i) {
|
|
240
249
|
if (!this.checkName(i, r))
|
|
241
|
-
|
|
250
|
+
n(
|
|
242
251
|
`${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
243
252
|
);
|
|
244
253
|
else {
|
|
@@ -252,7 +261,7 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
252
261
|
}
|
|
253
262
|
updateAttribute(t, e, r, i) {
|
|
254
263
|
if (!this.checkName(i, r))
|
|
255
|
-
|
|
264
|
+
n(
|
|
256
265
|
`${r} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
257
266
|
);
|
|
258
267
|
else {
|
|
@@ -275,8 +284,8 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
275
284
|
return { attrName: t, breakpoint: e };
|
|
276
285
|
}
|
|
277
286
|
updateAnchorOffset(t, e, r) {
|
|
278
|
-
if (!
|
|
279
|
-
|
|
287
|
+
if (!c(r, e)) {
|
|
288
|
+
n(
|
|
280
289
|
`${e} is not a valid anchor-offset value for ${this.tagName.toLowerCase()}`
|
|
281
290
|
);
|
|
282
291
|
return;
|
|
@@ -298,6 +307,27 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
298
307
|
addAnchorClass() {
|
|
299
308
|
this.$el.classList.contains("anchored") || this.$el.classList.add("anchored");
|
|
300
309
|
}
|
|
310
|
+
updateAnchorSpacing(t, e, r) {
|
|
311
|
+
if (!c(r, e)) {
|
|
312
|
+
n(
|
|
313
|
+
`${e} is not a valid anchor-spacing value for ${this.tagName.toLowerCase()}`
|
|
314
|
+
);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const i = (o) => {
|
|
318
|
+
o !== null && o !== "" && o !== "default" && (this.style.setProperty(
|
|
319
|
+
"--container-anchor-spacing--mobile",
|
|
320
|
+
`var(--px-spacing-${o}-mobile)`
|
|
321
|
+
), this.style.setProperty(
|
|
322
|
+
"--container-anchor-spacing--tablet",
|
|
323
|
+
`var(--px-spacing-${o}-tablet)`
|
|
324
|
+
), this.style.setProperty(
|
|
325
|
+
"--container-anchor-spacing--laptop",
|
|
326
|
+
`var(--px-spacing-${o}-laptop)`
|
|
327
|
+
));
|
|
328
|
+
};
|
|
329
|
+
i(t), i(e);
|
|
330
|
+
}
|
|
301
331
|
get $slotAnchor() {
|
|
302
332
|
return this.querySelector('[slot^="anchor"]');
|
|
303
333
|
}
|
|
@@ -631,6 +661,12 @@ const n = (c, t, e) => `:host([${c}${e ? `--${e}` : ""}='${t}']) .container`, s
|
|
|
631
661
|
set anchorOffset(t) {
|
|
632
662
|
this.setAttribute("anchor-offset", t);
|
|
633
663
|
}
|
|
664
|
+
get anchorSpacing() {
|
|
665
|
+
return this.getAttribute("anchor-spacing");
|
|
666
|
+
}
|
|
667
|
+
set anchorSpacing(t) {
|
|
668
|
+
this.setAttribute("anchor-spacing", t);
|
|
669
|
+
}
|
|
634
670
|
get inverted() {
|
|
635
671
|
return this.getAttribute("inverted");
|
|
636
672
|
}
|
|
@@ -642,5 +678,6 @@ p.nativeName = "div";
|
|
|
642
678
|
let g = p;
|
|
643
679
|
customElements.get("px-container") || customElements.define("px-container", g);
|
|
644
680
|
export {
|
|
645
|
-
g as Container
|
|
681
|
+
g as Container,
|
|
682
|
+
S as anchorSpacingValues
|
|
646
683
|
};
|