Socket
Socket
Sign inDemoInstall

nav-frontend-alertstriper

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nav-frontend-alertstriper - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

lib/advarsel-alertstripe.js

143

lib/alertstripe.js

@@ -10,2 +10,53 @@ 'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _advarselAlertstripe = require('./advarsel-alertstripe');
Object.defineProperty(exports, 'AlertStripeAdvarsel', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_advarselAlertstripe).default;
}
});
var _suksessSolidAlertstripe = require('./suksess-solid-alertstripe');
Object.defineProperty(exports, 'AlertStripeSuksessSolid', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_suksessSolidAlertstripe).default;
}
});
var _suksessAlertstripe = require('./suksess-alertstripe');
Object.defineProperty(exports, 'AlertStripeSuksess', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_suksessAlertstripe).default;
}
});
var _infoSolidAlertstripe = require('./info-solid-alertstripe');
Object.defineProperty(exports, 'AlertStripeInfoSolid', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_infoSolidAlertstripe).default;
}
});
var _infoAlertstripe = require('./info-alertstripe');
Object.defineProperty(exports, 'AlertStripeInfo', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_infoAlertstripe).default;
}
});
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');

@@ -15,4 +66,2 @@

var _propTypes = require('prop-types');
var _classnames = require('classnames');

@@ -34,2 +83,8 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
// eslint-disable-line import/extensions

@@ -62,30 +117,47 @@

function AlertStripe(_ref2) {
var type = _ref2.type,
solid = _ref2.solid,
className = _ref2.className,
children = _ref2.children,
props = _objectWithoutProperties(_ref2, ['type', 'solid', 'className', 'children']);
var AlertStripe = function (_Component) {
_inherits(AlertStripe, _Component);
return _react2.default.createElement(
'div',
_extends({ className: cls(type, solid, className) }, props),
_react2.default.createElement(
'span',
{ className: 'alertstripe__ikon' },
_react2.default.createElement(_navFrontendIkonerAssets2.default, { kind: ikonKind(type, solid), height: '1.5rem', width: '1.5rem' })
),
_react2.default.createElement(
_navFrontendTypografi.Infotekst,
{ tag: 'span' },
children
)
);
}
function AlertStripe() {
_classCallCheck(this, AlertStripe);
return _possibleConstructorReturn(this, (AlertStripe.__proto__ || Object.getPrototypeOf(AlertStripe)).apply(this, arguments));
}
_createClass(AlertStripe, [{
key: 'render',
// eslint-disable-line react/prefer-stateless-function
value: function render() {
var _props = this.props,
type = _props.type,
solid = _props.solid,
className = _props.className,
children = _props.children,
props = _objectWithoutProperties(_props, ['type', 'solid', 'className', 'children']);
return _react2.default.createElement(
'div',
_extends({ className: cls(type, solid, className) }, props),
_react2.default.createElement(
'span',
{ className: 'alertstripe__ikon' },
_react2.default.createElement(_navFrontendIkonerAssets2.default, { kind: ikonKind(type, solid), height: '1.5rem', width: '1.5rem' })
),
_react2.default.createElement(
_navFrontendTypografi.Infotekst,
{ tag: 'span' },
children
)
);
}
}]);
return AlertStripe;
}(_react.Component);
AlertStripe.propTypes = {
children: _propTypes.PropTypes.node.isRequired,
type: _propTypes.PropTypes.oneOf(['advarsel', 'suksess', 'info']).isRequired,
solid: _propTypes.PropTypes.bool,
className: _propTypes.PropTypes.string
children: _propTypes2.default.node.isRequired,
type: _propTypes2.default.oneOf(['advarsel', 'suksess', 'info']).isRequired,
solid: _propTypes2.default.bool,
className: _propTypes2.default.string
};

@@ -98,17 +170,2 @@

exports.default = AlertStripe;
var AlertStripeAdvarsel = exports.AlertStripeAdvarsel = function AlertStripeAdvarsel(props) {
return _react2.default.createElement(AlertStripe, _extends({ type: 'advarsel', solid: true }, props));
};
var AlertStripeSuksessSolid = exports.AlertStripeSuksessSolid = function AlertStripeSuksessSolid(props) {
return _react2.default.createElement(AlertStripe, _extends({ type: 'suksess', solid: true }, props));
};
var AlertStripeSuksess = exports.AlertStripeSuksess = function AlertStripeSuksess(props) {
return _react2.default.createElement(AlertStripe, _extends({ type: 'suksess' }, props));
};
var AlertStripeInfoSolid = exports.AlertStripeInfoSolid = function AlertStripeInfoSolid(props) {
return _react2.default.createElement(AlertStripe, _extends({ type: 'info', solid: true }, props));
};
var AlertStripeInfo = exports.AlertStripeInfo = function AlertStripeInfo(props) {
return _react2.default.createElement(AlertStripe, _extends({ type: 'info' }, props));
};
exports.default = AlertStripe;
{
"name": "nav-frontend-alertstriper",
"version": "0.1.1",
"version": "0.1.2",
"main": "lib/alertstripe.js",

@@ -15,18 +15,17 @@ "jsnext:main": "src/alertstripe.js",

},
"dependencies": {},
"peerDependencies": {
"react": "^15.4.2",
"classnames": "^2.2.5",
"nav-frontend-alertstriper-style": "0.1.2",
"nav-frontend-ikoner-assets": "0.2.2",
"nav-frontend-typografi": "0.2.2",
"prop-types": "^15.5.10",
"nav-frontend-typografi": "0.2.1",
"nav-frontend-alertstriper-style": "0.1.1",
"nav-frontend-ikoner-assets": "0.2.1"
"react": "^15.4.2"
},
"devDependencies": {
"@kadira/storybook": "2.21.0",
"react": "^15.4.2",
"nav-frontend-alertstriper-style": "0.1.1",
"nav-frontend-typografi": "0.2.1",
"nav-frontend-ikoner-assets": "0.2.1"
"@storybook/react": "3.0.0",
"nav-frontend-alertstriper-style": "0.1.2",
"nav-frontend-ikoner-assets": "0.2.2",
"nav-frontend-typografi": "0.2.2",
"react": "^15.4.2"
}
}

@@ -1,3 +0,3 @@

import React from 'react';
import { PropTypes as PT } from 'prop-types';
import PT from 'prop-types';
import React, { Component } from 'react';
import classNames from 'classnames';

@@ -28,12 +28,15 @@ import { Infotekst } from 'nav-frontend-typografi';

class AlertStripe extends Component { // eslint-disable-line react/prefer-stateless-function
render() {
const { type, solid, className, children, ...props } = this.props;
function AlertStripe({ type, solid, className, children, ...props }) {
return (
<div className={cls(type, solid, className)} {...props}>
<span className="alertstripe__ikon">
<Ikon kind={ikonKind(type, solid)} height="1.5rem" width="1.5rem" />
</span>
<Infotekst tag="span">{children}</Infotekst>
</div>
);
return (
<div className={cls(type, solid, className)} {...props}>
<span className="alertstripe__ikon">
<Ikon kind={ikonKind(type, solid)} height="1.5rem" width="1.5rem" />
</span>
<Infotekst tag="span">{children}</Infotekst>
</div>
);
}
}

@@ -55,6 +58,6 @@

export const AlertStripeAdvarsel = (props) => <AlertStripe type="advarsel" solid {...props} />;
export const AlertStripeSuksessSolid = (props) => <AlertStripe type="suksess" solid {...props} />;
export const AlertStripeSuksess = (props) => <AlertStripe type="suksess" {...props} />;
export const AlertStripeInfoSolid = (props) => <AlertStripe type="info" solid {...props} />;
export const AlertStripeInfo = (props) => <AlertStripe type="info" {...props} />;
export { default as AlertStripeAdvarsel } from './advarsel-alertstripe';
export { default as AlertStripeSuksessSolid } from './suksess-solid-alertstripe';
export { default as AlertStripeSuksess } from './suksess-alertstripe';
export { default as AlertStripeInfoSolid } from './info-solid-alertstripe';
export { default as AlertStripeInfo } from './info-alertstripe';
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc