@justeattakeaway/pie-textarea 0.17.24 → 0.17.26

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/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
@@ -1,108 +1,114 @@
1
- import { LitElement as N, nothing as U, html as R, unsafeCSS as G } from "lit";
2
- import { property as c, query as A } from "lit/decorators.js";
3
- import { classMap as H } from "lit/directives/class-map.js";
4
- import { ifDefined as b } from "lit/directives/if-defined.js";
5
- import { live as K } from "lit/directives/live.js";
1
+ import { LitElement as de, nothing as ce, html as J, unsafeCSS as ue } from "lit";
2
+ import { property as l, query as Y } from "lit/decorators.js";
3
+ import { classMap as pe } from "lit/directives/class-map.js";
4
+ import { ifDefined as z } from "lit/directives/if-defined.js";
5
+ import { live as he } from "lit/directives/live.js";
6
6
  import "@justeattakeaway/pie-assistive-text";
7
- import { FormControlMixin as X, RtlMixin as J, DelegatesFocusMixin as Q, wrapNativeEvent as Y, validPropertyValues as O, safeCustomElement as Z } from "@justeattakeaway/pie-webc-core";
8
- const _ = class _ extends N {
7
+ import { FormControlMixin as fe, RtlMixin as xe, DelegatesFocusMixin as ve, wrapNativeEvent as ge, validPropertyValues as N, safeCustomElement as be } from "@justeattakeaway/pie-webc-core";
8
+ const O = class O extends de {
9
9
  willUpdate() {
10
- this.getAttribute("v") || this.setAttribute("v", _.v);
10
+ this.getAttribute("v") || this.setAttribute("v", O.v);
11
11
  }
12
12
  };
13
- _.v = "0.17.24";
14
- let w = _;
15
- var $ = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
16
- function ee(e) {
17
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
13
+ O.v = "0.17.26";
14
+ let V = O;
15
+ var w = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
16
+ function me(t) {
17
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
18
18
  }
19
- var L = "Expected a function", M = NaN, te = "[object Symbol]", re = /^\s+|\s+$/g, ae = /^[-+]0x[0-9a-f]+$/i, ie = /^0b[01]+$/i, oe = /^0o[0-7]+$/i, ne = parseInt, se = typeof $ == "object" && $ && $.Object === Object && $, le = typeof self == "object" && self && self.Object === Object && self, de = se || le || Function("return this")(), ce = Object.prototype, ue = ce.toString, pe = Math.max, he = Math.min, W = function() {
20
- return de.Date.now();
21
- };
22
- function fe(e, t, r) {
23
- var n, a, p, l, d, h, x = 0, g = !1, v = !1, m = !0;
24
- if (typeof e != "function")
25
- throw new TypeError(L);
26
- t = D(t) || 0, T(r) && (g = !!r.leading, v = "maxWait" in r, p = v ? pe(D(r.maxWait) || 0, t) : p, m = "trailing" in r ? !!r.trailing : m);
27
- function C(i) {
28
- var f = n, y = a;
29
- return n = a = void 0, x = i, l = e.apply(y, f), l;
30
- }
31
- function q(i) {
32
- return x = i, d = setTimeout(k, t), g ? C(i) : l;
33
- }
34
- function B(i) {
35
- var f = i - h, y = i - x, F = t - f;
36
- return v ? he(F, p - y) : F;
37
- }
38
- function E(i) {
39
- var f = i - h, y = i - x;
40
- return h === void 0 || f >= t || f < 0 || v && y >= p;
19
+ var B, Q;
20
+ function ye() {
21
+ if (Q) return B;
22
+ Q = 1;
23
+ var t = "Expected a function", s = NaN, g = "[object Symbol]", f = /^\s+|\s+$/g, c = /^[-+]0x[0-9a-f]+$/i, b = /^0b[01]+$/i, x = /^0o[0-7]+$/i, E = parseInt, I = typeof w == "object" && w && w.Object === Object && w, F = typeof self == "object" && self && self.Object === Object && self, k = I || F || Function("return this")(), R = Object.prototype, L = R.toString, Z = Math.max, ee = Math.min, M = function() {
24
+ return k.Date.now();
25
+ };
26
+ function te(e, a, n) {
27
+ var p, h, W, y, u, m, T = 0, G = !1, _ = !1, q = !0;
28
+ if (typeof e != "function")
29
+ throw new TypeError(t);
30
+ a = U(a) || 0, S(n) && (G = !!n.leading, _ = "maxWait" in n, W = _ ? Z(U(n.maxWait) || 0, a) : W, q = "trailing" in n ? !!n.trailing : q);
31
+ function D(r) {
32
+ var v = p, $ = h;
33
+ return p = h = void 0, T = r, y = e.apply($, v), y;
34
+ }
35
+ function oe(r) {
36
+ return T = r, u = setTimeout(j, a), G ? D(r) : y;
37
+ }
38
+ function ne(r) {
39
+ var v = r - m, $ = r - T, X = a - v;
40
+ return _ ? ee(X, W - $) : X;
41
+ }
42
+ function H(r) {
43
+ var v = r - m, $ = r - T;
44
+ return m === void 0 || v >= a || v < 0 || _ && $ >= W;
45
+ }
46
+ function j() {
47
+ var r = M();
48
+ if (H(r))
49
+ return K(r);
50
+ u = setTimeout(j, ne(r));
51
+ }
52
+ function K(r) {
53
+ return u = void 0, q && p ? D(r) : (p = h = void 0, y);
54
+ }
55
+ function se() {
56
+ u !== void 0 && clearTimeout(u), T = 0, p = m = h = u = void 0;
57
+ }
58
+ function le() {
59
+ return u === void 0 ? y : K(M());
60
+ }
61
+ function A() {
62
+ var r = M(), v = H(r);
63
+ if (p = arguments, h = this, m = r, v) {
64
+ if (u === void 0)
65
+ return oe(m);
66
+ if (_)
67
+ return u = setTimeout(j, a), D(m);
68
+ }
69
+ return u === void 0 && (u = setTimeout(j, a)), y;
70
+ }
71
+ return A.cancel = se, A.flush = le, A;
41
72
  }
42
- function k() {
43
- var i = W();
44
- if (E(i))
45
- return I(i);
46
- d = setTimeout(k, B(i));
73
+ function re(e, a, n) {
74
+ var p = !0, h = !0;
75
+ if (typeof e != "function")
76
+ throw new TypeError(t);
77
+ return S(n) && (p = "leading" in n ? !!n.leading : p, h = "trailing" in n ? !!n.trailing : h), te(e, a, {
78
+ leading: p,
79
+ maxWait: a,
80
+ trailing: h
81
+ });
47
82
  }
48
- function I(i) {
49
- return d = void 0, m && n ? C(i) : (n = a = void 0, l);
83
+ function S(e) {
84
+ var a = typeof e;
85
+ return !!e && (a == "object" || a == "function");
50
86
  }
51
- function P() {
52
- d !== void 0 && clearTimeout(d), x = 0, n = h = a = d = void 0;
87
+ function ae(e) {
88
+ return !!e && typeof e == "object";
53
89
  }
54
- function V() {
55
- return d === void 0 ? l : I(W());
90
+ function ie(e) {
91
+ return typeof e == "symbol" || ae(e) && L.call(e) == g;
56
92
  }
57
- function S() {
58
- var i = W(), f = E(i);
59
- if (n = arguments, a = this, h = i, f) {
60
- if (d === void 0)
61
- return q(h);
62
- if (v)
63
- return d = setTimeout(k, t), C(h);
93
+ function U(e) {
94
+ if (typeof e == "number")
95
+ return e;
96
+ if (ie(e))
97
+ return s;
98
+ if (S(e)) {
99
+ var a = typeof e.valueOf == "function" ? e.valueOf() : e;
100
+ e = S(a) ? a + "" : a;
64
101
  }
65
- return d === void 0 && (d = setTimeout(k, t)), l;
66
- }
67
- return S.cancel = P, S.flush = V, S;
68
- }
69
- function xe(e, t, r) {
70
- var n = !0, a = !0;
71
- if (typeof e != "function")
72
- throw new TypeError(L);
73
- return T(r) && (n = "leading" in r ? !!r.leading : n, a = "trailing" in r ? !!r.trailing : a), fe(e, t, {
74
- leading: n,
75
- maxWait: t,
76
- trailing: a
77
- });
78
- }
79
- function T(e) {
80
- var t = typeof e;
81
- return !!e && (t == "object" || t == "function");
82
- }
83
- function ve(e) {
84
- return !!e && typeof e == "object";
85
- }
86
- function ge(e) {
87
- return typeof e == "symbol" || ve(e) && ue.call(e) == te;
88
- }
89
- function D(e) {
90
- if (typeof e == "number")
91
- return e;
92
- if (ge(e))
93
- return M;
94
- if (T(e)) {
95
- var t = typeof e.valueOf == "function" ? e.valueOf() : e;
96
- e = T(t) ? t + "" : t;
102
+ if (typeof e != "string")
103
+ return e === 0 ? e : +e;
104
+ e = e.replace(f, "");
105
+ var n = b.test(e);
106
+ return n || x.test(e) ? E(e.slice(2), n ? 2 : 8) : c.test(e) ? s : +e;
97
107
  }
98
- if (typeof e != "string")
99
- return e === 0 ? e : +e;
100
- e = e.replace(re, "");
101
- var r = ie.test(e);
102
- return r || oe.test(e) ? ne(e.slice(2), r ? 2 : 8) : ae.test(e) ? M : +e;
108
+ return B = re, B;
103
109
  }
104
- var be = xe;
105
- const me = /* @__PURE__ */ ee(be), ye = "*,*:after,*:before{box-sizing:inherit}:host{display:block}.c-textareaWrapper{--textarea-line-height: calc(var(--dt-font-body-l-line-height) * 1px);--textarea-border-thickness: 1px;--textarea-resize: none;--textarea-padding-inline: var(--dt-spacing-c);--textarea-padding-block: var(--dt-spacing-b);--textarea-background-color: var(--dt-color-container-default);--textarea-border-color: var(--dt-color-border-form);--textarea-content-color: var(--dt-color-content-default);--textarea-placeholder-color: var(--dt-color-content-placeholder);--textarea-height: calc((var(--textarea-line-height) * 2) + (var(--textarea-padding-block) * 2));line-height:0;padding:var(--dt-spacing-a);border:var(--textarea-border-thickness) solid var(--textarea-border-color);background-color:var(--textarea-background-color);border-radius:var(--dt-radius-rounded-c);inline-size:100%}.c-textareaWrapper textarea{font-size:calc(var(--dt-font-body-l-size) * 1px);line-height:var(--textarea-line-height);font-family:var(--dt-font-body-l-family);resize:var(--textarea-resize);border:none;background-color:var(--textarea-background-color);color:var(--textarea-content-color);block-size:var(--textarea-height);max-block-size:var(--textarea-max-height);min-block-size:var(--textarea-min-height);inline-size:100%;padding-block-start:var(--textarea-padding-block);padding-block-end:var(--textarea-padding-block);padding-inline-start:var(--textarea-padding-inline);padding-inline-end:var(--textarea-padding-inline)}.c-textareaWrapper textarea:focus{box-shadow:none;outline:none}.c-textareaWrapper textarea::placeholder{color:var(--textarea-placeholder-color);opacity:1}.c-textareaWrapper.is-readonly{--textarea-background-color: var(--dt-color-container-subtle);--textarea-border-color: var(--dt-color-border-form)}.c-textareaWrapper.is-disabled{--textarea-background-color: var(--dt-color-disabled-01);--textarea-border-color: var(--dt-color-disabled-01);--textarea-content-color: var(--dt-color-content-disabled);--textarea-placeholder-color: var(--dt-color-content-disabled)}@media (hover: hover){.c-textareaWrapper:hover:not(.is-disabled,.is-readonly){--textarea-background-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), calc(var(--dt-color-container-default-l) + calc(-1 * var(--dt-color-hover-01))))}@supports (background-color: color-mix(in srgb,black,white)){.c-textareaWrapper:hover:not(.is-disabled,.is-readonly){--textarea-background-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-container-default))}}}.c-textareaWrapper:focus-within{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.c-textareaWrapper.c-textarea--large{--textarea-padding-block: var(--dt-spacing-c)}.c-textareaWrapper.c-textarea--small{--textarea-padding-block: var(--dt-spacing-a)}.c-textareaWrapper.c-textarea--resize-manual{--textarea-resize: vertical;--textarea-min-height: calc((var(--textarea-line-height) * 1) + (var(--textarea-padding-block) * 2))}@media (pointer: coarse){.c-textareaWrapper.c-textarea--resize-manual{--textarea-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-min-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-max-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-resize: none}}.c-textareaWrapper.c-textarea--resize-auto{--textarea-max-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-min-height: var(--textarea-height)}.c-textareaWrapper.has-error{--textarea-border-color: var(--dt-color-support-error)}", ze = ["small", "medium", "large"], ke = ["auto", "manual"], $e = ["default", "success", "error"], u = {
110
+ var ze = ye();
111
+ const ke = /* @__PURE__ */ me(ze), Te = "*,*:after,*:before{box-sizing:inherit}:host{display:block}.c-textareaWrapper{--textarea-line-height: calc(var(--dt-font-body-l-line-height) * 1px);--textarea-border-thickness: 1px;--textarea-resize: none;--textarea-padding-inline: var(--dt-spacing-c);--textarea-padding-block: var(--dt-spacing-b);--textarea-background-color: var(--dt-color-container-default);--textarea-border-color: var(--dt-color-border-form);--textarea-content-color: var(--dt-color-content-default);--textarea-placeholder-color: var(--dt-color-content-placeholder);--textarea-height: calc((var(--textarea-line-height) * 2) + (var(--textarea-padding-block) * 2));line-height:0;padding:var(--dt-spacing-a);border:var(--textarea-border-thickness) solid var(--textarea-border-color);background-color:var(--textarea-background-color);border-radius:var(--dt-radius-rounded-c);inline-size:100%}.c-textareaWrapper textarea{font-size:calc(var(--dt-font-body-l-size) * 1px);line-height:var(--textarea-line-height);font-family:var(--dt-font-body-l-family);resize:var(--textarea-resize);border:none;background-color:var(--textarea-background-color);color:var(--textarea-content-color);block-size:var(--textarea-height);max-block-size:var(--textarea-max-height);min-block-size:var(--textarea-min-height);inline-size:100%;padding-block-start:var(--textarea-padding-block);padding-block-end:var(--textarea-padding-block);padding-inline-start:var(--textarea-padding-inline);padding-inline-end:var(--textarea-padding-inline)}.c-textareaWrapper textarea:focus{box-shadow:none;outline:none}.c-textareaWrapper textarea::placeholder{color:var(--textarea-placeholder-color);opacity:1}.c-textareaWrapper.is-readonly{--textarea-background-color: var(--dt-color-container-subtle);--textarea-border-color: var(--dt-color-border-form)}.c-textareaWrapper.is-disabled{--textarea-background-color: var(--dt-color-disabled-01);--textarea-border-color: var(--dt-color-disabled-01);--textarea-content-color: var(--dt-color-content-disabled);--textarea-placeholder-color: var(--dt-color-content-disabled)}@media (hover: hover){.c-textareaWrapper:hover:not(.is-disabled,.is-readonly){--textarea-background-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), calc(var(--dt-color-container-default-l) + calc(-1 * var(--dt-color-hover-01))))}@supports (background-color: color-mix(in srgb,black,white)){.c-textareaWrapper:hover:not(.is-disabled,.is-readonly){--textarea-background-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-container-default))}}}.c-textareaWrapper:focus-within{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.c-textareaWrapper.c-textarea--large{--textarea-padding-block: var(--dt-spacing-c)}.c-textareaWrapper.c-textarea--small{--textarea-padding-block: var(--dt-spacing-a)}.c-textareaWrapper.c-textarea--resize-manual{--textarea-resize: vertical;--textarea-min-height: calc((var(--textarea-line-height) * 1) + (var(--textarea-padding-block) * 2))}@media (pointer: coarse){.c-textareaWrapper.c-textarea--resize-manual{--textarea-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-min-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-max-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-resize: none}}.c-textareaWrapper.c-textarea--resize-auto{--textarea-max-height: calc((var(--textarea-line-height) * 6) + (var(--textarea-padding-block) * 2));--textarea-min-height: var(--textarea-height)}.c-textareaWrapper.has-error{--textarea-border-color: var(--dt-color-support-error)}", _e = ["small", "medium", "large"], $e = ["auto", "manual"], Ce = ["default", "success", "error"], d = {
106
112
  disabled: !1,
107
113
  size: "medium",
108
114
  resize: "auto",
@@ -113,39 +119,39 @@ const me = /* @__PURE__ */ ee(be), ye = "*,*:after,*:before{box-sizing:inherit}:
113
119
  readonly: !1,
114
120
  required: !1
115
121
  };
116
- var Te = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, s = (e, t, r, n) => {
117
- for (var a = n > 1 ? void 0 : n ? _e(t, r) : t, p = e.length - 1, l; p >= 0; p--)
118
- (l = e[p]) && (a = (n ? l(t, r, a) : l(a)) || a);
119
- return n && a && Te(t, r, a), a;
122
+ var Se = Object.defineProperty, We = Object.getOwnPropertyDescriptor, o = (t, s, g, f) => {
123
+ for (var c = f > 1 ? void 0 : f ? We(s, g) : s, b = t.length - 1, x; b >= 0; b--)
124
+ (x = t[b]) && (c = (f ? x(s, g, c) : x(c)) || c);
125
+ return f && c && Se(s, g, c), c;
120
126
  };
121
- const z = "pie-textarea", j = "assistive-text";
122
- let o = class extends X(J(Q(w))) {
127
+ const C = "pie-textarea", P = "assistive-text";
128
+ let i = class extends fe(xe(ve(V))) {
123
129
  constructor() {
124
- super(...arguments), this.value = u.value, this.disabled = u.disabled, this.size = u.size, this.resize = u.resize, this.readonly = u.readonly, this.autoFocus = u.autoFocus, this.required = u.required, this.status = u.status, this._throttledResize = me(() => {
130
+ super(...arguments), this.value = d.value, this.disabled = d.disabled, this.size = d.size, this.resize = d.resize, this.readonly = d.readonly, this.autoFocus = d.autoFocus, this.required = d.required, this.status = d.status, this._throttledResize = ke(() => {
125
131
  this.resize === "auto" && (this._textarea.style.height = "auto", this._textarea.style.height = `${this._textarea.scrollHeight}px`);
126
- }, 100), this.handleInput = (e, t) => {
127
- e ? this.value = e.target.value : t && (this.value = t), this._internals.setFormValue(this.value), this.handleResize();
128
- }, this.handleChange = (e) => {
129
- const t = Y(e);
130
- this.dispatchEvent(t);
131
- }, this.handleKeyDown = (e) => {
132
- e.key === "Enter" && e.stopPropagation();
132
+ }, 100), this.handleInput = (t, s) => {
133
+ t ? this.value = t.target.value : s && (this.value = s), this._internals.setFormValue(this.value), this.handleResize();
134
+ }, this.handleChange = (t) => {
135
+ const s = ge(t);
136
+ this.dispatchEvent(s);
137
+ }, this.handleKeyDown = (t) => {
138
+ t.key === "Enter" && t.stopPropagation();
133
139
  };
134
140
  }
135
141
  connectedCallback() {
136
142
  super.connectedCallback(), this._abortController = new AbortController();
137
- const { signal: e } = this._abortController;
138
- window.addEventListener("resize", () => this.handleResize(), { signal: e });
143
+ const { signal: t } = this._abortController;
144
+ window.addEventListener("resize", () => this.handleResize(), { signal: t });
139
145
  }
140
146
  disconnectedCallback() {
141
147
  super.disconnectedCallback(), this._abortController.abort();
142
148
  }
143
149
  firstUpdated() {
144
- const { signal: e } = this._abortController;
145
- this._textarea.addEventListener("keydown", this.handleKeyDown, { signal: e }), this._internals.setFormValue(this.value);
150
+ const { signal: t } = this._abortController;
151
+ this._textarea.addEventListener("keydown", this.handleKeyDown, { signal: t }), this._internals.setFormValue(this.value);
146
152
  }
147
- updated(e) {
148
- e.has("value") && this.handleInput(null, this.value), this.resize === "auto" && (e.has("resize") || e.has("size")) && this.handleResize();
153
+ updated(t) {
154
+ t.has("value") && this.handleInput(null, this.value), this.resize === "auto" && (t.has("resize") || t.has("size")) && this.handleResize();
149
155
  }
150
156
  /**
151
157
  * (Read-only) returns a ValidityState with the validity states that this element is in.
@@ -160,69 +166,69 @@ let o = class extends X(J(Q(w))) {
160
166
  * or because the disabled state changed on a <fieldset> that's an ancestor of this element.
161
167
  * @param disabled - The latest disabled state of the input.
162
168
  */
163
- formDisabledCallback(e) {
164
- this.disabled = e;
169
+ formDisabledCallback(t) {
170
+ this.disabled = t;
165
171
  }
166
172
  /**
167
173
  * Called when the form that owns this component is reset.
168
174
  * Resets the value to the default value.
169
175
  */
170
176
  formResetCallback() {
171
- this.value = this.defaultValue ?? u.value, this._internals.setFormValue(this.value);
177
+ this.value = this.defaultValue ?? d.value, this._internals.setFormValue(this.value);
172
178
  }
173
179
  handleResize() {
174
180
  this._throttledResize();
175
181
  }
176
182
  renderAssistiveText() {
177
- return this.assistiveText ? R`
183
+ return this.assistiveText ? J`
178
184
  <pie-assistive-text
179
- id="${j}"
180
- variant=${b(this.status)}
185
+ id="${P}"
186
+ variant=${z(this.status)}
181
187
  data-test-id="pie-textarea-assistive-text">
182
188
  ${this.assistiveText}
183
189
  </pie-assistive-text>
184
- ` : U;
190
+ ` : ce;
185
191
  }
186
192
  render() {
187
193
  const {
188
- disabled: e,
189
- resize: t,
190
- size: r,
191
- autocomplete: n,
192
- autoFocus: a,
193
- name: p,
194
- readonly: l,
195
- placeholder: d,
196
- value: h,
197
- required: x,
198
- status: g,
199
- assistiveText: v
200
- } = this, m = {
194
+ disabled: t,
195
+ resize: s,
196
+ size: g,
197
+ autocomplete: f,
198
+ autoFocus: c,
199
+ name: b,
200
+ readonly: x,
201
+ placeholder: E,
202
+ value: I,
203
+ required: F,
204
+ status: k,
205
+ assistiveText: R
206
+ } = this, L = {
201
207
  "c-textareaWrapper": !0,
202
- "is-disabled": e,
203
- "is-readonly": l,
204
- "has-error": g === "error",
205
- [`c-textarea--resize-${t}`]: !0,
206
- [`c-textarea--${r}`]: !0
208
+ "is-disabled": t,
209
+ "is-readonly": x,
210
+ "has-error": k === "error",
211
+ [`c-textarea--resize-${s}`]: !0,
212
+ [`c-textarea--${g}`]: !0
207
213
  };
208
- return R`<div>
214
+ return J`<div>
209
215
  <div
210
- class="${H(m)}"
216
+ class="${pe(L)}"
211
217
  data-test-id="pie-textarea-wrapper">
212
218
  <textarea
213
- id="${z}"
214
- data-test-id="${z}"
215
- name=${b(p)}
216
- autocomplete=${b(n)}
217
- placeholder=${b(d)}
218
- .value=${K(h)}
219
- ?autofocus=${a}
220
- ?readonly=${l}
221
- ?required=${x}
222
- ?disabled=${e}
223
- aria-describedby=${b(v ? j : void 0)}
224
- aria-invalid=${g === "error" ? "true" : "false"}
225
- aria-errormessage="${b(g === "error" ? j : void 0)}"
219
+ id="${C}"
220
+ data-test-id="${C}"
221
+ name=${z(b)}
222
+ autocomplete=${z(f)}
223
+ placeholder=${z(E)}
224
+ .value=${he(I)}
225
+ ?autofocus=${c}
226
+ ?readonly=${x}
227
+ ?required=${F}
228
+ ?disabled=${t}
229
+ aria-describedby=${z(R ? P : void 0)}
230
+ aria-invalid=${k === "error" ? "true" : "false"}
231
+ aria-errormessage="${z(k === "error" ? P : void 0)}"
226
232
  @input=${this.handleInput}
227
233
  @change=${this.handleChange}
228
234
  ></textarea>
@@ -231,62 +237,62 @@ let o = class extends X(J(Q(w))) {
231
237
  </div>`;
232
238
  }
233
239
  };
234
- o.styles = G(ye);
235
- s([
236
- c({ type: String })
237
- ], o.prototype, "value", 2);
238
- s([
239
- c({ type: String })
240
- ], o.prototype, "defaultValue", 2);
241
- s([
242
- c({ type: Boolean, reflect: !0 })
243
- ], o.prototype, "disabled", 2);
244
- s([
245
- c({ type: String }),
246
- O(z, ze, u.size)
247
- ], o.prototype, "size", 2);
248
- s([
249
- c({ type: String }),
250
- O(z, ke, u.resize)
251
- ], o.prototype, "resize", 2);
252
- s([
253
- c({ type: Boolean })
254
- ], o.prototype, "readonly", 2);
255
- s([
256
- c({ type: Boolean })
257
- ], o.prototype, "autoFocus", 2);
258
- s([
259
- c({ type: Boolean })
260
- ], o.prototype, "required", 2);
261
- s([
262
- c({ type: String }),
263
- O(z, $e, u.status)
264
- ], o.prototype, "status", 2);
265
- s([
266
- c({ type: String })
267
- ], o.prototype, "assistiveText", 2);
268
- s([
269
- c({ type: String, reflect: !0 })
270
- ], o.prototype, "name", 2);
271
- s([
272
- c({ type: String })
273
- ], o.prototype, "autocomplete", 2);
274
- s([
275
- c({ type: String })
276
- ], o.prototype, "placeholder", 2);
277
- s([
278
- A("textarea")
279
- ], o.prototype, "_textarea", 2);
280
- s([
281
- A("textarea")
282
- ], o.prototype, "focusTarget", 2);
283
- o = s([
284
- Z("pie-textarea")
285
- ], o);
240
+ i.styles = ue(Te);
241
+ o([
242
+ l({ type: String })
243
+ ], i.prototype, "value", 2);
244
+ o([
245
+ l({ type: String })
246
+ ], i.prototype, "defaultValue", 2);
247
+ o([
248
+ l({ type: Boolean, reflect: !0 })
249
+ ], i.prototype, "disabled", 2);
250
+ o([
251
+ l({ type: String }),
252
+ N(C, _e, d.size)
253
+ ], i.prototype, "size", 2);
254
+ o([
255
+ l({ type: String }),
256
+ N(C, $e, d.resize)
257
+ ], i.prototype, "resize", 2);
258
+ o([
259
+ l({ type: Boolean })
260
+ ], i.prototype, "readonly", 2);
261
+ o([
262
+ l({ type: Boolean })
263
+ ], i.prototype, "autoFocus", 2);
264
+ o([
265
+ l({ type: Boolean })
266
+ ], i.prototype, "required", 2);
267
+ o([
268
+ l({ type: String }),
269
+ N(C, Ce, d.status)
270
+ ], i.prototype, "status", 2);
271
+ o([
272
+ l({ type: String })
273
+ ], i.prototype, "assistiveText", 2);
274
+ o([
275
+ l({ type: String, reflect: !0 })
276
+ ], i.prototype, "name", 2);
277
+ o([
278
+ l({ type: String })
279
+ ], i.prototype, "autocomplete", 2);
280
+ o([
281
+ l({ type: String })
282
+ ], i.prototype, "placeholder", 2);
283
+ o([
284
+ Y("textarea")
285
+ ], i.prototype, "_textarea", 2);
286
+ o([
287
+ Y("textarea")
288
+ ], i.prototype, "focusTarget", 2);
289
+ i = o([
290
+ be("pie-textarea")
291
+ ], i);
286
292
  export {
287
- o as PieTextarea,
288
- u as defaultProps,
289
- ke as resizeModes,
290
- ze as sizes,
291
- $e as statusTypes
293
+ i as PieTextarea,
294
+ d as defaultProps,
295
+ $e as resizeModes,
296
+ _e as sizes,
297
+ Ce as statusTypes
292
298
  };
package/dist/react.d.ts CHANGED
File without changes
package/dist/react.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-textarea",
3
3
  "description": "PIE Design System Textarea built using Web Components",
4
- "version": "0.17.24",
4
+ "version": "0.17.26",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -46,13 +46,13 @@
46
46
  "@custom-elements-manifest/analyzer": "0.9.0",
47
47
  "@justeattakeaway/pie-components-config": "0.21.0",
48
48
  "@justeattakeaway/pie-css": "1.1.0",
49
- "@justeattakeaway/pie-monorepo-utils": "0.8.0",
49
+ "@justeattakeaway/pie-monorepo-utils": "0.9.0",
50
50
  "@types/lodash.throttle": "4.1.9",
51
51
  "cem-plugin-module-file-extensions": "0.0.5"
52
52
  },
53
53
  "dependencies": {
54
- "@justeattakeaway/pie-assistive-text": "0.11.24",
55
- "@justeattakeaway/pie-webc-core": "14.0.0",
54
+ "@justeattakeaway/pie-assistive-text": "0.11.26",
55
+ "@justeattakeaway/pie-webc-core": "14.0.1",
56
56
  "lodash.throttle": "4.1.1"
57
57
  },
58
58
  "volta": {