@skra/ui 0.7.0 → 0.8.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skra-ui-file-upload.mjs","sources":["../../../../libs/ui/file-upload/src/lib/file-upload.directives.ts","../../../../libs/ui/file-upload/src/lib/file-helpers/file-helpers.ts","../../../../libs/ui/file-upload/src/lib/file-helpers/file-partition.ts","../../../../libs/ui/file-upload/src/lib/file-upload/file-upload-context.ts","../../../../libs/ui/file-upload/src/lib/file-input/file-input.ts","../../../../libs/ui/file-upload/src/lib/file-upload/file-drop-guard.ts","../../../../libs/ui/file-upload/src/lib/file-upload/file-upload.ts","../../../../libs/ui/file-upload/src/lib/file-upload/file-upload.html","../../../../libs/ui/file-upload/src/lib/file-helpers/file-name.ts","../../../../libs/ui/file-upload/src/lib/file-item/file-item.ts","../../../../libs/ui/file-upload/src/lib/file-item/file-item.html","../../../../libs/ui/file-upload/src/index.ts","../../../../libs/ui/file-upload/src/skra-ui-file-upload.ts"],"sourcesContent":["import { Directive } from '@angular/core';\r\n\r\n// Slot markers of the FileUpload family (ADR 020 Smart Slots v2.0). Each is detected\r\n// through a Signal Query so the owning component renders a slot's wrapper only when the\r\n// slot is filled — never an empty node. Entry-local (the Button / Accordion precedent)\r\n// to avoid a cross-entry marker dependency. Import the markers you use alongside the\r\n// component: projection works on the attribute alone, but slot DETECTION needs the class.\r\n\r\n// ─── <skra-file-upload> ──────────────────────────────────────────────────────\r\n\r\n/** Leading icon of `<skra-file-upload>`'s face. Decorative — the consumer marks it `aria-hidden`. */\r\n@Directive({\r\n selector: '[skra-start]',\r\n standalone: true,\r\n})\r\nexport class SkraFileUploadStart {}\r\n\r\n/**\r\n * REQUIRED. The visible action text of `<skra-file-upload>` (\"Choose a video\"). It joins the\r\n * native control's accessible name through `aria-labelledby` (ADR 0056 D4, WCAG 2.5.3), so a\r\n * voice-control user can say what they see.\r\n */\r\n@Directive({\r\n selector: '[skra-file-upload-action]',\r\n standalone: true,\r\n})\r\nexport class SkraFileUploadAction {}\r\n\r\n/**\r\n * The drop instruction (\"or drag it here\"). Its presence switches the face from the compact\r\n * row to the drop-zone layout — an instruction is what invites dragging. Hidden on devices\r\n * with no fine pointer, where \"drag\" means nothing.\r\n */\r\n@Directive({\r\n selector: '[skra-file-upload-instruction]',\r\n standalone: true,\r\n})\r\nexport class SkraFileUploadInstruction {}\r\n\r\n/**\r\n * The selection summary in the page's language (\"recording.mp4, 2.3 GB\"). Rendered inside the\r\n * composite's always-present `role=\"status\"` region and linked to the control as a description,\r\n * so a change is announced and the user agent's browser-language status is not the only one.\r\n */\r\n@Directive({\r\n selector: '[skra-file-upload-status]',\r\n standalone: true,\r\n})\r\nexport class SkraFileUploadStatus {}\r\n\r\n// ─── li[skraFileItem] ────────────────────────────────────────────────────────\r\n\r\n/** Leading visual of a file row — an icon or a consumer-made thumbnail (`URL.createObjectURL`). */\r\n@Directive({\r\n selector: '[skra-start]',\r\n standalone: true,\r\n})\r\nexport class SkraFileItemStart {}\r\n\r\n/** Row detail under the name — typically `progress[skraProgress]` or a status line. */\r\n@Directive({\r\n selector: '[skra-file-item-detail]',\r\n standalone: true,\r\n})\r\nexport class SkraFileItemDetail {}\r\n\r\n/**\r\n * The row's error text. Its presence is what paints the row invalid\r\n * (`data-skra-validation=\"invalid\"`), so the colour never appears without the words\r\n * (WCAG 1.4.1 by construction).\r\n */\r\n@Directive({\r\n selector: '[skra-file-item-error]',\r\n standalone: true,\r\n})\r\nexport class SkraFileItemError {}\r\n\r\n/** Trailing row actions — the consumer's `button[skraButton]`s (cancel / retry / remove). */\r\n@Directive({\r\n selector: '[skra-end]',\r\n standalone: true,\r\n})\r\nexport class SkraFileItemEnd {}\r\n","// The two \"How\" helpers of the FileUpload family — pure, framework-free and SSR-safe (no\r\n// DOM access; `File` is used as a type and read through `name` / `type` only). Every\r\n// consumer otherwise reimplements them, and each has a subtle edge that is easy to get\r\n// wrong: 1000 vs 1024, a rounded value that crosses a unit boundary, the HTML `accept`\r\n// grammar, and files the platform reports with no MIME type at all.\r\n\r\n/** SI units, 1 kB = 1000 B — the `Intl` unit identifiers, and what macOS / iOS show. */\r\nconst UNITS = [\r\n 'byte',\r\n 'kilobyte',\r\n 'megabyte',\r\n 'gigabyte',\r\n 'terabyte',\r\n 'petabyte',\r\n] as const;\r\n\r\n/**\r\n * Format a byte count for display in `locale` (`undefined` → the host default, the ADR 0050\r\n * §5 precedent): `2,3 GB` in `pl`, `2.3 GB` in `en`, one fractional digit at most.\r\n *\r\n * SI units (1 kB = 1000 B) because `Intl` names only those and macOS / iOS report sizes the\r\n * same way. The unit label is `Intl`'s own short form, so it is translated and pluralised by\r\n * the platform's locale data, never by Skra (e.g. `999 byte` in English, `999 B` in Polish —\r\n * CLDR's choice, not ours). A multi-GB `File.size` is a safe integer; nothing here rounds\r\n * the input.\r\n *\r\n * @throws RangeError for a negative or non-finite count — a size that cannot exist is a bug\r\n * in the caller, and printing `NaN byte` would hide it.\r\n */\r\nexport function skraFormatFileSize(bytes: number, locale?: string): string {\r\n if (!Number.isFinite(bytes) || bytes < 0) {\r\n throw new RangeError(\r\n `skraFormatFileSize: expected a finite, non-negative byte count, got ${bytes}.`,\r\n );\r\n }\r\n let index = 0;\r\n while (index < UNITS.length - 1 && bytes >= 1000 ** (index + 1)) index += 1;\r\n // A value that ROUNDS up to 1000 of its unit reads as the next unit: 999 950 B is\r\n // \"1 MB\", not \"1,000 kB\".\r\n if (\r\n index < UNITS.length - 1 &&\r\n Math.round((bytes / 1000 ** index) * 10) / 10 >= 1000\r\n ) {\r\n index += 1;\r\n }\r\n return new Intl.NumberFormat(locale, {\r\n style: 'unit',\r\n unit: UNITS[index],\r\n unitDisplay: 'short',\r\n maximumFractionDigits: 1,\r\n }).format(bytes / 1000 ** index);\r\n}\r\n\r\n/** One parsed `accept` token. Tokens the HTML grammar does not recognise are dropped. */\r\ntype AcceptToken =\r\n | { kind: 'extension'; value: string }\r\n | { kind: 'mime'; value: string }\r\n | { kind: 'wildcard'; value: string };\r\n\r\nfunction parseAccept(accept: string): AcceptToken[] {\r\n const tokens: AcceptToken[] = [];\r\n for (const raw of accept.split(',')) {\r\n const token = raw.trim().toLowerCase();\r\n if (token.length > 1 && token.startsWith('.')) {\r\n tokens.push({ kind: 'extension', value: token });\r\n continue;\r\n }\r\n // `type/subtype` or `type/*`; parameters (`;charset=…`) never take part in a match.\r\n const mime = token.split(';')[0].trim();\r\n const slash = mime.indexOf('/');\r\n if (slash <= 0 || slash === mime.length - 1) continue;\r\n const subtype = mime.slice(slash + 1);\r\n if (subtype === '*') {\r\n tokens.push({ kind: 'wildcard', value: mime.slice(0, slash + 1) });\r\n } else {\r\n tokens.push({ kind: 'mime', value: mime });\r\n }\r\n }\r\n return tokens;\r\n}\r\n\r\n/**\r\n * Does `file` satisfy `accept`, under the HTML attribute's own semantics?\r\n *\r\n * - `.ext` — a case-insensitive suffix of the file NAME;\r\n * - `type/subtype` — the file's MIME type, case-insensitive, parameters ignored;\r\n * - `type/*` — any subtype of `type`.\r\n *\r\n * An empty `accept`, or one with no token the grammar recognises, accepts everything — the\r\n * picker applies no filter in that case either.\r\n *\r\n * **Typeless files** (`File.type === ''` — common for `.mkv` / `.heic` on some engines) are\r\n * matched by extension tokens only, and PASS when `accept` has no extension token (spec Q-5).\r\n * A false rejection of a legitimate 4 GB recording costs more than a junk file the consumer\r\n * and the server reject anyway.\r\n *\r\n * `accept` is never a guarantee: every platform lets a user bypass it. Validate on the server.\r\n */\r\nexport function skraFileMatchesAccept(\r\n file: Pick<File, 'name' | 'type'>,\r\n accept: string,\r\n): boolean {\r\n const tokens = parseAccept(accept);\r\n if (!tokens.length) return true;\r\n\r\n const name = file.name.toLowerCase();\r\n const type = file.type.trim().toLowerCase().split(';')[0].trim();\r\n const extensions = tokens.filter((t) => t.kind === 'extension');\r\n\r\n if (extensions.some((t) => name.endsWith(t.value))) return true;\r\n if (!type) return extensions.length === 0;\r\n\r\n return tokens.some(\r\n (t) =>\r\n (t.kind === 'mime' && t.value === type) ||\r\n (t.kind === 'wildcard' && type.startsWith(t.value)),\r\n );\r\n}\r\n","import { skraFileMatchesAccept } from './file-helpers';\r\n\r\n/** Why the normalisation turned a file down. Every reason is a rule the PLATFORM's picker enforces. */\r\nexport type SkraFileRejectionReason = 'type' | 'count' | 'directory';\r\n\r\n/** A file the normalisation rejected, and why. */\r\nexport interface SkraFileRejection {\r\n readonly file: File;\r\n readonly reason: SkraFileRejectionReason;\r\n}\r\n\r\n/** One selected item. `isDirectory` can only be true on the drop path. */\r\nexport interface SkraFileCandidate {\r\n readonly file: File;\r\n readonly isDirectory: boolean;\r\n}\r\n\r\n/** The native constraints Skra reads from the host — never mirrored as inputs. */\r\nexport interface SkraFileConstraints {\r\n readonly accept: string;\r\n readonly multiple: boolean;\r\n}\r\n\r\nexport interface SkraFilePartition {\r\n readonly accepted: File[];\r\n readonly rejected: SkraFileRejection[];\r\n}\r\n\r\n/**\r\n * Internal — NOT part of the public barrel. Partition one selection into accepted and\r\n * rejected files, enforcing exactly what the platform's own picker enforces and nothing more\r\n * (size, file count caps and duplicates are product policy — the consumer's, in `filesChange`).\r\n *\r\n * Precedence, one reason per file:\r\n * 1. `directory` — a dropped folder is never a file;\r\n * 2. `count` — more than one file on a control without `multiple` rejects ALL of them: a\r\n * single-file control never silently keeps one of N (spec Q-6);\r\n * 3. `type` — the file does not satisfy `accept` (`skraFileMatchesAccept`, typeless → Q-5).\r\n *\r\n * Order is preserved within both lists.\r\n */\r\nexport function partitionFiles(\r\n candidates: readonly SkraFileCandidate[],\r\n constraints: SkraFileConstraints,\r\n): SkraFilePartition {\r\n const accepted: File[] = [];\r\n const rejected: SkraFileRejection[] = [];\r\n const tooMany =\r\n !constraints.multiple &&\r\n candidates.filter((c) => !c.isDirectory).length > 1;\r\n\r\n for (const { file, isDirectory } of candidates) {\r\n if (isDirectory) rejected.push({ file, reason: 'directory' });\r\n else if (tooMany) rejected.push({ file, reason: 'count' });\r\n else if (skraFileMatchesAccept(file, constraints.accept))\r\n accepted.push(file);\r\n else rejected.push({ file, reason: 'type' });\r\n }\r\n return { accepted, rejected };\r\n}\r\n","import { Injectable, inject } from '@angular/core';\r\nimport { IdGeneratorService } from '@skra/ui/field';\r\n\r\n/**\r\n * Internal — provided by `<skra-file-upload>` per instance, injected `{ optional: true }` by\r\n * the projected `input[skraFileInput]` (ADR 013 §3.6 contextual wiring). Carries ids only —\r\n * never a value, never state (ADR 037; the composite owns no state, ADR 027 §3.8).\r\n *\r\n * Its PRESENCE is what puts the input into overlay mode (`data-skra-in-upload`, ADR 027\r\n * §3.9b): Emulated encapsulation lets no parent style projected content, and DI keeps the\r\n * rule in the atom's own stylesheet instead of a global slice (no O-8 bridge cost).\r\n */\r\n@Injectable()\r\nexport class SkraFileUploadContext {\r\n private readonly base = inject(IdGeneratorService).nextId('skra-file-upload');\r\n\r\n /** The face's visible action text — the second half of the control's name (ADR 0056 D4). */\r\n readonly actionId = `${this.base}-action`;\r\n\r\n /** The always-present status region — a description of the control, never its name. */\r\n readonly statusId = `${this.base}-status`;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n ViewEncapsulation,\r\n afterNextRender,\r\n computed,\r\n effect,\r\n inject,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { SkraFieldContext } from '@skra/ui/field';\r\nimport {\r\n partitionFiles,\r\n type SkraFileCandidate,\r\n type SkraFileRejection,\r\n} from '../file-helpers/file-partition';\r\nimport { SkraFileUploadContext } from '../file-upload/file-upload-context';\r\n\r\nexport type {\r\n SkraFileRejection,\r\n SkraFileRejectionReason,\r\n} from '../file-helpers/file-partition';\r\n\r\ndeclare const ngDevMode: boolean | undefined;\r\n\r\n/** True when a drag carries files from the OS — not text, not a link, not an in-page node. */\r\nfunction carriesFiles(event: DragEvent): boolean {\r\n const types = event.dataTransfer?.types;\r\n return !!types && Array.from(types).includes('Files');\r\n}\r\n\r\n/**\r\n * `input[type=\"file\"][skraFileInput]` — the native file control (spec\r\n * `component-file-upload-spec.md`; ADR 0056 Group B). A Component-on-a-native-host\r\n * (ADR 040): `<input>` is void, so `template: ''`, and `file-input.scss` is scoped to the\r\n * host by Emulated encapsulation — the box from `comp.field.*`, the user agent's\r\n * `::file-selector-button` painted from `comp.field.file.*` (ADR 0056 B1–B5).\r\n *\r\n * **No inputs.** Every constraint is a NATIVE attribute on the consumer's own host —\r\n * `accept`, `multiple`, `capture`, `required`, `disabled`, `name`, `webkitdirectory`\r\n * (native-attr-first, Iron Boundary #9). Skra reads them at the moment of a selection; it\r\n * never mirrors them.\r\n *\r\n * **Agnostic value (ADR 037).** The selection is REPORTED, never held: `filesChange` carries\r\n * the normalised files, `filesRejected` what the normalisation turned down. Native\r\n * `(change)` keeps working and reports the RAW selection; `filesChange` is the normalised one.\r\n *\r\n * **Normalisation** — Skra enforces exactly what the platform's own picker enforces, on\r\n * every path, and nothing more (size / count caps / duplicates are product policy):\r\n *\r\n * | Rule | Picker (`change`) | Drop (`drop` on the host) |\r\n * | --- | --- | --- |\r\n * | `accept` mismatch → `type` | possible (Windows \"All files\", Android) | the browser applies no `accept` to drops |\r\n * | >1 file without `multiple` → `count` | impossible | possible — ALL rejected |\r\n * | a directory → `directory` | impossible | possible |\r\n * | assignment | `input.files` left as the platform set it | `input.files` = the ACCEPTED files, then `input` + `change` are dispatched |\r\n *\r\n * A drop where nothing is accepted leaves the existing selection untouched and emits only\r\n * `filesRejected` — like a cancelled picker, it is not a change.\r\n *\r\n * **Field wiring (ADR 013 §3.7)** — the `skraInput` wiring verbatim: optional\r\n * `SkraFieldContext`; `id` / `disabled` written from guarded `effect()`s so a standalone\r\n * consumer's own attributes survive; `aria-describedby` / `aria-invalid` / `aria-required`\r\n * host bindings. Readonly: the native `readonly` attribute does not apply to `type=\"file\"`\r\n * (HTML) and `aria-readonly` is not exposed for its `button` role (G-4, measured), so it is\r\n * `aria-disabled=\"true\"` — the focusable soft-disable — plus a behaviour guard that blocks the\r\n * picker (`click`, keys other than `Tab`) and drops.\r\n *\r\n * **Known limitation (G-4, measured in Chromium):** \"required\" cannot reach assistive\r\n * technology on this control — neither `aria-required` (kept: harmless, and the field's\r\n * contract) nor native `required` is exposed for the `button` role. Say \"required\" in visible\r\n * text (the label or the hint) as well.\r\n *\r\n * **Inside `<skra-file-upload>`** (ADR 0056 Group D) the composite's context is injected:\r\n * the host reflects `data-skra-in-upload` (ADR 027 §3.9b) and its own stylesheet makes it a\r\n * transparent overlay over the painted face (`opacity: 0` only — D2); its name becomes\r\n * \"field label + visible action text\" via `aria-labelledby` (D4, WCAG 2.5.3) and the\r\n * composite's status region joins its description.\r\n *\r\n * <skra-field>\r\n * <label skraLabelFor>Session recording</label>\r\n * <input skraFileInput type=\"file\" accept=\"video/*\" #picker (filesChange)=\"onFiles($event)\" />\r\n * </skra-field>\r\n */\r\n@Component({\r\n selector: 'input[type=\"file\"][skraFileInput]',\r\n standalone: true,\r\n // Void host — no <ng-content>. See ADR 040 §2.\r\n template: '',\r\n styleUrl: './file-input.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n // ARIA relationships — Skra-owned, present only while a field / the composite cascades them.\r\n '[attr.aria-describedby]': 'describedBy()',\r\n '[attr.aria-labelledby]': 'labelledBy()',\r\n '[attr.aria-invalid]': 'context?.hasError() ? \"true\" : null',\r\n '[attr.aria-required]': 'context?.isRequired() ? \"true\" : null',\r\n // Readonly → `aria-disabled` (spec Q-4's fallback, taken 2026-10-31 on the G-4\r\n // measurement): native `readonly` does not apply to type=\"file\", and `aria-readonly` is\r\n // not exposed for the role a file input has (`button`) — a screen reader heard nothing.\r\n // `aria-disabled` alone is the sanctioned soft-disable (boundary #9 exception): the\r\n // control stays focusable, AT hears \"unavailable\", the guard below makes it true. Never\r\n // alongside native `disabled`, which already says it.\r\n '[attr.aria-disabled]': 'softDisabled() ? \"true\" : null',\r\n // ADR 027 §3.9a — a Pointer state with no pseudo-class (`:drop()` never shipped).\r\n '[attr.data-skra-dragover]': 'dragOver() ? \"\" : null',\r\n // ADR 027 §3.9b — structural placement marker, static for the instance's lifetime.\r\n '[attr.data-skra-in-upload]': 'inUpload ? \"\" : null',\r\n '(change)': 'onChange()',\r\n '(click)': 'blockWhenReadonly($event)',\r\n '(keydown)': 'blockKeyWhenReadonly($event)',\r\n '(dragenter)': 'onDragEnter($event)',\r\n '(dragover)': 'onDragOver($event)',\r\n '(dragleave)': 'onDragLeave()',\r\n '(drop)': 'onDrop($event)',\r\n '(dragend)': 'resetDrag()',\r\n },\r\n})\r\nexport class SkraFileInput {\r\n private readonly el = inject<ElementRef<HTMLInputElement>>(ElementRef);\r\n readonly context = inject(SkraFieldContext, { optional: true });\r\n private readonly upload = inject(SkraFileUploadContext, { optional: true });\r\n\r\n /** User picked or dropped files. Fires on user interaction only, after normalisation. */\r\n readonly filesChange = output<readonly File[]>();\r\n\r\n /** Files the normalisation rejected. Fires only when at least one was rejected. */\r\n readonly filesRejected = output<readonly SkraFileRejection[]>();\r\n\r\n protected readonly inUpload = this.upload !== null;\r\n protected readonly dragOver = signal(false);\r\n\r\n // dragenter / dragleave also fire when the pointer crosses into the user agent's own\r\n // button inside the control (retargeted to the host), and Safari reports a null\r\n // `relatedTarget` on every dragleave — so a depth counter, not relatedTarget, decides\r\n // when the drag has really left (spec G-5).\r\n private dragDepth = 0;\r\n\r\n protected readonly softDisabled = computed(\r\n () => !!this.context?.isReadonly() && !this.context.isDisabled(),\r\n );\r\n\r\n protected readonly describedBy = computed(() => {\r\n const ids = [this.context?.describedByIds(), this.upload?.statusId].filter(\r\n Boolean,\r\n );\r\n return ids.length ? ids.join(' ') : null;\r\n });\r\n\r\n // ADR 0056 D4 — field label first, the face's action text second; the action alone when\r\n // there is no field. Outside the composite the name is the consumer's `<label>` (Path 1).\r\n protected readonly labelledBy = computed(() => {\r\n if (!this.upload) return null;\r\n return [this.context?.labelId(), this.upload.actionId]\r\n .filter(Boolean)\r\n .join(' ');\r\n });\r\n\r\n constructor() {\r\n const el = this.el.nativeElement;\r\n\r\n // Field-cascaded native properties — only bound when a field is present, so a\r\n // standalone consumer keeps full control of its own `id` / `disabled` (ADR 013 §3.7).\r\n if (this.context) {\r\n const ctx = this.context;\r\n effect(() => {\r\n el.id = ctx.fieldId();\r\n });\r\n effect(() => {\r\n el.disabled = ctx.isDisabled();\r\n });\r\n }\r\n\r\n // Dev-only: inside the composite, `aria-labelledby` names the control and OVERRIDES a\r\n // `<label for>` — so outside <skra-field> a consumer's own label would vanish from the\r\n // name. A read of the rendered control, never a write.\r\n if (\r\n this.upload &&\r\n !this.context &&\r\n (typeof ngDevMode === 'undefined' || ngDevMode)\r\n ) {\r\n afterNextRender(() => {\r\n if (el.labels?.length) {\r\n console.warn(\r\n '[skraFileInput] inside <skra-file-upload> without <skra-field>, the control is named by ' +\r\n 'its visible action alone (aria-labelledby, ADR 0056 D4) — which overrides your ' +\r\n '<label for>. Wrap it in <skra-field> with label[skraLabelFor] to get \"label + action\".',\r\n );\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Reset the native selection (`value = ''`) so the same file can be picked again — the\r\n * queue model (`filesChange` → enqueue → `clear()`). Programmatic: emits nothing.\r\n * Reach it through a template reference: `#picker` on the host resolves to this component.\r\n */\r\n clear(): void {\r\n this.el.nativeElement.value = '';\r\n }\r\n\r\n private get blocked(): boolean {\r\n return this.el.nativeElement.disabled || !!this.context?.isReadonly();\r\n }\r\n\r\n /**\r\n * The native constraints, read at selection time. A `webkitdirectory` picker hands over\r\n * EVERY file of the chosen folder whether or not `multiple` is set, so it counts as\r\n * multiple — otherwise each folder pick would be rejected whole as `count`.\r\n */\r\n private constraints() {\r\n const el = this.el.nativeElement;\r\n return { accept: el.accept, multiple: el.multiple || el.webkitdirectory };\r\n }\r\n\r\n /**\r\n * The picker path — and the drop path's own dispatched `change`, already normalised.\r\n *\r\n * Order is part of the contract, the same on both paths: `filesChange` FIRST, then\r\n * `filesRejected`. A consumer that clears its error on a new selection and sets it on a\r\n * rejection then ends on the rejection message, not on a cleared one. A selection where\r\n * EVERY file was rejected emits no `filesChange` at all (like a fully rejected drop): it\r\n * changed nothing the consumer can use. An empty selection with no rejection (a picker\r\n * that reports a cleared selection) still emits `filesChange([])`.\r\n */\r\n protected onChange(): void {\r\n const el = this.el.nativeElement;\r\n const { accepted, rejected } = partitionFiles(\r\n Array.from(el.files ?? [], (file) => ({ file, isDirectory: false })),\r\n this.constraints(),\r\n );\r\n if (accepted.length || !rejected.length) this.filesChange.emit(accepted);\r\n if (rejected.length) this.filesRejected.emit(rejected);\r\n }\r\n\r\n /** Readonly: `preventDefault` on `click` keeps the picker closed, for pointer and keyboard alike. */\r\n protected blockWhenReadonly(event: Event): void {\r\n if (this.context?.isReadonly()) event.preventDefault();\r\n }\r\n\r\n /** Readonly: block keyboard activation; let `Tab` through. */\r\n protected blockKeyWhenReadonly(event: KeyboardEvent): void {\r\n if (this.context?.isReadonly() && event.key !== 'Tab') {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n protected onDragEnter(event: DragEvent): void {\r\n if (!carriesFiles(event) || this.blocked) return;\r\n event.preventDefault();\r\n this.dragDepth += 1;\r\n this.dragOver.set(true);\r\n }\r\n\r\n protected onDragOver(event: DragEvent): void {\r\n if (!carriesFiles(event)) return;\r\n // Always cancelled for a file drag: on a blocked control that is what stops the user\r\n // agent's own drop handling (which would assign the files); `dropEffect` tells the\r\n // user why nothing will happen.\r\n event.preventDefault();\r\n if (event.dataTransfer) {\r\n event.dataTransfer.dropEffect = this.blocked ? 'none' : 'copy';\r\n }\r\n if (!this.blocked) {\r\n // A dragover with no counted dragenter (the control became enabled mid-drag) still\r\n // owes the leave that clears it.\r\n if (this.dragDepth === 0) this.dragDepth = 1;\r\n this.dragOver.set(true);\r\n }\r\n }\r\n\r\n protected onDragLeave(): void {\r\n if (this.dragDepth === 0) return;\r\n this.dragDepth -= 1;\r\n if (this.dragDepth === 0) this.dragOver.set(false);\r\n }\r\n\r\n protected resetDrag(): void {\r\n this.dragDepth = 0;\r\n this.dragOver.set(false);\r\n }\r\n\r\n /** The drop path — normalise, then assign the ACCEPTED files and replay the native events. */\r\n protected onDrop(event: DragEvent): void {\r\n if (!carriesFiles(event)) return;\r\n event.preventDefault();\r\n this.resetDrag();\r\n if (this.blocked || !event.dataTransfer) return;\r\n\r\n const el = this.el.nativeElement;\r\n const { accepted, rejected } = partitionFiles(\r\n this.candidatesOf(event.dataTransfer),\r\n this.constraints(),\r\n );\r\n\r\n if (accepted.length) {\r\n const transfer = new DataTransfer();\r\n for (const file of accepted) transfer.items.add(file);\r\n el.files = transfer.files;\r\n // The native event stream stays the one source of truth: consumers bound through\r\n // `(change)`, `[formControl]` or `[(ngModel)]` see a drop exactly like a pick, and\r\n // `onChange()` emits `filesChange` once, from the same place for both paths.\r\n el.dispatchEvent(new Event('input', { bubbles: true }));\r\n el.dispatchEvent(new Event('change', { bubbles: true }));\r\n }\r\n // Last, as on the picker path (see onChange).\r\n if (rejected.length) this.filesRejected.emit(rejected);\r\n }\r\n\r\n /**\r\n * Directory detection has to happen INSIDE the `drop` handler: `webkitGetAsEntry()` is the\r\n * only cross-engine signal (a dropped folder arrives as a `File` too), and the item list\r\n * is emptied once the event returns.\r\n */\r\n private candidatesOf(transfer: DataTransfer): SkraFileCandidate[] {\r\n const items = transfer.items\r\n ? Array.from(transfer.items).filter((i) => i.kind === 'file')\r\n : [];\r\n if (!items.length) {\r\n return Array.from(transfer.files, (file) => ({\r\n file,\r\n isDirectory: false,\r\n }));\r\n }\r\n const candidates: SkraFileCandidate[] = [];\r\n for (const item of items) {\r\n const file = item.getAsFile();\r\n if (!file) continue;\r\n const entry =\r\n typeof item.webkitGetAsEntry === 'function'\r\n ? item.webkitGetAsEntry()\r\n : null;\r\n candidates.push({ file, isDirectory: !!entry?.isDirectory });\r\n }\r\n return candidates;\r\n }\r\n}\r\n","import { DOCUMENT, Injectable, inject } from '@angular/core';\r\n\r\n/**\r\n * Internal — NOT part of the public barrel. The page-navigation guard of the FileUpload\r\n * family (spec Q-3, architect-reviewed 2026-10-31: spec-level, not an ADR).\r\n *\r\n * A file dropped a few pixels OUTSIDE a drop zone makes the browser navigate to it — midway\r\n * through a multi-GB upload, that destroys the session. While at least one\r\n * `<skra-file-upload>` is mounted, this cancels `dragover` / `drop` on the document, and only\r\n * for drags that:\r\n * - carry `Files` (text, links and in-page drags are never touched);\r\n * - nothing nearer has already handled (`defaultPrevented` — every drop target, including\r\n * `input[skraFileInput]`, cancels the events it accepts);\r\n * - do not land on a target that accepts files natively: ANY `input[type=\"file\"]` (Skra's or\r\n * not) and editable content keep their own drop behaviour.\r\n *\r\n * It is the library's FIRST document-level listener, so the rules are binding here: scoped\r\n * exactly as above, ref-counted (installed once for any number of instances, removed with the\r\n * last), browser-only (installed from `afterNextRender`, so never under SSR). A second\r\n * component needing one lifts these rules into an ADR. react-dropzone ships the same default\r\n * (`preventDropOnDocument`).\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class SkraFileDropGuard {\r\n private readonly doc = inject(DOCUMENT);\r\n private holders = 0;\r\n\r\n // Cancel ONLY — no `dropEffect` write. Cancelling `dragover` + `drop` is what stops the\r\n // navigation; writing `dropEffect = 'none'` here would also silently kill a consumer's own\r\n // page-wide drop target on `window` (or a later `document` listener) that cancels without\r\n // setting `dropEffect` itself — the browser would never fire its `drop` (review 2026-11-01).\r\n private readonly onDragOver = (event: DragEvent): void => {\r\n if (this.guards(event)) event.preventDefault();\r\n };\r\n\r\n private readonly onDrop = (event: DragEvent): void => {\r\n if (this.guards(event)) event.preventDefault();\r\n };\r\n\r\n /** One mounted composite more. Installs the listeners on the first. */\r\n acquire(): void {\r\n this.holders += 1;\r\n if (this.holders > 1) return;\r\n this.doc.addEventListener('dragover', this.onDragOver);\r\n this.doc.addEventListener('drop', this.onDrop);\r\n }\r\n\r\n /** One mounted composite fewer. Removes the listeners with the last. */\r\n release(): void {\r\n if (this.holders === 0) return;\r\n this.holders -= 1;\r\n if (this.holders > 0) return;\r\n this.doc.removeEventListener('dragover', this.onDragOver);\r\n this.doc.removeEventListener('drop', this.onDrop);\r\n }\r\n\r\n private guards(event: DragEvent): boolean {\r\n if (event.defaultPrevented) return false;\r\n const types = event.dataTransfer?.types;\r\n if (!types || !Array.from(types).includes('Files')) return false;\r\n const target = event.target as\r\n | (Partial<Pick<Element, 'closest'>> & { isContentEditable?: boolean })\r\n | null;\r\n if (target?.closest?.('input[type=\"file\"]')) return false;\r\n if (target?.isContentEditable) return false;\r\n return true;\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n ViewEncapsulation,\r\n afterNextRender,\r\n computed,\r\n contentChild,\r\n contentChildren,\r\n effect,\r\n inject,\r\n} from '@angular/core';\r\nimport { SkraFileDropGuard } from './file-drop-guard';\r\nimport { SkraFileInput } from '../file-input/file-input';\r\nimport {\r\n SkraFileUploadAction,\r\n SkraFileUploadInstruction,\r\n SkraFileUploadStart,\r\n SkraFileUploadStatus,\r\n} from '../file-upload.directives';\r\nimport { SkraFileUploadContext } from './file-upload-context';\r\n\r\ndeclare const ngDevMode: boolean | undefined;\r\n\r\n/**\r\n * `<skra-file-upload>` — the optional enhancement over a projected `input[skraFileInput]`\r\n * (spec `component-file-upload-spec.md`; ADR 0056 Group D). It paints a localisable face —\r\n * the action and the instruction in the PAGE's language, from tokens — enlarges the control\r\n * into a drop zone, and hosts the live selection-status region.\r\n *\r\n * Why it exists: the native control's two strings (\"Choose File\" / \"No file chosen\") come\r\n * from the browser's UI language, not the page's `lang`, and no CSS or attribute can replace\r\n * them (ADR 0056 §1.6). The native control stays THE control (D2): transparent\r\n * (`opacity: 0`, its own stylesheet, switched on by this component's context), covering the\r\n * whole face, it remains the focus target, the pointer target, the drop target and the node\r\n * assistive technology reads — so `required`, `aria-invalid`, the validation bubble, label\r\n * activation, form submission and the iOS camera / library sheet all keep working.\r\n *\r\n * **State-READING** (ADR 027 §3.8, ADR 055): no inputs, no outputs; every state it paints —\r\n * hover, focus-visible, drag-over, disabled, readonly, invalid — is read from the projected\r\n * control through `:has()`. It owns no state, so it mirrors no ARIA.\r\n *\r\n * **Layout follows content (ADR 020).** No `[skra-file-upload-instruction]` → a compact,\r\n * field-like row (`[icon] [action] status`); with one → the drop-zone layout (stacked,\r\n * centred, dashed). Both accept drops. There is no look input (skin philosophy).\r\n *\r\n * **Never project interactive content** into it — the transparent control covers the whole\r\n * face and swallows the clicks (D3). The file list is a SIBLING.\r\n *\r\n * **Page-navigation guard.** While one is mounted, a FILE drag dropped outside every drop\r\n * target is cancelled instead of navigating the page to the file (spec Q-3; text / link\r\n * drags, native file inputs and editable content are untouched).\r\n *\r\n * <skra-field [hasError]=\"!!error()\">\r\n * <label skraLabelFor>Session recording</label>\r\n * <skra-file-upload>\r\n * <span skra-file-upload-action>Choose a video</span>\r\n * <span skra-file-upload-instruction>or drag it here</span>\r\n * <span skra-file-upload-status>{{ summary() }}</span>\r\n * <input skraFileInput type=\"file\" accept=\"video/*\" (filesChange)=\"onFiles($event)\" />\r\n * </skra-file-upload>\r\n * <skra-error>{{ error() }}</skra-error>\r\n * </skra-field>\r\n */\r\n@Component({\r\n selector: 'skra-file-upload',\r\n standalone: true,\r\n templateUrl: './file-upload.html',\r\n styleUrl: './file-upload.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n providers: [SkraFileUploadContext],\r\n host: {\r\n // Slot presence (ADR 020 / ADR 027 §3.6 — exempt from the State Surface).\r\n '[attr.data-skra-has-start]': 'hasStart() ? \"\" : null',\r\n '[attr.data-skra-has-instruction]': 'hasInstruction() ? \"\" : null',\r\n '[attr.data-skra-has-status]': 'hasStatus() ? \"\" : null',\r\n },\r\n})\r\nexport class SkraFileUpload {\r\n protected readonly ctx = inject(SkraFileUploadContext);\r\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n // `descendants: false` — projection takes top-level content only, so detection must too\r\n // (ADR 020: a slot marker nested deeper is never projected and must not render a wrapper).\r\n private readonly start = contentChild(SkraFileUploadStart, {\r\n descendants: false,\r\n });\r\n private readonly action = contentChild(SkraFileUploadAction, {\r\n descendants: false,\r\n });\r\n private readonly instruction = contentChild(SkraFileUploadInstruction, {\r\n descendants: false,\r\n });\r\n private readonly status = contentChild(SkraFileUploadStatus, {\r\n descendants: false,\r\n });\r\n // Direct children only (the projection slot takes nothing else) vs anywhere inside.\r\n private readonly inputs = contentChildren(SkraFileInput);\r\n private readonly nestedInputs = contentChildren(SkraFileInput, {\r\n descendants: true,\r\n });\r\n\r\n protected readonly hasStart = computed(() => !!this.start());\r\n protected readonly hasInstruction = computed(() => !!this.instruction());\r\n protected readonly hasStatus = computed(() => !!this.status());\r\n\r\n constructor() {\r\n // The page-navigation guard (spec Q-3): a missed drop must not navigate away from a\r\n // multi-GB upload. Browser-only by construction — `afterNextRender` never runs under SSR\r\n // — and ref-counted across every mounted composite.\r\n const guard = inject(SkraFileDropGuard);\r\n const destroyRef = inject(DestroyRef);\r\n afterNextRender(() => {\r\n guard.acquire();\r\n destroyRef.onDestroy(() => guard.release());\r\n });\r\n\r\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\r\n effect(() => this.warnMisuse());\r\n afterNextRender(() => this.warnInteractiveFace());\r\n }\r\n }\r\n\r\n /**\r\n * Dev-only, ADR 0056 D3: the face is paint. Anything interactive projected into it sits\r\n * UNDER the transparent control, so the control swallows its clicks — and inside the\r\n * `aria-hidden` face it is hidden from assistive technology while still focusable. A read of\r\n * the rendered face, never a write.\r\n */\r\n private warnInteractiveFace(): void {\r\n const face = this.host.nativeElement.querySelector(\r\n '.skra-file-upload-face',\r\n );\r\n const offender = face?.querySelector(\r\n 'a[href], button, input, select, textarea, [tabindex], [contenteditable]',\r\n );\r\n if (offender) {\r\n console.error(\r\n `[skra-file-upload] interactive content (<${offender.tagName.toLowerCase()}>) is ` +\r\n 'projected into the face. The transparent control covers the whole face and swallows ' +\r\n 'its clicks, and the face is aria-hidden (ADR 0056 D3). Put row actions in a SIBLING ' +\r\n 'list (ul[skraStack] of li[skraFileItem]).',\r\n );\r\n }\r\n }\r\n\r\n /** Dev-only: the composite cannot work without exactly one direct-child control and an action. */\r\n private warnMisuse(): void {\r\n const direct = this.inputs().length;\r\n const all = this.nestedInputs().length;\r\n if (all === 0) {\r\n console.error(\r\n '[skra-file-upload] needs a direct-child <input type=\"file\" skraFileInput> — it is the ' +\r\n 'control; the component only paints a face over it (ADR 0056 Group D). Import ' +\r\n 'SkraFileInput and project the input as a direct child.',\r\n );\r\n } else if (direct !== all) {\r\n console.error(\r\n '[skra-file-upload] the input[skraFileInput] must be a DIRECT child — wrapped in another ' +\r\n 'element it is never projected, and nothing covers the face.',\r\n );\r\n } else if (direct > 1) {\r\n console.error(\r\n '[skra-file-upload] takes exactly ONE input[skraFileInput]; use `multiple` on it for ' +\r\n 'several files.',\r\n );\r\n }\r\n if (!this.action()) {\r\n console.error(\r\n '[skra-file-upload] needs a [skra-file-upload-action] (e.g. <span skra-file-upload-action>' +\r\n 'Choose a video</span>) — it is the visible action and half of the control’s accessible ' +\r\n 'name (ADR 0056 D4). Import SkraFileUploadAction so it can be detected.',\r\n );\r\n }\r\n }\r\n}\r\n","<!--\r\n The FACE (ADR 0056 D3) — paint, not a widget: aria-hidden, nothing focusable. The native\r\n control projected below covers all of it (D2) and is the only thing a user or AT operates.\r\n-->\r\n<span class=\"skra-file-upload-face\" aria-hidden=\"true\">\r\n @if (hasStart()) {\r\n <span class=\"skra-file-upload-icon\"\r\n ><ng-content select=\"[skra-start]\"\r\n /></span>\r\n }\r\n <!-- Referenced by the control's aria-labelledby (D4): the visible action text IS in the name. -->\r\n <span class=\"skra-file-upload-action\" [id]=\"ctx.actionId\"\r\n ><ng-content select=\"[skra-file-upload-action]\"\r\n /></span>\r\n @if (hasInstruction()) {\r\n <span class=\"skra-file-upload-instruction\"\r\n ><ng-content select=\"[skra-file-upload-instruction]\"\r\n /></span>\r\n }\r\n</span>\r\n<!--\r\n ALWAYS rendered: a live region must exist before its content changes, or the first change is\r\n not announced. Outside the aria-hidden face (D3's one exception) and linked to the control as a\r\n description. Role only — the implicit `status` politeness, no explicit aria-live (ADR 0052).\r\n-->\r\n<span class=\"skra-file-upload-status\" role=\"status\" [id]=\"ctx.statusId\"\r\n ><ng-content select=\"[skra-file-upload-status]\"\r\n/></span>\r\n<ng-content select=\"input[skraFileInput]\" />\r\n","/** A file name split for middle truncation: the stem may shrink, the extension never does. */\r\nexport interface SkraFileNameParts {\r\n readonly stem: string;\r\n readonly ext: string;\r\n}\r\n\r\n/**\r\n * Internal — NOT part of the public barrel. Split a file name at its LAST dot, for display.\r\n *\r\n * - `clip.final.mp4` → `clip.final` + `.mp4` (only the last dot separates);\r\n * - `.env` → no extension (a dotfile is all name — the dot is at index 0);\r\n * - `README`, `x.` → no extension (none, or an empty one after a trailing dot).\r\n *\r\n * Purely visual: the row also renders the WHOLE name for assistive technology, so the split\r\n * (and the ellipsis) is never heard.\r\n */\r\nexport function splitFileName(name: string): SkraFileNameParts {\r\n const dot = name.lastIndexOf('.');\r\n if (dot <= 0 || dot === name.length - 1) return { stem: name, ext: '' };\r\n return { stem: name.slice(0, dot), ext: name.slice(dot) };\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n contentChild,\r\n input,\r\n} from '@angular/core';\r\nimport { skraFormatFileSize } from '../file-helpers/file-helpers';\r\nimport { splitFileName } from '../file-helpers/file-name';\r\nimport {\r\n SkraFileItemDetail,\r\n SkraFileItemEnd,\r\n SkraFileItemError,\r\n SkraFileItemStart,\r\n} from '../file-upload.directives';\r\n\r\n/**\r\n * `li[skraFileItem]` — a display row for ONE consumer-owned file (spec\r\n * `component-file-upload-spec.md`). A Component-on-a-native-host (ADR 012 / ADR 040): the\r\n * `<li>` keeps its list-item semantics inside the consumer's `ul[skraStack]`.\r\n *\r\n * Separate from `<skra-file-upload>` by SRP: a row outlives the selection (it tracks an\r\n * upload), its source of truth is the consumer's queue — not `input.files` — and it is a\r\n * display list item, not a form control. **Skra never uploads**: progress, retry, cancel and\r\n * removal are the consumer's, projected into the row's slots.\r\n *\r\n * - **Name**, middle-truncated with the extension always visible — pure CSS, no measurement.\r\n * The visual split is `aria-hidden`; an `[skra-sr-only]` copy carries the whole name.\r\n * - **Size** — `skraFormatFileSize(size, locale)`: SI units, `Intl` short labels, the\r\n * `locale` input or the host default (the ADR 0050 §5 precedent).\r\n * - **Invalid is READ, never owned** (ADR 027 §3.8, spec Q-7): the row paints\r\n * `data-skra-validation=\"invalid\"` only while `[skra-file-item-error]` text is projected, so\r\n * the colour never appears without the words (WCAG 1.4.1 by construction). No `aria-invalid`\r\n * — no role an `<li>` holds supports it.\r\n *\r\n * <ul skraStack>\r\n * @for (u of uploads(); track u.id) {\r\n * <li skraFileItem [name]=\"u.file.name\" [size]=\"u.file.size\" locale=\"pl-PL\">\r\n * <progress skraProgress skra-file-item-detail [value]=\"u.sent\" [max]=\"u.file.size\"\r\n * [attr.aria-label]=\"'Uploading ' + u.file.name\"></progress>\r\n * @if (u.error) { <span skra-file-item-error>{{ u.error }}</span> }\r\n * <button skraButton skra-end emphasis=\"low\" (click)=\"cancel(u)\">\r\n * Cancel<span skra-sr-only> {{ u.file.name }}</span>\r\n * </button>\r\n * </li>\r\n * }\r\n * </ul>\r\n */\r\n@Component({\r\n selector: 'li[skraFileItem]',\r\n standalone: true,\r\n templateUrl: './file-item.html',\r\n styleUrl: './file-item.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n // Slot presence (ADR 020 / ADR 027 §3.6 — exempt).\r\n '[attr.data-skra-has-start]': 'hasStart() ? \"\" : null',\r\n '[attr.data-skra-has-detail]': 'hasDetail() ? \"\" : null',\r\n '[attr.data-skra-has-end]': 'hasEnd() ? \"\" : null',\r\n // Validation READ from the error slot (ADR 027 §3.8) — the canonical value, never\r\n // `data-skra-has-error` (ADR 027 iron boundary).\r\n '[attr.data-skra-validation]': 'hasError() ? \"invalid\" : null',\r\n },\r\n})\r\nexport class SkraFileItem {\r\n /** The file name, shown as stem + extension. */\r\n readonly name = input.required<string>();\r\n\r\n /** Size in bytes, formatted for display. `undefined` → no size shown. */\r\n readonly size = input<number | undefined>(undefined);\r\n\r\n /** `Intl` locale for the size. `undefined` → the host default (ADR 0050 §5 precedent). */\r\n readonly locale = input<string | undefined>(undefined);\r\n\r\n // `descendants: false` — `<ng-content select>` projects only TOP-LEVEL content, so detection\r\n // must look no deeper: an icon marked `[skra-start]` inside an end-slot button would\r\n // otherwise report a start slot and render an empty wrapper (ADR 020).\r\n private readonly start = contentChild(SkraFileItemStart, {\r\n descendants: false,\r\n });\r\n private readonly detail = contentChild(SkraFileItemDetail, {\r\n descendants: false,\r\n });\r\n private readonly error = contentChild(SkraFileItemError, {\r\n descendants: false,\r\n });\r\n private readonly end = contentChild(SkraFileItemEnd, { descendants: false });\r\n\r\n protected readonly hasStart = computed(() => !!this.start());\r\n protected readonly hasDetail = computed(() => !!this.detail());\r\n protected readonly hasError = computed(() => !!this.error());\r\n protected readonly hasEnd = computed(() => !!this.end());\r\n\r\n protected readonly parts = computed(() => splitFileName(this.name()));\r\n\r\n // A size that cannot exist is shown as no size, not as an exception in the template:\r\n // the row is display, and the helper's RangeError is for the caller who computes sizes.\r\n protected readonly sizeLabel = computed(() => {\r\n const bytes = this.size();\r\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return '';\r\n return skraFormatFileSize(bytes, this.locale());\r\n });\r\n}\r\n","@if (hasStart()) {\r\n<span class=\"skra-file-item-start\"><ng-content select=\"[skra-start]\" /></span>\r\n}\r\n<span class=\"skra-file-item-body\">\r\n <!--\r\n The name, middle-truncated with the extension always visible. The split pieces are\r\n aria-hidden; the whole name is read from the sr-only copy, so a screen reader never hears\r\n the split or the ellipsis. `dir=\"auto\"` lets an RTL name order its own pieces.\r\n -->\r\n <span class=\"skra-file-item-name\" dir=\"auto\">\r\n <span class=\"skra-file-item-stem\" aria-hidden=\"true\"\r\n >{{ parts().stem }}</span\r\n >\r\n @if (parts().ext) {\r\n <span class=\"skra-file-item-ext\" aria-hidden=\"true\">{{ parts().ext }}</span>\r\n }\r\n <span skra-sr-only>{{ name() }}</span>\r\n </span>\r\n @if (sizeLabel()) {\r\n <span class=\"skra-file-item-meta\">{{ sizeLabel() }}</span>\r\n } @if (hasDetail()) {\r\n <span class=\"skra-file-item-detail\"\r\n ><ng-content select=\"[skra-file-item-detail]\"\r\n /></span>\r\n } @if (hasError()) {\r\n <span class=\"skra-file-item-error\"\r\n ><ng-content select=\"[skra-file-item-error]\"\r\n /></span>\r\n }\r\n</span>\r\n@if (hasEnd()) {\r\n<span class=\"skra-file-item-end\"><ng-content select=\"[skra-end]\" /></span>\r\n}\r\n","// Public API for @skra/ui/file-upload — the FileUpload family (spec\r\n// adr/specs/component-file-upload-spec.md; ADR 0056 Groups B + D).\r\nexport * from './lib/file-upload.directives';\r\nexport * from './lib/file-helpers/file-helpers';\r\nexport * from './lib/file-input/file-input';\r\nexport * from './lib/file-upload/file-upload';\r\nexport * from './lib/file-item/file-item';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;MAKa,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACx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AAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,iBAAiB,CAAA,EAAA,EAAA,GAAE;AACvD,4BAAA,WAAW,EAAE,KAAK;AACnB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACsC,kBAAkB,CAAA,EAAA,EAAA,GAAE;AACzD,4BAAA,WAAW,EAAE,KAAK;AACnB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACqC,iBAAiB,CAAA,EAAA,EAAA,GAAE;AACvD,4BAAA,WAAW,EAAE,KAAK;AACnB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACmC,eAAe,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExF7E;AACA;;ACDA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skra/ui",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,7 +10,7 @@
10
10
  "@angular/core": ">=22.0.0 <23.0.0",
11
11
  "@angular/common": ">=22.0.0 <23.0.0",
12
12
  "@angular/cdk": ">=22.0.0 <23.0.0",
13
- "@skra/tokens": "^0.7.0"
13
+ "@skra/tokens": "^0.8.0"
14
14
  },
15
15
  "dependencies": {
16
16
  "@floating-ui/dom": "^1.7.6",
@@ -78,6 +78,10 @@
78
78
  "types": "./types/skra-ui-field.d.ts",
79
79
  "default": "./fesm2022/skra-ui-field.mjs"
80
80
  },
81
+ "./file-upload": {
82
+ "types": "./types/skra-ui-file-upload.d.ts",
83
+ "default": "./fesm2022/skra-ui-file-upload.mjs"
84
+ },
81
85
  "./icon": {
82
86
  "types": "./types/skra-ui-icon.d.ts",
83
87
  "default": "./fesm2022/skra-ui-icon.mjs"
@@ -0,0 +1,360 @@
1
+ import * as i0 from '@angular/core';
2
+ import { SkraFieldContext } from '@skra/ui/field';
3
+
4
+ /** Leading icon of `<skra-file-upload>`'s face. Decorative — the consumer marks it `aria-hidden`. */
5
+ declare class SkraFileUploadStart {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileUploadStart, never>;
7
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileUploadStart, "[skra-start]", never, {}, {}, never, never, true, never>;
8
+ }
9
+ /**
10
+ * REQUIRED. The visible action text of `<skra-file-upload>` ("Choose a video"). It joins the
11
+ * native control's accessible name through `aria-labelledby` (ADR 0056 D4, WCAG 2.5.3), so a
12
+ * voice-control user can say what they see.
13
+ */
14
+ declare class SkraFileUploadAction {
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileUploadAction, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileUploadAction, "[skra-file-upload-action]", never, {}, {}, never, never, true, never>;
17
+ }
18
+ /**
19
+ * The drop instruction ("or drag it here"). Its presence switches the face from the compact
20
+ * row to the drop-zone layout — an instruction is what invites dragging. Hidden on devices
21
+ * with no fine pointer, where "drag" means nothing.
22
+ */
23
+ declare class SkraFileUploadInstruction {
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileUploadInstruction, never>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileUploadInstruction, "[skra-file-upload-instruction]", never, {}, {}, never, never, true, never>;
26
+ }
27
+ /**
28
+ * The selection summary in the page's language ("recording.mp4, 2.3 GB"). Rendered inside the
29
+ * composite's always-present `role="status"` region and linked to the control as a description,
30
+ * so a change is announced and the user agent's browser-language status is not the only one.
31
+ */
32
+ declare class SkraFileUploadStatus {
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileUploadStatus, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileUploadStatus, "[skra-file-upload-status]", never, {}, {}, never, never, true, never>;
35
+ }
36
+ /** Leading visual of a file row — an icon or a consumer-made thumbnail (`URL.createObjectURL`). */
37
+ declare class SkraFileItemStart {
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileItemStart, never>;
39
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileItemStart, "[skra-start]", never, {}, {}, never, never, true, never>;
40
+ }
41
+ /** Row detail under the name — typically `progress[skraProgress]` or a status line. */
42
+ declare class SkraFileItemDetail {
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileItemDetail, never>;
44
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileItemDetail, "[skra-file-item-detail]", never, {}, {}, never, never, true, never>;
45
+ }
46
+ /**
47
+ * The row's error text. Its presence is what paints the row invalid
48
+ * (`data-skra-validation="invalid"`), so the colour never appears without the words
49
+ * (WCAG 1.4.1 by construction).
50
+ */
51
+ declare class SkraFileItemError {
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileItemError, never>;
53
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileItemError, "[skra-file-item-error]", never, {}, {}, never, never, true, never>;
54
+ }
55
+ /** Trailing row actions — the consumer's `button[skraButton]`s (cancel / retry / remove). */
56
+ declare class SkraFileItemEnd {
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileItemEnd, never>;
58
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SkraFileItemEnd, "[skra-end]", never, {}, {}, never, never, true, never>;
59
+ }
60
+
61
+ /**
62
+ * Format a byte count for display in `locale` (`undefined` → the host default, the ADR 0050
63
+ * §5 precedent): `2,3 GB` in `pl`, `2.3 GB` in `en`, one fractional digit at most.
64
+ *
65
+ * SI units (1 kB = 1000 B) because `Intl` names only those and macOS / iOS report sizes the
66
+ * same way. The unit label is `Intl`'s own short form, so it is translated and pluralised by
67
+ * the platform's locale data, never by Skra (e.g. `999 byte` in English, `999 B` in Polish —
68
+ * CLDR's choice, not ours). A multi-GB `File.size` is a safe integer; nothing here rounds
69
+ * the input.
70
+ *
71
+ * @throws RangeError for a negative or non-finite count — a size that cannot exist is a bug
72
+ * in the caller, and printing `NaN byte` would hide it.
73
+ */
74
+ declare function skraFormatFileSize(bytes: number, locale?: string): string;
75
+ /**
76
+ * Does `file` satisfy `accept`, under the HTML attribute's own semantics?
77
+ *
78
+ * - `.ext` — a case-insensitive suffix of the file NAME;
79
+ * - `type/subtype` — the file's MIME type, case-insensitive, parameters ignored;
80
+ * - `type/*` — any subtype of `type`.
81
+ *
82
+ * An empty `accept`, or one with no token the grammar recognises, accepts everything — the
83
+ * picker applies no filter in that case either.
84
+ *
85
+ * **Typeless files** (`File.type === ''` — common for `.mkv` / `.heic` on some engines) are
86
+ * matched by extension tokens only, and PASS when `accept` has no extension token (spec Q-5).
87
+ * A false rejection of a legitimate 4 GB recording costs more than a junk file the consumer
88
+ * and the server reject anyway.
89
+ *
90
+ * `accept` is never a guarantee: every platform lets a user bypass it. Validate on the server.
91
+ */
92
+ declare function skraFileMatchesAccept(file: Pick<File, 'name' | 'type'>, accept: string): boolean;
93
+
94
+ /** Why the normalisation turned a file down. Every reason is a rule the PLATFORM's picker enforces. */
95
+ type SkraFileRejectionReason = 'type' | 'count' | 'directory';
96
+ /** A file the normalisation rejected, and why. */
97
+ interface SkraFileRejection {
98
+ readonly file: File;
99
+ readonly reason: SkraFileRejectionReason;
100
+ }
101
+
102
+ /**
103
+ * `input[type="file"][skraFileInput]` — the native file control (spec
104
+ * `component-file-upload-spec.md`; ADR 0056 Group B). A Component-on-a-native-host
105
+ * (ADR 040): `<input>` is void, so `template: ''`, and `file-input.scss` is scoped to the
106
+ * host by Emulated encapsulation — the box from `comp.field.*`, the user agent's
107
+ * `::file-selector-button` painted from `comp.field.file.*` (ADR 0056 B1–B5).
108
+ *
109
+ * **No inputs.** Every constraint is a NATIVE attribute on the consumer's own host —
110
+ * `accept`, `multiple`, `capture`, `required`, `disabled`, `name`, `webkitdirectory`
111
+ * (native-attr-first, Iron Boundary #9). Skra reads them at the moment of a selection; it
112
+ * never mirrors them.
113
+ *
114
+ * **Agnostic value (ADR 037).** The selection is REPORTED, never held: `filesChange` carries
115
+ * the normalised files, `filesRejected` what the normalisation turned down. Native
116
+ * `(change)` keeps working and reports the RAW selection; `filesChange` is the normalised one.
117
+ *
118
+ * **Normalisation** — Skra enforces exactly what the platform's own picker enforces, on
119
+ * every path, and nothing more (size / count caps / duplicates are product policy):
120
+ *
121
+ * | Rule | Picker (`change`) | Drop (`drop` on the host) |
122
+ * | --- | --- | --- |
123
+ * | `accept` mismatch → `type` | possible (Windows "All files", Android) | the browser applies no `accept` to drops |
124
+ * | >1 file without `multiple` → `count` | impossible | possible — ALL rejected |
125
+ * | a directory → `directory` | impossible | possible |
126
+ * | assignment | `input.files` left as the platform set it | `input.files` = the ACCEPTED files, then `input` + `change` are dispatched |
127
+ *
128
+ * A drop where nothing is accepted leaves the existing selection untouched and emits only
129
+ * `filesRejected` — like a cancelled picker, it is not a change.
130
+ *
131
+ * **Field wiring (ADR 013 §3.7)** — the `skraInput` wiring verbatim: optional
132
+ * `SkraFieldContext`; `id` / `disabled` written from guarded `effect()`s so a standalone
133
+ * consumer's own attributes survive; `aria-describedby` / `aria-invalid` / `aria-required`
134
+ * host bindings. Readonly: the native `readonly` attribute does not apply to `type="file"`
135
+ * (HTML) and `aria-readonly` is not exposed for its `button` role (G-4, measured), so it is
136
+ * `aria-disabled="true"` — the focusable soft-disable — plus a behaviour guard that blocks the
137
+ * picker (`click`, keys other than `Tab`) and drops.
138
+ *
139
+ * **Known limitation (G-4, measured in Chromium):** "required" cannot reach assistive
140
+ * technology on this control — neither `aria-required` (kept: harmless, and the field's
141
+ * contract) nor native `required` is exposed for the `button` role. Say "required" in visible
142
+ * text (the label or the hint) as well.
143
+ *
144
+ * **Inside `<skra-file-upload>`** (ADR 0056 Group D) the composite's context is injected:
145
+ * the host reflects `data-skra-in-upload` (ADR 027 §3.9b) and its own stylesheet makes it a
146
+ * transparent overlay over the painted face (`opacity: 0` only — D2); its name becomes
147
+ * "field label + visible action text" via `aria-labelledby` (D4, WCAG 2.5.3) and the
148
+ * composite's status region joins its description.
149
+ *
150
+ * <skra-field>
151
+ * <label skraLabelFor>Session recording</label>
152
+ * <input skraFileInput type="file" accept="video/*" #picker (filesChange)="onFiles($event)" />
153
+ * </skra-field>
154
+ */
155
+ declare class SkraFileInput {
156
+ private readonly el;
157
+ readonly context: SkraFieldContext | null;
158
+ private readonly upload;
159
+ /** User picked or dropped files. Fires on user interaction only, after normalisation. */
160
+ readonly filesChange: i0.OutputEmitterRef<readonly File[]>;
161
+ /** Files the normalisation rejected. Fires only when at least one was rejected. */
162
+ readonly filesRejected: i0.OutputEmitterRef<readonly SkraFileRejection[]>;
163
+ protected readonly inUpload: boolean;
164
+ protected readonly dragOver: i0.WritableSignal<boolean>;
165
+ private dragDepth;
166
+ protected readonly softDisabled: i0.Signal<boolean>;
167
+ protected readonly describedBy: i0.Signal<string | null>;
168
+ protected readonly labelledBy: i0.Signal<string | null>;
169
+ constructor();
170
+ /**
171
+ * Reset the native selection (`value = ''`) so the same file can be picked again — the
172
+ * queue model (`filesChange` → enqueue → `clear()`). Programmatic: emits nothing.
173
+ * Reach it through a template reference: `#picker` on the host resolves to this component.
174
+ */
175
+ clear(): void;
176
+ private get blocked();
177
+ /**
178
+ * The native constraints, read at selection time. A `webkitdirectory` picker hands over
179
+ * EVERY file of the chosen folder whether or not `multiple` is set, so it counts as
180
+ * multiple — otherwise each folder pick would be rejected whole as `count`.
181
+ */
182
+ private constraints;
183
+ /**
184
+ * The picker path — and the drop path's own dispatched `change`, already normalised.
185
+ *
186
+ * Order is part of the contract, the same on both paths: `filesChange` FIRST, then
187
+ * `filesRejected`. A consumer that clears its error on a new selection and sets it on a
188
+ * rejection then ends on the rejection message, not on a cleared one. A selection where
189
+ * EVERY file was rejected emits no `filesChange` at all (like a fully rejected drop): it
190
+ * changed nothing the consumer can use. An empty selection with no rejection (a picker
191
+ * that reports a cleared selection) still emits `filesChange([])`.
192
+ */
193
+ protected onChange(): void;
194
+ /** Readonly: `preventDefault` on `click` keeps the picker closed, for pointer and keyboard alike. */
195
+ protected blockWhenReadonly(event: Event): void;
196
+ /** Readonly: block keyboard activation; let `Tab` through. */
197
+ protected blockKeyWhenReadonly(event: KeyboardEvent): void;
198
+ protected onDragEnter(event: DragEvent): void;
199
+ protected onDragOver(event: DragEvent): void;
200
+ protected onDragLeave(): void;
201
+ protected resetDrag(): void;
202
+ /** The drop path — normalise, then assign the ACCEPTED files and replay the native events. */
203
+ protected onDrop(event: DragEvent): void;
204
+ /**
205
+ * Directory detection has to happen INSIDE the `drop` handler: `webkitGetAsEntry()` is the
206
+ * only cross-engine signal (a dropped folder arrives as a `File` too), and the item list
207
+ * is emptied once the event returns.
208
+ */
209
+ private candidatesOf;
210
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileInput, never>;
211
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkraFileInput, "input[type=\"file\"][skraFileInput]", never, {}, { "filesChange": "filesChange"; "filesRejected": "filesRejected"; }, never, never, true, never>;
212
+ }
213
+
214
+ /**
215
+ * Internal — provided by `<skra-file-upload>` per instance, injected `{ optional: true }` by
216
+ * the projected `input[skraFileInput]` (ADR 013 §3.6 contextual wiring). Carries ids only —
217
+ * never a value, never state (ADR 037; the composite owns no state, ADR 027 §3.8).
218
+ *
219
+ * Its PRESENCE is what puts the input into overlay mode (`data-skra-in-upload`, ADR 027
220
+ * §3.9b): Emulated encapsulation lets no parent style projected content, and DI keeps the
221
+ * rule in the atom's own stylesheet instead of a global slice (no O-8 bridge cost).
222
+ */
223
+ declare class SkraFileUploadContext {
224
+ private readonly base;
225
+ /** The face's visible action text — the second half of the control's name (ADR 0056 D4). */
226
+ readonly actionId: string;
227
+ /** The always-present status region — a description of the control, never its name. */
228
+ readonly statusId: string;
229
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileUploadContext, never>;
230
+ static ɵprov: i0.ɵɵInjectableDeclaration<SkraFileUploadContext>;
231
+ }
232
+
233
+ /**
234
+ * `<skra-file-upload>` — the optional enhancement over a projected `input[skraFileInput]`
235
+ * (spec `component-file-upload-spec.md`; ADR 0056 Group D). It paints a localisable face —
236
+ * the action and the instruction in the PAGE's language, from tokens — enlarges the control
237
+ * into a drop zone, and hosts the live selection-status region.
238
+ *
239
+ * Why it exists: the native control's two strings ("Choose File" / "No file chosen") come
240
+ * from the browser's UI language, not the page's `lang`, and no CSS or attribute can replace
241
+ * them (ADR 0056 §1.6). The native control stays THE control (D2): transparent
242
+ * (`opacity: 0`, its own stylesheet, switched on by this component's context), covering the
243
+ * whole face, it remains the focus target, the pointer target, the drop target and the node
244
+ * assistive technology reads — so `required`, `aria-invalid`, the validation bubble, label
245
+ * activation, form submission and the iOS camera / library sheet all keep working.
246
+ *
247
+ * **State-READING** (ADR 027 §3.8, ADR 055): no inputs, no outputs; every state it paints —
248
+ * hover, focus-visible, drag-over, disabled, readonly, invalid — is read from the projected
249
+ * control through `:has()`. It owns no state, so it mirrors no ARIA.
250
+ *
251
+ * **Layout follows content (ADR 020).** No `[skra-file-upload-instruction]` → a compact,
252
+ * field-like row (`[icon] [action] status`); with one → the drop-zone layout (stacked,
253
+ * centred, dashed). Both accept drops. There is no look input (skin philosophy).
254
+ *
255
+ * **Never project interactive content** into it — the transparent control covers the whole
256
+ * face and swallows the clicks (D3). The file list is a SIBLING.
257
+ *
258
+ * **Page-navigation guard.** While one is mounted, a FILE drag dropped outside every drop
259
+ * target is cancelled instead of navigating the page to the file (spec Q-3; text / link
260
+ * drags, native file inputs and editable content are untouched).
261
+ *
262
+ * <skra-field [hasError]="!!error()">
263
+ * <label skraLabelFor>Session recording</label>
264
+ * <skra-file-upload>
265
+ * <span skra-file-upload-action>Choose a video</span>
266
+ * <span skra-file-upload-instruction>or drag it here</span>
267
+ * <span skra-file-upload-status>{{ summary() }}</span>
268
+ * <input skraFileInput type="file" accept="video/*" (filesChange)="onFiles($event)" />
269
+ * </skra-file-upload>
270
+ * <skra-error>{{ error() }}</skra-error>
271
+ * </skra-field>
272
+ */
273
+ declare class SkraFileUpload {
274
+ protected readonly ctx: SkraFileUploadContext;
275
+ private readonly host;
276
+ private readonly start;
277
+ private readonly action;
278
+ private readonly instruction;
279
+ private readonly status;
280
+ private readonly inputs;
281
+ private readonly nestedInputs;
282
+ protected readonly hasStart: i0.Signal<boolean>;
283
+ protected readonly hasInstruction: i0.Signal<boolean>;
284
+ protected readonly hasStatus: i0.Signal<boolean>;
285
+ constructor();
286
+ /**
287
+ * Dev-only, ADR 0056 D3: the face is paint. Anything interactive projected into it sits
288
+ * UNDER the transparent control, so the control swallows its clicks — and inside the
289
+ * `aria-hidden` face it is hidden from assistive technology while still focusable. A read of
290
+ * the rendered face, never a write.
291
+ */
292
+ private warnInteractiveFace;
293
+ /** Dev-only: the composite cannot work without exactly one direct-child control and an action. */
294
+ private warnMisuse;
295
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileUpload, never>;
296
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkraFileUpload, "skra-file-upload", never, {}, {}, ["start", "action", "instruction", "status", "inputs", "nestedInputs"], ["[skra-start]", "[skra-file-upload-action]", "[skra-file-upload-instruction]", "[skra-file-upload-status]", "input[skraFileInput]"], true, never>;
297
+ }
298
+
299
+ /** A file name split for middle truncation: the stem may shrink, the extension never does. */
300
+ interface SkraFileNameParts {
301
+ readonly stem: string;
302
+ readonly ext: string;
303
+ }
304
+
305
+ /**
306
+ * `li[skraFileItem]` — a display row for ONE consumer-owned file (spec
307
+ * `component-file-upload-spec.md`). A Component-on-a-native-host (ADR 012 / ADR 040): the
308
+ * `<li>` keeps its list-item semantics inside the consumer's `ul[skraStack]`.
309
+ *
310
+ * Separate from `<skra-file-upload>` by SRP: a row outlives the selection (it tracks an
311
+ * upload), its source of truth is the consumer's queue — not `input.files` — and it is a
312
+ * display list item, not a form control. **Skra never uploads**: progress, retry, cancel and
313
+ * removal are the consumer's, projected into the row's slots.
314
+ *
315
+ * - **Name**, middle-truncated with the extension always visible — pure CSS, no measurement.
316
+ * The visual split is `aria-hidden`; an `[skra-sr-only]` copy carries the whole name.
317
+ * - **Size** — `skraFormatFileSize(size, locale)`: SI units, `Intl` short labels, the
318
+ * `locale` input or the host default (the ADR 0050 §5 precedent).
319
+ * - **Invalid is READ, never owned** (ADR 027 §3.8, spec Q-7): the row paints
320
+ * `data-skra-validation="invalid"` only while `[skra-file-item-error]` text is projected, so
321
+ * the colour never appears without the words (WCAG 1.4.1 by construction). No `aria-invalid`
322
+ * — no role an `<li>` holds supports it.
323
+ *
324
+ * <ul skraStack>
325
+ * @for (u of uploads(); track u.id) {
326
+ * <li skraFileItem [name]="u.file.name" [size]="u.file.size" locale="pl-PL">
327
+ * <progress skraProgress skra-file-item-detail [value]="u.sent" [max]="u.file.size"
328
+ * [attr.aria-label]="'Uploading ' + u.file.name"></progress>
329
+ * @if (u.error) { <span skra-file-item-error>{{ u.error }}</span> }
330
+ * <button skraButton skra-end emphasis="low" (click)="cancel(u)">
331
+ * Cancel<span skra-sr-only> {{ u.file.name }}</span>
332
+ * </button>
333
+ * </li>
334
+ * }
335
+ * </ul>
336
+ */
337
+ declare class SkraFileItem {
338
+ /** The file name, shown as stem + extension. */
339
+ readonly name: i0.InputSignal<string>;
340
+ /** Size in bytes, formatted for display. `undefined` → no size shown. */
341
+ readonly size: i0.InputSignal<number | undefined>;
342
+ /** `Intl` locale for the size. `undefined` → the host default (ADR 0050 §5 precedent). */
343
+ readonly locale: i0.InputSignal<string | undefined>;
344
+ private readonly start;
345
+ private readonly detail;
346
+ private readonly error;
347
+ private readonly end;
348
+ protected readonly hasStart: i0.Signal<boolean>;
349
+ protected readonly hasDetail: i0.Signal<boolean>;
350
+ protected readonly hasError: i0.Signal<boolean>;
351
+ protected readonly hasEnd: i0.Signal<boolean>;
352
+ protected readonly parts: i0.Signal<SkraFileNameParts>;
353
+ protected readonly sizeLabel: i0.Signal<string>;
354
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkraFileItem, never>;
355
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkraFileItem, "li[skraFileItem]", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; }, {}, ["start", "detail", "error", "end"], ["[skra-start]", "[skra-file-item-detail]", "[skra-file-item-error]", "[skra-end]"], true, never>;
356
+ }
357
+
358
+ export { SkraFileInput, SkraFileItem, SkraFileItemDetail, SkraFileItemEnd, SkraFileItemError, SkraFileItemStart, SkraFileUpload, SkraFileUploadAction, SkraFileUploadInstruction, SkraFileUploadStart, SkraFileUploadStatus, skraFileMatchesAccept, skraFormatFileSize };
359
+ export type { SkraFileRejection, SkraFileRejectionReason };
360
+ //# sourceMappingURL=skra-ui-file-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skra-ui-file-upload.d.ts","sources":["../../../../libs/ui/file-upload/src/lib/file-upload.directives.ts","../../../../libs/ui/file-upload/src/lib/file-helpers/file-helpers.ts","../../../../libs/ui/file-upload/src/lib/file-helpers/file-partition.ts","../../../../libs/ui/file-upload/src/lib/file-input/file-input.ts","../../../../libs/ui/file-upload/src/lib/file-upload/file-upload-context.ts","../../../../libs/ui/file-upload/src/lib/file-upload/file-upload.ts","../../../../libs/ui/file-upload/src/lib/file-helpers/file-name.ts","../../../../libs/ui/file-upload/src/lib/file-item/file-item.ts"],"mappings":";;;AAUA;AACA,cAIa,mBAAmB;yCAAnB,mBAAmB;2CAAnB,mBAAmB;AAAG;AAEnC;;;;AAIG;AACH,cAIa,oBAAoB;yCAApB,oBAAoB;2CAApB,oBAAoB;AAAG;AAEpC;;;;AAIG;AACH,cAIa,yBAAyB;yCAAzB,yBAAyB;2CAAzB,yBAAyB;AAAG;AAEzC;;;;AAIG;AACH,cAIa,oBAAoB;yCAApB,oBAAoB;2CAApB,oBAAoB;AAAG;AAIpC;AACA,cAIa,iBAAiB;yCAAjB,iBAAiB;2CAAjB,iBAAiB;AAAG;AAEjC;AACA,cAIa,kBAAkB;yCAAlB,kBAAkB;2CAAlB,kBAAkB;AAAG;AAElC;;;;AAIG;AACH,cAIa,iBAAiB;yCAAjB,iBAAiB;2CAAjB,iBAAiB;AAAG;AAEjC;AACA,cAIa,eAAe;yCAAf,eAAe;2CAAf,eAAe;AAAG;;AClE/B;;;;;;;;;;;;AAYG;AACH,iBAAgB,kBAAkB;AAoDlC;;;;;;;;;;;;;;;;AAgBG;AACH,iBAAgB,qBAAqB,OAC7B,IAAI,CAAC,IAAI;;ACjGjB;AACM,KAAM,uBAAuB;AAEnC;UACiB,iBAAiB;AAChC,mBAAe,IAAI;AACnB,qBAAiB,uBAAuB;AACzC;;ACwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDG;AACH,cAmCa,aAAa;AACxB;sBACgB,gBAAA;AAChB;;0BAGoBA,EAAA,CAAA,gBAAA,UAAA,IAAA;;4BAGEA,EAAA,CAAA,gBAAA,UAAA,iBAAA;AAEtB;AACA,iCAA2BA,EAAA,CAAA,cAAA;;AAQ3B,qCAA+BA,EAAA,CAAA,MAAA;AAI/B,oCAA8BA,EAAA,CAAA,MAAA;AAS9B,mCAA6BA,EAAA,CAAA,MAAA;;AA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