1- import { Button , ButtonGroup } from '@srcube-ui/react' ;
2- import { TabPanel , Tabs } from '@srcube-ui/react' ;
1+ import { Button , ButtonGroup , TabPanel , Tabs } from '@srcube-ui/react' ;
32import { createFileRoute } from '@tanstack/react-router' ;
43import type React from 'react' ;
54import { useMemo , useState } from 'react' ;
@@ -31,7 +30,7 @@ const tabsColorGroups = [
3130] as const ;
3231
3332type TabsColor = ( typeof tabsColorGroups ) [ number ] [ number ] [ 'value' ] ;
34- type TabsVariant = 'default' | 'outline' | 'twotone' | 'underline' ;
33+ type TabsVariant = 'default' | 'outline' | 'twotone' | 'flat' | ' underline';
3534type TabsPlacement = 'top' | 'start' | 'end' | 'bottom' ;
3635
3736function Section ( {
@@ -110,22 +109,13 @@ function TabsDemo() {
110109 setBasicValue ( next as DemoTabValue ) ;
111110 } }
112111 >
113- < TabPanel
114- value = "tab-1"
115- className = "rounded-2xl border border-slate-200 bg-white p-4"
116- >
112+ < TabPanel value = "tab-1" className = "mt-2 rounded-2xl bg-white p-4" >
117113 Panel for Tab 1
118114 </ TabPanel >
119- < TabPanel
120- value = "tab-2"
121- className = "rounded-2xl border border-slate-200 bg-white p-4"
122- >
115+ < TabPanel value = "tab-2" className = "mt-2 rounded-2xl bg-white p-4" >
123116 Panel for Tab 2
124117 </ TabPanel >
125- < TabPanel
126- value = "tab-3"
127- className = "rounded-2xl border border-slate-200 bg-white p-4"
128- >
118+ < TabPanel value = "tab-3" className = "mt-2 rounded-2xl bg-white p-4" >
129119 Panel for Tab 3
130120 </ TabPanel >
131121 </ Tabs >
@@ -189,26 +179,29 @@ function TabsDemo() {
189179 >
190180 < TabPanel
191181 value = "tab-a"
192- className = "h-full rounded-2xl border border-slate-200 bg-white p-4 text-sm"
182+ className = "mt-2 h-full rounded-2xl bg-white p-4 text-sm"
193183 >
194184 Panel for Tab A
195185 </ TabPanel >
196186 < TabPanel
197187 value = "tab-b"
198- className = "h-full rounded-2xl border border-slate-200 bg-white p-4 text-sm"
188+ className = "mt-2 h-full rounded-2xl bg-white p-4 text-sm"
199189 >
200190 Panel for Tab B
201191 </ TabPanel >
202192 < TabPanel
203193 value = "tab-c"
204- className = "h-full rounded-2xl border border-slate-200 bg-white p-4 text-sm"
194+ className = "mt-2 h-full rounded-2xl bg-white p-4 text-sm"
205195 >
206196 Panel for Tab C (disabled tab)
207197 </ TabPanel >
208198 </ Tabs >
209199 </ Section >
210200
211- < Section title = "Variant / Color" description = "default / outline / twotone / underline" >
201+ < Section
202+ title = "Variant / Color"
203+ description = "default / outline / twotone / flat / underline"
204+ >
212205 < ButtonGroup size = "sm" isBlock >
213206 < Button
214207 color = { activeVariant === 'default' ? 'primary' : 'default' }
@@ -237,6 +230,15 @@ function TabsDemo() {
237230 >
238231 twotone
239232 </ Button >
233+ < Button
234+ color = { activeVariant === 'flat' ? 'primary' : 'default' }
235+ variant = { activeVariant === 'flat' ? 'solid' : 'flat' }
236+ onTap = { ( ) => {
237+ setActiveVariant ( 'flat' ) ;
238+ } }
239+ >
240+ flat
241+ </ Button >
240242 < Button
241243 color = { activeVariant === 'underline' ? 'primary' : 'default' }
242244 variant = { activeVariant === 'underline' ? 'solid' : 'flat' }
@@ -259,7 +261,9 @@ function TabsDemo() {
259261 { group . map ( ( item ) => (
260262 < Button
261263 key = { item . value }
262- color = { activeColor === item . value ? item . value : 'default' }
264+ color = {
265+ activeColor === item . value ? item . value : 'default'
266+ }
263267 variant = { activeColor === item . value ? 'solid' : 'flat' }
264268 onTap = { ( ) => {
265269 setActiveColor ( item . value ) ;
@@ -284,7 +288,8 @@ function TabsDemo() {
284288 />
285289
286290 < div className = "mt-2 text-xs text-slate-500" >
287- Variant: { activeVariant } / Color: { activeColor } / Selected: { colorValue }
291+ Variant: { activeVariant } / Color: { activeColor } / Selected:{ ' ' }
292+ { colorValue }
288293 </ div >
289294 </ div >
290295 </ Section >
0 commit comments