@xsolla/xui-tag 0.104.0 → 0.105.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/native/index.d.mts +3 -0
- package/native/index.d.ts +3 -0
- package/native/index.js +47 -11
- package/native/index.js.flow +3 -0
- package/native/index.js.map +1 -1
- package/native/index.mjs +47 -11
- package/native/index.mjs.map +1 -1
- package/package.json +4 -4
- package/web/index.d.mts +3 -0
- package/web/index.d.ts +3 -0
- package/web/index.js +47 -11
- package/web/index.js.flow +3 -0
- package/web/index.js.map +1 -1
- package/web/index.mjs +47 -11
- package/web/index.mjs.map +1 -1
package/native/index.d.mts
CHANGED
|
@@ -3,6 +3,9 @@ import React from 'react';
|
|
|
3
3
|
interface TagProps {
|
|
4
4
|
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
5
|
tone?: "primary" | "secondary" | "brand" | "brandExtra" | "success" | "warning" | "alert" | "neutral";
|
|
6
|
+
variant?: "default" | "selectable";
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
onPress?: () => void;
|
|
6
9
|
children: React.ReactNode;
|
|
7
10
|
icon?: React.ReactNode;
|
|
8
11
|
onRemove?: () => void;
|
package/native/index.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import React from 'react';
|
|
|
3
3
|
interface TagProps {
|
|
4
4
|
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
5
|
tone?: "primary" | "secondary" | "brand" | "brandExtra" | "success" | "warning" | "alert" | "neutral";
|
|
6
|
+
variant?: "default" | "selectable";
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
onPress?: () => void;
|
|
6
9
|
children: React.ReactNode;
|
|
7
10
|
icon?: React.ReactNode;
|
|
8
11
|
onRemove?: () => void;
|
package/native/index.js
CHANGED
|
@@ -263,9 +263,13 @@ var Icon = ({ children, color, size }) => {
|
|
|
263
263
|
var import_xui_core = require("@xsolla/xui-core");
|
|
264
264
|
var import_xui_icons = require("@xsolla/xui-icons");
|
|
265
265
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
266
|
+
var SELECTABLE_BORDER_RADIUS = 8;
|
|
266
267
|
var Tag = ({
|
|
267
268
|
size = "md",
|
|
268
269
|
tone = "primary",
|
|
270
|
+
variant = "default",
|
|
271
|
+
selected = false,
|
|
272
|
+
onPress,
|
|
269
273
|
children,
|
|
270
274
|
icon,
|
|
271
275
|
onRemove
|
|
@@ -273,66 +277,98 @@ var Tag = ({
|
|
|
273
277
|
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
274
278
|
const sizeStyles = theme.sizing.tag(size);
|
|
275
279
|
const resolveColors = () => {
|
|
280
|
+
if (variant === "selectable") {
|
|
281
|
+
if (selected) {
|
|
282
|
+
return {
|
|
283
|
+
bg: theme.colors.control.brand.secondary.bg,
|
|
284
|
+
text: theme.colors.content.brand.primary,
|
|
285
|
+
border: theme.colors.border.secondary
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
bg: theme.colors.overlay.mono,
|
|
290
|
+
text: theme.colors.content.primary,
|
|
291
|
+
border: theme.colors.border.secondary
|
|
292
|
+
};
|
|
293
|
+
}
|
|
276
294
|
switch (tone) {
|
|
277
295
|
case "primary":
|
|
278
296
|
return {
|
|
279
297
|
bg: theme.colors.background.primary,
|
|
280
|
-
text: theme.colors.content.primary
|
|
298
|
+
text: theme.colors.content.primary,
|
|
299
|
+
border: void 0
|
|
281
300
|
};
|
|
282
301
|
case "secondary":
|
|
283
302
|
return {
|
|
284
303
|
bg: theme.colors.background.secondary,
|
|
285
|
-
text: theme.colors.content.primary
|
|
304
|
+
text: theme.colors.content.primary,
|
|
305
|
+
border: void 0
|
|
286
306
|
};
|
|
287
307
|
case "brand":
|
|
288
308
|
return {
|
|
289
309
|
bg: theme.colors.background.brand.primary,
|
|
290
|
-
text: theme.colors.content.on.brand
|
|
310
|
+
text: theme.colors.content.on.brand,
|
|
311
|
+
border: void 0
|
|
291
312
|
};
|
|
292
313
|
case "brandExtra":
|
|
293
314
|
return {
|
|
294
315
|
bg: theme.colors.background.brandExtra.primary,
|
|
295
|
-
text: theme.colors.content.on.brandExtra
|
|
316
|
+
text: theme.colors.content.on.brandExtra,
|
|
317
|
+
border: void 0
|
|
296
318
|
};
|
|
297
319
|
case "success":
|
|
298
320
|
return {
|
|
299
321
|
bg: theme.colors.background.success.primary,
|
|
300
|
-
text: theme.colors.content.on.success
|
|
322
|
+
text: theme.colors.content.on.success,
|
|
323
|
+
border: void 0
|
|
301
324
|
};
|
|
302
325
|
case "warning":
|
|
303
326
|
return {
|
|
304
327
|
bg: theme.colors.background.warning.primary,
|
|
305
|
-
text: theme.colors.content.on.warning
|
|
328
|
+
text: theme.colors.content.on.warning,
|
|
329
|
+
border: void 0
|
|
306
330
|
};
|
|
307
331
|
case "alert":
|
|
308
332
|
return {
|
|
309
333
|
bg: theme.colors.background.alert.primary,
|
|
310
|
-
text: theme.colors.content.on.alert
|
|
334
|
+
text: theme.colors.content.on.alert,
|
|
335
|
+
border: void 0
|
|
311
336
|
};
|
|
312
337
|
case "neutral":
|
|
313
338
|
return {
|
|
314
339
|
bg: theme.colors.background.neutral.primary,
|
|
315
|
-
text: theme.colors.content.on.neutral
|
|
340
|
+
text: theme.colors.content.on.neutral,
|
|
341
|
+
border: void 0
|
|
316
342
|
};
|
|
317
343
|
default:
|
|
318
344
|
return {
|
|
319
345
|
bg: theme.colors.background.primary,
|
|
320
|
-
text: theme.colors.content.primary
|
|
346
|
+
text: theme.colors.content.primary,
|
|
347
|
+
border: void 0
|
|
321
348
|
};
|
|
322
349
|
}
|
|
323
350
|
};
|
|
324
|
-
const { bg, text } = resolveColors();
|
|
351
|
+
const { bg, text, border } = resolveColors();
|
|
352
|
+
const isSelectable = variant === "selectable";
|
|
353
|
+
const borderRadius = isSelectable ? SELECTABLE_BORDER_RADIUS : sizeStyles.radius;
|
|
325
354
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
326
355
|
Box,
|
|
327
356
|
{
|
|
357
|
+
as: isSelectable ? "button" : void 0,
|
|
358
|
+
onPress: isSelectable ? onPress : void 0,
|
|
328
359
|
backgroundColor: bg,
|
|
329
|
-
borderRadius
|
|
360
|
+
borderRadius,
|
|
330
361
|
height: sizeStyles.height,
|
|
331
362
|
paddingHorizontal: sizeStyles.padding,
|
|
332
363
|
flexDirection: "row",
|
|
333
364
|
alignItems: "center",
|
|
334
365
|
justifyContent: "center",
|
|
335
366
|
gap: sizeStyles.gap,
|
|
367
|
+
borderWidth: isSelectable ? 1 : 0,
|
|
368
|
+
borderColor: border,
|
|
369
|
+
borderStyle: isSelectable ? "solid" : void 0,
|
|
370
|
+
cursor: isSelectable ? "pointer" : void 0,
|
|
371
|
+
hoverStyle: isSelectable && !selected ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover } : void 0,
|
|
336
372
|
style: {
|
|
337
373
|
overflow: "hidden",
|
|
338
374
|
textOverflow: "ellipsis",
|
package/native/index.js.flow
CHANGED
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["export * from \"./Tag\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 flexDirection,\n alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, fall back to the system font\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\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> = ({ children, color, size }) => {\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 <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n }\n };\n\n const { bg, text } = resolveColors();\n\n return (\n <Box\n backgroundColor={bg}\n borderRadius={sizeStyles.radius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA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AAA,MACC,iBAAiB;AAAA,MACjB,cAAc,WAAW;AAAA,MACzB,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,eAAc;AAAA,MACd,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,KAAK,WAAW;AAAA,MAChB,OAAO;AAAA,QACL,UAAU;AAAA,QACV,cAAc;AAAA,QACd,YAAY;AAAA,MACd;AAAA,MAEC;AAAA,gBACC,6CAAC,QAAK,MAAM,WAAW,UAAU,OAAO,MACrC,gBACH;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,WAAW;AAAA,YACrB,YAAW;AAAA,YACX,YAAW;AAAA,YACX,OAAO;AAAA,cACL,UAAU;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,YACC,6CAAC,OAAI,SAAS,UACZ,uDAAC,sBAAE,MAAM,WAAW,UAAU,OAAO,MAAM,GAC7C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","React","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["export * from \"./Tag\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 flexDirection,\n alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, fall back to the system font\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\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> = ({ children, color, size }) => {\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 <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n variant?: \"default\" | \"selectable\";\n selected?: boolean;\n onPress?: () => void;\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nconst SELECTABLE_BORDER_RADIUS = 8;\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n variant = \"default\",\n selected = false,\n onPress,\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n if (variant === \"selectable\") {\n if (selected) {\n return {\n bg: theme.colors.control.brand.secondary.bg,\n text: theme.colors.content.brand.primary,\n border: theme.colors.border.secondary,\n };\n }\n return {\n bg: theme.colors.overlay.mono,\n text: theme.colors.content.primary,\n border: theme.colors.border.secondary,\n };\n }\n\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n border: undefined,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n border: undefined,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n border: undefined,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n border: undefined,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n border: undefined,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n border: undefined,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n }\n };\n\n const { bg, text, border } = resolveColors();\n const isSelectable = variant === \"selectable\";\n const borderRadius = isSelectable\n ? SELECTABLE_BORDER_RADIUS\n : sizeStyles.radius;\n\n return (\n <Box\n as={isSelectable ? \"button\" : undefined}\n onPress={isSelectable ? onPress : undefined}\n backgroundColor={bg}\n borderRadius={borderRadius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n borderWidth={isSelectable ? 1 : 0}\n borderColor={border}\n borderStyle={isSelectable ? \"solid\" : undefined}\n cursor={isSelectable ? \"pointer\" : undefined}\n hoverStyle={\n isSelectable && !selected\n ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover }\n : undefined\n }\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,0BAQO;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,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,IACJ;AAAA,EACF;AAEA,QAAM,EAAE,IAAI,MAAM,OAAO,IAAI,cAAc;AAC3C,QAAM,eAAe,YAAY;AACjC,QAAM,eAAe,eACjB,2BACA,WAAW;AAEf,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,eAAe,WAAW;AAAA,MAC9B,SAAS,eAAe,UAAU;AAAA,MAClC,iBAAiB;AAAA,MACjB;AAAA,MACA,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,eAAc;AAAA,MACd,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,KAAK,WAAW;AAAA,MAChB,aAAa,eAAe,IAAI;AAAA,MAChC,aAAa;AAAA,MACb,aAAa,eAAe,UAAU;AAAA,MACtC,QAAQ,eAAe,YAAY;AAAA,MACnC,YACE,gBAAgB,CAAC,WACb,EAAE,iBAAiB,MAAM,OAAO,QAAQ,MAAM,SAAS,QAAQ,IAC/D;AAAA,MAEN,OAAO;AAAA,QACL,UAAU;AAAA,QACV,cAAc;AAAA,QACd,YAAY;AAAA,MACd;AAAA,MAEC;AAAA,gBACC,6CAAC,QAAK,MAAM,WAAW,UAAU,OAAO,MACrC,gBACH;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,WAAW;AAAA,YACrB,YAAW;AAAA,YACX,YAAW;AAAA,YACX,OAAO;AAAA,cACL,UAAU;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,YACC,6CAAC,OAAI,SAAS,UACZ,uDAAC,sBAAE,MAAM,WAAW,UAAU,OAAO,MAAM,GAC7C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","React","import_jsx_runtime"]}
|
package/native/index.mjs
CHANGED
|
@@ -231,9 +231,13 @@ var Icon = ({ children, color, size }) => {
|
|
|
231
231
|
import { useDesignSystem } from "@xsolla/xui-core";
|
|
232
232
|
import { X } from "@xsolla/xui-icons";
|
|
233
233
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
234
|
+
var SELECTABLE_BORDER_RADIUS = 8;
|
|
234
235
|
var Tag = ({
|
|
235
236
|
size = "md",
|
|
236
237
|
tone = "primary",
|
|
238
|
+
variant = "default",
|
|
239
|
+
selected = false,
|
|
240
|
+
onPress,
|
|
237
241
|
children,
|
|
238
242
|
icon,
|
|
239
243
|
onRemove
|
|
@@ -241,66 +245,98 @@ var Tag = ({
|
|
|
241
245
|
const { theme } = useDesignSystem();
|
|
242
246
|
const sizeStyles = theme.sizing.tag(size);
|
|
243
247
|
const resolveColors = () => {
|
|
248
|
+
if (variant === "selectable") {
|
|
249
|
+
if (selected) {
|
|
250
|
+
return {
|
|
251
|
+
bg: theme.colors.control.brand.secondary.bg,
|
|
252
|
+
text: theme.colors.content.brand.primary,
|
|
253
|
+
border: theme.colors.border.secondary
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
bg: theme.colors.overlay.mono,
|
|
258
|
+
text: theme.colors.content.primary,
|
|
259
|
+
border: theme.colors.border.secondary
|
|
260
|
+
};
|
|
261
|
+
}
|
|
244
262
|
switch (tone) {
|
|
245
263
|
case "primary":
|
|
246
264
|
return {
|
|
247
265
|
bg: theme.colors.background.primary,
|
|
248
|
-
text: theme.colors.content.primary
|
|
266
|
+
text: theme.colors.content.primary,
|
|
267
|
+
border: void 0
|
|
249
268
|
};
|
|
250
269
|
case "secondary":
|
|
251
270
|
return {
|
|
252
271
|
bg: theme.colors.background.secondary,
|
|
253
|
-
text: theme.colors.content.primary
|
|
272
|
+
text: theme.colors.content.primary,
|
|
273
|
+
border: void 0
|
|
254
274
|
};
|
|
255
275
|
case "brand":
|
|
256
276
|
return {
|
|
257
277
|
bg: theme.colors.background.brand.primary,
|
|
258
|
-
text: theme.colors.content.on.brand
|
|
278
|
+
text: theme.colors.content.on.brand,
|
|
279
|
+
border: void 0
|
|
259
280
|
};
|
|
260
281
|
case "brandExtra":
|
|
261
282
|
return {
|
|
262
283
|
bg: theme.colors.background.brandExtra.primary,
|
|
263
|
-
text: theme.colors.content.on.brandExtra
|
|
284
|
+
text: theme.colors.content.on.brandExtra,
|
|
285
|
+
border: void 0
|
|
264
286
|
};
|
|
265
287
|
case "success":
|
|
266
288
|
return {
|
|
267
289
|
bg: theme.colors.background.success.primary,
|
|
268
|
-
text: theme.colors.content.on.success
|
|
290
|
+
text: theme.colors.content.on.success,
|
|
291
|
+
border: void 0
|
|
269
292
|
};
|
|
270
293
|
case "warning":
|
|
271
294
|
return {
|
|
272
295
|
bg: theme.colors.background.warning.primary,
|
|
273
|
-
text: theme.colors.content.on.warning
|
|
296
|
+
text: theme.colors.content.on.warning,
|
|
297
|
+
border: void 0
|
|
274
298
|
};
|
|
275
299
|
case "alert":
|
|
276
300
|
return {
|
|
277
301
|
bg: theme.colors.background.alert.primary,
|
|
278
|
-
text: theme.colors.content.on.alert
|
|
302
|
+
text: theme.colors.content.on.alert,
|
|
303
|
+
border: void 0
|
|
279
304
|
};
|
|
280
305
|
case "neutral":
|
|
281
306
|
return {
|
|
282
307
|
bg: theme.colors.background.neutral.primary,
|
|
283
|
-
text: theme.colors.content.on.neutral
|
|
308
|
+
text: theme.colors.content.on.neutral,
|
|
309
|
+
border: void 0
|
|
284
310
|
};
|
|
285
311
|
default:
|
|
286
312
|
return {
|
|
287
313
|
bg: theme.colors.background.primary,
|
|
288
|
-
text: theme.colors.content.primary
|
|
314
|
+
text: theme.colors.content.primary,
|
|
315
|
+
border: void 0
|
|
289
316
|
};
|
|
290
317
|
}
|
|
291
318
|
};
|
|
292
|
-
const { bg, text } = resolveColors();
|
|
319
|
+
const { bg, text, border } = resolveColors();
|
|
320
|
+
const isSelectable = variant === "selectable";
|
|
321
|
+
const borderRadius = isSelectable ? SELECTABLE_BORDER_RADIUS : sizeStyles.radius;
|
|
293
322
|
return /* @__PURE__ */ jsxs(
|
|
294
323
|
Box,
|
|
295
324
|
{
|
|
325
|
+
as: isSelectable ? "button" : void 0,
|
|
326
|
+
onPress: isSelectable ? onPress : void 0,
|
|
296
327
|
backgroundColor: bg,
|
|
297
|
-
borderRadius
|
|
328
|
+
borderRadius,
|
|
298
329
|
height: sizeStyles.height,
|
|
299
330
|
paddingHorizontal: sizeStyles.padding,
|
|
300
331
|
flexDirection: "row",
|
|
301
332
|
alignItems: "center",
|
|
302
333
|
justifyContent: "center",
|
|
303
334
|
gap: sizeStyles.gap,
|
|
335
|
+
borderWidth: isSelectable ? 1 : 0,
|
|
336
|
+
borderColor: border,
|
|
337
|
+
borderStyle: isSelectable ? "solid" : void 0,
|
|
338
|
+
cursor: isSelectable ? "pointer" : void 0,
|
|
339
|
+
hoverStyle: isSelectable && !selected ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover } : void 0,
|
|
304
340
|
style: {
|
|
305
341
|
overflow: "hidden",
|
|
306
342
|
textOverflow: "ellipsis",
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 flexDirection,\n alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, fall back to the system font\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\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> = ({ children, color, size }) => {\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 <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n }\n };\n\n const { bg, text } = resolveColors();\n\n return (\n <Box\n backgroundColor={bg}\n borderRadius={sizeStyles.radius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EAC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;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,eAAc;AAAA,MACd,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,KAAK,WAAW;AAAA,MAChB,OAAO;AAAA,QACL,UAAU;AAAA,QACV,cAAc;AAAA,QACd,YAAY;AAAA,MACd;AAAA,MAEC;AAAA,gBACC,gBAAAA,KAAC,QAAK,MAAM,WAAW,UAAU,OAAO,MACrC,gBACH;AAAA,QAGF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,WAAW;AAAA,YACrB,YAAW;AAAA,YACX,YAAW;AAAA,YACX,OAAO;AAAA,cACL,UAAU;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,YACC,gBAAAA,KAAC,OAAI,SAAS,UACZ,0BAAAA,KAAC,KAAE,MAAM,WAAW,UAAU,OAAO,MAAM,GAC7C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["jsx","View","jsx","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 flexDirection,\n alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, fall back to the system font\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\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> = ({ children, color, size }) => {\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 <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n variant?: \"default\" | \"selectable\";\n selected?: boolean;\n onPress?: () => void;\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nconst SELECTABLE_BORDER_RADIUS = 8;\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n variant = \"default\",\n selected = false,\n onPress,\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n if (variant === \"selectable\") {\n if (selected) {\n return {\n bg: theme.colors.control.brand.secondary.bg,\n text: theme.colors.content.brand.primary,\n border: theme.colors.border.secondary,\n };\n }\n return {\n bg: theme.colors.overlay.mono,\n text: theme.colors.content.primary,\n border: theme.colors.border.secondary,\n };\n }\n\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n border: undefined,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n border: undefined,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n border: undefined,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n border: undefined,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n border: undefined,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n border: undefined,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n }\n };\n\n const { bg, text, border } = resolveColors();\n const isSelectable = variant === \"selectable\";\n const borderRadius = isSelectable\n ? SELECTABLE_BORDER_RADIUS\n : sizeStyles.radius;\n\n return (\n <Box\n as={isSelectable ? \"button\" : undefined}\n onPress={isSelectable ? onPress : undefined}\n backgroundColor={bg}\n borderRadius={borderRadius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n borderWidth={isSelectable ? 1 : 0}\n borderColor={border}\n borderStyle={isSelectable ? \"solid\" : undefined}\n cursor={isSelectable ? \"pointer\" : undefined}\n hoverStyle={\n isSelectable && !selected\n ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover }\n : undefined\n }\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,o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AW;AAEf,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,eAAe,WAAW;AAAA,MAC9B,SAAS,eAAe,UAAU;AAAA,MAClC,iBAAiB;AAAA,MACjB;AAAA,MACA,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,eAAc;AAAA,MACd,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,KAAK,WAAW;AAAA,MAChB,aAAa,eAAe,IAAI;AAAA,MAChC,aAAa;AAAA,MACb,aAAa,eAAe,UAAU;AAAA,MACtC,QAAQ,eAAe,YAAY;AAAA,MACnC,YACE,gBAAgB,CAAC,WACb,EAAE,iBAAiB,MAAM,OAAO,QAAQ,MAAM,SAAS,QAAQ,IAC/D;AAAA,MAEN,OAAO;AAAA,QACL,UAAU;AAAA,QACV,cAAc;AAAA,QACd,YAAY;AAAA,MACd;AAAA,MAEC;AAAA,gBACC,gBAAAA,KAAC,QAAK,MAAM,WAAW,UAAU,OAAO,MACrC,gBACH;AAAA,QAGF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,WAAW;AAAA,YACrB,YAAW;AAAA,YACX,YAAW;AAAA,YACX,OAAO;AAAA,cACL,UAAU;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,YACC,gBAAAA,KAAC,OAAI,SAAS,UACZ,0BAAAA,KAAC,KAAE,MAAM,WAAW,UAAU,OAAO,MAAM,GAC7C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["jsx","View","jsx","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-tag",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,9 +10,9 @@
|
|
|
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-primitives-core": "0.
|
|
13
|
+
"@xsolla/xui-core": "0.105.0",
|
|
14
|
+
"@xsolla/xui-icons": "0.105.0",
|
|
15
|
+
"@xsolla/xui-primitives-core": "0.105.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=16.8.0",
|
package/web/index.d.mts
CHANGED
|
@@ -3,6 +3,9 @@ import React from 'react';
|
|
|
3
3
|
interface TagProps {
|
|
4
4
|
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
5
|
tone?: "primary" | "secondary" | "brand" | "brandExtra" | "success" | "warning" | "alert" | "neutral";
|
|
6
|
+
variant?: "default" | "selectable";
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
onPress?: () => void;
|
|
6
9
|
children: React.ReactNode;
|
|
7
10
|
icon?: React.ReactNode;
|
|
8
11
|
onRemove?: () => void;
|
package/web/index.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import React from 'react';
|
|
|
3
3
|
interface TagProps {
|
|
4
4
|
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
5
|
tone?: "primary" | "secondary" | "brand" | "brandExtra" | "success" | "warning" | "alert" | "neutral";
|
|
6
|
+
variant?: "default" | "selectable";
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
onPress?: () => void;
|
|
6
9
|
children: React.ReactNode;
|
|
7
10
|
icon?: React.ReactNode;
|
|
8
11
|
onRemove?: () => void;
|
package/web/index.js
CHANGED
|
@@ -261,9 +261,13 @@ var Icon = ({ children, ...props }) => {
|
|
|
261
261
|
var import_xui_core = require("@xsolla/xui-core");
|
|
262
262
|
var import_xui_icons = require("@xsolla/xui-icons");
|
|
263
263
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
264
|
+
var SELECTABLE_BORDER_RADIUS = 8;
|
|
264
265
|
var Tag = ({
|
|
265
266
|
size = "md",
|
|
266
267
|
tone = "primary",
|
|
268
|
+
variant = "default",
|
|
269
|
+
selected = false,
|
|
270
|
+
onPress,
|
|
267
271
|
children,
|
|
268
272
|
icon,
|
|
269
273
|
onRemove
|
|
@@ -271,66 +275,98 @@ var Tag = ({
|
|
|
271
275
|
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
272
276
|
const sizeStyles = theme.sizing.tag(size);
|
|
273
277
|
const resolveColors = () => {
|
|
278
|
+
if (variant === "selectable") {
|
|
279
|
+
if (selected) {
|
|
280
|
+
return {
|
|
281
|
+
bg: theme.colors.control.brand.secondary.bg,
|
|
282
|
+
text: theme.colors.content.brand.primary,
|
|
283
|
+
border: theme.colors.border.secondary
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
bg: theme.colors.overlay.mono,
|
|
288
|
+
text: theme.colors.content.primary,
|
|
289
|
+
border: theme.colors.border.secondary
|
|
290
|
+
};
|
|
291
|
+
}
|
|
274
292
|
switch (tone) {
|
|
275
293
|
case "primary":
|
|
276
294
|
return {
|
|
277
295
|
bg: theme.colors.background.primary,
|
|
278
|
-
text: theme.colors.content.primary
|
|
296
|
+
text: theme.colors.content.primary,
|
|
297
|
+
border: void 0
|
|
279
298
|
};
|
|
280
299
|
case "secondary":
|
|
281
300
|
return {
|
|
282
301
|
bg: theme.colors.background.secondary,
|
|
283
|
-
text: theme.colors.content.primary
|
|
302
|
+
text: theme.colors.content.primary,
|
|
303
|
+
border: void 0
|
|
284
304
|
};
|
|
285
305
|
case "brand":
|
|
286
306
|
return {
|
|
287
307
|
bg: theme.colors.background.brand.primary,
|
|
288
|
-
text: theme.colors.content.on.brand
|
|
308
|
+
text: theme.colors.content.on.brand,
|
|
309
|
+
border: void 0
|
|
289
310
|
};
|
|
290
311
|
case "brandExtra":
|
|
291
312
|
return {
|
|
292
313
|
bg: theme.colors.background.brandExtra.primary,
|
|
293
|
-
text: theme.colors.content.on.brandExtra
|
|
314
|
+
text: theme.colors.content.on.brandExtra,
|
|
315
|
+
border: void 0
|
|
294
316
|
};
|
|
295
317
|
case "success":
|
|
296
318
|
return {
|
|
297
319
|
bg: theme.colors.background.success.primary,
|
|
298
|
-
text: theme.colors.content.on.success
|
|
320
|
+
text: theme.colors.content.on.success,
|
|
321
|
+
border: void 0
|
|
299
322
|
};
|
|
300
323
|
case "warning":
|
|
301
324
|
return {
|
|
302
325
|
bg: theme.colors.background.warning.primary,
|
|
303
|
-
text: theme.colors.content.on.warning
|
|
326
|
+
text: theme.colors.content.on.warning,
|
|
327
|
+
border: void 0
|
|
304
328
|
};
|
|
305
329
|
case "alert":
|
|
306
330
|
return {
|
|
307
331
|
bg: theme.colors.background.alert.primary,
|
|
308
|
-
text: theme.colors.content.on.alert
|
|
332
|
+
text: theme.colors.content.on.alert,
|
|
333
|
+
border: void 0
|
|
309
334
|
};
|
|
310
335
|
case "neutral":
|
|
311
336
|
return {
|
|
312
337
|
bg: theme.colors.background.neutral.primary,
|
|
313
|
-
text: theme.colors.content.on.neutral
|
|
338
|
+
text: theme.colors.content.on.neutral,
|
|
339
|
+
border: void 0
|
|
314
340
|
};
|
|
315
341
|
default:
|
|
316
342
|
return {
|
|
317
343
|
bg: theme.colors.background.primary,
|
|
318
|
-
text: theme.colors.content.primary
|
|
344
|
+
text: theme.colors.content.primary,
|
|
345
|
+
border: void 0
|
|
319
346
|
};
|
|
320
347
|
}
|
|
321
348
|
};
|
|
322
|
-
const { bg, text } = resolveColors();
|
|
349
|
+
const { bg, text, border } = resolveColors();
|
|
350
|
+
const isSelectable = variant === "selectable";
|
|
351
|
+
const borderRadius = isSelectable ? SELECTABLE_BORDER_RADIUS : sizeStyles.radius;
|
|
323
352
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
324
353
|
Box,
|
|
325
354
|
{
|
|
355
|
+
as: isSelectable ? "button" : void 0,
|
|
356
|
+
onPress: isSelectable ? onPress : void 0,
|
|
326
357
|
backgroundColor: bg,
|
|
327
|
-
borderRadius
|
|
358
|
+
borderRadius,
|
|
328
359
|
height: sizeStyles.height,
|
|
329
360
|
paddingHorizontal: sizeStyles.padding,
|
|
330
361
|
flexDirection: "row",
|
|
331
362
|
alignItems: "center",
|
|
332
363
|
justifyContent: "center",
|
|
333
364
|
gap: sizeStyles.gap,
|
|
365
|
+
borderWidth: isSelectable ? 1 : 0,
|
|
366
|
+
borderColor: border,
|
|
367
|
+
borderStyle: isSelectable ? "solid" : void 0,
|
|
368
|
+
cursor: isSelectable ? "pointer" : void 0,
|
|
369
|
+
hoverStyle: isSelectable && !selected ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover } : void 0,
|
|
334
370
|
style: {
|
|
335
371
|
overflow: "hidden",
|
|
336
372
|
textOverflow: "ellipsis",
|
package/web/index.js.flow
CHANGED
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["export * from \"./Tag\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\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 \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n }\n };\n\n const { bg, text } = resolveColors();\n\n return (\n <Box\n backgroundColor={bg}\n borderRadius={sizeStyles.radius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAClB,+BAAmB;AAuMX;AApMR,IAAM,YAAY,yBAAAA,QAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;AAAA,kBAC7C,CAAC,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K,IAAI,cAAc;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB;AAAA,MACjB,cAAc,WAAW;AAAA,MACzB,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,eAAc;AAAA,MACd,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,KAAK,WAAW;AAAA,MAChB,OAAO;AAAA,QACL,UAAU;AAAA,QACV,cAAc;AAAA,QACd,YAAY;AAAA,MACd;AAAA,MAEC;AAAA,gBACC,6CAAC,QAAK,MAAM,WAAW,UAAU,OAAO,MACrC,gBACH;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,WAAW;AAAA,YACrB,YAAW;AAAA,YACX,YAAW;AAAA,YACX,OAAO;AAAA,cACL,UAAU;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,YACC,6CAAC,OAAI,SAAS,UACZ,uDAAC,sBAAE,MAAM,WAAW,UAAU,OAAO,MAAM,GAC7C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["styled","React","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["export * from \"./Tag\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\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 \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n variant?: \"default\" | \"selectable\";\n selected?: boolean;\n onPress?: () => void;\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nconst SELECTABLE_BORDER_RADIUS = 8;\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n variant = \"default\",\n selected = false,\n onPress,\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n if (variant === \"selectable\") {\n if (selected) {\n return {\n bg: theme.colors.control.brand.secondary.bg,\n text: theme.colors.content.brand.primary,\n border: theme.colors.border.secondary,\n };\n }\n return {\n bg: theme.colors.overlay.mono,\n text: theme.colors.content.primary,\n border: theme.colors.border.secondary,\n };\n }\n\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n border: undefined,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n border: undefined,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n border: undefined,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n border: undefined,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n border: undefined,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n border: undefined,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n }\n };\n\n const { bg, text, border } = resolveColors();\n const isSelectable = variant === \"selectable\";\n const borderRadius = isSelectable\n ? SELECTABLE_BORDER_RADIUS\n : sizeStyles.radius;\n\n return (\n <Box\n as={isSelectable ? \"button\" : undefined}\n onPress={isSelectable ? onPress : undefined}\n backgroundColor={bg}\n borderRadius={borderRadius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n borderWidth={isSelectable ? 1 : 0}\n borderColor={border}\n borderStyle={isSelectable ? \"solid\" : undefined}\n cursor={isSelectable ? \"pointer\" : undefined}\n hoverStyle={\n isSelectable && !selected\n ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover }\n : undefined\n }\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAClB,+BAAmB;AAuMX;AApMR,IAAM,YAAY,yBAAAA,QAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;AAAA,kBAC7C,CAAC,UACf,OAAO,MAAM,gBAAgB,WACzB,GAAG,MAAM,WAAW,OACpB,MAAM,eAAe,CAAC;AAAA;AAAA,IAE1B,CAAC,UACD,MAAM,sBAAsB,UAC5B;AAAA,2BACuB,OAAO,MAAM,sBAAsB,WAAW,GAAG,MAAM,iBAAiB,OAAO,MAAM,iBAAiB;AAAA,2BACtG,MAAM,qBAAqB,MAAM,eAAe,aAAa;AAAA;AAAA,GAErF;AAAA,IACC,CAAC,UACD,MAAM,mBAAmB,UACzB;AAAA,wBACoB,OAAO,MAAM,mBAAmB,WAAW,GAAG,MAAM,cAAc,OAAO,MAAM,cAAc;AAAA,w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x_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_jsx_runtime"]}
|
package/web/index.mjs
CHANGED
|
@@ -225,9 +225,13 @@ var Icon = ({ children, ...props }) => {
|
|
|
225
225
|
import { useDesignSystem } from "@xsolla/xui-core";
|
|
226
226
|
import { X } from "@xsolla/xui-icons";
|
|
227
227
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
228
|
+
var SELECTABLE_BORDER_RADIUS = 8;
|
|
228
229
|
var Tag = ({
|
|
229
230
|
size = "md",
|
|
230
231
|
tone = "primary",
|
|
232
|
+
variant = "default",
|
|
233
|
+
selected = false,
|
|
234
|
+
onPress,
|
|
231
235
|
children,
|
|
232
236
|
icon,
|
|
233
237
|
onRemove
|
|
@@ -235,66 +239,98 @@ var Tag = ({
|
|
|
235
239
|
const { theme } = useDesignSystem();
|
|
236
240
|
const sizeStyles = theme.sizing.tag(size);
|
|
237
241
|
const resolveColors = () => {
|
|
242
|
+
if (variant === "selectable") {
|
|
243
|
+
if (selected) {
|
|
244
|
+
return {
|
|
245
|
+
bg: theme.colors.control.brand.secondary.bg,
|
|
246
|
+
text: theme.colors.content.brand.primary,
|
|
247
|
+
border: theme.colors.border.secondary
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
bg: theme.colors.overlay.mono,
|
|
252
|
+
text: theme.colors.content.primary,
|
|
253
|
+
border: theme.colors.border.secondary
|
|
254
|
+
};
|
|
255
|
+
}
|
|
238
256
|
switch (tone) {
|
|
239
257
|
case "primary":
|
|
240
258
|
return {
|
|
241
259
|
bg: theme.colors.background.primary,
|
|
242
|
-
text: theme.colors.content.primary
|
|
260
|
+
text: theme.colors.content.primary,
|
|
261
|
+
border: void 0
|
|
243
262
|
};
|
|
244
263
|
case "secondary":
|
|
245
264
|
return {
|
|
246
265
|
bg: theme.colors.background.secondary,
|
|
247
|
-
text: theme.colors.content.primary
|
|
266
|
+
text: theme.colors.content.primary,
|
|
267
|
+
border: void 0
|
|
248
268
|
};
|
|
249
269
|
case "brand":
|
|
250
270
|
return {
|
|
251
271
|
bg: theme.colors.background.brand.primary,
|
|
252
|
-
text: theme.colors.content.on.brand
|
|
272
|
+
text: theme.colors.content.on.brand,
|
|
273
|
+
border: void 0
|
|
253
274
|
};
|
|
254
275
|
case "brandExtra":
|
|
255
276
|
return {
|
|
256
277
|
bg: theme.colors.background.brandExtra.primary,
|
|
257
|
-
text: theme.colors.content.on.brandExtra
|
|
278
|
+
text: theme.colors.content.on.brandExtra,
|
|
279
|
+
border: void 0
|
|
258
280
|
};
|
|
259
281
|
case "success":
|
|
260
282
|
return {
|
|
261
283
|
bg: theme.colors.background.success.primary,
|
|
262
|
-
text: theme.colors.content.on.success
|
|
284
|
+
text: theme.colors.content.on.success,
|
|
285
|
+
border: void 0
|
|
263
286
|
};
|
|
264
287
|
case "warning":
|
|
265
288
|
return {
|
|
266
289
|
bg: theme.colors.background.warning.primary,
|
|
267
|
-
text: theme.colors.content.on.warning
|
|
290
|
+
text: theme.colors.content.on.warning,
|
|
291
|
+
border: void 0
|
|
268
292
|
};
|
|
269
293
|
case "alert":
|
|
270
294
|
return {
|
|
271
295
|
bg: theme.colors.background.alert.primary,
|
|
272
|
-
text: theme.colors.content.on.alert
|
|
296
|
+
text: theme.colors.content.on.alert,
|
|
297
|
+
border: void 0
|
|
273
298
|
};
|
|
274
299
|
case "neutral":
|
|
275
300
|
return {
|
|
276
301
|
bg: theme.colors.background.neutral.primary,
|
|
277
|
-
text: theme.colors.content.on.neutral
|
|
302
|
+
text: theme.colors.content.on.neutral,
|
|
303
|
+
border: void 0
|
|
278
304
|
};
|
|
279
305
|
default:
|
|
280
306
|
return {
|
|
281
307
|
bg: theme.colors.background.primary,
|
|
282
|
-
text: theme.colors.content.primary
|
|
308
|
+
text: theme.colors.content.primary,
|
|
309
|
+
border: void 0
|
|
283
310
|
};
|
|
284
311
|
}
|
|
285
312
|
};
|
|
286
|
-
const { bg, text } = resolveColors();
|
|
313
|
+
const { bg, text, border } = resolveColors();
|
|
314
|
+
const isSelectable = variant === "selectable";
|
|
315
|
+
const borderRadius = isSelectable ? SELECTABLE_BORDER_RADIUS : sizeStyles.radius;
|
|
287
316
|
return /* @__PURE__ */ jsxs(
|
|
288
317
|
Box,
|
|
289
318
|
{
|
|
319
|
+
as: isSelectable ? "button" : void 0,
|
|
320
|
+
onPress: isSelectable ? onPress : void 0,
|
|
290
321
|
backgroundColor: bg,
|
|
291
|
-
borderRadius
|
|
322
|
+
borderRadius,
|
|
292
323
|
height: sizeStyles.height,
|
|
293
324
|
paddingHorizontal: sizeStyles.padding,
|
|
294
325
|
flexDirection: "row",
|
|
295
326
|
alignItems: "center",
|
|
296
327
|
justifyContent: "center",
|
|
297
328
|
gap: sizeStyles.gap,
|
|
329
|
+
borderWidth: isSelectable ? 1 : 0,
|
|
330
|
+
borderColor: border,
|
|
331
|
+
borderStyle: isSelectable ? "solid" : void 0,
|
|
332
|
+
cursor: isSelectable ? "pointer" : void 0,
|
|
333
|
+
hoverStyle: isSelectable && !selected ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover } : void 0,
|
|
298
334
|
style: {
|
|
299
335
|
overflow: "hidden",
|
|
300
336
|
textOverflow: "ellipsis",
|
package/web/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\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 \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n };\n }\n };\n\n const { bg, text } = resolveColors();\n\n return (\n <Box\n backgroundColor={bg}\n borderRadius={sizeStyles.radius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,OAAO,YAAY;AAuMX;AApMR,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA,sBAGH,CA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AAA,UAC5B,MAAM,MAAM,OAAO,QAAQ;AAAA,QAC7B;AAAA,IACJ;AAAA,EACF;AAEA,QAAM,EAAE,IAAI,KAAK,IAAI,cAAc;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB;AAAA,MACjB,cAAc,WAAW;AAAA,MACzB,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,eAAc;AAAA,MACd,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,KAAK,WAAW;AAAA,MAChB,OAAO;AAAA,QACL,UAAU;AAAA,QACV,cAAc;AAAA,QACd,YAAY;AAAA,MACd;AAAA,MAEC;AAAA,gBACC,gBAAAA,KAAC,QAAK,MAAM,WAAW,UAAU,OAAO,MACrC,gBACH;AAAA,QAGF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,WAAW;AAAA,YACrB,YAAW;AAAA,YACX,YAAW;AAAA,YACX,OAAO;AAAA,cACL,UAAU;AAAA,cACV,cAAc;AAAA,YAChB;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEC,YACC,gBAAAA,KAAC,OAAI,SAAS,UACZ,0BAAAA,KAAC,KAAE,MAAM,WAAW,UAAU,OAAO,MAAM,GAC7C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["styled","jsx","styled","jsx","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Icon.tsx","../../src/Tag.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\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 \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n type,\n disabled,\n id,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X } from \"@xsolla/xui-icons\";\n\nexport interface TagProps {\n size?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\n tone?:\n | \"primary\"\n | \"secondary\"\n | \"brand\"\n | \"brandExtra\"\n | \"success\"\n | \"warning\"\n | \"alert\"\n | \"neutral\";\n variant?: \"default\" | \"selectable\";\n selected?: boolean;\n onPress?: () => void;\n children: React.ReactNode;\n icon?: React.ReactNode;\n onRemove?: () => void;\n}\n\nconst SELECTABLE_BORDER_RADIUS = 8;\n\nexport const Tag: React.FC<TagProps> = ({\n size = \"md\",\n tone = \"primary\",\n variant = \"default\",\n selected = false,\n onPress,\n children,\n icon,\n onRemove,\n}) => {\n const { theme } = useDesignSystem();\n const sizeStyles = theme.sizing.tag(size);\n\n const resolveColors = () => {\n if (variant === \"selectable\") {\n if (selected) {\n return {\n bg: theme.colors.control.brand.secondary.bg,\n text: theme.colors.content.brand.primary,\n border: theme.colors.border.secondary,\n };\n }\n return {\n bg: theme.colors.overlay.mono,\n text: theme.colors.content.primary,\n border: theme.colors.border.secondary,\n };\n }\n\n switch (tone) {\n case \"primary\":\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"secondary\":\n return {\n bg: theme.colors.background.secondary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n case \"brand\":\n return {\n bg: theme.colors.background.brand.primary,\n text: theme.colors.content.on.brand,\n border: undefined,\n };\n case \"brandExtra\":\n return {\n bg: theme.colors.background.brandExtra.primary,\n text: theme.colors.content.on.brandExtra,\n border: undefined,\n };\n case \"success\":\n return {\n bg: theme.colors.background.success.primary,\n text: theme.colors.content.on.success,\n border: undefined,\n };\n case \"warning\":\n return {\n bg: theme.colors.background.warning.primary,\n text: theme.colors.content.on.warning,\n border: undefined,\n };\n case \"alert\":\n return {\n bg: theme.colors.background.alert.primary,\n text: theme.colors.content.on.alert,\n border: undefined,\n };\n case \"neutral\":\n return {\n bg: theme.colors.background.neutral.primary,\n text: theme.colors.content.on.neutral,\n border: undefined,\n };\n default:\n return {\n bg: theme.colors.background.primary,\n text: theme.colors.content.primary,\n border: undefined,\n };\n }\n };\n\n const { bg, text, border } = resolveColors();\n const isSelectable = variant === \"selectable\";\n const borderRadius = isSelectable\n ? SELECTABLE_BORDER_RADIUS\n : sizeStyles.radius;\n\n return (\n <Box\n as={isSelectable ? \"button\" : undefined}\n onPress={isSelectable ? onPress : undefined}\n backgroundColor={bg}\n borderRadius={borderRadius}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.padding}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n borderWidth={isSelectable ? 1 : 0}\n borderColor={border}\n borderStyle={isSelectable ? \"solid\" : undefined}\n cursor={isSelectable ? \"pointer\" : undefined}\n hoverStyle={\n isSelectable && !selected\n ? { backgroundColor: theme.colors.control.brand.tertiary.bgHover }\n : undefined\n }\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {icon && (\n <Icon size={sizeStyles.iconSize} color={text}>\n {icon}\n </Icon>\n )}\n\n <Text\n color={text}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"500\"\n whiteSpace=\"nowrap\"\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {children}\n </Text>\n\n {onRemove && (\n <Box onPress={onRemove}>\n <X size={sizeStyles.iconSize} color={text} />\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,OAAO,YAAY;AAuMX;AApMR,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;AAAA,kBAC7C,CAAC,UACf,OAAO,MAAM,gBAAgB,WACzB,GAAG,MAAM,WAAW,OACpB,MAAM,eAAe,CAAC;AAAA;AAAA,IAE1B,CAAC,UACD,MAAM,sBAAsB,UAC5B;AAAA,2BACuB,OAAO,MAAM,sBAAsB,WAAW,GAAG,MAAM,iBAAiB,OAAO,MAAM,iBAAiB;AAAA,2BACtG,MAAM,qBAAqB,MAAM,eAAe,aAAa;AAAA;AAAA,GAErF;AAAA,IACC,CAAC,UACD,MAAM,mBAAmB,UACzB;AAAA,wBACoB,OAAO,MAAM,mBAAmB,WAAW,GAAG,MAAM,cAAc,OAAO,MAAM,cAAc;AAAA,wBAC7F,MAAM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