Skip to content

Commit ac5e9fb

Browse files
committed
docs(v1-components): Storybook control buttons were migrated to UiButton
1 parent 7e21049 commit ac5e9fb

File tree

8 files changed

+51
-40
lines changed

8 files changed

+51
-40
lines changed

packages/v1-components/storybook/stories/UiAlert.closable.example.vue

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
@hidden="onHidden"
88
/>
99

10-
<button type="button" @click="shown = true">
10+
<UiButton appearance="secondary" @click="shown = true">
1111
Show alert
12-
</button>
12+
</UiButton>
1313
</div>
1414
</template>
1515

1616
<script lang="ts" setup>
1717
import { ref } from 'vue'
1818
1919
import UiAlert from '@/host/components/alert/UiAlert.vue'
20+
import UiButton from '@/host/components/button/UiButton.vue'
2021
2122
const shown = ref(true)
2223
@@ -27,20 +28,11 @@ const onHidden = () => {
2728

2829
<style lang="less" module>
2930
@import (reference) '../../assets/stylesheets/geometry.less';
30-
@import (reference) '../../assets/stylesheets/palette.less';
3131
@import (reference) '../../assets/stylesheets/variables.less';
3232
3333
.container {
3434
display: grid;
3535
gap: @spacing-xs;
36-
}
37-
38-
:global(button) {
39-
width: fit-content;
40-
border: 1px solid @grey-500;
41-
border-radius: @border-radius-sm;
42-
background: #fff;
43-
padding: @spacing-xxs @spacing-xs;
44-
cursor: pointer;
36+
justify-items: start;
4537
}
4638
</style>

packages/v1-components/storybook/stories/UiCollapse.basic.example.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<div style="display: grid; gap: 12px; width: 420px;">
3-
<button type="button" @click="expanded = !expanded">
3+
<UiButton appearance="secondary" @click="expanded = !expanded">
44
{{ expanded ? 'Hide details' : 'Show details' }}
5-
</button>
5+
</UiButton>
66

77
<UiCollapse :expanded="expanded">
88
<div style="border: 1px solid #d5dbe3; border-radius: 8px; background: #f7f9fc; padding: 12px;">
@@ -15,6 +15,7 @@
1515
<script setup lang="ts">
1616
import { ref } from 'vue'
1717
18+
import UiButton from '@/host/components/button/UiButton.vue'
1819
import UiCollapse from '@/host/components/collapse/UiCollapse.vue'
1920
2021
const expanded = ref(false)

packages/v1-components/storybook/stories/UiCollapse.dispose.example.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<div style="display: grid; gap: 12px; width: 420px;">
3-
<button type="button" @click="expanded = !expanded">
3+
<UiButton appearance="secondary" @click="expanded = !expanded">
44
{{ expanded ? 'Unmount content' : 'Mount content' }}
5-
</button>
5+
</UiButton>
66

77
<UiCollapse
88
:expanded="expanded"
@@ -18,6 +18,7 @@
1818
<script setup lang="ts">
1919
import { ref } from 'vue'
2020
21+
import UiButton from '@/host/components/button/UiButton.vue'
2122
import UiCollapse from '@/host/components/collapse/UiCollapse.vue'
2223
2324
const expanded = ref(true)

packages/v1-components/storybook/stories/UiCollapse.stories.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { UiCollapseProperties } from '@/common/components/collapse'
33

44
import { computed, ref, watch } from 'vue'
55

6+
import UiButton from '@/host/components/button/UiButton.vue'
67
import UiCollapse from '@/host/components/collapse/UiCollapse.vue'
78

89
import { COLLAPSE_BEHAVIOUR } from '@/common/components/collapse'
@@ -34,6 +35,7 @@ const meta = {
3435

3536
render: (args: UiCollapseProperties) => ({
3637
components: {
38+
UiButton,
3739
UiCollapse,
3840
},
3941

@@ -54,9 +56,9 @@ const meta = {
5456

5557
template: `
5658
<div style="width: 520px; display: grid; gap: 12px;">
57-
<button type="button" @click="expanded = !expanded">
59+
<UiButton appearance="secondary" @click="expanded = !expanded">
5860
{{ expanded ? 'Hide content' : 'Show content' }}
59-
</button>
61+
</UiButton>
6062
6163
<UiCollapse
6264
:expanded="expanded"

packages/v1-components/storybook/stories/UiCollapseBox.stories.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { UiCollapseBoxProperties } from '@/common/components/collapse-box'
33

44
import { computed, ref, watch } from 'vue'
55

6+
import UiButton from '@/host/components/button/UiButton.vue'
67
import UiCollapseBox from '@/host/components/collapse-box/UiCollapseBox.vue'
78
import UiCollapseGroup from '@/host/components/collapse-box/UiCollapseGroup.vue'
89

@@ -54,6 +55,7 @@ const meta = {
5455

5556
render: (args: UiCollapseBoxProperties) => ({
5657
components: {
58+
UiButton,
5759
UiCollapseBox,
5860
IconSettingsOutlined,
5961
},
@@ -102,9 +104,13 @@ const meta = {
102104
</template>
103105
104106
<template #footer-content>
105-
<button type="button" @click="expanded = false">
107+
<UiButton
108+
appearance="secondary"
109+
style="flex: none; align-self: flex-start;"
110+
@click="expanded = false"
111+
>
106112
Collapse
107-
</button>
113+
</UiButton>
108114
</template>
109115
</UiCollapseBox>
110116
</div>

packages/v1-components/storybook/stories/UiInfobox.closable.example.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
Use closable mode when info can be dismissed by the user.
99
</UiInfobox>
1010

11-
<button
11+
<UiButton
1212
v-if="!shown"
13-
type="button"
13+
appearance="secondary"
14+
style="justify-self: start; width: fit-content;"
1415
@click="shown = true"
1516
>
1617
Show again
17-
</button>
18+
</UiButton>
1819
</div>
1920
</template>
2021

2122
<script setup lang="ts">
2223
import { ref } from 'vue'
2324
25+
import UiButton from '@/host/components/button/UiButton.vue'
2426
import UiInfobox from '@/host/components/infobox/UiInfobox.vue'
2527
2628
const shown = ref(true)

packages/v1-components/storybook/stories/UiInfobox.controlled.example.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<template>
22
<div style="display: grid; gap: 8px; width: 680px;">
33
<div style="display: flex; gap: 8px;">
4-
<button type="button" @click="shown = !shown">
4+
<UiButton
5+
appearance="secondary"
6+
style="flex: none; align-self: flex-start;"
7+
@click="shown = !shown"
8+
>
59
{{ shown ? 'Hide' : 'Show' }}
6-
</button>
10+
</UiButton>
711

8-
<button
9-
type="button"
12+
<UiButton
13+
appearance="secondary"
14+
style="flex: none; align-self: flex-start;"
1015
:disabled="!expandable"
1116
@click="expanded = !expanded"
1217
>
1318
{{ expanded ? 'Collapse' : 'Expand' }}
14-
</button>
19+
</UiButton>
1520
</div>
1621

1722
<UiInfobox
@@ -28,6 +33,7 @@
2833
<script setup lang="ts">
2934
import { ref } from 'vue'
3035
36+
import UiButton from '@/host/components/button/UiButton.vue'
3137
import UiInfobox from '@/host/components/infobox/UiInfobox.vue'
3238
3339
const shown = ref(true)

packages/v1-components/storybook/stories/UiSwitch.controlled.example.vue

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@
1313
</div>
1414

1515
<div :class="$style['controls']">
16-
<button type="button" @click="value = true">
16+
<UiButton
17+
appearance="secondary"
18+
style="flex: none; align-self: flex-start;"
19+
@click="value = true"
20+
>
1721
Set on
18-
</button>
22+
</UiButton>
1923

20-
<button type="button" @click="value = false">
24+
<UiButton
25+
appearance="secondary"
26+
style="flex: none; align-self: flex-start;"
27+
@click="value = false"
28+
>
2129
Set off
22-
</button>
30+
</UiButton>
2331
</div>
2432

2533
<div>
@@ -31,6 +39,7 @@
3139
<script lang="ts" setup>
3240
import { ref } from 'vue'
3341
42+
import UiButton from '@/host/components/button/UiButton.vue'
3443
import UiSwitch from '@/host/components/switch/UiSwitch.vue'
3544
3645
const value = ref(false)
@@ -61,13 +70,5 @@ const value = ref(false)
6170
.controls {
6271
display: inline-flex;
6372
gap: @spacing-xs;
64-
65-
:global(button) {
66-
border: 1px solid @grey-500;
67-
border-radius: @border-radius-sm;
68-
background: #fff;
69-
padding: @spacing-xxs @spacing-xs;
70-
cursor: pointer;
71-
}
7273
}
7374
</style>

0 commit comments

Comments
 (0)