@krizaka/ui 3.65.0 → 3.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/account-settings.d.ts +2 -0
- package/dist/account-settings.js +3 -1
- package/dist/account-settings.js.map +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/app-header/search.js +1 -1
- package/dist/app-header.d.ts +3 -3
- package/dist/app-shell.js +1 -1
- package/dist/argument-card.js +2 -2
- package/dist/audio-player.js +1 -1
- package/dist/auth-layout.js +1 -1
- package/dist/auth-layout.js.map +1 -1
- package/dist/{chunk-5QEXOGO2.js → chunk-6BMKLAZ7.js} +1 -1
- package/dist/{chunk-XCBVFMNV.js.map → chunk-6BMKLAZ7.js.map} +1 -1
- package/dist/{chunk-SHBYNQFS.js → chunk-7DYZTEE3.js} +1 -1
- package/dist/{chunk-SHBYNQFS.js.map → chunk-7DYZTEE3.js.map} +1 -1
- package/dist/{chunk-YCZ7N6Q6.js → chunk-7MQNG35Q.js} +2 -2
- package/dist/{chunk-XCBVFMNV.js → chunk-C57KK5VB.js} +7 -2
- package/dist/chunk-C57KK5VB.js.map +1 -0
- package/dist/{chunk-VB7MWE2N.js → chunk-DSDFXPL6.js} +2 -2
- package/dist/{chunk-BG5APGX6.js → chunk-E4X3V7QX.js} +17 -18
- package/dist/{chunk-BG5APGX6.js.map → chunk-E4X3V7QX.js.map} +1 -1
- package/dist/{chunk-P7GZR5CU.js → chunk-GFRUTPGG.js} +1 -1
- package/dist/{chunk-P7GZR5CU.js.map → chunk-GFRUTPGG.js.map} +1 -1
- package/dist/{chunk-4GQH27IT.js → chunk-GW5EI7MI.js} +2 -2
- package/dist/chunk-NG6G6V5E.js +33 -0
- package/dist/{chunk-5QEXOGO2.js.map → chunk-NG6G6V5E.js.map} +1 -1
- package/dist/{chunk-F6JTHPHE.js → chunk-PFPOBIHL.js} +46 -29
- package/dist/{chunk-F6JTHPHE.js.map → chunk-PFPOBIHL.js.map} +1 -1
- package/dist/{chunk-CPA5CF35.js → chunk-PGBF3UBX.js} +1 -1
- package/dist/{chunk-CPA5CF35.js.map → chunk-PGBF3UBX.js.map} +1 -1
- package/dist/{chunk-RCKXJEDQ.js → chunk-ST5P5HNI.js} +2 -2
- package/dist/code-block.js +1 -1
- package/dist/collection-switcher.d.ts +68 -0
- package/dist/collection-switcher.js +131 -0
- package/dist/collection-switcher.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/cover-hero.js +1 -1
- package/dist/data-table.js +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/decision-list.js +1 -1
- package/dist/default-avatar-D9kiSFNB.d.ts +26 -0
- package/dist/docs-layout.js +1 -1
- package/dist/entity-header.d.ts +92 -0
- package/dist/entity-header.js +165 -0
- package/dist/entity-header.js.map +1 -0
- package/dist/file-upload.d.ts +5 -3
- package/dist/file-upload.js +3 -1
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/footnote.js +1 -1
- package/dist/footnote.js.map +1 -1
- package/dist/genui.js +4 -4
- package/dist/link-card.js +2 -2
- package/dist/list.js +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/native.d.ts +121 -3
- package/dist/native.js +1770 -1228
- package/dist/native.js.map +1 -1
- package/dist/opening-hours.js +1 -1
- package/dist/page-hero.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/photo-grid.js +1 -1
- package/dist/pricing-page.js.map +1 -1
- package/dist/qr-code.d.ts +42 -0
- package/dist/qr-code.js +350 -0
- package/dist/qr-code.js.map +1 -0
- package/dist/radio-group.js +1 -1
- package/dist/rail-nav.js +1 -1
- package/dist/retro-tv.js +2 -2
- package/dist/search-field.js +2 -2
- package/dist/service-card.js +1 -1
- package/dist/shop-composer.js +1 -1
- package/dist/shop-composer.js.map +1 -1
- package/dist/site-cahier.js +1 -1
- package/dist/status-chip.js +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/tag-selector.js +2 -1
- package/dist/tag-selector.js.map +1 -1
- package/dist/terminal-replay.js +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/video-player.js +2 -2
- package/package.json +48 -5
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +2 -2
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +2 -2
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +2 -2
- package/registry/app-header.json +2 -2
- package/registry/app-shell.json +2 -2
- package/registry/argument-card.json +2 -2
- package/registry/audio-player.json +2 -2
- package/registry/auth-layout.json +2 -2
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +2 -2
- package/registry/collection-switcher.json +436 -0
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +2 -2
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +3 -3
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +2 -2
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +2 -2
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +502 -0
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/collection-switcher/entity.d.ts +4 -0
- package/registry/examples/collection-switcher/entity.js +17 -0
- package/registry/examples/collection-switcher/entity.tsx +13 -0
- package/registry/examples/collection-switcher/list.d.ts +4 -0
- package/registry/examples/collection-switcher/list.js +32 -0
- package/registry/examples/collection-switcher/list.tsx +27 -0
- package/registry/examples/collection-switcher/native/list.d.ts +4 -0
- package/registry/examples/collection-switcher/native/list.dark.png +0 -0
- package/registry/examples/collection-switcher/native/list.js +18 -0
- package/registry/examples/collection-switcher/native/list.light.png +0 -0
- package/registry/examples/collection-switcher/native/list.tsx +14 -0
- package/registry/examples/collection-switcher/tree.d.ts +4 -0
- package/registry/examples/collection-switcher/tree.js +19 -0
- package/registry/examples/collection-switcher/tree.tsx +15 -0
- package/registry/examples/entity-header/basic.d.ts +4 -0
- package/registry/examples/entity-header/basic.js +31 -0
- package/registry/examples/entity-header/basic.tsx +25 -0
- package/registry/examples/entity-header/native/basic.d.ts +4 -0
- package/registry/examples/entity-header/native/basic.dark.png +0 -0
- package/registry/examples/entity-header/native/basic.js +17 -0
- package/registry/examples/entity-header/native/basic.light.png +0 -0
- package/registry/examples/entity-header/native/basic.tsx +12 -0
- package/registry/examples/qr-code/basic.d.ts +4 -0
- package/registry/examples/qr-code/basic.js +11 -0
- package/registry/examples/qr-code/basic.tsx +6 -0
- package/registry/examples/qr-code/calendar-feed.d.ts +4 -0
- package/registry/examples/qr-code/calendar-feed.js +24 -0
- package/registry/examples/qr-code/calendar-feed.tsx +18 -0
- package/registry/examples/qr-code/native/calendar-feed.d.ts +4 -0
- package/registry/examples/qr-code/native/calendar-feed.dark.png +0 -0
- package/registry/examples/qr-code/native/calendar-feed.js +25 -0
- package/registry/examples/qr-code/native/calendar-feed.light.png +0 -0
- package/registry/examples/qr-code/native/calendar-feed.tsx +19 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +17 -3
- package/registry/filter-bar.json +3 -3
- package/registry/flock.json +1 -1
- package/registry/footnote.json +2 -2
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +102 -8
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +2 -2
- package/registry/list.json +2 -2
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +2 -2
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +2 -2
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +2 -2
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +2 -2
- package/registry/photo-grid.json +2 -2
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +2 -2
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/qr-code.json +343 -0
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +2 -2
- package/registry/rail-nav.json +3 -3
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +2 -2
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +2 -2
- package/registry/shop.json +2 -2
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +2 -2
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +2 -2
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +2 -2
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +2 -2
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +2 -2
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +1 -1
- package/registry/waveform.json +1 -1
- /package/dist/{chunk-YCZ7N6Q6.js.map → chunk-7MQNG35Q.js.map} +0 -0
- /package/dist/{chunk-VB7MWE2N.js.map → chunk-DSDFXPL6.js.map} +0 -0
- /package/dist/{chunk-4GQH27IT.js.map → chunk-GW5EI7MI.js.map} +0 -0
- /package/dist/{chunk-RCKXJEDQ.js.map → chunk-ST5P5HNI.js.map} +0 -0
package/dist/file-upload.d.ts
CHANGED
|
@@ -145,13 +145,15 @@ type DropzoneProps = {
|
|
|
145
145
|
onReject?: (rejections: FileRejection[]) => void;
|
|
146
146
|
/** The words of a refusal, shown in the zone: `(r) => r.file.name + " is too large"`. Without it, nothing is shown. */
|
|
147
147
|
refusalLabel?: (rejection: FileRejection) => string;
|
|
148
|
+
/** The accessible name of the file input, passed translated. Defaults to `title`. */
|
|
149
|
+
inputLabel?: string;
|
|
148
150
|
/** An icon instead of the upload glyph. */
|
|
149
151
|
icon?: React.ReactNode;
|
|
150
152
|
/** Classes merged on the zone. */
|
|
151
153
|
className?: string;
|
|
152
154
|
};
|
|
153
155
|
/** A zone to drop files on, with a button that opens the picker: checks type, size and count. */
|
|
154
|
-
declare function Dropzone({ title, browseLabel, hint, accept, maxSize, maxFiles, multiple, disabled, capture, onFiles, onReject, refusalLabel, icon, className, }: DropzoneProps): React.JSX.Element;
|
|
156
|
+
declare function Dropzone({ title, browseLabel, hint, accept, maxSize, maxFiles, multiple, disabled, capture, onFiles, onReject, refusalLabel, inputLabel, icon, className, }: DropzoneProps): React.JSX.Element;
|
|
155
157
|
type UploadStatus = "queued" | "uploading" | "paused" | "done" | "error";
|
|
156
158
|
type UploadItem = {
|
|
157
159
|
/** A stable id. */
|
|
@@ -240,8 +242,8 @@ declare function useUploadQueue(options: UploadQueueOptions): {
|
|
|
240
242
|
items: UploadItem[];
|
|
241
243
|
add: (files: readonly File[]) => void;
|
|
242
244
|
pause: (id: string) => void;
|
|
243
|
-
resume:
|
|
244
|
-
retry:
|
|
245
|
+
resume: any;
|
|
246
|
+
retry: any;
|
|
245
247
|
cancel: (id: string) => void;
|
|
246
248
|
remove: (id: string) => void;
|
|
247
249
|
};
|
package/dist/file-upload.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
PlayGlyph,
|
|
10
10
|
RetryGlyph,
|
|
11
11
|
UploadGlyph
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PGBF3UBX.js";
|
|
13
13
|
|
|
14
14
|
// src/file-upload/file-upload.tsx
|
|
15
15
|
import { getNumberFormat } from "@krizaka/intl";
|
|
@@ -195,6 +195,7 @@ function Dropzone({
|
|
|
195
195
|
onFiles,
|
|
196
196
|
onReject,
|
|
197
197
|
refusalLabel,
|
|
198
|
+
inputLabel,
|
|
198
199
|
icon,
|
|
199
200
|
className
|
|
200
201
|
}) {
|
|
@@ -269,6 +270,7 @@ function Dropzone({
|
|
|
269
270
|
type: "file",
|
|
270
271
|
tabIndex: -1,
|
|
271
272
|
"aria-hidden": true,
|
|
273
|
+
"aria-label": inputLabel ?? title,
|
|
272
274
|
className: "sr-only",
|
|
273
275
|
accept,
|
|
274
276
|
multiple,
|
package/dist/file-upload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/file-upload/file-upload.tsx","../src/progress/progress.tsx"],"sourcesContent":["// Client. Three parts that work alone or together:\n// - `Dropzone`: drop files on it or pick them with its button (a real `<input type=\"file\">`, so the keyboard and the\n// phone's camera / files sheet work); it checks the type, the size and the count, and hands over the accepted files\n// and the refused ones with their reason;\n// - `UploadList`: each file with its preview, size, progress, speed, and the actions its state allows (pause, resume,\n// retry, cancel, remove); the progress is a `progressbar`, a failure is announced;\n// - `useUploadQueue`: runs the app's `upload(file, { signal, onProgress, resumed })` with a concurrency, pauses by\n// aborting the signal and resumes by calling it again with `resumed: true` — what a Tus client (tus-js-client's\n// `abort()` / `start()`) or a multipart upload needs, without depending on either. The line (concurrency, retries\n// with backoff, pause per file) is `createQueue` of @krizaka/pacer.\nimport { getNumberFormat } from \"@krizaka/intl\";\nimport { type QueueOptions } from \"@krizaka/pacer\";\nimport { useQueue, useQueueSnapshot } from \"@krizaka/pacer/react\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CloseGlyph, FileGlyph, PauseGlyph, PlayGlyph, RetryGlyph, UploadGlyph } from \"../glyphs\";\nimport { useLatest } from \"../media\";\nimport { Progress } from \"../progress\";\n\nexport const fileUpload = tv({\n slots: {\n zone:\n \"relative flex w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-border-default bg-surface-1 px-6 py-10 text-center \" +\n \"transition-colors data-[dragging]:border-accent data-[dragging]:bg-accent-soft data-[disabled]:opacity-50 has-[:focus-visible]:border-accent\",\n zoneIcon: \"flex h-12 w-12 items-center justify-center rounded-full bg-surface-3 text-fg-secondary\",\n zoneTitle: \"text-sm font-semibold text-fg\",\n zoneHint: \"text-xs text-fg-secondary\",\n browse:\n \"inline-flex h-9 items-center justify-center rounded-lg bg-accent px-4 text-sm font-semibold text-on-accent transition-colors hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none\",\n refusals: \"w-full text-left text-xs font-medium text-fg-danger\",\n list: \"flex w-full flex-col gap-2\",\n item: \"flex items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3 data-[status=error]:border-danger/60\",\n preview: \"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-3 text-fg-secondary\",\n body: \"flex min-w-0 flex-1 flex-col gap-1.5\",\n name: \"truncate text-sm font-semibold text-fg\",\n meta: \"flex flex-wrap gap-x-2 text-xs tabular-nums text-fg-secondary\",\n error: \"text-xs font-medium text-fg-danger\",\n actions: \"flex shrink-0 items-center gap-1\",\n action:\n \"inline-flex h-8 w-8 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\n/** Why a file was refused. */\nexport type FileRejection = { file: File; reason: \"type\" | \"size\" | \"count\" };\n\n/** Whether a file matches an `accept` list (`\"video/*,.mov,image/png\"`). */\nexport function acceptsFile(file: File, accept?: string): boolean {\n if (!accept) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return accept\n .split(\",\")\n .map((rule) => rule.trim().toLowerCase())\n .filter(Boolean)\n .some((rule) => (rule.startsWith(\".\") ? name.endsWith(rule) : rule.endsWith(\"/*\") ? type.startsWith(rule.slice(0, -1)) : type === rule));\n}\n\n/** A size in the locale's words (`\"1.4 GB\"`, `\"820 kB\"`), through `@krizaka/intl`. */\nexport function formatBytes(bytes: number, locale = \"en\"): string {\n const units = [\"byte\", \"kilobyte\", \"megabyte\", \"gigabyte\", \"terabyte\"] as const;\n let value = Math.max(0, bytes);\n let unit = 0;\n while (value >= 1000 && unit < units.length - 1) {\n value /= 1000;\n unit += 1;\n }\n return getNumberFormat(locale, { style: \"unit\", unit: units[unit], unitDisplay: \"short\", maximumFractionDigits: value < 10 && unit > 0 ? 1 : 0 }).format(value);\n}\n\nexport type DropzoneProps = {\n /** The title in the zone (\"Drop your video here\"), passed translated. */\n title: string;\n /** The button that opens the file picker (\"Choose a file\"), passed translated. */\n browseLabel: string;\n /** What is accepted, in words (\"MP4 or MOV, up to 4 GB\"). */\n hint?: string;\n /** The types accepted, as the `accept` attribute (`\"video/*\"`, `\"image/png,.pdf\"`). */\n accept?: string;\n /** The largest file, in bytes. */\n maxSize?: number;\n /** The most files at once (1 unless `multiple`). */\n maxFiles?: number;\n /** Several files at once. */\n multiple?: boolean;\n /** Not available (an upload is running). */\n disabled?: boolean;\n /** On a phone, opens the camera directly (`\"environment\"` the back one, `\"user\"` the front one). */\n capture?: \"user\" | \"environment\";\n /** Called with the files accepted (never empty). */\n onFiles: (files: File[]) => void;\n /** Called with the files refused and why (show `refusalLabel`'s words, or your own). */\n onReject?: (rejections: FileRejection[]) => void;\n /** The words of a refusal, shown in the zone: `(r) => r.file.name + \" is too large\"`. Without it, nothing is shown. */\n refusalLabel?: (rejection: FileRejection) => string;\n /** An icon instead of the upload glyph. */\n icon?: React.ReactNode;\n /** Classes merged on the zone. */\n className?: string;\n};\n\n/** A zone to drop files on, with a button that opens the picker: checks type, size and count. */\nexport function Dropzone({\n title,\n browseLabel,\n hint,\n accept,\n maxSize,\n maxFiles,\n multiple,\n disabled,\n capture,\n onFiles,\n onReject,\n refusalLabel,\n icon,\n className,\n}: DropzoneProps) {\n const s = fileUpload();\n const input = React.useRef<HTMLInputElement>(null);\n const [dragging, setDragging] = React.useState(false);\n const [refused, setRefused] = React.useState<FileRejection[]>([]);\n const depth = React.useRef(0);\n const id = React.useId();\n const limit = maxFiles ?? (multiple ? Infinity : 1);\n\n const take = (list: FileList | File[]) => {\n const files = [...list];\n const accepted: File[] = [];\n const rejections: FileRejection[] = [];\n for (const file of files) {\n if (!acceptsFile(file, accept)) rejections.push({ file, reason: \"type\" });\n else if (maxSize !== undefined && file.size > maxSize) rejections.push({ file, reason: \"size\" });\n else if (accepted.length >= limit) rejections.push({ file, reason: \"count\" });\n else accepted.push(file);\n }\n setRefused(rejections);\n if (accepted.length) onFiles(accepted);\n if (rejections.length) onReject?.(rejections);\n };\n\n return (\n <div\n className={s.zone({ className })}\n data-dragging={dragging ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n onDragEnter={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current += 1;\n setDragging(true);\n }}\n onDragOver={(event) => {\n if (disabled) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = \"copy\";\n }}\n onDragLeave={() => {\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setDragging(false);\n }}\n onDrop={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current = 0;\n setDragging(false);\n take(event.dataTransfer.files);\n }}\n >\n <span className={s.zoneIcon()} aria-hidden>\n {icon ?? <UploadGlyph className=\"h-6 w-6\" />}\n </span>\n <p id={`${id}-title`} className={s.zoneTitle()}>\n {title}\n </p>\n {hint ? (\n <p id={`${id}-hint`} className={s.zoneHint()}>\n {hint}\n </p>\n ) : null}\n <button\n type=\"button\"\n className={s.browse()}\n disabled={disabled}\n aria-describedby={[`${id}-title`, hint ? `${id}-hint` : null].filter(Boolean).join(\" \")}\n onClick={() => input.current?.click()}\n >\n {browseLabel}\n </button>\n <input\n ref={input}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n className=\"sr-only\"\n accept={accept}\n multiple={multiple}\n capture={capture}\n disabled={disabled}\n onChange={(event) => {\n if (event.target.files?.length) take(event.target.files);\n event.target.value = \"\";\n }}\n />\n {refusalLabel && refused.length > 0 ? (\n <ul role=\"alert\" className={s.refusals()}>\n {refused.map((r) => (\n <li key={`${r.file.name}-${r.reason}`}>{refusalLabel(r)}</li>\n ))}\n </ul>\n ) : null}\n </div>\n );\n}\n\nexport type UploadStatus = \"queued\" | \"uploading\" | \"paused\" | \"done\" | \"error\";\n\nexport type UploadItem = {\n /** A stable id. */\n id: string;\n /** The file's name. */\n name: string;\n /** Its size, in bytes. */\n size: number;\n /** Its MIME type (`video/mp4`): picks the preview. */\n type?: string;\n /** Sent so far, between 0 and 1. */\n progress: number;\n /** Where it stands. */\n status: UploadStatus;\n /** Why it failed, passed translated. */\n error?: string;\n /** A preview (an object URL of the file, a thumbnail from the server). */\n previewUrl?: string;\n /** Bytes per second, for the speed and the time left. */\n speed?: number;\n};\n\nexport type UploadListLabels = {\n /** The list's accessible name (\"Uploads\"). */\n list: string;\n pause: (name: string) => string;\n resume: (name: string) => string;\n retry: (name: string) => string;\n cancel: (name: string) => string;\n remove: (name: string) => string;\n /** A state in words: `(status) => \"Paused\"`… */\n status: (status: UploadStatus) => string;\n /** The time left: `(seconds) => \"2 min left\"`. */\n remaining: (seconds: number) => string;\n};\n\nexport const uploadListLabels: UploadListLabels = {\n list: \"Uploads\",\n pause: (name) => `Pause ${name}`,\n resume: (name) => `Resume ${name}`,\n retry: (name) => `Retry ${name}`,\n cancel: (name) => `Cancel ${name}`,\n remove: (name) => `Remove ${name}`,\n status: (status) => ({ queued: \"Waiting\", uploading: \"Uploading\", paused: \"Paused\", done: \"Uploaded\", error: \"Failed\" })[status],\n remaining: (seconds) => (seconds < 60 ? `${Math.ceil(seconds)} s left` : `${Math.ceil(seconds / 60)} min left`),\n};\n\nexport type UploadListProps = {\n /** The uploads, as `useUploadQueue` gives them (or your own state). */\n items: readonly UploadItem[];\n /** Pauses an upload (shown while it uploads, when given). */\n onPause?: (id: string) => void;\n /** Resumes a paused one. */\n onResume?: (id: string) => void;\n /** Tries a failed one again. */\n onRetry?: (id: string) => void;\n /** Stops an upload under way and drops it. */\n onCancel?: (id: string) => void;\n /** Drops a finished or failed one from the list. */\n onRemove?: (id: string) => void;\n /** The locale of sizes and speeds. Default `\"en\"`. */\n locale?: string;\n /** The words, passed translated; English by default. */\n labels?: Partial<UploadListLabels>;\n /** Classes merged on the list. */\n className?: string;\n};\n\nfunction Preview({ item }: { item: UploadItem }) {\n if (item.previewUrl && item.type?.startsWith(\"image/\")) return <img src={item.previewUrl} alt=\"\" className=\"h-full w-full object-cover\" />;\n if (item.previewUrl && item.type?.startsWith(\"video/\")) return <video src={item.previewUrl} muted playsInline preload=\"metadata\" className=\"h-full w-full object-cover\" aria-hidden />;\n return <FileGlyph className=\"h-5 w-5\" />;\n}\n\n/** The files being sent: preview, size, progress, speed and time left, and the actions each state allows. */\nexport function UploadList({ items, onPause, onResume, onRetry, onCancel, onRemove, locale = \"en\", labels: given, className }: UploadListProps) {\n const labels = { ...uploadListLabels, ...given };\n const s = fileUpload();\n const action = (label: string, run: () => void, glyph: React.ReactNode) => (\n <button type=\"button\" className={s.action()} aria-label={label} title={label} onClick={run}>\n {glyph}\n </button>\n );\n return (\n <ul aria-label={labels.list} className={s.list({ className })}>\n {items.map((item) => {\n const left = item.status === \"uploading\" && item.speed ? ((1 - item.progress) * item.size) / item.speed : null;\n return (\n <li key={item.id} className={s.item()} data-status={item.status}>\n <span className={s.preview()}>\n <Preview item={item} />\n </span>\n <div className={s.body()}>\n <p className={s.name()}>{item.name}</p>\n {item.status !== \"done\" && item.status !== \"error\" ? (\n <Progress size=\"sm\" label={item.name} value={item.status === \"queued\" ? null : Math.round(item.progress * 100)} />\n ) : null}\n <p className={s.meta()}>\n <span>{labels.status(item.status)}</span>\n <span>{item.status === \"done\" ? formatBytes(item.size, locale) : `${formatBytes(item.progress * item.size, locale)} / ${formatBytes(item.size, locale)}`}</span>\n {item.status === \"uploading\" && item.speed ? <span>{formatBytes(item.speed, locale)}/s</span> : null}\n {left !== null ? <span>{labels.remaining(left)}</span> : null}\n </p>\n {item.status === \"error\" && item.error ? (\n <p role=\"alert\" className={s.error()}>\n {item.error}\n </p>\n ) : null}\n </div>\n <div className={s.actions()}>\n {item.status === \"uploading\" && onPause && action(labels.pause(item.name), () => onPause(item.id), <PauseGlyph className=\"h-4 w-4\" />)}\n {item.status === \"paused\" && onResume && action(labels.resume(item.name), () => onResume(item.id), <PlayGlyph className=\"h-4 w-4\" />)}\n {item.status === \"error\" && onRetry && action(labels.retry(item.name), () => onRetry(item.id), <RetryGlyph className=\"h-4 w-4\" />)}\n {(item.status === \"done\" || item.status === \"error\") && onRemove\n ? action(labels.remove(item.name), () => onRemove(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : item.status !== \"done\" && onCancel\n ? action(labels.cancel(item.name), () => onCancel(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : null}\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport type UploadContext = {\n /** Aborted on pause and cancel: stop sending (`tusUpload.abort()`, `xhr.abort()`). */\n signal: AbortSignal;\n /** Report the bytes sent so far. */\n onProgress: (sent: number) => void;\n /** `true` when this call resumes a paused or failed upload (a Tus client then continues from its offset). */\n resumed: boolean;\n};\n\nexport type UploadQueueOptions = {\n /** Sends one file; resolves when it is done, rejects on failure (its `message` becomes the item's error). */\n upload: (file: File, context: UploadContext) => Promise<void>;\n /** How many files go at once. Default 2. */\n concurrency?: number;\n /** How many times a failed upload is tried again by itself (with `backoff`) before it shows its error. Default 0. */\n retries?: number;\n /** The wait between retries: exponential from 1 s by default (`@krizaka/pacer`). */\n backoff?: QueueOptions[\"backoff\"];\n /** Whether an error deserves another try (a 4xx never does). Default: every error does, up to `retries`. */\n shouldRetry?: QueueOptions[\"shouldRetry\"];\n /** Makes an object URL for each file to preview (revoked when it leaves). Default `true`. */\n previews?: boolean;\n};\n\n/** What the screen reads of an upload besides its status: the file, how far it got, how fast. */\ntype UploadMeta = { file: File; progress: number; speed?: number; previewUrl?: string; last?: { at: number; sent: number } };\n\n/**\n * The state of an upload queue around the app's `upload` function: `add`, `pause`, `resume`, `retry`, `cancel`, `remove`.\n * The line itself — concurrency, retries with backoff, pause by aborting the signal — is `createQueue` of\n * `@krizaka/pacer`; this hook adds the files, their previews, their progress and their speed.\n */\nexport function useUploadQueue(options: UploadQueueOptions) {\n const { concurrency, retries, backoff, shouldRetry } = options;\n const latest = useLatest(options);\n const queue = useQueue<UploadMeta>({ concurrency: concurrency ?? 2, retries, backoff, shouldRetry });\n const jobs = useQueueSnapshot(queue);\n const metas = useLatest(new Map(jobs.map((job) => [job.id, job.meta])));\n\n const add = React.useCallback(\n (files: readonly File[]) => {\n const { previews = true } = latest.current;\n for (const file of files) {\n const id = `${file.name}-${file.size}-${Math.random().toString(36).slice(2, 8)}`;\n const previewUrl = previews && typeof URL.createObjectURL === \"function\" ? URL.createObjectURL(file) : undefined;\n queue.add(\n async ({ signal, resumed }) => {\n queue.update(id, (m) => ({ ...m, last: { at: Date.now(), sent: m.progress * file.size } }));\n try {\n await latest.current.upload(file, {\n signal,\n resumed,\n onProgress: (sent) => {\n if (signal.aborted) return;\n queue.update(id, (m) => {\n const now = Date.now();\n const last = m.last ?? { at: now, sent };\n const fresh = now - last.at > 400;\n return { ...m, progress: file.size ? Math.min(1, sent / file.size) : 0, speed: fresh ? ((sent - last.sent) / (now - last.at)) * 1000 : m.speed, last: fresh ? { at: now, sent } : last };\n });\n },\n });\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, progress: 1, speed: undefined }));\n } catch (error) {\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, speed: undefined }));\n throw error;\n }\n },\n { id, meta: { file, progress: 0, previewUrl } },\n );\n }\n },\n [latest, queue],\n );\n const forget = React.useCallback(\n (id: string) => {\n const url = metas.current.get(id)?.previewUrl;\n if (url) URL.revokeObjectURL(url);\n queue.cancel(id);\n },\n [metas, queue],\n );\n React.useEffect(\n () => () => {\n for (const meta of metas.current.values()) if (meta.previewUrl) URL.revokeObjectURL(meta.previewUrl);\n },\n [metas],\n );\n const pause = React.useCallback(\n (id: string) => {\n queue.pause(id);\n queue.update(id, (m) => ({ ...m, speed: undefined }));\n },\n [queue],\n );\n\n const items = React.useMemo<UploadItem[]>(\n () =>\n jobs.map(({ id, status, error, meta }) => ({\n id,\n name: meta.file.name,\n size: meta.file.size,\n type: meta.file.type,\n progress: meta.progress,\n status: status === \"running\" ? \"uploading\" : status,\n error: error?.message,\n previewUrl: meta.previewUrl,\n speed: status === \"running\" ? meta.speed : undefined,\n })),\n [jobs],\n );\n return { items, add, pause, resume: queue.resume, retry: queue.retry, cancel: forget, remove: forget };\n}\n","// Server-safe: no hook, no context. role=\"progressbar\" with aria-valuenow / aria-valuemax (none when indeterminate),\n// named by `label`. A bar or a ring; the ring can hold content in its centre (an amount, a percentage).\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const progress = tv({\n slots: {\n root: \"relative\",\n track: \"\",\n indicator: \"\",\n center: \"absolute inset-0 flex flex-col items-center justify-center text-center\",\n buffer: \"absolute inset-y-0 left-0 -z-10 rounded-sm bg-accent/25 transition-[width] duration-500 motion-reduce:transition-none\",\n frame: \"flex w-full flex-col gap-1.5\",\n header: \"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-xs\",\n caption: \"max-w-full shrink-0 grow truncate font-medium text-fg\",\n figure: \"shrink-0 tabular-nums text-fg-secondary\",\n },\n variants: {\n variant: {\n bar: {\n root: \"relative isolate w-full overflow-hidden rounded-sm bg-surface-3\",\n indicator:\n \"kz-progress h-full rounded-sm bg-linear-to-r from-accent to-accent-2 transition-[width] duration-500 motion-reduce:transition-none \" +\n \"data-[state=indeterminate]:w-2/5\",\n },\n ring: {\n root: \"inline-flex shrink-0 items-center justify-center\",\n track: \"stroke-border-default\",\n indicator:\n \"stroke-accent transition-[stroke-dashoffset] duration-1000 motion-reduce:transition-none \" +\n \"data-[state=indeterminate]:origin-center data-[state=indeterminate]:animate-spin motion-reduce:data-[state=indeterminate]:animate-none\",\n },\n },\n size: { sm: {}, md: {}, lg: {} },\n status: {\n active: {},\n // Paused: the fill rests, striped — the task is waiting for someone, not broken.\n paused: { indicator: \"kz-progress-paused opacity-70\" },\n // Failed: the fill turns to the danger colour where it stopped.\n error: { indicator: \"from-danger to-danger stroke-danger\" },\n },\n },\n compoundVariants: [\n { variant: \"bar\", size: \"sm\", class: { root: \"h-1\" } },\n { variant: \"bar\", size: \"md\", class: { root: \"h-2\" } },\n { variant: \"bar\", size: \"lg\", class: { root: \"h-3\" } },\n { variant: \"ring\", size: \"sm\", class: { root: \"h-10 w-10\" } },\n { variant: \"ring\", size: \"md\", class: { root: \"h-20 w-20\" } },\n { variant: \"ring\", size: \"lg\", class: { root: \"h-36 w-36\" } },\n ],\n defaultVariants: { variant: \"bar\", size: \"md\", status: \"active\" },\n});\n\nexport type ProgressVariants = VariantProps<typeof progress>;\n\nexport type ProgressProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n ProgressVariants & {\n /** bar · ring (a ring holds its `children` in the centre). */\n variant?: ProgressVariants[\"variant\"];\n /** sm · md · lg: the bar's thickness, the ring's diameter. */\n size?: ProgressVariants[\"size\"];\n /** How far, between 0 and `max`. `null` or absent: indeterminate (a wait of unknown length). */\n value?: number | null;\n /** The value that means complete. */\n max?: number;\n /** The accessible name — passed translated (\"Upload\", \"Raised towards the goal\"). */\n label: string;\n /** The value in words for assistive technology (\"$420 of $1,000\") — default: the percentage. */\n valueText?: string;\n /** A ring's centre: an amount, a percentage, an icon. */\n children?: React.ReactNode;\n /** How far is already available beyond the value (a video buffered ahead), between 0 and `max` — bar only. */\n buffer?: number;\n /** Splits the bar or the ring into this many segments: the steps of a task, the parts of a goal. */\n segments?: number;\n /**\n * active · paused (the fill rests, striped: waiting for someone) · error (the fill turns to the danger colour where it stopped).\n * @default \"active\"\n */\n status?: ProgressVariants[\"status\"];\n /** Shows the label above the bar, with the percentage (or `valueText`) and `eta` — bar only. */\n showLabel?: boolean;\n /** The time left, in words (“About 2 min left”), shown with `showLabel` and read with the value — passed translated. */\n eta?: string;\n };\n\nconst STROKE = { sm: 12, md: 9, lg: 7 } as const;\n\n/** A progress bar or ring: `value` / `max`, indeterminate without a value. State: `data-state` (loading · complete · indeterminate). */\nexport function Progress({\n variant = \"bar\",\n size = \"md\",\n value,\n max = 100,\n label,\n valueText,\n className,\n children,\n buffer,\n segments,\n status = \"active\",\n showLabel,\n eta,\n ...props\n}: ProgressProps) {\n const s = progress({ variant, size, status });\n const maskId = `kz-seg-${React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const known = typeof value === \"number\" && Number.isFinite(value);\n const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;\n const percent = Math.round(ratio * 100);\n const state = !known ? \"indeterminate\" : ratio >= 1 ? \"complete\" : \"loading\";\n const aria = {\n role: \"progressbar\" as const,\n \"aria-label\": label,\n \"aria-valuemin\": known ? 0 : undefined,\n \"aria-valuemax\": known ? max : undefined,\n \"aria-valuenow\": known ? Math.min(max, Math.max(0, value)) : undefined,\n \"aria-valuetext\": [known ? (valueText ?? `${percent}%`) : valueText, eta].filter(Boolean).join(\", \") || undefined,\n \"data-state\": state,\n \"data-status\": status === \"active\" ? undefined : status,\n \"data-value\": known ? value : undefined,\n \"data-variant\": variant,\n };\n if (variant === \"ring\") {\n const stroke = STROKE[size];\n const r = 50 - stroke / 2;\n return (\n <div {...aria} className={s.root({ className })} {...props}>\n <svg viewBox=\"0 0 100 100\" className=\"h-full w-full -rotate-90\" aria-hidden>\n {segments && segments > 1 && (\n <mask id={maskId}>\n <circle cx=\"50\" cy=\"50\" r={r} fill=\"none\" stroke=\"white\" strokeWidth={stroke + 2} pathLength={100} strokeDasharray={`${100 / segments - 2} 2`} />\n </mask>\n )}\n <g mask={segments && segments > 1 ? `url(#${maskId})` : undefined}>\n <circle cx=\"50\" cy=\"50\" r={r} fill=\"none\" strokeWidth={stroke} className={s.track()} />\n <circle\n cx=\"50\"\n cy=\"50\"\n r={r}\n fill=\"none\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n pathLength={100}\n strokeDasharray={100}\n strokeDashoffset={known ? 100 - percent : 75}\n data-state={state}\n className={s.indicator()}\n />\n </g>\n </svg>\n {children !== undefined && <div className={s.center()}>{children}</div>}\n </div>\n );\n }\n const segmented = segments && segments > 1 ? ({ \"--kz-segments\": segments } as React.CSSProperties) : undefined;\n const bufferRatio = typeof buffer === \"number\" && Number.isFinite(buffer) ? Math.min(1, Math.max(0, buffer / (max || 1))) : null;\n const bar = (\n <div {...aria} className={s.root({ className: [segmented && \"kz-progress-segmented\", className].filter(Boolean).join(\" \") || undefined })} style={segmented} {...props}>\n <div data-state={state} className={s.indicator()} style={known ? { width: `${ratio * 100}%` } : undefined} />\n {bufferRatio !== null && <div aria-hidden className={s.buffer()} style={{ width: `${bufferRatio * 100}%` }} />}\n </div>\n );\n if (!showLabel) return bar;\n const figure = [known ? (valueText ?? `${percent} %`) : valueText, eta].filter(Boolean).join(\" · \");\n return (\n <div className={s.frame()}>\n <div aria-hidden className={s.header()}>\n <span className={s.caption()}>{label}</span>\n {figure && <span className={s.figure()}>{figure}</span>}\n </div>\n {bar}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,SAAS,uBAAuB;AAEhC,SAAS,UAAU,wBAAwB;AAC3C,YAAYA,YAAW;AACvB,SAAS,MAAAC,WAAU;;;ACZnB,YAAY,WAAW;AACvB,SAAS,UAA6B;AAgIxB,cAGJ,YAHI;AA9HP,IAAM,WAAW,GAAG;AAAA,EACzB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,KAAK;AAAA,QACH,MAAM;AAAA,QACN,WACE;AAAA,MAEJ;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,OAAO;AAAA,QACP,WACE;AAAA,MAEJ;AAAA,IACF;AAAA,IACA,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE;AAAA,IAC/B,QAAQ;AAAA,MACN,QAAQ,CAAC;AAAA;AAAA,MAET,QAAQ,EAAE,WAAW,gCAAgC;AAAA;AAAA,MAErD,OAAO,EAAE,WAAW,sCAAsC;AAAA,IAC5D;AAAA,EACF;AAAA,EACA,kB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AW,YAAY,KAAK,QAAQ;AAAA,IAC7C,EAAE;AAAA,IACJ,CAAC,IAAI;AAAA,EACP;AACA,SAAO,EAAE,OAAO,KAAK,OAAO,QAAQ,MAAM,QAAQ,OAAO,MAAM,OAAO,QAAQ,QAAQ,QAAQ,OAAO;AACvG;","names":["React","tv","jsx","jsxs","tv"]}
|
|
1
|
+
{"version":3,"sources":["../src/file-upload/file-upload.tsx","../src/progress/progress.tsx"],"sourcesContent":["// Client. Three parts that work alone or together:\n// - `Dropzone`: drop files on it or pick them with its button (a real `<input type=\"file\">`, so the keyboard and the\n// phone's camera / files sheet work); it checks the type, the size and the count, and hands over the accepted files\n// and the refused ones with their reason;\n// - `UploadList`: each file with its preview, size, progress, speed, and the actions its state allows (pause, resume,\n// retry, cancel, remove); the progress is a `progressbar`, a failure is announced;\n// - `useUploadQueue`: runs the app's `upload(file, { signal, onProgress, resumed })` with a concurrency, pauses by\n// aborting the signal and resumes by calling it again with `resumed: true` — what a Tus client (tus-js-client's\n// `abort()` / `start()`) or a multipart upload needs, without depending on either. The line (concurrency, retries\n// with backoff, pause per file) is `createQueue` of @krizaka/pacer.\nimport { getNumberFormat } from \"@krizaka/intl\";\nimport { type QueueOptions } from \"@krizaka/pacer\";\nimport { useQueue, useQueueSnapshot } from \"@krizaka/pacer/react\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CloseGlyph, FileGlyph, PauseGlyph, PlayGlyph, RetryGlyph, UploadGlyph } from \"../glyphs\";\nimport { useLatest } from \"../media\";\nimport { Progress } from \"../progress\";\n\nexport const fileUpload = tv({\n slots: {\n zone:\n \"relative flex w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-border-default bg-surface-1 px-6 py-10 text-center \" +\n \"transition-colors data-[dragging]:border-accent data-[dragging]:bg-accent-soft data-[disabled]:opacity-50 has-[:focus-visible]:border-accent\",\n zoneIcon: \"flex h-12 w-12 items-center justify-center rounded-full bg-surface-3 text-fg-secondary\",\n zoneTitle: \"text-sm font-semibold text-fg\",\n zoneHint: \"text-xs text-fg-secondary\",\n browse:\n \"inline-flex h-9 items-center justify-center rounded-lg bg-accent px-4 text-sm font-semibold text-on-accent transition-colors hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none\",\n refusals: \"w-full text-left text-xs font-medium text-fg-danger\",\n list: \"flex w-full flex-col gap-2\",\n item: \"flex items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3 data-[status=error]:border-danger/60\",\n preview: \"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-3 text-fg-secondary\",\n body: \"flex min-w-0 flex-1 flex-col gap-1.5\",\n name: \"truncate text-sm font-semibold text-fg\",\n meta: \"flex flex-wrap gap-x-2 text-xs tabular-nums text-fg-secondary\",\n error: \"text-xs font-medium text-fg-danger\",\n actions: \"flex shrink-0 items-center gap-1\",\n action:\n \"inline-flex h-8 w-8 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\n/** Why a file was refused. */\nexport type FileRejection = { file: File; reason: \"type\" | \"size\" | \"count\" };\n\n/** Whether a file matches an `accept` list (`\"video/*,.mov,image/png\"`). */\nexport function acceptsFile(file: File, accept?: string): boolean {\n if (!accept) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return accept\n .split(\",\")\n .map((rule) => rule.trim().toLowerCase())\n .filter(Boolean)\n .some((rule) => (rule.startsWith(\".\") ? name.endsWith(rule) : rule.endsWith(\"/*\") ? type.startsWith(rule.slice(0, -1)) : type === rule));\n}\n\n/** A size in the locale's words (`\"1.4 GB\"`, `\"820 kB\"`), through `@krizaka/intl`. */\nexport function formatBytes(bytes: number, locale = \"en\"): string {\n const units = [\"byte\", \"kilobyte\", \"megabyte\", \"gigabyte\", \"terabyte\"] as const;\n let value = Math.max(0, bytes);\n let unit = 0;\n while (value >= 1000 && unit < units.length - 1) {\n value /= 1000;\n unit += 1;\n }\n return getNumberFormat(locale, { style: \"unit\", unit: units[unit], unitDisplay: \"short\", maximumFractionDigits: value < 10 && unit > 0 ? 1 : 0 }).format(value);\n}\n\nexport type DropzoneProps = {\n /** The title in the zone (\"Drop your video here\"), passed translated. */\n title: string;\n /** The button that opens the file picker (\"Choose a file\"), passed translated. */\n browseLabel: string;\n /** What is accepted, in words (\"MP4 or MOV, up to 4 GB\"). */\n hint?: string;\n /** The types accepted, as the `accept` attribute (`\"video/*\"`, `\"image/png,.pdf\"`). */\n accept?: string;\n /** The largest file, in bytes. */\n maxSize?: number;\n /** The most files at once (1 unless `multiple`). */\n maxFiles?: number;\n /** Several files at once. */\n multiple?: boolean;\n /** Not available (an upload is running). */\n disabled?: boolean;\n /** On a phone, opens the camera directly (`\"environment\"` the back one, `\"user\"` the front one). */\n capture?: \"user\" | \"environment\";\n /** Called with the files accepted (never empty). */\n onFiles: (files: File[]) => void;\n /** Called with the files refused and why (show `refusalLabel`'s words, or your own). */\n onReject?: (rejections: FileRejection[]) => void;\n /** The words of a refusal, shown in the zone: `(r) => r.file.name + \" is too large\"`. Without it, nothing is shown. */\n refusalLabel?: (rejection: FileRejection) => string;\n /** The accessible name of the file input, passed translated. Defaults to `title`. */\n inputLabel?: string;\n /** An icon instead of the upload glyph. */\n icon?: React.ReactNode;\n /** Classes merged on the zone. */\n className?: string;\n};\n\n/** A zone to drop files on, with a button that opens the picker: checks type, size and count. */\nexport function Dropzone({\n title,\n browseLabel,\n hint,\n accept,\n maxSize,\n maxFiles,\n multiple,\n disabled,\n capture,\n onFiles,\n onReject,\n refusalLabel,\n inputLabel,\n icon,\n className,\n}: DropzoneProps) {\n const s = fileUpload();\n const input = React.useRef<HTMLInputElement>(null);\n const [dragging, setDragging] = React.useState(false);\n const [refused, setRefused] = React.useState<FileRejection[]>([]);\n const depth = React.useRef(0);\n const id = React.useId();\n const limit = maxFiles ?? (multiple ? Infinity : 1);\n\n const take = (list: FileList | File[]) => {\n const files = [...list];\n const accepted: File[] = [];\n const rejections: FileRejection[] = [];\n for (const file of files) {\n if (!acceptsFile(file, accept)) rejections.push({ file, reason: \"type\" });\n else if (maxSize !== undefined && file.size > maxSize) rejections.push({ file, reason: \"size\" });\n else if (accepted.length >= limit) rejections.push({ file, reason: \"count\" });\n else accepted.push(file);\n }\n setRefused(rejections);\n if (accepted.length) onFiles(accepted);\n if (rejections.length) onReject?.(rejections);\n };\n\n return (\n <div\n className={s.zone({ className })}\n data-dragging={dragging ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n onDragEnter={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current += 1;\n setDragging(true);\n }}\n onDragOver={(event) => {\n if (disabled) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = \"copy\";\n }}\n onDragLeave={() => {\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setDragging(false);\n }}\n onDrop={(event) => {\n if (disabled) return;\n event.preventDefault();\n depth.current = 0;\n setDragging(false);\n take(event.dataTransfer.files);\n }}\n >\n <span className={s.zoneIcon()} aria-hidden>\n {icon ?? <UploadGlyph className=\"h-6 w-6\" />}\n </span>\n <p id={`${id}-title`} className={s.zoneTitle()}>\n {title}\n </p>\n {hint ? (\n <p id={`${id}-hint`} className={s.zoneHint()}>\n {hint}\n </p>\n ) : null}\n <button\n type=\"button\"\n className={s.browse()}\n disabled={disabled}\n aria-describedby={[`${id}-title`, hint ? `${id}-hint` : null].filter(Boolean).join(\" \")}\n onClick={() => input.current?.click()}\n >\n {browseLabel}\n </button>\n <input\n ref={input}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n aria-label={inputLabel ?? title}\n className=\"sr-only\"\n accept={accept}\n multiple={multiple}\n capture={capture}\n disabled={disabled}\n onChange={(event) => {\n if (event.target.files?.length) take(event.target.files);\n event.target.value = \"\";\n }}\n />\n {refusalLabel && refused.length > 0 ? (\n <ul role=\"alert\" className={s.refusals()}>\n {refused.map((r) => (\n <li key={`${r.file.name}-${r.reason}`}>{refusalLabel(r)}</li>\n ))}\n </ul>\n ) : null}\n </div>\n );\n}\n\nexport type UploadStatus = \"queued\" | \"uploading\" | \"paused\" | \"done\" | \"error\";\n\nexport type UploadItem = {\n /** A stable id. */\n id: string;\n /** The file's name. */\n name: string;\n /** Its size, in bytes. */\n size: number;\n /** Its MIME type (`video/mp4`): picks the preview. */\n type?: string;\n /** Sent so far, between 0 and 1. */\n progress: number;\n /** Where it stands. */\n status: UploadStatus;\n /** Why it failed, passed translated. */\n error?: string;\n /** A preview (an object URL of the file, a thumbnail from the server). */\n previewUrl?: string;\n /** Bytes per second, for the speed and the time left. */\n speed?: number;\n};\n\nexport type UploadListLabels = {\n /** The list's accessible name (\"Uploads\"). */\n list: string;\n pause: (name: string) => string;\n resume: (name: string) => string;\n retry: (name: string) => string;\n cancel: (name: string) => string;\n remove: (name: string) => string;\n /** A state in words: `(status) => \"Paused\"`… */\n status: (status: UploadStatus) => string;\n /** The time left: `(seconds) => \"2 min left\"`. */\n remaining: (seconds: number) => string;\n};\n\nexport const uploadListLabels: UploadListLabels = {\n list: \"Uploads\",\n pause: (name) => `Pause ${name}`,\n resume: (name) => `Resume ${name}`,\n retry: (name) => `Retry ${name}`,\n cancel: (name) => `Cancel ${name}`,\n remove: (name) => `Remove ${name}`,\n status: (status) => ({ queued: \"Waiting\", uploading: \"Uploading\", paused: \"Paused\", done: \"Uploaded\", error: \"Failed\" })[status],\n remaining: (seconds) => (seconds < 60 ? `${Math.ceil(seconds)} s left` : `${Math.ceil(seconds / 60)} min left`),\n};\n\nexport type UploadListProps = {\n /** The uploads, as `useUploadQueue` gives them (or your own state). */\n items: readonly UploadItem[];\n /** Pauses an upload (shown while it uploads, when given). */\n onPause?: (id: string) => void;\n /** Resumes a paused one. */\n onResume?: (id: string) => void;\n /** Tries a failed one again. */\n onRetry?: (id: string) => void;\n /** Stops an upload under way and drops it. */\n onCancel?: (id: string) => void;\n /** Drops a finished or failed one from the list. */\n onRemove?: (id: string) => void;\n /** The locale of sizes and speeds. Default `\"en\"`. */\n locale?: string;\n /** The words, passed translated; English by default. */\n labels?: Partial<UploadListLabels>;\n /** Classes merged on the list. */\n className?: string;\n};\n\nfunction Preview({ item }: { item: UploadItem }) {\n if (item.previewUrl && item.type?.startsWith(\"image/\")) return <img src={item.previewUrl} alt=\"\" className=\"h-full w-full object-cover\" />;\n if (item.previewUrl && item.type?.startsWith(\"video/\")) return <video src={item.previewUrl} muted playsInline preload=\"metadata\" className=\"h-full w-full object-cover\" aria-hidden />;\n return <FileGlyph className=\"h-5 w-5\" />;\n}\n\n/** The files being sent: preview, size, progress, speed and time left, and the actions each state allows. */\nexport function UploadList({ items, onPause, onResume, onRetry, onCancel, onRemove, locale = \"en\", labels: given, className }: UploadListProps) {\n const labels = { ...uploadListLabels, ...given };\n const s = fileUpload();\n const action = (label: string, run: () => void, glyph: React.ReactNode) => (\n <button type=\"button\" className={s.action()} aria-label={label} title={label} onClick={run}>\n {glyph}\n </button>\n );\n return (\n <ul aria-label={labels.list} className={s.list({ className })}>\n {items.map((item) => {\n const left = item.status === \"uploading\" && item.speed ? ((1 - item.progress) * item.size) / item.speed : null;\n return (\n <li key={item.id} className={s.item()} data-status={item.status}>\n <span className={s.preview()}>\n <Preview item={item} />\n </span>\n <div className={s.body()}>\n <p className={s.name()}>{item.name}</p>\n {item.status !== \"done\" && item.status !== \"error\" ? (\n <Progress size=\"sm\" label={item.name} value={item.status === \"queued\" ? null : Math.round(item.progress * 100)} />\n ) : null}\n <p className={s.meta()}>\n <span>{labels.status(item.status)}</span>\n <span>{item.status === \"done\" ? formatBytes(item.size, locale) : `${formatBytes(item.progress * item.size, locale)} / ${formatBytes(item.size, locale)}`}</span>\n {item.status === \"uploading\" && item.speed ? <span>{formatBytes(item.speed, locale)}/s</span> : null}\n {left !== null ? <span>{labels.remaining(left)}</span> : null}\n </p>\n {item.status === \"error\" && item.error ? (\n <p role=\"alert\" className={s.error()}>\n {item.error}\n </p>\n ) : null}\n </div>\n <div className={s.actions()}>\n {item.status === \"uploading\" && onPause && action(labels.pause(item.name), () => onPause(item.id), <PauseGlyph className=\"h-4 w-4\" />)}\n {item.status === \"paused\" && onResume && action(labels.resume(item.name), () => onResume(item.id), <PlayGlyph className=\"h-4 w-4\" />)}\n {item.status === \"error\" && onRetry && action(labels.retry(item.name), () => onRetry(item.id), <RetryGlyph className=\"h-4 w-4\" />)}\n {(item.status === \"done\" || item.status === \"error\") && onRemove\n ? action(labels.remove(item.name), () => onRemove(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : item.status !== \"done\" && onCancel\n ? action(labels.cancel(item.name), () => onCancel(item.id), <CloseGlyph className=\"h-4 w-4\" />)\n : null}\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport type UploadContext = {\n /** Aborted on pause and cancel: stop sending (`tusUpload.abort()`, `xhr.abort()`). */\n signal: AbortSignal;\n /** Report the bytes sent so far. */\n onProgress: (sent: number) => void;\n /** `true` when this call resumes a paused or failed upload (a Tus client then continues from its offset). */\n resumed: boolean;\n};\n\nexport type UploadQueueOptions = {\n /** Sends one file; resolves when it is done, rejects on failure (its `message` becomes the item's error). */\n upload: (file: File, context: UploadContext) => Promise<void>;\n /** How many files go at once. Default 2. */\n concurrency?: number;\n /** How many times a failed upload is tried again by itself (with `backoff`) before it shows its error. Default 0. */\n retries?: number;\n /** The wait between retries: exponential from 1 s by default (`@krizaka/pacer`). */\n backoff?: QueueOptions[\"backoff\"];\n /** Whether an error deserves another try (a 4xx never does). Default: every error does, up to `retries`. */\n shouldRetry?: QueueOptions[\"shouldRetry\"];\n /** Makes an object URL for each file to preview (revoked when it leaves). Default `true`. */\n previews?: boolean;\n};\n\n/** What the screen reads of an upload besides its status: the file, how far it got, how fast. */\ntype UploadMeta = { file: File; progress: number; speed?: number; previewUrl?: string; last?: { at: number; sent: number } };\n\n/**\n * The state of an upload queue around the app's `upload` function: `add`, `pause`, `resume`, `retry`, `cancel`, `remove`.\n * The line itself — concurrency, retries with backoff, pause by aborting the signal — is `createQueue` of\n * `@krizaka/pacer`; this hook adds the files, their previews, their progress and their speed.\n */\nexport function useUploadQueue(options: UploadQueueOptions) {\n const { concurrency, retries, backoff, shouldRetry } = options;\n const latest = useLatest(options);\n const queue = useQueue<UploadMeta>({ concurrency: concurrency ?? 2, retries, backoff, shouldRetry });\n const jobs = useQueueSnapshot(queue);\n const metas = useLatest(new Map(jobs.map((job) => [job.id, job.meta])));\n\n const add = React.useCallback(\n (files: readonly File[]) => {\n const { previews = true } = latest.current;\n for (const file of files) {\n const id = `${file.name}-${file.size}-${Math.random().toString(36).slice(2, 8)}`;\n const previewUrl = previews && typeof URL.createObjectURL === \"function\" ? URL.createObjectURL(file) : undefined;\n queue.add(\n async ({ signal, resumed }) => {\n queue.update(id, (m) => ({ ...m, last: { at: Date.now(), sent: m.progress * file.size } }));\n try {\n await latest.current.upload(file, {\n signal,\n resumed,\n onProgress: (sent) => {\n if (signal.aborted) return;\n queue.update(id, (m) => {\n const now = Date.now();\n const last = m.last ?? { at: now, sent };\n const fresh = now - last.at > 400;\n return { ...m, progress: file.size ? Math.min(1, sent / file.size) : 0, speed: fresh ? ((sent - last.sent) / (now - last.at)) * 1000 : m.speed, last: fresh ? { at: now, sent } : last };\n });\n },\n });\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, progress: 1, speed: undefined }));\n } catch (error) {\n if (!signal.aborted) queue.update(id, (m) => ({ ...m, speed: undefined }));\n throw error;\n }\n },\n { id, meta: { file, progress: 0, previewUrl } },\n );\n }\n },\n [latest, queue],\n );\n const forget = React.useCallback(\n (id: string) => {\n const url = metas.current.get(id)?.previewUrl;\n if (url) URL.revokeObjectURL(url);\n queue.cancel(id);\n },\n [metas, queue],\n );\n React.useEffect(\n () => () => {\n for (const meta of metas.current.values()) if (meta.previewUrl) URL.revokeObjectURL(meta.previewUrl);\n },\n [metas],\n );\n const pause = React.useCallback(\n (id: string) => {\n queue.pause(id);\n queue.update(id, (m) => ({ ...m, speed: undefined }));\n },\n [queue],\n );\n\n const items = React.useMemo<UploadItem[]>(\n () =>\n jobs.map(({ id, status, error, meta }) => ({\n id,\n name: meta.file.name,\n size: meta.file.size,\n type: meta.file.type,\n progress: meta.progress,\n status: status === \"running\" ? \"uploading\" : status,\n error: error?.message,\n previewUrl: meta.previewUrl,\n speed: status === \"running\" ? meta.speed : undefined,\n })),\n [jobs],\n );\n return { items, add, pause, resume: queue.resume, retry: queue.retry, cancel: forget, remove: forget };\n}\n","// Server-safe: no hook, no context. role=\"progressbar\" with aria-valuenow / aria-valuemax (none when indeterminate),\n// named by `label`. A bar or a ring; the ring can hold content in its centre (an amount, a percentage).\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const progress = tv({\n slots: {\n root: \"relative\",\n track: \"\",\n indicator: \"\",\n center: \"absolute inset-0 flex flex-col items-center justify-center text-center\",\n buffer: \"absolute inset-y-0 left-0 -z-10 rounded-sm bg-accent/25 transition-[width] duration-500 motion-reduce:transition-none\",\n frame: \"flex w-full flex-col gap-1.5\",\n header: \"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-xs\",\n caption: \"max-w-full shrink-0 grow truncate font-medium text-fg\",\n figure: \"shrink-0 tabular-nums text-fg-secondary\",\n },\n variants: {\n variant: {\n bar: {\n root: \"relative isolate w-full overflow-hidden rounded-sm bg-surface-3\",\n indicator:\n \"kz-progress h-full rounded-sm bg-linear-to-r from-accent to-accent-2 transition-[width] duration-500 motion-reduce:transition-none \" +\n \"data-[state=indeterminate]:w-2/5\",\n },\n ring: {\n root: \"inline-flex shrink-0 items-center justify-center\",\n track: \"stroke-border-default\",\n indicator:\n \"stroke-accent transition-[stroke-dashoffset] duration-1000 motion-reduce:transition-none \" +\n \"data-[state=indeterminate]:origin-center data-[state=indeterminate]:animate-spin motion-reduce:data-[state=indeterminate]:animate-none\",\n },\n },\n size: { sm: {}, md: {}, lg: {} },\n status: {\n active: {},\n // Paused: the fill rests, striped — the task is waiting for someone, not broken.\n paused: { indicator: \"kz-progress-paused opacity-70\" },\n // Failed: the fill turns to the danger colour where it stopped.\n error: { indicator: \"from-danger to-danger stroke-danger\" },\n },\n },\n compoundVariants: [\n { variant: \"bar\", size: \"sm\", class: { root: \"h-1\" } },\n { variant: \"bar\", size: \"md\", class: { root: \"h-2\" } },\n { variant: \"bar\", size: \"lg\", class: { root: \"h-3\" } },\n { variant: \"ring\", size: \"sm\", class: { root: \"h-10 w-10\" } },\n { variant: \"ring\", size: \"md\", class: { root: \"h-20 w-20\" } },\n { variant: \"ring\", size: \"lg\", class: { root: \"h-36 w-36\" } },\n ],\n defaultVariants: { variant: \"bar\", size: \"md\", status: \"active\" },\n});\n\nexport type ProgressVariants = VariantProps<typeof progress>;\n\nexport type ProgressProps = Omit<React.ComponentProps<\"div\">, \"children\"> &\n ProgressVariants & {\n /** bar · ring (a ring holds its `children` in the centre). */\n variant?: ProgressVariants[\"variant\"];\n /** sm · md · lg: the bar's thickness, the ring's diameter. */\n size?: ProgressVariants[\"size\"];\n /** How far, between 0 and `max`. `null` or absent: indeterminate (a wait of unknown length). */\n value?: number | null;\n /** The value that means complete. */\n max?: number;\n /** The accessible name — passed translated (\"Upload\", \"Raised towards the goal\"). */\n label: string;\n /** The value in words for assistive technology (\"$420 of $1,000\") — default: the percentage. */\n valueText?: string;\n /** A ring's centre: an amount, a percentage, an icon. */\n children?: React.ReactNode;\n /** How far is already available beyond the value (a video buffered ahead), between 0 and `max` — bar only. */\n buffer?: number;\n /** Splits the bar or the ring into this many segments: the steps of a task, the parts of a goal. */\n segments?: number;\n /**\n * active · paused (the fill rests, striped: waiting for someone) · error (the fill turns to the danger colour where it stopped).\n * @default \"active\"\n */\n status?: ProgressVariants[\"status\"];\n /** Shows the label above the bar, with the percentage (or `valueText`) and `eta` — bar only. */\n showLabel?: boolean;\n /** The time left, in words (“About 2 min left”), shown with `showLabel` and read with the value — passed translated. */\n eta?: string;\n };\n\nconst STROKE = { sm: 12, md: 9, lg: 7 } as const;\n\n/** A progress bar or ring: `value` / `max`, indeterminate without a value. State: `data-state` (loading · complete · indeterminate). */\nexport function Progress({\n variant = \"bar\",\n size = \"md\",\n value,\n max = 100,\n label,\n valueText,\n className,\n children,\n buffer,\n segments,\n status = \"active\",\n showLabel,\n eta,\n ...props\n}: ProgressProps) {\n const s = progress({ variant, size, status });\n const maskId = `kz-seg-${React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const known = typeof value === \"number\" && Number.isFinite(value);\n const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;\n const percent = Math.round(ratio * 100);\n const state = !known ? \"indeterminate\" : ratio >= 1 ? \"complete\" : \"loading\";\n const aria = {\n role: \"progressbar\" as const,\n \"aria-label\": label,\n \"aria-valuemin\": known ? 0 : undefined,\n \"aria-valuemax\": known ? max : undefined,\n \"aria-valuenow\": known ? Math.min(max, Math.max(0, value)) : undefined,\n \"aria-valuetext\": [known ? (valueText ?? `${percent}%`) : valueText, eta].filter(Boolean).join(\", \") || undefined,\n \"data-state\": state,\n \"data-status\": status === \"active\" ? undefined : status,\n \"data-value\": known ? value : undefined,\n \"data-variant\": variant,\n };\n if (variant === \"ring\") {\n const stroke = STROKE[size];\n const r = 50 - stroke / 2;\n return (\n <div {...aria} className={s.root({ className })} {...props}>\n <svg viewBox=\"0 0 100 100\" className=\"h-full w-full -rotate-90\" aria-hidden>\n {segments && segments > 1 && (\n <mask id={maskId}>\n <circle cx=\"50\" cy=\"50\" r={r} fill=\"none\" stroke=\"white\" strokeWidth={stroke + 2} pathLength={100} strokeDasharray={`${100 / segments - 2} 2`} />\n </mask>\n )}\n <g mask={segments && segments > 1 ? `url(#${maskId})` : undefined}>\n <circle cx=\"50\" cy=\"50\" r={r} fill=\"none\" strokeWidth={stroke} className={s.track()} />\n <circle\n cx=\"50\"\n cy=\"50\"\n r={r}\n fill=\"none\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n pathLength={100}\n strokeDasharray={100}\n strokeDashoffset={known ? 100 - percent : 75}\n data-state={state}\n className={s.indicator()}\n />\n </g>\n </svg>\n {children !== undefined && <div className={s.center()}>{children}</div>}\n </div>\n );\n }\n const segmented = segments && segments > 1 ? ({ \"--kz-segments\": segments } as React.CSSProperties) : undefined;\n const bufferRatio = typeof buffer === \"number\" && Number.isFinite(buffer) ? Math.min(1, Math.max(0, buffer / (max || 1))) : null;\n const bar = (\n <div {...aria} className={s.root({ className: [segmented && \"kz-progress-segmented\", className].filter(Boolean).join(\" \") || undefined })} style={segmented} {...props}>\n <div data-state={state} className={s.indicator()} style={known ? { width: `${ratio * 100}%` } : undefined} />\n {bufferRatio !== null && <div aria-hidden className={s.buffer()} style={{ width: `${bufferRatio * 100}%` }} />}\n </div>\n );\n if (!showLabel) return bar;\n const figure = [known ? (valueText ?? `${percent} %`) : valueText, eta].filter(Boolean).join(\" · \");\n return (\n <div className={s.frame()}>\n <div aria-hidden className={s.header()}>\n <span className={s.caption()}>{label}</span>\n {figure && <span className={s.figure()}>{figure}</span>}\n </div>\n {bar}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,SAAS,uBAAuB;AAEhC,SAAS,UAAU,wBAAwB;AAC3C,YAAYA,YAAW;AACvB,SAAS,MAAAC,WAAU;;;ACZnB,YAAY,WAAW;AACvB,SAAS,UAA6B;AAgIxB,cAGJ,YAHI;AA9HP,IAAM,WAAW,GAAG;AAAA,EACzB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,KAAK;AAAA,QACH,MAAM;AAAA,QACN,WACE;AAAA,MAEJ;AAAA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AAE;AAAA,IACtD;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,QAAc;AAAA,IAClB,MACE,KAAK,IAAI,CAAC,EAAE,IAAI,QAAQ,OAAO,KAAK,OAAO;AAAA,MACzC;AAAA,MACA,MAAM,KAAK,KAAK;AAAA,MAChB,MAAM,KAAK,KAAK;AAAA,MAChB,MAAM,KAAK,KAAK;AAAA,MAChB,UAAU,KAAK;AAAA,MACf,QAAQ,WAAW,YAAY,cAAc;AAAA,MAC7C,OAAO,OAAO;AAAA,MACd,YAAY,KAAK;AAAA,MACjB,OAAO,WAAW,YAAY,KAAK,QAAQ;AAAA,IAC7C,EAAE;AAAA,IACJ,CAAC,IAAI;AAAA,EACP;AACA,SAAO,EAAE,OAAO,KAAK,OAAO,QAAQ,MAAM,QAAQ,OAAO,MAAM,OAAO,QAAQ,QAAQ,QAAQ,OAAO;AACvG;","names":["React","tv","jsx","jsxs","tv"]}
|
package/dist/filter-bar.d.ts
CHANGED
|
@@ -75,11 +75,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
|
|
|
75
75
|
[key: string]: {
|
|
76
76
|
[key: string]: tailwind_variants.ClassValue | {
|
|
77
77
|
root?: tailwind_variants.ClassValue;
|
|
78
|
-
count?: tailwind_variants.ClassValue;
|
|
79
78
|
controls?: tailwind_variants.ClassValue;
|
|
80
79
|
active?: tailwind_variants.ClassValue;
|
|
81
80
|
clear?: tailwind_variants.ClassValue;
|
|
82
81
|
results?: tailwind_variants.ClassValue;
|
|
82
|
+
count?: tailwind_variants.ClassValue;
|
|
83
83
|
optionCount?: tailwind_variants.ClassValue;
|
|
84
84
|
trigger?: tailwind_variants.ClassValue;
|
|
85
85
|
};
|
|
@@ -88,11 +88,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
|
|
|
88
88
|
[x: string]: {
|
|
89
89
|
[x: string]: tailwind_variants.ClassValue | {
|
|
90
90
|
root?: tailwind_variants.ClassValue;
|
|
91
|
-
count?: tailwind_variants.ClassValue;
|
|
92
91
|
controls?: tailwind_variants.ClassValue;
|
|
93
92
|
active?: tailwind_variants.ClassValue;
|
|
94
93
|
clear?: tailwind_variants.ClassValue;
|
|
95
94
|
results?: tailwind_variants.ClassValue;
|
|
95
|
+
count?: tailwind_variants.ClassValue;
|
|
96
96
|
optionCount?: tailwind_variants.ClassValue;
|
|
97
97
|
trigger?: tailwind_variants.ClassValue;
|
|
98
98
|
};
|
|
@@ -110,11 +110,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
|
|
|
110
110
|
[key: string]: {
|
|
111
111
|
[key: string]: tailwind_variants.ClassValue | {
|
|
112
112
|
root?: tailwind_variants.ClassValue;
|
|
113
|
-
count?: tailwind_variants.ClassValue;
|
|
114
113
|
controls?: tailwind_variants.ClassValue;
|
|
115
114
|
active?: tailwind_variants.ClassValue;
|
|
116
115
|
clear?: tailwind_variants.ClassValue;
|
|
117
116
|
results?: tailwind_variants.ClassValue;
|
|
117
|
+
count?: tailwind_variants.ClassValue;
|
|
118
118
|
optionCount?: tailwind_variants.ClassValue;
|
|
119
119
|
trigger?: tailwind_variants.ClassValue;
|
|
120
120
|
};
|
package/dist/filter-bar.js
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
readFilterParams,
|
|
8
8
|
savedViewsLabels,
|
|
9
9
|
writeFilterParams
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PFPOBIHL.js";
|
|
11
11
|
import "./chunk-UYGUSYIC.js";
|
|
12
12
|
import "./chunk-D3T54RSL.js";
|
|
13
13
|
import "./chunk-J3NC6ER4.js";
|
|
14
14
|
import "./chunk-NSLXEDIS.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-PGBF3UBX.js";
|
|
16
16
|
export {
|
|
17
17
|
FilterBar,
|
|
18
18
|
FilterMenu,
|
package/dist/footnote.js
CHANGED
|
@@ -15,7 +15,7 @@ function FootnoteRef({ n, prefix = "fn", className, ...props }) {
|
|
|
15
15
|
return /* @__PURE__ */ jsx("sup", { id: `${prefix}-ref-${n}`, className: cn("kz-fnref", className), ...props, children: /* @__PURE__ */ jsx("a", { href: `#${prefix}-${n}`, "aria-label": `Note ${n}`, children: n }) });
|
|
16
16
|
}
|
|
17
17
|
function Footnotes({ notes, prefix = "fn", label = "Notes", backLabel = "Back to the text", className, ...props }) {
|
|
18
|
-
return /* @__PURE__ */ jsx("
|
|
18
|
+
return /* @__PURE__ */ jsx("section", { "aria-label": label, className: cn("kz-footnotes", className), ...props, children: /* @__PURE__ */ jsx("ol", { children: notes.map((note, i) => /* @__PURE__ */ jsxs("li", { id: `${prefix}-${i + 1}`, children: [
|
|
19
19
|
note,
|
|
20
20
|
" ",
|
|
21
21
|
/* @__PURE__ */ jsx("a", { href: `#${prefix}-ref-${i + 1}`, className: "kz-fn-back", "aria-label": `${backLabel} (${i + 1})`, children: "\u21A9" })
|
package/dist/footnote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/footnote/footnote.tsx"],"sourcesContent":["// Server-safe. The footnote and the caption of the Cahier (ADR-004, blocks.css): what a page says in small print. A\n// `Caption` names a figure (`fig. 2 — The owl reads every line`); a `FootnoteRef` is the superscript number in the text,\n// linked to its note; `Footnotes` lists the notes at the foot, each with its way back to the text.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type CaptionProps = React.HTMLAttributes<HTMLElement> & {\n /** The figure's number, typed before the text: `fig. 2`. */\n figure?: React.ReactNode;\n /** `figcaption` inside a `<figure>`, `p` elsewhere. @default \"figcaption\" */\n as?: \"figcaption\" | \"p\";\n};\n\n/** A caption in the typewriter face: the figure's number, a dash, what it shows. */\nexport function Caption({ figure, as: Tag = \"figcaption\", className, children, ...props }: CaptionProps) {\n return (\n <Tag className={cn(\"kz-caption\", className)} {...props}>\n {figure && <b className=\"kz-caption-figure\">{figure}</b>}\n {figure && \" — \"}\n {children}\n </Tag>\n );\n}\n\nexport type FootnoteRefProps = Omit<React.HTMLAttributes<HTMLElement>, \"id\"> & {\n /** The note's number. */\n n: number;\n /** The prefix of the ids, when a page has several sets of notes. @default \"fn\" */\n prefix?: string;\n};\n\n/** The superscript number in the text, linked to its note (and the note's link back lands here). */\nexport function FootnoteRef({ n, prefix = \"fn\", className, ...props }: FootnoteRefProps) {\n return (\n <sup id={`${prefix}-ref-${n}`} className={cn(\"kz-fnref\", className)} {...props}>\n <a href={`#${prefix}-${n}`} aria-label={`Note ${n}`}>\n {n}\n </a>\n </sup>\n );\n}\n\nexport type FootnotesProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The notes, in order: the first is note 1. */\n notes: readonly React.ReactNode[];\n /** The prefix of the ids (the same as the refs'). @default \"fn\" */\n prefix?: string;\n /** The heading of the notes, for assistive technology (visually a rule). @default \"Notes\" */\n label?: string;\n /** The label of the way back to the text. @default \"Back to the text\" */\n backLabel?: string;\n};\n\n/** The notes at the foot of a page: a short rule, numbered notes in small print, each with its way back to the text. */\nexport function Footnotes({ notes, prefix = \"fn\", label = \"Notes\", backLabel = \"Back to the text\", className, ...props }: FootnotesProps) {\n return (\n <
|
|
1
|
+
{"version":3,"sources":["../src/footnote/footnote.tsx"],"sourcesContent":["// Server-safe. The footnote and the caption of the Cahier (ADR-004, blocks.css): what a page says in small print. A\n// `Caption` names a figure (`fig. 2 — The owl reads every line`); a `FootnoteRef` is the superscript number in the text,\n// linked to its note; `Footnotes` lists the notes at the foot, each with its way back to the text.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type CaptionProps = React.HTMLAttributes<HTMLElement> & {\n /** The figure's number, typed before the text: `fig. 2`. */\n figure?: React.ReactNode;\n /** `figcaption` inside a `<figure>`, `p` elsewhere. @default \"figcaption\" */\n as?: \"figcaption\" | \"p\";\n};\n\n/** A caption in the typewriter face: the figure's number, a dash, what it shows. */\nexport function Caption({ figure, as: Tag = \"figcaption\", className, children, ...props }: CaptionProps) {\n return (\n <Tag className={cn(\"kz-caption\", className)} {...props}>\n {figure && <b className=\"kz-caption-figure\">{figure}</b>}\n {figure && \" — \"}\n {children}\n </Tag>\n );\n}\n\nexport type FootnoteRefProps = Omit<React.HTMLAttributes<HTMLElement>, \"id\"> & {\n /** The note's number. */\n n: number;\n /** The prefix of the ids, when a page has several sets of notes. @default \"fn\" */\n prefix?: string;\n};\n\n/** The superscript number in the text, linked to its note (and the note's link back lands here). */\nexport function FootnoteRef({ n, prefix = \"fn\", className, ...props }: FootnoteRefProps) {\n return (\n <sup id={`${prefix}-ref-${n}`} className={cn(\"kz-fnref\", className)} {...props}>\n <a href={`#${prefix}-${n}`} aria-label={`Note ${n}`}>\n {n}\n </a>\n </sup>\n );\n}\n\nexport type FootnotesProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The notes, in order: the first is note 1. */\n notes: readonly React.ReactNode[];\n /** The prefix of the ids (the same as the refs'). @default \"fn\" */\n prefix?: string;\n /** The heading of the notes, for assistive technology (visually a rule). @default \"Notes\" */\n label?: string;\n /** The label of the way back to the text. @default \"Back to the text\" */\n backLabel?: string;\n};\n\n/** The notes at the foot of a page: a short rule, numbered notes in small print, each with its way back to the text. */\nexport function Footnotes({ notes, prefix = \"fn\", label = \"Notes\", backLabel = \"Back to the text\", className, ...props }: FootnotesProps) {\n return (\n <section aria-label={label} className={cn(\"kz-footnotes\", className)} {...props}>\n <ol>\n {notes.map((note, i) => (\n <li key={i} id={`${prefix}-${i + 1}`}>\n {note}{\" \"}\n <a href={`#${prefix}-ref-${i + 1}`} className=\"kz-fn-back\" aria-label={`${backLabel} (${i + 1})`}>\n ↩\n </a>\n </li>\n ))}\n </ol>\n </section>\n );\n}\n"],"mappings":";;;;;AAiBI,SACa,KADb;AAFG,SAAS,QAAQ,EAAE,QAAQ,IAAI,MAAM,cAAc,WAAW,UAAU,GAAG,MAAM,GAAiB;AACvG,SACE,qBAAC,OAAI,WAAW,GAAG,cAAc,SAAS,GAAI,GAAG,OAC9C;AAAA,cAAU,oBAAC,OAAE,WAAU,qBAAqB,kBAAO;AAAA,IACnD,UAAU;AAAA,IACV;AAAA,KACH;AAEJ;AAUO,SAAS,YAAY,EAAE,GAAG,SAAS,MAAM,WAAW,GAAG,MAAM,GAAqB;AACvF,SACE,oBAAC,SAAI,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OACvE,8BAAC,OAAE,MAAM,IAAI,MAAM,IAAI,CAAC,IAAI,cAAY,QAAQ,CAAC,IAC9C,aACH,GACF;AAEJ;AAcO,SAAS,UAAU,EAAE,OAAO,SAAS,MAAM,QAAQ,SAAS,YAAY,oBAAoB,WAAW,GAAG,MAAM,GAAmB;AACxI,SACE,oBAAC,aAAQ,cAAY,OAAO,WAAW,GAAG,gBAAgB,SAAS,GAAI,GAAG,OACxE,8BAAC,QACE,gBAAM,IAAI,CAAC,MAAM,MAChB,qBAAC,QAAW,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,IAC/B;AAAA;AAAA,IAAM;AAAA,IACP,oBAAC,OAAE,MAAM,IAAI,MAAM,QAAQ,IAAI,CAAC,IAAI,WAAU,cAAa,cAAY,GAAG,SAAS,KAAK,IAAI,CAAC,KAAK,oBAElG;AAAA,OAJO,CAKT,CACD,GACH,GACF;AAEJ;","names":[]}
|
package/dist/genui.js
CHANGED
|
@@ -7,22 +7,22 @@ import {
|
|
|
7
7
|
} from "./chunk-YKOLME7R.js";
|
|
8
8
|
import {
|
|
9
9
|
DataTable
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-E4X3V7QX.js";
|
|
11
11
|
import "./chunk-3X3OF4TI.js";
|
|
12
12
|
import "./chunk-JXLDUDTD.js";
|
|
13
13
|
import "./chunk-M3GEYLMR.js";
|
|
14
14
|
import "./chunk-KVDB4GXV.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-PFPOBIHL.js";
|
|
16
16
|
import "./chunk-UYGUSYIC.js";
|
|
17
17
|
import "./chunk-D3T54RSL.js";
|
|
18
18
|
import "./chunk-J3NC6ER4.js";
|
|
19
19
|
import {
|
|
20
20
|
cn
|
|
21
21
|
} from "./chunk-NSLXEDIS.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-DSDFXPL6.js";
|
|
23
23
|
import "./chunk-ZIXB33X7.js";
|
|
24
24
|
import "./chunk-FZBWEDQI.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-PGBF3UBX.js";
|
|
26
26
|
|
|
27
27
|
// src/genui/catalog.tsx
|
|
28
28
|
import { formatCompact, formatMoney, formatNumber, formatPercent } from "@krizaka/intl";
|
package/dist/link-card.js
CHANGED
package/dist/list.js
CHANGED
package/dist/media-capture.js
CHANGED
package/dist/native.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { StyleProp, ViewStyle, ViewProps, PressableProps, TextProps, ImageProps, TextInput, TextInputProps, Animated, NativeSyntheticEvent, NativeScrollEvent, TextStyle, RefreshControlProps, DimensionValue, ActivityIndicatorProps } from 'react-native';
|
|
4
|
-
import { Label, TagPreset, StatusTone,
|
|
4
|
+
import { Marker as Marker$1, OrganizeCode, Label, TagPreset, StatusTone, StatusSet } from '@krizaka/organize/contract';
|
|
5
5
|
|
|
6
6
|
/** A brand of the default avatars. `orochia`, `yasakia`, `yororis` and `kachizaka` are deprecated: paused products (2026-10-25), removed in the next major; their pictures stay served until then. */
|
|
7
7
|
type DefaultAvatarBrand = "krizaka" | "orazaka" | "orochia" | "yasakia" | "yororis" | "yomizaka" | "kachizaka" | "akinaza";
|
|
@@ -718,6 +718,51 @@ declare const Chip: typeof ChipBase & {
|
|
|
718
718
|
Group: typeof ChipGroup;
|
|
719
719
|
};
|
|
720
720
|
|
|
721
|
+
type CollectionItem = {
|
|
722
|
+
/** A stable id. */
|
|
723
|
+
id: string;
|
|
724
|
+
/** Its name — it is the user's own text, never translated. */
|
|
725
|
+
name: string;
|
|
726
|
+
/** The collection it is nested in; `null`/missing for a root. An unknown parent makes it a root (nothing is lost). */
|
|
727
|
+
parentId?: string | null;
|
|
728
|
+
/** The default collection: marked, and never removable. */
|
|
729
|
+
isDefault?: boolean;
|
|
730
|
+
/** How many items it holds. */
|
|
731
|
+
count?: number;
|
|
732
|
+
/** Its picture (a shop or studio in `entity` mode). */
|
|
733
|
+
avatar?: {
|
|
734
|
+
src?: string | null;
|
|
735
|
+
defaultAvatar?: DefaultAvatar;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
type CollectionSwitcherProps = Omit<ViewProps, "children"> & {
|
|
740
|
+
/** The collections, flat; `parentId` nests them in the `tree` layout. */
|
|
741
|
+
collections: readonly CollectionItem[];
|
|
742
|
+
/** The current one (read from the route), or `null`. */
|
|
743
|
+
value: string | null;
|
|
744
|
+
/** The viewer chooses a collection: navigate. */
|
|
745
|
+
onValueChange?: (id: string) => void;
|
|
746
|
+
/** The accessible name (“Collections”), passed translated. */
|
|
747
|
+
label: string;
|
|
748
|
+
/** `list` (default) or `tree` (indented by `parentId`). */
|
|
749
|
+
layout?: "list" | "tree";
|
|
750
|
+
/** `collection` (default), or `entity`: a compact button that opens the list, to switch shop or studio. */
|
|
751
|
+
mode?: "collection" | "entity";
|
|
752
|
+
/** The mark on the default collection (“Default”), passed translated. */
|
|
753
|
+
defaultLabel: string;
|
|
754
|
+
/** Removes a collection — never offered on the default one. */
|
|
755
|
+
onRemove?: (id: string) => void;
|
|
756
|
+
/** The remove button's accessible name (“Remove Archive”), passed translated. */
|
|
757
|
+
removeLabel?: (name: string) => string;
|
|
758
|
+
/** Adds a collection: a row at the end. */
|
|
759
|
+
onCreate?: () => void;
|
|
760
|
+
/** The create row's words, passed translated. */
|
|
761
|
+
createLabel?: string;
|
|
762
|
+
};
|
|
763
|
+
/** The collections of a workspace — or the shops of an account — to move between; the default one marked and never removable. */
|
|
764
|
+
declare function CollectionSwitcher(props: CollectionSwitcherProps): React$1.JSX.Element;
|
|
765
|
+
|
|
721
766
|
/** An option: the value stored and its words (passed translated), a line under them. */
|
|
722
767
|
type SelectOption = {
|
|
723
768
|
value: string;
|
|
@@ -1067,6 +1112,58 @@ type EmptyStateProps = Omit<ViewProps, "children"> & {
|
|
|
1067
1112
|
/** What a list, a search or a screen says when it has nothing to show — every word is a prop. */
|
|
1068
1113
|
declare function EmptyState({ icon, title, description, action, style, ...props }: EmptyStateProps): React$1.JSX.Element;
|
|
1069
1114
|
|
|
1115
|
+
/** The refusals a header knows how to say: the product passes the words (translated) for the codes it can get. */
|
|
1116
|
+
type EntityRefusals = Partial<Record<OrganizeCode, string>>;
|
|
1117
|
+
/** The entity's picture: an address, or one of Krizaka's default pictures. */
|
|
1118
|
+
type EntityAvatar = {
|
|
1119
|
+
src?: string | null;
|
|
1120
|
+
defaultAvatar?: DefaultAvatar;
|
|
1121
|
+
fallback?: React$1.ReactNode;
|
|
1122
|
+
};
|
|
1123
|
+
type EntityTag = {
|
|
1124
|
+
id: string;
|
|
1125
|
+
label: string;
|
|
1126
|
+
marker: Marker$1;
|
|
1127
|
+
};
|
|
1128
|
+
/** The props both platforms take: plain data, the editing callbacks, the refusals. */
|
|
1129
|
+
type EntityHeaderBase = {
|
|
1130
|
+
/** The entity's name. */
|
|
1131
|
+
name: string;
|
|
1132
|
+
/** Makes the name editable in place: called with the trimmed new name. Throw (or reject with) an error carrying a `code` to show its refusal. */
|
|
1133
|
+
onNameChange?: (name: string) => void | Promise<void>;
|
|
1134
|
+
/** What editing the name does (“Rename the collection”), passed translated: the field's name, and the button's after the visible name. */
|
|
1135
|
+
nameLabel?: string;
|
|
1136
|
+
/** One line under the name. */
|
|
1137
|
+
description?: string;
|
|
1138
|
+
/** Makes the description editable in place. Same contract as `onNameChange`. */
|
|
1139
|
+
onDescriptionChange?: (description: string) => void | Promise<void>;
|
|
1140
|
+
/** What editing the description does (“Edit the description”), passed translated: the field's name, and the button's after the visible text. */
|
|
1141
|
+
descriptionLabel?: string;
|
|
1142
|
+
/** Shown when there is no description and it is editable (“Add a description”), passed translated. */
|
|
1143
|
+
descriptionPlaceholder?: string;
|
|
1144
|
+
/** The picture. */
|
|
1145
|
+
avatar?: EntityAvatar;
|
|
1146
|
+
/** The entity's tags. */
|
|
1147
|
+
tags?: readonly EntityTag[];
|
|
1148
|
+
/** A refusal to say now (the last answer of the server), by its code. */
|
|
1149
|
+
refusal?: {
|
|
1150
|
+
code: OrganizeCode;
|
|
1151
|
+
} | null;
|
|
1152
|
+
/** The messages by refusal code: `NAME_TAKEN`, `AVATAR_NOT_ALLOWED`, `DEFAULT_COLLECTION`, … A code with no message says nothing. */
|
|
1153
|
+
refusals?: EntityRefusals;
|
|
1154
|
+
/** After the text: the actions of the entity (a menu, a button). */
|
|
1155
|
+
actions?: React$1.ReactNode;
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
type EntityHeaderProps = Omit<ViewProps, "children"> & EntityHeaderBase & {
|
|
1159
|
+
/** Makes the picture a button; the app opens its picker. */
|
|
1160
|
+
onAvatarPress?: () => void;
|
|
1161
|
+
/** The accessible name of the picture's button (“Change the picture”), passed translated. */
|
|
1162
|
+
avatarLabel?: string;
|
|
1163
|
+
};
|
|
1164
|
+
/** The head of an entity: picture, name and description editable in place, tags, a refusal said in words, actions. */
|
|
1165
|
+
declare function EntityHeader({ avatar, onAvatarPress, avatarLabel, style, actions, refusal, refusals, tags, description, onDescriptionChange, descriptionLabel, descriptionPlaceholder, name, nameLabel, onNameChange, ...props }: EntityHeaderProps): React$1.JSX.Element;
|
|
1166
|
+
|
|
1070
1167
|
type EnvironmentNoticeProps = Omit<ViewProps, "children"> & {
|
|
1071
1168
|
/** The deployment's stage, read once by the app. `production` (or `prod`) renders nothing. */
|
|
1072
1169
|
stage: string | null | undefined;
|
|
@@ -2162,6 +2259,27 @@ type BrandedRefreshProps = {
|
|
|
2162
2259
|
*/
|
|
2163
2260
|
declare function BrandedRefresh({ product, refreshing, onRefresh, label, children, threshold }: BrandedRefreshProps): React$1.JSX.Element;
|
|
2164
2261
|
|
|
2262
|
+
type QrLevel = "L" | "M" | "Q" | "H";
|
|
2263
|
+
|
|
2264
|
+
type QrCodeProps = Omit<ViewProps, "children"> & {
|
|
2265
|
+
/** The text to encode. Encoded on the device; never sent anywhere. */
|
|
2266
|
+
value: string;
|
|
2267
|
+
/** What the code is, for the screen reader, passed translated. */
|
|
2268
|
+
label: string;
|
|
2269
|
+
/** The side of the tile, in points, quiet zone included. Default 176. */
|
|
2270
|
+
size?: number;
|
|
2271
|
+
/** The quiet zone, in modules. Default 4, never less than 2. */
|
|
2272
|
+
quietZone?: number;
|
|
2273
|
+
/** L · M (default) · Q · H. */
|
|
2274
|
+
level?: QrLevel;
|
|
2275
|
+
/** The copy action's words, translated. Without it there is no button. */
|
|
2276
|
+
copyLabel?: string;
|
|
2277
|
+
/** Called with the text when the person asks to copy: the app puts it on the clipboard and says so. */
|
|
2278
|
+
onCopy?: (value: string) => void;
|
|
2279
|
+
};
|
|
2280
|
+
/** A QR code from a text: dark modules on a light tile, a quiet zone, an accessible name, an optional copy button. */
|
|
2281
|
+
declare function QrCode({ value, label, size, quietZone, level, copyLabel, onCopy, style, ...props }: QrCodeProps): React$1.JSX.Element;
|
|
2282
|
+
|
|
2165
2283
|
/** A choice: the value stored and its words (passed translated), a line under them, a second line on a key. */
|
|
2166
2284
|
type RadioOption = {
|
|
2167
2285
|
value: string;
|
|
@@ -3207,5 +3325,5 @@ declare function YomizakaMark({ size, animated, title, neutral }: NativeMarkProp
|
|
|
3207
3325
|
*/
|
|
3208
3326
|
declare function YororisMark({ size, animated, title, neutral }: NativeMarkProps): React__default.JSX.Element;
|
|
3209
3327
|
|
|
3210
|
-
export { ActionSheet, ActivityFeed, AkinazaMark, AnalysisReport, AppHeader, AppHeaderCount, AppHeaderSearch, Avatar, AvatarGroup, AvatarRoot, Badge, BrandedRefresh, Button, Calendar, Card, CardBody, CardDescription, CardFooter, CardImage, CardMedia, CardOverlay, CardRoot, CardTitle, Checkbox, Chip, Columns, Combobox, ComposerMeta, ConversationItem, Countdown, DEFAULT_COLUMNS, DateField, DateWheel, DayStrip, DescriptionList, EmptyState, EnvironmentNotice, ErrorState, Fab, ForceUpdateScreen, FormFlow, GRID_GAPS, GoalGauge, Grid, Header, IconButton, ImageViewer, KachizakaMark, KrizakaMark, ListDetail, Loader, LoaderGlyph, LoadingState, MaintenanceScreen, MarkerPicker, Mascot, MascotState, MatchDialog, MessageBubble, MessageComposer, MetaRow, Meter, MonthPicker, NumberTicker, OfflineBanner, Onboarding, OrazakaMark, OrochiaMark, OtpInput, Pagination, PermissionPrompt, PersonCard, Phoenix, PhotoGrid, ProductMark, ProfileBanner, ProfileCard, Progress, PullToRefresh, RadioGroup, SIZE_CLASS_FROM, Screen, SearchField, Segmented, Select, SettingsGroup, SettingsRow, Sheet, Showcase, Skeleton, Slider, Spinner, SplashHandoff, StateScreen, StatusChip, StatusSetEditor, StepProgress, Stepper, SuccessState, SwipeDeck, SwipeableRow, Switch, TAG_MARKERS, TabBar, Tabs, TagChip, TagMarker, TagSelector, TagSetEditor, TextField, ThemeProvider, TimePicker, Toaster, Txt, TypingIndicator, UpdatePrompt, VerifiedBadge, Waveform, WelcomeState, Wheel, WheelDivider, WheelPicker, YasakiaMark, YazakiaMark, YomizakaMark, YororisMark, addDays, addMonths, ageOn, alpha, calendarLabels, columnsFit, comboboxLabels, composeDate, dateFieldLabels, datePartsOrder, daysInMonth, defaultAvatarUrl, formatTime, gridColumns, isRealDate, itemWidth, latestBirthDate, monthNames, prefetchNeighbours, showcaseLabels, sizeClassOf, splitDuration, statusSetEditorLabels, tagSetEditorLabels, textStyles, timeSlots, timeToMinutes, toast, todayIso, useCollapsingHeader, useCountdown, useDelayedWait, useFontScale, useReducedMotion, useSizeClass, useTheme, uses12Hours };
|
|
3211
|
-
export type { ActionSheetAction, ActionSheetProps, ActivityEvent, ActivityFeedLabels, ActivityFeedProps, ActivityTone, AnalysisReportData, AnalysisReportLabels, AnalysisReportProps, AnalysisStatus, AppHeaderCountProps, AppHeaderProps, AppHeaderSearchProps, AvatarGroupProps, AvatarProps, AvatarSize, BadgeProps, BadgeTone, BrandId, BrandedRefreshProps, BrandedRefreshScrollProps, ButtonProps, ButtonSize, ButtonVariant, CalendarLabels, CalendarProps, CardBodyProps, CardImageProps, CardMediaProps, CardOverlayProps, CardRootProps, CheckboxProps, ChipGroupProps, ChipProps, ChipSize, ColumnsProps, ComboboxLabels, ComboboxProps, ComposerMetaProps, ConversationItemProps, CountdownProps, CountdownUnits, DateFieldLabels, DateFieldProps, DatePart, DateWheelProps, DayStripProps, DefaultAvatar, DefaultAvatarBrand, DescriptionItem, DescriptionListProps, EditorRole, EmptyStateProps, EnvironmentNoticeProps, FabProps, ForceUpdateScreenProps, FormFlowProps, FormFlowStep, GoalGaugeProps, GridColumns, GridGap, GridPhoto, GridProps, HapticKind, HeaderProps, IconButtonProps, ImageViewerProps, Insets, ListDetailProps, LoaderGlyphProps, LoaderProps, MaintenanceScreenProps, Marker, MarkerPickerProps, MarkerShape, MascotProps, MascotStateProps, MatchDialogProps, MessageBubbleLabels, MessageBubbleProps, MessageComposerProps, MessageStatus, MetaRowProps, MeterPart, MeterProps, Mode, MonthPickerProps, Motion, NativeMarkProps, NumberTickerProps, OfflineBannerProps, OnboardingProps, OnboardingSlide, OtpInputProps, PaginationLabels, PaginationProps, PermissionPromptProps, PermissionStatus, PersonCardProps, PhoenixProps, PhotoGridLabels, PhotoGridProps, ProfileBannerProps, ProfileCardProps, ProfileStat, ProgressProps, PullToRefreshProps, RadioGroupProps, RadioOption, Radius, ScreenProps, SearchFieldProps, SegmentedOption, SegmentedProps, SelectOption, SelectProps, SettingsGroupProps, SettingsRowProps, SheetProps, ShowcaseLabels, ShowcaseProps, SizeClass, SkeletonProps, SliderProps, SliderValue, SpinnerProps, SplashHandoffProps, StateAction, StateKind, StateScreenProps, StatusChipProps, StatusMoveOption, StatusSetEditorLabels, StatusSetEditorProps, Step, StepProgressProps, StepStatus, StepperProps, SwipeAction, SwipeDeckLabels, SwipeDeckProps, SwipeDirection, SwipeableRowProps, SwitchProps, TabBarItem, TabBarProps, TabItem, TabsHue, TabsProps, TagChipProps, TagMarkerProps, TagOption, TagSelectorProps, TagSetEditorLabels, TagSetEditorProps, TagSetValue, TextFieldProps, Theme, ThemeContextValue, ThemeFonts, ThemeName, ThemeOverrides, ThemeProviderProps, TimePickerLabels, TimePickerProps, TimeValue, ToastItem, ToastOptions, ToastTone, ToasterProps, TxtProps, TxtTone, TxtVariant, TypingIndicatorProps, UpdatePromptProps, VerifiedBadgeProps, ViewerImage, WaveformProps, WheelOption, WheelPickerProps, WheelProps };
|
|
3328
|
+
export { ActionSheet, ActivityFeed, AkinazaMark, AnalysisReport, AppHeader, AppHeaderCount, AppHeaderSearch, Avatar, AvatarGroup, AvatarRoot, Badge, BrandedRefresh, Button, Calendar, Card, CardBody, CardDescription, CardFooter, CardImage, CardMedia, CardOverlay, CardRoot, CardTitle, Checkbox, Chip, CollectionSwitcher, Columns, Combobox, ComposerMeta, ConversationItem, Countdown, DEFAULT_COLUMNS, DateField, DateWheel, DayStrip, DescriptionList, EmptyState, EntityHeader, EnvironmentNotice, ErrorState, Fab, ForceUpdateScreen, FormFlow, GRID_GAPS, GoalGauge, Grid, Header, IconButton, ImageViewer, KachizakaMark, KrizakaMark, ListDetail, Loader, LoaderGlyph, LoadingState, MaintenanceScreen, MarkerPicker, Mascot, MascotState, MatchDialog, MessageBubble, MessageComposer, MetaRow, Meter, MonthPicker, NumberTicker, OfflineBanner, Onboarding, OrazakaMark, OrochiaMark, OtpInput, Pagination, PermissionPrompt, PersonCard, Phoenix, PhotoGrid, ProductMark, ProfileBanner, ProfileCard, Progress, PullToRefresh, QrCode, RadioGroup, SIZE_CLASS_FROM, Screen, SearchField, Segmented, Select, SettingsGroup, SettingsRow, Sheet, Showcase, Skeleton, Slider, Spinner, SplashHandoff, StateScreen, StatusChip, StatusSetEditor, StepProgress, Stepper, SuccessState, SwipeDeck, SwipeableRow, Switch, TAG_MARKERS, TabBar, Tabs, TagChip, TagMarker, TagSelector, TagSetEditor, TextField, ThemeProvider, TimePicker, Toaster, Txt, TypingIndicator, UpdatePrompt, VerifiedBadge, Waveform, WelcomeState, Wheel, WheelDivider, WheelPicker, YasakiaMark, YazakiaMark, YomizakaMark, YororisMark, addDays, addMonths, ageOn, alpha, calendarLabels, columnsFit, comboboxLabels, composeDate, dateFieldLabels, datePartsOrder, daysInMonth, defaultAvatarUrl, formatTime, gridColumns, isRealDate, itemWidth, latestBirthDate, monthNames, prefetchNeighbours, showcaseLabels, sizeClassOf, splitDuration, statusSetEditorLabels, tagSetEditorLabels, textStyles, timeSlots, timeToMinutes, toast, todayIso, useCollapsingHeader, useCountdown, useDelayedWait, useFontScale, useReducedMotion, useSizeClass, useTheme, uses12Hours };
|
|
3329
|
+
export type { ActionSheetAction, ActionSheetProps, ActivityEvent, ActivityFeedLabels, ActivityFeedProps, ActivityTone, AnalysisReportData, AnalysisReportLabels, AnalysisReportProps, AnalysisStatus, AppHeaderCountProps, AppHeaderProps, AppHeaderSearchProps, AvatarGroupProps, AvatarProps, AvatarSize, BadgeProps, BadgeTone, BrandId, BrandedRefreshProps, BrandedRefreshScrollProps, ButtonProps, ButtonSize, ButtonVariant, CalendarLabels, CalendarProps, CardBodyProps, CardImageProps, CardMediaProps, CardOverlayProps, CardRootProps, CheckboxProps, ChipGroupProps, ChipProps, ChipSize, CollectionSwitcherProps, ColumnsProps, ComboboxLabels, ComboboxProps, ComposerMetaProps, ConversationItemProps, CountdownProps, CountdownUnits, DateFieldLabels, DateFieldProps, DatePart, DateWheelProps, DayStripProps, DefaultAvatar, DefaultAvatarBrand, DescriptionItem, DescriptionListProps, EditorRole, EmptyStateProps, EntityHeaderProps, EnvironmentNoticeProps, FabProps, ForceUpdateScreenProps, FormFlowProps, FormFlowStep, GoalGaugeProps, GridColumns, GridGap, GridPhoto, GridProps, HapticKind, HeaderProps, IconButtonProps, ImageViewerProps, Insets, ListDetailProps, LoaderGlyphProps, LoaderProps, MaintenanceScreenProps, Marker, MarkerPickerProps, MarkerShape, MascotProps, MascotStateProps, MatchDialogProps, MessageBubbleLabels, MessageBubbleProps, MessageComposerProps, MessageStatus, MetaRowProps, MeterPart, MeterProps, Mode, MonthPickerProps, Motion, NativeMarkProps, NumberTickerProps, OfflineBannerProps, OnboardingProps, OnboardingSlide, OtpInputProps, PaginationLabels, PaginationProps, PermissionPromptProps, PermissionStatus, PersonCardProps, PhoenixProps, PhotoGridLabels, PhotoGridProps, ProfileBannerProps, ProfileCardProps, ProfileStat, ProgressProps, PullToRefreshProps, QrCodeProps, RadioGroupProps, RadioOption, Radius, ScreenProps, SearchFieldProps, SegmentedOption, SegmentedProps, SelectOption, SelectProps, SettingsGroupProps, SettingsRowProps, SheetProps, ShowcaseLabels, ShowcaseProps, SizeClass, SkeletonProps, SliderProps, SliderValue, SpinnerProps, SplashHandoffProps, StateAction, StateKind, StateScreenProps, StatusChipProps, StatusMoveOption, StatusSetEditorLabels, StatusSetEditorProps, Step, StepProgressProps, StepStatus, StepperProps, SwipeAction, SwipeDeckLabels, SwipeDeckProps, SwipeDirection, SwipeableRowProps, SwitchProps, TabBarItem, TabBarProps, TabItem, TabsHue, TabsProps, TagChipProps, TagMarkerProps, TagOption, TagSelectorProps, TagSetEditorLabels, TagSetEditorProps, TagSetValue, TextFieldProps, Theme, ThemeContextValue, ThemeFonts, ThemeName, ThemeOverrides, ThemeProviderProps, TimePickerLabels, TimePickerProps, TimeValue, ToastItem, ToastOptions, ToastTone, ToasterProps, TxtProps, TxtTone, TxtVariant, TypingIndicatorProps, UpdatePromptProps, VerifiedBadgeProps, ViewerImage, WaveformProps, WheelOption, WheelPickerProps, WheelProps };
|