@justeattakeaway/pie-icon-button 0.4.0 → 0.5.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +6 -0
- package/dist/index.js +59 -54
- package/dist/types/packages/components/pie-icon-button/src/defs.d.ts +4 -7
- package/dist/types/packages/components/pie-icon-button/src/defs.d.ts.map +1 -1
- package/dist/types/packages/components/pie-icon-button/src/index.d.ts +3 -3
- package/dist/types/packages/components/pie-icon-button/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/defs.ts +11 -7
- package/src/index.ts +4 -4
- package/test/accessibility/pie-icon-button.spec.ts +2 -2
- package/test/component/pie-icon-button.spec.ts +1 -2
- package/test/visual/pie-icon-button.spec.ts +4 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
[
|
|
1
|
+
[3:48:32 PM] @custom-elements-manifest/analyzer: Created new manifest.
|
|
2
2
|
react wrapper has been added!
|
|
3
|
-
|
|
3
|
+
[36mvite v4.2.3 [32mbuilding for production...[36m[39m
|
|
4
4
|
transforming...
|
|
5
|
-
|
|
5
|
+
[32m✓[39m 28 modules transformed.
|
|
6
6
|
rendering chunks...
|
|
7
7
|
computing gzip size...
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[vite:dts] Start generate declaration files
|
|
12
|
-
|
|
13
|
-
[vite:dts] Declaration files built in
|
|
14
|
-
|
|
8
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 7.93 kB[22m[1m[22m[2m │ gzip: 2.13 kB[22m
|
|
9
|
+
[2mdist/[22m[36mreact.js [39m[1m[2m59.14 kB[22m[1m[22m[2m │ gzip: 15.95 kB[22m
|
|
10
|
+
[32m
|
|
11
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
|
+
[32m✓[39m built in 30.04s
|
|
13
|
+
[32m[36m[vite:dts][32m Declaration files built in 27657ms.
|
|
14
|
+
[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @justeattakeaway/pie-icon-button
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [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)
|
|
8
|
+
|
|
3
9
|
## 0.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
2
|
-
import { property as
|
|
1
|
+
import { unsafeCSS as b, LitElement as p, html as l } from "lit";
|
|
2
|
+
import { property as d } from "lit/decorators.js";
|
|
3
3
|
import "lit/decorators/property.js";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
Object.defineProperty(
|
|
4
|
+
const g = (c, t, r) => function(n, o) {
|
|
5
|
+
const e = `#${o}`;
|
|
6
|
+
Object.defineProperty(n, o, {
|
|
7
7
|
get() {
|
|
8
|
-
return this[
|
|
8
|
+
return this[e];
|
|
9
9
|
},
|
|
10
|
-
set(
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
`<${
|
|
14
|
-
`Must be one of: ${
|
|
15
|
-
`Falling back to default value: "${
|
|
16
|
-
), this[
|
|
10
|
+
set(a) {
|
|
11
|
+
const f = this[e];
|
|
12
|
+
t.includes(a) ? this[e] = a : (console.error(
|
|
13
|
+
`<${c}> Invalid value "${a}" provided for property "${o}".`,
|
|
14
|
+
`Must be one of: ${t.join(" | ")}.`,
|
|
15
|
+
`Falling back to default value: "${r}"`
|
|
16
|
+
), this[e] = r), this.requestUpdate(o, f);
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
},
|
|
19
|
+
}, y = `.c-webComponentTestWrapper{padding-block:var(--dt-spacing-c);padding-inline:var(--dt-spacing-e);font-family:var(--dt-font-interactive-m-family);font-size:calc(var(--dt-font-size-20) * 1px);border:1px solid var(--dt-color-background-dark);display:grid;grid-template-columns:1fr 1fr}.c-webComponentTestWrapper-label{margin-block:var(--dt-spacing-c)}.c-webComponentTestWrapper-slot{padding:var(--dt-spacing-c);border:1px dashed var(--dt-color-background-dark);grid-column:1/3;margin-block-start:var(--dt-spacing-c)}
|
|
20
20
|
`;
|
|
21
|
-
var
|
|
22
|
-
for (var o =
|
|
23
|
-
(
|
|
24
|
-
return
|
|
21
|
+
var m = Object.defineProperty, B = Object.getOwnPropertyDescriptor, w = (c, t, r, n) => {
|
|
22
|
+
for (var o = n > 1 ? void 0 : n ? B(t, r) : t, e = c.length - 1, a; e >= 0; e--)
|
|
23
|
+
(a = c[e]) && (o = (n ? a(t, r, o) : a(o)) || o);
|
|
24
|
+
return n && o && m(t, r, o), o;
|
|
25
25
|
};
|
|
26
|
-
class
|
|
26
|
+
class s extends p {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments), this.propKeyValues = "";
|
|
29
29
|
}
|
|
@@ -32,14 +32,14 @@ class v extends u {
|
|
|
32
32
|
// <p class="c-webComponentTestWrapper-label"><b>size</b>: <code>small</code></p>
|
|
33
33
|
// <p class="c-webComponentTestWrapper-label"><b>isFullWidth</b>: <code>true</code></p>
|
|
34
34
|
_renderPropKeyValues() {
|
|
35
|
-
return this.propKeyValues.split(",").map((
|
|
36
|
-
const [
|
|
37
|
-
return
|
|
35
|
+
return this.propKeyValues.split(",").map((t) => {
|
|
36
|
+
const [r, n] = t.split(":");
|
|
37
|
+
return l`<p class="c-webComponentTestWrapper-label"><b>${r}</b>: <code>${n}</code></p>`;
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
// eslint-disable-next-line class-methods-use-this
|
|
41
41
|
render() {
|
|
42
|
-
return
|
|
42
|
+
return l`
|
|
43
43
|
<div class="c-webComponentTestWrapper">
|
|
44
44
|
${this._renderPropKeyValues()}
|
|
45
45
|
<div class="c-webComponentTestWrapper-slot">
|
|
@@ -48,51 +48,56 @@ class v extends u {
|
|
|
48
48
|
</div>`;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
],
|
|
55
|
-
const
|
|
56
|
-
customElements.get(
|
|
57
|
-
var i = /* @__PURE__ */ ((t) => (t.PRIMARY = "primary", t.SECONDARY = "secondary", t.OUTLINE = "outline", t.GHOST = "ghost", t.GHOST_TERTIARY = "ghost-tertiary", t))(i || {});
|
|
51
|
+
s.styles = b(y);
|
|
52
|
+
w([
|
|
53
|
+
d({ type: String })
|
|
54
|
+
], s.prototype, "propKeyValues", 2);
|
|
55
|
+
const v = "web-component-test-wrapper";
|
|
56
|
+
customElements.get(v) || customElements.define(v, s);
|
|
58
57
|
const $ = `.o-iconBtn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-height: 48px;--btn-width: var(--btn-height);--btn-bg-color: var(--dt-color-interactive-brand);--btn-icon-fill: var(--dt-color-content-interactive-primary);--btn-focus: var(--dt-color-focus-outer);min-block-size:var(--btn-height);aspect-ratio:1/1;border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:center}@supports not (aspect-ratio: 1/1){.o-iconBtn{min-inline-size:var(--btn-width)}}.o-iconBtn:focus-visible{outline:2px solid var(--btn-focus)}.o-iconBtn svg{height:24.5px;width:24.5px}.o-iconBtn svg,.o-iconBtn path{fill:var(--btn-icon-fill)}.o-iconBtn[variant=primary]:hover:not(:disabled){background-color:hsl(var(--dt-color-interactive-brand-h),var(--dt-color-interactive-brand-s),calc(var(--dt-color-interactive-brand-l) - var(--dt-color-hover-01)))}.o-iconBtn[variant=primary]:active:not(:disabled){background-color:hsl(var(--dt-color-interactive-brand-h),var(--dt-color-interactive-brand-s),calc(var(--dt-color-interactive-brand-l) - var(--dt-color-active-01)))}.o-iconBtn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-icon-fill: var(--dt-color-content-interactive-secondary)}.o-iconBtn[variant=secondary]:hover:not(:disabled){background-color:hsl(var(--dt-color-interactive-secondary-h),var(--dt-color-interactive-secondary-s),calc(var(--dt-color-interactive-secondary-l) - var(--dt-color-hover-01)))}.o-iconBtn[variant=secondary]:active:not(:disabled){background-color:hsl(var(--dt-color-interactive-secondary-h),var(--dt-color-interactive-secondary-s),calc(var(--dt-color-interactive-secondary-l) - var(--dt-color-active-01)))}.o-iconBtn[variant=outline]{--btn-bg-color: var(--dt-color-container-default);--btn-icon-fill: var(--dt-color-content-interactive-brand)}.o-iconBtn[variant=outline] .o-iconBtn{border:1px solid var(--dt-color-border-strong)}.o-iconBtn[variant=outline]:hover:not(:disabled){background-color:hsl(var(--dt-color-container-default-h),var(--dt-color-container-default-s),calc(var(--dt-color-container-default-l) - var(--dt-color-hover-01)))}.o-iconBtn[variant=outline]:active:not(:disabled){background-color:hsl(var(--dt-color-container-default-h),var(--dt-color-container-default-s),calc(var(--dt-color-container-default-l) - var(--dt-color-active-01)))}.o-iconBtn[variant=ghost]{--btn-bg-color: var(--dt-color-container-default);--btn-icon-fill: var(--dt-color-content-interactive-brand)}.o-iconBtn[variant=ghost]:hover:not(:disabled){background-color:hsl(var(--dt-color-container-default-h),var(--dt-color-container-default-s),calc(var(--dt-color-container-default-l) - var(--dt-color-hover-01)))}.o-iconBtn[variant=ghost]:active:not(:disabled){background-color:hsl(var(--dt-color-container-default-h),var(--dt-color-container-default-s),calc(var(--dt-color-container-default-l) - var(--dt-color-active-01)))}.o-iconBtn[variant=ghost-tertiary]{--btn-bg-color: var(--dt-color-container-default);--btn-icon-fill: var(--dt-color-content-interactive-tertiary)}.o-iconBtn[variant=ghost-tertiary]:hover:not(:disabled){background-color:hsl(var(--dt-color-container-default-h),var(--dt-color-container-default-s),calc(var(--dt-color-container-default-l) - var(--dt-color-hover-01)))}.o-iconBtn[variant=ghost-tertiary]:active:not(:disabled){background-color:hsl(var(--dt-color-container-default-h),var(--dt-color-container-default-s),calc(var(--dt-color-container-default-l) - var(--dt-color-active-01)))}.o-iconBtn[disabled]{--btn-bg-color: var(--dt-color-disabled-01);--btn-icon-fill: var(--dt-color-content-disabled)}.o-iconBtn[disabled] .o-iconBtn{border:1px solid var(--dt-color-disabled-01);cursor:not-allowed}.o-iconBtn[disabled][variant=outline] .o-iconBtn{outline:none}.o-iconBtn[disabled][variant=ghost],.o-iconBtn[disabled][variant=ghost-tertiary]{--btn-bg-color: transparent;--btn-icon-fill: var(--dt-color-content-default)}.o-iconBtn[disabled][variant=ghost] .o-iconBtn,.o-iconBtn[disabled][variant=ghost-tertiary] .o-iconBtn{outline:none;border:none}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
`, x = [
|
|
59
|
+
"primary",
|
|
60
|
+
"secondary",
|
|
61
|
+
"outline",
|
|
62
|
+
"ghost",
|
|
63
|
+
"ghost-tertiary"
|
|
64
|
+
];
|
|
65
|
+
var P = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, u = (c, t, r, n) => {
|
|
66
|
+
for (var o = n > 1 ? void 0 : n ? _(t, r) : t, e = c.length - 1, a; e >= 0; e--)
|
|
67
|
+
(a = c[e]) && (o = (n ? a(t, r, o) : a(o)) || o);
|
|
68
|
+
return n && o && P(t, r, o), o;
|
|
64
69
|
};
|
|
65
|
-
const
|
|
66
|
-
class
|
|
70
|
+
const h = "pie-icon-button";
|
|
71
|
+
class i extends p {
|
|
67
72
|
constructor() {
|
|
68
|
-
super(...arguments), this.variant =
|
|
73
|
+
super(...arguments), this.variant = "primary", this.disabled = !1;
|
|
69
74
|
}
|
|
70
75
|
render() {
|
|
71
76
|
const {
|
|
72
|
-
disabled:
|
|
73
|
-
variant:
|
|
77
|
+
disabled: t,
|
|
78
|
+
variant: r
|
|
74
79
|
} = this;
|
|
75
|
-
return
|
|
80
|
+
return l`
|
|
76
81
|
<button
|
|
77
82
|
class="o-iconBtn"
|
|
78
|
-
variant=${
|
|
79
|
-
?disabled=${
|
|
83
|
+
variant=${r}
|
|
84
|
+
?disabled=${t}>
|
|
80
85
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
81
86
|
<path d="M11.8676 3.20496L8.0001 7.07248L4.13258 3.20496L3.20508 4.13246L7.0726 7.99998L3.20508 11.8675L4.13258 12.795L8.0001 8.92748L11.8676 12.795L12.7951 11.8675L8.92761 7.99998L12.7951 4.13246L11.8676 3.20496Z" fill="#242E30"/>
|
|
82
87
|
</svg>
|
|
83
88
|
</button>`;
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
],
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
],
|
|
94
|
-
customElements.define(
|
|
91
|
+
i.styles = b($);
|
|
92
|
+
u([
|
|
93
|
+
d(),
|
|
94
|
+
g(h, x, "primary")
|
|
95
|
+
], i.prototype, "variant", 2);
|
|
96
|
+
u([
|
|
97
|
+
d({ type: Boolean })
|
|
98
|
+
], i.prototype, "disabled", 2);
|
|
99
|
+
customElements.define(h, i);
|
|
95
100
|
export {
|
|
96
|
-
i as
|
|
97
|
-
|
|
101
|
+
i as PieIconButton,
|
|
102
|
+
x as iconButtonVariants
|
|
98
103
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
export interface IconButtonProps {
|
|
2
|
+
variant: 'primary' | 'secondary' | 'outline' | 'ghost' | 'ghost-tertiary';
|
|
3
|
+
}
|
|
1
4
|
/**
|
|
2
5
|
* Icon Button style variants
|
|
3
6
|
*/
|
|
4
|
-
export declare
|
|
5
|
-
PRIMARY = "primary",
|
|
6
|
-
SECONDARY = "secondary",
|
|
7
|
-
OUTLINE = "outline",
|
|
8
|
-
GHOST = "ghost",
|
|
9
|
-
GHOST_TERTIARY = "ghost-tertiary"
|
|
10
|
-
}
|
|
7
|
+
export declare const iconButtonVariants: IconButtonProps['variant'][];
|
|
11
8
|
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,gBAAgB,CAAC;CAC7E;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,SAAS,CAAC,EAM1D,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { IconButtonProps, iconButtonVariants } from './defs';
|
|
3
|
+
export { type IconButtonProps, iconButtonVariants };
|
|
4
4
|
declare const componentSelector = "pie-icon-button";
|
|
5
5
|
export declare class PieIconButton extends LitElement {
|
|
6
|
-
variant:
|
|
6
|
+
variant: IconButtonProps['variant'];
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
render(): import("lit-html").TemplateResult<1>;
|
|
9
9
|
static styles: import("lit").CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;
|
|
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,eAAe,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAG7D,OAAO,EAAE,KAAK,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAEpD,QAAA,MAAM,iBAAiB,oBAAoB,CAAC;AAE5C,qBAAa,aAAc,SAAQ,UAAU;IAGrC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAa;IAGhD,QAAQ,UAAS;IAErB,MAAM;IAkBN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAID,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,aAAa,CAAC;KACtC;CACJ"}
|
package/package.json
CHANGED
package/src/defs.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
export interface IconButtonProps {
|
|
2
|
+
variant: 'primary' | 'secondary' | 'outline' | 'ghost' | 'ghost-tertiary';
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* Icon Button style variants
|
|
3
7
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export const iconButtonVariants: IconButtonProps['variant'][] = [
|
|
9
|
+
'primary',
|
|
10
|
+
'secondary',
|
|
11
|
+
'outline',
|
|
12
|
+
'ghost',
|
|
13
|
+
'ghost-tertiary',
|
|
14
|
+
];
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from 'lit'; // eslint-disable-line import/no-extraneous-dependencies
|
|
2
2
|
import { property } from 'lit/decorators.js'; // eslint-disable-line import/no-extraneous-dependencies
|
|
3
3
|
import { validPropertyValues } from '@justeattakeaway/pie-webc-core';
|
|
4
|
-
import { ICON_BUTTON_VARIANT } from './defs';
|
|
5
4
|
import styles from './iconButton.scss?inline';
|
|
5
|
+
import { IconButtonProps, iconButtonVariants } from './defs';
|
|
6
6
|
|
|
7
7
|
// Valid values available to consumers
|
|
8
|
-
export {
|
|
8
|
+
export { type IconButtonProps, iconButtonVariants };
|
|
9
9
|
|
|
10
10
|
const componentSelector = 'pie-icon-button';
|
|
11
11
|
|
|
12
12
|
export class PieIconButton extends LitElement {
|
|
13
13
|
@property()
|
|
14
|
-
@validPropertyValues(componentSelector,
|
|
15
|
-
variant
|
|
14
|
+
@validPropertyValues(componentSelector, iconButtonVariants, 'primary')
|
|
15
|
+
variant: IconButtonProps['variant'] = 'primary';
|
|
16
16
|
|
|
17
17
|
@property({ type: Boolean })
|
|
18
18
|
disabled = false;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
PropObject, Combination, getAllPropCombinations, splitCombinationsByPropertyValue,
|
|
5
5
|
} from '@justeattakeaway/pie-webc-core/src/test-helpers/get-all-prop-combos.ts';
|
|
6
6
|
import { PieIconButton } from '@/index';
|
|
7
|
-
import {
|
|
7
|
+
import { iconButtonVariants } from '@/defs';
|
|
8
8
|
|
|
9
9
|
const props: PropObject = {
|
|
10
|
-
variant:
|
|
10
|
+
variant: iconButtonVariants,
|
|
11
11
|
disabled: [true, false],
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { test, expect } from '@sand4rt/experimental-ct-web';
|
|
2
2
|
import { PieIconButton } from '@/index';
|
|
3
|
-
import { ICON_BUTTON_VARIANT } from '@/defs';
|
|
4
3
|
|
|
5
4
|
test('should correctly work with native click events', async ({ mount }) => {
|
|
6
5
|
const messages: string[] = [];
|
|
@@ -9,7 +8,7 @@ test('should correctly work with native click events', async ({ mount }) => {
|
|
|
9
8
|
PieIconButton,
|
|
10
9
|
{
|
|
11
10
|
props: {
|
|
12
|
-
variant:
|
|
11
|
+
variant: 'primary',
|
|
13
12
|
},
|
|
14
13
|
on: {
|
|
15
14
|
click: () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@sand4rt/experimental-ct-web';
|
|
2
2
|
import percySnapshot from '@percy/playwright';
|
|
3
|
+
import { getLitPercyOptions } from '@justeattakeaway/pie-webc-core/src/test-helpers/percy-lit-options.ts';
|
|
3
4
|
import type {
|
|
4
5
|
PropObject, WebComponentPropValues, WebComponentTestInput,
|
|
5
6
|
} from '@justeattakeaway/pie-webc-core/src/test-helpers/defs.ts';
|
|
@@ -13,10 +14,10 @@ import {
|
|
|
13
14
|
WebComponentTestWrapper,
|
|
14
15
|
} from '@justeattakeaway/pie-webc-core/src/test-helpers/components/web-component-test-wrapper/WebComponentTestWrapper.ts';
|
|
15
16
|
import { PieIconButton } from '@/index';
|
|
16
|
-
import {
|
|
17
|
+
import { iconButtonVariants } from '@/defs';
|
|
17
18
|
|
|
18
19
|
const props: PropObject = {
|
|
19
|
-
variant:
|
|
20
|
+
variant: iconButtonVariants,
|
|
20
21
|
disabled: [true, false],
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -54,5 +55,5 @@ componentVariants.forEach((variant) => test(`Render all prop variations for Vari
|
|
|
54
55
|
);
|
|
55
56
|
}));
|
|
56
57
|
|
|
57
|
-
await percySnapshot(page, `PIE Icon Button - Variant: ${variant}
|
|
58
|
+
await percySnapshot(page, `PIE Icon Button - Variant: ${variant}`, getLitPercyOptions());
|
|
58
59
|
}));
|