Add pretty labels to button props, ensure button width is always determined by content

This commit is contained in:
Andrew Kingston 2021-06-25 08:55:45 +01:00
parent 5f83ee6813
commit 937479986d
2 changed files with 43 additions and 3 deletions

View File

@ -245,16 +245,49 @@
}, },
{ {
"type": "select", "type": "select",
"label": "Button Type", "label": "Variant",
"key": "type", "key": "type",
"options": ["primary", "secondary", "cta", "warning"], "options": [
{
"label": "Primary",
"value": "primary"
}, {
"label": "Secondary",
"value": "secondary"
},
{
"label": "Action",
"value": "cta"
},
{
"label": "Warning",
"value": "warning"
}
],
"defaultValue": "primary" "defaultValue": "primary"
}, },
{ {
"type": "select", "type": "select",
"label": "Size", "label": "Size",
"key": "size", "key": "size",
"options": ["S", "M", "L", "XL"], "options": [
{
"label": "Small",
"value": "S"
},
{
"label": "Medium",
"value": "M"
},
{
"label": "Large",
"value": "L"
},
{
"label": "Extra large",
"value": "XL"
}
],
"defaultValue": "M" "defaultValue": "M"
}, },
{ {

View File

@ -19,3 +19,10 @@
> >
{text || ""} {text || ""}
</button> </button>
<style>
button {
width: fit-content;
width: -moz-fit-content;
}
</style>