@skyscanner/backpack-web 36.13.1 → 36.15.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.
|
@@ -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-chip-group-container{display:flex;margin:0 -0.25rem;align-items:center;white-space:nowrap}.bpk-chip-group{display:flex;margin:0;padding:.25rem;align-items:
|
|
18
|
+
.bpk-chip-group-container{display:flex;margin:0 -0.25rem;align-items:center;white-space:nowrap}.bpk-chip-group{display:flex;margin:0;padding:.25rem;align-items:center;border:none;gap:.5rem}.bpk-chip-group--wrap{padding-top:0;padding-bottom:0;flex-wrap:wrap}.bpk-sticky-chip-container:first-child{margin-inline-start:.25rem}.bpk-sticky-chip-container{margin-inline-end:.25rem;padding-inline-end:.5rem;box-shadow:-1px 0 0 0 #c1c7cf inset}html[dir=rtl] .bpk-sticky-chip-container{box-shadow:1px 0 0 0 #c1c7cf inset}.bpk-sticky-chip-container--on-dark{box-shadow:-1px 0 0 0 hsla(0,0%,100%,.5) inset}html[dir=rtl] .bpk-sticky-chip-container--on-dark{box-shadow:1px 0 0 0 hsla(0,0%,100%,.5) inset}
|
|
@@ -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-chip-group-nudger
|
|
18
|
+
.bpk-chip-group-nudger{margin-inline:.25rem}
|
|
@@ -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-info-banner{padding:.5rem 1rem;overflow:hidden;border-radius:.5rem;margin:0;font-size:.875rem;line-height:1.25rem;font-weight:400}.bpk-info-banner--style-default{background-color:#eff3f8}.bpk-info-banner--style-onContrast{background-color:#fff}.bpk-info-banner__header{display:flex;flex-direction:row;align-items:flex-start}.bpk-info-banner__header--expandable{cursor:pointer}.bpk-info-banner__icon,.bpk-info-banner__toggle{padding:.125rem 0}.bpk-info-banner__message{padding:.25rem .5rem;flex-grow:1}.bpk-info-banner__success-icon{fill:#0c838a}.bpk-info-banner__warning-icon{fill:#f55d42}.bpk-info-banner__error-icon{fill:#e70866}.bpk-info-banner__info-icon{fill:#626971}.bpk-info-banner__toggle-button{padding:0;border:0;background-color:rgba(0,0,0,0);cursor:pointer;appearance:none
|
|
18
|
+
.bpk-info-banner{padding:.5rem 1rem;overflow:hidden;border-radius:.5rem;margin:0;font-size:.875rem;line-height:1.25rem;font-weight:400}.bpk-info-banner--style-default{background-color:#eff3f8}.bpk-info-banner--style-onContrast{background-color:#fff}.bpk-info-banner__header{display:flex;flex-direction:row;align-items:flex-start}.bpk-info-banner__header--expandable{width:100%;padding:0;border:none;background-color:rgba(0,0,0,0);text-align:start;cursor:pointer}.bpk-info-banner__icon,.bpk-info-banner__toggle{padding:.125rem 0}.bpk-info-banner__message{padding:.25rem .5rem;flex-grow:1}.bpk-info-banner__success-icon{fill:#0c838a}.bpk-info-banner__warning-icon{fill:#f55d42}.bpk-info-banner__error-icon{fill:#e70866}.bpk-info-banner__info-icon{fill:#626971}.bpk-info-banner__toggle-button{padding:0;border:0;background-color:rgba(0,0,0,0);cursor:pointer;appearance:none;fill:#626971}.bpk-info-banner__children-container{color:#161616;font-size:.875rem;line-height:1.25rem;font-weight:400}.bpk-info-banner__children-container--with-action{padding:.25rem 0 .25rem}.bpk-info-banner__children-container--no-action{padding:.25rem 0 .5rem}
|
|
@@ -67,20 +67,13 @@ const getIconForType = (type, CustomIcon) => {
|
|
|
67
67
|
children: /*#__PURE__*/_jsx(AlignedIcon, {})
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
const ToggleButton = props => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
title: props.label,
|
|
78
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
79
|
-
className: classNames,
|
|
80
|
-
children: props.expanded ? /*#__PURE__*/_jsx(CollapseIcon, {}) : /*#__PURE__*/_jsx(ExpandIcon, {})
|
|
81
|
-
})
|
|
82
|
-
});
|
|
83
|
-
};
|
|
70
|
+
const ToggleButton = props => /*#__PURE__*/_jsxs("div", {
|
|
71
|
+
className: getClassName('bpk-info-banner__toggle-button'),
|
|
72
|
+
children: [props.expanded ? /*#__PURE__*/_jsx(CollapseIcon, {}) : /*#__PURE__*/_jsx(ExpandIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
73
|
+
className: "visually-hidden",
|
|
74
|
+
children: props.label
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
84
77
|
const BpkInfoBannerInner = ({
|
|
85
78
|
action = null,
|
|
86
79
|
animateOnEnter = false,
|
|
@@ -113,26 +106,23 @@ const BpkInfoBannerInner = ({
|
|
|
113
106
|
const isExpandable = configuration === CONFIGURATION.EXPANDABLE;
|
|
114
107
|
const dismissable = configuration === CONFIGURATION.DISMISSABLE;
|
|
115
108
|
const showChildren = isExpandable && expanded;
|
|
116
|
-
const
|
|
109
|
+
const classNames = getClassName('bpk-info-banner', `bpk-info-banner--${type}`, `bpk-info-banner--style-${style}`, bannerClassName && bannerClassName);
|
|
117
110
|
const headerClassNames = getClassName('bpk-info-banner__header', isExpandable && 'bpk-info-banner__header--expandable');
|
|
118
111
|
const childrenContainerClassName = action && isExpandable ? getClassName('bpk-info-banner__children-container--with-action') : getClassName('bpk-info-banner__children-container--no-action');
|
|
119
|
-
|
|
120
|
-
/* eslint-disable
|
|
121
|
-
jsx-a11y/no-static-element-interactions,
|
|
122
|
-
jsx-a11y/click-events-have-key-events,
|
|
123
|
-
*/
|
|
124
|
-
// Disabling 'click-events-have-key-events and interactive-supports-focus' because header element is not focusable.
|
|
125
|
-
// ToggleButton is focusable and works for this.
|
|
112
|
+
const BannerHeader = isExpandable ? 'button' : 'div';
|
|
126
113
|
return /*#__PURE__*/_jsx(AnimateAndFade, {
|
|
127
114
|
animateOnEnter: animateOnEnter,
|
|
128
115
|
animateOnLeave: dismissable || animateOnLeave,
|
|
129
116
|
show: show,
|
|
130
117
|
...rest,
|
|
131
|
-
children: /*#__PURE__*/_jsxs("
|
|
132
|
-
className:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
118
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
119
|
+
className: classNames,
|
|
120
|
+
children: [/*#__PURE__*/_jsxs(BannerHeader, {
|
|
121
|
+
"aria-expanded": isExpandable ? expanded : undefined,
|
|
122
|
+
type: isExpandable ? 'button' : undefined
|
|
123
|
+
// BannerHeader is just <button> or <div>, so className should be allowed.
|
|
124
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
125
|
+
,
|
|
136
126
|
className: headerClassNames,
|
|
137
127
|
onClick: onBannerExpandToggle,
|
|
138
128
|
children: [/*#__PURE__*/_jsx("span", {
|
|
@@ -168,6 +158,5 @@ const BpkInfoBannerInner = ({
|
|
|
168
158
|
})]
|
|
169
159
|
})
|
|
170
160
|
});
|
|
171
|
-
/* eslint-enable */
|
|
172
161
|
};
|
|
173
162
|
export default BpkInfoBannerInner;
|