@proximus/lavender-skeleton-native 0.1.0-alpha.0 → 0.1.0-alpha.2

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/CHANGELOG.md CHANGED
@@ -3,8 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # 0.1.0-alpha.0 (2025-09-24)
6
+ # [0.1.0-alpha.2](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-skeleton-native@0.1.0-alpha.1...@proximus/lavender-skeleton-native@0.1.0-alpha.2) (2025-09-26)
7
7
 
8
- ### Features
8
+ **Note:** Version bump only for package @proximus/lavender-skeleton-native
9
9
 
10
- - **BCRI-4333430:** skeleton components ([#23](https://github.com/Pxs-Corporate/react-native-lavender/issues/23)) ([184f02f](https://github.com/Pxs-Corporate/react-native-lavender/commit/184f02f4f58dd825288b4db905b4bcbe74756ff8))
10
+ # [0.1.0-alpha.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-skeleton-native@0.1.0-alpha.0...@proximus/lavender-skeleton-native@0.1.0-alpha.1) (2025-09-25)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **BCRI-000000:** no free space on gh runner during build ([#27](https://github.com/Pxs-Corporate/react-native-lavender/issues/27)) ([a7c8604](https://github.com/Pxs-Corporate/react-native-lavender/commit/a7c86043b5cefcb10fd768d449c5718fbabe87ec))
@@ -0,0 +1,18 @@
1
+ import { View } from 'react-native';
2
+ import { PxSkeleton } from './Skeleton';
3
+ import React from 'react';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ export function PxCardSkeleton({ inverted, containerStyle }) {
6
+ const { theme } = useTheme();
7
+ return (React.createElement(View, { style: [containerStyle, { borderRadius: theme.t('RadiusMain').number }] },
8
+ React.createElement(PxSkeleton, { variant: 'assetL', inverted: inverted, expand: true }),
9
+ React.createElement(View, { style: {
10
+ gap: theme.t('SpacingSMobile').number,
11
+ borderBottomEndRadius: theme.t('RadiusMain').number,
12
+ borderBottomStartRadius: theme.t('RadiusMain').number,
13
+ padding: theme.t('PaddingSMobile').number,
14
+ backgroundColor: theme.t('ColorBackgroundSurfaceLight'),
15
+ } },
16
+ React.createElement(PxSkeleton, { variant: 'headingS', inverted: inverted }),
17
+ React.createElement(PxSkeleton, { variant: 'body', inverted: inverted }))));
18
+ }
@@ -0,0 +1,28 @@
1
+ import { View } from 'react-native';
2
+ import { PxSkeleton } from './Skeleton';
3
+ import React from 'react';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ export function PxCarouselSkeleton({ inverted, itemsVisible = 1, containerStyle, }) {
6
+ const { theme } = useTheme();
7
+ const panelVariant = itemsVisible === 1 ? 'panel' : 'panelS';
8
+ return (React.createElement(View, { style: [
9
+ containerStyle,
10
+ {
11
+ gap: theme.t('SpacingSMobile').number,
12
+ borderRadius: theme.t('RadiusMain').number,
13
+ },
14
+ ] },
15
+ React.createElement(View, { style: {
16
+ flexDirection: 'row',
17
+ gap: theme.t('SpacingSMobile').number,
18
+ overflow: 'hidden',
19
+ } },
20
+ React.createElement(PxSkeleton, { inverted: inverted, variant: panelVariant }),
21
+ React.createElement(PxSkeleton, { inverted: inverted, variant: panelVariant }),
22
+ React.createElement(PxSkeleton, { inverted: inverted, variant: panelVariant })),
23
+ React.createElement(View, { style: {
24
+ justifyContent: 'center',
25
+ flexDirection: 'row',
26
+ } },
27
+ React.createElement(PxSkeleton, { inverted: inverted, variant: 'body' }))));
28
+ }
@@ -0,0 +1,28 @@
1
+ import { View } from 'react-native';
2
+ import { PxSkeleton } from './Skeleton';
3
+ import React from 'react';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ import { PxStatusSkeleton } from './StatusSkeleton';
6
+ export function PxDataUsageSkeleton({ inverted, containerStyle, }) {
7
+ const { theme } = useTheme();
8
+ return (React.createElement(View, { style: [
9
+ containerStyle,
10
+ {
11
+ gap: theme.t('SpacingDefaultMobile').number,
12
+ borderRadius: theme.t('RadiusMain').number,
13
+ padding: theme.t('PaddingSMobile').number,
14
+ backgroundColor: theme.t('ColorBackgroundSurfaceLight'),
15
+ },
16
+ ] },
17
+ React.createElement(View, { style: {
18
+ gap: theme.t('SpacingXsMobile').number,
19
+ } },
20
+ React.createElement(PxSkeleton, { variant: 'headingS', inverted: inverted }),
21
+ React.createElement(PxSkeleton, { variant: 'body', inverted: inverted })),
22
+ React.createElement(View, { style: {
23
+ gap: theme.t('SpacingXsMobile').number,
24
+ } },
25
+ React.createElement(PxSkeleton, { variant: 'headingS', inverted: inverted }),
26
+ React.createElement(PxSkeleton, { variant: 'body', inverted: inverted, expand: true }),
27
+ React.createElement(PxStatusSkeleton, null))));
28
+ }
@@ -0,0 +1,27 @@
1
+ import { View } from 'react-native';
2
+ import { PxSkeleton } from './Skeleton';
3
+ import React from 'react';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ export function PxMessageCardSkeleton({ inverted, containerStyle, }) {
6
+ const { theme } = useTheme();
7
+ return (React.createElement(View, { style: [
8
+ containerStyle,
9
+ {
10
+ backgroundColor: theme.t('ColorBackgroundSurfaceLight'),
11
+ borderRadius: theme.t('RadiusMain').number,
12
+ padding: theme.t('PaddingSMobile').number,
13
+ gap: theme.t('SpacingSMobile').number,
14
+ },
15
+ ] },
16
+ React.createElement(View, { style: {
17
+ flexDirection: 'row',
18
+ gap: theme.t('SpacingSMobile').number,
19
+ } },
20
+ React.createElement(PxSkeleton, { variant: 'assetS', inverted: inverted }),
21
+ React.createElement(View, { style: { flex: 1, gap: theme.t('SpacingSMobile').number } },
22
+ React.createElement(PxSkeleton, { variant: 'headingS', inverted: inverted }),
23
+ React.createElement(PxSkeleton, { variant: 'body', inverted: inverted })),
24
+ React.createElement(PxSkeleton, { variant: 'actionS', inverted: inverted })),
25
+ React.createElement(View, null,
26
+ React.createElement(PxSkeleton, { variant: 'actionL', inverted: inverted }))));
27
+ }
@@ -0,0 +1,125 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import { Animated, Easing, StyleSheet, View, } from 'react-native';
3
+ import LinearGradient from 'react-native-linear-gradient';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ const DURATION = 1500;
6
+ const ANGLE = 18;
7
+ function useColors({ inverted }) {
8
+ const { theme } = useTheme();
9
+ const invertedSuffix = inverted ? 'Inverted' : 'Default';
10
+ const backgroundColor = theme.t(`ColorBackgroundStateDisabled${invertedSuffix}`);
11
+ const highlightColor = inverted ? 'rgba(0,0,0,1)' : 'rgba(255,255,255,1)';
12
+ const highlightColorWithOpacity = inverted
13
+ ? 'rgba(0,0,0,0.24)'
14
+ : 'rgba(255,255,250,.24)';
15
+ return { backgroundColor, highlightColor, highlightColorWithOpacity };
16
+ }
17
+ export function PxSkeleton(props) {
18
+ const { inverted = false, containerStyle, variant, expand = false } = props;
19
+ const [layout, setLayout] = useState({ width: 0, height: 0 });
20
+ const translateX = useRef(new Animated.Value(0)).current;
21
+ const { theme } = useTheme();
22
+ const { backgroundColor, highlightColor, highlightColorWithOpacity } = useColors({ inverted });
23
+ const loopRef = useRef(null);
24
+ useEffect(() => {
25
+ if (layout.width <= 0)
26
+ return;
27
+ // Stop any previous loop before starting a new one
28
+ loopRef.current?.stop();
29
+ translateX.setValue(-layout.width * 1.5);
30
+ const loop = Animated.loop(Animated.timing(translateX, {
31
+ toValue: layout.width,
32
+ easing: Easing.cubic,
33
+ duration: DURATION,
34
+ useNativeDriver: true,
35
+ }));
36
+ loopRef.current = loop;
37
+ loop.start();
38
+ return () => {
39
+ loop.stop();
40
+ loopRef.current = null;
41
+ };
42
+ }, [translateX, layout]);
43
+ return (React.createElement(View, { style: [
44
+ containerStyle,
45
+ {
46
+ backgroundColor,
47
+ borderRadius: ['actionS', 'actionL'].includes(variant)
48
+ ? theme.t('RadiusPill').number
49
+ : theme.t('RadiusMain').number,
50
+ overflow: 'hidden',
51
+ },
52
+ styles[props.variant],
53
+ { ...(expand ? { width: '100%', maxWidth: undefined } : undefined) },
54
+ ], onLayout: (e) => {
55
+ const { width, height } = e.nativeEvent.layout;
56
+ setLayout({ width, height });
57
+ } },
58
+ React.createElement(Animated.View, { style: {
59
+ position: 'absolute',
60
+ top: -3 * layout.height, // ensure coverage when rotated
61
+ bottom: -3 * layout.height,
62
+ width: layout.width,
63
+ transform: [{ translateX }, { rotate: `${ANGLE}deg` }],
64
+ } }, layout.width > 0 && ( // Render gradient only when layout is measured will crash otherwise
65
+ React.createElement(LinearGradient, { style: { flex: 1 }, pointerEvents: "none", colors: [
66
+ highlightColorWithOpacity,
67
+ highlightColor,
68
+ highlightColorWithOpacity,
69
+ ], locations: [0, 0.5, 1], start: { x: 0, y: 0 }, end: { x: 1, y: 0 } })))));
70
+ }
71
+ const styles = StyleSheet.create({
72
+ headingS: {
73
+ height: 24,
74
+ minWidth: 120,
75
+ maxWidth: 240,
76
+ },
77
+ headingM: {
78
+ height: 32,
79
+ minWidth: 120,
80
+ maxWidth: 240,
81
+ },
82
+ headingL: {
83
+ height: 40,
84
+ minWidth: 120,
85
+ maxWidth: 240,
86
+ },
87
+ body: {
88
+ height: 16,
89
+ maxWidth: 300,
90
+ minWidth: 120,
91
+ },
92
+ bodyS: {
93
+ height: 16,
94
+ maxWidth: 180,
95
+ minWidth: 120,
96
+ },
97
+ actionS: {
98
+ height: 40,
99
+ width: 40,
100
+ },
101
+ actionL: {
102
+ height: 48,
103
+ width: 160,
104
+ },
105
+ assetS: {
106
+ height: 40,
107
+ width: 40,
108
+ },
109
+ assetXS: {
110
+ height: 16,
111
+ width: 16,
112
+ },
113
+ assetL: {
114
+ height: 80,
115
+ width: 80,
116
+ },
117
+ panel: {
118
+ height: 200,
119
+ width: 300,
120
+ },
121
+ panelS: {
122
+ height: 133,
123
+ width: 144,
124
+ },
125
+ });
@@ -0,0 +1,13 @@
1
+ import { View } from 'react-native';
2
+ import { PxSkeleton } from './Skeleton';
3
+ import React from 'react';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ export function PxStatusSkeleton({ inverted, containerStyle }) {
6
+ const { theme } = useTheme();
7
+ return (React.createElement(View, { style: [
8
+ containerStyle,
9
+ { flexDirection: 'row', gap: theme.t('Spacing2xsMobile').number },
10
+ ] },
11
+ React.createElement(PxSkeleton, { variant: 'assetXS', inverted: inverted }),
12
+ React.createElement(PxSkeleton, { variant: 'body', inverted: inverted })));
13
+ }
@@ -0,0 +1,31 @@
1
+ import { View } from 'react-native';
2
+ import { PxSkeleton } from './Skeleton';
3
+ import React from 'react';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ function PxTileSkeleton({ inverted }) {
6
+ const { theme } = useTheme();
7
+ return (React.createElement(View, { style: {
8
+ alignItems: 'center',
9
+ gap: theme.t('SpacingSMobile').number,
10
+ borderBottomEndRadius: theme.t('RadiusMain').number,
11
+ borderBottomStartRadius: theme.t('RadiusMain').number,
12
+ padding: theme.t('PaddingSMobile').number,
13
+ backgroundColor: theme.t('ColorBackgroundSurfaceLight'),
14
+ } },
15
+ React.createElement(PxSkeleton, { variant: 'assetS', inverted: inverted }),
16
+ React.createElement(PxSkeleton, { variant: 'headingS', inverted: inverted })));
17
+ }
18
+ export function PxTilesSkeleton({ inverted, containerStyle }) {
19
+ const { theme } = useTheme();
20
+ return (React.createElement(View, { style: [
21
+ containerStyle,
22
+ {
23
+ gap: theme.t('SpacingSMobile').number,
24
+ flexDirection: 'row',
25
+ overflow: 'hidden',
26
+ },
27
+ ] },
28
+ React.createElement(PxTileSkeleton, { inverted: inverted }),
29
+ React.createElement(PxTileSkeleton, { inverted: inverted }),
30
+ React.createElement(PxTileSkeleton, { inverted: inverted })));
31
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@proximus/lavender-skeleton-native",
3
+ "version": "0.1.0-alpha.2",
4
+ "description": "Lavender skeleton component",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "peerDependencies": {
8
+ "@proximus/lavender-common-native": "*",
9
+ "@proximus/lavender-styling-native": "*",
10
+ "@proximus/lavender-texts-native": "*"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "lerna": {
16
+ "command": {
17
+ "publish": {
18
+ "assets": [
19
+ {
20
+ "from": "dist/far/away/package.json",
21
+ "to": "."
22
+ },
23
+ "dist/*.js",
24
+ "dist/*.d.ts",
25
+ "dist/*.d.ts.map",
26
+ "src",
27
+ "package.json"
28
+ ]
29
+ }
30
+ }
31
+ },
32
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
33
+ }
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export * from './Skeleton';
2
+ export * from './CardSkeleton';
3
+ export * from './MessageCardSkeleton';
4
+ export * from './CarouselSkeleton';
5
+ export * from './StatusSkeleton';
6
+ export * from './TileSkeleton';
7
+ export * from './DataUsageSkeleton';
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@proximus/lavender-skeleton-native",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "Lavender skeleton component",
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
7
- "type": "module",
8
7
  "scripts": {
9
8
  "clean": "rm -rf dist",
10
- "prepublish": "yarn clean && yarn build",
9
+ "transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
10
+ "prepublish": "yarn clean && yarn transform-package-json && yarn build",
11
11
  "build": "npx tsc -p tsconfig.json"
12
12
  },
13
13
  "peerDependencies": {
@@ -16,9 +16,9 @@
16
16
  "@proximus/lavender-texts-native": "workspace:*"
17
17
  },
18
18
  "devDependencies": {
19
- "@proximus/lavender-common-native": "0.1.0-alpha.4",
20
- "@proximus/lavender-styling-native": "0.1.0-alpha.3",
21
- "@proximus/lavender-texts-native": "0.1.0-alpha.4"
19
+ "@proximus/lavender-common-native": "0.1.0-alpha.6",
20
+ "@proximus/lavender-styling-native": "0.1.0-alpha.5",
21
+ "@proximus/lavender-texts-native": "0.1.0-alpha.6"
22
22
  },
23
23
  "publishConfig": {
24
24
  "access": "public"
@@ -27,12 +27,18 @@
27
27
  "command": {
28
28
  "publish": {
29
29
  "assets": [
30
- "dist",
30
+ {
31
+ "from": "dist/far/away/package.json",
32
+ "to": "."
33
+ },
34
+ "dist/*.js",
35
+ "dist/*.d.ts",
36
+ "dist/*.d.ts.map",
31
37
  "src",
32
38
  "package.json"
33
39
  ]
34
40
  }
35
41
  }
36
42
  },
37
- "gitHead": "8794f25d197ead361646d6e655ce64ba1c7f60c0"
43
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
38
44
  }
package/tsconfig.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "outDir": "dist",
5
5
  },
6
6
  "include": ["src","../../../lib.d.ts"],
7
- "exclude": ["dist", "node_modules", "src/**/*.test.ts", "src/**/*.spec.ts"]
7
+ "exclude": ["dist", "node_modules", "src/**/*.spec.tsx", "src/**/*.spec.ts"]
8
8
  }