@carbon/react 1.74.0 → 1.75.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 (172) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +794 -794
  2. package/es/components/AILabel/index.d.ts +1 -2
  3. package/es/components/AILabel/index.js +1 -1
  4. package/es/components/AISkeleton/AISkeletonIcon.d.ts +1 -1
  5. package/es/components/AISkeleton/AISkeletonText.d.ts +1 -1
  6. package/es/components/Accordion/Accordion.Skeleton.d.ts +1 -1
  7. package/es/components/Accordion/AccordionItem.d.ts +2 -2
  8. package/es/components/AspectRatio/AspectRatio.d.ts +1 -1
  9. package/es/components/Button/Button.d.ts +3 -3
  10. package/es/components/Button/Button.js +1 -1
  11. package/es/components/ClassPrefix/index.d.ts +1 -1
  12. package/es/components/ComboBox/ComboBox.d.ts +4 -4
  13. package/es/components/ComboBox/ComboBox.js +0 -1
  14. package/es/components/ComboButton/index.d.ts +1 -1
  15. package/es/components/ComposedModal/ModalFooter.d.ts +1 -2
  16. package/es/components/ComposedModal/ModalFooter.js +2 -2
  17. package/es/components/ComposedModal/ModalHeader.d.ts +1 -2
  18. package/es/components/ContainedList/ContainedList.d.ts +1 -1
  19. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +2 -3
  20. package/es/components/ContextMenu/useContextMenu.d.ts +1 -1
  21. package/es/components/Copy/Copy.d.ts +1 -1
  22. package/es/components/DataTable/TableCell.d.ts +1 -1
  23. package/es/components/DataTable/TableExpandHeader.d.ts +3 -3
  24. package/es/components/DataTable/TableExpandRow.d.ts +1 -1
  25. package/es/components/DataTable/TableExpandedRow.d.ts +1 -1
  26. package/es/components/DataTable/TableHeader.d.ts +1 -1
  27. package/es/components/DataTable/TableSelectAll.d.ts +1 -1
  28. package/es/components/Dropdown/Dropdown.js +11 -3
  29. package/es/components/ErrorBoundary/ErrorBoundary.d.ts +2 -3
  30. package/es/components/FeatureFlags/index.d.ts +1 -1
  31. package/es/components/FileUploader/FileUploader.d.ts +8 -7
  32. package/es/components/FileUploader/FileUploader.js +9 -2
  33. package/es/components/Form/Form.d.ts +1 -1
  34. package/es/components/FormItem/FormItem.d.ts +1 -1
  35. package/es/components/Heading/index.d.ts +1 -1
  36. package/es/components/IconButton/index.d.ts +1 -1
  37. package/es/components/IdPrefix/index.d.ts +1 -1
  38. package/es/components/Layer/index.d.ts +1 -2
  39. package/es/components/LayoutDirection/LayoutDirection.d.ts +1 -1
  40. package/es/components/Link/Link.d.ts +5 -4
  41. package/es/components/Link/Link.js +1 -1
  42. package/es/components/ListItem/ListItem.d.ts +1 -1
  43. package/es/components/Menu/Menu.d.ts +1 -1
  44. package/es/components/Modal/Modal.js +1 -1
  45. package/es/components/ModalWrapper/ModalWrapper.d.ts +1 -1
  46. package/es/components/MultiSelect/FilterableMultiSelect.js +4 -1
  47. package/es/components/MultiSelect/MultiSelect.js +10 -1
  48. package/es/components/OrderedList/OrderedList.d.ts +1 -1
  49. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  50. package/es/components/PaginationNav/PaginationNav.d.ts +52 -1
  51. package/es/components/Popover/index.d.ts +6 -2
  52. package/es/components/Portal/index.d.ts +1 -1
  53. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +1 -1
  54. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +1 -1
  55. package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
  56. package/es/components/Tabs/Tabs.d.ts +2 -2
  57. package/es/components/Tabs/Tabs.js +1 -1
  58. package/es/components/Tag/DismissibleTag.js +1 -1
  59. package/es/components/Tag/OperationalTag.js +1 -1
  60. package/es/components/Tag/SelectableTag.d.ts +2 -2
  61. package/es/components/Tag/SelectableTag.js +1 -1
  62. package/es/components/Tag/Tag.d.ts +7 -3
  63. package/es/components/Tag/Tag.js +1 -1
  64. package/es/components/Text/Text.d.ts +6 -4
  65. package/es/components/Text/Text.js +1 -1
  66. package/es/components/Theme/index.d.ts +1 -1
  67. package/es/components/Toggle/Toggle.Skeleton.d.ts +1 -1
  68. package/es/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +1 -1
  69. package/es/components/Toggletip/index.d.ts +4 -4
  70. package/es/components/UIShell/Content.d.ts +1 -1
  71. package/es/components/UIShell/Header.d.ts +1 -1
  72. package/es/components/UIShell/HeaderGlobalAction.d.ts +1 -1
  73. package/es/components/UIShell/HeaderMenu.d.ts +1 -1
  74. package/es/components/UIShell/HeaderPanel.d.ts +1 -1
  75. package/es/components/UIShell/SideNavHeader.d.ts +1 -1
  76. package/es/components/UIShell/SideNavIcon.d.ts +1 -1
  77. package/es/components/UIShell/SideNavItem.d.ts +1 -1
  78. package/es/components/UIShell/SideNavItems.d.ts +1 -1
  79. package/es/components/UIShell/SideNavMenu.d.ts +1 -1
  80. package/es/components/UIShell/SideNavMenuItem.d.ts +1 -1
  81. package/es/components/UIShell/SideNavSwitcher.d.ts +1 -1
  82. package/es/components/UIShell/Switcher.d.ts +1 -1
  83. package/es/components/UIShell/SwitcherDivider.d.ts +1 -1
  84. package/es/components/UIShell/SwitcherItem.d.ts +4 -4
  85. package/es/index.d.ts +239 -0
  86. package/es/internal/PolymorphicProps.d.ts +11 -0
  87. package/lib/components/AILabel/index.d.ts +1 -2
  88. package/lib/components/AILabel/index.js +1 -1
  89. package/lib/components/AISkeleton/AISkeletonIcon.d.ts +1 -1
  90. package/lib/components/AISkeleton/AISkeletonText.d.ts +1 -1
  91. package/lib/components/Accordion/Accordion.Skeleton.d.ts +1 -1
  92. package/lib/components/Accordion/AccordionItem.d.ts +2 -2
  93. package/lib/components/AspectRatio/AspectRatio.d.ts +1 -1
  94. package/lib/components/Button/Button.d.ts +3 -3
  95. package/lib/components/Button/Button.js +1 -1
  96. package/lib/components/ClassPrefix/index.d.ts +1 -1
  97. package/lib/components/ComboBox/ComboBox.d.ts +4 -4
  98. package/lib/components/ComboBox/ComboBox.js +0 -1
  99. package/lib/components/ComboButton/index.d.ts +1 -1
  100. package/lib/components/ComposedModal/ModalFooter.d.ts +1 -2
  101. package/lib/components/ComposedModal/ModalFooter.js +2 -2
  102. package/lib/components/ComposedModal/ModalHeader.d.ts +1 -2
  103. package/lib/components/ContainedList/ContainedList.d.ts +1 -1
  104. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +2 -3
  105. package/lib/components/ContextMenu/useContextMenu.d.ts +1 -1
  106. package/lib/components/Copy/Copy.d.ts +1 -1
  107. package/lib/components/DataTable/TableCell.d.ts +1 -1
  108. package/lib/components/DataTable/TableExpandHeader.d.ts +3 -3
  109. package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
  110. package/lib/components/DataTable/TableExpandedRow.d.ts +1 -1
  111. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  112. package/lib/components/DataTable/TableSelectAll.d.ts +1 -1
  113. package/lib/components/Dropdown/Dropdown.js +11 -3
  114. package/lib/components/ErrorBoundary/ErrorBoundary.d.ts +2 -3
  115. package/lib/components/FeatureFlags/index.d.ts +1 -1
  116. package/lib/components/FileUploader/FileUploader.d.ts +8 -7
  117. package/lib/components/FileUploader/FileUploader.js +9 -2
  118. package/lib/components/Form/Form.d.ts +1 -1
  119. package/lib/components/FormItem/FormItem.d.ts +1 -1
  120. package/lib/components/Heading/index.d.ts +1 -1
  121. package/lib/components/IconButton/index.d.ts +1 -1
  122. package/lib/components/IdPrefix/index.d.ts +1 -1
  123. package/lib/components/Layer/index.d.ts +1 -2
  124. package/lib/components/LayoutDirection/LayoutDirection.d.ts +1 -1
  125. package/lib/components/Link/Link.d.ts +5 -4
  126. package/lib/components/Link/Link.js +1 -1
  127. package/lib/components/ListItem/ListItem.d.ts +1 -1
  128. package/lib/components/Menu/Menu.d.ts +1 -1
  129. package/lib/components/Modal/Modal.js +1 -1
  130. package/lib/components/ModalWrapper/ModalWrapper.d.ts +1 -1
  131. package/lib/components/MultiSelect/FilterableMultiSelect.js +4 -1
  132. package/lib/components/MultiSelect/MultiSelect.js +10 -1
  133. package/lib/components/OrderedList/OrderedList.d.ts +1 -1
  134. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  135. package/lib/components/PaginationNav/PaginationNav.d.ts +52 -1
  136. package/lib/components/Popover/index.d.ts +6 -2
  137. package/lib/components/Portal/index.d.ts +1 -1
  138. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +1 -1
  139. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +1 -1
  140. package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
  141. package/lib/components/Tabs/Tabs.d.ts +2 -2
  142. package/lib/components/Tabs/Tabs.js +1 -1
  143. package/lib/components/Tag/DismissibleTag.js +1 -1
  144. package/lib/components/Tag/OperationalTag.js +1 -1
  145. package/lib/components/Tag/SelectableTag.d.ts +2 -2
  146. package/lib/components/Tag/SelectableTag.js +1 -1
  147. package/lib/components/Tag/Tag.d.ts +7 -3
  148. package/lib/components/Tag/Tag.js +1 -1
  149. package/lib/components/Text/Text.d.ts +6 -4
  150. package/lib/components/Text/Text.js +1 -1
  151. package/lib/components/Theme/index.d.ts +1 -1
  152. package/lib/components/Toggle/Toggle.Skeleton.d.ts +1 -1
  153. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +1 -1
  154. package/lib/components/Toggletip/index.d.ts +4 -4
  155. package/lib/components/UIShell/Content.d.ts +1 -1
  156. package/lib/components/UIShell/Header.d.ts +1 -1
  157. package/lib/components/UIShell/HeaderGlobalAction.d.ts +1 -1
  158. package/lib/components/UIShell/HeaderMenu.d.ts +1 -1
  159. package/lib/components/UIShell/HeaderPanel.d.ts +1 -1
  160. package/lib/components/UIShell/SideNavHeader.d.ts +1 -1
  161. package/lib/components/UIShell/SideNavIcon.d.ts +1 -1
  162. package/lib/components/UIShell/SideNavItem.d.ts +1 -1
  163. package/lib/components/UIShell/SideNavItems.d.ts +1 -1
  164. package/lib/components/UIShell/SideNavMenu.d.ts +1 -1
  165. package/lib/components/UIShell/SideNavMenuItem.d.ts +1 -1
  166. package/lib/components/UIShell/SideNavSwitcher.d.ts +1 -1
  167. package/lib/components/UIShell/Switcher.d.ts +1 -1
  168. package/lib/components/UIShell/SwitcherDivider.d.ts +1 -1
  169. package/lib/components/UIShell/SwitcherItem.d.ts +4 -4
  170. package/lib/index.d.ts +239 -0
  171. package/lib/internal/PolymorphicProps.d.ts +11 -0
  172. package/package.json +14 -13
@@ -16,7 +16,7 @@ export declare const AILabelActions: React.ForwardRefExoticComponent<AILabelActi
16
16
  export type DeprecatedAlignment = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
17
17
  export type NewAlignment = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
18
18
  export type Alignment = DeprecatedAlignment | NewAlignment;
19
- interface AILabelProps {
19
+ export interface AILabelProps {
20
20
  AILabelContent?: React.ReactNode;
21
21
  aiText?: string;
22
22
  aiTextLabel?: string;
@@ -34,4 +34,3 @@ interface AILabelProps {
34
34
  slugLabel?: string;
35
35
  }
36
36
  export declare const AILabel: React.ForwardRefExoticComponent<AILabelProps & React.RefAttributes<HTMLDivElement>>;
37
- export {};
@@ -135,7 +135,7 @@ const AILabel = /*#__PURE__*/React__default.forwardRef(function AILabel(_ref3, r
135
135
  alignmentAxisOffset: isSmallIcon ? -24 : 0
136
136
  }, rest), /*#__PURE__*/React__default.createElement(ToggletipButton, {
137
137
  className: aiLabelButtonClasses,
138
- label: ariaLabelText
138
+ label: kind === 'inline' ? '' : ariaLabelText
139
139
  }, /*#__PURE__*/React__default.createElement("span", {
140
140
  className: `${prefix}--ai-label__text`
141
141
  }, aiText), kind === 'inline' && (aiTextLabel || textLabel) && /*#__PURE__*/React__default.createElement("span", {
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
- interface AISkeletonIconProps {
9
+ export interface AISkeletonIconProps {
10
10
  /**
11
11
  * Specify an optional className to add.
12
12
  */
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- interface AISkeletonTextProps {
8
+ export interface AISkeletonTextProps {
9
9
  /**
10
10
  * Specify an optional className to be applied to the container node.
11
11
  */
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- interface AccordionSkeletonProps {
8
+ export interface AccordionSkeletonProps {
9
9
  /**
10
10
  * Specify the alignment of the accordion heading
11
11
  * title and chevron.
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import { AnimationEventHandler, AriaAttributes, KeyboardEvent, MouseEventHandler, PropsWithChildren, ReactElement, ReactNode } from 'react';
3
- interface AccordionItemProps {
3
+ export interface AccordionItemProps {
4
4
  /**
5
5
  * Specify an optional className to be
6
6
  * applied to the container node.
@@ -49,7 +49,7 @@ interface AccordionItemProps {
49
49
  */
50
50
  handleAnimationEnd?: AnimationEventHandler<HTMLElement>;
51
51
  }
52
- interface AccordionToggleProps {
52
+ export interface AccordionToggleProps {
53
53
  'aria-controls'?: AriaAttributes['aria-controls'];
54
54
  'aria-expanded'?: AriaAttributes['aria-expanded'];
55
55
  className?: string;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { PropsWithChildren, ReactHTML } from 'react';
9
- interface AspectRatioProps {
9
+ export interface AspectRatioProps {
10
10
  /**
11
11
  * Provide a custom component or string to be rendered as
12
12
  * the outermost node of the component. This is useful if you want
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import { IconButtonKind } from '../IconButton';
9
- import { PolymorphicProps } from '../../types/common';
9
+ import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
10
10
  export declare const ButtonKinds: readonly ["primary", "secondary", "danger", "ghost", "danger--primary", "danger--ghost", "danger--tertiary", "tertiary"];
11
11
  export type ButtonKind = (typeof ButtonKinds)[number];
12
12
  export declare const ButtonSizes: readonly ["sm", "md", "lg", "xl", "2xl"];
@@ -65,7 +65,7 @@ export interface ButtonBaseProps extends React.ButtonHTMLAttributes<HTMLButtonEl
65
65
  */
66
66
  tooltipPosition?: ButtonTooltipPosition;
67
67
  }
68
- export type ButtonProps<T extends React.ElementType> = PolymorphicProps<T, ButtonBaseProps>;
69
- export type ButtonComponent = <T extends React.ElementType>(props: ButtonProps<T>, context?: any) => React.ReactElement<any, any> | null;
68
+ export type ButtonProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, ButtonBaseProps>;
69
+ export type ButtonComponent = <T extends React.ElementType = 'button'>(props: ButtonProps<T>, context?: any) => React.ReactElement | any;
70
70
  declare const _default: ButtonComponent;
71
71
  export default _default;
@@ -22,7 +22,7 @@ function isIconOnlyButton(hasIconOnly, _kind) {
22
22
  }
23
23
  return false;
24
24
  }
25
- const Button = /*#__PURE__*/React__default.forwardRef(function Button(props, ref) {
25
+ const Button = /*#__PURE__*/React__default.forwardRef((props, ref) => {
26
26
  const tooltipRef = useRef(null);
27
27
  const {
28
28
  as,
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { PropsWithChildren } from 'react';
9
- interface ClassPrefixProps {
9
+ export interface ClassPrefixProps {
10
10
  /**
11
11
  * The value used to prefix the CSS selectors
12
12
  * used by Carbon components.
@@ -9,7 +9,7 @@ import React, { type ReactNode, type ComponentType, type ReactElement, type RefA
9
9
  import { ListBoxSize } from '../ListBox';
10
10
  import { TranslateWithId } from '../../types/common';
11
11
  type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type' | 'size';
12
- interface OnChangeData<ItemType> {
12
+ export interface OnChangeData<ItemType> {
13
13
  selectedItem: ItemType | null | undefined;
14
14
  inputValue?: string | null;
15
15
  }
@@ -20,8 +20,8 @@ interface OnChangeData<ItemType> {
20
20
  * because those components aren't Typescript. (If you try, TranslationKey
21
21
  * ends up just being defined as "string".)
22
22
  */
23
- type TranslationKey = 'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection';
24
- type ItemToStringHandler<ItemType> = (item: ItemType | null) => string;
23
+ export type TranslationKey = 'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection';
24
+ export type ItemToStringHandler<ItemType> = (item: ItemType | null) => string;
25
25
  export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey> {
26
26
  /**
27
27
  * Specify whether or not the ComboBox should allow a value that is
@@ -197,7 +197,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
197
197
  warnText?: ReactNode;
198
198
  }
199
199
  type ComboboxComponentProps<ItemType> = PropsWithRef<PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>>;
200
- interface ComboBoxComponent {
200
+ export interface ComboBoxComponent {
201
201
  <ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement | null;
202
202
  }
203
203
  declare const _default: ComboBoxComponent;
@@ -386,7 +386,6 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
386
386
  });
387
387
  const wrapperClasses = cx(`${prefix}--list-box__wrapper`, [containerClassName, {
388
388
  [`${prefix}--list-box__wrapper--fluid--invalid`]: isFluid && invalid,
389
- [`${prefix}--list-box__wrapper--fluid--focus`]: isFluid && isFocused,
390
389
  [`${prefix}--list-box__wrapper--slug`]: slug,
391
390
  [`${prefix}--list-box__wrapper--decorator`]: decorator
392
391
  }]);
@@ -16,7 +16,7 @@ declare const defaultTranslations: {
16
16
  /**
17
17
  * Message ids that will be passed to translateWithId().
18
18
  */
19
- type TranslationKey = keyof typeof defaultTranslations;
19
+ export type TranslationKey = keyof typeof defaultTranslations;
20
20
  interface ComboButtonProps extends TranslateWithId<TranslationKey> {
21
21
  /**
22
22
  * A collection of `MenuItems` to be rendered as additional actions for this `ComboButton`.
@@ -1,6 +1,6 @@
1
1
  import React, { type ReactNode, type MouseEvent, type Ref } from 'react';
2
2
  import { InlineLoadingStatus } from '../InlineLoading/InlineLoading';
3
- interface SecondaryButtonProps {
3
+ export interface SecondaryButtonProps {
4
4
  buttonText: ReactNode;
5
5
  onClick(evt: MouseEvent): void;
6
6
  }
@@ -87,4 +87,3 @@ export interface ModalFooterProps {
87
87
  onLoadingSuccess?(): void;
88
88
  }
89
89
  export declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLElement>>;
90
- export {};
@@ -30,7 +30,7 @@ function SecondaryButtonSet(_ref) {
30
30
  onRequestClose(evt);
31
31
  }
32
32
  if (Array.isArray(secondaryButtons) && secondaryButtons.length <= 2) {
33
- return secondaryButtons.map((_ref2, i) => {
33
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, secondaryButtons.map((_ref2, i) => {
34
34
  let {
35
35
  buttonText,
36
36
  onClick: onButtonClick
@@ -41,7 +41,7 @@ function SecondaryButtonSet(_ref) {
41
41
  kind: "secondary",
42
42
  onClick: onButtonClick || handleRequestClose
43
43
  }, buttonText);
44
- });
44
+ }));
45
45
  }
46
46
  if (secondaryButtonText) {
47
47
  return /*#__PURE__*/React__default.createElement(Button, {
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { type ReactNode, type MouseEvent, type HTMLAttributes } from 'react';
8
- type DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
8
+ export type DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
9
9
  export interface ModalHeaderProps extends DivProps {
10
10
  /**
11
11
  * Provide an optional function to be called when the close button is
@@ -55,4 +55,3 @@ export interface ModalHeaderProps extends DivProps {
55
55
  titleClassName?: string;
56
56
  }
57
57
  export declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
58
- export {};
@@ -7,7 +7,7 @@
7
7
  import React, { ReactNode } from 'react';
8
8
  import ContainedListItem from './ContainedListItem';
9
9
  declare const variants: readonly ["on-page", "disclosed"];
10
- interface ContainedListType extends React.FC<ContainedListProps> {
10
+ export interface ContainedListType extends React.FC<ContainedListProps> {
11
11
  ContainedListItem: typeof ContainedListItem;
12
12
  }
13
13
  export type Variants = (typeof variants)[number];
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React, { HTMLAttributes, ReactElement } from 'react';
9
- interface SwitchEventHandlersParams {
9
+ export interface SwitchEventHandlersParams {
10
10
  index?: number;
11
11
  name?: string | number;
12
12
  text?: string;
@@ -46,7 +46,7 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
46
46
  */
47
47
  size: 'sm' | 'md' | 'lg';
48
48
  }
49
- interface ContentSwitcherState {
49
+ export interface ContentSwitcherState {
50
50
  selectedIndex?: number;
51
51
  }
52
52
  export default class ContentSwitcher extends React.Component<ContentSwitcherProps, ContentSwitcherState> {
@@ -101,4 +101,3 @@ export default class ContentSwitcher extends React.Component<ContentSwitcherProp
101
101
  handleChildChange: (data: any) => void;
102
102
  render(): import("react/jsx-runtime").JSX.Element;
103
103
  }
104
- export {};
@@ -6,7 +6,7 @@
6
6
  */
7
7
  /// <reference types="react" />
8
8
  type TriggerType = Element | Document | Window | React.RefObject<Element>;
9
- interface ContextMenuProps {
9
+ export interface ContextMenuProps {
10
10
  open: boolean;
11
11
  x: number;
12
12
  y: number;
@@ -9,7 +9,7 @@ import React, { AnimationEventHandler, MouseEventHandler, PropsWithChildren } fr
9
9
  export type DeprecatedCopyAlignment = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
10
10
  export type NewCopyAlignment = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
11
11
  export type CopyAlignment = DeprecatedCopyAlignment | NewCopyAlignment;
12
- interface CopyProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
12
+ export interface CopyProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13
13
  /**
14
14
  * Specify how the trigger should align with the tooltip
15
15
  */
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import { ReactAttr } from '../../types/common';
9
- interface TableCellProps extends ReactAttr<HTMLTableCellElement> {
9
+ export interface TableCellProps extends ReactAttr<HTMLTableCellElement> {
10
10
  /**
11
11
  * Pass in children that will be embedded in the table header label
12
12
  */
@@ -7,7 +7,7 @@
7
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
9
  import { ReactAttr } from '../../types/common';
10
- type TableExpandHeaderPropsBase = {
10
+ export type TableExpandHeaderPropsBase = {
11
11
  /**
12
12
  * Space separated list of one or more ID values referencing the TableExpandedRow(s) being controlled by the TableExpandHeader
13
13
  */
@@ -45,13 +45,13 @@ type TableExpandHeaderPropsBase = {
45
45
  */
46
46
  onExpand?(event: React.MouseEvent<HTMLButtonElement>): void;
47
47
  } & ReactAttr<HTMLTableCellElement>;
48
- type TableExpandHeaderPropsWithToggle = Omit<TableExpandHeaderPropsBase, 'ariaLabel' | 'aria-label' | 'enableToggle' | 'onExpand'> & {
48
+ export type TableExpandHeaderPropsWithToggle = Omit<TableExpandHeaderPropsBase, 'ariaLabel' | 'aria-label' | 'enableToggle' | 'onExpand'> & {
49
49
  enableToggle: true;
50
50
  ariaLabel: string;
51
51
  ['aria-label']: string;
52
52
  onExpand(event: React.MouseEvent<HTMLButtonElement>): void;
53
53
  };
54
- type TableExpandHeaderPropsWithExpando = Omit<TableExpandHeaderPropsBase, 'ariaLabel' | 'aria-label' | 'enableExpando' | 'onExpand'> & {
54
+ export type TableExpandHeaderPropsWithExpando = Omit<TableExpandHeaderPropsBase, 'ariaLabel' | 'aria-label' | 'enableExpando' | 'onExpand'> & {
55
55
  enableExpando: true;
56
56
  ariaLabel: string;
57
57
  ['aria-label']: string;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React, { type MouseEventHandler, type PropsWithChildren } from 'react';
8
8
  import { TableRowProps } from './TableRow';
9
- interface TableExpandRowProps extends PropsWithChildren<TableRowProps> {
9
+ export interface TableExpandRowProps extends PropsWithChildren<TableRowProps> {
10
10
  /**
11
11
  * Space separated list of one or more ID values referencing the TableExpandedRow(s) being controlled by the TableExpandRow
12
12
  */
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { ReactAttr } from '../../types/common';
9
- interface TableExpandedRowProps extends ReactAttr<HTMLTableRowElement> {
9
+ export interface TableExpandedRowProps extends ReactAttr<HTMLTableRowElement> {
10
10
  /**
11
11
  * The width of the expanded row's internal cell
12
12
  */
@@ -15,7 +15,7 @@ export interface TableHeaderTranslationArgs {
15
15
  sortDirection?: DataTableSortState;
16
16
  sortStates: typeof sortStates;
17
17
  }
18
- interface TableHeaderProps extends ReactAttr<HTMLTableCellElement & HTMLButtonElement>, TranslateWithId<TableHeaderTranslationKey, {
18
+ export interface TableHeaderProps extends ReactAttr<HTMLTableCellElement & HTMLButtonElement>, TranslateWithId<TableHeaderTranslationKey, {
19
19
  header: any;
20
20
  sortDirection: any;
21
21
  isSortHeader: any;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
- interface TableSelectAllProps {
9
+ export interface TableSelectAllProps {
10
10
  /**
11
11
  * Specify the aria label for the underlying input control
12
12
  * node
@@ -218,6 +218,7 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
218
218
  [`${prefix}--dropdown--invalid`]: invalid,
219
219
  [`${prefix}--dropdown--warning`]: showWarning,
220
220
  [`${prefix}--dropdown--open`]: isOpen,
221
+ [`${prefix}--dropdown--focus`]: isFocused,
221
222
  [`${prefix}--dropdown--inline`]: inline,
222
223
  [`${prefix}--dropdown--disabled`]: disabled,
223
224
  [`${prefix}--dropdown--light`]: light,
@@ -239,7 +240,6 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
239
240
  [`${prefix}--dropdown__wrapper--inline--invalid`]: inline && invalid,
240
241
  [`${prefix}--list-box__wrapper--inline--invalid`]: inline && invalid,
241
242
  [`${prefix}--list-box__wrapper--fluid--invalid`]: isFluid && invalid,
242
- [`${prefix}--list-box__wrapper--fluid--focus`]: isFluid && isFocused && !isOpen,
243
243
  [`${prefix}--list-box__wrapper--slug`]: slug,
244
244
  [`${prefix}--list-box__wrapper--decorator`]: decorator
245
245
  });
@@ -255,7 +255,7 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
255
255
  className: helperClasses
256
256
  }, helperText) : null;
257
257
  const handleFocus = evt => {
258
- setIsFocused(evt.type === 'focus' ? true : false);
258
+ setIsFocused(evt.type === 'focus' && !selectedItem ? true : false);
259
259
  };
260
260
  const mergedRef = mergeRefs(toggleButtonProps.ref, ref);
261
261
  const [currTimer, setCurrTimer] = useState();
@@ -272,7 +272,15 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
272
272
  setIsTyping(false);
273
273
  }, 3000));
274
274
  }
275
- if (toggleButtonProps.onKeyDown) {
275
+ if (['ArrowDown'].includes(evt.key)) {
276
+ setIsFocused(false);
277
+ }
278
+ if (['Enter'].includes(evt.key) && !selectedItem && !isOpen) {
279
+ setIsFocused(true);
280
+ }
281
+
282
+ // For Dropdowns the arrow up key is only allowed if the Dropdown is open
283
+ if (toggleButtonProps.onKeyDown && (evt.key !== 'ArrowUp' || isOpen && evt.key === 'ArrowUp')) {
276
284
  toggleButtonProps.onKeyDown(evt);
277
285
  }
278
286
  }, [isTyping, currTimer, toggleButtonProps]);
@@ -24,11 +24,11 @@ import { ErrorBoundaryContext } from './ErrorBoundaryContext';
24
24
  * Reference:
25
25
  * https://reactjs.org/docs/error-boundaries.html#introducing-error-boundaries
26
26
  */
27
- interface ErrorBoundaryProps {
27
+ export interface ErrorBoundaryProps {
28
28
  children?: ReactNode;
29
29
  fallback?: ReactNode;
30
30
  }
31
- interface ErrorBoundaryState {
31
+ export interface ErrorBoundaryState {
32
32
  hasError: boolean;
33
33
  }
34
34
  export default class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
@@ -44,4 +44,3 @@ export default class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
44
44
  componentDidUpdate(prevProps: ErrorBoundaryProps): void;
45
45
  render(): React.ReactNode;
46
46
  }
47
- export {};
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React, { ReactNode } from 'react';
9
- interface FeatureFlagsProps {
9
+ export interface FeatureFlagsProps {
10
10
  children?: ReactNode;
11
11
  flags?: Record<string, boolean>;
12
12
  enableV12TileDefaultIcons?: boolean;
@@ -4,7 +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 { ReactElement } from 'react';
7
+ import React from 'react';
8
8
  import { ReactAttr } from '../../types/common';
9
9
  export interface FileUploaderProps extends ReactAttr<HTMLSpanElement> {
10
10
  /**
@@ -73,10 +73,11 @@ export interface FileUploaderProps extends ReactAttr<HTMLSpanElement> {
73
73
  */
74
74
  size?: 'sm' | 'small' | 'md' | 'field' | 'lg';
75
75
  }
76
- declare const FileUploader: {
77
- <ItemType>(props: FileUploaderProps): ReactElement;
78
- propTypes?: any;
79
- contextTypes?: any;
80
- defaultProps?: any;
81
- };
76
+ export interface FileUploaderHandle {
77
+ /**
78
+ * Clear internal state
79
+ */
80
+ clearFiles: () => void;
81
+ }
82
+ declare const FileUploader: React.ForwardRefExoticComponent<FileUploaderProps & React.RefAttributes<FileUploaderHandle>>;
82
83
  export default FileUploader;
@@ -8,10 +8,10 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
- import React__default, { useState } from 'react';
11
+ import React__default, { useState, useImperativeHandle } from 'react';
12
12
  import Filename from './Filename.js';
13
13
  import FileUploaderButton from './FileUploaderButton.js';
14
- import { ButtonKinds } from '../../prop-types/types.js';
14
+ import { ButtonKinds } from '../Button/Button.js';
15
15
  import { usePrefix } from '../../internal/usePrefix.js';
16
16
  import '../Text/index.js';
17
17
  import { useId } from '../../internal/useId.js';
@@ -72,6 +72,13 @@ const FileUploader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
72
72
  onClick?.(evt);
73
73
  }
74
74
  };
75
+ useImperativeHandle(ref, () => ({
76
+ clearFiles() {
77
+ updateState({
78
+ fileNames: []
79
+ });
80
+ }
81
+ }));
75
82
  const uploaderButton = /*#__PURE__*/React__default.createRef();
76
83
  const classes = cx({
77
84
  [`${prefix}--form-item`]: true,
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { type ComponentProps } from 'react';
9
- type FormProps = ComponentProps<'form'>;
9
+ export type FormProps = ComponentProps<'form'>;
10
10
  declare function Form({ className, children, ...other }: FormProps): import("react/jsx-runtime").JSX.Element;
11
11
  declare namespace Form {
12
12
  var propTypes: {
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
- type FormItemProps = {
9
+ export type FormItemProps = {
10
10
  /**
11
11
  * Provide content to be rendered in the form item
12
12
  */
@@ -10,7 +10,7 @@ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
10
10
  type SectionBaseProps = {
11
11
  level?: HeadingLevel;
12
12
  };
13
- type SectionProps<E extends ElementType> = PolymorphicProps<E, SectionBaseProps>;
13
+ export type SectionProps<E extends ElementType> = PolymorphicProps<E, SectionBaseProps>;
14
14
  export declare const Section: React.ForwardRefExoticComponent<Omit<SectionProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
15
15
  export declare const Heading: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
16
16
  export {};
@@ -11,7 +11,7 @@ export type IconButtonKind = (typeof IconButtonKinds)[number];
11
11
  export type DeprecatedIconButtonAlignment = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
12
12
  export type NewIconButtonAlignment = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
13
13
  export type IconButtonAlignment = DeprecatedIconButtonAlignment | NewIconButtonAlignment;
14
- interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
14
+ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
15
15
  /**
16
16
  * Specify how the trigger should align with the tooltip
17
17
  */
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { PropsWithChildren, ReactNode } from 'react';
9
- type IdPrefixProps = {
9
+ export type IdPrefixProps = {
10
10
  children?: ReactNode;
11
11
  /**
12
12
  * The value used to prefix the auto-generated id placed on some DOM elements
@@ -15,7 +15,7 @@ import { PolymorphicProps } from '../../types/common';
15
15
  export declare function useLayer(): {
16
16
  level: 0 | 1 | 2;
17
17
  };
18
- interface LayerBaseProps {
18
+ export interface LayerBaseProps {
19
19
  /**
20
20
  * Provide child elements to be rendered inside of `Theme`
21
21
  */
@@ -35,4 +35,3 @@ export interface LayerComponent {
35
35
  <T extends React.ElementType>(props: LayerProps<T>, context?: any): React.ReactElement<any, any> | null;
36
36
  }
37
37
  export declare const Layer: LayerComponent;
38
- export {};
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import { ElementType, ReactNode } from 'react';
9
9
  import { LayoutDirectionContext } from './LayoutDirectionContext';
10
10
  type Direction = 'ltr' | 'rtl';
11
- interface LayoutDirectionProps {
11
+ export interface LayoutDirectionProps {
12
12
  /**
13
13
  * Customize the element type used to render the outermost node
14
14
  */
@@ -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 React, { AnchorHTMLAttributes, AriaAttributes, ComponentType, ElementType, HTMLAttributeAnchorTarget } from 'react';
8
- import { PolymorphicProps } from '../../types/common';
7
+ import React, { AnchorHTMLAttributes, AriaAttributes, ComponentType, HTMLAttributeAnchorTarget } from 'react';
8
+ import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
9
9
  export interface LinkBaseProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
10
10
  /**
11
11
  * @description Indicates the element that represents the
@@ -48,6 +48,7 @@ export interface LinkBaseProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
48
48
  */
49
49
  visited?: boolean;
50
50
  }
51
- export type LinkProps<E extends ElementType> = PolymorphicProps<E, LinkBaseProps>;
52
- declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
51
+ export type LinkProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, LinkBaseProps>;
52
+ type LinkComponent = <T extends React.ElementType = 'a'>(props: LinkProps<T>) => React.ReactElement | any;
53
+ declare const Link: LinkComponent;
53
54
  export default Link;
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
11
11
  import React__default from 'react';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
- const Link = /*#__PURE__*/React__default.forwardRef(function Link(_ref, ref) {
14
+ const Link = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
15
15
  let {
16
16
  as: BaseComponent,
17
17
  children,
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import { type ComponentProps } from 'react';
9
- type ListItemProps = ComponentProps<'li'>;
9
+ export type ListItemProps = Omit<ComponentProps<'li'>, 'ref'>;
10
10
  declare function ListItem({ className, children, ...other }: ListItemProps): import("react/jsx-runtime").JSX.Element;
11
11
  declare namespace ListItem {
12
12
  var propTypes: {
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { ReactNode, RefObject } from 'react';
8
- interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
8
+ export interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
9
9
  /**
10
10
  * The ref of the containing element, used for positioning and alignment of the menu
11
11
  */
@@ -71,7 +71,7 @@ const Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
71
71
  } = _ref;
72
72
  const prefix = usePrefix();
73
73
  const button = useRef(null);
74
- const secondaryButton = useRef();
74
+ const secondaryButton = useRef(null);
75
75
  const contentRef = useRef(null);
76
76
  const innerModal = useRef(null);
77
77
  const startTrap = useRef(null);
@@ -7,7 +7,7 @@
7
7
  import PropTypes from 'prop-types';
8
8
  import React, { ReactNode } from 'react';
9
9
  import { ButtonKinds } from '../Button';
10
- interface ModalWrapperProps {
10
+ export interface ModalWrapperProps {
11
11
  buttonTriggerClassName?: string;
12
12
  buttonTriggerText?: ReactNode;
13
13
  children?: ReactNode;