@danxbot/ui 6.0.2 → 6.0.4
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.
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type PaginationBarMode = "numbered" | "simple";
|
|
2
|
+
export interface PaginationBarProps {
|
|
3
|
+
/** 1-based current page. */
|
|
4
|
+
page: number;
|
|
5
|
+
/** Rows per page. Should be one of `pageSizeOptions`. */
|
|
6
|
+
pageSize: number;
|
|
7
|
+
/** The sizes offered in the per-page popover, in the order shown. */
|
|
8
|
+
pageSizeOptions: readonly number[];
|
|
9
|
+
/** Total matching items across every page — drives the range text and page count. */
|
|
10
|
+
total: number;
|
|
11
|
+
onPageChange: (page: number) => void;
|
|
12
|
+
onPageSizeChange: (size: number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* `"simple"`: ‹ Page N of M › — fixed width regardless of how many pages
|
|
15
|
+
* exist, and the shape guaranteed to fit a narrow bar unaided.
|
|
16
|
+
* `"numbered"`: the numbered-window `Pagination` control, for a list long
|
|
17
|
+
* enough that jumping past adjacent pages is worth the room it costs.
|
|
18
|
+
* @default "simple"
|
|
19
|
+
*/
|
|
20
|
+
mode?: PaginationBarMode;
|
|
21
|
+
/** Names the bar for assistive tech, e.g. "Cards" or "Dispatches". */
|
|
22
|
+
label: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Range text + a popover-based per-page picker + page navigation, always on
|
|
27
|
+
* one row. See the file banner above for the reasoning behind the popover
|
|
28
|
+
* and the `mode` split — this replaces both of gpt-manager's pre-existing,
|
|
29
|
+
* differently-shaped hand-rolled footers.
|
|
30
|
+
*/
|
|
31
|
+
export declare function PaginationBar({ page, pageSize, pageSizeOptions, total, onPageChange, onPageSizeChange, mode, label, className, }: PaginationBarProps): import("react").JSX.Element;
|
|
@@ -39,6 +39,22 @@ export interface DataTableProps<TData> {
|
|
|
39
39
|
* never connected to anything. This is that connection.
|
|
40
40
|
*/
|
|
41
41
|
pageSize?: number;
|
|
42
|
+
/**
|
|
43
|
+
* The sizes offered by the footer's per-page picker. Defaults to
|
|
44
|
+
* `[10, 25, 50, 100]` (with `pageSize` folded in if it names a value not
|
|
45
|
+
* already on that list), so a caller that only ever set `pageSize` still
|
|
46
|
+
* gets a real picker rather than none at all — DX-2947 added this menu to
|
|
47
|
+
* every paginated table, not as an opt-in.
|
|
48
|
+
*/
|
|
49
|
+
pageSizeOptions?: readonly number[];
|
|
50
|
+
/**
|
|
51
|
+
* Told when the footer's per-page picker changes the size, in addition to
|
|
52
|
+
* the table re-paginating itself immediately. Pagination stays entirely
|
|
53
|
+
* internal either way — this is for a caller that wants to remember the
|
|
54
|
+
* choice (e.g. persist it), not something that has to be wired for paging
|
|
55
|
+
* to work.
|
|
56
|
+
*/
|
|
57
|
+
onPageSizeChange?: (size: number) => void;
|
|
42
58
|
emptyState?: ReactNode;
|
|
43
59
|
/**
|
|
44
60
|
* An extra class for the rows a consumer needs to mark — "this figure could
|
|
@@ -79,7 +95,7 @@ export interface DataTableProps<TData> {
|
|
|
79
95
|
className?: string;
|
|
80
96
|
getRowId?: (row: TData, index: number) => string;
|
|
81
97
|
}
|
|
82
|
-
export declare function DataTable<TData>({ data, columns, density, selectable, maxHeight, zebra, loading, refreshing, loadingRows, pageSize, emptyState, getRowClassName, onRowClick, toolbar, className, getRowId, }: DataTableProps<TData>): import("react").JSX.Element;
|
|
98
|
+
export declare function DataTable<TData>({ data, columns, density, selectable, maxHeight, zebra, loading, refreshing, loadingRows, pageSize, pageSizeOptions, onPageSizeChange, emptyState, getRowClassName, onRowClick, toolbar, className, getRowId, }: DataTableProps<TData>): import("react").JSX.Element;
|
|
83
99
|
export declare function TableEmptyState({ icon, title, description, action, }: {
|
|
84
100
|
icon?: ReactNode;
|
|
85
101
|
title?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export { RecordCard, RecordCardHandle, RecordCardEyebrow, RecordCardTitle, Recor
|
|
|
47
47
|
export { Tabs, TabList, Tab, TabPanel, type TabsProps, type TabListProps, type TabProps, type TabPanelProps, } from "./components/Tabs";
|
|
48
48
|
export { Accordion, AccordionItem, type AccordionProps, type AccordionItemProps, } from "./components/Accordion";
|
|
49
49
|
export { Breadcrumb, Pagination, type BreadcrumbProps, type PaginationProps, type Crumb, } from "./components/Navigation";
|
|
50
|
+
export { PaginationBar, type PaginationBarProps, type PaginationBarMode, } from "./components/PaginationBar";
|
|
50
51
|
export { Stepper, stepStatus, stepperProgress, advanceBlockReason, assertSteps, type StepperProps, type Step, type StepStatus, type StepperProgress, } from "./components/stepper";
|
|
51
52
|
export { StatusChecklist, tallyChecklist, type StatusChecklistProps, type ChecklistItem, type ChecklistState, type ChecklistTally, } from "./components/checklist";
|
|
52
53
|
export { Toggle, ToggleGroup, Toolbar, ToolbarButton, ToolbarGroup, ToolbarInput, ToolbarSeparator, type ToggleProps, type ToggleGroupProps, type ToolbarProps, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, } from "./components/Toggle";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { parseMarkdown } from "./parse";
|
|
2
2
|
export { markdown } from "./grammar";
|
|
3
|
-
export { MarkdownNodes, sanitizeHref } from "./render";
|
|
3
|
+
export { MarkdownNodes, MarkdownImage, sanitizeHref } from "./render";
|
|
4
4
|
export type { MdNode, MdInline, MdListItem, MdCell, MdAlign, MdCodeRenderer } from "./types";
|