@dtdot/lego 2.0.0-20 → 2.0.0-22
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.
- package/build/components/InlineCard/_InlineCardContent.component.js +2 -0
- package/build/components/InlineCard/_InlineCardMeta.component.js +1 -0
- package/build/components/Table/Table.component.js +1 -0
- package/build/components/Table/_TableRow.component.js +4 -0
- package/build/components/Text/Text.component.d.ts +2 -1
- package/build/components/Text/Text.component.js +21 -3
- package/package.json +1 -1
|
@@ -9,6 +9,10 @@ const StyledRow = styled.tr `
|
|
|
9
9
|
&:last-child {
|
|
10
10
|
box-shadow: none;
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: ${(props) => props.theme.colours.cardBackground};
|
|
15
|
+
}
|
|
12
16
|
`;
|
|
13
17
|
const TableRow = ({ children, 'data-testid': dataTestId }) => {
|
|
14
18
|
const { variant } = useContext(TableContext);
|
|
@@ -3,7 +3,8 @@ export type TextVariant = 'primary' | 'secondary';
|
|
|
3
3
|
export interface TextProps {
|
|
4
4
|
'children': React.ReactNode;
|
|
5
5
|
'variant'?: TextVariant;
|
|
6
|
+
'noWrap'?: boolean;
|
|
6
7
|
'data-testid'?: string;
|
|
7
8
|
}
|
|
8
|
-
declare const Text: ({ children, variant, "data-testid": dataTestId }: TextProps) => JSX.Element;
|
|
9
|
+
declare const Text: ({ children, variant, noWrap, "data-testid": dataTestId }: TextProps) => JSX.Element;
|
|
9
10
|
export default Text;
|
|
@@ -6,6 +6,15 @@ const TextContainer = styled.span `
|
|
|
6
6
|
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
7
7
|
|
|
8
8
|
color: ${(props) => props.theme.colours.defaultFont};
|
|
9
|
+
|
|
10
|
+
${(props) => props.noWrap &&
|
|
11
|
+
`
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
text-overflow: ellipsis;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
`}
|
|
9
18
|
`;
|
|
10
19
|
const TextContainerSecondary = styled.span `
|
|
11
20
|
font-family: ${(props) => props.theme.fonts.default.family};
|
|
@@ -13,14 +22,23 @@ const TextContainerSecondary = styled.span `
|
|
|
13
22
|
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
14
23
|
|
|
15
24
|
color: ${(props) => props.theme.colours.secondaryFont};
|
|
25
|
+
|
|
26
|
+
${(props) => props.noWrap &&
|
|
27
|
+
`
|
|
28
|
+
white-space: nowrap;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
text-overflow: ellipsis;
|
|
31
|
+
display: inline-block;
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
`}
|
|
16
34
|
`;
|
|
17
|
-
const Text = ({ children, variant = 'primary', 'data-testid': dataTestId }) => {
|
|
35
|
+
const Text = ({ children, variant = 'primary', noWrap, 'data-testid': dataTestId }) => {
|
|
18
36
|
switch (variant) {
|
|
19
37
|
case 'secondary':
|
|
20
|
-
return React.createElement(TextContainerSecondary, { "data-testid": dataTestId }, children);
|
|
38
|
+
return (React.createElement(TextContainerSecondary, { noWrap: noWrap, "data-testid": dataTestId }, children));
|
|
21
39
|
case 'primary':
|
|
22
40
|
default:
|
|
23
|
-
return React.createElement(TextContainer, { "data-testid": dataTestId }, children);
|
|
41
|
+
return (React.createElement(TextContainer, { noWrap: noWrap, "data-testid": dataTestId }, children));
|
|
24
42
|
}
|
|
25
43
|
};
|
|
26
44
|
export default Text;
|