@cmdniels/uikit 1.1.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +4 -4
  2. package/out/components/button/Button.js +1 -1
  3. package/out/components/chart/ChartContainer.d.ts +7 -0
  4. package/out/components/chart/ChartContainer.js +24 -0
  5. package/out/components/chart/ChartContext.d.ts +16 -0
  6. package/out/components/chart/ChartContext.js +2 -0
  7. package/out/components/chart/ChartLegend.d.ts +3 -0
  8. package/out/components/chart/ChartLegend.js +5 -0
  9. package/out/components/chart/ChartLegendContent.d.ts +9 -0
  10. package/out/components/chart/ChartLegendContent.js +19 -0
  11. package/out/components/chart/ChartStyle.d.ts +5 -0
  12. package/out/components/chart/ChartStyle.js +23 -0
  13. package/out/components/chart/ChartTooltip.d.ts +3 -0
  14. package/out/components/chart/ChartTooltip.js +17 -0
  15. package/out/components/chart/ChartTooltipContent.d.ts +15 -0
  16. package/out/components/chart/ChartTooltipContent.js +49 -0
  17. package/out/components/chart/getPayloadConfigFromPayload.d.ts +11 -0
  18. package/out/components/chart/getPayloadConfigFromPayload.js +18 -0
  19. package/out/components/chart/useChart.d.ts +3 -0
  20. package/out/components/chart/useChart.js +9 -0
  21. package/out/components/copy-input/CopyInput.js +2 -3
  22. package/out/components/error/Error.d.ts +2 -1
  23. package/out/components/item/ItemActions.d.ts +2 -2
  24. package/out/components/item/ItemContent.d.ts +2 -2
  25. package/out/components/item/ItemDescription.d.ts +2 -2
  26. package/out/components/item/ItemFooter.d.ts +2 -2
  27. package/out/components/item/ItemGroup.d.ts +2 -2
  28. package/out/components/item/ItemHeader.d.ts +2 -2
  29. package/out/components/item/ItemMedia.d.ts +2 -2
  30. package/out/components/item/ItemSeparator.d.ts +2 -2
  31. package/out/components/item/ItemTitle.d.ts +2 -2
  32. package/out/components/link-input/LinkInput.js +1 -1
  33. package/out/components/sheet/Sheet.d.ts +2 -0
  34. package/out/components/sheet/Sheet.js +18 -0
  35. package/out/components/sheet/SheetClose.d.ts +2 -0
  36. package/out/components/sheet/SheetClose.js +18 -0
  37. package/out/components/sheet/SheetContent.d.ts +5 -0
  38. package/out/components/sheet/SheetContent.js +23 -0
  39. package/out/components/sheet/SheetDescription.d.ts +2 -0
  40. package/out/components/sheet/SheetDescription.js +19 -0
  41. package/out/components/sheet/SheetFooter.d.ts +2 -0
  42. package/out/components/sheet/SheetFooter.js +18 -0
  43. package/out/components/sheet/SheetHeader.d.ts +2 -0
  44. package/out/components/sheet/SheetHeader.js +18 -0
  45. package/out/components/sheet/SheetOverlay.d.ts +2 -0
  46. package/out/components/sheet/SheetOverlay.js +19 -0
  47. package/out/components/sheet/SheetPortal.d.ts +2 -0
  48. package/out/components/sheet/SheetPortal.js +18 -0
  49. package/out/components/sheet/SheetTitle.d.ts +2 -0
  50. package/out/components/sheet/SheetTitle.js +19 -0
  51. package/out/components/sheet/SheetTrigger.d.ts +2 -0
  52. package/out/components/sheet/SheetTrigger.js +18 -0
  53. package/out/components/sidebar/Sidebar.d.ts +7 -0
  54. package/out/components/sidebar/Sidebar.js +43 -0
  55. package/out/components/sidebar/SidebarContent.d.ts +2 -0
  56. package/out/components/sidebar/SidebarContent.js +17 -0
  57. package/out/components/sidebar/SidebarFooter.d.ts +2 -0
  58. package/out/components/sidebar/SidebarFooter.js +17 -0
  59. package/out/components/sidebar/SidebarGroup.d.ts +2 -0
  60. package/out/components/sidebar/SidebarGroup.js +17 -0
  61. package/out/components/sidebar/SidebarGroupAction.d.ts +3 -0
  62. package/out/components/sidebar/SidebarGroupAction.js +28 -0
  63. package/out/components/sidebar/SidebarGroupContent.d.ts +2 -0
  64. package/out/components/sidebar/SidebarGroupContent.js +17 -0
  65. package/out/components/sidebar/SidebarGroupLabel.d.ts +3 -0
  66. package/out/components/sidebar/SidebarGroupLabel.js +28 -0
  67. package/out/components/sidebar/SidebarHeader.d.ts +2 -0
  68. package/out/components/sidebar/SidebarHeader.js +17 -0
  69. package/out/components/sidebar/SidebarInput.d.ts +3 -0
  70. package/out/components/sidebar/SidebarInput.js +18 -0
  71. package/out/components/sidebar/SidebarInset.d.ts +2 -0
  72. package/out/components/sidebar/SidebarInset.js +17 -0
  73. package/out/components/sidebar/SidebarMenu.d.ts +2 -0
  74. package/out/components/sidebar/SidebarMenu.js +17 -0
  75. package/out/components/sidebar/SidebarMenuAction.d.ts +5 -0
  76. package/out/components/sidebar/SidebarMenuAction.js +29 -0
  77. package/out/components/sidebar/SidebarMenuBadge.d.ts +2 -0
  78. package/out/components/sidebar/SidebarMenuBadge.js +17 -0
  79. package/out/components/sidebar/SidebarMenuButton.d.ts +9 -0
  80. package/out/components/sidebar/SidebarMenuButton.js +46 -0
  81. package/out/components/sidebar/SidebarMenuItem.d.ts +2 -0
  82. package/out/components/sidebar/SidebarMenuItem.js +17 -0
  83. package/out/components/sidebar/SidebarMenuSkeleton.d.ts +4 -0
  84. package/out/components/sidebar/SidebarMenuSkeleton.js +23 -0
  85. package/out/components/sidebar/SidebarMenuSub.d.ts +2 -0
  86. package/out/components/sidebar/SidebarMenuSub.js +17 -0
  87. package/out/components/sidebar/SidebarMenuSubButton.d.ts +6 -0
  88. package/out/components/sidebar/SidebarMenuSubButton.js +30 -0
  89. package/out/components/sidebar/SidebarMenuSubItem.d.ts +2 -0
  90. package/out/components/sidebar/SidebarMenuSubItem.js +17 -0
  91. package/out/components/sidebar/SidebarProvider.d.ts +23 -0
  92. package/out/components/sidebar/SidebarProvider.js +69 -0
  93. package/out/components/sidebar/SidebarRail.d.ts +2 -0
  94. package/out/components/sidebar/SidebarRail.js +20 -0
  95. package/out/components/sidebar/SidebarSeparator.d.ts +3 -0
  96. package/out/components/sidebar/SidebarSeparator.js +18 -0
  97. package/out/components/sidebar/SidebarTrigger.d.ts +3 -0
  98. package/out/components/sidebar/SidebarTrigger.js +25 -0
  99. package/out/components/sidebar/sidebarMenuButtonVariants.d.ts +5 -0
  100. package/out/components/sidebar/sidebarMenuButtonVariants.js +19 -0
  101. package/out/components/sidebar/useIsMobile.d.ts +1 -0
  102. package/out/components/sidebar/useIsMobile.js +14 -0
  103. package/out/components/sidebar/useSidebar.d.ts +9 -0
  104. package/out/components/sidebar/useSidebar.js +9 -0
  105. package/out/components/spinner/Spinner.d.ts +2 -1
  106. package/out/index.d.ts +36 -0
  107. package/out/index.js +37 -0
  108. package/package.json +2 -1
package/README.md CHANGED
@@ -113,13 +113,13 @@ export default function MyComponent() {
113
113
 
114
114
  ## Available Components
115
115
 
116
- - **Layout**: Accordion, Card, Item, Separator, Table
116
+ - **Layout**: Accordion, AspectRatio, Card, Item, ScrollArea, Separator, Sheet, Sidebar, Table
117
117
  - **Forms**: Button, ButtonGroup, Checkbox, Input, InputGroup, Label, Select, Switch, Textarea, Toggle
118
- - **Data Entry**: Calendar, Combobox, DatePicker, Field, FileDropzone
119
- - **Feedback**: Alert, AlertDialog, Error, Skeleton, Toaster (Sonner)
118
+ - **Data Entry**: Calendar, Combobox, CopyInput, DatePicker, Field, FileDropzone, LinkInput
119
+ - **Feedback**: Alert, AlertDialog, Error, Skeleton, Spinner, Toaster (Sonner)
120
120
  - **Navigation**: ContextMenu, DropdownMenu
121
121
  - **Overlay**: Popover, Tooltip
122
- - **Utilities**: AspectRatio, Badge, Sortable
122
+ - **Utilities**: Badge, Chart, Sortable
123
123
  - **Typography**: Complete set of typography components
124
124
 
125
125
  ## Development
@@ -16,5 +16,5 @@ import Spinner from "../../components/spinner/Spinner";
16
16
  import { buttonVariants } from "./buttonVariants";
17
17
  export default function Button(_a) {
18
18
  var { className, children, variant = "default", size = "default", loading = false, disabled } = _a, props = __rest(_a, ["className", "children", "variant", "size", "loading", "disabled"]);
19
- return (_jsxs(ButtonPrimitive, Object.assign({ "data-slot": "button", className: cn(buttonVariants({ variant, size, className }), loading && "relative"), disabled: disabled !== null && disabled !== void 0 ? disabled : loading }, props, { children: [loading && _jsx(Spinner, { className: "absolute inset-0 m-auto" }), _jsx("span", { className: cn("contents", loading && "invisible"), children: children })] })));
19
+ return (_jsxs(ButtonPrimitive, Object.assign({ "data-slot": "button", className: cn(buttonVariants({ variant, size, className }), loading && "relative"), disabled: loading || disabled }, props, { children: [loading && _jsx(Spinner, { className: "absolute inset-0 m-auto" }), _jsx("span", { className: cn("contents", loading && "invisible"), children: children })] })));
20
20
  }
@@ -0,0 +1,7 @@
1
+ import { type ComponentProps } from "react";
2
+ import { ResponsiveContainer as RechartsResponsiveContainer } from "recharts";
3
+ import { type ChartConfig } from "./ChartContext";
4
+ export default function ChartContainer({ id, className, children, config, ...props }: ComponentProps<"div"> & {
5
+ config: ChartConfig;
6
+ children: ComponentProps<typeof RechartsResponsiveContainer>["children"];
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { useId } from "react";
15
+ import { ResponsiveContainer as RechartsResponsiveContainer } from "recharts";
16
+ import cn from "../../cn";
17
+ import { ChartContext } from "./ChartContext";
18
+ import ChartStyle from "./ChartStyle";
19
+ export default function ChartContainer(_a) {
20
+ var { id, className, children, config } = _a, props = __rest(_a, ["id", "className", "children", "config"]);
21
+ const uniqueId = useId();
22
+ const chartId = `chart-${id !== null && id !== void 0 ? id : uniqueId.replace(/:/g, "")}`;
23
+ return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", Object.assign({ "data-slot": "chart", "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-none [&_g]:focus:outline-none", className) }, props, { children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsResponsiveContainer, { children: children })] })) }));
24
+ }
@@ -0,0 +1,16 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ export type ChartConfig = {
3
+ [k in string]: {
4
+ label?: ReactNode;
5
+ icon?: ComponentType;
6
+ } & ({
7
+ color?: string;
8
+ theme?: never;
9
+ } | {
10
+ color?: never;
11
+ theme: Record<"light" | "dark", string>;
12
+ });
13
+ };
14
+ export declare const ChartContext: import("react").Context<{
15
+ config: ChartConfig;
16
+ } | null>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from "react";
2
+ export const ChartContext = createContext(null);
@@ -0,0 +1,3 @@
1
+ import { type ComponentProps } from "react";
2
+ import { Legend as RechartsLegend } from "recharts";
3
+ export default function ChartLegend(props: ComponentProps<typeof RechartsLegend>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Legend as RechartsLegend } from "recharts";
3
+ export default function ChartLegend(props) {
4
+ return _jsx(RechartsLegend, Object.assign({}, props));
5
+ }
@@ -0,0 +1,9 @@
1
+ import type { LegendPayload } from "recharts/types/component/DefaultLegendContent";
2
+ import type { Props as LegendProps } from "recharts/types/component/Legend";
3
+ export default function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: {
4
+ className?: string;
5
+ hideIcon?: boolean;
6
+ verticalAlign?: LegendProps["verticalAlign"];
7
+ payload?: readonly LegendPayload[];
8
+ nameKey?: string;
9
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import cn from "../../cn";
4
+ import getPayloadConfigFromPayload from "./getPayloadConfigFromPayload";
5
+ import useChart from "./useChart";
6
+ export default function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey, }) {
7
+ const { config } = useChart();
8
+ if (!(payload === null || payload === void 0 ? void 0 : payload.length)) {
9
+ return null;
10
+ }
11
+ return (_jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload.map((item) => {
12
+ var _a;
13
+ const key = `${(_a = nameKey !== null && nameKey !== void 0 ? nameKey : item.dataKey) !== null && _a !== void 0 ? _a : "value"}`;
14
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
15
+ return (_jsxs("div", { className: cn("flex items-center gap-1.5 [&>svg]:size-3 [&>svg]:text-muted-foreground"), children: [(itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "size-2 shrink-0 rounded-[2px]", style: {
16
+ backgroundColor: item.color,
17
+ } })), itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label] }, item.value));
18
+ }) }));
19
+ }
@@ -0,0 +1,5 @@
1
+ import { type ChartConfig } from "./ChartContext";
2
+ export default function ChartStyle({ id, config }: {
3
+ id: string;
4
+ config: ChartConfig;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const THEMES = { light: "", dark: ".dark" }; // Format: { THEME_NAME: CSS_SELECTOR }
3
+ export default function ChartStyle({ id, config }) {
4
+ const colorConfig = Object.entries(config).filter(([, _config]) => { var _a; return (_a = _config.theme) !== null && _a !== void 0 ? _a : _config.color; });
5
+ if (!colorConfig.length) {
6
+ return null;
7
+ }
8
+ return (_jsx("style", { dangerouslySetInnerHTML: {
9
+ __html: Object.entries(THEMES)
10
+ .map(([theme, prefix]) => `
11
+ ${prefix} [data-chart=${id}] {
12
+ ${colorConfig
13
+ .map(([key, itemConfig]) => {
14
+ var _a, _b;
15
+ const color = (_b = (_a = itemConfig.theme) === null || _a === void 0 ? void 0 : _a[theme]) !== null && _b !== void 0 ? _b : itemConfig.color;
16
+ return color ? ` --color-${key}: ${color};` : null;
17
+ })
18
+ .join("\n")}
19
+ }
20
+ `)
21
+ .join("\n"),
22
+ } }));
23
+ }
@@ -0,0 +1,3 @@
1
+ import { type ComponentProps } from "react";
2
+ import { Tooltip as RechartsTooltip } from "recharts";
3
+ export default function ChartTooltip({ ...props }: ComponentProps<typeof RechartsTooltip>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { Tooltip as RechartsTooltip } from "recharts";
14
+ export default function ChartTooltip(_a) {
15
+ var props = __rest(_a, []);
16
+ return _jsx(RechartsTooltip, Object.assign({}, props));
17
+ }
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from "react";
2
+ import type { NameType, Payload, ValueType } from "recharts/types/component/DefaultTooltipContent";
3
+ import type { TooltipContentProps } from "recharts/types/component/Tooltip";
4
+ export default function ChartTooltipContent({ active, payload, label, className, indicator, hideLabel, hideIndicator, labelFormatter, formatter, labelClassName, color, nameKey, labelKey, }: TooltipContentProps<ValueType, NameType> & {
5
+ className?: string;
6
+ hideLabel?: boolean;
7
+ hideIndicator?: boolean;
8
+ indicator?: "line" | "dot" | "dashed";
9
+ nameKey?: string;
10
+ labelKey?: string;
11
+ labelFormatter?: (label: TooltipContentProps<number, string>["label"], payload: TooltipContentProps<number, string>["payload"]) => ReactNode;
12
+ formatter?: (value: number | string, name: string, item: Payload<number | string, string>, index: number, payload: ReadonlyArray<Payload<number | string, string>>) => ReactNode;
13
+ labelClassName?: string;
14
+ color?: string;
15
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
+ import cn from "../../cn";
5
+ import getPayloadConfigFromPayload from "./getPayloadConfigFromPayload";
6
+ import useChart from "./useChart";
7
+ export default function ChartTooltipContent({ active, payload, label, className, indicator = "dot", hideLabel = false, hideIndicator = false, labelFormatter, formatter, labelClassName, color, nameKey, labelKey, }) {
8
+ const { config } = useChart();
9
+ const tooltipLabel = useMemo(() => {
10
+ var _a, _b;
11
+ if (hideLabel || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
12
+ return null;
13
+ }
14
+ const [item] = payload;
15
+ const key = `${(_b = (_a = labelKey !== null && labelKey !== void 0 ? labelKey : item === null || item === void 0 ? void 0 : item.dataKey) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.name) !== null && _b !== void 0 ? _b : "value"}`;
16
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
17
+ const value = (() => {
18
+ var _a, _b;
19
+ const v = !labelKey && typeof label === "string" ? ((_b = (_a = config[label]) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : label) : itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label;
20
+ return typeof v === "string" || typeof v === "number" ? v : undefined;
21
+ })();
22
+ if (labelFormatter) {
23
+ return _jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
24
+ }
25
+ if (!value) {
26
+ return null;
27
+ }
28
+ return _jsx("div", { className: cn("font-medium", labelClassName), children: value });
29
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
30
+ if (!active || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
31
+ return null;
32
+ }
33
+ const nestLabel = payload.length === 1 && indicator !== "dot";
34
+ return (_jsxs("div", { className: cn("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
35
+ var _a, _b, _c, _d;
36
+ const key = `${(_b = (_a = nameKey !== null && nameKey !== void 0 ? nameKey : item.name) !== null && _a !== void 0 ? _a : item.dataKey) !== null && _b !== void 0 ? _b : "value"}`;
37
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
38
+ const indicatorColor = (_c = color !== null && color !== void 0 ? color : item.payload.fill) !== null && _c !== void 0 ? _c : item.color;
39
+ return (_jsx("div", { className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"), children: formatter && (item === null || item === void 0 ? void 0 : item.value) !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [(itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
40
+ "size-2.5 ": indicator === "dot",
41
+ "w-1": indicator === "line",
42
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
43
+ "my-0.5": nestLabel && indicator === "dashed",
44
+ }), style: {
45
+ "--color-bg": indicatorColor,
46
+ "--color-border": indicatorColor,
47
+ } }))), _jsxs("div", { className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: (_d = itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label) !== null && _d !== void 0 ? _d : item.name })] }), item.value && (_jsx("span", { className: "font-mono font-medium text-foreground tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
48
+ }) })] }));
49
+ }
@@ -0,0 +1,11 @@
1
+ import { type ChartConfig } from "./ChartContext";
2
+ export default function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ({
3
+ label?: import("react").ReactNode;
4
+ icon?: import("react").ComponentType;
5
+ } & ({
6
+ color?: string;
7
+ theme?: never;
8
+ } | {
9
+ color?: never;
10
+ theme: Record<"light" | "dark", string>;
11
+ })) | undefined;
@@ -0,0 +1,18 @@
1
+ export default function getPayloadConfigFromPayload(config, payload, key) {
2
+ if (typeof payload !== "object" || payload === null) {
3
+ return undefined;
4
+ }
5
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null
6
+ ? payload.payload
7
+ : undefined;
8
+ let configLabelKey = key;
9
+ if (key in payload && typeof payload[key] === "string") {
10
+ configLabelKey = payload[key];
11
+ }
12
+ else if (payloadPayload &&
13
+ key in payloadPayload &&
14
+ typeof payloadPayload[key] === "string") {
15
+ configLabelKey = payloadPayload[key];
16
+ }
17
+ return configLabelKey in config ? config[configLabelKey] : config[key];
18
+ }
@@ -0,0 +1,3 @@
1
+ export default function useChart(): {
2
+ config: import("./ChartContext").ChartConfig;
3
+ };
@@ -0,0 +1,9 @@
1
+ import { useContext } from "react";
2
+ import { ChartContext } from "./ChartContext";
3
+ export default function useChart() {
4
+ const context = useContext(ChartContext);
5
+ if (!context) {
6
+ throw new Error("useChart must be used within a <ChartContainer />");
7
+ }
8
+ return context;
9
+ }
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { IconCopy } from "@tabler/icons-react";
15
- import { useState, useRef, Children, isValidElement } from "react";
15
+ import { useState, useRef, Children, isValidElement, } from "react";
16
16
  import Button from "../../components/button/Button";
17
17
  import InputGroup from "../../components/input-group/InputGroup";
18
18
  import InputGroupAddon from "../../components/input-group/InputGroupAddon";
@@ -31,8 +31,7 @@ export default function CopyInput(_a) {
31
31
  const text = (_d = (_c = Children.map(children, (child) => {
32
32
  if (isValidElement(child) && child.props.children) {
33
33
  const inputGroupText = child.props.children;
34
- if (isValidElement(inputGroupText) &&
35
- inputGroupText.props.children) {
34
+ if (isValidElement(inputGroupText) && inputGroupText.props.children) {
36
35
  const innerText = inputGroupText.props.children;
37
36
  if (typeof innerText === "string" || typeof innerText === "number") {
38
37
  return innerText;
@@ -1,4 +1,5 @@
1
- export default function Error({ title, message, className, ...props }: React.HTMLAttributes<HTMLDivElement> & {
1
+ import { type HTMLAttributes } from "react";
2
+ export default function Error({ title, message, className, ...props }: HTMLAttributes<HTMLDivElement> & {
2
3
  title: string;
3
4
  message: string;
4
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import { type ComponentProps } from "react";
2
+ declare function ItemActions({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemActions;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import { type ComponentProps } from "react";
2
+ declare function ItemContent({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemContent;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
1
+ import type { ComponentProps } from "react";
2
+ declare function ItemDescription({ className, ...props }: ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemDescription;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import type { ComponentProps } from "react";
2
+ declare function ItemFooter({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemFooter;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import type { ComponentProps } from "react";
2
+ declare function ItemGroup({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemGroup;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import type { ComponentProps } from "react";
2
+ declare function ItemHeader({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemHeader;
@@ -1,5 +1,5 @@
1
- import * as React from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import itemMediaVariants from "./itemMediaVariants";
3
3
  import type { VariantProps } from "class-variance-authority";
4
- declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): import("react/jsx-runtime").JSX.Element;
4
+ declare function ItemMedia({ className, variant, ...props }: ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): import("react/jsx-runtime").JSX.Element;
5
5
  export default ItemMedia;
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import Separator from "../../components/separator/Separator";
3
- declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
3
+ declare function ItemSeparator({ className, ...props }: ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
4
4
  export default ItemSeparator;
@@ -1,3 +1,3 @@
1
- import * as React from "react";
2
- declare function ItemTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import type { ComponentProps } from "react";
2
+ declare function ItemTitle({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export default ItemTitle;
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { IconExternalLink } from "@tabler/icons-react";
15
- import { useState, useRef, isValidElement, Children } from "react";
15
+ import { useState, useRef, isValidElement, Children, } from "react";
16
16
  import Button from "../../components/button/Button";
17
17
  import InputGroup from "../../components/input-group/InputGroup";
18
18
  import InputGroupAddon from "../../components/input-group/InputGroupAddon";
@@ -0,0 +1,2 @@
1
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
2
+ export default function Sheet({ ...props }: SheetPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
15
+ export default function Sheet(_a) {
16
+ var props = __rest(_a, []);
17
+ return _jsx(SheetPrimitive.Root, Object.assign({ "data-slot": "sheet" }, props));
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
2
+ export default function SheetClose({ ...props }: SheetPrimitive.Close.Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
15
+ export default function SheetClose(_a) {
16
+ var props = __rest(_a, []);
17
+ return _jsx(SheetPrimitive.Close, Object.assign({ "data-slot": "sheet-close" }, props));
18
+ }
@@ -0,0 +1,5 @@
1
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
2
+ export default function SheetContent({ className, children, side, showCloseButton, ...props }: SheetPrimitive.Popup.Props & {
3
+ side?: "top" | "right" | "bottom" | "left";
4
+ showCloseButton?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
15
+ import { IconX } from "@tabler/icons-react";
16
+ import cn from "../../cn";
17
+ import Button from "../../components/button/Button";
18
+ import SheetOverlay from "./SheetOverlay";
19
+ import SheetPortal from "./SheetPortal";
20
+ export default function SheetContent(_a) {
21
+ var { className, children, side = "right", showCloseButton = true } = _a, props = __rest(_a, ["className", "children", "side", "showCloseButton"]);
22
+ return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Popup, Object.assign({ "data-slot": "sheet-content", "data-side": side, className: cn("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10", className) }, props, { children: [children, showCloseButton && (_jsxs(SheetPrimitive.Close, { "data-slot": "sheet-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm" }), children: [_jsx(IconX, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] }))] }));
23
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
2
+ export default function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
15
+ import cn from "../../cn";
16
+ export default function SheetDescription(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(SheetPrimitive.Description, Object.assign({ "data-slot": "sheet-description", className: cn("text-sm text-muted-foreground", className) }, props)));
19
+ }
@@ -0,0 +1,2 @@
1
+ import type { ComponentProps } from "react";
2
+ export default function SheetFooter({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import cn from "../../cn";
15
+ export default function SheetFooter(_a) {
16
+ var { className } = _a, props = __rest(_a, ["className"]);
17
+ return _jsx("div", Object.assign({ "data-slot": "sheet-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className) }, props));
18
+ }
@@ -0,0 +1,2 @@
1
+ import type { ComponentProps } from "react";
2
+ export default function SheetHeader({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import cn from "../../cn";
15
+ export default function SheetHeader(_a) {
16
+ var { className } = _a, props = __rest(_a, ["className"]);
17
+ return _jsx("div", Object.assign({ "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className) }, props));
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
2
+ export default function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
15
+ import cn from "../../cn";
16
+ export default function SheetOverlay(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(SheetPrimitive.Backdrop, Object.assign({ "data-slot": "sheet-overlay", className: cn("fixed inset-0 z-50 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className) }, props)));
19
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
2
+ export default function SheetPortal({ ...props }: SheetPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;