@threekit-tools/treble 0.0.81 → 0.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/Treble/Treble.d.ts +11 -5
  2. package/dist/Treble/Treble.js +41 -12
  3. package/dist/Treble/index.d.ts +2 -2
  4. package/dist/Treble/index.js +7 -3
  5. package/dist/Treble/{Snapshots.d.ts → snapshots.d.ts} +4 -9
  6. package/dist/Treble/snapshots.js +247 -0
  7. package/dist/Treble/{Wishlist.d.ts → wishlist.d.ts} +2 -6
  8. package/dist/Treble/wishlist.js +135 -0
  9. package/dist/api/catalog.js +6 -6
  10. package/dist/api/configurations.js +3 -3
  11. package/dist/api/datatables.js +5 -5
  12. package/dist/api/index.js +5 -1
  13. package/dist/api/orders.d.ts +5 -7
  14. package/dist/api/orders.js +12 -12
  15. package/dist/api/price.js +2 -2
  16. package/dist/api/products.js +2 -2
  17. package/dist/components/Accordion/index.js +6 -7
  18. package/dist/components/AttributeTitle/index.d.ts +0 -9
  19. package/dist/components/AttributeTitle/index.js +0 -9
  20. package/dist/components/AttributeValue/index.d.ts +0 -6
  21. package/dist/components/AttributeValue/index.js +2 -8
  22. package/dist/components/Button/index.d.ts +0 -27
  23. package/dist/components/Button/index.js +0 -27
  24. package/dist/components/Cards/index.d.ts +2 -55
  25. package/dist/components/Cards/index.js +3 -60
  26. package/dist/components/Drawer/index.js +7 -16
  27. package/dist/components/Dropdown/index.d.ts +2 -59
  28. package/dist/components/Dropdown/index.js +11 -72
  29. package/dist/components/FlatForm/index.d.ts +0 -21
  30. package/dist/components/FlatForm/index.js +10 -25
  31. package/dist/components/Modal/index.js +2 -15
  32. package/dist/components/Player/index.d.ts +1 -1
  33. package/dist/components/PortalToArOverlay/index.js +5 -1
  34. package/dist/components/PortalToElement/index.js +0 -8
  35. package/dist/components/ProductDescription/index.d.ts +0 -6
  36. package/dist/components/ProductDescription/index.js +0 -6
  37. package/dist/components/ProductName/index.d.ts +0 -9
  38. package/dist/components/ProductName/index.js +0 -9
  39. package/dist/components/Share/index.d.ts +0 -12
  40. package/dist/components/Share/index.js +2 -14
  41. package/dist/components/Snapshots/index.d.ts +0 -8
  42. package/dist/components/Snapshots/index.js +2 -10
  43. package/dist/components/Strips/index.d.ts +2 -55
  44. package/dist/components/Strips/index.js +3 -60
  45. package/dist/components/Swatch/index.d.ts +2 -64
  46. package/dist/components/Swatch/index.js +3 -69
  47. package/dist/components/Switch/index.d.ts +2 -34
  48. package/dist/components/Switch/index.js +2 -38
  49. package/dist/components/Tabs/index.js +5 -1
  50. package/dist/components/TextInput/index.d.ts +2 -1
  51. package/dist/components/TextInput/index.js +2 -3
  52. package/dist/components/ThreekitProvider/index.js +5 -1
  53. package/dist/components/Tiles/index.d.ts +2 -29
  54. package/dist/components/Tiles/index.js +3 -33
  55. package/dist/components/TilesGroup/index.d.ts +2 -26
  56. package/dist/components/TilesGroup/index.js +3 -30
  57. package/dist/components/TotalPrice/index.d.ts +0 -6
  58. package/dist/components/TotalPrice/index.js +0 -6
  59. package/dist/components/TrebleApp/index.js +5 -1
  60. package/dist/components/Upload/index.d.ts +2 -1
  61. package/dist/components/Upload/index.js +21 -17
  62. package/dist/components/UploadArea/index.d.ts +2 -1
  63. package/dist/components/UploadArea/index.js +18 -15
  64. package/dist/components/Wishlist/index.d.ts +0 -3
  65. package/dist/components/Wishlist/index.js +12 -10
  66. package/dist/components/Zoom/index.d.ts +0 -17
  67. package/dist/components/Zoom/index.js +5 -21
  68. package/dist/components/formComponents.d.ts +12 -0
  69. package/dist/components/formComponents.js +10 -8
  70. package/dist/components/message/index.d.ts +0 -9
  71. package/dist/components/message/index.js +4 -31
  72. package/dist/connection.js +2 -2
  73. package/dist/constants.d.ts +0 -49
  74. package/dist/constants.js +1 -59
  75. package/dist/hooks/useAttribute/index.d.ts +1 -1
  76. package/dist/hooks/useAttribute/index.js +6 -6
  77. package/dist/hooks/useConfigurationLoader/index.js +5 -5
  78. package/dist/hooks/useNestedConfigurator/index.js +2 -2
  79. package/dist/hooks/useShare/index.js +3 -3
  80. package/dist/hooks/useSingleAnimation/index.js +20 -25
  81. package/dist/http/datatables.js +0 -1
  82. package/dist/http/index.js +5 -1
  83. package/dist/http/orders.d.ts +6 -8
  84. package/dist/icons/Spinner.js +5 -1
  85. package/dist/icons/index.d.ts +0 -41
  86. package/dist/icons/index.js +0 -42
  87. package/dist/index.d.ts +42 -3
  88. package/dist/index.js +84 -26
  89. package/dist/store/attributes.d.ts +0 -12
  90. package/dist/store/attributes.js +2 -15
  91. package/dist/store/index.d.ts +1 -1
  92. package/dist/store/price.d.ts +0 -12
  93. package/dist/store/price.js +2 -16
  94. package/dist/store/product.d.ts +6 -21
  95. package/dist/store/product.js +26 -38
  96. package/dist/store/translations.d.ts +1 -13
  97. package/dist/store/translations.js +2 -12
  98. package/dist/store/treble.d.ts +1 -16
  99. package/dist/store/treble.js +31 -66
  100. package/dist/store/wishlist.d.ts +0 -12
  101. package/dist/store/wishlist.js +4 -17
  102. package/dist/types.d.ts +118 -65
  103. package/dist/types.js +54 -0
  104. package/dist/utils.d.ts +10 -10
  105. package/dist/utils.js +8 -16
  106. package/package.json +16 -4
  107. package/dist/Treble/Snapshots.js +0 -251
  108. package/dist/Treble/Wishlist.js +0 -136
  109. package/dist/hooks/useImageEditor/index.d.ts +0 -14
  110. package/dist/hooks/useImageEditor/index.js +0 -320
@@ -51,15 +51,15 @@ var getDatatable = function (datatableId, config) { return __awaiter(void 0, voi
51
51
  if (!datatableId)
52
52
  message = 'Requires a datatable ID';
53
53
  if (message)
54
- return [2 /*return*/, Promise.resolve(undefined)];
54
+ return [2, Promise.resolve(undefined)];
55
55
  format = Object.assign({ format: constants_1.DATATABLE_FORMATS.json }, config).format;
56
- return [4 /*yield*/, http_1.default.datatables.getDatatable(datatableId)];
56
+ return [4, http_1.default.datatables.getDatatable(datatableId)];
57
57
  case 1:
58
58
  response = _a.sent();
59
59
  if (response.status !== 200)
60
- return [2 /*return*/, Promise.resolve(undefined)];
60
+ return [2, Promise.resolve(undefined)];
61
61
  if (format.toLowerCase() === constants_1.DATATABLE_FORMATS.csv)
62
- return [2 /*return*/, Promise.resolve(response.data)];
62
+ return [2, Promise.resolve(response.data)];
63
63
  csvData = response.data
64
64
  .replace(/"/g, '')
65
65
  .split('\n')
@@ -81,7 +81,7 @@ var getDatatable = function (datatableId, config) { return __awaiter(void 0, voi
81
81
  output.push(rowOutput);
82
82
  return output;
83
83
  }, []);
84
- return [2 /*return*/, Promise.resolve(datatableJson)];
84
+ return [2, Promise.resolve(datatableJson)];
85
85
  }
86
86
  });
87
87
  }); };
package/dist/api/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,14 +1,12 @@
1
- import { ICart, STATUSES, IOrderResponse } from '../http/orders';
2
- interface IEditOrder extends ICart {
3
- }
4
- interface ICreateOrder extends ICart {
5
- name: string;
1
+ import { ICartItem, STATUSES, IOrderResponse } from '../http/orders';
2
+ export interface ICreateOrder {
3
+ name?: string;
6
4
  metadata?: Record<string, string>;
7
5
  platform?: Record<string, string>;
8
6
  status?: STATUSES;
7
+ cart: Array<ICartItem>;
9
8
  }
10
9
  export declare const getOrder: (orderId: string) => Promise<IOrderResponse>;
11
10
  export declare const fetchOrders: (metadataQuery: Record<string, string>) => Promise<IOrderResponse[]>;
12
11
  export declare const createOrder: (order: ICreateOrder) => Promise<IOrderResponse>;
13
- export declare const editOrder: (orderId: string, data: IEditOrder) => Promise<IOrderResponse>;
14
- export {};
12
+ export declare const editOrder: (orderId: string, data: Array<ICartItem>) => Promise<IOrderResponse>;
@@ -44,15 +44,15 @@ var http_1 = __importDefault(require("../http"));
44
44
  var connection_1 = __importDefault(require("../connection"));
45
45
  var getOrder = function (orderId) { return __awaiter(void 0, void 0, void 0, function () {
46
46
  return __generator(this, function (_a) {
47
- return [2 /*return*/, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
47
+ return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
48
48
  var orders;
49
49
  return __generator(this, function (_a) {
50
50
  switch (_a.label) {
51
- case 0: return [4 /*yield*/, http_1.default.orders.getOrder(orderId)];
51
+ case 0: return [4, http_1.default.orders.getOrder(orderId)];
52
52
  case 1:
53
53
  orders = _a.sent();
54
54
  resolve(orders.data);
55
- return [2 /*return*/];
55
+ return [2];
56
56
  }
57
57
  });
58
58
  }); })];
@@ -61,11 +61,11 @@ var getOrder = function (orderId) { return __awaiter(void 0, void 0, void 0, fun
61
61
  exports.getOrder = getOrder;
62
62
  var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, void 0, function () {
63
63
  return __generator(this, function (_a) {
64
- return [2 /*return*/, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
64
+ return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var orders, output, _a, key_1, value_1;
66
66
  return __generator(this, function (_b) {
67
67
  switch (_b.label) {
68
- case 0: return [4 /*yield*/, http_1.default.orders.fetchOrders()];
68
+ case 0: return [4, http_1.default.orders.fetchOrders()];
69
69
  case 1:
70
70
  orders = _b.sent();
71
71
  output = orders.data.orders;
@@ -74,7 +74,7 @@ var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, vo
74
74
  output = orders.data.orders.filter(function (order) { var _a; return ((_a = order.metadata) === null || _a === void 0 ? void 0 : _a[key_1]) === value_1; });
75
75
  }
76
76
  resolve(output);
77
- return [2 /*return*/];
77
+ return [2];
78
78
  }
79
79
  });
80
80
  }); })];
@@ -83,7 +83,7 @@ var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, vo
83
83
  exports.fetchOrders = fetchOrders;
84
84
  var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, function () {
85
85
  return __generator(this, function (_a) {
86
- return [2 /*return*/, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
86
+ return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
87
87
  var orgId, name, cart, metadata, platform, status, data, createOrder;
88
88
  return __generator(this, function (_a) {
89
89
  switch (_a.label) {
@@ -98,11 +98,11 @@ var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, fu
98
98
  metadata: metadata || {},
99
99
  status: status || 'List',
100
100
  };
101
- return [4 /*yield*/, http_1.default.orders.createOrder(data)];
101
+ return [4, http_1.default.orders.createOrder(data)];
102
102
  case 1:
103
103
  createOrder = _a.sent();
104
104
  resolve(createOrder.data);
105
- return [2 /*return*/];
105
+ return [2];
106
106
  }
107
107
  });
108
108
  }); })];
@@ -111,7 +111,7 @@ var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, fu
111
111
  exports.createOrder = createOrder;
112
112
  var editOrder = function (orderId, data) { return __awaiter(void 0, void 0, void 0, function () {
113
113
  return __generator(this, function (_a) {
114
- return [2 /*return*/, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
114
+ return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
115
115
  var cart;
116
116
  return __generator(this, function (_a) {
117
117
  switch (_a.label) {
@@ -120,11 +120,11 @@ var editOrder = function (orderId, data) { return __awaiter(void 0, void 0, void
120
120
  throw new Error('Missing Order ID');
121
121
  if (!data)
122
122
  throw new Error('Missing New Cart data for Cart Order update.');
123
- return [4 /*yield*/, http_1.default.orders.editOrderCart(orderId, data)];
123
+ return [4, http_1.default.orders.editOrderCart(orderId, data)];
124
124
  case 1:
125
125
  cart = _a.sent();
126
126
  resolve(cart.data);
127
- return [2 /*return*/];
127
+ return [2];
128
128
  }
129
129
  });
130
130
  }); })];
package/dist/api/price.js CHANGED
@@ -45,10 +45,10 @@ var getPricebooksList = function () { return __awaiter(void 0, void 0, void 0, f
45
45
  var response;
46
46
  return __generator(this, function (_a) {
47
47
  switch (_a.label) {
48
- case 0: return [4 /*yield*/, http_1.default.pricebook.getList()];
48
+ case 0: return [4, http_1.default.pricebook.getList()];
49
49
  case 1:
50
50
  response = _a.sent();
51
- return [2 /*return*/, response.data.pricebooks];
51
+ return [2, response.data.pricebooks];
52
52
  }
53
53
  });
54
54
  }); };
@@ -46,7 +46,7 @@ var fetchTranslations = function () {
46
46
  var translations, csvData, languages, translationMap;
47
47
  return __generator(this, function (_a) {
48
48
  switch (_a.label) {
49
- case 0: return [4 /*yield*/, http_1.default.products.getTranslations()];
49
+ case 0: return [4, http_1.default.products.getTranslations()];
50
50
  case 1:
51
51
  translations = _a.sent();
52
52
  csvData = translations.data
@@ -68,7 +68,7 @@ var fetchTranslations = function () {
68
68
  return output;
69
69
  }, {});
70
70
  resolve(translationMap);
71
- return [2 /*return*/];
71
+ return [2];
72
72
  }
73
73
  });
74
74
  }); });
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -33,12 +37,7 @@ var AccordionItem = function (props) {
33
37
  react_1.default.createElement("div", null, label),
34
38
  react_1.default.createElement("div", null),
35
39
  react_1.default.createElement("div", null,
36
- react_1.default.createElement(CaretDown_1.default
37
- // style={{
38
- // transition: `all 0.3s`,
39
- // transform: selected ? 'rotate(180deg)' : 'rotate(0)',
40
- // }}
41
- , null))),
40
+ react_1.default.createElement(CaretDown_1.default, null))),
42
41
  react_1.default.createElement("div", null,
43
42
  react_1.default.createElement("div", null, children))));
44
43
  };
@@ -8,17 +8,8 @@ interface IAttributeTitle {
8
8
  export declare const AttributeTitle: {
9
9
  (props: IAttributeTitle): JSX.Element | null;
10
10
  propTypes: {
11
- /**
12
- * The attribute's title/label displayed to the user
13
- */
14
11
  attribute: PropTypes.Requireable<string>;
15
- /**
16
- * An override value to display instead of the attribute title.
17
- */
18
12
  title: PropTypes.Requireable<string>;
19
- /**
20
- * Custom classNames applied to the HTML Element to apply custom CSS styling.
21
- */
22
13
  className: PropTypes.Requireable<string>;
23
14
  };
24
15
  defaultProps: {
@@ -20,17 +20,8 @@ var AttributeTitle = function (props) {
20
20
  };
21
21
  exports.AttributeTitle = AttributeTitle;
22
22
  exports.AttributeTitle.propTypes = {
23
- /**
24
- * The attribute's title/label displayed to the user
25
- */
26
23
  attribute: prop_types_1.default.string,
27
- /**
28
- * An override value to display instead of the attribute title.
29
- */
30
24
  title: prop_types_1.default.string,
31
- /**
32
- * Custom classNames applied to the HTML Element to apply custom CSS styling.
33
- */
34
25
  className: prop_types_1.default.string,
35
26
  };
36
27
  exports.AttributeTitle.defaultProps = {
@@ -7,13 +7,7 @@ interface IAttributeValue {
7
7
  export declare const AttributeValue: {
8
8
  (props: IAttributeValue): JSX.Element | null;
9
9
  propTypes: {
10
- /**
11
- * The attribute's title/label displayed to the user
12
- */
13
10
  attribute: PropTypes.Requireable<string>;
14
- /**
15
- * Custom classNames applied to the HTML Element to apply custom CSS styling.
16
- */
17
11
  className: PropTypes.Requireable<string>;
18
12
  };
19
13
  defaultProps: {
@@ -8,7 +8,7 @@ var react_1 = __importDefault(require("react"));
8
8
  var prop_types_1 = __importDefault(require("prop-types"));
9
9
  var attributeValue_styles_1 = require("./attributeValue.styles");
10
10
  var useAttribute_1 = __importDefault(require("../../hooks/useAttribute"));
11
- var constants_1 = require("../../constants");
11
+ var types_1 = require("../../types");
12
12
  var utils_1 = require("../../utils");
13
13
  var AttributeValue = function (props) {
14
14
  var _a, _b;
@@ -17,7 +17,7 @@ var AttributeValue = function (props) {
17
17
  if (!attributeData)
18
18
  return null;
19
19
  var value;
20
- if (attributeData.type === constants_1.ATTRIBUTE_TYPES.asset) {
20
+ if (attributeData.type === types_1.ATTRIBUTE_TYPES.ASSET) {
21
21
  var assetAttribute_1 = attributeData;
22
22
  if (!((_a = assetAttribute_1.value) === null || _a === void 0 ? void 0 : _a.assetId))
23
23
  return null;
@@ -32,13 +32,7 @@ var AttributeValue = function (props) {
32
32
  };
33
33
  exports.AttributeValue = AttributeValue;
34
34
  exports.AttributeValue.propTypes = {
35
- /**
36
- * The attribute's title/label displayed to the user
37
- */
38
35
  attribute: prop_types_1.default.string,
39
- /**
40
- * Custom classNames applied to the HTML Element to apply custom CSS styling.
41
- */
42
36
  className: prop_types_1.default.string,
43
37
  };
44
38
  exports.AttributeValue.defaultProps = {
@@ -25,39 +25,12 @@ export declare const SHAPES: {
25
25
  export declare const Button: {
26
26
  (props: IButton): JSX.Element | null;
27
27
  propTypes: {
28
- /**
29
- * Used to add a title to the input
30
- */
31
28
  title: PropTypes.Requireable<string>;
32
- /**
33
- * Threekit Icon to use as the prefix to the button title
34
- */
35
29
  icon: PropTypes.Requireable<string>;
36
- /**
37
- * The presentational type of the input component. Options
38
- * include: `hollow`, `standard`, `accent`, `primary`
39
- */
40
30
  type: PropTypes.Requireable<string>;
41
- /**
42
- * Used to set the shape of the Button component. Options
43
- * include: `square`, `round`
44
- */
45
31
  shape: PropTypes.Requireable<string>;
46
- /**
47
- * NOTE: Input wide hide disabled will be deprecated in favour of option
48
- * specific control of both 'disabled' and 'visible'.
49
- *
50
- * Used to hide the options that have the 'disabled' equal to true.
51
- */
52
32
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
53
- /**
54
- * Allows the Button's width to be set to 100%.
55
- */
56
33
  fullWidth: PropTypes.Requireable<boolean>;
57
- /**
58
- *
59
- * Used to add a custom class name to each of the components html elements
60
- */
61
34
  className: PropTypes.Requireable<string>;
62
35
  };
63
36
  defaultProps: {
@@ -39,39 +39,12 @@ var Button = function (props) {
39
39
  };
40
40
  exports.Button = Button;
41
41
  exports.Button.propTypes = {
42
- /**
43
- * Used to add a title to the input
44
- */
45
42
  title: prop_types_1.default.string,
46
- /**
47
- * Threekit Icon to use as the prefix to the button title
48
- */
49
43
  icon: prop_types_1.default.string,
50
- /**
51
- * The presentational type of the input component. Options
52
- * include: `hollow`, `standard`, `accent`, `primary`
53
- */
54
44
  type: prop_types_1.default.string,
55
- /**
56
- * Used to set the shape of the Button component. Options
57
- * include: `square`, `round`
58
- */
59
45
  shape: prop_types_1.default.string,
60
- /**
61
- * NOTE: Input wide hide disabled will be deprecated in favour of option
62
- * specific control of both 'disabled' and 'visible'.
63
- *
64
- * Used to hide the options that have the 'disabled' equal to true.
65
- */
66
46
  onClick: prop_types_1.default.func,
67
- /**
68
- * Allows the Button's width to be set to 100%.
69
- */
70
47
  fullWidth: prop_types_1.default.bool,
71
- /**
72
- *
73
- * Used to add a custom class name to each of the components html elements
74
- */
75
48
  className: prop_types_1.default.string,
76
49
  };
77
50
  exports.Button.defaultProps = {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import PropTypes from 'prop-types';
3
+ import { ATTRIBUTE_TYPES } from '../../types';
3
4
  import { IFormComponentProps, IOption } from '../containers/formInputContainer';
4
5
  export interface ICards extends IFormComponentProps<IOption> {
5
6
  showThumbnail?: boolean;
@@ -9,33 +10,11 @@ export interface ICards extends IFormComponentProps<IOption> {
9
10
  export declare const Cards: {
10
11
  (props: ICards): JSX.Element;
11
12
  propTypes: {
12
- /**
13
- * Is the attribute name on the initialized asset that we are
14
- * using this component for. If the attribute prop is used,
15
- * the component will ignore the props for: `value`, `options`, `onClick`.
16
- */
17
13
  attribute: PropTypes.Requireable<string>;
18
- /**
19
- * Used to add a title to the input
20
- */
21
14
  title: PropTypes.Requireable<string>;
22
- /**
23
- * Used to provide a custom description for the input component
24
- */
25
15
  description: PropTypes.Requireable<string>;
26
- /**
27
- * Selected value from the option set. Should match the 'value' property
28
- * of one of the items in the options array.
29
- */
30
16
  value: PropTypes.Requireable<string>;
31
- /**
32
- * Handles the user seletion by passing the value of the selected
33
- * option as the argument into the onClick callback.
34
- */
35
17
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
36
- /**
37
- * The options set to be displayed for the user
38
- */
39
18
  options: PropTypes.Requireable<(PropTypes.InferProps<{
40
19
  name: PropTypes.Requireable<string>;
41
20
  description: PropTypes.Requireable<string>;
@@ -45,44 +24,12 @@ export declare const Cards: {
45
24
  color: PropTypes.Requireable<string>;
46
25
  disabled: PropTypes.Requireable<boolean>;
47
26
  }> | null | undefined)[]>;
48
- /**
49
- * Used to add a custom class name to each of the components html elements
50
- */
51
27
  className: PropTypes.Requireable<string>;
52
- /**
53
- * By default the thumbnail (image/color value) is soruced from the `_thumbnail`
54
- * metadata key in the option's Catalog Item. This metadata key can be overwritten
55
- * by passing in the prefered key value to the **thumbnailFromMetadata** prop.
56
- */
57
28
  metadataKeyThumbnail: PropTypes.Requireable<string>;
58
- /**
59
- * By default the description is soruced from the `_description` metadata
60
- * key in the option's Catalog Item. This metadata key can be overwritten
61
- * by passing in the prefered key value to the **metadataKeyDescription**
62
- * prop.
63
- */
64
29
  metadataKeyDescription: PropTypes.Requireable<string>;
65
- /**
66
- * By default the price of an item is soruced from the pricebook entry for
67
- * the option's Catalog Item. The price can alternatively be soruced from
68
- * the option's Catalog Item metadata, by specifying the key under which the
69
- * price can be found as the **metadataKeyPrice** prop.
70
- */
71
30
  metadataKeyPrice: PropTypes.Requireable<string>;
72
- /**
73
- * A boolean to set whether or all the Cards should display thumbnails
74
- * for the options.
75
- */
76
31
  showThumbnail: PropTypes.Requireable<boolean>;
77
- /**
78
- * A boolean to set whether or all the Cards should display the description
79
- * for the options.
80
- */
81
32
  showDescription: PropTypes.Requireable<boolean>;
82
- /**
83
- * A boolean to set whether or all the Cards should display the price
84
- * for the options/
85
- */
86
33
  showPrice: PropTypes.Requireable<boolean>;
87
34
  };
88
35
  defaultProps: {
@@ -101,7 +48,7 @@ export declare const Cards: {
101
48
  onClick: undefined;
102
49
  };
103
50
  componentName: string;
104
- compatibleAttributes: Set<string>;
51
+ compatibleAttributes: Set<ATTRIBUTE_TYPES>;
105
52
  };
106
53
  declare const _default: (props: ICards) => JSX.Element | null;
107
54
  export default _default;
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
11
11
  var shared_styles_1 = require("../shared.styles");
12
12
  var cards_styles_1 = require("./cards.styles");
13
13
  var utils_1 = require("../../utils");
14
- var constants_1 = require("../../constants");
14
+ var types_1 = require("../../types");
15
15
  var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
16
16
  var Thumbnail = function (props) {
17
17
  var imageUrl = props.imageUrl, color = props.color, name = props.name, className = props.className;
@@ -62,33 +62,11 @@ var Cards = function (props) {
62
62
  };
63
63
  exports.Cards = Cards;
64
64
  exports.Cards.propTypes = {
65
- /**
66
- * Is the attribute name on the initialized asset that we are
67
- * using this component for. If the attribute prop is used,
68
- * the component will ignore the props for: `value`, `options`, `onClick`.
69
- */
70
65
  attribute: prop_types_1.default.string,
71
- /**
72
- * Used to add a title to the input
73
- */
74
66
  title: prop_types_1.default.string,
75
- /**
76
- * Used to provide a custom description for the input component
77
- */
78
67
  description: prop_types_1.default.string,
79
- /**
80
- * Selected value from the option set. Should match the 'value' property
81
- * of one of the items in the options array.
82
- */
83
68
  value: prop_types_1.default.string,
84
- /**
85
- * Handles the user seletion by passing the value of the selected
86
- * option as the argument into the onClick callback.
87
- */
88
69
  onClick: prop_types_1.default.func,
89
- /**
90
- * The options set to be displayed for the user
91
- */
92
70
  options: prop_types_1.default.arrayOf(prop_types_1.default.shape({
93
71
  name: prop_types_1.default.string,
94
72
  description: prop_types_1.default.string,
@@ -98,59 +76,24 @@ exports.Cards.propTypes = {
98
76
  color: prop_types_1.default.string,
99
77
  disabled: prop_types_1.default.bool,
100
78
  })),
101
- /**
102
- * Used to add a custom class name to each of the components html elements
103
- */
104
79
  className: prop_types_1.default.string,
105
- /**
106
- * By default the thumbnail (image/color value) is soruced from the `_thumbnail`
107
- * metadata key in the option's Catalog Item. This metadata key can be overwritten
108
- * by passing in the prefered key value to the **thumbnailFromMetadata** prop.
109
- */
110
80
  metadataKeyThumbnail: prop_types_1.default.string,
111
- /**
112
- * By default the description is soruced from the `_description` metadata
113
- * key in the option's Catalog Item. This metadata key can be overwritten
114
- * by passing in the prefered key value to the **metadataKeyDescription**
115
- * prop.
116
- */
117
81
  metadataKeyDescription: prop_types_1.default.string,
118
- /**
119
- * By default the price of an item is soruced from the pricebook entry for
120
- * the option's Catalog Item. The price can alternatively be soruced from
121
- * the option's Catalog Item metadata, by specifying the key under which the
122
- * price can be found as the **metadataKeyPrice** prop.
123
- */
124
82
  metadataKeyPrice: prop_types_1.default.string,
125
- /**
126
- * A boolean to set whether or all the Cards should display thumbnails
127
- * for the options.
128
- */
129
83
  showThumbnail: prop_types_1.default.bool,
130
- /**
131
- * A boolean to set whether or all the Cards should display the description
132
- * for the options.
133
- */
134
84
  showDescription: prop_types_1.default.bool,
135
- /**
136
- * A boolean to set whether or all the Cards should display the price
137
- * for the options/
138
- */
139
85
  showPrice: prop_types_1.default.bool,
140
86
  };
141
87
  exports.Cards.defaultProps = {
142
88
  description: undefined,
143
89
  className: undefined,
144
- // Default use
145
90
  attribute: undefined,
146
- // Default user overrides
147
91
  metadataKeyThumbnail: undefined,
148
92
  metadataKeyDescription: undefined,
149
93
  metadataKeyPrice: undefined,
150
94
  showThumbnail: true,
151
95
  showPrice: true,
152
96
  showDescription: true,
153
- // Custom use
154
97
  title: undefined,
155
98
  value: undefined,
156
99
  options: undefined,
@@ -158,7 +101,7 @@ exports.Cards.defaultProps = {
158
101
  };
159
102
  exports.Cards.componentName = 'cards';
160
103
  exports.Cards.compatibleAttributes = new Set([
161
- constants_1.ATTRIBUTE_TYPES.asset,
162
- constants_1.ATTRIBUTE_TYPES.string,
104
+ types_1.ATTRIBUTE_TYPES.ASSET,
105
+ types_1.ATTRIBUTE_TYPES.STRING,
163
106
  ]);
164
107
  exports.default = (0, formInputContainer_1.default)(exports.Cards);
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
14
  if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
16
20
  }) : (function(o, m, k, k2) {
17
21
  if (k2 === undefined) k2 = k;
18
22
  o[k2] = m[k];
@@ -39,7 +43,7 @@ var prop_types_1 = __importDefault(require("prop-types"));
39
43
  var react_dom_1 = __importDefault(require("react-dom"));
40
44
  var drawer_styles_1 = require("./drawer.styles");
41
45
  var utils_1 = require("../../utils");
42
- var icons_1 = require("../../icons");
46
+ var Remove_1 = __importDefault(require("../../icons/Remove"));
43
47
  var TRANSITION_DURATION = 0.2;
44
48
  var Drawer = function (props) {
45
49
  var title = props.title, children = props.children, handleClose = props.handleClose, showHeader = props.showHeader, className = props.className;
@@ -63,27 +67,14 @@ var Drawer = function (props) {
63
67
  showHeader ? (react_1.default.createElement(drawer_styles_1.Header, { className: "".concat(cls, " drawer-header") },
64
68
  react_1.default.createElement("div", { className: "".concat(cls, " drawer-title") }, title),
65
69
  react_1.default.createElement("div", { onClick: handleClickClose },
66
- react_1.default.createElement(icons_1.RemoveIcon, null)))) : null,
70
+ react_1.default.createElement(Remove_1.default, null)))) : null,
67
71
  react_1.default.createElement(drawer_styles_1.Content, { className: "".concat(cls, " drawer-content") }, children))));
68
72
  };
69
73
  exports.Drawer = Drawer;
70
74
  exports.Drawer.propTypes = {
71
- /**
72
- * The title to be shown in the Drawer header
73
- */
74
75
  title: prop_types_1.default.string,
75
- /**
76
- * Callback function to close the Drawer. Can be used with custom UI
77
- * components in the Drawer
78
- */
79
76
  handleClose: prop_types_1.default.func,
80
- /**
81
- * Whether or not to render the default Drawer header
82
- */
83
77
  showHeader: prop_types_1.default.bool,
84
- /**
85
- * Used to add a custom class name to each of the components html elements
86
- */
87
78
  className: prop_types_1.default.string,
88
79
  };
89
80
  exports.Drawer.defaultProps = {