@themindfulpug/core
Advanced tools
Comparing version 1.0.0-2 to 1.0.0
@@ -11,3 +11,3 @@ import { EmotionJSX } from '@emotion/react/types/jsx-namespace'; | ||
*/ | ||
logo: EmotionJSX.Element | React.FC | string; | ||
logo?: EmotionJSX.Element | React.FC | string; | ||
/** | ||
@@ -14,0 +14,0 @@ * A list of urls to be made into links |
@@ -24,4 +24,7 @@ var __assign = (this && this.__assign) || function () { | ||
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime"; | ||
import { useState } from 'react'; | ||
import { CDN_URL } from '../../util/constants'; | ||
import { Image } from '../Image'; | ||
import { Link } from '../Link'; | ||
import { theme } from '../ThemeProvider'; | ||
var styles = { | ||
@@ -51,2 +54,10 @@ default: { | ||
}, | ||
linkOverride: { | ||
fontWeight: 400, | ||
color: theme.palette.text.primary | ||
}, | ||
linkOverrideHover: { | ||
fontWeight: 'bold', | ||
color: theme.palette.text.primary | ||
}, | ||
action: { | ||
@@ -60,2 +71,6 @@ width: '100%', | ||
padding: '0 10px' | ||
}, | ||
underline: { | ||
width: '15px', | ||
borderTop: "2px solid " + theme.palette.primary.main | ||
} | ||
@@ -71,6 +86,8 @@ }; | ||
export var Header = function (_a) { | ||
var logo = _a.logo, links = _a.links, action = _a.action, style = _a.style, props = __rest(_a, ["logo", "links", "action", "style"]); | ||
var _b = _a.logo, logo = _b === void 0 ? CDN_URL + "/the-mindful-pug-logo-w-text.png" : _b, links = _a.links, action = _a.action, style = _a.style, props = __rest(_a, ["logo", "links", "action", "style"]); | ||
var _c = useState(false), hovered = _c[0], setHovered = _c[1]; | ||
return (_jsxs("div", __assign({ css: setStyles }, props, { style: style }, { children: [_jsx("div", { children: typeof logo === 'string' ? (_jsx(Image, { src: logo, style: styles.logo }, void 0)) : (logo) }, void 0), | ||
_jsx("div", __assign({ css: styles.links }, { children: links.map(function (l, i) { return (_jsx("div", __assign({ css: styles.link }, { children: _jsx(Link, { to: l.to, text: l.text }, void 0) }), i + l.text)); }) }), void 0), | ||
_jsx("div", __assign({ css: styles.links }, { children: links.map(function (l, i) { return (_jsxs("div", __assign({ css: styles.link, onMouseEnter: function () { return setHovered(true); }, onMouseLeave: function () { return setHovered(false); } }, { children: [_jsx(Link, { to: l.to, text: l.text, style: hovered ? styles.linkOverrideHover : styles.linkOverride }, void 0), | ||
hovered && _jsx("div", { style: styles.underline }, void 0)] }), i)); }) }), void 0), | ||
_jsx("div", __assign({ css: styles.action }, { children: Array.isArray(action) ? (action.map(function (a, i) { return (_jsx("div", __assign({ css: styles.button }, { children: a }), i)); })) : (_jsx("div", __assign({ css: styles.button }, { children: action }), void 0)) }), void 0)] }), void 0)); | ||
}; |
{ | ||
"name": "@themindfulpug/core", | ||
"version": "1.0.0-2", | ||
"version": "1.0.0", | ||
"author": "joshgreenwell", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.txt", |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
46697
1158
1
0