@xsolla/xui-notification-native 0.64.0-pr56.1768348754
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/index.d.mts +15 -0
- package/index.d.ts +15 -0
- package/index.js +627 -0
- package/index.js.map +1 -0
- package/index.mjs +594 -0
- package/index.mjs.map +1 -0
- package/package.json +26 -0
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/Notification.tsx"],"sourcesContent":["export * from \"./Notification\";\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, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\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 type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\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 // @ts-ignore - passing color down to potential Text/Icon children\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\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import React from \"react\";\n// @ts-ignore\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { X, AlertCircle, Check } from \"@xsolla/xui-icons\";\n\nexport interface NotificationProps {\n tone?: \"neutral\" | \"success\" | \"warning\" | \"alert\";\n type?: \"toast\" | \"inline\";\n title?: string;\n message?: string;\n actionLabel?: string;\n onAction?: () => void;\n onClose?: () => void;\n showClose?: boolean;\n}\n\nexport const Notification: React.FC<NotificationProps> = ({\n tone = \"neutral\",\n type = \"toast\",\n title,\n message,\n actionLabel,\n onAction,\n onClose,\n showClose = true,\n}) => {\n const { theme } = useDesignSystem();\n const config = theme.sizing.notification(type);\n\n const toneConfig = {\n neutral: {\n bg: theme.colors.background.neutral.secondary,\n content: theme.colors.content.neutral.primary,\n icon: theme.colors.content.neutral.primary,\n },\n success: {\n bg: theme.colors.background.success.secondary,\n content: theme.colors.content.success.primary,\n icon: theme.colors.content.success.primary,\n },\n warning: {\n bg: theme.colors.background.warning.secondary,\n content: theme.colors.content.warning.primary,\n icon: theme.colors.content.warning.primary,\n },\n alert: {\n bg: theme.colors.background.alert.secondary,\n content: theme.colors.content.alert.primary,\n icon: theme.colors.content.alert.primary,\n },\n }[tone];\n\n const renderIcon = () => {\n switch (tone) {\n case \"success\":\n return <Check size={config.iconSize} color={toneConfig.icon} />;\n case \"warning\":\n case \"alert\":\n return <AlertCircle size={config.iconSize} color={toneConfig.icon} />;\n default:\n return <AlertCircle size={config.iconSize} color={toneConfig.icon} />;\n }\n };\n\n return (\n <Box\n backgroundColor={toneConfig.bg}\n borderRadius={config.radius}\n paddingHorizontal={config.paddingHorizontal}\n paddingVertical={config.paddingVertical}\n width={config.width}\n flexDirection=\"row\"\n alignItems={type === \"inline\" ? \"center\" : \"flex-start\"}\n gap={16}\n >\n <Box\n width={config.iconWrapperSize}\n height={config.iconWrapperSize}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {renderIcon()}\n </Box>\n\n <Box\n flex={1}\n flexDirection={type === \"inline\" ? \"row\" : \"column\"}\n gap={type === \"inline\" ? 28 : config.gap}\n alignItems={type === \"inline\" ? \"center\" : \"flex-start\"}\n >\n <Box flex={1} gap={4}>\n {title && (\n <Text\n color={theme.colors.content.primary}\n fontSize={config.titleSize}\n fontWeight=\"500\"\n >\n {title}\n </Text>\n )}\n {message && (\n <Text\n color={theme.colors.content.secondary}\n fontSize={config.messageSize}\n >\n {message}\n </Text>\n )}\n </Box>\n\n {actionLabel && (\n <Box onPress={onAction} paddingVertical={type === \"inline\" ? 0 : 8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={16}\n fontWeight=\"500\"\n letterSpacing={0.4}\n whiteSpace=\"nowrap\"\n >\n {actionLabel}\n </Text>\n </Box>\n )}\n </Box>\n\n {showClose && (\n <Box onPress={onClose} marginTop={type === \"inline\" ? 0 : 2}>\n <Box\n width={24}\n height={24}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <X size={18} color={theme.colors.content.primary} />\n </Box>\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,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,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B;AAAA;AAAA,gBACH;AAAA,iBAEJ;AAAA,cAEC,eACC,6CAAC,OAAI,SAAS,UAAU,iBAAiB,SAAS,WAAW,IAAI,GAC/D;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,kBAC5B,UAAU;AAAA,kBACV,YAAW;AAAA,kBACX,eAAe;AAAA,kBACf,YAAW;AAAA,kBAEV;AAAA;AAAA,cACH,GACF;AAAA;AAAA;AAAA,QAEJ;AAAA,QAEC,aACC,6CAAC,OAAI,SAAS,SAAS,WAAW,SAAS,WAAW,IAAI,GACxD;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,YAAW;AAAA,YACX,gBAAe;AAAA,YAEf,uDAAC,sBAAE,MAAM,IAAI,OAAO,MAAM,OAAO,QAAQ,SAAS;AAAA;AAAA,QACpD,GACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_jsx_runtime"]}
|
package/index.mjs
ADDED
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
// ../primitives-native/src/Box.tsx
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Pressable,
|
|
5
|
+
Image
|
|
6
|
+
} from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var Box = ({
|
|
9
|
+
children,
|
|
10
|
+
onPress,
|
|
11
|
+
onLayout,
|
|
12
|
+
onMoveShouldSetResponder,
|
|
13
|
+
onResponderGrant,
|
|
14
|
+
onResponderMove,
|
|
15
|
+
onResponderRelease,
|
|
16
|
+
onResponderTerminate,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
borderColor,
|
|
19
|
+
borderWidth,
|
|
20
|
+
borderBottomWidth,
|
|
21
|
+
borderBottomColor,
|
|
22
|
+
borderTopWidth,
|
|
23
|
+
borderTopColor,
|
|
24
|
+
borderLeftWidth,
|
|
25
|
+
borderLeftColor,
|
|
26
|
+
borderRightWidth,
|
|
27
|
+
borderRightColor,
|
|
28
|
+
borderRadius,
|
|
29
|
+
borderStyle,
|
|
30
|
+
height,
|
|
31
|
+
padding,
|
|
32
|
+
paddingHorizontal,
|
|
33
|
+
paddingVertical,
|
|
34
|
+
margin,
|
|
35
|
+
marginTop,
|
|
36
|
+
marginBottom,
|
|
37
|
+
marginLeft,
|
|
38
|
+
marginRight,
|
|
39
|
+
flexDirection,
|
|
40
|
+
alignItems,
|
|
41
|
+
justifyContent,
|
|
42
|
+
position,
|
|
43
|
+
top,
|
|
44
|
+
bottom,
|
|
45
|
+
left,
|
|
46
|
+
right,
|
|
47
|
+
width,
|
|
48
|
+
flex,
|
|
49
|
+
overflow,
|
|
50
|
+
zIndex,
|
|
51
|
+
hoverStyle,
|
|
52
|
+
pressStyle,
|
|
53
|
+
style,
|
|
54
|
+
"data-testid": dataTestId,
|
|
55
|
+
testID,
|
|
56
|
+
as,
|
|
57
|
+
src,
|
|
58
|
+
alt,
|
|
59
|
+
...rest
|
|
60
|
+
}) => {
|
|
61
|
+
const getContainerStyle = (pressed) => ({
|
|
62
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
63
|
+
borderColor,
|
|
64
|
+
borderWidth,
|
|
65
|
+
borderBottomWidth,
|
|
66
|
+
borderBottomColor,
|
|
67
|
+
borderTopWidth,
|
|
68
|
+
borderTopColor,
|
|
69
|
+
borderLeftWidth,
|
|
70
|
+
borderLeftColor,
|
|
71
|
+
borderRightWidth,
|
|
72
|
+
borderRightColor,
|
|
73
|
+
borderRadius,
|
|
74
|
+
borderStyle,
|
|
75
|
+
overflow,
|
|
76
|
+
zIndex,
|
|
77
|
+
height,
|
|
78
|
+
width,
|
|
79
|
+
padding,
|
|
80
|
+
paddingHorizontal,
|
|
81
|
+
paddingVertical,
|
|
82
|
+
margin,
|
|
83
|
+
marginTop,
|
|
84
|
+
marginBottom,
|
|
85
|
+
marginLeft,
|
|
86
|
+
marginRight,
|
|
87
|
+
flexDirection,
|
|
88
|
+
alignItems,
|
|
89
|
+
justifyContent,
|
|
90
|
+
position,
|
|
91
|
+
top,
|
|
92
|
+
bottom,
|
|
93
|
+
left,
|
|
94
|
+
right,
|
|
95
|
+
flex,
|
|
96
|
+
...style
|
|
97
|
+
});
|
|
98
|
+
const finalTestID = dataTestId || testID;
|
|
99
|
+
const {
|
|
100
|
+
role,
|
|
101
|
+
tabIndex,
|
|
102
|
+
onKeyDown,
|
|
103
|
+
onKeyUp,
|
|
104
|
+
"aria-label": _ariaLabel,
|
|
105
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
106
|
+
"aria-current": _ariaCurrent,
|
|
107
|
+
"aria-disabled": _ariaDisabled,
|
|
108
|
+
"aria-live": _ariaLive,
|
|
109
|
+
className,
|
|
110
|
+
"data-testid": _dataTestId,
|
|
111
|
+
...nativeRest
|
|
112
|
+
} = rest;
|
|
113
|
+
if (as === "img" && src) {
|
|
114
|
+
const imageStyle = {
|
|
115
|
+
width,
|
|
116
|
+
height,
|
|
117
|
+
borderRadius,
|
|
118
|
+
position,
|
|
119
|
+
top,
|
|
120
|
+
bottom,
|
|
121
|
+
left,
|
|
122
|
+
right,
|
|
123
|
+
...style
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ jsx(
|
|
126
|
+
Image,
|
|
127
|
+
{
|
|
128
|
+
source: { uri: src },
|
|
129
|
+
style: imageStyle,
|
|
130
|
+
testID: finalTestID,
|
|
131
|
+
resizeMode: "cover",
|
|
132
|
+
...nativeRest
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
if (onPress) {
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
Pressable,
|
|
139
|
+
{
|
|
140
|
+
onPress,
|
|
141
|
+
onLayout,
|
|
142
|
+
onMoveShouldSetResponder,
|
|
143
|
+
onResponderGrant,
|
|
144
|
+
onResponderMove,
|
|
145
|
+
onResponderRelease,
|
|
146
|
+
onResponderTerminate,
|
|
147
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
148
|
+
testID: finalTestID,
|
|
149
|
+
...nativeRest,
|
|
150
|
+
children
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return /* @__PURE__ */ jsx(
|
|
155
|
+
View,
|
|
156
|
+
{
|
|
157
|
+
style: getContainerStyle(),
|
|
158
|
+
testID: finalTestID,
|
|
159
|
+
onLayout,
|
|
160
|
+
onMoveShouldSetResponder,
|
|
161
|
+
onResponderGrant,
|
|
162
|
+
onResponderMove,
|
|
163
|
+
onResponderRelease,
|
|
164
|
+
onResponderTerminate,
|
|
165
|
+
...nativeRest,
|
|
166
|
+
children
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// ../primitives-native/src/Text.tsx
|
|
172
|
+
import { Text as RNText } from "react-native";
|
|
173
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
174
|
+
var roleMap = {
|
|
175
|
+
alert: "alert",
|
|
176
|
+
heading: "header",
|
|
177
|
+
button: "button",
|
|
178
|
+
link: "link",
|
|
179
|
+
text: "text"
|
|
180
|
+
};
|
|
181
|
+
var Text = ({
|
|
182
|
+
children,
|
|
183
|
+
color,
|
|
184
|
+
fontSize,
|
|
185
|
+
fontWeight,
|
|
186
|
+
fontFamily,
|
|
187
|
+
id,
|
|
188
|
+
role,
|
|
189
|
+
...props
|
|
190
|
+
}) => {
|
|
191
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
192
|
+
if (resolvedFontFamily === "Pilat Wide Bold") {
|
|
193
|
+
resolvedFontFamily = void 0;
|
|
194
|
+
}
|
|
195
|
+
const style = {
|
|
196
|
+
color,
|
|
197
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
198
|
+
fontWeight,
|
|
199
|
+
fontFamily: resolvedFontFamily,
|
|
200
|
+
textDecorationLine: props.textDecoration
|
|
201
|
+
};
|
|
202
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
203
|
+
return /* @__PURE__ */ jsx2(RNText, { style, testID: id, accessibilityRole, children });
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// ../primitives-native/src/Spinner.tsx
|
|
207
|
+
import { ActivityIndicator, View as View2 } from "react-native";
|
|
208
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
209
|
+
var Spinner = ({
|
|
210
|
+
color,
|
|
211
|
+
size,
|
|
212
|
+
role,
|
|
213
|
+
"aria-label": ariaLabel,
|
|
214
|
+
"aria-live": ariaLive,
|
|
215
|
+
"aria-describedby": ariaDescribedBy,
|
|
216
|
+
testID
|
|
217
|
+
}) => {
|
|
218
|
+
return /* @__PURE__ */ jsx3(
|
|
219
|
+
View2,
|
|
220
|
+
{
|
|
221
|
+
accessible: true,
|
|
222
|
+
accessibilityRole: role === "status" ? "none" : void 0,
|
|
223
|
+
accessibilityLabel: ariaLabel,
|
|
224
|
+
accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
|
|
225
|
+
testID,
|
|
226
|
+
children: /* @__PURE__ */ jsx3(
|
|
227
|
+
ActivityIndicator,
|
|
228
|
+
{
|
|
229
|
+
color,
|
|
230
|
+
size: typeof size === "number" ? size : "small"
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
Spinner.displayName = "Spinner";
|
|
237
|
+
|
|
238
|
+
// ../primitives-native/src/Icon.tsx
|
|
239
|
+
import React from "react";
|
|
240
|
+
import { View as View3 } from "react-native";
|
|
241
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
242
|
+
|
|
243
|
+
// ../primitives-native/src/Divider.tsx
|
|
244
|
+
import { View as View4 } from "react-native";
|
|
245
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
246
|
+
|
|
247
|
+
// ../primitives-native/src/Input.tsx
|
|
248
|
+
import { forwardRef } from "react";
|
|
249
|
+
import { TextInput as RNTextInput } from "react-native";
|
|
250
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
251
|
+
var keyboardTypeMap = {
|
|
252
|
+
text: "default",
|
|
253
|
+
number: "numeric",
|
|
254
|
+
email: "email-address",
|
|
255
|
+
tel: "phone-pad",
|
|
256
|
+
url: "url",
|
|
257
|
+
decimal: "decimal-pad"
|
|
258
|
+
};
|
|
259
|
+
var inputModeToKeyboardType = {
|
|
260
|
+
none: "default",
|
|
261
|
+
text: "default",
|
|
262
|
+
decimal: "decimal-pad",
|
|
263
|
+
numeric: "number-pad",
|
|
264
|
+
tel: "phone-pad",
|
|
265
|
+
search: "default",
|
|
266
|
+
email: "email-address",
|
|
267
|
+
url: "url"
|
|
268
|
+
};
|
|
269
|
+
var autoCompleteToTextContentType = {
|
|
270
|
+
"one-time-code": "oneTimeCode",
|
|
271
|
+
email: "emailAddress",
|
|
272
|
+
username: "username",
|
|
273
|
+
password: "password",
|
|
274
|
+
"new-password": "newPassword",
|
|
275
|
+
tel: "telephoneNumber",
|
|
276
|
+
"postal-code": "postalCode",
|
|
277
|
+
name: "name"
|
|
278
|
+
};
|
|
279
|
+
var InputPrimitive = forwardRef(
|
|
280
|
+
({
|
|
281
|
+
value,
|
|
282
|
+
placeholder,
|
|
283
|
+
onChange,
|
|
284
|
+
onChangeText,
|
|
285
|
+
onFocus,
|
|
286
|
+
onBlur,
|
|
287
|
+
onKeyDown,
|
|
288
|
+
disabled,
|
|
289
|
+
secureTextEntry,
|
|
290
|
+
style,
|
|
291
|
+
color,
|
|
292
|
+
fontSize,
|
|
293
|
+
placeholderTextColor,
|
|
294
|
+
maxLength,
|
|
295
|
+
name,
|
|
296
|
+
type,
|
|
297
|
+
inputMode,
|
|
298
|
+
autoComplete,
|
|
299
|
+
id,
|
|
300
|
+
"aria-invalid": ariaInvalid,
|
|
301
|
+
"aria-describedby": ariaDescribedBy,
|
|
302
|
+
"aria-labelledby": ariaLabelledBy,
|
|
303
|
+
"aria-label": ariaLabel,
|
|
304
|
+
"aria-disabled": ariaDisabled,
|
|
305
|
+
"data-testid": dataTestId
|
|
306
|
+
}, ref) => {
|
|
307
|
+
const handleChangeText = (text) => {
|
|
308
|
+
onChangeText?.(text);
|
|
309
|
+
if (onChange) {
|
|
310
|
+
const syntheticEvent = {
|
|
311
|
+
target: { value: text },
|
|
312
|
+
currentTarget: { value: text },
|
|
313
|
+
type: "change",
|
|
314
|
+
nativeEvent: { text },
|
|
315
|
+
preventDefault: () => {
|
|
316
|
+
},
|
|
317
|
+
stopPropagation: () => {
|
|
318
|
+
},
|
|
319
|
+
isTrusted: false
|
|
320
|
+
};
|
|
321
|
+
onChange(syntheticEvent);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
|
|
325
|
+
const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
|
|
326
|
+
return /* @__PURE__ */ jsx6(
|
|
327
|
+
RNTextInput,
|
|
328
|
+
{
|
|
329
|
+
ref,
|
|
330
|
+
value,
|
|
331
|
+
placeholder,
|
|
332
|
+
onChangeText: handleChangeText,
|
|
333
|
+
onFocus,
|
|
334
|
+
onBlur,
|
|
335
|
+
onKeyPress: (e) => {
|
|
336
|
+
if (onKeyDown) {
|
|
337
|
+
onKeyDown({
|
|
338
|
+
key: e.nativeEvent.key,
|
|
339
|
+
preventDefault: () => {
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
editable: !disabled,
|
|
345
|
+
secureTextEntry: secureTextEntry || type === "password",
|
|
346
|
+
keyboardType,
|
|
347
|
+
textContentType,
|
|
348
|
+
style: [
|
|
349
|
+
{
|
|
350
|
+
color,
|
|
351
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
352
|
+
flex: 1,
|
|
353
|
+
padding: 0,
|
|
354
|
+
textAlign: style?.textAlign || "left"
|
|
355
|
+
},
|
|
356
|
+
style
|
|
357
|
+
],
|
|
358
|
+
placeholderTextColor,
|
|
359
|
+
maxLength,
|
|
360
|
+
testID: dataTestId || id,
|
|
361
|
+
accessibilityLabel: ariaLabel,
|
|
362
|
+
accessibilityHint: ariaDescribedBy,
|
|
363
|
+
accessibilityState: {
|
|
364
|
+
disabled: disabled || ariaDisabled
|
|
365
|
+
},
|
|
366
|
+
accessible: true
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
InputPrimitive.displayName = "InputPrimitive";
|
|
372
|
+
|
|
373
|
+
// ../primitives-native/src/TextArea.tsx
|
|
374
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
375
|
+
import { TextInput as RNTextInput2 } from "react-native";
|
|
376
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
377
|
+
var TextAreaPrimitive = forwardRef2(
|
|
378
|
+
({
|
|
379
|
+
value,
|
|
380
|
+
placeholder,
|
|
381
|
+
onChange,
|
|
382
|
+
onChangeText,
|
|
383
|
+
onFocus,
|
|
384
|
+
onBlur,
|
|
385
|
+
onKeyDown,
|
|
386
|
+
disabled,
|
|
387
|
+
style,
|
|
388
|
+
color,
|
|
389
|
+
fontSize,
|
|
390
|
+
placeholderTextColor,
|
|
391
|
+
maxLength,
|
|
392
|
+
rows,
|
|
393
|
+
id,
|
|
394
|
+
"aria-invalid": ariaInvalid,
|
|
395
|
+
"aria-describedby": ariaDescribedBy,
|
|
396
|
+
"aria-labelledby": ariaLabelledBy,
|
|
397
|
+
"aria-label": ariaLabel,
|
|
398
|
+
"aria-disabled": ariaDisabled,
|
|
399
|
+
"data-testid": dataTestId
|
|
400
|
+
}, ref) => {
|
|
401
|
+
const handleChangeText = (text) => {
|
|
402
|
+
onChangeText?.(text);
|
|
403
|
+
if (onChange) {
|
|
404
|
+
const syntheticEvent = {
|
|
405
|
+
target: { value: text },
|
|
406
|
+
currentTarget: { value: text },
|
|
407
|
+
type: "change",
|
|
408
|
+
nativeEvent: { text },
|
|
409
|
+
preventDefault: () => {
|
|
410
|
+
},
|
|
411
|
+
stopPropagation: () => {
|
|
412
|
+
},
|
|
413
|
+
isTrusted: false
|
|
414
|
+
};
|
|
415
|
+
onChange(syntheticEvent);
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
return /* @__PURE__ */ jsx7(
|
|
419
|
+
RNTextInput2,
|
|
420
|
+
{
|
|
421
|
+
ref,
|
|
422
|
+
value,
|
|
423
|
+
placeholder,
|
|
424
|
+
onChangeText: handleChangeText,
|
|
425
|
+
onFocus,
|
|
426
|
+
onBlur,
|
|
427
|
+
onKeyPress: (e) => {
|
|
428
|
+
if (onKeyDown) {
|
|
429
|
+
onKeyDown({
|
|
430
|
+
key: e.nativeEvent.key,
|
|
431
|
+
preventDefault: () => {
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
editable: !disabled,
|
|
437
|
+
multiline: true,
|
|
438
|
+
numberOfLines: rows || 4,
|
|
439
|
+
style: [
|
|
440
|
+
{
|
|
441
|
+
color,
|
|
442
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
443
|
+
flex: 1,
|
|
444
|
+
padding: 0,
|
|
445
|
+
textAlignVertical: "top",
|
|
446
|
+
textAlign: style?.textAlign || "left"
|
|
447
|
+
},
|
|
448
|
+
style
|
|
449
|
+
],
|
|
450
|
+
placeholderTextColor,
|
|
451
|
+
maxLength,
|
|
452
|
+
testID: dataTestId || id,
|
|
453
|
+
accessibilityLabel: ariaLabel,
|
|
454
|
+
accessibilityHint: ariaDescribedBy,
|
|
455
|
+
accessibilityState: {
|
|
456
|
+
disabled: disabled || ariaDisabled
|
|
457
|
+
},
|
|
458
|
+
accessible: true
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
464
|
+
|
|
465
|
+
// src/Notification.tsx
|
|
466
|
+
import { useDesignSystem } from "@xsolla/xui-core";
|
|
467
|
+
import { X, AlertCircle, Check } from "@xsolla/xui-icons";
|
|
468
|
+
import { jsx as jsx8, jsxs } from "react/jsx-runtime";
|
|
469
|
+
var Notification = ({
|
|
470
|
+
tone = "neutral",
|
|
471
|
+
type = "toast",
|
|
472
|
+
title,
|
|
473
|
+
message,
|
|
474
|
+
actionLabel,
|
|
475
|
+
onAction,
|
|
476
|
+
onClose,
|
|
477
|
+
showClose = true
|
|
478
|
+
}) => {
|
|
479
|
+
const { theme } = useDesignSystem();
|
|
480
|
+
const config = theme.sizing.notification(type);
|
|
481
|
+
const toneConfig = {
|
|
482
|
+
neutral: {
|
|
483
|
+
bg: theme.colors.background.neutral.secondary,
|
|
484
|
+
content: theme.colors.content.neutral.primary,
|
|
485
|
+
icon: theme.colors.content.neutral.primary
|
|
486
|
+
},
|
|
487
|
+
success: {
|
|
488
|
+
bg: theme.colors.background.success.secondary,
|
|
489
|
+
content: theme.colors.content.success.primary,
|
|
490
|
+
icon: theme.colors.content.success.primary
|
|
491
|
+
},
|
|
492
|
+
warning: {
|
|
493
|
+
bg: theme.colors.background.warning.secondary,
|
|
494
|
+
content: theme.colors.content.warning.primary,
|
|
495
|
+
icon: theme.colors.content.warning.primary
|
|
496
|
+
},
|
|
497
|
+
alert: {
|
|
498
|
+
bg: theme.colors.background.alert.secondary,
|
|
499
|
+
content: theme.colors.content.alert.primary,
|
|
500
|
+
icon: theme.colors.content.alert.primary
|
|
501
|
+
}
|
|
502
|
+
}[tone];
|
|
503
|
+
const renderIcon = () => {
|
|
504
|
+
switch (tone) {
|
|
505
|
+
case "success":
|
|
506
|
+
return /* @__PURE__ */ jsx8(Check, { size: config.iconSize, color: toneConfig.icon });
|
|
507
|
+
case "warning":
|
|
508
|
+
case "alert":
|
|
509
|
+
return /* @__PURE__ */ jsx8(AlertCircle, { size: config.iconSize, color: toneConfig.icon });
|
|
510
|
+
default:
|
|
511
|
+
return /* @__PURE__ */ jsx8(AlertCircle, { size: config.iconSize, color: toneConfig.icon });
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
return /* @__PURE__ */ jsxs(
|
|
515
|
+
Box,
|
|
516
|
+
{
|
|
517
|
+
backgroundColor: toneConfig.bg,
|
|
518
|
+
borderRadius: config.radius,
|
|
519
|
+
paddingHorizontal: config.paddingHorizontal,
|
|
520
|
+
paddingVertical: config.paddingVertical,
|
|
521
|
+
width: config.width,
|
|
522
|
+
flexDirection: "row",
|
|
523
|
+
alignItems: type === "inline" ? "center" : "flex-start",
|
|
524
|
+
gap: 16,
|
|
525
|
+
children: [
|
|
526
|
+
/* @__PURE__ */ jsx8(
|
|
527
|
+
Box,
|
|
528
|
+
{
|
|
529
|
+
width: config.iconWrapperSize,
|
|
530
|
+
height: config.iconWrapperSize,
|
|
531
|
+
alignItems: "center",
|
|
532
|
+
justifyContent: "center",
|
|
533
|
+
children: renderIcon()
|
|
534
|
+
}
|
|
535
|
+
),
|
|
536
|
+
/* @__PURE__ */ jsxs(
|
|
537
|
+
Box,
|
|
538
|
+
{
|
|
539
|
+
flex: 1,
|
|
540
|
+
flexDirection: type === "inline" ? "row" : "column",
|
|
541
|
+
gap: type === "inline" ? 28 : config.gap,
|
|
542
|
+
alignItems: type === "inline" ? "center" : "flex-start",
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ jsxs(Box, { flex: 1, gap: 4, children: [
|
|
545
|
+
title && /* @__PURE__ */ jsx8(
|
|
546
|
+
Text,
|
|
547
|
+
{
|
|
548
|
+
color: theme.colors.content.primary,
|
|
549
|
+
fontSize: config.titleSize,
|
|
550
|
+
fontWeight: "500",
|
|
551
|
+
children: title
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
message && /* @__PURE__ */ jsx8(
|
|
555
|
+
Text,
|
|
556
|
+
{
|
|
557
|
+
color: theme.colors.content.secondary,
|
|
558
|
+
fontSize: config.messageSize,
|
|
559
|
+
children: message
|
|
560
|
+
}
|
|
561
|
+
)
|
|
562
|
+
] }),
|
|
563
|
+
actionLabel && /* @__PURE__ */ jsx8(Box, { onPress: onAction, paddingVertical: type === "inline" ? 0 : 8, children: /* @__PURE__ */ jsx8(
|
|
564
|
+
Text,
|
|
565
|
+
{
|
|
566
|
+
color: theme.colors.content.primary,
|
|
567
|
+
fontSize: 16,
|
|
568
|
+
fontWeight: "500",
|
|
569
|
+
letterSpacing: 0.4,
|
|
570
|
+
whiteSpace: "nowrap",
|
|
571
|
+
children: actionLabel
|
|
572
|
+
}
|
|
573
|
+
) })
|
|
574
|
+
]
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
showClose && /* @__PURE__ */ jsx8(Box, { onPress: onClose, marginTop: type === "inline" ? 0 : 2, children: /* @__PURE__ */ jsx8(
|
|
578
|
+
Box,
|
|
579
|
+
{
|
|
580
|
+
width: 24,
|
|
581
|
+
height: 24,
|
|
582
|
+
alignItems: "center",
|
|
583
|
+
justifyContent: "center",
|
|
584
|
+
children: /* @__PURE__ */ jsx8(X, { size: 18, color: theme.colors.content.primary })
|
|
585
|
+
}
|
|
586
|
+
) })
|
|
587
|
+
]
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
};
|
|
591
|
+
export {
|
|
592
|
+
Notification
|
|
593
|
+
};
|
|
594
|
+
//# sourceMappingURL=index.mjs.map
|