@zendeskgarden/react-theming 8.54.1 → 8.55.0

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/index.cjs.js CHANGED
@@ -689,11 +689,8 @@ function arrowStyles(position) {
689
689
  }
690
690
 
691
691
  var useText = function useText(component, props, name, text) {
692
- var _useState = React.useState(props[name]),
693
- _useState2 = _slicedToArray(_useState, 2),
694
- value = _useState2[0],
695
- setValue = _useState2[1];
696
- React.useEffect(function () {
692
+ var value = props[name];
693
+ return React.useMemo(function () {
697
694
  if (name === 'children') {
698
695
  throw new Error('Error: `children` is not a valid `getText` prop.');
699
696
  } else if (value === null || value === '') {
@@ -702,10 +699,10 @@ var useText = function useText(component, props, name, text) {
702
699
  if (process.env.NODE_ENV === 'development') {
703
700
  console.warn(component.displayName ? "Warning: you did not provide a customized/translated `".concat(name, "` text value for <").concat(component.displayName, ">. Zendesk Garden is rendering <").concat(component.displayName, " ").concat(name, "=\"").concat(text, "\"> by default.") : "Warning: you did not provide a customized/translated `".concat(name, "` text value. Zendesk Garden is rendering ").concat(name, "=\"").concat(text, "\" by default."));
704
701
  }
705
- setValue(text);
702
+ return text;
706
703
  }
707
- }, [name, value, component.displayName, text]);
708
- return value;
704
+ return value;
705
+ }, [component.displayName, value, name, text]);
709
706
  };
710
707
 
711
708
  var animationStyles = function animationStyles(position, options) {
package/dist/index.esm.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
 
8
- import React, { useState, useEffect, useRef } from 'react';
8
+ import React, { useState, useEffect, useRef, useMemo } from 'react';
9
9
  import { ThemeProvider as ThemeProvider$1, withTheme as withTheme$1, css, keyframes } from 'styled-components';
10
10
  import { useFocusVisible } from '@zendeskgarden/container-focusvisible';
11
11
  import { getControlledValue } from '@zendeskgarden/container-utilities';
@@ -681,11 +681,8 @@ function arrowStyles(position) {
681
681
  }
682
682
 
683
683
  var useText = function useText(component, props, name, text) {
684
- var _useState = useState(props[name]),
685
- _useState2 = _slicedToArray(_useState, 2),
686
- value = _useState2[0],
687
- setValue = _useState2[1];
688
- useEffect(function () {
684
+ var value = props[name];
685
+ return useMemo(function () {
689
686
  if (name === 'children') {
690
687
  throw new Error('Error: `children` is not a valid `getText` prop.');
691
688
  } else if (value === null || value === '') {
@@ -694,10 +691,10 @@ var useText = function useText(component, props, name, text) {
694
691
  if (process.env.NODE_ENV === 'development') {
695
692
  console.warn(component.displayName ? "Warning: you did not provide a customized/translated `".concat(name, "` text value for <").concat(component.displayName, ">. Zendesk Garden is rendering <").concat(component.displayName, " ").concat(name, "=\"").concat(text, "\"> by default.") : "Warning: you did not provide a customized/translated `".concat(name, "` text value. Zendesk Garden is rendering ").concat(name, "=\"").concat(text, "\" by default."));
696
693
  }
697
- setValue(text);
694
+ return text;
698
695
  }
699
- }, [name, value, component.displayName, text]);
700
- return value;
696
+ return value;
697
+ }, [component.displayName, value, name, text]);
701
698
  };
702
699
 
703
700
  var animationStyles = function animationStyles(position, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-theming",
3
- "version": "8.54.1",
3
+ "version": "8.55.0",
4
4
  "description": "Theming utilities and components within the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -41,5 +41,5 @@
41
41
  "access": "public"
42
42
  },
43
43
  "zendeskgarden:src": "src/index.ts",
44
- "gitHead": "fdf531c082579941617f674871067bfde1e5abb6"
44
+ "gitHead": "ec2cb4f499e02faadf6a4aa6ac94eaadf1d81015"
45
45
  }