@khanacademy/wonder-blocks-banner 1.2.5 → 1.2.7
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 +30 -0
- package/dist/es/index.js +2 -7
- package/dist/index.js +2 -7
- package/dist/index.js.flow +1 -1
- package/package.json +9 -9
- package/src/components/__docs__/banner.stories.js +2 -2
- package/src/components/__tests__/banner.test.js +1 -1
- package/src/components/banner.js +5 -16
- package/src/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-banner
|
|
2
2
|
|
|
3
|
+
## 1.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 91cb727c: Remove file extensions from imports
|
|
8
|
+
- 91cb727c: Replace .defaultProps on functional component with corresponding defaults when destructuring props
|
|
9
|
+
- Updated dependencies [91cb727c]
|
|
10
|
+
- Updated dependencies [91cb727c]
|
|
11
|
+
- Updated dependencies [91cb727c]
|
|
12
|
+
- Updated dependencies [91cb727c]
|
|
13
|
+
- @khanacademy/wonder-blocks-icon@1.2.37
|
|
14
|
+
- @khanacademy/wonder-blocks-button@3.0.14
|
|
15
|
+
- @khanacademy/wonder-blocks-color@1.2.1
|
|
16
|
+
- @khanacademy/wonder-blocks-core@4.7.0
|
|
17
|
+
- @khanacademy/wonder-blocks-icon-button@3.4.21
|
|
18
|
+
- @khanacademy/wonder-blocks-link@3.9.1
|
|
19
|
+
- @khanacademy/wonder-blocks-typography@1.1.38
|
|
20
|
+
|
|
21
|
+
## 1.2.6
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [1a5624d4]
|
|
26
|
+
- Updated dependencies [48aceaad]
|
|
27
|
+
- Updated dependencies [4fa99654]
|
|
28
|
+
- @khanacademy/wonder-blocks-icon@1.2.36
|
|
29
|
+
- @khanacademy/wonder-blocks-link@3.9.0
|
|
30
|
+
- @khanacademy/wonder-blocks-button@3.0.13
|
|
31
|
+
- @khanacademy/wonder-blocks-icon-button@3.4.20
|
|
32
|
+
|
|
3
33
|
## 1.2.5
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -63,9 +63,9 @@ const Banner = props => {
|
|
|
63
63
|
const {
|
|
64
64
|
actions,
|
|
65
65
|
"aria-label": ariaLabel,
|
|
66
|
-
dismissAriaLabel,
|
|
66
|
+
dismissAriaLabel = "Dismiss banner.",
|
|
67
67
|
onDismiss,
|
|
68
|
-
kind,
|
|
68
|
+
kind = "info",
|
|
69
69
|
layout,
|
|
70
70
|
text,
|
|
71
71
|
testId
|
|
@@ -148,11 +148,6 @@ const Banner = props => {
|
|
|
148
148
|
})) : null));
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
const defaultProps = {
|
|
152
|
-
kind: "info",
|
|
153
|
-
dismissAriaLabel: "Dismiss banner."
|
|
154
|
-
};
|
|
155
|
-
Banner.defaultProps = defaultProps;
|
|
156
151
|
const styles = StyleSheet.create({
|
|
157
152
|
backgroundColor: {
|
|
158
153
|
position: "absolute",
|
package/dist/index.js
CHANGED
|
@@ -93,9 +93,9 @@ const Banner = props => {
|
|
|
93
93
|
const {
|
|
94
94
|
actions,
|
|
95
95
|
"aria-label": ariaLabel,
|
|
96
|
-
dismissAriaLabel,
|
|
96
|
+
dismissAriaLabel = "Dismiss banner.",
|
|
97
97
|
onDismiss,
|
|
98
|
-
kind,
|
|
98
|
+
kind = "info",
|
|
99
99
|
layout,
|
|
100
100
|
text,
|
|
101
101
|
testId
|
|
@@ -178,11 +178,6 @@ const Banner = props => {
|
|
|
178
178
|
})) : null));
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
const defaultProps = {
|
|
182
|
-
kind: "info",
|
|
183
|
-
dismissAriaLabel: "Dismiss banner."
|
|
184
|
-
};
|
|
185
|
-
Banner.defaultProps = defaultProps;
|
|
186
181
|
const styles = aphrodite.StyleSheet.create({
|
|
187
182
|
backgroundColor: {
|
|
188
183
|
position: "absolute",
|
package/dist/index.js.flow
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
export * from "../src/index
|
|
2
|
+
export * from "../src/index";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-banner",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Banner components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-button": "^3.0.
|
|
20
|
-
"@khanacademy/wonder-blocks-color": "^1.2.
|
|
21
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
22
|
-
"@khanacademy/wonder-blocks-icon": "^1.2.
|
|
23
|
-
"@khanacademy/wonder-blocks-icon-button": "^3.4.
|
|
24
|
-
"@khanacademy/wonder-blocks-link": "^3.
|
|
19
|
+
"@khanacademy/wonder-blocks-button": "^3.0.14",
|
|
20
|
+
"@khanacademy/wonder-blocks-color": "^1.2.1",
|
|
21
|
+
"@khanacademy/wonder-blocks-core": "^4.7.0",
|
|
22
|
+
"@khanacademy/wonder-blocks-icon": "^1.2.37",
|
|
23
|
+
"@khanacademy/wonder-blocks-icon-button": "^3.4.21",
|
|
24
|
+
"@khanacademy/wonder-blocks-link": "^3.9.1",
|
|
25
25
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5",
|
|
26
|
-
"@khanacademy/wonder-blocks-typography": "^1.1.
|
|
26
|
+
"@khanacademy/wonder-blocks-typography": "^1.1.38"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"aphrodite": "^1.2.5",
|
|
30
30
|
"react": "16.14.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"wb-dev-build-settings": "^0.7.
|
|
33
|
+
"wb-dev-build-settings": "^0.7.1"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -13,8 +13,8 @@ import {LabelSmall} from "@khanacademy/wonder-blocks-typography";
|
|
|
13
13
|
|
|
14
14
|
import type {StoryComponentType} from "@storybook/react";
|
|
15
15
|
|
|
16
|
-
import BannerArgTypes from "./banner.argtypes
|
|
17
|
-
import ComponentInfo from "../../../../../.storybook/components/component-info
|
|
16
|
+
import BannerArgTypes from "./banner.argtypes";
|
|
17
|
+
import ComponentInfo from "../../../../../.storybook/components/component-info";
|
|
18
18
|
import {name, version} from "../../../package.json";
|
|
19
19
|
|
|
20
20
|
const bannerDescription = `
|
|
@@ -4,7 +4,7 @@ import {render, screen} from "@testing-library/react";
|
|
|
4
4
|
|
|
5
5
|
import Button from "@khanacademy/wonder-blocks-button";
|
|
6
6
|
|
|
7
|
-
import Banner from "../banner
|
|
7
|
+
import Banner from "../banner";
|
|
8
8
|
|
|
9
9
|
describe("Banner", () => {
|
|
10
10
|
test("having no `onDismiss` prop causes the 'X' button NOT to appear", () => {
|
package/src/components/banner.js
CHANGED
|
@@ -11,7 +11,7 @@ import Link from "@khanacademy/wonder-blocks-link";
|
|
|
11
11
|
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
12
12
|
import {LabelSmall} from "@khanacademy/wonder-blocks-typography";
|
|
13
13
|
|
|
14
|
-
import * as bannerIcons from "./banner-icons
|
|
14
|
+
import * as bannerIcons from "./banner-icons";
|
|
15
15
|
|
|
16
16
|
type ActionTriggerBase = {|
|
|
17
17
|
title: string,
|
|
@@ -85,7 +85,7 @@ type Props = {|
|
|
|
85
85
|
/**
|
|
86
86
|
* Determines the color and icon of the banner.
|
|
87
87
|
*/
|
|
88
|
-
kind
|
|
88
|
+
kind?: BannerKind,
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Determines the edge style of the Banner.
|
|
@@ -113,7 +113,7 @@ type Props = {|
|
|
|
113
113
|
* The accessible label for the dismiss button.
|
|
114
114
|
* Please pass in a translated string.
|
|
115
115
|
*/
|
|
116
|
-
dismissAriaLabel
|
|
116
|
+
dismissAriaLabel?: string,
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Test ID used for e2e testing.
|
|
@@ -180,9 +180,9 @@ const Banner = (props: Props): React.Node => {
|
|
|
180
180
|
// is missing in props validation when it's not.
|
|
181
181
|
// eslint-disable-next-line react/prop-types
|
|
182
182
|
"aria-label": ariaLabel,
|
|
183
|
-
dismissAriaLabel,
|
|
183
|
+
dismissAriaLabel = "Dismiss banner.", // default prop
|
|
184
184
|
onDismiss,
|
|
185
|
-
kind,
|
|
185
|
+
kind = "info", // default prop
|
|
186
186
|
layout,
|
|
187
187
|
text,
|
|
188
188
|
testId,
|
|
@@ -283,17 +283,6 @@ const Banner = (props: Props): React.Node => {
|
|
|
283
283
|
);
|
|
284
284
|
};
|
|
285
285
|
|
|
286
|
-
type DefaultProps = {|
|
|
287
|
-
kind: Props["kind"],
|
|
288
|
-
dismissAriaLabel: Props["dismissAriaLabel"],
|
|
289
|
-
|};
|
|
290
|
-
|
|
291
|
-
const defaultProps: DefaultProps = {
|
|
292
|
-
kind: "info",
|
|
293
|
-
dismissAriaLabel: "Dismiss banner.",
|
|
294
|
-
};
|
|
295
|
-
Banner.defaultProps = defaultProps;
|
|
296
|
-
|
|
297
286
|
const styles = StyleSheet.create({
|
|
298
287
|
backgroundColor: {
|
|
299
288
|
position: "absolute",
|
package/src/index.js
CHANGED