@carbon/react 1.63.0-rc.0 → 1.63.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.
Files changed (62) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +852 -852
  2. package/es/components/ComboBox/ComboBox.d.ts +10 -6
  3. package/es/components/ComboBox/ComboBox.js +10 -1
  4. package/es/components/ComboButton/index.d.ts +9 -6
  5. package/es/components/ComboButton/index.js +5 -0
  6. package/es/components/DataTable/DataTable.d.ts +25 -11
  7. package/es/components/DataTable/DataTable.js +5 -0
  8. package/es/components/DataTable/TableBatchActions.d.ts +2 -2
  9. package/es/components/DataTable/TableHeader.d.ts +7 -13
  10. package/es/components/DataTable/TableToolbarSearch.d.ts +5 -2
  11. package/es/components/DataTable/TableToolbarSearch.js +4 -0
  12. package/es/components/Dropdown/Dropdown.d.ts +2 -6
  13. package/es/components/FormGroup/FormGroup.d.ts +9 -1
  14. package/es/components/FormGroup/FormGroup.js +8 -1
  15. package/es/components/ListBox/ListBoxMenuIcon.d.ts +2 -7
  16. package/es/components/ListBox/ListBoxSelection.d.ts +8 -9
  17. package/es/components/ListBox/ListBoxSelection.js +5 -0
  18. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +10 -5
  19. package/es/components/MultiSelect/FilterableMultiSelect.js +11 -2
  20. package/es/components/MultiSelect/MultiSelect.d.ts +2 -2
  21. package/es/components/MultiSelect/MultiSelect.js +1 -1
  22. package/es/components/NumberInput/NumberInput.d.ts +8 -7
  23. package/es/components/NumberInput/NumberInput.js +5 -0
  24. package/es/components/PaginationNav/PaginationNav.d.ts +13 -6
  25. package/es/components/PaginationNav/PaginationNav.js +5 -0
  26. package/es/components/ProgressIndicator/ProgressIndicator.d.ts +12 -6
  27. package/es/components/ProgressIndicator/ProgressIndicator.js +5 -0
  28. package/es/components/Slider/Slider.d.ts +11 -9
  29. package/es/components/Slider/Slider.js +6 -1
  30. package/es/internal/Selection.js +1 -1
  31. package/es/types/common.d.ts +6 -1
  32. package/lib/components/ComboBox/ComboBox.d.ts +10 -6
  33. package/lib/components/ComboBox/ComboBox.js +10 -1
  34. package/lib/components/ComboButton/index.d.ts +9 -6
  35. package/lib/components/ComboButton/index.js +5 -0
  36. package/lib/components/DataTable/DataTable.d.ts +25 -11
  37. package/lib/components/DataTable/DataTable.js +5 -0
  38. package/lib/components/DataTable/TableBatchActions.d.ts +2 -2
  39. package/lib/components/DataTable/TableHeader.d.ts +7 -13
  40. package/lib/components/DataTable/TableToolbarSearch.d.ts +5 -2
  41. package/lib/components/DataTable/TableToolbarSearch.js +4 -0
  42. package/lib/components/Dropdown/Dropdown.d.ts +2 -6
  43. package/lib/components/FormGroup/FormGroup.d.ts +9 -1
  44. package/lib/components/FormGroup/FormGroup.js +8 -1
  45. package/lib/components/ListBox/ListBoxMenuIcon.d.ts +2 -7
  46. package/lib/components/ListBox/ListBoxSelection.d.ts +8 -9
  47. package/lib/components/ListBox/ListBoxSelection.js +5 -0
  48. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +10 -5
  49. package/lib/components/MultiSelect/FilterableMultiSelect.js +11 -2
  50. package/lib/components/MultiSelect/MultiSelect.d.ts +2 -2
  51. package/lib/components/MultiSelect/MultiSelect.js +1 -1
  52. package/lib/components/NumberInput/NumberInput.d.ts +8 -7
  53. package/lib/components/NumberInput/NumberInput.js +5 -0
  54. package/lib/components/PaginationNav/PaginationNav.d.ts +13 -6
  55. package/lib/components/PaginationNav/PaginationNav.js +5 -0
  56. package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +12 -6
  57. package/lib/components/ProgressIndicator/ProgressIndicator.js +5 -0
  58. package/lib/components/Slider/Slider.d.ts +11 -9
  59. package/lib/components/Slider/Slider.js +6 -1
  60. package/lib/internal/Selection.js +1 -1
  61. package/lib/types/common.d.ts +6 -1
  62. package/package.json +8 -9
@@ -9,11 +9,11 @@ import React, { ReactNode } from 'react';
9
9
  import { ListBoxSize, ListBoxType } from '../ListBox';
10
10
  import { MultiSelectSortingProps } from './MultiSelectPropTypes';
11
11
  import { ListBoxProps } from '../ListBox/ListBox';
12
- import type { InternationalProps } from '../../types/common';
12
+ import type { TranslateWithId } from '../../types/common';
13
13
  interface OnChangeData<ItemType> {
14
14
  selectedItems: ItemType[] | null;
15
15
  }
16
- export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, InternationalProps<'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection'> {
16
+ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, TranslateWithId<'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection'> {
17
17
  /**
18
18
  * **Experimental**: Will attempt to automatically align the floating
19
19
  * element to avoid collisions with the viewport and being clipped by
@@ -13,7 +13,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var iconsReact = require('@carbon/icons-react');
14
14
  var cx = require('classnames');
15
15
  var Downshift = require('downshift');
16
- var isEqual = require('lodash.isequal');
16
+ var isEqual = require('react-fast-compare');
17
17
  var PropTypes = require('prop-types');
18
18
  var React = require('react');
19
19
  var index = require('../ListBox/index.js');
@@ -5,12 +5,17 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { ReactNode } from 'react';
8
+ import { TranslateWithId } from '../../types/common';
8
9
  export declare const translationIds: {
9
- 'increment.number': string;
10
- 'decrement.number': string;
10
+ readonly 'increment.number': "increment.number";
11
+ readonly 'decrement.number': "decrement.number";
11
12
  };
13
+ /**
14
+ * Message ids that will be passed to translateWithId().
15
+ */
16
+ type TranslationKey = keyof typeof translationIds;
12
17
  type ExcludedAttributes = 'defaultValue' | 'id' | 'min' | 'max' | 'onChange' | 'onClick' | 'size' | 'step' | 'value';
13
- export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
18
+ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey> {
14
19
  /**
15
20
  * `true` to allow empty string.
16
21
  */
@@ -115,10 +120,6 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
115
120
  * Specify how much the values should increase/decrease upon clicking on up/down button
116
121
  */
117
122
  step?: number;
118
- /**
119
- * Provide custom text for the component for each translation id
120
- */
121
- translateWithId?: (id: string) => string;
122
123
  /**
123
124
  * Specify the value of the input
124
125
  */
@@ -34,6 +34,11 @@ const translationIds = {
34
34
  'increment.number': 'increment.number',
35
35
  'decrement.number': 'decrement.number'
36
36
  };
37
+
38
+ /**
39
+ * Message ids that will be passed to translateWithId().
40
+ */
41
+
37
42
  const defaultTranslations = {
38
43
  [translationIds['increment.number']]: 'Increment number',
39
44
  [translationIds['decrement.number']]: 'Decrement number'
@@ -5,7 +5,19 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
- interface PaginationNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
8
+ import { TranslateWithId } from '../../types/common';
9
+ declare const translationIds: {
10
+ readonly 'carbon.pagination-nav.next': "Next";
11
+ readonly 'carbon.pagination-nav.previous': "Previous";
12
+ readonly 'carbon.pagination-nav.item': "Page";
13
+ readonly 'carbon.pagination-nav.active': "Active";
14
+ readonly 'carbon.pagination-nav.of': "of";
15
+ };
16
+ /**
17
+ * Message ids that will be passed to translateWithId().
18
+ */
19
+ type TranslationKey = keyof typeof translationIds;
20
+ interface PaginationNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>, TranslateWithId<TranslationKey> {
9
21
  /**
10
22
  * Additional CSS class names.
11
23
  */
@@ -35,11 +47,6 @@ interface PaginationNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'on
35
47
  * The total number of items.
36
48
  */
37
49
  totalItems?: number;
38
- /**
39
- * Specify a custom translation function that takes in a message identifier
40
- * and returns the localized string for the message
41
- */
42
- translateWithId?: (id: string) => string;
43
50
  }
44
51
  declare const PaginationNav: React.ForwardRefExoticComponent<PaginationNavProps & React.RefAttributes<HTMLElement>>;
45
52
  export default PaginationNav;
@@ -31,6 +31,11 @@ const translationIds = {
31
31
  'carbon.pagination-nav.active': 'Active',
32
32
  'carbon.pagination-nav.of': 'of'
33
33
  };
34
+
35
+ /**
36
+ * Message ids that will be passed to translateWithId().
37
+ */
38
+
34
39
  function translateWithId(messageId) {
35
40
  return translationIds[messageId];
36
41
  }
@@ -6,6 +6,17 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
+ import { TranslateWithId } from '../../types/common';
10
+ declare const defaultTranslations: {
11
+ readonly 'carbon.progress-step.complete': "Complete";
12
+ readonly 'carbon.progress-step.incomplete': "Incomplete";
13
+ readonly 'carbon.progress-step.current': "Current";
14
+ readonly 'carbon.progress-step.invalid': "Invalid";
15
+ };
16
+ /**
17
+ * Message ids that will be passed to translateWithId().
18
+ */
19
+ type TranslationKey = keyof typeof defaultTranslations;
9
20
  export interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
10
21
  /**
11
22
  * Provide `<ProgressStep>` components to be rendered in the
@@ -63,7 +74,7 @@ declare namespace ProgressIndicator {
63
74
  vertical: PropTypes.Requireable<boolean>;
64
75
  };
65
76
  }
66
- export interface ProgressStepProps {
77
+ export interface ProgressStepProps extends TranslateWithId<TranslationKey> {
67
78
  /**
68
79
  * Provide an optional className to be applied to the containing `<li>` node
69
80
  */
@@ -112,11 +123,6 @@ export interface ProgressStepProps {
112
123
  * The ID of the tooltip content.
113
124
  */
114
125
  tooltipId?: string;
115
- /**
116
- * Optional method that takes in a message id and returns an
117
- * internationalized string.
118
- */
119
- translateWithId?: (id: string) => string;
120
126
  }
121
127
  declare function ProgressStep({ label, description, className, current, complete, invalid, secondaryLabel, disabled, onClick, translateWithId: t, ...rest }: ProgressStepProps): import("react/jsx-runtime").JSX.Element;
122
128
  declare namespace ProgressStep {
@@ -32,6 +32,11 @@ const defaultTranslations = {
32
32
  'carbon.progress-step.current': 'Current',
33
33
  'carbon.progress-step.invalid': 'Invalid'
34
34
  };
35
+
36
+ /**
37
+ * Message ids that will be passed to translateWithId().
38
+ */
39
+
35
40
  function translateWithId(messageId) {
36
41
  return defaultTranslations[messageId];
37
42
  }
@@ -6,6 +6,14 @@
6
6
  */
7
7
  import React, { type KeyboardEventHandler, PureComponent, ReactNode } from 'react';
8
8
  import PropTypes from 'prop-types';
9
+ import { TranslateWithId } from '../../types/common';
10
+ declare const translationIds: {
11
+ readonly autoCorrectAnnouncement: "carbon.slider.auto-correct-announcement";
12
+ };
13
+ /**
14
+ * Message ids that will be passed to translateWithId().
15
+ */
16
+ type TranslationKey = (typeof translationIds)[keyof typeof translationIds];
9
17
  /**
10
18
  * Distinguish two handles by lower and upper positions.
11
19
  */
@@ -14,7 +22,9 @@ declare enum HandlePosition {
14
22
  UPPER = "upper"
15
23
  }
16
24
  type ExcludedAttributes = 'onChange' | 'onBlur';
17
- export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
25
+ export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey, {
26
+ correctedValue?: string;
27
+ }> {
18
28
  /**
19
29
  * The `ariaLabel` for the `<input>`.
20
30
  */
@@ -136,14 +146,6 @@ export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
136
146
  * which will be `(max - min) / stepMultiplier`.
137
147
  */
138
148
  stepMultiplier?: number;
139
- /**
140
- * Supply a method to translate internal strings with your i18n tool of
141
- * choice. Translation keys are available on the `translationIds` field for
142
- * this component.
143
- */
144
- translateWithId?: (translationId: string, translationState: {
145
- correctedValue?: string;
146
- }) => string;
147
149
  /**
148
150
  * The value of the slider. When there are two handles, value is the lower
149
151
  * bound.
@@ -83,8 +83,13 @@ ThumbWrapper.propTypes = {
83
83
  const translationIds = {
84
84
  autoCorrectAnnouncement: 'carbon.slider.auto-correct-announcement'
85
85
  };
86
+
87
+ /**
88
+ * Message ids that will be passed to translateWithId().
89
+ */
90
+
86
91
  function translateWithId(translationId, translationState) {
87
- if (translationId === translationIds.autoCorrectAnnouncement && translationState?.correctedValue) {
92
+ if (translationState?.correctedValue) {
88
93
  const {
89
94
  correctedValue
90
95
  } = translationState;
@@ -12,7 +12,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
13
  var React = require('react');
14
14
  var PropTypes = require('prop-types');
15
- var isEqual = require('lodash.isequal');
15
+ var isEqual = require('react-fast-compare');
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
18
 
@@ -9,10 +9,15 @@ export type ForwardRefReturn<T, P = unknown> = React.ForwardRefExoticComponent<F
9
9
  export type PolymorphicProps<Element extends React.ElementType, Props> = Props & Omit<React.ComponentProps<Element>, 'as'> & {
10
10
  as?: Element;
11
11
  };
12
- export interface InternationalProps<MID = string, ARGS = Record<string, unknown>> {
12
+ export interface TranslateWithId<MID = string, ARGS = Record<string, unknown>> {
13
13
  /**
14
14
  * Supply a method to translate internal strings with your i18n tool of
15
15
  * choice.
16
16
  */
17
17
  translateWithId?(messageId: MID, args?: ARGS): string;
18
18
  }
19
+ /**
20
+ * Alias of TranslateWithId. Will be removed in v12
21
+ * @deprecated Use TranslateWithId instead
22
+ */
23
+ export type InternationalProps<MID = string, ARGS = Record<string, unknown>> = TranslateWithId<MID, ARGS>;
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.63.0-rc.0",
4
+ "version": "1.63.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -48,10 +48,10 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@babel/runtime": "^7.24.7",
51
- "@carbon/feature-flags": "^0.21.0-rc.0",
52
- "@carbon/icons-react": "^11.46.0-rc.0",
53
- "@carbon/layout": "^11.24.0-rc.0",
54
- "@carbon/styles": "^1.62.0-rc.0",
51
+ "@carbon/feature-flags": "^0.21.0",
52
+ "@carbon/icons-react": "^11.46.0",
53
+ "@carbon/layout": "^11.24.0",
54
+ "@carbon/styles": "^1.62.0",
55
55
  "@floating-ui/react": "^0.26.0",
56
56
  "@ibm/telemetry-js": "^1.5.0",
57
57
  "classnames": "2.5.1",
@@ -61,7 +61,6 @@
61
61
  "invariant": "^2.2.3",
62
62
  "lodash.debounce": "^4.0.8",
63
63
  "lodash.findlast": "^4.5.0",
64
- "lodash.isequal": "^4.5.0",
65
64
  "lodash.omit": "^4.5.0",
66
65
  "lodash.throttle": "^4.1.1",
67
66
  "prop-types": "^15.7.2",
@@ -81,7 +80,7 @@
81
80
  "@babel/preset-react": "^7.24.7",
82
81
  "@babel/preset-typescript": "^7.24.7",
83
82
  "@carbon/test-utils": "^10.30.0",
84
- "@carbon/themes": "^11.38.0-rc.0",
83
+ "@carbon/themes": "^11.38.0",
85
84
  "@figma/code-connect": "^1.0.2",
86
85
  "@rollup/plugin-babel": "^6.0.0",
87
86
  "@rollup/plugin-commonjs": "^26.0.0",
@@ -100,7 +99,7 @@
100
99
  "autoprefixer": "^10.4.0",
101
100
  "babel-loader": "^9.0.0",
102
101
  "babel-plugin-dev-expression": "^0.2.3",
103
- "babel-preset-carbon": "^0.6.0-rc.0",
102
+ "babel-preset-carbon": "^0.6.0",
104
103
  "browserify-zlib": "^0.2.0",
105
104
  "browserslist-config-carbon": "^11.2.0",
106
105
  "clipboardy": "^2.1.0",
@@ -142,5 +141,5 @@
142
141
  "**/*.scss",
143
142
  "**/*.css"
144
143
  ],
145
- "gitHead": "326ac312c2b669937ede1c0c68c0e3a6d9c34135"
144
+ "gitHead": "70a0775c76273e311cb1bb16db02d3f11ad8d018"
146
145
  }