@bikdotai/bik-component-library 0.0.660-beta.0 → 0.0.662-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.
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +2 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +2 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +1 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +6 -2
- package/dist/cjs/components/avatar/Avatar.d.ts +1 -3
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/cjs/components/plans/SubscriptionPlan.d.ts +1 -0
- package/dist/cjs/components/plans/SubscriptionPlan.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +1 -0
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/product.js +1 -1
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +7 -7
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.d.ts +11 -0
- package/dist/cjs/components/product-picker-v2/style.js +53 -18
- package/dist/cjs/components/product-picker-v2/utility.d.ts +1 -0
- package/dist/cjs/components/product-picker-v2/utility.js +1 -1
- package/dist/cjs/components/product-picker-v2/variant.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +2 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +2 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +5 -1
- package/dist/esm/components/avatar/Avatar.d.ts +1 -3
- package/dist/esm/components/avatar/Avatar.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/esm/components/plans/SubscriptionPlan.d.ts +1 -0
- package/dist/esm/components/plans/SubscriptionPlan.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +1 -0
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/product.js +1 -1
- package/dist/esm/components/product-picker-v2/productInfoOverlay.js +7 -7
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/style.d.ts +11 -0
- package/dist/esm/components/product-picker-v2/style.js +51 -16
- package/dist/esm/components/product-picker-v2/utility.d.ts +1 -0
- package/dist/esm/components/product-picker-v2/utility.js +1 -1
- package/dist/esm/components/product-picker-v2/variant.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/assets/icons/bik_livechat.svg.js +0 -1
- package/dist/esm/assets/icons/bik_livechat.svg.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js"),i=require("./modal.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),o=require("./modal.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(e);const d=l.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
background-color: white;
|
|
4
4
|
height: ${e=>e.renderWithoutModal?"90%":"75vh"};
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
`,l
|
|
6
|
+
`,n=l.default.div`
|
|
7
7
|
overflow-y: scroll;
|
|
8
8
|
overflow-x: hidden;
|
|
9
9
|
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
::-webkit-scrollbar-thumb {
|
|
16
|
-
background-color: ${e=>e.screenName!==
|
|
16
|
+
background-color: ${e=>e.screenName!==o.ScreenName.RearrangeProducts?"#888":"#fff"};
|
|
17
17
|
border-radius: 8px;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,a=l.default.div`
|
|
20
20
|
height: 64px;
|
|
21
21
|
background-color: ${e=>e.isDisabled?"#F0F0F0":e.isActive?t.COLORS.background.positive.light:"white"};
|
|
22
22
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
cursor: pointer;
|
|
31
31
|
background-color: ${t.COLORS.surface.hovered};
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,p=l.default.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
flex-direction: row;
|
|
36
36
|
justify-content: center;
|
|
37
37
|
align-items: center;
|
|
38
38
|
column-gap: 18px;
|
|
39
|
-
`,
|
|
39
|
+
`,c=l.default.div`
|
|
40
40
|
display: flex;
|
|
41
41
|
flex-direction: column;
|
|
42
42
|
justify-content: center;
|
|
43
|
-
`,
|
|
43
|
+
`,s=l.default.div`
|
|
44
44
|
display: flex;
|
|
45
45
|
flex-direction: row;
|
|
46
46
|
max-height: 32px;
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
position: sticky;
|
|
54
54
|
top: 0;
|
|
55
55
|
z-index: 10;
|
|
56
|
-
`,
|
|
56
|
+
`,x=l.default.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: row;
|
|
59
59
|
column-gap: 16px;
|
|
60
60
|
padding: 12px 16px;
|
|
61
61
|
border-bottom: 1px solid #e0e0e0;
|
|
62
62
|
align-items: center;
|
|
63
|
-
`,
|
|
63
|
+
`,f=l.default.div`
|
|
64
64
|
min-height: 64px;
|
|
65
65
|
background-color: ${e=>e.isActive?t.COLORS.background.positive.light:"white"};
|
|
66
66
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
background-color: ${t.COLORS.surface.hovered};
|
|
77
77
|
}
|
|
78
|
-
`,u=
|
|
78
|
+
`,u=l.default.div`
|
|
79
79
|
display: flex;
|
|
80
80
|
flex-direction: row;
|
|
81
81
|
max-height: 32px;
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
position: sticky;
|
|
88
88
|
top: 0;
|
|
89
89
|
z-index: 10;
|
|
90
|
-
`,
|
|
90
|
+
`,g=l.default.div`
|
|
91
91
|
display: flex;
|
|
92
92
|
flex-direction: column;
|
|
93
|
-
`,
|
|
93
|
+
`,y=l.default.div`
|
|
94
94
|
min-height: 72px;
|
|
95
95
|
background: white;
|
|
96
96
|
padding: 12px 16px;
|
|
@@ -101,24 +101,31 @@
|
|
|
101
101
|
|
|
102
102
|
.text-container {
|
|
103
103
|
display: flex;
|
|
104
|
-
justify-content: space-between;
|
|
105
104
|
gap: 16px;
|
|
105
|
+
flex: 1;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.tooltip-title-tag {
|
|
109
109
|
display: flex;
|
|
110
110
|
flex: 1;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
width: 100%;
|
|
114
|
+
gap: 16px;
|
|
115
|
+
}
|
|
116
|
+
.info-container {
|
|
117
|
+
display: flex;
|
|
111
118
|
flex-direction: column;
|
|
112
|
-
|
|
119
|
+
flex: 1;
|
|
113
120
|
}
|
|
114
|
-
`,
|
|
121
|
+
`,h=l.default.div`
|
|
115
122
|
height: 72px;
|
|
116
123
|
width: 72px;
|
|
117
124
|
display: flex;
|
|
118
125
|
align-items: center;
|
|
119
126
|
justify-content: center;
|
|
120
127
|
margin: 16px;
|
|
121
|
-
`;
|
|
128
|
+
`;l.default.div`
|
|
122
129
|
display: flex;
|
|
123
130
|
width: 32px;
|
|
124
131
|
height: 32px;
|
|
@@ -127,11 +134,39 @@
|
|
|
127
134
|
align-items: center;
|
|
128
135
|
border: 1px solid ${t.COLORS.stroke.primary};
|
|
129
136
|
border-radius: 4px;
|
|
130
|
-
`;const
|
|
137
|
+
`;const b=l.default.div`
|
|
131
138
|
padding: 16px 24px;
|
|
132
139
|
display: flex;
|
|
133
140
|
align-items: center;
|
|
134
141
|
justify-content: space-between;
|
|
135
142
|
margin-top: auto;
|
|
136
143
|
width: 100%;
|
|
137
|
-
|
|
144
|
+
`,m=l.default.div`
|
|
145
|
+
width: fit-content;
|
|
146
|
+
background: ${t.COLORS.background.brandLight};
|
|
147
|
+
padding: 2px 6px;
|
|
148
|
+
border-radius: 14px;
|
|
149
|
+
`,w=l.default(i.BodyTiny)`
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
overflow: hidden;
|
|
152
|
+
text-overflow: ellipsis;
|
|
153
|
+
max-width: 196px;
|
|
154
|
+
display: block;
|
|
155
|
+
color: ${t.COLORS.background.inverseLight};
|
|
156
|
+
`,v=l.default.div`
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: row;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: 5px;
|
|
161
|
+
`,S=l.default.div`
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: row;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: 8px;
|
|
166
|
+
min-width: 0;
|
|
167
|
+
`;l.default(i.TitleSmall)`
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
text-overflow: ellipsis;
|
|
171
|
+
display: block;
|
|
172
|
+
`,exports.CollectionCardDetailStyle=c,exports.CollectionCardInfoStyle=p,exports.CollectionCardStyle=a,exports.CollectionNameHolder=g,exports.ContainerStyle=d,exports.EllipsedBodyTiny=w,exports.ProductCardStyle=f,exports.ProductInfo=S,exports.ProductScreenCollectionCardStyle=x,exports.ProductScreenHeader=s,exports.ProductSubTitle=v,exports.SKUIDBadge=m,exports.ScrollContainerStyle=n,exports.SelectedScreenHeader=u,exports.StyledFooterForNonModal=b,exports.VariantCardGridStyle=h,exports.VariantCardListStyle=y;
|
|
@@ -48,3 +48,4 @@ export declare const updateAllVariantsForSelectedProducts: (selectedItems: {
|
|
|
48
48
|
} | undefined;
|
|
49
49
|
};
|
|
50
50
|
}, collections: Collection, searchedProducts: SearchedItems) => Record<string, any>;
|
|
51
|
+
export declare const getSkuId: (product: Product | ProductVariant, isVariant: boolean) => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((t=>{var i,n;const d=null!==(n=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||l.push(n)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const t=Object.assign({},o);Object.keys(t).forEach((o=>{var i,n;const d=null!==(n=null===(i=t[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=t[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===l[n]?u.fbStatus="REJECTED":u&&"APPROVED"===l[n]&&(u.fbStatus="APPROVED")}))}))})),i({type:d,data:t})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},exports.getVariantIdsToFetchAtProductLevel=(o,l)=>{const t=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const v=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(v).forEach((n=>{var d,v,s,e,u;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[n],(null==r?void 0:r.fbStatus)||t.push(n)}))})),t},exports.isCollectionPartiallyChecked=function(o,l,t){var i,n,d,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==l?void 0:l.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(n=t[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(u).length}else if(t[o]){const i=null==l?void 0:l.products;i&&Object.keys(i).forEach((o=>{var l;const t=null===(l=i[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>s+=1))}));const n=null===(v=t[o])||void 0===v?void 0:v.products;if(n&&Object.keys(n).forEach((o=>{var l;const t=null===(l=n[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,l,t,i,n)=>{var d,v,s,e,u,r,c,a,p,b,O,f,j,h,y,g,E,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((t=>{var i,n;const d=null!==(n=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||l.push(n)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const t=Object.assign({},o);Object.keys(t).forEach((o=>{var i,n;const d=null!==(n=null===(i=t[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=t[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===l[n]?u.fbStatus="REJECTED":u&&"APPROVED"===l[n]&&(u.fbStatus="APPROVED")}))}))})),i({type:d,data:t})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},exports.getSkuId=(o,l)=>{var t;if(l)return o.skuId;const i=Object.values(null!==(t=null==o?void 0:o.variants)&&void 0!==t?t:{});return 1===i.length&&i[0].name.includes(o.name)?i[0].skuId:""},exports.getVariantIdsToFetchAtProductLevel=(o,l)=>{const t=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const v=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(v).forEach((n=>{var d,v,s,e,u;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[n],(null==r?void 0:r.fbStatus)||t.push(n)}))})),t},exports.isCollectionPartiallyChecked=function(o,l,t){var i,n,d,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==l?void 0:l.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(n=t[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(u).length}else if(t[o]){const i=null==l?void 0:l.products;i&&Object.keys(i).forEach((o=>{var l;const t=null===(l=i[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>s+=1))}));const n=null===(v=t[o])||void 0===v?void 0:v.products;if(n&&Object.keys(n).forEach((o=>{var l;const t=null===(l=n[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,l,t,i,n)=>{var d,v,s,e,u,r,c,a,p,b,O,f,j,h,y,g,k,E,P;let D=0,S=0;if(null===(v=null===(d=null==t?void 0:t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(n)return!1;const d=(null===(u=null===(e=null===(s=null==t?void 0:t[o])||void 0===s?void 0:s.products)||void 0===e?void 0:e[l])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(d).length)for(const i in d){const n=null===(c=null===(r=null==t?void 0:t[o])||void 0===r?void 0:r.products)||void 0===c?void 0:c[l],d=null===(O=null===(b=null===(p=null===(a=null==t?void 0:t[o])||void 0===a?void 0:a.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[i];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==n?void 0:n.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>S++)),Object.keys((null===(P=null===(E=null===(k=null==t?void 0:t[o])||void 0===k?void 0:k.products)||void 0===E?void 0:E[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&S!==D)return!0}return!1},exports.liftTheStateUp=(l,t)=>{const i=o.cloneDeep(t);if(delete i.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:i})).productId&&t.products){const n=o.cloneDeep(t.products[l.productId]);(null==n?void 0:n.variants)&&delete n.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:i,productOnlyData:n})}return l},exports.markVariantsAsApprovedProductsLevel=(o,l,t,i,n)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var t,i;Object.keys(null!==(i=null===(t=null==o?void 0:o[l])||void 0===t?void 0:t.variants)&&void 0!==i?i:{}).forEach((t=>{var i,n;const v=null===(i=null==o?void 0:o[l].variants)||void 0===i?void 0:i[t];v&&(v.fbStatus="APPROVED");const s=null===(n=null==d?void 0:d[l])||void 0===n?void 0:n.variants;s&&s[t]&&(s[t]=v)}))})),i&&n){const o=Object.assign({},i);o.products=d,n(o),l({type:"productsPaged",data:{collectionId:t,products:d}})}else l({type:"productsPaged",data:{collectionId:t,products:d}})},exports.paginateSelectedItems=function(o,t,i){var n;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const e=o[s],u=l(e.products,t,i-v);u&&Object.keys(u).length>0&&(d[s]=Object.assign(Object.assign({},e),{products:u})),v+=Object.keys(null!==(n=e.products)&&void 0!==n?n:{}).length}return d},exports.shouldShowVariant=o=>{const l=Object.keys(o.variants||[]);let t=!1;return!(l.length<=1)||(l.forEach((l=>{var i,n;t=null!==(n=null===(i=o.variants)||void 0===i?void 0:i[l].name.includes(o.name))&&void 0!==n&&n})),!t)},exports.updateAllVariantsForSelectedProducts=(l,t,i)=>Object.keys(l).reduce(((n,d)=>{var v;return d in t?(n[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((n,v)=>{var s,e,u,r,c,a,p,b,O,f;const j=null===(s=t[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(u=null===(e=null==i?void 0:i.products)||void 0===e?void 0:e[d])||void 0===u?void 0:u.products)||void 0===r?void 0:r[v];return j?n[v]=Object.assign(Object.assign({},(null===(c=l[d].products)||void 0===c?void 0:c[v])||{}),{allVariants:o.cloneDeep(j.variants)}):h?n[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o.cloneDeep(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(n[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o.cloneDeep(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),n}),{})}),n):n}),{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/delete.svg.js"),r=require("../../assets/icons/drag_handle.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/delete.svg.js"),r=require("../../assets/icons/drag_handle.svg.js"),i=require("../../constants/Theme.js"),a=require("../icon-button/IconButton.js"),s=require("../shimmer-image/ShimmerImage.js"),n=require("../TypographyStyle.js"),o=require("./constants.js"),c=require("./helpers/ProductHelper.js"),l=require("./ProductPickerTag.js"),d=require("./style.js"),u=require("../tooltips/Tooltip.js");exports.VariantCardGridView=t=>{const{data:r}=t;return e.jsx(d.VariantCardGridStyle,{children:e.jsx(u.Tooltip,Object.assign({body:r.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e.jsx(s.ShimmerImage,{width:72,height:72,imageUrl:r.image,alt:"Item",borderRadius:4})}))})},exports.VariantCardListView=j=>{var h,m,g;const{data:p,selectedCollectionsDispatch:x,outOfStockAction:y}=j,b=()=>{let e;return e=p.name.includes(p.productName)?p.name:`${p.productName} ${p.name}`,e},{dataForProductPickerTag:v,tagText:I,tagType:O}=c.ProductHelper.getDataForProductPickerTag(p,!0,y),T=`${p.currency&&null!==(h=o.CurrencySymbols[p.currency])&&void 0!==h?h:""}${null!==(g=null!==(m=p.price)&&void 0!==m?m:p.actualPrice)&&void 0!==g?g:""}`,S=p.skuId;return e.jsx(d.VariantCardListStyle,{children:e.jsxs("div",Object.assign({className:"text-container"},{children:[e.jsx(r.default,{width:24,height:24,color:i.COLORS.content.placeholder}),e.jsx("div",{children:e.jsx(s.ShimmerImage,{width:40,height:40,imageUrl:p.image,alt:"Item",borderRadius:4},p.variantId)}),e.jsxs("div",Object.assign({className:"info-container"},{children:[e.jsxs("div",Object.assign({className:"tooltip-title-tag"},{children:[e.jsx(u.Tooltip,Object.assign({body:b(),placement:"bottom",delay:400,variant:"light"},{children:e.jsx(n.TitleSmall,Object.assign({numberOfLines:1,style:{flex:1,minWidth:0}},{children:b()}))})),e.jsxs(d.ProductInfo,{children:[e.jsx(l.ProductPickerTag,{isVariant:!0,data:v,tagText:I,tagType:O}),e.jsx(a.IconButton,{Icon:()=>e.jsx(t.default,{width:24,height:24,color:i.COLORS.content.placeholder}),onClick:()=>{x&&x({type:"variantUnselected",data:{productId:p.productId,variantId:p.variantId,collectionId:p.collectionId}}),j.onDelete&&j.onDelete()}})]})]})),e.jsxs(d.ProductSubTitle,{children:[e.jsx(n.BodyCaption,Object.assign({color:i.COLORS.content.secondary},{children:!(null==v?void 0:v.fbStatus)||I?null:T})),S&&e.jsx(u.Tooltip,Object.assign({body:S,placement:"top"},{children:e.jsx(d.SKUIDBadge,{children:e.jsx(d.EllipsedBodyTiny,{children:`SKU ID: ${S}`})})}))]})]}))]}))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import i,{useEffect as r,useImperativeHandle as l}from"react";import{useSelector as s}from"react-redux";import{Button as d}from"../../button/Button.js";import{Dropdown as n}from"../../dropdown/Dropdown.js";import{JOIN_OPERATOR_OPTIONS as a}from"../constants/operators.js";import{useQueryBuilder as c}from"../hooks/useQueryBuilder.js";import p from"./AddNodeButton.js";import m from"./DeleteButton.js";import u from"./QueryBuilderNode/QueryBuilderNode.js";import{LinedContainer as f}from"./QueryBuilderNodes.styled.js";const y=i.forwardRef(((i,y)=>{let{infinite:j,addNodeBtnText:b,allowedNodes:
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import i,{useEffect as r,useImperativeHandle as l}from"react";import{useSelector as s}from"react-redux";import{Button as d}from"../../button/Button.js";import{Dropdown as n}from"../../dropdown/Dropdown.js";import{JOIN_OPERATOR_OPTIONS as a}from"../constants/operators.js";import{useQueryBuilder as c}from"../hooks/useQueryBuilder.js";import p from"./AddNodeButton.js";import m from"./DeleteButton.js";import u from"./QueryBuilderNode/QueryBuilderNode.js";import{LinedContainer as f}from"./QueryBuilderNodes.styled.js";const y=i.forwardRef(((i,y)=>{let{infinite:j,addNodeBtnText:b,allowedNodes:g,typesAPIHandlers:v,onStateChange:h,mode:w,selectorKey:x}=i;var N;const O=s((e=>null==e?void 0:e[x])),{deleteNode:B,clearAll:S,selectJoinOperator:C,fillState:Q}=c(x);r((()=>{null==h||h(Object.assign({},O))}),[O]);const T=a.map((e=>(null==O?void 0:O.operator)&&e.value===O.operator?Object.assign(Object.assign({},e),{selected:!0}):e));return l(y,(()=>({getState:()=>Object.assign({},O),fillState(e){Q(Object.assign({},e))},clearAll:S}))),e(t,{children:[null===(N=null==O?void 0:O.nodes)||void 0===N?void 0:N.map(((i,r)=>e(t,{children:[0!==r&&o("div",Object.assign({style:{width:80,position:"relative"}},{children:o(n,{disabled:"view"===w,onSelect:e=>{C(e.value)},options:T,width:"80px",height:96,size:"small",skipSorting:!0})})),e("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:12}},{children:[o(f,Object.assign({style:{paddingTop:0===r?0:24,maxWidth:"calc(100% - 24px)"}},{children:o(u,{selectorKey:x,mode:null!=w?w:"create",allowedNodes:g,node:i,apiHandler:v[i.type]})})),o(t,"view"!==w?{children:0!==r&&o(m,{onClick:()=>B(i._id)})}:{})]}),i._id)]}))),j&&"view"!==w&&e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[o(p,{buttonText:b,allowedNodes:g,selectorKey:x}),o(d,{buttonText:"Clear filters",size:"medium",buttonType:"tertiaryGray",onClick:()=>S(g[0])})]}))]})}));y.displayName="QueryBuilderNodes";export{y as default};
|
|
@@ -37,5 +37,7 @@ export type LineChartProps = {
|
|
|
37
37
|
titleTooltipCallback?: (context: any) => void;
|
|
38
38
|
isInternationalStore?: boolean;
|
|
39
39
|
customYHeaders?: any;
|
|
40
|
+
legendsAndIconDirection?: 'row-reverse' | 'row';
|
|
41
|
+
headerIcons?: React.ReactNode[];
|
|
40
42
|
};
|
|
41
43
|
export declare const LineChart: React.FC<LineChartProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as n,CategoryScale as o,LinearScale as r,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as x,truncateValueForIndianStore as k}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";n.register(o,r,i,a,s,d,c,u,p,g);const O=n=>{let{scaleText:o,labels:r,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:O,prefixCurrencyInYAxis:B,pointRadius:S,useKFormat:z,lineThickness:D,ticksLabelCallback:I,labelCallback:T,afterBodyCallBack:$,titleTooltipCallback:A,isInternationalStore:F,customYHeaders:R,headerIcons:q=[],legendsAndIconDirection:L="row"}=n;var P,E,H;const[W,Y]=b(null),Z=y();m((()=>{var e,t,l,n;if(null===(n=null===(l=null===(t=null===(e=Z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===n?void 0:n.length){const e=38*Z.current.scales.y.ticks.length;Y(e)}}),[Z]);const G=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),K={labels:r,datasets:a.map(((e,t)=>{var l,n,o;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:S||(r&&r.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(n=null!==(l=e.lineWidth)&&void 0!==l?l:D)&&void 0!==n?n:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,W?W-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(o=e.backgroundColor)&&void 0!==o?o:"transparent",legend:e.legend})}))},N={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:A,label:T,afterBody:$},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==o?void 0:o.yPrefix)&&void 0!==t?t:""}${F?x(e):k(e)}${null!=B?B:""}`:R&&Object.keys(R).length>0?R[e]:`${null!==(l=null==o?void 0:o.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:O?24:0},title:{display:!!(null==o?void 0:o.y),text:null==o?void 0:o.y},grid:{color:f.background.base,drawBorder:null===(P=null==o?void 0:o.yDrawBorder)||void 0===P||P}},x:{ticks:{callback:I,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==o?void 0:o.x),text:null==o?void 0:o.x},grid:{display:!1,drawBorder:null!==(E=null==o?void 0:o.xDrawBorder)&&void 0!==E&&E}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(H=null!=i?i:W)&&void 0!==H?H:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:L}},{children:[t(C,{children:q.map(((e,l)=>t(j,{children:e},l)))}),t(C,{children:G.map(((n,o)=>{let{text:r,color:i,square:a}=n;return r?e(j,{children:[t(w,{color:i,square:a,newStyle:O}),t(h,Object.assign({color:"#667085"},{children:r}))]},o):t(l,{})}))})]})),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:Z,options:N,data:K})}))]}))};export{O as LineChart};
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,jsx as i}from"react/jsx-runtime";import t from"../../../../assets/icons/maximize.svg.js";import{Chart as e,CategoryScale as a,LinearScale as l,BarElement as n,Tooltip as d,Legend as s}from"chart.js";import r from"chartjs-plugin-datalabels";import{useState as c,useMemo as u}from"react";import{Bar as v}from"react-chartjs-2";import{IconButton as p}from"../../../icon-button/IconButton.js";import{StyledModal as g}from"../../../modals/styledModal.js";import{TitleRegular as b,BodyTiny as
|
|
1
|
+
import{jsxs as o,jsx as i}from"react/jsx-runtime";import t from"../../../../assets/icons/maximize.svg.js";import{Chart as e,CategoryScale as a,LinearScale as l,BarElement as n,Tooltip as d,Legend as s}from"chart.js";import r from"chartjs-plugin-datalabels";import{useState as c,useMemo as u}from"react";import{Bar as v}from"react-chartjs-2";import{IconButton as p}from"../../../icon-button/IconButton.js";import{StyledModal as g}from"../../../modals/styledModal.js";import{TitleRegular as b,BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as x,FONTS as m}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as f}from"../utils/calcPercentage.js";import{COLOR_SCHEMA as O,GRAPH_ORIENTATION as A}from"./StackedBarChart.model.js";import{GraphContainerWrapper as C,HeaderIconWrapper as k}from"./StackedBarChart.styles.js";e.register(a,l,n,d,s,r);const j=e=>{var a,l,n,d,s,r,j,L,F,S,H,I,T,R,w,E,B,D,N,Z,z,P,G,W,_,q,M,V,Y,J,K,Q,U,X,$,oo,io,to,eo,ao,lo,no;const{headerIcons:so=[],legendsAndIconDirection:ro="row"}=e,[co,uo]=c(!1),vo=[250,1e3,800,1500,300,600],po=0===e.yAxis.data.length,go=void 0===e.customColourScaleBrand&&void 0===e.customColourScalePastel?e.colorSchema===O.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:e.colorSchema===O.PASTEL?e.customColourScalePastel:e.customColourScaleBrand,bo=e.customHoverColour,ho=u((()=>{var o,i,t;return Object.assign(Object.assign({barPercentage:(null==e?void 0:e.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:e.barWidth,borderRadius:(null==e?void 0:e.borderRadius)||void 0},"object"==typeof(null==e?void 0:e.borderRadius)?{borderSkipped:!1}:{}),(null===(o=null==e?void 0:e.addBarGap)||void 0===o?void 0:o.flag)?{borderWidth:{top:(null===(i=null==e?void 0:e.addBarGap)||void 0===i?void 0:i.value)||2,bottom:(null===(t=null==e?void 0:e.addBarGap)||void 0===t?void 0:t.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[e.barWidth,null==e?void 0:e.borderRadius,null==e?void 0:e.barPercentage,null==e?void 0:e.addBarGap]),xo={};e.yAxis.data.map((o=>{o.map((o=>{xo[o.name]?xo[o.name].push(o.value):xo[o.name]=[o.value]}))}));const mo=Object.keys(xo).map(((o,i)=>Object.assign({label:o,data:xo[o],backgroundColor:null==go?void 0:go[i],hoverBackgroundColor:void 0===bo?void 0:bo[i]},ho)));let yo=e.xAxis.data.map((o=>"string"==typeof o?o:o.name)),fo=mo;if(e.truncateBars){const o=((o,i,t)=>{if(i.length<=t)return{truncatedData:o,truncatedLabels:i,originalData:o,originalLabels:i};const e=o.map((o=>o.slice(0,t))),a=o.map((o=>o.slice(t).reduce(((o,i)=>o+i),0)));e.forEach(((o,i)=>o.push(a[i])));const l=i.slice(0,t);return l.push("Others"),{truncatedData:e,truncatedLabels:l,originalData:o,originalLabels:i}})(mo.map((o=>o.data)),yo,e.truncateBars);mo.forEach(((i,t)=>i.data=o.truncatedData[t])),yo=o.truncatedLabels,fo=o.originalData.map(((o,i)=>Object.assign(Object.assign({},mo[i]),{data:o})))}const Oo={plugins:{legend:{display:!po&&!e.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!po,callbacks:{label:null===(a=e.tooltipConfig)||void 0===a?void 0:a.labelCallback,title:null===(l=e.tooltipConfig)||void 0===l?void 0:l.titleCallback,footer:null===(n=e.tooltipConfig)||void 0===n?void 0:n.footerCallback},footerFont:null===(s=null===(d=e.tooltipConfig)||void 0===d?void 0:d.footerStyles)||void 0===s?void 0:s.footerFont},datalabels:{display:null!==(r=e.showTotal)&&void 0!==r&&r,anchor:"end",align:"end",clamp:!0,formatter:(o,i)=>{var t;const e=i.datasetIndex,a=i.chart.data.datasets;if(e!==a.length-1)return"";const l=i.dataIndex;let n=0;for(let o=0;o<a.length;o++)n+=null!==(t=a[o].data[l])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:x.content.secondary}},layout:{padding:{right:e.showTotal&&e.orientation===A.HORIZONTAL?50:0,top:e.showTotal&&e.orientation!=A.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!e.customLegend,labels:{usePointStyle:!0}},indexAxis:e.orientation===A.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(e.orientation===A.HORIZONTAL?null===(j=e.yAxis)||void 0===j?void 0:j.title:null===(L=e.xAxis)||void 0===L?void 0:L.title),text:e.orientation===A.HORIZONTAL?null===(F=e.yAxis)||void 0===F?void 0:F.title:null===(S=e.xAxis)||void 0===S?void 0:S.title,color:null!==(T=e.orientation===A.HORIZONTAL?null===(H=e.yAxis)||void 0===H?void 0:H.titleColor:null===(I=e.xAxis)||void 0===I?void 0:I.titleColor)&&void 0!==T?T:x.content.secondary,font:{size:m.caption.fontSize}},grid:{display:e.orientation===A.HORIZONTAL&&(void 0===(null===(R=null==e?void 0:e.showGridLines)||void 0===R?void 0:R.x)||(null===(w=null==e?void 0:e.showGridLines)||void 0===w?void 0:w.x)),color:x.background.base},ticks:{fontSize:m.caption.fontSize,color:null!==(E=e.yAxis.labelColor)&&void 0!==E?E:x.content.secondary,callback:e.orientation===A.HORIZONTAL?e.isInternationalStore?y:f:void 0},stacked:e.orientation===A.HORIZONTAL?"boolean"!=typeof(null===(B=e.yAxis)||void 0===B?void 0:B.stacked)||(null===(D=e.yAxis)||void 0===D?void 0:D.stacked):"boolean"!=typeof(null===(N=e.xAxis)||void 0===N?void 0:N.stacked)||(null===(Z=e.xAxis)||void 0===Z?void 0:Z.stacked)},y:Object.assign(Object.assign({},(null===(z=null==e?void 0:e.equalHeight)||void 0===z?void 0:z.flag)?{suggestedMin:-(null==e?void 0:e.equalHeight.max),suggestedMax:null==e?void 0:e.equalHeight.max}:{}),{title:{display:!!(e.orientation===A.HORIZONTAL?null===(P=e.xAxis)||void 0===P?void 0:P.title:null===(G=e.yAxis)||void 0===G?void 0:G.title),text:e.orientation===A.HORIZONTAL?null===(W=e.xAxis)||void 0===W?void 0:W.title:null===(_=e.yAxis)||void 0===_?void 0:_.title,color:null!==(V=e.orientation===A.HORIZONTAL?null===(q=e.xAxis)||void 0===q?void 0:q.titleColor:null===(M=e.yAxis)||void 0===M?void 0:M.titleColor)&&void 0!==V?V:x.content.secondary,font:{size:m.caption.fontSize}},grid:{display:e.orientation!==A.HORIZONTAL&&(void 0===(null===(Y=null==e?void 0:e.showGridLines)||void 0===Y?void 0:Y.y)||(null===(J=null==e?void 0:e.showGridLines)||void 0===J?void 0:J.y)),color:x.background.base},ticks:Object.assign(Object.assign({stepSize:e.orientation===A.HORIZONTAL?null===(K=e.xAxis)||void 0===K?void 0:K.stepSize:null===(Q=e.yAxis)||void 0===Q?void 0:Q.stepSize,fontSize:m.caption.fontSize,color:null!==(U=e.xAxis.labelColor)&&void 0!==U?U:x.content.secondary},po?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==e?void 0:e.ticksCallback)?null==e?void 0:e.ticksCallback:e.orientation!==A.VERTICAL?e.isInternationalStore?y:f:void 0}),stacked:e.orientation===A.HORIZONTAL?"boolean"!=typeof(null===(X=e.xAxis)||void 0===X?void 0:X.stacked)||(null===($=e.xAxis)||void 0===$?void 0:$.stacked):"boolean"!=typeof(null===(oo=e.yAxis)||void 0===oo?void 0:oo.stacked)||(null===(io=e.yAxis)||void 0===io?void 0:io.stacked)})},onClick:(o,i)=>{if(!e.onBarClick)return;const t=i[0].datasetIndex,a=i[0].index,l=o.chart.data.datasets[t].label,n=o.chart.data.labels[a];e.onBarClick(n,l)},onHover:(o,i)=>{e.onBarClick&&i.length&&(o.native.target.style.cursor="pointer")}};e.orientation&&e.orientation!==A.VERTICAL?delete Oo.scales.y.ticks.callback:delete Oo.scales.x.ticks.callback;const Ao={labels:yo,datasets:po?[{data:vo,backgroundColor:"rgba(0,0,0,0)"}]:mo},Co={labels:e.xAxis.data.map((o=>"string"==typeof o?o:o.name)),datasets:po?[{data:vo,backgroundColor:"rgba(0,0,0,0)"}]:fo},ko=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return i("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:e.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:mo.map((t=>o("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[i("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),i(h,Object.assign({color:x.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return o(C,Object.assign({style:null!==(to=e.wrapperStyle)&&void 0!==to?to:{},padding:e.outerPadding,customLegend:e.customLegend},{children:[e.chartHeading&&o("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:e.hideHeading?"flex-end":"space-between"}},{children:[!0!==e.hideHeading&&i(b,Object.assign({color:null!==(eo=e.chartHeading.color)&&void 0!==eo?eo:x.content.secondary},{children:e.chartHeading.heading})),e.allowChartPopup&&i("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:i("div",{children:i(p,{Icon:t,onClick:()=>{uo(!0)}})})}))]})),e.customLegend&&o("div",Object.assign({style:{display:"flex",flexDirection:ro,justifyContent:"space-between"}},{children:[i(k,{children:so.map(((o,t)=>i("div",{children:i("div",{children:o})},t)))}),ko()]})),i("div",Object.assign({className:"graph__wrapper"},{children:i("div",Object.assign({style:{height:null!==(ao=e.graphCanvasHeight)&&void 0!==ao?ao:500,width:null!==(lo=e.graphCanvasWidth)&&void 0!==lo?lo:"auto"}},{children:i(v,{options:Oo,data:Ao})}))})),co&&i(g,Object.assign({open:co,onClose:()=>uo(!1),closeOnOutsideClick:!0,headingTitle:null===(no=e.chartHeading)||void 0===no?void 0:no.heading,width:"85%"},{children:o("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[e.customLegend&&ko(!0),i("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:i(v,{options:Oo,data:Co})}))]}))}))]}))};export{j as StackedBarChart};
|
|
@@ -28,4 +28,8 @@ import e from"styled-components";import{COLORS as r}from"../../../../constants/T
|
|
|
28
28
|
.legend__set {
|
|
29
29
|
margin-top: 16px;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
`,p=e.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 8px;
|
|
35
|
+
`;export{n as GraphContainerWrapper,p as HeaderIconWrapper};
|
|
@@ -28,7 +28,6 @@ export type AvatarProps = {
|
|
|
28
28
|
isSelected: boolean;
|
|
29
29
|
isComments: boolean;
|
|
30
30
|
};
|
|
31
|
-
status?: 'ONLINE' | 'OFFLINE' | 'AWAY';
|
|
32
31
|
};
|
|
33
32
|
export declare const enum MESSAGE_CHANNELS {
|
|
34
33
|
INSTAGRAM = "instagram",
|
|
@@ -42,7 +41,6 @@ export declare const enum MESSAGE_CHANNELS {
|
|
|
42
41
|
EMAIL = "email",
|
|
43
42
|
SMTP = "smtp",
|
|
44
43
|
FACEBOOK_CATALOG = "facebook-catalog",
|
|
45
|
-
TASKS = "tasks"
|
|
46
|
-
BIK_LIVECHAT = "livechat"
|
|
44
|
+
TASKS = "tasks"
|
|
47
45
|
}
|
|
48
46
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as s}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as s}from"react";import{AvatarStyle as i}from"./Avatar.styled.js";import{SIZE as r,AVATAR_BACKGROUND as o,AVATAR_TYPES as a,AVATAR_SIZE_MAP as n}from"./AvatarHelper.js";import{BodyTiny as c,TitleSmall as l,TitleMedium as d}from"../TypographyStyle.js";import{COLORS as h}from"../../constants/Theme.js";import m from"../../assets/icons/CheckSquareOffset.svg.js";import g from"../../assets/icons/email-channel.svg.js";import p from"../../assets/icons/facebook_channel.svg.js";import A from"../../assets/icons/gmail.svg.js";import b from"../../assets/icons/instagram-channel.svg.js";import u from"../../assets/icons/whatsapp_color.svg.js";const S={[r.SMALL]:16,[r.MEDIUM]:20,[r.INBOX]:24,[r.LARGE]:32},f={[o.LIGHT]:h.content.secondary,[o.DARK]:h.surface.standard};var I;!function(e){e.INSTAGRAM="instagram",e.MESSENGER="messenger",e.WHATSAPP="whatsapp",e.GMAIL="gmail",e.LIVECHAT="livechat",e.GOOGLE_BUSINESS_CHAT="gbm",e.SHOPIFY="shopify",e.FACEBOOK="facebook",e.EMAIL="email",e.SMTP="smtp",e.FACEBOOK_CATALOG="facebook-catalog",e.TASKS="tasks"}(I||(I={}));const y=o=>{const[y,O]=s(!1),j=()=>{const e=(o.name||"").split(".").join(" ").split(" ").map((e=>e.charAt(0).toUpperCase())).slice(0,2).join("");return o.size===r.SMALL?t(c,Object.assign({style:{color:f[o.background]}},{children:e})):o.size===r.MEDIUM||o.size===r.INBOX?t(l,Object.assign({style:{color:f[o.background]}},{children:e})):o.size===r.LARGE?t(d,Object.assign({style:{color:f[o.background]}},{children:e})):void 0};return e("div",Object.assign({style:{position:"relative"}},{children:[e(i,Object.assign({type:o.type===a.IMAGE&&y&&o.useNameFallback&&o.name?a.INITIALS:o.type,size:o.size,background:o.background},{children:[o.type===a.IMAGE&&(o.useNameFallback&&!y?t("img",{alt:"",width:n[o.size],height:n[o.size],style:{borderRadius:(null==o?void 0:o.borderRadius)||"50%",objectFit:"contain"},src:o.photoUrl,onError:()=>{O(!0)}}):o.useNameFallback&&y&&o.name?t("div",{children:j()}):t("img",{alt:"",width:n[o.size],height:n[o.size],style:{borderRadius:(null==o?void 0:o.borderRadius)||"50%",objectFit:"contain"},src:o.photoUrl})),o.type===a.INITIALS&&t("div",{children:j()}),o.type===a.ICON&&o.icon&&t(o.icon,{width:S[o.size],height:S[o.size],color:f[o.background]})]})),o.inboxSettings&&t("div",Object.assign({style:{position:"absolute",left:"20px",top:"20px",width:14,height:14,borderRadius:(null==o?void 0:o.borderRadius)||"50%",display:"flex",justifyContent:"center",backgroundColor:o.inboxSettings.isSelected?o.inboxSettings.isComments?h.content.primary:h.background.brandLight:o.inboxSettings.isComments?h.content.primary:h.surface.standard,alignItems:"center"}},{children:(()=>{switch(o.channelName){case I.EMAIL:case I.SMTP:return t(g,{width:11,height:11});case I.FACEBOOK:case I.FACEBOOK_CATALOG:case I.MESSENGER:return t(p,{width:11,height:11});case I.INSTAGRAM:return t(b,{width:11,height:11});case I.WHATSAPP:return t(u,{width:11,height:11});case I.GMAIL:return t(A,{width:11,height:11});case I.TASKS:return t(m,{width:11,height:11})}})()}))]}))};export{S as AVATAR_SIZE_VS_ICON_SIZE_MAP,y as Avatar,f as BACKGROUND_VS_TEXT_COLOR_MAP,I as MESSAGE_CHANNELS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,TitleSmall as p}from"../TypographyStyle.js";import{useCurrency as g}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as u}from"../tag/Tag.js";import{Tooltip as y}from"../tooltips/Tooltip.js";const j=j=>{var O;const{formatCurrency:f}=g(),v=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,TitleSmall as p}from"../TypographyStyle.js";import{useCurrency as g}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as u}from"../tag/Tag.js";import{Tooltip as y}from"../tooltips/Tooltip.js";const j=j=>{var O;const{formatCurrency:f}=g(),v=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:k=!1,isDisabled:S=!1,onPlanSelect:C,oldPrice:M,hideMonthYearTag:w,planDescription:D,planDescriptionDiscount:L,showTrialOptions:F,freeTrialMessages:B,extraBlockMessage:$,isLoading:z,buttonText:H,bottomDescription:W,showMonthlyOptions:_,popularTestimony:I,skipRadioSelection:U=!1,includeText:Y,height:q,showFeaturesButton:A,businessDescription:R,isPlanSelected:E=!1,onClickShowAllFeatures:G,showSelectedPlanChip:J=!1,perMonthForYearly:K=!1,minHeightOfFeatures:Q,hoverTooltip:V,hidePriceBlock:X=!1}=j,Z=e=>K&&!_?0==e?"$0":f(Math.round(e/12),"USD"):0==e?"$0":f(e,"USD");return e(y,Object.assign({body:V},{children:t(l,Object.assign({height:q,showMostPopularChip:N||!1,onClick:()=>C(x)},{children:[N&&t("div",Object.assign({className:"most-popular-chip"},{children:[e(c,Object.assign({className:"popular-text"},{children:"Most popular "})),e(o,{height:12,width:12})]})),t("div",Object.assign({className:`box ${S?"disabled":""} \n\t\t\t\t`},{children:[t("div",Object.assign({className:"radio-flex"},{children:[!U&&e("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=S&&S,onChange:()=>C(x),className:"radio-button",checked:E}),e(d,Object.assign({style:{color:b.content.secondary,marginBottom:4}},{children:P})),J&&e("div",Object.assign({style:{marginLeft:"auto"}},{children:e(u,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),X?e(s,{}):t("div",Object.assign({className:"price-block"},{children:[M?e(h,Object.assign({className:"old--price"},{children:Z(T.price)})):e(s,{}),e(m,Object.assign({style:{color:b.content.primary}},{children:Z(M||T.price)})),e(c,Object.assign({style:{color:b.content.secondary,marginLeft:4}},{children:w?"":"/ "+(_?"month":K?"month billed annually":"year")}))]})),D&&t("div",Object.assign({className:"per-message-price"},{children:[e(h,Object.assign({style:{color:b.content.secondary}},{children:D})),L&&e(h,Object.assign({style:{color:b.background.positive.vibrant,marginLeft:4}},{children:L}))]})),R&&R.length&&e("div",Object.assign({style:{marginTop:4}},{children:R.map(((t,s)=>e(h,{style:{color:b.content.secondary},dangerouslySetInnerHTML:{__html:t}},s)))})),F&&t(c,Object.assign({className:"trial "+(k?"selected":"")},{children:["7 day free trial with ",B," messages"]})),$&&e(c,Object.assign({className:"trial "+(k?"selected":"")},{children:$})),e(p,Object.assign({className:"extra-include-margin",style:{height:Y?"":"20px"}},{children:Y||""})),e("div",Object.assign({className:"features",style:{minHeight:Q}},{children:v.map(((s,i)=>t("div",Object.assign({className:"feature"},{children:[e("div",{children:e(a,{height:20,width:20,color:b.content.primary})}),e(h,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),A&&e(r,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),G&&G()}}),U&&e("div",Object.assign({className:"button-box"},{children:z?e(r,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):t(s,{children:[k&&e(r,{disabled:S,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:H||"Selected Plan"}),!k&&!S&&e(r,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:H||"Choose plan"})]})})),I&&t("div",Object.assign({className:"popular-testimony"},{children:[e(n,{height:26,width:70}),e("div",Object.assign({className:"testimony-text"},{children:e("i",{children:I})}))]}))]})),W&&e("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${S?"disabled":""}\n\t\t\t\t\t${k?"selected":""}\n\t\t\t\t`},{children:e(c,Object.assign({className:"text",style:{color:b.background.inverse}},{children:W}))}))]}))}))};export{j as NewSubscriptionPlan};
|
|
@@ -31,6 +31,7 @@ export interface SubscriptionPlanProps {
|
|
|
31
31
|
hideMonthYearTag?: boolean;
|
|
32
32
|
buttonText?: string;
|
|
33
33
|
hoverTooltip?: string;
|
|
34
|
+
hidePriceBlock?: boolean;
|
|
34
35
|
}
|
|
35
36
|
type Props = SubscriptionPlanProps;
|
|
36
37
|
export declare const SubscriptionPlan: FunctionComponent<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import{Button as n}from"../button/Button.js";import{SubscriptionPlanStyled as a}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as o,BodyCaption as r,TitleMedium as l,BodyPrimary as d}from"../TypographyStyle.js";import{useCurrency as m}from"../../hooks/useCurreny.js";import{COLORS as h}from"../../constants/Theme.js";const p=p=>{const{formatCurrency:b}=m(),g=p.showMonthlyOptions?p.features:p.annualFeatures||[],u=p.showMonthlyOptions?p.monthlyPlan:p.yearlyPlan,y=!p.isDisabled&&p.isMostPopular,j=e=>0==e?"$0":b(e,"USD");return e(a,Object.assign({isManifestPlan:!0,isSelected:p.isSelected||!1,style:{marginTop:y?0:24}},{children:[y&&t("div",Object.assign({className:"most-popular"},{children:t(c,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e("div",Object.assign({className:`box ${p.isSelected?"selected":""} ${p.isDisabled?"disabled":""} ${y?"":"rounded-corners"}\n\t\t\t\t`},{children:[e("div",{children:[t(o,Object.assign({style:{color:h.content.secondary,marginBottom:4}},{children:p.planName})),e("div",Object.assign({className:"price-block"},{children:[p.oldPrice?t(r,Object.assign({className:"old--price"},{children:j(u.price)})):t(s,{}),t(l,Object.assign({style:{color:h.content.primary}},{children:p.oldPrice?j(p.oldPrice):j(u.price)})),t(d,Object.assign({style:{color:h.content.secondary,marginLeft:4}},{children:p.hideMonthYearTag?"":"/ "+(p.showMonthlyOptions?"month":"year")}))]})),e("div",Object.assign({className:"per-message-price"},{children:[p.planDescription&&t(r,Object.assign({style:{color:h.content.secondary}},{children:p.planDescription})),p.planDescriptionDiscount&&t(r,Object.assign({style:{color:h.background.positive.vibrant,marginLeft:4}},{children:p.planDescriptionDiscount}))]})),p.showTrialOptions&&e(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:["7 day free trial with ",p.freeTrialMessages," messages"]})),p.extraBlockMessage&&t(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:p.extraBlockMessage})),t("div",Object.assign({className:"features"},{children:g.map(((s,n)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(i,{height:12,width:12,color:h.content.primary})}),t(r,Object.assign({className:"feature-text"},{children:s.detail}),n)]}),s.detail)))}))]}),t("div",Object.assign({className:"button-box"},{children:p.isLoading?t(n,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[p.isSelected&&t(n,{disabled:p.isDisabled,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:p.buttonText||"Selected Plan"}),!p.isSelected&&!p.isDisabled&&t(n,{buttonType:"primary",size:"medium",onClick:()=>p.onPlanSelect(p.code),matchParentWidth:!0,buttonText:p.buttonText||"Choose plan"})]})}))]})),p.bottomDescription&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${p.isDisabled?"disabled":""}\n\t\t\t\t\t${p.isSelected?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:h.background.inverse}},{children:p.bottomDescription}))}))]}))};export{p as SubscriptionPlan};
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import{Button as n}from"../button/Button.js";import{SubscriptionPlanStyled as a}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as o,BodyCaption as r,TitleMedium as l,BodyPrimary as d}from"../TypographyStyle.js";import{useCurrency as m}from"../../hooks/useCurreny.js";import{COLORS as h}from"../../constants/Theme.js";const p=p=>{const{formatCurrency:b}=m(),g=p.showMonthlyOptions?p.features:p.annualFeatures||[],u=p.showMonthlyOptions?p.monthlyPlan:p.yearlyPlan,y=!p.isDisabled&&p.isMostPopular,j=e=>0==e?"$0":b(e,"USD");return e(a,Object.assign({isManifestPlan:!0,isSelected:p.isSelected||!1,style:{marginTop:y?0:24}},{children:[y&&t("div",Object.assign({className:"most-popular"},{children:t(c,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e("div",Object.assign({className:`box ${p.isSelected?"selected":""} ${p.isDisabled?"disabled":""} ${y?"":"rounded-corners"}\n\t\t\t\t`},{children:[e("div",{children:[t(o,Object.assign({style:{color:h.content.secondary,marginBottom:4}},{children:p.planName})),(null==p?void 0:p.hidePriceBlock)?t(s,{}):e("div",Object.assign({className:"price-block"},{children:[p.oldPrice?t(r,Object.assign({className:"old--price"},{children:j(u.price)})):t(s,{}),t(l,Object.assign({style:{color:h.content.primary}},{children:p.oldPrice?j(p.oldPrice):j(u.price)})),t(d,Object.assign({style:{color:h.content.secondary,marginLeft:4}},{children:p.hideMonthYearTag?"":"/ "+(p.showMonthlyOptions?"month":"year")}))]})),e("div",Object.assign({className:"per-message-price"},{children:[p.planDescription&&t(r,Object.assign({style:{color:h.content.secondary}},{children:p.planDescription})),p.planDescriptionDiscount&&t(r,Object.assign({style:{color:h.background.positive.vibrant,marginLeft:4}},{children:p.planDescriptionDiscount}))]})),p.showTrialOptions&&e(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:["7 day free trial with ",p.freeTrialMessages," messages"]})),p.extraBlockMessage&&t(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:p.extraBlockMessage})),t("div",Object.assign({className:"features"},{children:g.map(((s,n)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(i,{height:12,width:12,color:h.content.primary})}),t(r,Object.assign({className:"feature-text"},{children:s.detail}),n)]}),s.detail)))}))]}),t("div",Object.assign({className:"button-box"},{children:p.isLoading?t(n,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[p.isSelected&&t(n,{disabled:p.isDisabled,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:p.buttonText||"Selected Plan"}),!p.isSelected&&!p.isDisabled&&t(n,{buttonType:"primary",size:"medium",onClick:()=>p.onPlanSelect(p.code),matchParentWidth:!0,buttonText:p.buttonText||"Choose plan"})]})}))]})),p.bottomDescription&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${p.isDisabled?"disabled":""}\n\t\t\t\t\t${p.isSelected?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:h.background.inverse}},{children:p.bottomDescription}))}))]}))};export{p as SubscriptionPlan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import d from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as h}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import d from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as h}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as g}from"./collectionScreen.js";import{ProductInfoOverlay as C}from"./productInfoOverlay.js";import{ProductsScreen as b}from"./productScreen.js";import{RearrangeScreen as f}from"./rearrangeScreen.js";import{collectionsReducer as y,searchReducer as S,selectedColectionsReducer as v,CollectionIdContext as k}from"./reducers.js";import{SearchScreen as j}from"./searchScreen.js";import{SelectedScreen as I}from"./selectedScreen.js";import{ContainerStyle as P,ScrollContainerStyle as x,StyledFooterForNonModal as O}from"./style.js";import{OUT_OF_STOCK_ACTION as D}from"./type.js";import{updateAllVariantsForSelectedProducts as F}from"./utility.js";var T;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(T||(T={}));const R=R=>{const{storeId:w,selectedItems:A,onClose:B,visible:E,zIndex:L,exactLimit:z,limit:V,hideCollectionCheckbox:$,hideProductCheckbox:M,outOfStockAction:H=D.BLUR,hideVariantCheckbox:W,selectProductsFromCustomCollection:G,hideSelectionCount:K,title:N,width:U,left:Y,renderWithoutModal:q,onClickSave:J,pickerType:Q,hideProductVariants:X=!1,startupScreen:Z=T.Collections,rearrangeEnabled:_,selectSingleItem:ee=!1,showProductDetails:te,containerStyle:oe,crossButtonInsideHeader:ce=!1,footerForNonModal:re={},primaryButton:se,secondaryButton:ie,subtitle:ne}=R,[le,de]=r(y,{}),[ae,ue]=s([T.Collections,T.RearrangeProducts].includes(Z)?Z:T.Collections),[he,pe]=s("grid"),[me,ge]=s(""),[Ce,be]=s(""),[fe,ye]=s(0),[Se,ve]=s(!1),[ke,je]=s(0),[Ie,Pe]=s(""),[xe,Oe]=s(!1),[De,Fe]=s(!1),[Te,Re]=r(S,{collections:{},products:{}}),[we,Ae]=r(v,Object.keys(A).length>0?A:{}),Be=i(null),[Ee,Le]=s(!1),[ze,Ve]=s();n((()=>{ve(!0),Fe(!0),R.collectionFetcher(fe,w).then((e=>{console.log("collectionsParsed?.collections",null==e?void 0:e.collections),de({type:"fetched",data:(null==e?void 0:e.collections)||{}}),ve(!1),ye((e=>e+1)),Fe(!1)})).catch()}),[]),n((()=>{let e=0;X?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,r;Object.keys((null===(r=null===(c=we[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),je(e)}),[le,we,X]),n((()=>{Ce&&(ve(!0),R.productFetcher(Ce,w).then((e=>{Object.keys(e).length&&de({type:"productsFetched",data:{collectionId:Ce,products:e}}),ve(!1)})).catch())}),[Ce]),n((()=>{const e=setTimeout((()=>{"rearrange"!==ae&&(Ie.length||"collections"!==ae)&&(Ie.length?(Oe(!0),R.searchFetcher(w,Ie).then((e=>{"collections"in e&&"products"in e?(Re({type:"set",data:e}),de({type:"searched",data:e.collections})):(Re({type:"set",data:{collections:{},products:e}}),de({type:"searched",data:e})),ue("searchProducts"),ve(!1),Oe(!1)}))):ue("collections"))}),800);return()=>clearTimeout(e)}),[Ie]),n((()=>{J&&(R.onAdd(we,ke),$e())}),[J]),n((()=>{ee&&Object.keys(we||{}).length&&ke&&(R.onAdd(we,ke),$e())}),[ee,we,ke]);const $e=()=>{Ae({type:"reset",data:{}})},Me=()=>z&&ke>z?t(m,{tagText:`You can only select ${z} products`,type:"negative"}):V&&ke>V?t(m,{tagText:`You can only select ${V} products`,type:"negative"}):t(a,ke>0?{onClick:()=>{ue(_?T.RearrangeProducts:T.SelectedProducts)},buttonText:z?`${ke}/${z} products selected`:`${ke} products selected`,buttonType:["rearrange","view"].includes(ae)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(ae)}:{disabled:!0,buttonText:z?`${ke}/${z} products selected`:`${ke} products selected`,buttonType:"tertiaryGray"}),He=e=>Se?"Loading...":ae===T.RearrangeProducts?null!=e?e:"Done":null!=e?e:"Add",We=e(P,Object.assign({style:null!=oe?oe:{}},{children:[R.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:R.postHeader})),!R.hideGlobalSearch&&t(o,{children:("collections"===ae||"searchProducts"===ae)&&t("div",Object.assign({style:{padding:q?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(u,{placeholder:"Search products using name or SKU ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>xe?t(p,{size:"small",color:l.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:Ie,onChangeText:e=>{e.length&&e.trim().length?Pe(e):Pe("")}})}))}),e(x,Object.assign({ref:Be,screenName:ae},{children:["collections"===ae&&t(g,{customCollectionRestriction:R.customCollectionRestriction,dataLoading:De,collections:le,selectedCollectionsDispatch:Ae,setCollectionId:ge,setSelectedCollectionId:be,setScreen:ue,selectedCollections:we,collectionFetcher:R.collectionFetcher,storeId:w,collectionsDispatch:de,setSaveDisabled:ve,pagingControls:{curPage:fe,setCurPage:ye},hideCollectionCheckbox:$,renderWithoutModal:q,pickerType:Q,scrollContainerRef:Be}),"products"===ae&&me&&t(k.Provider,Object.assign({value:me},{children:t(b,{hideInCollectionSearch:R.hideInCollectionSearch,customCollectionRestriction:R.customCollectionRestriction,productFetcher:R.productFetcher,setScreen:ue,storeId:w,data:le[me],collectionsDispatch:de,selectedCollectionsDispatch:Ae,selectedData:we,setSaveDisabled:ve,searchInCollectionFetcher:R.searchInCollectionFetcher,hideProductCheckbox:M,outOfStockAction:H,hideVariantCheckbox:W,selectProductsFromCustomCollection:G,renderWithoutModal:q,pickerType:Q,hideProductVariants:X,fbStatusFetcher:R.fbStatusFetcher,onProductDetailClick:e=>{Le(!0),Ve(e)},showProductDetailInfoIcon:te,scrollContainerRef:Be})})),"view"===ae&&t(I,{selectedCollections:we||{},selectedCollectionsDispatch:Ae,setScreen:ue,collections:le,hideProductVariants:X,outOfStockAction:H,storeId:w,fbStatusFetcher:R.fbStatusFetcher}),"rearrange"===ae&&t(f,{selectedCollections:we||{},selectedCollectionsDispatch:Ae,setScreen:ue,outOfStockAction:H,rearrangeViewType:"grid"===he?"list":"grid",scrollContainerRef:Be,storeId:w,fbStatusFetcher:R.fbStatusFetcher}),"searchProducts"===ae&&t(j,{customCollectionRestriction:R.customCollectionRestriction,selectedCollections:we||{},searchedCollections:Te||{},searchedCollectionsDispatch:Re,selectedCollectionsDispatch:Ae,setScreen:ue,collections:le,onBackPress:()=>{Pe(""),Re({type:"set",data:{collections:{},products:{}}})},pickerType:Q,hideProductCheckbox:M,hideProductVariants:X,hideVariantCheckbox:W,storeId:w,fbStatusFetcher:R.fbStatusFetcher,setCollectionId:ge,setSelectedCollectionId:be,renderWithoutModal:q,hideCollectionCheckbox:$,outOfStockAction:H})]}))]}));return t(o,{children:q?e(o,{children:[We,re.renderFooter?e(O,{children:[Me(),t(a,{buttonText:He(re.primaryButtonText),disabled:!re.isLoading&&(Se||ke<1||z&&ke<z||!z&&V&&ke>V)||re.primaryButtonDisabled,isLoading:re.isLoading,onClick:()=>{R.onAdd(we,ke),$e(),ue([T.Collections,T.RearrangeProducts].includes(Z)?Z:T.Collections)}})]}):t(o,{}),Ee&&ze?t(C,{productData:ze,outOfStockAction:H,useDynamicInfoImageSize:R.useDynamicInfoImageSize,onClose:()=>{Le(!1)}}):t(o,{})]}):e(h,Object.assign({zIndex:L,open:E,onClose:()=>{null==B||B(),$e()},headingTitle:N||("collections"===ae||"products"===ae?"Select Products":"view"===ae?"Selected Products":"searchProducts"===ae?"Searched Results":"rearrange"===ae?"Rearrange Products":void 0),headingSubtitle:ne,footerShadow:!0,centralContainerStyles:{width:U||"600px",left:Y||"auto"},headerRightCustomElement:ce?t("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:B},{children:t(d,{width:20,height:20,color:l.content.secondary})})):t(o,{}),footerContainerStyle:R.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:l.surface.standard}:void 0,primaryButton:se?(e=>Object.assign(Object.assign({},e),{disabled:!e.isLoading&&(Se||ke<1||z&&ke<z||!z&&V&&ke>V)||e.disabled,onClick:()=>{R.onAdd(we,ke),$e(),ue([T.Collections,T.RearrangeProducts].includes(Z)?Z:T.Collections)}}))(se):{buttonText:He(),disabled:Se||ke<1||z&&ke<z||!z&&V&&ke>V||!1,onClick:()=>{R.onAdd(we,ke),$e()}},secondaryButton:ie?(e=>Object.assign(Object.assign({},e),{disabled:Se||ke<1||z&&ke<z||!z&&V&&ke>V||!1,onClick:()=>{const e=F(we,le,Te);R.onAdd(e,ke,!0)}}))(ie):void 0,wrapperStyle:R.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:K?t(o,{}):Me(),hideCrossButton:Ee||ce},{children:[We,Ee&&ze?t(C,{productData:ze,useDynamicInfoImageSize:R.useDynamicInfoImageSize,outOfStockAction:H,onClose:()=>{Le(!1)}}):t(o,{})]}))})};export{R as ProductPickerModal,T as ScreenName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as i,Fragment as o}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import c from"../../assets/icons/info.svg.js";import{CheckBox as d}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as r}from"../shimmer-image/ShimmerImage.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{TitleSmall as a,BodyCaption as s}from"../TypographyStyle.js";import{CurrencySymbols as u}from"./constants.js";import{ProductHelper as v}from"./helpers/ProductHelper.js";import{ProductPickerTag as p}from"./ProductPickerTag.js";import{ProductCardStyle as h}from"./style.js";import{shouldShowVariant as
|
|
1
|
+
import{jsxs as t,jsx as i,Fragment as o}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import c from"../../assets/icons/info.svg.js";import{CheckBox as d}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as r}from"../shimmer-image/ShimmerImage.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{TitleSmall as a,BodyCaption as s}from"../TypographyStyle.js";import{CurrencySymbols as u}from"./constants.js";import{ProductHelper as v}from"./helpers/ProductHelper.js";import{ProductPickerTag as p}from"./ProductPickerTag.js";import{ProductCardStyle as h,ProductInfo as m,ProductSubTitle as I,SKUIDBadge as y,EllipsedBodyTiny as P}from"./style.js";import{shouldShowVariant as f,getSkuId as g}from"./utility.js";const k=o=>{var e,c,d,n,r,l,a,s,v;const{collectionId:p,productId:h,data:m,selectedData:I,selectedCollectionsDispatch:y,viewOnly:P,upliftAdditions:g,isProductPartiallyChecked:k,hideProductCheckbox:j,outOfStockAction:C,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,onProductDetailClick:T,showProductDetailInfoIcon:S}=o,V=t=>{var i,o,e,c,d,n;if(!(null===(o=null===(i=null==I?void 0:I[p])||void 0===i?void 0:i.products)||void 0===o?void 0:o[h]))return!1;return!!(null===(n=null===(d=null===(c=null===(e=null==I?void 0:I[p])||void 0===e?void 0:e.products)||void 0===c?void 0:c[h])||void 0===d?void 0:d.variants)||void 0===n?void 0:n[t])},A=x||!f(m)?`${m.currency&&null!==(e=u[m.currency])&&void 0!==e?e:""}${null!==(v=null!==(r=null===(n=null===(d=Object.values(null!==(c=m.variants)&&void 0!==c?c:{}))||void 0===d?void 0:d[0])||void 0===n?void 0:n.price)&&void 0!==r?r:null===(s=null===(a=Object.values(null!==(l=m.variants)&&void 0!==l?l:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==v?v:""}`:"";return t("div",{children:[i(b,{isVariant:!1,data:m,productId:h,collectionId:p,isSelected:(()=>{var t,i;return!!(null===(i=null===(t=null==I?void 0:I[p])||void 0===t?void 0:t.products)||void 0===i?void 0:i[h])})(),isPartiallyChecked:k,selectedCollectionsDispatch:y,upliftAdditions:g,viewOnly:P,hideProductCheckbox:j,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,outOfStockAction:C,onProductDetailClick:T,showProductDetailInfoIcon:S,currencyAndPrice:A},h),x?null:f(m)&&Object.keys(m.variants||[]).map((t=>{var o,e,c,d,n,r,l;const a=`${m.currency&&null!==(o=u[m.currency])&&void 0!==o?o:""}${null!==(l=null!==(d=null===(c=null===(e=m.variants)||void 0===e?void 0:e[t])||void 0===c?void 0:c.price)&&void 0!==d?d:null===(r=null===(n=m.variants)||void 0===n?void 0:n[t])||void 0===r?void 0:r.actualPrice)&&void 0!==l?l:""}`;return i(b,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},m.variants[t]),{currency:m.currency}),variantId:t,productId:h,viewOnly:P,upliftAdditions:g,collectionId:p,isSelected:V(t),selectedCollectionsDispatch:y,outOfStockAction:C,onProductDetailClick:T,showProductDetailInfoIcon:S,currencyAndPrice:a},t)}))]})},b=u=>{const{isVariant:f,data:k,productId:b,collectionId:j,variantId:C,isSelected:O,selectedCollectionsDispatch:x,viewOnly:D,upliftAdditions:T,isPartiallyChecked:S,hideProductCheckbox:V,outOfStockAction:A,hideVariantCheckbox:w,hideProductVariants:U,pickerType:$="PRODUCT",onProductDetailClick:F,showProductDetailInfoIcon:B,currencyAndPrice:R}=u,{isVariantForProductPickerTag:H,dataForProductPickerTag:K,tagText:L,tagType:q}=v.getDataForProductPickerTag(k,f,A);console.log({data:k,isVariant:f,isVariantForProductPickerTag:H});const z=g(k,f);return t(h,Object.assign({isVariant:f,onClick:t=>{if(t.stopPropagation(),"PRODUCT"===$&&(V||w)){const t=Object.keys(k.variants);U?O?x({type:"productUnselected",data:{productId:b,collectionId:j}}):T("productSelected",{productId:b,variantId:C,collectionId:j,product:k}):O?x({type:"variantUnselected",data:{productId:b,variantId:C,collectionId:j}}):T("variantSelected",{productId:b,variantId:C||t[0],collectionId:j,variant:k})}},isActive:O},{children:[f&&!D&&!w||!f&&!D&&!V?i(d,{isChecked:O,isPartiallyChecked:S||!1,onValueChange:function(t,i,o){null==o||o.stopPropagation(),f?t?T(U?"productSelected":"variantSelected",{productId:b,variantId:C,collectionId:j,variant:k}):x({type:U?"productUnselected":"variantUnselected",data:{productId:b,variantId:C,collectionId:j}}):t?T("productSelected",{productId:b,collectionId:j,product:k}):x({type:"productUnselected",data:{productId:b,collectionId:j}})}}):i(o,{}),i("div",{children:i(r,{width:40,height:40,imageUrl:k.image,alt:"Item",borderRadius:4})}),t("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16}},{children:[i(l,Object.assign({variant:"light",body:k.name,placement:"bottom",delay:400},{children:i(a,Object.assign({style:{flex:1},numberOfLines:1},{children:k.name}))})),t(m,{children:[i(p,{isVariant:H,data:K,tagText:L,tagType:q}),B&&i(n,{onClick:()=>{null==F||F(k)},Icon:()=>i(c,{width:20,height:20,color:e.content.placeholder})})]})]})),t(I,{children:[!(null==K?void 0:K.fbStatus)&&H||L?null:i(s,Object.assign({color:e.content.secondary},{children:R})),z&&i(l,Object.assign({body:z,placement:"top"},{children:i(y,{children:i(P,{children:`SKU ID: ${z}`})})}))]})]}))]}))};export{b as ProductCard,k as ProductGroup};
|