Skip to content

Commit

Permalink
feat(control): add SControlButtonGroup component
Browse files Browse the repository at this point in the history
  • Loading branch information
NozomuIkuta committed Apr 26, 2024
1 parent c98cb3f commit ac83a51
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/components/SControlButtonGroup.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="SControlButtonGroup">
<slot />
</div>
</template>

<style scoped lang="postcss">
.SControlButtonGroup :deep(.SControlButton) {
display: inline-flex;
justify-content: center;
align-items: center;
.SButton {
border-left-width: 0;
border-radius: 0;
}
&:first-child .SButton {
border-left-width: 1px;
border-radius: 6px 0 0 6px;
}
&:last-child .SButton {
border-radius: 0 6px 6px 0;
}
}
</style>
5 changes: 5 additions & 0 deletions stories/components/SCard.01_Playground.story.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SControlActionBar from 'sefirot/components/SControlActionBar.vue'
import SControlActionBarButton from 'sefirot/components/SControlActionBarButton.vue'
import SControlActionBarCollapse from 'sefirot/components/SControlActionBarCollapse.vue'
import SControlButton from 'sefirot/components/SControlButton.vue'
import SControlButtonGroup from 'sefirot/components/SControlButtonGroup.vue'
import SControlLeft from 'sefirot/components/SControlLeft.vue'
import SControlRight from 'sefirot/components/SControlRight.vue'
import SControlText from 'sefirot/components/SControlText.vue'
Expand Down Expand Up @@ -70,6 +71,10 @@ function state() {
<SCardBlock size="large" class="s-px-24">
<SControl>
<SControlRight>
<SControlButtonGroup>
<SControlButton label="Prev" />
<SControlButton label="Next" />
</SControlButtonGroup>
<SControlButton label="Cancel" />
<SControlButton mode="info" label="Submit" />
</SControlRight>
Expand Down

0 comments on commit ac83a51

Please sign in to comment.