@@ -84,15 +84,18 @@ export const Gallery: Story = {
8484}
8585
8686/**
87- * A `Card` grouping content under a titled, bordered surface. `variant`
88- * tints the background (`secondary`/`danger`) or leaves it untouched
89- * (`primary`/`ghost`); `interactive` strengthens the border on hover and
90- * tints each row's (`Stack`) background. `collapsible` + `defaultCollapsed`
87+ * A `Card` grouping content under a titled, bordered surface. `secondary`
88+ * tints the background with no border; `ghost` and `primary` are untinted.
89+ * `info`/`success`/`warning`/`danger` each draw a light body tint, a
90+ * stronger same-hue header bar, and a matching border. `interactive`
91+ * strengthens the border on hover (same hue for the four semantic variants)
92+ * and tints each row's (`Stack`) background. `collapsible` + `defaultCollapsed`
9193 * control the initial collapse state; clear `title` to confirm the header
9294 * (and its chevron) still renders without one.
9395 */
9496interface CardArgs {
95- variant : 'primary' | 'secondary' | 'ghost' | 'danger'
97+ variant : 'primary' | 'secondary' | 'ghost' | 'danger' | 'info' | 'success' | 'warning'
98+ rowVariant : 'primary' | 'secondary' | 'ghost' | 'danger' | 'info' | 'success' | 'warning'
9699 interactive : boolean
97100 title : string
98101 collapsible : boolean
@@ -101,23 +104,24 @@ interface CardArgs {
101104
102105export const Card : StoryObj < Meta < CardArgs > > = {
103106 argTypes : {
104- variant : { control : 'select' , options : [ 'primary' , 'secondary' , 'ghost' , 'danger' ] } ,
107+ variant : { control : 'select' , options : [ 'primary' , 'secondary' , 'ghost' , 'danger' , 'info' , 'success' , 'warning' ] } ,
108+ rowVariant : { control : 'select' , options : [ 'primary' , 'secondary' , 'ghost' , 'danger' , 'info' , 'success' , 'warning' ] } ,
105109 interactive : { control : 'boolean' } ,
106110 title : { control : 'text' } ,
107111 collapsible : { control : 'boolean' } ,
108112 defaultCollapsed : { control : 'boolean' } ,
109113 } ,
110- args : { variant : 'primary' , interactive : false , title : 'Plugin' , collapsible : true , defaultCollapsed : false } ,
114+ args : { variant : 'primary' , rowVariant : 'ghost' , interactive : false , title : 'Plugin' , collapsible : true , defaultCollapsed : false } ,
111115 render : args => renderSpec ( ( ) => ( {
112116 root : 'root' ,
113117 state : { } ,
114118 elements : {
115119 root : { type : 'Card' , props : { title : args . title , collapsible : args . collapsible , defaultCollapsed : args . defaultCollapsed , variant : args . variant , interactive : args . interactive } , children : [ 'body' ] } ,
116120 body : { type : 'Stack' , props : { direction : 'column' , gap : 4 , padding : 4 } , children : [ 'row1' , 'row2' ] } ,
117- row1 : { type : 'Stack' , props : { direction : 'row' , gap : 8 , align : 'center' , interactive : args . interactive } , children : [ 't' , 'badge' ] } ,
121+ row1 : { type : 'Stack' , props : { direction : 'row' , gap : 8 , align : 'center' , variant : args . rowVariant , interactive : args . interactive } , children : [ 't' , 'badge' ] } ,
118122 t : { type : 'Text' , props : { text : 'vite-plugin-inspect' , variant : 'code' } } ,
119123 badge : { type : 'Badge' , props : { text : 'enabled' , variant : 'success' } } ,
120- row2 : { type : 'Stack' , props : { direction : 'row' , gap : 8 , align : 'center' , interactive : args . interactive } , children : [ 't2' , 'badge2' ] } ,
124+ row2 : { type : 'Stack' , props : { direction : 'row' , gap : 8 , align : 'center' , variant : args . rowVariant , interactive : args . interactive } , children : [ 't2' , 'badge2' ] } ,
121125 t2 : { type : 'Text' , props : { text : 'vite-plugin-vue' , variant : 'code' } } ,
122126 badge2 : { type : 'Badge' , props : { text : 'enabled' , variant : 'success' } } ,
123127 } ,
0 commit comments