@khanacademy/wonder-blocks-breadcrumbs 3.2.28 → 3.3.0
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 +20 -0
- package/dist/components/breadcrumbs.d.ts +2 -1
- package/dist/es/index.js +2 -1
- package/dist/index.js +2 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-breadcrumbs
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f7eef63: Breadcrumbs' default `aria-label` and the TabsDropdown and NavigationTabsDropdown default opener label now read translated strings from `WonderBlocksConfigProvider`. The `aria-label` and `labels.defaultOpenerLabel` props override the built-in translations.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [f7eef63]
|
|
12
|
+
- @khanacademy/wonder-blocks-config@0.3.0
|
|
13
|
+
|
|
14
|
+
## 3.2.29
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [04522d4]
|
|
19
|
+
- Updated dependencies [5b4fed3]
|
|
20
|
+
- @khanacademy/wonder-blocks-tokens@18.0.0
|
|
21
|
+
- @khanacademy/wonder-blocks-core@12.5.0
|
|
22
|
+
|
|
3
23
|
## 3.2.28
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -45,7 +45,8 @@ declare const Breadcrumbs: React.ForwardRefExoticComponent<Readonly<import("@kha
|
|
|
45
45
|
*/
|
|
46
46
|
children: Array<React.ReactElement<React.ComponentProps<typeof BreadcrumbsItem>>> | React.ReactElement<React.ComponentProps<typeof BreadcrumbsItem>>;
|
|
47
47
|
/**
|
|
48
|
-
* Accessible label for the breadcrumbs.
|
|
48
|
+
* Accessible label for the breadcrumbs. This overrides the default label
|
|
49
|
+
* provided by `WonderBlocksConfigProvider`.
|
|
49
50
|
*/
|
|
50
51
|
"aria-label"?: string;
|
|
51
52
|
/**
|
package/dist/es/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { StyleSheet } from 'aphrodite';
|
|
4
|
+
import { useWonderBlocksI18n } from '@khanacademy/wonder-blocks-config';
|
|
4
5
|
import { addStyle } from '@khanacademy/wonder-blocks-core';
|
|
5
6
|
import { sizing, font, semanticColor } from '@khanacademy/wonder-blocks-tokens';
|
|
6
7
|
|
|
7
|
-
const StyledOl=addStyle("ol");const Breadcrumbs=React.forwardRef(function Breadcrumbs(props,ref){const{"aria-label":ariaLabel
|
|
8
|
+
const StyledOl=addStyle("ol");const Breadcrumbs=React.forwardRef(function Breadcrumbs(props,ref){const{strings}=useWonderBlocksI18n();const{"aria-label":ariaLabel,children,testId,...otherProps}=props;const lastChildIndex=React.Children.count(children)-1;return jsx("nav",{...otherProps,"aria-label":ariaLabel||strings.breadcrumbs,"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"}});
|
|
8
9
|
|
|
9
10
|
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",marginInlineEnd:sizing.size_040,lineHeight:"inherit",fontFamily:font.family.sans},separator:{marginInlineStart:sizing.size_040,fill:semanticColor.core.foreground.neutral.default}});
|
|
10
11
|
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var aphrodite = require('aphrodite');
|
|
8
|
+
var wonderBlocksConfig = require('@khanacademy/wonder-blocks-config');
|
|
8
9
|
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
9
10
|
var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
|
|
10
11
|
|
|
@@ -28,7 +29,7 @@ function _interopNamespace(e) {
|
|
|
28
29
|
|
|
29
30
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
31
|
|
|
31
|
-
const StyledOl=wonderBlocksCore.addStyle("ol");const Breadcrumbs=React__namespace.forwardRef(function Breadcrumbs(props,ref){const{"aria-label":ariaLabel
|
|
32
|
+
const StyledOl=wonderBlocksCore.addStyle("ol");const Breadcrumbs=React__namespace.forwardRef(function Breadcrumbs(props,ref){const{strings}=wonderBlocksConfig.useWonderBlocksI18n();const{"aria-label":ariaLabel,children,testId,...otherProps}=props;const lastChildIndex=React__namespace.Children.count(children)-1;return jsxRuntime.jsx("nav",{...otherProps,"aria-label":ariaLabel||strings.breadcrumbs,"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"}});
|
|
32
33
|
|
|
33
34
|
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",marginInlineEnd:wonderBlocksTokens.sizing.size_040,lineHeight:"inherit",fontFamily:wonderBlocksTokens.font.family.sans},separator:{marginInlineStart:wonderBlocksTokens.sizing.size_040,fill:wonderBlocksTokens.semanticColor.core.foreground.neutral.default}});
|
|
34
35
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.3.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
"module": "dist/es/index.js",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@khanacademy/wonder-blocks-
|
|
24
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
23
|
+
"@khanacademy/wonder-blocks-config": "0.3.0",
|
|
24
|
+
"@khanacademy/wonder-blocks-tokens": "18.0.0",
|
|
25
|
+
"@khanacademy/wonder-blocks-core": "12.5.0"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
28
|
"aphrodite": "^1.2.5",
|