@carbon/react 1.57.0 → 1.58.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 (156) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1106 -990
  2. package/es/components/Accordion/Accordion.d.ts +1 -1
  3. package/es/components/Accordion/index.d.ts +2 -2
  4. package/es/components/Button/Button.js +2 -2
  5. package/es/components/Button/index.d.ts +2 -1
  6. package/es/components/Checkbox/Checkbox.d.ts +6 -7
  7. package/es/components/ComboBox/ComboBox.d.ts +4 -5
  8. package/es/components/ComboBox/ComboBox.js +268 -261
  9. package/es/components/ComposedModal/ComposedModal.d.ts +1 -2
  10. package/es/components/DataTable/TableHeader.d.ts +4 -5
  11. package/es/components/DataTable/TableSlugRow.d.ts +3 -2
  12. package/es/components/DatePicker/DatePicker.d.ts +4 -5
  13. package/es/components/Dropdown/Dropdown.d.ts +6 -7
  14. package/es/components/Dropdown/index.d.ts +2 -2
  15. package/es/components/FormLabel/index.d.ts +2 -2
  16. package/es/components/Grid/Column.d.ts +2 -2
  17. package/es/components/Grid/GridTypes.d.ts +1 -2
  18. package/es/components/Grid/index.d.ts +3 -1
  19. package/es/components/IconButton/index.d.ts +3 -4
  20. package/es/components/InlineLoading/index.d.ts +2 -2
  21. package/es/components/ListBox/next/ListBoxTrigger.js +1 -0
  22. package/es/components/Loading/index.d.ts +2 -2
  23. package/es/components/Menu/Menu.js +1 -1
  24. package/es/components/Menu/MenuItem.js +13 -2
  25. package/es/components/Modal/Modal.d.ts +8 -9
  26. package/es/components/Modal/index.d.ts +2 -2
  27. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -2
  28. package/es/components/MultiSelect/MultiSelect.d.ts +10 -9
  29. package/es/components/Notification/Notification.d.ts +2 -2
  30. package/es/components/NumberInput/NumberInput.d.ts +12 -2
  31. package/es/components/NumberInput/NumberInput.js +2 -2
  32. package/es/components/NumberInput/index.d.ts +1 -1
  33. package/es/components/OverflowMenu/OverflowMenu.d.ts +10 -6
  34. package/es/components/OverflowMenu/index.d.ts +13 -0
  35. package/es/components/PasswordInput/index.d.ts +3 -0
  36. package/es/components/Popover/index.d.ts +8 -2
  37. package/es/components/Popover/index.js +26 -1
  38. package/es/components/ProgressBar/ProgressBar.d.ts +1 -1
  39. package/es/components/ProgressBar/index.d.ts +2 -2
  40. package/es/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
  41. package/es/components/ProgressIndicator/index.d.ts +2 -0
  42. package/es/components/RadioButton/RadioButton.d.ts +3 -4
  43. package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +7 -8
  44. package/es/components/Select/Select.d.ts +1 -2
  45. package/es/components/Slider/Slider.d.ts +5 -5
  46. package/es/components/Slider/Slider.js +1 -1
  47. package/es/components/StructuredList/index.d.ts +2 -0
  48. package/es/components/Switch/Switch.d.ts +1 -1
  49. package/es/components/Switch/index.d.ts +2 -2
  50. package/es/components/Tab/index.d.ts +2 -1
  51. package/es/components/Tag/DismissibleTag.d.ts +12 -12
  52. package/es/components/Tag/DismissibleTag.js +34 -9
  53. package/es/components/Tag/OperationalTag.d.ts +12 -12
  54. package/es/components/Tag/OperationalTag.js +45 -9
  55. package/es/components/Tag/SelectableTag.d.ts +12 -12
  56. package/es/components/Tag/SelectableTag.js +46 -10
  57. package/es/components/Tag/Tag.d.ts +3 -3
  58. package/es/components/Tag/Tag.js +31 -5
  59. package/es/components/TextArea/TextArea.d.ts +6 -7
  60. package/es/components/TextArea/index.d.ts +2 -2
  61. package/es/components/TextInput/PasswordInput.d.ts +5 -6
  62. package/es/components/TextInput/PasswordInput.js +2 -2
  63. package/es/components/TextInput/TextInput.d.ts +1 -2
  64. package/es/components/TextInput/index.d.ts +4 -2
  65. package/es/components/Theme/index.d.ts +1 -0
  66. package/es/components/Theme/index.js +8 -2
  67. package/es/components/Tile/Tile.d.ts +3 -4
  68. package/es/components/TileGroup/TileGroup.d.ts +3 -2
  69. package/es/components/TileGroup/index.d.ts +9 -0
  70. package/es/components/Toggle/Toggle.js +1 -1
  71. package/es/components/Tooltip/DefinitionTooltip.js +1 -1
  72. package/es/components/Tooltip/Tooltip.js +16 -5
  73. package/es/components/Tooltip/index.d.ts +2 -2
  74. package/es/components/UnorderedList/UnorderedList.d.ts +1 -1
  75. package/es/components/UnorderedList/index.d.ts +1 -0
  76. package/es/index.js +4 -4
  77. package/es/prop-types/deprecateValuesWithin.js +35 -0
  78. package/lib/components/Accordion/Accordion.d.ts +1 -1
  79. package/lib/components/Accordion/index.d.ts +2 -2
  80. package/lib/components/Button/Button.js +2 -2
  81. package/lib/components/Button/index.d.ts +2 -1
  82. package/lib/components/Checkbox/Checkbox.d.ts +6 -7
  83. package/lib/components/ComboBox/ComboBox.d.ts +4 -5
  84. package/lib/components/ComboBox/ComboBox.js +267 -261
  85. package/lib/components/ComposedModal/ComposedModal.d.ts +1 -2
  86. package/lib/components/DataTable/TableHeader.d.ts +4 -5
  87. package/lib/components/DataTable/TableSlugRow.d.ts +3 -2
  88. package/lib/components/DatePicker/DatePicker.d.ts +4 -5
  89. package/lib/components/Dropdown/Dropdown.d.ts +6 -7
  90. package/lib/components/Dropdown/index.d.ts +2 -2
  91. package/lib/components/FormLabel/index.d.ts +2 -2
  92. package/lib/components/Grid/Column.d.ts +2 -2
  93. package/lib/components/Grid/GridTypes.d.ts +1 -2
  94. package/lib/components/Grid/index.d.ts +3 -1
  95. package/lib/components/IconButton/index.d.ts +3 -4
  96. package/lib/components/InlineLoading/index.d.ts +2 -2
  97. package/lib/components/ListBox/next/ListBoxTrigger.js +1 -0
  98. package/lib/components/Loading/index.d.ts +2 -2
  99. package/lib/components/Menu/Menu.js +1 -1
  100. package/lib/components/Menu/MenuItem.js +13 -2
  101. package/lib/components/Modal/Modal.d.ts +8 -9
  102. package/lib/components/Modal/index.d.ts +2 -2
  103. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -2
  104. package/lib/components/MultiSelect/MultiSelect.d.ts +10 -9
  105. package/lib/components/Notification/Notification.d.ts +2 -2
  106. package/lib/components/NumberInput/NumberInput.d.ts +12 -2
  107. package/lib/components/NumberInput/NumberInput.js +2 -2
  108. package/lib/components/NumberInput/index.d.ts +1 -1
  109. package/lib/components/OverflowMenu/OverflowMenu.d.ts +10 -6
  110. package/lib/components/OverflowMenu/index.d.ts +13 -0
  111. package/lib/components/PasswordInput/index.d.ts +3 -0
  112. package/lib/components/Popover/index.d.ts +8 -2
  113. package/lib/components/Popover/index.js +26 -1
  114. package/lib/components/ProgressBar/ProgressBar.d.ts +1 -1
  115. package/lib/components/ProgressBar/index.d.ts +2 -2
  116. package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
  117. package/lib/components/ProgressIndicator/index.d.ts +2 -0
  118. package/lib/components/RadioButton/RadioButton.d.ts +3 -4
  119. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +7 -8
  120. package/lib/components/Select/Select.d.ts +1 -2
  121. package/lib/components/Slider/Slider.d.ts +5 -5
  122. package/lib/components/Slider/Slider.js +1 -1
  123. package/lib/components/StructuredList/index.d.ts +2 -0
  124. package/lib/components/Switch/Switch.d.ts +1 -1
  125. package/lib/components/Switch/index.d.ts +2 -2
  126. package/lib/components/Tab/index.d.ts +2 -1
  127. package/lib/components/Tag/DismissibleTag.d.ts +12 -12
  128. package/lib/components/Tag/DismissibleTag.js +33 -8
  129. package/lib/components/Tag/OperationalTag.d.ts +12 -12
  130. package/lib/components/Tag/OperationalTag.js +44 -8
  131. package/lib/components/Tag/SelectableTag.d.ts +12 -12
  132. package/lib/components/Tag/SelectableTag.js +45 -9
  133. package/lib/components/Tag/Tag.d.ts +3 -3
  134. package/lib/components/Tag/Tag.js +30 -4
  135. package/lib/components/TextArea/TextArea.d.ts +6 -7
  136. package/lib/components/TextArea/index.d.ts +2 -2
  137. package/lib/components/TextInput/PasswordInput.d.ts +5 -6
  138. package/lib/components/TextInput/PasswordInput.js +2 -2
  139. package/lib/components/TextInput/TextInput.d.ts +1 -2
  140. package/lib/components/TextInput/index.d.ts +4 -2
  141. package/lib/components/Theme/index.d.ts +1 -0
  142. package/lib/components/Theme/index.js +8 -1
  143. package/lib/components/Tile/Tile.d.ts +3 -4
  144. package/lib/components/TileGroup/TileGroup.d.ts +3 -2
  145. package/lib/components/TileGroup/index.d.ts +9 -0
  146. package/lib/components/Toggle/Toggle.js +1 -1
  147. package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
  148. package/lib/components/Tooltip/Tooltip.js +16 -5
  149. package/lib/components/Tooltip/index.d.ts +2 -2
  150. package/lib/components/UnorderedList/UnorderedList.d.ts +1 -1
  151. package/lib/components/UnorderedList/index.d.ts +1 -0
  152. package/lib/index.js +30 -29
  153. package/lib/prop-types/deprecateValuesWithin.js +39 -0
  154. package/package.json +6 -6
  155. package/es/components/TileGroup/index.js +0 -13
  156. package/lib/components/TileGroup/index.js +0 -18
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { PropsWithChildren } from 'react';
9
- interface AccordionProps {
9
+ export interface AccordionProps {
10
10
  /**
11
11
  * Specify the alignment of the accordion heading
12
12
  * title and chevron. Defaults to `end`.
@@ -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 Accordion from './Accordion';
7
+ import Accordion, { type AccordionProps } from './Accordion';
8
8
  export default Accordion;
9
- export { Accordion };
9
+ export { Accordion, type AccordionProps };
10
10
  export { default as AccordionItem } from './AccordionItem';
11
11
  export { default as AccordionSkeleton } from './Accordion.Skeleton';
@@ -64,10 +64,10 @@ const Button = /*#__PURE__*/React__default.forwardRef(function Button(props, ref
64
64
  align = tooltipPosition;
65
65
  }
66
66
  if (tooltipAlignment === 'end') {
67
- align = `${tooltipPosition}-right`;
67
+ align = `${tooltipPosition}-end`;
68
68
  }
69
69
  if (tooltipAlignment === 'start') {
70
- align = `${tooltipPosition}-left`;
70
+ align = `${tooltipPosition}-start`;
71
71
  }
72
72
  }
73
73
  if (tooltipPosition === 'right' || tooltipPosition === 'left') {
@@ -5,7 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import Button from './Button';
8
+ import { type ButtonProps } from './Button';
8
9
  export default Button;
9
- export { Button };
10
+ export { Button, type ButtonProps };
10
11
  export * from './Button';
11
12
  export { default as ButtonSkeleton } from './Button.Skeleton';
@@ -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
  type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type';
10
9
  export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
11
10
  /**
@@ -16,7 +15,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
16
15
  * Provide a label to provide a description of the Checkbox input that you are
17
16
  * exposing to the user
18
17
  */
19
- labelText: NonNullable<ReactNodeLike>;
18
+ labelText: NonNullable<ReactNode>;
20
19
  /**
21
20
  * Specify whether the underlying input should be checked by default
22
21
  */
@@ -28,7 +27,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
28
27
  /**
29
28
  * Provide text for the form group for additional help
30
29
  */
31
- helperText?: React.ReactNode;
30
+ helperText?: ReactNode;
32
31
  /**
33
32
  * Specify whether the label should be hidden, or not
34
33
  */
@@ -44,11 +43,11 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
44
43
  /**
45
44
  * Provide the text that is displayed when the Checkbox is in an invalid state
46
45
  */
47
- invalidText?: React.ReactNode;
46
+ invalidText?: ReactNode;
48
47
  /**
49
48
  * **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
50
49
  */
51
- slug?: ReactNodeLike;
50
+ slug?: ReactNode;
52
51
  /**
53
52
  * Specify whether the Checkbox is currently invalid
54
53
  */
@@ -56,7 +55,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
56
55
  /**
57
56
  * Provide the text that is displayed when the Checkbox is in an invalid state
58
57
  */
59
- warnText?: React.ReactNode;
58
+ warnText?: ReactNode;
60
59
  /**
61
60
  * Provide an optional handler that is called when the internal state of
62
61
  * Checkbox changes. This handler is called with event and state info.
@@ -4,9 +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 Downshift from 'downshift';
8
- import { ReactNodeLike } from 'prop-types';
9
- import { type ComponentProps, type ReactNode, type ComponentType, type ReactElement, type RefAttributes, type PropsWithChildren, type PropsWithRef, type InputHTMLAttributes, type MouseEvent } from 'react';
7
+ import { UseComboboxProps } from 'downshift';
8
+ import { type ReactNode, type ComponentType, type ReactElement, type RefAttributes, type PropsWithChildren, type PropsWithRef, type InputHTMLAttributes, type MouseEvent } from 'react';
10
9
  import { ListBoxSize } from '../ListBox';
11
10
  type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type' | 'size';
12
11
  interface OnChangeData<ItemType> {
@@ -45,7 +44,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
45
44
  /**
46
45
  * Additional props passed to Downshift
47
46
  */
48
- downshiftProps?: ComponentProps<typeof Downshift<ItemType>>;
47
+ downshiftProps?: Partial<UseComboboxProps<ItemType>>;
49
48
  /**
50
49
  * Provide helper text that is used alongside the control label for
51
50
  * additional help
@@ -139,7 +138,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
139
138
  /**
140
139
  * **Experimental**: Provide a `Slug` component to be rendered inside the `ComboBox` component
141
140
  */
142
- slug?: ReactNodeLike;
141
+ slug?: ReactNode;
143
142
  /**
144
143
  * Provide text to be used in a `<label>` element that is tied to the
145
144
  * combobox via ARIA attributes.