@khanacademy/wonder-blocks-breadcrumbs 3.1.9 → 3.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/es/index.js +3 -75
- package/dist/index.js +3 -79
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-breadcrumbs
|
|
2
2
|
|
|
3
|
+
## 3.1.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [28fa0c0]
|
|
8
|
+
- Updated dependencies [28fa0c0]
|
|
9
|
+
- @khanacademy/wonder-blocks-core@12.3.0
|
|
10
|
+
|
|
11
|
+
## 3.1.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [b9e4946]
|
|
16
|
+
- @khanacademy/wonder-blocks-tokens@10.0.0
|
|
17
|
+
- @khanacademy/wonder-blocks-core@12.2.1
|
|
18
|
+
|
|
3
19
|
## 3.1.9
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1,83 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { StyleSheet } from 'aphrodite';
|
|
5
4
|
import { addStyle } from '@khanacademy/wonder-blocks-core';
|
|
6
5
|
import { spacing } from '@khanacademy/wonder-blocks-tokens';
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
const StyledOl = addStyle("ol");
|
|
10
|
-
const Breadcrumbs = React.forwardRef(function Breadcrumbs(props, ref) {
|
|
11
|
-
const {
|
|
12
|
-
"aria-label": ariaLabel = "Breadcrumbs",
|
|
13
|
-
children,
|
|
14
|
-
testId
|
|
15
|
-
} = props,
|
|
16
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
17
|
-
const lastChildIndex = React.Children.count(children) - 1;
|
|
18
|
-
return React.createElement("nav", _extends({}, otherProps, {
|
|
19
|
-
"aria-label": ariaLabel,
|
|
20
|
-
"data-testid": testId,
|
|
21
|
-
ref: ref
|
|
22
|
-
}), React.createElement(StyledOl, {
|
|
23
|
-
style: styles$1.container
|
|
24
|
-
}, React.Children.map(children, (item, index) => {
|
|
25
|
-
const isLastChild = index === lastChildIndex;
|
|
26
|
-
return React.cloneElement(item, _extends({}, item.props, {
|
|
27
|
-
showSeparator: !isLastChild,
|
|
28
|
-
["aria-current"]: isLastChild ? "page" : undefined
|
|
29
|
-
}));
|
|
30
|
-
})));
|
|
31
|
-
});
|
|
32
|
-
const styles$1 = StyleSheet.create({
|
|
33
|
-
container: {
|
|
34
|
-
display: "flex",
|
|
35
|
-
listStyle: "none",
|
|
36
|
-
margin: 0,
|
|
37
|
-
padding: 0,
|
|
38
|
-
overflow: "hidden"
|
|
39
|
-
}
|
|
40
|
-
});
|
|
7
|
+
const StyledOl=addStyle("ol");const Breadcrumbs=React.forwardRef(function Breadcrumbs(props,ref){const{"aria-label":ariaLabel="Breadcrumbs",children,testId,...otherProps}=props;const lastChildIndex=React.Children.count(children)-1;return jsx("nav",{...otherProps,"aria-label":ariaLabel,"data-testid":testId,ref:ref,children:jsx(StyledOl,{style:styles$1.container,children:React.Children.map(children,(item,index)=>{const isLastChild=index===lastChildIndex;return React.cloneElement(item,{...item.props,showSeparator:!isLastChild,["aria-current"]:isLastChild?"page":undefined})})})})});const styles$1=StyleSheet.create({container:{display:"flex",listStyle:"none",margin:0,padding:0,overflow:"hidden"}});
|
|
41
8
|
|
|
42
|
-
const
|
|
43
|
-
const StyledLi = addStyle("li");
|
|
44
|
-
const StyledSvg = addStyle("svg");
|
|
45
|
-
const BreadcrumbsItem = React.forwardRef(function BreadcrumbsItem(props, ref) {
|
|
46
|
-
const {
|
|
47
|
-
children,
|
|
48
|
-
showSeparator,
|
|
49
|
-
testId
|
|
50
|
-
} = props,
|
|
51
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
52
|
-
const _renderSeparator = () => {
|
|
53
|
-
return React.createElement(StyledSvg, {
|
|
54
|
-
style: styles.separator,
|
|
55
|
-
width: 16,
|
|
56
|
-
height: 16,
|
|
57
|
-
viewBox: "0 0 16 16",
|
|
58
|
-
"aria-hidden": true
|
|
59
|
-
}, React.createElement("circle", {
|
|
60
|
-
cx: "8",
|
|
61
|
-
cy: "9",
|
|
62
|
-
r: "1.5"
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
return React.createElement(StyledLi, _extends({}, otherProps, {
|
|
66
|
-
style: styles.item,
|
|
67
|
-
"data-testid": testId,
|
|
68
|
-
ref: ref
|
|
69
|
-
}), children, showSeparator && _renderSeparator());
|
|
70
|
-
});
|
|
71
|
-
const styles = StyleSheet.create({
|
|
72
|
-
item: {
|
|
73
|
-
display: "flex",
|
|
74
|
-
alignItems: "center",
|
|
75
|
-
justifyContent: "center",
|
|
76
|
-
marginRight: spacing.xxxSmall_4
|
|
77
|
-
},
|
|
78
|
-
separator: {
|
|
79
|
-
marginLeft: spacing.xxxSmall_4
|
|
80
|
-
}
|
|
81
|
-
});
|
|
9
|
+
const StyledLi=addStyle("li");const StyledSvg=addStyle("svg");const BreadcrumbsItem=React.forwardRef(function BreadcrumbsItem(props,ref){const{children,showSeparator,testId,...otherProps}=props;const _renderSeparator=()=>{return jsx(StyledSvg,{style:styles.separator,width:16,height:16,viewBox:"0 0 16 16","aria-hidden":true,children:jsx("circle",{cx:"8",cy:"9",r:"1.5"})})};return jsxs(StyledLi,{...otherProps,style:styles.item,"data-testid":testId,ref:ref,children:[children,showSeparator&&_renderSeparator()]})});const styles=StyleSheet.create({item:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:spacing.xxxSmall_4},separator:{marginLeft:spacing.xxxSmall_4}});
|
|
82
10
|
|
|
83
11
|
export { Breadcrumbs, BreadcrumbsItem };
|
package/dist/index.js
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var aphrodite = require('aphrodite');
|
|
9
8
|
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
10
9
|
var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
|
|
11
10
|
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
11
|
function _interopNamespace(e) {
|
|
15
12
|
if (e && e.__esModule) return e;
|
|
16
13
|
var n = Object.create(null);
|
|
@@ -29,84 +26,11 @@ function _interopNamespace(e) {
|
|
|
29
26
|
return Object.freeze(n);
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
33
|
-
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
|
|
34
29
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
35
30
|
|
|
36
|
-
const
|
|
37
|
-
const StyledOl = wonderBlocksCore.addStyle("ol");
|
|
38
|
-
const Breadcrumbs = React__namespace.forwardRef(function Breadcrumbs(props, ref) {
|
|
39
|
-
const {
|
|
40
|
-
"aria-label": ariaLabel = "Breadcrumbs",
|
|
41
|
-
children,
|
|
42
|
-
testId
|
|
43
|
-
} = props,
|
|
44
|
-
otherProps = _objectWithoutPropertiesLoose__default["default"](props, _excluded$1);
|
|
45
|
-
const lastChildIndex = React__namespace.Children.count(children) - 1;
|
|
46
|
-
return React__namespace.createElement("nav", _extends__default["default"]({}, otherProps, {
|
|
47
|
-
"aria-label": ariaLabel,
|
|
48
|
-
"data-testid": testId,
|
|
49
|
-
ref: ref
|
|
50
|
-
}), React__namespace.createElement(StyledOl, {
|
|
51
|
-
style: styles$1.container
|
|
52
|
-
}, React__namespace.Children.map(children, (item, index) => {
|
|
53
|
-
const isLastChild = index === lastChildIndex;
|
|
54
|
-
return React__namespace.cloneElement(item, _extends__default["default"]({}, item.props, {
|
|
55
|
-
showSeparator: !isLastChild,
|
|
56
|
-
["aria-current"]: isLastChild ? "page" : undefined
|
|
57
|
-
}));
|
|
58
|
-
})));
|
|
59
|
-
});
|
|
60
|
-
const styles$1 = aphrodite.StyleSheet.create({
|
|
61
|
-
container: {
|
|
62
|
-
display: "flex",
|
|
63
|
-
listStyle: "none",
|
|
64
|
-
margin: 0,
|
|
65
|
-
padding: 0,
|
|
66
|
-
overflow: "hidden"
|
|
67
|
-
}
|
|
68
|
-
});
|
|
31
|
+
const StyledOl=wonderBlocksCore.addStyle("ol");const Breadcrumbs=React__namespace.forwardRef(function Breadcrumbs(props,ref){const{"aria-label":ariaLabel="Breadcrumbs",children,testId,...otherProps}=props;const lastChildIndex=React__namespace.Children.count(children)-1;return jsxRuntime.jsx("nav",{...otherProps,"aria-label":ariaLabel,"data-testid":testId,ref:ref,children:jsxRuntime.jsx(StyledOl,{style:styles$1.container,children:React__namespace.Children.map(children,(item,index)=>{const isLastChild=index===lastChildIndex;return React__namespace.cloneElement(item,{...item.props,showSeparator:!isLastChild,["aria-current"]:isLastChild?"page":undefined})})})})});const styles$1=aphrodite.StyleSheet.create({container:{display:"flex",listStyle:"none",margin:0,padding:0,overflow:"hidden"}});
|
|
69
32
|
|
|
70
|
-
const
|
|
71
|
-
const StyledLi = wonderBlocksCore.addStyle("li");
|
|
72
|
-
const StyledSvg = wonderBlocksCore.addStyle("svg");
|
|
73
|
-
const BreadcrumbsItem = React__namespace.forwardRef(function BreadcrumbsItem(props, ref) {
|
|
74
|
-
const {
|
|
75
|
-
children,
|
|
76
|
-
showSeparator,
|
|
77
|
-
testId
|
|
78
|
-
} = props,
|
|
79
|
-
otherProps = _objectWithoutPropertiesLoose__default["default"](props, _excluded);
|
|
80
|
-
const _renderSeparator = () => {
|
|
81
|
-
return React__namespace.createElement(StyledSvg, {
|
|
82
|
-
style: styles.separator,
|
|
83
|
-
width: 16,
|
|
84
|
-
height: 16,
|
|
85
|
-
viewBox: "0 0 16 16",
|
|
86
|
-
"aria-hidden": true
|
|
87
|
-
}, React__namespace.createElement("circle", {
|
|
88
|
-
cx: "8",
|
|
89
|
-
cy: "9",
|
|
90
|
-
r: "1.5"
|
|
91
|
-
}));
|
|
92
|
-
};
|
|
93
|
-
return React__namespace.createElement(StyledLi, _extends__default["default"]({}, otherProps, {
|
|
94
|
-
style: styles.item,
|
|
95
|
-
"data-testid": testId,
|
|
96
|
-
ref: ref
|
|
97
|
-
}), children, showSeparator && _renderSeparator());
|
|
98
|
-
});
|
|
99
|
-
const styles = aphrodite.StyleSheet.create({
|
|
100
|
-
item: {
|
|
101
|
-
display: "flex",
|
|
102
|
-
alignItems: "center",
|
|
103
|
-
justifyContent: "center",
|
|
104
|
-
marginRight: wonderBlocksTokens.spacing.xxxSmall_4
|
|
105
|
-
},
|
|
106
|
-
separator: {
|
|
107
|
-
marginLeft: wonderBlocksTokens.spacing.xxxSmall_4
|
|
108
|
-
}
|
|
109
|
-
});
|
|
33
|
+
const StyledLi=wonderBlocksCore.addStyle("li");const StyledSvg=wonderBlocksCore.addStyle("svg");const BreadcrumbsItem=React__namespace.forwardRef(function BreadcrumbsItem(props,ref){const{children,showSeparator,testId,...otherProps}=props;const _renderSeparator=()=>{return jsxRuntime.jsx(StyledSvg,{style:styles.separator,width:16,height:16,viewBox:"0 0 16 16","aria-hidden":true,children:jsxRuntime.jsx("circle",{cx:"8",cy:"9",r:"1.5"})})};return jsxRuntime.jsxs(StyledLi,{...otherProps,style:styles.item,"data-testid":testId,ref:ref,children:[children,showSeparator&&_renderSeparator()]})});const styles=aphrodite.StyleSheet.create({item:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:wonderBlocksTokens.spacing.xxxSmall_4},separator:{marginLeft:wonderBlocksTokens.spacing.xxxSmall_4}});
|
|
110
34
|
|
|
111
35
|
exports.Breadcrumbs = Breadcrumbs;
|
|
112
36
|
exports.BreadcrumbsItem = BreadcrumbsItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-breadcrumbs",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,16 +12,15 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@
|
|
16
|
-
"@khanacademy/wonder-blocks-
|
|
17
|
-
"@khanacademy/wonder-blocks-tokens": "9.0.0"
|
|
15
|
+
"@khanacademy/wonder-blocks-core": "12.3.0",
|
|
16
|
+
"@khanacademy/wonder-blocks-tokens": "10.0.0"
|
|
18
17
|
},
|
|
19
18
|
"peerDependencies": {
|
|
20
19
|
"aphrodite": "^1.2.5",
|
|
21
20
|
"react": "18.2.0"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
|
-
"@khanacademy/wb-dev-build-settings": "
|
|
23
|
+
"@khanacademy/wb-dev-build-settings": "3.0.0"
|
|
25
24
|
},
|
|
26
25
|
"scripts": {
|
|
27
26
|
"test": "echo \"Error: no test specified\" && exit 1"
|