commerce-toolkit 0.1.0 → 0.2.0
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/category-card-link-BqMAG9Op.js +211 -0
- package/dist/category-card-link-BqMAG9Op.js.map +1 -0
- package/dist/category-card-link-BwSFHFcd.cjs +2 -0
- package/dist/category-card-link-BwSFHFcd.cjs.map +1 -0
- package/dist/category-card.cjs +1 -1
- package/dist/category-card.cjs.map +1 -1
- package/dist/category-card.js +23 -218
- package/dist/category-card.js.map +1 -1
- package/dist/checkbox-indicator-GNoyS6OL.cjs +2 -0
- package/dist/checkbox-indicator-GNoyS6OL.cjs.map +1 -0
- package/dist/checkbox-indicator-os50dewx.js +18 -0
- package/dist/checkbox-indicator-os50dewx.js.map +1 -0
- package/dist/{checkbox-indicator-Cfw9uH_b.js → checkbox-root-B9W2Y8rY.js} +74 -85
- package/dist/checkbox-root-B9W2Y8rY.js.map +1 -0
- package/dist/checkbox-root-g9HcYZCP.cjs +2 -0
- package/dist/checkbox-root-g9HcYZCP.cjs.map +1 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +5 -4
- package/dist/checkbox.js.map +1 -1
- package/dist/compare-card-specs-empty-BMLUSqQL.js +281 -0
- package/dist/compare-card-specs-empty-BMLUSqQL.js.map +1 -0
- package/dist/compare-card-specs-empty-ar5CneZv.cjs +2 -0
- package/dist/compare-card-specs-empty-ar5CneZv.cjs.map +1 -0
- package/dist/compare-card.cjs +2 -0
- package/dist/compare-card.cjs.map +1 -0
- package/dist/compare-card.js +65 -0
- package/dist/compare-card.js.map +1 -0
- package/dist/components/accordion/index.d.ts.map +1 -1
- package/dist/components/alert/index.d.ts.map +1 -1
- package/dist/components/banner/index.d.ts.map +1 -1
- package/dist/components/blog-post-card/index.d.ts.map +1 -1
- package/dist/components/card/index.d.ts.map +1 -1
- package/dist/components/carousel/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/chip/index.d.ts.map +1 -1
- package/dist/components/compare-card/compare-card.d.ts +45 -0
- package/dist/components/compare-card/compare-card.d.ts.map +1 -0
- package/dist/components/compare-card/index.d.ts +3 -0
- package/dist/components/compare-card/index.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-description-content.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-description-content.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-description-empty.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-description-empty.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-description-label.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-description-label.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-description.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-description.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-form-input.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-form-input.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-form.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-form.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-link.d.ts +5 -0
- package/dist/components/compare-card/primitives/compare-card-link.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-product.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-product.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-rating-empty.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-rating-empty.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-rating-label.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-rating-label.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-rating.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-rating.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-root.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-root.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-skeleton.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-skeleton.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-specs-definition.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-specs-definition.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-specs-empty.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-specs-empty.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-specs-label.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-specs-label.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-specs-list.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-specs-list.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-specs-term.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-specs-term.d.ts.map +1 -0
- package/dist/components/compare-card/primitives/compare-card-specs.d.ts +4 -0
- package/dist/components/compare-card/primitives/compare-card-specs.d.ts.map +1 -0
- package/dist/components/compare-card/primitives.d.ts +20 -0
- package/dist/components/compare-card/primitives.d.ts.map +1 -0
- package/dist/components/compare-drawer/index.d.ts.map +1 -1
- package/dist/components/cursor-pagination/index.d.ts +1 -1
- package/dist/components/cursor-pagination/index.d.ts.map +1 -1
- package/dist/components/dropdown-menu/index.d.ts.map +1 -1
- package/dist/components/favorite/index.d.ts.map +1 -1
- package/dist/components/icon/index.d.ts.map +1 -1
- package/dist/components/label/index.d.ts.map +1 -1
- package/dist/components/logo/index.d.ts.map +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/offset-pagination/index.d.ts +1 -1
- package/dist/components/offset-pagination/index.d.ts.map +1 -1
- package/dist/components/price/index.d.ts.map +1 -1
- package/dist/components/product-card/index.d.ts.map +1 -1
- package/dist/components/rating/index.d.ts.map +1 -1
- package/dist/components/reveal/index.d.ts.map +1 -1
- package/dist/components/scroll-area/index.d.ts.map +1 -1
- package/dist/components/side-panel/index.d.ts +3 -0
- package/dist/components/side-panel/index.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-body.d.ts +4 -0
- package/dist/components/side-panel/primitives/side-panel-body.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-close.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-close.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-content.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-content.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-header.d.ts +4 -0
- package/dist/components/side-panel/primitives/side-panel-header.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-overlay.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-overlay.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-portal.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-portal.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-root.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-root.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-title.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-title.d.ts.map +1 -0
- package/dist/components/side-panel/primitives/side-panel-trigger.d.ts +5 -0
- package/dist/components/side-panel/primitives/side-panel-trigger.d.ts.map +1 -0
- package/dist/components/side-panel/primitives.d.ts +10 -0
- package/dist/components/side-panel/primitives.d.ts.map +1 -0
- package/dist/components/side-panel/side-panel.d.ts +28 -0
- package/dist/components/side-panel/side-panel.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/tabs/index.d.ts.map +1 -1
- package/dist/{dropdown-menu-node-C7Z-zRyr.js → dropdown-menu-node-4Pe3uXjC.js} +2 -2
- package/dist/{dropdown-menu-node-C7Z-zRyr.js.map → dropdown-menu-node-4Pe3uXjC.js.map} +1 -1
- package/dist/{dropdown-menu-node-BB7FJzMX.cjs → dropdown-menu-node-zOplWIzZ.cjs} +2 -2
- package/dist/{dropdown-menu-node-BB7FJzMX.cjs.map → dropdown-menu-node-zOplWIzZ.cjs.map} +1 -1
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/index-BppAzNV8.cjs +6 -0
- package/dist/index-BppAzNV8.cjs.map +1 -0
- package/dist/index-ChSlzMYI.js +242 -0
- package/dist/index-ChSlzMYI.js.map +1 -0
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1275 -1133
- package/dist/index.js.map +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/modal-title-CuB6IpxH.cjs +2 -0
- package/dist/modal-title-CuB6IpxH.cjs.map +1 -0
- package/dist/modal-title-MIH3Xsp2.js +58 -0
- package/dist/modal-title-MIH3Xsp2.js.map +1 -0
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/offset-pagination-ellipsis-DWDhFCgW.js +79 -0
- package/dist/offset-pagination-ellipsis-DWDhFCgW.js.map +1 -0
- package/dist/offset-pagination-ellipsis-MCFHXB-5.cjs +2 -0
- package/dist/offset-pagination-ellipsis-MCFHXB-5.cjs.map +1 -0
- package/dist/offset-pagination.cjs +1 -1
- package/dist/offset-pagination.cjs.map +1 -1
- package/dist/offset-pagination.js +6 -76
- package/dist/offset-pagination.js.map +1 -1
- package/dist/product-card-label-CJmC9ICf.js +312 -0
- package/dist/product-card-label-CJmC9ICf.js.map +1 -0
- package/dist/product-card-label-D43AXtRL.cjs +2 -0
- package/dist/product-card-label-D43AXtRL.cjs.map +1 -0
- package/dist/product-card-root-4Xz4-pdL.js +43 -0
- package/dist/product-card-root-4Xz4-pdL.js.map +1 -0
- package/dist/product-card-root-BMTVhhFp.cjs +2 -0
- package/dist/product-card-root-BMTVhhFp.cjs.map +1 -0
- package/dist/product-card-skeleton-CCQkDMNl.cjs +2 -0
- package/dist/product-card-skeleton-CCQkDMNl.cjs.map +1 -0
- package/dist/product-card-skeleton-Dkqf-bfA.js +34 -0
- package/dist/product-card-skeleton-Dkqf-bfA.js.map +1 -0
- package/dist/product-card.cjs +1 -1
- package/dist/product-card.cjs.map +1 -1
- package/dist/product-card.js +25 -326
- package/dist/product-card.js.map +1 -1
- package/dist/{scroll-area-corner-DLTYMMl-.js → scroll-area-corner-Bq7PB1XK.js} +2 -2
- package/dist/{scroll-area-corner-DLTYMMl-.js.map → scroll-area-corner-Bq7PB1XK.js.map} +1 -1
- package/dist/{scroll-area-corner-CEc2oMZt.cjs → scroll-area-corner-DsyetkPH.cjs} +2 -2
- package/dist/{scroll-area-corner-CEc2oMZt.cjs.map → scroll-area-corner-DsyetkPH.cjs.map} +1 -1
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.js +1 -1
- package/dist/side-panel-close-Bjcn4BEE.cjs +2 -0
- package/dist/side-panel-close-Bjcn4BEE.cjs.map +1 -0
- package/dist/side-panel-close-DVJwOxdM.js +86 -0
- package/dist/side-panel-close-DVJwOxdM.js.map +1 -0
- package/dist/side-panel.cjs +2 -0
- package/dist/side-panel.cjs.map +1 -0
- package/dist/side-panel.js +13 -0
- package/dist/side-panel.js.map +1 -0
- package/package.json +21 -1
- package/dist/arrow-up-right-Cfau6CiE.cjs +0 -7
- package/dist/arrow-up-right-Cfau6CiE.cjs.map +0 -1
- package/dist/arrow-up-right-D7smpXBs.js +0 -16
- package/dist/arrow-up-right-D7smpXBs.js.map +0 -1
- package/dist/checkbox-indicator-BgXRGvAh.cjs +0 -2
- package/dist/checkbox-indicator-BgXRGvAh.cjs.map +0 -1
- package/dist/checkbox-indicator-Cfw9uH_b.js.map +0 -1
- package/dist/modal-title-B2Yr1KDi.js +0 -288
- package/dist/modal-title-B2Yr1KDi.js.map +0 -1
- package/dist/modal-title-CpD_Fors.cjs +0 -6
- package/dist/modal-title-CpD_Fors.cjs.map +0 -1
- package/dist/price-BwaeTmkR.js +0 -53
- package/dist/price-BwaeTmkR.js.map +0 -1
- package/dist/price-CdK2ye4P.cjs +0 -2
- package/dist/price-CdK2ye4P.cjs.map +0 -1
- package/dist/primitives--2McVg9Z.js +0 -15
- package/dist/primitives--2McVg9Z.js.map +0 -1
- package/dist/primitives-DmqzDKi2.cjs +0 -2
- package/dist/primitives-DmqzDKi2.cjs.map +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { S as g } from "./index-DD8W7cMj.js";
|
|
3
|
+
import { c } from "./utils-BOGlfttm.js";
|
|
4
|
+
import { createContext as h, useMemo as x, use as y } from "react";
|
|
5
|
+
const u = h(void 0);
|
|
6
|
+
function w({
|
|
7
|
+
className: r,
|
|
8
|
+
children: o,
|
|
9
|
+
as: t,
|
|
10
|
+
textColorScheme: a = "light",
|
|
11
|
+
iconColorScheme: e = "light",
|
|
12
|
+
aspectRatio: l = "5:6",
|
|
13
|
+
textSize: i = "small",
|
|
14
|
+
showOverlay: d = !0,
|
|
15
|
+
...f
|
|
16
|
+
}) {
|
|
17
|
+
const m = t ?? "article", v = x(
|
|
18
|
+
() => ({
|
|
19
|
+
textColorScheme: a,
|
|
20
|
+
iconColorScheme: e,
|
|
21
|
+
aspectRatio: l,
|
|
22
|
+
textSize: i,
|
|
23
|
+
showOverlay: d
|
|
24
|
+
}),
|
|
25
|
+
[a, e, l, i, d]
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ n(u.Provider, { value: v, children: /* @__PURE__ */ n(
|
|
28
|
+
m,
|
|
29
|
+
{
|
|
30
|
+
className: c(
|
|
31
|
+
"group relative flex w-full max-w-md cursor-pointer flex-col gap-2 rounded-[var(--category-card-border-radius,1rem)] font-[var(--category-card-font-family,var(--font-family-body))] @container",
|
|
32
|
+
{
|
|
33
|
+
small: "gap-2",
|
|
34
|
+
medium: "gap-3",
|
|
35
|
+
large: "gap-4",
|
|
36
|
+
"x-large": "gap-5"
|
|
37
|
+
}[i],
|
|
38
|
+
r
|
|
39
|
+
),
|
|
40
|
+
"data-slot": "category-card-root",
|
|
41
|
+
...f,
|
|
42
|
+
children: o
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
}
|
|
46
|
+
function s() {
|
|
47
|
+
const r = y(u);
|
|
48
|
+
if (r === void 0)
|
|
49
|
+
throw new Error("useCategoryCard must be used within a CategoryCardRoot");
|
|
50
|
+
return r;
|
|
51
|
+
}
|
|
52
|
+
function N({ className: r, children: o, ...t }) {
|
|
53
|
+
const { iconColorScheme: a } = s();
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
55
|
+
g,
|
|
56
|
+
{
|
|
57
|
+
className: c(
|
|
58
|
+
"absolute right-5 top-5 z-10 transition-transform duration-700 ease-out group-hover:-translate-y-1.5 group-hover:translate-x-1.5",
|
|
59
|
+
{
|
|
60
|
+
light: "text-[var(--category-card-light-icon,hsl(var(--foreground)))]",
|
|
61
|
+
dark: "text-[var(--category-card-dark-icon,hsl(var(--background)))]"
|
|
62
|
+
}[a],
|
|
63
|
+
r
|
|
64
|
+
),
|
|
65
|
+
"data-slot": "category-card-icon",
|
|
66
|
+
...t,
|
|
67
|
+
children: o
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function S({
|
|
72
|
+
className: r,
|
|
73
|
+
children: o,
|
|
74
|
+
...t
|
|
75
|
+
}) {
|
|
76
|
+
const { textColorScheme: a, aspectRatio: e } = s();
|
|
77
|
+
return /* @__PURE__ */ n(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: c(
|
|
81
|
+
"relative overflow-hidden rounded-[inherit] group-focus:ring-[var(--category-card-focus,hsl(var(--primary)))] group-focus-visible:ring-2",
|
|
82
|
+
{
|
|
83
|
+
light: "bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]",
|
|
84
|
+
dark: "bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]"
|
|
85
|
+
}[a],
|
|
86
|
+
{
|
|
87
|
+
"5:6": "aspect-[5/6]",
|
|
88
|
+
"3:4": "aspect-[3/4]",
|
|
89
|
+
"1:1": "aspect-square"
|
|
90
|
+
}[e],
|
|
91
|
+
r
|
|
92
|
+
),
|
|
93
|
+
"data-slot": "category-card-thumbnail",
|
|
94
|
+
...t,
|
|
95
|
+
children: o
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function _({
|
|
100
|
+
className: r,
|
|
101
|
+
children: o,
|
|
102
|
+
asChild: t = !1,
|
|
103
|
+
...a
|
|
104
|
+
}) {
|
|
105
|
+
const { textColorScheme: e } = s();
|
|
106
|
+
return /* @__PURE__ */ n(
|
|
107
|
+
t ? g : "img",
|
|
108
|
+
{
|
|
109
|
+
className: c(
|
|
110
|
+
"h-full w-full scale-100 select-none object-cover transition-transform duration-500 ease-out group-hover:scale-110",
|
|
111
|
+
{
|
|
112
|
+
light: "bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]",
|
|
113
|
+
dark: "bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]"
|
|
114
|
+
}[e],
|
|
115
|
+
r
|
|
116
|
+
),
|
|
117
|
+
"data-slot": "category-card-image",
|
|
118
|
+
...a
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function R({ className: r, children: o, ...t }) {
|
|
123
|
+
const { textColorScheme: a } = s();
|
|
124
|
+
return /* @__PURE__ */ n(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: c(
|
|
128
|
+
"break-words p-4 text-4xl font-bold leading-none tracking-tight transition-transform duration-500 ease-out group-hover:scale-105",
|
|
129
|
+
{
|
|
130
|
+
light: "[color:color-mix(in_oklab,hsl(var(--foreground))_30%,transparent)]",
|
|
131
|
+
dark: "[color:color-mix(in_oklab,hsl(var(--background))_30%,transparent)]"
|
|
132
|
+
}[a],
|
|
133
|
+
r
|
|
134
|
+
),
|
|
135
|
+
"data-slot": "category-card-fallback",
|
|
136
|
+
...t,
|
|
137
|
+
children: o
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
function j({ children: r, className: o, ...t }) {
|
|
142
|
+
const { showOverlay: a } = s();
|
|
143
|
+
return /* @__PURE__ */ n(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: c(
|
|
147
|
+
"absolute inset-0 flex items-end p-6 @xs:p-8",
|
|
148
|
+
a && "bg-gradient-to-b from-foreground/0 from-50% via-foreground/0 via-50% to-foreground/50 to-100%",
|
|
149
|
+
o
|
|
150
|
+
),
|
|
151
|
+
"data-slot": "category-card-overlay",
|
|
152
|
+
...t,
|
|
153
|
+
children: r
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
function E({ children: r, className: o, ...t }) {
|
|
158
|
+
const { textSize: a, textColorScheme: e } = s();
|
|
159
|
+
return /* @__PURE__ */ n(
|
|
160
|
+
"h3",
|
|
161
|
+
{
|
|
162
|
+
className: c(
|
|
163
|
+
"font-medium leading-tight",
|
|
164
|
+
{
|
|
165
|
+
small: "text-lg tracking-normal @xs:text-xl",
|
|
166
|
+
medium: "text-xl tracking-normal @xs:text-2xl",
|
|
167
|
+
large: "text-2xl tracking-tight @xs:text-3xl",
|
|
168
|
+
"x-large": "text-3xl tracking-tight @xs:text-4xl"
|
|
169
|
+
}[a],
|
|
170
|
+
{
|
|
171
|
+
light: "text-[var(--category-card-light-text,hsl(var(--foreground)))]",
|
|
172
|
+
dark: "text-[var(--category-card-dark-text,hsl(var(--background)))]"
|
|
173
|
+
}[e],
|
|
174
|
+
o
|
|
175
|
+
),
|
|
176
|
+
"data-slot": "category-card-title",
|
|
177
|
+
...t,
|
|
178
|
+
children: r
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
function I({ asChild: r = !1, className: o, ...t }) {
|
|
183
|
+
const { textColorScheme: a } = s();
|
|
184
|
+
return /* @__PURE__ */ n(
|
|
185
|
+
r ? g : "a",
|
|
186
|
+
{
|
|
187
|
+
className: c(
|
|
188
|
+
"absolute inset-0 rounded-[var(--category-card-border-radius,1rem)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--category-card-focus,hsl(var(--primary)))] focus-visible:ring-offset-4",
|
|
189
|
+
{
|
|
190
|
+
light: "ring-offset-[var(--category-card-light-offset,hsl(var(--background)))]",
|
|
191
|
+
dark: "ring-offset-[var(--category-card-dark-offset,hsl(var(--foreground)))]"
|
|
192
|
+
}[a],
|
|
193
|
+
o
|
|
194
|
+
),
|
|
195
|
+
"data-slot": "category-card-link",
|
|
196
|
+
...t
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
export {
|
|
201
|
+
w as C,
|
|
202
|
+
N as a,
|
|
203
|
+
S as b,
|
|
204
|
+
_ as c,
|
|
205
|
+
R as d,
|
|
206
|
+
j as e,
|
|
207
|
+
E as f,
|
|
208
|
+
I as g,
|
|
209
|
+
s as u
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=category-card-link-BqMAG9Op.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category-card-link-BqMAG9Op.js","sources":["../src/components/category-card/primitives/category-card-root.tsx","../src/components/category-card/primitives/category-card-icon.tsx","../src/components/category-card/primitives/category-card-thumbnail.tsx","../src/components/category-card/primitives/category-card-image.tsx","../src/components/category-card/primitives/category-card-fallback.tsx","../src/components/category-card/primitives/category-card-overlay.tsx","../src/components/category-card/primitives/category-card-title.tsx","../src/components/category-card/primitives/category-card-link.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, use, useMemo } from 'react';\nimport type { ComponentProps, ElementType } from 'react';\n\nimport { cn } from '@/lib';\n\ninterface CategoryCardContext {\n textColorScheme: 'light' | 'dark';\n iconColorScheme: 'light' | 'dark';\n aspectRatio: '5:6' | '3:4' | '1:1';\n textSize: 'small' | 'medium' | 'large' | 'x-large';\n showOverlay: boolean;\n}\n\nexport const CategoryCardContext = createContext<CategoryCardContext | undefined>(undefined);\n\nexport type CategoryCardRootProps<E extends ElementType = 'article'> = Omit<\n ComponentProps<E>,\n 'as'\n> & {\n as?: E;\n textColorScheme?: 'light' | 'dark';\n iconColorScheme?: 'light' | 'dark';\n aspectRatio?: '5:6' | '3:4' | '1:1';\n textSize?: 'small' | 'medium' | 'large' | 'x-large';\n showOverlay?: boolean;\n};\n\nexport function CategoryCardRoot<T extends ElementType = 'article'>({\n className,\n children,\n as,\n textColorScheme = 'light',\n iconColorScheme = 'light',\n aspectRatio = '5:6',\n textSize = 'small',\n showOverlay = true,\n ...props\n}: CategoryCardRootProps<T>) {\n const CategoryCardRootElement = as ?? 'article';\n\n const contextValues = useMemo(\n () => ({\n textColorScheme,\n iconColorScheme,\n aspectRatio,\n textSize,\n showOverlay,\n }),\n [textColorScheme, iconColorScheme, aspectRatio, textSize, showOverlay],\n );\n\n return (\n <CategoryCardContext.Provider value={contextValues}>\n <CategoryCardRootElement\n className={cn(\n 'group relative flex w-full max-w-md cursor-pointer flex-col gap-2 rounded-[var(--category-card-border-radius,1rem)] font-[var(--category-card-font-family,var(--font-family-body))] @container',\n {\n small: 'gap-2',\n medium: 'gap-3',\n large: 'gap-4',\n 'x-large': 'gap-5',\n }[textSize],\n className,\n )}\n data-slot=\"category-card-root\"\n {...props}\n >\n {children}\n </CategoryCardRootElement>\n </CategoryCardContext.Provider>\n );\n}\n\nexport function useCategoryCard() {\n const context = use(CategoryCardContext);\n\n if (context === undefined) {\n throw new Error('useCategoryCard must be used within a CategoryCardRoot');\n }\n\n return context;\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardIconProps = ComponentProps<typeof Slot>;\n\nexport function CategoryCardIcon({ className, children, ...props }: CategoryCardIconProps) {\n const { iconColorScheme } = useCategoryCard();\n\n return (\n <Slot\n className={cn(\n 'absolute right-5 top-5 z-10 transition-transform duration-700 ease-out group-hover:-translate-y-1.5 group-hover:translate-x-1.5',\n {\n light: 'text-[var(--category-card-light-icon,hsl(var(--foreground)))]',\n dark: 'text-[var(--category-card-dark-icon,hsl(var(--background)))]',\n }[iconColorScheme],\n className,\n )}\n data-slot=\"category-card-icon\"\n {...props}\n >\n {children}\n </Slot>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardThumbnailProps = ComponentProps<'div'>;\n\nexport function CategoryCardThumbnail({\n className,\n children,\n ...props\n}: CategoryCardThumbnailProps) {\n const { textColorScheme, aspectRatio } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-[inherit] group-focus:ring-[var(--category-card-focus,hsl(var(--primary)))] group-focus-visible:ring-2',\n {\n light: 'bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]',\n dark: 'bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]',\n }[textColorScheme],\n {\n '5:6': 'aspect-[5/6]',\n '3:4': 'aspect-[3/4]',\n '1:1': 'aspect-square',\n }[aspectRatio],\n className,\n )}\n data-slot=\"category-card-thumbnail\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardImageProps = ComponentProps<'img'> & {\n asChild?: boolean;\n};\n\nexport function CategoryCardImage({\n className,\n children,\n asChild = false,\n ...props\n}: CategoryCardImageProps) {\n const { textColorScheme } = useCategoryCard();\n\n const Component = asChild ? Slot : 'img';\n\n return (\n <Component\n className={cn(\n 'h-full w-full scale-100 select-none object-cover transition-transform duration-500 ease-out group-hover:scale-110',\n {\n light: 'bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]',\n dark: 'bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-image\"\n {...props}\n />\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardFallbackProps = ComponentProps<'div'>;\n\nexport function CategoryCardFallback({ className, children, ...props }: CategoryCardFallbackProps) {\n const { textColorScheme } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'break-words p-4 text-4xl font-bold leading-none tracking-tight transition-transform duration-500 ease-out group-hover:scale-105',\n {\n light: '[color:color-mix(in_oklab,hsl(var(--foreground))_30%,transparent)]',\n dark: '[color:color-mix(in_oklab,hsl(var(--background))_30%,transparent)]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-fallback\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardOverlayProps = ComponentProps<'div'>;\n\nexport function CategoryCardOverlay({ children, className, ...props }: CategoryCardOverlayProps) {\n const { showOverlay } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'absolute inset-0 flex items-end p-6 @xs:p-8',\n showOverlay &&\n 'bg-gradient-to-b from-foreground/0 from-50% via-foreground/0 via-50% to-foreground/50 to-100%',\n className,\n )}\n data-slot=\"category-card-overlay\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardTitleProps = ComponentProps<'h3'>;\n\nexport function CategoryCardTitle({ children, className, ...props }: CategoryCardTitleProps) {\n const { textSize, textColorScheme } = useCategoryCard();\n\n return (\n <h3\n className={cn(\n 'font-medium leading-tight',\n {\n small: 'text-lg tracking-normal @xs:text-xl',\n medium: 'text-xl tracking-normal @xs:text-2xl',\n large: 'text-2xl tracking-tight @xs:text-3xl',\n 'x-large': 'text-3xl tracking-tight @xs:text-4xl',\n }[textSize],\n {\n light: 'text-[var(--category-card-light-text,hsl(var(--foreground)))]',\n dark: 'text-[var(--category-card-dark-text,hsl(var(--background)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-title\"\n {...props}\n >\n {children}\n </h3>\n );\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport interface CategoryCardLinkProps extends ComponentProps<'a'> {\n asChild?: boolean;\n}\n\nexport function CategoryCardLink({ asChild = false, className, ...props }: CategoryCardLinkProps) {\n const { textColorScheme } = useCategoryCard();\n\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n className={cn(\n 'absolute inset-0 rounded-[var(--category-card-border-radius,1rem)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--category-card-focus,hsl(var(--primary)))] focus-visible:ring-offset-4',\n {\n light: 'ring-offset-[var(--category-card-light-offset,hsl(var(--background)))]',\n dark: 'ring-offset-[var(--category-card-dark-offset,hsl(var(--foreground)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-link\"\n {...props}\n />\n );\n}\n"],"names":["CategoryCardContext","createContext","CategoryCardRoot","className","children","as","textColorScheme","iconColorScheme","aspectRatio","textSize","showOverlay","props","CategoryCardRootElement","contextValues","useMemo","jsx","cn","useCategoryCard","context","use","CategoryCardIcon","Slot","CategoryCardThumbnail","CategoryCardImage","asChild","CategoryCardFallback","CategoryCardOverlay","CategoryCardTitle","CategoryCardLink"],"mappings":";;;;AAeO,MAAMA,IAAsBC,EAA+C,MAAS;AAcpF,SAASC,EAAoD;AAAA,EAClE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,iBAAAC,IAAkB;AAAA,EAClB,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,aAAAC,IAAc;AAAA,EAC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,EAAE,aAAAD,EAAA,IAAgBO,EAAA;AAExB,SACE,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAN,KACE;AAAA,QACFP;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MACT,GAAGQ;AAAA,MAEH,UAAAP;AAAA,IAAA;AAAA,EAAA;AAGP;ACjBO,SAASuB,EAAkB,EAAE,UAAAvB,GAAU,WAAAD,GAAW,GAAGQ,KAAiC;AAC3F,QAAM,EAAE,UAAAF,GAAU,iBAAAH,EAAA,IAAoBW,EAAA;AAEtC,SACE,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,UACE,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,WAAW;AAAA,QAAA,EACXP,CAAQ;AAAA,QACV;AAAA,UACE,OAAO;AAAA,UACP,MAAM;AAAA,QAAA,EACNH,CAAe;AAAA,QACjBH;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MACT,GAAGQ;AAAA,MAEH,UAAAP;AAAA,IAAA;AAAA,EAAA;AAGP;ACvBO,SAASwB,EAAiB,EAAE,SAAAJ,IAAU,IAAO,WAAArB,GAAW,GAAGQ,KAAgC;AAChG,QAAM,EAAE,iBAAAL,EAAA,IAAoBW,EAAA;AAI5B,SACE,gBAAAF;AAAA,IAHgBS,IAAUH,IAAO;AAAA,IAGhC;AAAA,MACC,WAAWL;AAAA,QACT;AAAA,QACA;AAAA,UACE,OAAO;AAAA,UACP,MAAM;AAAA,QAAA,EACNV,CAAe;AAAA,QACjBH;AAAA,MAAA;AAAA,MAEF,aAAU;AAAA,MACT,GAAGQ;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),i=require("./index-DGaxX11V.cjs"),c=require("./utils-LBH114_M.cjs"),d=require("react"),f=d.createContext(void 0);function m({className:r,children:o,as:t,textColorScheme:a="light",iconColorScheme:e="light",aspectRatio:l="5:6",textSize:g="small",showOverlay:u=!0,...x}){const v=t??"article",y=d.useMemo(()=>({textColorScheme:a,iconColorScheme:e,aspectRatio:l,textSize:g,showOverlay:u}),[a,e,l,g,u]);return n.jsx(f.Provider,{value:y,children:n.jsx(v,{className:c.cn("group relative flex w-full max-w-md cursor-pointer flex-col gap-2 rounded-[var(--category-card-border-radius,1rem)] font-[var(--category-card-font-family,var(--font-family-body))] @container",{small:"gap-2",medium:"gap-3",large:"gap-4","x-large":"gap-5"}[g],r),"data-slot":"category-card-root",...x,children:o})})}function s(){const r=d.use(f);if(r===void 0)throw new Error("useCategoryCard must be used within a CategoryCardRoot");return r}function C({className:r,children:o,...t}){const{iconColorScheme:a}=s();return n.jsx(i.Slot,{className:c.cn("absolute right-5 top-5 z-10 transition-transform duration-700 ease-out group-hover:-translate-y-1.5 group-hover:translate-x-1.5",{light:"text-[var(--category-card-light-icon,hsl(var(--foreground)))]",dark:"text-[var(--category-card-dark-icon,hsl(var(--background)))]"}[a],r),"data-slot":"category-card-icon",...t,children:o})}function h({className:r,children:o,...t}){const{textColorScheme:a,aspectRatio:e}=s();return n.jsx("div",{className:c.cn("relative overflow-hidden rounded-[inherit] group-focus:ring-[var(--category-card-focus,hsl(var(--primary)))] group-focus-visible:ring-2",{light:"bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]",dark:"bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]"}[a],{"5:6":"aspect-[5/6]","3:4":"aspect-[3/4]","1:1":"aspect-square"}[e],r),"data-slot":"category-card-thumbnail",...t,children:o})}function b({className:r,children:o,asChild:t=!1,...a}){const{textColorScheme:e}=s(),l=t?i.Slot:"img";return n.jsx(l,{className:c.cn("h-full w-full scale-100 select-none object-cover transition-transform duration-500 ease-out group-hover:scale-110",{light:"bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]",dark:"bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]"}[e],r),"data-slot":"category-card-image",...a})}function k({className:r,children:o,...t}){const{textColorScheme:a}=s();return n.jsx("div",{className:c.cn("break-words p-4 text-4xl font-bold leading-none tracking-tight transition-transform duration-500 ease-out group-hover:scale-105",{light:"[color:color-mix(in_oklab,hsl(var(--foreground))_30%,transparent)]",dark:"[color:color-mix(in_oklab,hsl(var(--background))_30%,transparent)]"}[a],r),"data-slot":"category-card-fallback",...t,children:o})}function p({children:r,className:o,...t}){const{showOverlay:a}=s();return n.jsx("div",{className:c.cn("absolute inset-0 flex items-end p-6 @xs:p-8",a&&"bg-gradient-to-b from-foreground/0 from-50% via-foreground/0 via-50% to-foreground/50 to-100%",o),"data-slot":"category-card-overlay",...t,children:r})}function j({children:r,className:o,...t}){const{textSize:a,textColorScheme:e}=s();return n.jsx("h3",{className:c.cn("font-medium leading-tight",{small:"text-lg tracking-normal @xs:text-xl",medium:"text-xl tracking-normal @xs:text-2xl",large:"text-2xl tracking-tight @xs:text-3xl","x-large":"text-3xl tracking-tight @xs:text-4xl"}[a],{light:"text-[var(--category-card-light-text,hsl(var(--foreground)))]",dark:"text-[var(--category-card-dark-text,hsl(var(--background)))]"}[e],o),"data-slot":"category-card-title",...t,children:r})}function w({asChild:r=!1,className:o,...t}){const{textColorScheme:a}=s(),e=r?i.Slot:"a";return n.jsx(e,{className:c.cn("absolute inset-0 rounded-[var(--category-card-border-radius,1rem)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--category-card-focus,hsl(var(--primary)))] focus-visible:ring-offset-4",{light:"ring-offset-[var(--category-card-light-offset,hsl(var(--background)))]",dark:"ring-offset-[var(--category-card-dark-offset,hsl(var(--foreground)))]"}[a],o),"data-slot":"category-card-link",...t})}exports.CategoryCardFallback=k;exports.CategoryCardIcon=C;exports.CategoryCardImage=b;exports.CategoryCardLink=w;exports.CategoryCardOverlay=p;exports.CategoryCardRoot=m;exports.CategoryCardThumbnail=h;exports.CategoryCardTitle=j;exports.useCategoryCard=s;
|
|
2
|
+
//# sourceMappingURL=category-card-link-BwSFHFcd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category-card-link-BwSFHFcd.cjs","sources":["../src/components/category-card/primitives/category-card-root.tsx","../src/components/category-card/primitives/category-card-icon.tsx","../src/components/category-card/primitives/category-card-thumbnail.tsx","../src/components/category-card/primitives/category-card-image.tsx","../src/components/category-card/primitives/category-card-fallback.tsx","../src/components/category-card/primitives/category-card-overlay.tsx","../src/components/category-card/primitives/category-card-title.tsx","../src/components/category-card/primitives/category-card-link.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, use, useMemo } from 'react';\nimport type { ComponentProps, ElementType } from 'react';\n\nimport { cn } from '@/lib';\n\ninterface CategoryCardContext {\n textColorScheme: 'light' | 'dark';\n iconColorScheme: 'light' | 'dark';\n aspectRatio: '5:6' | '3:4' | '1:1';\n textSize: 'small' | 'medium' | 'large' | 'x-large';\n showOverlay: boolean;\n}\n\nexport const CategoryCardContext = createContext<CategoryCardContext | undefined>(undefined);\n\nexport type CategoryCardRootProps<E extends ElementType = 'article'> = Omit<\n ComponentProps<E>,\n 'as'\n> & {\n as?: E;\n textColorScheme?: 'light' | 'dark';\n iconColorScheme?: 'light' | 'dark';\n aspectRatio?: '5:6' | '3:4' | '1:1';\n textSize?: 'small' | 'medium' | 'large' | 'x-large';\n showOverlay?: boolean;\n};\n\nexport function CategoryCardRoot<T extends ElementType = 'article'>({\n className,\n children,\n as,\n textColorScheme = 'light',\n iconColorScheme = 'light',\n aspectRatio = '5:6',\n textSize = 'small',\n showOverlay = true,\n ...props\n}: CategoryCardRootProps<T>) {\n const CategoryCardRootElement = as ?? 'article';\n\n const contextValues = useMemo(\n () => ({\n textColorScheme,\n iconColorScheme,\n aspectRatio,\n textSize,\n showOverlay,\n }),\n [textColorScheme, iconColorScheme, aspectRatio, textSize, showOverlay],\n );\n\n return (\n <CategoryCardContext.Provider value={contextValues}>\n <CategoryCardRootElement\n className={cn(\n 'group relative flex w-full max-w-md cursor-pointer flex-col gap-2 rounded-[var(--category-card-border-radius,1rem)] font-[var(--category-card-font-family,var(--font-family-body))] @container',\n {\n small: 'gap-2',\n medium: 'gap-3',\n large: 'gap-4',\n 'x-large': 'gap-5',\n }[textSize],\n className,\n )}\n data-slot=\"category-card-root\"\n {...props}\n >\n {children}\n </CategoryCardRootElement>\n </CategoryCardContext.Provider>\n );\n}\n\nexport function useCategoryCard() {\n const context = use(CategoryCardContext);\n\n if (context === undefined) {\n throw new Error('useCategoryCard must be used within a CategoryCardRoot');\n }\n\n return context;\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardIconProps = ComponentProps<typeof Slot>;\n\nexport function CategoryCardIcon({ className, children, ...props }: CategoryCardIconProps) {\n const { iconColorScheme } = useCategoryCard();\n\n return (\n <Slot\n className={cn(\n 'absolute right-5 top-5 z-10 transition-transform duration-700 ease-out group-hover:-translate-y-1.5 group-hover:translate-x-1.5',\n {\n light: 'text-[var(--category-card-light-icon,hsl(var(--foreground)))]',\n dark: 'text-[var(--category-card-dark-icon,hsl(var(--background)))]',\n }[iconColorScheme],\n className,\n )}\n data-slot=\"category-card-icon\"\n {...props}\n >\n {children}\n </Slot>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardThumbnailProps = ComponentProps<'div'>;\n\nexport function CategoryCardThumbnail({\n className,\n children,\n ...props\n}: CategoryCardThumbnailProps) {\n const { textColorScheme, aspectRatio } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-[inherit] group-focus:ring-[var(--category-card-focus,hsl(var(--primary)))] group-focus-visible:ring-2',\n {\n light: 'bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]',\n dark: 'bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]',\n }[textColorScheme],\n {\n '5:6': 'aspect-[5/6]',\n '3:4': 'aspect-[3/4]',\n '1:1': 'aspect-square',\n }[aspectRatio],\n className,\n )}\n data-slot=\"category-card-thumbnail\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardImageProps = ComponentProps<'img'> & {\n asChild?: boolean;\n};\n\nexport function CategoryCardImage({\n className,\n children,\n asChild = false,\n ...props\n}: CategoryCardImageProps) {\n const { textColorScheme } = useCategoryCard();\n\n const Component = asChild ? Slot : 'img';\n\n return (\n <Component\n className={cn(\n 'h-full w-full scale-100 select-none object-cover transition-transform duration-500 ease-out group-hover:scale-110',\n {\n light: 'bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]',\n dark: 'bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-image\"\n {...props}\n />\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardFallbackProps = ComponentProps<'div'>;\n\nexport function CategoryCardFallback({ className, children, ...props }: CategoryCardFallbackProps) {\n const { textColorScheme } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'break-words p-4 text-4xl font-bold leading-none tracking-tight transition-transform duration-500 ease-out group-hover:scale-105',\n {\n light: '[color:color-mix(in_oklab,hsl(var(--foreground))_30%,transparent)]',\n dark: '[color:color-mix(in_oklab,hsl(var(--background))_30%,transparent)]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-fallback\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardOverlayProps = ComponentProps<'div'>;\n\nexport function CategoryCardOverlay({ children, className, ...props }: CategoryCardOverlayProps) {\n const { showOverlay } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'absolute inset-0 flex items-end p-6 @xs:p-8',\n showOverlay &&\n 'bg-gradient-to-b from-foreground/0 from-50% via-foreground/0 via-50% to-foreground/50 to-100%',\n className,\n )}\n data-slot=\"category-card-overlay\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardTitleProps = ComponentProps<'h3'>;\n\nexport function CategoryCardTitle({ children, className, ...props }: CategoryCardTitleProps) {\n const { textSize, textColorScheme } = useCategoryCard();\n\n return (\n <h3\n className={cn(\n 'font-medium leading-tight',\n {\n small: 'text-lg tracking-normal @xs:text-xl',\n medium: 'text-xl tracking-normal @xs:text-2xl',\n large: 'text-2xl tracking-tight @xs:text-3xl',\n 'x-large': 'text-3xl tracking-tight @xs:text-4xl',\n }[textSize],\n {\n light: 'text-[var(--category-card-light-text,hsl(var(--foreground)))]',\n dark: 'text-[var(--category-card-dark-text,hsl(var(--background)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-title\"\n {...props}\n >\n {children}\n </h3>\n );\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport interface CategoryCardLinkProps extends ComponentProps<'a'> {\n asChild?: boolean;\n}\n\nexport function CategoryCardLink({ asChild = false, className, ...props }: CategoryCardLinkProps) {\n const { textColorScheme } = useCategoryCard();\n\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n className={cn(\n 'absolute inset-0 rounded-[var(--category-card-border-radius,1rem)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--category-card-focus,hsl(var(--primary)))] focus-visible:ring-offset-4',\n {\n light: 'ring-offset-[var(--category-card-light-offset,hsl(var(--background)))]',\n dark: 'ring-offset-[var(--category-card-dark-offset,hsl(var(--foreground)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-link\"\n {...props}\n />\n );\n}\n"],"names":["CategoryCardContext","createContext","CategoryCardRoot","className","children","as","textColorScheme","iconColorScheme","aspectRatio","textSize","showOverlay","props","CategoryCardRootElement","contextValues","useMemo","jsx","cn","useCategoryCard","context","use","CategoryCardIcon","Slot","CategoryCardThumbnail","CategoryCardImage","asChild","Component","CategoryCardFallback","CategoryCardOverlay","CategoryCardTitle","CategoryCardLink"],"mappings":"yIAeaA,EAAsBC,EAAAA,cAA+C,MAAS,EAcpF,SAASC,EAAoD,CAClE,UAAAC,EACA,SAAAC,EACA,GAAAC,EACA,gBAAAC,EAAkB,QAClB,gBAAAC,EAAkB,QAClB,YAAAC,EAAc,MACd,SAAAC,EAAW,QACX,YAAAC,EAAc,GACd,GAAGC,CACL,EAA6B,CAC3B,MAAMC,EAA0BP,GAAM,UAEhCQ,EAAgBC,EAAAA,QACpB,KAAO,CACL,gBAAAR,EACA,gBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,YAAAC,CAAA,GAEF,CAACJ,EAAiBC,EAAiBC,EAAaC,EAAUC,CAAW,CAAA,EAGvE,OACEK,EAAAA,IAACf,EAAoB,SAApB,CAA6B,MAAOa,EACnC,SAAAE,EAAAA,IAACH,EAAA,CACC,UAAWI,EAAAA,GACT,iMACA,CACE,MAAO,QACP,OAAQ,QACR,MAAO,QACP,UAAW,OAAA,EACXP,CAAQ,EACVN,CAAA,EAEF,YAAU,qBACT,GAAGQ,EAEH,SAAAP,CAAA,CAAA,EAEL,CAEJ,CAEO,SAASa,GAAkB,CAChC,MAAMC,EAAUC,EAAAA,IAAInB,CAAmB,EAEvC,GAAIkB,IAAY,OACd,MAAM,IAAI,MAAM,wDAAwD,EAG1E,OAAOA,CACT,CCzEO,SAASE,EAAiB,CAAE,UAAAjB,E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,SAAAP,CAAA,CAAA,CAGP,CClBO,SAASuB,EAAoB,CAAE,SAAAvB,EAAU,UAAAD,EAAW,GAAGQ,GAAmC,CAC/F,KAAM,CAAE,YAAAD,CAAA,EAAgBO,EAAA,EAExB,OACEF,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GACT,8CACAN,GACE,gGACFP,CAAA,EAEF,YAAU,wBACT,GAAGQ,EAEH,SAAAP,CAAA,CAAA,CAGP,CCjBO,SAASwB,EAAkB,CAAE,SAAAxB,EAAU,UAAAD,EAAW,GAAGQ,GAAiC,CAC3F,KAAM,CAAE,SAAAF,EAAU,gBAAAH,CAAA,EAAoBW,EAAA,EAEtC,OACEF,EAAAA,IAAC,KAAA,CACC,UAAWC,EAAAA,GACT,4BACA,CACE,MAAO,sCACP,OAAQ,uCACR,MAAO,uCACP,UAAW,sCAAA,EACXP,CAAQ,EACV,CACE,MAAO,gEACP,KAAM,8DAAA,EACNH,CAAe,EACjBH,CAAA,EAEF,YAAU,sBACT,GAAGQ,EAEH,SAAAP,CAAA,CAAA,CAGP,CCvBO,SAASyB,EAAiB,CAAE,QAAAL,EAAU,GAAO,UAAArB,EAAW,GAAGQ,GAAgC,CAChG,KAAM,CAAE,gBAAAL,CAAA,EAAoBW,EAAA,EAEtBQ,EAAYD,EAAUH,EAAAA,KAAO,IAEnC,OACEN,EAAAA,IAACU,EAAA,CACC,UAAWT,EAAAA,GACT,6MACA,CACE,MAAO,yEACP,KAAM,uEAAA,EACNV,CAAe,EACjBH,CAAA,EAEF,YAAU,qBACT,GAAGQ,CAAA,CAAA,CAGV"}
|
package/dist/category-card.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./category-card-link-BwSFHFcd.cjs"),a=require("react/jsx-runtime"),r=require("./utils-LBH114_M.cjs"),n=require("./skeleton-box-yQLivCqg.cjs"),c=require("./skeleton-text-CLzoDFvz.cjs");function l({className:t,...o}){const{aspectRatio:s}=e.useCategoryCard();return a.jsxs("div",{className:r.cn("@container",t),...o,"data-slot":"category-card-skeleton",children:[a.jsx(n.SkeletonBox,{className:r.cn("rounded-[var(--category-card-border-radius,1rem)]",{"5:6":"aspect-[5/6]","3:4":"aspect-[3/4]","1:1":"aspect-square"}[s])}),a.jsx("div",{className:"mt-3",children:a.jsx(c.SkeletonText,{characterCount:10,className:"rounded text-lg"})})]})}exports.Fallback=e.CategoryCardFallback;exports.Icon=e.CategoryCardIcon;exports.Image=e.CategoryCardImage;exports.Link=e.CategoryCardLink;exports.Overlay=e.CategoryCardOverlay;exports.Root=e.CategoryCardRoot;exports.Thumbnail=e.CategoryCardThumbnail;exports.Title=e.CategoryCardTitle;exports.useCategoryCard=e.useCategoryCard;exports.Skeleton=l;
|
|
2
2
|
//# sourceMappingURL=category-card.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-card.cjs","sources":["../src/components/category-card/primitives/category-card-root.tsx","../src/components/category-card/primitives/category-card-icon.tsx","../src/components/category-card/primitives/category-card-thumbnail.tsx","../src/components/category-card/primitives/category-card-image.tsx","../src/components/category-card/primitives/category-card-fallback.tsx","../src/components/category-card/primitives/category-card-overlay.tsx","../src/components/category-card/primitives/category-card-title.tsx","../src/components/category-card/primitives/category-card-link.tsx","../src/components/category-card/primitives/category-card-skeleton.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, use, useMemo } from 'react';\nimport type { ComponentProps, ElementType } from 'react';\n\nimport { cn } from '@/lib';\n\ninterface CategoryCardContext {\n textColorScheme: 'light' | 'dark';\n iconColorScheme: 'light' | 'dark';\n aspectRatio: '5:6' | '3:4' | '1:1';\n textSize: 'small' | 'medium' | 'large' | 'x-large';\n showOverlay: boolean;\n}\n\nexport const CategoryCardContext = createContext<CategoryCardContext | undefined>(undefined);\n\nexport type CategoryCardRootProps<E extends ElementType = 'article'> = Omit<\n ComponentProps<E>,\n 'as'\n> & {\n as?: E;\n textColorScheme?: 'light' | 'dark';\n iconColorScheme?: 'light' | 'dark';\n aspectRatio?: '5:6' | '3:4' | '1:1';\n textSize?: 'small' | 'medium' | 'large' | 'x-large';\n showOverlay?: boolean;\n};\n\nexport function CategoryCardRoot<T extends ElementType = 'article'>({\n className,\n children,\n as,\n textColorScheme = 'light',\n iconColorScheme = 'light',\n aspectRatio = '5:6',\n textSize = 'small',\n showOverlay = true,\n ...props\n}: CategoryCardRootProps<T>) {\n const CategoryCardRootElement = as ?? 'article';\n\n const contextValues = useMemo(\n () => ({\n textColorScheme,\n iconColorScheme,\n aspectRatio,\n textSize,\n showOverlay,\n }),\n [textColorScheme, iconColorScheme, aspectRatio, textSize, showOverlay],\n );\n\n return (\n <CategoryCardContext.Provider value={contextValues}>\n <CategoryCardRootElement\n className={cn(\n 'group relative flex w-full max-w-md cursor-pointer flex-col gap-2 rounded-[var(--category-card-border-radius,1rem)] font-[var(--category-card-font-family,var(--font-family-body))] @container',\n {\n small: 'gap-2',\n medium: 'gap-3',\n large: 'gap-4',\n 'x-large': 'gap-5',\n }[textSize],\n className,\n )}\n data-slot=\"category-card-root\"\n {...props}\n >\n {children}\n </CategoryCardRootElement>\n </CategoryCardContext.Provider>\n );\n}\n\nexport function useCategoryCard() {\n const context = use(CategoryCardContext);\n\n if (context === undefined) {\n throw new Error('useCategoryCard must be used within a CategoryCardRoot');\n }\n\n return context;\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardIconProps = ComponentProps<typeof Slot>;\n\nexport function CategoryCardIcon({ className, children, ...props }: CategoryCardIconProps) {\n const { iconColorScheme } = useCategoryCard();\n\n return (\n <Slot\n className={cn(\n 'absolute right-5 top-5 z-10 transition-transform duration-700 ease-out group-hover:-translate-y-1.5 group-hover:translate-x-1.5',\n {\n light: 'text-[var(--category-card-light-icon,hsl(var(--foreground)))]',\n dark: 'text-[var(--category-card-dark-icon,hsl(var(--background)))]',\n }[iconColorScheme],\n className,\n )}\n data-slot=\"category-card-icon\"\n {...props}\n >\n {children}\n </Slot>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardThumbnailProps = ComponentProps<'div'>;\n\nexport function CategoryCardThumbnail({\n className,\n children,\n ...props\n}: CategoryCardThumbnailProps) {\n const { textColorScheme, aspectRatio } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-[inherit] group-focus:ring-[var(--category-card-focus,hsl(var(--primary)))] group-focus-visible:ring-2',\n {\n light: 'bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]',\n dark: 'bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]',\n }[textColorScheme],\n {\n '5:6': 'aspect-[5/6]',\n '3:4': 'aspect-[3/4]',\n '1:1': 'aspect-square',\n }[aspectRatio],\n className,\n )}\n data-slot=\"category-card-thumbnail\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardImageProps = ComponentProps<'img'> & {\n asChild?: boolean;\n};\n\nexport function CategoryCardImage({\n className,\n children,\n asChild = false,\n ...props\n}: CategoryCardImageProps) {\n const { textColorScheme } = useCategoryCard();\n\n const Component = asChild ? Slot : 'img';\n\n return (\n <Component\n className={cn(\n 'h-full w-full scale-100 select-none object-cover transition-transform duration-500 ease-out group-hover:scale-110',\n {\n light: 'bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]',\n dark: 'bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-image\"\n {...props}\n />\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport type CategoryCardFallbackProps = ComponentProps<'div'>;\n\nexport function CategoryCardFallback({ className, children, ...props }: CategoryCardFallbackProps) {\n const { textColorScheme } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'break-words p-4 text-4xl font-bold leading-none tracking-tight transition-transform duration-500 ease-out group-hover:scale-105',\n {\n light: '[color:color-mix(in_oklab,hsl(var(--foreground))_30%,transparent)]',\n dark: '[color:color-mix(in_oklab,hsl(var(--background))_30%,transparent)]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-fallback\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardOverlayProps = ComponentProps<'div'>;\n\nexport function CategoryCardOverlay({ children, className, ...props }: CategoryCardOverlayProps) {\n const { showOverlay } = useCategoryCard();\n\n return (\n <div\n className={cn(\n 'absolute inset-0 flex items-end p-6 @xs:p-8',\n showOverlay &&\n 'bg-gradient-to-b from-foreground/0 from-50% via-foreground/0 via-50% to-foreground/50 to-100%',\n className,\n )}\n data-slot=\"category-card-overlay\"\n {...props}\n >\n {children}\n </div>\n );\n}\n","'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardTitleProps = ComponentProps<'h3'>;\n\nexport function CategoryCardTitle({ children, className, ...props }: CategoryCardTitleProps) {\n const { textSize, textColorScheme } = useCategoryCard();\n\n return (\n <h3\n className={cn(\n 'font-medium leading-tight',\n {\n small: 'text-lg tracking-normal @xs:text-xl',\n medium: 'text-xl tracking-normal @xs:text-2xl',\n large: 'text-2xl tracking-tight @xs:text-3xl',\n 'x-large': 'text-3xl tracking-tight @xs:text-4xl',\n }[textSize],\n {\n light: 'text-[var(--category-card-light-text,hsl(var(--foreground)))]',\n dark: 'text-[var(--category-card-dark-text,hsl(var(--background)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-title\"\n {...props}\n >\n {children}\n </h3>\n );\n}\n","'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ComponentProps } from 'react';\n\nimport { useCategoryCard } from '@/components/category-card';\nimport { cn } from '@/lib';\n\nexport interface CategoryCardLinkProps extends ComponentProps<'a'> {\n asChild?: boolean;\n}\n\nexport function CategoryCardLink({ asChild = false, className, ...props }: CategoryCardLinkProps) {\n const { textColorScheme } = useCategoryCard();\n\n const Component = asChild ? Slot : 'a';\n\n return (\n <Component\n className={cn(\n 'absolute inset-0 rounded-[var(--category-card-border-radius,1rem)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--category-card-focus,hsl(var(--primary)))] focus-visible:ring-offset-4',\n {\n light: 'ring-offset-[var(--category-card-light-offset,hsl(var(--background)))]',\n dark: 'ring-offset-[var(--category-card-dark-offset,hsl(var(--foreground)))]',\n }[textColorScheme],\n className,\n )}\n data-slot=\"category-card-link\"\n {...props}\n />\n );\n}\n","import type { ComponentProps } from 'react';\n\nimport * as SkeletonPrimitive from '@/components/skeleton';\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardSkeletonProps = ComponentProps<'div'>;\n\nexport function CategoryCardSkeleton({ className, ...props }: CategoryCardSkeletonProps) {\n const { aspectRatio } = useCategoryCard();\n\n return (\n <div className={cn('@container', className)} {...props} data-slot=\"category-card-skeleton\">\n <SkeletonPrimitive.Box\n className={cn(\n 'rounded-[var(--category-card-border-radius,1rem)]',\n {\n '5:6': 'aspect-[5/6]',\n '3:4': 'aspect-[3/4]',\n '1:1': 'aspect-square',\n }[aspectRatio],\n )}\n />\n <div className=\"mt-3\">\n <SkeletonPrimitive.Text characterCount={10} className=\"rounded text-lg\" />\n </div>\n </div>\n );\n}\n"],"names":["CategoryCardContext","createContext","CategoryCardRoot","className","children","as","textColorScheme","iconColorScheme","aspectRatio","textSize","showOverlay","props","CategoryCardRootElement","contextValues","useMemo","jsx","cn","useCategoryCard","context","use","CategoryCardIcon","Slot","CategoryCardThumbnail","CategoryCardImage","asChild","Component","CategoryCardFallback","CategoryCardOverlay","CategoryCardTitle","CategoryCardLink","CategoryCardSkeleton","jsxs","SkeletonPrimitive.Box","SkeletonPrimitive.Text"],"mappings":"+RAeaA,EAAsBC,EAAAA,cAA+C,MAAS,EAcpF,SAASC,EAAoD,CAClE,UAAAC,EACA,SAAAC,EACA,GAAAC,EACA,gBAAAC,EAAkB,QAClB,gBAAAC,EAAkB,QAClB,YAAAC,EAAc,MACd,SAAAC,EAAW,QACX,YAAAC,EAAc,GACd,GAAGC,CACL,EAA6B,CAC3B,MAAMC,EAA0BP,GAAM,UAEhCQ,EAAgBC,EAAAA,QACpB,KAAO,CACL,gBAAAR,EACA,gBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,YAAAC,CAAA,GAEF,CAACJ,EAAiBC,EAAiBC,EAAaC,EAAUC,CAAW,CAAA,EAGvE,OACEK,EAAAA,IAACf,EAAoB,SAApB,CAA6B,MAAOa,EACnC,SAAAE,EAAAA,IAACH,EAAA,CACC,UAAWI,EAAAA,GACT,iMACA,CACE,MAAO,QACP,OAAQ,QACR,MAAO,QACP,UAAW,OAAA,EACXP,CAAQ,EACVN,CAAA,EAEF,YAAU,qBACT,GAAGQ,EAEH,SAAAP,CAAA,CAAA,EAEL,CAEJ,CAEO,SAASa,GAAkB,CAChC,MAAMC,EAAUC,EAAAA,IAAInB,CAAmB,EAEvC,GAAIkB,IAAY,OACd,MAAM,IAAI,MAAM,wDAAwD,EAG1E,OAAOA,CACT,CCzEO,SAASE,EAAiB,CAAE,UAAAjB,EAAW,SAAAC,EAAU,GAAGO,GAAgC,CACzF,KAAM,CAAE,gBAAAJ,CAAA,EAAoBU,EAAA,EAE5B,OACEF,EAAAA,IAACM,EAAAA,KAAA,CACC,U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UAAU,OACb,SAAAA,EAAAA,IAACkB,EAAAA,aAAA,CAAuB,eAAgB,GAAI,UAAU,iBAAA,CAAkB,CAAA,CAC1E,CAAA,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"category-card.cjs","sources":["../src/components/category-card/primitives/category-card-skeleton.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport * as SkeletonPrimitive from '@/components/skeleton';\nimport { cn } from '@/lib';\n\nimport { useCategoryCard } from '../primitives';\n\nexport type CategoryCardSkeletonProps = ComponentProps<'div'>;\n\nexport function CategoryCardSkeleton({ className, ...props }: CategoryCardSkeletonProps) {\n const { aspectRatio } = useCategoryCard();\n\n return (\n <div className={cn('@container', className)} {...props} data-slot=\"category-card-skeleton\">\n <SkeletonPrimitive.Box\n className={cn(\n 'rounded-[var(--category-card-border-radius,1rem)]',\n {\n '5:6': 'aspect-[5/6]',\n '3:4': 'aspect-[3/4]',\n '1:1': 'aspect-square',\n }[aspectRatio],\n )}\n />\n <div className=\"mt-3\">\n <SkeletonPrimitive.Text characterCount={10} className=\"rounded text-lg\" />\n </div>\n </div>\n );\n}\n"],"names":["CategoryCardSkeleton","className","props","aspectRatio","useCategoryCard","jsxs","cn","jsx","SkeletonPrimitive.Box","SkeletonPrimitive.Text"],"mappings":"yRASO,SAASA,EAAqB,CAAE,UAAAC,EAAW,GAAGC,GAAoC,CACvF,KAAM,CAAE,YAAAC,CAAA,EAAgBC,kBAAA,EAExB,OACEC,OAAC,MAAA,CAAI,UAAWC,EAAAA,GAAG,aAAcL,CAAS,EAAI,GAAGC,EAAO,YAAU,yBAChE,SAAA,CAAAK,EAAAA,IAACC,EAAAA,YAAA,CACC,UAAWF,EAAAA,GACT,oDACA,CACE,MAAO,eACP,MAAO,eACP,MAAO,eAAA,EACPH,CAAW,CAAA,CACf,CAAA,EAEFI,EAAAA,IAAC,MAAA,CAAI,UAAU,OACb,SAAAA,EAAAA,IAACE,EAAAA,aAAA,CAAuB,eAAgB,GAAI,UAAU,iBAAA,CAAkB,CAAA,CAC1E,CAAA,EACF,CAEJ"}
|
package/dist/category-card.js
CHANGED
|
@@ -1,233 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import { S as
|
|
6
|
-
import { S as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
className: r,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
textColorScheme: o = "light",
|
|
13
|
-
iconColorScheme: c = "light",
|
|
14
|
-
aspectRatio: l = "5:6",
|
|
15
|
-
textSize: i = "small",
|
|
16
|
-
showOverlay: g = !0,
|
|
17
|
-
...m
|
|
18
|
-
}) {
|
|
19
|
-
const f = a ?? "article", v = y(
|
|
20
|
-
() => ({
|
|
21
|
-
textColorScheme: o,
|
|
22
|
-
iconColorScheme: c,
|
|
23
|
-
aspectRatio: l,
|
|
24
|
-
textSize: i,
|
|
25
|
-
showOverlay: g
|
|
26
|
-
}),
|
|
27
|
-
[o, c, l, i, g]
|
|
28
|
-
);
|
|
29
|
-
return /* @__PURE__ */ e(u.Provider, { value: v, children: /* @__PURE__ */ e(
|
|
30
|
-
f,
|
|
31
|
-
{
|
|
32
|
-
className: n(
|
|
33
|
-
"group relative flex w-full max-w-md cursor-pointer flex-col gap-2 rounded-[var(--category-card-border-radius,1rem)] font-[var(--category-card-font-family,var(--font-family-body))] @container",
|
|
34
|
-
{
|
|
35
|
-
small: "gap-2",
|
|
36
|
-
medium: "gap-3",
|
|
37
|
-
large: "gap-4",
|
|
38
|
-
"x-large": "gap-5"
|
|
39
|
-
}[i],
|
|
40
|
-
r
|
|
41
|
-
),
|
|
42
|
-
"data-slot": "category-card-root",
|
|
43
|
-
...m,
|
|
44
|
-
children: t
|
|
45
|
-
}
|
|
46
|
-
) });
|
|
47
|
-
}
|
|
48
|
-
function s() {
|
|
49
|
-
const r = p(u);
|
|
50
|
-
if (r === void 0)
|
|
51
|
-
throw new Error("useCategoryCard must be used within a CategoryCardRoot");
|
|
52
|
-
return r;
|
|
53
|
-
}
|
|
54
|
-
function _({ className: r, children: t, ...a }) {
|
|
55
|
-
const { iconColorScheme: o } = s();
|
|
56
|
-
return /* @__PURE__ */ e(
|
|
57
|
-
d,
|
|
58
|
-
{
|
|
59
|
-
className: n(
|
|
60
|
-
"absolute right-5 top-5 z-10 transition-transform duration-700 ease-out group-hover:-translate-y-1.5 group-hover:translate-x-1.5",
|
|
61
|
-
{
|
|
62
|
-
light: "text-[var(--category-card-light-icon,hsl(var(--foreground)))]",
|
|
63
|
-
dark: "text-[var(--category-card-dark-icon,hsl(var(--background)))]"
|
|
64
|
-
}[o],
|
|
65
|
-
r
|
|
66
|
-
),
|
|
67
|
-
"data-slot": "category-card-icon",
|
|
68
|
-
...a,
|
|
69
|
-
children: t
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
function j({
|
|
74
|
-
className: r,
|
|
75
|
-
children: t,
|
|
76
|
-
...a
|
|
77
|
-
}) {
|
|
78
|
-
const { textColorScheme: o, aspectRatio: c } = s();
|
|
79
|
-
return /* @__PURE__ */ e(
|
|
80
|
-
"div",
|
|
81
|
-
{
|
|
82
|
-
className: n(
|
|
83
|
-
"relative overflow-hidden rounded-[inherit] group-focus:ring-[var(--category-card-focus,hsl(var(--primary)))] group-focus-visible:ring-2",
|
|
84
|
-
{
|
|
85
|
-
light: "bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]",
|
|
86
|
-
dark: "bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]"
|
|
87
|
-
}[o],
|
|
88
|
-
{
|
|
89
|
-
"5:6": "aspect-[5/6]",
|
|
90
|
-
"3:4": "aspect-[3/4]",
|
|
91
|
-
"1:1": "aspect-square"
|
|
92
|
-
}[c],
|
|
93
|
-
r
|
|
94
|
-
),
|
|
95
|
-
"data-slot": "category-card-thumbnail",
|
|
96
|
-
...a,
|
|
97
|
-
children: t
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
function q({
|
|
102
|
-
className: r,
|
|
103
|
-
children: t,
|
|
104
|
-
asChild: a = !1,
|
|
105
|
-
...o
|
|
106
|
-
}) {
|
|
107
|
-
const { textColorScheme: c } = s();
|
|
108
|
-
return /* @__PURE__ */ e(
|
|
109
|
-
a ? d : "img",
|
|
110
|
-
{
|
|
111
|
-
className: n(
|
|
112
|
-
"h-full w-full scale-100 select-none object-cover transition-transform duration-500 ease-out group-hover:scale-110",
|
|
113
|
-
{
|
|
114
|
-
light: "bg-[var(--category-card-light-background,hsl(var(--contrast-100)))]",
|
|
115
|
-
dark: "bg-[var(--category-card-dark-background,hsl(var(--contrast-500)))]"
|
|
116
|
-
}[c],
|
|
117
|
-
r
|
|
118
|
-
),
|
|
119
|
-
"data-slot": "category-card-image",
|
|
120
|
-
...o
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
function E({ className: r, children: t, ...a }) {
|
|
125
|
-
const { textColorScheme: o } = s();
|
|
126
|
-
return /* @__PURE__ */ e(
|
|
127
|
-
"div",
|
|
128
|
-
{
|
|
129
|
-
className: n(
|
|
130
|
-
"break-words p-4 text-4xl font-bold leading-none tracking-tight transition-transform duration-500 ease-out group-hover:scale-105",
|
|
131
|
-
{
|
|
132
|
-
light: "[color:color-mix(in_oklab,hsl(var(--foreground))_30%,transparent)]",
|
|
133
|
-
dark: "[color:color-mix(in_oklab,hsl(var(--background))_30%,transparent)]"
|
|
134
|
-
}[o],
|
|
135
|
-
r
|
|
136
|
-
),
|
|
137
|
-
"data-slot": "category-card-fallback",
|
|
138
|
-
...a,
|
|
139
|
-
children: t
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
function F({ children: r, className: t, ...a }) {
|
|
144
|
-
const { showOverlay: o } = s();
|
|
145
|
-
return /* @__PURE__ */ e(
|
|
146
|
-
"div",
|
|
147
|
-
{
|
|
148
|
-
className: n(
|
|
149
|
-
"absolute inset-0 flex items-end p-6 @xs:p-8",
|
|
150
|
-
o && "bg-gradient-to-b from-foreground/0 from-50% via-foreground/0 via-50% to-foreground/50 to-100%",
|
|
151
|
-
t
|
|
152
|
-
),
|
|
153
|
-
"data-slot": "category-card-overlay",
|
|
154
|
-
...a,
|
|
155
|
-
children: r
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
function L({ children: r, className: t, ...a }) {
|
|
160
|
-
const { textSize: o, textColorScheme: c } = s();
|
|
161
|
-
return /* @__PURE__ */ e(
|
|
162
|
-
"h3",
|
|
163
|
-
{
|
|
164
|
-
className: n(
|
|
165
|
-
"font-medium leading-tight",
|
|
166
|
-
{
|
|
167
|
-
small: "text-lg tracking-normal @xs:text-xl",
|
|
168
|
-
medium: "text-xl tracking-normal @xs:text-2xl",
|
|
169
|
-
large: "text-2xl tracking-tight @xs:text-3xl",
|
|
170
|
-
"x-large": "text-3xl tracking-tight @xs:text-4xl"
|
|
171
|
-
}[o],
|
|
172
|
-
{
|
|
173
|
-
light: "text-[var(--category-card-light-text,hsl(var(--foreground)))]",
|
|
174
|
-
dark: "text-[var(--category-card-dark-text,hsl(var(--background)))]"
|
|
175
|
-
}[c],
|
|
176
|
-
t
|
|
177
|
-
),
|
|
178
|
-
"data-slot": "category-card-title",
|
|
179
|
-
...a,
|
|
180
|
-
children: r
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
function O({ asChild: r = !1, className: t, ...a }) {
|
|
185
|
-
const { textColorScheme: o } = s();
|
|
186
|
-
return /* @__PURE__ */ e(
|
|
187
|
-
r ? d : "a",
|
|
188
|
-
{
|
|
189
|
-
className: n(
|
|
190
|
-
"absolute inset-0 rounded-[var(--category-card-border-radius,1rem)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--category-card-focus,hsl(var(--primary)))] focus-visible:ring-offset-4",
|
|
191
|
-
{
|
|
192
|
-
light: "ring-offset-[var(--category-card-light-offset,hsl(var(--background)))]",
|
|
193
|
-
dark: "ring-offset-[var(--category-card-dark-offset,hsl(var(--foreground)))]"
|
|
194
|
-
}[o],
|
|
195
|
-
t
|
|
196
|
-
),
|
|
197
|
-
"data-slot": "category-card-link",
|
|
198
|
-
...a
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
function B({ className: r, ...t }) {
|
|
203
|
-
const { aspectRatio: a } = s();
|
|
204
|
-
return /* @__PURE__ */ h("div", { className: n("@container", r), ...t, "data-slot": "category-card-skeleton", children: [
|
|
205
|
-
/* @__PURE__ */ e(
|
|
206
|
-
C,
|
|
1
|
+
import { u as s } from "./category-card-link-BqMAG9Op.js";
|
|
2
|
+
import { d as x, a as C, c as S, g as y, e as b, C as h, b as v, f as N } from "./category-card-link-BqMAG9Op.js";
|
|
3
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
4
|
+
import { c as e } from "./utils-BOGlfttm.js";
|
|
5
|
+
import { S as n } from "./skeleton-box-BSzQ5f9Y.js";
|
|
6
|
+
import { S as m } from "./skeleton-text-Dd4GbnEz.js";
|
|
7
|
+
function f({ className: r, ...o }) {
|
|
8
|
+
const { aspectRatio: t } = s();
|
|
9
|
+
return /* @__PURE__ */ c("div", { className: e("@container", r), ...o, "data-slot": "category-card-skeleton", children: [
|
|
10
|
+
/* @__PURE__ */ a(
|
|
11
|
+
n,
|
|
207
12
|
{
|
|
208
|
-
className:
|
|
13
|
+
className: e(
|
|
209
14
|
"rounded-[var(--category-card-border-radius,1rem)]",
|
|
210
15
|
{
|
|
211
16
|
"5:6": "aspect-[5/6]",
|
|
212
17
|
"3:4": "aspect-[3/4]",
|
|
213
18
|
"1:1": "aspect-square"
|
|
214
|
-
}[
|
|
19
|
+
}[t]
|
|
215
20
|
)
|
|
216
21
|
}
|
|
217
22
|
),
|
|
218
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ a("div", { className: "mt-3", children: /* @__PURE__ */ a(m, { characterCount: 10, className: "rounded text-lg" }) })
|
|
219
24
|
] });
|
|
220
25
|
}
|
|
221
26
|
export {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
27
|
+
x as Fallback,
|
|
28
|
+
C as Icon,
|
|
29
|
+
S as Image,
|
|
30
|
+
y as Link,
|
|
31
|
+
b as Overlay,
|
|
32
|
+
h as Root,
|
|
33
|
+
f as Skeleton,
|
|
34
|
+
v as Thumbnail,
|
|
35
|
+
N as Title,
|
|
231
36
|
s as useCategoryCard
|
|
232
37
|
};
|
|
233
38
|
//# sourceMappingURL=category-card.js.map
|