@carbon/react 1.111.0 → 1.112.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 (37) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +960 -1001
  2. package/es/components/ComboBox/ComboBox.js +7 -7
  3. package/es/components/Dropdown/Dropdown.js +1 -4
  4. package/es/components/FeatureFlags/index.js +32 -14
  5. package/es/components/IconIndicator/index.d.ts +33 -1
  6. package/es/components/IconIndicator/index.js +55 -26
  7. package/es/components/MultiSelect/FilterableMultiSelect.js +6 -7
  8. package/es/components/MultiSelect/MultiSelect.js +3 -4
  9. package/es/components/OverflowMenu/OverflowMenu.js +31 -6
  10. package/es/components/OverflowMenu/next/index.d.ts +1 -1
  11. package/es/components/OverflowMenu/next/index.js +2 -2
  12. package/es/components/ShapeIndicator/index.d.ts +18 -0
  13. package/es/components/ShapeIndicator/index.js +49 -7
  14. package/es/components/Tabs/Tabs.js +1 -1
  15. package/es/components/Tooltip/DefinitionTooltip.js +5 -2
  16. package/es/internal/index.d.ts +2 -1
  17. package/es/internal/isItemDisabled.d.ts +7 -0
  18. package/es/internal/isItemDisabled.js +17 -0
  19. package/lib/components/ComboBox/ComboBox.js +7 -7
  20. package/lib/components/Dropdown/Dropdown.js +2 -5
  21. package/lib/components/FeatureFlags/index.js +32 -14
  22. package/lib/components/IconIndicator/index.d.ts +33 -1
  23. package/lib/components/IconIndicator/index.js +54 -25
  24. package/lib/components/MultiSelect/FilterableMultiSelect.js +6 -7
  25. package/lib/components/MultiSelect/MultiSelect.js +3 -4
  26. package/lib/components/OverflowMenu/OverflowMenu.js +30 -5
  27. package/lib/components/OverflowMenu/next/index.d.ts +1 -1
  28. package/lib/components/OverflowMenu/next/index.js +2 -2
  29. package/lib/components/ShapeIndicator/index.d.ts +18 -0
  30. package/lib/components/ShapeIndicator/index.js +48 -6
  31. package/lib/components/Tabs/Tabs.js +1 -1
  32. package/lib/components/Tooltip/DefinitionTooltip.js +4 -1
  33. package/lib/internal/index.d.ts +2 -1
  34. package/lib/internal/isItemDisabled.d.ts +7 -0
  35. package/lib/internal/isItemDisabled.js +17 -0
  36. package/package.json +9 -8
  37. package/telemetry.yml +2 -0
@@ -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_DefinitionTooltip = require("../Tooltip/DefinitionTooltip.js");
10
11
  let classnames = require("classnames");
11
12
  classnames = require_runtime.__toESM(classnames);
12
13
  let react = require("react");
@@ -65,26 +66,62 @@ const shapeTypes = {
65
66
  incomplete: incompleteIcon,
66
67
  draft: _carbon_icons_react.CircleStroke
67
68
  };
68
- const ShapeIndicator = react.default.forwardRef(({ className: customClassName, kind, label, textSize = 12 }, ref) => {
69
+ const ShapeIndicator = react.default.forwardRef(({ align = "right", autoAlign = false, className: customClassName, compact = false, kind, label, shapeDescription, textSize = 12 }, ref) => {
69
70
  const prefix = require_usePrefix.usePrefix();
70
71
  const classNames = (0, classnames.default)(`${prefix}--shape-indicator`, customClassName, { [`${prefix}--shape-indicator--14`]: textSize == 14 });
71
72
  const ShapeForKind = shapeTypes[kind];
72
73
  if (!ShapeForKind) return null;
73
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
74
+ const shapeElement = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShapeForKind, {
75
+ size: 16,
76
+ className: `${prefix}--shape-indicator--${kind}`
77
+ });
78
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
74
79
  className: classNames,
75
80
  ref,
76
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShapeForKind, {
77
- size: 16,
78
- className: `${prefix}--shape-indicator--${kind}`
79
- }), label]
81
+ children: compact ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_DefinitionTooltip.DefinitionTooltip, {
82
+ align,
83
+ autoAlign,
84
+ openOnHover: true,
85
+ definition: label,
86
+ triggerClassName: `${prefix}--shape-indicator__button`,
87
+ children: [shapeElement, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
88
+ className: `${prefix}--visually-hidden`,
89
+ children: shapeDescription ?? label
90
+ })]
91
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [shapeElement, label] })
80
92
  });
81
93
  });
82
94
  ShapeIndicator.propTypes = {
95
+ /**
96
+ * Specify how the tooltip should align with the shape in compact mode
97
+ */
98
+ align: prop_types.default.oneOf([
99
+ "top",
100
+ "top-start",
101
+ "top-end",
102
+ "bottom",
103
+ "bottom-start",
104
+ "bottom-end",
105
+ "left",
106
+ "left-start",
107
+ "left-end",
108
+ "right",
109
+ "right-start",
110
+ "right-end"
111
+ ]),
112
+ /**
113
+ * Will auto-align the tooltip in compact mode
114
+ */
115
+ autoAlign: prop_types.default.bool,
83
116
  /**
84
117
  * Specify an optional className to add.
85
118
  */
86
119
  className: prop_types.default.string,
87
120
  /**
121
+ * When true, displays only the shape with the label in a tooltip
122
+ */
123
+ compact: prop_types.default.bool,
124
+ /**
88
125
  * Specify the kind of the Shape Indicator
89
126
  */
90
127
  kind: prop_types.default.oneOf(ShapeIndicatorKinds).isRequired,
@@ -93,6 +130,11 @@ ShapeIndicator.propTypes = {
93
130
  */
94
131
  label: prop_types.default.string.isRequired,
95
132
  /**
133
+ * Description for the shape announced to screen readers in compact mode.
134
+ * Defaults to `label` when not provided.
135
+ */
136
+ shapeDescription: prop_types.default.string,
137
+ /**
96
138
  * Specify the text size of the Shape Indicator. Defaults to 12.
97
139
  */
98
140
  textSize: prop_types.default.oneOf([12, 14])
@@ -934,7 +934,7 @@ function TabPanels({ children }) {
934
934
  const isVertical = tabContainer?.classList.contains(`${prefix}--tabs--vertical`);
935
935
  const parentHasHeight = tabContainer?.parentElement?.style.height;
936
936
  if (isVertical && !parentHasHeight) {
937
- hiddenStates.current = refs.current.map((ref) => ref?.hidden || false);
937
+ hiddenStates.current = refs.current.map((ref) => ref?.hasAttribute("hidden") || false);
938
938
  refs.current.forEach((ref) => {
939
939
  if (ref) ref.hidden = false;
940
940
  });
@@ -31,7 +31,10 @@ const DefinitionTooltip = ({ align = "bottom", autoAlign, className, children, d
31
31
  const prefix = require_usePrefix.usePrefix();
32
32
  const tooltipId = require_useId.useFallbackId(id);
33
33
  function onKeyDown(event) {
34
- if (isOpen && require_match.match(event, require_keys.Escape)) {
34
+ if (require_match.match(event, require_keys.Enter) || require_match.match(event, require_keys.Space)) {
35
+ event.preventDefault();
36
+ setOpen(!isOpen);
37
+ } else if (isOpen && require_match.match(event, require_keys.Escape)) {
35
38
  event.stopPropagation();
36
39
  setOpen(false);
37
40
  }
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Copyright IBM Corp. 2025
2
+ * Copyright IBM Corp. 2025, 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.
6
6
  */
7
7
  export * from './defaultItemToString';
8
+ export * from './isItemDisabled';
8
9
  export * from './utils';
@@ -0,0 +1,7 @@
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 const isItemDisabled: (item: unknown) => boolean;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 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
+
8
+ //#region src/internal/isItemDisabled.ts
9
+ /**
10
+ * Copyright IBM Corp. 2026
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ const isItemDisabled = (item) => item !== null && typeof item === "object" && "disabled" in item && item.disabled === true;
16
+ //#endregion
17
+ exports.isItemDisabled = isItemDisabled;
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.111.0",
4
+ "version": "1.112.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.4.0",
56
- "@carbon/icons-react": "^11.83.0",
57
- "@carbon/layout": "^11.54.0",
58
- "@carbon/styles": "^1.110.0",
59
- "@carbon/utilities": "^0.21.0",
56
+ "@carbon/icons-react": "^11.84.0-rc.0",
57
+ "@carbon/layout": "^11.55.0-rc.0",
58
+ "@carbon/styles": "^1.111.0-rc.0",
59
+ "@carbon/utilities": "^0.22.0-rc.0",
60
60
  "@floating-ui/react": "^0.27.4",
61
61
  "@ibm/telemetry-js": "^1.5.0",
62
62
  "classnames": "2.5.1",
@@ -79,7 +79,7 @@
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.76.0",
82
+ "@carbon/themes": "^11.77.0-rc.0",
83
83
  "@figma/code-connect": "^1.4.7",
84
84
  "@stackblitz/sdk": "^1.11.0",
85
85
  "@storybook/addon-a11y": "^10.3.5",
@@ -110,7 +110,8 @@
110
110
  "stream-browserify": "^3.0.0",
111
111
  "tinyclip": "^0.1.12",
112
112
  "tsdown": "^0.22.0",
113
- "typescript-config-carbon": "^0.10.0",
113
+ "typescript": "^6.0.3",
114
+ "typescript-config-carbon": "^0.11.0-rc.0",
114
115
  "use-sync-external-store": "^1.5.0",
115
116
  "vite": "^8.0.0"
116
117
  },
@@ -125,5 +126,5 @@
125
126
  "**/*.scss",
126
127
  "**/*.css"
127
128
  ],
128
- "gitHead": "30ca2b932469a5c89da10cb8d1fa82586ed14018"
129
+ "gitHead": "1738a92e35dc0b9ba19877b9a4319bcc3336c5b1"
129
130
  }
package/telemetry.yml CHANGED
@@ -43,6 +43,7 @@ collect:
43
43
  - closeOnActivation
44
44
  - cols
45
45
  - colSpan
46
+ - compact
46
47
  - compareItems
47
48
  - condensed
48
49
  - contained
@@ -531,6 +532,7 @@ collect:
531
532
  # SelectItem
532
533
  - hidden
533
534
  # ShapeIndicator
535
+ - shapeDescription
534
536
  - textSize
535
537
  # SideNav
536
538
  - addMouseListeners