orcs-design-system 3.2.41 → 3.2.42

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.
@@ -118,6 +118,7 @@ export const ActionsMenuBody = _ref2 => {
118
118
  direction = "right-start",
119
119
  menuWidth,
120
120
  customTriggerComponent,
121
+ renderTrigger,
121
122
  children,
122
123
  ariaLabel = "Options Menu",
123
124
  onTriggerFocus,
@@ -158,8 +159,12 @@ export const ActionsMenuBody = _ref2 => {
158
159
  className: "action-menu-icon"
159
160
  })
160
161
  });
162
+ if (renderTrigger) {
163
+ triggerComponent = renderTrigger(triggerProps);
164
+ }
161
165
  if (customTriggerComponent) {
162
166
  triggerComponent = /*#__PURE__*/_jsx("div", {
167
+ role: "button",
163
168
  ...triggerProps,
164
169
  children: customTriggerComponent
165
170
  });
@@ -244,6 +249,8 @@ ActionsMenuBody.propTypes = {
244
249
  menuRightPosition: PropTypes.string,
245
250
  menuWidth: PropTypes.string,
246
251
  customTriggerComponent: PropTypes.node,
252
+ renderTrigger: PropTypes.func,
253
+ "data-testid": PropTypes.string,
247
254
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
248
255
  theme: PropTypes.object,
249
256
  ariaLabel: PropTypes.string
@@ -271,6 +278,7 @@ ActionsMenu.propTypes = {
271
278
  isOpen: PropTypes.bool,
272
279
  direction: PropTypes.oneOf(["left", "right", "top", "bottom", "top-start", "top-end", "bottom-start", "bottom-end", "left-start", "left-end", "right-start", "right-end"]),
273
280
  customTriggerComponent: PropTypes.node,
281
+ renderTrigger: PropTypes.func,
274
282
  closeOnClick: PropTypes.bool,
275
283
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
276
284
  /** Specifies the colour theme */
@@ -341,6 +349,13 @@ ActionsMenu.__docgenInfo = {
341
349
  },
342
350
  "required": false
343
351
  },
352
+ "renderTrigger": {
353
+ "description": "",
354
+ "type": {
355
+ "name": "func"
356
+ },
357
+ "required": false
358
+ },
344
359
  "closeOnClick": {
345
360
  "description": "",
346
361
  "type": {
@@ -423,6 +438,10 @@ ActionsMenuBody.__docgenInfo = {
423
438
  "value": "\"ActionsMenu\"",
424
439
  "computed": false
425
440
  },
441
+ "description": "",
442
+ "type": {
443
+ "name": "string"
444
+ },
426
445
  "required": false
427
446
  },
428
447
  "onTriggerFocus": {
@@ -495,6 +514,13 @@ ActionsMenuBody.__docgenInfo = {
495
514
  },
496
515
  "required": false
497
516
  },
517
+ "renderTrigger": {
518
+ "description": "",
519
+ "type": {
520
+ "name": "func"
521
+ },
522
+ "required": false
523
+ },
498
524
  "children": {
499
525
  "description": "",
500
526
  "type": {
@@ -55,11 +55,11 @@ const Tabs = _ref4 => {
55
55
  } = _ref4;
56
56
  const [isMounted, setIsMounted] = useState(false);
57
57
  const containerRef = useRef(null);
58
- const showMoreButtonRef = useRef();
59
58
  const containerVisibleWidth = useRef(0);
60
59
  const [showMoreTabs, setShowMoreTabs] = useState([]);
61
60
  const calculateVisibility = useCallback(actionElements => {
62
- const showMoreButtonWidth = showMoreButtonRef?.current?.offsetWidth ?? 0;
61
+ const showMoreButton = document.getElementById("show-more-button");
62
+ const showMoreButtonWidth = showMoreButton?.offsetWidth ?? 0;
63
63
  // as we loop through the tabs, we need to calculate the width of the visible tabs.
64
64
  let calculatedWidth = showMoreTabs.length ? showMoreButtonWidth : 0;
65
65
 
@@ -130,9 +130,10 @@ const Tabs = _ref4 => {
130
130
  children: tab.label
131
131
  }, tab.path)), /*#__PURE__*/_jsx(ActionsMenu, {
132
132
  direction: "bottom-end",
133
- customTriggerComponent: /*#__PURE__*/_jsxs(ShowMoreButton, {
134
- ref: showMoreButtonRef,
133
+ renderTrigger: props => /*#__PURE__*/_jsxs(ShowMoreButton, {
134
+ ...props,
135
135
  showMoreVisible: showMoreTabsList.length,
136
+ id: "show-more-button",
136
137
  className: showMoreItemActive && "hasActive",
137
138
  children: [/*#__PURE__*/_jsx(FlexItem, {
138
139
  flex: "0 0 auto",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.2.41",
3
+ "version": "3.2.42",
4
4
  "engines": {
5
5
  "node": "20.12.2"
6
6
  },