@xsolla/xui-b2c-other-card 0.202.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/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@xsolla/xui-b2c-other-card",
3
+ "version": "0.202.0",
4
+ "main": "./web/index.js",
5
+ "module": "./web/index.mjs",
6
+ "types": "./web/index.d.ts",
7
+ "scripts": {
8
+ "build": "yarn build:web && yarn build:native",
9
+ "build:web": "PLATFORM=web tsup",
10
+ "build:native": "PLATFORM=native tsup",
11
+ "test": "vitest",
12
+ "test:run": "vitest run",
13
+ "test:coverage": "vitest run --coverage"
14
+ },
15
+ "dependencies": {
16
+ "@xsolla/xui-core": "0.202.0",
17
+ "@xsolla/xui-icons": "0.202.0",
18
+ "@xsolla/xui-primitives-core": "0.202.0"
19
+ },
20
+ "peerDependencies": {
21
+ "react": ">=16.8.0"
22
+ },
23
+ "devDependencies": {
24
+ "@testing-library/jest-dom": "^6.9.1",
25
+ "@testing-library/react": "^14.1.2",
26
+ "@vitest/coverage-v8": "^4.0.18",
27
+ "jsdom": "^24.0.0",
28
+ "react": "^18.0.0",
29
+ "react-dom": "^18.0.0",
30
+ "tsup": "^8.0.0",
31
+ "vitest": "^4.0.18"
32
+ },
33
+ "license": "MIT",
34
+ "sideEffects": false,
35
+ "react-native": "./native/index.js",
36
+ "exports": {
37
+ ".": {
38
+ "react-native": {
39
+ "types": "./native/index.d.ts",
40
+ "import": "./native/index.mjs",
41
+ "require": "./native/index.js"
42
+ },
43
+ "import": {
44
+ "types": "./web/index.d.ts",
45
+ "default": "./web/index.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./web/index.d.ts",
49
+ "default": "./web/index.js"
50
+ },
51
+ "default": {
52
+ "types": "./web/index.d.ts",
53
+ "default": "./web/index.js"
54
+ }
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,49 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type OtherCardInteractiveState = "default" | "hover" | "press" | "disabled";
5
+ /**
6
+ * `brand` is the offer-type tag on the left (e.g. "Passive bonus").
7
+ * `alert` is the timing tag on the right (e.g. "Active until 10 Jul 2025").
8
+ */
9
+ type OtherCardTagTone = "brand" | "alert";
10
+ interface OtherCardTagData {
11
+ label: ReactNode;
12
+ icon?: ReactNode;
13
+ tone?: OtherCardTagTone;
14
+ }
15
+ interface OtherCardProps extends ThemeOverrideProps {
16
+ /** Offer title, e.g. "X2 cashback {item name}". heading/h5 (display, 20/20/700); wraps to at most two lines. */
17
+ title: ReactNode;
18
+ /** Optional supporting copy under the title. Clamped to three lines. */
19
+ description?: ReactNode;
20
+ /** Publisher / game name that sources the offer, e.g. "PUBG Mobile". */
21
+ publisherName?: ReactNode;
22
+ /** Circular publisher avatar (24×24). Paired with `publisherName`; the avatar alone is not enough. */
23
+ publisherAvatarSrc?: string;
24
+ publisherAvatarAlt?: string;
25
+ /** Tag row. The first tag defaults to the `brand` tone, the rest to `alert`. */
26
+ tags?: OtherCardTagData[];
27
+ /** Availability label, e.g. "Available". Rendered with the success palette. */
28
+ status?: ReactNode;
29
+ /** Verb phrase for the action button, e.g. "Show discount code". */
30
+ actionLabel?: ReactNode;
31
+ onActionPress?: () => void;
32
+ /** Makes the whole card tappable (navigates to the offer detail). */
33
+ onPress?: () => void;
34
+ /** Square (1:1) promo image. Omit — or set `imageVisible={false}` — for the text-only variant. */
35
+ imageSrc?: string;
36
+ imageAlt?: string;
37
+ imageVisible?: boolean;
38
+ /** Interactive state. Web applies hover/press automatically; pass explicitly for design review. */
39
+ state?: OtherCardInteractiveState;
40
+ disabled?: boolean;
41
+ /** Card width. Defaults to the 366 px Figma frame; pass `"100%"` to fill a feed column. */
42
+ width?: number | string;
43
+ "aria-label"?: string;
44
+ testID?: string;
45
+ }
46
+
47
+ declare const OtherCard: React.FC<OtherCardProps>;
48
+
49
+ export { OtherCard, type OtherCardInteractiveState, type OtherCardProps, type OtherCardTagData, type OtherCardTagTone };
package/web/index.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type OtherCardInteractiveState = "default" | "hover" | "press" | "disabled";
5
+ /**
6
+ * `brand` is the offer-type tag on the left (e.g. "Passive bonus").
7
+ * `alert` is the timing tag on the right (e.g. "Active until 10 Jul 2025").
8
+ */
9
+ type OtherCardTagTone = "brand" | "alert";
10
+ interface OtherCardTagData {
11
+ label: ReactNode;
12
+ icon?: ReactNode;
13
+ tone?: OtherCardTagTone;
14
+ }
15
+ interface OtherCardProps extends ThemeOverrideProps {
16
+ /** Offer title, e.g. "X2 cashback {item name}". heading/h5 (display, 20/20/700); wraps to at most two lines. */
17
+ title: ReactNode;
18
+ /** Optional supporting copy under the title. Clamped to three lines. */
19
+ description?: ReactNode;
20
+ /** Publisher / game name that sources the offer, e.g. "PUBG Mobile". */
21
+ publisherName?: ReactNode;
22
+ /** Circular publisher avatar (24×24). Paired with `publisherName`; the avatar alone is not enough. */
23
+ publisherAvatarSrc?: string;
24
+ publisherAvatarAlt?: string;
25
+ /** Tag row. The first tag defaults to the `brand` tone, the rest to `alert`. */
26
+ tags?: OtherCardTagData[];
27
+ /** Availability label, e.g. "Available". Rendered with the success palette. */
28
+ status?: ReactNode;
29
+ /** Verb phrase for the action button, e.g. "Show discount code". */
30
+ actionLabel?: ReactNode;
31
+ onActionPress?: () => void;
32
+ /** Makes the whole card tappable (navigates to the offer detail). */
33
+ onPress?: () => void;
34
+ /** Square (1:1) promo image. Omit — or set `imageVisible={false}` — for the text-only variant. */
35
+ imageSrc?: string;
36
+ imageAlt?: string;
37
+ imageVisible?: boolean;
38
+ /** Interactive state. Web applies hover/press automatically; pass explicitly for design review. */
39
+ state?: OtherCardInteractiveState;
40
+ disabled?: boolean;
41
+ /** Card width. Defaults to the 366 px Figma frame; pass `"100%"` to fill a feed column. */
42
+ width?: number | string;
43
+ "aria-label"?: string;
44
+ testID?: string;
45
+ }
46
+
47
+ declare const OtherCard: React.FC<OtherCardProps>;
48
+
49
+ export { OtherCard, type OtherCardInteractiveState, type OtherCardProps, type OtherCardTagData, type OtherCardTagTone };