@drawbridge/components 0.0.52 → 0.0.55
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/advertisement.js +190 -129
- package/dist/advertisement.mjs +21 -12
- package/dist/{chunk-L5X6LHYZ.mjs → chunk-7AIAMVTM.mjs} +31 -15
- package/dist/chunk-DNK33H3K.mjs +75 -0
- package/dist/chunk-OHJMWJAQ.mjs +86 -0
- package/dist/{chunk-XWELEL6Z.mjs → chunk-PT7UR6AO.mjs} +2 -2
- package/dist/embla-fade.js +41 -0
- package/dist/embla-fade.mjs +6 -0
- package/dist/input-group-error.js +129 -0
- package/dist/input-group-error.mjs +7 -0
- package/dist/input-group.js +91 -52
- package/dist/input-group.mjs +2 -1
- package/dist/input-name.js +101 -64
- package/dist/input-name.mjs +2 -1
- package/dist/input-phone.js +77 -24
- package/dist/input-phone.mjs +49 -19
- package/dist/product.js +162 -109
- package/dist/product.mjs +6 -5
- package/dist/wrapper-gradient.js +2 -2
- package/dist/wrapper-gradient.mjs +1 -1
- package/package.json +10 -1
- package/types/embla-fade.d.ts +2 -0
- package/types/input-group-error.d.ts +14 -0
- package/dist/chunk-3SAKIKZP.mjs +0 -117
package/dist/product.js
CHANGED
|
@@ -38,7 +38,7 @@ var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
|
38
38
|
var import_cdn = require("@drawbridge/shopify/cdn");
|
|
39
39
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
40
40
|
|
|
41
|
-
// components/input-group.js
|
|
41
|
+
// components/input-group-error.js
|
|
42
42
|
var import_react = require("react");
|
|
43
43
|
|
|
44
44
|
// components/icons/warning.js
|
|
@@ -67,8 +67,86 @@ var Warning = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
|
67
67
|
);
|
|
68
68
|
var warning_default = Warning;
|
|
69
69
|
|
|
70
|
-
// components/input-group.js
|
|
70
|
+
// components/input-group-error.js
|
|
71
71
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
72
|
+
var InputGroupError = ({
|
|
73
|
+
className,
|
|
74
|
+
error,
|
|
75
|
+
label,
|
|
76
|
+
message,
|
|
77
|
+
style = {}
|
|
78
|
+
}) => {
|
|
79
|
+
var _a, _b, _c, _d;
|
|
80
|
+
if (!(error || message)) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const classes = [
|
|
84
|
+
"flex items-center justify-start space-x-2 py-1 rounded text-sm"
|
|
85
|
+
];
|
|
86
|
+
if (error) {
|
|
87
|
+
classes.push("px-1.5");
|
|
88
|
+
}
|
|
89
|
+
if (className) {
|
|
90
|
+
classes.push(className);
|
|
91
|
+
}
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
93
|
+
"p",
|
|
94
|
+
{
|
|
95
|
+
...{
|
|
96
|
+
className: classes.join(" "),
|
|
97
|
+
...error && {
|
|
98
|
+
style: {
|
|
99
|
+
backgroundColor: (((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || "rgb( 0, 0, 0 )").replace(")", ",.1)"),
|
|
100
|
+
color: ((_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "rgb( 0, 0, 0 )"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
children: [
|
|
105
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
107
|
+
warning_default,
|
|
108
|
+
{
|
|
109
|
+
...{
|
|
110
|
+
className: "w-4 h-4",
|
|
111
|
+
"aria-hidden": true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
116
|
+
"span",
|
|
117
|
+
{
|
|
118
|
+
...{
|
|
119
|
+
className: "text-[0px] opacity-0 w-0 h-0 absolute"
|
|
120
|
+
},
|
|
121
|
+
children: [
|
|
122
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
|
|
123
|
+
label,
|
|
124
|
+
": "
|
|
125
|
+
] }) : null,
|
|
126
|
+
error
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
132
|
+
"span",
|
|
133
|
+
{
|
|
134
|
+
...{
|
|
135
|
+
...error && {
|
|
136
|
+
"aria-hidden": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
children: error || message
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
var input_group_error_default = InputGroupError;
|
|
147
|
+
|
|
148
|
+
// components/input-group.js
|
|
149
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
72
150
|
var InputGroup = ({
|
|
73
151
|
className,
|
|
74
152
|
error,
|
|
@@ -78,7 +156,6 @@ var InputGroup = ({
|
|
|
78
156
|
style = {},
|
|
79
157
|
...rest
|
|
80
158
|
}) => {
|
|
81
|
-
var _a, _b, _c, _d;
|
|
82
159
|
const classes = [
|
|
83
160
|
"input-group"
|
|
84
161
|
];
|
|
@@ -88,7 +165,7 @@ var InputGroup = ({
|
|
|
88
165
|
if (error) {
|
|
89
166
|
classes.push("error");
|
|
90
167
|
}
|
|
91
|
-
return /* @__PURE__ */ (0,
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
92
169
|
"div",
|
|
93
170
|
{
|
|
94
171
|
...{
|
|
@@ -99,14 +176,14 @@ var InputGroup = ({
|
|
|
99
176
|
}
|
|
100
177
|
},
|
|
101
178
|
children: [
|
|
102
|
-
label ? /* @__PURE__ */ (0,
|
|
179
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
103
180
|
"div",
|
|
104
181
|
{
|
|
105
182
|
...{
|
|
106
183
|
className: "space-y-2"
|
|
107
184
|
},
|
|
108
185
|
children: [
|
|
109
|
-
/* @__PURE__ */ (0,
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
110
187
|
"span",
|
|
111
188
|
{
|
|
112
189
|
...{
|
|
@@ -119,55 +196,15 @@ var InputGroup = ({
|
|
|
119
196
|
]
|
|
120
197
|
}
|
|
121
198
|
) : input,
|
|
122
|
-
|
|
123
|
-
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
200
|
+
input_group_error_default,
|
|
124
201
|
{
|
|
125
202
|
...{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
children: [
|
|
135
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
|
|
136
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
137
|
-
warning_default,
|
|
138
|
-
{
|
|
139
|
-
...{
|
|
140
|
-
className: "w-4 h-4",
|
|
141
|
-
"aria-hidden": true
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
146
|
-
"span",
|
|
147
|
-
{
|
|
148
|
-
...{
|
|
149
|
-
className: "text-[0px] opacity-0 w-0 h-0 absolute"
|
|
150
|
-
},
|
|
151
|
-
children: [
|
|
152
|
-
label,
|
|
153
|
-
": ",
|
|
154
|
-
error
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
)
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
160
|
-
"span",
|
|
161
|
-
{
|
|
162
|
-
...{
|
|
163
|
-
...error && {
|
|
164
|
-
"aria-hidden": true
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
children: error || message
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
]
|
|
203
|
+
error,
|
|
204
|
+
label,
|
|
205
|
+
message,
|
|
206
|
+
style
|
|
207
|
+
}
|
|
171
208
|
}
|
|
172
209
|
)
|
|
173
210
|
]
|
|
@@ -180,8 +217,8 @@ var input_group_default = InputGroup;
|
|
|
180
217
|
var import_react2 = require("react");
|
|
181
218
|
|
|
182
219
|
// components/icons/chevron-down.js
|
|
183
|
-
var
|
|
184
|
-
var ChevronDown = (props) => /* @__PURE__ */ (0,
|
|
220
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
221
|
+
var ChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
185
222
|
"svg",
|
|
186
223
|
{
|
|
187
224
|
...{
|
|
@@ -191,7 +228,7 @@ var ChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
|
191
228
|
viewBox: "0 0 24 24",
|
|
192
229
|
...props
|
|
193
230
|
},
|
|
194
|
-
children: /* @__PURE__ */ (0,
|
|
231
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
195
232
|
"path",
|
|
196
233
|
{
|
|
197
234
|
...{
|
|
@@ -236,7 +273,7 @@ var inputStyle = (style) => {
|
|
|
236
273
|
};
|
|
237
274
|
|
|
238
275
|
// components/input-select.js
|
|
239
|
-
var
|
|
276
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
240
277
|
var InputSelect = ({
|
|
241
278
|
onChange,
|
|
242
279
|
options = [],
|
|
@@ -257,14 +294,14 @@ var InputSelect = ({
|
|
|
257
294
|
window.removeEventListener("mousedown", click);
|
|
258
295
|
};
|
|
259
296
|
}, []);
|
|
260
|
-
return /* @__PURE__ */ (0,
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
261
298
|
"div",
|
|
262
299
|
{
|
|
263
300
|
...{
|
|
264
301
|
className: "relative"
|
|
265
302
|
},
|
|
266
303
|
children: [
|
|
267
|
-
/* @__PURE__ */ (0,
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
268
305
|
"select",
|
|
269
306
|
{
|
|
270
307
|
...{
|
|
@@ -275,7 +312,7 @@ var InputSelect = ({
|
|
|
275
312
|
value
|
|
276
313
|
},
|
|
277
314
|
children: [
|
|
278
|
-
/* @__PURE__ */ (0,
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
279
316
|
"option",
|
|
280
317
|
{
|
|
281
318
|
...{
|
|
@@ -286,7 +323,7 @@ var InputSelect = ({
|
|
|
286
323
|
children: "Select"
|
|
287
324
|
}
|
|
288
325
|
),
|
|
289
|
-
options.map(({ label, option, value: optValue }, key) => /* @__PURE__ */ (0,
|
|
326
|
+
options.map(({ label, option, value: optValue }, key) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
290
327
|
"option",
|
|
291
328
|
{
|
|
292
329
|
...{
|
|
@@ -299,14 +336,14 @@ var InputSelect = ({
|
|
|
299
336
|
]
|
|
300
337
|
}
|
|
301
338
|
),
|
|
302
|
-
/* @__PURE__ */ (0,
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
303
340
|
"div",
|
|
304
341
|
{
|
|
305
342
|
...{
|
|
306
343
|
"aria-hidden": true,
|
|
307
344
|
className: "h-full flex items-center absolute inset-y-0 right-0 pointer-events-none px-2.5"
|
|
308
345
|
},
|
|
309
|
-
children: /* @__PURE__ */ (0,
|
|
346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
310
347
|
chevron_down_default,
|
|
311
348
|
{
|
|
312
349
|
...{
|
|
@@ -324,7 +361,7 @@ var input_select_default = InputSelect;
|
|
|
324
361
|
|
|
325
362
|
// components/wrapper-gradient.js
|
|
326
363
|
var import_react3 = require("react");
|
|
327
|
-
var
|
|
364
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
328
365
|
var WrapperGradientContext = (0, import_react3.createContext)(null);
|
|
329
366
|
var WrapperGradient = ({
|
|
330
367
|
children,
|
|
@@ -338,9 +375,9 @@ var WrapperGradient = ({
|
|
|
338
375
|
const showX = horizontal === true || horizontal === "both";
|
|
339
376
|
const showY = horizontal === false || horizontal === "both";
|
|
340
377
|
const overflowClass = horizontal === "both" ? "overflow-scroll" : horizontal ? "overflow-x-scroll overflow-y-visible" : "overflow-y-scroll overflow-x-visible";
|
|
341
|
-
const overscrollClass = horizontal
|
|
378
|
+
const overscrollClass = horizontal ? "overscroll-x-none" : "";
|
|
342
379
|
const themed = Boolean(color);
|
|
343
|
-
const gradientDefaults = "absolute z-[2]
|
|
380
|
+
const gradientDefaults = "absolute z-[2] pointer-events-none transition-all duration-[100ms] ";
|
|
344
381
|
const classes = {
|
|
345
382
|
container: [
|
|
346
383
|
themed ? "relative" : "w-full relative",
|
|
@@ -447,14 +484,14 @@ var WrapperGradient = ({
|
|
|
447
484
|
}),
|
|
448
485
|
[scroll.atBottom, scroll.atRight]
|
|
449
486
|
);
|
|
450
|
-
return /* @__PURE__ */ (0,
|
|
487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
451
488
|
"div",
|
|
452
489
|
{
|
|
453
490
|
...{
|
|
454
491
|
className: classes.container.join(" ")
|
|
455
492
|
},
|
|
456
|
-
children: /* @__PURE__ */ (0,
|
|
457
|
-
showY && /* @__PURE__ */ (0,
|
|
493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(WrapperGradientContext.Provider, { value: contextValue, children: [
|
|
494
|
+
showY && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
458
495
|
"div",
|
|
459
496
|
{
|
|
460
497
|
...{
|
|
@@ -470,7 +507,7 @@ var WrapperGradient = ({
|
|
|
470
507
|
}
|
|
471
508
|
}
|
|
472
509
|
),
|
|
473
|
-
showX && /* @__PURE__ */ (0,
|
|
510
|
+
showX && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
474
511
|
"div",
|
|
475
512
|
{
|
|
476
513
|
...{
|
|
@@ -483,7 +520,7 @@ var WrapperGradient = ({
|
|
|
483
520
|
}
|
|
484
521
|
}
|
|
485
522
|
),
|
|
486
|
-
/* @__PURE__ */ (0,
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
487
524
|
"div",
|
|
488
525
|
{
|
|
489
526
|
...{
|
|
@@ -493,7 +530,7 @@ var WrapperGradient = ({
|
|
|
493
530
|
children
|
|
494
531
|
}
|
|
495
532
|
),
|
|
496
|
-
showY && /* @__PURE__ */ (0,
|
|
533
|
+
showY && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
497
534
|
"div",
|
|
498
535
|
{
|
|
499
536
|
...{
|
|
@@ -506,7 +543,7 @@ var WrapperGradient = ({
|
|
|
506
543
|
}
|
|
507
544
|
}
|
|
508
545
|
),
|
|
509
|
-
showX && /* @__PURE__ */ (0,
|
|
546
|
+
showX && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
510
547
|
"div",
|
|
511
548
|
{
|
|
512
549
|
...{
|
|
@@ -526,8 +563,8 @@ var WrapperGradient = ({
|
|
|
526
563
|
var wrapper_gradient_default = WrapperGradient;
|
|
527
564
|
|
|
528
565
|
// components/icons/loader.js
|
|
529
|
-
var
|
|
530
|
-
var Loader = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
566
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
567
|
+
var Loader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
531
568
|
"svg",
|
|
532
569
|
{
|
|
533
570
|
...{
|
|
@@ -539,7 +576,7 @@ var Loader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
539
576
|
...props
|
|
540
577
|
},
|
|
541
578
|
children: [
|
|
542
|
-
/* @__PURE__ */ (0,
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
543
580
|
"circle",
|
|
544
581
|
{
|
|
545
582
|
...{
|
|
@@ -552,7 +589,7 @@ var Loader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
552
589
|
}
|
|
553
590
|
}
|
|
554
591
|
),
|
|
555
|
-
/* @__PURE__ */ (0,
|
|
592
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
556
593
|
"path",
|
|
557
594
|
{
|
|
558
595
|
...{
|
|
@@ -568,8 +605,8 @@ var Loader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime
|
|
|
568
605
|
var loader_default = Loader;
|
|
569
606
|
|
|
570
607
|
// components/product.js
|
|
571
|
-
var
|
|
572
|
-
var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ (0,
|
|
608
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
609
|
+
var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
573
610
|
"img",
|
|
574
611
|
{
|
|
575
612
|
...{
|
|
@@ -583,6 +620,7 @@ var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ (0, impor
|
|
|
583
620
|
var Product = ({
|
|
584
621
|
action = null,
|
|
585
622
|
addToCart = true,
|
|
623
|
+
buttonFontSize,
|
|
586
624
|
disabled = false,
|
|
587
625
|
errors = {},
|
|
588
626
|
header,
|
|
@@ -597,7 +635,7 @@ var Product = ({
|
|
|
597
635
|
style = {},
|
|
598
636
|
variant
|
|
599
637
|
}) => {
|
|
600
|
-
var _a, _b, _c, _d, _e;
|
|
638
|
+
var _a, _b, _c, _d, _e, _f;
|
|
601
639
|
const resolved = {
|
|
602
640
|
...style,
|
|
603
641
|
background: {
|
|
@@ -609,6 +647,7 @@ var Product = ({
|
|
|
609
647
|
color: ((_b = style == null ? void 0 : style.text) == null ? void 0 : _b.color) || { hex: "#000000", rgb: "rgb( 0, 0, 0 )" }
|
|
610
648
|
}
|
|
611
649
|
};
|
|
650
|
+
const imageRadius = ((_c = resolved == null ? void 0 : resolved.image) == null ? void 0 : _c.radius) != null ? resolved.image.radius + "px" : "12px";
|
|
612
651
|
const available = (0, import_react4.useMemo)(
|
|
613
652
|
() => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
|
|
614
653
|
[product]
|
|
@@ -666,7 +705,7 @@ var Product = ({
|
|
|
666
705
|
}
|
|
667
706
|
;
|
|
668
707
|
};
|
|
669
|
-
return /* @__PURE__ */ (0,
|
|
708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
670
709
|
"div",
|
|
671
710
|
{
|
|
672
711
|
...{
|
|
@@ -678,7 +717,7 @@ var Product = ({
|
|
|
678
717
|
},
|
|
679
718
|
children: [
|
|
680
719
|
header,
|
|
681
|
-
images.length > 0 && /* @__PURE__ */ (0,
|
|
720
|
+
images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
682
721
|
"div",
|
|
683
722
|
{
|
|
684
723
|
...{
|
|
@@ -688,26 +727,29 @@ var Product = ({
|
|
|
688
727
|
}
|
|
689
728
|
},
|
|
690
729
|
children: [
|
|
691
|
-
images.length > 1 && /* @__PURE__ */ (0,
|
|
730
|
+
images.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
692
731
|
wrapper_gradient_default,
|
|
693
732
|
{
|
|
694
733
|
...{
|
|
695
734
|
classNameScroll: "flex flex-col w-12 h-48 space-y-3",
|
|
696
735
|
color: resolved.background.color.rgb
|
|
697
736
|
},
|
|
698
|
-
children: images.map(({ src }, key) => /* @__PURE__ */ (0,
|
|
737
|
+
children: images.map(({ src }, key) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
699
738
|
"button",
|
|
700
739
|
{
|
|
701
740
|
...{
|
|
702
741
|
// Active state is conveyed purely by a dimmed image (no border).
|
|
703
|
-
className: "relative w-12 h-12 overflow-hidden
|
|
742
|
+
className: "relative w-12 h-12 overflow-hidden shrink-0",
|
|
704
743
|
onClick: () => {
|
|
705
744
|
setActiveImage(key);
|
|
706
745
|
emblaApi == null ? void 0 : emblaApi.scrollTo(key);
|
|
707
746
|
},
|
|
747
|
+
style: {
|
|
748
|
+
borderRadius: imageRadius
|
|
749
|
+
},
|
|
708
750
|
type: "button"
|
|
709
751
|
},
|
|
710
|
-
children: /* @__PURE__ */ (0,
|
|
752
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
711
753
|
ImageComponent,
|
|
712
754
|
{
|
|
713
755
|
...{
|
|
@@ -731,7 +773,7 @@ var Product = ({
|
|
|
731
773
|
))
|
|
732
774
|
}
|
|
733
775
|
),
|
|
734
|
-
/* @__PURE__ */ (0,
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
735
777
|
"div",
|
|
736
778
|
{
|
|
737
779
|
...{
|
|
@@ -739,14 +781,15 @@ var Product = ({
|
|
|
739
781
|
// those sizes live only in this package's dist, and a consuming
|
|
740
782
|
// app's Tailwind scan of node_modules can lag and drop them,
|
|
741
783
|
// silently collapsing the carousel. Inline styles are immune.
|
|
742
|
-
className: "overflow-hidden
|
|
784
|
+
className: "overflow-hidden m-auto",
|
|
743
785
|
ref: emblaRef,
|
|
744
786
|
style: {
|
|
787
|
+
borderRadius: imageRadius,
|
|
745
788
|
width: "12rem",
|
|
746
789
|
height: "12rem"
|
|
747
790
|
}
|
|
748
791
|
},
|
|
749
|
-
children: /* @__PURE__ */ (0,
|
|
792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
750
793
|
"div",
|
|
751
794
|
{
|
|
752
795
|
...{
|
|
@@ -755,7 +798,7 @@ var Product = ({
|
|
|
755
798
|
height: "100%"
|
|
756
799
|
}
|
|
757
800
|
},
|
|
758
|
-
children: images.map(({ src }, key) => /* @__PURE__ */ (0,
|
|
801
|
+
children: images.map(({ src }, key) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
759
802
|
"div",
|
|
760
803
|
{
|
|
761
804
|
...{
|
|
@@ -765,7 +808,7 @@ var Product = ({
|
|
|
765
808
|
height: "100%"
|
|
766
809
|
}
|
|
767
810
|
},
|
|
768
|
-
children: /* @__PURE__ */ (0,
|
|
811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
769
812
|
ImageComponent,
|
|
770
813
|
{
|
|
771
814
|
...{
|
|
@@ -788,51 +831,51 @@ var Product = ({
|
|
|
788
831
|
]
|
|
789
832
|
}
|
|
790
833
|
),
|
|
791
|
-
/* @__PURE__ */ (0,
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
792
835
|
"div",
|
|
793
836
|
{
|
|
794
837
|
...{
|
|
795
838
|
className: "text-center space-y-2"
|
|
796
839
|
},
|
|
797
840
|
children: [
|
|
798
|
-
(product == null ? void 0 : product.title) && /* @__PURE__ */ (0,
|
|
841
|
+
(product == null ? void 0 : product.title) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
799
842
|
"h2",
|
|
800
843
|
{
|
|
801
844
|
...{
|
|
802
845
|
className: "max-w-80 mx-auto",
|
|
803
846
|
style: {
|
|
804
|
-
fontFamily: ((
|
|
805
|
-
fontWeight: ((
|
|
806
|
-
textTransform: ((
|
|
847
|
+
fontFamily: ((_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.family) || (style == null ? void 0 : style.fontFamily) || "Roboto Flex",
|
|
848
|
+
fontWeight: ((_e = style == null ? void 0 : style.heading) == null ? void 0 : _e.weight) || (style == null ? void 0 : style.fontWeight),
|
|
849
|
+
textTransform: ((_f = style == null ? void 0 : style.heading) == null ? void 0 : _f.transform) || (style == null ? void 0 : style.textTransform)
|
|
807
850
|
}
|
|
808
851
|
},
|
|
809
852
|
children: product == null ? void 0 : product.title
|
|
810
853
|
}
|
|
811
854
|
),
|
|
812
|
-
!available.length ? /* @__PURE__ */ (0,
|
|
855
|
+
!available.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: "Unavailable" }) : (selectedVariant == null ? void 0 : selectedVariant.price) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: (0, import_drawbridge_utils.formatCurrency)({
|
|
813
856
|
code: selectedVariant.currency,
|
|
814
857
|
display: "parts",
|
|
815
858
|
value: selectedVariant.price
|
|
816
859
|
}) }),
|
|
817
|
-
(product == null ? void 0 : product.description) && /* @__PURE__ */ (0,
|
|
860
|
+
(product == null ? void 0 : product.description) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
818
861
|
wrapper_gradient_default,
|
|
819
862
|
{
|
|
820
863
|
...{
|
|
821
864
|
classNameScroll: "max-h-[4.5em]",
|
|
822
865
|
color: resolved.background.color.rgb
|
|
823
866
|
},
|
|
824
|
-
children: /* @__PURE__ */ (0,
|
|
867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: product.description })
|
|
825
868
|
}
|
|
826
869
|
)
|
|
827
870
|
]
|
|
828
871
|
}
|
|
829
872
|
),
|
|
830
|
-
available.length > 1 && /* @__PURE__ */ (0,
|
|
873
|
+
available.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
831
874
|
input_group_default,
|
|
832
875
|
{
|
|
833
876
|
...{
|
|
834
877
|
error: errors == null ? void 0 : errors.variant,
|
|
835
|
-
input: /* @__PURE__ */ (0,
|
|
878
|
+
input: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
836
879
|
input_select_default,
|
|
837
880
|
{
|
|
838
881
|
...{
|
|
@@ -851,29 +894,34 @@ var Product = ({
|
|
|
851
894
|
}
|
|
852
895
|
}
|
|
853
896
|
),
|
|
854
|
-
available.length > 0 && /* @__PURE__ */ (0,
|
|
897
|
+
available.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
855
898
|
input_group_default,
|
|
856
899
|
{
|
|
857
900
|
...{
|
|
858
901
|
error: errors == null ? void 0 : errors.root,
|
|
859
|
-
input: /* @__PURE__ */ (0,
|
|
902
|
+
input: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
860
903
|
"div",
|
|
861
904
|
{
|
|
862
905
|
...{
|
|
863
906
|
className: addToCart ? "grid grid-cols-2 gap-5" : ""
|
|
864
907
|
},
|
|
865
908
|
children: [
|
|
866
|
-
addToCart && /* @__PURE__ */ (0,
|
|
909
|
+
addToCart && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
867
910
|
"button",
|
|
868
911
|
{
|
|
869
912
|
...{
|
|
870
913
|
className: "button justify-center border py-3 px-4 rounded",
|
|
871
914
|
disabled: disabled || Boolean(action),
|
|
872
915
|
onClick: onAdd,
|
|
873
|
-
style:
|
|
916
|
+
style: {
|
|
917
|
+
...inputStyle(resolved),
|
|
918
|
+
...buttonFontSize && {
|
|
919
|
+
fontSize: buttonFontSize
|
|
920
|
+
}
|
|
921
|
+
},
|
|
874
922
|
type: "button"
|
|
875
923
|
},
|
|
876
|
-
children: action === "add" ? /* @__PURE__ */ (0,
|
|
924
|
+
children: action === "add" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
877
925
|
loader_default,
|
|
878
926
|
{
|
|
879
927
|
...{
|
|
@@ -883,17 +931,22 @@ var Product = ({
|
|
|
883
931
|
) : "Add to cart"
|
|
884
932
|
}
|
|
885
933
|
),
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
934
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
887
935
|
"button",
|
|
888
936
|
{
|
|
889
937
|
...{
|
|
890
938
|
className: "button justify-center py-3 px-4 rounded" + (addToCart ? "" : " w-full"),
|
|
891
939
|
disabled: disabled || Boolean(action),
|
|
892
940
|
onClick: onBuy,
|
|
893
|
-
style:
|
|
941
|
+
style: {
|
|
942
|
+
...buttonStyle(resolved),
|
|
943
|
+
...buttonFontSize && {
|
|
944
|
+
fontSize: buttonFontSize
|
|
945
|
+
}
|
|
946
|
+
},
|
|
894
947
|
type: "button"
|
|
895
948
|
},
|
|
896
|
-
children: action === "buy" ? /* @__PURE__ */ (0,
|
|
949
|
+
children: action === "buy" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
897
950
|
loader_default,
|
|
898
951
|
{
|
|
899
952
|
...{
|
package/dist/product.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
product_default
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-XWELEL6Z.mjs";
|
|
7
|
-
import "./chunk-3SAKIKZP.mjs";
|
|
8
|
-
import "./chunk-Q3UIVGPQ.mjs";
|
|
4
|
+
} from "./chunk-7AIAMVTM.mjs";
|
|
5
|
+
import "./chunk-PT7UR6AO.mjs";
|
|
9
6
|
import "./chunk-3SXAH7B7.mjs";
|
|
10
7
|
import "./chunk-FYA7EAMR.mjs";
|
|
8
|
+
import "./chunk-2ZYGRSSA.mjs";
|
|
9
|
+
import "./chunk-DNK33H3K.mjs";
|
|
10
|
+
import "./chunk-OHJMWJAQ.mjs";
|
|
11
|
+
import "./chunk-Q3UIVGPQ.mjs";
|
|
11
12
|
import "./chunk-FJ7PKMAC.mjs";
|
|
12
13
|
export {
|
|
13
14
|
product_default as default
|
package/dist/wrapper-gradient.js
CHANGED
|
@@ -40,9 +40,9 @@ var WrapperGradient = ({
|
|
|
40
40
|
const showX = horizontal === true || horizontal === "both";
|
|
41
41
|
const showY = horizontal === false || horizontal === "both";
|
|
42
42
|
const overflowClass = horizontal === "both" ? "overflow-scroll" : horizontal ? "overflow-x-scroll overflow-y-visible" : "overflow-y-scroll overflow-x-visible";
|
|
43
|
-
const overscrollClass = horizontal
|
|
43
|
+
const overscrollClass = horizontal ? "overscroll-x-none" : "";
|
|
44
44
|
const themed = Boolean(color);
|
|
45
|
-
const gradientDefaults = "absolute z-[2]
|
|
45
|
+
const gradientDefaults = "absolute z-[2] pointer-events-none transition-all duration-[100ms] ";
|
|
46
46
|
const classes = {
|
|
47
47
|
container: [
|
|
48
48
|
themed ? "relative" : "w-full relative",
|