'use client';
import React from 'react';
import ErrorMessage from '../../commons/ErrorMessage';
export const PHXText = ({ as = 'p', children, className, size = 'xs', tone = 'default' }) => {
    const Component = as || 'p';
    const getToneClass = () => {
        switch (tone) {
            case 'subdued':
                return 'text-gray-500';
            case 'error':
                return 'text-red-800';
            default:
                return 'text-gray-700';
        }
    };
    const Element = (React.createElement(Component, { className: `text-${size} ${getToneClass()}  leading-5 ${className} ` }, children));
    if (tone === 'error') {
        return React.createElement(ErrorMessage, { message: children });
    }
    return Element;
};
//# sourceMappingURL=Text.js.map