@jc-times/business-ui 0.2.43
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/AGENTS.md +6 -0
- package/CHANGELOG.md +267 -0
- package/README.md +55 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/bin/business-ui-gate.mjs +171 -0
- package/dist/Alert.js +47 -0
- package/dist/AsyncDirectoryPicker.js +134 -0
- package/dist/AsyncSearchPicker.js +155 -0
- package/dist/AutoComplete.js +34 -0
- package/dist/Badge.js +14 -0
- package/dist/Button.js +54 -0
- package/dist/Cascader.js +141 -0
- package/dist/Combobox.js +106 -0
- package/dist/ConfirmDialog.js +48 -0
- package/dist/DataTableHorizontalScrollbar.js +38 -0
- package/dist/DataTableIcons.js +37 -0
- package/dist/DataTableMergedRows.js +45 -0
- package/dist/DataTableTheme.js +135 -0
- package/dist/DateInput.js +223 -0
- package/dist/DropdownMenu.js +130 -0
- package/dist/EmptyState.js +27 -0
- package/dist/ExplainableButton.js +68 -0
- package/dist/FileDropzone.js +70 -0
- package/dist/FilePreparationDialog.js +33 -0
- package/dist/FloatingControls.js +120 -0
- package/dist/FormField.js +143 -0
- package/dist/MetricCard.js +38 -0
- package/dist/ModalShell.js +139 -0
- package/dist/MultiSelect.js +137 -0
- package/dist/NumericInput.js +97 -0
- package/dist/OverlayContainer.js +9 -0
- package/dist/PageHeader.js +36 -0
- package/dist/Pagination.js +115 -0
- package/dist/PreparedFileDropzone.js +30 -0
- package/dist/RecoverableAsyncState.js +35 -0
- package/dist/RovingTabs.js +54 -0
- package/dist/SectionCard.js +35 -0
- package/dist/SegmentedControl.js +46 -0
- package/dist/Select.js +73 -0
- package/dist/Skeleton.js +25 -0
- package/dist/SortableList.js +55 -0
- package/dist/StructuredAddressInput.js +157 -0
- package/dist/Toast.js +100 -0
- package/dist/ToggleSwitch.js +34 -0
- package/dist/TreeSelect.js +444 -0
- package/dist/amount-format.js +20 -0
- package/dist/business-ui.js +44 -0
- package/dist/chinese-address-regions.js +15 -0
- package/dist/classNames.js +6 -0
- package/dist/data-table.js +257 -0
- package/dist/document-render-budget.js +22 -0
- package/dist/document-viewer/ContinuousPdfViewer.js +145 -0
- package/dist/document-viewer/DocumentViewer.js +123 -0
- package/dist/document-viewer/DocumentViewerViewport.js +36 -0
- package/dist/document-viewer/ImagePage.js +39 -0
- package/dist/document-viewer/PdfCanvasPage.js +26 -0
- package/dist/document-viewer/PdfThumbnailRail.js +116 -0
- package/dist/document-viewer/PdfToolbar.js +61 -0
- package/dist/document-viewer/PdfWorkspace.js +42 -0
- package/dist/document-viewer/pdf-render-budget.js +7 -0
- package/dist/document-viewer/usePdfCanvas.js +69 -0
- package/dist/document-viewer/usePdfViewport.js +48 -0
- package/dist/document-viewer-v2/DocumentViewerV2.js +171 -0
- package/dist/document-viewer-v2/HeadlessPdfViewer.js +420 -0
- package/dist/document-viewer-v2/HeadlessSearch.js +66 -0
- package/dist/document-viewer-v2.js +13 -0
- package/dist/document-viewer.js +12 -0
- package/dist/pdfium-viewer.js +18 -0
- package/dist/styles.css +2 -0
- package/dist/types/Alert.d.ts +11 -0
- package/dist/types/AmountFormat.d.ts +15 -0
- package/dist/types/AsyncDirectoryPicker.d.ts +32 -0
- package/dist/types/AsyncSearchPicker.d.ts +26 -0
- package/dist/types/AutoComplete.d.ts +9 -0
- package/dist/types/Badge.d.ts +13 -0
- package/dist/types/Button.d.ts +36 -0
- package/dist/types/Cascader.d.ts +57 -0
- package/dist/types/ChineseAddressRegions.d.ts +4 -0
- package/dist/types/Combobox.d.ts +37 -0
- package/dist/types/ConfirmDialog.d.ts +20 -0
- package/dist/types/DataTable.d.ts +68 -0
- package/dist/types/DataTableHorizontalScrollbar.d.ts +8 -0
- package/dist/types/DataTableIcons.d.ts +19 -0
- package/dist/types/DataTableMergedRows.d.ts +11 -0
- package/dist/types/DataTableTheme.d.ts +4 -0
- package/dist/types/DateInput.d.ts +25 -0
- package/dist/types/DocumentRenderBudget.d.ts +9 -0
- package/dist/types/DocumentViewer.d.ts +11 -0
- package/dist/types/DocumentViewerV2.d.ts +10 -0
- package/dist/types/DropdownMenu.d.ts +73 -0
- package/dist/types/EmptyState.d.ts +9 -0
- package/dist/types/ExplainableButton.d.ts +7 -0
- package/dist/types/FileDropzone.d.ts +20 -0
- package/dist/types/FilePreparationDialog.d.ts +12 -0
- package/dist/types/FloatingControls.d.ts +39 -0
- package/dist/types/FormField.d.ts +35 -0
- package/dist/types/MetricCard.d.ts +17 -0
- package/dist/types/ModalShell.d.ts +33 -0
- package/dist/types/MultiSelect.d.ts +12 -0
- package/dist/types/NumericInput.d.ts +54 -0
- package/dist/types/OverlayContainer.d.ts +2 -0
- package/dist/types/PageHeader.d.ts +23 -0
- package/dist/types/Pagination.d.ts +14 -0
- package/dist/types/PdfiumViewer.d.ts +5 -0
- package/dist/types/PreparedFileDropzone.d.ts +7 -0
- package/dist/types/RecoverableAsyncState.d.ts +11 -0
- package/dist/types/RovingTabs.d.ts +21 -0
- package/dist/types/SectionCard.d.ts +18 -0
- package/dist/types/SegmentedControl.d.ts +26 -0
- package/dist/types/Select.d.ts +31 -0
- package/dist/types/Skeleton.d.ts +11 -0
- package/dist/types/SortableList.d.ts +17 -0
- package/dist/types/StructuredAddressInput.d.ts +57 -0
- package/dist/types/Toast.d.ts +22 -0
- package/dist/types/ToggleSwitch.d.ts +15 -0
- package/dist/types/TreeSelect.d.ts +58 -0
- package/dist/types/classNames.d.ts +1 -0
- package/dist/types/document-viewer/ContinuousPdfViewer.d.ts +16 -0
- package/dist/types/document-viewer/DocumentViewer.d.ts +31 -0
- package/dist/types/document-viewer/DocumentViewerViewport.d.ts +23 -0
- package/dist/types/document-viewer/ImagePage.d.ts +9 -0
- package/dist/types/document-viewer/PdfCanvasPage.d.ts +7 -0
- package/dist/types/document-viewer/PdfThumbnailRail.d.ts +12 -0
- package/dist/types/document-viewer/PdfToolbar.d.ts +13 -0
- package/dist/types/document-viewer/PdfWorkspace.d.ts +5 -0
- package/dist/types/document-viewer/pdf-render-budget.d.ts +2 -0
- package/dist/types/document-viewer/usePdfCanvas.d.ts +22 -0
- package/dist/types/document-viewer/usePdfViewport.d.ts +14 -0
- package/dist/types/document-viewer-v2/DocumentViewerV2.d.ts +50 -0
- package/dist/types/document-viewer-v2/HeadlessPdfViewer.d.ts +39 -0
- package/dist/types/document-viewer-v2/HeadlessSearch.d.ts +9 -0
- package/dist/types/index.d.ts +41 -0
- package/dist/types/useDebouncedValue.d.ts +2 -0
- package/dist/types/useFilePreparation.d.ts +28 -0
- package/dist/types/useModalFocusTrap.d.ts +3 -0
- package/dist/useDebouncedValue.js +16 -0
- package/dist/useFilePreparation.js +51 -0
- package/dist/useModalFocusTrap.js +71 -0
- package/docs/agent-guide.md +145 -0
- package/docs/api.md +220 -0
- package/docs/cascader.md +56 -0
- package/docs/component-strategy.md +94 -0
- package/docs/data-table.md +123 -0
- package/docs/dependencies.md +57 -0
- package/docs/document-viewer-v2.md +259 -0
- package/docs/document-viewer.md +28 -0
- package/docs/file-preparation.md +11 -0
- package/docs/maturity-migration.md +62 -0
- package/docs/modal-shell-migration.md +43 -0
- package/docs/mrt-poc.md +205 -0
- package/docs/release.md +32 -0
- package/docs/viewport-qa.md +99 -0
- package/licenses/rc-cascader-MIT.txt +21 -0
- package/package.json +163 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export type AlertTone = "info" | "success" | "warning" | "danger";
|
|
3
|
+
export type AlertProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
4
|
+
tone?: AlertTone;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
dismissLabel?: string;
|
|
9
|
+
onDismiss?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function Alert({ tone, title, description, action, dismissLabel, onDismiss, className, ...props }: AlertProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Presentation only: symbols and units never change the stored numeric value. */
|
|
2
|
+
export type MoneyFormat = {
|
|
3
|
+
symbol: string;
|
|
4
|
+
unit?: string;
|
|
5
|
+
display?: "symbol" | "unit" | "number";
|
|
6
|
+
};
|
|
7
|
+
export type AmountFormatOptions = {
|
|
8
|
+
moneyFormat?: MoneyFormat;
|
|
9
|
+
useGrouping?: boolean;
|
|
10
|
+
minimumFractionDigits?: number;
|
|
11
|
+
};
|
|
12
|
+
/** Formats exact decimal strings without a floating-point conversion or currency conversion. */
|
|
13
|
+
export declare function formatDecimalAmount(value: string, options?: AmountFormatOptions): string;
|
|
14
|
+
/** Integer storage adapter, suitable for server-side document generation. */
|
|
15
|
+
export declare function formatScaledMoney(value: number, moneyFormat: MoneyFormat, scale?: number): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export type AsyncDirectoryPickerProps<T> = {
|
|
3
|
+
selectedItem?: T | null;
|
|
4
|
+
loadItems(query: string, signal: AbortSignal): Promise<readonly T[]>;
|
|
5
|
+
getKey(item: T): string;
|
|
6
|
+
getText(item: T): string;
|
|
7
|
+
getSelectionText?: (item: T) => string;
|
|
8
|
+
renderItem(item: T): ReactNode;
|
|
9
|
+
onSelect(item: T): void | Promise<void>;
|
|
10
|
+
onQueryChange?: (query: string) => void;
|
|
11
|
+
ownerKey?: string;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
searchLabel?: ReactNode;
|
|
15
|
+
loadingTitle?: string;
|
|
16
|
+
emptyText?: ReactNode;
|
|
17
|
+
minimumCharacters?: number;
|
|
18
|
+
minimumCharactersText?: (minimum: number) => ReactNode;
|
|
19
|
+
debounceMs?: number;
|
|
20
|
+
/** Maximum cached queries per owner. Zero disables caching. Default: 50. */
|
|
21
|
+
cacheSize?: number;
|
|
22
|
+
/** Cache TTL in milliseconds; defaults to 5 minutes. Zero bypasses cache. */
|
|
23
|
+
cacheTtlMs?: number;
|
|
24
|
+
/** Change after directory mutations to invalidate cached results and pending requests. */
|
|
25
|
+
refreshKey?: string | number;
|
|
26
|
+
loadOnFocus?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
busy?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "disabled" | "role" | "aria-autocomplete" | "aria-expanded" | "aria-controls" | "aria-activedescendant">;
|
|
31
|
+
};
|
|
32
|
+
export declare function AsyncDirectoryPicker<T>({ selectedItem, loadItems, getKey, getText, getSelectionText, renderItem, onSelect, onQueryChange, ownerKey, label, placeholder, searchLabel, loadingTitle, emptyText, minimumCharacters, minimumCharactersText, debounceMs, cacheSize, cacheTtlMs, refreshKey, loadOnFocus, disabled, busy, className, inputProps }: AsyncDirectoryPickerProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
export type AsyncSearchStatus = "idle" | "loading" | "error" | "success";
|
|
3
|
+
export type AsyncSearchPickerProps<T> = {
|
|
4
|
+
query: string;
|
|
5
|
+
onQueryChange(query: string): void;
|
|
6
|
+
onSearch(query: string): void;
|
|
7
|
+
items: readonly T[];
|
|
8
|
+
getKey(item: T): string;
|
|
9
|
+
getText(item: T): string;
|
|
10
|
+
renderItem(item: T): ReactNode;
|
|
11
|
+
onSelect(item: T): void;
|
|
12
|
+
status?: AsyncSearchStatus;
|
|
13
|
+
error?: string;
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
searchLabel?: ReactNode;
|
|
16
|
+
loadingTitle?: string;
|
|
17
|
+
emptyText?: ReactNode;
|
|
18
|
+
minimumCharacters?: number;
|
|
19
|
+
minimumCharactersText?: (minimum: number) => ReactNode;
|
|
20
|
+
busy?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
24
|
+
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "disabled" | "role" | "aria-autocomplete" | "aria-expanded" | "aria-controls" | "aria-activedescendant">;
|
|
25
|
+
};
|
|
26
|
+
export declare function AsyncSearchPicker<T>({ query, onQueryChange, onSearch, items, getKey, getText, renderItem, onSelect, status, error, label, searchLabel, loadingTitle, emptyText, minimumCharacters, minimumCharactersText, busy, disabled, className, inputRef, inputProps }: AsyncSearchPickerProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComboboxOption, type ComboboxProps } from "./Combobox";
|
|
2
|
+
export type AutoCompleteProps = Omit<ComboboxProps, "allowsCustomValue" | "inputValue" | "defaultInputValue" | "onInputChange" | "selectedKey" | "defaultSelectedKey" | "onSelectionChange"> & {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onSelect?: (item: ComboboxOption) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function AutoComplete({ value: controlledValue, defaultValue, onChange, onSelect, items, ...props }: AutoCompleteProps): import("react").JSX.Element;
|
|
9
|
+
export declare const Autocomplete: typeof AutoComplete;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export type BadgeTone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
3
|
+
export type BadgeSize = "small" | "medium";
|
|
4
|
+
export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
tone?: BadgeTone;
|
|
6
|
+
size?: BadgeSize;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare const Badge: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & {
|
|
10
|
+
tone?: BadgeTone;
|
|
11
|
+
size?: BadgeSize;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
|
|
3
|
+
export type ButtonSize = "compact" | "default" | "touch";
|
|
4
|
+
type ButtonSharedProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
busy?: boolean;
|
|
8
|
+
busyLabel?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type ButtonProps = ButtonSharedProps & ({
|
|
11
|
+
iconOnly: true;
|
|
12
|
+
"aria-label": string;
|
|
13
|
+
} | {
|
|
14
|
+
iconOnly?: false;
|
|
15
|
+
});
|
|
16
|
+
type LinkButtonSharedProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
|
|
17
|
+
href: string;
|
|
18
|
+
variant?: ButtonVariant;
|
|
19
|
+
size?: ButtonSize;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type LinkButtonProps = LinkButtonSharedProps & ({
|
|
23
|
+
iconOnly: true;
|
|
24
|
+
"aria-label": string;
|
|
25
|
+
} | {
|
|
26
|
+
iconOnly?: false;
|
|
27
|
+
});
|
|
28
|
+
export type ButtonStyleProps = Pick<ButtonSharedProps, "className"> & {
|
|
29
|
+
variant?: ButtonVariant;
|
|
30
|
+
size?: ButtonSize;
|
|
31
|
+
iconOnly?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
34
|
+
export declare const LinkButton: import("react").ForwardRefExoticComponent<LinkButtonProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
35
|
+
export declare function buttonClassName({ variant, size, iconOnly, className }?: ButtonStyleProps): string;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
export type CascaderOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
children?: CascaderOption[];
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
isLeaf?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "children" | "disabled" | "required"> & {
|
|
10
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
type CommonProps = {
|
|
13
|
+
options: CascaderOption[];
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
helpText?: ReactNode;
|
|
16
|
+
error?: ReactNode;
|
|
17
|
+
id?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
emptyText?: ReactNode;
|
|
23
|
+
clearLabel?: string;
|
|
24
|
+
allowClear?: boolean;
|
|
25
|
+
searchable?: boolean;
|
|
26
|
+
changeOnSelect?: boolean;
|
|
27
|
+
open?: boolean;
|
|
28
|
+
onOpenChange?(open: boolean): void;
|
|
29
|
+
loadData?(path: CascaderOption[]): void;
|
|
30
|
+
inputProps?: InputProps;
|
|
31
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
32
|
+
};
|
|
33
|
+
export type CascaderProps = CommonProps & ({
|
|
34
|
+
multiple?: false;
|
|
35
|
+
value: string[];
|
|
36
|
+
onValueChange(value: string[], path: CascaderOption[]): void;
|
|
37
|
+
} | {
|
|
38
|
+
multiple: true;
|
|
39
|
+
value: string[][];
|
|
40
|
+
onValueChange(value: string[][], paths: CascaderOption[][]): void;
|
|
41
|
+
/** Independent selection is the default; false enables parent/child conduction. */
|
|
42
|
+
checkStrictly?: boolean;
|
|
43
|
+
maxTagCount?: number;
|
|
44
|
+
});
|
|
45
|
+
/** Controlled hierarchical path picker. Data loading and business IDs belong to the caller. */
|
|
46
|
+
export declare function Cascader(props: CascaderProps): import("react").JSX.Element;
|
|
47
|
+
export type CascaderFlatItem = {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
parentId?: string | null;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** Reject ambiguous IDs and cycles instead of silently changing a business hierarchy. */
|
|
54
|
+
export declare function buildCascaderOptions(items: readonly CascaderFlatItem[]): CascaderOption[];
|
|
55
|
+
/** Build once per options change when adapting many selected department IDs. */
|
|
56
|
+
export declare function indexCascaderPaths(options: readonly CascaderOption[]): Map<string, string[]>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type InputProps, type Placement } from "react-aria-components";
|
|
3
|
+
export type ComboboxOption = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type DataAttributes = {
|
|
10
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type ComboboxProps = {
|
|
13
|
+
items: readonly ComboboxOption[];
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
inputValue?: string;
|
|
17
|
+
defaultInputValue?: string;
|
|
18
|
+
selectedKey?: string | null;
|
|
19
|
+
defaultSelectedKey?: string;
|
|
20
|
+
onInputChange?: (value: string) => void;
|
|
21
|
+
onSelectionChange?: (key: string | null) => void;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
allowsCustomValue?: boolean;
|
|
26
|
+
emptyText?: ReactNode;
|
|
27
|
+
helpText?: ReactNode;
|
|
28
|
+
error?: ReactNode;
|
|
29
|
+
virtualized?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
32
|
+
inputProps?: Omit<InputProps, "id" | "className" | "placeholder" | "value" | "defaultValue" | "onChange" | "disabled" | "required"> & DataAttributes;
|
|
33
|
+
placement?: Placement;
|
|
34
|
+
portalContainer?: Element;
|
|
35
|
+
};
|
|
36
|
+
export declare function Combobox({ items, label, placeholder, inputValue, defaultInputValue, selectedKey, defaultSelectedKey, onInputChange, onSelectionChange, loading, disabled, required, allowsCustomValue, emptyText, helpText, error, virtualized, className, inputRef, inputProps, placement, portalContainer }: ComboboxProps): import("react").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ButtonVariant } from "./Button";
|
|
3
|
+
import type { FocusTarget } from "./useModalFocusTrap";
|
|
4
|
+
export type ConfirmDialogProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
confirmLabel?: ReactNode;
|
|
9
|
+
cancelLabel?: ReactNode;
|
|
10
|
+
confirmVariant?: Extract<ButtonVariant, "primary" | "danger">;
|
|
11
|
+
busy?: boolean;
|
|
12
|
+
busyLabel?: ReactNode;
|
|
13
|
+
closeOnEscape?: boolean;
|
|
14
|
+
initialFocus?: "cancel" | "confirm" | FocusTarget;
|
|
15
|
+
returnFocus?: FocusTarget | false;
|
|
16
|
+
onConfirm(): void;
|
|
17
|
+
onCancel(): void;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare function ConfirmDialog({ open, title, description, confirmLabel, cancelLabel, confirmVariant, busy, busyLabel, closeOnEscape, initialFocus, returnFocus, onConfirm, onCancel, children }: ConfirmDialogProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type MRT_TableOptions, type MRT_RowData, type MRT_TableInstance, type MRT_ColumnDef } from "material-react-table";
|
|
2
|
+
import { type CSSProperties, type HTMLAttributes, type ReactNode, type Ref, type TableHTMLAttributes } from "react";
|
|
3
|
+
export { DataTableTheme } from './DataTableTheme';
|
|
4
|
+
export { DataTableMergedRows, type DataTableMergedRowsProps } from './DataTableMergedRows';
|
|
5
|
+
type DataAttributes = {
|
|
6
|
+
[key: `data-${string}`]: string | number | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type DataTableSort = {
|
|
9
|
+
columnId: string;
|
|
10
|
+
direction: "ascending" | "descending";
|
|
11
|
+
};
|
|
12
|
+
export type DataTableColumn<Row> = {
|
|
13
|
+
id: string;
|
|
14
|
+
header: ReactNode;
|
|
15
|
+
cell: (row: Row) => ReactNode;
|
|
16
|
+
mobileLabel?: string;
|
|
17
|
+
sortValue?: (row: Row) => string | number | Date | null | undefined;
|
|
18
|
+
sortable?: boolean;
|
|
19
|
+
align?: "start" | "center" | "end";
|
|
20
|
+
width?: CSSProperties["width"];
|
|
21
|
+
};
|
|
22
|
+
export type DataTableProps<Row> = {
|
|
23
|
+
rows: readonly Row[];
|
|
24
|
+
columns: readonly DataTableColumn<Row>[];
|
|
25
|
+
getRowId: (row: Row) => string;
|
|
26
|
+
caption?: ReactNode;
|
|
27
|
+
sort?: DataTableSort | null;
|
|
28
|
+
defaultSort?: DataTableSort | null;
|
|
29
|
+
onSortChange?: (sort: DataTableSort | null) => void;
|
|
30
|
+
sortMode?: "client" | "server";
|
|
31
|
+
selectionSummary?: boolean;
|
|
32
|
+
selectPageLabel?: string;
|
|
33
|
+
renderSelectionActions?: (ids: ReadonlySet<string>) => ReactNode;
|
|
34
|
+
hiddenColumnIds?: ReadonlySet<string>;
|
|
35
|
+
selectedRowIds?: ReadonlySet<string>;
|
|
36
|
+
onSelectedRowIdsChange?: (ids: Set<string>) => void;
|
|
37
|
+
getRowDisabled?: (row: Row) => boolean;
|
|
38
|
+
loading?: boolean;
|
|
39
|
+
loadingRows?: number;
|
|
40
|
+
emptyTitle?: ReactNode;
|
|
41
|
+
emptyDescription?: ReactNode;
|
|
42
|
+
emptyAction?: ReactNode;
|
|
43
|
+
mobileLayout?: "scroll" | "cards";
|
|
44
|
+
stickyHorizontalScrollbar?: boolean;
|
|
45
|
+
horizontalScrollbarLabel?: string;
|
|
46
|
+
className?: string;
|
|
47
|
+
rootRef?: Ref<HTMLDivElement>;
|
|
48
|
+
rootProps?: Omit<HTMLAttributes<HTMLDivElement>, "children" | "className"> & DataAttributes;
|
|
49
|
+
tableRef?: Ref<HTMLTableElement>;
|
|
50
|
+
tableProps?: Omit<TableHTMLAttributes<HTMLTableElement>, "children" | "className"> & DataAttributes;
|
|
51
|
+
};
|
|
52
|
+
/** Advanced table configuration. Use inside a component, just like MRT's hook. */
|
|
53
|
+
export declare function useDataTable<Row extends MRT_RowData>(options: MRT_TableOptions<Row>): MRT_TableInstance<Row>;
|
|
54
|
+
/** Render the public advanced table instance; callers own domain columns/data. */
|
|
55
|
+
export declare function DataTableView<Row extends MRT_RowData>({ table, stickyHorizontalScrollbar, horizontalScrollbarLabel }: {
|
|
56
|
+
table: MRT_TableInstance<Row>;
|
|
57
|
+
stickyHorizontalScrollbar?: boolean;
|
|
58
|
+
horizontalScrollbarLabel?: string;
|
|
59
|
+
}): import("react").JSX.Element;
|
|
60
|
+
export type { MRT_TableOptions as DataTableOptions, MRT_TableInstance as DataTableInstance, MRT_ColumnDef as DataTableColumnDef };
|
|
61
|
+
export type ConfiguredDataTableProps<Row extends MRT_RowData> = {
|
|
62
|
+
options: MRT_TableOptions<Row>;
|
|
63
|
+
stickyHorizontalScrollbar?: boolean;
|
|
64
|
+
horizontalScrollbarLabel?: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function DataTable<Row>(props: DataTableProps<Row>): ReactNode;
|
|
67
|
+
export declare function DataTable<Row extends MRT_RowData>(props: ConfiguredDataTableProps<Row>): ReactNode;
|
|
68
|
+
export declare function sortRows<Row>(rows: readonly Row[], columns: readonly DataTableColumn<Row>[], sort?: DataTableSort | null): Row[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function DataTableHorizontalScrollbar({ children, enabled, label }: Props): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type SvgIconProps } from '@mui/material/SvgIcon';
|
|
2
|
+
export declare const icons: {
|
|
3
|
+
SearchIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
4
|
+
CloseIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
5
|
+
CancelIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
6
|
+
ArrowDownwardIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
7
|
+
ExpandMoreIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
8
|
+
ArrowRightIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
9
|
+
SyncAltIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
|
+
MoreVertIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
ViewColumnIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
12
|
+
FilterListIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
13
|
+
FilterAltIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
14
|
+
FilterListOffIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
15
|
+
PushPinIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
16
|
+
DragHandleIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
17
|
+
RestartAltIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
18
|
+
VisibilityOffIcon: import("react").ForwardRefExoticComponent<Omit<SvgIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MRT_TableInstance } from 'material-react-table';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { MRT_RowData } from 'material-react-table';
|
|
4
|
+
export type DataTableMergedRowsProps<Row extends MRT_RowData, Detail> = {
|
|
5
|
+
table: MRT_TableInstance<Row>;
|
|
6
|
+
getDetails: (row: Row) => readonly Detail[];
|
|
7
|
+
detailColumnIds: readonly string[];
|
|
8
|
+
getDetailValue: (detail: Detail | null, columnId: string) => ReactNode;
|
|
9
|
+
emptyContent?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function DataTableMergedRows<Row extends MRT_RowData, Detail>(props: DataTableMergedRowsProps<Row, Detail>): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type Ref } from "react";
|
|
2
|
+
export type DateInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange"> & {
|
|
3
|
+
value: string;
|
|
4
|
+
onValueChange(value: string): void;
|
|
5
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
6
|
+
inputClassName?: string;
|
|
7
|
+
minDate?: string;
|
|
8
|
+
maxDate?: string;
|
|
9
|
+
isDateUnavailable?(isoDate: string): boolean;
|
|
10
|
+
onValidationError?(message: string | null): void;
|
|
11
|
+
};
|
|
12
|
+
export declare const DateInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "defaultValue" | "onChange" | "value"> & {
|
|
13
|
+
value: string;
|
|
14
|
+
onValueChange(value: string): void;
|
|
15
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
16
|
+
inputClassName?: string;
|
|
17
|
+
minDate?: string;
|
|
18
|
+
maxDate?: string;
|
|
19
|
+
isDateUnavailable?(isoDate: string): boolean;
|
|
20
|
+
onValidationError?(message: string | null): void;
|
|
21
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
22
|
+
export declare function parseDate(value: string): string | null;
|
|
23
|
+
export declare function calendarDays(year: number, month: number): {
|
|
24
|
+
date: Date;
|
|
25
|
+
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type PdfRenderBudget = {
|
|
2
|
+
maxDevicePixelRatio: number;
|
|
3
|
+
maxCanvasPixels: number;
|
|
4
|
+
overscanPixels: number;
|
|
5
|
+
neighboringPages: number;
|
|
6
|
+
preloadOffsets: number[];
|
|
7
|
+
};
|
|
8
|
+
export declare function getPdfRenderBudget(viewportWidth: number, coarsePointer: boolean): PdfRenderBudget;
|
|
9
|
+
export declare function constrainedPixelRatio(cssWidth: number, cssHeight: number, devicePixelRatio: number, budget: PdfRenderBudget): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
import "./document-viewer/document-viewer.css";
|
|
3
|
+
export { DocumentViewer, type DocumentViewerSource, type DocumentViewerProps } from "./document-viewer/DocumentViewer";
|
|
4
|
+
export { DocumentViewerViewport, type DocumentViewerViewportProps } from "./document-viewer/DocumentViewerViewport";
|
|
5
|
+
export { ContinuousPdfViewer } from "./document-viewer/ContinuousPdfViewer";
|
|
6
|
+
export { PdfThumbnailRail, PageThumbnail } from "./document-viewer/PdfThumbnailRail";
|
|
7
|
+
export { PdfWorkspace } from "./document-viewer/PdfWorkspace";
|
|
8
|
+
export { PdfCanvasPage } from "./document-viewer/PdfCanvasPage";
|
|
9
|
+
export { PdfToolbar } from "./document-viewer/PdfToolbar";
|
|
10
|
+
export { usePdfCanvas } from "./document-viewer/usePdfCanvas";
|
|
11
|
+
export { usePdfViewport } from "./document-viewer/usePdfViewport";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
import "./document-viewer-v2.css";
|
|
3
|
+
import "./document-viewer/document-viewer.css";
|
|
4
|
+
export type { DocumentViewerV2HeadlessProps, DocumentViewerV2OverlayContext } from './document-viewer-v2/HeadlessPdfViewer';
|
|
5
|
+
export { DocumentViewerV2, DocumentViewerV2 as DocumentViewer, createDocumentViewerV2Config, DOCUMENT_VIEWER_V2_DISABLED_CATEGORIES, } from "./document-viewer-v2/DocumentViewerV2";
|
|
6
|
+
export type { DocumentViewerV2BufferSource, DocumentViewerV2Config, DocumentViewerV2Props, DocumentViewerV2Source, DocumentViewerV2PdfSource, DocumentViewerV2ImageSource, DocumentViewerV2NativeProps, DocumentViewerV2UrlSource, } from "./document-viewer-v2/DocumentViewerV2";
|
|
7
|
+
export type { DocumentViewerProps, DocumentViewerSource } from './document-viewer/DocumentViewer';
|
|
8
|
+
export { DocumentViewerViewport, ContinuousPdfViewer, PdfThumbnailRail, PageThumbnail, PdfWorkspace, PdfCanvasPage, PdfToolbar, usePdfCanvas, usePdfViewport } from './DocumentViewer';
|
|
9
|
+
export type { DocumentViewerViewportProps } from './DocumentViewer';
|
|
10
|
+
export type { PDFViewerConfig, PDFViewerRef, PluginRegistry, } from "@embedpdf/react-pdf-viewer";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type ButtonProps as AriaButtonProps, type MenuItemProps as AriaMenuItemProps, type MenuProps as AriaMenuProps, type Placement } from "react-aria-components";
|
|
2
|
+
import { type AriaAttributes, type ReactNode, type Ref } from "react";
|
|
3
|
+
import { type ButtonSize, type ButtonVariant } from "./Button";
|
|
4
|
+
type DropdownMenuItemPresentation = {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
textValue: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
startIcon?: ReactNode;
|
|
9
|
+
endSlot?: ReactNode;
|
|
10
|
+
selectedIcon?: ReactNode;
|
|
11
|
+
current?: AriaAttributes["aria-current"];
|
|
12
|
+
itemRef?: Ref<HTMLDivElement>;
|
|
13
|
+
itemProps?: DropdownMenuItemProps;
|
|
14
|
+
};
|
|
15
|
+
export type DropdownMenuAction = DropdownMenuItemPresentation & {
|
|
16
|
+
type?: "item";
|
|
17
|
+
id: string;
|
|
18
|
+
dangerous?: boolean;
|
|
19
|
+
onAction(): void;
|
|
20
|
+
};
|
|
21
|
+
export type DropdownMenuSeparator = {
|
|
22
|
+
type: "separator";
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
export type DropdownMenuGroup = {
|
|
26
|
+
type: "group";
|
|
27
|
+
id: string;
|
|
28
|
+
label?: ReactNode;
|
|
29
|
+
items: readonly DropdownMenuEntry[];
|
|
30
|
+
};
|
|
31
|
+
export type DropdownMenuSubmenu = DropdownMenuItemPresentation & {
|
|
32
|
+
type: "submenu";
|
|
33
|
+
id: string;
|
|
34
|
+
items: readonly DropdownMenuEntry[];
|
|
35
|
+
};
|
|
36
|
+
export type DropdownMenuEntry = DropdownMenuAction | DropdownMenuSeparator | DropdownMenuGroup | DropdownMenuSubmenu;
|
|
37
|
+
export type DropdownMenuSelection = "all" | Set<string>;
|
|
38
|
+
type DropdownMenuSelectionProps = {
|
|
39
|
+
selectionMode?: "none";
|
|
40
|
+
selectedKeys?: never;
|
|
41
|
+
defaultSelectedKeys?: never;
|
|
42
|
+
onSelectionChange?: never;
|
|
43
|
+
} | {
|
|
44
|
+
selectionMode: "single" | "multiple";
|
|
45
|
+
selectedKeys?: "all" | Iterable<string>;
|
|
46
|
+
defaultSelectedKeys?: "all" | Iterable<string>;
|
|
47
|
+
onSelectionChange?: (keys: DropdownMenuSelection) => void;
|
|
48
|
+
};
|
|
49
|
+
type DataAttributes = {
|
|
50
|
+
[key: `data-${string}`]: string | number | undefined;
|
|
51
|
+
};
|
|
52
|
+
export type DropdownMenuTriggerProps = Omit<AriaButtonProps, "children" | "className" | "isDisabled"> & DataAttributes;
|
|
53
|
+
export type DropdownMenuListProps = Omit<AriaMenuProps<DropdownMenuEntry>, "children" | "className" | "items" | "selectionMode" | "selectedKeys" | "defaultSelectedKeys" | "onSelectionChange"> & DataAttributes;
|
|
54
|
+
export type DropdownMenuItemProps = Omit<AriaMenuItemProps<DropdownMenuEntry>, "children" | "className" | "id" | "value" | "textValue" | "isDisabled" | "onAction" | "aria-current"> & DataAttributes;
|
|
55
|
+
export type DropdownMenuProps = DropdownMenuSelectionProps & {
|
|
56
|
+
trigger: ReactNode;
|
|
57
|
+
triggerLabel?: string;
|
|
58
|
+
triggerVariant?: ButtonVariant;
|
|
59
|
+
triggerSize?: ButtonSize;
|
|
60
|
+
triggerRef?: Ref<HTMLButtonElement>;
|
|
61
|
+
triggerProps?: DropdownMenuTriggerProps;
|
|
62
|
+
items: readonly DropdownMenuEntry[];
|
|
63
|
+
menuLabel?: string;
|
|
64
|
+
menuRef?: Ref<HTMLDivElement>;
|
|
65
|
+
menuProps?: DropdownMenuListProps;
|
|
66
|
+
placement?: Placement;
|
|
67
|
+
portalContainer?: Element;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
className?: string;
|
|
70
|
+
};
|
|
71
|
+
export declare function DropdownMenu({ trigger, triggerLabel, triggerVariant, triggerSize, items, menuLabel, triggerRef, triggerProps, menuRef, menuProps, placement, portalContainer, disabled, className, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange }: DropdownMenuProps): import("react").JSX.Element;
|
|
72
|
+
export declare const Menu: typeof DropdownMenu;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
action?: ReactNode;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function EmptyState({ icon, title, description, action, compact, className, ...props }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ButtonProps } from "./Button";
|
|
2
|
+
export type ExplainableButtonProps = Omit<ButtonProps, "disabled"> & {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
disabledReason?: string;
|
|
5
|
+
reasonPresentation?: "inline" | "popover";
|
|
6
|
+
};
|
|
7
|
+
export declare function ExplainableButton({ disabled, disabledReason, reasonPresentation, onClick, onFocus, onBlur, onKeyDown, children, ...props }: ExplainableButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type LabelHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
export type FileDropzoneProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange"> & {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
accept?: string;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
maxFileSize?: number;
|
|
8
|
+
maxFiles?: number;
|
|
9
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
10
|
+
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, "accept" | "children" | "className" | "disabled" | "multiple" | "onChange" | "type">;
|
|
11
|
+
onFilesSelected(files: readonly File[]): void;
|
|
12
|
+
onFilesRejected?(files: readonly File[]): void;
|
|
13
|
+
onRejections?(rejections: readonly FileRejection[]): void;
|
|
14
|
+
};
|
|
15
|
+
export type FileRejection = {
|
|
16
|
+
file: File;
|
|
17
|
+
reason: "type" | "size" | "count";
|
|
18
|
+
};
|
|
19
|
+
export declare function FileDropzone({ children, accept, multiple, disabled, inputRef, inputProps, maxFileSize, maxFiles, onRejections, onFilesSelected, onFilesRejected, className, onDragEnter, onDragLeave, onDragOver, onDrop, onKeyDown, ...props }: FileDropzoneProps): import("react").JSX.Element;
|
|
20
|
+
export declare function acceptsFile(file: Pick<File, "name" | "type">, accept?: string): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FilePreparation } from "./useFilePreparation";
|
|
2
|
+
export type FilePreparationLabels = {
|
|
3
|
+
preparingTitle: string;
|
|
4
|
+
failedTitle: string;
|
|
5
|
+
preparingDescription: string;
|
|
6
|
+
cancel: string;
|
|
7
|
+
close: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function FilePreparationDialog({ preparation, labels }: {
|
|
10
|
+
preparation: FilePreparation;
|
|
11
|
+
labels: FilePreparationLabels;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type ButtonVariant } from "./Button";
|
|
3
|
+
type FloatingSide = "top" | "right" | "bottom" | "left";
|
|
4
|
+
type FloatingAlign = "start" | "center" | "end";
|
|
5
|
+
export type TooltipProps = {
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
side?: FloatingSide;
|
|
9
|
+
delayDuration?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
contentClassName?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function Tooltip({ children, content, side, delayDuration, disabled, contentClassName }: TooltipProps): import("react").JSX.Element;
|
|
14
|
+
export type PopoverProps = {
|
|
15
|
+
trigger: ReactElement;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
title?: ReactNode;
|
|
18
|
+
closeLabel?: string;
|
|
19
|
+
side?: FloatingSide;
|
|
20
|
+
align?: FloatingAlign;
|
|
21
|
+
open?: boolean;
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
modal?: boolean;
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
contentClassName?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function Popover({ trigger, children, title, closeLabel, side, align, open, defaultOpen, modal, onOpenChange, contentClassName }: PopoverProps): import("react").JSX.Element;
|
|
28
|
+
export type PopconfirmProps = Omit<PopoverProps, "children" | "title" | "onOpenChange"> & {
|
|
29
|
+
title: ReactNode;
|
|
30
|
+
description?: ReactNode;
|
|
31
|
+
confirmLabel?: ReactNode;
|
|
32
|
+
cancelLabel?: ReactNode;
|
|
33
|
+
confirmVariant?: ButtonVariant;
|
|
34
|
+
onConfirm: () => void | Promise<void>;
|
|
35
|
+
onConfirmError?: (error: unknown) => void;
|
|
36
|
+
onOpenChange?: (open: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
export declare function Popconfirm({ title, description, confirmLabel, cancelLabel, confirmVariant, onConfirm, onConfirmError, open: controlledOpen, defaultOpen, onOpenChange, ...popoverProps }: PopconfirmProps): import("react").JSX.Element;
|
|
39
|
+
export {};
|