@carbon/react 1.114.0 → 1.115.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 (136) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +2700 -1188
  2. package/es/components/Accordion/AccordionItem.d.ts +5 -0
  3. package/es/components/Accordion/AccordionItem.js +0 -6
  4. package/es/components/BigNumber/BigNumber.d.ts +82 -0
  5. package/es/components/BigNumber/BigNumberSkeleton.d.ts +16 -0
  6. package/es/components/BigNumber/constants.d.ts +19 -0
  7. package/es/components/BigNumber/index.d.ts +9 -0
  8. package/es/components/Card/Card.d.ts +1 -1
  9. package/es/components/Card/Card.js +19 -7
  10. package/es/components/Card/Card.types.d.ts +38 -7
  11. package/es/components/Card/CardActions.js +1 -1
  12. package/es/components/Card/CardBody.d.ts +2 -1
  13. package/es/components/Card/CardBody.js +3 -2
  14. package/es/components/Card/CardFooter.d.ts +5 -1
  15. package/es/components/Card/CardFooter.js +13 -2
  16. package/es/components/Card/CardTitle.d.ts +1 -1
  17. package/es/components/ComboBox/ComboBox.js +2 -2
  18. package/es/components/ComposedModal/ComposedModal.js +2 -2
  19. package/es/components/ContentSwitcher/ContentSwitcher.js +2 -2
  20. package/es/components/DatePicker/DatePicker.d.ts +1 -1
  21. package/es/components/DatePicker/DatePicker.js +2 -2
  22. package/es/components/DatePicker/plugins/rangePlugin.d.ts +1 -1
  23. package/es/components/FileUploader/FileUploader.js +1 -1
  24. package/es/components/FileUploader/FileUploaderButton.js +2 -2
  25. package/es/components/FileUploader/FileUploaderDropContainer.js +13 -7
  26. package/es/components/FileUploader/FileUploaderItem.js +2 -2
  27. package/es/components/FormLabel/FormLabel.d.ts +2 -2
  28. package/es/components/FormLabel/FormLabel.js +1 -1
  29. package/es/components/Loading/Loading.js +82 -2
  30. package/es/components/Menu/Menu.js +2 -2
  31. package/es/components/Menu/MenuItem.js +2 -2
  32. package/es/components/Modal/Modal.js +3 -3
  33. package/es/components/MultiSelect/FilterableMultiSelect.js +2 -2
  34. package/es/components/MultiSelect/MultiSelect.js +2 -2
  35. package/es/components/Notification/Notification.js +2 -2
  36. package/es/components/NumberInput/NumberInput.js +2 -2
  37. package/es/components/OverflowMenu/OverflowMenu.js +2 -2
  38. package/es/components/OverflowMenuItem/OverflowMenuItem.js +1 -1
  39. package/es/components/Pagination/Pagination.d.ts +1 -1
  40. package/es/components/Pagination/Pagination.js +52 -53
  41. package/es/components/Popover/index.js +1 -1
  42. package/es/components/RadioTile/RadioTile.js +2 -2
  43. package/es/components/Search/Search.js +2 -2
  44. package/es/components/Slider/Slider.js +2 -2
  45. package/es/components/Tabs/Tabs.js +15 -4
  46. package/es/components/Tile/Tile.js +3 -3
  47. package/es/components/Toggletip/index.js +2 -2
  48. package/es/components/Tooltip/DefinitionTooltip.js +2 -2
  49. package/es/components/Tooltip/Tooltip.js +2 -2
  50. package/es/components/TreeView/TreeNode.js +2 -2
  51. package/es/components/TreeView/TreeView.js +1 -1
  52. package/es/components/UIShell/HeaderContainer.js +1 -1
  53. package/es/components/UIShell/HeaderMenu.js +2 -2
  54. package/es/components/UIShell/HeaderPanel.js +2 -2
  55. package/es/components/UIShell/SideNav.js +2 -2
  56. package/es/index.d.ts +2 -1
  57. package/es/index.js +1 -1
  58. package/es/internal/DisplayBox.d.ts +14 -0
  59. package/es/internal/getSupportedLocale.d.ts +12 -0
  60. package/lib/components/Accordion/AccordionItem.d.ts +5 -0
  61. package/lib/components/Accordion/AccordionItem.js +0 -6
  62. package/lib/components/BigNumber/BigNumber.d.ts +82 -0
  63. package/lib/components/BigNumber/BigNumberSkeleton.d.ts +16 -0
  64. package/lib/components/BigNumber/constants.d.ts +19 -0
  65. package/lib/components/BigNumber/index.d.ts +9 -0
  66. package/lib/components/Card/Card.d.ts +1 -1
  67. package/lib/components/Card/Card.js +19 -7
  68. package/lib/components/Card/Card.types.d.ts +38 -7
  69. package/lib/components/Card/CardActions.js +1 -1
  70. package/lib/components/Card/CardBody.d.ts +2 -1
  71. package/lib/components/Card/CardBody.js +3 -2
  72. package/lib/components/Card/CardFooter.d.ts +5 -1
  73. package/lib/components/Card/CardFooter.js +13 -2
  74. package/lib/components/Card/CardTitle.d.ts +1 -1
  75. package/lib/components/ComboBox/ComboBox.js +2 -2
  76. package/lib/components/ComposedModal/ComposedModal.js +2 -2
  77. package/lib/components/ContentSwitcher/ContentSwitcher.js +2 -2
  78. package/lib/components/DatePicker/DatePicker.d.ts +1 -1
  79. package/lib/components/DatePicker/DatePicker.js +2 -2
  80. package/lib/components/DatePicker/plugins/rangePlugin.d.ts +1 -1
  81. package/lib/components/FileUploader/FileUploader.js +1 -1
  82. package/lib/components/FileUploader/FileUploaderButton.js +2 -2
  83. package/lib/components/FileUploader/FileUploaderDropContainer.js +13 -7
  84. package/lib/components/FileUploader/FileUploaderItem.js +2 -2
  85. package/lib/components/FormLabel/FormLabel.d.ts +2 -2
  86. package/lib/components/FormLabel/FormLabel.js +1 -1
  87. package/lib/components/Loading/Loading.js +81 -1
  88. package/lib/components/Menu/Menu.js +2 -2
  89. package/lib/components/Menu/MenuItem.js +2 -2
  90. package/lib/components/Modal/Modal.js +3 -3
  91. package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -2
  92. package/lib/components/MultiSelect/MultiSelect.js +2 -2
  93. package/lib/components/Notification/Notification.js +2 -2
  94. package/lib/components/NumberInput/NumberInput.js +2 -2
  95. package/lib/components/OverflowMenu/OverflowMenu.js +2 -2
  96. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +1 -1
  97. package/lib/components/Pagination/Pagination.d.ts +1 -1
  98. package/lib/components/Pagination/Pagination.js +52 -53
  99. package/lib/components/Popover/index.js +1 -1
  100. package/lib/components/RadioTile/RadioTile.js +2 -2
  101. package/lib/components/Search/Search.js +2 -2
  102. package/lib/components/Slider/Slider.js +2 -2
  103. package/lib/components/Tabs/Tabs.js +15 -4
  104. package/lib/components/Tile/Tile.js +3 -3
  105. package/lib/components/Toggletip/index.js +2 -2
  106. package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
  107. package/lib/components/Tooltip/Tooltip.js +2 -2
  108. package/lib/components/TreeView/TreeNode.js +2 -2
  109. package/lib/components/TreeView/TreeView.js +1 -1
  110. package/lib/components/UIShell/HeaderContainer.js +1 -1
  111. package/lib/components/UIShell/HeaderMenu.js +2 -2
  112. package/lib/components/UIShell/HeaderPanel.js +2 -2
  113. package/lib/components/UIShell/SideNav.js +2 -2
  114. package/lib/index.d.ts +2 -1
  115. package/lib/index.js +1 -1
  116. package/lib/internal/DisplayBox.d.ts +14 -0
  117. package/lib/internal/getSupportedLocale.d.ts +12 -0
  118. package/package.json +21 -21
  119. package/scss/_border-radius.scss +9 -0
  120. package/scss/components/OptionsTile/_index.scss +5 -0
  121. package/scss/components/OptionsTile/_options-tile.scss +5 -0
  122. package/scss/components/big-number/_big-number.scss +9 -0
  123. package/scss/components/big-number/_index.scss +9 -0
  124. package/scss/components/coachmark/_coachmark.scss +5 -0
  125. package/scss/components/coachmark/_index.scss +5 -0
  126. package/scss/components/edit-in-place/_edit-in-place.scss +5 -0
  127. package/scss/components/edit-in-place/_index.scss +5 -0
  128. package/scss/components/full-page-error/_full-page-error.scss +5 -0
  129. package/scss/components/full-page-error/_index.scss +5 -0
  130. package/scss/components/interstitial-screen/_index.scss +6 -0
  131. package/scss/components/interstitial-screen/_interstitial-screen.scss +12 -0
  132. package/scss/components/scroll-gradient/_index.scss +9 -0
  133. package/scss/components/scroll-gradient/_scroll-gradient.scss +9 -0
  134. package/scss/components/user-avatar/_index.scss +9 -0
  135. package/scss/components/user-avatar/_user-avatar.scss +9 -0
  136. package/telemetry.yml +91 -3
@@ -5,9 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ import { useWindowEvent } from "../../internal/useEvent.js";
8
9
  import { Escape } from "../../internal/keyboard/keys.js";
9
10
  import { match } from "../../internal/keyboard/match.js";
10
- import { useWindowEvent } from "../../internal/useEvent.js";
11
11
  import { useCallback, useState } from "react";
12
12
  import PropTypes from "prop-types";
13
13
  import { jsx } from "react/jsx-runtime";
@@ -6,11 +6,11 @@
6
6
  */
7
7
 
8
8
  import { PrefixContext } from "../../internal/usePrefix.js";
9
- import { Enter, Escape, Space } from "../../internal/keyboard/keys.js";
10
- import { matches } from "../../internal/keyboard/match.js";
11
9
  import { deprecate } from "../../prop-types/deprecate.js";
12
10
  import { isComponentElement } from "../../internal/utils.js";
13
11
  import { useMergedRefs } from "../../internal/useMergedRefs.js";
12
+ import { Enter, Escape, Space } from "../../internal/keyboard/keys.js";
13
+ import { matches } from "../../internal/keyboard/match.js";
14
14
  import { composeEventHandlers } from "../../tools/events.js";
15
15
  import { AriaLabelPropType } from "../../prop-types/AriaPropTypes.js";
16
16
  import HeaderMenuItem from "./HeaderMenuItem.js";
@@ -7,11 +7,11 @@
7
7
 
8
8
  import { noopFn } from "../../internal/noopFn.js";
9
9
  import { usePrefix } from "../../internal/usePrefix.js";
10
- import { Escape } from "../../internal/keyboard/keys.js";
11
- import { match } from "../../internal/keyboard/match.js";
12
10
  import { isComponentElement } from "../../internal/utils.js";
13
11
  import { useMergedRefs } from "../../internal/useMergedRefs.js";
14
12
  import { useWindowEvent } from "../../internal/useEvent.js";
13
+ import { Escape } from "../../internal/keyboard/keys.js";
14
+ import { match } from "../../internal/keyboard/match.js";
15
15
  import Switcher from "./Switcher.js";
16
16
  import React, { useRef, useState } from "react";
17
17
  import cx from "classnames";
@@ -6,10 +6,10 @@
6
6
  */
7
7
 
8
8
  import { usePrefix } from "../../internal/usePrefix.js";
9
- import { Escape, Tab } from "../../internal/keyboard/keys.js";
10
- import { match } from "../../internal/keyboard/match.js";
11
9
  import { useMergedRefs } from "../../internal/useMergedRefs.js";
12
10
  import { useWindowEvent } from "../../internal/useEvent.js";
11
+ import { Escape, Tab } from "../../internal/keyboard/keys.js";
12
+ import { match } from "../../internal/keyboard/match.js";
13
13
  import { useDelayedState } from "../../internal/useDelayedState.js";
14
14
  import { useMatchMedia } from "../../internal/useMatchMedia.js";
15
15
  import { AriaLabelPropType } from "../../prop-types/AriaPropTypes.js";
package/es/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
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.
@@ -7,6 +7,7 @@
7
7
  import './feature-flags';
8
8
  import './internal/warnAboutDeprecatedReactVersion';
9
9
  export * from './components/Accordion';
10
+ export type { BigNumberProps as preview__BigNumberProps } from './components/BigNumber';
10
11
  export * from './components/AccordionItem';
11
12
  export * from './components/AspectRatio';
12
13
  export * from './components/Breadcrumb';
package/es/index.js CHANGED
@@ -246,7 +246,7 @@ import AISkeletonText from "./components/AISkeleton/AISkeletonText.js";
246
246
  import { GlobalTheme, Theme, ThemeContext, usePrefersDarkScheme, useTheme } from "./components/Theme/index.js";
247
247
  //#region src/index.ts
248
248
  /**
249
- * Copyright IBM Corp. 2016, 2025
249
+ * Copyright IBM Corp. 2016, 2026
250
250
  *
251
251
  * This source code is licensed under the Apache-2.0 license found in the
252
252
  * LICENSE file in the root directory of this source tree.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright IBM Corp. 2022, 2022
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 { type ReactNode } from 'react';
8
+ interface DisplayBoxProps {
9
+ children?: ReactNode;
10
+ className?: string;
11
+ msg?: ReactNode;
12
+ }
13
+ export declare const DisplayBox: ({ children, className, msg }: DisplayBoxProps) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ * Returns the provided locale if it is supported by the runtime's
9
+ * `Intl.NumberFormat`, otherwise falls back to the provided fallback
10
+ * (or `'en-US'` when no fallback is given).
11
+ */
12
+ export declare function getSupportedLocale(locale: string | undefined, fallback?: string): string;
@@ -61,6 +61,11 @@ export interface AccordionToggleProps {
61
61
  className?: string;
62
62
  disabled?: boolean;
63
63
  onClick?: MouseEventHandler<HTMLButtonElement>;
64
+ /**
65
+ * @deprecated `AccordionItem` no longer passes an `onKeyDown` handler to
66
+ * the toggle. This prop is kept only so custom `renderToggle`
67
+ * implementations that reference it don't hit a breaking type change.
68
+ */
64
69
  onKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
65
70
  type?: 'button';
66
71
  }
@@ -9,8 +9,6 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
10
  const require_AccordionProvider = require("./AccordionProvider.js");
11
11
  const require_Text = require("../Text/Text.js");
12
- const require_keys = require("../../internal/keyboard/keys.js");
13
- const require_match = require("../../internal/keyboard/match.js");
14
12
  const require_useId = require("../../internal/useId.js");
15
13
  const require_deprecate = require("../../prop-types/deprecate.js");
16
14
  let react = require("react");
@@ -64,9 +62,6 @@ function AccordionItem({ children, className: customClassName = "", open = false
64
62
  event
65
63
  });
66
64
  }
67
- function onKeyDown(event) {
68
- if (isOpen && require_match.match(event, require_keys.Escape)) setIsOpen(false);
69
- }
70
65
  function onAnimationEnd(event) {
71
66
  if (handleAnimationEnd) handleAnimationEnd(event);
72
67
  }
@@ -80,7 +75,6 @@ function AccordionItem({ children, className: customClassName = "", open = false
80
75
  "aria-label": ariaLabel,
81
76
  className: `${prefix}--accordion__heading`,
82
77
  onClick,
83
- onKeyDown,
84
78
  type: "button",
85
79
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_carbon_icons_react.ChevronRight, { className: `${prefix}--accordion__arrow` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
86
80
  as: "div",
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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 React, { ReactNode } from 'react';
8
+ import { BigNumberSizeValues } from './constants';
9
+ export interface BigNumberProps {
10
+ /**
11
+ * Provide an optional class to be applied to the containing node.
12
+ */
13
+ className?: string;
14
+ /**
15
+ * The default behavior will hide `total` if `undefined` or is the same as `value`.
16
+ *
17
+ * Set to `true` to ignore the default behavior and show the `total`.
18
+ */
19
+ forceShowTotal?: boolean;
20
+ /**
21
+ * Specifies the number of fraction digits when truncating `value` and `total`.
22
+ */
23
+ fractionDigits?: number;
24
+ /**
25
+ * Displays an icon button next to `value`.
26
+ */
27
+ iconButton?: ReactNode;
28
+ /**
29
+ * Text label above the `value`.
30
+ */
31
+ label: string;
32
+ /**
33
+ * When `true`, will show the loading state.
34
+ */
35
+ loading?: boolean;
36
+ /**
37
+ * Determines how `value` and `total` will be formatted.
38
+ */
39
+ locale?: string;
40
+ /**
41
+ * Appends a percent sign (_%_) after `value` and hides `total`.
42
+ */
43
+ percentage?: boolean;
44
+ /**
45
+ * Controls the visual size of the component.
46
+ */
47
+ size?: BigNumberSizeValues;
48
+ /**
49
+ * When applied, an information icon will be rendered next to the
50
+ * `label` and the description will be applied to its tooltip.
51
+ */
52
+ tooltipDescription?: string;
53
+ /**
54
+ * The number that will appear after the slash (i.e. the "denominator" of a fraction).
55
+ *
56
+ * This number will not be rendered if it's the same as `value` or
57
+ * `percentage` is true. See also the **forceShowTotal** prop.
58
+ */
59
+ total?: number;
60
+ /**
61
+ * When `true`, will render a "trending up" icon.
62
+ */
63
+ trending?: boolean;
64
+ /**
65
+ * Abbreviates the number when `true`. E.g. from _1,000_ to _1K_.
66
+ */
67
+ truncate?: boolean;
68
+ /**
69
+ * The primary value to display (or the "numerator" of a fraction).
70
+ */
71
+ value?: number;
72
+ }
73
+ /**
74
+ * BigNumber is used to display large values in a small area. The display of
75
+ * values can be the value itself, or grouped in a `numerator/denominator` fashion.
76
+ * Control over the total fraction decimals displayed as well as how the
77
+ * values/totals are displayed are done via a locale prop. Other optional props
78
+ * allow control over size, truncation, if the value is a percentage, the addition
79
+ * of a button as well as tooltip functionality.
80
+ * The default locale is English (`en-US`) if one is not provided or if the provided one is not supported.
81
+ */
82
+ export declare const BigNumber: React.ForwardRefExoticComponent<BigNumberProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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 React from 'react';
8
+ import { BigNumberProps } from './BigNumber';
9
+ /**
10
+ * BigNumberSkeleton is used to display a skeleton version while
11
+ * content is loading (handled by the BigNumber prop `loading`).
12
+ *
13
+ * Note: This component is only used within BigNumber.
14
+ */
15
+ export type BigNumberSkeletonProps = Pick<BigNumberProps, 'className' | 'size'> & React.HTMLAttributes<HTMLDivElement>;
16
+ export declare const BigNumberSkeleton: React.ForwardRefExoticComponent<Pick<BigNumberProps, "className" | "size"> & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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
+ export declare enum BigNumberSize {
8
+ Default = "default",
9
+ Large = "lg",
10
+ XLarge = "xl"
11
+ }
12
+ export type BigNumberSizeValues = `${BigNumberSize}`;
13
+ export declare enum Characters {
14
+ Dash = "\u2013",
15
+ Slash = "/"
16
+ }
17
+ export declare const DefaultLocale = "en-US";
18
+ export declare const formatValue: (locale: Intl.LocalesArgument, value: number | null | undefined, fractionDigits: number, truncate: boolean) => string | null | undefined;
19
+ export declare const getIconSize: (size: BigNumberSizeValues) => number;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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
+ export { BigNumber } from './BigNumber';
8
+ export type { BigNumberProps } from './BigNumber';
9
+ export { BigNumberSkeleton } from './BigNumberSkeleton';
@@ -17,7 +17,7 @@ import { CardActions } from './CardActions';
17
17
  import { CardAction } from './CardAction';
18
18
  export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
19
19
  Header: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
20
- Body: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
20
+ Body: React.ForwardRefExoticComponent<import("./Card.types").CardBodyProps & React.RefAttributes<HTMLDivElement>>;
21
21
  Footer: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
22
22
  HeaderMedia: {
23
23
  ({ children, className, ...rest }: import("./CardHeaderMedia").CardHeaderMediaProps): import("react/jsx-runtime").JSX.Element;
@@ -23,6 +23,7 @@ react = require_runtime.__toESM(react);
23
23
  let classnames = require("classnames");
24
24
  classnames = require_runtime.__toESM(classnames);
25
25
  let react_jsx_runtime = require("react/jsx-runtime");
26
+ let _carbon_icons_react = require("@carbon/icons-react");
26
27
  //#region src/components/Card/Card.tsx
27
28
  /**
28
29
  * Copyright IBM Corp. 2026
@@ -34,19 +35,23 @@ const componentName = "Card";
34
35
  /**
35
36
  * Card component - Root container for composable card
36
37
  */
37
- const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKeyDown, disabled = false, density = "productive", decorator, horizontal = false, className, children, ...rest }, ref) => {
38
+ const CardComponent = (0, react.forwardRef)(({ as, clickable = false, onClick, onKeyDown, disabled = false, density = "productive", decorator, horizontal = false, renderFooterIcon: FooterIcon = _carbon_icons_react.ArrowRight, className, children, ...rest }, ref) => {
38
39
  const blockClass = `${require_usePrefix.usePrefix()}--card`;
39
40
  const hasAILabel = (0, react.useMemo)(() => (0, react.isValidElement)(decorator) && decorator.type === require_index.AILabel, [decorator]);
41
+ if (FooterIcon !== _carbon_icons_react.ArrowRight && !clickable) console.error("[Card] `renderFooterIcon` only has effect when `clickable` is true.");
42
+ if (clickable && !rest["aria-label"] && !rest["aria-labelledby"]) console.error("[Card] A clickable card must have an accessible name. Pass `aria-label` or `aria-labelledby` to the Card.");
40
43
  const contextValue = (0, react.useMemo)(() => ({
41
44
  clickable,
42
45
  disabled,
43
46
  decorator,
44
- horizontal
47
+ horizontal,
48
+ onClick
45
49
  }), [
46
50
  clickable,
47
51
  disabled,
48
52
  decorator,
49
- horizontal
53
+ horizontal,
54
+ onClick
50
55
  ]);
51
56
  const handleKeyDown = (0, react.useCallback)((event) => {
52
57
  if (clickable && !disabled && (event.key === "Enter" || event.key === " ")) {
@@ -70,17 +75,20 @@ const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKey
70
75
  [`${blockClass}--has-ai-label`]: hasAILabel,
71
76
  [`${blockClass}--horizontal`]: horizontal
72
77
  });
78
+ const BaseComponent = as ?? "div";
79
+ const isAnchor = BaseComponent === "a";
73
80
  const cardProps = {
74
81
  ...rest,
75
82
  ref,
76
83
  className: cardClasses,
77
- ...clickable && {
84
+ ...disabled && { "aria-disabled": true },
85
+ ...clickable && { ...isAnchor ? { onClick: handleClick } : {
78
86
  role: "button",
79
87
  tabIndex: disabled ? -1 : 0,
80
88
  onClick: handleClick,
81
89
  onKeyDown: handleKeyDown,
82
90
  "aria-disabled": disabled
83
- }
91
+ } }
84
92
  };
85
93
  const { mediaChildren, contentChildren, mediaIsFirst } = (0, react.useMemo)(() => {
86
94
  if (!horizontal) return {
@@ -106,9 +114,13 @@ const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKey
106
114
  }
107
115
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CardContext.CardContext.Provider, {
108
116
  value: contextValue,
109
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
117
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BaseComponent, {
110
118
  ...cardProps,
111
- children: renderedChildren
119
+ children: [renderedChildren, clickable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
120
+ className: `${blockClass}__clickable-footer`,
121
+ "aria-hidden": "true",
122
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FooterIcon, { "aria-hidden": "true" })
123
+ })]
112
124
  })
113
125
  });
114
126
  });
@@ -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 { ReactNode } from 'react';
7
+ import React, { ReactNode } from 'react';
8
8
  /**
9
9
  * Base props shared across card components
10
10
  */
@@ -23,17 +23,29 @@ export interface CardBaseProps {
23
23
  */
24
24
  export interface CardProps extends CardBaseProps {
25
25
  /**
26
- * Makes the entire card clickable
26
+ * The underlying element or component to render the card as.
27
+ * Defaults to `'div'`. Use `'a'` or a router Link component for
28
+ * navigation cards when combined with `clickable`.
29
+ * @example <Card as="a" clickable href="/dashboard">...</Card>
30
+ * @example <Card as={RouterLink} clickable to="/dashboard">...</Card>
31
+ */
32
+ as?: React.ElementType;
33
+ /**
34
+ * Makes the entire card clickable. When true, the card gains interactive
35
+ * styles (hover, focus, active) and renders a built-in footer affordance
36
+ * with an arrow icon. Use `onClick` for action cards or `as="a"` with
37
+ * `href` for navigation cards.
27
38
  */
28
39
  clickable?: boolean;
29
40
  /**
30
- * Click handler for clickable cards
41
+ * Click handler for clickable cards. Only has effect when `clickable`
42
+ * is true.
31
43
  */
32
- onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
44
+ onClick?: (event: React.MouseEvent) => void;
33
45
  /**
34
- * Keyboard event handler for clickable cards
46
+ * Keyboard event handler. Only has effect when `clickable` is true.
35
47
  */
36
- onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
48
+ onKeyDown?: (event: React.KeyboardEvent) => void;
37
49
  /**
38
50
  * Disables the card and all interactive elements
39
51
  */
@@ -52,6 +64,13 @@ export interface CardProps extends CardBaseProps {
52
64
  * header/body/footer stacked vertically on the right.
53
65
  */
54
66
  horizontal?: boolean;
67
+ /**
68
+ * Icon rendered in the built-in footer affordance of a clickable card.
69
+ * Only has effect when `clickable` is true. Defaults to ArrowRight.
70
+ * Pass any icon component from `@carbon/icons-react`.
71
+ * @example <Card clickable renderFooterIcon={Launch}>...</Card>
72
+ */
73
+ renderFooterIcon?: React.ElementType;
55
74
  }
56
75
  /**
57
76
  * Props for CardHeader component
@@ -60,7 +79,14 @@ export type CardHeaderProps = CardBaseProps;
60
79
  /**
61
80
  * Props for CardBody component
62
81
  */
63
- export type CardBodyProps = CardBaseProps;
82
+ export interface CardBodyProps extends CardBaseProps {
83
+ /**
84
+ * When true, removes all padding so content fills the body edge-to-edge.
85
+ * Use when the body contains a component (e.g. a table, chart, or image)
86
+ * that manages its own internal spacing.
87
+ */
88
+ isFlush?: boolean;
89
+ }
64
90
  /**
65
91
  * Props for CardFooter component
66
92
  */
@@ -85,4 +111,9 @@ export interface CardContextValue {
85
111
  * Whether the card is in horizontal layout mode
86
112
  */
87
113
  horizontal?: boolean;
114
+ /**
115
+ * Click handler forwarded from the Card root, available to child components
116
+ * (e.g. the built-in clickable footer affordance).
117
+ */
118
+ onClick?: (event: React.MouseEvent) => void;
88
119
  }
@@ -76,7 +76,7 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
76
76
  style: { position: "relative" },
77
77
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.OverflowMenu, {
78
78
  size: "sm",
79
- "aria-label": overflowMenuLabel,
79
+ label: overflowMenuLabel,
80
80
  children: hiddenItems.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MenuItem.MenuItem, {
81
81
  label: item.label || "Action",
82
82
  onClick: () => {
@@ -5,7 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import { CardBodyProps } from './Card.types';
8
9
  /**
9
10
  * CardBody component - Body section of the card for free-form content
10
11
  */
11
- export declare const CardBody: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const CardBody: React.ForwardRefExoticComponent<CardBodyProps & React.RefAttributes<HTMLDivElement>>;
@@ -23,8 +23,9 @@ const componentName = "CardBody";
23
23
  /**
24
24
  * CardBody component - Body section of the card for free-form content
25
25
  */
26
- const CardBody = (0, react.forwardRef)(({ className, children, ...rest }, ref) => {
27
- const bodyClasses = (0, classnames.default)(`${require_usePrefix.usePrefix()}--card__body`, className);
26
+ const CardBody = (0, react.forwardRef)(({ className, children, isFlush = false, ...rest }, ref) => {
27
+ const prefix = require_usePrefix.usePrefix();
28
+ const bodyClasses = (0, classnames.default)(`${prefix}--card__body`, className, { [`${prefix}--card__body--flush`]: isFlush });
28
29
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
29
30
  ...rest,
30
31
  ref,
@@ -6,6 +6,10 @@
6
6
  */
7
7
  import React from 'react';
8
8
  /**
9
- * CardFooter component - Footer section of the card
9
+ * CardFooter component - Footer section of the card.
10
+ *
11
+ * Not supported inside a `clickable` card. A clickable card renders its own
12
+ * built-in footer affordance automatically. Use the `renderFooterIcon` prop on
13
+ * `Card` to customize the icon.
10
14
  */
11
15
  export declare const CardFooter: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
@@ -7,6 +7,7 @@
7
7
 
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
+ const require_CardContext = require("./CardContext.js");
10
11
  let react = require("react");
11
12
  react = require_runtime.__toESM(react);
12
13
  let classnames = require("classnames");
@@ -21,10 +22,20 @@ let react_jsx_runtime = require("react/jsx-runtime");
21
22
  */
22
23
  const componentName = "CardFooter";
23
24
  /**
24
- * CardFooter component - Footer section of the card
25
+ * CardFooter component - Footer section of the card.
26
+ *
27
+ * Not supported inside a `clickable` card. A clickable card renders its own
28
+ * built-in footer affordance automatically. Use the `renderFooterIcon` prop on
29
+ * `Card` to customize the icon.
25
30
  */
26
31
  const CardFooter = (0, react.forwardRef)(({ className, children, ...rest }, ref) => {
27
- const footerClasses = (0, classnames.default)(`${require_usePrefix.usePrefix()}--card__footer`, className);
32
+ const prefix = require_usePrefix.usePrefix();
33
+ const { clickable } = require_CardContext.useCardContext();
34
+ if (clickable) {
35
+ console.error("[Card] `Card.Footer` cannot be used inside a `clickable` card. A clickable card renders its own footer affordance automatically. Use the `renderFooterIcon` prop on `Card` to customize the icon.");
36
+ return null;
37
+ }
38
+ const footerClasses = (0, classnames.default)(`${prefix}--card__footer`, className);
28
39
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
29
40
  ...rest,
30
41
  ref,
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { ReactNode } from 'react';
8
- export interface CardTitleProps {
8
+ export interface CardTitleProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  /**
10
10
  * Provide the contents of the CardTitle.
11
11
  */
@@ -8,13 +8,13 @@
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
10
  const require_Text = require("../Text/Text.js");
11
- const require_keys = require("../../internal/keyboard/keys.js");
12
- const require_match = require("../../internal/keyboard/match.js");
13
11
  const require_useId = require("../../internal/useId.js");
14
12
  const require_deprecate = require("../../prop-types/deprecate.js");
15
13
  const require_defaultItemToString = require("../../internal/defaultItemToString.js");
16
14
  const require_isItemDisabled = require("../../internal/isItemDisabled.js");
17
15
  const require_utils = require("../../internal/utils.js");
16
+ const require_keys = require("../../internal/keyboard/keys.js");
17
+ const require_match = require("../../internal/keyboard/match.js");
18
18
  const require_index = require("../FeatureFlags/index.js");
19
19
  const require_index$1 = require("../AILabel/index.js");
20
20
  const require_mergeRefs = require("../../tools/mergeRefs.js");
@@ -8,11 +8,11 @@
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_warning = require("../../internal/warning.js");
10
10
  const require_usePrefix = require("../../internal/usePrefix.js");
11
- const require_keys = require("../../internal/keyboard/keys.js");
12
- const require_match = require("../../internal/keyboard/match.js");
13
11
  const require_useId = require("../../internal/useId.js");
14
12
  const require_deprecate = require("../../prop-types/deprecate.js");
15
13
  const require_utils = require("../../internal/utils.js");
14
+ const require_keys = require("../../internal/keyboard/keys.js");
15
+ const require_match = require("../../internal/keyboard/match.js");
16
16
  const require_index = require("../FeatureFlags/index.js");
17
17
  const require_index$1 = require("../AILabel/index.js");
18
18
  const require_mergeRefs = require("../../tools/mergeRefs.js");
@@ -7,11 +7,11 @@
7
7
 
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
+ const require_deprecate = require("../../prop-types/deprecate.js");
11
+ const require_utils = require("../../internal/utils.js");
10
12
  const require_keys = require("../../internal/keyboard/keys.js");
11
13
  const require_match = require("../../internal/keyboard/match.js");
12
14
  const require_navigation = require("../../internal/keyboard/navigation.js");
13
- const require_deprecate = require("../../prop-types/deprecate.js");
14
- const require_utils = require("../../internal/utils.js");
15
15
  const require_index = require("../Layout/index.js");
16
16
  const require_Switch = require("../Switch/Switch.js");
17
17
  const require_IconSwitch = require("../Switch/IconSwitch.js");
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React, { type ReactNode } from 'react';
8
8
  import flatpickr from 'flatpickr';
9
- import { DateLimit, DateOption } from 'flatpickr/dist/types/options';
9
+ import type { DateLimit, DateOption } from 'flatpickr/dist/types/options';
10
10
  import { type SupportedLocale } from './DatePickerLocales';
11
11
  export type DatePickerTypes = 'simple' | 'single' | 'range';
12
12
  export interface DatePickerProps {
@@ -7,10 +7,10 @@
7
7
 
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
- const require_keys = require("../../internal/keyboard/keys.js");
11
- const require_match = require("../../internal/keyboard/match.js");
12
10
  const require_deprecate = require("../../prop-types/deprecate.js");
13
11
  const require_utils = require("../../internal/utils.js");
12
+ const require_keys = require("../../internal/keyboard/keys.js");
13
+ const require_match = require("../../internal/keyboard/match.js");
14
14
  const require_index = require("../DatePickerInput/index.js");
15
15
  const require_appendToPlugin = require("./plugins/appendToPlugin.js");
16
16
  const require_fixEventsPlugin = require("./plugins/fixEventsPlugin.js");
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { type Config } from 'flatpickr/dist/plugins/rangePlugin';
8
- import { Instance } from 'flatpickr/dist/types/instance';
8
+ import type { Instance } from 'flatpickr/dist/types/instance';
9
9
  /**
10
10
  * @param config Plugin configuration.
11
11
  * @returns An extension of Flatpickr `rangePlugin` that does the following:
@@ -8,9 +8,9 @@
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
10
  const require_Text = require("../Text/Text.js");
11
+ const require_useId = require("../../internal/useId.js");
11
12
  const require_keys = require("../../internal/keyboard/keys.js");
12
13
  const require_match = require("../../internal/keyboard/match.js");
13
- const require_useId = require("../../internal/useId.js");
14
14
  const require_index = require("../FeatureFlags/index.js");
15
15
  const require_Button = require("../Button/Button.js");
16
16
  const require_Filename = require("./Filename.js");