@skyscanner/backpack-web 34.2.0 → 34.4.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.
Files changed (87) hide show
  1. package/bpk-component-autosuggest/src/BpkAutosuggest.module.css +1 -1
  2. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +3 -5
  3. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +3 -5
  4. package/bpk-component-breakpoint/src/BpkBreakpoint.js +13 -7
  5. package/bpk-component-button/BpkButtonDestructive.d.ts +4 -0
  6. package/bpk-component-button/BpkButtonDestructive.js +9 -1
  7. package/bpk-component-button/BpkButtonFeatured.d.ts +4 -0
  8. package/bpk-component-button/BpkButtonFeatured.js +9 -1
  9. package/bpk-component-button/BpkButtonLink.d.ts +4 -0
  10. package/bpk-component-button/BpkButtonLink.js +9 -1
  11. package/bpk-component-button/BpkButtonLinkOnDark.d.ts +4 -0
  12. package/bpk-component-button/BpkButtonLinkOnDark.js +8 -1
  13. package/bpk-component-button/BpkButtonPrimary.d.ts +4 -0
  14. package/bpk-component-button/BpkButtonPrimary.js +8 -1
  15. package/bpk-component-button/BpkButtonPrimaryOnDark.d.ts +4 -0
  16. package/bpk-component-button/BpkButtonPrimaryOnDark.js +9 -1
  17. package/bpk-component-button/BpkButtonPrimaryOnLight.d.ts +4 -0
  18. package/bpk-component-button/BpkButtonPrimaryOnLight.js +9 -1
  19. package/bpk-component-button/BpkButtonSecondary.d.ts +4 -0
  20. package/bpk-component-button/BpkButtonSecondary.js +9 -1
  21. package/bpk-component-button/BpkButtonSecondaryOnDark.d.ts +4 -0
  22. package/bpk-component-button/BpkButtonSecondaryOnDark.js +9 -1
  23. package/bpk-component-button/index.d.ts +9 -9
  24. package/bpk-component-button/index.js +10 -20
  25. package/bpk-component-button/src/BpkButton.d.ts +56 -0
  26. package/bpk-component-button/src/BpkButton.js +31 -24
  27. package/bpk-component-button/src/BpkButtonBase.d.ts +53 -0
  28. package/bpk-component-button/src/BpkButtonBase.js +70 -43
  29. package/bpk-component-button/src/BpkButtonBase.module.css +1 -1
  30. package/bpk-component-button/src/common-types.d.ts +37 -0
  31. package/bpk-component-button/src/common-types.js +16 -15
  32. package/bpk-component-card/src/BpkCard.d.ts +1 -1
  33. package/bpk-component-card/src/BpkCard.js +4 -1
  34. package/bpk-component-card/src/BpkCard.module.css +1 -1
  35. package/bpk-component-card/src/BpkCardWrapper.js +18 -12
  36. package/bpk-component-card/src/BpkDividedCard.d.ts +1 -1
  37. package/bpk-component-card/src/BpkDividedCard.js +26 -19
  38. package/bpk-component-card/src/BpkDividedCard.module.css +1 -1
  39. package/bpk-component-card/src/CardContext.d.ts +14 -0
  40. package/{bpk-component-button/src/BpkButtonPrimary.js → bpk-component-card/src/CardContext.js} +11 -15
  41. package/bpk-component-card-button/src/BpkSaveButton.js +20 -24
  42. package/bpk-component-card-button/src/BpkSaveButton.module.css +1 -1
  43. package/bpk-component-close-button/src/BpkCloseButton.module.css +1 -1
  44. package/bpk-component-description-list/index.d.ts +4 -0
  45. package/bpk-component-description-list/src/BpkDescriptionDetails.d.ts +8 -0
  46. package/bpk-component-description-list/src/BpkDescriptionDetails.js +14 -2
  47. package/bpk-component-description-list/src/BpkDescriptionList.d.ts +8 -0
  48. package/bpk-component-description-list/src/BpkDescriptionList.js +14 -2
  49. package/bpk-component-description-list/src/BpkDescriptionTerm.d.ts +8 -0
  50. package/bpk-component-description-list/src/BpkDescriptionTerm.js +14 -2
  51. package/bpk-component-dialog/src/BpkDialogInner.js +3 -5
  52. package/bpk-component-dialog/src/BpkDialogInner.module.css +1 -1
  53. package/bpk-component-dialog/src/common-types.d.ts +1 -1
  54. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +12 -9
  55. package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +1 -1
  56. package/bpk-component-icon/src/classNameModifierHOCFactory.js +0 -3
  57. package/bpk-component-modal/src/BpkModalInner.js +6 -15
  58. package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
  59. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
  60. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +5 -11
  61. package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -1
  62. package/bpk-component-pagination/src/BpkPaginationPage.js +6 -9
  63. package/bpk-component-pagination/src/BpkPaginationPage.module.css +1 -1
  64. package/bpk-component-popover/src/BpkPopover.d.ts +13 -3
  65. package/bpk-component-popover/src/BpkPopover.js +13 -3
  66. package/bpk-component-popover/src/BpkPopover.module.css +1 -1
  67. package/bpk-component-text/src/BpkText.module.css +1 -1
  68. package/bpk-stylesheets/larken.css +1 -1
  69. package/bpk-stylesheets/larken.scss +90 -0
  70. package/package.json +2 -2
  71. package/bpk-component-button/src/BpkButtonDestructive.js +0 -48
  72. package/bpk-component-button/src/BpkButtonDestructive.module.css +0 -18
  73. package/bpk-component-button/src/BpkButtonFeatured.js +0 -48
  74. package/bpk-component-button/src/BpkButtonFeatured.module.css +0 -18
  75. package/bpk-component-button/src/BpkButtonLink.js +0 -53
  76. package/bpk-component-button/src/BpkButtonLink.module.css +0 -18
  77. package/bpk-component-button/src/BpkButtonLinkOnDark.js +0 -53
  78. package/bpk-component-button/src/BpkButtonLinkOnDark.module.css +0 -18
  79. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +0 -48
  80. package/bpk-component-button/src/BpkButtonPrimaryOnDark.module.css +0 -18
  81. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +0 -48
  82. package/bpk-component-button/src/BpkButtonPrimaryOnLight.module.css +0 -18
  83. package/bpk-component-button/src/BpkButtonSecondary.js +0 -47
  84. package/bpk-component-button/src/BpkButtonSecondary.module.css +0 -18
  85. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +0 -48
  86. package/bpk-component-button/src/BpkButtonSecondaryOnDark.module.css +0 -18
  87. package/bpk-component-description-list/src/ComponentFactory.js +0 -54
@@ -14,17 +14,27 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import { propTypes, defaultProps } from "./common-types";
17
+ */
18
+ import { cssModules } from "../../bpk-react-utils";
19
+ import { propTypes, defaultProps } from "./common-types";
18
20
  import COMMON_STYLES from "./BpkButtonBase.module.css";
19
-
20
- // This was originally depended upon from the bpk-react-utils package, however
21
- // we decided to inline it in this particular component so as not to bloat the
22
- // the bundles of consumers who are not yet on webpack 2
23
- // We'll revisit this again soon.
24
21
  import { jsx as _jsx } from "react/jsx-runtime";
25
- const cssModules = (styles = {}) => className => styles[className] ? styles[className] : className;
26
- const getCommonClassName = cssModules(COMMON_STYLES);
27
- const BpkButton = props => {
22
+ const getClassName = cssModules(COMMON_STYLES);
23
+
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 = props => {
28
38
  const {
29
39
  blank,
30
40
  children,
@@ -36,58 +46,75 @@ const BpkButton = props => {
36
46
  onClick,
37
47
  rel: propRel,
38
48
  submit,
49
+ type,
39
50
  ...rest
40
51
  } = props;
41
- const classNames = [getCommonClassName('bpk-button')];
52
+ const classNames = [];
53
+ if (type === undefined) {
54
+ classNames.push('bpk-button');
55
+ }
56
+ if (type === BUTTON_TYPES.featured) {
57
+ classNames.push('bpk-button--featured');
58
+ }
59
+ if (type === BUTTON_TYPES.destructive) {
60
+ classNames.push('bpk-button--destructive');
61
+ }
62
+ if (type === BUTTON_TYPES.link) {
63
+ classNames.push('bpk-button--link');
64
+ }
65
+ if (type === BUTTON_TYPES.linkOnDark) {
66
+ classNames.push('bpk-button--linkOnDark');
67
+ }
68
+ if (type === BUTTON_TYPES.primaryOnDark) {
69
+ classNames.push('bpk-button--primaryOnDark');
70
+ }
71
+ if (type === BUTTON_TYPES.primaryOnLight) {
72
+ classNames.push('bpk-button--primaryOnLight');
73
+ }
74
+ if (type === BUTTON_TYPES.secondary) {
75
+ classNames.push('bpk-button--secondary');
76
+ }
77
+ if (type === BUTTON_TYPES.secondaryOnDark) {
78
+ classNames.push('bpk-button--secondaryOnDark');
79
+ }
42
80
  if (large) {
43
- classNames.push(getCommonClassName('bpk-button--large'));
81
+ classNames.push('bpk-button--large');
44
82
  }
45
83
  if (iconOnly) {
46
- classNames.push(getCommonClassName(large ? 'bpk-button--large-icon-only' : 'bpk-button--icon-only'));
84
+ classNames.push(large ? 'bpk-button--large-icon-only' : 'bpk-button--icon-only');
47
85
  }
48
86
  if (className) {
49
87
  classNames.push(className);
50
88
  }
51
- const classNameFinal = classNames.join(' ');
89
+ const classNameFinal = getClassName(...classNames);
52
90
  const target = blank ? '_blank' : null;
53
91
  const rel = blank ? propRel || 'noopener noreferrer' : propRel;
54
92
  if (!disabled && href) {
55
- return (
56
- /*#__PURE__*/
57
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
58
- _jsx("a", {
59
- href: href,
60
- className: classNameFinal,
61
- onClick: onClick,
62
- target: target,
63
- rel: rel,
64
- ...rest,
65
- children: children
66
- })
67
- );
68
- }
69
- const buttonType = submit ? 'submit' : 'button';
70
-
71
- /* eslint-disable react/button-has-type */
72
- return (
73
- /*#__PURE__*/
74
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
75
- _jsx("button", {
76
- type: buttonType,
77
- disabled: disabled,
93
+ return /*#__PURE__*/_jsx("a", {
94
+ href: href,
78
95
  className: classNameFinal,
79
96
  onClick: onClick,
97
+ target: target || undefined,
98
+ rel: rel,
80
99
  ...rest,
81
100
  children: children
82
- })
83
- );
84
- /* eslint-enable */
101
+ });
102
+ }
103
+ const buttonType = submit ? 'submit' : 'button';
104
+ return /*#__PURE__*/_jsx("button", {
105
+ // eslint-disable-next-line react/button-has-type
106
+ type: buttonType,
107
+ disabled: disabled,
108
+ className: classNameFinal,
109
+ onClick: onClick,
110
+ ...rest,
111
+ children: children
112
+ });
85
113
  };
86
- BpkButton.propTypes = {
114
+ BpkButtonBase.propTypes = {
87
115
  ...propTypes
88
116
  };
89
- BpkButton.defaultProps = {
117
+ BpkButtonBase.defaultProps = {
90
118
  ...defaultProps
91
119
  };
92
- export default BpkButton;
93
- export { cssModules };
120
+ export default BpkButtonBase;
@@ -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 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 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;padding:0;border:0;background-color:rgba(0,0,0,0);text-decoration:none;cursor:pointer;appearance:none;color:#0062e3;color:var(--bpk-link-color, rgb(0, 98, 227));padding:.375rem 0;color:#0062e3}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, rgb(0, 98, 227))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, rgb(0, 98, 227))}.bpk-button--link:visited{color:#0062e3;color:var(--bpk-link-visited-color, rgb(0, 98, 227))}.bpk-button--link:active{text-decoration:underline;color:#0062e3;color:var(--bpk-link-active-color, rgb(0, 98, 227))}.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;padding:0;border:0;background-color:rgba(0,0,0,0);text-decoration:none;cursor:pointer;appearance:none;color:#0062e3;color:var(--bpk-link-color, rgb(0, 98, 227));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){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, rgb(0, 98, 227))}:global(.bpk-no-touch-support) .bpk-button--linkOnDark:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, rgb(0, 98, 227))}.bpk-button--linkOnDark:visited{color:#0062e3;color:var(--bpk-link-visited-color, rgb(0, 98, 227))}.bpk-button--linkOnDark:active{text-decoration:underline;color:#0062e3;color:var(--bpk-link-active-color, rgb(0, 98, 227))}.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:rgba(255,255,255,.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:rgba(255,255,255,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--linkOnDark:active{color:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.2)}
@@ -0,0 +1,37 @@
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 defaultProps: {
16
+ href: null;
17
+ className: null;
18
+ disabled: boolean;
19
+ onClick: null;
20
+ submit: boolean;
21
+ large: boolean;
22
+ iconOnly: boolean;
23
+ blank: boolean;
24
+ rel: null;
25
+ };
26
+ export declare const propTypes: {
27
+ children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
28
+ href: PropTypes.Requireable<string>;
29
+ className: PropTypes.Requireable<string>;
30
+ disabled: PropTypes.Requireable<boolean>;
31
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
32
+ submit: PropTypes.Requireable<boolean>;
33
+ large: PropTypes.Requireable<boolean>;
34
+ iconOnly: PropTypes.Requireable<boolean>;
35
+ blank: PropTypes.Requireable<boolean>;
36
+ rel: PropTypes.Requireable<string>;
37
+ };
@@ -14,20 +14,10 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
18
- const propTypes = {
19
- children: PropTypes.node.isRequired,
20
- href: PropTypes.string,
21
- className: PropTypes.string,
22
- disabled: PropTypes.bool,
23
- onClick: PropTypes.func,
24
- submit: PropTypes.bool,
25
- large: PropTypes.bool,
26
- iconOnly: PropTypes.bool,
27
- blank: PropTypes.bool,
28
- rel: PropTypes.string
29
- };
30
- const defaultProps = {
17
+ */
18
+
19
+ import PropTypes from 'prop-types';
20
+ export const defaultProps = {
31
21
  href: null,
32
22
  className: null,
33
23
  disabled: false,
@@ -38,4 +28,15 @@ const defaultProps = {
38
28
  blank: false,
39
29
  rel: null
40
30
  };
41
- export { propTypes, defaultProps };
31
+ export const propTypes = {
32
+ children: PropTypes.node.isRequired,
33
+ href: PropTypes.string,
34
+ className: PropTypes.string,
35
+ disabled: PropTypes.bool,
36
+ onClick: PropTypes.func,
37
+ submit: PropTypes.bool,
38
+ large: PropTypes.bool,
39
+ iconOnly: PropTypes.bool,
40
+ blank: PropTypes.bool,
41
+ rel: PropTypes.string
42
+ };
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  type Props = {
3
3
  children: ReactNode | string;
4
4
  className?: string | null;
@@ -16,7 +16,9 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
+ import { useContext } from 'react';
19
20
  import { cssModules } from "../../bpk-react-utils";
21
+ import { CardContext } from "./CardContext";
20
22
  import STYLES from "./BpkCard.module.css";
21
23
  import { jsx as _jsx } from "react/jsx-runtime";
22
24
  const getClassName = cssModules(STYLES);
@@ -29,7 +31,8 @@ const BpkCard = ({
29
31
  padded = true,
30
32
  ...rest
31
33
  }) => {
32
- const classNames = getClassName('bpk-card', atomic && !href && 'bpk-card--atomic-button', padded && 'bpk-card--padded', className);
34
+ const cardContext = useContext(CardContext);
35
+ const classNames = getClassName('bpk-card', atomic && !href && 'bpk-card--atomic-button', padded && 'bpk-card--padded', !cardContext.elevated && 'bpk-card--no-elevation', className);
33
36
  const atomicProps = {};
34
37
  if (href) {
35
38
  let blankProps = {};
@@ -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-card{position:relative;display:block;background-color:#fff;color:#161616;text-decoration:none;cursor:pointer;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3);border-radius:.75rem}.bpk-no-touch-support .bpk-card:hover:not(:active):not(:disabled)::after{opacity:1}:global(.bpk-no-touch-support) .bpk-card:hover:not(:active):not(:disabled)::after{opacity:1}.bpk-card::after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";transition:opacity 200ms ease-in-out;opacity:0;pointer-events:none;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25);border-radius:.75rem}@media screen\0 {.bpk-card::after{z-index:-1}}.bpk-card:active::after{box-shadow:none}.bpk-card--atomic-button{width:100%;padding:0;border:none;background:none;color:inherit;text-align:inherit;cursor:pointer;appearance:none}.bpk-card--padded{padding:1rem}
18
+ .bpk-card{position:relative;display:block;background-color:#fff;color:#161616;text-decoration:none;cursor:pointer;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3);border-radius:.75rem}.bpk-no-touch-support .bpk-card:hover:not(:active):not(:disabled)::after{opacity:1}:global(.bpk-no-touch-support) .bpk-card:hover:not(:active):not(:disabled)::after{opacity:1}.bpk-card::after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";transition:opacity 200ms ease-in-out;opacity:0;pointer-events:none;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25);border-radius:.75rem}@media screen\0 {.bpk-card::after{z-index:-1}}.bpk-card:active::after{box-shadow:none}.bpk-card--atomic-button{width:100%;padding:0;border:none;background:none;color:inherit;text-align:inherit;cursor:pointer;appearance:none}.bpk-card--padded{padding:1rem}.bpk-card--no-elevation{box-shadow:none}.bpk-card--no-elevation::after{box-shadow:none}
@@ -17,6 +17,7 @@
17
17
  */
18
18
 
19
19
  import { cssModules } from "../../bpk-react-utils";
20
+ import { CardContext } from "./CardContext";
20
21
  import STYLES from "./BpkCardWrapper.module.css";
21
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
23
  const getClassName = cssModules(STYLES);
@@ -27,19 +28,24 @@ const BpkCardWrapper = ({
27
28
  header
28
29
  }) => {
29
30
  const classNames = getClassName('bpk-card-wrapper', className);
30
- return /*#__PURE__*/_jsxs("div", {
31
- className: classNames,
32
- style: {
33
- // @ts-expect-error TS is reporting this incorrectly as --background-color is valid
34
- '--background-color': backgroundColor
31
+ return /*#__PURE__*/_jsx(CardContext.Provider, {
32
+ value: {
33
+ elevated: false
35
34
  },
36
- children: [/*#__PURE__*/_jsx("div", {
37
- className: getClassName('bpk-card-wrapper--header'),
38
- children: header
39
- }), /*#__PURE__*/_jsx("div", {
40
- className: getClassName('bpk-card-wrapper--content'),
41
- children: card
42
- })]
35
+ children: /*#__PURE__*/_jsxs("div", {
36
+ className: classNames,
37
+ style: {
38
+ // @ts-expect-error TS is reporting this incorrectly as --background-color is valid
39
+ '--background-color': backgroundColor
40
+ },
41
+ children: [/*#__PURE__*/_jsx("div", {
42
+ className: getClassName('bpk-card-wrapper--header'),
43
+ children: header
44
+ }), /*#__PURE__*/_jsx("div", {
45
+ className: getClassName('bpk-card-wrapper--content'),
46
+ children: card
47
+ })]
48
+ })
43
49
  });
44
50
  };
45
51
  export default BpkCardWrapper;
@@ -12,5 +12,5 @@ export type Props = {
12
12
  isElevated?: boolean;
13
13
  [rest: string]: any;
14
14
  };
15
- declare const BpkDividedCard: ({ className, href, isElevated, orientation, primaryContent, secondaryContent, ...rest }: Props) => JSX.Element;
15
+ declare const BpkDividedCard: ({ href, isElevated, orientation, primaryContent, secondaryContent, ...rest }: Props) => JSX.Element;
16
16
  export default BpkDividedCard;
@@ -18,6 +18,7 @@
18
18
 
19
19
  import { cssModules } from "../../bpk-react-utils";
20
20
  import BpkCard from "./BpkCard";
21
+ import { CardContext } from "./CardContext";
21
22
  import STYLES from "./BpkDividedCard.module.css";
22
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
24
  const getClassName = cssModules(STYLES);
@@ -26,7 +27,6 @@ export const ORIENTATION = {
26
27
  vertical: 'vertical'
27
28
  };
28
29
  const BpkDividedCard = ({
29
- className = null,
30
30
  href = null,
31
31
  isElevated = true,
32
32
  orientation = ORIENTATION.horizontal,
@@ -35,24 +35,31 @@ const BpkDividedCard = ({
35
35
  ...rest
36
36
  }) => {
37
37
  const isVertical = orientation === ORIENTATION.vertical;
38
- const classNames = getClassName('bpk-divided-card', isVertical ? 'bpk-divided-card--vertical' : 'bpk-divided-card--horizontal', !isElevated && 'bpk-divided-card--no-elevation', className);
39
- return (
40
- /*#__PURE__*/
41
- // TODO: className to be removed
42
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
43
- _jsxs(BpkCard, {
44
- className: classNames,
45
- href: href,
46
- padded: false,
47
- ...rest,
48
- children: [/*#__PURE__*/_jsx("div", {
49
- className: getClassName(!isVertical && 'bpk-divided-card__primary--horizontal'),
50
- children: primaryContent
51
- }), /*#__PURE__*/_jsx("div", {
52
- className: getClassName(isVertical ? 'bpk-divided-card__secondary--vertical' : 'bpk-divided-card__secondary--horizontal'),
53
- children: secondaryContent
54
- })]
38
+ const containerClassName = getClassName(isVertical ? 'bpk-divided-card--vertical-container' : 'bpk-divided-card--horizontal-container');
39
+ const contentClassName = getClassName('bpk-divided-card--content', isVertical && 'bpk-divided-card--vertical-content');
40
+ const secondaryContentClassName = getClassName(isVertical ? 'bpk-divided-card__secondary--vertical' : 'bpk-divided-card__secondary--horizontal');
41
+ return /*#__PURE__*/_jsx(CardContext.Provider, {
42
+ value: {
43
+ elevated: isElevated
44
+ },
45
+ children: /*#__PURE__*/_jsx("div", {
46
+ className: containerClassName,
47
+ children: /*#__PURE__*/_jsx(BpkCard, {
48
+ href: href,
49
+ padded: false,
50
+ ...rest,
51
+ children: /*#__PURE__*/_jsxs("div", {
52
+ className: contentClassName,
53
+ children: [/*#__PURE__*/_jsx("div", {
54
+ className: getClassName(!isVertical && 'bpk-divided-card__primary--horizontal'),
55
+ children: primaryContent
56
+ }), /*#__PURE__*/_jsx("div", {
57
+ className: secondaryContentClassName,
58
+ children: secondaryContent
59
+ })]
60
+ })
61
+ })
55
62
  })
56
- );
63
+ });
57
64
  };
58
65
  export default BpkDividedCard;
@@ -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-divided-card{display:flex;align-items:stretch}.bpk-divided-card--vertical{min-width:15rem;max-width:45rem;flex-direction:column}.bpk-divided-card--horizontal{min-width:45.0625rem;min-height:18.25rem}.bpk-divided-card__primary--horizontal{flex:1}.bpk-divided-card__secondary--vertical{border-top:solid .0625rem #c1c7cf}.bpk-divided-card__secondary--horizontal{width:13.5rem;border-left:solid .0625rem #c1c7cf}html[dir=rtl] .bpk-divided-card__secondary--horizontal{border-right:solid .0625rem #c1c7cf;border-left:unset}.bpk-divided-card--no-elevation{box-shadow:none}.bpk-divided-card--no-elevation::after{box-shadow:none}
18
+ .bpk-divided-card--content{display:flex;height:100%;align-items:stretch}.bpk-divided-card--vertical-content{flex-direction:column}.bpk-divided-card--vertical-container{display:flex;min-width:15rem;max-width:45rem}.bpk-divided-card--horizontal-container{display:flex;min-width:45.0625rem;min-height:18.25rem}.bpk-divided-card__primary--horizontal{flex:1}.bpk-divided-card__secondary--vertical{border-top:solid .0625rem #c1c7cf}.bpk-divided-card__secondary--horizontal{width:13.5rem;border-left:solid .0625rem #c1c7cf}html[dir=rtl] .bpk-divided-card__secondary--horizontal{border-right:solid .0625rem #c1c7cf;border-left:unset}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ interface BpkCardContext {
3
+ /**
4
+ * Indicates if the BpkCard should render elevated from the page or not. Parent card types can specify `false` when they handle elevation internally, rather than BpkCard.
5
+ * BpkCard will render elevated by default.
6
+ */
7
+ elevated: boolean;
8
+ }
9
+ /**
10
+ * CardContext is an internal context to be used only within Backpack parent Card types (time of writing BpkDividedCard & BpkCardWrapper).
11
+ * It facillitates the BpkCard to render appropriately when wrapped and/or is rendered indirectly from a parent.
12
+ */
13
+ export declare const CardContext: import("react").Context<BpkCardContext>;
14
+ export {};
@@ -14,19 +14,15 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import BpkButtonBase from "./BpkButtonBase";
18
- import { defaultProps, propTypes } from "./common-types";
19
-
20
- // TODO: BpkButtonBase has the primary button style as it wasn't removed to
21
- // avoid a breaking change in the mixin. Review after this is tested.
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- const BpkButtonPrimary = props => /*#__PURE__*/_jsx(BpkButtonBase, {
24
- ...props
25
- });
26
- BpkButtonPrimary.propTypes = {
27
- ...propTypes
28
- };
29
- BpkButtonPrimary.defaultProps = {
30
- ...defaultProps
17
+ */
18
+ import { createContext } from 'react';
19
+ const defaultContext = {
20
+ elevated: true
31
21
  };
32
- export default BpkButtonPrimary;
22
+
23
+ /**
24
+ * CardContext is an internal context to be used only within Backpack parent Card types (time of writing BpkDividedCard & BpkCardWrapper).
25
+ * It facillitates the BpkCard to render appropriately when wrapped and/or is rendered indirectly from a parent.
26
+ */
27
+ // eslint-disable-next-line import/prefer-default-export
28
+ export const CardContext = /*#__PURE__*/createContext(defaultContext);
@@ -17,8 +17,7 @@
17
17
  */
18
18
 
19
19
  import { useState } from 'react';
20
- import { BpkButtonV2 } from "../../bpk-component-button";
21
- import { withLargeButtonAlignment } from "../../bpk-component-icon";
20
+ import { colorBlack, colorWhite } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
22
21
  import BpkHeartIcon from "../../bpk-component-icon/lg/heart";
23
22
  import BpkHeartOutlineIcon from "../../bpk-component-icon/lg/heart--outline";
24
23
  import BpkHeartIconSm from "../../bpk-component-icon/sm/heart";
@@ -36,10 +35,10 @@ export const STYLE_TYPES = {
36
35
  onDark: 'onDark'
37
36
  };
38
37
  const getClassName = cssModules(STYLES);
39
- const AlignedHeartIcon = withLargeButtonAlignment(BpkHeartIcon);
40
- const AlignedHeartOutlineIcon = withLargeButtonAlignment(BpkHeartOutlineIcon);
41
- const AlignedHeartIconSm = withLargeButtonAlignment(BpkHeartIconSm);
42
- const AlignedHeartOutlineIconSm = withLargeButtonAlignment(BpkHeartOutlineIconSm);
38
+ const AlignedHeartIcon = BpkHeartIcon;
39
+ const AlignedHeartOutlineIcon = BpkHeartOutlineIcon;
40
+ const AlignedHeartIconSm = BpkHeartIconSm;
41
+ const AlignedHeartOutlineIconSm = BpkHeartOutlineIconSm;
43
42
  const BpkSaveButton = ({
44
43
  accessibilityLabel,
45
44
  checked,
@@ -47,33 +46,30 @@ const BpkSaveButton = ({
47
46
  size = SIZE_TYPES.default,
48
47
  style = STYLE_TYPES.default
49
48
  }) => {
50
- const [toggle, setToggle] = useState(false);
49
+ const [shouldPlayAnim, setPlayAnim] = useState(false);
51
50
  const smallSize = size === SIZE_TYPES.small;
52
51
  const HeartIcon = smallSize ? AlignedHeartIconSm : AlignedHeartIcon;
53
52
  const HeartOutLineIcon = smallSize ? AlignedHeartOutlineIconSm : AlignedHeartOutlineIcon;
54
- return /*#__PURE__*/_jsxs(BpkButtonV2, {
55
- "aria-label": accessibilityLabel
56
- // TODO: className to be removed
57
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
58
- ,
53
+ return /*#__PURE__*/_jsxs("button", {
54
+ type: "button",
55
+ "aria-label": accessibilityLabel,
59
56
  className: getClassName('bpk-save-button', smallSize && 'bpk-save-button__small', `bpk-save-button__${style}`),
60
57
  onClick: e => {
61
58
  onCheckedChange(e);
62
59
  if (!checked) {
63
- setToggle(true);
60
+ setPlayAnim(true);
64
61
  }
65
62
  },
66
- iconOnly: true,
67
- children: [/*#__PURE__*/_jsx(HeartIcon
68
- // TODO: className to be removed
69
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
70
- , {
71
- className: getClassName('bpk-save-button__icon', 'bpk-save-button__heartIcon', toggle && checked && 'bpk-save-button__heartIcon--toggle', `bpk-save-button__heartIcon--${checked ? 'show' : 'hide'}`, `bpk-save-button__heartIcon--${style}`)
72
- }), /*#__PURE__*/_jsx(HeartOutLineIcon
73
- // TODO: className to be removed
74
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
75
- , {
76
- className: getClassName('bpk-save-button__icon', 'bpk-save-button__heartOutlineIcon', `bpk-save-button__heartOutlineIcon--${checked ? 'hide' : 'show'}`, `bpk-save-button__heartOutlineIcon--${style}`)
63
+ children: [/*#__PURE__*/_jsx("div", {
64
+ className: getClassName(`bpk-save-button__heartIcon`, checked && shouldPlayAnim && `bpk-save-button__heartIcon--clicked`, `bpk-save-button__heartIcon--${style}`),
65
+ "data-show": checked,
66
+ children: /*#__PURE__*/_jsx(HeartIcon, {})
67
+ }), /*#__PURE__*/_jsx("div", {
68
+ className: getClassName(`bpk-save-button__heartOutlineIcon`),
69
+ "data-show": !checked,
70
+ children: /*#__PURE__*/_jsx(HeartOutLineIcon, {
71
+ fill: style === STYLE_TYPES.onDark ? colorWhite : colorBlack
72
+ })
77
73
  })]
78
74
  });
79
75
  };
@@ -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
- @keyframes heart-beat{0%,100%{transform:translate(-50%, -50%) scale(1)}10%{transform:translate(-50%, -50%) scale(1.4)}20%{transform:translate(-50%, -50%) scale(1.2)}30%{transform:translate(-50%, -50%) scale(1.3)}50%{transform:translate(-50%, -50%) scale(1.25)}70%{transform:translate(-50%, -50%) scale(1.25)}}.bpk-save-button{position:relative;width:2.5rem;height:2.5rem;padding:.5rem;border-radius:50%;background-color:rgba(0,0,0,0)}.bpk-no-touch-support .bpk-save-button:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0)}:global(.bpk-no-touch-support) .bpk-save-button:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0)}.bpk-save-button:active{background-color:rgba(0,0,0,0)}.bpk-save-button__icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);color:#161616}.bpk-no-touch-support .bpk-save-button__icon:hover:not(:active):not(:disabled){color:#161616}:global(.bpk-no-touch-support) .bpk-save-button__icon:hover:not(:active):not(:disabled){color:#161616}.bpk-save-button__heartOutlineIcon{z-index:1;opacity:1}.bpk-no-touch-support .bpk-save-button__heartOutlineIcon--show:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;opacity:0}:global(.bpk-no-touch-support) .bpk-save-button__heartOutlineIcon--show:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;opacity:0}.bpk-save-button__heartOutlineIcon--hide{opacity:0}.bpk-save-button__heartOutlineIcon--onDark{color:#fff}.bpk-save-button__heartIcon{z-index:2;color:#0062e3;opacity:0}.bpk-save-button__heartIcon--toggle{animation:heart-beat 1s 0s 1 ease-out;animation-fill-mode:forwards}.bpk-save-button__heartIcon--show{opacity:1}.bpk-no-touch-support .bpk-save-button__heartIcon--show:hover:not(:active):not(:disabled){color:#0062e3}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--show:hover:not(:active):not(:disabled){color:#0062e3}.bpk-no-touch-support .bpk-save-button__heartIcon--hide:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;color:#161616;opacity:1}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--hide:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;color:#161616;opacity:1}.bpk-save-button__heartIcon--onDark{color:#fff}.bpk-no-touch-support .bpk-save-button__heartIcon--onDark:hover:not(:active):not(:disabled){color:#fff}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--onDark:hover:not(:active):not(:disabled){color:#fff}.bpk-save-button__small{width:2rem;height:2rem;min-height:2rem}.bpk-save-button__contained{background-color:rgba(255,255,255,.8)}.bpk-no-touch-support .bpk-save-button__contained:hover:not(:active):not(:disabled){background-color:rgba(255,255,255,.8)}:global(.bpk-no-touch-support) .bpk-save-button__contained:hover:not(:active):not(:disabled){background-color:rgba(255,255,255,.8)}.bpk-save-button__contained:active{background-color:rgba(255,255,255,.8)}
18
+ @keyframes heart-beat{0%,100%{transform:translate(-50%, -50%) scale(1)}10%{transform:translate(-50%, -50%) scale(1.4)}20%{transform:translate(-50%, -50%) scale(1.2)}30%{transform:translate(-50%, -50%) scale(1.3)}50%{transform:translate(-50%, -50%) scale(1.25)}70%{transform:translate(-50%, -50%) scale(1.25)}}.bpk-save-button{position:relative;width:2.5rem;height:2.5rem;padding:.5rem;border:0;border-radius:50%;background-color:rgba(0,0,0,0)}.bpk-save-button__icon{position:absolute;top:50%;left:50%;display:flex;transform:translate(-50%, -50%)}.bpk-save-button__heartOutlineIcon{z-index:1;opacity:1;composes:bpk-save-button__icon}.bpk-no-touch-support .bpk-save-button__heartOutlineIcon[data-show=true]:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;opacity:0}:global(.bpk-no-touch-support) .bpk-save-button__heartOutlineIcon[data-show=true]:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;opacity:0}.bpk-save-button__heartOutlineIcon[data-show=false]{opacity:0}.bpk-save-button__heartIcon{z-index:2;opacity:0;composes:bpk-save-button__icon}.bpk-save-button__heartIcon[data-show=true]{opacity:1}.bpk-no-touch-support .bpk-save-button__heartIcon[data-show=false]:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;opacity:1}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon[data-show=false]:hover:not(:active):not(:disabled){transition:opacity 200ms ease-in-out;opacity:1}.bpk-save-button__heartIcon--clicked{animation:heart-beat 1s 0s 1 ease-out;animation-fill-mode:forwards}.bpk-save-button__heartIcon--onDark{fill:#fff}.bpk-no-touch-support .bpk-save-button__heartIcon--onDark:hover:not(:active):not(:disabled){fill:#fff}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--onDark:hover:not(:active):not(:disabled){fill:#fff}.bpk-save-button__heartIcon--default,.bpk-save-button__heartIcon--contained{fill:#0062e3}.bpk-no-touch-support .bpk-save-button__heartIcon--default:hover:not(:active):not(:disabled),.bpk-no-touch-support .bpk-save-button__heartIcon--contained:hover:not(:active):not(:disabled){fill:#161616}.bpk-no-touch-support .bpk-save-button__heartIcon--default:hover:not(:active):not(:disabled)[data-show=true],.bpk-no-touch-support .bpk-save-button__heartIcon--contained:hover:not(:active):not(:disabled)[data-show=true]{fill:#0062e3}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--default:hover:not(:active):not(:disabled),:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--contained:hover:not(:active):not(:disabled){fill:#161616}:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--default:hover:not(:active):not(:disabled)[data-show=true],:global(.bpk-no-touch-support) .bpk-save-button__heartIcon--contained:hover:not(:active):not(:disabled)[data-show=true]{fill:#0062e3}.bpk-save-button__small{width:2rem;height:2rem;min-height:2rem}.bpk-save-button__contained{background-color:rgba(255,255,255,.8)}
@@ -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-close-button{width:1.5rem;height:1.5rem;margin-right:-0.125rem;margin-left:-0.125rem;padding:0;border:0;background-color:rgba(0,0,0,0);font-size:1.5rem;cursor:pointer;appearance:none;position:relative}.bpk-close-button::before{position:absolute;top:calc(-2.75rem/2 + 50%);left:calc(-2.75rem/2 + 50%);content:"";width:2.75rem;height:2.75rem}.bpk-close-button__default{color:#161616;composes:bpk-close-button}.bpk-no-touch-support .bpk-close-button__default:hover:not(:active):not(:disabled){color:#161616}:global(.bpk-no-touch-support) .bpk-close-button__default:hover:not(:active):not(:disabled){color:#161616}.bpk-close-button__default:active{color:#161616}.bpk-close-button__onDark{color:#fff;composes:bpk-close-button}.bpk-no-touch-support .bpk-close-button__onDark:hover:not(:active):not(:disabled){color:#fff}:global(.bpk-no-touch-support) .bpk-close-button__onDark:hover:not(:active):not(:disabled){color:#fff}.bpk-close-button__onDark:active{color:#fff}.bpk-close-button-icon{fill:currentcolor}
18
+ .bpk-close-button{width:1.5rem;height:1.5rem;padding:0;border:0;background-color:rgba(0,0,0,0);font-size:1.5rem;cursor:pointer;appearance:none;position:relative}.bpk-close-button::before{position:absolute;top:calc(-2.75rem/2 + 50%);left:calc(-2.75rem/2 + 50%);content:"";width:2.75rem;height:2.75rem}.bpk-close-button__default{color:#161616;composes:bpk-close-button}.bpk-no-touch-support .bpk-close-button__default:hover:not(:active):not(:disabled){color:#161616}:global(.bpk-no-touch-support) .bpk-close-button__default:hover:not(:active):not(:disabled){color:#161616}.bpk-close-button__default:active{color:#161616}.bpk-close-button__onDark{color:#fff;composes:bpk-close-button}.bpk-no-touch-support .bpk-close-button__onDark:hover:not(:active):not(:disabled){color:#fff}:global(.bpk-no-touch-support) .bpk-close-button__onDark:hover:not(:active):not(:disabled){color:#fff}.bpk-close-button__onDark:active{color:#fff}.bpk-close-button-icon{fill:currentcolor}
@@ -0,0 +1,4 @@
1
+ import BpkDescriptionDetails from './src/BpkDescriptionDetails';
2
+ import BpkDescriptionList from './src/BpkDescriptionList';
3
+ import BpkDescriptionTerm from './src/BpkDescriptionTerm';
4
+ export { BpkDescriptionList, BpkDescriptionTerm, BpkDescriptionDetails };
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode | string;
4
+ className?: string;
5
+ [rest: string]: any;
6
+ };
7
+ declare const _default: ({ children, className, ...rest }: Props) => JSX.Element;
8
+ export default _default;
@@ -16,5 +16,17 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import buildComponent from "./ComponentFactory";
20
- export default buildComponent('dd', 'bpk-description-list__details');
19
+ import { cssModules } from "../../bpk-react-utils";
20
+ import STYLES from "./BpkDescriptionList.module.css";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ const getClassName = cssModules(STYLES);
23
+ export default (({
24
+ children,
25
+ className,
26
+ ...rest
27
+ }) => /*#__PURE__*/_jsx("dd", {
28
+ className: [getClassName('bpk-description-list__details'), className].filter(x => x) // inline drops the className if undefined
29
+ .join(' '),
30
+ ...rest,
31
+ children: children
32
+ }));
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode | string;
4
+ className?: string;
5
+ [rest: string]: any;
6
+ };
7
+ declare const _default: ({ children, className, ...rest }: Props) => JSX.Element;
8
+ export default _default;