@justeattakeaway/pie-icon-button 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -4
- package/CHANGELOG.md +25 -0
- package/dist/index.js +52 -16
- package/dist/react.js +1605 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/packages/components/pie-icon-button/src/defs.d.ts +11 -0
- package/dist/types/packages/components/pie-icon-button/src/defs.d.ts.map +1 -0
- package/dist/types/packages/components/pie-icon-button/src/index.d.ts +16 -0
- package/dist/types/packages/components/pie-icon-button/src/index.d.ts.map +1 -0
- package/dist/types/packages/components/pie-icon-button/src/react.d.ts +3 -0
- package/dist/types/packages/components/pie-icon-button/src/react.d.ts.map +1 -0
- package/dist/types/react.d.ts +1 -0
- package/package.json +8 -4
- package/src/defs.ts +10 -0
- package/src/iconButton.scss +122 -0
- package/src/index.ts +34 -8
- package/tsconfig.json +3 -25
- package/dist/types/src/index.d.ts +0 -10
- package/dist/types/src/index.d.ts.map +0 -1
- package/vite.config.js +0 -21
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
[7:49:27 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.20 kB[22m[1m[22m[2m │ gzip: 1.70 kB[22m
|
|
9
|
+
[2mdist/[22m[36mreact.js [39m[1m[2m59.14 kB[22m[1m[22m[2m │ gzip: 15.95 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 14.76s
|
|
13
|
+
[32m[36m[vite:dts][32m Declaration files built in 13749ms.
|
|
11
14
|
[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @justeattakeaway/pie-icon-button
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [Changed] - customElement.define parameter to string ([#507](https://github.com/justeattakeaway/pie/pull/507)) by [@LTurns](https://github.com/LTurns)
|
|
8
|
+
|
|
9
|
+
## 0.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [Added] - Variant and disabled props and styling ([#491](https://github.com/justeattakeaway/pie/pull/491)) by [@jamieomaguire](https://github.com/jamieomaguire)
|
|
14
|
+
|
|
15
|
+
- [Changed] - Build script to include generating react wrapper ([#426](https://github.com/justeattakeaway/pie/pull/426)) by [@LTurns](https://github.com/LTurns)
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [Added] - Missing `test:ci` scripts to package.json ([#492](https://github.com/justeattakeaway/pie/pull/492)) by [@siggerzz](https://github.com/siggerzz)
|
|
20
|
+
|
|
21
|
+
- [Fixed] - Resolved TS Build errors ([#482](https://github.com/justeattakeaway/pie/pull/482)) by [@ashleynolan](https://github.com/ashleynolan)
|
|
22
|
+
|
|
23
|
+
- [Updated] - components to use the shared configurations ([#487](https://github.com/justeattakeaway/pie/pull/487)) by [@fernandofranca](https://github.com/fernandofranca)
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`090354733`](https://github.com/justeattakeaway/pie/commit/090354733f24f0aa52ce287db7f8d13648414150)]:
|
|
26
|
+
- @justeattakeaway/pie-webc-core@0.2.0
|
|
27
|
+
|
|
3
28
|
## 0.1.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,59 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { unsafeCSS as b, LitElement as h, html as u } from "lit";
|
|
2
|
+
import { property as d } from "lit/decorators.js";
|
|
3
|
+
import "lit/decorators/property.js";
|
|
4
|
+
const f = (o, r, e) => function(c, t) {
|
|
5
|
+
const n = `#${t}`;
|
|
6
|
+
Object.defineProperty(c, t, {
|
|
7
|
+
get() {
|
|
8
|
+
return this[n];
|
|
9
|
+
},
|
|
10
|
+
set(a) {
|
|
11
|
+
const v = this[n];
|
|
12
|
+
r.includes(a) ? this[n] = a : (console.error(
|
|
13
|
+
`<${o}> Invalid value "${a}" provided for property "${t}".`,
|
|
14
|
+
`Must be one of: ${r.join(" | ")}.`,
|
|
15
|
+
`Falling back to default value: "${e}"`
|
|
16
|
+
), this[n] = e), this.requestUpdate(t, v);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
7
19
|
};
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
var i = /* @__PURE__ */ ((o) => (o.PRIMARY = "primary", o.SECONDARY = "secondary", o.OUTLINE = "outline", o.GHOST = "ghost", o.GHOST_TERTIARY = "ghost-tertiary", o))(i || {});
|
|
21
|
+
const g = `:host{--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)}.o-iconBtn{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)}:host([variant=primary]) .o-iconBtn: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-iconBtn: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-icon-fill: var(--dt-color-content-interactive-secondary)}:host([variant=secondary]) .o-iconBtn: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-iconBtn: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-icon-fill: var(--dt-color-content-interactive-brand)}:host([variant=outline]) .o-iconBtn{border:1px solid var(--dt-color-border-strong)}:host([variant=outline]) .o-iconBtn: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-iconBtn: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-icon-fill: var(--dt-color-content-interactive-brand)}:host([variant=ghost]) .o-iconBtn: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-iconBtn: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-tertiary]){--btn-bg-color: var(--dt-color-container-default);--btn-icon-fill: var(--dt-color-content-interactive-tertiary)}:host([variant=ghost-tertiary]) .o-iconBtn: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-tertiary]) .o-iconBtn: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-icon-fill: var(--dt-color-content-disabled)}:host([disabled]) .o-iconBtn{border:1px solid var(--dt-color-disabled-01);cursor:not-allowed}:host([disabled][variant=outline]) .o-iconBtn{outline:none}:host([disabled][variant=ghost]),:host([disabled][variant=ghost-tertiary]){--btn-bg-color: transparent;--btn-icon-fill: var(--dt-color-content-default)}:host([disabled][variant=ghost]) .o-iconBtn,:host([disabled][variant=ghost-tertiary]) .o-iconBtn{outline:none;border:none}
|
|
22
|
+
`;
|
|
23
|
+
var p = Object.defineProperty, y = Object.getOwnPropertyDescriptor, s = (o, r, e, c) => {
|
|
24
|
+
for (var t = c > 1 ? void 0 : c ? y(r, e) : r, n = o.length - 1, a; n >= 0; n--)
|
|
25
|
+
(a = o[n]) && (t = (c ? a(r, e, t) : a(t)) || t);
|
|
26
|
+
return c && t && p(r, e, t), t;
|
|
27
|
+
};
|
|
28
|
+
const B = "pie-icon-button";
|
|
29
|
+
class l extends h {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments), this.variant = i.PRIMARY, this.disabled = !1;
|
|
32
|
+
}
|
|
10
33
|
render() {
|
|
34
|
+
const {
|
|
35
|
+
disabled: r
|
|
36
|
+
} = this;
|
|
11
37
|
return u`
|
|
12
|
-
<button
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
<button
|
|
39
|
+
class="o-iconBtn"
|
|
40
|
+
?disabled=${r}>
|
|
41
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
42
|
+
<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"/>
|
|
43
|
+
</svg>
|
|
15
44
|
</button>`;
|
|
16
45
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
46
|
+
}
|
|
47
|
+
l.styles = b(g);
|
|
48
|
+
s([
|
|
49
|
+
d(),
|
|
50
|
+
f(B, Object.values(i), i.PRIMARY)
|
|
51
|
+
], l.prototype, "variant", 2);
|
|
52
|
+
s([
|
|
53
|
+
d({ type: Boolean })
|
|
54
|
+
], l.prototype, "disabled", 2);
|
|
55
|
+
customElements.define("pie-icon-button", l);
|
|
21
56
|
export {
|
|
22
|
-
|
|
57
|
+
i as ICON_BUTTON_VARIANT,
|
|
58
|
+
l as PieIconButton
|
|
23
59
|
};
|