@stackframe/dashboard-ui-components 2.8.76
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/LICENSE +5 -0
- package/dist/chunk-BE-pF4vm.js +34 -0
- package/dist/components/alert.d.ts +22 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +75 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/badge.d.ts +24 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +59 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +32 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +68 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.d.ts +59 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +133 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/chart-card.d.ts +21 -0
- package/dist/components/chart-card.d.ts.map +1 -0
- package/dist/components/chart-card.js +54 -0
- package/dist/components/chart-card.js.map +1 -0
- package/dist/components/chart-container.d.ts +51 -0
- package/dist/components/chart-container.d.ts.map +1 -0
- package/dist/components/chart-container.js +77 -0
- package/dist/components/chart-container.js.map +1 -0
- package/dist/components/chart-legend.d.ts +12 -0
- package/dist/components/chart-legend.d.ts.map +1 -0
- package/dist/components/chart-legend.js +41 -0
- package/dist/components/chart-legend.js.map +1 -0
- package/dist/components/chart-theme.d.ts +26 -0
- package/dist/components/chart-theme.d.ts.map +1 -0
- package/dist/components/chart-theme.js +64 -0
- package/dist/components/chart-theme.js.map +1 -0
- package/dist/components/chart-tooltip.d.ts +41 -0
- package/dist/components/chart-tooltip.d.ts.map +1 -0
- package/dist/components/chart-tooltip.js +89 -0
- package/dist/components/chart-tooltip.js.map +1 -0
- package/dist/components/cursor-blast-effect.d.ts +27 -0
- package/dist/components/cursor-blast-effect.d.ts.map +1 -0
- package/dist/components/cursor-blast-effect.js +243 -0
- package/dist/components/cursor-blast-effect.js.map +1 -0
- package/dist/components/edit-mode.d.ts +12 -0
- package/dist/components/edit-mode.d.ts.map +1 -0
- package/dist/components/edit-mode.js +23 -0
- package/dist/components/edit-mode.js.map +1 -0
- package/dist/components/empty-state.d.ts +21 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +37 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/input.d.ts +18 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +53 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/metric-card.d.ts +31 -0
- package/dist/components/metric-card.d.ts.map +1 -0
- package/dist/components/metric-card.js +88 -0
- package/dist/components/metric-card.js.map +1 -0
- package/dist/components/pill-toggle.d.ts +33 -0
- package/dist/components/pill-toggle.d.ts.map +1 -0
- package/dist/components/pill-toggle.js +86 -0
- package/dist/components/pill-toggle.js.map +1 -0
- package/dist/components/progress-bar.d.ts +25 -0
- package/dist/components/progress-bar.d.ts.map +1 -0
- package/dist/components/progress-bar.js +44 -0
- package/dist/components/progress-bar.js.map +1 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +20 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/skeleton.d.ts +12 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +18 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/table.d.ts +24 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +59 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +34 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +100 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/dashboard-ui-components.global.js +15232 -0
- package/dist/dashboard-ui-components.global.js.map +7 -0
- package/dist/esm/components/alert.d.ts +22 -0
- package/dist/esm/components/alert.d.ts.map +1 -0
- package/dist/esm/components/alert.js +73 -0
- package/dist/esm/components/alert.js.map +1 -0
- package/dist/esm/components/badge.d.ts +24 -0
- package/dist/esm/components/badge.d.ts.map +1 -0
- package/dist/esm/components/badge.js +57 -0
- package/dist/esm/components/badge.js.map +1 -0
- package/dist/esm/components/button.d.ts +32 -0
- package/dist/esm/components/button.d.ts.map +1 -0
- package/dist/esm/components/button.js +65 -0
- package/dist/esm/components/button.js.map +1 -0
- package/dist/esm/components/card.d.ts +59 -0
- package/dist/esm/components/card.d.ts.map +1 -0
- package/dist/esm/components/card.js +127 -0
- package/dist/esm/components/card.js.map +1 -0
- package/dist/esm/components/chart-card.d.ts +21 -0
- package/dist/esm/components/chart-card.d.ts.map +1 -0
- package/dist/esm/components/chart-card.js +51 -0
- package/dist/esm/components/chart-card.js.map +1 -0
- package/dist/esm/components/chart-container.d.ts +51 -0
- package/dist/esm/components/chart-container.d.ts.map +1 -0
- package/dist/esm/components/chart-container.js +70 -0
- package/dist/esm/components/chart-container.js.map +1 -0
- package/dist/esm/components/chart-legend.d.ts +12 -0
- package/dist/esm/components/chart-legend.d.ts.map +1 -0
- package/dist/esm/components/chart-legend.js +36 -0
- package/dist/esm/components/chart-legend.js.map +1 -0
- package/dist/esm/components/chart-theme.d.ts +26 -0
- package/dist/esm/components/chart-theme.d.ts.map +1 -0
- package/dist/esm/components/chart-theme.js +59 -0
- package/dist/esm/components/chart-theme.js.map +1 -0
- package/dist/esm/components/chart-tooltip.d.ts +41 -0
- package/dist/esm/components/chart-tooltip.d.ts.map +1 -0
- package/dist/esm/components/chart-tooltip.js +84 -0
- package/dist/esm/components/chart-tooltip.js.map +1 -0
- package/dist/esm/components/cursor-blast-effect.d.ts +27 -0
- package/dist/esm/components/cursor-blast-effect.d.ts.map +1 -0
- package/dist/esm/components/cursor-blast-effect.js +241 -0
- package/dist/esm/components/cursor-blast-effect.js.map +1 -0
- package/dist/esm/components/edit-mode.d.ts +12 -0
- package/dist/esm/components/edit-mode.d.ts.map +1 -0
- package/dist/esm/components/edit-mode.js +20 -0
- package/dist/esm/components/edit-mode.js.map +1 -0
- package/dist/esm/components/empty-state.d.ts +21 -0
- package/dist/esm/components/empty-state.d.ts.map +1 -0
- package/dist/esm/components/empty-state.js +34 -0
- package/dist/esm/components/empty-state.js.map +1 -0
- package/dist/esm/components/input.d.ts +18 -0
- package/dist/esm/components/input.d.ts.map +1 -0
- package/dist/esm/components/input.js +50 -0
- package/dist/esm/components/input.js.map +1 -0
- package/dist/esm/components/metric-card.d.ts +31 -0
- package/dist/esm/components/metric-card.d.ts.map +1 -0
- package/dist/esm/components/metric-card.js +85 -0
- package/dist/esm/components/metric-card.js.map +1 -0
- package/dist/esm/components/pill-toggle.d.ts +33 -0
- package/dist/esm/components/pill-toggle.d.ts.map +1 -0
- package/dist/esm/components/pill-toggle.js +84 -0
- package/dist/esm/components/pill-toggle.js.map +1 -0
- package/dist/esm/components/progress-bar.d.ts +25 -0
- package/dist/esm/components/progress-bar.d.ts.map +1 -0
- package/dist/esm/components/progress-bar.js +42 -0
- package/dist/esm/components/progress-bar.js.map +1 -0
- package/dist/esm/components/separator.d.ts +14 -0
- package/dist/esm/components/separator.d.ts.map +1 -0
- package/dist/esm/components/separator.js +18 -0
- package/dist/esm/components/separator.js.map +1 -0
- package/dist/esm/components/skeleton.d.ts +12 -0
- package/dist/esm/components/skeleton.d.ts.map +1 -0
- package/dist/esm/components/skeleton.js +16 -0
- package/dist/esm/components/skeleton.js.map +1 -0
- package/dist/esm/components/table.d.ts +24 -0
- package/dist/esm/components/table.d.ts.map +1 -0
- package/dist/esm/components/table.js +51 -0
- package/dist/esm/components/table.js.map +1 -0
- package/dist/esm/components/tabs.d.ts +34 -0
- package/dist/esm/components/tabs.d.ts.map +1 -0
- package/dist/esm/components/tabs.js +98 -0
- package/dist/esm/components/tabs.js.map +1 -0
- package/dist/esm/index.d.ts +21 -0
- package/dist/esm/index.js +22 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +245 -0
- package/package.json +71 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Spinner, Tooltip, TooltipContent, TooltipTrigger, cn } from "@stackframe/stack-ui";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { runAsynchronouslyWithAlert } from "@stackframe/stack-shared/dist/utils/promises";
|
|
7
|
+
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
|
8
|
+
import { useGlassmorphicDefault } from "./card.js";
|
|
9
|
+
|
|
10
|
+
//#region src/components/pill-toggle.tsx
|
|
11
|
+
const sizeClasses = new Map([
|
|
12
|
+
["sm", {
|
|
13
|
+
button: "px-3 py-1.5 text-xs",
|
|
14
|
+
icon: "h-3.5 w-3.5"
|
|
15
|
+
}],
|
|
16
|
+
["md", {
|
|
17
|
+
button: "px-4 py-2 text-sm",
|
|
18
|
+
icon: "h-4 w-4"
|
|
19
|
+
}],
|
|
20
|
+
["lg", {
|
|
21
|
+
button: "px-5 py-2.5 text-sm",
|
|
22
|
+
icon: "h-4 w-4"
|
|
23
|
+
}]
|
|
24
|
+
]);
|
|
25
|
+
const gradientClasses = new Map([
|
|
26
|
+
["blue", "ring-blue-500/20 dark:ring-blue-400/20"],
|
|
27
|
+
["cyan", "ring-cyan-500/20 dark:ring-cyan-400/20"],
|
|
28
|
+
["purple", "ring-purple-500/20 dark:ring-purple-400/20"],
|
|
29
|
+
["green", "ring-emerald-500/20 dark:ring-emerald-400/20"],
|
|
30
|
+
["orange", "ring-amber-500/20 dark:ring-amber-400/20"],
|
|
31
|
+
["default", "ring-black/[0.12] dark:ring-white/[0.06]"]
|
|
32
|
+
]);
|
|
33
|
+
function getMapValueOrThrow(map, key, mapName) {
|
|
34
|
+
const value = map.get(key);
|
|
35
|
+
if (!value) throw new Error(`Missing ${mapName} entry for key "${String(key)}"`);
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function DesignPillToggle({ options, selected, onSelect, size = "md", glassmorphic: glassmorphicProp, gradient = "default", showLabels = true, className }) {
|
|
39
|
+
const glassmorphic = useGlassmorphicDefault(glassmorphicProp);
|
|
40
|
+
const sizeClass = getMapValueOrThrow(sizeClasses, size, "sizeClasses");
|
|
41
|
+
const activeRingClass = getMapValueOrThrow(gradientClasses, gradient, "gradientClasses");
|
|
42
|
+
const [loadingOptionId, setLoadingOptionId] = useState(null);
|
|
43
|
+
const handleClick = (optionId) => {
|
|
44
|
+
const result = onSelect(optionId);
|
|
45
|
+
if (result && typeof result.then === "function") {
|
|
46
|
+
setLoadingOptionId(optionId);
|
|
47
|
+
runAsynchronouslyWithAlert(Promise.resolve(result).finally(() => setLoadingOptionId(null)));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: cn("inline-flex items-center gap-1 p-1 rounded-xl", glassmorphic ? "bg-foreground/[0.04] backdrop-blur-sm" : "bg-black/[0.08] dark:bg-white/[0.04]", className),
|
|
52
|
+
children: options.map((option) => {
|
|
53
|
+
const isActive = selected === option.id;
|
|
54
|
+
const Icon = option.icon;
|
|
55
|
+
const pill = /* @__PURE__ */ jsxs("button", {
|
|
56
|
+
onClick: () => handleClick(option.id),
|
|
57
|
+
disabled: loadingOptionId !== null,
|
|
58
|
+
className: cn("relative flex items-center gap-2 font-medium rounded-lg transition-all duration-150 hover:transition-none", sizeClass.button, isActive ? cn("bg-background text-foreground shadow-sm ring-1", glassmorphic ? "ring-foreground/[0.06] dark:bg-[hsl(240,71%,70%)]/10 dark:text-[hsl(240,71%,90%)] dark:ring-[hsl(240,71%,70%)]/20" : activeRingClass) : cn("text-muted-foreground hover:text-foreground", glassmorphic ? "hover:bg-background/50" : "hover:bg-black/[0.06] dark:hover:bg-white/[0.04]")),
|
|
59
|
+
children: [loadingOptionId === option.id && /* @__PURE__ */ jsx(Spinner, {
|
|
60
|
+
size: 12,
|
|
61
|
+
className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"
|
|
62
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
63
|
+
className: cn("flex items-center gap-2", loadingOptionId === option.id && "invisible"),
|
|
64
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, { className: sizeClass.icon }), showLabels && option.label]
|
|
65
|
+
})]
|
|
66
|
+
}, option.id);
|
|
67
|
+
if (!showLabels) return /* @__PURE__ */ jsxs(Tooltip, {
|
|
68
|
+
delayDuration: 0,
|
|
69
|
+
children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
70
|
+
asChild: true,
|
|
71
|
+
children: pill
|
|
72
|
+
}), /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipContent, {
|
|
73
|
+
side: "top",
|
|
74
|
+
children: option.label
|
|
75
|
+
}) })]
|
|
76
|
+
}, option.id);
|
|
77
|
+
return pill;
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { DesignPillToggle };
|
|
84
|
+
//# sourceMappingURL=pill-toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pill-toggle.js","names":[],"sources":["../../../src/components/pill-toggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { cn, Spinner, Tooltip, TooltipContent, TooltipTrigger } from \"@stackframe/stack-ui\";\nimport { TooltipPortal } from \"@radix-ui/react-tooltip\";\nimport { runAsynchronouslyWithAlert } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { useGlassmorphicDefault } from \"./card\";\n\ntype DesignPillToggleSize = \"sm\" | \"md\" | \"lg\";\ntype DesignPillToggleGradient = \"blue\" | \"cyan\" | \"purple\" | \"green\" | \"orange\" | \"default\";\n\nexport type DesignPillToggleOption = {\n id: string,\n label: string,\n icon?: React.ElementType,\n};\n\nexport type DesignPillToggleProps = {\n options: DesignPillToggleOption[],\n selected: string,\n onSelect: (id: string) => void | Promise<void>,\n size?: DesignPillToggleSize,\n glassmorphic?: boolean,\n gradient?: DesignPillToggleGradient,\n /** When false, hides labels and shows a tooltip on hover instead. Defaults to true. */\n showLabels?: boolean,\n className?: string,\n};\n\ntype SizeClass = {\n button: string,\n icon: string,\n};\n\nconst sizeClasses = new Map<DesignPillToggleSize, SizeClass>([\n [\"sm\", { button: \"px-3 py-1.5 text-xs\", icon: \"h-3.5 w-3.5\" }],\n [\"md\", { button: \"px-4 py-2 text-sm\", icon: \"h-4 w-4\" }],\n [\"lg\", { button: \"px-5 py-2.5 text-sm\", icon: \"h-4 w-4\" }],\n]);\n\nconst gradientClasses = new Map<DesignPillToggleGradient, string>([\n [\"blue\", \"ring-blue-500/20 dark:ring-blue-400/20\"],\n [\"cyan\", \"ring-cyan-500/20 dark:ring-cyan-400/20\"],\n [\"purple\", \"ring-purple-500/20 dark:ring-purple-400/20\"],\n [\"green\", \"ring-emerald-500/20 dark:ring-emerald-400/20\"],\n [\"orange\", \"ring-amber-500/20 dark:ring-amber-400/20\"],\n [\"default\", \"ring-black/[0.12] dark:ring-white/[0.06]\"],\n]);\n\nfunction getMapValueOrThrow<TKey, TValue>(map: Map<TKey, TValue>, key: TKey, mapName: string) {\n const value = map.get(key);\n if (!value) {\n throw new Error(`Missing ${mapName} entry for key \"${String(key)}\"`);\n }\n return value;\n}\n\nexport function DesignPillToggle({\n options,\n selected,\n onSelect,\n size = \"md\",\n glassmorphic: glassmorphicProp,\n gradient = \"default\",\n showLabels = true,\n className,\n}: DesignPillToggleProps) {\n const glassmorphic = useGlassmorphicDefault(glassmorphicProp);\n const sizeClass = getMapValueOrThrow(sizeClasses, size, \"sizeClasses\");\n const activeRingClass = getMapValueOrThrow(gradientClasses, gradient, \"gradientClasses\");\n\n const [loadingOptionId, setLoadingOptionId] = useState<string | null>(null);\n\n const handleClick = (optionId: string) => {\n const result = onSelect(optionId);\n if (result && typeof (result as Promise<void>).then === \"function\") {\n setLoadingOptionId(optionId);\n runAsynchronouslyWithAlert(\n Promise.resolve(result).finally(() => setLoadingOptionId(null))\n );\n }\n };\n\n return (\n <div\n className={cn(\n \"inline-flex items-center gap-1 p-1 rounded-xl\",\n glassmorphic\n ? \"bg-foreground/[0.04] backdrop-blur-sm\"\n : \"bg-black/[0.08] dark:bg-white/[0.04]\",\n className\n )}\n >\n {options.map((option) => {\n const isActive = selected === option.id;\n const Icon = option.icon;\n\n const pill = (\n <button\n key={option.id}\n onClick={() => handleClick(option.id)}\n disabled={loadingOptionId !== null}\n className={cn(\n \"relative flex items-center gap-2 font-medium rounded-lg transition-all duration-150 hover:transition-none\",\n sizeClass.button,\n isActive\n ? cn(\n \"bg-background text-foreground shadow-sm ring-1\",\n glassmorphic\n ? \"ring-foreground/[0.06] dark:bg-[hsl(240,71%,70%)]/10 dark:text-[hsl(240,71%,90%)] dark:ring-[hsl(240,71%,70%)]/20\"\n : activeRingClass\n )\n : cn(\n \"text-muted-foreground hover:text-foreground\",\n glassmorphic\n ? \"hover:bg-background/50\"\n : \"hover:bg-black/[0.06] dark:hover:bg-white/[0.04]\"\n )\n )}\n >\n {loadingOptionId === option.id && (\n <Spinner\n size={12}\n className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none\"\n />\n )}\n <span className={cn(\n \"flex items-center gap-2\",\n loadingOptionId === option.id && \"invisible\"\n )}>\n {Icon && <Icon className={sizeClass.icon} />}\n {showLabels && option.label}\n </span>\n </button>\n );\n\n if (!showLabels) {\n return (\n <Tooltip key={option.id} delayDuration={0}>\n <TooltipTrigger asChild>\n {pill}\n </TooltipTrigger>\n <TooltipPortal>\n <TooltipContent side=\"top\">\n {option.label}\n </TooltipContent>\n </TooltipPortal>\n </Tooltip>\n );\n }\n\n return pill;\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAkCA,MAAM,cAAc,IAAI,IAAqC;CAC3D,CAAC,MAAM;EAAE,QAAQ;EAAuB,MAAM;EAAe,CAAC;CAC9D,CAAC,MAAM;EAAE,QAAQ;EAAqB,MAAM;EAAW,CAAC;CACxD,CAAC,MAAM;EAAE,QAAQ;EAAuB,MAAM;EAAW,CAAC;CAC3D,CAAC;AAEF,MAAM,kBAAkB,IAAI,IAAsC;CAChE,CAAC,QAAQ,yCAAyC;CAClD,CAAC,QAAQ,yCAAyC;CAClD,CAAC,UAAU,6CAA6C;CACxD,CAAC,SAAS,+CAA+C;CACzD,CAAC,UAAU,2CAA2C;CACtD,CAAC,WAAW,2CAA2C;CACxD,CAAC;AAEF,SAAS,mBAAiC,KAAwB,KAAW,SAAiB;CAC5F,MAAM,QAAQ,IAAI,IAAI,IAAI;AAC1B,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,WAAW,QAAQ,kBAAkB,OAAO,IAAI,CAAC,GAAG;AAEtE,QAAO;;AAGT,SAAgB,iBAAiB,EAC/B,SACA,UACA,UACA,OAAO,MACP,cAAc,kBACd,WAAW,WACX,aAAa,MACb,aACwB;CACxB,MAAM,eAAe,uBAAuB,iBAAiB;CAC7D,MAAM,YAAY,mBAAmB,aAAa,MAAM,cAAc;CACtE,MAAM,kBAAkB,mBAAmB,iBAAiB,UAAU,kBAAkB;CAExF,MAAM,CAAC,iBAAiB,sBAAsB,SAAwB,KAAK;CAE3E,MAAM,eAAe,aAAqB;EACxC,MAAM,SAAS,SAAS,SAAS;AACjC,MAAI,UAAU,OAAQ,OAAyB,SAAS,YAAY;AAClE,sBAAmB,SAAS;AAC5B,8BACE,QAAQ,QAAQ,OAAO,CAAC,cAAc,mBAAmB,KAAK,CAAC,CAChE;;;AAIL,QACE,oBAAC;EACC,WAAW,GACT,iDACA,eACI,0CACA,wCACJ,UACD;YAEA,QAAQ,KAAK,WAAW;GACvB,MAAM,WAAW,aAAa,OAAO;GACrC,MAAM,OAAO,OAAO;GAEpB,MAAM,OACJ,qBAAC;IAEC,eAAe,YAAY,OAAO,GAAG;IACrC,UAAU,oBAAoB;IAC9B,WAAW,GACT,6GACA,UAAU,QACV,WACI,GACA,kDACA,eACI,sHACA,gBACL,GACC,GACA,+CACA,eACI,2BACA,mDACL,CACJ;eAEA,oBAAoB,OAAO,MAC1B,oBAAC;KACC,MAAM;KACN,WAAU;MACV,EAEJ,qBAAC;KAAK,WAAW,GACf,2BACA,oBAAoB,OAAO,MAAM,YAClC;gBACE,QAAQ,oBAAC,QAAK,WAAW,UAAU,OAAQ,EAC3C,cAAc,OAAO;MACjB;MAjCF,OAAO,GAkCL;AAGX,OAAI,CAAC,WACH,QACE,qBAAC;IAAwB,eAAe;eACtC,oBAAC;KAAe;eACb;MACc,EACjB,oBAAC,2BACC,oBAAC;KAAe,MAAK;eAClB,OAAO;MACO,GACH;MARJ,OAAO,GASX;AAId,UAAO;IACP;GACE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/progress-bar.d.ts
|
|
4
|
+
type DesignProgressBarGradient = "blue" | "cyan" | "purple" | "green" | "orange" | "default";
|
|
5
|
+
type DesignProgressBarProps = {
|
|
6
|
+
value: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
gradient?: DesignProgressBarGradient;
|
|
9
|
+
label?: string;
|
|
10
|
+
showPercentage?: boolean;
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
declare function DesignProgressBar({
|
|
15
|
+
value,
|
|
16
|
+
max,
|
|
17
|
+
gradient,
|
|
18
|
+
label,
|
|
19
|
+
showPercentage,
|
|
20
|
+
size,
|
|
21
|
+
className
|
|
22
|
+
}: DesignProgressBarProps): react_jsx_runtime0.JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { DesignProgressBar, DesignProgressBarProps };
|
|
25
|
+
//# sourceMappingURL=progress-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","names":[],"sources":["../../../src/components/progress-bar.tsx"],"mappings":";;;KAIK,yBAAA;AAAA,KAWO,sBAAA;EACV,KAAA;EACA,GAAA;EACA,QAAA,GAAW,yBAAA;EACX,KAAA;EACA,cAAA;EACA,IAAA;EACA,SAAA;AAAA;AAAA,iBAGc,iBAAA,CAAA;EACd,KAAA;EACA,GAAA;EACA,QAAA;EACA,KAAA;EACA,cAAA;EACA,IAAA;EACA;AAAA,GACC,sBAAA,GAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stackframe/stack-ui";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/progress-bar.tsx
|
|
7
|
+
const fillClasses = new Map([
|
|
8
|
+
["blue", "bg-blue-500 dark:bg-blue-400"],
|
|
9
|
+
["cyan", "bg-cyan-500 dark:bg-cyan-400"],
|
|
10
|
+
["purple", "bg-purple-500 dark:bg-purple-400"],
|
|
11
|
+
["green", "bg-emerald-500 dark:bg-emerald-400"],
|
|
12
|
+
["orange", "bg-amber-500 dark:bg-amber-400"],
|
|
13
|
+
["default", "bg-foreground/60"]
|
|
14
|
+
]);
|
|
15
|
+
function DesignProgressBar({ value, max = 100, gradient = "default", label, showPercentage = false, size = "md", className }) {
|
|
16
|
+
const percentage = max > 0 ? Math.min(Math.max(value / max * 100, 0), 100) : 0;
|
|
17
|
+
const fillClass = fillClasses.get(gradient) ?? "bg-foreground/60";
|
|
18
|
+
const trackHeight = size === "sm" ? "h-1.5" : size === "lg" ? "h-3" : "h-2";
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: cn("w-full", className),
|
|
21
|
+
children: [(label || showPercentage) && /* @__PURE__ */ jsxs("div", {
|
|
22
|
+
className: "flex items-center justify-between mb-2",
|
|
23
|
+
children: [label && /* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
25
|
+
children: label
|
|
26
|
+
}), showPercentage && /* @__PURE__ */ jsxs("span", {
|
|
27
|
+
className: "text-xs font-medium tabular-nums text-foreground",
|
|
28
|
+
children: [Math.round(percentage), "%"]
|
|
29
|
+
})]
|
|
30
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: cn("w-full rounded-full bg-black/[0.06] dark:bg-white/[0.06] overflow-hidden", trackHeight),
|
|
32
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: cn("h-full rounded-full transition-all duration-300 ease-out", fillClass),
|
|
34
|
+
style: { width: `${percentage}%` }
|
|
35
|
+
})
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { DesignProgressBar };
|
|
42
|
+
//# sourceMappingURL=progress-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.js","names":[],"sources":["../../../src/components/progress-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@stackframe/stack-ui\";\n\ntype DesignProgressBarGradient = \"blue\" | \"cyan\" | \"purple\" | \"green\" | \"orange\" | \"default\";\n\nconst fillClasses = new Map<DesignProgressBarGradient, string>([\n [\"blue\", \"bg-blue-500 dark:bg-blue-400\"],\n [\"cyan\", \"bg-cyan-500 dark:bg-cyan-400\"],\n [\"purple\", \"bg-purple-500 dark:bg-purple-400\"],\n [\"green\", \"bg-emerald-500 dark:bg-emerald-400\"],\n [\"orange\", \"bg-amber-500 dark:bg-amber-400\"],\n [\"default\", \"bg-foreground/60\"],\n]);\n\nexport type DesignProgressBarProps = {\n value: number,\n max?: number,\n gradient?: DesignProgressBarGradient,\n label?: string,\n showPercentage?: boolean,\n size?: \"sm\" | \"md\" | \"lg\",\n className?: string,\n};\n\nexport function DesignProgressBar({\n value,\n max = 100,\n gradient = \"default\",\n label,\n showPercentage = false,\n size = \"md\",\n className,\n}: DesignProgressBarProps) {\n const percentage = max > 0 ? Math.min(Math.max((value / max) * 100, 0), 100) : 0;\n const fillClass = fillClasses.get(gradient) ?? \"bg-foreground/60\";\n\n const trackHeight = size === \"sm\" ? \"h-1.5\" : size === \"lg\" ? \"h-3\" : \"h-2\";\n\n return (\n <div className={cn(\"w-full\", className)}>\n {(label || showPercentage) && (\n <div className=\"flex items-center justify-between mb-2\">\n {label && (\n <span className=\"text-xs font-medium text-muted-foreground\">\n {label}\n </span>\n )}\n {showPercentage && (\n <span className=\"text-xs font-medium tabular-nums text-foreground\">\n {Math.round(percentage)}%\n </span>\n )}\n </div>\n )}\n <div\n className={cn(\n \"w-full rounded-full bg-black/[0.06] dark:bg-white/[0.06] overflow-hidden\",\n trackHeight\n )}\n >\n <div\n className={cn(\n \"h-full rounded-full transition-all duration-300 ease-out\",\n fillClass\n )}\n style={{ width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAMA,MAAM,cAAc,IAAI,IAAuC;CAC7D,CAAC,QAAQ,+BAA+B;CACxC,CAAC,QAAQ,+BAA+B;CACxC,CAAC,UAAU,mCAAmC;CAC9C,CAAC,SAAS,qCAAqC;CAC/C,CAAC,UAAU,iCAAiC;CAC5C,CAAC,WAAW,mBAAmB;CAChC,CAAC;AAYF,SAAgB,kBAAkB,EAChC,OACA,MAAM,KACN,WAAW,WACX,OACA,iBAAiB,OACjB,OAAO,MACP,aACyB;CACzB,MAAM,aAAa,MAAM,IAAI,KAAK,IAAI,KAAK,IAAK,QAAQ,MAAO,KAAK,EAAE,EAAE,IAAI,GAAG;CAC/E,MAAM,YAAY,YAAY,IAAI,SAAS,IAAI;CAE/C,MAAM,cAAc,SAAS,OAAO,UAAU,SAAS,OAAO,QAAQ;AAEtE,QACE,qBAAC;EAAI,WAAW,GAAG,UAAU,UAAU;cACnC,SAAS,mBACT,qBAAC;GAAI,WAAU;cACZ,SACC,oBAAC;IAAK,WAAU;cACb;KACI,EAER,kBACC,qBAAC;IAAK,WAAU;eACb,KAAK,MAAM,WAAW,EAAC;KACnB;IAEL,EAER,oBAAC;GACC,WAAW,GACT,4EACA,YACD;aAED,oBAAC;IACC,WAAW,GACT,4DACA,UACD;IACD,OAAO,EAAE,OAAO,GAAG,WAAW,IAAI;KAClC;IACE;GACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/separator.d.ts
|
|
4
|
+
type DesignSeparatorProps = {
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
declare function DesignSeparator({
|
|
8
|
+
orientation,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: DesignSeparatorProps): react_jsx_runtime0.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { DesignSeparator, DesignSeparatorProps };
|
|
14
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","names":[],"sources":["../../../src/components/separator.tsx"],"mappings":";;;KAIY,oBAAA;EACV,WAAA;AAAA,IACE,KAAA,CAAM,cAAA,CAAe,cAAA;AAAA,iBAET,eAAA,CAAA;EACd,WAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,oBAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stackframe/stack-ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/separator.tsx
|
|
7
|
+
function DesignSeparator({ orientation = "horizontal", className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
role: "separator",
|
|
10
|
+
"aria-orientation": orientation,
|
|
11
|
+
className: cn(orientation === "horizontal" ? "h-[1px] w-full bg-black/[0.08] dark:bg-white/[0.06]" : "w-[1px] h-full bg-black/[0.08] dark:bg-white/[0.06]", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DesignSeparator };
|
|
18
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/separator.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@stackframe/stack-ui\";\n\nexport type DesignSeparatorProps = {\n orientation?: \"horizontal\" | \"vertical\",\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport function DesignSeparator({\n orientation = \"horizontal\",\n className,\n ...props\n}: DesignSeparatorProps) {\n return (\n <div\n role=\"separator\"\n aria-orientation={orientation}\n className={cn(\n orientation === \"horizontal\"\n ? \"h-[1px] w-full bg-black/[0.08] dark:bg-white/[0.06]\"\n : \"w-[1px] h-full bg-black/[0.08] dark:bg-white/[0.06]\",\n className\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;AAQA,SAAgB,gBAAgB,EAC9B,cAAc,cACd,WACA,GAAG,SACoB;AACvB,QACE,oBAAC;EACC,MAAK;EACL,oBAAkB;EAClB,WAAW,GACT,gBAAgB,eACZ,wDACA,uDACJ,UACD;EACD,GAAI;GACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/skeleton.d.ts
|
|
5
|
+
type DesignSkeletonProps = React.HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
declare function DesignSkeleton({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: DesignSkeletonProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { DesignSkeleton, DesignSkeletonProps };
|
|
12
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","names":[],"sources":["../../../src/components/skeleton.tsx"],"mappings":";;;;KAKY,mBAAA,GAAsB,KAAA,CAAM,cAAA,CAAe,cAAA;AAAA,iBAEvC,cAAA,CAAA;EAAiB,SAAA;EAAA,GAAc;AAAA,GAAS,mBAAA,GAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stackframe/stack-ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/skeleton.tsx
|
|
7
|
+
function DesignSkeleton({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
className: cn("animate-pulse rounded-md bg-black/[0.06] dark:bg-white/[0.06]", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { DesignSkeleton };
|
|
16
|
+
//# sourceMappingURL=skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":[],"sources":["../../../src/components/skeleton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"@stackframe/stack-ui\";\nimport type React from \"react\";\n\nexport type DesignSkeletonProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport function DesignSkeleton({ className, ...props }: DesignSkeletonProps) {\n return (\n <div\n className={cn(\n \"animate-pulse rounded-md bg-black/[0.06] dark:bg-white/[0.06]\",\n className\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;AAOA,SAAgB,eAAe,EAAE,WAAW,GAAG,SAA8B;AAC3E,QACE,oBAAC;EACC,WAAW,GACT,iEACA,UACD;EACD,GAAI;GACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/table.d.ts
|
|
4
|
+
declare const DesignTable: React.FC<React.HTMLAttributes<HTMLTableElement> & {
|
|
5
|
+
ref?: React.Ref<HTMLTableElement> | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
declare const DesignTableHeader: React.FC<React.HTMLAttributes<HTMLTableSectionElement> & {
|
|
8
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
declare const DesignTableBody: React.FC<React.HTMLAttributes<HTMLTableSectionElement> & {
|
|
11
|
+
ref?: React.Ref<HTMLTableSectionElement> | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
declare const DesignTableRow: React.FC<React.HTMLAttributes<HTMLTableRowElement> & {
|
|
14
|
+
ref?: React.Ref<HTMLTableRowElement> | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
declare const DesignTableHead: React.FC<React.ThHTMLAttributes<HTMLTableCellElement> & {
|
|
17
|
+
ref?: React.Ref<HTMLTableCellElement> | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
declare const DesignTableCell: React.FC<React.TdHTMLAttributes<HTMLTableCellElement> & {
|
|
20
|
+
ref?: React.Ref<HTMLTableCellElement> | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow };
|
|
24
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","names":[],"sources":["../../../src/components/table.tsx"],"mappings":";;;cAMa,WAAA,EAAW,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,gBAAA;;;cAcX,iBAAA,EAAiB,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,uBAAA;;;cAYjB,eAAA,EAAe,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,uBAAA;;;cAYf,cAAA,EAAc,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,mBAAA;;;cAed,eAAA,EAAe,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,gBAAA,CAAA,oBAAA;;;cAef,eAAA,EAAe,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,gBAAA,CAAA,oBAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stackframe/stack-ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/table.tsx
|
|
9
|
+
const DesignTable = forwardRefIfNeeded(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: "relative w-full overflow-auto",
|
|
11
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
12
|
+
ref,
|
|
13
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
14
|
+
...props
|
|
15
|
+
})
|
|
16
|
+
}));
|
|
17
|
+
DesignTable.displayName = "DesignTable";
|
|
18
|
+
const DesignTableHeader = forwardRefIfNeeded(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", {
|
|
19
|
+
ref,
|
|
20
|
+
className: cn("bg-foreground/[0.02] [&_tr]:border-b [&_tr]:border-black/[0.06] dark:[&_tr]:border-white/[0.06]", className),
|
|
21
|
+
...props
|
|
22
|
+
}));
|
|
23
|
+
DesignTableHeader.displayName = "DesignTableHeader";
|
|
24
|
+
const DesignTableBody = forwardRefIfNeeded(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", {
|
|
25
|
+
ref,
|
|
26
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
27
|
+
...props
|
|
28
|
+
}));
|
|
29
|
+
DesignTableBody.displayName = "DesignTableBody";
|
|
30
|
+
const DesignTableRow = forwardRefIfNeeded(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", {
|
|
31
|
+
ref,
|
|
32
|
+
className: cn("border-b border-black/[0.06] dark:border-white/[0.06] transition-colors duration-150 hover:transition-none hover:bg-foreground/[0.04] data-[state=selected]:bg-foreground/[0.06]", className),
|
|
33
|
+
...props
|
|
34
|
+
}));
|
|
35
|
+
DesignTableRow.displayName = "DesignTableRow";
|
|
36
|
+
const DesignTableHead = forwardRefIfNeeded(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
37
|
+
ref,
|
|
38
|
+
className: cn("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
39
|
+
...props
|
|
40
|
+
}));
|
|
41
|
+
DesignTableHead.displayName = "DesignTableHead";
|
|
42
|
+
const DesignTableCell = forwardRefIfNeeded(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", {
|
|
43
|
+
ref,
|
|
44
|
+
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
45
|
+
...props
|
|
46
|
+
}));
|
|
47
|
+
DesignTableCell.displayName = "DesignTableCell";
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow };
|
|
51
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../../src/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRefIfNeeded } from \"@stackframe/stack-shared/dist/utils/react\";\nimport { cn } from \"@stackframe/stack-ui\";\nimport React from \"react\";\n\nexport const DesignTable = forwardRefIfNeeded<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n));\nDesignTable.displayName = \"DesignTable\";\n\nexport const DesignTableHeader = forwardRefIfNeeded<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={cn(\"bg-foreground/[0.02] [&_tr]:border-b [&_tr]:border-black/[0.06] dark:[&_tr]:border-white/[0.06]\", className)}\n {...props}\n />\n));\nDesignTableHeader.displayName = \"DesignTableHeader\";\n\nexport const DesignTableBody = forwardRefIfNeeded<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n));\nDesignTableBody.displayName = \"DesignTableBody\";\n\nexport const DesignTableRow = forwardRefIfNeeded<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b border-black/[0.06] dark:border-white/[0.06] transition-colors duration-150 hover:transition-none hover:bg-foreground/[0.04] data-[state=selected]:bg-foreground/[0.06]\",\n className\n )}\n {...props}\n />\n));\nDesignTableRow.displayName = \"DesignTableRow\";\n\nexport const DesignTableHead = forwardRefIfNeeded<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n \"h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n));\nDesignTableHead.displayName = \"DesignTableHead\";\n\nexport const DesignTableCell = forwardRefIfNeeded<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n \"p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n));\nDesignTableCell.displayName = \"DesignTableCell\";\n"],"mappings":";;;;;;;;AAMA,MAAa,cAAc,oBAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CAAI,WAAU;WACb,oBAAC;EACM;EACL,WAAW,GAAG,iCAAiC,UAAU;EACzD,GAAI;GACJ;EACE,CACN;AACF,YAAY,cAAc;AAE1B,MAAa,oBAAoB,oBAG9B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,mGAAmG,UAAU;CAC3H,GAAI;EACJ,CACF;AACF,kBAAkB,cAAc;AAEhC,MAAa,kBAAkB,oBAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,8BAA8B,UAAU;CACtD,GAAI;EACJ,CACF;AACF,gBAAgB,cAAc;AAE9B,MAAa,iBAAiB,oBAG3B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GACT,oLACA,UACD;CACD,GAAI;EACJ,CACF;AACF,eAAe,cAAc;AAE7B,MAAa,kBAAkB,oBAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GACT,0IACA,UACD;CACD,GAAI;EACJ,CACF;AACF,gBAAgB,cAAc;AAE9B,MAAa,kBAAkB,oBAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GACT,wFACA,UACD;CACD,GAAI;EACJ,CACF;AACF,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/tabs.d.ts
|
|
4
|
+
type DesignTabsSize = "sm" | "md";
|
|
5
|
+
type DesignTabsGradient = "blue" | "cyan" | "purple" | "green" | "orange" | "default";
|
|
6
|
+
type DesignCategoryTabItem = {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
count?: number;
|
|
10
|
+
badgeCount?: number;
|
|
11
|
+
};
|
|
12
|
+
type DesignCategoryTabsProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
13
|
+
categories: DesignCategoryTabItem[];
|
|
14
|
+
selectedCategory: string;
|
|
15
|
+
onSelect: (id: string) => void | Promise<void>;
|
|
16
|
+
showBadge?: boolean;
|
|
17
|
+
size?: DesignTabsSize;
|
|
18
|
+
glassmorphic?: boolean;
|
|
19
|
+
gradient?: DesignTabsGradient;
|
|
20
|
+
};
|
|
21
|
+
declare function DesignCategoryTabs({
|
|
22
|
+
categories,
|
|
23
|
+
selectedCategory,
|
|
24
|
+
onSelect,
|
|
25
|
+
showBadge,
|
|
26
|
+
size,
|
|
27
|
+
glassmorphic: glassmorphicProp,
|
|
28
|
+
gradient,
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: DesignCategoryTabsProps): react_jsx_runtime0.JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { DesignCategoryTabItem, DesignCategoryTabs, DesignCategoryTabsProps };
|
|
34
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","names":[],"sources":["../../../src/components/tabs.tsx"],"mappings":";;;KAOK,cAAA;AAAA,KACA,kBAAA;AAAA,KAEO,qBAAA;EACV,EAAA;EACA,KAAA;EACA,KAAA;EACA,UAAA;AAAA;AAAA,KAGU,uBAAA,GAA0B,IAAA,CAAK,KAAA,CAAM,cAAA;EAC/C,UAAA,EAAY,qBAAA;EACZ,gBAAA;EACA,QAAA,GAAW,EAAA,oBAAsB,OAAA;EACjC,SAAA;EACA,IAAA,GAAO,cAAA;EACP,YAAA;EACA,QAAA,GAAW,kBAAA;AAAA;AAAA,iBA8EG,kBAAA,CAAA;EACd,UAAA;EACA,gBAAA;EACA,QAAA;EACA,SAAA;EACA,IAAA;EACA,YAAA,EAAc,gBAAA;EACd,QAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Spinner, cn } from "@stackframe/stack-ui";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { runAsynchronouslyWithAlert } from "@stackframe/stack-shared/dist/utils/promises";
|
|
7
|
+
import { useGlassmorphicDefault } from "./card.js";
|
|
8
|
+
|
|
9
|
+
//#region src/components/tabs.tsx
|
|
10
|
+
const tabSizeClasses = new Map([["sm", {
|
|
11
|
+
button: "px-3 py-2 text-xs",
|
|
12
|
+
badge: "text-[10px] px-1.5 py-0.5"
|
|
13
|
+
}], ["md", {
|
|
14
|
+
button: "px-4 py-3 text-sm",
|
|
15
|
+
badge: "text-xs px-1.5 py-0.5"
|
|
16
|
+
}]]);
|
|
17
|
+
const gradientClasses = new Map([
|
|
18
|
+
["blue", {
|
|
19
|
+
activeText: "text-blue-700 dark:text-blue-400",
|
|
20
|
+
activeBadge: "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400",
|
|
21
|
+
underline: "bg-blue-700 dark:bg-blue-400"
|
|
22
|
+
}],
|
|
23
|
+
["cyan", {
|
|
24
|
+
activeText: "text-cyan-700 dark:text-cyan-300",
|
|
25
|
+
activeBadge: "bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300",
|
|
26
|
+
underline: "bg-cyan-600 dark:bg-cyan-400"
|
|
27
|
+
}],
|
|
28
|
+
["purple", {
|
|
29
|
+
activeText: "text-purple-700 dark:text-purple-300",
|
|
30
|
+
activeBadge: "bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300",
|
|
31
|
+
underline: "bg-purple-600 dark:bg-purple-400"
|
|
32
|
+
}],
|
|
33
|
+
["green", {
|
|
34
|
+
activeText: "text-emerald-700 dark:text-emerald-300",
|
|
35
|
+
activeBadge: "bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300",
|
|
36
|
+
underline: "bg-emerald-600 dark:bg-emerald-400"
|
|
37
|
+
}],
|
|
38
|
+
["orange", {
|
|
39
|
+
activeText: "text-amber-700 dark:text-amber-300",
|
|
40
|
+
activeBadge: "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300",
|
|
41
|
+
underline: "bg-amber-600 dark:bg-amber-400"
|
|
42
|
+
}],
|
|
43
|
+
["default", {
|
|
44
|
+
activeText: "text-foreground",
|
|
45
|
+
activeBadge: "bg-foreground/10 text-foreground",
|
|
46
|
+
underline: "bg-foreground/80"
|
|
47
|
+
}]
|
|
48
|
+
]);
|
|
49
|
+
function getMapValueOrThrow(map, key, mapName) {
|
|
50
|
+
const value = map.get(key);
|
|
51
|
+
if (!value) throw new Error(`Missing ${mapName} entry for key "${String(key)}"`);
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
function DesignCategoryTabs({ categories, selectedCategory, onSelect, showBadge = true, size = "sm", glassmorphic: glassmorphicProp, gradient = "blue", className, ...props }) {
|
|
55
|
+
const glassmorphic = useGlassmorphicDefault(glassmorphicProp);
|
|
56
|
+
const sizeClass = getMapValueOrThrow(tabSizeClasses, size, "tabSizeClasses");
|
|
57
|
+
const gradientClass = getMapValueOrThrow(gradientClasses, gradient, "gradientClasses");
|
|
58
|
+
const [loadingCategoryId, setLoadingCategoryId] = useState(null);
|
|
59
|
+
const handleSelect = (categoryId) => {
|
|
60
|
+
const result = onSelect(categoryId);
|
|
61
|
+
if (result && typeof result.then === "function") {
|
|
62
|
+
setLoadingCategoryId(categoryId);
|
|
63
|
+
runAsynchronouslyWithAlert(Promise.resolve(result).finally(() => setLoadingCategoryId(null)));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ jsx("div", {
|
|
67
|
+
className: cn("flex items-center gap-1 overflow-x-auto flex-nowrap [&::-webkit-scrollbar]:hidden", glassmorphic ? "rounded-xl bg-black/[0.08] dark:bg-white/[0.04] p-1 backdrop-blur-sm" : "border-b border-gray-300 dark:border-gray-800", className),
|
|
68
|
+
...props,
|
|
69
|
+
children: categories.map((category) => {
|
|
70
|
+
const isActive = selectedCategory === category.id;
|
|
71
|
+
const badgeValue = category.badgeCount ?? category.count;
|
|
72
|
+
const shouldShowBadge = showBadge && badgeValue !== void 0;
|
|
73
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
74
|
+
onClick: () => handleSelect(category.id),
|
|
75
|
+
disabled: loadingCategoryId !== null,
|
|
76
|
+
className: cn("font-medium transition-all duration-150 hover:transition-none relative flex flex-shrink-0 items-center justify-center gap-2 whitespace-nowrap", "hover:text-gray-900 dark:hover:text-gray-100", sizeClass.button, glassmorphic ? "rounded-lg" : "", isActive ? cn(gradientClass.activeText, glassmorphic && "bg-background shadow-sm ring-1 ring-black/[0.12] dark:ring-white/[0.06]") : "text-gray-700 dark:text-gray-400"),
|
|
77
|
+
children: [
|
|
78
|
+
loadingCategoryId === category.id && /* @__PURE__ */ jsx(Spinner, {
|
|
79
|
+
size: 12,
|
|
80
|
+
className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsxs("span", {
|
|
83
|
+
className: cn("flex items-center gap-2", loadingCategoryId === category.id && "invisible"),
|
|
84
|
+
children: [category.label, shouldShowBadge && /* @__PURE__ */ jsx("span", {
|
|
85
|
+
className: cn("rounded-full", sizeClass.badge, isActive ? gradientClass.activeBadge : "bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400"),
|
|
86
|
+
children: badgeValue
|
|
87
|
+
})]
|
|
88
|
+
}),
|
|
89
|
+
!glassmorphic && isActive && /* @__PURE__ */ jsx("div", { className: cn("absolute bottom-0 left-0 right-0 h-0.5", gradientClass.underline) })
|
|
90
|
+
]
|
|
91
|
+
}, category.id);
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
export { DesignCategoryTabs };
|
|
98
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","names":[],"sources":["../../../src/components/tabs.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { cn, Spinner } from \"@stackframe/stack-ui\";\nimport { runAsynchronouslyWithAlert } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { useGlassmorphicDefault } from \"./card\";\n\ntype DesignTabsSize = \"sm\" | \"md\";\ntype DesignTabsGradient = \"blue\" | \"cyan\" | \"purple\" | \"green\" | \"orange\" | \"default\";\n\nexport type DesignCategoryTabItem = {\n id: string,\n label: string,\n count?: number,\n badgeCount?: number,\n};\n\nexport type DesignCategoryTabsProps = Omit<React.ComponentProps<\"div\">, \"onSelect\"> & {\n categories: DesignCategoryTabItem[],\n selectedCategory: string,\n onSelect: (id: string) => void | Promise<void>,\n showBadge?: boolean,\n size?: DesignTabsSize,\n glassmorphic?: boolean,\n gradient?: DesignTabsGradient,\n};\n\ntype TabSizeClass = {\n button: string,\n badge: string,\n};\n\ntype GradientClass = {\n activeText: string,\n activeBadge: string,\n underline: string,\n};\n\nconst tabSizeClasses = new Map<DesignTabsSize, TabSizeClass>([\n [\"sm\", { button: \"px-3 py-2 text-xs\", badge: \"text-[10px] px-1.5 py-0.5\" }],\n [\"md\", { button: \"px-4 py-3 text-sm\", badge: \"text-xs px-1.5 py-0.5\" }],\n]);\n\nconst gradientClasses = new Map<DesignTabsGradient, GradientClass>([\n [\n \"blue\",\n {\n activeText: \"text-blue-700 dark:text-blue-400\",\n activeBadge: \"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400\",\n underline: \"bg-blue-700 dark:bg-blue-400\",\n },\n ],\n [\n \"cyan\",\n {\n activeText: \"text-cyan-700 dark:text-cyan-300\",\n activeBadge: \"bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300\",\n underline: \"bg-cyan-600 dark:bg-cyan-400\",\n },\n ],\n [\n \"purple\",\n {\n activeText: \"text-purple-700 dark:text-purple-300\",\n activeBadge: \"bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300\",\n underline: \"bg-purple-600 dark:bg-purple-400\",\n },\n ],\n [\n \"green\",\n {\n activeText: \"text-emerald-700 dark:text-emerald-300\",\n activeBadge: \"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300\",\n underline: \"bg-emerald-600 dark:bg-emerald-400\",\n },\n ],\n [\n \"orange\",\n {\n activeText: \"text-amber-700 dark:text-amber-300\",\n activeBadge: \"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300\",\n underline: \"bg-amber-600 dark:bg-amber-400\",\n },\n ],\n [\n \"default\",\n {\n activeText: \"text-foreground\",\n activeBadge: \"bg-foreground/10 text-foreground\",\n underline: \"bg-foreground/80\",\n },\n ],\n]);\n\nfunction getMapValueOrThrow<TKey, TValue>(map: Map<TKey, TValue>, key: TKey, mapName: string) {\n const value = map.get(key);\n if (!value) {\n throw new Error(`Missing ${mapName} entry for key \"${String(key)}\"`);\n }\n return value;\n}\n\nexport function DesignCategoryTabs({\n categories,\n selectedCategory,\n onSelect,\n showBadge = true,\n size = \"sm\",\n glassmorphic: glassmorphicProp,\n gradient = \"blue\",\n className,\n ...props\n}: DesignCategoryTabsProps) {\n const glassmorphic = useGlassmorphicDefault(glassmorphicProp);\n const sizeClass = getMapValueOrThrow(tabSizeClasses, size, \"tabSizeClasses\");\n const gradientClass = getMapValueOrThrow(gradientClasses, gradient, \"gradientClasses\");\n const [loadingCategoryId, setLoadingCategoryId] = useState<string | null>(null);\n\n const handleSelect = (categoryId: string) => {\n const result = onSelect(categoryId);\n if (result && typeof (result as Promise<void>).then === \"function\") {\n setLoadingCategoryId(categoryId);\n runAsynchronouslyWithAlert(\n Promise.resolve(result).finally(() => setLoadingCategoryId(null))\n );\n }\n };\n\n return (\n <div\n className={cn(\n \"flex items-center gap-1 overflow-x-auto flex-nowrap [&::-webkit-scrollbar]:hidden\",\n glassmorphic\n ? \"rounded-xl bg-black/[0.08] dark:bg-white/[0.04] p-1 backdrop-blur-sm\"\n : \"border-b border-gray-300 dark:border-gray-800\",\n className\n )}\n {...props}\n >\n {categories.map((category) => {\n const isActive = selectedCategory === category.id;\n const badgeValue = category.badgeCount ?? category.count;\n const shouldShowBadge = showBadge && badgeValue !== undefined;\n\n return (\n <button\n key={category.id}\n onClick={() => handleSelect(category.id)}\n disabled={loadingCategoryId !== null}\n className={cn(\n \"font-medium transition-all duration-150 hover:transition-none relative flex flex-shrink-0 items-center justify-center gap-2 whitespace-nowrap\",\n \"hover:text-gray-900 dark:hover:text-gray-100\",\n sizeClass.button,\n glassmorphic ? \"rounded-lg\" : \"\",\n isActive\n ? cn(\n gradientClass.activeText,\n glassmorphic && \"bg-background shadow-sm ring-1 ring-black/[0.12] dark:ring-white/[0.06]\"\n )\n : \"text-gray-700 dark:text-gray-400\"\n )}\n >\n {loadingCategoryId === category.id && (\n <Spinner\n size={12}\n className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none\"\n />\n )}\n <span className={cn(\n \"flex items-center gap-2\",\n loadingCategoryId === category.id && \"invisible\"\n )}>\n {category.label}\n {shouldShowBadge && (\n <span\n className={cn(\n \"rounded-full\",\n sizeClass.badge,\n isActive\n ? gradientClass.activeBadge\n : \"bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400\"\n )}\n >\n {badgeValue}\n </span>\n )}\n </span>\n {!glassmorphic && isActive && (\n <div className={cn(\"absolute bottom-0 left-0 right-0 h-0.5\", gradientClass.underline)} />\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAsCA,MAAM,iBAAiB,IAAI,IAAkC,CAC3D,CAAC,MAAM;CAAE,QAAQ;CAAqB,OAAO;CAA6B,CAAC,EAC3E,CAAC,MAAM;CAAE,QAAQ;CAAqB,OAAO;CAAyB,CAAC,CACxE,CAAC;AAEF,MAAM,kBAAkB,IAAI,IAAuC;CACjE,CACE,QACA;EACE,YAAY;EACZ,aAAa;EACb,WAAW;EACZ,CACF;CACD,CACE,QACA;EACE,YAAY;EACZ,aAAa;EACb,WAAW;EACZ,CACF;CACD,CACE,UACA;EACE,YAAY;EACZ,aAAa;EACb,WAAW;EACZ,CACF;CACD,CACE,SACA;EACE,YAAY;EACZ,aAAa;EACb,WAAW;EACZ,CACF;CACD,CACE,UACA;EACE,YAAY;EACZ,aAAa;EACb,WAAW;EACZ,CACF;CACD,CACE,WACA;EACE,YAAY;EACZ,aAAa;EACb,WAAW;EACZ,CACF;CACF,CAAC;AAEF,SAAS,mBAAiC,KAAwB,KAAW,SAAiB;CAC5F,MAAM,QAAQ,IAAI,IAAI,IAAI;AAC1B,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,WAAW,QAAQ,kBAAkB,OAAO,IAAI,CAAC,GAAG;AAEtE,QAAO;;AAGT,SAAgB,mBAAmB,EACjC,YACA,kBACA,UACA,YAAY,MACZ,OAAO,MACP,cAAc,kBACd,WAAW,QACX,WACA,GAAG,SACuB;CAC1B,MAAM,eAAe,uBAAuB,iBAAiB;CAC7D,MAAM,YAAY,mBAAmB,gBAAgB,MAAM,iBAAiB;CAC5E,MAAM,gBAAgB,mBAAmB,iBAAiB,UAAU,kBAAkB;CACtF,MAAM,CAAC,mBAAmB,wBAAwB,SAAwB,KAAK;CAE/E,MAAM,gBAAgB,eAAuB;EAC3C,MAAM,SAAS,SAAS,WAAW;AACnC,MAAI,UAAU,OAAQ,OAAyB,SAAS,YAAY;AAClE,wBAAqB,WAAW;AAChC,8BACE,QAAQ,QAAQ,OAAO,CAAC,cAAc,qBAAqB,KAAK,CAAC,CAClE;;;AAIL,QACE,oBAAC;EACC,WAAW,GACT,qFACA,eACI,yEACA,iDACJ,UACD;EACD,GAAI;YAEH,WAAW,KAAK,aAAa;GAC5B,MAAM,WAAW,qBAAqB,SAAS;GAC/C,MAAM,aAAa,SAAS,cAAc,SAAS;GACnD,MAAM,kBAAkB,aAAa,eAAe;AAEpD,UACE,qBAAC;IAEC,eAAe,aAAa,SAAS,GAAG;IACxC,UAAU,sBAAsB;IAChC,WAAW,GACT,iJACA,gDACA,UAAU,QACV,eAAe,eAAe,IAC9B,WACI,GACA,cAAc,YACd,gBAAgB,0EACjB,GACC,mCACL;;KAEA,sBAAsB,SAAS,MAC9B,oBAAC;MACC,MAAM;MACN,WAAU;OACV;KAEJ,qBAAC;MAAK,WAAW,GACf,2BACA,sBAAsB,SAAS,MAAM,YACtC;iBACE,SAAS,OACT,mBACC,oBAAC;OACC,WAAW,GACT,gBACA,UAAU,OACV,WACI,cAAc,cACd,gEACL;iBAEA;QACI;OAEJ;KACN,CAAC,gBAAgB,YAChB,oBAAC,SAAI,WAAW,GAAG,0CAA0C,cAAc,UAAU,GAAI;;MA1CtF,SAAS,GA4CP;IAEX;GACE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DesignAlert, DesignAlertProps } from "./components/alert";
|
|
2
|
+
import { DesignBadge, DesignBadgeColor, DesignBadgeContentMode, DesignBadgeProps, DesignBadgeSize } from "./components/badge";
|
|
3
|
+
import { DesignButton, DesignButtonProps, DesignOriginalButtonProps } from "./components/button";
|
|
4
|
+
import { DesignCard, DesignCardProps, DesignCardTint, DesignCardTintProps, useGlassmorphicDefault, useInsideDesignCard } from "./components/card";
|
|
5
|
+
import { CursorBlastEffect, CursorBlastEffectProps } from "./components/cursor-blast-effect";
|
|
6
|
+
import { DesignEditMode, useDesignEditMode } from "./components/edit-mode";
|
|
7
|
+
import { DesignInput, DesignInputProps } from "./components/input";
|
|
8
|
+
import { DesignPillToggle, DesignPillToggleOption, DesignPillToggleProps } from "./components/pill-toggle";
|
|
9
|
+
import { DesignSeparator, DesignSeparatorProps } from "./components/separator";
|
|
10
|
+
import { DesignSkeleton, DesignSkeletonProps } from "./components/skeleton";
|
|
11
|
+
import { DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow } from "./components/table";
|
|
12
|
+
import { DesignCategoryTabItem, DesignCategoryTabs, DesignCategoryTabsProps } from "./components/tabs";
|
|
13
|
+
import { DESIGN_CHART_AXIS_TICK_STYLE, DESIGN_CHART_COLORS, DESIGN_CHART_GRID_COLOR, DesignChartColorEntry, DesignChartColorName, getDesignChartColor } from "./components/chart-theme";
|
|
14
|
+
import { DesignChartConfig, DesignChartContainer, DesignChartStyle, getPayloadConfigFromPayload, useDesignChart } from "./components/chart-container";
|
|
15
|
+
import { DesignChartTooltip, DesignChartTooltipContent } from "./components/chart-tooltip";
|
|
16
|
+
import { DesignChartLegend, DesignChartLegendContent } from "./components/chart-legend";
|
|
17
|
+
import { DesignChartCard, DesignChartCardProps } from "./components/chart-card";
|
|
18
|
+
import { DesignMetricCard, DesignMetricCardProps, DesignMetricCardTrend } from "./components/metric-card";
|
|
19
|
+
import { DesignProgressBar, DesignProgressBarProps } from "./components/progress-bar";
|
|
20
|
+
import { DesignEmptyState, DesignEmptyStateProps } from "./components/empty-state";
|
|
21
|
+
export { CursorBlastEffect, type CursorBlastEffectProps, DESIGN_CHART_AXIS_TICK_STYLE, DESIGN_CHART_COLORS, DESIGN_CHART_GRID_COLOR, DesignAlert, type DesignAlertProps, DesignBadge, type DesignBadgeColor, type DesignBadgeContentMode, type DesignBadgeProps, type DesignBadgeSize, DesignButton, type DesignButtonProps, DesignCard, type DesignCardProps, DesignCardTint, type DesignCardTintProps, type DesignCategoryTabItem, DesignCategoryTabs, type DesignCategoryTabsProps, DesignChartCard, type DesignChartCardProps, type DesignChartColorEntry, type DesignChartColorName, type DesignChartConfig, DesignChartContainer, DesignChartLegend, DesignChartLegendContent, DesignChartStyle, DesignChartTooltip, DesignChartTooltipContent, DesignEditMode, DesignEmptyState, type DesignEmptyStateProps, DesignInput, type DesignInputProps, DesignMetricCard, type DesignMetricCardProps, type DesignMetricCardTrend, type DesignOriginalButtonProps, DesignPillToggle, type DesignPillToggleOption, type DesignPillToggleProps, DesignProgressBar, type DesignProgressBarProps, DesignSeparator, type DesignSeparatorProps, DesignSkeleton, type DesignSkeletonProps, DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow, getDesignChartColor, getPayloadConfigFromPayload, useDesignChart, useDesignEditMode, useGlassmorphicDefault, useInsideDesignCard };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DesignAlert } from "./components/alert.js";
|
|
2
|
+
import { DesignBadge } from "./components/badge.js";
|
|
3
|
+
import { DesignButton } from "./components/button.js";
|
|
4
|
+
import { DesignCard, DesignCardTint, useGlassmorphicDefault, useInsideDesignCard } from "./components/card.js";
|
|
5
|
+
import { CursorBlastEffect } from "./components/cursor-blast-effect.js";
|
|
6
|
+
import { DesignEditMode, useDesignEditMode } from "./components/edit-mode.js";
|
|
7
|
+
import { DesignInput } from "./components/input.js";
|
|
8
|
+
import { DesignPillToggle } from "./components/pill-toggle.js";
|
|
9
|
+
import { DesignSeparator } from "./components/separator.js";
|
|
10
|
+
import { DesignSkeleton } from "./components/skeleton.js";
|
|
11
|
+
import { DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow } from "./components/table.js";
|
|
12
|
+
import { DesignCategoryTabs } from "./components/tabs.js";
|
|
13
|
+
import { DESIGN_CHART_AXIS_TICK_STYLE, DESIGN_CHART_COLORS, DESIGN_CHART_GRID_COLOR, getDesignChartColor } from "./components/chart-theme.js";
|
|
14
|
+
import { DesignChartContainer, DesignChartStyle, getPayloadConfigFromPayload, useDesignChart } from "./components/chart-container.js";
|
|
15
|
+
import { DesignChartTooltip, DesignChartTooltipContent } from "./components/chart-tooltip.js";
|
|
16
|
+
import { DesignChartLegend, DesignChartLegendContent } from "./components/chart-legend.js";
|
|
17
|
+
import { DesignChartCard } from "./components/chart-card.js";
|
|
18
|
+
import { DesignMetricCard } from "./components/metric-card.js";
|
|
19
|
+
import { DesignProgressBar } from "./components/progress-bar.js";
|
|
20
|
+
import { DesignEmptyState } from "./components/empty-state.js";
|
|
21
|
+
|
|
22
|
+
export { CursorBlastEffect, DESIGN_CHART_AXIS_TICK_STYLE, DESIGN_CHART_COLORS, DESIGN_CHART_GRID_COLOR, DesignAlert, DesignBadge, DesignButton, DesignCard, DesignCardTint, DesignCategoryTabs, DesignChartCard, DesignChartContainer, DesignChartLegend, DesignChartLegendContent, DesignChartStyle, DesignChartTooltip, DesignChartTooltipContent, DesignEditMode, DesignEmptyState, DesignInput, DesignMetricCard, DesignPillToggle, DesignProgressBar, DesignSeparator, DesignSkeleton, DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow, getDesignChartColor, getPayloadConfigFromPayload, useDesignChart, useDesignEditMode, useGlassmorphicDefault, useInsideDesignCard };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DesignAlert, DesignAlertProps } from "./components/alert.js";
|
|
2
|
+
import { DesignBadge, DesignBadgeColor, DesignBadgeContentMode, DesignBadgeProps, DesignBadgeSize } from "./components/badge.js";
|
|
3
|
+
import { DesignButton, DesignButtonProps, DesignOriginalButtonProps } from "./components/button.js";
|
|
4
|
+
import { DesignCard, DesignCardProps, DesignCardTint, DesignCardTintProps, useGlassmorphicDefault, useInsideDesignCard } from "./components/card.js";
|
|
5
|
+
import { DesignChartCard, DesignChartCardProps } from "./components/chart-card.js";
|
|
6
|
+
import { DesignChartConfig, DesignChartContainer, DesignChartStyle, getPayloadConfigFromPayload, useDesignChart } from "./components/chart-container.js";
|
|
7
|
+
import { DesignChartLegend, DesignChartLegendContent } from "./components/chart-legend.js";
|
|
8
|
+
import { DESIGN_CHART_AXIS_TICK_STYLE, DESIGN_CHART_COLORS, DESIGN_CHART_GRID_COLOR, DesignChartColorEntry, DesignChartColorName, getDesignChartColor } from "./components/chart-theme.js";
|
|
9
|
+
import { DesignChartTooltip, DesignChartTooltipContent } from "./components/chart-tooltip.js";
|
|
10
|
+
import { CursorBlastEffect, CursorBlastEffectProps } from "./components/cursor-blast-effect.js";
|
|
11
|
+
import { DesignEditMode, useDesignEditMode } from "./components/edit-mode.js";
|
|
12
|
+
import { DesignEmptyState, DesignEmptyStateProps } from "./components/empty-state.js";
|
|
13
|
+
import { DesignInput, DesignInputProps } from "./components/input.js";
|
|
14
|
+
import { DesignMetricCard, DesignMetricCardProps, DesignMetricCardTrend } from "./components/metric-card.js";
|
|
15
|
+
import { DesignPillToggle, DesignPillToggleOption, DesignPillToggleProps } from "./components/pill-toggle.js";
|
|
16
|
+
import { DesignProgressBar, DesignProgressBarProps } from "./components/progress-bar.js";
|
|
17
|
+
import { DesignSeparator, DesignSeparatorProps } from "./components/separator.js";
|
|
18
|
+
import { DesignSkeleton, DesignSkeletonProps } from "./components/skeleton.js";
|
|
19
|
+
import { DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow } from "./components/table.js";
|
|
20
|
+
import { DesignCategoryTabItem, DesignCategoryTabs, DesignCategoryTabsProps } from "./components/tabs.js";
|
|
21
|
+
export { CursorBlastEffect, type CursorBlastEffectProps, DESIGN_CHART_AXIS_TICK_STYLE, DESIGN_CHART_COLORS, DESIGN_CHART_GRID_COLOR, DesignAlert, type DesignAlertProps, DesignBadge, type DesignBadgeColor, type DesignBadgeContentMode, type DesignBadgeProps, type DesignBadgeSize, DesignButton, type DesignButtonProps, DesignCard, type DesignCardProps, DesignCardTint, type DesignCardTintProps, type DesignCategoryTabItem, DesignCategoryTabs, type DesignCategoryTabsProps, DesignChartCard, type DesignChartCardProps, type DesignChartColorEntry, type DesignChartColorName, type DesignChartConfig, DesignChartContainer, DesignChartLegend, DesignChartLegendContent, DesignChartStyle, DesignChartTooltip, DesignChartTooltipContent, DesignEditMode, DesignEmptyState, type DesignEmptyStateProps, DesignInput, type DesignInputProps, DesignMetricCard, type DesignMetricCardProps, type DesignMetricCardTrend, type DesignOriginalButtonProps, DesignPillToggle, type DesignPillToggleOption, type DesignPillToggleProps, DesignProgressBar, type DesignProgressBarProps, DesignSeparator, type DesignSeparatorProps, DesignSkeleton, type DesignSkeletonProps, DesignTable, DesignTableBody, DesignTableCell, DesignTableHead, DesignTableHeader, DesignTableRow, getDesignChartColor, getPayloadConfigFromPayload, useDesignChart, useDesignEditMode, useGlassmorphicDefault, useInsideDesignCard };
|