@skyscanner/backpack-web 38.12.0 → 38.13.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/bpk-component-blockquote/index.d.ts +4 -0
- package/bpk-component-blockquote/src/BpkBlockquote.d.ts +7 -0
- package/bpk-component-blockquote/src/BpkBlockquote.js +6 -11
- package/bpk-component-blockquote/src/themeAttributes.d.ts +2 -0
- package/bpk-component-blockquote/src/themeAttributes.js +2 -1
- package/bpk-component-fieldset/src/BpkFieldset.js +11 -0
- package/bpk-component-skip-link/src/BpkSkipLink.js +14 -21
- package/bpk-theming/src/BpkThemeProvider.js +8 -14
- package/package.json +1 -1
|
@@ -16,26 +16,21 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import PropTypes from 'prop-types';
|
|
20
19
|
import { cssModules } from "../../bpk-react-utils";
|
|
21
20
|
import STYLES from "./BpkBlockquote.module.css";
|
|
22
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
22
|
const getClassName = cssModules(STYLES);
|
|
24
|
-
const BpkBlockquote =
|
|
23
|
+
const BpkBlockquote = ({
|
|
24
|
+
children,
|
|
25
|
+
extraSpace = false
|
|
26
|
+
}) => {
|
|
25
27
|
const classNames = [getClassName('bpk-blockquote')];
|
|
26
|
-
if (
|
|
28
|
+
if (extraSpace) {
|
|
27
29
|
classNames.push(getClassName('bpk-blockquote--extra-spacing'));
|
|
28
30
|
}
|
|
29
31
|
return /*#__PURE__*/_jsx("blockquote", {
|
|
30
32
|
className: classNames.join(' '),
|
|
31
|
-
children:
|
|
33
|
+
children: children
|
|
32
34
|
});
|
|
33
35
|
};
|
|
34
|
-
BpkBlockquote.propTypes = {
|
|
35
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
36
|
-
extraSpace: PropTypes.bool
|
|
37
|
-
};
|
|
38
|
-
BpkBlockquote.defaultProps = {
|
|
39
|
-
extraSpace: false
|
|
40
|
-
};
|
|
41
36
|
export default BpkBlockquote;
|
|
@@ -132,6 +132,17 @@ export const propTypes = {
|
|
|
132
132
|
validationProps: PropTypes.object,
|
|
133
133
|
description: PropTypes.string
|
|
134
134
|
};
|
|
135
|
+
export const defaultProps = {
|
|
136
|
+
label: null,
|
|
137
|
+
disabled: false,
|
|
138
|
+
valid: null,
|
|
139
|
+
required: false,
|
|
140
|
+
className: null,
|
|
141
|
+
validationMessage: null,
|
|
142
|
+
isCheckbox: false,
|
|
143
|
+
validationProps: {},
|
|
144
|
+
description: null
|
|
145
|
+
};
|
|
135
146
|
BpkFieldset.propTypes = {
|
|
136
147
|
...propTypes
|
|
137
148
|
};
|
|
@@ -19,30 +19,23 @@ import { cssModules } from "../../bpk-react-utils";
|
|
|
19
19
|
import STYLES from "./BpkSkipLink.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
const getClassName = cssModules(STYLES);
|
|
22
|
-
const BpkSkipLink =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children: label
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
};
|
|
22
|
+
const BpkSkipLink = ({
|
|
23
|
+
className = null,
|
|
24
|
+
href,
|
|
25
|
+
label,
|
|
26
|
+
...rest
|
|
27
|
+
}) =>
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
30
|
+
_jsx("a", {
|
|
31
|
+
href: href,
|
|
32
|
+
className: getClassName('bpk-skip-link', className),
|
|
33
|
+
...rest,
|
|
34
|
+
children: label
|
|
35
|
+
});
|
|
40
36
|
BpkSkipLink.propTypes = {
|
|
41
37
|
label: PropTypes.string.isRequired,
|
|
42
38
|
href: PropTypes.string.isRequired,
|
|
43
39
|
className: PropTypes.string
|
|
44
40
|
};
|
|
45
|
-
BpkSkipLink.defaultProps = {
|
|
46
|
-
className: null
|
|
47
|
-
};
|
|
48
41
|
export default BpkSkipLink;
|
|
@@ -49,15 +49,14 @@ const createStyle = (theme, themeAttributes) => {
|
|
|
49
49
|
}
|
|
50
50
|
return style;
|
|
51
51
|
};
|
|
52
|
-
const BpkThemeProvider =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} = props;
|
|
52
|
+
const BpkThemeProvider = ({
|
|
53
|
+
children,
|
|
54
|
+
component: WrapperComponent = 'div',
|
|
55
|
+
style: userStyle = null,
|
|
56
|
+
theme = null,
|
|
57
|
+
themeAttributes,
|
|
58
|
+
...rest
|
|
59
|
+
}) => {
|
|
61
60
|
const dedupedThemeAttributes = uniq(themeAttributes);
|
|
62
61
|
const style = createStyle(theme, dedupedThemeAttributes);
|
|
63
62
|
return /*#__PURE__*/_jsx(WrapperComponent, {
|
|
@@ -119,9 +118,4 @@ BpkThemeProvider.propTypes = {
|
|
|
119
118
|
component: PropTypes.elementType,
|
|
120
119
|
style: PropTypes.object // eslint-disable-line react/forbid-prop-types
|
|
121
120
|
};
|
|
122
|
-
BpkThemeProvider.defaultProps = {
|
|
123
|
-
theme: null,
|
|
124
|
-
component: 'div',
|
|
125
|
-
style: null
|
|
126
|
-
};
|
|
127
121
|
export default BpkThemeProvider;
|