@tensor_1/react 2.47.0 → 2.49.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 +540 -2
- package/dist/{SchedulingCalendar-B6TakO2h.d.ts → SchedulingCalendar-WWyFL3Eo.d.ts} +51 -2
- package/dist/announce.d.ts +10 -0
- package/dist/announce.js +30 -0
- package/dist/chart-analytic.cjs +33 -25
- package/dist/chart-preset.cjs +23 -15
- package/dist/chart.cjs +23 -15
- package/dist/combobox-model.d.ts +10 -1
- package/dist/combobox-model.js +15 -0
- package/dist/command-palette-model.d.ts +44 -0
- package/dist/command-palette-model.js +36 -0
- package/dist/components/AccountMenu.d.ts +44 -0
- package/dist/components/AccountMenu.js +43 -0
- package/dist/components/AppShell.d.ts +45 -2
- package/dist/components/AppShell.js +116 -5
- package/dist/components/AuditLog.d.ts +128 -0
- package/dist/components/AuditLog.js +196 -0
- package/dist/components/BrandProfiles.js +4 -3
- package/dist/components/Breadcrumbs.d.ts +9 -2
- package/dist/components/Breadcrumbs.js +3 -2
- package/dist/components/Button.d.ts +12 -5
- package/dist/components/Button.js +7 -3
- package/dist/components/Card.d.ts +18 -1
- package/dist/components/Card.js +5 -1
- package/dist/components/ChangeHighlight.d.ts +30 -0
- package/dist/components/ChangeHighlight.js +21 -0
- package/dist/components/ChartCore.js +2 -1
- package/dist/components/Checkbox.d.ts +27 -1
- package/dist/components/Checkbox.js +31 -2
- package/dist/components/Chip.d.ts +7 -3
- package/dist/components/Chip.js +2 -2
- package/dist/components/CodeDisplay.d.ts +65 -0
- package/dist/components/CodeDisplay.js +124 -0
- package/dist/components/Combobox.d.ts +27 -6
- package/dist/components/Combobox.js +195 -58
- package/dist/components/CommandPalette.d.ts +36 -1
- package/dist/components/CommandPalette.js +254 -2
- package/dist/components/ContactCard.d.ts +66 -0
- package/dist/components/ContactCard.js +74 -0
- package/dist/components/Count.d.ts +24 -0
- package/dist/components/Count.js +32 -0
- package/dist/components/DashboardCanvas.js +14 -0
- package/dist/components/DataWorkspace.d.ts +167 -0
- package/dist/components/DataWorkspace.js +380 -0
- package/dist/components/DateFieldParts.d.ts +2 -1
- package/dist/components/DateFieldParts.js +7 -0
- package/dist/components/DatePicker.d.ts +9 -2
- package/dist/components/DatePicker.js +67 -28
- package/dist/components/DateRangePicker.d.ts +12 -2
- package/dist/components/DateRangePicker.js +13 -12
- package/dist/components/DetailPage.d.ts +7 -1
- package/dist/components/DetailPage.js +2 -1
- package/dist/components/Dialogs.d.ts +71 -10
- package/dist/components/Dialogs.js +130 -30
- package/dist/components/DiffViewer.d.ts +23 -3
- package/dist/components/DiffViewer.js +26 -12
- package/dist/components/DiscardPrompt.js +16 -0
- package/dist/components/DisplayPreferences.d.ts +83 -0
- package/dist/components/DisplayPreferences.js +185 -0
- package/dist/components/EditorialHome.d.ts +23 -3
- package/dist/components/EditorialHome.js +16 -11
- package/dist/components/EntityPicker.d.ts +20 -3
- package/dist/components/EntityPicker.js +32 -13
- package/dist/components/FilterEditor.d.ts +18 -4
- package/dist/components/FilterEditor.js +141 -19
- package/dist/components/FocusOnMount.d.ts +282 -0
- package/dist/components/FocusOnMount.js +12 -0
- package/dist/components/InfoTip.js +11 -12
- package/dist/components/InlineEdit.d.ts +87 -20
- package/dist/components/InlineEdit.js +197 -54
- package/dist/components/Input.d.ts +12 -2
- package/dist/components/Input.js +5 -3
- package/dist/components/Kanban.d.ts +14 -3
- package/dist/components/Kanban.js +9 -4
- package/dist/components/Kbd.d.ts +6 -1
- package/dist/components/Kbd.js +6 -6
- package/dist/components/Lightbox.d.ts +41 -5
- package/dist/components/Lightbox.js +95 -9
- package/dist/components/MatchReview.d.ts +40 -1
- package/dist/components/MatchReview.js +130 -4
- package/dist/components/MetricInput.js +3 -2
- package/dist/components/Modal.d.ts +2 -1
- package/dist/components/Modal.js +13 -4
- package/dist/components/MotionList.d.ts +303 -0
- package/dist/components/MotionList.js +175 -0
- package/dist/components/NavFavourites.d.ts +5 -0
- package/dist/components/NavFavourites.js +7 -7
- package/dist/components/OtpInput.d.ts +33 -0
- package/dist/components/OtpInput.js +123 -0
- package/dist/components/PageHeader.d.ts +7 -1
- package/dist/components/PageHeader.js +2 -2
- package/dist/components/Pagination.js +6 -5
- package/dist/components/PasswordInput.d.ts +34 -0
- package/dist/components/PasswordInput.js +101 -0
- package/dist/components/Peek.js +3 -3
- package/dist/components/Popover.js +11 -0
- package/dist/components/PrintLayout.d.ts +63 -0
- package/dist/components/PrintLayout.js +114 -0
- package/dist/components/QrCode.d.ts +47 -0
- package/dist/components/QrCode.js +55 -0
- package/dist/components/QrScanner.d.ts +95 -0
- package/dist/components/QrScanner.js +266 -0
- package/dist/components/RelationshipGraph.d.ts +32 -1
- package/dist/components/RelationshipGraph.js +22 -6
- package/dist/components/RelationshipGraphLayered.d.ts +1 -1
- package/dist/components/RelationshipGraphLayered.js +268 -118
- package/dist/components/RelationshipGraphList.js +33 -6
- package/dist/components/RuleBuilder.js +39 -7
- package/dist/components/SchedulingAgenda.d.ts +3 -1
- package/dist/components/SchedulingCalendar.d.ts +3 -1
- package/dist/components/SchedulingCalendar.js +43 -4
- package/dist/components/SchedulingResourceDay.d.ts +57 -0
- package/dist/components/SchedulingResourceDay.js +287 -0
- package/dist/components/SchedulingTimeGrid.d.ts +3 -1
- package/dist/components/SchedulingTimeline.d.ts +3 -1
- package/dist/components/SearchSuggest.d.ts +23 -3
- package/dist/components/SearchSuggest.js +56 -18
- package/dist/components/Segmented.d.ts +39 -4
- package/dist/components/Segmented.js +39 -5
- package/dist/components/Select.d.ts +3 -2
- package/dist/components/Select.js +7 -1
- package/dist/components/ShortcutHint.d.ts +11 -10
- package/dist/components/ShortcutHint.js +44 -38
- package/dist/components/Sidebar.d.ts +36 -4
- package/dist/components/Sidebar.js +37 -12
- package/dist/components/SortableList.d.ts +45 -0
- package/dist/components/SortableList.js +147 -0
- package/dist/components/Stat.d.ts +28 -3
- package/dist/components/Stat.js +13 -3
- package/dist/components/States.d.ts +33 -1
- package/dist/components/States.js +43 -1
- package/dist/components/StatusPill.d.ts +14 -3
- package/dist/components/StatusPill.js +11 -3
- package/dist/components/Steps.js +2 -1
- package/dist/components/Table.d.ts +9 -2
- package/dist/components/Table.js +4 -2
- package/dist/components/TableControls.js +18 -58
- package/dist/components/TableOverflowProbe.d.ts +12 -0
- package/dist/components/TableOverflowProbe.js +27 -0
- package/dist/components/Tabs.d.ts +2 -1
- package/dist/components/Tabs.js +10 -2
- package/dist/components/TagInput.d.ts +67 -0
- package/dist/components/TagInput.js +342 -0
- package/dist/components/Textarea.d.ts +5 -0
- package/dist/components/Textarea.js +2 -2
- package/dist/components/TimePicker.d.ts +80 -0
- package/dist/components/TimePicker.js +347 -0
- package/dist/components/Toast.d.ts +1 -1
- package/dist/components/Toast.js +109 -4
- package/dist/components/Tooltip.d.ts +8 -4
- package/dist/components/Tooltip.js +86 -28
- package/dist/components/Tree.d.ts +8 -0
- package/dist/components/Tree.js +11 -5
- package/dist/display-preferences-model.d.ts +53 -0
- package/dist/display-preferences-model.js +64 -0
- package/dist/emoji.cjs +143 -49
- package/dist/filter-model.d.ts +59 -3
- package/dist/filter-model.js +67 -2
- package/dist/hooks/useAnchoredPosition.js +14 -2
- package/dist/hooks/useChangeHighlight.d.ts +33 -0
- package/dist/hooks/useChangeHighlight.js +44 -0
- package/dist/hooks/useDeferredReorder.d.ts +32 -0
- package/dist/hooks/useDeferredReorder.js +47 -0
- package/dist/hooks/useDialog.d.ts +5 -0
- package/dist/hooks/useDialog.js +17 -3
- package/dist/hooks/useKeyboardGrab.d.ts +58 -0
- package/dist/hooks/useKeyboardGrab.js +118 -0
- package/dist/hooks/useOptimisticValue.d.ts +51 -0
- package/dist/hooks/useOptimisticValue.js +61 -0
- package/dist/hooks/useReducedMotion.d.ts +4 -1
- package/dist/hooks/useReducedMotion.js +7 -1
- package/dist/hooks/useResolvedFilterLabels.d.ts +15 -0
- package/dist/hooks/useResolvedFilterLabels.js +34 -0
- package/dist/hooks/useSlidingIndicator.d.ts +18 -0
- package/dist/hooks/useSlidingIndicator.js +80 -0
- package/dist/hooks/useVirtualRows.d.ts +21 -2
- package/dist/hooks/useVirtualRows.js +30 -3
- package/dist/icons/Icon.d.ts +1 -1
- package/dist/index.cjs +19687 -13423
- package/dist/index.d.cts +3419 -651
- package/dist/index.d.ts +48 -18
- package/dist/index.js +153 -9
- package/dist/labels-context.d.ts +93 -3
- package/dist/motion.d.ts +11 -0
- package/dist/motion.js +35 -0
- package/dist/overlay-stack.d.ts +6 -0
- package/dist/overlay-stack.js +13 -0
- package/dist/qr-model.d.ts +65 -0
- package/dist/qr-model.js +323 -0
- package/dist/relationship-graph-model.d.ts +92 -3
- package/dist/relationship-graph-model.js +134 -15
- package/dist/reorder.d.ts +30 -0
- package/dist/reorder.js +74 -0
- package/dist/rich-text.cjs +46 -4
- package/dist/scheduling-resource-model.d.ts +76 -0
- package/dist/scheduling-resource-model.js +74 -0
- package/dist/search-suggest-model.js +3 -1
- package/dist/shell-context.d.ts +11 -0
- package/dist/shell-context.js +7 -0
- package/dist/time-field-model.d.ts +46 -0
- package/dist/time-field-model.js +152 -0
- package/dist/toast-store.d.ts +22 -3
- package/dist/toast-store.js +26 -9
- package/package.json +2 -1
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
|
|
3
3
|
interface UseVirtualRowsOptions {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Rendered row height in pixels. With `measureRows` it is the estimate for the first paint,
|
|
6
|
+
* until the mounted rows have been measured.
|
|
7
|
+
*/
|
|
5
8
|
rowHeight: number;
|
|
9
|
+
/**
|
|
10
|
+
* A selector for the mounted data rows inside the container, e.g. `'tbody > tr[data-row]'`
|
|
11
|
+
* (HAR-1829). With it the hook sizes its spacers and window from the rows' real pitch (their
|
|
12
|
+
* mean `offsetHeight`) instead of trusting `rowHeight`, which only has to be close: a row's
|
|
13
|
+
* height comes from CSS and content (kit padding, a second line, density), and a wrong number
|
|
14
|
+
* gives a short scrollbar and a window that drifts away from the rows on screen. It measures
|
|
15
|
+
* when windowing starts, when `rowHeight` changes (a density switch) and when the container
|
|
16
|
+
* resizes, never while scrolling, so the spacers do not move under the reader. Spacer rows
|
|
17
|
+
* must not match it.
|
|
18
|
+
*/
|
|
19
|
+
measureRows?: string;
|
|
6
20
|
/** Rows rendered beyond each viewport edge. Default: 6. */
|
|
7
21
|
overscan?: number;
|
|
8
22
|
/**
|
|
@@ -30,6 +44,11 @@ interface UseVirtualRowsResult<T> {
|
|
|
30
44
|
padBottom: number;
|
|
31
45
|
totalHeight: number;
|
|
32
46
|
virtualized: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The row height in use: the measured pitch with `measureRows`, else the `rowHeight` option.
|
|
49
|
+
* Scroll a keyboard-focused row into view with it (`index * rowHeight`).
|
|
50
|
+
*/
|
|
51
|
+
rowHeight: number;
|
|
33
52
|
}
|
|
34
53
|
/**
|
|
35
54
|
* Owns scroll/resize observation and exposes the small visible row window.
|
|
@@ -37,6 +56,6 @@ interface UseVirtualRowsResult<T> {
|
|
|
37
56
|
* When the row count shrinks under a large scroll position the window is clamped to the new
|
|
38
57
|
* count in the same render, so `padTop` never exceeds the list (HAR-1616).
|
|
39
58
|
*/
|
|
40
|
-
declare function useVirtualRows<T>(rows: readonly T[], { rowHeight, overscan, threshold, estimatedViewportHeight, enabled }: UseVirtualRowsOptions): UseVirtualRowsResult<T>;
|
|
59
|
+
declare function useVirtualRows<T>(rows: readonly T[], { rowHeight: estimate, overscan, threshold, estimatedViewportHeight, enabled, measureRows }: UseVirtualRowsOptions): UseVirtualRowsResult<T>;
|
|
41
60
|
|
|
42
61
|
export { type UseVirtualRowsOptions, type UseVirtualRowsResult, useVirtualRows };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { shouldVirtualize, virtualWindow } from "../table-engine.js";
|
|
4
|
-
function useVirtualRows(rows, { rowHeight, overscan = 6, threshold = 100, estimatedViewportHeight = 0, enabled = true }) {
|
|
4
|
+
function useVirtualRows(rows, { rowHeight: estimate, overscan = 6, threshold = 100, estimatedViewportHeight = 0, enabled = true, measureRows }) {
|
|
5
5
|
const containerRef = useRef(null);
|
|
6
6
|
const [viewport, setViewport] = useState({ scrollTop: 0, height: 0 });
|
|
7
|
+
const [measured, setMeasured] = useState(null);
|
|
8
|
+
const measureRowsRef = useRef(() => {
|
|
9
|
+
});
|
|
7
10
|
useLayoutEffect(() => {
|
|
8
11
|
const element = containerRef.current;
|
|
9
12
|
if (!element) return;
|
|
@@ -21,7 +24,10 @@ function useVirtualRows(rows, { rowHeight, overscan = 6, threshold = 100, estima
|
|
|
21
24
|
};
|
|
22
25
|
commitMeasurement();
|
|
23
26
|
element.addEventListener("scroll", measure, { passive: true });
|
|
24
|
-
const observer = new ResizeObserver(
|
|
27
|
+
const observer = new ResizeObserver(() => {
|
|
28
|
+
measure();
|
|
29
|
+
measureRowsRef.current();
|
|
30
|
+
});
|
|
25
31
|
observer.observe(element);
|
|
26
32
|
return () => {
|
|
27
33
|
element.removeEventListener("scroll", measure);
|
|
@@ -31,6 +37,26 @@ function useVirtualRows(rows, { rowHeight, overscan = 6, threshold = 100, estima
|
|
|
31
37
|
}, []);
|
|
32
38
|
const height = viewport.height > 0 ? viewport.height : Math.max(0, estimatedViewportHeight);
|
|
33
39
|
const virtualized = enabled && height > 0 && shouldVirtualize(rows.length, threshold);
|
|
40
|
+
const rowHeight = measureRows && measured && measured.estimate === estimate ? measured.height : estimate;
|
|
41
|
+
measureRowsRef.current = () => {
|
|
42
|
+
const element = containerRef.current;
|
|
43
|
+
if (!element || !measureRows || !virtualized) return;
|
|
44
|
+
let total = 0;
|
|
45
|
+
let count = 0;
|
|
46
|
+
for (const row of Array.from(element.querySelectorAll(measureRows))) {
|
|
47
|
+
const h = row.offsetHeight;
|
|
48
|
+
if (h > 0) {
|
|
49
|
+
total += h;
|
|
50
|
+
count += 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (count === 0) return;
|
|
54
|
+
const next = Math.round(total / count * 100) / 100;
|
|
55
|
+
setMeasured((current) => current && current.estimate === estimate && current.height === next ? current : { height: next, estimate });
|
|
56
|
+
};
|
|
57
|
+
useLayoutEffect(() => {
|
|
58
|
+
measureRowsRef.current();
|
|
59
|
+
}, [virtualized, estimate, measureRows]);
|
|
34
60
|
const window = useMemo(
|
|
35
61
|
() => virtualized ? virtualWindow(viewport.scrollTop, height, rowHeight, rows.length, overscan) : { start: 0, end: rows.length, padTop: 0, padBottom: 0, total: rows.length * rowHeight },
|
|
36
62
|
[virtualized, overscan, rowHeight, rows.length, height, viewport.scrollTop]
|
|
@@ -43,7 +69,8 @@ function useVirtualRows(rows, { rowHeight, overscan = 6, threshold = 100, estima
|
|
|
43
69
|
padTop: window.padTop,
|
|
44
70
|
padBottom: window.padBottom,
|
|
45
71
|
totalHeight: window.total,
|
|
46
|
-
virtualized
|
|
72
|
+
virtualized,
|
|
73
|
+
rowHeight
|
|
47
74
|
};
|
|
48
75
|
}
|
|
49
76
|
export {
|
package/dist/icons/Icon.d.ts
CHANGED
|
@@ -269,6 +269,7 @@ declare function renderIcon(node: IconNode, { size, tone, label, strokeWidth, cl
|
|
|
269
269
|
clip?: number | string | undefined | undefined;
|
|
270
270
|
stroke: string;
|
|
271
271
|
href?: string | undefined | undefined;
|
|
272
|
+
d?: string | undefined | undefined;
|
|
272
273
|
capHeight?: number | string | undefined | undefined;
|
|
273
274
|
dy?: number | string | undefined | undefined;
|
|
274
275
|
dx?: number | string | undefined | undefined;
|
|
@@ -306,7 +307,6 @@ declare function renderIcon(node: IconNode, { size, tone, label, strokeWidth, cl
|
|
|
306
307
|
contentStyleType?: number | string | undefined | undefined;
|
|
307
308
|
cx?: number | string | undefined | undefined;
|
|
308
309
|
cy?: number | string | undefined | undefined;
|
|
309
|
-
d?: string | undefined | undefined;
|
|
310
310
|
decelerate?: number | string | undefined | undefined;
|
|
311
311
|
descent?: number | string | undefined | undefined;
|
|
312
312
|
diffuseConstant?: number | string | undefined | undefined;
|