'use client'; import { createAlert } from '@gluestack-ui/core/alert/creator'; import { UIIcon } from '@gluestack-ui/core/icon/creator'; import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils'; import { tva, useStyleContext, withStyleContext } from '@gluestack-ui/utils/nativewind-utils'; import { styled } from 'nativewind'; import React from 'react'; import { Text, View } from 'react-native'; const SCOPE = 'ALERT'; const alertStyle = tva({ base: 'rounded-lg border px-2.5 py-2 flex-row gap-2 items-start ', variants: { variant: { default: 'bg-card border-border', destructive: 'bg-card border-destructive', }, }, }); const alertTextStyle = tva({ base: 'font-medium tracking-tight text-sm flex-1', parentVariants: { variant: { default: 'text-card-foreground', destructive: 'text-destructive', }, }, }); const alertIconStyle = tva({ base: 'fill-none w-4 h-4 mt-0.5', parentVariants: { variant: { default: 'text-card-foreground', destructive: 'text-destructive', }, }, }); const StyledUIIcon = styled(UIIcon, { className: "style", }); export const UIAlert = createAlert({ Root: withStyleContext(View, SCOPE), Text: Text, Icon: StyledUIIcon, }); type IAlertProps = Omit< React.ComponentPropsWithoutRef, 'context' > & VariantProps; const Alert = React.forwardRef, IAlertProps>( function Alert({ className, variant = 'default', ...props }, ref) { return ( ); } ); type IAlertTextProps = React.ComponentPropsWithoutRef & VariantProps; const AlertText = React.forwardRef< React.ComponentRef, IAlertTextProps >(function AlertText({ className, ...props }, ref) { const { variant: parentVariant } = useStyleContext(SCOPE); return ( ); }); type IAlertIconProps = React.ComponentPropsWithoutRef & VariantProps & { height?: number; width?: number; }; const AlertIcon = React.forwardRef< React.ComponentRef, IAlertIconProps >(function AlertIcon({ className, ...props }, ref) { const { variant: parentVariant } = useStyleContext(SCOPE); return ( ); }); Alert.displayName = 'Alert'; AlertText.displayName = 'AlertText'; AlertIcon.displayName = 'AlertIcon'; export { Alert, AlertIcon, AlertText };