@vielzeug/codex 26.10.3 → 26.10.4

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/refine.json CHANGED
@@ -7926,555 +7926,555 @@
7926
7926
  }
7927
7927
  ]
7928
7928
  },
7929
- {
7930
- "kind": "function",
7931
- "name": "formatBytes",
7932
- "return": {
7933
- "type": {
7934
- "text": "string"
7935
- }
7936
- },
7937
- "parameters": [
7938
- {
7939
- "name": "bytes",
7940
- "type": {
7941
- "text": "number"
7942
- }
7943
- }
7944
- ]
7945
- },
7946
- {
7947
- "kind": "function",
7948
- "name": "createFileQueue",
7949
- "return": {
7950
- "type": {
7951
- "text": "FileQueue"
7952
- }
7953
- },
7954
- "parameters": [
7955
- {
7956
- "name": "options",
7957
- "type": {
7958
- "text": "FileQueueOptions"
7959
- }
7960
- }
7961
- ],
7962
- "description": "Owns file selection *and* the opt-in upload lifecycle together: they were never really\nseparable (adding a file starts its upload; removing one must abort it; replacing one is both\nat once). Independent of `html`/rendering, following the same shape as `datagrid`'s\n`createDataGridControls` and `combobox`'s `combobox-options.ts`: a factory `file-input.ts`\nwires into drag/drop/native-input events and the template, directly unit-testable without\nmounting a component.\n\nEvery file-level rule (accept, max-size, max-files, disabled) and every upload-lifecycle rule\n(progress, retry-from-offset, per-file isolation) lives here in one place."
7963
- },
7964
7929
  {
7965
7930
  "kind": "variable",
7966
- "name": "FILE_INPUT_TAG",
7931
+ "name": "INPUT_TAG",
7967
7932
  "type": {
7968
- "text": "'ore-file-input'"
7933
+ "text": "'ore-input'"
7969
7934
  },
7970
- "default": "'ore-file-input'",
7971
- "description": "A file upload field with drag-and-drop support, built-in validation messaging, and: once a\n`upload` transport is wired up: a full per-file upload lifecycle: live progress/speed/ETA,\nretry-on-failure, a success confirmation card, and fully independent handling of concurrent\nfiles (one failing never blocks or cancels the others). Picking files with no `upload` set\nkeeps the original, upload-free selection-only behavior."
7935
+ "default": "'ore-input'",
7936
+ "description": "A customizable text input component with multiple variants, label placements, and form features."
7972
7937
  },
7973
7938
  {
7974
7939
  "kind": "class",
7975
- "name": "OreFileInputElement",
7976
- "tagName": "ore-file-input",
7940
+ "name": "OreInputElement",
7941
+ "tagName": "ore-input",
7977
7942
  "customElement": true,
7978
- "description": "A file upload field with drag-and-drop support, built-in validation messaging, and: once a\n`upload` transport is wired up: a full per-file upload lifecycle: live progress/speed/ETA,\nretry-on-failure, a success confirmation card, and fully independent handling of concurrent\nfiles (one failing never blocks or cancels the others). Picking files with no `upload` set\nkeeps the original, upload-free selection-only behavior.",
7943
+ "description": "A customizable text input component with multiple variants, label placements, and form features.",
7979
7944
  "summary": "",
7980
7945
  "attributes": [
7981
7946
  {
7982
- "name": "accept",
7947
+ "name": "aria-label",
7983
7948
  "type": {
7984
7949
  "text": "string"
7985
7950
  },
7986
- "description": "Comma-separated file extensions or MIME types"
7951
+ "description": "Accessible name used when no visible label is rendered"
7987
7952
  },
7988
7953
  {
7989
- "name": "multiple",
7954
+ "name": "label",
7990
7955
  "type": {
7991
- "text": "boolean"
7956
+ "text": "string"
7992
7957
  },
7993
- "description": "Enable multiple files selection"
7958
+ "description": "Label text"
7994
7959
  },
7995
7960
  {
7996
- "name": "gallery",
7961
+ "name": "label-placement",
7997
7962
  "type": {
7998
- "text": "boolean"
7963
+ "text": "'inset' | 'outside'"
7999
7964
  },
8000
- "description": "Show selected files as an image thumbnail/preview grid"
7965
+ "description": "Label placement: 'inset' | 'outside'"
8001
7966
  },
8002
7967
  {
8003
- "name": "max-files",
7968
+ "name": "type",
8004
7969
  "type": {
8005
- "text": "number"
7970
+ "text": "'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'"
8006
7971
  },
8007
- "description": "Max number of files allowed"
7972
+ "description": "HTML input type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'"
8008
7973
  },
8009
7974
  {
8010
- "name": "max-size",
7975
+ "name": "value",
8011
7976
  "type": {
8012
- "text": "number"
7977
+ "text": "string"
8013
7978
  },
8014
- "description": "Max size of each file in bytes"
7979
+ "description": "Current input value"
8015
7980
  },
8016
7981
  {
8017
- "name": "disabled",
7982
+ "name": "placeholder",
8018
7983
  "type": {
8019
- "text": "boolean"
7984
+ "text": "string"
8020
7985
  },
8021
- "description": "Disable interaction"
7986
+ "description": "Placeholder text"
8022
7987
  },
8023
7988
  {
8024
- "name": "error",
7989
+ "name": "name",
8025
7990
  "type": {
8026
7991
  "text": "string"
8027
7992
  },
8028
- "description": "Show an error state/message"
7993
+ "description": "Form field name"
8029
7994
  },
8030
7995
  {
8031
7996
  "name": "helper",
8032
7997
  "type": {
8033
7998
  "text": "string"
8034
7999
  },
8035
- "description": "Provide helper context below the dropzone"
8000
+ "description": "Helper text displayed below the input (fallback when the `helper` slot is empty)"
8036
8001
  },
8037
8002
  {
8038
- "name": "browse-label",
8003
+ "name": "error",
8039
8004
  "type": {
8040
8005
  "text": "string"
8041
8006
  },
8042
- "description": "Action half of the dropzone line (default 'click to browse')"
8007
+ "description": "Error message: marks the field as invalid (fallback when the `error` slot is empty)"
8043
8008
  },
8044
8009
  {
8045
- "name": "dropzone-label",
8010
+ "name": "disabled",
8046
8011
  "type": {
8047
- "text": "string"
8012
+ "text": "boolean"
8048
8013
  },
8049
- "description": "Main half of the dropzone line (default 'Drop files here or')"
8014
+ "description": "Disable input interaction"
8050
8015
  },
8051
8016
  {
8052
- "name": "dropzone-active-label",
8017
+ "name": "readonly",
8053
8018
  "type": {
8054
- "text": "string"
8019
+ "text": "boolean"
8055
8020
  },
8056
- "description": "Dropzone line while a drag is active (default 'Release to upload')"
8021
+ "description": "Make the input read-only"
8057
8022
  },
8058
8023
  {
8059
- "name": "dropzone-hint",
8024
+ "name": "required",
8060
8025
  "type": {
8061
- "text": "string"
8026
+ "text": "boolean"
8062
8027
  },
8063
- "description": "Replace the auto-generated accept/max-size hint with this text"
8028
+ "description": "Mark the field as required"
8064
8029
  },
8065
8030
  {
8066
- "name": "files-label",
8031
+ "name": "loading",
8067
8032
  "type": {
8068
- "text": "string"
8033
+ "text": "boolean"
8069
8034
  },
8070
- "description": "Accessible name of the selected-files list (default 'Selected files')"
8071
- }
8072
- ],
8073
- "events": [
8035
+ "description": "Show an inline spinner and force the field disabled"
8036
+ },
8074
8037
  {
8075
- "name": "change",
8076
- "description": "detail: { files: File[], value: File[] }",
8038
+ "name": "success",
8077
8039
  "type": {
8078
- "text": "CustomEvent"
8079
- }
8040
+ "text": "boolean"
8041
+ },
8042
+ "description": "Show an inline success check icon (suppressed while `error` is set)"
8080
8043
  },
8081
8044
  {
8082
- "name": "remove",
8083
- "description": "detail: { file: File, files: File[] }",
8045
+ "name": "color",
8084
8046
  "type": {
8085
- "text": "CustomEvent"
8086
- }
8047
+ "text": "'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'"
8048
+ },
8049
+ "description": "Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'"
8087
8050
  },
8088
8051
  {
8089
- "name": "reject",
8090
- "description": "detail: { files: File[], reasons: ('size' | 'type')[] }: nothing was added",
8052
+ "name": "variant",
8091
8053
  "type": {
8092
- "text": "CustomEvent"
8093
- }
8054
+ "text": "'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'"
8055
+ },
8056
+ "description": "Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'"
8094
8057
  },
8095
8058
  {
8096
- "name": "upload-progress",
8097
- "description": "detail: { file: File, loaded: number, total: number }",
8059
+ "name": "size",
8098
8060
  "type": {
8099
- "text": "CustomEvent"
8100
- }
8061
+ "text": "'sm' | 'md' | 'lg'"
8062
+ },
8063
+ "description": "Input size: 'sm' | 'md' | 'lg'"
8101
8064
  },
8102
8065
  {
8103
- "name": "upload-success",
8104
- "description": "detail: { file: File }",
8066
+ "name": "rounded",
8067
+ "type": {
8068
+ "text": "'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'"
8069
+ },
8070
+ "description": "Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'"
8071
+ }
8072
+ ],
8073
+ "events": [
8074
+ {
8075
+ "name": "input",
8076
+ "description": "Emitted when input value changes (on every keystroke).",
8105
8077
  "type": {
8106
8078
  "text": "CustomEvent"
8107
8079
  }
8108
8080
  },
8109
8081
  {
8110
- "name": "upload-error",
8111
- "description": "detail: { file: File, error: unknown }",
8082
+ "name": "change",
8083
+ "description": "Emitted when input loses focus with changed value.",
8112
8084
  "type": {
8113
8085
  "text": "CustomEvent"
8114
8086
  }
8115
8087
  }
8116
8088
  ],
8089
+ "slots": [
8090
+ {
8091
+ "name": "prefix",
8092
+ "description": "Content before the input (e.g., icons)"
8093
+ },
8094
+ {
8095
+ "name": "suffix",
8096
+ "description": "Content after the input (e.g., clear button, validation icon)"
8097
+ },
8098
+ {
8099
+ "name": "label",
8100
+ "description": "Replaces the label text: slotted content takes precedence over the `label` prop"
8101
+ },
8102
+ {
8103
+ "name": "helper",
8104
+ "description": "Replaces the helper text: slotted content takes precedence over the `helper` prop"
8105
+ },
8106
+ {
8107
+ "name": "error",
8108
+ "description": "Replaces the error text: slotted content takes precedence over the `error` prop"
8109
+ }
8110
+ ],
8117
8111
  "cssParts": [
8118
8112
  {
8119
8113
  "name": "wrapper",
8120
- "description": "Root wrapper around the file input field"
8114
+ "description": "The input wrapper element"
8121
8115
  },
8122
8116
  {
8123
8117
  "name": "label",
8124
- "description": "Visible label rendered above the dropzone"
8118
+ "description": "The label element (inset or outside)"
8125
8119
  },
8126
8120
  {
8127
- "name": "dropzone",
8128
- "description": "Interactive drag-and-drop target"
8121
+ "name": "field",
8122
+ "description": "The field container element"
8123
+ },
8124
+ {
8125
+ "name": "input-row",
8126
+ "description": "The input row container element"
8129
8127
  },
8130
8128
  {
8131
8129
  "name": "input",
8132
- "description": "Native file input element"
8130
+ "description": "The input element"
8133
8131
  },
8134
8132
  {
8135
- "name": "gallery",
8136
- "description": "Gallery grid container (rendered instead of `file-list` when `gallery` is set)"
8133
+ "name": "status-icon",
8134
+ "description": "The inline error/success icon shown inside the field"
8137
8135
  },
8138
8136
  {
8139
- "name": "helper",
8140
- "description": "Helper text shown beneath the dropzone"
8137
+ "name": "spinner",
8138
+ "description": "The inline loading spinner shown inside the field while `loading`"
8141
8139
  },
8142
8140
  {
8143
- "name": "error",
8144
- "description": "Error message shown beneath the field"
8141
+ "name": "helper",
8142
+ "description": "The helper text element"
8145
8143
  }
8146
8144
  ],
8147
8145
  "cssProperties": [
8148
8146
  {
8149
- "name": "--file-input-bg",
8150
- "description": "Dropzone background color"
8147
+ "name": "--input-bg",
8148
+ "description": "Background color"
8151
8149
  },
8152
8150
  {
8153
- "name": "--file-input-border-color",
8154
- "description": "Dropzone border color"
8151
+ "name": "--input-color",
8152
+ "description": "Text color"
8155
8153
  },
8156
8154
  {
8157
- "name": "--file-input-font-size",
8158
- "description": "Font size"
8155
+ "name": "--input-border-color",
8156
+ "description": "Border color"
8159
8157
  },
8160
8158
  {
8161
- "name": "--file-input-radius",
8162
- "description": "Dropzone border radius"
8159
+ "name": "--input-placeholder-color",
8160
+ "description": "Placeholder text color"
8163
8161
  },
8164
8162
  {
8165
- "name": "--file-input-min-height",
8166
- "description": "Minimum dropzone height"
8163
+ "name": "--input-radius",
8164
+ "description": "Border radius"
8167
8165
  },
8168
8166
  {
8169
- "name": "--file-input-hover-bg",
8170
- "description": "Dropzone background on hover (flat/ghost variants)"
8167
+ "name": "--input-padding",
8168
+ "description": "Inner padding (block inline)"
8171
8169
  },
8172
8170
  {
8173
- "name": "--file-input-hover-border-color",
8174
- "description": "Dropzone border on hover (flat/bordered variants)"
8171
+ "name": "--input-label-block-inset",
8172
+ "description": "Inset from the field block start for an inset label"
8175
8173
  },
8176
8174
  {
8177
- "name": "--file-input-focus-bg",
8178
- "description": "Dropzone background when focused/drag-over (flat variant)"
8175
+ "name": "--input-label-inset",
8176
+ "description": "Inset from the field inline start for an inset label"
8179
8177
  },
8180
8178
  {
8181
- "name": "--file-input-focus-border-color",
8182
- "description": "Dropzone border when focused/drag-over (flat variant)"
8179
+ "name": "--input-gap",
8180
+ "description": "Gap between prefix/suffix icons and input text"
8183
8181
  },
8184
8182
  {
8185
- "name": "--file-input-thumb-size",
8186
- "description": "Gallery thumbnail width/height"
8183
+ "name": "--input-font-size",
8184
+ "description": "Font size"
8185
+ },
8186
+ {
8187
+ "name": "--input-height",
8188
+ "description": "Field height"
8189
+ },
8190
+ {
8191
+ "name": "--input-hover-bg",
8192
+ "description": "Field background on hover (flat/ghost variants)"
8193
+ },
8194
+ {
8195
+ "name": "--input-hover-border-color",
8196
+ "description": "Field border on hover (flat/bordered variants)"
8197
+ },
8198
+ {
8199
+ "name": "--input-focus-bg",
8200
+ "description": "Field background when focused (flat variant)"
8201
+ },
8202
+ {
8203
+ "name": "--input-focus-border-color",
8204
+ "description": "Field border when focused (flat/text variants)"
8187
8205
  }
8188
8206
  ],
8189
8207
  "demos": [
8190
8208
  {
8191
- "url": "",
8192
- "description": "```html\n<ore-file-input label=\"Upload files\" accept=\"image/*\" multiple />\n<ore-file-input label=\"Photos\" accept=\"image/*\" multiple gallery />\n<ore-file-input label=\"Resume\" accept=\".pdf,.doc,.docx\" max-size=\"5242880\" />\n<ore-file-input variant=\"bordered\" color=\"primary\" />\n```\n```ts\n// Wire up a real upload transport: progress/retry/success are then handled automatically.\n// `XMLHttpRequest` is used here (not `fetch`) because it's the only browser API that reports\n// upload progress; swap in whatever transport the app already uses.\nconst input = document.querySelector('ore-file-input');\ninput.upload = (file, { onProgress, signal, resumeFrom }) =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener('progress', (e) => onProgress(resumeFrom + e.loaded, file.size));\n xhr.addEventListener('load', () => (xhr.status < 400 ? resolve() : reject(new Error(xhr.statusText))));\n xhr.addEventListener('error', () => reject(new Error('Network error')));\n signal.addEventListener('abort', () => xhr.abort());\n xhr.open('PUT', '/uploads');\n if (resumeFrom > 0) xhr.setRequestHeader('Content-Range', `bytes ${resumeFrom}-/${file.size}`);\n xhr.send(file);\n });\n```"
8209
+ "url": "",
8210
+ "description": "```html\n<ore-input type=\"email\" label=\"Email\" placeholder=\"you@example.com\" />\n<ore-input label=\"Name\" variant=\"bordered\" color=\"primary\" />\n<ore-input label=\"Username\" error=\"That username is taken\" />\n<ore-input label=\"Username\" success />\n<ore-input label=\"Username\" loading />\n```"
8211
+ }
8212
+ ]
8213
+ },
8214
+ {
8215
+ "kind": "function",
8216
+ "name": "formatBytes",
8217
+ "return": {
8218
+ "type": {
8219
+ "text": "string"
8220
+ }
8221
+ },
8222
+ "parameters": [
8223
+ {
8224
+ "name": "bytes",
8225
+ "type": {
8226
+ "text": "number"
8227
+ }
8228
+ }
8229
+ ]
8230
+ },
8231
+ {
8232
+ "kind": "function",
8233
+ "name": "createFileQueue",
8234
+ "return": {
8235
+ "type": {
8236
+ "text": "FileQueue"
8237
+ }
8238
+ },
8239
+ "parameters": [
8240
+ {
8241
+ "name": "options",
8242
+ "type": {
8243
+ "text": "FileQueueOptions"
8244
+ }
8193
8245
  }
8194
- ]
8246
+ ],
8247
+ "description": "Owns file selection *and* the opt-in upload lifecycle together: they were never really\nseparable (adding a file starts its upload; removing one must abort it; replacing one is both\nat once). Independent of `html`/rendering, following the same shape as `datagrid`'s\n`createDataGridControls` and `combobox`'s `combobox-options.ts`: a factory `file-input.ts`\nwires into drag/drop/native-input events and the template, directly unit-testable without\nmounting a component.\n\nEvery file-level rule (accept, max-size, max-files, disabled) and every upload-lifecycle rule\n(progress, retry-from-offset, per-file isolation) lives here in one place."
8195
8248
  },
8196
8249
  {
8197
8250
  "kind": "variable",
8198
- "name": "INPUT_TAG",
8251
+ "name": "FILE_INPUT_TAG",
8199
8252
  "type": {
8200
- "text": "'ore-input'"
8253
+ "text": "'ore-file-input'"
8201
8254
  },
8202
- "default": "'ore-input'",
8203
- "description": "A customizable text input component with multiple variants, label placements, and form features."
8255
+ "default": "'ore-file-input'",
8256
+ "description": "A file upload field with drag-and-drop support, built-in validation messaging, and: once a\n`upload` transport is wired up: a full per-file upload lifecycle: live progress/speed/ETA,\nretry-on-failure, a success confirmation card, and fully independent handling of concurrent\nfiles (one failing never blocks or cancels the others). Picking files with no `upload` set\nkeeps the original, upload-free selection-only behavior."
8204
8257
  },
8205
8258
  {
8206
8259
  "kind": "class",
8207
- "name": "OreInputElement",
8208
- "tagName": "ore-input",
8260
+ "name": "OreFileInputElement",
8261
+ "tagName": "ore-file-input",
8209
8262
  "customElement": true,
8210
- "description": "A customizable text input component with multiple variants, label placements, and form features.",
8263
+ "description": "A file upload field with drag-and-drop support, built-in validation messaging, and: once a\n`upload` transport is wired up: a full per-file upload lifecycle: live progress/speed/ETA,\nretry-on-failure, a success confirmation card, and fully independent handling of concurrent\nfiles (one failing never blocks or cancels the others). Picking files with no `upload` set\nkeeps the original, upload-free selection-only behavior.",
8211
8264
  "summary": "",
8212
8265
  "attributes": [
8213
8266
  {
8214
- "name": "aria-label",
8267
+ "name": "accept",
8215
8268
  "type": {
8216
8269
  "text": "string"
8217
8270
  },
8218
- "description": "Accessible name used when no visible label is rendered"
8271
+ "description": "Comma-separated file extensions or MIME types"
8219
8272
  },
8220
8273
  {
8221
- "name": "label",
8274
+ "name": "multiple",
8222
8275
  "type": {
8223
- "text": "string"
8276
+ "text": "boolean"
8224
8277
  },
8225
- "description": "Label text"
8278
+ "description": "Enable multiple files selection"
8226
8279
  },
8227
8280
  {
8228
- "name": "label-placement",
8281
+ "name": "gallery",
8229
8282
  "type": {
8230
- "text": "'inset' | 'outside'"
8283
+ "text": "boolean"
8231
8284
  },
8232
- "description": "Label placement: 'inset' | 'outside'"
8285
+ "description": "Show selected files as an image thumbnail/preview grid"
8233
8286
  },
8234
8287
  {
8235
- "name": "type",
8288
+ "name": "max-files",
8236
8289
  "type": {
8237
- "text": "'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'"
8290
+ "text": "number"
8238
8291
  },
8239
- "description": "HTML input type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'"
8292
+ "description": "Max number of files allowed"
8240
8293
  },
8241
8294
  {
8242
- "name": "value",
8295
+ "name": "max-size",
8243
8296
  "type": {
8244
- "text": "string"
8297
+ "text": "number"
8245
8298
  },
8246
- "description": "Current input value"
8299
+ "description": "Max size of each file in bytes"
8247
8300
  },
8248
8301
  {
8249
- "name": "placeholder",
8302
+ "name": "disabled",
8250
8303
  "type": {
8251
- "text": "string"
8304
+ "text": "boolean"
8252
8305
  },
8253
- "description": "Placeholder text"
8306
+ "description": "Disable interaction"
8254
8307
  },
8255
8308
  {
8256
- "name": "name",
8309
+ "name": "error",
8257
8310
  "type": {
8258
8311
  "text": "string"
8259
8312
  },
8260
- "description": "Form field name"
8313
+ "description": "Show an error state/message"
8261
8314
  },
8262
8315
  {
8263
8316
  "name": "helper",
8264
8317
  "type": {
8265
8318
  "text": "string"
8266
8319
  },
8267
- "description": "Helper text displayed below the input (fallback when the `helper` slot is empty)"
8320
+ "description": "Provide helper context below the dropzone"
8268
8321
  },
8269
8322
  {
8270
- "name": "error",
8323
+ "name": "browse-label",
8271
8324
  "type": {
8272
8325
  "text": "string"
8273
8326
  },
8274
- "description": "Error message: marks the field as invalid (fallback when the `error` slot is empty)"
8327
+ "description": "Action half of the dropzone line (default 'click to browse')"
8275
8328
  },
8276
8329
  {
8277
- "name": "disabled",
8330
+ "name": "dropzone-label",
8278
8331
  "type": {
8279
- "text": "boolean"
8332
+ "text": "string"
8280
8333
  },
8281
- "description": "Disable input interaction"
8334
+ "description": "Main half of the dropzone line (default 'Drop files here or')"
8282
8335
  },
8283
8336
  {
8284
- "name": "readonly",
8337
+ "name": "dropzone-active-label",
8285
8338
  "type": {
8286
- "text": "boolean"
8339
+ "text": "string"
8287
8340
  },
8288
- "description": "Make the input read-only"
8341
+ "description": "Dropzone line while a drag is active (default 'Release to upload')"
8289
8342
  },
8290
8343
  {
8291
- "name": "required",
8344
+ "name": "dropzone-hint",
8292
8345
  "type": {
8293
- "text": "boolean"
8346
+ "text": "string"
8294
8347
  },
8295
- "description": "Mark the field as required"
8348
+ "description": "Replace the auto-generated accept/max-size hint with this text"
8296
8349
  },
8297
8350
  {
8298
- "name": "loading",
8351
+ "name": "files-label",
8299
8352
  "type": {
8300
- "text": "boolean"
8353
+ "text": "string"
8301
8354
  },
8302
- "description": "Show an inline spinner and force the field disabled"
8303
- },
8355
+ "description": "Accessible name of the selected-files list (default 'Selected files')"
8356
+ }
8357
+ ],
8358
+ "events": [
8304
8359
  {
8305
- "name": "success",
8360
+ "name": "change",
8361
+ "description": "detail: { files: File[], value: File[] }",
8306
8362
  "type": {
8307
- "text": "boolean"
8308
- },
8309
- "description": "Show an inline success check icon (suppressed while `error` is set)"
8363
+ "text": "CustomEvent"
8364
+ }
8310
8365
  },
8311
8366
  {
8312
- "name": "color",
8367
+ "name": "remove",
8368
+ "description": "detail: { file: File, files: File[] }",
8313
8369
  "type": {
8314
- "text": "'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'"
8315
- },
8316
- "description": "Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'"
8370
+ "text": "CustomEvent"
8371
+ }
8317
8372
  },
8318
8373
  {
8319
- "name": "variant",
8374
+ "name": "reject",
8375
+ "description": "detail: { files: File[], reasons: ('size' | 'type')[] }: nothing was added",
8320
8376
  "type": {
8321
- "text": "'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'"
8322
- },
8323
- "description": "Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'"
8377
+ "text": "CustomEvent"
8378
+ }
8324
8379
  },
8325
8380
  {
8326
- "name": "size",
8381
+ "name": "upload-progress",
8382
+ "description": "detail: { file: File, loaded: number, total: number }",
8327
8383
  "type": {
8328
- "text": "'sm' | 'md' | 'lg'"
8329
- },
8330
- "description": "Input size: 'sm' | 'md' | 'lg'"
8384
+ "text": "CustomEvent"
8385
+ }
8331
8386
  },
8332
8387
  {
8333
- "name": "rounded",
8334
- "type": {
8335
- "text": "'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'"
8336
- },
8337
- "description": "Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'"
8338
- }
8339
- ],
8340
- "events": [
8341
- {
8342
- "name": "input",
8343
- "description": "Emitted when input value changes (on every keystroke).",
8388
+ "name": "upload-success",
8389
+ "description": "detail: { file: File }",
8344
8390
  "type": {
8345
8391
  "text": "CustomEvent"
8346
8392
  }
8347
8393
  },
8348
8394
  {
8349
- "name": "change",
8350
- "description": "Emitted when input loses focus with changed value.",
8395
+ "name": "upload-error",
8396
+ "description": "detail: { file: File, error: unknown }",
8351
8397
  "type": {
8352
8398
  "text": "CustomEvent"
8353
8399
  }
8354
8400
  }
8355
8401
  ],
8356
- "slots": [
8357
- {
8358
- "name": "prefix",
8359
- "description": "Content before the input (e.g., icons)"
8360
- },
8361
- {
8362
- "name": "suffix",
8363
- "description": "Content after the input (e.g., clear button, validation icon)"
8364
- },
8365
- {
8366
- "name": "label",
8367
- "description": "Replaces the label text: slotted content takes precedence over the `label` prop"
8368
- },
8369
- {
8370
- "name": "helper",
8371
- "description": "Replaces the helper text: slotted content takes precedence over the `helper` prop"
8372
- },
8373
- {
8374
- "name": "error",
8375
- "description": "Replaces the error text: slotted content takes precedence over the `error` prop"
8376
- }
8377
- ],
8378
8402
  "cssParts": [
8379
8403
  {
8380
8404
  "name": "wrapper",
8381
- "description": "The input wrapper element"
8405
+ "description": "Root wrapper around the file input field"
8382
8406
  },
8383
8407
  {
8384
8408
  "name": "label",
8385
- "description": "The label element (inset or outside)"
8386
- },
8387
- {
8388
- "name": "field",
8389
- "description": "The field container element"
8409
+ "description": "Visible label rendered above the dropzone"
8390
8410
  },
8391
8411
  {
8392
- "name": "input-row",
8393
- "description": "The input row container element"
8412
+ "name": "dropzone",
8413
+ "description": "Interactive drag-and-drop target"
8394
8414
  },
8395
8415
  {
8396
8416
  "name": "input",
8397
- "description": "The input element"
8417
+ "description": "Native file input element"
8398
8418
  },
8399
8419
  {
8400
- "name": "status-icon",
8401
- "description": "The inline error/success icon shown inside the field"
8420
+ "name": "gallery",
8421
+ "description": "Gallery grid container (rendered instead of `file-list` when `gallery` is set)"
8402
8422
  },
8403
8423
  {
8404
- "name": "spinner",
8405
- "description": "The inline loading spinner shown inside the field while `loading`"
8424
+ "name": "helper",
8425
+ "description": "Helper text shown beneath the dropzone"
8406
8426
  },
8407
8427
  {
8408
- "name": "helper",
8409
- "description": "The helper text element"
8428
+ "name": "error",
8429
+ "description": "Error message shown beneath the field"
8410
8430
  }
8411
8431
  ],
8412
8432
  "cssProperties": [
8413
8433
  {
8414
- "name": "--input-bg",
8415
- "description": "Background color"
8416
- },
8417
- {
8418
- "name": "--input-color",
8419
- "description": "Text color"
8420
- },
8421
- {
8422
- "name": "--input-border-color",
8423
- "description": "Border color"
8424
- },
8425
- {
8426
- "name": "--input-placeholder-color",
8427
- "description": "Placeholder text color"
8428
- },
8429
- {
8430
- "name": "--input-radius",
8431
- "description": "Border radius"
8432
- },
8433
- {
8434
- "name": "--input-padding",
8435
- "description": "Inner padding (block inline)"
8434
+ "name": "--file-input-bg",
8435
+ "description": "Dropzone background color"
8436
8436
  },
8437
8437
  {
8438
- "name": "--input-label-block-inset",
8439
- "description": "Inset from the field block start for an inset label"
8438
+ "name": "--file-input-border-color",
8439
+ "description": "Dropzone border color"
8440
8440
  },
8441
8441
  {
8442
- "name": "--input-label-inset",
8443
- "description": "Inset from the field inline start for an inset label"
8442
+ "name": "--file-input-font-size",
8443
+ "description": "Font size"
8444
8444
  },
8445
8445
  {
8446
- "name": "--input-gap",
8447
- "description": "Gap between prefix/suffix icons and input text"
8446
+ "name": "--file-input-radius",
8447
+ "description": "Dropzone border radius"
8448
8448
  },
8449
8449
  {
8450
- "name": "--input-font-size",
8451
- "description": "Font size"
8450
+ "name": "--file-input-min-height",
8451
+ "description": "Minimum dropzone height"
8452
8452
  },
8453
8453
  {
8454
- "name": "--input-height",
8455
- "description": "Field height"
8454
+ "name": "--file-input-hover-bg",
8455
+ "description": "Dropzone background on hover (flat/ghost variants)"
8456
8456
  },
8457
8457
  {
8458
- "name": "--input-hover-bg",
8459
- "description": "Field background on hover (flat/ghost variants)"
8458
+ "name": "--file-input-hover-border-color",
8459
+ "description": "Dropzone border on hover (flat/bordered variants)"
8460
8460
  },
8461
8461
  {
8462
- "name": "--input-hover-border-color",
8463
- "description": "Field border on hover (flat/bordered variants)"
8462
+ "name": "--file-input-focus-bg",
8463
+ "description": "Dropzone background when focused/drag-over (flat variant)"
8464
8464
  },
8465
8465
  {
8466
- "name": "--input-focus-bg",
8467
- "description": "Field background when focused (flat variant)"
8466
+ "name": "--file-input-focus-border-color",
8467
+ "description": "Dropzone border when focused/drag-over (flat variant)"
8468
8468
  },
8469
8469
  {
8470
- "name": "--input-focus-border-color",
8471
- "description": "Field border when focused (flat/text variants)"
8470
+ "name": "--file-input-thumb-size",
8471
+ "description": "Gallery thumbnail width/height"
8472
8472
  }
8473
8473
  ],
8474
8474
  "demos": [
8475
8475
  {
8476
8476
  "url": "",
8477
- "description": "```html\n<ore-input type=\"email\" label=\"Email\" placeholder=\"you@example.com\" />\n<ore-input label=\"Name\" variant=\"bordered\" color=\"primary\" />\n<ore-input label=\"Username\" error=\"That username is taken\" />\n<ore-input label=\"Username\" success />\n<ore-input label=\"Username\" loading />\n```"
8477
+ "description": "```html\n<ore-file-input label=\"Upload files\" accept=\"image/*\" multiple />\n<ore-file-input label=\"Photos\" accept=\"image/*\" multiple gallery />\n<ore-file-input label=\"Resume\" accept=\".pdf,.doc,.docx\" max-size=\"5242880\" />\n<ore-file-input variant=\"bordered\" color=\"primary\" />\n```\n```ts\n// Wire up a real upload transport: progress/retry/success are then handled automatically.\n// `XMLHttpRequest` is used here (not `fetch`) because it's the only browser API that reports\n// upload progress; swap in whatever transport the app already uses.\nconst input = document.querySelector('ore-file-input');\ninput.upload = (file, { onProgress, signal, resumeFrom }) =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener('progress', (e) => onProgress(resumeFrom + e.loaded, file.size));\n xhr.addEventListener('load', () => (xhr.status < 400 ? resolve() : reject(new Error(xhr.statusText))));\n xhr.addEventListener('error', () => reject(new Error('Network error')));\n signal.addEventListener('abort', () => xhr.abort());\n xhr.open('PUT', '/uploads');\n if (resumeFrom > 0) xhr.setRequestHeader('Content-Range', `bytes ${resumeFrom}-/${file.size}`);\n xhr.send(file);\n });\n```"
8478
8478
  }
8479
8479
  ]
8480
8480
  },