@pushwoosh/dumb-components 1.0.75 → 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.75",
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,19 +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
- }) => $variant && variants[$variant]);
92
+ }) => $variant && variants[$variant], ({
93
+ $opacity
94
+ }) => $opacity !== undefined && `opacity: ${$opacity};`, ({
95
+ $transform
96
+ }) => $transform && `text-transform: ${$transform};`);
96
97
  export function renderToReact(ast, context) {
97
98
  return renderNodesToArray(ast, context, (tagNode, children, key) => {
98
99
  const TagName = tagNode.name;
@@ -100,7 +101,9 @@ export function renderToReact(ast, context) {
100
101
  if (TagName === 'text') {
101
102
  return [React.createElement(Txt, {
102
103
  "$variant": props.variant,
103
- "$color": getColor(props.color),
104
+ "$color": props.color && getColor(props.color),
105
+ "$opacity": props.opacity,
106
+ "$transform": props.transform,
104
107
  key: key
105
108
  }, children)];
106
109
  }