@kb.ui/react 0.10.4 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -707
- package/dist/components/Accordion/Accordion.d.ts +33 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -0
- package/dist/components/Code/Code.d.ts +26 -3
- package/dist/components/Code/tokenize.d.ts +5 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +10 -0
- package/dist/components/Collection/Collection.d.ts +99 -0
- package/dist/components/Collection/useCollection.d.ts +66 -0
- package/dist/components/CollectionList/CollectionList.d.ts +12 -0
- package/dist/components/CollectionRow/CollectionRow.d.ts +17 -0
- package/dist/components/Combobox/Combobox.d.ts +14 -2
- package/dist/components/ConfirmAction/ConfirmAction.d.ts +42 -0
- package/dist/components/CopyableText/CopyableText.d.ts +38 -0
- package/dist/components/CopyableText/content.d.ts +14 -0
- package/dist/components/Dashboard/Dashboard.d.ts +17 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +20 -0
- package/dist/components/Dialog/Dialog.d.ts +3 -1
- package/dist/components/Disclosure/Disclosure.d.ts +21 -0
- package/dist/components/EmptyState/EmptyState.d.ts +30 -0
- package/dist/components/Form/Form.d.ts +19 -0
- package/dist/components/FormSection/FormSection.d.ts +26 -0
- package/dist/components/Gallery/Gallery.d.ts +26 -0
- package/dist/components/Grid/Grid.d.ts +17 -6
- package/dist/components/Image/Image.d.ts +20 -0
- package/dist/components/Link/Link.d.ts +15 -2
- package/dist/components/PageHeader/PageHeader.d.ts +27 -0
- package/dist/components/Panel/Panel.d.ts +3 -1
- package/dist/components/Popover/Popover.d.ts +55 -0
- package/dist/components/Settings/Settings.d.ts +11 -0
- package/dist/components/Skeleton/Skeleton.d.ts +34 -0
- package/dist/components/Spinner/Spinner.d.ts +26 -0
- package/dist/components/Stack/Stack.d.ts +15 -0
- package/dist/components/StatsRow/StatsRow.d.ts +33 -0
- package/dist/components/SupportingPane/SupportingPane.d.ts +15 -0
- package/dist/components/Table/Table.d.ts +65 -0
- package/dist/components/Tabs/Tabs.d.ts +69 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Thumbnail/Thumbnail.d.ts +14 -0
- package/dist/components/Toast/Toast.d.ts +72 -0
- package/dist/index.d.ts +39 -4
- package/dist/index.js +3901 -1238
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/CollapsiblePanel.d.ts +10 -0
- package/dist/utils/useClipboard.d.ts +28 -0
- package/docs/components/Accordion.md +66 -0
- package/docs/components/Avatar.md +80 -0
- package/docs/components/Badge.md +37 -0
- package/docs/components/Button.md +46 -0
- package/docs/components/Callout.md +41 -0
- package/docs/components/Card.md +41 -0
- package/docs/components/Checkbox.md +60 -0
- package/docs/components/Code.md +77 -0
- package/docs/components/CodeBlock.md +77 -0
- package/docs/components/Collection.md +183 -0
- package/docs/components/CollectionList.md +44 -0
- package/docs/components/CollectionRow.md +62 -0
- package/docs/components/Combobox.md +88 -0
- package/docs/components/ConfirmAction.md +100 -0
- package/docs/components/Container.md +41 -0
- package/docs/components/CopyableText.md +93 -0
- package/docs/components/Dashboard.md +81 -0
- package/docs/components/DescriptionList.md +61 -0
- package/docs/components/Dialog.md +84 -0
- package/docs/components/Disclosure.md +53 -0
- package/docs/components/EmptyState.md +50 -0
- package/docs/components/ErrorSummary.md +48 -0
- package/docs/components/Fieldset.md +42 -0
- package/docs/components/FileInput.md +74 -0
- package/docs/components/Form.md +67 -0
- package/docs/components/FormActions.md +45 -0
- package/docs/components/FormSection.md +57 -0
- package/docs/components/Gallery.md +84 -0
- package/docs/components/Grid.md +66 -0
- package/docs/components/Heading.md +40 -0
- package/docs/components/Image.md +62 -0
- package/docs/components/Inline.md +42 -0
- package/docs/components/Input.md +82 -0
- package/docs/components/Link.md +52 -0
- package/docs/components/Menu.md +44 -0
- package/docs/components/MultiSelect.md +59 -0
- package/docs/components/NumberField.md +65 -0
- package/docs/components/PageHeader.md +68 -0
- package/docs/components/Panel.md +153 -0
- package/docs/components/Popover.md +89 -0
- package/docs/components/Progress.md +37 -0
- package/docs/components/RadioGroup.md +69 -0
- package/docs/components/ScrollArea.md +40 -0
- package/docs/components/Select.md +71 -0
- package/docs/components/Separator.md +40 -0
- package/docs/components/Settings.md +57 -0
- package/docs/components/Skeleton.md +86 -0
- package/docs/components/Spinner.md +45 -0
- package/docs/components/Split.md +47 -0
- package/docs/components/Stack.md +54 -0
- package/docs/components/Stat.md +34 -0
- package/docs/components/StatsRow.md +80 -0
- package/docs/components/Status.md +48 -0
- package/docs/components/SupportingPane.md +59 -0
- package/docs/components/Switch.md +73 -0
- package/docs/components/Table.md +105 -0
- package/docs/components/Tabs.md +89 -0
- package/docs/components/Text.md +36 -0
- package/docs/components/Textarea.md +47 -0
- package/docs/components/Thumbnail.md +66 -0
- package/docs/components/Toast.md +130 -0
- package/docs/components/Toolbar.md +39 -0
- package/docs/components/Tooltip.md +42 -0
- package/package.json +3 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Accordion as Base } from "@base-ui/react/accordion";
|
|
2
|
+
export type AccordionProps<Value = string> = Omit<Base.Root.Props<Value>, "className"> & {
|
|
3
|
+
/** Plain class string on root. */
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type AccordionItemProps = Omit<Base.Item.Props, "className"> & {
|
|
7
|
+
/** Plain class string on item. */
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type AccordionHeaderProps = Omit<Base.Header.Props, "className"> & {
|
|
11
|
+
/** Plain class string on heading; use render to set heading rank. */
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type AccordionTriggerProps = Omit<Base.Trigger.Props, "className"> & {
|
|
15
|
+
/** Plain class string on trigger. */
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type AccordionPanelProps = Omit<Base.Panel.Props, "className"> & {
|
|
19
|
+
/** Plain class string on panel. */
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
declare function AccordionRoot<Value = string>({ className, ...props }: AccordionProps<Value>): import("react").JSX.Element;
|
|
23
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): import("react").JSX.Element;
|
|
24
|
+
declare function AccordionHeader({ className, ...props }: AccordionHeaderProps): import("react").JSX.Element;
|
|
25
|
+
declare function AccordionTrigger({ className, ...props }: AccordionTriggerProps): import("react").JSX.Element;
|
|
26
|
+
declare function AccordionPanel({ className, children, render, ...props }: AccordionPanelProps): import("react").JSX.Element;
|
|
27
|
+
export declare const Accordion: typeof AccordionRoot & {
|
|
28
|
+
Item: typeof AccordionItem;
|
|
29
|
+
Header: typeof AccordionHeader;
|
|
30
|
+
Trigger: typeof AccordionTrigger;
|
|
31
|
+
Panel: typeof AccordionPanel;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type ImageProps } from "../Image/Image";
|
|
4
|
+
export type AvatarShape = "circle" | "square" | "rounded" | "hexagon" | "diamond";
|
|
5
|
+
export type AvatarProps = Omit<ComponentProps<"span">, "children" | "onLoad" | "onError"> & Pick<ImageProps, "src" | "srcSet" | "sizes" | "loading" | "onLoad" | "onError"> & {
|
|
6
|
+
/** Full identity; remains accessible when photo fails. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Caller-owned initials; defaults to first and last name initials. */
|
|
9
|
+
initials?: string | undefined;
|
|
10
|
+
/** Hide duplicate identity beside visible text. */
|
|
11
|
+
decorative?: boolean | undefined;
|
|
12
|
+
/** Fixed identity dimensions. */
|
|
13
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
14
|
+
/** Identity silhouette; photo and initials remain upright. */
|
|
15
|
+
shape?: AvatarShape | undefined;
|
|
16
|
+
/** Extra classes for root, media and initials. */
|
|
17
|
+
classNames?: ClassNames<"root" | "media" | "initials"> | undefined;
|
|
18
|
+
};
|
|
19
|
+
export declare function Avatar({ name, initials, decorative, size, shape, src, srcSet, sizes, loading, onLoad, onError, className, classNames, ...props }: AvatarProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type ComponentProps, type Ref } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type CopyFeedbackProps } from "../../utils/useClipboard";
|
|
4
|
+
import { type CodeLanguage, type CodeToken } from "./tokenize";
|
|
5
|
+
export { type CodeLanguage, type CodeSyntaxKind, type CodeToken, tokenizeCode, } from "./tokenize";
|
|
6
|
+
export type CodePart = "header" | "meta" | "title" | "language" | "actions" | "toggle" | "copy" | "feedback" | "viewport" | "pre" | "content" | "line" | "lineNumber" | "lineText";
|
|
7
|
+
export type CodeProps = Omit<ComponentProps<"code">, "ref" | "title" | "onCopy"> & CopyFeedbackProps & {
|
|
8
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
9
|
+
block?: boolean | undefined;
|
|
10
|
+
language?: CodeLanguage | undefined;
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
copyable?: boolean | undefined;
|
|
13
|
+
lineNumbers?: boolean | undefined;
|
|
14
|
+
startLine?: number | undefined;
|
|
15
|
+
highlightLines?: readonly number[] | undefined;
|
|
16
|
+
minLines?: number | undefined;
|
|
17
|
+
collapsible?: boolean | undefined;
|
|
18
|
+
collapsedLines?: number | undefined;
|
|
19
|
+
defaultCollapsed?: boolean | undefined;
|
|
20
|
+
collapsed?: boolean | undefined;
|
|
21
|
+
onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
|
|
22
|
+
maxHeight?: string | number | undefined;
|
|
23
|
+
tokens?: readonly CodeToken[] | undefined;
|
|
24
|
+
classNames?: ClassNames<CodePart> | undefined;
|
|
25
|
+
};
|
|
26
|
+
export declare function Code({ ref, block, language, title, copyable, onCopy, onCopyError, disabled, feedbackDuration, copyLabel, copyingLabel, copiedLabel, copyErrorLabel, successMessage, errorMessage, lineNumbers, startLine, highlightLines, minLines, collapsible, collapsedLines, defaultCollapsed, collapsed: collapsedProp, onCollapsedChange, maxHeight, tokens, classNames, className, style, children, ...props }: CodeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type CodeLanguage = "tsx" | "ts" | "typescript" | "jsx" | "js" | "javascript" | "css" | "html" | "json" | "bash" | "sh" | "shell" | "shellscript" | "plain" | "text";
|
|
2
|
+
export type CodeSyntaxKind = "keyword" | "string" | "comment" | "number" | "tag" | "attribute" | "type" | "function" | "operator" | "property";
|
|
3
|
+
export type CodeToken = readonly [start: number, end: number, kind: CodeSyntaxKind];
|
|
4
|
+
export declare function formatCodeLanguage(language?: CodeLanguage): string | undefined;
|
|
5
|
+
export declare function tokenizeCode(code: string, language?: CodeLanguage): CodeToken[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import { type CodeProps } from "../Code/Code";
|
|
3
|
+
export type CodeBlockProps = Omit<CodeProps, "block" | "children" | "ref"> & {
|
|
4
|
+
/** Exact source string, including whitespace and trailing newlines. */
|
|
5
|
+
children: string;
|
|
6
|
+
/** Root block element. */
|
|
7
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
8
|
+
};
|
|
9
|
+
/** Explicit block rendering with Code's highlighting, line, and collapse contracts. */
|
|
10
|
+
export declare function CodeBlock({ className, ...props }: CodeBlockProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type UseCollectionOptions } from "./useCollection";
|
|
4
|
+
export type CollectionColumn<T> = {
|
|
5
|
+
/** Unique column identity used in sort requests. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Visible column label. */
|
|
8
|
+
header: string;
|
|
9
|
+
/** Record cell content. */
|
|
10
|
+
cell: (item: T) => ReactNode;
|
|
11
|
+
/** Ascending comparator; enables sorting in client mode. */
|
|
12
|
+
compare?: ((a: T, b: T) => number) | undefined;
|
|
13
|
+
/** Enable a server-owned sortable column without a local comparator. */
|
|
14
|
+
sortable?: boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type CollectionFilter = {
|
|
17
|
+
/** State filter key. */
|
|
18
|
+
key: string;
|
|
19
|
+
/** Visible select label. */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Nonempty facet values and their visible labels. */
|
|
22
|
+
options: readonly {
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
export type CollectionBulkAction = {
|
|
28
|
+
/** Unique action identity. */
|
|
29
|
+
key: string;
|
|
30
|
+
/** Visible action label. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Receives explicit ID snapshot; rejection preserves selection. */
|
|
33
|
+
onAction: (keys: readonly string[]) => void | Promise<void>;
|
|
34
|
+
/** Caller-owned permission or availability constraint. */
|
|
35
|
+
disabled?: boolean | undefined;
|
|
36
|
+
};
|
|
37
|
+
export type CollectionPaginationProps = Omit<ComponentProps<"nav">, "onChange"> & {
|
|
38
|
+
/** One-based current page; clamped to available pages. */
|
|
39
|
+
page: number;
|
|
40
|
+
/** Positive integer page size. */
|
|
41
|
+
pageSize: number;
|
|
42
|
+
/** Known non-negative total after filtering. */
|
|
43
|
+
totalItems: number;
|
|
44
|
+
/** Receives bounded one-based page requests. */
|
|
45
|
+
onPageChange: (page: number) => void;
|
|
46
|
+
/** Receives page-size requests; caller also resets page to one. */
|
|
47
|
+
onPageSizeChange?: ((pageSize: number) => void) | undefined;
|
|
48
|
+
/** Positive integer page-size choices. */
|
|
49
|
+
pageSizes?: readonly number[] | undefined;
|
|
50
|
+
/** Disable navigation while data or actions are pending. */
|
|
51
|
+
disabled?: boolean | undefined;
|
|
52
|
+
};
|
|
53
|
+
export declare function CollectionPagination({ page, pageSize, totalItems, onPageChange, onPageSizeChange, pageSizes, disabled, className, ...props }: CollectionPaginationProps): import("react").JSX.Element;
|
|
54
|
+
export type CollectionBulkActionsProps = ComponentProps<"fieldset"> & {
|
|
55
|
+
/** Explicit selected record IDs, including off-page selection. */
|
|
56
|
+
selectedKeys: readonly string[];
|
|
57
|
+
/** Available application-owned operations. */
|
|
58
|
+
actions: readonly CollectionBulkAction[];
|
|
59
|
+
/** Clear current selection on request. */
|
|
60
|
+
onClear: () => void;
|
|
61
|
+
/** Remove successfully submitted IDs; omitted preserves selection. */
|
|
62
|
+
onSuccess?: ((keys: readonly string[]) => void) | undefined;
|
|
63
|
+
/** Lock surrounding collection controls during an operation. */
|
|
64
|
+
onPendingChange?: ((pending: boolean) => void) | undefined;
|
|
65
|
+
/** Disable actions while parent data is unavailable. */
|
|
66
|
+
disabled?: boolean | undefined;
|
|
67
|
+
};
|
|
68
|
+
export declare function CollectionBulkActions({ selectedKeys, actions, onClear, onSuccess, onPendingChange, disabled, className, ...props }: CollectionBulkActionsProps): import("react").JSX.Element;
|
|
69
|
+
type CollectionPart = "toolbar" | "filters" | "viewport" | "table" | "caption" | "head" | "cell" | "row" | "empty" | "status" | "bulk" | "pagination";
|
|
70
|
+
export type CollectionProps<T> = UseCollectionOptions<T> & Omit<ComponentProps<"section">, "children" | "defaultValue"> & {
|
|
71
|
+
/** Accessible region name and visible table caption. */
|
|
72
|
+
label: string;
|
|
73
|
+
/** Stable accessible record name used by selection controls. */
|
|
74
|
+
getItemLabel: (item: T) => string;
|
|
75
|
+
/** Ordered table columns. */
|
|
76
|
+
columns: readonly CollectionColumn<T>[];
|
|
77
|
+
/** Facet controls; matches applies their values in client mode. */
|
|
78
|
+
filters?: readonly CollectionFilter[] | undefined;
|
|
79
|
+
/** Application-owned operations on explicit selected IDs. */
|
|
80
|
+
bulkActions?: readonly CollectionBulkAction[] | undefined;
|
|
81
|
+
/** Hide selection controls for read-only collections. */
|
|
82
|
+
selectable?: boolean | undefined;
|
|
83
|
+
/** Suppress rows and lock controls while fetching. */
|
|
84
|
+
loading?: boolean | undefined;
|
|
85
|
+
/** Caller-owned fetch failure and recovery content. */
|
|
86
|
+
error?: ReactNode | undefined;
|
|
87
|
+
/** Content shown when no records match. */
|
|
88
|
+
empty?: ReactNode | undefined;
|
|
89
|
+
/** Additional named controls or recovery actions. */
|
|
90
|
+
toolbar?: ReactNode | undefined;
|
|
91
|
+
/** Classes for collection slots. */
|
|
92
|
+
classNames?: ClassNames<CollectionPart> | undefined;
|
|
93
|
+
};
|
|
94
|
+
declare function CollectionRoot<T>({ label, getItemLabel, columns, filters, bulkActions, selectable, loading, error, empty, toolbar, classNames, className, items, getKey, isItemDisabled, matches, compare, mode, totalItems, state, defaultState, onStateChange, ...props }: CollectionProps<T>): import("react").JSX.Element;
|
|
95
|
+
export declare const Collection: typeof CollectionRoot & {
|
|
96
|
+
Pagination: typeof CollectionPagination;
|
|
97
|
+
BulkActions: typeof CollectionBulkActions;
|
|
98
|
+
};
|
|
99
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export type CollectionSort = {
|
|
2
|
+
/** Column identifier. */
|
|
3
|
+
key: string;
|
|
4
|
+
/** Comparison direction. */
|
|
5
|
+
direction: "ascending" | "descending";
|
|
6
|
+
};
|
|
7
|
+
export type CollectionState = {
|
|
8
|
+
/** Search text, interpreted by matches or the server. */
|
|
9
|
+
query: string;
|
|
10
|
+
/** Facet values; empty values mean no constraint. */
|
|
11
|
+
filters: Readonly<Record<string, string>>;
|
|
12
|
+
/** Active sort; null preserves input order. */
|
|
13
|
+
sort: CollectionSort | null;
|
|
14
|
+
/** One-based page. */
|
|
15
|
+
page: number;
|
|
16
|
+
/** Positive integer records per page. */
|
|
17
|
+
pageSize: number;
|
|
18
|
+
/** Explicit record IDs; never an implicit all-results selection. */
|
|
19
|
+
selectedKeys: readonly string[];
|
|
20
|
+
};
|
|
21
|
+
export type CollectionData<T> = {
|
|
22
|
+
/** Complete local dataset or one server page. */
|
|
23
|
+
items: readonly T[];
|
|
24
|
+
/** Unique, stable identity across pages and updates. */
|
|
25
|
+
getKey: (item: T) => string;
|
|
26
|
+
/** Disable selection for an ineligible record. */
|
|
27
|
+
isItemDisabled?: ((item: T) => boolean) | undefined;
|
|
28
|
+
/** Client search and facet predicate; server mode ignores it. */
|
|
29
|
+
matches?: ((item: T, query: string, filters: CollectionState["filters"]) => boolean) | undefined;
|
|
30
|
+
/** Client comparison for the requested sort; server mode ignores it. */
|
|
31
|
+
compare?: ((a: T, b: T, sort: CollectionSort) => number) | undefined;
|
|
32
|
+
} & ({
|
|
33
|
+
mode?: "client" | undefined;
|
|
34
|
+
totalItems?: never;
|
|
35
|
+
} | {
|
|
36
|
+
mode: "server";
|
|
37
|
+
totalItems: number;
|
|
38
|
+
});
|
|
39
|
+
export type UseCollectionOptions<T> = CollectionData<T> & {
|
|
40
|
+
/** Controlled workflow state; owner must apply changes. */
|
|
41
|
+
state?: CollectionState | undefined;
|
|
42
|
+
/** Initial uncontrolled workflow state. */
|
|
43
|
+
defaultState?: Partial<CollectionState> | undefined;
|
|
44
|
+
/** Receives complete next state for URL, server or external ownership. */
|
|
45
|
+
onStateChange?: ((state: CollectionState) => void) | undefined;
|
|
46
|
+
};
|
|
47
|
+
export declare function positiveInteger(value: number, name: string): number;
|
|
48
|
+
export declare function collectionPageCount(totalItems: number, pageSize: number): number;
|
|
49
|
+
export declare function useCollection<T>(options: UseCollectionOptions<T>): {
|
|
50
|
+
state: CollectionState;
|
|
51
|
+
items: readonly T[];
|
|
52
|
+
totalItems: number;
|
|
53
|
+
pageCount: number;
|
|
54
|
+
pageSelection: "all" | "none" | "some";
|
|
55
|
+
selectableCount: number;
|
|
56
|
+
setQuery: (query: string) => void;
|
|
57
|
+
setFilter: (key: string, value: string) => void;
|
|
58
|
+
setSort: (sort: CollectionSort | null) => void;
|
|
59
|
+
setPage: (page: number) => void;
|
|
60
|
+
setPageSize: (pageSize: number) => void;
|
|
61
|
+
toggle: (key: string, checked: boolean) => void;
|
|
62
|
+
selectPage: (checked: boolean) => void;
|
|
63
|
+
clearSelection: () => void;
|
|
64
|
+
removeSelection: (keysToRemove: readonly string[]) => void;
|
|
65
|
+
};
|
|
66
|
+
export type CollectionController<T> = ReturnType<typeof useCollection<T>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
export type CollectionListElement = "ul" | "ol";
|
|
3
|
+
export type CollectionListProps<T extends CollectionListElement = "ul"> = ComponentProps<T> & {
|
|
4
|
+
as?: T | undefined;
|
|
5
|
+
density?: "comfortable" | "dense" | undefined;
|
|
6
|
+
dividers?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare function CollectionList<T extends CollectionListElement = "ul">({ as, density, dividers, className, ...props }: CollectionListProps<T>): import("react").DetailedReactHTMLElement<Omit<CollectionListProps<T>, "as" | "className" | "density" | "dividers"> & {
|
|
9
|
+
role: "list" | NonNullable<CollectionListProps<T>["role"]>;
|
|
10
|
+
} & {
|
|
11
|
+
className: string;
|
|
12
|
+
} & Record<`data-${string}`, string>, HTMLUListElement>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
export type CollectionRowProps = Omit<ComponentProps<"li">, "title" | "children"> & {
|
|
4
|
+
/** Primary record name; compose a named link for navigation. */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** Supporting detail; rich content and zero values remain intact. */
|
|
7
|
+
description?: ReactNode | undefined;
|
|
8
|
+
/** Leading icon, avatar or independent selection control. */
|
|
9
|
+
leading?: ReactNode | undefined;
|
|
10
|
+
metadata?: ReactNode | undefined;
|
|
11
|
+
/** Independent named links, Buttons or Menu composition. */
|
|
12
|
+
actions?: ReactNode | undefined;
|
|
13
|
+
/** Visual selection; selection control supplies accessible state. */
|
|
14
|
+
selected?: boolean | undefined;
|
|
15
|
+
classNames?: ClassNames<"layout" | "leading" | "content" | "title" | "description" | "aside" | "metadata" | "actions"> | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare function CollectionRow({ title, description, leading, metadata, actions, selected, classNames, className, ...props }: CollectionRowProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Combobox as Base } from "@base-ui/react/combobox";
|
|
2
2
|
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
3
3
|
import { type ClassNames } from "../../utils/kb";
|
|
4
|
+
import { type MultiSelectProps } from "../MultiSelect/MultiSelect";
|
|
4
5
|
/** Single selectable option in a Combobox list. */
|
|
5
6
|
export interface ComboboxOption {
|
|
6
7
|
/** Option value committed to `onValueChange`. */
|
|
@@ -14,6 +15,8 @@ export interface ComboboxOption {
|
|
|
14
15
|
export type ComboboxSlot = "label" | "shell" | "input" | "actions" | "clear" | "trigger" | "positioner" | "popup" | "list" | "option" | "optionIndicator" | "optionLabel" | "empty" | "description" | "error";
|
|
15
16
|
/** Props for the searchable single-select Combobox component. */
|
|
16
17
|
export interface ComboboxProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange"> {
|
|
18
|
+
/** Choose one option; omit for single selection. */
|
|
19
|
+
multiple?: false | undefined;
|
|
17
20
|
/** Visible label naming the combobox input. */
|
|
18
21
|
label: string;
|
|
19
22
|
/** Selectable options shown and filtered in the popup list. */
|
|
@@ -61,5 +64,14 @@ export interface ComboboxProps extends Omit<ComponentPropsWithoutRef<"div">, "de
|
|
|
61
64
|
/** Extra classes for inner parts, keyed by slot name. */
|
|
62
65
|
classNames?: ClassNames<ComboboxSlot>;
|
|
63
66
|
}
|
|
64
|
-
/**
|
|
65
|
-
export
|
|
67
|
+
/** Multiple-choice combobox props; shares MultiSelect behavior and styling. */
|
|
68
|
+
export interface ComboboxMultipleProps extends MultiSelectProps {
|
|
69
|
+
/** Enable multiple selections with removable chips. */
|
|
70
|
+
multiple: true;
|
|
71
|
+
}
|
|
72
|
+
/** Explicit single-selection props; preserves existing ComboboxProps contract. */
|
|
73
|
+
export type ComboboxSingleProps = ComboboxProps;
|
|
74
|
+
type ComboboxSelectionProps = ComboboxProps | ComboboxMultipleProps;
|
|
75
|
+
/** Searchable single or multiple selection with removable values. */
|
|
76
|
+
export declare const Combobox: import("react").ForwardRefExoticComponent<ComboboxSelectionProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type DialogContentProps, type DialogTriggerProps } from "../Dialog/Dialog";
|
|
4
|
+
export type ConfirmActionSlot = "popup" | "backdrop" | "details" | "error";
|
|
5
|
+
/** Destructive action behind a modal confirmation; the trigger only opens it. */
|
|
6
|
+
export type ConfirmActionProps = Omit<DialogTriggerProps, "className" | "title" | "children" | "handle" | "payload"> & {
|
|
7
|
+
/** Trigger text; also the confirm button text unless confirmLabel is set. */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** Plain class string for the trigger. */
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
/** Dialog heading and accessible name; ask the question the action settles. */
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
/** Consequence of confirming; the dialog's accessible description. */
|
|
14
|
+
description?: ReactNode | undefined;
|
|
15
|
+
/** Further consequence detail, such as what else is removed. */
|
|
16
|
+
details?: ReactNode | undefined;
|
|
17
|
+
/** Runs the action. Throw or reject to keep the dialog open with an error. */
|
|
18
|
+
onConfirm: () => unknown;
|
|
19
|
+
/** Runs once after success, after the dialog has closed; remove the trigger here. */
|
|
20
|
+
onConfirmed?: (() => void) | undefined;
|
|
21
|
+
/** Confirm button text; defaults to the trigger's children. */
|
|
22
|
+
confirmLabel?: ReactNode | undefined;
|
|
23
|
+
/** Confirm button text while the action runs; defaults to confirmLabel. */
|
|
24
|
+
pendingLabel?: ReactNode | undefined;
|
|
25
|
+
/** Cancel button text. */
|
|
26
|
+
cancelLabel?: ReactNode | undefined;
|
|
27
|
+
/** Alert shown after a failure; a function receives the thrown reason. */
|
|
28
|
+
errorMessage?: ReactNode | ((error: unknown) => ReactNode) | undefined;
|
|
29
|
+
/** Controlled visibility. */
|
|
30
|
+
open?: boolean | undefined;
|
|
31
|
+
/** Initial visibility when uncontrolled. */
|
|
32
|
+
defaultOpen?: boolean | undefined;
|
|
33
|
+
/** Receives each requested visibility change, including the close after success. */
|
|
34
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
35
|
+
/** Focus target after closing; set it when success removes the trigger. */
|
|
36
|
+
finalFocus?: DialogContentProps["finalFocus"] | undefined;
|
|
37
|
+
/** Portal target; defaults to document.body. */
|
|
38
|
+
container?: DialogContentProps["container"] | undefined;
|
|
39
|
+
/** Classes for inner parts, keyed by part. */
|
|
40
|
+
classNames?: ClassNames<ConfirmActionSlot> | undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare function ConfirmAction({ title, description, details, onConfirm, onConfirmed, confirmLabel, pendingLabel, cancelLabel, errorMessage, open, defaultOpen, onOpenChange, finalFocus, container, classNames, className, children, render, ...props }: ConfirmActionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type CopyFeedbackProps } from "../../utils/useClipboard";
|
|
4
|
+
import type { CodeLanguage } from "../Code/tokenize";
|
|
5
|
+
export type CopyableTextPart = "label" | "value" | "actions" | "toggle" | "copy" | "feedback" | "link" | "highlight" | "code";
|
|
6
|
+
export type CopyableTextFormat = "auto" | "text" | "code";
|
|
7
|
+
export type CopyableTextTone = "neutral" | "accent" | "info" | "success" | "warning" | "danger";
|
|
8
|
+
export type CopyableTextProps = Omit<ComponentProps<"span">, "onCopy"> & CopyFeedbackProps & {
|
|
9
|
+
/** Exact clipboard value; display formatting never changes copied bytes. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Optional visible context above value. */
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
/** Bordered field or inline text with adjacent copy action. */
|
|
14
|
+
appearance?: "field" | "plain" | undefined;
|
|
15
|
+
/** Content and copy target density. */
|
|
16
|
+
size?: "sm" | "md" | undefined;
|
|
17
|
+
/** Monospace display for identifiers, paths, and commands. */
|
|
18
|
+
mono?: boolean | undefined;
|
|
19
|
+
/** Value color and subtle field tint; independent of clipboard state. */
|
|
20
|
+
tone?: CopyableTextTone | undefined;
|
|
21
|
+
/** Single-line preview with explicit full-value disclosure. */
|
|
22
|
+
truncate?: boolean | undefined;
|
|
23
|
+
/** Collapsed disclosure button text. */
|
|
24
|
+
expandLabel?: string | undefined;
|
|
25
|
+
/** Expanded disclosure button text. */
|
|
26
|
+
collapseLabel?: string | undefined;
|
|
27
|
+
/** Case-sensitive literal terms to emphasize; longer matches win overlaps. */
|
|
28
|
+
highlight?: string | readonly string[] | undefined;
|
|
29
|
+
/** Automatic recognition, literal text, or explicit source code. */
|
|
30
|
+
format?: CopyableTextFormat | undefined;
|
|
31
|
+
/** Code language hint; forces code in automatic mode. */
|
|
32
|
+
language?: CodeLanguage | undefined;
|
|
33
|
+
/** Override automatic web/email links when full content is visible. */
|
|
34
|
+
linkify?: boolean | undefined;
|
|
35
|
+
/** Extra classes for each rendered part. */
|
|
36
|
+
classNames?: ClassNames<CopyableTextPart> | undefined;
|
|
37
|
+
};
|
|
38
|
+
export declare function CopyableText({ value, label, appearance, size, mono, tone, truncate, expandLabel, collapseLabel, highlight, linkify, format, language, copyLabel, copyingLabel, copiedLabel, copyErrorLabel, successMessage, errorMessage, disabled, feedbackDuration, onCopy, onCopyError, className, classNames, children, ...props }: CopyableTextProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type CodeLanguage } from "../Code/tokenize";
|
|
3
|
+
type ContentOptions = {
|
|
4
|
+
highlight?: string | readonly string[] | undefined;
|
|
5
|
+
linkify: boolean;
|
|
6
|
+
detectCode: boolean;
|
|
7
|
+
codeLanguage?: CodeLanguage | undefined;
|
|
8
|
+
codeClassName?: string | undefined;
|
|
9
|
+
highlightClassName?: string | undefined;
|
|
10
|
+
linkClassName?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function detectCopyableLanguage(value: string): CodeLanguage | undefined;
|
|
13
|
+
export declare function renderCopyableContent(value: string, options: ContentOptions): ReactNode;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
export type DashboardPart = "header" | "metrics" | "panels" | "primary" | "secondary";
|
|
4
|
+
export interface DashboardProps extends Omit<ComponentProps<"div">, "children"> {
|
|
5
|
+
/** Page title, freshness and page actions; usually a PageHeader. */
|
|
6
|
+
header?: ReactNode | undefined;
|
|
7
|
+
/** Row of headline metrics below the header. */
|
|
8
|
+
metrics?: ReactNode | undefined;
|
|
9
|
+
/** Main panels; take two thirds beside secondary on wide pages. */
|
|
10
|
+
primary?: ReactNode | undefined;
|
|
11
|
+
/** Supporting panels; move below primary on narrow pages. */
|
|
12
|
+
secondary?: ReactNode | undefined;
|
|
13
|
+
/** Classes for inner regions, keyed by region. */
|
|
14
|
+
classNames?: ClassNames<DashboardPart> | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Layout intent for an overview page: header, metrics, then primary and secondary panels. */
|
|
17
|
+
export declare const Dashboard: ({ ref, header, metrics, primary, secondary, className, classNames, ...props }: DashboardProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export type DescriptionListProps = ComponentProps<"dl"> & {
|
|
3
|
+
/** Responsive label/value columns, always horizontal, or always stacked. */
|
|
4
|
+
layout?: "responsive" | "horizontal" | "stacked" | undefined;
|
|
5
|
+
density?: "comfortable" | "dense" | undefined;
|
|
6
|
+
dividers?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
declare function DescriptionListRoot({ layout, density, dividers, className, ...props }: DescriptionListProps): import("react").JSX.Element;
|
|
9
|
+
export type DescriptionListItemProps = ComponentProps<"div">;
|
|
10
|
+
declare function DescriptionListItem({ className, ...props }: DescriptionListItemProps): import("react").JSX.Element;
|
|
11
|
+
export type DescriptionListTermProps = ComponentProps<"dt">;
|
|
12
|
+
declare function DescriptionListTerm({ className, ...props }: DescriptionListTermProps): import("react").JSX.Element;
|
|
13
|
+
export type DescriptionListDetailProps = ComponentProps<"dd">;
|
|
14
|
+
declare function DescriptionListDetail({ className, ...props }: DescriptionListDetailProps): import("react").JSX.Element;
|
|
15
|
+
export declare const DescriptionList: typeof DescriptionListRoot & {
|
|
16
|
+
Item: typeof DescriptionListItem;
|
|
17
|
+
Term: typeof DescriptionListTerm;
|
|
18
|
+
Detail: typeof DescriptionListDetail;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -15,6 +15,8 @@ export type DialogDescriptionProps = Omit<Base.Description.Props, "className"> &
|
|
|
15
15
|
export type DialogActionsProps = ComponentProps<"div">;
|
|
16
16
|
export type DialogSectionProps = ComponentProps<"div">;
|
|
17
17
|
export type DialogContentProps = Omit<Base.Popup.Props, "className" | "title"> & {
|
|
18
|
+
/** Centered dialog or inline-end drawer with independently scrolling Body. */
|
|
19
|
+
layout?: "center" | "drawer";
|
|
18
20
|
/** Accessible name; mutually exclusive with a composed Dialog.Title. */
|
|
19
21
|
title?: ReactNode;
|
|
20
22
|
/** Accessible description; mutually exclusive with a composed Dialog.Description. */
|
|
@@ -35,7 +37,7 @@ declare function DialogActions({ className, ...props }: DialogActionsProps): imp
|
|
|
35
37
|
declare function DialogHeader({ className, ...props }: DialogSectionProps): import("react").JSX.Element;
|
|
36
38
|
declare function DialogBody({ className, ...props }: DialogSectionProps): import("react").JSX.Element;
|
|
37
39
|
declare function DialogFooter({ className, ...props }: DialogSectionProps): import("react").JSX.Element;
|
|
38
|
-
declare function DialogContent({ classNames, title, description, container, children, className, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
40
|
+
declare function DialogContent({ layout, classNames, title, description, container, children, className, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
39
41
|
export declare const Dialog: typeof DialogRoot & {
|
|
40
42
|
Trigger: typeof DialogTrigger;
|
|
41
43
|
Content: typeof DialogContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Collapsible as Base } from "@base-ui/react/collapsible";
|
|
2
|
+
export type DisclosureProps = Omit<Base.Root.Props, "className"> & {
|
|
3
|
+
/** Plain class string on root. */
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type DisclosureTriggerProps = Omit<Base.Trigger.Props, "className"> & {
|
|
7
|
+
/** Plain class string on trigger. */
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type DisclosurePanelProps = Omit<Base.Panel.Props, "className"> & {
|
|
11
|
+
/** Plain class string on panel. */
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare function DisclosureRoot({ className, ...props }: DisclosureProps): import("react").JSX.Element;
|
|
15
|
+
declare function DisclosureTrigger({ className, ...props }: DisclosureTriggerProps): import("react").JSX.Element;
|
|
16
|
+
declare function DisclosurePanel({ className, children, render, ...props }: DisclosurePanelProps): import("react").JSX.Element;
|
|
17
|
+
export declare const Disclosure: typeof DisclosureRoot & {
|
|
18
|
+
Trigger: typeof DisclosureTrigger;
|
|
19
|
+
Panel: typeof DisclosurePanel;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
export type EmptyStateSize = "sm" | "md" | "lg";
|
|
4
|
+
export type EmptyStateVariant = "surface" | "subtle" | "plain";
|
|
5
|
+
export type EmptyStateTone = "neutral" | "info" | "warning" | "danger";
|
|
6
|
+
export type EmptyStateHeadingLevel = 2 | 3 | 4;
|
|
7
|
+
export type EmptyStateProps = Omit<ComponentProps<"div">, "title"> & {
|
|
8
|
+
/** Primary heading explaining why the region is empty or unavailable. */
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** Supporting guidance explaining what appears here or how to proceed. */
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** Short category or state label above the title. */
|
|
13
|
+
eyebrow?: ReactNode;
|
|
14
|
+
/** Decorative glyph or emblem rendered above the header. */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Primary and secondary recovery or creation controls. */
|
|
17
|
+
actions?: ReactNode;
|
|
18
|
+
/** Quiet metadata or secondary link below the actions. */
|
|
19
|
+
footer?: ReactNode;
|
|
20
|
+
/** Document outline rank for the title heading (`2`–`4`). */
|
|
21
|
+
headingLevel?: EmptyStateHeadingLevel;
|
|
22
|
+
size?: EmptyStateSize;
|
|
23
|
+
variant?: EmptyStateVariant;
|
|
24
|
+
tone?: EmptyStateTone;
|
|
25
|
+
/** Announces dynamic empty or recoverable failure updates via `role="status"`. */
|
|
26
|
+
live?: boolean;
|
|
27
|
+
classNames?: ClassNames<"icon" | "header" | "eyebrow" | "title" | "description" | "body" | "actions" | "footer">;
|
|
28
|
+
};
|
|
29
|
+
/** Structured placeholder for empty collections, zero-match filters, and recoverable section errors. */
|
|
30
|
+
export declare function EmptyState({ title, description, eyebrow, icon, actions, footer, headingLevel, size, variant, tone, live, className, classNames, children, ...rest }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type FormActionsAlign } from "../FormActions/FormActions";
|
|
4
|
+
export type FormWidth = "sm" | "md" | "full";
|
|
5
|
+
export type FormPart = "header" | "body" | "actions";
|
|
6
|
+
export interface FormProps extends ComponentProps<"form"> {
|
|
7
|
+
/** Title and intro above the fields, such as a heading or PageHeader. */
|
|
8
|
+
header?: ReactNode | undefined;
|
|
9
|
+
/** The task's submit button first, then secondary actions. */
|
|
10
|
+
actions?: ReactNode | undefined;
|
|
11
|
+
/** Alignment of the actions row above the compact width. */
|
|
12
|
+
actionsAlign?: FormActionsAlign | undefined;
|
|
13
|
+
/** Maximum inline size: sm 32rem, md 40rem or full. */
|
|
14
|
+
width?: FormWidth | undefined;
|
|
15
|
+
/** Classes for inner regions, keyed by region. */
|
|
16
|
+
classNames?: ClassNames<FormPart> | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** Layout intent for one task: header, grouped fields, then its actions. */
|
|
19
|
+
export declare const Form: ({ ref, header, actions, actionsAlign, width, className, classNames, children, ...props }: FormProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
import { type FormActionsAlign } from "../FormActions/FormActions";
|
|
4
|
+
export type FormSectionLayout = "stack" | "split";
|
|
5
|
+
export type FormSectionHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
export type FormSectionPart = "header" | "title" | "description" | "body" | "fields" | "error" | "actions";
|
|
7
|
+
export interface FormSectionProps extends Omit<ComponentProps<"fieldset">, "title"> {
|
|
8
|
+
/** Section heading; also names the group. */
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** Heading rank; follow the page hierarchy. */
|
|
11
|
+
headingLevel?: FormSectionHeadingLevel | undefined;
|
|
12
|
+
/** Supporting context for the grouped fields. */
|
|
13
|
+
description?: ReactNode | undefined;
|
|
14
|
+
/** Section-level validation error. */
|
|
15
|
+
error?: ReactNode | undefined;
|
|
16
|
+
/** Buttons for this section, after the fields in Tab order. */
|
|
17
|
+
actions?: ReactNode | undefined;
|
|
18
|
+
/** Alignment of the actions row. */
|
|
19
|
+
actionsAlign?: FormActionsAlign | undefined;
|
|
20
|
+
/** Heading beside or above fields; unset follows the enclosing intent. */
|
|
21
|
+
layout?: FormSectionLayout | undefined;
|
|
22
|
+
/** Classes for inner parts, keyed by part. */
|
|
23
|
+
classNames?: ClassNames<FormSectionPart> | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Named group of related fields with its heading, error and actions. */
|
|
26
|
+
export declare const FormSection: ({ ref, title, headingLevel, description, error, actions, actionsAlign, layout, disabled, className, classNames, children, "aria-describedby": ariaDescribedBy, "aria-invalid": callerAriaInvalid, ...props }: FormSectionProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { type ClassNames } from "../../utils/kb";
|
|
3
|
+
export type GalleryPart = "header" | "filters" | "items" | "empty";
|
|
4
|
+
export interface GalleryProps extends ComponentProps<"div"> {
|
|
5
|
+
/** Page title, intro and page actions, usually a PageHeader. */
|
|
6
|
+
header?: ReactNode | undefined;
|
|
7
|
+
/** Search, filter and sort controls; they share a row and wrap. */
|
|
8
|
+
filters?: ReactNode | undefined;
|
|
9
|
+
/** Accessible name for the item list. */
|
|
10
|
+
itemsLabel?: string | undefined;
|
|
11
|
+
/** Shown in place of the list when there are no items. */
|
|
12
|
+
empty?: ReactNode | undefined;
|
|
13
|
+
/** Classes for inner regions, keyed by region. */
|
|
14
|
+
classNames?: ClassNames<GalleryPart> | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface GalleryItemProps extends ComponentProps<"li"> {
|
|
17
|
+
/** Spans two columns once the list has two; keep featured items first. */
|
|
18
|
+
featured?: boolean | undefined;
|
|
19
|
+
}
|
|
20
|
+
declare function GalleryRoot({ ref, header, filters, itemsLabel, empty, className, classNames, children, ...props }: GalleryProps): import("react").JSX.Element;
|
|
21
|
+
declare function GalleryItem({ featured, className, ...props }: GalleryItemProps): import("react").JSX.Element;
|
|
22
|
+
/** Layout intent for a grid of image-led items, such as a product catalog. */
|
|
23
|
+
export declare const Gallery: typeof GalleryRoot & {
|
|
24
|
+
Item: typeof GalleryItem;
|
|
25
|
+
};
|
|
26
|
+
export {};
|