@ugurdemirel/landcraft 0.1.22 → 0.1.24
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/README.md +13 -8
- package/dist/cjs/components/Button.cjs +1 -1
- package/dist/cjs/components/Button.cjs.map +1 -1
- package/dist/cjs/components/CTA/CTA.cjs +1 -1
- package/dist/cjs/components/CTA/CTA.cjs.map +1 -1
- package/dist/cjs/components/CTA/parts.cjs +1 -1
- package/dist/cjs/components/CTA/parts.cjs.map +1 -1
- package/dist/cjs/components/CTA/variants/Panel.cjs +1 -1
- package/dist/cjs/components/CTA/variants/Panel.cjs.map +1 -1
- package/dist/cjs/components/CTA/variants/Surface.cjs +1 -1
- package/dist/cjs/components/CTA/variants/Surface.cjs.map +1 -1
- package/dist/cjs/components/Footer/Footer.cjs +1 -1
- package/dist/cjs/components/Footer/Footer.cjs.map +1 -1
- package/dist/cjs/components/Footer/parts.cjs +1 -1
- package/dist/cjs/components/Footer/parts.cjs.map +1 -1
- package/dist/cjs/components/Footer/variants/Columns.cjs +2 -0
- package/dist/cjs/components/Footer/variants/Columns.cjs.map +1 -0
- package/dist/cjs/components/Footer/variants/Editorial.cjs +1 -1
- package/dist/cjs/components/Footer/variants/Editorial.cjs.map +1 -1
- package/dist/cjs/components/Footer/variants/Minimal.cjs +1 -1
- package/dist/cjs/components/Footer/variants/Minimal.cjs.map +1 -1
- package/dist/cjs/components/Hero/parts.cjs +1 -1
- package/dist/cjs/components/Hero/parts.cjs.map +1 -1
- package/dist/cjs/components/Hero/variants/Centered.cjs +1 -1
- package/dist/cjs/components/Hero/variants/Centered.cjs.map +1 -1
- package/dist/cjs/components/Hero/variants/Parallax.cjs +1 -1
- package/dist/cjs/components/Hero/variants/Parallax.cjs.map +1 -1
- package/dist/cjs/components/Hero/variants/Split.cjs +1 -1
- package/dist/cjs/components/Hero/variants/Split.cjs.map +1 -1
- package/dist/cjs/components/Hero/variants/Statement.cjs +1 -1
- package/dist/cjs/components/Hero/variants/Statement.cjs.map +1 -1
- package/dist/cjs/components/LanguageSwitcher/parts.cjs +1 -1
- package/dist/cjs/components/LanguageSwitcher/parts.cjs.map +1 -1
- package/dist/cjs/components/MegaMenu/MegaMenu.cjs +1 -1
- package/dist/cjs/components/MegaMenu/MegaMenu.cjs.map +1 -1
- package/dist/cjs/components/Navbar/Navbar.cjs +1 -1
- package/dist/cjs/components/Navbar/Navbar.cjs.map +1 -1
- package/dist/cjs/components/Stats/Stats.cjs +1 -1
- package/dist/cjs/components/Stats/Stats.cjs.map +1 -1
- package/dist/cjs/components/Stats/parts.cjs +1 -1
- package/dist/cjs/components/Stats/parts.cjs.map +1 -1
- package/dist/cjs/components/Stats/variants/Cells.cjs +1 -1
- package/dist/cjs/components/Stats/variants/Cells.cjs.map +1 -1
- package/dist/cjs/components/Stats/variants/Divided.cjs +2 -0
- package/dist/cjs/components/Stats/variants/Divided.cjs.map +1 -0
- package/dist/cjs/components/Stats/variants/Stacked.cjs +2 -0
- package/dist/cjs/components/Stats/variants/Stacked.cjs.map +1 -0
- package/dist/cjs/components/Stats/variants/Ticker.cjs +1 -1
- package/dist/cjs/components/Stats/variants/Ticker.cjs.map +1 -1
- package/dist/cjs/utils/surface.cjs +2 -0
- package/dist/cjs/utils/surface.cjs.map +1 -0
- package/dist/es/components/Button.js +41 -31
- package/dist/es/components/Button.js.map +1 -1
- package/dist/es/components/CTA/CTA.js +5 -6
- package/dist/es/components/CTA/CTA.js.map +1 -1
- package/dist/es/components/CTA/parts.js +19 -14
- package/dist/es/components/CTA/parts.js.map +1 -1
- package/dist/es/components/CTA/variants/Panel.js +15 -17
- package/dist/es/components/CTA/variants/Panel.js.map +1 -1
- package/dist/es/components/CTA/variants/Surface.js +21 -11
- package/dist/es/components/CTA/variants/Surface.js.map +1 -1
- package/dist/es/components/Footer/Footer.js +5 -5
- package/dist/es/components/Footer/Footer.js.map +1 -1
- package/dist/es/components/Footer/parts.js +21 -20
- package/dist/es/components/Footer/parts.js.map +1 -1
- package/dist/es/components/Footer/variants/Columns.js +76 -0
- package/dist/es/components/Footer/variants/Columns.js.map +1 -0
- package/dist/es/components/Footer/variants/Editorial.js +68 -35
- package/dist/es/components/Footer/variants/Editorial.js.map +1 -1
- package/dist/es/components/Footer/variants/Minimal.js +50 -16
- package/dist/es/components/Footer/variants/Minimal.js.map +1 -1
- package/dist/es/components/Hero/parts.js +13 -11
- package/dist/es/components/Hero/parts.js.map +1 -1
- package/dist/es/components/Hero/variants/Centered.js +29 -17
- package/dist/es/components/Hero/variants/Centered.js.map +1 -1
- package/dist/es/components/Hero/variants/Parallax.js +23 -23
- package/dist/es/components/Hero/variants/Parallax.js.map +1 -1
- package/dist/es/components/Hero/variants/Split.js +35 -23
- package/dist/es/components/Hero/variants/Split.js.map +1 -1
- package/dist/es/components/Hero/variants/Statement.js +28 -23
- package/dist/es/components/Hero/variants/Statement.js.map +1 -1
- package/dist/es/components/LanguageSwitcher/parts.js +44 -44
- package/dist/es/components/LanguageSwitcher/parts.js.map +1 -1
- package/dist/es/components/MegaMenu/MegaMenu.js +131 -126
- package/dist/es/components/MegaMenu/MegaMenu.js.map +1 -1
- package/dist/es/components/Navbar/Navbar.js +110 -92
- package/dist/es/components/Navbar/Navbar.js.map +1 -1
- package/dist/es/components/Stats/Stats.js +8 -8
- package/dist/es/components/Stats/Stats.js.map +1 -1
- package/dist/es/components/Stats/parts.js +37 -17
- package/dist/es/components/Stats/parts.js.map +1 -1
- package/dist/es/components/Stats/variants/Cells.js +46 -18
- package/dist/es/components/Stats/variants/Cells.js.map +1 -1
- package/dist/es/components/Stats/variants/Divided.js +45 -0
- package/dist/es/components/Stats/variants/Divided.js.map +1 -0
- package/dist/es/components/Stats/variants/Stacked.js +40 -0
- package/dist/es/components/Stats/variants/Stacked.js.map +1 -0
- package/dist/es/components/Stats/variants/Ticker.js +44 -23
- package/dist/es/components/Stats/variants/Ticker.js.map +1 -1
- package/dist/es/utils/surface.js +16 -0
- package/dist/es/utils/surface.js.map +1 -0
- package/dist/index.d.ts +49 -10
- package/dist/styles.css +169 -114
- package/dist/theme.css +27 -0
- package/package.json +1 -1
- package/dist/cjs/components/CTA/variants/Inverse.cjs +0 -2
- package/dist/cjs/components/CTA/variants/Inverse.cjs.map +0 -1
- package/dist/cjs/components/Footer/variants/Classic.cjs +0 -2
- package/dist/cjs/components/Footer/variants/Classic.cjs.map +0 -1
- package/dist/cjs/components/Stats/variants/Editorial.cjs +0 -2
- package/dist/cjs/components/Stats/variants/Editorial.cjs.map +0 -1
- package/dist/cjs/components/Stats/variants/Hairline.cjs +0 -2
- package/dist/cjs/components/Stats/variants/Hairline.cjs.map +0 -1
- package/dist/es/components/CTA/variants/Inverse.js +0 -42
- package/dist/es/components/CTA/variants/Inverse.js.map +0 -1
- package/dist/es/components/Footer/variants/Classic.js +0 -43
- package/dist/es/components/Footer/variants/Classic.js.map +0 -1
- package/dist/es/components/Stats/variants/Editorial.js +0 -32
- package/dist/es/components/Stats/variants/Editorial.js.map +0 -1
- package/dist/es/components/Stats/variants/Hairline.js +0 -25
- package/dist/es/components/Stats/variants/Hairline.js.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { X as
|
|
6
|
-
|
|
2
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
import { useState as P } from "react";
|
|
4
|
+
import { cn as o } from "../../utils/cn.js";
|
|
5
|
+
import { X as T, Menu as C } from "../../icons.js";
|
|
6
|
+
import { emphasisSurfaceStyle as M } from "../../utils/surface.js";
|
|
7
|
+
const O = {
|
|
7
8
|
classic: {
|
|
8
9
|
shell: "border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75",
|
|
9
10
|
bar: "mx-auto max-w-6xl px-5 sm:px-8",
|
|
@@ -11,8 +12,8 @@ const f = "text-on-secondary", d = "text-foreground", C = {
|
|
|
11
12
|
link: "text-muted-foreground hover:text-foreground",
|
|
12
13
|
mobilePanel: "border-t border-border bg-background",
|
|
13
14
|
mobileLink: "text-muted-foreground hover:bg-surface hover:text-foreground",
|
|
14
|
-
menuButton:
|
|
15
|
-
brandText:
|
|
15
|
+
menuButton: "text-foreground hover:bg-surface",
|
|
16
|
+
brandText: "text-foreground",
|
|
16
17
|
brandDot: "bg-foreground",
|
|
17
18
|
desktopList: "hidden items-center gap-7 md:flex"
|
|
18
19
|
},
|
|
@@ -23,117 +24,134 @@ const f = "text-on-secondary", d = "text-foreground", C = {
|
|
|
23
24
|
link: "text-muted-foreground hover:text-foreground",
|
|
24
25
|
mobilePanel: "mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface",
|
|
25
26
|
mobileLink: "text-muted-foreground hover:bg-surface hover:text-foreground",
|
|
26
|
-
menuButton:
|
|
27
|
-
brandText:
|
|
27
|
+
menuButton: "text-foreground hover:bg-surface",
|
|
28
|
+
brandText: "text-foreground",
|
|
28
29
|
brandDot: "bg-foreground",
|
|
29
30
|
desktopList: "hidden items-center gap-7 md:flex"
|
|
30
|
-
},
|
|
31
|
-
inverse: {
|
|
32
|
-
shell: "border-b border-white/10 bg-[#101010]/85 backdrop-blur-md",
|
|
33
|
-
bar: "mx-auto max-w-6xl px-5 sm:px-8",
|
|
34
|
-
header: "px-0",
|
|
35
|
-
link: "text-on-secondary/60 hover:text-on-secondary",
|
|
36
|
-
mobilePanel: "border-t border-white/10 bg-[#101010]",
|
|
37
|
-
mobileLink: "text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary",
|
|
38
|
-
menuButton: `${f} hover:bg-white/10`,
|
|
39
|
-
brandText: f,
|
|
40
|
-
brandDot: "bg-on-secondary",
|
|
41
|
-
desktopList: "hidden items-center gap-7 md:flex"
|
|
42
31
|
}
|
|
43
|
-
},
|
|
32
|
+
}, _ = {
|
|
33
|
+
shell: "",
|
|
34
|
+
bar: "mx-auto max-w-6xl px-5 sm:px-8",
|
|
35
|
+
header: "px-0",
|
|
36
|
+
link: "text-current/70 hover:text-current",
|
|
37
|
+
mobilePanel: "border-t border-current/15",
|
|
38
|
+
mobileLink: "text-current/70 hover:bg-current/10 hover:text-current",
|
|
39
|
+
menuButton: "text-current hover:bg-current/10",
|
|
40
|
+
brandText: "text-current",
|
|
41
|
+
brandDot: "bg-current",
|
|
42
|
+
desktopList: "hidden items-center gap-7 md:flex"
|
|
43
|
+
}, z = ({
|
|
44
44
|
className: g,
|
|
45
|
-
variant:
|
|
45
|
+
variant: u = "classic",
|
|
46
46
|
brand: s,
|
|
47
47
|
logo: v,
|
|
48
|
-
logoSrc:
|
|
48
|
+
logoSrc: b,
|
|
49
49
|
logoAlt: N,
|
|
50
|
-
logoClassName:
|
|
51
|
-
brandHref:
|
|
50
|
+
logoClassName: w,
|
|
51
|
+
brandHref: k = "#",
|
|
52
52
|
links: x,
|
|
53
|
-
actions:
|
|
53
|
+
actions: d,
|
|
54
54
|
cta: i,
|
|
55
|
-
languageSwitcher:
|
|
55
|
+
languageSwitcher: m,
|
|
56
56
|
sticky: y = !0,
|
|
57
|
+
background: n,
|
|
57
58
|
LinkComponent: L,
|
|
59
|
+
style: f,
|
|
58
60
|
...j
|
|
59
61
|
}) => {
|
|
60
|
-
const [
|
|
62
|
+
const [l, p] = P(!1), c = L ?? "a", t = n ? _ : O[u], B = !n && u === "floating", h = v ?? (b ? /* @__PURE__ */ e(
|
|
61
63
|
"img",
|
|
62
64
|
{
|
|
63
|
-
src:
|
|
65
|
+
src: b,
|
|
64
66
|
alt: N ?? (typeof s == "string" ? s : "Logo"),
|
|
65
|
-
className:
|
|
67
|
+
className: o("h-7 w-auto", w)
|
|
66
68
|
}
|
|
67
|
-
) : null),
|
|
68
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !0, className:
|
|
69
|
+
) : null), D = h ? /* @__PURE__ */ e("span", { className: "flex items-center", children: h }) : /* @__PURE__ */ a("span", { className: o("flex items-center gap-2 font-display text-[17px] font-bold tracking-tight", t.brandText), children: [
|
|
70
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: o("inline-block h-2.5 w-2.5 rounded-sm", t.brandDot) }),
|
|
69
71
|
s
|
|
70
72
|
] });
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */ e(
|
|
90
|
-
"button",
|
|
91
|
-
{
|
|
92
|
-
type: "button",
|
|
93
|
-
"aria-label": a ? "Close menu" : "Open menu",
|
|
94
|
-
"aria-expanded": a,
|
|
95
|
-
onClick: () => h((r) => !r),
|
|
96
|
-
className: n(
|
|
97
|
-
"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md md:hidden",
|
|
98
|
-
"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
99
|
-
o.menuButton
|
|
100
|
-
),
|
|
101
|
-
children: a ? /* @__PURE__ */ e(P, { className: "h-5 w-5" }) : /* @__PURE__ */ e(T, { className: "h-5 w-5" })
|
|
102
|
-
}
|
|
103
|
-
)
|
|
104
|
-
] }),
|
|
105
|
-
/* @__PURE__ */ e(
|
|
106
|
-
"div",
|
|
107
|
-
{
|
|
108
|
-
className: n(
|
|
109
|
-
"grid transition-[grid-template-rows,opacity] duration-200 md:hidden",
|
|
110
|
-
a ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",
|
|
111
|
-
o.mobilePanel
|
|
112
|
-
),
|
|
113
|
-
children: /* @__PURE__ */ e("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ t("ul", { className: n("flex flex-col py-4", b !== "floating" && "px-5"), children: [
|
|
114
|
-
c ? /* @__PURE__ */ e("li", { className: "px-2 pb-4", children: c }) : null,
|
|
115
|
-
x.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
116
|
-
m,
|
|
73
|
+
return /* @__PURE__ */ a(
|
|
74
|
+
"header",
|
|
75
|
+
{
|
|
76
|
+
"data-emphasis": n ? "" : void 0,
|
|
77
|
+
style: n ? { ...M(n), ...f } : f,
|
|
78
|
+
className: o(
|
|
79
|
+
"w-full transition-colors duration-200",
|
|
80
|
+
y && "sticky top-0 z-50",
|
|
81
|
+
t.shell,
|
|
82
|
+
t.header,
|
|
83
|
+
g
|
|
84
|
+
),
|
|
85
|
+
...j,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ a("nav", { className: o("flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200", t.bar), "aria-label": "Main navigation", children: [
|
|
88
|
+
/* @__PURE__ */ e(c, { href: k, className: "shrink-0", children: D }),
|
|
89
|
+
/* @__PURE__ */ e("ul", { className: t.desktopList, children: x.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
90
|
+
c,
|
|
117
91
|
{
|
|
118
92
|
href: r.href,
|
|
119
93
|
target: r.external ? "_blank" : void 0,
|
|
120
94
|
rel: r.external ? "noopener noreferrer" : void 0,
|
|
121
|
-
|
|
122
|
-
className: n(
|
|
123
|
-
"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150",
|
|
124
|
-
o.mobileLink
|
|
125
|
-
),
|
|
95
|
+
className: o("text-sm font-medium transition-colors duration-150", t.link),
|
|
126
96
|
children: r.label
|
|
127
97
|
}
|
|
128
|
-
) }, r.href)),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
98
|
+
) }, r.href)) }),
|
|
99
|
+
/* @__PURE__ */ a("div", { className: "hidden items-center gap-3 md:flex", children: [
|
|
100
|
+
m,
|
|
101
|
+
d,
|
|
102
|
+
i
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ e(
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
type: "button",
|
|
108
|
+
"aria-label": l ? "Close menu" : "Open menu",
|
|
109
|
+
"aria-expanded": l,
|
|
110
|
+
onClick: () => p((r) => !r),
|
|
111
|
+
className: o(
|
|
112
|
+
"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md md:hidden",
|
|
113
|
+
"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
114
|
+
t.menuButton
|
|
115
|
+
),
|
|
116
|
+
children: l ? /* @__PURE__ */ e(T, { className: "h-5 w-5" }) : /* @__PURE__ */ e(C, { className: "h-5 w-5" })
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ e(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
className: o(
|
|
124
|
+
"grid transition-[grid-template-rows,opacity] duration-200 md:hidden",
|
|
125
|
+
l ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",
|
|
126
|
+
t.mobilePanel,
|
|
127
|
+
n && "bg-transparent"
|
|
128
|
+
),
|
|
129
|
+
children: /* @__PURE__ */ e("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ a("ul", { className: o("flex flex-col py-4", !B && "px-5"), children: [
|
|
130
|
+
m ? /* @__PURE__ */ e("li", { className: "px-2 pb-4", children: m }) : null,
|
|
131
|
+
x.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
132
|
+
c,
|
|
133
|
+
{
|
|
134
|
+
href: r.href,
|
|
135
|
+
target: r.external ? "_blank" : void 0,
|
|
136
|
+
rel: r.external ? "noopener noreferrer" : void 0,
|
|
137
|
+
onClick: () => p(!1),
|
|
138
|
+
className: o(
|
|
139
|
+
"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150",
|
|
140
|
+
t.mobileLink
|
|
141
|
+
),
|
|
142
|
+
children: r.label
|
|
143
|
+
}
|
|
144
|
+
) }, r.href)),
|
|
145
|
+
i ? /* @__PURE__ */ e("li", { className: "mt-3 px-2 pb-2", children: i }) : d ? /* @__PURE__ */ e("li", { className: "mt-3 flex flex-wrap gap-3 px-2 pb-2", children: d }) : null
|
|
146
|
+
] }) })
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
134
152
|
};
|
|
135
|
-
|
|
153
|
+
z.displayName = "Navbar";
|
|
136
154
|
export {
|
|
137
|
-
|
|
155
|
+
z as Navbar
|
|
138
156
|
};
|
|
139
157
|
//# sourceMappingURL=Navbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navbar.js","sources":["../../../../src/components/Navbar/Navbar.tsx"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Menu, X } from \"../../icons\";\nimport type { NavbarProps, NavbarVariant } from \"./types\";\n\ninterface NavbarStyle {\n shell: string;\n bar: string;\n header: string;\n link: string;\n mobilePanel: string;\n mobileLink: string;\n menuButton: string;\n brandText: string;\n brandDot: string;\n desktopList: string;\n}\n\nconst inverse = \"text-on-secondary\";\nconst light = \"text-foreground\";\n\nconst styles: Record<NavbarVariant, NavbarStyle> = {\n classic: {\n shell: \"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel: \"border-t border-border bg-background\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: `${light} hover:bg-surface`,\n brandText: light,\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n floating: {\n shell: \"px-0\",\n bar: \"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70\",\n header: \"px-3 sm:px-6\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel:\n \"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: `${light} hover:bg-surface`,\n brandText: light,\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n inverse: {\n shell: \"border-b border-white/10 bg-[#101010]/85 backdrop-blur-md\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-on-secondary/60 hover:text-on-secondary\",\n mobilePanel: \"border-t border-white/10 bg-[#101010]\",\n mobileLink:\n \"text-on-secondary/70 hover:bg-white/10 hover:text-on-secondary\",\n menuButton: `${inverse} hover:bg-white/10`,\n brandText: inverse,\n brandDot: \"bg-on-secondary\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n};\n\nexport const Navbar = ({\n className,\n variant = \"classic\",\n brand,\n logo,\n logoSrc,\n logoAlt,\n logoClassName,\n brandHref = \"#\",\n links,\n actions,\n cta,\n languageSwitcher,\n sticky = true,\n LinkComponent,\n ...props\n}: NavbarProps) => {\n const [open, setOpen] = useState(false);\n const Link = LinkComponent ?? \"a\";\n const s = styles[variant];\n\n const logoNode =\n logo ??\n (logoSrc ? (\n <img\n src={logoSrc}\n alt={logoAlt ?? (typeof brand === \"string\" ? brand : \"Logo\")}\n className={cn(\"h-7 w-auto\", logoClassName)}\n />\n ) : null);\n\n const brandNode = logoNode ? (\n <span className=\"flex items-center\">{logoNode}</span>\n ) : (\n <span className={cn(\"flex items-center gap-2 font-display text-[17px] font-bold tracking-tight\", s.brandText)}>\n <span aria-hidden className={cn(\"inline-block h-2.5 w-2.5 rounded-sm\", s.brandDot)} />\n {brand}\n </span>\n );\n\n return (\n <header className={cn(\"w-full transition-colors duration-200\", sticky && \"sticky top-0 z-50\", s.shell, s.header, className)} {...props}>\n <nav className={cn(\"flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200\", s.bar)} aria-label=\"Main navigation\">\n <Link href={brandHref} className=\"shrink-0\">\n {brandNode}\n </Link>\n\n <ul className={s.desktopList}>\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n target={link.external ? \"_blank\" : undefined}\n rel={link.external ? \"noopener noreferrer\" : undefined}\n className={cn(\"text-sm font-medium transition-colors duration-150\", s.link)}\n >\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n\n <div className=\"hidden items-center gap-3 md:flex\">\n {languageSwitcher}\n {actions}\n {cta}\n </div>\n\n <button\n type=\"button\"\n aria-label={open ? \"Close menu\" : \"Open menu\"}\n aria-expanded={open}\n onClick={() => setOpen((o) => !o)}\n className={cn(\n \"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md md:hidden\",\n \"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n s.menuButton,\n )}\n >\n {open ? <X className=\"h-5 w-5\" /> : <Menu className=\"h-5 w-5\" />}\n </button>\n </nav>\n\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200 md:hidden\",\n open ? \"grid-rows-[1fr] opacity-100\" : \"grid-rows-[0fr] opacity-0\",\n s.mobilePanel,\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <ul className={cn(\"flex flex-col py-4\", variant !== \"floating\" && \"px-5\")}>\n {languageSwitcher ? (\n <li className=\"px-2 pb-4\">{languageSwitcher}</li>\n ) : null}\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n target={link.external ? \"_blank\" : undefined}\n rel={link.external ? \"noopener noreferrer\" : undefined}\n onClick={() => setOpen(false)}\n className={cn(\n \"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileLink,\n )}\n >\n {link.label}\n </Link>\n </li>\n ))}\n {cta ? (\n <li className=\"mt-3 px-2 pb-2\">{cta}</li>\n ) : actions ? (\n <li className=\"mt-3 flex flex-wrap gap-3 px-2 pb-2\">{actions}</li>\n ) : null}\n </ul>\n </div>\n </div>\n </header>\n );\n};\nNavbar.displayName = \"Navbar\";"],"names":["inverse","light","styles","Navbar","className","variant","brand","logo","logoSrc","logoAlt","logoClassName","brandHref","links","actions","cta","languageSwitcher","sticky","LinkComponent","props","open","setOpen","useState","Link","s","logoNode","jsx","cn","brandNode","jsxs","link","o","X","Menu"],"mappings":";;;;AAmBA,MAAMA,IAAU,qBACVC,IAAQ,mBAERC,IAA6C;AAAA,EACjD,SAAS;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,aAAa;AAAA,IACb,YACE;AAAA,IACF,YAAY,GAAGD,CAAK;AAAA,IACpB,WAAWA;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEf,UAAU;AAAA,IACR,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,aACE;AAAA,IACF,YACE;AAAA,IACF,YAAY,GAAGA,CAAK;AAAA,IACpB,WAAWA;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEf,SAAS;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,aAAa;AAAA,IACb,YACE;AAAA,IACF,YAAY,GAAGD,CAAO;AAAA,IACtB,WAAWA;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAEjB,GAEaG,IAAS,CAAC;AAAA,EACrB,WAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,SAAAC;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B,WAAWM;AAAA,gBACT;AAAA,gBACAH,EAAE;AAAA,cAAA;AAAA,cAGH,UAAAM,EAAK;AAAA,YAAA;AAAA,UAAA,KAXDA,EAAK,IAad,CACD;AAAA,UACAf,IACC,gBAAAW,EAAC,MAAA,EAAG,WAAU,kBAAkB,UAAAX,EAAA,CAAI,IAClCD,IACF,gBAAAY,EAAC,MAAA,EAAG,WAAU,uCAAuC,aAAQ,IAC3D;AAAA,QAAA,EAAA,CACN,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AACAtB,EAAO,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Navbar.js","sources":["../../../../src/components/Navbar/Navbar.tsx"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Menu, X } from \"../../icons\";\nimport { emphasisSurfaceStyle } from \"../../utils/surface\";\nimport type { NavbarProps, NavbarVariant } from \"./types\";\n\ninterface NavbarStyle {\n shell: string;\n bar: string;\n header: string;\n link: string;\n mobilePanel: string;\n mobileLink: string;\n menuButton: string;\n brandText: string;\n brandDot: string;\n desktopList: string;\n}\n\nconst styles: Record<NavbarVariant, NavbarStyle> = {\n classic: {\n shell: \"border-b border-border bg-background/85 backdrop-blur-md supports-[backdrop-filter]:bg-background/75\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel: \"border-t border-border bg-background\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: \"text-foreground hover:bg-surface\",\n brandText: \"text-foreground\",\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n floating: {\n shell: \"px-0\",\n bar: \"mx-auto mt-3 max-w-5xl rounded-xl border border-border bg-surface/90 px-5 shadow-soft backdrop-blur-md supports-[backdrop-filter]:bg-surface/70\",\n header: \"px-3 sm:px-6\",\n link: \"text-muted-foreground hover:text-foreground\",\n mobilePanel:\n \"mx-3 mb-3 max-w-5xl overflow-hidden rounded-b-xl border border-border bg-surface\",\n mobileLink:\n \"text-muted-foreground hover:bg-surface hover:text-foreground\",\n menuButton: \"text-foreground hover:bg-surface\",\n brandText: \"text-foreground\",\n brandDot: \"bg-foreground\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n },\n};\n\n/**\n * On an emphasis (custom-background) bar everything inherits the resolved\n * contrast color instead of the page's --color-foreground/--color-border tokens.\n */\nconst emphatic: NavbarStyle = {\n shell: \"\",\n bar: \"mx-auto max-w-6xl px-5 sm:px-8\",\n header: \"px-0\",\n link: \"text-current/70 hover:text-current\",\n mobilePanel: \"border-t border-current/15\",\n mobileLink: \"text-current/70 hover:bg-current/10 hover:text-current\",\n menuButton: \"text-current hover:bg-current/10\",\n brandText: \"text-current\",\n brandDot: \"bg-current\",\n desktopList: \"hidden items-center gap-7 md:flex\",\n};\n\nexport const Navbar = ({\n className,\n variant = \"classic\",\n brand,\n logo,\n logoSrc,\n logoAlt,\n logoClassName,\n brandHref = \"#\",\n links,\n actions,\n cta,\n languageSwitcher,\n sticky = true,\n background,\n LinkComponent,\n style,\n ...props\n}: NavbarProps) => {\n const [open, setOpen] = useState(false);\n const Link = LinkComponent ?? \"a\";\n const s = background ? emphatic : styles[variant];\n const floating = !background && variant === \"floating\";\n\n const logoNode =\n logo ??\n (logoSrc ? (\n <img\n src={logoSrc}\n alt={logoAlt ?? (typeof brand === \"string\" ? brand : \"Logo\")}\n className={cn(\"h-7 w-auto\", logoClassName)}\n />\n ) : null);\n\n const brandNode = logoNode ? (\n <span className=\"flex items-center\">{logoNode}</span>\n ) : (\n <span className={cn(\"flex items-center gap-2 font-display text-[17px] font-bold tracking-tight\", s.brandText)}>\n <span aria-hidden className={cn(\"inline-block h-2.5 w-2.5 rounded-sm\", s.brandDot)} />\n {brand}\n </span>\n );\n\n return (\n <header\n data-emphasis={background ? \"\" : undefined}\n style={background ? { ...emphasisSurfaceStyle(background), ...style } : style}\n className={cn(\n \"w-full transition-colors duration-200\",\n sticky && \"sticky top-0 z-50\",\n s.shell,\n s.header,\n className,\n )}\n {...props}\n >\n <nav className={cn(\"flex h-16 w-full items-center justify-between gap-4 transition-colors duration-200\", s.bar)} aria-label=\"Main navigation\">\n <Link href={brandHref} className=\"shrink-0\">\n {brandNode}\n </Link>\n\n <ul className={s.desktopList}>\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n target={link.external ? \"_blank\" : undefined}\n rel={link.external ? \"noopener noreferrer\" : undefined}\n className={cn(\"text-sm font-medium transition-colors duration-150\", s.link)}\n >\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n\n <div className=\"hidden items-center gap-3 md:flex\">\n {languageSwitcher}\n {actions}\n {cta}\n </div>\n\n <button\n type=\"button\"\n aria-label={open ? \"Close menu\" : \"Open menu\"}\n aria-expanded={open}\n onClick={() => setOpen((o) => !o)}\n className={cn(\n \"inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-md md:hidden\",\n \"transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n s.menuButton,\n )}\n >\n {open ? <X className=\"h-5 w-5\" /> : <Menu className=\"h-5 w-5\" />}\n </button>\n </nav>\n\n <div\n className={cn(\n \"grid transition-[grid-template-rows,opacity] duration-200 md:hidden\",\n open ? \"grid-rows-[1fr] opacity-100\" : \"grid-rows-[0fr] opacity-0\",\n s.mobilePanel,\n background && \"bg-transparent\",\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">\n <ul className={cn(\"flex flex-col py-4\", !floating && \"px-5\")}>\n {languageSwitcher ? (\n <li className=\"px-2 pb-4\">{languageSwitcher}</li>\n ) : null}\n {links.map((link) => (\n <li key={link.href}>\n <Link\n href={link.href}\n target={link.external ? \"_blank\" : undefined}\n rel={link.external ? \"noopener noreferrer\" : undefined}\n onClick={() => setOpen(false)}\n className={cn(\n \"block rounded-md px-2 py-2.5 text-sm font-medium transition-colors duration-150\",\n s.mobileLink,\n )}\n >\n {link.label}\n </Link>\n </li>\n ))}\n {cta ? (\n <li className=\"mt-3 px-2 pb-2\">{cta}</li>\n ) : actions ? (\n <li className=\"mt-3 flex flex-wrap gap-3 px-2 pb-2\">{actions}</li>\n ) : null}\n </ul>\n </div>\n </div>\n </header>\n );\n};\nNavbar.displayName = \"Navbar\";\n"],"names":["styles","emphatic","Navbar","className","variant","brand","logo","logoSrc","logoAlt","logoClassName","brandHref","links","actions","cta","languageSwitcher","sticky","background","LinkComponent","style","props","open","setOpen","useState","Link","s","floating","logoNode","jsx","cn","brandNode","jsxs","emphasisSurfaceStyle","link","o","X","Menu"],"mappings":";;;;;AAoBA,MAAMA,IAA6C;AAAA,EACjD,SAAS;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,aAAa;AAAA,IACb,YACE;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAAA,EAEf,UAAU;AAAA,IACR,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,aACE;AAAA,IACF,YACE;AAAA,IACF,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAEjB,GAMMC,IAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AACf,GAEaC,IAAS,CAAC;AAAA,EACrB,WAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ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;AAAA,cAAAX,IACC,gBAAAa,EAAC,MAAA,EAAG,WAAU,aAAa,aAAiB,IAC1C;AAAA,cACHhB,EAAM,IAAI,CAACqB,wBACT,MAAA,EACC,UAAA,gBAAAL;AAAA,gBAACJ;AAAA,gBAAA;AAAA,kBACC,MAAMS,EAAK;AAAA,kBACX,QAAQA,EAAK,WAAW,WAAW;AAAA,kBACnC,KAAKA,EAAK,WAAW,wBAAwB;AAAA,kBAC7C,SAAS,MAAMX,EAAQ,EAAK;AAAA,kBAC5B,WAAWO;AAAA,oBACT;AAAA,oBACAJ,EAAE;AAAA,kBAAA;AAAA,kBAGH,UAAAQ,EAAK;AAAA,gBAAA;AAAA,cAAA,KAXDA,EAAK,IAad,CACD;AAAA,cACAnB,IACC,gBAAAc,EAAC,MAAA,EAAG,WAAU,kBAAkB,UAAAd,EAAA,CAAI,IAClCD,IACF,gBAAAe,EAAC,MAAA,EAAG,WAAU,uCAAuC,aAAQ,IAC3D;AAAA,YAAA,EAAA,CACN,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;AACAzB,EAAO,cAAc;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { StatsCells as
|
|
2
|
+
import { forwardRef as e } from "react";
|
|
3
|
+
import { StatsStacked as a } from "./variants/Stacked.js";
|
|
4
|
+
import { StatsDivided as d } from "./variants/Divided.js";
|
|
5
|
+
import { StatsCells as s } from "./variants/Cells.js";
|
|
6
6
|
import { StatsTicker as f } from "./variants/Ticker.js";
|
|
7
|
-
const
|
|
8
|
-
({ option:
|
|
7
|
+
const o = e(
|
|
8
|
+
({ option: m = "stacked", ...t }, r) => m === "ticker" ? /* @__PURE__ */ i(f, { ref: r, ...t }) : m === "cells" ? /* @__PURE__ */ i(s, { ref: r, ...t }) : m === "divided" ? /* @__PURE__ */ i(d, { ref: r, ...t }) : /* @__PURE__ */ i(a, { ref: r, ...t })
|
|
9
9
|
);
|
|
10
|
-
|
|
10
|
+
o.displayName = "Stats";
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
o as Stats
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=Stats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.js","sources":["../../../../src/components/Stats/Stats.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { StatsProps } from \"./types\";\nimport {
|
|
1
|
+
{"version":3,"file":"Stats.js","sources":["../../../../src/components/Stats/Stats.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { StatsProps } from \"./types\";\nimport { StatsStacked } from \"./variants/Stacked\";\nimport { StatsDivided } from \"./variants/Divided\";\nimport { StatsCells } from \"./variants/Cells\";\nimport { StatsTicker } from \"./variants/Ticker\";\n\nexport const Stats = forwardRef<HTMLDListElement, StatsProps>(\n ({ option = \"stacked\", ...props }, ref) => {\n if (option === \"ticker\") return <StatsTicker ref={ref} {...props} />;\n if (option === \"cells\") return <StatsCells ref={ref} {...props} />;\n if (option === \"divided\") return <StatsDivided ref={ref} {...props} />;\n return <StatsStacked ref={ref} {...props} />;\n },\n);\nStats.displayName = \"Stats\";\n"],"names":["Stats","forwardRef","option","props","ref","StatsTicker","StatsCells","StatsDivided","jsx","StatsStacked"],"mappings":";;;;;;AAOO,MAAMA,IAAQC;AAAA,EACnB,CAAC,EAAE,QAAAC,IAAS,WAAW,GAAGC,EAAA,GAASC,MAC7BF,MAAW,6BAAkBG,GAAA,EAAY,KAAAD,GAAW,GAAGD,GAAO,IAC9DD,MAAW,4BAAiBI,GAAA,EAAW,KAAAF,GAAW,GAAGD,GAAO,IAC5DD,MAAW,8BAAmBK,GAAA,EAAa,KAAAH,GAAW,GAAGD,GAAO,IAC7D,gBAAAK,EAACC,GAAA,EAAa,KAAAL,GAAW,GAAGD,EAAA,CAAO;AAE9C;AACAH,EAAM,cAAc;"}
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { ArrowUp as
|
|
4
|
-
const
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as o } from "../../utils/cn.js";
|
|
3
|
+
import { ArrowUp as d, ArrowDown as s } from "../../icons.js";
|
|
4
|
+
const m = "font-display font-semibold leading-none tracking-[-0.03em] tabular-nums text-foreground", g = "ml-1.5 font-sans text-[0.42em] font-medium tracking-normal text-muted-foreground", h = {
|
|
5
5
|
2: "sm:grid-cols-2",
|
|
6
6
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
7
7
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
8
|
+
}, u = {
|
|
9
|
+
2: "sm:[&>*:nth-child(2n)]:border-l",
|
|
10
|
+
3: "sm:max-lg:[&>*:nth-child(2n)]:border-l lg:[&>*:nth-child(3n+2)]:border-l lg:[&>*:nth-child(3n)]:border-l",
|
|
11
|
+
4: "sm:max-lg:[&>*:nth-child(2n)]:border-l lg:[&>*:nth-child(4n+2)]:border-l lg:[&>*:nth-child(4n+3)]:border-l lg:[&>*:nth-child(4n)]:border-l"
|
|
8
12
|
};
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return /* @__PURE__ */
|
|
13
|
+
function f({ delta: e, className: l }) {
|
|
14
|
+
const n = e > 0 ? "up" : e < 0 ? "down" : "flat";
|
|
15
|
+
return /* @__PURE__ */ t(
|
|
12
16
|
"span",
|
|
13
17
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
"data-direction": n,
|
|
19
|
+
className: o(
|
|
20
|
+
"inline-flex items-center gap-1 text-[0.8125rem] font-semibold leading-none tabular-nums",
|
|
21
|
+
l
|
|
17
22
|
),
|
|
18
23
|
children: [
|
|
19
|
-
/* @__PURE__ */ r(
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
/* @__PURE__ */ r(
|
|
25
|
+
"span",
|
|
26
|
+
{
|
|
27
|
+
"aria-hidden": !0,
|
|
28
|
+
className: o(
|
|
29
|
+
"inline-flex",
|
|
30
|
+
n === "up" && "text-accent",
|
|
31
|
+
n === "down" && "text-danger",
|
|
32
|
+
n === "flat" && "text-muted-foreground"
|
|
33
|
+
),
|
|
34
|
+
children: n === "up" ? /* @__PURE__ */ r(d, { className: "h-3.5 w-3.5", strokeWidth: 2.25 }) : n === "down" ? /* @__PURE__ */ r(s, { className: "h-3.5 w-3.5", strokeWidth: 2.25 }) : /* @__PURE__ */ r("span", { className: "h-px w-2.5 bg-current" })
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ t("span", { className: n === "flat" ? "text-muted-foreground" : "text-foreground", children: [
|
|
38
|
+
Math.abs(e),
|
|
39
|
+
"%"
|
|
40
|
+
] })
|
|
22
41
|
]
|
|
23
42
|
}
|
|
24
43
|
);
|
|
25
44
|
}
|
|
26
45
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
g as
|
|
46
|
+
f as DeltaMark,
|
|
47
|
+
h as gridCols,
|
|
48
|
+
u as gridDivider,
|
|
49
|
+
g as suffixBase,
|
|
50
|
+
m as valueBase
|
|
31
51
|
};
|
|
32
52
|
//# sourceMappingURL=parts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sources":["../../../../src/components/Stats/parts.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport {
|
|
1
|
+
{"version":3,"file":"parts.js","sources":["../../../../src/components/Stats/parts.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport { ArrowDown, ArrowUp } from \"../../icons\";\n\n/**\n * Shared Stats primitives.\n *\n * One voice across every layout: Space Grotesk numerals on a fixed baseline,\n * quiet sentence-case labels, hairline rules instead of card chrome, and a\n * typographic delta mark instead of a pill badge.\n */\n\nexport const valueBase =\n \"font-display font-semibold leading-none tracking-[-0.03em] tabular-nums text-foreground\";\n\n/** Unit scales with the numeral it sits beside, so it reads at every size. */\nexport const suffixBase =\n \"ml-1.5 font-sans text-[0.42em] font-medium tracking-normal text-muted-foreground\";\n\nexport const gridCols: Record<2 | 3 | 4, string> = {\n 2: \"sm:grid-cols-2\",\n 3: \"sm:grid-cols-2 lg:grid-cols-3\",\n 4: \"sm:grid-cols-2 lg:grid-cols-4\",\n};\n\n/**\n * Vertical hairlines between grid columns. Each breakpoint owns the columns it\n * actually draws (and `max-lg` removes the 2-up rule once 3/4-up takes over),\n * so wrapped rows never inherit a stray edge rule.\n */\nexport const gridDivider: Record<2 | 3 | 4, string> = {\n 2: \"sm:[&>*:nth-child(2n)]:border-l\",\n 3: \"sm:max-lg:[&>*:nth-child(2n)]:border-l lg:[&>*:nth-child(3n+2)]:border-l lg:[&>*:nth-child(3n)]:border-l\",\n 4: \"sm:max-lg:[&>*:nth-child(2n)]:border-l lg:[&>*:nth-child(4n+2)]:border-l lg:[&>*:nth-child(4n+3)]:border-l lg:[&>*:nth-child(4n)]:border-l\",\n};\n\n/**\n * delta — a change, set in type: a direction-colored arrow beside the signed\n * magnitude in high-contrast foreground. No background, no pill, no border.\n * Zero reads neutral.\n *\n * Direction lives on the arrow, not the figure: `--color-accent` is emerald-600\n * and only clears 3:1 as a graphic, so tinting 13px text with it would miss the\n * 4.5:1 text floor. Danger (4.8:1) could tint text, but the mark stays one\n * consistent treatment instead of two.\n */\nexport function DeltaMark({ delta, className }: { delta: number; className?: string }) {\n const direction = delta > 0 ? \"up\" : delta < 0 ? \"down\" : \"flat\";\n\n return (\n <span\n data-direction={direction}\n className={cn(\n \"inline-flex items-center gap-1 text-[0.8125rem] font-semibold leading-none tabular-nums\",\n className,\n )}\n >\n <span\n aria-hidden\n className={cn(\n \"inline-flex\",\n direction === \"up\" && \"text-accent\",\n direction === \"down\" && \"text-danger\",\n direction === \"flat\" && \"text-muted-foreground\",\n )}\n >\n {direction === \"up\" ? (\n <ArrowUp className=\"h-3.5 w-3.5\" strokeWidth={2.25} />\n ) : direction === \"down\" ? (\n <ArrowDown className=\"h-3.5 w-3.5\" strokeWidth={2.25} />\n ) : (\n <span className=\"h-px w-2.5 bg-current\" />\n )}\n </span>\n <span className={direction === \"flat\" ? \"text-muted-foreground\" : \"text-foreground\"}>\n {Math.abs(delta)}%\n </span>\n </span>\n );\n}\n"],"names":["valueBase","suffixBase","gridCols","gridDivider","DeltaMark","delta","className","direction","jsxs","cn","jsx","ArrowUp","ArrowDown"],"mappings":";;;AAWO,MAAMA,IACX,2FAGWC,IACX,oFAEWC,IAAsC;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL,GAOaC,IAAyC;AAAA,EACpD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAYO,SAASC,EAAU,EAAE,OAAAC,GAAO,WAAAC,KAAoD;AACrF,QAAMC,IAAYF,IAAQ,IAAI,OAAOA,IAAQ,IAAI,SAAS;AAE1D,SACE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,kBAAgBD;AAAA,MAChB,WAAWE;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAA,gBAAAI;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAW;AAAA,YACX,WAAWD;AAAA,cACT;AAAA,cACAF,MAAc,QAAQ;AAAA,cACtBA,MAAc,UAAU;AAAA,cACxBA,MAAc,UAAU;AAAA,YAAA;AAAA,YAGzB,UAAAA,MAAc,OACb,gBAAAG,EAACC,GAAA,EAAQ,WAAU,eAAc,aAAa,MAAM,IAClDJ,MAAc,SAChB,gBAAAG,EAACE,GAAA,EAAU,WAAU,eAAc,aAAa,MAAM,IAEtD,gBAAAF,EAAC,QAAA,EAAK,WAAU,wBAAA,CAAwB;AAAA,UAAA;AAAA,QAAA;AAAA,0BAG3C,QAAA,EAAK,WAAWH,MAAc,SAAS,0BAA0B,mBAC/D,UAAA;AAAA,UAAA,KAAK,IAAIF,CAAK;AAAA,UAAE;AAAA,QAAA,EAAA,CACnB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,25 +1,53 @@
|
|
|
1
1
|
import { jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { suffixBase as
|
|
3
|
+
import { cn as d } from "../../../utils/cn.js";
|
|
4
|
+
import { suffixBase as c, valueBase as f, DeltaMark as u, gridCols as p } from "../parts.js";
|
|
5
5
|
const x = m(
|
|
6
|
-
({ className: i, stats:
|
|
7
|
-
"
|
|
6
|
+
({ className: i, stats: a, columns: n = 4, ...s }, o) => /* @__PURE__ */ l(
|
|
7
|
+
"dl",
|
|
8
8
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
ref: o,
|
|
10
|
+
className: d(
|
|
11
|
+
"grid grid-cols-1 gap-px overflow-hidden rounded-xl border border-border bg-border",
|
|
12
|
+
p[n],
|
|
13
|
+
i
|
|
14
|
+
),
|
|
15
|
+
...s,
|
|
16
|
+
children: a.map((e) => /* @__PURE__ */ r(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: "flex min-h-[8rem] flex-col justify-between gap-8 bg-surface p-5 sm:p-6",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-3", children: [
|
|
22
|
+
/* @__PURE__ */ l("dt", { className: "text-sm leading-5 text-muted-foreground", children: e.label }),
|
|
23
|
+
e.icon ? /* @__PURE__ */ l("span", { className: "shrink-0 text-foreground/45", children: e.icon }) : null
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ r("div", { children: [
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
|
+
"dd",
|
|
28
|
+
{
|
|
29
|
+
className: d(
|
|
30
|
+
f,
|
|
31
|
+
"text-4xl",
|
|
32
|
+
e.accent ? "text-primary" : void 0
|
|
33
|
+
),
|
|
34
|
+
children: [
|
|
35
|
+
e.value,
|
|
36
|
+
e.suffix ? /* @__PURE__ */ l("span", { className: c, children: e.suffix }) : null
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
typeof e.delta == "number" || e.sub ? /* @__PURE__ */ r("div", { className: "mt-3 flex flex-wrap items-baseline gap-x-3 gap-y-1", children: [
|
|
41
|
+
typeof e.delta == "number" ? /* @__PURE__ */ l(u, { delta: e.delta }) : null,
|
|
42
|
+
e.sub ? /* @__PURE__ */ l("p", { className: "text-[13px] leading-5 text-muted-foreground", children: e.sub }) : null
|
|
43
|
+
] }) : null
|
|
44
|
+
] })
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
e.label
|
|
48
|
+
))
|
|
49
|
+
}
|
|
50
|
+
)
|
|
23
51
|
);
|
|
24
52
|
x.displayName = "StatsCells";
|
|
25
53
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cells.js","sources":["../../../../../src/components/Stats/variants/Cells.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { valueBase, suffixBase, gridCols } from \"../parts\";\nimport type { Stat } from \"../types\";\n\ninterface CellsProps extends HTMLAttributes<HTMLDListElement> {\n stats: Stat[];\n columns?: 2 | 3 | 4;\n}\n\nexport const StatsCells = forwardRef<HTMLDListElement, CellsProps>(\n ({ className, stats, columns = 4, ...props }, ref) => (\n <dl
|
|
1
|
+
{"version":3,"file":"Cells.js","sources":["../../../../../src/components/Stats/variants/Cells.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { valueBase, suffixBase, gridCols, DeltaMark } from \"../parts\";\nimport type { Stat } from \"../types\";\n\ninterface CellsProps extends HTMLAttributes<HTMLDListElement> {\n stats: Stat[];\n columns?: 2 | 3 | 4;\n}\n\n/**\n * cells — one framed spec matrix. Cells are divided by real hairlines (the grid\n * gaps show the shared border color), so the group reads as a single panel\n * instead of a row of detached cards.\n */\nexport const StatsCells = forwardRef<HTMLDListElement, CellsProps>(\n ({ className, stats, columns = 4, ...props }, ref) => (\n <dl\n ref={ref}\n className={cn(\n \"grid grid-cols-1 gap-px overflow-hidden rounded-xl border border-border bg-border\",\n gridCols[columns],\n className,\n )}\n {...props}\n >\n {stats.map((stat) => (\n <div\n key={stat.label}\n className=\"flex min-h-[8rem] flex-col justify-between gap-8 bg-surface p-5 sm:p-6\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <dt className=\"text-sm leading-5 text-muted-foreground\">{stat.label}</dt>\n {stat.icon ? <span className=\"shrink-0 text-foreground/45\">{stat.icon}</span> : null}\n </div>\n <div>\n <dd\n className={cn(\n valueBase,\n \"text-4xl\",\n stat.accent ? \"text-primary\" : undefined,\n )}\n >\n {stat.value}\n {stat.suffix ? <span className={suffixBase}>{stat.suffix}</span> : null}\n </dd>\n {typeof stat.delta === \"number\" || stat.sub ? (\n <div className=\"mt-3 flex flex-wrap items-baseline gap-x-3 gap-y-1\">\n {typeof stat.delta === \"number\" ? <DeltaMark delta={stat.delta} /> : null}\n {stat.sub ? (\n <p className=\"text-[13px] leading-5 text-muted-foreground\">{stat.sub}</p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n ))}\n </dl>\n ),\n);\nStatsCells.displayName = \"StatsCells\";\n"],"names":["StatsCells","forwardRef","className","stats","columns","props","ref","jsx","cn","gridCols","stat","jsxs","valueBase","suffixBase","DeltaMark"],"mappings":";;;;AAeO,MAAMA,IAAaC;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,OAA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,QAAA;AAAA,QA1BKA,EAAK;AAAA,MAAA,CA4Bb;AAAA,IAAA;AAAA,EAAA;AAGP;AACAV,EAAW,cAAc;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { cn as a } from "../../../utils/cn.js";
|
|
4
|
+
import { suffixBase as o, valueBase as x, DeltaMark as n, gridDivider as f, gridCols as p } from "../parts.js";
|
|
5
|
+
const u = c(
|
|
6
|
+
({ className: i, stats: m, columns: r = 4, ...s }, t) => /* @__PURE__ */ l(
|
|
7
|
+
"dl",
|
|
8
|
+
{
|
|
9
|
+
ref: t,
|
|
10
|
+
className: a("grid grid-cols-1 gap-y-10", p[r], f[r], i),
|
|
11
|
+
...s,
|
|
12
|
+
children: m.map((e) => /* @__PURE__ */ d(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: "flex flex-col items-center gap-2.5 border-border text-center sm:px-6",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ d(
|
|
18
|
+
"dd",
|
|
19
|
+
{
|
|
20
|
+
className: a(
|
|
21
|
+
x,
|
|
22
|
+
"text-4xl sm:text-5xl",
|
|
23
|
+
e.accent ? "text-primary" : void 0
|
|
24
|
+
),
|
|
25
|
+
children: [
|
|
26
|
+
e.value,
|
|
27
|
+
e.suffix ? /* @__PURE__ */ l("span", { className: o, children: e.suffix }) : null
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ l("dt", { className: "text-sm leading-5 text-muted-foreground", children: e.label }),
|
|
32
|
+
typeof e.delta == "number" ? /* @__PURE__ */ l(n, { delta: e.delta, className: "mt-0.5" }) : null,
|
|
33
|
+
e.sub ? /* @__PURE__ */ l("p", { className: "mt-1 max-w-[22ch] text-[13px] leading-5 text-muted-foreground", children: e.sub }) : null
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
e.label
|
|
37
|
+
))
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
u.displayName = "StatsDivided";
|
|
42
|
+
export {
|
|
43
|
+
u as StatsDivided
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=Divided.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divided.js","sources":["../../../../../src/components/Stats/variants/Divided.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cn } from \"../../../utils/cn\";\nimport { valueBase, suffixBase, gridCols, gridDivider, DeltaMark } from \"../parts\";\nimport type { Stat } from \"../types\";\n\ninterface DividedProps extends HTMLAttributes<HTMLDListElement> {\n stats: Stat[];\n columns?: 2 | 3 | 4;\n}\n\n/** divided — centered numerals in a symmetric run, divided by true vertical hairlines. */\nexport const StatsDivided = forwardRef<HTMLDListElement, DividedProps>(\n ({ className, stats, columns = 4, ...props }, ref) => (\n <dl\n ref={ref}\n className={cn(\"grid grid-cols-1 gap-y-10\", gridCols[columns], gridDivider[columns], className)}\n {...props}\n >\n {stats.map((stat) => (\n <div\n key={stat.label}\n className=\"flex flex-col items-center gap-2.5 border-border text-center sm:px-6\"\n >\n <dd\n className={cn(\n valueBase,\n \"text-4xl sm:text-5xl\",\n stat.accent ? \"text-primary\" : undefined,\n )}\n >\n {stat.value}\n {stat.suffix ? <span className={suffixBase}>{stat.suffix}</span> : null}\n </dd>\n <dt className=\"text-sm leading-5 text-muted-foreground\">{stat.label}</dt>\n {typeof stat.delta === \"number\" ? (\n <DeltaMark delta={stat.delta} className=\"mt-0.5\" />\n ) : null}\n {stat.sub ? (\n <p className=\"mt-1 max-w-[22ch] text-[13px] leading-5 text-muted-foreground\">\n {stat.sub}\n </p>\n ) : null}\n </div>\n ))}\n </dl>\n ),\n);\nStatsDivided.displayName = \"StatsDivided\";\n"],"names":["StatsDivided","forwardRef","className","stats","columns","props","ref","jsx","cn","gridCols","gridDivider","stat","jsxs","valueBase","suffixBase","DeltaMark"],"mappings":";;;;AAWO,MAAMA,IAAeC;AAAA,EAC1B,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,SAAAC,IAAU,GAAG,GAAGC,EAAA,GAASC,MAC5C,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE,EAAG,6BAA6BC,EAASL,CAAO,GAAGM,EAAYN,CAAO,GAAGF,CAAS;AAAA,MAC5F,GAAGG;AAAA,MAEH,UAAAF,EAAM,IAAI,CAACQ,MACV,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UAEV,UAAA;AAAA,YAAA,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWJ;AAAA,kBACTK;AAAA,kBACA;AAAA,kBACAF,EAAK,SAAS,iBAAiB;AAAA,gBAAA;AAAA,gBAGhC,UAAA;AAAA,kBAAAA,EAAK;AAAA,kBACLA,EAAK,SAAS,gBAAAJ,EAAC,QAAA,EAAK,WAAWO,GAAa,UAAAH,EAAK,QAAO,IAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,YAErE,gBAAAJ,EAAC,MAAA,EAAG,WAAU,2CAA2C,YAAK,OAAM;AAAA,YACnE,OAAOI,EAAK,SAAU,WACrB,gBAAAJ,EAACQ,GAAA,EAAU,OAAOJ,EAAK,OAAO,WAAU,SAAA,CAAS,IAC/C;AAAA,YACHA,EAAK,MACJ,gBAAAJ,EAAC,KAAA,EAAE,WAAU,iEACV,UAAAI,EAAK,KACR,IACE;AAAA,UAAA;AAAA,QAAA;AAAA,QArBCA,EAAK;AAAA,MAAA,CAuBb;AAAA,IAAA;AAAA,EAAA;AAGP;AACAX,EAAa,cAAc;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { cn as a } from "../../../utils/cn.js";
|
|
4
|
+
import { suffixBase as c, valueBase as t, DeltaMark as x, gridCols as p } from "../parts.js";
|
|
5
|
+
const f = n(
|
|
6
|
+
({ className: d, stats: m, columns: i = 4, ...s }, o) => /* @__PURE__ */ l(
|
|
7
|
+
"dl",
|
|
8
|
+
{
|
|
9
|
+
ref: o,
|
|
10
|
+
className: a("grid grid-cols-1 gap-x-10 gap-y-10", p[i], d),
|
|
11
|
+
...s,
|
|
12
|
+
children: m.map((e) => /* @__PURE__ */ r("div", { className: "border-t border-border pt-5", children: [
|
|
13
|
+
/* @__PURE__ */ l("dt", { className: "text-sm leading-5 text-muted-foreground", children: e.label }),
|
|
14
|
+
/* @__PURE__ */ r(
|
|
15
|
+
"dd",
|
|
16
|
+
{
|
|
17
|
+
className: a(
|
|
18
|
+
t,
|
|
19
|
+
"mt-3 text-5xl sm:text-6xl",
|
|
20
|
+
e.accent ? "text-primary" : void 0
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
e.value,
|
|
24
|
+
e.suffix ? /* @__PURE__ */ l("span", { className: c, children: e.suffix }) : null
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
typeof e.delta == "number" || e.sub ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap items-baseline gap-x-3 gap-y-1", children: [
|
|
29
|
+
typeof e.delta == "number" ? /* @__PURE__ */ l(x, { delta: e.delta }) : null,
|
|
30
|
+
e.sub ? /* @__PURE__ */ l("p", { className: "text-[13px] leading-5 text-muted-foreground", children: e.sub }) : null
|
|
31
|
+
] }) : null
|
|
32
|
+
] }, e.label))
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
f.displayName = "StatsStacked";
|
|
37
|
+
export {
|
|
38
|
+
f as StatsStacked
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Stacked.js.map
|