@wlloyalty/wll-react-sdk 1.4.9 → 1.5.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/dist/index.d.ts +5 -1
- package/dist/native.js +68 -11
- package/dist/native.js.map +1 -1
- package/dist/types/components/atoms/BaseTile/styles.d.ts +25 -0
- package/dist/types/components/atoms/Button/Button.stories.d.ts +2 -0
- package/dist/types/components/atoms/Button/index.d.ts +2 -1
- package/dist/types/components/organisms/RewardTile/RewardTile.stories.d.ts +6 -0
- package/dist/types/components/organisms/VenueTile/VenueTile.stories.d.ts +3 -0
- package/dist/types/components/organisms/VenueTile/index.d.ts +1 -1
- package/dist/types/components/organisms/VenueTile/venue-tile-media.d.ts +1 -1
- package/dist/types/types/tile.d.ts +3 -0
- package/dist/web.js +105 -19
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const baseStyles: {
|
|
2
|
+
imageContainer: {
|
|
3
|
+
position: "relative";
|
|
4
|
+
};
|
|
2
5
|
container: {
|
|
3
6
|
width: "100%";
|
|
4
7
|
height: "100%";
|
|
@@ -40,6 +43,17 @@ export declare const useBaseTileStyles: () => {
|
|
|
40
43
|
width: "100%";
|
|
41
44
|
objectFit: "cover";
|
|
42
45
|
};
|
|
46
|
+
lockOverlay: {
|
|
47
|
+
position: "absolute";
|
|
48
|
+
top: number;
|
|
49
|
+
left: number;
|
|
50
|
+
right: number;
|
|
51
|
+
bottom: number;
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
justifyContent: "center";
|
|
54
|
+
alignItems: "center";
|
|
55
|
+
zIndex: number;
|
|
56
|
+
};
|
|
43
57
|
} | {
|
|
44
58
|
container: {
|
|
45
59
|
backgroundColor: string;
|
|
@@ -71,4 +85,15 @@ export declare const useBaseTileStyles: () => {
|
|
|
71
85
|
width: "100%";
|
|
72
86
|
objectFit: "cover";
|
|
73
87
|
};
|
|
88
|
+
lockOverlay: {
|
|
89
|
+
position: "absolute";
|
|
90
|
+
top: number;
|
|
91
|
+
left: number;
|
|
92
|
+
right: number;
|
|
93
|
+
bottom: number;
|
|
94
|
+
backgroundColor: string;
|
|
95
|
+
justifyContent: "center";
|
|
96
|
+
alignItems: "center";
|
|
97
|
+
zIndex: number;
|
|
98
|
+
};
|
|
74
99
|
};
|
|
@@ -7,7 +7,8 @@ type ButtonProps = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
accessibilityLabel?: string;
|
|
9
9
|
accessibilityHint?: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
10
11
|
testID?: string;
|
|
11
12
|
};
|
|
12
|
-
declare const Button: ({ title, onPress, variant, disabled, accessibilityLabel, accessibilityHint, testID, }: ButtonProps) => React.ReactElement;
|
|
13
|
+
declare const Button: ({ title, onPress, variant, disabled, accessibilityLabel, accessibilityHint, icon, testID, }: ButtonProps) => React.ReactElement;
|
|
13
14
|
export default Button;
|
|
@@ -10,3 +10,9 @@ export declare const DefaultWithPoints: import("@storybook/csf").AnnotatedStoryF
|
|
|
10
10
|
export declare const ArtworkOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
11
11
|
tile: import("../../..").Tile;
|
|
12
12
|
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
13
|
+
export declare const Locked: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
14
|
+
tile: import("../../..").Tile;
|
|
15
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
16
|
+
export declare const ArtworkOnlyLocked: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
17
|
+
tile: import("../../..").Tile;
|
|
18
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
@@ -10,3 +10,6 @@ export declare const WithDescription: import("@storybook/csf").AnnotatedStoryFn<
|
|
|
10
10
|
export declare const WithoutDescription: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
11
11
|
tile: import("../../..").Tile;
|
|
12
12
|
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
13
|
+
export declare const Locked: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
14
|
+
tile: import("../../..").Tile;
|
|
15
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
@@ -8,7 +8,7 @@ type VenueTileProps = {
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const VenueTile: (({ tile }: VenueTileProps) => React.ReactElement | null) & {
|
|
10
10
|
Media: ({ isArtworkOnly, }: {
|
|
11
|
-
isArtworkOnly
|
|
11
|
+
isArtworkOnly?: boolean;
|
|
12
12
|
}) => React.ReactElement | null;
|
|
13
13
|
Title: () => React.ReactElement | null;
|
|
14
14
|
Description: () => React.ReactElement | null;
|
|
@@ -65,6 +65,7 @@ export declare class ContentTileConfig {
|
|
|
65
65
|
artworkUrl?: string | null;
|
|
66
66
|
ctaLinkTarget?: CTALinkTarget;
|
|
67
67
|
ctaLink?: string | null;
|
|
68
|
+
isLocked?: boolean;
|
|
68
69
|
}
|
|
69
70
|
export declare class RewardTileConfig {
|
|
70
71
|
rewardId: string;
|
|
@@ -72,6 +73,7 @@ export declare class RewardTileConfig {
|
|
|
72
73
|
showPrice: boolean;
|
|
73
74
|
showArtwork?: boolean;
|
|
74
75
|
showDetails?: boolean;
|
|
76
|
+
isLocked?: boolean;
|
|
75
77
|
id: string;
|
|
76
78
|
createdAt: string;
|
|
77
79
|
updatedAt: string;
|
|
@@ -104,6 +106,7 @@ export declare class VenueTileConfig {
|
|
|
104
106
|
name: string;
|
|
105
107
|
artworkUrl: string;
|
|
106
108
|
description: string;
|
|
109
|
+
isLocked?: boolean;
|
|
107
110
|
}
|
|
108
111
|
export declare enum BadgeTileType {
|
|
109
112
|
Specific = "SPECIFIC",
|
package/dist/web.js
CHANGED
|
@@ -8758,6 +8758,7 @@ var useButtonDynamicStyles = function () {
|
|
|
8758
8758
|
button: {
|
|
8759
8759
|
justifyContent: 'center',
|
|
8760
8760
|
alignItems: 'center',
|
|
8761
|
+
flexDirection: 'row',
|
|
8761
8762
|
paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
|
|
8762
8763
|
paddingVertical: theme.sizes.sm,
|
|
8763
8764
|
alignSelf: 'flex-start'
|
|
@@ -8811,6 +8812,7 @@ var Button = function (_a) {
|
|
|
8811
8812
|
disabled = _b === void 0 ? false : _b,
|
|
8812
8813
|
accessibilityLabel = _a.accessibilityLabel,
|
|
8813
8814
|
accessibilityHint = _a.accessibilityHint,
|
|
8815
|
+
icon = _a.icon,
|
|
8814
8816
|
testID = _a.testID;
|
|
8815
8817
|
var theme = useWllSdk().theme;
|
|
8816
8818
|
var buttonStyle = useButtonStyles(theme, variant);
|
|
@@ -8837,7 +8839,7 @@ var Button = function (_a) {
|
|
|
8837
8839
|
disabled: disabled
|
|
8838
8840
|
},
|
|
8839
8841
|
testID: testID
|
|
8840
|
-
}, /*#__PURE__*/React__namespace.createElement(RNText, {
|
|
8842
|
+
}, icon && icon, title && /*#__PURE__*/React__namespace.createElement(RNText, {
|
|
8841
8843
|
style: [styles.text, textStyle]
|
|
8842
8844
|
}, title));
|
|
8843
8845
|
};
|
|
@@ -19425,6 +19427,9 @@ var shouldHideContentForHalfTile = function (sizeInfo, artworkUrl) {
|
|
|
19425
19427
|
};
|
|
19426
19428
|
|
|
19427
19429
|
var baseStyles = StyleSheet$1.create({
|
|
19430
|
+
imageContainer: {
|
|
19431
|
+
position: 'relative'
|
|
19432
|
+
},
|
|
19428
19433
|
container: {
|
|
19429
19434
|
width: '100%',
|
|
19430
19435
|
height: '100%',
|
|
@@ -19462,7 +19467,18 @@ var useBaseTileStyles = function () {
|
|
|
19462
19467
|
alignItems: 'center',
|
|
19463
19468
|
justifyContent: 'space-between'
|
|
19464
19469
|
},
|
|
19465
|
-
media: baseStyles.media
|
|
19470
|
+
media: baseStyles.media,
|
|
19471
|
+
lockOverlay: {
|
|
19472
|
+
position: 'absolute',
|
|
19473
|
+
top: 0,
|
|
19474
|
+
left: 0,
|
|
19475
|
+
right: 0,
|
|
19476
|
+
bottom: 0,
|
|
19477
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
19478
|
+
justifyContent: 'center',
|
|
19479
|
+
alignItems: 'center',
|
|
19480
|
+
zIndex: 10
|
|
19481
|
+
}
|
|
19466
19482
|
});
|
|
19467
19483
|
}
|
|
19468
19484
|
var sizeInfo = useTileSize(tileContext);
|
|
@@ -19494,7 +19510,18 @@ var useBaseTileStyles = function () {
|
|
|
19494
19510
|
media: __assign(__assign({}, baseStyles.media), {
|
|
19495
19511
|
flexBasis: !isHalfSize && title && body ? '50%' : '100%',
|
|
19496
19512
|
height: isHalfSize ? '100%' : undefined
|
|
19497
|
-
})
|
|
19513
|
+
}),
|
|
19514
|
+
lockOverlay: {
|
|
19515
|
+
position: 'absolute',
|
|
19516
|
+
top: 0,
|
|
19517
|
+
left: 0,
|
|
19518
|
+
right: 0,
|
|
19519
|
+
bottom: 0,
|
|
19520
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
19521
|
+
justifyContent: 'center',
|
|
19522
|
+
alignItems: 'center',
|
|
19523
|
+
zIndex: 10
|
|
19524
|
+
}
|
|
19498
19525
|
});
|
|
19499
19526
|
};
|
|
19500
19527
|
|
|
@@ -19563,10 +19590,14 @@ var BaseTileMedia = function (props) {
|
|
|
19563
19590
|
var _a = tileContext.configuration,
|
|
19564
19591
|
artworkUrl = _a.artworkUrl,
|
|
19565
19592
|
_b = _a.title,
|
|
19566
|
-
title = _b === void 0 ? '' : _b
|
|
19593
|
+
title = _b === void 0 ? '' : _b,
|
|
19594
|
+
_c = _a.isLocked,
|
|
19595
|
+
isLocked = _c === void 0 ? false : _c;
|
|
19567
19596
|
var styles = useBaseTileStyles();
|
|
19568
19597
|
if (!artworkUrl) return null;
|
|
19569
|
-
return /*#__PURE__*/React.createElement(
|
|
19598
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19599
|
+
style: baseStyles.imageContainer
|
|
19600
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, __assign({}, props, {
|
|
19570
19601
|
source: {
|
|
19571
19602
|
uri: artworkUrl
|
|
19572
19603
|
},
|
|
@@ -19574,7 +19605,14 @@ var BaseTileMedia = function (props) {
|
|
|
19574
19605
|
style: [props.style, baseStyles.media, styles.media],
|
|
19575
19606
|
alt: "Content image".concat(title ? " for ".concat(title) : ''),
|
|
19576
19607
|
role: "img"
|
|
19577
|
-
}))
|
|
19608
|
+
})), isLocked && (/*#__PURE__*/React.createElement(View$2, {
|
|
19609
|
+
style: styles.lockOverlay,
|
|
19610
|
+
testID: "lock-overlay"
|
|
19611
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
19612
|
+
name: "LockKeyhole",
|
|
19613
|
+
size: 48,
|
|
19614
|
+
color: "white"
|
|
19615
|
+
}))));
|
|
19578
19616
|
};
|
|
19579
19617
|
|
|
19580
19618
|
/**
|
|
@@ -22319,6 +22357,15 @@ var useRewardTileStyles = function () {
|
|
|
22319
22357
|
height: '100%',
|
|
22320
22358
|
resizeMode: 'cover'
|
|
22321
22359
|
},
|
|
22360
|
+
lockIcon: {
|
|
22361
|
+
position: 'absolute',
|
|
22362
|
+
top: 0,
|
|
22363
|
+
left: 0,
|
|
22364
|
+
bottom: 0,
|
|
22365
|
+
right: 0,
|
|
22366
|
+
width: '100%',
|
|
22367
|
+
height: '100%'
|
|
22368
|
+
},
|
|
22322
22369
|
content: {
|
|
22323
22370
|
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
22324
22371
|
flex: 1
|
|
@@ -22342,7 +22389,18 @@ var useRewardTileStyles = function () {
|
|
|
22342
22389
|
tileTitle: __assign({
|
|
22343
22390
|
maxWidth: '90%',
|
|
22344
22391
|
flex: 1
|
|
22345
|
-
}, getDirectionalMargin(8))
|
|
22392
|
+
}, getDirectionalMargin(8)),
|
|
22393
|
+
lockOverlay: {
|
|
22394
|
+
position: 'absolute',
|
|
22395
|
+
top: 0,
|
|
22396
|
+
left: 0,
|
|
22397
|
+
right: 0,
|
|
22398
|
+
bottom: 0,
|
|
22399
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
22400
|
+
justifyContent: 'center',
|
|
22401
|
+
alignItems: 'center',
|
|
22402
|
+
zIndex: 10
|
|
22403
|
+
}
|
|
22346
22404
|
});
|
|
22347
22405
|
};
|
|
22348
22406
|
|
|
@@ -22363,7 +22421,9 @@ var RewardTileMedia = function (_a) {
|
|
|
22363
22421
|
_c = _b.showArtwork,
|
|
22364
22422
|
showArtwork = _c === void 0 ? true : _c,
|
|
22365
22423
|
_d = _b.name,
|
|
22366
|
-
name = _d === void 0 ? 'Reward' : _d
|
|
22424
|
+
name = _d === void 0 ? 'Reward' : _d,
|
|
22425
|
+
_e = _b.isLocked,
|
|
22426
|
+
isLocked = _e === void 0 ? false : _e;
|
|
22367
22427
|
if (!artworkUrl || !showArtwork) return null;
|
|
22368
22428
|
var containerStyle = {
|
|
22369
22429
|
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
@@ -22379,7 +22439,14 @@ var RewardTileMedia = function (_a) {
|
|
|
22379
22439
|
},
|
|
22380
22440
|
style: styles.image,
|
|
22381
22441
|
alt: "Reward image for ".concat(name)
|
|
22382
|
-
})
|
|
22442
|
+
}), isLocked && (/*#__PURE__*/React.createElement(View$2, {
|
|
22443
|
+
style: styles.lockOverlay,
|
|
22444
|
+
testID: "lock-overlay"
|
|
22445
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
22446
|
+
name: "LockKeyhole",
|
|
22447
|
+
size: 48,
|
|
22448
|
+
color: "white"
|
|
22449
|
+
}))));
|
|
22383
22450
|
};
|
|
22384
22451
|
|
|
22385
22452
|
/**
|
|
@@ -22980,7 +23047,18 @@ var useVenueTileStyles = function () {
|
|
|
22980
23047
|
tileTitle: __assign({
|
|
22981
23048
|
maxWidth: '90%',
|
|
22982
23049
|
flex: 1
|
|
22983
|
-
}, getDirectionalMargin(8))
|
|
23050
|
+
}, getDirectionalMargin(8)),
|
|
23051
|
+
lockOverlay: {
|
|
23052
|
+
position: 'absolute',
|
|
23053
|
+
top: 0,
|
|
23054
|
+
left: 0,
|
|
23055
|
+
right: 0,
|
|
23056
|
+
bottom: 0,
|
|
23057
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
23058
|
+
justifyContent: 'center',
|
|
23059
|
+
alignItems: 'center',
|
|
23060
|
+
zIndex: 10
|
|
23061
|
+
}
|
|
22984
23062
|
});
|
|
22985
23063
|
};
|
|
22986
23064
|
|
|
@@ -22992,14 +23070,17 @@ var useVenueTileStyles = function () {
|
|
|
22992
23070
|
* @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
|
|
22993
23071
|
*/
|
|
22994
23072
|
var VenueTileMedia = function (_a) {
|
|
22995
|
-
var
|
|
23073
|
+
var _b = _a.isArtworkOnly,
|
|
23074
|
+
isArtworkOnly = _b === void 0 ? false : _b;
|
|
22996
23075
|
var styles = useVenueTileStyles();
|
|
22997
23076
|
var tileContext = useTileContext();
|
|
22998
23077
|
if (!isContextValid(tileContext)) return null;
|
|
22999
|
-
var
|
|
23000
|
-
artworkUrl =
|
|
23001
|
-
|
|
23002
|
-
name =
|
|
23078
|
+
var _c = tileContext.configuration,
|
|
23079
|
+
artworkUrl = _c.artworkUrl,
|
|
23080
|
+
_d = _c.name,
|
|
23081
|
+
name = _d === void 0 ? 'Venue' : _d,
|
|
23082
|
+
_e = _c.isLocked,
|
|
23083
|
+
isLocked = _e === void 0 ? false : _e;
|
|
23003
23084
|
if (!artworkUrl) return null;
|
|
23004
23085
|
var containerStyle = {
|
|
23005
23086
|
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
@@ -23015,7 +23096,14 @@ var VenueTileMedia = function (_a) {
|
|
|
23015
23096
|
},
|
|
23016
23097
|
style: styles.image,
|
|
23017
23098
|
alt: "Venue image for ".concat(name)
|
|
23018
|
-
})
|
|
23099
|
+
}), isLocked && (/*#__PURE__*/React.createElement(View$2, {
|
|
23100
|
+
style: styles.lockOverlay,
|
|
23101
|
+
testID: "lock-overlay"
|
|
23102
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
23103
|
+
name: "LockKeyhole",
|
|
23104
|
+
size: 48,
|
|
23105
|
+
color: "white"
|
|
23106
|
+
}))));
|
|
23019
23107
|
};
|
|
23020
23108
|
|
|
23021
23109
|
/**
|
|
@@ -23078,9 +23166,7 @@ var VenueTileRoot = function (_a) {
|
|
|
23078
23166
|
if (!tile || tile.tileHeight !== exports.TileHeight.Full || !tile.active || !tile.configuration) return null;
|
|
23079
23167
|
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
23080
23168
|
tile: tile
|
|
23081
|
-
}, /*#__PURE__*/React.createElement(VenueTile.Media, {
|
|
23082
|
-
isArtworkOnly: false
|
|
23083
|
-
}), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Row, {
|
|
23169
|
+
}, /*#__PURE__*/React.createElement(VenueTile.Media, null), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Row, {
|
|
23084
23170
|
justify: "between",
|
|
23085
23171
|
align: "center",
|
|
23086
23172
|
style: styles.header
|