@alpic-ai/ui 0.0.0-staging.ge618bb9 → 0.0.0-staging.ge6c0eda
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion-card.d.mts +5 -30
- package/dist/components/accordion-card.mjs +1 -5
- package/dist/components/accordion.d.mts +5 -23
- package/dist/components/accordion.mjs +1 -5
- package/dist/components/alert.d.mts +5 -24
- package/dist/components/area-chart.d.mts +2 -21
- package/dist/components/area-chart.mjs +34 -121
- package/dist/components/attachment-tile.d.mts +1 -13
- package/dist/components/avatar.d.mts +4 -27
- package/dist/components/badge.d.mts +2 -9
- package/dist/components/bar-chart.d.mts +5 -19
- package/dist/components/bar-chart.mjs +75 -93
- package/dist/components/bar-list.d.mts +3 -12
- package/dist/components/bar-list.mjs +24 -18
- package/dist/components/breadcrumb.d.mts +8 -35
- package/dist/components/button.d.mts +2 -15
- package/dist/components/card.d.mts +7 -30
- package/dist/components/chart-card.d.mts +2 -13
- package/dist/components/chart-card.mjs +1 -1
- package/dist/components/chart-container.d.mts +2 -7
- package/dist/components/chart-legend.d.mts +6 -5
- package/dist/components/chart-legend.mjs +31 -8
- package/dist/components/chart-primitives.d.mts +64 -0
- package/dist/components/chart-primitives.mjs +129 -0
- package/dist/components/chart-tooltip.d.mts +1 -11
- package/dist/components/chart-tooltip.mjs +54 -27
- package/dist/components/checkbox.d.mts +1 -5
- package/dist/components/collapsible.d.mts +3 -10
- package/dist/components/combobox.d.mts +9 -46
- package/dist/components/command.d.mts +8 -32
- package/dist/components/copyable.d.mts +2 -9
- package/dist/components/description-list.d.mts +4 -17
- package/dist/components/dialog.d.mts +10 -42
- package/dist/components/donut-chart.d.mts +1 -16
- package/dist/components/donut-chart.mjs +10 -8
- package/dist/components/dropdown-menu.d.mts +13 -55
- package/dist/components/field.d.mts +14 -0
- package/dist/components/field.mjs +41 -0
- package/dist/components/form.d.mts +15 -115
- package/dist/components/form.mjs +3 -1
- package/dist/components/github-button.d.mts +1 -6
- package/dist/components/heatmap-chart.d.mts +10 -18
- package/dist/components/heatmap-chart.mjs +158 -97
- package/dist/components/input-group.d.mts +3 -15
- package/dist/components/input.d.mts +1 -14
- package/dist/components/input.mjs +25 -49
- package/dist/components/label.d.mts +1 -5
- package/dist/components/line-chart.d.mts +4 -20
- package/dist/components/line-chart.mjs +39 -115
- package/dist/components/page-loader.d.mts +1 -3
- package/dist/components/pagination.d.mts +1 -8
- package/dist/components/popover.d.mts +4 -16
- package/dist/components/radio-group.d.mts +2 -9
- package/dist/components/scroll-area.d.mts +2 -11
- package/dist/components/select-trigger-variants.d.mts +1 -5
- package/dist/components/select-trigger-variants.mjs +1 -5
- package/dist/components/select.d.mts +8 -35
- package/dist/components/separator.d.mts +1 -7
- package/dist/components/sheet.d.mts +9 -35
- package/dist/components/shimmer-text.d.mts +1 -5
- package/dist/components/sidebar.d.mts +22 -113
- package/dist/components/sidebar.mjs +1 -1
- package/dist/components/skeleton.d.mts +1 -6
- package/dist/components/skeleton.mjs +1 -1
- package/dist/components/sonner.d.mts +1 -8
- package/dist/components/spinner.d.mts +3 -15
- package/dist/components/stat.d.mts +9 -11
- package/dist/components/stat.mjs +76 -59
- package/dist/components/status-dot.d.mts +1 -7
- package/dist/components/switch.d.mts +1 -5
- package/dist/components/table.d.mts +12 -39
- package/dist/components/table.mjs +2 -2
- package/dist/components/tabs.d.mts +7 -36
- package/dist/components/tag.d.mts +3 -20
- package/dist/components/task-progress.d.mts +2 -11
- package/dist/components/textarea.d.mts +1 -11
- package/dist/components/textarea.mjs +17 -41
- package/dist/components/toggle-group.d.mts +2 -15
- package/dist/components/tooltip-icon-button.d.mts +0 -1
- package/dist/components/tooltip.d.mts +4 -17
- package/dist/components/typography.d.mts +4 -17
- package/dist/components/wizard.d.mts +1 -7
- package/dist/hooks/use-copy-to-clipboard.d.mts +1 -3
- package/dist/lib/chart-palette.d.mts +16 -1
- package/dist/lib/chart-palette.mjs +29 -27
- package/dist/lib/chart.d.mts +7 -5
- package/dist/lib/chart.mjs +18 -12
- package/dist/lib/cn.d.mts +0 -1
- package/package.json +36 -32
- package/src/components/accordion-card.tsx +1 -5
- package/src/components/accordion.tsx +1 -5
- package/src/components/area-chart.tsx +44 -155
- package/src/components/attachment-tile.tsx +0 -5
- package/src/components/avatar.tsx +0 -2
- package/src/components/bar-chart.tsx +95 -108
- package/src/components/bar-list.tsx +25 -18
- package/src/components/chart-card.tsx +8 -6
- package/src/components/chart-container.tsx +2 -0
- package/src/components/chart-legend.tsx +56 -11
- package/src/components/chart-primitives.tsx +182 -0
- package/src/components/chart-tooltip.tsx +22 -6
- package/src/components/combobox.tsx +1 -29
- package/src/components/donut-chart.tsx +7 -10
- package/src/components/dropdown-menu.tsx +0 -12
- package/src/components/field.tsx +57 -0
- package/src/components/form.tsx +4 -6
- package/src/components/heatmap-chart.tsx +108 -26
- package/src/components/input.tsx +3 -33
- package/src/components/line-chart.tsx +64 -148
- package/src/components/select-trigger-variants.ts +1 -5
- package/src/components/select.tsx +0 -10
- package/src/components/sidebar.tsx +0 -2
- package/src/components/skeleton.tsx +1 -1
- package/src/components/stat.tsx +77 -45
- package/src/components/table.tsx +12 -7
- package/src/components/tabs.tsx +1 -18
- package/src/components/tag.tsx +0 -6
- package/src/components/task-progress.tsx +2 -14
- package/src/components/textarea.tsx +4 -34
- package/src/components/wizard.tsx +0 -6
- package/src/lib/chart-palette.ts +23 -39
- package/src/lib/chart.ts +37 -15
- package/src/stories/area-chart.stories.tsx +9 -7
- package/src/stories/bar-chart.stories.tsx +9 -7
- package/src/stories/bar-list.stories.tsx +1 -1
- package/src/stories/button.stories.tsx +1 -15
- package/src/stories/combobox.stories.tsx +0 -12
- package/src/stories/donut-chart.stories.tsx +9 -7
- package/src/stories/dropdown-menu.stories.tsx +0 -4
- package/src/stories/form.stories.tsx +0 -6
- package/src/stories/heatmap-chart.stories.tsx +1 -2
- package/src/stories/input-group.stories.tsx +0 -4
- package/src/stories/input.stories.tsx +0 -8
- package/src/stories/line-chart.stories.tsx +128 -86
- package/src/stories/sidebar.stories.tsx +1 -4
- package/src/stories/skeleton.stories.tsx +0 -2
- package/src/stories/stat.stories.tsx +8 -6
- package/src/stories/table.stories.tsx +0 -5
- package/src/stories/tabs.stories.tsx +0 -11
- package/src/stories/textarea.stories.tsx +7 -0
- package/src/stories/toggle-group.stories.tsx +0 -5
- package/src/stories/wizard.stories.tsx +1 -5
- package/src/styles/tokens.css +0 -45
- package/dist/hooks/use-reduced-motion.d.mts +0 -4
- package/dist/hooks/use-reduced-motion.mjs +0 -16
- package/src/hooks/use-reduced-motion.ts +0 -17
|
@@ -1,40 +1,15 @@
|
|
|
1
1
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/accordion-card.d.ts
|
|
5
|
-
declare function AccordionCard({
|
|
6
|
-
defaultOpen,
|
|
7
|
-
open,
|
|
8
|
-
onOpenChange,
|
|
9
|
-
disabled,
|
|
10
|
-
className,
|
|
11
|
-
children,
|
|
12
|
-
...props
|
|
13
|
-
}: {
|
|
4
|
+
declare function AccordionCard({ defaultOpen, open, onOpenChange, disabled, className, children, ...props }: {
|
|
14
5
|
defaultOpen?: boolean;
|
|
15
6
|
open?: boolean;
|
|
16
7
|
onOpenChange?: (nextOpen: boolean) => void;
|
|
17
8
|
disabled?: boolean;
|
|
18
9
|
} & Omit<React$1.ComponentProps<typeof AccordionPrimitive.Root>, "type" | "collapsible" | "defaultValue" | "value" | "onValueChange" | "disabled">): React$1.JSX.Element;
|
|
19
|
-
declare function AccordionCardHeader({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}: React$1.ComponentProps<typeof AccordionPrimitive.Trigger>): React$1.JSX.Element;
|
|
24
|
-
declare function AccordionCardTitle({
|
|
25
|
-
className,
|
|
26
|
-
children,
|
|
27
|
-
...props
|
|
28
|
-
}: React$1.HTMLAttributes<HTMLHeadingElement>): React$1.JSX.Element;
|
|
29
|
-
/**
|
|
30
|
-
* `className` is forwarded to the inner padding wrapper, not the Radix Content root.
|
|
31
|
-
* The root always applies overflow-hidden and the accordion animations.
|
|
32
|
-
* To override overflow or animation behavior, wrap this component in an additional element.
|
|
33
|
-
*/
|
|
34
|
-
declare function AccordionCardContent({
|
|
35
|
-
className,
|
|
36
|
-
children,
|
|
37
|
-
...props
|
|
38
|
-
}: React$1.ComponentProps<typeof AccordionPrimitive.Content>): React$1.JSX.Element;
|
|
10
|
+
declare function AccordionCardHeader({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Trigger>): React$1.JSX.Element;
|
|
11
|
+
declare function AccordionCardTitle({ className, children, ...props }: React$1.HTMLAttributes<HTMLHeadingElement>): React$1.JSX.Element;
|
|
12
|
+
/** `className` styles the inner padding wrapper, not the Radix Content root, which keeps overflow-hidden and the accordion animations. */
|
|
13
|
+
declare function AccordionCardContent({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Content>): React$1.JSX.Element;
|
|
39
14
|
//#endregion
|
|
40
15
|
export { AccordionCard, AccordionCardContent, AccordionCardHeader, AccordionCardTitle };
|
|
@@ -41,11 +41,7 @@ function AccordionCardTitle({ className, children, ...props }) {
|
|
|
41
41
|
children
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* `className` is forwarded to the inner padding wrapper, not the Radix Content root.
|
|
46
|
-
* The root always applies overflow-hidden and the accordion animations.
|
|
47
|
-
* To override overflow or animation behavior, wrap this component in an additional element.
|
|
48
|
-
*/
|
|
44
|
+
/** `className` styles the inner padding wrapper, not the Radix Content root, which keeps overflow-hidden and the accordion animations. */
|
|
49
45
|
function AccordionCardContent({ className, children, ...props }) {
|
|
50
46
|
return /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
|
|
51
47
|
"data-slot": "accordion-card-content",
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/accordion.d.ts
|
|
5
|
-
declare function Accordion({
|
|
6
|
-
|
|
7
|
-
}: React$1.ComponentProps<typeof AccordionPrimitive.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
...props
|
|
11
|
-
}: React$1.ComponentProps<typeof AccordionPrimitive.Item>): React$1.JSX.Element;
|
|
12
|
-
declare function AccordionTrigger({
|
|
13
|
-
className,
|
|
14
|
-
children,
|
|
15
|
-
...props
|
|
16
|
-
}: React$1.ComponentProps<typeof AccordionPrimitive.Trigger>): React$1.JSX.Element;
|
|
17
|
-
/**
|
|
18
|
-
* `className` is forwarded to the inner padding wrapper, not the Radix Content root.
|
|
19
|
-
* The root always applies overflow-hidden and the accordion animations.
|
|
20
|
-
* To override overflow or animation behavior, wrap this component in an additional element.
|
|
21
|
-
*/
|
|
22
|
-
declare function AccordionContent({
|
|
23
|
-
className,
|
|
24
|
-
children,
|
|
25
|
-
...props
|
|
26
|
-
}: React$1.ComponentProps<typeof AccordionPrimitive.Content>): React$1.JSX.Element;
|
|
4
|
+
declare function Accordion({ ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Root>): React$1.JSX.Element;
|
|
5
|
+
declare function AccordionItem({ className, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Item>): React$1.JSX.Element;
|
|
6
|
+
declare function AccordionTrigger({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Trigger>): React$1.JSX.Element;
|
|
7
|
+
/** `className` styles the inner padding wrapper, not the Radix Content root, which keeps overflow-hidden and the accordion animations. */
|
|
8
|
+
declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Content>): React$1.JSX.Element;
|
|
27
9
|
//#endregion
|
|
28
10
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -28,11 +28,7 @@ function AccordionTrigger({ className, children, ...props }) {
|
|
|
28
28
|
})
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
32
|
-
* `className` is forwarded to the inner padding wrapper, not the Radix Content root.
|
|
33
|
-
* The root always applies overflow-hidden and the accordion animations.
|
|
34
|
-
* To override overflow or animation behavior, wrap this component in an additional element.
|
|
35
|
-
*/
|
|
31
|
+
/** `className` styles the inner padding wrapper, not the Radix Content root, which keeps overflow-hidden and the accordion animations. */
|
|
36
32
|
function AccordionContent({ className, children, ...props }) {
|
|
37
33
|
return /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
|
|
38
34
|
"data-slot": "accordion-content",
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/alert.d.ts
|
|
5
4
|
declare const alertVariants: (props?: ({
|
|
6
5
|
variant?: "default" | "destructive" | "warning" | "success" | null | undefined;
|
|
7
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
7
|
interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {}
|
|
9
|
-
declare function Alert({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...props
|
|
13
|
-
}: AlertProps): React$1.JSX.Element;
|
|
14
|
-
declare function AlertTitle({
|
|
15
|
-
className,
|
|
16
|
-
...props
|
|
17
|
-
}: React$1.HTMLAttributes<HTMLParagraphElement>): React$1.JSX.Element;
|
|
18
|
-
declare function AlertDescription({
|
|
19
|
-
className,
|
|
20
|
-
...props
|
|
21
|
-
}: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
8
|
+
declare function Alert({ className, variant, ...props }: AlertProps): React$1.JSX.Element;
|
|
9
|
+
declare function AlertTitle({ className, ...props }: React$1.HTMLAttributes<HTMLParagraphElement>): React$1.JSX.Element;
|
|
10
|
+
declare function AlertDescription({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
22
11
|
interface ConvenienceAlertProps {
|
|
23
12
|
title?: string;
|
|
24
13
|
description?: React$1.ReactNode;
|
|
25
14
|
className?: string;
|
|
26
15
|
}
|
|
27
|
-
declare function ErrorAlert({
|
|
28
|
-
|
|
29
|
-
description,
|
|
30
|
-
className
|
|
31
|
-
}: ConvenienceAlertProps): React$1.JSX.Element;
|
|
32
|
-
declare function WarningAlert({
|
|
33
|
-
title,
|
|
34
|
-
description,
|
|
35
|
-
className
|
|
36
|
-
}: ConvenienceAlertProps): React$1.JSX.Element;
|
|
16
|
+
declare function ErrorAlert({ title, description, className }: ConvenienceAlertProps): React$1.JSX.Element;
|
|
17
|
+
declare function WarningAlert({ title, description, className }: ConvenienceAlertProps): React$1.JSX.Element;
|
|
37
18
|
//#endregion
|
|
38
19
|
export { Alert, AlertDescription, AlertTitle, ErrorAlert, WarningAlert };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ChartSeries } from "../lib/chart.mjs";
|
|
2
2
|
import { ChartPaletteName } from "../lib/chart-palette.mjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
|
-
|
|
5
4
|
//#region src/components/area-chart.d.ts
|
|
6
5
|
declare const CURVE_TYPE: {
|
|
7
6
|
readonly monotone: "monotone";
|
|
@@ -21,6 +20,7 @@ interface AreaChartProps {
|
|
|
21
20
|
variant?: "stacked" | "grouped" | "expand";
|
|
22
21
|
curve?: keyof typeof CURVE_TYPE;
|
|
23
22
|
legend?: boolean;
|
|
23
|
+
legendAlign?: "left" | "center" | "right";
|
|
24
24
|
valueFlags?: boolean;
|
|
25
25
|
height?: number;
|
|
26
26
|
yAxisWidth?: number;
|
|
@@ -38,25 +38,6 @@ interface AreaChartProps {
|
|
|
38
38
|
labelFormatter?: (label: string | number) => string;
|
|
39
39
|
className?: string;
|
|
40
40
|
}
|
|
41
|
-
declare function AreaChart({
|
|
42
|
-
data,
|
|
43
|
-
index,
|
|
44
|
-
series,
|
|
45
|
-
variant,
|
|
46
|
-
curve,
|
|
47
|
-
legend,
|
|
48
|
-
valueFlags,
|
|
49
|
-
height,
|
|
50
|
-
yAxisWidth,
|
|
51
|
-
palette,
|
|
52
|
-
referenceLine,
|
|
53
|
-
markers,
|
|
54
|
-
lastValueLabel,
|
|
55
|
-
texture,
|
|
56
|
-
loading,
|
|
57
|
-
valueFormatter,
|
|
58
|
-
labelFormatter,
|
|
59
|
-
className
|
|
60
|
-
}: AreaChartProps): React$1.JSX.Element;
|
|
41
|
+
declare function AreaChart({ data, index, series, variant, curve, legend, legendAlign, valueFlags, height, yAxisWidth, palette, referenceLine, markers, lastValueLabel, texture, loading, valueFormatter, labelFormatter, className }: AreaChartProps): React$1.JSX.Element;
|
|
61
42
|
//#endregion
|
|
62
43
|
export { AreaChart, AreaChartProps, ChartMarker };
|
|
@@ -1,44 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { orderByLuminance, resolveSeries } from "../lib/chart.mjs";
|
|
3
|
+
import { makeXAxisTick, orderByLuminance, resolveSeries } from "../lib/chart.mjs";
|
|
5
4
|
import { useChartContext } from "./chart-container.mjs";
|
|
6
5
|
import { ChartLegend } from "./chart-legend.mjs";
|
|
6
|
+
import { computeNumericMax, makeActiveDot, makeChartAxis, makeLastValueLabel, makeLegendItems, renderMarkers, renderReferenceLine } from "./chart-primitives.mjs";
|
|
7
7
|
import { ChartTooltipContent } from "./chart-tooltip.mjs";
|
|
8
|
+
import { Skeleton } from "./skeleton.mjs";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import * as React$1 from "react";
|
|
10
|
-
import { Area, AreaChart as AreaChart$1, CartesianGrid, LabelList,
|
|
11
|
+
import { Area, AreaChart as AreaChart$1, CartesianGrid, LabelList, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
11
12
|
//#region src/components/area-chart.tsx
|
|
12
13
|
const CURVE_TYPE = {
|
|
13
14
|
monotone: "monotone",
|
|
14
15
|
linear: "linear",
|
|
15
16
|
step: "stepAfter"
|
|
16
17
|
};
|
|
17
|
-
function AreaChart({ data, index, series, variant = "stacked", curve = "monotone", legend = false, valueFlags = false, height = 200, yAxisWidth = 48, palette, referenceLine, markers, lastValueLabel = false, texture = false, loading = false, valueFormatter = (value) => value.toLocaleString("en-US"), labelFormatter, className }) {
|
|
18
|
+
function AreaChart({ data, index, series, variant = "stacked", curve = "monotone", legend = false, legendAlign = "left", valueFlags = false, height = 200, yAxisWidth = 48, palette, referenceLine, markers, lastValueLabel = false, texture = false, loading = false, valueFormatter = (value) => value.toLocaleString("en-US"), labelFormatter, className }) {
|
|
18
19
|
const { palette: paletteColors, theme } = useChartContext(palette);
|
|
19
20
|
const reactId = React$1.useId().replace(/:/g, "");
|
|
20
|
-
const animated = !useReducedMotion();
|
|
21
21
|
const resolved = resolveSeries(series, paletteColors, theme);
|
|
22
22
|
const stacked = variant === "stacked" || variant === "expand";
|
|
23
23
|
const rendered = stacked ? orderByLuminance(resolved) : resolved;
|
|
24
24
|
const filled = !(variant === "grouped" && rendered.length > 1);
|
|
25
25
|
const lead = resolved[0];
|
|
26
26
|
const withTotal = stacked && rendered.length > 1;
|
|
27
|
-
const numericMax = React$1.useMemo(() =>
|
|
28
|
-
let max = 0;
|
|
29
|
-
for (const row of data) {
|
|
30
|
-
let rowTotal = 0;
|
|
31
|
-
for (const entry of series) {
|
|
32
|
-
const value = Number(row[entry.key]);
|
|
33
|
-
if (Number.isFinite(value)) {
|
|
34
|
-
rowTotal += value;
|
|
35
|
-
if (!stacked && value > max) max = value;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (stacked && rowTotal > max) max = rowTotal;
|
|
39
|
-
}
|
|
40
|
-
return max;
|
|
41
|
-
}, [
|
|
27
|
+
const numericMax = React$1.useMemo(() => computeNumericMax(data, series, stacked), [
|
|
42
28
|
data,
|
|
43
29
|
series,
|
|
44
30
|
stacked
|
|
@@ -50,84 +36,30 @@ function AreaChart({ data, index, series, variant = "stacked", curve = "monotone
|
|
|
50
36
|
bottom: 2,
|
|
51
37
|
left: 0
|
|
52
38
|
};
|
|
53
|
-
const axis =
|
|
54
|
-
|
|
55
|
-
tick: {
|
|
56
|
-
fill: theme.axisForeground,
|
|
57
|
-
fontSize: 10,
|
|
58
|
-
fontFamily: theme.fontMono
|
|
59
|
-
},
|
|
60
|
-
tickLine: false,
|
|
61
|
-
axisLine: {
|
|
62
|
-
stroke: theme.border,
|
|
63
|
-
strokeOpacity: .6
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const legendItems = resolved.map((entry) => ({
|
|
67
|
-
name: entry.name,
|
|
68
|
-
color: entry.color,
|
|
69
|
-
dashed: entry.dashed
|
|
70
|
-
}));
|
|
71
|
-
const activeDotFor = (entry) => valueFlags ? (dotProps) => {
|
|
72
|
-
if (dotProps.cx == null || dotProps.cy == null) return /* @__PURE__ */ jsx("g", {});
|
|
73
|
-
return /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("circle", {
|
|
74
|
-
cx: dotProps.cx,
|
|
75
|
-
cy: dotProps.cy,
|
|
76
|
-
r: 3.5,
|
|
77
|
-
fill: entry.color,
|
|
78
|
-
stroke: theme.card,
|
|
79
|
-
strokeWidth: 2
|
|
80
|
-
}), /* @__PURE__ */ jsx("text", {
|
|
81
|
-
x: dotProps.cx,
|
|
82
|
-
y: dotProps.cy - 8,
|
|
83
|
-
textAnchor: "middle",
|
|
84
|
-
fill: entry.color,
|
|
85
|
-
fontFamily: theme.fontMono,
|
|
86
|
-
fontSize: 10,
|
|
87
|
-
style: { fontVariantNumeric: "tabular-nums" },
|
|
88
|
-
children: valueFormatter(Number(dotProps.value ?? 0))
|
|
89
|
-
})] });
|
|
90
|
-
} : {
|
|
91
|
-
r: 3.5,
|
|
92
|
-
fill: entry.color,
|
|
93
|
-
stroke: theme.card,
|
|
94
|
-
strokeWidth: 2
|
|
95
|
-
};
|
|
39
|
+
const axis = makeChartAxis(theme);
|
|
40
|
+
const legendItems = makeLegendItems(resolved);
|
|
96
41
|
const fillFor = (entry, slot) => {
|
|
97
42
|
if (!filled) return "none";
|
|
98
43
|
if (texture && lead && entry.key === lead.key) return `url(#hatch-${reactId})`;
|
|
99
44
|
return `url(#area-${reactId}-${slot})`;
|
|
100
45
|
};
|
|
101
|
-
const renderLastLabel = (color) => (props) => {
|
|
102
|
-
if (props.index !== data.length - 1 || props.x == null || props.y == null) return null;
|
|
103
|
-
return /* @__PURE__ */ jsx("text", {
|
|
104
|
-
x: Number(props.x) + 6,
|
|
105
|
-
y: Number(props.y),
|
|
106
|
-
dy: 3,
|
|
107
|
-
fill: color,
|
|
108
|
-
fontFamily: theme.fontMono,
|
|
109
|
-
fontSize: 10,
|
|
110
|
-
textAnchor: "start",
|
|
111
|
-
style: { fontVariantNumeric: "tabular-nums" },
|
|
112
|
-
children: valueFormatter(Number(props.value ?? 0))
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
46
|
const isEmpty = data.length === 0 || rendered.length === 0;
|
|
116
47
|
return /* @__PURE__ */ jsxs("div", {
|
|
117
48
|
"data-slot": "area-chart",
|
|
118
|
-
className: cn("flex w-full flex-col gap-3", className),
|
|
49
|
+
className: cn("flex w-full flex-col gap-3", "[&_.recharts-surface]:outline-none [&_.recharts-wrapper]:outline-none", className),
|
|
119
50
|
children: [/* @__PURE__ */ jsx("div", {
|
|
120
51
|
className: "w-full",
|
|
121
52
|
style: { height },
|
|
122
|
-
children: loading ? /* @__PURE__ */
|
|
123
|
-
className: "flex h-full items-center justify-center gap-2.5 font-mono text-quaternary-foreground text-text-xs",
|
|
124
|
-
children: [/* @__PURE__ */ jsx("span", { className: "size-4 animate-spin rounded-full border-2 border-border border-t-foreground" }), "loading…"]
|
|
125
|
-
}) : isEmpty ? /* @__PURE__ */ jsx("div", {
|
|
53
|
+
children: loading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-full w-full rounded-lg" }) : isEmpty ? /* @__PURE__ */ jsx("div", {
|
|
126
54
|
className: "flex h-full items-center justify-center rounded-lg border border-border border-dashed font-mono text-quaternary-foreground text-text-xs",
|
|
127
55
|
children: "no data in range"
|
|
128
56
|
}) : /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
129
57
|
width: "100%",
|
|
130
58
|
height: "100%",
|
|
59
|
+
initialDimension: {
|
|
60
|
+
width: 0,
|
|
61
|
+
height
|
|
62
|
+
},
|
|
131
63
|
children: /* @__PURE__ */ jsxs(AreaChart$1, {
|
|
132
64
|
data,
|
|
133
65
|
stackOffset: variant === "expand" ? "expand" : "none",
|
|
@@ -177,8 +109,9 @@ function AreaChart({ data, index, series, variant = "stacked", curve = "monotone
|
|
|
177
109
|
/* @__PURE__ */ jsx(XAxis, {
|
|
178
110
|
dataKey: index,
|
|
179
111
|
...axis,
|
|
112
|
+
tick: makeXAxisTick(theme),
|
|
180
113
|
interval: "preserveStartEnd",
|
|
181
|
-
minTickGap:
|
|
114
|
+
minTickGap: 56
|
|
182
115
|
}),
|
|
183
116
|
/* @__PURE__ */ jsx(YAxis, {
|
|
184
117
|
...axis,
|
|
@@ -202,25 +135,10 @@ function AreaChart({ data, index, series, variant = "stacked", curve = "monotone
|
|
|
202
135
|
showTotal: withTotal
|
|
203
136
|
})
|
|
204
137
|
}),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
fillOpacity: .06,
|
|
210
|
-
ifOverflow: "extendDomain"
|
|
211
|
-
}),
|
|
212
|
-
referenceLine && /* @__PURE__ */ jsx(ReferenceLine, {
|
|
213
|
-
y: referenceLine.y,
|
|
214
|
-
stroke: theme.warning,
|
|
215
|
-
strokeDasharray: "4 4",
|
|
216
|
-
strokeOpacity: .6,
|
|
217
|
-
label: referenceLine.label ? {
|
|
218
|
-
value: referenceLine.label,
|
|
219
|
-
fill: theme.warning,
|
|
220
|
-
fontSize: 9,
|
|
221
|
-
fontFamily: theme.fontMono,
|
|
222
|
-
position: "insideBottomRight"
|
|
223
|
-
} : void 0
|
|
138
|
+
renderReferenceLine({
|
|
139
|
+
referenceLine,
|
|
140
|
+
numericMax,
|
|
141
|
+
theme
|
|
224
142
|
}),
|
|
225
143
|
rendered.map((entry, slot) => /* @__PURE__ */ jsx(Area, {
|
|
226
144
|
type: curveType,
|
|
@@ -232,36 +150,31 @@ function AreaChart({ data, index, series, variant = "stacked", curve = "monotone
|
|
|
232
150
|
strokeDasharray: entry.dashed ? "5 3" : void 0,
|
|
233
151
|
fill: fillFor(entry, slot),
|
|
234
152
|
dot: false,
|
|
235
|
-
activeDot:
|
|
236
|
-
|
|
153
|
+
activeDot: makeActiveDot(entry, {
|
|
154
|
+
valueFlags,
|
|
155
|
+
theme,
|
|
156
|
+
valueFormatter
|
|
157
|
+
}),
|
|
158
|
+
isAnimationActive: false,
|
|
237
159
|
animationDuration: 650,
|
|
238
160
|
animationEasing: "ease-out",
|
|
239
161
|
children: lastValueLabel && /* @__PURE__ */ jsx(LabelList, {
|
|
240
162
|
dataKey: entry.key,
|
|
241
|
-
content:
|
|
163
|
+
content: makeLastValueLabel(entry.color, {
|
|
164
|
+
dataLength: data.length,
|
|
165
|
+
theme,
|
|
166
|
+
valueFormatter
|
|
167
|
+
})
|
|
242
168
|
})
|
|
243
169
|
}, entry.key)),
|
|
244
|
-
markers
|
|
245
|
-
x: marker.x,
|
|
246
|
-
y: marker.y,
|
|
247
|
-
r: 3.5,
|
|
248
|
-
fill: marker.color ?? theme.foreground,
|
|
249
|
-
stroke: theme.card,
|
|
250
|
-
strokeWidth: 2,
|
|
251
|
-
label: marker.label ? {
|
|
252
|
-
value: marker.label,
|
|
253
|
-
fill: marker.color ?? theme.foreground,
|
|
254
|
-
fontSize: 9,
|
|
255
|
-
fontFamily: theme.fontMono,
|
|
256
|
-
position: "top"
|
|
257
|
-
} : void 0
|
|
258
|
-
}, `${marker.x}-${marker.y}`))
|
|
170
|
+
renderMarkers(markers, theme)
|
|
259
171
|
]
|
|
260
172
|
})
|
|
261
173
|
})
|
|
262
174
|
}), legend && !isEmpty && /* @__PURE__ */ jsx(ChartLegend, {
|
|
263
175
|
items: legendItems,
|
|
264
|
-
|
|
176
|
+
align: legendAlign,
|
|
177
|
+
insetLeft: yAxisWidth
|
|
265
178
|
})]
|
|
266
179
|
});
|
|
267
180
|
}
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
//#region src/components/attachment-tile.d.ts
|
|
2
2
|
interface AttachmentTileProps {
|
|
3
|
-
/** Source URL for the attachment thumbnail */
|
|
4
3
|
src?: string;
|
|
5
|
-
/** Whether the attachment is an image */
|
|
6
4
|
isImage?: boolean;
|
|
7
|
-
/** Accessible label describing the attachment */
|
|
8
5
|
label?: string;
|
|
9
|
-
/** Called when the remove button is clicked */
|
|
10
6
|
onRemove?: () => void;
|
|
11
|
-
/** Called when the tile is clicked (e.g. to open a preview) */
|
|
12
7
|
onClick?: () => void;
|
|
13
8
|
className?: string;
|
|
14
9
|
}
|
|
15
|
-
declare function AttachmentTile({
|
|
16
|
-
src,
|
|
17
|
-
isImage,
|
|
18
|
-
label,
|
|
19
|
-
onRemove,
|
|
20
|
-
onClick,
|
|
21
|
-
className
|
|
22
|
-
}: AttachmentTileProps): import("react").JSX.Element;
|
|
10
|
+
declare function AttachmentTile({ src, isImage, label, onRemove, onClick, className }: AttachmentTileProps): import("react").JSX.Element;
|
|
23
11
|
//#endregion
|
|
24
12
|
export { AttachmentTile, type AttachmentTileProps };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
|
-
|
|
5
4
|
//#region src/components/avatar.d.ts
|
|
6
5
|
declare const avatarVariants: (props?: ({
|
|
7
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
@@ -11,21 +10,9 @@ type AvatarStatus = "online";
|
|
|
11
10
|
interface AvatarProps extends React$1.ComponentProps<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
12
11
|
status?: AvatarStatus;
|
|
13
12
|
}
|
|
14
|
-
declare function Avatar({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
className,
|
|
18
|
-
children,
|
|
19
|
-
...props
|
|
20
|
-
}: AvatarProps): React$1.JSX.Element;
|
|
21
|
-
declare function AvatarImage({
|
|
22
|
-
className,
|
|
23
|
-
...props
|
|
24
|
-
}: React$1.ComponentProps<typeof AvatarPrimitive.Image>): React$1.JSX.Element;
|
|
25
|
-
declare function AvatarFallback({
|
|
26
|
-
className,
|
|
27
|
-
...props
|
|
28
|
-
}: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): React$1.JSX.Element;
|
|
13
|
+
declare function Avatar({ size, status, className, children, ...props }: AvatarProps): React$1.JSX.Element;
|
|
14
|
+
declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Image>): React$1.JSX.Element;
|
|
15
|
+
declare function AvatarFallback({ className, ...props }: React$1.ComponentProps<typeof AvatarPrimitive.Fallback>): React$1.JSX.Element;
|
|
29
16
|
interface AvatarLabelGroupProps extends React$1.ComponentProps<"div"> {
|
|
30
17
|
size?: "sm" | "md";
|
|
31
18
|
src?: string;
|
|
@@ -35,16 +22,6 @@ interface AvatarLabelGroupProps extends React$1.ComponentProps<"div"> {
|
|
|
35
22
|
label?: string;
|
|
36
23
|
status?: AvatarStatus;
|
|
37
24
|
}
|
|
38
|
-
declare function AvatarLabelGroup({
|
|
39
|
-
size,
|
|
40
|
-
src,
|
|
41
|
-
alt,
|
|
42
|
-
fallback,
|
|
43
|
-
name,
|
|
44
|
-
label,
|
|
45
|
-
status,
|
|
46
|
-
className,
|
|
47
|
-
...props
|
|
48
|
-
}: AvatarLabelGroupProps): React$1.JSX.Element;
|
|
25
|
+
declare function AvatarLabelGroup({ size, src, alt, fallback, name, label, status, className, ...props }: AvatarLabelGroupProps): React$1.JSX.Element;
|
|
49
26
|
//#endregion
|
|
50
27
|
export { Avatar, AvatarFallback, AvatarImage, AvatarLabelGroup, type AvatarSize, type AvatarStatus };
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
|
-
|
|
3
2
|
//#region src/components/badge.d.ts
|
|
4
3
|
declare const badgeVariants: (props?: ({
|
|
5
|
-
variant?: "warning" | "success" | "
|
|
4
|
+
variant?: "warning" | "success" | "secondary" | "primary" | "error" | null | undefined;
|
|
6
5
|
size?: "sm" | "md" | null | undefined;
|
|
7
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
7
|
interface BadgeProps extends React.ComponentProps<"span">, VariantProps<typeof badgeVariants> {}
|
|
9
|
-
declare function Badge({
|
|
10
|
-
className,
|
|
11
|
-
variant,
|
|
12
|
-
size,
|
|
13
|
-
children,
|
|
14
|
-
...props
|
|
15
|
-
}: BadgeProps): import("react").JSX.Element;
|
|
8
|
+
declare function Badge({ className, variant, size, children, ...props }: BadgeProps): import("react").JSX.Element;
|
|
16
9
|
type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>["variant"]>;
|
|
17
10
|
//#endregion
|
|
18
11
|
export { Badge, type BadgeVariant, badgeVariants };
|
|
@@ -2,7 +2,6 @@ import { ChartSeries } from "../lib/chart.mjs";
|
|
|
2
2
|
import { ChartPaletteName } from "../lib/chart-palette.mjs";
|
|
3
3
|
import { ChartMarker } from "./area-chart.mjs";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
|
-
|
|
6
5
|
//#region src/components/bar-chart.d.ts
|
|
7
6
|
interface BarChartProps {
|
|
8
7
|
data: ReadonlyArray<Record<string, string | number | null | undefined>>;
|
|
@@ -10,9 +9,12 @@ interface BarChartProps {
|
|
|
10
9
|
series: ChartSeries[];
|
|
11
10
|
variant?: "stacked" | "grouped" | "expand";
|
|
12
11
|
legend?: boolean;
|
|
12
|
+
legendAlign?: "left" | "center" | "right";
|
|
13
13
|
valueLabels?: boolean;
|
|
14
14
|
height?: number;
|
|
15
15
|
yAxisWidth?: number;
|
|
16
|
+
bare?: boolean;
|
|
17
|
+
barCategoryGap?: number | string;
|
|
16
18
|
palette?: ChartPaletteName;
|
|
17
19
|
referenceLine?: {
|
|
18
20
|
y: number;
|
|
@@ -21,28 +23,12 @@ interface BarChartProps {
|
|
|
21
23
|
};
|
|
22
24
|
markers?: ChartMarker[];
|
|
23
25
|
texture?: boolean;
|
|
26
|
+
partialLastBar?: boolean;
|
|
24
27
|
loading?: boolean;
|
|
25
28
|
valueFormatter?: (value: number) => string;
|
|
26
29
|
labelFormatter?: (label: string | number) => string;
|
|
27
30
|
className?: string;
|
|
28
31
|
}
|
|
29
|
-
declare function BarChart({
|
|
30
|
-
data,
|
|
31
|
-
index,
|
|
32
|
-
series,
|
|
33
|
-
variant,
|
|
34
|
-
legend,
|
|
35
|
-
valueLabels,
|
|
36
|
-
height,
|
|
37
|
-
yAxisWidth,
|
|
38
|
-
palette,
|
|
39
|
-
referenceLine,
|
|
40
|
-
markers,
|
|
41
|
-
texture,
|
|
42
|
-
loading,
|
|
43
|
-
valueFormatter,
|
|
44
|
-
labelFormatter,
|
|
45
|
-
className
|
|
46
|
-
}: BarChartProps): React$1.JSX.Element;
|
|
32
|
+
declare function BarChart({ data, index, series, variant, legend, legendAlign, valueLabels, height, yAxisWidth, bare, barCategoryGap, palette, referenceLine, markers, texture, partialLastBar, loading, valueFormatter, labelFormatter, className }: BarChartProps): React$1.JSX.Element;
|
|
47
33
|
//#endregion
|
|
48
34
|
export { BarChart, BarChartProps };
|