Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions packages/react/src/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type React from 'react'
import {type ForwardedRef} from 'react'
import classes from './Text.module.css'
import {fixedForwardRef, type PolymorphicProps} from '../utils/modern-polymorphic'
import {mergeProps} from '../utils/mergeProps'

export type TextProps<As extends React.ElementType = 'span'> = PolymorphicProps<
As,
Expand All @@ -21,13 +22,17 @@ function Text<As extends React.ElementType>(props: TextProps<As>, ref: Forwarded

return (
<Component
className={clsx(className, classes.Text)}
data-component="Text"
data-size={size}
data-weight={weight}
data-white-space={whiteSpace}
{...rest}
ref={ref}
{...mergeProps(
{
className: clsx(classes.Text, className),
'data-component': 'Text',
'data-size': size,
'data-weight': weight,
'data-white-space': whiteSpace,
},
rest,
)}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ exports[`TextInputWithTokens > renders a truncated set of tokens 1`] = `
</span>
</span>
<span
class="prc-TextInputWithTokens-OverflowCountXLarge-zydSJ prc-Text-Text-jAl-N"
class="prc-Text-Text-jAl-N prc-TextInputWithTokens-OverflowCountXLarge-zydSJ"
data-component="TextInputWithTokens.OverflowCount"
>
+
Expand Down Expand Up @@ -1217,7 +1217,7 @@ exports[`TextInputWithTokens > renders a truncated set of tokens 1`] = `
</span>
</span>
<span
class="prc-TextInputWithTokens-OverflowCountXLarge-zydSJ prc-Text-Text-jAl-N"
class="prc-Text-Text-jAl-N prc-TextInputWithTokens-OverflowCountXLarge-zydSJ"
data-component="TextInputWithTokens.OverflowCount"
>
+
Expand Down
Loading