Skip to content

Commit 0166404

Browse files
committed
LITE-30099: Update button component to match the design
1 parent 1b42903 commit 0166404

File tree

7 files changed

+735
-64
lines changed

7 files changed

+735
-64
lines changed

components/src/stories/Button.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Meta, ArgsTable } from '@storybook/blocks';
2+
import { Figma } from '@storybook/addon-designs/blocks';
3+
4+
<Meta title="Components/Button/Design" />
5+
6+
# Button Design Specification
7+
8+
<Figma
9+
url="https://www.figma.com/file/iWvG1cSD2xzbGS2KAB1DgV/Connect-UI-Guides-%26-Specs?type=design&node-id=1-4009&mode=design&t=5CPLKuHbPQnKMEJh-0"
10+
height="1000%"
11+
/>
12+
<ArgsTable of={Figma} />
Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
1+
import * as icons from '@cloudblueconnect/material-svg';
12
import Button from '~widgets/button/widget.vue';
23
import registerWidget from '~core/registerWidget';
34

45
registerWidget('ui-button', Button);
56

6-
export const Component = {
7+
export const Base = {
8+
name: 'Base component',
79
render: (args) => ({
810
setup() {
9-
return { args };
11+
const showAlert = () => alert('The button was clicked');
12+
return { args, showAlert };
1013
},
11-
template: `<ui-button disabled v-bind="args"></ui-button>`,
14+
template: '<ui-button v-bind="args" @clicked="showAlert" />',
1215
}),
16+
args: {
17+
mode: 'solid',
18+
size: 'large',
19+
label: 'Accept',
20+
icon: 'googleCheckBaseline',
21+
iconRight: '',
22+
color: '#2C98F0',
23+
progress: false,
24+
lowerCase: false,
25+
onlyIcon: false,
26+
disabled: false,
27+
},
28+
};
1329

30+
export const Slotted = {
31+
name: 'Using the default slot',
32+
render: (args) => ({
33+
setup() {
34+
const showAlert = () => alert('The button was clicked');
35+
return { args, showAlert };
36+
},
37+
template:
38+
'<ui-button v-bind="args" @clicked="showAlert"><pre style="background-color:darkblue;color:lightcyan;font-style:italic;">Custom slot content</pre></ui-button>',
39+
}),
1440
args: {
15-
text: 'Text',
41+
...Base.args,
42+
label: '',
1643
},
1744
};
1845

@@ -23,6 +50,25 @@ export default {
2350
layout: 'centered',
2451
},
2552
argTypes: {
26-
text: 'text',
53+
mode: { control: 'radio', options: ['solid', 'flat', 'outlined'] },
54+
size: { control: 'radio', options: ['small', 'large'] },
55+
label: 'text',
56+
icon: {
57+
options: Object.keys(icons),
58+
control: {
59+
type: 'select',
60+
},
61+
},
62+
iconRight: {
63+
options: Object.keys(icons),
64+
control: {
65+
type: 'select',
66+
},
67+
},
68+
color: 'text',
69+
progress: 'boolean',
70+
lowerCase: 'boolean',
71+
onlyIcon: 'boolean',
72+
disabled: 'boolean',
2773
},
2874
};

0 commit comments

Comments
 (0)