@skyscanner/backpack-web 38.21.0 → 38.22.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-skeleton/index.d.ts +1 -1
- package/bpk-component-skeleton/index.js +1 -1
- package/bpk-component-skeleton/src/BpkSkeleton.js +3 -2
- package/bpk-component-skeleton/src/BpkSkeleton.module.css +1 -1
- package/bpk-component-skeleton/src/common-types.d.ts +7 -0
- package/bpk-component-skeleton/src/common-types.js +4 -0
- package/package.json +2 -2
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import BpkSkeleton from "./src/BpkSkeleton";
|
|
20
|
-
export { SIZE_TYPES, SKELETON_TYPES, IMAGE_SKELETON_STYLE } from "./src/common-types";
|
|
20
|
+
export { SIZE_TYPES, SKELETON_TYPES, IMAGE_SKELETON_STYLE, BACKGROUND_STYLE } from "./src/common-types";
|
|
21
21
|
export default BpkSkeleton;
|
|
@@ -18,17 +18,18 @@
|
|
|
18
18
|
|
|
19
19
|
import { cssModules } from "../../bpk-react-utils";
|
|
20
20
|
import BpkBaseSkeleton from "./BpkBaseSkeleton";
|
|
21
|
-
import { SKELETON_TYPES, IMAGE_SKELETON_STYLE, SIZE_TYPES } from "./common-types";
|
|
21
|
+
import { SKELETON_TYPES, IMAGE_SKELETON_STYLE, SIZE_TYPES, BACKGROUND_STYLE } from "./common-types";
|
|
22
22
|
import STYLES from "./BpkSkeleton.module.css";
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
const getClassName = cssModules(STYLES);
|
|
25
25
|
const BpkSkeleton = props => {
|
|
26
26
|
const {
|
|
27
|
+
backgroundStyle = BACKGROUND_STYLE.default,
|
|
27
28
|
size = SIZE_TYPES.default,
|
|
28
29
|
type
|
|
29
30
|
} = props;
|
|
30
31
|
const isImageRounded = type === SKELETON_TYPES.image && props.style === IMAGE_SKELETON_STYLE.rounded;
|
|
31
|
-
const classNames = getClassName(`bpk-skeleton__${type}`, typeof size !== 'object' && `bpk-skeleton__${type}--${size}`, isImageRounded && 'bpk-skeleton__image--rounded');
|
|
32
|
+
const classNames = getClassName(`bpk-skeleton__${type}`, typeof size !== 'object' && `bpk-skeleton__${type}--${size}`, isImageRounded && 'bpk-skeleton__image--rounded', `bpk-skeleton__${backgroundStyle}`);
|
|
32
33
|
const styleObj = typeof size === 'object' ? size : undefined;
|
|
33
34
|
return /*#__PURE__*/_jsx(BpkBaseSkeleton, {
|
|
34
35
|
skeletonStyle: classNames,
|
|
@@ -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-skeleton__image{width:6rem;height:6rem}.bpk-skeleton__image--rounded{border-radius:.5rem}.bpk-skeleton__headline{width:5rem;border-radius:.25rem}.bpk-skeleton__headline--small{height:.5rem;border-radius:.125rem}.bpk-skeleton__headline--default{height:1rem;border-radius:.25rem}.bpk-skeleton__headline--large{height:2rem;border-radius:.25rem}.bpk-skeleton__circle{border-radius:50%}.bpk-skeleton__circle--small{width:2rem;height:2rem}.bpk-skeleton__circle--default{width:3rem;height:3rem}.bpk-skeleton__bodyText{height:.5rem;border-radius:.125rem}.bpk-skeleton__bodyText--small{width:7.125rem}.bpk-skeleton__bodyText--default{width:10.6875rem}.bpk-skeleton__bodyText--large{width:12.5rem}
|
|
18
|
+
.bpk-skeleton__image{width:6rem;height:6rem}.bpk-skeleton__image--rounded{border-radius:.5rem}.bpk-skeleton__headline{width:5rem;border-radius:.25rem}.bpk-skeleton__headline--small{height:.5rem;border-radius:.125rem}.bpk-skeleton__headline--default{height:1rem;border-radius:.25rem}.bpk-skeleton__headline--large{height:2rem;border-radius:.25rem}.bpk-skeleton__circle{border-radius:50%}.bpk-skeleton__circle--small{width:2rem;height:2rem}.bpk-skeleton__circle--default{width:3rem;height:3rem}.bpk-skeleton__bodyText{height:.5rem;border-radius:.125rem}.bpk-skeleton__bodyText--small{width:7.125rem}.bpk-skeleton__bodyText--default{width:10.6875rem}.bpk-skeleton__bodyText--large{width:12.5rem}.bpk-skeleton__onContrast{background-color:hsla(0,0%,100%,.1)}
|
|
@@ -20,6 +20,11 @@ export declare const IMAGE_SKELETON_STYLE: {
|
|
|
20
20
|
readonly default: "default";
|
|
21
21
|
};
|
|
22
22
|
export type ImageSkeletonStyle = (typeof IMAGE_SKELETON_STYLE)[keyof typeof IMAGE_SKELETON_STYLE];
|
|
23
|
+
export declare const BACKGROUND_STYLE: {
|
|
24
|
+
readonly default: "default";
|
|
25
|
+
readonly onContrast: "onContrast";
|
|
26
|
+
};
|
|
27
|
+
export type BackgroundStyle = (typeof BACKGROUND_STYLE)[keyof typeof BACKGROUND_STYLE];
|
|
23
28
|
type SizeMap = {
|
|
24
29
|
[SKELETON_TYPES.image]: (typeof SIZE_TYPES)['default'];
|
|
25
30
|
[SKELETON_TYPES.bodyText]: (typeof SIZE_TYPES)[keyof typeof SIZE_TYPES];
|
|
@@ -30,8 +35,10 @@ export type ComponentProps = {
|
|
|
30
35
|
type: Extract<SkeletonType, 'image'>;
|
|
31
36
|
size?: SizeMap['image'] | CUSTOM_SIZE_TYPE;
|
|
32
37
|
style?: ImageSkeletonStyle;
|
|
38
|
+
backgroundStyle?: BackgroundStyle;
|
|
33
39
|
} | {
|
|
34
40
|
type: Exclude<keyof SizeMap, 'image'>;
|
|
35
41
|
size?: SizeMap[keyof SizeMap] | CUSTOM_SIZE_TYPE;
|
|
42
|
+
backgroundStyle?: BackgroundStyle;
|
|
36
43
|
};
|
|
37
44
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyscanner/backpack-web",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.22.0",
|
|
4
4
|
"description": "Backpack Design System web library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@radix-ui/react-compose-refs": "^1.1.1",
|
|
28
28
|
"@radix-ui/react-slider": "1.3.5",
|
|
29
29
|
"@react-google-maps/api": "^2.19.3",
|
|
30
|
-
"@skyscanner/bpk-foundations-web": "^
|
|
30
|
+
"@skyscanner/bpk-foundations-web": "^23.0.0",
|
|
31
31
|
"@skyscanner/bpk-svgs": "^20.9.0",
|
|
32
32
|
"a11y-focus-scope": "^1.1.3",
|
|
33
33
|
"a11y-focus-store": "^1.0.0",
|