Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit aba2faa

Browse files
authored
Merge pull request #18 from misteinb/bugfix/upgrade-fluent-css
Bugfix/upgrade fluent css
2 parents 58e7d3a + 16d4e5a commit aba2faa

File tree

7 files changed

+67
-16
lines changed

7 files changed

+67
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ lib/**/*.js
22
lib/**/*.d.ts
33
dist/
44
node_modules/
5+
static/

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CHANGELOG
2+
3+
## v2.0.1
4+
### Fixed
5+
- alert close button hover colors didn't work across themes. updated to newer version of fluent-colors
6+
- update git ignore to include static folder
7+
8+
## v2.0.0
9+
### Changed
10+
- Alert close button changed from Icon to ActionTriggerButton
11+
12+
### Removed
13+
- Alert.attr.closeIcon
14+
15+
### Added
16+
- Alert.attr.closeButtonTitle

lib/components/Alert/Alert.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ ______________________________________________________________________________
2121
#### Information Alert
2222

2323
```jsx
24-
<Alert icon='info' type={0}>This is an information alert!</Alert>
24+
let onClose = () => alert('Alert close button pushed!');
25+
<Alert icon='info' type={0} onClose={onClose} attr={{closeButtonTitle: 'dismiss'}}>This is an information alert!</Alert>
2526
```
2627

2728
#### Warning Alert
2829

2930
```jsx
30-
<Alert icon='warning' type={1}>This is a warning alert!</Alert>
31+
let onClose = () => alert('Alert close button pushed!');
32+
<Alert icon='warning' type={1} onClose={onClose} attr={{closeButtonTitle: 'dismiss'}}>This is a warning alert!</Alert>
3133
```
3234

3335
#### Error Alert
@@ -43,8 +45,6 @@ let onClose = () => alert('Alert close button pushed!');
4345
<Alert icon='error' type={2} onClose={onClose} attr={{closeButtonTitle: 'dismiss'}}>This is an error alert with a close button! pp This is an error alert with a close button! This is an error alert with a close button! This is an error alert with a close button!</Alert>
4446
```
4547

46-
#### Multiline alert
47-
4848
```jsx
4949
<Alert icon='info' type={0} multiline>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed efficitur eros nec arcu vulputate placerat. Mauris porta consectetur eros, id vehicula ligula tempus at. Pellentesque sed velit nisl. Pellentesque efficitur orci ultrices dui condimentum venenatis. Pellentesque risus tortor, mollis tincidunt euismod in, rutrum et nisl. Praesent tincidunt metus justo, tempus tincidunt nisi facilisis ac. Praesent a metus nec urna viverra ultrices id sed arcu.</Alert>
5050
```

lib/components/Alert/Alert.scss

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ $icon-margin-top: 3px;
5151
}
5252
}
5353

54+
.close-button {
55+
&:focus {
56+
outline-offset: -1px;
57+
}
58+
}
59+
5460
&.alert-fixed {
5561
width: 71*$grid-size;
5662
}
@@ -59,32 +65,56 @@ $icon-margin-top: 3px;
5965
@include themify{
6066
background-color: themed('color-bg-alert-info');
6167
color: themed('color-text-rest');
62-
}
6368

64-
.alert-text {
65-
@include themify{
69+
.alert-text {
6670
color: themed('color-text-rest');
6771
}
72+
73+
.close-button {
74+
&:hover, &:focus {
75+
background-color: themed('color-bg-alert-info-close-hover');
76+
}
77+
}
6878
}
6979
}
7080

7181
&.alert-warning {
7282
@include themify{
7383
background-color: themed('color-bg-alert-warning');
7484
color: themed('color-text-black');
85+
86+
.close-button {
87+
&:hover, &:focus {
88+
background-color: themed('color-bg-alert-warning-close-hover');
89+
}
90+
}
91+
92+
.close-button-container {
93+
color: themed('color-text-black');
94+
}
7595
}
7696
}
7797

7898
&.alert-error {
7999
@include themify{
80100
background-color: themed('color-bg-alert-error');
81101
color: themed('color-text-white');
82-
}
83-
.alert-text {
84-
@include themify{
102+
103+
.alert-text {
104+
color: themed('color-text-white');
105+
}
106+
107+
.close-button {
108+
&:hover, &:focus {
109+
background-color: themed('color-bg-alert-error-close-hover');
110+
}
111+
}
112+
113+
.close-button-container {
85114
color: themed('color-text-white');
86115
}
87116
}
117+
88118
}
89119

90120
&.alert-multiline {

lib/components/Alert/Alert.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,15 @@ export const Alert: React.StatelessComponent<AlertProps> = (props: AlertProps) =
102102
const closeButtonTitle = props.attr && props.attr.closeButtonTitle ? props.attr.closeButtonTitle : undefined;
103103
close = (
104104
<ActionTriggerButton
105+
className={css('close-button')}
105106
onClick={props.onClose}
106107
icon={'cancelLegacy'}
107108
attr={{
108109
button: {
109110
title: closeButtonTitle
111+
},
112+
container: {
113+
className: css('close-button-container')
110114
}
111115
}}
112116
/>

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/azure-iot-ux-fluent-controls",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Azure IoT Fluent React Controls",
55
"main": "./lib/index.js",
66
"types": "./lib/index.d.ts",
@@ -29,7 +29,7 @@
2929
"url": "https://msazure.visualstudio.com/DefaultCollection/One/_git/azure-iot-ux-baseline"
3030
},
3131
"devDependencies": {
32-
"@microsoft/azure-iot-ux-fluent-css": "^1.0.0",
32+
"@microsoft/azure-iot-ux-fluent-css": "^1.1.0",
3333
"@types/chai": "^4.0.4",
3434
"@types/classnames": "^2.2.3",
3535
"@types/enzyme": "^2.8.9",

0 commit comments

Comments
 (0)