@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.
- package/dist/components/ArticleCard/ArticleCard.d.ts.map +1 -1
- package/dist/components/ArticleCard/ArticleCard.js +161 -170
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +19 -6
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +148 -112
- package/dist/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/components/OfferCard/OfferCard.d.ts +45 -17
- package/dist/components/OfferCard/OfferCard.d.ts.map +1 -1
- package/dist/components/OfferCard/OfferCard.js +180 -266
- package/dist/components/OfferCard/OfferCard.stories.d.ts +5 -2
- package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -1
- package/dist/components/PartnerCard/PartnerCard.d.ts +90 -26
- package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -1
- package/dist/components/PartnerCard/PartnerCard.js +323 -264
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts +6 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -1
- package/dist/components/PriceTag/PriceTag.d.ts +37 -0
- package/dist/components/PriceTag/PriceTag.d.ts.map +1 -0
- package/dist/components/PriceTag/PriceTag.js +43 -0
- package/dist/components/PriceTag/PriceTag.stories.d.ts +8 -0
- package/dist/components/PriceTag/PriceTag.stories.d.ts.map +1 -0
- package/dist/components/PriceTag/index.d.ts +2 -0
- package/dist/components/PriceTag/index.d.ts.map +1 -0
- package/dist/components/PriceTag/index.js +5 -0
- package/dist/components/Tooltip/Tooltip.d.ts +18 -7
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +116 -68
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/VoucherCard/VoucherCard.d.ts +24 -1
- package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -1
- package/dist/components/VoucherCard/VoucherCard.js +68 -76
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts +1 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/internal/CardCompactShell.d.ts +80 -0
- package/dist/components/internal/CardCompactShell.d.ts.map +1 -0
- package/dist/components/internal/CardCompactShell.js +148 -0
- package/dist/components/internal/CardImageSlot.d.ts +56 -0
- package/dist/components/internal/CardImageSlot.d.ts.map +1 -0
- package/dist/components/internal/CardImageSlot.js +85 -0
- package/dist/index.js +178 -175
- package/dist/muza-ui.css +1 -1
- package/dist/styles/token-sizes.css +16 -4
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +6 -3
- package/dist/utils/disabledLinkProps.d.ts +8 -1
- package/dist/utils/disabledLinkProps.d.ts.map +1 -1
- package/dist/utils/disabledLinkProps.js +0 -1
- package/package.json +3 -2
|
@@ -20,11 +20,28 @@ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof Dial
|
|
|
20
20
|
/**
|
|
21
21
|
* Shrinks the content region's top and bottom padding to
|
|
22
22
|
* `--spacing-comp-dialog-p-hor-sm` for a more compact dialog. Header and
|
|
23
|
-
* footer keep their own padding and stay flush to the edges.
|
|
23
|
+
* footer keep their own padding and stay flush to the edges. Combined with
|
|
24
|
+
* `isFullscreenOnMobile`, a bare-content dialog keeps this compact bottom
|
|
25
|
+
* padding at fullscreen too.
|
|
24
26
|
*
|
|
25
27
|
* @default false
|
|
26
28
|
*/
|
|
27
29
|
smallerContentYpadding?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Below the `md` breakpoint (768px), renders the dialog edge-to-edge over
|
|
32
|
+
* the whole viewport: the overlay gutter, the `max-w-*` cap and the corner
|
|
33
|
+
* radius all come off. Above `md` the dialog is unchanged.
|
|
34
|
+
*
|
|
35
|
+
* A bare-content dialog moves its close button in-flow to the top right and
|
|
36
|
+
* scrolls as a whole. A dialog with a `DialogHeader` / `DialogFooter` is
|
|
37
|
+
* pinned to the full screen height with the content region scrolling
|
|
38
|
+
* between them. Without a `DialogHeader` a close button is rendered at the
|
|
39
|
+
* top of the content region, because at fullscreen there is no overlay to
|
|
40
|
+
* tap; with `DialogHeader hideCloseButton` provide your own `DialogClose`.
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
isFullscreenOnMobile?: boolean;
|
|
28
45
|
}
|
|
29
46
|
declare const Dialog: React.FC<DialogProps>;
|
|
30
47
|
declare const DialogTitle: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
@@ -48,10 +65,6 @@ declare const DialogTrigger: import('react').ForwardRefExoticComponent<DialogPri
|
|
|
48
65
|
declare const DialogPortal: import('react').FC<DialogPrimitive.DialogPortalProps>;
|
|
49
66
|
declare const DialogClose: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
50
67
|
declare const DialogOverlay: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
51
|
-
declare const DialogContent: import('react').ForwardRefExoticComponent<
|
|
52
|
-
size?: "small" | "medium" | "large";
|
|
53
|
-
closeAriaLabel?: string;
|
|
54
|
-
smallerContentYpadding?: boolean;
|
|
55
|
-
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
68
|
+
declare const DialogContent: import('react').ForwardRefExoticComponent<DialogContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
56
69
|
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
57
70
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAE7B,KAAK,SAAS,EAGf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAMzD,6EAA6E;AAC7E,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACzD,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,4FAA4F;IAC5F,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,kHAAkH;AAClH,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC;IAChE,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAE7B,KAAK,SAAS,EAGf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAMzD,6EAA6E;AAC7E,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACzD,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,C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yB,CAAA;AAC3C,QAAA,MAAM,WAAW,gIAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,4LAYjB,CAAA;AAGF,QAAA,MAAM,aAAa,+GA+HlB,CAAA;AAGD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA"}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as a, jsxs as n, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as b, Children as T, isValidElement as k } from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-dialog";
|
|
4
|
-
import { useMuzaTranslations as
|
|
5
|
-
import { cn as
|
|
4
|
+
import { useMuzaTranslations as C } from "../../translations/TranslationContext.js";
|
|
5
|
+
import { cn as i } from "../../utils/cn.js";
|
|
6
6
|
import "@solar-icons/react-perf";
|
|
7
|
-
import { XClose as
|
|
8
|
-
import { typographyVariants as
|
|
9
|
-
const
|
|
10
|
-
className:
|
|
7
|
+
import { XClose as z } from "../Icons/CustomIcons.js";
|
|
8
|
+
import { typographyVariants as H } from "../Typography/Typography.js";
|
|
9
|
+
const J = e.Root, K = e.Title, Q = e.Description, w = ({
|
|
10
|
+
className: t,
|
|
11
11
|
ariaLabel: o
|
|
12
12
|
}) => /* @__PURE__ */ a(
|
|
13
13
|
e.Close,
|
|
14
14
|
{
|
|
15
|
-
className:
|
|
15
|
+
className: i(
|
|
16
16
|
"cursor-pointer text-icon-dark-primary-def focus-visible-default transition-opacity disabled:pointer-events-none",
|
|
17
|
-
|
|
17
|
+
t
|
|
18
18
|
),
|
|
19
19
|
"aria-label": o,
|
|
20
|
-
children: /* @__PURE__ */ a(
|
|
20
|
+
children: /* @__PURE__ */ a(z, { className: "size-icon-medium" })
|
|
21
21
|
}
|
|
22
|
-
),
|
|
22
|
+
), j = b(
|
|
23
23
|
({
|
|
24
|
-
className:
|
|
24
|
+
className: t,
|
|
25
25
|
icon: o,
|
|
26
|
-
children:
|
|
27
|
-
title:
|
|
28
|
-
hideCloseButton:
|
|
29
|
-
closeAriaLabel:
|
|
30
|
-
...
|
|
31
|
-
},
|
|
32
|
-
const y =
|
|
26
|
+
children: r,
|
|
27
|
+
title: m,
|
|
28
|
+
hideCloseButton: d = !1,
|
|
29
|
+
closeAriaLabel: s,
|
|
30
|
+
...f
|
|
31
|
+
}, h) => {
|
|
32
|
+
const y = C(), g = s ?? y.dialog.closeAriaLabel;
|
|
33
33
|
return /* @__PURE__ */ a(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
ref:
|
|
37
|
-
className:
|
|
36
|
+
ref: h,
|
|
37
|
+
className: i(
|
|
38
38
|
"-mx-comp-dialog-p -mt-comp-dialog-p border-b border-stroke-base-primary px-comp-dialog-p py-comp-dialog-p-hor-def",
|
|
39
|
-
|
|
39
|
+
t
|
|
40
40
|
),
|
|
41
|
-
...
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
41
|
+
...f,
|
|
42
|
+
children: /* @__PURE__ */ n("div", { className: "flex items-center gap-comp-dialog-gap", children: [
|
|
43
|
+
/* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
|
|
44
44
|
o && /* @__PURE__ */ a("span", { className: "text-icon-brand-def [&>svg]:size-icon-medium", children: o }),
|
|
45
45
|
/* @__PURE__ */ a(
|
|
46
46
|
e.Title,
|
|
47
47
|
{
|
|
48
|
-
className:
|
|
48
|
+
className: i(
|
|
49
49
|
"min-w-0 flex-1 text-text-dark-primary-def",
|
|
50
|
-
|
|
50
|
+
H({
|
|
51
51
|
variant: "title",
|
|
52
52
|
size: "md",
|
|
53
53
|
weight: "medium",
|
|
54
54
|
fixY: !0
|
|
55
55
|
})
|
|
56
56
|
),
|
|
57
|
-
children:
|
|
57
|
+
children: m ?? r
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
] }),
|
|
61
|
-
!
|
|
62
|
-
|
|
61
|
+
!d && /* @__PURE__ */ a(
|
|
62
|
+
w,
|
|
63
63
|
{
|
|
64
64
|
className: "shrink-0",
|
|
65
|
-
ariaLabel:
|
|
65
|
+
ariaLabel: g
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
] })
|
|
@@ -70,112 +70,148 @@ const q = e.Root, G = e.Title, I = e.Description, k = ({
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
({ className:
|
|
73
|
+
j.displayName = "DialogHeader";
|
|
74
|
+
const P = b(
|
|
75
|
+
({ className: t, children: o, ...r }, m) => /* @__PURE__ */ a(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
|
-
ref:
|
|
79
|
-
className:
|
|
78
|
+
ref: m,
|
|
79
|
+
className: i(
|
|
80
80
|
"-mx-comp-dialog-p -mb-comp-dialog-p flex items-center justify-end gap-sm border-t border-stroke-base-primary px-comp-dialog-p py-comp-dialog-p-hor-sm",
|
|
81
|
-
|
|
81
|
+
t
|
|
82
82
|
),
|
|
83
|
-
...
|
|
83
|
+
...r,
|
|
84
84
|
children: o
|
|
85
85
|
}
|
|
86
86
|
)
|
|
87
87
|
);
|
|
88
|
-
|
|
89
|
-
const
|
|
88
|
+
P.displayName = "DialogFooter";
|
|
89
|
+
const S = e.Trigger, R = e.Portal, U = e.Close, L = b(({ className: t, ...o }, r) => /* @__PURE__ */ a(
|
|
90
90
|
e.Overlay,
|
|
91
91
|
{
|
|
92
|
-
ref:
|
|
93
|
-
className:
|
|
92
|
+
ref: r,
|
|
93
|
+
className: i(
|
|
94
94
|
"fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-surface-base-overlay px-layout-p-standard py-comp-dialog-p-hor-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
95
|
-
|
|
95
|
+
t
|
|
96
96
|
),
|
|
97
97
|
...o
|
|
98
98
|
}
|
|
99
99
|
));
|
|
100
|
-
|
|
101
|
-
const
|
|
100
|
+
L.displayName = e.Overlay.displayName;
|
|
101
|
+
const V = b(
|
|
102
102
|
({
|
|
103
|
-
className:
|
|
103
|
+
className: t,
|
|
104
104
|
children: o,
|
|
105
|
-
size:
|
|
106
|
-
closeAriaLabel:
|
|
107
|
-
smallerContentYpadding:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
size: r = "medium",
|
|
106
|
+
closeAriaLabel: m,
|
|
107
|
+
smallerContentYpadding: d = !1,
|
|
108
|
+
isFullscreenOnMobile: s = !1,
|
|
109
|
+
...f
|
|
110
|
+
}, h) => {
|
|
111
|
+
const y = C(), g = m ?? y.dialog.closeAriaLabel, u = T.toArray(o), v = u.find(
|
|
111
112
|
(l) => {
|
|
112
|
-
var
|
|
113
|
-
return
|
|
113
|
+
var p;
|
|
114
|
+
return k(l) && ((p = l.type) == null ? void 0 : p.displayName) === "DialogHeader";
|
|
114
115
|
}
|
|
115
|
-
),
|
|
116
|
+
), N = u.find(
|
|
116
117
|
(l) => {
|
|
117
|
-
var
|
|
118
|
-
return
|
|
118
|
+
var p;
|
|
119
|
+
return k(l) && ((p = l.type) == null ? void 0 : p.displayName) === "DialogFooter";
|
|
119
120
|
}
|
|
120
|
-
), A =
|
|
121
|
-
(l) => l !==
|
|
122
|
-
),
|
|
123
|
-
return /* @__PURE__ */ a(
|
|
124
|
-
|
|
121
|
+
), A = u.filter(
|
|
122
|
+
(l) => l !== v && l !== N
|
|
123
|
+
), c = !!v, x = !!N;
|
|
124
|
+
return /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
|
|
125
|
+
L,
|
|
125
126
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"relative flex w-full flex-col rounded-comp-dialog-radius bg-surface-base-secondary px-comp-dialog-p duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
129
|
-
{
|
|
130
|
-
"max-w-comp-dialog-w-sm": t === "small",
|
|
131
|
-
"max-w-comp-dialog-w-md": t === "medium",
|
|
132
|
-
"max-w-comp-dialog-w-lg": t === "large",
|
|
133
|
-
"max-h-[calc(100vh-var(--spacing-comp-dialog-p-hor-overlay)*2)]": v || x
|
|
134
|
-
},
|
|
135
|
-
// Header/footer bleed to the edges via negative margins that cancel
|
|
136
|
-
// the root vertical padding, so it stays standard when either is
|
|
137
|
-
// present. A bare content dialog is padded directly by the root.
|
|
138
|
-
x || v ? "py-comp-dialog-p" : m ? "py-comp-dialog-p-hor-sm" : "pt-5xl pb-comp-dialog-p",
|
|
139
|
-
i
|
|
127
|
+
className: i(
|
|
128
|
+
s && "max-md:place-items-stretch max-md:px-0 max-md:py-0"
|
|
140
129
|
),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"-
|
|
149
|
-
|
|
130
|
+
children: /* @__PURE__ */ a(
|
|
131
|
+
e.Content,
|
|
132
|
+
{
|
|
133
|
+
ref: h,
|
|
134
|
+
className: i(
|
|
135
|
+
"relative flex w-full flex-col rounded-comp-dialog-radius bg-surface-base-secondary px-comp-dialog-p duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
136
|
+
{
|
|
137
|
+
"max-w-comp-dialog-w-sm": r === "small",
|
|
138
|
+
"max-w-comp-dialog-w-md": r === "medium",
|
|
139
|
+
"max-w-comp-dialog-w-lg": r === "large",
|
|
140
|
+
"max-h-[calc(100vh-var(--spacing-comp-dialog-p-hor-overlay)*2)]": x || c
|
|
141
|
+
},
|
|
142
|
+
// Header/footer bleed to the edges via negative margins that cancel
|
|
143
|
+
// the root vertical padding, so it stays standard when either is
|
|
144
|
+
// present. A bare content dialog is padded directly by the root.
|
|
145
|
+
c || x ? "py-comp-dialog-p" : d ? "py-comp-dialog-p-hor-sm" : "pt-5xl pb-comp-dialog-p",
|
|
146
|
+
// `max-w-none` is unusable: the design system defines
|
|
147
|
+
// `--spacing-none`, so Tailwind resolves it to `0px`.
|
|
148
|
+
s && "max-md:max-w-[none] max-md:rounded-none",
|
|
149
|
+
s && (c || x ? (
|
|
150
|
+
// The overlay's grid row is auto-sized, so the column needs
|
|
151
|
+
// a definite height for the `flex-1` middle to scroll in.
|
|
152
|
+
"max-md:h-dvh max-md:max-h-dvh"
|
|
153
|
+
) : (
|
|
154
|
+
// Tokens follow the design's fullscreen frame, which binds
|
|
155
|
+
// the primitives rather than the dialog tokens.
|
|
156
|
+
[
|
|
157
|
+
"max-md:px-layout-p-standard max-md:pt-xl",
|
|
158
|
+
!d && "max-md:pb-3xl"
|
|
159
|
+
]
|
|
160
|
+
)),
|
|
161
|
+
t
|
|
162
|
+
),
|
|
163
|
+
...f,
|
|
164
|
+
children: c || x ? /* @__PURE__ */ n(D, { children: [
|
|
165
|
+
v,
|
|
166
|
+
/* @__PURE__ */ n(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: i(
|
|
170
|
+
"-mr-[calc(var(--spacing-comp-dialog-p)-8px)] min-h-0 flex-1 overflow-y-auto pr-[calc(var(--spacing-comp-dialog-p)-8px-5px)] [&::-webkit-scrollbar]:w-[5px] [&::-webkit-scrollbar]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-stroke-base-secondary hover:[&::-webkit-scrollbar-thumb]:bg-stroke-base-primary [&::-webkit-scrollbar-track]:bg-transparent",
|
|
171
|
+
d ? "py-comp-dialog-p-hor-sm" : "py-comp-dialog-p"
|
|
172
|
+
),
|
|
173
|
+
children: [
|
|
174
|
+
s && !c && /* @__PURE__ */ a(
|
|
175
|
+
w,
|
|
176
|
+
{
|
|
177
|
+
className: "mb-xl ml-auto block md:hidden",
|
|
178
|
+
ariaLabel: g
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ a("div", { children: A })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
150
184
|
),
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
185
|
+
N
|
|
186
|
+
] }) : /* @__PURE__ */ n(D, { children: [
|
|
187
|
+
o,
|
|
188
|
+
/* @__PURE__ */ a(
|
|
189
|
+
w,
|
|
190
|
+
{
|
|
191
|
+
className: i(
|
|
192
|
+
"absolute top-4 right-4",
|
|
193
|
+
s && "max-md:static max-md:order-first max-md:mb-xl max-md:self-end"
|
|
194
|
+
),
|
|
195
|
+
ariaLabel: g
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
199
|
+
}
|
|
200
|
+
)
|
|
165
201
|
}
|
|
166
|
-
) })
|
|
202
|
+
) });
|
|
167
203
|
}
|
|
168
204
|
);
|
|
169
|
-
|
|
205
|
+
V.displayName = e.Content.displayName;
|
|
170
206
|
export {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
207
|
+
J as Dialog,
|
|
208
|
+
U as DialogClose,
|
|
209
|
+
V as DialogContent,
|
|
210
|
+
Q as DialogDescription,
|
|
211
|
+
P as DialogFooter,
|
|
212
|
+
j as DialogHeader,
|
|
213
|
+
L as DialogOverlay,
|
|
214
|
+
R as DialogPortal,
|
|
215
|
+
K as DialogTitle,
|
|
216
|
+
S as DialogTrigger
|
|
181
217
|
};
|
|
@@ -17,4 +17,7 @@ export declare const OverflowContent: Story;
|
|
|
17
17
|
export declare const WithHeaderAndFooter: Story;
|
|
18
18
|
export declare const SmallerContentYPadding: Story;
|
|
19
19
|
export declare const WithHeaderAndFooterLongContent: Story;
|
|
20
|
+
export declare const FullscreenOnMobile: Story;
|
|
21
|
+
export declare const FullscreenOnMobileWithHeaderAndFooter: Story;
|
|
22
|
+
export declare const FullscreenOnMobileFooterOnly: Story;
|
|
20
23
|
//# sourceMappingURL=Dialog.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EACL,MAAM,EAOP,MAAM,UAAU,CAAA;AAEjB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAiD7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAA;AAEtC,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAoDnB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KA+BvB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAkBpB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAkBnB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KA2CjC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAuCpC,CAAA;AAED,eAAO,MAAM,8BAA8B,EAAE,KAiK5C,CAAA"}
|
|
1
|
+
{"version":3,"file":"Dialog.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EACL,MAAM,EAOP,MAAM,UAAU,CAAA;AAEjB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAiD7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAA;AAEtC,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAoDnB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KA+BvB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAkBpB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAkBnB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KA2CjC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAuCpC,CAAA;AAED,eAAO,MAAM,8BAA8B,EAAE,KAiK5C,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KA6HhC,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,KAwCnD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAiD1C,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const offerCardVariants: (props?: ({
|
|
4
4
|
variant?: "search" | "compact" | null | undefined;
|
|
5
|
-
|
|
5
|
+
isTinted?: boolean | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare const offerCardTitleVariants: (props?: ({
|
|
8
8
|
variant?: "search" | "compact" | null | undefined;
|
|
@@ -11,7 +11,6 @@ declare const offerCardDescriptionVariants: (props?: ({
|
|
|
11
11
|
variant?: "search" | "compact" | null | undefined;
|
|
12
12
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
13
|
export type OfferCardVariant = 'compact' | 'search';
|
|
14
|
-
type OfferCardType = 'default' | 'promo';
|
|
15
14
|
/** Props for the `OfferCard.Skeleton` subcomponent. */
|
|
16
15
|
export interface OfferCardSkeletonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
17
16
|
/**
|
|
@@ -29,16 +28,16 @@ export interface OfferCardSkeletonProps extends Omit<React.HTMLAttributes<HTMLDi
|
|
|
29
28
|
*/
|
|
30
29
|
color?: 'default' | 'light';
|
|
31
30
|
/**
|
|
32
|
-
* Mirrors `OfferCard.
|
|
33
|
-
* background when standing in for a
|
|
34
|
-
*
|
|
31
|
+
* Mirrors `OfferCard.isTinted` so the skeleton reserves the same tinted
|
|
32
|
+
* background when standing in for a tinted compact card. Has no effect on
|
|
33
|
+
* the `'search'` variant.
|
|
35
34
|
*
|
|
36
|
-
* @default
|
|
35
|
+
* @default false
|
|
37
36
|
*/
|
|
38
|
-
|
|
37
|
+
isTinted?: boolean;
|
|
39
38
|
}
|
|
40
39
|
declare const OfferCardSkeleton: {
|
|
41
|
-
({ variant, color,
|
|
40
|
+
({ variant, color, isTinted, className, ...props }: OfferCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
42
41
|
displayName: string;
|
|
43
42
|
};
|
|
44
43
|
/**
|
|
@@ -47,7 +46,7 @@ declare const OfferCardSkeleton: {
|
|
|
47
46
|
* children/asChild axis are split into the two members of the discriminated
|
|
48
47
|
* union below.
|
|
49
48
|
*/
|
|
50
|
-
export interface OfferCardBaseProps extends Omit<VariantProps<typeof offerCardVariants>, 'variant' | '
|
|
49
|
+
export interface OfferCardBaseProps extends Omit<VariantProps<typeof offerCardVariants>, 'variant' | 'isTinted'> {
|
|
51
50
|
/** Offer title — primary heading rendered inside the clickable link. */
|
|
52
51
|
name: string;
|
|
53
52
|
/**
|
|
@@ -55,13 +54,37 @@ export interface OfferCardBaseProps extends Omit<VariantProps<typeof offerCardVa
|
|
|
55
54
|
* custom React node such as a Next.js `<Image>` element. The wrapper
|
|
56
55
|
* handles sizing, rounded corners, overflow, and the disabled dim; any
|
|
57
56
|
* direct `<img>` child is auto-stretched to fill the wrapper.
|
|
57
|
+
*
|
|
58
|
+
* Omit it (or pass `undefined`) to render the placeholder instead — pair
|
|
59
|
+
* that with `placeholderIcon` and `placeholderColor`.
|
|
58
60
|
*/
|
|
59
|
-
image
|
|
61
|
+
image?: string | React.ReactNode;
|
|
60
62
|
/**
|
|
61
63
|
* Alt text for the built-in `<img>` (used when `image` is a string).
|
|
62
64
|
* Defaults to `name`. Ignored when `image` is a custom React node.
|
|
63
65
|
*/
|
|
64
66
|
imageAlt?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Decorative icon rendered centred in the image area when `image` is
|
|
69
|
+
* absent — typically the market-category icon for the offer. Sized by the
|
|
70
|
+
* card (56px on desktop, 40px below `md` on `compact`) and coloured via
|
|
71
|
+
* `currentColor`, so pass a bare Solar icon element.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <OfferCard
|
|
75
|
+
* name="Concert"
|
|
76
|
+
* placeholderIcon={<MusicNoteBold />}
|
|
77
|
+
* placeholderColor="#e4329c"
|
|
78
|
+
* />
|
|
79
|
+
*/
|
|
80
|
+
placeholderIcon?: React.ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* Any CSS color string driving the placeholder. The image area is filled
|
|
83
|
+
* with the color at 20% alpha, the icon and the category `Tag` take the
|
|
84
|
+
* full color. Omit to fall back to the brand-tertiary tint with a
|
|
85
|
+
* tertiary-grey icon.
|
|
86
|
+
*/
|
|
87
|
+
placeholderColor?: string;
|
|
65
88
|
/**
|
|
66
89
|
* Optional partner / merchant logo — either a URL string (rendered as a
|
|
67
90
|
* plain `<img>`) or a custom React node such as a Next.js `<Image>`.
|
|
@@ -104,6 +127,12 @@ export interface OfferCardBaseProps extends Omit<VariantProps<typeof offerCardVa
|
|
|
104
127
|
rating?: number;
|
|
105
128
|
/** Review count shown as `(N)` next to the rating. Only shown when `rating` is set. */
|
|
106
129
|
ratingCount?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Formatted price rendered as a `PriceTag` pill below the vendor/rating
|
|
132
|
+
* row — e.g. `"100 Kč"`. Formatting is the consumer's responsibility.
|
|
133
|
+
* Only rendered on the `search` variant; omit to hide the pill.
|
|
134
|
+
*/
|
|
135
|
+
price?: React.ReactNode;
|
|
107
136
|
/**
|
|
108
137
|
* Controlled favorite state for the embedded `HeartButton`. When provided,
|
|
109
138
|
* the heart does not manage its own state.
|
|
@@ -138,14 +167,14 @@ export interface OfferCardBaseProps extends Omit<VariantProps<typeof offerCardVa
|
|
|
138
167
|
*/
|
|
139
168
|
variant?: OfferCardVariant;
|
|
140
169
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* effect on the `search` variant.
|
|
170
|
+
* Swaps the `compact` card's transparent fill for a tinted
|
|
171
|
+
* `--color-surface-base-secondary` background, used to highlight promoted
|
|
172
|
+
* entries in a grid. `PartnerCard` takes the same prop, so a mixed promo
|
|
173
|
+
* band tints uniformly. Has no effect on the `search` variant.
|
|
145
174
|
*
|
|
146
|
-
* @default
|
|
175
|
+
* @default false
|
|
147
176
|
*/
|
|
148
|
-
|
|
177
|
+
isTinted?: boolean;
|
|
149
178
|
/**
|
|
150
179
|
* Disabled visual state. Adds the disabled border, dims the image, and
|
|
151
180
|
* grays the text. The anchor's `href` is also stripped so the card is
|
|
@@ -202,5 +231,4 @@ declare const OfferCardWithSkeleton: typeof OfferCard & {
|
|
|
202
231
|
Skeleton: typeof OfferCardSkeleton;
|
|
203
232
|
};
|
|
204
233
|
export { OfferCardWithSkeleton as OfferCard, offerCardVariants, offerCardTitleVariants, offerCardDescriptionVariants, };
|
|
205
|
-
export type { OfferCardType };
|
|
206
234
|
//# sourceMappingURL=OfferCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfferCard.d.ts","sourceRoot":"","sources":["../../../src/components/OfferCard/OfferCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"OfferCard.d.ts","sourceRoot":"","sources":["../../../src/components/OfferCard/OfferCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAiBjE,QAAA,MAAM,iBAAiB;;;8EA2BtB,CAAA;AAED,QAAA,MAAM,sBAAsB;;8EAU1B,CAAA;AAEF,QAAA,MAAM,4BAA4B;;8EAUhC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAA;AA6BnD,uDAAuD;AACvD,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,QAAA,MAAM,iBAAiB;wDAMpB,sBAAsB;;CA4CxB,CAAA;AAGD;;;;;GAKG;AACH,MAAM,WAAW,kBAC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