@companycam/slab-web 0.0.2-21 → 0.0.2-23
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/bundle.js +5 -13
- package/package.json +6 -3
package/dist/bundle.js
CHANGED
|
@@ -418,10 +418,8 @@ const mapNameToMdiIconPath = name => {
|
|
|
418
418
|
switch (name) {
|
|
419
419
|
case "check":
|
|
420
420
|
return js.mdiCheck;
|
|
421
|
-
|
|
422
421
|
case "upgrade":
|
|
423
422
|
return js.mdiLightningBolt;
|
|
424
|
-
|
|
425
423
|
default:
|
|
426
424
|
return null;
|
|
427
425
|
}
|
|
@@ -436,7 +434,6 @@ const getFontSize = size => {
|
|
|
436
434
|
return tokens.size_text_l;
|
|
437
435
|
}
|
|
438
436
|
};
|
|
439
|
-
|
|
440
437
|
const UpgradeIconContainer = styled__default["default"].div`
|
|
441
438
|
${({
|
|
442
439
|
size
|
|
@@ -451,7 +448,6 @@ const UpgradeIconContainer = styled__default["default"].div`
|
|
|
451
448
|
align-items: center;
|
|
452
449
|
justify-content: center;
|
|
453
450
|
`;
|
|
454
|
-
|
|
455
451
|
const Icon = props => {
|
|
456
452
|
const {
|
|
457
453
|
name,
|
|
@@ -461,14 +457,14 @@ const Icon = props => {
|
|
|
461
457
|
className
|
|
462
458
|
} = props;
|
|
463
459
|
const iconColor = color || "var(--cc_color_text_default)";
|
|
464
|
-
|
|
465
460
|
if (!MDI_NAMES.includes(name)) {
|
|
466
461
|
throw new Error(`'${name}' is not a valid Slab icon name [@companycam/slab] `);
|
|
467
|
-
}
|
|
468
|
-
|
|
462
|
+
}
|
|
469
463
|
|
|
470
|
-
|
|
464
|
+
// Return Vector Icon
|
|
465
|
+
const mdiIconPath = mapNameToMdiIconPath(name);
|
|
471
466
|
|
|
467
|
+
// unique case: Upgrade Icon
|
|
472
468
|
if (name === "upgrade") {
|
|
473
469
|
const iconSize = getFontSize(size) * 0.8;
|
|
474
470
|
return /*#__PURE__*/React__default["default"].createElement(UpgradeIconContainer, {
|
|
@@ -481,22 +477,18 @@ const Icon = props => {
|
|
|
481
477
|
color: tokens.color_text_default_le
|
|
482
478
|
}));
|
|
483
479
|
}
|
|
484
|
-
|
|
485
480
|
return /*#__PURE__*/React__default["default"].createElement(MdiIcon__default["default"], {
|
|
486
481
|
path: mdiIconPath,
|
|
487
482
|
size: `${getFontSize(size)}px`,
|
|
488
483
|
color: iconColor
|
|
489
484
|
});
|
|
490
485
|
};
|
|
491
|
-
|
|
492
486
|
Icon.displayName = "Icon";
|
|
493
487
|
Icon.propTypes = {
|
|
494
488
|
name: PropTypes__default["default"].string.isRequired,
|
|
495
489
|
color: PropTypes__default["default"].string,
|
|
496
490
|
size: PropTypes__default["default"].oneOfType([PropTypes__default["default"].oneOf(["tiny", "small", "medium", "large"]), PropTypes__default["default"].number]),
|
|
497
|
-
style: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object
|
|
498
|
-
/* allow Icon to be extended as styled-component */
|
|
499
|
-
, PropTypes__default["default"].array]),
|
|
491
|
+
style: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object /* allow Icon to be extended as styled-component */, PropTypes__default["default"].array]),
|
|
500
492
|
className: PropTypes__default["default"].string
|
|
501
493
|
};
|
|
502
494
|
Icon.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companycam/slab-web",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-23",
|
|
4
4
|
"description": "Design System for usage across CompanyCam applications",
|
|
5
5
|
"main": "web/index.js",
|
|
6
6
|
"module": "dist/bundle.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"deepmerge": "4.2.2",
|
|
29
29
|
"hoist-non-react-statics": "^3.3.2",
|
|
30
30
|
"polished": "^4.1.3",
|
|
31
|
+
"react-is": "^16.8.0",
|
|
31
32
|
"styled-components": "^5.1.1"
|
|
32
33
|
},
|
|
33
34
|
"files": [
|
|
@@ -46,10 +47,12 @@
|
|
|
46
47
|
"@rollup/plugin-commonjs": "^21.1.0",
|
|
47
48
|
"@rollup/plugin-json": "^4.1.0",
|
|
48
49
|
"@rollup/plugin-node-resolve": "^13.2.1",
|
|
49
|
-
"react": "17.0.2",
|
|
50
|
-
"react-art": "17.0.2",
|
|
51
50
|
"react-dom": "17.0.2",
|
|
52
51
|
"rollup": "^2.70.2",
|
|
53
52
|
"style-dictionary": "3.0.3"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": ">= 16",
|
|
56
|
+
"prop-types": ">= 15"
|
|
54
57
|
}
|
|
55
58
|
}
|