@companycam/slab-web 0.0.2-24 → 0.0.2-26
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 +13 -5
- package/package.json +11 -7
- package/shared/tokens/build/css/base.css +1 -1
- package/shared/tokens/build/css/dark_environment.css +1 -1
- package/shared/tokens/build/css/light_environment.css +1 -1
- package/shared/tokens/build/js/tokens.js +1 -1
- package/shared/tokens/build/scss/tokens.scss +1 -1
package/dist/bundle.js
CHANGED
|
@@ -398,8 +398,10 @@ const mapNameToMdiIconPath = name => {
|
|
|
398
398
|
switch (name) {
|
|
399
399
|
case "check":
|
|
400
400
|
return js.mdiCheck;
|
|
401
|
+
|
|
401
402
|
case "upgrade":
|
|
402
403
|
return js.mdiLightningBolt;
|
|
404
|
+
|
|
403
405
|
default:
|
|
404
406
|
return null;
|
|
405
407
|
}
|
|
@@ -414,6 +416,7 @@ const getFontSize = size => {
|
|
|
414
416
|
return tokens.size_text_l;
|
|
415
417
|
}
|
|
416
418
|
};
|
|
419
|
+
|
|
417
420
|
const UpgradeIconContainer = styled__default["default"].div`
|
|
418
421
|
${({
|
|
419
422
|
size
|
|
@@ -428,6 +431,7 @@ const UpgradeIconContainer = styled__default["default"].div`
|
|
|
428
431
|
align-items: center;
|
|
429
432
|
justify-content: center;
|
|
430
433
|
`;
|
|
434
|
+
|
|
431
435
|
const Icon = props => {
|
|
432
436
|
const {
|
|
433
437
|
name,
|
|
@@ -437,14 +441,14 @@ const Icon = props => {
|
|
|
437
441
|
className
|
|
438
442
|
} = props;
|
|
439
443
|
const iconColor = color || "var(--cc_color_text_default)";
|
|
444
|
+
|
|
440
445
|
if (!MDI_NAMES.includes(name)) {
|
|
441
446
|
throw new Error(`'${name}' is not a valid Slab icon name [@companycam/slab] `);
|
|
442
|
-
}
|
|
447
|
+
} // Return Vector Icon
|
|
448
|
+
|
|
443
449
|
|
|
444
|
-
//
|
|
445
|
-
const mdiIconPath = mapNameToMdiIconPath(name);
|
|
450
|
+
const mdiIconPath = mapNameToMdiIconPath(name); // unique case: Upgrade Icon
|
|
446
451
|
|
|
447
|
-
// unique case: Upgrade Icon
|
|
448
452
|
if (name === "upgrade") {
|
|
449
453
|
const iconSize = getFontSize(size) * 0.8;
|
|
450
454
|
return /*#__PURE__*/React__default["default"].createElement(UpgradeIconContainer, {
|
|
@@ -457,18 +461,22 @@ const Icon = props => {
|
|
|
457
461
|
color: tokens.color_text_default_le
|
|
458
462
|
}));
|
|
459
463
|
}
|
|
464
|
+
|
|
460
465
|
return /*#__PURE__*/React__default["default"].createElement(MdiIcon__default["default"], {
|
|
461
466
|
path: mdiIconPath,
|
|
462
467
|
size: `${getFontSize(size)}px`,
|
|
463
468
|
color: iconColor
|
|
464
469
|
});
|
|
465
470
|
};
|
|
471
|
+
|
|
466
472
|
Icon.displayName = "Icon";
|
|
467
473
|
Icon.propTypes = {
|
|
468
474
|
name: PropTypes__default["default"].string.isRequired,
|
|
469
475
|
color: PropTypes__default["default"].string,
|
|
470
476
|
size: PropTypes__default["default"].oneOfType([PropTypes__default["default"].oneOf(["tiny", "small", "medium", "large"]), PropTypes__default["default"].number]),
|
|
471
|
-
style: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object
|
|
477
|
+
style: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object
|
|
478
|
+
/* allow Icon to be extended as styled-component */
|
|
479
|
+
, PropTypes__default["default"].array]),
|
|
472
480
|
className: PropTypes__default["default"].string
|
|
473
481
|
};
|
|
474
482
|
Icon.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companycam/slab-web",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-26",
|
|
4
4
|
"description": "Design System for use across CompanyCam web applications",
|
|
5
5
|
"main": "web/index.js",
|
|
6
6
|
"module": "dist/bundle.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"release": "yarn
|
|
9
|
-
"bump-version": "yarn version --
|
|
10
|
-
"publish-latest": "
|
|
11
|
-
"
|
|
8
|
+
"release": "yarn clean && yarn copy-source && yarn build && yarn bump-version && yarn publish-latest",
|
|
9
|
+
"bump-version": "yarn version --prepatch --no-git-tag-version",
|
|
10
|
+
"publish-latest": "yarn publish . --tag latest",
|
|
11
|
+
"copy-source": "cp -r ../src/shared ./ && cp -r ../src/web ./",
|
|
12
|
+
"build": "yarn build:tokens && rollup --config ./rollup.config.js",
|
|
13
|
+
"build:tokens": "style-dictionary build --config ./shared/tokens/config.js",
|
|
14
|
+
"clean": "rimraf ./dist/* && rimraf ./web/* && rimraf ./shared/*"
|
|
12
15
|
},
|
|
13
16
|
"repository": {
|
|
14
17
|
"type": "git",
|
|
@@ -47,11 +50,12 @@
|
|
|
47
50
|
"@rollup/plugin-json": "^4.1.0",
|
|
48
51
|
"@rollup/plugin-node-resolve": "^13.2.1",
|
|
49
52
|
"react-dom": "17.0.2",
|
|
53
|
+
"rimraf": "^3.0.2",
|
|
50
54
|
"rollup": "^2.70.2",
|
|
51
55
|
"style-dictionary": "3.0.3"
|
|
52
56
|
},
|
|
53
57
|
"peerDependencies": {
|
|
54
|
-
"
|
|
55
|
-
"
|
|
58
|
+
"prop-types": ">= 15",
|
|
59
|
+
"react": ">= 16"
|
|
56
60
|
}
|
|
57
61
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// Do not edit directly
|
|
3
|
-
// Generated on
|
|
3
|
+
// Generated on Sat, 12 Nov 2022 18:32:07 GMT
|
|
4
4
|
|
|
5
5
|
$cc_color_brand_primary: #0967d2; // Our beloved CoCam deep blue. Use only for branding purposes.
|
|
6
6
|
$cc_color_brand_secondary: #142334; // Complements our primary blue. Use only for branding purposes.
|