@pareto-engineering/design-system 2.0.0-alpha.25 → 2.0.0-alpha.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.
@@ -19,6 +19,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
 
20
20
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
21
 
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
23
+
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
+
26
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
+
22
28
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
29
 
24
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -53,10 +59,10 @@ var SVG = _ref => {
53
59
  (0, React.useLayoutEffect)(() => {
54
60
  Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
55
61
  });
56
- var useSVGProps = (0, React.useMemo)(() => ({
62
+ var useSVGProps = (0, React.useMemo)(() => _objectSpread(_objectSpread({
57
63
  className: useClassName,
58
- source,
59
- target,
64
+ source
65
+ }, target), {}, {
60
66
  sprite,
61
67
  strokeWidth
62
68
  }), [useClassName, source, target, strokeWidth, sprite]);
@@ -22,29 +22,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
22
22
  // Local Definitions
23
23
  var baseClassName = _bem.default.base;
24
24
  var componentClassName = 'logo';
25
- var defaultTargets = [{
26
- id: 'logo__p',
27
- target: 'logo__p'
28
- }, {
29
- id: 'logo__areto',
30
- target: 'logo__areto'
31
- }, {
32
- id: 'logo__t',
33
- target: 'logo__t'
34
- }];
25
+ var defaultTarget = {
26
+ id: 'logo',
27
+ target: 'logo'
28
+ };
35
29
  var contentMap = {
36
30
  default: {
37
- sprite: '/logo_parts.svg',
38
- viewBox: '0 0 688 250',
39
- targets: defaultTargets
40
- },
41
- beta: {
42
- sprite: '/logo_parts_beta.svg',
43
- viewBox: '0 0 1000 300',
44
- targets: [...defaultTargets, {
45
- id: 'logo__beta',
46
- target: 'logo__beta'
47
- }]
31
+ sprite: '/logo.svg',
32
+ viewBox: '0 0 39 39',
33
+ target: defaultTarget
48
34
  }
49
35
  };
50
36
  /**
@@ -57,8 +43,6 @@ var Logo = _ref => {
57
43
  className: userClassName,
58
44
  style,
59
45
  color,
60
- animated,
61
- loop,
62
46
  height,
63
47
  width,
64
48
  variant // ...otherProps
@@ -72,12 +56,11 @@ var Logo = _ref => {
72
56
  height: height,
73
57
  width: width,
74
58
  viewBox: svgConfig.viewBox,
75
- targets: svgConfig.targets,
59
+ target: svgConfig.target,
76
60
  sprite: svgConfig.sprite,
77
61
  id: id,
78
- className: [baseClassName, componentClassName, "x-".concat(color), userClassName, loop && 'loop'].filter(e => e).join(' '),
79
- style: style,
80
- animated: animated // {...otherProps}
62
+ className: [baseClassName, componentClassName, "x-".concat(color), userClassName].filter(e => e).join(' '),
63
+ style: style // {...otherProps}
81
64
 
82
65
  });
83
66
  };
@@ -103,16 +86,6 @@ Logo.propTypes = {
103
86
  */
104
87
  color: _propTypes.default.string,
105
88
 
106
- /**
107
- * Whether the logo is animated
108
- */
109
- animated: _propTypes.default.bool,
110
-
111
- /**
112
- * Whether the animation loops
113
- */
114
- loop: _propTypes.default.bool,
115
-
116
89
  /**
117
90
  * The height of the element
118
91
  */
@@ -129,9 +102,7 @@ Logo.propTypes = {
129
102
  variant: _propTypes.default.string
130
103
  };
131
104
  Logo.defaultProps = {
132
- color: 'primary',
133
- animated: false,
134
- loop: false,
105
+ color: 'paragraph',
135
106
  height: '4em',
136
107
  variant: 'default'
137
108
  };
@@ -1,147 +1,9 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
 
3
- /* stylelint-disable selector-id-pattern, selector-max-id -- because of the custom svg */
4
-
5
3
  @use "@pareto-engineering/bem";
6
4
 
7
- // Main animation - finishes after the drawing
8
-
9
- @keyframes draw-logo-p {
10
- 0% {
11
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
12
- }
13
-
14
- 20%,
15
- 100% {
16
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
17
- }
18
- }
19
- @keyframes draw-logo-areto {
20
- 0%,
21
- 20% {
22
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
23
- }
24
-
25
- 90%,
26
- 100% {
27
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
28
- }
29
- }
30
- @keyframes draw-logo-t {
31
- 0%,
32
- 90% {
33
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
34
- }
35
-
36
- 100% {
37
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
38
- }
39
- }
40
-
41
- // Alt animation - looping
42
-
43
- @keyframes draw-alt-logo-p {
44
- 0% {
45
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
46
- }
47
-
48
- 10%,
49
- 50% {
50
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
51
- }
52
-
53
- 60%,
54
- 100% {
55
- stroke-dashoffset: var(--svg-final-stroke-dashoffset, 1000);
56
- }
57
- }
58
- @keyframes draw-alt-logo-areto {
59
- 0%,
60
- 10% {
61
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
62
- }
63
-
64
- 45%,
65
- 60% {
66
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
67
- }
68
-
69
- 95%,
70
- 100% {
71
- stroke-dashoffset: var(--svg-final-stroke-dashoffset, 1000);
72
- }
73
- }
74
- @keyframes draw-alt-logo-t {
75
- 0%,
76
- 45% {
77
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
78
- }
79
-
80
- 50%,
81
- 95% {
82
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
83
- }
84
-
85
- 100% {
86
- stroke-dashoffset: var(--svg-final-stroke-dashoffset, 1000);
87
- }
88
- }
89
-
90
5
  .#{bem.$base}.logo {
91
- &.animated.animated {
92
- --svg-animation-repeats: 1;
93
- --svg-animation-time: 3.5s;
94
-
95
- &:hover,
96
- &:focus {
97
- //--path-animation: dash-a 1s linear 0s 1 forwards;
98
- }
99
-
100
- use#logo__p {
101
- //--svg-animation-delay: 0;
102
- --svg-dasharray: 1000;
103
- --svg-origin-stroke-dashoffset: -1000;
104
- //--svg-target-stroke-dashoffset: 0;
105
- --svg-final-stroke-dashoffset: 1000;
106
- animation-name: draw-logo-p;
107
- }
108
-
109
- use#logo__areto {
110
- --svg-dasharray: 2000;
111
- --svg-origin-stroke-dashoffset: 2000;
112
- //--svg-target-stroke-dashoffset: 0;
113
- --svg-final-stroke-dashoffset: -2000;
114
- animation-name: draw-logo-areto;
115
- }
116
-
117
- use#logo__t {
118
- --svg-dasharray: 200;
119
- --svg-origin-stroke-dashoffset: 200;
120
- //--svg-target-stroke-dashoffset: 0;
121
- --svg-final-stroke-dashoffset: -200;
122
- animation-name: draw-logo-t;
123
- }
124
-
125
- &.loop.loop {
126
- --svg-animation-time: 6s;
127
- --svg-animation-repeats: infinite;
128
-
129
- use#logo__p {
130
- --svg-final-stroke-dashoffset: 1000;
131
- animation-name: draw-alt-logo-p;
132
- }
133
-
134
- use#logo__areto {
135
- --svg-final-stroke-dashoffset: -2000;
136
- animation-name: draw-alt-logo-areto;
137
- }
138
6
 
139
- use#logo__t {
140
- --svg-final-stroke-dashoffset: -200;
141
- animation-name: draw-alt-logo-t;
142
- }
143
- }
144
- }
145
7
  }
146
8
 
147
9
 
@@ -33,7 +33,7 @@ const SVG = ({
33
33
  const useSVGProps = useMemo(() => ({
34
34
  className: useClassName,
35
35
  source,
36
- target,
36
+ ...target,
37
37
  sprite,
38
38
  strokeWidth
39
39
  }), [useClassName, source, target, strokeWidth, sprite]);
@@ -7,29 +7,15 @@ import { SVG } from "../../a"; // Local Definitions
7
7
 
8
8
  const baseClassName = styleNames.base;
9
9
  const componentClassName = 'logo';
10
- const defaultTargets = [{
11
- id: 'logo__p',
12
- target: 'logo__p'
13
- }, {
14
- id: 'logo__areto',
15
- target: 'logo__areto'
16
- }, {
17
- id: 'logo__t',
18
- target: 'logo__t'
19
- }];
10
+ const defaultTarget = {
11
+ id: 'logo',
12
+ target: 'logo'
13
+ };
20
14
  const contentMap = {
21
15
  default: {
22
- sprite: '/logo_parts.svg',
23
- viewBox: '0 0 688 250',
24
- targets: defaultTargets
25
- },
26
- beta: {
27
- sprite: '/logo_parts_beta.svg',
28
- viewBox: '0 0 1000 300',
29
- targets: [...defaultTargets, {
30
- id: 'logo__beta',
31
- target: 'logo__beta'
32
- }]
16
+ sprite: '/logo.svg',
17
+ viewBox: '0 0 39 39',
18
+ target: defaultTarget
33
19
  }
34
20
  };
35
21
  /**
@@ -41,8 +27,6 @@ const Logo = ({
41
27
  className: userClassName,
42
28
  style,
43
29
  color,
44
- animated,
45
- loop,
46
30
  height,
47
31
  width,
48
32
  variant // ...otherProps
@@ -56,12 +40,11 @@ const Logo = ({
56
40
  height: height,
57
41
  width: width,
58
42
  viewBox: svgConfig.viewBox,
59
- targets: svgConfig.targets,
43
+ target: svgConfig.target,
60
44
  sprite: svgConfig.sprite,
61
45
  id: id,
62
- className: [baseClassName, componentClassName, `x-${color}`, userClassName, loop && 'loop'].filter(e => e).join(' '),
63
- style: style,
64
- animated: animated // {...otherProps}
46
+ className: [baseClassName, componentClassName, `x-${color}`, userClassName].filter(e => e).join(' '),
47
+ style: style // {...otherProps}
65
48
 
66
49
  });
67
50
  };
@@ -87,16 +70,6 @@ Logo.propTypes = {
87
70
  */
88
71
  color: PropTypes.string,
89
72
 
90
- /**
91
- * Whether the logo is animated
92
- */
93
- animated: PropTypes.bool,
94
-
95
- /**
96
- * Whether the animation loops
97
- */
98
- loop: PropTypes.bool,
99
-
100
73
  /**
101
74
  * The height of the element
102
75
  */
@@ -113,9 +86,7 @@ Logo.propTypes = {
113
86
  variant: PropTypes.string
114
87
  };
115
88
  Logo.defaultProps = {
116
- color: 'primary',
117
- animated: false,
118
- loop: false,
89
+ color: 'paragraph',
119
90
  height: '4em',
120
91
  variant: 'default'
121
92
  };
@@ -1,147 +1,9 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
 
3
- /* stylelint-disable selector-id-pattern, selector-max-id -- because of the custom svg */
4
-
5
3
  @use "@pareto-engineering/bem";
6
4
 
7
- // Main animation - finishes after the drawing
8
-
9
- @keyframes draw-logo-p {
10
- 0% {
11
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
12
- }
13
-
14
- 20%,
15
- 100% {
16
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
17
- }
18
- }
19
- @keyframes draw-logo-areto {
20
- 0%,
21
- 20% {
22
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
23
- }
24
-
25
- 90%,
26
- 100% {
27
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
28
- }
29
- }
30
- @keyframes draw-logo-t {
31
- 0%,
32
- 90% {
33
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
34
- }
35
-
36
- 100% {
37
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
38
- }
39
- }
40
-
41
- // Alt animation - looping
42
-
43
- @keyframes draw-alt-logo-p {
44
- 0% {
45
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
46
- }
47
-
48
- 10%,
49
- 50% {
50
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
51
- }
52
-
53
- 60%,
54
- 100% {
55
- stroke-dashoffset: var(--svg-final-stroke-dashoffset, 1000);
56
- }
57
- }
58
- @keyframes draw-alt-logo-areto {
59
- 0%,
60
- 10% {
61
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
62
- }
63
-
64
- 45%,
65
- 60% {
66
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
67
- }
68
-
69
- 95%,
70
- 100% {
71
- stroke-dashoffset: var(--svg-final-stroke-dashoffset, 1000);
72
- }
73
- }
74
- @keyframes draw-alt-logo-t {
75
- 0%,
76
- 45% {
77
- stroke-dashoffset: var(--svg-origin-stroke-dashoffset, 1000);
78
- }
79
-
80
- 50%,
81
- 95% {
82
- stroke-dashoffset: var(--svg-target-stroke-dashoffset, 0);
83
- }
84
-
85
- 100% {
86
- stroke-dashoffset: var(--svg-final-stroke-dashoffset, 1000);
87
- }
88
- }
89
-
90
5
  .#{bem.$base}.logo {
91
- &.animated.animated {
92
- --svg-animation-repeats: 1;
93
- --svg-animation-time: 3.5s;
94
-
95
- &:hover,
96
- &:focus {
97
- //--path-animation: dash-a 1s linear 0s 1 forwards;
98
- }
99
-
100
- use#logo__p {
101
- //--svg-animation-delay: 0;
102
- --svg-dasharray: 1000;
103
- --svg-origin-stroke-dashoffset: -1000;
104
- //--svg-target-stroke-dashoffset: 0;
105
- --svg-final-stroke-dashoffset: 1000;
106
- animation-name: draw-logo-p;
107
- }
108
-
109
- use#logo__areto {
110
- --svg-dasharray: 2000;
111
- --svg-origin-stroke-dashoffset: 2000;
112
- //--svg-target-stroke-dashoffset: 0;
113
- --svg-final-stroke-dashoffset: -2000;
114
- animation-name: draw-logo-areto;
115
- }
116
-
117
- use#logo__t {
118
- --svg-dasharray: 200;
119
- --svg-origin-stroke-dashoffset: 200;
120
- //--svg-target-stroke-dashoffset: 0;
121
- --svg-final-stroke-dashoffset: -200;
122
- animation-name: draw-logo-t;
123
- }
124
-
125
- &.loop.loop {
126
- --svg-animation-time: 6s;
127
- --svg-animation-repeats: infinite;
128
-
129
- use#logo__p {
130
- --svg-final-stroke-dashoffset: 1000;
131
- animation-name: draw-alt-logo-p;
132
- }
133
-
134
- use#logo__areto {
135
- --svg-final-stroke-dashoffset: -2000;
136
- animation-name: draw-alt-logo-areto;
137
- }
138
6
 
139
- use#logo__t {
140
- --svg-final-stroke-dashoffset: -200;
141
- animation-name: draw-alt-logo-t;
142
- }
143
- }
144
- }
145
7
  }
146
8
 
147
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.25",
3
+ "version": "2.0.0-alpha.26",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -79,7 +79,7 @@
79
79
  "stylelint-config-palantir": "^5.1.0"
80
80
  },
81
81
  "dependencies": {
82
- "@pareto-engineering/assets": "^2.0.0-alpha.10",
82
+ "@pareto-engineering/assets": "^2.0.0-alpha.11",
83
83
  "@pareto-engineering/bem": "^0.1.5",
84
84
  "@pareto-engineering/styles": "^2.0.0-alpha.8",
85
85
  "date-fns": "^2.22.1",