@italia/upload 1.0.0-alpha.10

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it-upload.js","sources":["../../../src/it-upload.ts"],"sourcesContent":["/* eslint-disable lit-a11y/no-redundant-role */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { FormControl, FormControlController } from '@italia/globals';\nimport { registerTranslation } from '@italia/i18n';\nimport { html, nothing } from 'lit';\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\n\nimport type { UploadFile, UploadFileStatus, UploadVariant, UploadInternalFile } from './types.js';\nimport it from './locales/it.js';\nimport en from './locales/en.js';\nimport styles from './upload.scss';\nimport { formatSize } from './utils.js';\n\nregisterTranslation(it);\nregisterTranslation(en);\n\n@customElement('it-upload')\nexport class ItUpload extends FormControl {\n static styles = styles;\n\n // Override the base FormControlController to submit File[] instead of strings.\n // The base class field is declared as `protected readonly` but re-declaring here\n // shadows it cleanly via class field initialization order.\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n value: (el) => (el as ItUpload)._files.map((f) => f._raw),\n assumeInteractionOn: ['it-change'],\n });\n\n @query('.it-form__control')\n override inputElement!: HTMLInputElement;\n\n @queryAssignedElements({ slot: 'label' })\n labelElements!: HTMLElement[];\n\n get label(): string {\n if (this.labelElements.length > 0) {\n return this.labelElements[0].innerText.trim();\n }\n return '';\n }\n\n /** Allow multiple file selection */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /** Accepted file types, e.g. \"image/*,.pdf\" */\n @property({ type: String })\n accept?: string;\n\n /** Show image thumbnails in the file list */\n @property({ type: Boolean, attribute: 'image-preview' })\n imagePreview = false;\n\n /** Layout variant: 'default' shows a vertical file list, 'gallery' shows a pictures-wall grid */\n @property({ type: String, reflect: true })\n variant: UploadVariant = 'default';\n\n /** Support text displayed below the upload button */\n @property({ type: String, attribute: 'support-text' })\n supportText = '';\n\n /**\n * If true, files transition to 'success' automatically as soon as they are added\n * (useful for purely client-side scenarios).\n * Leave false (default) when you need to call setFileStatus() after a real HTTP upload.\n */\n @property({ type: Boolean, attribute: 'auto-success' })\n autoSuccess = false;\n\n @state()\n private _files: UploadInternalFile[] = [];\n\n /** Returns a copy of the current file list */\n get files(): UploadFile[] {\n return this._files.map(({ _raw: _, ...rest }) => rest);\n }\n\n /**\n * Programmatically add a file to the list with an initial status of 'loading'.\n * Returns the generated id for use with setFileStatus / removeFile.\n */\n addFile(file: File): string {\n const id = `upload-file-${Math.random().toString(36).slice(2)}`;\n const entry: UploadInternalFile = {\n id,\n name: file.name,\n size: file.size,\n status: 'loading',\n _raw: file,\n };\n this._files = [...this._files, entry];\n return id;\n }\n\n /** Update the status (and optional progress 0–100) of a file by id. No-op for unknown ids. */\n setFileStatus(id: string, status: UploadFileStatus, progress?: number) {\n this._files = this._files.map((f) => (f.id === id ? { ...f, status, progress: progress ?? f.progress } : f));\n }\n\n /** Set a thumbnail data URL for a file entry by id. No-op for unknown ids. */\n setFileThumbnail(id: string, dataUrl: string) {\n this._files = this._files.map((f) => (f.id === id ? { ...f, thumbnail: dataUrl } : f));\n }\n\n /** Remove a file entry by id. No-op for unknown ids. */\n removeFile(id: string) {\n this._files = this._files.filter((f) => f.id !== id);\n this._validateFiles();\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._handleReady();\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n if (!this.label && this.label?.length === 0) {\n this.logger.warn(\n `Label is required for accessibility. Define a <span slot=\"label\"> inside <it-upload name=\"${this.name}\">.`,\n );\n }\n }\n\n // Override FormControl.checkValidity — the native hidden input manages required state\n override checkValidity(): boolean {\n return this.inputElement?.checkValidity() ?? true;\n }\n\n /** Override to prevent string-level validation messages from FormControl base */\n protected override handleValidationMessages() {\n this._validateFiles();\n }\n\n private _validateFiles() {\n if (this.required && this._files.length === 0) {\n this.inputElement?.setCustomValidity(this.$t('validityRequired'));\n this.validationMessage = this.$t('validityRequired');\n } else {\n this.inputElement?.setCustomValidity('');\n this.validationMessage = '';\n }\n this.formControlController.updateValidity();\n }\n\n override get validity(): ValidityState {\n return this.inputElement?.validity;\n }\n\n private _handleFileChange(e: Event) {\n const input = e.target as HTMLInputElement;\n const fileList = input.files;\n if (!fileList || fileList.length === 0) return;\n\n const newFiles = Array.from(fileList);\n newFiles.forEach((file) => {\n const id = this.addFile(file);\n if (file.type.startsWith('image/') && (this.imagePreview || this.variant === 'gallery')) {\n const reader = new FileReader();\n reader.onload = (ev) => {\n this.setFileThumbnail(id, ev.target?.result as string);\n if (this.autoSuccess) this.setFileStatus(id, 'success');\n };\n reader.readAsDataURL(file);\n } else if (this.autoSuccess) {\n this.setFileStatus(id, 'success');\n }\n });\n\n // Reset the native input so the same file can be re-selected\n input.value = '';\n\n this._validateFiles();\n\n this.dispatchEvent(\n new CustomEvent('it-upload-add', {\n detail: { files: newFiles, name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { files: this._files.map((f) => f._raw), name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleRemove(id: string, name: string) {\n this.removeFile(id);\n this.dispatchEvent(\n new CustomEvent('it-upload-remove', {\n detail: { id, name, componentName: this.name, componentId: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n this.dispatchEvent(\n new CustomEvent('it-change', {\n detail: { files: this._files.map((f) => f._raw), name: this.name, id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _getStatusLabel(status: UploadFileStatus): string {\n switch (status) {\n case 'loading':\n return this.$t('upload_status_loading');\n case 'success':\n return this.$t('upload_status_success');\n case 'error':\n default:\n return this.$t('upload_status_error');\n }\n }\n\n private _getRemoveLabel(f: UploadInternalFile): string {\n let key: string;\n switch (f.status) {\n case 'loading':\n key = 'upload_remove_loading';\n break;\n case 'error':\n key = 'upload_remove_error';\n break;\n case 'success':\n default:\n key = 'upload_remove_done';\n break;\n }\n const template = this.$t(key);\n return template.replace('{name}', f.name);\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _iconForStatus(status: UploadFileStatus) {\n switch (status) {\n case 'loading':\n case 'success':\n return 'it-file';\n case 'error':\n default:\n return 'it-close-circle';\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _colorForStatus(status: UploadFileStatus): string {\n switch (status) {\n case 'success':\n return 'success';\n case 'error':\n return 'danger';\n default:\n return 'secondary';\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private _actionIconForStatus(status: UploadFileStatus): string {\n return status === 'success' ? 'it-check' : 'it-close';\n }\n\n private _renderFileItem(f: UploadInternalFile) {\n const liClass = this.composeClass('upload-file', f.status === 'loading' ? 'uploading' : f.status);\n\n const statusLabel = this._getStatusLabel(f.status);\n const removeLabel = this._getRemoveLabel(f);\n\n return html`\n <li class=\"${liClass}\" role=\"listitem\">\n ${when(\n this.imagePreview && f.thumbnail,\n () => html`\n <div class=\"upload-image\">\n <img src=\"${f.thumbnail!}\" alt=\"${f.name}\" />\n </div>\n `,\n () =>\n html`<it-icon\n name=\"${this._iconForStatus(f.status)}\"\n size=\"sm\"\n color=\"${this._colorForStatus(f.status)}\"\n aria-hidden=\"true\"\n ></it-icon>`,\n )}\n <p>\n <span class=\"visually-hidden\">${statusLabel}</span>${f.name}${when(\n f.status === 'success',\n () => html`<span class=\"upload-file-weight\">${formatSize(f.size)}</span>`,\n )}\n </p>\n\n ${when(\n f.status === 'success',\n () => html`\n <div class=\"upload-file-actions\" part=\"file-status-indicator\">\n <it-icon\n name=\"it-check\"\n size=\"xs\"\n color=\"success\"\n aria-hidden=\"true\"\n class=\"upload-file-success\"\n ></it-icon>\n <button\n part=\"file-remove-button\"\n type=\"button\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon name=\"it-close\" aria-hidden=\"true\" color=\"secondary\"></it-icon>\n </button>\n </div>\n `,\n () => html`\n <button\n part=\"file-remove-button\"\n type=\"button\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon\n name=\"${this._actionIconForStatus(f.status)}\"\n color=\"${this._colorForStatus(f.status)}\"\n aria-hidden=\"true\"\n ></it-icon>\n </button>\n `,\n )}\n ${when(\n f.status === 'loading',\n () => html` <it-progress type=\"line\" .value=\"${f.progress ?? 0}\" it-aria-label=\"${f.name}\"></it-progress> `,\n )}\n </li>\n `;\n }\n\n private _renderGalleryItem(f: UploadInternalFile) {\n // NOTE: BSI reference HTML does not include a remove button for gallery items.\n // Added here as a critical accessibility addition: without it there is no way\n // to remove a photo once added (WCAG 2.1 SC 3.3.4 Error Prevention).\n const removeLabel = this._getRemoveLabel(f);\n return html`\n <li class=\"upload-image\" role=\"listitem\">\n ${when(f.thumbnail, () => html`<img src=\"${f.thumbnail!}\" alt=\"${f.name}\" />`)}\n <button\n part=\"gallery-remove-button\"\n type=\"button\"\n class=\"btn btn-primary btn-icon btn-xs upload-image-remove\"\n @click=\"${() => this._handleRemove(f.id, f.name)}\"\n ?disabled=\"${this.disabled}\"\n >\n <span class=\"visually-hidden\">${removeLabel}</span>\n <it-icon name=\"it-close\" size=\"xs\" color=\"inverse\" aria-hidden=\"true\"></it-icon>\n </button>\n </li>\n `;\n }\n\n private _renderFileList() {\n if (this._files.length === 0) return nothing;\n\n if (this.variant === 'gallery') {\n return html` ${this._files.map((f) => this._renderGalleryItem(f))} `;\n }\n\n const listClass = this.composeClass('upload-file-list', this.imagePreview ? 'upload-file-list-image' : '');\n return html`\n <ul class=\"${listClass}\" aria-label=\"${this.$t('upload_file_list_label')}\" role=\"list\">\n ${this._files.map((f) => this._renderFileItem(f))}\n </ul>\n `;\n }\n\n private _renderUploadInput() {\n const inputId = this._id!;\n const labelText = this.variant === 'gallery' ? this.$t('upload_gallery_label') : this.$t('upload_label');\n\n const showValidation = this.formControlController.submittedOnce;\n const isInvalid = showValidation && this.validationMessage.length > 0;\n\n return html`\n <div class=\"form-group\">\n <input\n type=\"file\"\n class=\"upload it-form__control\"\n id=\"${inputId}\"\n name=\"${this.name}\"\n ?multiple=\"${this.multiple}\"\n accept=\"${ifDefined(this.accept)}\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required && this._files.length === 0}\"\n aria-invalid=\"${isInvalid ? 'true' : 'false'}\"\n aria-describedby=\"${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}\"\n @change=\"${this._handleFileChange}\"\n />\n <label part=\"input-label\" for=\"${inputId}\">\n <slot name=\"icon\">\n <it-icon\n name=\"${this.variant === 'gallery' ? 'it-plus' : 'it-upload'}\"\n size=\"${this.variant === 'gallery' ? 'lg' : 'sm'}\"\n aria-hidden=\"true\"\n color=\"${this.variant === 'gallery' ? 'primary' : 'inverse'}\"\n ></it-icon>\n </slot>\n <slot name=\"label\">${labelText}</slot>\n </label>\n\n ${when(this.supportText, () => html`<small class=\"form-text\">${this.supportText}</small>`)}\n\n <div\n role=\"alert\"\n id=\"invalid-feedback-${inputId}\"\n class=\"invalid-feedback form-feedback form-text just-validate-error-label\"\n ?hidden=${!isInvalid}\n >\n ${isInvalid ? html`<span class=\"visually-hidden\">${this.label}: </span>${this.validationMessage}` : nothing}\n </div>\n </div>\n `;\n }\n\n override render() {\n if (this.variant === 'gallery') {\n return html`\n <ul class=\"upload-pictures-wall\" role=\"list\">\n ${this._renderFileList()}\n <li>${this._renderUploadInput()}</li>\n </ul>\n `;\n }\n\n return html` ${this._renderUploadInput()} ${this._renderFileList()} `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-upload': ItUpload;\n }\n}\n"],"names":["it","en"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAIjB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;AACX,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAIhB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;AACnC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAIrB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACP,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAInC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACrC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAQjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACnC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAGZ,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACkC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AArD/B,QAAQ,GAAA,UAAA,CAAA;IADpB,aAAa,CAAC,WAAW;AACb,CAAA,EAAA,QAAQ,CAwapB;;;;"}
@@ -0,0 +1,4 @@
1
+ import type { DefaultTranslation } from '@italia/i18n';
2
+ declare const translation: DefaultTranslation;
3
+ export default translation;
4
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/locales/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,WAAW,EAAE,kBA2BlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DefaultTranslation } from '@italia/i18n';
2
+ declare const translation: DefaultTranslation;
3
+ export default translation;
4
+ //# sourceMappingURL=it.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../src/locales/it.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,WAAW,EAAE,kBA2BlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,15 @@
1
+ export type UploadFileStatus = 'loading' | 'success' | 'error';
2
+ export type UploadVariant = 'default' | 'gallery';
3
+ export interface UploadFile {
4
+ id: string;
5
+ name: string;
6
+ size: number;
7
+ status: UploadFileStatus;
8
+ progress?: number;
9
+ thumbnail?: string;
10
+ }
11
+ /** Internal representation that also carries the raw File reference */
12
+ export interface UploadInternalFile extends UploadFile {
13
+ _raw: File;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,IAAI,EAAE,IAAI,CAAC;CACZ"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Format a byte count into a human-readable string (B, KB, MB, GB).
3
+ * Shared by it-upload and it-upload-drag-drop.
4
+ */
5
+ export declare function formatSize(bytes: number): string;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhD"}
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@italia/upload",
3
+ "description": "Web components it-upload, it-upload-avatar, it-upload-drag-drop del Design system .italia",
4
+ "version": "1.0.0-alpha.10",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "license": "BSD-3-Clause",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/italia/dev-kit-italia.git",
12
+ "directory": "packages/upload"
13
+ },
14
+ "author": "Presidenza del Consiglio dei Ministri",
15
+ "homepage": "https://italia.github.io/dev-kit-italia",
16
+ "bugs": {
17
+ "url": "https://github.com/italia/dev-kit-italia/issues"
18
+ },
19
+ "type": "module",
20
+ "main": "./dist/src/index.js",
21
+ "module": "./dist/src/index.js",
22
+ "types": "./dist/src/index.d.ts",
23
+ "exports": {
24
+ ".": "./dist/src/index.js",
25
+ "./it-upload.js": "./dist/src/it-upload.js",
26
+ "./it-upload-avatar.js": "./dist/src/it-upload-avatar.js",
27
+ "./it-upload-drag-drop.js": "./dist/src/it-upload-drag-drop.js",
28
+ "./styles/*": "./styles/*"
29
+ },
30
+ "files": [
31
+ "dist/src",
32
+ "styles",
33
+ "README.md",
34
+ "AUTHORS",
35
+ "LICENSE",
36
+ "custom-elements.json"
37
+ ],
38
+ "dependencies": {
39
+ "bootstrap-italia": "3.0.0-alpha.9",
40
+ "lit": "^3.3.0",
41
+ "@italia/globals": "^1.0.0-alpha.10",
42
+ "@italia/i18n": "^1.0.0-alpha.10"
43
+ },
44
+ "peerDependencies": {
45
+ "@italia/icon": "^1.0.0-alpha.10",
46
+ "@italia/avatar": "^1.0.0-alpha.10",
47
+ "@italia/progress": "^1.0.0-alpha.10"
48
+ },
49
+ "devDependencies": {
50
+ "@custom-elements-manifest/analyzer": "^0.10.3",
51
+ "@open-wc/testing": "^4.0.0",
52
+ "@rollup/plugin-node-resolve": "^16.0.1",
53
+ "@rollup/plugin-typescript": "^12.1.2",
54
+ "@types/mocha": "^10.0.10",
55
+ "@web/test-runner": "^0.18.2",
56
+ "@web/test-runner-commands": "^0.9.0",
57
+ "rimraf": "^6.0.1",
58
+ "rollup": "^4.42.0",
59
+ "rollup-plugin-scss-lit": "^2.1.0",
60
+ "tslib": "^2.6.3",
61
+ "@italia/test-config": "^0.0.0",
62
+ "@italia/typescript-config": "^0.0.0"
63
+ },
64
+ "customElements": "custom-elements.json",
65
+ "scripts": {
66
+ "analyze": "cem analyze --litelement --exclude dist",
67
+ "build": "rollup --config rollup.config.js",
68
+ "clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
69
+ "prepublish": "pnpm build",
70
+ "lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"styles/**/*.scss\" \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
71
+ "format": "eslint --fix --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint --fix \"styles/**/*.scss\" \"src/**/*.scss\" && prettier --write \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\"",
72
+ "test": "wtr --coverage --node-resolve --config web-test-runner.config.js",
73
+ "test:watch": "wtr --coverage --node-resolve --config web-test-runner.config.js --watch"
74
+ }
75
+ }
@@ -0,0 +1,24 @@
1
+ it-upload {
2
+ --it-host-display: block;
3
+ display: var(--it-host-display);
4
+ }
5
+
6
+ it-upload:not(:defined) {
7
+ --it-host-display: inline-flex;
8
+ align-items: center;
9
+ gap: var(--#{$prefix}spacing-xxs, 8px);
10
+
11
+ &[variant='gallery'] {
12
+ width: 128px;
13
+ height: 128px;
14
+ justify-content: center;
15
+ border: 2px dashed var(--#{$prefix}color-border);
16
+ border-radius: 4px;
17
+ text-align: center;
18
+ }
19
+ }
20
+
21
+ it-upload-avatar[size='xl'] {
22
+ width: 80px;
23
+ height: 80px;
24
+ }