@@ -99,27 +99,66 @@ const Text = forwardRef(function CubeText(allProps: CubeTextProps, ref) {
9999 ) ;
100100} ) ;
101101
102- const _Text = Object . assign ( Text , {
103- Minor : forwardRef ( function MinorText ( props : CubeTextProps , ref ) {
104- return < Text ref = { ref } color = "#minor" { ...props } /> ;
105- } ) ,
106- Danger : forwardRef ( function DangerText ( props : CubeTextProps , ref ) {
107- return < Text ref = { ref } role = "alert" color = "#danger-text" { ...props } /> ;
108- } ) ,
109- Success : forwardRef ( function SuccessText ( props : CubeTextProps , ref ) {
110- return < Text ref = { ref } color = "#success-text" { ...props } /> ;
111- } ) ,
112- Strong : forwardRef ( function StrongText ( props : CubeTextProps < 'strong' > , ref ) {
113- return < Text ref = { ref } as = "strong" preset = "strong" { ...props } /> ;
114- } ) ,
115- Emphasis : forwardRef ( function StrongText ( props : CubeTextProps < 'em' > , ref ) {
116- return < Text ref = { ref } as = "em" preset = "em" { ...props } /> ;
117- } ) ,
118- Selection : forwardRef ( function SelectionText ( props : CubeTextProps , ref ) {
119- return < Text ref = { ref } color = "#dark" fill = "#note.30" { ...props } /> ;
120- } ) ,
102+ const MinorText = tasty ( Text , {
103+ styles : {
104+ color : '#minor' ,
105+ } ,
106+ } ) ;
107+
108+ const DangerText = tasty ( Text , {
109+ role : 'alert' ,
110+ styles : {
111+ color : '#danger-text' ,
112+ } ,
113+ } ) ;
114+
115+ const SuccessText = tasty ( Text , {
116+ styles : {
117+ color : '#success-text' ,
118+ } ,
119+ } ) ;
120+
121+ const StrongText = tasty ( Text , {
122+ as : 'strong' ,
123+ preset : 'strong' ,
121124} ) ;
122125
126+ const EmphasisText = tasty ( Text , {
127+ as : 'em' ,
128+ preset : 'em' ,
129+ } ) ;
130+
131+ const SelectionText = tasty ( Text , {
132+ styles : {
133+ color : '#dark' ,
134+ fill : '#note.30' ,
135+ } ,
136+ } ) ;
137+
138+ const PlaceholderText = tasty ( Text , {
139+ styles : {
140+ opacity : '$disabled-opacity' ,
141+ } ,
142+ } ) ;
143+
144+ const _Text = Object . assign ( Text , {
145+ Minor : MinorText ,
146+ Danger : DangerText ,
147+ Success : SuccessText ,
148+ Strong : StrongText ,
149+ Emphasis : EmphasisText ,
150+ Selection : SelectionText ,
151+ Placeholder : PlaceholderText ,
152+ } ) as typeof Text & {
153+ Minor : typeof MinorText ;
154+ Danger : typeof DangerText ;
155+ Success : typeof SuccessText ;
156+ Strong : typeof StrongText ;
157+ Emphasis : typeof EmphasisText ;
158+ Selection : typeof SelectionText ;
159+ Placeholder : typeof PlaceholderText ;
160+ } ;
161+
123162_Text . displayName = 'Text' ;
124163
125164export { _Text as Text } ;
0 commit comments