@justeattakeaway/pie-divider 0.2.0 → 0.3.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 +27 -0
- package/dist/react.d.ts +30 -0
- package/dist/react.js +45 -42
- package/package.json +7 -2
- package/src/index.ts +1 -5
- package/.eslintignore +0 -6
- package/.turbo/turbo-build.log +0 -14
- package/CHANGELOG.md +0 -19
- package/dist/types/index.d.ts +0 -1
- package/dist/types/packages/components/pie-divider/src/defs.d.ts +0 -13
- package/dist/types/packages/components/pie-divider/src/defs.d.ts.map +0 -1
- package/dist/types/packages/components/pie-divider/src/index.d.ts +0 -16
- package/dist/types/packages/components/pie-divider/src/index.d.ts.map +0 -1
- package/dist/types/packages/components/pie-divider/src/react.d.ts +0 -3
- package/dist/types/packages/components/pie-divider/src/react.d.ts.map +0 -1
- package/dist/types/react.d.ts +0 -1
- package/playwright/index.html +0 -57
- package/playwright/index.ts +0 -1
- package/playwright-lit-visual.config.ts +0 -4
- package/playwright-lit.config.ts +0 -4
- package/test/accessibility/pie-divider.spec.ts +0 -18
- package/test/component/pie-divider.spec.ts +0 -20
- package/test/visual/pie-divider.spec.ts +0 -50
- package/tsconfig.json +0 -8
- package/vite.config.js +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CSSResult } from 'lit';
|
|
2
|
+
import type { LitElement } from 'lit';
|
|
3
|
+
import type { TemplateResult } from 'lit-html';
|
|
4
|
+
|
|
5
|
+
export declare interface DividerProps {
|
|
6
|
+
/**
|
|
7
|
+
* What style variant the divider should be such as default or vertical.
|
|
8
|
+
*/
|
|
9
|
+
variant: typeof variants[number];
|
|
10
|
+
/**
|
|
11
|
+
* What orientation the divider should be such as horizontal or inverse.
|
|
12
|
+
*/
|
|
13
|
+
orientation: typeof orientations[number];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare const orientations: readonly ["horizontal", "vertical"];
|
|
17
|
+
|
|
18
|
+
export declare class PieDivider extends LitElement implements DividerProps {
|
|
19
|
+
variant: DividerProps['variant'];
|
|
20
|
+
orientation: DividerProps['orientation'];
|
|
21
|
+
render(): TemplateResult<1>;
|
|
22
|
+
static styles: CSSResult;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare const variants: readonly ["default", "inverse"];
|
|
26
|
+
|
|
27
|
+
export { }
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CSSResult } from 'lit';
|
|
2
|
+
import type { LitElement } from 'lit';
|
|
3
|
+
import type { ReactWebComponent } from '@lit-labs/react';
|
|
4
|
+
import type { TemplateResult } from 'lit-html';
|
|
5
|
+
|
|
6
|
+
export declare interface DividerProps {
|
|
7
|
+
/**
|
|
8
|
+
* What style variant the divider should be such as default or vertical.
|
|
9
|
+
*/
|
|
10
|
+
variant: typeof variants[number];
|
|
11
|
+
/**
|
|
12
|
+
* What orientation the divider should be such as horizontal or inverse.
|
|
13
|
+
*/
|
|
14
|
+
orientation: typeof orientations[number];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare const orientations: readonly ["horizontal", "vertical"];
|
|
18
|
+
|
|
19
|
+
export declare const PieDivider: ReactWebComponent<PieDivider_2, {}>;
|
|
20
|
+
|
|
21
|
+
declare class PieDivider_2 extends LitElement implements DividerProps {
|
|
22
|
+
variant: DividerProps['variant'];
|
|
23
|
+
orientation: DividerProps['orientation'];
|
|
24
|
+
render(): TemplateResult<1>;
|
|
25
|
+
static styles: CSSResult;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const variants: readonly ["default", "inverse"];
|
|
29
|
+
|
|
30
|
+
export { }
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PieDivider as Nr } from "./index.js";
|
|
2
|
+
import { orientations as Xr, variants as Zr } from "./index.js";
|
|
2
3
|
import "lit";
|
|
3
4
|
import "lit/decorators.js";
|
|
4
5
|
import "lit/decorators/property.js";
|
|
@@ -32,7 +33,7 @@ var Ve = { exports: {} }, p = {};
|
|
|
32
33
|
* LICENSE file in the root directory of this source tree.
|
|
33
34
|
*/
|
|
34
35
|
var Ct;
|
|
35
|
-
function
|
|
36
|
+
function xr() {
|
|
36
37
|
if (Ct)
|
|
37
38
|
return p;
|
|
38
39
|
Ct = 1;
|
|
@@ -74,8 +75,8 @@ function Mr() {
|
|
|
74
75
|
if (b === 1)
|
|
75
76
|
v.children = d;
|
|
76
77
|
else if (1 < b) {
|
|
77
|
-
for (var E = Array(b),
|
|
78
|
-
E[
|
|
78
|
+
for (var E = Array(b), x = 0; x < b; x++)
|
|
79
|
+
E[x] = arguments[x + 2];
|
|
79
80
|
v.children = E;
|
|
80
81
|
}
|
|
81
82
|
if (r && r.defaultProps)
|
|
@@ -119,8 +120,8 @@ function Mr() {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
if (S)
|
|
122
|
-
return S = r, v = v(S), r = h === "" ? "." + se(S, 0) : h, Q(v) ? (d = "", r != null && (d = r.replace(ve, "$&/") + "/"), ne(v, u, d, "", function(
|
|
123
|
-
return
|
|
123
|
+
return S = r, v = v(S), r = h === "" ? "." + se(S, 0) : h, Q(v) ? (d = "", r != null && (d = r.replace(ve, "$&/") + "/"), ne(v, u, d, "", function(x) {
|
|
124
|
+
return x;
|
|
124
125
|
})) : v != null && (ie(v) && (v = pe(v, d + (!v.key || S && S.key === v.key ? "" : ("" + v.key).replace(ve, "$&/") + "/") + r)), u.push(v)), 1;
|
|
125
126
|
if (S = 0, h = h === "" ? "." : h + ":", Q(r))
|
|
126
127
|
for (var b = 0; b < r.length; b++) {
|
|
@@ -189,8 +190,8 @@ function Mr() {
|
|
|
189
190
|
h.children = d;
|
|
190
191
|
else if (1 < E) {
|
|
191
192
|
b = Array(E);
|
|
192
|
-
for (var
|
|
193
|
-
b[
|
|
193
|
+
for (var x = 0; x < E; x++)
|
|
194
|
+
b[x] = arguments[x + 2];
|
|
194
195
|
h.children = b;
|
|
195
196
|
}
|
|
196
197
|
return { $$typeof: g, type: r.type, key: v, ref: _, props: h, _owner: S };
|
|
@@ -260,7 +261,7 @@ var de = { exports: {} };
|
|
|
260
261
|
*/
|
|
261
262
|
de.exports;
|
|
262
263
|
var St;
|
|
263
|
-
function
|
|
264
|
+
function Mr() {
|
|
264
265
|
return St || (St = 1, function(g, c) {
|
|
265
266
|
process.env.NODE_ENV !== "production" && function() {
|
|
266
267
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
@@ -430,11 +431,11 @@ function xr() {
|
|
|
430
431
|
function E() {
|
|
431
432
|
}
|
|
432
433
|
E.prototype = v.prototype;
|
|
433
|
-
function
|
|
434
|
+
function x(e, t, n) {
|
|
434
435
|
this.props = e, this.context = t, this.refs = h, this.updater = n || u;
|
|
435
436
|
}
|
|
436
|
-
var ke =
|
|
437
|
-
ke.constructor =
|
|
437
|
+
var ke = x.prototype = new E();
|
|
438
|
+
ke.constructor = x, d(ke, v.prototype), ke.isPureReactComponent = !0;
|
|
438
439
|
function kt() {
|
|
439
440
|
var e = {
|
|
440
441
|
current: null
|
|
@@ -626,7 +627,7 @@ function xr() {
|
|
|
626
627
|
var n = je(e.type, t, e.ref, e._self, e._source, e._owner, e.props);
|
|
627
628
|
return n;
|
|
628
629
|
}
|
|
629
|
-
function
|
|
630
|
+
function xt(e, t, n) {
|
|
630
631
|
if (e == null)
|
|
631
632
|
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + e + ".");
|
|
632
633
|
var a, o = d({}, e.props), s = e.key, i = e.ref, l = e._self, y = e._source, m = e._owner;
|
|
@@ -650,7 +651,7 @@ function xr() {
|
|
|
650
651
|
function ae(e) {
|
|
651
652
|
return typeof e == "object" && e !== null && e.$$typeof === T;
|
|
652
653
|
}
|
|
653
|
-
var Ke = ".",
|
|
654
|
+
var Ke = ".", Mt = ":";
|
|
654
655
|
function Ut(e) {
|
|
655
656
|
var t = /[=:]/g, n = {
|
|
656
657
|
"=": "=0",
|
|
@@ -707,7 +708,7 @@ function xr() {
|
|
|
707
708
|
)), t.push(y));
|
|
708
709
|
return 1;
|
|
709
710
|
}
|
|
710
|
-
var w, C, O = 0, $ = a === "" ? Ke : a +
|
|
711
|
+
var w, C, O = 0, $ = a === "" ? Ke : a + Mt;
|
|
711
712
|
if (he(e))
|
|
712
713
|
for (var Oe = 0; Oe < e.length; Oe++)
|
|
713
714
|
w = e[Oe], C = $ + Ae(w, Oe), O += ge(w, t, n, C, o);
|
|
@@ -958,7 +959,7 @@ Your code should look like:
|
|
|
958
959
|
}
|
|
959
960
|
return n;
|
|
960
961
|
}
|
|
961
|
-
function
|
|
962
|
+
function M() {
|
|
962
963
|
var e = K.current;
|
|
963
964
|
return e === null && f(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
964
965
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
@@ -967,7 +968,7 @@ Your code should look like:
|
|
|
967
968
|
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), e;
|
|
968
969
|
}
|
|
969
970
|
function Xt(e) {
|
|
970
|
-
var t =
|
|
971
|
+
var t = M();
|
|
971
972
|
if (e._context !== void 0) {
|
|
972
973
|
var n = e._context;
|
|
973
974
|
n.Consumer === e ? f("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : n.Provider === e && f("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
@@ -975,61 +976,61 @@ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and f
|
|
|
975
976
|
return t.useContext(e);
|
|
976
977
|
}
|
|
977
978
|
function Zt(e) {
|
|
978
|
-
var t =
|
|
979
|
+
var t = M();
|
|
979
980
|
return t.useState(e);
|
|
980
981
|
}
|
|
981
982
|
function er(e, t, n) {
|
|
982
|
-
var a =
|
|
983
|
+
var a = M();
|
|
983
984
|
return a.useReducer(e, t, n);
|
|
984
985
|
}
|
|
985
986
|
function tr(e) {
|
|
986
|
-
var t =
|
|
987
|
+
var t = M();
|
|
987
988
|
return t.useRef(e);
|
|
988
989
|
}
|
|
989
990
|
function rr(e, t) {
|
|
990
|
-
var n =
|
|
991
|
+
var n = M();
|
|
991
992
|
return n.useEffect(e, t);
|
|
992
993
|
}
|
|
993
994
|
function nr(e, t) {
|
|
994
|
-
var n =
|
|
995
|
+
var n = M();
|
|
995
996
|
return n.useInsertionEffect(e, t);
|
|
996
997
|
}
|
|
997
998
|
function ar(e, t) {
|
|
998
|
-
var n =
|
|
999
|
+
var n = M();
|
|
999
1000
|
return n.useLayoutEffect(e, t);
|
|
1000
1001
|
}
|
|
1001
1002
|
function or(e, t) {
|
|
1002
|
-
var n =
|
|
1003
|
+
var n = M();
|
|
1003
1004
|
return n.useCallback(e, t);
|
|
1004
1005
|
}
|
|
1005
1006
|
function ur(e, t) {
|
|
1006
|
-
var n =
|
|
1007
|
+
var n = M();
|
|
1007
1008
|
return n.useMemo(e, t);
|
|
1008
1009
|
}
|
|
1009
1010
|
function ir(e, t, n) {
|
|
1010
|
-
var a =
|
|
1011
|
+
var a = M();
|
|
1011
1012
|
return a.useImperativeHandle(e, t, n);
|
|
1012
1013
|
}
|
|
1013
1014
|
function sr(e, t) {
|
|
1014
1015
|
{
|
|
1015
|
-
var n =
|
|
1016
|
+
var n = M();
|
|
1016
1017
|
return n.useDebugValue(e, t);
|
|
1017
1018
|
}
|
|
1018
1019
|
}
|
|
1019
1020
|
function cr() {
|
|
1020
|
-
var e =
|
|
1021
|
+
var e = M();
|
|
1021
1022
|
return e.useTransition();
|
|
1022
1023
|
}
|
|
1023
1024
|
function fr(e) {
|
|
1024
|
-
var t =
|
|
1025
|
+
var t = M();
|
|
1025
1026
|
return t.useDeferredValue(e);
|
|
1026
1027
|
}
|
|
1027
1028
|
function lr() {
|
|
1028
|
-
var e =
|
|
1029
|
+
var e = M();
|
|
1029
1030
|
return e.useId();
|
|
1030
1031
|
}
|
|
1031
1032
|
function dr(e, t, n) {
|
|
1032
|
-
var a =
|
|
1033
|
+
var a = M();
|
|
1033
1034
|
return a.useSyncExternalStore(e, t, n);
|
|
1034
1035
|
}
|
|
1035
1036
|
var le = 0, tt, rt, nt, at, ot, ut, it;
|
|
@@ -1385,7 +1386,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1385
1386
|
}), t;
|
|
1386
1387
|
}
|
|
1387
1388
|
function Cr(e, t, n) {
|
|
1388
|
-
for (var a =
|
|
1389
|
+
for (var a = xt.apply(this, arguments), o = 2; o < arguments.length; o++)
|
|
1389
1390
|
yt(arguments[o], a.type);
|
|
1390
1391
|
return ht(a), a;
|
|
1391
1392
|
}
|
|
@@ -1427,7 +1428,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1427
1428
|
try {
|
|
1428
1429
|
if (j.isBatchingLegacy = !0, a = e(), !n && j.didScheduleLegacyUpdate) {
|
|
1429
1430
|
var o = j.current;
|
|
1430
|
-
o !== null && (j.didScheduleLegacyUpdate = !1,
|
|
1431
|
+
o !== null && (j.didScheduleLegacyUpdate = !1, Me(o));
|
|
1431
1432
|
}
|
|
1432
1433
|
} catch (C) {
|
|
1433
1434
|
throw Se(t), C;
|
|
@@ -1452,7 +1453,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1452
1453
|
var y = a;
|
|
1453
1454
|
if (Se(t), ue === 0) {
|
|
1454
1455
|
var m = j.current;
|
|
1455
|
-
m !== null && (
|
|
1456
|
+
m !== null && (Me(m), j.current = null);
|
|
1456
1457
|
var R = {
|
|
1457
1458
|
then: function(C, O) {
|
|
1458
1459
|
j.current === null ? (j.current = [], Le(y, C, O)) : C(y);
|
|
@@ -1478,7 +1479,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1478
1479
|
var a = j.current;
|
|
1479
1480
|
if (a !== null)
|
|
1480
1481
|
try {
|
|
1481
|
-
|
|
1482
|
+
Me(a), Or(function() {
|
|
1482
1483
|
a.length === 0 ? (j.current = null, t(e)) : Le(e, t, n);
|
|
1483
1484
|
});
|
|
1484
1485
|
} catch (o) {
|
|
@@ -1488,10 +1489,10 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1488
1489
|
t(e);
|
|
1489
1490
|
}
|
|
1490
1491
|
}
|
|
1491
|
-
var
|
|
1492
|
-
function
|
|
1493
|
-
if (!
|
|
1494
|
-
|
|
1492
|
+
var xe = !1;
|
|
1493
|
+
function Me(e) {
|
|
1494
|
+
if (!xe) {
|
|
1495
|
+
xe = !0;
|
|
1495
1496
|
var t = 0;
|
|
1496
1497
|
try {
|
|
1497
1498
|
for (; t < e.length; t++) {
|
|
@@ -1504,7 +1505,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1504
1505
|
} catch (a) {
|
|
1505
1506
|
throw e = e.slice(t + 1), a;
|
|
1506
1507
|
} finally {
|
|
1507
|
-
|
|
1508
|
+
xe = !1;
|
|
1508
1509
|
}
|
|
1509
1510
|
}
|
|
1510
1511
|
}
|
|
@@ -1515,11 +1516,11 @@ Check the top-level render call using <` + n + ">.");
|
|
|
1515
1516
|
toArray: zt,
|
|
1516
1517
|
only: Bt
|
|
1517
1518
|
};
|
|
1518
|
-
c.Children = Ar, c.Component = v, c.Fragment = k, c.Profiler = I, c.PureComponent =
|
|
1519
|
+
c.Children = Ar, c.Component = v, c.Fragment = k, c.Profiler = I, c.PureComponent = x, c.StrictMode = V, c.Suspense = H, c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = q, c.cloneElement = Pr, c.createContext = Ht, c.createElement = kr, c.createFactory = jr, c.createRef = kt, c.forwardRef = Qt, c.isValidElement = ae, c.lazy = Kt, c.memo = Jt, c.startTransition = Sr, c.unstable_act = Tr, c.useCallback = or, c.useContext = Xt, c.useDebugValue = sr, c.useDeferredValue = fr, c.useEffect = rr, c.useId = lr, c.useImperativeHandle = ir, c.useInsertionEffect = nr, c.useLayoutEffect = ar, c.useMemo = ur, c.useReducer = er, c.useRef = tr, c.useState = Zt, c.useSyncExternalStore = dr, c.useTransition = cr, c.version = U, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
1519
1520
|
}();
|
|
1520
1521
|
}(de, de.exports)), de.exports;
|
|
1521
1522
|
}
|
|
1522
|
-
process.env.NODE_ENV === "production" ? Ve.exports =
|
|
1523
|
+
process.env.NODE_ENV === "production" ? Ve.exports = xr() : Ve.exports = Mr();
|
|
1523
1524
|
var Tt = Ve.exports;
|
|
1524
1525
|
const Ur = /* @__PURE__ */ Lr(Tt), Vr = /* @__PURE__ */ Fr({
|
|
1525
1526
|
__proto__: null,
|
|
@@ -1587,5 +1588,7 @@ const Kr = zr({
|
|
|
1587
1588
|
events: {}
|
|
1588
1589
|
});
|
|
1589
1590
|
export {
|
|
1590
|
-
Kr as PieDivider
|
|
1591
|
+
Kr as PieDivider,
|
|
1592
|
+
Xr as orientations,
|
|
1593
|
+
Zr as variants
|
|
1591
1594
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
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.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
|
-
"types": "dist/
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"dist",
|
|
12
|
+
"**/*.d.ts"
|
|
13
|
+
],
|
|
9
14
|
"scripts": {
|
|
10
15
|
"build": "yarn build:wrapper pie-divider && run -T vite build",
|
|
11
16
|
"lint:scripts": "run -T eslint .",
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,7 @@ import styles from './divider.scss?inline';
|
|
|
5
5
|
import { DividerProps, variants, orientations } from './defs';
|
|
6
6
|
|
|
7
7
|
// Valid values available to consumers
|
|
8
|
-
export
|
|
9
|
-
type DividerProps,
|
|
10
|
-
variants,
|
|
11
|
-
orientations,
|
|
12
|
-
};
|
|
8
|
+
export * from './defs';
|
|
13
9
|
|
|
14
10
|
const componentSelector = 'pie-divider';
|
|
15
11
|
|
package/.eslintignore
DELETED
package/.turbo/turbo-build.log
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[2:03:48 PM] @custom-elements-manifest/analyzer: Created new manifest.
|
|
2
|
-
react wrapper has been added!
|
|
3
|
-
[36mvite v4.3.9 [32mbuilding for production...[36m[39m
|
|
4
|
-
transforming...
|
|
5
|
-
[32m✓[39m 22 modules transformed.
|
|
6
|
-
rendering chunks...
|
|
7
|
-
computing gzip size...
|
|
8
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m 2.04 kB[22m[1m[22m[2m │ gzip: 0.94 kB[22m
|
|
9
|
-
[2mdist/[22m[36mreact.js [39m[1m[2m59.02 kB[22m[1m[22m[2m │ gzip: 15.91 kB[22m
|
|
10
|
-
[32m
|
|
11
|
-
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
|
-
[32m✓ built in 45.92s[39m
|
|
13
|
-
[32m[36m[vite:dts][32m Declaration files built in 43220ms.
|
|
14
|
-
[39m
|
package/CHANGELOG.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @justeattakeaway/pie-divider
|
|
2
|
-
|
|
3
|
-
## 0.2.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [Added] pie divider component ([#704](https://github.com/justeattakeaway/pie/pull/704)) by [@raoufswe](https://github.com/raoufswe)
|
|
8
|
-
|
|
9
|
-
- [Changed] - skip visual tests ([#709](https://github.com/justeattakeaway/pie/pull/709)) by [@raoufswe](https://github.com/raoufswe)
|
|
10
|
-
|
|
11
|
-
- [Changed] extend ts config using relative paths ([#704](https://github.com/justeattakeaway/pie/pull/704)) by [@raoufswe](https://github.com/raoufswe)
|
|
12
|
-
|
|
13
|
-
## 0.1.0
|
|
14
|
-
|
|
15
|
-
### Minor Changes
|
|
16
|
-
|
|
17
|
-
- [Added] - Create a skeleton divider web component using our component generator ([#693](https://github.com/justeattakeaway/pie/pull/693)) by [@raoufswe](https://github.com/raoufswe)
|
|
18
|
-
|
|
19
|
-
- [Added] - init pie link ([#707](https://github.com/justeattakeaway/pie/pull/707)) by [@raoufswe](https://github.com/raoufswe)
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './packages/components/pie-divider/src/index'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const variants: readonly ["default", "inverse"];
|
|
2
|
-
export declare const orientations: readonly ["horizontal", "vertical"];
|
|
3
|
-
export interface DividerProps {
|
|
4
|
-
/**
|
|
5
|
-
* What style variant the divider should be such as default or vertical.
|
|
6
|
-
*/
|
|
7
|
-
variant: typeof variants[number];
|
|
8
|
-
/**
|
|
9
|
-
* What orientation the divider should be such as horizontal or inverse.
|
|
10
|
-
*/
|
|
11
|
-
orientation: typeof orientations[number];
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,iCAAkC,CAAC;AACxD,eAAO,MAAM,YAAY,qCAAsC,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC1B;;QAEI;IACJ,OAAO,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC;;OAEG;IACJ,WAAW,EAAE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;CAC3C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { DividerProps, variants, orientations } from './defs';
|
|
3
|
-
export { type DividerProps, variants, orientations, };
|
|
4
|
-
declare const componentSelector = "pie-divider";
|
|
5
|
-
export declare class PieDivider extends LitElement implements DividerProps {
|
|
6
|
-
variant: DividerProps['variant'];
|
|
7
|
-
orientation: DividerProps['orientation'];
|
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
-
static styles: import("lit").CSSResult;
|
|
10
|
-
}
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
[componentSelector]: PieDivider;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAIlD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG9D,OAAO,EACH,KAAK,YAAY,EACjB,QAAQ,EACR,YAAY,GACf,CAAC;AAEF,QAAA,MAAM,iBAAiB,gBAAgB,CAAC;AAExC,qBAAa,UAAW,SAAQ,UAAW,YAAW,YAAY;IAGvD,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAa;IAI7C,WAAW,EAAG,YAAY,CAAC,aAAa,CAAC,CAAgB;IAEhE,MAAM;IAcN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAID,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;KACnC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,UAAU,kEAMrB,CAAC"}
|
package/dist/types/react.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './packages/components/pie-divider/src/react'
|
package/playwright/index.html
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2" as="font" type="font/woff2" crossorigin>
|
|
7
|
-
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2" as="font" type="font/woff2" crossorigin>
|
|
8
|
-
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2" as="font" type="font/woff2" crossorigin>
|
|
9
|
-
<style>
|
|
10
|
-
@font-face {
|
|
11
|
-
font-family: JETSansDigital;
|
|
12
|
-
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2') format("woff2"),
|
|
13
|
-
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff') format("woff");
|
|
14
|
-
font-weight: 400;
|
|
15
|
-
font-display: swap;
|
|
16
|
-
}
|
|
17
|
-
@font-face {
|
|
18
|
-
font-family: JETSansDigital;
|
|
19
|
-
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2') format("woff2"),
|
|
20
|
-
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff') format("woff");
|
|
21
|
-
font-weight: 700;
|
|
22
|
-
font-display: swap;
|
|
23
|
-
}
|
|
24
|
-
@font-face {
|
|
25
|
-
font-family: JETSansDigital;
|
|
26
|
-
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2') format("woff2"),
|
|
27
|
-
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff') format("woff");
|
|
28
|
-
font-weight: 800;
|
|
29
|
-
font-display: swap;
|
|
30
|
-
}
|
|
31
|
-
body {
|
|
32
|
-
font-feature-settings: "tnum"; /* Enable tabular numbers */
|
|
33
|
-
}
|
|
34
|
-
/* basic styles to center align components and give them some spacing */
|
|
35
|
-
#root {
|
|
36
|
-
padding: 1em;
|
|
37
|
-
min-height: 300px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
#root > * {
|
|
41
|
-
display: block;
|
|
42
|
-
margin-inline: auto;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#root > * + * {
|
|
46
|
-
margin-top: 1em;
|
|
47
|
-
}
|
|
48
|
-
</style>
|
|
49
|
-
<title>Testing Page</title>
|
|
50
|
-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet.css" />
|
|
51
|
-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet-hsl-colors.css" />
|
|
52
|
-
</head>
|
|
53
|
-
<body>
|
|
54
|
-
<div id="root"></div>
|
|
55
|
-
<script type="module" src="./index.ts"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
package/playwright/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// Import common styles here
|
package/playwright-lit.config.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/fixtures.ts';
|
|
3
|
-
import { PieDivider, DividerProps } from '@/index';
|
|
4
|
-
|
|
5
|
-
test.describe('PieDivider - Accessibility tests', () => {
|
|
6
|
-
test('a11y - should test the PieDivider component WCAG compliance', async ({ makeAxeBuilder, mount }) => {
|
|
7
|
-
await mount(
|
|
8
|
-
PieDivider,
|
|
9
|
-
{
|
|
10
|
-
props: {} as DividerProps,
|
|
11
|
-
},
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const results = await makeAxeBuilder().analyze();
|
|
15
|
-
|
|
16
|
-
expect(results.violations).toEqual([]);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { test, expect } from '@sand4rt/experimental-ct-web';
|
|
3
|
-
import { PieDivider, DividerProps } from '@/index';
|
|
4
|
-
|
|
5
|
-
const componentSelector = '[data-test-id="pie-divider"]';
|
|
6
|
-
|
|
7
|
-
test.describe('PieDivider - Component tests', () => {
|
|
8
|
-
test('should render successfully', async ({ mount, page }) => {
|
|
9
|
-
// Arrange
|
|
10
|
-
await mount(PieDivider, {
|
|
11
|
-
props: {} as DividerProps,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Act
|
|
15
|
-
const divider = page.locator(componentSelector);
|
|
16
|
-
|
|
17
|
-
// Assert
|
|
18
|
-
expect(divider).toBeVisible();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { test } from '@sand4rt/experimental-ct-web';
|
|
3
|
-
import percySnapshot from '@percy/playwright';
|
|
4
|
-
import type {
|
|
5
|
-
PropObject, WebComponentPropValues, WebComponentTestInput,
|
|
6
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts';
|
|
7
|
-
import {
|
|
8
|
-
getAllPropCombinations, splitCombinationsByPropertyValue,
|
|
9
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/get-all-prop-combos.ts';
|
|
10
|
-
import {
|
|
11
|
-
createTestWebComponent,
|
|
12
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/rendering.ts';
|
|
13
|
-
import {
|
|
14
|
-
WebComponentTestWrapper,
|
|
15
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/components/web-component-test-wrapper/WebComponentTestWrapper.ts';
|
|
16
|
-
import { variants, orientations } from '@/defs';
|
|
17
|
-
import { PieDivider } from '@/index';
|
|
18
|
-
|
|
19
|
-
const props: PropObject = {
|
|
20
|
-
variant: variants,
|
|
21
|
-
orientation: orientations,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const renderTestPieDivider = (propVals: WebComponentPropValues) => `<pie-divider variant="${propVals.variant}" orientation="${propVals.orientation}" />`;
|
|
25
|
-
|
|
26
|
-
const componentPropsMatrix : WebComponentPropValues[] = getAllPropCombinations(props);
|
|
27
|
-
const componentPropsMatrixByVariant: Record<string, WebComponentPropValues[]> = splitCombinationsByPropertyValue(componentPropsMatrix, 'variant');
|
|
28
|
-
const componentVariants: string[] = Object.keys(componentPropsMatrixByVariant);
|
|
29
|
-
|
|
30
|
-
test.beforeEach(async ({ page, mount }) => {
|
|
31
|
-
await mount(PieDivider, {});
|
|
32
|
-
await page.evaluate(() => {
|
|
33
|
-
const element : Element | null = document.querySelector('pie-divider');
|
|
34
|
-
element?.remove();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
componentVariants.forEach((variant) => test(`Render all prop variations for Variant: ${variant}`, async ({ page, mount }) => {
|
|
39
|
-
await Promise.all(componentPropsMatrixByVariant[variant].map(async (combo: WebComponentPropValues) => {
|
|
40
|
-
const testComponent: WebComponentTestInput = createTestWebComponent(combo, renderTestPieDivider);
|
|
41
|
-
const propKeyValues = `orientation: ${testComponent.propValues.orientation}}`;
|
|
42
|
-
|
|
43
|
-
await mount(
|
|
44
|
-
WebComponentTestWrapper,
|
|
45
|
-
{ props: { propKeyValues, darkMode: variant === 'inverse' } },
|
|
46
|
-
);
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
await percySnapshot(page, `PIE Divider - Variant: ${variant}`);
|
|
50
|
-
}));
|
package/tsconfig.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../configs/pie-components-config/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"rootDir": ".",
|
|
6
|
-
},
|
|
7
|
-
"include": ["src/**/*.ts","./declaration.d.ts", "test/**/*.ts", "playwright-lit-visual.config.ts", "playwright-lit.config.ts"],
|
|
8
|
-
}
|
package/vite.config.js
DELETED