@pushwoosh/dumb-components 1.0.76 → 1.0.77

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": "@pushwoosh/dumb-components",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -80,21 +80,20 @@ export function renderToString(ast, context) {
80
80
  }
81
81
  function getColor(color) {
82
82
  const colorValue = Color[color];
83
- if (colorValue) {
84
- return colorValue;
85
- }
86
- return color;
83
+ return colorValue || color;
87
84
  }
88
85
  const Txt = styled.span.withConfig({
89
86
  displayName: "Txt",
90
87
  componentId: "sc-nm71u5-0"
91
- })(["", " ", " ", ""], ({
88
+ })(["", " ", " ", " ", ""], ({
92
89
  $color
93
90
  }) => $color && `color: ${$color};`, ({
94
91
  $variant
95
92
  }) => $variant && variants[$variant], ({
96
93
  $opacity
97
- }) => $opacity !== undefined && `opacity: ${$opacity};`);
94
+ }) => $opacity !== undefined && `opacity: ${$opacity};`, ({
95
+ $transform
96
+ }) => $transform && `text-transform: ${$transform};`);
98
97
  export function renderToReact(ast, context) {
99
98
  return renderNodesToArray(ast, context, (tagNode, children, key) => {
100
99
  const TagName = tagNode.name;
@@ -102,7 +101,9 @@ export function renderToReact(ast, context) {
102
101
  if (TagName === 'text') {
103
102
  return [React.createElement(Txt, {
104
103
  "$variant": props.variant,
105
- "$color": getColor(props.color),
104
+ "$color": props.color && getColor(props.color),
105
+ "$opacity": props.opacity,
106
+ "$transform": props.transform,
106
107
  key: key
107
108
  }, children)];
108
109
  }