Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.2.22 to 1.0.1

lib/advarsel-alertstripe.d.ts

29

lib/advarsel-alertstripe.js

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeAdvarsel(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'advarsel' }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeAdvarsel = function AlertStripeAdvarsel(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "advarsel" }, props));
};
AlertStripeAdvarsel.propTypes = {};
exports.default = AlertStripeAdvarsel;

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeAdvarselSolid(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'advarsel', solid: true }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeAdvarselSolid = function AlertStripeAdvarselSolid(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "advarsel", solid: true }, props));
};
AlertStripeAdvarselSolid.propTypes = {};
exports.default = AlertStripeAdvarselSolid;

@@ -1,97 +0,5 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AlertStripeNavAnsatt = exports.AlertStripeInfo = exports.AlertStripeInfoSolid = exports.AlertStripeSuksess = exports.AlertStripeSuksessSolid = exports.AlertStripeAdvarsel = exports.AlertStripeAdvarselSolid = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
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 _advarselSolidAlertstripe = require('./advarsel-solid-alertstripe');
Object.defineProperty(exports, 'AlertStripeAdvarselSolid', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_advarselSolidAlertstripe).default;
}
});
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 _navansattAlertstripe = require('./navansatt-alertstripe');
Object.defineProperty(exports, 'AlertStripeNavAnsatt', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_navansattAlertstripe).default;
}
});
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var _navFrontendTypografi = require('nav-frontend-typografi');
var _navFrontendIkonerAssets = require('nav-frontend-ikoner-assets');
var _navFrontendIkonerAssets2 = _interopRequireDefault(_navFrontendIkonerAssets);
require('nav-frontend-alertstriper-style');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

@@ -105,6 +13,11 @@

// eslint-disable-line import/extensions
Object.defineProperty(exports, "__esModule", { value: true });
var PT = require("prop-types");
var React = require("react");
var classNames = require("classnames");
var nav_frontend_typografi_1 = require("nav-frontend-typografi");
var nav_frontend_ikoner_assets_1 = require("nav-frontend-ikoner-assets");
require("nav-frontend-alertstriper-style");
var cls = function cls(type, solid, className) {
return (0, _classnames2.default)('alertstripe', className, {
return classNames('alertstripe', className, {
'alertstripe--solid': solid,

@@ -126,3 +39,2 @@ 'alertstripe--advarsel': type === 'advarsel' || type === 'nav-ansatt',

};
return Object.keys(kindMap).map(function (key) {

@@ -136,4 +48,4 @@ return { key: key, predicate: kindMap[key] };

var AlertStripe = function (_Component) {
_inherits(AlertStripe, _Component);
var AlertStripe = function (_React$Component) {
_inherits(AlertStripe, _React$Component);

@@ -147,4 +59,3 @@ function AlertStripe() {

_createClass(AlertStripe, [{
key: 'render',
// eslint-disable-line react/prefer-stateless-function
key: "render",
value: function render() {

@@ -157,20 +68,6 @@ var _props = this.props,

children = _props.children,
props = _objectWithoutProperties(_props, ['type', 'solid', 'size', 'className', 'children']);
props = _objectWithoutProperties(_props, ["type", "solid", "size", "className", "children"]);
var ariaAttrs = type === 'advarsel' ? { 'aria-live': 'assertive' } : {};
return _react2.default.createElement(
'div',
_extends({ className: cls(type, solid, className) }, props, ariaAttrs),
_react2.default.createElement(
'span',
{ className: 'alertstripe__ikon', 'aria-label': type },
_react2.default.createElement(_navFrontendIkonerAssets2.default, { kind: ikonKind(type, solid), size: size })
),
_react2.default.createElement(
_navFrontendTypografi.Normaltekst,
{ className: 'alertstripe__tekst', tag: 'span' },
children
)
);
return React.createElement("div", Object.assign({ className: cls(type, solid, className) }, props, ariaAttrs), React.createElement("span", { className: "alertstripe__ikon", "aria-label": type }, React.createElement(nav_frontend_ikoner_assets_1.default, { kind: ikonKind(type, solid), size: size })), React.createElement(nav_frontend_typografi_1.Normaltekst, { className: "alertstripe__tekst", tag: "span" }, children));
}

@@ -180,12 +77,11 @@ }]);

return AlertStripe;
}(_react.Component);
}(React.Component);
AlertStripe.propTypes = {
children: _propTypes2.default.node.isRequired,
type: _propTypes2.default.oneOf(['suksess', 'info', 'advarsel', 'nav-ansatt']).isRequired,
solid: _propTypes2.default.bool,
size: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
className: _propTypes2.default.string
children: PT.node.isRequired,
type: PT.oneOf(['suksess', 'info', 'advarsel', 'nav-ansatt']).isRequired,
solid: PT.bool,
size: PT.oneOfType([PT.string, PT.number]),
className: PT.string
};
AlertStripe.defaultProps = {

@@ -196,74 +92,17 @@ className: undefined,

};
exports.default = AlertStripe;
AlertStripe.__docgenInfo = {
'description': '',
'displayName': 'AlertStripe',
'props': {
'children': {
'type': {
'name': 'node'
},
'required': true,
'description': ''
},
'type': {
'type': {
'name': 'enum',
'value': [{
'value': '\'suksess\'',
'computed': false
}, {
'value': '\'info\'',
'computed': false
}, {
'value': '\'advarsel\'',
'computed': false
}, {
'value': '\'nav-ansatt\'',
'computed': false
}]
},
'required': true,
'description': ''
},
'solid': {
'type': {
'name': 'bool'
},
'required': false,
'description': '',
'defaultValue': {
'value': 'false',
'computed': false
}
},
'size': {
'type': {
'name': 'union',
'value': [{
'name': 'string'
}, {
'name': 'number'
}]
},
'required': false,
'description': '',
'defaultValue': {
'value': '\'1.5em\'',
'computed': false
}
},
'className': {
'type': {
'name': 'string'
},
'required': false,
'description': '',
'defaultValue': {
'value': 'undefined',
'computed': true
}
}
}
};
var advarsel_solid_alertstripe_1 = require("./advarsel-solid-alertstripe");
exports.AlertStripeAdvarselSolid = advarsel_solid_alertstripe_1.default;
var advarsel_alertstripe_1 = require("./advarsel-alertstripe");
exports.AlertStripeAdvarsel = advarsel_alertstripe_1.default;
var suksess_solid_alertstripe_1 = require("./suksess-solid-alertstripe");
exports.AlertStripeSuksessSolid = suksess_solid_alertstripe_1.default;
var suksess_alertstripe_1 = require("./suksess-alertstripe");
exports.AlertStripeSuksess = suksess_alertstripe_1.default;
var info_solid_alertstripe_1 = require("./info-solid-alertstripe");
exports.AlertStripeInfoSolid = info_solid_alertstripe_1.default;
var info_alertstripe_1 = require("./info-alertstripe");
exports.AlertStripeInfo = info_alertstripe_1.default;
var navansatt_alertstripe_1 = require("./navansatt-alertstripe");
exports.AlertStripeNavAnsatt = navansatt_alertstripe_1.default;
AlertStripe.__docgenInfo = {"description":"","displayName":"AlertStripe","props":{"type":{"defaultValue":null,"description":"","name":"type","required":true,"type":{"name":"enum","value":[{"value":"\"suksess\""},{"value":"\"info\""},{"value":"\"advarsel\""},{"value":"\"nav-ansatt\""}]}},"solid":{"defaultValue":null,"description":"","name":"solid","required":false,"type":{"name":"boolean"}},"size":{"defaultValue":null,"description":"","name":"size","required":false,"type":{"name":"ReactText"}},"className":{"defaultValue":null,"description":"","name":"className","required":false,"type":{"name":"string"}}}}

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeInfo(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'info' }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeInfo = function AlertStripeInfo(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "info" }, props));
};
AlertStripeInfo.propTypes = {};
exports.default = AlertStripeInfo;

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeInfoSolid(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'info', solid: true }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeInfoSolid = function AlertStripeInfoSolid(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "info", solid: true }, props));
};
AlertStripeInfoSolid.propTypes = {};
exports.default = AlertStripeInfoSolid;

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeNavAnsatt(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'nav-ansatt', size: '5em' }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeNavAnsatt = function AlertStripeNavAnsatt(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "nav-ansatt", size: "5em" }, props));
};
AlertStripeNavAnsatt.propTypes = {};
exports.default = AlertStripeNavAnsatt;

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeSuksess(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'suksess' }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeSuksess = function AlertStripeSuksess(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "suksess" }, props));
};
AlertStripeSuksess.propTypes = {};
exports.default = AlertStripeSuksess;

@@ -1,25 +0,10 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _alertstripe = require('./alertstripe');
var _alertstripe2 = _interopRequireDefault(_alertstripe);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AlertStripeSuksessSolid(props) {
return _react2.default.createElement(_alertstripe2.default, _extends({ type: 'suksess', solid: true }, props));
}
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var alertstripe_1 = require("./alertstripe");
var AlertStripeSuksessSolid = function AlertStripeSuksessSolid(props) {
return React.createElement(alertstripe_1.default, Object.assign({ type: "suksess", solid: true }, props));
};
AlertStripeSuksessSolid.propTypes = {};
exports.default = AlertStripeSuksessSolid;
{
"name": "nav-frontend-alertstriper",
"version": "0.2.22",
"version": "1.0.1",
"main": "lib/alertstripe.js",
"jsnext:main": "src/alertstripe.js",
"types": "lib/alertstripe.d.ts",
"license": "MIT",

@@ -20,3 +20,3 @@ "files": [

"nav-frontend-ikoner-assets": "^0.2.22",
"nav-frontend-typografi": "^1.0.12",
"nav-frontend-typografi": "^2.0.1",
"prop-types": "^15.5.10",

@@ -26,7 +26,9 @@ "react": "^15.4.2 || ^16.0.0"

"devDependencies": {
"@types/classnames": "^2.2.3",
"@types/react": "15.0.23 || ^16.0.0",
"nav-frontend-alertstriper-style": "^0.2.27",
"nav-frontend-ikoner-assets": "^0.2.22",
"nav-frontend-typografi": "^1.0.12",
"nav-frontend-typografi": "^2.0.1",
"react": "^15.4.2 || ^16.0.0"
}
}
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