@companycam/slab-web 0.0.2-23 → 0.0.2-25

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 CHANGED
@@ -6,7 +6,8 @@ var React = require('react');
6
6
  var PropTypes = require('prop-types');
7
7
  var styled = require('styled-components');
8
8
  var MdiIcon = require('@mdi/react');
9
- var require$$0 = require('react-is');
9
+ require('deepmerge');
10
+ require('hoist-non-react-statics');
10
11
  var js = require('@mdi/js');
11
12
 
12
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -15,7 +16,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
16
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
16
17
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
17
18
  var MdiIcon__default = /*#__PURE__*/_interopDefaultLegacy(MdiIcon);
18
- var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
19
19
 
20
20
  var color_brand_primary = "#0967d2";
21
21
  var color_brand_secondary = "#142334";
@@ -342,26 +342,6 @@ var tokens = {
342
342
  }
343
343
  });
344
344
 
345
- var reactIs = require$$0__default["default"];
346
- var FORWARD_REF_STATICS = {
347
- '$$typeof': true,
348
- render: true,
349
- defaultProps: true,
350
- displayName: true,
351
- propTypes: true
352
- };
353
- var MEMO_STATICS = {
354
- '$$typeof': true,
355
- compare: true,
356
- defaultProps: true,
357
- displayName: true,
358
- propTypes: true,
359
- type: true
360
- };
361
- var TYPE_STATICS = {};
362
- TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
363
- TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
364
-
365
345
  ({
366
346
  name: "dark_environment",
367
347
  dark: true,
@@ -418,8 +398,10 @@ const mapNameToMdiIconPath = name => {
418
398
  switch (name) {
419
399
  case "check":
420
400
  return js.mdiCheck;
401
+
421
402
  case "upgrade":
422
403
  return js.mdiLightningBolt;
404
+
423
405
  default:
424
406
  return null;
425
407
  }
@@ -434,6 +416,7 @@ const getFontSize = size => {
434
416
  return tokens.size_text_l;
435
417
  }
436
418
  };
419
+
437
420
  const UpgradeIconContainer = styled__default["default"].div`
438
421
  ${({
439
422
  size
@@ -448,6 +431,7 @@ const UpgradeIconContainer = styled__default["default"].div`
448
431
  align-items: center;
449
432
  justify-content: center;
450
433
  `;
434
+
451
435
  const Icon = props => {
452
436
  const {
453
437
  name,
@@ -457,14 +441,14 @@ const Icon = props => {
457
441
  className
458
442
  } = props;
459
443
  const iconColor = color || "var(--cc_color_text_default)";
444
+
460
445
  if (!MDI_NAMES.includes(name)) {
461
446
  throw new Error(`'${name}' is not a valid Slab icon name [@companycam/slab] `);
462
- }
447
+ } // Return Vector Icon
463
448
 
464
- // Return Vector Icon
465
- const mdiIconPath = mapNameToMdiIconPath(name);
466
449
 
467
- // unique case: Upgrade Icon
450
+ const mdiIconPath = mapNameToMdiIconPath(name); // unique case: Upgrade Icon
451
+
468
452
  if (name === "upgrade") {
469
453
  const iconSize = getFontSize(size) * 0.8;
470
454
  return /*#__PURE__*/React__default["default"].createElement(UpgradeIconContainer, {
@@ -477,18 +461,22 @@ const Icon = props => {
477
461
  color: tokens.color_text_default_le
478
462
  }));
479
463
  }
464
+
480
465
  return /*#__PURE__*/React__default["default"].createElement(MdiIcon__default["default"], {
481
466
  path: mdiIconPath,
482
467
  size: `${getFontSize(size)}px`,
483
468
  color: iconColor
484
469
  });
485
470
  };
471
+
486
472
  Icon.displayName = "Icon";
487
473
  Icon.propTypes = {
488
474
  name: PropTypes__default["default"].string.isRequired,
489
475
  color: PropTypes__default["default"].string,
490
476
  size: PropTypes__default["default"].oneOfType([PropTypes__default["default"].oneOf(["tiny", "small", "medium", "large"]), PropTypes__default["default"].number]),
491
- style: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object /* allow Icon to be extended as styled-component */, PropTypes__default["default"].array]),
477
+ style: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object
478
+ /* allow Icon to be extended as styled-component */
479
+ , PropTypes__default["default"].array]),
492
480
  className: PropTypes__default["default"].string
493
481
  };
494
482
  Icon.defaultProps = {
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "@companycam/slab-web",
3
- "version": "0.0.2-23",
4
- "description": "Design System for usage across CompanyCam applications",
3
+ "version": "0.0.2-25",
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 clean && yarn copy-source && yarn build && yarn bump-version && publish-latest",
9
+ "bump-version": "yarn version --patch --no-git-tag-version && git push --tags",
10
+ "publish-latest": "yarn publish . --tag latest && git push",
11
+ "copy-source": "cp -r ../src/shared ./ && cp -r ../src/web ./",
12
+ "build": "yarn build:tokens && rollup --config ./rollup.config.js",
8
13
  "build:tokens": "style-dictionary build --config ./shared/tokens/config.js",
9
- "release": "yarn bump-version && yarn build:web && yarn publish-latest",
10
- "bump-version": "yarn version --patch",
11
- "publish-latest": "git push --tags && yarn publish . --tag latest && git push",
12
- "build:web": "rollup --config ./rollup.config.js"
14
+ "clean": "rimraf ./dist/* && rimraf ./web/* && rimraf ./shared/*"
15
+
13
16
  },
14
17
  "repository": {
15
18
  "type": "git",
@@ -48,11 +51,12 @@
48
51
  "@rollup/plugin-json": "^4.1.0",
49
52
  "@rollup/plugin-node-resolve": "^13.2.1",
50
53
  "react-dom": "17.0.2",
54
+ "rimraf": "^3.0.2",
51
55
  "rollup": "^2.70.2",
52
56
  "style-dictionary": "3.0.3"
53
57
  },
54
58
  "peerDependencies": {
55
- "react": ">= 16",
56
- "prop-types": ">= 15"
59
+ "prop-types": ">= 15",
60
+ "react": ">= 16"
57
61
  }
58
62
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 09 Nov 2022 15:37:56 GMT
3
+ * Generated on Fri, 11 Nov 2022 21:01:49 GMT
4
4
  */
5
5
 
6
6
  :root, .light-environment {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 09 Nov 2022 15:37:56 GMT
3
+ * Generated on Fri, 11 Nov 2022 21:01:49 GMT
4
4
  */
5
5
 
6
6
  .dark-environment {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 09 Nov 2022 15:37:56 GMT
3
+ * Generated on Fri, 11 Nov 2022 21:01:49 GMT
4
4
  */
5
5
 
6
6
  :root, .light-environment {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 09 Nov 2022 15:37:56 GMT
3
+ * Generated on Fri, 11 Nov 2022 21:01:49 GMT
4
4
  */
5
5
 
6
6
  export const color_brand_primary = "#0967d2"; // Our beloved CoCam deep blue. Use only for branding purposes.
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Wed, 09 Nov 2022 15:37:56 GMT
3
+ // Generated on Fri, 11 Nov 2022 21:01:49 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.