@xsolla/xui-b2c-backpack-item-card 0.0.0-stage → 0.230.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.
@@ -0,0 +1,71 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+ import { TagLabelProps } from '@xsolla/xui-tag-label';
4
+
5
+ /** Figma `Rarity`. Tints the top-centre glow of the slot. */
6
+ type BackpackItemCardRarity = "common" | "uncommon" | "rare" | "epic" | "legendary";
7
+ /**
8
+ * Figma `State`.
9
+ * - `default` — filled slot at rest.
10
+ * - `hover` — pointer over the slot (applied automatically on web when the card is interactive).
11
+ * - `selected` — the slot is the current selection.
12
+ * - `drag` — the slot is being dragged (lifted, with a drop shadow).
13
+ * - `dragSlot` — placeholder left behind / drop target while an item is dragged.
14
+ * - `empty` — inventory slot with no item.
15
+ * - `skeleton` — loading placeholder.
16
+ */
17
+ type BackpackItemCardState = "default" | "hover" | "selected" | "drag" | "dragSlot" | "empty" | "skeleton";
18
+ /** Figma `Backpack-item-Desktop` (200 px) vs `Backpack-item-Mobile` (181 px). */
19
+ type BackpackItemCardSize = "default" | "compact";
20
+ /** Figma `Image`: a flat render, or a 3D asset (adds the 3D indicator). */
21
+ type BackpackItemCardImageType = "static" | "3d";
22
+ interface BackpackItemCardProps extends ThemeOverrideProps {
23
+ /** Item name, shown bottom-left. Required for filled states. */
24
+ name?: string;
25
+ /** Quantity shown in the counter chip bottom-right. Hidden when omitted. */
26
+ count?: number | string;
27
+ /** Item artwork URL. Rendered centred with `object-fit: contain`. */
28
+ imageSrc?: string;
29
+ /** Alt text for the artwork. Decorative by default (the card is already named). */
30
+ imageAlt?: string;
31
+ /** Custom artwork node (e.g. a 3D viewer). Takes precedence over `imageSrc`. */
32
+ image?: ReactNode;
33
+ /** Figma `Image`. `"3d"` shows the 3D indicator under the download button. */
34
+ imageType?: BackpackItemCardImageType;
35
+ /** TagLabel ID series, e.g. `"XLA"`. */
36
+ series?: string;
37
+ /** TagLabel ID number, e.g. `"-001-001"`. */
38
+ number?: string;
39
+ /**
40
+ * Extra props forwarded to the compact `TagLabel` (top-left), e.g.
41
+ * `entityType` or `entityIcon`. `series` / `number` above win over these.
42
+ */
43
+ tagLabelProps?: Partial<TagLabelProps>;
44
+ /** Figma `Rarity`. Defaults to `common`. */
45
+ rarity?: BackpackItemCardRarity;
46
+ /** Figma `State`. Defaults to `default`. */
47
+ state?: BackpackItemCardState;
48
+ /** `default` = 200 px desktop slot, `compact` = 181 px mobile slot. */
49
+ size?: BackpackItemCardSize;
50
+ /**
51
+ * Overrides the square edge length in px. Figma constrains desktop slots to
52
+ * 181–380 px and mobile slots to 146–200 px; values are not clamped.
53
+ */
54
+ width?: number;
55
+ /** Makes the slot interactive (select / open the item). */
56
+ onPress?: () => void;
57
+ /**
58
+ * Download handler. When set, a brand `Tag` (xs, icon only) renders top-right.
59
+ * Pressing it never triggers `onPress`.
60
+ */
61
+ onDownload?: () => void;
62
+ /** Accessible label for the download button. Defaults to `"Download <name>"`. */
63
+ downloadLabel?: string;
64
+ /** Accessible name for the slot. Defaults per state (name, rarity, count / "Empty slot" / "Loading item"). */
65
+ "aria-label"?: string;
66
+ testID?: string;
67
+ }
68
+
69
+ declare const BackpackItemCard: React.FC<BackpackItemCardProps>;
70
+
71
+ export { BackpackItemCard, type BackpackItemCardImageType, type BackpackItemCardProps, type BackpackItemCardRarity, type BackpackItemCardSize, type BackpackItemCardState };
@@ -0,0 +1,71 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+ import { TagLabelProps } from '@xsolla/xui-tag-label';
4
+
5
+ /** Figma `Rarity`. Tints the top-centre glow of the slot. */
6
+ type BackpackItemCardRarity = "common" | "uncommon" | "rare" | "epic" | "legendary";
7
+ /**
8
+ * Figma `State`.
9
+ * - `default` — filled slot at rest.
10
+ * - `hover` — pointer over the slot (applied automatically on web when the card is interactive).
11
+ * - `selected` — the slot is the current selection.
12
+ * - `drag` — the slot is being dragged (lifted, with a drop shadow).
13
+ * - `dragSlot` — placeholder left behind / drop target while an item is dragged.
14
+ * - `empty` — inventory slot with no item.
15
+ * - `skeleton` — loading placeholder.
16
+ */
17
+ type BackpackItemCardState = "default" | "hover" | "selected" | "drag" | "dragSlot" | "empty" | "skeleton";
18
+ /** Figma `Backpack-item-Desktop` (200 px) vs `Backpack-item-Mobile` (181 px). */
19
+ type BackpackItemCardSize = "default" | "compact";
20
+ /** Figma `Image`: a flat render, or a 3D asset (adds the 3D indicator). */
21
+ type BackpackItemCardImageType = "static" | "3d";
22
+ interface BackpackItemCardProps extends ThemeOverrideProps {
23
+ /** Item name, shown bottom-left. Required for filled states. */
24
+ name?: string;
25
+ /** Quantity shown in the counter chip bottom-right. Hidden when omitted. */
26
+ count?: number | string;
27
+ /** Item artwork URL. Rendered centred with `object-fit: contain`. */
28
+ imageSrc?: string;
29
+ /** Alt text for the artwork. Decorative by default (the card is already named). */
30
+ imageAlt?: string;
31
+ /** Custom artwork node (e.g. a 3D viewer). Takes precedence over `imageSrc`. */
32
+ image?: ReactNode;
33
+ /** Figma `Image`. `"3d"` shows the 3D indicator under the download button. */
34
+ imageType?: BackpackItemCardImageType;
35
+ /** TagLabel ID series, e.g. `"XLA"`. */
36
+ series?: string;
37
+ /** TagLabel ID number, e.g. `"-001-001"`. */
38
+ number?: string;
39
+ /**
40
+ * Extra props forwarded to the compact `TagLabel` (top-left), e.g.
41
+ * `entityType` or `entityIcon`. `series` / `number` above win over these.
42
+ */
43
+ tagLabelProps?: Partial<TagLabelProps>;
44
+ /** Figma `Rarity`. Defaults to `common`. */
45
+ rarity?: BackpackItemCardRarity;
46
+ /** Figma `State`. Defaults to `default`. */
47
+ state?: BackpackItemCardState;
48
+ /** `default` = 200 px desktop slot, `compact` = 181 px mobile slot. */
49
+ size?: BackpackItemCardSize;
50
+ /**
51
+ * Overrides the square edge length in px. Figma constrains desktop slots to
52
+ * 181–380 px and mobile slots to 146–200 px; values are not clamped.
53
+ */
54
+ width?: number;
55
+ /** Makes the slot interactive (select / open the item). */
56
+ onPress?: () => void;
57
+ /**
58
+ * Download handler. When set, a brand `Tag` (xs, icon only) renders top-right.
59
+ * Pressing it never triggers `onPress`.
60
+ */
61
+ onDownload?: () => void;
62
+ /** Accessible label for the download button. Defaults to `"Download <name>"`. */
63
+ downloadLabel?: string;
64
+ /** Accessible name for the slot. Defaults per state (name, rarity, count / "Empty slot" / "Loading item"). */
65
+ "aria-label"?: string;
66
+ testID?: string;
67
+ }
68
+
69
+ declare const BackpackItemCard: React.FC<BackpackItemCardProps>;
70
+
71
+ export { BackpackItemCard, type BackpackItemCardImageType, type BackpackItemCardProps, type BackpackItemCardRarity, type BackpackItemCardSize, type BackpackItemCardState };