@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.
Files changed (248) hide show
  1. package/dist/advertisement.js +1303 -0
  2. package/dist/advertisement.mjs +98 -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-GUSVATKJ.mjs +335 -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 +865 -0
  161. package/dist/product.mjs +14 -0
  162. package/dist/provider-font.js +94 -0
  163. package/dist/provider-font.mjs +74 -0
  164. package/dist/styles.js +127 -0
  165. package/dist/styles.mjs +28 -0
  166. package/dist/video.js +195 -0
  167. package/dist/video.mjs +125 -0
  168. package/dist/wrapper-gradient.js +232 -0
  169. package/dist/wrapper-gradient.mjs +9 -0
  170. package/package.json +316 -2
  171. package/types/advertisement.d.ts +36 -0
  172. package/types/embla.d.ts +2 -0
  173. package/types/icons/arrow-down-tray.d.ts +5 -0
  174. package/types/icons/arrow-left.d.ts +5 -0
  175. package/types/icons/arrow-right.d.ts +5 -0
  176. package/types/icons/arrow-up-tray.d.ts +5 -0
  177. package/types/icons/bars-arrow-down.d.ts +5 -0
  178. package/types/icons/bars-arrow-up.d.ts +5 -0
  179. package/types/icons/bold.d.ts +5 -0
  180. package/types/icons/bolt.d.ts +5 -0
  181. package/types/icons/calendar.d.ts +5 -0
  182. package/types/icons/cancel.d.ts +5 -0
  183. package/types/icons/card.d.ts +5 -0
  184. package/types/icons/chart.d.ts +5 -0
  185. package/types/icons/check.d.ts +5 -0
  186. package/types/icons/chevron-down.d.ts +5 -0
  187. package/types/icons/chevron-left.d.ts +5 -0
  188. package/types/icons/chevron-right.d.ts +5 -0
  189. package/types/icons/chevron-up-down.d.ts +5 -0
  190. package/types/icons/chevron-up.d.ts +5 -0
  191. package/types/icons/clock.d.ts +5 -0
  192. package/types/icons/code-bracket.d.ts +5 -0
  193. package/types/icons/cog.d.ts +5 -0
  194. package/types/icons/copy.d.ts +5 -0
  195. package/types/icons/document.d.ts +5 -0
  196. package/types/icons/download.d.ts +5 -0
  197. package/types/icons/drag.d.ts +5 -0
  198. package/types/icons/ellipsis.d.ts +5 -0
  199. package/types/icons/email.d.ts +5 -0
  200. package/types/icons/external.d.ts +5 -0
  201. package/types/icons/filter.d.ts +5 -0
  202. package/types/icons/flag.d.ts +5 -0
  203. package/types/icons/google.d.ts +5 -0
  204. package/types/icons/home.d.ts +5 -0
  205. package/types/icons/image.d.ts +5 -0
  206. package/types/icons/italic.d.ts +5 -0
  207. package/types/icons/link.d.ts +5 -0
  208. package/types/icons/loader.d.ts +5 -0
  209. package/types/icons/lock.d.ts +5 -0
  210. package/types/icons/logo-mark.d.ts +5 -0
  211. package/types/icons/logo-tagline.d.ts +5 -0
  212. package/types/icons/map-pin.d.ts +5 -0
  213. package/types/icons/menu.d.ts +5 -0
  214. package/types/icons/minus.d.ts +5 -0
  215. package/types/icons/muted.d.ts +5 -0
  216. package/types/icons/pause.d.ts +5 -0
  217. package/types/icons/pencil.d.ts +5 -0
  218. package/types/icons/play.d.ts +5 -0
  219. package/types/icons/plus.d.ts +5 -0
  220. package/types/icons/powered-by.d.ts +5 -0
  221. package/types/icons/qr-code.d.ts +5 -0
  222. package/types/icons/queue.d.ts +5 -0
  223. package/types/icons/refresh.d.ts +5 -0
  224. package/types/icons/refund.d.ts +5 -0
  225. package/types/icons/rocket.d.ts +5 -0
  226. package/types/icons/search.d.ts +5 -0
  227. package/types/icons/share.d.ts +5 -0
  228. package/types/icons/shop.d.ts +5 -0
  229. package/types/icons/sparkles.d.ts +5 -0
  230. package/types/icons/star.d.ts +5 -0
  231. package/types/icons/switch.d.ts +5 -0
  232. package/types/icons/times.d.ts +5 -0
  233. package/types/icons/trash.d.ts +5 -0
  234. package/types/icons/underline.d.ts +5 -0
  235. package/types/icons/upload.d.ts +5 -0
  236. package/types/icons/volume.d.ts +5 -0
  237. package/types/icons/warning.d.ts +5 -0
  238. package/types/input-checkbox.d.ts +14 -0
  239. package/types/input-group.d.ts +15 -0
  240. package/types/input-number.d.ts +17 -0
  241. package/types/input-select.d.ts +19 -0
  242. package/types/input-text.d.ts +12 -0
  243. package/types/input-textarea.d.ts +13 -0
  244. package/types/product.d.ts +21 -0
  245. package/types/provider-font.d.ts +23 -0
  246. package/types/styles.d.ts +37 -0
  247. package/types/video.d.ts +22 -0
  248. package/types/wrapper-gradient.d.ts +17 -0
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import {
3
+ product_default
4
+ } from "./chunk-GUSVATKJ.mjs";
5
+ import "./chunk-2ZYGRSSA.mjs";
6
+ import "./chunk-XWELEL6Z.mjs";
7
+ import {
8
+ card_advertisement_default
9
+ } from "./chunk-TJNIR4PF.mjs";
10
+ import "./chunk-7ZLMDYBR.mjs";
11
+ import "./chunk-Q3UIVGPQ.mjs";
12
+ import "./chunk-BD3TDNJE.mjs";
13
+ import "./chunk-FYA7EAMR.mjs";
14
+ import "./chunk-FJXG3REN.mjs";
15
+
16
+ // components/advertisement.js
17
+ import { jsx } from "react/jsx-runtime";
18
+ var Advertisement = ({
19
+ action = null,
20
+ affiliate,
21
+ brand,
22
+ button,
23
+ campaign,
24
+ disabled = false,
25
+ errors,
26
+ file,
27
+ fonts,
28
+ header,
29
+ id,
30
+ ImageComponent,
31
+ lead,
32
+ onAdd,
33
+ onBuy,
34
+ onClick = () => {
35
+ },
36
+ onVariantChange,
37
+ onVariantSelect = () => {
38
+ },
39
+ organization,
40
+ page,
41
+ preview = false,
42
+ product,
43
+ style = {},
44
+ title,
45
+ url,
46
+ variant,
47
+ VideoComponent
48
+ }) => {
49
+ if (product) {
50
+ return /* @__PURE__ */ jsx(
51
+ product_default,
52
+ {
53
+ ...{
54
+ action,
55
+ addToCart: false,
56
+ disabled: preview || disabled,
57
+ errors,
58
+ header,
59
+ ImageComponent,
60
+ onAdd,
61
+ onBuy,
62
+ onVariantChange,
63
+ product,
64
+ style,
65
+ variant
66
+ }
67
+ }
68
+ );
69
+ }
70
+ return /* @__PURE__ */ jsx(
71
+ card_advertisement_default,
72
+ {
73
+ ...{
74
+ advertisement: id,
75
+ affiliate,
76
+ asset: file,
77
+ brand: brand || { style },
78
+ button,
79
+ campaign,
80
+ fonts,
81
+ ImageComponent,
82
+ lead,
83
+ onClick,
84
+ onVariantSelect,
85
+ organization,
86
+ page,
87
+ preview,
88
+ title,
89
+ url,
90
+ VideoComponent
91
+ }
92
+ }
93
+ );
94
+ };
95
+ var advertisement_default = Advertisement;
96
+ export {
97
+ advertisement_default as default
98
+ };
@@ -1,357 +1,6 @@
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;
1
+ import {
2
+ card_advertisement_default
3
+ } from "./chunk-TJNIR4PF.mjs";
355
4
  export {
356
5
  card_advertisement_default as default
357
6
  };
@@ -0,0 +1,45 @@
1
+ // components/icons/loader.js
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ var Loader = ({ className, ...props }) => /* @__PURE__ */ jsxs(
4
+ "svg",
5
+ {
6
+ ...{
7
+ fill: "none",
8
+ stroke: "none",
9
+ strokeWidth: 0,
10
+ viewBox: "0 0 24 24",
11
+ className: ["animate-spin", className].filter(Boolean).join(" "),
12
+ ...props
13
+ },
14
+ children: [
15
+ /* @__PURE__ */ jsx(
16
+ "circle",
17
+ {
18
+ ...{
19
+ className: "opacity-25",
20
+ cx: 12,
21
+ cy: 12,
22
+ r: 10,
23
+ stroke: "currentColor",
24
+ strokeWidth: 4
25
+ }
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsx(
29
+ "path",
30
+ {
31
+ ...{
32
+ className: "opacity-75",
33
+ fill: "currentColor",
34
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
35
+ }
36
+ }
37
+ )
38
+ ]
39
+ }
40
+ );
41
+ var loader_default = Loader;
42
+
43
+ export {
44
+ loader_default
45
+ };
@@ -0,0 +1,113 @@
1
+ import {
2
+ warning_default
3
+ } from "./chunk-Q3UIVGPQ.mjs";
4
+
5
+ // components/input-group.js
6
+ import { Fragment } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var InputGroup = ({
9
+ className,
10
+ error,
11
+ input,
12
+ label,
13
+ message,
14
+ style = {}
15
+ }) => {
16
+ var _a, _b, _c, _d;
17
+ const classes = [
18
+ "input-group"
19
+ ];
20
+ if (className) {
21
+ classes.push(className);
22
+ }
23
+ if (error) {
24
+ classes.push("error");
25
+ }
26
+ return /* @__PURE__ */ jsxs(
27
+ "div",
28
+ {
29
+ ...{
30
+ className: classes.join(" "),
31
+ "aria-live": "polite"
32
+ },
33
+ children: [
34
+ label ? /* @__PURE__ */ jsxs(
35
+ "div",
36
+ {
37
+ ...{
38
+ className: "space-y-2"
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ jsx(
42
+ "span",
43
+ {
44
+ ...{
45
+ className: "block"
46
+ },
47
+ children: label
48
+ }
49
+ ),
50
+ input
51
+ ]
52
+ }
53
+ ) : input,
54
+ (error || message) && /* @__PURE__ */ jsxs(
55
+ "p",
56
+ {
57
+ ...{
58
+ className: "flex items-center justify-start space-x-2 py-1 rounded text-sm " + (error && "px-1.5"),
59
+ ...error && Object.keys(style).length > 0 && {
60
+ style: {
61
+ backgroundColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb.replace(")", ",.1)"),
62
+ color: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
63
+ }
64
+ }
65
+ },
66
+ children: [
67
+ error && /* @__PURE__ */ jsxs(Fragment, { children: [
68
+ /* @__PURE__ */ jsx(
69
+ warning_default,
70
+ {
71
+ ...{
72
+ className: "w-4 h-4",
73
+ "aria-hidden": true
74
+ }
75
+ }
76
+ ),
77
+ /* @__PURE__ */ jsxs(
78
+ "span",
79
+ {
80
+ ...{
81
+ className: "text-[0px] opacity-0 w-0 h-0 absolute"
82
+ },
83
+ children: [
84
+ label,
85
+ ": ",
86
+ error
87
+ ]
88
+ }
89
+ )
90
+ ] }),
91
+ /* @__PURE__ */ jsx(
92
+ "span",
93
+ {
94
+ ...{
95
+ ...error && {
96
+ "aria-hidden": true
97
+ }
98
+ },
99
+ children: error || message
100
+ }
101
+ )
102
+ ]
103
+ }
104
+ )
105
+ ]
106
+ }
107
+ );
108
+ };
109
+ var input_group_default = InputGroup;
110
+
111
+ export {
112
+ input_group_default
113
+ };