@fluid-app/rep-widgets 0.1.6 → 0.1.8

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 (34) hide show
  1. package/dist/{ChartWidget-RTTBCUP5.cjs → ChartWidget-ETZEURVU.cjs} +5 -5
  2. package/dist/{ChartWidget-RTTBCUP5.cjs.map → ChartWidget-ETZEURVU.cjs.map} +1 -1
  3. package/dist/{ChartWidget-QAVE4MR6.js → ChartWidget-QTYGMAEV.js} +3 -3
  4. package/dist/{ChartWidget-QAVE4MR6.js.map → ChartWidget-QTYGMAEV.js.map} +1 -1
  5. package/dist/{ListWidget-FCMXJE5M.cjs → ListWidget-7HUFB5JZ.cjs} +5 -5
  6. package/dist/{ListWidget-FCMXJE5M.cjs.map → ListWidget-7HUFB5JZ.cjs.map} +1 -1
  7. package/dist/ListWidget-I7I7FAW5.js +6 -0
  8. package/dist/{ListWidget-EN2V55JJ.js.map → ListWidget-I7I7FAW5.js.map} +1 -1
  9. package/dist/{TableWidget-APVKJ225.js → TableWidget-VMPYQU7I.js} +3 -3
  10. package/dist/{TableWidget-APVKJ225.js.map → TableWidget-VMPYQU7I.js.map} +1 -1
  11. package/dist/{TableWidget-DXXVKRNC.cjs → TableWidget-ZX5A4IFW.cjs} +5 -5
  12. package/dist/{TableWidget-DXXVKRNC.cjs.map → TableWidget-ZX5A4IFW.cjs.map} +1 -1
  13. package/dist/{chunk-RHJWWSDK.js → chunk-7B5RPA6J.js} +26 -21
  14. package/dist/chunk-7B5RPA6J.js.map +1 -0
  15. package/dist/{chunk-RPVMJLTN.cjs → chunk-BZQW7APC.cjs} +457 -422
  16. package/dist/chunk-BZQW7APC.cjs.map +1 -0
  17. package/dist/{chunk-JDIYHCWU.cjs → chunk-MUFXAD45.cjs} +26 -21
  18. package/dist/chunk-MUFXAD45.cjs.map +1 -0
  19. package/dist/{chunk-ZCVNDXQ5.js → chunk-NYL2AQJ2.js} +5 -5
  20. package/dist/chunk-NYL2AQJ2.js.map +1 -0
  21. package/dist/{chunk-IDKYJ6OT.cjs → chunk-PHI5YY5E.cjs} +5 -5
  22. package/dist/chunk-PHI5YY5E.cjs.map +1 -0
  23. package/dist/{chunk-3KJRYFS7.js → chunk-Y657NN2D.js} +457 -422
  24. package/dist/chunk-Y657NN2D.js.map +1 -0
  25. package/dist/widgets/index.cjs +12 -12
  26. package/dist/widgets/index.js +6 -6
  27. package/package.json +3 -3
  28. package/dist/ListWidget-EN2V55JJ.js +0 -6
  29. package/dist/chunk-3KJRYFS7.js.map +0 -1
  30. package/dist/chunk-IDKYJ6OT.cjs.map +0 -1
  31. package/dist/chunk-JDIYHCWU.cjs.map +0 -1
  32. package/dist/chunk-RHJWWSDK.js.map +0 -1
  33. package/dist/chunk-RPVMJLTN.cjs.map +0 -1
  34. package/dist/chunk-ZCVNDXQ5.js.map +0 -1
@@ -3,31 +3,66 @@
3
3
  var chunkLOXFR6XC_cjs = require('./chunk-LOXFR6XC.cjs');
4
4
  var chunkQV3OAAEQ_cjs = require('./chunk-QV3OAAEQ.cjs');
5
5
  var chunkCM7D7WGL_cjs = require('./chunk-CM7D7WGL.cjs');
6
- var react = require('react');
7
6
  var jsxRuntime = require('react/jsx-runtime');
7
+ var react = require('react');
8
8
 
9
- var DEFAULT_ITEMS = [];
10
- var SCROLL_ITEM_WIDTH = 300;
11
- var getImageUrl = (item) => {
12
- return item.imageUrl || item.image;
13
- };
14
- function getFeaturedAssetUrl(value) {
15
- if (!value) return void 0;
16
- if (typeof value === "string") {
17
- const isVideo = /\.(mp4|webm|ogg|mov)$/i.test(value);
18
- return { url: value, isVideo };
19
- }
20
- if (typeof value === "object") {
21
- const videoUrl = value.videoUrl || value.video_url || value.url;
22
- if (videoUrl && /\.(mp4|webm|ogg|mov)$/i.test(videoUrl)) {
23
- return { url: videoUrl, isVideo: true };
24
- }
25
- const imageUrl = value.imageUrl || value.image_url || value.url;
26
- if (imageUrl) {
27
- return { url: imageUrl, isVideo: false };
9
+ function FeaturedSection({
10
+ borderRadius,
11
+ titleSize,
12
+ featuredTitle,
13
+ featuredSubtitle,
14
+ featuredButtonText,
15
+ featuredButtonUrl,
16
+ featuredSubtitleColor,
17
+ featuredSubtitleSize,
18
+ asset
19
+ }) {
20
+ return /* @__PURE__ */ jsxRuntime.jsxs(
21
+ "div",
22
+ {
23
+ className: `relative h-full min-h-[300px] w-full overflow-hidden rounded-${borderRadius}`,
24
+ children: [
25
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
26
+ chunkLOXFR6XC_cjs.MediaRenderer,
27
+ {
28
+ src: asset.url,
29
+ mediaType: asset.isVideo ? "video" : "image",
30
+ alt: featuredTitle || "Featured",
31
+ objectFit: "cover",
32
+ autoplay: asset.isVideo,
33
+ loop: asset.isVideo,
34
+ muted: asset.isVideo,
35
+ controls: false
36
+ }
37
+ ) }),
38
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-black/40" }),
39
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col items-start justify-end p-8", children: [
40
+ featuredTitle && /* @__PURE__ */ jsxRuntime.jsx(
41
+ "h3",
42
+ {
43
+ className: `mb-2 font-bold text-white text-${titleSize === "md" ? "base" : titleSize}`,
44
+ children: featuredTitle
45
+ }
46
+ ),
47
+ featuredSubtitle && /* @__PURE__ */ jsxRuntime.jsx(
48
+ "p",
49
+ {
50
+ className: `mb-4 text-${featuredSubtitleColor} text-${featuredSubtitleSize === "md" ? "base" : featuredSubtitleSize}`,
51
+ children: featuredSubtitle
52
+ }
53
+ ),
54
+ featuredButtonText && /* @__PURE__ */ jsxRuntime.jsx(
55
+ "a",
56
+ {
57
+ href: featuredButtonUrl || "#",
58
+ className: `bg-white px-6 py-2 font-medium text-foreground transition-opacity hover:opacity-90 rounded-${borderRadius}`,
59
+ children: featuredButtonText
60
+ }
61
+ )
62
+ ] })
63
+ ]
28
64
  }
29
- }
30
- return void 0;
65
+ );
31
66
  }
32
67
  function getTextContent(value) {
33
68
  if (!value) return "";
@@ -60,6 +95,101 @@ function getStringValue(value) {
60
95
  }
61
96
  return "";
62
97
  }
98
+ function ListItemCardContent({
99
+ item,
100
+ padding,
101
+ itemTitleColor,
102
+ itemTitleSize,
103
+ descriptionColor,
104
+ descriptionSize,
105
+ priceColor,
106
+ priceSize,
107
+ originalPriceColor,
108
+ metaTextColor,
109
+ metaTextSize,
110
+ showMetaText
111
+ }) {
112
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `p-${padding}`, children: [
113
+ item.title && /* @__PURE__ */ jsxRuntime.jsx(
114
+ "h3",
115
+ {
116
+ className: `text-${itemTitleColor} text-${itemTitleSize === "md" ? "base" : itemTitleSize} mb-1 font-semibold`,
117
+ children: getTextContent(item.title)
118
+ }
119
+ ),
120
+ item.description && /* @__PURE__ */ jsxRuntime.jsx(
121
+ "p",
122
+ {
123
+ className: `text-${descriptionColor} text-${descriptionSize === "md" ? "base" : descriptionSize} mb-2`,
124
+ children: getTextContent(item.description)
125
+ }
126
+ ),
127
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
128
+ item.price && /* @__PURE__ */ jsxRuntime.jsx(
129
+ "span",
130
+ {
131
+ className: `text-${priceColor} text-${priceSize === "md" ? "base" : priceSize} font-bold`,
132
+ children: getStringValue(item.price)
133
+ }
134
+ ),
135
+ item.originalPrice && /* @__PURE__ */ jsxRuntime.jsx(
136
+ "span",
137
+ {
138
+ className: `text-${originalPriceColor} text-${descriptionSize === "md" ? "base" : descriptionSize} line-through`,
139
+ children: getStringValue(item.originalPrice)
140
+ }
141
+ )
142
+ ] }),
143
+ showMetaText && (item.qv || item.cv) && /* @__PURE__ */ jsxRuntime.jsxs(
144
+ "div",
145
+ {
146
+ className: `mt-2 flex gap-3 text-${metaTextColor} text-${metaTextSize === "md" ? "base" : metaTextSize}`,
147
+ children: [
148
+ item.qv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
149
+ "QV: ",
150
+ getStringValue(item.qv)
151
+ ] }),
152
+ item.cv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
153
+ "CV: ",
154
+ getStringValue(item.cv)
155
+ ] })
156
+ ]
157
+ }
158
+ )
159
+ ] });
160
+ }
161
+ function DiscountBadge({ discount }) {
162
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-2 right-2 z-10 rounded-md bg-destructive px-2 py-1 text-xs font-bold text-destructive-foreground", children: getStringValue(discount) });
163
+ }
164
+ function FavoriteButton({ className }) {
165
+ return /* @__PURE__ */ jsxRuntime.jsx(
166
+ "button",
167
+ {
168
+ className: className || "absolute top-2 left-2 z-10 rounded-full bg-background/80 p-2 backdrop-blur-sm transition-colors hover:bg-background",
169
+ children: /* @__PURE__ */ jsxRuntime.jsx(
170
+ "svg",
171
+ {
172
+ className: "h-5 w-5 text-muted-foreground",
173
+ fill: "none",
174
+ stroke: "currentColor",
175
+ viewBox: "0 0 24 24",
176
+ children: /* @__PURE__ */ jsxRuntime.jsx(
177
+ "path",
178
+ {
179
+ strokeLinecap: "round",
180
+ strokeLinejoin: "round",
181
+ strokeWidth: 2,
182
+ d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
183
+ }
184
+ )
185
+ }
186
+ )
187
+ }
188
+ );
189
+ }
190
+ var getImageUrl = (item) => {
191
+ return item.imageUrl || item.image;
192
+ };
63
193
  var getAspectRatioClass = (ratio) => {
64
194
  const ratios = {
65
195
  square: "aspect-square",
@@ -79,6 +209,244 @@ var getResponsiveGridClass = (columns) => {
79
209
  };
80
210
  return responsiveClasses[columns] || "grid-cols-2 @lg:grid-cols-3";
81
211
  };
212
+ function UnorderedList({
213
+ items,
214
+ columns,
215
+ gap,
216
+ borderRadius,
217
+ imageAspectRatio,
218
+ showBadge,
219
+ showFavorite,
220
+ padding,
221
+ itemTitleColor,
222
+ itemTitleSize,
223
+ descriptionColor,
224
+ descriptionSize,
225
+ priceColor,
226
+ priceSize,
227
+ originalPriceColor,
228
+ metaTextColor,
229
+ metaTextSize,
230
+ showMetaText
231
+ }) {
232
+ const gridClass = getResponsiveGridClass(columns);
233
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid ${gridClass} gap-${chunkCM7D7WGL_cjs.gapValues[gap]}`, children: items.map((item) => {
234
+ const imageUrl = getImageUrl(item);
235
+ const aspectRatioClass = getAspectRatioClass(imageAspectRatio);
236
+ return /* @__PURE__ */ jsxRuntime.jsxs(
237
+ "div",
238
+ {
239
+ className: `relative rounded-${borderRadius} overflow-hidden bg-background shadow-sm transition-shadow hover:shadow-md`,
240
+ children: [
241
+ showBadge && item.discount && /* @__PURE__ */ jsxRuntime.jsx(DiscountBadge, { discount: item.discount }),
242
+ showFavorite && /* @__PURE__ */ jsxRuntime.jsx(FavoriteButton, {}),
243
+ imageUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full ${aspectRatioClass} overflow-hidden`, children: /* @__PURE__ */ jsxRuntime.jsx(
244
+ "img",
245
+ {
246
+ src: imageUrl,
247
+ alt: item.title || "Product",
248
+ className: "h-full w-full object-cover"
249
+ }
250
+ ) }),
251
+ /* @__PURE__ */ jsxRuntime.jsx(
252
+ ListItemCardContent,
253
+ {
254
+ item,
255
+ padding,
256
+ itemTitleColor,
257
+ itemTitleSize,
258
+ descriptionColor,
259
+ descriptionSize,
260
+ priceColor,
261
+ priceSize,
262
+ originalPriceColor,
263
+ metaTextColor,
264
+ metaTextSize,
265
+ showMetaText
266
+ }
267
+ )
268
+ ]
269
+ },
270
+ item.id
271
+ );
272
+ }) });
273
+ }
274
+ var SCROLL_ITEM_WIDTH = 300;
275
+ var getImageUrl2 = (item) => {
276
+ return item.imageUrl || item.image;
277
+ };
278
+ var getAspectRatioClass2 = (ratio) => {
279
+ const ratios = {
280
+ square: "aspect-square",
281
+ landscape: "aspect-video",
282
+ portrait: "aspect-[3/4]"
283
+ };
284
+ return ratios[ratio];
285
+ };
286
+ var largeNumberSizes = {
287
+ xs: "8rem",
288
+ sm: "10rem",
289
+ md: "12rem",
290
+ lg: "14rem",
291
+ xl: "16rem",
292
+ "2xl": "20rem"
293
+ };
294
+ function OrderedList({
295
+ items,
296
+ scrollAxis,
297
+ gap,
298
+ borderRadius,
299
+ imageAspectRatio,
300
+ showBadge,
301
+ showFavorite,
302
+ padding,
303
+ itemTitleColor,
304
+ itemTitleSize,
305
+ descriptionColor,
306
+ descriptionSize,
307
+ priceColor,
308
+ priceSize,
309
+ originalPriceColor,
310
+ metaTextColor,
311
+ metaTextSize,
312
+ numberColor,
313
+ numberSize,
314
+ showMetaText
315
+ }) {
316
+ const scrollContainerRef = react.useRef(null);
317
+ const scrollByAmount = (direction) => {
318
+ const container = scrollContainerRef.current;
319
+ if (!container) return;
320
+ const computedGap = parseFloat(getComputedStyle(container).gap) || 0;
321
+ const scrollAmount = SCROLL_ITEM_WIDTH + computedGap;
322
+ container.scrollTo({
323
+ left: container.scrollLeft + (direction === "next" ? scrollAmount : -scrollAmount),
324
+ behavior: "smooth"
325
+ });
326
+ };
327
+ const contentProps = {
328
+ padding,
329
+ itemTitleColor,
330
+ itemTitleSize,
331
+ descriptionColor,
332
+ descriptionSize,
333
+ priceColor,
334
+ priceSize,
335
+ originalPriceColor,
336
+ metaTextColor,
337
+ metaTextSize,
338
+ showMetaText
339
+ };
340
+ if (scrollAxis === "horizontal") {
341
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
342
+ /* @__PURE__ */ jsxRuntime.jsx(
343
+ "div",
344
+ {
345
+ ref: scrollContainerRef,
346
+ className: `flex gap-${chunkCM7D7WGL_cjs.gapValues[gap]} scrollbar-hide overflow-x-auto scroll-smooth`,
347
+ children: items.map((item, index) => {
348
+ const imageUrl = getImageUrl2(item);
349
+ const aspectRatioClass = getAspectRatioClass2(imageAspectRatio);
350
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-[300px] flex-shrink-0", children: [
351
+ /* @__PURE__ */ jsxRuntime.jsx(
352
+ "div",
353
+ {
354
+ className: `absolute top-0 left-0 text-${numberColor} z-0 leading-none font-bold opacity-20`,
355
+ style: { fontSize: largeNumberSizes[numberSize] },
356
+ children: index + 1
357
+ }
358
+ ),
359
+ /* @__PURE__ */ jsxRuntime.jsxs(
360
+ "div",
361
+ {
362
+ className: `relative z-10 ml-20 rounded-${borderRadius} overflow-hidden bg-background shadow-sm transition-shadow hover:shadow-md`,
363
+ children: [
364
+ showBadge && item.discount && /* @__PURE__ */ jsxRuntime.jsx(DiscountBadge, { discount: item.discount }),
365
+ showFavorite && /* @__PURE__ */ jsxRuntime.jsx(FavoriteButton, {}),
366
+ imageUrl && /* @__PURE__ */ jsxRuntime.jsx(
367
+ "div",
368
+ {
369
+ className: `w-full ${aspectRatioClass} overflow-hidden`,
370
+ children: /* @__PURE__ */ jsxRuntime.jsx(
371
+ "img",
372
+ {
373
+ src: imageUrl,
374
+ alt: item.title || "Product",
375
+ className: "h-full w-full object-cover"
376
+ }
377
+ )
378
+ }
379
+ ),
380
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemCardContent, { item, ...contentProps })
381
+ ]
382
+ }
383
+ )
384
+ ] }, item.id);
385
+ })
386
+ }
387
+ ),
388
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-x-0 top-1/2 z-20 flex w-full -translate-y-1/2 items-center justify-between px-8", children: /* @__PURE__ */ jsxRuntime.jsx(
389
+ chunkQV3OAAEQ_cjs.ScrollArrows,
390
+ {
391
+ onPrevious: () => scrollByAmount("prev"),
392
+ onNext: () => scrollByAmount("next")
393
+ }
394
+ ) })
395
+ ] });
396
+ }
397
+ if (scrollAxis === "vertical") {
398
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex flex-col gap-${chunkCM7D7WGL_cjs.gapValues[gap]}`, children: items.map((item, index) => {
399
+ const imageUrl = getImageUrl2(item);
400
+ return /* @__PURE__ */ jsxRuntime.jsxs(
401
+ "div",
402
+ {
403
+ className: `relative flex gap-${chunkCM7D7WGL_cjs.gapValues[gap]} rounded-${borderRadius} overflow-hidden bg-background shadow-sm transition-shadow hover:shadow-md ${`p-${padding}`}`,
404
+ children: [
405
+ /* @__PURE__ */ jsxRuntime.jsx(
406
+ "div",
407
+ {
408
+ className: `flex-shrink-0 text-${numberColor} text-${numberSize === "md" ? "base" : numberSize} flex w-16 items-center justify-center font-bold`,
409
+ children: index + 1
410
+ }
411
+ ),
412
+ imageUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 w-24 flex-shrink-0 overflow-hidden rounded-md", children: /* @__PURE__ */ jsxRuntime.jsx(
413
+ "img",
414
+ {
415
+ src: imageUrl,
416
+ alt: item.title || "Product",
417
+ className: "h-full w-full object-cover"
418
+ }
419
+ ) }),
420
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(ListItemCardContent, { item, ...contentProps }) }),
421
+ showBadge && item.discount && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-2 right-2 rounded-md bg-destructive px-2 py-1 text-xs font-bold text-destructive-foreground", children: getStringValue(item.discount) }),
422
+ showFavorite && /* @__PURE__ */ jsxRuntime.jsx(FavoriteButton, { className: "absolute top-2 right-12 rounded-full bg-background/80 p-2 backdrop-blur-sm transition-colors hover:bg-background" })
423
+ ]
424
+ },
425
+ item.id
426
+ );
427
+ }) });
428
+ }
429
+ return null;
430
+ }
431
+ var DEFAULT_ITEMS = [];
432
+ function getFeaturedAssetUrl(value) {
433
+ if (!value) return void 0;
434
+ if (typeof value === "string") {
435
+ const isVideo = /\.(mp4|webm|ogg|mov)$/i.test(value);
436
+ return { url: value, isVideo };
437
+ }
438
+ if (typeof value === "object") {
439
+ const videoUrl = value.videoUrl || value.video_url || value.url;
440
+ if (videoUrl && /\.(mp4|webm|ogg|mov)$/i.test(videoUrl)) {
441
+ return { url: videoUrl, isVideo: true };
442
+ }
443
+ const imageUrl = value.imageUrl || value.image_url || value.url;
444
+ if (imageUrl) {
445
+ return { url: imageUrl, isVideo: false };
446
+ }
447
+ }
448
+ return void 0;
449
+ }
82
450
  function ListWidget({
83
451
  listType = "unordered",
84
452
  scrollAxis = "horizontal",
@@ -119,403 +487,25 @@ function ListWidget({
119
487
  className,
120
488
  ...props
121
489
  }) {
122
- const scrollContainerRef = react.useRef(null);
123
490
  const displayItems = maxItems ? items.slice(0, maxItems) : items;
124
491
  const hasItems = displayItems.length > 0;
125
- const largeNumberSizes = {
126
- xs: "8rem",
127
- sm: "10rem",
128
- md: "12rem",
129
- lg: "14rem",
130
- xl: "16rem",
131
- "2xl": "20rem"
132
- };
133
- const scrollByAmount = (direction) => {
134
- const container = scrollContainerRef.current;
135
- if (!container) return;
136
- const computedGap = parseFloat(getComputedStyle(container).gap) || 0;
137
- const scrollAmount = SCROLL_ITEM_WIDTH + computedGap;
138
- container.scrollTo({
139
- left: container.scrollLeft + (direction === "next" ? scrollAmount : -scrollAmount),
140
- behavior: "smooth"
141
- });
142
- };
143
- const renderFeaturedSection = () => {
144
- if (!showFeaturedSection) return null;
145
- const asset = getFeaturedAssetUrl(featuredAsset);
146
- if (!asset) return null;
147
- return /* @__PURE__ */ jsxRuntime.jsxs(
148
- "div",
149
- {
150
- className: `relative h-full min-h-[300px] w-full overflow-hidden rounded-${borderRadius}`,
151
- children: [
152
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
153
- chunkLOXFR6XC_cjs.MediaRenderer,
154
- {
155
- src: asset.url,
156
- mediaType: asset.isVideo ? "video" : "image",
157
- alt: featuredTitle || "Featured",
158
- objectFit: "cover",
159
- autoplay: asset.isVideo,
160
- loop: asset.isVideo,
161
- muted: asset.isVideo,
162
- controls: false
163
- }
164
- ) }),
165
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-black/40" }),
166
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col items-start justify-end p-8", children: [
167
- featuredTitle && /* @__PURE__ */ jsxRuntime.jsx(
168
- "h3",
169
- {
170
- className: `mb-2 font-bold text-white text-${titleSize === "md" ? "base" : titleSize}`,
171
- children: featuredTitle
172
- }
173
- ),
174
- featuredSubtitle && /* @__PURE__ */ jsxRuntime.jsx(
175
- "p",
176
- {
177
- className: `mb-4 text-${featuredSubtitleColor} text-${featuredSubtitleSize === "md" ? "base" : featuredSubtitleSize}`,
178
- children: featuredSubtitle
179
- }
180
- ),
181
- featuredButtonText && /* @__PURE__ */ jsxRuntime.jsx(
182
- "a",
183
- {
184
- href: featuredButtonUrl || "#",
185
- className: `bg-white px-6 py-2 font-medium text-foreground transition-opacity hover:opacity-90 rounded-${borderRadius}`,
186
- children: featuredButtonText
187
- }
188
- )
189
- ] })
190
- ]
191
- }
192
- );
193
- };
194
- const renderUnorderedList = () => {
195
- const gridClass = getResponsiveGridClass(columns);
196
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid ${gridClass} gap-${chunkCM7D7WGL_cjs.gapValues[gap]}`, children: displayItems.map((item) => {
197
- const imageUrl = getImageUrl(item);
198
- const aspectRatioClass = getAspectRatioClass(imageAspectRatio);
199
- return /* @__PURE__ */ jsxRuntime.jsxs(
200
- "div",
201
- {
202
- className: `relative rounded-${borderRadius} overflow-hidden bg-background shadow-sm transition-shadow hover:shadow-md`,
203
- children: [
204
- showBadge && item.discount && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-2 right-2 z-10 rounded-md bg-destructive px-2 py-1 text-xs font-bold text-destructive-foreground", children: getStringValue(item.discount) }),
205
- showFavorite && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "absolute top-2 left-2 z-10 rounded-full bg-background/80 p-2 backdrop-blur-sm transition-colors hover:bg-background", children: /* @__PURE__ */ jsxRuntime.jsx(
206
- "svg",
207
- {
208
- className: "h-5 w-5 text-muted-foreground",
209
- fill: "none",
210
- stroke: "currentColor",
211
- viewBox: "0 0 24 24",
212
- children: /* @__PURE__ */ jsxRuntime.jsx(
213
- "path",
214
- {
215
- strokeLinecap: "round",
216
- strokeLinejoin: "round",
217
- strokeWidth: 2,
218
- d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
219
- }
220
- )
221
- }
222
- ) }),
223
- imageUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-full ${aspectRatioClass} overflow-hidden`, children: /* @__PURE__ */ jsxRuntime.jsx(
224
- "img",
225
- {
226
- src: imageUrl,
227
- alt: item.title || "Product",
228
- className: "h-full w-full object-cover"
229
- }
230
- ) }),
231
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `p-${padding}`, children: [
232
- item.title && /* @__PURE__ */ jsxRuntime.jsx(
233
- "h3",
234
- {
235
- className: `text-${itemTitleColor} text-${itemTitleSize === "md" ? "base" : itemTitleSize} mb-1 font-semibold`,
236
- children: getTextContent(item.title)
237
- }
238
- ),
239
- item.description && /* @__PURE__ */ jsxRuntime.jsx(
240
- "p",
241
- {
242
- className: `text-${descriptionColor} text-${descriptionSize === "md" ? "base" : descriptionSize} mb-2`,
243
- children: getTextContent(item.description)
244
- }
245
- ),
246
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
247
- item.price && /* @__PURE__ */ jsxRuntime.jsx(
248
- "span",
249
- {
250
- className: `text-${priceColor} text-${priceSize === "md" ? "base" : priceSize} font-bold`,
251
- children: getStringValue(item.price)
252
- }
253
- ),
254
- item.originalPrice && /* @__PURE__ */ jsxRuntime.jsx(
255
- "span",
256
- {
257
- className: `text-${originalPriceColor} text-${descriptionSize === "md" ? "base" : descriptionSize} line-through`,
258
- children: getStringValue(item.originalPrice)
259
- }
260
- )
261
- ] }),
262
- showMetaText && (item.qv || item.cv) && /* @__PURE__ */ jsxRuntime.jsxs(
263
- "div",
264
- {
265
- className: `mt-2 flex gap-3 text-${metaTextColor} text-${metaTextSize === "md" ? "base" : metaTextSize}`,
266
- children: [
267
- item.qv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
268
- "QV: ",
269
- getStringValue(item.qv)
270
- ] }),
271
- item.cv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
272
- "CV: ",
273
- getStringValue(item.cv)
274
- ] })
275
- ]
276
- }
277
- )
278
- ] })
279
- ]
280
- },
281
- item.id
282
- );
283
- }) });
284
- };
285
- const renderOrderedList = () => {
286
- const isHorizontal = scrollAxis === "horizontal";
287
- const isVertical = scrollAxis === "vertical";
288
- if (isHorizontal) {
289
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
290
- /* @__PURE__ */ jsxRuntime.jsx(
291
- "div",
292
- {
293
- ref: scrollContainerRef,
294
- className: `flex gap-${chunkCM7D7WGL_cjs.gapValues[gap]} scrollbar-hide overflow-x-auto scroll-smooth`,
295
- children: displayItems.map((item, index) => {
296
- const imageUrl = getImageUrl(item);
297
- const aspectRatioClass = getAspectRatioClass(imageAspectRatio);
298
- return /* @__PURE__ */ jsxRuntime.jsxs(
299
- "div",
300
- {
301
- className: `relative w-[300px] flex-shrink-0`,
302
- children: [
303
- /* @__PURE__ */ jsxRuntime.jsx(
304
- "div",
305
- {
306
- className: `absolute top-0 left-0 text-${numberColor} z-0 leading-none font-bold opacity-20`,
307
- style: { fontSize: largeNumberSizes[numberSize] },
308
- children: index + 1
309
- }
310
- ),
311
- /* @__PURE__ */ jsxRuntime.jsxs(
312
- "div",
313
- {
314
- className: `relative z-10 ml-20 rounded-${borderRadius} overflow-hidden bg-background shadow-sm transition-shadow hover:shadow-md`,
315
- children: [
316
- showBadge && item.discount && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-2 right-2 z-10 rounded-md bg-destructive px-2 py-1 text-xs font-bold text-destructive-foreground", children: getStringValue(item.discount) }),
317
- showFavorite && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "absolute top-2 left-2 z-10 rounded-full bg-background/80 p-2 backdrop-blur-sm transition-colors hover:bg-background", children: /* @__PURE__ */ jsxRuntime.jsx(
318
- "svg",
319
- {
320
- className: "h-5 w-5 text-muted-foreground",
321
- fill: "none",
322
- stroke: "currentColor",
323
- viewBox: "0 0 24 24",
324
- children: /* @__PURE__ */ jsxRuntime.jsx(
325
- "path",
326
- {
327
- strokeLinecap: "round",
328
- strokeLinejoin: "round",
329
- strokeWidth: 2,
330
- d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
331
- }
332
- )
333
- }
334
- ) }),
335
- imageUrl && /* @__PURE__ */ jsxRuntime.jsx(
336
- "div",
337
- {
338
- className: `w-full ${aspectRatioClass} overflow-hidden`,
339
- children: /* @__PURE__ */ jsxRuntime.jsx(
340
- "img",
341
- {
342
- src: imageUrl,
343
- alt: item.title || "Product",
344
- className: "h-full w-full object-cover"
345
- }
346
- )
347
- }
348
- ),
349
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `p-${padding}`, children: [
350
- item.title && /* @__PURE__ */ jsxRuntime.jsx(
351
- "h3",
352
- {
353
- className: `text-${itemTitleColor} text-${itemTitleSize === "md" ? "base" : itemTitleSize} mb-1 font-semibold`,
354
- children: getTextContent(item.title)
355
- }
356
- ),
357
- item.description && /* @__PURE__ */ jsxRuntime.jsx(
358
- "p",
359
- {
360
- className: `text-${descriptionColor} text-${descriptionSize === "md" ? "base" : descriptionSize} mb-2`,
361
- children: getTextContent(item.description)
362
- }
363
- ),
364
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
365
- item.price && /* @__PURE__ */ jsxRuntime.jsx(
366
- "span",
367
- {
368
- className: `text-${priceColor} text-${priceSize === "md" ? "base" : priceSize} font-bold`,
369
- children: getStringValue(item.price)
370
- }
371
- ),
372
- item.originalPrice && /* @__PURE__ */ jsxRuntime.jsx(
373
- "span",
374
- {
375
- className: `text-${originalPriceColor} text-${descriptionSize === "md" ? "base" : descriptionSize} line-through`,
376
- children: getStringValue(item.originalPrice)
377
- }
378
- )
379
- ] }),
380
- showMetaText && (item.qv || item.cv) && /* @__PURE__ */ jsxRuntime.jsxs(
381
- "div",
382
- {
383
- className: `mt-2 flex gap-3 text-${metaTextColor} text-${metaTextSize === "md" ? "base" : metaTextSize}`,
384
- children: [
385
- item.qv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
386
- "QV: ",
387
- getStringValue(item.qv)
388
- ] }),
389
- item.cv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
390
- "CV: ",
391
- getStringValue(item.cv)
392
- ] })
393
- ]
394
- }
395
- )
396
- ] })
397
- ]
398
- }
399
- )
400
- ]
401
- },
402
- item.id
403
- );
404
- })
405
- }
406
- ),
407
- /* @__PURE__ */ jsxRuntime.jsx(
408
- "div",
409
- {
410
- className: `absolute inset-x-0 top-1/2 z-20 flex w-full -translate-y-1/2 items-center justify-between px-8`,
411
- children: /* @__PURE__ */ jsxRuntime.jsx(
412
- chunkQV3OAAEQ_cjs.ScrollArrows,
413
- {
414
- onPrevious: () => scrollByAmount("prev"),
415
- onNext: () => scrollByAmount("next")
416
- }
417
- )
418
- }
419
- )
420
- ] });
421
- }
422
- if (isVertical) {
423
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex flex-col gap-${chunkCM7D7WGL_cjs.gapValues[gap]}`, children: displayItems.map((item, index) => {
424
- const imageUrl = getImageUrl(item);
425
- return /* @__PURE__ */ jsxRuntime.jsxs(
426
- "div",
427
- {
428
- className: `relative flex gap-${chunkCM7D7WGL_cjs.gapValues[gap]} rounded-${borderRadius} overflow-hidden bg-background shadow-sm transition-shadow hover:shadow-md ${`p-${padding}`}`,
429
- children: [
430
- /* @__PURE__ */ jsxRuntime.jsx(
431
- "div",
432
- {
433
- className: `flex-shrink-0 text-${numberColor} text-${numberSize === "md" ? "base" : numberSize} flex w-16 items-center justify-center font-bold`,
434
- children: index + 1
435
- }
436
- ),
437
- imageUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 w-24 flex-shrink-0 overflow-hidden rounded-md", children: /* @__PURE__ */ jsxRuntime.jsx(
438
- "img",
439
- {
440
- src: imageUrl,
441
- alt: item.title || "Product",
442
- className: "h-full w-full object-cover"
443
- }
444
- ) }),
445
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
446
- item.title && /* @__PURE__ */ jsxRuntime.jsx(
447
- "h3",
448
- {
449
- className: `text-${itemTitleColor} text-${itemTitleSize === "md" ? "base" : itemTitleSize} mb-1 font-semibold`,
450
- children: getTextContent(item.title)
451
- }
452
- ),
453
- item.description && /* @__PURE__ */ jsxRuntime.jsx(
454
- "p",
455
- {
456
- className: `text-${descriptionColor} text-${descriptionSize === "md" ? "base" : descriptionSize} mb-2`,
457
- children: getTextContent(item.description)
458
- }
459
- ),
460
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
461
- item.price && /* @__PURE__ */ jsxRuntime.jsx(
462
- "span",
463
- {
464
- className: `text-${priceColor} text-${priceSize === "md" ? "base" : priceSize} font-bold`,
465
- children: getStringValue(item.price)
466
- }
467
- ),
468
- item.originalPrice && /* @__PURE__ */ jsxRuntime.jsx(
469
- "span",
470
- {
471
- className: `text-${originalPriceColor} text-${descriptionSize === "md" ? "base" : descriptionSize} line-through`,
472
- children: getStringValue(item.originalPrice)
473
- }
474
- )
475
- ] }),
476
- showMetaText && (item.qv || item.cv) && /* @__PURE__ */ jsxRuntime.jsxs(
477
- "div",
478
- {
479
- className: `mt-2 flex gap-3 text-${metaTextColor} text-${metaTextSize === "md" ? "base" : metaTextSize}`,
480
- children: [
481
- item.qv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
482
- "QV: ",
483
- getStringValue(item.qv)
484
- ] }),
485
- item.cv && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
486
- "CV: ",
487
- getStringValue(item.cv)
488
- ] })
489
- ]
490
- }
491
- )
492
- ] }),
493
- showBadge && item.discount && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-2 right-2 rounded-md bg-destructive px-2 py-1 text-xs font-bold text-destructive-foreground", children: getStringValue(item.discount) }),
494
- showFavorite && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "absolute top-2 right-12 rounded-full bg-background/80 p-2 backdrop-blur-sm transition-colors hover:bg-background", children: /* @__PURE__ */ jsxRuntime.jsx(
495
- "svg",
496
- {
497
- className: "h-5 w-5 text-muted-foreground",
498
- fill: "none",
499
- stroke: "currentColor",
500
- viewBox: "0 0 24 24",
501
- children: /* @__PURE__ */ jsxRuntime.jsx(
502
- "path",
503
- {
504
- strokeLinecap: "round",
505
- strokeLinejoin: "round",
506
- strokeWidth: 2,
507
- d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
508
- }
509
- )
510
- }
511
- ) })
512
- ]
513
- },
514
- item.id
515
- );
516
- }) });
517
- }
518
- return null;
492
+ const itemStyleProps = {
493
+ padding,
494
+ itemTitleColor,
495
+ itemTitleSize,
496
+ descriptionColor,
497
+ descriptionSize,
498
+ priceColor,
499
+ priceSize,
500
+ originalPriceColor,
501
+ metaTextColor,
502
+ metaTextSize,
503
+ showMetaText,
504
+ showBadge,
505
+ showFavorite,
506
+ borderRadius,
507
+ imageAspectRatio,
508
+ gap
519
509
  };
520
510
  const hasFeaturedAsset = getFeaturedAssetUrl(featuredAsset);
521
511
  const shouldShowFeaturedSection = showFeaturedSection && hasFeaturedAsset;
@@ -536,9 +526,54 @@ function ListWidget({
536
526
  }
537
527
  ),
538
528
  !hasItems ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center rounded-md border-2 border-dashed border-border bg-muted py-12 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted", children: "No items to display" }) }) : shouldShowFeaturedSection ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 @lg:flex-row @lg:gap-6", children: [
539
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full @lg:w-[45%]", children: renderFeaturedSection() }),
540
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full @lg:w-[55%]", children: listType === "unordered" ? renderUnorderedList() : renderOrderedList() })
541
- ] }) : listType === "unordered" ? renderUnorderedList() : renderOrderedList()
529
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full @lg:w-[45%]", children: /* @__PURE__ */ jsxRuntime.jsx(
530
+ FeaturedSection,
531
+ {
532
+ borderRadius,
533
+ titleSize,
534
+ featuredTitle,
535
+ featuredSubtitle,
536
+ featuredButtonText,
537
+ featuredButtonUrl,
538
+ featuredSubtitleColor,
539
+ featuredSubtitleSize,
540
+ asset: hasFeaturedAsset
541
+ }
542
+ ) }),
543
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full @lg:w-[55%]", children: listType === "unordered" ? /* @__PURE__ */ jsxRuntime.jsx(
544
+ UnorderedList,
545
+ {
546
+ items: displayItems,
547
+ columns,
548
+ ...itemStyleProps
549
+ }
550
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
551
+ OrderedList,
552
+ {
553
+ items: displayItems,
554
+ scrollAxis,
555
+ numberColor,
556
+ numberSize,
557
+ ...itemStyleProps
558
+ }
559
+ ) })
560
+ ] }) : listType === "unordered" ? /* @__PURE__ */ jsxRuntime.jsx(
561
+ UnorderedList,
562
+ {
563
+ items: displayItems,
564
+ columns,
565
+ ...itemStyleProps
566
+ }
567
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
568
+ OrderedList,
569
+ {
570
+ items: displayItems,
571
+ scrollAxis,
572
+ numberColor,
573
+ numberSize,
574
+ ...itemStyleProps
575
+ }
576
+ )
542
577
  ]
543
578
  }
544
579
  );
@@ -951,5 +986,5 @@ var listWidgetPropertySchema = {
951
986
 
952
987
  exports.ListWidget = ListWidget;
953
988
  exports.listWidgetPropertySchema = listWidgetPropertySchema;
954
- //# sourceMappingURL=chunk-RPVMJLTN.cjs.map
955
- //# sourceMappingURL=chunk-RPVMJLTN.cjs.map
989
+ //# sourceMappingURL=chunk-BZQW7APC.cjs.map
990
+ //# sourceMappingURL=chunk-BZQW7APC.cjs.map