@justeattakeaway/pie-icon-button 0.13.2 → 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.
@@ -1,20 +1,35 @@
1
- export declare const sizes: readonly ["xsmall", "small", "medium", "large"];
2
- export declare const variants: readonly ["primary", "secondary", "outline", "ghost", "ghost-secondary"];
3
- export interface IconButtonProps {
4
- /**
5
- * (Optional) What size the button should be.
6
- * @default "medium"
7
- */
8
- size: typeof sizes[number];
9
- /**
10
- * (Optional) What style variant the button should be such as primary, outline or ghost.
11
- * @default "primary"
12
- */
13
- variant: typeof variants[number];
14
- /**
15
- * (Optional) When true, the button element is disabled.
16
- * @default false
17
- */
18
- disabled: boolean;
19
- }
20
- //# sourceMappingURL=defs.d.ts.map
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 { }
@@ -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 Mr() {
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), M = 0; M < b; M++)
78
- E[M] = arguments[M + 2];
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(M) {
123
- return M;
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 M = 0; M < E; M++)
193
- b[M] = arguments[M + 2];
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 xr() {
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 M(e, t, n) {
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 = M.prototype = new E();
437
- ke.constructor = M, d(ke, v.prototype), ke.isPureReactComponent = !0;
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 Mt(e, t, n) {
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 = ".", xt = ":";
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 + xt;
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 x() {
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 = x();
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 = x();
979
+ var t = M();
979
980
  return t.useState(e);
980
981
  }
981
982
  function er(e, t, n) {
982
- var a = x();
983
+ var a = M();
983
984
  return a.useReducer(e, t, n);
984
985
  }
985
986
  function tr(e) {
986
- var t = x();
987
+ var t = M();
987
988
  return t.useRef(e);
988
989
  }
989
990
  function rr(e, t) {
990
- var n = x();
991
+ var n = M();
991
992
  return n.useEffect(e, t);
992
993
  }
993
994
  function nr(e, t) {
994
- var n = x();
995
+ var n = M();
995
996
  return n.useInsertionEffect(e, t);
996
997
  }
997
998
  function ar(e, t) {
998
- var n = x();
999
+ var n = M();
999
1000
  return n.useLayoutEffect(e, t);
1000
1001
  }
1001
1002
  function or(e, t) {
1002
- var n = x();
1003
+ var n = M();
1003
1004
  return n.useCallback(e, t);
1004
1005
  }
1005
1006
  function ur(e, t) {
1006
- var n = x();
1007
+ var n = M();
1007
1008
  return n.useMemo(e, t);
1008
1009
  }
1009
1010
  function ir(e, t, n) {
1010
- var a = x();
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 = x();
1016
+ var n = M();
1016
1017
  return n.useDebugValue(e, t);
1017
1018
  }
1018
1019
  }
1019
1020
  function cr() {
1020
- var e = x();
1021
+ var e = M();
1021
1022
  return e.useTransition();
1022
1023
  }
1023
1024
  function fr(e) {
1024
- var t = x();
1025
+ var t = M();
1025
1026
  return t.useDeferredValue(e);
1026
1027
  }
1027
1028
  function lr() {
1028
- var e = x();
1029
+ var e = M();
1029
1030
  return e.useId();
1030
1031
  }
1031
1032
  function dr(e, t, n) {
1032
- var a = x();
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 = Mt.apply(this, arguments), o = 2; o < arguments.length; o++)
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, xe(o));
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 && (xe(m), j.current = 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
- xe(a), Or(function() {
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 Me = !1;
1492
- function xe(e) {
1493
- if (!Me) {
1494
- Me = !0;
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
- Me = !1;
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 = M, 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
+ 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 = Mr() : Ve.exports = xr();
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.13.2",
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/types/index.d.ts",
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 .",
package/src/index.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from './defs';
9
9
 
10
10
  // Valid values available to consumers
11
- export { type IconButtonProps, sizes, variants };
11
+ export * from './defs';
12
12
 
13
13
  const componentSelector = 'pie-icon-button';
14
14
 
package/.eslintignore DELETED
@@ -1,5 +0,0 @@
1
- .turbo
2
- dist
3
- node_modules
4
- lit-browsers-report
5
- lit-visual-report
@@ -1,14 +0,0 @@
1
- [2:03:52 PM] @custom-elements-manifest/analyzer: Created new manifest.
2
- react wrapper has been added!
3
- vite v4.3.9 building for production...
4
- transforming...
5
- ✓ 22 modules transformed.
6
- rendering chunks...
7
- computing gzip size...
8
- dist/index.js  6.06 kB │ gzip: 1.52 kB
9
- dist/react.js 59.03 kB │ gzip: 15.92 kB
10
- 
11
- [vite:dts] Start generate declaration files...
12
- ✓ built in 44.16s
13
- [vite:dts] Declaration files built in 40928ms.
14
- 
package/CHANGELOG.md DELETED
@@ -1,157 +0,0 @@
1
- # @justeattakeaway/pie-icon-button
2
-
3
- ## 0.13.2
4
-
5
- ### Patch Changes
6
-
7
- - [Fixed] - Corrected the following peerDependency: ([#713](https://github.com/justeattakeaway/pie/pull/713)) by [@siggerzz](https://github.com/siggerzz)
8
-
9
- ```js
10
- "peerDependencies": {
11
- "@justeat/pie-design-tokens": "5.4.0"
12
- },
13
- ```
14
-
15
- - [Changed] - use latest pie-design-tokens ([#716](https://github.com/justeattakeaway/pie/pull/716)) by [@xander-marjoram](https://github.com/xander-marjoram)
16
-
17
- ## 0.13.1
18
-
19
- ### Patch Changes
20
-
21
- - [Changed] - use latest pie-design-tokens ([#694](https://github.com/justeattakeaway/pie/pull/694)) by [@xander-marjoram](https://github.com/xander-marjoram)
22
-
23
- ## 0.13.0
24
-
25
- ### Minor Changes
26
-
27
- - [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)
28
-
29
- ## 0.12.0
30
-
31
- ### Minor Changes
32
-
33
- - [Fixed] - Prevent tree-shaking of components in storybook ([#667](https://github.com/justeattakeaway/pie/pull/667)) by [@xander-marjoram](https://github.com/xander-marjoram)
34
-
35
- [Removed] - Built webc icons from source control
36
- [Added] - Type declaration files for components
37
- [Added] - Types for pie-icons
38
- [Added] - TS version of pie-icons-configs/config.js (Will be used after DSW-1025)
39
- [Added] - Webc icon tests for width, height and base classes
40
- [Changed] - Update pie-icons-webc build to generate a slightly different template for regular and large icons (using different types, etc.)
41
- [Changed] - Update pie-icons-webc rollup config to remove commonjs build
42
- [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)
43
-
44
- ## 0.11.0
45
-
46
- ### Minor Changes
47
-
48
- - [Changed] - Add js/ts linting and fix errors ([#653](https://github.com/justeattakeaway/pie/pull/653)) by [@jamieomaguire](https://github.com/jamieomaguire)
49
-
50
- ## 0.10.0
51
-
52
- ### Minor Changes
53
-
54
- - [Changed] - expose icon-button size css variables for consumers ([#627](https://github.com/justeattakeaway/pie/pull/627)) by [@jamieomaguire](https://github.com/jamieomaguire)
55
-
56
- ## 0.9.0
57
-
58
- ### Minor Changes
59
-
60
- - [Changed] - Added slot info the the readme and peerDep added ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
61
-
62
- - [Changed] - Ensure component implements it's props interface ([#611](https://github.com/justeattakeaway/pie/pull/611)) by [@jamieomaguire](https://github.com/jamieomaguire)
63
-
64
- - [Fixed] - Added IconClose to Visual tests and modal ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
65
-
66
- - [Added] - Slot added to pie-icon-button ([#604](https://github.com/justeattakeaway/pie/pull/604)) by [@ashleynolan](https://github.com/ashleynolan)
67
-
68
- ## 0.8.0
69
-
70
- ### Minor Changes
71
-
72
- - [Changed] - Set all component props to public ([#597](https://github.com/justeattakeaway/pie/pull/597)) by [@jamieomaguire](https://github.com/jamieomaguire)
73
-
74
- ### Patch Changes
75
-
76
- - 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)]:
77
- - @justeattakeaway/pie-icons-webc@0.2.0
78
-
79
- ## 0.7.0
80
-
81
- ### Minor Changes
82
-
83
- - [Changed] - ghost-tertiary renamed to ghost-secondary ([#583](https://github.com/justeattakeaway/pie/pull/583)) by [@ashleynolan](https://github.com/ashleynolan)
84
-
85
- ### Patch Changes
86
-
87
- - Updated dependencies [[`4c3f9348a`](https://github.com/justeattakeaway/pie/commit/4c3f9348a2041494f640cfc35e4c321eee6e550b)]:
88
- - @justeattakeaway/pie-icons-webc@0.1.0
89
-
90
- ## 0.6.1
91
-
92
- ### Patch Changes
93
-
94
- - [Changed] - Updated defs to use different array type syntax ([#566](https://github.com/justeattakeaway/pie/pull/566)) by [@ashleynolan](https://github.com/ashleynolan)
95
-
96
- ## 0.6.0
97
-
98
- ### Minor Changes
99
-
100
- - [Added] - `size` prop added to pie-icon-button ([#557](https://github.com/justeattakeaway/pie/pull/557)) by [@ashleynolan](https://github.com/ashleynolan)
101
-
102
- ## 0.5.0
103
-
104
- ### Minor Changes
105
-
106
- - [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)
107
-
108
- ## 0.4.0
109
-
110
- ### Minor Changes
111
-
112
- - [Changed] - Refactor visual tests to have labels showing props ([#519](https://github.com/justeattakeaway/pie/pull/519)) by [@jamieomaguire](https://github.com/jamieomaguire)
113
-
114
- - [Added] - component and a11y browser tests ([#499](https://github.com/justeattakeaway/pie/pull/499)) by [@jamieomaguire](https://github.com/jamieomaguire)
115
-
116
- - [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)
117
-
118
- - [Added] - percy visual tests ([#499](https://github.com/justeattakeaway/pie/pull/499)) by [@jamieomaguire](https://github.com/jamieomaguire)
119
-
120
- - [Added] - Additional notes on visual tests and environment variables ([#525](https://github.com/justeattakeaway/pie/pull/525)) by [@jamieomaguire](https://github.com/jamieomaguire)
121
-
122
- - [Added] Read me percy config examples ([#529](https://github.com/justeattakeaway/pie/pull/529)) by [@kevinrodrigues](https://github.com/kevinrodrigues)
123
-
124
- ### Patch Changes
125
-
126
- - [Changed] - Use `componentSelector` to define the custom element ([#530](https://github.com/justeattakeaway/pie/pull/530)) by [@raoufswe](https://github.com/raoufswe)
127
-
128
- ## 0.3.0
129
-
130
- ### Minor Changes
131
-
132
- - [Changed] - customElement.define parameter to string ([#507](https://github.com/justeattakeaway/pie/pull/507)) by [@LTurns](https://github.com/LTurns)
133
-
134
- ## 0.2.0
135
-
136
- ### Minor Changes
137
-
138
- - [Added] - Variant and disabled props and styling ([#491](https://github.com/justeattakeaway/pie/pull/491)) by [@jamieomaguire](https://github.com/jamieomaguire)
139
-
140
- - [Changed] - Build script to include generating react wrapper ([#426](https://github.com/justeattakeaway/pie/pull/426)) by [@LTurns](https://github.com/LTurns)
141
-
142
- ### Patch Changes
143
-
144
- - [Added] - Missing `test:ci` scripts to package.json ([#492](https://github.com/justeattakeaway/pie/pull/492)) by [@siggerzz](https://github.com/siggerzz)
145
-
146
- - [Fixed] - Resolved TS Build errors ([#482](https://github.com/justeattakeaway/pie/pull/482)) by [@ashleynolan](https://github.com/ashleynolan)
147
-
148
- - [Updated] - components to use the shared configurations ([#487](https://github.com/justeattakeaway/pie/pull/487)) by [@fernandofranca](https://github.com/fernandofranca)
149
-
150
- - Updated dependencies [[`090354733`](https://github.com/justeattakeaway/pie/commit/090354733f24f0aa52ce287db7f8d13648414150)]:
151
- - @justeattakeaway/pie-webc-core@0.2.0
152
-
153
- ## 0.1.0
154
-
155
- ### Minor Changes
156
-
157
- - [Added] - base component shell ([#486](https://github.com/justeattakeaway/pie/pull/486)) by [@jamieomaguire](https://github.com/jamieomaguire)
@@ -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,3 +0,0 @@
1
- import { PieIconButton as PieIconButtonReact } from './index';
2
- export declare const PieIconButton: import("@lit-labs/react").ReactWebComponent<PieIconButtonReact, {}>;
3
- //# sourceMappingURL=react.d.ts.map
@@ -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"}
@@ -1 +0,0 @@
1
- export * from './packages/components/pie-icon-button/src/react'
@@ -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>
@@ -1 +0,0 @@
1
- // Import common styles here
@@ -1,4 +0,0 @@
1
- import { defineConfig } from '@sand4rt/experimental-ct-web';
2
- import { getPlaywrightVisualConfig } from '@justeattakeaway/pie-components-config';
3
-
4
- export default defineConfig(getPlaywrightVisualConfig());
@@ -1,4 +0,0 @@
1
- import { defineConfig } from '@sand4rt/experimental-ct-web';
2
- import { getPlaywrightConfig } from '@justeattakeaway/pie-components-config';
3
-
4
- export default defineConfig(getPlaywrightConfig());
@@ -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
@@ -1,3 +0,0 @@
1
- import viteConfig from '@justeattakeaway/pie-components-config/vite.config';
2
-
3
- export default viteConfig;