@croquiscom/pds 0.30.3 → 0.31.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croquiscom/pds",
3
- "version": "0.30.3",
3
+ "version": "0.31.1",
4
4
  "description": "Design system for Zigzag's Partner Center",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.es.js",
@@ -2,6 +2,8 @@ const getAttributeValue = (jsx, name) => {
2
2
  return jsx.find((e) => e.name.name === name);
3
3
  };
4
4
 
5
+ const lineBreak = `\n`;
6
+
5
7
  function svgrComponentTemplate(variables, { tpl }) {
6
8
  const { exports, jsx, componentName } = variables;
7
9
  const matched_size = componentName.match(/\d{2,3}$/);
@@ -13,16 +15,14 @@ function svgrComponentTemplate(variables, { tpl }) {
13
15
  const height = heightAttr.value.expression.value;
14
16
  const aspectRatio = width / height;
15
17
 
16
- const heightExpr = aspectRatio === 1
17
- ? tpl(`size`)
18
- : tpl(`size && Math.floor(size / ${aspectRatio}) || ${height}`);
18
+ const heightExpr = aspectRatio === 1 ? tpl(`size`) : tpl(`size && Math.floor(size / ${aspectRatio}) || ${height}`);
19
19
 
20
20
  heightAttr.value.expression = heightExpr.expression;
21
21
 
22
22
  return tpl`
23
23
  import React from 'react';
24
24
  import { IconProps } from '.'
25
-
25
+ ${lineBreak}
26
26
  const ${componentName} = ({
27
27
  size = ${matched_size ? matched_size[0] : '16'},
28
28
  color= '#363644',
@@ -31,7 +31,7 @@ function svgrComponentTemplate(variables, { tpl }) {
31
31
  }: IconProps): JSX.Element => {
32
32
  return ${jsx};
33
33
  }
34
-
34
+ ${lineBreak}
35
35
  ${exports}
36
36
  `;
37
37
  }
@@ -2,6 +2,8 @@ const getAttributeValue = (jsx, name) => {
2
2
  return jsx.find((e) => e.name.name === name);
3
3
  };
4
4
 
5
+ const lineBreak = `\n`;
6
+
5
7
  function svgrComponentTemplate(variables, { tpl }) {
6
8
  const { exports, jsx, componentName } = variables;
7
9
 
@@ -20,14 +22,14 @@ function svgrComponentTemplate(variables, { tpl }) {
20
22
  return tpl`
21
23
  import React from 'react';
22
24
  import { ImageProps } from '.'
23
-
25
+ ${lineBreak}
24
26
  const ${componentName} = ({
25
27
  size = ${widthExpr.expression},
26
28
  ...props
27
29
  }: ImageProps): JSX.Element => {
28
30
  return ${jsx};
29
31
  }
30
-
32
+ ${lineBreak}
31
33
  ${exports}
32
34
  `;
33
35
  }