@carbon/react 1.92.0-rc.0 → 1.92.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.
@@ -218,6 +218,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
218
218
  const lastFocusedField = useRef(null);
219
219
  const savedOnChange = useSavedCallback(onChange);
220
220
  const savedOnOpen = useSavedCallback(onOpen);
221
+ const effectiveWarn = warn && !invalid;
221
222
  const datePickerClasses = cx(`${prefix}--date-picker`, {
222
223
  [`${prefix}--date-picker--short`]: short,
223
224
  [`${prefix}--date-picker--light`]: light,
@@ -238,26 +239,34 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
238
239
  return /*#__PURE__*/React.cloneElement(child, {
239
240
  datePickerType,
240
241
  ref: startInputField,
241
- readOnly
242
+ readOnly,
243
+ invalid,
244
+ warn: effectiveWarn
242
245
  });
243
246
  }
244
247
  if (index === 1 && child.type === /*#__PURE__*/React.createElement(DatePickerInput, child.props).type) {
245
248
  return /*#__PURE__*/React.cloneElement(child, {
246
249
  datePickerType,
247
250
  ref: endInputField,
248
- readOnly
251
+ readOnly,
252
+ invalid,
253
+ warn: effectiveWarn
249
254
  });
250
255
  }
251
256
  if (index === 0) {
252
257
  return /*#__PURE__*/React.cloneElement(child, {
253
258
  ref: startInputField,
254
- readOnly
259
+ readOnly,
260
+ invalid,
261
+ warn: effectiveWarn
255
262
  });
256
263
  }
257
264
  if (index === 1) {
258
265
  return /*#__PURE__*/React.cloneElement(child, {
259
266
  ref: endInputField,
260
- readOnly
267
+ readOnly,
268
+ invalid,
269
+ warn: effectiveWarn
261
270
  });
262
271
  }
263
272
  });
@@ -616,8 +625,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
616
625
  }), /*#__PURE__*/React.createElement("div", {
617
626
  className: `${prefix}--form-requirement`
618
627
  }, invalidText));
619
- }
620
- if (warn && !invalid) {
628
+ } else if (warn) {
621
629
  fluidError = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WarningAltFilled, {
622
630
  className: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--warn`
623
631
  }), /*#__PURE__*/React.createElement("hr", {
@@ -137,7 +137,7 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
137
137
  }), /*#__PURE__*/React.createElement(Text, {
138
138
  as: "div",
139
139
  className: `${prefix}--form-requirement`
140
- }, invalidText)), warn && /*#__PURE__*/React.createElement(React.Fragment, null, isFluid && /*#__PURE__*/React.createElement("hr", {
140
+ }, invalidText)), warn && !invalid && /*#__PURE__*/React.createElement(React.Fragment, null, isFluid && /*#__PURE__*/React.createElement("hr", {
141
141
  className: `${prefix}--date-picker__divider`
142
142
  }), /*#__PURE__*/React.createElement(Text, {
143
143
  as: "div",
@@ -34,7 +34,7 @@ export interface MenuButtonProps extends ComponentProps<'div'> {
34
34
  /**
35
35
  * Specify the size of the button and menu.
36
36
  */
37
- size?: 'sm' | 'md' | 'lg';
37
+ size?: 'xs' | 'sm' | 'md' | 'lg';
38
38
  /**
39
39
  * Specify the tabIndex of the button.
40
40
  */
@@ -177,7 +177,7 @@ MenuButton.propTypes = {
177
177
  */
178
178
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
179
179
  // @ts-ignore-next-line -- avoid spurious (?) TS2322 error
180
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
180
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
181
181
  /**
182
182
  * Specify the tabIndex of the button.
183
183
  */
@@ -222,6 +222,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
222
222
  const lastFocusedField = React.useRef(null);
223
223
  const savedOnChange = useSavedCallback.useSavedCallback(onChange);
224
224
  const savedOnOpen = useSavedCallback.useSavedCallback(onOpen);
225
+ const effectiveWarn = warn && !invalid;
225
226
  const datePickerClasses = cx(`${prefix}--date-picker`, {
226
227
  [`${prefix}--date-picker--short`]: short,
227
228
  [`${prefix}--date-picker--light`]: light,
@@ -242,26 +243,34 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
242
243
  return /*#__PURE__*/React.cloneElement(child, {
243
244
  datePickerType,
244
245
  ref: startInputField,
245
- readOnly
246
+ readOnly,
247
+ invalid,
248
+ warn: effectiveWarn
246
249
  });
247
250
  }
248
251
  if (index === 1 && child.type === /*#__PURE__*/React.createElement(DatePickerInput.default, child.props).type) {
249
252
  return /*#__PURE__*/React.cloneElement(child, {
250
253
  datePickerType,
251
254
  ref: endInputField,
252
- readOnly
255
+ readOnly,
256
+ invalid,
257
+ warn: effectiveWarn
253
258
  });
254
259
  }
255
260
  if (index === 0) {
256
261
  return /*#__PURE__*/React.cloneElement(child, {
257
262
  ref: startInputField,
258
- readOnly
263
+ readOnly,
264
+ invalid,
265
+ warn: effectiveWarn
259
266
  });
260
267
  }
261
268
  if (index === 1) {
262
269
  return /*#__PURE__*/React.cloneElement(child, {
263
270
  ref: endInputField,
264
- readOnly
271
+ readOnly,
272
+ invalid,
273
+ warn: effectiveWarn
265
274
  });
266
275
  }
267
276
  });
@@ -620,8 +629,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
620
629
  }), /*#__PURE__*/React.createElement("div", {
621
630
  className: `${prefix}--form-requirement`
622
631
  }, invalidText));
623
- }
624
- if (warn && !invalid) {
632
+ } else if (warn) {
625
633
  fluidError = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(iconsReact.WarningAltFilled, {
626
634
  className: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--warn`
627
635
  }), /*#__PURE__*/React.createElement("hr", {
@@ -141,7 +141,7 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
141
141
  }), /*#__PURE__*/React.createElement(Text.Text, {
142
142
  as: "div",
143
143
  className: `${prefix}--form-requirement`
144
- }, invalidText)), warn && /*#__PURE__*/React.createElement(React.Fragment, null, isFluid && /*#__PURE__*/React.createElement("hr", {
144
+ }, invalidText)), warn && !invalid && /*#__PURE__*/React.createElement(React.Fragment, null, isFluid && /*#__PURE__*/React.createElement("hr", {
145
145
  className: `${prefix}--date-picker__divider`
146
146
  }), /*#__PURE__*/React.createElement(Text.Text, {
147
147
  as: "div",
@@ -34,7 +34,7 @@ export interface MenuButtonProps extends ComponentProps<'div'> {
34
34
  /**
35
35
  * Specify the size of the button and menu.
36
36
  */
37
- size?: 'sm' | 'md' | 'lg';
37
+ size?: 'xs' | 'sm' | 'md' | 'lg';
38
38
  /**
39
39
  * Specify the tabIndex of the button.
40
40
  */
@@ -179,7 +179,7 @@ MenuButton.propTypes = {
179
179
  */
180
180
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
181
181
  // @ts-ignore-next-line -- avoid spurious (?) TS2322 error
182
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
182
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
183
183
  /**
184
184
  * Specify the tabIndex of the button.
185
185
  */
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.92.0-rc.0",
4
+ "version": "1.92.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -52,10 +52,10 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@babel/runtime": "^7.27.3",
55
- "@carbon/feature-flags": "^0.31.0-rc.0",
56
- "@carbon/icons-react": "^11.68.0-rc.0",
57
- "@carbon/layout": "^11.42.0-rc.0",
58
- "@carbon/styles": "^1.91.0-rc.0",
55
+ "@carbon/feature-flags": "^0.31.0",
56
+ "@carbon/icons-react": "^11.68.0",
57
+ "@carbon/layout": "^11.42.0",
58
+ "@carbon/styles": "^1.91.0",
59
59
  "@carbon/utilities": "^0.10.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.61.0-rc.0",
83
+ "@carbon/themes": "^11.61.0",
84
84
  "@figma/code-connect": "^1.3.2",
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": "eae1402aa3c86b644feefc43bd3202915404e924"
142
+ "gitHead": "8f9dd77c8055a1a1ce36af55298c19c9f8966ab9"
143
143
  }