@salesgenterp/ui-components 0.0.17 → 0.0.20

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/README.md CHANGED
@@ -15,6 +15,12 @@ Note: `import 'antd/dist/antd.css'` in storybook component to apply the style.
15
15
 
16
16
  Check latest version [here](https://www.npmjs.com/package/@salesgenterp/ui-components)
17
17
 
18
+ ### Add tag to publish commit:
19
+ - Add tag to maintain the release version. Run following commands:
20
+ - git tag -a `<version-number>` 9fceb02
21
+ - example: git tag -a v1.2 9fceb02
22
+ - git push origin --tags
23
+
18
24
  #### Auto publish:
19
25
  - Publishing package is automated using github actions.
20
26
  - Changes pushed/merged into `master` branch with updated package verison will be automatically published to npm.
package/dist/index.js CHANGED
@@ -3,7 +3,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
3
3
  var React = require('react');
4
4
  var React__default = _interopDefault(React);
5
5
  var antd = require('antd');
6
- var styled = _interopDefault(require('styled-components'));
6
+ var styled = require('styled-components');
7
+ var styled__default = _interopDefault(styled);
7
8
 
8
9
  function _extends() {
9
10
  _extends = Object.assign || function (target) {
@@ -47,6 +48,25 @@ function _taggedTemplateLiteralLoose(strings, raw) {
47
48
  return strings;
48
49
  }
49
50
 
51
+ var buttonColor = function buttonColor(theme) {
52
+ var color = theme.colors.primary;
53
+ return "\n border-color: " + color + " !important;\n background: " + color + " !important;\n ";
54
+ };
55
+
56
+ var buttonSVGStyles = function buttonSVGStyles(theme) {
57
+ return "\n svg {\n fill: " + theme.colors.white + "\n } \n";
58
+ };
59
+
60
+ var primaryButtonStyle = function primaryButtonStyle(_ref) {
61
+ var theme = _ref.theme;
62
+ return "\n " + buttonColor(theme) + "\n\n &:hover,\n &:focus,\n &:active {\n " + buttonColor(theme) + "\n }\n \n " + buttonSVGStyles(theme) + "\n";
63
+ };
64
+
65
+ var labelPrimaryStyle = function labelPrimaryStyle(_ref) {
66
+ var theme = _ref.theme;
67
+ return " color: " + theme.colors.primary;
68
+ };
69
+
50
70
  function _templateObject12() {
51
71
  var data = _taggedTemplateLiteralLoose(["\n text-transform: uppercase;\n button {\n padding: 0;\n margin-right: 5px;\n text-transform: uppercase;\n }\n"]);
52
72
 
@@ -58,7 +78,7 @@ function _templateObject12() {
58
78
  }
59
79
 
60
80
  function _templateObject11() {
61
- var data = _taggedTemplateLiteralLoose(["\n background: red;\n height: 30px;\n width: 30px;\n\n position: absolute;\n top: 10px;\n left: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n border-radius: 50%;\n"]);
81
+ var data = _taggedTemplateLiteralLoose(["\n background: ", ";\n height: 30px;\n width: 30px;\n\n position: absolute;\n top: 10px;\n left: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n border-radius: 50%;\n"]);
62
82
 
63
83
  _templateObject11 = function _templateObject11() {
64
84
  return data;
@@ -68,7 +88,7 @@ function _templateObject11() {
68
88
  }
69
89
 
70
90
  function _templateObject10() {
71
- var data = _taggedTemplateLiteralLoose(["\n margin-left: 15px;\n"]);
91
+ var data = _taggedTemplateLiteralLoose(["\n margin-left: 15px;\n color: white;\n ", ";\n"]);
72
92
 
73
93
  _templateObject10 = function _templateObject10() {
74
94
  return data;
@@ -138,7 +158,7 @@ function _templateObject4() {
138
158
  }
139
159
 
140
160
  function _templateObject3() {
141
- var data = _taggedTemplateLiteralLoose(["\n color: red;\n font-weight: 500;\n"]);
161
+ var data = _taggedTemplateLiteralLoose(["\n ", ";\n font-weight: 500;\n"]);
142
162
 
143
163
  _templateObject3 = function _templateObject3() {
144
164
  return data;
@@ -148,7 +168,7 @@ function _templateObject3() {
148
168
  }
149
169
 
150
170
  function _templateObject2() {
151
- var data = _taggedTemplateLiteralLoose(["\n color: red;\n font-weight: bold;\n"]);
171
+ var data = _taggedTemplateLiteralLoose(["\n ", ";\n font-weight: bold;\n"]);
152
172
 
153
173
  _templateObject2 = function _templateObject2() {
154
174
  return data;
@@ -166,18 +186,21 @@ function _templateObject() {
166
186
 
167
187
  return data;
168
188
  }
169
- var StyledOne = styled.div(_templateObject());
170
- var StyledPrice = styled.div(_templateObject2());
171
- var StyledOutOfStock = styled.div(_templateObject3());
172
- var StyledStockBG = styled.div(_templateObject4());
173
- var StyledUpdateQty = styled.div(_templateObject5());
174
- var StyledNumberInput = styled(antd.Input)(_templateObject6());
175
- var StyledFlex = styled.div(_templateObject7());
176
- var AddToCartContainer = styled(StyledFlex)(_templateObject8());
177
- var StyledNotifyMe = styled(StyledFlex)(_templateObject9());
178
- var StyledNotifyButton = styled(antd.Button)(_templateObject10());
179
- var StyledProductCounter = styled.div(_templateObject11());
180
- var StyledLoginView = styled.div(_templateObject12());
189
+ var StyledOne = styled__default.div(_templateObject());
190
+ var StyledPrice = styled__default.div(_templateObject2(), labelPrimaryStyle);
191
+ var StyledOutOfStock = styled__default.div(_templateObject3(), labelPrimaryStyle);
192
+ var StyledStockBG = styled__default.div(_templateObject4());
193
+ var StyledUpdateQty = styled__default.div(_templateObject5());
194
+ var StyledNumberInput = styled__default(antd.Input)(_templateObject6());
195
+ var StyledFlex = styled__default.div(_templateObject7());
196
+ var AddToCartContainer = styled__default(StyledFlex)(_templateObject8());
197
+ var StyledNotifyMe = styled__default(StyledFlex)(_templateObject9());
198
+ var StyledNotifyButton = styled__default(antd.Button)(_templateObject10(), primaryButtonStyle);
199
+ var StyledProductCounter = styled__default.div(_templateObject11(), function (_ref) {
200
+ var theme = _ref.theme;
201
+ return theme.colors.primary;
202
+ });
203
+ var StyledLoginView = styled__default.div(_templateObject12());
181
204
 
182
205
  var preventOuterClick = function preventOuterClick(e) {
183
206
  e.preventDefault();
@@ -191,11 +214,9 @@ var ProductCounter = function ProductCounter(_ref) {
191
214
  };
192
215
 
193
216
  var QtyMeter = function QtyMeter(_ref2) {
194
- var _ref2$defaultQty = _ref2.defaultQty,
195
- defaultQty = _ref2$defaultQty === void 0 ? 0 : _ref2$defaultQty,
196
- updatedQty = _ref2.updatedQty;
217
+ var updatedQty = _ref2.updatedQty;
197
218
 
198
- var _useState = React.useState(defaultQty),
219
+ var _useState = React.useState(0),
199
220
  qtyToBuy = _useState[0],
200
221
  setQtyToBuy = _useState[1];
201
222
 
@@ -204,6 +225,10 @@ var QtyMeter = function QtyMeter(_ref2) {
204
225
  setShowInput = _useState2[1];
205
226
 
206
227
  var containerRef = React.useRef(null);
228
+
229
+ var _useContext = React.useContext(ProductContext),
230
+ totalQty = _useContext.item.qty;
231
+
207
232
  React.useEffect(function () {
208
233
  var onResize = function onResize() {
209
234
  var _containerRef$current = containerRef.current.closest('.ant-card').getBoundingClientRect(),
@@ -227,7 +252,7 @@ var QtyMeter = function QtyMeter(_ref2) {
227
252
  var increaseQty = function increaseQty(e) {
228
253
  preventOuterClick(e);
229
254
 
230
- if (qtyToBuy >= 0) {
255
+ if (qtyToBuy >= 0 && qtyToBuy < totalQty) {
231
256
  updateQty(qtyToBuy + 1);
232
257
  }
233
258
  };
@@ -249,19 +274,22 @@ var QtyMeter = function QtyMeter(_ref2) {
249
274
  }
250
275
  };
251
276
 
252
- return /*#__PURE__*/React__default.createElement(StyledUpdateQty, {
253
- ref: containerRef
277
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ProductCounter, {
278
+ qty: qtyToBuy
279
+ }), /*#__PURE__*/React__default.createElement(StyledUpdateQty, {
280
+ ref: containerRef,
281
+ className: "qty-container"
254
282
  }, /*#__PURE__*/React__default.createElement(antd.Button, {
255
- onClick: increaseQty
283
+ onClick: increaseQty,
284
+ className: "increment"
256
285
  }, "+"), showInput && /*#__PURE__*/React__default.createElement(StyledNumberInput, {
257
286
  value: qtyToBuy,
258
287
  onChange: onInputChange,
259
288
  onClick: preventOuterClick
260
289
  }), /*#__PURE__*/React__default.createElement(antd.Button, {
261
- onClick: decreaseQty
262
- }, "-"), /*#__PURE__*/React__default.createElement(ProductCounter, {
263
- qty: qtyToBuy
264
- }));
290
+ onClick: decreaseQty,
291
+ className: "decrement"
292
+ }, "-")));
265
293
  };
266
294
 
267
295
  function _arrayWithHoles(arr) {
@@ -2094,8 +2122,6 @@ var ShoppingCartOutlined$2 = /*#__PURE__*/React.forwardRef(ShoppingCartOutlined$
2094
2122
  var NotifyMeButton = function NotifyMeButton(_ref) {
2095
2123
  var onClick = _ref.onClick;
2096
2124
  return /*#__PURE__*/React__default.createElement(StyledNotifyButton, {
2097
- type: "primary",
2098
- danger: true,
2099
2125
  onClick: onClick
2100
2126
  }, /*#__PURE__*/React__default.createElement(BellOutlined$2, null));
2101
2127
  };
@@ -2130,11 +2156,19 @@ var NotifyMe = function NotifyMe() {
2130
2156
  }));
2131
2157
  };
2132
2158
 
2159
+ function _templateObject$1() {
2160
+ var data = _taggedTemplateLiteralLoose(["\n ", ";\n"]);
2161
+
2162
+ _templateObject$1 = function _templateObject() {
2163
+ return data;
2164
+ };
2165
+
2166
+ return data;
2167
+ }
2168
+ var StyledAddToCartIconButton = styled__default(antd.Button)(_templateObject$1(), primaryButtonStyle);
2133
2169
  var AddToCartButton = function AddToCartButton(_ref) {
2134
2170
  var onClick = _ref.onClick;
2135
- return /*#__PURE__*/React__default.createElement(antd.Button, {
2136
- danger: true,
2137
- type: "primary",
2171
+ return /*#__PURE__*/React__default.createElement(StyledAddToCartIconButton, {
2138
2172
  onClick: onClick
2139
2173
  }, /*#__PURE__*/React__default.createElement(ShoppingCartOutlined$2, null));
2140
2174
  };
@@ -2194,10 +2228,169 @@ var One = function One() {
2194
2228
  }) : renderSubModules());
2195
2229
  };
2196
2230
 
2197
- function _templateObject$1() {
2198
- var data = _taggedTemplateLiteralLoose(["\n text-align: center;\n\n :hover {\n cursor: pointer;\n\n ", ";\n\n .quick-action {\n display: flex;\n }\n }\n\n .ant-card-cover {\n ", "\n }\n\n .ant-card-body {\n padding: 15px;\n padding-top: 0px;\n }\n\n .ant-card-meta {\n margin-bottom: 6px;\n\n .ant-card-meta-title {\n white-space: initial;\n font-size: 14px;\n ", "\n }\n\n .ant-card-meta-description {\n ", ";\n }\n }\n"]);
2231
+ function _templateObject4$1() {
2232
+ var data = _taggedTemplateLiteralLoose(["\n height: 35px;\n\n ", "\n"]);
2199
2233
 
2200
- _templateObject$1 = function _templateObject() {
2234
+ _templateObject4$1 = function _templateObject4() {
2235
+ return data;
2236
+ };
2237
+
2238
+ return data;
2239
+ }
2240
+
2241
+ function _templateObject3$1() {
2242
+ var data = _taggedTemplateLiteralLoose(["\n height: 35px;\n text-transform: uppercase;\n\n display: flex;\n align-items: center;\n justify-content: center;\n"]);
2243
+
2244
+ _templateObject3$1 = function _templateObject3() {
2245
+ return data;
2246
+ };
2247
+
2248
+ return data;
2249
+ }
2250
+
2251
+ function _templateObject2$1() {
2252
+ var data = _taggedTemplateLiteralLoose(["\n font-size: 20px;\n margin-bottom: 10px;\n"]);
2253
+
2254
+ _templateObject2$1 = function _templateObject2() {
2255
+ return data;
2256
+ };
2257
+
2258
+ return data;
2259
+ }
2260
+
2261
+ function _templateObject$2() {
2262
+ var data = _taggedTemplateLiteralLoose(["\n min-height: 60px;\n"]);
2263
+
2264
+ _templateObject$2 = function _templateObject() {
2265
+ return data;
2266
+ };
2267
+
2268
+ return data;
2269
+ }
2270
+ var StyledTwo = styled__default.div(_templateObject$2());
2271
+ var StyledPrice$1 = styled__default.div(_templateObject2$1());
2272
+ var StyledOutOfStock$1 = styled__default.div(_templateObject3$1());
2273
+ var StyledAddToCartButton = styled__default(antd.Button)(_templateObject4$1(), primaryButtonStyle);
2274
+
2275
+ function Two() {
2276
+ var _useContext = React.useContext(ProductContext),
2277
+ _useContext$item = _useContext.item,
2278
+ price = _useContext$item.price,
2279
+ currency = _useContext$item.currency,
2280
+ qty = _useContext$item.qty,
2281
+ id = _useContext$item.id,
2282
+ addToCart = _useContext.addToCart;
2283
+
2284
+ var amount = currency + " " + price;
2285
+ var isProductOutOfStock = qty === 0;
2286
+
2287
+ var onAddToCartClick = function onAddToCartClick(e) {
2288
+ preventOuterClick(e);
2289
+ addToCart({
2290
+ id: id,
2291
+ qty: 1
2292
+ });
2293
+ };
2294
+
2295
+ return /*#__PURE__*/React__default.createElement(StyledTwo, null, /*#__PURE__*/React__default.createElement(StyledPrice$1, null, amount), isProductOutOfStock ? /*#__PURE__*/React__default.createElement(StyledOutOfStock$1, null, "out of stock") : /*#__PURE__*/React__default.createElement(StyledAddToCartButton, {
2296
+ type: "primary",
2297
+ icon: /*#__PURE__*/React__default.createElement(ShoppingCartOutlined$2, null),
2298
+ onClick: onAddToCartClick
2299
+ }, "Add to Cart"));
2300
+ }
2301
+
2302
+ function _templateObject5$1() {
2303
+ var data = _taggedTemplateLiteralLoose([""]);
2304
+
2305
+ _templateObject5$1 = function _templateObject5() {
2306
+ return data;
2307
+ };
2308
+
2309
+ return data;
2310
+ }
2311
+
2312
+ function _templateObject4$2() {
2313
+ var data = _taggedTemplateLiteralLoose(["\n align-items: center;\n margin-bottom: 10px;\n\n .qty-container {\n position: relative;\n width: 70px;\n height: 35px;\n\n input {\n width: inherit;\n text-align: left;\n }\n\n .increment,\n .decrement {\n position: absolute;\n right: 8px;\n height: 14px;\n width: 14px;\n font-size: 12px;\n z-index: 1;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .increment {\n top: 3px;\n }\n .decrement {\n bottom: 3px;\n }\n }\n"]);
2314
+
2315
+ _templateObject4$2 = function _templateObject4() {
2316
+ return data;
2317
+ };
2318
+
2319
+ return data;
2320
+ }
2321
+
2322
+ function _templateObject3$2() {
2323
+ var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n ", ";\n"]);
2324
+
2325
+ _templateObject3$2 = function _templateObject3() {
2326
+ return data;
2327
+ };
2328
+
2329
+ return data;
2330
+ }
2331
+
2332
+ function _templateObject2$2() {
2333
+ var data = _taggedTemplateLiteralLoose(["\n font-weight: bold;\n ", ";\n"]);
2334
+
2335
+ _templateObject2$2 = function _templateObject2() {
2336
+ return data;
2337
+ };
2338
+
2339
+ return data;
2340
+ }
2341
+
2342
+ function _templateObject$3() {
2343
+ var data = _taggedTemplateLiteralLoose([""]);
2344
+
2345
+ _templateObject$3 = function _templateObject() {
2346
+ return data;
2347
+ };
2348
+
2349
+ return data;
2350
+ }
2351
+ var StyledThree = styled__default.div(_templateObject$3());
2352
+ var StyledPrice$2 = styled__default.div(_templateObject2$2(), labelPrimaryStyle);
2353
+ var StyledAddToCartButton$1 = styled__default(antd.Button)(_templateObject3$2(), primaryButtonStyle);
2354
+ var StyledPriceQtyContainer = styled__default(StyledFlex)(_templateObject4$2());
2355
+ var StyledQty = styled__default.div(_templateObject5$1());
2356
+
2357
+ function Three() {
2358
+ var _useContext = React.useContext(ProductContext),
2359
+ _useContext$item = _useContext.item,
2360
+ price = _useContext$item.price,
2361
+ currency = _useContext$item.currency,
2362
+ qty = _useContext$item.qty,
2363
+ id = _useContext$item.id,
2364
+ addToCart = _useContext.addToCart;
2365
+
2366
+ var _useState = React.useState(0),
2367
+ newUpdatedQty = _useState[0],
2368
+ setNewUpdatedQty = _useState[1];
2369
+
2370
+ var amount = currency + " " + price;
2371
+ var isProductOutOfStock = qty === 0;
2372
+
2373
+ var onAddToCartClick = function onAddToCartClick(e) {
2374
+ preventOuterClick(e);
2375
+ addToCart({
2376
+ id: id,
2377
+ qty: newUpdatedQty
2378
+ });
2379
+ };
2380
+
2381
+ return /*#__PURE__*/React__default.createElement(StyledThree, null, !isProductOutOfStock && /*#__PURE__*/React__default.createElement(StyledPriceQtyContainer, null, /*#__PURE__*/React__default.createElement(StyledPrice$2, null, amount), /*#__PURE__*/React__default.createElement(StyledQty, null, /*#__PURE__*/React__default.createElement(QtyMeter, {
2382
+ updatedQty: setNewUpdatedQty
2383
+ }))), isProductOutOfStock ? /*#__PURE__*/React__default.createElement(NotifyMe, null) : /*#__PURE__*/React__default.createElement(StyledAddToCartButton$1, {
2384
+ type: "primary",
2385
+ icon: /*#__PURE__*/React__default.createElement(ShoppingCartOutlined$2, null),
2386
+ onClick: onAddToCartClick
2387
+ }, "Add to Cart"));
2388
+ }
2389
+
2390
+ function _templateObject$4() {
2391
+ var data = _taggedTemplateLiteralLoose(["\n text-align: center;\n\n :hover {\n cursor: pointer;\n\n .quick-action {\n display: flex;\n }\n }\n\n .ant-card-cover .ant-image {\n ", "\n }\n\n .ant-card-body {\n padding: 15px;\n padding-top: 0px;\n }\n\n .ant-card-meta {\n margin-bottom: 6px;\n\n .ant-card-meta-title {\n white-space: initial;\n font-size: 14px;\n ", "\n }\n\n .ant-card-meta-description {\n ", ";\n }\n }\n"]);
2392
+
2393
+ _templateObject$4 = function _templateObject() {
2201
2394
  return data;
2202
2395
  };
2203
2396
 
@@ -2219,14 +2412,7 @@ var descriptionLayout = function descriptionLayout(_ref3) {
2219
2412
  return "\n margin-bottom: " + detail.mb + "px;\n";
2220
2413
  };
2221
2414
 
2222
- var boxShadow = function boxShadow() {
2223
- return "\n box-shadow: 0 2.8px 2.2px rgba(0, 0, 0, 0.034),\n 0 6.7px 5.3px rgba(0, 0, 0, 0.048), 0 12.5px 10px rgba(0, 0, 0, 0.06),\n 0 22.3px 17.9px rgba(0, 0, 0, 0.072), 0 41.8px 33.4px rgba(0, 0, 0, 0.086),\n 0 100px 80px rgba(0, 0, 0, 0.12);\n\n transition: box-shadow 0.3s ease-in-out;\n";
2224
- };
2225
-
2226
- var StyledCardProductContainer = styled(antd.Card)(_templateObject$1(), function (_ref4) {
2227
- var showBoxShadow = _ref4.showBoxShadow;
2228
- return showBoxShadow && boxShadow();
2229
- }, imageLayout, titleLayout, descriptionLayout);
2415
+ var StyledCardProductContainer = styled__default(antd.Card)(_templateObject$4(), imageLayout, titleLayout, descriptionLayout);
2230
2416
 
2231
2417
  var OneQuickAction = function OneQuickAction() {
2232
2418
  var _useContext = React.useContext(ProductContext),
@@ -2234,7 +2420,8 @@ var OneQuickAction = function OneQuickAction() {
2234
2420
  addToCart = _useContext.addToCart;
2235
2421
 
2236
2422
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(AddToCartButton, {
2237
- onClick: function onClick() {
2423
+ onClick: function onClick(e) {
2424
+ preventOuterClick(e);
2238
2425
  addToCart({
2239
2426
  id: id,
2240
2427
  qty: 1
@@ -2243,22 +2430,37 @@ var OneQuickAction = function OneQuickAction() {
2243
2430
  }));
2244
2431
  };
2245
2432
 
2246
- function _templateObject$2() {
2247
- var data = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.3);\n display: none;\n"]);
2433
+ function _templateObject$5() {
2434
+ var data = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n align-items: center;\n justify-content: center;\n background: rgba(0, 0, 0, 0.3);\n display: none;\n z-index: 1;\n"]);
2248
2435
 
2249
- _templateObject$2 = function _templateObject() {
2436
+ _templateObject$5 = function _templateObject() {
2250
2437
  return data;
2251
2438
  };
2252
2439
 
2253
2440
  return data;
2254
2441
  }
2255
- var StyledQuickActions = styled.div(_templateObject$2());
2442
+ var StyledQuickActions = styled__default.div(_templateObject$5());
2256
2443
  var QuickAction = function QuickAction(props) {
2257
2444
  return /*#__PURE__*/React__default.createElement(StyledQuickActions, _extends({}, props, {
2258
2445
  className: "quick-action"
2259
2446
  }), props.children);
2260
2447
  };
2261
2448
 
2449
+ var Breakpoint = function Breakpoint() {};
2450
+
2451
+ Breakpoint.xs = 'xs';
2452
+ Breakpoint.sm = 'sm';
2453
+ Breakpoint.md = 'md';
2454
+ Breakpoint.lg = 'lg';
2455
+ Breakpoint.xl = 'xl';
2456
+ Breakpoint.xxl = 'xxl';
2457
+
2458
+ var Variant = function Variant() {};
2459
+
2460
+ Variant.ONE = 'one';
2461
+ Variant.TWO = 'two';
2462
+ Variant.THREE = 'three';
2463
+
2262
2464
  var Meta = antd.Card.Meta;
2263
2465
 
2264
2466
  var noop = function noop() {};
@@ -2275,12 +2477,24 @@ var ProductContext = React__default.createContext(defaultProps);
2275
2477
 
2276
2478
  var getComponent = function getComponent(variant) {
2277
2479
  switch (variant) {
2278
- case 'one':
2480
+ case Variant.ONE:
2279
2481
  return {
2280
2482
  quickAction: /*#__PURE__*/React__default.createElement(OneQuickAction, null),
2281
2483
  subComponent: /*#__PURE__*/React__default.createElement(One, null)
2282
2484
  };
2283
2485
 
2486
+ case Variant.TWO:
2487
+ return {
2488
+ quickAction: /*#__PURE__*/React__default.createElement(OneQuickAction, null),
2489
+ subComponent: /*#__PURE__*/React__default.createElement(Two, null)
2490
+ };
2491
+
2492
+ case Variant.THREE:
2493
+ return {
2494
+ quickAction: /*#__PURE__*/React__default.createElement(OneQuickAction, null),
2495
+ subComponent: /*#__PURE__*/React__default.createElement(Three, null)
2496
+ };
2497
+
2284
2498
  default:
2285
2499
  return {
2286
2500
  quickAction: '',
@@ -2314,8 +2528,8 @@ var Product = function Product(props) {
2314
2528
  onClick: function onClick(e) {
2315
2529
  return onProductClick(item, e);
2316
2530
  },
2317
- showBoxShadow: showBoxShadow,
2318
2531
  layout: layoutModel,
2532
+ hoverable: showBoxShadow,
2319
2533
  cover: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showQuickAction && /*#__PURE__*/React__default.createElement(QuickAction, null, c.quickAction), /*#__PURE__*/React__default.createElement(antd.Image, {
2320
2534
  onClick: function onClick(e) {
2321
2535
  preventOuterClick(e);
@@ -2332,6 +2546,13 @@ var Product = function Product(props) {
2332
2546
  }), c.subComponent)));
2333
2547
  };
2334
2548
 
2549
+ var theme = {
2550
+ colors: {
2551
+ primary: 'red',
2552
+ white: 'white'
2553
+ }
2554
+ };
2555
+
2335
2556
  var noop$1 = function noop() {};
2336
2557
 
2337
2558
  var getLayoutModel = function getLayoutModel(_temp) {
@@ -2399,7 +2620,8 @@ var ProductSlider = function ProductSlider(props) {
2399
2620
 
2400
2621
  var colCount = newProps.colCount,
2401
2622
  items = newProps.items,
2402
- restProps = _objectWithoutPropertiesLoose(newProps, ["colCount", "items"]);
2623
+ theme$1 = newProps.theme,
2624
+ restProps = _objectWithoutPropertiesLoose(newProps, ["colCount", "items", "theme"]);
2403
2625
 
2404
2626
  var _restProps$layoutMode = restProps.layoutModel,
2405
2627
  colSpace = _restProps$layoutMode.colSpace,
@@ -2421,23 +2643,21 @@ var ProductSlider = function ProductSlider(props) {
2421
2643
  key: item.id
2422
2644
  }));
2423
2645
  });
2424
- return /*#__PURE__*/React__default.createElement(antd.Row, {
2646
+
2647
+ var newTheme = _extends({}, theme, {
2648
+ colors: _extends({}, theme.colors, theme$1.colors)
2649
+ });
2650
+
2651
+ return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
2652
+ theme: newTheme
2653
+ }, /*#__PURE__*/React__default.createElement(antd.Row, {
2425
2654
  gutter: [colSpace, rowSpace],
2426
2655
  style: {
2427
2656
  background: backgroundColor
2428
2657
  }
2429
- }, products);
2658
+ }, products));
2430
2659
  };
2431
2660
 
2432
- var Breakpoint = function Breakpoint() {};
2433
-
2434
- Breakpoint.xs = 'xs';
2435
- Breakpoint.sm = 'sm';
2436
- Breakpoint.md = 'md';
2437
- Breakpoint.lg = 'lg';
2438
- Breakpoint.xl = 'xl';
2439
- Breakpoint.xxl = 'xxl';
2440
-
2441
2661
  var ProductHelper = /*#__PURE__*/function () {
2442
2662
  function ProductHelper() {
2443
2663
  this.setupMap();
@@ -2556,6 +2776,7 @@ exports.Breakpoint = Breakpoint;
2556
2776
  exports.Product = Product;
2557
2777
  exports.ProductHelper = ProductHelper;
2558
2778
  exports.ProductSlider = ProductSlider;
2779
+ exports.Variant = Variant;
2559
2780
  exports.useGridSize = useGridSize;
2560
2781
  exports.useWindowSize = useWindowSize;
2561
2782
  //# sourceMappingURL=index.js.map