@wlloyalty/wll-react-sdk 1.8.1 → 1.10.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.
@@ -6,7 +6,7 @@ export declare const useChipStyles: () => {
6
6
  flexDirection: "row";
7
7
  paddingHorizontal: number;
8
8
  paddingVertical: number;
9
- borderRadius: 9999;
9
+ borderRadius: number;
10
10
  overflow: "hidden";
11
11
  flexShrink: number;
12
12
  };
@@ -1,6 +1,11 @@
1
1
  import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ type ResponsiveViewStyle = StyleProp<ViewStyle> & {
4
+ flexBasis?: string | number;
5
+ };
2
6
  type ContentTileMediaProps = {
3
7
  isArtworkOnly: boolean;
4
8
  };
9
+ export declare const getContentTileMediaContainerStyle: (isArtworkOnly: boolean) => ResponsiveViewStyle;
5
10
  export declare const ContentTileMedia: ({ isArtworkOnly, }: ContentTileMediaProps) => React.ReactElement | null;
6
11
  export {};
@@ -1,4 +1,3 @@
1
- import { sizes } from '../utils/styling';
2
1
  import { WithChildren } from './helpers';
3
2
  import { BadgeTileType } from './tile';
4
3
  export type PercentageKey = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 95;
@@ -6,6 +5,23 @@ export type DerivedColors = {
6
5
  [K in PercentageKey]: string;
7
6
  };
8
7
  export type DesaturationType = BadgeTileType.Specific | BadgeTileType.Latest;
8
+ export type Sizes = {
9
+ borderRadiusSm: number;
10
+ borderRadiusLg: number;
11
+ borderRadiusButton: number;
12
+ borderRadiusRounded: number;
13
+ xxxs: number;
14
+ xxs: number;
15
+ xs: number;
16
+ sm: number;
17
+ md: number;
18
+ lg: number;
19
+ xl: number;
20
+ xxl: number;
21
+ xxxl: number;
22
+ xxxxl: number;
23
+ xxxxxl: number;
24
+ };
9
25
  export type BaseThemeObject = {
10
26
  fontFamily: string;
11
27
  accent: string;
@@ -19,6 +35,7 @@ export type BaseThemeObject = {
19
35
  surface: string;
20
36
  surfaceText: string;
21
37
  text: string;
38
+ sizes?: Partial<Sizes>;
22
39
  };
23
40
  export type DerivedProperties = {
24
41
  accentText: string;
@@ -32,7 +49,7 @@ export type DerivedProperties = {
32
49
  alphaDerivedText: DerivedColors;
33
50
  };
34
51
  export type ThemeObject = BaseThemeObject & DerivedProperties & {
35
- readonly sizes: typeof sizes;
52
+ sizes: Sizes;
36
53
  };
37
54
  export type ThemeContextType = {
38
55
  theme: ThemeObject;
@@ -13,6 +13,7 @@ export declare const storyBookThemes: {
13
13
  pageButtonText: string;
14
14
  positive: string;
15
15
  text: string;
16
+ sizes?: Partial<import("../types/theme").Sizes>;
16
17
  };
17
18
  warm: {
18
19
  primary: string;
@@ -27,6 +28,7 @@ export declare const storyBookThemes: {
27
28
  pageButtonText: string;
28
29
  positive: string;
29
30
  text: string;
31
+ sizes?: Partial<import("../types/theme").Sizes>;
30
32
  };
31
33
  dark: {
32
34
  background: string;
@@ -41,6 +43,7 @@ export declare const storyBookThemes: {
41
43
  pageButtonBackground: string;
42
44
  pageButtonText: string;
43
45
  positive: string;
46
+ sizes?: Partial<import("../types/theme").Sizes>;
44
47
  };
45
48
  forest: {
46
49
  primary: string;
@@ -55,6 +58,7 @@ export declare const storyBookThemes: {
55
58
  pageButtonText: string;
56
59
  positive: string;
57
60
  text: string;
61
+ sizes?: Partial<import("../types/theme").Sizes>;
58
62
  };
59
63
  sunset: {
60
64
  primary: string;
@@ -69,6 +73,7 @@ export declare const storyBookThemes: {
69
73
  pageButtonText: string;
70
74
  positive: string;
71
75
  text: string;
76
+ sizes?: Partial<import("../types/theme").Sizes>;
72
77
  };
73
78
  };
74
79
  export type ThemeName = 'default' | 'dark' | 'modern' | 'warm' | 'forest' | 'sunset';
package/dist/web.js CHANGED
@@ -8914,9 +8914,11 @@ var createTheme = function (baseTheme) {
8914
8914
  if (baseTheme === void 0) {
8915
8915
  baseTheme = {};
8916
8916
  }
8917
- var mergedTheme = __assign(__assign({}, defaultTheme), baseTheme);
8917
+ var userSizes = baseTheme.sizes,
8918
+ restBaseTheme = __rest(baseTheme, ["sizes"]);
8919
+ var mergedTheme = __assign(__assign({}, defaultTheme), restBaseTheme);
8918
8920
  return __assign(__assign({}, mergedTheme), {
8919
- sizes: sizes,
8921
+ sizes: __assign(__assign({}, sizes), userSizes),
8920
8922
  derivedBackground: getDerivedColor(mergedTheme.background),
8921
8923
  primaryText: getReadableTextColor(mergedTheme.primary),
8922
8924
  accentText: getReadableTextColor(mergedTheme.accent),
@@ -20933,6 +20935,14 @@ var useContentTileStyles = function (hasArtwork) {
20933
20935
  });
20934
20936
  };
20935
20937
 
20938
+ var getContentTileMediaContainerStyle = function (isArtworkOnly) {
20939
+ return isArtworkOnly ? {
20940
+ flexBasis: '100%',
20941
+ aspectRatio: 1
20942
+ } : {
20943
+ flexBasis: '50%'
20944
+ };
20945
+ };
20936
20946
  var ContentTileMedia = function (_a) {
20937
20947
  var isArtworkOnly = _a.isArtworkOnly;
20938
20948
  var tileContext = useTileContext();
@@ -20944,11 +20954,7 @@ var ContentTileMedia = function (_a) {
20944
20954
  if (!artworkUrl) return null;
20945
20955
  var hasArtwork = Boolean(artworkUrl);
20946
20956
  var styles = useContentTileStyles(hasArtwork);
20947
- var containerStyle = __assign({
20948
- flexBasis: isArtworkOnly ? '100%' : '50%'
20949
- }, isArtworkOnly && IS_WEB && {
20950
- aspectRatio: 1
20951
- });
20957
+ var containerStyle = getContentTileMediaContainerStyle(isArtworkOnly);
20952
20958
  return /*#__PURE__*/React.createElement(View$2, {
20953
20959
  style: [styles.imageContainer, containerStyle],
20954
20960
  testID: "content-tile-media",