@justeattakeaway/pie-divider 0.13.7 → 0.13.9
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/custom-elements.json +0 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -21
- package/dist/react.d.ts +2 -2
- package/dist/react.js +7 -6
- package/package.json +3 -2
- package/src/defs-react.ts +1 -1
- package/src/divider.scss +2 -10
- package/src/index.ts +12 -8
package/custom-elements.json
CHANGED
|
@@ -76,18 +76,12 @@
|
|
|
76
76
|
{
|
|
77
77
|
"kind": "field",
|
|
78
78
|
"name": "variant",
|
|
79
|
-
"type": {
|
|
80
|
-
"text": "DividerProps['variant']"
|
|
81
|
-
},
|
|
82
79
|
"privacy": "public",
|
|
83
80
|
"attribute": "variant"
|
|
84
81
|
},
|
|
85
82
|
{
|
|
86
83
|
"kind": "field",
|
|
87
84
|
"name": "orientation",
|
|
88
|
-
"type": {
|
|
89
|
-
"text": "DividerProps['orientation']"
|
|
90
|
-
},
|
|
91
85
|
"privacy": "public",
|
|
92
86
|
"attribute": "orientation"
|
|
93
87
|
}
|
|
@@ -95,16 +89,10 @@
|
|
|
95
89
|
"attributes": [
|
|
96
90
|
{
|
|
97
91
|
"name": "variant",
|
|
98
|
-
"type": {
|
|
99
|
-
"text": "DividerProps['variant']"
|
|
100
|
-
},
|
|
101
92
|
"fieldName": "variant"
|
|
102
93
|
},
|
|
103
94
|
{
|
|
104
95
|
"name": "orientation",
|
|
105
|
-
"type": {
|
|
106
|
-
"text": "DividerProps['orientation']"
|
|
107
|
-
},
|
|
108
96
|
"fieldName": "orientation"
|
|
109
97
|
}
|
|
110
98
|
],
|
package/dist/index.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export declare const orientations: readonly ["horizontal", "vertical"];
|
|
|
24
24
|
* @tagname pie-divider
|
|
25
25
|
*/
|
|
26
26
|
export declare class PieDivider extends LitElement implements DividerProps {
|
|
27
|
-
variant:
|
|
28
|
-
orientation:
|
|
27
|
+
variant: "default" | "inverse";
|
|
28
|
+
orientation: "horizontal" | "vertical";
|
|
29
29
|
render(): TemplateResult<1>;
|
|
30
30
|
static styles: CSSResult;
|
|
31
31
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
import { unsafeCSS as h, LitElement as f, html as u } from "lit";
|
|
2
2
|
import { property as c } from "lit/decorators.js";
|
|
3
|
+
import { classMap as m } from "lit/directives/class-map.js";
|
|
3
4
|
import { validPropertyValues as l, defineCustomElement as g } from "@justeattakeaway/pie-webc-core";
|
|
4
|
-
const
|
|
5
|
-
`,
|
|
5
|
+
const b = `*,*:after,*:before{box-sizing:inherit}.c-divider{--divider-bg-color: var(--dt-color-divider-default);--divider-width: 100%;--divider-height: 1px;margin:0;border:0;width:var(--divider-width);height:var(--divider-height);background-color:var(--divider-bg-color)}.c-divider.c-divider--inverse{--divider-bg-color: var(--dt-color-divider-inverse)}.c-divider.c-divider--vertical{--divider-width: 1px;--divider-height: 100%}
|
|
6
|
+
`, y = ["default", "inverse"], P = ["horizontal", "vertical"], o = {
|
|
6
7
|
variant: "default",
|
|
7
8
|
orientation: "horizontal"
|
|
8
9
|
};
|
|
9
|
-
var
|
|
10
|
-
for (var i =
|
|
11
|
-
(v = a
|
|
12
|
-
return
|
|
10
|
+
var w = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, p = (n, r, e, t) => {
|
|
11
|
+
for (var i = t > 1 ? void 0 : t ? _(r, e) : r, a = n.length - 1, v; a >= 0; a--)
|
|
12
|
+
(v = n[a]) && (i = (t ? v(r, e, i) : v(i)) || i);
|
|
13
|
+
return t && i && w(r, e, i), i;
|
|
13
14
|
};
|
|
14
15
|
const s = "pie-divider";
|
|
15
|
-
class
|
|
16
|
+
class d extends f {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments), this.variant = o.variant, this.orientation = o.orientation;
|
|
18
19
|
}
|
|
19
20
|
render() {
|
|
20
|
-
const { variant: r, orientation:
|
|
21
|
+
const { variant: r, orientation: e } = this;
|
|
21
22
|
return u`
|
|
22
23
|
<hr
|
|
23
24
|
data-test-id="pie-divider"
|
|
24
25
|
aria-hidden="true"
|
|
25
|
-
class="
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
class="${m({
|
|
27
|
+
"c-divider": !0,
|
|
28
|
+
"c-divider--inverse": r === "inverse",
|
|
29
|
+
"c-divider--vertical": e === "vertical"
|
|
30
|
+
})}" />`;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
|
|
33
|
+
d.styles = h(b);
|
|
32
34
|
p([
|
|
33
35
|
c({ type: String }),
|
|
34
|
-
l(s,
|
|
35
|
-
],
|
|
36
|
+
l(s, y, o.variant)
|
|
37
|
+
], d.prototype, "variant", 2);
|
|
36
38
|
p([
|
|
37
39
|
c({ type: String }),
|
|
38
|
-
l(s,
|
|
39
|
-
],
|
|
40
|
-
g(s,
|
|
40
|
+
l(s, P, o.orientation)
|
|
41
|
+
], d.prototype, "orientation", 2);
|
|
42
|
+
g(s, d);
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
d as PieDivider,
|
|
43
45
|
o as defaultProps,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
P as orientations,
|
|
47
|
+
y as variants
|
|
46
48
|
};
|
package/dist/react.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare const PieDivider: React_2.ForwardRefExoticComponent<DividerProps
|
|
|
27
27
|
* @tagname pie-divider
|
|
28
28
|
*/
|
|
29
29
|
declare class PieDivider_2 extends LitElement implements DividerProps {
|
|
30
|
-
variant:
|
|
31
|
-
orientation:
|
|
30
|
+
variant: "default" | "inverse";
|
|
31
|
+
orientation: "horizontal" | "vertical";
|
|
32
32
|
render(): TemplateResult<1>;
|
|
33
33
|
static styles: CSSResult;
|
|
34
34
|
}
|
package/dist/react.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { createComponent as i } from "@lit/react";
|
|
3
3
|
import { PieDivider as r } from "./index.js";
|
|
4
|
-
import { defaultProps as
|
|
4
|
+
import { defaultProps as P, orientations as f, variants as D } from "./index.js";
|
|
5
5
|
import "lit";
|
|
6
6
|
import "lit/decorators.js";
|
|
7
|
+
import "lit/directives/class-map.js";
|
|
7
8
|
import "@justeattakeaway/pie-webc-core";
|
|
8
9
|
const t = i({
|
|
9
10
|
displayName: "PieDivider",
|
|
@@ -11,10 +12,10 @@ const t = i({
|
|
|
11
12
|
react: e,
|
|
12
13
|
tagName: "pie-divider",
|
|
13
14
|
events: {}
|
|
14
|
-
}),
|
|
15
|
+
}), n = t;
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
n as PieDivider,
|
|
18
|
+
P as defaultProps,
|
|
19
|
+
f as orientations,
|
|
20
|
+
D as variants
|
|
20
21
|
};
|
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": "0.13.
|
|
4
|
+
"version": "0.13.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
39
|
-
"@justeattakeaway/pie-components-config": "0.
|
|
39
|
+
"@justeattakeaway/pie-components-config": "0.17.0",
|
|
40
|
+
"@justeattakeaway/pie-css": "0.12.1",
|
|
40
41
|
"@justeattakeaway/pie-wrapper-react": "0.14.1",
|
|
41
42
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
42
43
|
},
|
package/src/defs-react.ts
CHANGED
package/src/divider.scss
CHANGED
|
@@ -11,19 +11,11 @@
|
|
|
11
11
|
height: var(--divider-height);
|
|
12
12
|
background-color: var(--divider-bg-color);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
/* Same as default styles */
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&[variant='inverse'] {
|
|
14
|
+
&.c-divider--inverse {
|
|
19
15
|
--divider-bg-color: var(--dt-color-divider-inverse);
|
|
20
16
|
}
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
/* Same as default styles */
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&[orientation='vertical'] {
|
|
18
|
+
&.c-divider--vertical {
|
|
27
19
|
--divider-width: 1px;
|
|
28
20
|
--divider-height: 100%;
|
|
29
21
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
-
import {
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { defineCustomElement, validPropertyValues } from '@justeattakeaway/pie-webc-core';
|
|
4
5
|
import styles from './divider.scss?inline';
|
|
5
6
|
import {
|
|
6
|
-
DividerProps,
|
|
7
|
+
type DividerProps, defaultProps, orientations, variants,
|
|
7
8
|
} from './defs';
|
|
8
9
|
|
|
9
10
|
// Valid values available to consumers
|
|
@@ -17,23 +18,26 @@ const componentSelector = 'pie-divider';
|
|
|
17
18
|
export class PieDivider extends LitElement implements DividerProps {
|
|
18
19
|
@property({ type: String })
|
|
19
20
|
@validPropertyValues(componentSelector, variants, defaultProps.variant)
|
|
20
|
-
public variant
|
|
21
|
+
public variant = defaultProps.variant;
|
|
21
22
|
|
|
22
23
|
@property({ type: String })
|
|
23
24
|
@validPropertyValues(componentSelector, orientations, defaultProps.orientation)
|
|
24
|
-
public orientation
|
|
25
|
+
public orientation = defaultProps.orientation;
|
|
25
26
|
|
|
26
27
|
render () {
|
|
27
28
|
const { variant, orientation } = this;
|
|
28
29
|
|
|
30
|
+
const classes = {
|
|
31
|
+
'c-divider': true,
|
|
32
|
+
'c-divider--inverse': variant === 'inverse',
|
|
33
|
+
'c-divider--vertical': orientation === 'vertical',
|
|
34
|
+
};
|
|
35
|
+
|
|
29
36
|
return html`
|
|
30
37
|
<hr
|
|
31
38
|
data-test-id="pie-divider"
|
|
32
39
|
aria-hidden="true"
|
|
33
|
-
class="
|
|
34
|
-
variant=${variant}
|
|
35
|
-
orientation=${orientation}
|
|
36
|
-
/>`;
|
|
40
|
+
class="${classMap(classes)}" />`;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
// Renders a `CSSResult` generated from SCSS by Vite
|