@justeattakeaway/pie-icon-button 0.13.1 → 0.14.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/{types/packages/components/pie-icon-button/src/defs.d.ts → index.d.ts} +35 -20
- package/dist/react.d.ts +38 -0
- package/dist/react.js +45 -42
- package/package.json +8 -3
- package/src/index.ts +1 -1
- package/.eslintignore +0 -5
- package/.turbo/turbo-build.log +0 -14
- package/CHANGELOG.md +0 -143
- package/dist/types/index.d.ts +0 -1
- package/dist/types/packages/components/pie-icon-button/src/defs.d.ts.map +0 -1
- package/dist/types/packages/components/pie-icon-button/src/index.d.ts +0 -17
- package/dist/types/packages/components/pie-icon-button/src/index.d.ts.map +0 -1
- package/dist/types/packages/components/pie-icon-button/src/react.d.ts +0 -3
- package/dist/types/packages/components/pie-icon-button/src/react.d.ts.map +0 -1
- package/dist/types/react.d.ts +0 -1
- package/playwright/index.html +0 -56
- 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-icon-button.spec.ts +0 -36
- package/test/component/pie-icon-button.spec.ts +0 -24
- package/test/visual/pie-icon-button.spec.ts +0 -70
- package/tsconfig.json +0 -8
- package/vite.config.js +0 -3
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import type { CSSResult } from 'lit';
|
|
2
|
+
import type { LitElement } from 'lit';
|
|
3
|
+
import type { TemplateResult } from 'lit-html';
|
|
4
|
+
|
|
5
|
+
export declare interface IconButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* (Optional) What size the button should be.
|
|
8
|
+
* @default "medium"
|
|
9
|
+
*/
|
|
10
|
+
size: typeof sizes[number];
|
|
11
|
+
/**
|
|
12
|
+
* (Optional) What style variant the button should be such as primary, outline or ghost.
|
|
13
|
+
* @default "primary"
|
|
14
|
+
*/
|
|
15
|
+
variant: typeof variants[number];
|
|
16
|
+
/**
|
|
17
|
+
* (Optional) When true, the button element is disabled.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare class PieIconButton extends LitElement implements IconButtonProps {
|
|
24
|
+
size: IconButtonProps['size'];
|
|
25
|
+
variant: IconButtonProps['variant'];
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
render(): TemplateResult<1>;
|
|
28
|
+
static styles: CSSResult;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare const sizes: readonly ["xsmall", "small", "medium", "large"];
|
|
32
|
+
|
|
33
|
+
export declare const variants: readonly ["primary", "secondary", "outline", "ghost", "ghost-secondary"];
|
|
34
|
+
|
|
35
|
+
export { }
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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 IconButtonProps {
|
|
7
|
+
/**
|
|
8
|
+
* (Optional) What size the button should be.
|
|
9
|
+
* @default "medium"
|
|
10
|
+
*/
|
|
11
|
+
size: typeof sizes[number];
|
|
12
|
+
/**
|
|
13
|
+
* (Optional) What style variant the button should be such as primary, outline or ghost.
|
|
14
|
+
* @default "primary"
|
|
15
|
+
*/
|
|
16
|
+
variant: typeof variants[number];
|
|
17
|
+
/**
|
|
18
|
+
* (Optional) When true, the button element is disabled.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare const PieIconButton: ReactWebComponent<PieIconButton_2, {}>;
|
|
25
|
+
|
|
26
|
+
declare class PieIconButton_2 extends LitElement implements IconButtonProps {
|
|
27
|
+
size: IconButtonProps['size'];
|
|
28
|
+
variant: IconButtonProps['variant'];
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
render(): TemplateResult<1>;
|
|
31
|
+
static styles: CSSResult;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare const sizes: readonly ["xsmall", "small", "medium", "large"];
|
|
35
|
+
|
|
36
|
+
export declare const variants: readonly ["primary", "secondary", "outline", "ghost", "ghost-secondary"];
|
|
37
|
+
|
|
38
|
+
export { }
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PieIconButton as Nr } from "./index.js";
|
|
2
|
+
import { sizes 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, D = a === "" ? Ke : a +
|
|
711
|
+
var w, C, O = 0, D = 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 = D + 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: Bt,
|
|
1516
1517
|
only: zt
|
|
1517
1518
|
};
|
|
1518
|
-
c.Children = Ar, c.Component = v, c.Fragment = k, c.Profiler = $, c.PureComponent =
|
|
1519
|
+
c.Children = Ar, c.Component = v, c.Fragment = k, c.Profiler = $, 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 = Br({
|
|
|
1587
1588
|
events: {}
|
|
1588
1589
|
});
|
|
1589
1590
|
export {
|
|
1590
|
-
Kr as PieIconButton
|
|
1591
|
+
Kr as PieIconButton,
|
|
1592
|
+
Xr as sizes,
|
|
1593
|
+
Zr as variants
|
|
1591
1594
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-icon-button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "PIE Design System Icon Button built using Web Components",
|
|
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-icon-button && run -T vite build",
|
|
11
16
|
"lint:scripts": "run -T eslint .",
|
|
@@ -24,7 +29,7 @@
|
|
|
24
29
|
"@justeattakeaway/pie-webc-core": "workspace:*"
|
|
25
30
|
},
|
|
26
31
|
"peerDependencies": {
|
|
27
|
-
"pie-design-tokens": "5.
|
|
32
|
+
"@justeat/pie-design-tokens": "5.5.0"
|
|
28
33
|
},
|
|
29
34
|
"volta": {
|
|
30
35
|
"extends": "../../../package.json"
|
package/src/index.ts
CHANGED
package/.eslintignore
DELETED
package/.turbo/turbo-build.log
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[3:19:40 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 6.06 kB[22m[1m[22m[2m │ gzip: 1.52 kB[22m
|
|
9
|
-
[2mdist/[22m[36mreact.js [39m[1m[2m59.03 kB[22m[1m[22m[2m │ gzip: 15.92 kB[22m
|
|
10
|
-
[32m
|
|
11
|
-
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
|
-
[32m✓ built in 49.88s[39m
|
|
13
|
-
[32m[36m[vite:dts][32m Declaration files built in 45838ms.
|
|
14
|
-
[39m
|
package/CHANGELOG.md
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# @justeattakeaway/pie-icon-button
|
|
2
|
-
|
|
3
|
-
## 0.13.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- [Changed] - use latest pie-design-tokens ([#694](https://github.com/justeattakeaway/pie/pull/694)) by [@xander-marjoram](https://github.com/xander-marjoram)
|
|
8
|
-
|
|
9
|
-
## 0.13.0
|
|
10
|
-
|
|
11
|
-
### Minor Changes
|
|
12
|
-
|
|
13
|
-
- [Added] - axe builder to be shared as a base instance across broswer accessibility tests ([#669](https://github.com/justeattakeaway/pie/pull/669)) by [@raoufswe](https://github.com/raoufswe)
|
|
14
|
-
|
|
15
|
-
## 0.12.0
|
|
16
|
-
|
|
17
|
-
### Minor Changes
|
|
18
|
-
|
|
19
|
-
- [Fixed] - Prevent tree-shaking of components in storybook ([#667](https://github.com/justeattakeaway/pie/pull/667)) by [@xander-marjoram](https://github.com/xander-marjoram)
|
|
20
|
-
|
|
21
|
-
[Removed] - Built webc icons from source control
|
|
22
|
-
[Added] - Type declaration files for components
|
|
23
|
-
[Added] - Types for pie-icons
|
|
24
|
-
[Added] - TS version of pie-icons-configs/config.js (Will be used after DSW-1025)
|
|
25
|
-
[Added] - Webc icon tests for width, height and base classes
|
|
26
|
-
[Changed] - Update pie-icons-webc build to generate a slightly different template for regular and large icons (using different types, etc.)
|
|
27
|
-
[Changed] - Update pie-icons-webc rollup config to remove commonjs build
|
|
28
|
-
[Changed] - Use `just-kebab-case` and `just-pascal-case` instead of `kebab-case` and `pascal-case` to simplify usage (and they're more recently maintained)
|
|
29
|
-
|
|
30
|
-
## 0.11.0
|
|
31
|
-
|
|
32
|
-
### Minor Changes
|
|
33
|
-
|
|
34
|
-
- [Changed] - Add js/ts linting and fix errors ([#653](https://github.com/justeattakeaway/pie/pull/653)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
35
|
-
|
|
36
|
-
## 0.10.0
|
|
37
|
-
|
|
38
|
-
### Minor Changes
|
|
39
|
-
|
|
40
|
-
- [Changed] - expose icon-button size css variables for consumers ([#627](https://github.com/justeattakeaway/pie/pull/627)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
41
|
-
|
|
42
|
-
## 0.9.0
|
|
43
|
-
|
|
44
|
-
### Minor Changes
|
|
45
|
-
|
|
46
|
-
- [Changed] - Added slot info the the readme and peerDep added ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
47
|
-
|
|
48
|
-
- [Changed] - Ensure component implements it's props interface ([#611](https://github.com/justeattakeaway/pie/pull/611)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
49
|
-
|
|
50
|
-
- [Fixed] - Added IconClose to Visual tests and modal ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
51
|
-
|
|
52
|
-
- [Added] - Slot added to pie-icon-button ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
53
|
-
|
|
54
|
-
## 0.8.0
|
|
55
|
-
|
|
56
|
-
### Minor Changes
|
|
57
|
-
|
|
58
|
-
- [Changed] - Set all component props to public ([#597](https://github.com/justeattakeaway/pie/pull/597)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
59
|
-
|
|
60
|
-
### Patch Changes
|
|
61
|
-
|
|
62
|
-
- Updated dependencies [[`816909e55`](https://github.com/justeattakeaway/pie/commit/816909e55f464fd191fa8a54e3407b8fbd0cdc29), [`816909e55`](https://github.com/justeattakeaway/pie/commit/816909e55f464fd191fa8a54e3407b8fbd0cdc29), [`816909e55`](https://github.com/justeattakeaway/pie/commit/816909e55f464fd191fa8a54e3407b8fbd0cdc29)]:
|
|
63
|
-
- @justeattakeaway/pie-icons-webc@0.2.0
|
|
64
|
-
|
|
65
|
-
## 0.7.0
|
|
66
|
-
|
|
67
|
-
### Minor Changes
|
|
68
|
-
|
|
69
|
-
- [Changed] - ghost-tertiary renamed to ghost-secondary ([#583](https://github.com/justeattakeaway/pie/pull/583)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
70
|
-
|
|
71
|
-
### Patch Changes
|
|
72
|
-
|
|
73
|
-
- Updated dependencies [[`4c3f9348a`](https://github.com/justeattakeaway/pie/commit/4c3f9348a2041494f640cfc35e4c321eee6e550b)]:
|
|
74
|
-
- @justeattakeaway/pie-icons-webc@0.1.0
|
|
75
|
-
|
|
76
|
-
## 0.6.1
|
|
77
|
-
|
|
78
|
-
### Patch Changes
|
|
79
|
-
|
|
80
|
-
- [Changed] - Updated defs to use different array type syntax ([#566](https://github.com/justeattakeaway/pie/pull/566)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
81
|
-
|
|
82
|
-
## 0.6.0
|
|
83
|
-
|
|
84
|
-
### Minor Changes
|
|
85
|
-
|
|
86
|
-
- [Added] - `size` prop added to pie-icon-button ([#557](https://github.com/justeattakeaway/pie/pull/557)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
87
|
-
|
|
88
|
-
## 0.5.0
|
|
89
|
-
|
|
90
|
-
### Minor Changes
|
|
91
|
-
|
|
92
|
-
- [Updated] - enum types to string union types to string union types ([#508](https://github.com/justeattakeaway/pie/pull/508)) by [@FayeCarter](https://github.com/FayeCarter)
|
|
93
|
-
|
|
94
|
-
## 0.4.0
|
|
95
|
-
|
|
96
|
-
### Minor Changes
|
|
97
|
-
|
|
98
|
-
- [Changed] - Refactor visual tests to have labels showing props ([#519](https://github.com/justeattakeaway/pie/pull/519)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
99
|
-
|
|
100
|
-
- [Added] - component and a11y browser tests ([#499](https://github.com/justeattakeaway/pie/pull/499)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
101
|
-
|
|
102
|
-
- [Changed] - moved pie-webc-core dependency to devDependencies in each component ([#499](https://github.com/justeattakeaway/pie/pull/499)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
103
|
-
|
|
104
|
-
- [Added] - percy visual tests ([#499](https://github.com/justeattakeaway/pie/pull/499)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
105
|
-
|
|
106
|
-
- [Added] - Additional notes on visual tests and environment variables ([#525](https://github.com/justeattakeaway/pie/pull/525)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
107
|
-
|
|
108
|
-
- [Added] Read me percy config examples ([#529](https://github.com/justeattakeaway/pie/pull/529)) by [@kevinrodrigues](https://github.com/kevinrodrigues)
|
|
109
|
-
|
|
110
|
-
### Patch Changes
|
|
111
|
-
|
|
112
|
-
- [Changed] - Use `componentSelector` to define the custom element ([#530](https://github.com/justeattakeaway/pie/pull/530)) by [@raoufswe](https://github.com/raoufswe)
|
|
113
|
-
|
|
114
|
-
## 0.3.0
|
|
115
|
-
|
|
116
|
-
### Minor Changes
|
|
117
|
-
|
|
118
|
-
- [Changed] - customElement.define parameter to string ([#507](https://github.com/justeattakeaway/pie/pull/507)) by [@LTurns](https://github.com/LTurns)
|
|
119
|
-
|
|
120
|
-
## 0.2.0
|
|
121
|
-
|
|
122
|
-
### Minor Changes
|
|
123
|
-
|
|
124
|
-
- [Added] - Variant and disabled props and styling ([#491](https://github.com/justeattakeaway/pie/pull/491)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
125
|
-
|
|
126
|
-
- [Changed] - Build script to include generating react wrapper ([#426](https://github.com/justeattakeaway/pie/pull/426)) by [@LTurns](https://github.com/LTurns)
|
|
127
|
-
|
|
128
|
-
### Patch Changes
|
|
129
|
-
|
|
130
|
-
- [Added] - Missing `test:ci` scripts to package.json ([#492](https://github.com/justeattakeaway/pie/pull/492)) by [@siggerzz](https://github.com/siggerzz)
|
|
131
|
-
|
|
132
|
-
- [Fixed] - Resolved TS Build errors ([#482](https://github.com/justeattakeaway/pie/pull/482)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
133
|
-
|
|
134
|
-
- [Updated] - components to use the shared configurations ([#487](https://github.com/justeattakeaway/pie/pull/487)) by [@fernandofranca](https://github.com/fernandofranca)
|
|
135
|
-
|
|
136
|
-
- Updated dependencies [[`090354733`](https://github.com/justeattakeaway/pie/commit/090354733f24f0aa52ce287db7f8d13648414150)]:
|
|
137
|
-
- @justeattakeaway/pie-webc-core@0.2.0
|
|
138
|
-
|
|
139
|
-
## 0.1.0
|
|
140
|
-
|
|
141
|
-
### Minor Changes
|
|
142
|
-
|
|
143
|
-
- [Added] - base component shell ([#486](https://github.com/justeattakeaway/pie/pull/486)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './packages/components/pie-icon-button/src/index'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAAkD,CAAC;AACrE,eAAO,MAAM,QAAQ,0EAA2E,CAAC;AAEjG,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,IAAI,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B;;;OAGG;IACH,OAAO,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { IconButtonProps, sizes, variants } from './defs';
|
|
3
|
-
export { type IconButtonProps, sizes, variants };
|
|
4
|
-
declare const componentSelector = "pie-icon-button";
|
|
5
|
-
export declare class PieIconButton extends LitElement implements IconButtonProps {
|
|
6
|
-
size: IconButtonProps['size'];
|
|
7
|
-
variant: IconButtonProps['variant'];
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
-
static styles: import("lit").CSSResult;
|
|
11
|
-
}
|
|
12
|
-
declare global {
|
|
13
|
-
interface HTMLElementTagNameMap {
|
|
14
|
-
[componentSelector]: PieIconButton;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# 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;AAKlD,OAAO,EACH,eAAe,EAAE,KAAK,EAAE,QAAQ,EACnC,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEjD,QAAA,MAAM,iBAAiB,oBAAoB,CAAC;AAE5C,qBAAa,aAAc,SAAQ,UAAW,YAAW,eAAe;IAG7D,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAY;IAIzC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAa;IAGhD,QAAQ,UAAS;IAExB,MAAM;IAiBN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAID,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,aAAa,CAAC;KACtC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D,eAAO,MAAM,aAAa,qEAMxB,CAAC"}
|
package/dist/types/react.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './packages/components/pie-icon-button/src/react'
|
package/playwright/index.html
DELETED
|
@@ -1,56 +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
|
-
}
|
|
38
|
-
|
|
39
|
-
#root > * {
|
|
40
|
-
display: block;
|
|
41
|
-
margin-inline: auto;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
#root > * + * {
|
|
45
|
-
margin-top: 1em;
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
48
|
-
<title>Testing Page</title>
|
|
49
|
-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet.css" />
|
|
50
|
-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet-hsl-colors.css" />
|
|
51
|
-
</head>
|
|
52
|
-
<body>
|
|
53
|
-
<div id="root"></div>
|
|
54
|
-
<script type="module" src="./index.ts"></script>
|
|
55
|
-
</body>
|
|
56
|
-
</html>
|
package/playwright/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// Import common styles here
|
package/playwright-lit.config.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/fixtures.ts';
|
|
2
|
-
import type {
|
|
3
|
-
PropObject, WebComponentPropValues,
|
|
4
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts';
|
|
5
|
-
import {
|
|
6
|
-
getAllPropCombinations, splitCombinationsByPropertyValue,
|
|
7
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/get-all-prop-combos.ts';
|
|
8
|
-
import { PieIconButton } from '@/index';
|
|
9
|
-
import { variants } from '@/defs';
|
|
10
|
-
|
|
11
|
-
const props: PropObject = {
|
|
12
|
-
variant: variants,
|
|
13
|
-
disabled: [true, false],
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const componentPropsMatrix : WebComponentPropValues[] = getAllPropCombinations(props);
|
|
17
|
-
const componentPropsMatrixByVariant: Record<string, WebComponentPropValues[]> = splitCombinationsByPropertyValue(componentPropsMatrix, 'variant');
|
|
18
|
-
const componentVariants: string[] = Object.keys(componentPropsMatrixByVariant);
|
|
19
|
-
|
|
20
|
-
componentVariants.forEach((variant) => test(`Render all prop variations for Variant: ${variant}`, async ({ makeAxeBuilder, mount }) => {
|
|
21
|
-
await Promise.all(componentPropsMatrixByVariant[variant].map(async (combo: WebComponentPropValues) => {
|
|
22
|
-
await mount(
|
|
23
|
-
PieIconButton,
|
|
24
|
-
{
|
|
25
|
-
props: { ...combo },
|
|
26
|
-
slots: {
|
|
27
|
-
default: 'Hello world',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
}));
|
|
32
|
-
|
|
33
|
-
const results = await makeAxeBuilder().analyze();
|
|
34
|
-
|
|
35
|
-
expect(results.violations).toEqual([]);
|
|
36
|
-
}));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { test, expect } from '@sand4rt/experimental-ct-web';
|
|
2
|
-
import { PieIconButton } from '@/index';
|
|
3
|
-
|
|
4
|
-
test('should correctly work with native click events', async ({ mount }) => {
|
|
5
|
-
const messages: string[] = [];
|
|
6
|
-
const expectedEventMessage = 'Native event dispatched';
|
|
7
|
-
const component = await mount(
|
|
8
|
-
PieIconButton,
|
|
9
|
-
{
|
|
10
|
-
props: {
|
|
11
|
-
variant: 'primary',
|
|
12
|
-
},
|
|
13
|
-
on: {
|
|
14
|
-
click: () => {
|
|
15
|
-
messages.push(expectedEventMessage);
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
await component.click();
|
|
22
|
-
|
|
23
|
-
expect(messages).toEqual([expectedEventMessage]);
|
|
24
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { test } from '@sand4rt/experimental-ct-web';
|
|
2
|
-
import percySnapshot from '@percy/playwright';
|
|
3
|
-
import type {
|
|
4
|
-
PropObject, WebComponentPropValues, WebComponentTestInput,
|
|
5
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts';
|
|
6
|
-
import {
|
|
7
|
-
getAllPropCombinations, splitCombinationsByPropertyValue,
|
|
8
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/get-all-prop-combos.ts';
|
|
9
|
-
import {
|
|
10
|
-
createTestWebComponent,
|
|
11
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/rendering.ts';
|
|
12
|
-
import {
|
|
13
|
-
WebComponentTestWrapper,
|
|
14
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/components/web-component-test-wrapper/WebComponentTestWrapper.ts';
|
|
15
|
-
import { PieIconButton } from '@/index';
|
|
16
|
-
|
|
17
|
-
import { sizes, variants } from '@/defs';
|
|
18
|
-
|
|
19
|
-
const props: PropObject = {
|
|
20
|
-
size: sizes,
|
|
21
|
-
variant: variants,
|
|
22
|
-
disabled: [true, false],
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// TODO: Currently setting the slot to use a straight up SVG
|
|
26
|
-
// This should be updated to use pie-icons-webc, but after some investigation, we think that we'll
|
|
27
|
-
// need to convert the webc icons to use Lit, as currently the components don't work well in a Node env like Playwright
|
|
28
|
-
// Atm, importing them like `import '@justeattakeaway/pie-icons-webc/icons/IconClose.js';` results in an `HTMLElement is not defined` error
|
|
29
|
-
const closeSVG = '<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--close"><path d="M11.868 3.205 8 7.072 4.133 3.205l-.928.927L7.073 8l-3.868 3.867.928.928L8 8.927l3.868 3.868.927-.928L8.928 8l3.867-3.868-.927-.927Z"></path></svg>';
|
|
30
|
-
|
|
31
|
-
// Renders a <pie-icon-button> HTML string with the given prop values
|
|
32
|
-
const renderTestPieIconButton = (propVals: WebComponentPropValues) => `<pie-icon-button size="${propVals.size}" variant="${propVals.variant}" ${propVals.disabled ? 'disabled' : ''}>${closeSVG}</pie-icon-button>`;
|
|
33
|
-
|
|
34
|
-
const componentPropsMatrix : WebComponentPropValues[] = getAllPropCombinations(props);
|
|
35
|
-
const componentPropsMatrixByVariant: Record<string, WebComponentPropValues[]> = splitCombinationsByPropertyValue(componentPropsMatrix, 'variant');
|
|
36
|
-
const componentVariants: string[] = Object.keys(componentPropsMatrixByVariant);
|
|
37
|
-
|
|
38
|
-
// This ensures the component is registered in the DOM for each test
|
|
39
|
-
// This is not required if your tests mount the web component directly in the tests
|
|
40
|
-
test.beforeEach(async ({ page, mount }) => {
|
|
41
|
-
await mount(
|
|
42
|
-
PieIconButton,
|
|
43
|
-
{},
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
// Removing the element so it's not present in the tests (but is still registered in the DOM)
|
|
47
|
-
await page.evaluate(() => {
|
|
48
|
-
const element : Element | null = document.querySelector('pie-icon-button');
|
|
49
|
-
element?.remove();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
componentVariants.forEach((variant) => test(`Render all prop variations for Variant: ${variant}`, async ({ page, mount }) => {
|
|
54
|
-
await Promise.all(componentPropsMatrixByVariant[variant].map(async (combo: WebComponentPropValues) => {
|
|
55
|
-
const testComponent: WebComponentTestInput = createTestWebComponent(combo, renderTestPieIconButton);
|
|
56
|
-
const propKeyValues = `size: ${testComponent.propValues.size}, disabled: ${testComponent.propValues.disabled}`;
|
|
57
|
-
|
|
58
|
-
await mount(
|
|
59
|
-
WebComponentTestWrapper,
|
|
60
|
-
{
|
|
61
|
-
props: { propKeyValues },
|
|
62
|
-
slots: {
|
|
63
|
-
component: testComponent.renderedString,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
);
|
|
67
|
-
}));
|
|
68
|
-
|
|
69
|
-
await percySnapshot(page, `PIE Icon Button - Variant: ${variant}`);
|
|
70
|
-
}));
|
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