@loomhq/lens 10.92.0 → 10.93.0
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.
|
@@ -9,7 +9,7 @@ declare type VariantsProps = {
|
|
|
9
9
|
export declare const variants: VariantsProps;
|
|
10
10
|
export declare const lineHeightToPx: (size: any) => number;
|
|
11
11
|
declare const TextWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, TextWrapperProps, object>;
|
|
12
|
-
declare const Text: ({ children, size, color, isInline, isDimmed, fontWeight, hasEllipsis, ellipsisLines, variant, htmlTag, alignment, sizeMinMax, ...props }: TextProps & React.ComponentProps<typeof TextWrapper>) => JSX.Element;
|
|
12
|
+
declare const Text: ({ children, size, color, isInline, isDimmed, fontWeight, hasEllipsis, ellipsisLines, noWrap, variant, htmlTag, alignment, sizeMinMax, ...props }: TextProps & React.ComponentProps<typeof TextWrapper>) => JSX.Element;
|
|
13
13
|
export declare const availableSizes: string[];
|
|
14
14
|
export declare const deprecatedSizes: string[];
|
|
15
15
|
export declare const availableFontWeights: string[];
|
|
@@ -24,6 +24,7 @@ interface TextProps {
|
|
|
24
24
|
isInline?: boolean;
|
|
25
25
|
isDimmed?: boolean;
|
|
26
26
|
hasEllipsis?: boolean;
|
|
27
|
+
noWrap?: boolean;
|
|
27
28
|
ellipsisLines?: number;
|
|
28
29
|
htmlTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'span' | 'div';
|
|
29
30
|
children?: React.ReactNode;
|
|
@@ -59,7 +59,9 @@ const TextWrapper = styled.span `
|
|
|
59
59
|
-webkit-box-orient: vertical;
|
|
60
60
|
-webkit-line-clamp: ${props.ellipsisLines};
|
|
61
61
|
`};
|
|
62
|
-
|
|
62
|
+
${props => !props.hasEllipsis &&
|
|
63
|
+
props.noWrap &&
|
|
64
|
+
'white-space: nowrap; overflow: hidden;'};
|
|
63
65
|
${props => props.sizeMinMax &&
|
|
64
66
|
`
|
|
65
67
|
min-height: 0vw;
|
|
@@ -77,11 +79,11 @@ const TextWrapper = styled.span `
|
|
|
77
79
|
`}
|
|
78
80
|
`;
|
|
79
81
|
const Text = (_a) => {
|
|
80
|
-
var { children, size = 'body-md', color, isInline, isDimmed, fontWeight = 'book', hasEllipsis, ellipsisLines, variant, htmlTag = 'span', alignment, sizeMinMax } = _a, props = __rest(_a, ["children", "size", "color", "isInline", "isDimmed", "fontWeight", "hasEllipsis", "ellipsisLines", "variant", "htmlTag", "alignment", "sizeMinMax"]);
|
|
82
|
+
var { children, size = 'body-md', color, isInline, isDimmed, fontWeight = 'book', hasEllipsis, ellipsisLines, noWrap, variant, htmlTag = 'span', alignment, sizeMinMax } = _a, props = __rest(_a, ["children", "size", "color", "isInline", "isDimmed", "fontWeight", "hasEllipsis", "ellipsisLines", "noWrap", "variant", "htmlTag", "alignment", "sizeMinMax"]);
|
|
81
83
|
if (isDimmed) {
|
|
82
84
|
console.warn(textIsDimmedDeprecated);
|
|
83
85
|
}
|
|
84
|
-
return (React.createElement(TextWrapper, Object.assign({ size: variant ? variants[variant].size : size, color: color, isInline: isInline, isDimmed: isDimmed, fontWeight: variant ? variants[variant].fontWeight : fontWeight, hasEllipsis: hasEllipsis, ellipsisLines: ellipsisLines, variant: variant, as: htmlTag, alignment: alignment, sizeMinMax: sizeMinMax }, props), children));
|
|
86
|
+
return (React.createElement(TextWrapper, Object.assign({ size: variant ? variants[variant].size : size, color: color, isInline: isInline, isDimmed: isDimmed, fontWeight: variant ? variants[variant].fontWeight : fontWeight, hasEllipsis: hasEllipsis, ellipsisLines: ellipsisLines, noWrap: noWrap, variant: variant, as: htmlTag, alignment: alignment, sizeMinMax: sizeMinMax }, props), children));
|
|
85
87
|
};
|
|
86
88
|
export const availableSizes = [
|
|
87
89
|
'body-sm',
|