@carbon/ibm-products 2.70.1 → 2.71.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 (175) hide show
  1. package/css/carbon.css +317 -216
  2. package/css/carbon.css.map +1 -1
  3. package/css/index-full-carbon.css +546 -270
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +387 -43
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +229 -54
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +242 -56
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/_virtual/_commonjsHelpers.js +1 -3
  20. package/es/_virtual/index2.js +2 -6
  21. package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
  22. package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
  23. package/es/components/APIKeyModal/APIKeyModal.js +1 -1
  24. package/es/components/ActionSet/ActionSet.d.ts +4 -0
  25. package/es/components/ActionSet/ActionSet.js +46 -44
  26. package/es/components/AddSelect/AddSelectBody.js +1 -1
  27. package/es/components/Card/Card.d.ts +1 -0
  28. package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
  29. package/es/components/Coachmark/CoachmarkTagline.js +2 -2
  30. package/es/components/Coachmark/utils/context.d.ts +28 -2
  31. package/es/components/Coachmark/utils/context.js +1 -1
  32. package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
  33. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
  34. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  35. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
  36. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
  38. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
  39. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
  40. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
  41. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
  42. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
  43. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
  44. package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
  45. package/es/components/ConditionBuilder/utils/util.js +11 -4
  46. package/es/components/CreateModal/CreateModal.d.ts +4 -7
  47. package/es/components/CreateModal/CreateModal.js +4 -19
  48. package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
  49. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
  50. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
  51. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
  52. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
  53. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
  54. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
  55. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
  56. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
  57. package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
  58. package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
  59. package/es/components/EmptyStates/EmptyState.js +0 -1
  60. package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
  61. package/es/components/FilterSummary/FilterSummary.js +2 -1
  62. package/es/components/Guidebanner/Guidebanner.js +4 -20
  63. package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
  64. package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
  65. package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
  66. package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
  67. package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
  68. package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
  69. package/es/components/InterstitialScreen/index.d.ts +4 -1
  70. package/es/components/Nav/NavItemLink.js +1 -4
  71. package/es/components/PageHeader/PageHeaderTitle.js +1 -1
  72. package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
  73. package/es/components/PageHeader/next/PageHeader.js +475 -0
  74. package/es/components/PageHeader/next/index.d.ts +8 -0
  75. package/es/components/ScrollGradient/ScrollGradient.js +4 -4
  76. package/es/components/SidePanel/SidePanel.js +25 -20
  77. package/es/components/StringFormatter/StringFormatter.js +3 -0
  78. package/es/components/Tearsheet/Tearsheet.js +4 -7
  79. package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
  80. package/es/components/Tearsheet/TearsheetShell.js +1 -1
  81. package/es/components/UserAvatar/UserAvatar.js +5 -7
  82. package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
  83. package/es/components/UserProfileImage/UserProfileImage.js +12 -6
  84. package/es/components/index.d.ts +1 -0
  85. package/es/global/js/package-settings.js +1 -1
  86. package/es/index.js +3 -0
  87. package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
  88. package/es/node_modules/prop-types/index.js +1 -1
  89. package/lib/_virtual/_commonjsHelpers.js +0 -3
  90. package/lib/_virtual/index2.js +2 -8
  91. package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
  92. package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
  93. package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
  94. package/lib/components/ActionSet/ActionSet.d.ts +4 -0
  95. package/lib/components/ActionSet/ActionSet.js +46 -43
  96. package/lib/components/AddSelect/AddSelectBody.js +1 -1
  97. package/lib/components/Card/Card.d.ts +1 -0
  98. package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
  99. package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
  100. package/lib/components/Coachmark/utils/context.d.ts +28 -2
  101. package/lib/components/Coachmark/utils/context.js +1 -1
  102. package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
  103. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
  104. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  105. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
  106. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
  107. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
  108. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
  109. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
  110. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
  111. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
  112. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
  113. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
  114. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
  115. package/lib/components/ConditionBuilder/utils/util.js +11 -4
  116. package/lib/components/CreateModal/CreateModal.d.ts +4 -7
  117. package/lib/components/CreateModal/CreateModal.js +4 -19
  118. package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
  119. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
  120. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
  121. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
  122. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
  123. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
  124. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
  125. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
  126. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
  127. package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
  128. package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
  129. package/lib/components/EmptyStates/EmptyState.js +0 -1
  130. package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
  131. package/lib/components/FilterSummary/FilterSummary.js +2 -1
  132. package/lib/components/Guidebanner/Guidebanner.js +4 -20
  133. package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
  134. package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
  135. package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
  136. package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
  137. package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
  138. package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
  139. package/lib/components/InterstitialScreen/index.d.ts +4 -1
  140. package/lib/components/Nav/NavItemLink.js +1 -4
  141. package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
  142. package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
  143. package/lib/components/PageHeader/next/PageHeader.js +490 -0
  144. package/lib/components/PageHeader/next/index.d.ts +8 -0
  145. package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
  146. package/lib/components/SidePanel/SidePanel.js +26 -21
  147. package/lib/components/StringFormatter/StringFormatter.js +3 -0
  148. package/lib/components/Tearsheet/Tearsheet.js +4 -7
  149. package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
  150. package/lib/components/Tearsheet/TearsheetShell.js +1 -1
  151. package/lib/components/UserAvatar/UserAvatar.js +5 -7
  152. package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
  153. package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
  154. package/lib/components/index.d.ts +1 -0
  155. package/lib/global/js/package-settings.js +1 -1
  156. package/lib/index.js +5 -2
  157. package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
  158. package/lib/node_modules/prop-types/index.js +1 -1
  159. package/package.json +22 -30
  160. package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
  161. package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
  162. package/scss/components/PageHeader/_page-header.scss +198 -0
  163. package/scss/components/SidePanel/_side-panel.scss +2 -52
  164. package/scss/components/_index-released-only.scss +1 -0
  165. package/telemetry.yml +12 -13
  166. package/es/_virtual/index3.js +0 -10
  167. package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
  168. package/es/components/SidePanel/resizer/Resizer.js +0 -271
  169. package/es/node_modules/lodash.debounce/index.js +0 -367
  170. package/lib/_virtual/index3.js +0 -12
  171. package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
  172. package/lib/components/SidePanel/resizer/Resizer.js +0 -277
  173. package/lib/node_modules/lodash.debounce/index.js +0 -369
  174. /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
  175. /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -1,367 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 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
- import { commonjsGlobal } from '../../_virtual/_commonjsHelpers.js';
9
-
10
- var lodash_debounce;
11
- var hasRequiredLodash_debounce;
12
- function requireLodash_debounce() {
13
- if (hasRequiredLodash_debounce) return lodash_debounce;
14
- hasRequiredLodash_debounce = 1;
15
- /** Used as the `TypeError` message for "Functions" methods. */
16
- var FUNC_ERROR_TEXT = 'Expected a function';
17
-
18
- /** Used as references for various `Number` constants. */
19
- var NAN = 0 / 0;
20
-
21
- /** `Object#toString` result references. */
22
- var symbolTag = '[object Symbol]';
23
-
24
- /** Used to match leading and trailing whitespace. */
25
- var reTrim = /^\s+|\s+$/g;
26
-
27
- /** Used to detect bad signed hexadecimal string values. */
28
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
29
-
30
- /** Used to detect binary string values. */
31
- var reIsBinary = /^0b[01]+$/i;
32
-
33
- /** Used to detect octal string values. */
34
- var reIsOctal = /^0o[0-7]+$/i;
35
-
36
- /** Built-in method references without a dependency on `root`. */
37
- var freeParseInt = parseInt;
38
-
39
- /** Detect free variable `global` from Node.js. */
40
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
41
-
42
- /** Detect free variable `self`. */
43
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
44
-
45
- /** Used as a reference to the global object. */
46
- var root = freeGlobal || freeSelf || Function('return this')();
47
-
48
- /** Used for built-in method references. */
49
- var objectProto = Object.prototype;
50
-
51
- /**
52
- * Used to resolve the
53
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
54
- * of values.
55
- */
56
- var objectToString = objectProto.toString;
57
-
58
- /* Built-in method references for those with the same name as other `lodash` methods. */
59
- var nativeMax = Math.max,
60
- nativeMin = Math.min;
61
-
62
- /**
63
- * Gets the timestamp of the number of milliseconds that have elapsed since
64
- * the Unix epoch (1 January 1970 00:00:00 UTC).
65
- *
66
- * @static
67
- * @memberOf _
68
- * @since 2.4.0
69
- * @category Date
70
- * @returns {number} Returns the timestamp.
71
- * @example
72
- *
73
- * _.defer(function(stamp) {
74
- * console.log(_.now() - stamp);
75
- * }, _.now());
76
- * // => Logs the number of milliseconds it took for the deferred invocation.
77
- */
78
- var now = function () {
79
- return root.Date.now();
80
- };
81
-
82
- /**
83
- * Creates a debounced function that delays invoking `func` until after `wait`
84
- * milliseconds have elapsed since the last time the debounced function was
85
- * invoked. The debounced function comes with a `cancel` method to cancel
86
- * delayed `func` invocations and a `flush` method to immediately invoke them.
87
- * Provide `options` to indicate whether `func` should be invoked on the
88
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
89
- * with the last arguments provided to the debounced function. Subsequent
90
- * calls to the debounced function return the result of the last `func`
91
- * invocation.
92
- *
93
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
94
- * invoked on the trailing edge of the timeout only if the debounced function
95
- * is invoked more than once during the `wait` timeout.
96
- *
97
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
98
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
99
- *
100
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
101
- * for details over the differences between `_.debounce` and `_.throttle`.
102
- *
103
- * @static
104
- * @memberOf _
105
- * @since 0.1.0
106
- * @category Function
107
- * @param {Function} func The function to debounce.
108
- * @param {number} [wait=0] The number of milliseconds to delay.
109
- * @param {Object} [options={}] The options object.
110
- * @param {boolean} [options.leading=false]
111
- * Specify invoking on the leading edge of the timeout.
112
- * @param {number} [options.maxWait]
113
- * The maximum time `func` is allowed to be delayed before it's invoked.
114
- * @param {boolean} [options.trailing=true]
115
- * Specify invoking on the trailing edge of the timeout.
116
- * @returns {Function} Returns the new debounced function.
117
- * @example
118
- *
119
- * // Avoid costly calculations while the window size is in flux.
120
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
121
- *
122
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
123
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
124
- * 'leading': true,
125
- * 'trailing': false
126
- * }));
127
- *
128
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
129
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
130
- * var source = new EventSource('/stream');
131
- * jQuery(source).on('message', debounced);
132
- *
133
- * // Cancel the trailing debounced invocation.
134
- * jQuery(window).on('popstate', debounced.cancel);
135
- */
136
- function debounce(func, wait, options) {
137
- var lastArgs,
138
- lastThis,
139
- maxWait,
140
- result,
141
- timerId,
142
- lastCallTime,
143
- lastInvokeTime = 0,
144
- leading = false,
145
- maxing = false,
146
- trailing = true;
147
- if (typeof func != 'function') {
148
- throw new TypeError(FUNC_ERROR_TEXT);
149
- }
150
- wait = toNumber(wait) || 0;
151
- if (isObject(options)) {
152
- leading = !!options.leading;
153
- maxing = 'maxWait' in options;
154
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
155
- trailing = 'trailing' in options ? !!options.trailing : trailing;
156
- }
157
- function invokeFunc(time) {
158
- var args = lastArgs,
159
- thisArg = lastThis;
160
- lastArgs = lastThis = undefined;
161
- lastInvokeTime = time;
162
- result = func.apply(thisArg, args);
163
- return result;
164
- }
165
- function leadingEdge(time) {
166
- // Reset any `maxWait` timer.
167
- lastInvokeTime = time;
168
- // Start the timer for the trailing edge.
169
- timerId = setTimeout(timerExpired, wait);
170
- // Invoke the leading edge.
171
- return leading ? invokeFunc(time) : result;
172
- }
173
- function remainingWait(time) {
174
- var timeSinceLastCall = time - lastCallTime,
175
- timeSinceLastInvoke = time - lastInvokeTime,
176
- result = wait - timeSinceLastCall;
177
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
178
- }
179
- function shouldInvoke(time) {
180
- var timeSinceLastCall = time - lastCallTime,
181
- timeSinceLastInvoke = time - lastInvokeTime;
182
-
183
- // Either this is the first call, activity has stopped and we're at the
184
- // trailing edge, the system time has gone backwards and we're treating
185
- // it as the trailing edge, or we've hit the `maxWait` limit.
186
- return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
187
- }
188
- function timerExpired() {
189
- var time = now();
190
- if (shouldInvoke(time)) {
191
- return trailingEdge(time);
192
- }
193
- // Restart the timer.
194
- timerId = setTimeout(timerExpired, remainingWait(time));
195
- }
196
- function trailingEdge(time) {
197
- timerId = undefined;
198
-
199
- // Only invoke if we have `lastArgs` which means `func` has been
200
- // debounced at least once.
201
- if (trailing && lastArgs) {
202
- return invokeFunc(time);
203
- }
204
- lastArgs = lastThis = undefined;
205
- return result;
206
- }
207
- function cancel() {
208
- if (timerId !== undefined) {
209
- clearTimeout(timerId);
210
- }
211
- lastInvokeTime = 0;
212
- lastArgs = lastCallTime = lastThis = timerId = undefined;
213
- }
214
- function flush() {
215
- return timerId === undefined ? result : trailingEdge(now());
216
- }
217
- function debounced() {
218
- var time = now(),
219
- isInvoking = shouldInvoke(time);
220
- lastArgs = arguments;
221
- lastThis = this;
222
- lastCallTime = time;
223
- if (isInvoking) {
224
- if (timerId === undefined) {
225
- return leadingEdge(lastCallTime);
226
- }
227
- if (maxing) {
228
- // Handle invocations in a tight loop.
229
- timerId = setTimeout(timerExpired, wait);
230
- return invokeFunc(lastCallTime);
231
- }
232
- }
233
- if (timerId === undefined) {
234
- timerId = setTimeout(timerExpired, wait);
235
- }
236
- return result;
237
- }
238
- debounced.cancel = cancel;
239
- debounced.flush = flush;
240
- return debounced;
241
- }
242
-
243
- /**
244
- * Checks if `value` is the
245
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
246
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
247
- *
248
- * @static
249
- * @memberOf _
250
- * @since 0.1.0
251
- * @category Lang
252
- * @param {*} value The value to check.
253
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
254
- * @example
255
- *
256
- * _.isObject({});
257
- * // => true
258
- *
259
- * _.isObject([1, 2, 3]);
260
- * // => true
261
- *
262
- * _.isObject(_.noop);
263
- * // => true
264
- *
265
- * _.isObject(null);
266
- * // => false
267
- */
268
- function isObject(value) {
269
- var type = typeof value;
270
- return !!value && (type == 'object' || type == 'function');
271
- }
272
-
273
- /**
274
- * Checks if `value` is object-like. A value is object-like if it's not `null`
275
- * and has a `typeof` result of "object".
276
- *
277
- * @static
278
- * @memberOf _
279
- * @since 4.0.0
280
- * @category Lang
281
- * @param {*} value The value to check.
282
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
283
- * @example
284
- *
285
- * _.isObjectLike({});
286
- * // => true
287
- *
288
- * _.isObjectLike([1, 2, 3]);
289
- * // => true
290
- *
291
- * _.isObjectLike(_.noop);
292
- * // => false
293
- *
294
- * _.isObjectLike(null);
295
- * // => false
296
- */
297
- function isObjectLike(value) {
298
- return !!value && typeof value == 'object';
299
- }
300
-
301
- /**
302
- * Checks if `value` is classified as a `Symbol` primitive or object.
303
- *
304
- * @static
305
- * @memberOf _
306
- * @since 4.0.0
307
- * @category Lang
308
- * @param {*} value The value to check.
309
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
310
- * @example
311
- *
312
- * _.isSymbol(Symbol.iterator);
313
- * // => true
314
- *
315
- * _.isSymbol('abc');
316
- * // => false
317
- */
318
- function isSymbol(value) {
319
- return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
320
- }
321
-
322
- /**
323
- * Converts `value` to a number.
324
- *
325
- * @static
326
- * @memberOf _
327
- * @since 4.0.0
328
- * @category Lang
329
- * @param {*} value The value to process.
330
- * @returns {number} Returns the number.
331
- * @example
332
- *
333
- * _.toNumber(3.2);
334
- * // => 3.2
335
- *
336
- * _.toNumber(Number.MIN_VALUE);
337
- * // => 5e-324
338
- *
339
- * _.toNumber(Infinity);
340
- * // => Infinity
341
- *
342
- * _.toNumber('3.2');
343
- * // => 3.2
344
- */
345
- function toNumber(value) {
346
- if (typeof value == 'number') {
347
- return value;
348
- }
349
- if (isSymbol(value)) {
350
- return NAN;
351
- }
352
- if (isObject(value)) {
353
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
354
- value = isObject(other) ? other + '' : other;
355
- }
356
- if (typeof value != 'string') {
357
- return value === 0 ? value : +value;
358
- }
359
- value = value.replace(reTrim, '');
360
- var isBinary = reIsBinary.test(value);
361
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
362
- }
363
- lodash_debounce = debounce;
364
- return lodash_debounce;
365
- }
366
-
367
- export { requireLodash_debounce as __require };
@@ -1,12 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 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
- 'use strict';
9
-
10
- var propTypes = {exports: {}};
11
-
12
- exports.__module = propTypes;
@@ -1,21 +0,0 @@
1
- /**
2
- * @license
3
- *
4
- * Copyright IBM Corp. 2025
5
- *
6
- * This source code is licensed under the Apache-2.0 license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
- import React from 'react';
10
- export declare const DEBOUNCE_DELAY = 100;
11
- /** Primary UI component for user interaction */
12
- interface ResizerProps {
13
- orientation: 'horizontal' | 'vertical';
14
- onResize?: (event: MouseEvent | KeyboardEvent, delta: number) => void;
15
- onResizeEnd?: (event: MouseEvent | KeyboardEvent, ref: React.RefObject<HTMLDivElement>) => void;
16
- onDoubleClick?: (event: MouseEvent) => string | void;
17
- className?: string;
18
- [key: string]: any;
19
- }
20
- export declare const Resizer: React.ForwardRefExoticComponent<Omit<ResizerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
21
- export default Resizer;
@@ -1,277 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 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
- 'use strict';
9
-
10
- Object.defineProperty(exports, '__esModule', { value: true });
11
-
12
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
- var React = require('react');
14
- var cx = require('classnames');
15
- var index = require('../../../_virtual/index2.js');
16
-
17
- var _span;
18
- const DEBOUNCE_DELAY = 100;
19
- /** Primary UI component for user interaction */
20
-
21
- const getRefElement = ref => {
22
- if (!ref || !('current' in ref)) {
23
- return null;
24
- }
25
- return ref.current;
26
- };
27
- const Resizer = /*#__PURE__*/React.forwardRef((_ref, forwardedRef) => {
28
- let {
29
- orientation,
30
- onResize,
31
- onResizeEnd,
32
- onDoubleClick,
33
- className,
34
- ...rest
35
- } = _ref;
36
- const prefix = 'clabs';
37
- const blockClass = `${prefix}__resizer`;
38
- const internalRef = React.useRef(null);
39
- const ref = forwardedRef || internalRef; // combine refs, forwarded ref takes priority over internal ref
40
- const [isResizing, setIsResizing] = React.useState(false);
41
- const startPos = React.useRef({
42
- x: 0,
43
- y: 0
44
- });
45
- // Sizes of the previous and next siblings, gets modified during resizing
46
- const sizes = React.useRef({
47
- prevSiblingSize: {
48
- width: 0,
49
- height: 0
50
- },
51
- nextSiblingSize: {
52
- width: 0,
53
- height: 0
54
- }
55
- });
56
- // Initial sizes of the previous and next siblings, a static reference
57
- const initialSizes = React.useRef({
58
- prevSiblingSize: {
59
- width: 0,
60
- height: 0
61
- },
62
- nextSiblingSize: {
63
- width: 0,
64
- height: 0
65
- }
66
- });
67
-
68
- // Debounced function to handle resize end events
69
- // This is used to prevent multiple calls during a resize operation especially from keyboard when the key is held down
70
- // It will only call the onResizeEnd after the user has stopped resizing
71
- const debouncedResizeEnd = React.useRef(index.default(event => {
72
- const element = getRefElement(ref);
73
- if (element && onResizeEnd) {
74
- onResizeEnd(event, ref);
75
- }
76
- }, DEBOUNCE_DELAY));
77
- React.useEffect(() => {
78
- const element = getRefElement(ref);
79
- if (!element) {
80
- return;
81
- }
82
- const prevSibling = element.previousElementSibling;
83
- const nextSibling = element.nextElementSibling;
84
- const rect = el => el?.getBoundingClientRect();
85
- initialSizes.current = {
86
- prevSiblingSize: prevSibling ? {
87
- width: rect(prevSibling).width,
88
- height: rect(prevSibling).height
89
- } : {
90
- width: 0,
91
- height: 0
92
- },
93
- nextSiblingSize: nextSibling ? {
94
- width: rect(nextSibling).width,
95
- height: rect(nextSibling).height
96
- } : {
97
- width: 0,
98
- height: 0
99
- }
100
- };
101
- }, [ref]);
102
- const updateSizes = React.useCallback((event, delta) => {
103
- const element = getRefElement(ref);
104
- if (!element) {
105
- return;
106
- }
107
- if (onResize) {
108
- onResize(event, delta);
109
- return;
110
- }
111
- const prevSibling = element.previousElementSibling;
112
- const nextSibling = element.nextElementSibling;
113
- const prop = orientation === 'horizontal' ? 'height' : 'width';
114
- if (prevSibling) {
115
- const newSize = sizes.current.prevSiblingSize[prop] + delta;
116
- prevSibling.style[prop] = `${newSize}px`;
117
- }
118
- if (nextSibling) {
119
- const newSize = sizes.current.nextSiblingSize[prop] - delta;
120
- nextSibling.style[prop] = `${newSize}px`;
121
- }
122
- }, [onResize, orientation, ref]);
123
- const handleMouseMove = React.useCallback(event => {
124
- event.preventDefault();
125
- event.stopPropagation();
126
- const delta = orientation === 'horizontal' ? event.clientY - startPos.current.y : event.clientX - startPos.current.x;
127
- updateSizes(event, delta);
128
- }, [orientation, updateSizes]);
129
- const handleMouseUp = React.useCallback(event => {
130
- const element = getRefElement(ref);
131
- if (!element) {
132
- return;
133
- }
134
- setIsResizing(false);
135
- if (onResizeEnd) {
136
- onResizeEnd(event, ref);
137
- }
138
- const prevSibling = element.previousElementSibling;
139
- const nextSibling = element.nextElementSibling;
140
- if (prevSibling) {
141
- prevSibling.style.transition = '';
142
- }
143
- if (nextSibling) {
144
- nextSibling.style.transition = '';
145
- }
146
- }, [onResizeEnd, ref]);
147
-
148
- // Effect to add/remove mousemove and mouseup listeners during resizing
149
- React.useEffect(() => {
150
- if (!isResizing) {
151
- return;
152
- }
153
- window.addEventListener('mousemove', handleMouseMove);
154
- window.addEventListener('mouseup', handleMouseUp);
155
- return () => {
156
- window.removeEventListener('mousemove', handleMouseMove);
157
- window.removeEventListener('mouseup', handleMouseUp);
158
- };
159
- }, [isResizing, handleMouseMove, handleMouseUp]);
160
- const handleMouseDown = React.useCallback(event => {
161
- event.preventDefault();
162
- event.stopPropagation();
163
- const element = getRefElement(ref);
164
- if (!element) {
165
- return;
166
- }
167
- const prevSibling = element.previousElementSibling;
168
- const nextSibling = element.nextElementSibling;
169
- const rect = el => el?.getBoundingClientRect();
170
- prevSibling && (prevSibling.style.transition = 'none');
171
- nextSibling && (nextSibling.style.transition = 'none');
172
- setIsResizing(true);
173
- startPos.current = {
174
- x: event.clientX,
175
- y: event.clientY
176
- };
177
- sizes.current = {
178
- prevSiblingSize: prevSibling ? {
179
- width: rect(prevSibling).width,
180
- height: rect(prevSibling).height
181
- } : {
182
- width: 0,
183
- height: 0
184
- },
185
- nextSiblingSize: nextSibling ? {
186
- width: rect(nextSibling).width,
187
- height: rect(nextSibling).height
188
- } : {
189
- width: 0,
190
- height: 0
191
- }
192
- };
193
- }, [ref]);
194
- const handleKeyDown = React.useCallback(event => {
195
- const navigationKeys = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End'];
196
- if (![...navigationKeys, 'PageUp', 'PageDown'].includes(event.key)) {
197
- return;
198
- }
199
- const element = getRefElement(ref);
200
- if (!element) {
201
- return;
202
- }
203
- event.preventDefault();
204
- event.stopPropagation();
205
- const prevSibling = element.previousElementSibling;
206
- const nextSibling = element.nextElementSibling;
207
- const getSize = el => {
208
- const rect = el?.getBoundingClientRect();
209
- return {
210
- width: rect?.width || 0,
211
- height: rect?.height || 0
212
- };
213
- };
214
- sizes.current = {
215
- prevSiblingSize: getSize(prevSibling),
216
- nextSiblingSize: getSize(nextSibling)
217
- };
218
- const step = event.shiftKey ? 25 : 5;
219
- let delta = 0;
220
- const isHorizontal = orientation === 'horizontal';
221
- const keyMap = {
222
- ArrowUp: () => isHorizontal ? delta = -step : null,
223
- ArrowDown: () => isHorizontal ? delta = step : null,
224
- ArrowLeft: () => !isHorizontal ? delta = -step : null,
225
- ArrowRight: () => !isHorizontal ? delta = step : null,
226
- Home: () => delta = isHorizontal ? -sizes.current.prevSiblingSize.height : -sizes.current.prevSiblingSize.width,
227
- End: () => delta = isHorizontal ? sizes.current.nextSiblingSize.height : sizes.current.nextSiblingSize.width
228
- };
229
- keyMap[event.key]?.();
230
- updateSizes(event, delta);
231
- debouncedResizeEnd?.current(event);
232
- }, [orientation, updateSizes, debouncedResizeEnd, ref]);
233
- const handleDoubleClick = event => {
234
- event.preventDefault();
235
- const element = getRefElement(ref);
236
- if (!element) {
237
- return;
238
- }
239
- const prevSibling = element.previousElementSibling;
240
- const nextSibling = element.nextElementSibling;
241
- if (onDoubleClick) {
242
- onDoubleClick(event);
243
- } else {
244
- const prop = orientation === 'horizontal' ? 'height' : 'width';
245
- if (prevSibling) {
246
- prevSibling.style[prop] = `${initialSizes.current.prevSiblingSize[prop]}px`;
247
- }
248
- if (nextSibling) {
249
- nextSibling.style[prop] = `${initialSizes.current.nextSiblingSize[prop]}px`;
250
- }
251
- }
252
- };
253
- return (
254
- /*#__PURE__*/
255
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
256
- React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
257
- ref: ref,
258
- role: "separator"
259
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
260
- ,
261
- tabIndex: 0,
262
- "aria-orientation": orientation,
263
- "aria-live": "assertive",
264
- onMouseDown: handleMouseDown,
265
- onDoubleClick: handleDoubleClick,
266
- onKeyDown: handleKeyDown,
267
- className: cx([className, blockClass, `${blockClass}--${orientation}`])
268
- }), _span || (_span = /*#__PURE__*/React.createElement("span", {
269
- className: "sr-only"
270
- }, "Use arrow keys to resize, hold Shift for larger steps. Double-click to reset.")))
271
- );
272
- });
273
- Resizer.displayName = 'Resizer';
274
-
275
- exports.DEBOUNCE_DELAY = DEBOUNCE_DELAY;
276
- exports.Resizer = Resizer;
277
- exports.default = Resizer;