terra-clinical-action-header
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -123,3 +123,14 @@ 'use strict'; | ||
var ActionHeader = function ActionHeader(_ref) { | ||
var contextTypes = { | ||
/* eslint-disable consistent-return */ | ||
intl: function intl(context) { | ||
if (context.intl === undefined) { | ||
return new Error('Please add locale prop to Base component to load translations'); | ||
} | ||
} | ||
}; | ||
var ActionHeader = function ActionHeader(_ref, _ref2) { | ||
var intl = _ref2.intl; | ||
var title = _ref.title, | ||
@@ -136,9 +147,16 @@ onClose = _ref.onClose, | ||
var attributes = _extends({}, customProps); | ||
var closeButton = onClose ? _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconClose2.default, null), onClick: onClose }) : null; | ||
var backButton = onBack ? _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconLeft2.default, null), onClick: onBack }) : null; | ||
var backText = intl.formatMessage({ id: 'Terra.Clinical.ActionHeader.back' }); | ||
var closeText = intl.formatMessage({ id: 'Terra.Clinical.ActionHeader.close' }); | ||
var minimizeText = intl.formatMessage({ id: 'Terra.Clinical.ActionHeader.minimize' }); | ||
var maximizeText = intl.formatMessage({ id: 'Terra.Clinical.ActionHeader.maximize' }); | ||
var previousText = intl.formatMessage({ id: 'Terra.Clinical.ActionHeader.previous' }); | ||
var nextText = intl.formatMessage({ id: 'Terra.Clinical.ActionHeader.next' }); | ||
var closeButton = onClose ? _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconClose2.default, { ariaLabel: closeText }), onClick: onClose }) : null; | ||
var backButton = onBack ? _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconLeft2.default, { ariaLabel: backText }), onClick: onBack }) : null; | ||
var closeButtonSmall = void 0; | ||
var backButtonSmall = void 0; | ||
if (onClose && !onBack) { | ||
backButtonSmall = _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconLeft2.default, null), onClick: onClose }); | ||
backButtonSmall = _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconLeft2.default, { ariaLabel: backText }), onClick: onClose }); | ||
closeButtonSmall = null; | ||
@@ -153,5 +171,5 @@ } else { | ||
if (onMaximize) { | ||
expandButton = _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconMaximize2.default, null), onClick: onMaximize }); | ||
expandButton = _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconMaximize2.default, { ariaLabel: maximizeText }), onClick: onMaximize }); | ||
} else if (onMinimize) { | ||
expandButton = _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconMinimize2.default, null), onClick: onMinimize }); | ||
expandButton = _react2.default.createElement(_terraButton2.default, { icon: _react2.default.createElement(_IconMinimize2.default, { ariaLabel: minimizeText }), onClick: onMinimize }); | ||
} | ||
@@ -165,4 +183,4 @@ } | ||
null, | ||
_react2.default.createElement(_terraButtonGroup2.default.Button, { icon: _react2.default.createElement(_IconChevronUp2.default, null), onClick: onPrevious, key: 'ActionHeaderPrevious' }), | ||
_react2.default.createElement(_terraButtonGroup2.default.Button, { icon: _react2.default.createElement(_IconChevronDown2.default, null), onClick: onNext, key: 'ActionHeaderNext' }) | ||
_react2.default.createElement(_terraButtonGroup2.default.Button, { icon: _react2.default.createElement(_IconChevronUp2.default, { ariaLabel: previousText }), onClick: onPrevious, key: 'ActionHeaderPrevious' }), | ||
_react2.default.createElement(_terraButtonGroup2.default.Button, { icon: _react2.default.createElement(_IconChevronDown2.default, { ariaLabel: nextText }), onClick: onNext, key: 'ActionHeaderNext' }) | ||
); | ||
@@ -221,3 +239,4 @@ } | ||
ActionHeader.defaultProps = defaultProps; | ||
ActionHeader.contextTypes = contextTypes; | ||
exports.default = ActionHeader; |
{ | ||
"name": "terra-clinical-action-header", | ||
"main": "lib/ActionHeader.js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "An action header is a header bar with a grey background containing actionable navigation buttons, a left aligned title, and a space for an additional element to be added on the right side.", | ||
@@ -25,3 +25,3 @@ "repository": { | ||
"devDependencies": { | ||
"terra-toolkit": "^0.x" | ||
"react-intl": "^2.3.0" | ||
}, | ||
@@ -34,6 +34,5 @@ "peerDependencies": { | ||
"terra-button-group": "^0.x", | ||
"terra-clinical-header": "^0.1.2", | ||
"terra-clinical-header": "^0.1.3", | ||
"terra-icon": "0.x", | ||
"terra-mixins": "^1.0.0", | ||
"terra-responsive-element": "^0.x" | ||
"terra-mixins": "^1.0.0" | ||
}, | ||
@@ -46,3 +45,3 @@ "dependencies": { | ||
"terra-button-group": "^0.x", | ||
"terra-clinical-header": "^0.1.2", | ||
"terra-clinical-header": "^0.1.3", | ||
"terra-icon": "^0.x", | ||
@@ -62,9 +61,9 @@ "terra-mixins": "^1.0.0", | ||
"test:all": "npm run test:nightwatch-default && npm run test:nightwatch-chrome && npm run test:nightwatch-firefox && npm run test:nightwatch-safari", | ||
"test:nightwatch-default": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ./node_modules/terra-toolkit/lib/scripts/nightwatch.js", | ||
"test:nightwatch-chrome": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ./node_modules/terra-toolkit/lib/scripts/nightwatch.js chrome", | ||
"test:nightwatch-firefox": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ./node_modules/terra-toolkit/lib/scripts/nightwatch.js firefox", | ||
"test:nightwatch-safari": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ./node_modules/terra-toolkit/lib/scripts/nightwatch-non-parallel.js safari", | ||
"test:remote": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config REMOTE=true node ./node_modules/terra-toolkit/lib/scripts/nightwatch-process.js --config tests/nightwatch.conf.js", | ||
"test:remote:all": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config REMOTE=true node ./node_modules/terra-toolkit/lib/scripts/nightwatch-process.js --config tests/nightwatch.conf.js --env chrome-tiny,chrome-small,chrome-medium,chrome-large,chrome-huge,chrome-enormous,firefox-tiny,firefox-small,firefox-medium,firefox-large,firefox-huge,firefox-enormous,ie10-tiny,ie10-small,ie10-medium,ie10-large,ie10-huge,ie10-enormous,ie11-tiny,ie11-small,ie11-medium,ie11-large,ie11-huge,ie11-enormous,edge-tiny,edge-small,edge-medium,edge-large,edge-huge,edge-enormous,safari-tiny,safari-small,safari-medium,safari-large,safari-huge,safari-enormous" | ||
"test:nightwatch-default": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ../../node_modules/terra-toolkit/lib/scripts/nightwatch.js", | ||
"test:nightwatch-chrome": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ../../node_modules/terra-toolkit/lib/scripts/nightwatch.js chrome", | ||
"test:nightwatch-firefox": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ../../node_modules/terra-toolkit/lib/scripts/nightwatch.js firefox", | ||
"test:nightwatch-safari": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config SPECTRE_TEST_SUITE=terra-clinical-action-header node ../../node_modules/terra-toolkit/lib/scripts/nightwatch-non-parallel.js safari", | ||
"test:remote": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config REMOTE=true SPECTRE_TEST_SUITE=terra-clinical-action-header node ../../node_modules/terra-toolkit/lib/scripts/nightwatch-process.js --config tests/nightwatch.conf.js", | ||
"test:remote:all": "WEBPACK_CONFIG_PATH=../../../../terra-clinical-site/webpack.config REMOTE=true SPECTRE_TEST_SUITE=terra-clinical-action-header node ../../node_modules/terra-toolkit/lib/scripts/nightwatch-process.js --config tests/nightwatch.conf.js --env chrome-tiny,chrome-small,chrome-medium,chrome-large,chrome-huge,chrome-enormous,firefox-tiny,firefox-small,firefox-medium,firefox-large,firefox-huge,firefox-enormous,ie10-tiny,ie10-small,ie10-medium,ie10-large,ie10-huge,ie10-enormous,ie11-tiny,ie11-small,ie11-medium,ie11-large,ie11-huge,ie11-enormous,edge-tiny,edge-small,edge-medium,edge-large,edge-huge,edge-enormous,safari-tiny,safari-small,safari-medium,safari-large,safari-huge,safari-enormous" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17
28875
14
222
1
Updatedterra-clinical-header@^0.1.3