You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

terra-section-header

Package Overview
Dependencies
Maintainers
8
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-section-header - npm Package Compare versions

Comparing version

to
2.65.0

5

CHANGELOG.md

@@ -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 @@

14

lib/SectionHeader.js

@@ -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