@xsolla/xui-tag-label 0.228.0 → 0.229.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/README.md +62 -9
- package/native/index.d.mts +22 -3
- package/native/index.d.ts +22 -3
- package/native/index.js +41 -12
- package/native/index.js.map +1 -1
- package/native/index.mjs +44 -11
- package/native/index.mjs.map +1 -1
- package/package.json +5 -4
- package/web/index.d.mts +22 -3
- package/web/index.d.ts +22 -3
- package/web/index.js +41 -12
- package/web/index.js.map +1 -1
- package/web/index.mjs +44 -11
- package/web/index.mjs.map +1 -1
package/native/index.mjs
CHANGED
|
@@ -343,8 +343,30 @@ var Icon = ({
|
|
|
343
343
|
// src/TagLabel.tsx
|
|
344
344
|
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
345
345
|
import { User, Settings, Info, X } from "@xsolla/xui-icons";
|
|
346
|
+
import {
|
|
347
|
+
RarityCommon,
|
|
348
|
+
RarityUncommon,
|
|
349
|
+
RarityRare,
|
|
350
|
+
RarityEpic,
|
|
351
|
+
RarityLegendary
|
|
352
|
+
} from "@xsolla/xui-icons-tag-label";
|
|
346
353
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
354
|
+
var RARITY_TYPES = [
|
|
355
|
+
"common",
|
|
356
|
+
"uncommon",
|
|
357
|
+
"rare",
|
|
358
|
+
"epic",
|
|
359
|
+
"legendary"
|
|
360
|
+
];
|
|
347
361
|
var SEGMENT_HEIGHT = 24;
|
|
362
|
+
var RARITY_ICONS = {
|
|
363
|
+
common: RarityCommon,
|
|
364
|
+
uncommon: RarityUncommon,
|
|
365
|
+
rare: RarityRare,
|
|
366
|
+
epic: RarityEpic,
|
|
367
|
+
legendary: RarityLegendary
|
|
368
|
+
};
|
|
369
|
+
var isRarityType = (value) => typeof value === "string" && RARITY_TYPES.includes(value);
|
|
348
370
|
var TagLabelModuleChip = ({ showIcon, showLabel, icon, label, colors }) => {
|
|
349
371
|
if (!showIcon && !showLabel) return null;
|
|
350
372
|
if (showIcon && !showLabel) {
|
|
@@ -546,23 +568,24 @@ var TagLabelNameSegment = ({
|
|
|
546
568
|
}
|
|
547
569
|
);
|
|
548
570
|
};
|
|
549
|
-
var TagLabelRaritySegment = ({
|
|
550
|
-
rarity
|
|
551
|
-
theme
|
|
552
|
-
}) => {
|
|
553
|
-
const tagLabel = theme?.colors?.control?.tagLabel;
|
|
554
|
-
const colors = tagLabel?.rarity;
|
|
571
|
+
var TagLabelRaritySegment = ({ rarity, icon, theme }) => {
|
|
572
|
+
const colors = theme?.colors?.control?.tagLabel?.rarity;
|
|
555
573
|
if (!colors) return null;
|
|
574
|
+
const tier = isRarityType(rarity) ? rarity : "common";
|
|
575
|
+
const TierIcon = RARITY_ICONS[tier];
|
|
576
|
+
const content = colors.content;
|
|
577
|
+
const customIcon = icon ?? (isRarityType(rarity) ? void 0 : rarity);
|
|
556
578
|
return /* @__PURE__ */ jsx4(
|
|
557
579
|
Box,
|
|
558
580
|
{
|
|
581
|
+
testID: `tag-label__rarity-${tier}`,
|
|
559
582
|
height: SEGMENT_HEIGHT,
|
|
560
583
|
width: SEGMENT_HEIGHT,
|
|
561
|
-
backgroundColor: colors
|
|
562
|
-
paddingHorizontal:
|
|
584
|
+
backgroundColor: colors[tier],
|
|
585
|
+
paddingHorizontal: 3,
|
|
563
586
|
alignItems: "center",
|
|
564
587
|
justifyContent: "center",
|
|
565
|
-
children: /* @__PURE__ */ jsx4(Icon, { size: 18, color:
|
|
588
|
+
children: customIcon ? /* @__PURE__ */ jsx4(Icon, { size: 18, color: content, children: customIcon }) : /* @__PURE__ */ jsx4(TierIcon, { size: 18, color: content })
|
|
566
589
|
}
|
|
567
590
|
);
|
|
568
591
|
};
|
|
@@ -638,6 +661,7 @@ var TagLabel = ({
|
|
|
638
661
|
number,
|
|
639
662
|
label,
|
|
640
663
|
rarity,
|
|
664
|
+
rarityIcon,
|
|
641
665
|
status,
|
|
642
666
|
compact = false,
|
|
643
667
|
children,
|
|
@@ -684,6 +708,14 @@ var TagLabel = ({
|
|
|
684
708
|
theme
|
|
685
709
|
}
|
|
686
710
|
),
|
|
711
|
+
!compact && rarity && /* @__PURE__ */ jsx4(
|
|
712
|
+
TagLabelRaritySegment,
|
|
713
|
+
{
|
|
714
|
+
rarity,
|
|
715
|
+
icon: rarityIcon,
|
|
716
|
+
theme
|
|
717
|
+
}
|
|
718
|
+
),
|
|
687
719
|
(series || number) && /* @__PURE__ */ jsx4(
|
|
688
720
|
TagLabelIdSegment,
|
|
689
721
|
{
|
|
@@ -694,7 +726,6 @@ var TagLabel = ({
|
|
|
694
726
|
}
|
|
695
727
|
),
|
|
696
728
|
!compact && label && /* @__PURE__ */ jsx4(TagLabelNameSegment, { label, theme }),
|
|
697
|
-
!compact && rarity && /* @__PURE__ */ jsx4(TagLabelRaritySegment, { rarity, theme }),
|
|
698
729
|
!compact && status && /* @__PURE__ */ jsx4(TagLabelStatusSegment, { type: status, theme }),
|
|
699
730
|
!compact && children && /* @__PURE__ */ jsx4(TagLabelCustomSlot, { theme, children })
|
|
700
731
|
]
|
|
@@ -702,6 +733,8 @@ var TagLabel = ({
|
|
|
702
733
|
);
|
|
703
734
|
};
|
|
704
735
|
export {
|
|
705
|
-
|
|
736
|
+
RARITY_TYPES,
|
|
737
|
+
TagLabel,
|
|
738
|
+
isRarityType
|
|
706
739
|
};
|
|
707
740
|
//# sourceMappingURL=index.mjs.map
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../src/TagLabel.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\n/**\n * Yoga has no inline formatting context, so RN's ViewStyle.display only\n * accepts \"flex\" | \"none\". Every inline-ish web value collapses to a plain\n * flex container — the box already fills only its content on native, which is\n * what those callers wanted on web anyway. Returning undefined (rather than\n * \"flex\") leaves RN's own default in place.\n */\nconst toNativeDisplay = (\n display: BoxProps[\"display\"]\n): ViewStyle[\"display\"] => (display === \"none\" ? \"none\" : undefined);\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n display,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n display: toNativeDisplay(display),\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","import React, { type ReactNode } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } from \"@xsolla/xui-core\";\nimport { User, Settings, Info, X } from \"@xsolla/xui-icons\";\n\n// --- Types ---\n\nexport type EntityType = \"item\" | \"product\" | \"account\";\n\nexport type StatusType = \"sale\" | \"maintenance\" | \"inactive\";\n\nexport type SubentityType =\n | \"skin\"\n | \"in-game-item\"\n | \"currency\"\n | \"bundle\"\n | \"lootbox\"\n | \"game-key\"\n | \"discount\"\n | \"coupon\"\n | \"game\"\n | \"sdk\"\n | \"plugin\"\n | \"api\"\n | \"service\"\n | \"tool\"\n | \"webshop\"\n | \"app\"\n | \"launcher\"\n | \"library\"\n | \"engine\"\n | \"user\"\n | \"developer\"\n | \"influencer\"\n | \"publisher\"\n | \"settings\";\n\nexport interface TagLabelProps extends ThemeOverrideProps {\n /** Main entity type */\n entityType?: EntityType;\n /** Detailed sub-category */\n subentityType?: SubentityType;\n /**\n * Custom icon for the entity module.\n *\n * @deprecated Use {@link TagLabelProps.entityIcon} instead. `icon` is kept as\n * an alias for backwards compatibility and will be removed in a future major.\n */\n icon?: ReactNode;\n /**\n * Show the icon of the entity module.\n *\n * @default true\n */\n showEntityIcon?: boolean;\n /**\n * Show the text label of the entity module. Defaults to `!compact`, so\n * `compact` only seeds the default — an explicit value always wins.\n *\n * @default !compact\n */\n showEntityLabel?: boolean;\n /** Custom icon override for the entity module. Takes precedence over `icon`. */\n entityIcon?: ReactNode;\n /**\n * Show the icon of the subentity module.\n *\n * @default true\n */\n showSubentityIcon?: boolean;\n /**\n * Show the text label of the subentity module. Defaults to `!compact`, so\n * `compact` only seeds the default — an explicit value always wins.\n *\n * @default !compact\n */\n showSubentityLabel?: boolean;\n /** Custom icon override for the subentity module. */\n subentityIcon?: ReactNode;\n /** ID series (e.g. \"XLA\") */\n series?: string;\n /** ID number (e.g. \"-001-001\") */\n number?: string;\n /** Item label/name */\n label?: string;\n /** Rarity icon or indicator */\n rarity?: ReactNode;\n /** Status indicator */\n status?: StatusType;\n /** Whether to show the compact version */\n compact?: boolean;\n /** Custom content slot */\n children?: ReactNode;\n /** Custom styles */\n style?: any;\n testID?: string;\n}\n\n// --- Internal Segments ---\n\nconst SEGMENT_HEIGHT = 24;\n\ninterface ModuleColors {\n bg?: string;\n text?: string;\n textCompact?: string;\n}\n\n/**\n * Shared chip renderer for the entity and subentity modules.\n *\n * Rendering rules (see XUITSD-101):\n * - icon + label -> full chip: tinted background, icon, text.\n * - icon only -> 24x24 square, no chip background (the legacy compact\n * entity rendering).\n * - label only -> full chip minus the icon; background, padding and\n * typography are unchanged.\n * - neither -> nothing is rendered at all.\n */\nconst TagLabelModuleChip: React.FC<{\n showIcon: boolean;\n showLabel: boolean;\n icon: ReactNode;\n label: string;\n colors: ModuleColors;\n}> = ({ showIcon, showLabel, icon, label, colors }) => {\n if (!showIcon && !showLabel) return null;\n\n if (showIcon && !showLabel) {\n return (\n <Box\n height={SEGMENT_HEIGHT}\n width={SEGMENT_HEIGHT}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Icon size={16} color={colors.textCompact || colors.text}>\n {icon}\n </Icon>\n </Box>\n );\n }\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingLeft={2}\n paddingRight={4}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={2}\n >\n {showIcon && (\n <Icon size={20} color={colors.text}>\n {icon}\n </Icon>\n )}\n <Text\n color={colors.text}\n fontSize={14}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n >\n {label}\n </Text>\n </Box>\n );\n};\n\nconst TagLabelEntitySegment: React.FC<{\n type: EntityType;\n showIcon: boolean;\n showLabel: boolean;\n icon?: ReactNode;\n theme: any;\n}> = ({ type, showIcon, showLabel, icon, theme }) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors: ModuleColors | undefined = tagLabel?.[type];\n\n if (!colors) return null;\n\n // Generic icon placeholders for now based on Figma intent\n const renderIcon = () => {\n if (icon) return icon;\n switch (type) {\n case \"item\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Cube placeholder\n case \"product\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Chip placeholder\n case \"account\":\n return <User size=\"100%\" />;\n }\n };\n\n return (\n <TagLabelModuleChip\n showIcon={showIcon}\n showLabel={showLabel}\n icon={renderIcon()}\n label={type.charAt(0).toUpperCase() + type.slice(1)}\n colors={colors}\n />\n );\n};\n\nconst TagLabelSubentitySegment: React.FC<{\n type: SubentityType;\n showIcon: boolean;\n showLabel: boolean;\n icon?: ReactNode;\n theme: any;\n}> = ({ type, showIcon, showLabel, icon, theme }) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors: ModuleColors | undefined = tagLabel?.subentity;\n\n if (!colors || !type || typeof type !== \"string\") return null;\n\n // Icon mapping based on Figma\n const renderIcon = () => {\n if (icon) return icon;\n switch (type) {\n case \"skin\":\n case \"in-game-item\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Pencil placeholder\n case \"game\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Controller placeholder\n case \"user\":\n return <User size=\"100%\" />;\n case \"settings\":\n return <Settings size=\"100%\" />;\n // ... more icons as needed\n default:\n return <Info size=\"100%\" />;\n }\n };\n\n const label = type\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n\n return (\n <TagLabelModuleChip\n showIcon={showIcon}\n showLabel={showLabel}\n icon={renderIcon()}\n label={label}\n colors={colors}\n />\n );\n};\n\nconst TagLabelIdSegment: React.FC<{\n series?: string;\n number?: string;\n compact?: boolean;\n theme: any;\n}> = ({ series, number, compact, theme }) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors = tagLabel?.id;\n\n if (!colors) return null;\n\n if (compact) {\n return (\n <Box\n height={SEGMENT_HEIGHT}\n paddingLeft={4}\n paddingRight={6}\n flexDirection=\"row\"\n alignItems=\"center\"\n >\n {series && (\n <Text color={colors.textCompact} fontSize={14} fontWeight=\"400\">\n {series}\n </Text>\n )}\n {number && (\n <Text color={colors.textCompact} fontSize={14} fontWeight=\"400\">\n {number}\n </Text>\n )}\n </Box>\n );\n }\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingLeft={4}\n paddingRight={6}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={2}\n >\n {series && (\n <Box\n backgroundColor={colors.bgSeries}\n height={16}\n paddingHorizontal={2}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Text color={colors.textSeries} fontSize={14} fontWeight=\"500\">\n {series}\n </Text>\n </Box>\n )}\n {number && (\n <Text color={colors.textNumber} fontSize={14} fontWeight=\"500\">\n {number}\n </Text>\n )}\n </Box>\n );\n};\n\nconst TagLabelNameSegment: React.FC<{ label: string; theme: any }> = ({\n label,\n theme,\n}) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors = tagLabel?.name;\n\n if (!colors) return null;\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingHorizontal={4}\n justifyContent=\"center\"\n >\n <Text\n color={colors.text}\n fontSize={14}\n fontWeight=\"400\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {label}\n </Text>\n </Box>\n );\n};\n\nconst TagLabelRaritySegment: React.FC<{ rarity: ReactNode; theme: any }> = ({\n rarity,\n theme,\n}) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors = tagLabel?.rarity;\n\n if (!colors) return null;\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n width={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingHorizontal={6}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Icon size={18} color={colors.text}>\n {rarity || <Info size=\"100%\" />}\n </Icon>\n </Box>\n );\n};\n\nconst TagLabelStatusSegment: React.FC<{ type: StatusType; theme: any }> = ({\n type,\n theme,\n}) => {\n let bg;\n let icon;\n\n if (!theme?.colors?.background) return null;\n\n switch (type) {\n case \"sale\":\n bg = theme.colors.background.warning?.primary;\n icon = <Info size=\"100%\" />; // Info placeholder\n break;\n case \"maintenance\":\n bg = theme.colors.background.success?.primary;\n icon = <Settings size=\"100%\" />;\n break;\n case \"inactive\":\n bg = theme.colors.background.alert?.primary;\n icon = <X size=\"100%\" />;\n break;\n }\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n width={SEGMENT_HEIGHT}\n backgroundColor={bg}\n paddingHorizontal={2}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Icon size={20} color=\"black\">\n {icon}\n </Icon>\n </Box>\n );\n};\n\nconst TagLabelCustomSlot: React.FC<{ children: ReactNode; theme: any }> = ({\n children,\n theme,\n}) => {\n if (!theme?.colors?.background) return null;\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={theme.colors.background.secondary}\n paddingHorizontal={6}\n justifyContent=\"center\"\n >\n {typeof children === \"string\" ? (\n <Text\n color={theme?.colors?.content?.primary}\n fontSize={14}\n fontWeight=\"500\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Box>\n );\n};\n\n// --- Main Component ---\n\nexport const TagLabel: React.FC<TagLabelProps> = ({\n entityType,\n subentityType,\n icon,\n entityIcon,\n showEntityIcon = true,\n showEntityLabel,\n subentityIcon,\n showSubentityIcon = true,\n showSubentityLabel,\n series,\n number,\n label,\n rarity,\n status,\n compact = false,\n children,\n style,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n // `compact` only seeds the DEFAULT for the label flags — an explicit\n // show*Label always wins over it.\n const entityLabelVisible = showEntityLabel ?? !compact;\n const subentityLabelVisible = showSubentityLabel ?? !compact;\n\n // `entityIcon` is the canonical prop; `icon` is the deprecated alias.\n const resolvedEntityIcon = entityIcon ?? icon;\n\n const renderEntity =\n Boolean(entityType) && (showEntityIcon || entityLabelVisible);\n const renderSubentity =\n Boolean(subentityType) && (showSubentityIcon || subentityLabelVisible);\n\n return (\n <Box\n testID={testID}\n flexDirection=\"row\"\n alignItems=\"center\"\n style={{\n overflow: \"hidden\",\n borderRadius: theme.shape.tagLabel.borderRadius,\n ...style,\n }}\n >\n {renderEntity && (\n <TagLabelEntitySegment\n type={entityType as EntityType}\n showIcon={showEntityIcon}\n showLabel={entityLabelVisible}\n icon={resolvedEntityIcon}\n theme={theme}\n />\n )}\n\n {renderSubentity && (\n <TagLabelSubentitySegment\n type={subentityType as SubentityType}\n showIcon={showSubentityIcon}\n showLabel={subentityLabelVisible}\n icon={subentityIcon}\n theme={theme}\n />\n )}\n\n {(series || number) && (\n <TagLabelIdSegment\n series={series}\n number={number}\n compact={compact}\n theme={theme}\n />\n )}\n\n {!compact && label && <TagLabelNameSegment label={label} theme={theme} />}\n\n {!compact && rarity && (\n <TagLabelRaritySegment rarity={rarity} theme={theme} />\n )}\n\n {!compact && status && (\n <TagLabelStatusSegment type={status} theme={theme} />\n )}\n\n {!compact && children && (\n <TagLabelCustomSlot theme={theme}>{children}</TagLabelCustomSlot>\n )}\n </Box>\n );\n};\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAqND;AAlNN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAGA,IAAM,aAAa,CAAC,QAAyD;AAC3E,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,QAAM,UAAU,sBAAsB,KAAK,GAAG;AAC9C,MAAI,QAAS,QAAO,OAAO,QAAQ,CAAC,CAAC;AACrC,QAAM,WAAW,OAAO,GAAG;AAC3B,SAAO,OAAO,SAAS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../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../src/TagLabel.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\n/**\n * Yoga has no inline formatting context, so RN's ViewStyle.display only\n * accepts \"flex\" | \"none\". Every inline-ish web value collapses to a plain\n * flex container — the box already fills only its content on native, which is\n * what those callers wanted on web anyway. Returning undefined (rather than\n * \"flex\") leaves RN's own default in place.\n */\nconst toNativeDisplay = (\n display: BoxProps[\"display\"]\n): ViewStyle[\"display\"] => (display === \"none\" ? \"none\" : undefined);\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n display,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n display: toNativeDisplay(display),\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","import React, { type ReactNode } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } from \"@xsolla/xui-core\";\nimport { User, Settings, Info, X } from \"@xsolla/xui-icons\";\nimport {\n RarityCommon,\n RarityUncommon,\n RarityRare,\n RarityEpic,\n RarityLegendary,\n} from \"@xsolla/xui-icons-tag-label\";\n\n// --- Types ---\n\nexport type EntityType = \"item\" | \"product\" | \"account\";\n\nexport type StatusType = \"sale\" | \"maintenance\" | \"inactive\";\n\n/**\n * Rarity tiers, in the order of the Figma `.tag-label-rarity` component set.\n * Each tier maps to a `tag-label/rarity/*` colour token and a rarity icon.\n */\nexport type RarityType = \"common\" | \"uncommon\" | \"rare\" | \"epic\" | \"legendary\";\n\nexport const RARITY_TYPES: readonly RarityType[] = [\n \"common\",\n \"uncommon\",\n \"rare\",\n \"epic\",\n \"legendary\",\n];\n\nexport type SubentityType =\n | \"skin\"\n | \"in-game-item\"\n | \"currency\"\n | \"bundle\"\n | \"lootbox\"\n | \"game-key\"\n | \"discount\"\n | \"coupon\"\n | \"game\"\n | \"sdk\"\n | \"plugin\"\n | \"api\"\n | \"service\"\n | \"tool\"\n | \"webshop\"\n | \"app\"\n | \"launcher\"\n | \"library\"\n | \"engine\"\n | \"user\"\n | \"developer\"\n | \"influencer\"\n | \"publisher\"\n | \"settings\";\n\nexport interface TagLabelProps extends ThemeOverrideProps {\n /** Main entity type */\n entityType?: EntityType;\n /** Detailed sub-category */\n subentityType?: SubentityType;\n /**\n * Custom icon for the entity module.\n *\n * @deprecated Use {@link TagLabelProps.entityIcon} instead. `icon` is kept as\n * an alias for backwards compatibility and will be removed in a future major.\n */\n icon?: ReactNode;\n /**\n * Show the icon of the entity module.\n *\n * @default true\n */\n showEntityIcon?: boolean;\n /**\n * Show the text label of the entity module. Defaults to `!compact`, so\n * `compact` only seeds the default — an explicit value always wins.\n *\n * @default !compact\n */\n showEntityLabel?: boolean;\n /** Custom icon override for the entity module. Takes precedence over `icon`. */\n entityIcon?: ReactNode;\n /**\n * Show the icon of the subentity module.\n *\n * @default true\n */\n showSubentityIcon?: boolean;\n /**\n * Show the text label of the subentity module. Defaults to `!compact`, so\n * `compact` only seeds the default — an explicit value always wins.\n *\n * @default !compact\n */\n showSubentityLabel?: boolean;\n /** Custom icon override for the subentity module. */\n subentityIcon?: ReactNode;\n /** ID series (e.g. \"XLA\") */\n series?: string;\n /** ID number (e.g. \"-001-001\") */\n number?: string;\n /** Item label/name */\n label?: string;\n /**\n * Rarity tier. Pass a {@link RarityType} (`\"common\"` … `\"legendary\"`) to\n * render the tier's background colour and icon from the design tokens.\n *\n * A custom `ReactNode` is still accepted for backwards compatibility; it is\n * rendered as the icon on the `common` background.\n */\n rarity?: RarityType | ReactNode;\n /** Custom icon override for the rarity module. */\n rarityIcon?: ReactNode;\n /** Status indicator */\n status?: StatusType;\n /** Whether to show the compact version */\n compact?: boolean;\n /** Custom content slot */\n children?: ReactNode;\n /** Custom styles */\n style?: any;\n testID?: string;\n}\n\n// --- Internal Segments ---\n\nconst SEGMENT_HEIGHT = 24;\n\ninterface ModuleColors {\n bg?: string;\n text?: string;\n textCompact?: string;\n}\n\ntype RarityColors = Partial<Record<RarityType | \"content\", string>>;\n\nconst RARITY_ICONS: Record<RarityType, React.ComponentType<any>> = {\n common: RarityCommon,\n uncommon: RarityUncommon,\n rare: RarityRare,\n epic: RarityEpic,\n legendary: RarityLegendary,\n};\n\nexport const isRarityType = (value: unknown): value is RarityType =>\n typeof value === \"string\" &&\n (RARITY_TYPES as readonly string[]).includes(value);\n\n/**\n * Shared chip renderer for the entity and subentity modules.\n *\n * Rendering rules (see XUITSD-101):\n * - icon + label -> full chip: tinted background, icon, text.\n * - icon only -> 24x24 square, no chip background (the legacy compact\n * entity rendering).\n * - label only -> full chip minus the icon; background, padding and\n * typography are unchanged.\n * - neither -> nothing is rendered at all.\n */\nconst TagLabelModuleChip: React.FC<{\n showIcon: boolean;\n showLabel: boolean;\n icon: ReactNode;\n label: string;\n colors: ModuleColors;\n}> = ({ showIcon, showLabel, icon, label, colors }) => {\n if (!showIcon && !showLabel) return null;\n\n if (showIcon && !showLabel) {\n return (\n <Box\n height={SEGMENT_HEIGHT}\n width={SEGMENT_HEIGHT}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Icon size={16} color={colors.textCompact || colors.text}>\n {icon}\n </Icon>\n </Box>\n );\n }\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingLeft={2}\n paddingRight={4}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={2}\n >\n {showIcon && (\n <Icon size={20} color={colors.text}>\n {icon}\n </Icon>\n )}\n <Text\n color={colors.text}\n fontSize={14}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n >\n {label}\n </Text>\n </Box>\n );\n};\n\nconst TagLabelEntitySegment: React.FC<{\n type: EntityType;\n showIcon: boolean;\n showLabel: boolean;\n icon?: ReactNode;\n theme: any;\n}> = ({ type, showIcon, showLabel, icon, theme }) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors: ModuleColors | undefined = tagLabel?.[type];\n\n if (!colors) return null;\n\n // Generic icon placeholders for now based on Figma intent\n const renderIcon = () => {\n if (icon) return icon;\n switch (type) {\n case \"item\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Cube placeholder\n case \"product\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Chip placeholder\n case \"account\":\n return <User size=\"100%\" />;\n }\n };\n\n return (\n <TagLabelModuleChip\n showIcon={showIcon}\n showLabel={showLabel}\n icon={renderIcon()}\n label={type.charAt(0).toUpperCase() + type.slice(1)}\n colors={colors}\n />\n );\n};\n\nconst TagLabelSubentitySegment: React.FC<{\n type: SubentityType;\n showIcon: boolean;\n showLabel: boolean;\n icon?: ReactNode;\n theme: any;\n}> = ({ type, showIcon, showLabel, icon, theme }) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors: ModuleColors | undefined = tagLabel?.subentity;\n\n if (!colors || !type || typeof type !== \"string\") return null;\n\n // Icon mapping based on Figma\n const renderIcon = () => {\n if (icon) return icon;\n switch (type) {\n case \"skin\":\n case \"in-game-item\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Pencil placeholder\n case \"game\":\n return (\n <Box\n style={{ width: 12, height: 12, backgroundColor: colors.text }}\n />\n ); // Controller placeholder\n case \"user\":\n return <User size=\"100%\" />;\n case \"settings\":\n return <Settings size=\"100%\" />;\n // ... more icons as needed\n default:\n return <Info size=\"100%\" />;\n }\n };\n\n const label = type\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n\n return (\n <TagLabelModuleChip\n showIcon={showIcon}\n showLabel={showLabel}\n icon={renderIcon()}\n label={label}\n colors={colors}\n />\n );\n};\n\nconst TagLabelIdSegment: React.FC<{\n series?: string;\n number?: string;\n compact?: boolean;\n theme: any;\n}> = ({ series, number, compact, theme }) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors = tagLabel?.id;\n\n if (!colors) return null;\n\n if (compact) {\n return (\n <Box\n height={SEGMENT_HEIGHT}\n paddingLeft={4}\n paddingRight={6}\n flexDirection=\"row\"\n alignItems=\"center\"\n >\n {series && (\n <Text color={colors.textCompact} fontSize={14} fontWeight=\"400\">\n {series}\n </Text>\n )}\n {number && (\n <Text color={colors.textCompact} fontSize={14} fontWeight=\"400\">\n {number}\n </Text>\n )}\n </Box>\n );\n }\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingLeft={4}\n paddingRight={6}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={2}\n >\n {series && (\n <Box\n backgroundColor={colors.bgSeries}\n height={16}\n paddingHorizontal={2}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Text color={colors.textSeries} fontSize={14} fontWeight=\"500\">\n {series}\n </Text>\n </Box>\n )}\n {number && (\n <Text color={colors.textNumber} fontSize={14} fontWeight=\"500\">\n {number}\n </Text>\n )}\n </Box>\n );\n};\n\nconst TagLabelNameSegment: React.FC<{ label: string; theme: any }> = ({\n label,\n theme,\n}) => {\n const tagLabel = theme?.colors?.control?.tagLabel;\n const colors = tagLabel?.name;\n\n if (!colors) return null;\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={colors.bg}\n paddingHorizontal={4}\n justifyContent=\"center\"\n >\n <Text\n color={colors.text}\n fontSize={14}\n fontWeight=\"400\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {label}\n </Text>\n </Box>\n );\n};\n\n/**\n * Rarity module — mirrors the Figma `.tag-label-rarity` component set: a\n * 24×24 chip whose background is the tier's `tag-label/rarity/<tier>` token,\n * with the tier's 18px icon drawn in the `tag-label/rarity/content` colour.\n */\nconst TagLabelRaritySegment: React.FC<{\n rarity: RarityType | ReactNode;\n icon?: ReactNode;\n theme: any;\n}> = ({ rarity, icon, theme }) => {\n const colors: RarityColors | undefined =\n theme?.colors?.control?.tagLabel?.rarity;\n\n if (!colors) return null;\n\n const tier: RarityType = isRarityType(rarity) ? rarity : \"common\";\n const TierIcon = RARITY_ICONS[tier];\n const content = colors.content;\n\n // A legacy ReactNode `rarity` is treated as a custom icon.\n const customIcon = icon ?? (isRarityType(rarity) ? undefined : rarity);\n\n return (\n <Box\n testID={`tag-label__rarity-${tier}`}\n height={SEGMENT_HEIGHT}\n width={SEGMENT_HEIGHT}\n backgroundColor={colors[tier]}\n paddingHorizontal={3}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {customIcon ? (\n <Icon size={18} color={content}>\n {customIcon}\n </Icon>\n ) : (\n <TierIcon size={18} color={content} />\n )}\n </Box>\n );\n};\n\nconst TagLabelStatusSegment: React.FC<{ type: StatusType; theme: any }> = ({\n type,\n theme,\n}) => {\n let bg;\n let icon;\n\n if (!theme?.colors?.background) return null;\n\n switch (type) {\n case \"sale\":\n bg = theme.colors.background.warning?.primary;\n icon = <Info size=\"100%\" />; // Info placeholder\n break;\n case \"maintenance\":\n bg = theme.colors.background.success?.primary;\n icon = <Settings size=\"100%\" />;\n break;\n case \"inactive\":\n bg = theme.colors.background.alert?.primary;\n icon = <X size=\"100%\" />;\n break;\n }\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n width={SEGMENT_HEIGHT}\n backgroundColor={bg}\n paddingHorizontal={2}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Icon size={20} color=\"black\">\n {icon}\n </Icon>\n </Box>\n );\n};\n\nconst TagLabelCustomSlot: React.FC<{ children: ReactNode; theme: any }> = ({\n children,\n theme,\n}) => {\n if (!theme?.colors?.background) return null;\n\n return (\n <Box\n height={SEGMENT_HEIGHT}\n backgroundColor={theme.colors.background.secondary}\n paddingHorizontal={6}\n justifyContent=\"center\"\n >\n {typeof children === \"string\" ? (\n <Text\n color={theme?.colors?.content?.primary}\n fontSize={14}\n fontWeight=\"500\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Box>\n );\n};\n\n// --- Main Component ---\n\n/**\n * Segments render in the Figma `TagLabel` order:\n * entity → subentity → rarity → ID → name → status → custom slot.\n */\nexport const TagLabel: React.FC<TagLabelProps> = ({\n entityType,\n subentityType,\n icon,\n entityIcon,\n showEntityIcon = true,\n showEntityLabel,\n subentityIcon,\n showSubentityIcon = true,\n showSubentityLabel,\n series,\n number,\n label,\n rarity,\n rarityIcon,\n status,\n compact = false,\n children,\n style,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n // `compact` only seeds the DEFAULT for the label flags — an explicit\n // show*Label always wins over it.\n const entityLabelVisible = showEntityLabel ?? !compact;\n const subentityLabelVisible = showSubentityLabel ?? !compact;\n\n // `entityIcon` is the canonical prop; `icon` is the deprecated alias.\n const resolvedEntityIcon = entityIcon ?? icon;\n\n const renderEntity =\n Boolean(entityType) && (showEntityIcon || entityLabelVisible);\n const renderSubentity =\n Boolean(subentityType) && (showSubentityIcon || subentityLabelVisible);\n\n return (\n <Box\n testID={testID}\n flexDirection=\"row\"\n alignItems=\"center\"\n style={{\n overflow: \"hidden\",\n borderRadius: theme.shape.tagLabel.borderRadius,\n ...style,\n }}\n >\n {renderEntity && (\n <TagLabelEntitySegment\n type={entityType as EntityType}\n showIcon={showEntityIcon}\n showLabel={entityLabelVisible}\n icon={resolvedEntityIcon}\n theme={theme}\n />\n )}\n\n {renderSubentity && (\n <TagLabelSubentitySegment\n type={subentityType as SubentityType}\n showIcon={showSubentityIcon}\n showLabel={subentityLabelVisible}\n icon={subentityIcon}\n theme={theme}\n />\n )}\n\n {!compact && rarity && (\n <TagLabelRaritySegment\n rarity={rarity}\n icon={rarityIcon}\n theme={theme}\n />\n )}\n\n {(series || number) && (\n <TagLabelIdSegment\n series={series}\n number={number}\n compact={compact}\n theme={theme}\n />\n )}\n\n {!compact && label && <TagLabelNameSegment label={label} theme={theme} />}\n\n {!compact && status && (\n <TagLabelStatusSegment type={status} theme={theme} />\n )}\n\n {!compact && children && (\n <TagLabelCustomSlot theme={theme}>{children}</TagLabelCustomSlot>\n )}\n </Box>\n );\n};\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAqND;AAlNN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAG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AAA,MACL;AAAA,MAEC;AAAA,wBACC,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN,UAAU;AAAA,YACV,WAAW;AAAA,YACX,MAAM;AAAA,YACN;AAAA;AAAA,QACF;AAAA,QAGD,mBACC,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN,UAAU;AAAA,YACV,WAAW;AAAA,YACX,MAAM;AAAA,YACN;AAAA;AAAA,QACF;AAAA,QAGD,CAAC,WAAW,UACX,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,MAAM;AAAA,YACN;AAAA;AAAA,QACF;AAAA,SAGA,UAAU,WACV,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QAGD,CAAC,WAAW,SAAS,gBAAAA,KAAC,uBAAoB,OAAc,OAAc;AAAA,QAEtE,CAAC,WAAW,UACX,gBAAAA,KAAC,yBAAsB,MAAM,QAAQ,OAAc;AAAA,QAGpD,CAAC,WAAW,YACX,gBAAAA,KAAC,sBAAmB,OAAe,UAAS;AAAA;AAAA;AAAA,EAEhD;AAEJ;","names":["jsx","View","jsx","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-tag-label",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.229.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-core": "0.
|
|
14
|
-
"@xsolla/xui-icons": "0.
|
|
15
|
-
"@xsolla/xui-
|
|
13
|
+
"@xsolla/xui-core": "0.229.0",
|
|
14
|
+
"@xsolla/xui-icons": "0.229.0",
|
|
15
|
+
"@xsolla/xui-icons-tag-label": "0.229.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.229.0"
|
|
16
17
|
},
|
|
17
18
|
"peerDependencies": {
|
|
18
19
|
"react": ">=16.8.0",
|
package/web/index.d.mts
CHANGED
|
@@ -3,6 +3,12 @@ import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
|
3
3
|
|
|
4
4
|
type EntityType = "item" | "product" | "account";
|
|
5
5
|
type StatusType = "sale" | "maintenance" | "inactive";
|
|
6
|
+
/**
|
|
7
|
+
* Rarity tiers, in the order of the Figma `.tag-label-rarity` component set.
|
|
8
|
+
* Each tier maps to a `tag-label/rarity/*` colour token and a rarity icon.
|
|
9
|
+
*/
|
|
10
|
+
type RarityType = "common" | "uncommon" | "rare" | "epic" | "legendary";
|
|
11
|
+
declare const RARITY_TYPES: readonly RarityType[];
|
|
6
12
|
type SubentityType = "skin" | "in-game-item" | "currency" | "bundle" | "lootbox" | "game-key" | "discount" | "coupon" | "game" | "sdk" | "plugin" | "api" | "service" | "tool" | "webshop" | "app" | "launcher" | "library" | "engine" | "user" | "developer" | "influencer" | "publisher" | "settings";
|
|
7
13
|
interface TagLabelProps extends ThemeOverrideProps {
|
|
8
14
|
/** Main entity type */
|
|
@@ -52,8 +58,16 @@ interface TagLabelProps extends ThemeOverrideProps {
|
|
|
52
58
|
number?: string;
|
|
53
59
|
/** Item label/name */
|
|
54
60
|
label?: string;
|
|
55
|
-
/**
|
|
56
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Rarity tier. Pass a {@link RarityType} (`"common"` … `"legendary"`) to
|
|
63
|
+
* render the tier's background colour and icon from the design tokens.
|
|
64
|
+
*
|
|
65
|
+
* A custom `ReactNode` is still accepted for backwards compatibility; it is
|
|
66
|
+
* rendered as the icon on the `common` background.
|
|
67
|
+
*/
|
|
68
|
+
rarity?: RarityType | ReactNode;
|
|
69
|
+
/** Custom icon override for the rarity module. */
|
|
70
|
+
rarityIcon?: ReactNode;
|
|
57
71
|
/** Status indicator */
|
|
58
72
|
status?: StatusType;
|
|
59
73
|
/** Whether to show the compact version */
|
|
@@ -64,6 +78,11 @@ interface TagLabelProps extends ThemeOverrideProps {
|
|
|
64
78
|
style?: any;
|
|
65
79
|
testID?: string;
|
|
66
80
|
}
|
|
81
|
+
declare const isRarityType: (value: unknown) => value is RarityType;
|
|
82
|
+
/**
|
|
83
|
+
* Segments render in the Figma `TagLabel` order:
|
|
84
|
+
* entity → subentity → rarity → ID → name → status → custom slot.
|
|
85
|
+
*/
|
|
67
86
|
declare const TagLabel: React.FC<TagLabelProps>;
|
|
68
87
|
|
|
69
|
-
export { type EntityType, type StatusType, type SubentityType, TagLabel, type TagLabelProps };
|
|
88
|
+
export { type EntityType, RARITY_TYPES, type RarityType, type StatusType, type SubentityType, TagLabel, type TagLabelProps, isRarityType };
|
package/web/index.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
|
3
3
|
|
|
4
4
|
type EntityType = "item" | "product" | "account";
|
|
5
5
|
type StatusType = "sale" | "maintenance" | "inactive";
|
|
6
|
+
/**
|
|
7
|
+
* Rarity tiers, in the order of the Figma `.tag-label-rarity` component set.
|
|
8
|
+
* Each tier maps to a `tag-label/rarity/*` colour token and a rarity icon.
|
|
9
|
+
*/
|
|
10
|
+
type RarityType = "common" | "uncommon" | "rare" | "epic" | "legendary";
|
|
11
|
+
declare const RARITY_TYPES: readonly RarityType[];
|
|
6
12
|
type SubentityType = "skin" | "in-game-item" | "currency" | "bundle" | "lootbox" | "game-key" | "discount" | "coupon" | "game" | "sdk" | "plugin" | "api" | "service" | "tool" | "webshop" | "app" | "launcher" | "library" | "engine" | "user" | "developer" | "influencer" | "publisher" | "settings";
|
|
7
13
|
interface TagLabelProps extends ThemeOverrideProps {
|
|
8
14
|
/** Main entity type */
|
|
@@ -52,8 +58,16 @@ interface TagLabelProps extends ThemeOverrideProps {
|
|
|
52
58
|
number?: string;
|
|
53
59
|
/** Item label/name */
|
|
54
60
|
label?: string;
|
|
55
|
-
/**
|
|
56
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Rarity tier. Pass a {@link RarityType} (`"common"` … `"legendary"`) to
|
|
63
|
+
* render the tier's background colour and icon from the design tokens.
|
|
64
|
+
*
|
|
65
|
+
* A custom `ReactNode` is still accepted for backwards compatibility; it is
|
|
66
|
+
* rendered as the icon on the `common` background.
|
|
67
|
+
*/
|
|
68
|
+
rarity?: RarityType | ReactNode;
|
|
69
|
+
/** Custom icon override for the rarity module. */
|
|
70
|
+
rarityIcon?: ReactNode;
|
|
57
71
|
/** Status indicator */
|
|
58
72
|
status?: StatusType;
|
|
59
73
|
/** Whether to show the compact version */
|
|
@@ -64,6 +78,11 @@ interface TagLabelProps extends ThemeOverrideProps {
|
|
|
64
78
|
style?: any;
|
|
65
79
|
testID?: string;
|
|
66
80
|
}
|
|
81
|
+
declare const isRarityType: (value: unknown) => value is RarityType;
|
|
82
|
+
/**
|
|
83
|
+
* Segments render in the Figma `TagLabel` order:
|
|
84
|
+
* entity → subentity → rarity → ID → name → status → custom slot.
|
|
85
|
+
*/
|
|
67
86
|
declare const TagLabel: React.FC<TagLabelProps>;
|
|
68
87
|
|
|
69
|
-
export { type EntityType, type StatusType, type SubentityType, TagLabel, type TagLabelProps };
|
|
88
|
+
export { type EntityType, RARITY_TYPES, type RarityType, type StatusType, type SubentityType, TagLabel, type TagLabelProps, isRarityType };
|
package/web/index.js
CHANGED
|
@@ -30,7 +30,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.tsx
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
|
|
33
|
+
RARITY_TYPES: () => RARITY_TYPES,
|
|
34
|
+
TagLabel: () => TagLabel,
|
|
35
|
+
isRarityType: () => isRarityType
|
|
34
36
|
});
|
|
35
37
|
module.exports = __toCommonJS(index_exports);
|
|
36
38
|
|
|
@@ -402,8 +404,24 @@ var Icon = ({
|
|
|
402
404
|
// src/TagLabel.tsx
|
|
403
405
|
var import_xui_core = require("@xsolla/xui-core");
|
|
404
406
|
var import_xui_icons = require("@xsolla/xui-icons");
|
|
407
|
+
var import_xui_icons_tag_label = require("@xsolla/xui-icons-tag-label");
|
|
405
408
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
409
|
+
var RARITY_TYPES = [
|
|
410
|
+
"common",
|
|
411
|
+
"uncommon",
|
|
412
|
+
"rare",
|
|
413
|
+
"epic",
|
|
414
|
+
"legendary"
|
|
415
|
+
];
|
|
406
416
|
var SEGMENT_HEIGHT = 24;
|
|
417
|
+
var RARITY_ICONS = {
|
|
418
|
+
common: import_xui_icons_tag_label.RarityCommon,
|
|
419
|
+
uncommon: import_xui_icons_tag_label.RarityUncommon,
|
|
420
|
+
rare: import_xui_icons_tag_label.RarityRare,
|
|
421
|
+
epic: import_xui_icons_tag_label.RarityEpic,
|
|
422
|
+
legendary: import_xui_icons_tag_label.RarityLegendary
|
|
423
|
+
};
|
|
424
|
+
var isRarityType = (value) => typeof value === "string" && RARITY_TYPES.includes(value);
|
|
407
425
|
var TagLabelModuleChip = ({ showIcon, showLabel, icon, label, colors }) => {
|
|
408
426
|
if (!showIcon && !showLabel) return null;
|
|
409
427
|
if (showIcon && !showLabel) {
|
|
@@ -605,23 +623,24 @@ var TagLabelNameSegment = ({
|
|
|
605
623
|
}
|
|
606
624
|
);
|
|
607
625
|
};
|
|
608
|
-
var TagLabelRaritySegment = ({
|
|
609
|
-
rarity
|
|
610
|
-
theme
|
|
611
|
-
}) => {
|
|
612
|
-
const tagLabel = theme?.colors?.control?.tagLabel;
|
|
613
|
-
const colors = tagLabel?.rarity;
|
|
626
|
+
var TagLabelRaritySegment = ({ rarity, icon, theme }) => {
|
|
627
|
+
const colors = theme?.colors?.control?.tagLabel?.rarity;
|
|
614
628
|
if (!colors) return null;
|
|
629
|
+
const tier = isRarityType(rarity) ? rarity : "common";
|
|
630
|
+
const TierIcon = RARITY_ICONS[tier];
|
|
631
|
+
const content = colors.content;
|
|
632
|
+
const customIcon = icon ?? (isRarityType(rarity) ? void 0 : rarity);
|
|
615
633
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
616
634
|
Box,
|
|
617
635
|
{
|
|
636
|
+
testID: `tag-label__rarity-${tier}`,
|
|
618
637
|
height: SEGMENT_HEIGHT,
|
|
619
638
|
width: SEGMENT_HEIGHT,
|
|
620
|
-
backgroundColor: colors
|
|
621
|
-
paddingHorizontal:
|
|
639
|
+
backgroundColor: colors[tier],
|
|
640
|
+
paddingHorizontal: 3,
|
|
622
641
|
alignItems: "center",
|
|
623
642
|
justifyContent: "center",
|
|
624
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: 18, color:
|
|
643
|
+
children: customIcon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: 18, color: content, children: customIcon }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TierIcon, { size: 18, color: content })
|
|
625
644
|
}
|
|
626
645
|
);
|
|
627
646
|
};
|
|
@@ -697,6 +716,7 @@ var TagLabel = ({
|
|
|
697
716
|
number,
|
|
698
717
|
label,
|
|
699
718
|
rarity,
|
|
719
|
+
rarityIcon,
|
|
700
720
|
status,
|
|
701
721
|
compact = false,
|
|
702
722
|
children,
|
|
@@ -743,6 +763,14 @@ var TagLabel = ({
|
|
|
743
763
|
theme
|
|
744
764
|
}
|
|
745
765
|
),
|
|
766
|
+
!compact && rarity && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
767
|
+
TagLabelRaritySegment,
|
|
768
|
+
{
|
|
769
|
+
rarity,
|
|
770
|
+
icon: rarityIcon,
|
|
771
|
+
theme
|
|
772
|
+
}
|
|
773
|
+
),
|
|
746
774
|
(series || number) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
747
775
|
TagLabelIdSegment,
|
|
748
776
|
{
|
|
@@ -753,7 +781,6 @@ var TagLabel = ({
|
|
|
753
781
|
}
|
|
754
782
|
),
|
|
755
783
|
!compact && label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TagLabelNameSegment, { label, theme }),
|
|
756
|
-
!compact && rarity && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TagLabelRaritySegment, { rarity, theme }),
|
|
757
784
|
!compact && status && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TagLabelStatusSegment, { type: status, theme }),
|
|
758
785
|
!compact && children && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TagLabelCustomSlot, { theme, children })
|
|
759
786
|
]
|
|
@@ -762,6 +789,8 @@ var TagLabel = ({
|
|
|
762
789
|
};
|
|
763
790
|
// Annotate the CommonJS export names for ESM import in node:
|
|
764
791
|
0 && (module.exports = {
|
|
765
|
-
|
|
792
|
+
RARITY_TYPES,
|
|
793
|
+
TagLabel,
|
|
794
|
+
isRarityType
|
|
766
795
|
});
|
|
767
796
|
//# sourceMappingURL=index.js.map
|