@nysds/nys-textarea 1.21.1 → 1.22.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,6 +1,36 @@
1
1
  import { NysFormControlElement } from "@nysds/internals";
2
2
  import "@nysds/nys-label";
3
3
  import "@nysds/nys-errormessage";
4
+ /** Detail payload for the `nys-input` event. */
5
+ export interface NysTextareaInputDetail {
6
+ id: string;
7
+ name: string;
8
+ value: string;
9
+ }
10
+ /** The `nys-input` event, fired on each keystroke. */
11
+ export type NysTextareaInputEvent = CustomEvent<NysTextareaInputDetail>;
12
+ /** Detail payload for the `nys-change` event. */
13
+ export interface NysTextareaChangeDetail {
14
+ id: string;
15
+ name: string;
16
+ value: string;
17
+ }
18
+ /** The `nys-change` event, fired when the value is committed. */
19
+ export type NysTextareaChangeEvent = CustomEvent<NysTextareaChangeDetail>;
20
+ /** Detail payload for the `nys-select` event. */
21
+ export interface NysTextareaSelectDetail {
22
+ id: string;
23
+ value: string;
24
+ }
25
+ /** The `nys-select` event, fired when the user selects text. */
26
+ export type NysTextareaSelectEvent = CustomEvent<NysTextareaSelectDetail>;
27
+ /** Detail payload for the `nys-selectionchange` event. */
28
+ export interface NysTextareaSelectionchangeDetail {
29
+ id: string;
30
+ value: string;
31
+ }
32
+ /** The `nys-selectionchange` event, fired when the text selection changes. */
33
+ export type NysTextareaSelectionchangeEvent = CustomEvent<NysTextareaSelectionchangeDetail>;
4
34
  /**
5
35
  * A multi-line text input for collecting longer responses like comments, descriptions, or feedback.
6
36
  * Form-associated with validation support via ElementInternals.
@@ -13,10 +43,21 @@ import "@nysds/nys-errormessage";
13
43
  *
14
44
  * @slot description - Custom HTML description content below the label.
15
45
  *
16
- * @fires nys-input - Fired on input change. Detail: `{id, value}`.
17
- * @fires nys-focus - Fired when textarea gains focus.
18
- * @fires nys-blur - Fired when textarea loses focus. Triggers validation.
19
- * @fires nys-select - Fired when user selects text. Detail: `{id, value}`.
46
+ * @formControl value nys-change nys-input
47
+ *
48
+ * @fires {NysTextareaInputEvent} nys-input - Fired on each input. Detail: `{id, name, value}`.
49
+ * @fires {NysTextareaChangeEvent} nys-change - Fired when the value is committed (native `change`). Detail: `{id, name, value}`.
50
+ * @fires {Event} nys-focus - Fired when the textarea gains focus.
51
+ * @fires {Event} nys-blur - Fired when the textarea loses focus. Triggers validation.
52
+ * @fires {NysTextareaSelectEvent} nys-select - Fired when the user selects text. Detail: `{id, value}`.
53
+ * @fires {NysTextareaSelectionchangeEvent} nys-selectionchange - Fired when the text selection changes. Detail: `{id, value}`.
54
+ *
55
+ * @usagedos
56
+ * - Use to collect multiple lines of open-ended text input (e.g., comments, descriptions, feedback).
57
+ *
58
+ * @usagedonts
59
+ * - Use for short or single-line input. Use `<nys-textinput>` instead.
60
+ * - Use when input should be selected from predefined options. Use `<nys-select>`, `<nys-radiobutton>`, or `<nys-checkbox>` instead.
20
61
  *
21
62
  * @example Basic
22
63
  * ```html
@@ -144,6 +185,7 @@ export declare class NysTextarea extends NysFormControlElement {
144
185
  connectedCallback(): void;
145
186
  disconnectedCallback(): void;
146
187
  firstUpdated(): void;
188
+ willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
147
189
  updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
148
190
  /**
149
191
  * Form Integration
@@ -165,6 +207,7 @@ export declare class NysTextarea extends NysFormControlElement {
165
207
  * --------------------------------------------------------------------------
166
208
  */
167
209
  private _handleInput;
210
+ private _handleChange;
168
211
  private _handleFocus;
169
212
  private _handleBlur;
170
213
  private _handleSelect;
@@ -1,5 +1,5 @@
1
- import { LitElement as p, unsafeCSS as v, html as f } from "lit";
2
- import { property as a } from "lit/decorators.js";
1
+ import { LitElement as f, unsafeCSS as _, html as x } from "lit";
2
+ import { property as r } from "lit/decorators.js";
3
3
  import { ifDefined as h } from "lit/directives/if-defined.js";
4
4
  import "@nysds/nys-label";
5
5
  import "@nysds/nys-errormessage";
@@ -8,20 +8,30 @@ import "@nysds/nys-errormessage";
8
8
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
9
9
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
10
10
  *
11
- * Textarea Component v1.21.1
11
+ * Textarea Component v1.22.0
12
12
  * Part of the New York State Design System
13
13
  * Repository: https://github.com/its-hcd/nysds
14
14
  * License: MIT
15
15
  */
16
16
  /*!
17
- * New York State Design System v1.21.1
17
+ * New York State Design System v1.22.0
18
18
  * Description: A design system for New York State's digital products.
19
19
  * Repository: https://github.com/its-hcd/nysds
20
20
  * License: MIT
21
21
  */
22
- let x = 0;
23
- function _(o) {
24
- return `${o}-${Date.now()}-${x++}`;
22
+ let g = 0;
23
+ function m(o) {
24
+ return `${o}-${Date.now()}-${g++}`;
25
+ }
26
+ function c(o, e, t) {
27
+ o.dispatchEvent(
28
+ new CustomEvent(e, { detail: t, bubbles: !0, composed: !0 })
29
+ );
30
+ }
31
+ function v(o, e) {
32
+ o.dispatchEvent(
33
+ new Event(`nys-${e}`, { bubbles: !0, composed: !0 })
34
+ );
25
35
  }
26
36
  const b = (o) => {
27
37
  class e extends o {
@@ -29,14 +39,14 @@ const b = (o) => {
29
39
  return this.localName || "nys-element";
30
40
  }
31
41
  ensureId() {
32
- this.id || (this.id = _(this.idPrefix));
42
+ this.id || (this.id = m(this.idPrefix));
33
43
  }
34
44
  connectedCallback() {
35
45
  super.connectedCallback(), this.ensureId();
36
46
  }
37
47
  }
38
48
  return e;
39
- }, m = (o) => {
49
+ }, w = (o) => {
40
50
  class e extends b(o) {
41
51
  constructor() {
42
52
  super(...arguments), this.__internals = null;
@@ -60,7 +70,7 @@ const b = (o) => {
60
70
  l[n] = i;
61
71
  return;
62
72
  }
63
- const d = g(n);
73
+ const d = V(n);
64
74
  i === null ? this.removeAttribute(d) : this.setAttribute(d, i);
65
75
  }
66
76
  reflectDefaultSemantics() {
@@ -73,21 +83,33 @@ const b = (o) => {
73
83
  }
74
84
  return e;
75
85
  };
76
- function g(o) {
86
+ function V(o) {
77
87
  if (o === "role") return "role";
78
88
  const e = o.replace(/^aria/, "");
79
89
  return "aria-" + e.charAt(0).toLowerCase() + e.slice(1);
80
90
  }
81
- const w = (o) => {
82
- const e = class extends m(o) {
91
+ const $ = (o) => {
92
+ const e = class extends w(o) {
93
+ constructor() {
94
+ super(...arguments), this.__internalValidationMessage = "";
95
+ }
96
+ get internalValidationMessage() {
97
+ return this.__internalValidationMessage;
98
+ }
99
+ set internalValidationMessage(i) {
100
+ i !== this.__internalValidationMessage && (this.__internalValidationMessage = i, this.requestUpdate("internalValidationMessage"));
101
+ }
102
+ resolvedErrorMessage() {
103
+ return this.errorMessage || this.internalValidationMessage;
104
+ }
83
105
  setFormValue(i) {
84
106
  this.internals?.setFormValue(i ?? null);
85
107
  }
86
108
  setValidityFromState(i, l, d) {
87
- const u = this.internals;
88
- if (!u) return;
89
- const y = Object.values(i).some(Boolean);
90
- y ? u.setValidity(i, l ?? "Invalid value", d) : u.setValidity({}), this.setHostAria("ariaInvalid", y ? "true" : "false");
109
+ const y = this.internals;
110
+ if (!y) return;
111
+ const p = Object.values(i).some(Boolean);
112
+ p ? y.setValidity(i, l ?? "Invalid value", d) : y.setValidity({}), this.setHostAria("ariaInvalid", p ? "true" : "false");
91
113
  }
92
114
  clearValidity() {
93
115
  this.internals?.setValidity({}), this.setHostAria("ariaInvalid", "false");
@@ -99,17 +121,17 @@ const w = (o) => {
99
121
  return this.internals?.reportValidity() ?? !0;
100
122
  }
101
123
  formResetCallback() {
102
- this.clearValidity();
124
+ this.internalValidationMessage = "", this.clearValidity();
103
125
  }
104
126
  };
105
127
  return e.formAssociated = !0, e;
106
- }, $ = /* @__PURE__ */ w(p), S = ':host{--_nys-textarea-width: 100%;--_nys-textarea-border-radius: var(--nys-radius-md, 4px);--_nys-textarea-border-width: var(--nys-border-width-sm, 1px);--_nys-textarea-border-color: var(--nys-color-neutral-400, #909395);--_nys-textarea-padding: var(--nys-space-200, 16px);--_nys-textarea-gap: var(--nys-space-50, 4px);--_nys-textarea-color: var(--nys-color-ink, #1b1b1b);--_nys-textarea-color--placeholder: var( --nys-color-text-weaker, var(--nys-color-neutral-500, #797c7f) );--_nys-textarea-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-textarea-outline-width: var(--nys-border-width-sm, 1px);--_nys-textarea-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-textarea-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-textarea-border-color--disabled: var(--nys-color-neutral-200, #bec0c1);--_nys-textarea-color--disabled: var( --nys-color-text-disabled, var(--nys-color-neutral-200, #bec0c1) );--_nys-textarea-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-textarea-font-size: var(--nys-font-size-ui-md, 16px);--_nys-textarea-font-weight: var(--nys-font-weight-regular, 400);--_nys-textarea-line-height: var(--nys-font-lineheight-ui-md, 24px);--nys-textarea-letterspacing-ui: var( --nys-font-letterspacing-ui-md, var(--nys-font-letterspacing-400, .044px) )}:host([width=sm]){--_nys-textarea-width: var(--nys-form-width-sm, 88px)}:host([width=md]){--_nys-textarea-width: var(--nys-form-width-md, 200px)}:host([width=lg]){--_nys-textarea-width: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-textarea-width: 100%;flex:1}:host([showError]){--_nys-textarea-border-color: var(--nys-color-danger, #b52c2c)}:host([inverted]){--_nys-textarea-outline-color--focus: var(--nys-color-focus-reverse, #7aa5e7)}.nys-textarea{font-weight:var(--_nys-textarea-font-weight);font-family:var(--_nys-textarea-font-family);line-height:var(--_nys-textarea-line-height);letter-spacing:var(--nys-textarea-letterspacing-ui);color:var(--_nys-textarea-color);gap:var(--_nys-textarea-gap);display:flex;flex-direction:column}.nys-textarea__textarea{color:var(--_nys-textarea-color);font-size:var(--_nys-textarea-font-size);font-family:var(--_nys-textarea-font-family);border-radius:var(--_nys-textarea-border-radius);border:solid var(--_nys-textarea-border-color) var(--_nys-textarea-border-width);padding:var(--_nys-textarea-padding);width:var(--_nys-textarea-width);line-height:var(--_nys-textarea-line-height);max-width:var(--_nys-textarea-width);box-sizing:border-box}.nys-textarea__textarea::placeholder{color:var(--_nys-textarea-color--placeholder)}.nys-textarea__textarea.none{resize:none}.nys-textarea__textarea:hover:not(:disabled):not(:focus):not([readonly]){outline:solid var(--_nys-textarea-outline-width) var(--_nys-textarea-outline-color--hover);border-color:var(--_nys-textarea-outline-color--hover)}.nys-textarea__textarea:focus:not([readonly]){outline:solid var(--_nys-textarea-outline-width) var(--_nys-textarea-outline-color--focus);border-color:var(--_nys-textarea-outline-color--focus);caret-color:var(--_nys-textarea-outline-color--focus)}.nys-textarea__textarea:disabled,.nys-textarea__textarea:disabled::placeholder{background-color:var(--_nys-textarea-background-color--disabled);border-color:var(--_nys-textarea-border-color--disabled);color:var(--_nys-textarea-color--disabled);cursor:not-allowed}';
107
- var V = Object.defineProperty, s = (o, e, t, n) => {
128
+ }, S = /* @__PURE__ */ $(f), q = ':host{--_nys-textarea-width: 100%;--_nys-textarea-border-radius: var(--nys-radius-md, 4px);--_nys-textarea-border-width: var(--nys-border-width-sm, 1px);--_nys-textarea-border-color: var(--nys-color-neutral-400, #909395);--_nys-textarea-padding: var(--nys-space-200, 16px);--_nys-textarea-gap: var(--nys-space-50, 4px);--_nys-textarea-color: var(--nys-color-ink, #1b1b1b);--_nys-textarea-color--placeholder: var( --nys-color-text-weaker, var(--nys-color-neutral-500, #797c7f) );--_nys-textarea-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-textarea-outline-width: var(--nys-border-width-sm, 1px);--_nys-textarea-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-textarea-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-textarea-border-color--disabled: var(--nys-color-neutral-200, #bec0c1);--_nys-textarea-color--disabled: var( --nys-color-text-disabled, var(--nys-color-neutral-200, #bec0c1) );--_nys-textarea-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-textarea-font-size: var(--nys-font-size-ui-md, 16px);--_nys-textarea-font-weight: var(--nys-font-weight-regular, 400);--_nys-textarea-line-height: var(--nys-font-lineheight-ui-md, 24px);--nys-textarea-letterspacing-ui: var( --nys-font-letterspacing-ui-md, var(--nys-font-letterspacing-400, .044px) )}:host([width=sm]){--_nys-textarea-width: var(--nys-form-width-sm, 88px)}:host([width=md]){--_nys-textarea-width: var(--nys-form-width-md, 200px)}:host([width=lg]){--_nys-textarea-width: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-textarea-width: 100%;flex:1}:host([showError]){--_nys-textarea-border-color: var(--nys-color-danger, #b52c2c)}:host([inverted]){--_nys-textarea-outline-color--focus: var(--nys-color-focus-reverse, #7aa5e7)}.nys-textarea{font-weight:var(--_nys-textarea-font-weight);font-family:var(--_nys-textarea-font-family);line-height:var(--_nys-textarea-line-height);letter-spacing:var(--nys-textarea-letterspacing-ui);color:var(--_nys-textarea-color);gap:var(--_nys-textarea-gap);display:flex;flex-direction:column}.nys-textarea__textarea{color:var(--_nys-textarea-color);font-size:var(--_nys-textarea-font-size);font-family:var(--_nys-textarea-font-family);border-radius:var(--_nys-textarea-border-radius);border:solid var(--_nys-textarea-border-color) var(--_nys-textarea-border-width);padding:var(--_nys-textarea-padding);width:var(--_nys-textarea-width);line-height:var(--_nys-textarea-line-height);max-width:var(--_nys-textarea-width);box-sizing:border-box}.nys-textarea__textarea::placeholder{color:var(--_nys-textarea-color--placeholder)}.nys-textarea__textarea.none{resize:none}.nys-textarea__textarea:hover:not(:disabled):not(:focus):not([readonly]){outline:solid var(--_nys-textarea-outline-width) var(--_nys-textarea-outline-color--hover);border-color:var(--_nys-textarea-outline-color--hover)}.nys-textarea__textarea:focus:not([readonly]){outline:solid var(--_nys-textarea-outline-width) var(--_nys-textarea-outline-color--focus);border-color:var(--_nys-textarea-outline-color--focus);caret-color:var(--_nys-textarea-outline-color--focus)}.nys-textarea__textarea:disabled,.nys-textarea__textarea:disabled::placeholder{background-color:var(--_nys-textarea-background-color--disabled);border-color:var(--_nys-textarea-border-color--disabled);color:var(--_nys-textarea-color--disabled);cursor:not-allowed}';
129
+ var E = Object.defineProperty, s = (o, e, t, n) => {
108
130
  for (var i = void 0, l = o.length - 1, d; l >= 0; l--)
109
131
  (d = o[l]) && (i = d(e, t, i) || i);
110
- return i && V(e, t, i), i;
132
+ return i && E(e, t, i), i;
111
133
  };
112
- const c = class c extends $ {
134
+ const u = class u extends S {
113
135
  constructor() {
114
136
  super(...arguments), this.id = "", this.name = "", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.tooltip = "", this.inverted = !1, this.form = null, this.maxlength = null, this.width = "full", this.rows = 4, this.resize = "vertical", this.showError = !1, this.errorMessage = "", this.ariaLabel = "", this._hasUserInteracted = !1;
115
137
  }
@@ -129,10 +151,13 @@ const c = class c extends $ {
129
151
  firstUpdated() {
130
152
  this._setValue();
131
153
  }
154
+ willUpdate(e) {
155
+ e.has("rows") && this.rows == null && (this.rows = 4);
156
+ }
132
157
  async updated(e) {
133
- if (await Promise.resolve(), e.has("value") && this._setValue(), e.has("rows") && (this.rows = this.rows ?? 4), e.has("readonly") || e.has("required")) {
158
+ if (await Promise.resolve(), e.has("value") && this._setValue(), e.has("readonly") || e.has("required")) {
134
159
  const t = this.shadowRoot?.querySelector("textarea");
135
- t && (t.required = this.required && !this.readonly);
160
+ t && (t.required = this.required && !this.readonly), this._manageRequire();
136
161
  }
137
162
  }
138
163
  /**
@@ -145,12 +170,19 @@ const c = class c extends $ {
145
170
  _manageRequire() {
146
171
  const e = this.shadowRoot?.querySelector("textarea");
147
172
  if (!e) return;
148
- const t = this.errorMessage || "This field is required";
149
- this.required && !this.value ? this.setValidityFromState({ valueMissing: !0 }, t, e) : (this.clearValidity(), this._hasUserInteracted = !1);
173
+ this.required && !this.value ? (this.internalValidationMessage = "This field is required", this.setValidityFromState(
174
+ { valueMissing: !0 },
175
+ this.resolvedErrorMessage(),
176
+ e
177
+ )) : (this.internalValidationMessage = "", this.clearValidity(), this._hasUserInteracted = !1);
150
178
  }
151
179
  _setValidityMessage(e = "") {
152
180
  const t = this.shadowRoot?.querySelector("textarea");
153
- t && (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), e ? this.setValidityFromState({ customError: !0 }, e, t) : this.clearValidity());
181
+ t && (this.showError = !!e, this.internalValidationMessage = e, e ? this.setValidityFromState(
182
+ { customError: !0 },
183
+ this.resolvedErrorMessage(),
184
+ t
185
+ ) : this.clearValidity());
154
186
  }
155
187
  _validate() {
156
188
  const e = this.shadowRoot?.querySelector("textarea");
@@ -162,7 +194,7 @@ const c = class c extends $ {
162
194
  formResetCallback() {
163
195
  this.value = "";
164
196
  const e = this.shadowRoot?.querySelector("textarea");
165
- e && (e.value = "", e.setAttribute("aria-invalid", "false")), this.showError = !1, this.clearValidity(), this.requestUpdate();
197
+ e && (e.value = "", e.setAttribute("aria-invalid", "false")), this.showError = !1, this.internalValidationMessage = "", this.clearValidity(), this.requestUpdate();
166
198
  }
167
199
  /**
168
200
  * Functions
@@ -190,48 +222,49 @@ const c = class c extends $ {
190
222
  // Handle input event to check pattern validity
191
223
  _handleInput(e) {
192
224
  const t = e.target;
193
- this.value = t.value, this.setFormValue(this.value), this._hasUserInteracted && this._validate(), this.dispatchEvent(
194
- new CustomEvent("nys-input", {
195
- detail: { id: this.id, value: this.value },
196
- bubbles: !0,
197
- composed: !0
198
- })
199
- );
225
+ this.value = t.value, this.setFormValue(this.value), this._hasUserInteracted && this._validate(), c(this, "nys-input", {
226
+ id: this.id,
227
+ name: this.name,
228
+ value: this.value
229
+ });
230
+ }
231
+ // Handle native change (value committed on blur after edits)
232
+ _handleChange(e) {
233
+ const t = e.target;
234
+ this.value = t.value, c(this, "nys-change", {
235
+ id: this.id,
236
+ name: this.name,
237
+ value: this.value
238
+ });
200
239
  }
201
240
  // Handle focus event
202
241
  _handleFocus() {
203
- this.dispatchEvent(
204
- new Event("nys-focus", { bubbles: !0, composed: !0 })
205
- );
242
+ v(this, "focus");
206
243
  }
207
244
  // Handle blur event
208
245
  _handleBlur() {
209
- this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this.dispatchEvent(
210
- new Event("nys-blur", { bubbles: !0, composed: !0 })
211
- );
246
+ this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), v(this, "blur");
212
247
  }
213
248
  _handleSelect(e) {
214
249
  const t = e.target;
215
- this.value = t.value, this.dispatchEvent(
216
- new CustomEvent("nys-select", {
217
- detail: { id: this.id, value: this.value },
218
- bubbles: !0,
219
- composed: !0
220
- })
221
- );
250
+ this.value = t.value, c(this, "nys-select", {
251
+ id: this.id,
252
+ value: this.value
253
+ });
222
254
  }
223
255
  _handleSelectionChange(e) {
224
256
  const t = e.target;
225
- this.value = t.value, this.dispatchEvent(
226
- new CustomEvent("nys-selectionchange", {
227
- detail: { id: this.id, value: this.value },
228
- bubbles: !0,
229
- composed: !0
230
- })
257
+ this.value = t.value, c(
258
+ this,
259
+ "nys-selectionchange",
260
+ {
261
+ id: this.id,
262
+ value: this.value
263
+ }
231
264
  );
232
265
  }
233
266
  render() {
234
- return f`
267
+ return x`
235
268
  <div class="nys-textarea">
236
269
  <nys-label
237
270
  id="${this.id}--label"
@@ -272,6 +305,7 @@ const c = class c extends $ {
272
305
  .rows=${this.rows}
273
306
  form=${h(this.form || void 0)}
274
307
  @input=${this._handleInput}
308
+ @change=${this._handleChange}
275
309
  @focus="${this._handleFocus}"
276
310
  @blur="${this._handleBlur}"
277
311
  @select="${this._handleSelect}"
@@ -280,79 +314,79 @@ const c = class c extends $ {
280
314
  <nys-errormessage
281
315
  id=${this.id + "--error"}
282
316
  ?showError=${this.showError}
283
- errorMessage=${this.internals.validationMessage || this.errorMessage}
317
+ errorMessage=${this.resolvedErrorMessage()}
284
318
  ></nys-errormessage>
285
319
  </div>
286
320
  `;
287
321
  }
288
322
  };
289
- c.styles = v(S), c.shadowRootOptions = {
290
- ...p.shadowRootOptions,
323
+ u.styles = _(q), u.shadowRootOptions = {
324
+ ...f.shadowRootOptions,
291
325
  delegatesFocus: !0
292
326
  };
293
- let r = c;
327
+ let a = u;
294
328
  s([
295
- a({ type: String, reflect: !0 })
296
- ], r.prototype, "id");
329
+ r({ type: String, reflect: !0 })
330
+ ], a.prototype, "id");
297
331
  s([
298
- a({ type: String, reflect: !0 })
299
- ], r.prototype, "name");
332
+ r({ type: String, reflect: !0 })
333
+ ], a.prototype, "name");
300
334
  s([
301
- a({ type: String })
302
- ], r.prototype, "label");
335
+ r({ type: String })
336
+ ], a.prototype, "label");
303
337
  s([
304
- a({ type: String })
305
- ], r.prototype, "description");
338
+ r({ type: String })
339
+ ], a.prototype, "description");
306
340
  s([
307
- a({ type: String })
308
- ], r.prototype, "placeholder");
341
+ r({ type: String })
342
+ ], a.prototype, "placeholder");
309
343
  s([
310
- a({ type: String })
311
- ], r.prototype, "value");
344
+ r({ type: String })
345
+ ], a.prototype, "value");
312
346
  s([
313
- a({ type: Boolean, reflect: !0 })
314
- ], r.prototype, "disabled");
347
+ r({ type: Boolean, reflect: !0 })
348
+ ], a.prototype, "disabled");
315
349
  s([
316
- a({ type: Boolean, reflect: !0 })
317
- ], r.prototype, "readonly");
350
+ r({ type: Boolean, reflect: !0 })
351
+ ], a.prototype, "readonly");
318
352
  s([
319
- a({ type: Boolean, reflect: !0 })
320
- ], r.prototype, "required");
353
+ r({ type: Boolean, reflect: !0 })
354
+ ], a.prototype, "required");
321
355
  s([
322
- a({ type: Boolean, reflect: !0 })
323
- ], r.prototype, "optional");
356
+ r({ type: Boolean, reflect: !0 })
357
+ ], a.prototype, "optional");
324
358
  s([
325
- a({ type: String })
326
- ], r.prototype, "tooltip");
359
+ r({ type: String })
360
+ ], a.prototype, "tooltip");
327
361
  s([
328
- a({ type: Boolean, reflect: !0 })
329
- ], r.prototype, "inverted");
362
+ r({ type: Boolean, reflect: !0 })
363
+ ], a.prototype, "inverted");
330
364
  s([
331
- a({ type: String, reflect: !0 })
332
- ], r.prototype, "form");
365
+ r({ type: String, reflect: !0 })
366
+ ], a.prototype, "form");
333
367
  s([
334
- a({ type: Number })
335
- ], r.prototype, "maxlength");
368
+ r({ type: Number })
369
+ ], a.prototype, "maxlength");
336
370
  s([
337
- a({ type: String, reflect: !0 })
338
- ], r.prototype, "width");
371
+ r({ type: String, reflect: !0 })
372
+ ], a.prototype, "width");
339
373
  s([
340
- a({ type: Number })
341
- ], r.prototype, "rows");
374
+ r({ type: Number })
375
+ ], a.prototype, "rows");
342
376
  s([
343
- a({ type: String, reflect: !0 })
344
- ], r.prototype, "resize");
377
+ r({ type: String, reflect: !0 })
378
+ ], a.prototype, "resize");
345
379
  s([
346
- a({ type: Boolean, reflect: !0 })
347
- ], r.prototype, "showError");
380
+ r({ type: Boolean, reflect: !0 })
381
+ ], a.prototype, "showError");
348
382
  s([
349
- a({ type: String })
350
- ], r.prototype, "errorMessage");
383
+ r({ type: String })
384
+ ], a.prototype, "errorMessage");
351
385
  s([
352
- a({ type: String })
353
- ], r.prototype, "ariaLabel");
354
- customElements.get("nys-textarea") || customElements.define("nys-textarea", r);
386
+ r({ type: String })
387
+ ], a.prototype, "ariaLabel");
388
+ customElements.get("nys-textarea") || customElements.define("nys-textarea", a);
355
389
  export {
356
- r as NysTextarea
390
+ a as NysTextarea
357
391
  };
358
392
  //# sourceMappingURL=nys-textarea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nys-textarea.js","sources":["../../internals/dist/index.js","../src/nys-textarea.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.21.1\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, A = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction R(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction _(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction E(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction V(e, t, n) {\n const i = d(n), r = _(t);\n i.length ? e.setAttribute(r, E(i).join(\" \")) : e.removeAttribute(r);\n}\nfunction x(e, t, n, i, r) {\n const s = d(i), a = p[n], l = t;\n if (a && R(t)) {\n l[a] = s.length ? s : null;\n return;\n }\n const o = A[n];\n if (!o) return;\n const c = r ?? (s.length ? s.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst g = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, n) {\n const i = d(n), r = g[t], s = C[t], a = e;\n if (r && r in e && (a[r] = i.length ? i : null), !s) return;\n const l = i.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(s, l) : e.removeAttribute(s);\n}\nconst b = (e) => {\n class t extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return t;\n}, P = /* @__PURE__ */ b(u), h = (e) => {\n class t extends b(e) {\n constructor() {\n super(...arguments), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\")\n try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(i, r) {\n const s = this.internals;\n if (s && i in s) {\n s[i] = r;\n return;\n }\n const a = v(i);\n r === null ? this.removeAttribute(a) : this.setAttribute(a, r);\n }\n reflectDefaultSemantics() {\n const i = this.defaultRole;\n i && this.setHostAria(\"role\", i);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return t;\n};\nfunction v(e) {\n if (e === \"role\") return \"role\";\n const t = e.replace(/^aria/, \"\");\n return \"aria-\" + t.charAt(0).toLowerCase() + t.slice(1);\n}\nconst T = /* @__PURE__ */ h(u), I = (e) => {\n const n = class n extends h(e) {\n setFormValue(r) {\n this.internals?.setFormValue(r ?? null);\n }\n setValidityFromState(r, s, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(r).some(Boolean);\n o ? l.setValidity(r, s ?? \"Invalid value\", a) : l.setValidity({}), this.setHostAria(\"ariaInvalid\", o ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.clearValidity();\n }\n };\n n.formAssociated = !0;\n let t = n;\n return t;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const t = e.tagName.toLowerCase(), n = /* @__PURE__ */ new Set(), i = (r) => {\n r.querySelectorAll(\"*\").forEach((s) => {\n const a = s.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && n.add(a), s.shadowRoot && i(s.shadowRoot);\n });\n };\n return e.shadowRoot && i(e.shadowRoot), i(e), [...n].sort();\n}\nexport {\n I as FormControlMixin,\n b as IdentifiedMixin,\n P as NysElement,\n w as NysFormControlElement,\n T as NysReflectsAriaElement,\n h as ReflectsAriaMixin,\n V as associateControl,\n L as associateControlRefs,\n x as associateHost,\n O as findUnregisteredChildren,\n f as generateId,\n R as supportsElementRefs\n};\n//# sourceMappingURL=index.js.map\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { NysFormControlElement } from \"@nysds/internals\";\n// These internal elements are rendered inside this component's shadow DOM, so\n// they must be registered whenever nys-textarea is used. Importing them here\n// (intentional side effect) guarantees the visible label and error message —\n// which the accessible name/error association depends on — always render.\nimport \"@nysds/nys-label\";\nimport \"@nysds/nys-errormessage\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-textarea.scss?inline\";\n\n/**\n * A multi-line text input for collecting longer responses like comments, descriptions, or feedback.\n * Form-associated with validation support via ElementInternals.\n *\n * Use for detailed responses needing multiple lines. For single-line input, use `nys-textinput`.\n * For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.\n *\n * @summary Multi-line text input for comments, descriptions, and feedback.\n * @element nys-textarea\n *\n * @slot description - Custom HTML description content below the label.\n *\n * @fires nys-input - Fired on input change. Detail: `{id, value}`.\n * @fires nys-focus - Fired when textarea gains focus.\n * @fires nys-blur - Fired when textarea loses focus. Triggers validation.\n * @fires nys-select - Fired when user selects text. Detail: `{id, value}`.\n *\n * @example Basic\n * ```html\n * <nys-textarea label=\"Comments\"></nys-textarea>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-textarea label=\"Comments\" disabled></nys-textarea>\n * ```\n *\n * @example Readonly\n * ```html\n * <nys-textarea label=\"Comments\" readonly value=\"You can see me but not edit me\"></nys-textarea>\n * ```\n *\n * @example Required\n * ```html\n * <nys-textarea label=\"Describe the incident\" required></nys-textarea>\n * ```\n *\n * @example Optional\n * ```html\n * <nys-textarea label=\"Comments\" optional></nys-textarea>\n * ```\n *\n * @example Max length\n * ```html\n * <nys-textarea label=\"Comments\" maxlength=\"100\"></nys-textarea>\n * ```\n *\n * @example Width Small\n * ```html\n * <nys-textarea label=\"Comments\" width=\"sm\"></nys-textarea>\n * ```\n *\n * @example Width Medium\n * ```html\n * <nys-textarea label=\"Comments\" width=\"md\"></nys-textarea>\n * ```\n *\n * @example Width Large\n * ```html\n * <nys-textarea label=\"Comments\" width=\"lg\"></nys-textarea>\n * ```\n *\n * @example Description\n * ```html\n * <nys-textarea label=\"Describe the incident\" description=\"Please provide details\"></nys-textarea>\n * ```\n *\n * @example Description Slot\n * ```html\n * <nys-textarea label=\"Describe the incident\">\n * <div slot=\"description\">Please provide details</div>\n * </nys-textarea>\n * ```\n */\n\nexport class NysTextarea extends NysFormControlElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name for form submission. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Visible label text. Required for accessibility. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Placeholder text. Don't use as label replacement. */\n @property({ type: String }) placeholder = \"\";\n\n /** Current textarea value. */\n @property({ type: String }) value = \"\";\n\n /** Prevents interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes textarea readonly but focusable. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Marks as required. Shows \"Required\" flag and validates on blur. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Shows \"Optional\" flag. Use when most fields are required. */\n @property({ type: Boolean, reflect: true }) optional = false;\n\n /** Tooltip text shown on hover/focus of info icon. */\n @property({ type: String }) tooltip = \"\";\n\n /** Adjusts colors for dark backgrounds. */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n /** Form `id` to associate with when textarea is outside form element. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /** Maximum character length. */\n @property({ type: Number }) maxlength: number | null = null;\n\n /**\n * Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).\n * @default \"full\"\n */\n @property({ type: String, reflect: true }) width:\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"full\" = \"full\";\n\n /**\n * Visible height in lines.\n * @default 4\n */\n @property({ type: Number }) rows = 4;\n\n /**\n * Resize behavior: `vertical` (default, user can resize height), `none` (fixed size).\n * @default \"vertical\"\n */\n @property({ type: String, reflect: true }) resize: \"vertical\" | \"none\" =\n \"vertical\";\n\n /** Shows error message when true. Set by validation or manually. */\n @property({ type: Boolean, reflect: true }) showError = false;\n\n /** Error message text. Shown only when `showError` is true. */\n @property({ type: String }) errorMessage = \"\";\n\n /** Accessible label used only when no visible `label` is provided. */\n @property({ type: String }) ariaLabel = \"\";\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n * Form association, ElementInternals, and id generation are provided by\n * NysFormControlElement (@nysds/internals).\n */\n\n connectedCallback() {\n // super.connectedCallback() (NysFormControlElement) assigns an id when one\n // is not provided and reflects default semantics.\n super.connectedCallback();\n this.addEventListener(\"invalid\", this._handleInvalid);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n }\n\n firstUpdated() {\n // This ensures our element always participates in the form\n this._setValue();\n }\n\n async updated(changedProperties: Map<string | number | symbol, unknown>) {\n await Promise.resolve();\n\n if (changedProperties.has(\"value\")) {\n this._setValue();\n }\n if (changedProperties.has(\"rows\")) {\n this.rows = this.rows ?? 4;\n }\n if (\n changedProperties.has(\"readonly\") ||\n changedProperties.has(\"required\")\n ) {\n const input = this.shadowRoot?.querySelector(\"textarea\");\n\n if (input) input.required = this.required && !this.readonly;\n }\n }\n\n /**\n * Form Integration\n * --------------------------------------------------------------------------\n */\n\n private _setValue() {\n this.setFormValue(this.value);\n this._manageRequire();\n }\n\n private _manageRequire() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n\n if (!textarea) return;\n\n const message = this.errorMessage || \"This field is required\";\n const isInvalid = this.required && !this.value;\n\n if (isInvalid) {\n this.setValidityFromState({ valueMissing: true }, message, textarea);\n } else {\n this.clearValidity();\n this._hasUserInteracted = false; // Reset lazy validation when valid\n }\n }\n\n private _setValidityMessage(message: string = \"\") {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Toggle the HTML <div> tag error message\n this.showError = !!message;\n // If user sets errorMessage, this will always override the native validation message\n if (this.errorMessage?.trim() && message !== \"\") {\n message = this.errorMessage;\n }\n\n if (message) {\n this.setValidityFromState({ customError: true }, message, textarea);\n } else {\n this.clearValidity();\n }\n }\n\n private _validate() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Get the native validation state\n let message = textarea.validationMessage;\n\n this._setValidityMessage(message);\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetCallback() {\n this.value = \"\";\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n textarea.value = \"\";\n textarea.setAttribute(\"aria-invalid\", \"false\");\n }\n\n // Reset validation UI\n this.showError = false;\n this.clearValidity();\n\n // Re-render UI\n this.requestUpdate();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // This helper function is called to perform the element's native validation.\n checkValidity(): boolean {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n return textarea ? textarea.checkValidity() : true;\n }\n\n private _handleInvalid(event: Event) {\n event.preventDefault();\n this._hasUserInteracted = true; // Start aggressive mode due to form submission\n this._validate();\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this.internals?.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n textarea.focus();\n }\n } else {\n // If not part of a form, simply focus.\n textarea.focus();\n }\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n // Handle input event to check pattern validity\n private _handleInput(event: Event) {\n const textarea = event.target as HTMLInputElement;\n this.value = textarea.value;\n this.setFormValue(this.value);\n\n // Field is invalid after unfocused, validate aggressively on each input (e.g. Eager mode: a combination of aggressive and lazy.)\n if (this._hasUserInteracted) {\n this._validate();\n }\n\n this.dispatchEvent(\n new CustomEvent(\"nys-input\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Handle focus event\n private _handleFocus() {\n this.dispatchEvent(\n new Event(\"nys-focus\", { bubbles: true, composed: true }),\n );\n }\n\n // Handle blur event\n private _handleBlur() {\n if (!this._hasUserInteracted) {\n this._hasUserInteracted = true; // At initial unfocus: if textarea is invalid, start aggressive mode\n }\n\n this._validate();\n this.dispatchEvent(\n new Event(\"nys-blur\", { bubbles: true, composed: true }),\n );\n }\n\n private _handleSelect(e: Event) {\n const select = e.target as HTMLSelectElement;\n this.value = select.value;\n this.dispatchEvent(\n new CustomEvent(\"nys-select\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleSelectionChange(e: Event) {\n const select = e.target as HTMLSelectElement;\n this.value = select.value;\n this.dispatchEvent(\n new CustomEvent(\"nys-selectionchange\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n render() {\n return html`\n <div class=\"nys-textarea\">\n <nys-label\n id=\"${this.id}--label\"\n label=${this.label}\n description=${this.description}\n flag=${this.required && !this.readonly\n ? \"required\"\n : this.optional\n ? \"optional\"\n : \"\"}\n tooltip=${this.tooltip}\n ?inverted=${this.inverted}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <textarea\n class=\"nys-textarea__textarea ${this.resize}\"\n name=${this.name}\n id=${this.id}\n .value=${this.value}\n ?disabled=${this.disabled}\n ?required=${this.required && !this.readonly}\n ?readonly=${this.readonly}\n aria-disabled=${ifDefined(this.disabled ? \"true\" : undefined)}\n aria-required=${ifDefined(this.required ? \"true\" : undefined)}\n aria-labelledby=${ifDefined(\n this.label ? this.id + \"--label\" : undefined,\n )}\n aria-label=${ifDefined(\n !this.label && this.ariaLabel ? this.ariaLabel : undefined,\n )}\n aria-description=${ifDefined(this.description || undefined)}\n aria-invalid=${this.showError ? \"true\" : \"false\"}\n aria-errormessage=${this.id + \"--error\"}\n aria-describedby=${ifDefined(\n this.showError ? this.id + \"--error\" : undefined,\n )}\n placeholder=${ifDefined(\n this.placeholder ? this.placeholder : undefined,\n )}\n maxlength=${ifDefined(this.maxlength ?? undefined)}\n .rows=${this.rows}\n form=${ifDefined(this.form || undefined)}\n @input=${this._handleInput}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @select=\"${this._handleSelect}\"\n @selectionchange=\"${this._handleSelectionChange}\"\n ></textarea>\n <nys-errormessage\n id=${this.id + \"--error\"}\n ?showError=${this.showError}\n errorMessage=${this.internals!.validationMessage || this.errorMessage}\n ></nys-errormessage>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-textarea\")) {\n customElements.define(\"nys-textarea\", NysTextarea);\n}\n"],"names":["LitElement","unsafeCSS","html","property","ifDefined","y","f","e","t","h","i","r","s","a","v","I","n","l","o","w","u","_NysTextarea","NysFormControlElement","changedProperties","input","textarea","message","event","form","element","select","styles","NysTextarea","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF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CiB,WAAA,SAAA;AAGgBC,EAAA;AAAA,EAA3C9B,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzC/B6B,EAyCiC,WAAA,UAAA;AAGDC,EAAA;AAAA,EAA1C9B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA5C9B6B,EA4CgC,WAAA,MAAA;AAGfC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Cf6B,EA+CiB,WAAA,WAAA;AAMeC,EAAA;AAAA,EAA1C9B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArD9B6B,EAqDgC,WAAA,OAAA;AAUfC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Df6B,EA+DiB,WAAA,MAAA;AAMeC,EAAA;AAAA,EAA1C9B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArE9B6B,EAqEgC,WAAA,QAAA;AAICC,EAAA;AAAA,EAA3C9B,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzE/B6B,EAyEiC,WAAA,WAAA;AAGhBC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5Ef6B,EA4EiB,WAAA,cAAA;AAGAC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/Ef6B,EA+EiB,WAAA,WAAA;AAgSzB,eAAe,IAAI,cAAc,KACpC,eAAe,OAAO,gBAAgBA,CAAW;"}
1
+ {"version":3,"file":"nys-textarea.js","sources":["../../internals/dist/index.js","../src/nys-textarea.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.22.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nfunction N(e, t, s) {\n e.dispatchEvent(\n new CustomEvent(t, { detail: s, bubbles: !0, composed: !0 })\n );\n}\nfunction I(e, t) {\n e.dispatchEvent(\n new Event(`nys-${t}`, { bubbles: !0, composed: !0 })\n );\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, g = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction _(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction E(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction A(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction w(e, t, s) {\n const n = d(s), i = E(t);\n n.length ? e.setAttribute(i, A(n).join(\" \")) : e.removeAttribute(i);\n}\nfunction x(e, t, s, n, i) {\n const r = d(n), a = p[s], l = t;\n if (a && _(t)) {\n l[a] = r.length ? r : null;\n return;\n }\n const o = g[s];\n if (!o) return;\n const c = i ?? (r.length ? r.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst R = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, V = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, s) {\n const n = d(s), i = R[t], r = V[t], a = e;\n if (i && i in e && (a[i] = n.length ? n : null), !r) return;\n const l = n.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(r, l) : e.removeAttribute(r);\n}\nconst h = (e) => {\n class t extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return t;\n}, P = /* @__PURE__ */ h(u), b = (e) => {\n class t extends h(e) {\n constructor() {\n super(...arguments), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\")\n try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(n, i) {\n const r = this.internals;\n if (r && n in r) {\n r[n] = i;\n return;\n }\n const a = v(n);\n i === null ? this.removeAttribute(a) : this.setAttribute(a, i);\n }\n reflectDefaultSemantics() {\n const n = this.defaultRole;\n n && this.setHostAria(\"role\", n);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return t;\n};\nfunction v(e) {\n if (e === \"role\") return \"role\";\n const t = e.replace(/^aria/, \"\");\n return \"aria-\" + t.charAt(0).toLowerCase() + t.slice(1);\n}\nconst T = /* @__PURE__ */ b(u), C = (e) => {\n const s = class s extends b(e) {\n constructor() {\n super(...arguments), this.__internalValidationMessage = \"\";\n }\n get internalValidationMessage() {\n return this.__internalValidationMessage;\n }\n set internalValidationMessage(i) {\n i !== this.__internalValidationMessage && (this.__internalValidationMessage = i, this.requestUpdate(\"internalValidationMessage\"));\n }\n resolvedErrorMessage() {\n return this.errorMessage || this.internalValidationMessage;\n }\n setFormValue(i) {\n this.internals?.setFormValue(i ?? null);\n }\n setValidityFromState(i, r, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(i).some(Boolean);\n o ? l.setValidity(i, r ?? \"Invalid value\", a) : l.setValidity({}), this.setHostAria(\"ariaInvalid\", o ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.internalValidationMessage = \"\", this.clearValidity();\n }\n };\n s.formAssociated = !0;\n let t = s;\n return t;\n}, O = /* @__PURE__ */ C(u);\nfunction B(e) {\n const t = e.tagName.toLowerCase(), s = /* @__PURE__ */ new Set(), n = (i) => {\n i.querySelectorAll(\"*\").forEach((r) => {\n const a = r.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && s.add(a), r.shadowRoot && n(r.shadowRoot);\n });\n };\n return e.shadowRoot && n(e.shadowRoot), n(e), [...s].sort();\n}\nexport {\n C as FormControlMixin,\n h as IdentifiedMixin,\n P as NysElement,\n O as NysFormControlElement,\n T as NysReflectsAriaElement,\n b as ReflectsAriaMixin,\n w as associateControl,\n L as associateControlRefs,\n x as associateHost,\n N as dispatchNysEvent,\n I as dispatchNysFocusBlur,\n B as findUnregisteredChildren,\n f as generateId,\n _ as supportsElementRefs\n};\n//# sourceMappingURL=index.js.map\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport {\n NysFormControlElement,\n dispatchNysEvent,\n dispatchNysFocusBlur,\n} from \"@nysds/internals\";\n// These internal elements are rendered inside this component's shadow DOM, so\n// they must be registered whenever nys-textarea is used. Importing them here\n// (intentional side effect) guarantees the visible label and error message —\n// which the accessible name/error association depends on — always render.\nimport \"@nysds/nys-label\";\nimport \"@nysds/nys-errormessage\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-textarea.scss?inline\";\n\n/** Detail payload for the `nys-input` event. */\nexport interface NysTextareaInputDetail {\n id: string;\n name: string;\n value: string;\n}\n\n/** The `nys-input` event, fired on each keystroke. */\nexport type NysTextareaInputEvent = CustomEvent<NysTextareaInputDetail>;\n\n/** Detail payload for the `nys-change` event. */\nexport interface NysTextareaChangeDetail {\n id: string;\n name: string;\n value: string;\n}\n\n/** The `nys-change` event, fired when the value is committed. */\nexport type NysTextareaChangeEvent = CustomEvent<NysTextareaChangeDetail>;\n\n/** Detail payload for the `nys-select` event. */\nexport interface NysTextareaSelectDetail {\n id: string;\n value: string;\n}\n\n/** The `nys-select` event, fired when the user selects text. */\nexport type NysTextareaSelectEvent = CustomEvent<NysTextareaSelectDetail>;\n\n/** Detail payload for the `nys-selectionchange` event. */\nexport interface NysTextareaSelectionchangeDetail {\n id: string;\n value: string;\n}\n\n/** The `nys-selectionchange` event, fired when the text selection changes. */\nexport type NysTextareaSelectionchangeEvent =\n CustomEvent<NysTextareaSelectionchangeDetail>;\n\n/**\n * A multi-line text input for collecting longer responses like comments, descriptions, or feedback.\n * Form-associated with validation support via ElementInternals.\n *\n * Use for detailed responses needing multiple lines. For single-line input, use `nys-textinput`.\n * For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.\n *\n * @summary Multi-line text input for comments, descriptions, and feedback.\n * @element nys-textarea\n *\n * @slot description - Custom HTML description content below the label.\n *\n * @formControl value nys-change nys-input\n *\n * @fires {NysTextareaInputEvent} nys-input - Fired on each input. Detail: `{id, name, value}`.\n * @fires {NysTextareaChangeEvent} nys-change - Fired when the value is committed (native `change`). Detail: `{id, name, value}`.\n * @fires {Event} nys-focus - Fired when the textarea gains focus.\n * @fires {Event} nys-blur - Fired when the textarea loses focus. Triggers validation.\n * @fires {NysTextareaSelectEvent} nys-select - Fired when the user selects text. Detail: `{id, value}`.\n * @fires {NysTextareaSelectionchangeEvent} nys-selectionchange - Fired when the text selection changes. Detail: `{id, value}`.\n *\n * @usagedos\n * - Use to collect multiple lines of open-ended text input (e.g., comments, descriptions, feedback).\n *\n * @usagedonts\n * - Use for short or single-line input. Use `<nys-textinput>` instead.\n * - Use when input should be selected from predefined options. Use `<nys-select>`, `<nys-radiobutton>`, or `<nys-checkbox>` instead.\n *\n * @example Basic\n * ```html\n * <nys-textarea label=\"Comments\"></nys-textarea>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-textarea label=\"Comments\" disabled></nys-textarea>\n * ```\n *\n * @example Readonly\n * ```html\n * <nys-textarea label=\"Comments\" readonly value=\"You can see me but not edit me\"></nys-textarea>\n * ```\n *\n * @example Required\n * ```html\n * <nys-textarea label=\"Describe the incident\" required></nys-textarea>\n * ```\n *\n * @example Optional\n * ```html\n * <nys-textarea label=\"Comments\" optional></nys-textarea>\n * ```\n *\n * @example Max length\n * ```html\n * <nys-textarea label=\"Comments\" maxlength=\"100\"></nys-textarea>\n * ```\n *\n * @example Width Small\n * ```html\n * <nys-textarea label=\"Comments\" width=\"sm\"></nys-textarea>\n * ```\n *\n * @example Width Medium\n * ```html\n * <nys-textarea label=\"Comments\" width=\"md\"></nys-textarea>\n * ```\n *\n * @example Width Large\n * ```html\n * <nys-textarea label=\"Comments\" width=\"lg\"></nys-textarea>\n * ```\n *\n * @example Description\n * ```html\n * <nys-textarea label=\"Describe the incident\" description=\"Please provide details\"></nys-textarea>\n * ```\n *\n * @example Description Slot\n * ```html\n * <nys-textarea label=\"Describe the incident\">\n * <div slot=\"description\">Please provide details</div>\n * </nys-textarea>\n * ```\n */\n\nexport class NysTextarea extends NysFormControlElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name for form submission. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Visible label text. Required for accessibility. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Placeholder text. Don't use as label replacement. */\n @property({ type: String }) placeholder = \"\";\n\n /** Current textarea value. */\n @property({ type: String }) value = \"\";\n\n /** Prevents interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes textarea readonly but focusable. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Marks as required. Shows \"Required\" flag and validates on blur. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Shows \"Optional\" flag. Use when most fields are required. */\n @property({ type: Boolean, reflect: true }) optional = false;\n\n /** Tooltip text shown on hover/focus of info icon. */\n @property({ type: String }) tooltip = \"\";\n\n /** Adjusts colors for dark backgrounds. */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n /** Form `id` to associate with when textarea is outside form element. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /** Maximum character length. */\n @property({ type: Number }) maxlength: number | null = null;\n\n /**\n * Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).\n * @default \"full\"\n */\n @property({ type: String, reflect: true }) width:\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"full\" = \"full\";\n\n /**\n * Visible height in lines.\n * @default 4\n */\n @property({ type: Number }) rows = 4;\n\n /**\n * Resize behavior: `vertical` (default, user can resize height), `none` (fixed size).\n * @default \"vertical\"\n */\n @property({ type: String, reflect: true }) resize: \"vertical\" | \"none\" =\n \"vertical\";\n\n /** Shows error message when true. Set by validation or manually. */\n @property({ type: Boolean, reflect: true }) showError = false;\n\n /** Error message text. Shown only when `showError` is true. */\n @property({ type: String }) errorMessage = \"\";\n\n /** Accessible label used only when no visible `label` is provided. */\n @property({ type: String }) ariaLabel = \"\";\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n * Form association, ElementInternals, and id generation are provided by\n * NysFormControlElement (@nysds/internals).\n */\n\n connectedCallback() {\n // super.connectedCallback() (NysFormControlElement) assigns an id when one\n // is not provided and reflects default semantics.\n super.connectedCallback();\n this.addEventListener(\"invalid\", this._handleInvalid);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n }\n\n firstUpdated() {\n // This ensures our element always participates in the form\n this._setValue();\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has(\"rows\") && this.rows == null) {\n this.rows = 4;\n }\n }\n\n async updated(changedProperties: Map<string | number | symbol, unknown>) {\n await Promise.resolve();\n\n if (changedProperties.has(\"value\")) {\n this._setValue();\n }\n if (\n changedProperties.has(\"readonly\") ||\n changedProperties.has(\"required\")\n ) {\n const input = this.shadowRoot?.querySelector(\"textarea\");\n\n if (input) input.required = this.required && !this.readonly;\n\n // Re-sync ElementInternals, not just the shadow <textarea>: `required`\n // can arrive as a late property write (e.g. a framework wrapper\n // setting it post-hydration, after firstUpdated already ran\n // _setValue()/_manageRequire() once against the old value). Without\n // this, ElementInternals keeps reporting valid, the native `invalid`\n // event never fires on submit, and showError never flips even though\n // the field is genuinely required and empty.\n this._manageRequire();\n }\n }\n\n /**\n * Form Integration\n * --------------------------------------------------------------------------\n */\n\n private _setValue() {\n this.setFormValue(this.value);\n this._manageRequire();\n }\n\n private _manageRequire() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n\n if (!textarea) return;\n\n const isInvalid = this.required && !this.value;\n\n if (isInvalid) {\n this.internalValidationMessage = \"This field is required\";\n this.setValidityFromState(\n { valueMissing: true },\n this.resolvedErrorMessage(),\n textarea,\n );\n } else {\n this.internalValidationMessage = \"\";\n this.clearValidity();\n this._hasUserInteracted = false; // Reset lazy validation when valid\n }\n }\n\n private _setValidityMessage(message: string = \"\") {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Toggle the HTML <div> tag error message\n this.showError = !!message;\n // Store the component's own validation text; a consumer-supplied\n // errorMessage always wins via resolvedErrorMessage().\n this.internalValidationMessage = message;\n\n if (message) {\n this.setValidityFromState(\n { customError: true },\n this.resolvedErrorMessage(),\n textarea,\n );\n } else {\n this.clearValidity();\n }\n }\n\n private _validate() {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (!textarea) return;\n\n // Get the native validation state\n let message = textarea.validationMessage;\n\n this._setValidityMessage(message);\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetCallback() {\n this.value = \"\";\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n textarea.value = \"\";\n textarea.setAttribute(\"aria-invalid\", \"false\");\n }\n\n // Reset validation UI. Clears only the component's own validation text;\n // a consumer-supplied errorMessage is never touched.\n this.showError = false;\n this.internalValidationMessage = \"\";\n this.clearValidity();\n\n // Re-render UI\n this.requestUpdate();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // This helper function is called to perform the element's native validation.\n checkValidity(): boolean {\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n return textarea ? textarea.checkValidity() : true;\n }\n\n private _handleInvalid(event: Event) {\n event.preventDefault();\n this._hasUserInteracted = true; // Start aggressive mode due to form submission\n this._validate();\n\n const textarea = this.shadowRoot?.querySelector(\"textarea\");\n if (textarea) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this.internals?.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n textarea.focus();\n }\n } else {\n // If not part of a form, simply focus.\n textarea.focus();\n }\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n // Handle input event to check pattern validity\n private _handleInput(event: Event) {\n const textarea = event.target as HTMLInputElement;\n this.value = textarea.value;\n this.setFormValue(this.value);\n\n // Field is invalid after unfocused, validate aggressively on each input (e.g. Eager mode: a combination of aggressive and lazy.)\n if (this._hasUserInteracted) {\n this._validate();\n }\n\n dispatchNysEvent<NysTextareaInputDetail>(this, \"nys-input\", {\n id: this.id,\n name: this.name,\n value: this.value,\n });\n }\n\n // Handle native change (value committed on blur after edits)\n private _handleChange(event: Event) {\n const textarea = event.target as HTMLTextAreaElement;\n this.value = textarea.value;\n dispatchNysEvent<NysTextareaChangeDetail>(this, \"nys-change\", {\n id: this.id,\n name: this.name,\n value: this.value,\n });\n }\n\n // Handle focus event\n private _handleFocus() {\n dispatchNysFocusBlur(this, \"focus\");\n }\n\n // Handle blur event\n private _handleBlur() {\n if (!this._hasUserInteracted) {\n this._hasUserInteracted = true; // At initial unfocus: if textarea is invalid, start aggressive mode\n }\n\n this._validate();\n dispatchNysFocusBlur(this, \"blur\");\n }\n\n private _handleSelect(e: Event) {\n const textarea = e.target as HTMLTextAreaElement;\n this.value = textarea.value;\n dispatchNysEvent<NysTextareaSelectDetail>(this, \"nys-select\", {\n id: this.id,\n value: this.value,\n });\n }\n\n private _handleSelectionChange(e: Event) {\n const textarea = e.target as HTMLTextAreaElement;\n this.value = textarea.value;\n dispatchNysEvent<NysTextareaSelectionchangeDetail>(\n this,\n \"nys-selectionchange\",\n {\n id: this.id,\n value: this.value,\n },\n );\n }\n\n render() {\n return html`\n <div class=\"nys-textarea\">\n <nys-label\n id=\"${this.id}--label\"\n label=${this.label}\n description=${this.description}\n flag=${this.required && !this.readonly\n ? \"required\"\n : this.optional\n ? \"optional\"\n : \"\"}\n tooltip=${this.tooltip}\n ?inverted=${this.inverted}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <textarea\n class=\"nys-textarea__textarea ${this.resize}\"\n name=${this.name}\n id=${this.id}\n .value=${this.value}\n ?disabled=${this.disabled}\n ?required=${this.required && !this.readonly}\n ?readonly=${this.readonly}\n aria-disabled=${ifDefined(this.disabled ? \"true\" : undefined)}\n aria-required=${ifDefined(this.required ? \"true\" : undefined)}\n aria-labelledby=${ifDefined(\n this.label ? this.id + \"--label\" : undefined,\n )}\n aria-label=${ifDefined(\n !this.label && this.ariaLabel ? this.ariaLabel : undefined,\n )}\n aria-description=${ifDefined(this.description || undefined)}\n aria-invalid=${this.showError ? \"true\" : \"false\"}\n aria-errormessage=${this.id + \"--error\"}\n aria-describedby=${ifDefined(\n this.showError ? this.id + \"--error\" : undefined,\n )}\n placeholder=${ifDefined(\n this.placeholder ? this.placeholder : undefined,\n )}\n maxlength=${ifDefined(this.maxlength ?? undefined)}\n .rows=${this.rows}\n form=${ifDefined(this.form || undefined)}\n @input=${this._handleInput}\n @change=${this._handleChange}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @select=\"${this._handleSelect}\"\n @selectionchange=\"${this._handleSelectionChange}\"\n ></textarea>\n <nys-errormessage\n id=${this.id + \"--error\"}\n ?showError=${this.showError}\n errorMessage=${this.resolvedErrorMessage()}\n ></nys-errormessage>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-textarea\")) {\n customElements.define(\"nys-textarea\", NysTextarea);\n}\n"],"names":["LitElement","unsafeCSS","html","property","ifDefined","y","f","e","N","t","s","I","h","b","r","a","v","C","l","o","O","u","_NysTextarea","NysFormControlElement","changedProperties","input","textarea","message","event","form","element","dispatchNysEvent","dispatchNysFocusBlur","styles","NysTextarea","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AACA,SAASG,EAAED,GAAGE,GAAGC,GAAG;AAClB,EAAAH,EAAE;AAAA,IACA,IAAI,YAAYE,GAAG,EAAE,QAAQC,GAAG,SAAS,IAAI,UAAU,GAAE,CAAE;AAAA,EAC/D;AACA;AACA,SAASC,EAAEJ,GAAGE,GAAG;AACf,EAAAF,EAAE;AAAA,IACA,IAAI,MAAM,OAAOE,CAAC,IAAI,EAAE,SAAS,IAAI,UAAU,GAAE,CAAE;AAAA,EACvD;AACA;AAqDK,MAACG,IAAI,CAACL,MAAM;AAAA,EACf,MAAME,UAAUF,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;AAAA,IACA,WAAW;AACT,WAAK,OAAO,KAAK,KAAKD,EAAE,KAAK,QAA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description": "The Textarea component from the NYS Design System.",
5
5
  "module": "dist/nys-textarea.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "import": "./dist/nys-textarea.js",
10
- "types": "./dist/index.d.ts"
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/nys-textarea.js"
11
11
  }
12
12
  },
13
13
  "type": "module",
@@ -23,12 +23,12 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.21.1",
27
- "@nysds/nys-label": "^1.21.1",
28
- "@nysds/nys-errormessage": "^1.21.1"
26
+ "@nysds/nys-icon": "^1.22.0",
27
+ "@nysds/nys-label": "^1.22.0",
28
+ "@nysds/nys-errormessage": "^1.22.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@nysds/internals": "^1.21.1",
31
+ "@nysds/internals": "^1.22.0",
32
32
  "lit": "^3.3.1",
33
33
  "typescript": "^5.9.3",
34
34
  "vite": "^7.3.1"