Skip to content

Commit bbf959a

Browse files
committed
rms styled-system and styled-components usage from Truncate
1 parent 9d3efa3 commit bbf959a

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

packages/react/src/Truncate/Truncate.docs.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
"name": "as",
4242
"type": "React.ElementType",
4343
"defaultValue": "'div'"
44-
},
45-
{
46-
"name": "sx",
47-
"type": "SystemStyleObject",
48-
"deprecated": true
4944
}
5045
],
5146
"subcomponents": []

packages/react/src/Truncate/Truncate.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.Truncate {
2+
--truncate-max-width: ;
3+
24
display: inherit;
35
overflow: hidden;
46
text-overflow: ellipsis;

packages/react/src/Truncate/Truncate.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React from 'react'
22
import {clsx} from 'clsx'
3-
import type {MaxWidthProps} from 'styled-system'
4-
import type {SxProp} from '../sx'
53
import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic'
64
import {BoxWithFallback} from '../internal/components/BoxWithFallback'
75
import classes from './Truncate.module.css'
@@ -10,11 +8,11 @@ type TruncateProps = React.HTMLAttributes<HTMLElement> & {
108
title: string
119
inline?: boolean
1210
expandable?: boolean
13-
} & MaxWidthProps &
14-
SxProp
11+
maxWidth?: number
12+
}
1513

1614
const Truncate = React.forwardRef(function Truncate(
17-
{as, children, className, title, inline, expandable, maxWidth = 125, style, sx, ...rest},
15+
{as, children, className, title, inline, expandable, maxWidth = 125, style, ...rest},
1816
ref,
1917
) {
2018
return (
@@ -33,7 +31,6 @@ const Truncate = React.forwardRef(function Truncate(
3331
typeof maxWidth === 'number' ? `${maxWidth}px` : typeof maxWidth === 'string' ? maxWidth : undefined,
3432
} as React.CSSProperties
3533
}
36-
sx={sx}
3734
>
3835
{children}
3936
</BoxWithFallback>

0 commit comments

Comments
 (0)