@labpane/ui 1.0.0 → 1.2.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 +27 -12
- package/dist/chunk-NR3PLNO7.js +100 -0
- package/dist/chunk-NR3PLNO7.js.map +7 -0
- package/dist/index.js +6829 -610
- package/dist/index.js.map +4 -4
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/terminal.js.map +1 -1
- package/dist/ui/alert.d.ts +13 -0
- package/dist/ui/app-menu.d.ts +6 -1
- package/dist/ui/avatar.d.ts +11 -0
- package/dist/ui/badge.d.ts +17 -0
- package/dist/ui/breadcrumb.d.ts +11 -0
- package/dist/ui/browser-layout.d.ts +20 -0
- package/dist/ui/button.d.ts +27 -0
- package/dist/ui/card.d.ts +15 -0
- package/dist/ui/chart-frame.d.ts +4 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/classes.d.ts +5 -0
- package/dist/ui/command.d.ts +82 -0
- package/dist/ui/confirm-dialog.d.ts +28 -0
- package/dist/ui/copy-button.d.ts +7 -0
- package/dist/ui/dialog.d.ts +8 -17
- package/dist/ui/discard-dialog.d.ts +6 -0
- package/dist/ui/email-thread.d.ts +35 -0
- package/dist/ui/empty.d.ts +14 -0
- package/dist/ui/field.d.ts +26 -0
- package/dist/ui/file-input.d.ts +6 -0
- package/dist/ui/flame-graph-model.d.ts +23 -0
- package/dist/ui/flame-graph.d.ts +15 -0
- package/dist/ui/form-fields.d.ts +1 -1
- package/dist/ui/histogram.d.ts +23 -0
- package/dist/ui/index.d.ts +54 -3
- package/dist/ui/input-group.d.ts +28 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/kbd.d.ts +4 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/menu.d.ts +27 -0
- package/dist/ui/native-select.d.ts +7 -0
- package/dist/ui/nav-tabs.d.ts +7 -0
- package/dist/ui/overlay.d.ts +1 -0
- package/dist/ui/page.d.ts +22 -0
- package/dist/ui/rail.d.ts +16 -0
- package/dist/ui/search-input.d.ts +6 -0
- package/dist/ui/select.d.ts +13 -0
- package/dist/ui/separator.d.ts +6 -0
- package/dist/ui/settings.d.ts +14 -0
- package/dist/ui/sheet.d.ts +20 -0
- package/dist/ui/side-panel.d.ts +23 -0
- package/dist/ui/sidebar.d.ts +81 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/stat.d.ts +7 -0
- package/dist/ui/steps.d.ts +7 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/tab-state.d.ts +8 -0
- package/dist/ui/table-layout.d.ts +19 -0
- package/dist/ui/table-model.d.ts +42 -0
- package/dist/ui/table-screen.d.ts +9 -0
- package/dist/ui/table.d.ts +33 -22
- package/dist/ui/tabs.d.ts +13 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/theme.d.ts +22 -0
- package/dist/ui/time-series-chart.d.ts +19 -0
- package/dist/ui/time-series-model.d.ts +90 -0
- package/dist/ui/timing-tracks.d.ts +27 -0
- package/dist/ui/toggle.d.ts +22 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/topbar.d.ts +4 -0
- package/dist/ui/use-chart-width.d.ts +5 -0
- package/dist/ui/use-mobile.d.ts +1 -0
- package/package.json +18 -1
- package/styles.css +123 -0
- package/dist/chunk-3ZY2AVB4.js +0 -434
- package/dist/chunk-3ZY2AVB4.js.map +0 -7
- package/dist/ui/primitives.d.ts +0 -85
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
declare function Select({ value, defaultValue, onValueChange, ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SelectValue(props: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
5
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
6
|
+
size?: "sm" | "default";
|
|
7
|
+
variant?: "default" | "ghost";
|
|
8
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
11
|
+
hint?: React.ReactNode;
|
|
12
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
orientation?: "horizontal" | "vertical";
|
|
4
|
+
decorative?: boolean;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Separator };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const SettingsSection: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "title"> & {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
6
|
+
declare const SettingsRow: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
htmlFor?: string;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const SettingsFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
+
status?: React.ReactNode;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export { SettingsSection, SettingsRow, SettingsFooter };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Sheet({ open, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const sheetSides: {
|
|
7
|
+
right: string;
|
|
8
|
+
left: string;
|
|
9
|
+
top: string;
|
|
10
|
+
bottom: string;
|
|
11
|
+
};
|
|
12
|
+
declare const SheetContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
13
|
+
side?: keyof typeof sheetSides;
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const SheetHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const SheetFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
19
|
+
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
20
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SidePanelLimits = {
|
|
3
|
+
minWidth: number;
|
|
4
|
+
maxWidth: number;
|
|
5
|
+
slack: number;
|
|
6
|
+
mainMinWidth: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const sidePanelLimits: SidePanelLimits;
|
|
9
|
+
export declare function resolveDrag(desired: number, available: number, limits: SidePanelLimits): {
|
|
10
|
+
open: boolean;
|
|
11
|
+
width: number;
|
|
12
|
+
};
|
|
13
|
+
declare const SidePanel: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & {
|
|
14
|
+
open: boolean;
|
|
15
|
+
onOpenChange: (open: boolean) => void;
|
|
16
|
+
width: number;
|
|
17
|
+
onWidthChange: (width: number) => void;
|
|
18
|
+
side?: "left" | "right";
|
|
19
|
+
label: string;
|
|
20
|
+
limits?: Partial<SidePanelLimits>;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
23
|
+
export { SidePanel };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TooltipContent } from "./tooltip.js";
|
|
3
|
+
type SidebarState = {
|
|
4
|
+
state: "expanded" | "collapsed";
|
|
5
|
+
open: boolean;
|
|
6
|
+
setOpen: (open: boolean) => void;
|
|
7
|
+
openMobile: boolean;
|
|
8
|
+
setOpenMobile: (open: boolean) => void;
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
toggleSidebar: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare function useSidebar(): SidebarState;
|
|
13
|
+
declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
shortcut?: string | null;
|
|
18
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
|
+
side?: "left" | "right";
|
|
21
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
22
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
23
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
25
|
+
variant?: import("./button.js").ButtonVariant | null;
|
|
26
|
+
size?: import("./button.js").ButtonSize | null;
|
|
27
|
+
asChild?: boolean;
|
|
28
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
29
|
+
declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
31
|
+
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const SidebarContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const SidebarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const SidebarGroupContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
38
|
+
orientation?: "horizontal" | "vertical";
|
|
39
|
+
decorative?: boolean;
|
|
40
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const SidebarGroupLabel: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
42
|
+
asChild?: boolean;
|
|
43
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
declare const SidebarGroupAction: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
45
|
+
asChild?: boolean;
|
|
46
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
47
|
+
declare const SidebarMenu: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
48
|
+
declare const SidebarMenuItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
49
|
+
declare const menuButtonVariants: {
|
|
50
|
+
default: string;
|
|
51
|
+
outline: string;
|
|
52
|
+
};
|
|
53
|
+
declare const menuButtonSizes: {
|
|
54
|
+
default: string;
|
|
55
|
+
sm: string;
|
|
56
|
+
lg: string;
|
|
57
|
+
};
|
|
58
|
+
declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
isActive?: boolean;
|
|
61
|
+
variant?: keyof typeof menuButtonVariants;
|
|
62
|
+
size?: keyof typeof menuButtonSizes;
|
|
63
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
64
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
65
|
+
declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
66
|
+
asChild?: boolean;
|
|
67
|
+
showOnHover?: boolean;
|
|
68
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
69
|
+
declare const SidebarMenuBadge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
declare const SidebarMenuSkeleton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
71
|
+
showIcon?: boolean;
|
|
72
|
+
width?: string;
|
|
73
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
75
|
+
declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
76
|
+
declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
77
|
+
asChild?: boolean;
|
|
78
|
+
size?: "sm" | "md";
|
|
79
|
+
isActive?: boolean;
|
|
80
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
81
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Stats: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDListElement>, HTMLDListElement>, "ref"> & React.RefAttributes<HTMLDListElement>>;
|
|
3
|
+
declare const Stat: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const StatLabel: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
declare const StatValue: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
6
|
+
declare const StatDetail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export { Stats, Stat, StatLabel, StatValue, StatDetail };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Steps: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
3
|
+
declare const Step: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
index: number;
|
|
6
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export { Steps, Step };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
4
|
+
size?: "default" | "sm";
|
|
5
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export { Switch };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TabState = {
|
|
3
|
+
active: boolean;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const TabStateContext: React.Context<TabState>;
|
|
7
|
+
export declare function useTabActive(): boolean;
|
|
8
|
+
export declare function useTabVisible(): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function useTableWindow(count: number, rowHeight?: number): {
|
|
3
|
+
scrollRef: React.RefObject<HTMLDivElement | null>;
|
|
4
|
+
range: {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
};
|
|
8
|
+
reveal: (index: number) => void;
|
|
9
|
+
viewportHeight: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function useColumnResize(): {
|
|
12
|
+
widths: Record<string, number>;
|
|
13
|
+
change: (id: string, width: number) => void;
|
|
14
|
+
start: (event: React.PointerEvent<HTMLElement>, id: string, initial: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function useLoadMore(root: React.RefObject<HTMLElement | null>, onLoadMore: (() => void | Promise<void>) | undefined, hasMore: boolean): {
|
|
17
|
+
sentinel: React.RefObject<HTMLTableRowElement | null>;
|
|
18
|
+
loading: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type SortDirection = "asc" | "desc";
|
|
3
|
+
export type TableSort = {
|
|
4
|
+
column: string;
|
|
5
|
+
direction: SortDirection;
|
|
6
|
+
};
|
|
7
|
+
export type SortValue = string | number | boolean | null | undefined;
|
|
8
|
+
export type TableColumn<T> = {
|
|
9
|
+
id: string;
|
|
10
|
+
header: React.ReactNode;
|
|
11
|
+
headerDetail?: React.ReactNode;
|
|
12
|
+
srOnly?: boolean;
|
|
13
|
+
rowHeader?: boolean;
|
|
14
|
+
className?: string | ((row: T, index: number) => string | undefined);
|
|
15
|
+
headClassName?: string;
|
|
16
|
+
cell: (row: T, index: number) => React.ReactNode;
|
|
17
|
+
sortValue?: (row: T) => SortValue;
|
|
18
|
+
sort?: boolean;
|
|
19
|
+
align?: "start" | "end" | "center";
|
|
20
|
+
numeric?: boolean;
|
|
21
|
+
width?: string;
|
|
22
|
+
hideBelow?: "sm" | "md" | "lg";
|
|
23
|
+
};
|
|
24
|
+
export declare function compareValues(left: SortValue, right: SortValue): number;
|
|
25
|
+
export declare function sortRows<T>(rows: readonly T[], columns: TableColumn<T>[], sort: TableSort | null): readonly T[];
|
|
26
|
+
export declare const isSortable: <T>(column: TableColumn<T>) => boolean;
|
|
27
|
+
export declare function nextSort<T>(column: TableColumn<T>, current: TableSort | null): TableSort;
|
|
28
|
+
export declare function pageOf<T>(rows: readonly T[], pageSize: number | undefined, page: number): {
|
|
29
|
+
size: number;
|
|
30
|
+
pages: number;
|
|
31
|
+
current: number;
|
|
32
|
+
offset: number;
|
|
33
|
+
rows: readonly T[];
|
|
34
|
+
};
|
|
35
|
+
export declare function visibleRowRange(count: number, scrollTop: number, height: number, rowHeight: number, overscan?: number): {
|
|
36
|
+
start: number;
|
|
37
|
+
end: number;
|
|
38
|
+
};
|
|
39
|
+
export declare const clampColumnWidth: (width: number) => number;
|
|
40
|
+
export declare function column<T>(id: string, header: string, value: (row: T) => SortValue, cell?: (row: T) => React.ReactNode): TableColumn<T>;
|
|
41
|
+
export declare const mono: <T>(id: string, header: string, value: (row: T) => unknown) => TableColumn<T>;
|
|
42
|
+
export declare const num: <T>(id: string, header: string, value: (row: T) => number, digits?: number, headerDetail?: string) => TableColumn<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const TableScreen: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "title"> & {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
actions?: React.ReactNode;
|
|
6
|
+
tabs?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { TableScreen };
|
package/dist/ui/table.d.ts
CHANGED
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type
|
|
3
|
-
export type TableColumn
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
numeric?: boolean;
|
|
9
|
-
cell: (row: T) => React.ReactNode;
|
|
10
|
-
sortValue: (row: T) => string | number | null | undefined;
|
|
11
|
-
};
|
|
12
|
-
type Sort = {
|
|
13
|
-
column: string;
|
|
14
|
-
direction: "asc" | "desc";
|
|
15
|
-
};
|
|
16
|
-
export declare function Table<T>({ label, columns, rows, rowKey, loading, empty, defaultSort, onRowActivate, rowLabel, }: {
|
|
17
|
-
label: string;
|
|
2
|
+
import { type TableColumn, type TableSort } from "./table-model.js";
|
|
3
|
+
export type { SortDirection, SortValue, TableColumn, TableSort, } from "./table-model.js";
|
|
4
|
+
export { column, mono, num } from "./table-model.js";
|
|
5
|
+
export type TableProps<T> = {
|
|
6
|
+
label?: string;
|
|
7
|
+
caption?: string;
|
|
18
8
|
columns: TableColumn<T>[];
|
|
19
9
|
rows: readonly T[];
|
|
20
10
|
rowKey: (row: T, index: number) => string;
|
|
21
|
-
loading?: boolean;
|
|
22
11
|
empty?: React.ReactNode;
|
|
23
|
-
|
|
12
|
+
className?: string;
|
|
13
|
+
tableClassName?: string;
|
|
14
|
+
scrollClassName?: string;
|
|
15
|
+
rowClassName?: (row: T) => string | undefined;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
skeletonRows?: number;
|
|
18
|
+
sort?: TableSort | null;
|
|
19
|
+
defaultSort?: TableSort | null;
|
|
20
|
+
onSortChange?: (sort: TableSort | null) => void;
|
|
21
|
+
clientSort?: boolean;
|
|
22
|
+
sortDisabled?: boolean;
|
|
24
23
|
onRowActivate?: (row: T) => void;
|
|
25
24
|
rowLabel?: (row: T) => string;
|
|
25
|
+
selectedKey?: string | null;
|
|
26
|
+
pageSize?: number;
|
|
27
|
+
rowHeight?: number;
|
|
28
|
+
onLoadMore?: () => void | Promise<void>;
|
|
29
|
+
hasMore?: boolean;
|
|
30
|
+
banner?: React.ReactNode;
|
|
31
|
+
tabs?: React.ReactNode;
|
|
32
|
+
footerStart?: React.ReactNode;
|
|
33
|
+
footerCenter?: React.ReactNode;
|
|
34
|
+
footerEnd?: React.ReactNode;
|
|
35
|
+
};
|
|
36
|
+
declare function Table<T>({ label, caption, columns, rows, rowKey, empty, className, tableClassName, scrollClassName, rowClassName, loading, skeletonRows, sort, defaultSort, onSortChange, clientSort, sortDisabled, onRowActivate, rowLabel, selectedKey, pageSize, rowHeight, onLoadMore, hasMore, banner, tabs, footerStart, footerCenter, footerEnd, }: TableProps<T>): React.JSX.Element;
|
|
37
|
+
declare function TableStack({ title, detail, }: {
|
|
38
|
+
title: React.ReactNode;
|
|
39
|
+
detail?: React.ReactNode;
|
|
26
40
|
}): React.JSX.Element;
|
|
27
|
-
export
|
|
28
|
-
export declare const mono: <T>(id: string, header: string, value: (row: T) => unknown) => TableColumn<T>;
|
|
29
|
-
export declare const num: <T>(id: string, header: string, value: (row: T) => number, digits?: number, headerDetail?: string) => TableColumn<T>;
|
|
30
|
-
export {};
|
|
41
|
+
export { Table, TableStack };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const tabsListVariants: {
|
|
5
|
+
default: string;
|
|
6
|
+
line: string;
|
|
7
|
+
};
|
|
8
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
|
+
variant?: keyof typeof tabsListVariants;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare const themeColors: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "link", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "destructive-foreground", "destructive-muted", "success", "success-foreground", "warning", "warning-foreground", "info", "info-foreground", "border", "input", "input-background", "ring", "overlay", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
3
|
+
export type ThemeColor = (typeof themeColors)[number];
|
|
4
|
+
export type ThemeColors = Partial<Record<ThemeColor, string>>;
|
|
5
|
+
export type Theme = {
|
|
6
|
+
light?: ThemeColors;
|
|
7
|
+
dark?: ThemeColors;
|
|
8
|
+
fonts?: {
|
|
9
|
+
sans?: string;
|
|
10
|
+
mono?: string;
|
|
11
|
+
display?: string;
|
|
12
|
+
};
|
|
13
|
+
radius?: string;
|
|
14
|
+
radiusDialog?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function themeCss(theme: Theme, selector?: string): string;
|
|
17
|
+
export declare function ThemeStyle({ theme, selector, }: {
|
|
18
|
+
theme: Theme;
|
|
19
|
+
selector?: string;
|
|
20
|
+
}): React.ReactElement<{
|
|
21
|
+
"data-slot": string;
|
|
22
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ChartOptions, type SeriesPoint } from "./time-series-model.js";
|
|
3
|
+
export { DAY, DEFAULT_OPTIONS, type ChartOptions, type SeriesPoint, } from "./time-series-model.js";
|
|
4
|
+
export type TimeSeriesChartProps = {
|
|
5
|
+
points: SeriesPoint[];
|
|
6
|
+
series: {
|
|
7
|
+
key: string;
|
|
8
|
+
color: string;
|
|
9
|
+
}[];
|
|
10
|
+
start: number;
|
|
11
|
+
options: ChartOptions;
|
|
12
|
+
onOptionsChange: (options: ChartOptions) => void;
|
|
13
|
+
title?: string;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
unit?: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
declare const TimeSeriesChart: React.ForwardRefExoticComponent<TimeSeriesChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export { TimeSeriesChart };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Pure chart geometry: no DOM, React, clock or storage. */
|
|
2
|
+
export declare const DAY = 86400000;
|
|
3
|
+
export type Range = [number, number];
|
|
4
|
+
export type SeriesPoint = {
|
|
5
|
+
time: number;
|
|
6
|
+
total: number;
|
|
7
|
+
values: Record<string, number>;
|
|
8
|
+
annotation?: string;
|
|
9
|
+
carried?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type ChartOptions = {
|
|
12
|
+
logarithmic: boolean;
|
|
13
|
+
logBase: number;
|
|
14
|
+
sma: boolean;
|
|
15
|
+
ema: boolean;
|
|
16
|
+
bollinger: boolean;
|
|
17
|
+
forecast: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const DEFAULT_OPTIONS: ChartOptions;
|
|
20
|
+
export declare const FORECAST_DAYS = 90;
|
|
21
|
+
export declare const INDICATOR_PERIOD = 20;
|
|
22
|
+
export declare function nearestPoint(points: SeriesPoint[], time: number): number;
|
|
23
|
+
export declare function clampRange(range: Range, bounds: Range, minimum?: number): Range;
|
|
24
|
+
export declare function zoomRange(range: Range, factor: number, anchor: number, bounds: Range): Range;
|
|
25
|
+
export declare function indicators(points: SeriesPoint[], period?: number): {
|
|
26
|
+
time: number;
|
|
27
|
+
ema: number;
|
|
28
|
+
sma: number | null;
|
|
29
|
+
upper: number | null;
|
|
30
|
+
lower: number | null;
|
|
31
|
+
}[];
|
|
32
|
+
/** Fits the last 90 daily values, then anchors the projection to the latest actual value. */
|
|
33
|
+
export declare function regression(points: SeriesPoint[]): {
|
|
34
|
+
slope: number;
|
|
35
|
+
r2: number;
|
|
36
|
+
points: {
|
|
37
|
+
time: number;
|
|
38
|
+
value: number;
|
|
39
|
+
}[];
|
|
40
|
+
} | null;
|
|
41
|
+
export declare function niceTicks(maximum: number, count?: number): number[];
|
|
42
|
+
export declare function chartModel(points: SeriesPoint[], keys: string[], range: Range, width: number, height: number, options: ChartOptions, lockedDomain?: Range): {
|
|
43
|
+
plot: {
|
|
44
|
+
left: number;
|
|
45
|
+
right: number;
|
|
46
|
+
top: number;
|
|
47
|
+
bottom: number;
|
|
48
|
+
};
|
|
49
|
+
domain: Range;
|
|
50
|
+
x: (time: number) => number;
|
|
51
|
+
y: (value: number) => number;
|
|
52
|
+
timeAt: (pixel: number) => number;
|
|
53
|
+
bands: {
|
|
54
|
+
key: string;
|
|
55
|
+
path: string;
|
|
56
|
+
}[];
|
|
57
|
+
totalPath: string;
|
|
58
|
+
xTicks: {
|
|
59
|
+
value: number;
|
|
60
|
+
pixel: number;
|
|
61
|
+
}[];
|
|
62
|
+
yTicks: {
|
|
63
|
+
value: number;
|
|
64
|
+
pixel: number;
|
|
65
|
+
}[];
|
|
66
|
+
positions: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
}[];
|
|
70
|
+
computed: {
|
|
71
|
+
time: number;
|
|
72
|
+
ema: number;
|
|
73
|
+
sma: number | null;
|
|
74
|
+
upper: number | null;
|
|
75
|
+
lower: number | null;
|
|
76
|
+
}[];
|
|
77
|
+
smaPath: string;
|
|
78
|
+
emaPath: string;
|
|
79
|
+
upperPath: string;
|
|
80
|
+
lowerPath: string;
|
|
81
|
+
forecast: {
|
|
82
|
+
slope: number;
|
|
83
|
+
r2: number;
|
|
84
|
+
points: {
|
|
85
|
+
time: number;
|
|
86
|
+
value: number;
|
|
87
|
+
}[];
|
|
88
|
+
} | null;
|
|
89
|
+
forecastPath: string;
|
|
90
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TimingSpan = {
|
|
3
|
+
id: string;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
label: string;
|
|
7
|
+
detail?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
/** A bound or observation window, not a measured execution interval. */
|
|
10
|
+
uncertain?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TimingTrack = {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
spans: TimingSpan[];
|
|
16
|
+
};
|
|
17
|
+
export type TimingTracksProps = {
|
|
18
|
+
tracks: TimingTrack[];
|
|
19
|
+
from: number;
|
|
20
|
+
to: number;
|
|
21
|
+
label?: string;
|
|
22
|
+
unit?: string;
|
|
23
|
+
onSelect?: (span: TimingSpan) => void;
|
|
24
|
+
};
|
|
25
|
+
/** Shared-clock tracks supplied by the caller. Deliberately no clock conversion. */
|
|
26
|
+
declare const TimingTracks: React.ForwardRefExoticComponent<TimingTracksProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export { TimingTracks };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4
|
+
declare const toggleVariants: {
|
|
5
|
+
default: string;
|
|
6
|
+
outline: string;
|
|
7
|
+
};
|
|
8
|
+
declare const toggleSizes: {
|
|
9
|
+
default: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
lg: string;
|
|
12
|
+
};
|
|
13
|
+
type ToggleStyle = {
|
|
14
|
+
variant?: keyof typeof toggleVariants;
|
|
15
|
+
size?: keyof typeof toggleSizes;
|
|
16
|
+
};
|
|
17
|
+
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & ToggleStyle & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref">) & ToggleStyle & {
|
|
19
|
+
spacing?: number;
|
|
20
|
+
}) & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & ToggleStyle & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
export { Toggle, ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
4
|
+
declare function Tooltip({ open, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Topbar: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
3
|
+
declare const TopbarActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Topbar, TopbarActions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|