@skyscanner/backpack-web 40.3.0 → 41.0.1

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.
Files changed (38) hide show
  1. package/bpk-component-button/index.d.ts +3 -12
  2. package/bpk-component-button/index.js +3 -12
  3. package/bpk-component-button/src/BpkButtonV2/BpkButton.d.ts +1 -1
  4. package/bpk-component-button/src/BpkButtonV2/BpkButton.js +12 -3
  5. package/bpk-component-button/src/BpkButtonV2/BpkButton.module.css +1 -1
  6. package/bpk-component-button/src/BpkButtonV2/common-types.d.ts +1 -0
  7. package/bpk-component-card-list/src/BpkExpand/ExpandAccessoryContent.js +1 -0
  8. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +1 -0
  9. package/bpk-component-pagination/src/BpkPaginationNudger.js +1 -0
  10. package/bpk-mixins/_buttons.scss +40 -2
  11. package/package.json +1 -1
  12. package/bpk-component-button/BpkButtonDestructive.d.ts +0 -8
  13. package/bpk-component-button/BpkButtonDestructive.js +0 -31
  14. package/bpk-component-button/BpkButtonFeatured.d.ts +0 -8
  15. package/bpk-component-button/BpkButtonFeatured.js +0 -31
  16. package/bpk-component-button/BpkButtonLink.d.ts +0 -8
  17. package/bpk-component-button/BpkButtonLink.js +0 -31
  18. package/bpk-component-button/BpkButtonLinkOnDark.d.ts +0 -8
  19. package/bpk-component-button/BpkButtonLinkOnDark.js +0 -30
  20. package/bpk-component-button/BpkButtonPrimary.d.ts +0 -8
  21. package/bpk-component-button/BpkButtonPrimary.js +0 -30
  22. package/bpk-component-button/BpkButtonPrimaryOnDark.d.ts +0 -8
  23. package/bpk-component-button/BpkButtonPrimaryOnDark.js +0 -31
  24. package/bpk-component-button/BpkButtonPrimaryOnLight.d.ts +0 -8
  25. package/bpk-component-button/BpkButtonPrimaryOnLight.js +0 -31
  26. package/bpk-component-button/BpkButtonSecondary.d.ts +0 -8
  27. package/bpk-component-button/BpkButtonSecondary.js +0 -31
  28. package/bpk-component-button/BpkButtonSecondaryOnDark.d.ts +0 -8
  29. package/bpk-component-button/BpkButtonSecondaryOnDark.js +0 -31
  30. package/bpk-component-button/src/BpkButton.d.ts +0 -41
  31. package/bpk-component-button/src/BpkButton.js +0 -101
  32. package/bpk-component-button/src/BpkButtonBase.d.ts +0 -31
  33. package/bpk-component-button/src/BpkButtonBase.js +0 -116
  34. package/bpk-component-button/src/BpkButtonBase.module.css +0 -18
  35. package/bpk-component-button/src/common-types.d.ts +0 -26
  36. package/bpk-component-button/src/common-types.js +0 -31
  37. package/bpk-component-button/themeAttributes.d.ts +0 -1
  38. package/bpk-component-button/themeAttributes.js +0 -19
@@ -1,15 +1,6 @@
1
- import BpkButtonDestructive from './BpkButtonDestructive';
2
- import BpkButtonFeatured from './BpkButtonFeatured';
3
- import BpkButtonLink from './BpkButtonLink';
4
- import BpkButtonLinkOnDark from './BpkButtonLinkOnDark';
5
- import BpkButtonPrimary from './BpkButtonPrimary';
6
- import BpkButtonPrimaryOnDark from './BpkButtonPrimaryOnDark';
7
- import BpkButtonPrimaryOnLight from './BpkButtonPrimaryOnLight';
8
- import BpkButtonSecondary from './BpkButtonSecondary';
9
- import BpkButtonSecondaryOnDark from './BpkButtonSecondaryOnDark';
10
- import BpkButton from './src/BpkButton';
11
1
  import { BpkButtonV2 } from './src/BpkButtonV2/BpkButton';
12
2
  export { BUTTON_TYPES, SIZE_TYPES, type ButtonType, type SizeType, type Props, } from './src/BpkButtonV2/common-types';
13
- export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes, } from './themeAttributes';
3
+ export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes, } from './src/themeAttributes';
4
+ declare const BpkButton: ({ blank, children, className, disabled, fullWidth, href, iconOnly, implicit, onClick, rel: propRel, size, submit, type, ...rest }: import("./src/BpkButtonV2/common-types").Props) => import("react/jsx-runtime").JSX.Element;
14
5
  export default BpkButton;
15
- export { BpkButtonPrimary, BpkButtonPrimaryOnDark, BpkButtonPrimaryOnLight, BpkButtonSecondary, BpkButtonSecondaryOnDark, BpkButtonDestructive, BpkButtonLink, BpkButtonLinkOnDark, BpkButtonFeatured, BpkButtonV2, };
6
+ export { BpkButtonV2 };
@@ -16,18 +16,9 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import BpkButtonDestructive from "./BpkButtonDestructive";
20
- import BpkButtonFeatured from "./BpkButtonFeatured";
21
- import BpkButtonLink from "./BpkButtonLink";
22
- import BpkButtonLinkOnDark from "./BpkButtonLinkOnDark";
23
- import BpkButtonPrimary from "./BpkButtonPrimary";
24
- import BpkButtonPrimaryOnDark from "./BpkButtonPrimaryOnDark";
25
- import BpkButtonPrimaryOnLight from "./BpkButtonPrimaryOnLight";
26
- import BpkButtonSecondary from "./BpkButtonSecondary";
27
- import BpkButtonSecondaryOnDark from "./BpkButtonSecondaryOnDark";
28
- import BpkButton from "./src/BpkButton";
29
19
  import { BpkButtonV2 } from "./src/BpkButtonV2/BpkButton";
30
20
  export { BUTTON_TYPES, SIZE_TYPES } from "./src/BpkButtonV2/common-types";
31
- export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes } from "./themeAttributes";
21
+ export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes } from "./src/themeAttributes";
22
+ const BpkButton = BpkButtonV2;
32
23
  export default BpkButton;
33
- export { BpkButtonPrimary, BpkButtonPrimaryOnDark, BpkButtonPrimaryOnLight, BpkButtonSecondary, BpkButtonSecondaryOnDark, BpkButtonDestructive, BpkButtonLink, BpkButtonLinkOnDark, BpkButtonFeatured, BpkButtonV2 };
24
+ export { BpkButtonV2 };
@@ -1,2 +1,2 @@
1
1
  import type { Props } from './common-types';
2
- export declare const BpkButtonV2: ({ blank, children, className, disabled, fullWidth, href, iconOnly, onClick, rel: propRel, size, submit, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const BpkButtonV2: ({ blank, children, className, disabled, fullWidth, href, iconOnly, implicit, onClick, rel: propRel, size, submit, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
@@ -30,6 +30,7 @@ export const BpkButtonV2 = ({
30
30
  fullWidth = false,
31
31
  href = null,
32
32
  iconOnly = false,
33
+ implicit = false,
33
34
  onClick = () => {},
34
35
  rel: propRel = undefined,
35
36
  size = SIZE_TYPES.small,
@@ -37,7 +38,15 @@ export const BpkButtonV2 = ({
37
38
  type = BUTTON_TYPES.primary,
38
39
  ...rest
39
40
  }) => {
40
- const classNames = getCommonClassName('bpk-button', size === SIZE_TYPES.large && 'bpk-button--large', iconOnly && 'bpk-button--icon-only', iconOnly && size === SIZE_TYPES.large && 'bpk-button--large-icon-only', `bpk-button--${type}`, fullWidth && 'bpk-button--full-width', className);
41
+ const isLinkType = type === BUTTON_TYPES.link || type === BUTTON_TYPES.linkOnDark;
42
+ const alternate = type === BUTTON_TYPES.linkOnDark;
43
+ const shouldUnderline = isLinkType && !iconOnly && !disabled;
44
+ const classNames = getCommonClassName('bpk-button', size === SIZE_TYPES.large && 'bpk-button--large', iconOnly && 'bpk-button--icon-only', iconOnly && size === SIZE_TYPES.large && 'bpk-button--large-icon-only', `bpk-button--${type}`, fullWidth && 'bpk-button--full-width', isLinkType && iconOnly && 'bpk-button--link--icon-only', isLinkType && implicit && 'bpk-button--link--implicit', className);
45
+ const underlinedClassName = shouldUnderline ? getCommonClassName('bpk-button--link-underlined', implicit && !alternate && 'bpk-button--link-underlined--implicit', alternate && !implicit && 'bpk-button--link-underlined--alternate', implicit && alternate && 'bpk-button--link-underlined--implicit--alternate') : null;
46
+ const content = underlinedClassName ? /*#__PURE__*/_jsx("span", {
47
+ className: underlinedClassName,
48
+ children: children
49
+ }) : children;
41
50
  const target = blank ? '_blank' : '';
42
51
  const rel = blank ? propRel || 'noopener noreferrer' : propRel;
43
52
  if (!disabled && href) {
@@ -48,7 +57,7 @@ export const BpkButtonV2 = ({
48
57
  target: target,
49
58
  rel: rel,
50
59
  ...rest,
51
- children: children
60
+ children: content
52
61
  });
53
62
  }
54
63
  return /*#__PURE__*/_jsx("button", {
@@ -57,6 +66,6 @@ export const BpkButtonV2 = ({
57
66
  className: classNames,
58
67
  onClick: onClick,
59
68
  ...rest,
60
- children: children
69
+ children: content
61
70
  });
62
71
  };
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-button{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;border-radius:.5rem;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}.bpk-button:active{color:#fff;color:var(--bpk-button-primary-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, rgb(21, 70, 121))}.bpk-button:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-button--large{min-height:3rem;padding:.75rem 1rem}.bpk-button--icon-only{border-radius:.5rem;padding-right:.625rem;padding-left:.625rem;border-radius:.5rem}.bpk-button--large-icon-only{border-radius:.5rem;padding-right:.75rem;padding-left:.75rem;border-radius:.5rem}.bpk-button--destructive{color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233));color:#e70866;color:var(--bpk-button-destructive-text-color, rgb(231, 8, 102));background-color:#e0e4e9;background-color:var(--bpk-button-destructive-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--destructive:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}.bpk-button--destructive:active{color:#fff;color:var(--bpk-button-destructive-active-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-active-background-color, rgb(231, 8, 102))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--featured{color:#fff;color:var(--bpk-button-featured-text-color, rgb(255, 255, 255));background-color:#0062e3;background-color:var(--bpk-button-featured-background-color, rgb(0, 98, 227))}.bpk-no-touch-support .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}:global(.bpk-no-touch-support) .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}.bpk-button--featured:active{color:#fff;color:var(--bpk-button-featured-active-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-active-background-color, rgb(2, 77, 175))}.bpk-button--featured:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--link{background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link::after{bottom:auto}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link:disabled{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-large{padding:.75rem 0}.bpk-button--link-on-dark{background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3;color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link-on-dark:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link-on-dark::after{bottom:auto}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link-on-dark:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link-on-dark:disabled{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-on-dark-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--link-on-dark:active{color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-active-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--link-on-dark:visited{color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:disabled{color:hsla(0,0%,100%,.2);color:var(--bpk-button-link-on-dark-disabled-color, rgba(255, 255, 255, 0.2))}.bpk-button--primary-on-dark{color:#161616;color:var(--bpk-button-primary-on-dark-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}.bpk-button--primary-on-dark:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-active-background-color, rgb(193, 199, 207))}.bpk-button--primary-on-dark:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--primary-on-light{color:#fff;color:var(--bpk-button-primary-on-light-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-on-light-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}.bpk-button--primary-on-light:active{color:#fff;color:var(--bpk-button-primary-on-light-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-active-background-color, rgb(21, 70, 121))}.bpk-button--primary-on-light:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary{color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--secondary:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--secondary:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary-on-dark{color:#fff;color:var(--bpk-button-secondary-on-dark-text-color, rgb(255, 255, 255));background-color:hsla(0,0%,100%,.1);background-color:var(--bpk-button-secondary-on-dark-background-color, rgba(255, 255, 255, 0.1))}.bpk-no-touch-support .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(1, 9, 19))}:global(.bpk-no-touch-support) .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(1, 9, 19))}.bpk-button--secondary-on-dark:active{color:#fff;color:var(--bpk-button-secondary-on-dark-active-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-active-background-color, rgb(1, 9, 19))}.bpk-button--secondary-on-dark:disabled{background-color:#0b121d;color:hsla(0,0%,100%,.2)}.bpk-button--full-width{display:block;width:100%}.bpk-button span>svg{display:block}.bpk-button svg{fill:currentcolor}
18
+ .bpk-button{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;border-radius:.5rem;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}.bpk-button:active{color:#fff;color:var(--bpk-button-primary-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, rgb(21, 70, 121))}.bpk-button:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-button--large{min-height:3rem;padding:.75rem 1rem}.bpk-button--icon-only{border-radius:.5rem;padding-right:.625rem;padding-left:.625rem;border-radius:.5rem}.bpk-button--large-icon-only{border-radius:.5rem;padding-right:.75rem;padding-left:.75rem;border-radius:.5rem}.bpk-button--destructive{color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233));color:#e70866;color:var(--bpk-button-destructive-text-color, rgb(231, 8, 102));background-color:#e0e4e9;background-color:var(--bpk-button-destructive-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--destructive:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}.bpk-button--destructive:active{color:#fff;color:var(--bpk-button-destructive-active-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-active-background-color, rgb(231, 8, 102))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--featured{color:#fff;color:var(--bpk-button-featured-text-color, rgb(255, 255, 255));background-color:#0062e3;background-color:var(--bpk-button-featured-background-color, rgb(0, 98, 227))}.bpk-no-touch-support .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}:global(.bpk-no-touch-support) .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}.bpk-button--featured:active{color:#fff;color:var(--bpk-button-featured-active-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-active-background-color, rgb(2, 77, 175))}.bpk-button--featured:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--link{background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3;position:relative;display:inline;padding:0;border:0;background-color:rgba(0,0,0,0);text-decoration:none;cursor:pointer;appearance:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));--bpk-button-svg-display: inline-block;--bpk-button-svg-vertical-align: middle}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link::after{bottom:auto}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link:disabled,.bpk-button--link:disabled:active{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:none;color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:none;color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link:visited{color:#161616;color:var(--bpk-link-visited-color, rgb(22, 22, 22))}.bpk-button--link:active{color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link--implicit{color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22))}.bpk-no-touch-support .bpk-button--link--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link--implicit:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link--icon-only{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle}.bpk-button--link-on-dark{background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3;color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255));color:#fff;color:var(--bpk-link-alternate-color, rgb(255, 255, 255));--bpk-button-svg-display: inline-block;--bpk-button-svg-vertical-align: middle}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link-on-dark:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link-on-dark::after{bottom:auto}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link-on-dark:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link-on-dark:disabled,.bpk-button--link-on-dark:disabled:active{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-on-dark-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--link-on-dark:active{color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-active-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--link-on-dark:visited{color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:disabled,.bpk-button--link-on-dark:disabled:active{color:hsla(0,0%,100%,.2);color:var(--bpk-button-link-on-dark-disabled-color, rgba(255, 255, 255, 0.2))}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-link-alternate-hover-color, rgb(255, 255, 255))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-link-alternate-hover-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:visited{color:#fff;color:var(--bpk-link-alternate-visited-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:active{color:#fff;color:var(--bpk-link-alternate-active-color, rgb(255, 255, 255))}.bpk-button--link-on-dark--implicit{color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22))}.bpk-no-touch-support .bpk-button--link-on-dark--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link-on-dark--implicit:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link-underlined{gap:.5rem;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;padding-bottom:.0625rem;transition:background-size 200ms ease;background:linear-gradient(rgb(22, 22, 22), rgb(22, 22, 22));background-repeat:no-repeat;background-position:0 100%;background-size:100% 1px}.bpk-no-touch-support .bpk-button--link-underlined:hover:not(:active):not(:disabled){background-size:0 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined:hover:not(:active):not(:disabled){background-size:0 1px}.bpk-button--link-underlined--implicit{background-size:0 1px}.bpk-no-touch-support .bpk-button--link-underlined--implicit:hover:not(:active):not(:disabled){background-size:100% 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined--implicit:hover:not(:active):not(:disabled){background-size:100% 1px}.bpk-button--link-underlined--alternate{background:linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255));background-repeat:no-repeat;background-position:0 100%;background-size:100% 1px}.bpk-no-touch-support .bpk-button--link-underlined--alternate:hover:not(:active):not(:disabled){background-size:0 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined--alternate:hover:not(:active):not(:disabled){background-size:0 1px}.bpk-button--link-underlined--implicit--alternate{background:linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255));background-repeat:no-repeat;background-position:0 100%;background-size:0 1px}.bpk-no-touch-support .bpk-button--link-underlined--implicit--alternate:hover:not(:active):not(:disabled){background-size:100% 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined--implicit--alternate:hover:not(:active):not(:disabled){background-size:100% 1px}.bpk-button--primary-on-dark{color:#161616;color:var(--bpk-button-primary-on-dark-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}.bpk-button--primary-on-dark:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-active-background-color, rgb(193, 199, 207))}.bpk-button--primary-on-dark:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--primary-on-light{color:#fff;color:var(--bpk-button-primary-on-light-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-on-light-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}.bpk-button--primary-on-light:active{color:#fff;color:var(--bpk-button-primary-on-light-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-active-background-color, rgb(21, 70, 121))}.bpk-button--primary-on-light:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary{color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--secondary:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--secondary:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary-on-dark{color:#fff;color:var(--bpk-button-secondary-on-dark-text-color, rgb(255, 255, 255));background-color:hsla(0,0%,100%,.1);background-color:var(--bpk-button-secondary-on-dark-background-color, rgba(255, 255, 255, 0.1))}.bpk-no-touch-support .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(1, 9, 19))}:global(.bpk-no-touch-support) .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(1, 9, 19))}.bpk-button--secondary-on-dark:active{color:#fff;color:var(--bpk-button-secondary-on-dark-active-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-active-background-color, rgb(1, 9, 19))}.bpk-button--secondary-on-dark:disabled{background-color:#0b121d;color:hsla(0,0%,100%,.2)}.bpk-button--full-width{display:block;width:100%}.bpk-button span>svg{display:var(--bpk-button-svg-display, block);vertical-align:var(--bpk-button-svg-vertical-align, baseline)}.bpk-button svg{fill:currentcolor}
@@ -24,6 +24,7 @@ export type Props = {
24
24
  disabled?: boolean;
25
25
  fullWidth?: boolean;
26
26
  iconOnly?: boolean;
27
+ implicit?: boolean;
27
28
  onClick?: (event: MouseEvent<HTMLButtonElement & HTMLAnchorElement>) => void;
28
29
  rel?: string | undefined;
29
30
  submit?: boolean;
@@ -32,6 +32,7 @@ const ExpandAccessoryContent = ({
32
32
  type: BUTTON_TYPES.link,
33
33
  onClick: onExpandToggle,
34
34
  "aria-expanded": !collapsed,
35
+ implicit: true,
35
36
  children: [children, collapsed ? /*#__PURE__*/_jsx(AlignedChevronDownIcon, {}) : /*#__PURE__*/_jsx(AlignedChevronUpIcon, {})]
36
37
  });
37
38
  export default ExpandAccessoryContent;
@@ -82,6 +82,7 @@ const BpkFloatingNotification = props => {
82
82
  className: getClassName('bpk-floating-notification__cta'),
83
83
  children: /*#__PURE__*/_jsx(BpkButtonV2, {
84
84
  type: BUTTON_TYPES.linkOnDark,
85
+ implicit: true,
85
86
  onClick: onClick,
86
87
  children: ctaText
87
88
  })
@@ -41,6 +41,7 @@ const BpkPaginationNudger = props => {
41
41
  type: BUTTON_TYPES.link,
42
42
  onClick: onNudge,
43
43
  disabled: disabled,
44
+ iconOnly: true,
44
45
  children: [nudgerIcon(forward), /*#__PURE__*/_jsx("span", {
45
46
  className: getClassName('bpk-pagination-nudger__text--hidden'),
46
47
  children: label
@@ -416,7 +416,10 @@
416
416
  text-decoration: none;
417
417
  }
418
418
 
419
- &:disabled {
419
+ // The link button inherits from bpk-link which defines :active styles but has no disabled state,
420
+ // so we need to ensure the disabled appearance is maintained even when clicked.
421
+ &:disabled,
422
+ &:disabled:active {
420
423
  background: none;
421
424
  color: tokens.$bpk-text-disabled-day;
422
425
  text-decoration: none;
@@ -469,7 +472,8 @@
469
472
  );
470
473
  }
471
474
 
472
- &:disabled {
475
+ &:disabled,
476
+ &:disabled:active {
473
477
  @include utils.bpk-themeable-property(
474
478
  color,
475
479
  --bpk-button-link-on-dark-disabled-color,
@@ -478,6 +482,40 @@
478
482
  }
479
483
  }
480
484
 
485
+ /// Button link icon only aligned. Modifies the bpk-button mixin.
486
+ ///
487
+ /// @require {mixin} bpk-button
488
+ ///
489
+ /// @example scss
490
+ /// .selector {
491
+ /// @include bpk-button();
492
+ /// @include bpk-button--link-icon-only;
493
+ /// }
494
+
495
+ @mixin bpk-button--link-icon-only {
496
+ display: inline-flex;
497
+ justify-content: center;
498
+ align-items: center;
499
+ vertical-align: middle;
500
+ }
501
+
502
+ /// Button link underlined. Modifies the bpk-button mixin.
503
+ ///
504
+ /// @require {mixin} bpk-button
505
+ ///
506
+ /// @example scss
507
+ /// .selector {
508
+ /// @include bpk-button();
509
+ /// @include bpk-button--link-underlined;
510
+ /// }
511
+
512
+ @mixin bpk-button--link-underlined {
513
+ gap: tokens.bpk-spacing-md();
514
+
515
+ @include bpk-button--link-icon-only;
516
+ @include typography.bpk-link-underlined;
517
+ }
518
+
481
519
  /// Icon-only button. Modifies the bpk-button mixin.
482
520
  ///
483
521
  /// @require {mixin} bpk-button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "40.3.0",
3
+ "version": "41.0.1",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonDestructive is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.destructive} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Destructive button component
6
- */
7
- declare const BpkButtonDestructive: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonDestructive;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonDestructive is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.destructive} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Destructive button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonDestructive = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- destructive: true
30
- });
31
- export default BpkButtonDestructive;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonFeatured is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.featured} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Featured button component
6
- */
7
- declare const BpkButtonFeatured: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonFeatured;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonFeatured is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.featured} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Featured button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonFeatured = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- featured: true
30
- });
31
- export default BpkButtonFeatured;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonLink is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.link} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Link button component
6
- */
7
- declare const BpkButtonLink: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonLink;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonLink is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.link} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Link button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonLink = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- link: true
30
- });
31
- export default BpkButtonLink;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonLinkOnDark is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.linkOnDark} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Link on dark button component
6
- */
7
- declare const BpkButtonLinkOnDark: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonLinkOnDark;
@@ -1,30 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- import BpkButton from "./src/BpkButton";
19
-
20
- /**
21
- * @deprecated BpkButtonLinkOnDark is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.linkOnDark} instead.
22
- * @param {Props} props - Component props
23
- * @returns {JSX.Element} Link on dark button component
24
- */
25
- import { jsx as _jsx } from "react/jsx-runtime";
26
- const BpkButtonLinkOnDark = props => /*#__PURE__*/_jsx(BpkButton, {
27
- ...props,
28
- linkOnDark: true
29
- });
30
- export default BpkButtonLinkOnDark;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonPrimary is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.primary} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Primary button component
6
- */
7
- declare const BpkButtonPrimary: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonPrimary;
@@ -1,30 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonPrimary is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.primary} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Primary button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonPrimary = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props
29
- });
30
- export default BpkButtonPrimary;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonPrimaryOnDark is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.primaryOnDark} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Primary on dark button component
6
- */
7
- declare const BpkButtonPrimaryOnDark: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonPrimaryOnDark;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonPrimaryOnDark is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.primaryOnDark} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Primary on dark button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonPrimaryOnDark = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- primaryOnDark: true
30
- });
31
- export default BpkButtonPrimaryOnDark;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonPrimaryOnLight is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.primaryOnLight} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Primary on light button component
6
- */
7
- declare const BpkButtonPrimaryOnLight: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonPrimaryOnLight;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonPrimaryOnLight is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.primaryOnLight} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Primary on light button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonPrimaryOnLight = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- primaryOnLight: true
30
- });
31
- export default BpkButtonPrimaryOnLight;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonSecondary is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.secondary} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Secondary button component
6
- */
7
- declare const BpkButtonSecondary: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonSecondary;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonSecondary is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.secondary} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Secondary button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonSecondary = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- secondary: true
30
- });
31
- export default BpkButtonSecondary;
@@ -1,8 +0,0 @@
1
- import { type Props } from './src/BpkButton';
2
- /**
3
- * @deprecated BpkButtonSecondaryOnDark is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.secondaryOnDark} instead.
4
- * @param {Props} props - Component props
5
- * @returns {JSX.Element} Secondary on dark button component
6
- */
7
- declare const BpkButtonSecondaryOnDark: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
- export default BpkButtonSecondaryOnDark;
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import BpkButton from "./src/BpkButton";
20
-
21
- /**
22
- * @deprecated BpkButtonSecondaryOnDark is deprecated and will be removed in a future major version. Please use BpkButtonV2 with type={BUTTON_TYPES.secondaryOnDark} instead.
23
- * @param {Props} props - Component props
24
- * @returns {JSX.Element} Secondary on dark button component
25
- */
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- const BpkButtonSecondaryOnDark = props => /*#__PURE__*/_jsx(BpkButton, {
28
- ...props,
29
- secondaryOnDark: true
30
- });
31
- export default BpkButtonSecondaryOnDark;
@@ -1,41 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import { type Props as CommonProps } from './common-types';
3
- export type Props = CommonProps & {
4
- primaryOnDark?: boolean;
5
- primaryOnLight?: boolean;
6
- secondary?: boolean;
7
- secondaryOnDark?: boolean;
8
- destructive?: boolean;
9
- featured?: boolean;
10
- link?: boolean;
11
- linkOnDark?: boolean;
12
- };
13
- /**
14
- * @deprecated BpkButton is deprecated and will be removed in a future major version. Please use BpkButtonV2 instead.
15
- * @param {Props} props - Component props
16
- * @returns {JSX.Element} Button component
17
- */
18
- declare const BpkButton: {
19
- ({ destructive, featured, link, linkOnDark, primaryOnDark, primaryOnLight, secondary, secondaryOnDark, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
20
- propTypes: {
21
- primaryOnDark: PropTypes.Requireable<boolean>;
22
- primaryOnLight: PropTypes.Requireable<boolean>;
23
- secondary: PropTypes.Requireable<boolean>;
24
- secondaryOnDark: PropTypes.Requireable<boolean>;
25
- destructive: PropTypes.Requireable<boolean>;
26
- featured: PropTypes.Requireable<boolean>;
27
- link: PropTypes.Requireable<boolean>;
28
- linkOnDark: PropTypes.Requireable<boolean>;
29
- children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
30
- href: PropTypes.Requireable<string>;
31
- className: PropTypes.Requireable<string>;
32
- disabled: PropTypes.Requireable<boolean>;
33
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
34
- submit: PropTypes.Requireable<boolean>;
35
- large: PropTypes.Requireable<boolean>;
36
- iconOnly: PropTypes.Requireable<boolean>;
37
- blank: PropTypes.Requireable<boolean>;
38
- rel: PropTypes.Requireable<string>;
39
- };
40
- };
41
- export default BpkButton;
@@ -1,101 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- import PropTypes from 'prop-types';
19
- import BpkButtonBase, { BUTTON_TYPES } from "./BpkButtonBase";
20
- import { propTypes } from "./common-types";
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- /**
23
- * @deprecated BpkButton is deprecated and will be removed in a future major version. Please use BpkButtonV2 instead.
24
- * @param {Props} props - Component props
25
- * @returns {JSX.Element} Button component
26
- */
27
- const BpkButton = ({
28
- destructive = false,
29
- featured = false,
30
- link = false,
31
- linkOnDark = false,
32
- primaryOnDark = false,
33
- primaryOnLight = false,
34
- secondary = false,
35
- secondaryOnDark = false,
36
- ...rest
37
- }) => {
38
- if (primaryOnDark) {
39
- return /*#__PURE__*/_jsx(BpkButtonBase, {
40
- type: BUTTON_TYPES.primaryOnDark,
41
- ...rest
42
- });
43
- }
44
- if (primaryOnLight) {
45
- return /*#__PURE__*/_jsx(BpkButtonBase, {
46
- type: BUTTON_TYPES.primaryOnLight,
47
- ...rest
48
- });
49
- }
50
- if (secondary) {
51
- return /*#__PURE__*/_jsx(BpkButtonBase, {
52
- type: BUTTON_TYPES.secondary,
53
- ...rest
54
- });
55
- }
56
- if (secondaryOnDark) {
57
- return /*#__PURE__*/_jsx(BpkButtonBase, {
58
- type: BUTTON_TYPES.secondaryOnDark,
59
- ...rest
60
- });
61
- }
62
- if (destructive) {
63
- return /*#__PURE__*/_jsx(BpkButtonBase, {
64
- type: BUTTON_TYPES.destructive,
65
- ...rest
66
- });
67
- }
68
- if (featured) {
69
- return /*#__PURE__*/_jsx(BpkButtonBase, {
70
- type: BUTTON_TYPES.featured,
71
- ...rest
72
- });
73
- }
74
- if (link) {
75
- return /*#__PURE__*/_jsx(BpkButtonBase, {
76
- type: BUTTON_TYPES.link,
77
- ...rest
78
- });
79
- }
80
- if (linkOnDark) {
81
- return /*#__PURE__*/_jsx(BpkButtonBase, {
82
- type: BUTTON_TYPES.linkOnDark,
83
- ...rest
84
- });
85
- }
86
- return /*#__PURE__*/_jsx(BpkButtonBase, {
87
- ...rest
88
- });
89
- };
90
- BpkButton.propTypes = {
91
- ...propTypes,
92
- primaryOnDark: PropTypes.bool,
93
- primaryOnLight: PropTypes.bool,
94
- secondary: PropTypes.bool,
95
- secondaryOnDark: PropTypes.bool,
96
- destructive: PropTypes.bool,
97
- featured: PropTypes.bool,
98
- link: PropTypes.bool,
99
- linkOnDark: PropTypes.bool
100
- };
101
- export default BpkButton;
@@ -1,31 +0,0 @@
1
- import { type Props } from './common-types';
2
- export declare const BUTTON_TYPES: {
3
- readonly primary: "primary";
4
- readonly primaryOnDark: "primary-on-dark";
5
- readonly primaryOnLight: "primary-on-light";
6
- readonly secondary: "secondary";
7
- readonly secondaryOnDark: "secondary-on-dark";
8
- readonly destructive: "destructive";
9
- readonly featured: "featured";
10
- readonly link: "link";
11
- readonly linkOnDark: "link-on-dark";
12
- };
13
- type ValueOf<T> = T[keyof T];
14
- declare const BpkButtonBase: {
15
- ({ blank, children, className, disabled, href, iconOnly, large, onClick, rel: propRel, submit, type, ...rest }: Props & {
16
- type?: ValueOf<typeof BUTTON_TYPES>;
17
- }): import("react/jsx-runtime").JSX.Element;
18
- propTypes: {
19
- children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
20
- href: import("prop-types").Requireable<string>;
21
- className: import("prop-types").Requireable<string>;
22
- disabled: import("prop-types").Requireable<boolean>;
23
- onClick: import("prop-types").Requireable<(...args: any[]) => any>;
24
- submit: import("prop-types").Requireable<boolean>;
25
- large: import("prop-types").Requireable<boolean>;
26
- iconOnly: import("prop-types").Requireable<boolean>;
27
- blank: import("prop-types").Requireable<boolean>;
28
- rel: import("prop-types").Requireable<string>;
29
- };
30
- };
31
- export default BpkButtonBase;
@@ -1,116 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- import { cssModules } from "../../bpk-react-utils";
19
- import { propTypes } from "./common-types";
20
- import COMMON_STYLES from "./BpkButtonBase.module.css";
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- const getClassName = cssModules(COMMON_STYLES);
23
- const noop = () => null;
24
- // This is a duplicate of BpkButtonV2
25
- // Better to duplicate rather than prematurely align the abstraction between Button and ButtonV2
26
- export const BUTTON_TYPES = {
27
- primary: 'primary',
28
- primaryOnDark: 'primary-on-dark',
29
- primaryOnLight: 'primary-on-light',
30
- secondary: 'secondary',
31
- secondaryOnDark: 'secondary-on-dark',
32
- destructive: 'destructive',
33
- featured: 'featured',
34
- link: 'link',
35
- linkOnDark: 'link-on-dark'
36
- };
37
- const BpkButtonBase = ({
38
- blank = false,
39
- children,
40
- className = '',
41
- disabled = false,
42
- href = '',
43
- iconOnly = false,
44
- large = false,
45
- onClick = noop,
46
- rel: propRel = undefined,
47
- submit = false,
48
- type,
49
- ...rest
50
- }) => {
51
- const classNames = [];
52
- if (type === undefined) {
53
- classNames.push('bpk-button');
54
- }
55
- if (type === BUTTON_TYPES.featured) {
56
- classNames.push('bpk-button--featured');
57
- }
58
- if (type === BUTTON_TYPES.destructive) {
59
- classNames.push('bpk-button--destructive');
60
- }
61
- if (type === BUTTON_TYPES.link) {
62
- classNames.push('bpk-button--link');
63
- }
64
- if (type === BUTTON_TYPES.linkOnDark) {
65
- classNames.push('bpk-button--linkOnDark');
66
- }
67
- if (type === BUTTON_TYPES.primaryOnDark) {
68
- classNames.push('bpk-button--primaryOnDark');
69
- }
70
- if (type === BUTTON_TYPES.primaryOnLight) {
71
- classNames.push('bpk-button--primaryOnLight');
72
- }
73
- if (type === BUTTON_TYPES.secondary) {
74
- classNames.push('bpk-button--secondary');
75
- }
76
- if (type === BUTTON_TYPES.secondaryOnDark) {
77
- classNames.push('bpk-button--secondaryOnDark');
78
- }
79
- if (large) {
80
- classNames.push('bpk-button--large');
81
- }
82
- if (iconOnly) {
83
- classNames.push(large ? 'bpk-button--large-icon-only' : 'bpk-button--icon-only');
84
- }
85
- if (className) {
86
- classNames.push(className);
87
- }
88
- const classNameFinal = getClassName(...classNames);
89
- const target = blank ? '_blank' : null;
90
- const rel = blank ? propRel || 'noopener noreferrer' : propRel;
91
- if (!disabled && href) {
92
- return /*#__PURE__*/_jsx("a", {
93
- href: href,
94
- className: classNameFinal,
95
- onClick: onClick,
96
- target: target || undefined,
97
- rel: rel,
98
- ...rest,
99
- children: children
100
- });
101
- }
102
- const buttonType = submit ? 'submit' : 'button';
103
- return /*#__PURE__*/_jsx("button", {
104
- // eslint-disable-next-line react/button-has-type
105
- type: buttonType,
106
- disabled: disabled,
107
- className: classNameFinal,
108
- onClick: onClick,
109
- ...rest,
110
- children: children
111
- });
112
- };
113
- BpkButtonBase.propTypes = {
114
- ...propTypes
115
- };
116
- export default BpkButtonBase;
@@ -1,18 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- .bpk-button{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;border-radius:.5rem;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}.bpk-button:active{color:#fff;color:var(--bpk-button-primary-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, rgb(21, 70, 121))}.bpk-button:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-button--large{min-height:3rem;padding:.75rem 1rem}.bpk-button--icon-only{border-radius:.5rem;padding-right:.625rem;padding-left:.625rem;border-radius:.5rem}.bpk-button--large-icon-only{border-radius:.5rem;padding-right:.75rem;padding-left:.75rem;border-radius:.5rem}.bpk-button span>svg{display:block}.bpk-button svg{fill:currentcolor}.bpk-button--featured{composes:bpk-button;color:#fff;color:var(--bpk-button-featured-text-color, rgb(255, 255, 255));background-color:#0062e3;background-color:var(--bpk-button-featured-background-color, rgb(0, 98, 227))}.bpk-no-touch-support .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}:global(.bpk-no-touch-support) .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}.bpk-button--featured:active{color:#fff;color:var(--bpk-button-featured-active-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-active-background-color, rgb(2, 77, 175))}.bpk-button--featured:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--destructive{composes:bpk-button;color:#e70866;color:var(--bpk-button-destructive-text-color, rgb(231, 8, 102));background-color:#e0e4e9;background-color:var(--bpk-button-destructive-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}.bpk-button--destructive:active{color:#fff;color:var(--bpk-button-destructive-active-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-active-background-color, rgb(231, 8, 102))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--link{composes:bpk-button;background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link::after{bottom:auto}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link:disabled{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-large{padding:.75rem 0}.bpk-button--linkOnDark{composes:bpk-button;background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3;color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-button--linkOnDark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--linkOnDark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--linkOnDark:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--linkOnDark::after{bottom:auto}.bpk-no-touch-support .bpk-button--linkOnDark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--linkOnDark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--linkOnDark:active{background:none;color:#024daf;text-decoration:none}.bpk-button--linkOnDark:disabled{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--linkOnDark-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--linkOnDark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}:global(.bpk-no-touch-support) .bpk-button--linkOnDark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--linkOnDark:active{color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-active-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--linkOnDark:visited{color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255))}.bpk-button--linkOnDark:disabled{color:hsla(0,0%,100%,.2);color:var(--bpk-button-link-on-dark-disabled-color, rgba(255, 255, 255, 0.2))}.bpk-button--primaryOnDark{composes:bpk-button;color:#161616;color:var(--bpk-button-primary-on-dark-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-button--primaryOnDark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--primaryOnDark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}.bpk-button--primaryOnDark:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-active-background-color, rgb(193, 199, 207))}.bpk-button--primaryOnDark:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--primaryOnLight{composes:bpk-button;color:#fff;color:var(--bpk-button-primary-on-light-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-on-light-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button--primaryOnLight:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button--primaryOnLight:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}.bpk-button--primaryOnLight:active{color:#fff;color:var(--bpk-button-primary-on-light-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-active-background-color, rgb(21, 70, 121))}.bpk-button--primaryOnLight:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary{composes:bpk-button;color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--secondary:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--secondary:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondaryOnDark{composes:bpk-button;color:#fff;color:var(--bpk-button-secondary-on-dark-text-color, rgb(255, 255, 255));background-color:hsla(0,0%,100%,.1);background-color:var(--bpk-button-secondary-on-dark-background-color, rgba(255, 255, 255, 0.1))}.bpk-no-touch-support .bpk-button--secondaryOnDark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(1, 9, 19))}:global(.bpk-no-touch-support) .bpk-button--secondaryOnDark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(1, 9, 19))}.bpk-button--secondaryOnDark:active{color:#fff;color:var(--bpk-button-secondary-on-dark-active-text-color, rgb(255, 255, 255));background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-active-background-color, rgb(1, 9, 19))}.bpk-button--secondaryOnDark:disabled{background-color:#0b121d;color:hsla(0,0%,100%,.2)}
@@ -1,26 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import type { ReactNode, SyntheticEvent } from 'react';
3
- export type Props = {
4
- children: ReactNode;
5
- href?: string;
6
- className?: string;
7
- disabled?: boolean;
8
- onClick?: (event: SyntheticEvent) => unknown;
9
- submit?: boolean;
10
- large?: boolean;
11
- iconOnly?: boolean;
12
- blank?: boolean;
13
- rel?: string;
14
- };
15
- export declare const propTypes: {
16
- children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
17
- href: PropTypes.Requireable<string>;
18
- className: PropTypes.Requireable<string>;
19
- disabled: PropTypes.Requireable<boolean>;
20
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
21
- submit: PropTypes.Requireable<boolean>;
22
- large: PropTypes.Requireable<boolean>;
23
- iconOnly: PropTypes.Requireable<boolean>;
24
- blank: PropTypes.Requireable<boolean>;
25
- rel: PropTypes.Requireable<string>;
26
- };
@@ -1,31 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import PropTypes from 'prop-types';
20
- export const propTypes = {
21
- children: PropTypes.node.isRequired,
22
- href: PropTypes.string,
23
- className: PropTypes.string,
24
- disabled: PropTypes.bool,
25
- onClick: PropTypes.func,
26
- submit: PropTypes.bool,
27
- large: PropTypes.bool,
28
- iconOnly: PropTypes.bool,
29
- blank: PropTypes.bool,
30
- rel: PropTypes.string
31
- };
@@ -1 +0,0 @@
1
- export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes, } from './src/themeAttributes';
@@ -1,19 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes } from "./src/themeAttributes";