@zendeskgarden/container-breadcrumb
Advanced tools
Comparing version
@@ -20,55 +20,26 @@ /** | ||
function _extends() { | ||
_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; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const useBreadcrumb = () => ({ | ||
getContainerProps: _ref => { | ||
let { | ||
role = 'navigation', | ||
...other | ||
} = _ref; | ||
return { | ||
role: role === null ? undefined : role, | ||
'data-garden-container-id': 'containers.breadcrumb', | ||
'data-garden-container-version': '1.0.1', | ||
...other | ||
}; | ||
}, | ||
getCurrentPageProps: props => ({ | ||
'aria-current': 'page', | ||
...props | ||
}) | ||
}); | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
var _excluded = ["role"]; | ||
var useBreadcrumb = function useBreadcrumb() { | ||
return { | ||
getContainerProps: function getContainerProps(_ref) { | ||
var _ref$role = _ref.role, | ||
role = _ref$role === void 0 ? 'navigation' : _ref$role, | ||
other = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
return _extends({ | ||
role: role === null ? undefined : role, | ||
'data-garden-container-id': 'containers.breadcrumb', | ||
'data-garden-container-version': '1.0.0' | ||
}, other); | ||
}, | ||
getCurrentPageProps: function getCurrentPageProps(props) { | ||
return _extends({ | ||
'aria-current': 'page' | ||
}, props); | ||
} | ||
}; | ||
}; | ||
var BreadcrumbContainer = function BreadcrumbContainer(_ref) { | ||
var children = _ref.children, | ||
_ref$render = _ref.render, | ||
render = _ref$render === void 0 ? children : _ref$render; | ||
const BreadcrumbContainer = _ref => { | ||
let { | ||
children, | ||
render = children | ||
} = _ref; | ||
return React__default["default"].createElement(React__default["default"].Fragment, null, render(useBreadcrumb())); | ||
@@ -75,0 +46,0 @@ }; |
@@ -11,55 +11,26 @@ /** | ||
function _extends() { | ||
_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; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const useBreadcrumb = () => ({ | ||
getContainerProps: _ref => { | ||
let { | ||
role = 'navigation', | ||
...other | ||
} = _ref; | ||
return { | ||
role: role === null ? undefined : role, | ||
'data-garden-container-id': 'containers.breadcrumb', | ||
'data-garden-container-version': '1.0.1', | ||
...other | ||
}; | ||
}, | ||
getCurrentPageProps: props => ({ | ||
'aria-current': 'page', | ||
...props | ||
}) | ||
}); | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
var _excluded = ["role"]; | ||
var useBreadcrumb = function useBreadcrumb() { | ||
return { | ||
getContainerProps: function getContainerProps(_ref) { | ||
var _ref$role = _ref.role, | ||
role = _ref$role === void 0 ? 'navigation' : _ref$role, | ||
other = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
return _extends({ | ||
role: role === null ? undefined : role, | ||
'data-garden-container-id': 'containers.breadcrumb', | ||
'data-garden-container-version': '1.0.0' | ||
}, other); | ||
}, | ||
getCurrentPageProps: function getCurrentPageProps(props) { | ||
return _extends({ | ||
'aria-current': 'page' | ||
}, props); | ||
} | ||
}; | ||
}; | ||
var BreadcrumbContainer = function BreadcrumbContainer(_ref) { | ||
var children = _ref.children, | ||
_ref$render = _ref.render, | ||
render = _ref$render === void 0 ? children : _ref$render; | ||
const BreadcrumbContainer = _ref => { | ||
let { | ||
children, | ||
render = children | ||
} = _ref; | ||
return React.createElement(React.Fragment, null, render(useBreadcrumb())); | ||
@@ -66,0 +37,0 @@ }; |
{ | ||
"name": "@zendeskgarden/container-breadcrumb", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Containers relating to breadcrumb in the Garden Design System", | ||
@@ -43,3 +43,3 @@ "license": "Apache-2.0", | ||
"zendeskgarden:src": "src/index.ts", | ||
"gitHead": "9d58d7c857d5b21a8d90558be2f2be341b2a9270" | ||
"gitHead": "621beb216c03789ed99aa39ed0f2897fa2e52368" | ||
} |
17401
-36.1%9
-10%136
-28.42%