@justeattakeaway/pie-divider 0.7.0 → 0.8.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.d.ts +3 -0
- package/dist/index.js +27 -23
- package/dist/react.d.ts +3 -0
- package/package.json +2 -2
- package/src/index.ts +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export declare interface DividerProps {
|
|
|
15
15
|
|
|
16
16
|
export declare const orientations: readonly ["horizontal", "vertical"];
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @tagname pie-divider
|
|
20
|
+
*/
|
|
18
21
|
export declare class PieDivider extends LitElement implements DividerProps {
|
|
19
22
|
variant: DividerProps['variant'];
|
|
20
23
|
orientation: DividerProps['orientation'];
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { unsafeCSS as u, LitElement as f, html as g } from "lit";
|
|
2
2
|
import { property as c } from "lit/decorators.js";
|
|
3
|
-
const l = (
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(
|
|
3
|
+
const l = (i, e, r) => function(t, o) {
|
|
4
|
+
const n = `#${o}`;
|
|
5
|
+
Object.defineProperty(t, o, {
|
|
6
6
|
get() {
|
|
7
|
-
return this[
|
|
7
|
+
return this[n];
|
|
8
8
|
},
|
|
9
9
|
set(s) {
|
|
10
|
-
const p = this[
|
|
11
|
-
|
|
12
|
-
`<${
|
|
13
|
-
`Must be one of: ${
|
|
10
|
+
const p = this[n];
|
|
11
|
+
e.includes(s) ? this[n] = s : (console.error(
|
|
12
|
+
`<${i}> Invalid value "${s}" provided for property "${o}".`,
|
|
13
|
+
`Must be one of: ${e.join(" | ")}.`,
|
|
14
14
|
`Falling back to default value: "${r}"`
|
|
15
|
-
), this[
|
|
15
|
+
), this[n] = r), this.requestUpdate(o, p);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
};
|
|
19
|
+
function m(i, e) {
|
|
20
|
+
customElements.get(i) ? console.warn(`PIE Web Component: "${i}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(i, e);
|
|
21
|
+
}
|
|
22
|
+
const b = `.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[variant=inverse]{--divider-bg-color: var(--dt-color-divider-inverse)}.c-divider[orientation=vertical]{--divider-width: 1px;--divider-height: 100%}
|
|
23
|
+
`, P = ["default", "inverse"], y = ["horizontal", "vertical"];
|
|
24
|
+
var $ = Object.defineProperty, w = Object.getOwnPropertyDescriptor, h = (i, e, r, d) => {
|
|
25
|
+
for (var t = d > 1 ? void 0 : d ? w(e, r) : e, o = i.length - 1, n; o >= 0; o--)
|
|
26
|
+
(n = i[o]) && (t = (d ? n(e, r, t) : n(t)) || t);
|
|
27
|
+
return d && t && $(e, r, t), t;
|
|
24
28
|
};
|
|
25
29
|
const v = "pie-divider";
|
|
26
30
|
class a extends f {
|
|
@@ -28,29 +32,29 @@ class a extends f {
|
|
|
28
32
|
super(...arguments), this.variant = "default", this.orientation = "horizontal";
|
|
29
33
|
}
|
|
30
34
|
render() {
|
|
31
|
-
const { variant:
|
|
35
|
+
const { variant: e, orientation: r } = this;
|
|
32
36
|
return g`
|
|
33
37
|
<hr
|
|
34
38
|
data-test-id="pie-divider"
|
|
35
39
|
aria-hidden="true"
|
|
36
40
|
class="c-divider"
|
|
37
|
-
variant=${
|
|
41
|
+
variant=${e}
|
|
38
42
|
orientation=${r}
|
|
39
43
|
/>`;
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
a.styles = u(
|
|
46
|
+
a.styles = u(b);
|
|
43
47
|
h([
|
|
44
48
|
c({ type: String }),
|
|
45
|
-
l(v,
|
|
49
|
+
l(v, P, "default")
|
|
46
50
|
], a.prototype, "variant", 2);
|
|
47
51
|
h([
|
|
48
52
|
c({ type: String }),
|
|
49
|
-
l(v,
|
|
53
|
+
l(v, y, "horizontal")
|
|
50
54
|
], a.prototype, "orientation", 2);
|
|
51
|
-
|
|
55
|
+
m(v, a);
|
|
52
56
|
export {
|
|
53
57
|
a as PieDivider,
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
y as orientations,
|
|
59
|
+
P as variants
|
|
56
60
|
};
|
package/dist/react.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export declare const orientations: readonly ["horizontal", "vertical"];
|
|
|
18
18
|
|
|
19
19
|
export declare const PieDivider: ReactWebComponent<PieDivider_2, {}>;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @tagname pie-divider
|
|
23
|
+
*/
|
|
21
24
|
declare class PieDivider_2 extends LitElement implements DividerProps {
|
|
22
25
|
variant: DividerProps['variant'];
|
|
23
26
|
orientation: DividerProps['orientation'];
|
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.
|
|
4
|
+
"version": "0.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@justeattakeaway/pie-components-config": "0.4.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
34
|
+
"@justeattakeaway/pie-webc-core": "0.11.0"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
37
|
"extends": "../../../package.json"
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
-
import { validPropertyValues } from '@justeattakeaway/pie-webc-core';
|
|
3
|
+
import { validPropertyValues, defineCustomElement } from '@justeattakeaway/pie-webc-core';
|
|
4
4
|
import styles from './divider.scss?inline';
|
|
5
5
|
import { DividerProps, variants, orientations } from './defs';
|
|
6
6
|
|
|
@@ -9,6 +9,9 @@ export * from './defs';
|
|
|
9
9
|
|
|
10
10
|
const componentSelector = 'pie-divider';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @tagname pie-divider
|
|
14
|
+
*/
|
|
12
15
|
export class PieDivider extends LitElement implements DividerProps {
|
|
13
16
|
@property({ type: String })
|
|
14
17
|
@validPropertyValues(componentSelector, variants, 'default')
|
|
@@ -35,7 +38,7 @@ export class PieDivider extends LitElement implements DividerProps {
|
|
|
35
38
|
static styles = unsafeCSS(styles);
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
defineCustomElement(componentSelector, PieDivider);
|
|
39
42
|
|
|
40
43
|
declare global {
|
|
41
44
|
interface HTMLElementTagNameMap {
|