@jumpgroup/jump-design-system 0.3.88 → 0.3.90

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 (27) hide show
  1. package/dist/cjs/jump-card-ecommerce.cjs.entry.js +76 -5
  2. package/dist/cjs/jump-card-ecommerce.cjs.entry.js.map +1 -1
  3. package/dist/cjs/jump-design-system.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.css +60 -0
  7. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.js +153 -4
  8. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.js.map +1 -1
  9. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.stories.js +254 -3
  10. package/dist/collection/components/jump-card-ecommerce/jump-card-ecommerce.stories.js.map +1 -1
  11. package/dist/components/jump-card-ecommerce.js +81 -6
  12. package/dist/components/jump-card-ecommerce.js.map +1 -1
  13. package/dist/esm/jump-card-ecommerce.entry.js +76 -5
  14. package/dist/esm/jump-card-ecommerce.entry.js.map +1 -1
  15. package/dist/esm/jump-design-system.js +1 -1
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  18. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  19. package/dist/jump-design-system/p-45cd5f71.entry.js +2 -0
  20. package/dist/jump-design-system/p-45cd5f71.entry.js.map +1 -0
  21. package/dist/jump-design-system-elements.json +4 -0
  22. package/dist/types/components/jump-card-ecommerce/jump-card-ecommerce.d.ts +19 -2
  23. package/dist/types/components/jump-card-ecommerce/jump-card-ecommerce.stories.d.ts +12 -0
  24. package/dist/types/components.d.ts +22 -0
  25. package/package.json +1 -1
  26. package/dist/jump-design-system/p-2432fb64.entry.js +0 -2
  27. package/dist/jump-design-system/p-2432fb64.entry.js.map +0 -1
@@ -191,6 +191,12 @@ export default {
191
191
  options: ['cover', 'scale-down', 'contain', 'fill', 'none'],
192
192
  defaultValue: 'cover'
193
193
  },
194
+ autoSelectFirstVariation: {
195
+ name: 'auto-select-first-variation',
196
+ description: 'Indica se selezionare automaticamente la prima variazione disponibile',
197
+ control: 'boolean',
198
+ defaultValue: true
199
+ },
194
200
  }
195
201
  };
196
202
  const Template = (args) => {
@@ -231,6 +237,7 @@ Card.args = {
231
237
  isMini: false,
232
238
  enableZoom: false,
233
239
  imageObjectFit: 'cover',
240
+ autoSelectFirstVariation: true,
234
241
  };
235
242
  const TemplateWithEvent = (args, data) => {
236
243
  let id = data.id;
@@ -238,8 +245,9 @@ const TemplateWithEvent = (args, data) => {
238
245
  return formatHtml(`
239
246
  <jump-card-ecommerce ${attributes}>
240
247
 
241
- <jump-card-ecommerce-option code="size1" label="sono una select un pò lunga"></jump-card-ecommerce-option>
242
- <jump-card-ecommerce-option code="size2" label="L" sku="cod123"></jump-card-ecommerce-option>
248
+ <jump-card-ecommerce-option code="size1" label="sono una select un pò lunga" order="1"></jump-card-ecommerce-option>
249
+ <jump-card-ecommerce-option code="size2" label="L" sku="cod123" order="2"></jump-card-ecommerce-option>
250
+ <jump-card-ecommerce-option code="size3" label="XL" sku="cod124" order="3"></jump-card-ecommerce-option>
243
251
 
244
252
  <div slot="addtocart"><a href="">Sono un bottone dentro lo slot addotocart</a></div>
245
253
  </jump-card-ecommerce>
@@ -262,14 +270,16 @@ const TemplateWithEvent = (args, data) => {
262
270
  container.querySelector('jump-card-ecommerce').addEventListener( 'jump-add-to-cart', ev => {
263
271
  let productId = ev.detail.productId;
264
272
  let addedToCart = ev.detail.addedToCart;
273
+ let variation = ev.detail.variation;
265
274
  if(addedToCart){
266
275
  console.log( 'Prodotto ' + productId + ' aggiunto al carrello');
276
+ console.log( 'Variazione selezionata:', variation);
267
277
  }
268
278
  })
269
279
 
270
280
  container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {
271
281
  let variation = ev.detail;
272
- console.log('Variation selected', variation);
282
+ console.log('Variation selected automatically:', variation);
273
283
  });
274
284
 
275
285
  })();
@@ -305,6 +315,7 @@ CardEvent.args = {
305
315
  outOfStockText: 'Esaurito',
306
316
  waitingListText: 'Notifica disponibilità',
307
317
  isMini: true,
318
+ autoSelectFirstVariation: true,
308
319
  };
309
320
  const TemplateDisallowAllowCart = (args) => {
310
321
  const attributes = generateAttributesFromArgs(args);
@@ -349,4 +360,244 @@ CardDisallow.args = {
349
360
  // Storia per mostrare l'utilizzo della proprietà imageObjectFit
350
361
  export const CardWithScaleDown = Template.bind({});
351
362
  CardWithScaleDown.args = Object.assign(Object.assign({}, Card.args), { imageObjectFit: 'scale-down', img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', productName: 'Card con scale-down', subtitle: 'L\'immagine usa object-fit: scale-down' });
363
+ // Storia per mostrare la selezione automatica delle variazioni
364
+ const TemplateWithVariations = (args, data) => {
365
+ let id = data.id;
366
+ const attributes = generateAttributesFromArgs(args);
367
+ return formatHtml(`
368
+ <jump-card-ecommerce ${attributes}>
369
+ <jump-card-ecommerce-option code="s" label="Small (S)" order="1"></jump-card-ecommerce-option>
370
+ <jump-card-ecommerce-option code="m" label="Medium (M)" order="2"></jump-card-ecommerce-option>
371
+ <jump-card-ecommerce-option code="l" label="Large (L)" order="3"></jump-card-ecommerce-option>
372
+ <jump-card-ecommerce-option code="xl" label="Extra Large (XL)" order="4"></jump-card-ecommerce-option>
373
+
374
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
375
+ </jump-card-ecommerce>
376
+ <script>
377
+ (function() {
378
+ let container = document.querySelector('#story--${id}');
379
+ container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {
380
+ let variation = ev.detail;
381
+ console.log('Variazione selezionata automaticamente:', variation);
382
+ });
383
+ })();
384
+ </script>
385
+ `);
386
+ };
387
+ export const CardWithAutoSelection = TemplateWithVariations.bind({});
388
+ CardWithAutoSelection.args = Object.assign(Object.assign({}, Card.args), { productName: 'T-shirt con selezione automatica', subtitle: 'La prima variazione viene selezionata automaticamente', autoSelectFirstVariation: true });
389
+ export const CardWithoutAutoSelection = TemplateWithVariations.bind({});
390
+ CardWithoutAutoSelection.args = Object.assign(Object.assign({}, Card.args), { productName: 'T-shirt senza selezione automatica', subtitle: 'L\'utente deve selezionare manualmente la variazione', autoSelectFirstVariation: false });
391
+ export const CardArchiveGrid = () => formatHtml(`
392
+ <div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; max-width: 900px; margin: 0 auto;">
393
+ <jump-card-ecommerce
394
+ product-name="T-shirt Uomo"
395
+ subtitle="Cotone 100%"
396
+ has-favorite="true"
397
+ img="https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
398
+ img-alt="T-shirt Uomo"
399
+ price="15"
400
+ sale-price="10"
401
+ badge="In offerta"
402
+ badge-color="secondary"
403
+ add-to-cart-text="Aggiungi al carrello"
404
+ >
405
+ <jump-card-ecommerce-option code="s" label="Small (S)" order="1"></jump-card-ecommerce-option>
406
+ <jump-card-ecommerce-option code="m" label="Medium (M)" order="2"></jump-card-ecommerce-option>
407
+ <jump-card-ecommerce-option code="l" label="Large (L)" order="3"></jump-card-ecommerce-option>
408
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
409
+ </jump-card-ecommerce>
410
+ <jump-card-ecommerce
411
+ product-name="Felpa Donna"
412
+ subtitle="Felpa con cappuccio"
413
+ img="https://images.pexels.com/photos/532220/pexels-photo-532220.jpeg?auto=compress&cs=tinysrgb&w=800"
414
+ img-alt="Felpa Donna"
415
+ price="29"
416
+ badge="Novità"
417
+ badge-color="primary"
418
+ add-to-cart-text="Aggiungi al carrello"
419
+ >
420
+ <jump-card-ecommerce-option code="xs" label="XS" order="1"></jump-card-ecommerce-option>
421
+ <jump-card-ecommerce-option code="s" label="S" order="2"></jump-card-ecommerce-option>
422
+ <jump-card-ecommerce-option code="m" label="M" order="3"></jump-card-ecommerce-option>
423
+ <jump-card-ecommerce-option code="l" label="L" order="4"></jump-card-ecommerce-option>
424
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
425
+ </jump-card-ecommerce>
426
+ <jump-card-ecommerce
427
+ product-name="Jeans Slim"
428
+ subtitle="Denim elasticizzato"
429
+ img="https://images.pexels.com/photos/2983464/pexels-photo-2983464.jpeg?auto=compress&cs=tinysrgb&w=800"
430
+ img-alt="Jeans Slim"
431
+ price="49"
432
+ badge="Best Seller"
433
+ badge-color="success"
434
+ add-to-cart-text="Aggiungi al carrello"
435
+ >
436
+ <jump-card-ecommerce-option code="30" label="Taglia 30" order="1"></jump-card-ecommerce-option>
437
+ <jump-card-ecommerce-option code="32" label="Taglia 32" order="2"></jump-card-ecommerce-option>
438
+ <jump-card-ecommerce-option code="34" label="Taglia 34" order="3"></jump-card-ecommerce-option>
439
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
440
+ </jump-card-ecommerce>
441
+ <jump-card-ecommerce
442
+ product-name="Giacca Leggera"
443
+ subtitle="Primavera/Estate"
444
+ img="https://images.pexels.com/photos/532221/pexels-photo-532221.jpeg?auto=compress&cs=tinysrgb&w=800"
445
+ img-alt="Giacca Leggera"
446
+ price="59"
447
+ out-of-stock="true"
448
+ sale-price="45"
449
+ badge="Promo"
450
+ badge-color="danger"
451
+ add-to-cart-text="Aggiungi al carrello"
452
+ >
453
+ <jump-card-ecommerce-option code="m" label="M" order="1"></jump-card-ecommerce-option>
454
+ <jump-card-ecommerce-option code="l" label="L" order="2"></jump-card-ecommerce-option>
455
+ <jump-card-ecommerce-option code="xl" label="XL" order="3"></jump-card-ecommerce-option>
456
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
457
+ </jump-card-ecommerce>
458
+ <jump-card-ecommerce
459
+ has-background
460
+ product-name="T-shirt Uomo"
461
+ subtitle="Cotone 100%"
462
+ img="https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
463
+ img-alt="T-shirt Uomo"
464
+ price="15"
465
+ sale-price="10"
466
+ badge="In offerta"
467
+ badge-color="secondary"
468
+ add-to-cart-text="Aggiungi al carrello"
469
+ >
470
+ <jump-card-ecommerce-option code="s" label="Small (S)" order="1"></jump-card-ecommerce-option>
471
+ <jump-card-ecommerce-option code="m" label="Medium (M)" order="2"></jump-card-ecommerce-option>
472
+ <jump-card-ecommerce-option code="l" label="Large (L)" order="3"></jump-card-ecommerce-option>
473
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
474
+ </jump-card-ecommerce>
475
+ <jump-card-ecommerce
476
+ has-background
477
+ product-name="Felpa Donna"
478
+ subtitle="Felpa con cappuccio"
479
+ img="https://images.pexels.com/photos/532220/pexels-photo-532220.jpeg?auto=compress&cs=tinysrgb&w=800"
480
+ img-alt="Felpa Donna"
481
+ price="29"
482
+ sale-price="25"
483
+ badge="Novità"
484
+ badge-color="primary"
485
+ add-to-cart-text="Aggiungi al carrello"
486
+ >
487
+ <jump-card-ecommerce-option code="xs" label="XS" order="1"></jump-card-ecommerce-option>
488
+ <jump-card-ecommerce-option code="s" label="S" order="2"></jump-card-ecommerce-option>
489
+ <jump-card-ecommerce-option code="m" label="M" order="3"></jump-card-ecommerce-option>
490
+ <jump-card-ecommerce-option code="l" label="L" order="4"></jump-card-ecommerce-option>
491
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
492
+ </jump-card-ecommerce>
493
+ <jump-card-ecommerce
494
+ has-background
495
+ product-name="Jeans Slim"
496
+ subtitle="Denim elasticizzato"
497
+ img="https://images.pexels.com/photos/2983464/pexels-photo-2983464.jpeg?auto=compress&cs=tinysrgb&w=800"
498
+ img-alt="Jeans Slim"
499
+ price="49"
500
+ badge="Best Seller"
501
+ badge-color="success"
502
+ add-to-cart-text="Aggiungi al carrello"
503
+ enable-zoom
504
+ >
505
+ <jump-card-ecommerce-option code="30" label="Taglia 30" order="1"></jump-card-ecommerce-option>
506
+ <jump-card-ecommerce-option code="32" label="Taglia 32" order="2"></jump-card-ecommerce-option>
507
+ <jump-card-ecommerce-option code="34" label="Taglia 34" order="3"></jump-card-ecommerce-option>
508
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
509
+ </jump-card-ecommerce>
510
+ <jump-card-ecommerce
511
+ has-background
512
+ product-name="Giacca Leggera"
513
+ subtitle="Primavera/Estate"
514
+ img="https://images.pexels.com/photos/532221/pexels-photo-532221.jpeg?auto=compress&cs=tinysrgb&w=800"
515
+ img-alt="Giacca Leggera"
516
+ price="59"
517
+ sale-price="45"
518
+ badge="Promo"
519
+ badge-color="danger"
520
+ add-to-cart-text="Aggiungi al carrello"
521
+ enable-zoom
522
+ >
523
+ <jump-card-ecommerce-option code="m" label="M" order="1"></jump-card-ecommerce-option>
524
+ <jump-card-ecommerce-option code="l" label="L" order="2"></jump-card-ecommerce-option>
525
+ <jump-card-ecommerce-option code="xl" label="XL" order="3"></jump-card-ecommerce-option>
526
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
527
+ </jump-card-ecommerce>
528
+ <jump-card-ecommerce
529
+ has-background
530
+ product-name="T-shirt Uomo"
531
+ subtitle="Cotone 100%"
532
+ img="https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
533
+ img-alt="T-shirt Uomo"
534
+ price="15"
535
+ sale-price="10"
536
+ badge="In offerta"
537
+ badge-color="secondary"
538
+ add-to-cart-text="Aggiungi al carrello"
539
+ enable-zoom
540
+ >
541
+ <jump-card-ecommerce-option code="s" label="Small (S)" order="1"></jump-card-ecommerce-option>
542
+ <jump-card-ecommerce-option code="m" label="Medium (M)" order="2"></jump-card-ecommerce-option>
543
+ <jump-card-ecommerce-option code="l" label="Large (L)" order="3"></jump-card-ecommerce-option>
544
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
545
+ </jump-card-ecommerce>
546
+ <jump-card-ecommerce
547
+ has-background
548
+ product-name="Felpa Donna"
549
+ subtitle="Felpa con cappuccio"
550
+ img="https://images.pexels.com/photos/532220/pexels-photo-532220.jpeg?auto=compress&cs=tinysrgb&w=800"
551
+ img-alt="Felpa Donna"
552
+ price="29"
553
+ sale-price="25"
554
+ badge="Novità"
555
+ badge-color="primary"
556
+ add-to-cart-text="Aggiungi al carrello"
557
+ enable-zoom
558
+ >
559
+ <jump-card-ecommerce-option code="xs" label="XS" order="1"></jump-card-ecommerce-option>
560
+ <jump-card-ecommerce-option code="s" label="S" order="2"></jump-card-ecommerce-option>
561
+ <jump-card-ecommerce-option code="m" label="M" order="3"></jump-card-ecommerce-option>
562
+ <jump-card-ecommerce-option code="l" label="L" order="4"></jump-card-ecommerce-option>
563
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
564
+ </jump-card-ecommerce>
565
+ <jump-card-ecommerce
566
+ has-background
567
+ product-name="Jeans Slim"
568
+ subtitle="Denim elasticizzato"
569
+ img="https://images.pexels.com/photos/2983464/pexels-photo-2983464.jpeg?auto=compress&cs=tinysrgb&w=800"
570
+ img-alt="Jeans Slim"
571
+ price="49"
572
+ badge="Best Seller"
573
+ badge-color="success"
574
+ add-to-cart-text="Aggiungi al carrello"
575
+ enable-zoom
576
+ >
577
+ <jump-card-ecommerce-option code="30" label="Taglia 30" order="1"></jump-card-ecommerce-option>
578
+ <jump-card-ecommerce-option code="32" label="Taglia 32" order="2"></jump-card-ecommerce-option>
579
+ <jump-card-ecommerce-option code="34" label="Taglia 34" order="3"></jump-card-ecommerce-option>
580
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
581
+ </jump-card-ecommerce>
582
+ <jump-card-ecommerce
583
+ has-background
584
+ product-name="Giacca Leggera"
585
+ subtitle="Primavera/Estate"
586
+ img="https://images.pexels.com/photos/532221/pexels-photo-532221.jpeg?auto=compress&cs=tinysrgb&w=800"
587
+ img-alt="Giacca Leggera"
588
+ price="59"
589
+ sale-price="45"
590
+ badge="Promo"
591
+ badge-color="danger"
592
+ add-to-cart-text="Aggiungi al carrello"
593
+ enable-zoom
594
+ >
595
+ <jump-card-ecommerce-option code="m" label="M" order="1"></jump-card-ecommerce-option>
596
+ <jump-card-ecommerce-option code="l" label="L" order="2"></jump-card-ecommerce-option>
597
+ <jump-card-ecommerce-option code="xl" label="XL" order="3"></jump-card-ecommerce-option>
598
+ <jump-quantity slot="quantity" min="1" max="10" value="1"></jump-quantity>
599
+ </jump-card-ecommerce>
600
+ </div>
601
+ `);
602
+ CardArchiveGrid.storyName = 'Archivio (Grid X colonne con variazioni e quantità)';
352
603
  //# sourceMappingURL=jump-card-ecommerce.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jump-card-ecommerce.stories.js","sourceRoot":"","sources":["../../../src/components/jump-card-ecommerce/jump-card-ecommerce.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE,SAAS;SACnB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,4DAA4D;YACzE,OAAO,EAAE,SAAS;SACnB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,kBAAkB;YAC/B,OAAO,EAAE,MAAM;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE,SAAS;SACnB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,cAAc;YACp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WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,sBAAsB;IACrC,cAAc,EAAE,WAAW;IAC3B,gBAAgB,EAAE,KAAK;IACvB,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,UAAU;IAC1B,eAAe,EAAE,wBAAwB;IACzC,MAAM,EAAE,KAAK;IACb,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnD,iBAAiB,CAAC,IAAI,mCACjB,IAAI,CAAC,IAAI,KACZ,cAAc,EAAE,YAAY,EAC5B,GAAG,EAAE,iHAAiH,EACtH,WAAW,EAAE,qBAAqB,EAClC,QAAQ,EAAE,wCAAwC,GACnD,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/CardEcommerce/Card',\n tags: ['autodocs'],\n argTypes: {\n hasBackground: {\n name: 'has-background',\n description: 'Aggiungi o meno il background alla card',\n control: 'boolean',\n },\n onlyIconButton: {\n name: 'only-icon-button',\n description: 'Cambia lo stile della card mostrando solo il bottone icona',\n control: 'boolean',\n },\n badge: {\n name: 'badge',\n description: 'Badge della card',\n control: 'text',\n },\n favorite: {\n name: 'favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasFavorite: {\n name: 'has-favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasSlotForFavorite: {\n name: 'has-slot-for-favorite',\n description: 'Di default la card ecommerce ha un bottone icona per il favorite che emette un evento; Se hasSlotForFavorite è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: true,\n },\n link: {\n name: 'link',\n description: 'Link della card',\n control: 'text',\n },\n img: {\n name: 'img',\n description: 'Url dell\\'immagine da visualizzare, si attiva solo se non è presente video-src',\n control: 'text',\n defaultValue: 'https://content-management-files.canva.com/cdn-cgi/image/f=auto,q=70/2fdbd7ab-f378-4c63-8b21-c944ad2633fd/header_t-shirts2.jpg',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n imgAlt: {\n name: 'img-alt',\n description: 'Alt dell\\'immagine da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n hoverImg: {\n name: 'hover-img',\n description: 'Url dell\\'immagine in hover da visualizzare, si attiva solo se non è presente videoSrc',\n control: 'text',\n defaultValue: 'https://ch.benetton.com/dw/image/v2/BBSF_PRD/on/demandware.static/-/Sites-ucb-master/default/dwf2799586/images/Full_Card_v/UCB-Bambino_24P_3096C10JA_0Z3_FS_Full_Card_v.jpg?sw=600&sh=800',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n hoverImgAlt: {\n name: 'hover-img-alt',\n description: 'Alt dell\\'immagine in hover da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n videoSrc: {\n name: 'video-src',\n description: 'Url del video da visualizzare, si attiva solo se non è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: false\n }\n },\n notificationUrl: {\n name: 'notification-url',\n description: 'Url della notifica da visualizzare',\n control: 'text',\n },\n notificationText: {\n name: 'notification-text',\n description: 'Testo della notifica da visualizzare',\n control: 'text',\n },\n productName: {\n name: 'product-name',\n description: 'Nome del prodotto',\n control: 'text',\n },\n subtitle: {\n name: 'subtitle',\n description: 'Sottotitolo della card',\n control: 'text',\n },\n productId: {\n name: 'product-id',\n description: 'ID del prodotto',\n control: 'text',\n },\n price: {\n name: 'price',\n description: 'Prezzo del prodotto; Se la card è in versione Mini gli va passato il prezzo scontato',\n control: 'number',\n },\n salePrice: {\n name: 'sale-price',\n description: 'Prezzo scontato del prodotto',\n control: 'number',\n },\n addToCartText: {\n name: 'add-to-cart-text',\n description: 'Testo bottone aggiungi al carrello',\n control: 'text',\n },\n addToCartColor: {\n name: 'add-to-cart-color',\n description: 'Colore del bottone aggiungi al carrello',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'white'\n ],\n },\n hasSlotAddToCart: {\n name: 'has-slot-add-to-cart',\n description: 'Di default la card ecommerce ha un bottone per l\\'aggiunta al carrello; Se has-slot-add-to-cart è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: false,\n },\n badgeColor: {\n name: 'badge-color',\n description: 'Colore del badge',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'warning',\n 'success',\n 'danger',\n ],\n },\n outOfStock: {\n name: 'out-of-stock',\n description: 'Indica se il prodotto è esaurito',\n control: 'boolean',\n defaultValue: false\n },\n outOfStockText: {\n name: 'out-of-stock-text',\n description: 'Testo da visualizzare se il prodotto è esaurito',\n control: 'text',\n },\n waitingListText: {\n name: 'waiting-list-text',\n description: 'cta per richiedere l\\'avviso se il prodotto torna disponibile',\n control: 'text',\n },\n isMini: {\n name: 'is-mini',\n description: 'Indica se la card è di dimensioni ridotte',\n control: 'boolean',\n defaultValue: false\n },\n enableZoom: {\n name: 'enable-zoom',\n description: 'Indica se è attivo lo zoom all\\'hover',\n control: 'boolean',\n defaultValue: false\n },\n imageObjectFit: {\n name: 'image-object-fit',\n description: 'Controlla il comportamento dell\\'object-fit delle immagini',\n control: 'select',\n options: ['cover', 'scale-down', 'contain', 'fill', 'none'],\n defaultValue: 'cover'\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const Card = Template.bind({});\nCard.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n enableZoom: false,\n imageObjectFit: 'cover',\n};\n\nconst TemplateWithEvent = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n\n <jump-card-ecommerce-option code=\"size1\" label=\"sono una select un pò lunga\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"size2\" label=\"L\" sku=\"cod123\"></jump-card-ecommerce-option>\n\n <div slot=\"addtocart\"><a href=\"\">Sono un bottone dentro lo slot addotocart</a></div>\n </jump-card-ecommerce>\n <script>\n\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-toggle-favorite', ev => {\n let productId = ev.detail.productId;\n let favorite = ev.detail.favorite;\n if(favorite){\n console.log( 'Prodotto ' + productId + ' aggiunto ai preferiti');\n } else {\n console.log( 'Prodotto ' + productId + ' rimosso dai preferiti');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-add-to-cart', ev => {\n let productId = ev.detail.productId;\n let addedToCart = ev.detail.addedToCart;\n if(addedToCart){\n console.log( 'Prodotto ' + productId + ' aggiunto al carrello');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {\n let variation = ev.detail;\n console.log('Variation selected', variation);\n });\n\n })();\n\n </script>\n ` );\n}\n\nexport const CardEvent = TemplateWithEvent.bind({});\nCardEvent.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n hasFavorite: false,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n currency: '€',\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'primary',\n hasSlotAddToCart: false,\n badgeColor: 'primary',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: true,\n};\n\nconst TemplateDisallowAllowCart = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const CardWithZoom = Template.bind({});\nCardWithZoom.args = {\n ...Card.args,\n enableZoom: true,\n hoverImg: '',\n hoverImgAlt: '',\n};\n\nexport const CardDisallow = TemplateDisallowAllowCart.bind({});\nCardDisallow.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n disallowAddToCart: true,\n};\n\n// Storia per mostrare l'utilizzo della proprietà imageObjectFit\nexport const CardWithScaleDown = Template.bind({});\nCardWithScaleDown.args = {\n ...Card.args,\n imageObjectFit: 'scale-down',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n productName: 'Card con scale-down',\n subtitle: 'L\\'immagine usa object-fit: scale-down'\n};"]}
1
+ {"version":3,"file":"jump-card-ecommerce.stories.js","sourceRoot":"","sources":["../../../src/components/jump-card-ecommerce/jump-card-ecommerce.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,yCAAyC;YACtD,OAAO,EAAE,SAAS;SACnB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,4DAA4D;YACzE,OAAO,EAAE,SAAS;SACnB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,kBAAkB;YAC/B,OAAO,EAAE,MAAM;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE,S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,CAAC,EAAE,CAAC,CAAC;AACrE,qBAAqB,CAAC,IAAI,mCACrB,IAAI,CAAC,IAAI,KACZ,WAAW,EAAE,kCAAkC,EAC/C,QAAQ,EAAE,uDAAuD,EACjE,wBAAwB,EAAE,IAAI,GAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE,wBAAwB,CAAC,IAAI,mCACxB,IAAI,CAAC,IAAI,KACZ,WAAW,EAAE,oCAAoC,EACjD,QAAQ,EAAE,sDAAsD,EAChE,wBAAwB,EAAE,KAAK,GAChC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkN/C,CAAC,CAAC;AACH,eAAe,CAAC,SAAS,GAAG,qDAAqD,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/CardEcommerce/Card',\n tags: ['autodocs'],\n argTypes: {\n hasBackground: {\n name: 'has-background',\n description: 'Aggiungi o meno il background alla card',\n control: 'boolean',\n },\n onlyIconButton: {\n name: 'only-icon-button',\n description: 'Cambia lo stile della card mostrando solo il bottone icona',\n control: 'boolean',\n },\n badge: {\n name: 'badge',\n description: 'Badge della card',\n control: 'text',\n },\n favorite: {\n name: 'favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasFavorite: {\n name: 'has-favorite',\n description: 'Aggiunge il prodotto ai preferiti',\n control: 'boolean',\n },\n hasSlotForFavorite: {\n name: 'has-slot-for-favorite',\n description: 'Di default la card ecommerce ha un bottone icona per il favorite che emette un evento; Se hasSlotForFavorite è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: true,\n },\n link: {\n name: 'link',\n description: 'Link della card',\n control: 'text',\n },\n img: {\n name: 'img',\n description: 'Url dell\\'immagine da visualizzare, si attiva solo se non è presente video-src',\n control: 'text',\n defaultValue: 'https://content-management-files.canva.com/cdn-cgi/image/f=auto,q=70/2fdbd7ab-f378-4c63-8b21-c944ad2633fd/header_t-shirts2.jpg',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n imgAlt: {\n name: 'img-alt',\n description: 'Alt dell\\'immagine da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n hoverImg: {\n name: 'hover-img',\n description: 'Url dell\\'immagine in hover da visualizzare, si attiva solo se non è presente videoSrc',\n control: 'text',\n defaultValue: 'https://ch.benetton.com/dw/image/v2/BBSF_PRD/on/demandware.static/-/Sites-ucb-master/default/dwf2799586/images/Full_Card_v/UCB-Bambino_24P_3096C10JA_0Z3_FS_Full_Card_v.jpg?sw=600&sh=800',\n if:{\n arg: 'videoSrc',\n exists: false\n }\n },\n hoverImgAlt: {\n name: 'hover-img-alt',\n description: 'Alt dell\\'immagine in hover da visualizzare, si attiva solo se è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: true\n }\n },\n videoSrc: {\n name: 'video-src',\n description: 'Url del video da visualizzare, si attiva solo se non è presente img',\n control: 'text',\n if:{\n arg: 'img',\n exists: false\n }\n },\n notificationUrl: {\n name: 'notification-url',\n description: 'Url della notifica da visualizzare',\n control: 'text',\n },\n notificationText: {\n name: 'notification-text',\n description: 'Testo della notifica da visualizzare',\n control: 'text',\n },\n productName: {\n name: 'product-name',\n description: 'Nome del prodotto',\n control: 'text',\n },\n subtitle: {\n name: 'subtitle',\n description: 'Sottotitolo della card',\n control: 'text',\n },\n productId: {\n name: 'product-id',\n description: 'ID del prodotto',\n control: 'text',\n },\n price: {\n name: 'price',\n description: 'Prezzo del prodotto; Se la card è in versione Mini gli va passato il prezzo scontato',\n control: 'number',\n },\n salePrice: {\n name: 'sale-price',\n description: 'Prezzo scontato del prodotto',\n control: 'number',\n },\n addToCartText: {\n name: 'add-to-cart-text',\n description: 'Testo bottone aggiungi al carrello',\n control: 'text',\n },\n addToCartColor: {\n name: 'add-to-cart-color',\n description: 'Colore del bottone aggiungi al carrello',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'white'\n ],\n },\n hasSlotAddToCart: {\n name: 'has-slot-add-to-cart',\n description: 'Di default la card ecommerce ha un bottone per l\\'aggiunta al carrello; Se has-slot-add-to-cart è true il bottone viene sostituito da uno slot',\n control: 'boolean',\n defaultValue: false,\n },\n badgeColor: {\n name: 'badge-color',\n description: 'Colore del badge',\n control: 'select',\n options: [\n 'primary',\n 'secondary',\n 'neutral',\n 'warning',\n 'success',\n 'danger',\n ],\n },\n outOfStock: {\n name: 'out-of-stock',\n description: 'Indica se il prodotto è esaurito',\n control: 'boolean',\n defaultValue: false\n },\n outOfStockText: {\n name: 'out-of-stock-text',\n description: 'Testo da visualizzare se il prodotto è esaurito',\n control: 'text',\n },\n waitingListText: {\n name: 'waiting-list-text',\n description: 'cta per richiedere l\\'avviso se il prodotto torna disponibile',\n control: 'text',\n },\n isMini: {\n name: 'is-mini',\n description: 'Indica se la card è di dimensioni ridotte',\n control: 'boolean',\n defaultValue: false\n },\n enableZoom: {\n name: 'enable-zoom',\n description: 'Indica se è attivo lo zoom all\\'hover',\n control: 'boolean',\n defaultValue: false\n },\n imageObjectFit: {\n name: 'image-object-fit',\n description: 'Controlla il comportamento dell\\'object-fit delle immagini',\n control: 'select',\n options: ['cover', 'scale-down', 'contain', 'fill', 'none'],\n defaultValue: 'cover'\n },\n autoSelectFirstVariation: {\n name: 'auto-select-first-variation',\n description: 'Indica se selezionare automaticamente la prima variazione disponibile',\n control: 'boolean',\n defaultValue: true\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const Card = Template.bind({});\nCard.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n enableZoom: false,\n imageObjectFit: 'cover',\n autoSelectFirstVariation: true,\n};\n\nconst TemplateWithEvent = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n\n <jump-card-ecommerce-option code=\"size1\" label=\"sono una select un pò lunga\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"size2\" label=\"L\" sku=\"cod123\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"size3\" label=\"XL\" sku=\"cod124\" order=\"3\"></jump-card-ecommerce-option>\n\n <div slot=\"addtocart\"><a href=\"\">Sono un bottone dentro lo slot addotocart</a></div>\n </jump-card-ecommerce>\n <script>\n\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-toggle-favorite', ev => {\n let productId = ev.detail.productId;\n let favorite = ev.detail.favorite;\n if(favorite){\n console.log( 'Prodotto ' + productId + ' aggiunto ai preferiti');\n } else {\n console.log( 'Prodotto ' + productId + ' rimosso dai preferiti');\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener( 'jump-add-to-cart', ev => {\n let productId = ev.detail.productId;\n let addedToCart = ev.detail.addedToCart;\n let variation = ev.detail.variation;\n if(addedToCart){\n console.log( 'Prodotto ' + productId + ' aggiunto al carrello');\n console.log( 'Variazione selezionata:', variation);\n }\n })\n\n container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {\n let variation = ev.detail;\n console.log('Variation selected automatically:', variation);\n });\n\n })();\n\n </script>\n ` );\n}\n\nexport const CardEvent = TemplateWithEvent.bind({});\nCardEvent.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n hasFavorite: false,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n currency: '€',\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'primary',\n hasSlotAddToCart: false,\n badgeColor: 'primary',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: true,\n autoSelectFirstVariation: true,\n};\n\nconst TemplateDisallowAllowCart = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n </jump-card-ecommerce>\n `);\n}\n\nexport const CardWithZoom = Template.bind({});\nCardWithZoom.args = {\n ...Card.args,\n enableZoom: true,\n hoverImg: '',\n hoverImgAlt: '',\n};\n\nexport const CardDisallow = TemplateDisallowAllowCart.bind({});\nCardDisallow.args = {\n hasBackground: true,\n onlyIconButton: false,\n badge: 'In offerta',\n favorite: false,\n hasFavorite: true,\n hasSlotForFavorite: false,\n link: '/prodotto',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n imgAlt: 'Immagine',\n hoverImg: 'https://images.pexels.com/photos/9558695/pexels-photo-9558695.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n hoverImgAlt: 'immagine in hover',\n notificationUrl: '/cart',\n notificationText: 'Aggiunto al carrello',\n productName: 'T-shirt',\n subtitle: 'T-shirt da uomo',\n productId: '1',\n price: 15,\n salePrice: 10,\n addToCartText: 'Aggiungi al carrello',\n addToCartColor: 'secondary',\n hasSlotAddToCart: false,\n badgeColor: 'secondary',\n currency: '€',\n outOfStock: false,\n outOfStockText: 'Esaurito',\n waitingListText: 'Notifica disponibilità',\n isMini: false,\n disallowAddToCart: true,\n};\n\n// Storia per mostrare l'utilizzo della proprietà imageObjectFit\nexport const CardWithScaleDown = Template.bind({});\nCardWithScaleDown.args = {\n ...Card.args,\n imageObjectFit: 'scale-down',\n img: 'https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',\n productName: 'Card con scale-down',\n subtitle: 'L\\'immagine usa object-fit: scale-down'\n};\n\n// Storia per mostrare la selezione automatica delle variazioni\nconst TemplateWithVariations = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-card-ecommerce ${attributes}>\n <jump-card-ecommerce-option code=\"s\" label=\"Small (S)\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"Medium (M)\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"Large (L)\" order=\"3\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"xl\" label=\"Extra Large (XL)\" order=\"4\"></jump-card-ecommerce-option>\n \n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <script>\n (function() {\n let container = document.querySelector('#story--${id}');\n container.querySelector('jump-card-ecommerce').addEventListener('jump-variation-selected', ev => {\n let variation = ev.detail;\n console.log('Variazione selezionata automaticamente:', variation);\n });\n })();\n </script>\n `);\n};\n\nexport const CardWithAutoSelection = TemplateWithVariations.bind({});\nCardWithAutoSelection.args = {\n ...Card.args,\n productName: 'T-shirt con selezione automatica',\n subtitle: 'La prima variazione viene selezionata automaticamente',\n autoSelectFirstVariation: true,\n};\n\nexport const CardWithoutAutoSelection = TemplateWithVariations.bind({});\nCardWithoutAutoSelection.args = {\n ...Card.args,\n productName: 'T-shirt senza selezione automatica',\n subtitle: 'L\\'utente deve selezionare manualmente la variazione',\n autoSelectFirstVariation: false,\n};\n\nexport const CardArchiveGrid = () => formatHtml(`\n <div style=\"display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; max-width: 900px; margin: 0 auto;\">\n <jump-card-ecommerce\n product-name=\"T-shirt Uomo\"\n subtitle=\"Cotone 100%\"\n has-favorite=\"true\"\n img=\"https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1\"\n img-alt=\"T-shirt Uomo\"\n price=\"15\"\n sale-price=\"10\"\n badge=\"In offerta\"\n badge-color=\"secondary\"\n add-to-cart-text=\"Aggiungi al carrello\"\n >\n <jump-card-ecommerce-option code=\"s\" label=\"Small (S)\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"Medium (M)\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"Large (L)\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n product-name=\"Felpa Donna\"\n subtitle=\"Felpa con cappuccio\"\n img=\"https://images.pexels.com/photos/532220/pexels-photo-532220.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Felpa Donna\"\n price=\"29\"\n badge=\"Novità\"\n badge-color=\"primary\"\n add-to-cart-text=\"Aggiungi al carrello\"\n >\n <jump-card-ecommerce-option code=\"xs\" label=\"XS\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"s\" label=\"S\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"M\" order=\"3\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"L\" order=\"4\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n product-name=\"Jeans Slim\"\n subtitle=\"Denim elasticizzato\"\n img=\"https://images.pexels.com/photos/2983464/pexels-photo-2983464.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Jeans Slim\"\n price=\"49\"\n badge=\"Best Seller\"\n badge-color=\"success\"\n add-to-cart-text=\"Aggiungi al carrello\"\n >\n <jump-card-ecommerce-option code=\"30\" label=\"Taglia 30\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"32\" label=\"Taglia 32\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"34\" label=\"Taglia 34\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n product-name=\"Giacca Leggera\"\n subtitle=\"Primavera/Estate\"\n img=\"https://images.pexels.com/photos/532221/pexels-photo-532221.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Giacca Leggera\"\n price=\"59\"\n out-of-stock=\"true\"\n sale-price=\"45\"\n badge=\"Promo\"\n badge-color=\"danger\"\n add-to-cart-text=\"Aggiungi al carrello\"\n >\n <jump-card-ecommerce-option code=\"m\" label=\"M\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"L\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"xl\" label=\"XL\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"T-shirt Uomo\"\n subtitle=\"Cotone 100%\"\n img=\"https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1\"\n img-alt=\"T-shirt Uomo\"\n price=\"15\"\n sale-price=\"10\"\n badge=\"In offerta\"\n badge-color=\"secondary\"\n add-to-cart-text=\"Aggiungi al carrello\"\n >\n <jump-card-ecommerce-option code=\"s\" label=\"Small (S)\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"Medium (M)\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"Large (L)\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"Felpa Donna\"\n subtitle=\"Felpa con cappuccio\"\n img=\"https://images.pexels.com/photos/532220/pexels-photo-532220.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Felpa Donna\"\n price=\"29\"\n sale-price=\"25\"\n badge=\"Novità\"\n badge-color=\"primary\"\n add-to-cart-text=\"Aggiungi al carrello\"\n >\n <jump-card-ecommerce-option code=\"xs\" label=\"XS\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"s\" label=\"S\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"M\" order=\"3\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"L\" order=\"4\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"Jeans Slim\"\n subtitle=\"Denim elasticizzato\"\n img=\"https://images.pexels.com/photos/2983464/pexels-photo-2983464.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Jeans Slim\"\n price=\"49\"\n badge=\"Best Seller\"\n badge-color=\"success\"\n add-to-cart-text=\"Aggiungi al carrello\"\n enable-zoom\n >\n <jump-card-ecommerce-option code=\"30\" label=\"Taglia 30\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"32\" label=\"Taglia 32\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"34\" label=\"Taglia 34\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"Giacca Leggera\"\n subtitle=\"Primavera/Estate\"\n img=\"https://images.pexels.com/photos/532221/pexels-photo-532221.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Giacca Leggera\"\n price=\"59\"\n sale-price=\"45\"\n badge=\"Promo\"\n badge-color=\"danger\"\n add-to-cart-text=\"Aggiungi al carrello\"\n enable-zoom\n >\n <jump-card-ecommerce-option code=\"m\" label=\"M\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"L\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"xl\" label=\"XL\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"T-shirt Uomo\"\n subtitle=\"Cotone 100%\"\n img=\"https://images.pexels.com/photos/4066293/pexels-photo-4066293.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1\"\n img-alt=\"T-shirt Uomo\"\n price=\"15\"\n sale-price=\"10\"\n badge=\"In offerta\"\n badge-color=\"secondary\"\n add-to-cart-text=\"Aggiungi al carrello\"\n enable-zoom\n >\n <jump-card-ecommerce-option code=\"s\" label=\"Small (S)\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"Medium (M)\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"Large (L)\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"Felpa Donna\"\n subtitle=\"Felpa con cappuccio\"\n img=\"https://images.pexels.com/photos/532220/pexels-photo-532220.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Felpa Donna\"\n price=\"29\"\n sale-price=\"25\"\n badge=\"Novità\"\n badge-color=\"primary\"\n add-to-cart-text=\"Aggiungi al carrello\"\n enable-zoom\n >\n <jump-card-ecommerce-option code=\"xs\" label=\"XS\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"s\" label=\"S\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"m\" label=\"M\" order=\"3\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"L\" order=\"4\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"Jeans Slim\"\n subtitle=\"Denim elasticizzato\"\n img=\"https://images.pexels.com/photos/2983464/pexels-photo-2983464.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Jeans Slim\"\n price=\"49\"\n badge=\"Best Seller\"\n badge-color=\"success\"\n add-to-cart-text=\"Aggiungi al carrello\"\n enable-zoom\n >\n <jump-card-ecommerce-option code=\"30\" label=\"Taglia 30\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"32\" label=\"Taglia 32\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"34\" label=\"Taglia 34\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n <jump-card-ecommerce\n has-background\n product-name=\"Giacca Leggera\"\n subtitle=\"Primavera/Estate\"\n img=\"https://images.pexels.com/photos/532221/pexels-photo-532221.jpeg?auto=compress&cs=tinysrgb&w=800\"\n img-alt=\"Giacca Leggera\"\n price=\"59\"\n sale-price=\"45\"\n badge=\"Promo\"\n badge-color=\"danger\"\n add-to-cart-text=\"Aggiungi al carrello\"\n enable-zoom\n >\n <jump-card-ecommerce-option code=\"m\" label=\"M\" order=\"1\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"l\" label=\"L\" order=\"2\"></jump-card-ecommerce-option>\n <jump-card-ecommerce-option code=\"xl\" label=\"XL\" order=\"3\"></jump-card-ecommerce-option>\n <jump-quantity slot=\"quantity\" min=\"1\" max=\"10\" value=\"1\"></jump-quantity>\n </jump-card-ecommerce>\n </div>\n`);\nCardArchiveGrid.storyName = 'Archivio (Grid X colonne con variazioni e quantità)';"]}