terra-section-header
Advanced tools
Comparing version
@@ -5,2 +5,7 @@ # Changelog | ||
## 2.65.0 - (November 21, 2023) | ||
* Added | ||
* Added the ability to fix the position of the title of the `terra-section-header`. | ||
## 2.64.0 - (November 13, 2023) | ||
@@ -7,0 +12,0 @@ |
@@ -16,3 +16,3 @@ "use strict"; | ||
var _SectionHeaderModule = _interopRequireDefault(require("./SectionHeader.module.scss")); | ||
var _excluded = ["text", "title", "refCallback", "onClick", "isOpen", "isTransparent", "level"]; | ||
var _excluded = ["text", "title", "refCallback", "onClick", "isOpen", "isTransparent", "level", "isTitleFixed"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
@@ -72,3 +72,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
*/ | ||
isTransparent: _propTypes.default.bool | ||
isTransparent: _propTypes.default.bool, | ||
/** | ||
* @private | ||
* Specifies whether the section header title position should be fixed | ||
*/ | ||
isTitleFixed: _propTypes.default.bool | ||
}; | ||
@@ -144,2 +149,3 @@ var defaultProps = { | ||
level = _this$props.level, | ||
isTitleFixed = _this$props.isTitleFixed, | ||
customProps = _objectWithoutProperties(_this$props, _excluded); | ||
@@ -197,3 +203,5 @@ var theme = this.context; | ||
}), /*#__PURE__*/_react.default.createElement(ArrangeWrapper, _extends({}, buttonAttributes, { | ||
className: cx('arrange-wrapper') | ||
className: cx('arrange-wrapper', { | ||
'title-fixed': isTitleFixed | ||
}) | ||
}), /*#__PURE__*/_react.default.createElement(_terraArrange.default, { | ||
@@ -200,0 +208,0 @@ fitStart: onClick && accordionIcon, |
{ | ||
"name": "terra-section-header", | ||
"version": "2.64.0", | ||
"version": "2.65.0", | ||
"description": "Section Header component that contains text and can be optionally interacted with.", | ||
@@ -49,3 +49,3 @@ "author": "Cerner Corporation", | ||
}, | ||
"gitHead": "1be8c98fe2eeec64ef7a7fa457dd708da88e5170" | ||
"gitHead": "29de123607af8afdd5c9abb4f8007676636475de" | ||
} |
@@ -45,2 +45,7 @@ import React from 'react'; | ||
isTransparent: PropTypes.bool, | ||
/** | ||
* @private | ||
* Specifies whether the section header title position should be fixed | ||
*/ | ||
isTitleFixed: PropTypes.bool, | ||
}; | ||
@@ -104,2 +109,3 @@ | ||
level, | ||
isTitleFixed, | ||
...customProps | ||
@@ -164,3 +170,3 @@ } = this.props; | ||
<Element {...headerAttributes} className={sectionHeaderClassNames} aria-label={!onClick ? headerText : undefined}> | ||
<ArrangeWrapper {...buttonAttributes} className={cx('arrange-wrapper')}> | ||
<ArrangeWrapper {...buttonAttributes} className={cx('arrange-wrapper', { 'title-fixed': isTitleFixed })}> | ||
<Arrange | ||
@@ -167,0 +173,0 @@ fitStart={onClick && accordionIcon} |
@@ -145,2 +145,15 @@ import React from 'react'; | ||
}); | ||
it('verifies that section header with a fixed title has appropriate classes', () => { | ||
const wrapper = shallow( | ||
<SectionHeader | ||
text="foo" | ||
level={2} | ||
isTitleFixed | ||
/>, | ||
); | ||
const sectionHeader = wrapper.find('.arrange-wrapper.title-fixed').at(0); | ||
expect(sectionHeader).toHaveLength(1); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
82526
1.38%608
4.29%