@drawbridge/components 0.0.39 → 0.0.42
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 +1303 -0
- package/dist/advertisement.mjs +98 -0
- package/dist/card-advertisement.mjs +3 -354
- package/dist/chunk-2ZYGRSSA.mjs +45 -0
- package/dist/chunk-7ZLMDYBR.mjs +113 -0
- package/dist/chunk-BD3TDNJE.mjs +98 -0
- package/dist/chunk-FJXG3REN.mjs +93 -0
- package/dist/chunk-FYA7EAMR.mjs +29 -0
- package/dist/chunk-GFDZ7ER6.mjs +29 -0
- package/dist/chunk-GUSVATKJ.mjs +335 -0
- package/dist/chunk-HH7WF5BT.mjs +29 -0
- package/dist/chunk-Q3UIVGPQ.mjs +29 -0
- package/dist/chunk-T5QQBFM3.mjs +29 -0
- package/dist/chunk-TJNIR4PF.mjs +358 -0
- package/dist/chunk-XWELEL6Z.mjs +208 -0
- package/dist/embla.js +41 -0
- package/dist/embla.mjs +6 -0
- package/dist/icons/arrow-down-tray.js +48 -0
- package/dist/icons/arrow-down-tray.mjs +28 -0
- package/dist/icons/arrow-left.js +48 -0
- package/dist/icons/arrow-left.mjs +28 -0
- package/dist/icons/arrow-right.js +48 -0
- package/dist/icons/arrow-right.mjs +28 -0
- package/dist/icons/arrow-up-tray.js +48 -0
- package/dist/icons/arrow-up-tray.mjs +28 -0
- package/dist/icons/bars-arrow-down.js +48 -0
- package/dist/icons/bars-arrow-down.mjs +28 -0
- package/dist/icons/bars-arrow-up.js +48 -0
- package/dist/icons/bars-arrow-up.mjs +28 -0
- package/dist/icons/bold.js +47 -0
- package/dist/icons/bold.mjs +27 -0
- package/dist/icons/bolt.js +48 -0
- package/dist/icons/bolt.mjs +28 -0
- package/dist/icons/calendar.js +48 -0
- package/dist/icons/calendar.mjs +28 -0
- package/dist/icons/cancel.js +48 -0
- package/dist/icons/cancel.mjs +28 -0
- package/dist/icons/card.js +48 -0
- package/dist/icons/card.mjs +28 -0
- package/dist/icons/chart.js +48 -0
- package/dist/icons/chart.mjs +28 -0
- package/dist/icons/check.js +48 -0
- package/dist/icons/check.mjs +6 -0
- package/dist/icons/chevron-down.js +48 -0
- package/dist/icons/chevron-down.mjs +6 -0
- package/dist/icons/chevron-left.js +48 -0
- package/dist/icons/chevron-left.mjs +28 -0
- package/dist/icons/chevron-right.js +48 -0
- package/dist/icons/chevron-right.mjs +28 -0
- package/dist/icons/chevron-up-down.js +48 -0
- package/dist/icons/chevron-up-down.mjs +28 -0
- package/dist/icons/chevron-up.js +48 -0
- package/dist/icons/chevron-up.mjs +28 -0
- package/dist/icons/clock.js +48 -0
- package/dist/icons/clock.mjs +28 -0
- package/dist/icons/code-bracket.js +48 -0
- package/dist/icons/code-bracket.mjs +28 -0
- package/dist/icons/cog.js +60 -0
- package/dist/icons/cog.mjs +40 -0
- package/dist/icons/copy.js +48 -0
- package/dist/icons/copy.mjs +28 -0
- package/dist/icons/document.js +48 -0
- package/dist/icons/document.mjs +28 -0
- package/dist/icons/download.js +48 -0
- package/dist/icons/download.mjs +28 -0
- package/dist/icons/drag.js +51 -0
- package/dist/icons/drag.mjs +31 -0
- package/dist/icons/ellipsis.js +48 -0
- package/dist/icons/ellipsis.mjs +28 -0
- package/dist/icons/email.js +48 -0
- package/dist/icons/email.mjs +28 -0
- package/dist/icons/external.js +48 -0
- package/dist/icons/external.mjs +28 -0
- package/dist/icons/filter.js +48 -0
- package/dist/icons/filter.mjs +28 -0
- package/dist/icons/flag.js +48 -0
- package/dist/icons/flag.mjs +28 -0
- package/dist/icons/google.js +74 -0
- package/dist/icons/google.mjs +54 -0
- package/dist/icons/home.js +48 -0
- package/dist/icons/home.mjs +28 -0
- package/dist/icons/image.js +48 -0
- package/dist/icons/image.mjs +28 -0
- package/dist/icons/italic.js +48 -0
- package/dist/icons/italic.mjs +28 -0
- package/dist/icons/link.js +48 -0
- package/dist/icons/link.mjs +28 -0
- package/dist/icons/loader.js +64 -0
- package/dist/icons/loader.mjs +6 -0
- package/dist/icons/lock.js +48 -0
- package/dist/icons/lock.mjs +28 -0
- package/dist/icons/logo-mark.js +55 -0
- package/dist/icons/logo-mark.mjs +35 -0
- package/dist/icons/logo-tagline.js +137 -0
- package/dist/icons/logo-tagline.mjs +117 -0
- package/dist/icons/map-pin.js +60 -0
- package/dist/icons/map-pin.mjs +40 -0
- package/dist/icons/menu.js +48 -0
- package/dist/icons/menu.mjs +28 -0
- package/dist/icons/minus.js +48 -0
- package/dist/icons/minus.mjs +6 -0
- package/dist/icons/muted.js +48 -0
- package/dist/icons/muted.mjs +28 -0
- package/dist/icons/pause.js +48 -0
- package/dist/icons/pause.mjs +28 -0
- package/dist/icons/pencil.js +48 -0
- package/dist/icons/pencil.mjs +28 -0
- package/dist/icons/play.js +48 -0
- package/dist/icons/play.mjs +28 -0
- package/dist/icons/plus.js +48 -0
- package/dist/icons/plus.mjs +6 -0
- package/dist/icons/powered-by.js +45 -0
- package/dist/icons/powered-by.mjs +25 -0
- package/dist/icons/qr-code.js +60 -0
- package/dist/icons/qr-code.mjs +40 -0
- package/dist/icons/queue.js +48 -0
- package/dist/icons/queue.mjs +28 -0
- package/dist/icons/refresh.js +48 -0
- package/dist/icons/refresh.mjs +28 -0
- package/dist/icons/refund.js +48 -0
- package/dist/icons/refund.mjs +28 -0
- package/dist/icons/rocket.js +48 -0
- package/dist/icons/rocket.mjs +28 -0
- package/dist/icons/search.js +48 -0
- package/dist/icons/search.mjs +28 -0
- package/dist/icons/share.js +48 -0
- package/dist/icons/share.mjs +28 -0
- package/dist/icons/shop.js +46 -0
- package/dist/icons/shop.mjs +26 -0
- package/dist/icons/sparkles.js +48 -0
- package/dist/icons/sparkles.mjs +28 -0
- package/dist/icons/star.js +48 -0
- package/dist/icons/star.mjs +28 -0
- package/dist/icons/switch.js +48 -0
- package/dist/icons/switch.mjs +28 -0
- package/dist/icons/times.js +48 -0
- package/dist/icons/times.mjs +28 -0
- package/dist/icons/trash.js +48 -0
- package/dist/icons/trash.mjs +28 -0
- package/dist/icons/underline.js +48 -0
- package/dist/icons/underline.mjs +28 -0
- package/dist/icons/upload.js +48 -0
- package/dist/icons/upload.mjs +28 -0
- package/dist/icons/volume.js +48 -0
- package/dist/icons/volume.mjs +28 -0
- package/dist/icons/warning.js +48 -0
- package/dist/icons/warning.mjs +6 -0
- package/dist/input-checkbox.js +130 -0
- package/dist/input-checkbox.mjs +71 -0
- package/dist/input-group.js +156 -0
- package/dist/input-group.mjs +7 -0
- package/dist/input-number.js +211 -0
- package/dist/input-number.mjs +136 -0
- package/dist/input-select.js +150 -0
- package/dist/input-select.mjs +9 -0
- package/dist/input-text.js +65 -0
- package/dist/input-text.mjs +36 -0
- package/dist/input-textarea.js +69 -0
- package/dist/input-textarea.mjs +40 -0
- package/dist/product.js +865 -0
- package/dist/product.mjs +14 -0
- package/dist/provider-font.js +94 -0
- package/dist/provider-font.mjs +74 -0
- package/dist/styles.js +127 -0
- package/dist/styles.mjs +28 -0
- package/dist/video.js +195 -0
- package/dist/video.mjs +125 -0
- package/dist/wrapper-gradient.js +232 -0
- package/dist/wrapper-gradient.mjs +9 -0
- package/package.json +316 -2
- package/types/advertisement.d.ts +36 -0
- package/types/embla.d.ts +2 -0
- package/types/icons/arrow-down-tray.d.ts +5 -0
- package/types/icons/arrow-left.d.ts +5 -0
- package/types/icons/arrow-right.d.ts +5 -0
- package/types/icons/arrow-up-tray.d.ts +5 -0
- package/types/icons/bars-arrow-down.d.ts +5 -0
- package/types/icons/bars-arrow-up.d.ts +5 -0
- package/types/icons/bold.d.ts +5 -0
- package/types/icons/bolt.d.ts +5 -0
- package/types/icons/calendar.d.ts +5 -0
- package/types/icons/cancel.d.ts +5 -0
- package/types/icons/card.d.ts +5 -0
- package/types/icons/chart.d.ts +5 -0
- package/types/icons/check.d.ts +5 -0
- package/types/icons/chevron-down.d.ts +5 -0
- package/types/icons/chevron-left.d.ts +5 -0
- package/types/icons/chevron-right.d.ts +5 -0
- package/types/icons/chevron-up-down.d.ts +5 -0
- package/types/icons/chevron-up.d.ts +5 -0
- package/types/icons/clock.d.ts +5 -0
- package/types/icons/code-bracket.d.ts +5 -0
- package/types/icons/cog.d.ts +5 -0
- package/types/icons/copy.d.ts +5 -0
- package/types/icons/document.d.ts +5 -0
- package/types/icons/download.d.ts +5 -0
- package/types/icons/drag.d.ts +5 -0
- package/types/icons/ellipsis.d.ts +5 -0
- package/types/icons/email.d.ts +5 -0
- package/types/icons/external.d.ts +5 -0
- package/types/icons/filter.d.ts +5 -0
- package/types/icons/flag.d.ts +5 -0
- package/types/icons/google.d.ts +5 -0
- package/types/icons/home.d.ts +5 -0
- package/types/icons/image.d.ts +5 -0
- package/types/icons/italic.d.ts +5 -0
- package/types/icons/link.d.ts +5 -0
- package/types/icons/loader.d.ts +5 -0
- package/types/icons/lock.d.ts +5 -0
- package/types/icons/logo-mark.d.ts +5 -0
- package/types/icons/logo-tagline.d.ts +5 -0
- package/types/icons/map-pin.d.ts +5 -0
- package/types/icons/menu.d.ts +5 -0
- package/types/icons/minus.d.ts +5 -0
- package/types/icons/muted.d.ts +5 -0
- package/types/icons/pause.d.ts +5 -0
- package/types/icons/pencil.d.ts +5 -0
- package/types/icons/play.d.ts +5 -0
- package/types/icons/plus.d.ts +5 -0
- package/types/icons/powered-by.d.ts +5 -0
- package/types/icons/qr-code.d.ts +5 -0
- package/types/icons/queue.d.ts +5 -0
- package/types/icons/refresh.d.ts +5 -0
- package/types/icons/refund.d.ts +5 -0
- package/types/icons/rocket.d.ts +5 -0
- package/types/icons/search.d.ts +5 -0
- package/types/icons/share.d.ts +5 -0
- package/types/icons/shop.d.ts +5 -0
- package/types/icons/sparkles.d.ts +5 -0
- package/types/icons/star.d.ts +5 -0
- package/types/icons/switch.d.ts +5 -0
- package/types/icons/times.d.ts +5 -0
- package/types/icons/trash.d.ts +5 -0
- package/types/icons/underline.d.ts +5 -0
- package/types/icons/upload.d.ts +5 -0
- package/types/icons/volume.d.ts +5 -0
- package/types/icons/warning.d.ts +5 -0
- package/types/input-checkbox.d.ts +14 -0
- package/types/input-group.d.ts +15 -0
- package/types/input-number.d.ts +17 -0
- package/types/input-select.d.ts +19 -0
- package/types/input-text.d.ts +12 -0
- package/types/input-textarea.d.ts +13 -0
- package/types/product.d.ts +21 -0
- package/types/provider-font.d.ts +23 -0
- package/types/styles.d.ts +37 -0
- package/types/video.d.ts +22 -0
- package/types/wrapper-gradient.d.ts +17 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chevron_down_default
|
|
3
|
+
} from "./chunk-FYA7EAMR.mjs";
|
|
4
|
+
import {
|
|
5
|
+
inputStyle
|
|
6
|
+
} from "./chunk-FJXG3REN.mjs";
|
|
7
|
+
|
|
8
|
+
// components/input-select.js
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var InputSelect = ({
|
|
12
|
+
onChange,
|
|
13
|
+
options = [],
|
|
14
|
+
style,
|
|
15
|
+
value,
|
|
16
|
+
...rest
|
|
17
|
+
}) => {
|
|
18
|
+
const [keyboard, setKeyboard] = useState(false);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const down = (e) => {
|
|
21
|
+
if (e.key === "Tab") setKeyboard(true);
|
|
22
|
+
};
|
|
23
|
+
const click = () => setKeyboard(false);
|
|
24
|
+
window.addEventListener("keydown", down);
|
|
25
|
+
window.addEventListener("mousedown", click);
|
|
26
|
+
return () => {
|
|
27
|
+
window.removeEventListener("keydown", down);
|
|
28
|
+
window.removeEventListener("mousedown", click);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
...{
|
|
35
|
+
className: "relative"
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(
|
|
39
|
+
"select",
|
|
40
|
+
{
|
|
41
|
+
...{
|
|
42
|
+
...rest,
|
|
43
|
+
className: "input appearance-none " + (keyboard ? "focus-visible:!outline-1 focus-visible:!ring-1 focus-visible:!ring-blue-600" : "focus-visible:!outline-0 focus-visible:!ring-0"),
|
|
44
|
+
onChange: ({ target }) => onChange(target == null ? void 0 : target.value),
|
|
45
|
+
style: inputStyle(style),
|
|
46
|
+
value
|
|
47
|
+
},
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
"option",
|
|
51
|
+
{
|
|
52
|
+
...{
|
|
53
|
+
disabled: true,
|
|
54
|
+
"aria-label": "Select option",
|
|
55
|
+
value: ""
|
|
56
|
+
},
|
|
57
|
+
children: "Select"
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
options.map(({ label, option, value: optValue }, key) => /* @__PURE__ */ jsx(
|
|
61
|
+
"option",
|
|
62
|
+
{
|
|
63
|
+
...{
|
|
64
|
+
value: optValue ?? option
|
|
65
|
+
},
|
|
66
|
+
children: label ?? option
|
|
67
|
+
},
|
|
68
|
+
"input-select-option-" + key
|
|
69
|
+
))
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
...{
|
|
77
|
+
"aria-hidden": true,
|
|
78
|
+
className: "h-full flex items-center absolute inset-y-0 right-0 pointer-events-none px-2.5"
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ jsx(
|
|
81
|
+
chevron_down_default,
|
|
82
|
+
{
|
|
83
|
+
...{
|
|
84
|
+
className: "w-5 h-5 text-inherit"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
var input_select_default = InputSelect;
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
input_select_default
|
|
98
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// components/styles.js
|
|
2
|
+
var backgroundStyle = (style) => {
|
|
3
|
+
var _a, _b, _c, _d;
|
|
4
|
+
return {
|
|
5
|
+
backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
|
|
6
|
+
color: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
var borderStyle = (style) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return {
|
|
12
|
+
borderColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
var buttonStyle = (style) => {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
17
|
+
return {
|
|
18
|
+
backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || ((_e = (_d = style == null ? void 0 : style.text) == null ? void 0 : _d.color) == null ? void 0 : _e.rgb),
|
|
19
|
+
borderColor: ((_h = (_g = (_f = style == null ? void 0 : style.button) == null ? void 0 : _f.background) == null ? void 0 : _g.color) == null ? void 0 : _h.rgb) || ((_j = (_i = style == null ? void 0 : style.text) == null ? void 0 : _i.color) == null ? void 0 : _j.rgb),
|
|
20
|
+
borderRadius: ((_k = style == null ? void 0 : style.button) == null ? void 0 : _k.radius) != null ? style.button.radius / 4 + "px" : void 0,
|
|
21
|
+
color: ((_n = (_m = (_l = style == null ? void 0 : style.button) == null ? void 0 : _l.text) == null ? void 0 : _m.color) == null ? void 0 : _n.rgb) || ((_p = (_o = style == null ? void 0 : style.background) == null ? void 0 : _o.color) == null ? void 0 : _p.rgb)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
var closeStyle = (style) => {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
return {
|
|
27
|
+
backgroundColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
|
|
28
|
+
color: (_d = (_c = style == null ? void 0 : style.background) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
var headerStyle = (style) => {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
return {
|
|
34
|
+
fontFamily: (_a = style == null ? void 0 : style.heading) == null ? void 0 : _a.family,
|
|
35
|
+
fontWeight: (_b = style == null ? void 0 : style.heading) == null ? void 0 : _b.weight,
|
|
36
|
+
textTransform: (_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.transform
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
var inputStyle = (style) => {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
41
|
+
return {
|
|
42
|
+
backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
|
|
43
|
+
borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
|
|
44
|
+
borderRadius: ((_e = style == null ? void 0 : style.input) == null ? void 0 : _e.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
45
|
+
color: (_g = (_f = style == null ? void 0 : style.text) == null ? void 0 : _f.color) == null ? void 0 : _g.rgb
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
var inputCheckboxStyle = (style) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return {
|
|
51
|
+
...inputStyle(style),
|
|
52
|
+
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? Math.min(style.input.radius / 4, 6) + "px" : void 0
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var inputNameStyle = (style) => inputStyle(style);
|
|
56
|
+
var inputPhoneStyle = (style) => inputStyle(style);
|
|
57
|
+
var menuStyle = (style) => {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f;
|
|
59
|
+
return {
|
|
60
|
+
backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
|
|
61
|
+
borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
|
|
62
|
+
color: (_f = (_e = style == null ? void 0 : style.text) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
var selectStyle = (style) => {
|
|
66
|
+
var _a, _b, _c, _d, _e, _f;
|
|
67
|
+
return {
|
|
68
|
+
borderColor: (_c = (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) == null ? void 0 : _c.replace(")", ", 0.3)"),
|
|
69
|
+
borderRadius: ((_d = style == null ? void 0 : style.input) == null ? void 0 : _d.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
70
|
+
color: (_f = (_e = style == null ? void 0 : style.text) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
var textStyle = (style) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return {
|
|
76
|
+
color: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
backgroundStyle,
|
|
82
|
+
borderStyle,
|
|
83
|
+
buttonStyle,
|
|
84
|
+
closeStyle,
|
|
85
|
+
headerStyle,
|
|
86
|
+
inputStyle,
|
|
87
|
+
inputCheckboxStyle,
|
|
88
|
+
inputNameStyle,
|
|
89
|
+
inputPhoneStyle,
|
|
90
|
+
menuStyle,
|
|
91
|
+
selectStyle,
|
|
92
|
+
textStyle
|
|
93
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// components/icons/chevron-down.js
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var ChevronDown = (props) => /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
...{
|
|
7
|
+
fill: "none",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
...props
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
...{
|
|
17
|
+
d: "m19.5 8.25-7.5 7.5-7.5-7.5",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
var chevron_down_default = ChevronDown;
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
chevron_down_default
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// components/icons/check.js
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var Check = (props) => /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
...{
|
|
7
|
+
fill: "none",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
...props
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
...{
|
|
17
|
+
d: "m4.5 12.75 6 6 9-13.5",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
var check_default = Check;
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
check_default
|
|
29
|
+
};
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loader_default
|
|
3
|
+
} from "./chunk-2ZYGRSSA.mjs";
|
|
4
|
+
import {
|
|
5
|
+
wrapper_gradient_default
|
|
6
|
+
} from "./chunk-XWELEL6Z.mjs";
|
|
7
|
+
import {
|
|
8
|
+
input_group_default
|
|
9
|
+
} from "./chunk-7ZLMDYBR.mjs";
|
|
10
|
+
import {
|
|
11
|
+
input_select_default
|
|
12
|
+
} from "./chunk-BD3TDNJE.mjs";
|
|
13
|
+
import {
|
|
14
|
+
buttonStyle,
|
|
15
|
+
inputStyle
|
|
16
|
+
} from "./chunk-FJXG3REN.mjs";
|
|
17
|
+
|
|
18
|
+
// components/product.js
|
|
19
|
+
import { useEffect, useMemo, useState } from "react";
|
|
20
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
21
|
+
import { cdnShopify } from "@drawbridge/shopify/cdn";
|
|
22
|
+
import { formatCurrency } from "@drawbridge/drawbridge-utils";
|
|
23
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ jsx(
|
|
25
|
+
"img",
|
|
26
|
+
{
|
|
27
|
+
...{
|
|
28
|
+
alt,
|
|
29
|
+
className,
|
|
30
|
+
src
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
var Product = ({
|
|
35
|
+
action = null,
|
|
36
|
+
addToCart = true,
|
|
37
|
+
disabled = false,
|
|
38
|
+
errors = {},
|
|
39
|
+
header,
|
|
40
|
+
ImageComponent = DefaultImage,
|
|
41
|
+
onAdd = () => {
|
|
42
|
+
},
|
|
43
|
+
onBuy = () => {
|
|
44
|
+
},
|
|
45
|
+
onVariantChange = () => {
|
|
46
|
+
},
|
|
47
|
+
product,
|
|
48
|
+
style = {},
|
|
49
|
+
variant
|
|
50
|
+
}) => {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
52
|
+
const available = useMemo(
|
|
53
|
+
() => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
|
|
54
|
+
[product]
|
|
55
|
+
);
|
|
56
|
+
const [activeImage, setActiveImage] = useState(0);
|
|
57
|
+
const [emblaRef, emblaApi] = useEmblaCarousel();
|
|
58
|
+
const selectedVariant = available.find((v) => v.id === variant) || null;
|
|
59
|
+
const images = useMemo(
|
|
60
|
+
() => {
|
|
61
|
+
const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
|
|
62
|
+
const result = [];
|
|
63
|
+
const seen = /* @__PURE__ */ new Set();
|
|
64
|
+
if (product == null ? void 0 : product.image) {
|
|
65
|
+
seen.add(product.image);
|
|
66
|
+
result.push({
|
|
67
|
+
src: product.image,
|
|
68
|
+
variant: null
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
for (const v of variants) {
|
|
72
|
+
if (v.image && !seen.has(v.image)) {
|
|
73
|
+
seen.add(v.image);
|
|
74
|
+
result.push({
|
|
75
|
+
src: v.image,
|
|
76
|
+
variant: v
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
},
|
|
82
|
+
[product]
|
|
83
|
+
);
|
|
84
|
+
useEffect(
|
|
85
|
+
() => {
|
|
86
|
+
if (!emblaApi) return;
|
|
87
|
+
const onSelect = () => {
|
|
88
|
+
const idx = emblaApi.selectedScrollSnap();
|
|
89
|
+
setActiveImage(idx);
|
|
90
|
+
const img = images[idx];
|
|
91
|
+
if (img == null ? void 0 : img.variant) onVariantChange(img.variant.id);
|
|
92
|
+
};
|
|
93
|
+
emblaApi.on("select", onSelect);
|
|
94
|
+
return () => emblaApi.off("select", onSelect);
|
|
95
|
+
},
|
|
96
|
+
[emblaApi, images, onVariantChange]
|
|
97
|
+
);
|
|
98
|
+
const handleVariant = (value) => {
|
|
99
|
+
onVariantChange(value);
|
|
100
|
+
const v = available.find((x) => x.id === value);
|
|
101
|
+
if (!(v == null ? void 0 : v.image)) return;
|
|
102
|
+
const idx = images.findIndex((img) => img.src === v.image);
|
|
103
|
+
if (idx >= 0) {
|
|
104
|
+
setActiveImage(idx);
|
|
105
|
+
emblaApi == null ? void 0 : emblaApi.scrollTo(idx);
|
|
106
|
+
}
|
|
107
|
+
;
|
|
108
|
+
};
|
|
109
|
+
return /* @__PURE__ */ jsxs(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
...{
|
|
113
|
+
className: "space-y-6 pb-12"
|
|
114
|
+
},
|
|
115
|
+
children: [
|
|
116
|
+
header,
|
|
117
|
+
images.length > 0 && /* @__PURE__ */ jsxs(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
...{
|
|
121
|
+
className: "flex items-center h-48 " + (images.length > 1 && "pr-12")
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
images.length > 1 && /* @__PURE__ */ jsx(
|
|
125
|
+
wrapper_gradient_default,
|
|
126
|
+
{
|
|
127
|
+
...{
|
|
128
|
+
classNameScroll: "flex flex-col w-12 h-48 space-y-3",
|
|
129
|
+
color: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb
|
|
130
|
+
},
|
|
131
|
+
children: images.map(({ src }, key) => /* @__PURE__ */ jsx(
|
|
132
|
+
"button",
|
|
133
|
+
{
|
|
134
|
+
...{
|
|
135
|
+
className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border border-transparent",
|
|
136
|
+
onClick: () => {
|
|
137
|
+
setActiveImage(key);
|
|
138
|
+
emblaApi == null ? void 0 : emblaApi.scrollTo(key);
|
|
139
|
+
},
|
|
140
|
+
type: "button",
|
|
141
|
+
...activeImage === key && {
|
|
142
|
+
style: inputStyle(style)
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
children: /* @__PURE__ */ jsx(
|
|
146
|
+
ImageComponent,
|
|
147
|
+
{
|
|
148
|
+
...{
|
|
149
|
+
alt: product.title + " thumbnail " + key,
|
|
150
|
+
className: "object-cover",
|
|
151
|
+
fill: true,
|
|
152
|
+
sizes: "48px",
|
|
153
|
+
src: cdnShopify(src, "100x100", product == null ? void 0 : product.updatedAt) || src,
|
|
154
|
+
unoptimized: true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
},
|
|
159
|
+
"thumbnail-" + key
|
|
160
|
+
))
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
...{
|
|
167
|
+
className: "aspect-square w-48 overflow-hidden rounded-3xl m-auto",
|
|
168
|
+
ref: emblaRef
|
|
169
|
+
},
|
|
170
|
+
children: /* @__PURE__ */ jsx(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
...{
|
|
174
|
+
className: "flex h-full"
|
|
175
|
+
},
|
|
176
|
+
children: images.map(({ src }, key) => /* @__PURE__ */ jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
...{
|
|
180
|
+
className: "min-w-0 flex-[0_0_100%] relative h-full bg-gray-100"
|
|
181
|
+
},
|
|
182
|
+
children: /* @__PURE__ */ jsx(
|
|
183
|
+
ImageComponent,
|
|
184
|
+
{
|
|
185
|
+
...{
|
|
186
|
+
alt: product.title + " image " + key,
|
|
187
|
+
className: "object-cover",
|
|
188
|
+
fill: true,
|
|
189
|
+
sizes: "192px",
|
|
190
|
+
src: cdnShopify(src, "400x400", product == null ? void 0 : product.updatedAt) || src,
|
|
191
|
+
unoptimized: true
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
},
|
|
196
|
+
"image-" + key
|
|
197
|
+
))
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsxs(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
...{
|
|
209
|
+
className: "text-center space-y-2"
|
|
210
|
+
},
|
|
211
|
+
children: [
|
|
212
|
+
(product == null ? void 0 : product.title) && /* @__PURE__ */ jsx(
|
|
213
|
+
"h2",
|
|
214
|
+
{
|
|
215
|
+
...{
|
|
216
|
+
className: "max-w-80 mx-auto",
|
|
217
|
+
style: {
|
|
218
|
+
fontFamily: ((_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.family) || (style == null ? void 0 : style.fontFamily) || "Roboto Flex",
|
|
219
|
+
fontWeight: ((_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.weight) || (style == null ? void 0 : style.fontWeight),
|
|
220
|
+
textTransform: ((_e = style == null ? void 0 : style.heading) == null ? void 0 : _e.transform) || (style == null ? void 0 : style.textTransform)
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
children: product == null ? void 0 : product.title
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
!available.length ? /* @__PURE__ */ jsx("p", { children: "Unavailable" }) : (selectedVariant == null ? void 0 : selectedVariant.price) && /* @__PURE__ */ jsx("p", { children: formatCurrency({
|
|
227
|
+
code: selectedVariant.currency,
|
|
228
|
+
display: "parts",
|
|
229
|
+
value: selectedVariant.price
|
|
230
|
+
}) }),
|
|
231
|
+
(product == null ? void 0 : product.description) && /* @__PURE__ */ jsx(
|
|
232
|
+
wrapper_gradient_default,
|
|
233
|
+
{
|
|
234
|
+
...{
|
|
235
|
+
classNameScroll: "max-h-[4.5em]",
|
|
236
|
+
color: (_g = (_f = style == null ? void 0 : style.background) == null ? void 0 : _f.color) == null ? void 0 : _g.rgb
|
|
237
|
+
},
|
|
238
|
+
children: /* @__PURE__ */ jsx("p", { children: product.description })
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
available.length > 1 && /* @__PURE__ */ jsx(
|
|
245
|
+
input_group_default,
|
|
246
|
+
{
|
|
247
|
+
...{
|
|
248
|
+
error: errors == null ? void 0 : errors.variant,
|
|
249
|
+
input: /* @__PURE__ */ jsx(
|
|
250
|
+
input_select_default,
|
|
251
|
+
{
|
|
252
|
+
...{
|
|
253
|
+
disabled,
|
|
254
|
+
onChange: handleVariant,
|
|
255
|
+
options: available.map((v) => ({
|
|
256
|
+
label: v.title,
|
|
257
|
+
value: v.id
|
|
258
|
+
})),
|
|
259
|
+
style,
|
|
260
|
+
value: variant || ""
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
style
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
available.length > 0 && /* @__PURE__ */ jsx(
|
|
269
|
+
input_group_default,
|
|
270
|
+
{
|
|
271
|
+
...{
|
|
272
|
+
error: errors == null ? void 0 : errors.root,
|
|
273
|
+
input: /* @__PURE__ */ jsxs(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
...{
|
|
277
|
+
className: addToCart ? "grid grid-cols-2 gap-3" : ""
|
|
278
|
+
},
|
|
279
|
+
children: [
|
|
280
|
+
addToCart && /* @__PURE__ */ jsx(
|
|
281
|
+
"button",
|
|
282
|
+
{
|
|
283
|
+
...{
|
|
284
|
+
className: "button justify-center border",
|
|
285
|
+
disabled: disabled || Boolean(action),
|
|
286
|
+
onClick: onAdd,
|
|
287
|
+
style: inputStyle(style),
|
|
288
|
+
type: "button"
|
|
289
|
+
},
|
|
290
|
+
children: action === "add" ? /* @__PURE__ */ jsx(
|
|
291
|
+
loader_default,
|
|
292
|
+
{
|
|
293
|
+
...{
|
|
294
|
+
className: "w-6 h-6 animate-spin"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
) : "Add to cart"
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
"button",
|
|
302
|
+
{
|
|
303
|
+
...{
|
|
304
|
+
className: "button justify-center" + (addToCart ? "" : " w-full"),
|
|
305
|
+
disabled: disabled || Boolean(action),
|
|
306
|
+
onClick: onBuy,
|
|
307
|
+
style: buttonStyle(style),
|
|
308
|
+
type: "button"
|
|
309
|
+
},
|
|
310
|
+
children: action === "buy" ? /* @__PURE__ */ jsx(
|
|
311
|
+
loader_default,
|
|
312
|
+
{
|
|
313
|
+
...{
|
|
314
|
+
className: "w-6 h-6 animate-spin"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
) : "Buy now"
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
),
|
|
323
|
+
style
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
};
|
|
331
|
+
var product_default = Product;
|
|
332
|
+
|
|
333
|
+
export {
|
|
334
|
+
product_default
|
|
335
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// components/icons/plus.js
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var Plus = (props) => /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
...{
|
|
7
|
+
fill: "none",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
...props
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
...{
|
|
17
|
+
d: "M12 4.5v15m7.5-7.5h-15",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
var plus_default = Plus;
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
plus_default
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// components/icons/warning.js
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var Warning = (props) => /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
...{
|
|
7
|
+
fill: "none",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
...props
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
...{
|
|
17
|
+
d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
var warning_default = Warning;
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
warning_default
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// components/icons/minus.js
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var Minus = (props) => /* @__PURE__ */ jsx(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
...{
|
|
7
|
+
fill: "none",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
strokeWidth: 1.5,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
...props
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
...{
|
|
17
|
+
d: "M5 12h14",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
var minus_default = Minus;
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
minus_default
|
|
29
|
+
};
|