@carbon/react 1.57.0 → 1.58.0-rc.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 (90) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +870 -911
  2. package/es/components/Button/Button.js +2 -2
  3. package/es/components/Checkbox/Checkbox.d.ts +6 -7
  4. package/es/components/ComboBox/ComboBox.d.ts +4 -5
  5. package/es/components/ComboBox/ComboBox.js +268 -261
  6. package/es/components/ComposedModal/ComposedModal.d.ts +1 -2
  7. package/es/components/DataTable/TableHeader.d.ts +4 -5
  8. package/es/components/DataTable/TableSlugRow.d.ts +3 -2
  9. package/es/components/DatePicker/DatePicker.d.ts +4 -5
  10. package/es/components/Dropdown/Dropdown.d.ts +5 -6
  11. package/es/components/IconButton/index.d.ts +3 -4
  12. package/es/components/ListBox/next/ListBoxTrigger.js +1 -0
  13. package/es/components/Menu/Menu.js +1 -1
  14. package/es/components/Menu/MenuItem.js +13 -2
  15. package/es/components/Modal/Modal.d.ts +8 -9
  16. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -2
  17. package/es/components/MultiSelect/MultiSelect.d.ts +10 -9
  18. package/es/components/Notification/Notification.d.ts +2 -2
  19. package/es/components/NumberInput/NumberInput.d.ts +1 -2
  20. package/es/components/PasswordInput/index.d.ts +3 -0
  21. package/es/components/Popover/index.d.ts +8 -2
  22. package/es/components/Popover/index.js +26 -1
  23. package/es/components/RadioButton/RadioButton.d.ts +3 -4
  24. package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +7 -8
  25. package/es/components/Select/Select.d.ts +1 -2
  26. package/es/components/Slider/Slider.d.ts +5 -5
  27. package/es/components/Slider/Slider.js +1 -1
  28. package/es/components/Tag/DismissibleTag.d.ts +3 -3
  29. package/es/components/Tag/OperationalTag.d.ts +3 -3
  30. package/es/components/Tag/SelectableTag.d.ts +3 -3
  31. package/es/components/Tag/Tag.d.ts +3 -3
  32. package/es/components/TextArea/TextArea.d.ts +6 -7
  33. package/es/components/TextInput/PasswordInput.d.ts +5 -6
  34. package/es/components/TextInput/PasswordInput.js +2 -2
  35. package/es/components/TextInput/TextInput.d.ts +1 -2
  36. package/es/components/Theme/index.d.ts +1 -0
  37. package/es/components/Theme/index.js +8 -2
  38. package/es/components/Tile/Tile.d.ts +3 -4
  39. package/es/components/TileGroup/TileGroup.d.ts +3 -2
  40. package/es/components/TileGroup/index.d.ts +9 -0
  41. package/es/components/Toggle/Toggle.js +1 -1
  42. package/es/components/Tooltip/DefinitionTooltip.js +1 -1
  43. package/es/index.js +4 -4
  44. package/es/prop-types/deprecateValuesWithin.js +35 -0
  45. package/lib/components/Button/Button.js +2 -2
  46. package/lib/components/Checkbox/Checkbox.d.ts +6 -7
  47. package/lib/components/ComboBox/ComboBox.d.ts +4 -5
  48. package/lib/components/ComboBox/ComboBox.js +267 -261
  49. package/lib/components/ComposedModal/ComposedModal.d.ts +1 -2
  50. package/lib/components/DataTable/TableHeader.d.ts +4 -5
  51. package/lib/components/DataTable/TableSlugRow.d.ts +3 -2
  52. package/lib/components/DatePicker/DatePicker.d.ts +4 -5
  53. package/lib/components/Dropdown/Dropdown.d.ts +5 -6
  54. package/lib/components/IconButton/index.d.ts +3 -4
  55. package/lib/components/ListBox/next/ListBoxTrigger.js +1 -0
  56. package/lib/components/Menu/Menu.js +1 -1
  57. package/lib/components/Menu/MenuItem.js +13 -2
  58. package/lib/components/Modal/Modal.d.ts +8 -9
  59. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -2
  60. package/lib/components/MultiSelect/MultiSelect.d.ts +10 -9
  61. package/lib/components/Notification/Notification.d.ts +2 -2
  62. package/lib/components/NumberInput/NumberInput.d.ts +1 -2
  63. package/lib/components/PasswordInput/index.d.ts +3 -0
  64. package/lib/components/Popover/index.d.ts +8 -2
  65. package/lib/components/Popover/index.js +26 -1
  66. package/lib/components/RadioButton/RadioButton.d.ts +3 -4
  67. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +7 -8
  68. package/lib/components/Select/Select.d.ts +1 -2
  69. package/lib/components/Slider/Slider.d.ts +5 -5
  70. package/lib/components/Slider/Slider.js +1 -1
  71. package/lib/components/Tag/DismissibleTag.d.ts +3 -3
  72. package/lib/components/Tag/OperationalTag.d.ts +3 -3
  73. package/lib/components/Tag/SelectableTag.d.ts +3 -3
  74. package/lib/components/Tag/Tag.d.ts +3 -3
  75. package/lib/components/TextArea/TextArea.d.ts +6 -7
  76. package/lib/components/TextInput/PasswordInput.d.ts +5 -6
  77. package/lib/components/TextInput/PasswordInput.js +2 -2
  78. package/lib/components/TextInput/TextInput.d.ts +1 -2
  79. package/lib/components/Theme/index.d.ts +1 -0
  80. package/lib/components/Theme/index.js +8 -1
  81. package/lib/components/Tile/Tile.d.ts +3 -4
  82. package/lib/components/TileGroup/TileGroup.d.ts +3 -2
  83. package/lib/components/TileGroup/index.d.ts +9 -0
  84. package/lib/components/Toggle/Toggle.js +1 -1
  85. package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
  86. package/lib/index.js +30 -29
  87. package/lib/prop-types/deprecateValuesWithin.js +39 -0
  88. package/package.json +5 -5
  89. package/es/components/TileGroup/index.js +0 -13
  90. package/lib/components/TileGroup/index.js +0 -18
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import PropTypes, { ReactNodeLike } from 'prop-types';
8
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import React, { ReactNode } from 'react';
9
9
  import { PolymorphicProps } from '../../types/common';
10
10
  import { SIZES, TYPES } from './Tag';
11
11
  export interface DismissibleTagBaseProps {
@@ -42,7 +42,7 @@ export interface DismissibleTagBaseProps {
42
42
  /**
43
43
  * **Experimental:** Provide a `Slug` component to be rendered inside the `DismissibleTag` component
44
44
  */
45
- slug?: ReactNodeLike;
45
+ slug?: ReactNode;
46
46
  /**
47
47
  * Text to show on clear filters
48
48
  */
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import PropTypes, { ReactNodeLike } from 'prop-types';
8
- import React, { MouseEventHandler } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import React, { MouseEventHandler, ReactNode } from 'react';
9
9
  import { PolymorphicProps } from '../../types/common';
10
10
  import { SIZES } from './Tag';
11
11
  declare const TYPES: {
@@ -51,7 +51,7 @@ export interface OperationalTagBaseProps {
51
51
  /**
52
52
  * **Experimental:** Provide a `Slug` component to be rendered inside the `OperationalTag` component
53
53
  */
54
- slug?: ReactNodeLike;
54
+ slug?: ReactNode;
55
55
  /**
56
56
  * Specify the type of the `Tag`
57
57
  */
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import PropTypes, { ReactNodeLike } from 'prop-types';
8
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import React, { ReactNode } from 'react';
9
9
  import { PolymorphicProps } from '../../types/common';
10
10
  import { SIZES } from './Tag';
11
11
  export interface SelectableTagBaseProps {
@@ -42,7 +42,7 @@ export interface SelectableTagBaseProps {
42
42
  /**
43
43
  * **Experimental:** Provide a `Slug` component to be rendered inside the `SelectableTag` component
44
44
  */
45
- slug?: ReactNodeLike;
45
+ slug?: ReactNode;
46
46
  }
47
47
  export type SelectableTagProps<T extends React.ElementType> = PolymorphicProps<T, SelectableTagBaseProps>;
48
48
  declare const SelectableTag: {
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import PropTypes, { ReactNodeLike } from 'prop-types';
8
- import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import React, { ReactNode } from 'react';
9
9
  import { PolymorphicProps } from '../../types/common';
10
10
  export declare const TYPES: {
11
11
  red: string;
@@ -64,7 +64,7 @@ export interface TagBaseProps {
64
64
  /**
65
65
  * **Experimental:** Provide a `Slug` component to be rendered inside the `Tag` component
66
66
  */
67
- slug?: ReactNodeLike;
67
+ slug?: ReactNode;
68
68
  /**
69
69
  * @deprecated This property is deprecated and will be removed in the next major version. Use DismissibleTag instead.
70
70
  */
@@ -4,8 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { ReactNodeLike } from 'prop-types';
8
- import React from 'react';
7
+ import React, { ReactNode } from 'react';
9
8
  export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaElement> {
10
9
  /**
11
10
  * Provide a custom className that is applied directly to the underlying
@@ -31,7 +30,7 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
31
30
  /**
32
31
  * Provide text that is used alongside the control label for additional help
33
32
  */
34
- helperText?: ReactNodeLike;
33
+ helperText?: ReactNode;
35
34
  /**
36
35
  * Specify whether you want the underlying label to be visually hidden
37
36
  */
@@ -47,12 +46,12 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
47
46
  /**
48
47
  * Provide the text that is displayed when the control is in an invalid state
49
48
  */
50
- invalidText?: ReactNodeLike;
49
+ invalidText?: ReactNode;
51
50
  /**
52
51
  * Provide the text that will be read by a screen reader when visiting this
53
52
  * control
54
53
  */
55
- labelText: ReactNodeLike;
54
+ labelText: ReactNode;
56
55
  /**
57
56
  * @deprecated
58
57
  * `true` to use the light version. For use on $ui-01 backgrounds only.
@@ -93,7 +92,7 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
93
92
  /**
94
93
  * **Experimental**: Provide a `Slug` component to be rendered inside the `TextArea` component
95
94
  */
96
- slug?: ReactNodeLike;
95
+ slug?: ReactNode;
97
96
  /**
98
97
  * Provide the current value of the `<textarea>`
99
98
  */
@@ -105,7 +104,7 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
105
104
  /**
106
105
  * Provide the text that is displayed when the control is in warning state
107
106
  */
108
- warnText?: ReactNodeLike;
107
+ warnText?: ReactNode;
109
108
  /**
110
109
  * Specify the method used for calculating the counter number
111
110
  */
@@ -1,5 +1,4 @@
1
- import React, { InputHTMLAttributes } from 'react';
2
- import { ReactNodeLike } from 'prop-types';
1
+ import React, { InputHTMLAttributes, ReactNode } from 'react';
3
2
  type ExcludedAttributes = 'size';
4
3
  export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
5
4
  /**
@@ -21,7 +20,7 @@ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputEl
21
20
  /**
22
21
  * Provide text that is used alongside the control label for additional help
23
22
  */
24
- helperText?: ReactNodeLike;
23
+ helperText?: ReactNode;
25
24
  /**
26
25
  * Specify whether or not the underlying label is visually hidden
27
26
  */
@@ -45,11 +44,11 @@ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputEl
45
44
  /**
46
45
  * Provide the text that is displayed when the control is in an invalid state
47
46
  */
48
- invalidText?: ReactNodeLike;
47
+ invalidText?: ReactNode;
49
48
  /**
50
49
  * Provide the text that will be read by a screen reader when visiting this control
51
50
  */
52
- labelText: ReactNodeLike;
51
+ labelText: ReactNode;
53
52
  /**
54
53
  * @deprecated The `light` prop for `PasswordInput` has been deprecated in favor of the new `Layer` component. It will be removed in the next major release.
55
54
  * `true` to use the light version. For use on $ui-01 backgrounds only.
@@ -119,7 +118,7 @@ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputEl
119
118
  /**
120
119
  * Provide the text that is displayed when the control is in warning state
121
120
  */
122
- warnText?: ReactNodeLike;
121
+ warnText?: ReactNode;
123
122
  }
124
123
  declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<unknown>>;
125
124
  export default PasswordInput;
@@ -149,10 +149,10 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
149
149
  align = tooltipPosition;
150
150
  }
151
151
  if (tooltipAlignment === 'end') {
152
- align = `${tooltipPosition}-right`;
152
+ align = `${tooltipPosition}-end`;
153
153
  }
154
154
  if (tooltipAlignment === 'start') {
155
- align = `${tooltipPosition}-left`;
155
+ align = `${tooltipPosition}-start`;
156
156
  }
157
157
  }
158
158
  if (tooltipPosition === 'right' || tooltipPosition === 'left') {
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { ReactNodeLike } from 'prop-types';
8
7
  import React, { ReactNode } from 'react';
9
8
  type ExcludedAttributes = 'defaultValue' | 'id' | 'size' | 'value';
10
9
  export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
@@ -89,7 +88,7 @@ export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
89
88
  /**
90
89
  * **Experimental**: Provide a `Slug` component to be rendered inside the `TextInput` component
91
90
  */
92
- slug?: ReactNodeLike;
91
+ slug?: ReactNode;
93
92
  /**
94
93
  * Specify the type of the `<input>`
95
94
  */
@@ -49,4 +49,5 @@ export declare namespace Theme {
49
49
  * Get access to the current theme
50
50
  */
51
51
  export declare function useTheme(): GlobalThemeProps;
52
+ export declare function usePrefersDarkScheme(): boolean;
52
53
  export {};
@@ -15,6 +15,7 @@ var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
16
  var usePrefix = require('../../internal/usePrefix.js');
17
17
  var LayerContext = require('../Layer/LayerContext.js');
18
+ var useMatchMedia = require('../../internal/useMatchMedia.js');
18
19
 
19
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
21
 
@@ -72,8 +73,10 @@ function Theme(_ref2) {
72
73
  [`${prefix}--layer-one`]: true
73
74
  });
74
75
  const value = React__default["default"].useMemo(() => {
76
+ const isDark = theme && ['g90', 'g100'].includes(theme);
75
77
  return {
76
- theme
78
+ theme,
79
+ isDark
77
80
  };
78
81
  }, [theme]);
79
82
  const BaseComponentAsAny = BaseComponent;
@@ -112,8 +115,12 @@ Theme.propTypes = {
112
115
  function useTheme() {
113
116
  return React__default["default"].useContext(ThemeContext);
114
117
  }
118
+ function usePrefersDarkScheme() {
119
+ return useMatchMedia.useMatchMedia('(prefers-color-scheme: dark)');
120
+ }
115
121
 
116
122
  exports.GlobalTheme = GlobalTheme;
117
123
  exports.Theme = Theme;
118
124
  exports.ThemeContext = ThemeContext;
125
+ exports.usePrefersDarkScheme = usePrefersDarkScheme;
119
126
  exports.useTheme = useTheme;
@@ -1,5 +1,4 @@
1
1
  import React, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ChangeEvent, type ComponentType } from 'react';
2
- import { ReactNodeLike } from 'prop-types';
3
2
  export interface TileProps extends HTMLAttributes<HTMLDivElement> {
4
3
  children?: ReactNode;
5
4
  className?: string;
@@ -13,7 +12,7 @@ export interface TileProps extends HTMLAttributes<HTMLDivElement> {
13
12
  /**
14
13
  * **Experimental**: Provide a `Slug` component to be rendered inside the `SelectableTile` component
15
14
  */
16
- slug?: ReactNodeLike;
15
+ slug?: ReactNode;
17
16
  }
18
17
  export declare const Tile: React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLDivElement>>;
19
18
  export interface ClickableTileProps extends HTMLAttributes<HTMLAnchorElement> {
@@ -104,7 +103,7 @@ export interface SelectableTileProps extends HTMLAttributes<HTMLDivElement> {
104
103
  /**
105
104
  * **Experimental**: Provide a `Slug` component to be rendered inside the `SelectableTile` component
106
105
  */
107
- slug?: ReactNodeLike;
106
+ slug?: ReactNode;
108
107
  /**
109
108
  * Specify the tab index of the wrapper element
110
109
  */
@@ -149,7 +148,7 @@ export interface ExpandableTileProps extends HTMLAttributes<HTMLDivElement> {
149
148
  /**
150
149
  * **Experimental**: Provide a `Slug` component to be rendered inside the `ExpandableTile` component
151
150
  */
152
- slug?: ReactNodeLike;
151
+ slug?: ReactNode;
153
152
  /**
154
153
  * The `tabindex` attribute.
155
154
  */
@@ -4,14 +4,15 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import PropTypes, { ReactNodeLike } from 'prop-types';
7
+ import PropTypes from 'prop-types';
8
+ import { ReactNode } from 'react';
8
9
  import { ReactAttr } from '../../types/common';
9
10
  type ExcludedAttributes = 'onChange';
10
11
  export interface TileGroupProps extends Omit<ReactAttr<HTMLFieldSetElement>, ExcludedAttributes> {
11
12
  /**
12
13
  * Provide a collection of <RadioTile> components to render in the group
13
14
  */
14
- children?: ReactNodeLike;
15
+ children?: ReactNode;
15
16
  /**
16
17
  * Provide an optional className to be applied to the container node
17
18
  */
@@ -0,0 +1,9 @@
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 TileGroup from './TileGroup';
8
+ export default TileGroup;
9
+ export { TileGroup };
@@ -99,7 +99,7 @@ function Toggle(_ref) {
99
99
  role: "switch",
100
100
  type: "button",
101
101
  "aria-checked": checked,
102
- "aria-labelledby": ariaLabelledby ?? labelId,
102
+ "aria-labelledby": ariaLabelledby ?? (labelText ? labelId : undefined),
103
103
  disabled: disabled,
104
104
  onClick: handleClick
105
105
  })), /*#__PURE__*/React__default["default"].createElement(LabelComponent, {
@@ -28,7 +28,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
28
 
29
29
  const DefinitionTooltip = _ref => {
30
30
  let {
31
- align = 'bottom-left',
31
+ align = 'bottom-start',
32
32
  className,
33
33
  children,
34
34
  definition,
package/lib/index.js CHANGED
@@ -84,6 +84,8 @@ var OverflowMenuItem = require('./components/OverflowMenuItem/OverflowMenuItem.j
84
84
  var Pagination$1 = require('./components/Pagination/Pagination.js');
85
85
  var Pagination_Skeleton = require('./components/Pagination/Pagination.Skeleton.js');
86
86
  var PaginationNav = require('./components/PaginationNav/PaginationNav.js');
87
+ var ControlledPasswordInput = require('./components/TextInput/ControlledPasswordInput.js');
88
+ var PasswordInput = require('./components/TextInput/PasswordInput.js');
87
89
  var PrimaryButton = require('./components/PrimaryButton/PrimaryButton.js');
88
90
  var ProgressIndicator_Skeleton = require('./components/ProgressIndicator/ProgressIndicator.Skeleton.js');
89
91
  var ProgressIndicator = require('./components/ProgressIndicator/ProgressIndicator.js');
@@ -121,13 +123,13 @@ var TextArea = require('./components/TextArea/TextArea.js');
121
123
  var TextArea_Skeleton = require('./components/TextArea/TextArea.Skeleton.js');
122
124
  require('./components/TextInput/index.js');
123
125
  var Tile = require('./components/Tile/Tile.js');
124
- var index$b = require('./components/TileGroup/index.js');
126
+ var TileGroup = require('./components/TileGroup/TileGroup.js');
125
127
  var TimePicker = require('./components/TimePicker/TimePicker.js');
126
128
  var TimePickerSelect = require('./components/TimePickerSelect/TimePickerSelect.js');
127
129
  var Toggle = require('./components/Toggle/Toggle.js');
128
130
  var Toggle_Skeleton = require('./components/Toggle/Toggle.Skeleton.js');
129
131
  var ToggleSmall_Skeleton = require('./components/ToggleSmall/ToggleSmall.Skeleton.js');
130
- var index$c = require('./components/Toggletip/index.js');
132
+ var index$b = require('./components/Toggletip/index.js');
131
133
  var Content = require('./components/UIShell/Content.js');
132
134
  var Header = require('./components/UIShell/Header.js');
133
135
  var HeaderContainer = require('./components/UIShell/HeaderContainer.js');
@@ -159,12 +161,12 @@ var SideNavMenuItem = require('./components/UIShell/SideNavMenuItem.js');
159
161
  var SideNavSwitcher = require('./components/UIShell/SideNavSwitcher.js');
160
162
  var UnorderedList = require('./components/UnorderedList/UnorderedList.js');
161
163
  var index = require('./components/FeatureFlags/index.js');
162
- var index$d = require('./components/Heading/index.js');
163
- var index$e = require('./components/IconButton/index.js');
164
- var index$f = require('./components/Layer/index.js');
164
+ var index$c = require('./components/Heading/index.js');
165
+ var index$d = require('./components/IconButton/index.js');
166
+ var index$e = require('./components/Layer/index.js');
165
167
  var index$1 = require('./components/Layout/index.js');
166
168
  var index$2 = require('./components/OverflowMenuV2/index.js');
167
- var index$g = require('./components/Popover/index.js');
169
+ var index$f = require('./components/Popover/index.js');
168
170
  var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
169
171
  var index$3 = require('./components/Slug/index.js');
170
172
  var AiSkeletonPlaceholder = require('./components/AiSkeleton/AiSkeletonPlaceholder.js');
@@ -173,7 +175,7 @@ var AiSkeletonText = require('./components/AiSkeleton/AiSkeletonText.js');
173
175
  var DefinitionTooltip = require('./components/Tooltip/DefinitionTooltip.js');
174
176
  var Tooltip = require('./components/Tooltip/Tooltip.js');
175
177
  require('./components/Text/index.js');
176
- var index$h = require('./components/Theme/index.js');
178
+ var index$g = require('./components/Theme/index.js');
177
179
  var usePrefix = require('./internal/usePrefix.js');
178
180
  var useIdPrefix = require('./internal/useIdPrefix.js');
179
181
  var FluidDatePicker_Skeleton = require('./components/FluidDatePicker/FluidDatePicker.Skeleton.js');
@@ -234,8 +236,6 @@ var TableToolbarSearch = require('./components/DataTable/TableToolbarSearch.js')
234
236
  var TableToolbarMenu = require('./components/DataTable/TableToolbarMenu.js');
235
237
  var FilterableMultiSelect = require('./components/MultiSelect/FilterableMultiSelect.js');
236
238
  var MultiSelect = require('./components/MultiSelect/MultiSelect.js');
237
- var ControlledPasswordInput = require('./components/TextInput/ControlledPasswordInput.js');
238
- var PasswordInput = require('./components/TextInput/PasswordInput.js');
239
239
  var TreeNode = require('./components/TreeView/TreeNode.js');
240
240
 
241
241
 
@@ -325,6 +325,8 @@ exports.OverflowMenuItem = OverflowMenuItem["default"];
325
325
  exports.Pagination = Pagination$1["default"];
326
326
  exports.PaginationSkeleton = Pagination_Skeleton["default"];
327
327
  exports.PaginationNav = PaginationNav["default"];
328
+ exports.ControlledPasswordInput = ControlledPasswordInput["default"];
329
+ exports.PasswordInput = PasswordInput["default"];
328
330
  exports.PrimaryButton = PrimaryButton["default"];
329
331
  exports.ProgressIndicatorSkeleton = ProgressIndicator_Skeleton["default"];
330
332
  exports.ProgressIndicator = ProgressIndicator.ProgressIndicator;
@@ -377,17 +379,17 @@ exports.SelectableTile = Tile.SelectableTile;
377
379
  exports.Tile = Tile.Tile;
378
380
  exports.TileAboveTheFoldContent = Tile.TileAboveTheFoldContent;
379
381
  exports.TileBelowTheFoldContent = Tile.TileBelowTheFoldContent;
380
- exports.TileGroup = index$b["default"];
382
+ exports.TileGroup = TileGroup["default"];
381
383
  exports.TimePicker = TimePicker["default"];
382
384
  exports.TimePickerSelect = TimePickerSelect["default"];
383
385
  exports.Toggle = Toggle.Toggle;
384
386
  exports.ToggleSkeleton = Toggle_Skeleton["default"];
385
387
  exports.ToggleSmallSkeleton = ToggleSmall_Skeleton["default"];
386
- exports.Toggletip = index$c.Toggletip;
387
- exports.ToggletipActions = index$c.ToggletipActions;
388
- exports.ToggletipButton = index$c.ToggletipButton;
389
- exports.ToggletipContent = index$c.ToggletipContent;
390
- exports.ToggletipLabel = index$c.ToggletipLabel;
388
+ exports.Toggletip = index$b.Toggletip;
389
+ exports.ToggletipActions = index$b.ToggletipActions;
390
+ exports.ToggletipButton = index$b.ToggletipButton;
391
+ exports.ToggletipContent = index$b.ToggletipContent;
392
+ exports.ToggletipLabel = index$b.ToggletipLabel;
391
393
  exports.Content = Content["default"];
392
394
  exports.Header = Header["default"];
393
395
  exports.HeaderContainer = HeaderContainer["default"];
@@ -421,16 +423,16 @@ exports.UnorderedList = UnorderedList["default"];
421
423
  exports.unstable_FeatureFlags = index.FeatureFlags;
422
424
  exports.unstable_useFeatureFlag = index.useFeatureFlag;
423
425
  exports.unstable_useFeatureFlags = index.useFeatureFlags;
424
- exports.Heading = index$d.Heading;
425
- exports.Section = index$d.Section;
426
- exports.IconButton = index$e.IconButton;
427
- exports.IconButtonKinds = index$e.IconButtonKinds;
428
- exports.Layer = index$f.Layer;
429
- exports.useLayer = index$f.useLayer;
426
+ exports.Heading = index$c.Heading;
427
+ exports.Section = index$c.Section;
428
+ exports.IconButton = index$d.IconButton;
429
+ exports.IconButtonKinds = index$d.IconButtonKinds;
430
+ exports.Layer = index$e.Layer;
431
+ exports.useLayer = index$e.useLayer;
430
432
  exports.unstable_Layout = index$1.Layout;
431
433
  exports.unstable_OverflowMenuV2 = index$2.OverflowMenuV2;
432
- exports.Popover = index$g.Popover;
433
- exports.PopoverContent = index$g.PopoverContent;
434
+ exports.Popover = index$f.Popover;
435
+ exports.PopoverContent = index$f.PopoverContent;
434
436
  exports.ProgressBar = ProgressBar["default"];
435
437
  exports.unstable__Slug = index$3.Slug;
436
438
  exports.unstable__SlugActions = index$3.SlugActions;
@@ -440,10 +442,11 @@ exports.unstable__AiSkeletonIcon = AiSkeletonIcon["default"];
440
442
  exports.unstable__AiSkeletonText = AiSkeletonText["default"];
441
443
  exports.DefinitionTooltip = DefinitionTooltip.DefinitionTooltip;
442
444
  exports.Tooltip = Tooltip.Tooltip;
443
- exports.GlobalTheme = index$h.GlobalTheme;
444
- exports.Theme = index$h.Theme;
445
- exports.ThemeContext = index$h.ThemeContext;
446
- exports.useTheme = index$h.useTheme;
445
+ exports.GlobalTheme = index$g.GlobalTheme;
446
+ exports.Theme = index$g.Theme;
447
+ exports.ThemeContext = index$g.ThemeContext;
448
+ exports.usePrefersDarkScheme = index$g.usePrefersDarkScheme;
449
+ exports.useTheme = index$g.useTheme;
447
450
  exports.PrefixContext = usePrefix.PrefixContext;
448
451
  exports.usePrefix = usePrefix.usePrefix;
449
452
  exports.useIdPrefix = useIdPrefix.useIdPrefix;
@@ -505,6 +508,4 @@ exports.TableToolbarSearch = TableToolbarSearch["default"];
505
508
  exports.TableToolbarMenu = TableToolbarMenu["default"];
506
509
  exports.FilterableMultiSelect = FilterableMultiSelect["default"];
507
510
  exports.MultiSelect = MultiSelect["default"];
508
- exports.ControlledPasswordInput = ControlledPasswordInput["default"];
509
- exports.PasswordInput = PasswordInput["default"];
510
511
  exports.TreeNode = TreeNode["default"];
@@ -0,0 +1,39 @@
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var warning = require('../internal/warning.js');
13
+
14
+ const didWarnAboutDeprecation = {};
15
+ function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
16
+ return function checker(props, propName, componentName) {
17
+ if (props[propName] === undefined) {
18
+ return;
19
+ }
20
+ if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
21
+ didWarnAboutDeprecation[componentName] = {
22
+ ...didWarnAboutDeprecation[componentName],
23
+ [propName]: true
24
+ };
25
+ const deprecatedValue = props[propName];
26
+ const newValue = propMappingFunction ? propMappingFunction(deprecatedValue) : null;
27
+ if (allowedValues && !allowedValues.includes(deprecatedValue)) {
28
+ const message = propMappingFunction ? `"${deprecatedValue}" is a deprecated value for the "${propName}" prop on the "${componentName}" component. Use "${newValue}" instead. "${deprecatedValue}" will be removed in the next major release.` : `"${deprecatedValue}" is a deprecated value for the "${propName}" prop on the "${componentName}" component. Allowed values is/are: ${allowedValues.join(', ')}. "${deprecatedValue}" will be removed in the next major release. `;
29
+ process.env.NODE_ENV !== "production" ? warning.warning(false, message) : void 0;
30
+ }
31
+ }
32
+ for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
33
+ rest[_key - 3] = arguments[_key];
34
+ }
35
+ return propType(props, propName, componentName, ...rest);
36
+ };
37
+ }
38
+
39
+ exports["default"] = deprecateValuesWithin;
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.57.0",
4
+ "version": "1.58.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -49,9 +49,9 @@
49
49
  "dependencies": {
50
50
  "@babel/runtime": "^7.18.3",
51
51
  "@carbon/feature-flags": "^0.20.0",
52
- "@carbon/icons-react": "^11.41.0",
52
+ "@carbon/icons-react": "^11.42.0-rc.0",
53
53
  "@carbon/layout": "^11.22.0",
54
- "@carbon/styles": "^1.57.0",
54
+ "@carbon/styles": "^1.58.0-rc.0",
55
55
  "@floating-ui/react": "^0.26.0",
56
56
  "@ibm/telemetry-js": "^1.5.0",
57
57
  "classnames": "2.5.1",
@@ -123,7 +123,7 @@
123
123
  "sass": "^1.51.0",
124
124
  "sass-loader": "^14.0.0",
125
125
  "storybook": "^7.1.0",
126
- "storybook-addon-accessibility-checker": "^3.1.61-rc.2",
126
+ "storybook-addon-accessibility-checker": "^3.1.61-rc.3",
127
127
  "stream-browserify": "^3.0.0",
128
128
  "style-loader": "^3.3.1",
129
129
  "typescript-config-carbon": "^0.2.0",
@@ -141,5 +141,5 @@
141
141
  "**/*.scss",
142
142
  "**/*.css"
143
143
  ],
144
- "gitHead": "e4922a44b2110b9dcb71da21ff6c0c9bb95610e0"
144
+ "gitHead": "23f19271f964a10a9fbc4616a43b05f5cc14e7d1"
145
145
  }
@@ -1,13 +0,0 @@
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
-
8
- import { createClassWrapper } from '../../internal/createClassWrapper.js';
9
- import TileGroup$1 from './TileGroup.js';
10
-
11
- const TileGroup = createClassWrapper(TileGroup$1);
12
-
13
- export { TileGroup, TileGroup as default };
@@ -1,18 +0,0 @@
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
-
8
- 'use strict';
9
-
10
- Object.defineProperty(exports, '__esModule', { value: true });
11
-
12
- var createClassWrapper = require('../../internal/createClassWrapper.js');
13
- var TileGroup$1 = require('./TileGroup.js');
14
-
15
- const TileGroup = createClassWrapper.createClassWrapper(TileGroup$1["default"]);
16
-
17
- exports.TileGroup = TileGroup;
18
- exports["default"] = TileGroup;