@nysds/nys-divider 1.12.0 → 1.13.1
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/nys-divider.js +20 -9
- package/dist/nys-divider.js.map +1 -1
- package/package.json +1 -1
package/dist/nys-divider.js
CHANGED
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
import { LitElement as
|
|
1
|
+
import { LitElement as l, unsafeCSS as v, html as a } from "lit";
|
|
2
2
|
import { property as c } from "lit/decorators.js";
|
|
3
3
|
const f = ":host{--_nys-divider-size: var(--nys-size-1px, 1px);--_nys-divider-color: var(--nys-color-neutral-500, #797c7f);--_nys-divider-width: 100%}:host([inverted]){--_nys-divider-color: var(--nys-color-ink-reverse, #fff)}.nys-divider{width:var(--_nys-divider-width);height:var(--_nys-divider-size);background-color:var(--_nys-divider-color);flex:1 0 0;margin:0;border:none}";
|
|
4
|
-
var y = Object.defineProperty,
|
|
5
|
-
for (var e = void 0, i =
|
|
6
|
-
(o =
|
|
7
|
-
return e && y(
|
|
4
|
+
var y = Object.defineProperty, u = (n, s, d, p) => {
|
|
5
|
+
for (var e = void 0, i = n.length - 1, o; i >= 0; i--)
|
|
6
|
+
(o = n[i]) && (e = o(s, d, e) || e);
|
|
7
|
+
return e && y(s, d, e), e;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
let h = 0;
|
|
10
|
+
const t = class t extends l {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(), this.inverted = !1;
|
|
12
13
|
}
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
super.connectedCallback(), this.id || (this.id = this._generateUniqueId());
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Functions
|
|
19
|
+
* --------------------------------------------------------------------------
|
|
20
|
+
*/
|
|
21
|
+
_generateUniqueId() {
|
|
22
|
+
return `nys-divider-${Date.now()}-${h++}`;
|
|
23
|
+
}
|
|
13
24
|
render() {
|
|
14
25
|
return a`<hr class="nys-divider" />`;
|
|
15
26
|
}
|
|
16
27
|
};
|
|
17
|
-
|
|
18
|
-
let r =
|
|
19
|
-
|
|
28
|
+
t.styles = v(f);
|
|
29
|
+
let r = t;
|
|
30
|
+
u([
|
|
20
31
|
c({ type: Boolean, reflect: !0 })
|
|
21
32
|
], r.prototype, "inverted");
|
|
22
33
|
customElements.get("nys-divider") || customElements.define("nys-divider", r);
|
package/dist/nys-divider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nys-divider.js","sources":["../src/nys-divider.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-divider.scss?inline\";\n\nexport class NysDivider extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n constructor() {\n super();\n }\n\n render() {\n return html`<hr class=\"nys-divider\" />`;\n }\n}\n\nif (!customElements.get(\"nys-divider\")) {\n customElements.define(\"nys-divider\", NysDivider);\n}\n"],"names":["_NysDivider","LitElement","html","unsafeCSS","styles","NysDivider","__decorateClass","property"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"nys-divider.js","sources":["../src/nys-divider.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-divider.scss?inline\";\n\nlet dividerIdCounter = 0;\n\n/**\n * A horizontal rule for visual separation between content sections. Renders a semantic `<hr>` element.\n *\n * Use to separate distinct content areas within a page. Set `inverted` for use on dark backgrounds.\n *\n * @summary Horizontal divider for visual separation of content sections.\n * @element nys-divider\n *\n * @example Basic divider\n * ```html\n * <p>Section one content</p>\n * <nys-divider></nys-divider>\n * <p>Section two content</p>\n * ```\n */\n\nexport class NysDivider extends LitElement {\n static styles = unsafeCSS(styles);\n\n /** Adjusts colors for dark backgrounds. */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n constructor() {\n super();\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Generate a unique ID if not provided\n if (!this.id) {\n this.id = this._generateUniqueId();\n }\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n private _generateUniqueId() {\n return `nys-divider-${Date.now()}-${dividerIdCounter++}`;\n }\n\n render() {\n return html`<hr class=\"nys-divider\" />`;\n }\n}\n\nif (!customElements.get(\"nys-divider\")) {\n customElements.define(\"nys-divider\", NysDivider);\n}\n"],"names":["dividerIdCounter","_NysDivider","LitElement","html","unsafeCSS","styles","NysDivider","__decorateClass","property"],"mappings":";;;;;;;;AAKA,IAAIA,IAAmB;AAkBhB,MAAMC,IAAN,MAAMA,UAAmBC,EAAW;AAAA,EAMzC,cAAc;AACZ,UAAA,GAH0C,KAAA,WAAW;AAAA,EAIvD;AAAA,EAEA,oBAAoB;AAClB,UAAM,kBAAA,GAGD,KAAK,OACR,KAAK,KAAK,KAAK,kBAAA;AAAA,EAEnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,oBAAoB;AAC1B,WAAO,eAAe,KAAK,IAAA,CAAK,IAAIF,GAAkB;AAAA,EACxD;AAAA,EAEA,SAAS;AACP,WAAOG;AAAA,EACT;AACF;AA9BEF,EAAO,SAASG,EAAUC,CAAM;AAD3B,IAAMC,IAANL;AAIuCM,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAJ/BF,EAIiC,WAAA,UAAA;AA6BzC,eAAe,IAAI,aAAa,KACnC,eAAe,OAAO,eAAeA,CAAU;"}
|