@justeattakeaway/pie-textarea 0.12.0 → 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.
@@ -42,7 +42,7 @@
42
42
  "type": {
43
43
  "text": "DefaultProps"
44
44
  },
45
- "default": "{\n disabled: false,\n size: 'medium',\n resize: 'auto',\n label: '',\n value: '',\n placeholder: '',\n status: 'default',\n autoFocus: false,\n readonly: false,\n required: false,\n}",
45
+ "default": "{\n disabled: false,\n size: 'medium',\n resize: 'auto',\n value: '',\n placeholder: '',\n status: 'default',\n autoFocus: false,\n readonly: false,\n required: false,\n}",
46
46
  "description": "Default values for optional properties that have default fallback values in the component."
47
47
  }
48
48
  ],
@@ -133,12 +133,6 @@
133
133
  "privacy": "public",
134
134
  "attribute": "resize"
135
135
  },
136
- {
137
- "kind": "field",
138
- "name": "label",
139
- "privacy": "public",
140
- "attribute": "label"
141
- },
142
136
  {
143
137
  "kind": "field",
144
138
  "name": "readonly",
@@ -304,18 +298,6 @@
304
298
  "name": "handleKeyDown",
305
299
  "privacy": "private"
306
300
  },
307
- {
308
- "kind": "method",
309
- "name": "renderLabel",
310
- "parameters": [
311
- {
312
- "name": "label",
313
- "type": {
314
- "text": "string"
315
- }
316
- }
317
- ]
318
- },
319
301
  {
320
302
  "kind": "method",
321
303
  "name": "renderAssistiveText"
@@ -361,10 +343,6 @@
361
343
  "name": "resize",
362
344
  "fieldName": "resize"
363
345
  },
364
- {
365
- "name": "label",
366
- "fieldName": "label"
367
- },
368
346
  {
369
347
  "name": "readonly",
370
348
  "fieldName": "readonly"
package/dist/index.d.ts CHANGED
@@ -35,7 +35,6 @@ export declare class PieTextarea extends PieTextarea_base implements TextareaPro
35
35
  disabled: boolean;
36
36
  size: "small" | "medium" | "large";
37
37
  resize: "auto" | "manual";
38
- label: string;
39
38
  readonly: boolean;
40
39
  autoFocus: boolean;
41
40
  required: boolean;
@@ -80,7 +79,6 @@ export declare class PieTextarea extends PieTextarea_base implements TextareaPro
80
79
  private handleChange;
81
80
  private handleKeyDown;
82
81
  disconnectedCallback(): void;
83
- renderLabel(label: string): TemplateResult<1> | typeof nothing;
84
82
  renderAssistiveText(): TemplateResult<1> | typeof nothing;
85
83
  render(): TemplateResult<1>;
86
84
  static styles: CSSResult;
@@ -149,10 +147,6 @@ export declare interface TextareaProps {
149
147
  * If true, the textarea is required to have a value before submitting the form. If there is no value, then the component validity state will be invalid.
150
148
  */
151
149
  required?: boolean;
152
- /**
153
- * The label text for the textarea field.
154
- */
155
- label?: string;
156
150
  /**
157
151
  * The placeholder text to display when the textarea is empty.
158
152
  */
package/dist/index.js CHANGED
@@ -1,73 +1,72 @@
1
- import { LitElement as L, html as j, nothing as M, unsafeCSS as P } from "lit";
2
- import { property as l, query as D } from "lit/decorators.js";
1
+ import { LitElement as F, nothing as K, html as R, unsafeCSS as P } from "lit";
2
+ import { property as d, query as q } from "lit/decorators.js";
3
3
  import { classMap as G } from "lit/directives/class-map.js";
4
- import { ifDefined as m } from "lit/directives/if-defined.js";
4
+ import { ifDefined as g } from "lit/directives/if-defined.js";
5
5
  import { live as H } from "lit/directives/live.js";
6
6
  import "@justeattakeaway/pie-assistive-text";
7
- import "@justeattakeaway/pie-form-label";
8
- import { FormControlMixin as U, RtlMixin as X, wrapNativeEvent as J, validPropertyValues as C, defineCustomElement as Q } from "@justeattakeaway/pie-webc-core";
7
+ import { FormControlMixin as U, RtlMixin as X, wrapNativeEvent as J, validPropertyValues as w, defineCustomElement as Q } from "@justeattakeaway/pie-webc-core";
9
8
  var T = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
10
9
  function Y(e) {
11
10
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
12
11
  }
13
- var V = "Expected a function", q = NaN, Z = "[object Symbol]", ee = /^\s+|\s+$/g, te = /^[-+]0x[0-9a-f]+$/i, ae = /^0b[01]+$/i, re = /^0o[0-7]+$/i, ie = parseInt, oe = typeof T == "object" && T && T.Object === Object && T, ne = typeof self == "object" && self && self.Object === Object && self, se = oe || ne || Function("return this")(), le = Object.prototype, de = le.toString, ce = Math.max, ue = Math.min, w = function() {
12
+ var B = "Expected a function", L = NaN, Z = "[object Symbol]", ee = /^\s+|\s+$/g, te = /^[-+]0x[0-9a-f]+$/i, ae = /^0b[01]+$/i, re = /^0o[0-7]+$/i, ie = parseInt, oe = typeof T == "object" && T && T.Object === Object && T, ne = typeof self == "object" && self && self.Object === Object && self, se = oe || ne || Function("return this")(), le = Object.prototype, de = le.toString, ce = Math.max, ue = Math.min, _ = function() {
14
13
  return se.Date.now();
15
14
  };
16
15
  function pe(e, t, a) {
17
- var d, o, p, u, s, h, x = 0, k = !1, v = !1, g = !0;
16
+ var l, i, p, u, s, h, v = 0, k = !1, f = !1, m = !0;
18
17
  if (typeof e != "function")
19
- throw new TypeError(V);
20
- t = B(t) || 0, S(a) && (k = !!a.leading, v = "maxWait" in a, p = v ? ce(B(a.maxWait) || 0, t) : p, g = "trailing" in a ? !!a.trailing : g);
18
+ throw new TypeError(B);
19
+ t = M(t) || 0, S(a) && (k = !!a.leading, f = "maxWait" in a, p = f ? ce(M(a.maxWait) || 0, t) : p, m = "trailing" in a ? !!a.trailing : m);
21
20
  function y(r) {
22
- var f = d, z = o;
23
- return d = o = void 0, x = r, u = e.apply(z, f), u;
21
+ var x = l, z = i;
22
+ return l = i = void 0, v = r, u = e.apply(z, x), u;
24
23
  }
25
- function E(r) {
26
- return x = r, s = setTimeout($, t), k ? y(r) : u;
24
+ function D(r) {
25
+ return v = r, s = setTimeout($, t), k ? y(r) : u;
27
26
  }
28
- function A(r) {
29
- var f = r - h, z = r - x, R = t - f;
30
- return v ? ue(R, p - z) : R;
27
+ function V(r) {
28
+ var x = r - h, z = r - v, I = t - x;
29
+ return f ? ue(I, p - z) : I;
31
30
  }
32
- function I(r) {
33
- var f = r - h, z = r - x;
34
- return h === void 0 || f >= t || f < 0 || v && z >= p;
31
+ function O(r) {
32
+ var x = r - h, z = r - v;
33
+ return h === void 0 || x >= t || x < 0 || f && z >= p;
35
34
  }
36
35
  function $() {
37
- var r = w();
38
- if (I(r))
39
- return F(r);
40
- s = setTimeout($, A(r));
36
+ var r = _();
37
+ if (O(r))
38
+ return C(r);
39
+ s = setTimeout($, V(r));
41
40
  }
42
- function F(r) {
43
- return s = void 0, g && d ? y(r) : (d = o = void 0, u);
41
+ function C(r) {
42
+ return s = void 0, m && l ? y(r) : (l = i = void 0, u);
44
43
  }
45
- function N() {
46
- s !== void 0 && clearTimeout(s), x = 0, d = h = o = s = void 0;
44
+ function A() {
45
+ s !== void 0 && clearTimeout(s), v = 0, l = h = i = s = void 0;
47
46
  }
48
- function K() {
49
- return s === void 0 ? u : F(w());
47
+ function N() {
48
+ return s === void 0 ? u : C(_());
50
49
  }
51
- function _() {
52
- var r = w(), f = I(r);
53
- if (d = arguments, o = this, h = r, f) {
50
+ function E() {
51
+ var r = _(), x = O(r);
52
+ if (l = arguments, i = this, h = r, x) {
54
53
  if (s === void 0)
55
- return E(h);
56
- if (v)
54
+ return D(h);
55
+ if (f)
57
56
  return s = setTimeout($, t), y(h);
58
57
  }
59
58
  return s === void 0 && (s = setTimeout($, t)), u;
60
59
  }
61
- return _.cancel = N, _.flush = K, _;
60
+ return E.cancel = A, E.flush = N, E;
62
61
  }
63
62
  function he(e, t, a) {
64
- var d = !0, o = !0;
63
+ var l = !0, i = !0;
65
64
  if (typeof e != "function")
66
- throw new TypeError(V);
67
- return S(a) && (d = "leading" in a ? !!a.leading : d, o = "trailing" in a ? !!a.trailing : o), pe(e, t, {
68
- leading: d,
65
+ throw new TypeError(B);
66
+ return S(a) && (l = "leading" in a ? !!a.leading : l, i = "trailing" in a ? !!a.trailing : i), pe(e, t, {
67
+ leading: l,
69
68
  maxWait: t,
70
- trailing: o
69
+ trailing: i
71
70
  });
72
71
  }
73
72
  function S(e) {
@@ -80,11 +79,11 @@ function fe(e) {
80
79
  function xe(e) {
81
80
  return typeof e == "symbol" || fe(e) && de.call(e) == Z;
82
81
  }
83
- function B(e) {
82
+ function M(e) {
84
83
  if (typeof e == "number")
85
84
  return e;
86
85
  if (xe(e))
87
- return q;
86
+ return L;
88
87
  if (S(e)) {
89
88
  var t = typeof e.valueOf == "function" ? e.valueOf() : e;
90
89
  e = S(t) ? t + "" : t;
@@ -93,14 +92,13 @@ function B(e) {
93
92
  return e === 0 ? e : +e;
94
93
  e = e.replace(ee, "");
95
94
  var a = ae.test(e);
96
- return a || re.test(e) ? ie(e.slice(2), a ? 2 : 8) : te.test(e) ? q : +e;
95
+ return a || re.test(e) ? ie(e.slice(2), a ? 2 : 8) : te.test(e) ? L : +e;
97
96
  }
98
97
  var ve = he;
99
98
  const ge = /* @__PURE__ */ Y(ve), be = "*,*:after,*:before{box-sizing:inherit}.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-interactive-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.c-textarea--readonly{--textarea-background-color: var(--dt-color-container-subtle);--textarea-border-color: var(--dt-color-interactive-form)}.c-textareaWrapper.c-textarea--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(.c-textarea--disabled,.c-textarea--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))))}}.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.c-textarea--error{--textarea-border-color: var(--dt-color-support-error)}", me = ["small", "medium", "large"], ye = ["auto", "manual"], ze = ["default", "success", "error"], c = {
100
99
  disabled: !1,
101
100
  size: "medium",
102
101
  resize: "auto",
103
- label: "",
104
102
  value: "",
105
103
  placeholder: "",
106
104
  status: "default",
@@ -108,14 +106,14 @@ const ge = /* @__PURE__ */ Y(ve), be = "*,*:after,*:before{box-sizing:inherit}.c
108
106
  readonly: !1,
109
107
  required: !1
110
108
  };
111
- var ke = Object.defineProperty, n = (e, t, a, d) => {
112
- for (var o = void 0, p = e.length - 1, u; p >= 0; p--)
113
- (u = e[p]) && (o = u(t, a, o) || o);
114
- return o && ke(t, a, o), o;
109
+ var ke = Object.defineProperty, n = (e, t, a, l) => {
110
+ for (var i = void 0, p = e.length - 1, u; p >= 0; p--)
111
+ (u = e[p]) && (i = u(t, a, i) || i);
112
+ return i && ke(t, a, i), i;
115
113
  };
116
- const b = "pie-textarea", O = "assistive-text", W = class W extends U(X(L)) {
114
+ const b = "pie-textarea", j = "assistive-text", W = class W extends U(X(F)) {
117
115
  constructor() {
118
- super(...arguments), this.value = c.value, this.disabled = c.disabled, this.size = c.size, this.resize = c.resize, this.label = c.label, this.readonly = c.readonly, this.autoFocus = c.autoFocus, this.required = c.required, this.status = c.status, this._throttledResize = ge(() => {
116
+ super(...arguments), this.value = c.value, this.disabled = c.disabled, this.size = c.size, this.resize = c.resize, this.readonly = c.readonly, this.autoFocus = c.autoFocus, this.required = c.required, this.status = c.status, this._throttledResize = ge(() => {
119
117
  this.resize === "auto" && (this._textarea.style.height = "auto", this._textarea.style.height = `${this._textarea.scrollHeight}px`);
120
118
  }, 100), this.handleInput = (t, a) => {
121
119
  t ? this.value = t.target.value : a && (this.value = a), this._internals.setFormValue(this.value), this.handleResize();
@@ -161,61 +159,56 @@ const b = "pie-textarea", O = "assistive-text", W = class W extends U(X(L)) {
161
159
  disconnectedCallback() {
162
160
  this._textarea.removeEventListener("keydown", this.handleKeyDown), window.removeEventListener("resize", () => this.handleResize());
163
161
  }
164
- renderLabel(t) {
165
- return t != null && t.length ? j`<pie-form-label for="${b}">${t}</pie-form-label>` : M;
166
- }
167
162
  renderAssistiveText() {
168
- return this.assistiveText ? j`
163
+ return this.assistiveText ? R`
169
164
  <pie-assistive-text
170
- id="${O}"
171
- variant=${m(this.status)}
165
+ id="${j}"
166
+ variant=${g(this.status)}
172
167
  data-test-id="pie-textarea-assistive-text">
173
168
  ${this.assistiveText}
174
169
  </pie-assistive-text>
175
- ` : M;
170
+ ` : K;
176
171
  }
177
172
  render() {
178
173
  const {
179
174
  disabled: t,
180
175
  resize: a,
181
- size: d,
182
- autocomplete: o,
176
+ size: l,
177
+ autocomplete: i,
183
178
  autoFocus: p,
184
179
  name: u,
185
180
  readonly: s,
186
181
  placeholder: h,
187
- value: x,
182
+ value: v,
188
183
  required: k,
189
- label: v,
190
- status: g,
191
- assistiveText: y
192
- } = this, E = {
184
+ status: f,
185
+ assistiveText: m
186
+ } = this, y = {
193
187
  "c-textareaWrapper": !0,
194
188
  "c-textarea--disabled": t,
195
189
  "c-textarea--readonly": s,
196
- "c-textarea--error": g === "error",
190
+ "c-textarea--error": f === "error",
197
191
  [`c-textarea--resize-${a}`]: !0,
198
- [`c-textarea--${d}`]: !0
192
+ [`c-textarea--${l}`]: !0
199
193
  };
200
- return j`<div>
201
- ${this.renderLabel(v)}
194
+ return R`<div>
202
195
  <div
203
- class="${G(E)}"
196
+ class="${G(y)}"
204
197
  data-test-id="pie-textarea-wrapper">
205
198
  <textarea
206
199
  id="${b}"
207
200
  data-test-id="${b}"
208
- name=${m(u)}
209
- autocomplete=${m(o)}
210
- placeholder=${m(h)}
211
- .value=${H(x)}
201
+ name=${g(u)}
202
+ autocomplete=${g(i)}
203
+ placeholder=${g(h)}
204
+ .value=${H(v)}
212
205
  ?autofocus=${p}
213
206
  ?readonly=${s}
214
207
  ?required=${k}
215
208
  ?disabled=${t}
216
- aria-describedby=${m(y ? O : void 0)}
217
- aria-invalid=${g === "error" ? "true" : "false"}
218
- aria-errormessage="${m(g === "error" ? O : void 0)}"
209
+ aria-describedby=${g(m ? j : void 0)}
210
+ aria-invalid=${f === "error" ? "true" : "false"}
211
+ aria-errormessage="${g(f === "error" ? j : void 0)}"
219
212
  @input=${this.handleInput}
220
213
  @change=${this.handleChange}
221
214
  ></textarea>
@@ -224,62 +217,59 @@ const b = "pie-textarea", O = "assistive-text", W = class W extends U(X(L)) {
224
217
  </div>`;
225
218
  }
226
219
  };
227
- W.shadowRootOptions = { ...L.shadowRootOptions, delegatesFocus: !0 }, W.styles = P(be);
228
- let i = W;
229
- n([
230
- l({ type: String })
231
- ], i.prototype, "value");
220
+ W.shadowRootOptions = { ...F.shadowRootOptions, delegatesFocus: !0 }, W.styles = P(be);
221
+ let o = W;
232
222
  n([
233
- l({ type: String })
234
- ], i.prototype, "defaultValue");
223
+ d({ type: String })
224
+ ], o.prototype, "value");
235
225
  n([
236
- l({ type: Boolean, reflect: !0 })
237
- ], i.prototype, "disabled");
226
+ d({ type: String })
227
+ ], o.prototype, "defaultValue");
238
228
  n([
239
- l({ type: String }),
240
- C(b, me, c.size)
241
- ], i.prototype, "size");
229
+ d({ type: Boolean, reflect: !0 })
230
+ ], o.prototype, "disabled");
242
231
  n([
243
- l({ type: String }),
244
- C(b, ye, c.resize)
245
- ], i.prototype, "resize");
232
+ d({ type: String }),
233
+ w(b, me, c.size)
234
+ ], o.prototype, "size");
246
235
  n([
247
- l({ type: String })
248
- ], i.prototype, "label");
236
+ d({ type: String }),
237
+ w(b, ye, c.resize)
238
+ ], o.prototype, "resize");
249
239
  n([
250
- l({ type: Boolean })
251
- ], i.prototype, "readonly");
240
+ d({ type: Boolean })
241
+ ], o.prototype, "readonly");
252
242
  n([
253
- l({ type: Boolean })
254
- ], i.prototype, "autoFocus");
243
+ d({ type: Boolean })
244
+ ], o.prototype, "autoFocus");
255
245
  n([
256
- l({ type: Boolean })
257
- ], i.prototype, "required");
246
+ d({ type: Boolean })
247
+ ], o.prototype, "required");
258
248
  n([
259
- l({ type: String }),
260
- C(b, ze, c.status)
261
- ], i.prototype, "status");
249
+ d({ type: String }),
250
+ w(b, ze, c.status)
251
+ ], o.prototype, "status");
262
252
  n([
263
- l({ type: String })
264
- ], i.prototype, "assistiveText");
253
+ d({ type: String })
254
+ ], o.prototype, "assistiveText");
265
255
  n([
266
- l({ type: String })
267
- ], i.prototype, "name");
256
+ d({ type: String })
257
+ ], o.prototype, "name");
268
258
  n([
269
- l({ type: String })
270
- ], i.prototype, "autocomplete");
259
+ d({ type: String })
260
+ ], o.prototype, "autocomplete");
271
261
  n([
272
- l({ type: String })
273
- ], i.prototype, "placeholder");
262
+ d({ type: String })
263
+ ], o.prototype, "placeholder");
274
264
  n([
275
- D("textarea")
276
- ], i.prototype, "_textarea");
265
+ q("textarea")
266
+ ], o.prototype, "_textarea");
277
267
  n([
278
- D("textarea")
279
- ], i.prototype, "focusTarget");
280
- Q(b, i);
268
+ q("textarea")
269
+ ], o.prototype, "focusTarget");
270
+ Q(b, o);
281
271
  export {
282
- i as PieTextarea,
272
+ o as PieTextarea,
283
273
  c as defaultProps,
284
274
  ye as resizeModes,
285
275
  me as sizes,
package/dist/react.d.ts CHANGED
@@ -38,7 +38,6 @@ declare class PieTextarea_2 extends PieTextarea_base implements TextareaProps, P
38
38
  disabled: boolean;
39
39
  size: "small" | "medium" | "large";
40
40
  resize: "auto" | "manual";
41
- label: string;
42
41
  readonly: boolean;
43
42
  autoFocus: boolean;
44
43
  required: boolean;
@@ -83,7 +82,6 @@ declare class PieTextarea_2 extends PieTextarea_base implements TextareaProps, P
83
82
  private handleChange;
84
83
  private handleKeyDown;
85
84
  disconnectedCallback(): void;
86
- renderLabel(label: string): TemplateResult<1> | typeof nothing;
87
85
  renderAssistiveText(): TemplateResult<1> | typeof nothing;
88
86
  render(): TemplateResult<1>;
89
87
  static styles: CSSResult;
@@ -159,10 +157,6 @@ export declare interface TextareaProps {
159
157
  * If true, the textarea is required to have a value before submitting the form. If there is no value, then the component validity state will be invalid.
160
158
  */
161
159
  required?: boolean;
162
- /**
163
- * The label text for the textarea field.
164
- */
165
- label?: string;
166
160
  /**
167
161
  * The placeholder text to display when the textarea is empty.
168
162
  */
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.12.0",
4
+ "version": "0.13.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "cem-plugin-module-file-extensions": "0.0.5"
43
43
  },
44
44
  "dependencies": {
45
- "@justeattakeaway/pie-form-label": "0.14.4",
45
+ "@justeattakeaway/pie-assistive-text": "0.8.0",
46
46
  "@justeattakeaway/pie-webc-core": "0.24.2",
47
47
  "lodash.throttle": "4.1.1"
48
48
  },
package/src/defs.ts CHANGED
@@ -71,11 +71,6 @@ export interface TextareaProps {
71
71
  */
72
72
  required?: boolean;
73
73
 
74
- /**
75
- * The label text for the textarea field.
76
- */
77
- label?: string;
78
-
79
74
  /**
80
75
  * The placeholder text to display when the textarea is empty.
81
76
  */
@@ -94,7 +89,6 @@ export const defaultProps: DefaultProps = {
94
89
  disabled: false,
95
90
  size: 'medium',
96
91
  resize: 'auto',
97
- label: '',
98
92
  value: '',
99
93
  placeholder: '',
100
94
  status: 'default',
package/src/index.ts CHANGED
@@ -8,7 +8,6 @@ import { live } from 'lit/directives/live.js';
8
8
  import throttle from 'lodash.throttle';
9
9
 
10
10
  import '@justeattakeaway/pie-assistive-text';
11
- import '@justeattakeaway/pie-form-label';
12
11
  import {
13
12
  validPropertyValues, RtlMixin, defineCustomElement, FormControlMixin, wrapNativeEvent, type PIEInputElement,
14
13
  } from '@justeattakeaway/pie-webc-core';
@@ -49,9 +48,6 @@ export class PieTextarea extends FormControlMixin(RtlMixin(LitElement)) implemen
49
48
  @validPropertyValues(componentSelector, resizeModes, defaultProps.resize)
50
49
  public resize = defaultProps.resize;
51
50
 
52
- @property({ type: String })
53
- public label = defaultProps.label;
54
-
55
51
  @property({ type: Boolean })
56
52
  public readonly = defaultProps.readonly;
57
53
 
@@ -181,12 +177,6 @@ export class PieTextarea extends FormControlMixin(RtlMixin(LitElement)) implemen
181
177
  window.removeEventListener('resize', () => this.handleResize());
182
178
  }
183
179
 
184
- renderLabel (label: string) {
185
- return label?.length
186
- ? html`<pie-form-label for="${componentSelector}">${label}</pie-form-label>`
187
- : nothing;
188
- }
189
-
190
180
  renderAssistiveText () {
191
181
  if (!this.assistiveText) {
192
182
  return nothing;
@@ -214,7 +204,6 @@ export class PieTextarea extends FormControlMixin(RtlMixin(LitElement)) implemen
214
204
  placeholder,
215
205
  value,
216
206
  required,
217
- label,
218
207
  status,
219
208
  assistiveText,
220
209
  } = this;
@@ -229,7 +218,6 @@ export class PieTextarea extends FormControlMixin(RtlMixin(LitElement)) implemen
229
218
  };
230
219
 
231
220
  return html`<div>
232
- ${this.renderLabel(label)}
233
221
  <div
234
222
  class="${classMap(classes)}"
235
223
  data-test-id="pie-textarea-wrapper">