@justeattakeaway/pie-divider 1.3.0 → 1.4.0
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/index.js +52 -56
- package/package.json +4 -4
- package/src/index.ts +2 -3
- package/declaration.d.ts +0 -9
package/dist/index.js
CHANGED
|
@@ -1,76 +1,72 @@
|
|
|
1
|
-
import { LitElement as u,
|
|
2
|
-
import { property as
|
|
3
|
-
import { classMap as
|
|
4
|
-
import { validPropertyValues as f,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(
|
|
8
|
-
return e && w(t, d, e), e;
|
|
9
|
-
};
|
|
10
|
-
class g extends u {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments), this.v = "1.3.0";
|
|
1
|
+
import { LitElement as u, unsafeCSS as m, html as h } from "lit";
|
|
2
|
+
import { property as b } from "lit/decorators.js";
|
|
3
|
+
import { classMap as g } from "lit/directives/class-map.js";
|
|
4
|
+
import { validPropertyValues as f, safeCustomElement as w } from "@justeattakeaway/pie-webc-core";
|
|
5
|
+
const v = class v extends u {
|
|
6
|
+
willUpdate() {
|
|
7
|
+
this.getAttribute("v") || this.setAttribute("v", v.v);
|
|
13
8
|
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
-
const $ = "*,*:after,*:before{box-sizing:inherit}.c-divider{--divider-bg-color: var(--dt-color-divider-default);--divider-width: 100%;--divider-min-width: 16px;--divider-height: 1px;--divider-label-max-width: 90%;--divider-font-size: calc(var(--dt-font-body-l-size) * 1px);--divider-line-height: calc(var(--dt-font-body-l-line-height) * 1px);width:var(--divider-width)}.c-divider,.c-divider hr{margin:0;border:0;background-color:var(--divider-bg-color)}.c-divider:not(.c-divider--labelled){height:var(--divider-height)}.c-divider.c-divider--labelled{display:flex;align-items:center;text-align:center;gap:var(--dt-spacing-b);background-color:transparent;color:var(--dt-color-content-subdued)}.c-divider.c-divider--labelled .c-divider-label{font-size:var(--divider-font-size);line-height:var(--divider-line-height);max-width:var(--divider-label-max-width);word-wrap:break-word}.c-divider.c-divider--labelled hr{flex-grow:1;height:var(--divider-height);min-width:var(--divider-min-width)}.c-divider.c-divider--labelled.c-divider--inverse{color:var(--dt-color-content-inverse)}.c-divider.c-divider--inverse{--divider-bg-color: var(--dt-color-divider-inverse)}.c-divider.c-divider--vertical{--divider-width: 1px;--divider-height: 100%}", z = ["default", "inverse"], S = ["horizontal", "vertical"], o = {
|
|
9
|
+
};
|
|
10
|
+
v.v = "1.4.0";
|
|
11
|
+
let p = v;
|
|
12
|
+
const x = "*,*:after,*:before{box-sizing:inherit}.c-divider{--divider-bg-color: var(--dt-color-divider-default);--divider-width: 100%;--divider-min-width: 16px;--divider-height: 1px;--divider-label-max-width: 90%;--divider-font-size: calc(var(--dt-font-body-l-size) * 1px);--divider-line-height: calc(var(--dt-font-body-l-line-height) * 1px);width:var(--divider-width)}.c-divider,.c-divider hr{margin:0;border:0;background-color:var(--divider-bg-color)}.c-divider:not(.c-divider--labelled){height:var(--divider-height)}.c-divider.c-divider--labelled{display:flex;align-items:center;text-align:center;gap:var(--dt-spacing-b);background-color:transparent;color:var(--dt-color-content-subdued)}.c-divider.c-divider--labelled .c-divider-label{font-size:var(--divider-font-size);line-height:var(--divider-line-height);max-width:var(--divider-label-max-width);word-wrap:break-word}.c-divider.c-divider--labelled hr{flex-grow:1;height:var(--divider-height);min-width:var(--divider-min-width)}.c-divider.c-divider--labelled.c-divider--inverse{color:var(--dt-color-content-inverse)}.c-divider.c-divider--inverse{--divider-bg-color: var(--dt-color-divider-inverse)}.c-divider.c-divider--vertical{--divider-width: 1px;--divider-height: 100%}", y = ["default", "inverse"], $ = ["horizontal", "vertical"], l = {
|
|
19
13
|
variant: "default",
|
|
20
14
|
orientation: "horizontal",
|
|
21
15
|
label: ""
|
|
22
16
|
};
|
|
23
|
-
var
|
|
24
|
-
for (var
|
|
25
|
-
(
|
|
26
|
-
return
|
|
17
|
+
var z = Object.defineProperty, S = Object.getOwnPropertyDescriptor, n = (o, r, d, t) => {
|
|
18
|
+
for (var i = t > 1 ? void 0 : t ? S(r, d) : r, s = o.length - 1, c; s >= 0; s--)
|
|
19
|
+
(c = o[s]) && (i = (t ? c(r, d, i) : c(i)) || i);
|
|
20
|
+
return t && i && z(r, d, i), i;
|
|
27
21
|
};
|
|
28
|
-
const
|
|
22
|
+
const e = "pie-divider";
|
|
23
|
+
let a = class extends p {
|
|
29
24
|
constructor() {
|
|
30
|
-
super(...arguments), this.variant =
|
|
25
|
+
super(...arguments), this.variant = l.variant, this.orientation = l.orientation, this.label = l.label;
|
|
31
26
|
}
|
|
32
27
|
render() {
|
|
33
|
-
const { variant:
|
|
28
|
+
const { variant: o, orientation: r, label: d } = this, t = d.length > 0 && r === "horizontal", i = {
|
|
34
29
|
"c-divider": !0,
|
|
35
|
-
"c-divider--inverse":
|
|
36
|
-
"c-divider--vertical":
|
|
37
|
-
"c-divider--labelled":
|
|
30
|
+
"c-divider--inverse": o === "inverse",
|
|
31
|
+
"c-divider--vertical": r === "vertical",
|
|
32
|
+
"c-divider--labelled": t
|
|
38
33
|
};
|
|
39
|
-
return
|
|
40
|
-
${
|
|
34
|
+
return h`
|
|
35
|
+
${t ? h`
|
|
41
36
|
<div
|
|
42
|
-
id="${
|
|
43
|
-
data-test-id="${
|
|
44
|
-
class="${
|
|
45
|
-
aria-labelledby="${
|
|
37
|
+
id="${e}"
|
|
38
|
+
data-test-id="${e}"
|
|
39
|
+
class="${g(i)}"
|
|
40
|
+
aria-labelledby="${e}-label">
|
|
46
41
|
<hr aria-hidden="true"/>
|
|
47
|
-
<span id="${
|
|
42
|
+
<span id="${e}-label" class="c-divider-label">${d}</span>
|
|
48
43
|
<hr aria-hidden="true"/>
|
|
49
|
-
</div>` :
|
|
50
|
-
<hr id="${
|
|
51
|
-
data-test-id="${
|
|
52
|
-
class="${
|
|
44
|
+
</div>` : h`
|
|
45
|
+
<hr id="${e}"
|
|
46
|
+
data-test-id="${e}"
|
|
47
|
+
class="${g(i)}"
|
|
53
48
|
aria-hidden="true"
|
|
54
49
|
/>`}`;
|
|
55
50
|
}
|
|
56
51
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
a.styles = m(x);
|
|
53
|
+
n([
|
|
54
|
+
b({ type: String }),
|
|
55
|
+
f(e, y, l.variant)
|
|
56
|
+
], a.prototype, "variant", 2);
|
|
57
|
+
n([
|
|
58
|
+
b({ type: String }),
|
|
59
|
+
f(e, $, l.orientation)
|
|
60
|
+
], a.prototype, "orientation", 2);
|
|
61
|
+
n([
|
|
62
|
+
b({ type: String })
|
|
63
|
+
], a.prototype, "label", 2);
|
|
64
|
+
a = n([
|
|
65
|
+
w("pie-divider")
|
|
66
|
+
], a);
|
|
71
67
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
a as PieDivider,
|
|
69
|
+
l as defaultProps,
|
|
70
|
+
$ as orientations,
|
|
71
|
+
y as variants
|
|
76
72
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-divider",
|
|
3
3
|
"description": "PIE Design System Divider built using Web Components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/justeattakeaway/pie",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
42
|
-
"@justeattakeaway/pie-components-config": "0.
|
|
42
|
+
"@justeattakeaway/pie-components-config": "0.20.1",
|
|
43
43
|
"@justeattakeaway/pie-css": "0.16.0",
|
|
44
|
-
"@justeattakeaway/pie-monorepo-utils": "0.5.
|
|
44
|
+
"@justeattakeaway/pie-monorepo-utils": "0.5.1",
|
|
45
45
|
"@justeattakeaway/pie-wrapper-react": "0.14.3",
|
|
46
46
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
49
|
+
"@justeattakeaway/pie-webc-core": "0.26.0"
|
|
50
50
|
},
|
|
51
51
|
"volta": {
|
|
52
52
|
"extends": "../../../package.json"
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
|
|
5
5
|
import { property } from 'lit/decorators.js';
|
|
6
6
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
|
-
import {
|
|
7
|
+
import { safeCustomElement, validPropertyValues } from '@justeattakeaway/pie-webc-core';
|
|
8
8
|
import styles from './divider.scss?inline';
|
|
9
9
|
import {
|
|
10
10
|
type DividerProps, defaultProps, orientations, variants,
|
|
@@ -18,6 +18,7 @@ const componentSelector = 'pie-divider';
|
|
|
18
18
|
/**
|
|
19
19
|
* @tagname pie-divider
|
|
20
20
|
*/
|
|
21
|
+
@safeCustomElement('pie-divider')
|
|
21
22
|
export class PieDivider extends PieElement implements DividerProps {
|
|
22
23
|
@property({ type: String })
|
|
23
24
|
@validPropertyValues(componentSelector, variants, defaultProps.variant)
|
|
@@ -65,8 +66,6 @@ export class PieDivider extends PieElement implements DividerProps {
|
|
|
65
66
|
static styles = unsafeCSS(styles);
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
defineCustomElement(componentSelector, PieDivider);
|
|
69
|
-
|
|
70
69
|
declare global {
|
|
71
70
|
interface HTMLElementTagNameMap {
|
|
72
71
|
[componentSelector]: PieDivider;
|