@skyscanner/backpack-web 36.15.0 → 36.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bpk-component-drawer/src/BpkDrawer.d.ts +2 -1
- package/bpk-component-drawer/src/BpkDrawer.js +4 -2
- package/bpk-component-drawer/src/BpkDrawerContent.d.ts +2 -1
- package/bpk-component-drawer/src/BpkDrawerContent.js +4 -0
- package/bpk-component-drawer/src/BpkDrawerContent.module.css +1 -1
- package/bpk-component-inset-banner/src/BpkInsetBanner.d.ts +1 -0
- package/bpk-component-inset-banner/src/BpkInsetBanner.js +2 -1
- package/bpk-component-modal/src/BpkModalInner.d.ts +2 -1
- package/bpk-component-modal/src/BpkModalInner.js +2 -0
- package/bpk-component-popover/src/BpkPopover.d.ts +2 -1
- package/bpk-component-popover/src/BpkPopover.js +5 -1
- package/bpk-component-popover/src/BpkPopover.module.css +1 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControl.js +0 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControl.module.css +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export type Props = {
|
|
|
8
8
|
}) => void;
|
|
9
9
|
title: string;
|
|
10
10
|
getApplicationElement: () => HTMLElement | null;
|
|
11
|
+
width?: string;
|
|
11
12
|
renderTarget?: null | HTMLElement | (() => null | HTMLElement);
|
|
12
13
|
dialogRef?: (ref: HTMLElement | null | undefined) => void;
|
|
13
14
|
className?: string;
|
|
@@ -20,5 +21,5 @@ export type Props = {
|
|
|
20
21
|
padded?: boolean;
|
|
21
22
|
mobileModalDisplay?: boolean;
|
|
22
23
|
};
|
|
23
|
-
declare const BpkDrawer: ({ children, className, closeLabel, closeText, contentClassName, dialogRef, getApplicationElement, hideTitle, id, isIpad, isIphone, isOpen, mobileModalDisplay, onClose, padded, renderTarget, title, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const BpkDrawer: ({ children, className, closeLabel, closeText, contentClassName, dialogRef, getApplicationElement, hideTitle, id, isIpad, isIphone, isOpen, mobileModalDisplay, onClose, padded, renderTarget, title, width, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export default BpkDrawer;
|
|
@@ -37,7 +37,8 @@ const BpkDrawer = ({
|
|
|
37
37
|
onClose,
|
|
38
38
|
padded = true,
|
|
39
39
|
renderTarget = null,
|
|
40
|
-
title
|
|
40
|
+
title,
|
|
41
|
+
width = '90%'
|
|
41
42
|
}) => {
|
|
42
43
|
const [isDrawerShown, setIsDrawerShown] = useState(true);
|
|
43
44
|
useEffect(() => {
|
|
@@ -62,7 +63,8 @@ const BpkDrawer = ({
|
|
|
62
63
|
title: title,
|
|
63
64
|
dialogRef: dialogRef,
|
|
64
65
|
closeLabel: closeLabel || "",
|
|
65
|
-
closeText: closeText
|
|
66
|
+
closeText: closeText,
|
|
67
|
+
width: width
|
|
66
68
|
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
67
69
|
,
|
|
68
70
|
className: className,
|
|
@@ -6,6 +6,7 @@ type Props = {
|
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
id: string;
|
|
8
8
|
title: string;
|
|
9
|
+
width?: string;
|
|
9
10
|
className?: string | null;
|
|
10
11
|
contentClassName?: string;
|
|
11
12
|
closeLabel?: string;
|
|
@@ -18,5 +19,5 @@ type Props = {
|
|
|
18
19
|
padded?: boolean;
|
|
19
20
|
mobileModalDisplay?: boolean;
|
|
20
21
|
};
|
|
21
|
-
declare const BpkDrawerContent: ({ children, className, closeLabel, closeOnScrimClick, closeText, contentClassName, dialogRef, hideTitle, id, isDrawerShown, isIpad, isIphone, mobileModalDisplay, onClose, onCloseAnimationComplete, padded, title, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare const BpkDrawerContent: ({ children, className, closeLabel, closeOnScrimClick, closeText, contentClassName, dialogRef, hideTitle, id, isDrawerShown, isIpad, isIphone, mobileModalDisplay, onClose, onCloseAnimationComplete, padded, title, width, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export default BpkDrawerContent;
|
|
@@ -48,6 +48,7 @@ const BpkDrawerContent = ({
|
|
|
48
48
|
onCloseAnimationComplete,
|
|
49
49
|
padded,
|
|
50
50
|
title,
|
|
51
|
+
width,
|
|
51
52
|
...rest
|
|
52
53
|
}) => {
|
|
53
54
|
const drawerClassNames = [getClassName('bpk-drawer')];
|
|
@@ -81,6 +82,9 @@ const BpkDrawerContent = ({
|
|
|
81
82
|
tabIndex: -1,
|
|
82
83
|
role: "dialog",
|
|
83
84
|
"aria-labelledby": headingId,
|
|
85
|
+
style: {
|
|
86
|
+
'--dynamic-width': width
|
|
87
|
+
},
|
|
84
88
|
className: [drawerClassNames.join(' '), getClassName(`bpk-drawer--${status}`, mobileModalDisplay ? `bpk-drawer__modal-mobile-view--${status}` : undefined)].join(' '),
|
|
85
89
|
ref: dialogRef,
|
|
86
90
|
...rest,
|
|
@@ -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-drawer{position:fixed;right:0;display:flex;z-index:1100;width:
|
|
18
|
+
.bpk-drawer{position:fixed;right:0;display:flex;z-index:1100;width:var(--dynamic-width);height:100%;flex-direction:column;transform:translate(100%);transition:transform 400ms ease;outline:0;background:#fff;overflow-y:scroll;box-shadow:0px 12px 50px 0px rgba(37,32,31,.25)}html[dir=rtl] .bpk-drawer{right:auto;left:0;transform:translate(-100%)}@media(max-width: 32rem){.bpk-drawer{width:100%;max-width:100%}}.bpk-drawer--entering,.bpk-drawer--entered{transform:translate(0)}html[dir=rtl] .bpk-drawer--entering,html[dir=rtl] .bpk-drawer--entered{transform:translate(0)}.bpk-drawer--exiting{transition:transform 400ms ease}.bpk-drawer--exiting,.bpk-drawer--exited{transform:translate(100%)}html[dir=rtl] .bpk-drawer--exiting,html[dir=rtl] .bpk-drawer--exited{transform:translate(-100%)}.bpk-drawer__header{display:flex;min-height:3rem;padding:1rem;justify-content:space-between;align-items:center;flex:0 0}.bpk-drawer__heading{margin:0;font-size:1rem;line-height:1.5rem;font-weight:700}.bpk-drawer__heading--visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;overflow:hidden;clip:rect(0 0 0 0)}.bpk-drawer__close-button{float:right}html[dir=rtl] .bpk-drawer__close-button{float:left}.bpk-drawer__content{height:100%;flex:1 1 100%;overflow-y:auto}.bpk-drawer__content--padded{padding:1rem}@media(max-width: 32rem){.bpk-drawer__modal-mobile-view{transform:scale(0.9);transition:opacity 400ms ease-in-out,transform 400ms ease-in-out;opacity:0}.bpk-drawer__modal-mobile-view--entering,.bpk-drawer__modal-mobile-view--entered{transform:scale(1);opacity:1}.bpk-drawer__modal-mobile-view--exited{transform:scale(0.9);opacity:0}.bpk-drawer__modal-mobile-view--exiting{transform:none}}
|
|
@@ -81,10 +81,11 @@ const BpkInsetBanner = ({
|
|
|
81
81
|
closeButtonText: callToAction?.buttonCloseLabel,
|
|
82
82
|
closeButtonIcon: callToAction?.closeBtnIcon,
|
|
83
83
|
labelAsTitle: callToAction?.labelTitle,
|
|
84
|
+
zIndexValue: callToAction?.zIndexCustom,
|
|
84
85
|
target: /*#__PURE__*/_jsx("button", {
|
|
85
86
|
"aria-label": callToAction?.buttonA11yLabel,
|
|
86
87
|
className: getClassName('bpk-inset-banner--cta-button'),
|
|
87
|
-
"data-testid": "
|
|
88
|
+
"data-testid": "ctaBtn",
|
|
88
89
|
"aria-hidden": "false",
|
|
89
90
|
type: "button",
|
|
90
91
|
children: /*#__PURE__*/_jsxs("div", {
|
|
@@ -20,11 +20,12 @@ export type Props = {
|
|
|
20
20
|
* The accessory view allows for icons and actions to be placed in front of the main title inside the modal header. To be used with `BpkNavigationBarButtonLink`
|
|
21
21
|
*/
|
|
22
22
|
accessoryView?: ReactNode;
|
|
23
|
+
ariaLabel?: string;
|
|
23
24
|
};
|
|
24
25
|
export declare const MODAL_STYLING: {
|
|
25
26
|
default: string;
|
|
26
27
|
surfaceContrast: string;
|
|
27
28
|
};
|
|
28
29
|
export type ModalStyle = (typeof MODAL_STYLING)[keyof typeof MODAL_STYLING];
|
|
29
|
-
declare const BpkModalInner: ({ accessoryView, children, className, closeLabel, closeText, contentClassName, dialogRef, fullScreen, fullScreenOnMobile, id, isIphone, modalStyle, onClose, padded, showHeader, title, wide, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare const BpkModalInner: ({ accessoryView, ariaLabel, children, className, closeLabel, closeText, contentClassName, dialogRef, fullScreen, fullScreenOnMobile, id, isIphone, modalStyle, onClose, padded, showHeader, title, wide, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
30
31
|
export default BpkModalInner;
|
|
@@ -31,6 +31,7 @@ export const MODAL_STYLING = {
|
|
|
31
31
|
};
|
|
32
32
|
const BpkModalInner = ({
|
|
33
33
|
accessoryView = null,
|
|
34
|
+
ariaLabel,
|
|
34
35
|
children,
|
|
35
36
|
className = null,
|
|
36
37
|
closeLabel = '',
|
|
@@ -83,6 +84,7 @@ const BpkModalInner = ({
|
|
|
83
84
|
tabIndex: -1,
|
|
84
85
|
role: "dialog",
|
|
85
86
|
"aria-labelledby": showHeader ? headingId : undefined,
|
|
87
|
+
"aria-label": !showHeader ? ariaLabel : undefined,
|
|
86
88
|
className: classNames.join(' '),
|
|
87
89
|
ref: dialogRef,
|
|
88
90
|
children: [showHeader && /*#__PURE__*/_jsx("header", {
|
|
@@ -31,9 +31,10 @@ export type Props = CloseButtonProps & {
|
|
|
31
31
|
target: ReactElement<any>;
|
|
32
32
|
closeButtonLabel?: string;
|
|
33
33
|
actionText?: string;
|
|
34
|
+
zIndexValue?: number;
|
|
34
35
|
onAction?: () => void;
|
|
35
36
|
renderTarget?: () => HTMLElement | HTMLElement | undefined;
|
|
36
37
|
[rest: string]: any;
|
|
37
38
|
};
|
|
38
|
-
declare const BpkPopover: ({ actionText, children, className, closeButtonIcon, closeButtonLabel, closeButtonProps, closeButtonText, hoverable, id, isOpen, label, labelAsTitle, onAction, onClose, padded, placement, renderTarget, showArrow, target, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare const BpkPopover: ({ actionText, children, className, closeButtonIcon, closeButtonLabel, closeButtonProps, closeButtonText, hoverable, id, isOpen, label, labelAsTitle, onAction, onClose, padded, placement, renderTarget, showArrow, target, zIndexValue, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
39
40
|
export default BpkPopover;
|
|
@@ -65,6 +65,7 @@ const BpkPopover = ({
|
|
|
65
65
|
renderTarget = () => undefined,
|
|
66
66
|
showArrow = true,
|
|
67
67
|
target,
|
|
68
|
+
zIndexValue = 900,
|
|
68
69
|
...rest
|
|
69
70
|
}) => {
|
|
70
71
|
const [isOpenState, setIsOpenState] = useState(isOpen);
|
|
@@ -132,8 +133,11 @@ const BpkPopover = ({
|
|
|
132
133
|
children: /*#__PURE__*/_jsx("div", {
|
|
133
134
|
className: getClassName('bpk-popover--container'),
|
|
134
135
|
ref: refs.setFloating,
|
|
135
|
-
style: floatingStyles,
|
|
136
136
|
...getFloatingProps(),
|
|
137
|
+
style: {
|
|
138
|
+
...floatingStyles,
|
|
139
|
+
zIndex: zIndexValue
|
|
140
|
+
},
|
|
137
141
|
children: /*#__PURE__*/_jsx(TransitionInitialMount, {
|
|
138
142
|
appearClassName: getClassName('bpk-popover--appear'),
|
|
139
143
|
appearActiveClassName: getClassName('bpk-popover--appear-active'),
|
|
@@ -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-popover
|
|
18
|
+
.bpk-popover{transition:opacity 200ms ease-in-out;outline:0;background-color:#fff;opacity:1;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.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{width:1.5rem;height:1.5rem;fill:#fff}.bpk-popover__arrow[data-hide]{visibility:hidden}.bpk-popover__body--padded{padding:1rem}.bpk-popover__body--padded:not(:last-of-type){padding-bottom:0}.bpk-popover__header{display:flex;padding:1rem 1rem 0;justify-content:space-between}.bpk-popover__header~.bpk-popover__body--padded{padding-top:.5rem}.bpk-popover__label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;overflow:hidden;clip:rect(0 0 0 0)}.bpk-popover__footer{padding:.5rem 1rem;text-align:right}html[dir=rtl] .bpk-popover__footer{text-align:left}.bpk-popover__action{padding:0 1rem 1rem 1rem}
|
|
@@ -43,7 +43,6 @@ const BpkSegmentedControl = ({
|
|
|
43
43
|
};
|
|
44
44
|
const containerStyling = getClassName('bpk-segmented-control-group', shadow && 'bpk-segmented-control-group-shadow');
|
|
45
45
|
return /*#__PURE__*/_jsx("div", {
|
|
46
|
-
role: "radiogroup",
|
|
47
46
|
className: containerStyling,
|
|
48
47
|
children: buttonContents.map((content, index) => {
|
|
49
48
|
const isSelected = index === selectedButton;
|
|
@@ -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-segmented-control-group{display:
|
|
18
|
+
.bpk-segmented-control-group{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;border-radius:.5rem}.bpk-segmented-control-group-shadow{box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-segmented-control{min-height:2rem;padding:.5rem 1rem;border:none;cursor:pointer;overflow:hidden;font-size:.875rem;line-height:1.25rem;font-weight:700}.bpk-segmented-control:focus-visible{z-index:0;outline:.125rem solid #0062e3;outline-offset:.125rem}.bpk-segmented-control--canvas-default{background-color:#eff3f8;color:#161616}.bpk-segmented-control--canvas-default-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--canvas-contrast{background-color:#fff;color:#161616}.bpk-segmented-control--canvas-contrast-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--surface-default{background-color:#eff3f8;color:#161616}.bpk-segmented-control--surface-default-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--surface-contrast{background-color:hsla(0,0%,100%,.1);color:#fff}.bpk-segmented-control--surface-contrast-selected{background-color:#024daf;color:#fff}.bpk-segmented-control:not(:first-of-type,[class*=selected]){border-inline-start:.0625rem solid #c1c7cf}.bpk-segmented-control--surface-contrast:not(:first-of-type,[class*=selected]){border-inline-start:.0625rem solid hsla(0,0%,100%,.5)}.bpk-segmented-control[class*=rightOfOption]{border-inline-start:none}.bpk-segmented-control:first-child{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}html[dir=rtl] .bpk-segmented-control:first-child{border-top-left-radius:0;border-top-right-radius:.5rem;border-bottom-left-radius:0;border-bottom-right-radius:.5rem}.bpk-segmented-control:last-child{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}html[dir=rtl] .bpk-segmented-control:last-child{border-top-left-radius:.5rem;border-top-right-radius:0;border-bottom-left-radius:.5rem;border-bottom-right-radius:0}
|