@arch-ui/navbar
Advanced tools
Comparing version 0.0.6 to 0.0.7
# @arch-ui/navbar | ||
## 0.0.7 | ||
### Patch Changes | ||
- [81dc0be5](https://github.com/keystonejs/keystone-5/commit/81dc0be5): | ||
- Update dependencies | ||
## 0.0.6 | ||
@@ -4,0 +12,0 @@ |
@@ -25,4 +25,4 @@ 'use strict'; | ||
var ItemElement = function ItemElement(_ref) { | ||
var isSelected = _ref.isSelected, | ||
const ItemElement = _ref => { | ||
let isSelected = _ref.isSelected, | ||
props = _objectWithoutProperties(_ref, ["isSelected"]); | ||
@@ -37,4 +37,4 @@ | ||
var PRIMARY_NAV_GUTTER = theme.gridSize * 2; | ||
var NavGroupIcons = styled.div({ | ||
const PRIMARY_NAV_GUTTER = theme.gridSize * 2; | ||
const NavGroupIcons = styled.div({ | ||
alignItems: 'center', | ||
@@ -47,3 +47,3 @@ alignSelf: 'stretch', | ||
}); | ||
var PrimaryNav = styled.nav({ | ||
const PrimaryNav = styled.nav({ | ||
boxSizing: 'border-box', | ||
@@ -57,7 +57,7 @@ display: 'flex', | ||
}); | ||
var PrimaryNavScrollArea = styled.div(function (_ref) { | ||
var hasScroll = _ref.hasScroll, | ||
const PrimaryNavScrollArea = styled.div(_ref => { | ||
let hasScroll = _ref.hasScroll, | ||
isBottom = _ref.isBottom, | ||
isScrollable = _ref.isScrollable; | ||
var divider = { | ||
const divider = { | ||
backgroundColor: 'rgba(9, 30, 66, 0.1)', | ||
@@ -70,6 +70,6 @@ content: '" "', | ||
}; | ||
var before = hasScroll ? _objectSpread({}, divider, { | ||
const before = hasScroll ? _objectSpread({}, divider, { | ||
top: 0 | ||
}) : null; | ||
var after = isScrollable && !isBottom ? _objectSpread({}, divider, { | ||
const after = isScrollable && !isBottom ? _objectSpread({}, divider, { | ||
bottom: 0 | ||
@@ -89,3 +89,3 @@ }) : null; | ||
}); | ||
var BrandItem = styled.h2({ | ||
const BrandItem = styled.h2({ | ||
fontSize: 18, | ||
@@ -96,6 +96,6 @@ fontWeight: 500, | ||
}); | ||
var PrimaryNavItem = styled(ItemElement)(function (_ref2) { | ||
var depth = _ref2.depth, | ||
const PrimaryNavItem = styled(ItemElement)(_ref2 => { | ||
let depth = _ref2.depth, | ||
isSelected = _ref2.isSelected; | ||
var selectedStyles = isSelected ? { | ||
const selectedStyles = isSelected ? { | ||
'&, :hover, :active, :focus': { | ||
@@ -142,4 +142,4 @@ ':after': { | ||
}); | ||
var PrimaryNavHeading = styled.h3(function (_ref3) { | ||
var depth = _ref3.depth; | ||
const PrimaryNavHeading = styled.h3(_ref3 => { | ||
let depth = _ref3.depth; | ||
return { | ||
@@ -155,3 +155,3 @@ color: theme.colors.N40, | ||
}); | ||
var Wrapper = styled.nav({ | ||
const Wrapper = styled.nav({ | ||
borderBottom: "1px solid ".concat(theme.colors.N10), | ||
@@ -161,4 +161,4 @@ color: theme.colors.text, | ||
}); | ||
var SecondaryNavItem = styled(ItemElement)(function (_ref) { | ||
var isSelected = _ref.isSelected; | ||
const SecondaryNavItem = styled(ItemElement)(_ref => { | ||
let isSelected = _ref.isSelected; | ||
return { | ||
@@ -180,4 +180,4 @@ boxShadow: "inset 0 ".concat(isSelected ? -2 : 0, "px 0 currentColor"), | ||
var SecondaryNav = function SecondaryNav(_ref2) { | ||
var children = _ref2.children; | ||
const SecondaryNav = _ref2 => { | ||
let children = _ref2.children; | ||
return React.createElement(Wrapper, null, children); | ||
@@ -184,0 +184,0 @@ }; |
"use strict"; | ||
function _interopDefault(ex) { | ||
return ex && "object" == typeof ex && "default" in ex ? ex.default : ex; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: !0 }); | ||
var _objectSpread = _interopDefault( | ||
require("@babel/runtime/helpers/objectSpread") | ||
), | ||
styled = _interopDefault(require("@emotion/styled")), | ||
theme = require("@arch-ui/theme"), | ||
_extends = _interopDefault(require("@babel/runtime/helpers/extends")), | ||
_objectWithoutProperties = _interopDefault( | ||
require("@babel/runtime/helpers/objectWithoutProperties") | ||
), | ||
React = _interopDefault(require("react")), | ||
reactRouterDom = require("react-router-dom"), | ||
ItemElement = function(_ref) { | ||
_ref.isSelected; | ||
var props = _objectWithoutProperties(_ref, ["isSelected"]); | ||
return props.to | ||
? React.createElement(reactRouterDom.Link, props) | ||
: props.href | ||
? React.createElement("a", props) | ||
: React.createElement("button", _extends({ type: "button" }, props)); | ||
}, | ||
PRIMARY_NAV_GUTTER = 2 * theme.gridSize, | ||
NavGroupIcons = styled.div({ | ||
alignItems: "center", | ||
alignSelf: "stretch", | ||
display: "flex", | ||
flexFlow: "row nowrap", | ||
justifyContent: "space-between", | ||
padding: PRIMARY_NAV_GUTTER | ||
}), | ||
PrimaryNav = styled.nav({ | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}); | ||
var _objectSpread = _interopDefault(require("@babel/runtime/helpers/objectSpread")), styled = _interopDefault(require("@emotion/styled")), theme = require("@arch-ui/theme"), _extends = _interopDefault(require("@babel/runtime/helpers/extends")), _objectWithoutProperties = _interopDefault(require("@babel/runtime/helpers/objectWithoutProperties")), React = _interopDefault(require("react")), reactRouterDom = require("react-router-dom"); | ||
const ItemElement = _ref => { | ||
_ref.isSelected; | ||
let props = _objectWithoutProperties(_ref, [ "isSelected" ]); | ||
return props.to ? React.createElement(reactRouterDom.Link, props) : props.href ? React.createElement("a", props) : React.createElement("button", _extends({ | ||
type: "button" | ||
}, props)); | ||
}, PRIMARY_NAV_GUTTER = 2 * theme.gridSize, NavGroupIcons = styled.div({ | ||
alignItems: "center", | ||
alignSelf: "stretch", | ||
display: "flex", | ||
flexFlow: "row nowrap", | ||
justifyContent: "space-between", | ||
padding: PRIMARY_NAV_GUTTER | ||
}), PrimaryNav = styled.nav({ | ||
boxSizing: "border-box", | ||
display: "flex", | ||
flexFlow: "column nowrap", | ||
fontSize: "0.9rem", | ||
height: "100vh", | ||
position: "fixed", | ||
zIndex: 2 | ||
}), PrimaryNavScrollArea = styled.div(_ref => { | ||
let hasScroll = _ref.hasScroll, isBottom = _ref.isBottom, isScrollable = _ref.isScrollable; | ||
const divider = { | ||
backgroundColor: "rgba(9, 30, 66, 0.1)", | ||
content: '" "', | ||
height: 2, | ||
left: PRIMARY_NAV_GUTTER, | ||
right: PRIMARY_NAV_GUTTER, | ||
position: "absolute" | ||
}, before = hasScroll ? _objectSpread({}, divider, { | ||
top: 0 | ||
}) : null, after = isScrollable && !isBottom ? _objectSpread({}, divider, { | ||
bottom: 0 | ||
}) : null; | ||
return { | ||
boxSizing: "border-box", | ||
display: "flex", | ||
flexFlow: "column nowrap", | ||
fontSize: "0.9rem", | ||
height: "100vh", | ||
position: "fixed", | ||
zIndex: 2 | ||
}), | ||
PrimaryNavScrollArea = styled.div(function(_ref) { | ||
var hasScroll = _ref.hasScroll, | ||
isBottom = _ref.isBottom, | ||
isScrollable = _ref.isScrollable, | ||
divider = { | ||
backgroundColor: "rgba(9, 30, 66, 0.1)", | ||
content: '" "', | ||
height: 2, | ||
left: PRIMARY_NAV_GUTTER, | ||
right: PRIMARY_NAV_GUTTER, | ||
position: "absolute" | ||
}, | ||
before = hasScroll ? _objectSpread({}, divider, { top: 0 }) : null, | ||
after = | ||
isScrollable && !isBottom | ||
? _objectSpread({}, divider, { bottom: 0 }) | ||
: null; | ||
return { | ||
boxSizing: "border-box", | ||
flex: 1, | ||
overflowY: "auto", | ||
overflowX: "hidden", | ||
minWidth: 140, | ||
paddingBottom: PRIMARY_NAV_GUTTER, | ||
width: "100%", | ||
":before": before, | ||
":after": after | ||
}; | ||
}), | ||
BrandItem = styled.h2({ | ||
fontSize: 18, | ||
fontWeight: 500, | ||
margin: 0, | ||
paddingBottom: PRIMARY_NAV_GUTTER | ||
}), | ||
PrimaryNavItem = styled(ItemElement)(function(_ref2) { | ||
var depth = _ref2.depth, | ||
selectedStyles = _ref2.isSelected | ||
? { | ||
"&, :hover, :active, :focus": { | ||
":after": { backgroundColor: theme.colors.primary } | ||
} | ||
} | ||
: {}; | ||
return _objectSpread( | ||
{ | ||
border: 0, | ||
borderRight: "1px solid transparent", | ||
color: theme.colors.N90, | ||
display: "block", | ||
marginBottom: 2, | ||
overflow: "hidden", | ||
paddingLeft: depth ? PRIMARY_NAV_GUTTER * depth : PRIMARY_NAV_GUTTER, | ||
paddingRight: PRIMARY_NAV_GUTTER, | ||
paddingBottom: theme.gridSize, | ||
paddingTop: theme.gridSize, | ||
position: "relative", | ||
textDecoration: "none", | ||
textOverflow: "ellipsis", | ||
whiteSpace: "nowrap", | ||
":hover": { backgroundColor: theme.colors.N05, textDecoration: "none" }, | ||
":active": { backgroundColor: theme.colors.N10 }, | ||
":after": { | ||
borderRadius: 2, | ||
bottom: 2, | ||
content: '" "', | ||
pointerEvents: "none", | ||
position: "absolute", | ||
right: 6, | ||
top: 2, | ||
transition: "background-color 110ms", | ||
width: 4 | ||
} | ||
}, | ||
selectedStyles | ||
); | ||
}), | ||
PrimaryNavHeading = styled.h3(function(_ref3) { | ||
var depth = _ref3.depth; | ||
return { | ||
color: theme.colors.N40, | ||
fontSize: "0.85em", | ||
fontWeight: "bold", | ||
marginTop: "2em", | ||
paddingLeft: depth ? PRIMARY_NAV_GUTTER * depth : PRIMARY_NAV_GUTTER, | ||
paddingRight: PRIMARY_NAV_GUTTER, | ||
textTransform: "uppercase" | ||
}; | ||
}), | ||
Wrapper = styled.nav({ | ||
borderBottom: "1px solid ".concat(theme.colors.N10), | ||
color: theme.colors.text, | ||
fontSize: "0.85em" | ||
}), | ||
SecondaryNavItem = styled(ItemElement)(function(_ref) { | ||
var isSelected = _ref.isSelected; | ||
return { | ||
boxShadow: "inset 0 ".concat(isSelected ? -2 : 0, "px 0 currentColor"), | ||
color: isSelected ? theme.colors.text : theme.colors.N60, | ||
cursor: "pointer", | ||
display: "inline-block", | ||
marginRight: theme.gridSize, | ||
paddingBottom: 2 * theme.gridSize, | ||
paddingTop: 2 * theme.gridSize, | ||
transition: "box-shadow 200ms", | ||
":hover": { color: theme.colors.text, textDecoration: "none" } | ||
}; | ||
}), | ||
SecondaryNav = function(_ref2) { | ||
var children = _ref2.children; | ||
return React.createElement(Wrapper, null, children); | ||
flex: 1, | ||
overflowY: "auto", | ||
overflowX: "hidden", | ||
minWidth: 140, | ||
paddingBottom: PRIMARY_NAV_GUTTER, | ||
width: "100%", | ||
":before": before, | ||
":after": after | ||
}; | ||
(exports.BrandItem = BrandItem), | ||
(exports.PrimaryNav = PrimaryNav), | ||
(exports.PrimaryNavItem = PrimaryNavItem), | ||
(exports.PrimaryNavHeading = PrimaryNavHeading), | ||
(exports.PrimaryNavScrollArea = PrimaryNavScrollArea), | ||
(exports.NavGroupIcons = NavGroupIcons), | ||
(exports.PRIMARY_NAV_GUTTER = PRIMARY_NAV_GUTTER), | ||
(exports.SecondaryNav = SecondaryNav), | ||
(exports.SecondaryNavItem = SecondaryNavItem); | ||
}), BrandItem = styled.h2({ | ||
fontSize: 18, | ||
fontWeight: 500, | ||
margin: 0, | ||
paddingBottom: PRIMARY_NAV_GUTTER | ||
}), PrimaryNavItem = styled(ItemElement)(_ref2 => { | ||
let depth = _ref2.depth; | ||
const selectedStyles = _ref2.isSelected ? { | ||
"&, :hover, :active, :focus": { | ||
":after": { | ||
backgroundColor: theme.colors.primary | ||
} | ||
} | ||
} : {}; | ||
return _objectSpread({ | ||
border: 0, | ||
borderRight: "1px solid transparent", | ||
color: theme.colors.N90, | ||
display: "block", | ||
marginBottom: 2, | ||
overflow: "hidden", | ||
paddingLeft: depth ? PRIMARY_NAV_GUTTER * depth : PRIMARY_NAV_GUTTER, | ||
paddingRight: PRIMARY_NAV_GUTTER, | ||
paddingBottom: theme.gridSize, | ||
paddingTop: theme.gridSize, | ||
position: "relative", | ||
textDecoration: "none", | ||
textOverflow: "ellipsis", | ||
whiteSpace: "nowrap", | ||
":hover": { | ||
backgroundColor: theme.colors.N05, | ||
textDecoration: "none" | ||
}, | ||
":active": { | ||
backgroundColor: theme.colors.N10 | ||
}, | ||
":after": { | ||
borderRadius: 2, | ||
bottom: 2, | ||
content: '" "', | ||
pointerEvents: "none", | ||
position: "absolute", | ||
right: 6, | ||
top: 2, | ||
transition: "background-color 110ms", | ||
width: 4 | ||
} | ||
}, selectedStyles); | ||
}), PrimaryNavHeading = styled.h3(_ref3 => { | ||
let depth = _ref3.depth; | ||
return { | ||
color: theme.colors.N40, | ||
fontSize: "0.85em", | ||
fontWeight: "bold", | ||
marginTop: "2em", | ||
paddingLeft: depth ? PRIMARY_NAV_GUTTER * depth : PRIMARY_NAV_GUTTER, | ||
paddingRight: PRIMARY_NAV_GUTTER, | ||
textTransform: "uppercase" | ||
}; | ||
}), Wrapper = styled.nav({ | ||
borderBottom: "1px solid ".concat(theme.colors.N10), | ||
color: theme.colors.text, | ||
fontSize: "0.85em" | ||
}), SecondaryNavItem = styled(ItemElement)(_ref => { | ||
let isSelected = _ref.isSelected; | ||
return { | ||
boxShadow: "inset 0 ".concat(isSelected ? -2 : 0, "px 0 currentColor"), | ||
color: isSelected ? theme.colors.text : theme.colors.N60, | ||
cursor: "pointer", | ||
display: "inline-block", | ||
marginRight: theme.gridSize, | ||
paddingBottom: 2 * theme.gridSize, | ||
paddingTop: 2 * theme.gridSize, | ||
transition: "box-shadow 200ms", | ||
":hover": { | ||
color: theme.colors.text, | ||
textDecoration: "none" | ||
} | ||
}; | ||
}), SecondaryNav = _ref2 => { | ||
let children = _ref2.children; | ||
return React.createElement(Wrapper, null, children); | ||
}; | ||
exports.BrandItem = BrandItem, exports.PrimaryNav = PrimaryNav, exports.PrimaryNavItem = PrimaryNavItem, | ||
exports.PrimaryNavHeading = PrimaryNavHeading, exports.PrimaryNavScrollArea = PrimaryNavScrollArea, | ||
exports.NavGroupIcons = NavGroupIcons, exports.PRIMARY_NAV_GUTTER = PRIMARY_NAV_GUTTER, | ||
exports.SecondaryNav = SecondaryNav, exports.SecondaryNavItem = SecondaryNavItem; |
@@ -9,4 +9,4 @@ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread'; | ||
var ItemElement = function ItemElement(_ref) { | ||
var isSelected = _ref.isSelected, | ||
const ItemElement = (_ref) => { | ||
let isSelected = _ref.isSelected, | ||
props = _objectWithoutProperties(_ref, ["isSelected"]); | ||
@@ -21,4 +21,4 @@ | ||
var PRIMARY_NAV_GUTTER = gridSize * 2; | ||
var NavGroupIcons = styled.div({ | ||
const PRIMARY_NAV_GUTTER = gridSize * 2; | ||
const NavGroupIcons = styled.div({ | ||
alignItems: 'center', | ||
@@ -31,3 +31,3 @@ alignSelf: 'stretch', | ||
}); | ||
var PrimaryNav = styled.nav({ | ||
const PrimaryNav = styled.nav({ | ||
boxSizing: 'border-box', | ||
@@ -41,7 +41,7 @@ display: 'flex', | ||
}); | ||
var PrimaryNavScrollArea = styled.div(function (_ref) { | ||
var hasScroll = _ref.hasScroll, | ||
const PrimaryNavScrollArea = styled.div((_ref) => { | ||
let hasScroll = _ref.hasScroll, | ||
isBottom = _ref.isBottom, | ||
isScrollable = _ref.isScrollable; | ||
var divider = { | ||
const divider = { | ||
backgroundColor: 'rgba(9, 30, 66, 0.1)', | ||
@@ -54,6 +54,6 @@ content: '" "', | ||
}; | ||
var before = hasScroll ? _objectSpread({}, divider, { | ||
const before = hasScroll ? _objectSpread({}, divider, { | ||
top: 0 | ||
}) : null; | ||
var after = isScrollable && !isBottom ? _objectSpread({}, divider, { | ||
const after = isScrollable && !isBottom ? _objectSpread({}, divider, { | ||
bottom: 0 | ||
@@ -73,3 +73,3 @@ }) : null; | ||
}); | ||
var BrandItem = styled.h2({ | ||
const BrandItem = styled.h2({ | ||
fontSize: 18, | ||
@@ -80,6 +80,6 @@ fontWeight: 500, | ||
}); | ||
var PrimaryNavItem = styled(ItemElement)(function (_ref2) { | ||
var depth = _ref2.depth, | ||
const PrimaryNavItem = styled(ItemElement)((_ref2) => { | ||
let depth = _ref2.depth, | ||
isSelected = _ref2.isSelected; | ||
var selectedStyles = isSelected ? { | ||
const selectedStyles = isSelected ? { | ||
'&, :hover, :active, :focus': { | ||
@@ -126,4 +126,4 @@ ':after': { | ||
}); | ||
var PrimaryNavHeading = styled.h3(function (_ref3) { | ||
var depth = _ref3.depth; | ||
const PrimaryNavHeading = styled.h3((_ref3) => { | ||
let depth = _ref3.depth; | ||
return { | ||
@@ -140,3 +140,3 @@ color: colors.N40, | ||
var Wrapper = styled.nav({ | ||
const Wrapper = styled.nav({ | ||
borderBottom: "1px solid ".concat(colors.N10), | ||
@@ -146,4 +146,4 @@ color: colors.text, | ||
}); | ||
var SecondaryNavItem = styled(ItemElement)(function (_ref) { | ||
var isSelected = _ref.isSelected; | ||
const SecondaryNavItem = styled(ItemElement)((_ref) => { | ||
let isSelected = _ref.isSelected; | ||
return { | ||
@@ -164,4 +164,4 @@ boxShadow: "inset 0 ".concat(isSelected ? -2 : 0, "px 0 currentColor"), | ||
}); | ||
var SecondaryNav = function SecondaryNav(_ref2) { | ||
var children = _ref2.children; | ||
const SecondaryNav = (_ref2) => { | ||
let children = _ref2.children; | ||
return React.createElement(Wrapper, null, children); | ||
@@ -168,0 +168,0 @@ }; |
{ | ||
"name": "@arch-ui/navbar", | ||
"description": "Navbar UI as used in @keystone-alpha Admin UI.", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"author": "Jed Watson", | ||
@@ -9,13 +9,13 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"react": "^16.8.4" | ||
"react": "^16.8.6" | ||
}, | ||
"devDependencies": { | ||
"react": "^16.8.4" | ||
"react": "^16.8.6" | ||
}, | ||
"dependencies": { | ||
"@arch-ui/color-utils": "^0.0.1", | ||
"@arch-ui/theme": "^0.0.3", | ||
"@babel/runtime": "^7.3.4", | ||
"@emotion/core": "^10.0.9", | ||
"@emotion/styled": "^10.0.9", | ||
"@arch-ui/theme": "^0.0.4", | ||
"@babel/runtime": "^7.4.3", | ||
"@emotion/core": "^10.0.10", | ||
"@emotion/styled": "^10.0.10", | ||
"react-router-dom": "5.0.0" | ||
@@ -22,0 +22,0 @@ }, |
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
19928
623
+ Added@arch-ui/theme@0.0.4(transitive)
- Removed@arch-ui/theme@0.0.3(transitive)
Updated@arch-ui/theme@^0.0.4
Updated@babel/runtime@^7.4.3
Updated@emotion/core@^10.0.10
Updated@emotion/styled@^10.0.10