@ds-mo/ui 14.24.0 → 14.26.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.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +341 -13
- package/dist/angular/ds-score.d.ts +12 -0
- package/dist/angular/ds-score.js +38 -0
- package/dist/angular/ds-textarea.d.ts +15 -0
- package/dist/angular/ds-textarea.js +43 -0
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +2 -0
- package/dist/angular/proxies.d.ts +2 -0
- package/dist/angular/proxies.js +2 -0
- package/dist/angular/text-value-accessor.d.ts +1 -1
- package/dist/angular/text-value-accessor.js +2 -2
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-questionnaire.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-source-list.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-attachment-list.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-bar-action.js +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/ds-card-chart.js +1 -1
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-overview.js.map +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart.js +1 -1
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-section.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-filter-menu.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-actions.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-message.js +1 -1
- package/dist/components/ds-mobile-bar-nav.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-mobile-sheet-nav.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-pagination.js +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-paper-texture.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-score.d.ts +11 -0
- package/dist/components/ds-score.js +2 -0
- package/dist/components/ds-score.js.map +1 -0
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-table-filter.js +1 -1
- package/dist/components/ds-table-group.js +1 -1
- package/dist/components/ds-table-saved-views.js +1 -1
- package/dist/components/ds-table-search.js +1 -1
- package/dist/components/ds-table-sort.js +1 -1
- package/dist/components/ds-table-toolbar.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/ds-table.js.map +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-textarea.d.ts +11 -0
- package/dist/components/ds-textarea.js +2 -0
- package/dist/components/ds-textarea.js.map +1 -0
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-tooltip-chart.js +1 -1
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/{p-DLaN9BPq.js → p-1604KY3B.js} +2 -2
- package/dist/components/{p-CYMKmJ2s.js → p-2wIPUcSL.js} +2 -2
- package/dist/components/{p-CEfxLsbX.js → p-537t6oRD.js} +2 -2
- package/dist/components/{p-kslioYhf.js → p-6_CNVbqa.js} +2 -2
- package/dist/components/{p-PXdvBMXB.js → p-B3Z5sQin.js} +2 -2
- package/dist/components/{p-CZjjDhUl.js → p-B3sRZBZk.js} +2 -2
- package/dist/components/{p-BZlhBJZL.js → p-B9esvbYk.js} +2 -2
- package/dist/components/{p-5Z4oYuiK.js → p-BEXkJ9lg.js} +2 -2
- package/dist/components/{p-DbLLH3hr.js → p-BIGpc__9.js} +2 -2
- package/dist/components/{p-DzPtYdXy.js → p-BMzn2Cmw.js} +2 -2
- package/dist/components/{p-BSRIF4m8.js → p-BRLDf-NK.js} +2 -2
- package/dist/components/{p-0X-4KGQf.js → p-BUh2GkPJ.js} +2 -2
- package/dist/components/{p-pUOA3iDG.js → p-BVpn_e-r.js} +2 -2
- package/dist/components/{p-CpeJMKJ5.js → p-BVz-r3g0.js} +2 -2
- package/dist/components/{p-CBymzuOO.js → p-BXDLR072.js} +2 -2
- package/dist/components/{p-DiS5BgLA.js → p-BZiGtBBk.js} +2 -2
- package/dist/components/{p-BcxidW9k.js → p-Bb9dA7sl.js} +2 -2
- package/dist/components/{p-BR1ayqMU.js → p-Bjt_8sLe.js} +2 -2
- package/dist/components/{p-BqbdABo3.js → p-BssZ4SbT.js} +2 -2
- package/dist/components/{p-bHnk8t5I.js → p-C68oSTb1.js} +2 -2
- package/dist/components/{p-C_FFU6W3.js → p-CGQnHNuW.js} +2 -2
- package/dist/components/{p-BqVXMEJm.js → p-CQjUOHiN.js} +2 -2
- package/dist/components/{p-w9fkkwL2.js → p-CaF5WCci.js} +2 -2
- package/dist/components/{p-Bjq1KP_Y.js → p-Cf5Ai4xx.js} +2 -2
- package/dist/components/{p-B0kSlcaw.js → p-Cr6pDY-e.js} +2 -2
- package/dist/components/{p-FxtgCvhA.js → p-Cy1oWIaV.js} +2 -2
- package/dist/components/{p-CTH3dSYg.js → p-DDqRCDXh.js} +2 -2
- package/dist/components/{p-x5u5Ueli.js → p-DIqAdmui.js} +2 -2
- package/dist/components/{p-Cd1JnnVK.js → p-DQQsS9Rx.js} +2 -2
- package/dist/components/{p-CZHIkVgj.js → p-DQsFmleZ.js} +2 -2
- package/dist/components/p-DRyrcR2k.js +2 -0
- package/dist/components/p-DRyrcR2k.js.map +1 -0
- package/dist/components/{p-CE2b5GPu.js → p-DVLghmNY.js} +2 -2
- package/dist/components/p-DW8ssbfI.js +2 -0
- package/dist/components/p-DW8ssbfI.js.map +1 -0
- package/dist/components/{p-BXv6RpoF.js → p-DZcIt_JJ.js} +2 -2
- package/dist/components/{p-CglHiyY2.js → p-DkxOEFHN.js} +2 -2
- package/dist/components/{p-DeK_6Uym.js → p-DlbhmXjH.js} +2 -2
- package/dist/components/{p-Bq8svcPs.js → p-GEi3hDJQ.js} +2 -2
- package/dist/components/p-LMmrjmI_.js +2 -0
- package/dist/components/p-LMmrjmI_.js.map +1 -0
- package/dist/components/{p-DI8DUozc.js → p-Q0dkeoJ6.js} +2 -2
- package/dist/components/{p-XaCYqck3.js → p-Q7AOgrg5.js} +2 -2
- package/dist/components/{p-B0OZx3JB.js → p-WFo1x6dN.js} +2 -2
- package/dist/components/{p-CEXchU5N.js → p-to8BxxgT.js} +2 -2
- package/dist/docs/components.json +1104 -3
- package/dist/mcp-data/registry/card-overview.json +8 -6
- package/dist/mcp-data/registry/field.json +5 -4
- package/dist/mcp-data/registry/panel-nav.json +2 -1
- package/dist/mcp-data/registry/registry.json +346 -12
- package/dist/mcp-data/registry/score.json +241 -0
- package/dist/mcp-data/registry/shell-app.json +1 -0
- package/dist/mcp-data/registry/table.json +17 -14
- package/dist/mcp-data/registry/textarea.json +600 -0
- package/dist/mcp-data/registry/tooltip.json +5 -5
- package/dist/react/components.d.ts +2 -0
- package/dist/react/components.js +2 -0
- package/dist/react/ds-score.d.ts +9 -0
- package/dist/react/ds-score.js +12 -0
- package/dist/react/ds-textarea.d.ts +12 -0
- package/dist/react/ds-textarea.js +12 -0
- package/dist/styles/table.css +201 -70
- package/dist/types/components/CardOverview/card-overview-controller.d.ts +2 -2
- package/dist/types/components/CardOverview/card-overview-types.d.ts +2 -1
- package/dist/types/components/Score/Score.d.ts +21 -0
- package/dist/types/components/Score/index.d.ts +3 -0
- package/dist/types/components/Score/score-model.d.ts +14 -0
- package/dist/types/components/Score/score-types.d.ts +5 -0
- package/dist/types/components/Table/Table.d.ts +5 -2
- package/dist/types/components/Table/index.d.ts +1 -1
- package/dist/types/components/Table/table-cell-model.d.ts +12 -0
- package/dist/types/components/Table/table-model.d.ts +10 -1
- package/dist/types/components/Table/table-render-model.d.ts +3 -1
- package/dist/types/components/Table/table-row-view.d.ts +2 -1
- package/dist/types/components/Table/table-types.d.ts +60 -1
- package/dist/types/components/Table/table-virtual-model.d.ts +6 -5
- package/dist/types/components/Textarea/Textarea.d.ts +66 -0
- package/dist/types/components/Textarea/index.d.ts +2 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components.d.ts +324 -2
- package/dist/vue/components.d.ts +2 -0
- package/dist/vue/components.js +2 -0
- package/dist/vue/ds-score.d.ts +3 -0
- package/dist/vue/ds-score.js +12 -0
- package/dist/vue/ds-textarea.d.ts +3 -0
- package/dist/vue/ds-textarea.js +36 -0
- package/package.json +1 -1
- package/dist/components/p-9X_p0bHr.js +0 -2
- package/dist/components/p-9X_p0bHr.js.map +0 -1
- package/dist/components/p-Bo6uW_8T.js +0 -2
- package/dist/components/p-Bo6uW_8T.js.map +0 -1
- /package/dist/components/{p-DLaN9BPq.js.map → p-1604KY3B.js.map} +0 -0
- /package/dist/components/{p-CYMKmJ2s.js.map → p-2wIPUcSL.js.map} +0 -0
- /package/dist/components/{p-CEfxLsbX.js.map → p-537t6oRD.js.map} +0 -0
- /package/dist/components/{p-kslioYhf.js.map → p-6_CNVbqa.js.map} +0 -0
- /package/dist/components/{p-PXdvBMXB.js.map → p-B3Z5sQin.js.map} +0 -0
- /package/dist/components/{p-CZjjDhUl.js.map → p-B3sRZBZk.js.map} +0 -0
- /package/dist/components/{p-BZlhBJZL.js.map → p-B9esvbYk.js.map} +0 -0
- /package/dist/components/{p-5Z4oYuiK.js.map → p-BEXkJ9lg.js.map} +0 -0
- /package/dist/components/{p-DbLLH3hr.js.map → p-BIGpc__9.js.map} +0 -0
- /package/dist/components/{p-DzPtYdXy.js.map → p-BMzn2Cmw.js.map} +0 -0
- /package/dist/components/{p-BSRIF4m8.js.map → p-BRLDf-NK.js.map} +0 -0
- /package/dist/components/{p-0X-4KGQf.js.map → p-BUh2GkPJ.js.map} +0 -0
- /package/dist/components/{p-pUOA3iDG.js.map → p-BVpn_e-r.js.map} +0 -0
- /package/dist/components/{p-CpeJMKJ5.js.map → p-BVz-r3g0.js.map} +0 -0
- /package/dist/components/{p-CBymzuOO.js.map → p-BXDLR072.js.map} +0 -0
- /package/dist/components/{p-DiS5BgLA.js.map → p-BZiGtBBk.js.map} +0 -0
- /package/dist/components/{p-BcxidW9k.js.map → p-Bb9dA7sl.js.map} +0 -0
- /package/dist/components/{p-BR1ayqMU.js.map → p-Bjt_8sLe.js.map} +0 -0
- /package/dist/components/{p-BqbdABo3.js.map → p-BssZ4SbT.js.map} +0 -0
- /package/dist/components/{p-bHnk8t5I.js.map → p-C68oSTb1.js.map} +0 -0
- /package/dist/components/{p-C_FFU6W3.js.map → p-CGQnHNuW.js.map} +0 -0
- /package/dist/components/{p-BqVXMEJm.js.map → p-CQjUOHiN.js.map} +0 -0
- /package/dist/components/{p-w9fkkwL2.js.map → p-CaF5WCci.js.map} +0 -0
- /package/dist/components/{p-Bjq1KP_Y.js.map → p-Cf5Ai4xx.js.map} +0 -0
- /package/dist/components/{p-B0kSlcaw.js.map → p-Cr6pDY-e.js.map} +0 -0
- /package/dist/components/{p-FxtgCvhA.js.map → p-Cy1oWIaV.js.map} +0 -0
- /package/dist/components/{p-CTH3dSYg.js.map → p-DDqRCDXh.js.map} +0 -0
- /package/dist/components/{p-x5u5Ueli.js.map → p-DIqAdmui.js.map} +0 -0
- /package/dist/components/{p-Cd1JnnVK.js.map → p-DQQsS9Rx.js.map} +0 -0
- /package/dist/components/{p-CZHIkVgj.js.map → p-DQsFmleZ.js.map} +0 -0
- /package/dist/components/{p-CE2b5GPu.js.map → p-DVLghmNY.js.map} +0 -0
- /package/dist/components/{p-BXv6RpoF.js.map → p-DZcIt_JJ.js.map} +0 -0
- /package/dist/components/{p-CglHiyY2.js.map → p-DkxOEFHN.js.map} +0 -0
- /package/dist/components/{p-DeK_6Uym.js.map → p-DlbhmXjH.js.map} +0 -0
- /package/dist/components/{p-Bq8svcPs.js.map → p-GEi3hDJQ.js.map} +0 -0
- /package/dist/components/{p-DI8DUozc.js.map → p-Q0dkeoJ6.js.map} +0 -0
- /package/dist/components/{p-XaCYqck3.js.map → p-Q7AOgrg5.js.map} +0 -0
- /package/dist/components/{p-B0OZx3JB.js.map → p-WFo1x6dN.js.map} +0 -0
- /package/dist/components/{p-CEXchU5N.js.map → p-to8BxxgT.js.map} +0 -0
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "textarea",
|
|
4
|
+
"title": "Textarea",
|
|
5
|
+
"description": "Form-associated multiline text control with shared Input density, focus, validation, and field-composition behavior.",
|
|
6
|
+
"type": "registry:ui",
|
|
7
|
+
"meta": {
|
|
8
|
+
"library": "@ds-mo/ui",
|
|
9
|
+
"distribution": "npm",
|
|
10
|
+
"storybook": "https://zainadeel.github.io/compomo/?path=/story/textarea",
|
|
11
|
+
"source": "src/wc/components/Textarea/Textarea.tsx",
|
|
12
|
+
"intentStatus": "complete",
|
|
13
|
+
"intent": {
|
|
14
|
+
"audience": "general",
|
|
15
|
+
"status": "experimental",
|
|
16
|
+
"summary": "Form-associated multiline text control with shared Input density, focus, validation, and field-composition behavior.",
|
|
17
|
+
"useWhen": [
|
|
18
|
+
"A person needs to enter freeform text that may span several lines.",
|
|
19
|
+
"Notes, descriptions, comments, or explanations need native multiline editing and form submission.",
|
|
20
|
+
"A multiline control must compose with Field for its visible label, guidance, and error presentation."
|
|
21
|
+
],
|
|
22
|
+
"avoidWhen": [
|
|
23
|
+
"The value is predictably one line; use Input instead.",
|
|
24
|
+
"The content is a conversational prompt with submit, stop, and tool actions; use MessageComposer instead.",
|
|
25
|
+
"The interface needs rich-text formatting, mentions, or structured blocks."
|
|
26
|
+
],
|
|
27
|
+
"alternatives": [
|
|
28
|
+
{
|
|
29
|
+
"when": "The value is predictably one line.",
|
|
30
|
+
"component": "component:ds-input",
|
|
31
|
+
"reason": "Input supplies single-line semantics, adornments, search clearing, and numeric stepping."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"when": "The field is a conversational prompt with submission actions.",
|
|
35
|
+
"component": "component:ds-message-composer",
|
|
36
|
+
"reason": "MessageComposer owns chat-specific growth, submission, stop, tools, and recovery behavior."
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"commonlyComposedWith": [
|
|
40
|
+
"component:ds-field",
|
|
41
|
+
"component:ds-text"
|
|
42
|
+
],
|
|
43
|
+
"accessibility": [
|
|
44
|
+
"Give every Textarea an accessible name, preferably by wrapping it in Field with a persistent visible label.",
|
|
45
|
+
"Use description text for lasting guidance; placeholder text is an example or short prompt, not a label.",
|
|
46
|
+
"Required validation uses the native form contract and can provide a localized requiredMessage.",
|
|
47
|
+
"Read-only text remains focusable and submittable; inactive text is unavailable and omitted from form submission.",
|
|
48
|
+
"When Textarea renders its own errorMessage, it merges that message ID with authored aria-describedby references."
|
|
49
|
+
],
|
|
50
|
+
"states": [
|
|
51
|
+
"Textarea exposes data-filled, data-focused, data-dirty, data-touched, data-invalid, data-disabled, data-readonly, and data-required state hooks.",
|
|
52
|
+
"The default four visible rows can be changed with rows; rows is clamped to at least one.",
|
|
53
|
+
"Vertical resizing is enabled by default and can be disabled when the surrounding layout owns the field height.",
|
|
54
|
+
"Size changes typography and inset spacing without changing the authored row count.",
|
|
55
|
+
"Border, focus, error, placeholder, inactive, hover, and pressed treatments follow the same shared recipes as Input."
|
|
56
|
+
],
|
|
57
|
+
"responsiveBehavior": [
|
|
58
|
+
"Textarea fills its parent by default and follows the width supplied by Field or the form layout.",
|
|
59
|
+
"The native value wraps within the available width and scrolls when its content exceeds the visible rows.",
|
|
60
|
+
"Use width hug only in intrinsically sized layouts with an explicit surrounding constraint."
|
|
61
|
+
],
|
|
62
|
+
"frameworkCaveats": {
|
|
63
|
+
"customElements": [
|
|
64
|
+
"Listen for dsChange; its detail is the complete current string value.",
|
|
65
|
+
"Set value through the component property for controlled updates and use setFocus() for imperative focus."
|
|
66
|
+
],
|
|
67
|
+
"react": [
|
|
68
|
+
"Use the generated Textarea adapter and read the full string from the dsChange detail."
|
|
69
|
+
],
|
|
70
|
+
"angular": [
|
|
71
|
+
"Use the generated Textarea adapter with its text value accessor for form bindings."
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"references": [
|
|
75
|
+
{
|
|
76
|
+
"label": "Storybook examples",
|
|
77
|
+
"path": "src/wc/components/Textarea/Textarea.stories.ts"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"label": "Cross-browser form and accessibility coverage",
|
|
81
|
+
"path": "tests/e2e/forms.spec.ts"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"api": {
|
|
86
|
+
"props": {
|
|
87
|
+
"ariaDescribedby": {
|
|
88
|
+
"type": "string | undefined",
|
|
89
|
+
"resolvedType": "string | undefined",
|
|
90
|
+
"attribute": "aria-describedby",
|
|
91
|
+
"required": false,
|
|
92
|
+
"mutable": false
|
|
93
|
+
},
|
|
94
|
+
"ariaLabel": {
|
|
95
|
+
"type": "string | null",
|
|
96
|
+
"resolvedType": "null | string",
|
|
97
|
+
"attribute": "aria-label",
|
|
98
|
+
"default": "null",
|
|
99
|
+
"required": false,
|
|
100
|
+
"mutable": false
|
|
101
|
+
},
|
|
102
|
+
"ariaLabelledby": {
|
|
103
|
+
"type": "string | undefined",
|
|
104
|
+
"resolvedType": "string | undefined",
|
|
105
|
+
"attribute": "aria-labelledby",
|
|
106
|
+
"required": false,
|
|
107
|
+
"mutable": false
|
|
108
|
+
},
|
|
109
|
+
"autoComplete": {
|
|
110
|
+
"type": "string | undefined",
|
|
111
|
+
"resolvedType": "string | undefined",
|
|
112
|
+
"attribute": "autocomplete",
|
|
113
|
+
"required": false,
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"description": "Native browser autofill hint."
|
|
116
|
+
},
|
|
117
|
+
"autoFocus": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"resolvedType": "boolean",
|
|
120
|
+
"attribute": "auto-focus",
|
|
121
|
+
"default": "false",
|
|
122
|
+
"required": false,
|
|
123
|
+
"mutable": false
|
|
124
|
+
},
|
|
125
|
+
"disabled": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"resolvedType": "boolean",
|
|
128
|
+
"attribute": "disabled",
|
|
129
|
+
"default": "false",
|
|
130
|
+
"required": false,
|
|
131
|
+
"mutable": false
|
|
132
|
+
},
|
|
133
|
+
"enterKeyHint": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"resolvedType": "string",
|
|
136
|
+
"attribute": "enterkeyhint",
|
|
137
|
+
"default": "''",
|
|
138
|
+
"required": false,
|
|
139
|
+
"mutable": false,
|
|
140
|
+
"description": "Preferred virtual-keyboard action label."
|
|
141
|
+
},
|
|
142
|
+
"error": {
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"resolvedType": "boolean",
|
|
145
|
+
"attribute": "error",
|
|
146
|
+
"default": "false",
|
|
147
|
+
"required": false,
|
|
148
|
+
"mutable": false
|
|
149
|
+
},
|
|
150
|
+
"errorMessage": {
|
|
151
|
+
"type": "string | undefined",
|
|
152
|
+
"resolvedType": "string | undefined",
|
|
153
|
+
"attribute": "error-message",
|
|
154
|
+
"required": false,
|
|
155
|
+
"mutable": false
|
|
156
|
+
},
|
|
157
|
+
"form": {
|
|
158
|
+
"type": "string | undefined",
|
|
159
|
+
"resolvedType": "string | undefined",
|
|
160
|
+
"attribute": "form",
|
|
161
|
+
"required": false,
|
|
162
|
+
"mutable": false
|
|
163
|
+
},
|
|
164
|
+
"hasBorder": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"resolvedType": "boolean",
|
|
167
|
+
"attribute": "has-border",
|
|
168
|
+
"default": "true",
|
|
169
|
+
"required": false,
|
|
170
|
+
"mutable": false,
|
|
171
|
+
"description": "Show the standard inset border, including focused and invalid strokes."
|
|
172
|
+
},
|
|
173
|
+
"hasInteractionFill": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"resolvedType": "boolean",
|
|
176
|
+
"attribute": "has-interaction-fill",
|
|
177
|
+
"default": "true",
|
|
178
|
+
"required": false,
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"description": "Show the standard hover and pressed fill when the field is not embedded in interactive chrome."
|
|
181
|
+
},
|
|
182
|
+
"inputId": {
|
|
183
|
+
"type": "string | undefined",
|
|
184
|
+
"resolvedType": "string | undefined",
|
|
185
|
+
"attribute": "input-id",
|
|
186
|
+
"required": false,
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"description": "Associates the internal textarea with an external <label>."
|
|
189
|
+
},
|
|
190
|
+
"inputMode": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"resolvedType": "string",
|
|
193
|
+
"attribute": "inputmode",
|
|
194
|
+
"default": "''",
|
|
195
|
+
"required": false,
|
|
196
|
+
"mutable": false,
|
|
197
|
+
"description": "Preferred virtual keyboard without changing the value semantics."
|
|
198
|
+
},
|
|
199
|
+
"isInactive": {
|
|
200
|
+
"type": "boolean",
|
|
201
|
+
"resolvedType": "boolean",
|
|
202
|
+
"attribute": "is-inactive",
|
|
203
|
+
"default": "false",
|
|
204
|
+
"required": false,
|
|
205
|
+
"mutable": false
|
|
206
|
+
},
|
|
207
|
+
"name": {
|
|
208
|
+
"type": "string | undefined",
|
|
209
|
+
"resolvedType": "string | undefined",
|
|
210
|
+
"attribute": "name",
|
|
211
|
+
"required": false,
|
|
212
|
+
"mutable": false
|
|
213
|
+
},
|
|
214
|
+
"placeholder": {
|
|
215
|
+
"type": "string | undefined",
|
|
216
|
+
"resolvedType": "string | undefined",
|
|
217
|
+
"attribute": "placeholder",
|
|
218
|
+
"required": false,
|
|
219
|
+
"mutable": false
|
|
220
|
+
},
|
|
221
|
+
"readOnly": {
|
|
222
|
+
"type": "boolean",
|
|
223
|
+
"resolvedType": "boolean",
|
|
224
|
+
"attribute": "read-only",
|
|
225
|
+
"default": "false",
|
|
226
|
+
"required": false,
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"description": "Keeps the value focusable and submittable while preventing edits."
|
|
229
|
+
},
|
|
230
|
+
"required": {
|
|
231
|
+
"type": "boolean",
|
|
232
|
+
"resolvedType": "boolean",
|
|
233
|
+
"attribute": "required",
|
|
234
|
+
"default": "false",
|
|
235
|
+
"required": false,
|
|
236
|
+
"mutable": false
|
|
237
|
+
},
|
|
238
|
+
"requiredMessage": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"resolvedType": "string",
|
|
241
|
+
"attribute": "required-message",
|
|
242
|
+
"default": "'This field is required.'",
|
|
243
|
+
"required": false,
|
|
244
|
+
"mutable": false
|
|
245
|
+
},
|
|
246
|
+
"resize": {
|
|
247
|
+
"type": "TextareaResize",
|
|
248
|
+
"resolvedType": "\"none\" | \"vertical\"",
|
|
249
|
+
"attribute": "resize",
|
|
250
|
+
"default": "'vertical'",
|
|
251
|
+
"required": false,
|
|
252
|
+
"mutable": false,
|
|
253
|
+
"description": "Whether the user can resize the field vertically."
|
|
254
|
+
},
|
|
255
|
+
"rows": {
|
|
256
|
+
"type": "number",
|
|
257
|
+
"resolvedType": "number",
|
|
258
|
+
"attribute": "rows",
|
|
259
|
+
"default": "4",
|
|
260
|
+
"required": false,
|
|
261
|
+
"mutable": false,
|
|
262
|
+
"description": "Visible text rows before the field scrolls."
|
|
263
|
+
},
|
|
264
|
+
"size": {
|
|
265
|
+
"type": "TextareaSize",
|
|
266
|
+
"resolvedType": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
|
|
267
|
+
"attribute": "size",
|
|
268
|
+
"default": "'md'",
|
|
269
|
+
"required": false,
|
|
270
|
+
"mutable": false,
|
|
271
|
+
"description": "Control density for typography and inset spacing."
|
|
272
|
+
},
|
|
273
|
+
"spellCheck": {
|
|
274
|
+
"type": "boolean",
|
|
275
|
+
"resolvedType": "boolean",
|
|
276
|
+
"attribute": "spellcheck",
|
|
277
|
+
"default": "true",
|
|
278
|
+
"required": false,
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"description": "Whether the browser should check spelling and grammar."
|
|
281
|
+
},
|
|
282
|
+
"value": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"resolvedType": "string",
|
|
285
|
+
"attribute": "value",
|
|
286
|
+
"default": "''",
|
|
287
|
+
"required": false,
|
|
288
|
+
"mutable": true
|
|
289
|
+
},
|
|
290
|
+
"width": {
|
|
291
|
+
"type": "TextareaWidth",
|
|
292
|
+
"resolvedType": "\"fill\" | \"hug\"",
|
|
293
|
+
"attribute": "width",
|
|
294
|
+
"default": "'fill'",
|
|
295
|
+
"required": false,
|
|
296
|
+
"mutable": false,
|
|
297
|
+
"description": "Width fit — fill the parent (default) or hug the available content."
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
"events": [
|
|
301
|
+
{
|
|
302
|
+
"name": "dsChange",
|
|
303
|
+
"detail": "string",
|
|
304
|
+
"bubbles": true,
|
|
305
|
+
"cancelable": true,
|
|
306
|
+
"composed": true
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"methods": [
|
|
310
|
+
{
|
|
311
|
+
"name": "setFocus",
|
|
312
|
+
"signature": "setFocus() => Promise<void>"
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
"slots": []
|
|
316
|
+
},
|
|
317
|
+
"props": {
|
|
318
|
+
"ariaDescribedby": {
|
|
319
|
+
"type": "string | undefined",
|
|
320
|
+
"resolvedType": "string | undefined",
|
|
321
|
+
"attribute": "aria-describedby",
|
|
322
|
+
"required": false,
|
|
323
|
+
"mutable": false
|
|
324
|
+
},
|
|
325
|
+
"ariaLabel": {
|
|
326
|
+
"type": "string | null",
|
|
327
|
+
"resolvedType": "null | string",
|
|
328
|
+
"attribute": "aria-label",
|
|
329
|
+
"default": "null",
|
|
330
|
+
"required": false,
|
|
331
|
+
"mutable": false
|
|
332
|
+
},
|
|
333
|
+
"ariaLabelledby": {
|
|
334
|
+
"type": "string | undefined",
|
|
335
|
+
"resolvedType": "string | undefined",
|
|
336
|
+
"attribute": "aria-labelledby",
|
|
337
|
+
"required": false,
|
|
338
|
+
"mutable": false
|
|
339
|
+
},
|
|
340
|
+
"autoComplete": {
|
|
341
|
+
"type": "string | undefined",
|
|
342
|
+
"resolvedType": "string | undefined",
|
|
343
|
+
"attribute": "autocomplete",
|
|
344
|
+
"required": false,
|
|
345
|
+
"mutable": false,
|
|
346
|
+
"description": "Native browser autofill hint."
|
|
347
|
+
},
|
|
348
|
+
"autoFocus": {
|
|
349
|
+
"type": "boolean",
|
|
350
|
+
"resolvedType": "boolean",
|
|
351
|
+
"attribute": "auto-focus",
|
|
352
|
+
"default": "false",
|
|
353
|
+
"required": false,
|
|
354
|
+
"mutable": false
|
|
355
|
+
},
|
|
356
|
+
"disabled": {
|
|
357
|
+
"type": "boolean",
|
|
358
|
+
"resolvedType": "boolean",
|
|
359
|
+
"attribute": "disabled",
|
|
360
|
+
"default": "false",
|
|
361
|
+
"required": false,
|
|
362
|
+
"mutable": false
|
|
363
|
+
},
|
|
364
|
+
"enterKeyHint": {
|
|
365
|
+
"type": "string",
|
|
366
|
+
"resolvedType": "string",
|
|
367
|
+
"attribute": "enterkeyhint",
|
|
368
|
+
"default": "''",
|
|
369
|
+
"required": false,
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"description": "Preferred virtual-keyboard action label."
|
|
372
|
+
},
|
|
373
|
+
"error": {
|
|
374
|
+
"type": "boolean",
|
|
375
|
+
"resolvedType": "boolean",
|
|
376
|
+
"attribute": "error",
|
|
377
|
+
"default": "false",
|
|
378
|
+
"required": false,
|
|
379
|
+
"mutable": false
|
|
380
|
+
},
|
|
381
|
+
"errorMessage": {
|
|
382
|
+
"type": "string | undefined",
|
|
383
|
+
"resolvedType": "string | undefined",
|
|
384
|
+
"attribute": "error-message",
|
|
385
|
+
"required": false,
|
|
386
|
+
"mutable": false
|
|
387
|
+
},
|
|
388
|
+
"form": {
|
|
389
|
+
"type": "string | undefined",
|
|
390
|
+
"resolvedType": "string | undefined",
|
|
391
|
+
"attribute": "form",
|
|
392
|
+
"required": false,
|
|
393
|
+
"mutable": false
|
|
394
|
+
},
|
|
395
|
+
"hasBorder": {
|
|
396
|
+
"type": "boolean",
|
|
397
|
+
"resolvedType": "boolean",
|
|
398
|
+
"attribute": "has-border",
|
|
399
|
+
"default": "true",
|
|
400
|
+
"required": false,
|
|
401
|
+
"mutable": false,
|
|
402
|
+
"description": "Show the standard inset border, including focused and invalid strokes."
|
|
403
|
+
},
|
|
404
|
+
"hasInteractionFill": {
|
|
405
|
+
"type": "boolean",
|
|
406
|
+
"resolvedType": "boolean",
|
|
407
|
+
"attribute": "has-interaction-fill",
|
|
408
|
+
"default": "true",
|
|
409
|
+
"required": false,
|
|
410
|
+
"mutable": false,
|
|
411
|
+
"description": "Show the standard hover and pressed fill when the field is not embedded in interactive chrome."
|
|
412
|
+
},
|
|
413
|
+
"inputId": {
|
|
414
|
+
"type": "string | undefined",
|
|
415
|
+
"resolvedType": "string | undefined",
|
|
416
|
+
"attribute": "input-id",
|
|
417
|
+
"required": false,
|
|
418
|
+
"mutable": false,
|
|
419
|
+
"description": "Associates the internal textarea with an external <label>."
|
|
420
|
+
},
|
|
421
|
+
"inputMode": {
|
|
422
|
+
"type": "string",
|
|
423
|
+
"resolvedType": "string",
|
|
424
|
+
"attribute": "inputmode",
|
|
425
|
+
"default": "''",
|
|
426
|
+
"required": false,
|
|
427
|
+
"mutable": false,
|
|
428
|
+
"description": "Preferred virtual keyboard without changing the value semantics."
|
|
429
|
+
},
|
|
430
|
+
"isInactive": {
|
|
431
|
+
"type": "boolean",
|
|
432
|
+
"resolvedType": "boolean",
|
|
433
|
+
"attribute": "is-inactive",
|
|
434
|
+
"default": "false",
|
|
435
|
+
"required": false,
|
|
436
|
+
"mutable": false
|
|
437
|
+
},
|
|
438
|
+
"name": {
|
|
439
|
+
"type": "string | undefined",
|
|
440
|
+
"resolvedType": "string | undefined",
|
|
441
|
+
"attribute": "name",
|
|
442
|
+
"required": false,
|
|
443
|
+
"mutable": false
|
|
444
|
+
},
|
|
445
|
+
"placeholder": {
|
|
446
|
+
"type": "string | undefined",
|
|
447
|
+
"resolvedType": "string | undefined",
|
|
448
|
+
"attribute": "placeholder",
|
|
449
|
+
"required": false,
|
|
450
|
+
"mutable": false
|
|
451
|
+
},
|
|
452
|
+
"readOnly": {
|
|
453
|
+
"type": "boolean",
|
|
454
|
+
"resolvedType": "boolean",
|
|
455
|
+
"attribute": "read-only",
|
|
456
|
+
"default": "false",
|
|
457
|
+
"required": false,
|
|
458
|
+
"mutable": false,
|
|
459
|
+
"description": "Keeps the value focusable and submittable while preventing edits."
|
|
460
|
+
},
|
|
461
|
+
"required": {
|
|
462
|
+
"type": "boolean",
|
|
463
|
+
"resolvedType": "boolean",
|
|
464
|
+
"attribute": "required",
|
|
465
|
+
"default": "false",
|
|
466
|
+
"required": false,
|
|
467
|
+
"mutable": false
|
|
468
|
+
},
|
|
469
|
+
"requiredMessage": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"resolvedType": "string",
|
|
472
|
+
"attribute": "required-message",
|
|
473
|
+
"default": "'This field is required.'",
|
|
474
|
+
"required": false,
|
|
475
|
+
"mutable": false
|
|
476
|
+
},
|
|
477
|
+
"resize": {
|
|
478
|
+
"type": "TextareaResize",
|
|
479
|
+
"resolvedType": "\"none\" | \"vertical\"",
|
|
480
|
+
"attribute": "resize",
|
|
481
|
+
"default": "'vertical'",
|
|
482
|
+
"required": false,
|
|
483
|
+
"mutable": false,
|
|
484
|
+
"description": "Whether the user can resize the field vertically."
|
|
485
|
+
},
|
|
486
|
+
"rows": {
|
|
487
|
+
"type": "number",
|
|
488
|
+
"resolvedType": "number",
|
|
489
|
+
"attribute": "rows",
|
|
490
|
+
"default": "4",
|
|
491
|
+
"required": false,
|
|
492
|
+
"mutable": false,
|
|
493
|
+
"description": "Visible text rows before the field scrolls."
|
|
494
|
+
},
|
|
495
|
+
"size": {
|
|
496
|
+
"type": "TextareaSize",
|
|
497
|
+
"resolvedType": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
|
|
498
|
+
"attribute": "size",
|
|
499
|
+
"default": "'md'",
|
|
500
|
+
"required": false,
|
|
501
|
+
"mutable": false,
|
|
502
|
+
"description": "Control density for typography and inset spacing."
|
|
503
|
+
},
|
|
504
|
+
"spellCheck": {
|
|
505
|
+
"type": "boolean",
|
|
506
|
+
"resolvedType": "boolean",
|
|
507
|
+
"attribute": "spellcheck",
|
|
508
|
+
"default": "true",
|
|
509
|
+
"required": false,
|
|
510
|
+
"mutable": false,
|
|
511
|
+
"description": "Whether the browser should check spelling and grammar."
|
|
512
|
+
},
|
|
513
|
+
"value": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"resolvedType": "string",
|
|
516
|
+
"attribute": "value",
|
|
517
|
+
"default": "''",
|
|
518
|
+
"required": false,
|
|
519
|
+
"mutable": true
|
|
520
|
+
},
|
|
521
|
+
"width": {
|
|
522
|
+
"type": "TextareaWidth",
|
|
523
|
+
"resolvedType": "\"fill\" | \"hug\"",
|
|
524
|
+
"attribute": "width",
|
|
525
|
+
"default": "'fill'",
|
|
526
|
+
"required": false,
|
|
527
|
+
"mutable": false,
|
|
528
|
+
"description": "Width fit — fill the parent (default) or hug the available content."
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
"events": [
|
|
532
|
+
{
|
|
533
|
+
"name": "dsChange",
|
|
534
|
+
"detail": "string",
|
|
535
|
+
"bubbles": true,
|
|
536
|
+
"cancelable": true,
|
|
537
|
+
"composed": true
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
"methods": [
|
|
541
|
+
{
|
|
542
|
+
"name": "setFocus",
|
|
543
|
+
"signature": "setFocus() => Promise<void>"
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"slots": [],
|
|
547
|
+
"exports": {
|
|
548
|
+
"customElement": "ds-textarea",
|
|
549
|
+
"react": "DsTextarea",
|
|
550
|
+
"vue": "DsTextarea",
|
|
551
|
+
"angular": "DsTextarea"
|
|
552
|
+
},
|
|
553
|
+
"consumption": {
|
|
554
|
+
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
555
|
+
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
556
|
+
"customElements": {
|
|
557
|
+
"import": "import '@ds-mo/ui/dist/components/ds-textarea.js';",
|
|
558
|
+
"example": "<ds-textarea></ds-textarea>"
|
|
559
|
+
},
|
|
560
|
+
"react": {
|
|
561
|
+
"import": "import { DsTextarea } from '@ds-mo/ui/react';",
|
|
562
|
+
"example": "<DsTextarea />"
|
|
563
|
+
},
|
|
564
|
+
"vue": {
|
|
565
|
+
"import": "import { DsTextarea } from '@ds-mo/ui/vue';",
|
|
566
|
+
"example": "<DsTextarea />"
|
|
567
|
+
},
|
|
568
|
+
"angular": {
|
|
569
|
+
"import": "import { DsTextarea } from '@ds-mo/ui/angular/ds-textarea';",
|
|
570
|
+
"example": "<ds-textarea></ds-textarea>"
|
|
571
|
+
},
|
|
572
|
+
"peerDependencies": {
|
|
573
|
+
"required": [
|
|
574
|
+
"@ds-mo/tokens ^6.5.1",
|
|
575
|
+
"@ds-mo/icons ^7.0.0"
|
|
576
|
+
],
|
|
577
|
+
"frameworks": "Custom Elements; React 18/19 wrappers; Vue 3 wrappers; Angular 19-22 standalone adapters."
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
"dependencies": [
|
|
582
|
+
"@ds-mo/ui",
|
|
583
|
+
"@ds-mo/tokens"
|
|
584
|
+
],
|
|
585
|
+
"registryDependencies": [
|
|
586
|
+
"text"
|
|
587
|
+
],
|
|
588
|
+
"files": [
|
|
589
|
+
{
|
|
590
|
+
"path": "src/wc/components/Textarea/Textarea.css",
|
|
591
|
+
"content": "@import '../../utils/interaction-fill.css';\n@import '../../utils/focus-ring.css';\n@import '../../utils/control-inactive.css';\n@import '../../utils/control-density.css';\n@import '../../utils/control-width.css';\n@import '../../utils/field-stack.css';\n@import '../../utils/typography.css';\n@import '../../utils/forced-colors.css';\n\n:host(.textarea-host) {\n display: inline-flex;\n --ds-textarea-fg: var(--color-foreground-primary);\n --ds-textarea-placeholder: var(--color-foreground-secondary);\n --ds-textarea-placeholder-active: var(--color-foreground-quaternary);\n --ds-textarea-border: var(--color-border-secondary);\n}\n\n:host(.ds-control-width--fill),\n:host(.ds-control-width--fill) .textarea-control {\n width: 100%;\n}\n\n.textarea-control {\n display: flex;\n box-sizing: border-box;\n min-width: 0;\n overflow: hidden;\n background: transparent;\n border: none;\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n color: var(--ds-textarea-fg);\n}\n\n.textarea-control--resizable {\n padding-block-end: var(--dimension-space-025);\n padding-inline-end: var(--dimension-space-025);\n}\n\n.textarea-control--bordered {\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--ds-textarea-border);\n}\n\n.textarea-control--error {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-negative);\n}\n\n.textarea-control--bordered:focus-within:not(.textarea-control--error) {\n --ds-interaction-border-width: var(--dimension-stroke-width-018);\n --ds-interaction-border-color: var(--color-border-bold-brand);\n}\n\n:host(.ds-control-inactive) .textarea-control::after {\n background: transparent;\n}\n\n.native-textarea {\n position: relative;\n z-index: 2;\n box-sizing: border-box;\n min-width: 0;\n width: 100%;\n padding-block: var(--ds-control-padding-inline, var(--dimension-space-075));\n padding-inline: calc(\n var(--ds-control-padding-inline, var(--dimension-space-075)) +\n var(--ds-control-label-inset, var(--dimension-space-025))\n );\n background: transparent;\n border: none;\n border-radius: inherit;\n outline: none;\n color: var(--ds-textarea-fg);\n font-family: inherit;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.native-textarea--resize-vertical {\n resize: vertical;\n}\n\n.native-textarea--resize-none {\n resize: none;\n}\n\n.native-textarea:disabled {\n cursor: not-allowed;\n}\n\n.native-textarea:read-only:not(:disabled) {\n cursor: default;\n}\n\n.native-textarea::placeholder {\n color: var(--ds-textarea-placeholder);\n}\n\n.native-textarea:focus::placeholder {\n color: var(--ds-textarea-placeholder-active);\n}\n\n.error-text {\n width: 100%;\n}\n\n@media (forced-colors: active) {\n .textarea-control--bordered:focus-within:not(.textarea-control--error)::after {\n outline-color: var(--ds-forced-color-selected);\n }\n\n .textarea-control--error::after {\n outline-style: dashed;\n }\n}\n",
|
|
592
|
+
"type": "registry:ui"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"path": "src/wc/components/Textarea/Textarea.tsx",
|
|
596
|
+
"content": "import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Method,\n Prop,\n State,\n Watch,\n h,\n Host,\n} from '@stencil/core';\nimport {\n controlWidthClass,\n CONTROL_TEXT_VARIANT,\n DEFAULT_REQUIRED_MESSAGE,\n restoreStringFormState,\n setFormControlValue,\n setRequiredValidity,\n type ControlWidth,\n} from '../../utils';\n\nexport type TextareaSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type TextareaWidth = ControlWidth;\nexport type TextareaResize = 'vertical' | 'none';\n\nlet idCounter = 0;\n\n@Component({\n tag: 'ds-textarea',\n styleUrl: 'Textarea.css',\n scoped: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n private generatedId = `ds-textarea-${++idCounter}`;\n private errorId = `${this.generatedId}-error`;\n\n @Prop({ mutable: true }) value: string = '';\n @Prop({ reflect: true }) name: string | undefined;\n @Prop({ reflect: true }) form: string | undefined;\n @Prop({ reflect: true }) disabled: boolean = false;\n /** Keeps the value focusable and submittable while preventing edits. */\n @Prop({ reflect: true }) readOnly: boolean = false;\n @Prop({ reflect: true }) required: boolean = false;\n @Prop() requiredMessage: string = DEFAULT_REQUIRED_MESSAGE;\n @Prop() placeholder: string | undefined;\n /** Visible text rows before the field scrolls. */\n @Prop() rows: number = 4;\n /** Whether the user can resize the field vertically. */\n @Prop() resize: TextareaResize = 'vertical';\n /** Native browser autofill hint. */\n @Prop({ attribute: 'autocomplete' }) autoComplete: string | undefined;\n /** Preferred virtual keyboard without changing the value semantics. */\n @Prop({ attribute: 'inputmode' }) inputMode: string = '';\n /** Preferred virtual-keyboard action label. */\n @Prop({ attribute: 'enterkeyhint' }) enterKeyHint: string = '';\n /** Whether the browser should check spelling and grammar. */\n @Prop({ attribute: 'spellcheck' }) spellCheck: boolean = true;\n /** Control density for typography and inset spacing. */\n @Prop() size: TextareaSize = 'md';\n /** Width fit — fill the parent (default) or hug the available content. */\n @Prop() width: TextareaWidth = 'fill';\n /** Show the standard inset border, including focused and invalid strokes. */\n @Prop() hasBorder: boolean = true;\n /** Show the standard hover and pressed fill when the field is not embedded in interactive chrome. */\n @Prop() hasInteractionFill: boolean = true;\n @Prop() isInactive: boolean = false;\n @Prop() autoFocus: boolean = false;\n @Prop() error: boolean = false;\n @Prop() errorMessage: string | undefined;\n /** Associates the internal textarea with an external <label>. */\n @Prop() inputId: string | undefined;\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n @Prop({ attribute: 'aria-labelledby' }) ariaLabelledby: string | undefined;\n @Prop({ attribute: 'aria-describedby' }) ariaDescribedby: string | undefined;\n\n @Event() dsChange!: EventEmitter<string>;\n\n private initialValue = '';\n private textareaEl?: HTMLTextAreaElement;\n @State() private formDisabled = false;\n @State() private focused = false;\n @State() private touched = false;\n\n componentWillLoad() {\n this.initialValue = this.value;\n this.syncFormValue();\n }\n\n @Watch('value')\n @Watch('disabled')\n @Watch('isInactive')\n @Watch('required')\n syncFormValue() {\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n setFormControlValue(this.internals, this.value, { inactive });\n const missing = this.required && !inactive && this.value.length === 0;\n setRequiredValidity(this.internals, missing, this.requiredMessage);\n }\n\n formDisabledCallback(disabled: boolean) {\n this.formDisabled = disabled;\n this.syncFormValue();\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = restoreStringFormState(state);\n }\n\n @Method()\n async setFocus() {\n this.textareaEl?.focus();\n }\n\n private handleInput = (event: Event) => {\n this.value = (event.target as HTMLTextAreaElement).value;\n this.dsChange.emit(this.value);\n };\n\n private handleFocus = () => {\n this.focused = true;\n };\n\n private handleBlur = () => {\n this.focused = false;\n this.touched = true;\n };\n\n render() {\n const inputId = this.inputId ?? this.generatedId;\n const inactive = this.isInactive || this.disabled || this.formDisabled;\n const filled = this.value.length > 0;\n const dirty = this.value !== this.initialValue;\n const showError = this.error && Boolean(this.errorMessage);\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const rows = Number.isFinite(this.rows) ? Math.max(1, Math.floor(this.rows)) : 4;\n const describedBy =\n [this.ariaDescribedby, showError ? this.errorId : undefined].filter(Boolean).join(' ') ||\n undefined;\n\n return (\n <Host\n class={{\n 'textarea-host': true,\n 'ds-field-stack': true,\n 'ds-control-inactive': inactive,\n [`ds-control--${this.size}`]: true,\n ...controlWidthClass(this.width),\n }}\n data-disabled={inactive ? '' : undefined}\n data-readonly={this.readOnly ? '' : undefined}\n data-required={this.required ? '' : undefined}\n data-invalid={this.error ? '' : undefined}\n data-filled={filled ? '' : undefined}\n data-focused={this.focused ? '' : undefined}\n data-dirty={dirty ? '' : undefined}\n data-touched={this.touched ? '' : undefined}\n >\n <div\n class={{\n 'textarea-control': true,\n 'textarea-control--resizable': this.resize === 'vertical',\n 'textarea-control--bordered': this.hasBorder,\n 'textarea-control--error': this.hasBorder && this.error,\n 'ds-interaction-fill': this.hasInteractionFill,\n [`ds-control--${this.size}`]: true,\n }}\n >\n <textarea\n ref={element => {\n this.textareaEl = element;\n }}\n id={inputId}\n value={this.value}\n placeholder={this.placeholder}\n rows={rows}\n disabled={inactive}\n readOnly={this.readOnly}\n required={this.required}\n autoFocus={this.autoFocus}\n autoComplete={this.autoComplete}\n inputMode={this.inputMode || undefined}\n enterKeyHint={this.enterKeyHint || undefined}\n spellcheck={this.spellCheck}\n class={`native-textarea native-textarea--resize-${this.resize} ds-text--${textVariant.replace('text-', '')} ds-text--regular ds-interaction-fill__content`}\n aria-label={this.ariaLabel}\n aria-labelledby={this.ariaLabelledby}\n aria-describedby={describedBy}\n aria-invalid={this.error ? 'true' : undefined}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n {showError && (\n <ds-text\n class=\"error-text\"\n as=\"div\"\n variant=\"text-body-small\"\n color=\"negative\"\n textId={this.errorId}\n role=\"alert\"\n >\n {this.errorMessage}\n </ds-text>\n )}\n </Host>\n );\n }\n}\n",
|
|
597
|
+
"type": "registry:ui"
|
|
598
|
+
}
|
|
599
|
+
]
|
|
600
|
+
}
|