vviinn-widgets 2.2.2 → 2.4.0

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 (240) hide show
  1. package/dist/cjs/{app-globals-30781f30.js → app-globals-2bcc74df.js} +1 -1
  2. package/dist/cjs/cropper-handler.cjs.entry.js +1 -1
  3. package/dist/cjs/{customized-slots-5d904d8e.js → customized-slots-4202eaf5.js} +1 -1
  4. package/dist/cjs/highlight-box_22.cjs.entry.js +20 -10
  5. package/dist/cjs/{imageSearch.store-128957a4.js → imageSearch.store-cb2b2cc8.js} +14 -11
  6. package/dist/cjs/{index-c493804d.js → index-44fc16ad.js} +7 -9
  7. package/dist/cjs/{index-741a970d.js → index-6771ae25.js} +1 -1
  8. package/dist/cjs/index-e9439500.js +3943 -0
  9. package/dist/cjs/loader.cjs.js +3 -3
  10. package/dist/cjs/{vviinn-carousel_5.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +54 -108
  11. package/dist/cjs/vviinn-error.cjs.entry.js +1 -1
  12. package/dist/cjs/vviinn-preloader.cjs.entry.js +2 -2
  13. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +63 -0
  14. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +44 -0
  15. package/dist/cjs/vviinn-vps-button.cjs.entry.js +4 -4
  16. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +74 -10
  17. package/dist/cjs/vviinn-widgets.cjs.js +3 -3
  18. package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +27 -7
  19. package/dist/collection/components/image-search/search-filters/search-filters.js +24 -1
  20. package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +4 -0
  21. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +6 -3
  22. package/dist/collection/components/vviinn-icons/index.js +6 -8
  23. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +18 -1
  24. package/dist/collection/components/vviinn-product-card/stories/args.js +73 -0
  25. package/dist/collection/components/vviinn-product-card/stories/decorators.js +51 -0
  26. package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +105 -0
  27. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +57 -12
  28. package/dist/collection/components/vviinn-vpr-button/stories/args.js +207 -0
  29. package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +89 -0
  30. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +11 -4
  31. package/dist/collection/components/vviinn-vpr-widget/stories/args.js +190 -0
  32. package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +29 -0
  33. package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +212 -0
  34. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +47 -9
  35. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +5 -0
  36. package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +31 -0
  37. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +3 -0
  38. package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +33 -0
  39. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +108 -10
  40. package/dist/collection/network/utils.js +1 -1
  41. package/dist/collection/openApi/index.js +27 -0
  42. package/dist/collection/{components/vviinn-vpr-widget/GridMode.js → recommendation/events.js} +0 -0
  43. package/dist/collection/store/store.js +7 -9
  44. package/dist/collection/store/tracking.store.js +3 -0
  45. package/dist/collection/tracking/event.js +3 -0
  46. package/dist/collection/tracking/filter.js +5 -0
  47. package/dist/collection/tracking/index.js +13 -0
  48. package/dist/collection/tracking/models.js +6 -0
  49. package/dist/collection/tracking/product.js +18 -0
  50. package/dist/collection/tracking/search.js +5 -0
  51. package/dist/collection/tracking/widget.js +10 -0
  52. package/dist/esm/{app-globals-345e497d.js → app-globals-550daa9b.js} +1 -1
  53. package/dist/esm/cropper-handler.entry.js +1 -1
  54. package/dist/esm/{customized-slots-a76a8d41.js → customized-slots-80625933.js} +1 -1
  55. package/dist/esm/highlight-box_22.entry.js +20 -10
  56. package/dist/esm/{imageSearch.store-8eab0da1.js → imageSearch.store-1268786d.js} +12 -10
  57. package/dist/esm/{index-8cb063df.js → index-1cf740a8.js} +8 -10
  58. package/dist/esm/{index-6fa21e24.js → index-c09e56b6.js} +1 -1
  59. package/dist/esm/index-fa27f1df.js +3934 -0
  60. package/dist/esm/loader.js +3 -3
  61. package/dist/esm/{vviinn-carousel_5.entry.js → vviinn-carousel_3.entry.js} +55 -107
  62. package/dist/esm/vviinn-error.entry.js +1 -1
  63. package/dist/esm/vviinn-preloader.entry.js +2 -2
  64. package/dist/esm/vviinn-recommendations-sidebar.entry.js +59 -0
  65. package/dist/esm/vviinn-vpr-button.entry.js +40 -0
  66. package/dist/esm/vviinn-vps-button.entry.js +4 -4
  67. package/dist/esm/vviinn-vps-widget.entry.js +71 -7
  68. package/dist/esm/vviinn-widgets.js +3 -3
  69. package/dist/types/Image/error.d.ts +1 -0
  70. package/dist/types/Image/form.d.ts +1 -0
  71. package/dist/types/Image/fromFile.d.ts +1 -0
  72. package/dist/types/Image/imageToB64.d.ts +1 -0
  73. package/dist/types/Image/index.d.ts +1 -0
  74. package/dist/types/Image/renderPromise.d.ts +1 -0
  75. package/dist/types/Image/resizeImage.d.ts +1 -0
  76. package/dist/types/Image/sizing.d.ts +1 -0
  77. package/dist/types/Image/toFile.d.ts +1 -0
  78. package/dist/types/analytics/GAnalytics.d.ts +1 -0
  79. package/dist/types/analytics/GeneralAnalytics.d.ts +1 -0
  80. package/dist/types/analytics/GtagAnalytics.d.ts +1 -0
  81. package/dist/types/analytics/ProductAnalytics.d.ts +1 -0
  82. package/dist/types/campaign/Campaign.d.ts +1 -0
  83. package/dist/types/campaign/CampaignService.d.ts +1 -0
  84. package/dist/types/campaign/VCSCampaign.d.ts +1 -0
  85. package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -0
  86. package/dist/types/campaign/VCSCampaignService.d.ts +1 -0
  87. package/dist/types/campaign/VPRCampaignResponse.d.ts +1 -0
  88. package/dist/types/campaign/VPRCampaignService.d.ts +1 -0
  89. package/dist/types/components/customized-slots.d.ts +1 -0
  90. package/dist/types/components/image-search/image-view/highlight-box/highlight-box.d.ts +1 -0
  91. package/dist/types/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.d.ts +1 -0
  92. package/dist/types/components/image-search/image-view/image-cropper/image-cropper.d.ts +4 -0
  93. package/dist/types/components/image-search/search-filters/search-filters.d.ts +4 -0
  94. package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +4 -0
  95. package/dist/types/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.d.ts +1 -0
  96. package/dist/types/components/vviinn-error/vviinn-error.d.ts +1 -0
  97. package/dist/types/components/vviinn-error/vviinn-server-error/vviinn-server-error.d.ts +1 -0
  98. package/dist/types/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.d.ts +1 -0
  99. package/dist/types/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.d.ts +1 -0
  100. package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
  101. package/dist/types/components/vviinn-icons/index.d.ts +1 -0
  102. package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +1 -0
  103. package/dist/types/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.d.ts +3 -0
  104. package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +1 -0
  105. package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
  106. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +1 -0
  107. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +1 -0
  108. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +1 -0
  109. package/dist/types/components/vviinn-onboarding/vviinn-onboarding.d.ts +1 -0
  110. package/dist/types/components/vviinn-overlay/vviinn-overlay.d.ts +1 -0
  111. package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +1 -0
  112. package/dist/types/components/vviinn-preloader/vviinn-preloader.d.ts +1 -0
  113. package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
  114. package/dist/types/components/vviinn-product-card/render-helpers.d.ts +1 -0
  115. package/dist/types/components/vviinn-product-card/stories/args.d.ts +74 -0
  116. package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +2 -0
  117. package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +81 -0
  118. package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +9 -3
  119. package/dist/types/components/vviinn-slider/arrow.d.ts +1 -0
  120. package/dist/types/components/vviinn-slider/vviinn-slide/vviinn-slide.d.ts +1 -0
  121. package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +1 -0
  122. package/dist/types/components/vviinn-teaser/vviinn-teaser.d.ts +1 -0
  123. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +1 -0
  124. package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +208 -0
  125. package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +215 -0
  126. package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +4 -0
  127. package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +199 -0
  128. package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +3 -0
  129. package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +142 -0
  130. package/dist/types/components/vviinn-vpr-widget/token-helpers.d.ts +1 -0
  131. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +10 -1
  132. package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +13 -0
  133. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +1 -0
  134. package/dist/types/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts +11 -0
  135. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +14 -1
  136. package/dist/types/components.d.ts +10 -4
  137. package/dist/types/cropper/Cropper.d.ts +1 -0
  138. package/dist/types/cropper/Handler.d.ts +1 -0
  139. package/dist/types/dom/index.d.ts +1 -0
  140. package/dist/types/error.d.ts +1 -0
  141. package/dist/types/file/index.d.ts +1 -0
  142. package/dist/types/geometry/Clip.d.ts +1 -0
  143. package/dist/types/geometry/Point.d.ts +1 -0
  144. package/dist/types/geometry/Rectangle.d.ts +1 -0
  145. package/dist/types/geometry/RectangleAlt.d.ts +1 -0
  146. package/dist/types/geometry/Sized.d.ts +1 -0
  147. package/dist/types/global.d.ts +1 -0
  148. package/dist/types/index.d.ts +1 -0
  149. package/dist/types/interfaces/generated.d.ts +1 -0
  150. package/dist/types/interfaces/recommendation.d.ts +1 -0
  151. package/dist/types/network/apiClient.d.ts +1 -0
  152. package/dist/types/network/ion/File.d.ts +1 -0
  153. package/dist/types/network/ion/Form.d.ts +1 -0
  154. package/dist/types/network/ion/Link.d.ts +1 -0
  155. package/dist/types/network/ion/ValueObject.d.ts +1 -0
  156. package/dist/types/network/request.d.ts +1 -0
  157. package/dist/types/network/utils.d.ts +1 -0
  158. package/dist/types/openApi/index.d.ts +6 -0
  159. package/dist/types/recommendation/events.d.ts +6 -0
  160. package/dist/types/recommendation/recommendation.d.ts +1 -0
  161. package/dist/types/searchSession/searchSession.d.ts +1 -0
  162. package/dist/types/sentry.d.ts +1 -0
  163. package/dist/types/slider/GridMode.d.ts +1 -0
  164. package/dist/types/store/file-processing.d.ts +1 -0
  165. package/dist/types/store/imageSearch.store.d.ts +1 -0
  166. package/dist/types/store/store.d.ts +8 -6
  167. package/dist/types/store/tracking.store.d.ts +4 -0
  168. package/dist/types/stories/image-selector.stories.d.ts +1 -0
  169. package/dist/types/stories/image-view.stories.d.ts +1 -0
  170. package/dist/types/stories/modal.stories.d.ts +1 -0
  171. package/dist/types/stories/onboarding.stories.d.ts +1 -0
  172. package/dist/types/stories/overlay.stories.d.ts +1 -0
  173. package/dist/types/stories/overlayedModal.stories.d.ts +1 -0
  174. package/dist/types/stories/privacy-badge.stories.d.ts +1 -0
  175. package/dist/types/stories/slider.stories.d.ts +1 -0
  176. package/dist/types/stories/teaser.stories.d.ts +1 -0
  177. package/dist/types/stories/vps-widget.stories.d.ts +1 -0
  178. package/dist/types/stories/vviinn-product.stories.d.ts +1 -0
  179. package/dist/types/tracking/event.d.ts +4 -0
  180. package/dist/types/tracking/filter.d.ts +3 -0
  181. package/dist/types/tracking/index.d.ts +9 -0
  182. package/dist/types/tracking/models.d.ts +13 -0
  183. package/dist/types/tracking/product.d.ts +7 -0
  184. package/dist/types/tracking/search.d.ts +3 -0
  185. package/dist/types/tracking/widget.d.ts +5 -0
  186. package/dist/types/utils/collections/collectionsUtils.d.ts +1 -0
  187. package/dist/types/utils/either.d.ts +1 -0
  188. package/dist/types/utils/enum/enumUtils.d.ts +1 -0
  189. package/dist/types/utils/event/Events.d.ts +1 -0
  190. package/dist/types/utils/number/index.d.ts +1 -0
  191. package/dist/types/utils/option/option.d.ts +1 -0
  192. package/dist/types/utils/semigroup/semigroupDiff.d.ts +1 -0
  193. package/dist/types/utils/token/tokenUtils.d.ts +1 -0
  194. package/dist/vviinn-widgets/{p-78ccc9eb.js → p-07125f64.js} +1 -1
  195. package/dist/vviinn-widgets/{p-f47e82b2.entry.js → p-27ede517.entry.js} +1 -1
  196. package/dist/vviinn-widgets/{p-9d24f51e.entry.js → p-314e40b3.entry.js} +1 -1
  197. package/dist/vviinn-widgets/p-316abc01.js +1 -0
  198. package/dist/vviinn-widgets/{p-fb14e3cc.entry.js → p-4bdb3027.entry.js} +1 -1
  199. package/dist/vviinn-widgets/p-5535163a.entry.js +1 -0
  200. package/dist/vviinn-widgets/{p-59edfbe2.js → p-78b65f70.js} +1 -1
  201. package/dist/vviinn-widgets/{p-400eb62f.entry.js → p-86ae782f.entry.js} +1 -1
  202. package/dist/vviinn-widgets/p-89f2c19a.entry.js +1 -0
  203. package/dist/vviinn-widgets/{p-e1ba8626.js → p-8e25b838.js} +1 -1
  204. package/dist/vviinn-widgets/p-94aa8705.entry.js +1 -0
  205. package/dist/vviinn-widgets/{p-e67cae57.js → p-97af45f0.js} +1 -1
  206. package/dist/vviinn-widgets/p-c5e6ec4f.js +1 -0
  207. package/dist/vviinn-widgets/p-c63fb46b.entry.js +1 -0
  208. package/{www/build/p-d085199d.entry.js → dist/vviinn-widgets/p-dd7cac6e.entry.js} +1 -1
  209. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  210. package/package.json +11 -3
  211. package/www/build/{p-78ccc9eb.js → p-07125f64.js} +1 -1
  212. package/www/build/{p-f47e82b2.entry.js → p-27ede517.entry.js} +1 -1
  213. package/www/build/{p-9d24f51e.entry.js → p-314e40b3.entry.js} +1 -1
  214. package/www/build/p-316abc01.js +1 -0
  215. package/www/build/{p-fb14e3cc.entry.js → p-4bdb3027.entry.js} +1 -1
  216. package/www/build/p-5535163a.entry.js +1 -0
  217. package/www/build/{p-59edfbe2.js → p-78b65f70.js} +1 -1
  218. package/www/build/{p-400eb62f.entry.js → p-86ae782f.entry.js} +1 -1
  219. package/www/build/p-89f2c19a.entry.js +1 -0
  220. package/www/build/{p-e1ba8626.js → p-8e25b838.js} +1 -1
  221. package/www/build/p-94aa8705.entry.js +1 -0
  222. package/www/build/p-961822d3.js +125 -0
  223. package/www/build/{p-e67cae57.js → p-97af45f0.js} +1 -1
  224. package/www/build/p-c5e6ec4f.js +1 -0
  225. package/www/build/p-c63fb46b.entry.js +1 -0
  226. package/{dist/vviinn-widgets/p-d085199d.entry.js → www/build/p-dd7cac6e.entry.js} +1 -1
  227. package/www/build/p-e0153ae2.css +6 -0
  228. package/www/build/vviinn-widgets.esm.js +1 -1
  229. package/www/index.html +1 -177
  230. package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +0 -18
  231. package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +0 -7
  232. package/dist/types/components/vviinn-vpr-widget/GridMode.d.ts +0 -1
  233. package/dist/vviinn-widgets/p-04b06ea9.entry.js +0 -1
  234. package/dist/vviinn-widgets/p-56fc949a.js +0 -1
  235. package/dist/vviinn-widgets/p-e38f4aa2.entry.js +0 -1
  236. package/www/build/p-04b06ea9.entry.js +0 -1
  237. package/www/build/p-56fc949a.js +0 -1
  238. package/www/build/p-7e4978d5.js +0 -1
  239. package/www/build/p-a67898be.css +0 -1
  240. package/www/build/p-e38f4aa2.entry.js +0 -1
@@ -0,0 +1,207 @@
1
+ export const argTypes = {
2
+ buttonSize: {
3
+ name: "Button size",
4
+ options: ["Default", "Small", "Large"],
5
+ mapping: {
6
+ Default: 40,
7
+ Small: 32,
8
+ Large: 48,
9
+ },
10
+ control: {
11
+ type: "select",
12
+ labels: {
13
+ Default: "Default (40px)",
14
+ Small: "Small (32px)",
15
+ Large: "Large (48px)",
16
+ },
17
+ },
18
+ defaultValue: "Default",
19
+ },
20
+ iconColor: {
21
+ name: "Icon color",
22
+ control: {
23
+ type: "color",
24
+ },
25
+ defaultValue: "#000000",
26
+ },
27
+ backgroundColor: {
28
+ name: "Background color",
29
+ control: {
30
+ type: "color",
31
+ },
32
+ defaultValue: "#ffffff",
33
+ },
34
+ backgroundOpacity: {
35
+ name: "Background opacity (%)",
36
+ control: {
37
+ type: "number",
38
+ },
39
+ defaultValue: 100,
40
+ },
41
+ radius: {
42
+ name: "Radius (px)",
43
+ control: {
44
+ type: "number",
45
+ },
46
+ defaultValue: 20,
47
+ },
48
+ border: {
49
+ name: "Border",
50
+ control: {
51
+ type: "boolean",
52
+ },
53
+ defaultValue: false,
54
+ },
55
+ borderColor: {
56
+ name: "Border color",
57
+ control: {
58
+ type: "color",
59
+ },
60
+ defaultValue: "#cccccc",
61
+ },
62
+ shadow: {
63
+ name: "Shadow",
64
+ control: {
65
+ type: "boolean",
66
+ },
67
+ defaultValue: true,
68
+ },
69
+ position: {
70
+ name: "Modal container appearance",
71
+ options: ["bottom", "right"],
72
+ control: {
73
+ type: "select",
74
+ labels: {
75
+ bottom: "From bottom",
76
+ right: "From right",
77
+ },
78
+ },
79
+ defaultValue: "bottom",
80
+ },
81
+ backdropOpacity: {
82
+ name: "Backdrop opacity (%)",
83
+ control: {
84
+ type: "number",
85
+ },
86
+ defaultValue: 50,
87
+ },
88
+ sidebarBorderRadius: {
89
+ name: "Modal container round corners (px)",
90
+ control: {
91
+ type: "number",
92
+ },
93
+ defaultValue: 16,
94
+ },
95
+ showSourceImage: {
96
+ name: "Modal container show source image",
97
+ control: {
98
+ type: "boolean",
99
+ },
100
+ defaultValue: true,
101
+ },
102
+ sourceImageSize: {
103
+ name: "Source image size",
104
+ options: ["Default", "Small", "Large"],
105
+ mapping: {
106
+ Default: 64,
107
+ Small: 48,
108
+ Large: 80,
109
+ },
110
+ control: {
111
+ type: "select",
112
+ labels: {
113
+ Default: "Default (64px)",
114
+ Small: "Small (48px)",
115
+ Large: "Large (80px)",
116
+ },
117
+ },
118
+ defaultValue: "Default",
119
+ },
120
+ sourceImageBorder: {
121
+ name: "Source image border",
122
+ control: {
123
+ type: "boolean",
124
+ },
125
+ defaultValue: false,
126
+ },
127
+ sourceImageBorderColor: {
128
+ name: "Source image border color",
129
+ control: {
130
+ type: "color",
131
+ },
132
+ defaultValue: "#cccccc",
133
+ },
134
+ sourceImageShadow: {
135
+ name: "Source image shadow",
136
+ control: {
137
+ type: "boolean",
138
+ },
139
+ defaultValue: true,
140
+ },
141
+ font: {
142
+ name: "Font family",
143
+ options: ["Inter", "System", "Arial"],
144
+ mapping: {
145
+ Inter: "'Inter', sans-serif",
146
+ System: `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
147
+ Arial: "Arial, sans-serif",
148
+ },
149
+ control: {
150
+ type: "select",
151
+ labels: {
152
+ Inter: "Inter",
153
+ System: "System stack",
154
+ Arial: "Arial (web safe)",
155
+ },
156
+ },
157
+ defaultValue: "Inter",
158
+ },
159
+ primaryTextColor: {
160
+ name: "Primary text color",
161
+ control: {
162
+ type: "color",
163
+ },
164
+ defaultValue: "#161616",
165
+ },
166
+ secondaryTextColor: {
167
+ name: "Secondary text color",
168
+ control: {
169
+ type: "color",
170
+ },
171
+ defaultValue: "#757575",
172
+ },
173
+ modalTitle: {
174
+ name: "Modal container title",
175
+ control: {
176
+ type: "boolean",
177
+ },
178
+ defaultValue: true,
179
+ },
180
+ sidebarTitle: {
181
+ name: "Modal container title name",
182
+ control: {
183
+ type: "text",
184
+ },
185
+ defaultValue: "Visually similar products",
186
+ },
187
+ modalTitleFontSize: {
188
+ name: "Modal container title font size (px)",
189
+ control: {
190
+ type: "number",
191
+ },
192
+ defaultValue: 28,
193
+ },
194
+ modalScrollbar: {
195
+ name: "Use default horizontal scrollbar in modal container",
196
+ control: {
197
+ type: "boolean",
198
+ },
199
+ defaultValue: false,
200
+ },
201
+ productId: {
202
+ name: "Product id",
203
+ },
204
+ token: {
205
+ name: "Token",
206
+ },
207
+ };
@@ -0,0 +1,89 @@
1
+ import { withDesign } from "storybook-addon-designs";
2
+ import { argTypes } from "./args";
3
+ const centerDecorator = (story) => `
4
+ <div style="display: grid;
5
+ position: absolute;
6
+ top: 0;
7
+ bottom: 0;
8
+ left: 0;
9
+ right: 0;
10
+ align-items: center;
11
+ justify-items: center;">
12
+ ${story()}
13
+ </div>
14
+ `;
15
+ export default {
16
+ title: "Widgets/Visual Recommendations/Button",
17
+ component: "vviinn-vpr-button",
18
+ decorators: [withDesign, centerDecorator],
19
+ argTypes,
20
+ };
21
+ const Template = (args) => `<style>
22
+ body {
23
+ font-family: ${args.font};
24
+ }
25
+
26
+ vviinn-vpr-button::part(button) {
27
+ width: ${args.buttonSize}px;
28
+ height: ${args.buttonSize}px;
29
+ fill: ${args.iconColor};
30
+ background: ${args.backgroundColor};
31
+ opacity: ${args.backgroundOpacity}%;
32
+ border-radius: ${args.radius}px;
33
+ border: ${args.border ? "1px solid" : "none"};
34
+ border-color: ${args.borderColor};
35
+ ${args.shadow ? "" : "box-shadow: none;"}
36
+ }
37
+
38
+ vviinn-recommendations-sidebar::part(title) {
39
+ display: ${args.modalTitle ? "inline" : "none"};
40
+ font-size: ${args.modalTitleFontSize}px;
41
+ }
42
+
43
+ vviinn-recommendations-sidebar::part(product-title),
44
+ vviinn-recommendations-sidebar::part(brand),
45
+ vviinn-recommendations-sidebar::part(type),
46
+ vviinn-recommendations-sidebar::part(price-regular),
47
+ vviinn-recommendations-sidebar::part(price-sale) {
48
+ color: ${args.primaryTextColor};
49
+ }
50
+
51
+ vviinn-recommendations-sidebar::part(price-outdated) {
52
+ color: ${args.secondaryTextColor};
53
+ }
54
+
55
+ vviinn-recommendations-sidebar.open {
56
+ background: rgba(0, 0, 0, 0.1);
57
+ }
58
+
59
+ vviinn-recommendations-sidebar::part(body) {
60
+ border-radius: ${args.sidebarBorderRadius}px ${args.sidebarBorderRadius}px 0 0;
61
+ }
62
+
63
+ vviinn-recommendations-sidebar::part(source-image) {
64
+ width: ${args.sourceImageSize}px;
65
+ height: ${args.sourceImageSize}px;
66
+ border: ${args.sourceImageBorder ? "1px solid" : "none"};
67
+ border-color: ${args.sourceImageBorderColor};
68
+ ${args.sourceImageShadow ? "" : "box-shadow: none;"}
69
+ }
70
+ </style>
71
+ <vviinn-vpr-button token="${args.token}"
72
+ product-id="${args.productId}"
73
+ position="${args.position}"
74
+ sidebar-title="${args.sidebarTitle}"
75
+ modal-scrollbar="${args.modalScrollbar}"
76
+ source-image="${args.showSourceImage
77
+ ? "https://www.moebel-shop.de/media/image/e3/e9/28/0749295-001_600x600.jpg"
78
+ : ""}"></vviinn-vpr-button>`;
79
+ export const Default = Template.bind({});
80
+ Default.args = {
81
+ token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjgzLCJqdGkiOiI3ZTg2Y2I1YS00ZTFjLTRhYjctYjU2My1lN2FjMTYzZTYyZDIiLCJzY29wZXMiOlsidnByIiwidnBzIiwidnBjIl19.SbaQnBkvoXer3GPCWUthFQStFKLHZNMBfj4Qu44WHM8nzaIt48I74yVy4gVbX29vtd6jIkDPdakqEXRXmAxOCtv7_nsd4iBs1yMegfOWW5g8f10PKfZqmWJcfhwKIEElnUMFmP6rXpogntZ7iFfeTBbiRNzQPhkaa7jUjgQkCC4",
82
+ productId: "4114460310",
83
+ };
84
+ Default.parameters = {
85
+ design: {
86
+ type: "figma",
87
+ url: "https://www.figma.com/file/YR5ZK1s4z9ZRUXytB8uVuj/Widgets?node-id=591%3A3859",
88
+ },
89
+ };
@@ -10,6 +10,10 @@ export class VviinnVprButton {
10
10
  this.sourceImage = null;
11
11
  this.sidebarTitle = "Visually similar products";
12
12
  this.modalScrollbar = false;
13
+ this.sidebar = null;
14
+ this.sidebarCloseListener = () => {
15
+ document.body.removeChild(this.sidebar);
16
+ };
13
17
  }
14
18
  render() {
15
19
  return (h(Host, null,
@@ -25,10 +29,13 @@ export class VviinnVprButton {
25
29
  sidebar.position = this.position;
26
30
  sidebar.sourceImage = this.sourceImage;
27
31
  sidebar.widgetScrollbar = this.modalScrollbar;
28
- sidebar.addEventListener("modalClosed", () => {
29
- document.body.removeChild(sidebar);
30
- });
31
- document.body.append(sidebar);
32
+ this.sidebar = sidebar;
33
+ sidebar.addEventListener("modalClosed", this.sidebarCloseListener);
34
+ document.body.append(this.sidebar);
35
+ }
36
+ disconnectedCallback() {
37
+ this.sidebar.removeEventListener("modalCLosed", this.sidebarCloseListener);
38
+ document.body.removeChild(this.sidebar);
32
39
  }
33
40
  static get is() { return "vviinn-vpr-button"; }
34
41
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,190 @@
1
+ export const apiPath = {
2
+ name: "api-path",
3
+ control: {
4
+ type: "text",
5
+ },
6
+ table: {
7
+ defaultValue: { summary: "https://api.vviinn.com" },
8
+ },
9
+ };
10
+ const token = {
11
+ name: "token",
12
+ control: {
13
+ type: "text",
14
+ },
15
+ };
16
+ const productId = {
17
+ name: "product-id",
18
+ control: {
19
+ type: "text",
20
+ },
21
+ };
22
+ const cssUrl = {
23
+ name: "css-url",
24
+ description: "Optional for custom CSS. It will overwrite all other settings.",
25
+ control: {
26
+ type: "text",
27
+ },
28
+ required: false,
29
+ };
30
+ const analyticsId = {
31
+ name: "Google tracking account ID",
32
+ description: "Optional. Goolge Analytics account id or tag manager id and click events will be send for analytics product lists",
33
+ control: {
34
+ type: "text",
35
+ },
36
+ required: false,
37
+ };
38
+ export const campaignType = {
39
+ name: "campaign-type",
40
+ control: {
41
+ type: "select",
42
+ labels: {
43
+ VPR: "Visually similar products (VPR)",
44
+ VCS: "Visually cross-selling (VCS)",
45
+ },
46
+ },
47
+ required: false,
48
+ };
49
+ const showTitle = {
50
+ name: "Section title",
51
+ control: {
52
+ type: "boolean",
53
+ },
54
+ table: {
55
+ defaultValue: { summary: true },
56
+ },
57
+ required: false,
58
+ };
59
+ const titleName = {
60
+ name: "block-title",
61
+ control: {
62
+ type: "text",
63
+ },
64
+ table: {
65
+ defaultValue: { summary: "Recommended products" },
66
+ },
67
+ required: false,
68
+ };
69
+ const titleFontSize = {
70
+ name: "Section title name font size (px)",
71
+ control: {
72
+ type: "number",
73
+ },
74
+ required: false,
75
+ };
76
+ const showScrollbars = {
77
+ name: "show-scroll",
78
+ description: "Add browser default horizontal scroll bar (in continuity mode) or pagination bullets (in grid mode) to add extra cue for users ",
79
+ control: {
80
+ type: "boolean",
81
+ },
82
+ required: false,
83
+ };
84
+ const imageWidth = {
85
+ name: "image-width",
86
+ control: {
87
+ type: "number",
88
+ },
89
+ };
90
+ const contentAlignment = {
91
+ name: "Content alignment",
92
+ options: ["Left", "Centered", "Right"],
93
+ mapping: {
94
+ Left: 0,
95
+ Centered: 1,
96
+ Right: 2,
97
+ },
98
+ control: {
99
+ type: "select",
100
+ default: 0,
101
+ },
102
+ };
103
+ const primaryTextColor = {
104
+ name: "Primary text color",
105
+ control: {
106
+ type: "color",
107
+ },
108
+ description: "Used where the most user attention is needed: product brand, product title, and price.",
109
+ };
110
+ const secondaryTextColor = {
111
+ name: "Secondary text color",
112
+ description: "Used in Old Price",
113
+ control: {
114
+ type: "color",
115
+ },
116
+ };
117
+ export const argTypes = {
118
+ analyticsId,
119
+ apiPath,
120
+ campaignType,
121
+ contentAlignment,
122
+ cssUrl,
123
+ imageWidth,
124
+ primaryTextColor,
125
+ productId,
126
+ secondaryTextColor,
127
+ showScrollbars,
128
+ showTitle,
129
+ titleFontSize,
130
+ titleName,
131
+ token,
132
+ };
133
+ const recommendationsGridProductsDesktop = {
134
+ name: "Product cards shown on desktop",
135
+ description: "Desktop mode is bigger than 1024px. (Use arrow buttons to apply changes)",
136
+ control: {
137
+ type: "number",
138
+ },
139
+ required: false,
140
+ };
141
+ const recommendationsGridProductsTablet = {
142
+ name: "Product cards shown on tablet",
143
+ description: "How many product cards users will see inside one grid in a screen 768px-1024px. (Use arrow buttons to apply changes)",
144
+ control: {
145
+ type: "number",
146
+ },
147
+ required: false,
148
+ };
149
+ const recommendationsGridProductsMobile = {
150
+ name: "Product cards shown on mobile",
151
+ description: "How many product cards users will see inside one grid in a screen <768. (Use arrow buttons to apply changes)",
152
+ control: {
153
+ type: "number",
154
+ },
155
+ required: false,
156
+ };
157
+ export const gridLayoutArgs = {
158
+ recommendationsGridProductsDesktop,
159
+ recommendationsGridProductsTablet,
160
+ recommendationsGridProductsMobile,
161
+ };
162
+ const recommendationsContinuityProductsDesktop = {
163
+ name: "Product cards width in a L screen [px]",
164
+ description: "How wide product cards will be on a screen bigger than 1024px width",
165
+ control: {
166
+ type: "number",
167
+ },
168
+ required: false,
169
+ };
170
+ const recommendationsContinuityProductsTablet = {
171
+ name: "Product cards width in a M screen [px]",
172
+ description: "How wide product cards will be on a screen from 768px-1024px width",
173
+ control: {
174
+ type: "number",
175
+ },
176
+ required: false,
177
+ };
178
+ const recommendationsContinuityProductsMobile = {
179
+ name: "Product cards width in a S screen [px]",
180
+ description: "How wide product cards will be on a screen smaller than 768px width",
181
+ control: {
182
+ type: "number",
183
+ },
184
+ required: false,
185
+ };
186
+ export const continuityLayoutArgs = {
187
+ recommendationsContinuityProductsDesktop,
188
+ recommendationsContinuityProductsTablet,
189
+ recommendationsContinuityProductsMobile,
190
+ };
@@ -0,0 +1,29 @@
1
+ export const gridDecorator = (story) => `
2
+ <style>
3
+ @media (min-width: 836px) {
4
+ #root-inner {
5
+ padding: 0 10%;
6
+ }
7
+ }
8
+
9
+ @media (max-width: 860px) {
10
+ vviinn-product-card::part(title),
11
+ vviinn-product-card::part(brand),
12
+ vviinn-product-card::part(type),
13
+ vviinn-product-card::part(price-container) {
14
+ font-size: 14px;
15
+ }
16
+ }
17
+ </style>
18
+ ${story()}
19
+ `;
20
+ export const continuityDecorator = (story) => `
21
+ <style>
22
+ @media (min-width: 836px) {
23
+ #root-inner {
24
+ padding-left: 10%;
25
+ }
26
+ }
27
+ </style>
28
+ ${story()}
29
+ `;