@proximus/lavender-heading 1.2.0-alpha.35

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.
Files changed (2) hide show
  1. package/dist/index.js +137 -0
  2. package/package.json +40 -0
package/dist/index.js ADDED
@@ -0,0 +1,137 @@
1
+ import { PxElement as g, colorValues as y } from "@proximus/lavender-common";
2
+ const u = "h1,.style-title-4xl,::slotted(h1),h2,.style-title-3xl,::slotted(h2),h3,.style-title-2xl,::slotted(h3),h4,.style-title-xl,::slotted(h4),h5,.style-title-l,::slotted(h5),h6,.style-title-m,::slotted(h6),.style-title-s,.style-subtitle{margin:0;font-family:var(--px-font-family);color:var(--heading-color-default, var(--px-color-txt-primary-default));font-size:var(--px-text-size-base-mobile);line-height:var(--px-line-height-m);font-weight:700}:host([inverted]) h1,:host([inverted]) .style-title-4xl,:host([inverted]) ::slotted(h1),:host([inverted]) h2,:host([inverted]) .style-title-3xl,:host([inverted]) ::slotted(h2),:host([inverted]) h3,:host([inverted]) .style-title-2xl,:host([inverted]) ::slotted(h3),:host([inverted]) h4,:host([inverted]) .style-title-xl,:host([inverted]) ::slotted(h4),:host([inverted]) h5,:host([inverted]) .style-title-l,:host([inverted]) ::slotted(h5),:host([inverted]) h6,:host([inverted]) .style-title-m,:host([inverted]) ::slotted(h6),:host([inverted]) .style-title-s,:host([inverted]) .style-subtitle{color:var(--heading-color-inverted, var(--px-color-txt-primary-inverted))}h1,.style-title-4xl,::slotted(h1){font-size:var(--px-text-size-5xl-mobile);line-height:var(--px-line-height-s);font-weight:900}h2,.style-title-3xl,::slotted(h2){font-size:var(--px-text-size-4xl-mobile);line-height:var(--px-line-height-s);font-weight:900}h3,.style-title-2xl,::slotted(h3){font-size:var(--px-text-size-3xl-mobile);line-height:var(--px-line-height-s)}h4,.style-title-xl,::slotted(h4){font-size:var(--px-text-size-2xl-mobile)}h5,.style-title-l,::slotted(h5){font-size:var(--px-text-size-l-mobile)}h6,.style-title-m,::slotted(h6){font-size:var(--px-text-size-m-mobile)}.style-subtitle{font-size:var(--px-text-size-xl-mobile);font-weight:300}.style-title-s{font-size:var(--px-text-size-base-mobile)}@media only screen and (min-width: 768px){h1,.style-title-4xl,::slotted(h1){font-size:var(--px-text-size-5xl-tablet)}h2,.style-title-3xl,::slotted(h2){font-size:var(--px-text-size-4xl-tablet)}h3,.style-title-2xl,::slotted(h3){font-size:var(--px-text-size-3xl-tablet)}h4,.style-title-xl,::slotted(h4){font-size:var(--px-text-size-2xl-tablet)}h5,.style-title-l,::slotted(h5){font-size:var(--px-text-size-l-tablet)}h6,.style-title-m,::slotted(h6){font-size:var(--px-text-size-m-tablet)}.style-title-s{font-size:var(--px-text-size-base-tablet)}.style-subtitle{font-size:var(--px-text-size-xl-tablet)}}@media only screen and (min-width: 1025px){h1,.style-title-4xl,::slotted(h1){font-size:var(--px-text-size-5xl-desktop)}h2,.style-title-3xl,::slotted(h2){font-size:var(--px-text-size-4xl-desktop)}h3,.style-title-2xl,::slotted(h3){font-size:var(--px-text-size-3xl-desktop)}h4,.style-title-xl,::slotted(h4){font-size:var(--px-text-size-2xl-desktop)}h5,.style-title-l,::slotted(h5){font-size:var(--px-text-size-l-desktop)}h6,.style-title-m,::slotted(h6){font-size:var(--px-text-size-m-desktop)}.style-title-s{font-size:var(--px-text-size-base-desktop)}.style-subtitle{font-size:var(--px-text-size-xl-desktop)}}", k = ":host>*:first-child{--font-weight-light: 300;--font-weight-regular: 400;--font-weight-bold: 700;--font-weight-extrabold: 900}.color-inherit{color:inherit}.color-primary{color:var(--px-color-txt-primary-default)}.color-body{color:var(--px-color-txt-body-default)}.color-details{color:var(--px-color-txt-details-default)}.color-hover{color:var(--px-color-txt-hover-default)}.color-disabled{color:var(--px-color-txt-disabled-default)}.color-active{color:var(--px-color-txt-active-default)}.color-promo{color:var(--px-color-txt-promo-default)}.color-success{color:var(--px-color-txt-success-default)}.color-error{color:var(--px-color-txt-error-default)}.color-warning{color:var(--px-color-txt-warning-default)}.color-unlimited{color:var(--px-color-txt-unlimited-default)}:host([inverted]) .color-inherit{color:inherit}:host([inverted]) .color-primary{color:var(--px-color-txt-primary-inverted)}:host([inverted]) .color-body{color:var(--px-color-txt-body-inverted)}:host([inverted]) .color-details{color:var(--px-color-txt-details-inverted)}:host([inverted]) .color-hover{color:var(--px-color-txt-hover-inverted)}:host([inverted]) .color-disabled{color:var(--px-color-txt-disabled-inverted)}:host([inverted]) .color-active{color:var(--px-color-txt-active-inverted)}:host([inverted]) .color-promo{color:var(--px-color-txt-promo-inverted)}:host([inverted]) .color-success{color:var(--px-color-txt-success-inverted)}:host([inverted]) .color-error{color:var(--px-color-txt-error-inverted)}:host([inverted]) .color-warning{color:var(--px-color-txt-warning-inverted)}:host([inverted]) .color-unlimited{color:var(--px-color-txt-unlimited-inverted)}.fontsize-inherit{font-size:inherit;line-height:inherit}.fontsize-xs{font-size:var(--px-text-size-xs-mobile)}.fontsize-s{font-size:var(--px-text-size-s-mobile)}.fontsize-base{font-size:var(--px-text-size-base-mobile)}.fontsize-m{font-size:var(--px-text-size-m-mobile)}.fontsize-l{font-size:var(--px-text-size-l-mobile)}.fontsize-xl{font-size:var(--px-text-size-xl-mobile)}.fontsize-2xl{font-size:var(--px-text-size-2xl-mobile)}.fontsize-3xl{font-size:var(--px-text-size-3xl-mobile);line-height:var(--px-line-height-s)}.fontsize-4xl{font-size:var(--px-text-size-4xl-mobile);line-height:var(--px-line-height-s)}.fontsize-5xl{font-size:var(--px-text-size-5xl-mobile);line-height:var(--px-line-height-s)}.fontsize-6xl{font-size:var(--px-text-size-6xl-mobile);line-height:var(--px-line-height-s)}.fontsize-7xl{font-size:var(--px-text-size-7xl-mobile);line-height:var(--px-line-height-s)}@media only screen and (min-width: 768px){.fontsize-xs{font-size:var(--px-text-size-xs-mobile)}.fontsize-s{font-size:var(--px-text-size-s-mobile)}.fontsize-base{font-size:var(--px-text-size-base-mobile)}.fontsize-m{font-size:var(--px-text-size-m-mobile)}.fontsize-l{font-size:var(--px-text-size-l-mobile)}.fontsize-xl{font-size:var(--px-text-size-xl-mobile)}.fontsize-2xl{font-size:var(--px-text-size-2xl-mobile)}.fontsize-3xl{font-size:var(--px-text-size-3xl-mobile)}.fontsize-4xl{font-size:var(--px-text-size-4xl-mobile)}.fontsize-5xl{font-size:var(--px-text-size-5xl-mobile)}.fontsize-6xl{font-size:var(--px-text-size-6xl-mobile)}.fontsize-7xl{font-size:var(--px-text-size-7xl-mobile)}}@media only screen and (min-width: 1025px){.fontsize-xs{font-size:var(--px-text-size-xs-tablet)}.fontsize-s{font-size:var(--px-text-size-s-tablet)}.fontsize-base{font-size:var(--px-text-size-base-tablet)}.fontsize-m{font-size:var(--px-text-size-m-tablet)}.fontsize-l{font-size:var(--px-text-size-l-tablet)}.fontsize-xl{font-size:var(--px-text-size-xl-tablet)}.fontsize-2xl{font-size:var(--px-text-size-2xl-tablet)}.fontsize-3xl{font-size:var(--px-text-size-3xl-tablet)}.fontsize-4xl{font-size:var(--px-text-size-4xl-tablet)}.fontsize-5xl{font-size:var(--px-text-size-5xl-tablet)}.fontsize-6xl{font-size:var(--px-text-size-6xl-tablet)}.fontsize-7xl{font-size:var(--px-text-size-7xl-tablet)}}@media only screen and (min-width: 1441px){.fontsize-xs{font-size:var(--px-text-size-xs-desktop)}.fontsize-s{font-size:var(--px-text-size-s-desktop)}.fontsize-base{font-size:var(--px-text-size-base-desktop)}.fontsize-m{font-size:var(--px-text-size-m-desktop)}.fontsize-l{font-size:var(--px-text-size-l-desktop)}.fontsize-xl{font-size:var(--px-text-size-xl-desktop)}.fontsize-2xl{font-size:var(--px-text-size-2xl-desktop)}.fontsize-3xl{font-size:var(--px-text-size-3xl-desktop)}.fontsize-4xl{font-size:var(--px-text-size-4xl-desktop)}.fontsize-5xl{font-size:var(--px-text-size-5xl-desktop)}.fontsize-6xl{font-size:var(--px-text-size-6xl-desktop)}.fontsize-7xl{font-size:var(--px-text-size-7xl-desktop)}}.fontweight-inherit{font-weight:inherit}.fontweight-normal{font-weight:var(--font-weight-regular)}.fontweight-bold{font-weight:var(--font-weight-bold)}.fontweight-extrabold{font-weight:var(--font-weight-extrabold)}.fontweight-light{font-weight:var(--font-weight-light)}", b = new CSSStyleSheet();
3
+ b.replaceSync(u);
4
+ const m = new CSSStyleSheet();
5
+ m.replaceSync(k);
6
+ const w = [
7
+ "",
8
+ "default",
9
+ "title-4xl",
10
+ "title-3xl",
11
+ "title-2xl",
12
+ "title-xl",
13
+ "title-l",
14
+ "title-m",
15
+ "title-s",
16
+ "subtitle"
17
+ ];
18
+ class o extends g {
19
+ template() {
20
+ return "<slot></slot>";
21
+ }
22
+ constructor(t) {
23
+ super(b, m);
24
+ const e = document.createElement(t);
25
+ e.innerHTML = this.template(), this.shadowRoot.appendChild(e);
26
+ }
27
+ static get observedAttributes() {
28
+ return [...super.observedAttributes, "variant", "color", "inverted"];
29
+ }
30
+ get variant() {
31
+ return this.getAttribute("variant");
32
+ }
33
+ set variant(t) {
34
+ this.setAttribute("variant", t);
35
+ }
36
+ get color() {
37
+ return this.getAttribute("color");
38
+ }
39
+ set color(t) {
40
+ this.setAttribute("color", t);
41
+ }
42
+ get inverted() {
43
+ return this.getAttribute("inverted");
44
+ }
45
+ set inverted(t) {
46
+ this.setAttribute("inverted", t);
47
+ }
48
+ attributeChangedCallback(t, e, i) {
49
+ if (e !== i)
50
+ switch (t) {
51
+ case "variant":
52
+ this.updateAttribute(t, e, i, w);
53
+ break;
54
+ case "color":
55
+ this.updateColor(e, i, y);
56
+ break;
57
+ default:
58
+ super.attributeChangedCallback(t, e, i);
59
+ break;
60
+ }
61
+ }
62
+ toggleClass(t, e) {
63
+ t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`style-${t}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`style-${e}`);
64
+ }
65
+ checkName(t, e) {
66
+ return t.includes(e);
67
+ }
68
+ updateAttribute(t, e, i, s) {
69
+ this.checkName(s, i) ? this.toggleClass(e, i) : console.error(`Bad "${t}" value for`, this.$el);
70
+ }
71
+ updateColor(t, e, i) {
72
+ const s = this.inverted === null ? "default" : "inverted";
73
+ t !== null && t !== "" && t !== "default" && this.$el.style.setProperty(
74
+ `--heading-color-${s}`,
75
+ `var(--px-color-txt-${t}-${s})`
76
+ ), e !== null && e !== "" && e !== "default" && this.$el.style.setProperty(
77
+ `--heading-color-${s}`,
78
+ `var(--px-color-txt-${e}-${s})`
79
+ ), this.checkName(i, e) || console.error("Bad color value for", this.$el);
80
+ }
81
+ }
82
+ const z = class z extends o {
83
+ constructor() {
84
+ super("h1");
85
+ }
86
+ };
87
+ z.nativeName = "h1";
88
+ let l = z;
89
+ customElements.define("px-h1", l);
90
+ const v = class v extends o {
91
+ constructor() {
92
+ super("h2");
93
+ }
94
+ };
95
+ v.nativeName = "h2";
96
+ let r = v;
97
+ customElements.define("px-h2", r);
98
+ const d = class d extends o {
99
+ constructor() {
100
+ super("h3");
101
+ }
102
+ };
103
+ d.nativeName = "h3";
104
+ let x = d;
105
+ customElements.define("px-h3", x);
106
+ const f = class f extends o {
107
+ constructor() {
108
+ super("h4");
109
+ }
110
+ };
111
+ f.nativeName = "h4";
112
+ let n = f;
113
+ customElements.define("px-h4", n);
114
+ const p = class p extends o {
115
+ constructor() {
116
+ super("h5");
117
+ }
118
+ };
119
+ p.nativeName = "h5";
120
+ let a = p;
121
+ customElements.define("px-h5", a);
122
+ const c = class c extends o {
123
+ constructor() {
124
+ super("h6");
125
+ }
126
+ };
127
+ c.nativeName = "h6";
128
+ let h = c;
129
+ customElements.define("px-h6", h);
130
+ export {
131
+ l as H1,
132
+ r as H2,
133
+ x as H3,
134
+ n as H4,
135
+ a as H5,
136
+ h as H6
137
+ };
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@proximus/lavender-heading",
3
+ "version": "1.2.0-alpha.35",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./src/index.ts",
9
+ "development": "./src/index.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./src/*.css": {
13
+ "development": "src/*.css"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "type": "module",
20
+ "scripts": {
21
+ "build": "rm -rf dist;tsc; vite build",
22
+ "test": "vitest run --coverage"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "gitHead": "15a231df98020f83813279639a9a7712a5a5e759",
28
+ "lerna": {
29
+ "command": {
30
+ "publish": {
31
+ "assets": [
32
+ "CHANGELOG.md",
33
+ "package.json",
34
+ "dist/*.js",
35
+ "dist/css/**/*.css"
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ }