2021-04-22 00:12:47 +12:00
|
|
|
<script>
|
2021-05-04 22:04:42 +12:00
|
|
|
import "@spectrum-css/buttongroup/dist/index-vars.css"
|
|
|
|
export let vertical = false
|
2021-04-22 00:19:10 +12:00
|
|
|
|
2021-05-04 22:04:42 +12:00
|
|
|
function group(element) {
|
|
|
|
const buttons = Array.from(element.getElementsByTagName("button"))
|
2021-05-04 22:32:22 +12:00
|
|
|
buttons.forEach(button => {
|
2021-05-04 22:04:42 +12:00
|
|
|
button.classList.add("spectrum-ButtonGroup-item")
|
|
|
|
})
|
|
|
|
}
|
2021-04-22 00:12:47 +12:00
|
|
|
</script>
|
|
|
|
|
2021-05-04 22:04:42 +12:00
|
|
|
<div
|
|
|
|
use:group
|
|
|
|
class="spectrum-ButtonGroup"
|
|
|
|
class:spectrum-ButtonGroup--vertical={vertical}
|
|
|
|
>
|
|
|
|
<slot />
|
|
|
|
</div>
|