File tree Expand file tree Collapse file tree 8 files changed +51
-40
lines changed
packages/v1-components/storybook/stories Expand file tree Collapse file tree 8 files changed +51
-40
lines changed Original file line number Diff line number Diff line change 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>
1717import { ref } from ' vue'
1818
1919import UiAlert from ' @/host/components/alert/UiAlert.vue'
20+ import UiButton from ' @/host/components/button/UiButton.vue'
2021
2122const 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 >
Original file line number Diff line number Diff line change 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 ;" >
1515<script setup lang="ts">
1616import { ref } from ' vue'
1717
18+ import UiButton from ' @/host/components/button/UiButton.vue'
1819import UiCollapse from ' @/host/components/collapse/UiCollapse.vue'
1920
2021const expanded = ref (false )
Original file line number Diff line number Diff line change 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"
1818<script setup lang="ts">
1919import { ref } from ' vue'
2020
21+ import UiButton from ' @/host/components/button/UiButton.vue'
2122import UiCollapse from ' @/host/components/collapse/UiCollapse.vue'
2223
2324const expanded = ref (true )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { UiCollapseProperties } from '@/common/components/collapse'
33
44import { computed , ref , watch } from 'vue'
55
6+ import UiButton from '@/host/components/button/UiButton.vue'
67import UiCollapse from '@/host/components/collapse/UiCollapse.vue'
78
89import { 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"
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { UiCollapseBoxProperties } from '@/common/components/collapse-box'
33
44import { computed , ref , watch } from 'vue'
55
6+ import UiButton from '@/host/components/button/UiButton.vue'
67import UiCollapseBox from '@/host/components/collapse-box/UiCollapseBox.vue'
78import 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>
Original file line number Diff line number Diff line change 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">
2223import { ref } from ' vue'
2324
25+ import UiButton from ' @/host/components/button/UiButton.vue'
2426import UiInfobox from ' @/host/components/infobox/UiInfobox.vue'
2527
2628const shown = ref (true )
Original file line number Diff line number Diff line change 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
2833<script setup lang="ts">
2934import { ref } from ' vue'
3035
36+ import UiButton from ' @/host/components/button/UiButton.vue'
3137import UiInfobox from ' @/host/components/infobox/UiInfobox.vue'
3238
3339const shown = ref (true )
Original file line number Diff line number Diff line change 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 >
3139<script lang="ts" setup>
3240import { ref } from ' vue'
3341
42+ import UiButton from ' @/host/components/button/UiButton.vue'
3443import UiSwitch from ' @/host/components/switch/UiSwitch.vue'
3544
3645const 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 >
You can’t perform that action at this time.
0 commit comments