@youwen/ai-design-system
Version:
Enterprise AI-driven design system with comprehensive design tokens
1,073 lines (1,072 loc) โข 251 kB
JavaScript
var yt = Object.defineProperty;
var xt = (a, e, t) => e in a ? yt(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
var V = (a, e, t) => (xt(a, typeof e != "symbol" ? e + "" : e, t), t);
import { B as Sa, b as Fa } from "./ui-3cbc7c26.mjs";
import { T as za, W as Ba, t as Aa, w as Ra } from "./layouts-49a39706.mjs";
import { jsx as s, jsxs as m } from "react/jsx-runtime";
import * as z from "react";
import { cva as $ } from "class-variance-authority";
import { c as A } from "./charts-563ee857.mjs";
import { F as ja, a as Ma, d as $a, g as La, f as Oa, b as Ia, e as Va, h as Pa } from "./charts-563ee857.mjs";
import "@radix-ui/react-slot";
import "clsx";
import "tailwind-merge";
const vt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), bt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
big: i,
medium: n,
...o
}, d) => {
const c = e.split(",").map((h) => h.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
vt({ size: t, padding: r }),
a
),
ref: d,
...o,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (c.includes("leftTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-big", style: { top: "5px", left: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium", style: { top: "30px", left: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (c.includes("rightTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-big text-right", style: { top: "5px", right: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium text-right", style: { top: "30px", right: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (c.includes("leftBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-big", style: { bottom: "30px", left: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium", style: { bottom: "5px", left: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (c.includes("rightBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-big text-right", style: { bottom: "30px", right: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium text-right", style: { bottom: "5px", right: "0px", width: "195px" }, children: n })
] }) })
] })
}
);
}
);
bt.displayName = "WidgetTitleTwoLinesBigMedium";
const wt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), kt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
medium: i,
small: n,
...o
}, d) => {
const c = e.split(",").map((h) => h.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
wt({ size: t, padding: r }),
a
),
ref: d,
...o,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (c.includes("leftTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium", style: { top: "5px", left: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small", style: { top: "30px", left: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (c.includes("rightTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium text-right", style: { top: "5px", right: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small text-right", style: { top: "30px", right: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (c.includes("leftBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small", style: { bottom: "30px", left: "0px", width: "195px" }, children: n }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium", style: { bottom: "5px", left: "0px", width: "195px" }, children: i })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (c.includes("rightBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small text-right", style: { bottom: "30px", right: "0px", width: "195px" }, children: n }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-medium text-right", style: { bottom: "5px", right: "0px", width: "195px" }, children: i })
] }) })
] })
}
);
}
);
kt.displayName = "WidgetTitleTwoLinesMediumSmall";
const _t = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Nt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
small: i,
mini: n,
...o
}, d) => {
const c = e.split(",").map((h) => h.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
_t({ size: t, padding: r }),
a
),
ref: d,
...o,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (c.includes("leftTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small", style: { top: "5px", left: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-mini", style: { top: "30px", left: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (c.includes("rightTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small text-right", style: { top: "5px", right: "0px", width: "195px" }, children: i }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-mini text-right", style: { top: "30px", right: "0px", width: "195px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (c.includes("leftBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-mini", style: { bottom: "30px", left: "0px", width: "195px" }, children: n }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small", style: { bottom: "5px", left: "0px", width: "195px" }, children: i })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (c.includes("rightBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "relative w-full h-full font-scto", children: [
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-mini text-right", style: { bottom: "30px", right: "0px", width: "195px" }, children: n }),
/* @__PURE__ */ s("div", { className: "absolute font-normal text-widget-small text-right", style: { bottom: "5px", right: "0px", width: "195px" }, children: i })
] }) })
] })
}
);
}
);
Nt.displayName = "WidgetTitleTwoLinesSmallMini";
const Tt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), St = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
medium: i,
small: n,
...o
}, d) => {
const c = e.split(",").map((h) => h.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
Tt({ size: t, padding: r }),
a
),
ref: d,
...o,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (c.includes("leftTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-start items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-medium", children: i }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (c.includes("rightTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-end items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: n }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-medium", children: i })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (c.includes("leftBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-start items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-medium", children: i }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (c.includes("rightBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-end items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: n }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-medium", children: i })
] }) })
] })
}
);
}
);
St.displayName = "WidgetTitleOneLineMediumSmall";
const Ft = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Ct = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
small: i,
mini: n,
...o
}, d) => {
const c = e.split(",").map((h) => h.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
Ft({ size: t, padding: r }),
a
),
ref: d,
...o,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (c.includes("leftTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-start items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: i }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini", children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (c.includes("rightTop") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-end items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini", children: n }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: i })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (c.includes("leftBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-start items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: i }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini", children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (c.includes("rightBottom") || c.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-row justify-end items-center p-0 gap-2 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini", children: n }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: i })
] }) })
] })
}
);
}
);
Ct.displayName = "WidgetTitleOneLineSmallMini";
const zt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Bt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
placeholder: i = "Placeholder",
...n
}, o) => {
const d = e.split(",").map((c) => c.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
zt({ size: t, padding: r }),
a
),
ref: o,
...n,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (d.includes("leftTop") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-center p-0 border-2 border-dashed border-gray-300 rounded font-scto", children: /* @__PURE__ */ s("div", { className: "font-normal text-gray-400 text-widget-small font-scto", children: i }) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (d.includes("rightTop") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-center p-0 border-2 border-dashed border-gray-300 rounded font-scto", children: /* @__PURE__ */ s("div", { className: "font-normal text-gray-400 text-widget-small font-scto", children: i }) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (d.includes("leftBottom") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-center p-0 border-2 border-dashed border-gray-300 rounded font-scto", children: /* @__PURE__ */ s("div", { className: "font-normal text-gray-400 text-widget-small font-scto", children: i }) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (d.includes("rightBottom") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-center p-0 border-2 border-dashed border-gray-300 rounded font-scto", children: /* @__PURE__ */ s("div", { className: "font-normal text-gray-400 text-widget-small font-scto", children: i }) }) })
] })
}
);
}
);
Bt.displayName = "WidgetTitlePlaceholder";
const At = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Rt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
items: i = [
{ icon: "๐ง", title1: "CPU", title2: "ๅค็ๅจ", description: "85%" },
{ icon: "๐พ", title1: "ๅ
ๅญ", title2: "Memory", description: "67%" },
{ icon: "๐ฟ", title1: "็ฃ็", title2: "Disk", description: "45%" }
],
...n
}, o) => {
const d = e.split(",").map((c) => c.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
At({ size: t, padding: r }),
a
),
ref: o,
...n,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (d.includes("leftTop") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto", children: i.slice(0, 3).map((c, h) => /* @__PURE__ */ m(
"div",
{
className: "flex items-center justify-between w-full",
style: {
height: "20px",
marginBottom: h < 2 ? "18px" : "0px"
},
children: [
/* @__PURE__ */ m("div", { className: "flex items-center flex-1 min-w-0", children: [
c.icon && /* @__PURE__ */ s(
"div",
{
className: "flex items-center justify-center text-xs",
style: { width: "16px", height: "16px", marginRight: "10px" },
children: c.icon
}
),
/* @__PURE__ */ m("div", { className: "flex flex-col justify-center min-w-0 flex-1", children: [
/* @__PURE__ */ s(
"div",
{
className: "font-normal truncate",
style: { fontSize: "16px", lineHeight: "11px" },
children: c.title1
}
),
c.title2 && /* @__PURE__ */ s(
"div",
{
className: "font-normal truncate text-gray-600",
style: { fontSize: "10px", lineHeight: "7px", marginTop: "2px" },
children: c.title2
}
)
] })
] }),
/* @__PURE__ */ s(
"div",
{
className: "font-medium text-right",
style: { fontSize: "16px", marginLeft: "8px" },
children: c.description
}
)
]
},
h
)) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (d.includes("rightTop") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto", children: i.slice(0, 3).map((c, h) => /* @__PURE__ */ m(
"div",
{
className: "flex items-center justify-between w-full text-right",
style: {
height: "20px",
marginBottom: h < 2 ? "18px" : "0px"
},
children: [
/* @__PURE__ */ m("div", { className: "flex items-center flex-1 min-w-0", children: [
c.icon && /* @__PURE__ */ s(
"div",
{
className: "flex items-center justify-center text-xs",
style: { width: "16px", height: "16px", marginRight: "10px" },
children: c.icon
}
),
/* @__PURE__ */ m("div", { className: "flex flex-col justify-center min-w-0 flex-1", children: [
/* @__PURE__ */ s(
"div",
{
className: "font-normal truncate",
style: { fontSize: "16px", lineHeight: "11px" },
children: c.title1
}
),
c.title2 && /* @__PURE__ */ s(
"div",
{
className: "font-normal truncate text-gray-600",
style: { fontSize: "10px", lineHeight: "7px", marginTop: "2px" },
children: c.title2
}
)
] })
] }),
/* @__PURE__ */ s(
"div",
{
className: "font-medium text-right",
style: { fontSize: "16px", marginLeft: "8px" },
children: c.description
}
)
]
},
h
)) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (d.includes("leftBottom") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-end items-start p-0 font-scto", children: i.slice(0, 3).map((c, h) => /* @__PURE__ */ m(
"div",
{
className: "flex items-center justify-between w-full",
style: {
height: "20px",
marginBottom: h < 2 ? "18px" : "0px"
},
children: [
/* @__PURE__ */ m("div", { className: "flex items-center flex-1 min-w-0", children: [
c.icon && /* @__PURE__ */ s(
"div",
{
className: "flex items-center justify-center text-xs",
style: { width: "16px", height: "16px", marginRight: "10px" },
children: c.icon
}
),
/* @__PURE__ */ m("div", { className: "flex flex-col justify-center min-w-0 flex-1", children: [
/* @__PURE__ */ s(
"div",
{
className: "font-normal truncate",
style: { fontSize: "16px", lineHeight: "11px" },
children: c.title1
}
),
c.title2 && /* @__PURE__ */ s(
"div",
{
className: "font-normal truncate text-gray-600",
style: { fontSize: "10px", lineHeight: "7px", marginTop: "2px" },
children: c.title2
}
)
] })
] }),
/* @__PURE__ */ s(
"div",
{
className: "font-medium text-right",
style: { fontSize: "16px", marginLeft: "8px" },
children: c.description
}
)
]
},
h
)).reverse() }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (d.includes("rightBottom") || d.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-end items-start p-0 font-scto", children: i.slice(0, 3).map((c, h) => /* @__PURE__ */ m(
"div",
{
className: "flex items-center justify-between w-full text-right",
style: {
height: "20px",
marginBottom: h < 2 ? "18px" : "0px"
},
children: [
/* @__PURE__ */ m("div", { className: "flex items-center flex-1 min-w-0", children: [
c.icon && /* @__PURE__ */ s(
"div",
{
className: "flex items-center justify-center text-xs",
style: { width: "16px", height: "16px", marginRight: "10px" },
children: c.icon
}
),
/* @__PURE__ */ m("div", { className: "flex flex-col justify-center min-w-0 flex-1", children: [
/* @__PURE__ */ s(
"div",
{
className: "font-normal truncate",
style: { fontSize: "16px", lineHeight: "11px" },
children: c.title1
}
),
c.title2 && /* @__PURE__ */ s(
"div",
{
className: "font-normal truncate text-gray-600",
style: { fontSize: "10px", lineHeight: "7px", marginTop: "2px" },
children: c.title2
}
)
] })
] }),
/* @__PURE__ */ s(
"div",
{
className: "font-medium text-right",
style: { fontSize: "16px", marginLeft: "8px" },
children: c.description
}
)
]
},
h
)).reverse() }) })
] })
}
);
}
);
Rt.displayName = "WidgetModuleList";
const Et = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), jt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
topContent: i = "ไธ้จๅ
ๅฎน",
bottomContent: n = "ไธ้จๅ
ๅฎน",
dividerType: o = "horizontal",
...d
}, c) => {
const h = e.split(",").map((p) => p.trim());
return /* @__PURE__ */ s(
"div",
{
className: A(
Et({ size: t, padding: r }),
a
),
ref: c,
...d,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (h.includes("leftTop") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px", marginBottom: "8px" }, children: i }),
/* @__PURE__ */ s("div", { style: { borderTop: "1px solid #e5e7eb", width: "100%", margin: "8px 0" } }),
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (h.includes("rightTop") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto text-right", children: [
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px", marginBottom: "8px" }, children: i }),
/* @__PURE__ */ s("div", { style: { borderTop: "1px solid #e5e7eb", width: "100%", margin: "8px 0" } }),
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (h.includes("leftBottom") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px", marginBottom: "8px" }, children: i }),
/* @__PURE__ */ s("div", { style: { borderTop: "1px solid #e5e7eb", width: "100%", margin: "8px 0" } }),
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px" }, children: n })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (h.includes("rightBottom") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto text-right", children: [
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px", marginBottom: "8px" }, children: i }),
/* @__PURE__ */ s("div", { style: { borderTop: "1px solid #e5e7eb", width: "100%", margin: "8px 0" } }),
/* @__PURE__ */ s("div", { className: "font-normal", style: { fontSize: "16px", lineHeight: "11px" }, children: n })
] }) })
] })
}
);
}
);
jt.displayName = "WidgetModuleDivider";
const Mt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), $t = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
buttonText: i = "ๆไฝ",
buttonType: n = "primary",
isDisabled: o = !1,
onButtonClick: d,
...c
}, h) => {
const p = e.split(",").map((N) => N.trim()), C = () => {
const N = "px-4 py-2 rounded font-medium text-widget-small transition-colors cursor-pointer";
if (o)
return `${N} bg-gray-100 text-gray-400 cursor-not-allowed`;
switch (n) {
case "primary":
return `${N} bg-blue-600 text-white hover:bg-blue-700`;
case "secondary":
return `${N} bg-gray-200 text-gray-800 hover:bg-gray-300`;
case "destructive":
return `${N} bg-red-600 text-white hover:bg-red-700`;
default:
return `${N} bg-blue-600 text-white hover:bg-blue-700`;
}
};
return /* @__PURE__ */ s(
"div",
{
className: A(
Mt({ size: t, padding: r }),
a
),
ref: h,
...c,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (p.includes("leftTop") || p.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-start p-0 font-scto", children: /* @__PURE__ */ s(
"button",
{
className: C(),
onClick: o ? void 0 : d,
disabled: o,
children: i
}
) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (p.includes("rightTop") || p.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-end p-0 font-scto", children: /* @__PURE__ */ s(
"button",
{
className: C(),
onClick: o ? void 0 : d,
disabled: o,
children: i
}
) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (p.includes("leftBottom") || p.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-start p-0 font-scto", children: /* @__PURE__ */ s(
"button",
{
className: C(),
onClick: o ? void 0 : d,
disabled: o,
children: i
}
) }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (p.includes("rightBottom") || p.includes("all")) && /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col justify-center items-end p-0 font-scto", children: /* @__PURE__ */ s(
"button",
{
className: C(),
onClick: o ? void 0 : d,
disabled: o,
children: i
}
) }) })
] })
}
);
}
);
$t.displayName = "ModuleControlButton";
const Lt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Ot = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
graphTitle: i = "ๅพ่กจๆ ้ข",
placeholder: n = "ๅพ่กจๆฐๆฎ",
graphType: o = "line",
...d
}, c) => {
const h = e.split(",").map((C) => C.trim()), p = () => {
switch (o) {
case "line":
return "๐";
case "bar":
return "๐";
case "pie":
return "๐ฅง";
case "area":
return "๐";
default:
return "๐";
}
};
return /* @__PURE__ */ s(
"div",
{
className: A(
Lt({ size: t, padding: r }),
a
),
ref: c,
...d,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (h.includes("leftTop") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small mb-2", children: i }),
/* @__PURE__ */ m("div", { className: "flex-1 w-full flex flex-col justify-center items-center border-2 border-dashed border-gray-300 rounded bg-gray-50", children: [
/* @__PURE__ */ s("div", { className: "text-2xl mb-1", children: p() }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini text-gray-500", children: n })
] })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (h.includes("rightTop") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-end p-0 font-scto text-right", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small mb-2", children: i }),
/* @__PURE__ */ m("div", { className: "flex-1 w-full flex flex-col justify-center items-center border-2 border-dashed border-gray-300 rounded bg-gray-50", children: [
/* @__PURE__ */ s("div", { className: "text-2xl mb-1", children: p() }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini text-gray-500", children: n })
] })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (h.includes("leftBottom") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-end items-start p-0 font-scto", children: [
/* @__PURE__ */ m("div", { className: "flex-1 w-full flex flex-col justify-center items-center border-2 border-dashed border-gray-300 rounded bg-gray-50 mb-2", children: [
/* @__PURE__ */ s("div", { className: "text-2xl mb-1", children: p() }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini text-gray-500", children: n })
] }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: i })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (h.includes("rightBottom") || h.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-end items-end p-0 font-scto text-right", children: [
/* @__PURE__ */ m("div", { className: "flex-1 w-full flex flex-col justify-center items-center border-2 border-dashed border-gray-300 rounded bg-gray-50 mb-2", children: [
/* @__PURE__ */ s("div", { className: "text-2xl mb-1", children: p() }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-mini text-gray-500", children: n })
] }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small", children: i })
] }) })
] })
}
);
}
);
Ot.displayName = "ModuleGraphPlaceholder";
const It = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Vt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
graphTitle: i = "ๆฐๆฎ่ถๅฟ",
dataPoints: n = [
{ label: "1ๆ", value: 65 },
{ label: "2ๆ", value: 78 },
{ label: "3ๆ", value: 90 },
{ label: "4ๆ", value: 81 },
{ label: "5ๆ", value: 95 }
],
graphType: o = "line",
showAxes: d = !0,
...c
}, h) => {
var P, X, R, O, pe, Ye, Ke, Qe;
const p = e.split(",").map((I) => I.trim()), C = Math.max(...n.map((I) => I.value));
Math.min(...n.map((I) => I.value));
const N = () => o === "bar" ? /* @__PURE__ */ s("div", { className: "flex items-end justify-between h-12 w-full px-1", children: n.slice(0, 5).map((I, ee) => {
const le = I.value / C * 40;
return /* @__PURE__ */ s(
"div",
{
className: "bg-blue-500 w-2 rounded-t",
style: { height: `${le}px` }
},
ee
);
}) }) : /* @__PURE__ */ s("div", { className: "flex items-end justify-between h-12 w-full relative", children: /* @__PURE__ */ m("svg", { className: "absolute inset-0 w-full h-full", viewBox: "0 0 100 40", children: [
/* @__PURE__ */ s(
"polyline",
{
fill: "none",
stroke: "#3b82f6",
strokeWidth: "2",
points: n.slice(0, 5).map((I, ee) => {
const le = ee / (n.slice(0, 5).length - 1) * 100, ke = 40 - I.value / C * 35;
return `${le},${ke}`;
}).join(" ")
}
),
n.slice(0, 5).map((I, ee) => {
const le = ee / (n.slice(0, 5).length - 1) * 100, ke = 40 - I.value / C * 35;
return /* @__PURE__ */ s(
"circle",
{
cx: le,
cy: ke,
r: "2",
fill: "#3b82f6"
},
ee
);
})
] }) });
return /* @__PURE__ */ s(
"div",
{
className: A(
It({ size: t, padding: r }),
a
),
ref: h,
...c,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (p.includes("leftTop") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-start p-0 font-scto", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small mb-2", children: i }),
/* @__PURE__ */ s("div", { className: "flex-1 w-full", children: N() }),
d && /* @__PURE__ */ m("div", { className: "flex justify-between w-full text-widget-mini text-gray-500 mt-1", children: [
/* @__PURE__ */ s("span", { children: (P = n[0]) == null ? void 0 : P.label }),
/* @__PURE__ */ s("span", { children: (X = n[n.length - 1]) == null ? void 0 : X.label })
] })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (p.includes("rightTop") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-start items-end p-0 font-scto text-right", children: [
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small mb-2", children: i }),
/* @__PURE__ */ s("div", { className: "flex-1 w-full", children: N() }),
d && /* @__PURE__ */ m("div", { className: "flex justify-between w-full text-widget-mini text-gray-500 mt-1", children: [
/* @__PURE__ */ s("span", { children: (R = n[0]) == null ? void 0 : R.label }),
/* @__PURE__ */ s("span", { children: (O = n[n.length - 1]) == null ? void 0 : O.label })
] })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (p.includes("leftBottom") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-end items-start p-0 font-scto", children: [
d && /* @__PURE__ */ m("div", { className: "flex justify-between w-full text-widget-mini text-gray-500 mb-1", children: [
/* @__PURE__ */ s("span", { children: (pe = n[0]) == null ? void 0 : pe.label }),
/* @__PURE__ */ s("span", { children: (Ye = n[n.length - 1]) == null ? void 0 : Ye.label })
] }),
/* @__PURE__ */ s("div", { className: "flex-1 w-full", children: N() }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small mt-2", children: i })
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 right-0", children: (p.includes("rightBottom") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-end items-end p-0 font-scto text-right", children: [
d && /* @__PURE__ */ m("div", { className: "flex justify-between w-full text-widget-mini text-gray-500 mb-1", children: [
/* @__PURE__ */ s("span", { children: (Ke = n[0]) == null ? void 0 : Ke.label }),
/* @__PURE__ */ s("span", { children: (Qe = n[n.length - 1]) == null ? void 0 : Qe.label })
] }),
/* @__PURE__ */ s("div", { className: "flex-1 w-full", children: N() }),
/* @__PURE__ */ s("div", { className: "font-normal text-widget-small mt-2", children: i })
] }) })
] })
}
);
}
);
Vt.displayName = "ModuleGraphDefault";
const Pt = $(
"relative bg-card border rounded-lg shadow-sm",
{
variants: {
size: {
standard: "w-container-md h-container-md",
auto: "w-full h-auto"
},
padding: {
none: "p-0",
base: "p-[15px]"
}
},
defaultVariants: {
size: "standard",
padding: "base"
}
}
), Zt = z.forwardRef(
({
className: a,
layout: e = "leftTop",
size: t = "standard",
padding: r = "base",
content: i = "้็จๅ
ๅฎน",
icon: n = "๐ฑ",
status: o = "normal",
contentType: d = "text",
...c
}, h) => {
const p = e.split(",").map((X) => X.trim()), C = () => {
switch (o) {
case "warning":
return "text-yellow-600";
case "error":
return "text-red-600";
case "success":
return "text-green-600";
default:
return "text-gray-600";
}
}, N = () => {
switch (o) {
case "warning":
return "โ ๏ธ";
case "error":
return "โ";
case "success":
return "โ
";
default:
return "โน๏ธ";
}
}, P = () => {
switch (d) {
case "number":
return /* @__PURE__ */ s("div", { className: `font-bold text-widget-big ${C()}`, children: i });
case "status":
return /* @__PURE__ */ m("div", { className: "flex items-center space-x-2", children: [
/* @__PURE__ */ s("span", { className: "text-lg", children: N() }),
/* @__PURE__ */ s("span", { className: `font-medium text-widget-small ${C()}`, children: i })
] });
case "custom":
return i;
default:
return /* @__PURE__ */ s("div", { className: `font-normal text-widget-medium ${C()}`, children: i });
}
};
return /* @__PURE__ */ s(
"div",
{
className: A(
Pt({ size: t, padding: r }),
a
),
ref: h,
...c,
children: /* @__PURE__ */ m("div", { className: "relative w-full h-full", children: [
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 left-0", children: (p.includes("leftTop") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-center items-start p-0 font-scto", children: [
n && /* @__PURE__ */ s("div", { className: "text-2xl mb-2", children: n }),
P()
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm top-0 right-0", children: (p.includes("rightTop") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-center items-end p-0 font-scto text-right", children: [
n && /* @__PURE__ */ s("div", { className: "text-2xl mb-2", children: n }),
P()
] }) }),
/* @__PURE__ */ s("div", { className: "absolute w-widget-sm h-widget-sm bottom-0 left-0", children: (p.includes("leftBottom") || p.includes("all")) && /* @__PURE__ */ m("div", { className: "w-full h-full flex flex-col justify-center items-start p-0 font-scto", children: [
P(),
n && /* @__PURE__ */ s("div", { className: "text-2xl mt-2", children: n })