@imfusion/web-ui 0.11.1-dev.42.ge966e634 → 0.11.1-dev.45.gf7b49f57
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/CHANGELOG.md +8 -0
- package/dist/{code-BXlEW54h.js → code-BX1Humcy.js} +6 -6
- package/dist/components/file-drop-zone/collect-files.d.ts +56 -0
- package/dist/components/file-drop-zone/file-drop-zone-context.d.ts +15 -0
- package/dist/components/file-drop-zone/file-drop-zone.d.ts +185 -0
- package/dist/components/file-drop-zone/file-drop-zone.meta.d.ts +2 -0
- package/dist/components/file-drop-zone/format-bytes.d.ts +5 -0
- package/dist/components/file-drop-zone/index.d.ts +4 -0
- package/dist/components/logo/logo.d.ts +1 -1
- package/dist/components/toast/toast.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3914 -3225
- package/dist/integrations/code-highlight.js +1 -1
- package/dist/integrations/image-display-options.js +56 -56
- package/dist/style.css +1 -1
- package/dist/{tabs-D5DTlk0d.js → tabs-CLeLjFNy.js} +126 -126
- package/package.json +1 -1
- package/src/docgen/doc.gen.json +534 -0
- package/src/llms/llms.gen.txt +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
- `Progress` is a new bar for the completion of a running task, adapted from Base UI. `size` runs from `xs` (a 2px hairline) to
|
|
8
8
|
`lg`, `layout` is `stacked` or `inline`, `value={null}` sweeps while the amount is unknown, and the fill turns positive at the
|
|
9
9
|
maximum. [Progress](src/components/progress/progress.mdx) — Nikolaus Brunner <brunner@imfusion.com>
|
|
10
|
+
- `FileDropZone` is a new zone that collects files or whole folders by drop or through its `Trigger` buttons, in sizes `sm`,
|
|
11
|
+
`md` and `lg`. It reports accepted and rejected files through `onFilesAdded`, scans folders recursively, and reads the
|
|
12
|
+
result out to screen readers. `FileDropZone.Upload` composes the zone with a file list, a skipped-files note, per-file and
|
|
13
|
+
overall `Progress`, and an upload button; the app owns the items and the upload, and `onRetry` adds a Retry button to
|
|
14
|
+
failed rows. A single-file zone shows its file with `FileDropZone.File` and `FileDropZone.Remove`, and the glyph changes to a
|
|
15
|
+
page.
|
|
16
|
+
[FileDropZone](src/components/file-drop-zone/file-drop-zone.mdx) — Nikolaus Brunner <brunner@imfusion.com>
|
|
10
17
|
- `TabNav` is a new row of links to routes with a bar under the current one, in the underline look of `Tabs`. `TabNav.Item`
|
|
11
18
|
renders an `<a>`, takes a router link as `render`, and sets `aria-current="page"` from `current`.
|
|
12
19
|
[TabNav](src/components/tab-nav/tab-nav.stories.tsx#InAProjectHeader) — Nikolaus Brunner <brunner@imfusion.com>
|
|
@@ -112,6 +119,7 @@
|
|
|
112
119
|
- `npm run dev` starts Storybook on the next free port again while another checkout's Storybook runs. — Nikolaus Brunner
|
|
113
120
|
<brunner@imfusion.com>
|
|
114
121
|
- A Storybook sidebar row's status icon stays in place on hover. — Nikolaus Brunner <brunner@imfusion.com>
|
|
122
|
+
- `npm run ci:status` lists queued and running builds beside finished ones. — Nikolaus Brunner <brunner@imfusion.com>
|
|
115
123
|
- Components — Nikolaus Brunner <brunner@imfusion.com>
|
|
116
124
|
- A `Drawer.Close` or `Popover.Close` rendered as another component, such as a `Button`, keeps that component's styles.
|
|
117
125
|
- A `Popover.Trigger` rendered as another component keeps that component's styles, so `render={<Button />}` looks like a Button.
|
|
@@ -5,8 +5,8 @@ import { a, i as o, n as s, o as c, s as l } from "./scroll-area-CUo1NBaW.js";
|
|
|
5
5
|
import { cx as u } from "class-variance-authority";
|
|
6
6
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useRender as v } from "@base-ui/react/use-render";
|
|
9
|
+
import { mergeProps as y } from "@base-ui/react/merge-props";
|
|
10
10
|
//#region src/hooks/use-clipboard.ts
|
|
11
11
|
function b({ timeout: e = 1500 } = {}) {
|
|
12
12
|
let [t, n] = _(!1), r = g(void 0);
|
|
@@ -35,11 +35,11 @@ var x = {
|
|
|
35
35
|
});
|
|
36
36
|
function C({ copyable: e = !1, children: i, render: a, ...o }) {
|
|
37
37
|
let { copied: s, copy: c } = b(), l = g(null), u = s ? r : t;
|
|
38
|
-
return
|
|
38
|
+
return v({
|
|
39
39
|
defaultTagName: "code",
|
|
40
40
|
render: a,
|
|
41
41
|
props: {
|
|
42
|
-
...
|
|
42
|
+
...y(o, {
|
|
43
43
|
className: x.inline,
|
|
44
44
|
children: /* @__PURE__ */ p(d, { children: [
|
|
45
45
|
/* @__PURE__ */ f("span", {
|
|
@@ -72,11 +72,11 @@ function w({ kind: e = "external", ...t }) {
|
|
|
72
72
|
target: "_blank",
|
|
73
73
|
rel: "noreferrer"
|
|
74
74
|
} : {};
|
|
75
|
-
return
|
|
75
|
+
return v({
|
|
76
76
|
defaultTagName: "a",
|
|
77
77
|
render: t.render,
|
|
78
78
|
props: {
|
|
79
|
-
...
|
|
79
|
+
...y(n, t, {
|
|
80
80
|
className: u(x.inline, x.inlineLink, t.className),
|
|
81
81
|
children: t.children
|
|
82
82
|
}),
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface FileDropZoneItem {
|
|
2
|
+
file: File;
|
|
3
|
+
/** Folder-relative path with the root folder's name first (`"scans/s1.nii.gz"`), or the file name for a loose file. */
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CollectResult {
|
|
7
|
+
accepted: FileDropZoneItem[];
|
|
8
|
+
rejected: FileDropZoneItem[];
|
|
9
|
+
}
|
|
10
|
+
interface CollectOptions {
|
|
11
|
+
accept?: string[];
|
|
12
|
+
directory: boolean;
|
|
13
|
+
multiple: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** The part of a `FileSystemEntry` the walk reads. */
|
|
16
|
+
export interface EntryLike {
|
|
17
|
+
readonly isFile: boolean;
|
|
18
|
+
readonly isDirectory: boolean;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly fullPath: string;
|
|
21
|
+
}
|
|
22
|
+
/** What the synchronous part of a `drop` handler can read; the drag data store is gone after the first `await`. */
|
|
23
|
+
interface DropSource {
|
|
24
|
+
entry: EntryLike | null;
|
|
25
|
+
file: File | null;
|
|
26
|
+
}
|
|
27
|
+
/** The part of a `DataTransfer` that `snapshotDrop` reads. */
|
|
28
|
+
interface DropData {
|
|
29
|
+
items: ArrayLike<{
|
|
30
|
+
kind: string;
|
|
31
|
+
webkitGetAsEntry: () => EntryLike | null;
|
|
32
|
+
getAsFile: () => File | null;
|
|
33
|
+
}>;
|
|
34
|
+
files: ArrayLike<File>;
|
|
35
|
+
}
|
|
36
|
+
export type DragState = "idle" | "accepting" | "rejecting";
|
|
37
|
+
export declare function matchesAccept(file: File, accept?: string[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* A drag shows each item's MIME type but never its name, so only a type that is known to come from other extensions
|
|
40
|
+
* than the accepted ones is judged `"rejecting"`. A type missing from the table, an empty one, or an empty item list
|
|
41
|
+
* (Safari lists no items during a drag) stays `"accepting"`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function classifyDrag(items: ArrayLike<{
|
|
44
|
+
kind: string;
|
|
45
|
+
type: string;
|
|
46
|
+
}>, accept?: string[]): DragState;
|
|
47
|
+
/** Reads every `webkitGetAsEntry()` and `getAsFile()` of a drop. Call it synchronously inside the `drop` handler. */
|
|
48
|
+
export declare function snapshotDrop(dataTransfer: DropData): DropSource[];
|
|
49
|
+
export declare function collectFromDrop(sources: DropSource[], options: CollectOptions): Promise<CollectResult>;
|
|
50
|
+
/** Files from a picker. A folder pick carries `webkitRelativePath`, which includes the chosen folder's name. */
|
|
51
|
+
export declare function collectFromFileList(files: File[], options: CollectOptions & {
|
|
52
|
+
fromFolder: boolean;
|
|
53
|
+
}): CollectResult;
|
|
54
|
+
/** Names the accepted types for copy: `[".png", ".jpg", ".jpeg", ".webp"]` becomes "PNG, JPEG or WebP". Empty without a list. */
|
|
55
|
+
export declare function describeAccept(accept?: string[]): string;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type FileDropZoneSize = "sm" | "md" | "lg";
|
|
2
|
+
interface FileDropZoneContextValue {
|
|
3
|
+
size: FileDropZoneSize;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
directory: boolean;
|
|
6
|
+
/** Whether a `FileDropZone.File` is mounted. */
|
|
7
|
+
filled: boolean;
|
|
8
|
+
openPicker: (mode: "files" | "folder") => void;
|
|
9
|
+
setFilled: (filled: boolean) => void;
|
|
10
|
+
registerTitle: (id: string | null) => void;
|
|
11
|
+
registerDescription: (id: string | null) => void;
|
|
12
|
+
}
|
|
13
|
+
/** What `FileDropZone.Root` hands to its parts; a part outside a Root reads the inert defaults. */
|
|
14
|
+
export declare const FileDropZoneContext: import('react').Context<FileDropZoneContextValue>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Button } from '../button';
|
|
3
|
+
import { Icon, IconComponent } from '../icon';
|
|
4
|
+
import { IconButton } from '../icon-button';
|
|
5
|
+
import { DragState, FileDropZoneItem } from './collect-files';
|
|
6
|
+
declare const root: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
type RootProps = React.ComponentProps<"div"> & VariantProps<typeof root> & {
|
|
10
|
+
/** Accepted file types: extensions (`".nii.gz"`), MIME types (`"image/png"`) or wildcards (`"image/*"`). Any file when empty. */
|
|
11
|
+
accept?: string[];
|
|
12
|
+
/** Whether more than one file can be added at once. With `false`, only the first accepted file is kept. */
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
/** Whether folders can be dropped or picked. They are scanned recursively. Needs `multiple`. */
|
|
15
|
+
directory?: boolean;
|
|
16
|
+
/** Blocks dropping and picking; the Triggers follow. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Marks the zone as holding a problem. The message belongs in `Field.Error` or a `Callout`. */
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
/** Called once per drop or pick with the files that match `accept` and those that do not. */
|
|
21
|
+
onFilesAdded?: (accepted: FileDropZoneItem[], rejected: FileDropZoneItem[]) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Called when a drag over the zone starts, changes or ends. `"rejecting"` is reported only for a dragged type the
|
|
24
|
+
* browser exposes and `accept` cannot produce; names and counts are unknown until the drop.
|
|
25
|
+
*/
|
|
26
|
+
onDragStateChange?: (state: DragState) => void;
|
|
27
|
+
/** Words for the screen reader status after each drop or pick. Return `""` to stay silent. */
|
|
28
|
+
formatStatus?: (accepted: number, rejected: number) => string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* FileDropZone.Root — a group that collects files and folders by drop or by its Triggers and reports them through
|
|
32
|
+
* `onFilesAdded`. The Triggers are the keyboard and screen reader path; dropping is an enhancement.
|
|
33
|
+
*/
|
|
34
|
+
export declare function Root({ accept, multiple, directory, size, disabled, invalid, onFilesAdded, onDragStateChange, formatStatus, children, className, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onDragEnter, onDragOver, onDragLeave, onDrop, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare namespace Root {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
/** FileDropZone.Title — names the group. */
|
|
39
|
+
export declare function Title(props: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare namespace Title {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
/** FileDropZone.Description — describes the group, such as the accepted file types. */
|
|
44
|
+
export declare function Description(props: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare namespace Description {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
48
|
+
/** FileDropZone.Actions — the row of Triggers. */
|
|
49
|
+
export declare function Actions(props: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare namespace Actions {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
53
|
+
type FileProps = React.ComponentProps<"div"> & {
|
|
54
|
+
/** The single file the zone holds. Its name shows middle-truncated, with the last 12 characters kept, and its size in mono. */
|
|
55
|
+
file: globalThis.File;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* FileDropZone.File — the file a single-file zone holds, in place of `Title` and `Description`. It names the group,
|
|
59
|
+
* describes it with the size, and sets `data-filled` on the Root while mounted. Long names truncate in the middle so the
|
|
60
|
+
* extension stays readable; the full name is the `title`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function File({ file, className, ...props }: FileProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export declare namespace File {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
66
|
+
type IconButtonProps = React.ComponentProps<typeof IconButton>;
|
|
67
|
+
type RemoveProps = Omit<IconButtonProps, "glyph" | "label"> & {
|
|
68
|
+
/** Accessible name of the button. Defaults to "Remove file". */
|
|
69
|
+
label?: string;
|
|
70
|
+
/** Defaults to `"ghost"` in an `sm` zone and `"outline"` otherwise. */
|
|
71
|
+
variant?: IconButtonProps["variant"];
|
|
72
|
+
/** Defaults to `"md"` in an `lg` zone and `"sm"` otherwise. */
|
|
73
|
+
size?: IconButtonProps["size"];
|
|
74
|
+
/** Defaults to the zone's `disabled`. */
|
|
75
|
+
disabled?: IconButtonProps["disabled"];
|
|
76
|
+
};
|
|
77
|
+
/** FileDropZone.Remove — an icon button that empties a filled zone. It carries no behavior of its own: `onClick` clears the consumer's state. */
|
|
78
|
+
export declare function Remove({ label, variant, size, disabled, ...props }: RemoveProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export declare namespace Remove {
|
|
80
|
+
var displayName: string;
|
|
81
|
+
}
|
|
82
|
+
type GlyphProps = Omit<React.ComponentProps<typeof Icon>, "glyph"> & {
|
|
83
|
+
/** Icon component imported from `@imfusion/web-ui/icons`. Defaults to `UploadSquare`, or `Page` while a File is mounted. */
|
|
84
|
+
glyph?: IconComponent;
|
|
85
|
+
};
|
|
86
|
+
/** FileDropZone.Glyph — the large icon of the `lg` zone: the upload icon, or a page while a `FileDropZone.File` is mounted. It renders nothing in `sm` and `md`. */
|
|
87
|
+
export declare function Glyph({ glyph, size, ...props }: GlyphProps): import("react/jsx-runtime").JSX.Element | null;
|
|
88
|
+
export declare namespace Glyph {
|
|
89
|
+
var displayName: string;
|
|
90
|
+
}
|
|
91
|
+
type ButtonProps = React.ComponentProps<typeof Button>;
|
|
92
|
+
type TriggerProps = ButtonProps & {
|
|
93
|
+
/** `"files"` opens the file picker, `"folder"` the folder picker. A folder Trigger needs `directory` on the Root. */
|
|
94
|
+
mode?: "files" | "folder";
|
|
95
|
+
/** Defaults to `"ghost"` in an `sm` zone and `"outline"` otherwise. */
|
|
96
|
+
variant?: ButtonProps["variant"];
|
|
97
|
+
/** Defaults to `"md"` in an `lg` zone and `"sm"` otherwise. */
|
|
98
|
+
size?: ButtonProps["size"];
|
|
99
|
+
/** Defaults to the zone's `disabled`. */
|
|
100
|
+
disabled?: ButtonProps["disabled"];
|
|
101
|
+
};
|
|
102
|
+
/** FileDropZone.Trigger — a Button that opens the picker. */
|
|
103
|
+
export declare function Trigger({ mode, variant, size, disabled, onClick, ...props }: TriggerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
104
|
+
export declare namespace Trigger {
|
|
105
|
+
var displayName: string;
|
|
106
|
+
}
|
|
107
|
+
export interface FileDropZoneUploadItem {
|
|
108
|
+
/** Identifies the row in `onRemove`. */
|
|
109
|
+
id: string;
|
|
110
|
+
file: globalThis.File;
|
|
111
|
+
/** Shown instead of the file name, such as a folder-relative path. */
|
|
112
|
+
path?: string;
|
|
113
|
+
/** `"queued"` and `"error"` rows list the file with a Remove button; `"uploading"` and `"done"` rows show a progress bar. */
|
|
114
|
+
status: "queued" | "uploading" | "done" | "error";
|
|
115
|
+
/** From 0 to 100 while `"uploading"`; `null` while the amount is unknown. */
|
|
116
|
+
progress?: number | null;
|
|
117
|
+
}
|
|
118
|
+
interface UploadLabels {
|
|
119
|
+
chooseFiles: string;
|
|
120
|
+
chooseFolder: string;
|
|
121
|
+
/** Text of the upload button, from the number of queued items. */
|
|
122
|
+
upload: (queued: number) => string;
|
|
123
|
+
/** Text beside "Start over" once the upload has finished, from the number of items done and failed. */
|
|
124
|
+
uploaded: (done: number, failed: number) => string;
|
|
125
|
+
overall: string;
|
|
126
|
+
startOver: string;
|
|
127
|
+
uploading: string;
|
|
128
|
+
done: string;
|
|
129
|
+
failed: string;
|
|
130
|
+
waiting: string;
|
|
131
|
+
/** Accessible name of the file list. */
|
|
132
|
+
files: string;
|
|
133
|
+
dropToAdd: string;
|
|
134
|
+
cantAdd: string;
|
|
135
|
+
releaseToAdd: (multiple: boolean) => string;
|
|
136
|
+
/** Hint while a drag the zone cannot accept is over it, from the named accepted types ("" without `accept`). */
|
|
137
|
+
addTypes: (types: string) => string;
|
|
138
|
+
remove: (name: string) => string;
|
|
139
|
+
retry: string;
|
|
140
|
+
/** Accessible name of a row's Retry button. */
|
|
141
|
+
retryName: (name: string) => string;
|
|
142
|
+
/** The note under the zone. `types` is set only when every skipped file failed the `accept` check. */
|
|
143
|
+
skipped: (info: {
|
|
144
|
+
count: number;
|
|
145
|
+
paths: string[];
|
|
146
|
+
types: string;
|
|
147
|
+
}) => string;
|
|
148
|
+
/** Screen reader announcement when the upload starts. */
|
|
149
|
+
uploadingStatus: (count: number) => string;
|
|
150
|
+
}
|
|
151
|
+
type UploadProps = Omit<RootProps, "children" | "directory" | "title" | "onReset"> & {
|
|
152
|
+
/** The files to list, in order. The app owns this list and each item's `status` and `progress`. */
|
|
153
|
+
items: FileDropZoneUploadItem[];
|
|
154
|
+
/** Called with the `id` of the row whose Remove button was pressed. */
|
|
155
|
+
onRemove: (id: string) => void;
|
|
156
|
+
/** Called when the upload button is pressed. The app starts the upload and moves the queued items to `"uploading"`. */
|
|
157
|
+
onUpload: () => void;
|
|
158
|
+
/**
|
|
159
|
+
* Called with the `id` of a failed row whose Retry button was pressed. The app sends the file again and moves the row
|
|
160
|
+
* back to `"uploading"`. Failed rows show Retry only when this is set.
|
|
161
|
+
*/
|
|
162
|
+
onRetry?: (id: string) => void;
|
|
163
|
+
/** Called by "Start over" once every item is done or failed. The button shows only when this is set. */
|
|
164
|
+
onReset?: () => void;
|
|
165
|
+
/** Heading of the card around the zone and the list. */
|
|
166
|
+
heading?: React.ReactNode;
|
|
167
|
+
/** Title of the zone. Defaults to "Drop files or a folder", or "Drop a file" without `multiple`. */
|
|
168
|
+
title?: React.ReactNode;
|
|
169
|
+
/** Text under the zone title. Defaults to the accepted types, such as "PNG, JPEG or WebP", and a note that folders are scanned. */
|
|
170
|
+
description?: React.ReactNode;
|
|
171
|
+
/** Whether the zone takes whole folders, with a "Choose folder" button. Needs `multiple`. */
|
|
172
|
+
folders?: boolean;
|
|
173
|
+
/** Replaces any of the English texts: the button texts, the drag copy, the row states, the skipped note, the finished text. */
|
|
174
|
+
labels?: Partial<UploadLabels>;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* FileDropZone.Upload — the upload sequence in one piece: a zone, the list of collected files to check and remove, a
|
|
178
|
+
* `Progress` per row and overall once the upload runs, and the upload button. It is controlled and uploads nothing: the app
|
|
179
|
+
* keeps `items`, performs the upload, and reports each item's `status` and `progress`. Other props go to the zone.
|
|
180
|
+
*/
|
|
181
|
+
export declare function Upload({ items, onRemove, onUpload, onRetry, onReset, heading, title, description, folders, labels, size, multiple, accept, disabled, onFilesAdded, onDragStateChange, ...zoneProps }: UploadProps): import("react/jsx-runtime").JSX.Element;
|
|
182
|
+
export declare namespace Upload {
|
|
183
|
+
var displayName: string;
|
|
184
|
+
}
|
|
185
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a size such as "3.1 MB", in the unit that suits `scale` (the size itself by default). `digits` sets the decimals;
|
|
3
|
+
* by default one below ten units and none above. Bytes have none.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatBytes(bytes: number, scale?: number, digits?: number): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const logo: (props?: ({
|
|
4
|
-
size?: "sm" | "md" | "lg" | "hero" | "
|
|
4
|
+
size?: "sm" | "md" | "lg" | "hero" | "xs" | "xl" | "fit" | null | undefined;
|
|
5
5
|
variant?: "inherit" | "main" | "support" | "minor" | "brand" | "oncolor" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
type Props = Omit<React.ComponentProps<"span">, "children"> & VariantProps<typeof logo> & {
|
|
@@ -5,7 +5,7 @@ declare const toastViewport: (props?: ({
|
|
|
5
5
|
width?: "default" | "content" | "wide" | "compact" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare const toastRoot: (props?: ({
|
|
8
|
-
variant?: "warning" | "info" | "
|
|
8
|
+
variant?: "warning" | "info" | "error" | "neutral" | "success" | null | undefined;
|
|
9
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
10
|
/**
|
|
11
11
|
* Toast.useToastManager — reads the queue and the add/close/update/promise
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { ColorSchemeToggle, colorSchemeToggleMeta } from './components/color-sch
|
|
|
9
9
|
export { Combobox, comboboxMeta } from './components/combobox';
|
|
10
10
|
export { Field, fieldMeta } from './components/field';
|
|
11
11
|
export { Fieldset, fieldsetMeta } from './components/fieldset';
|
|
12
|
+
export { FileDropZone, fileDropZoneMeta } from './components/file-drop-zone';
|
|
13
|
+
export type { FileDropZoneItem, FileDropZoneUploadItem } from './components/file-drop-zone';
|
|
12
14
|
export { Input, inputMeta } from './components/input';
|
|
13
15
|
export { NumberField, numberFieldMeta } from './components/number-field';
|
|
14
16
|
export { Select, selectMeta } from './components/select';
|