@revenuecat/purchases-ui-js 0.0.16 → 0.0.18

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 (67) hide show
  1. package/dist/components/button/Button.svelte +0 -13
  2. package/dist/components/button/Button.svelte.d.ts +4 -2
  3. package/dist/components/button/ButtonNode.stories.svelte +16 -11
  4. package/dist/components/button/ButtonNode.svelte +26 -1
  5. package/dist/components/button/ButtonNode.svelte.d.ts +1 -0
  6. package/dist/components/button/button-utils.d.ts +2 -0
  7. package/dist/components/button/button-utils.js +19 -0
  8. package/dist/components/footer/Footer.stories.svelte +47 -155
  9. package/dist/components/footer/Footer.stories.svelte.d.ts +1 -2
  10. package/dist/components/footer/Footer.svelte +10 -1
  11. package/dist/components/footer/Footer.svelte.d.ts +1 -0
  12. package/dist/components/image/Image.stories.svelte +13 -7
  13. package/dist/components/image/Image.svelte +37 -19
  14. package/dist/components/image/Image.svelte.d.ts +1 -0
  15. package/dist/components/image/image-utils.d.ts +2 -12
  16. package/dist/components/image/image-utils.js +28 -11
  17. package/dist/components/package/Package.stories.svelte +5 -5
  18. package/dist/components/package/Package.svelte +15 -6
  19. package/dist/components/package/Package.svelte.d.ts +1 -0
  20. package/dist/components/paywall/Node.svelte +77 -17
  21. package/dist/components/paywall/Node.svelte.d.ts +21 -2
  22. package/dist/components/paywall/Paywall.stories.svelte +93 -15
  23. package/dist/components/paywall/Paywall.svelte +110 -88
  24. package/dist/components/paywall/Paywall.svelte.d.ts +4 -0
  25. package/dist/components/paywall/paywall-utils.d.ts +1 -1
  26. package/dist/components/paywall/paywall-utils.js +11 -9
  27. package/dist/components/purchase-button/PurchaseButton.stories.svelte +7 -8
  28. package/dist/components/purchase-button/PurchaseButton.svelte +24 -10
  29. package/dist/components/purchase-button/PurchaseButton.svelte.d.ts +1 -0
  30. package/dist/components/purchase-button/purchase-button-utils.d.ts +2 -0
  31. package/dist/components/purchase-button/purchase-button-utils.js +20 -0
  32. package/dist/components/stack/Stack.stories.svelte +1138 -6
  33. package/dist/components/stack/Stack.svelte +160 -42
  34. package/dist/components/stack/Stack.svelte.d.ts +1 -0
  35. package/dist/components/stack/stack-utils.d.ts +24 -24
  36. package/dist/components/stack/stack-utils.js +245 -12
  37. package/dist/components/text/Text.svelte +24 -19
  38. package/dist/components/text/Text.svelte.d.ts +4 -2
  39. package/dist/components/text/TextNode.stories.svelte +13 -13
  40. package/dist/components/text/TextNode.svelte +24 -34
  41. package/dist/components/text/TextNode.svelte.d.ts +1 -0
  42. package/dist/components/text/text-utils.d.ts +11 -14
  43. package/dist/components/text/text-utils.js +130 -15
  44. package/dist/components/timeline/Timeline.stories.svelte +640 -0
  45. package/dist/components/timeline/Timeline.stories.svelte.d.ts +19 -0
  46. package/dist/components/timeline/Timeline.svelte +40 -0
  47. package/dist/components/timeline/Timeline.svelte.d.ts +4 -0
  48. package/dist/components/timeline/TimelineItem.svelte +112 -0
  49. package/dist/components/timeline/TimelineItem.svelte.d.ts +4 -0
  50. package/dist/components/timeline/timeline-utils.d.ts +8 -0
  51. package/dist/components/timeline/timeline-utils.js +128 -0
  52. package/dist/data/entities.d.ts +89 -9
  53. package/dist/data/state.d.ts +2 -0
  54. package/dist/index.d.ts +3 -2
  55. package/dist/index.js +3 -2
  56. package/dist/stories/fixtures.d.ts +7 -1
  57. package/dist/stories/fixtures.js +6898 -7
  58. package/dist/stories/meta-templates.d.ts +0 -1
  59. package/dist/stories/meta-templates.js +0 -5
  60. package/dist/types.d.ts +16 -7
  61. package/dist/types.js +7 -0
  62. package/dist/utils/style-utils.d.ts +80 -41
  63. package/dist/utils/style-utils.js +157 -70
  64. package/dist/utils/variable-utils.d.ts +27 -0
  65. package/dist/utils/variable-utils.js +37 -0
  66. package/package.json +27 -25
  67. package/dist/components/paywall/global-styles.css +0 -9
@@ -3,7 +3,6 @@
3
3
  import Stack from "./Stack.svelte";
4
4
  import {
5
5
  borderStoryMeta,
6
- colorModeStoryMeta,
7
6
  getColorStoryMeta,
8
7
  getSpacingStoryMeta,
9
8
  shadowStoryMeta,
@@ -11,6 +10,8 @@
11
10
  stackDimensionStoryMeta,
12
11
  } from "../../stories/meta-templates";
13
12
  import { labelsData as labels } from "../../stories/fixtures";
13
+ import type { PurchaseState } from "../../data/state";
14
+ import type { PaywallComponent } from "../../data/entities";
14
15
 
15
16
  const { Story } = defineMeta({
16
17
  title: "Components/Stack",
@@ -22,7 +23,6 @@
22
23
  control: { type: "number" },
23
24
  description: "Space between stack items in pixels",
24
25
  },
25
- colorMode: colorModeStoryMeta,
26
26
  shadow: shadowStoryMeta,
27
27
  background_color: getColorStoryMeta("Background color object"),
28
28
  padding: getSpacingStoryMeta("Padding values in pixels"),
@@ -32,12 +32,13 @@
32
32
  },
33
33
  });
34
34
 
35
- const purchaseState = {
35
+ const purchaseState: PurchaseState = {
36
36
  locale: "en_US",
37
37
  defaultLocale: "en_US",
38
+ colorMode: "light",
38
39
  };
39
40
 
40
- const components = [
41
+ const components: PaywallComponent[] = [
41
42
  {
42
43
  type: "text",
43
44
  size: {
@@ -200,7 +201,6 @@
200
201
  light: { type: "hex", value: "#646464" },
201
202
  dark: { type: "hex", value: "#646464" },
202
203
  },
203
- style: "solid",
204
204
  },
205
205
  shape: {
206
206
  type: "rectangle",
@@ -303,7 +303,6 @@
303
303
  light: { type: "hex", value: "#646464" },
304
304
  dark: { type: "hex", value: "#646464" },
305
305
  },
306
- style: "solid",
307
306
  },
308
307
  shape: {
309
308
  type: "rectangle",
@@ -319,3 +318,1136 @@
319
318
  size: { width: { type: "fill" }, height: { type: "fill" } },
320
319
  }}
321
320
  />
321
+
322
+ <Story
323
+ name="Badge - Nested"
324
+ args={{
325
+ type: "stack",
326
+ purchaseState,
327
+ dimension: {
328
+ type: "zlayer",
329
+ alignment: "center",
330
+ },
331
+ components: [
332
+ {
333
+ type: "stack",
334
+ labels,
335
+ purchaseState,
336
+ dimension: {
337
+ type: "zlayer",
338
+ alignment: "center",
339
+ },
340
+ components: [],
341
+ size: {
342
+ width: { type: "fixed", value: 500 },
343
+ height: { type: "fixed", value: 500 },
344
+ },
345
+ id: "badge-zstack-base",
346
+ name: "badge-zstack-base",
347
+ },
348
+ {
349
+ type: "stack",
350
+ labels,
351
+ purchaseState,
352
+ dimension: {
353
+ type: "zlayer",
354
+ alignment: "center",
355
+ },
356
+ components: [],
357
+ size: {
358
+ width: { type: "fixed", value: 500 },
359
+ height: { type: "fixed", value: 500 },
360
+ },
361
+ id: "badge-zstack-top_leading",
362
+ name: "badge-zstack-top_leading",
363
+ badge: {
364
+ stack: {
365
+ type: "stack",
366
+ components: [],
367
+ },
368
+ style: "nested",
369
+ alignment: "top_leading",
370
+ shape: {
371
+ type: "rectangle",
372
+ corners: {
373
+ top_leading: 4,
374
+ top_trailing: 4,
375
+ bottom_leading: 4,
376
+ bottom_trailing: 4,
377
+ },
378
+ },
379
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
380
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
381
+ text_lid: "badge",
382
+ color: { light: { type: "hex", value: "#000000" } },
383
+ font_weight: "bold",
384
+ font_size: "body_s",
385
+ horizontal_alignment: "center",
386
+ background_color: {
387
+ light: { type: "hex", value: "#47aab1" },
388
+ },
389
+ },
390
+ },
391
+ {
392
+ type: "stack",
393
+ labels,
394
+ purchaseState,
395
+ dimension: {
396
+ type: "zlayer",
397
+ alignment: "center",
398
+ },
399
+ components: [],
400
+ size: {
401
+ width: { type: "fixed", value: 500 },
402
+ height: { type: "fixed", value: 500 },
403
+ },
404
+ id: "badge-zstack-top_leading",
405
+ name: "badge-zstack-top_leading",
406
+ badge: {
407
+ stack: {
408
+ type: "stack",
409
+ components: [],
410
+ },
411
+ style: "nested",
412
+ alignment: "top",
413
+ shape: {
414
+ type: "rectangle",
415
+ corners: {
416
+ top_leading: 4,
417
+ top_trailing: 4,
418
+ bottom_leading: 4,
419
+ bottom_trailing: 4,
420
+ },
421
+ },
422
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
423
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
424
+ text_lid: "badge",
425
+ color: { light: { type: "hex", value: "#000000" } },
426
+ font_weight: "bold",
427
+ font_size: "body_s",
428
+ horizontal_alignment: "center",
429
+ background_color: {
430
+ light: { type: "hex", value: "#47aab1" },
431
+ },
432
+ },
433
+ },
434
+ {
435
+ type: "stack",
436
+ labels,
437
+ purchaseState,
438
+ dimension: {
439
+ type: "zlayer",
440
+ alignment: "center",
441
+ },
442
+ components: [],
443
+ size: {
444
+ width: { type: "fixed", value: 500 },
445
+ height: { type: "fixed", value: 500 },
446
+ },
447
+ id: "badge-zstack-top_leading",
448
+ name: "badge-zstack-top_leading",
449
+ badge: {
450
+ stack: {
451
+ type: "stack",
452
+ components: [],
453
+ },
454
+ style: "nested",
455
+ alignment: "top_trailing",
456
+ shape: {
457
+ type: "rectangle",
458
+ corners: {
459
+ top_leading: 4,
460
+ top_trailing: 4,
461
+ bottom_leading: 4,
462
+ bottom_trailing: 4,
463
+ },
464
+ },
465
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
466
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
467
+ text_lid: "badge",
468
+ color: { light: { type: "hex", value: "#000000" } },
469
+ font_weight: "bold",
470
+ font_size: "body_s",
471
+ horizontal_alignment: "center",
472
+ background_color: {
473
+ light: { type: "hex", value: "#47aab1" },
474
+ },
475
+ },
476
+ },
477
+ {
478
+ type: "stack",
479
+ labels,
480
+ purchaseState,
481
+ dimension: {
482
+ type: "zlayer",
483
+ alignment: "center",
484
+ },
485
+ components: [],
486
+ size: {
487
+ width: { type: "fixed", value: 500 },
488
+ height: { type: "fixed", value: 500 },
489
+ },
490
+ id: "badge-zstack-top_leading",
491
+ name: "badge-zstack-top_leading",
492
+ badge: {
493
+ stack: {
494
+ type: "stack",
495
+ components: [],
496
+ },
497
+ style: "nested",
498
+ alignment: "leading",
499
+ shape: {
500
+ type: "rectangle",
501
+ corners: {
502
+ top_leading: 4,
503
+ top_trailing: 4,
504
+ bottom_leading: 4,
505
+ bottom_trailing: 4,
506
+ },
507
+ },
508
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
509
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
510
+ text_lid: "badge",
511
+ color: { light: { type: "hex", value: "#000000" } },
512
+ font_weight: "bold",
513
+ font_size: "body_s",
514
+ horizontal_alignment: "center",
515
+ background_color: {
516
+ light: { type: "hex", value: "#47aab1" },
517
+ },
518
+ },
519
+ },
520
+ {
521
+ type: "stack",
522
+ labels,
523
+ purchaseState,
524
+ dimension: {
525
+ type: "zlayer",
526
+ alignment: "center",
527
+ },
528
+ components: [],
529
+ size: {
530
+ width: { type: "fixed", value: 500 },
531
+ height: { type: "fixed", value: 500 },
532
+ },
533
+ id: "badge-zstack-top_leading",
534
+ name: "badge-zstack-top_leading",
535
+ badge: {
536
+ stack: {
537
+ type: "stack",
538
+ components: [],
539
+ },
540
+ style: "nested",
541
+ alignment: "trailing",
542
+ shape: {
543
+ type: "rectangle",
544
+ corners: {
545
+ top_leading: 4,
546
+ top_trailing: 4,
547
+ bottom_leading: 4,
548
+ bottom_trailing: 4,
549
+ },
550
+ },
551
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
552
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
553
+ text_lid: "badge",
554
+ color: { light: { type: "hex", value: "#000000" } },
555
+ font_weight: "bold",
556
+ font_size: "body_s",
557
+ horizontal_alignment: "center",
558
+ background_color: {
559
+ light: { type: "hex", value: "#47aab1" },
560
+ },
561
+ },
562
+ },
563
+ {
564
+ type: "stack",
565
+ labels,
566
+ purchaseState,
567
+ dimension: {
568
+ type: "zlayer",
569
+ alignment: "center",
570
+ },
571
+ components: [],
572
+ size: {
573
+ width: { type: "fixed", value: 500 },
574
+ height: { type: "fixed", value: 500 },
575
+ },
576
+ id: "badge-zstack-top_leading",
577
+ name: "badge-zstack-top_leading",
578
+ badge: {
579
+ stack: {
580
+ type: "stack",
581
+ components: [],
582
+ },
583
+ style: "nested",
584
+ alignment: "bottom_leading",
585
+ shape: {
586
+ type: "rectangle",
587
+ corners: {
588
+ top_leading: 4,
589
+ top_trailing: 4,
590
+ bottom_leading: 4,
591
+ bottom_trailing: 4,
592
+ },
593
+ },
594
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
595
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
596
+ text_lid: "badge",
597
+ color: { light: { type: "hex", value: "#000000" } },
598
+ font_weight: "bold",
599
+ font_size: "body_s",
600
+ horizontal_alignment: "center",
601
+ background_color: {
602
+ light: { type: "hex", value: "#47aab1" },
603
+ },
604
+ },
605
+ },
606
+ {
607
+ type: "stack",
608
+ labels,
609
+ purchaseState,
610
+ dimension: {
611
+ type: "zlayer",
612
+ alignment: "center",
613
+ },
614
+ components: [],
615
+ size: {
616
+ width: { type: "fixed", value: 500 },
617
+ height: { type: "fixed", value: 500 },
618
+ },
619
+ id: "badge-zstack-top_leading",
620
+ name: "badge-zstack-top_leading",
621
+ badge: {
622
+ stack: {
623
+ type: "stack",
624
+ components: [],
625
+ },
626
+ style: "nested",
627
+ alignment: "bottom",
628
+ shape: {
629
+ type: "rectangle",
630
+ corners: {
631
+ top_leading: 4,
632
+ top_trailing: 4,
633
+ bottom_leading: 4,
634
+ bottom_trailing: 4,
635
+ },
636
+ },
637
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
638
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
639
+ text_lid: "badge",
640
+ color: { light: { type: "hex", value: "#000000" } },
641
+ font_weight: "bold",
642
+ font_size: "body_s",
643
+ horizontal_alignment: "center",
644
+ background_color: {
645
+ light: { type: "hex", value: "#47aab1" },
646
+ },
647
+ },
648
+ },
649
+ {
650
+ type: "stack",
651
+ labels,
652
+ purchaseState,
653
+ dimension: {
654
+ type: "zlayer",
655
+ alignment: "center",
656
+ },
657
+ components: [],
658
+ size: {
659
+ width: { type: "fixed", value: 500 },
660
+ height: { type: "fixed", value: 500 },
661
+ },
662
+ id: "badge-zstack-top_leading",
663
+ name: "badge-zstack-top_leading",
664
+ badge: {
665
+ stack: {
666
+ type: "stack",
667
+ components: [],
668
+ },
669
+ style: "nested",
670
+ alignment: "bottom_trailing",
671
+ shape: {
672
+ type: "rectangle",
673
+ corners: {
674
+ top_leading: 4,
675
+ top_trailing: 4,
676
+ bottom_leading: 4,
677
+ bottom_trailing: 4,
678
+ },
679
+ },
680
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
681
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
682
+ text_lid: "badge",
683
+ color: { light: { type: "hex", value: "#000000" } },
684
+ font_weight: "bold",
685
+ font_size: "body_s",
686
+ horizontal_alignment: "center",
687
+ background_color: {
688
+ light: { type: "hex", value: "#47aab1" },
689
+ },
690
+ },
691
+ },
692
+ ],
693
+ labels,
694
+ border: {
695
+ width: 2,
696
+ color: {
697
+ light: { type: "hex", value: "#47aab1" },
698
+ },
699
+ },
700
+ shape: {
701
+ type: "rectangle",
702
+ corners: {
703
+ top_leading: 8,
704
+ top_trailing: 8,
705
+ bottom_leading: 8,
706
+ bottom_trailing: 8,
707
+ },
708
+ },
709
+ spacing: 16,
710
+ padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
711
+ size: {
712
+ width: { type: "fixed", value: 500 },
713
+ height: { type: "fixed", value: 500 },
714
+ },
715
+ }}
716
+ />
717
+
718
+ <Story
719
+ name="Badge - Overlaid"
720
+ args={{
721
+ type: "stack",
722
+ purchaseState,
723
+ dimension: {
724
+ type: "zlayer",
725
+ alignment: "center",
726
+ },
727
+ components: [
728
+ {
729
+ type: "stack",
730
+ labels,
731
+ purchaseState,
732
+ dimension: {
733
+ type: "zlayer",
734
+ alignment: "center",
735
+ },
736
+ components: [],
737
+ size: {
738
+ width: { type: "fixed", value: 500 },
739
+ height: { type: "fixed", value: 500 },
740
+ },
741
+ id: "badge-zstack-base",
742
+ name: "badge-zstack-base",
743
+ },
744
+ {
745
+ type: "stack",
746
+ labels,
747
+ purchaseState,
748
+ dimension: {
749
+ type: "zlayer",
750
+ alignment: "center",
751
+ },
752
+ components: [],
753
+ size: {
754
+ width: { type: "fixed", value: 500 },
755
+ height: { type: "fixed", value: 500 },
756
+ },
757
+ id: "badge-zstack-top_leading",
758
+ name: "badge-zstack-top_leading",
759
+ badge: {
760
+ stack: {
761
+ type: "stack",
762
+ components: [],
763
+ },
764
+ style: "overlay",
765
+ alignment: "top_leading",
766
+ shape: {
767
+ type: "rectangle",
768
+ corners: {
769
+ top_leading: 4,
770
+ top_trailing: 4,
771
+ bottom_leading: 4,
772
+ bottom_trailing: 4,
773
+ },
774
+ },
775
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
776
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
777
+ text_lid: "badge",
778
+ color: { light: { type: "hex", value: "#000000" } },
779
+ font_weight: "bold",
780
+ font_size: "body_s",
781
+ horizontal_alignment: "center",
782
+ background_color: {
783
+ light: { type: "hex", value: "#47aab1" },
784
+ },
785
+ },
786
+ },
787
+ {
788
+ type: "stack",
789
+ labels,
790
+ purchaseState,
791
+ dimension: {
792
+ type: "zlayer",
793
+ alignment: "center",
794
+ },
795
+ components: [],
796
+ size: {
797
+ width: { type: "fixed", value: 500 },
798
+ height: { type: "fixed", value: 500 },
799
+ },
800
+ id: "badge-zstack-top_leading",
801
+ name: "badge-zstack-top_leading",
802
+ badge: {
803
+ stack: {
804
+ type: "stack",
805
+ components: [],
806
+ },
807
+ style: "overlay",
808
+ alignment: "top",
809
+ shape: {
810
+ type: "rectangle",
811
+ corners: {
812
+ top_leading: 4,
813
+ top_trailing: 4,
814
+ bottom_leading: 4,
815
+ bottom_trailing: 4,
816
+ },
817
+ },
818
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
819
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
820
+ text_lid: "badge",
821
+ color: { light: { type: "hex", value: "#000000" } },
822
+ font_weight: "bold",
823
+ font_size: "body_s",
824
+ horizontal_alignment: "center",
825
+ background_color: {
826
+ light: { type: "hex", value: "#47aab1" },
827
+ },
828
+ },
829
+ },
830
+ {
831
+ type: "stack",
832
+ labels,
833
+ purchaseState,
834
+ dimension: {
835
+ type: "zlayer",
836
+ alignment: "center",
837
+ },
838
+ components: [],
839
+ size: {
840
+ width: { type: "fixed", value: 500 },
841
+ height: { type: "fixed", value: 500 },
842
+ },
843
+ id: "badge-zstack-top_leading",
844
+ name: "badge-zstack-top_leading",
845
+ badge: {
846
+ stack: {
847
+ type: "stack",
848
+ components: [],
849
+ },
850
+ style: "overlay",
851
+ alignment: "top_trailing",
852
+ shape: {
853
+ type: "rectangle",
854
+ corners: {
855
+ top_leading: 4,
856
+ top_trailing: 4,
857
+ bottom_leading: 4,
858
+ bottom_trailing: 4,
859
+ },
860
+ },
861
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
862
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
863
+ text_lid: "badge",
864
+ color: { light: { type: "hex", value: "#000000" } },
865
+ font_weight: "bold",
866
+ font_size: "body_s",
867
+ horizontal_alignment: "center",
868
+ background_color: {
869
+ light: { type: "hex", value: "#47aab1" },
870
+ },
871
+ },
872
+ },
873
+ {
874
+ type: "stack",
875
+ labels,
876
+ purchaseState,
877
+ dimension: {
878
+ type: "zlayer",
879
+ alignment: "center",
880
+ },
881
+ components: [],
882
+ size: {
883
+ width: { type: "fixed", value: 500 },
884
+ height: { type: "fixed", value: 500 },
885
+ },
886
+ id: "badge-zstack-top_leading",
887
+ name: "badge-zstack-top_leading",
888
+ badge: {
889
+ stack: {
890
+ type: "stack",
891
+ components: [],
892
+ },
893
+ style: "overlay",
894
+ alignment: "bottom_leading",
895
+ shape: {
896
+ type: "rectangle",
897
+ corners: {
898
+ top_leading: 4,
899
+ top_trailing: 4,
900
+ bottom_leading: 4,
901
+ bottom_trailing: 4,
902
+ },
903
+ },
904
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
905
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
906
+ text_lid: "badge",
907
+ color: { light: { type: "hex", value: "#000000" } },
908
+ font_weight: "bold",
909
+ font_size: "body_s",
910
+ horizontal_alignment: "center",
911
+ background_color: {
912
+ light: { type: "hex", value: "#47aab1" },
913
+ },
914
+ },
915
+ },
916
+ {
917
+ type: "stack",
918
+ labels,
919
+ purchaseState,
920
+ dimension: {
921
+ type: "zlayer",
922
+ alignment: "center",
923
+ },
924
+ components: [],
925
+ size: {
926
+ width: { type: "fixed", value: 500 },
927
+ height: { type: "fixed", value: 500 },
928
+ },
929
+ id: "badge-zstack-top_leading",
930
+ name: "badge-zstack-top_leading",
931
+ badge: {
932
+ stack: {
933
+ type: "stack",
934
+ components: [],
935
+ },
936
+ style: "overlay",
937
+ alignment: "bottom",
938
+ shape: {
939
+ type: "rectangle",
940
+ corners: {
941
+ top_leading: 4,
942
+ top_trailing: 4,
943
+ bottom_leading: 4,
944
+ bottom_trailing: 4,
945
+ },
946
+ },
947
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
948
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
949
+ text_lid: "badge",
950
+ color: { light: { type: "hex", value: "#000000" } },
951
+ font_weight: "bold",
952
+ font_size: "body_s",
953
+ horizontal_alignment: "center",
954
+ background_color: {
955
+ light: { type: "hex", value: "#47aab1" },
956
+ },
957
+ },
958
+ },
959
+ {
960
+ type: "stack",
961
+ labels,
962
+ purchaseState,
963
+ dimension: {
964
+ type: "zlayer",
965
+ alignment: "center",
966
+ },
967
+ components: [],
968
+ size: {
969
+ width: { type: "fixed", value: 500 },
970
+ height: { type: "fixed", value: 500 },
971
+ },
972
+ id: "badge-zstack-top_leading",
973
+ name: "badge-zstack-top_leading",
974
+ badge: {
975
+ stack: {
976
+ type: "stack",
977
+ components: [],
978
+ },
979
+ style: "overlay",
980
+ alignment: "bottom_trailing",
981
+ shape: {
982
+ type: "rectangle",
983
+ corners: {
984
+ top_leading: 4,
985
+ top_trailing: 4,
986
+ bottom_leading: 4,
987
+ bottom_trailing: 4,
988
+ },
989
+ },
990
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
991
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
992
+ text_lid: "badge",
993
+ color: { light: { type: "hex", value: "#000000" } },
994
+ font_weight: "bold",
995
+ font_size: "body_s",
996
+ horizontal_alignment: "center",
997
+ background_color: {
998
+ light: { type: "hex", value: "#47aab1" },
999
+ },
1000
+ },
1001
+ },
1002
+ ],
1003
+ labels,
1004
+ border: {
1005
+ width: 2,
1006
+ color: {
1007
+ light: { type: "hex", value: "#47aab1" },
1008
+ },
1009
+ },
1010
+ shape: {
1011
+ type: "rectangle",
1012
+ corners: {
1013
+ top_leading: 8,
1014
+ top_trailing: 8,
1015
+ bottom_leading: 8,
1016
+ bottom_trailing: 8,
1017
+ },
1018
+ },
1019
+ spacing: 16,
1020
+ padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
1021
+ size: {
1022
+ width: { type: "fixed", value: 500 },
1023
+ height: { type: "fixed", value: 500 },
1024
+ },
1025
+ }}
1026
+ />
1027
+
1028
+ <Story
1029
+ name="Badge - edge-to-edge top centered"
1030
+ args={{
1031
+ type: "stack",
1032
+ purchaseState,
1033
+ dimension: {
1034
+ type: "vertical",
1035
+ alignment: "center",
1036
+ distribution: "space_around",
1037
+ },
1038
+ background_color: {
1039
+ light: { type: "hex", value: "#FFFFFF" },
1040
+ dark: { type: "hex", value: "#FFFFFF" },
1041
+ },
1042
+ components,
1043
+ labels,
1044
+ border: {
1045
+ width: 2,
1046
+ color: {
1047
+ light: { type: "hex", value: "#47aab1" },
1048
+ },
1049
+ },
1050
+ shape: {
1051
+ type: "rectangle",
1052
+ corners: {
1053
+ top_leading: 8,
1054
+ top_trailing: 8,
1055
+ bottom_leading: 8,
1056
+ bottom_trailing: 8,
1057
+ },
1058
+ },
1059
+ spacing: 16,
1060
+ padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
1061
+ margin: { top: 32, trailing: 16, bottom: 16, leading: 16 },
1062
+ size: {
1063
+ width: { type: "fixed", value: 500 },
1064
+ height: { type: "fixed", value: 500 },
1065
+ },
1066
+ badge: {
1067
+ stack: {
1068
+ type: "stack",
1069
+ components: [],
1070
+ },
1071
+ style: "edge_to_edge",
1072
+ alignment: "top",
1073
+ shape: {
1074
+ type: "rectangle",
1075
+ corners: {
1076
+ top_leading: 8,
1077
+ top_trailing: 8,
1078
+ bottom_leading: 8,
1079
+ bottom_trailing: 8,
1080
+ },
1081
+ },
1082
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1083
+ margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
1084
+ text_lid: "badge",
1085
+ color: { light: { type: "hex", value: "#000000" } },
1086
+ font_weight: "bold",
1087
+ font_size: "body_s",
1088
+ horizontal_alignment: "center",
1089
+ background_color: {
1090
+ light: { type: "hex", value: "#47aab1" },
1091
+ },
1092
+ },
1093
+ }}
1094
+ />
1095
+
1096
+ <Story
1097
+ name="Badge - edge-to-edge bottom centered"
1098
+ args={{
1099
+ type: "stack",
1100
+ purchaseState,
1101
+ dimension: {
1102
+ type: "vertical",
1103
+ alignment: "center",
1104
+ distribution: "space_around",
1105
+ },
1106
+ background_color: {
1107
+ light: { type: "hex", value: "#FFFFFF" },
1108
+ dark: { type: "hex", value: "#FFFFFF" },
1109
+ },
1110
+ components,
1111
+ labels,
1112
+ border: {
1113
+ width: 2,
1114
+ color: {
1115
+ light: { type: "hex", value: "#47aab1" },
1116
+ },
1117
+ },
1118
+ shape: {
1119
+ type: "rectangle",
1120
+ corners: {
1121
+ top_leading: 8,
1122
+ top_trailing: 8,
1123
+ bottom_leading: 8,
1124
+ bottom_trailing: 8,
1125
+ },
1126
+ },
1127
+ spacing: 16,
1128
+ padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
1129
+ margin: { top: 32, trailing: 16, bottom: 16, leading: 16 },
1130
+ size: {
1131
+ width: { type: "fixed", value: 500 },
1132
+ height: { type: "fixed", value: 500 },
1133
+ },
1134
+ badge: {
1135
+ stack: {
1136
+ type: "stack",
1137
+ components: [],
1138
+ },
1139
+ style: "edge_to_edge",
1140
+ alignment: "bottom",
1141
+ shape: {
1142
+ type: "rectangle",
1143
+ corners: {
1144
+ top_leading: 8,
1145
+ top_trailing: 8,
1146
+ bottom_leading: 8,
1147
+ bottom_trailing: 8,
1148
+ },
1149
+ },
1150
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1151
+ margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
1152
+ text_lid: "badge",
1153
+ color: { light: { type: "hex", value: "#000000" } },
1154
+ font_weight: "bold",
1155
+ font_size: "body_s",
1156
+ horizontal_alignment: "center",
1157
+ background_color: {
1158
+ light: { type: "hex", value: "#47aab1" },
1159
+ },
1160
+ },
1161
+ }}
1162
+ />
1163
+
1164
+ <Story
1165
+ name="Badge - edge-to-edge side centered"
1166
+ args={{
1167
+ type: "stack",
1168
+ purchaseState,
1169
+ dimension: {
1170
+ type: "zlayer",
1171
+ alignment: "center",
1172
+ },
1173
+ background_color: {
1174
+ light: { type: "hex", value: "#FFFFFF" },
1175
+ },
1176
+ components: [
1177
+ {
1178
+ type: "stack",
1179
+ labels,
1180
+ purchaseState,
1181
+ dimension: {
1182
+ type: "zlayer",
1183
+ alignment: "center",
1184
+ },
1185
+ components: [],
1186
+ size: {
1187
+ width: { type: "fixed", value: 500 },
1188
+ height: { type: "fixed", value: 500 },
1189
+ },
1190
+ id: "badge-zstack-base",
1191
+ name: "badge-zstack-base",
1192
+ },
1193
+ {
1194
+ type: "stack",
1195
+ labels,
1196
+ purchaseState,
1197
+ dimension: {
1198
+ type: "zlayer",
1199
+ alignment: "center",
1200
+ },
1201
+ components: [],
1202
+
1203
+ border: {
1204
+ width: 2,
1205
+ color: {
1206
+ light: { type: "hex", value: "#47aab1" },
1207
+ },
1208
+ },
1209
+ size: {
1210
+ width: { type: "fixed", value: 500 },
1211
+ height: { type: "fixed", value: 500 },
1212
+ },
1213
+ id: "badge-zstack-top_leading",
1214
+ name: "badge-zstack-top_leading",
1215
+ badge: {
1216
+ stack: {
1217
+ type: "stack",
1218
+ components: [],
1219
+ },
1220
+ style: "edge_to_edge",
1221
+ alignment: "top_leading",
1222
+ shape: {
1223
+ type: "rectangle",
1224
+ corners: {
1225
+ top_leading: 8,
1226
+ top_trailing: 8,
1227
+ bottom_leading: 8,
1228
+ bottom_trailing: 8,
1229
+ },
1230
+ },
1231
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1232
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1233
+ text_lid: "badge",
1234
+ color: { light: { type: "hex", value: "#000000" } },
1235
+ font_weight: "bold",
1236
+ font_size: "body_s",
1237
+ horizontal_alignment: "center",
1238
+ background_color: {
1239
+ light: { type: "hex", value: "#47aab1" },
1240
+ },
1241
+ },
1242
+ shape: {
1243
+ type: "rectangle",
1244
+ corners: {
1245
+ top_leading: 8,
1246
+ top_trailing: 8,
1247
+ bottom_leading: 8,
1248
+ bottom_trailing: 8,
1249
+ },
1250
+ },
1251
+ },
1252
+ {
1253
+ type: "stack",
1254
+ labels,
1255
+ purchaseState,
1256
+ dimension: {
1257
+ type: "zlayer",
1258
+ alignment: "center",
1259
+ },
1260
+ components: [],
1261
+
1262
+ border: {
1263
+ width: 2,
1264
+ color: {
1265
+ light: { type: "hex", value: "#47aab1" },
1266
+ },
1267
+ },
1268
+ size: {
1269
+ width: { type: "fixed", value: 500 },
1270
+ height: { type: "fixed", value: 500 },
1271
+ },
1272
+ id: "badge-zstack-top_leading",
1273
+ name: "badge-zstack-top_leading",
1274
+ badge: {
1275
+ stack: {
1276
+ type: "stack",
1277
+ components: [],
1278
+ },
1279
+ style: "edge_to_edge",
1280
+ alignment: "top_trailing",
1281
+ shape: {
1282
+ type: "rectangle",
1283
+ corners: {
1284
+ top_leading: 8,
1285
+ top_trailing: 8,
1286
+ bottom_leading: 8,
1287
+ bottom_trailing: 8,
1288
+ },
1289
+ },
1290
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1291
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1292
+ text_lid: "badge",
1293
+ color: { light: { type: "hex", value: "#000000" } },
1294
+ font_weight: "bold",
1295
+ font_size: "body_s",
1296
+ horizontal_alignment: "center",
1297
+ background_color: {
1298
+ light: { type: "hex", value: "#47aab1" },
1299
+ },
1300
+ },
1301
+ shape: {
1302
+ type: "rectangle",
1303
+ corners: {
1304
+ top_leading: 8,
1305
+ top_trailing: 8,
1306
+ bottom_leading: 8,
1307
+ bottom_trailing: 8,
1308
+ },
1309
+ },
1310
+ },
1311
+ {
1312
+ type: "stack",
1313
+ labels,
1314
+ purchaseState,
1315
+ dimension: {
1316
+ type: "zlayer",
1317
+ alignment: "center",
1318
+ },
1319
+ components: [],
1320
+
1321
+ border: {
1322
+ width: 2,
1323
+ color: {
1324
+ light: { type: "hex", value: "#47aab1" },
1325
+ },
1326
+ },
1327
+ size: {
1328
+ width: { type: "fixed", value: 500 },
1329
+ height: { type: "fixed", value: 500 },
1330
+ },
1331
+ id: "badge-zstack-top_leading",
1332
+ name: "badge-zstack-top_leading",
1333
+ badge: {
1334
+ stack: {
1335
+ type: "stack",
1336
+ components: [],
1337
+ },
1338
+ style: "edge_to_edge",
1339
+ alignment: "bottom_leading",
1340
+ shape: {
1341
+ type: "rectangle",
1342
+ corners: {
1343
+ top_leading: 8,
1344
+ top_trailing: 8,
1345
+ bottom_leading: 8,
1346
+ bottom_trailing: 8,
1347
+ },
1348
+ },
1349
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1350
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1351
+ text_lid: "badge",
1352
+ color: { light: { type: "hex", value: "#000000" } },
1353
+ font_weight: "bold",
1354
+ font_size: "body_s",
1355
+ horizontal_alignment: "center",
1356
+ background_color: {
1357
+ light: { type: "hex", value: "#47aab1" },
1358
+ },
1359
+ },
1360
+ shape: {
1361
+ type: "rectangle",
1362
+ corners: {
1363
+ top_leading: 8,
1364
+ top_trailing: 8,
1365
+ bottom_leading: 8,
1366
+ bottom_trailing: 8,
1367
+ },
1368
+ },
1369
+ },
1370
+ {
1371
+ type: "stack",
1372
+ labels,
1373
+ purchaseState,
1374
+ dimension: {
1375
+ type: "zlayer",
1376
+ alignment: "center",
1377
+ },
1378
+ components: [],
1379
+
1380
+ border: {
1381
+ width: 2,
1382
+ color: {
1383
+ light: { type: "hex", value: "#47aab1" },
1384
+ },
1385
+ },
1386
+ size: {
1387
+ width: { type: "fixed", value: 500 },
1388
+ height: { type: "fixed", value: 500 },
1389
+ },
1390
+ id: "badge-zstack-top_leading",
1391
+ name: "badge-zstack-top_leading",
1392
+ badge: {
1393
+ stack: {
1394
+ type: "stack",
1395
+ components: [],
1396
+ },
1397
+ style: "edge_to_edge",
1398
+ alignment: "bottom_trailing",
1399
+ shape: {
1400
+ type: "rectangle",
1401
+ corners: {
1402
+ top_leading: 8,
1403
+ top_trailing: 8,
1404
+ bottom_leading: 8,
1405
+ bottom_trailing: 8,
1406
+ },
1407
+ },
1408
+ padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1409
+ margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1410
+ text_lid: "badge",
1411
+ color: { light: { type: "hex", value: "#000000" } },
1412
+ font_weight: "bold",
1413
+ font_size: "body_s",
1414
+ horizontal_alignment: "center",
1415
+ background_color: {
1416
+ light: { type: "hex", value: "#47aab1" },
1417
+ },
1418
+ },
1419
+ shape: {
1420
+ type: "rectangle",
1421
+ corners: {
1422
+ top_leading: 8,
1423
+ top_trailing: 8,
1424
+ bottom_leading: 8,
1425
+ bottom_trailing: 8,
1426
+ },
1427
+ },
1428
+ },
1429
+ ],
1430
+ labels,
1431
+ border: {
1432
+ width: 2,
1433
+ color: {
1434
+ light: { type: "hex", value: "#47aab1" },
1435
+ },
1436
+ },
1437
+ shape: {
1438
+ type: "rectangle",
1439
+ corners: {
1440
+ top_leading: 8,
1441
+ top_trailing: 8,
1442
+ bottom_leading: 8,
1443
+ bottom_trailing: 8,
1444
+ },
1445
+ },
1446
+ spacing: 16,
1447
+ padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
1448
+ size: {
1449
+ width: { type: "fixed", value: 500 },
1450
+ height: { type: "fixed", value: 500 },
1451
+ },
1452
+ }}
1453
+ />