@facter/ds-core 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +25 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7728,13 +7728,13 @@ var colorConfigs = {
|
|
|
7728
7728
|
}
|
|
7729
7729
|
};
|
|
7730
7730
|
var rootVariants2 = cva(
|
|
7731
|
-
"relative overflow-hidden bg-card shadow-sm border border-border
|
|
7731
|
+
"relative overflow-hidden bg-card shadow-sm border border-border",
|
|
7732
7732
|
{
|
|
7733
7733
|
variants: {
|
|
7734
7734
|
variant: {
|
|
7735
|
-
default: "rounded-2xl",
|
|
7736
|
-
compact: "rounded-xl",
|
|
7737
|
-
mini: "rounded-xl"
|
|
7735
|
+
default: "rounded-2xl h-full",
|
|
7736
|
+
compact: "rounded-xl h-full",
|
|
7737
|
+
mini: "rounded-xl w-fit"
|
|
7738
7738
|
}
|
|
7739
7739
|
},
|
|
7740
7740
|
defaultVariants: {
|
|
@@ -7754,9 +7754,9 @@ function StatsCardRoot({
|
|
|
7754
7754
|
/* @__PURE__ */ jsx("div", { className: cn("absolute inset-0 bg-gradient-to-br pointer-events-none", config.bgGradient) }),
|
|
7755
7755
|
/* @__PURE__ */ jsx("div", { className: cn(
|
|
7756
7756
|
"relative flex h-full",
|
|
7757
|
-
variant === "
|
|
7758
|
-
variant === "
|
|
7759
|
-
variant === "
|
|
7757
|
+
variant === "default" && "flex-col",
|
|
7758
|
+
variant === "compact" && "flex-row items-center p-3 gap-3",
|
|
7759
|
+
variant === "mini" && "flex-row items-center p-3 gap-3"
|
|
7760
7760
|
), children })
|
|
7761
7761
|
] }) });
|
|
7762
7762
|
}
|
|
@@ -7768,8 +7768,7 @@ function StatsCardHeader({ className, children, ...props }) {
|
|
|
7768
7768
|
className: cn(
|
|
7769
7769
|
"flex items-center justify-between",
|
|
7770
7770
|
variant === "default" && "p-4 pb-2",
|
|
7771
|
-
variant === "mini" && "
|
|
7772
|
-
variant === "compact" && "flex-1 min-w-0",
|
|
7771
|
+
(variant === "compact" || variant === "mini") && "flex-1 min-w-0",
|
|
7773
7772
|
className
|
|
7774
7773
|
),
|
|
7775
7774
|
...props,
|
|
@@ -7778,29 +7777,26 @@ function StatsCardHeader({ className, children, ...props }) {
|
|
|
7778
7777
|
);
|
|
7779
7778
|
}
|
|
7780
7779
|
function StatsCardIcon({ icon: Icon2, className, ...props }) {
|
|
7781
|
-
const { config
|
|
7780
|
+
const { config } = useStatsCard();
|
|
7782
7781
|
return /* @__PURE__ */ jsx(
|
|
7783
7782
|
"div",
|
|
7784
7783
|
{
|
|
7785
7784
|
className: cn(
|
|
7786
|
-
"rounded-lg",
|
|
7785
|
+
"rounded-lg p-2",
|
|
7787
7786
|
config.iconBg,
|
|
7788
|
-
variant === "mini" ? "p-1.5" : "p-2",
|
|
7789
7787
|
className
|
|
7790
7788
|
),
|
|
7791
7789
|
...props,
|
|
7792
|
-
children: /* @__PURE__ */ jsx(Icon2, { className:
|
|
7790
|
+
children: /* @__PURE__ */ jsx(Icon2, { className: "w-4 h-4" })
|
|
7793
7791
|
}
|
|
7794
7792
|
);
|
|
7795
7793
|
}
|
|
7796
7794
|
function StatsCardTitle({ className, children, ...props }) {
|
|
7797
|
-
const { variant } = useStatsCard();
|
|
7798
7795
|
return /* @__PURE__ */ jsx(
|
|
7799
7796
|
"h3",
|
|
7800
7797
|
{
|
|
7801
7798
|
className: cn(
|
|
7802
|
-
"font-medium text-gray-700",
|
|
7803
|
-
variant === "mini" ? "text-xs leading-tight" : "text-sm",
|
|
7799
|
+
"font-medium text-gray-700 text-sm",
|
|
7804
7800
|
className
|
|
7805
7801
|
),
|
|
7806
7802
|
...props,
|
|
@@ -7809,13 +7805,11 @@ function StatsCardTitle({ className, children, ...props }) {
|
|
|
7809
7805
|
);
|
|
7810
7806
|
}
|
|
7811
7807
|
function StatsCardSubtitle({ className, children, ...props }) {
|
|
7812
|
-
const { variant } = useStatsCard();
|
|
7813
7808
|
return /* @__PURE__ */ jsx(
|
|
7814
7809
|
"p",
|
|
7815
7810
|
{
|
|
7816
7811
|
className: cn(
|
|
7817
|
-
"text-gray-400",
|
|
7818
|
-
variant === "mini" ? "text-[9px] leading-tight" : "text-[10px]",
|
|
7812
|
+
"text-gray-400 text-[10px]",
|
|
7819
7813
|
className
|
|
7820
7814
|
),
|
|
7821
7815
|
...props,
|
|
@@ -7830,7 +7824,8 @@ function StatsCardValue({ className, children, ...props }) {
|
|
|
7830
7824
|
{
|
|
7831
7825
|
className: cn(
|
|
7832
7826
|
"font-light tracking-tight text-gray-900",
|
|
7833
|
-
variant === "
|
|
7827
|
+
variant === "default" && "text-4xl",
|
|
7828
|
+
(variant === "compact" || variant === "mini") && "text-2xl",
|
|
7834
7829
|
className
|
|
7835
7830
|
),
|
|
7836
7831
|
...props,
|
|
@@ -7839,33 +7834,34 @@ function StatsCardValue({ className, children, ...props }) {
|
|
|
7839
7834
|
);
|
|
7840
7835
|
}
|
|
7841
7836
|
function StatsCardChange({ type = "positive", className, children, ...props }) {
|
|
7842
|
-
const { config
|
|
7837
|
+
const { config } = useStatsCard();
|
|
7843
7838
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-0.5", className), ...props, children: [
|
|
7844
7839
|
/* @__PURE__ */ jsx(
|
|
7845
7840
|
"svg",
|
|
7846
7841
|
{
|
|
7847
|
-
className: cn(
|
|
7842
|
+
className: cn("w-2.5 h-2.5", config.textColor),
|
|
7848
7843
|
viewBox: "0 0 12 12",
|
|
7849
7844
|
fill: "currentColor",
|
|
7850
7845
|
children: /* @__PURE__ */ jsx("path", { d: type === "negative" ? "M6 10L10 5H2L6 10Z" : "M6 2L10 7H2L6 2Z" })
|
|
7851
7846
|
}
|
|
7852
7847
|
),
|
|
7853
7848
|
/* @__PURE__ */ jsx("span", { className: cn(
|
|
7854
|
-
"font-medium",
|
|
7855
|
-
config.textColor
|
|
7856
|
-
variant === "mini" ? "text-[9px]" : "text-[10px]"
|
|
7849
|
+
"font-medium text-[10px]",
|
|
7850
|
+
config.textColor
|
|
7857
7851
|
), children })
|
|
7858
7852
|
] });
|
|
7859
7853
|
}
|
|
7860
7854
|
function StatsCardChart({ data, height, className, ...props }) {
|
|
7861
7855
|
const { config, variant } = useStatsCard();
|
|
7862
7856
|
const gradientId = React49.useId();
|
|
7863
|
-
|
|
7857
|
+
if (variant === "mini") {
|
|
7858
|
+
return null;
|
|
7859
|
+
}
|
|
7860
|
+
const chartHeight = height ?? (variant === "compact" ? 40 : 70);
|
|
7864
7861
|
return /* @__PURE__ */ jsx(
|
|
7865
7862
|
"div",
|
|
7866
7863
|
{
|
|
7867
7864
|
className: cn(
|
|
7868
|
-
variant === "mini" && "mt-auto h-10",
|
|
7869
7865
|
variant === "compact" && "w-16 h-10 shrink-0",
|
|
7870
7866
|
variant === "default" && "flex-1 relative mt-auto",
|
|
7871
7867
|
className
|
|
@@ -7901,10 +7897,10 @@ function StatsCardChart({ data, height, className, ...props }) {
|
|
|
7901
7897
|
fill: `url(#${gradientId})`,
|
|
7902
7898
|
dot: false,
|
|
7903
7899
|
activeDot: {
|
|
7904
|
-
r:
|
|
7900
|
+
r: 3,
|
|
7905
7901
|
fill: config.lineColor,
|
|
7906
7902
|
stroke: "white",
|
|
7907
|
-
strokeWidth:
|
|
7903
|
+
strokeWidth: 2
|
|
7908
7904
|
}
|
|
7909
7905
|
}
|
|
7910
7906
|
)
|
|
@@ -7918,7 +7914,6 @@ function StatsCardContent({ className, children, ...props }) {
|
|
|
7918
7914
|
"div",
|
|
7919
7915
|
{
|
|
7920
7916
|
className: cn(
|
|
7921
|
-
variant === "mini" && "mb-2",
|
|
7922
7917
|
variant === "default" && "mt-2",
|
|
7923
7918
|
className
|
|
7924
7919
|
),
|