@skyscanner/backpack-web 0.0.1 → 0.0.4
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 +100 -0
- package/bpk-animate-height/examples.js +1 -1
- package/bpk-component-accordion/examples.js +4 -4
- package/bpk-component-accordion/package.json +4 -4
- package/bpk-component-accordion/src/BpkAccordion.js +1 -1
- package/bpk-component-accordion/src/BpkAccordionItem.js +8 -8
- package/bpk-component-accordion/src/withAccordionItemState.js +2 -2
- package/bpk-component-accordion/src/withSingleItemAccordionState.js +1 -1
- package/bpk-component-aria-live/examples.js +7 -8
- package/bpk-component-aria-live/package.json +3 -3
- package/bpk-component-aria-live/src/BpkAriaLive.js +1 -1
- package/bpk-component-autosuggest/examples.js +4 -4
- package/bpk-component-autosuggest/package.json +3 -3
- package/bpk-component-autosuggest/src/BpkAutosuggest.js +2 -2
- package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +1 -1
- package/bpk-component-badge/BadgeLayout.js +1 -1
- package/bpk-component-badge/examples.js +5 -5
- package/bpk-component-badge/package.json +2 -2
- package/bpk-component-badge/src/BpkBadge.js +1 -1
- package/bpk-component-banner-alert/examples.js +4 -4
- package/bpk-component-banner-alert/package.json +4 -4
- package/bpk-component-banner-alert/src/AnimateAndFade.js +2 -2
- package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +7 -7
- package/bpk-component-banner-alert/src/withBannerAlertState.js +1 -1
- package/bpk-component-barchart/examples.js +4 -4
- package/bpk-component-barchart/hocs.js +1 -1
- package/bpk-component-barchart/package.json +2 -2
- package/bpk-component-barchart/src/BpkBarchart.js +2 -2
- package/bpk-component-barchart/src/BpkBarchartBar.js +1 -1
- package/bpk-component-barchart/src/BpkChartAxis.js +1 -1
- package/bpk-component-barchart/src/BpkChartDataTable.js +1 -1
- package/bpk-component-barchart/src/BpkChartGridLines.js +9 -9
- package/bpk-component-barchart/src/RTLtransforms.js +1 -1
- package/bpk-component-blockquote/src/BpkBlockquote.js +1 -1
- package/bpk-component-breadcrumb/package.json +3 -3
- package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +1 -1
- package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +5 -5
- package/bpk-component-breakpoint/examples.js +1 -1
- package/bpk-component-calendar/examples-components.js +1 -1
- package/bpk-component-calendar/examples.js +1 -1
- package/bpk-component-calendar/package.json +4 -4
- package/bpk-component-calendar/src/BpkCalendarContainer.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarDate.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGrid.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGridTransition.js +12 -12
- package/bpk-component-calendar/src/BpkCalendarNav.js +13 -13
- package/bpk-component-calendar/src/Week.js +2 -2
- package/bpk-component-calendar/src/composeCalendar.js +1 -1
- package/bpk-component-card/examples.js +3 -3
- package/bpk-component-card/package.json +2 -2
- package/bpk-component-card/src/BpkCard.js +1 -1
- package/bpk-component-checkbox/package.json +2 -2
- package/bpk-component-checkbox/src/BpkCheckbox.js +1 -1
- package/bpk-component-chip/examples.js +12 -13
- package/bpk-component-chip/package.json +4 -4
- package/bpk-component-chip/src/BpkDismissibleChip.js +1 -1
- package/bpk-component-chip/src/BpkSelectableChip.js +3 -3
- package/bpk-component-close-button/package.json +2 -2
- package/bpk-component-close-button/src/BpkCloseButton.js +2 -2
- package/bpk-component-code/src/BpkCode.js +1 -1
- package/bpk-component-code/src/BpkCodeBlock.js +1 -1
- package/bpk-component-content-container/examples.js +2 -2
- package/bpk-component-content-container/src/BpkContentContainer.js +1 -1
- package/bpk-component-datatable/package.json +2 -2
- package/bpk-component-datatable/src/BpkDataTable.js +1 -1
- package/bpk-component-datatable/src/BpkDataTableColumn.js +1 -1
- package/bpk-component-datatable/src/bpkHeaderRenderer.js +4 -4
- package/bpk-component-datepicker/examples.js +4 -4
- package/bpk-component-datepicker/index.js +1 -1
- package/bpk-component-datepicker/package.json +5 -5
- package/bpk-component-datepicker/src/BpkDatepicker.js +6 -6
- package/bpk-component-datepicker/src/themeAttributes.js +3 -3
- package/bpk-component-description-list/src/ComponentFactory.js +1 -1
- package/bpk-component-dialog/examples.js +7 -7
- package/bpk-component-dialog/package.json +5 -5
- package/bpk-component-dialog/src/BpkDialog.js +2 -2
- package/bpk-component-dialog/src/BpkDialogInner.js +3 -3
- package/bpk-component-drawer/examples.js +4 -4
- package/bpk-component-drawer/package.json +4 -4
- package/bpk-component-drawer/src/BpkDrawer.js +2 -2
- package/bpk-component-drawer/src/BpkDrawerContent.js +3 -3
- package/bpk-component-drawer/src/themeAttributes.js +1 -1
- package/bpk-component-fieldset/examples.js +12 -12
- package/bpk-component-fieldset/package.json +7 -7
- package/bpk-component-fieldset/src/BpkFieldset.js +3 -3
- package/bpk-component-flare/examples.js +4 -4
- package/bpk-component-flare/package.json +2 -2
- package/bpk-component-flare/src/BpkContentBubble.js +1 -1
- package/bpk-component-flare/src/BpkFlareBar.js +1 -1
- package/bpk-component-form-validation/examples.js +6 -6
- package/bpk-component-form-validation/package.json +4 -4
- package/bpk-component-form-validation/src/BpkFormValidation.js +4 -4
- package/bpk-component-grid/src/BpkGridColumn.js +1 -1
- package/bpk-component-grid/src/BpkGridContainer.js +1 -1
- package/bpk-component-grid/src/BpkGridRow.js +1 -1
- package/bpk-component-grid-toggle/src/BpkGridToggle.js +2 -2
- package/bpk-component-horizontal-nav/examples.js +2 -2
- package/bpk-component-horizontal-nav/package.json +2 -2
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +2 -2
- package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +1 -1
- package/bpk-component-icon/examples.js +7 -7
- package/bpk-component-icon/package.json +2 -2
- package/bpk-component-icon/src/classNameModifierHOCFactory.js +1 -1
- package/bpk-component-icon/src/withAlignment.js +3 -4
- package/bpk-component-icon/src/withDescription.js +1 -1
- package/bpk-component-icon/src/withRtlSupport.js +1 -1
- package/bpk-component-image/examples.js +5 -5
- package/bpk-component-image/package.json +2 -2
- package/bpk-component-image/src/BpkBackgroundImage.js +2 -2
- package/bpk-component-image/src/BpkImage.js +2 -2
- package/bpk-component-image/src/withLazyLoading.js +1 -1
- package/bpk-component-image/src/withLoadingBehavior.js +28 -28
- package/bpk-component-infinite-scroll/examples.js +4 -4
- package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +106 -106
- package/bpk-component-input/examples.js +3 -3
- package/bpk-component-input/package.json +3 -3
- package/bpk-component-input/src/BpkClearButton.js +3 -3
- package/bpk-component-input/src/BpkInput.js +1 -1
- package/bpk-component-input/src/withOpenEvents.js +1 -1
- package/bpk-component-label/src/BpkLabel.js +1 -1
- package/bpk-component-link/src/BpkButtonLink.js +1 -1
- package/bpk-component-link/src/BpkLink.js +1 -1
- package/bpk-component-list/src/BpkList.js +1 -1
- package/bpk-component-list/src/BpkListItem.js +1 -1
- package/bpk-component-loading-button/examples.js +3 -3
- package/bpk-component-loading-button/package.json +2 -2
- package/bpk-component-loading-button/src/BpkLoadingButton.js +5 -5
- package/bpk-component-map/examples.js +6 -6
- package/bpk-component-map/package.json +3 -3
- package/bpk-component-map/src/BpkIconMarker.js +1 -1
- package/bpk-component-map/src/BpkIconMarkerBackground.js +1 -1
- package/bpk-component-map/src/BpkPriceMarker.js +4 -8
- package/bpk-component-map/src/DefaultLoadingElement.js +2 -2
- package/bpk-component-mobile-scroll-container/examples.js +1 -1
- package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +1 -1
- package/bpk-component-modal/examples.js +8 -8
- package/bpk-component-modal/package.json +5 -5
- package/bpk-component-modal/src/BpkModal.js +8 -8
- package/bpk-component-modal/src/BpkModalInner.js +4 -4
- package/bpk-component-modal/src/themeAttributes.js +1 -1
- package/bpk-component-navigation-bar/AirlineLogo.js +1 -1
- package/bpk-component-navigation-bar/examples.js +4 -4
- package/bpk-component-navigation-bar/package.json +4 -4
- package/bpk-component-navigation-bar/src/BpkNavigationBar.js +3 -3
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +2 -2
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +2 -2
- package/bpk-component-navigation-stack/examples.js +2 -2
- package/bpk-component-navigation-stack/package.json +3 -3
- package/bpk-component-navigation-stack/src/BpkNavigationStack.js +4 -5
- package/bpk-component-navigation-stack/stories-components.js +20 -20
- package/bpk-component-nudger/examples.js +2 -2
- package/bpk-component-nudger/package.json +2 -2
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +6 -6
- package/bpk-component-nudger/src/BpkNudger.js +1 -1
- package/bpk-component-nudger/src/themeAttributes.js +1 -1
- package/bpk-component-overlay/examples.js +3 -3
- package/bpk-component-overlay/package.json +3 -3
- package/bpk-component-overlay/src/BpkOverlay.js +2 -2
- package/bpk-component-pagination/package.json +2 -2
- package/bpk-component-pagination/src/BpkPagination.js +1 -1
- package/bpk-component-pagination/src/BpkPaginationList.js +1 -1
- package/bpk-component-pagination/src/BpkPaginationNudger.js +4 -4
- package/bpk-component-pagination/src/BpkPaginationPage.js +2 -2
- package/bpk-component-pagination/src/themeAttributes.js +1 -1
- package/bpk-component-panel/src/BpkPanel.js +1 -1
- package/bpk-component-phone-input/examples.js +2 -2
- package/bpk-component-phone-input/package.json +5 -5
- package/bpk-component-phone-input/src/BpkPhoneInput.js +4 -4
- package/bpk-component-popover/examples.js +6 -6
- package/bpk-component-popover/package.json +4 -4
- package/bpk-component-popover/src/BpkPopover.js +5 -5
- package/bpk-component-popover/src/BpkPopoverPortal.js +1 -1
- package/bpk-component-popover/src/themeAttributes.js +1 -1
- package/bpk-component-progress/examples.js +2 -2
- package/bpk-component-progress/src/BpkProgress.js +1 -1
- package/bpk-component-radio/src/BpkRadio.js +1 -1
- package/bpk-component-rating/examples.js +1 -1
- package/bpk-component-rating/package.json +2 -2
- package/bpk-component-rating/src/BpkRating.js +15 -9
- package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +1 -1
- package/bpk-component-rtl-toggle/src/updateOnDirectionChange.js +1 -1
- package/bpk-component-scrollable-calendar/examples.js +1 -1
- package/bpk-component-scrollable-calendar/index.js +1 -1
- package/bpk-component-scrollable-calendar/package.json +3 -3
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendar.js +1 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarDate.js +1 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +4 -5
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +2 -2
- package/bpk-component-scrollable-calendar/src/utils.js +1 -1
- package/bpk-component-section-list/package.json +3 -3
- package/bpk-component-section-list/src/BpkSectionListItem.js +3 -3
- package/bpk-component-section-list/src/BpkSectionListSection.js +3 -5
- package/bpk-component-select/src/BpkSelect.js +1 -1
- package/bpk-component-skip-link/src/BpkSkipLink.js +1 -1
- package/bpk-component-slider/examples.js +9 -9
- package/bpk-component-slider/src/BpkSlider.js +1 -1
- package/bpk-component-spinner/SpinnerLayout.js +1 -1
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +1 -1
- package/bpk-component-spinner/src/BpkLargeSpinner.js +1 -1
- package/bpk-component-spinner/src/BpkSpinner.js +1 -1
- package/bpk-component-star-rating/examples.js +1 -1
- package/bpk-component-star-rating/package.json +2 -2
- package/bpk-component-star-rating/src/BpkInteractiveStar.js +1 -1
- package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
- package/bpk-component-star-rating/src/BpkStar.js +8 -8
- package/bpk-component-star-rating/src/BpkStarRating.js +4 -4
- package/bpk-component-star-rating/src/withInteractiveStarRatingState.js +1 -1
- package/bpk-component-switch/src/BpkSwitch.js +1 -1
- package/bpk-component-table/src/BpkTable.js +1 -1
- package/bpk-component-table/src/BpkTableCell.js +1 -1
- package/bpk-component-table/src/BpkTableHeadCell.js +1 -1
- package/bpk-component-text/examples.js +18 -18
- package/bpk-component-text/package.json +1 -1
- package/bpk-component-text/src/BpkText.js +2 -2
- package/bpk-component-textarea/examples.js +1 -1
- package/bpk-component-textarea/src/BpkTextarea.js +1 -1
- package/bpk-component-theme-toggle/src/BpkThemeToggle.js +3 -3
- package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
- package/bpk-component-ticket/examples.js +4 -4
- package/bpk-component-ticket/package.json +2 -2
- package/bpk-component-ticket/src/BpkTicket.js +7 -7
- package/bpk-component-tooltip/examples.js +4 -4
- package/bpk-component-tooltip/package.json +2 -2
- package/bpk-component-tooltip/src/BpkTooltip.js +1 -1
- package/bpk-component-tooltip/src/BpkTooltipPortal.js +1 -1
- package/bpk-scrim-utils/src/BpkScrim.js +1 -1
- package/bpk-scrim-utils/src/withScrim.js +1 -1
- package/package.json +2 -2
- package/bpk-component-heading/README.md +0 -31
- package/bpk-component-heading/examples.js +0 -36
- package/bpk-component-heading/index.js +0 -23
- package/bpk-component-heading/package.json +0 -25
- package/bpk-component-heading/src/BpkHeading.js +0 -70
- package/bpk-component-heading/src/BpkHeading.module.css +0 -18
- package/bpk-component-heading/src/BpkHeading.module.scss +0 -49
- package/bpk-component-paragraph/README.md +0 -28
- package/bpk-component-paragraph/examples.js +0 -46
- package/bpk-component-paragraph/index.js +0 -23
- package/bpk-component-paragraph/package.json +0 -25
- package/bpk-component-paragraph/src/BpkParagraph.js +0 -55
- package/bpk-component-paragraph/src/BpkParagraph.module.css +0 -18
- package/bpk-component-paragraph/src/BpkParagraph.module.scss +0 -25
- package/bpk-tether/.eslintrc +0 -6
- package/bpk-tether/README.md +0 -52
- package/bpk-tether/index.js +0 -24
- package/bpk-tether/package.json +0 -19
- package/bpk-tether/src/TetherWrapper.js +0 -30
- package/bpk-tether/src/applyRTLTransforms.js +0 -49
- package/bpk-tether/src/getArrowPositionCallback.js +0 -65
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# This component has been deprecated, please use bpk-component-text instead to apply heading styles
|
|
2
|
-
# bpk-component-heading
|
|
3
|
-
|
|
4
|
-
> Backpack heading component.
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```sh
|
|
9
|
-
npm install bpk-component-heading --save-dev
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import BpkHeading from 'bpk-component-heading';
|
|
17
|
-
|
|
18
|
-
export default () => (
|
|
19
|
-
<BpkHeading level="h1">My Heading</BpkHeading>
|
|
20
|
-
);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Props
|
|
24
|
-
|
|
25
|
-
| Property | PropType | Required | Default Value |
|
|
26
|
-
| ------------ | ---------------------------------- | -------- | ------------- |
|
|
27
|
-
| children | - | true | - |
|
|
28
|
-
| level | 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' | true | - |
|
|
29
|
-
| className | string | false | null |
|
|
30
|
-
| id | string | false | null |
|
|
31
|
-
| bottomMargin | bool | false | true |
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
import React from 'react';
|
|
22
|
-
|
|
23
|
-
import BpkHeading from './index';
|
|
24
|
-
|
|
25
|
-
const Examples = () => (
|
|
26
|
-
<div>
|
|
27
|
-
<BpkHeading level="h1">Heading 1</BpkHeading>
|
|
28
|
-
<BpkHeading level="h2">Heading 2</BpkHeading>
|
|
29
|
-
<BpkHeading level="h3">Heading 3</BpkHeading>
|
|
30
|
-
<BpkHeading level="h4">Heading 4</BpkHeading>
|
|
31
|
-
<BpkHeading level="h5">Heading 5</BpkHeading>
|
|
32
|
-
<BpkHeading level="h6">Heading 6</BpkHeading>
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export default Examples;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
import component from './src/BpkHeading';
|
|
22
|
-
|
|
23
|
-
export default component;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "bpk-component-heading",
|
|
3
|
-
"version": "5.1.0",
|
|
4
|
-
"description": "Backpack heading component.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"private": true,
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git@github.com:Skyscanner/backpack.git"
|
|
10
|
-
},
|
|
11
|
-
"author": "Backpack Design System <backpack@skyscanner.net>",
|
|
12
|
-
"main": "index.js",
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"registry": "https://registry.npmjs.org/"
|
|
15
|
-
},
|
|
16
|
-
"gitHead": "5c156b97cb0ba5e75851d3c763334578714c895e",
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"bpk-mixins": "^26.1.0",
|
|
19
|
-
"bpk-react-utils": "^4.1.0",
|
|
20
|
-
"prop-types": "^15.7.2"
|
|
21
|
-
},
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"react": "^16.3.0 || ^17.0.0"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
22
|
-
import React, { type Node } from 'react';
|
|
23
|
-
import { cssModules } from 'bpk-react-utils';
|
|
24
|
-
|
|
25
|
-
import STYLES from './BpkHeading.module.scss';
|
|
26
|
-
|
|
27
|
-
const getClassName = cssModules(STYLES);
|
|
28
|
-
|
|
29
|
-
type Props = {
|
|
30
|
-
children: Node,
|
|
31
|
-
level: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6',
|
|
32
|
-
className: ?string,
|
|
33
|
-
id: ?string,
|
|
34
|
-
bottomMargin: boolean,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const BpkHeading = (props: Props) => {
|
|
38
|
-
const { bottomMargin, children, className, id, level } = props;
|
|
39
|
-
const classNames = [getClassName(`bpk-heading-${level}`)];
|
|
40
|
-
const Level = level;
|
|
41
|
-
|
|
42
|
-
if (className) {
|
|
43
|
-
classNames.push(className);
|
|
44
|
-
}
|
|
45
|
-
if (!bottomMargin) {
|
|
46
|
-
classNames.push(getClassName('bpk-heading--no-bottom-margin'));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<Level className={classNames.join(' ')} id={id}>
|
|
51
|
-
{children}
|
|
52
|
-
</Level>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
BpkHeading.propTypes = {
|
|
57
|
-
children: PropTypes.node.isRequired,
|
|
58
|
-
level: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']).isRequired,
|
|
59
|
-
className: PropTypes.string,
|
|
60
|
-
id: PropTypes.string,
|
|
61
|
-
bottomMargin: PropTypes.bool,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
BpkHeading.defaultProps = {
|
|
65
|
-
className: null,
|
|
66
|
-
id: null,
|
|
67
|
-
bottomMargin: true,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default BpkHeading;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-heading-h1{font-size:2.5rem;line-height:3rem;font-weight:700}@media (max-width: 32.25rem){.bpk-heading-h1{font-size:2rem;line-height:2.5rem;font-weight:700}}.bpk-heading-h2{font-size:2rem;line-height:2.5rem;font-weight:700}@media (max-width: 32.25rem){.bpk-heading-h2{font-size:1.5rem;line-height:1.75rem;font-weight:700}}.bpk-heading-h3{font-size:1.5rem;line-height:1.75rem;font-weight:700}@media (max-width: 32.25rem){.bpk-heading-h3{font-size:1.25rem;line-height:1.5rem;font-weight:700}}.bpk-heading-h4{font-size:1.25rem;line-height:1.5rem;font-weight:700}@media (max-width: 32.25rem){.bpk-heading-h4{font-size:1rem;line-height:1.25rem;font-weight:700}}.bpk-heading-h5{font-size:1rem;line-height:1.25rem;font-weight:700}.bpk-heading-h6{font-size:1rem;line-height:1.25rem;font-weight:700}.bpk-heading--no-bottom-margin{margin-bottom:0}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
@import '~bpk-mixins/index';
|
|
20
|
-
|
|
21
|
-
.bpk-heading {
|
|
22
|
-
&-h1 {
|
|
23
|
-
@include bpk-heading-1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&-h2 {
|
|
27
|
-
@include bpk-heading-2;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&-h3 {
|
|
31
|
-
@include bpk-heading-3;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&-h4 {
|
|
35
|
-
@include bpk-heading-4;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&-h5 {
|
|
39
|
-
@include bpk-heading-5;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&-h6 {
|
|
43
|
-
@include bpk-heading-6;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&--no-bottom-margin {
|
|
47
|
-
@include bpk-heading--no-bottom-margin;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# This component has been deprecated, please use bpk-component-text instead to apply paragraph styles
|
|
2
|
-
# bpk-component-paragraph
|
|
3
|
-
|
|
4
|
-
> Backpack paragraph component.
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```sh
|
|
9
|
-
npm install bpk-component-paragraph --save-dev
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import BpkParagraph from 'bpk-component-paragraph';
|
|
17
|
-
|
|
18
|
-
export default () => (
|
|
19
|
-
<BpkParagraph>My paragraph content.</BpkParagraph>
|
|
20
|
-
)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Props
|
|
24
|
-
|
|
25
|
-
| Property | PropType | Required | Default Value |
|
|
26
|
-
| --------- | -------- | -------- | ------------- |
|
|
27
|
-
| children | node | true | - |
|
|
28
|
-
| className | string | false | null |
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
import React from 'react';
|
|
22
|
-
|
|
23
|
-
import BpkParagraph from './index';
|
|
24
|
-
|
|
25
|
-
const DefaultExample = () => (
|
|
26
|
-
<div>
|
|
27
|
-
<BpkParagraph>
|
|
28
|
-
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
|
|
29
|
-
ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis
|
|
30
|
-
dis parturient montes, nascetur ridiculus mus.
|
|
31
|
-
</BpkParagraph>
|
|
32
|
-
<BpkParagraph>
|
|
33
|
-
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla
|
|
34
|
-
consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec,
|
|
35
|
-
vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis
|
|
36
|
-
vitae, justo.
|
|
37
|
-
</BpkParagraph>
|
|
38
|
-
<BpkParagraph>
|
|
39
|
-
Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras
|
|
40
|
-
dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.
|
|
41
|
-
Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim.
|
|
42
|
-
</BpkParagraph>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
export default DefaultExample;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
import component from './src/BpkParagraph';
|
|
22
|
-
|
|
23
|
-
export default component;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "bpk-component-paragraph",
|
|
3
|
-
"version": "3.1.0",
|
|
4
|
-
"description": "Backpack paragraph component.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"private": true,
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git@github.com:Skyscanner/backpack.git"
|
|
10
|
-
},
|
|
11
|
-
"author": "Backpack Design System <backpack@skyscanner.net>",
|
|
12
|
-
"main": "index.js",
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"registry": "https://registry.npmjs.org/"
|
|
15
|
-
},
|
|
16
|
-
"gitHead": "5c156b97cb0ba5e75851d3c763334578714c895e",
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"bpk-mixins": "^26.1.0",
|
|
19
|
-
"bpk-react-utils": "^4.1.0",
|
|
20
|
-
"prop-types": "^15.7.2"
|
|
21
|
-
},
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"react": "^16.3.0 || ^17.0.0"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
22
|
-
import React, { type Node } from 'react';
|
|
23
|
-
import { cssModules } from 'bpk-react-utils';
|
|
24
|
-
|
|
25
|
-
import STYLES from './BpkParagraph.module.scss';
|
|
26
|
-
|
|
27
|
-
const getClassName = cssModules(STYLES);
|
|
28
|
-
|
|
29
|
-
type Props = {
|
|
30
|
-
children: Node,
|
|
31
|
-
className: ?string,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const BpkParagraph = (props: Props) => {
|
|
35
|
-
const classNames = [getClassName('bpk-paragraph')];
|
|
36
|
-
const { className, ...rest } = props;
|
|
37
|
-
|
|
38
|
-
if (className) {
|
|
39
|
-
classNames.push(className);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
|
|
43
|
-
return <p className={classNames.join(' ')} {...rest} />;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
BpkParagraph.propTypes = {
|
|
47
|
-
children: PropTypes.node.isRequired,
|
|
48
|
-
className: PropTypes.string,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
BpkParagraph.defaultProps = {
|
|
52
|
-
className: null,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default BpkParagraph;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-paragraph{margin-top:0;margin-bottom:1rem}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
@import '~bpk-mixins/index';
|
|
20
|
-
|
|
21
|
-
$bpk-spacing-v2: true;
|
|
22
|
-
|
|
23
|
-
.bpk-paragraph {
|
|
24
|
-
@include bpk-paragraph;
|
|
25
|
-
}
|
package/bpk-tether/.eslintrc
DELETED
package/bpk-tether/README.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# bpk-tether
|
|
2
|
-
|
|
3
|
-
> Wrapper around the Tether library, along with related utilities
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install bpk-tether --save-dev
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Tether Wrapper
|
|
12
|
-
|
|
13
|
-
A wrapper around the [Tether](http://tether.io/) library which extends the `Tether` object to emit a `position` event.
|
|
14
|
-
|
|
15
|
-
### Usage
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
import { Tether } from 'bpk-tether';
|
|
19
|
-
|
|
20
|
-
this.tether = new Tether({
|
|
21
|
-
classPrefix: 'bpk-popover-tether',
|
|
22
|
-
element: popoverElement,
|
|
23
|
-
target: targetElement,
|
|
24
|
-
tetherOptions: tetherOptions,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
this.tether.on('position', position => console.log('Tether was repositioned', position));
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## getArrowPositionCallback
|
|
31
|
-
|
|
32
|
-
When using Tether to create a popover or tooltip with an arrow pointing towards the target element, we want to have
|
|
33
|
-
this arrow point to the target element at all times. To achieve this, the `getArrowPositionCallback` function returns
|
|
34
|
-
a callback to be used on the `position` event. When invoked, it repositions the arrow element to stick to the target
|
|
35
|
-
element.
|
|
36
|
-
|
|
37
|
-
### Usage
|
|
38
|
-
|
|
39
|
-
```js
|
|
40
|
-
import { Tether } from 'bpk-tether';
|
|
41
|
-
|
|
42
|
-
const classPrefix = 'bpk-popover-tether';
|
|
43
|
-
|
|
44
|
-
this.tether = new Tether({
|
|
45
|
-
classPrefix,
|
|
46
|
-
element: tetherElement,
|
|
47
|
-
target: targetElement,
|
|
48
|
-
tetherOptions: tetherOptions,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
this.tether.on('position', getArrowPositionCallback(tetherElement, 'arrow-id', classPrefix));
|
|
52
|
-
```
|
package/bpk-tether/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import TetherWrapper from './src/TetherWrapper';
|
|
20
|
-
import getArrowPositionCallback from './src/getArrowPositionCallback';
|
|
21
|
-
import applyRTLTransforms from './src/applyRTLTransforms';
|
|
22
|
-
|
|
23
|
-
export default TetherWrapper;
|
|
24
|
-
export { getArrowPositionCallback, applyRTLTransforms };
|
package/bpk-tether/package.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "bpk-tether",
|
|
3
|
-
"version": "1.1.2",
|
|
4
|
-
"description": "Wrapper and utils for Tether.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git@github.com:Skyscanner/backpack.git"
|
|
9
|
-
},
|
|
10
|
-
"author": "Backpack Design System <backpack@skyscanner.net>",
|
|
11
|
-
"main": "index.js",
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"registry": "https://registry.npmjs.org/"
|
|
14
|
-
},
|
|
15
|
-
"gitHead": "09fc99e4e67a5b71dc15f41a5409ad412bc139d4",
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"tether": "^2.0.0"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import Tether from 'tether';
|
|
20
|
-
|
|
21
|
-
// We extend tether to hook into the position function in order to expose
|
|
22
|
-
// a `position` event on the tether object. Useful for repositioning arrows
|
|
23
|
-
// etc. See http://tether.io/advanced/extending_tether/.
|
|
24
|
-
Tether.modules.push({
|
|
25
|
-
position(props) {
|
|
26
|
-
this.trigger('position', props);
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export default Tether;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import { isRTL } from 'bpk-react-utils';
|
|
20
|
-
|
|
21
|
-
const tryFlipAttachmentString = (value) => {
|
|
22
|
-
if (value.indexOf('right') !== -1) {
|
|
23
|
-
return value.replace('right', 'left');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return value.replace('left', 'right');
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const transform = (tetherOptions) => {
|
|
30
|
-
const { attachment, targetAttachment, ...rest } = tetherOptions;
|
|
31
|
-
|
|
32
|
-
const options = {};
|
|
33
|
-
|
|
34
|
-
if (attachment) {
|
|
35
|
-
options.attachment = isRTL()
|
|
36
|
-
? tryFlipAttachmentString(attachment)
|
|
37
|
-
: attachment;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (targetAttachment) {
|
|
41
|
-
options.targetAttachment = isRTL()
|
|
42
|
-
? tryFlipAttachmentString(targetAttachment)
|
|
43
|
-
: targetAttachment;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return { ...options, ...rest };
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default transform;
|