@carbon/react 1.43.0-rc.0 → 1.44.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.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1161 -1001
- package/es/components/ComboBox/ComboBox.js +12 -0
- package/es/components/ComboButton/index.js +2 -1
- package/es/components/ComposedModal/ComposedModal.d.ts +3 -3
- package/es/components/ComposedModal/ComposedModal.js +3 -3
- package/es/components/ContextMenu/useContextMenu.js +2 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +1 -1
- package/es/components/Dropdown/Dropdown.js +4 -1
- package/es/components/Link/Link.d.ts +5 -0
- package/es/components/Link/Link.js +9 -2
- package/es/components/Menu/Menu.js +14 -0
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.js +19 -4
- package/es/components/MenuButton/index.js +3 -1
- package/es/components/Slug/index.js +1 -1
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/Switcher.d.ts +38 -0
- package/es/components/UIShell/Switcher.js +14 -13
- package/es/components/UIShell/SwitcherDivider.d.ts +9 -0
- package/es/components/UIShell/SwitcherDivider.js +4 -5
- package/es/components/UIShell/SwitcherItem.d.ts +49 -0
- package/es/components/UIShell/SwitcherItem.js +13 -17
- package/es/prop-types/tools/getDisplayName.js +34 -0
- package/lib/components/ComboBox/ComboBox.js +12 -0
- package/lib/components/ComboButton/index.js +2 -1
- package/lib/components/ComposedModal/ComposedModal.d.ts +3 -3
- package/lib/components/ComposedModal/ComposedModal.js +3 -3
- package/lib/components/ContextMenu/useContextMenu.js +2 -1
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +4 -1
- package/lib/components/Link/Link.d.ts +5 -0
- package/lib/components/Link/Link.js +9 -2
- package/lib/components/Menu/Menu.js +14 -0
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.js +19 -4
- package/lib/components/MenuButton/index.js +3 -1
- package/lib/components/Slug/index.js +1 -1
- package/lib/components/UIShell/SideNav.js +1 -1
- package/lib/components/UIShell/Switcher.d.ts +38 -0
- package/lib/components/UIShell/Switcher.js +13 -12
- package/lib/components/UIShell/SwitcherDivider.d.ts +9 -0
- package/lib/components/UIShell/SwitcherDivider.js +4 -5
- package/lib/components/UIShell/SwitcherItem.d.ts +49 -0
- package/lib/components/UIShell/SwitcherItem.js +12 -16
- package/lib/prop-types/tools/getDisplayName.js +38 -0
- package/package.json +3 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
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
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
const cachedDisplayNames = new WeakMap();
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `getDisplayName` is a utility function for getting a name from a given
|
|
16
|
+
* component type. It supports names from React elements, Stateless Functional
|
|
17
|
+
* Components, and Class-based Components
|
|
18
|
+
*/
|
|
19
|
+
const getDisplayName = type => {
|
|
20
|
+
if (typeof type === 'string') {
|
|
21
|
+
return type;
|
|
22
|
+
}
|
|
23
|
+
if (cachedDisplayNames.has(type)) {
|
|
24
|
+
return cachedDisplayNames.get(type);
|
|
25
|
+
}
|
|
26
|
+
let displayName;
|
|
27
|
+
if (typeof type.displayName === 'string') {
|
|
28
|
+
displayName = type.displayName;
|
|
29
|
+
}
|
|
30
|
+
if (!displayName) {
|
|
31
|
+
displayName = type.name || 'Unknown';
|
|
32
|
+
}
|
|
33
|
+
cachedDisplayNames.set(type, displayName);
|
|
34
|
+
return displayName;
|
|
35
|
+
};
|
|
36
|
+
var getDisplayName$1 = getDisplayName;
|
|
37
|
+
|
|
38
|
+
exports["default"] = getDisplayName$1;
|
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.
|
|
4
|
+
"version": "1.44.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@carbon/feature-flags": "^0.16.0",
|
|
51
51
|
"@carbon/icons-react": "^11.31.0-rc.0",
|
|
52
52
|
"@carbon/layout": "^11.20.0",
|
|
53
|
-
"@carbon/styles": "^1.
|
|
53
|
+
"@carbon/styles": "^1.44.0-rc.0",
|
|
54
54
|
"@carbon/telemetry": "0.1.0",
|
|
55
55
|
"classnames": "2.3.2",
|
|
56
56
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"**/*.scss",
|
|
141
141
|
"**/*.css"
|
|
142
142
|
],
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "c9e8c54239275eb4451b25f7f11c4b8bf40ddd43"
|
|
144
144
|
}
|