Skip to content

Commit 5b309e4

Browse files
committed
adjust for stories
1 parent 4403adf commit 5b309e4

File tree

8 files changed

+35
-11
lines changed

8 files changed

+35
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const meta: Meta = {
2121
},
2222
color: {
2323
control: { type: 'select' },
24-
options: ['default', 'positive', 'warning', 'danger'],
24+
options: ['default', 'positive', 'warning', 'danger', 'invalid'],
2525
},
2626
},
2727
parameters: {
@@ -67,7 +67,7 @@ export const LooksAndColors: Story = {
6767
render: () => {
6868
const buttons = ['copy', 'remove', 'delete'];
6969
const looks = ['default', 'primary', 'secondary', 'outline', 'placeholder'];
70-
const colors = ['default', 'positive', 'warning', 'danger'];
70+
const colors = ['default', 'positive', 'warning', 'danger', 'invalid'];
7171

7272
const uppercaseFirstLetter = (str: string) =>
7373
str.charAt(0).toUpperCase() + str.slice(1);

packages/uui-badge/lib/uui-badge.story.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const meta: Meta = {
1616
options: ['default', 'primary', 'secondary', 'outline', 'placeholder'],
1717
},
1818
color: {
19-
options: ['default', 'positive', 'warning', 'danger'],
19+
options: ['default', 'positive', 'warning', 'danger', 'invalid'],
2020
},
2121
},
2222

@@ -63,7 +63,7 @@ export const Icon: Story = {
6363
export const LooksAndColors: Story = {
6464
render: () => {
6565
const looks = ['default', 'primary', 'secondary', 'outline', 'placeholder'];
66-
const colors = ['default', 'positive', 'warning', 'danger'];
66+
const colors = ['default', 'positive', 'warning', 'danger', 'invalid'];
6767

6868
const uppercaseFirstLetter = (str: string) =>
6969
str.charAt(0).toUpperCase() + str.slice(1);

packages/uui-base/lib/types/InterfaceColor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export const UUIInterfaceColorValues: Readonly<UUIInterfaceColor[]> = [
33
'positive',
44
'warning',
55
'danger',
6+
'invalid',
67
] as const;
78

89
export type UUIInterfaceColor =

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const meta: Meta = {
2020
options: ['default', 'primary', 'secondary', 'outline', 'placeholder'],
2121
},
2222
color: {
23-
options: ['default', 'positive', 'warning', 'danger'],
23+
options: ['default', 'positive', 'warning', 'danger', 'invalid'],
2424
},
2525
type: {
2626
options: ['button', 'submit', 'reset'],
@@ -147,7 +147,13 @@ export const LooksAndColors: Story = {
147147
'outline',
148148
'placeholder',
149149
] as const;
150-
const colors = ['default', 'positive', 'warning', 'danger'] as const;
150+
const colors = [
151+
'default',
152+
'positive',
153+
'warning',
154+
'danger',
155+
'invalid',
156+
] as const;
151157

152158
const uppercaseFirstLetter = (str: string) =>
153159
str.charAt(0).toUpperCase() + str.slice(1);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ export class UUITagElement extends LitElement {
8080
--color-contrast: var(--uui-color-warning-contrast);
8181
}
8282
:host([color='danger']) {
83+
--color: var(--uui-color-danger);
84+
--color-standalone: var(--uui-color-danger-standalone);
85+
--color-contrast: var(--uui-color-danger-contrast);
86+
}
87+
:host([color='invalid']) {
8388
--color: var(--uui-color-invalid);
8489
--color-standalone: var(--uui-color-invalid-standalone);
8590
--color-contrast: var(--uui-color-invalid-contrast);

packages/uui-tag/lib/uui-tag.story.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const Sizing: Story = {
3939
export const LooksAndColors: Story = {
4040
render: () => {
4141
const looks = ['default', 'primary', 'secondary', 'outline', 'placeholder'];
42-
const colors = ['default', 'positive', 'warning', 'danger'];
42+
const colors = ['default', 'positive', 'warning', 'danger', 'invalid'];
4343

4444
function uppercaseFirstLetter(s: string) {
4545
return s.charAt(0).toUpperCase() + s.slice(1);

packages/uui-toast-notification/lib/uui-toast-notification.element.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { css, html, LitElement } from 'lit';
66
import { property, query, state } from 'lit/decorators.js';
77

88
import { UUIToastNotificationEvent } from './UUIToastNotificationEvent';
9+
import { UUIInterfaceColor } from '@umbraco-ui/uui-base';
910

1011
/**
1112
* @element uui-toast-notification
@@ -20,12 +21,12 @@ import { UUIToastNotificationEvent } from './UUIToastNotificationEvent';
2021
export class UUIToastNotificationElement extends LitElement {
2122
/**
2223
* Changes the color of the notification to one of the predefined, symbolic colors. Example: set this to danger to indicate errors.
23-
* @type {'' | 'default' | 'positive' | 'warning' | 'danger'}
24+
* @type {UUIInterfaceColor}
2425
* @attr
2526
* @default ""
2627
*/
2728
@property({ reflect: true })
28-
color: '' | 'default' | 'positive' | 'warning' | 'danger' = '';
29+
color: UUIInterfaceColor = '';
2930

3031
private _autoClose: number | null = null;
3132
/**

packages/uui-toast-notification/lib/uui-toast-notification.story.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const meta: Meta = {
1515
},
1616
argTypes: {
1717
color: {
18-
options: ['', 'default', 'positive', 'warning', 'danger'],
18+
options: ['', 'default', 'positive', 'warning', 'danger', 'invalid'],
1919
},
2020
headline: { control: { type: 'text' } },
2121
},
@@ -42,7 +42,7 @@ export const Default: Story = {
4242
},
4343
};
4444

45-
export const ErrorStyle: Story = {
45+
export const DangerStyle: Story = {
4646
args: {
4747
headline: 'Document could not be published!',
4848
slot: html`An error occurred while attempting to contact the server. Please
@@ -54,6 +54,17 @@ export const ErrorStyle: Story = {
5454
},
5555
};
5656

57+
export const ErrorStyle: Story = {
58+
args: {
59+
headline: 'Document could not be published!',
60+
slot: html`The data is not valid. Please correct data corrdingly.
61+
<uui-button slot="actions" look="primary" color="invalid"
62+
>Retry</uui-button
63+
>`,
64+
color: 'invalid',
65+
},
66+
};
67+
5768
export const PositiveStyle: Story = {
5869
args: {
5970
headline: 'Document published!',

0 commit comments

Comments
 (0)