@vkzstudio/muza-ui 1.1.0 → 1.3.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/components/Accordion/Accordion.d.ts +52 -2
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +111 -76
- package/dist/components/ArticleCard/ArticleCard.d.ts +178 -0
- package/dist/components/ArticleCard/ArticleCard.d.ts.map +1 -0
- package/dist/components/ArticleCard/ArticleCard.js +542 -0
- package/dist/components/ArticleCard/ArticleCard.stories.d.ts +14 -0
- package/dist/components/ArticleCard/ArticleCard.stories.d.ts.map +1 -0
- package/dist/components/ArticleCard/index.d.ts +2 -0
- package/dist/components/ArticleCard/index.d.ts.map +1 -0
- package/dist/components/ButtonArrow/ButtonArrow.js +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +5 -5
- package/dist/components/Calendar/index.d.ts +1 -2
- package/dist/components/Calendar/index.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +9 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +135 -133
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts +34 -0
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts.map +1 -0
- package/dist/components/CarouselSection/CarouselSection.stories.d.ts +8 -0
- package/dist/components/CarouselSection/CarouselSection.stories.d.ts.map +1 -0
- package/dist/components/CategoryCard/CategoryCard.d.ts +97 -0
- package/dist/components/CategoryCard/CategoryCard.d.ts.map +1 -0
- package/dist/components/CategoryCard/CategoryCard.js +152 -0
- package/dist/components/CategoryCard/CategoryCard.stories.d.ts +14 -0
- package/dist/components/CategoryCard/CategoryCard.stories.d.ts.map +1 -0
- package/dist/components/CategoryCard/index.d.ts +2 -0
- package/dist/components/CategoryCard/index.d.ts.map +1 -0
- package/dist/components/CategoryIcon/CategoryIcon.d.ts +45 -0
- package/dist/components/CategoryIcon/CategoryIcon.d.ts.map +1 -0
- package/dist/components/CategoryIcon/CategoryIcon.js +54 -0
- package/dist/components/CategoryIcon/CategoryIcon.stories.d.ts +10 -0
- package/dist/components/CategoryIcon/CategoryIcon.stories.d.ts.map +1 -0
- package/dist/components/CategoryIcon/index.d.ts +2 -0
- package/dist/components/CategoryIcon/index.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +5 -5
- package/dist/components/DotDivider/DotDivider.d.ts +35 -0
- package/dist/components/DotDivider/DotDivider.d.ts.map +1 -0
- package/dist/components/DotDivider/DotDivider.js +31 -0
- package/dist/components/DotDivider/DotDivider.stories.d.ts +10 -0
- package/dist/components/DotDivider/DotDivider.stories.d.ts.map +1 -0
- package/dist/components/DotDivider/index.d.ts +2 -0
- package/dist/components/DotDivider/index.d.ts.map +1 -0
- package/dist/components/HeartButton/HeartButton.d.ts +61 -0
- package/dist/components/HeartButton/HeartButton.d.ts.map +1 -0
- package/dist/components/HeartButton/HeartButton.js +88 -0
- package/dist/components/HeartButton/HeartButton.stories.d.ts +10 -0
- package/dist/components/HeartButton/HeartButton.stories.d.ts.map +1 -0
- package/dist/components/HeartButton/index.d.ts +2 -0
- package/dist/components/HeartButton/index.d.ts.map +1 -0
- package/dist/components/Icons/CustomBadges.d.ts +20 -0
- package/dist/components/Icons/CustomBadges.d.ts.map +1 -1
- package/dist/components/Icons/CustomBadges.js +176 -21
- package/dist/components/Icons/CustomIcons.d.ts +13 -0
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +50 -30
- package/dist/components/Icons/LogosAndBadges.stories.d.ts +2 -1
- package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +65 -55
- package/dist/components/LoginScreen/LoginScreen.d.ts +21 -2
- package/dist/components/LoginScreen/LoginScreen.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.js +32 -26
- package/dist/components/LoginScreen/LoginScreen.stories.d.ts +2 -2
- package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/OfferCard/OfferCard.d.ts +206 -0
- package/dist/components/OfferCard/OfferCard.d.ts.map +1 -0
- package/dist/components/OfferCard/OfferCard.js +423 -0
- package/dist/components/OfferCard/OfferCard.stories.d.ts +15 -0
- package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -0
- package/dist/components/OfferCard/index.d.ts +2 -0
- package/dist/components/OfferCard/index.d.ts.map +1 -0
- package/dist/components/PartnerCard/PartnerCard.d.ts +234 -0
- package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -0
- package/dist/components/PartnerCard/PartnerCard.js +591 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts +14 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -0
- package/dist/components/PartnerCard/index.d.ts +2 -0
- package/dist/components/PartnerCard/index.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.examples.d.ts +35 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.examples.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.stories.d.ts +11 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.stories.d.ts.map +1 -0
- package/dist/components/Rating/Rating.d.ts +62 -0
- package/dist/components/Rating/Rating.d.ts.map +1 -0
- package/dist/components/Rating/Rating.js +88 -0
- package/dist/components/Rating/Rating.stories.d.ts +12 -0
- package/dist/components/Rating/Rating.stories.d.ts.map +1 -0
- package/dist/components/Rating/index.d.ts +2 -0
- package/dist/components/Rating/index.d.ts.map +1 -0
- package/dist/components/RatingBlock/RatingBlock.d.ts +65 -0
- package/dist/components/RatingBlock/RatingBlock.d.ts.map +1 -0
- package/dist/components/RatingBlock/RatingBlock.js +92 -0
- package/dist/components/RatingBlock/RatingBlock.stories.d.ts +12 -0
- package/dist/components/RatingBlock/RatingBlock.stories.d.ts.map +1 -0
- package/dist/components/RatingBlock/index.d.ts +2 -0
- package/dist/components/RatingBlock/index.d.ts.map +1 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +5 -5
- package/dist/components/SearchFilters/SearchFilters.d.ts +88 -0
- package/dist/components/SearchFilters/SearchFilters.d.ts.map +1 -0
- package/dist/components/SearchFilters/SearchFilters.js +176 -0
- package/dist/components/SearchFilters/SearchFilters.stories.d.ts +12 -0
- package/dist/components/SearchFilters/SearchFilters.stories.d.ts.map +1 -0
- package/dist/components/SearchFilters/index.d.ts +2 -0
- package/dist/components/SearchFilters/index.d.ts.map +1 -0
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TransactionsListView/TransactionsListView.d.ts +152 -0
- package/dist/components/TransactionsListView/TransactionsListView.d.ts.map +1 -0
- package/dist/components/TransactionsListView/TransactionsListView.js +367 -0
- package/dist/components/TransactionsListView/TransactionsListView.stories.d.ts +12 -0
- package/dist/components/TransactionsListView/TransactionsListView.stories.d.ts.map +1 -0
- package/dist/components/TransactionsListView/index.d.ts +2 -0
- package/dist/components/TransactionsListView/index.d.ts.map +1 -0
- package/dist/components/VoucherCard/VoucherCard.d.ts +105 -0
- package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -0
- package/dist/components/VoucherCard/VoucherCard.js +167 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts +9 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -0
- package/dist/components/VoucherCard/index.d.ts +2 -0
- package/dist/components/VoucherCard/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +405 -352
- package/dist/muza-ui.css +1 -1
- package/dist/styles/primitives.css +5 -0
- package/dist/styles/token-colors.css +105 -30
- package/dist/styles/token-sizes.css +24 -0
- package/dist/translations/index.d.ts +2 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +30 -2
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +26 -2
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +30 -2
- package/dist/translations/resolvePluralTemplate.d.ts +10 -0
- package/dist/translations/resolvePluralTemplate.d.ts.map +1 -0
- package/dist/translations/resolvePluralTemplate.js +20 -0
- package/dist/translations/types.d.ts +57 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +116 -24
- package/dist/utils/disabledLinkProps.d.ts +14 -0
- package/dist/utils/disabledLinkProps.d.ts.map +1 -0
- package/dist/utils/disabledLinkProps.js +9 -0
- package/dist/{components/Calendar/utils → utils}/formatDate.d.ts +1 -1
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/formatDateRange.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/Calendar/utils/formatDate.d.ts.map +0 -1
- package/dist/components/Calendar/utils/formatDateRange.d.ts.map +0 -1
- /package/dist/{components/Calendar/utils → utils}/formatDate.js +0 -0
- /package/dist/{components/Calendar/utils → utils}/formatDateRange.d.ts +0 -0
- /package/dist/{components/Calendar/utils → utils}/formatDateRange.js +0 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { cva as z } from "class-variance-authority";
|
|
4
|
+
import { HeartButton as Q } from "../HeartButton/HeartButton.js";
|
|
5
|
+
import { Rating as U } from "../Rating/Rating.js";
|
|
6
|
+
import { cn as s } from "../../utils/cn.js";
|
|
7
|
+
import { Typography as n } from "../Typography/Typography.js";
|
|
8
|
+
import { disabledLinkProps as X } from "../../utils/disabledLinkProps.js";
|
|
9
|
+
import { Tag as Z } from "../Tag/Tag.js";
|
|
10
|
+
import { Flex as f } from "../Flex/Flex.js";
|
|
11
|
+
import { DotDivider as ee } from "../DotDivider/DotDivider.js";
|
|
12
|
+
import { Skeleton as o } from "../Skeleton/Skeleton.js";
|
|
13
|
+
const ae = z(
|
|
14
|
+
"group relative inline-flex border border-solid transition-colors focus-visible:outline-none data-[disabled=true]:pointer-events-none",
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
compact: "flex-col overflow-hidden rounded-comp-offer-card-compact-radius border-comp-offer-card-stroke-default has-[a:focus-visible]:border-comp-offer-card-stroke-focused has-[a:hover]:border-comp-offer-card-stroke-hover data-[disabled=true]:border-comp-offer-card-stroke-disabled",
|
|
19
|
+
search: "flex-row gap-comp-offer-card-search-gap border-transparent"
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
default: "",
|
|
23
|
+
promo: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
variant: "compact",
|
|
29
|
+
type: "default",
|
|
30
|
+
class: "bg-comp-offer-card-fill-def-default has-[a:focus-visible]:bg-comp-offer-card-fill-def-focused has-[a:hover]:bg-comp-offer-card-fill-def-hover data-[disabled=true]:bg-comp-offer-card-fill-def-disabled"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
variant: "compact",
|
|
34
|
+
type: "promo",
|
|
35
|
+
class: "bg-comp-offer-card-fill-promo-default has-[a:focus-visible]:bg-comp-offer-card-fill-promo-focused has-[a:hover]:bg-comp-offer-card-fill-promo-hover data-[disabled=true]:bg-comp-offer-card-fill-promo-disabled"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
defaultVariants: { variant: "compact", type: "default" }
|
|
39
|
+
}
|
|
40
|
+
), re = z("", {
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
compact: "text-text-dark-primary-def group-has-[a:focus-visible]:text-text-brand-focused group-has-[a:hover]:text-text-brand-hover group-data-[disabled=true]:text-text-dark-disabled",
|
|
44
|
+
search: "text-text-dark-primary-def group-has-[a:focus-visible]:text-text-brand-focused group-has-[a:hover]:text-text-brand-hover group-data-[disabled=true]:text-text-dark-disabled"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: { variant: "compact" }
|
|
48
|
+
}), oe = z("", {
|
|
49
|
+
variants: {
|
|
50
|
+
variant: {
|
|
51
|
+
compact: "mt-auto line-clamp-1 text-text-dark-secondary group-has-[a:focus-visible]:text-text-brand-focused group-data-[disabled=true]:text-text-dark-disabled",
|
|
52
|
+
search: "line-clamp-1 text-text-dark-secondary group-has-[a:focus-visible]:text-text-brand-focused group-data-[disabled=true]:text-text-dark-disabled"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: { variant: "compact" }
|
|
56
|
+
}), k = ({ rating: c, ratingCount: a, disabled: t }) => /* @__PURE__ */ r(f, { align: "center", gap: "2xs", children: [
|
|
57
|
+
/* @__PURE__ */ e(U, { value: c, allowHalf: !0, disabled: t }),
|
|
58
|
+
a != null && /* @__PURE__ */ r(
|
|
59
|
+
n,
|
|
60
|
+
{
|
|
61
|
+
component: "span",
|
|
62
|
+
variant: "body",
|
|
63
|
+
size: "sm",
|
|
64
|
+
weight: "regular",
|
|
65
|
+
fixY: !0,
|
|
66
|
+
className: s(
|
|
67
|
+
t ? "text-text-dark-disabled" : "text-text-dark-primary-def"
|
|
68
|
+
),
|
|
69
|
+
children: [
|
|
70
|
+
"(",
|
|
71
|
+
a,
|
|
72
|
+
")"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] });
|
|
77
|
+
k.displayName = "OfferCard.RatingRow";
|
|
78
|
+
const E = ({
|
|
79
|
+
variant: c = "compact",
|
|
80
|
+
color: a = "default",
|
|
81
|
+
type: t = "default",
|
|
82
|
+
className: l,
|
|
83
|
+
...m
|
|
84
|
+
}) => c === "compact" ? /* @__PURE__ */ r(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: s(
|
|
88
|
+
"inline-flex flex-col overflow-hidden rounded-comp-offer-card-compact-radius border border-solid border-comp-offer-card-stroke-default",
|
|
89
|
+
t === "promo" ? "bg-comp-offer-card-fill-promo-default" : "bg-comp-offer-card-fill-def-default",
|
|
90
|
+
l
|
|
91
|
+
),
|
|
92
|
+
...m,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ r("div", { className: "relative aspect-[288/162] w-full shrink-0 overflow-hidden", children: [
|
|
95
|
+
/* @__PURE__ */ e(
|
|
96
|
+
o,
|
|
97
|
+
{
|
|
98
|
+
color: a,
|
|
99
|
+
className: "absolute inset-0 size-full rounded-none"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ r("div", { className: "absolute top-comp-offer-card-compact-p-img right-comp-offer-card-compact-p-img left-comp-offer-card-compact-p-img flex items-center justify-between", children: [
|
|
103
|
+
/* @__PURE__ */ e(
|
|
104
|
+
o,
|
|
105
|
+
{
|
|
106
|
+
color: a,
|
|
107
|
+
className: "h-comp-tag-h-def w-16 rounded-full"
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
o,
|
|
112
|
+
{
|
|
113
|
+
color: a,
|
|
114
|
+
className: "size-comp-button-h-xs rounded-full"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ r(
|
|
120
|
+
f,
|
|
121
|
+
{
|
|
122
|
+
direction: "column",
|
|
123
|
+
flex: 1,
|
|
124
|
+
gap: "2xs",
|
|
125
|
+
className: "px-comp-offer-card-compact-p pt-comp-offer-card-compact-p-top pb-comp-offer-card-compact-p",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ e(o, { color: a, className: "h-5 w-full" }),
|
|
128
|
+
/* @__PURE__ */ e(o, { color: a, className: "h-5 w-3/4" }),
|
|
129
|
+
/* @__PURE__ */ e(o, { color: a, className: "mt-2xs h-4 w-32" }),
|
|
130
|
+
/* @__PURE__ */ e(o, { color: a, className: "mt-2xs h-4 w-24" })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
) : /* @__PURE__ */ r(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: s(
|
|
140
|
+
"inline-flex flex-row gap-comp-offer-card-search-gap",
|
|
141
|
+
l
|
|
142
|
+
),
|
|
143
|
+
...m,
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ r("div", { className: "relative h-comp-offer-card-search-h-img w-comp-offer-card-search-w-img shrink-0 overflow-hidden rounded-comp-offer-card-search-radius-img", children: [
|
|
146
|
+
/* @__PURE__ */ e(
|
|
147
|
+
o,
|
|
148
|
+
{
|
|
149
|
+
color: a,
|
|
150
|
+
className: "absolute inset-0 size-full rounded-none"
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ e("div", { className: "absolute top-comp-offer-card-search-p-img left-comp-offer-card-search-p-img", children: /* @__PURE__ */ e(
|
|
154
|
+
o,
|
|
155
|
+
{
|
|
156
|
+
color: a,
|
|
157
|
+
className: "size-comp-button-h-xs rounded-full"
|
|
158
|
+
}
|
|
159
|
+
) })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ r(
|
|
162
|
+
f,
|
|
163
|
+
{
|
|
164
|
+
direction: "column",
|
|
165
|
+
flex: 1,
|
|
166
|
+
gap: "sm",
|
|
167
|
+
className: "min-w-0 gap-comp-offer-card-search-gap-text pt-comp-offer-card-search-p-top-text",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ e(o, { color: a, className: "h-5 w-full" }),
|
|
170
|
+
/* @__PURE__ */ e(o, { color: a, className: "h-4 w-40" }),
|
|
171
|
+
/* @__PURE__ */ e(o, { color: a, className: "h-4 w-32" })
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
E.displayName = "OfferCard.Skeleton";
|
|
179
|
+
const y = ({
|
|
180
|
+
image: c,
|
|
181
|
+
alt: a,
|
|
182
|
+
wrapperClassName: t,
|
|
183
|
+
children: l
|
|
184
|
+
}) => /* @__PURE__ */ r("div", { className: t, children: [
|
|
185
|
+
/* @__PURE__ */ e(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
className: s(
|
|
189
|
+
"absolute inset-0 overflow-hidden",
|
|
190
|
+
"[&>img]:size-full [&>img]:object-cover",
|
|
191
|
+
"transition-transform duration-300 ease-out group-hover:scale-110",
|
|
192
|
+
"group-data-[disabled=true]:opacity-50",
|
|
193
|
+
"group-data-[disabled=true]:grayscale",
|
|
194
|
+
"group-data-[disabled=true]:group-hover:scale-100"
|
|
195
|
+
),
|
|
196
|
+
children: typeof c == "string" ? /* @__PURE__ */ e("img", { src: c, alt: a }) : c
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
l
|
|
200
|
+
] });
|
|
201
|
+
y.displayName = "OfferCard.ImageSlot";
|
|
202
|
+
const L = w.forwardRef(
|
|
203
|
+
(c, a) => {
|
|
204
|
+
const {
|
|
205
|
+
name: t,
|
|
206
|
+
image: l,
|
|
207
|
+
imageAlt: m,
|
|
208
|
+
logo: i,
|
|
209
|
+
logoAlt: T,
|
|
210
|
+
category: C,
|
|
211
|
+
description: p,
|
|
212
|
+
vendor: u,
|
|
213
|
+
rating: b,
|
|
214
|
+
ratingCount: j,
|
|
215
|
+
favorite: B,
|
|
216
|
+
defaultFavorite: O,
|
|
217
|
+
onFavoriteChange: h,
|
|
218
|
+
favoriteAriaLabel: H,
|
|
219
|
+
showFavorite: P = !0,
|
|
220
|
+
variant: g = "compact",
|
|
221
|
+
type: W = "default",
|
|
222
|
+
disabled: d = !1,
|
|
223
|
+
asChild: _ = !1,
|
|
224
|
+
href: $,
|
|
225
|
+
className: q,
|
|
226
|
+
children: v,
|
|
227
|
+
...G
|
|
228
|
+
} = c, R = m ?? t, V = T ?? `${u ?? t} logo`, J = re({ variant: g }), S = oe({ variant: g }), x = b != null, K = s(
|
|
229
|
+
ae({ variant: g, type: W }),
|
|
230
|
+
q
|
|
231
|
+
), A = 'outline-none after:absolute after:inset-0 after:rounded-[inherit] after:content-[""] focus-visible:outline-none', F = /* @__PURE__ */ e(
|
|
232
|
+
n,
|
|
233
|
+
{
|
|
234
|
+
component: "h3",
|
|
235
|
+
variant: "title",
|
|
236
|
+
size: "base",
|
|
237
|
+
weight: "medium",
|
|
238
|
+
className: s("line-clamp-2", J),
|
|
239
|
+
children: t
|
|
240
|
+
}
|
|
241
|
+
), I = _ && w.isValidElement(v) ? w.cloneElement(
|
|
242
|
+
v,
|
|
243
|
+
{
|
|
244
|
+
className: s(A, v.props.className),
|
|
245
|
+
...d ? X : null
|
|
246
|
+
},
|
|
247
|
+
F
|
|
248
|
+
) : /* @__PURE__ */ e("a", { href: d ? void 0 : $, className: A, children: F }), Y = P && /* @__PURE__ */ e(
|
|
249
|
+
Q,
|
|
250
|
+
{
|
|
251
|
+
active: B,
|
|
252
|
+
defaultActive: O,
|
|
253
|
+
onClick: h !== void 0 || O !== void 0 ? (se, M) => h == null ? void 0 : h(M) : void 0,
|
|
254
|
+
"aria-label": H,
|
|
255
|
+
disabled: d,
|
|
256
|
+
className: "relative z-10"
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
let N = null;
|
|
260
|
+
return g === "compact" ? N = /* @__PURE__ */ r(D, { children: [
|
|
261
|
+
/* @__PURE__ */ r("div", { className: "relative w-full shrink-0", children: [
|
|
262
|
+
/* @__PURE__ */ r(
|
|
263
|
+
y,
|
|
264
|
+
{
|
|
265
|
+
image: l,
|
|
266
|
+
alt: R,
|
|
267
|
+
wrapperClassName: "relative aspect-[288/162] w-full overflow-hidden",
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ e(
|
|
270
|
+
"div",
|
|
271
|
+
{
|
|
272
|
+
"aria-hidden": "true",
|
|
273
|
+
className: "absolute inset-0 bg-gradient-to-t from-black/0 from-50% to-black/70"
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
/* @__PURE__ */ r("div", { className: "absolute top-comp-offer-card-compact-p-img right-comp-offer-card-compact-p-img left-comp-offer-card-compact-p-img flex items-start justify-between gap-sm", children: [
|
|
277
|
+
C ? /* @__PURE__ */ e(
|
|
278
|
+
Z,
|
|
279
|
+
{
|
|
280
|
+
variant: "invert",
|
|
281
|
+
className: "min-w-[50px] shrink overflow-hidden",
|
|
282
|
+
children: C
|
|
283
|
+
}
|
|
284
|
+
) : /* @__PURE__ */ e("span", {}),
|
|
285
|
+
Y
|
|
286
|
+
] })
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
i && /* @__PURE__ */ e(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
className: s(
|
|
294
|
+
"pointer-events-none absolute bottom-comp-offer-card-compact-logo-y left-comp-offer-card-compact-logo-x z-10 size-comp-offer-card-compact-logo-size overflow-hidden rounded-full border-2 border-stroke-base-secondary bg-comp-offer-card-fill-def-default",
|
|
295
|
+
"[&>img]:size-full [&>img]:object-cover",
|
|
296
|
+
"group-data-[disabled=true]:grayscale"
|
|
297
|
+
),
|
|
298
|
+
children: typeof i == "string" ? /* @__PURE__ */ e("img", { src: i, alt: V }) : i
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] }),
|
|
302
|
+
/* @__PURE__ */ r(
|
|
303
|
+
f,
|
|
304
|
+
{
|
|
305
|
+
direction: "column",
|
|
306
|
+
flex: 1,
|
|
307
|
+
gap: "2xs",
|
|
308
|
+
className: "px-comp-offer-card-compact-p pt-comp-offer-card-compact-p-top pb-comp-offer-card-compact-p",
|
|
309
|
+
children: [
|
|
310
|
+
I,
|
|
311
|
+
x && /* @__PURE__ */ e(
|
|
312
|
+
k,
|
|
313
|
+
{
|
|
314
|
+
rating: b,
|
|
315
|
+
ratingCount: j,
|
|
316
|
+
disabled: d
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
p && /* @__PURE__ */ e(
|
|
320
|
+
n,
|
|
321
|
+
{
|
|
322
|
+
component: "span",
|
|
323
|
+
variant: "body",
|
|
324
|
+
size: "sm",
|
|
325
|
+
weight: "regular",
|
|
326
|
+
fixY: !0,
|
|
327
|
+
className: S,
|
|
328
|
+
children: p
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
] }) : N = /* @__PURE__ */ r(D, { children: [
|
|
335
|
+
/* @__PURE__ */ r(
|
|
336
|
+
y,
|
|
337
|
+
{
|
|
338
|
+
image: l,
|
|
339
|
+
alt: R,
|
|
340
|
+
wrapperClassName: "relative shrink-0 overflow-hidden rounded-comp-offer-card-search-radius-img h-comp-offer-card-search-h-img w-comp-offer-card-search-w-img",
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ e(
|
|
343
|
+
"div",
|
|
344
|
+
{
|
|
345
|
+
"aria-hidden": "true",
|
|
346
|
+
className: "absolute inset-0 bg-gradient-to-b from-black/50 to-black/0 to-50%"
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
i && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center bg-surface-base-overlay", children: /* @__PURE__ */ e("div", { className: "size-comp-offer-card-search-logo-size overflow-hidden rounded-full border-(length:--spacing-comp-offer-card-search-logo-stroke) border-solid border-stroke-base-secondary group-data-[disabled=true]:grayscale [&>img]:size-full [&>img]:object-cover", children: typeof i == "string" ? /* @__PURE__ */ e("img", { src: i, alt: V }) : i }) }),
|
|
350
|
+
/* @__PURE__ */ e("div", { className: "absolute top-comp-offer-card-search-p-img left-comp-offer-card-search-p-img", children: Y })
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
/* @__PURE__ */ r(
|
|
355
|
+
f,
|
|
356
|
+
{
|
|
357
|
+
direction: "column",
|
|
358
|
+
flex: 1,
|
|
359
|
+
className: "min-w-0 gap-comp-offer-card-search-gap-text pt-comp-offer-card-search-p-top-text",
|
|
360
|
+
children: [
|
|
361
|
+
I,
|
|
362
|
+
/* @__PURE__ */ r(f, { align: "center", gap: "sm", wrap: "wrap", children: [
|
|
363
|
+
u && /* @__PURE__ */ e(
|
|
364
|
+
n,
|
|
365
|
+
{
|
|
366
|
+
component: "span",
|
|
367
|
+
variant: "body",
|
|
368
|
+
size: "base",
|
|
369
|
+
weight: "regular",
|
|
370
|
+
fixY: !0,
|
|
371
|
+
className: s(
|
|
372
|
+
d ? "text-text-dark-disabled" : "text-text-dark-primary-def"
|
|
373
|
+
),
|
|
374
|
+
children: u
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
u && x && /* @__PURE__ */ e(ee, {}),
|
|
378
|
+
x && /* @__PURE__ */ e(
|
|
379
|
+
k,
|
|
380
|
+
{
|
|
381
|
+
rating: b,
|
|
382
|
+
ratingCount: j,
|
|
383
|
+
disabled: d
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
] }),
|
|
387
|
+
p && /* @__PURE__ */ e(
|
|
388
|
+
n,
|
|
389
|
+
{
|
|
390
|
+
component: "span",
|
|
391
|
+
variant: "body",
|
|
392
|
+
size: "sm",
|
|
393
|
+
weight: "regular",
|
|
394
|
+
fixY: !0,
|
|
395
|
+
className: S,
|
|
396
|
+
children: p
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
] }), /* @__PURE__ */ e(
|
|
403
|
+
"div",
|
|
404
|
+
{
|
|
405
|
+
ref: a,
|
|
406
|
+
className: K,
|
|
407
|
+
"data-disabled": d || void 0,
|
|
408
|
+
"aria-disabled": d || void 0,
|
|
409
|
+
...G,
|
|
410
|
+
children: N
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
L.displayName = "OfferCard";
|
|
416
|
+
const te = L;
|
|
417
|
+
te.Skeleton = E;
|
|
418
|
+
export {
|
|
419
|
+
te as OfferCard,
|
|
420
|
+
oe as offerCardDescriptionVariants,
|
|
421
|
+
re as offerCardTitleVariants,
|
|
422
|
+
ae as offerCardVariants
|
|
423
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { OfferCard } from './OfferCard';
|
|
3
|
+
declare const meta: Meta<typeof OfferCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof OfferCard>;
|
|
6
|
+
export declare const Compact: Story;
|
|
7
|
+
export declare const CompactSkeleton: Story;
|
|
8
|
+
export declare const CompactPromo: Story;
|
|
9
|
+
export declare const CompactPromoSkeleton: Story;
|
|
10
|
+
export declare const Search: Story;
|
|
11
|
+
export declare const SearchSkeleton: Story;
|
|
12
|
+
export declare const WithFavoriteControlled: Story;
|
|
13
|
+
export declare const WithFavoriteNonInteractive: Story;
|
|
14
|
+
export declare const AsChildLink: Story;
|
|
15
|
+
//# sourceMappingURL=OfferCard.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OfferCard.stories.d.ts","sourceRoot":"","sources":["../../../src/components/OfferCard/OfferCard.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAyIvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAiDhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,KA0BrB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAgB7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA2B1B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAgBlC,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KA4BpB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAyBpC,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAmBxC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OfferCard/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const partnerCardVariants: (props?: ({
|
|
4
|
+
variant?: "search" | "heroLarge" | "heroSmall" | "listView" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare const partnerCardTitleVariants: (props?: ({
|
|
7
|
+
variant?: "search" | "heroLarge" | "heroSmall" | "listView" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
type PartnerCardVariant = 'search' | 'heroLarge' | 'heroSmall' | 'listView';
|
|
10
|
+
/** Props for the `PartnerCard.Skeleton` subcomponent. */
|
|
11
|
+
export interface PartnerCardSkeletonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
12
|
+
/**
|
|
13
|
+
* Visual layout variant — mirrors `PartnerCard.variant` so the skeleton
|
|
14
|
+
* reserves the same footprint as the card it stands in for.
|
|
15
|
+
*
|
|
16
|
+
* @default 'search'
|
|
17
|
+
*/
|
|
18
|
+
variant?: PartnerCardVariant;
|
|
19
|
+
/**
|
|
20
|
+
* Skeleton color, forwarded to every inner `Skeleton` block. Use `'light'`
|
|
21
|
+
* when the skeleton sits on a tinted surface.
|
|
22
|
+
*
|
|
23
|
+
* @default 'default'
|
|
24
|
+
*/
|
|
25
|
+
color?: 'default' | 'light';
|
|
26
|
+
}
|
|
27
|
+
declare const PartnerCardSkeleton: {
|
|
28
|
+
({ variant, color, className, ...props }: PartnerCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Content props shared between the default-anchor and `asChild` shapes of
|
|
33
|
+
* PartnerCard.
|
|
34
|
+
*/
|
|
35
|
+
export interface PartnerCardBaseProps extends Omit<VariantProps<typeof partnerCardVariants>, 'variant'> {
|
|
36
|
+
/** Partner / venue title — rendered inside the clickable link. */
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Image source — either a URL string (rendered as a plain `<img>`) or a
|
|
40
|
+
* custom React node such as a Next.js `<Image>` element. The wrapper
|
|
41
|
+
* handles sizing, rounded corners, overflow, and the disabled dim; any
|
|
42
|
+
* direct `<img>` child is auto-stretched to fill the wrapper.
|
|
43
|
+
*/
|
|
44
|
+
image: string | React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Alt text for the built-in `<img>` (used when `image` is a string).
|
|
47
|
+
*
|
|
48
|
+
* - `search` — defaults to `name`.
|
|
49
|
+
* - `heroLarge` / `heroSmall` — defaults to `""` (the image is decorative;
|
|
50
|
+
* the title already conveys the meaning).
|
|
51
|
+
*
|
|
52
|
+
* Ignored when `image` is a custom React node.
|
|
53
|
+
*/
|
|
54
|
+
imageAlt?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Address line rendered under the title on the `search` variant. Ignored
|
|
57
|
+
* on the hero variants.
|
|
58
|
+
*/
|
|
59
|
+
address?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Pre-formatted distance string (e.g. `"20 km"`) rendered next to the map
|
|
62
|
+
* button on the `search` variant. Format the value on the consumer side.
|
|
63
|
+
* Ignored on the hero variants.
|
|
64
|
+
*/
|
|
65
|
+
distance?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Display-only rating (0–5). Renders the existing `Rating` component with
|
|
68
|
+
* `allowHalf` and `disabled` (display mode). Omit to hide the rating row.
|
|
69
|
+
*/
|
|
70
|
+
rating?: number;
|
|
71
|
+
/** Review count shown as `(N)` next to the rating. Only shown when `rating` is set. */
|
|
72
|
+
ratingCount?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Single category label rendered as a glass-style chip on the hero
|
|
75
|
+
* variants (`heroLarge`, `heroSmall`). When `tags` is also provided on a
|
|
76
|
+
* hero variant, `category` renders first followed by the entries of
|
|
77
|
+
* `tags`, capped together by `maxNumberOfVisibleTags` with a `+N`
|
|
78
|
+
* overflow chip. Ignored on `search` — use `categoryIcon` + `tags` for
|
|
79
|
+
* the search row instead.
|
|
80
|
+
*/
|
|
81
|
+
category?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Icon node rendered inside the colored `CategoryIcon` badge (search
|
|
84
|
+
* variant). Pair with `categoryColor`. Omit both to hide the badge.
|
|
85
|
+
*/
|
|
86
|
+
categoryIcon?: React.ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Color used for the `CategoryIcon` badge background tint and icon
|
|
89
|
+
* foreground (search variant). Required when `categoryIcon` is set.
|
|
90
|
+
*/
|
|
91
|
+
categoryColor?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Additional category / partner-type chips. On the `search` variant they
|
|
94
|
+
* render next to the `CategoryIcon`; on the hero variants they render
|
|
95
|
+
* after `category` in the glass-style chip row. Overflow collapses into a
|
|
96
|
+
* `+N` counter chip (mirrors the `MultiSelect`/`ArticleCard` pattern). On
|
|
97
|
+
* `search`, the visible count is forced to 1 below the mobile breakpoint
|
|
98
|
+
* (≤768px) — same behavior as `ArticleCard`.
|
|
99
|
+
*/
|
|
100
|
+
tags?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* Maximum number of chips rendered before overflow collapses into a `+N`
|
|
103
|
+
* counter chip. On the hero variants this caps the combined total of
|
|
104
|
+
* `category` (if set) and `tags`.
|
|
105
|
+
*
|
|
106
|
+
* @default 3
|
|
107
|
+
*/
|
|
108
|
+
maxNumberOfVisibleTags?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Optional partner / merchant logo rendered centered on a dark overlay on
|
|
111
|
+
* top of the `search` image. Either a URL string (rendered as a plain
|
|
112
|
+
* `<img>`) or a custom React node such as a Next.js `<Image>`.
|
|
113
|
+
*/
|
|
114
|
+
logo?: string | React.ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* Alt text for the built-in logo `<img>` (used when `logo` is a string).
|
|
117
|
+
* Defaults to `${name} logo`. Ignored when `logo` is a custom React node.
|
|
118
|
+
*/
|
|
119
|
+
logoAlt?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Controlled favorite state for the embedded `HeartButton`. When provided,
|
|
122
|
+
* the heart does not manage its own state.
|
|
123
|
+
*/
|
|
124
|
+
favorite?: boolean;
|
|
125
|
+
/** Initial favorite state for uncontrolled usage. @default false */
|
|
126
|
+
defaultFavorite?: boolean;
|
|
127
|
+
/** Fires when the favorite is toggled. Receives the new active value. */
|
|
128
|
+
onFavoriteChange?: (active: boolean) => void;
|
|
129
|
+
/**
|
|
130
|
+
* Accessible label for the embedded `HeartButton`. Defaults to the
|
|
131
|
+
* localized `translations.heartButton.toggleFavorite`.
|
|
132
|
+
*/
|
|
133
|
+
favoriteAriaLabel?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Whether to render the embedded `HeartButton` on the `search` variant.
|
|
136
|
+
* Has no effect on the hero variants (hero cards never render a heart).
|
|
137
|
+
*
|
|
138
|
+
* @default true
|
|
139
|
+
*/
|
|
140
|
+
showFavorite?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Fires when the "Map" button is clicked on the `search` variant. Pass
|
|
143
|
+
* this handler to render the map button; omit to hide it. Ignored on
|
|
144
|
+
* the hero variants.
|
|
145
|
+
*/
|
|
146
|
+
onMapClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Override for the map-button label.
|
|
149
|
+
*
|
|
150
|
+
* @default translations.partnerCard.mapButton
|
|
151
|
+
*/
|
|
152
|
+
mapLabel?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Visual layout variant.
|
|
155
|
+
*
|
|
156
|
+
* - `search` — horizontal image-left card for partner result lists.
|
|
157
|
+
* Reflows to a narrower image-left layout on mobile.
|
|
158
|
+
* - `heroLarge` — large image-as-background card with a glass-style
|
|
159
|
+
* category tag and overlaid title. Renders `h-full w-full` and fills
|
|
160
|
+
* whatever cell its parent grid hands it.
|
|
161
|
+
* - `heroSmall` — same archetype as `heroLarge` (image background, glass
|
|
162
|
+
* category tag, overlaid title) with tighter padding, smaller gap, and
|
|
163
|
+
* a smaller title — sized for the secondary tiles in a bento layout.
|
|
164
|
+
* Also renders `h-full w-full`, so the consumer's grid cell decides
|
|
165
|
+
* the dimensions.
|
|
166
|
+
* - `listView` — compact card with a square thumbnail on the left for
|
|
167
|
+
* tightly-packed result lists. The text column reflows at the `md`
|
|
168
|
+
* breakpoint (768px): on desktop, distance and address sit on a single
|
|
169
|
+
* inline row separated by a `DotDivider`; on mobile they split onto
|
|
170
|
+
* their own lines and the rating row moves directly under the title.
|
|
171
|
+
* `onMapClick` and `logo` are ignored on this variant — the design has
|
|
172
|
+
* no slot for them.
|
|
173
|
+
*
|
|
174
|
+
* @default 'search'
|
|
175
|
+
*/
|
|
176
|
+
variant?: PartnerCardVariant;
|
|
177
|
+
/**
|
|
178
|
+
* Disabled visual state. Dims the image and grays the text. The anchor's
|
|
179
|
+
* `href` is also stripped so the card is non-navigable; the embedded
|
|
180
|
+
* `HeartButton` and map `Button` disable alongside the card.
|
|
181
|
+
*
|
|
182
|
+
* @default false
|
|
183
|
+
*/
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Default shape — PartnerCard renders an `<a href>` (stretched-link) as the
|
|
188
|
+
* primary clickable surface and the structured content as siblings.
|
|
189
|
+
*/
|
|
190
|
+
export interface PartnerCardLinkProps extends PartnerCardBaseProps, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'title' | 'children' | 'href' | 'type'> {
|
|
191
|
+
/**
|
|
192
|
+
* URL the card navigates to when activated. Required unless `asChild` is
|
|
193
|
+
* used. Stripped from the rendered DOM when `disabled` is true so the
|
|
194
|
+
* anchor becomes non-navigable while keeping its visual state.
|
|
195
|
+
*/
|
|
196
|
+
href: string;
|
|
197
|
+
/** Discriminant: omit (or set to `false`) for the built-in `<a>` shape. Set to `true` to switch to the `asChild` shape. */
|
|
198
|
+
asChild?: false;
|
|
199
|
+
/** Not accepted in the default `<a>` shape — the card composes its own structured content. Use `asChild` to swap the inner link element. */
|
|
200
|
+
children?: never;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Escape-hatch shape — hand the clickable anchor off to a consumer-provided
|
|
204
|
+
* `<Link>` (Next.js, React Router, …) via Radix `Slot`. The card's
|
|
205
|
+
* structured content stays in the wrapping `<div>`; only the inner link
|
|
206
|
+
* element is swapped.
|
|
207
|
+
*/
|
|
208
|
+
export interface PartnerCardAsChildProps extends PartnerCardBaseProps, Omit<React.HTMLAttributes<HTMLElement>, 'title' | 'children'> {
|
|
209
|
+
/**
|
|
210
|
+
* Replaces the built-in `<a>` link element with the consumer's child via
|
|
211
|
+
* Radix `Slot`, so the click target can be a router `<Link>` (Next.js,
|
|
212
|
+
* React Router, …). Pass a self-closing element; the card injects the
|
|
213
|
+
* title as its child.
|
|
214
|
+
*/
|
|
215
|
+
asChild: true;
|
|
216
|
+
/** Self-closing link element to use as the click target. Its children are replaced with the card title. */
|
|
217
|
+
children: React.ReactElement;
|
|
218
|
+
/** Not accepted in the `asChild` shape — set `href` on the consumer-provided child instead. */
|
|
219
|
+
href?: never;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Props for the PartnerCard component.
|
|
223
|
+
*
|
|
224
|
+
* The card is a link by default. Pass `href` for the built-in `<a>`, or
|
|
225
|
+
* `asChild` with a self-closing child to swap in a router `<Link>`.
|
|
226
|
+
*/
|
|
227
|
+
export type PartnerCardProps = PartnerCardLinkProps | PartnerCardAsChildProps;
|
|
228
|
+
declare const PartnerCard: React.ForwardRefExoticComponent<PartnerCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
229
|
+
declare const PartnerCardWithSkeleton: typeof PartnerCard & {
|
|
230
|
+
Skeleton: typeof PartnerCardSkeleton;
|
|
231
|
+
};
|
|
232
|
+
export { PartnerCardWithSkeleton as PartnerCard, partnerCardVariants, partnerCardTitleVariants, };
|
|
233
|
+
export type { PartnerCardVariant };
|
|
234
|
+
//# sourceMappingURL=PartnerCard.d.ts.map
|