@justeattakeaway/pie-button 0.12.2 → 0.13.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 +7 -4
- package/CHANGELOG.md +21 -0
- package/README.md +10 -0
- package/dist/index.js +56 -65
- package/dist/react.js +1605 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/{src → packages/components/pie-button/src}/index.d.ts +2 -1
- package/dist/types/packages/components/pie-button/src/index.d.ts.map +1 -0
- package/dist/types/packages/components/pie-button/src/react.d.ts +3 -0
- package/dist/types/packages/components/pie-button/src/react.d.ts.map +1 -0
- package/dist/types/react.d.ts +1 -0
- package/package.json +10 -3
- package/playwright/index.html +40 -38
- package/playwright-lit-visual.config.ts +4 -51
- package/playwright-lit.config.ts +4 -51
- package/src/button.scss +93 -126
- package/src/index.ts +13 -18
- package/tsconfig.json +3 -25
- package/dist/types/src/decorators.d.ts +0 -9
- package/dist/types/src/decorators.d.ts.map +0 -1
- package/dist/types/src/index.d.ts.map +0 -1
- package/src/decorators.ts +0 -34
- package/vite.config.js +0 -21
- /package/dist/types/{src → packages/components/pie-button/src}/defs.d.ts +0 -0
- /package/dist/types/{src → packages/components/pie-button/src}/defs.d.ts.map +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
[11:03:19 AM] @custom-elements-manifest/analyzer: Created new manifest.
|
|
2
|
+
react wrapper has been added!
|
|
1
3
|
[36mvite v4.2.1 [32mbuilding for production...[36m[39m
|
|
2
4
|
transforming...
|
|
3
|
-
[32m✓[39m
|
|
5
|
+
[32m✓[39m 19 modules transformed.
|
|
4
6
|
rendering chunks...
|
|
5
7
|
computing gzip size...
|
|
6
|
-
[2mdist/[22m[36mindex.js [39m[1m[
|
|
8
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 6.51 kB[22m[1m[22m[2m │ gzip: 1.78 kB[22m
|
|
9
|
+
[2mdist/[22m[36mreact.js [39m[1m[2m59.13 kB[22m[1m[22m[2m │ gzip: 15.94 kB[22m
|
|
7
10
|
[32m
|
|
8
11
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
9
|
-
[32m✓[39m built in
|
|
10
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
12
|
+
[32m✓[39m built in 37.16s
|
|
13
|
+
[32m[36m[vite:dts][32m Declaration files built in 34280ms.
|
|
11
14
|
[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [Changed] - Build script to include generating react wrapper ([#426](https://github.com/justeattakeaway/pie/pull/426)) by [@LTurns](https://github.com/LTurns)
|
|
8
|
+
|
|
9
|
+
- [Changed] - Deleted old prop validation decorator to replace with shared one from the core package ([#491](https://github.com/justeattakeaway/pie/pull/491)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
10
|
+
|
|
11
|
+
- [Changed] - Changed styles to use CSS Custom Props and host attrs ([#482](https://github.com/justeattakeaway/pie/pull/482)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [Added] - Missing `test:ci` scripts to package.json ([#492](https://github.com/justeattakeaway/pie/pull/492)) by [@siggerzz](https://github.com/siggerzz)
|
|
16
|
+
|
|
17
|
+
- [Fixed] - Resolved TS Build errors ([#482](https://github.com/justeattakeaway/pie/pull/482)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
18
|
+
|
|
19
|
+
- [Updated] - components to use the shared configurations ([#487](https://github.com/justeattakeaway/pie/pull/487)) by [@fernandofranca](https://github.com/fernandofranca)
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`090354733`](https://github.com/justeattakeaway/pie/commit/090354733f24f0aa52ce287db7f8d13648414150)]:
|
|
22
|
+
- @justeattakeaway/pie-webc-core@0.2.0
|
|
23
|
+
|
|
3
24
|
## 0.12.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -45,6 +45,16 @@ Compile and watch for changes (auto-compiles `dist` on save)
|
|
|
45
45
|
yarn watch
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
### Importing the component
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// default
|
|
52
|
+
import { PieButton } from '@justeattakeaway/pie-button';
|
|
53
|
+
|
|
54
|
+
// react
|
|
55
|
+
import { PieButton } from '@justeattakeaway/pie-button/dist/react';
|
|
56
|
+
```
|
|
57
|
+
|
|
48
58
|
## Props
|
|
49
59
|
|
|
50
60
|
| Property | Type | Default | Description |
|
package/dist/index.js
CHANGED
|
@@ -1,81 +1,72 @@
|
|
|
1
|
-
import { unsafeCSS as f, LitElement as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(r, t, {
|
|
1
|
+
import { unsafeCSS as f, LitElement as g, html as m } from "lit";
|
|
2
|
+
import { property as c } from "lit/decorators.js";
|
|
3
|
+
import "lit/decorators/property.js";
|
|
4
|
+
const u = (t, r, e) => function(n, o) {
|
|
5
|
+
const a = `#${o}`;
|
|
6
|
+
Object.defineProperty(n, o, {
|
|
8
7
|
get() {
|
|
9
|
-
return this[
|
|
8
|
+
return this[a];
|
|
10
9
|
},
|
|
11
10
|
set(i) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`Must be one of: ${
|
|
16
|
-
`Falling back to default value: "${
|
|
17
|
-
), this[
|
|
11
|
+
const p = this[a];
|
|
12
|
+
r.includes(i) ? this[a] = i : (console.error(
|
|
13
|
+
`<${t}> Invalid value "${i}" provided for property "${o}".`,
|
|
14
|
+
`Must be one of: ${r.join(" | ")}.`,
|
|
15
|
+
`Falling back to default value: "${e}"`
|
|
16
|
+
), this[a] = e), this.requestUpdate(o, p);
|
|
18
17
|
}
|
|
19
18
|
});
|
|
19
|
+
}, y = `:host{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-padding: 10px var(--dt-spacing-e);--btn-min-height: 48px;--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-focus: var(--dt-color-focus-outer)}.o-btn{min-block-size:var(--btn-min-block-size);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none}.o-btn:focus-visible{outline:2px solid var(--btn-focus)}:host([variant=primary]) .o-btn: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)))}:host([variant=primary]) .o-btn: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)))}:host([variant=secondary]){--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}:host([variant=secondary]) .o-btn: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)))}:host([variant=secondary]) .o-btn: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)))}:host([variant=outline]){--btn-bg-color: var(--dt-color-container-default);--btn-text-color: var(--dt-color-content-interactive-tertiary)}:host([variant=outline]) .o-btn{border:1px solid var(--dt-color-border-strong)}:host([variant=outline]) .o-btn: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)))}:host([variant=outline]) .o-btn: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)))}:host([variant=ghost]){--btn-bg-color: var(--dt-color-container-default);--btn-text-color: var(--dt-color-content-link)}:host([variant=ghost]) .o-btn: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)))}:host([variant=ghost]) .o-btn: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)))}:host([disabled]){--btn-bg-color: var(--dt-color-disabled-01);--btn-text-color: var(--dt-color-content-disabled)}:host([disabled]) .o-btn{border:1px solid var(--dt-color-disabled-01);cursor:not-allowed}:host([isFullWidth]) .o-btn{inline-size:100%}:host([disabled][variant=ghost]){--btn-bg-color: var(--dt-color-container-default)}:host([disabled][variant=ghost]) .o-btn{outline:none}:host([size=xsmall]){--btn-padding: 6px var(--dt-spacing-b);--btn-min-block-size: 32px;--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px)}:host([size=small]){--btn-padding: 8px var(--dt-spacing-d);--btn-min-block-size: 40px;--btn-font-size: calc(var(--dt-font-size-19) * 1px);--btn-line-height: calc(var(--dt-font-size-19-line-height) * 1px)}:host([size=large]){--btn-padding: 14px var(--dt-spacing-e);--btn-min-block-size: 56px;--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px)}
|
|
20
|
+
`;
|
|
21
|
+
var s = /* @__PURE__ */ ((t) => (t.XSMALL = "xsmall", t.SMALL_EXPRESSIVE = "small-expressive", t.SMALL_PRODUCTIVE = "small-productive", t.MEDIUM = "medium", t.LARGE = "large", t))(s || {}), v = /* @__PURE__ */ ((t) => (t.SUBMIT = "submit", t.BUTTON = "button", t.RESET = "reset", t.MENU = "menu", t))(v || {}), b = /* @__PURE__ */ ((t) => (t.PRIMARY = "primary", t.SECONDARY = "secondary", t.OUTLINE = "outline", t.GHOST = "ghost", t))(b || {}), x = Object.defineProperty, z = Object.getOwnPropertyDescriptor, d = (t, r, e, n) => {
|
|
22
|
+
for (var o = n > 1 ? void 0 : n ? z(r, e) : r, a = t.length - 1, i; a >= 0; a--)
|
|
23
|
+
(i = t[a]) && (o = (n ? i(r, e, o) : i(o)) || o);
|
|
24
|
+
return n && o && x(r, e, o), o;
|
|
20
25
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(d = o[i]) && (e = (t ? d(n, r, e) : d(e)) || e);
|
|
24
|
-
return t && e && y(n, r, e), e;
|
|
25
|
-
};
|
|
26
|
-
let s = class extends h {
|
|
26
|
+
const h = "pie-button";
|
|
27
|
+
class l extends g {
|
|
27
28
|
constructor() {
|
|
28
|
-
super(...arguments), this.size =
|
|
29
|
+
super(...arguments), this.size = s.MEDIUM, this.type = v.SUBMIT, this.variant = b.PRIMARY, this.disabled = !1, this.isFullWidth = !1;
|
|
29
30
|
}
|
|
30
31
|
render() {
|
|
31
32
|
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = this, i = {
|
|
38
|
-
"o-btn": !0,
|
|
39
|
-
[`o-btn--${o}`]: o,
|
|
40
|
-
[`o-btn--${r}`]: r,
|
|
41
|
-
"o-btn--is-disabled": t,
|
|
42
|
-
"o-btn--fullWidth": e
|
|
43
|
-
};
|
|
44
|
-
return g`
|
|
33
|
+
type: r,
|
|
34
|
+
disabled: e,
|
|
35
|
+
isFullWidth: n
|
|
36
|
+
} = this;
|
|
37
|
+
return m`
|
|
45
38
|
<button
|
|
46
|
-
class
|
|
47
|
-
type=${
|
|
48
|
-
?disabled=${
|
|
49
|
-
?isFullWidth=${
|
|
39
|
+
class="o-btn"
|
|
40
|
+
type=${r}
|
|
41
|
+
?disabled=${e}
|
|
42
|
+
?isFullWidth=${n}>
|
|
50
43
|
<slot></slot>
|
|
51
44
|
</button>`;
|
|
52
45
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
u(Object.values(
|
|
58
|
-
],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
u(Object.values(
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
u(Object.values(
|
|
66
|
-
],
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
],
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
],
|
|
73
|
-
|
|
74
|
-
x("pie-button")
|
|
75
|
-
], s);
|
|
46
|
+
}
|
|
47
|
+
l.styles = f(y);
|
|
48
|
+
d([
|
|
49
|
+
c(),
|
|
50
|
+
u(h, Object.values(s), s.MEDIUM)
|
|
51
|
+
], l.prototype, "size", 2);
|
|
52
|
+
d([
|
|
53
|
+
c(),
|
|
54
|
+
u(h, Object.values(v), v.SUBMIT)
|
|
55
|
+
], l.prototype, "type", 2);
|
|
56
|
+
d([
|
|
57
|
+
c(),
|
|
58
|
+
u(h, Object.values(b), b.PRIMARY)
|
|
59
|
+
], l.prototype, "variant", 2);
|
|
60
|
+
d([
|
|
61
|
+
c({ type: Boolean, reflect: !0 })
|
|
62
|
+
], l.prototype, "disabled", 2);
|
|
63
|
+
d([
|
|
64
|
+
c({ type: Boolean, reflect: !0 })
|
|
65
|
+
], l.prototype, "isFullWidth", 2);
|
|
66
|
+
customElements.define(h, l);
|
|
76
67
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
s as BUTTON_SIZE,
|
|
69
|
+
v as BUTTON_TYPE,
|
|
70
|
+
b as BUTTON_VARIANT,
|
|
71
|
+
l as PieButton
|
|
81
72
|
};
|