tawuniya 0.7.0 → 0.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/components/compound/card-button.d.ts +5 -4
- package/dist/components/compound/card-button.js +109 -115
- package/dist/components/compound/policy-card.d.ts +34 -0
- package/dist/components/compound/policy-card.js +162 -0
- package/dist/components/compound/stats-card.d.ts +17 -0
- package/dist/components/compound/stats-card.js +67 -0
- package/dist/components/icons/import.js +30 -0
- package/dist/components/icons/svg/airplane-square.svg.js +5 -0
- package/dist/components/icons/svg/boat-line.svg.js +5 -0
- package/dist/components/icons/svg/card-driving.svg.js +5 -0
- package/dist/components/icons/svg/category-rounded.svg.js +5 -0
- package/dist/components/icons/svg/chair.svg.js +5 -0
- package/dist/components/icons/svg/coins.svg.js +5 -0
- package/dist/components/icons/svg/cross-border-damage.svg.js +5 -0
- package/dist/components/icons/svg/cup.svg.js +5 -0
- package/dist/components/icons/svg/delinquency-insurance.svg.js +5 -0
- package/dist/components/icons/svg/element-plus.svg.js +5 -0
- package/dist/components/icons/svg/emergency-light.svg.js +5 -0
- package/dist/components/icons/svg/engineering-insurance.svg.js +5 -0
- package/dist/components/icons/svg/extended-warranty.svg.js +5 -0
- package/dist/components/icons/svg/flash.svg.js +5 -0
- package/dist/components/icons/svg/global-2.svg.js +5 -0
- package/dist/components/icons/svg/graduation-cap.svg.js +5 -0
- package/dist/components/icons/svg/home-rounded-2.svg.js +5 -0
- package/dist/components/icons/svg/home-rounded-3.svg.js +5 -0
- package/dist/components/icons/svg/home-rounded.svg.js +5 -0
- package/dist/components/icons/svg/kaaba.svg.js +5 -0
- package/dist/components/icons/svg/key-collect.svg.js +5 -0
- package/dist/components/icons/svg/medical-error.svg.js +5 -0
- package/dist/components/icons/svg/money-group.svg.js +5 -0
- package/dist/components/icons/svg/motor-insurance-img.svg.js +19 -0
- package/dist/components/icons/svg/safe-home.svg.js +5 -0
- package/dist/components/icons/svg/smart-car-2.svg.js +5 -0
- package/dist/components/icons/svg/smart-car.svg.js +5 -0
- package/dist/components/icons/svg/sport-insurance.svg.js +5 -0
- package/dist/components/icons/svg/user-octagon.svg.js +5 -0
- package/dist/components/icons/svg/user-rounded.svg.js +5 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/ui/icon-text.js +16 -15
- package/dist/components.js +8 -4
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { HTMLAttributeAnchorTarget, ReactNode } from 'react';
|
|
1
|
+
import { HTMLAttributeAnchorTarget, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
type FeatureItem = {
|
|
3
3
|
key: string;
|
|
4
4
|
text: string;
|
|
5
5
|
};
|
|
6
6
|
interface CardButtonProps {
|
|
7
7
|
title: string;
|
|
8
|
-
icon: ReactNode;
|
|
8
|
+
icon: ReactNode | string;
|
|
9
9
|
active?: boolean;
|
|
10
10
|
features?: FeatureItem[];
|
|
11
11
|
subText?: ReactNode;
|
|
12
|
-
href
|
|
12
|
+
href?: string;
|
|
13
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
13
14
|
target?: HTMLAttributeAnchorTarget | undefined;
|
|
14
15
|
badgeText?: string;
|
|
15
16
|
classNames?: {
|
|
@@ -29,5 +30,5 @@ interface CardButtonProps {
|
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
declare const CardButton: ({ title, icon, active, features, subText, href, target, badgeText, classNames, }: CardButtonProps) => import("react").JSX.Element;
|
|
33
|
+
declare const CardButton: ({ title, icon, active, features, subText, href, onClick, target, badgeText, classNames, }: CardButtonProps) => import("react").JSX.Element;
|
|
33
34
|
export default CardButton;
|
|
@@ -1,131 +1,125 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, Fragment as N, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as k } from "react";
|
|
2
3
|
import { cn as o } from "../../lib/utils.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
title:
|
|
9
|
-
icon:
|
|
10
|
-
active:
|
|
11
|
-
features:
|
|
12
|
-
subText:
|
|
13
|
-
href:
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import m from "../icons/index.js";
|
|
5
|
+
import z from "../ui/icon-text.js";
|
|
6
|
+
import C from "../ui/typography.js";
|
|
7
|
+
import j from "../ui/badge.js";
|
|
8
|
+
const R = ({
|
|
9
|
+
title: f,
|
|
10
|
+
icon: i,
|
|
11
|
+
active: t = !1,
|
|
12
|
+
features: a = [],
|
|
13
|
+
subText: n,
|
|
14
|
+
href: s,
|
|
15
|
+
onClick: u,
|
|
16
|
+
target: g = "_blank",
|
|
17
|
+
badgeText: l,
|
|
16
18
|
classNames: e
|
|
17
19
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
),
|
|
29
|
-
children: [
|
|
30
|
-
n && /* @__PURE__ */ r(
|
|
31
|
-
"div",
|
|
20
|
+
const h = a.length > 0, x = !!s, y = k(i), v = t ? "[&_svg>path]:fill-primary [&_svg>path]:stroke-primary" : "[&_svg>path]:fill-foreground [&_svg>path]:stroke-foreground", b = t ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 group-hover:grid-rows-[1fr] group-hover:opacity-100", p = /* @__PURE__ */ c(N, { children: [
|
|
21
|
+
l && /* @__PURE__ */ r(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: o(
|
|
25
|
+
"absolute inset-x-0 -top-4 flex justify-center",
|
|
26
|
+
e?.badge?.wrapper
|
|
27
|
+
),
|
|
28
|
+
children: /* @__PURE__ */ r(
|
|
29
|
+
j,
|
|
32
30
|
{
|
|
31
|
+
variant: "default",
|
|
32
|
+
size: "sm",
|
|
33
33
|
className: o(
|
|
34
|
-
"
|
|
35
|
-
e?.badge?.
|
|
34
|
+
"bg-primary text-primary-foreground",
|
|
35
|
+
e?.badge?.badgeItem
|
|
36
36
|
),
|
|
37
|
-
children:
|
|
38
|
-
b,
|
|
39
|
-
{
|
|
40
|
-
variant: "default",
|
|
41
|
-
size: "sm",
|
|
42
|
-
className: o(
|
|
43
|
-
"bg-primary text-primary-foreground",
|
|
44
|
-
e?.badge?.badgeItem
|
|
45
|
-
),
|
|
46
|
-
children: n
|
|
47
|
-
}
|
|
48
|
-
)
|
|
37
|
+
children: l
|
|
49
38
|
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
t && /* @__PURE__ */ r("div", { className: "absolute top-4 inset-e-4 size-2 rounded-full bg-primary" }),
|
|
43
|
+
/* @__PURE__ */ c(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: o(
|
|
47
|
+
"flex flex-col items-center gap-y-2",
|
|
48
|
+
e?.contentWrapper
|
|
50
49
|
),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
className: o(
|
|
64
|
-
"flex items-center justify-center",
|
|
65
|
-
"[&_svg]:size-7 [&_svg>*]:duration-300",
|
|
66
|
-
"group-hover:[&_svg>path]:fill-primary",
|
|
67
|
-
"group-hover:[&_svg>path]:stroke-primary",
|
|
68
|
-
m,
|
|
69
|
-
e?.iconWrapper
|
|
70
|
-
),
|
|
71
|
-
children: s
|
|
72
|
-
}
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ r(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
className: o(
|
|
55
|
+
"flex items-center justify-center",
|
|
56
|
+
"[&_svg]:size-7 [&_svg>*]:duration-300",
|
|
57
|
+
"group-hover:[&_svg>path]:fill-primary",
|
|
58
|
+
"group-hover:[&_svg>path]:stroke-primary",
|
|
59
|
+
v,
|
|
60
|
+
e?.iconWrapper
|
|
73
61
|
),
|
|
74
|
-
/* @__PURE__ */ r(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
62
|
+
children: y ? i : /* @__PURE__ */ r(m, { name: i })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ r(
|
|
66
|
+
C,
|
|
67
|
+
{
|
|
68
|
+
as: "h3",
|
|
69
|
+
size: "sm",
|
|
70
|
+
weight: "bold",
|
|
71
|
+
color: t ? "primary" : "default",
|
|
72
|
+
className: o(
|
|
73
|
+
"capitalize duration-300 group-hover:text-primary",
|
|
74
|
+
e?.title
|
|
87
75
|
),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
children: f
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
!t && n && /* @__PURE__ */ r("div", { className: "grid grid-rows-[1fr] transition-all duration-300 ease-in-out group-hover:grid-rows-[0fr]", children: /* @__PURE__ */ r("div", { className: "overflow-hidden", children: /* @__PURE__ */ r("div", { className: "transition-opacity duration-300 group-hover:opacity-0", children: n }) }) }),
|
|
80
|
+
h && /* @__PURE__ */ r(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: o(
|
|
84
|
+
"grid transition-all duration-300 ease-in-out",
|
|
85
|
+
b,
|
|
86
|
+
e?.featuresWrapper
|
|
87
|
+
),
|
|
88
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-y-1 overflow-hidden", children: a.map(({ key: w, text: _ }) => /* @__PURE__ */ r(
|
|
89
|
+
z,
|
|
91
90
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
),
|
|
97
|
-
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-y-1 overflow-hidden", children: t.map(({ key: g, text: h }) => /* @__PURE__ */ r(
|
|
98
|
-
v,
|
|
91
|
+
text: _,
|
|
92
|
+
iconSize: "xs",
|
|
93
|
+
icon: /* @__PURE__ */ r(
|
|
94
|
+
m,
|
|
99
95
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
)
|
|
125
|
-
]
|
|
126
|
-
}
|
|
96
|
+
name: "checkbox-circle-fill",
|
|
97
|
+
className: "fill-primary"
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
classNames: {
|
|
101
|
+
container: e?.feature?.wrapper,
|
|
102
|
+
icon: e?.feature?.icon,
|
|
103
|
+
text: o(
|
|
104
|
+
"font-medium text-muted-foreground",
|
|
105
|
+
e?.feature?.text
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
w
|
|
110
|
+
)) })
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }), d = o(
|
|
117
|
+
"tawn tawn-card-button m-w-[120px]! max-w-[186px]! h-[188px] max-h-[188px] group relative flex max-w-48 flex-col justify-center gap-y-2 rounded-2xl border-2 bg-muted p-4 cursor-pointer",
|
|
118
|
+
t ? "border-primary" : "border-transparent",
|
|
119
|
+
e?.mainWrapper
|
|
127
120
|
);
|
|
121
|
+
return x ? /* @__PURE__ */ r("a", { href: s, target: g, className: d, children: p }) : /* @__PURE__ */ r("button", { type: "button", onClick: u, className: d, children: p });
|
|
128
122
|
};
|
|
129
123
|
export {
|
|
130
|
-
|
|
124
|
+
R as default
|
|
131
125
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLAttributeAnchorTarget, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { buttonVariants } from '../../lib/variants';
|
|
4
|
+
type ActionVariant = VariantProps<typeof buttonVariants>["variant"];
|
|
5
|
+
interface PolicyCardClassNames {
|
|
6
|
+
root?: string;
|
|
7
|
+
wrapper?: string;
|
|
8
|
+
contentWrapper?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
imageWrapper?: string;
|
|
12
|
+
badgeWrapper?: string;
|
|
13
|
+
badge?: string;
|
|
14
|
+
footerWrapper?: string;
|
|
15
|
+
actionWrapper?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
}
|
|
18
|
+
interface PolicyCardProps {
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
icon?: ReactNode | string;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
image?: ReactNode;
|
|
23
|
+
badgeText?: ReactNode;
|
|
24
|
+
hideAction?: boolean;
|
|
25
|
+
actionVariant?: ActionVariant;
|
|
26
|
+
actionContent?: ReactNode;
|
|
27
|
+
actionHref?: string;
|
|
28
|
+
actionTarget?: HTMLAttributeAnchorTarget;
|
|
29
|
+
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
30
|
+
classNames?: PolicyCardClassNames;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
declare const PolicyCard: ({ title, description, icon, image, badgeText, hideAction, actionContent, actionHref, actionTarget, onClick, actionVariant, classNames, children, }: PolicyCardProps) => import("react").JSX.Element;
|
|
34
|
+
export default PolicyCard;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as W } from "react";
|
|
3
|
+
import { cn as t } from "../../lib/utils.js";
|
|
4
|
+
import "../../lib/variants.js";
|
|
5
|
+
import m from "../ui/typography.js";
|
|
6
|
+
import j from "../ui/badge.js";
|
|
7
|
+
import h from "../ui/button.js";
|
|
8
|
+
import z from "../icons/index.js";
|
|
9
|
+
const H = ({
|
|
10
|
+
title: y,
|
|
11
|
+
description: l,
|
|
12
|
+
icon: a,
|
|
13
|
+
image: c,
|
|
14
|
+
badgeText: p,
|
|
15
|
+
hideAction: g = !1,
|
|
16
|
+
actionContent: n,
|
|
17
|
+
actionHref: s,
|
|
18
|
+
actionTarget: u = "_self",
|
|
19
|
+
onClick: i,
|
|
20
|
+
actionVariant: f = "smooth",
|
|
21
|
+
classNames: e,
|
|
22
|
+
children: v
|
|
23
|
+
}) => {
|
|
24
|
+
const o = !!s, x = o ? s : "#", b = o || !i && !o, w = W(a);
|
|
25
|
+
return /* @__PURE__ */ d(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: t("tawn tawn-policy-card relative", e?.root),
|
|
29
|
+
"data-testid": "policy-card",
|
|
30
|
+
children: [
|
|
31
|
+
p && /* @__PURE__ */ r(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: t(
|
|
35
|
+
"absolute -top-3.5 inset-e-6 z-10",
|
|
36
|
+
e?.badgeWrapper
|
|
37
|
+
),
|
|
38
|
+
"data-testid": "policy-card-badge-wrapper",
|
|
39
|
+
children: /* @__PURE__ */ r(
|
|
40
|
+
j,
|
|
41
|
+
{
|
|
42
|
+
className: t(
|
|
43
|
+
"bg-primary text-primary-foreground",
|
|
44
|
+
e?.badge
|
|
45
|
+
),
|
|
46
|
+
"data-testid": "policy-card-badge",
|
|
47
|
+
children: p
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ d(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: t(
|
|
56
|
+
"flex flex-col gap-2 relative rounded-3xl border-2 border-muted bg-background overflow-hidden",
|
|
57
|
+
e?.wrapper
|
|
58
|
+
),
|
|
59
|
+
"data-testid": "policy-card-wrapper",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ d(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: t(
|
|
65
|
+
"flex flex-col gap-y-4 px-6 pt-6",
|
|
66
|
+
e?.contentWrapper
|
|
67
|
+
),
|
|
68
|
+
"data-testid": "policy-card-content-wrapper",
|
|
69
|
+
children: [
|
|
70
|
+
a && /* @__PURE__ */ r("div", { "data-testid": "policy-card-icon", children: w ? a : /* @__PURE__ */ r(
|
|
71
|
+
z,
|
|
72
|
+
{
|
|
73
|
+
name: a,
|
|
74
|
+
className: t("size-7", e?.icon)
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col gap-y-2", children: [
|
|
78
|
+
/* @__PURE__ */ r(
|
|
79
|
+
m,
|
|
80
|
+
{
|
|
81
|
+
as: "h3",
|
|
82
|
+
size: "md",
|
|
83
|
+
weight: "bold",
|
|
84
|
+
className: e?.title,
|
|
85
|
+
"data-testid": "policy-card-title",
|
|
86
|
+
children: y
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
l && /* @__PURE__ */ r(
|
|
90
|
+
m,
|
|
91
|
+
{
|
|
92
|
+
size: "sm",
|
|
93
|
+
color: "muted_foreground",
|
|
94
|
+
className: e?.description,
|
|
95
|
+
"data-testid": "policy-card-description",
|
|
96
|
+
children: l
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
v
|
|
100
|
+
] })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ d(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: t(
|
|
108
|
+
"w-full flex items-end justify-between pl-6 rtl:pr-6 rtl:pl-0",
|
|
109
|
+
e?.footerWrapper
|
|
110
|
+
),
|
|
111
|
+
"data-testid": "policy-card-footer",
|
|
112
|
+
children: [
|
|
113
|
+
!g && /* @__PURE__ */ r(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: t("pb-6", e?.actionWrapper),
|
|
117
|
+
"data-testid": "policy-card-action-wrapper",
|
|
118
|
+
children: b ? /* @__PURE__ */ r(h, { variant: f, asChild: !0, children: /* @__PURE__ */ r(
|
|
119
|
+
"a",
|
|
120
|
+
{
|
|
121
|
+
href: x,
|
|
122
|
+
target: u,
|
|
123
|
+
onClick: i,
|
|
124
|
+
"data-testid": "policy-card-action",
|
|
125
|
+
children: n
|
|
126
|
+
}
|
|
127
|
+
) }) : /* @__PURE__ */ r(
|
|
128
|
+
h,
|
|
129
|
+
{
|
|
130
|
+
type: "button",
|
|
131
|
+
variant: f,
|
|
132
|
+
onClick: i,
|
|
133
|
+
"data-testid": "policy-card-action",
|
|
134
|
+
children: n
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
c && /* @__PURE__ */ r(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
className: t(
|
|
143
|
+
"flex-1 shrink-0 flex justify-end",
|
|
144
|
+
e?.imageWrapper
|
|
145
|
+
),
|
|
146
|
+
"data-testid": "policy-card-image-wrapper",
|
|
147
|
+
children: c
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
export {
|
|
161
|
+
H as default
|
|
162
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface StatsCardClassNames {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
subTitle?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
}
|
|
9
|
+
interface StatsCardPops {
|
|
10
|
+
icon?: ReactNode | string;
|
|
11
|
+
title: string;
|
|
12
|
+
subTitle?: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
classNames?: StatsCardClassNames;
|
|
15
|
+
}
|
|
16
|
+
declare const StatsCard: ({ icon, title, subTitle, description, classNames, }: StatsCardPops) => import("react").JSX.Element;
|
|
17
|
+
export default StatsCard;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as n } from "react";
|
|
3
|
+
import { cn as d } from "../../lib/utils.js";
|
|
4
|
+
import s from "../ui/typography.js";
|
|
5
|
+
import m from "../icons/index.js";
|
|
6
|
+
const b = ({
|
|
7
|
+
icon: e,
|
|
8
|
+
title: r,
|
|
9
|
+
subTitle: i,
|
|
10
|
+
description: o,
|
|
11
|
+
classNames: t
|
|
12
|
+
}) => {
|
|
13
|
+
const c = n(e);
|
|
14
|
+
return /* @__PURE__ */ l(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: d(
|
|
18
|
+
"tawn tawn-stats-card flex flex-col gap-y-1.5 p-4 rounded-xl bg-background",
|
|
19
|
+
t?.wrapper
|
|
20
|
+
),
|
|
21
|
+
"data-testid": "stats-card",
|
|
22
|
+
children: [
|
|
23
|
+
e && /* @__PURE__ */ a("div", { "data-testid": "stats-card-icon", className: "mb-1", children: c ? e : /* @__PURE__ */ a(
|
|
24
|
+
m,
|
|
25
|
+
{
|
|
26
|
+
name: e,
|
|
27
|
+
className: d("size-6", t?.icon)
|
|
28
|
+
}
|
|
29
|
+
) }),
|
|
30
|
+
/* @__PURE__ */ a(
|
|
31
|
+
s,
|
|
32
|
+
{
|
|
33
|
+
as: "h3",
|
|
34
|
+
weight: "bold",
|
|
35
|
+
className: t?.title,
|
|
36
|
+
"data-testid": "stats-card-title",
|
|
37
|
+
children: r
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ a(
|
|
41
|
+
s,
|
|
42
|
+
{
|
|
43
|
+
as: "h4",
|
|
44
|
+
size: "xs",
|
|
45
|
+
weight: "bold",
|
|
46
|
+
className: t?.subTitle,
|
|
47
|
+
"data-testid": "stats-card-subTitle",
|
|
48
|
+
children: i
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ a(
|
|
52
|
+
s,
|
|
53
|
+
{
|
|
54
|
+
size: "xs",
|
|
55
|
+
color: "muted_foreground",
|
|
56
|
+
className: t?.description,
|
|
57
|
+
"data-testid": "stats-card-description",
|
|
58
|
+
children: o
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
b as default
|
|
67
|
+
};
|