@transferwise/components 0.0.0-experimental-9ea64bb → 0.0.0-experimental-249c8c0

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.
@@ -12124,7 +12124,8 @@ class Tabs extends Component {
12124
12124
  selected,
12125
12125
  className,
12126
12126
  transitionSpacing,
12127
- headerWidth
12127
+ headerWidth,
12128
+ action
12128
12129
  } = this.props;
12129
12130
  const {
12130
12131
  isSwiping,
@@ -12163,40 +12164,46 @@ class Tabs extends Component {
12163
12164
  onTouchStart: changeTabOnSwipe ? this.handleTouchStart : undefined,
12164
12165
  onTouchEnd: changeTabOnSwipe ? this.handleTouchEnd : undefined,
12165
12166
  onTouchMove: changeTabOnSwipe ? this.handleTouchMove : undefined,
12166
- children: [/*#__PURE__*/jsxs(TabList$1, {
12167
- children: [tabs.map(({
12168
- title,
12169
- disabled
12170
- }, index) => {
12171
- return /*#__PURE__*/jsx(Tab$1, {
12172
- ref: node => {
12173
- this.tabRefs[index] = node;
12174
- },
12175
- id: `${name}-tab-${index}`,
12176
- panelId: `${name}-panel-${index}`,
12177
- selected: selected === index,
12178
- disabled: disabled,
12179
- focusTab: () => {
12180
- if (this.containerReference.current?.contains(document.activeElement)) {
12181
- this.tabRefs[index].focus();
12182
- }
12183
- },
12184
- onClick: disabled ? null : this.handleTabClick(index),
12185
- onKeyDown: this.onKeyDown(index),
12186
- ...(fullWidthTabs ? {
12187
- style: {
12188
- width: `${1 / tabs.length * 100}%`
12189
- }
12190
- } : {}),
12191
- children: title
12192
- }, title);
12193
- }), translateLineX ? /*#__PURE__*/jsx("li", {
12194
- role: "none",
12195
- className: "tabs__line",
12196
- style: {
12197
- width: this.getTabLineWidth(),
12198
- transform: isRTL ? `translateX(-${translateLineX})` : `translateX(${translateLineX})`
12199
- }
12167
+ children: [/*#__PURE__*/jsxs("div", {
12168
+ className: "tabs__header",
12169
+ children: [/*#__PURE__*/jsxs(TabList$1, {
12170
+ children: [tabs.map(({
12171
+ title,
12172
+ disabled
12173
+ }, index) => {
12174
+ return /*#__PURE__*/jsx(Tab$1, {
12175
+ ref: node => {
12176
+ this.tabRefs[index] = node;
12177
+ },
12178
+ id: `${name}-tab-${index}`,
12179
+ panelId: `${name}-panel-${index}`,
12180
+ selected: selected === index,
12181
+ disabled: disabled,
12182
+ focusTab: () => {
12183
+ if (this.containerReference.current?.contains(document.activeElement)) {
12184
+ this.tabRefs[index].focus();
12185
+ }
12186
+ },
12187
+ onClick: disabled ? null : this.handleTabClick(index),
12188
+ onKeyDown: this.onKeyDown(index),
12189
+ ...(fullWidthTabs ? {
12190
+ style: {
12191
+ width: `${1 / tabs.length * 100}%`
12192
+ }
12193
+ } : {}),
12194
+ children: title
12195
+ }, title);
12196
+ }), translateLineX ? /*#__PURE__*/jsx("li", {
12197
+ role: "none",
12198
+ className: "tabs__line",
12199
+ style: {
12200
+ width: this.getTabLineWidth(),
12201
+ transform: isRTL ? `translateX(-${translateLineX})` : `translateX(${translateLineX})`
12202
+ }
12203
+ }) : null]
12204
+ }), action ? /*#__PURE__*/jsx("div", {
12205
+ className: "tabs__action-container",
12206
+ children: action
12200
12207
  }) : null]
12201
12208
  }), /*#__PURE__*/jsx("div", {
12202
12209
  ref: this.setContainerRefAndWidth,
@@ -12274,7 +12281,8 @@ Tabs.propTypes = {
12274
12281
  className: PropTypes.string,
12275
12282
  transitionSpacing: PropTypes.oneOf(['default', 'xs', 'sm', 'md', 'lg']),
12276
12283
  headerWidth: PropTypes.oneOf(['auto', 'block']),
12277
- id: PropTypes.string
12284
+ id: PropTypes.string,
12285
+ action: PropTypes.element
12278
12286
  };
12279
12287
  Tabs.defaultProps = {
12280
12288
  animatePanelsOnClick: false,