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