@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.
@@ -0,0 +1,4 @@
1
+ import BpkBlockquote from './src/BpkBlockquote';
2
+ import themeAttributes from './src/themeAttributes';
3
+ export default BpkBlockquote;
4
+ export { themeAttributes };
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export type Props = {
3
+ children: ReactNode;
4
+ extraSpace?: boolean;
5
+ };
6
+ declare const BpkBlockquote: ({ children, extraSpace }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default BpkBlockquote;
@@ -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 = props => {
23
+ const BpkBlockquote = ({
24
+ children,
25
+ extraSpace = false
26
+ }) => {
25
27
  const classNames = [getClassName('bpk-blockquote')];
26
- if (props.extraSpace) {
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: props.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;
@@ -0,0 +1,2 @@
1
+ declare const themeAttributes: readonly ["blockquoteBarColor"];
2
+ export default themeAttributes;
@@ -16,4 +16,5 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- export default ['blockquoteBarColor'];
19
+ const themeAttributes = ['blockquoteBarColor'];
20
+ export default themeAttributes;
@@ -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 = props => {
23
- const {
24
- className,
25
- href,
26
- label,
27
- ...rest
28
- } = props;
29
- return (
30
- /*#__PURE__*/
31
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
32
- _jsx("a", {
33
- href: href,
34
- className: getClassName('bpk-skip-link', className),
35
- ...rest,
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 = props => {
53
- const {
54
- children,
55
- component: WrapperComponent,
56
- style: userStyle,
57
- theme,
58
- themeAttributes,
59
- ...rest
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "38.12.0",
3
+ "version": "38.13.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",