1import React, { forwardRef } from 'react';
2import { StyleSheet, Platform } from 'react-native';
3import { em } from '../css/units';
4import Text from '../primitives/Text';
5import View from '../primitives/View';
6export const P = forwardRef(({ style, ...props }, ref) => {
7    return React.createElement(Text, { ...props, style: [styles.p, style], ref: ref });
8});
9export const B = forwardRef(({ style, ...props }, ref) => {
10    return React.createElement(Text, { ...props, style: [styles.b, style], ref: ref });
11});
12export const S = forwardRef(({ style, ...props }, ref) => {
13    return React.createElement(Text, { ...props, style: [styles.s, style], ref: ref });
14});
15export const I = forwardRef(({ style, ...props }, ref) => {
16    return React.createElement(Text, { ...props, style: [styles.i, style], ref: ref });
17});
18export const Q = forwardRef(({ children, cite, style, ...props }, ref) => {
19    return (React.createElement(Text, { ...props, style: [styles.q, style], ref: ref },
20        "\"",
21        children,
22        "\""));
23});
24export const BlockQuote = forwardRef(({ style, cite, ...props }, ref) => {
25    return React.createElement(View, { ...props, style: [styles.blockQuote, style], ref: ref });
26});
27export const BR = forwardRef(({ style, ...props }, ref) => {
28    return React.createElement(Text, { ...props, style: [styles.br, style], ref: ref });
29});
30export const Mark = forwardRef(({ style, ...props }, ref) => {
31    return React.createElement(Text, { ...props, style: [styles.mark, style], ref: ref });
32});
33export const Code = forwardRef(({ style, ...props }, ref) => {
34    return React.createElement(Text, { ...props, style: [styles.code, style], ref: ref });
35});
36function isTextProps(props) {
37    return typeof props.children === 'string';
38}
39export const Pre = forwardRef((props, ref) => {
40    if (isTextProps(props)) {
41        return React.createElement(Text, { ...props, style: [styles.code, styles.pre, props.style], ref: ref });
42    }
43    return React.createElement(View, { ...props, style: [styles.pre, props.style], ref: ref });
44});
45// Extract dateTime to prevent passing it to the native Text element
46export const Time = forwardRef(({ dateTime, ...props }, ref) => {
47    return React.createElement(Text, { ...props, ref: ref });
48});
49export const Strong = B;
50export const Del = S;
51export const EM = I;
52export const Span = Text;
53const styles = StyleSheet.create({
54    p: {
55        marginVertical: em(1),
56    },
57    b: {
58        fontWeight: 'bold',
59    },
60    q: {
61        fontStyle: 'italic',
62    },
63    code: {
64        fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),
65        fontWeight: '500',
66    },
67    pre: {
68        marginVertical: em(1),
69    },
70    blockQuote: {
71        marginVertical: em(1),
72    },
73    br: {
74        width: 0,
75        height: em(0.5),
76    },
77    s: {
78        textDecorationLine: 'line-through',
79        textDecorationStyle: 'solid',
80    },
81    mark: {
82        backgroundColor: 'yellow',
83        color: 'black',
84    },
85    i: {
86        fontStyle: 'italic',
87    },
88});
89//# sourceMappingURL=Text.js.map