@hexclave/dashboard-ui-components 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert.js +4 -4
- package/dist/components/alert.js.map +1 -1
- package/dist/components/analytics-chart/analytics-chart-pie.js +33 -11
- package/dist/components/analytics-chart/analytics-chart-pie.js.map +1 -1
- package/dist/components/analytics-chart/analytics-chart.js +3 -3
- package/dist/components/analytics-chart/analytics-chart.js.map +1 -1
- package/dist/components/analytics-chart/default-analytics-chart-tooltip.js +4 -4
- package/dist/components/analytics-chart/default-analytics-chart-tooltip.js.map +1 -1
- package/dist/components/analytics-chart/types.d.ts +1 -0
- package/dist/components/analytics-chart/types.d.ts.map +1 -1
- package/dist/components/analytics-chart/types.js.map +1 -1
- package/dist/components/badge.js +2 -2
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.d.ts +4 -4
- package/dist/components/button.js +11 -11
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.js +7 -7
- package/dist/components/card.js.map +1 -1
- package/dist/components/chart-card.js +3 -3
- package/dist/components/chart-card.js.map +1 -1
- package/dist/components/chart-container.js +2 -2
- package/dist/components/chart-container.js.map +1 -1
- package/dist/components/chart-legend.js +3 -3
- package/dist/components/chart-legend.js.map +1 -1
- package/dist/components/chart-tooltip.js +7 -7
- package/dist/components/chart-tooltip.js.map +1 -1
- package/dist/components/data-grid/data-grid-toolbar.js +7 -7
- package/dist/components/data-grid/data-grid-toolbar.js.map +1 -1
- package/dist/components/data-grid/data-grid.js +16 -16
- package/dist/components/data-grid/data-grid.js.map +1 -1
- package/dist/components/data-grid/state.js +2 -2
- package/dist/components/data-grid/state.js.map +1 -1
- package/dist/components/dialog.js +22 -22
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/empty-state.js +2 -2
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/input.js +8 -8
- package/dist/components/input.js.map +1 -1
- package/dist/components/metric-card.js +5 -5
- package/dist/components/metric-card.js.map +1 -1
- package/dist/components/pill-toggle.js +11 -10
- package/dist/components/pill-toggle.js.map +1 -1
- package/dist/components/progress-bar.js +4 -4
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/separator.js +2 -2
- package/dist/components/separator.js.map +1 -1
- package/dist/components/skeleton.js +2 -2
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/table.js +14 -14
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +10 -10
- package/dist/components/tabs.js.map +1 -1
- package/dist/dashboard-ui-components.global.js +1720 -1678
- package/dist/dashboard-ui-components.global.js.map +4 -4
- package/dist/esm/components/alert.js.map +1 -1
- package/dist/esm/components/analytics-chart/analytics-chart-pie.js +33 -11
- package/dist/esm/components/analytics-chart/analytics-chart-pie.js.map +1 -1
- package/dist/esm/components/analytics-chart/analytics-chart.js.map +1 -1
- package/dist/esm/components/analytics-chart/default-analytics-chart-tooltip.js.map +1 -1
- package/dist/esm/components/analytics-chart/types.d.ts +1 -0
- package/dist/esm/components/analytics-chart/types.d.ts.map +1 -1
- package/dist/esm/components/analytics-chart/types.js.map +1 -1
- package/dist/esm/components/badge.js.map +1 -1
- package/dist/esm/components/button.d.ts +4 -4
- package/dist/esm/components/button.js.map +1 -1
- package/dist/esm/components/card.js.map +1 -1
- package/dist/esm/components/chart-card.js.map +1 -1
- package/dist/esm/components/chart-container.js.map +1 -1
- package/dist/esm/components/chart-legend.js.map +1 -1
- package/dist/esm/components/chart-tooltip.js.map +1 -1
- package/dist/esm/components/data-grid/data-grid-toolbar.js.map +1 -1
- package/dist/esm/components/data-grid/data-grid.js.map +1 -1
- package/dist/esm/components/data-grid/state.js.map +1 -1
- package/dist/esm/components/dialog.js.map +1 -1
- package/dist/esm/components/empty-state.js.map +1 -1
- package/dist/esm/components/input.js.map +1 -1
- package/dist/esm/components/metric-card.js.map +1 -1
- package/dist/esm/components/pill-toggle.js +1 -0
- package/dist/esm/components/pill-toggle.js.map +1 -1
- package/dist/esm/components/progress-bar.js.map +1 -1
- package/dist/esm/components/separator.js.map +1 -1
- package/dist/esm/components/skeleton.js.map +1 -1
- package/dist/esm/components/table.js.map +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +1 -1
- package/package.json +4 -4
|
@@ -4,8 +4,8 @@ import { VariantProps } from "class-variance-authority";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/button.d.ts
|
|
6
6
|
declare const designButtonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
8
|
-
size?: "
|
|
7
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
type DesignOriginalButtonProps = {
|
|
11
11
|
asChild?: boolean;
|
|
@@ -36,8 +36,8 @@ declare const DesignButton: React.FC<{
|
|
|
36
36
|
} & {
|
|
37
37
|
asChild?: boolean;
|
|
38
38
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
|
|
39
|
-
variant?: "
|
|
40
|
-
size?: "
|
|
39
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
40
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
41
41
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
42
42
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
43
43
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
3
|
-
let
|
|
3
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
let _radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
6
|
-
let
|
|
6
|
+
let _hexclave_shared_dist_utils_react = require("@hexclave/shared/dist/utils/react");
|
|
7
7
|
let class_variance_authority = require("class-variance-authority");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
react = require_chunk.__toESM(react);
|
|
10
|
-
let
|
|
11
|
-
let
|
|
10
|
+
let _hexclave_shared_dist_hooks_use_async_callback = require("@hexclave/shared/dist/hooks/use-async-callback");
|
|
11
|
+
let _hexclave_shared_dist_utils_promises = require("@hexclave/shared/dist/utils/promises");
|
|
12
12
|
|
|
13
13
|
//#region src/components/button.tsx
|
|
14
14
|
const designButtonVariants = (0, class_variance_authority.cva)("stack-scope inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
|
|
@@ -34,9 +34,9 @@ const designButtonVariants = (0, class_variance_authority.cva)("stack-scope inli
|
|
|
34
34
|
size: "default"
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
const DesignOriginalButton = (0,
|
|
37
|
+
const DesignOriginalButton = (0, _hexclave_shared_dist_utils_react.forwardRefIfNeeded)(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
38
38
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? _radix_ui_react_slot.Slot : "button", {
|
|
39
|
-
className: (0,
|
|
39
|
+
className: (0, _hexclave_ui.cn)(designButtonVariants({
|
|
40
40
|
variant,
|
|
41
41
|
size,
|
|
42
42
|
className
|
|
@@ -60,8 +60,8 @@ DesignOriginalButton.displayName = "DesignButton";
|
|
|
60
60
|
* while the promise is pending (set `loadingStyle="disabled"` if you prefer
|
|
61
61
|
* a simple disabled state instead).
|
|
62
62
|
*/
|
|
63
|
-
const DesignButton = (0,
|
|
64
|
-
const [handleClick, isLoading] = (0,
|
|
63
|
+
const DesignButton = (0, _hexclave_shared_dist_utils_react.forwardRefIfNeeded)(({ onClick, loading: loadingProp, loadingStyle = "spinner", children, size, ...props }, ref) => {
|
|
64
|
+
const [handleClick, isLoading] = (0, _hexclave_shared_dist_hooks_use_async_callback.useAsyncCallback)(async (e) => {
|
|
65
65
|
await onClick?.(e);
|
|
66
66
|
}, [onClick]);
|
|
67
67
|
const loading = loadingProp || isLoading;
|
|
@@ -69,10 +69,10 @@ const DesignButton = (0, _stackframe_stack_shared_dist_utils_react.forwardRefIfN
|
|
|
69
69
|
...props,
|
|
70
70
|
ref,
|
|
71
71
|
disabled: props.disabled || loading,
|
|
72
|
-
onClick: (e) => (0,
|
|
72
|
+
onClick: (e) => (0, _hexclave_shared_dist_utils_promises.runAsynchronouslyWithAlert)(handleClick(e)),
|
|
73
73
|
size,
|
|
74
|
-
className: (0,
|
|
75
|
-
children: [loadingStyle === "spinner" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
74
|
+
className: (0, _hexclave_ui.cn)("relative", loading && "[&>:not(.stack-button-do-not-hide-when-siblings-are)]:invisible", props.className),
|
|
75
|
+
children: [loadingStyle === "spinner" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hexclave_ui.Spinner, { className: (0, _hexclave_ui.cn)("absolute inset-0 flex items-center justify-center stack-button-do-not-hide-when-siblings-are", !loading && "invisible") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_slot.Slottable, { children: typeof children === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }) : children })]
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
DesignButton.displayName = "DesignButton";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":["Slot","Spinner","Slottable"],"sources":["../../src/components/button.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"button.js","names":["Slot","Spinner","Slottable"],"sources":["../../src/components/button.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport React from \"react\";\n\nimport { cn, Spinner } from \"@hexclave/ui\";\nimport { useAsyncCallback } from \"@hexclave/shared/dist/hooks/use-async-callback\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\n\nconst designButtonVariants = cva(\n \"stack-scope inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-white/85 dark:bg-background hover:bg-white dark:hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n plain: \"\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport type DesignOriginalButtonProps = {\n asChild?: boolean,\n} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof designButtonVariants>;\n\nconst DesignOriginalButton = forwardRefIfNeeded<HTMLButtonElement, DesignOriginalButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(designButtonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nDesignOriginalButton.displayName = \"DesignButton\";\n\nexport type DesignButtonProps = {\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>,\n loading?: boolean,\n loadingStyle?: \"spinner\" | \"disabled\",\n} & DesignOriginalButtonProps;\n\n/**\n * Standard button. Variants: `default | destructive | outline | secondary | ghost | link | plain`.\n * Sizes: `default | sm | lg | icon`.\n *\n * ```tsx\n * <DesignButton variant=\"default\" onClick={handleSave}>Save</DesignButton>\n * <DesignButton variant=\"outline\" size=\"sm\" onClick={handleCancel}>Cancel</DesignButton>\n * <DesignButton variant=\"ghost\" size=\"icon\"><PlusIcon className=\"h-4 w-4\" /></DesignButton>\n * ```\n *\n * Pass an async `onClick` and the button will automatically show a spinner\n * while the promise is pending (set `loadingStyle=\"disabled\"` if you prefer\n * a simple disabled state instead).\n */\nexport const DesignButton = forwardRefIfNeeded<HTMLButtonElement, DesignButtonProps>(\n ({ onClick, loading: loadingProp, loadingStyle = \"spinner\", children, size, ...props }, ref) => {\n const [handleClick, isLoading] = useAsyncCallback(async (e: React.MouseEvent<HTMLButtonElement>) => {\n await onClick?.(e);\n }, [onClick]);\n\n const loading = loadingProp || isLoading;\n\n return (\n <DesignOriginalButton\n {...props}\n ref={ref}\n disabled={props.disabled || loading}\n onClick={(e) => runAsynchronouslyWithAlert(handleClick(e))}\n size={size}\n className={cn(\"relative\", loading && \"[&>:not(.stack-button-do-not-hide-when-siblings-are)]:invisible\", props.className)}\n >\n {loadingStyle === \"spinner\" && <Spinner className={cn(\"absolute inset-0 flex items-center justify-center stack-button-do-not-hide-when-siblings-are\", !loading && \"invisible\")} />}\n <Slottable>\n {typeof children === \"string\" ? <span>{children}</span> : children}\n </Slottable>\n </DesignOriginalButton>\n );\n }\n);\nDesignButton.displayName = \"DesignButton\";\n"],"mappings":";;;;;;;;;;;;;AASA,MAAM,yDACJ,iOACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,aACE;GACF,SACE;GACF,WACE;GACF,OAAO;GACP,MAAM;GACN,OAAO;GACR;EACD,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;GACP;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAMD,MAAM,kFACH,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS,QAAQ;AAEhE,QACE,2CAFW,UAAUA,4BAAO;EAG1B,gCAAc,qBAAqB;GAAE;GAAS;GAAM;GAAW,CAAC,CAAC;EAC5D;EACL,GAAI;GACJ;EAGP;AACD,qBAAqB,cAAc;;;;;;;;;;;;;;;AAsBnC,MAAa,0EACV,EAAE,SAAS,SAAS,aAAa,eAAe,WAAW,UAAU,MAAM,GAAG,SAAS,QAAQ;CAC9F,MAAM,CAAC,aAAa,kFAA8B,OAAO,MAA2C;AAClG,QAAM,UAAU,EAAE;IACjB,CAAC,QAAQ,CAAC;CAEb,MAAM,UAAU,eAAe;AAE/B,QACE,4CAAC;EACC,GAAI;EACC;EACL,UAAU,MAAM,YAAY;EAC5B,UAAU,2EAAiC,YAAY,EAAE,CAAC;EACpD;EACN,gCAAc,YAAY,WAAW,mEAAmE,MAAM,UAAU;aAEvH,iBAAiB,aAAa,2CAACC,wBAAQ,gCAAc,gGAAgG,CAAC,WAAW,YAAY,GAAI,EAClL,2CAACC,4CACE,OAAO,aAAa,WAAW,2CAAC,UAAM,WAAgB,GAAG,WAChD;GACS;EAG5B;AACD,aAAa,cAAc"}
|
package/dist/components/card.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
5
|
-
let
|
|
5
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_chunk.__toESM(react);
|
|
@@ -77,14 +77,14 @@ function DesignCard({ title, subtitle, icon: Icon, actions, glassmorphic: glassm
|
|
|
77
77
|
const variant = title != null ? subtitle != null ? "header" : "compact" : "bodyOnly";
|
|
78
78
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DesignCardNestingContext.Provider, {
|
|
79
79
|
value: true,
|
|
80
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
81
|
-
className: (0,
|
|
80
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_hexclave_ui.Card, {
|
|
81
|
+
className: (0, _hexclave_ui.cn)("group relative rounded-2xl overflow-hidden", glassmorphic && [
|
|
82
82
|
"bg-white/90 dark:bg-background/60 dark:backdrop-blur-xl border-0 transition-all duration-150 hover:transition-none",
|
|
83
83
|
"ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]",
|
|
84
84
|
"shadow-none"
|
|
85
85
|
], glassmorphic && variant === "bodyOnly" && "dark:bg-transparent dark:ring-0 dark:shadow-none", className),
|
|
86
86
|
...props,
|
|
87
|
-
children: [glassmorphic && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0,
|
|
87
|
+
children: [glassmorphic && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, _hexclave_ui.cn)("absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl", variant === "bodyOnly" && "dark:hidden") }), variant !== "bodyOnly" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, _hexclave_ui.cn)("absolute inset-0 transition-colors duration-150 group-hover:transition-none pointer-events-none rounded-2xl", hoverTintClass) })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
88
88
|
className: "relative",
|
|
89
89
|
children: [
|
|
90
90
|
variant === "header" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -129,7 +129,7 @@ function DesignCard({ title, subtitle, icon: Icon, actions, glassmorphic: glassm
|
|
|
129
129
|
})]
|
|
130
130
|
}),
|
|
131
131
|
hasContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
132
|
-
className: (0,
|
|
132
|
+
className: (0, _hexclave_ui.cn)(variant === "header" ? "border-t border-black/[0.12] dark:border-white/[0.06]" : "", variant === "compact" ? "px-5 py-4" : "", variant === "bodyOnly" || variant === "header" ? bodyPaddingClass : "", contentClassName),
|
|
133
133
|
children
|
|
134
134
|
})
|
|
135
135
|
]
|
|
@@ -140,11 +140,11 @@ function DesignCard({ title, subtitle, icon: Icon, actions, glassmorphic: glassm
|
|
|
140
140
|
function DesignCardTint({ gradient, className, children, ...props }) {
|
|
141
141
|
const tintClass = demoTintClasses.get(gradient) ?? "group-hover/tint:bg-slate-500/[0.015]";
|
|
142
142
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
143
|
-
className: (0,
|
|
143
|
+
className: (0, _hexclave_ui.cn)("group/tint relative rounded-2xl bg-white/90 dark:bg-background/60 dark:backdrop-blur-xl transition-all duration-150 hover:transition-none", "ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]", "shadow-none overflow-hidden", className),
|
|
144
144
|
...props,
|
|
145
145
|
children: [
|
|
146
146
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl" }),
|
|
147
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0,
|
|
147
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, _hexclave_ui.cn)("absolute inset-0 transition-colors duration-150 group-hover/tint:transition-none pointer-events-none rounded-2xl", tintClass) }),
|
|
148
148
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
149
149
|
className: "relative",
|
|
150
150
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":["React","Card"],"sources":["../../src/components/card.tsx"],"sourcesContent":["\"use client\";\n\nimport { Card } from \"@stackframe/stack-ui\";\nimport { cn } from \"@stackframe/stack-ui\";\nimport React from \"react\";\n\n// ─── Card nesting context ────────────────────────────────────────────────────\n// Components with a `glassmorphic` prop use this to auto-detect whether they\n// sit inside a DesignCard. When they do, glassmorphic defaults to `true`;\n// when they don't, it defaults to `false`.\n\nconst DesignCardNestingContext = React.createContext(false);\n\n/**\n * Returns `true` when the calling component is rendered inside a DesignCard.\n * Useful for deriving a glassmorphic default.\n */\nexport function useInsideDesignCard(): boolean {\n return React.useContext(DesignCardNestingContext);\n}\n\n/**\n * Resolve the effective glassmorphic value.\n * - If the caller passed an explicit boolean → honour it.\n * - Otherwise → fall back to whether we're inside a DesignCard.\n */\nexport function useGlassmorphicDefault(explicit: boolean | undefined): boolean {\n const insideCard = useInsideDesignCard();\n return explicit ?? insideCard;\n}\n\ntype DesignCardGradient = \"blue\" | \"cyan\" | \"purple\" | \"green\" | \"orange\" | \"default\";\n\nconst hoverTintClasses = new Map<DesignCardGradient, string>([\n [\"blue\", \"group-hover:bg-blue-500/[0.03]\"],\n [\"purple\", \"group-hover:bg-purple-500/[0.03]\"],\n [\"green\", \"group-hover:bg-emerald-500/[0.03]\"],\n [\"orange\", \"group-hover:bg-orange-500/[0.03]\"],\n [\"default\", \"group-hover:bg-slate-500/[0.02]\"],\n [\"cyan\", \"group-hover:bg-cyan-500/[0.03]\"],\n]);\n\nconst demoTintClasses = new Map<DesignCardGradient, string>([\n [\"blue\", \"group-hover/tint:bg-blue-500/[0.02]\"],\n [\"purple\", \"group-hover/tint:bg-purple-500/[0.02]\"],\n [\"green\", \"group-hover/tint:bg-emerald-500/[0.02]\"],\n [\"orange\", \"group-hover/tint:bg-orange-500/[0.02]\"],\n [\"default\", \"group-hover/tint:bg-slate-500/[0.015]\"],\n [\"cyan\", \"group-hover/tint:bg-cyan-500/[0.02]\"],\n]);\n\nconst bodyPaddingClass = \"p-5\";\n\n// ─── Discriminated props ──────────────────────────────────────────────────\n// - If title is given, icon is required.\n// - The layout is derived automatically:\n// title + subtitle → \"header\" (full header block with subtitle)\n// title only → \"compact\" (slim bar with border-b)\n// no title → \"bodyOnly\" (just the body)\n\ntype DesignCardBaseProps = {\n glassmorphic?: boolean,\n gradient?: DesignCardGradient,\n contentClassName?: string,\n} & Omit<React.ComponentProps<typeof Card>, \"title\">;\n\ntype WithTitleProps = {\n title: React.ReactNode,\n subtitle?: React.ReactNode,\n icon: React.ElementType,\n actions?: React.ReactNode,\n};\n\ntype WithoutTitleProps = {\n title?: never,\n subtitle?: never,\n icon?: never,\n actions?: never,\n};\n\nexport type DesignCardProps = DesignCardBaseProps & (WithTitleProps | WithoutTitleProps);\n\n/**\n * General-purpose card for grouping related content: section headers,\n * description blocks, chart-less panels, etc. If the content is a\n * big-number metric, use `DesignMetricCard` instead. If it contains a\n * chart, wrap it in `DesignChartCard`.\n *\n * Two shapes, picked automatically by the props you pass:\n *\n * ```tsx\n * // With a header (title requires icon):\n * <DesignCard title=\"Recent activity\" icon={ActivityIcon}>\n * ...body...\n * </DesignCard>\n *\n * // Body-only (no header):\n * <DesignCard>\n * <h2 className=\"text-2xl font-semibold\">Dashboard</h2>\n * <p className=\"text-muted-foreground\">Overview of your user base</p>\n * </DesignCard>\n * ```\n *\n * Rules:\n * - DO NOT add padding classes (`p-6`, `p-5`, etc.) to `className` — the\n * component already has built-in padding and extra padding will look wrong.\n * - If you set `title`, you MUST also set `icon`. The TS types enforce this,\n * but writing `title` without `icon` will fail.\n * - Body-only cards (no `title`) automatically go transparent in dark mode.\n */\nexport function DesignCard({\n title,\n subtitle,\n icon: Icon,\n actions,\n glassmorphic: glassmorphicProp,\n gradient = \"default\",\n children,\n className,\n contentClassName,\n ...props\n}: DesignCardProps) {\n const glassmorphic = glassmorphicProp ?? true;\n const hoverTintClass = hoverTintClasses.get(gradient) ?? \"group-hover:bg-slate-500/[0.02]\";\n const hasContent = React.Children.count(children) > 0;\n\n // Derive layout from which props were provided\n const variant = title != null\n ? (subtitle != null ? \"header\" : \"compact\")\n : \"bodyOnly\";\n\n return (\n <DesignCardNestingContext.Provider value={true}>\n <Card\n className={cn(\n \"group relative rounded-2xl overflow-hidden\",\n glassmorphic && [\n \"bg-white/90 dark:bg-background/60 dark:backdrop-blur-xl border-0 transition-all duration-150 hover:transition-none\",\n \"ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]\",\n \"shadow-none\",\n ],\n glassmorphic && variant === \"bodyOnly\" && \"dark:bg-transparent dark:ring-0 dark:shadow-none\",\n className\n )}\n {...props}\n >\n {glassmorphic && (\n <>\n <div className={cn(\n \"absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl\",\n variant === \"bodyOnly\" && \"dark:hidden\"\n )} />\n {variant !== \"bodyOnly\" && (\n <div\n className={cn(\n \"absolute inset-0 transition-colors duration-150 group-hover:transition-none pointer-events-none rounded-2xl\",\n hoverTintClass\n )}\n />\n )}\n </>\n )}\n <div className=\"relative\">\n {variant === \"header\" && (\n <div className={bodyPaddingClass}>\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n {Icon && (\n <div className=\"p-1.5 rounded-lg bg-foreground/[0.06] dark:bg-foreground/[0.04]\">\n <Icon className=\"h-3.5 w-3.5 text-foreground/70 dark:text-muted-foreground\" />\n </div>\n )}\n <span className=\"text-xs font-semibold text-foreground uppercase tracking-wider\">\n {title}\n </span>\n </div>\n {subtitle && (\n <p className=\"text-sm text-muted-foreground mt-1\">\n {subtitle}\n </p>\n )}\n </div>\n {actions && (\n <div className=\"flex-shrink-0\">\n {actions}\n </div>\n )}\n </div>\n </div>\n )}\n {variant === \"compact\" && (\n <div className=\"p-5 flex items-center justify-between gap-4 border-b border-black/[0.12] dark:border-white/[0.06]\">\n <div className=\"flex items-center gap-2 min-w-0\">\n {Icon && (\n <div className=\"p-1.5 rounded-lg bg-foreground/[0.04]\">\n <Icon className=\"h-3.5 w-3.5 text-muted-foreground\" />\n </div>\n )}\n <span className=\"text-xs font-semibold text-foreground uppercase tracking-wider\">\n {title}\n </span>\n </div>\n {actions && (\n <div className=\"flex-shrink-0\">\n {actions}\n </div>\n )}\n </div>\n )}\n {hasContent && (\n <div\n className={cn(\n variant === \"header\" ? \"border-t border-black/[0.12] dark:border-white/[0.06]\" : \"\",\n variant === \"compact\" ? \"px-5 py-4\" : \"\",\n variant === \"bodyOnly\" || variant === \"header\" ? bodyPaddingClass : \"\",\n contentClassName\n )}\n >\n {children}\n </div>\n )}\n </div>\n </Card>\n </DesignCardNestingContext.Provider>\n );\n}\n\nexport type DesignCardTintProps = {\n gradient: DesignCardGradient,\n} & React.ComponentProps<\"div\">\n\nexport function DesignCardTint({\n gradient,\n className,\n children,\n ...props\n}: DesignCardTintProps) {\n const tintClass = demoTintClasses.get(gradient) ?? \"group-hover/tint:bg-slate-500/[0.015]\";\n\n return (\n <div\n className={cn(\n \"group/tint relative rounded-2xl bg-white/90 dark:bg-background/60 dark:backdrop-blur-xl transition-all duration-150 hover:transition-none\",\n \"ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]\",\n \"shadow-none overflow-hidden\",\n className\n )}\n {...props}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl\" />\n <div\n className={cn(\n \"absolute inset-0 transition-colors duration-150 group-hover/tint:transition-none pointer-events-none rounded-2xl\",\n tintClass\n )}\n />\n <div className=\"relative\">\n {children}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,2BAA2BA,cAAM,cAAc,MAAM;;;;;AAM3D,SAAgB,sBAA+B;AAC7C,QAAOA,cAAM,WAAW,yBAAyB;;;;;;;AAQnD,SAAgB,uBAAuB,UAAwC;CAC7E,MAAM,aAAa,qBAAqB;AACxC,QAAO,YAAY;;AAKrB,MAAM,mBAAmB,IAAI,IAAgC;CAC3D,CAAC,QAAQ,iCAAiC;CAC1C,CAAC,UAAU,mCAAmC;CAC9C,CAAC,SAAS,oCAAoC;CAC9C,CAAC,UAAU,mCAAmC;CAC9C,CAAC,WAAW,kCAAkC;CAC9C,CAAC,QAAQ,iCAAiC;CAC3C,CAAC;AAEF,MAAM,kBAAkB,IAAI,IAAgC;CAC1D,CAAC,QAAQ,sCAAsC;CAC/C,CAAC,UAAU,wCAAwC;CACnD,CAAC,SAAS,yCAAyC;CACnD,CAAC,UAAU,wCAAwC;CACnD,CAAC,WAAW,wCAAwC;CACpD,CAAC,QAAQ,sCAAsC;CAChD,CAAC;AAEF,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DzB,SAAgB,WAAW,EACzB,OACA,UACA,MAAM,MACN,SACA,cAAc,kBACd,WAAW,WACX,UACA,WACA,kBACA,GAAG,SACe;CAClB,MAAM,eAAe,oBAAoB;CACzC,MAAM,iBAAiB,iBAAiB,IAAI,SAAS,IAAI;CACzD,MAAM,aAAaA,cAAM,SAAS,MAAM,SAAS,GAAG;CAGpD,MAAM,UAAU,SAAS,OACpB,YAAY,OAAO,WAAW,YAC/B;AAEJ,QACE,2CAAC,yBAAyB;EAAS,OAAO;YACxC,4CAACC;GACC,wCACE,8CACA,gBAAgB;IACd;IACA;IACA;IACD,EACD,gBAAgB,YAAY,cAAc,oDAC1C,UACD;GACD,GAAI;cAEH,gBACC,qFACE,2CAAC,SAAI,wCACH,wIACA,YAAY,cAAc,cAC3B,GAAI,EACJ,YAAY,cACX,2CAAC,SACC,wCACE,+GACA,eACD,GACD,IAEH,EAEL,4CAAC;IAAI,WAAU;;KACZ,YAAY,YACX,2CAAC;MAAI,WAAW;gBACd,4CAAC;OAAI,WAAU;kBACb,4CAAC;QAAI,WAAU;mBACb,4CAAC;SAAI,WAAU;oBACZ,QACC,2CAAC;UAAI,WAAU;oBACb,2CAAC,QAAK,WAAU,8DAA8D;WAC1E,EAER,2CAAC;UAAK,WAAU;oBACb;WACI;UACH,EACL,YACC,2CAAC;SAAE,WAAU;mBACV;UACC;SAEF,EACL,WACC,2CAAC;QAAI,WAAU;kBACZ;SACG;QAEJ;OACF;KAEP,YAAY,aACX,4CAAC;MAAI,WAAU;iBACb,4CAAC;OAAI,WAAU;kBACZ,QACC,2CAAC;QAAI,WAAU;kBACb,2CAAC,QAAK,WAAU,sCAAsC;SAClD,EAER,2CAAC;QAAK,WAAU;kBACb;SACI;QACH,EACL,WACC,2CAAC;OAAI,WAAU;iBACZ;QACG;OAEJ;KAEP,cACC,2CAAC;MACC,wCACE,YAAY,WAAW,0DAA0D,IACjF,YAAY,YAAY,cAAc,IACtC,YAAY,cAAc,YAAY,WAAW,mBAAmB,IACpE,iBACD;MAEA;OACG;;KAEJ;IACD;GAC2B;;AAQxC,SAAgB,eAAe,EAC7B,UACA,WACA,UACA,GAAG,SACmB;CACtB,MAAM,YAAY,gBAAgB,IAAI,SAAS,IAAI;AAEnD,QACE,4CAAC;EACC,wCACE,6IACA,sGACA,+BACA,UACD;EACD,GAAI;;GAEJ,2CAAC,SAAI,WAAU,yIAAyI;GACxJ,2CAAC,SACC,wCACE,oHACA,UACD,GACD;GACF,2CAAC;IAAI,WAAU;IACZ;KACG;;GACF"}
|
|
1
|
+
{"version":3,"file":"card.js","names":["React","Card"],"sources":["../../src/components/card.tsx"],"sourcesContent":["\"use client\";\n\nimport { Card } from \"@hexclave/ui\";\nimport { cn } from \"@hexclave/ui\";\nimport React from \"react\";\n\n// ─── Card nesting context ────────────────────────────────────────────────────\n// Components with a `glassmorphic` prop use this to auto-detect whether they\n// sit inside a DesignCard. When they do, glassmorphic defaults to `true`;\n// when they don't, it defaults to `false`.\n\nconst DesignCardNestingContext = React.createContext(false);\n\n/**\n * Returns `true` when the calling component is rendered inside a DesignCard.\n * Useful for deriving a glassmorphic default.\n */\nexport function useInsideDesignCard(): boolean {\n return React.useContext(DesignCardNestingContext);\n}\n\n/**\n * Resolve the effective glassmorphic value.\n * - If the caller passed an explicit boolean → honour it.\n * - Otherwise → fall back to whether we're inside a DesignCard.\n */\nexport function useGlassmorphicDefault(explicit: boolean | undefined): boolean {\n const insideCard = useInsideDesignCard();\n return explicit ?? insideCard;\n}\n\ntype DesignCardGradient = \"blue\" | \"cyan\" | \"purple\" | \"green\" | \"orange\" | \"default\";\n\nconst hoverTintClasses = new Map<DesignCardGradient, string>([\n [\"blue\", \"group-hover:bg-blue-500/[0.03]\"],\n [\"purple\", \"group-hover:bg-purple-500/[0.03]\"],\n [\"green\", \"group-hover:bg-emerald-500/[0.03]\"],\n [\"orange\", \"group-hover:bg-orange-500/[0.03]\"],\n [\"default\", \"group-hover:bg-slate-500/[0.02]\"],\n [\"cyan\", \"group-hover:bg-cyan-500/[0.03]\"],\n]);\n\nconst demoTintClasses = new Map<DesignCardGradient, string>([\n [\"blue\", \"group-hover/tint:bg-blue-500/[0.02]\"],\n [\"purple\", \"group-hover/tint:bg-purple-500/[0.02]\"],\n [\"green\", \"group-hover/tint:bg-emerald-500/[0.02]\"],\n [\"orange\", \"group-hover/tint:bg-orange-500/[0.02]\"],\n [\"default\", \"group-hover/tint:bg-slate-500/[0.015]\"],\n [\"cyan\", \"group-hover/tint:bg-cyan-500/[0.02]\"],\n]);\n\nconst bodyPaddingClass = \"p-5\";\n\n// ─── Discriminated props ──────────────────────────────────────────────────\n// - If title is given, icon is required.\n// - The layout is derived automatically:\n// title + subtitle → \"header\" (full header block with subtitle)\n// title only → \"compact\" (slim bar with border-b)\n// no title → \"bodyOnly\" (just the body)\n\ntype DesignCardBaseProps = {\n glassmorphic?: boolean,\n gradient?: DesignCardGradient,\n contentClassName?: string,\n} & Omit<React.ComponentProps<typeof Card>, \"title\">;\n\ntype WithTitleProps = {\n title: React.ReactNode,\n subtitle?: React.ReactNode,\n icon: React.ElementType,\n actions?: React.ReactNode,\n};\n\ntype WithoutTitleProps = {\n title?: never,\n subtitle?: never,\n icon?: never,\n actions?: never,\n};\n\nexport type DesignCardProps = DesignCardBaseProps & (WithTitleProps | WithoutTitleProps);\n\n/**\n * General-purpose card for grouping related content: section headers,\n * description blocks, chart-less panels, etc. If the content is a\n * big-number metric, use `DesignMetricCard` instead. If it contains a\n * chart, wrap it in `DesignChartCard`.\n *\n * Two shapes, picked automatically by the props you pass:\n *\n * ```tsx\n * // With a header (title requires icon):\n * <DesignCard title=\"Recent activity\" icon={ActivityIcon}>\n * ...body...\n * </DesignCard>\n *\n * // Body-only (no header):\n * <DesignCard>\n * <h2 className=\"text-2xl font-semibold\">Dashboard</h2>\n * <p className=\"text-muted-foreground\">Overview of your user base</p>\n * </DesignCard>\n * ```\n *\n * Rules:\n * - DO NOT add padding classes (`p-6`, `p-5`, etc.) to `className` — the\n * component already has built-in padding and extra padding will look wrong.\n * - If you set `title`, you MUST also set `icon`. The TS types enforce this,\n * but writing `title` without `icon` will fail.\n * - Body-only cards (no `title`) automatically go transparent in dark mode.\n */\nexport function DesignCard({\n title,\n subtitle,\n icon: Icon,\n actions,\n glassmorphic: glassmorphicProp,\n gradient = \"default\",\n children,\n className,\n contentClassName,\n ...props\n}: DesignCardProps) {\n const glassmorphic = glassmorphicProp ?? true;\n const hoverTintClass = hoverTintClasses.get(gradient) ?? \"group-hover:bg-slate-500/[0.02]\";\n const hasContent = React.Children.count(children) > 0;\n\n // Derive layout from which props were provided\n const variant = title != null\n ? (subtitle != null ? \"header\" : \"compact\")\n : \"bodyOnly\";\n\n return (\n <DesignCardNestingContext.Provider value={true}>\n <Card\n className={cn(\n \"group relative rounded-2xl overflow-hidden\",\n glassmorphic && [\n \"bg-white/90 dark:bg-background/60 dark:backdrop-blur-xl border-0 transition-all duration-150 hover:transition-none\",\n \"ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]\",\n \"shadow-none\",\n ],\n glassmorphic && variant === \"bodyOnly\" && \"dark:bg-transparent dark:ring-0 dark:shadow-none\",\n className\n )}\n {...props}\n >\n {glassmorphic && (\n <>\n <div className={cn(\n \"absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl\",\n variant === \"bodyOnly\" && \"dark:hidden\"\n )} />\n {variant !== \"bodyOnly\" && (\n <div\n className={cn(\n \"absolute inset-0 transition-colors duration-150 group-hover:transition-none pointer-events-none rounded-2xl\",\n hoverTintClass\n )}\n />\n )}\n </>\n )}\n <div className=\"relative\">\n {variant === \"header\" && (\n <div className={bodyPaddingClass}>\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n {Icon && (\n <div className=\"p-1.5 rounded-lg bg-foreground/[0.06] dark:bg-foreground/[0.04]\">\n <Icon className=\"h-3.5 w-3.5 text-foreground/70 dark:text-muted-foreground\" />\n </div>\n )}\n <span className=\"text-xs font-semibold text-foreground uppercase tracking-wider\">\n {title}\n </span>\n </div>\n {subtitle && (\n <p className=\"text-sm text-muted-foreground mt-1\">\n {subtitle}\n </p>\n )}\n </div>\n {actions && (\n <div className=\"flex-shrink-0\">\n {actions}\n </div>\n )}\n </div>\n </div>\n )}\n {variant === \"compact\" && (\n <div className=\"p-5 flex items-center justify-between gap-4 border-b border-black/[0.12] dark:border-white/[0.06]\">\n <div className=\"flex items-center gap-2 min-w-0\">\n {Icon && (\n <div className=\"p-1.5 rounded-lg bg-foreground/[0.04]\">\n <Icon className=\"h-3.5 w-3.5 text-muted-foreground\" />\n </div>\n )}\n <span className=\"text-xs font-semibold text-foreground uppercase tracking-wider\">\n {title}\n </span>\n </div>\n {actions && (\n <div className=\"flex-shrink-0\">\n {actions}\n </div>\n )}\n </div>\n )}\n {hasContent && (\n <div\n className={cn(\n variant === \"header\" ? \"border-t border-black/[0.12] dark:border-white/[0.06]\" : \"\",\n variant === \"compact\" ? \"px-5 py-4\" : \"\",\n variant === \"bodyOnly\" || variant === \"header\" ? bodyPaddingClass : \"\",\n contentClassName\n )}\n >\n {children}\n </div>\n )}\n </div>\n </Card>\n </DesignCardNestingContext.Provider>\n );\n}\n\nexport type DesignCardTintProps = {\n gradient: DesignCardGradient,\n} & React.ComponentProps<\"div\">\n\nexport function DesignCardTint({\n gradient,\n className,\n children,\n ...props\n}: DesignCardTintProps) {\n const tintClass = demoTintClasses.get(gradient) ?? \"group-hover/tint:bg-slate-500/[0.015]\";\n\n return (\n <div\n className={cn(\n \"group/tint relative rounded-2xl bg-white/90 dark:bg-background/60 dark:backdrop-blur-xl transition-all duration-150 hover:transition-none\",\n \"ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]\",\n \"shadow-none overflow-hidden\",\n className\n )}\n {...props}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl\" />\n <div\n className={cn(\n \"absolute inset-0 transition-colors duration-150 group-hover/tint:transition-none pointer-events-none rounded-2xl\",\n tintClass\n )}\n />\n <div className=\"relative\">\n {children}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,2BAA2BA,cAAM,cAAc,MAAM;;;;;AAM3D,SAAgB,sBAA+B;AAC7C,QAAOA,cAAM,WAAW,yBAAyB;;;;;;;AAQnD,SAAgB,uBAAuB,UAAwC;CAC7E,MAAM,aAAa,qBAAqB;AACxC,QAAO,YAAY;;AAKrB,MAAM,mBAAmB,IAAI,IAAgC;CAC3D,CAAC,QAAQ,iCAAiC;CAC1C,CAAC,UAAU,mCAAmC;CAC9C,CAAC,SAAS,oCAAoC;CAC9C,CAAC,UAAU,mCAAmC;CAC9C,CAAC,WAAW,kCAAkC;CAC9C,CAAC,QAAQ,iCAAiC;CAC3C,CAAC;AAEF,MAAM,kBAAkB,IAAI,IAAgC;CAC1D,CAAC,QAAQ,sCAAsC;CAC/C,CAAC,UAAU,wCAAwC;CACnD,CAAC,SAAS,yCAAyC;CACnD,CAAC,UAAU,wCAAwC;CACnD,CAAC,WAAW,wCAAwC;CACpD,CAAC,QAAQ,sCAAsC;CAChD,CAAC;AAEF,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DzB,SAAgB,WAAW,EACzB,OACA,UACA,MAAM,MACN,SACA,cAAc,kBACd,WAAW,WACX,UACA,WACA,kBACA,GAAG,SACe;CAClB,MAAM,eAAe,oBAAoB;CACzC,MAAM,iBAAiB,iBAAiB,IAAI,SAAS,IAAI;CACzD,MAAM,aAAaA,cAAM,SAAS,MAAM,SAAS,GAAG;CAGpD,MAAM,UAAU,SAAS,OACpB,YAAY,OAAO,WAAW,YAC/B;AAEJ,QACE,2CAAC,yBAAyB;EAAS,OAAO;YACxC,4CAACC;GACC,gCACE,8CACA,gBAAgB;IACd;IACA;IACA;IACD,EACD,gBAAgB,YAAY,cAAc,oDAC1C,UACD;GACD,GAAI;cAEH,gBACC,qFACE,2CAAC,SAAI,gCACH,wIACA,YAAY,cAAc,cAC3B,GAAI,EACJ,YAAY,cACX,2CAAC,SACC,gCACE,+GACA,eACD,GACD,IAEH,EAEL,4CAAC;IAAI,WAAU;;KACZ,YAAY,YACX,2CAAC;MAAI,WAAW;gBACd,4CAAC;OAAI,WAAU;kBACb,4CAAC;QAAI,WAAU;mBACb,4CAAC;SAAI,WAAU;oBACZ,QACC,2CAAC;UAAI,WAAU;oBACb,2CAAC,QAAK,WAAU,8DAA8D;WAC1E,EAER,2CAAC;UAAK,WAAU;oBACb;WACI;UACH,EACL,YACC,2CAAC;SAAE,WAAU;mBACV;UACC;SAEF,EACL,WACC,2CAAC;QAAI,WAAU;kBACZ;SACG;QAEJ;OACF;KAEP,YAAY,aACX,4CAAC;MAAI,WAAU;iBACb,4CAAC;OAAI,WAAU;kBACZ,QACC,2CAAC;QAAI,WAAU;kBACb,2CAAC,QAAK,WAAU,sCAAsC;SAClD,EAER,2CAAC;QAAK,WAAU;kBACb;SACI;QACH,EACL,WACC,2CAAC;OAAI,WAAU;iBACZ;QACG;OAEJ;KAEP,cACC,2CAAC;MACC,gCACE,YAAY,WAAW,0DAA0D,IACjF,YAAY,YAAY,cAAc,IACtC,YAAY,cAAc,YAAY,WAAW,mBAAmB,IACpE,iBACD;MAEA;OACG;;KAEJ;IACD;GAC2B;;AAQxC,SAAgB,eAAe,EAC7B,UACA,WACA,UACA,GAAG,SACmB;CACtB,MAAM,YAAY,gBAAgB,IAAI,SAAS,IAAI;AAEnD,QACE,4CAAC;EACC,gCACE,6IACA,sGACA,+BACA,UACD;EACD,GAAI;;GAEJ,2CAAC,SAAI,WAAU,yIAAyI;GACxJ,2CAAC,SACC,gCACE,oHACA,UACD,GACD;GACF,2CAAC;IAAI,WAAU;IACZ;KACG;;GACF"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
5
|
-
let
|
|
5
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_chunk.__toESM(react);
|
|
@@ -56,11 +56,11 @@ function DesignChartCard({ gradient = "default", title, description, className,
|
|
|
56
56
|
overflow: visible !important;
|
|
57
57
|
}
|
|
58
58
|
` } }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
59
|
-
className: (0,
|
|
59
|
+
className: (0, _hexclave_ui.cn)("group relative rounded-2xl bg-white/90 dark:bg-background/60 backdrop-blur-xl transition-all duration-150 hover:transition-none design-chart-card-tooltip-escape", "ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]", "shadow-sm hover:shadow-md hover:z-10", className),
|
|
60
60
|
...props,
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl overflow-hidden" }),
|
|
63
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0,
|
|
63
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, _hexclave_ui.cn)("absolute inset-0 transition-colors duration-150 group-hover:transition-none pointer-events-none rounded-2xl overflow-hidden", hoverTintClass) }),
|
|
64
64
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
65
65
|
className: "relative h-full flex flex-col p-4",
|
|
66
66
|
children: [(title || description) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-card.js","names":[],"sources":["../../src/components/chart-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@
|
|
1
|
+
{"version":3,"file":"chart-card.js","names":[],"sources":["../../src/components/chart-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@hexclave/ui\";\nimport React from \"react\";\n\ntype DesignChartCardGradient = \"blue\" | \"cyan\" | \"purple\" | \"green\" | \"orange\" | \"default\";\n\nconst hoverTintClasses = new Map<DesignChartCardGradient, string>([\n [\"blue\", \"group-hover:bg-blue-500/[0.03]\"],\n [\"cyan\", \"group-hover:bg-cyan-500/[0.03]\"],\n [\"purple\", \"group-hover:bg-purple-500/[0.03]\"],\n [\"green\", \"group-hover:bg-emerald-500/[0.03]\"],\n [\"orange\", \"group-hover:bg-orange-500/[0.03]\"],\n [\"default\", \"group-hover:bg-slate-500/[0.02]\"],\n]);\n\nexport type DesignChartCardProps = {\n gradient?: DesignChartCardGradient,\n title?: React.ReactNode,\n description?: React.ReactNode,\n} & Omit<React.ComponentProps<\"div\">, \"title\">;\n\n/**\n * Card chrome (title + description + border) for a chart. Wrap every\n * `AnalyticsChart` in this so the chart has context. Also used around raw\n * Recharts components paired with `DesignChartContainer` for non-time-series\n * fallbacks.\n *\n * ```tsx\n * // Time-series chart (preferred):\n * <DesignChartCard title=\"Signups\" description=\"Last 30 days\">\n * <AnalyticsChart data={data} state={state} onChange={setState} />\n * </DesignChartCard>\n *\n * // Non-time-series fallback (static ranking, distribution, etc.):\n * <DesignChartCard title=\"Top referrers\" description=\"This month\">\n * <DesignChartContainer config={chartConfig} maxHeight={300}>\n * <Recharts.BarChart data={data}>\n * <Recharts.CartesianGrid strokeDasharray=\"3 3\" stroke=\"hsl(var(--border))\" />\n * <Recharts.XAxis dataKey=\"name\" tick={{ fill: 'hsl(var(--muted-foreground))', fontSize: 12 }} />\n * <Recharts.YAxis tick={{ fill: 'hsl(var(--muted-foreground))', fontSize: 12 }} />\n * <Recharts.Tooltip content={<DesignChartTooltipContent />} />\n * <Recharts.Bar dataKey=\"count\" fill={getDesignChartColor(0)} radius={[4, 4, 0, 0]} />\n * </Recharts.BarChart>\n * </DesignChartContainer>\n * </DesignChartCard>\n * ```\n *\n * `chartConfig` for `DesignChartContainer` maps each `dataKey` to its label and color:\n * `{ count: { label: \"Count\", color: getDesignChartColor(0) } }`.\n */\nexport function DesignChartCard({\n gradient = \"default\",\n title,\n description,\n className,\n children,\n ...props\n}: DesignChartCardProps) {\n const hoverTintClass = hoverTintClasses.get(gradient) ?? \"group-hover:bg-slate-500/[0.02]\";\n\n return (\n <>\n <style dangerouslySetInnerHTML={{ __html: `\n .design-chart-card-tooltip-escape .recharts-tooltip-wrapper {\n z-index: 9999 !important;\n overflow: visible !important;\n }\n .design-chart-card-tooltip-escape .recharts-tooltip-wrapper > * {\n overflow: visible !important;\n }\n ` }} />\n <div\n className={cn(\n \"group relative rounded-2xl bg-white/90 dark:bg-background/60 backdrop-blur-xl transition-all duration-150 hover:transition-none design-chart-card-tooltip-escape\",\n \"ring-1 ring-black/[0.06] hover:ring-black/[0.1] dark:ring-white/[0.06] dark:hover:ring-white/[0.1]\",\n \"shadow-sm hover:shadow-md hover:z-10\",\n className\n )}\n {...props}\n >\n <div className=\"absolute inset-0 bg-gradient-to-br from-foreground/[0.04] dark:from-foreground/[0.02] to-transparent pointer-events-none rounded-2xl overflow-hidden\" />\n <div\n className={cn(\n \"absolute inset-0 transition-colors duration-150 group-hover:transition-none pointer-events-none rounded-2xl overflow-hidden\",\n hoverTintClass\n )}\n />\n <div className=\"relative h-full flex flex-col p-4\">\n {(title || description) && (\n <div className=\"mb-3\">\n {title && <h3 className=\"text-sm font-semibold text-foreground\">{title}</h3>}\n {description && <p className=\"text-xs text-muted-foreground mt-0.5\">{description}</p>}\n </div>\n )}\n {children}\n </div>\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AAOA,MAAM,mBAAmB,IAAI,IAAqC;CAChE,CAAC,QAAQ,iCAAiC;CAC1C,CAAC,QAAQ,iCAAiC;CAC1C,CAAC,UAAU,mCAAmC;CAC9C,CAAC,SAAS,oCAAoC;CAC9C,CAAC,UAAU,mCAAmC;CAC9C,CAAC,WAAW,kCAAkC;CAC/C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCF,SAAgB,gBAAgB,EAC9B,WAAW,WACX,OACA,aACA,WACA,UACA,GAAG,SACoB;CACvB,MAAM,iBAAiB,iBAAiB,IAAI,SAAS,IAAI;AAEzD,QACE,qFACE,2CAAC,WAAM,yBAAyB,EAAE,QAAQ;;;;;;;;SAQvC,GAAI,EACP,4CAAC;EACC,gCACE,oKACA,sGACA,wCACA,UACD;EACD,GAAI;;GAEJ,2CAAC,SAAI,WAAU,yJAAyJ;GACxK,2CAAC,SACC,gCACE,+HACA,eACD,GACD;GACF,4CAAC;IAAI,WAAU;gBACX,SAAS,gBACT,4CAAC;KAAI,WAAU;gBACZ,SAAS,2CAAC;MAAG,WAAU;gBAAyC;OAAW,EAC3E,eAAe,2CAAC;MAAE,WAAU;gBAAwC;OAAgB;MACjF,EAEP;KACG;;GACF,IACL"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
5
|
-
let
|
|
5
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_chunk.__toESM(react);
|
|
@@ -40,7 +40,7 @@ const DesignChartContainer = react.forwardRef(({ id, className, children, config
|
|
|
40
40
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
41
41
|
"data-chart": chartId,
|
|
42
42
|
ref,
|
|
43
|
-
className: (0,
|
|
43
|
+
className: (0, _hexclave_ui.cn)("flex aspect-video justify-center text-xs", "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground", "[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-black/[0.06] dark:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-white/[0.06]", "[&_.recharts-curve.recharts-tooltip-cursor]:stroke-black/[0.12] dark:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-white/[0.12]", "[&_.recharts-dot[stroke='#fff']]:stroke-transparent", "[&_.recharts-layer]:outline-none", "[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-black/[0.06] dark:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-white/[0.06]", "[&_.recharts-radial-bar-background-sector]:fill-black/[0.04] dark:[&_.recharts-radial-bar-background-sector]:fill-white/[0.04]", "[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-black/[0.04] dark:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-white/[0.04]", "[&_.recharts-reference-line_[stroke='#ccc']]:stroke-black/[0.06] dark:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-white/[0.06]", "[&_.recharts-sector[stroke='#fff']]:stroke-transparent", "[&_.recharts-sector]:outline-none", "[&_.recharts-surface]:outline-none", className),
|
|
44
44
|
...props,
|
|
45
45
|
style: {
|
|
46
46
|
...props.style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.js","names":["React","RechartsPrimitive"],"sources":["../../src/components/chart-container.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport { cn } from \"@
|
|
1
|
+
{"version":3,"file":"chart-container.js","names":["React","RechartsPrimitive"],"sources":["../../src/components/chart-container.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport { cn } from \"@hexclave/ui\";\n\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nexport type DesignChartConfig = {\n [k in string]: {\n label?: React.ReactNode,\n icon?: React.ComponentType,\n } & (\n | { color?: string, theme?: never }\n | { color?: never, theme: Record<keyof typeof THEMES, string> }\n )\n};\n\ntype ChartContextProps = {\n config: DesignChartConfig,\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nexport function useDesignChart() {\n const context = React.useContext(ChartContext);\n if (!context) {\n throw new Error(\"useDesignChart must be used within a <DesignChartContainer />\");\n }\n return context;\n}\n\nexport function DesignChartStyle({ id, config }: { id: string, config: DesignChartConfig }) {\n const colorConfig = Object.entries(config).filter(\n ([_, cfg]) => cfg.theme || cfg.color\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||\n itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join(\"\\n\")}\n}\n`\n )\n .join(\"\\n\"),\n }}\n />\n );\n}\n\nexport const DesignChartContainer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n maxHeight?: number,\n config: DesignChartConfig,\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >[\"children\"],\n }\n>(({ id, className, children, config, maxHeight, ...props }, ref) => {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, \"\")}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-chart={chartId}\n ref={ref}\n className={cn(\n \"flex aspect-video justify-center text-xs\",\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground\",\n \"[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-black/[0.06] dark:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-white/[0.06]\",\n \"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-black/[0.12] dark:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-white/[0.12]\",\n \"[&_.recharts-dot[stroke='#fff']]:stroke-transparent\",\n \"[&_.recharts-layer]:outline-none\",\n \"[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-black/[0.06] dark:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-white/[0.06]\",\n \"[&_.recharts-radial-bar-background-sector]:fill-black/[0.04] dark:[&_.recharts-radial-bar-background-sector]:fill-white/[0.04]\",\n \"[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-black/[0.04] dark:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-white/[0.04]\",\n \"[&_.recharts-reference-line_[stroke='#ccc']]:stroke-black/[0.06] dark:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-white/[0.06]\",\n \"[&_.recharts-sector[stroke='#fff']]:stroke-transparent\",\n \"[&_.recharts-sector]:outline-none\",\n \"[&_.recharts-surface]:outline-none\",\n className\n )}\n {...props}\n style={{\n ...props.style,\n maxHeight,\n }}\n >\n <DesignChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer maxHeight={maxHeight}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n});\nDesignChartContainer.displayName = \"DesignChartContainer\";\n\n/**\n * Helper to extract item config from a Recharts payload object.\n */\nexport function getPayloadConfigFromPayload(\n config: DesignChartConfig,\n payload: unknown,\n key: string,\n) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload &&\n typeof payload.payload === \"object\" &&\n payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (\n key in payload &&\n typeof payload[key as keyof typeof payload] === \"string\"\n ) {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === \"string\"\n ) {\n configLabelKey = payloadPayload[\n key as keyof typeof payloadPayload\n ] as string;\n }\n\n return configLabelKey in config\n ? config[configLabelKey]\n : config[key as keyof typeof config];\n}\n"],"mappings":";;;;;;;;;;;;AAMA,MAAM,SAAS;CAAE,OAAO;CAAI,MAAM;CAAS;AAgB3C,MAAM,eAAeA,MAAM,cAAwC,KAAK;AAExE,SAAgB,iBAAiB;CAC/B,MAAM,UAAUA,MAAM,WAAW,aAAa;AAC9C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,gEAAgE;AAElF,QAAO;;AAGT,SAAgB,iBAAiB,EAAE,IAAI,UAAqD;CAC1F,MAAM,cAAc,OAAO,QAAQ,OAAO,CAAC,QACxC,CAAC,GAAG,SAAS,IAAI,SAAS,IAAI,MAChC;AAED,KAAI,CAAC,YAAY,OACf,QAAO;AAGT,QACE,2CAAC,WACC,yBAAyB,EACvB,QAAQ,OAAO,QAAQ,OAAO,CAC3B,KACE,CAAC,OAAO,YAAY;EAC/B,OAAO,eAAe,GAAG;EACzB,YACa,KAAK,CAAC,KAAK,gBAAgB;EAC1B,MAAM,QAChB,WAAW,QAAQ,UACnB,WAAW;AACD,SAAO,QAAQ,aAAa,IAAI,IAAI,MAAM,KAAK;GAC/C,CACD,KAAK,KAAK,CAAC;;EAGf,CACA,KAAK,KAAK,EACd,GACD;;AAIN,MAAa,uBAAuBA,MAAM,YASvC,EAAE,IAAI,WAAW,UAAU,QAAQ,WAAW,GAAG,SAAS,QAAQ;CACnE,MAAM,WAAWA,MAAM,OAAO;CAC9B,MAAM,UAAU,SAAS,MAAM,SAAS,QAAQ,MAAM,GAAG;AAEzD,QACE,2CAAC,aAAa;EAAS,OAAO,EAAE,QAAQ;YACtC,4CAAC;GACC,cAAY;GACP;GACL,gCACE,4CACA,gEACA,kJACA,wIACA,uDACA,oCACA,kIACA,kIACA,4IACA,0IACA,0DACA,qCACA,sCACA,UACD;GACD,GAAI;GACJ,OAAO;IACL,GAAG,MAAM;IACT;IACD;cAED,2CAAC;IAAiB,IAAI;IAAiB;KAAU,EACjD,2CAACC,SAAkB;IAA+B;IAC/C;KACqC;IACpC;GACgB;EAE1B;AACF,qBAAqB,cAAc;;;;AAKnC,SAAgB,4BACd,QACA,SACA,KACA;AACA,KAAI,OAAO,YAAY,YAAY,YAAY,KAC7C;CAGF,MAAM,iBACJ,aAAa,WACb,OAAO,QAAQ,YAAY,YAC3B,QAAQ,YAAY,OAChB,QAAQ,UACR;CAEN,IAAI,iBAAyB;AAE7B,KACE,OAAO,WACP,OAAO,QAAQ,SAAiC,SAEhD,kBAAiB,QAAQ;UAEzB,kBACA,OAAO,kBACP,OAAO,eAAe,SAAwC,SAE9D,kBAAiB,eACf;AAIJ,QAAO,kBAAkB,SACrB,OAAO,kBACP,OAAO"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
5
|
-
let
|
|
5
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_chunk.__toESM(react);
|
|
@@ -14,11 +14,11 @@ const DesignChartLegendContent = react.forwardRef(({ className, hideIcon = false
|
|
|
14
14
|
if (!payload?.length) return null;
|
|
15
15
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
16
16
|
ref,
|
|
17
|
-
className: (0,
|
|
17
|
+
className: (0, _hexclave_ui.cn)("flex flex-wrap items-center justify-center gap-2", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
18
18
|
children: payload.map((item) => {
|
|
19
19
|
const itemConfig = (0, __chart_container_js.getPayloadConfigFromPayload)(config, item, `${nameKey || item.dataKey || "value"}`);
|
|
20
20
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
21
|
-
className: (0,
|
|
21
|
+
className: (0, _hexclave_ui.cn)("flex items-center gap-1.5 rounded-full bg-foreground/[0.03] ring-1 ring-foreground/[0.06] px-3 py-1.5 text-xs", "transition-colors duration-150 hover:transition-none hover:bg-foreground/[0.05]"),
|
|
22
22
|
children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
23
23
|
className: "h-2 w-2 shrink-0 rounded-full",
|
|
24
24
|
style: { backgroundColor: item.color }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-legend.js","names":["React"],"sources":["../../src/components/chart-legend.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport { cn } from \"@
|
|
1
|
+
{"version":3,"file":"chart-legend.js","names":["React"],"sources":["../../src/components/chart-legend.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport { cn } from \"@hexclave/ui\";\nimport { useDesignChart, getPayloadConfigFromPayload } from \"./chart-container\";\n\nexport const DesignChartLegendContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"payload\" | \"verticalAlign\"> & {\n hideIcon?: boolean,\n nameKey?: string,\n }\n>(\n (\n { className, hideIcon = false, payload, verticalAlign = \"bottom\", nameKey },\n ref\n ) => {\n const { config } = useDesignChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center justify-center gap-2\",\n verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\",\n className\n )}\n >\n {payload.map((item) => {\n const key = `${nameKey || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n \"flex items-center gap-1.5 rounded-full bg-foreground/[0.03] ring-1 ring-foreground/[0.06] px-3 py-1.5 text-xs\",\n \"transition-colors duration-150 hover:transition-none hover:bg-foreground/[0.05]\"\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <span\n className=\"h-2 w-2 shrink-0 rounded-full\"\n style={{ backgroundColor: item.color }}\n />\n )}\n <span className=\"font-medium text-foreground\">\n {itemConfig?.label || item.value}\n </span>\n </div>\n );\n })}\n </div>\n );\n }\n);\nDesignChartLegendContent.displayName = \"DesignChartLegendContent\";\n"],"mappings":";;;;;;;;;;;AAOA,MAAa,2BAA2BA,MAAM,YAS1C,EAAE,WAAW,WAAW,OAAO,SAAS,gBAAgB,UAAU,WAClE,QACG;CACH,MAAM,EAAE,qDAA2B;AAEnC,KAAI,CAAC,SAAS,OACZ,QAAO;AAGT,QACE,2CAAC;EACM;EACL,gCACE,oDACA,kBAAkB,QAAQ,SAAS,QACnC,UACD;YAEA,QAAQ,KAAK,SAAS;GAErB,MAAM,mEAAyC,QAAQ,MAD3C,GAAG,WAAW,KAAK,WAAW,UACuB;AAEjE,UACE,4CAAC;IAEC,gCACE,iHACA,kFACD;eAEA,YAAY,QAAQ,CAAC,WACpB,2CAAC,WAAW,SAAO,GAEnB,2CAAC;KACC,WAAU;KACV,OAAO,EAAE,iBAAiB,KAAK,OAAO;MACtC,EAEJ,2CAAC;KAAK,WAAU;eACb,YAAY,SAAS,KAAK;MACtB;MAhBF,KAAK,MAiBN;IAER;GACE;EAGX;AACD,yBAAyB,cAAc"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
5
|
-
let
|
|
5
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_chunk.__toESM(react);
|
|
@@ -21,12 +21,12 @@ const DesignChartTooltipContent = react.forwardRef(({ active, payload, className
|
|
|
21
21
|
const configEntry = typeof label === "string" ? config[label] : void 0;
|
|
22
22
|
const value = !labelKey && typeof label === "string" ? configEntry?.label ?? label : itemConfig?.label;
|
|
23
23
|
if (labelFormatter) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
24
|
-
className: (0,
|
|
24
|
+
className: (0, _hexclave_ui.cn)("font-medium text-muted-foreground tracking-wide", labelClassName),
|
|
25
25
|
children: labelFormatter(value, payload)
|
|
26
26
|
});
|
|
27
27
|
if (!value) return null;
|
|
28
28
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
29
|
-
className: (0,
|
|
29
|
+
className: (0, _hexclave_ui.cn)("font-medium text-muted-foreground tracking-wide", labelClassName),
|
|
30
30
|
children: value
|
|
31
31
|
});
|
|
32
32
|
}, [
|
|
@@ -42,7 +42,7 @@ const DesignChartTooltipContent = react.forwardRef(({ active, payload, className
|
|
|
42
42
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
43
43
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
44
44
|
ref,
|
|
45
|
-
className: (0,
|
|
45
|
+
className: (0, _hexclave_ui.cn)("grid min-w-[8rem] items-start gap-1.5 rounded-xl bg-background/95 px-3.5 py-2.5 text-xs shadow-lg backdrop-blur-xl ring-1 ring-foreground/[0.08]", className),
|
|
46
46
|
style: { zIndex: 9999 },
|
|
47
47
|
children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48
48
|
className: "grid gap-1.5",
|
|
@@ -50,9 +50,9 @@ const DesignChartTooltipContent = react.forwardRef(({ active, payload, className
|
|
|
50
50
|
const itemConfig = (0, __chart_container_js.getPayloadConfigFromPayload)(config, item, `${nameKey || item.name || item.dataKey || "value"}`);
|
|
51
51
|
const indicatorColor = color || item.payload.fill || item.color;
|
|
52
52
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
53
|
-
className: (0,
|
|
53
|
+
className: (0, _hexclave_ui.cn)("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"),
|
|
54
54
|
children: formatter && item.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
55
|
-
className: (0,
|
|
55
|
+
className: (0, _hexclave_ui.cn)("shrink-0 rounded-full", {
|
|
56
56
|
"h-2 w-2 ring-2 ring-white/20": indicator === "dot",
|
|
57
57
|
"w-1 rounded-[2px]": indicator === "line",
|
|
58
58
|
"w-0 border-[1.5px] border-dashed bg-transparent rounded-[2px]": indicator === "dashed",
|
|
@@ -64,7 +64,7 @@ const DesignChartTooltipContent = react.forwardRef(({ active, payload, className
|
|
|
64
64
|
backgroundColor: indicator === "dot" ? indicatorColor : void 0
|
|
65
65
|
}
|
|
66
66
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
67
|
-
className: (0,
|
|
67
|
+
className: (0, _hexclave_ui.cn)("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
|
|
68
68
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
69
69
|
className: "grid gap-1.5",
|
|
70
70
|
children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-tooltip.js","names":["RechartsPrimitive","React"],"sources":["../../src/components/chart-tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport { cn } from \"@
|
|
1
|
+
{"version":3,"file":"chart-tooltip.js","names":["RechartsPrimitive","React"],"sources":["../../src/components/chart-tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\nimport { cn } from \"@hexclave/ui\";\nimport { useDesignChart, getPayloadConfigFromPayload } from \"./chart-container\";\n\nexport const DesignChartTooltip = RechartsPrimitive.Tooltip;\n\nexport const DesignChartTooltipContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<\"div\"> & {\n hideLabel?: boolean,\n hideIndicator?: boolean,\n indicator?: \"line\" | \"dot\" | \"dashed\",\n nameKey?: string,\n labelKey?: string,\n }\n>(\n (\n {\n active,\n payload,\n className,\n indicator = \"dot\",\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n },\n ref\n ) => {\n const { config } = useDesignChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item.dataKey || item.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const configEntry = typeof label === \"string\" ? config[label as keyof typeof config] : undefined;\n const value =\n !labelKey && typeof label === \"string\"\n ? configEntry?.label ?? label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn(\"font-medium text-muted-foreground tracking-wide\", labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium text-muted-foreground tracking-wide\", labelClassName)}>{value}</div>;\n }, [\n label,\n labelFormatter,\n payload,\n hideLabel,\n labelClassName,\n config,\n labelKey,\n ]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n ref={ref}\n className={cn(\n \"grid min-w-[8rem] items-start gap-1.5 rounded-xl bg-background/95 px-3.5 py-2.5 text-xs shadow-lg backdrop-blur-xl ring-1 ring-foreground/[0.08]\",\n className\n )}\n style={{ zIndex: 9999 }}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground\",\n indicator === \"dot\" && \"items-center\"\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n \"shrink-0 rounded-full\",\n {\n \"h-2 w-2 ring-2 ring-white/20\": indicator === \"dot\",\n \"w-1 rounded-[2px]\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent rounded-[2px]\":\n indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n }\n )}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n backgroundColor: indicator === \"dot\" ? indicatorColor : undefined,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n \"flex flex-1 justify-between leading-none\",\n nestLabel ? \"items-end\" : \"items-center\"\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-[11px] text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value != null && (\n <span className=\"ml-auto font-mono text-xs font-semibold tabular-nums text-foreground\">\n {typeof item.value === \"number\" ? item.value.toLocaleString() : item.value}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n);\nDesignChartTooltipContent.displayName = \"DesignChartTooltipContent\";\n"],"mappings":";;;;;;;;;;;;;AAOA,MAAa,qBAAqBA,SAAkB;AAEpD,MAAa,4BAA4BC,MAAM,YAY3C,EACE,QACA,SACA,WACA,YAAY,OACZ,YAAY,OACZ,gBAAgB,OAChB,OACA,gBACA,gBACA,WACA,OACA,SACA,YAEF,QACG;CACH,MAAM,EAAE,qDAA2B;CAEnC,MAAM,eAAeA,MAAM,cAAc;AACvC,MAAI,aAAa,CAAC,SAAS,OACzB,QAAO;EAGT,MAAM,CAAC,QAAQ;EAEf,MAAM,mEAAyC,QAAQ,MAD3C,GAAG,YAAY,KAAK,WAAW,KAAK,QAAQ,UACS;EACjE,MAAM,cAAc,OAAO,UAAU,WAAW,OAAO,SAAgC;EACvF,MAAM,QACJ,CAAC,YAAY,OAAO,UAAU,WAC1B,aAAa,SAAS,QACtB,YAAY;AAElB,MAAI,eACF,QACE,2CAAC;GAAI,gCAAc,mDAAmD,eAAe;aAClF,eAAe,OAAO,QAAQ;IAC3B;AAIV,MAAI,CAAC,MACH,QAAO;AAGT,SAAO,2CAAC;GAAI,gCAAc,mDAAmD,eAAe;aAAG;IAAY;IAC1G;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,KAAI,CAAC,UAAU,CAAC,SAAS,OACvB,QAAO;CAGT,MAAM,YAAY,QAAQ,WAAW,KAAK,cAAc;AAExD,QACE,4CAAC;EACM;EACL,gCACE,oJACA,UACD;EACD,OAAO,EAAE,QAAQ,MAAM;aAEtB,CAAC,YAAY,eAAe,MAC7B,2CAAC;GAAI,WAAU;aACZ,QAAQ,KAAK,MAAM,UAAU;IAE5B,MAAM,mEAAyC,QAAQ,MAD3C,GAAG,WAAW,KAAK,QAAQ,KAAK,WAAW,UACU;IACjE,MAAM,iBAAiB,SAAS,KAAK,QAAQ,QAAQ,KAAK;AAE1D,WACE,2CAAC;KAEC,gCACE,uGACA,cAAc,SAAS,eACxB;eAEA,aAAa,KAAK,UAAU,UAAa,KAAK,OAC7C,UAAU,KAAK,OAAO,KAAK,MAAM,MAAM,OAAO,KAAK,QAAQ,GAE3D,qFACG,YAAY,OACX,2CAAC,WAAW,SAAO,GAEnB,CAAC,iBACC,2CAAC;MACC,gCACE,yBACA;OACE,gCAAgC,cAAc;OAC9C,qBAAqB,cAAc;OACnC,iEACE,cAAc;OAChB,UAAU,aAAa,cAAc;OACtC,CACF;MACD,OACE;OACE,cAAc;OACd,kBAAkB;OAClB,iBAAiB,cAAc,QAAQ,iBAAiB;OACzD;OAEH,EAGN,4CAAC;MACC,gCACE,4CACA,YAAY,cAAc,eAC3B;iBAED,4CAAC;OAAI,WAAU;kBACZ,YAAY,eAAe,MAC5B,2CAAC;QAAK,WAAU;kBACb,YAAY,SAAS,KAAK;SACtB;QACH,EACL,KAAK,SAAS,QACb,2CAAC;OAAK,WAAU;iBACb,OAAO,KAAK,UAAU,WAAW,KAAK,MAAM,gBAAgB,GAAG,KAAK;QAChE;OAEL,IACL;OArDA,KAAK,QAuDN;KAER;IACE;GACF;EAGX;AACD,0BAA0B,cAAc"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_chunk = require('../../chunk-BE-pF4vm.js');
|
|
5
5
|
let _phosphor_icons_react = require("@phosphor-icons/react");
|
|
6
|
-
let
|
|
6
|
+
let _hexclave_ui = require("@hexclave/ui");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
react = require_chunk.__toESM(react);
|
|
@@ -37,7 +37,7 @@ function usePopover() {
|
|
|
37
37
|
function PopoverPanel({ children, className, popoverRef }) {
|
|
38
38
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
39
39
|
ref: popoverRef,
|
|
40
|
-
className: (0,
|
|
40
|
+
className: (0, _hexclave_ui.cn)("absolute top-full left-0 mt-1 z-50", "bg-popover text-popover-foreground rounded-xl shadow-lg", "ring-1 ring-black/[0.08] dark:ring-white/[0.1]", "backdrop-blur-xl", className),
|
|
41
41
|
children
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -48,7 +48,7 @@ function QuickSearch({ value, onChange, placeholder }) {
|
|
|
48
48
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.MagnifyingGlass, { className: "absolute left-2.5 h-3.5 w-3.5 text-muted-foreground/50 pointer-events-none" }),
|
|
49
49
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
50
50
|
type: "text",
|
|
51
|
-
className: (0,
|
|
51
|
+
className: (0, _hexclave_ui.cn)("h-8 w-full sm:w-52 pl-8 pr-7 rounded-xl text-xs", "bg-background", "border border-black/[0.08] dark:border-white/[0.08]", "placeholder:text-muted-foreground/40", "focus:outline-none focus:ring-1 focus:ring-foreground/[0.1]", "transition-all duration-150"),
|
|
52
52
|
placeholder,
|
|
53
53
|
value,
|
|
54
54
|
onChange: (e) => onChange(e.target.value)
|
|
@@ -64,7 +64,7 @@ function QuickSearch({ value, onChange, placeholder }) {
|
|
|
64
64
|
}
|
|
65
65
|
function ToolbarButton({ children, onClick, active, title, className: extraClassName }) {
|
|
66
66
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
67
|
-
className: (0,
|
|
67
|
+
className: (0, _hexclave_ui.cn)("relative flex items-center justify-center rounded-lg text-xs font-medium", "h-7 w-7", "transition-colors duration-75", active ? "bg-foreground/[0.06] text-foreground" : "text-muted-foreground hover:text-foreground hover:bg-foreground/[0.04]", extraClassName),
|
|
68
68
|
onClick,
|
|
69
69
|
title,
|
|
70
70
|
children
|
|
@@ -97,7 +97,7 @@ function ColumnManager({ columns, visibility, onChange, strings, dateDisplay, on
|
|
|
97
97
|
children: hideableColumns.map((col) => {
|
|
98
98
|
const visible = visibility[col.id] !== false;
|
|
99
99
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
100
|
-
className: (0,
|
|
100
|
+
className: (0, _hexclave_ui.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 rounded-lg text-xs", "hover:bg-foreground/[0.06] transition-colors duration-75", visible ? "text-foreground" : "text-muted-foreground/50"),
|
|
101
101
|
onClick: () => toggleColumn(col.id),
|
|
102
102
|
children: [
|
|
103
103
|
visible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.Eye, { className: "h-3.5 w-3.5 flex-shrink-0 text-blue-500" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.EyeSlash, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
@@ -139,11 +139,11 @@ function ColumnManager({ columns, visibility, onChange, strings, dateDisplay, on
|
|
|
139
139
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
140
140
|
className: "inline-flex items-center gap-0.5 rounded-lg bg-foreground/[0.04] p-0.5",
|
|
141
141
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
142
|
-
className: (0,
|
|
142
|
+
className: (0, _hexclave_ui.cn)("px-2 py-0.5 rounded-md text-[11px] font-medium transition-colors duration-75", dateDisplay === "relative" ? "bg-background text-foreground shadow-sm ring-1 ring-foreground/[0.06]" : "text-muted-foreground hover:text-foreground"),
|
|
143
143
|
onClick: () => onDateDisplayChange("relative"),
|
|
144
144
|
children: strings.dateFormatRelative
|
|
145
145
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
146
|
-
className: (0,
|
|
146
|
+
className: (0, _hexclave_ui.cn)("px-2 py-0.5 rounded-md text-[11px] font-medium transition-colors duration-75", dateDisplay === "absolute" ? "bg-background text-foreground shadow-sm ring-1 ring-foreground/[0.06]" : "text-muted-foreground hover:text-foreground"),
|
|
147
147
|
onClick: () => onDateDisplayChange("absolute"),
|
|
148
148
|
children: strings.dateFormatAbsolute
|
|
149
149
|
})]
|