@carbon/react 1.95.1-rc.0 → 1.96.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.
@@ -149,7 +149,7 @@ const Menu = /*#__PURE__*/forwardRef(function Menu({
149
149
  }
150
150
  }
151
151
  function handleBlur(e) {
152
- if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) {
152
+ if (open && onClose && isRoot && e.relatedTarget && !menu.current?.contains(e.relatedTarget)) {
153
153
  handleClose();
154
154
  }
155
155
  }
@@ -250,6 +250,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(({
250
250
  hideLabel: true,
251
251
  onChange: handlePageInputChange,
252
252
  value: page,
253
+ key: page,
253
254
  disabled: pageInputDisabled || disabled
254
255
  }, selectItems), /*#__PURE__*/React.createElement("span", {
255
256
  className: `${prefix}--pagination__text`
@@ -10,7 +10,7 @@ import { Close, Search as Search$1 } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import React, { useContext, useRef, useState } from 'react';
13
- import { Enter, Space, Escape } from '../../internal/keyboard/keys.js';
13
+ import { Escape, Enter, Space } from '../../internal/keyboard/keys.js';
14
14
  import { match } from '../../internal/keyboard/match.js';
15
15
  import { useId } from '../../internal/useId.js';
16
16
  import { usePrefix } from '../../internal/usePrefix.js';
@@ -20,6 +20,8 @@ import { deprecate } from '../../prop-types/deprecate.js';
20
20
  import '../FluidForm/FluidForm.js';
21
21
  import { FormContext } from '../FluidForm/FormContext.js';
22
22
  import { noopFn } from '../../internal/noopFn.js';
23
+ import '../Tooltip/DefinitionTooltip.js';
24
+ import { Tooltip } from '../Tooltip/Tooltip.js';
23
25
 
24
26
  var _Close;
25
27
  const Search = /*#__PURE__*/React.forwardRef(({
@@ -129,11 +131,7 @@ const Search = /*#__PURE__*/React.forwardRef(({
129
131
  }
130
132
  }
131
133
  }
132
- return /*#__PURE__*/React.createElement("div", {
133
- role: "search",
134
- "aria-label": placeholder,
135
- className: searchClasses
136
- }, /*#__PURE__*/React.createElement("div", {
134
+ const magnifierButton = /*#__PURE__*/React.createElement("div", {
137
135
  "aria-labelledby": onExpand ? searchId : undefined,
138
136
  role: onExpand ? 'button' : undefined,
139
137
  className: `${prefix}--search-magnifier`,
@@ -145,7 +143,19 @@ const Search = /*#__PURE__*/React.forwardRef(({
145
143
  "aria-controls": onExpand ? uniqueId : undefined
146
144
  }, /*#__PURE__*/React.createElement(CustomSearchIcon, {
147
145
  icon: renderIcon
148
- })), /*#__PURE__*/React.createElement("label", {
146
+ }));
147
+
148
+ // Wrap magnifierButton in a tooltip if it's expandable
149
+ const magnifierWithTooltip = onExpand && !isExpanded ? /*#__PURE__*/React.createElement(Tooltip, {
150
+ className: `${prefix}--search-tooltip ${prefix}--search-magnifier-tooltip`,
151
+ align: "top",
152
+ label: "Search"
153
+ }, magnifierButton) : magnifierButton;
154
+ return /*#__PURE__*/React.createElement("div", {
155
+ role: "search",
156
+ "aria-label": placeholder,
157
+ className: searchClasses
158
+ }, magnifierWithTooltip, /*#__PURE__*/React.createElement("label", {
149
159
  id: searchId,
150
160
  htmlFor: uniqueId,
151
161
  className: `${prefix}--label`
@@ -151,7 +151,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu({
151
151
  }
152
152
  }
153
153
  function handleBlur(e) {
154
- if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) {
154
+ if (open && onClose && isRoot && e.relatedTarget && !menu.current?.contains(e.relatedTarget)) {
155
155
  handleClose();
156
156
  }
157
157
  }
@@ -254,6 +254,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(({
254
254
  hideLabel: true,
255
255
  onChange: handlePageInputChange,
256
256
  value: page,
257
+ key: page,
257
258
  disabled: pageInputDisabled || disabled
258
259
  }, selectItems), /*#__PURE__*/React.createElement("span", {
259
260
  className: `${prefix}--pagination__text`
@@ -24,6 +24,8 @@ var deprecate = require('../../prop-types/deprecate.js');
24
24
  require('../FluidForm/FluidForm.js');
25
25
  var FormContext = require('../FluidForm/FormContext.js');
26
26
  var noopFn = require('../../internal/noopFn.js');
27
+ require('../Tooltip/DefinitionTooltip.js');
28
+ var Tooltip = require('../Tooltip/Tooltip.js');
27
29
 
28
30
  var _Close;
29
31
  const Search = /*#__PURE__*/React.forwardRef(({
@@ -133,11 +135,7 @@ const Search = /*#__PURE__*/React.forwardRef(({
133
135
  }
134
136
  }
135
137
  }
136
- return /*#__PURE__*/React.createElement("div", {
137
- role: "search",
138
- "aria-label": placeholder,
139
- className: searchClasses
140
- }, /*#__PURE__*/React.createElement("div", {
138
+ const magnifierButton = /*#__PURE__*/React.createElement("div", {
141
139
  "aria-labelledby": onExpand ? searchId : undefined,
142
140
  role: onExpand ? 'button' : undefined,
143
141
  className: `${prefix}--search-magnifier`,
@@ -149,7 +147,19 @@ const Search = /*#__PURE__*/React.forwardRef(({
149
147
  "aria-controls": onExpand ? uniqueId : undefined
150
148
  }, /*#__PURE__*/React.createElement(CustomSearchIcon, {
151
149
  icon: renderIcon
152
- })), /*#__PURE__*/React.createElement("label", {
150
+ }));
151
+
152
+ // Wrap magnifierButton in a tooltip if it's expandable
153
+ const magnifierWithTooltip = onExpand && !isExpanded ? /*#__PURE__*/React.createElement(Tooltip.Tooltip, {
154
+ className: `${prefix}--search-tooltip ${prefix}--search-magnifier-tooltip`,
155
+ align: "top",
156
+ label: "Search"
157
+ }, magnifierButton) : magnifierButton;
158
+ return /*#__PURE__*/React.createElement("div", {
159
+ role: "search",
160
+ "aria-label": placeholder,
161
+ className: searchClasses
162
+ }, magnifierWithTooltip, /*#__PURE__*/React.createElement("label", {
153
163
  id: searchId,
154
164
  htmlFor: uniqueId,
155
165
  className: `${prefix}--label`
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.95.1-rc.0",
4
+ "version": "1.96.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -55,7 +55,7 @@
55
55
  "@carbon/feature-flags": "0.32.0",
56
56
  "@carbon/icons-react": "^11.70.0",
57
57
  "@carbon/layout": "^11.43.0",
58
- "@carbon/styles": "^1.94.1-rc.0",
58
+ "@carbon/styles": "^1.95.0",
59
59
  "@carbon/utilities": "^0.12.0",
60
60
  "@floating-ui/react": "^0.27.4",
61
61
  "@ibm/telemetry-js": "^1.5.0",
@@ -80,7 +80,7 @@
80
80
  "@babel/preset-react": "^7.27.1",
81
81
  "@babel/preset-typescript": "^7.27.1",
82
82
  "@carbon/test-utils": "^10.38.0",
83
- "@carbon/themes": "^11.62.1-rc.0",
83
+ "@carbon/themes": "^11.63.0",
84
84
  "@figma/code-connect": "^1.3.5",
85
85
  "@rollup/plugin-babel": "^6.0.0",
86
86
  "@rollup/plugin-commonjs": "^28.0.3",
@@ -139,5 +139,5 @@
139
139
  "**/*.scss",
140
140
  "**/*.css"
141
141
  ],
142
- "gitHead": "fde0c0fc9b6c3931d871720ee94e99255603d18d"
142
+ "gitHead": "d2ccae94e5aa3defcce07cc9ea90058fda6c9705"
143
143
  }