@skyscanner/backpack-web 36.18.0 → 37.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/bpk-component-button/src/BpkButtonBase.module.css +1 -1
  2. package/bpk-component-button/src/BpkButtonV2/BpkButton.module.css +1 -1
  3. package/bpk-component-carousel/src/BpkCarousel.js +0 -2
  4. package/bpk-component-checkbox/src/BpkCheckbox.module.css +1 -1
  5. package/bpk-component-icon/all.d.ts +2 -1
  6. package/bpk-component-icon/all.js +2 -1
  7. package/bpk-component-icon/lg/award.js +1 -1
  8. package/bpk-component-icon/lg/baggage-personal-item.js +14 -0
  9. package/bpk-component-icon/lg/bus.js +8 -5
  10. package/bpk-component-icon/sm/award.js +1 -1
  11. package/bpk-component-icon/sm/baggage-personal-item.js +14 -0
  12. package/bpk-component-icon/sm/bus.js +3 -2
  13. package/bpk-component-icon/sm/check.js +18 -0
  14. package/bpk-component-icon/xl/star-half.js +14 -0
  15. package/bpk-component-icon/xl/star-outline.js +14 -0
  16. package/bpk-component-icon/xl/star.js +14 -0
  17. package/bpk-component-inset-banner/src/BpkInsetBanner.d.ts +3 -0
  18. package/bpk-component-inset-banner/src/BpkInsetBanner.js +8 -0
  19. package/bpk-component-inset-banner/src/BpkInsetBanner.module.css +1 -1
  20. package/bpk-component-link/src/BpkLink.js +11 -5
  21. package/bpk-component-link/src/BpkLink.module.css +1 -1
  22. package/bpk-component-overlay/src/BpkOverlay.d.ts +2 -2
  23. package/bpk-component-overlay/src/BpkOverlay.js +4 -4
  24. package/bpk-component-overlay/src/BpkOverlay.module.css +1 -1
  25. package/bpk-component-page-indicator/index.d.ts +6 -0
  26. package/bpk-component-page-indicator/index.js +3 -1
  27. package/bpk-component-page-indicator/src/BpkPageIndicator.d.ts +21 -0
  28. package/bpk-component-page-indicator/src/BpkPageIndicator.js +49 -68
  29. package/bpk-component-page-indicator/src/NavButton.d.ts +15 -0
  30. package/bpk-component-page-indicator/src/NavButton.js +22 -35
  31. package/bpk-component-price/src/BpkPrice.js +6 -2
  32. package/bpk-component-tooltip/index.d.ts +4 -4
  33. package/bpk-component-tooltip/index.js +2 -2
  34. package/bpk-component-tooltip/src/BpkTooltip.d.ts +17 -4
  35. package/bpk-component-tooltip/src/BpkTooltip.js +100 -23
  36. package/bpk-component-tooltip/src/BpkTooltip.module.css +1 -1
  37. package/bpk-mixins/_buttons.scss +5 -1
  38. package/bpk-mixins/_forms.scss +5 -26
  39. package/bpk-mixins/_typography.scss +101 -8
  40. package/package.json +3 -3
  41. package/unstable__bpk-mixins/_buttons.scss +5 -1
  42. package/unstable__bpk-mixins/_forms.scss +5 -28
  43. package/unstable__bpk-mixins/_typography.scss +101 -8
  44. package/bpk-component-tooltip/src/BpkTooltipPortal.d.ts +0 -54
  45. package/bpk-component-tooltip/src/BpkTooltipPortal.js +0 -154
@@ -14,7 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import NavButton, { DIRECTIONS } from "./NavButton";
20
21
  import STYLES from "./BpkPageIndicator.module.css";
@@ -27,84 +28,64 @@ export const VARIANT = {
27
28
  overImage: 'overImage'
28
29
  };
29
30
  const BpkPageIndicator = ({
30
- className,
31
+ className = undefined,
31
32
  currentIndex,
32
33
  indicatorLabel,
33
34
  nextNavLabel,
34
- onClick,
35
+ onClick = () => {},
35
36
  prevNavLabel,
36
- showNav,
37
+ showNav = false,
37
38
  totalIndicators,
38
- variant
39
+ variant = VARIANT.default
39
40
  }) => {
40
41
  /**
41
42
  * This validation is used to avoid an a11y issue when onClick isn't available.
42
43
  * In this case, we can set aria-hidden = true to let screen reader skip reading page indicator dots.
43
44
  * and render the dot as div rather than button to align with aria-hidden = true.
44
- */
45
+ */
45
46
  const isInteractive = !!onClick;
46
- return (
47
- /*#__PURE__*/
48
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
49
- _jsx("div", {
50
- className: className,
51
- "aria-hidden": isInteractive ? 'false' : 'true',
52
- "data-testid": "indicator-container",
53
- children: /*#__PURE__*/_jsxs("div", {
54
- className: getClassName('bpk-page-indicator', showNav && 'bpk-page-indicator__showNav'),
55
- children: [showNav && /*#__PURE__*/_jsx(NavButton, {
56
- currentIndex: currentIndex,
57
- onClick: onClick,
58
- disabled: currentIndex === 0,
59
- direction: DIRECTIONS.PREV,
60
- ariaLabel: prevNavLabel
61
- }), /*#__PURE__*/_jsx("div", {
62
- className: getClassName('bpk-page-indicator__container'),
63
- children: /*#__PURE__*/_jsx("div", {
64
- className: getClassName('bpk-page-indicator__indicators-container'),
65
- style: currentIndex > START_SCROLL_INDEX ? {
66
- '--scroll-index': totalIndicators > DISPLAYED_TOTAL ? Math.min(currentIndex - START_SCROLL_INDEX, totalIndicators - DISPLAYED_TOTAL) : 0
67
- } : undefined,
68
- children: [...Array(totalIndicators)].map((val, index) => isInteractive ? /*#__PURE__*/_jsx("button", {
69
- type: "button",
70
- onClick: e => {
71
- onClick(e, index, DIRECTIONS.INDICATORS);
72
- },
73
- className: getClassName('bpk-page-indicator__indicator', `bpk-page-indicator__indicator--${variant}`, index === currentIndex && `bpk-page-indicator__indicator--active-${variant}`),
74
- "aria-label": `${indicatorLabel} ${index + 1}`,
75
- "aria-current": currentIndex === index ? 'true' : 'false'
76
- // eslint-disable-next-line react/no-array-index-key
77
- }, `indicator-${index}`) : /*#__PURE__*/_jsx("div", {
78
- className: getClassName('bpk-page-indicator__indicator', `bpk-page-indicator__indicator--${variant}`, index === currentIndex && `bpk-page-indicator__indicator--active-${variant}`)
79
- // eslint-disable-next-line react/no-array-index-key
80
- }, `indicator-${index}`))
81
- })
82
- }), showNav && /*#__PURE__*/_jsx(NavButton, {
83
- currentIndex: currentIndex,
84
- onClick: onClick,
85
- disabled: currentIndex === totalIndicators - 1,
86
- ariaLabel: nextNavLabel,
87
- direction: DIRECTIONS.NEXT
88
- })]
89
- })
47
+ const customStyle = {
48
+ '--scroll-index': totalIndicators > DISPLAYED_TOTAL ? Math.min(currentIndex - START_SCROLL_INDEX, totalIndicators - DISPLAYED_TOTAL) : 0
49
+ };
50
+ return /*#__PURE__*/_jsx("div", {
51
+ className: className,
52
+ "aria-hidden": isInteractive ? 'false' : 'true',
53
+ "data-testid": "indicator-container",
54
+ children: /*#__PURE__*/_jsxs("div", {
55
+ className: getClassName('bpk-page-indicator', showNav && 'bpk-page-indicator__showNav'),
56
+ children: [showNav && /*#__PURE__*/_jsx(NavButton, {
57
+ currentIndex: currentIndex,
58
+ onClick: onClick,
59
+ disabled: currentIndex === 0,
60
+ direction: DIRECTIONS.PREV,
61
+ ariaLabel: prevNavLabel
62
+ }), /*#__PURE__*/_jsx("div", {
63
+ className: getClassName('bpk-page-indicator__container'),
64
+ children: /*#__PURE__*/_jsx("div", {
65
+ className: getClassName('bpk-page-indicator__indicators-container'),
66
+ style: currentIndex > START_SCROLL_INDEX ? customStyle : undefined,
67
+ children: [...Array(totalIndicators)].map((val, index) => isInteractive ? /*#__PURE__*/_jsx("button", {
68
+ type: "button",
69
+ onClick: e => {
70
+ onClick(e, index, DIRECTIONS.INDICATORS);
71
+ },
72
+ className: getClassName('bpk-page-indicator__indicator', `bpk-page-indicator__indicator--${variant}`, index === currentIndex && `bpk-page-indicator__indicator--active-${variant}`),
73
+ "aria-label": `${indicatorLabel} ${index + 1}`,
74
+ "aria-current": currentIndex === index ? 'true' : 'false'
75
+ // eslint-disable-next-line react/no-array-index-key
76
+ }, `indicator-${index}`) : /*#__PURE__*/_jsx("div", {
77
+ className: getClassName('bpk-page-indicator__indicator', `bpk-page-indicator__indicator--${variant}`, index === currentIndex && `bpk-page-indicator__indicator--active-${variant}`)
78
+ // eslint-disable-next-line react/no-array-index-key
79
+ }, `indicator-${index}`))
80
+ })
81
+ }), showNav && /*#__PURE__*/_jsx(NavButton, {
82
+ currentIndex: currentIndex,
83
+ onClick: onClick,
84
+ disabled: currentIndex === totalIndicators - 1,
85
+ ariaLabel: nextNavLabel,
86
+ direction: DIRECTIONS.NEXT
87
+ })]
90
88
  })
91
- );
92
- };
93
- BpkPageIndicator.propTypes = {
94
- indicatorLabel: PropTypes.string,
95
- prevNavLabel: PropTypes.string,
96
- nextNavLabel: PropTypes.string,
97
- currentIndex: PropTypes.number.isRequired,
98
- totalIndicators: PropTypes.number.isRequired,
99
- variant: PropTypes.oneOf(Object.keys(VARIANT)),
100
- onClick: PropTypes.func,
101
- className: PropTypes.string,
102
- showNav: PropTypes.bool
103
- };
104
- BpkPageIndicator.defaultProps = {
105
- onClick: null,
106
- className: null,
107
- showNav: false,
108
- variant: VARIANT.default
89
+ });
109
90
  };
110
91
  export default BpkPageIndicator;
@@ -0,0 +1,15 @@
1
+ export declare const DIRECTIONS: {
2
+ readonly PREV: "PREV";
3
+ readonly INDICATORS: "INDICATORS";
4
+ readonly NEXT: "NEXT";
5
+ };
6
+ type Direction = (typeof DIRECTIONS)[keyof typeof DIRECTIONS];
7
+ type Props = {
8
+ ariaLabel: string | undefined;
9
+ currentIndex: number;
10
+ direction: Direction;
11
+ disabled?: boolean;
12
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>, newIndex: number, direction: Direction) => void;
13
+ };
14
+ declare const NavButton: ({ ariaLabel, currentIndex, direction, disabled, onClick, }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ export default NavButton;
@@ -14,7 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
17
+ */
18
+
18
19
  import { BUTTON_TYPES, BpkButtonV2 } from "../../bpk-component-button";
19
20
  import { withButtonAlignment, withRtlSupport } from "../../bpk-component-icon";
20
21
  import LeftArrowIcon from "../../bpk-component-icon/lg/chevron-left";
@@ -27,38 +28,24 @@ export const DIRECTIONS = {
27
28
  };
28
29
  const AlignedLeftArrowIcon = withButtonAlignment(withRtlSupport(LeftArrowIcon));
29
30
  const AlignedRightArrowIcon = withButtonAlignment(withRtlSupport(RightArrowIcon));
30
- const NavButton = props => {
31
- const {
32
- ariaLabel,
33
- currentIndex,
34
- direction,
35
- disabled,
36
- onClick
37
- } = props;
38
- return /*#__PURE__*/_jsx(BpkButtonV2, {
39
- iconOnly: true,
40
- type: BUTTON_TYPES.link,
41
- onClick: e => {
42
- if (direction === DIRECTIONS.PREV) {
43
- onClick(e, currentIndex - 1, direction);
44
- } else {
45
- onClick(e, currentIndex + 1, direction);
46
- }
47
- },
48
- "aria-label": ariaLabel,
49
- disabled: disabled,
50
- children: direction === DIRECTIONS.PREV ? /*#__PURE__*/_jsx(AlignedLeftArrowIcon, {}) : /*#__PURE__*/_jsx(AlignedRightArrowIcon, {})
51
- });
52
- };
53
- NavButton.propTypes = {
54
- direction: PropTypes.oneOf(Object.keys(DIRECTIONS)).isRequired,
55
- disabled: PropTypes.bool,
56
- ariaLabel: PropTypes.string.isRequired,
57
- currentIndex: PropTypes.number.isRequired,
58
- onClick: PropTypes.func
59
- };
60
- NavButton.defaultProps = {
61
- disabled: false,
62
- onClick: null
63
- };
31
+ const NavButton = ({
32
+ ariaLabel,
33
+ currentIndex,
34
+ direction,
35
+ disabled = false,
36
+ onClick = () => {}
37
+ }) => /*#__PURE__*/_jsx(BpkButtonV2, {
38
+ iconOnly: true,
39
+ type: BUTTON_TYPES.link,
40
+ onClick: e => {
41
+ if (direction === DIRECTIONS.PREV) {
42
+ onClick(e, currentIndex - 1, direction);
43
+ } else {
44
+ onClick(e, currentIndex + 1, direction);
45
+ }
46
+ },
47
+ "aria-label": ariaLabel,
48
+ disabled: disabled,
49
+ children: direction === DIRECTIONS.PREV ? /*#__PURE__*/_jsx(AlignedLeftArrowIcon, {}) : /*#__PURE__*/_jsx(AlignedRightArrowIcon, {})
50
+ });
64
51
  export default NavButton;
@@ -40,6 +40,7 @@ const BpkPrice = props => {
40
40
  const {
41
41
  align,
42
42
  className,
43
+ dataAttributes,
43
44
  icon,
44
45
  leadingClassName,
45
46
  leadingText,
@@ -107,6 +108,7 @@ const BpkPrice = props => {
107
108
  children: /*#__PURE__*/_jsx(BpkText, {
108
109
  textStyle: priceTextStyle,
109
110
  tagName: "span",
111
+ ...dataAttributes,
110
112
  children: price
111
113
  })
112
114
  }), icon && /*#__PURE__*/_jsx("span", {
@@ -124,7 +126,8 @@ BpkPrice.propTypes = {
124
126
  leadingText: PropTypes.string,
125
127
  trailingText: PropTypes.string,
126
128
  previousPrice: PropTypes.string,
127
- leadingClassName: PropTypes.string
129
+ leadingClassName: PropTypes.string,
130
+ dataAttributes: PropTypes.objectOf(PropTypes.string)
128
131
  };
129
132
  BpkPrice.defaultProps = {
130
133
  size: SIZES.small,
@@ -133,6 +136,7 @@ BpkPrice.defaultProps = {
133
136
  leadingText: null,
134
137
  trailingText: null,
135
138
  previousPrice: null,
136
- leadingClassName: null
139
+ leadingClassName: null,
140
+ dataAttributes: {}
137
141
  };
138
142
  export default BpkPrice;
@@ -1,6 +1,6 @@
1
- import BpkTooltipPortal from './src/BpkTooltipPortal';
1
+ import BpkTooltip from './src/BpkTooltip';
2
2
  import { TOOLTIP_TYPES } from './src/constants';
3
- import type { Props } from './src/BpkTooltipPortal';
4
- export type BpkTooltipPortalProps = Props;
5
- export default BpkTooltipPortal;
3
+ import type { Props } from './src/BpkTooltip';
4
+ export type BpkTooltipProps = Props;
5
+ export default BpkTooltip;
6
6
  export { TOOLTIP_TYPES };
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import BpkTooltipPortal from "./src/BpkTooltipPortal";
19
+ import BpkTooltip from "./src/BpkTooltip";
20
20
  import { TOOLTIP_TYPES } from "./src/constants";
21
- export default BpkTooltipPortal;
21
+ export default BpkTooltip;
22
22
  export { TOOLTIP_TYPES };
@@ -1,11 +1,24 @@
1
- import type { ReactNode } from 'react';
1
+ import type { ReactNode, ReactElement } from 'react';
2
2
  import { TOOLTIP_TYPES } from './constants';
3
- export type TooltipProps = {
3
+ import type { Placement } from '@floating-ui/react';
4
+ export type Props = {
5
+ /**
6
+ * Tooltips are invisible to assistive technologies such as screen readers.
7
+ * To improve accessibility, `ariaLabel` is required to describe the content of the tooltip to assistive technologies.
8
+ * The label will be used on the `target` element, so any existing `aria-label` attached to `target` will be overridden.
9
+ */
10
+ ariaLabel: string;
11
+ /**
12
+ * "target" should be a DOM element.
13
+ */
14
+ target: ReactElement<any>;
4
15
  id: string;
5
16
  children: ReactNode | string;
6
17
  type?: (typeof TOOLTIP_TYPES)[keyof typeof TOOLTIP_TYPES];
7
18
  padded?: boolean;
8
- className?: string | null;
19
+ hideOnTouchDevices?: boolean;
20
+ placement?: Placement;
21
+ isOpen?: boolean;
9
22
  };
10
- declare const BpkTooltip: ({ children, className, id, padded, type, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const BpkTooltip: ({ ariaLabel, children, hideOnTouchDevices, id, isOpen, padded, placement, target, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
11
24
  export default BpkTooltip;
@@ -22,42 +22,119 @@ This is the component for the tooltip that is displayed to users.
22
22
  The actual component that developers create (i.e. the default export from this package) is BpkTooltipPortal.
23
23
  */
24
24
 
25
+ import { cloneElement, useRef, useState, useEffect } from 'react';
26
+ import { arrow, FloatingArrow, FloatingPortal, offset, shift, useFloating, useHover, useInteractions, useRole } from '@floating-ui/react';
27
+ import { surfaceHighlightDay } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
25
28
  import { TransitionInitialMount, cssModules } from "../../bpk-react-utils";
26
29
  import { ARROW_ID, TOOLTIP_TYPES } from "./constants";
27
30
  import STYLES from "./BpkTooltip.module.css";
28
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
29
32
  const getClassName = cssModules(STYLES);
33
+
34
+ // The stroke width is used to set the border width of the arrow.
35
+ const strokeWidth = 1;
36
+ // This function is to ensure the arrow alignment when used on the top and bottom
37
+ // doesn't look clipped away from the tooltip. This is due to our use of box-shadows that makes it look floating away,
38
+ // so we need to compensate slightly to make it look as one.
39
+ const getArrowAlignment = placement => {
40
+ if (placement.includes('bottom')) {
41
+ return {
42
+ bottom: '98%'
43
+ };
44
+ }
45
+ if (placement.includes('top')) {
46
+ return {
47
+ top: '98%'
48
+ };
49
+ }
50
+ return undefined;
51
+ };
52
+ const hasTouchSupport = () => !!(typeof window !== 'undefined' && ('ontouchstart' in window || navigator.maxTouchPoints > 0));
30
53
  const BpkTooltip = ({
54
+ ariaLabel,
31
55
  children,
32
- className = null,
56
+ hideOnTouchDevices = true,
33
57
  id,
58
+ isOpen = false,
34
59
  padded = true,
60
+ placement = 'bottom',
61
+ target,
35
62
  type = TOOLTIP_TYPES.light,
36
63
  ...rest
37
64
  }) => {
38
- const classNames = getClassName('bpk-tooltip', className);
65
+ const [isOpenState, setIsOpenState] = useState(isOpen);
66
+ const arrowRef = useRef(null);
67
+ useEffect(() => {
68
+ if (!isOpen) {
69
+ setIsOpenState(false);
70
+ }
71
+ }, [isOpen]);
72
+ const {
73
+ context,
74
+ floatingStyles,
75
+ refs
76
+ } = useFloating({
77
+ open: isOpenState,
78
+ onOpenChange: setIsOpenState,
79
+ placement,
80
+ middleware: [offset(8), shift(), arrow({
81
+ element: arrowRef
82
+ })]
83
+ });
84
+ const hover = useHover(context, {
85
+ mouseOnly: !hasTouchSupport() || !hideOnTouchDevices
86
+ });
87
+ const role = useRole(context, {
88
+ role: 'tooltip'
89
+ });
90
+ const {
91
+ getFloatingProps,
92
+ getReferenceProps
93
+ } = useInteractions([hover, role]);
94
+ const targetWithAccessibilityProps = /*#__PURE__*/cloneElement(target, {
95
+ tabIndex: '0',
96
+ 'aria-label': ariaLabel,
97
+ role: 'tooltip',
98
+ ref: refs.setReference,
99
+ ...getReferenceProps()
100
+ });
101
+ const classNames = getClassName('bpk-tooltip');
39
102
  const innerClassNames = getClassName('bpk-tooltip__inner', type === TOOLTIP_TYPES.dark && 'bpk-tooltip__inner--dark', padded && 'bpk-tooltip__inner--padded');
40
103
  const arrowClassNames = getClassName('bpk-tooltip__arrow', type === TOOLTIP_TYPES.dark && 'bpk-tooltip__arrow--dark');
41
- return /*#__PURE__*/_jsx(TransitionInitialMount, {
42
- appearClassName: getClassName('bpk-tooltip--appear'),
43
- appearActiveClassName: getClassName('bpk-tooltip--appear-active'),
44
- transitionTimeout: 200,
45
- children: /*#__PURE__*/_jsxs("section", {
46
- id: id,
47
- tabIndex: -1,
48
- role: "dialog",
49
- className: classNames,
50
- ...rest,
51
- children: [/*#__PURE__*/_jsx("span", {
52
- id: ARROW_ID,
53
- "data-popper-arrow": true,
54
- className: arrowClassNames,
55
- role: "presentation"
56
- }), /*#__PURE__*/_jsx("div", {
57
- className: innerClassNames,
58
- children: children
59
- })]
60
- })
104
+ return /*#__PURE__*/_jsxs(_Fragment, {
105
+ children: [targetWithAccessibilityProps, isOpenState && /*#__PURE__*/_jsx(FloatingPortal, {
106
+ children: /*#__PURE__*/_jsx("div", {
107
+ className: getClassName('bpk-tooltip--container'),
108
+ ref: refs.setFloating,
109
+ style: floatingStyles,
110
+ ...getFloatingProps(),
111
+ children: /*#__PURE__*/_jsx(TransitionInitialMount, {
112
+ appearClassName: getClassName('bpk-tooltip--appear'),
113
+ appearActiveClassName: getClassName('bpk-tooltip--appear-active'),
114
+ transitionTimeout: 200,
115
+ children: /*#__PURE__*/_jsxs("section", {
116
+ id: id,
117
+ tabIndex: -1,
118
+ role: "dialog",
119
+ className: classNames,
120
+ ...rest,
121
+ children: [/*#__PURE__*/_jsx(FloatingArrow, {
122
+ ref: arrowRef,
123
+ context: context,
124
+ id: ARROW_ID,
125
+ className: arrowClassNames,
126
+ role: "presentation",
127
+ stroke: surfaceHighlightDay,
128
+ strokeWidth: strokeWidth,
129
+ style: getArrowAlignment(context.placement)
130
+ }), /*#__PURE__*/_jsx("div", {
131
+ className: innerClassNames,
132
+ children: children
133
+ })]
134
+ })
135
+ })
136
+ })
137
+ })]
61
138
  });
62
139
  };
63
140
  export default BpkTooltip;
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-tooltip-portal{z-index:900}.bpk-tooltip-portal--target{display:inline-block}.bpk-tooltip{transition:opacity 200ms ease-in-out,transform 200ms ease-in-out;outline:0;opacity:1}.bpk-tooltip--appear{opacity:0}.bpk-tooltip-portal[data-popper-placement=top] .bpk-tooltip--appear:not(.bpk-tooltip--appear-active){transform:translate(0, -1rem);transition:none}.bpk-tooltip-portal[data-popper-placement=right] .bpk-tooltip--appear:not(.bpk-tooltip--appear-active){transform:translate(1rem, 0);transition:none}.bpk-tooltip-portal[data-popper-placement=bottom] .bpk-tooltip--appear:not(.bpk-tooltip--appear-active){transform:translate(0, 1rem);transition:none}.bpk-tooltip-portal[data-popper-placement=left] .bpk-tooltip--appear:not(.bpk-tooltip--appear-active){transform:translate(-1rem, 0);transition:none}.bpk-tooltip--appear-active{transform:translate(0, 0);transition:opacity 200ms ease-in-out,transform 200ms ease-in-out;opacity:1}.bpk-tooltip__arrow{position:absolute;width:.5rem;height:.5rem;transform:rotate(45deg);border:.0625rem solid rgba(0,0,0,0);background:inherit;background-color:#fff}.bpk-tooltip-portal[data-popper-placement=top] .bpk-tooltip__arrow{bottom:-0.1875rem;border-right-color:#c1c7cf;border-bottom-color:#c1c7cf}.bpk-tooltip-portal[data-popper-placement=right] .bpk-tooltip__arrow{left:-0.1875rem;border-bottom-color:#c1c7cf;border-left-color:#c1c7cf}.bpk-tooltip-portal[data-popper-placement=bottom] .bpk-tooltip__arrow{top:-0.1875rem;border-top-color:#c1c7cf;border-left-color:#c1c7cf}.bpk-tooltip-portal[data-popper-placement=left] .bpk-tooltip__arrow{right:-0.1875rem;border-top-color:#c1c7cf;border-right-color:#c1c7cf}.bpk-tooltip__arrow--dark{background-color:#05203c}.bpk-tooltip-portal[data-popper-placement=top] .bpk-tooltip__arrow--dark{border-right-color:#05203c;border-bottom-color:#05203c}.bpk-tooltip-portal[data-popper-placement=right] .bpk-tooltip__arrow--dark{border-bottom-color:#05203c;border-left-color:#05203c}.bpk-tooltip-portal[data-popper-placement=bottom] .bpk-tooltip__arrow--dark{border-top-color:#05203c;border-left-color:#05203c}.bpk-tooltip-portal[data-popper-placement=left] .bpk-tooltip__arrow--dark{border-top-color:#05203c;border-right-color:#05203c}.bpk-tooltip__inner{overflow:hidden;border:.0625rem solid #e0e4e9;background-color:#fff;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}.bpk-tooltip__inner--padded{padding:.5rem 1rem}.bpk-tooltip__inner--dark{color:#fff;border:.0625rem solid #05203c;background-color:#05203c;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}
18
+ .bpk-tooltip--container{z-index:900}.bpk-tooltip{transition:opacity 200ms ease-in-out;outline:0;opacity:1;border:.0625rem solid #e0e4e9;background-color:#fff;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}.bpk-tooltip--appear{opacity:0}.bpk-tooltip--appear-active{opacity:1}.bpk-tooltip__arrow{width:.5rem;height:.5rem;fill:#fff}.bpk-tooltip__arrow--dark{fill:#05203c}.bpk-tooltip__inner--padded{padding:.5rem 1rem}.bpk-tooltip__inner--dark{color:#fff;border:.0625rem solid #05203c;background-color:#05203c;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}
@@ -395,7 +395,11 @@
395
395
  background: none; /* stylelint-disable-line order/order, order/properties-order */
396
396
  box-shadow: none;
397
397
 
398
- @include bpk-link;
398
+ @include bpk-link--implicit;
399
+
400
+ &::after {
401
+ bottom: auto;
402
+ }
399
403
 
400
404
  padding: $vertical-padding 0; /* stylelint-disable-line order/order, order/properties-order */
401
405
  color: $bpk-private-button-link-normal-foreground-day;
@@ -627,34 +627,13 @@
627
627
  /// @include bpk-checkbox__checkmark();
628
628
  /// }
629
629
  @mixin bpk-checkbox__checkmark {
630
- &::before,
631
- &::after {
632
- position: absolute;
633
- content: '';
634
- transform: rotate(45deg);
635
- border-radius: $bpk-border-size-lg;
636
- background-color: $bpk-text-primary-inverse-day;
637
- }
638
-
639
- &::before {
640
- top: bpk-spacing-md() - $bpk-one-pixel-rem;
641
- left: 0;
642
- width: bpk-spacing-lg() / 3;
643
- height: bpk-spacing-sm() - $bpk-one-pixel-rem;
644
- }
645
-
646
- &::after {
647
- top: bpk-spacing-sm() / 2;
648
- left: bpk-spacing-md() - $bpk-one-pixel-rem;
649
- width: bpk-spacing-sm() - $bpk-one-pixel-rem;
650
- height: bpk-spacing-md() + ($bpk-one-pixel-rem * 3);
651
- }
630
+ background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%229%22%20viewBox%3D%220%200%2013%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.35352%203.64648L5.5%207.5L11.5%201.5%22%20stroke%3D%22white%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
631
+ background-repeat: no-repeat;
632
+ background-position: $bpk-one-pixel-rem center;
633
+ background-size: calc(100% - $bpk-one-pixel-rem * 2.5) auto;
652
634
 
653
635
  &:disabled {
654
- &::before,
655
- &::after {
656
- background-color: $bpk-text-disabled-day;
657
- }
636
+ background-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%229%22%20viewBox%3D%220%200%2013%209%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.35352%203.64648L5.5%207.5L11.5%201.5%22%20stroke%3D%22lightgrey%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E');
658
637
  }
659
638
  }
660
639