@carbon/react 1.24.0-rc.0 → 1.24.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.
@@ -90,7 +90,7 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
90
90
  var defaultValue = rest.defaultValue,
91
91
  value = rest.value;
92
92
 
93
- var _useState = React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) || 0),
93
+ var _useState = React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.toString().length) || (value === null || value === void 0 ? void 0 : value.toString().length) || 0),
94
94
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
95
95
  textCount = _useState2[0],
96
96
  setTextCount = _useState2[1];
@@ -168,6 +168,7 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
168
168
  isFluid = _useContext.isFluid;
169
169
 
170
170
  var ariaAnnouncement = useAnnouncer.useAnnouncer(textCount, maxCount);
171
+ var Icon = normalizedProps.icon;
171
172
  return /*#__PURE__*/React__default["default"].createElement("div", {
172
173
  className: inputWrapperClasses
173
174
  }, !inline ? labelWrapper : /*#__PURE__*/React__default["default"].createElement("div", {
@@ -177,7 +178,7 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
177
178
  }, /*#__PURE__*/React__default["default"].createElement("div", {
178
179
  className: fieldWrapperClasses,
179
180
  "data-invalid": normalizedProps.invalid || null
180
- }, normalizedProps.icon && /*#__PURE__*/React__default["default"].createElement(normalizedProps.icon, {
181
+ }, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
181
182
  className: iconClasses
182
183
  }), input, /*#__PURE__*/React__default["default"].createElement("span", {
183
184
  className: "".concat(prefix, "--text-input__counter-alert"),
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { Ref, ForwardedRef } from 'react';
8
+ /**
9
+ * Combine multiple refs into a single ref. This use useful when you have two
10
+ * refs from both `React.forwardRef` and `useRef` that you would like to add to
11
+ * the same node.
12
+ */
13
+ export declare const useMergedRefs: <T>(refs: ForwardedRef<T>[]) => Ref<T>;
@@ -15,12 +15,9 @@ var React = require('react');
15
15
  * Combine multiple refs into a single ref. This use useful when you have two
16
16
  * refs from both `React.forwardRef` and `useRef` that you would like to add to
17
17
  * the same node.
18
- *
19
- * @param {Array} refs
20
- * @returns {Function}
21
18
  */
22
19
 
23
- function useMergedRefs(refs) {
20
+ var useMergedRefs = function useMergedRefs(refs) {
24
21
  return React.useCallback(function (node) {
25
22
  refs.forEach(function (ref) {
26
23
  if (typeof ref === 'function') {
@@ -30,6 +27,6 @@ function useMergedRefs(refs) {
30
27
  }
31
28
  }); // eslint-disable-next-line react-hooks/exhaustive-deps
32
29
  }, refs);
33
- }
30
+ };
34
31
 
35
32
  exports.useMergedRefs = useMergedRefs;
@@ -33,6 +33,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
33
  * @property {boolean} disabled - Whether the input is disabled
34
34
  * @property {boolean} invalid - Whether the input is invalid (takes precedence over warn)
35
35
  * @property {string} invalidId - The invalid message's id
36
+ * @property {string} helperId - id used for helper text
36
37
  * @property {boolean} warn - Whether the input is in warning state
37
38
  * @property {string} warnId - The warning message's id
38
39
  * @property {React.ReactNode | null} validation – React node rendering the appropriate validation message (if any)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/react",
3
3
  "description": "React components for the Carbon Design System",
4
- "version": "1.24.0-rc.0",
4
+ "version": "1.24.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -43,10 +43,10 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@babel/runtime": "^7.18.3",
46
- "@carbon/feature-flags": "^0.13.0-rc.0",
47
- "@carbon/icons-react": "^11.17.0-rc.0",
48
- "@carbon/layout": "^11.12.0-rc.0",
49
- "@carbon/styles": "^1.24.0-rc.0",
46
+ "@carbon/feature-flags": "^0.13.0",
47
+ "@carbon/icons-react": "^11.17.0",
48
+ "@carbon/layout": "^11.12.0",
49
+ "@carbon/styles": "^1.24.0",
50
50
  "@carbon/telemetry": "0.1.0",
51
51
  "classnames": "2.3.2",
52
52
  "copy-to-clipboard": "^3.3.1",
@@ -72,8 +72,8 @@
72
72
  "@babel/plugin-transform-react-constant-elements": "^7.17.12",
73
73
  "@babel/preset-env": "^7.18.2",
74
74
  "@babel/preset-react": "^7.17.12",
75
- "@carbon/test-utils": "^10.27.0-rc.0",
76
- "@carbon/themes": "^11.17.0-rc.0",
75
+ "@carbon/test-utils": "^10.27.0",
76
+ "@carbon/themes": "^11.17.0",
77
77
  "@rollup/plugin-babel": "^6.0.0",
78
78
  "@rollup/plugin-commonjs": "^24.0.0",
79
79
  "@rollup/plugin-node-resolve": "^15.0.0",
@@ -92,9 +92,9 @@
92
92
  "autoprefixer": "^10.4.0",
93
93
  "babel-loader": "^9.0.0",
94
94
  "babel-plugin-dev-expression": "^0.2.3",
95
- "babel-preset-carbon": "^0.4.0-rc.0",
95
+ "babel-preset-carbon": "^0.4.0",
96
96
  "browserify-zlib": "^0.2.0",
97
- "browserslist-config-carbon": "^11.1.0-rc.0",
97
+ "browserslist-config-carbon": "^11.1.0",
98
98
  "clipboardy": "^2.1.0",
99
99
  "css-loader": "^6.5.1",
100
100
  "enquirer": "^2.3.6",
@@ -133,5 +133,5 @@
133
133
  "**/*.scss",
134
134
  "**/*.css"
135
135
  ],
136
- "gitHead": "0554718f48299a56a0525c4fb3e2b0271f13440b"
136
+ "gitHead": "07168bf0272678a04c92cd1e700ac60e66355a95"
137
137
  }