@siyahi/ui 0.1.8-next.4 → 0.1.9-next.2
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 +38 -18
- package/THIRD_PARTY_NOTICES.md +11 -10
- package/dist/components/registry/charts/area-chart-card.d.ts +4 -3
- package/dist/components/registry/charts/area-chart-card.js +2 -2
- package/dist/components/registry/charts/bar-chart-card.d.ts +7 -1
- package/dist/components/registry/charts/bar-chart-card.js +20 -5
- package/dist/components/registry/charts/line-chart-card.d.ts +5 -2
- package/dist/components/registry/charts/line-chart-card.js +2 -2
- package/dist/components/registry/dashboard-01/section-cards.d.ts +9 -2
- package/dist/components/registry/dashboard-01/section-cards.js +32 -21
- package/dist/components/registry/dashboardcn/bar-list.d.ts +3 -1
- package/dist/components/registry/dashboardcn/bar-list.js +2 -2
- package/dist/components/registry/dashboardcn/distribution-bar.d.ts +38 -0
- package/dist/components/registry/dashboardcn/distribution-bar.js +118 -0
- package/dist/components/registry/minidev/copy-button.d.ts +11 -0
- package/dist/components/registry/minidev/copy-button.js +34 -0
- package/dist/components/registry/niko-table/components/data-table-search-filter.d.ts +35 -0
- package/dist/components/registry/niko-table/components/data-table-search-filter.js +44 -0
- package/dist/components/registry/niko-table/filters/table-search-filter.d.ts +38 -0
- package/dist/components/registry/niko-table/filters/table-search-filter.js +103 -0
- package/dist/components/siyahi/data-list.d.ts +14 -0
- package/dist/components/siyahi/data-list.js +25 -0
- package/dist/components/siyahi/data-table-row-count.d.ts +11 -0
- package/dist/components/siyahi/data-table-row-count.js +18 -0
- package/dist/components/siyahi/data-table-sort-header.d.ts +15 -0
- package/dist/components/siyahi/data-table-sort-header.js +36 -0
- package/dist/components/siyahi/inline-code.d.ts +7 -0
- package/dist/components/siyahi/inline-code.js +11 -0
- package/dist/components/siyahi/page-section.d.ts +21 -0
- package/dist/components/siyahi/page-section.js +39 -0
- package/dist/components/siyahi/tone-progress.d.ts +15 -0
- package/dist/components/siyahi/tone-progress.js +18 -0
- package/dist/components/siyahi/treemap.d.ts +7 -0
- package/dist/components/siyahi/treemap.js +69 -2
- package/dist/components/ui/code-block.d.ts +28 -0
- package/dist/components/ui/code-block.js +122 -0
- package/dist/index.d.ts +19 -8
- package/dist/index.js +14 -3
- package/dist/lib/chart-frame.d.ts +10 -3
- package/dist/lib/chart-frame.js +161 -55
- package/dist/lib/chart-series.d.ts +55 -3
- package/dist/lib/format.d.ts +3 -0
- package/dist/lib/format.js +6 -1
- package/dist/lib/treemap.d.ts +4 -0
- package/dist/lib/treemap.js +9 -4
- package/package.json +1 -1
- package/registry.lock.json +32 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/components/ui/code-block.tsx
|
|
8
|
+
const codeBlockVariants = cva("group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-2xl text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/30 data-[size=sm]:rounded-xl data-[size=sm]:text-xs", {
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
default: "bg-muted text-foreground ring-1 ring-foreground/5 dark:ring-foreground/10",
|
|
11
|
+
destructive: "bg-destructive/5 text-destructive ring-1 ring-destructive/15 dark:bg-destructive/10 dark:ring-destructive/20"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { variant: "default" }
|
|
14
|
+
});
|
|
15
|
+
function CodeBlock({ className, variant = "default", size = "default", ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
"data-slot": "code-block",
|
|
18
|
+
"data-variant": variant,
|
|
19
|
+
"data-size": size,
|
|
20
|
+
className: cn(codeBlockVariants({ variant }), className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function CodeBlockHeader({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
"data-slot": "code-block-header",
|
|
27
|
+
className: cn("flex min-w-0 shrink-0 items-center gap-2 px-5 pt-5 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pt-3 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function CodeBlockTitle({ className, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
"data-slot": "code-block-title",
|
|
34
|
+
className: cn("min-w-0 truncate font-sans text-sm font-medium text-foreground group-data-[size=sm]/code-block:text-xs group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-4 group-data-[size=sm]/code-block:[&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5", className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CodeBlockActions({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
"data-slot": "code-block-actions",
|
|
41
|
+
className: cn("-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 *:data-[slot=button]:hover:bg-foreground/5 dark:*:data-[slot=button]:hover:bg-foreground/10 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-4 [[data-slot=code-block]>&]:top-4 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-2 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10", className),
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function CodeBlockCopyButton({ value, variant = "ghost", size = "icon-xs", className, onClick, ...props }) {
|
|
46
|
+
const [copied, setCopied] = React$1.useState(false);
|
|
47
|
+
React$1.useEffect(() => {
|
|
48
|
+
if (!copied) return;
|
|
49
|
+
const timeout = setTimeout(() => setCopied(false), 2e3);
|
|
50
|
+
return () => clearTimeout(timeout);
|
|
51
|
+
}, [copied]);
|
|
52
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
53
|
+
"data-slot": "code-block-copy-button",
|
|
54
|
+
"data-copied": copied || void 0,
|
|
55
|
+
variant,
|
|
56
|
+
size,
|
|
57
|
+
"aria-label": copied ? "Copied" : "Copy",
|
|
58
|
+
className: cn("hover:bg-foreground/5 dark:hover:bg-foreground/10", className),
|
|
59
|
+
onClick: (event) => {
|
|
60
|
+
onClick?.(event);
|
|
61
|
+
navigator.clipboard.writeText(value).then(() => setCopied(true)).catch(() => {});
|
|
62
|
+
},
|
|
63
|
+
...props,
|
|
64
|
+
children: copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {})
|
|
65
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
66
|
+
"aria-live": "polite",
|
|
67
|
+
className: "sr-only",
|
|
68
|
+
children: copied ? "Copied" : ""
|
|
69
|
+
})] });
|
|
70
|
+
}
|
|
71
|
+
function CodeBlockContent({ className, children, style, wrap = false, lineNumbers = false, startLine = 1, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
73
|
+
"data-slot": "code-block-content",
|
|
74
|
+
"data-wrap": wrap || void 0,
|
|
75
|
+
"data-numbered": lineNumbers || void 0,
|
|
76
|
+
dir: "ltr",
|
|
77
|
+
tabIndex: 0,
|
|
78
|
+
style: {
|
|
79
|
+
counterReset: `line ${startLine - 1}`,
|
|
80
|
+
...style
|
|
81
|
+
},
|
|
82
|
+
className: cn("min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-5 py-5 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:py-3 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap", className),
|
|
83
|
+
...props,
|
|
84
|
+
children: /* @__PURE__ */ jsx("code", {
|
|
85
|
+
"data-slot": "code-block-code",
|
|
86
|
+
className: "grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",
|
|
87
|
+
children: lineNumbers && typeof children === "string" ? children.replace(/\n$/, "").split("\n").map((line, index) => /* @__PURE__ */ jsx(CodeBlockLine, { children: line }, index)) : children
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const codeBlockLineVariants = cva("relative -mx-5 block min-h-lh px-5 group-data-[size=sm]/code-block:-mx-3 group-data-[size=sm]/code-block:px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']", {
|
|
92
|
+
variants: { variant: {
|
|
93
|
+
default: "",
|
|
94
|
+
added: "bg-foreground/5 after:content-['+']",
|
|
95
|
+
removed: "bg-destructive/10 after:text-destructive after:content-['−']",
|
|
96
|
+
highlighted: "bg-foreground/5"
|
|
97
|
+
} },
|
|
98
|
+
defaultVariants: { variant: "default" }
|
|
99
|
+
});
|
|
100
|
+
function CodeBlockLine({ className, variant = "default", children, ...props }) {
|
|
101
|
+
const empty = children === void 0 || children === null || children === "" || Array.isArray(children) && children.length === 0;
|
|
102
|
+
return /* @__PURE__ */ jsx("span", {
|
|
103
|
+
"data-slot": "code-block-line",
|
|
104
|
+
"data-variant": variant,
|
|
105
|
+
className: cn(codeBlockLineVariants({ variant }), className),
|
|
106
|
+
...props,
|
|
107
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
108
|
+
"data-slot": "code-block-line-content",
|
|
109
|
+
className: "min-w-0",
|
|
110
|
+
children: empty ? "\n" : children
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function CodeBlockFooter({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsx("div", {
|
|
116
|
+
"data-slot": "code-block-footer",
|
|
117
|
+
className: cn("flex min-w-0 shrink-0 items-center gap-2 px-5 pb-5 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pb-3", className),
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { ChartColor, ChartSeries, ChartSeriesItem, SeriesChartProps } from "./lib/chart-series.js";
|
|
1
|
+
import { ChartColor, ChartCurve, ChartReferenceLine, ChartSeries, ChartSeriesItem, NumericXProps, SeriesChartProps } from "./lib/chart-series.js";
|
|
2
2
|
import { AreaChartCard, AreaChartCardProps } from "./components/registry/charts/area-chart-card.js";
|
|
3
3
|
import { BarChartCard, BarChartCardProps } from "./components/registry/charts/bar-chart-card.js";
|
|
4
|
-
import { LineChartCard } from "./components/registry/charts/line-chart-card.js";
|
|
5
|
-
import { SectionCard, SectionCards } from "./components/registry/dashboard-01/section-cards.js";
|
|
4
|
+
import { LineChartCard, LineChartCardProps } from "./components/registry/charts/line-chart-card.js";
|
|
5
|
+
import { SectionCard, SectionCards, SectionCardsProps } from "./components/registry/dashboard-01/section-cards.js";
|
|
6
6
|
import { BarList, BarListItem, BarListProps } from "./components/registry/dashboardcn/bar-list.js";
|
|
7
|
+
import { DistributionBar, DistributionBarProps, DistributionMarker, DistributionSegment } from "./components/registry/dashboardcn/distribution-bar.js";
|
|
7
8
|
import { Activity, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, ColorConfig, Labels } from "./components/registry/heatmap/calendar-heatmap.js";
|
|
8
9
|
import { StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue } from "./components/registry/heatmap/status-heatmap.js";
|
|
9
10
|
import { ColorConfig as ColorConfig$1, WeekdayExtraColumnSpec, WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBlockProps, WeekdayHeatmapBody, WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, WeekdayHeatmapFooterProps, WeekdayHeatmapLabels, WeekdayHeatmapLegend, WeekdayHeatmapLegendProps, WeekdayHeatmapProps, WeekdayHeatmapStat, WeekdayHeatmapStatProps, WeekdayHour, WeekdayHourlyActivity, WeekdayIndex } from "./components/registry/heatmap/weekday-heatmap.js";
|
|
11
|
+
import { Button, buttonVariants } from "./components/ui/button.js";
|
|
12
|
+
import { CopyButton } from "./components/registry/minidev/copy-button.js";
|
|
10
13
|
import { TableColumnActions, TableColumnActionsProps } from "./components/registry/niko-table/filters/table-column-actions.js";
|
|
11
14
|
import { DataTableColumnActions } from "./components/registry/niko-table/components/data-table-column-actions.js";
|
|
12
15
|
import { DataTableColumnFilter } from "./components/registry/niko-table/components/data-table-column-filter.js";
|
|
@@ -24,6 +27,8 @@ import { DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, resolveR
|
|
|
24
27
|
import { DataTableRowContextMenu, DataTableRowContextMenuProps } from "./components/registry/niko-table/components/data-table-row-context-menu.js";
|
|
25
28
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
26
29
|
import { DataTableRowMenuScope, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, useDataTableRow } from "./components/registry/niko-table/components/data-table-row-menu.js";
|
|
30
|
+
import { TableSearchFilter, TableSearchFilterProps } from "./components/registry/niko-table/filters/table-search-filter.js";
|
|
31
|
+
import { DataTableSearchFilter } from "./components/registry/niko-table/components/data-table-search-filter.js";
|
|
27
32
|
import { DataTableToolbarSection, DataTableToolbarSectionProps } from "./components/registry/niko-table/components/data-table-toolbar-section.js";
|
|
28
33
|
import { ActiveCell, ActiveSelection, ColumnResizeInfo, DataTableActions, DataTableContext, DataTableContextState, DataTableProvider, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, ScrollAlign, ScrollRowIntoView, flashCellKey, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter } from "./components/registry/niko-table/core/data-table-context.js";
|
|
29
34
|
import { DataTableErrorBoundary, DataTableErrorBoundaryProps } from "./components/registry/niko-table/core/data-table-error-boundary.js";
|
|
@@ -36,18 +41,24 @@ import { NavMain } from "./components/registry/sidebar-07/nav-main.js";
|
|
|
36
41
|
import { NavProjects } from "./components/registry/sidebar-07/nav-projects.js";
|
|
37
42
|
import { NavUser } from "./components/registry/sidebar-07/nav-user.js";
|
|
38
43
|
import { TeamSwitcher } from "./components/registry/sidebar-07/team-switcher.js";
|
|
39
|
-
import { Button, buttonVariants } from "./components/ui/button.js";
|
|
40
44
|
import { Input } from "./components/ui/input.js";
|
|
41
45
|
import { Separator } from "./components/ui/separator.js";
|
|
42
46
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
43
47
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/ui/sidebar.js";
|
|
44
48
|
import { AppSidebar, AppSidebarProps } from "./components/registry/sidebar-07/app-sidebar.js";
|
|
49
|
+
import { DataList, DataListItem, DataListItemProps } from "./components/siyahi/data-list.js";
|
|
50
|
+
import { DataTableRowCount, DataTableRowCountProps } from "./components/siyahi/data-table-row-count.js";
|
|
51
|
+
import { DataTableSortHeader } from "./components/siyahi/data-table-sort-header.js";
|
|
45
52
|
import { Delta, DeltaProps } from "./components/siyahi/delta.js";
|
|
53
|
+
import { InlineCode } from "./components/siyahi/inline-code.js";
|
|
46
54
|
import { LocalTime, LocalTimeProps } from "./components/siyahi/local-time.js";
|
|
55
|
+
import { PageSection, PageSectionProps, PageSubheading } from "./components/siyahi/page-section.js";
|
|
47
56
|
import { PriceChart, PriceChartProps } from "./components/siyahi/price-chart.js";
|
|
48
57
|
import { SiyahiLocale, defaultLocale } from "./lib/locale.js";
|
|
49
58
|
import { SiyahiProvider, SiyahiProviderProps, useLocale } from "./components/siyahi/siyahi-provider.js";
|
|
50
|
-
import {
|
|
59
|
+
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "./components/ui/progress.js";
|
|
60
|
+
import { ToneProgress, ToneProgressProps } from "./components/siyahi/tone-progress.js";
|
|
61
|
+
import { Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps } from "./components/siyahi/treemap.js";
|
|
51
62
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/ui/accordion.js";
|
|
52
63
|
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./components/ui/alert.js";
|
|
53
64
|
import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./components/ui/avatar.js";
|
|
@@ -56,13 +67,13 @@ import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, Breadcr
|
|
|
56
67
|
import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
57
68
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card.js";
|
|
58
69
|
import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
70
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./components/ui/code-block.js";
|
|
59
71
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
60
72
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
|
|
61
73
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./components/ui/command.js";
|
|
62
74
|
import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./components/ui/context-menu.js";
|
|
63
75
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from "./components/ui/input-group.js";
|
|
64
76
|
import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "./components/ui/popover.js";
|
|
65
|
-
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "./components/ui/progress.js";
|
|
66
77
|
import { ScrollArea, ScrollBar } from "./components/ui/scroll-area.js";
|
|
67
78
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/ui/select.js";
|
|
68
79
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/ui/sheet.js";
|
|
@@ -73,6 +84,6 @@ import { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants } from "./co
|
|
|
73
84
|
import { Textarea } from "./components/ui/textarea.js";
|
|
74
85
|
import { Toggle, toggleVariants } from "./components/ui/toggle.js";
|
|
75
86
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
76
|
-
import { Formatters, TimeOptions, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
87
|
+
import { Formatters, TimeOptions, count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
77
88
|
import { Area, AreaChart, Bar, BarChart, CartesianGrid, Line, LineChart, ReferenceLine, XAxis, YAxis } from "./lib/recharts.js";
|
|
78
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, Area, AreaChart, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarChartCardProps, BarList, BarListItem, BarListProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartColor, ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartSeries, ChartSeriesItem, ChartStyle, ChartTooltip, ChartTooltipContent, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorConfig, ColumnResizeInfo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowContextValue, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableGroupedRowsProps, DataTableHeader, type DataTableHeader$1 as DataTableHeaderCell, DataTableHeaderProps, type DataTableInstance, DataTableLoading, DataTableLoadingMore, DataTableLoadingMoreProps, DataTableLoadingProps, DataTableProvider, DataTableRoot, type DataTableRow, DataTableRowContextMenu, DataTableRowContextMenuProps, DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, DataTableRowMenuScope, DataTableSkeleton, DataTableSkeletonProps, DataTableToolbarSection, DataTableToolbarSectionProps, Delta, DeltaProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtendedColumnFilter, type ExtendedColumnSort, type FilterOperator, type FilterOperatorValues, type FilterVariant, type FilterVariantValues, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, Formatters, type GlobalFilter, GroupedBodyRow, GroupedBodyRowProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type JoinOperator, type JoinOperatorValues, Labels, Line, LineChart, LineChartCard, LocalTime, LocalTimeProps, NavMain, NavProjects, NavUser, type Option, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollAlign, ScrollArea, ScrollBar, type ScrollEvent, ScrollRowIntoView, SectionCard, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesChartProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiLocale, SiyahiProvider, SiyahiProviderProps, Skeleton, Slider, StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, TimeOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapItem, TreemapProps, type ValueOf, type ColorConfig$1 as WeekdayColorConfig, type WeekdayExtraColumnSpec, type WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, type WeekdayHeatmapBlockProps, WeekdayHeatmapBody, type WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, type WeekdayHeatmapFooterProps, type WeekdayHeatmapLabels, WeekdayHeatmapLegend, type WeekdayHeatmapLegendProps, type WeekdayHeatmapProps, WeekdayHeatmapStat, type WeekdayHeatmapStatProps, type WeekdayHour, type WeekdayHourlyActivity, type WeekdayIndex, XAxis, YAxis, badgeVariants, buttonVariants, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
89
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, Area, AreaChart, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarChartCardProps, BarList, BarListItem, BarListProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartColor, ChartConfig, ChartContainer, ChartCurve, ChartLegend, ChartLegendContent, ChartReferenceLine, ChartSeries, ChartSeriesItem, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorConfig, ColumnResizeInfo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataList, DataListItem, DataListItemProps, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowContextValue, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableGroupedRowsProps, DataTableHeader, type DataTableHeader$1 as DataTableHeaderCell, DataTableHeaderProps, type DataTableInstance, DataTableLoading, DataTableLoadingMore, DataTableLoadingMoreProps, DataTableLoadingProps, DataTableProvider, DataTableRoot, type DataTableRow, DataTableRowContextMenu, DataTableRowContextMenuProps, DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, DataTableRowCount, DataTableRowCountProps, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSkeletonProps, DataTableSortHeader, DataTableToolbarSection, DataTableToolbarSectionProps, Delta, DeltaProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DistributionBar, DistributionBarProps, DistributionMarker, DistributionSegment, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtendedColumnFilter, type ExtendedColumnSort, type FilterOperator, type FilterOperatorValues, type FilterVariant, type FilterVariantValues, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, Formatters, type GlobalFilter, GroupedBodyRow, GroupedBodyRowProps, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type JoinOperator, type JoinOperatorValues, Labels, Line, LineChart, LineChartCard, LineChartCardProps, LocalTime, LocalTimeProps, NavMain, NavProjects, NavUser, NumericXProps, type Option, PageSection, PageSectionProps, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollAlign, ScrollArea, ScrollBar, type ScrollEvent, ScrollRowIntoView, SectionCard, SectionCards, SectionCardsProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesChartProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiLocale, SiyahiProvider, SiyahiProviderProps, Skeleton, Slider, StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, TableSearchFilterProps, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, TimeOptions, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, ToneProgressProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps, type ValueOf, type ColorConfig$1 as WeekdayColorConfig, type WeekdayExtraColumnSpec, type WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, type WeekdayHeatmapBlockProps, WeekdayHeatmapBody, type WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, type WeekdayHeatmapFooterProps, type WeekdayHeatmapLabels, WeekdayHeatmapLegend, type WeekdayHeatmapLegendProps, type WeekdayHeatmapProps, WeekdayHeatmapStat, type WeekdayHeatmapStatProps, type WeekdayHour, type WeekdayHourlyActivity, type WeekdayIndex, XAxis, YAxis, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Button, buttonVariants } from "./components/ui/button.js";
|
|
|
7
7
|
import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
8
8
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card.js";
|
|
9
9
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
10
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./components/ui/code-block.js";
|
|
10
11
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
11
12
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
|
|
12
13
|
import { Input } from "./components/ui/input.js";
|
|
@@ -35,11 +36,13 @@ import { AreaChartCard } from "./components/registry/charts/area-chart-card.js";
|
|
|
35
36
|
import { BarChartCard } from "./components/registry/charts/bar-chart-card.js";
|
|
36
37
|
import { LineChartCard } from "./components/registry/charts/line-chart-card.js";
|
|
37
38
|
import { SectionCards } from "./components/registry/dashboard-01/section-cards.js";
|
|
38
|
-
import { money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
39
|
+
import { count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
39
40
|
import { BarList } from "./components/registry/dashboardcn/bar-list.js";
|
|
41
|
+
import { DistributionBar } from "./components/registry/dashboardcn/distribution-bar.js";
|
|
40
42
|
import { CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat } from "./components/registry/heatmap/calendar-heatmap.js";
|
|
41
43
|
import { StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat } from "./components/registry/heatmap/status-heatmap.js";
|
|
42
44
|
import { WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat } from "./components/registry/heatmap/weekday-heatmap.js";
|
|
45
|
+
import { CopyButton } from "./components/registry/minidev/copy-button.js";
|
|
43
46
|
import { TableColumnActions } from "./components/registry/niko-table/filters/table-column-actions.js";
|
|
44
47
|
import { DataTableColumnHeader, DataTableColumnHeaderRoot, useColumnHeaderContext } from "./components/registry/niko-table/components/data-table-column-header.js";
|
|
45
48
|
import { DataTableColumnActions } from "./components/registry/niko-table/components/data-table-column-actions.js";
|
|
@@ -56,6 +59,8 @@ import { DataTableGroupRowProvider, DataTableGroupedRows, resolveGroupedRowsSlot
|
|
|
56
59
|
import { DataTableRowContextMenuSlot, resolveRowContextMenuRenderer, useResolvedRowContextMenuRenderer } from "./components/registry/niko-table/components/data-table-row-context-menu-slot.js";
|
|
57
60
|
import { DataTableRowMenuScope, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, useDataTableRow } from "./components/registry/niko-table/components/data-table-row-menu.js";
|
|
58
61
|
import { DataTableRowContextMenu } from "./components/registry/niko-table/components/data-table-row-context-menu.js";
|
|
62
|
+
import { TableSearchFilter } from "./components/registry/niko-table/filters/table-search-filter.js";
|
|
63
|
+
import { DataTableSearchFilter } from "./components/registry/niko-table/components/data-table-search-filter.js";
|
|
59
64
|
import { DataTableToolbarSection } from "./components/registry/niko-table/components/data-table-toolbar-section.js";
|
|
60
65
|
import { DataTableErrorBoundary } from "./components/registry/niko-table/core/data-table-error-boundary.js";
|
|
61
66
|
import { DataTableGroupedRowCells, GroupedBodyRow } from "./components/registry/niko-table/core/data-table-grouped-row.js";
|
|
@@ -67,9 +72,15 @@ import { NavProjects } from "./components/registry/sidebar-07/nav-projects.js";
|
|
|
67
72
|
import { NavUser } from "./components/registry/sidebar-07/nav-user.js";
|
|
68
73
|
import { TeamSwitcher } from "./components/registry/sidebar-07/team-switcher.js";
|
|
69
74
|
import { AppSidebar } from "./components/registry/sidebar-07/app-sidebar.js";
|
|
75
|
+
import { DataList, DataListItem } from "./components/siyahi/data-list.js";
|
|
76
|
+
import { DataTableRowCount } from "./components/siyahi/data-table-row-count.js";
|
|
77
|
+
import { DataTableSortHeader } from "./components/siyahi/data-table-sort-header.js";
|
|
70
78
|
import { Delta } from "./components/siyahi/delta.js";
|
|
79
|
+
import { InlineCode } from "./components/siyahi/inline-code.js";
|
|
71
80
|
import { LocalTime } from "./components/siyahi/local-time.js";
|
|
81
|
+
import { PageSection, PageSubheading } from "./components/siyahi/page-section.js";
|
|
72
82
|
import { PriceChart } from "./components/siyahi/price-chart.js";
|
|
73
|
-
import {
|
|
83
|
+
import { ToneProgress } from "./components/siyahi/tone-progress.js";
|
|
84
|
+
import { Treemap, TreemapLegend } from "./components/siyahi/treemap.js";
|
|
74
85
|
import { Area, AreaChart, Bar, BarChart, CartesianGrid, Line, LineChart, ReferenceLine, XAxis, YAxis } from "./lib/recharts.js";
|
|
75
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, Area, AreaChart, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableHeader, DataTableLoading, DataTableLoadingMore, DataTableProvider, DataTableRoot, DataTableRowContextMenu, DataTableRowContextMenuSlot, DataTableRowMenuScope, DataTableSkeleton, DataTableToolbarSection, Delta, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Line, LineChart, LineChartCard, LocalTime, NavMain, NavProjects, NavUser, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollArea, ScrollBar, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiProvider, Skeleton, Slider, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, XAxis, YAxis, badgeVariants, buttonVariants, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
86
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, Area, AreaChart, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataList, DataListItem, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableHeader, DataTableLoading, DataTableLoadingMore, DataTableProvider, DataTableRoot, DataTableRowContextMenu, DataTableRowContextMenuSlot, DataTableRowCount, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSortHeader, DataTableToolbarSection, Delta, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DistributionBar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Line, LineChart, LineChartCard, LocalTime, NavMain, NavProjects, NavUser, PageSection, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, ReferenceLine, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollArea, ScrollBar, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiProvider, Skeleton, Slider, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, Tabs, TabsContent, TabsList, TabsTrigger, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapLegend, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, XAxis, YAxis, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { ChartSeries, SeriesChartProps } from "./chart-series.js";
|
|
1
|
+
import { ChartSeries, NumericXProps, SeriesChartProps } from "./chart-series.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { AreaChart, BarChart, LineChart } from "recharts";
|
|
4
4
|
//#region src/lib/chart-frame.d.ts
|
|
5
|
-
interface ChartFrameProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K
|
|
5
|
+
interface ChartFrameProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K>, NumericXProps {
|
|
6
6
|
chart: typeof AreaChart | typeof BarChart | typeof LineChart;
|
|
7
7
|
/** One Bar, Area or Line per series. */
|
|
8
8
|
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Bars run sideways: the categories go down the left, where long names fit, and the value axis is hidden, as
|
|
11
|
+
* in shadcn's chart-bar-horizontal. x and y keep their meaning: x is the category, y the value.
|
|
12
|
+
*/
|
|
13
|
+
horizontal?: boolean;
|
|
14
|
+
/** "sign" stacks negative values below zero and positive ones above, rather than on one running total. */
|
|
15
|
+
stackOffset?: "sign";
|
|
9
16
|
}
|
|
10
17
|
/** A tooltip row: the series' colour and label, then its value as the page formats it, or — when the row has none. */
|
|
11
18
|
export declare function seriesRow<T>(series: ChartSeries<T>, formatValue: (value: number) => string): (value: unknown, _name: unknown, item: {
|
|
@@ -17,6 +24,6 @@ export declare function seriesRow<T>(series: ChartSeries<T>, formatValue: (value
|
|
|
17
24
|
* that gave its category axis its own id (dash#88) got a plot split in two
|
|
18
25
|
* and every tooltip headed with the series name instead of the category.
|
|
19
26
|
*/
|
|
20
|
-
export declare function ChartFrame<T extends object, K extends keyof T>({ chart: Chart, children, title, description, action, data, xKey, series, xFormatter, valueFormatter, yTickFormatter, height }: ChartFrameProps<T, K>): import("react").JSX.Element;
|
|
27
|
+
export declare function ChartFrame<T extends object, K extends keyof T>({ chart: Chart, children, horizontal, stackOffset, title, description, action, data, xKey, series, xFormatter, xTooltipFormatter, valueFormatter, yTickFormatter, yDomain, yTicks, height, xTickDetail, xLabel, yLabel, referenceLines, placeholder, footer, xDomain, xTicks }: ChartFrameProps<T, K>): import("react").JSX.Element;
|
|
21
28
|
//#endregion
|
|
22
29
|
export {};
|
package/dist/lib/chart-frame.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../components/ui/card.js";
|
|
1
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../components/ui/card.js";
|
|
2
2
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from "../components/ui/chart.js";
|
|
3
3
|
import { useLocale } from "../components/siyahi/siyahi-provider.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { CartesianGrid, ReferenceLine, XAxis, YAxis } from "recharts";
|
|
6
6
|
//#region src/lib/chart-frame.tsx
|
|
7
|
+
const AXIS_TITLE = "fill-muted-foreground text-xs";
|
|
8
|
+
const TICK = { className: "fill-muted-foreground font-mono" };
|
|
9
|
+
const NO_LINES = [];
|
|
7
10
|
/** A tooltip row: the series' colour and label, then its value as the page formats it, or — when the row has none. */
|
|
8
11
|
function seriesRow(series, formatValue) {
|
|
9
12
|
return (value, _name, item) => {
|
|
10
13
|
const entry = series.find(({ key }) => key === item.dataKey);
|
|
14
|
+
const color = entry?.negativeColor && Number(value) < 0 ? entry.negativeColor : entry?.color;
|
|
11
15
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
16
|
/* @__PURE__ */ jsx("span", {
|
|
13
17
|
className: "size-2.5 shrink-0 rounded-xs",
|
|
14
|
-
style: { backgroundColor:
|
|
18
|
+
style: { backgroundColor: color }
|
|
15
19
|
}),
|
|
16
20
|
/* @__PURE__ */ jsx("span", {
|
|
17
21
|
className: "text-muted-foreground",
|
|
@@ -24,13 +28,51 @@ function seriesRow(series, formatValue) {
|
|
|
24
28
|
] });
|
|
25
29
|
};
|
|
26
30
|
}
|
|
31
|
+
const CHAR_WIDTH = 6.6;
|
|
32
|
+
/** Squeezes a line into its column with SVG's own textLength when it would run into the next one. */
|
|
33
|
+
const fitTo = (text, room) => room > 0 && text.length * CHAR_WIDTH > room ? {
|
|
34
|
+
textLength: room,
|
|
35
|
+
lengthAdjust: "spacingAndGlyphs"
|
|
36
|
+
} : {};
|
|
37
|
+
/**
|
|
38
|
+
* An x tick with a second line from its row. Under a column the lines hang below the axis; beside a horizontal
|
|
39
|
+
* bar they straddle its middle. Both lines are set in Geist, not Mono: a name with a figure under it reads as a
|
|
40
|
+
* label, as in BarList, and sector names in Mono would take most of a phone's width.
|
|
41
|
+
*/
|
|
42
|
+
function twoLineTick(data, xKey, xFormatter, detailOf, beside) {
|
|
43
|
+
return ({ x, y, width, visibleTicksCount, payload }) => {
|
|
44
|
+
const value = payload?.value;
|
|
45
|
+
const row = data.find((r) => r[xKey] === value);
|
|
46
|
+
const name = xFormatter(value);
|
|
47
|
+
const detail = row ? detailOf(row) : null;
|
|
48
|
+
const room = beside || !visibleTicksCount ? 0 : Number(width) / visibleTicksCount - 6;
|
|
49
|
+
return /* @__PURE__ */ jsxs("text", {
|
|
50
|
+
x,
|
|
51
|
+
y,
|
|
52
|
+
textAnchor: beside ? "end" : "middle",
|
|
53
|
+
className: "recharts-cartesian-axis-tick-value fill-muted-foreground",
|
|
54
|
+
children: [/* @__PURE__ */ jsx("tspan", {
|
|
55
|
+
x,
|
|
56
|
+
dy: beside ? -4 : 12,
|
|
57
|
+
...fitTo(name, room),
|
|
58
|
+
children: name
|
|
59
|
+
}), detail !== null && /* @__PURE__ */ jsx("tspan", {
|
|
60
|
+
x,
|
|
61
|
+
dy: 15,
|
|
62
|
+
className: "tabular-nums",
|
|
63
|
+
...fitTo(detail, room),
|
|
64
|
+
children: detail
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}
|
|
27
69
|
/**
|
|
28
70
|
* The card, axes, grid, tooltip and legend the three chart cards share. Both
|
|
29
71
|
* axes keep Recharts' default ids: marks find their axes by id, and a page
|
|
30
72
|
* that gave its category axis its own id (dash#88) got a plot split in two
|
|
31
73
|
* and every tooltip headed with the series name instead of the category.
|
|
32
74
|
*/
|
|
33
|
-
function ChartFrame({ chart: Chart, children, title, description, action, data, xKey, series, xFormatter = String, valueFormatter, yTickFormatter, height }) {
|
|
75
|
+
function ChartFrame({ chart: Chart, children, horizontal = false, stackOffset, title, description, action, data, xKey, series, xFormatter = String, xTooltipFormatter = xFormatter, valueFormatter, yTickFormatter, yDomain, yTicks, height, xTickDetail, xLabel, yLabel, referenceLines = NO_LINES, placeholder, footer, xDomain, xTicks }) {
|
|
34
76
|
const { numberLocale } = useLocale();
|
|
35
77
|
const formatValue = valueFormatter ?? new Intl.NumberFormat(numberLocale).format;
|
|
36
78
|
const config = Object.fromEntries(series.map(({ key, label, color }) => [key, {
|
|
@@ -38,59 +80,123 @@ function ChartFrame({ chart: Chart, children, title, description, action, data,
|
|
|
38
80
|
color
|
|
39
81
|
}]));
|
|
40
82
|
const crossesZero = data.some((row) => series.some(({ key }) => Number(row[key]) < 0));
|
|
41
|
-
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
84
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(CardTitle, { children: title }),
|
|
86
|
+
description && /* @__PURE__ */ jsx(CardDescription, { children: description }),
|
|
87
|
+
action && /* @__PURE__ */ jsx(CardAction, { children: action })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsx(CardContent, { children: placeholder ? /* @__PURE__ */ jsx("div", {
|
|
90
|
+
"data-slot": "chart-placeholder",
|
|
91
|
+
className: "flex items-center justify-center",
|
|
92
|
+
style: { height },
|
|
93
|
+
children: placeholder
|
|
94
|
+
}) : /* @__PURE__ */ jsx(ChartContainer, {
|
|
95
|
+
config,
|
|
96
|
+
className: "aspect-auto w-full",
|
|
97
|
+
style: { height },
|
|
98
|
+
children: /* @__PURE__ */ jsxs(Chart, {
|
|
99
|
+
data,
|
|
100
|
+
layout: horizontal ? "vertical" : "horizontal",
|
|
101
|
+
stackOffset,
|
|
102
|
+
margin: {
|
|
103
|
+
left: 0,
|
|
104
|
+
right: 8
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx(CartesianGrid, {
|
|
108
|
+
vertical: horizontal,
|
|
109
|
+
horizontal: !horizontal,
|
|
110
|
+
strokeDasharray: "3 3"
|
|
111
|
+
}),
|
|
112
|
+
horizontal ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XAxis, {
|
|
113
|
+
type: "number",
|
|
114
|
+
hide: true,
|
|
115
|
+
domain: yDomain,
|
|
116
|
+
ticks: yTicks
|
|
117
|
+
}), /* @__PURE__ */ jsx(YAxis, {
|
|
118
|
+
dataKey: xKey,
|
|
119
|
+
type: "category",
|
|
120
|
+
width: "auto",
|
|
121
|
+
tickLine: false,
|
|
122
|
+
axisLine: false,
|
|
123
|
+
tickMargin: 8,
|
|
124
|
+
tickFormatter: (value) => xFormatter(value),
|
|
125
|
+
tick: xTickDetail ? twoLineTick(data, xKey, xFormatter, xTickDetail, horizontal) : TICK,
|
|
126
|
+
interval: 0
|
|
127
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XAxis, {
|
|
128
|
+
dataKey: xKey,
|
|
129
|
+
type: xDomain ? "number" : "category",
|
|
130
|
+
domain: xDomain,
|
|
131
|
+
ticks: xTicks,
|
|
132
|
+
height: (xTickDetail ? 40 : 30) + (xLabel ? 18 : 0),
|
|
133
|
+
label: xLabel ? {
|
|
134
|
+
value: xLabel,
|
|
135
|
+
position: "insideBottom",
|
|
136
|
+
className: AXIS_TITLE
|
|
137
|
+
} : void 0,
|
|
138
|
+
tickLine: false,
|
|
139
|
+
axisLine: false,
|
|
140
|
+
tickMargin: 8,
|
|
141
|
+
tickFormatter: (value) => xFormatter(value),
|
|
142
|
+
tick: xTickDetail ? twoLineTick(data, xKey, xFormatter, xTickDetail, false) : TICK,
|
|
143
|
+
interval: xTickDetail ? 0 : void 0
|
|
144
|
+
}), /* @__PURE__ */ jsx(YAxis, {
|
|
145
|
+
tickLine: false,
|
|
146
|
+
axisLine: false,
|
|
147
|
+
width: "auto",
|
|
148
|
+
domain: yDomain,
|
|
149
|
+
ticks: yTicks,
|
|
150
|
+
label: yLabel ? {
|
|
151
|
+
value: yLabel,
|
|
152
|
+
angle: -90,
|
|
153
|
+
position: "insideLeft",
|
|
154
|
+
style: { textAnchor: "middle" },
|
|
155
|
+
className: AXIS_TITLE
|
|
156
|
+
} : void 0,
|
|
157
|
+
tickFormatter: (value) => (yTickFormatter ?? formatValue)(value),
|
|
158
|
+
tick: TICK
|
|
159
|
+
})] }),
|
|
160
|
+
crossesZero && (horizontal ? /* @__PURE__ */ jsx(ReferenceLine, {
|
|
161
|
+
x: 0,
|
|
162
|
+
stroke: "var(--border)"
|
|
163
|
+
}) : /* @__PURE__ */ jsx(ReferenceLine, {
|
|
164
|
+
y: 0,
|
|
165
|
+
stroke: "var(--border)"
|
|
166
|
+
})),
|
|
167
|
+
referenceLines.map(({ label, emphasis = "muted", labelPosition = "insideTopLeft", ...at }) => /* @__PURE__ */ jsx(ReferenceLine, {
|
|
168
|
+
...horizontal ? {
|
|
169
|
+
x: at.y,
|
|
170
|
+
y: at.x
|
|
171
|
+
} : at,
|
|
172
|
+
stroke: emphasis === "strong" ? "var(--foreground)" : "var(--muted-foreground)",
|
|
173
|
+
strokeDasharray: at.y === void 0 ? void 0 : "4 4",
|
|
174
|
+
label: label === void 0 ? void 0 : {
|
|
175
|
+
value: label,
|
|
176
|
+
position: labelPosition,
|
|
177
|
+
className: "fill-muted-foreground text-xs"
|
|
178
|
+
}
|
|
179
|
+
}, `${at.x ?? ""}:${at.y ?? ""}:${label ?? ""}`)),
|
|
180
|
+
/* @__PURE__ */ jsx(ChartTooltip, { content: /* @__PURE__ */ jsx(ChartTooltipContent, {
|
|
181
|
+
labelFormatter: (_, payload) => {
|
|
182
|
+
const row = payload[0]?.payload;
|
|
183
|
+
return row ? xTooltipFormatter(row[xKey]) : null;
|
|
184
|
+
},
|
|
185
|
+
formatter: seriesRow(series, formatValue)
|
|
186
|
+
}) }),
|
|
187
|
+
children,
|
|
188
|
+
/* @__PURE__ */ jsx(ChartLegend, {
|
|
189
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {}),
|
|
190
|
+
itemSorter: null
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
})
|
|
194
|
+
}) }),
|
|
195
|
+
footer && /* @__PURE__ */ jsx(CardFooter, {
|
|
196
|
+
className: "flex-col items-start gap-2 text-sm",
|
|
197
|
+
children: footer
|
|
92
198
|
})
|
|
93
|
-
|
|
199
|
+
] });
|
|
94
200
|
}
|
|
95
201
|
//#endregion
|
|
96
202
|
export { ChartFrame, seriesRow };
|