@wlloyalty/wll-react-sdk 1.0.12 → 1.0.21
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/README.md +78 -36
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,15 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
# Loyalty Tiles SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> A React SDK for building customisable loyalty experiences with configurable tiles, themes, and navigation
|
|
4
4
|
|
|
5
|
+
[](https://conventionalcommits.org)
|
|
6
|
+
[](https://reactjs.org/)
|
|
7
|
+
[](https://reactnative.dev/)
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- 🎨 **Flexible Theming** - Full control over visual styling with automatic color derivation and responsive design system
|
|
12
|
+
- 🧩 **Composable Tiles** - Pre-built components for rewards, points, badges, and tiers that work together seamlessly
|
|
13
|
+
- 🔌 **Platform Agnostic** - Bring your own navigation and network layer to integrate with any React application
|
|
14
|
+
- 📱 **Mobile First** - Responsive components optimized for both mobile and desktop experiences
|
|
15
|
+
- 🔒 **Secure by Design** - Built-in support for custom API integration through your own backend proxy
|
|
16
|
+
- ⚡ **Easy Integration** - Simple setup with customisable configuration for navigation, theming, and API handling
|
|
17
|
+
|
|
18
|
+
## 📚 Documentation
|
|
19
|
+
|
|
20
|
+
- [Getting Started Guide](https://wll-react-sdk.vercel.app/guide/getting-started)
|
|
21
|
+
- [Component Library](https://wll-react-sdk.vercel.app/components/)
|
|
22
|
+
- [Live Storybook Demo](https://66c36701bb14ec551f38279c-ueompbfvfq.chromatic.com/)
|
|
23
|
+
|
|
24
|
+
## 🚀 Quick Start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# npm
|
|
28
|
+
npm install @wll/react-sdk
|
|
29
|
+
|
|
30
|
+
# yarn
|
|
31
|
+
yarn add @wll/react-sdk
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 💻 System Requirements
|
|
35
|
+
|
|
36
|
+
The SDK is compatible with:
|
|
5
37
|
- React: ^18.0.0
|
|
6
38
|
- React Native: >=0.70.0 <0.73.0
|
|
7
39
|
|
|
8
|
-
Please ensure your project
|
|
40
|
+
Please ensure your project meets these version requirements for optimal compatibility.
|
|
9
41
|
|
|
10
|
-
##
|
|
42
|
+
## 🤝 Contributing
|
|
11
43
|
|
|
12
|
-
This
|
|
44
|
+
We welcome contributions! This project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification to ensure consistent commit messages and automated versioning.
|
|
45
|
+
|
|
46
|
+
### Commit Message Format
|
|
13
47
|
|
|
14
48
|
```
|
|
15
49
|
type(scope?): subject
|
|
@@ -20,40 +54,48 @@ type(scope?): subject
|
|
|
20
54
|
```
|
|
21
55
|
|
|
22
56
|
### Types
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
We use several tools to
|
|
42
|
-
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
To make a commit using the interactive commit tool:
|
|
57
|
+
| Type | Description |
|
|
58
|
+
|------|-------------|
|
|
59
|
+
| `feat` | New features (e.g., `feat(auth): add Google OAuth login`) |
|
|
60
|
+
| `fix` | Bug fixes (e.g., `fix(api): correct rate limiting logic`) |
|
|
61
|
+
| `hotfix` | Critical bug fixes requiring immediate deployment |
|
|
62
|
+
| `docs` | Documentation changes |
|
|
63
|
+
| `style` | Code style changes (formatting, etc) |
|
|
64
|
+
| `refactor` | Code changes that neither fix bugs nor add features |
|
|
65
|
+
| `perf` | Performance improvements |
|
|
66
|
+
| `test` | Adding or updating tests |
|
|
67
|
+
| `build` | Changes to build system or dependencies |
|
|
68
|
+
| `ci` | Changes to CI configuration |
|
|
69
|
+
| `chore` | Other changes that don't modify src or test files |
|
|
70
|
+
| `revert` | Reverting previous changes |
|
|
71
|
+
| `wip` | Work in progress |
|
|
72
|
+
|
|
73
|
+
### Development Workflow
|
|
74
|
+
|
|
75
|
+
We use several tools to maintain code quality:
|
|
76
|
+
- **Commitlint**: Validates commit message format
|
|
77
|
+
- **Commitizen**: Interactive commit message formatter
|
|
78
|
+
- **Husky**: Git hooks for enforcing conventions
|
|
79
|
+
|
|
48
80
|
```bash
|
|
81
|
+
# Make a commit using the interactive tool
|
|
49
82
|
yarn commit
|
|
50
|
-
```
|
|
51
83
|
|
|
52
|
-
|
|
53
|
-
If you're setting up the repository locally, the commit hooks will be installed automatically when you run `yarn install`. However, if you need to reinstall the hooks, you can run:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
84
|
+
# Reinstall git hooks if needed
|
|
56
85
|
yarn prepare
|
|
57
86
|
```
|
|
58
87
|
|
|
59
|
-
|
|
88
|
+
## 📄 License
|
|
89
|
+
|
|
90
|
+
MIT License - See [LICENSE](LICENSE) for more information.
|
|
91
|
+
|
|
92
|
+
Copyright (c) 2024 WLL
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
95
|
+
|
|
96
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
97
|
+
|
|
98
|
+
## 🆘 Support
|
|
99
|
+
|
|
100
|
+
- [Documentation](https://wll-react-sdk.vercel.app/)
|
|
101
|
+
- [Issues](https://github.com/white-label-loyalty/wll-react-sdk/issues)
|
package/dist/index.d.ts
CHANGED
|
@@ -448,12 +448,12 @@ type BannerTileProps = {
|
|
|
448
448
|
tile: Tile;
|
|
449
449
|
};
|
|
450
450
|
declare const BannerTile: React.FC<BannerTileProps> & {
|
|
451
|
-
|
|
451
|
+
Media: typeof BannerTileMedia;
|
|
452
452
|
Title: typeof BannerTileTitle;
|
|
453
453
|
Description: typeof BannerTileDescription;
|
|
454
454
|
CTA: typeof BannerTileCTA;
|
|
455
455
|
};
|
|
456
|
-
declare const
|
|
456
|
+
declare const BannerTileMedia: React.FC;
|
|
457
457
|
declare const BannerTileTitle: React.FC;
|
|
458
458
|
declare const BannerTileDescription: React.FC;
|
|
459
459
|
declare const BannerTileCTA: React.FC;
|
package/dist/index.js
CHANGED
|
@@ -18953,8 +18953,7 @@ var BaseTileContent = function (_a) {
|
|
|
18953
18953
|
if (isHalfSize && artworkUrl) return null;
|
|
18954
18954
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
18955
18955
|
style: [styles$d.content, isHalfSize && {
|
|
18956
|
-
justifyContent: 'center'
|
|
18957
|
-
padding: 16
|
|
18956
|
+
justifyContent: 'center'
|
|
18958
18957
|
}]
|
|
18959
18958
|
}, children);
|
|
18960
18959
|
};
|
|
@@ -19339,21 +19338,21 @@ var BannerTile = function (_a) {
|
|
|
19339
19338
|
var tile = _a.tile;
|
|
19340
19339
|
return /*#__PURE__*/React__namespace.createElement(BaseBanner, {
|
|
19341
19340
|
tile: tile
|
|
19342
|
-
}, /*#__PURE__*/React__namespace.createElement(BannerTile.
|
|
19341
|
+
}, /*#__PURE__*/React__namespace.createElement(BannerTile.Media, null), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
19343
19342
|
style: styles$a.slideContent
|
|
19344
19343
|
}, /*#__PURE__*/React__namespace.createElement(BannerTile.Title, null), /*#__PURE__*/React__namespace.createElement(BannerTile.Description, null), /*#__PURE__*/React__namespace.createElement(BannerTile.CTA, null)));
|
|
19345
19344
|
};
|
|
19346
|
-
var
|
|
19345
|
+
var BannerTileMedia = function () {
|
|
19347
19346
|
var configuration = useBannerContext().configuration;
|
|
19348
19347
|
var artworkUrl = configuration.artworkUrl;
|
|
19349
19348
|
if (!artworkUrl) return null;
|
|
19350
19349
|
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
19351
|
-
style: styles$a.
|
|
19350
|
+
style: styles$a.mediaContainer
|
|
19352
19351
|
}, /*#__PURE__*/React__namespace.createElement(ProgressiveImage, {
|
|
19353
19352
|
source: {
|
|
19354
19353
|
uri: artworkUrl
|
|
19355
19354
|
},
|
|
19356
|
-
style: styles$a.
|
|
19355
|
+
style: styles$a.media
|
|
19357
19356
|
}));
|
|
19358
19357
|
};
|
|
19359
19358
|
var BannerTileTitle = function () {
|
|
@@ -19407,14 +19406,14 @@ var styles$a = StyleSheet$1.create({
|
|
|
19407
19406
|
slideContent: createResponsiveStyle({
|
|
19408
19407
|
flex: 1
|
|
19409
19408
|
}),
|
|
19410
|
-
|
|
19409
|
+
mediaContainer: createResponsiveStyle({
|
|
19411
19410
|
width: '20%',
|
|
19412
19411
|
aspectRatio: 1,
|
|
19413
19412
|
position: 'relative',
|
|
19414
19413
|
overflow: 'hidden',
|
|
19415
19414
|
marginRight: [8, 8, 24]
|
|
19416
19415
|
}),
|
|
19417
|
-
|
|
19416
|
+
media: {
|
|
19418
19417
|
position: 'absolute',
|
|
19419
19418
|
width: '100%',
|
|
19420
19419
|
height: '100%',
|
|
@@ -19430,7 +19429,7 @@ var styles$a = StyleSheet$1.create({
|
|
|
19430
19429
|
marginBottom: [12, 12, 32]
|
|
19431
19430
|
})
|
|
19432
19431
|
});
|
|
19433
|
-
BannerTile.
|
|
19432
|
+
BannerTile.Media = BannerTileMedia;
|
|
19434
19433
|
BannerTile.Title = BannerTileTitle;
|
|
19435
19434
|
BannerTile.Description = BannerTileDescription;
|
|
19436
19435
|
BannerTile.CTA = BannerTileCTA;
|