@khanacademy/wonder-blocks-breadcrumbs 1.0.32 → 1.0.34
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/index.js +65 -40
- package/docs.md +3 -24
- package/package.json +3 -3
- package/src/__tests__/__snapshots__/generated-snapshot.test.js.snap +0 -151
- package/src/__tests__/generated-snapshot.test.js +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-breadcrumbs
|
|
2
2
|
|
|
3
|
+
## 1.0.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [175a2dd2]
|
|
8
|
+
- @khanacademy/wonder-blocks-core@4.5.0
|
|
9
|
+
- @khanacademy/wonder-blocks-typography@1.1.34
|
|
10
|
+
|
|
11
|
+
## 1.0.33
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [6ee20af9]
|
|
16
|
+
- @khanacademy/wonder-blocks-core@4.4.0
|
|
17
|
+
- @khanacademy/wonder-blocks-typography@1.1.33
|
|
18
|
+
|
|
3
19
|
## 1.0.32
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 7);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -101,32 +101,56 @@ module.exports = require("@khanacademy/wonder-blocks-core");
|
|
|
101
101
|
/* 2 */
|
|
102
102
|
/***/ (function(module, exports) {
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
function _extends() {
|
|
105
|
+
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
106
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
107
|
+
var source = arguments[i];
|
|
108
|
+
|
|
109
|
+
for (var key in source) {
|
|
110
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
111
|
+
target[key] = source[key];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return target;
|
|
117
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
118
|
+
return _extends.apply(this, arguments);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
105
122
|
|
|
106
123
|
/***/ }),
|
|
107
124
|
/* 3 */
|
|
108
125
|
/***/ (function(module, exports) {
|
|
109
126
|
|
|
110
|
-
module.exports = require("
|
|
127
|
+
module.exports = require("aphrodite");
|
|
111
128
|
|
|
112
129
|
/***/ }),
|
|
113
130
|
/* 4 */
|
|
131
|
+
/***/ (function(module, exports) {
|
|
132
|
+
|
|
133
|
+
module.exports = require("@khanacademy/wonder-blocks-spacing");
|
|
134
|
+
|
|
135
|
+
/***/ }),
|
|
136
|
+
/* 5 */
|
|
114
137
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
115
138
|
|
|
116
139
|
"use strict";
|
|
117
140
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Breadcrumbs; });
|
|
118
|
-
/* harmony import */ var
|
|
119
|
-
/* harmony import */ var
|
|
120
|
-
/* harmony import */ var
|
|
121
|
-
/* harmony import */ var
|
|
122
|
-
/* harmony import */ var
|
|
123
|
-
/* harmony import */ var
|
|
124
|
-
|
|
141
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
142
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
143
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
144
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
145
|
+
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
|
|
146
|
+
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_2__);
|
|
147
|
+
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
|
|
148
|
+
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
125
149
|
|
|
126
150
|
|
|
127
151
|
|
|
128
152
|
|
|
129
|
-
const StyledList = Object(
|
|
153
|
+
const StyledList = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__["addStyle"])("ol");
|
|
130
154
|
/**
|
|
131
155
|
* A breadcrumb trail consists of a list of links to the parent pages
|
|
132
156
|
* of the current page in hierarchical order. It helps users find their
|
|
@@ -165,7 +189,7 @@ const StyledList = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODU
|
|
|
165
189
|
* ```
|
|
166
190
|
*/
|
|
167
191
|
|
|
168
|
-
class Breadcrumbs extends
|
|
192
|
+
class Breadcrumbs extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
169
193
|
// Moved it here, in case we need to override the label for a different
|
|
170
194
|
// language
|
|
171
195
|
render() {
|
|
@@ -176,14 +200,14 @@ class Breadcrumbs extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
176
200
|
} = this.props; // using React.Children allows to deal with opaque data structures
|
|
177
201
|
// e.g. children = 'string' vs children = []
|
|
178
202
|
|
|
179
|
-
const lastChildIndex =
|
|
180
|
-
return /*#__PURE__*/
|
|
203
|
+
const lastChildIndex = react__WEBPACK_IMPORTED_MODULE_1__["Children"].count(children) - 1;
|
|
204
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("nav", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, otherProps, {
|
|
181
205
|
"data-test-id": testId
|
|
182
|
-
}), /*#__PURE__*/
|
|
206
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledList, {
|
|
183
207
|
style: styles.container
|
|
184
|
-
},
|
|
208
|
+
}, react__WEBPACK_IMPORTED_MODULE_1__["Children"].map(children, (item, index) => {
|
|
185
209
|
const isLastChild = index === lastChildIndex;
|
|
186
|
-
return /*#__PURE__*/
|
|
210
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["cloneElement"](item, { ...item.props,
|
|
187
211
|
showSeparator: !isLastChild,
|
|
188
212
|
["aria-current"]: isLastChild ? "page" : undefined
|
|
189
213
|
});
|
|
@@ -194,7 +218,7 @@ class Breadcrumbs extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
194
218
|
Breadcrumbs.defaultProps = {
|
|
195
219
|
"aria-label": "Breadcrumbs"
|
|
196
220
|
};
|
|
197
|
-
const styles =
|
|
221
|
+
const styles = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create({
|
|
198
222
|
container: {
|
|
199
223
|
display: "flex",
|
|
200
224
|
listStyle: "none",
|
|
@@ -205,44 +229,45 @@ const styles = aphrodite__WEBPACK_IMPORTED_MODULE_1__["StyleSheet"].create({
|
|
|
205
229
|
});
|
|
206
230
|
|
|
207
231
|
/***/ }),
|
|
208
|
-
/*
|
|
232
|
+
/* 6 */
|
|
209
233
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
210
234
|
|
|
211
235
|
"use strict";
|
|
212
236
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BreadcrumbsItem; });
|
|
213
|
-
/* harmony import */ var
|
|
214
|
-
/* harmony import */ var
|
|
215
|
-
/* harmony import */ var
|
|
216
|
-
/* harmony import */ var
|
|
217
|
-
/* harmony import */ var
|
|
218
|
-
/* harmony import */ var
|
|
219
|
-
/* harmony import */ var
|
|
220
|
-
/* harmony import */ var
|
|
221
|
-
|
|
237
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
238
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
239
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
240
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
241
|
+
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
|
|
242
|
+
/* harmony import */ var aphrodite__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(aphrodite__WEBPACK_IMPORTED_MODULE_2__);
|
|
243
|
+
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
|
|
244
|
+
/* harmony import */ var _khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
245
|
+
/* harmony import */ var _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);
|
|
246
|
+
/* harmony import */ var _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_4__);
|
|
222
247
|
|
|
223
248
|
|
|
224
249
|
|
|
225
250
|
|
|
226
251
|
|
|
227
|
-
const StyledListItem = Object(
|
|
228
|
-
const StyledSvg = Object(
|
|
252
|
+
const StyledListItem = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__["addStyle"])("li");
|
|
253
|
+
const StyledSvg = Object(_khanacademy_wonder_blocks_core__WEBPACK_IMPORTED_MODULE_3__["addStyle"])("svg");
|
|
229
254
|
/**
|
|
230
255
|
* The BreadcrumbsItem represents an individual item in the breadcrumbs list.
|
|
231
256
|
*/
|
|
232
257
|
|
|
233
|
-
class BreadcrumbsItem extends
|
|
258
|
+
class BreadcrumbsItem extends react__WEBPACK_IMPORTED_MODULE_1__["Component"] {
|
|
234
259
|
/**
|
|
235
260
|
* Renders a separator after the content
|
|
236
261
|
* It draws a circular bullet point using an SVG circle shape
|
|
237
262
|
*/
|
|
238
263
|
_renderSeparator() {
|
|
239
|
-
return /*#__PURE__*/
|
|
264
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledSvg, {
|
|
240
265
|
style: styles.separator,
|
|
241
266
|
width: 16,
|
|
242
267
|
height: 16,
|
|
243
268
|
viewBox: "0 0 16 16",
|
|
244
269
|
"aria-hidden": true
|
|
245
|
-
}, /*#__PURE__*/
|
|
270
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("circle", {
|
|
246
271
|
cx: "8",
|
|
247
272
|
cy: "9",
|
|
248
273
|
r: "1.5"
|
|
@@ -256,35 +281,35 @@ class BreadcrumbsItem extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
256
281
|
testId,
|
|
257
282
|
...otherProps
|
|
258
283
|
} = this.props;
|
|
259
|
-
return /*#__PURE__*/
|
|
284
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](StyledListItem, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, otherProps, {
|
|
260
285
|
style: styles.item,
|
|
261
286
|
"data-test-id": testId
|
|
262
287
|
}), children, showSeparator && this._renderSeparator());
|
|
263
288
|
}
|
|
264
289
|
|
|
265
290
|
}
|
|
266
|
-
const styles =
|
|
291
|
+
const styles = aphrodite__WEBPACK_IMPORTED_MODULE_2__["StyleSheet"].create({
|
|
267
292
|
item: {
|
|
268
293
|
display: "flex",
|
|
269
294
|
alignItems: "center",
|
|
270
295
|
justifyContent: "center",
|
|
271
|
-
marginRight:
|
|
296
|
+
marginRight: _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_4___default.a.xxxSmall_4
|
|
272
297
|
},
|
|
273
298
|
separator: {
|
|
274
|
-
marginLeft:
|
|
299
|
+
marginLeft: _khanacademy_wonder_blocks_spacing__WEBPACK_IMPORTED_MODULE_4___default.a.xxxSmall_4
|
|
275
300
|
}
|
|
276
301
|
});
|
|
277
302
|
|
|
278
303
|
/***/ }),
|
|
279
|
-
/*
|
|
304
|
+
/* 7 */
|
|
280
305
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
281
306
|
|
|
282
307
|
"use strict";
|
|
283
308
|
__webpack_require__.r(__webpack_exports__);
|
|
284
|
-
/* harmony import */ var _components_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
309
|
+
/* harmony import */ var _components_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
|
285
310
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return _components_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_0__["a"]; });
|
|
286
311
|
|
|
287
|
-
/* harmony import */ var _components_breadcrumbs_item_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
312
|
+
/* harmony import */ var _components_breadcrumbs_item_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
|
|
288
313
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BreadcrumbsItem", function() { return _components_breadcrumbs_item_js__WEBPACK_IMPORTED_MODULE_1__["a"]; });
|
|
289
314
|
|
|
290
315
|
|
package/docs.md
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import Link from "@khanacademy/wonder-blocks-link";
|
|
3
|
-
import {Breadcrumbs, BreadcrumbsItem} from "@khanacademy/wonder-blocks-breadcrumbs";
|
|
1
|
+
Documentation for `@khanacademy/wonder-blocks-breadcrumbs` is now in Storybook.
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<Link href="https://khanacademy.org/">Home</Link>
|
|
8
|
-
</BreadcrumbsItem>
|
|
9
|
-
<BreadcrumbsItem>
|
|
10
|
-
<Link href="https://khanacademy.org/about">About</Link>
|
|
11
|
-
</BreadcrumbsItem>
|
|
12
|
-
<BreadcrumbsItem>Current page</BreadcrumbsItem>
|
|
13
|
-
</Breadcrumbs>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
**NOTE**: `<BreadcrumbsItem />` only accepts two element types:
|
|
17
|
-
|
|
18
|
-
1. string
|
|
19
|
-
2. `<Link />`
|
|
20
|
-
|
|
21
|
-
## Accessibility
|
|
22
|
-
|
|
23
|
-
- It should follow guidelines from [W3C](https://www.w3.org/TR/wai-aria-practices/examples/breadcrumb/index.html).
|
|
24
|
-
- Use aria-label=Breadcrumb for the container (nav).
|
|
25
|
-
- Use aria-current=page for the link containing the current page.
|
|
3
|
+
Visit the [Storybook Breadcrumbs](https://khan.github.io/wonder-blocks/?path=/docs/breadcrumbs)
|
|
4
|
+
docs on GitHub Pages.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-breadcrumbs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
19
|
"@khanacademy/wonder-blocks-color": "^1.2.0",
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
20
|
+
"@khanacademy/wonder-blocks-core": "^4.5.0",
|
|
21
21
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
22
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
22
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.34"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"aphrodite": "^1.2.5",
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`wonder-blocks-breadcrumbs example 1 1`] = `
|
|
4
|
-
<nav
|
|
5
|
-
aria-label="Breadcrumbs"
|
|
6
|
-
>
|
|
7
|
-
<ol
|
|
8
|
-
className=""
|
|
9
|
-
style={
|
|
10
|
-
Object {
|
|
11
|
-
"display": "flex",
|
|
12
|
-
"listStyle": "none",
|
|
13
|
-
"margin": 0,
|
|
14
|
-
"overflow": "hidden",
|
|
15
|
-
"padding": 0,
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
>
|
|
19
|
-
<li
|
|
20
|
-
className=""
|
|
21
|
-
style={
|
|
22
|
-
Object {
|
|
23
|
-
"alignItems": "center",
|
|
24
|
-
"display": "flex",
|
|
25
|
-
"justifyContent": "center",
|
|
26
|
-
"marginRight": 4,
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
>
|
|
30
|
-
<a
|
|
31
|
-
className=""
|
|
32
|
-
href="https://khanacademy.org/"
|
|
33
|
-
onBlur={[Function]}
|
|
34
|
-
onClick={[Function]}
|
|
35
|
-
onDragStart={[Function]}
|
|
36
|
-
onFocus={[Function]}
|
|
37
|
-
onKeyDown={[Function]}
|
|
38
|
-
onKeyUp={[Function]}
|
|
39
|
-
onMouseDown={[Function]}
|
|
40
|
-
onMouseEnter={[Function]}
|
|
41
|
-
onMouseLeave={[Function]}
|
|
42
|
-
onMouseUp={[Function]}
|
|
43
|
-
onTouchCancel={[Function]}
|
|
44
|
-
onTouchEnd={[Function]}
|
|
45
|
-
onTouchStart={[Function]}
|
|
46
|
-
style={
|
|
47
|
-
Object {
|
|
48
|
-
"color": "#1865f2",
|
|
49
|
-
"cursor": "pointer",
|
|
50
|
-
"outline": "none",
|
|
51
|
-
"textDecoration": "none",
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
tabIndex={0}
|
|
55
|
-
>
|
|
56
|
-
Home
|
|
57
|
-
</a>
|
|
58
|
-
<svg
|
|
59
|
-
aria-hidden={true}
|
|
60
|
-
className=""
|
|
61
|
-
height={16}
|
|
62
|
-
style={
|
|
63
|
-
Object {
|
|
64
|
-
"marginLeft": 4,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
viewBox="0 0 16 16"
|
|
68
|
-
width={16}
|
|
69
|
-
>
|
|
70
|
-
<circle
|
|
71
|
-
cx="8"
|
|
72
|
-
cy="9"
|
|
73
|
-
r="1.5"
|
|
74
|
-
/>
|
|
75
|
-
</svg>
|
|
76
|
-
</li>
|
|
77
|
-
<li
|
|
78
|
-
className=""
|
|
79
|
-
style={
|
|
80
|
-
Object {
|
|
81
|
-
"alignItems": "center",
|
|
82
|
-
"display": "flex",
|
|
83
|
-
"justifyContent": "center",
|
|
84
|
-
"marginRight": 4,
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
>
|
|
88
|
-
<a
|
|
89
|
-
className=""
|
|
90
|
-
href="https://khanacademy.org/about"
|
|
91
|
-
onBlur={[Function]}
|
|
92
|
-
onClick={[Function]}
|
|
93
|
-
onDragStart={[Function]}
|
|
94
|
-
onFocus={[Function]}
|
|
95
|
-
onKeyDown={[Function]}
|
|
96
|
-
onKeyUp={[Function]}
|
|
97
|
-
onMouseDown={[Function]}
|
|
98
|
-
onMouseEnter={[Function]}
|
|
99
|
-
onMouseLeave={[Function]}
|
|
100
|
-
onMouseUp={[Function]}
|
|
101
|
-
onTouchCancel={[Function]}
|
|
102
|
-
onTouchEnd={[Function]}
|
|
103
|
-
onTouchStart={[Function]}
|
|
104
|
-
style={
|
|
105
|
-
Object {
|
|
106
|
-
"color": "#1865f2",
|
|
107
|
-
"cursor": "pointer",
|
|
108
|
-
"outline": "none",
|
|
109
|
-
"textDecoration": "none",
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
tabIndex={0}
|
|
113
|
-
>
|
|
114
|
-
About
|
|
115
|
-
</a>
|
|
116
|
-
<svg
|
|
117
|
-
aria-hidden={true}
|
|
118
|
-
className=""
|
|
119
|
-
height={16}
|
|
120
|
-
style={
|
|
121
|
-
Object {
|
|
122
|
-
"marginLeft": 4,
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
viewBox="0 0 16 16"
|
|
126
|
-
width={16}
|
|
127
|
-
>
|
|
128
|
-
<circle
|
|
129
|
-
cx="8"
|
|
130
|
-
cy="9"
|
|
131
|
-
r="1.5"
|
|
132
|
-
/>
|
|
133
|
-
</svg>
|
|
134
|
-
</li>
|
|
135
|
-
<li
|
|
136
|
-
aria-current="page"
|
|
137
|
-
className=""
|
|
138
|
-
style={
|
|
139
|
-
Object {
|
|
140
|
-
"alignItems": "center",
|
|
141
|
-
"display": "flex",
|
|
142
|
-
"justifyContent": "center",
|
|
143
|
-
"marginRight": 4,
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
>
|
|
147
|
-
Current page
|
|
148
|
-
</li>
|
|
149
|
-
</ol>
|
|
150
|
-
</nav>
|
|
151
|
-
`;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by gen-snapshot-tests.js
|
|
2
|
-
// Do not edit this file. To make changes to these snapshot tests:
|
|
3
|
-
// 1. edit the markdown documentation files in the package,
|
|
4
|
-
// packages/wonder-blocks-breadcrumbs
|
|
5
|
-
// 2. Run `yarn run gen-snapshot-tests`.
|
|
6
|
-
import React from "react";
|
|
7
|
-
import renderer from "react-test-renderer";
|
|
8
|
-
|
|
9
|
-
// Mock react-dom as jest doesn't like findDOMNode.
|
|
10
|
-
jest.mock("react-dom");
|
|
11
|
-
import Link from "@khanacademy/wonder-blocks-link";
|
|
12
|
-
import {
|
|
13
|
-
Breadcrumbs,
|
|
14
|
-
BreadcrumbsItem,
|
|
15
|
-
} from "@khanacademy/wonder-blocks-breadcrumbs";
|
|
16
|
-
|
|
17
|
-
describe("wonder-blocks-breadcrumbs", () => {
|
|
18
|
-
it("example 1", () => {
|
|
19
|
-
const example = (
|
|
20
|
-
<Breadcrumbs>
|
|
21
|
-
<BreadcrumbsItem>
|
|
22
|
-
<Link href="https://khanacademy.org/">Home</Link>
|
|
23
|
-
</BreadcrumbsItem>
|
|
24
|
-
<BreadcrumbsItem>
|
|
25
|
-
<Link href="https://khanacademy.org/about">About</Link>
|
|
26
|
-
</BreadcrumbsItem>
|
|
27
|
-
<BreadcrumbsItem>Current page</BreadcrumbsItem>
|
|
28
|
-
</Breadcrumbs>
|
|
29
|
-
);
|
|
30
|
-
const tree = renderer.create(example).toJSON();
|
|
31
|
-
expect(tree).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
});
|