@cmdniels/uikit 1.1.7 → 1.3.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 (43) 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/dialog/Dialog.d.ts +2 -0
  22. package/out/components/dialog/Dialog.js +18 -0
  23. package/out/components/dialog/DialogClose.d.ts +2 -0
  24. package/out/components/dialog/DialogClose.js +18 -0
  25. package/out/components/dialog/DialogContent.d.ts +4 -0
  26. package/out/components/dialog/DialogContent.js +23 -0
  27. package/out/components/dialog/DialogDescription.d.ts +2 -0
  28. package/out/components/dialog/DialogDescription.js +19 -0
  29. package/out/components/dialog/DialogFooter.d.ts +4 -0
  30. package/out/components/dialog/DialogFooter.js +20 -0
  31. package/out/components/dialog/DialogHeader.d.ts +2 -0
  32. package/out/components/dialog/DialogHeader.js +18 -0
  33. package/out/components/dialog/DialogOverlay.d.ts +2 -0
  34. package/out/components/dialog/DialogOverlay.js +19 -0
  35. package/out/components/dialog/DialogPortal.d.ts +2 -0
  36. package/out/components/dialog/DialogPortal.js +18 -0
  37. package/out/components/dialog/DialogTitle.d.ts +2 -0
  38. package/out/components/dialog/DialogTitle.js +19 -0
  39. package/out/components/dialog/DialogTrigger.d.ts +2 -0
  40. package/out/components/dialog/DialogTrigger.js +18 -0
  41. package/out/index.d.ts +17 -0
  42. package/out/index.js +17 -0
  43. package/package.json +4 -2
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
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function Dialog({ ...props }: DialogPrimitive.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ export default function Dialog(_a) {
16
+ var props = __rest(_a, []);
17
+ return _jsx(DialogPrimitive.Root, Object.assign({ "data-slot": "dialog" }, props));
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogClose({ ...props }: DialogPrimitive.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ export default function DialogClose(_a) {
16
+ var props = __rest(_a, []);
17
+ return _jsx(DialogPrimitive.Close, Object.assign({ "data-slot": "dialog-close" }, props));
18
+ }
@@ -0,0 +1,4 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
3
+ showCloseButton?: boolean;
4
+ }): 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 DialogPrimitive } 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 DialogOverlay from "./DialogOverlay";
19
+ import DialogPortal from "./DialogPortal";
20
+ export default function DialogContent(_a) {
21
+ var { className, children, showCloseButton = true } = _a, props = __rest(_a, ["className", "children", "showCloseButton"]);
22
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, Object.assign({ "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-1/2 gap-6 rounded-xl bg-background p-6 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className) }, props, { children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-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 DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogDescription({ className, ...props }: DialogPrimitive.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ import cn from "../../cn";
16
+ export default function DialogDescription(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(DialogPrimitive.Description, Object.assign({ "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className) }, props)));
19
+ }
@@ -0,0 +1,4 @@
1
+ import type * as React from "react";
2
+ export default function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
3
+ showCloseButton?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ import cn from "../../cn";
16
+ import Button from "../../components/button/Button";
17
+ export default function DialogFooter(_a) {
18
+ var { className, showCloseButton = false, children } = _a, props = __rest(_a, ["className", "showCloseButton", "children"]);
19
+ return (_jsxs("div", Object.assign({ "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className) }, props, { children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "outline" }), children: "Close" }))] })));
20
+ }
@@ -0,0 +1,2 @@
1
+ import type * as React from "react";
2
+ export default function DialogHeader({ className, ...props }: React.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 DialogHeader(_a) {
16
+ var { className } = _a, props = __rest(_a, ["className"]);
17
+ return _jsx("div", Object.assign({ "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className) }, props));
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogOverlay({ className, ...props }: DialogPrimitive.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ import cn from "../../cn";
16
+ export default function DialogOverlay(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(DialogPrimitive.Backdrop, Object.assign({ "data-slot": "dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 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 DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogPortal({ ...props }: DialogPrimitive.Portal.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ export default function DialogPortal(_a) {
16
+ var props = __rest(_a, []);
17
+ return _jsx(DialogPrimitive.Portal, Object.assign({ "data-slot": "dialog-portal" }, props));
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogTitle({ className, ...props }: DialogPrimitive.Title.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ import cn from "../../cn";
16
+ export default function DialogTitle(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className: cn("leading-none font-medium", className) }, props)));
19
+ }
@@ -0,0 +1,2 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ export default function DialogTrigger({ ...props }: DialogPrimitive.Trigger.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 DialogPrimitive } from "@base-ui/react/dialog";
15
+ export default function DialogTrigger(_a) {
16
+ var props = __rest(_a, []);
17
+ return _jsx(DialogPrimitive.Trigger, Object.assign({ "data-slot": "dialog-trigger" }, props));
18
+ }
package/out/index.d.ts CHANGED
@@ -33,6 +33,13 @@ export { default as CardDescription } from "./components/card/CardDescription";
33
33
  export { default as CardFooter } from "./components/card/CardFooter";
34
34
  export { default as CardHeader } from "./components/card/CardHeader";
35
35
  export { default as CardTitle } from "./components/card/CardTitle";
36
+ export type { ChartConfig } from "./components/chart/ChartContext";
37
+ export { default as ChartContainer } from "./components/chart/ChartContainer";
38
+ export { default as ChartLegend } from "./components/chart/ChartLegend";
39
+ export { default as ChartLegendContent } from "./components/chart/ChartLegendContent";
40
+ export { default as ChartStyle } from "./components/chart/ChartStyle";
41
+ export { default as ChartTooltip } from "./components/chart/ChartTooltip";
42
+ export { default as ChartTooltipContent } from "./components/chart/ChartTooltipContent";
36
43
  export { default as Checkbox } from "./components/checkbox/Checkbox";
37
44
  export { default as Combobox } from "./components/combobox/Combobox";
38
45
  export { default as ComboboxChip } from "./components/combobox/ComboboxChip";
@@ -68,6 +75,16 @@ export { default as ContextMenuSubTrigger } from "./components/context-menu/Cont
68
75
  export { default as ContextMenuTrigger } from "./components/context-menu/ContextMenuTrigger";
69
76
  export { default as CopyInput } from "./components/copy-input/CopyInput";
70
77
  export { default as DatePicker } from "./components/date-picker/DatePicker";
78
+ export { default as Dialog } from "./components/dialog/Dialog";
79
+ export { default as DialogClose } from "./components/dialog/DialogClose";
80
+ export { default as DialogContent } from "./components/dialog/DialogContent";
81
+ export { default as DialogDescription } from "./components/dialog/DialogDescription";
82
+ export { default as DialogFooter } from "./components/dialog/DialogFooter";
83
+ export { default as DialogHeader } from "./components/dialog/DialogHeader";
84
+ export { default as DialogOverlay } from "./components/dialog/DialogOverlay";
85
+ export { default as DialogPortal } from "./components/dialog/DialogPortal";
86
+ export { default as DialogTitle } from "./components/dialog/DialogTitle";
87
+ export { default as DialogTrigger } from "./components/dialog/DialogTrigger";
71
88
  export { default as DropdownMenu } from "./components/dropdown-menu/DropdownMenu";
72
89
  export { default as DropdownMenuCheckboxItem } from "./components/dropdown-menu/DropdownMenuCheckboxItem";
73
90
  export { default as DropdownMenuContent } from "./components/dropdown-menu/DropdownMenuContent";
package/out/index.js CHANGED
@@ -42,6 +42,12 @@ export { default as CardDescription } from "./components/card/CardDescription";
42
42
  export { default as CardFooter } from "./components/card/CardFooter";
43
43
  export { default as CardHeader } from "./components/card/CardHeader";
44
44
  export { default as CardTitle } from "./components/card/CardTitle";
45
+ export { default as ChartContainer } from "./components/chart/ChartContainer";
46
+ export { default as ChartLegend } from "./components/chart/ChartLegend";
47
+ export { default as ChartLegendContent } from "./components/chart/ChartLegendContent";
48
+ export { default as ChartStyle } from "./components/chart/ChartStyle";
49
+ export { default as ChartTooltip } from "./components/chart/ChartTooltip";
50
+ export { default as ChartTooltipContent } from "./components/chart/ChartTooltipContent";
45
51
  // Checkbox
46
52
  export { default as Checkbox } from "./components/checkbox/Checkbox";
47
53
  // Combobox
@@ -82,6 +88,17 @@ export { default as ContextMenuTrigger } from "./components/context-menu/Context
82
88
  export { default as CopyInput } from "./components/copy-input/CopyInput";
83
89
  // Date Picker
84
90
  export { default as DatePicker } from "./components/date-picker/DatePicker";
91
+ // Dialog
92
+ export { default as Dialog } from "./components/dialog/Dialog";
93
+ export { default as DialogClose } from "./components/dialog/DialogClose";
94
+ export { default as DialogContent } from "./components/dialog/DialogContent";
95
+ export { default as DialogDescription } from "./components/dialog/DialogDescription";
96
+ export { default as DialogFooter } from "./components/dialog/DialogFooter";
97
+ export { default as DialogHeader } from "./components/dialog/DialogHeader";
98
+ export { default as DialogOverlay } from "./components/dialog/DialogOverlay";
99
+ export { default as DialogPortal } from "./components/dialog/DialogPortal";
100
+ export { default as DialogTitle } from "./components/dialog/DialogTitle";
101
+ export { default as DialogTrigger } from "./components/dialog/DialogTrigger";
85
102
  // Dropdown Menu
86
103
  export { default as DropdownMenu } from "./components/dropdown-menu/DropdownMenu";
87
104
  export { default as DropdownMenuCheckboxItem } from "./components/dropdown-menu/DropdownMenuCheckboxItem";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdniels/uikit",
3
- "version": "1.1.7",
3
+ "version": "1.3.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,7 +32,8 @@
32
32
  "@clerk/themes": "^2.4.46",
33
33
  "next": "^14.0.0 || ^15.0.0 || ^16.0.0",
34
34
  "react": "^18.0.0 || ^19.0.0",
35
- "react-dom": "^18.0.0 || ^19.0.0"
35
+ "react-dom": "^18.0.0 || ^19.0.0",
36
+ "recharts": "^3.6.0"
36
37
  },
37
38
  "dependencies": {
38
39
  "@base-ui/react": "^1.0.0",
@@ -40,6 +41,7 @@
40
41
  "@dnd-kit/modifiers": "^9.0.0",
41
42
  "@dnd-kit/sortable": "^10.0.0",
42
43
  "@dnd-kit/utilities": "^3.2.2",
44
+ "@radix-ui/react-dialog": "^1.1.15",
43
45
  "@radix-ui/react-scroll-area": "^1.2.10",
44
46
  "@tabler/icons-react": "^3.35.0",
45
47
  "@tailwindcss/postcss": "^4",