@@ -82,6 +82,14 @@ const meta: any = {
8282 defaultValue : { summary : 'medium' } ,
8383 } ,
8484 } ,
85+ type : {
86+ options : [ 'card' , 'plain' , 'popover' ] ,
87+ control : { type : 'radio' } ,
88+ description : 'Visual type of the ListBox' ,
89+ table : {
90+ defaultValue : { summary : 'card' } ,
91+ } ,
92+ } ,
8593 header : {
8694 control : { type : 'text' } ,
8795 description : 'Custom header content' ,
@@ -1392,3 +1400,102 @@ export const AllValuePropsExample: Story = {
13921400 } ,
13931401 } ,
13941402} ;
1403+
1404+ export const TypeVariants : Story = {
1405+ render : ( ) => (
1406+ < Space gap = "4x" flow = "column" >
1407+ < div >
1408+ < Text preset = "t3" weight = "600" >
1409+ Card Type (default)
1410+ </ Text >
1411+ < Text preset = "t4" color = "#dark.60" >
1412+ Standard card styling with border and margin
1413+ </ Text >
1414+ < Space height = "1x" />
1415+ < ListBox
1416+ type = "card"
1417+ label = "Select a fruit"
1418+ selectionMode = "single"
1419+ defaultSelectedKey = "apple"
1420+ >
1421+ { fruits . slice ( 0 , 4 ) . map ( ( fruit ) => (
1422+ < ListBox . Item key = { fruit . key } > { fruit . label } </ ListBox . Item >
1423+ ) ) }
1424+ </ ListBox >
1425+ </ div >
1426+
1427+ < div >
1428+ < Text preset = "t3" weight = "600" >
1429+ Plain Type
1430+ </ Text >
1431+ < Text preset = "t4" color = "#dark.60" >
1432+ No border, no margin, no radius - suitable for embedded use
1433+ </ Text >
1434+ < Space height = "1x" />
1435+ < ListBox
1436+ type = "plain"
1437+ label = "Select a fruit"
1438+ selectionMode = "single"
1439+ defaultSelectedKey = "banana"
1440+ >
1441+ { fruits . slice ( 0 , 4 ) . map ( ( fruit ) => (
1442+ < ListBox . Item key = { fruit . key } > { fruit . label } </ ListBox . Item >
1443+ ) ) }
1444+ </ ListBox >
1445+ </ div >
1446+
1447+ < div >
1448+ < Text preset = "t3" weight = "600" >
1449+ Popover Type
1450+ </ Text >
1451+ < Text preset = "t4" color = "#dark.60" >
1452+ No border, but keeps margin and radius - suitable for overlay use
1453+ </ Text >
1454+ < Space height = "1x" />
1455+ < ListBox
1456+ type = "popover"
1457+ label = "Select a fruit"
1458+ selectionMode = "single"
1459+ defaultSelectedKey = "cherry"
1460+ >
1461+ { fruits . slice ( 0 , 4 ) . map ( ( fruit ) => (
1462+ < ListBox . Item key = { fruit . key } > { fruit . label } </ ListBox . Item >
1463+ ) ) }
1464+ </ ListBox >
1465+ </ div >
1466+
1467+ < div >
1468+ < Text preset = "t3" weight = "600" >
1469+ Plain Type with Sections
1470+ </ Text >
1471+ < Text preset = "t4" color = "#dark.60" >
1472+ Section margins are preserved even with plain type
1473+ </ Text >
1474+ < Space height = "1x" />
1475+ < ListBox
1476+ type = "plain"
1477+ label = "Select food items"
1478+ selectionMode = "single"
1479+ defaultSelectedKey = "carrot"
1480+ >
1481+ < ListBox . Section title = "Fruits" >
1482+ < ListBox . Item key = "apple" > Apple</ ListBox . Item >
1483+ < ListBox . Item key = "banana" > Banana</ ListBox . Item >
1484+ </ ListBox . Section >
1485+ < ListBox . Section title = "Vegetables" >
1486+ < ListBox . Item key = "carrot" > Carrot</ ListBox . Item >
1487+ < ListBox . Item key = "broccoli" > Broccoli</ ListBox . Item >
1488+ </ ListBox . Section >
1489+ </ ListBox >
1490+ </ div >
1491+ </ Space >
1492+ ) ,
1493+ parameters : {
1494+ docs : {
1495+ description : {
1496+ story :
1497+ 'The `type` prop controls the visual styling of the ListBox. Use `card` for standalone use, `plain` for embedded use without decoration, and `popover` for use inside overlays where borders are handled by the container.' ,
1498+ } ,
1499+ } ,
1500+ } ,
1501+ } ;
0 commit comments