@carbon/react 1.63.2 → 1.64.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 (98) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1523 -1160
  2. package/es/components/{Slug → AILabel}/index.js +47 -35
  3. package/es/components/{AiSkeleton/AiSkeletonIcon.d.ts → AISkeleton/AISkeletonIcon.d.ts} +4 -4
  4. package/es/components/{AiSkeleton/AiSkeletonIcon.js → AISkeleton/AISkeletonIcon.js} +5 -5
  5. package/es/components/{AiSkeleton/AiSkeletonPlaceholder.d.ts → AISkeleton/AISkeletonPlaceholder.d.ts} +4 -4
  6. package/es/components/{AiSkeleton/AiSkeletonPlaceholder.js → AISkeleton/AISkeletonPlaceholder.js} +5 -5
  7. package/es/components/{AiSkeleton/AiSkeletonText.d.ts → AISkeleton/AISkeletonText.d.ts} +4 -4
  8. package/es/components/{AiSkeleton/AiSkeletonText.js → AISkeleton/AISkeletonText.js} +3 -3
  9. package/es/components/AISkeleton/index.d.ts +10 -0
  10. package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
  11. package/es/components/ComboBox/ComboBox.js +4 -4
  12. package/es/components/ComposedModal/ComposedModal.js +1 -1
  13. package/es/components/DataTable/DataTable.js +1 -1
  14. package/es/components/DatePickerInput/DatePickerInput.js +1 -1
  15. package/es/components/Dropdown/Dropdown.js +12 -6
  16. package/es/components/FluidMultiSelect/FluidMultiSelect.js +4 -2
  17. package/es/components/Menu/MenuItem.js +45 -63
  18. package/es/components/Modal/Modal.js +1 -1
  19. package/es/components/MultiSelect/FilterableMultiSelect.js +44 -23
  20. package/es/components/MultiSelect/MultiSelect.js +6 -4
  21. package/es/components/NumberInput/NumberInput.js +2 -2
  22. package/es/components/OverflowMenu/OverflowMenu.js +2 -1
  23. package/es/components/OverflowMenu/next/index.js +2 -1
  24. package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  25. package/es/components/RadioTile/RadioTile.js +1 -1
  26. package/es/components/Select/Select.js +1 -1
  27. package/es/components/Tabs/Tabs.js +3 -3
  28. package/es/components/Tag/DismissibleTag.js +1 -1
  29. package/es/components/Tag/OperationalTag.js +1 -1
  30. package/es/components/Tag/SelectableTag.js +3 -1
  31. package/es/components/Tag/Tag.js +1 -1
  32. package/es/components/TextArea/TextArea.js +1 -1
  33. package/es/components/TextInput/PasswordInput.js +5 -0
  34. package/es/components/TextInput/TextInput.js +1 -1
  35. package/es/components/Tile/Tile.js +2 -2
  36. package/es/components/TreeView/TreeNode.d.ts +150 -0
  37. package/es/components/TreeView/TreeNode.js +22 -15
  38. package/es/components/TreeView/TreeView.d.ts +59 -0
  39. package/es/components/TreeView/TreeView.js +37 -23
  40. package/es/components/TreeView/index.d.ts +11 -0
  41. package/es/components/UIShell/SwitcherItem.d.ts +4 -0
  42. package/es/components/UIShell/SwitcherItem.js +7 -1
  43. package/es/index.d.ts +4 -2
  44. package/es/index.js +6 -6
  45. package/es/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +143 -0
  46. package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +39 -0
  47. package/lib/components/{Slug → AILabel}/index.js +49 -37
  48. package/lib/components/{AiSkeleton/AiSkeletonIcon.d.ts → AISkeleton/AISkeletonIcon.d.ts} +4 -4
  49. package/lib/components/{AiSkeleton/AiSkeletonIcon.js → AISkeleton/AISkeletonIcon.js} +5 -5
  50. package/lib/components/{AiSkeleton/AiSkeletonPlaceholder.d.ts → AISkeleton/AISkeletonPlaceholder.d.ts} +4 -4
  51. package/lib/components/{AiSkeleton/AiSkeletonPlaceholder.js → AISkeleton/AISkeletonPlaceholder.js} +5 -5
  52. package/lib/components/{AiSkeleton/AiSkeletonText.d.ts → AISkeleton/AISkeletonText.d.ts} +4 -4
  53. package/lib/components/{AiSkeleton/AiSkeletonText.js → AISkeleton/AISkeletonText.js} +3 -3
  54. package/lib/components/AISkeleton/index.d.ts +10 -0
  55. package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
  56. package/lib/components/ComboBox/ComboBox.js +4 -4
  57. package/lib/components/ComposedModal/ComposedModal.js +1 -1
  58. package/lib/components/DataTable/DataTable.js +2 -2
  59. package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
  60. package/lib/components/Dropdown/Dropdown.js +12 -6
  61. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +4 -2
  62. package/lib/components/Menu/MenuItem.js +44 -62
  63. package/lib/components/Modal/Modal.js +1 -1
  64. package/lib/components/MultiSelect/FilterableMultiSelect.js +43 -22
  65. package/lib/components/MultiSelect/MultiSelect.js +6 -4
  66. package/lib/components/NumberInput/NumberInput.js +2 -2
  67. package/lib/components/OverflowMenu/OverflowMenu.js +2 -1
  68. package/lib/components/OverflowMenu/next/index.js +2 -1
  69. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  70. package/lib/components/RadioTile/RadioTile.js +1 -1
  71. package/lib/components/Select/Select.js +1 -1
  72. package/lib/components/Tabs/Tabs.js +2 -2
  73. package/lib/components/Tag/DismissibleTag.js +1 -1
  74. package/lib/components/Tag/OperationalTag.js +1 -1
  75. package/lib/components/Tag/SelectableTag.js +3 -1
  76. package/lib/components/Tag/Tag.js +1 -1
  77. package/lib/components/TextArea/TextArea.js +1 -1
  78. package/lib/components/TextInput/PasswordInput.js +5 -0
  79. package/lib/components/TextInput/TextInput.js +1 -1
  80. package/lib/components/Tile/Tile.js +2 -2
  81. package/lib/components/TreeView/TreeNode.d.ts +150 -0
  82. package/lib/components/TreeView/TreeNode.js +24 -17
  83. package/lib/components/TreeView/TreeView.d.ts +59 -0
  84. package/lib/components/TreeView/TreeView.js +39 -25
  85. package/lib/components/TreeView/index.d.ts +11 -0
  86. package/lib/components/UIShell/SwitcherItem.d.ts +4 -0
  87. package/lib/components/UIShell/SwitcherItem.js +7 -1
  88. package/lib/index.d.ts +4 -2
  89. package/lib/index.js +20 -14
  90. package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +148 -0
  91. package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +47 -0
  92. package/package.json +4 -4
  93. package/scss/components/ai-label/_ai-label.scss +9 -0
  94. package/scss/components/ai-label/_index.scss +9 -0
  95. package/es/components/AiSkeleton/index.d.ts +0 -10
  96. package/es/components/DataTable/tools/instanceId.js +0 -20
  97. package/lib/components/AiSkeleton/index.d.ts +0 -10
  98. package/lib/components/DataTable/tools/instanceId.js +0 -24
@@ -0,0 +1,148 @@
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
+ var floatingUi_utils = require('../../utils/dist/floating-ui.utils.mjs.js');
13
+
14
+ /**
15
+ * Resolves with an object of overflow side offsets that determine how much the
16
+ * element is overflowing a given clipping boundary on each side.
17
+ * - positive = overflowing the boundary by that number of pixels
18
+ * - negative = how many pixels left before it will overflow
19
+ * - 0 = lies flush with the boundary
20
+ * @see https://floating-ui.com/docs/detectOverflow
21
+ */
22
+ async function detectOverflow(state, options) {
23
+ var _await$platform$isEle;
24
+ if (options === void 0) {
25
+ options = {};
26
+ }
27
+ const {
28
+ x,
29
+ y,
30
+ platform,
31
+ rects,
32
+ elements,
33
+ strategy
34
+ } = state;
35
+ const {
36
+ boundary = 'clippingAncestors',
37
+ rootBoundary = 'viewport',
38
+ elementContext = 'floating',
39
+ altBoundary = false,
40
+ padding = 0
41
+ } = floatingUi_utils.evaluate(options, state);
42
+ const paddingObject = floatingUi_utils.getPaddingObject(padding);
43
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
44
+ const element = elements[altBoundary ? altContext : elementContext];
45
+ const clippingClientRect = floatingUi_utils.rectToClientRect(await platform.getClippingRect({
46
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
47
+ boundary,
48
+ rootBoundary,
49
+ strategy
50
+ }));
51
+ const rect = elementContext === 'floating' ? {
52
+ ...rects.floating,
53
+ x,
54
+ y
55
+ } : rects.reference;
56
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
57
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
58
+ x: 1,
59
+ y: 1
60
+ } : {
61
+ x: 1,
62
+ y: 1
63
+ };
64
+ const elementClientRect = floatingUi_utils.rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
65
+ rect,
66
+ offsetParent,
67
+ strategy
68
+ }) : rect);
69
+ return {
70
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
71
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
72
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
73
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
74
+ };
75
+ }
76
+
77
+ function getSideOffsets(overflow, rect) {
78
+ return {
79
+ top: overflow.top - rect.height,
80
+ right: overflow.right - rect.width,
81
+ bottom: overflow.bottom - rect.height,
82
+ left: overflow.left - rect.width
83
+ };
84
+ }
85
+ function isAnySideFullyClipped(overflow) {
86
+ return floatingUi_utils.sides.some(side => overflow[side] >= 0);
87
+ }
88
+ /**
89
+ * Provides data to hide the floating element in applicable situations, such as
90
+ * when it is not in the same clipping context as the reference element.
91
+ * @see https://floating-ui.com/docs/hide
92
+ */
93
+ const hide = function (options) {
94
+ if (options === void 0) {
95
+ options = {};
96
+ }
97
+ return {
98
+ name: 'hide',
99
+ options,
100
+ async fn(state) {
101
+ const {
102
+ rects
103
+ } = state;
104
+ const {
105
+ strategy = 'referenceHidden',
106
+ ...detectOverflowOptions
107
+ } = floatingUi_utils.evaluate(options, state);
108
+ switch (strategy) {
109
+ case 'referenceHidden':
110
+ {
111
+ const overflow = await detectOverflow(state, {
112
+ ...detectOverflowOptions,
113
+ elementContext: 'reference'
114
+ });
115
+ const offsets = getSideOffsets(overflow, rects.reference);
116
+ return {
117
+ data: {
118
+ referenceHiddenOffsets: offsets,
119
+ referenceHidden: isAnySideFullyClipped(offsets)
120
+ }
121
+ };
122
+ }
123
+ case 'escaped':
124
+ {
125
+ const overflow = await detectOverflow(state, {
126
+ ...detectOverflowOptions,
127
+ altBoundary: true
128
+ });
129
+ const offsets = getSideOffsets(overflow, rects.floating);
130
+ return {
131
+ data: {
132
+ escapedOffsets: offsets,
133
+ escaped: isAnySideFullyClipped(offsets)
134
+ }
135
+ };
136
+ }
137
+ default:
138
+ {
139
+ return {};
140
+ }
141
+ }
142
+ }
143
+ };
144
+ };
145
+
146
+ exports.rectToClientRect = floatingUi_utils.rectToClientRect;
147
+ exports.detectOverflow = detectOverflow;
148
+ exports.hide = hide;
@@ -0,0 +1,47 @@
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 sides = ['top', 'right', 'bottom', 'left'];
13
+ function evaluate(value, param) {
14
+ return typeof value === 'function' ? value(param) : value;
15
+ }
16
+ function expandPaddingObject(padding) {
17
+ return {
18
+ top: 0,
19
+ right: 0,
20
+ bottom: 0,
21
+ left: 0,
22
+ ...padding
23
+ };
24
+ }
25
+ function getPaddingObject(padding) {
26
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
27
+ top: padding,
28
+ right: padding,
29
+ bottom: padding,
30
+ left: padding
31
+ };
32
+ }
33
+ function rectToClientRect(rect) {
34
+ return {
35
+ ...rect,
36
+ top: rect.y,
37
+ left: rect.x,
38
+ right: rect.x + rect.width,
39
+ bottom: rect.y + rect.height
40
+ };
41
+ }
42
+
43
+ exports.evaluate = evaluate;
44
+ exports.expandPaddingObject = expandPaddingObject;
45
+ exports.getPaddingObject = getPaddingObject;
46
+ exports.rectToClientRect = rectToClientRect;
47
+ exports.sides = sides;
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.63.2",
4
+ "version": "1.64.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -49,9 +49,9 @@
49
49
  "dependencies": {
50
50
  "@babel/runtime": "^7.24.7",
51
51
  "@carbon/feature-flags": "^0.21.0",
52
- "@carbon/icons-react": "^11.46.0",
52
+ "@carbon/icons-react": "^11.47.0-rc.0",
53
53
  "@carbon/layout": "^11.24.0",
54
- "@carbon/styles": "^1.62.0",
54
+ "@carbon/styles": "^1.63.0-rc.0",
55
55
  "@floating-ui/react": "^0.26.0",
56
56
  "@ibm/telemetry-js": "^1.5.0",
57
57
  "classnames": "2.5.1",
@@ -141,5 +141,5 @@
141
141
  "**/*.scss",
142
142
  "**/*.css"
143
143
  ],
144
- "gitHead": "7c34fa18ada2705e92d63a64c3b744a560759fbf"
144
+ "gitHead": "51d2a214ec7d870b4f807ed08a05031d091bfd46"
145
145
  }
@@ -0,0 +1,9 @@
1
+ // Code generated by @carbon/react. DO NOT EDIT.
2
+ //
3
+ // Copyright IBM Corp. 2018, 2023
4
+ //
5
+ // This source code is licensed under the Apache-2.0 license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
8
+
9
+ @forward '@carbon/styles/scss/components/ai-label/ai-label';
@@ -0,0 +1,9 @@
1
+ // Code generated by @carbon/react. DO NOT EDIT.
2
+ //
3
+ // Copyright IBM Corp. 2018, 2023
4
+ //
5
+ // This source code is licensed under the Apache-2.0 license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
8
+
9
+ @forward '@carbon/styles/scss/components/ai-label';
@@ -1,10 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2016, 2024
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 AiSkeletonPlaceholder from './AiSkeletonPlaceholder';
8
- import AiSkeletonIcon from './AiSkeletonIcon';
9
- import AiSkeletonText from './AiSkeletonText';
10
- export { AiSkeletonText, AiSkeletonIcon, AiSkeletonPlaceholder };
@@ -1,20 +0,0 @@
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
- /**
9
- * Generic utility to initialize a method that will return a unique instance id
10
- * for a component.
11
- */
12
- const setupGetInstanceId = () => {
13
- let instanceId = 0;
14
- return function getInstanceId() {
15
- return ++instanceId;
16
- };
17
- };
18
- var setupGetInstanceId$1 = setupGetInstanceId;
19
-
20
- export { setupGetInstanceId$1 as default };
@@ -1,10 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2016, 2024
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 AiSkeletonPlaceholder from './AiSkeletonPlaceholder';
8
- import AiSkeletonIcon from './AiSkeletonIcon';
9
- import AiSkeletonText from './AiSkeletonText';
10
- export { AiSkeletonText, AiSkeletonIcon, AiSkeletonPlaceholder };
@@ -1,24 +0,0 @@
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
- /**
13
- * Generic utility to initialize a method that will return a unique instance id
14
- * for a component.
15
- */
16
- const setupGetInstanceId = () => {
17
- let instanceId = 0;
18
- return function getInstanceId() {
19
- return ++instanceId;
20
- };
21
- };
22
- var setupGetInstanceId$1 = setupGetInstanceId;
23
-
24
- exports["default"] = setupGetInstanceId$1;