@justeattakeaway/pie-icon-button 0.1.0 → 0.2.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,11 +1,14 @@
1
+ [11:03:19 AM] @custom-elements-manifest/analyzer: Created new manifest.
2
+ react wrapper has been added!
1
3
  vite v4.2.1 building for production...
2
4
  transforming...
3
- ✓ 1 modules transformed.
5
+ ✓ 19 modules transformed.
4
6
  rendering chunks...
5
7
  computing gzip size...
6
- dist/index.js 0.67 kB │ gzip: 0.40 kB
8
+ dist/index.js  6.19 kB │ gzip: 1.70 kB
9
+ dist/react.js 59.15 kB │ gzip: 15.95 kB
7
10
  
8
11
  [vite:dts] Start generate declaration files...
9
- ✓ built in 11.98s
10
- [vite:dts] Declaration files built in 11853ms.
12
+ ✓ built in 37.13s
13
+ [vite:dts] Declaration files built in 34284ms.
11
14
  
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @justeattakeaway/pie-icon-button
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [Added] - Variant and disabled props and styling ([#491](https://github.com/justeattakeaway/pie/pull/491)) by [@jamieomaguire](https://github.com/jamieomaguire)
8
+
9
+ - [Changed] - Build script to include generating react wrapper ([#426](https://github.com/justeattakeaway/pie/pull/426)) by [@LTurns](https://github.com/LTurns)
10
+
11
+ ### Patch Changes
12
+
13
+ - [Added] - Missing `test:ci` scripts to package.json ([#492](https://github.com/justeattakeaway/pie/pull/492)) by [@siggerzz](https://github.com/siggerzz)
14
+
15
+ - [Fixed] - Resolved TS Build errors ([#482](https://github.com/justeattakeaway/pie/pull/482)) by [@ashleynolan](https://github.com/ashleynolan)
16
+
17
+ - [Updated] - components to use the shared configurations ([#487](https://github.com/justeattakeaway/pie/pull/487)) by [@fernandofranca](https://github.com/fernandofranca)
18
+
19
+ - Updated dependencies [[`090354733`](https://github.com/justeattakeaway/pie/commit/090354733f24f0aa52ce287db7f8d13648414150)]:
20
+ - @justeattakeaway/pie-webc-core@0.2.0
21
+
3
22
  ## 0.1.0
4
23
 
5
24
  ### Minor Changes
package/dist/index.js CHANGED
@@ -1,23 +1,59 @@
1
- import { LitElement as m, html as u } from "lit";
2
- import { customElement as i } from "lit/decorators.js";
3
- var c = Object.defineProperty, f = Object.getOwnPropertyDescriptor, b = (p, e, r, o) => {
4
- for (var t = o > 1 ? void 0 : o ? f(e, r) : e, n = p.length - 1, l; n >= 0; n--)
5
- (l = p[n]) && (t = (o ? l(e, r, t) : l(t)) || t);
6
- return o && t && c(e, r, t), t;
1
+ import { unsafeCSS as h, LitElement as u, html as f } from "lit";
2
+ import { property as d } from "lit/decorators.js";
3
+ import "lit/decorators/property.js";
4
+ const g = (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 b = 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, b);
17
+ }
18
+ });
7
19
  };
8
- let s = class extends m {
9
- // eslint-disable-next-line class-methods-use-this
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 p = `: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 y = Object.defineProperty, B = Object.getOwnPropertyDescriptor, s = (o, r, e, c) => {
24
+ for (var t = c > 1 ? void 0 : c ? B(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 && y(r, e, t), t;
27
+ };
28
+ const v = "pie-icon-button";
29
+ class l extends u {
30
+ constructor() {
31
+ super(...arguments), this.variant = i.PRIMARY, this.disabled = !1;
32
+ }
10
33
  render() {
11
- return u`
12
- <button>
13
- I am a pie-icon-button
14
- <slot></slot>
34
+ const {
35
+ disabled: r
36
+ } = this;
37
+ return f`
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
- s = b([
19
- i("pie-icon-button")
20
- ], s);
46
+ }
47
+ l.styles = h(p);
48
+ s([
49
+ d(),
50
+ g(v, Object.values(i), i.PRIMARY)
51
+ ], l.prototype, "variant", 2);
52
+ s([
53
+ d({ type: Boolean })
54
+ ], l.prototype, "disabled", 2);
55
+ customElements.define(v, l);
21
56
  export {
22
- s as PieIconButton
57
+ i as ICON_BUTTON_VARIANT,
58
+ l as PieIconButton
23
59
  };