@acronis-platform/ui-react 0.56.1 → 0.57.1
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/dist/components/ui/avatar/avatar.js +7 -7
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +104 -0
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -0
- package/dist/components/ui/chart/chart.js +49 -49
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +1 -1
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/chip/chip.js +28 -28
- package/dist/components/ui/chip/chip.js.map +1 -1
- package/dist/components/ui/data-table/data-table.js +223 -155
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/input-text/input-text.js +8 -8
- package/dist/components/ui/input-text/input-text.js.map +1 -1
- package/dist/components/ui/link/link.js +16 -16
- package/dist/components/ui/link/link.js.map +1 -1
- package/dist/components/ui/page-header/page-header.js +159 -49
- package/dist/components/ui/page-header/page-header.js.map +1 -1
- package/dist/components/ui/search/search.js +6 -6
- package/dist/components/ui/search/search.js.map +1 -1
- package/dist/components/ui/table/table.js +32 -32
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/toolbar/toolbar.js +214 -0
- package/dist/components/ui/toolbar/toolbar.js.map +1 -0
- package/dist/hooks/use-intersection-observer.js +26 -0
- package/dist/hooks/use-intersection-observer.js.map +1 -0
- package/dist/index.js +356 -343
- package/dist/index.js.map +1 -1
- package/dist/react.js +356 -343
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +28 -0
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -0
- package/dist/src/components/ui/data-table/data-table.d.ts +107 -4
- package/dist/src/components/ui/data-table/data-table.docs.d.ts +88 -4
- package/dist/src/components/ui/data-table/index.d.ts +1 -1
- package/dist/src/components/ui/page-header/index.d.ts +1 -1
- package/dist/src/components/ui/page-header/page-header.d.ts +9 -3
- package/dist/src/components/ui/toolbar/index.d.ts +1 -0
- package/dist/src/components/ui/toolbar/toolbar.d.ts +23 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-intersection-observer.d.ts +26 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ChartConfig } from '../chart';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const barChartVariants: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
layout?: "grouped" | "stacked" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface BarChartProps extends Omit<React.ComponentProps<'div'>, 'children'>, VariantProps<typeof barChartVariants> {
|
|
9
|
+
/** Row-per-category data. Each object holds the category key + one numeric field per series. */
|
|
10
|
+
data: ReadonlyArray<Record<string, string | number>>;
|
|
11
|
+
/**
|
|
12
|
+
* Per-series map of `label` / `color` (imported from the shared `Chart`
|
|
13
|
+
* primitives). Series colors are caller-supplied — reference an existing
|
|
14
|
+
* semantic `--ui-*` token; there is no chart palette tier yet.
|
|
15
|
+
*/
|
|
16
|
+
config: ChartConfig;
|
|
17
|
+
/** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */
|
|
18
|
+
dataKeys: string[];
|
|
19
|
+
/** Category axis key (the shared dimension across rows, e.g. `"month"`). */
|
|
20
|
+
xKey: string;
|
|
21
|
+
/** Corner radius applied to the growing end of each bar. */
|
|
22
|
+
barRadius?: number;
|
|
23
|
+
showGrid?: boolean;
|
|
24
|
+
showTooltip?: boolean;
|
|
25
|
+
showLegend?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const BarChart: React.ForwardRefExoticComponent<Omit<BarChartProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export { BarChart, barChartVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BarChart, barChartVariants, type BarChartProps } from './bar-chart';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ColumnDef, ColumnSizingState, OnChangeFn, Row, RowData, VisibilityState } from '@tanstack/react-table';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { Cell, Column, ColumnDef, ColumnSizingState, OnChangeFn, Row, RowData, SortingState, Table as TanstackTable, VisibilityState } from '@tanstack/react-table';
|
|
3
3
|
declare module '@tanstack/react-table' {
|
|
4
4
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
5
5
|
/** Pin the column to a table edge (sticky while the grid scrolls horizontally). */
|
|
@@ -11,6 +11,9 @@ declare module '@tanstack/react-table' {
|
|
|
11
11
|
wrap?: boolean;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
export declare function getPinnedStyle<TData>(column: Column<TData, unknown>): CSSProperties | undefined;
|
|
15
|
+
export declare function getColumnWidth<TData>(column: Column<TData, unknown>, enableColumnResizing: boolean): number | undefined;
|
|
16
|
+
export declare function getCellStyle<TData>(cell: Cell<TData, unknown>, enableColumnResizing: boolean): CSSProperties | undefined;
|
|
14
17
|
/**
|
|
15
18
|
* Computes the next column width for an Arrow-key resize step (Shift = larger
|
|
16
19
|
* step), clamped to `[min, max]` regardless of which bound `currentSize`
|
|
@@ -22,9 +25,34 @@ export declare function getResizeKeyboardStep(key: string, currentSize: number,
|
|
|
22
25
|
min: number;
|
|
23
26
|
max: number;
|
|
24
27
|
}): number | undefined;
|
|
25
|
-
|
|
28
|
+
type DataTableDataSourceProps<TData, TValue> = {
|
|
26
29
|
columns: ColumnDef<TData, TValue>[];
|
|
27
30
|
data: TData[];
|
|
31
|
+
/**
|
|
32
|
+
* Also drive an externally-built TanStack `table` instance (e.g. a
|
|
33
|
+
* composed toolbar/pagination) from the same state as this DataTable.
|
|
34
|
+
*/
|
|
35
|
+
table?: TanstackTable<TData>;
|
|
36
|
+
} | {
|
|
37
|
+
columns?: ColumnDef<TData, TValue>[];
|
|
38
|
+
data?: TData[];
|
|
39
|
+
/**
|
|
40
|
+
* Render from an externally-built TanStack `table` instance instead of
|
|
41
|
+
* DataTable's own — DataTable then owns no state and renders the caller's
|
|
42
|
+
* instance as-is (sorting, filtering, pagination, row models, etc. are all
|
|
43
|
+
* configured on that instance). Makes `columns`/`data` unnecessary (they're
|
|
44
|
+
* only used to build DataTable's own instance) and the following props
|
|
45
|
+
* no-ops (configure the equivalent directly on the external instance
|
|
46
|
+
* instead): `columnVisibility`, `onColumnVisibilityChange`,
|
|
47
|
+
* `onColumnSizingChange`, `enableColumnResizing`, `getRowCanExpand`,
|
|
48
|
+
* `manualSorting`, `sorting`, `onSortingChange`, `paginationMode`,
|
|
49
|
+
* `onLoadMore`, `loadMoreRootMargin`, `hasNextPage`, `isLoadingMore`.
|
|
50
|
+
* `meta.pin`-driven column pinning is also skipped — pin/unpin the
|
|
51
|
+
* caller's own instance via TanStack's `column.pin()` directly.
|
|
52
|
+
*/
|
|
53
|
+
table: TanstackTable<TData>;
|
|
54
|
+
};
|
|
55
|
+
interface DataTableOwnProps<TData> {
|
|
28
56
|
/** Enables row expansion for rows that return true. Pair with `renderExpandedRow`. */
|
|
29
57
|
getRowCanExpand?: (row: Row<TData>) => boolean;
|
|
30
58
|
/**
|
|
@@ -58,5 +86,80 @@ export interface DataTableProps<TData, TValue> {
|
|
|
58
86
|
columnVisibility?: VisibilityState;
|
|
59
87
|
/** Passthrough for the `columnVisibility` state; pairs with `columnVisibility`. */
|
|
60
88
|
onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
|
|
89
|
+
/**
|
|
90
|
+
* Opt out of client-side sorting — pass already-sorted `data` and drive
|
|
91
|
+
* sorting via `sorting`/`onSortingChange` (e.g. mapped to a server query by
|
|
92
|
+
* the caller). Mapping sort state to a query and refetching stays the
|
|
93
|
+
* caller's job; DataTable only skips its own comparator.
|
|
94
|
+
*/
|
|
95
|
+
manualSorting?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Controlled sorting state — pass this (with `onSortingChange`) to drive
|
|
98
|
+
* sorting externally. Uncontrolled (internal state) when omitted.
|
|
99
|
+
*/
|
|
100
|
+
sorting?: SortingState;
|
|
101
|
+
/** Passthrough for the `sorting` state; pairs with `sorting`. */
|
|
102
|
+
onSortingChange?: OnChangeFn<SortingState>;
|
|
103
|
+
/**
|
|
104
|
+
* Renders a full row, bypassing DataTable's default per-cell `flexRender`
|
|
105
|
+
* path entirely (no `<TableRow>`/cell-styling/pinning of DataTable's own).
|
|
106
|
+
* Use to swap in a custom, independently memoizable row component. The
|
|
107
|
+
* caller owns the row's markup and equality semantics — reuse the exported
|
|
108
|
+
* `getCellStyle`/`getPinnedStyle`/`getColumnWidth` helpers to match
|
|
109
|
+
* DataTable's default cell styling if desired.
|
|
110
|
+
*
|
|
111
|
+
* Also bypasses DataTable's `renderExpandedRow` handling — a row rendered
|
|
112
|
+
* via `renderRow` never gets an expanded-content row appended, even when
|
|
113
|
+
* `getRowCanExpand` returns true for it. Read `row.getIsExpanded()` and
|
|
114
|
+
* render the expanded content yourself if you need both.
|
|
115
|
+
*/
|
|
116
|
+
renderRow?: (row: Row<TData>, rowIndex: number) => ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* Renders a custom empty state instead of the default "No results." row.
|
|
119
|
+
* Receives `hasFilters` (whether any column filter is currently applied) so
|
|
120
|
+
* the caller can distinguish "no data at all" from "no matches" — the
|
|
121
|
+
* actual copy/wording/localization stays the caller's job.
|
|
122
|
+
*/
|
|
123
|
+
renderEmptyState?: (context: {
|
|
124
|
+
hasFilters: boolean;
|
|
125
|
+
}) => ReactNode;
|
|
126
|
+
/**
|
|
127
|
+
* `'page'` (default) keeps today's client-paginated behavior. `'infinite'`
|
|
128
|
+
* omits the paginated row model — `data` is assumed to be the full
|
|
129
|
+
* accumulated array the caller appends to on each `onLoadMore` — and
|
|
130
|
+
* renders a sentinel row that calls `onLoadMore` once it scrolls into view.
|
|
131
|
+
* Does not compose with virtualization; for a large accumulated list, use
|
|
132
|
+
* the `VirtualScrolling` recipe over the raw `Table` primitives instead.
|
|
133
|
+
*/
|
|
134
|
+
paginationMode?: 'page' | 'infinite';
|
|
135
|
+
/**
|
|
136
|
+
* Called when the infinite-scroll sentinel intersects the viewport.
|
|
137
|
+
* `paginationMode="infinite"` only. The fetch-more call, cursor/offset
|
|
138
|
+
* tracking, dedup, and accumulating `data` stay the caller's job. Requires
|
|
139
|
+
* at least one row already rendered — an empty table with `data={[]}`
|
|
140
|
+
* cannot use the sentinel to drive its very first fetch; seed the first
|
|
141
|
+
* page yourself (e.g. on mount) and use `onLoadMore` for subsequent pages.
|
|
142
|
+
*/
|
|
143
|
+
onLoadMore?: () => void;
|
|
144
|
+
/**
|
|
145
|
+
* Expands the sentinel's `IntersectionObserver` root margin (native CSS
|
|
146
|
+
* margin syntax, e.g. `'400px'`) so `onLoadMore` fires before the sentinel
|
|
147
|
+
* is literally visible — the closer the caller's fetch is to finishing by
|
|
148
|
+
* the time the user actually scrolls there, the less often the trailing
|
|
149
|
+
* loading row is seen. `paginationMode="infinite"` only; no-op when `table`
|
|
150
|
+
* is passed. How far this actually prefetches also depends on page size —
|
|
151
|
+
* a large margin with small pages can trigger several `onLoadMore` calls
|
|
152
|
+
* back-to-back as the user scrolls normally, which is expected.
|
|
153
|
+
*/
|
|
154
|
+
loadMoreRootMargin?: string;
|
|
155
|
+
/** Whether more rows are available to load. `paginationMode="infinite"` only. */
|
|
156
|
+
hasNextPage?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Whether a load is in flight — suppresses further `onLoadMore` calls and
|
|
159
|
+
* renders a trailing loading row. `paginationMode="infinite"` only.
|
|
160
|
+
*/
|
|
161
|
+
isLoadingMore?: boolean;
|
|
61
162
|
}
|
|
62
|
-
export
|
|
163
|
+
export type DataTableProps<TData, TValue = unknown> = DataTableOwnProps<TData> & DataTableDataSourceProps<TData, TValue>;
|
|
164
|
+
export declare function DataTable<TData, TValue = unknown>({ columns, data, table: externalTable, getRowCanExpand, renderExpandedRow, striped, bordered, highlightCurrentRow, skeleton, skeletonRows, enableColumnResizing, onColumnSizingChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, manualSorting, sorting: controlledSorting, onSortingChange, renderRow, renderEmptyState, paginationMode, onLoadMore, loadMoreRootMargin, hasNextPage, isLoadingMore, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
165
|
+
export {};
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
/** Props for `DataTable`. */
|
|
3
3
|
export interface DataTableProps {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* TanStack column definitions — header/cell renderers and accessors. Required
|
|
6
|
+
* unless `table` (an externally-built instance) is passed.
|
|
7
|
+
*/
|
|
8
|
+
columns?: unknown[];
|
|
9
|
+
/** The row data. Required unless `table` is passed. */
|
|
10
|
+
data?: unknown[];
|
|
11
|
+
/**
|
|
12
|
+
* Render from an externally-built TanStack `table` instance instead of
|
|
13
|
+
* DataTable's own — DataTable then owns no state and renders the caller's
|
|
14
|
+
* instance as-is. Makes `columns`/`data` unnecessary and the following props
|
|
15
|
+
* no-ops (configure the equivalent on the external instance instead):
|
|
16
|
+
* `columnVisibility`, `onColumnVisibilityChange`, `onColumnSizingChange`,
|
|
17
|
+
* `enableColumnResizing`, `getRowCanExpand`, `manualSorting`, `sorting`,
|
|
18
|
+
* `onSortingChange`, `paginationMode`, `onLoadMore`, `loadMoreRootMargin`,
|
|
19
|
+
* `hasNextPage`, `isLoadingMore`. `meta.pin`-driven column pinning is also
|
|
20
|
+
* skipped — pin/unpin the caller's own instance via TanStack's `column.pin()`.
|
|
21
|
+
*/
|
|
22
|
+
table?: unknown;
|
|
8
23
|
/** Enables row expansion for rows that return true; pair with `renderExpandedRow`. */
|
|
9
24
|
getRowCanExpand?: (row: unknown) => boolean;
|
|
10
25
|
/** Renders the detail content for an expanded row. */
|
|
@@ -19,4 +34,73 @@ export interface DataTableProps {
|
|
|
19
34
|
skeleton?: boolean;
|
|
20
35
|
/** Number of skeleton rows to render when `skeleton` is set (default 5). */
|
|
21
36
|
skeletonRows?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Opt in to interactive column resizing — renders a drag handle at the
|
|
39
|
+
* trailing edge of each resizable header (TanStack's native `columnResizing`).
|
|
40
|
+
*/
|
|
41
|
+
enableColumnResizing?: boolean;
|
|
42
|
+
/** Passthrough for the `columnSizing` state so a consumer can persist widths. */
|
|
43
|
+
onColumnSizingChange?: (updater: unknown) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Controlled column-visibility state — pass this (with
|
|
46
|
+
* `onColumnVisibilityChange`) to share one visibility state with an external
|
|
47
|
+
* `useReactTable` instance. Uncontrolled (internal state) when omitted.
|
|
48
|
+
*/
|
|
49
|
+
columnVisibility?: unknown;
|
|
50
|
+
/** Passthrough for the `columnVisibility` state; pairs with `columnVisibility`. */
|
|
51
|
+
onColumnVisibilityChange?: (updater: unknown) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Opt out of client-side sorting — pass already-sorted `data` and drive
|
|
54
|
+
* sorting via `sorting`/`onSortingChange` (e.g. mapped to a server query by
|
|
55
|
+
* the caller).
|
|
56
|
+
*/
|
|
57
|
+
manualSorting?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Controlled sorting state — pass this (with `onSortingChange`) to drive
|
|
60
|
+
* sorting externally. Uncontrolled (internal state) when omitted.
|
|
61
|
+
*/
|
|
62
|
+
sorting?: unknown;
|
|
63
|
+
/** Passthrough for the `sorting` state; pairs with `sorting`. */
|
|
64
|
+
onSortingChange?: (updater: unknown) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Renders a full row, bypassing DataTable's default per-cell `flexRender`
|
|
67
|
+
* path entirely. Use to swap in a custom, independently memoizable row
|
|
68
|
+
* component — the caller owns the row's markup and equality semantics. Reuse
|
|
69
|
+
* the exported `getCellStyle`/`getPinnedStyle`/`getColumnWidth` helpers to
|
|
70
|
+
* match DataTable's default cell styling if desired. Also bypasses
|
|
71
|
+
* `renderExpandedRow` — a row rendered via `renderRow` never gets an
|
|
72
|
+
* expanded-content row appended.
|
|
73
|
+
*/
|
|
74
|
+
renderRow?: (row: unknown, rowIndex: number) => ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Renders a custom empty state instead of the default "No results." row.
|
|
77
|
+
* Receives `hasFilters` (whether any column filter is currently applied).
|
|
78
|
+
*/
|
|
79
|
+
renderEmptyState?: (context: {
|
|
80
|
+
hasFilters: boolean;
|
|
81
|
+
}) => ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* `'page'` (default) keeps today's client-paginated behavior. `'infinite'`
|
|
84
|
+
* omits the paginated row model — `data` is the full accumulated array the
|
|
85
|
+
* caller appends to on each `onLoadMore` — and renders a sentinel row that
|
|
86
|
+
* calls `onLoadMore` once it scrolls into view.
|
|
87
|
+
*/
|
|
88
|
+
paginationMode?: 'page' | 'infinite';
|
|
89
|
+
/**
|
|
90
|
+
* Called when the infinite-scroll sentinel intersects the viewport.
|
|
91
|
+
* `paginationMode="infinite"` only.
|
|
92
|
+
*/
|
|
93
|
+
onLoadMore?: () => void;
|
|
94
|
+
/**
|
|
95
|
+
* Expands the sentinel's `IntersectionObserver` root margin (native CSS
|
|
96
|
+
* margin syntax, e.g. `'400px'`). `paginationMode="infinite"` only.
|
|
97
|
+
*/
|
|
98
|
+
loadMoreRootMargin?: string;
|
|
99
|
+
/** Whether more rows are available to load. `paginationMode="infinite"` only. */
|
|
100
|
+
hasNextPage?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Whether a load is in flight — suppresses further `onLoadMore` calls and
|
|
103
|
+
* renders a trailing loading row. `paginationMode="infinite"` only.
|
|
104
|
+
*/
|
|
105
|
+
isLoadingMore?: boolean;
|
|
22
106
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DataTable, type DataTableProps } from './data-table';
|
|
1
|
+
export { DataTable, type DataTableProps, getCellStyle, getPinnedStyle, getColumnWidth, } from './data-table';
|
|
2
2
|
export { DataTableColumnHeader } from './data-table-column-header';
|
|
3
3
|
export { DataTableExpandTrigger } from './data-table-expand-trigger';
|
|
4
4
|
export { DataTablePagination } from './data-table-pagination';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PageHeader,
|
|
1
|
+
export { PageHeader, PageHeaderRow, PageHeaderTitle, PageHeaderTags, PageHeaderActions, PageHeaderDescriptionRow, PageHeaderDescription, } from './page-header';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
declare function useRowOverflow(): {
|
|
3
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
4
|
+
measureRef: React.RefObject<HTMLDivElement | null>;
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
};
|
|
2
7
|
declare const PageHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
-
declare const PageHeaderBreadcrumb: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
4
8
|
declare const PageHeaderRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
9
|
declare const PageHeaderTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
6
|
-
declare const
|
|
10
|
+
declare const PageHeaderTags: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
11
|
declare const PageHeaderActions: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
12
|
+
declare const PageHeaderDescriptionRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const PageHeaderDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
export { PageHeader, PageHeaderRow, PageHeaderTitle, PageHeaderTags, PageHeaderActions, PageHeaderDescriptionRow, PageHeaderDescription, useRowOverflow, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toolbar, ToolbarActions, ToolbarActionList, type ToolbarProps, type ToolbarActionsProps, type ToolbarActionListProps, type ToolbarActionListItem, } from './toolbar';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ToolbarProps = React.ComponentPropsWithoutRef<'fieldset'>;
|
|
3
|
+
declare const Toolbar: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
4
|
+
export type ToolbarActionsProps = React.ComponentPropsWithoutRef<'div'>;
|
|
5
|
+
declare const ToolbarActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare function computeVisibleActionCount(itemWidths: number[], moreWidth: number, gap: number, availableWidth: number): number;
|
|
7
|
+
export declare function measureNaturalWidth(el: Element): number;
|
|
8
|
+
export interface ToolbarActionListItem {
|
|
9
|
+
/** Stable identity — used as the React key in both the row and the overflow menu. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Rendered as the visible ghost Button's label, and the overflow menu item's label. */
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
onSelect?: () => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ToolbarActionListProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
17
|
+
/** Ordered list of actions; trailing ones collapse into "More actions" first. */
|
|
18
|
+
actions: ToolbarActionListItem[];
|
|
19
|
+
/** Label for the overflow trigger. */
|
|
20
|
+
moreActionsLabel?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const ToolbarActionList: React.ForwardRefExoticComponent<ToolbarActionListProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export { Toolbar, ToolbarActions, ToolbarActionList };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { useSortState, type SortDirection, type SortState, type SortComparator, type UseSortStateOptions, type UseSortStateResult, } from './use-sort-state';
|
|
2
|
+
export { useIntersectionObserver, type UseIntersectionObserverOptions, } from './use-intersection-observer';
|
|
2
3
|
export { useTableUrlState, parseTableUrlState, serializeTableUrlState, DEFAULT_TABLE_URL_PARAM_KEYS, type TableUrlState, type TablePaginationState, type TableSortingState, type TableColumnFilterState, type TableUrlParamKeys, type TableUrlUpdater, type UseTableUrlStateOptions, type UseTableUrlStateResult, } from './use-table-url-state';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface UseIntersectionObserverOptions extends IntersectionObserverInit {
|
|
2
|
+
/** Called each time the observed element intersects its root. */
|
|
3
|
+
onIntersect: () => void;
|
|
4
|
+
/**
|
|
5
|
+
* Skip observing — e.g. there's nothing left to load, or a load is already
|
|
6
|
+
* in flight. Disconnects any existing observer.
|
|
7
|
+
*/
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Wires a single `IntersectionObserver` on the returned ref callback's element
|
|
12
|
+
* and calls `onIntersect` each time it intersects. Re-creates the observer when
|
|
13
|
+
* the element, `disabled`, or any `IntersectionObserverInit` option changes;
|
|
14
|
+
* disconnects on cleanup. `onIntersect` itself doesn't need to be memoized by
|
|
15
|
+
* the caller — the latest version is always used (via a ref) without
|
|
16
|
+
* reconnecting the observer.
|
|
17
|
+
*
|
|
18
|
+
* Takes a ref *callback* (not a `RefObject`) rather than accepting one from the
|
|
19
|
+
* caller — attaching to `element.current` inside a `useEffect` keyed on a
|
|
20
|
+
* `RefObject` misses conditionally-mounted elements: the `ref` object's
|
|
21
|
+
* identity never changes when its `.current` is populated, so an effect keyed
|
|
22
|
+
* on it (rather than on the element itself) never re-runs once the element
|
|
23
|
+
* actually mounts. Routing the DOM node through `useState` instead makes the
|
|
24
|
+
* mount itself a dependency.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useIntersectionObserver<T extends Element>({ onIntersect, disabled, root, rootMargin, threshold, }: UseIntersectionObserverOptions): (node: T | null) => void;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './components/ui/app-shell';
|
|
|
7
7
|
export * from './components/ui/app-shell-chat';
|
|
8
8
|
export * from './components/ui/auth-layout';
|
|
9
9
|
export * from './components/ui/avatar';
|
|
10
|
+
export * from './components/ui/bar-chart';
|
|
10
11
|
export * from './components/ui/breadcrumb';
|
|
11
12
|
export * from './components/ui/button';
|
|
12
13
|
export * from './components/ui/button-menu';
|
|
@@ -66,6 +67,7 @@ export * from './components/ui/table';
|
|
|
66
67
|
export * from './components/ui/tabs';
|
|
67
68
|
export * from './components/ui/toast';
|
|
68
69
|
export * from './components/ui/toggle-group';
|
|
70
|
+
export * from './components/ui/toolbar';
|
|
69
71
|
export * from './components/ui/tooltip';
|
|
70
72
|
export * from './components/ui/tag';
|
|
71
73
|
export { Tag as Badge, type TagProps as BadgeProps, } from './components/ui/tag';
|