@nysds/nys-textarea 1.19.0 → 1.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nys-textarea.d.ts +123 -0
- package/dist/nys-textarea.js +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A multi-line text input for collecting longer responses like comments, descriptions, or feedback.
|
|
4
|
+
* Form-associated with validation support via ElementInternals.
|
|
5
|
+
*
|
|
6
|
+
* Use for detailed responses needing multiple lines. For single-line input, use `nys-textinput`.
|
|
7
|
+
* For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.
|
|
8
|
+
*
|
|
9
|
+
* @summary Multi-line text input for comments, descriptions, and feedback.
|
|
10
|
+
* @element nys-textarea
|
|
11
|
+
*
|
|
12
|
+
* @slot description - Custom HTML description content below the label.
|
|
13
|
+
*
|
|
14
|
+
* @fires nys-input - Fired on input change. Detail: `{id, value}`.
|
|
15
|
+
* @fires nys-focus - Fired when textarea gains focus.
|
|
16
|
+
* @fires nys-blur - Fired when textarea loses focus. Triggers validation.
|
|
17
|
+
* @fires nys-select - Fired when user selects text. Detail: `{id, value}`.
|
|
18
|
+
*
|
|
19
|
+
* @example Basic textarea
|
|
20
|
+
* ```html
|
|
21
|
+
* <nys-textarea label="Comments" rows="4"></nys-textarea>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Required with description
|
|
25
|
+
* ```html
|
|
26
|
+
* <nys-textarea label="Describe the incident" description="Please provide details" required></nys-textarea>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class NysTextarea extends LitElement {
|
|
30
|
+
static styles: import("lit").CSSResult;
|
|
31
|
+
static shadowRootOptions: {
|
|
32
|
+
delegatesFocus: boolean;
|
|
33
|
+
clonable?: boolean;
|
|
34
|
+
customElementRegistry?: CustomElementRegistry;
|
|
35
|
+
mode: ShadowRootMode;
|
|
36
|
+
serializable?: boolean;
|
|
37
|
+
slotAssignment?: SlotAssignmentMode;
|
|
38
|
+
};
|
|
39
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
40
|
+
id: string;
|
|
41
|
+
/** Name for form submission. */
|
|
42
|
+
name: string;
|
|
43
|
+
/** Visible label text. Required for accessibility. */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
46
|
+
description: string;
|
|
47
|
+
/** Placeholder text. Don't use as label replacement. */
|
|
48
|
+
placeholder: string;
|
|
49
|
+
/** Current textarea value. */
|
|
50
|
+
value: string;
|
|
51
|
+
/** Prevents interaction. */
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
/** Makes textarea read-only but focusable. */
|
|
54
|
+
readonly: boolean;
|
|
55
|
+
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
56
|
+
required: boolean;
|
|
57
|
+
/** Shows "Optional" flag. Use when most fields are required. */
|
|
58
|
+
optional: boolean;
|
|
59
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
60
|
+
tooltip: string;
|
|
61
|
+
/** Adjusts colors for dark backgrounds. */
|
|
62
|
+
inverted: boolean;
|
|
63
|
+
/** Form `id` to associate with when textarea is outside form element. */
|
|
64
|
+
form: string | null;
|
|
65
|
+
/** Maximum character length. */
|
|
66
|
+
maxlength: number | null;
|
|
67
|
+
/**
|
|
68
|
+
* Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).
|
|
69
|
+
* @default "full"
|
|
70
|
+
*/
|
|
71
|
+
width: "sm" | "md" | "lg" | "full";
|
|
72
|
+
/**
|
|
73
|
+
* Visible height in lines.
|
|
74
|
+
* @default 4
|
|
75
|
+
*/
|
|
76
|
+
rows: number;
|
|
77
|
+
/**
|
|
78
|
+
* Resize behavior: `vertical` (default, user can resize height), `none` (fixed size).
|
|
79
|
+
* @default "vertical"
|
|
80
|
+
*/
|
|
81
|
+
resize: "vertical" | "none";
|
|
82
|
+
/** Shows error message when true. Set by validation or manually. */
|
|
83
|
+
showError: boolean;
|
|
84
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
85
|
+
errorMessage: string;
|
|
86
|
+
private _hasUserInteracted;
|
|
87
|
+
private _internals;
|
|
88
|
+
/**
|
|
89
|
+
* Lifecycle methods
|
|
90
|
+
* --------------------------------------------------------------------------
|
|
91
|
+
*/
|
|
92
|
+
static formAssociated: boolean;
|
|
93
|
+
constructor();
|
|
94
|
+
connectedCallback(): void;
|
|
95
|
+
disconnectedCallback(): void;
|
|
96
|
+
firstUpdated(): void;
|
|
97
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Form Integration
|
|
100
|
+
* --------------------------------------------------------------------------
|
|
101
|
+
*/
|
|
102
|
+
private _setValue;
|
|
103
|
+
private _manageRequire;
|
|
104
|
+
private _setValidityMessage;
|
|
105
|
+
private _validate;
|
|
106
|
+
formResetCallback(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Functions
|
|
109
|
+
* --------------------------------------------------------------------------
|
|
110
|
+
*/
|
|
111
|
+
checkValidity(): boolean;
|
|
112
|
+
private _handleInvalid;
|
|
113
|
+
/**
|
|
114
|
+
* Event Handlers
|
|
115
|
+
* --------------------------------------------------------------------------
|
|
116
|
+
*/
|
|
117
|
+
private _handleInput;
|
|
118
|
+
private _handleFocus;
|
|
119
|
+
private _handleBlur;
|
|
120
|
+
private _handleSelect;
|
|
121
|
+
private _handleSelectionChange;
|
|
122
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
123
|
+
}
|
package/dist/nys-textarea.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ifDefined as o } from "lit/directives/if-defined.js";
|
|
|
6
6
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
7
7
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
8
8
|
*
|
|
9
|
-
* Textarea Component v1.19.
|
|
9
|
+
* Textarea Component v1.19.2
|
|
10
10
|
* Part of the New York State Design System
|
|
11
11
|
* Repository: https://github.com/its-hcd/nysds
|
|
12
12
|
* License: MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/nys-textarea",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2",
|
|
4
4
|
"description": "The Textarea component from the NYS Design System.",
|
|
5
5
|
"module": "dist/nys-textarea.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"lit-analyze": "lit-analyzer '**/*.ts'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@nysds/nys-icon": "^1.19.
|
|
27
|
-
"@nysds/nys-label": "^1.19.
|
|
28
|
-
"@nysds/nys-errormessage": "^1.19.
|
|
26
|
+
"@nysds/nys-icon": "^1.19.2",
|
|
27
|
+
"@nysds/nys-label": "^1.19.2",
|
|
28
|
+
"@nysds/nys-errormessage": "^1.19.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"lit": "^3.3.1",
|
|
@@ -42,5 +42,6 @@
|
|
|
42
42
|
"forms"
|
|
43
43
|
],
|
|
44
44
|
"author": "New York State Design System Team",
|
|
45
|
-
"license": "MIT"
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"sideEffects": true
|
|
46
47
|
}
|