@khanacademy/wonder-blocks-banner 1.0.1 → 1.1.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 +11 -0
- package/dist/es/index.js +9 -6
- package/dist/index.js +292 -5740
- package/package.json +2 -1
- package/src/components/__docs__/banner.argtypes.js +9 -0
- package/src/components/__docs__/banner.stories.js +1 -0
- package/src/components/__tests__/banner.test.js +51 -20
- package/src/components/banner.js +26 -8
package/CHANGELOG.md
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import Button from '@khanacademy/wonder-blocks-button';
|
|
|
4
4
|
import Color from '@khanacademy/wonder-blocks-color';
|
|
5
5
|
import { View } from '@khanacademy/wonder-blocks-core';
|
|
6
6
|
import Icon, { icons } from '@khanacademy/wonder-blocks-icon';
|
|
7
|
-
import Link from '@khanacademy/wonder-blocks-link';
|
|
8
7
|
import IconButton from '@khanacademy/wonder-blocks-icon-button';
|
|
8
|
+
import Link from '@khanacademy/wonder-blocks-link';
|
|
9
9
|
import Spacing from '@khanacademy/wonder-blocks-spacing';
|
|
10
10
|
import { LabelSmall } from '@khanacademy/wonder-blocks-typography';
|
|
11
11
|
|
|
@@ -62,6 +62,7 @@ const valuesForKind = kind => {
|
|
|
62
62
|
const Banner = props => {
|
|
63
63
|
const {
|
|
64
64
|
actions,
|
|
65
|
+
"aria-label": ariaLabel,
|
|
65
66
|
dismissAriaLabel,
|
|
66
67
|
onDismiss,
|
|
67
68
|
kind,
|
|
@@ -69,9 +70,6 @@ const Banner = props => {
|
|
|
69
70
|
text,
|
|
70
71
|
testId
|
|
71
72
|
} = props;
|
|
72
|
-
const layoutStyle = {
|
|
73
|
-
borderRadius: layout && layout === "full-width" ? 0 : 4
|
|
74
|
-
};
|
|
75
73
|
|
|
76
74
|
const renderActions = () => {
|
|
77
75
|
return actions == null ? void 0 : actions.filter(Boolean).map(action => {
|
|
@@ -107,14 +105,15 @@ const Banner = props => {
|
|
|
107
105
|
};
|
|
108
106
|
|
|
109
107
|
return React.createElement(View, {
|
|
110
|
-
style: [styles.containerOuter,
|
|
108
|
+
style: [styles.containerOuter, layout === "floating" && styles.floatingBorder, {
|
|
111
109
|
borderInlineStartColor: valuesForKind(kind).color
|
|
112
110
|
}],
|
|
113
111
|
role: valuesForKind(kind).role,
|
|
112
|
+
"aria-label": ariaLabel,
|
|
114
113
|
"aria-live": valuesForKind(kind).ariaLive,
|
|
115
114
|
testId: testId
|
|
116
115
|
}, React.createElement(View, {
|
|
117
|
-
style: [styles.backgroundColor,
|
|
116
|
+
style: [styles.backgroundColor, {
|
|
118
117
|
backgroundColor: valuesForKind(kind).color
|
|
119
118
|
}]
|
|
120
119
|
}), React.createElement(View, {
|
|
@@ -211,6 +210,10 @@ const styles = StyleSheet.create({
|
|
|
211
210
|
alignItems: "center",
|
|
212
211
|
marginLeft: Spacing.xSmall_8,
|
|
213
212
|
marginRight: Spacing.xSmall_8
|
|
213
|
+
},
|
|
214
|
+
floatingBorder: {
|
|
215
|
+
borderRadius: 4,
|
|
216
|
+
overflow: "hidden"
|
|
214
217
|
}
|
|
215
218
|
});
|
|
216
219
|
|