@drawbridge/components 0.0.2 → 0.0.3
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/card-advertisement.js +138 -129
- package/dist/card-advertisement.mjs +138 -129
- package/package.json +1 -1
|
@@ -23,7 +23,8 @@ __export(card_advertisement_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(card_advertisement_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
|
-
var
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
27
28
|
"img",
|
|
28
29
|
{
|
|
29
30
|
...{
|
|
@@ -33,7 +34,7 @@ var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ React.createElem
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
);
|
|
36
|
-
var DefaultVideo = ({ className, hsl, mp4, poster }) => /* @__PURE__ */
|
|
37
|
+
var DefaultVideo = ({ className, hsl, mp4, poster }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
37
38
|
"video",
|
|
38
39
|
{
|
|
39
40
|
...{
|
|
@@ -107,7 +108,7 @@ var CardAdvertisement = ({
|
|
|
107
108
|
classes.asset.push("bg-gray-light");
|
|
108
109
|
}
|
|
109
110
|
;
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
111
112
|
"div",
|
|
112
113
|
{
|
|
113
114
|
...{
|
|
@@ -116,142 +117,150 @@ var CardAdvertisement = ({
|
|
|
116
117
|
backgroundColor: (_f = (_e = style == null ? void 0 : style.background) == null ? void 0 : _e.color) == null ? void 0 : _f.hex,
|
|
117
118
|
color: (_h = (_g = style == null ? void 0 : style.text) == null ? void 0 : _g.color) == null ? void 0 : _h.hex
|
|
118
119
|
}
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
/* @__PURE__ */ React.createElement(
|
|
122
|
-
"span",
|
|
123
|
-
{
|
|
124
|
-
...{
|
|
125
|
-
className: classes.asset.join(" ")
|
|
126
|
-
}
|
|
127
120
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
...{
|
|
132
|
-
alt: asset == null ? void 0 : asset.filename,
|
|
133
|
-
className: "w-full h-full object-cover",
|
|
134
|
-
fill: true,
|
|
135
|
-
key: asset == null ? void 0 : asset.id,
|
|
136
|
-
priority: false,
|
|
137
|
-
sizes: "100%",
|
|
138
|
-
src: [
|
|
139
|
-
(_i = asset == null ? void 0 : asset.sizes) == null ? void 0 : _i["400x400"],
|
|
140
|
-
(asset == null ? void 0 : asset.updatedAt) && "?query=" + (asset == null ? void 0 : asset.updatedAt)
|
|
141
|
-
].filter(Boolean).join("")
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
!(asset == null ? void 0 : asset.sizes) && (product == null ? void 0 : product.image) && /* @__PURE__ */ React.createElement(
|
|
146
|
-
ImageComponent,
|
|
147
|
-
{
|
|
148
|
-
...{
|
|
149
|
-
alt: (product == null ? void 0 : product.title) || "Product",
|
|
150
|
-
className: "w-full h-full object-cover",
|
|
151
|
-
fill: true,
|
|
152
|
-
priority: false,
|
|
153
|
-
sizes: "100%",
|
|
154
|
-
src: product.image,
|
|
155
|
-
unoptimized: true
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
(asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("video") && /* @__PURE__ */ React.createElement(
|
|
160
|
-
"div",
|
|
161
|
-
{
|
|
162
|
-
...{
|
|
163
|
-
className: "relative h-full w-full aspect-[9/16]"
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
/* @__PURE__ */ React.createElement(
|
|
167
|
-
VideoComponent,
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
123
|
+
"span",
|
|
168
124
|
{
|
|
169
125
|
...{
|
|
170
|
-
className: "
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
126
|
+
className: classes.asset.join(" ")
|
|
127
|
+
},
|
|
128
|
+
children: [
|
|
129
|
+
(asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("image") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
ImageComponent,
|
|
131
|
+
{
|
|
132
|
+
...{
|
|
133
|
+
alt: asset == null ? void 0 : asset.filename,
|
|
134
|
+
className: "w-full h-full object-cover",
|
|
135
|
+
fill: true,
|
|
136
|
+
key: asset == null ? void 0 : asset.id,
|
|
137
|
+
priority: false,
|
|
138
|
+
sizes: "100%",
|
|
139
|
+
src: [
|
|
140
|
+
(_i = asset == null ? void 0 : asset.sizes) == null ? void 0 : _i["400x400"],
|
|
141
|
+
(asset == null ? void 0 : asset.updatedAt) && "?query=" + (asset == null ? void 0 : asset.updatedAt)
|
|
142
|
+
].filter(Boolean).join("")
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
!(asset == null ? void 0 : asset.sizes) && (product == null ? void 0 : product.image) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
147
|
+
ImageComponent,
|
|
148
|
+
{
|
|
149
|
+
...{
|
|
150
|
+
alt: (product == null ? void 0 : product.title) || "Product",
|
|
151
|
+
className: "w-full h-full object-cover",
|
|
152
|
+
fill: true,
|
|
153
|
+
priority: false,
|
|
154
|
+
sizes: "100%",
|
|
155
|
+
src: product.image,
|
|
156
|
+
unoptimized: true
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
(asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("video") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
...{
|
|
164
|
+
className: "relative h-full w-full aspect-[9/16]"
|
|
165
|
+
},
|
|
166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
167
|
+
VideoComponent,
|
|
168
|
+
{
|
|
169
|
+
...{
|
|
170
|
+
className: "w-full h-full",
|
|
171
|
+
hsl: ((_j = asset == null ? void 0 : asset.sizes) == null ? void 0 : _j.hsl) + "?query=" + (asset == null ? void 0 : asset.updatedAt),
|
|
172
|
+
mp4: ((_k = asset == null ? void 0 : asset.sizes) == null ? void 0 : _k.original) + "?query=" + (asset == null ? void 0 : asset.updatedAt),
|
|
173
|
+
poster: (((_n = (_m = (_l = asset == null ? void 0 : asset.frames) == null ? void 0 : _l[asset == null ? void 0 : asset.poster]) == null ? void 0 : _m.sizes) == null ? void 0 : _n["500x500"]) || ((_q = (_p = (_o = asset == null ? void 0 : asset.frames) == null ? void 0 : _o[asset == null ? void 0 : asset.poster]) == null ? void 0 : _p.sizes) == null ? void 0 : _q["1080x1920"])) + "?query=" + (asset == null ? void 0 : asset.updatedAt)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
hasVariants && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
180
|
+
"div",
|
|
181
|
+
{
|
|
182
|
+
...{
|
|
183
|
+
className: "absolute inset-0 flex flex-col justify-end transition-transform duration-300 ease-in-out p-4 space-y-3",
|
|
184
|
+
style: {
|
|
185
|
+
backgroundColor: "rgba(0,0,0,0.92)",
|
|
186
|
+
transform: variantsOpen ? "translateY(0)" : "translateY(100%)"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
+
"p",
|
|
192
|
+
{
|
|
193
|
+
...{
|
|
194
|
+
className: "text-xs text-white/60"
|
|
195
|
+
},
|
|
196
|
+
children: "Select an option"
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
...{
|
|
203
|
+
className: "flex flex-wrap gap-2"
|
|
204
|
+
},
|
|
205
|
+
children: variants.map((variant) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
206
|
+
"button",
|
|
207
|
+
{
|
|
208
|
+
...{
|
|
209
|
+
className: "text-xs px-3 py-1.5 rounded border border-white/30 text-white hover:border-white transition-colors",
|
|
210
|
+
onClick: () => {
|
|
211
|
+
if (preview) return;
|
|
212
|
+
const href = variantUrl(variant);
|
|
213
|
+
if (href) window.open(href, "_blank");
|
|
214
|
+
},
|
|
215
|
+
type: "button"
|
|
216
|
+
},
|
|
217
|
+
children: variant.title
|
|
218
|
+
},
|
|
219
|
+
variant.shopifyId
|
|
220
|
+
))
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
]
|
|
187
227
|
}
|
|
188
|
-
},
|
|
189
|
-
/* @__PURE__ */ React.createElement(
|
|
190
|
-
"p",
|
|
191
|
-
{
|
|
192
|
-
...{
|
|
193
|
-
className: "text-xs text-white/60"
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"Select an option"
|
|
197
228
|
),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
"
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
230
|
+
"span",
|
|
200
231
|
{
|
|
201
232
|
...{
|
|
202
|
-
className: "
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
{
|
|
208
|
-
key: variant.shopifyId,
|
|
209
|
-
...{
|
|
210
|
-
className: "text-xs px-3 py-1.5 rounded border border-white/30 text-white hover:border-white transition-colors",
|
|
211
|
-
onClick: () => {
|
|
212
|
-
if (preview) return;
|
|
213
|
-
const href = variantUrl(variant);
|
|
214
|
-
if (href) window.open(href, "_blank");
|
|
215
|
-
},
|
|
216
|
-
type: "button"
|
|
233
|
+
className: classes.content.join(" "),
|
|
234
|
+
style: {
|
|
235
|
+
...fonts == null ? void 0 : fonts.body,
|
|
236
|
+
backgroundColor: (_s = (_r = style == null ? void 0 : style.text) == null ? void 0 : _r.color) == null ? void 0 : _s.hex,
|
|
237
|
+
color: (_u = (_t = style == null ? void 0 : style.background) == null ? void 0 : _t.color) == null ? void 0 : _u.hex
|
|
217
238
|
}
|
|
218
239
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
{
|
|
240
|
-
...{
|
|
241
|
-
className: classes.button.join(" "),
|
|
242
|
-
disabled: !preview && !hasVariants && !url,
|
|
243
|
-
onClick: hasVariants ? () => setVariantsOpen((v) => !v) : preview ? () => {
|
|
244
|
-
} : onClick,
|
|
245
|
-
style: {
|
|
246
|
-
backgroundColor: (_w = (_v = style == null ? void 0 : style.background) == null ? void 0 : _v.color) == null ? void 0 : _w.hex,
|
|
247
|
-
color: (_y = (_x = style == null ? void 0 : style.text) == null ? void 0 : _x.color) == null ? void 0 : _y.hex
|
|
248
|
-
},
|
|
249
|
-
type: "button"
|
|
240
|
+
children: [
|
|
241
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
|
|
242
|
+
button && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
...{
|
|
246
|
+
className: classes.button.join(" "),
|
|
247
|
+
disabled: !preview && !hasVariants && !url,
|
|
248
|
+
onClick: hasVariants ? () => setVariantsOpen((v) => !v) : preview ? () => {
|
|
249
|
+
} : onClick,
|
|
250
|
+
style: {
|
|
251
|
+
backgroundColor: (_w = (_v = style == null ? void 0 : style.background) == null ? void 0 : _v.color) == null ? void 0 : _w.hex,
|
|
252
|
+
color: (_y = (_x = style == null ? void 0 : style.text) == null ? void 0 : _x.color) == null ? void 0 : _y.hex
|
|
253
|
+
},
|
|
254
|
+
type: "button"
|
|
255
|
+
},
|
|
256
|
+
children: variantsOpen ? "Close" : button
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
]
|
|
250
260
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)
|
|
261
|
+
)
|
|
262
|
+
]
|
|
263
|
+
}
|
|
255
264
|
);
|
|
256
265
|
};
|
|
257
266
|
var card_advertisement_default = CardAdvertisement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// components/card-advertisement.js
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ jsx(
|
|
4
5
|
"img",
|
|
5
6
|
{
|
|
6
7
|
...{
|
|
@@ -10,7 +11,7 @@ var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ React.createElem
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
);
|
|
13
|
-
var DefaultVideo = ({ className, hsl, mp4, poster }) => /* @__PURE__ */
|
|
14
|
+
var DefaultVideo = ({ className, hsl, mp4, poster }) => /* @__PURE__ */ jsx(
|
|
14
15
|
"video",
|
|
15
16
|
{
|
|
16
17
|
...{
|
|
@@ -84,7 +85,7 @@ var CardAdvertisement = ({
|
|
|
84
85
|
classes.asset.push("bg-gray-light");
|
|
85
86
|
}
|
|
86
87
|
;
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ jsxs(
|
|
88
89
|
"div",
|
|
89
90
|
{
|
|
90
91
|
...{
|
|
@@ -93,142 +94,150 @@ var CardAdvertisement = ({
|
|
|
93
94
|
backgroundColor: (_f = (_e = style == null ? void 0 : style.background) == null ? void 0 : _e.color) == null ? void 0 : _f.hex,
|
|
94
95
|
color: (_h = (_g = style == null ? void 0 : style.text) == null ? void 0 : _g.color) == null ? void 0 : _h.hex
|
|
95
96
|
}
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
/* @__PURE__ */ React.createElement(
|
|
99
|
-
"span",
|
|
100
|
-
{
|
|
101
|
-
...{
|
|
102
|
-
className: classes.asset.join(" ")
|
|
103
|
-
}
|
|
104
97
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
...{
|
|
109
|
-
alt: asset == null ? void 0 : asset.filename,
|
|
110
|
-
className: "w-full h-full object-cover",
|
|
111
|
-
fill: true,
|
|
112
|
-
key: asset == null ? void 0 : asset.id,
|
|
113
|
-
priority: false,
|
|
114
|
-
sizes: "100%",
|
|
115
|
-
src: [
|
|
116
|
-
(_i = asset == null ? void 0 : asset.sizes) == null ? void 0 : _i["400x400"],
|
|
117
|
-
(asset == null ? void 0 : asset.updatedAt) && "?query=" + (asset == null ? void 0 : asset.updatedAt)
|
|
118
|
-
].filter(Boolean).join("")
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
|
-
!(asset == null ? void 0 : asset.sizes) && (product == null ? void 0 : product.image) && /* @__PURE__ */ React.createElement(
|
|
123
|
-
ImageComponent,
|
|
124
|
-
{
|
|
125
|
-
...{
|
|
126
|
-
alt: (product == null ? void 0 : product.title) || "Product",
|
|
127
|
-
className: "w-full h-full object-cover",
|
|
128
|
-
fill: true,
|
|
129
|
-
priority: false,
|
|
130
|
-
sizes: "100%",
|
|
131
|
-
src: product.image,
|
|
132
|
-
unoptimized: true
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
),
|
|
136
|
-
(asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("video") && /* @__PURE__ */ React.createElement(
|
|
137
|
-
"div",
|
|
138
|
-
{
|
|
139
|
-
...{
|
|
140
|
-
className: "relative h-full w-full aspect-[9/16]"
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
/* @__PURE__ */ React.createElement(
|
|
144
|
-
VideoComponent,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsxs(
|
|
100
|
+
"span",
|
|
145
101
|
{
|
|
146
102
|
...{
|
|
147
|
-
className: "
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
103
|
+
className: classes.asset.join(" ")
|
|
104
|
+
},
|
|
105
|
+
children: [
|
|
106
|
+
(asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("image") && /* @__PURE__ */ jsx(
|
|
107
|
+
ImageComponent,
|
|
108
|
+
{
|
|
109
|
+
...{
|
|
110
|
+
alt: asset == null ? void 0 : asset.filename,
|
|
111
|
+
className: "w-full h-full object-cover",
|
|
112
|
+
fill: true,
|
|
113
|
+
key: asset == null ? void 0 : asset.id,
|
|
114
|
+
priority: false,
|
|
115
|
+
sizes: "100%",
|
|
116
|
+
src: [
|
|
117
|
+
(_i = asset == null ? void 0 : asset.sizes) == null ? void 0 : _i["400x400"],
|
|
118
|
+
(asset == null ? void 0 : asset.updatedAt) && "?query=" + (asset == null ? void 0 : asset.updatedAt)
|
|
119
|
+
].filter(Boolean).join("")
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
!(asset == null ? void 0 : asset.sizes) && (product == null ? void 0 : product.image) && /* @__PURE__ */ jsx(
|
|
124
|
+
ImageComponent,
|
|
125
|
+
{
|
|
126
|
+
...{
|
|
127
|
+
alt: (product == null ? void 0 : product.title) || "Product",
|
|
128
|
+
className: "w-full h-full object-cover",
|
|
129
|
+
fill: true,
|
|
130
|
+
priority: false,
|
|
131
|
+
sizes: "100%",
|
|
132
|
+
src: product.image,
|
|
133
|
+
unoptimized: true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
(asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("video") && /* @__PURE__ */ jsx(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
...{
|
|
141
|
+
className: "relative h-full w-full aspect-[9/16]"
|
|
142
|
+
},
|
|
143
|
+
children: /* @__PURE__ */ jsx(
|
|
144
|
+
VideoComponent,
|
|
145
|
+
{
|
|
146
|
+
...{
|
|
147
|
+
className: "w-full h-full",
|
|
148
|
+
hsl: ((_j = asset == null ? void 0 : asset.sizes) == null ? void 0 : _j.hsl) + "?query=" + (asset == null ? void 0 : asset.updatedAt),
|
|
149
|
+
mp4: ((_k = asset == null ? void 0 : asset.sizes) == null ? void 0 : _k.original) + "?query=" + (asset == null ? void 0 : asset.updatedAt),
|
|
150
|
+
poster: (((_n = (_m = (_l = asset == null ? void 0 : asset.frames) == null ? void 0 : _l[asset == null ? void 0 : asset.poster]) == null ? void 0 : _m.sizes) == null ? void 0 : _n["500x500"]) || ((_q = (_p = (_o = asset == null ? void 0 : asset.frames) == null ? void 0 : _o[asset == null ? void 0 : asset.poster]) == null ? void 0 : _p.sizes) == null ? void 0 : _q["1080x1920"])) + "?query=" + (asset == null ? void 0 : asset.updatedAt)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
hasVariants && /* @__PURE__ */ jsxs(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
...{
|
|
160
|
+
className: "absolute inset-0 flex flex-col justify-end transition-transform duration-300 ease-in-out p-4 space-y-3",
|
|
161
|
+
style: {
|
|
162
|
+
backgroundColor: "rgba(0,0,0,0.92)",
|
|
163
|
+
transform: variantsOpen ? "translateY(0)" : "translateY(100%)"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
"p",
|
|
169
|
+
{
|
|
170
|
+
...{
|
|
171
|
+
className: "text-xs text-white/60"
|
|
172
|
+
},
|
|
173
|
+
children: "Select an option"
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
...{
|
|
180
|
+
className: "flex flex-wrap gap-2"
|
|
181
|
+
},
|
|
182
|
+
children: variants.map((variant) => /* @__PURE__ */ jsx(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
...{
|
|
186
|
+
className: "text-xs px-3 py-1.5 rounded border border-white/30 text-white hover:border-white transition-colors",
|
|
187
|
+
onClick: () => {
|
|
188
|
+
if (preview) return;
|
|
189
|
+
const href = variantUrl(variant);
|
|
190
|
+
if (href) window.open(href, "_blank");
|
|
191
|
+
},
|
|
192
|
+
type: "button"
|
|
193
|
+
},
|
|
194
|
+
children: variant.title
|
|
195
|
+
},
|
|
196
|
+
variant.shopifyId
|
|
197
|
+
))
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
]
|
|
164
204
|
}
|
|
165
|
-
},
|
|
166
|
-
/* @__PURE__ */ React.createElement(
|
|
167
|
-
"p",
|
|
168
|
-
{
|
|
169
|
-
...{
|
|
170
|
-
className: "text-xs text-white/60"
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"Select an option"
|
|
174
205
|
),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
"
|
|
206
|
+
/* @__PURE__ */ jsxs(
|
|
207
|
+
"span",
|
|
177
208
|
{
|
|
178
209
|
...{
|
|
179
|
-
className: "
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
{
|
|
185
|
-
key: variant.shopifyId,
|
|
186
|
-
...{
|
|
187
|
-
className: "text-xs px-3 py-1.5 rounded border border-white/30 text-white hover:border-white transition-colors",
|
|
188
|
-
onClick: () => {
|
|
189
|
-
if (preview) return;
|
|
190
|
-
const href = variantUrl(variant);
|
|
191
|
-
if (href) window.open(href, "_blank");
|
|
192
|
-
},
|
|
193
|
-
type: "button"
|
|
210
|
+
className: classes.content.join(" "),
|
|
211
|
+
style: {
|
|
212
|
+
...fonts == null ? void 0 : fonts.body,
|
|
213
|
+
backgroundColor: (_s = (_r = style == null ? void 0 : style.text) == null ? void 0 : _r.color) == null ? void 0 : _s.hex,
|
|
214
|
+
color: (_u = (_t = style == null ? void 0 : style.background) == null ? void 0 : _t.color) == null ? void 0 : _u.hex
|
|
194
215
|
}
|
|
195
216
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
...{
|
|
218
|
-
className: classes.button.join(" "),
|
|
219
|
-
disabled: !preview && !hasVariants && !url,
|
|
220
|
-
onClick: hasVariants ? () => setVariantsOpen((v) => !v) : preview ? () => {
|
|
221
|
-
} : onClick,
|
|
222
|
-
style: {
|
|
223
|
-
backgroundColor: (_w = (_v = style == null ? void 0 : style.background) == null ? void 0 : _v.color) == null ? void 0 : _w.hex,
|
|
224
|
-
color: (_y = (_x = style == null ? void 0 : style.text) == null ? void 0 : _x.color) == null ? void 0 : _y.hex
|
|
225
|
-
},
|
|
226
|
-
type: "button"
|
|
217
|
+
children: [
|
|
218
|
+
title && /* @__PURE__ */ jsx("p", { children: title }),
|
|
219
|
+
button && /* @__PURE__ */ jsx(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
...{
|
|
223
|
+
className: classes.button.join(" "),
|
|
224
|
+
disabled: !preview && !hasVariants && !url,
|
|
225
|
+
onClick: hasVariants ? () => setVariantsOpen((v) => !v) : preview ? () => {
|
|
226
|
+
} : onClick,
|
|
227
|
+
style: {
|
|
228
|
+
backgroundColor: (_w = (_v = style == null ? void 0 : style.background) == null ? void 0 : _v.color) == null ? void 0 : _w.hex,
|
|
229
|
+
color: (_y = (_x = style == null ? void 0 : style.text) == null ? void 0 : _x.color) == null ? void 0 : _y.hex
|
|
230
|
+
},
|
|
231
|
+
type: "button"
|
|
232
|
+
},
|
|
233
|
+
children: variantsOpen ? "Close" : button
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
]
|
|
227
237
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
)
|
|
238
|
+
)
|
|
239
|
+
]
|
|
240
|
+
}
|
|
232
241
|
);
|
|
233
242
|
};
|
|
234
243
|
var card_advertisement_default = CardAdvertisement;
|