@proximus/lavender-switch 2.0.0-alpha.202 → 2.0.0-alpha.204

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/Switch.d.ts CHANGED
@@ -4,10 +4,10 @@ export declare enum InputState {
4
4
  SUCCESS = "success"
5
5
  }
6
6
  export declare class Switch extends PxElement<HTMLInputElement> {
7
+ protected static readonly template: HTMLTemplateElement;
7
8
  static nativeName: string;
8
9
  static accessorExclusions: string[];
9
10
  protected internals: ElementInternals;
10
- private template;
11
11
  constructor();
12
12
  static get observedAttributes(): string[];
13
13
  connectedCallback(): void;
@@ -11,6 +11,13 @@
11
11
  "description": "",
12
12
  "name": "Switch",
13
13
  "members": [
14
+ {
15
+ "kind": "field",
16
+ "name": "template",
17
+ "privacy": "protected",
18
+ "static": true,
19
+ "readonly": true
20
+ },
14
21
  {
15
22
  "kind": "field",
16
23
  "name": "nativeName",
@@ -37,11 +44,6 @@
37
44
  },
38
45
  "privacy": "protected"
39
46
  },
40
- {
41
- "kind": "field",
42
- "name": "template",
43
- "privacy": "private"
44
- },
45
47
  {
46
48
  "kind": "method",
47
49
  "name": "formData",
@@ -99,10 +101,6 @@
99
101
  "type": {
100
102
  "text": "boolean"
101
103
  }
102
- },
103
- {
104
- "kind": "field",
105
- "name": "innerHTML"
106
104
  }
107
105
  ],
108
106
  "events": [
package/dist/index.es.js CHANGED
@@ -1,10 +1,13 @@
1
- import { PxElement as e } from "@proximus/lavender-common";
1
+ import { PxElement as e, createTemplate as t, renderTemplate as n } from "@proximus/lavender-common";
2
2
  //#region src/switch.css?inline
3
- var t = ":host{display:inline-flex}.switch *{box-sizing:border-box}.switch{border-radius:var(--px-radius-pill);align-items:center;display:inline-flex}:host(:focus-visible){outline:none}:host(:focus-visible) .switch{outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default);outline-offset:var(--px-focus-offset-mobile)}:host([inverted]:focus-visible) .switch{outline-color:var(--px-color-border-focus-outline-inverted)}label{padding:var(--px-padding-3xs-mobile);border-radius:var(--px-radius-pill);background-color:var(--px-color-background-container-strong-default);outline:var(--px-size-border-m) solid var(--px-color-border-none-default);width:var(--px-size-action-input-switch-width);height:calc(var(--px-size-icon-m) + (var(--px-padding-3xs-mobile) * 2));flex-shrink:0;display:flex;position:relative}label:after{content:\"\";top:50%;left:var(--px-padding-3xs-mobile);width:var(--px-size-icon-m);max-width:var(--px-size-icon-m);height:var(--px-size-icon-m);border-radius:var(--px-radius-pill);background-color:var(--px-color-background-container-light-default);transition:transform .2s ease-in-out;position:absolute;transform:translateY(-50%)}:host input{appearance:none;margin:0}:is(:host(:not([disabled])):host(:hover),:host(:not([disabled])):host([hover])) label{outline-color:var(--px-color-border-neutral-default);cursor:pointer}:host([checked]) label{background-color:var(--px-color-background-purpose-success-default);transition:background-color .2s ease-in-out}:host([checked]) label:after{transform:translateY(-50%) translateX(calc(var(--px-size-icon-m) - var(--px-padding-3xs-mobile)));transition:transform .2s ease-in-out}:host(:hover) :is(:host(:not([disabled])) :is(:host([checked]) label)),:host([hover]) :is(:host(:not([disabled])) :is(:host([checked]) label)){outline-color:var(--px-color-border-purpose-success-default)}:host([disabled]) label{background-color:var(--px-color-background-state-disabled-default)}:host([disabled]) label:after{background-color:var(--px-color-background-state-disabled-default)}:host([inverted]) label{background-color:var(--px-color-background-container-strong-inverted)}:host(:hover) :is(:host(:not([disabled])) :is(:host([inverted]) label)),:host([hover]) :is(:host(:not([disabled])) :is(:host([inverted]) label)){outline-color:var(--px-color-border-neutral-inverted)}:host([checked]:not([disabled])) :is(:host([inverted]) label){background-color:var(--px-color-background-purpose-success-inverted)}:host(:hover) :is(:host([checked]:not([disabled])) :is(:host([inverted]) label)),:host([hover]) :is(:host([checked]:not([disabled])) :is(:host([inverted]) label)){outline-color:var(--px-color-border-purpose-success-inverted)}:host([disabled]) :is(:host([inverted]) label){background-color:var(--px-color-background-state-disabled-inverted)}:host([disabled]) :is(:host([inverted]) label):after{background-color:var(--px-color-background-state-disabled-inverted)}@media screen and (width>=48rem){label{padding:var(--px-padding-3xs-desktop)}}@media screen and (width>=64.0625rem){label{padding:var(--px-padding-3xs-desktop)}}", n = new CSSStyleSheet();
4
- n.replaceSync(t);
5
- var r = /* @__PURE__ */ function(e) {
3
+ var r = ":host{display:inline-flex}.switch *{box-sizing:border-box}.switch{border-radius:var(--px-radius-pill);align-items:center;display:inline-flex}:host(:focus-visible){outline:none}:host(:focus-visible) .switch{outline:var(--px-focus-outline-mobile) solid var(--px-color-border-focus-outline-default);outline-offset:var(--px-focus-offset-mobile)}:host([inverted]:focus-visible) .switch{outline-color:var(--px-color-border-focus-outline-inverted)}label{padding:var(--px-padding-3xs-mobile);border-radius:var(--px-radius-pill);background-color:var(--px-color-background-container-strong-default);outline:var(--px-size-border-m) solid var(--px-color-border-none-default);width:var(--px-size-action-input-switch-width);height:calc(var(--px-size-icon-m) + (var(--px-padding-3xs-mobile) * 2));flex-shrink:0;display:flex;position:relative}label:after{content:\"\";top:50%;left:var(--px-padding-3xs-mobile);width:var(--px-size-icon-m);max-width:var(--px-size-icon-m);height:var(--px-size-icon-m);border-radius:var(--px-radius-pill);background-color:var(--px-color-background-container-light-default);transition:transform .2s ease-in-out;position:absolute;transform:translateY(-50%)}:host input{appearance:none;margin:0}:is(:host(:not([disabled])):host(:hover),:host(:not([disabled])):host([hover])) label{outline-color:var(--px-color-border-neutral-default);cursor:pointer}:host([checked]) label{background-color:var(--px-color-background-purpose-success-default);transition:background-color .2s ease-in-out}:host([checked]) label:after{transform:translateY(-50%) translateX(calc(var(--px-size-icon-m) - var(--px-padding-3xs-mobile)));transition:transform .2s ease-in-out}:host(:hover) :is(:host(:not([disabled])) :is(:host([checked]) label)),:host([hover]) :is(:host(:not([disabled])) :is(:host([checked]) label)){outline-color:var(--px-color-border-purpose-success-default)}:host([disabled]) label{background-color:var(--px-color-background-state-disabled-default)}:host([disabled]) label:after{background-color:var(--px-color-background-state-disabled-default)}:host([inverted]) label{background-color:var(--px-color-background-container-strong-inverted)}:host(:hover) :is(:host(:not([disabled])) :is(:host([inverted]) label)),:host([hover]) :is(:host(:not([disabled])) :is(:host([inverted]) label)){outline-color:var(--px-color-border-neutral-inverted)}:host([checked]:not([disabled])) :is(:host([inverted]) label){background-color:var(--px-color-background-purpose-success-inverted)}:host(:hover) :is(:host([checked]:not([disabled])) :is(:host([inverted]) label)),:host([hover]) :is(:host([checked]:not([disabled])) :is(:host([inverted]) label)){outline-color:var(--px-color-border-purpose-success-inverted)}:host([disabled]) :is(:host([inverted]) label){background-color:var(--px-color-background-state-disabled-inverted)}:host([disabled]) :is(:host([inverted]) label):after{background-color:var(--px-color-background-state-disabled-inverted)}@media screen and (width>=48rem){label{padding:var(--px-padding-3xs-desktop)}}@media screen and (width>=64.0625rem){label{padding:var(--px-padding-3xs-desktop)}}", i = new CSSStyleSheet();
4
+ i.replaceSync(r);
5
+ var a = /* @__PURE__ */ function(e) {
6
6
  return e.ERROR = "error", e.SUCCESS = "success", e;
7
- }({}), i = class extends e {
7
+ }({}), o = class r extends e {
8
+ static {
9
+ this.template = t("<div class=\"switch\"><input type=\"checkbox\" tabindex=\"-1\" inert/><label></label></div>");
10
+ }
8
11
  static {
9
12
  this.nativeName = "input";
10
13
  }
@@ -12,7 +15,7 @@ var r = /* @__PURE__ */ function(e) {
12
15
  this.accessorExclusions = ["checked", "disabled"];
13
16
  }
14
17
  constructor() {
15
- super(n), this.template = () => "<div class=\"switch\">\n <input type=\"checkbox\" tabindex=\"-1\" inert/>\n <label></label>\n </div>", this.shadowRoot.innerHTML = this.template(), this.internals = this.attachInternals?.();
18
+ super(i), n(this.shadowRoot, r.template), this.internals = this.attachInternals?.();
16
19
  }
17
20
  static get observedAttributes() {
18
21
  return [
@@ -86,6 +89,6 @@ var r = /* @__PURE__ */ function(e) {
86
89
  return this.$el.disabled;
87
90
  }
88
91
  };
89
- customElements.get("px-switch") || customElements.define("px-switch", i);
92
+ customElements.get("px-switch") || customElements.define("px-switch", o);
90
93
  //#endregion
91
- export { r as InputState, i as Switch };
94
+ export { a as InputState, o as Switch };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@proximus/lavender-switch",
4
- "version": "2.0.0-alpha.202",
4
+ "version": "2.0.0-alpha.204",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -20,8 +20,7 @@
20
20
  { "name": "$switch" },
21
21
  { "name": "inverted" },
22
22
  { "name": "checked", "type": "boolean" },
23
- { "name": "disabled", "type": "boolean" },
24
- { "name": "innerHTML" }
23
+ { "name": "disabled", "type": "boolean" }
25
24
  ],
26
25
  "events": [{ "name": "change", "type": "Event" }]
27
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-switch",
3
- "version": "2.0.0-alpha.202",
3
+ "version": "2.0.0-alpha.204",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",