@wlloyalty/wll-react-sdk 1.0.3 → 1.0.4
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/components/atoms/BaseTile/index.d.ts +11 -1
- package/dist/components/atoms/Content/index.d.ts +14 -0
- package/dist/components/atoms/Icon/Icon.stories.d.ts +4 -4
- package/dist/components/atoms/ProgressBar/index.d.ts +1 -0
- package/dist/components/atoms/ProgressiveImage/ProgressiveImage.stories.d.ts +9 -0
- package/dist/components/atoms/ProgressiveImage/index.d.ts +10 -0
- package/dist/components/atoms/{BaseBanner/BaseBanner.stories.d.ts → RowHeader/RowHeader.stories.d.ts} +3 -3
- package/dist/components/atoms/RowHeader/index.d.ts +8 -0
- package/dist/components/atoms/Text/Text.stories.d.ts +3 -3
- package/dist/components/atoms/Text/index.d.ts +1 -1
- package/dist/components/atoms/TileContainer/index.d.ts +1 -1
- package/dist/components/atoms/index.d.ts +13 -9
- package/dist/components/molecules/Grid/index.d.ts +2 -2
- package/dist/components/molecules/ProgressIndicator/ProgressIndicator.stories.d.ts +2 -5
- package/dist/components/molecules/SectionHeader/index.d.ts +1 -1
- package/dist/components/organisms/BadgeTile/index.d.ts +1 -0
- package/dist/components/organisms/BadgeTileUpdated/BadgeTileUpdated.stories.d.ts +18 -0
- package/dist/components/organisms/BadgeTileUpdated/index.d.ts +19 -0
- package/dist/components/organisms/ContentTile/index.d.ts +17 -1
- package/dist/components/organisms/Group/Group.stories.d.ts +6 -0
- package/dist/components/organisms/Group/index.d.ts +6 -0
- package/dist/components/organisms/RewardCategoryTile/index.d.ts +4 -4
- package/dist/components/organisms/RewardTile/RewardTile.stories.d.ts +3 -0
- package/dist/components/organisms/RewardTile/index.d.ts +8 -2
- package/dist/components/organisms/Section/index.d.ts +5 -12
- package/dist/components/organisms/TierTile/TierTile.d.ts +7 -0
- package/dist/components/organisms/TierTileUpdated/TierTileUpdated.stories.d.ts +33 -0
- package/dist/components/organisms/TierTileUpdated/index.d.ts +15 -0
- package/dist/components/organisms/index.d.ts +4 -1
- package/dist/constants/grid.d.ts +1 -0
- package/dist/context/WllSdkContext.d.ts +11 -6
- package/dist/hooks/useTileSize.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/types/group.d.ts +9 -0
- package/dist/types/section.d.ts +1 -0
- package/dist/types/theme.d.ts +1 -0
- package/dist/types/tile.d.ts +78 -23
- package/dist/types/wll.d.ts +14 -16
- package/dist/utils/apiHelpers.d.ts +28 -0
- package/dist/utils/styling.d.ts +1 -1
- package/dist/utils/themeHelpers.d.ts +3 -0
- package/package.json +2 -1
- package/dist/components/atoms/BaseTile/BaseTile.stories.d.ts +0 -14
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
source: import("react-native").ImageSourcePropType;
|
|
7
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
8
|
+
isDesaturated?: boolean;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
type ProgressiveImageProps = {
|
|
4
|
+
source: ImageSourcePropType;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
isDesaturated?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
declare const ProgressiveImage: React.FC<ProgressiveImageProps>;
|
|
10
|
+
export default ProgressiveImage;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
3
|
declare const _default: Meta;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
6
|
-
tile: import("../../../types/tile").Tile;
|
|
7
6
|
children: React.ReactNode;
|
|
8
|
-
|
|
7
|
+
className?: string;
|
|
8
|
+
} & import("react-native").ViewProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
type RowHeaderProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & React.ComponentProps<typeof View>;
|
|
7
|
+
declare const RowHeader: React.FC<RowHeaderProps>;
|
|
8
|
+
export default RowHeader;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { Text } from
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Text } from '.';
|
|
3
3
|
declare const meta: Meta<typeof Text>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Text>;
|
|
6
6
|
export declare const Body: Story;
|
|
7
7
|
export declare const Eyebrow: Story;
|
|
8
8
|
export declare const Title: Story;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const description: Story;
|
|
10
10
|
export declare const Caption: Story;
|
|
11
11
|
export declare const Label: Story;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TextProps as RNTextProps, TextStyle } from 'react-native';
|
|
3
|
-
type TextVariant = 'eyebrow' | 'title' | '
|
|
3
|
+
type TextVariant = 'eyebrow' | 'title' | 'description' | 'body' | 'caption' | 'label' | 'tier-requirement' | 'tier-earned';
|
|
4
4
|
type TextProps = RNTextProps & {
|
|
5
5
|
variant?: TextVariant;
|
|
6
6
|
style?: TextStyle;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
1
|
+
import BaseBanner from './BaseBanner';
|
|
2
|
+
import BaseTile from './BaseTile';
|
|
3
|
+
import Button from './Button';
|
|
4
|
+
import Content from './Content';
|
|
5
|
+
import Icon from './Icon';
|
|
6
|
+
import Image from './Image';
|
|
7
|
+
import LoadingIndicator from './LoadingIndicator';
|
|
8
|
+
import ProgressBar from './ProgressBar';
|
|
9
|
+
import ProgressiveImage from './ProgressiveImage';
|
|
10
|
+
import RowHeader from './RowHeader';
|
|
11
|
+
import Text from './Text';
|
|
12
|
+
import TileContainer from './TileContainer';
|
|
13
|
+
export { BaseBanner, BaseTile, Button, Content, Icon, Image, LoadingIndicator, ProgressBar, ProgressiveImage, RowHeader, Text, TileContainer, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TSection
|
|
2
|
+
import { TSection } from '../../../types/section';
|
|
3
3
|
type GridProps = {
|
|
4
|
-
section:
|
|
4
|
+
section: TSection;
|
|
5
5
|
};
|
|
6
6
|
declare const Grid: React.FC<GridProps>;
|
|
7
7
|
export default Grid;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import ProgressIndicator, { ProgressIndicatorProps } from
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import ProgressIndicator, { ProgressIndicatorProps } from '.';
|
|
3
3
|
declare const _default: Meta<typeof ProgressIndicator>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
6
6
|
export declare const Incomplete: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
7
7
|
export declare const AlmostComplete: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
8
8
|
export declare const Complete: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
9
|
-
export declare const AccentVariant: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
10
|
-
export declare const SmallHeight: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
11
|
-
export declare const LargeHeight: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ProgressIndicatorProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const LatestNoBadgesEarned: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
5
|
+
tile: import("../../../types/tile").Tile;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const LatestEarned: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
8
|
+
tile: import("../../../types/tile").Tile;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const SpecificBadgeNotEarned: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
11
|
+
tile: import("../../../types/tile").Tile;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const SpecificBadgeHighCount: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
14
|
+
tile: import("../../../types/tile").Tile;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const SpecificBadgeAwardedOnce: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
17
|
+
tile: import("../../../types/tile").Tile;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { ImagePropsNoSource } from '../../../types/common';
|
|
3
|
+
import { Tile } from '../../../types/tile';
|
|
4
|
+
type BadgeTileProps = {
|
|
5
|
+
tile: Tile;
|
|
6
|
+
};
|
|
7
|
+
type BadgeTileMediaProps = ImagePropsNoSource & {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
type BadgeTileComponent = FC<BadgeTileProps> & {
|
|
11
|
+
Media: FC<BadgeTileMediaProps>;
|
|
12
|
+
Content: FC;
|
|
13
|
+
Title: FC;
|
|
14
|
+
Description: FC;
|
|
15
|
+
DateEarned: FC;
|
|
16
|
+
Status: FC;
|
|
17
|
+
};
|
|
18
|
+
export declare const BadgeTile: BadgeTileComponent;
|
|
19
|
+
export default BadgeTile;
|
|
@@ -3,5 +3,21 @@ import { Tile } from '../../../types/tile';
|
|
|
3
3
|
type ContentTileProps = {
|
|
4
4
|
tile: Tile;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type ContentTileComponent = React.FC<ContentTileProps> & {
|
|
7
|
+
Root: typeof ContentTileRoot;
|
|
8
|
+
Media: typeof ContentTileMedia;
|
|
9
|
+
Content: typeof ContentTileContent;
|
|
10
|
+
Header: typeof ContentTileHeader;
|
|
11
|
+
Body: typeof ContentTileBody;
|
|
12
|
+
};
|
|
13
|
+
declare const ContentTileRoot: React.FC<{
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}>;
|
|
16
|
+
declare const ContentTileMedia: React.FC;
|
|
17
|
+
declare const ContentTileContent: React.FC<{
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
declare const ContentTileHeader: React.FC;
|
|
21
|
+
declare const ContentTileBody: React.FC;
|
|
22
|
+
export declare const ContentTile: ContentTileComponent;
|
|
7
23
|
export default ContentTile;
|
|
@@ -4,9 +4,9 @@ type RewardCategoryTileProps = {
|
|
|
4
4
|
tile: Tile;
|
|
5
5
|
};
|
|
6
6
|
declare const RewardCategoryTile: React.FC<RewardCategoryTileProps> & {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Header: typeof RewardCategoryHeader;
|
|
8
|
+
Background: typeof RewardCategoryBackground;
|
|
9
9
|
};
|
|
10
|
-
declare const
|
|
11
|
-
declare const
|
|
10
|
+
declare const RewardCategoryHeader: React.FC;
|
|
11
|
+
declare const RewardCategoryBackground: React.FC;
|
|
12
12
|
export default RewardCategoryTile;
|
|
@@ -7,3 +7,6 @@ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("
|
|
|
7
7
|
export declare const DefaultWithPoints: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
8
8
|
tile: import("../../../types/tile").Tile;
|
|
9
9
|
}>;
|
|
10
|
+
export declare const ArtworkOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
11
|
+
tile: import("../../../types/tile").Tile;
|
|
12
|
+
}>;
|
|
@@ -4,13 +4,19 @@ type RewardTileProps = {
|
|
|
4
4
|
tile: Tile;
|
|
5
5
|
};
|
|
6
6
|
declare const RewardTile: React.FC<RewardTileProps> & {
|
|
7
|
-
|
|
7
|
+
Media: typeof RewardTileMedia;
|
|
8
8
|
Title: typeof RewardTileTitle;
|
|
9
9
|
Description: typeof RewardTileDescription;
|
|
10
10
|
Points: typeof RewardTilePoints;
|
|
11
|
+
Chevron: typeof RewardTileChevron;
|
|
12
|
+
Content: typeof RewardTileContent;
|
|
11
13
|
};
|
|
12
|
-
declare const
|
|
14
|
+
declare const RewardTileMedia: React.FC;
|
|
13
15
|
declare const RewardTileTitle: React.FC;
|
|
14
16
|
declare const RewardTileDescription: React.FC;
|
|
15
17
|
declare const RewardTilePoints: React.FC;
|
|
18
|
+
declare const RewardTileContent: React.FC<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}>;
|
|
21
|
+
declare const RewardTileChevron: React.FC;
|
|
16
22
|
export default RewardTile;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { TSection as SectionData } from '../../../types/section';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { TSection } from '../../../types/section';
|
|
3
3
|
type SectionContextType = {
|
|
4
|
-
sectionData:
|
|
5
|
-
loading: boolean;
|
|
6
|
-
error: Error | null;
|
|
4
|
+
sectionData: TSection;
|
|
7
5
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
sectionId: string;
|
|
11
|
-
children: React.ReactNode;
|
|
6
|
+
type SectionProps = {
|
|
7
|
+
section: TSection;
|
|
12
8
|
};
|
|
13
|
-
export declare const
|
|
9
|
+
export declare const SectionContext: React.Context<SectionContextType | undefined>;
|
|
14
10
|
export declare const useSectionContext: () => SectionContextType;
|
|
15
|
-
interface SectionProps {
|
|
16
|
-
section: SectionData;
|
|
17
|
-
}
|
|
18
11
|
declare const Section: React.FC<SectionProps>;
|
|
19
12
|
export default Section;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const CurrentTier: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
5
|
+
tile: import("../../../types/tile").Tile;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const CurrentTierHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
8
|
+
tile: import("../../../types/tile").Tile;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const CurrentTierNoArtwork: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
11
|
+
tile: import("../../../types/tile").Tile;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const CurrentTierNoArtworkHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
14
|
+
tile: import("../../../types/tile").Tile;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const CurrentNoTier: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
17
|
+
tile: import("../../../types/tile").Tile;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const CurrentNoTierHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
20
|
+
tile: import("../../../types/tile").Tile;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const PointsToTierNotAchieved: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
23
|
+
tile: import("../../../types/tile").Tile;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const PointsToTierNotAchievedHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
26
|
+
tile: import("../../../types/tile").Tile;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const PointsToTierAchieved: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
29
|
+
tile: import("../../../types/tile").Tile;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const PointsToTierAchievedHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
32
|
+
tile: import("../../../types/tile").Tile;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Tile } from '../../../types/tile';
|
|
3
|
+
type TierTileProps = {
|
|
4
|
+
tile: Tile;
|
|
5
|
+
};
|
|
6
|
+
type TierTileComponent = React.FC<TierTileProps> & {
|
|
7
|
+
Full: typeof TierTileFull;
|
|
8
|
+
Half: typeof TierTileHalf;
|
|
9
|
+
Empty: typeof TierTileEmpty;
|
|
10
|
+
};
|
|
11
|
+
declare const TierTileFull: React.FC<TierTileProps>;
|
|
12
|
+
declare const TierTileHalf: React.FC<TierTileProps>;
|
|
13
|
+
declare const TierTileEmpty: React.FC<TierTileProps>;
|
|
14
|
+
export declare const TierTile: TierTileComponent;
|
|
15
|
+
export default TierTile;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import BadgeTile from './BadgeTile';
|
|
2
|
+
import BadgeTileUpdated from './BadgeTileUpdated';
|
|
2
3
|
import BannerTile from './BannerTile';
|
|
3
4
|
import ContentTile from './ContentTile';
|
|
5
|
+
import Group from './Group';
|
|
4
6
|
import PointsTile from './PointsTile';
|
|
5
7
|
import RewardCategoryTile from './RewardCategoryTile';
|
|
6
8
|
import RewardTile from './RewardTile';
|
|
7
9
|
import Section from './Section';
|
|
8
10
|
import TierTile from './TierTile';
|
|
9
|
-
|
|
11
|
+
import TierTileUpdated from './TierTileUpdated';
|
|
12
|
+
export { BadgeTile, BadgeTileUpdated, BannerTile, ContentTile, Group, PointsTile, RewardCategoryTile, RewardTile, Section, TierTile, TierTileUpdated, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GRID_GAP = 16;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TGroup } from '../types/group';
|
|
2
3
|
import { TSection } from '../types/section';
|
|
3
4
|
import { BaseThemeObject, ThemeContextType } from '../types/theme';
|
|
4
5
|
import { Tile } from '../types/tile';
|
|
5
|
-
type
|
|
6
|
+
type Fetcher = <T>(endpoint: string, options?: RequestInit) => Promise<APIResponse<T>>;
|
|
7
|
+
export type SDKConfig = {
|
|
6
8
|
apiKey: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
userToken?: string;
|
|
10
|
+
fetcher?: Fetcher;
|
|
11
|
+
locale?: string;
|
|
9
12
|
};
|
|
10
|
-
type APIResponse<T> = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
export type APIResponse<T> = {
|
|
14
|
+
status: 'success' | 'error';
|
|
15
|
+
data: T | null;
|
|
16
|
+
error?: string;
|
|
13
17
|
};
|
|
14
18
|
type WllSdkContextType = ThemeContextType & {
|
|
19
|
+
getGroupByID: (id: string) => Promise<APIResponse<TGroup>>;
|
|
15
20
|
getSectionByID: (id: string) => Promise<APIResponse<TSection>>;
|
|
16
21
|
getTileByID: (id: string) => Promise<APIResponse<Tile>>;
|
|
17
22
|
};
|