Skip to content

Commit f400a91

Browse files
committed
action bar
1 parent 511c460 commit f400a91

File tree

2 files changed

+48
-29
lines changed

2 files changed

+48
-29
lines changed

packages/uui-action-bar/lib/uui-action-bar.story.ts

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@ import '@umbraco-ui/uui-icon-registry-essential/lib';
66

77
import { html } from 'lit-html';
88

9-
import {
10-
InterfaceLookNames,
11-
InterfaceLookType,
12-
} from '@umbraco-ui/uui-base/lib/types';
13-
149
export default {
1510
id: 'uui-action-bar',
1611
title: 'Buttons/Action Bar',
1712
component: 'uui-action-bar',
1813
args: {
19-
look: '',
14+
look: 'primary',
15+
color: 'primary',
2016
},
2117
argTypes: {
2218
look: {
2319
control: {
2420
type: 'select',
2521
},
26-
options: InterfaceLookNames,
22+
options: ['default', 'primary', 'secondary', 'outline', 'placeholder'],
23+
},
24+
color: {
25+
control: {
26+
type: 'select',
27+
},
28+
options: ['primary', 'positive', 'warning', 'danger'],
2729
},
2830
},
2931
};
@@ -34,7 +36,10 @@ export const AAAOverview: Story = props => html`
3436
<uui-icon-registry-essential>
3537
<uui-action-bar
3638
>${buttons.map(
37-
el => html` <uui-button label="${el}" look="${props.look}">
39+
el => html` <uui-button
40+
label="${el}"
41+
look="${props.look}"
42+
color="${props.color}">
3843
<uui-icon name="${el}"></uui-icon>
3944
</uui-button>`
4045
)}
@@ -55,38 +60,52 @@ export const Single = () =>
5560
</uui-icon-registry-essential>
5661
`;
5762

58-
export const Looks = () => html`
59-
<uui-icon-registry-essential>
60-
${InterfaceLookNames.map(
61-
(lookName: InterfaceLookType) =>
62-
html` <div>${lookName}</div>
63-
<uui-action-bar>
64-
${buttons.map(
65-
button => html`<uui-button label="${button}" .look=${lookName}>
66-
<uui-icon name="${button}"></uui-icon>
67-
</uui-button>`
68-
)} </uui-action-bar
69-
><br /><br />`
70-
)}
71-
</uui-icon-registry-essential>
72-
`;
63+
export const LooksAndColors = () => {
64+
const looks = ['default', 'primary', 'secondary', 'outline', 'placeholder'];
65+
const colors = ['primary', 'positive', 'warning', 'danger'];
66+
67+
return html`
68+
<uui-icon-registry-essential>
69+
${colors.map(
70+
color =>
71+
html`<div
72+
style="display: grid; grid-template-columns: repeat( auto-fill, 100px ); gap: 16px; margin-bottom: 32px">
73+
${looks.map(
74+
look => html`
75+
<uui-action-bar
76+
>${buttons.map(
77+
el => html` <uui-button
78+
label="${el}"
79+
.look="${look}"
80+
.color="${color}">
81+
<uui-icon name="${el}"></uui-icon>
82+
</uui-button>`
83+
)}
84+
</uui-action-bar>
85+
`
86+
)}
87+
</div> `
88+
)}
89+
</uui-icon-registry-essential>
90+
`;
91+
};
7392

74-
Looks.parameters = {
93+
LooksAndColors.parameters = {
7594
docs: {
7695
source: {
7796
code: `
7897
<uui-icon-registry-essential>
7998
<uui-action-bar>
8099
81-
<uui-button look="[look]" label="Copy">
100+
<uui-button look="[look]" color="[color]" label="Copy">
82101
<uui-icon name="copy"></uui-icon>
83102
</uui-button>
84103
85-
<uui-button look="[look]" label="Remove">
104+
<uui-button look="[look]" color="[color]" label="Remove">
86105
<uui-icon name="remove"></uui-icon>
87106
</uui-button>
88107
89-
<uui-button look="[look]" label="Delete">
108+
<uui-button look="[look]" color="[color]" label="Delete">
90109
<uui-icon name="delete"></uui-icon>
91110
</uui-button>
92111

packages/uui-button/lib/uui-button.element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export class UUIButtonElement extends FormControlMixin(
341341

342342
/**
343343
* Changes the look of the button to one of the predefined, symbolic looks. For example - set this to positive if you want nice, green "confirm" button.
344-
* @type {""default" | "primary" | "secondary" | "outline" | "placeholder""}
344+
* @type {"default" | "primary" | "secondary" | "outline" | "placeholder"}
345345
* @attr
346346
* @default "default"
347347
*/
@@ -350,7 +350,7 @@ export class UUIButtonElement extends FormControlMixin(
350350

351351
/**
352352
* Changes the look of the button to one of the predefined, symbolic looks. For example - set this to positive if you want nice, green "confirm" button.
353-
* @type {""primary" | "positive" | "warning" | "danger""}
353+
* @type {"primary" | "positive" | "warning" | "danger"}
354354
* @attr
355355
* @default "primary"
356356
*/

0 commit comments

Comments
 (0)