@skyscanner/backpack-web 42.1.0 → 42.2.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 (140) hide show
  1. package/bpk-component-banner-alert/src/BpkBannerAlert.js +0 -7
  2. package/bpk-component-breakpoint/src/BpkBreakpoint.js +3 -1
  3. package/bpk-component-calendar/src/utils.js +1 -1
  4. package/bpk-component-card/index.d.ts +4 -1
  5. package/bpk-component-card/index.js +3 -1
  6. package/bpk-component-card/src/BpkCardV2/BpkCardV2.d.ts +27 -0
  7. package/bpk-component-card/src/BpkCardV2/BpkCardV2.js +57 -0
  8. package/bpk-component-card/src/BpkCardV2/BpkCardV2.module.css +18 -0
  9. package/bpk-component-card/src/BpkCardV2/common-types.d.ts +124 -0
  10. package/bpk-component-card/src/BpkCardV2/common-types.js +102 -0
  11. package/bpk-component-card/src/BpkCardV2/subcomponents/Body.d.ts +36 -0
  12. package/bpk-component-card/src/BpkCardV2/subcomponents/Body.js +65 -0
  13. package/bpk-component-card/src/BpkCardV2/subcomponents/Divider.d.ts +13 -0
  14. package/bpk-component-card/src/BpkCardV2/subcomponents/Divider.js +37 -0
  15. package/bpk-component-card/src/BpkCardV2/subcomponents/Footer.d.ts +24 -0
  16. package/bpk-component-card/src/BpkCardV2/subcomponents/Footer.js +60 -0
  17. package/bpk-component-card/src/BpkCardV2/subcomponents/Header.d.ts +24 -0
  18. package/bpk-component-card/src/BpkCardV2/subcomponents/Header.js +60 -0
  19. package/bpk-component-card/src/BpkCardV2/subcomponents/Root.d.ts +28 -0
  20. package/bpk-component-card/src/BpkCardV2/subcomponents/Root.js +68 -0
  21. package/bpk-component-card/src/BpkCardV2/subcomponents/Section.d.ts +22 -0
  22. package/bpk-component-card/src/BpkCardV2/subcomponents/Section.js +53 -0
  23. package/bpk-component-card/src/BpkCardV2/subcomponents/resolveDirectionalPadding.d.ts +16 -0
  24. package/bpk-component-card/src/BpkCardV2/subcomponents/resolveDirectionalPadding.js +32 -0
  25. package/bpk-component-card-list/src/BpkCardList.module.css +1 -1
  26. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +3 -3
  27. package/bpk-component-chatbot-input/index.d.ts +7 -0
  28. package/bpk-component-chatbot-input/index.js +23 -0
  29. package/bpk-component-chatbot-input/src/BpkChatbotInput.d.ts +4 -0
  30. package/bpk-component-chatbot-input/src/BpkChatbotInput.js +118 -0
  31. package/bpk-component-chatbot-input/src/BpkChatbotInput.module.css +18 -0
  32. package/bpk-component-chatbot-input/src/InputField/InputField.d.ts +3 -0
  33. package/bpk-component-chatbot-input/src/InputField/InputField.js +82 -0
  34. package/bpk-component-chatbot-input/src/InputField.module.css +18 -0
  35. package/bpk-component-chatbot-input/src/SendButton/SendButton.d.ts +9 -0
  36. package/bpk-component-chatbot-input/src/SendButton/SendButton.js +47 -0
  37. package/bpk-component-chatbot-input/src/TextAreaField/TextAreaField.d.ts +10 -0
  38. package/bpk-component-chatbot-input/src/TextAreaField/TextAreaField.js +93 -0
  39. package/bpk-component-chatbot-input/src/TextAreaField.module.css +18 -0
  40. package/bpk-component-chatbot-input/src/common-types.d.ts +37 -0
  41. package/bpk-component-chatbot-input/src/common-types.js +23 -0
  42. package/bpk-component-chatbot-input/src/constants.d.ts +5 -0
  43. package/bpk-component-chatbot-input/src/constants.js +22 -0
  44. package/bpk-component-chatbot-input/src/hooks/index.d.ts +4 -0
  45. package/bpk-component-chatbot-input/src/hooks/index.js +22 -0
  46. package/bpk-component-chatbot-input/src/hooks/useChatbotInput.d.ts +32 -0
  47. package/bpk-component-chatbot-input/src/hooks/useChatbotInput.js +111 -0
  48. package/bpk-component-chatbot-input/src/hooks/useChatbotInputManager.d.ts +20 -0
  49. package/bpk-component-chatbot-input/src/hooks/useChatbotInputManager.js +83 -0
  50. package/bpk-component-chatbot-input/src/hooks/useInputHandlers.d.ts +8 -0
  51. package/bpk-component-chatbot-input/src/hooks/useInputHandlers.js +54 -0
  52. package/bpk-component-chatbot-input/src/hooks/useTextAreaAutoResize.d.ts +22 -0
  53. package/bpk-component-chatbot-input/src/hooks/useTextAreaAutoResize.js +137 -0
  54. package/bpk-component-chatbot-input/src/themeAttributes.d.ts +14 -0
  55. package/bpk-component-chatbot-input/src/themeAttributes.js +34 -0
  56. package/bpk-component-checkbox/index.d.ts +8 -8
  57. package/bpk-component-checkbox/index.js +3 -3
  58. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2.d.ts +9 -0
  59. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckbox.js → BpkCheckboxV2.js} +14 -14
  60. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Control.d.ts +6 -0
  61. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxControl.js → BpkCheckboxV2Control.js} +3 -3
  62. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Description.d.ts +6 -0
  63. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxDescription.js → BpkCheckboxV2Description.js} +3 -3
  64. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2HiddenInput.d.ts +2 -0
  65. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxHiddenInput.js → BpkCheckboxV2HiddenInput.js} +2 -2
  66. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Indicator.d.ts +2 -0
  67. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxIndicator.js → BpkCheckboxV2Indicator.js} +3 -3
  68. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Label.d.ts +6 -0
  69. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxLabel.js → BpkCheckboxV2Label.js} +3 -3
  70. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Root.d.ts +16 -0
  71. package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxRoot.js → BpkCheckboxV2Root.js} +3 -3
  72. package/bpk-component-checkbox-card/src/BpkCheckboxCard.module.css +1 -1
  73. package/bpk-component-icon/scripts/generate-figma-connect.js +267 -0
  74. package/bpk-component-inset-banner/index.d.ts +4 -1
  75. package/bpk-component-inset-banner/index.js +2 -1
  76. package/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.d.ts +56 -0
  77. package/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.js +118 -0
  78. package/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.module.css +18 -0
  79. package/bpk-component-layout/src/BpkProvider.d.ts +9 -4
  80. package/bpk-component-layout/src/BpkProvider.js +87 -8
  81. package/bpk-component-layout/src/types.d.ts +2 -2
  82. package/bpk-component-link/src/common-types.d.ts +1 -1
  83. package/bpk-component-modal/index.d.ts +2 -1
  84. package/bpk-component-modal/index.js +2 -1
  85. package/bpk-component-modal/src/BpkModalV3/BpkModalV3.d.ts +14 -0
  86. package/bpk-component-modal/src/BpkModalV3/BpkModalV3.js +43 -0
  87. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Body/BpkModalV3Body.d.ts +7 -0
  88. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Body/BpkModalV3Body.js +30 -0
  89. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Body.module.css +18 -0
  90. package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.d.ts +7 -0
  91. package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.js +49 -0
  92. package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger.module.css +18 -0
  93. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.d.ts +7 -0
  94. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.js +38 -0
  95. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content.module.css +18 -0
  96. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Context.d.ts +3 -0
  97. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Context.js +22 -0
  98. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Description/BpkModalV3Description.d.ts +7 -0
  99. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Description/BpkModalV3Description.js +28 -0
  100. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Header/BpkModalV3Header.d.ts +7 -0
  101. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Header/BpkModalV3Header.js +34 -0
  102. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Header.module.css +18 -0
  103. package/bpk-component-modal/src/BpkModalV3/BpkModalV3HeroImage/BpkModalV3HeroImage.d.ts +10 -0
  104. package/bpk-component-modal/src/BpkModalV3/BpkModalV3HeroImage/BpkModalV3HeroImage.js +44 -0
  105. package/bpk-component-modal/src/BpkModalV3/BpkModalV3HeroImage.module.css +18 -0
  106. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Portal/BpkModalV3Portal.d.ts +7 -0
  107. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Portal/BpkModalV3Portal.js +26 -0
  108. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/BpkModalV3Root.d.ts +13 -0
  109. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/BpkModalV3Root.js +44 -0
  110. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.d.ts +2 -0
  111. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.js +32 -0
  112. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim.module.css +18 -0
  113. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title/BpkModalV3Title.d.ts +7 -0
  114. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title/BpkModalV3Title.js +31 -0
  115. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title.module.css +18 -0
  116. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Trigger/BpkModalV3Trigger.d.ts +8 -0
  117. package/bpk-component-modal/src/BpkModalV3/BpkModalV3Trigger/BpkModalV3Trigger.js +30 -0
  118. package/bpk-component-modal/src/BpkModalV3/common-types.d.ts +1 -0
  119. package/bpk-component-modal/src/BpkModalV3/common-types.js +1 -0
  120. package/bpk-component-page-indicator/src/NavButton.d.ts +2 -1
  121. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.js +37 -16
  122. package/bpk-component-skeleton/src/BpkBaseSkeleton.d.d.ts +1 -0
  123. package/bpk-component-skeleton/src/BpkSkeleton.d.d.ts +1 -0
  124. package/bpk-component-table/index.d.ts +2 -1
  125. package/bpk-component-table/index.js +2 -1
  126. package/bpk-component-table/src/BpkTable.module.css +1 -1
  127. package/bpk-component-table/src/BpkTableBody.d.ts +4 -1
  128. package/bpk-component-table/src/BpkTableBody.js +19 -4
  129. package/bpk-component-table/src/common-types.d.ts +5 -0
  130. package/bpk-component-table/src/common-types.js +22 -0
  131. package/bpk-react-utils/src/Portal.d.ts +1 -1
  132. package/package.json +2 -2
  133. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckbox.d.ts +0 -9
  134. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxControl.d.ts +0 -6
  135. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxDescription.d.ts +0 -6
  136. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxHiddenInput.d.ts +0 -2
  137. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxIndicator.d.ts +0 -2
  138. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxLabel.d.ts +0 -6
  139. package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxRoot.d.ts +0 -16
  140. /package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckbox.module.css → BpkCheckboxV2.module.css} +0 -0
@@ -0,0 +1,14 @@
1
+ declare const BpkModalV3: {
2
+ Root: ({ children, onOpenChange, open, type, }: import("./BpkModalV3Root/BpkModalV3Root").BpkModalV3RootProps) => import("react/jsx-runtime").JSX.Element;
3
+ Trigger: ({ asChild, children, }: import("./BpkModalV3Trigger/BpkModalV3Trigger").BpkModalV3TriggerProps) => import("react/jsx-runtime").JSX.Element;
4
+ Portal: ({ children }: import("./BpkModalV3Portal/BpkModalV3Portal").BpkModalV3PortalProps) => import("react/jsx-runtime").JSX.Element;
5
+ Scrim: () => import("react/jsx-runtime").JSX.Element;
6
+ Content: ({ children }: import("./BpkModalV3Content/BpkModalV3Content").BpkModalV3ContentProps) => import("react/jsx-runtime").JSX.Element;
7
+ Header: ({ children }: import("./BpkModalV3Header/BpkModalV3Header").BpkModalV3HeaderProps) => import("react/jsx-runtime").JSX.Element;
8
+ Title: ({ children }: import("./BpkModalV3Title/BpkModalV3Title").BpkModalV3TitleProps) => import("react/jsx-runtime").JSX.Element;
9
+ Description: ({ children }: import("./BpkModalV3Description/BpkModalV3Description").BpkModalV3DescriptionProps) => import("react/jsx-runtime").JSX.Element;
10
+ Body: ({ children }: import("./BpkModalV3Body/BpkModalV3Body").BpkModalV3BodyProps) => import("react/jsx-runtime").JSX.Element;
11
+ HeroImage: ({ alt, children, height, src, }: import("./BpkModalV3HeroImage/BpkModalV3HeroImage").BpkModalV3HeroImageProps) => import("react/jsx-runtime").JSX.Element;
12
+ CloseTrigger: ({ label, onImage, }: import("./BpkModalV3CloseTrigger/BpkModalV3CloseTrigger").BpkModalV3CloseTriggerProps) => import("react/jsx-runtime").JSX.Element;
13
+ };
14
+ export default BpkModalV3;
@@ -0,0 +1,43 @@
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 BpkModalV3Body from "./BpkModalV3Body/BpkModalV3Body";
20
+ import BpkModalV3CloseTrigger from "./BpkModalV3CloseTrigger/BpkModalV3CloseTrigger";
21
+ import BpkModalV3Content from "./BpkModalV3Content/BpkModalV3Content";
22
+ import BpkModalV3Description from "./BpkModalV3Description/BpkModalV3Description";
23
+ import BpkModalV3Header from "./BpkModalV3Header/BpkModalV3Header";
24
+ import BpkModalV3HeroImage from "./BpkModalV3HeroImage/BpkModalV3HeroImage";
25
+ import BpkModalV3Portal from "./BpkModalV3Portal/BpkModalV3Portal";
26
+ import BpkModalV3Root from "./BpkModalV3Root/BpkModalV3Root";
27
+ import BpkModalV3Scrim from "./BpkModalV3Scrim/BpkModalV3Scrim";
28
+ import BpkModalV3Title from "./BpkModalV3Title/BpkModalV3Title";
29
+ import BpkModalV3Trigger from "./BpkModalV3Trigger/BpkModalV3Trigger";
30
+ const BpkModalV3 = {
31
+ Root: BpkModalV3Root,
32
+ Trigger: BpkModalV3Trigger,
33
+ Portal: BpkModalV3Portal,
34
+ Scrim: BpkModalV3Scrim,
35
+ Content: BpkModalV3Content,
36
+ Header: BpkModalV3Header,
37
+ Title: BpkModalV3Title,
38
+ Description: BpkModalV3Description,
39
+ Body: BpkModalV3Body,
40
+ HeroImage: BpkModalV3HeroImage,
41
+ CloseTrigger: BpkModalV3CloseTrigger
42
+ };
43
+ export default BpkModalV3;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3BodyProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const BpkModalV3Body: ({ children }: BpkModalV3BodyProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3Body;
7
+ export type { BpkModalV3BodyProps };
@@ -0,0 +1,30 @@
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 { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
20
+ import STYLES from "./BpkModalV3Body.module.css";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ const getClassName = cssModules(STYLES);
23
+ const BpkModalV3Body = ({
24
+ children
25
+ }) => /*#__PURE__*/_jsx("div", {
26
+ className: getClassName('bpk-modal-v3__body'),
27
+ ...getDataComponentAttribute('ModalV3Body'),
28
+ children: children
29
+ });
30
+ export default BpkModalV3Body;
@@ -0,0 +1,18 @@
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-modal-v3__body{flex:1;overflow-y:auto}
@@ -0,0 +1,7 @@
1
+ type BpkModalV3CloseTriggerProps = {
2
+ label: string;
3
+ onImage?: boolean;
4
+ };
5
+ declare const BpkModalV3CloseTrigger: ({ label, onImage, }: BpkModalV3CloseTriggerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3CloseTrigger;
7
+ export type { BpkModalV3CloseTriggerProps };
@@ -0,0 +1,49 @@
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 { Dialog } from '@ark-ui/react';
20
+
21
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
+ import BpkCloseButton from "../../../../bpk-component-close-button";
23
+ import CloseIcon from "../../../../bpk-component-icon/sm/close";
24
+ import { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
25
+ import STYLES from "./BpkModalV3CloseTrigger.module.css";
26
+ import { jsx as _jsx } from "react/jsx-runtime";
27
+ const getClassName = cssModules(STYLES);
28
+ const BpkModalV3CloseTrigger = ({
29
+ label,
30
+ onImage = false
31
+ }) => {
32
+ if (onImage) {
33
+ return /*#__PURE__*/_jsx(Dialog.CloseTrigger, {
34
+ className: getClassName('bpk-modal-v3__close-trigger--on-image'),
35
+ "aria-label": label,
36
+ ...getDataComponentAttribute('ModalV3CloseTrigger'),
37
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
38
+ });
39
+ }
40
+ return /*#__PURE__*/_jsx(Dialog.CloseTrigger, {
41
+ asChild: true,
42
+ children: /*#__PURE__*/_jsx(BpkCloseButton, {
43
+ label: label,
44
+ onClick: () => {},
45
+ ...getDataComponentAttribute('ModalV3CloseTrigger')
46
+ })
47
+ });
48
+ };
49
+ export default BpkModalV3CloseTrigger;
@@ -0,0 +1,18 @@
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-modal-v3__close-trigger--on-image{position:absolute;top:1rem;display:flex;width:2.5rem;height:2.5rem;padding:.75rem;justify-content:center;align-items:center;flex-shrink:0;border:none;border-radius:1.5rem;outline:none;background-color:hsla(0,0%,100%,.5);color:#161616;cursor:pointer;inset-inline-end:1.5rem}.bpk-modal-v3__close-trigger--on-image:focus-visible{outline:.125rem solid #0062e3;outline-offset:.125rem}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3ContentProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const BpkModalV3Content: ({ children }: BpkModalV3ContentProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3Content;
7
+ export type { BpkModalV3ContentProps };
@@ -0,0 +1,38 @@
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 { Dialog } from '@ark-ui/react';
20
+ import { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
21
+ import { useModalType } from "../BpkModalV3Context";
22
+ import STYLES from "./BpkModalV3Content.module.css";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ const getClassName = cssModules(STYLES);
25
+ const BpkModalV3Content = ({
26
+ children
27
+ }) => {
28
+ const type = useModalType();
29
+ return /*#__PURE__*/_jsx(Dialog.Positioner, {
30
+ className: getClassName('bpk-modal-v3__positioner', `bpk-modal-v3__positioner--${type}`),
31
+ children: /*#__PURE__*/_jsx(Dialog.Content, {
32
+ className: getClassName('bpk-modal-v3__content', `bpk-modal-v3__content--${type}`),
33
+ ...getDataComponentAttribute('ModalV3Content'),
34
+ children: children
35
+ })
36
+ });
37
+ };
38
+ export default BpkModalV3Content;
@@ -0,0 +1,18 @@
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-modal-v3__positioner{position:fixed;display:flex;z-index:1100;justify-content:center;align-items:center;inset:0;pointer-events:none}.bpk-modal-v3__positioner--sheet{align-items:flex-end}.bpk-modal-v3__positioner--full{align-items:stretch}.bpk-modal-v3__content{position:relative;display:flex;flex-direction:column;background-color:#fff;overflow:clip;pointer-events:none}.bpk-modal-v3__content[data-state=open]{pointer-events:auto}.bpk-modal-v3__content--default{width:100%;max-width:50rem;max-height:90vh;transform:scale(0.9);transition:transform 200ms ease-in-out;border-radius:1.5rem;opacity:0;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}@media(max-width: 32rem){.bpk-modal-v3__content--default{max-width:none;height:100%;max-height:none;transform:translateY(100%);border-radius:0;box-shadow:none}.bpk-modal-v3__content--default[data-state=open]{transform:translateY(0)}.bpk-modal-v3__content--default[data-state=closed]{transform:translateY(100%)}}.bpk-modal-v3__content--default[data-state=open]{transform:scale(1);opacity:1}.bpk-modal-v3__content--default[data-state=closed]{transform:scale(0.9);opacity:0}.bpk-modal-v3__content--sheet{width:100%;height:fit-content;max-height:100dvh;transform:translateY(100%);transition:opacity 400ms cubic-bezier(0.5, 0, 0, 1),transform 400ms cubic-bezier(0.5, 0, 0, 1);border-radius:1.5rem 1.5rem 0 0;opacity:0;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}.bpk-modal-v3__content--sheet[data-state=open]{transform:translateY(0);opacity:1}.bpk-modal-v3__content--sheet[data-state=closed]{transform:translateY(100%);opacity:0}.bpk-modal-v3__content--full{width:100%;height:100%;transform:translateY(100%);transition:opacity 400ms cubic-bezier(0.5, 0, 0, 1),transform 400ms cubic-bezier(0.5, 0, 0, 1);border-radius:0;opacity:0}.bpk-modal-v3__content--full[data-state=open]{transform:translateY(0);opacity:1}.bpk-modal-v3__content--full[data-state=closed]{transform:translateY(100%);opacity:0}@media(prefers-reduced-motion: reduce){.bpk-modal-v3__content--default{transform:scale(1);transition:none;opacity:1}}@media(prefers-reduced-motion: reduce)and (max-width: 32rem){.bpk-modal-v3__content--default{transform:translateY(0)}}@media(prefers-reduced-motion: reduce){.bpk-modal-v3__content--sheet,.bpk-modal-v3__content--full{transform:translateY(0);transition:none;opacity:1}}
@@ -0,0 +1,3 @@
1
+ import type { BpkModalV3Type } from './common-types';
2
+ export declare const useModalType: () => BpkModalV3Type;
3
+ export declare const ModalTypeProvider: import("react").Provider<BpkModalV3Type>;
@@ -0,0 +1,22 @@
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 { createContext, useContext } from 'react';
20
+ const BpkModalV3Context = /*#__PURE__*/createContext('default');
21
+ export const useModalType = () => useContext(BpkModalV3Context);
22
+ export const ModalTypeProvider = BpkModalV3Context.Provider;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3DescriptionProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const BpkModalV3Description: ({ children }: BpkModalV3DescriptionProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3Description;
7
+ export type { BpkModalV3DescriptionProps };
@@ -0,0 +1,28 @@
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 { Dialog } from '@ark-ui/react';
20
+ import { getDataComponentAttribute } from "../../../../bpk-react-utils";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ const BpkModalV3Description = ({
23
+ children
24
+ }) => /*#__PURE__*/_jsx(Dialog.Description, {
25
+ ...getDataComponentAttribute('ModalV3Description'),
26
+ children: children
27
+ });
28
+ export default BpkModalV3Description;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3HeaderProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const BpkModalV3Header: ({ children }: BpkModalV3HeaderProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3Header;
7
+ export type { BpkModalV3HeaderProps };
@@ -0,0 +1,34 @@
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 { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
20
+ import { useModalType } from "../BpkModalV3Context";
21
+ import STYLES from "./BpkModalV3Header.module.css";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ const getClassName = cssModules(STYLES);
24
+ const BpkModalV3Header = ({
25
+ children
26
+ }) => {
27
+ const type = useModalType();
28
+ return /*#__PURE__*/_jsx("div", {
29
+ className: getClassName('bpk-modal-v3__header', `bpk-modal-v3__header--${type}`),
30
+ ...getDataComponentAttribute('ModalV3Header'),
31
+ children: children
32
+ });
33
+ };
34
+ export default BpkModalV3Header;
@@ -0,0 +1,18 @@
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-modal-v3__header{display:flex;padding:1.5rem;align-items:flex-start;flex-shrink:0;gap:.25rem}.bpk-modal-v3__header--sheet,.bpk-modal-v3__header--full{padding-bottom:1rem}
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3HeroImageProps = {
3
+ src: string;
4
+ alt: string;
5
+ height?: string;
6
+ children?: ReactNode;
7
+ };
8
+ declare const BpkModalV3HeroImage: ({ alt, children, height, src, }: BpkModalV3HeroImageProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default BpkModalV3HeroImage;
10
+ export type { BpkModalV3HeroImageProps };
@@ -0,0 +1,44 @@
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 { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
20
+ import STYLES from "./BpkModalV3HeroImage.module.css";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const getClassName = cssModules(STYLES);
23
+ const BpkModalV3HeroImage = ({
24
+ alt,
25
+ children,
26
+ height,
27
+ src
28
+ }) => {
29
+ const style = height ? {
30
+ height,
31
+ flex: 'none'
32
+ } : undefined;
33
+ return /*#__PURE__*/_jsxs("div", {
34
+ className: getClassName('bpk-modal-v3__hero-image'),
35
+ style: style,
36
+ ...getDataComponentAttribute('ModalV3HeroImage'),
37
+ children: [/*#__PURE__*/_jsx("img", {
38
+ src: src,
39
+ alt: alt,
40
+ className: getClassName('bpk-modal-v3__hero-image-img')
41
+ }), children]
42
+ });
43
+ };
44
+ export default BpkModalV3HeroImage;
@@ -0,0 +1,18 @@
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-modal-v3__hero-image{position:relative;flex:1;overflow:hidden}.bpk-modal-v3__hero-image-img{position:absolute;width:100%;height:100%;inset:0;object-fit:cover}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3PortalProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const BpkModalV3Portal: ({ children }: BpkModalV3PortalProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3Portal;
7
+ export type { BpkModalV3PortalProps };
@@ -0,0 +1,26 @@
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 { Portal } from '@ark-ui/react';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkModalV3Portal = ({
22
+ children
23
+ }) => /*#__PURE__*/_jsx(Portal, {
24
+ children: children
25
+ });
26
+ export default BpkModalV3Portal;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { BpkModalV3Type } from '../common-types';
3
+ type BpkModalV3RootProps = {
4
+ children: ReactNode;
5
+ open?: boolean;
6
+ onOpenChange?: (details: {
7
+ open: boolean;
8
+ }) => void;
9
+ type?: BpkModalV3Type;
10
+ };
11
+ declare const BpkModalV3Root: ({ children, onOpenChange, open, type, }: BpkModalV3RootProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default BpkModalV3Root;
13
+ export type { BpkModalV3RootProps };
@@ -0,0 +1,44 @@
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 { Dialog } from '@ark-ui/react';
20
+ import { getDataComponentAttribute } from "../../../../bpk-react-utils";
21
+ import { ModalTypeProvider } from "../BpkModalV3Context";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ const BpkModalV3Root = ({
24
+ children,
25
+ onOpenChange,
26
+ open,
27
+ type = 'default'
28
+ }) => /*#__PURE__*/_jsx(Dialog.Root, {
29
+ ...(open !== undefined && {
30
+ open
31
+ }),
32
+ ...(onOpenChange !== undefined && {
33
+ onOpenChange
34
+ }),
35
+ children: /*#__PURE__*/_jsx(ModalTypeProvider, {
36
+ value: type,
37
+ children: /*#__PURE__*/_jsx("div", {
38
+ "data-type": type,
39
+ ...getDataComponentAttribute('ModalV3'),
40
+ children: children
41
+ })
42
+ })
43
+ });
44
+ export default BpkModalV3Root;
@@ -0,0 +1,2 @@
1
+ declare const BpkModalV3Scrim: () => import("react/jsx-runtime").JSX.Element;
2
+ export default BpkModalV3Scrim;
@@ -0,0 +1,32 @@
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 { Dialog } from '@ark-ui/react';
20
+ import { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
21
+ import { useModalType } from "../BpkModalV3Context";
22
+ import STYLES from "./BpkModalV3Scrim.module.css";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ const getClassName = cssModules(STYLES);
25
+ const BpkModalV3Scrim = () => {
26
+ const type = useModalType();
27
+ return /*#__PURE__*/_jsx(Dialog.Backdrop, {
28
+ className: getClassName('bpk-modal-v3__scrim', type === 'full' && 'bpk-modal-v3__scrim--full'),
29
+ ...getDataComponentAttribute('ModalV3Scrim')
30
+ });
31
+ };
32
+ export default BpkModalV3Scrim;
@@ -0,0 +1,18 @@
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-modal-v3__scrim{position:fixed;z-index:1100;transition:opacity 200ms ease-in-out;background-color:rgba(0,0,0,.7);opacity:0;inset:0;pointer-events:none}.bpk-modal-v3__scrim[data-state=open]{opacity:1;pointer-events:auto}.bpk-modal-v3__scrim[data-state=closed]{opacity:0}.bpk-modal-v3__scrim--full{display:none}@media(prefers-reduced-motion: reduce){.bpk-modal-v3__scrim{transition:none}}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ type BpkModalV3TitleProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const BpkModalV3Title: ({ children }: BpkModalV3TitleProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default BpkModalV3Title;
7
+ export type { BpkModalV3TitleProps };