filecove 0.0.0-stage → 0.2.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +65 -2
- package/THIRD_PARTY_NOTICES.md +63 -0
- package/dist/components/buttons/toolbar-actions.d.ts +28 -0
- package/dist/components/buttons/tooltip-icon-button.d.ts +14 -0
- package/dist/components/downloads/download-panel.d.ts +23 -0
- package/dist/components/drag/drag-preview.d.ts +24 -0
- package/dist/components/file-manager/announcer.d.ts +14 -0
- package/dist/components/file-manager/content/file-grid.d.ts +8 -0
- package/dist/components/file-manager/content/file-list.d.ts +9 -0
- package/dist/components/file-manager/content/folder-view.d.ts +83 -0
- package/dist/components/file-manager/content/item-icon.d.ts +16 -0
- package/dist/components/file-manager/content/no-sections.d.ts +11 -0
- package/dist/components/file-manager/content/search-results.d.ts +40 -0
- package/dist/components/file-manager/content/search-tabs.d.ts +29 -0
- package/dist/components/file-manager/content/trash-bar.d.ts +13 -0
- package/dist/components/file-manager/context-menu/context-menu.d.ts +20 -0
- package/dist/components/file-manager/dialogs/conflict-step.d.ts +28 -0
- package/dist/components/file-manager/dialogs/delete-dialog.d.ts +49 -0
- package/dist/components/file-manager/dialogs/image-viewer.d.ts +42 -0
- package/dist/components/file-manager/dialogs/name-dialog.d.ts +41 -0
- package/dist/components/file-manager/dialogs/paste-dialog.d.ts +39 -0
- package/dist/components/file-manager/dialogs/preview-dialog.d.ts +75 -0
- package/dist/components/file-manager/dialogs/restore-dialog.d.ts +41 -0
- package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +36 -0
- package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +71 -0
- package/dist/components/file-manager/dialogs/upload-dialog.d.ts +34 -0
- package/dist/components/file-manager/file-manager.d.ts +320 -0
- package/dist/components/file-manager/find-layer.d.ts +29 -0
- package/dist/components/file-manager/header-bar/header-bar.d.ts +65 -0
- package/dist/components/file-manager/header-bar/history-menu.d.ts +18 -0
- package/dist/components/file-manager/header-bar/path-bar.d.ts +19 -0
- package/dist/components/file-manager/header-bar/path-field.d.ts +23 -0
- package/dist/components/file-manager/header-bar/search-field.d.ts +27 -0
- package/dist/components/file-manager/header-bar/search-sections-menu.d.ts +25 -0
- package/dist/components/file-manager/header-bar/view-menu.d.ts +39 -0
- package/dist/components/file-manager/notice-bar.d.ts +36 -0
- package/dist/components/file-manager/properties-pane.d.ts +53 -0
- package/dist/components/file-manager/resize-edge.d.ts +39 -0
- package/dist/components/file-manager/selection-bar.d.ts +15 -0
- package/dist/components/file-manager/sidebar/location-item.d.ts +36 -0
- package/dist/components/file-manager/sidebar/main-menu.d.ts +23 -0
- package/dist/components/file-manager/sidebar/sidebar.d.ts +80 -0
- package/dist/components/icons/check-badge.d.ts +3 -0
- package/dist/components/icons/create-icon.d.ts +20 -0
- package/dist/components/icons/file-icon.d.ts +19 -0
- package/dist/components/icons/icon-provider.d.ts +21 -0
- package/dist/components/icons/icon-slot.d.ts +6 -0
- package/dist/components/icons/icon.d.ts +19 -0
- package/dist/components/icons/locked-icon.d.ts +9 -0
- package/dist/components/media-manager/asset-delete.d.ts +29 -0
- package/dist/components/media-manager/asset-hold.d.ts +32 -0
- package/dist/components/media-manager/asset-option.d.ts +74 -0
- package/dist/components/media-manager/asset-trail.d.ts +13 -0
- package/dist/components/media-manager/choice-list.d.ts +29 -0
- package/dist/components/media-manager/choices-pane.d.ts +50 -0
- package/dist/components/media-manager/choose-bar.d.ts +26 -0
- package/dist/components/media-manager/drop-zone.d.ts +7 -0
- package/dist/components/media-manager/group-check.d.ts +13 -0
- package/dist/components/media-manager/group-create.d.ts +20 -0
- package/dist/components/media-manager/group-path.d.ts +24 -0
- package/dist/components/media-manager/library-list.d.ts +23 -0
- package/dist/components/media-manager/media-asset.d.ts +65 -0
- package/dist/components/media-manager/media-edit-many.d.ts +33 -0
- package/dist/components/media-manager/media-fields.d.ts +31 -0
- package/dist/components/media-manager/media-filter-chips.d.ts +17 -0
- package/dist/components/media-manager/media-filters-dialog.d.ts +39 -0
- package/dist/components/media-manager/media-filters.d.ts +37 -0
- package/dist/components/media-manager/media-form.d.ts +29 -0
- package/dist/components/media-manager/media-frame.d.ts +77 -0
- package/dist/components/media-manager/media-grid.d.ts +114 -0
- package/dist/components/media-manager/media-group.d.ts +29 -0
- package/dist/components/media-manager/media-header.d.ts +80 -0
- package/dist/components/media-manager/media-manager.d.ts +309 -0
- package/dist/components/media-manager/media-move.d.ts +30 -0
- package/dist/components/media-manager/media-picker.d.ts +140 -0
- package/dist/components/media-manager/media-picture.d.ts +26 -0
- package/dist/components/media-manager/media-process.d.ts +26 -0
- package/dist/components/media-manager/media-row.d.ts +13 -0
- package/dist/components/media-manager/media-step.d.ts +33 -0
- package/dist/components/media-manager/media-tile.d.ts +15 -0
- package/dist/components/media-manager/media-upload.d.ts +46 -0
- package/dist/components/media-manager/open-button.d.ts +15 -0
- package/dist/components/media-manager/picker-frame.d.ts +33 -0
- package/dist/components/media-manager/selection-bar.d.ts +25 -0
- package/dist/components/media-manager/upload-tile.d.ts +17 -0
- package/dist/components/properties/properties-panel.d.ts +53 -0
- package/dist/components/properties/property-display.d.ts +15 -0
- package/dist/components/properties/property-editor.d.ts +26 -0
- package/dist/components/properties/property-input.d.ts +36 -0
- package/dist/components/transfers/transfer-panel.d.ts +25 -0
- package/dist/components/ui/backdrop.d.ts +7 -0
- package/dist/components/ui/button-base.d.ts +7 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/checkbox.d.ts +24 -0
- package/dist/components/ui/chip.d.ts +18 -0
- package/dist/components/ui/circular-progress.d.ts +14 -0
- package/dist/components/ui/collapse.d.ts +9 -0
- package/dist/components/ui/dialog.d.ts +40 -0
- package/dist/components/ui/divider.d.ts +4 -0
- package/dist/components/ui/icon-button.d.ts +12 -0
- package/dist/components/ui/linear-progress.d.ts +13 -0
- package/dist/components/ui/link.d.ts +4 -0
- package/dist/components/ui/menu.d.ts +77 -0
- package/dist/components/ui/root-providers.d.ts +16 -0
- package/dist/components/ui/text-field.d.ts +38 -0
- package/dist/components/ui/text.d.ts +21 -0
- package/dist/components/ui/tooltip.d.ts +24 -0
- package/dist/components/uploads/upload-panel.d.ts +31 -0
- package/dist/contexts/asset-look-context.d.ts +1 -0
- package/dist/contexts/cut-context.d.ts +6 -0
- package/dist/contexts/data-context.d.ts +12 -0
- package/dist/contexts/direction-context.d.ts +2 -0
- package/dist/contexts/drag-context.d.ts +36 -0
- package/dist/contexts/icon-context.d.ts +10 -0
- package/dist/contexts/locale-context.d.ts +2 -0
- package/dist/contexts/moving-context.d.ts +7 -0
- package/dist/create-icon-D2vnnBQX.js +40 -0
- package/dist/create-icon-D2vnnBQX.js.map +1 -0
- package/dist/hooks/use-announcer.d.ts +20 -0
- package/dist/hooks/use-asset-look.d.ts +6 -0
- package/dist/hooks/use-asset-states.d.ts +12 -0
- package/dist/hooks/use-chosen-column.d.ts +16 -0
- package/dist/hooks/use-clipboard-follow.d.ts +12 -0
- package/dist/hooks/use-controlled.d.ts +18 -0
- package/dist/hooks/use-cut-ids.d.ts +3 -0
- package/dist/hooks/use-dev-checks.d.ts +16 -0
- package/dist/hooks/use-download-queue.d.ts +19 -0
- package/dist/hooks/use-dragged-ids.d.ts +3 -0
- package/dist/hooks/use-drop-target.d.ts +48 -0
- package/dist/hooks/use-entry-drag.d.ts +46 -0
- package/dist/hooks/use-files-drop.d.ts +20 -0
- package/dist/hooks/use-folder.d.ts +14 -0
- package/dist/hooks/use-fork-ref.d.ts +6 -0
- package/dist/hooks/use-form-send.d.ts +12 -0
- package/dist/hooks/use-found.d.ts +10 -0
- package/dist/hooks/use-icon-config.d.ts +2 -0
- package/dist/hooks/use-level-filters.d.ts +112 -0
- package/dist/hooks/use-level-search.d.ts +21 -0
- package/dist/hooks/use-locale.d.ts +10 -0
- package/dist/hooks/use-location-history.d.ts +42 -0
- package/dist/hooks/use-long-press.d.ts +25 -0
- package/dist/hooks/use-marquee.d.ts +35 -0
- package/dist/hooks/use-match-count.d.ts +8 -0
- package/dist/hooks/use-media-search.d.ts +44 -0
- package/dist/hooks/use-moving-ids.d.ts +3 -0
- package/dist/hooks/use-picks.d.ts +39 -0
- package/dist/hooks/use-preview-contents.d.ts +33 -0
- package/dist/hooks/use-properties.d.ts +25 -0
- package/dist/hooks/use-scroll-measure.d.ts +34 -0
- package/dist/hooks/use-search.d.ts +12 -0
- package/dist/hooks/use-selection.d.ts +29 -0
- package/dist/hooks/use-setting.d.ts +21 -0
- package/dist/hooks/use-stable-set.d.ts +6 -0
- package/dist/hooks/use-swipe.d.ts +41 -0
- package/dist/hooks/use-text-direction.d.ts +8 -0
- package/dist/hooks/use-thumbnail.d.ts +8 -0
- package/dist/hooks/use-transfer-queue.d.ts +22 -0
- package/dist/hooks/use-tree-rows.d.ts +9 -0
- package/dist/hooks/use-tree-selection.d.ts +19 -0
- package/dist/hooks/use-type-ahead.d.ts +9 -0
- package/dist/hooks/use-type-icons.d.ts +10 -0
- package/dist/hooks/use-upload-queue.d.ts +24 -0
- package/dist/hooks/use-virtual-lines.d.ts +27 -0
- package/dist/hooks/use-virtual-rows.d.ts +31 -0
- package/dist/hooks/use-wheel-zoom.d.ts +10 -0
- package/dist/icon-sets/filled.d.ts +6 -0
- package/dist/icon-sets/filled.js +76 -0
- package/dist/icon-sets/filled.js.map +1 -0
- package/dist/icon-sets/outlined.d.ts +6 -0
- package/dist/icon-sets/outlined.js +73 -0
- package/dist/icon-sets/outlined.js.map +1 -0
- package/dist/icon-sets/rounded.d.ts +6 -0
- package/dist/icon-sets/rounded.js +73 -0
- package/dist/icon-sets/rounded.js.map +1 -0
- package/dist/icon-sets/sharp.d.ts +6 -0
- package/dist/icon-sets/sharp.js +73 -0
- package/dist/icon-sets/sharp.js.map +1 -0
- package/dist/icon-sets/two-tone.d.ts +6 -0
- package/dist/icon-sets/two-tone.js +188 -0
- package/dist/icon-sets/two-tone.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +32651 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/en-us.d.ts +7 -0
- package/dist/store/download-queue.d.ts +37 -0
- package/dist/store/folder-store.d.ts +79 -0
- package/dist/store/keyboard-layout.d.ts +11 -0
- package/dist/store/properties-cache.d.ts +73 -0
- package/dist/store/thumbnail-cache.d.ts +30 -0
- package/dist/store/transfer-across.d.ts +24 -0
- package/dist/store/transfer-queue.d.ts +59 -0
- package/dist/store/upload-queue.d.ts +83 -0
- package/dist/styles/arrived.d.ts +6 -0
- package/dist/styles/classes.d.ts +212 -0
- package/dist/styles/layout.d.ts +55 -0
- package/dist/styles/media-layout.d.ts +36 -0
- package/dist/styles/order.d.ts +1 -0
- package/dist/styles.css +7632 -0
- package/dist/styles.layer.css +7634 -0
- package/dist/types/action.d.ts +296 -0
- package/dist/types/adapter.d.ts +922 -0
- package/dist/types/api.d.ts +192 -0
- package/dist/types/clipboard.d.ts +45 -0
- package/dist/types/download.d.ts +41 -0
- package/dist/types/drag.d.ts +57 -0
- package/dist/types/folder.d.ts +47 -0
- package/dist/types/icon.d.ts +20 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/limits.d.ts +49 -0
- package/dist/types/locale.d.ts +1132 -0
- package/dist/types/main-menu.d.ts +20 -0
- package/dist/types/media.d.ts +631 -0
- package/dist/types/menu.d.ts +82 -0
- package/dist/types/navigation.d.ts +88 -0
- package/dist/types/preview.d.ts +54 -0
- package/dist/types/previewer.d.ts +67 -0
- package/dist/types/properties.d.ts +111 -0
- package/dist/types/property-definition.d.ts +286 -0
- package/dist/types/search.d.ts +46 -0
- package/dist/types/section.d.ts +98 -0
- package/dist/types/selection.d.ts +52 -0
- package/dist/types/slots.d.ts +218 -0
- package/dist/types/transfer.d.ts +68 -0
- package/dist/types/tree.d.ts +97 -0
- package/dist/types/undo.d.ts +133 -0
- package/dist/types/upload.d.ts +189 -0
- package/dist/types/view.d.ts +192 -0
- package/dist/utils/action-groups.d.ts +17 -0
- package/dist/utils/bidi.d.ts +15 -0
- package/dist/utils/clipboard.d.ts +30 -0
- package/dist/utils/cx.d.ts +2 -0
- package/dist/utils/dom.d.ts +36 -0
- package/dist/utils/download.d.ts +30 -0
- package/dist/utils/field-errors.d.ts +26 -0
- package/dist/utils/files.d.ts +48 -0
- package/dist/utils/format.d.ts +10 -0
- package/dist/utils/groups.d.ts +29 -0
- package/dist/utils/hidden.d.ts +3 -0
- package/dist/utils/keyboard.d.ts +21 -0
- package/dist/utils/limits.d.ts +7 -0
- package/dist/utils/media.d.ts +146 -0
- package/dist/utils/menu-position.d.ts +13 -0
- package/dist/utils/names.d.ts +21 -0
- package/dist/utils/navigation.d.ts +28 -0
- package/dist/utils/path.d.ts +33 -0
- package/dist/utils/permissions.d.ts +56 -0
- package/dist/utils/preview.d.ts +27 -0
- package/dist/utils/property-value.d.ts +41 -0
- package/dist/utils/resize.d.ts +2 -0
- package/dist/utils/search.d.ts +24 -0
- package/dist/utils/sections.d.ts +11 -0
- package/dist/utils/selection.d.ts +30 -0
- package/dist/utils/sets.d.ts +2 -0
- package/dist/utils/shortcut.d.ts +74 -0
- package/dist/utils/slots.d.ts +15 -0
- package/dist/utils/sort.d.ts +47 -0
- package/dist/utils/transfer.d.ts +48 -0
- package/dist/utils/trash.d.ts +25 -0
- package/dist/utils/undo.d.ts +63 -0
- package/dist/utils/zoom.d.ts +14 -0
- package/docs/README.md +55 -0
- package/docs/actions.md +301 -0
- package/docs/adapter.md +229 -0
- package/docs/copy-move-trash-undo.md +97 -0
- package/docs/customizing.md +247 -0
- package/docs/getting-started.md +168 -0
- package/docs/locale-and-rtl.md +58 -0
- package/docs/media-manager.md +498 -0
- package/docs/previewing.md +124 -0
- package/docs/properties.md +125 -0
- package/docs/recipes/in-memory-adapter.md +149 -0
- package/docs/recipes/rest-adapter.md +225 -0
- package/docs/recipes/s3-adapter.md +137 -0
- package/docs/search.md +73 -0
- package/docs/sections.md +119 -0
- package/docs/state-and-api.md +190 -0
- package/docs/uploads-and-downloads.md +144 -0
- package/package.json +90 -4
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface MediaStepProps {
|
|
3
|
+
title: string;
|
|
4
|
+
/** The back button's name. */
|
|
5
|
+
backLabel: string;
|
|
6
|
+
/** Back, or Escape. */
|
|
7
|
+
onBack: () => void;
|
|
8
|
+
/** Its buttons, at its foot. */
|
|
9
|
+
footer: ReactNode;
|
|
10
|
+
/** Why its main button is held back, beside them. */
|
|
11
|
+
note?: string;
|
|
12
|
+
/** The note's id, which that button is described by. */
|
|
13
|
+
noteId?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface StepSendProps {
|
|
17
|
+
/** While it's being sent, or its form isn't ready. */
|
|
18
|
+
held: boolean;
|
|
19
|
+
/** The note saying why, when there's one. */
|
|
20
|
+
describedBy: string | undefined;
|
|
21
|
+
onClick: () => void;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/** A step's main button, held back while it's being sent or its form isn't ready. */
|
|
25
|
+
export declare const StepSend: ({ held, describedBy, onClick, children }: StepSendProps) => import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* A step in the library's place, as a picker is often in the app's own dialog already: back, a title,
|
|
28
|
+
* a column of a form's width and its buttons at the foot. It takes the focus as it opens, so it's read
|
|
29
|
+
* out by its title, and Escape goes back. In a form's fields Escape only leaves them, the step taking
|
|
30
|
+
* the focus, and a second goes back, as going back loses what's been filled in.
|
|
31
|
+
*/
|
|
32
|
+
declare const MediaStep: ({ title, backLabel, onBack, footer, note, noteId, children }: MediaStepProps) => import("react").JSX.Element;
|
|
33
|
+
export default MediaStep;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MediaAssetLookProps } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* How the media manager draws an asset of a library of tiles, for an app's `renderAsset` to change a
|
|
4
|
+
* little: `<MediaTile {...params} detail={params.asset.meta?.show} />`. Its picture or icon in the
|
|
5
|
+
* kind's shape, with a video's or a piece of audio's length over it, and its name, with a picture's
|
|
6
|
+
* or a video's dimensions, or a document's or a piece of audio's size, under it, or in their place why it can't be chosen now, with a bar on the picture
|
|
7
|
+
* while it's processed. Its look only: what makes it an asset to select, its check and its Open
|
|
8
|
+
* button stay the media manager's, around it, so it's only drawn inside `renderAsset`. A group, an
|
|
9
|
+
* entry of `kind: "folder"`, is drawn as one: its picture, marked as a group, or a folder's icon, and
|
|
10
|
+
* how many it holds under its name. A search's result from further down says where it is, under those.
|
|
11
|
+
* Every tile is as tall: the line under the name is kept, empty or not, and so is a trail's while the
|
|
12
|
+
* grid shows results with them.
|
|
13
|
+
*/
|
|
14
|
+
declare const MediaTile: ({ asset, kind, thumbnail, hold, trail, title, detail, badge, picture, className }: MediaAssetLookProps) => import("react").JSX.Element;
|
|
15
|
+
export default MediaTile;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FileAdapter, FileEntry, FolderUpload, MediaSection, MediaUploadCheck, MediaUploadForm, UploadPartTarget } from "../../types/index.js";
|
|
2
|
+
interface MediaUploadProps {
|
|
3
|
+
section: MediaSection;
|
|
4
|
+
/** The name of the library or group they go into, as the title says and its back button goes to. */
|
|
5
|
+
levelName: string;
|
|
6
|
+
/** The library's adapter, its own or the media manager's. */
|
|
7
|
+
adapter: FileAdapter;
|
|
8
|
+
/** What was given, as the check before sending sorted it. */
|
|
9
|
+
check: MediaUploadCheck;
|
|
10
|
+
/**
|
|
11
|
+
* What the library asks of the files given: its upload form, for them, or nothing. With folders to
|
|
12
|
+
* make groups of, the step asks the library itself once they're read, of every file they hold too.
|
|
13
|
+
*/
|
|
14
|
+
form: MediaUploadForm | null;
|
|
15
|
+
/**
|
|
16
|
+
* The asset whose file the one given is to take the place of, from its view's Replace file, as it
|
|
17
|
+
* was asked for; undefined for an upload. Its way back goes to the asset.
|
|
18
|
+
*/
|
|
19
|
+
replacing?: FileEntry;
|
|
20
|
+
/**
|
|
21
|
+
* The asset and the part of it the files given go into, from a property's Upload in its view, with
|
|
22
|
+
* the types the part takes (`PropertyUpload.accept`); undefined for an upload. Its way back goes to
|
|
23
|
+
* the asset.
|
|
24
|
+
*/
|
|
25
|
+
intoPart?: UploadPartTarget & {
|
|
26
|
+
accept?: string;
|
|
27
|
+
};
|
|
28
|
+
onCancel: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Sends the files, with what the upload form holds, with no form nothing, and the folders to make
|
|
31
|
+
* groups of, as read, those that couldn't be or hold nothing the library takes left out.
|
|
32
|
+
*/
|
|
33
|
+
onUpload: (values: Readonly<Record<string, unknown>> | undefined, groups: FolderUpload[]) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The step before files are uploaded into a library, in its place, as the asset view is: what's
|
|
37
|
+
* about to go, what's left out and why, and the library's upload form for them, with Cancel and
|
|
38
|
+
* Upload, held back while the form isn't ready and while its `validate` is answered, which refusing keeps
|
|
39
|
+
* this open, saying why; or, with nothing left to send, why, with Close. Shown only when there's
|
|
40
|
+
* something to ask or to say, and always for folders, which it reads first, saying what groups they
|
|
41
|
+
* make, as the upload form is asked of every file they hold. Before a file is put in an asset's place
|
|
42
|
+
* (`replacing`), the same over the asset's view, with Replace; before files go into a part of an asset
|
|
43
|
+
* (`intoPart`), the same over its view, with the part's own form and the types it takes.
|
|
44
|
+
*/
|
|
45
|
+
declare const MediaUpload: ({ section, levelName, adapter, check, form, replacing, intoPart, onCancel, onUpload, }: MediaUploadProps) => import("react").JSX.Element;
|
|
46
|
+
export default MediaUpload;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface OpenButtonProps {
|
|
2
|
+
name: string;
|
|
3
|
+
/** Whether it's a group's, opening its details. */
|
|
4
|
+
group: boolean;
|
|
5
|
+
index: number;
|
|
6
|
+
onOpen: (index: number) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A tile's or a row's button opening its asset in the library's place. Out of the Tab order and
|
|
11
|
+
* hidden from screen readers, as the file manager's ⋮ is, since Alt+Enter on the asset does the
|
|
12
|
+
* same; a click on it neither selects nor chooses.
|
|
13
|
+
*/
|
|
14
|
+
declare const OpenButton: ({ name, group, index, onOpen, className }: OpenButtonProps) => import("react").JSX.Element;
|
|
15
|
+
export default OpenButton;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FileAdapter, FileEntry, MediaChoice, MediaFiltersVariant, MediaPickerValue, MediaPickForm, MediaPickerSlotProps, MediaPickerSlots, MediaSection } from "../../types/index.js";
|
|
2
|
+
export interface PickerFrameProps {
|
|
3
|
+
section: MediaSection;
|
|
4
|
+
adapter: FileAdapter;
|
|
5
|
+
onChoose: ((choices: MediaChoice[]) => void) | undefined;
|
|
6
|
+
pickForm: ((asset: FileEntry, section: MediaSection) => MediaPickForm | null) | undefined;
|
|
7
|
+
onCancel: (() => void) | undefined;
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
maxChoices: number | undefined;
|
|
10
|
+
/** Whether an asset or group can be added beside those already picked, for this use. */
|
|
11
|
+
canSelect: ((asset: FileEntry, section: MediaSection, choices: readonly MediaChoice[], trail: readonly FileEntry[] | undefined) => boolean | string) | undefined;
|
|
12
|
+
/** Whether groups can be selected as well as assets. */
|
|
13
|
+
selectGroups: boolean;
|
|
14
|
+
allowUpload: boolean;
|
|
15
|
+
/** Whether New group is offered, where the library makes groups. */
|
|
16
|
+
allowCreateGroups: boolean;
|
|
17
|
+
/** How the library's filters show, where its form doesn't say (`MediaFilterForm.variant`). */
|
|
18
|
+
filtersVariant: MediaFiltersVariant;
|
|
19
|
+
value: readonly MediaPickerValue[] | undefined;
|
|
20
|
+
defaultValue: readonly MediaPickerValue[] | undefined;
|
|
21
|
+
onChange: ((choices: MediaChoice[]) => void) | undefined;
|
|
22
|
+
/** Uploads at once, from `limits`, or the queue's default. */
|
|
23
|
+
uploadLimit: number | undefined;
|
|
24
|
+
/** How long the typing stops before the adapter's `search` is asked, from `limits`, or the default. */
|
|
25
|
+
searchDelay: number | undefined;
|
|
26
|
+
/** The app's own states, drawn in their boxes in place of the picker's (`slots`). */
|
|
27
|
+
slots: MediaPickerSlots;
|
|
28
|
+
/** The app's attributes for the picker's parts (`slotProps`). */
|
|
29
|
+
slotProps: MediaPickerSlotProps;
|
|
30
|
+
}
|
|
31
|
+
/** Everything inside the picker's root, below the contexts it provides. */
|
|
32
|
+
declare const PickerFrame: ({ section, adapter, onChoose, pickForm, onCancel, multiple, maxChoices, canSelect, selectGroups, allowUpload, allowCreateGroups, filtersVariant, value, defaultValue, onChange, uploadLimit, searchDelay, slots, slotProps, }: PickerFrameProps) => import("react").JSX.Element;
|
|
33
|
+
export default PickerFrame;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
interface SelectionBarProps {
|
|
3
|
+
/** How many of those shown are selected. */
|
|
4
|
+
count: number;
|
|
5
|
+
onClear: () => void;
|
|
6
|
+
/** Selects everything shown; missing once it is. */
|
|
7
|
+
onSelectAll: (() => void) | undefined;
|
|
8
|
+
/** Opens Edit fields for them; missing while they share no field that can be changed. */
|
|
9
|
+
onEditFields: (() => void) | undefined;
|
|
10
|
+
/** Asks where they go; missing while they can't all be moved. */
|
|
11
|
+
onMove: (() => void) | undefined;
|
|
12
|
+
/** Asks before deleting them; missing while they can't all be deleted. */
|
|
13
|
+
onDelete: (() => void) | undefined;
|
|
14
|
+
/** The buttons the focus goes back to as what they opened closes. */
|
|
15
|
+
editRef: Ref<HTMLButtonElement>;
|
|
16
|
+
moveRef: Ref<HTMLButtonElement>;
|
|
17
|
+
deleteRef: Ref<HTMLButtonElement>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* At the library's foot while the media manager is browsing and something shown is selected, as a web
|
|
21
|
+
* drive's selection toolbar is: Clear selection, how many, Select all, Edit fields…, Move to… and
|
|
22
|
+
* Delete, each as it can be done. Not while it takes picks, whose selected column and choose bar are what's selected for.
|
|
23
|
+
*/
|
|
24
|
+
declare const SelectionBar: ({ count, onClear, onSelectAll, onEditFields, onMove, onDelete, editRef, moveRef, deleteRef, }: SelectionBarProps) => import("react").JSX.Element;
|
|
25
|
+
export default SelectionBar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MediaKind, MediaLayout, UploadItem } from "../../types/index.js";
|
|
2
|
+
interface UploadTileProps {
|
|
3
|
+
/** A file being uploaded, or a folder being made a group, until the group is listed. */
|
|
4
|
+
item: UploadItem;
|
|
5
|
+
/** The library's kind, whose tiles' shape it takes. */
|
|
6
|
+
kind: MediaKind;
|
|
7
|
+
/** How the library shows its assets: as tiles, or as rows. */
|
|
8
|
+
layout: MediaLayout;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A file being uploaded into the open library, shown before its assets as they are, as a tile of the
|
|
12
|
+
* library's shape or a row: the picture itself when it's one, else its icon, faded, with how far
|
|
13
|
+
* it's got; or a folder being made a group, by a folder's icon, until the group is listed. It's no
|
|
14
|
+
* asset yet, so it can't be selected or opened; the upload panel cancels it.
|
|
15
|
+
*/
|
|
16
|
+
declare const UploadTile: ({ item, kind, layout }: UploadTileProps) => import("react").JSX.Element;
|
|
17
|
+
export default UploadTile;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { PropertiesCache } from "../../store/properties-cache.js";
|
|
2
|
+
import type { PartUploads, PropertiesItem, PropertyDefinitionGroup, SlotAttributes, ToolbarGroup } from "../../types/index.js";
|
|
3
|
+
interface PropertiesPanelProps {
|
|
4
|
+
/** What it shows: one entry, several, or none, which asks for something to be selected. */
|
|
5
|
+
items: readonly PropertiesItem[];
|
|
6
|
+
/** The host's count of its changes, which counts what's in folders again once it settles. */
|
|
7
|
+
changes: number;
|
|
8
|
+
/** Whether the host shows hidden files, which `measure` is told. */
|
|
9
|
+
showHidden: boolean;
|
|
10
|
+
/** Where what the adapters hand over is kept, to outlive the panel; one of its own without it. */
|
|
11
|
+
cache?: PropertiesCache;
|
|
12
|
+
/** Takes the focus as it's set, or as it mounts with it set. */
|
|
13
|
+
takeFocus?: boolean;
|
|
14
|
+
/** The host's actions for what it shows, in its header. */
|
|
15
|
+
actions?: readonly ToolbarGroup[];
|
|
16
|
+
/**
|
|
17
|
+
* Shown inside a host's own view of one entry, which has its picture, its name and a way back
|
|
18
|
+
* already, as the media manager's asset view does: no header, picture or name of its own.
|
|
19
|
+
*/
|
|
20
|
+
embedded?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether it shows its own rows, the type, size, location, dates and dimensions, before the
|
|
23
|
+
* backend's groups. The media manager leaves them out, as what an asset shows is the app's.
|
|
24
|
+
*/
|
|
25
|
+
ownRows?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The app's own definitions of what one entry shows, in groups, in place of the backend's own
|
|
28
|
+
* groups: each property read from the `values` the adapter's `properties` hands over by its
|
|
29
|
+
* `field`, or from the entry itself, and shown, edited and saved as its type, its kind and its
|
|
30
|
+
* functions say. Without them, the backend's groups show as the adapter describes them.
|
|
31
|
+
*/
|
|
32
|
+
definitions?: readonly PropertyDefinitionGroup[];
|
|
33
|
+
/**
|
|
34
|
+
* Uploading into the parts of the one entry it shows, for the definitions that say they take files
|
|
35
|
+
* (`PropertyDefinition.upload`): their Upload buttons, and the files being sent listed under them.
|
|
36
|
+
* The media manager's asset view hands it over for an asset whose library can take them.
|
|
37
|
+
*/
|
|
38
|
+
parts?: PartUploads;
|
|
39
|
+
/** Closes the panel, from its header's ✕; not shown while `embedded`. */
|
|
40
|
+
onClose?: () => void;
|
|
41
|
+
/** The host app's attributes for the panel (the file manager's `slotProps.properties`). */
|
|
42
|
+
attributes?: SlotAttributes;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* An entry's properties, or several entries' together: its picture and name, what the listing
|
|
46
|
+
* says of it (type, size or contents, location, dates, dimensions, length), and what its adapter
|
|
47
|
+
* adds, the fuller entry and properties of the backend's own (`properties`), and what's in folders
|
|
48
|
+
* (`measure`), with the host's actions for it in the header. The backend's fields it marks editable
|
|
49
|
+
* are changed in place and saved (`updateProperties`). It knows nothing of where it's shown, so it
|
|
50
|
+
* can sit beside any view of files, and has its own live region, saying what was copied or saved.
|
|
51
|
+
*/
|
|
52
|
+
declare const PropertiesPanel: ({ items, changes, showHidden, cache: given, takeFocus, actions, embedded, ownRows, definitions, parts, onClose, attributes, }: PropertiesPanelProps) => import("react").JSX.Element;
|
|
53
|
+
export default PropertiesPanel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PropertyDefinition } from "../../types/index.js";
|
|
2
|
+
export interface PropertyDisplayProps {
|
|
3
|
+
definition: PropertyDefinition;
|
|
4
|
+
value: unknown;
|
|
5
|
+
/** Its text, as `formatValue` writes it. */
|
|
6
|
+
formattedValue: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A property of the app's definition shown as its type has it: its text, a list as chips, an
|
|
10
|
+
* address as a link. One with a `valueFormatter` is its text, as the app wrote it. Public, so a
|
|
11
|
+
* property's `render` adding a little to how it's shown needn't draw it again:
|
|
12
|
+
* `<PropertyDisplay {...params} />`.
|
|
13
|
+
*/
|
|
14
|
+
declare const PropertyDisplay: ({ definition, value, formattedValue }: PropertyDisplayProps) => import("react").JSX.Element;
|
|
15
|
+
export default PropertyDisplay;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FileAdapter, FileEntry, PropertyDefinition, PropertySave } from "../../types/index.js";
|
|
2
|
+
interface PropertyEditorProps {
|
|
3
|
+
definition: PropertyDefinition;
|
|
4
|
+
/** The property's value, which editing starts from unless a save of it failed. */
|
|
5
|
+
value: unknown;
|
|
6
|
+
entry: FileEntry;
|
|
7
|
+
adapter: FileAdapter;
|
|
8
|
+
/** Its edit being saved, or that failed, kept by the cache, whose value it starts from. */
|
|
9
|
+
save?: PropertySave;
|
|
10
|
+
/** The element naming the property, its row's label. */
|
|
11
|
+
labelId: string;
|
|
12
|
+
/** Takes the focus as it mounts, opened by its Edit button rather than shown again after a failed save. */
|
|
13
|
+
takeFocus: boolean;
|
|
14
|
+
onSave: (value: unknown) => void;
|
|
15
|
+
/** Leaves the property as it was, also as the value saved is what it was. */
|
|
16
|
+
onCancel: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A property being changed in the properties: by the app's own editor (`renderEdit`), or the
|
|
20
|
+
* built-in one of its type (text, a number, a date, a select, chips), with Cancel and Save. Enter
|
|
21
|
+
* saves (Ctrl+Enter or ⌘Enter over several lines), Escape cancels, and the focus leaving it saves
|
|
22
|
+
* what changed, as a details panel on the web does. While it's saved it can't be changed, and
|
|
23
|
+
* should that fail, the adapter's message shows under it, with what was given kept to try again.
|
|
24
|
+
*/
|
|
25
|
+
declare const PropertyEditor: ({ definition, value, entry, adapter, save, labelId, takeFocus, onSave, onCancel, }: PropertyEditorProps) => import("react").JSX.Element;
|
|
26
|
+
export default PropertyEditor;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import type { PropertyDefinition } from "../../types/index.js";
|
|
3
|
+
/** What an editor asks of its input as it saves: the value, with anything typed but not added yet. */
|
|
4
|
+
export interface PropertyInputHandle {
|
|
5
|
+
flush: () => unknown;
|
|
6
|
+
}
|
|
7
|
+
interface PropertyInputProps {
|
|
8
|
+
definition: PropertyDefinition;
|
|
9
|
+
value: unknown;
|
|
10
|
+
onChange: (value: unknown) => void;
|
|
11
|
+
/** The control's id, which a label may be for. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** The element naming it, its label. */
|
|
14
|
+
labelId: string;
|
|
15
|
+
/** While it's saved: shown, but not changed. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* With `disabled`, off for now, as a form says, rather than only while it's saved: a text field
|
|
19
|
+
* looks it too, rather than being read-only with the focus kept in it.
|
|
20
|
+
*/
|
|
21
|
+
off?: boolean;
|
|
22
|
+
/** Its save failed, or it has an error the host shows. */
|
|
23
|
+
error?: boolean;
|
|
24
|
+
/** The element saying what's wrong with it, while there's something. */
|
|
25
|
+
describedBy?: string;
|
|
26
|
+
/** Given what an editor needs to save a list with something typed but not added yet. */
|
|
27
|
+
handle?: Ref<PropertyInputHandle>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The built-in control for a property of the app's definition, by its type: text, a URL, a number,
|
|
31
|
+
* a date, a checkbox, a select from its options, chips chosen from them or typed in for a list. A
|
|
32
|
+
* number of a kind that's only written out (size, duration), or a property with no type, has none.
|
|
33
|
+
* Its label is the host's, which names it through `labelId`.
|
|
34
|
+
*/
|
|
35
|
+
declare const PropertyInput: (props: PropertyInputProps) => import("react").JSX.Element | null;
|
|
36
|
+
export default PropertyInput;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TransferItem } from "../../types/index.js";
|
|
2
|
+
interface TransferPanelProps {
|
|
3
|
+
/** The copies and moves to show, in the order asked for. */
|
|
4
|
+
items: TransferItem[];
|
|
5
|
+
onCancel: (id: number) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Tries a failed copy or move again. Offered on the failed rows that `canRetry` takes, every one
|
|
8
|
+
* of them without it.
|
|
9
|
+
*/
|
|
10
|
+
onRetry: (item: TransferItem) => void;
|
|
11
|
+
canRetry?: (item: TransferItem) => boolean;
|
|
12
|
+
/** Cancels every copy and move waiting or under way. */
|
|
13
|
+
onCancelAll: () => void;
|
|
14
|
+
/** Forgets every failed copy and move. */
|
|
15
|
+
onClear: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Copies and moves that have taken a moment, or failed: a summary that can fold the list away, and
|
|
19
|
+
* a row per copy or move with where it goes and how far it has got, to cancel it, or once it has
|
|
20
|
+
* failed, to try it again. One that's done leaves, and the panel goes once none is left. It knows
|
|
21
|
+
* nothing of where it's shown, so it can sit under any view of files. The close button cancels
|
|
22
|
+
* whatever is still under way, and once nothing is, forgets the rest.
|
|
23
|
+
*/
|
|
24
|
+
declare const TransferPanel: ({ items, onCancel, onRetry, canRetry, onCancelAll, onClear }: TransferPanelProps) => import("react").JSX.Element;
|
|
25
|
+
export default TransferPanel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
interface BackdropProps extends ComponentProps<"div"> {
|
|
3
|
+
open: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** The dim layer behind an overlay, which a press on closes. It stays mounted, hidden while closed. */
|
|
6
|
+
declare const Backdrop: ({ open, className, ...props }: BackdropProps) => import("react").JSX.Element;
|
|
7
|
+
export default Backdrop;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A `button` with none of the browser's look, for a part to style with its own `className`. It's
|
|
4
|
+
* never a form's submit button unless it says so, and shows a ring on keyboard focus.
|
|
5
|
+
*/
|
|
6
|
+
declare const ButtonBase: ({ className, type, ...props }: ComponentProps<"button">) => import("react").JSX.Element;
|
|
7
|
+
export default ButtonBase;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export interface ButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
3
|
+
/** Plain text unless it's `outlined`, or `contained` for the one that does the work. */
|
|
4
|
+
variant?: "text" | "outlined" | "contained";
|
|
5
|
+
/** The accent unless it's `inherit`, the colour of the text around it, or `error`. */
|
|
6
|
+
color?: "primary" | "inherit" | "error";
|
|
7
|
+
size?: "small" | "medium";
|
|
8
|
+
/** A filled button without its shadow. */
|
|
9
|
+
disableElevation?: boolean;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
startIcon?: ReactNode;
|
|
12
|
+
endIcon?: ReactNode;
|
|
13
|
+
/** Shows a spinner in the label's place and takes no press, while what it started is under way. */
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** A button with a label. Its own `className` goes last, so a part's stylesheet can change it. */
|
|
17
|
+
declare const Button: ({ variant, color, size, disableElevation, fullWidth, startIcon, endIcon, loading, disabled, className, type, children, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
18
|
+
export default Button;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
|
|
3
|
+
interface CheckMarkProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
/** Neither ticked nor unticked, as when only some of what it stands for is. */
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A checkbox's box, drawn only. In a menu the item takes the press, holds the focus and carries the
|
|
11
|
+
* role and the state, so the arrow keys keep moving through the menu.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CheckMark: ({ checked, indeterminate, className }: CheckMarkProps) => import("react").JSX.Element;
|
|
14
|
+
/** A radio button's ring, drawn only, as `CheckMark` is. */
|
|
15
|
+
export declare const RadioMark: ({ checked, className }: Omit<CheckMarkProps, "indeterminate">) => import("react").JSX.Element;
|
|
16
|
+
interface CheckboxProps extends Omit<ComponentProps<typeof BaseCheckbox.Root>, "className" | "render" | "children"> {
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A checkbox that's ticked and unticked by a press, Space included. `id` goes on its hidden input,
|
|
21
|
+
* for a `label` pointing at it, and what names or describes it (`aria-labelledby`) on the box.
|
|
22
|
+
*/
|
|
23
|
+
declare const Checkbox: ({ checked, indeterminate, className, ...props }: CheckboxProps) => import("react").JSX.Element;
|
|
24
|
+
export default Checkbox;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
interface ChipProps {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
variant?: "filled" | "outlined";
|
|
5
|
+
/** Makes the chip a button that removes it, with a ✕ after its label. */
|
|
6
|
+
onRemove?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
"aria-label"?: string;
|
|
11
|
+
onMouseDown?: MouseEventHandler<HTMLElement>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A small pill for a tag or one value among several. With `onRemove` it's a button, pressed or
|
|
15
|
+
* activated from the keyboard to remove it, its ✕ drawn only.
|
|
16
|
+
*/
|
|
17
|
+
declare const Chip: ({ label, variant, onRemove, disabled, className, ...props }: ChipProps) => import("react").JSX.Element;
|
|
18
|
+
export default Chip;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
interface CircularProgressProps extends Omit<ComponentProps<"span">, "color"> {
|
|
3
|
+
/** The ring's width and height, in px. */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** `determinate` fills the ring as far as `value` says; otherwise it turns. */
|
|
6
|
+
variant?: "indeterminate" | "determinate";
|
|
7
|
+
/** How far it is, from 0 to 100, for a `determinate` ring. */
|
|
8
|
+
value?: number;
|
|
9
|
+
/** The accent unless it's `inherit`, the colour of the text around it. */
|
|
10
|
+
color?: "primary" | "inherit";
|
|
11
|
+
}
|
|
12
|
+
/** A ring for something awaited, named for screen readers by its `aria-label`. */
|
|
13
|
+
declare const CircularProgress: ({ size, variant, value, color, className, style, ...props }: CircularProgressProps) => import("react").JSX.Element;
|
|
14
|
+
export default CircularProgress;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface CollapseProps {
|
|
3
|
+
/** Whether the content shows; it folds away by its height otherwise, and stays mounted. */
|
|
4
|
+
in: boolean;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Content that folds away and back, such as a panel's list of rows. */
|
|
8
|
+
declare const Collapse: ({ in: open, children }: CollapseProps) => import("react").JSX.Element;
|
|
9
|
+
export default Collapse;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentProps, KeyboardEventHandler, ReactNode } from "react";
|
|
2
|
+
import { Dialog as BaseDialog } from "@base-ui/react/dialog";
|
|
3
|
+
import type { TextDirection } from "../../types/index.js";
|
|
4
|
+
/** What closed a dialog: Escape, a press on the backdrop, or something else the dialog holds. */
|
|
5
|
+
export type DialogCloseReason = "escapeKeyDown" | "backdropClick" | "other";
|
|
6
|
+
interface DialogProps {
|
|
7
|
+
open: boolean;
|
|
8
|
+
/** The dialog's direction, the file manager's, since it portals to `<body>`. */
|
|
9
|
+
dir?: TextDirection;
|
|
10
|
+
/** How wide the dialog may grow; `false` leaves its width to its `className`. */
|
|
11
|
+
maxWidth?: "xs" | "sm" | "md" | "lg" | false;
|
|
12
|
+
/** As wide as `maxWidth` allows, rather than as its content. */
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
"aria-labelledby"?: string;
|
|
16
|
+
/** Leaves the focus where it is as the dialog closes, for a part that places it itself. */
|
|
17
|
+
disableRestoreFocus?: boolean;
|
|
18
|
+
onClose: (reason: DialogCloseReason) => void;
|
|
19
|
+
/** Called once the dialog has faded in, when the part can place the focus in it. */
|
|
20
|
+
onEntered?: () => void;
|
|
21
|
+
/** Called once the dialog has faded out, when what it showed can be let go. */
|
|
22
|
+
onExited?: () => void;
|
|
23
|
+
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
[data: `data-${string}`]: string | boolean | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A modal dialog in the middle of the viewport, over a backdrop, opened and closed by the part
|
|
29
|
+
* that owns it. Escape and a press outside it ask to close it. The focus goes to the dialog itself
|
|
30
|
+
* as it opens, until `onEntered` places it, stays inside it, and goes back to where it was as it
|
|
31
|
+
* closes. It portals to `<body>`, so it takes `dir` and the theme's class.
|
|
32
|
+
*/
|
|
33
|
+
declare const Dialog: ({ open, dir, maxWidth, fullWidth, className, disableRestoreFocus, onClose, onEntered, onExited, children, ...props }: DialogProps) => import("react").JSX.Element;
|
|
34
|
+
/** The dialog's heading, which names it for screen readers. */
|
|
35
|
+
export declare const DialogTitle: ({ className, ...props }: ComponentProps<typeof BaseDialog.Title>) => import("react").JSX.Element;
|
|
36
|
+
/** What the dialog holds, scrolling when it's taller than the dialog can be. */
|
|
37
|
+
export declare const DialogContent: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
38
|
+
/** The dialog's buttons, at its bottom, lined up at the end. */
|
|
39
|
+
export declare const DialogActions: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
40
|
+
export default Dialog;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export interface IconButtonProps extends Omit<ComponentProps<"button">, "color"> {
|
|
3
|
+
size?: "small" | "medium";
|
|
4
|
+
/** The icons' own colour unless it's `inherit`, the colour of the text around it, or `primary`. */
|
|
5
|
+
color?: "default" | "inherit" | "primary";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A round button holding an icon alone. In `src/` an icon-only button is a `TooltipIconButton`,
|
|
9
|
+
* which names it; this is for the one that's hidden from screen readers.
|
|
10
|
+
*/
|
|
11
|
+
declare const IconButton: ({ size, color, className, type, ...props }: IconButtonProps) => import("react").JSX.Element;
|
|
12
|
+
export default IconButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
interface LinearProgressProps extends ComponentProps<"span"> {
|
|
3
|
+
/** `determinate` fills the bar as far as `value` says; otherwise it sweeps. */
|
|
4
|
+
variant?: "indeterminate" | "determinate";
|
|
5
|
+
/** How far it is, from 0 to 100, for a `determinate` bar. */
|
|
6
|
+
value?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A bar for something awaited, filling from the start side, the right right to left, and drawn in
|
|
10
|
+
* the system's selection colour under forced colors.
|
|
11
|
+
*/
|
|
12
|
+
declare const LinearProgress: ({ variant, value, className, ...props }: LinearProgressProps) => import("react").JSX.Element;
|
|
13
|
+
export default LinearProgress;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { Menu as BaseMenu } from "@base-ui/react/menu";
|
|
3
|
+
interface MenuProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** The element the menu hangs under. */
|
|
6
|
+
anchor?: Element | null;
|
|
7
|
+
/** A point of the viewport the menu opens at, in place of an element, as a right-click's. */
|
|
8
|
+
position?: {
|
|
9
|
+
top: number;
|
|
10
|
+
left: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Whether the part it was opened in runs right to left, which decides the side `align` means
|
|
14
|
+
* and the way it opens from a point. The file manager's direction when omitted.
|
|
15
|
+
*/
|
|
16
|
+
rtl?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Which of the anchor's edges the menu lines up with: its start, the left unless it runs right
|
|
19
|
+
* to left, or its end.
|
|
20
|
+
*/
|
|
21
|
+
align?: "start" | "end";
|
|
22
|
+
/** Under the anchor unless it's `top`, over it, as for a button at the bottom of its part. */
|
|
23
|
+
side?: "top" | "bottom";
|
|
24
|
+
/** Names the menu for screen readers. */
|
|
25
|
+
label?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
/** Called once the menu has faded out, when what it showed can be let go. */
|
|
29
|
+
onExited?: () => void;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A menu under an element or at a point, opened and closed by the part that owns it. It portals to
|
|
34
|
+
* `<body>`, so it takes the file manager's direction (`DirectionContext`) and the theme's class.
|
|
35
|
+
* Escape, a press outside it and Tab close it, and the focus goes back to where it was.
|
|
36
|
+
*
|
|
37
|
+
* A right-click outside the open menu closes it, rather than opening the browser's menu over it.
|
|
38
|
+
* One on the menu, or the Menu key pressed in it, which some browsers send on its release after
|
|
39
|
+
* the key press opened the menu, leaves it open.
|
|
40
|
+
*/
|
|
41
|
+
declare const Menu: ({ open, anchor, position, rtl, align, side, label, className, onClose, onExited, children, }: MenuProps) => import("react").JSX.Element;
|
|
42
|
+
interface MenuItemProps extends Omit<ComponentProps<typeof BaseMenu.Item>, "className" | "render"> {
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Draws a rule under the item. */
|
|
45
|
+
divider?: boolean;
|
|
46
|
+
/** `menuitemcheckbox` or `menuitemradio` for an item that shows a state, with its `aria-checked`. */
|
|
47
|
+
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio";
|
|
48
|
+
"aria-checked"?: boolean | "mixed";
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* One item of a menu. Picking it doesn't close the menu: the part that owns the menu does, so an
|
|
52
|
+
* item that only changes a setting can leave it open. `data-destructive` draws it as a deletion.
|
|
53
|
+
*/
|
|
54
|
+
export declare const MenuItem: ({ className, divider, role, "aria-checked": checked, ...props }: MenuItemProps) => import("react").JSX.Element;
|
|
55
|
+
/** The box an item's icon sits in, so the labels line up after it. */
|
|
56
|
+
export declare const MenuIcon: ({ className, ...props }: ComponentProps<"span">) => import("react").JSX.Element;
|
|
57
|
+
interface MenuTextProps {
|
|
58
|
+
/** Leaves the room an icon would take, for a label without one among labels that have one. */
|
|
59
|
+
inset?: boolean;
|
|
60
|
+
/** A second line under the label, in the secondary colour. */
|
|
61
|
+
secondary?: ReactNode;
|
|
62
|
+
/** Cuts each line short with an ellipsis rather than widening the menu. */
|
|
63
|
+
noWrap?: boolean;
|
|
64
|
+
className?: string;
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
}
|
|
67
|
+
/** An item's label, and what's under it. */
|
|
68
|
+
export declare const MenuText: ({ inset, secondary, noWrap, className, children }: MenuTextProps) => import("react").JSX.Element;
|
|
69
|
+
/** An item's keys, after its label. */
|
|
70
|
+
export declare const MenuShortcut: ({ children }: {
|
|
71
|
+
children: ReactNode;
|
|
72
|
+
}) => import("react").JSX.Element;
|
|
73
|
+
/** A rule between two groups of items. */
|
|
74
|
+
export declare const MenuDivider: () => import("react").JSX.Element;
|
|
75
|
+
/** What the items after it are, read out by screen readers as it's drawn: not an item itself. */
|
|
76
|
+
export declare const MenuLabel: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
77
|
+
export default Menu;
|