@fundamental-styles/mcp 0.41.7-rc.8 → 0.41.7
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/data/AI_USAGE.md +425 -0
- package/data/CHANGELOG.md +53 -3
- package/data/component-catalog.json +62 -209
- package/data/components/README.md +281 -0
- package/data/components/action-bar.md +443 -0
- package/data/components/ai-busy-indicator.md +79 -0
- package/data/components/ai-loading-bar.md +66 -0
- package/data/components/avatar-btp.md +198 -0
- package/data/components/avatar-group.md +2660 -0
- package/data/components/avatar-product-switch.md +476 -0
- package/data/components/avatar.md +993 -0
- package/data/components/bar.md +574 -0
- package/data/components/border-radius.md +148 -0
- package/data/components/border.md +412 -0
- package/data/components/breadcrumb.md +546 -0
- package/data/components/button-2.md +440 -0
- package/data/components/button-action-sheet.md +292 -0
- package/data/components/button-ai.md +730 -0
- package/data/components/button-btp.md +223 -0
- package/data/components/button-button.md +233 -0
- package/data/components/button-counter.md +176 -0
- package/data/components/button-patterns.md +731 -0
- package/data/components/button-split.md +459 -0
- package/data/components/button.md +469 -0
- package/data/components/calendar.md +5784 -0
- package/data/components/card-card-media.md +707 -0
- package/data/components/card-card.md +2426 -0
- package/data/components/card-layouts.md +1201 -0
- package/data/components/card.md +2404 -0
- package/data/components/carousel.md +1506 -0
- package/data/components/code.md +139 -0
- package/data/components/component-reset.md +272 -0
- package/data/components/components-icons-businesssuiteinappsymbol-icons.md +85 -0
- package/data/components/components-icons-sap-icons.md +147 -0
- package/data/components/components-icons-tnt-icons.md +85 -0
- package/data/components/container-queries.md +221 -0
- package/data/components/container.md +227 -0
- package/data/components/dialog-docs-static-busy-indicator.md +165 -0
- package/data/components/dialog-docs-static-dialog.md +949 -0
- package/data/components/dialog-docs-static-patterns.md +147 -0
- package/data/components/dialog-docs-static-settings.md +528 -0
- package/data/components/dialog-docs-static.md +982 -0
- package/data/components/dialog.md +606 -0
- package/data/components/dynamic-page-dynamic-page.md +1914 -0
- package/data/components/dynamic-page.md +973 -0
- package/data/components/dynamic-side.md +197 -0
- package/data/components/elevation.md +110 -0
- package/data/components/feed-input.md +346 -0
- package/data/components/feed-list.md +580 -0
- package/data/components/fieldset-2.md +292 -0
- package/data/components/fieldset-forms.md +169 -0
- package/data/components/fieldset.md +381 -0
- package/data/components/flexible-column-layout.md +205 -0
- package/data/components/form-group.md +287 -0
- package/data/components/form-header.md +71 -0
- package/data/components/form-item-2.md +98 -0
- package/data/components/form-item-3.md +134 -0
- package/data/components/form-item-4.md +556 -0
- package/data/components/form-item-5.md +182 -0
- package/data/components/form-item-6.md +539 -0
- package/data/components/form-item-7.md +239 -0
- package/data/components/form-item-ai.md +158 -0
- package/data/components/form-item-file-uploader.md +445 -0
- package/data/components/form-item-forms.md +234 -0
- package/data/components/form-item-patterns.md +426 -0
- package/data/components/form-item.md +464 -0
- package/data/components/form-label-ai.md +126 -0
- package/data/components/form-label-layouts.md +306 -0
- package/data/components/form-label-patterns.md +1175 -0
- package/data/components/form-label-status-indicator.md +1083 -0
- package/data/components/form-label-step-input.md +620 -0
- package/data/components/form-label.md +2876 -0
- package/data/components/generic-tag.md +747 -0
- package/data/components/grid-list-grid-list.md +1185 -0
- package/data/components/grid-list.md +1449 -0
- package/data/components/heading.md +66 -0
- package/data/components/horizontal-navigation.md +568 -0
- package/data/components/icon-tab-bar-dev.md +190 -0
- package/data/components/icon-tab-bar.md +2620 -0
- package/data/components/icon.md +171 -0
- package/data/components/iconBusinessSuite.md +92 -0
- package/data/components/iconTnt.md +92 -0
- package/data/components/illustrated-message.md +439 -0
- package/data/components/info-label.md +348 -0
- package/data/components/input-group.md +2068 -0
- package/data/components/label.md +66 -0
- package/data/components/layout-grid.md +447 -0
- package/data/components/layout-panel.md +261 -0
- package/data/components/layouts-layout-grid.md +608 -0
- package/data/components/layouts-paddings.md +133 -0
- package/data/components/layouts-section.md +287 -0
- package/data/components/list-2.md +148 -0
- package/data/components/list-3.md +735 -0
- package/data/components/list-list.md +790 -0
- package/data/components/list-object-list.md +1225 -0
- package/data/components/list.md +1286 -0
- package/data/components/media-queries.md +168 -0
- package/data/components/menu.md +946 -0
- package/data/components/message-box-docs-static-ai.md +149 -0
- package/data/components/message-box-docs-static.md +527 -0
- package/data/components/message-page-upload-collection.md +678 -0
- package/data/components/message-page.md +256 -0
- package/data/components/message-strip.md +977 -0
- package/data/components/message-toast.md +119 -0
- package/data/components/micro-process-flow.md +991 -0
- package/data/components/navigation-menu.md +366 -0
- package/data/components/navigation-navigation.md +1245 -0
- package/data/components/navigation.md +2604 -0
- package/data/components/numeric-content.md +317 -0
- package/data/components/object-attribute.md +96 -0
- package/data/components/object-identifier.md +227 -0
- package/data/components/object-marker.md +202 -0
- package/data/components/object-number.md +327 -0
- package/data/components/object-status.md +1538 -0
- package/data/components/off-screen.md +87 -0
- package/data/components/overflow.md +97 -0
- package/data/components/padding.md +122 -0
- package/data/components/paddings.md +130 -0
- package/data/components/page.md +300 -0
- package/data/components/pagination.md +672 -0
- package/data/components/panel-layouts.md +345 -0
- package/data/components/panel.md +514 -0
- package/data/components/patterns-label.md +74 -0
- package/data/components/popover-2.md +906 -0
- package/data/components/popover-ai.md +466 -0
- package/data/components/popover-btp.md +886 -0
- package/data/components/popover-deprecated.md +308 -0
- package/data/components/popover-message-popover.md +683 -0
- package/data/components/popover-notification.md +1511 -0
- package/data/components/popover-patterns.md +1100 -0
- package/data/components/popover-popover.md +1862 -0
- package/data/components/popover-quick-view.md +385 -0
- package/data/components/popover-timepicker.md +1836 -0
- package/data/components/popover-user-menu.md +1303 -0
- package/data/components/popover.md +1938 -0
- package/data/components/progress-indicator.md +351 -0
- package/data/components/prompt-input-ai.md +226 -0
- package/data/components/prompt-input.md +226 -0
- package/data/components/rating-indicator.md +1469 -0
- package/data/components/resizable-card-layout.md +951 -0
- package/data/components/scrollbar.md +86 -0
- package/data/components/search-field.md +287 -0
- package/data/components/section.md +250 -0
- package/data/components/segmented-button.md +324 -0
- package/data/components/shellbar.md +2183 -0
- package/data/components/side-nav.md +1562 -0
- package/data/components/skeleton.md +243 -0
- package/data/components/slider.md +395 -0
- package/data/components/splitter.md +353 -0
- package/data/components/table.md +2749 -0
- package/data/components/tabs.md +658 -0
- package/data/components/text-text.md +380 -0
- package/data/components/text.md +253 -0
- package/data/components/tile.md +1132 -0
- package/data/components/time.md +818 -0
- package/data/components/title.md +153 -0
- package/data/components/titles.md +83 -0
- package/data/components/token.md +311 -0
- package/data/components/tokenizer.md +398 -0
- package/data/components/tool-header.md +1352 -0
- package/data/components/tool-layout.md +199 -0
- package/data/components/toolbar-ai.md +174 -0
- package/data/components/toolbar-btp.md +526 -0
- package/data/components/toolbar-title-bar.md +473 -0
- package/data/components/toolbar.md +432 -0
- package/data/components/tree.md +1031 -0
- package/data/components/typography.md +435 -0
- package/data/components/variant-management.md +360 -0
- package/data/components/vertical-nav.md +589 -0
- package/data/components/wizard.md +1429 -0
- package/data/examples/Components/dialog/device-specifications.example.html +39 -30
- package/data/examples/Components/shellbar/optional-items.example.html +210 -157
- package/data/examples/Components/shellbar/overflow-toolbar.example.html +202 -177
- package/data/examples/Components/shellbar/responsive-paddings.example.html +217 -146
- package/data/examples/Components/shellbar/responsiveness.example.html +825 -613
- package/data/examples/Components/user-menu/default.example.html +241 -83
- package/data/schemas/badge.schema.json +1 -1
- package/data/schemas/button-split.schema.json +1 -1
- package/data/schemas/component-frontmatter.schema.json +123 -0
- package/data/schemas/component-markdown.schema.json +81 -0
- package/data/schemas/counter.schema.json +1 -1
- package/data/schemas/dynamic-page.schema.json +1 -1
- package/data/schemas/dynamic-side-content.schema.json +1 -1
- package/data/schemas/facet.schema.json +1 -1
- package/data/schemas/fieldset.schema.json +1 -1
- package/data/schemas/flexible-column-layout.schema.json +1 -1
- package/data/schemas/form-group.schema.json +3 -2
- package/data/schemas/form-header.schema.json +1 -1
- package/data/schemas/form-label.schema.json +1 -0
- package/data/schemas/form-message.schema.json +1 -1
- package/data/schemas/grid-list.schema.json +1 -1
- package/data/schemas/input-group.schema.json +1 -1
- package/data/schemas/layout-panel.schema.json +1 -1
- package/data/schemas/page.schema.json +1 -1
- package/data/schemas/quick-view.schema.json +2 -1
- package/data/schemas/section.schema.json +1 -1
- package/data/schemas/side-nav.schema.json +1 -1
- package/data/schemas/splitter.schema.json +1 -1
- package/data/schemas/tabs.schema.json +1 -1
- package/data/schemas/tile.schema.json +1 -1
- package/data/schemas/tool-layout.schema.json +1 -1
- package/data/schemas/user-menu.schema.json +10 -0
- package/data/schemas/wizard.schema.json +1 -1
- package/package.json +1 -1
- package/src/data/load-catalog.d.ts +2 -0
- package/src/data/load-catalog.js +5 -1
- package/src/data/load-catalog.js.map +1 -1
- package/src/data/load-markdown-docs.d.ts +44 -0
- package/src/data/load-markdown-docs.js +179 -0
- package/src/data/load-markdown-docs.js.map +1 -0
- package/src/data/markdown-cache.d.ts +60 -0
- package/src/data/markdown-cache.js +218 -0
- package/src/data/markdown-cache.js.map +1 -0
- package/src/server.js +72 -1
- package/src/server.js.map +1 -1
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: fd-form-item
|
|
3
|
+
title: Components/File Uploader
|
|
4
|
+
category: Components
|
|
5
|
+
selector: fd-form-item
|
|
6
|
+
cssFile: form-item.css
|
|
7
|
+
sourcePath: packages/styles/stories/Components/file-uploader/file-uploader.stories.js
|
|
8
|
+
tags: []
|
|
9
|
+
dependencies: ["button","file-uploader","form-item","form-label","info-label","input","message-strip","object-status"]
|
|
10
|
+
relatedComponents: ["button","file-uploader","form-item","form-label","info-label","input","message-strip","object-status"]
|
|
11
|
+
stability: stable
|
|
12
|
+
generatedAt: 2026-06-09T18:29:01.564Z
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Components/File Uploader
|
|
16
|
+
|
|
17
|
+
The File Uploader component allows the user to select the files from the system to upload.
|
|
18
|
+
It is an opinionated composition of the input and button components.
|
|
19
|
+
|
|
20
|
+
##Usage
|
|
21
|
+
|
|
22
|
+
Use the File Uploader if:
|
|
23
|
+
|
|
24
|
+
* The user needs to select the files to upload by browsing the system folders.
|
|
25
|
+
* The user needs to select the files based on specific file formats to upload.
|
|
26
|
+
|
|
27
|
+
## Usage Guidelines
|
|
28
|
+
|
|
29
|
+
Use the File Uploader if:
|
|
30
|
+
|
|
31
|
+
* The user needs to select the files to upload by browsing the system folders.
|
|
32
|
+
* The user needs to select the files based on specific file formats to upload.
|
|
33
|
+
|
|
34
|
+
## Dependencies
|
|
35
|
+
|
|
36
|
+
This component depends on the following CSS files:
|
|
37
|
+
|
|
38
|
+
- `button.css`
|
|
39
|
+
- `file-uploader.css`
|
|
40
|
+
- `form-item.css`
|
|
41
|
+
- `form-label.css`
|
|
42
|
+
- `info-label.css`
|
|
43
|
+
- `input.css`
|
|
44
|
+
- `message-strip.css`
|
|
45
|
+
- `object-status.css`
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install fundamental-styles
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<!-- Include theme -->
|
|
55
|
+
<link href="node_modules/fundamental-styles/dist/theming/sap_horizon.css" rel="stylesheet">
|
|
56
|
+
|
|
57
|
+
<!-- Include component CSS -->
|
|
58
|
+
<link href="node_modules/fundamental-styles/dist/form-item.css" rel="stylesheet">
|
|
59
|
+
|
|
60
|
+
<!-- Include dependencies -->
|
|
61
|
+
<link href="node_modules/fundamental-styles/dist/button.css" rel="stylesheet">
|
|
62
|
+
<link href="node_modules/fundamental-styles/dist/file-uploader.css" rel="stylesheet">
|
|
63
|
+
<link href="node_modules/fundamental-styles/dist/form-item.css" rel="stylesheet">
|
|
64
|
+
<link href="node_modules/fundamental-styles/dist/form-label.css" rel="stylesheet">
|
|
65
|
+
<link href="node_modules/fundamental-styles/dist/info-label.css" rel="stylesheet">
|
|
66
|
+
<link href="node_modules/fundamental-styles/dist/input.css" rel="stylesheet">
|
|
67
|
+
<link href="node_modules/fundamental-styles/dist/message-strip.css" rel="stylesheet">
|
|
68
|
+
<link href="node_modules/fundamental-styles/dist/object-status.css" rel="stylesheet">
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Basic Usage
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<div class="fd-form-item">
|
|
75
|
+
<label class="fd-form-label" id="browse_input1_label" >Upload Document</label>
|
|
76
|
+
<div class="fd-file-uploader">
|
|
77
|
+
<div class="fd-file-uploader__container">
|
|
78
|
+
<input
|
|
79
|
+
aria-labelledby="browse_input1_label"
|
|
80
|
+
class="fd-input fd-file-uploader__input"
|
|
81
|
+
onclick="browseFile('input1');"
|
|
82
|
+
title="Select a file"
|
|
83
|
+
type="text"
|
|
84
|
+
id="browse_input1"
|
|
85
|
+
autocomplete="off"
|
|
86
|
+
placeholder="Select a file"
|
|
87
|
+
>
|
|
88
|
+
|
|
89
|
+
<button
|
|
90
|
+
class="fd-button"
|
|
91
|
+
onclick="browseFile('input1');"
|
|
92
|
+
id="file-uploader-button-1"
|
|
93
|
+
aria-label="Select a file for uploading">
|
|
94
|
+
Browse...
|
|
95
|
+
</button>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<input
|
|
99
|
+
aria-labelledby="browse_input1_label"
|
|
100
|
+
hidden
|
|
101
|
+
id="input1"
|
|
102
|
+
class="fd-file-uploader__hidden"
|
|
103
|
+
type="file"
|
|
104
|
+
onchange="selectFile(this,'browse_input1')">
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## States
|
|
110
|
+
|
|
111
|
+
| Class | Description |
|
|
112
|
+
|-------|-------------|
|
|
113
|
+
| `is-error` | Error state |
|
|
114
|
+
| `is-information` | Information state |
|
|
115
|
+
| `is-success` | Success state |
|
|
116
|
+
| `is-warning` | Warning state |
|
|
117
|
+
|
|
118
|
+
## Related Components
|
|
119
|
+
|
|
120
|
+
This component works with or depends on:
|
|
121
|
+
|
|
122
|
+
- `button`
|
|
123
|
+
- `file-uploader`
|
|
124
|
+
- `form-item`
|
|
125
|
+
- `form-label`
|
|
126
|
+
- `info-label`
|
|
127
|
+
- `input`
|
|
128
|
+
- `message-strip`
|
|
129
|
+
- `object-status`
|
|
130
|
+
|
|
131
|
+
## Design Tokens
|
|
132
|
+
|
|
133
|
+
Key CSS variables used by this component:
|
|
134
|
+
|
|
135
|
+
- `--horizontal`
|
|
136
|
+
|
|
137
|
+
## Examples
|
|
138
|
+
|
|
139
|
+
### Default
|
|
140
|
+
|
|
141
|
+
File Uploader is a composition of the \
|
|
142
|
+
|
|
143
|
+
```html
|
|
144
|
+
<div class="fd-form-item">
|
|
145
|
+
<label class="fd-form-label" id="browse_input1_label" >Upload Document</label>
|
|
146
|
+
<div class="fd-file-uploader">
|
|
147
|
+
<div class="fd-file-uploader__container">
|
|
148
|
+
<input
|
|
149
|
+
aria-labelledby="browse_input1_label"
|
|
150
|
+
class="fd-input fd-file-uploader__input"
|
|
151
|
+
onclick="browseFile('input1');"
|
|
152
|
+
title="Select a file"
|
|
153
|
+
type="text"
|
|
154
|
+
id="browse_input1"
|
|
155
|
+
autocomplete="off"
|
|
156
|
+
placeholder="Select a file"
|
|
157
|
+
>
|
|
158
|
+
|
|
159
|
+
<button
|
|
160
|
+
class="fd-button"
|
|
161
|
+
onclick="browseFile('input1');"
|
|
162
|
+
id="file-uploader-button-1"
|
|
163
|
+
aria-label="Select a file for uploading">
|
|
164
|
+
Browse...
|
|
165
|
+
</button>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<input
|
|
169
|
+
aria-labelledby="browse_input1_label"
|
|
170
|
+
hidden
|
|
171
|
+
id="input1"
|
|
172
|
+
class="fd-file-uploader__hidden"
|
|
173
|
+
type="file"
|
|
174
|
+
onchange="selectFile(this,'browse_input1')">
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### After Selecting
|
|
180
|
+
|
|
181
|
+
Once the user selects files, update the input and the hidden div to include the file names. The hidden div will announce the file names only once when the value changes.
|
|
182
|
+
|
|
183
|
+
```html
|
|
184
|
+
<div class="fd-form-item">
|
|
185
|
+
<label class="fd-form-label" id="browse_input2_label" >Upload Document</label>
|
|
186
|
+
<div class="fd-file-uploader">
|
|
187
|
+
<div class="fd-file-uploader__container">
|
|
188
|
+
<input
|
|
189
|
+
aria-labelledby="browse_input2_label"
|
|
190
|
+
class="fd-input fd-file-uploader__input"
|
|
191
|
+
onclick="browseFile('input1');"
|
|
192
|
+
title="document.pdf"
|
|
193
|
+
type="text"
|
|
194
|
+
id="browse_input2"
|
|
195
|
+
autocomplete="off"
|
|
196
|
+
value="document.pdf"
|
|
197
|
+
>
|
|
198
|
+
<button
|
|
199
|
+
class="fd-button"
|
|
200
|
+
onclick="browseFile('input1');"
|
|
201
|
+
id="file-uploader-button-1"
|
|
202
|
+
aria-label="Select a file for uploading">Browse...
|
|
203
|
+
</button>
|
|
204
|
+
</div>
|
|
205
|
+
<div class="fd-file-uploader__hidden" aria-live="polite" aria-atomic="true">document.pdf</div>
|
|
206
|
+
<input
|
|
207
|
+
aria-labelledby="browse_input2_label"
|
|
208
|
+
hidden
|
|
209
|
+
id="input1"
|
|
210
|
+
class="fd-file-uploader__hidden"
|
|
211
|
+
type="file"
|
|
212
|
+
onchange="selectFile(this,'browse_input2')"
|
|
213
|
+
>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Status
|
|
219
|
+
|
|
220
|
+
For Status File Uploader apply the corresponding status class `is-success`, `is-error`, `is-warning`, `is-information ` modifier to the input element.
|
|
221
|
+
|
|
222
|
+
```html
|
|
223
|
+
<div class="fd-form-item">
|
|
224
|
+
<label class="fd-form-label" id="browse_input7_label">Upload Document (Success)</label>
|
|
225
|
+
<div class="fd-file-uploader">
|
|
226
|
+
<div class="fd-file-uploader__container">
|
|
227
|
+
<input
|
|
228
|
+
aria-labelledby="browse_input7_label"
|
|
229
|
+
class="fd-input fd-file-uploader__input is-success"
|
|
230
|
+
onclick="browseFile('input2');"
|
|
231
|
+
id="browse_input7"
|
|
232
|
+
type="text"
|
|
233
|
+
title="Select a file"
|
|
234
|
+
placeholder="Select a file"
|
|
235
|
+
autocomplete="off"
|
|
236
|
+
>
|
|
237
|
+
<button
|
|
238
|
+
class="fd-button fd-file-uploader__button"
|
|
239
|
+
onclick="browseFile('input2');"
|
|
240
|
+
id="file-uploader-button-7"
|
|
241
|
+
aria-label="Select a file for uploading">Browse...
|
|
242
|
+
</button>
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<input
|
|
246
|
+
aria-labelledby="browse_input7_label"
|
|
247
|
+
hidden
|
|
248
|
+
id="input6"
|
|
249
|
+
class="fd-file-uploader__hidden"
|
|
250
|
+
type="file"
|
|
251
|
+
onchange="selectFile(this,'browse_input7')">
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
<label class="fd-form-label" id="browse_input4_label">Upload Document (Error)</label>
|
|
255
|
+
<div class="fd-file-uploader">
|
|
256
|
+
<div class="fd-file-uploader__container">
|
|
257
|
+
<input
|
|
258
|
+
aria-labelledby="browse_input4_label"
|
|
259
|
+
class="fd-input fd-file-uploader__input is-error"
|
|
260
|
+
onclick="browseFile('input2');"
|
|
261
|
+
id="browse_input4"
|
|
262
|
+
type="text"
|
|
263
|
+
title="Select a file"
|
|
264
|
+
placeholder="Select a file"
|
|
265
|
+
autocomplete="off"
|
|
266
|
+
>
|
|
267
|
+
<button
|
|
268
|
+
class="fd-button fd-file-uploader__button"
|
|
269
|
+
onclick="browseFile('input2');"
|
|
270
|
+
id="file-uploader-button-4"
|
|
271
|
+
aria-label="Select a file for uploading">Browse...
|
|
272
|
+
</button>
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<input
|
|
276
|
+
aria-labelledby="browse_input4_label"
|
|
277
|
+
hidden
|
|
278
|
+
id="input3"
|
|
279
|
+
class="fd-file-uploader__hidden"
|
|
280
|
+
type="file"
|
|
281
|
+
onchange="selectFile(this,'browse_input4')">
|
|
282
|
+
</div>
|
|
283
|
+
<label class="fd-form-label" id="browse_input5_label">Upload Document (Warning)</label>
|
|
284
|
+
<div class="fd-file-uploader">
|
|
285
|
+
<div class="fd-file-uploader__container">
|
|
286
|
+
<input
|
|
287
|
+
aria-labelledby="browse_input5_label"
|
|
288
|
+
class="fd-input fd-file-uploader__input is-warning"
|
|
289
|
+
onclick="browseFile('input2');"
|
|
290
|
+
id="browse_input5"
|
|
291
|
+
type="text"
|
|
292
|
+
title="Select a file"
|
|
293
|
+
placeholder="Select a file"
|
|
294
|
+
autocomplete="off"
|
|
295
|
+
>
|
|
296
|
+
<button
|
|
297
|
+
class="fd-button fd-file-uploader__button"
|
|
298
|
+
onclick="browseFile('input2');"
|
|
299
|
+
id="file-uploader-button-5"
|
|
300
|
+
aria-label="Select a file for uploading">Browse...
|
|
301
|
+
</button>
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
<input
|
|
305
|
+
aria-labelledby="browse_input5_label"
|
|
306
|
+
hidden
|
|
307
|
+
id="input4"
|
|
308
|
+
class="fd-file-uploader__hidden"
|
|
309
|
+
type="file"
|
|
310
|
+
onchange="selectFile(this,'browse_input5')">
|
|
311
|
+
</div>
|
|
312
|
+
<label class="fd-form-label" id="browse_input6_label">Upload Document (Information)</label>
|
|
313
|
+
<div class="fd-file-uploader">
|
|
314
|
+
<div class="fd-file-uploader__container">
|
|
315
|
+
<input
|
|
316
|
+
aria-labelledby="browse_input6_label"
|
|
317
|
+
class="fd-input fd-file-uploader__input is-information"
|
|
318
|
+
onclick="browseFile('input2');"
|
|
319
|
+
id="browse_input3"
|
|
320
|
+
type="text"
|
|
321
|
+
title="Select a file"
|
|
322
|
+
placeholder="Select a file"
|
|
323
|
+
autocomplete="off"
|
|
324
|
+
>
|
|
325
|
+
<button
|
|
326
|
+
class="fd-button fd-file-uploader__button"
|
|
327
|
+
onclick="browseFile('input2');"
|
|
328
|
+
id="file-uploader-button-6"
|
|
329
|
+
aria-label="Select a file for uploading">Browse...
|
|
330
|
+
</button>
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
<input
|
|
334
|
+
aria-labelledby="browse_input6_label"
|
|
335
|
+
hidden
|
|
336
|
+
id="input5"
|
|
337
|
+
class="fd-file-uploader__hidden"
|
|
338
|
+
type="file"
|
|
339
|
+
onchange="selectFile(this,'browse_input6')">
|
|
340
|
+
</div>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### File Uploader with File List
|
|
344
|
+
|
|
345
|
+
<span class="fd-info-label fd-info-label--accent-color-3"><span class="fd-info-label__text">non-fiori 3</span></span><span style="margin-right: 0.5rem;"></span><span class="fd-info-label fd-info-label--accent-color-4"><span class="fd-info-label__text">CX</span></span>
|
|
346
|
+
|
|
347
|
+
```html
|
|
348
|
+
<div class="fd-form-item">
|
|
349
|
+
<div class="fd-file-uploader">
|
|
350
|
+
<div class="fd-file-uploader__container">
|
|
351
|
+
<input
|
|
352
|
+
class="fd-input fd-file-uploader__input"
|
|
353
|
+
title="Select a file"
|
|
354
|
+
type="text"
|
|
355
|
+
autocomplete="off"
|
|
356
|
+
placeholder="Select a file">
|
|
357
|
+
<button class="fd-button" title="Browse for a file" aria-label="Select a file for uploading">
|
|
358
|
+
Browse...
|
|
359
|
+
</button>
|
|
360
|
+
</div>
|
|
361
|
+
|
|
362
|
+
<input hidden class="fd-file-uploader__hidden" type="file">
|
|
363
|
+
<div class="fd-file-uploader__uploaded-files">
|
|
364
|
+
<p class="fd-file-uploader__label">No File Selected</p>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<hr><div class="fd-form-item">
|
|
370
|
+
<div class="fd-file-uploader">
|
|
371
|
+
<div class="fd-file-uploader__container">
|
|
372
|
+
<input class="fd-input fd-file-uploader__input" title="Select a file" type="text" autocomplete="off" placeholder="Select a file">
|
|
373
|
+
<button class="fd-button" title="Browse for a file" aria-label="Select a file for uploading">
|
|
374
|
+
Browse...
|
|
375
|
+
</button>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<input aria-labelledby="browse_input1_label" hidden class="fd-file-uploader__hidden" type="file">
|
|
379
|
+
|
|
380
|
+
<div class="fd-file-uploader__uploaded-files">
|
|
381
|
+
<h3 class="fd-file-uploader__label">File Selected:</h3>
|
|
382
|
+
<ul class="fd-file-uploader__list">
|
|
383
|
+
<li class="fd-file-uploader__list-item">
|
|
384
|
+
<span class="fd-object-status fd-object-status--positive">
|
|
385
|
+
<i class="fd-object-status__icon sap-icon--message-success" role="presentation"></i>
|
|
386
|
+
<span class="fd-object-status__text">Filename.format</span>
|
|
387
|
+
</span>
|
|
388
|
+
<div class="fd-file-uploader__actions">
|
|
389
|
+
<button title="Download File" aria-label="Download" class="fd-button fd-button--transparent">
|
|
390
|
+
<i class="sap-icon--download"></i>
|
|
391
|
+
</button>
|
|
392
|
+
<button title="Delete File" aria-label="Delete" class="fd-button fd-button--transparent">
|
|
393
|
+
<i class="sap-icon--decline"></i>
|
|
394
|
+
</button>
|
|
395
|
+
</div>
|
|
396
|
+
</li>
|
|
397
|
+
<li class="fd-file-uploader__list-item">
|
|
398
|
+
<span class="fd-object-status fd-object-status--positive">
|
|
399
|
+
<i class="fd-object-status__icon sap-icon--message-success" role="presentation"></i>
|
|
400
|
+
<span class="fd-object-status__text">Verylonglonglonglonglonglongfilename.format</span>
|
|
401
|
+
</span>
|
|
402
|
+
<div class="fd-file-uploader__actions">
|
|
403
|
+
<button title="Download File" aria-label="Download" class="fd-button fd-button--transparent">
|
|
404
|
+
<i class="sap-icon--download"></i>
|
|
405
|
+
</button>
|
|
406
|
+
<button title="Delete File" aria-label="Delete" class="fd-button fd-button--transparent">
|
|
407
|
+
<i class="sap-icon--decline"></i>
|
|
408
|
+
</button>
|
|
409
|
+
</div>
|
|
410
|
+
</li>
|
|
411
|
+
</ul>
|
|
412
|
+
|
|
413
|
+
<h3 class="fd-file-uploader__label">Invalid Files:</h3>
|
|
414
|
+
<ul class="fd-file-uploader__list">
|
|
415
|
+
<li class="fd-file-uploader__list-item">
|
|
416
|
+
<span class="fd-object-status fd-object-status--negative">
|
|
417
|
+
<i class="fd-object-status__icon sap-icon--message-error" role="presentation"></i>
|
|
418
|
+
<span class="fd-object-status__text">Negative Object Status</span>
|
|
419
|
+
</span>
|
|
420
|
+
</li>
|
|
421
|
+
<li class="fd-file-uploader__list-item">
|
|
422
|
+
<div class="fd-message-strip fd-message-strip--error fd-message-strip--no-icon" role="alert">
|
|
423
|
+
<p class="fd-message-strip__text">
|
|
424
|
+
Example text: File with 12343 bytes is too big. Maximum of 1 byte are allowed.
|
|
425
|
+
</p>
|
|
426
|
+
</div>
|
|
427
|
+
</li>
|
|
428
|
+
</ul>
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
</div>
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Accessibility
|
|
435
|
+
|
|
436
|
+
- Use semantic HTML elements where appropriate
|
|
437
|
+
- Include proper ARIA attributes for interactive elements
|
|
438
|
+
- Ensure keyboard navigation support
|
|
439
|
+
- Provide adequate color contrast
|
|
440
|
+
|
|
441
|
+
## Source
|
|
442
|
+
|
|
443
|
+
This documentation was automatically generated from: `packages/styles/stories/Components/file-uploader/file-uploader.stories.js`
|
|
444
|
+
|
|
445
|
+
For the latest updates and interactive examples, see [Storybook](https://sap.github.io/fundamental-styles/).
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: fd-form-item
|
|
3
|
+
title: Components/Forms/Textarea
|
|
4
|
+
category: Components
|
|
5
|
+
selector: fd-form-item
|
|
6
|
+
cssFile: form-item.css
|
|
7
|
+
sourcePath: packages/styles/stories/Components/Forms/textarea/textarea.stories.js
|
|
8
|
+
tags: []
|
|
9
|
+
dependencies: []
|
|
10
|
+
relatedComponents: []
|
|
11
|
+
stability: stable
|
|
12
|
+
generatedAt: 2026-06-09T18:29:01.515Z
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Components/Forms/Textarea
|
|
16
|
+
|
|
17
|
+
The text area is an input component that allows the user to enter several lines of text.
|
|
18
|
+
Use the text area if you want users to enter multiple lines of unformatted text.
|
|
19
|
+
|
|
20
|
+
Do not use the text area if
|
|
21
|
+
|
|
22
|
+
- You only want them to enter a single line of text, use the input component instead.
|
|
23
|
+
- Users need to enter formatted text. Use the rich text editor instead.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install fundamental-styles
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- Include theme -->
|
|
33
|
+
<link href="node_modules/fundamental-styles/dist/theming/sap_horizon.css" rel="stylesheet">
|
|
34
|
+
|
|
35
|
+
<!-- Include component CSS -->
|
|
36
|
+
<link href="node_modules/fundamental-styles/dist/form-item.css" rel="stylesheet">
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Basic Usage
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<div class="fd-form-item">
|
|
44
|
+
<label class="fd-form-label" for="textarea-1">Message:</label>
|
|
45
|
+
<textarea class="fd-textarea" id="textarea-1" placeholder="Write something here" rows="4" aria-required="false"></textarea>
|
|
46
|
+
</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## States
|
|
50
|
+
|
|
51
|
+
| Class | Description |
|
|
52
|
+
|-------|-------------|
|
|
53
|
+
| `is-error` | Error state |
|
|
54
|
+
| `is-focus` | Focus state |
|
|
55
|
+
| `is-information` | Information state |
|
|
56
|
+
| `is-success` | Success state |
|
|
57
|
+
| `is-warning` | Warning state |
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
### Primary
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<div class="fd-form-item">
|
|
65
|
+
<label class="fd-form-label" for="textarea-1">Message:</label>
|
|
66
|
+
<textarea class="fd-textarea" id="textarea-1" placeholder="Write something here" rows="4" aria-required="false"></textarea>
|
|
67
|
+
</div>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Counter
|
|
71
|
+
|
|
72
|
+
Textarea can have a counter to display the number of characters entered or left to type. The counter is displayed below the textarea.
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<div class="fd-form-item">
|
|
76
|
+
<label class="fd-form-label" for="textarea-2">Message</label>
|
|
77
|
+
|
|
78
|
+
<textarea
|
|
79
|
+
class="fd-textarea"
|
|
80
|
+
id="textarea-2"
|
|
81
|
+
name="message"
|
|
82
|
+
rows="4"
|
|
83
|
+
maxlength="200"
|
|
84
|
+
aria-required="false"
|
|
85
|
+
placeholder="Write something here"
|
|
86
|
+
aria-labelledby="textarea-2-counter"
|
|
87
|
+
></textarea>
|
|
88
|
+
|
|
89
|
+
<div class="fd-textarea-counter" id="textarea-2-counter">
|
|
90
|
+
200 characters left
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### DisabledAndReadOnly
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<div class="fd-form-item">
|
|
99
|
+
<label class="fd-form-label" for="textarea-7" aria-disabled="true">Message (Disabled)</label>
|
|
100
|
+
<textarea
|
|
101
|
+
class="fd-textarea"
|
|
102
|
+
rows="2"
|
|
103
|
+
id="textarea-7"
|
|
104
|
+
name="message-disabled"
|
|
105
|
+
aria-required="false"
|
|
106
|
+
disabled
|
|
107
|
+
aria-disabled="true">Disabled textarea
|
|
108
|
+
</textarea>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div class="fd-form-item">
|
|
112
|
+
<label class="fd-form-label" for="textarea-8">Message (Read-Only)</label>
|
|
113
|
+
<textarea
|
|
114
|
+
class="fd-textarea"
|
|
115
|
+
rows="2"
|
|
116
|
+
id="textarea-8"
|
|
117
|
+
name="message-readonly"
|
|
118
|
+
aria-required="false"
|
|
119
|
+
readonly
|
|
120
|
+
aria-readonly="true">Read Only textarea
|
|
121
|
+
</textarea>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div class="fd-form-item">
|
|
125
|
+
<label class="fd-form-label" for="textarea-9">Message (Read-Only & Focused)</label>
|
|
126
|
+
<textarea
|
|
127
|
+
class="fd-textarea is-focus"
|
|
128
|
+
rows="2"
|
|
129
|
+
id="textarea-9"
|
|
130
|
+
name="message-readonly-focus"
|
|
131
|
+
aria-required="false"
|
|
132
|
+
readonly
|
|
133
|
+
aria-readonly="true"
|
|
134
|
+
>Focused Read Only textarea</textarea>
|
|
135
|
+
</div>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### States
|
|
139
|
+
|
|
140
|
+
As with any other input component, you can validate the fields and show the result as a value state of the component. Possible value states are error, warning, success, information, or neutral (none).
|
|
141
|
+
|
|
142
|
+
```html
|
|
143
|
+
<div class="fd-form-item">
|
|
144
|
+
<label class="fd-form-label" for="textarea-3">Success message:</label>
|
|
145
|
+
<div class="fd-popover">
|
|
146
|
+
<div class="fd-popover__control" aria-controls="popoverT51" aria-expanded="true" aria-haspopup="true">
|
|
147
|
+
<textarea
|
|
148
|
+
class="fd-textarea is-success"
|
|
149
|
+
rows="2"
|
|
150
|
+
id="textarea-3"
|
|
151
|
+
placeholder="Enter your message here"
|
|
152
|
+
aria-required="false"
|
|
153
|
+
aria-labelledby="textarea-3-count"
|
|
154
|
+
aria-describedby="textarea-3-message popoverT51"></textarea>
|
|
155
|
+
<div class="fd-textarea__sr-only" id="textarea-3-message">Value State Success</div>
|
|
156
|
+
</div>
|
|
157
|
+
<div class="fd-popover__body fd-popover__body--input-message-group fd-popover__body--no-arrow" aria-hidden="false" id="popoverT51">
|
|
158
|
+
<div class="fd-form-message fd-form-message--success">Your input was successfully saved.</div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="fd-textarea-counter" id="textarea-3-count">150 characters remaining</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div class="fd-form-item">
|
|
165
|
+
<label class="fd-form-label" for="textarea-4">Error message:</label>
|
|
166
|
+
<div class="fd-popover">
|
|
167
|
+
<div class="fd-popover__control" aria-controls="popoverT52" aria-expanded="true" aria-haspopup="true">
|
|
168
|
+
<textarea
|
|
169
|
+
class="fd-textarea is-error"
|
|
170
|
+
rows="2"
|
|
171
|
+
id="textarea-4"
|
|
172
|
+
placeholder="Enter your message here"
|
|
173
|
+
aria-required="false"
|
|
174
|
+
aria-invalid="true"
|
|
175
|
+
aria-describedby="textarea-4-message popoverT52"></textarea>
|
|
176
|
+
<div class="fd-textarea__sr-only" id="textarea-4-message">Value State Error</div>
|
|
177
|
+
</div>
|
|
178
|
+
<div class="fd-popover__body fd-popover__body--input-message-group fd-popover__body--no-arrow" aria-hidden="false" id="popoverT52">
|
|
179
|
+
<div class="fd-form-message fd-form-message--error">Please correct the highlighted error.</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div class="fd-form-item">
|
|
185
|
+
<label class="fd-form-label" for="textarea-5">Warning message:</label>
|
|
186
|
+
<div class="fd-popover">
|
|
187
|
+
<div class="fd-popover__control" aria-controls="popoverT53" aria-expanded="true" aria-haspopup="true">
|
|
188
|
+
<textarea
|
|
189
|
+
class="fd-textarea is-warning"
|
|
190
|
+
rows="2"
|
|
191
|
+
id="textarea-5"
|
|
192
|
+
placeholder="Enter your message here"
|
|
193
|
+
aria-required="false"
|
|
194
|
+
aria-describedby="textarea-5-message popoverT53"></textarea>
|
|
195
|
+
<div class="fd-textarea__sr-only" id="textarea-5-message">Value State Warning</div>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="fd-popover__body fd-popover__body--input-message-group fd-popover__body--no-arrow" aria-hidden="false" id="popoverT53">
|
|
198
|
+
<div class="fd-form-message fd-form-message--warning">Please review your input for potential issues.</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="fd-form-item">
|
|
204
|
+
<label class="fd-form-label" for="textarea-6">Information message:</label>
|
|
205
|
+
<div class="fd-popover">
|
|
206
|
+
<div class="fd-popover__control" aria-controls="popoverT54" aria-expanded="true" aria-haspopup="true">
|
|
207
|
+
<textarea
|
|
208
|
+
class="fd-textarea is-information"
|
|
209
|
+
rows="2"
|
|
210
|
+
id="textarea-6"
|
|
211
|
+
placeholder="Enter your message here"
|
|
212
|
+
aria-required="false"
|
|
213
|
+
aria-describedby="textarea-6-message popoverT54"></textarea>
|
|
214
|
+
<div class="fd-textarea__sr-only" id="textarea-6-message">Value State Information</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div class="fd-popover__body fd-popover__body--input-message-group fd-popover__body--no-arrow" aria-hidden="false" id="popoverT54">
|
|
217
|
+
<div class="fd-form-message fd-form-message--information">This is additional information about your input.</div>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Accessibility
|
|
224
|
+
|
|
225
|
+
- Use semantic HTML elements where appropriate
|
|
226
|
+
- Include proper ARIA attributes for interactive elements
|
|
227
|
+
- Ensure keyboard navigation support
|
|
228
|
+
- Provide adequate color contrast
|
|
229
|
+
|
|
230
|
+
## Source
|
|
231
|
+
|
|
232
|
+
This documentation was automatically generated from: `packages/styles/stories/Components/Forms/textarea/textarea.stories.js`
|
|
233
|
+
|
|
234
|
+
For the latest updates and interactive examples, see [Storybook](https://sap.github.io/fundamental-styles/).
|