@carbon/react 1.108.0-rc.0 → 1.109.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 (48) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +974 -974
  2. package/es/components/Button/ButtonBase.js +5 -5
  3. package/es/components/ComboBox/ComboBox.js +28 -1
  4. package/es/components/ComposedModal/ModalFooter.d.ts +5 -0
  5. package/es/components/ComposedModal/ModalFooter.js +3 -1
  6. package/es/components/DataTable/DataTable.d.ts +9 -3
  7. package/es/components/DataTable/DataTable.js +10 -8
  8. package/es/components/DataTable/TableToolbar.d.ts +8 -2
  9. package/es/components/DataTable/TableToolbar.js +21 -11
  10. package/es/components/DataTable/TableToolbarMenu.d.ts +5 -1
  11. package/es/components/DataTable/TableToolbarMenu.js +12 -2
  12. package/es/components/DataTable/TableToolbarSearch.d.ts +2 -6
  13. package/es/components/DataTable/TableToolbarSearch.js +5 -1
  14. package/es/components/Dialog/Dialog.d.ts +5 -0
  15. package/es/components/Dialog/Dialog.js +3 -1
  16. package/es/components/Menu/MenuItem.js +3 -2
  17. package/es/components/Modal/Modal.d.ts +5 -0
  18. package/es/components/Modal/Modal.js +17 -7
  19. package/es/components/OverflowMenuItem/OverflowMenuItem.js +3 -2
  20. package/es/components/Tabs/Tabs.d.ts +5 -1
  21. package/es/components/Tabs/Tabs.js +2 -1
  22. package/es/index.d.ts +1 -0
  23. package/es/index.js +2 -1
  24. package/es/internal/FloatingMenu.js +5 -3
  25. package/lib/components/Button/ButtonBase.js +5 -5
  26. package/lib/components/ComboBox/ComboBox.js +28 -1
  27. package/lib/components/ComposedModal/ModalFooter.d.ts +5 -0
  28. package/lib/components/ComposedModal/ModalFooter.js +3 -1
  29. package/lib/components/DataTable/DataTable.d.ts +9 -3
  30. package/lib/components/DataTable/DataTable.js +10 -8
  31. package/lib/components/DataTable/TableToolbar.d.ts +8 -2
  32. package/lib/components/DataTable/TableToolbar.js +20 -9
  33. package/lib/components/DataTable/TableToolbarMenu.d.ts +5 -1
  34. package/lib/components/DataTable/TableToolbarMenu.js +12 -2
  35. package/lib/components/DataTable/TableToolbarSearch.d.ts +2 -6
  36. package/lib/components/DataTable/TableToolbarSearch.js +5 -1
  37. package/lib/components/Dialog/Dialog.d.ts +5 -0
  38. package/lib/components/Dialog/Dialog.js +3 -1
  39. package/lib/components/Menu/MenuItem.js +3 -2
  40. package/lib/components/Modal/Modal.d.ts +5 -0
  41. package/lib/components/Modal/Modal.js +16 -6
  42. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +3 -2
  43. package/lib/components/Tabs/Tabs.d.ts +5 -1
  44. package/lib/components/Tabs/Tabs.js +2 -1
  45. package/lib/index.d.ts +1 -0
  46. package/lib/index.js +2 -0
  47. package/lib/internal/FloatingMenu.js +5 -3
  48. package/package.json +9 -9
@@ -77,7 +77,7 @@ const Modal = react.default.forwardRef(function Modal({ open, ...props }, ref) {
77
77
  ...props
78
78
  });
79
79
  });
80
- const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label": ariaLabelProp, children, className, decorator, modalHeading = "", modalLabel = "", modalAriaLabel, passiveModal = false, secondaryButtonText, primaryButtonText, open: externalOpen, onRequestClose = require_noopFn.noopFn, onRequestSubmit = require_noopFn.noopFn, onSecondarySubmit, primaryButtonDisabled = false, danger, alert, secondaryButtons, selectorPrimaryFocus = "[data-modal-primary-focus]", selectorsFloatingMenus, shouldSubmitOnEnter, size, hasScrollingContent = false, closeButtonLabel = "Close", preventCloseOnClickOutside, isFullWidth, launcherButtonRef, loadingStatus = "inactive", loadingDescription, loadingIconDescription, onLoadingSuccess = require_noopFn.noopFn, slug, ...rest }, ref) {
80
+ const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label": ariaLabelProp, children, className, decorator, modalHeading = "", modalLabel = "", modalAriaLabel, passiveModal = false, secondaryButtonText, primaryButtonText, open: externalOpen, onRequestClose = require_noopFn.noopFn, onRequestSubmit = require_noopFn.noopFn, onSecondarySubmit, primaryButtonDisabled = false, danger, dangerDescription = "", alert, secondaryButtons, selectorPrimaryFocus = "[data-modal-primary-focus]", selectorsFloatingMenus, shouldSubmitOnEnter, size, hasScrollingContent = false, closeButtonLabel = "Close", preventCloseOnClickOutside, isFullWidth, launcherButtonRef, loadingStatus = "inactive", loadingDescription, loadingIconDescription, onLoadingSuccess = require_noopFn.noopFn, slug, ...rest }, ref) {
81
81
  const prefix = require_usePrefix.usePrefix();
82
82
  const button = (0, react.useRef)(null);
83
83
  const secondaryButton = (0, react.useRef)(null);
@@ -171,11 +171,18 @@ const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label"
171
171
  [`${prefix}--modal-container--${size}`]: size,
172
172
  [`${prefix}--modal-container--full-width`]: isFullWidth
173
173
  });
174
- /**
175
- * isScrollable is implicitly dependent on height, when height gets updated
176
- * via `useResizeObserver`, clientHeight and scrollHeight get updated too
177
- */
178
- const isScrollable = !!contentRef.current && contentRef?.current?.scrollHeight > contentRef?.current?.clientHeight;
174
+ const currentScrollHeight = contentRef.current?.scrollHeight || 0;
175
+ const currentClientHeight = contentRef.current?.clientHeight || 0;
176
+ const [isScrollable, setIsScrollable] = (0, react.useState)(currentScrollHeight > currentClientHeight);
177
+ (0, react.useEffect)(() => {
178
+ if (!contentRef.current) {
179
+ setIsScrollable(false);
180
+ return;
181
+ }
182
+ const diff = contentRef.current.scrollHeight - contentRef.current.clientHeight;
183
+ if (diff > 5) setIsScrollable(true);
184
+ else if (diff < -5) setIsScrollable(false);
185
+ }, [currentScrollHeight, currentClientHeight]);
179
186
  const contentClasses = (0, classnames.default)(`${prefix}--modal-content`, {
180
187
  [`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable,
181
188
  [`${prefix}--modal-scroll-content--no-fade`]: height <= 300
@@ -366,6 +373,7 @@ const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label"
366
373
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$2.default, {
367
374
  className: primaryButtonClass,
368
375
  kind: danger ? "danger" : "primary",
376
+ dangerDescription,
369
377
  disabled: loadingActive || primaryButtonDisabled,
370
378
  onClick: onRequestSubmit,
371
379
  ref: button,
@@ -442,6 +450,7 @@ const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label"
442
450
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$2.default, {
443
451
  className: primaryButtonClass,
444
452
  kind: danger ? "danger" : "primary",
453
+ dangerDescription,
445
454
  disabled: loadingActive || primaryButtonDisabled,
446
455
  onClick: onRequestSubmit,
447
456
  ref: button,
@@ -484,6 +493,7 @@ Modal.propTypes = {
484
493
  className: prop_types.default.string,
485
494
  closeButtonLabel: prop_types.default.string,
486
495
  danger: prop_types.default.bool,
496
+ dangerDescription: prop_types.default.string,
487
497
  decorator: prop_types.default.node,
488
498
  hasScrollingContent: prop_types.default.bool,
489
499
  id: prop_types.default.string,
@@ -27,7 +27,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
27
27
  * LICENSE file in the root directory of this source tree.
28
28
  */
29
29
  const OverflowMenuItem = (0, react.forwardRef)((props, ref) => {
30
- const { className, closeMenu, dangerDescription = "danger", disabled = false, handleOverflowMenuItemFocus, hasDivider = false, href, isDelete = false, index, itemText = "Provide itemText", onClick = () => {}, onKeyDown = () => {}, requireTitle, title, wrapperClassName, ...rest } = props;
30
+ const { className, closeMenu, dangerDescription = "", disabled = false, handleOverflowMenuItemFocus, hasDivider = false, href, isDelete = false, index, itemText = "Provide itemText", onClick = () => {}, onKeyDown = () => {}, requireTitle, title, wrapperClassName, ...rest } = props;
31
31
  const prefix = require_usePrefix.usePrefix();
32
32
  function setTabFocus(evt) {
33
33
  if (require_match.match(evt, require_keys.ArrowDown)) handleOverflowMenuItemFocus?.({
@@ -51,13 +51,14 @@ const OverflowMenuItem = (0, react.forwardRef)((props, ref) => {
51
51
  [`${prefix}--overflow-menu-options__option--disabled`]: disabled
52
52
  }, wrapperClassName);
53
53
  const TagToUse = href ? "a" : "button";
54
+ const hasDangerDescription = isDelete && Boolean(dangerDescription);
54
55
  const assistiveId = require_useId.useId("danger-description");
55
56
  const OverflowMenuItemContent = (() => {
56
57
  if (typeof itemText !== "string") return itemText;
57
58
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
58
59
  className: `${prefix}--overflow-menu-options__option-content`,
59
60
  children: itemText
60
- }), isDelete && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
61
+ }), hasDangerDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
61
62
  id: assistiveId,
62
63
  className: `${prefix}--visually-hidden`,
63
64
  children: dangerDescription
@@ -192,8 +192,12 @@ export interface TabListProps extends DivAttributes {
192
192
  * on component rerender
193
193
  */
194
194
  scrollIntoView?: boolean;
195
+ /**
196
+ * Specify the size of the tabs.
197
+ */
198
+ size?: 'sm' | 'md' | 'lg';
195
199
  }
196
- declare function TabList({ activation, 'aria-label': label, children, className: customClassName, contained, fullWidth, iconSize, leftOverflowButtonProps, light, rightOverflowButtonProps, scrollDebounceWait, scrollIntoView, ...rest }: TabListProps): import("react/jsx-runtime").JSX.Element;
200
+ declare function TabList({ activation, 'aria-label': label, children, className: customClassName, contained, fullWidth, iconSize, leftOverflowButtonProps, light, rightOverflowButtonProps, scrollDebounceWait, scrollIntoView, size, ...rest }: TabListProps): import("react/jsx-runtime").JSX.Element;
197
201
  declare namespace TabList {
198
202
  var propTypes: {
199
203
  /**
@@ -148,7 +148,7 @@ function getNextIndexVertical(event, total, index) {
148
148
  default: return index;
149
149
  }
150
150
  }
151
- function TabList({ activation = "automatic", "aria-label": label, children, className: customClassName, contained = false, fullWidth = false, iconSize, leftOverflowButtonProps, light, rightOverflowButtonProps, scrollDebounceWait = 200, scrollIntoView, ...rest }) {
151
+ function TabList({ activation = "automatic", "aria-label": label, children, className: customClassName, contained = false, fullWidth = false, iconSize, leftOverflowButtonProps, light, rightOverflowButtonProps, scrollDebounceWait = 200, scrollIntoView, size, ...rest }) {
152
152
  const { activeIndex, selectedIndex, setSelectedIndex, setActiveIndex, dismissable } = react.default.useContext(TabsContext);
153
153
  const prefix = require_usePrefix.usePrefix();
154
154
  const ref = (0, react.useRef)(null);
@@ -165,6 +165,7 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
165
165
  [`${prefix}--tabs__icon--default`]: iconSize === "default",
166
166
  [`${prefix}--tabs__icon--lg`]: iconSize === "lg",
167
167
  [`${prefix}--layout--size-lg`]: iconSize === "lg",
168
+ [`${prefix}--layout--size-${size}`]: size && contained && !hasSecondaryLabelTabs,
168
169
  [`${prefix}--tabs--tall`]: hasSecondaryLabelTabs,
169
170
  [`${prefix}--tabs--full-width`]: distributeWidth,
170
171
  [`${prefix}--tabs--dismissable`]: dismissable
package/lib/index.d.ts CHANGED
@@ -46,6 +46,7 @@ export * from './components/FormLabel';
46
46
  export * from './components/Grid';
47
47
  export * from './components/Icon/Icon.Skeleton';
48
48
  export * from './components/IdPrefix';
49
+ export { InlineCheckbox } from './components/InlineCheckbox';
49
50
  export * from './components/InlineLoading';
50
51
  export * from './components/Link';
51
52
  export * from './components/ListItem';
package/lib/index.js CHANGED
@@ -83,6 +83,7 @@ const require_TableExpandedRow = require("./components/DataTable/TableExpandedRo
83
83
  const require_TableHead = require("./components/DataTable/TableHead.js");
84
84
  const require_TableHeader = require("./components/DataTable/TableHeader.js");
85
85
  const require_TableRow = require("./components/DataTable/TableRow.js");
86
+ const require_InlineCheckbox = require("./components/InlineCheckbox/InlineCheckbox.js");
86
87
  const require_TableSelectAll = require("./components/DataTable/TableSelectAll.js");
87
88
  const require_RadioButton = require("./components/RadioButton/RadioButton.js");
88
89
  const require_TableSelectRow = require("./components/DataTable/TableSelectRow.js");
@@ -366,6 +367,7 @@ exports.IconSkeleton = require_Icon_Skeleton.default || require_Icon_Skeleton;
366
367
  exports.IconSwitch = require_IconSwitch.default || require_IconSwitch;
367
368
  exports.IconTab = require_Tabs.IconTab;
368
369
  exports.IdPrefix = require_index$13.IdPrefix;
370
+ exports.InlineCheckbox = require_InlineCheckbox.default || require_InlineCheckbox;
369
371
  exports.InlineLoading = require_InlineLoading.default || require_InlineLoading;
370
372
  exports.InlineNotification = require_Notification.InlineNotification;
371
373
  exports.Layer = require_index$8.Layer;
@@ -116,7 +116,10 @@ const FloatingMenu = ({ children, flipped, focusTrap, menuDirection = DIRECTION_
116
116
  position: getComputedStyle(target()).position
117
117
  }
118
118
  });
119
- if (!floatingPosition || floatingPosition.left !== newFloatingPosition.left || floatingPosition.top !== newFloatingPosition.top) setFloatingPosition(newFloatingPosition);
119
+ setFloatingPosition((prev) => {
120
+ if (prev && prev.left === newFloatingPosition.left && prev.top === newFloatingPosition.top) return prev;
121
+ return newFloatingPosition;
122
+ });
120
123
  if (!isAdjustment) {
121
124
  const newMenuSize = menuBody.getBoundingClientRect();
122
125
  if (newMenuSize.width !== menuSize.width || newMenuSize.height !== menuSize.height) updateMenuPosition(true);
@@ -128,8 +131,7 @@ const FloatingMenu = ({ children, flipped, focusTrap, menuDirection = DIRECTION_
128
131
  menuDirection,
129
132
  flipped,
130
133
  target,
131
- updateOrientation,
132
- floatingPosition
134
+ updateOrientation
133
135
  ]);
134
136
  const focusMenuContent = (menuBody) => {
135
137
  const primaryFocusNode = selectorPrimaryFocus ? menuBody.querySelector(selectorPrimaryFocus) : null;
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.108.0-rc.0",
4
+ "version": "1.109.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -53,10 +53,10 @@
53
53
  "dependencies": {
54
54
  "@babel/runtime": "^7.27.3",
55
55
  "@carbon/feature-flags": "^1.3.0",
56
- "@carbon/icons-react": "^11.81.0-rc.0",
57
- "@carbon/layout": "^11.53.0-rc.0",
58
- "@carbon/styles": "^1.107.0-rc.0",
59
- "@carbon/utilities": "^0.20.0-rc.0",
56
+ "@carbon/icons-react": "^11.82.0-rc.0",
57
+ "@carbon/layout": "^11.53.0",
58
+ "@carbon/styles": "^1.108.0-rc.0",
59
+ "@carbon/utilities": "^0.20.0",
60
60
  "@floating-ui/react": "^0.27.4",
61
61
  "@ibm/telemetry-js": "^1.5.0",
62
62
  "classnames": "2.5.1",
@@ -79,8 +79,8 @@
79
79
  "@babel/preset-react": "^7.27.1",
80
80
  "@babel/preset-typescript": "^7.27.1",
81
81
  "@carbon/test-utils": "^10.41.0",
82
- "@carbon/themes": "^11.74.0-rc.0",
83
- "@figma/code-connect": "^1.4.2",
82
+ "@carbon/themes": "^11.75.0-rc.0",
83
+ "@figma/code-connect": "^1.4.5",
84
84
  "@stackblitz/sdk": "^1.11.0",
85
85
  "@storybook/addon-a11y": "^10.3.5",
86
86
  "@storybook/addon-docs": "^10.3.5",
@@ -110,7 +110,7 @@
110
110
  "stream-browserify": "^3.0.0",
111
111
  "tinyclip": "^0.1.12",
112
112
  "tsdown": "^0.21.0",
113
- "typescript-config-carbon": "^0.10.0-rc.0",
113
+ "typescript-config-carbon": "^0.10.0",
114
114
  "use-sync-external-store": "^1.5.0",
115
115
  "vite": "^7.1.2"
116
116
  },
@@ -125,5 +125,5 @@
125
125
  "**/*.scss",
126
126
  "**/*.css"
127
127
  ],
128
- "gitHead": "3d219dfcc2a3da515016f7ce0e769d013c3a6c03"
128
+ "gitHead": "b23ca747c33b76557a54aa88b6df70bc76f55da9"
129
129
  }