@vkzstudio/muza-ui 1.6.0 → 1.8.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.
Files changed (53) hide show
  1. package/dist/components/ArticleCard/ArticleCard.d.ts.map +1 -1
  2. package/dist/components/ArticleCard/ArticleCard.js +161 -170
  3. package/dist/components/CarouselSection/CarouselSection.examples.d.ts +1 -1
  4. package/dist/components/Dialog/Dialog.d.ts +19 -6
  5. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  6. package/dist/components/Dialog/Dialog.js +148 -112
  7. package/dist/components/Dialog/Dialog.stories.d.ts +3 -0
  8. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  9. package/dist/components/OfferCard/OfferCard.d.ts +45 -17
  10. package/dist/components/OfferCard/OfferCard.d.ts.map +1 -1
  11. package/dist/components/OfferCard/OfferCard.js +180 -266
  12. package/dist/components/OfferCard/OfferCard.stories.d.ts +5 -2
  13. package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -1
  14. package/dist/components/PartnerCard/PartnerCard.d.ts +90 -26
  15. package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -1
  16. package/dist/components/PartnerCard/PartnerCard.js +323 -264
  17. package/dist/components/PartnerCard/PartnerCard.stories.d.ts +6 -0
  18. package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -1
  19. package/dist/components/PriceTag/PriceTag.d.ts +37 -0
  20. package/dist/components/PriceTag/PriceTag.d.ts.map +1 -0
  21. package/dist/components/PriceTag/PriceTag.js +43 -0
  22. package/dist/components/PriceTag/PriceTag.stories.d.ts +8 -0
  23. package/dist/components/PriceTag/PriceTag.stories.d.ts.map +1 -0
  24. package/dist/components/PriceTag/index.d.ts +2 -0
  25. package/dist/components/PriceTag/index.d.ts.map +1 -0
  26. package/dist/components/PriceTag/index.js +5 -0
  27. package/dist/components/Tooltip/Tooltip.d.ts +18 -7
  28. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  29. package/dist/components/Tooltip/Tooltip.js +116 -68
  30. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
  31. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  32. package/dist/components/VoucherCard/VoucherCard.d.ts +24 -1
  33. package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -1
  34. package/dist/components/VoucherCard/VoucherCard.js +68 -76
  35. package/dist/components/VoucherCard/VoucherCard.stories.d.ts +1 -0
  36. package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -1
  37. package/dist/components/index.d.ts +1 -0
  38. package/dist/components/index.d.ts.map +1 -1
  39. package/dist/components/internal/CardCompactShell.d.ts +80 -0
  40. package/dist/components/internal/CardCompactShell.d.ts.map +1 -0
  41. package/dist/components/internal/CardCompactShell.js +148 -0
  42. package/dist/components/internal/CardImageSlot.d.ts +56 -0
  43. package/dist/components/internal/CardImageSlot.d.ts.map +1 -0
  44. package/dist/components/internal/CardImageSlot.js +85 -0
  45. package/dist/index.js +178 -175
  46. package/dist/muza-ui.css +1 -1
  47. package/dist/styles/token-sizes.css +16 -4
  48. package/dist/utils/cn.d.ts.map +1 -1
  49. package/dist/utils/cn.js +6 -3
  50. package/dist/utils/disabledLinkProps.d.ts +8 -1
  51. package/dist/utils/disabledLinkProps.d.ts.map +1 -1
  52. package/dist/utils/disabledLinkProps.js +0 -1
  53. package/package.json +3 -2
@@ -1,17 +1,18 @@
1
- import { jsxs as o, Fragment as S, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as t, Fragment as z, jsx as e } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { Slot as j } from "@radix-ui/react-slot";
4
- import { cva as d } from "class-variance-authority";
5
- import { cn as c } from "../../utils/cn.js";
6
- import { disabledLinkProps as z } from "../../utils/disabledLinkProps.js";
3
+ import { Slot as I } from "@radix-ui/react-slot";
4
+ import { cva as c } from "class-variance-authority";
5
+ import { cn as h } from "../../utils/cn.js";
6
+ import { disabledLinkProps as j } from "../../utils/disabledLinkProps.js";
7
7
  import { Flex as v } from "../Flex/Flex.js";
8
8
  import { Skeleton as l } from "../Skeleton/Skeleton.js";
9
- import { Typography as h } from "../Typography/Typography.js";
10
- const A = d(
9
+ import { Typography as u } from "../Typography/Typography.js";
10
+ import { CardImageSlot as A } from "../internal/CardImageSlot.js";
11
+ const E = c(
11
12
  "group relative flex w-full flex-row items-start gap-comp-voucher-listview-gap border border-solid border-transparent transition-colors outline-none focus-visible:outline-none data-[disabled=true]:pointer-events-none"
12
- ), E = d(
13
+ ), F = c(
13
14
  "line-clamp-3 text-text-dark-primary-def group-hover:text-text-brand-hover group-focus-visible:text-text-brand-focused group-data-[disabled=true]:text-text-dark-disabled"
14
- ), F = d("line-clamp-3 min-w-0", {
15
+ ), R = c("line-clamp-3 min-w-0", {
15
16
  variants: {
16
17
  disabled: {
17
18
  true: "text-text-state-error-def",
@@ -20,34 +21,34 @@ const A = d(
20
21
  },
21
22
  defaultVariants: { disabled: !1 }
22
23
  }), f = ({
23
- color: a = "default",
24
- className: t,
25
- ...i
26
- }) => /* @__PURE__ */ o(
24
+ color: r = "default",
25
+ className: i,
26
+ ...o
27
+ }) => /* @__PURE__ */ t(
27
28
  "div",
28
29
  {
29
- className: c(
30
+ className: h(
30
31
  "inline-flex w-full flex-row items-center gap-comp-voucher-listview-gap",
31
- t
32
+ i
32
33
  ),
33
- ...i,
34
+ ...o,
34
35
  children: [
35
36
  /* @__PURE__ */ e(
36
37
  l,
37
38
  {
38
- color: a,
39
+ color: r,
39
40
  className: "h-comp-voucher-listview-h-img w-comp-voucher-listview-w-img shrink-0 rounded-comp-voucher-listview-radius-img"
40
41
  }
41
42
  ),
42
- /* @__PURE__ */ o(
43
+ /* @__PURE__ */ t(
43
44
  v,
44
45
  {
45
46
  direction: "column",
46
47
  flex: 1,
47
48
  className: "my-auto min-w-0 gap-sm py-comp-voucher-listview-p",
48
49
  children: [
49
- /* @__PURE__ */ e(l, { color: a, className: "h-5 w-full max-w-60" }),
50
- /* @__PURE__ */ e(l, { color: a, className: "h-4 w-40" })
50
+ /* @__PURE__ */ e(l, { color: r, className: "h-5 w-full max-w-60" }),
51
+ /* @__PURE__ */ e(l, { color: r, className: "h-4 w-40" })
51
52
  ]
52
53
  }
53
54
  )
@@ -55,45 +56,36 @@ const A = d(
55
56
  }
56
57
  );
57
58
  f.displayName = "VoucherCard.Skeleton";
58
- const g = ({ image: a, alt: t, wrapperClassName: i }) => /* @__PURE__ */ e("div", { className: i, children: /* @__PURE__ */ e(
59
- "div",
60
- {
61
- className: c(
62
- "absolute inset-0 overflow-hidden",
63
- "[&>img]:size-full [&>img]:object-cover",
64
- "transition-transform duration-300 ease-out group-hover:scale-110 group-focus-visible:scale-110",
65
- "group-data-[disabled=true]:opacity-50",
66
- "group-data-[disabled=true]:grayscale",
67
- "group-data-[disabled=true]:group-hover:scale-100",
68
- "group-data-[disabled=true]:group-focus-visible:scale-100"
69
- ),
70
- children: typeof a == "string" ? /* @__PURE__ */ e("img", { src: a, alt: t }) : a
71
- }
72
- ) });
73
- g.displayName = "VoucherCard.ImageSlot";
74
- const b = s.forwardRef(
75
- (a, t) => {
59
+ const T = "group-focus-visible:scale-110 group-data-[disabled=true]:group-focus-visible:scale-100", g = s.forwardRef(
60
+ (r, i) => {
76
61
  const {
77
- title: i,
62
+ title: o,
78
63
  description: w,
79
64
  image: x,
80
- imageAlt: N,
81
- disabled: r = !1,
65
+ imageAlt: b,
66
+ placeholderIcon: N,
67
+ placeholderColor: C,
68
+ disabled: a = !1,
82
69
  asChild: y = !1,
83
- href: C,
84
- className: V,
85
- children: n,
86
- ...m
87
- } = a, k = N ?? i, u = c(A(), V), p = /* @__PURE__ */ o(S, { children: [
70
+ href: V,
71
+ className: k,
72
+ children: d,
73
+ ...n
74
+ } = r, S = b ?? o, m = h(E(), k), p = /* @__PURE__ */ t(z, { children: [
88
75
  /* @__PURE__ */ e(
89
- g,
76
+ A,
90
77
  {
91
78
  image: x,
92
- alt: k,
79
+ alt: S,
80
+ placeholderIcon: N,
81
+ placeholderColor: C,
82
+ componentName: "VoucherCard",
83
+ placeholderIconClassName: "[&>svg]:size-comp-voucher-listview-icon-size",
84
+ innerClassName: T,
93
85
  wrapperClassName: "relative shrink-0 overflow-hidden h-comp-voucher-listview-h-img w-comp-voucher-listview-w-img rounded-comp-voucher-listview-radius-img"
94
86
  }
95
87
  ),
96
- /* @__PURE__ */ o(
88
+ /* @__PURE__ */ t(
97
89
  v,
98
90
  {
99
91
  direction: "column",
@@ -102,25 +94,25 @@ const b = s.forwardRef(
102
94
  className: "my-auto min-w-0 gap-sm py-comp-voucher-listview-p",
103
95
  children: [
104
96
  /* @__PURE__ */ e(
105
- h,
97
+ u,
106
98
  {
107
99
  component: "h3",
108
100
  variant: "title",
109
101
  size: "base",
110
102
  weight: "medium",
111
- className: E(),
112
- children: i
103
+ className: F(),
104
+ children: o
113
105
  }
114
106
  ),
115
107
  /* @__PURE__ */ e(
116
- h,
108
+ u,
117
109
  {
118
110
  component: "span",
119
111
  variant: "body",
120
112
  size: "sm",
121
113
  weight: "regular",
122
114
  fixY: !0,
123
- className: F({ disabled: r }),
115
+ className: R({ disabled: a }),
124
116
  children: w
125
117
  }
126
118
  )
@@ -128,40 +120,40 @@ const b = s.forwardRef(
128
120
  }
129
121
  )
130
122
  ] });
131
- return y && s.isValidElement(n) ? /* @__PURE__ */ e(
132
- j,
123
+ return y && s.isValidElement(d) ? /* @__PURE__ */ e(
124
+ I,
133
125
  {
134
- ref: t,
135
- className: u,
136
- "data-disabled": r || void 0,
137
- "aria-disabled": r || void 0,
138
- ...m,
126
+ ref: i,
127
+ className: m,
128
+ "data-disabled": a || void 0,
129
+ "aria-disabled": a || void 0,
130
+ ...n,
139
131
  children: s.cloneElement(
140
- n,
141
- r ? z : void 0,
132
+ d,
133
+ a ? j : void 0,
142
134
  p
143
135
  )
144
136
  }
145
137
  ) : /* @__PURE__ */ e(
146
138
  "a",
147
139
  {
148
- ref: t,
149
- href: r ? void 0 : C,
150
- className: u,
151
- "data-disabled": r || void 0,
152
- "aria-disabled": r || void 0,
153
- ...m,
140
+ ref: i,
141
+ href: a ? void 0 : V,
142
+ className: m,
143
+ "data-disabled": a || void 0,
144
+ "aria-disabled": a || void 0,
145
+ ...n,
154
146
  children: p
155
147
  }
156
148
  );
157
149
  }
158
150
  );
159
- b.displayName = "VoucherCard";
160
- const I = b;
161
- I.Skeleton = f;
151
+ g.displayName = "VoucherCard";
152
+ const D = g;
153
+ D.Skeleton = f;
162
154
  export {
163
- I as VoucherCard,
164
- F as voucherCardDescriptionVariants,
165
- E as voucherCardTitleVariants,
166
- A as voucherCardVariants
155
+ D as VoucherCard,
156
+ R as voucherCardDescriptionVariants,
157
+ F as voucherCardTitleVariants,
158
+ E as voucherCardVariants
167
159
  };
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof VoucherCard>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof VoucherCard>;
6
6
  export declare const ListView: Story;
7
+ export declare const ListViewPlaceholder: Story;
7
8
  export declare const ListViewSkeleton: Story;
8
9
  export declare const AsChildLink: Story;
9
10
  //# sourceMappingURL=VoucherCard.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VoucherCard.stories.d.ts","sourceRoot":"","sources":["../../../src/components/VoucherCard/VoucherCard.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AA4D3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CA+BlC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEzC,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAA"}
1
+ {"version":3,"file":"VoucherCard.stories.d.ts","sourceRoot":"","sources":["../../../src/components/VoucherCard/VoucherCard.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AA4D3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAiClC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEzC,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAgDjC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAA"}
@@ -42,6 +42,7 @@ export * from './PasswordInput';
42
42
  export * from './PhoneInput';
43
43
  export * from './PinIndicator';
44
44
  export * from './Popover';
45
+ export * from './PriceTag';
45
46
  export * from './Progress';
46
47
  export * from './Radio';
47
48
  export * from './Rating';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAA;AAG/B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,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@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Layout + stroke classes for a compact grid card. Shared verbatim by
4
+ * `OfferCard` and `PartnerCard` so the two never drift apart — the homepage
5
+ * grid mixes offers and partners in a single row, where any divergence in
6
+ * radius, border or hover ramp would read as a bug.
7
+ *
8
+ * Tokens stay under the `comp-offer-card-compact-*` namespace: there is one
9
+ * compact shell in the design system, and `OfferCard` is where it was first
10
+ * specified. Both cards resolve to the same Figma variables this way.
11
+ */
12
+ export declare const cardCompactContainerClass = "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";
13
+ /**
14
+ * Fill ramps for the compact shell, keyed by the `isTinted` boolean. The
15
+ * untinted card is transparent; the tinted one sits on
16
+ * `--color-surface-base-secondary` so promoted entries stand out in a grid.
17
+ */
18
+ export declare const cardCompactFillClass: {
19
+ readonly default: "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";
20
+ readonly tinted: "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";
21
+ };
22
+ export interface CardCompactShellProps {
23
+ /** Image source — a URL string or a custom React node. Omit for placeholder mode. */
24
+ image?: string | React.ReactNode;
25
+ /** Alt text for the built-in `<img>`. Ignored in placeholder mode. */
26
+ imageAlt: string;
27
+ /** Icon rendered centred in the placeholder when `image` is absent. */
28
+ placeholderIcon?: React.ReactNode;
29
+ /** Any CSS color string driving the placeholder tint and icon color. */
30
+ placeholderColor?: string;
31
+ /** Owning component name, used to prefix development warnings. */
32
+ componentName: string;
33
+ /** Label for the chip pinned to the top-left of the image. Omit to hide it. */
34
+ category?: string;
35
+ /** Favorite toggle pinned to the top-right of the image. */
36
+ heartButton?: React.ReactNode;
37
+ /** Partner / merchant logo badge anchored bottom-left, half-overlapping the text. */
38
+ logo?: string | React.ReactNode;
39
+ /** Alt text for the built-in logo `<img>`. Ignored when `logo` is a React node. */
40
+ logoAlt: string;
41
+ /** Whether the owning card is disabled — drops the category chip's tint. */
42
+ disabled?: boolean;
43
+ /** Text-column content: the title link, and whatever rows sit under it. */
44
+ children: React.ReactNode;
45
+ }
46
+ /**
47
+ * Image block + text column of a compact grid card, shared by `OfferCard` and
48
+ * `PartnerCard`.
49
+ *
50
+ * Renders the 288:162 image area (photo or placeholder), the glass category
51
+ * chip and heart pinned over it, the optional circular logo badge, and the
52
+ * padded text column below. Only the text column's contents differ between
53
+ * the two cards — everything above the fold is identical by construction.
54
+ *
55
+ * Internal helper. Not part of the public API.
56
+ */
57
+ declare const CardCompactShell: {
58
+ ({ image, imageAlt, placeholderIcon, placeholderColor, componentName, category, heartButton, logo, logoAlt, disabled, children, }: CardCompactShellProps): import("react/jsx-runtime").JSX.Element;
59
+ displayName: string;
60
+ };
61
+ export interface CardCompactSkeletonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
62
+ /** Skeleton color, forwarded to every inner `Skeleton` block. */
63
+ color?: 'default' | 'light';
64
+ /** Mirrors the card's `isTinted` so the skeleton reserves the same fill. */
65
+ isTinted?: boolean;
66
+ }
67
+ /**
68
+ * Loading placeholder for the compact shell, shared by `OfferCard.Skeleton`
69
+ * and `PartnerCard.Skeleton` for the same reason the shell itself is shared —
70
+ * mixed grids would otherwise show two different loading footprints side by
71
+ * side.
72
+ *
73
+ * Internal helper. Not part of the public API.
74
+ */
75
+ declare const CardCompactSkeleton: {
76
+ ({ color, isTinted, className, ...props }: CardCompactSkeletonProps): import("react/jsx-runtime").JSX.Element;
77
+ displayName: string;
78
+ };
79
+ export { CardCompactShell, CardCompactSkeleton };
80
+ //# sourceMappingURL=CardCompactShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardCompactShell.d.ts","sourceRoot":"","sources":["../../../src/components/internal/CardCompactShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,oRAC6O,CAAA;AAEnR;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;CAKvB,CAAA;AAMV,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAChC,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAA;IAChB,uEAAuE;IACvE,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACjC,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAA;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC/B,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAA;IACf,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2EAA2E;IAC3E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,gBAAgB;uIAYnB,qBAAqB;;CAkEvB,CAAA;AAGD,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D,iEAAiE;IACjE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB;+CAKtB,wBAAwB;;CAuC1B,CAAA;AAGD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,148 @@
1
+ import { jsxs as a, Fragment as v, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as m } from "../../utils/cn.js";
4
+ import { Flex as i } from "../Flex/Flex.js";
5
+ import { Skeleton as r } from "../Skeleton/Skeleton.js";
6
+ import { Tag as x } from "../Tag/Tag.js";
7
+ import { CardImageSlot as N, hasImageContent as w } from "./CardImageSlot.js";
8
+ const q = "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", A = {
9
+ default: "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",
10
+ tinted: "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"
11
+ }, p = "px-comp-offer-card-compact-p pt-comp-offer-card-compact-p-top pb-comp-offer-card-compact-p", C = ({
12
+ image: o,
13
+ imageAlt: l,
14
+ placeholderIcon: f,
15
+ placeholderColor: c,
16
+ componentName: n,
17
+ category: t,
18
+ heartButton: u,
19
+ logo: d,
20
+ logoAlt: b,
21
+ disabled: h,
22
+ children: g
23
+ }) => {
24
+ const s = w(o);
25
+ return /* @__PURE__ */ a(v, { children: [
26
+ /* @__PURE__ */ a("div", { className: "relative w-full shrink-0", children: [
27
+ /* @__PURE__ */ a(
28
+ N,
29
+ {
30
+ image: o,
31
+ alt: l,
32
+ placeholderIcon: f,
33
+ placeholderColor: c,
34
+ componentName: n,
35
+ wrapperClassName: "relative aspect-[288/162] w-full overflow-hidden",
36
+ children: [
37
+ s && /* @__PURE__ */ e(
38
+ "div",
39
+ {
40
+ "aria-hidden": "true",
41
+ className: "absolute inset-0 bg-gradient-to-t from-black/0 from-50% to-black/70"
42
+ }
43
+ ),
44
+ /* @__PURE__ */ a("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: [
45
+ t ? /* @__PURE__ */ e(
46
+ x,
47
+ {
48
+ variant: s ? "invert" : void 0,
49
+ color: s || h ? void 0 : c,
50
+ className: "min-w-[50px] shrink overflow-hidden",
51
+ children: t
52
+ }
53
+ ) : /* @__PURE__ */ e("span", {}),
54
+ u
55
+ ] })
56
+ ]
57
+ }
58
+ ),
59
+ d && /* @__PURE__ */ e(
60
+ "div",
61
+ {
62
+ className: m(
63
+ "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",
64
+ "[&>img]:size-full [&>img]:object-cover",
65
+ "group-data-[disabled=true]:grayscale"
66
+ ),
67
+ children: typeof d == "string" ? /* @__PURE__ */ e("img", { src: d, alt: b }) : d
68
+ }
69
+ )
70
+ ] }),
71
+ /* @__PURE__ */ e(
72
+ i,
73
+ {
74
+ direction: "column",
75
+ flex: 1,
76
+ gap: "2xs",
77
+ className: p,
78
+ children: g
79
+ }
80
+ )
81
+ ] });
82
+ };
83
+ C.displayName = "CardCompactShell";
84
+ const k = ({
85
+ color: o = "default",
86
+ isTinted: l = !1,
87
+ className: f,
88
+ ...c
89
+ }) => /* @__PURE__ */ a(
90
+ "div",
91
+ {
92
+ className: m(
93
+ "inline-flex flex-col overflow-hidden rounded-comp-offer-card-compact-radius border border-solid border-comp-offer-card-stroke-default",
94
+ l ? "bg-comp-offer-card-fill-promo-default" : "bg-comp-offer-card-fill-def-default",
95
+ f
96
+ ),
97
+ ...c,
98
+ children: [
99
+ /* @__PURE__ */ a("div", { className: "relative aspect-[288/162] w-full shrink-0 overflow-hidden", children: [
100
+ /* @__PURE__ */ e(
101
+ r,
102
+ {
103
+ color: o,
104
+ className: "absolute inset-0 size-full rounded-none"
105
+ }
106
+ ),
107
+ /* @__PURE__ */ a("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: [
108
+ /* @__PURE__ */ e(
109
+ r,
110
+ {
111
+ color: o,
112
+ className: "h-comp-tag-h-def w-16 rounded-full"
113
+ }
114
+ ),
115
+ /* @__PURE__ */ e(
116
+ r,
117
+ {
118
+ color: o,
119
+ className: "size-comp-button-h-xs rounded-full"
120
+ }
121
+ )
122
+ ] })
123
+ ] }),
124
+ /* @__PURE__ */ a(
125
+ i,
126
+ {
127
+ direction: "column",
128
+ flex: 1,
129
+ gap: "2xs",
130
+ className: p,
131
+ children: [
132
+ /* @__PURE__ */ e(r, { color: o, className: "h-5 w-full" }),
133
+ /* @__PURE__ */ e(r, { color: o, className: "h-5 w-3/4" }),
134
+ /* @__PURE__ */ e(r, { color: o, className: "mt-2xs h-4 w-32" }),
135
+ /* @__PURE__ */ e(r, { color: o, className: "mt-2xs h-4 w-24" })
136
+ ]
137
+ }
138
+ )
139
+ ]
140
+ }
141
+ );
142
+ k.displayName = "CardCompactSkeleton";
143
+ export {
144
+ C as CardCompactShell,
145
+ k as CardCompactSkeleton,
146
+ q as cardCompactContainerClass,
147
+ A as cardCompactFillClass
148
+ };
@@ -0,0 +1,56 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Whether an `image` prop carries something renderable. Cards use this to
4
+ * decide whether their image-overlay chrome (gradients, glass chips, inverted
5
+ * icon buttons) should render in photo mode or placeholder mode.
6
+ */
7
+ export declare const hasImageContent: (image?: string | React.ReactNode) => boolean;
8
+ export interface CardImageSlotProps {
9
+ /** Image source — a URL string (rendered as a plain `<img>`) or a custom React node. */
10
+ image?: string | React.ReactNode;
11
+ /** Alt text for the built-in `<img>`. Ignored in placeholder mode. */
12
+ alt: string;
13
+ /** Classes applied to the wrapper `<div>` — sizing, rounded corners, overflow. */
14
+ wrapperClassName: string;
15
+ /** Extra classes merged into the inner image layer (hover/focus zoom tweaks). */
16
+ innerClassName?: string;
17
+ /** Icon rendered centred in the placeholder when `image` is absent. */
18
+ placeholderIcon?: React.ReactNode;
19
+ /** Any CSS color string driving the placeholder tint and icon color. */
20
+ placeholderColor?: string;
21
+ /**
22
+ * Classes applied to the placeholder layer — used to size the icon. Defaults to
23
+ * the large market-category icon token.
24
+ */
25
+ placeholderIconClassName?: string;
26
+ /** Owning component name, used to prefix development warnings. */
27
+ componentName: string;
28
+ /** Overlays rendered on top of the image (gradient, tag chips). */
29
+ children?: React.ReactNode;
30
+ }
31
+ /**
32
+ * Renders a card image inside a wrapper that handles sizing and rounded
33
+ * corners. When `image` is a string we render a plain `<img>`; when it's a
34
+ * React node (e.g. Next.js `<Image>`) we render it as-is. The image sits in
35
+ * its own absolutely-positioned inner layer that carries the hover zoom and
36
+ * the disabled dim (opacity + grayscale), so the dim reaches any image node —
37
+ * including a `<picture>` or nested-`<img>` custom node — without fading the
38
+ * overlaid gradient/tag chips rendered as `children`. A direct `<img>` is
39
+ * auto-stretched to fill the layer, so consumers don't need sizing classes.
40
+ *
41
+ * When `image` is absent the same layer renders a decorative placeholder
42
+ * instead: a flat tint derived from `placeholderColor` at 20% alpha with
43
+ * `placeholderIcon` centred in the full color. Without a `placeholderColor`
44
+ * it falls back to the brand-tertiary tint with a tertiary icon. It carries
45
+ * the same hover zoom as the image path, so the icon grows on hover exactly
46
+ * like a photo would; disabled swaps both tint and icon for the neutral
47
+ * disabled surface instead of dimming the colored one.
48
+ *
49
+ * Internal helper shared by the card components. Not part of the public API.
50
+ */
51
+ declare const CardImageSlot: {
52
+ ({ image, alt, wrapperClassName, innerClassName, placeholderIcon, placeholderColor, placeholderIconClassName, componentName, children, }: CardImageSlotProps): import("react/jsx-runtime").JSX.Element;
53
+ displayName: string;
54
+ };
55
+ export { CardImageSlot };
56
+ //# sourceMappingURL=CardImageSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardImageSlot.d.ts","sourceRoot":"","sources":["../../../src/components/internal/CardImageSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,GAAG,KAAK,CAAC,SAAS,KAAG,OACjB,CAAA;AAElD,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAChC,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAA;IACX,kFAAkF;IAClF,gBAAgB,EAAE,MAAM,CAAA;IACxB,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,uEAAuE;IACvE,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACjC,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAA;IACrB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,aAAa;8IAUhB,kBAAkB;;CA2EpB,CAAA;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,85 @@
1
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
+ import "react";
3
+ import b from "color";
4
+ import { cn as u } from "../../utils/cn.js";
5
+ const m = (r) => {
6
+ try {
7
+ return b(r);
8
+ } catch {
9
+ return null;
10
+ }
11
+ }, g = /* @__PURE__ */ new Set(), p = (r, o) => {
12
+ process.env.NODE_ENV === "production" || g.has(r) || (g.add(r), console.warn(o));
13
+ }, h = (r) => r != null && r !== !1 && r !== "", v = ({
14
+ image: r,
15
+ alt: o,
16
+ wrapperClassName: i,
17
+ innerClassName: d,
18
+ placeholderIcon: l,
19
+ placeholderColor: e,
20
+ placeholderIconClassName: f = "[&>svg]:size-comp-market-category-ico-ico-size-lg",
21
+ componentName: t,
22
+ children: n
23
+ }) => {
24
+ if (h(r))
25
+ return /* @__PURE__ */ c("div", { className: i, children: [
26
+ /* @__PURE__ */ s(
27
+ "div",
28
+ {
29
+ className: u(
30
+ "absolute inset-0 overflow-hidden",
31
+ "[&>img]:size-full [&>img]:object-cover",
32
+ "transition-transform duration-300 ease-out group-hover:scale-110",
33
+ "group-data-[disabled=true]:opacity-50",
34
+ "group-data-[disabled=true]:grayscale",
35
+ "group-data-[disabled=true]:group-hover:scale-100",
36
+ d
37
+ ),
38
+ children: typeof r == "string" ? /* @__PURE__ */ s("img", { src: r, alt: o }) : r
39
+ }
40
+ ),
41
+ n
42
+ ] });
43
+ l || p(
44
+ `${t}:no-placeholder-icon`,
45
+ `[${t}] \`image\` was omitted without a \`placeholderIcon\` — rendering an empty image slot.`
46
+ );
47
+ const a = e ? m(e) : null;
48
+ return e && !a && p(
49
+ `${t}:invalid-color:${e}`,
50
+ `[${t}] Invalid \`placeholderColor\` "${e}". Falling back to neutral styling.`
51
+ ), /* @__PURE__ */ c("div", { className: i, children: [
52
+ /* @__PURE__ */ s(
53
+ "div",
54
+ {
55
+ "aria-hidden": "true",
56
+ className: u(
57
+ "absolute inset-0 flex items-center justify-center overflow-hidden",
58
+ a ? "bg-(--card-image-slot-placeholder-bg) text-(--card-image-slot-placeholder-fg)" : "bg-surface-brand-brand-tertiary text-icon-dark-tertiary",
59
+ // Disabled swaps the tint outright rather than dimming it — the
60
+ // design system gives the placeholder its own disabled ramp. Both
61
+ // layers use the same translucent token, so the icon reads as a
62
+ // slightly darker grey where it stacks over the fill.
63
+ "group-data-[disabled=true]:bg-surface-dark-secondary-disabled group-data-[disabled=true]:text-surface-dark-secondary-disabled",
64
+ // Same zoom the image path uses — the flat tint already covers the
65
+ // slot, so what visibly grows is the icon.
66
+ "transition-transform duration-300 ease-out group-hover:scale-110",
67
+ "group-data-[disabled=true]:group-hover:scale-100",
68
+ d,
69
+ f
70
+ ),
71
+ style: a ? {
72
+ "--card-image-slot-placeholder-bg": a.alpha(0.2).toString(),
73
+ "--card-image-slot-placeholder-fg": a.toString()
74
+ } : void 0,
75
+ children: l
76
+ }
77
+ ),
78
+ n
79
+ ] });
80
+ };
81
+ v.displayName = "CardImageSlot";
82
+ export {
83
+ v as CardImageSlot,
84
+ h as hasImageContent
85
+ };