@skyscanner/backpack-web 4.1.0 → 6.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -64
- package/bpk-component-accordion/src/BpkAccordion.js +0 -1
- package/bpk-component-accordion/src/BpkAccordionItem.js +0 -1
- package/bpk-component-accordion/src/withAccordionItemState.js +0 -1
- package/bpk-component-accordion/src/withSingleItemAccordionState.js +0 -1
- package/bpk-component-aria-live/src/BpkAriaLive.js +0 -1
- package/bpk-component-autosuggest/src/BpkAutosuggest.js +1 -2
- package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +0 -1
- package/bpk-component-badge/src/BpkBadge.js +0 -1
- package/bpk-component-banner-alert/src/AnimateAndFade.js +2 -3
- package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +1 -2
- package/bpk-component-banner-alert/src/withBannerAlertState.js +0 -1
- package/bpk-component-barchart/src/BpkBarchart.js +0 -1
- package/bpk-component-barchart/src/BpkBarchartBar.js +1 -2
- package/bpk-component-barchart/src/BpkChartAxis.js +1 -2
- package/bpk-component-barchart/src/BpkChartDataTable.js +0 -1
- package/bpk-component-barchart/src/BpkChartGridLines.js +0 -1
- package/bpk-component-blockquote/src/BpkBlockquote.js +0 -1
- package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +0 -1
- package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +0 -1
- package/bpk-component-button/src/BpkButtonBase.module.css +1 -1
- package/bpk-component-button/src/BpkButtonDestructive.module.css +1 -1
- package/bpk-component-button/src/BpkButtonFeatured.module.css +1 -1
- package/bpk-component-button/src/BpkButtonLink.module.css +1 -1
- package/bpk-component-button/src/BpkButtonLinkOnDark.module.css +18 -0
- package/bpk-component-button/src/BpkButtonPrimaryOnDark.module.css +18 -0
- package/bpk-component-button/src/BpkButtonPrimaryOnLight.module.css +18 -0
- package/bpk-component-button/src/BpkButtonSecondary.module.css +1 -1
- package/bpk-component-button/src/BpkButtonSecondaryOnDark.module.css +18 -0
- package/bpk-component-calendar/src/BpkCalendarContainer.js +0 -1
- package/bpk-component-calendar/src/BpkCalendarDate.js +0 -1
- package/bpk-component-calendar/src/BpkCalendarGrid.js +0 -1
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +0 -1
- package/bpk-component-calendar/src/BpkCalendarGridTransition.js +0 -1
- package/bpk-component-calendar/src/BpkCalendarNav.js +0 -1
- package/bpk-component-calendar/src/Week.js +0 -1
- package/bpk-component-calendar/src/composeCalendar.js +0 -1
- package/bpk-component-card/src/BpkCard.js +0 -1
- package/bpk-component-checkbox/src/BpkCheckbox.js +0 -1
- package/bpk-component-chip/src/BpkDismissibleChip.js +0 -1
- package/bpk-component-chip/src/BpkSelectableChip.js +0 -1
- package/bpk-component-close-button/src/BpkCloseButton.js +0 -1
- package/bpk-component-code/src/BpkCode.js +0 -1
- package/bpk-component-code/src/BpkCodeBlock.js +0 -1
- package/bpk-component-content-container/src/BpkContentContainer.js +0 -1
- package/bpk-component-content-container/src/BpkContentContainer.module.css +1 -1
- package/bpk-component-datatable/src/BpkDataTable.js +1 -2
- package/bpk-component-datatable/src/BpkDataTableColumn.js +0 -1
- package/bpk-component-datatable/src/bpkHeaderRenderer.js +0 -1
- package/bpk-component-datepicker/src/BpkDatepicker.js +16 -15
- package/bpk-component-description-list/src/ComponentFactory.js +0 -1
- package/bpk-component-dialog/src/BpkDialog.js +0 -1
- package/bpk-component-dialog/src/BpkDialogInner.js +0 -1
- package/bpk-component-dialog/src/BpkDialogInner.module.css +1 -1
- package/bpk-component-drawer/src/BpkDrawer.js +2 -11
- package/bpk-component-drawer/src/BpkDrawerContent.js +0 -1
- package/bpk-component-drawer/src/BpkDrawerContent.module.css +1 -1
- package/bpk-component-fieldset/src/BpkFieldset.js +0 -1
- package/bpk-component-flare/src/BpkContentBubble.js +0 -1
- package/bpk-component-flare/src/BpkFlareBar.js +0 -1
- package/bpk-component-flare/src/bpk-flare-bar.module.css +1 -1
- package/bpk-component-floating-notification/README.md +5 -0
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +6 -2
- package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +1 -1
- package/bpk-component-form-validation/src/BpkFormValidation.js +4 -5
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +0 -1
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +18 -0
- package/bpk-component-graphic-promotion/src/custom-breakpoints.module.css +17 -0
- package/bpk-component-grid/src/BpkGridColumn.js +0 -1
- package/bpk-component-grid/src/BpkGridColumn.module.css +1 -1
- package/bpk-component-grid/src/BpkGridContainer.js +0 -1
- package/bpk-component-grid/src/BpkGridContainer.module.css +1 -1
- package/bpk-component-grid/src/BpkGridRow.js +0 -1
- package/bpk-component-grid/src/BpkGridRow.module.css +1 -1
- package/bpk-component-grid-toggle/src/BpkGridToggle.js +0 -1
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +1 -2
- package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +0 -1
- package/bpk-component-icon/src/BpkIcon.module.css +1 -1
- package/bpk-component-icon/src/classNameModifierHOCFactory.js +0 -1
- package/bpk-component-icon/src/withAlignment.js +0 -1
- package/bpk-component-icon/src/withDescription.js +0 -1
- package/bpk-component-image/src/BpkBackgroundImage.js +2 -3
- package/bpk-component-image/src/BpkImage.js +2 -3
- package/bpk-component-image/src/withLazyLoading.js +1 -2
- package/bpk-component-image/src/withLoadingBehavior.js +0 -1
- package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +1 -2
- package/bpk-component-input/src/BpkClearButton.js +0 -1
- package/bpk-component-input/src/BpkInput.js +0 -1
- package/bpk-component-input/src/withOpenEvents.js +0 -1
- package/bpk-component-label/src/BpkLabel.js +0 -1
- package/bpk-component-link/src/BpkButtonLink.js +0 -1
- package/bpk-component-link/src/BpkLink.js +0 -1
- package/bpk-component-list/src/BpkList.js +0 -1
- package/bpk-component-list/src/BpkList.module.css +1 -1
- package/bpk-component-list/src/BpkListItem.js +0 -1
- package/bpk-component-loading-button/src/BpkLoadingButton.js +0 -1
- package/bpk-component-loading-button/src/BpkLoadingButton.module.css +18 -0
- package/bpk-component-map/src/BpkIconMarker.js +0 -1
- package/bpk-component-map/src/BpkIconMarkerBackground.js +0 -1
- package/bpk-component-map/src/BpkMap.js +1 -2
- package/bpk-component-map/src/BpkMap.module.css +18 -0
- package/bpk-component-map/src/BpkPriceMarker.js +0 -1
- package/bpk-component-map/src/DefaultLoadingElement.js +0 -1
- package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +0 -1
- package/bpk-component-modal/src/BpkModal.js +4 -10
- package/bpk-component-modal/src/BpkModal.module.css +1 -1
- package/bpk-component-modal/src/BpkModalInner.js +1 -2
- package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBar.js +0 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBar.module.css +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +0 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +0 -1
- package/bpk-component-navigation-stack/README.md +1 -0
- package/bpk-component-navigation-stack/package.json +1 -0
- package/bpk-component-navigation-stack/src/BpkNavigationStack.js +1 -2
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -1
- package/bpk-component-nudger/src/BpkNudger.js +0 -1
- package/bpk-component-nudger/src/BpkNudger.module.css +1 -1
- package/bpk-component-overlay/src/BpkOverlay.js +0 -1
- package/bpk-component-pagination/src/BpkPagination.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationList.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationNudger.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationPage.js +1 -2
- package/bpk-component-pagination/src/BpkPaginationPage.module.css +1 -1
- package/bpk-component-panel/src/BpkPanel.js +0 -1
- package/bpk-component-phone-input/src/BpkPhoneInput.js +0 -1
- package/bpk-component-phone-input/src/BpkPhoneInput.module.css +1 -1
- package/bpk-component-popover/src/BpkPopover.js +0 -1
- package/bpk-component-popover/src/BpkPopover.module.css +1 -1
- package/bpk-component-popover/src/BpkPopoverPortal.js +25 -15
- package/bpk-component-price/README.md +4 -2
- package/bpk-component-price/index.js +3 -2
- package/bpk-component-price/package.json +1 -1
- package/bpk-component-price/src/BpkPrice.js +16 -13
- package/bpk-component-price/src/BpkPrice.module.css +18 -0
- package/bpk-component-price/src/BpkPrice.module.scss +16 -10
- package/bpk-component-price/src/common-types.js +29 -0
- package/bpk-component-progress/src/BpkProgress.js +0 -1
- package/bpk-component-radio/src/BpkRadio.js +0 -1
- package/bpk-component-rating/src/BpkRating.js +0 -1
- package/bpk-component-rating/src/BpkRating.module.css +1 -1
- package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +0 -1
- package/bpk-component-rtl-toggle/src/updateOnDirectionChange.js +0 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarDate.js +0 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +0 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +2 -6
- package/bpk-component-section-list/src/BpkSectionListItem.js +0 -1
- package/bpk-component-section-list/src/BpkSectionListSection.js +0 -1
- package/bpk-component-select/src/BpkSelect.js +0 -1
- package/bpk-component-skip-link/src/BpkSkipLink.js +0 -1
- package/bpk-component-slider/src/BpkSlider.js +0 -1
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +1 -2
- package/bpk-component-spinner/src/BpkLargeSpinner.js +1 -2
- package/bpk-component-spinner/src/BpkSpinner.js +1 -2
- package/bpk-component-spinner/src/BpkSpinner.module.css +1 -1
- package/bpk-component-split-input/src/BpkInputField.js +2 -3
- package/bpk-component-split-input/src/BpkInputField.module.css +18 -0
- package/bpk-component-split-input/src/BpkInputField.module.scss +3 -3
- package/bpk-component-split-input/src/BpkSplitInput.js +4 -3
- package/bpk-component-split-input/src/BpkSplitInput.module.css +1 -1
- package/bpk-component-split-input/src/BpkSplitInput.module.scss +2 -2
- package/bpk-component-star-rating/src/BpkInteractiveStar.js +0 -1
- package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +0 -1
- package/bpk-component-star-rating/src/BpkStar.js +0 -1
- package/bpk-component-star-rating/src/BpkStarRating.js +0 -1
- package/bpk-component-star-rating/src/withInteractiveStarRatingState.js +0 -1
- package/bpk-component-switch/src/BpkSwitch.js +0 -1
- package/bpk-component-table/src/BpkTable.js +0 -1
- package/bpk-component-table/src/BpkTableCell.js +0 -1
- package/bpk-component-table/src/BpkTableHeadCell.js +0 -1
- package/bpk-component-text/src/BpkText.js +0 -1
- package/bpk-component-text/src/BpkText.module.css +1 -1
- package/bpk-component-textarea/src/BpkTextarea.js +0 -1
- package/bpk-component-theme-toggle/src/BpkThemeToggle.js +0 -1
- package/bpk-component-theme-toggle/src/updateOnThemeChange.js +0 -1
- package/bpk-component-ticket/README.md +0 -1
- package/bpk-component-ticket/package.json +1 -1
- package/bpk-component-ticket/src/BpkTicket.js +0 -41
- package/bpk-component-ticket/src/BpkTicket.module.css +1 -1
- package/bpk-component-ticket/src/BpkTicket.module.scss +13 -165
- package/bpk-component-tooltip/src/BpkTooltip.js +0 -1
- package/bpk-component-tooltip/src/BpkTooltip.module.css +1 -1
- package/bpk-component-tooltip/src/BpkTooltipPortal.js +0 -1
- package/bpk-react-utils/src/Portal.js +1 -1
- package/bpk-scrim-utils/src/BpkScrim.js +0 -1
- package/bpk-scrim-utils/src/bpk-scrim.module.css +1 -1
- package/bpk-scrim-utils/src/withScrim.js +0 -1
- package/package.json +1 -1
|
@@ -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 bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-popover-portal{z-index:900}@media (max-width:
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-popover-portal{z-index:900}@media (max-width: 32rem){.bpk-popover-portal{margin-right:1rem;margin-left:1rem}}.bpk-popover{transition:opacity 200ms ease-in-out;outline:0;opacity:1;border:.0625rem solid #dddde5;background-color:#fff;border-radius:.375rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,0.25)}@media (min-width: 32.0625rem){.bpk-popover{max-width:32rem;transition:opacity 50ms ease-in-out}}.bpk-popover--appear{opacity:0}.bpk-popover--appear-active{opacity:1}.bpk-popover__arrow{position:aboslute;width:1.5rem;height:1.5rem;transform:rotate(45deg);border:.0625rem solid transparent;background:inherit}.bpk-popover-portal[data-popper-placement='top'] .bpk-popover__arrow{bottom:-.6875rem;border-right-color:#dddde5;border-bottom-color:#dddde5}.bpk-popover-portal[data-popper-placement='right'] .bpk-popover__arrow{left:-.6875rem;border-bottom-color:#dddde5;border-left-color:#dddde5}.bpk-popover-portal[data-popper-placement='bottom'] .bpk-popover__arrow{top:-.6875rem;border-top-color:#dddde5;border-left-color:#dddde5}.bpk-popover-portal[data-popper-placement='left'] .bpk-popover__arrow{right:-.6875rem;border-top-color:#dddde5;border-right-color:#dddde5}.bpk-popover__arrow[data-hide]{visibility:hidden}.bpk-popover__body--padded{padding:1rem}.bpk-popover__header{display:flex;padding:1rem;justify-content:space-between;box-shadow:0 -1px 0 0 #dddde5 inset}.bpk-popover__label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0)}.bpk-popover__close-button{float:right}html[dir='rtl'] .bpk-popover__close-button{float:left}.bpk-popover__footer{padding:0.5rem 1rem;text-align:right;box-shadow:0 1px 0 0 #dddde5 inset}html[dir='rtl'] .bpk-popover__footer{text-align:left}
|
|
@@ -22,8 +22,7 @@ import { createPopper, basePlacements } from '@popperjs/core';
|
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
23
|
import React, { Component, type Node } from 'react';
|
|
24
24
|
import focusStore from 'a11y-focus-store';
|
|
25
|
-
|
|
26
|
-
import { PortalV1, cssModules } from '../../bpk-react-utils';
|
|
25
|
+
import { Portal, cssModules } from '../../bpk-react-utils';
|
|
27
26
|
|
|
28
27
|
import keyboardFocusScope from './keyboardFocusScope';
|
|
29
28
|
import STYLES from './BpkPopover.module.scss';
|
|
@@ -83,6 +82,7 @@ class BpkPopoverPortal extends Component<Props> {
|
|
|
83
82
|
|
|
84
83
|
this.popper = null;
|
|
85
84
|
this.previousTargetElement = null;
|
|
85
|
+
this.ref = React.createRef();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
onRender = (popoverElement: HTMLElement, targetElement: ?HTMLElement) => {
|
|
@@ -216,20 +216,30 @@ class BpkPopoverPortal extends Component<Props> {
|
|
|
216
216
|
classNames.push(portalClassName);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
const targetElement =
|
|
220
|
+
typeof target === 'function' ? (
|
|
221
|
+
target
|
|
222
|
+
) : (
|
|
223
|
+
<div ref={this.ref}>{target}</div>
|
|
224
|
+
);
|
|
225
|
+
|
|
219
226
|
return (
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
<>
|
|
228
|
+
{typeof targetElement !== 'function' && targetElement}
|
|
229
|
+
<Portal
|
|
230
|
+
beforeClose={this.beforeClose}
|
|
231
|
+
className={classNames.join(' ')}
|
|
232
|
+
isOpen={isOpen}
|
|
233
|
+
onClose={this.onClose}
|
|
234
|
+
onRender={this.onRender}
|
|
235
|
+
style={portalStyle}
|
|
236
|
+
renderTarget={renderTarget}
|
|
237
|
+
target={targetElement}
|
|
238
|
+
>
|
|
239
|
+
{/* $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'. */}
|
|
240
|
+
<BpkPopover onClose={this.onClose} {...rest} />
|
|
241
|
+
</Portal>
|
|
242
|
+
</>
|
|
233
243
|
);
|
|
234
244
|
}
|
|
235
245
|
}
|
|
@@ -12,14 +12,15 @@ npm install bpk-component-price --save-dev
|
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import BpkPrice, { SIZES } from 'bpk-component-price';
|
|
15
|
+
import BpkPrice, { SIZES, ALIGNS } from 'bpk-component-price';
|
|
16
16
|
|
|
17
17
|
export default () => (
|
|
18
18
|
<BpkPrice
|
|
19
19
|
size={SIZES.large}
|
|
20
|
+
align={ALIGNS.left}
|
|
20
21
|
subtitle="£209"
|
|
21
22
|
title="£1,830"
|
|
22
|
-
description="
|
|
23
|
+
description="a night"
|
|
23
24
|
/>
|
|
24
25
|
);
|
|
25
26
|
```
|
|
@@ -30,6 +31,7 @@ export default () => (
|
|
|
30
31
|
| --------- | -------- | -------- | ------------- |
|
|
31
32
|
| title | string | true | - |
|
|
32
33
|
| size | oneOf(SIZES) | false | SIZES.small |
|
|
34
|
+
| align | oneOf(ALIGNS) | false | ALIGNS.left |
|
|
33
35
|
| subtitle | string | false | null |
|
|
34
36
|
| description | string | false | null |
|
|
35
37
|
| className | string | false | null |
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import BpkPrice
|
|
20
|
+
import BpkPrice from './src/BpkPrice';
|
|
21
|
+
import { SIZES, ALIGNS } from './src/common-types';
|
|
21
22
|
|
|
22
23
|
export default BpkPrice;
|
|
23
|
-
export { SIZES };
|
|
24
|
+
export { SIZES, ALIGNS };
|
|
@@ -19,20 +19,16 @@
|
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
21
|
import React from 'react';
|
|
22
|
-
|
|
23
22
|
import { cssModules } from '../../bpk-react-utils';
|
|
24
23
|
import BpkText, { TEXT_STYLES } from '../../bpk-component-text';
|
|
25
24
|
|
|
26
25
|
import STYLES from './BpkPrice.module.scss';
|
|
27
|
-
|
|
28
|
-
export const SIZES = {
|
|
29
|
-
small: 'small',
|
|
30
|
-
large: 'large',
|
|
31
|
-
};
|
|
26
|
+
import { SIZES, ALIGNS } from './common-types';
|
|
32
27
|
|
|
33
28
|
type Props = {
|
|
34
29
|
title: string,
|
|
35
30
|
size: $Values<typeof SIZES>,
|
|
31
|
+
align: $Values<typeof ALIGNS>,
|
|
36
32
|
className: ?string,
|
|
37
33
|
subtitle: ?string,
|
|
38
34
|
description: ?string,
|
|
@@ -41,15 +37,17 @@ type Props = {
|
|
|
41
37
|
const getClassName = cssModules(STYLES);
|
|
42
38
|
|
|
43
39
|
const BpkPrice = (props: Props) => {
|
|
44
|
-
const { className, description, size, subtitle, title, ...rest } =
|
|
40
|
+
const { align, className, description, size, subtitle, title, ...rest } =
|
|
41
|
+
props;
|
|
45
42
|
|
|
46
43
|
const isSmall = size === SIZES.small;
|
|
44
|
+
const isAlignRight = align === ALIGNS.right;
|
|
47
45
|
|
|
48
46
|
return (
|
|
49
47
|
<div
|
|
50
48
|
className={getClassName(
|
|
51
49
|
'bpk-price',
|
|
52
|
-
|
|
50
|
+
isAlignRight && 'bpk-price--right',
|
|
53
51
|
className,
|
|
54
52
|
)}
|
|
55
53
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
@@ -64,9 +62,15 @@ const BpkPrice = (props: Props) => {
|
|
|
64
62
|
{subtitle}
|
|
65
63
|
</BpkText>
|
|
66
64
|
)}
|
|
67
|
-
<div
|
|
65
|
+
<div
|
|
66
|
+
className={isAlignRight && getClassName('bpk-price__column-container')}
|
|
67
|
+
>
|
|
68
68
|
<BpkText
|
|
69
69
|
textStyle={isSmall ? TEXT_STYLES.heading4 : TEXT_STYLES.xxl}
|
|
70
|
+
className={getClassName(
|
|
71
|
+
'bpk-price__title',
|
|
72
|
+
!isAlignRight && 'bpk-price__spacing',
|
|
73
|
+
)}
|
|
70
74
|
tagName="span"
|
|
71
75
|
>
|
|
72
76
|
{title}
|
|
@@ -75,10 +79,7 @@ const BpkPrice = (props: Props) => {
|
|
|
75
79
|
<BpkText
|
|
76
80
|
textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
|
|
77
81
|
tagName="span"
|
|
78
|
-
className={getClassName(
|
|
79
|
-
'bpk-price__description',
|
|
80
|
-
!isSmall && 'bpk-price__descriptionSpacing',
|
|
81
|
-
)}
|
|
82
|
+
className={getClassName('bpk-price__description')}
|
|
82
83
|
>
|
|
83
84
|
{description}
|
|
84
85
|
</BpkText>
|
|
@@ -91,6 +92,7 @@ const BpkPrice = (props: Props) => {
|
|
|
91
92
|
BpkPrice.propTypes = {
|
|
92
93
|
title: PropTypes.string.isRequired,
|
|
93
94
|
size: PropTypes.oneOf(Object.keys(SIZES)),
|
|
95
|
+
align: PropTypes.oneOf(Object.keys(ALIGNS)),
|
|
94
96
|
className: PropTypes.string,
|
|
95
97
|
subtitle: PropTypes.string,
|
|
96
98
|
description: PropTypes.string,
|
|
@@ -98,6 +100,7 @@ BpkPrice.propTypes = {
|
|
|
98
100
|
|
|
99
101
|
BpkPrice.defaultProps = {
|
|
100
102
|
size: SIZES.small,
|
|
103
|
+
align: ALIGNS.left,
|
|
101
104
|
className: null,
|
|
102
105
|
subtitle: null,
|
|
103
106
|
description: null,
|
|
@@ -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
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-price{display:flex;flex-direction:column}.bpk-price--right{text-align:right}html[dir='rtl'] .bpk-price--right{text-align:left}.bpk-price__subtitle{color:#68697f;text-decoration-line:line-through}.bpk-price__column-container{display:flex;flex-direction:column}.bpk-price__title{word-break:break-all}.bpk-price__spacing::after{content:'';margin-right:0.25rem}html[dir='rtl'] .bpk-price__spacing::after{margin-right:unset;margin-left:0.25rem}.bpk-price__description{color:#68697f;white-space:nowrap}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
|
|
25
|
-
&--
|
|
25
|
+
&--right {
|
|
26
26
|
text-align: right;
|
|
27
27
|
|
|
28
28
|
@include bpk-rtl {
|
|
@@ -35,21 +35,27 @@
|
|
|
35
35
|
text-decoration-line: line-through;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
&
|
|
38
|
+
&__column-container {
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
&
|
|
44
|
-
|
|
43
|
+
&__title {
|
|
44
|
+
word-break: break-all;
|
|
45
|
+
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
&__spacing::after {
|
|
48
|
+
content: '';
|
|
49
|
+
margin-right: bpk-spacing-sm();
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
51
|
+
@include bpk-rtl {
|
|
52
|
+
margin-right: unset;
|
|
53
|
+
margin-left: bpk-spacing-sm();
|
|
53
54
|
}
|
|
54
55
|
}
|
|
56
|
+
|
|
57
|
+
&__description {
|
|
58
|
+
color: $bpk-color-sky-gray-tint-02;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
55
61
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
/* @flow strict */
|
|
20
|
+
|
|
21
|
+
export const SIZES = {
|
|
22
|
+
small: 'small',
|
|
23
|
+
large: 'large',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const ALIGNS = {
|
|
27
|
+
left: 'left',
|
|
28
|
+
right: 'right',
|
|
29
|
+
};
|
|
@@ -22,7 +22,6 @@ import PropTypes from 'prop-types';
|
|
|
22
22
|
import React, { Component } from 'react';
|
|
23
23
|
import { colorWhite } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
24
24
|
import clamp from 'lodash.clamp';
|
|
25
|
-
|
|
26
25
|
import { cssModules } from '../../bpk-react-utils';
|
|
27
26
|
|
|
28
27
|
import STYLES from './BpkProgress.module.scss';
|
|
@@ -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 bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-rating{display:flex
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-rating{display:flex;flex-flow:row nowrap;align-items:baseline}.bpk-rating--large{align-items:center}.bpk-rating__value{display:flex;padding-right:0.5rem;justify-content:center;align-items:baseline;color:#111236}html[dir='rtl'] .bpk-rating__value{padding-right:0;padding-left:0.5rem}.bpk-rating__text-wrapper{display:flex;flex-direction:row;align-items:baseline;white-space:nowrap}.bpk-rating__text-wrapper--large{flex-direction:column;align-items:flex-start}.bpk-rating__scale{color:#68697f}.bpk-rating__title--large{padding-top:.0625rem}.bpk-rating__subtitle{padding-left:0.5rem;color:#68697f}html[dir='rtl'] .bpk-rating__subtitle{padding-right:0.5rem;padding-left:0}.bpk-rating__subtitle--large{padding-top:.0625rem;padding-left:0}html[dir='rtl'] .bpk-rating__subtitle--large{padding-right:0;padding-left:0}
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
import React from 'react';
|
|
21
|
+
import { cssModules, deprecated } from '../../bpk-react-utils';
|
|
22
|
+
import { DateUtils, BpkCalendarGridPropTypes } from '../../bpk-component-calendar';
|
|
21
23
|
import { startOfDay, startOfMonth } from 'date-fns';
|
|
22
24
|
import {
|
|
23
25
|
AutoSizer,
|
|
@@ -26,12 +28,6 @@ import {
|
|
|
26
28
|
CellMeasurerCache,
|
|
27
29
|
} from 'react-virtualized';
|
|
28
30
|
|
|
29
|
-
import { cssModules, deprecated } from '../../bpk-react-utils';
|
|
30
|
-
import {
|
|
31
|
-
DateUtils,
|
|
32
|
-
BpkCalendarGridPropTypes,
|
|
33
|
-
} from '../../bpk-component-calendar';
|
|
34
|
-
|
|
35
31
|
import STYLES from './BpkScrollableCalendarGridList.module.scss';
|
|
36
32
|
import BpkScrollableCalendarGrid from './BpkScrollableCalendarGrid';
|
|
37
33
|
import getMonthsArray from './utils';
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import React, { type Node } from 'react';
|
|
23
|
-
|
|
24
23
|
import { cssModules } from '../../bpk-react-utils';
|
|
25
24
|
import BpkLargeChevronRightIcon from '../../bpk-component-icon/lg/chevron-right';
|
|
26
25
|
import { withRtlSupport } from '../../bpk-component-icon';
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
|
-
import XlSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/xl';
|
|
24
|
-
|
|
25
23
|
import { cssModules } from '../../bpk-react-utils';
|
|
24
|
+
import XlSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/xl';
|
|
26
25
|
|
|
27
26
|
import STYLES from './BpkSpinner.module.scss';
|
|
28
27
|
import SPINNER_TYPES from './spinnerTypes';
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import React from 'react';
|
|
23
|
-
import LgSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/lg';
|
|
24
|
-
|
|
25
23
|
import { cssModules } from '../../bpk-react-utils';
|
|
24
|
+
import LgSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/lg';
|
|
26
25
|
|
|
27
26
|
import STYLES from './BpkSpinner.module.scss';
|
|
28
27
|
import SPINNER_TYPES from './spinnerTypes';
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import React from 'react';
|
|
23
|
-
import SmSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/sm';
|
|
24
|
-
|
|
25
23
|
import { cssModules } from '../../bpk-react-utils';
|
|
24
|
+
import SmSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/sm';
|
|
26
25
|
|
|
27
26
|
import STYLES from './BpkSpinner.module.scss';
|
|
28
27
|
import SPINNER_TYPES from './spinnerTypes';
|
|
@@ -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 bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-spinner{width:1rem;height:1rem;animation:bpk-keyframe-spin 600ms linear infinite}.bpk-spinner--primary{fill:#0770e3;fill:var(--bpk-spinner-primary-color, #0770e3)}.bpk-spinner--light{fill:#fff}.bpk-spinner--dark{fill:#444560}.bpk-spinner--large{width:1.5rem;height:1.5rem}.bpk-spinner--extra-large{width:2rem;height:2rem}.bpk-spinner--align-to-button{vertical-align:baseline}.bpk-spinner--align-to-large-button{margin-top
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-spinner{width:1rem;height:1rem;animation:bpk-keyframe-spin 600ms linear infinite}.bpk-spinner--primary{fill:#0770e3;fill:var(--bpk-spinner-primary-color, #0770e3)}.bpk-spinner--light{fill:#fff}.bpk-spinner--dark{fill:#444560}.bpk-spinner--large{width:1.5rem;height:1.5rem}.bpk-spinner--extra-large{width:2rem;height:2rem}.bpk-spinner--align-to-button{vertical-align:baseline}.bpk-spinner--align-to-large-button{margin-top:0rem;vertical-align:top}
|
|
@@ -18,10 +18,9 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import React, { Component } from 'react';
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
22
|
-
|
|
23
21
|
import BpkInput from '../../bpk-component-input';
|
|
24
22
|
import { cssModules } from '../../bpk-react-utils';
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
25
24
|
|
|
26
25
|
import STYLES from './BpkInputField.module.scss';
|
|
27
26
|
|
|
@@ -39,7 +38,7 @@ class BpkInputField extends Component {
|
|
|
39
38
|
render() {
|
|
40
39
|
const { focus, id, index, label, value, ...rest } = this.props;
|
|
41
40
|
return (
|
|
42
|
-
<div key={index} className={getClassName('
|
|
41
|
+
<div key={index} className={getClassName('bpk-input-field')}>
|
|
43
42
|
<BpkInput
|
|
44
43
|
id={id}
|
|
45
44
|
autoComplete="off"
|
|
@@ -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
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-input-field{display:flex;max-width:7.5rem;margin-right:0.25rem;align-items:center}.bpk-input-field input{text-align:center}.bpk-input-field:last-child{margin-right:0}
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
/* stylelint-disable */
|
|
19
19
|
@import '~bpk-mixins';
|
|
20
20
|
|
|
21
|
-
.
|
|
21
|
+
.bpk-input-field {
|
|
22
22
|
display: flex;
|
|
23
23
|
max-width: 3*bpk-spacing-xxl();
|
|
24
|
-
margin-right: bpk-spacing-
|
|
24
|
+
margin-right: bpk-spacing-sm();
|
|
25
25
|
align-items: center;
|
|
26
26
|
|
|
27
27
|
input {
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.
|
|
32
|
+
.bpk-input-field:last-child {
|
|
33
33
|
margin-right: $bpk-spacing-none;
|
|
34
34
|
}
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import React, { Component } from 'react';
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
22
|
-
|
|
23
21
|
import { cssModules } from '../../bpk-react-utils';
|
|
22
|
+
import PropTypes from 'prop-types';
|
|
24
23
|
import { INPUT_TYPES } from '../../bpk-component-input';
|
|
25
24
|
|
|
26
25
|
import InputField from './BpkInputField';
|
|
@@ -215,7 +214,9 @@ class BpkSplitInput extends Component {
|
|
|
215
214
|
|
|
216
215
|
render() {
|
|
217
216
|
return (
|
|
218
|
-
<div className={getClassName('
|
|
217
|
+
<div className={getClassName('bpk-split-input')}>
|
|
218
|
+
{this.renderInputs()}
|
|
219
|
+
</div>
|
|
219
220
|
);
|
|
220
221
|
}
|
|
221
222
|
}
|
|
@@ -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 bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-split-input{display:flex}
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-split-input{font-size:1rem;line-height:1.5rem;font-weight:400;display:flex;width:100%;padding-top:0.25rem;flex-direction:row;align-items:center;direction:ltr}.bpk-split-input__textbox{display:flex;align-items:center}
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
@import '~bpk-mixins/index';
|
|
22
22
|
|
|
23
|
-
.
|
|
23
|
+
.bpk-split-input {
|
|
24
24
|
@include bpk-body-default;
|
|
25
25
|
display: flex;
|
|
26
26
|
width: 100%;
|
|
27
|
-
padding-top: bpk-spacing-
|
|
27
|
+
padding-top: bpk-spacing-sm();
|
|
28
28
|
flex-direction: row;
|
|
29
29
|
align-items: center;
|
|
30
30
|
direction: ltr;
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
|
-
|
|
24
23
|
import SmallIcon from '../../bpk-component-icon/sm/star';
|
|
25
24
|
import LargeIcon from '../../bpk-component-icon/lg/star';
|
|
26
25
|
import OutlineSmallIcon from '../../bpk-component-icon/sm/star-outline';
|