@skyscanner/backpack-web 42.1.0 → 42.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bpk-component-banner-alert/src/BpkBannerAlert.js +0 -7
- package/bpk-component-breakpoint/src/BpkBreakpoint.js +3 -1
- package/bpk-component-calendar/src/utils.js +1 -1
- package/bpk-component-card/index.d.ts +4 -1
- package/bpk-component-card/index.js +3 -1
- package/bpk-component-card/src/BpkCardV2/BpkCardV2.d.ts +27 -0
- package/bpk-component-card/src/BpkCardV2/BpkCardV2.js +57 -0
- package/bpk-component-card/src/BpkCardV2/BpkCardV2.module.css +18 -0
- package/bpk-component-card/src/BpkCardV2/common-types.d.ts +124 -0
- package/bpk-component-card/src/BpkCardV2/common-types.js +102 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Body.d.ts +36 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Body.js +65 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Divider.d.ts +13 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Divider.js +37 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Footer.d.ts +24 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Footer.js +60 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Header.d.ts +24 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Header.js +60 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Root.d.ts +28 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Root.js +68 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Section.d.ts +22 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/Section.js +53 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/resolveDirectionalPadding.d.ts +16 -0
- package/bpk-component-card/src/BpkCardV2/subcomponents/resolveDirectionalPadding.js +32 -0
- package/bpk-component-card-list/src/BpkCardList.module.css +1 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +3 -3
- package/bpk-component-chat-bubble/index.d.ts +4 -0
- package/bpk-component-chat-bubble/index.js +21 -0
- package/bpk-component-chat-bubble/src/BpkChatBubble.d.ts +3 -0
- package/bpk-component-chat-bubble/src/BpkChatBubble.js +107 -0
- package/bpk-component-chat-bubble/src/BpkChatBubble.module.css +18 -0
- package/bpk-component-chat-bubble/src/common-types.d.ts +55 -0
- package/bpk-component-chat-bubble/src/common-types.js +29 -0
- package/bpk-component-chatbot-input/index.d.ts +7 -0
- package/bpk-component-chatbot-input/index.js +23 -0
- package/bpk-component-chatbot-input/src/BpkChatbotInput.d.ts +4 -0
- package/bpk-component-chatbot-input/src/BpkChatbotInput.js +118 -0
- package/bpk-component-chatbot-input/src/BpkChatbotInput.module.css +18 -0
- package/bpk-component-chatbot-input/src/InputField/InputField.d.ts +3 -0
- package/bpk-component-chatbot-input/src/InputField/InputField.js +82 -0
- package/bpk-component-chatbot-input/src/InputField/InputField.module.css +18 -0
- package/bpk-component-chatbot-input/src/SendButton/SendButton.d.ts +9 -0
- package/bpk-component-chatbot-input/src/SendButton/SendButton.js +47 -0
- package/bpk-component-chatbot-input/src/TextAreaField/TextAreaField.d.ts +10 -0
- package/bpk-component-chatbot-input/src/TextAreaField/TextAreaField.js +93 -0
- package/bpk-component-chatbot-input/src/TextAreaField/TextAreaField.module.css +18 -0
- package/bpk-component-chatbot-input/src/common-types.d.ts +37 -0
- package/bpk-component-chatbot-input/src/common-types.js +23 -0
- package/bpk-component-chatbot-input/src/constants.d.ts +5 -0
- package/bpk-component-chatbot-input/src/constants.js +22 -0
- package/bpk-component-chatbot-input/src/hooks/index.d.ts +4 -0
- package/bpk-component-chatbot-input/src/hooks/index.js +22 -0
- package/bpk-component-chatbot-input/src/hooks/useChatbotInput.d.ts +32 -0
- package/bpk-component-chatbot-input/src/hooks/useChatbotInput.js +111 -0
- package/bpk-component-chatbot-input/src/hooks/useChatbotInputManager.d.ts +20 -0
- package/bpk-component-chatbot-input/src/hooks/useChatbotInputManager.js +83 -0
- package/bpk-component-chatbot-input/src/hooks/useInputHandlers.d.ts +8 -0
- package/bpk-component-chatbot-input/src/hooks/useInputHandlers.js +54 -0
- package/bpk-component-chatbot-input/src/hooks/useTextAreaAutoResize.d.ts +22 -0
- package/bpk-component-chatbot-input/src/hooks/useTextAreaAutoResize.js +137 -0
- package/bpk-component-chatbot-input/src/themeAttributes.d.ts +14 -0
- package/bpk-component-chatbot-input/src/themeAttributes.js +34 -0
- package/bpk-component-checkbox/index.d.ts +8 -8
- package/bpk-component-checkbox/index.js +3 -3
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2.d.ts +9 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckbox.js → BpkCheckboxV2.js} +14 -14
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Control.d.ts +6 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxControl.js → BpkCheckboxV2Control.js} +3 -3
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Description.d.ts +6 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxDescription.js → BpkCheckboxV2Description.js} +3 -3
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2HiddenInput.d.ts +2 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxHiddenInput.js → BpkCheckboxV2HiddenInput.js} +2 -2
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Indicator.d.ts +2 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxIndicator.js → BpkCheckboxV2Indicator.js} +3 -3
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Label.d.ts +6 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxLabel.js → BpkCheckboxV2Label.js} +3 -3
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Root.d.ts +16 -0
- package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckboxRoot.js → BpkCheckboxV2Root.js} +3 -3
- package/bpk-component-checkbox-card/src/BpkCheckboxCard.module.css +1 -1
- package/bpk-component-floating-notification/index.d.ts +2 -1
- package/bpk-component-floating-notification/index.js +2 -1
- package/bpk-component-floating-notification/src/BpkFloatingNotification.d.ts +5 -0
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +8 -2
- package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +1 -1
- package/bpk-component-icon/scripts/generate-figma-connect.js +267 -0
- package/bpk-component-info-banner/src/BpkInfoBanner.module.css +1 -1
- package/bpk-component-info-banner/src/BpkInfoBannerInner.js +8 -3
- package/bpk-component-info-banner/src/common-types.d.ts +1 -0
- package/bpk-component-info-banner/src/common-types.js +2 -1
- package/bpk-component-inset-banner/index.d.ts +4 -1
- package/bpk-component-inset-banner/index.js +2 -1
- package/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.d.ts +56 -0
- package/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.js +118 -0
- package/bpk-component-inset-banner/src/BpkInsetBannerV3/BpkInsetBannerV3.module.css +18 -0
- package/bpk-component-layout/src/BpkProvider.d.ts +9 -4
- package/bpk-component-layout/src/BpkProvider.js +87 -8
- package/bpk-component-layout/src/types.d.ts +2 -2
- package/bpk-component-link/src/common-types.d.ts +1 -1
- package/bpk-component-modal/index.d.ts +3 -1
- package/bpk-component-modal/index.js +3 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3.d.ts +14 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3.js +43 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Body/BpkModalV3Body.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Body/BpkModalV3Body.js +30 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Body/BpkModalV3Body.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.js +49 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.js +38 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Context.d.ts +3 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Context.js +22 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Description/BpkModalV3Description.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Description/BpkModalV3Description.js +28 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Header/BpkModalV3Header.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Header/BpkModalV3Header.js +34 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Header/BpkModalV3Header.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3HeroImage/BpkModalV3HeroImage.d.ts +10 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3HeroImage/BpkModalV3HeroImage.js +44 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3HeroImage/BpkModalV3HeroImage.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Portal/BpkModalV3Portal.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Portal/BpkModalV3Portal.js +26 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/BpkModalV3Root.d.ts +13 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/BpkModalV3Root.js +67 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/useBodyLock.d.ts +9 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/useBodyLock.js +69 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.d.ts +2 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.js +32 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title/BpkModalV3Title.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title/BpkModalV3Title.js +31 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title/BpkModalV3Title.module.css +18 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Trigger/BpkModalV3Trigger.d.ts +8 -0
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Trigger/BpkModalV3Trigger.js +30 -0
- package/bpk-component-modal/src/BpkModalV3/common-types.d.ts +7 -0
- package/bpk-component-modal/src/BpkModalV3/common-types.js +24 -0
- package/bpk-component-page-indicator/src/NavButton.d.ts +2 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.js +37 -16
- package/bpk-component-skeleton/src/BpkBaseSkeleton.d.d.ts +1 -0
- package/bpk-component-skeleton/src/BpkSkeleton.d.d.ts +1 -0
- package/bpk-component-table/index.d.ts +2 -1
- package/bpk-component-table/index.js +2 -1
- package/bpk-component-table/src/BpkTable.module.css +1 -1
- package/bpk-component-table/src/BpkTableBody.d.ts +4 -1
- package/bpk-component-table/src/BpkTableBody.js +19 -4
- package/bpk-component-table/src/common-types.d.ts +5 -0
- package/bpk-component-table/src/common-types.js +22 -0
- package/bpk-react-utils/src/Portal.d.ts +1 -1
- package/package.json +2 -2
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckbox.d.ts +0 -9
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxControl.d.ts +0 -6
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxDescription.d.ts +0 -6
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxHiddenInput.d.ts +0 -2
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxIndicator.d.ts +0 -2
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxLabel.d.ts +0 -6
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxRoot.d.ts +0 -16
- /package/bpk-component-checkbox/src/BpkCheckboxV2/{BpkCheckbox.module.css → BpkCheckboxV2.module.css} +0 -0
|
@@ -19,13 +19,6 @@
|
|
|
19
19
|
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import BpkBannerAlertInner from "./BpkBannerAlertInner";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
const defaultProps = {
|
|
23
|
-
animateOnEnter: false,
|
|
24
|
-
animateOnLeave: false,
|
|
25
|
-
show: true,
|
|
26
|
-
icon: null
|
|
27
|
-
};
|
|
28
|
-
|
|
29
22
|
/**
|
|
30
23
|
* @deprecated use bpk-component-info-banner instead
|
|
31
24
|
* @returns {Component} a banner alert component
|
|
@@ -35,7 +35,9 @@ const useLegacyWarning = (query, legacy, isClient) => useMemo(() => {
|
|
|
35
35
|
if (isClient) {
|
|
36
36
|
// @ts-expect-error invariant check. query: string matching limited BREAKPOINTS string values
|
|
37
37
|
if (!legacy && !Object.values(BREAKPOINTS).includes(query)) {
|
|
38
|
-
console.warn(
|
|
38
|
+
console.warn(
|
|
39
|
+
// eslint-disable-line no-console
|
|
40
|
+
`Invalid query ${query}. Use one of the supported queries or pass the legacy prop.`);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}, [isClient, legacy, query]);
|
|
@@ -23,7 +23,7 @@ const splitToken = value => {
|
|
|
23
23
|
if (!match) {
|
|
24
24
|
throw new Error(`Invalid token value. Expecting a valid css unit, got ${value}`);
|
|
25
25
|
}
|
|
26
|
-
const [
|
|
26
|
+
const [, val, unit] = match;
|
|
27
27
|
return [parseFloat(val), unit];
|
|
28
28
|
};
|
|
29
29
|
export const getCalendarGridWidth = (multiplier = 1) => {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import BpkCard from './src/BpkCard';
|
|
2
|
+
import BpkCardV2 from './src/BpkCardV2/BpkCardV2';
|
|
2
3
|
import BpkCardWrapper from './src/BpkCardWrapper';
|
|
3
4
|
import BpkDividedCard, { ORIENTATION } from './src/BpkDividedCard';
|
|
4
|
-
export {
|
|
5
|
+
export type { BpkCardV2Props, BpkCardV2HeaderProps, BpkCardV2BodyProps, BpkCardV2SectionProps, BpkCardV2FooterProps, BpkCardV2SurfaceColor, BpkCardV2Variant, BpkCardV2Namespace, } from './src/BpkCardV2/common-types';
|
|
6
|
+
export { CARD_V2_SURFACE_COLORS, CARD_V2_VARIANTS } from './src/BpkCardV2/common-types';
|
|
7
|
+
export { ORIENTATION, BpkDividedCard, BpkCardWrapper, BpkCardV2 };
|
|
5
8
|
export default BpkCard;
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import BpkCard from "./src/BpkCard";
|
|
20
|
+
import BpkCardV2 from "./src/BpkCardV2/BpkCardV2";
|
|
20
21
|
import BpkCardWrapper from "./src/BpkCardWrapper";
|
|
21
22
|
import BpkDividedCard, { ORIENTATION } from "./src/BpkDividedCard";
|
|
22
|
-
export {
|
|
23
|
+
export { CARD_V2_SURFACE_COLORS, CARD_V2_VARIANTS } from "./src/BpkCardV2/common-types";
|
|
24
|
+
export { ORIENTATION, BpkDividedCard, BpkCardWrapper, BpkCardV2 };
|
|
23
25
|
export default BpkCard;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BpkCardV2Namespace } from './common-types';
|
|
2
|
+
/**
|
|
3
|
+
* BpkCardV2 is a composable, responsive card component namespace for Backpack.
|
|
4
|
+
*
|
|
5
|
+
* It provides subcomponents for explicit multi-section composition (Root, Header, Body, Footer),
|
|
6
|
+
* flexible multi-column layouts (Section/Divider), and customizable surface colors.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Basic card
|
|
10
|
+
* <BpkCardV2.Root>
|
|
11
|
+
* <BpkCardV2.Header>Title</BpkCardV2.Header>
|
|
12
|
+
* <BpkCardV2.Body>Content</BpkCardV2.Body>
|
|
13
|
+
* <BpkCardV2.Footer>Footer</BpkCardV2.Footer>
|
|
14
|
+
* </BpkCardV2.Root>
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Multi-column layout (70/30 on desktop, stacked on mobile)
|
|
18
|
+
* <BpkCardV2.Root bgColor={CARD_V2_SURFACE_COLORS.surfaceElevated}>
|
|
19
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '7fr auto 3fr' }}>
|
|
20
|
+
* <BpkCardV2.Section>Main content</BpkCardV2.Section>
|
|
21
|
+
* <BpkCardV2.Divider />
|
|
22
|
+
* <BpkCardV2.Section>Sidebar</BpkCardV2.Section>
|
|
23
|
+
* </BpkCardV2.Body>
|
|
24
|
+
* </BpkCardV2.Root>
|
|
25
|
+
*/
|
|
26
|
+
declare const BpkCardV2: BpkCardV2Namespace;
|
|
27
|
+
export default BpkCardV2;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 Body from "./subcomponents/Body";
|
|
20
|
+
import Divider from "./subcomponents/Divider";
|
|
21
|
+
import Footer from "./subcomponents/Footer";
|
|
22
|
+
import Header from "./subcomponents/Header";
|
|
23
|
+
import Root from "./subcomponents/Root";
|
|
24
|
+
import Section from "./subcomponents/Section";
|
|
25
|
+
/**
|
|
26
|
+
* BpkCardV2 is a composable, responsive card component namespace for Backpack.
|
|
27
|
+
*
|
|
28
|
+
* It provides subcomponents for explicit multi-section composition (Root, Header, Body, Footer),
|
|
29
|
+
* flexible multi-column layouts (Section/Divider), and customizable surface colors.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Basic card
|
|
33
|
+
* <BpkCardV2.Root>
|
|
34
|
+
* <BpkCardV2.Header>Title</BpkCardV2.Header>
|
|
35
|
+
* <BpkCardV2.Body>Content</BpkCardV2.Body>
|
|
36
|
+
* <BpkCardV2.Footer>Footer</BpkCardV2.Footer>
|
|
37
|
+
* </BpkCardV2.Root>
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Multi-column layout (70/30 on desktop, stacked on mobile)
|
|
41
|
+
* <BpkCardV2.Root bgColor={CARD_V2_SURFACE_COLORS.surfaceElevated}>
|
|
42
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '7fr auto 3fr' }}>
|
|
43
|
+
* <BpkCardV2.Section>Main content</BpkCardV2.Section>
|
|
44
|
+
* <BpkCardV2.Divider />
|
|
45
|
+
* <BpkCardV2.Section>Sidebar</BpkCardV2.Section>
|
|
46
|
+
* </BpkCardV2.Body>
|
|
47
|
+
* </BpkCardV2.Root>
|
|
48
|
+
*/
|
|
49
|
+
const BpkCardV2 = {
|
|
50
|
+
Root,
|
|
51
|
+
Header,
|
|
52
|
+
Body,
|
|
53
|
+
Section,
|
|
54
|
+
Divider,
|
|
55
|
+
Footer
|
|
56
|
+
};
|
|
57
|
+
export default BpkCardV2;
|
|
@@ -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-card-v2{display:flex;flex-direction:column;flex:1;transition:box-shadow 200ms ease-in-out;background-color:#fff;overflow:hidden;border-radius:.75rem;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-card-v2--surface-default{background-color:#fff}.bpk-card-v2--surface-elevated{background-color:#fff}.bpk-card-v2--surface-hero{background-color:#0062e3}.bpk-card-v2--surface-contrast{background-color:#05203c}.bpk-card-v2--surface-highlight{background-color:#e0e4e9}.bpk-card-v2--surface-subtle{background-color:#e3f0ff}.bpk-card-v2--surface-low-contrast{background-color:#f5f7fa}.bpk-card-v2--surface-tint{background-color:hsla(0,0%,100%,.1)}.bpk-no-touch-support .bpk-card-v2:hover:not(:active):not(:disabled){box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}:global(.bpk-no-touch-support) .bpk-card-v2:hover:not(:active):not(:disabled){box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}.bpk-card-v2--default{cursor:pointer}.bpk-card-v2--outlined{border:1px solid #c1c7cf;box-shadow:none}.bpk-no-touch-support .bpk-card-v2--outlined:hover:not(:active):not(:disabled){box-shadow:none}:global(.bpk-no-touch-support) .bpk-card-v2--outlined:hover:not(:active):not(:disabled){box-shadow:none}.bpk-card-v2--no-elevation{box-shadow:none}.bpk-no-touch-support .bpk-card-v2--no-elevation:hover:not(:active):not(:disabled){box-shadow:none}:global(.bpk-no-touch-support) .bpk-card-v2--no-elevation:hover:not(:active):not(:disabled){box-shadow:none}.bpk-card-v2--cars-prompt{background-color:#f5f7fa;box-shadow:none}.bpk-no-touch-support .bpk-card-v2--cars-prompt:hover:not(:active):not(:disabled){background-color:#e3f0ff;box-shadow:none}:global(.bpk-no-touch-support) .bpk-card-v2--cars-prompt:hover:not(:active):not(:disabled){background-color:#e3f0ff;box-shadow:none}.bpk-card-v2--cars-prompt:active{background-color:#e3f0ff;box-shadow:none}.bpk-card-v2--cars-prompt:focus-visible{background-color:#e3f0ff;box-shadow:none;outline:.125rem solid #0062e3;outline-offset:.125rem}.bpk-card-v2__divider{height:1px;margin:0 .5rem;background-color:#c1c7cf}@media(min-width: 32.0625rem){.bpk-card-v2__divider{width:1px;height:auto;margin:.5rem 0;align-self:stretch}}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, HTMLAttributes, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import type { BpkBoxProps, BpkFlexProps, BpkGridProps } from '../../../bpk-component-layout';
|
|
3
|
+
/** Surface color token options for BpkCardV2 background */
|
|
4
|
+
export declare const CARD_V2_SURFACE_COLORS: {
|
|
5
|
+
readonly surfaceDefault: "surfaceDefault";
|
|
6
|
+
readonly surfaceElevated: "surfaceElevated";
|
|
7
|
+
readonly surfaceTint: "surfaceTint";
|
|
8
|
+
readonly surfaceSubtle: "surfaceSubtle";
|
|
9
|
+
readonly surfaceHero: "surfaceHero";
|
|
10
|
+
readonly surfaceContrast: "surfaceContrast";
|
|
11
|
+
readonly surfaceLowContrast: "surfaceLowContrast";
|
|
12
|
+
readonly surfaceHighlight: "surfaceHighlight";
|
|
13
|
+
};
|
|
14
|
+
export type BpkCardV2SurfaceColor = (typeof CARD_V2_SURFACE_COLORS)[keyof typeof CARD_V2_SURFACE_COLORS];
|
|
15
|
+
/** Visual variant options for BpkCardV2 */
|
|
16
|
+
export declare const CARD_V2_VARIANTS: {
|
|
17
|
+
readonly default: "default";
|
|
18
|
+
readonly outlined: "outlined";
|
|
19
|
+
readonly noElevation: "noElevation";
|
|
20
|
+
readonly carsPrompt: "carsPrompt";
|
|
21
|
+
};
|
|
22
|
+
export type BpkCardV2Variant = (typeof CARD_V2_VARIANTS)[keyof typeof CARD_V2_VARIANTS];
|
|
23
|
+
type BpkCardV2BaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style'> & {
|
|
24
|
+
/** Card content - use Header, Body, Footer subcomponents */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* BpkCardV2 root component props.
|
|
29
|
+
*
|
|
30
|
+
* Composable card component with explicit Header/Body/Footer subcomponents.
|
|
31
|
+
* Supports multiple surface colors, visual variants, and responsive multi-column layouts.
|
|
32
|
+
*
|
|
33
|
+
* Note: `bgColor` is not supported for the `carsPrompt` variant — its background is fixed
|
|
34
|
+
* by design and cannot be customised.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* <BpkCardV2 variant={CARD_V2_VARIANTS.default} bgColor={CARD_V2_SURFACE_COLORS.surfaceDefault}>
|
|
38
|
+
* <BpkCardV2.Header>Title</BpkCardV2.Header>
|
|
39
|
+
* <BpkCardV2.Body>Content</BpkCardV2.Body>
|
|
40
|
+
* <BpkCardV2.Footer>Footer</BpkCardV2.Footer>
|
|
41
|
+
* </BpkCardV2>
|
|
42
|
+
*/
|
|
43
|
+
export type BpkCardV2Props = BpkCardV2BaseProps & ({
|
|
44
|
+
/** Visual variant controlling styling treatment (shadow/border) */
|
|
45
|
+
variant?: Exclude<BpkCardV2Variant, 'carsPrompt'>;
|
|
46
|
+
/** Background surface color token (default: surfaceDefault) */
|
|
47
|
+
bgColor?: BpkCardV2SurfaceColor;
|
|
48
|
+
} | {
|
|
49
|
+
/** Cars prompt variant — bgColor is fixed and cannot be set */
|
|
50
|
+
variant: 'carsPrompt';
|
|
51
|
+
bgColor?: never;
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* BpkCardV2.Header component props.
|
|
55
|
+
*
|
|
56
|
+
* Renders a BpkFlex container positioned at top of card.
|
|
57
|
+
* Defaults to horizontal (row) direction with base padding.
|
|
58
|
+
* All BpkFlex props are supported for layout customisation.
|
|
59
|
+
*/
|
|
60
|
+
export type BpkCardV2HeaderProps = BpkFlexProps;
|
|
61
|
+
/**
|
|
62
|
+
* BpkCardV2.Body component props.
|
|
63
|
+
*
|
|
64
|
+
* Renders card main content area as a BpkGrid container.
|
|
65
|
+
* Defaults to a single-column vertical layout with base padding.
|
|
66
|
+
* Use templateColumns for multi-column layouts. Include `auto` for each Divider child.
|
|
67
|
+
* All BpkGrid props are supported for layout customisation.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // Simple body
|
|
71
|
+
* <BpkCardV2.Body>Content</BpkCardV2.Body>
|
|
72
|
+
*
|
|
73
|
+
* // Multi-column layout with divider (70/30 on desktop, stacked on mobile)
|
|
74
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '7fr auto 3fr' }}>
|
|
75
|
+
* <BpkCardV2.Section>Main content</BpkCardV2.Section>
|
|
76
|
+
* <BpkCardV2.Divider />
|
|
77
|
+
* <BpkCardV2.Section>Sidebar</BpkCardV2.Section>
|
|
78
|
+
* </BpkCardV2.Body>
|
|
79
|
+
*/
|
|
80
|
+
export type BpkCardV2BodyProps = BpkGridProps;
|
|
81
|
+
/**
|
|
82
|
+
* BpkCardV2.Section component props.
|
|
83
|
+
*
|
|
84
|
+
* Generic content area for multi-column layouts. Renders a BpkBox.
|
|
85
|
+
* All BpkBox props are supported for layout customisation.
|
|
86
|
+
*/
|
|
87
|
+
export type BpkCardV2SectionProps = BpkBoxProps;
|
|
88
|
+
/**
|
|
89
|
+
* BpkCardV2.Footer component props.
|
|
90
|
+
*
|
|
91
|
+
* Renders a BpkFlex container positioned at bottom of card.
|
|
92
|
+
* Defaults to horizontal (row) direction with base padding.
|
|
93
|
+
* All BpkFlex props are supported for layout customisation.
|
|
94
|
+
*/
|
|
95
|
+
export type BpkCardV2FooterProps = BpkFlexProps;
|
|
96
|
+
/**
|
|
97
|
+
* BpkCardV2 namespace type.
|
|
98
|
+
*
|
|
99
|
+
* Contains all card subcomponents as properties.
|
|
100
|
+
*/
|
|
101
|
+
export type BpkCardV2Namespace = {
|
|
102
|
+
Root: ForwardRefExoticComponent<BpkCardV2Props & RefAttributes<HTMLDivElement>>;
|
|
103
|
+
Header: {
|
|
104
|
+
(props: BpkCardV2HeaderProps): ReactNode;
|
|
105
|
+
displayName?: string;
|
|
106
|
+
};
|
|
107
|
+
Body: {
|
|
108
|
+
(props: BpkCardV2BodyProps): ReactNode;
|
|
109
|
+
displayName?: string;
|
|
110
|
+
};
|
|
111
|
+
Section: {
|
|
112
|
+
(props: BpkCardV2SectionProps): ReactNode;
|
|
113
|
+
displayName?: string;
|
|
114
|
+
};
|
|
115
|
+
Divider: {
|
|
116
|
+
(): ReactNode;
|
|
117
|
+
displayName?: string;
|
|
118
|
+
};
|
|
119
|
+
Footer: {
|
|
120
|
+
(props: BpkCardV2FooterProps): ReactNode;
|
|
121
|
+
displayName?: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
/** Surface color token options for BpkCardV2 background */
|
|
20
|
+
export const CARD_V2_SURFACE_COLORS = {
|
|
21
|
+
surfaceDefault: 'surfaceDefault',
|
|
22
|
+
surfaceElevated: 'surfaceElevated',
|
|
23
|
+
surfaceTint: 'surfaceTint',
|
|
24
|
+
surfaceSubtle: 'surfaceSubtle',
|
|
25
|
+
surfaceHero: 'surfaceHero',
|
|
26
|
+
surfaceContrast: 'surfaceContrast',
|
|
27
|
+
surfaceLowContrast: 'surfaceLowContrast',
|
|
28
|
+
surfaceHighlight: 'surfaceHighlight'
|
|
29
|
+
};
|
|
30
|
+
/** Visual variant options for BpkCardV2 */
|
|
31
|
+
export const CARD_V2_VARIANTS = {
|
|
32
|
+
default: 'default',
|
|
33
|
+
outlined: 'outlined',
|
|
34
|
+
noElevation: 'noElevation',
|
|
35
|
+
carsPrompt: 'carsPrompt'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* BpkCardV2 root component props.
|
|
40
|
+
*
|
|
41
|
+
* Composable card component with explicit Header/Body/Footer subcomponents.
|
|
42
|
+
* Supports multiple surface colors, visual variants, and responsive multi-column layouts.
|
|
43
|
+
*
|
|
44
|
+
* Note: `bgColor` is not supported for the `carsPrompt` variant — its background is fixed
|
|
45
|
+
* by design and cannot be customised.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* <BpkCardV2 variant={CARD_V2_VARIANTS.default} bgColor={CARD_V2_SURFACE_COLORS.surfaceDefault}>
|
|
49
|
+
* <BpkCardV2.Header>Title</BpkCardV2.Header>
|
|
50
|
+
* <BpkCardV2.Body>Content</BpkCardV2.Body>
|
|
51
|
+
* <BpkCardV2.Footer>Footer</BpkCardV2.Footer>
|
|
52
|
+
* </BpkCardV2>
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* BpkCardV2.Header component props.
|
|
57
|
+
*
|
|
58
|
+
* Renders a BpkFlex container positioned at top of card.
|
|
59
|
+
* Defaults to horizontal (row) direction with base padding.
|
|
60
|
+
* All BpkFlex props are supported for layout customisation.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* BpkCardV2.Body component props.
|
|
65
|
+
*
|
|
66
|
+
* Renders card main content area as a BpkGrid container.
|
|
67
|
+
* Defaults to a single-column vertical layout with base padding.
|
|
68
|
+
* Use templateColumns for multi-column layouts. Include `auto` for each Divider child.
|
|
69
|
+
* All BpkGrid props are supported for layout customisation.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // Simple body
|
|
73
|
+
* <BpkCardV2.Body>Content</BpkCardV2.Body>
|
|
74
|
+
*
|
|
75
|
+
* // Multi-column layout with divider (70/30 on desktop, stacked on mobile)
|
|
76
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '7fr auto 3fr' }}>
|
|
77
|
+
* <BpkCardV2.Section>Main content</BpkCardV2.Section>
|
|
78
|
+
* <BpkCardV2.Divider />
|
|
79
|
+
* <BpkCardV2.Section>Sidebar</BpkCardV2.Section>
|
|
80
|
+
* </BpkCardV2.Body>
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* BpkCardV2.Section component props.
|
|
85
|
+
*
|
|
86
|
+
* Generic content area for multi-column layouts. Renders a BpkBox.
|
|
87
|
+
* All BpkBox props are supported for layout customisation.
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* BpkCardV2.Footer component props.
|
|
92
|
+
*
|
|
93
|
+
* Renders a BpkFlex container positioned at bottom of card.
|
|
94
|
+
* Defaults to horizontal (row) direction with base padding.
|
|
95
|
+
* All BpkFlex props are supported for layout customisation.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* BpkCardV2 namespace type.
|
|
100
|
+
*
|
|
101
|
+
* Contains all card subcomponents as properties.
|
|
102
|
+
*/
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BpkCardV2BodyProps } from '../common-types';
|
|
2
|
+
/**
|
|
3
|
+
* Body subcomponent for BpkCardV2.
|
|
4
|
+
*
|
|
5
|
+
* Renders the main content area of the card as a BpkGrid container.
|
|
6
|
+
* Defaults to a single-column vertical layout with base padding.
|
|
7
|
+
* Use templateColumns for multi-column layouts. Include `auto` for each Divider child.
|
|
8
|
+
* All BpkGrid props can be used to customise the layout.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Simple body
|
|
12
|
+
* <BpkCardV2.Body>Content here</BpkCardV2.Body>
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Multi-column layout
|
|
16
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '1fr 2fr 1fr' }}>
|
|
17
|
+
* <BpkCardV2.Section>Left</BpkCardV2.Section>
|
|
18
|
+
* <BpkCardV2.Section>Center (2x wide)</BpkCardV2.Section>
|
|
19
|
+
* <BpkCardV2.Section>Right</BpkCardV2.Section>
|
|
20
|
+
* </BpkCardV2.Body>
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Multi-column with divider (include auto for the divider)
|
|
24
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '7fr auto 3fr' }}>
|
|
25
|
+
* <BpkCardV2.Section>Main content</BpkCardV2.Section>
|
|
26
|
+
* <BpkCardV2.Divider />
|
|
27
|
+
* <BpkCardV2.Section>Sidebar</BpkCardV2.Section>
|
|
28
|
+
* </BpkCardV2.Body>
|
|
29
|
+
*
|
|
30
|
+
* @returns {JSX.Element} Body component
|
|
31
|
+
*/
|
|
32
|
+
declare const Body: {
|
|
33
|
+
({ children, padding, templateColumns, ...rest }: BpkCardV2BodyProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
export default Body;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { BpkGrid, BpkSpacing } from "../../../../bpk-component-layout";
|
|
20
|
+
import { getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
/**
|
|
23
|
+
* Body subcomponent for BpkCardV2.
|
|
24
|
+
*
|
|
25
|
+
* Renders the main content area of the card as a BpkGrid container.
|
|
26
|
+
* Defaults to a single-column vertical layout with base padding.
|
|
27
|
+
* Use templateColumns for multi-column layouts. Include `auto` for each Divider child.
|
|
28
|
+
* All BpkGrid props can be used to customise the layout.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Simple body
|
|
32
|
+
* <BpkCardV2.Body>Content here</BpkCardV2.Body>
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Multi-column layout
|
|
36
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '1fr 2fr 1fr' }}>
|
|
37
|
+
* <BpkCardV2.Section>Left</BpkCardV2.Section>
|
|
38
|
+
* <BpkCardV2.Section>Center (2x wide)</BpkCardV2.Section>
|
|
39
|
+
* <BpkCardV2.Section>Right</BpkCardV2.Section>
|
|
40
|
+
* </BpkCardV2.Body>
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // Multi-column with divider (include auto for the divider)
|
|
44
|
+
* <BpkCardV2.Body templateColumns={{ base: '1fr', tablet: '7fr auto 3fr' }}>
|
|
45
|
+
* <BpkCardV2.Section>Main content</BpkCardV2.Section>
|
|
46
|
+
* <BpkCardV2.Divider />
|
|
47
|
+
* <BpkCardV2.Section>Sidebar</BpkCardV2.Section>
|
|
48
|
+
* </BpkCardV2.Body>
|
|
49
|
+
*
|
|
50
|
+
* @returns {JSX.Element} Body component
|
|
51
|
+
*/
|
|
52
|
+
const Body = ({
|
|
53
|
+
children,
|
|
54
|
+
padding = BpkSpacing.Base,
|
|
55
|
+
templateColumns = '1fr',
|
|
56
|
+
...rest
|
|
57
|
+
}) => /*#__PURE__*/_jsx(BpkGrid, {
|
|
58
|
+
templateColumns: templateColumns,
|
|
59
|
+
padding: padding,
|
|
60
|
+
...getDataComponentAttribute('CardV2.Body'),
|
|
61
|
+
...rest,
|
|
62
|
+
children: children
|
|
63
|
+
});
|
|
64
|
+
Body.displayName = 'BpkCardV2.Body';
|
|
65
|
+
export default Body;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Divider between Section children in multi-column layout.
|
|
3
|
+
*
|
|
4
|
+
* Renders as a horizontal line on mobile and a vertical line on desktop.
|
|
5
|
+
* Styled via SCSS for breakpoint handling.
|
|
6
|
+
*
|
|
7
|
+
* @returns {JSX.Element} Divider component
|
|
8
|
+
*/
|
|
9
|
+
declare const Divider: {
|
|
10
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default Divider;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 "../BpkCardV2.module.css";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
const getClassName = cssModules(STYLES);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Divider between Section children in multi-column layout.
|
|
26
|
+
*
|
|
27
|
+
* Renders as a horizontal line on mobile and a vertical line on desktop.
|
|
28
|
+
* Styled via SCSS for breakpoint handling.
|
|
29
|
+
*
|
|
30
|
+
* @returns {JSX.Element} Divider component
|
|
31
|
+
*/
|
|
32
|
+
const Divider = () => /*#__PURE__*/_jsx("div", {
|
|
33
|
+
className: getClassName('bpk-card-v2__divider'),
|
|
34
|
+
...getDataComponentAttribute('CardV2.Divider')
|
|
35
|
+
});
|
|
36
|
+
Divider.displayName = 'BpkCardV2.Divider';
|
|
37
|
+
export default Divider;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BpkCardV2FooterProps } from '../common-types';
|
|
2
|
+
/**
|
|
3
|
+
* Footer subcomponent for BpkCardV2.
|
|
4
|
+
*
|
|
5
|
+
* Renders a BpkFlex container positioned at the bottom of the card.
|
|
6
|
+
* Defaults to horizontal (row) direction with base padding on bottom, start
|
|
7
|
+
* and end, and no top padding. All BpkFlex props can be used to customise the layout.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <BpkCardV2.Footer>Footer content</BpkCardV2.Footer>
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <BpkCardV2.Footer justify="flex-end" gap={BpkSpacing.SM}>
|
|
14
|
+
* <BpkButton>Cancel</BpkButton>
|
|
15
|
+
* <BpkButton>Save</BpkButton>
|
|
16
|
+
* </BpkCardV2.Footer>
|
|
17
|
+
*
|
|
18
|
+
* @returns {JSX.Element} Footer component
|
|
19
|
+
*/
|
|
20
|
+
declare const Footer: {
|
|
21
|
+
({ children, padding, paddingBottom, paddingEnd, paddingStart, paddingTop, ...rest }: BpkCardV2FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
export default Footer;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { BpkFlex, BpkSpacing } from "../../../../bpk-component-layout";
|
|
20
|
+
import { getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
|
+
import resolveDirectionalPadding from "./resolveDirectionalPadding";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
/**
|
|
24
|
+
* Footer subcomponent for BpkCardV2.
|
|
25
|
+
*
|
|
26
|
+
* Renders a BpkFlex container positioned at the bottom of the card.
|
|
27
|
+
* Defaults to horizontal (row) direction with base padding on bottom, start
|
|
28
|
+
* and end, and no top padding. All BpkFlex props can be used to customise the layout.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <BpkCardV2.Footer>Footer content</BpkCardV2.Footer>
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <BpkCardV2.Footer justify="flex-end" gap={BpkSpacing.SM}>
|
|
35
|
+
* <BpkButton>Cancel</BpkButton>
|
|
36
|
+
* <BpkButton>Save</BpkButton>
|
|
37
|
+
* </BpkCardV2.Footer>
|
|
38
|
+
*
|
|
39
|
+
* @returns {JSX.Element} Footer component
|
|
40
|
+
*/
|
|
41
|
+
const Footer = ({
|
|
42
|
+
children,
|
|
43
|
+
padding,
|
|
44
|
+
paddingBottom,
|
|
45
|
+
paddingEnd,
|
|
46
|
+
paddingStart,
|
|
47
|
+
paddingTop,
|
|
48
|
+
...rest
|
|
49
|
+
}) => /*#__PURE__*/_jsx(BpkFlex, {
|
|
50
|
+
padding: padding,
|
|
51
|
+
paddingTop: resolveDirectionalPadding(padding, paddingTop, BpkSpacing.None),
|
|
52
|
+
paddingStart: resolveDirectionalPadding(padding, paddingStart, BpkSpacing.Base),
|
|
53
|
+
paddingEnd: resolveDirectionalPadding(padding, paddingEnd, BpkSpacing.Base),
|
|
54
|
+
paddingBottom: resolveDirectionalPadding(padding, paddingBottom, BpkSpacing.Base),
|
|
55
|
+
...getDataComponentAttribute('CardV2.Footer'),
|
|
56
|
+
...rest,
|
|
57
|
+
children: children
|
|
58
|
+
});
|
|
59
|
+
Footer.displayName = 'BpkCardV2.Footer';
|
|
60
|
+
export default Footer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BpkCardV2HeaderProps } from '../common-types';
|
|
2
|
+
/**
|
|
3
|
+
* Header subcomponent for BpkCardV2.
|
|
4
|
+
*
|
|
5
|
+
* Renders a BpkFlex container positioned at the top of the card.
|
|
6
|
+
* Defaults to horizontal (row) direction with base padding on top, start
|
|
7
|
+
* and end, and no bottom padding. All BpkFlex props can be used to customise the layout.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <BpkCardV2.Header>Card title</BpkCardV2.Header>
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <BpkCardV2.Header justify="space-between" align="center">
|
|
14
|
+
* <BpkText>Title</BpkText>
|
|
15
|
+
* <BpkText>Action</BpkText>
|
|
16
|
+
* </BpkCardV2.Header>
|
|
17
|
+
*
|
|
18
|
+
* @returns {JSX.Element} Header component
|
|
19
|
+
*/
|
|
20
|
+
declare const Header: {
|
|
21
|
+
({ children, padding, paddingBottom, paddingEnd, paddingStart, paddingTop, ...rest }: BpkCardV2HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
export default Header;
|