@bikdotai/bik-component-library 0.0.725-beta.1 → 0.0.725-beta.10

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 (141) hide show
  1. package/dist/cjs/assets/icons/searchIcon.svg.js +1 -0
  2. package/dist/cjs/assets/icons/whatsNew.svg.js +1 -0
  3. package/dist/cjs/components/dropdown/DropdownPopover/index.d.ts +0 -1
  4. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  5. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.d.ts +4 -0
  6. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -0
  7. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +4 -0
  8. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -0
  9. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +4 -0
  10. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -0
  11. package/dist/cjs/components/feature-announcements/VideoModal.d.ts +3 -0
  12. package/dist/cjs/components/feature-announcements/VideoModal.js +1 -0
  13. package/dist/cjs/components/feature-announcements/constants/animations.d.ts +27 -0
  14. package/dist/cjs/components/feature-announcements/constants/animations.js +1 -0
  15. package/dist/cjs/components/feature-announcements/constants/dimensions.d.ts +56 -0
  16. package/dist/cjs/components/feature-announcements/constants/dimensions.js +1 -0
  17. package/dist/cjs/components/feature-announcements/constants/index.d.ts +19 -0
  18. package/dist/cjs/components/feature-announcements/constants/index.js +1 -0
  19. package/dist/cjs/components/feature-announcements/constants/localStorageKeys.d.ts +18 -0
  20. package/dist/cjs/components/feature-announcements/constants/localStorageKeys.js +1 -0
  21. package/dist/cjs/components/feature-announcements/constants/selectors.d.ts +21 -0
  22. package/dist/cjs/components/feature-announcements/constants/selectors.js +1 -0
  23. package/dist/cjs/components/feature-announcements/constants/zIndex.d.ts +10 -0
  24. package/dist/cjs/components/feature-announcements/constants/zIndex.js +1 -0
  25. package/dist/cjs/components/feature-announcements/hooks/index.d.ts +1 -0
  26. package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +13 -0
  27. package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.js +1 -0
  28. package/dist/cjs/components/feature-announcements/index.d.ts +7 -0
  29. package/dist/cjs/components/feature-announcements/styles/index.d.ts +4 -0
  30. package/dist/cjs/components/feature-announcements/styles/joyride.styles.d.ts +125 -0
  31. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.d.ts +23 -0
  32. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.js +1 -0
  33. package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.d.ts +16 -0
  34. package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.js +1 -0
  35. package/dist/cjs/components/feature-announcements/styles/videoModal.styles.d.ts +13 -0
  36. package/dist/cjs/components/feature-announcements/styles/videoModal.styles.js +1 -0
  37. package/dist/cjs/components/feature-announcements/types/feature.types.d.ts +41 -0
  38. package/dist/cjs/components/feature-announcements/types/index.d.ts +4 -0
  39. package/dist/cjs/components/feature-announcements/types/props.types.d.ts +43 -0
  40. package/dist/cjs/components/feature-announcements/types/repository.types.d.ts +11 -0
  41. package/dist/cjs/components/feature-announcements/types/router.types.d.ts +7 -0
  42. package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.d.ts +13 -0
  43. package/dist/cjs/components/feature-announcements/utils/animationHelpers.d.ts +18 -0
  44. package/dist/cjs/components/feature-announcements/utils/animationHelpers.js +1 -0
  45. package/dist/cjs/components/feature-announcements/utils/elementHelpers.d.ts +30 -0
  46. package/dist/cjs/components/feature-announcements/utils/elementHelpers.js +1 -0
  47. package/dist/cjs/components/feature-announcements/utils/htmlHelpers.d.ts +18 -0
  48. package/dist/cjs/components/feature-announcements/utils/htmlHelpers.js +1 -0
  49. package/dist/cjs/components/feature-announcements/utils/index.d.ts +3 -0
  50. package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +2 -0
  51. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  52. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  53. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +2 -0
  54. package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
  55. package/dist/cjs/components/whats-new/WhatsNew.d.ts +23 -0
  56. package/dist/cjs/components/whats-new/WhatsNew.js +1 -0
  57. package/dist/cjs/components/whats-new/WhatsNew.styles.d.ts +11 -0
  58. package/dist/cjs/components/whats-new/WhatsNew.styles.js +185 -0
  59. package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +58 -0
  60. package/dist/cjs/components/whats-new/WhatsNewButton.d.ts +3 -0
  61. package/dist/cjs/components/whats-new/WhatsNewButton.js +1 -0
  62. package/dist/cjs/components/whats-new/WhatsNewPanel.d.ts +3 -0
  63. package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -0
  64. package/dist/cjs/components/whats-new/WhatsNewProvider.d.ts +4 -0
  65. package/dist/cjs/components/whats-new/WhatsNewProvider.js +1 -0
  66. package/dist/cjs/components/whats-new/index.d.ts +7 -0
  67. package/dist/cjs/components/whats-new/useWhatsNew.d.ts +9 -0
  68. package/dist/cjs/components/whats-new/useWhatsNew.js +1 -0
  69. package/dist/cjs/index.d.ts +2 -0
  70. package/dist/cjs/index.js +1 -1
  71. package/dist/esm/assets/icons/searchIcon.svg.js +1 -0
  72. package/dist/esm/assets/icons/whatsNew.svg.js +1 -0
  73. package/dist/esm/components/dropdown/DropdownPopover/index.d.ts +0 -1
  74. package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
  75. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +4 -0
  76. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -0
  77. package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +4 -0
  78. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -0
  79. package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +4 -0
  80. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -0
  81. package/dist/esm/components/feature-announcements/VideoModal.d.ts +3 -0
  82. package/dist/esm/components/feature-announcements/VideoModal.js +1 -0
  83. package/dist/esm/components/feature-announcements/constants/animations.d.ts +27 -0
  84. package/dist/esm/components/feature-announcements/constants/animations.js +1 -0
  85. package/dist/esm/components/feature-announcements/constants/dimensions.d.ts +56 -0
  86. package/dist/esm/components/feature-announcements/constants/dimensions.js +1 -0
  87. package/dist/esm/components/feature-announcements/constants/index.d.ts +19 -0
  88. package/dist/esm/components/feature-announcements/constants/index.js +1 -0
  89. package/dist/esm/components/feature-announcements/constants/localStorageKeys.d.ts +18 -0
  90. package/dist/esm/components/feature-announcements/constants/localStorageKeys.js +1 -0
  91. package/dist/esm/components/feature-announcements/constants/selectors.d.ts +21 -0
  92. package/dist/esm/components/feature-announcements/constants/selectors.js +1 -0
  93. package/dist/esm/components/feature-announcements/constants/zIndex.d.ts +10 -0
  94. package/dist/esm/components/feature-announcements/constants/zIndex.js +1 -0
  95. package/dist/esm/components/feature-announcements/hooks/index.d.ts +1 -0
  96. package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +13 -0
  97. package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.js +1 -0
  98. package/dist/esm/components/feature-announcements/index.d.ts +7 -0
  99. package/dist/esm/components/feature-announcements/styles/index.d.ts +4 -0
  100. package/dist/esm/components/feature-announcements/styles/joyride.styles.d.ts +125 -0
  101. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.d.ts +23 -0
  102. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.js +1 -0
  103. package/dist/esm/components/feature-announcements/styles/minorPopup.styles.d.ts +16 -0
  104. package/dist/esm/components/feature-announcements/styles/minorPopup.styles.js +1 -0
  105. package/dist/esm/components/feature-announcements/styles/videoModal.styles.d.ts +13 -0
  106. package/dist/esm/components/feature-announcements/styles/videoModal.styles.js +1 -0
  107. package/dist/esm/components/feature-announcements/types/feature.types.d.ts +41 -0
  108. package/dist/esm/components/feature-announcements/types/index.d.ts +4 -0
  109. package/dist/esm/components/feature-announcements/types/props.types.d.ts +43 -0
  110. package/dist/esm/components/feature-announcements/types/repository.types.d.ts +11 -0
  111. package/dist/esm/components/feature-announcements/types/router.types.d.ts +7 -0
  112. package/dist/esm/components/feature-announcements/useFeatureAnnouncements.d.ts +13 -0
  113. package/dist/esm/components/feature-announcements/utils/animationHelpers.d.ts +18 -0
  114. package/dist/esm/components/feature-announcements/utils/animationHelpers.js +1 -0
  115. package/dist/esm/components/feature-announcements/utils/elementHelpers.d.ts +30 -0
  116. package/dist/esm/components/feature-announcements/utils/elementHelpers.js +1 -0
  117. package/dist/esm/components/feature-announcements/utils/htmlHelpers.d.ts +18 -0
  118. package/dist/esm/components/feature-announcements/utils/htmlHelpers.js +1 -0
  119. package/dist/esm/components/feature-announcements/utils/index.d.ts +3 -0
  120. package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +2 -0
  121. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
  122. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  123. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +2 -0
  124. package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
  125. package/dist/esm/components/whats-new/WhatsNew.d.ts +23 -0
  126. package/dist/esm/components/whats-new/WhatsNew.js +1 -0
  127. package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +11 -0
  128. package/dist/esm/components/whats-new/WhatsNew.styles.js +185 -0
  129. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +58 -0
  130. package/dist/esm/components/whats-new/WhatsNewButton.d.ts +3 -0
  131. package/dist/esm/components/whats-new/WhatsNewButton.js +1 -0
  132. package/dist/esm/components/whats-new/WhatsNewPanel.d.ts +3 -0
  133. package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -0
  134. package/dist/esm/components/whats-new/WhatsNewProvider.d.ts +4 -0
  135. package/dist/esm/components/whats-new/WhatsNewProvider.js +1 -0
  136. package/dist/esm/components/whats-new/index.d.ts +7 -0
  137. package/dist/esm/components/whats-new/useWhatsNew.d.ts +9 -0
  138. package/dist/esm/components/whats-new/useWhatsNew.js +1 -0
  139. package/dist/esm/index.d.ts +2 -0
  140. package/dist/esm/index.js +1 -1
  141. package/package.json +2 -1
@@ -0,0 +1,125 @@
1
+ export declare const majorStepStyles: {
2
+ tooltip: {
3
+ padding: number;
4
+ backgroundColor: string;
5
+ borderRadius: string;
6
+ border: string;
7
+ filter: string;
8
+ boxShadow: string;
9
+ };
10
+ tooltipContent: {
11
+ padding: number;
12
+ };
13
+ buttonNext: {
14
+ display: string;
15
+ };
16
+ buttonBack: {
17
+ display: string;
18
+ };
19
+ buttonClose: {
20
+ display: string;
21
+ };
22
+ buttonSkip: {
23
+ display: string;
24
+ };
25
+ };
26
+ export declare const minorStepStyles: {
27
+ tooltip: {
28
+ padding: number;
29
+ backgroundColor: string;
30
+ borderRadius: "4px";
31
+ border: string;
32
+ filter: string;
33
+ boxShadow: string;
34
+ };
35
+ tooltipContent: {
36
+ padding: number;
37
+ };
38
+ buttonNext: {
39
+ display: string;
40
+ };
41
+ buttonBack: {
42
+ display: string;
43
+ };
44
+ buttonClose: {
45
+ display: string;
46
+ };
47
+ buttonSkip: {
48
+ display: string;
49
+ };
50
+ };
51
+ export declare const getMajorJoyrideStyles: (isClosing: boolean) => {
52
+ options: {
53
+ arrowColor: string;
54
+ backgroundColor: string;
55
+ overlayColor: string;
56
+ primaryColor: string;
57
+ textColor: string;
58
+ zIndex: 10000;
59
+ };
60
+ tooltip: {
61
+ padding: number;
62
+ backgroundColor: string;
63
+ borderRadius: string;
64
+ border: string;
65
+ filter: string;
66
+ boxShadow: string;
67
+ position: "fixed";
68
+ top: string;
69
+ left: string;
70
+ transform: string;
71
+ };
72
+ tooltipContent: {
73
+ padding: number;
74
+ };
75
+ buttonNext: {
76
+ display: string;
77
+ };
78
+ buttonBack: {
79
+ display: string;
80
+ };
81
+ buttonClose: {
82
+ display: string;
83
+ };
84
+ buttonSkip: {
85
+ display: string;
86
+ };
87
+ };
88
+ export declare const getMinorJoyrideStyles: (isClosing: boolean) => {
89
+ options: {
90
+ arrowColor: string;
91
+ backgroundColor: string;
92
+ overlayColor: string;
93
+ primaryColor: string;
94
+ textColor: string;
95
+ zIndex: 10000;
96
+ };
97
+ spotlight: {
98
+ boxShadow: string;
99
+ borderRadius: "8px";
100
+ };
101
+ tooltip: {
102
+ padding: number;
103
+ backgroundColor: string;
104
+ borderRadius: "4px";
105
+ border: string;
106
+ filter: string;
107
+ boxShadow: string;
108
+ maxWidth: string;
109
+ };
110
+ tooltipContent: {
111
+ padding: number;
112
+ };
113
+ buttonNext: {
114
+ display: string;
115
+ };
116
+ buttonBack: {
117
+ display: string;
118
+ };
119
+ buttonClose: {
120
+ display: string;
121
+ };
122
+ buttonSkip: {
123
+ display: string;
124
+ };
125
+ };
@@ -0,0 +1,23 @@
1
+ import { CSSProperties } from 'react';
2
+ export declare const getMajorPopupStyles: (startAnimation: boolean, transform: string) => {
3
+ container: CSSProperties;
4
+ skipButton: {
5
+ base: CSSProperties;
6
+ hover: CSSProperties;
7
+ };
8
+ imageContainer: CSSProperties;
9
+ image: CSSProperties;
10
+ imagePlaceholder: CSSProperties;
11
+ contentContainer: CSSProperties;
12
+ title: CSSProperties;
13
+ content: CSSProperties;
14
+ exploreButton: {
15
+ base: CSSProperties;
16
+ hover: CSSProperties;
17
+ };
18
+ navigationContainer: CSSProperties;
19
+ navigationButton: (disabled: boolean) => {
20
+ base: CSSProperties;
21
+ hover: CSSProperties;
22
+ };
23
+ };
@@ -0,0 +1 @@
1
+ import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as n,BORDER_RADIUS as i,SPACING as o}from"../constants/dimensions.js";import{Z_INDEX as a}from"../constants/zIndex.js";const r=(r,l)=>({container:{width:`${n.MAJOR.width}px`,height:`${n.MAJOR.height}px`,display:"flex",backgroundColor:t.grayscale[900],borderRadius:i.POPUP,overflow:"hidden",position:"relative",transform:r?l:"scale(1)",opacity:r?0:1,transition:e},skipButton:{base:{position:"absolute",top:o.MAJOR.skipButtonTop,right:o.MAJOR.skipButtonRight,background:"transparent",border:"none",color:t.grayscale[400],fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:a.SKIP_BUTTON,transition:"all 0.2s"},hover:{backgroundColor:t.grayscale[100],color:t.grayscale[700]}},imageContainer:{backgroundColor:t.grayscale[900],width:`${n.MAJOR.imageWidth}px`,height:`${n.MAJOR.imageHeight}px`,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:o.MAJOR.imagePadding},image:{width:`${n.MAJOR.imageInnerWidth}px`,height:`${n.MAJOR.imageInnerHeight}px`,objectFit:"cover"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:`${n.MAJOR.imagePlaceholderWidth}px`,height:`${n.MAJOR.imagePlaceholderHeight}px`,display:"flex",alignItems:"center",justifyContent:"center"},contentContainer:{flex:1,display:"flex",margin:o.MAJOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:o.MAJOR.titlePadding,color:t.grayscale.white,lineHeight:"1.25",textAlign:"left"},content:{fontSize:"14px",lineHeight:"1.5",color:"rgba(255, 255, 255, 0.8)",textAlign:"left"},exploreButton:{base:{backgroundColor:"transparent",border:`1px solid ${t.warning[500]}`,color:t.warning[500],borderRadius:i.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:o.MAJOR.buttonMarginTop},hover:{backgroundColor:"rgba(254, 192, 45, 0.1)"}},navigationContainer:{position:"absolute",bottom:o.MAJOR.navigationBottom,right:o.MAJOR.navigationRight,display:"flex",gap:o.MAJOR.navigationGap,alignItems:"center"},navigationButton:e=>({base:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:e?t.grayscale[700]:t.grayscale.white,fontSize:"20px",cursor:e?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},hover:{color:t.warning[500]}})});export{r as getMajorPopupStyles};
@@ -0,0 +1,16 @@
1
+ import { CSSProperties } from 'react';
2
+ export declare const getMinorPopupStyles: (startAnimation: boolean, transform: string) => {
3
+ container: CSSProperties;
4
+ imageContainer: CSSProperties;
5
+ imageWrapper: CSSProperties;
6
+ image: CSSProperties;
7
+ badge: CSSProperties;
8
+ badgeText: CSSProperties;
9
+ imagePlaceholder: CSSProperties;
10
+ contentContainer: CSSProperties;
11
+ title: CSSProperties;
12
+ content: CSSProperties;
13
+ actionsContainer: CSSProperties;
14
+ understoodText: CSSProperties;
15
+ exploreButton: CSSProperties;
16
+ };
@@ -0,0 +1 @@
1
+ import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as i,BORDER_RADIUS as o,SPACING as n}from"../constants/dimensions.js";import{Z_INDEX as a}from"../constants/zIndex.js";const r=(r,s)=>({container:{width:`${i.MINOR.width}px`,height:`${i.MINOR.height}px`,display:"flex",backgroundColor:t.grayscale.white,borderRadius:o.POPUP,overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)",transform:r?s:"scale(1)",opacity:r?0:1,transition:e},imageContainer:{backgroundColor:t.grayscale[50],borderRadius:o.IMAGE,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:n.MINOR.imageMargin,width:`${i.MINOR.imageWidth}px`,minWidth:`${i.MINOR.imageWidth}px`,maxWidth:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`},imageWrapper:{position:"relative",width:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`},image:{width:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`,objectFit:"cover",borderRadius:o.IMAGE,display:"block"},badge:{position:"absolute",top:"0px",left:"0px",right:"0px",height:`${i.MINOR.badgeHeight}px`,backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:`${o.IMAGE} ${o.IMAGE} ${o.IMAGE} ${o.IMAGE}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:a.IMAGE_BADGE},badgeText:{color:t.grayscale.white,fontWeight:"600",fontSize:"14px"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t.grayscale[100],borderRadius:o.IMAGE},contentContainer:{flex:1,display:"flex",margin:n.MINOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:t.grayscale[900],lineHeight:"1.25",textAlign:"left"},content:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:t.grayscale[700],textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},actionsContainer:{position:"absolute",bottom:n.MINOR.actionsBottom,right:n.MINOR.actionsRight,display:"flex",gap:n.MINOR.actionsGap,alignItems:"center"},understoodText:{color:t.brand[800],fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"},exploreButton:{backgroundColor:t.brand[800],border:"none",color:t.grayscale.white,borderRadius:o.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}});export{r as getMinorPopupStyles};
@@ -0,0 +1,13 @@
1
+ import { CSSProperties } from 'react';
2
+ export declare const videoModalStyles: {
3
+ backdrop: CSSProperties;
4
+ container: CSSProperties;
5
+ closeButton: {
6
+ base: CSSProperties;
7
+ hover: CSSProperties;
8
+ };
9
+ videoWrapper: CSSProperties;
10
+ iframe: CSSProperties;
11
+ video: CSSProperties;
12
+ noVideoMessage: CSSProperties;
13
+ };
@@ -0,0 +1 @@
1
+ import"../constants/animations.js";import{BORDER_RADIUS as o}from"../constants/dimensions.js";import{Z_INDEX as t}from"../constants/zIndex.js";const e={backdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.9)",zIndex:t.VIDEO_MODAL,display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},container:{position:"relative",width:"90vw",height:"90vh",maxWidth:"1200px",maxHeight:"800px",backgroundColor:"black",borderRadius:o.VIDEO_MODAL,overflow:"hidden",boxShadow:"0 25px 50px rgba(0, 0, 0, 0.8)"},closeButton:{base:{position:"absolute",top:"20px",right:"20px",background:"rgba(0, 0, 0, 0.7)",border:"none",color:"white",fontSize:"24px",width:"40px",height:"40px",borderRadius:o.CLOSE_BUTTON,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:t.CLOSE_BUTTON,transition:"background-color 0.2s"},hover:{backgroundColor:"rgba(0, 0, 0, 0.9)"}},videoWrapper:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},iframe:{borderRadius:o.VIDEO_MODAL},video:{width:"100%",height:"100%",objectFit:"contain",borderRadius:o.VIDEO_MODAL},noVideoMessage:{color:"white",fontSize:"18px",textAlign:"center"}};export{e as videoModalStyles};
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Firestore Timestamp type
3
+ */
4
+ export interface FirestoreTimestamp {
5
+ seconds: number;
6
+ nanoseconds?: number;
7
+ }
8
+ /**
9
+ * Feature announcement data model
10
+ */
11
+ export interface FeatureAnnouncement {
12
+ id: string;
13
+ title: string;
14
+ body: string;
15
+ content: string;
16
+ buttonText: string;
17
+ displayImage: string;
18
+ featureTag: string;
19
+ featureUpdateType: 'Major' | 'Minor';
20
+ image: string;
21
+ module: string[];
22
+ pageUrls: string[];
23
+ productVideo: string;
24
+ redirectUrl: string;
25
+ updates: string;
26
+ visibility: boolean;
27
+ archived?: boolean;
28
+ createdAt: FirestoreTimestamp;
29
+ expirationDate?: FirestoreTimestamp | string | Date;
30
+ }
31
+ /**
32
+ * Store feature progress tracking
33
+ */
34
+ export interface StoreFeatureProgress {
35
+ storeId: string;
36
+ viewedFeatures: Record<string, boolean>;
37
+ }
38
+ /**
39
+ * Feature update types
40
+ */
41
+ export type FeatureUpdateType = 'Major' | 'Minor';
@@ -0,0 +1,4 @@
1
+ export * from './feature.types';
2
+ export * from './props.types';
3
+ export * from './repository.types';
4
+ export * from './router.types';
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { FeatureAnnouncement } from './feature.types';
3
+ import { FeatureAnnouncementRepository } from './repository.types';
4
+ import { RouterProps } from './router.types';
5
+ /**
6
+ * Base popup component props
7
+ */
8
+ export interface PopupBaseProps {
9
+ feature: FeatureAnnouncement;
10
+ currentIndex: number;
11
+ totalFeatures: number;
12
+ onSkip: () => void;
13
+ onExplore: () => void;
14
+ onPrevious: () => void;
15
+ onNext: () => void;
16
+ setIsClosing?: (isClosing: boolean) => void;
17
+ }
18
+ /**
19
+ * Major update popup props
20
+ */
21
+ export interface MajorUpdatePopupProps extends PopupBaseProps {
22
+ }
23
+ /**
24
+ * Minor update popup props
25
+ */
26
+ export interface MinorUpdatePopupProps extends PopupBaseProps {
27
+ }
28
+ /**
29
+ * Video modal props
30
+ */
31
+ export interface VideoModalProps {
32
+ isOpen: boolean;
33
+ videoUrl: string;
34
+ onClose: () => void;
35
+ }
36
+ /**
37
+ * Feature announcement provider props
38
+ */
39
+ export interface FeatureAnnouncementProviderProps extends FeatureAnnouncementRepository {
40
+ children: React.ReactNode;
41
+ module?: string;
42
+ router?: RouterProps;
43
+ }
@@ -0,0 +1,11 @@
1
+ import { FeatureAnnouncement, StoreFeatureProgress } from './feature.types';
2
+ /**
3
+ * Repository function types for dependency injection
4
+ */
5
+ export interface FeatureAnnouncementRepository {
6
+ fetchVisibleFeatures: (module?: string) => Promise<[Error | null, FeatureAnnouncement[] | null]>;
7
+ getStoreFeatureProgress: (storeId: string) => Promise<[Error | null, StoreFeatureProgress | null]>;
8
+ fetchFeatureById: (featureId: string) => Promise<[Error | null, FeatureAnnouncement | null]>;
9
+ markFeatureAsViewedForStore: (storeId: string, featureId: string) => Promise<[Error | null]>;
10
+ isFeatureApplicableToCurrentPage: (feature: FeatureAnnouncement) => boolean;
11
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Router properties
3
+ */
4
+ export interface RouterProps {
5
+ pathname: string;
6
+ query: Record<string, string | string[] | undefined>;
7
+ }
@@ -0,0 +1,13 @@
1
+ import { FeatureAnnouncement, FeatureAnnouncementRepository, RouterProps } from './types';
2
+ export declare const useFeatureAnnouncements: ({ fetchVisibleFeatures, getStoreFeatureProgress, fetchFeatureById, markFeatureAsViewedForStore, isFeatureApplicableToCurrentPage, module, router, }: FeatureAnnouncementRepository & {
3
+ module?: string | undefined;
4
+ router?: RouterProps | undefined;
5
+ }) => {
6
+ features: FeatureAnnouncement[];
7
+ majorUpdateFeatures: FeatureAnnouncement[];
8
+ minorUpdateFeatures: FeatureAnnouncement[];
9
+ isLoading: boolean;
10
+ error: string | null;
11
+ markFeatureAsViewed: (featureId: string) => Promise<void>;
12
+ refetch: () => Promise<void>;
13
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Calculate transform for closing animation
3
+ * @param popupElement - Popup element reference
4
+ * @param targetElement - Target element to animate towards
5
+ * @returns Transform CSS string
6
+ */
7
+ export declare const calculateCloseTransform: (popupElement: HTMLElement, targetElement: Element) => string;
8
+ /**
9
+ * Hide Joyride arrow element
10
+ * @param popupRef - Reference to popup element
11
+ */
12
+ export declare const hideJoyrideArrow: (popupRef: HTMLElement | null) => void;
13
+ /**
14
+ * Execute callback after animation completes
15
+ * @param callback - Function to execute
16
+ * @param delay - Optional delay override
17
+ */
18
+ export declare const executeAfterAnimation: (callback: () => void, delay?: number) => void;
@@ -0,0 +1 @@
1
+ import{ANIMATION_TIMING as t}from"../constants/animations.js";const e=(t,e)=>{const i=t.getBoundingClientRect(),o=e.getBoundingClientRect();return`translate(${o.left+o.width/2-(i.left+i.width/2)}px, ${o.top+o.height/2-(i.top+i.height/2)}px) scale(0)`},i=t=>{if(!t)return;const e=t.closest('[class*="react-joyride__tooltip"]');if(!e)return;const i=e.querySelector('[class*="react-joyride__arrow"]');i&&(i.style.display="none",i.style.visibility="hidden",i.style.opacity="0")},o=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.CLOSE_DURATION;setTimeout(e,i)};export{e as calculateCloseTransform,o as executeAfterAnimation,i as hideJoyrideArrow};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Find What's New button using multiple strategies
3
+ * @returns Element or null
4
+ */
5
+ export declare const findWhatsNewButton: () => Element | null;
6
+ /**
7
+ * Find target element for minor update
8
+ * @param featureTag - Feature tag selector
9
+ * @returns Element or null
10
+ */
11
+ export declare const findFeatureTagElement: (featureTag: string) => Element | null;
12
+ /**
13
+ * Normalize selector string
14
+ * @param selector - Selector string
15
+ * @returns Normalized selector
16
+ */
17
+ export declare const normalizeSelector: (selector: string) => string;
18
+ /**
19
+ * Check if element is fully visible in viewport
20
+ * @param element - Element to check
21
+ * @returns True if element is fully visible
22
+ */
23
+ export declare const isElementInViewport: (element: Element) => boolean;
24
+ /**
25
+ * Scroll to element smoothly with offset
26
+ * @param element - Element to scroll to
27
+ * @param offset - Offset from top (default 120px for popup space)
28
+ * @returns Promise that resolves when scroll completes
29
+ */
30
+ export declare const scrollToElementSmooth: (element: Element, offset?: number) => Promise<void>;
@@ -0,0 +1 @@
1
+ import"../constants/animations.js";import{SELECTORS as t}from"../constants/selectors.js";const e=()=>{let e=document.querySelector(t.WHATS_NEW_BUTTON);if(e)return e;if(e=document.querySelector(t.MAIN_ICON_CLASS),e)return e;const n=document.querySelector(t.SVG_VIEWBOX);if(n){if(n.querySelector(t.CLIPPATH_PATTERN))return n.closest(t.WHATS_NEW_BUTTON)||n.parentElement}return null},n=t=>{const e=t.startsWith("#")||t.startsWith(".")||t.startsWith("[")?t:`#${t}`;return document.querySelector(e)},o=t=>t.startsWith("#")||t.startsWith(".")||t.startsWith("[")?t:`#${t}`,r=t=>{const e=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth,r=e.top>=120&&e.bottom<=n,i=e.left>=0&&e.right<=o;return r&&i},i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:120;return new Promise((n=>{if(r(t))return void n();const o=t.getBoundingClientRect().top+window.pageYOffset-e;let i;window.scrollTo({top:o,behavior:"smooth"});const s=()=>{clearTimeout(i),i=setTimeout((()=>{window.removeEventListener("scroll",s),setTimeout((()=>n()),100)}),100)};window.addEventListener("scroll",s,{passive:!0}),setTimeout((()=>{window.removeEventListener("scroll",s),n()}),1e3)}))};export{n as findFeatureTagElement,e as findWhatsNewButton,r as isElementInViewport,o as normalizeSelector,i as scrollToElementSmooth};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Decode HTML entities in text
3
+ * @param text - Text containing HTML entities
4
+ * @returns Decoded text
5
+ */
6
+ export declare const decodeHTMLEntities: (text: string) => string;
7
+ /**
8
+ * Format video URL for embedding
9
+ * @param videoUrl - Original video URL
10
+ * @returns Formatted video URL
11
+ */
12
+ export declare const formatVideoUrl: (videoUrl: string) => string;
13
+ /**
14
+ * Check if URL is a YouTube video
15
+ * @param videoUrl - Video URL to check
16
+ * @returns True if YouTube video
17
+ */
18
+ export declare const isYouTubeVideo: (videoUrl: string) => boolean;
@@ -0,0 +1 @@
1
+ const e=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},t=e=>e.replace("watch?v=","embed/").replace("youtu.be/","youtube.com/embed/"),u=e=>e.includes("youtube.com")||e.includes("youtu.be");export{e as decodeHTMLEntities,t as formatVideoUrl,u as isYouTubeVideo};
@@ -0,0 +1,3 @@
1
+ export * from './htmlHelpers';
2
+ export * from './animationHelpers';
3
+ export * from './elementHelpers';
@@ -27,6 +27,8 @@ interface CollectionsScreenInterface {
27
27
  pickerType?: 'COLLECTION' | 'PRODUCT';
28
28
  scrollContainerRef: React.RefObject<HTMLDivElement>;
29
29
  appType: ApplicationType;
30
+ limit?: number;
31
+ exactLimit?: number;
30
32
  }
31
33
  export declare const CollectionsScreen: (props: CollectionsScreenInterface) => import("react/jsx-runtime").JSX.Element;
32
34
  export interface CollectionCardInterface {
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import t from"../../assets/icons/chevronRight.svg.js";import{useRef as i,useState as o,useEffect as l}from"react";import{CheckBox as s}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{Tag as c}from"../tag/Tag.js";import{Tooltip as r}from"../tooltips/Tooltip.js";import{TitleRegular as d,BodyPrimary as a}from"../TypographyStyle.js";import{EmptyState as u}from"./emptyState.js";import{ProductPickerShimmer as h}from"./ProductPickerShimmer.js";import{CollectionCardStyle as p,CollectionCardInfoStyle as m,CollectionCardDetailStyle as j,CollectionNameHolder as C}from"./style.js";import{isCollectionPartiallyChecked as v}from"./utility.js";const g=(e,t,i)=>{if(!e)return"";if(e.length<=t)return e;const o=e.slice(0,t-1);return(i?o.slice(0,o.lastIndexOf(" ")):o)+"..."},x=t=>{var s;const{customCollectionRestriction:n,dataLoading:c,collections:r,selectedCollectionsDispatch:d,setCollectionId:a,setSelectedCollectionId:p,selectedCollections:m,setScreen:j,collectionFetcher:C,collectionsDispatch:g,pagingControls:x,storeId:b,setSaveDisabled:f,hideCollectionCheckbox:k,renderWithoutModal:O,pickerType:I,scrollContainerRef:S,appType:P}=t,T=i(x.curPage),D=!!n&&(null==m?void 0:m.isCustom),[L,R]=o(!1),E=i(!1),w=i(!1),B=()=>{if(!S||!(null==S?void 0:S.current))return;const{scrollTop:e,clientHeight:t,scrollHeight:i}=S.current;e+t>=i-20&&!E.current&&!w.current&&(f(!0),R(!0),w.current=!0,f(!0),R(!0),C(T.current,b,P).then((e=>{g({type:"paged",data:(null==e?void 0:e.collections)||{}}),x.setCurPage(T.current+1),R(!1),f(!1),w.current=!1,Object.keys(null==e?void 0:e.collections).length||(E.current=!0)})).catch())};return l((()=>{var e;return null===(e=null==S?void 0:S.current)||void 0===e||e.addEventListener("scroll",B),()=>{var e;null===(e=null==S?void 0:S.current)||void 0===e||e.removeEventListener("scroll",B)}}),[]),l((()=>{T.current=x.curPage}),[x.curPage]),e.jsxs("div",{children:[(null===(s=Object.keys(null!=r?r:{}))||void 0===s?void 0:s.length)?Object.keys(r).map((t=>{var i,o;const l=!!(null==m?void 0:m[t])&&("PRODUCT"!==I||!!Object.keys(null!==(o=null===(i=null==m?void 0:m[t])||void 0===i?void 0:i.products)&&void 0!==o?o:{}).length);return e.jsx(y,{customCollectionRestriction:n,data:r[t],isDisabled:D&&!(null==m?void 0:m[t]),isChecked:l,isPartiallyChecked:v(t,null==r?void 0:r[t],m),selectedCollectionsDispatch:d,setCollectionId:a,setSelectedCollectionId:p,setScreen:j,id:t,hideCollectionCheckbox:k||"-1"===t,selectedCollections:m,renderWithoutModal:O,pickerType:I},t)})):c?e.jsx(h,{}):e.jsx(u,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),L&&e.jsx(h,{})]})},y=i=>{const{customCollectionRestriction:o,data:l,selectedCollectionsDispatch:u,setCollectionId:h,setSelectedCollectionId:v,isPartiallyChecked:g,setScreen:x,id:y,isChecked:b,isDisabled:f,hideCollectionCheckbox:k,pickerType:O,usedInSearch:I}=i;return l?e.jsxs(p,Object.assign({isDisabled:f,onClick:e=>{if(!f){if("COLLECTION"===O)return e.stopPropagation(),u({type:"reset",data:{}}),u({type:"selected",data:{id:y,val:l,isRestricted:o}}),h(y),void v(y);h(y),v(y),x("products")}},isActive:b,usedInSearch:null!=I&&I},{children:[e.jsxs(m,{children:[!k&&e.jsx(s,{isDisabled:f,isChecked:b,isPartiallyChecked:g,onValueChange:function(e,t,i){null==i||i.stopPropagation(),u(e?{type:"selected",data:{id:y,val:l,isRestricted:o}}:{type:"unselected",data:{id:y}}),v(e?y:"")}}),e.jsx(j,{children:e.jsx(r,Object.assign({body:l.name,placement:"bottom",delay:400,variant:"light"},{children:e.jsxs(C,{children:[I?e.jsx(a,Object.assign({numberOfLines:1},{children:l.name})):e.jsx(d,Object.assign({numberOfLines:1},{children:l.name})),l.isSmartCollection?e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(c,{tagText:"Smart Collection",type:"warning"})})):e.jsx(e.Fragment,{})]})}))})]}),"COLLECTION"!==O&&e.jsx(n,{height:12,width:12,disabled:f,Icon:t})]})):e.jsx(e.Fragment,{})};export{y as CollectionCard,x as CollectionsScreen,g as truncate};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import t from"../../assets/icons/chevronRight.svg.js";import{useRef as i,useState as o,useEffect as l}from"react";import{CheckBox as s}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{Tag as c}from"../tag/Tag.js";import{Tooltip as r}from"../tooltips/Tooltip.js";import{TitleRegular as d,BodyPrimary as a}from"../TypographyStyle.js";import{EmptyState as u}from"./emptyState.js";import{ProductPickerShimmer as h}from"./ProductPickerShimmer.js";import{CollectionCardStyle as m,CollectionCardInfoStyle as p,CollectionCardDetailStyle as C,CollectionNameHolder as j}from"./style.js";import{isCollectionPartiallyChecked as g}from"./utility.js";const v=(e,t,i)=>{if(!e)return"";if(e.length<=t)return e;const o=e.slice(0,t-1);return(i?o.slice(0,o.lastIndexOf(" ")):o)+"..."},x=t=>{var s;const{customCollectionRestriction:n,dataLoading:c,collections:r,selectedCollectionsDispatch:d,setCollectionId:a,setSelectedCollectionId:m,selectedCollections:p,setScreen:C,collectionFetcher:j,collectionsDispatch:v,pagingControls:x,storeId:b,setSaveDisabled:f,hideCollectionCheckbox:k,renderWithoutModal:O,pickerType:I,scrollContainerRef:S,appType:T,limit:L,exactLimit:P}=t,D=i(x.curPage),R=!!n&&(null==p?void 0:p.isCustom),[E,N]=o(!1),w=i(!1),B=i(!1),F=()=>{if(!S||!(null==S?void 0:S.current))return;const{scrollTop:e,clientHeight:t,scrollHeight:i}=S.current;e+t>=i-20&&!w.current&&!B.current&&(f(!0),N(!0),B.current=!0,f(!0),N(!0),j(D.current,b,T).then((e=>{v({type:"paged",data:(null==e?void 0:e.collections)||{}}),x.setCurPage(D.current+1),N(!1),f(!1),B.current=!1,Object.keys(null==e?void 0:e.collections).length||(w.current=!0)})).catch())};l((()=>{var e;return null===(e=null==S?void 0:S.current)||void 0===e||e.addEventListener("scroll",F),()=>{var e;null===(e=null==S?void 0:S.current)||void 0===e||e.removeEventListener("scroll",F)}}),[]),l((()=>{D.current=x.curPage}),[x.curPage]);const W=Object.keys(p||{}).filter((e=>"isCustom"!==e)).length;return e.jsxs("div",{children:[(null===(s=Object.keys(null!=r?r:{}))||void 0===s?void 0:s.length)?Object.keys(r).map((t=>{var i,o;const l=!!(null==p?void 0:p[t])&&("PRODUCT"!==I||!!Object.keys(null!==(o=null===(i=null==p?void 0:p[t])||void 0===i?void 0:i.products)&&void 0!==o?o:{}).length),s="COLLECTION"===I&&!l&&(!!P&&W>=P||!!L&&W>=L);return e.jsx(y,{customCollectionRestriction:n,data:r[t],isDisabled:R&&!(null==p?void 0:p[t])||s,isChecked:l,isPartiallyChecked:g(t,null==r?void 0:r[t],p),selectedCollectionsDispatch:d,setCollectionId:a,setSelectedCollectionId:m,setScreen:C,id:t,hideCollectionCheckbox:k||"-1"===t,selectedCollections:p,renderWithoutModal:O,pickerType:I},t)})):c?e.jsx(h,{}):e.jsx(u,{title:"No collections to show",subtitle:"We couldn’t find any collection."}),E&&e.jsx(h,{})]})},y=i=>{const{customCollectionRestriction:o,data:l,selectedCollectionsDispatch:u,setCollectionId:h,setSelectedCollectionId:g,isPartiallyChecked:v,setScreen:x,id:y,isChecked:b,isDisabled:f,hideCollectionCheckbox:k,pickerType:O,usedInSearch:I}=i;return l?e.jsxs(m,Object.assign({isDisabled:f,onClick:e=>{if(!f){if("COLLECTION"===O)return e.stopPropagation(),u({type:"reset",data:{}}),u({type:"selected",data:{id:y,val:l,isRestricted:o}}),h(y),void g(y);h(y),g(y),x("products")}},isActive:b,usedInSearch:null!=I&&I},{children:[e.jsxs(p,{children:[!k&&e.jsx(s,{isDisabled:f,isChecked:b,isPartiallyChecked:v,onValueChange:function(e,t,i){null==i||i.stopPropagation(),u(e?{type:"selected",data:{id:y,val:l,isRestricted:o}}:{type:"unselected",data:{id:y}}),g(e?y:"")}}),e.jsx(C,{children:e.jsx(r,Object.assign({body:l.name,placement:"bottom",delay:400,variant:"light"},{children:e.jsxs(j,{children:[I?e.jsx(a,Object.assign({numberOfLines:1},{children:l.name})):e.jsx(d,Object.assign({numberOfLines:1},{children:l.name})),l.isSmartCollection?e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(c,{tagText:"Smart Collection",type:"warning"})})):e.jsx(e.Fragment,{})]})}))})]}),"COLLECTION"!==O&&e.jsx(n,{height:12,width:12,disabled:f,Icon:t})]})):e.jsx(e.Fragment,{})};export{y as CollectionCard,x as CollectionsScreen,v as truncate};
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{ApplicationType as t}from"@bikdotai/bik-models/growth/models/bik-store";import o from"../../assets/icons/search.svg.js";import{useReducer as c,useState as s,useRef as r,useEffect as i}from"react";import{COLORS as n}from"../../constants/Theme.js";import l from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as u}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as h}from"../tag/Tag.js";import{CollectionsScreen as m}from"./collectionScreen.js";import{ProductInfoOverlay as g}from"./productInfoOverlay.js";import{ProductsScreen as C}from"./productScreen.js";import{RearrangeScreen as j}from"./rearrangeScreen.js";import{collectionsReducer as y,searchReducer as x,selectedColectionsReducer as b,CollectionIdContext as f}from"./reducers.js";import{SearchScreen as S}from"./searchScreen.js";import{SelectedScreen as k}from"./selectedScreen.js";import{ContainerStyle as v,ScrollContainerStyle as I,StyledFooterForNonModal as F}from"./style.js";import{OUT_OF_STOCK_ACTION as P,ScreenName as O}from"./type.js";import{updateAllVariantsForSelectedProducts as T}from"./utility.js";const D=D=>{const{storeId:R,selectedItems:w,onClose:A,visible:B,zIndex:E,exactLimit:L,limit:z,hideCollectionCheckbox:V,hideProductCheckbox:$,outOfStockAction:M=P.BLUR,hideVariantCheckbox:H,selectProductsFromCustomCollection:W,hideSelectionCount:G,title:K,width:N,left:U,renderWithoutModal:Y,onClickSave:_,pickerType:q,hideProductVariants:J=!1,startupScreen:Q=O.Collections,rearrangeEnabled:X,selectSingleItem:Z=!1,showProductDetails:ee,containerStyle:te,crossButtonInsideHeader:oe=!1,footerForNonModal:ce={},primaryButton:se,secondaryButton:re,subtitle:ie}=D,ne=D.appType||t.BIK,[le,ae]=c(y,{}),[de,ue]=s([O.Collections,O.RearrangeProducts].includes(Q)?Q:O.Collections),[pe,he]=s("grid"),[me,ge]=s(""),[Ce,je]=s(""),[ye,xe]=s(0),[be,fe]=s(!1),[Se,ke]=s(0),[ve,Ie]=s(""),[Fe,Pe]=s(!1),[Oe,Te]=s(!1),[De,Re]=c(x,{collections:{},products:{}}),[we,Ae]=c(b,Object.keys(w).length>0?w:{}),Be=r(null),[Ee,Le]=s(!1),[ze,Ve]=s();i((()=>{fe(!0),Te(!0),D.collectionFetcher(ye,R,ne).then((e=>{ae({type:"fetched",data:(null==e?void 0:e.collections)||{}}),fe(!1),xe((e=>e+1)),Te(!1)})).catch()}),[]),i((()=>{let e=0;J?Object.keys(we||[]).forEach((t=>{var o;Object.keys((null===(o=we[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&we[-1]&&(null===(c=we[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(we||[]).forEach((t=>{var o;Object.keys((null===(o=we[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,s;Object.keys((null===(s=null===(c=we[t].products)||void 0===c?void 0:c[o])||void 0===s?void 0:s.variants)||[]).forEach((()=>{e+=1}))}))})),ke(e)}),[le,we,J]),i((()=>{Ce&&(fe(!0),D.productFetcher(Ce,R,ne).then((e=>{Object.keys(e).length&&ae({type:"productsFetched",data:{collectionId:Ce,products:e}}),fe(!1)})).catch())}),[Ce]),i((()=>{const e=setTimeout((()=>{"rearrange"!==de&&(ve.length||"collections"!==de)&&(ve.length?(Pe(!0),D.searchFetcher(R,ve,ne).then((e=>{"collections"in e&&"products"in e?(Re({type:"set",data:e}),ae({type:"searched",data:e.collections}),ae({type:"searched",data:e.products})):(Re({type:"set",data:{collections:{},products:e}}),ae({type:"searched",data:e})),ue("searchProducts"),fe(!1),Pe(!1)}))):ue("collections"))}),800);return()=>clearTimeout(e)}),[ve]),i((()=>{_&&(D.onAdd(we,Se),$e())}),[_]),i((()=>{Z&&Object.keys(we||{}).length&&Se&&(D.onAdd(we,Se),$e())}),[Z,we,Se]);const $e=()=>{Ae({type:"reset",data:{}})},Me=()=>L&&Se>L?e.jsx(h,{tagText:`You can only select ${L} products`,type:"negative"}):z&&Se>z?e.jsx(h,{tagText:`You can only select ${z} products`,type:"negative"}):Se>0?e.jsx(a,{onClick:()=>{ue(X?O.RearrangeProducts:O.SelectedProducts)},buttonText:L?`${Se}/${L} products selected`:`${Se} products selected`,buttonType:["rearrange","view"].includes(de)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(de)}):e.jsx(a,{disabled:!0,buttonText:L?`${Se}/${L} products selected`:`${Se} products selected`,buttonType:"tertiaryGray"}),He=e=>be?"Loading...":de===O.RearrangeProducts?null!=e?e:"Done":null!=e?e:"Add",We=e.jsxs(v,Object.assign({style:null!=te?te:{}},{children:[D.postHeader&&e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:D.postHeader})),!D.hideGlobalSearch&&e.jsx(e.Fragment,{children:("collections"===de||"searchProducts"===de)&&e.jsx("div",Object.assign({style:{padding:Y?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(d,{placeholder:"Search using ID, Name or SKU ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Fe?e.jsx(p,{size:"small",color:n.content.primary}):e.jsx(o,{})},id:"listInput",height:"24px",type:"text",value:ve,onChangeText:e=>{e.length&&e.trim().length?Ie(e):Ie("")}})}))}),e.jsxs(I,Object.assign({ref:Be,screenName:de},{children:["collections"===de&&e.jsx(m,{customCollectionRestriction:D.customCollectionRestriction,dataLoading:Oe,collections:le,selectedCollectionsDispatch:Ae,setCollectionId:ge,setSelectedCollectionId:je,setScreen:ue,selectedCollections:we,collectionFetcher:D.collectionFetcher,storeId:R,appType:ne,collectionsDispatch:ae,setSaveDisabled:fe,pagingControls:{curPage:ye,setCurPage:xe},hideCollectionCheckbox:V,renderWithoutModal:Y,pickerType:q,scrollContainerRef:Be}),"products"===de&&me&&e.jsx(f.Provider,Object.assign({value:me},{children:e.jsx(C,{hideInCollectionSearch:D.hideInCollectionSearch,customCollectionRestriction:D.customCollectionRestriction,productFetcher:D.productFetcher,setScreen:ue,storeId:R,appType:ne,data:le[me],collectionsDispatch:ae,selectedCollectionsDispatch:Ae,selectedData:we,setSaveDisabled:fe,searchInCollectionFetcher:D.searchInCollectionFetcher,hideProductCheckbox:$,outOfStockAction:M,hideVariantCheckbox:H,selectProductsFromCustomCollection:W,renderWithoutModal:Y,pickerType:q,hideProductVariants:J,fbStatusFetcher:D.fbStatusFetcher,onProductDetailClick:e=>{Le(!0),Ve(e)},showProductDetailInfoIcon:ee,scrollContainerRef:Be})})),"view"===de&&e.jsx(k,{selectedCollections:we||{},selectedCollectionsDispatch:Ae,setScreen:ue,collections:le,hideProductVariants:J,outOfStockAction:M,storeId:R,appType:ne,fbStatusFetcher:D.fbStatusFetcher}),"rearrange"===de&&e.jsx(j,{selectedCollections:we||{},selectedCollectionsDispatch:Ae,setScreen:ue,outOfStockAction:M,rearrangeViewType:"grid"===pe?"list":"grid",scrollContainerRef:Be,storeId:R,appType:ne,fbStatusFetcher:D.fbStatusFetcher}),"searchProducts"===de&&e.jsx(S,{customCollectionRestriction:D.customCollectionRestriction,selectedCollections:we||{},searchedCollections:De||{},searchedCollectionsDispatch:Re,selectedCollectionsDispatch:Ae,setScreen:ue,collections:le,onBackPress:()=>{Ie(""),Re({type:"set",data:{collections:{},products:{}}})},pickerType:q,hideProductCheckbox:$,hideProductVariants:J,hideVariantCheckbox:H,storeId:R,appType:ne,fbStatusFetcher:D.fbStatusFetcher,setCollectionId:ge,setSelectedCollectionId:je,renderWithoutModal:Y,hideCollectionCheckbox:V,outOfStockAction:M})]}))]}));return e.jsx(e.Fragment,{children:Y?e.jsxs(e.Fragment,{children:[We,ce.renderFooter?e.jsxs(F,{children:[Me(),e.jsx(a,{buttonText:He(ce.primaryButtonText),disabled:!ce.isLoading&&(be||Se<1||L&&Se<L||!L&&z&&Se>z)||ce.primaryButtonDisabled,isLoading:ce.isLoading,onClick:()=>{D.onAdd(we,Se),$e(),ue([O.Collections,O.RearrangeProducts].includes(Q)?Q:O.Collections)}})]}):e.jsx(e.Fragment,{}),Ee&&ze?e.jsx(g,{productData:ze,outOfStockAction:M,useDynamicInfoImageSize:D.useDynamicInfoImageSize,onClose:()=>{Le(!1)}}):e.jsx(e.Fragment,{})]}):e.jsxs(u,Object.assign({zIndex:E,open:B,onClose:()=>{null==A||A(),$e()},headingTitle:K||("collections"===de||"products"===de?"Select Products":"view"===de?"Selected Products":"searchProducts"===de?"Searched Results":"rearrange"===de?"Rearrange Products":void 0),headingSubtitle:ie,footerShadow:!0,centralContainerStyles:{width:N||"600px",left:U||"auto"},headerRightCustomElement:oe?e.jsx("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:A},{children:e.jsx(l,{width:20,height:20,color:n.content.secondary})})):e.jsx(e.Fragment,{}),footerContainerStyle:D.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:n.surface.standard}:void 0,primaryButton:se?(e=>Object.assign(Object.assign({},e),{disabled:!e.isLoading&&(be||Se<1||L&&Se<L||!L&&z&&Se>z)||e.disabled,onClick:()=>{D.onAdd(we,Se),$e(),ue([O.Collections,O.RearrangeProducts].includes(Q)?Q:O.Collections)}}))(se):{buttonText:He(),disabled:be||Se<1||L&&Se<L||!L&&z&&Se>z||!1,onClick:()=>{D.onAdd(we,Se),$e()}},secondaryButton:re?(e=>Object.assign(Object.assign({},e),{disabled:be||Se<1||L&&Se<L||!L&&z&&Se>z||!1,onClick:()=>{const e=T(we,le,De);D.onAdd(e,Se,!0)}}))(re):void 0,wrapperStyle:D.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:G?e.jsx(e.Fragment,{}):Me(),hideCrossButton:Ee||oe},{children:[We,Ee&&ze?e.jsx(g,{productData:ze,useDynamicInfoImageSize:D.useDynamicInfoImageSize,outOfStockAction:M,onClose:()=>{Le(!1)}}):e.jsx(e.Fragment,{})]}))})};export{D as ProductPickerModal};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import{ApplicationType as t}from"@bikdotai/bik-models/growth/models/bik-store";import o from"../../assets/icons/search.svg.js";import{useReducer as c,useState as s,useRef as r,useEffect as i}from"react";import{COLORS as n}from"../../constants/Theme.js";import l from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as u}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as p}from"../tag/Tag.js";import{CollectionsScreen as m}from"./collectionScreen.js";import{ProductInfoOverlay as g}from"./productInfoOverlay.js";import{ProductsScreen as C}from"./productScreen.js";import{RearrangeScreen as j}from"./rearrangeScreen.js";import{collectionsReducer as y,searchReducer as x,selectedColectionsReducer as b,CollectionIdContext as f}from"./reducers.js";import{SearchScreen as S}from"./searchScreen.js";import{SelectedScreen as k}from"./selectedScreen.js";import{ContainerStyle as v,ScrollContainerStyle as I,StyledFooterForNonModal as F}from"./style.js";import{OUT_OF_STOCK_ACTION as O,ScreenName as P}from"./type.js";import{updateAllVariantsForSelectedProducts as T}from"./utility.js";const D=D=>{const{storeId:R,selectedItems:w,onClose:L,visible:A,zIndex:E,exactLimit:$,limit:B,hideCollectionCheckbox:z,hideProductCheckbox:V,outOfStockAction:M=O.BLUR,hideVariantCheckbox:N,selectProductsFromCustomCollection:H,hideSelectionCount:W,title:G,width:K,left:U,renderWithoutModal:Y,onClickSave:_,pickerType:q,hideProductVariants:J=!1,startupScreen:Q=P.Collections,rearrangeEnabled:X,selectSingleItem:Z=!1,showProductDetails:ee,containerStyle:te,crossButtonInsideHeader:oe=!1,footerForNonModal:ce={},primaryButton:se,secondaryButton:re,subtitle:ie}=D,ne=D.appType||t.BIK,[le,ae]=c(y,{}),[de,ue]=s([P.Collections,P.RearrangeProducts].includes(Q)?Q:P.Collections),[he,pe]=s("grid"),[me,ge]=s(""),[Ce,je]=s(""),[ye,xe]=s(0),[be,fe]=s(!1),[Se,ke]=s(0),[ve,Ie]=s(""),[Fe,Oe]=s(!1),[Pe,Te]=s(!1),[De,Re]=c(x,{collections:{},products:{}}),[we,Le]=c(b,Object.keys(w).length>0?w:{}),Ae=r(null),[Ee,$e]=s(!1),[Be,ze]=s();i((()=>{fe(!0),Te(!0),D.collectionFetcher(ye,R,ne).then((e=>{ae({type:"fetched",data:(null==e?void 0:e.collections)||{}}),fe(!1),xe((e=>e+1)),Te(!1)})).catch()}),[]),i((()=>{let e=0;"COLLECTION"===q?e=Object.keys(we||{}).filter((e=>"isCustom"!==e)).length:J?Object.keys(we||[]).forEach((t=>{var o;Object.keys((null===(o=we[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&we[-1]&&(null===(c=we[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(we||[]).forEach((t=>{var o;Object.keys((null===(o=we[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,s;Object.keys((null===(s=null===(c=we[t].products)||void 0===c?void 0:c[o])||void 0===s?void 0:s.variants)||[]).forEach((()=>{e+=1}))}))})),ke(e)}),[le,we,J,q]),i((()=>{Ce&&(fe(!0),D.productFetcher(Ce,R,ne).then((e=>{Object.keys(e).length&&ae({type:"productsFetched",data:{collectionId:Ce,products:e}}),fe(!1)})).catch())}),[Ce]),i((()=>{const e=setTimeout((()=>{"rearrange"!==de&&(ve.length||"collections"!==de)&&(ve.length?(Oe(!0),D.searchFetcher(R,ve,ne).then((e=>{"collections"in e&&"products"in e?(Re({type:"set",data:e}),ae({type:"searched",data:e.collections}),ae({type:"searched",data:e.products})):(Re({type:"set",data:{collections:{},products:e}}),ae({type:"searched",data:e})),ue("searchProducts"),fe(!1),Oe(!1)}))):ue("collections"))}),800);return()=>clearTimeout(e)}),[ve]),i((()=>{_&&(D.onAdd(we,Se),Ve())}),[_]),i((()=>{Z&&Object.keys(we||{}).length&&Se&&(D.onAdd(we,Se),Ve())}),[Z,we,Se]);const Ve=()=>{Le({type:"reset",data:{}})},Me=()=>{let t,o;return"COLLECTION"===q?(t="collection",o="collections"):J?(t="product",o="products"):(t="variant",o="variants"),$&&Se>$?e.jsx(p,{tagText:`You can only select ${$} ${1===$?t:o}`,type:"negative"}):B&&Se>B?e.jsx(p,{tagText:`You can only select ${B} ${1===B?t:o}`,type:"negative"}):Se>0?e.jsx(a,{onClick:()=>{ue(X?P.RearrangeProducts:P.SelectedProducts)},buttonText:$?`${Se}/${$} ${1===Se?t:o} selected`:`${Se} ${1===Se?t:o} selected`,buttonType:["rearrange","view"].includes(de)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(de)}):e.jsx(a,{disabled:!0,buttonText:$?`${Se}/${$} ${1===$?t:o} selected`:`${Se} ${1===Se?t:o} selected`,buttonType:"tertiaryGray"})},Ne=e=>be?"Loading...":de===P.RearrangeProducts?null!=e?e:"Done":null!=e?e:"Add",He=e.jsxs(v,Object.assign({style:null!=te?te:{}},{children:[D.postHeader&&e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:D.postHeader})),!D.hideGlobalSearch&&e.jsx(e.Fragment,{children:("collections"===de||"searchProducts"===de)&&e.jsx("div",Object.assign({style:{padding:Y?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(d,{placeholder:"Search using ID, Name or SKU ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Fe?e.jsx(h,{size:"small",color:n.content.primary}):e.jsx(o,{})},id:"listInput",height:"24px",type:"text",value:ve,onChangeText:e=>{e.length&&e.trim().length?Ie(e):Ie("")}})}))}),e.jsxs(I,Object.assign({ref:Ae,screenName:de},{children:["collections"===de&&e.jsx(m,{customCollectionRestriction:D.customCollectionRestriction,dataLoading:Pe,collections:le,selectedCollectionsDispatch:Le,setCollectionId:ge,setSelectedCollectionId:je,setScreen:ue,selectedCollections:we,collectionFetcher:D.collectionFetcher,storeId:R,appType:ne,collectionsDispatch:ae,setSaveDisabled:fe,pagingControls:{curPage:ye,setCurPage:xe},hideCollectionCheckbox:z,renderWithoutModal:Y,pickerType:q,scrollContainerRef:Ae,limit:B,exactLimit:$}),"products"===de&&me&&e.jsx(f.Provider,Object.assign({value:me},{children:e.jsx(C,{hideInCollectionSearch:D.hideInCollectionSearch,customCollectionRestriction:D.customCollectionRestriction,productFetcher:D.productFetcher,setScreen:ue,storeId:R,appType:ne,data:le[me],collectionsDispatch:ae,selectedCollectionsDispatch:Le,selectedData:we,setSaveDisabled:fe,searchInCollectionFetcher:D.searchInCollectionFetcher,hideProductCheckbox:V,outOfStockAction:M,hideVariantCheckbox:N,selectProductsFromCustomCollection:H,renderWithoutModal:Y,pickerType:q,hideProductVariants:J,fbStatusFetcher:D.fbStatusFetcher,onProductDetailClick:e=>{$e(!0),ze(e)},showProductDetailInfoIcon:ee,scrollContainerRef:Ae})})),"view"===de&&e.jsx(k,{selectedCollections:we||{},selectedCollectionsDispatch:Le,setScreen:ue,collections:le,hideProductVariants:J,outOfStockAction:M,storeId:R,appType:ne,fbStatusFetcher:D.fbStatusFetcher}),"rearrange"===de&&e.jsx(j,{selectedCollections:we||{},selectedCollectionsDispatch:Le,setScreen:ue,outOfStockAction:M,rearrangeViewType:"grid"===he?"list":"grid",scrollContainerRef:Ae,storeId:R,appType:ne,fbStatusFetcher:D.fbStatusFetcher}),"searchProducts"===de&&e.jsx(S,{customCollectionRestriction:D.customCollectionRestriction,selectedCollections:we||{},searchedCollections:De||{},searchedCollectionsDispatch:Re,selectedCollectionsDispatch:Le,setScreen:ue,collections:le,onBackPress:()=>{Ie(""),Re({type:"set",data:{collections:{},products:{}}})},pickerType:q,hideProductCheckbox:V,hideProductVariants:J,hideVariantCheckbox:N,storeId:R,appType:ne,fbStatusFetcher:D.fbStatusFetcher,setCollectionId:ge,setSelectedCollectionId:je,renderWithoutModal:Y,hideCollectionCheckbox:z,outOfStockAction:M,limit:B,exactLimit:$})]}))]}));return e.jsx(e.Fragment,{children:Y?e.jsxs(e.Fragment,{children:[He,ce.renderFooter?e.jsxs(F,{children:[Me(),e.jsx(a,{buttonText:Ne(ce.primaryButtonText),disabled:!ce.isLoading&&(be||Se<1||$&&Se<$||!$&&B&&Se>B)||ce.primaryButtonDisabled,isLoading:ce.isLoading,onClick:()=>{D.onAdd(we,Se),Ve(),ue([P.Collections,P.RearrangeProducts].includes(Q)?Q:P.Collections)}})]}):e.jsx(e.Fragment,{}),Ee&&Be?e.jsx(g,{productData:Be,outOfStockAction:M,useDynamicInfoImageSize:D.useDynamicInfoImageSize,onClose:()=>{$e(!1)}}):e.jsx(e.Fragment,{})]}):e.jsxs(u,Object.assign({zIndex:E,open:A,onClose:()=>{null==L||L(),Ve()},headingTitle:G||("collections"===de||"products"===de?"Select Products":"view"===de?"Selected Products":"searchProducts"===de?"Searched Results":"rearrange"===de?"Rearrange Products":void 0),headingSubtitle:ie,footerShadow:!0,centralContainerStyles:{width:K||"600px",left:U||"auto"},headerRightCustomElement:oe?e.jsx("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:L},{children:e.jsx(l,{width:20,height:20,color:n.content.secondary})})):e.jsx(e.Fragment,{}),footerContainerStyle:D.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:n.surface.standard}:void 0,primaryButton:se?(e=>Object.assign(Object.assign({},e),{disabled:!e.isLoading&&(be||Se<1||$&&Se<$||!$&&B&&Se>B)||e.disabled,onClick:()=>{D.onAdd(we,Se),Ve(),ue([P.Collections,P.RearrangeProducts].includes(Q)?Q:P.Collections)}}))(se):{buttonText:Ne(),disabled:be||Se<1||$&&Se<$||!$&&B&&Se>B||!1,onClick:()=>{D.onAdd(we,Se),Ve()}},secondaryButton:re?(e=>Object.assign(Object.assign({},e),{disabled:be||Se<1||$&&Se<$||!$&&B&&Se>B||!1,onClick:()=>{const e=T(we,le,De);D.onAdd(e,Se,!0)}}))(re):void 0,wrapperStyle:D.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:W?e.jsx(e.Fragment,{}):Me(),hideCrossButton:Ee||oe},{children:[He,Ee&&Be?e.jsx(g,{productData:Be,useDynamicInfoImageSize:D.useDynamicInfoImageSize,outOfStockAction:M,onClose:()=>{$e(!1)}}):e.jsx(e.Fragment,{})]}))})};export{D as ProductPickerModal};
@@ -26,6 +26,8 @@ interface SearchScreenInterface {
26
26
  hideCollectionCheckbox?: boolean;
27
27
  renderWithoutModal?: boolean;
28
28
  outOfStockAction?: OUT_OF_STOCK_ACTION;
29
+ limit?: number;
30
+ exactLimit?: number;
29
31
  }
30
32
  export declare const SearchScreen: (props: SearchScreenInterface) => import("react/jsx-runtime").JSX.Element;
31
33
  export {};
@@ -1 +1 @@
1
- import{j as o}from"../../node_modules/react/jsx-runtime.js";import e from"../../assets/icons/arrow_left.svg.js";import{useEffect as t}from"react";import{IconButton as l}from"../icon-button/IconButton.js";import{BodyCaption as i}from"../TypographyStyle.js";import{CollectionCard as c}from"./collectionScreen.js";import{EmptyState as s}from"./emptyState.js";import{ProductGroup as d}from"./product.js";import{SelectedScreenHeader as r}from"./style.js";import{fetchFbStatusCollection as n,isCollectionPartiallyChecked as u,isProductPartiallyChecked as a,liftTheStateUp as p}from"./utility.js";const h=h=>{var v;const{customCollectionRestriction:m,selectedCollections:j,searchedCollections:C,searchedCollectionsDispatch:k,selectedCollectionsDispatch:y,setScreen:x,collections:b,onBackPress:f,hideVariantCheckbox:S,pickerType:g,hideProductVariants:O,hideProductCheckbox:P,storeId:I,fbStatusFetcher:D,setCollectionId:T,setSelectedCollectionId:F,hideCollectionCheckbox:V,renderWithoutModal:w,outOfStockAction:A,appType:R}=h;t((()=>{var o;n(null!==(o=C.products)&&void 0!==o?o:{},I,R,k,D,"setProducts")}),[null==C?void 0:C.products]);const W=!!m&&(null==j?void 0:j.isCustom);return o.jsxs("div",{children:[o.jsxs(r,{children:[o.jsx(l,{Icon:e,onClick:()=>{x("collections"),f()}}),o.jsx(i,{children:(null===(v=Object.keys(null==C?void 0:C.collections))||void 0===v?void 0:v.length)?"Searched Collections & Products":"Searched Products"})]}),o.jsx("div",{children:Object.keys(null==C?void 0:C.products).length||Object.keys(null==C?void 0:C.collections).length?o.jsxs(o.Fragment,{children:[o.jsx(o.Fragment,{children:Object.keys(null==C?void 0:C.collections).map((e=>o.jsx(c,{customCollectionRestriction:m,data:null==b?void 0:b[e],isDisabled:W&&!(null==j?void 0:j[e]),isChecked:!!(null==j?void 0:j[e]),isPartiallyChecked:u(e,null==b?void 0:b[e],j,O),selectedCollectionsDispatch:y,setCollectionId:T,setSelectedCollectionId:F,setScreen:x,id:e,hideCollectionCheckbox:V||"-1"===e,selectedCollections:j,renderWithoutModal:w,pickerType:g,usedInSearch:!0},e)))}),o.jsx(o.Fragment,{children:Object.keys(null==C?void 0:C.products).map((e=>{var t,l;return Object.keys((null===(l=null===(t=null==C?void 0:C.products)||void 0===t?void 0:t[e])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i,c;let s=!1;return(null===(l=null==C?void 0:C.products)||void 0===l?void 0:l.isCustom)&&(s=!0),o.jsx(d,{collectionId:e,upliftAdditions:(o,t)=>((o,e,t)=>{var l;const i=p(t,null===(l=null==C?void 0:C.products)||void 0===l?void 0:l[o]);y({type:e,data:Object.assign(Object.assign({},i),{isRestricted:m})})})(e,o,t),productId:t,data:(null===(i=null==C?void 0:C.products)||void 0===i?void 0:i[e].products)[t],isProductPartiallyChecked:a(e,t,j,null===(c=C.products)||void 0===c?void 0:c[e],O),selectedData:j,selectedCollectionsDispatch:y,viewOnly:s,hideProductCheckbox:P,hideVariantCheckbox:S,hideProductVariants:O,pickerType:g,outOfStockAction:A},t)}))}))})]}):o.jsx(s,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{h as SearchScreen};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import o from"../../assets/icons/arrow_left.svg.js";import{useEffect as t}from"react";import{IconButton as l}from"../icon-button/IconButton.js";import{BodyCaption as i}from"../TypographyStyle.js";import{CollectionCard as c}from"./collectionScreen.js";import{EmptyState as s}from"./emptyState.js";import{ProductGroup as d}from"./product.js";import{SelectedScreenHeader as r}from"./style.js";import{fetchFbStatusCollection as n,isCollectionPartiallyChecked as u,isProductPartiallyChecked as a,liftTheStateUp as p}from"./utility.js";const h=h=>{var v;const{customCollectionRestriction:m,selectedCollections:j,searchedCollections:C,searchedCollectionsDispatch:k,selectedCollectionsDispatch:y,setScreen:x,collections:b,onBackPress:f,hideVariantCheckbox:O,pickerType:S,hideProductVariants:g,hideProductCheckbox:I,storeId:P,fbStatusFetcher:D,setCollectionId:T,setSelectedCollectionId:F,hideCollectionCheckbox:V,renderWithoutModal:w,outOfStockAction:A,appType:L,limit:R,exactLimit:W}=h;t((()=>{var e;n(null!==(e=C.products)&&void 0!==e?e:{},P,L,k,D,"setProducts")}),[null==C?void 0:C.products]);const B=!!m&&(null==j?void 0:j.isCustom),M=Object.keys(j||{}).filter((e=>"isCustom"!==e)).length;return e.jsxs("div",{children:[e.jsxs(r,{children:[e.jsx(l,{Icon:o,onClick:()=>{x("collections"),f()}}),e.jsx(i,{children:(null===(v=Object.keys(null==C?void 0:C.collections))||void 0===v?void 0:v.length)?"Searched Collections & Products":"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==C?void 0:C.products).length||Object.keys(null==C?void 0:C.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==C?void 0:C.collections).map((o=>{const t=!!(null==j?void 0:j[o]),l="COLLECTION"===S&&!t&&(!!W&&M>=W||!!R&&M>=R);return e.jsx(c,{customCollectionRestriction:m,data:null==b?void 0:b[o],isDisabled:B&&!(null==j?void 0:j[o])||l,isChecked:t,isPartiallyChecked:u(o,null==b?void 0:b[o],j,g),selectedCollectionsDispatch:y,setCollectionId:T,setSelectedCollectionId:F,setScreen:x,id:o,hideCollectionCheckbox:V||"-1"===o,selectedCollections:j,renderWithoutModal:w,pickerType:S,usedInSearch:!0},o)}))}),e.jsx(e.Fragment,{children:Object.keys(null==C?void 0:C.products).map((o=>{var t,l;return Object.keys((null===(l=null===(t=null==C?void 0:C.products)||void 0===t?void 0:t[o])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i,c;let s=!1;return(null===(l=null==C?void 0:C.products)||void 0===l?void 0:l.isCustom)&&(s=!0),e.jsx(d,{collectionId:o,upliftAdditions:(e,t)=>((e,o,t)=>{var l;const i=p(t,null===(l=null==C?void 0:C.products)||void 0===l?void 0:l[e]);y({type:o,data:Object.assign(Object.assign({},i),{isRestricted:m})})})(o,e,t),productId:t,data:(null===(i=null==C?void 0:C.products)||void 0===i?void 0:i[o].products)[t],isProductPartiallyChecked:a(o,t,j,null===(c=C.products)||void 0===c?void 0:c[o],g),selectedData:j,selectedCollectionsDispatch:y,viewOnly:s,hideProductCheckbox:I,hideVariantCheckbox:O,hideProductVariants:g,pickerType:S,outOfStockAction:A},t)}))}))})]}):e.jsx(s,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{h as SearchScreen};
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { WhatsNewContent } from './WhatsNew.types';
3
+ interface WhatsNewProps {
4
+ title?: string;
5
+ tooltip?: string;
6
+ searchPlaceholder?: string;
7
+ emptyStateTitle?: string;
8
+ emptyStateDescription?: string;
9
+ noResultsText?: string;
10
+ width?: string;
11
+ onContentClick?: (content: WhatsNewContent) => void;
12
+ renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
13
+ buttonTestId?: string;
14
+ iconWidth?: number;
15
+ iconHeight?: number;
16
+ customIcon?: React.ComponentType<{
17
+ width?: number;
18
+ height?: number;
19
+ color?: string;
20
+ }>;
21
+ }
22
+ export declare const WhatsNew: React.FC<WhatsNewProps>;
23
+ export {};
@@ -0,0 +1 @@
1
+ import{j as t}from"../../node_modules/react/jsx-runtime.js";import{useState as e}from"react";import{WhatsNewButton as o}from"./WhatsNewButton.js";import{WhatsNewPanel as n}from"./WhatsNewPanel.js";import{useWhatsNewContext as s}from"./WhatsNewProvider.js";const i=i=>{let{title:r="What's new",tooltip:a="What's new",searchPlaceholder:c="Search posts",emptyStateTitle:h="Nothing new!",emptyStateDescription:m="There are no new updates or features at the moment. Check back soon!",noResultsText:l="Sorry, no results found.",width:d="480px",onContentClick:p,renderCustomContent:u,buttonTestId:C="whats-new-button",iconWidth:w=32,iconHeight:j=32,customIcon:x}=i;const[f,g]=e(!1),{whatsNewContent:W,isLoading:S,newContentCount:T}=s();return t.jsxs(t.Fragment,{children:[t.jsx(o,{onClick:()=>g(!0),newContentCount:T,isOpen:f,isLoading:S,tooltip:a,testId:C,iconWidth:w,iconHeight:j,customIcon:x}),t.jsx(n,{isOpen:f,onClose:()=>g(!1),content:W,isLoading:S,title:r,searchPlaceholder:c,emptyStateTitle:h,emptyStateDescription:m,noResultsText:l,width:d,onContentClick:t=>{p&&p(t)},renderCustomContent:u})]})};export{i as WhatsNew};
@@ -0,0 +1,11 @@
1
+ export declare const WhatsNewIconContainer: import("styled-components").StyledComponent<"div", any, {
2
+ count?: number | undefined;
3
+ }, never>;
4
+ export declare const WhatsNewWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const MainCardContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const BackgroundImageContainer: import("styled-components").StyledComponent<"div", any, {
8
+ imageUrl: string;
9
+ height?: string | undefined;
10
+ width?: string | undefined;
11
+ }, never>;