@clds/component-enhancer
Advanced tools
Comparing version 0.51.0 to 0.51.1
import React, { ComponentProps, FC, ReactNode } from 'react'; | ||
export declare const useWrapTextChildren: (children?: ReactNode) => (number | Iterable<React.ReactNode> | React.JSX.Element)[]; | ||
export declare const useWrapTextChildren: (children?: ReactNode) => (number | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element)[]; | ||
export declare const WrapTextChildren: FC<{ | ||
children: ReactNode; | ||
}>; | ||
export declare const withTextWrap: <Type extends React.ComponentType<{}>>(WrappedComponent: string | Type) => (props: React.ComponentProps<Type>) => React.JSX.Element; | ||
export declare const withTextWrap: <Type extends React.ComponentType<{}>>(WrappedComponent: string | Type) => (props: React.ComponentProps<Type>) => import("react/jsx-runtime").JSX.Element; | ||
export declare const TextWrap: import("styled-components").StyledComponent<"span", any, {}, never>; |
@@ -0,1 +1,2 @@ | ||
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; | ||
import React, { isValidElement, useMemo, } from 'react'; | ||
@@ -18,11 +19,10 @@ import { default as styled } from 'styled-components'; | ||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions | ||
return typeof child === 'string' || isFormattedMessage ? (React.createElement(TextWrap, { key: `${child}-${idx}` }, child)) : (child); | ||
return typeof child === 'string' || isFormattedMessage ? (_jsx(TextWrap, { children: child }, `${child}-${idx}`)) : (child); | ||
}), [children]); | ||
}; | ||
export const WrapTextChildren = ({ children }) => (React.createElement(React.Fragment, null, useWrapTextChildren(children))); | ||
export const WrapTextChildren = ({ children }) => (_jsx(_Fragment, { children: useWrapTextChildren(children) })); | ||
export const withTextWrap = (WrappedComponent) => | ||
// eslint-disable-next-line react/display-name | ||
(props) => (React.createElement(TextWrap, null, | ||
React.createElement(WrappedComponent, { ...props }))); | ||
(props) => (_jsx(TextWrap, { children: _jsx(WrappedComponent, { ...props }) })); | ||
export const TextWrap = styled.span ``; | ||
//# sourceMappingURL=textWrap.js.map |
{ | ||
"name": "@clds/component-enhancer", | ||
"description": "", | ||
"version": "0.51.0", | ||
"version": "0.51.1", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "author": "Cloudinary", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
52145