@drawbridge/components 0.0.39 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/dist/advertisement.js +1299 -0
  2. package/dist/advertisement.mjs +95 -0
  3. package/dist/card-advertisement.mjs +3 -354
  4. package/dist/chunk-2ZYGRSSA.mjs +45 -0
  5. package/dist/chunk-7ZLMDYBR.mjs +113 -0
  6. package/dist/chunk-BD3TDNJE.mjs +98 -0
  7. package/dist/chunk-FJXG3REN.mjs +93 -0
  8. package/dist/chunk-FYA7EAMR.mjs +29 -0
  9. package/dist/chunk-GFDZ7ER6.mjs +29 -0
  10. package/dist/chunk-HDOA3Y3U.mjs +334 -0
  11. package/dist/chunk-HH7WF5BT.mjs +29 -0
  12. package/dist/chunk-Q3UIVGPQ.mjs +29 -0
  13. package/dist/chunk-T5QQBFM3.mjs +29 -0
  14. package/dist/chunk-TJNIR4PF.mjs +358 -0
  15. package/dist/chunk-XWELEL6Z.mjs +208 -0
  16. package/dist/embla.js +41 -0
  17. package/dist/embla.mjs +6 -0
  18. package/dist/icons/arrow-down-tray.js +48 -0
  19. package/dist/icons/arrow-down-tray.mjs +28 -0
  20. package/dist/icons/arrow-left.js +48 -0
  21. package/dist/icons/arrow-left.mjs +28 -0
  22. package/dist/icons/arrow-right.js +48 -0
  23. package/dist/icons/arrow-right.mjs +28 -0
  24. package/dist/icons/arrow-up-tray.js +48 -0
  25. package/dist/icons/arrow-up-tray.mjs +28 -0
  26. package/dist/icons/bars-arrow-down.js +48 -0
  27. package/dist/icons/bars-arrow-down.mjs +28 -0
  28. package/dist/icons/bars-arrow-up.js +48 -0
  29. package/dist/icons/bars-arrow-up.mjs +28 -0
  30. package/dist/icons/bold.js +47 -0
  31. package/dist/icons/bold.mjs +27 -0
  32. package/dist/icons/bolt.js +48 -0
  33. package/dist/icons/bolt.mjs +28 -0
  34. package/dist/icons/calendar.js +48 -0
  35. package/dist/icons/calendar.mjs +28 -0
  36. package/dist/icons/cancel.js +48 -0
  37. package/dist/icons/cancel.mjs +28 -0
  38. package/dist/icons/card.js +48 -0
  39. package/dist/icons/card.mjs +28 -0
  40. package/dist/icons/chart.js +48 -0
  41. package/dist/icons/chart.mjs +28 -0
  42. package/dist/icons/check.js +48 -0
  43. package/dist/icons/check.mjs +6 -0
  44. package/dist/icons/chevron-down.js +48 -0
  45. package/dist/icons/chevron-down.mjs +6 -0
  46. package/dist/icons/chevron-left.js +48 -0
  47. package/dist/icons/chevron-left.mjs +28 -0
  48. package/dist/icons/chevron-right.js +48 -0
  49. package/dist/icons/chevron-right.mjs +28 -0
  50. package/dist/icons/chevron-up-down.js +48 -0
  51. package/dist/icons/chevron-up-down.mjs +28 -0
  52. package/dist/icons/chevron-up.js +48 -0
  53. package/dist/icons/chevron-up.mjs +28 -0
  54. package/dist/icons/clock.js +48 -0
  55. package/dist/icons/clock.mjs +28 -0
  56. package/dist/icons/code-bracket.js +48 -0
  57. package/dist/icons/code-bracket.mjs +28 -0
  58. package/dist/icons/cog.js +60 -0
  59. package/dist/icons/cog.mjs +40 -0
  60. package/dist/icons/copy.js +48 -0
  61. package/dist/icons/copy.mjs +28 -0
  62. package/dist/icons/document.js +48 -0
  63. package/dist/icons/document.mjs +28 -0
  64. package/dist/icons/download.js +48 -0
  65. package/dist/icons/download.mjs +28 -0
  66. package/dist/icons/drag.js +51 -0
  67. package/dist/icons/drag.mjs +31 -0
  68. package/dist/icons/ellipsis.js +48 -0
  69. package/dist/icons/ellipsis.mjs +28 -0
  70. package/dist/icons/email.js +48 -0
  71. package/dist/icons/email.mjs +28 -0
  72. package/dist/icons/external.js +48 -0
  73. package/dist/icons/external.mjs +28 -0
  74. package/dist/icons/filter.js +48 -0
  75. package/dist/icons/filter.mjs +28 -0
  76. package/dist/icons/flag.js +48 -0
  77. package/dist/icons/flag.mjs +28 -0
  78. package/dist/icons/google.js +74 -0
  79. package/dist/icons/google.mjs +54 -0
  80. package/dist/icons/home.js +48 -0
  81. package/dist/icons/home.mjs +28 -0
  82. package/dist/icons/image.js +48 -0
  83. package/dist/icons/image.mjs +28 -0
  84. package/dist/icons/italic.js +48 -0
  85. package/dist/icons/italic.mjs +28 -0
  86. package/dist/icons/link.js +48 -0
  87. package/dist/icons/link.mjs +28 -0
  88. package/dist/icons/loader.js +64 -0
  89. package/dist/icons/loader.mjs +6 -0
  90. package/dist/icons/lock.js +48 -0
  91. package/dist/icons/lock.mjs +28 -0
  92. package/dist/icons/logo-mark.js +55 -0
  93. package/dist/icons/logo-mark.mjs +35 -0
  94. package/dist/icons/logo-tagline.js +137 -0
  95. package/dist/icons/logo-tagline.mjs +117 -0
  96. package/dist/icons/map-pin.js +60 -0
  97. package/dist/icons/map-pin.mjs +40 -0
  98. package/dist/icons/menu.js +48 -0
  99. package/dist/icons/menu.mjs +28 -0
  100. package/dist/icons/minus.js +48 -0
  101. package/dist/icons/minus.mjs +6 -0
  102. package/dist/icons/muted.js +48 -0
  103. package/dist/icons/muted.mjs +28 -0
  104. package/dist/icons/pause.js +48 -0
  105. package/dist/icons/pause.mjs +28 -0
  106. package/dist/icons/pencil.js +48 -0
  107. package/dist/icons/pencil.mjs +28 -0
  108. package/dist/icons/play.js +48 -0
  109. package/dist/icons/play.mjs +28 -0
  110. package/dist/icons/plus.js +48 -0
  111. package/dist/icons/plus.mjs +6 -0
  112. package/dist/icons/powered-by.js +45 -0
  113. package/dist/icons/powered-by.mjs +25 -0
  114. package/dist/icons/qr-code.js +60 -0
  115. package/dist/icons/qr-code.mjs +40 -0
  116. package/dist/icons/queue.js +48 -0
  117. package/dist/icons/queue.mjs +28 -0
  118. package/dist/icons/refresh.js +48 -0
  119. package/dist/icons/refresh.mjs +28 -0
  120. package/dist/icons/refund.js +48 -0
  121. package/dist/icons/refund.mjs +28 -0
  122. package/dist/icons/rocket.js +48 -0
  123. package/dist/icons/rocket.mjs +28 -0
  124. package/dist/icons/search.js +48 -0
  125. package/dist/icons/search.mjs +28 -0
  126. package/dist/icons/share.js +48 -0
  127. package/dist/icons/share.mjs +28 -0
  128. package/dist/icons/shop.js +46 -0
  129. package/dist/icons/shop.mjs +26 -0
  130. package/dist/icons/sparkles.js +48 -0
  131. package/dist/icons/sparkles.mjs +28 -0
  132. package/dist/icons/star.js +48 -0
  133. package/dist/icons/star.mjs +28 -0
  134. package/dist/icons/switch.js +48 -0
  135. package/dist/icons/switch.mjs +28 -0
  136. package/dist/icons/times.js +48 -0
  137. package/dist/icons/times.mjs +28 -0
  138. package/dist/icons/trash.js +48 -0
  139. package/dist/icons/trash.mjs +28 -0
  140. package/dist/icons/underline.js +48 -0
  141. package/dist/icons/underline.mjs +28 -0
  142. package/dist/icons/upload.js +48 -0
  143. package/dist/icons/upload.mjs +28 -0
  144. package/dist/icons/volume.js +48 -0
  145. package/dist/icons/volume.mjs +28 -0
  146. package/dist/icons/warning.js +48 -0
  147. package/dist/icons/warning.mjs +6 -0
  148. package/dist/input-checkbox.js +130 -0
  149. package/dist/input-checkbox.mjs +71 -0
  150. package/dist/input-group.js +156 -0
  151. package/dist/input-group.mjs +7 -0
  152. package/dist/input-number.js +211 -0
  153. package/dist/input-number.mjs +136 -0
  154. package/dist/input-select.js +150 -0
  155. package/dist/input-select.mjs +9 -0
  156. package/dist/input-text.js +65 -0
  157. package/dist/input-text.mjs +36 -0
  158. package/dist/input-textarea.js +69 -0
  159. package/dist/input-textarea.mjs +40 -0
  160. package/dist/product.js +864 -0
  161. package/dist/product.mjs +14 -0
  162. package/dist/styles.js +127 -0
  163. package/dist/styles.mjs +28 -0
  164. package/dist/video.js +177 -0
  165. package/dist/video.mjs +107 -0
  166. package/dist/wrapper-gradient.js +232 -0
  167. package/dist/wrapper-gradient.mjs +9 -0
  168. package/package.json +312 -2
  169. package/types/advertisement.d.ts +35 -0
  170. package/types/embla.d.ts +2 -0
  171. package/types/icons/arrow-down-tray.d.ts +5 -0
  172. package/types/icons/arrow-left.d.ts +5 -0
  173. package/types/icons/arrow-right.d.ts +5 -0
  174. package/types/icons/arrow-up-tray.d.ts +5 -0
  175. package/types/icons/bars-arrow-down.d.ts +5 -0
  176. package/types/icons/bars-arrow-up.d.ts +5 -0
  177. package/types/icons/bold.d.ts +5 -0
  178. package/types/icons/bolt.d.ts +5 -0
  179. package/types/icons/calendar.d.ts +5 -0
  180. package/types/icons/cancel.d.ts +5 -0
  181. package/types/icons/card.d.ts +5 -0
  182. package/types/icons/chart.d.ts +5 -0
  183. package/types/icons/check.d.ts +5 -0
  184. package/types/icons/chevron-down.d.ts +5 -0
  185. package/types/icons/chevron-left.d.ts +5 -0
  186. package/types/icons/chevron-right.d.ts +5 -0
  187. package/types/icons/chevron-up-down.d.ts +5 -0
  188. package/types/icons/chevron-up.d.ts +5 -0
  189. package/types/icons/clock.d.ts +5 -0
  190. package/types/icons/code-bracket.d.ts +5 -0
  191. package/types/icons/cog.d.ts +5 -0
  192. package/types/icons/copy.d.ts +5 -0
  193. package/types/icons/document.d.ts +5 -0
  194. package/types/icons/download.d.ts +5 -0
  195. package/types/icons/drag.d.ts +5 -0
  196. package/types/icons/ellipsis.d.ts +5 -0
  197. package/types/icons/email.d.ts +5 -0
  198. package/types/icons/external.d.ts +5 -0
  199. package/types/icons/filter.d.ts +5 -0
  200. package/types/icons/flag.d.ts +5 -0
  201. package/types/icons/google.d.ts +5 -0
  202. package/types/icons/home.d.ts +5 -0
  203. package/types/icons/image.d.ts +5 -0
  204. package/types/icons/italic.d.ts +5 -0
  205. package/types/icons/link.d.ts +5 -0
  206. package/types/icons/loader.d.ts +5 -0
  207. package/types/icons/lock.d.ts +5 -0
  208. package/types/icons/logo-mark.d.ts +5 -0
  209. package/types/icons/logo-tagline.d.ts +5 -0
  210. package/types/icons/map-pin.d.ts +5 -0
  211. package/types/icons/menu.d.ts +5 -0
  212. package/types/icons/minus.d.ts +5 -0
  213. package/types/icons/muted.d.ts +5 -0
  214. package/types/icons/pause.d.ts +5 -0
  215. package/types/icons/pencil.d.ts +5 -0
  216. package/types/icons/play.d.ts +5 -0
  217. package/types/icons/plus.d.ts +5 -0
  218. package/types/icons/powered-by.d.ts +5 -0
  219. package/types/icons/qr-code.d.ts +5 -0
  220. package/types/icons/queue.d.ts +5 -0
  221. package/types/icons/refresh.d.ts +5 -0
  222. package/types/icons/refund.d.ts +5 -0
  223. package/types/icons/rocket.d.ts +5 -0
  224. package/types/icons/search.d.ts +5 -0
  225. package/types/icons/share.d.ts +5 -0
  226. package/types/icons/shop.d.ts +5 -0
  227. package/types/icons/sparkles.d.ts +5 -0
  228. package/types/icons/star.d.ts +5 -0
  229. package/types/icons/switch.d.ts +5 -0
  230. package/types/icons/times.d.ts +5 -0
  231. package/types/icons/trash.d.ts +5 -0
  232. package/types/icons/underline.d.ts +5 -0
  233. package/types/icons/upload.d.ts +5 -0
  234. package/types/icons/volume.d.ts +5 -0
  235. package/types/icons/warning.d.ts +5 -0
  236. package/types/input-checkbox.d.ts +14 -0
  237. package/types/input-group.d.ts +15 -0
  238. package/types/input-number.d.ts +17 -0
  239. package/types/input-select.d.ts +19 -0
  240. package/types/input-text.d.ts +12 -0
  241. package/types/input-textarea.d.ts +13 -0
  242. package/types/product.d.ts +20 -0
  243. package/types/styles.d.ts +37 -0
  244. package/types/video.d.ts +20 -0
  245. package/types/wrapper-gradient.d.ts +17 -0
@@ -0,0 +1,358 @@
1
+ // components/card-advertisement.js
2
+ import { useEffect, useState } from "react";
3
+ import { cdnShopify } from "@drawbridge/shopify/cdn";
4
+ import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
5
+ import { formatCurrency } from "@drawbridge/drawbridge-utils";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ jsx(
8
+ "img",
9
+ {
10
+ ...{
11
+ alt,
12
+ className,
13
+ src
14
+ }
15
+ }
16
+ );
17
+ var DefaultVideo = ({ className, hls, mp4, poster }) => /* @__PURE__ */ jsx(
18
+ "video",
19
+ {
20
+ ...{
21
+ className,
22
+ poster,
23
+ src: mp4 || hls
24
+ }
25
+ }
26
+ );
27
+ var CardAdvertisement = ({
28
+ advertisement,
29
+ affiliate,
30
+ asset,
31
+ brand = {},
32
+ button,
33
+ campaign,
34
+ fonts,
35
+ ImageComponent = DefaultImage,
36
+ lead,
37
+ onClick = () => {
38
+ },
39
+ onVariantSelect = () => {
40
+ },
41
+ organization,
42
+ page,
43
+ preview = false,
44
+ product,
45
+ title,
46
+ url,
47
+ VideoComponent = DefaultVideo
48
+ }) => {
49
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
50
+ const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
51
+ const hasVariants = variants.length > 0;
52
+ const [selectedVariant, setSelectedVariant] = useState(variants[0] || null);
53
+ const [keyboard, setKeyboard] = useState(false);
54
+ useEffect(() => {
55
+ const down = (e) => {
56
+ if (e.key === "Tab") setKeyboard(true);
57
+ };
58
+ const click = () => setKeyboard(false);
59
+ window.addEventListener("keydown", down);
60
+ window.addEventListener("mousedown", click);
61
+ return () => {
62
+ window.removeEventListener("keydown", down);
63
+ window.removeEventListener("mousedown", click);
64
+ };
65
+ }, []);
66
+ const style = {
67
+ background: {
68
+ color: ((_a = brand == null ? void 0 : brand.style) == null ? void 0 : _a.background) ? (_b = brand.style.background) == null ? void 0 : _b.color : {
69
+ hex: "#FFFFFF",
70
+ rgb: "rgb( 255, 255, 255 )"
71
+ }
72
+ },
73
+ text: {
74
+ color: ((_c = brand == null ? void 0 : brand.style) == null ? void 0 : _c.text) ? (_d = brand.style.text) == null ? void 0 : _d.color : {
75
+ hex: "#000000",
76
+ rgb: "rgb( 0, 0, 0 )"
77
+ }
78
+ }
79
+ };
80
+ const classes = {
81
+ asset: [
82
+ "block relative aspect-square rounded overflow-hidden"
83
+ ],
84
+ button: [
85
+ "card-advertisement-button",
86
+ "flex items-center justify-center py-3 px-4 w-full border"
87
+ ],
88
+ container: [
89
+ "card-advertisement",
90
+ "block w-full space-y-2 border border-gray rounded p-6"
91
+ ],
92
+ content: [
93
+ "flex flex-col items-center justify-between gap-x-4 text-center text-sm rounded"
94
+ ]
95
+ };
96
+ const productImage = (selectedVariant == null ? void 0 : selectedVariant.image) || (product == null ? void 0 : product.image) || null;
97
+ const productImageSrc = cdnShopify(productImage, "400x400", product == null ? void 0 : product.updatedAt);
98
+ if (!(asset == null ? void 0 : asset.sizes) && !productImageSrc) {
99
+ classes.asset.push("bg-gray-light");
100
+ }
101
+ ;
102
+ return /* @__PURE__ */ jsxs(
103
+ "div",
104
+ {
105
+ ...{
106
+ className: classes.container.join(" "),
107
+ style: {
108
+ backgroundColor: (_f = (_e = style == null ? void 0 : style.background) == null ? void 0 : _e.color) == null ? void 0 : _f.hex,
109
+ color: (_h = (_g = style == null ? void 0 : style.text) == null ? void 0 : _g.color) == null ? void 0 : _h.hex
110
+ }
111
+ },
112
+ children: [
113
+ /* @__PURE__ */ jsxs(
114
+ "span",
115
+ {
116
+ ...{
117
+ className: classes.asset.join(" ")
118
+ },
119
+ children: [
120
+ (asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("image") && /* @__PURE__ */ jsx(
121
+ ImageComponent,
122
+ {
123
+ ...{
124
+ alt: asset == null ? void 0 : asset.filename,
125
+ className: "w-full h-full object-cover",
126
+ fill: true,
127
+ priority: false,
128
+ sizes: "100%",
129
+ src: cdnSrc(asset, "400x400", asset == null ? void 0 : asset.updatedAt)
130
+ }
131
+ },
132
+ asset == null ? void 0 : asset.id
133
+ ),
134
+ !(asset == null ? void 0 : asset.sizes) && productImageSrc && /* @__PURE__ */ jsx(
135
+ ImageComponent,
136
+ {
137
+ ...{
138
+ alt: (product == null ? void 0 : product.title) || "Product",
139
+ className: "w-full h-full object-cover",
140
+ fill: true,
141
+ priority: false,
142
+ sizes: "100%",
143
+ src: productImageSrc,
144
+ unoptimized: true
145
+ }
146
+ },
147
+ productImageSrc
148
+ ),
149
+ (asset == null ? void 0 : asset.sizes) && asset.mimetype.includes("video") && /* @__PURE__ */ jsx(
150
+ "div",
151
+ {
152
+ ...{
153
+ className: "relative h-full w-full aspect-[9/16]"
154
+ },
155
+ children: /* @__PURE__ */ jsx(
156
+ VideoComponent,
157
+ {
158
+ ...{
159
+ className: "w-full h-full",
160
+ hls: cdnSrc(asset, "hls", asset == null ? void 0 : asset.updatedAt),
161
+ mp4: cdnSrc(asset, "original", asset == null ? void 0 : asset.updatedAt),
162
+ poster: cdnSrc((_i = asset == null ? void 0 : asset.frames) == null ? void 0 : _i[asset == null ? void 0 : asset.poster], "500x500", asset == null ? void 0 : asset.updatedAt) || cdnSrc((_j = asset == null ? void 0 : asset.frames) == null ? void 0 : _j[asset == null ? void 0 : asset.poster], "1080x1920", asset == null ? void 0 : asset.updatedAt)
163
+ }
164
+ }
165
+ )
166
+ }
167
+ )
168
+ ]
169
+ }
170
+ ),
171
+ /* @__PURE__ */ jsxs(
172
+ "span",
173
+ {
174
+ ...{
175
+ className: classes.content.join(" "),
176
+ style: {
177
+ ...fonts == null ? void 0 : fonts.body,
178
+ color: (_l = (_k = style == null ? void 0 : style.text) == null ? void 0 : _k.color) == null ? void 0 : _l.hex,
179
+ gap: "10px",
180
+ marginTop: "10px"
181
+ }
182
+ },
183
+ children: [
184
+ /* @__PURE__ */ jsxs(
185
+ "div",
186
+ {
187
+ ...{
188
+ className: "flex-1 min-w-0 space-y-2"
189
+ },
190
+ children: [
191
+ title && /* @__PURE__ */ jsx(
192
+ "p",
193
+ {
194
+ ...{
195
+ style: {
196
+ fontSize: "18px"
197
+ }
198
+ },
199
+ children: title
200
+ }
201
+ ),
202
+ (selectedVariant == null ? void 0 : selectedVariant.price) && (selectedVariant == null ? void 0 : selectedVariant.currency) && /* @__PURE__ */ jsxs(
203
+ "p",
204
+ {
205
+ ...{
206
+ style: {
207
+ fontSize: "14px",
208
+ marginBottom: "10px"
209
+ }
210
+ },
211
+ children: [
212
+ (selectedVariant == null ? void 0 : selectedVariant.sale) && selectedVariant.sale > selectedVariant.price && /* @__PURE__ */ jsx(
213
+ "span",
214
+ {
215
+ ...{
216
+ style: {
217
+ marginRight: "6px",
218
+ opacity: 0.5,
219
+ textDecoration: "line-through"
220
+ }
221
+ },
222
+ children: formatCurrency({
223
+ code: selectedVariant.currency,
224
+ display: "parts",
225
+ value: selectedVariant.sale
226
+ })
227
+ }
228
+ ),
229
+ formatCurrency({
230
+ code: selectedVariant.currency,
231
+ display: "parts",
232
+ value: selectedVariant.price
233
+ })
234
+ ]
235
+ }
236
+ ),
237
+ variants.length > 1 && /* @__PURE__ */ jsxs(
238
+ "div",
239
+ {
240
+ ...{
241
+ className: "relative w-full"
242
+ },
243
+ children: [
244
+ /* @__PURE__ */ jsx(
245
+ "select",
246
+ {
247
+ ...{
248
+ 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"),
249
+ onChange: (e) => {
250
+ const variant = variants.find((v) => v.id === e.target.value);
251
+ if (variant) setSelectedVariant(variant);
252
+ },
253
+ style: {
254
+ appearance: "none",
255
+ backgroundColor: (_n = (_m = style == null ? void 0 : style.background) == null ? void 0 : _m.color) == null ? void 0 : _n.rgb,
256
+ backgroundImage: "none",
257
+ borderColor: (_p = (_o = style == null ? void 0 : style.text) == null ? void 0 : _o.color) == null ? void 0 : _p.rgb,
258
+ borderRadius: ((_r = (_q = brand == null ? void 0 : brand.style) == null ? void 0 : _q.button) == null ? void 0 : _r.radius) != null ? brand.style.button.radius / 4 + "px" : void 0,
259
+ color: (_t = (_s = style == null ? void 0 : style.text) == null ? void 0 : _s.color) == null ? void 0 : _t.rgb,
260
+ WebkitAppearance: "none"
261
+ },
262
+ value: (selectedVariant == null ? void 0 : selectedVariant.id) || ""
263
+ },
264
+ children: variants.map((variant) => /* @__PURE__ */ jsx(
265
+ "option",
266
+ {
267
+ ...{
268
+ value: variant.id
269
+ },
270
+ children: variant.title
271
+ },
272
+ variant.id
273
+ ))
274
+ }
275
+ ),
276
+ /* @__PURE__ */ jsx(
277
+ "div",
278
+ {
279
+ ...{
280
+ "aria-hidden": true,
281
+ style: {
282
+ alignItems: "center",
283
+ bottom: 0,
284
+ display: "flex",
285
+ paddingRight: "0.625rem",
286
+ pointerEvents: "none",
287
+ position: "absolute",
288
+ right: 0,
289
+ top: 0
290
+ }
291
+ },
292
+ children: /* @__PURE__ */ jsx(
293
+ "svg",
294
+ {
295
+ ...{
296
+ style: {
297
+ height: "1.25rem",
298
+ width: "1.25rem"
299
+ },
300
+ fill: "none",
301
+ stroke: "currentColor",
302
+ strokeWidth: 1.5,
303
+ viewBox: "0 0 24 24",
304
+ xmlns: "http://www.w3.org/2000/svg"
305
+ },
306
+ children: /* @__PURE__ */ jsx(
307
+ "path",
308
+ {
309
+ ...{
310
+ d: "M19.5 8.25l-7.5 7.5-7.5-7.5",
311
+ strokeLinecap: "round",
312
+ strokeLinejoin: "round"
313
+ }
314
+ }
315
+ )
316
+ }
317
+ )
318
+ }
319
+ )
320
+ ]
321
+ }
322
+ )
323
+ ]
324
+ }
325
+ ),
326
+ button && /* @__PURE__ */ jsx(
327
+ "button",
328
+ {
329
+ ...{
330
+ className: classes.button.join(" "),
331
+ disabled: !preview && !hasVariants && !url,
332
+ onClick: hasVariants ? () => {
333
+ if (!preview) onVariantSelect(selectedVariant);
334
+ } : preview ? () => {
335
+ } : onClick,
336
+ style: {
337
+ backgroundColor: ((_x = (_w = (_v = (_u = brand == null ? void 0 : brand.style) == null ? void 0 : _u.button) == null ? void 0 : _v.background) == null ? void 0 : _w.color) == null ? void 0 : _x.hex) || ((_z = (_y = style == null ? void 0 : style.text) == null ? void 0 : _y.color) == null ? void 0 : _z.hex),
338
+ borderColor: ((_D = (_C = (_B = (_A = brand == null ? void 0 : brand.style) == null ? void 0 : _A.button) == null ? void 0 : _B.background) == null ? void 0 : _C.color) == null ? void 0 : _D.hex) || ((_F = (_E = style == null ? void 0 : style.text) == null ? void 0 : _E.color) == null ? void 0 : _F.hex),
339
+ borderRadius: ((_H = (_G = brand == null ? void 0 : brand.style) == null ? void 0 : _G.button) == null ? void 0 : _H.radius) != null ? brand.style.button.radius / 4 + "px" : void 0,
340
+ color: ((_L = (_K = (_J = (_I = brand == null ? void 0 : brand.style) == null ? void 0 : _I.button) == null ? void 0 : _J.text) == null ? void 0 : _K.color) == null ? void 0 : _L.hex) || ((_N = (_M = style == null ? void 0 : style.background) == null ? void 0 : _M.color) == null ? void 0 : _N.hex)
341
+ },
342
+ type: "button"
343
+ },
344
+ children: button
345
+ }
346
+ )
347
+ ]
348
+ }
349
+ )
350
+ ]
351
+ }
352
+ );
353
+ };
354
+ var card_advertisement_default = CardAdvertisement;
355
+
356
+ export {
357
+ card_advertisement_default
358
+ };
@@ -0,0 +1,208 @@
1
+ // components/wrapper-gradient.js
2
+ import { createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var WrapperGradientContext = createContext(null);
5
+ var useWrapperGradient = () => useContext(WrapperGradientContext);
6
+ var WrapperGradient = ({
7
+ children,
8
+ className,
9
+ classNameGradient,
10
+ classNameScroll,
11
+ color,
12
+ gradientTopOffset,
13
+ horizontal = false
14
+ }) => {
15
+ const showX = horizontal === true || horizontal === "both";
16
+ const showY = horizontal === false || horizontal === "both";
17
+ const overflowClass = horizontal === "both" ? "overflow-scroll" : horizontal ? "overflow-x-scroll overflow-y-visible" : "overflow-y-scroll overflow-x-visible";
18
+ const overscrollClass = horizontal === "both" ? "overscroll-none" : horizontal ? "overscroll-x-none overscroll-y-auto" : "overscroll-y-none overscroll-x-auto";
19
+ const themed = Boolean(color);
20
+ const gradientDefaults = "absolute z-[2] " + (themed ? "pointer-events-none " : "") + "transition-all duration-[100ms] ";
21
+ const classes = {
22
+ container: [
23
+ themed ? "relative" : "w-full relative",
24
+ ...className ? [className] : []
25
+ ],
26
+ inner: [
27
+ "w-full relative scroll-smooth hide-scrollbar",
28
+ overscrollClass,
29
+ overflowClass,
30
+ ...classNameScroll ? [classNameScroll] : []
31
+ ],
32
+ topGradient: [
33
+ gradientDefaults,
34
+ "w-full -top-[1px]",
35
+ ...themed ? [] : ["bg-gradient-to-b"],
36
+ ...classNameGradient ? [classNameGradient] : themed ? ["h-10"] : ["from-white to-transparent h-10"]
37
+ ],
38
+ bottomGradient: [
39
+ gradientDefaults,
40
+ "w-full -bottom-[1px]",
41
+ ...themed ? [] : ["bg-gradient-to-t"],
42
+ ...classNameGradient ? [classNameGradient] : themed ? ["h-10"] : ["from-white to-transparent h-10"]
43
+ ],
44
+ leftGradient: [
45
+ gradientDefaults,
46
+ "h-full top-0 left-0",
47
+ ...themed ? [] : ["bg-gradient-to-r"],
48
+ ...classNameGradient ? [classNameGradient] : themed ? ["w-4"] : ["from-white from-30% to-transparent w-4"]
49
+ ],
50
+ rightGradient: [
51
+ gradientDefaults,
52
+ "h-full top-0 right-0",
53
+ ...themed ? [] : ["bg-gradient-to-l"],
54
+ ...classNameGradient ? [classNameGradient] : themed ? ["w-4"] : ["from-white from-30% to-transparent w-4"]
55
+ ]
56
+ };
57
+ const gradients = {
58
+ top: "linear-gradient( to bottom, " + color + " 0%, transparent 100% )",
59
+ bottom: "linear-gradient( to top, " + color + " 0%, transparent 100% )",
60
+ left: "linear-gradient( to right, " + color + " 0%, transparent 100% )",
61
+ right: "linear-gradient( to left, " + color + " 0%, transparent 100% )"
62
+ };
63
+ const containerRef = useRef(null);
64
+ const [scroll, setScroll] = useState({
65
+ top: 0,
66
+ left: 0,
67
+ atBottom: true,
68
+ atRight: true
69
+ });
70
+ useEffect(
71
+ () => {
72
+ const container = containerRef.current;
73
+ const handleScroll = () => {
74
+ const { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = container;
75
+ setScroll({
76
+ top: scrollTop,
77
+ left: scrollLeft,
78
+ atBottom: scrollTop + clientHeight >= scrollHeight - 1,
79
+ atRight: scrollLeft + clientWidth >= scrollWidth - 1
80
+ });
81
+ };
82
+ const handleUpdate = () => {
83
+ const { scrollHeight, scrollWidth, clientHeight, clientWidth } = container;
84
+ if (scrollHeight <= clientHeight && scrollWidth <= clientWidth) {
85
+ setScroll({
86
+ top: 0,
87
+ left: 0,
88
+ atBottom: true,
89
+ atRight: true
90
+ });
91
+ return;
92
+ }
93
+ ;
94
+ handleScroll();
95
+ };
96
+ handleUpdate();
97
+ container.addEventListener("scroll", handleScroll);
98
+ const observer = new MutationObserver((mutations) => {
99
+ for (const mutation of mutations) {
100
+ if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
101
+ handleUpdate();
102
+ break;
103
+ }
104
+ }
105
+ });
106
+ observer.observe(container, {
107
+ childList: true,
108
+ subtree: true
109
+ });
110
+ const resizeObserver = new ResizeObserver(handleUpdate);
111
+ resizeObserver.observe(container);
112
+ return () => {
113
+ container.removeEventListener("scroll", handleScroll);
114
+ observer.disconnect();
115
+ resizeObserver.disconnect();
116
+ };
117
+ },
118
+ [horizontal]
119
+ );
120
+ const contextValue = useMemo(
121
+ () => ({
122
+ atBottom: scroll.atBottom,
123
+ atRight: scroll.atRight
124
+ }),
125
+ [scroll.atBottom, scroll.atRight]
126
+ );
127
+ return /* @__PURE__ */ jsx(
128
+ "div",
129
+ {
130
+ ...{
131
+ className: classes.container.join(" ")
132
+ },
133
+ children: /* @__PURE__ */ jsxs(WrapperGradientContext.Provider, { value: contextValue, children: [
134
+ showY && /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ ...{
138
+ className: classes.topGradient.join(" ") + (scroll.top > 5 ? " opacity-100 visible" : " opacity-0 invisible"),
139
+ style: {
140
+ ...themed && {
141
+ backgroundImage: gradients.top
142
+ },
143
+ ...gradientTopOffset && {
144
+ top: gradientTopOffset
145
+ }
146
+ }
147
+ }
148
+ }
149
+ ),
150
+ showX && /* @__PURE__ */ jsx(
151
+ "div",
152
+ {
153
+ ...{
154
+ className: classes.leftGradient.join(" ") + (scroll.left > 5 ? " opacity-100 visible" : " opacity-0 invisible"),
155
+ style: {
156
+ ...themed && {
157
+ backgroundImage: gradients.left
158
+ }
159
+ }
160
+ }
161
+ }
162
+ ),
163
+ /* @__PURE__ */ jsx(
164
+ "div",
165
+ {
166
+ ...{
167
+ className: classes.inner.join(" "),
168
+ ref: containerRef
169
+ },
170
+ children
171
+ }
172
+ ),
173
+ showY && /* @__PURE__ */ jsx(
174
+ "div",
175
+ {
176
+ ...{
177
+ className: classes.bottomGradient.join(" ") + (!scroll.atBottom ? " opacity-100 visible" : " opacity-0 invisible"),
178
+ style: {
179
+ ...themed && {
180
+ backgroundImage: gradients.bottom
181
+ }
182
+ }
183
+ }
184
+ }
185
+ ),
186
+ showX && /* @__PURE__ */ jsx(
187
+ "div",
188
+ {
189
+ ...{
190
+ className: classes.rightGradient.join(" ") + (!scroll.atRight ? " opacity-100 visible" : " opacity-0 invisible"),
191
+ style: {
192
+ ...themed && {
193
+ backgroundImage: gradients.right
194
+ }
195
+ }
196
+ }
197
+ }
198
+ )
199
+ ] })
200
+ }
201
+ );
202
+ };
203
+ var wrapper_gradient_default = WrapperGradient;
204
+
205
+ export {
206
+ useWrapperGradient,
207
+ wrapper_gradient_default
208
+ };
package/dist/embla.js ADDED
@@ -0,0 +1,41 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // components/embla.js
31
+ var embla_exports = {};
32
+ __export(embla_exports, {
33
+ default: () => import_embla_carousel_react.default
34
+ });
35
+ module.exports = __toCommonJS(embla_exports);
36
+ var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
37
+ __reExport(embla_exports, require("embla-carousel-react"), module.exports);
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ ...require("embla-carousel-react")
41
+ });
package/dist/embla.mjs ADDED
@@ -0,0 +1,6 @@
1
+ // components/embla.js
2
+ import { default as default2 } from "embla-carousel-react";
3
+ export * from "embla-carousel-react";
4
+ export {
5
+ default2 as default
6
+ };
@@ -0,0 +1,48 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // components/icons/arrow-down-tray.js
20
+ var arrow_down_tray_exports = {};
21
+ __export(arrow_down_tray_exports, {
22
+ default: () => arrow_down_tray_default
23
+ });
24
+ module.exports = __toCommonJS(arrow_down_tray_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var ArrowDownTray = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
27
+ "svg",
28
+ {
29
+ ...{
30
+ fill: "none",
31
+ stroke: "currentColor",
32
+ strokeWidth: 1.5,
33
+ viewBox: "0 0 24 24",
34
+ ...props
35
+ },
36
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
+ "path",
38
+ {
39
+ ...{
40
+ d: "M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3",
41
+ strokeLinecap: "round",
42
+ strokeLinejoin: "round"
43
+ }
44
+ }
45
+ )
46
+ }
47
+ );
48
+ var arrow_down_tray_default = ArrowDownTray;
@@ -0,0 +1,28 @@
1
+ // components/icons/arrow-down-tray.js
2
+ import { jsx } from "react/jsx-runtime";
3
+ var ArrowDownTray = (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: "M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3",
18
+ strokeLinecap: "round",
19
+ strokeLinejoin: "round"
20
+ }
21
+ }
22
+ )
23
+ }
24
+ );
25
+ var arrow_down_tray_default = ArrowDownTray;
26
+ export {
27
+ arrow_down_tray_default as default
28
+ };