@instructure/ui-alerts 8.16.1-snapshot.2 → 8.17.1-snapshot.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/es/Alert/index.js +5 -6
- package/lib/Alert/index.js +6 -6
- package/package.json +17 -17
- package/src/Alert/index.tsx +6 -3
- package/src/Alert/props.ts +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Alert/index.d.ts.map +1 -1
- package/types/Alert/props.d.ts +2 -1
- package/types/Alert/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.17.0](https://github.com/instructure/instructure-ui/compare/v8.16.0...v8.17.0) (2022-02-07)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- remove type:"commonjs" from package.json files ([0b243be](https://github.com/instructure/instructure-ui/commit/0b243bee389ee14493e6b3dbb30a8b660c295d3d))
|
|
11
|
+
|
|
6
12
|
# [8.16.0](https://github.com/instructure/instructure-ui/compare/v8.15.0...v8.16.0) (2022-02-03)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-alerts
|
package/es/Alert/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class, _class2, _temp;
|
|
1
|
+
var _dec, _dec2, _class, _class2, _temp;
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* The MIT License (MIT)
|
|
@@ -28,14 +28,13 @@ var _dec, _class, _class2, _temp;
|
|
|
28
28
|
import React, { Component } from 'react';
|
|
29
29
|
import ReactDOM from 'react-dom';
|
|
30
30
|
import keycode from 'keycode';
|
|
31
|
-
import { callRenderProp } from '@instructure/ui-react-utils';
|
|
31
|
+
import { callRenderProp, withDeterministicId } from '@instructure/ui-react-utils';
|
|
32
32
|
import { CloseButton } from '@instructure/ui-buttons';
|
|
33
33
|
import { View } from '@instructure/ui-view';
|
|
34
34
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
35
35
|
import { IconCheckMarkSolid, IconInfoBorderlessSolid, IconWarningBorderlessSolid, IconNoSolid } from '@instructure/ui-icons';
|
|
36
36
|
import { Transition } from '@instructure/ui-motion';
|
|
37
37
|
import { logError as error } from '@instructure/console';
|
|
38
|
-
import { uid } from '@instructure/uid';
|
|
39
38
|
import { canvas } from '@instructure/ui-themes';
|
|
40
39
|
import { withStyle, jsx, InstUISettingsProvider } from '@instructure/emotion';
|
|
41
40
|
import generateStyle from './styles';
|
|
@@ -48,7 +47,7 @@ category: components
|
|
|
48
47
|
---
|
|
49
48
|
@tsProps
|
|
50
49
|
**/
|
|
51
|
-
let Alert = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class Alert extends Component {
|
|
50
|
+
let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_temp = _class2 = class Alert extends Component {
|
|
52
51
|
constructor(props) {
|
|
53
52
|
super(props);
|
|
54
53
|
this._timeouts = [];
|
|
@@ -141,7 +140,7 @@ let Alert = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
141
140
|
const liveRegion = this.getLiveRegion();
|
|
142
141
|
|
|
143
142
|
if (liveRegion) {
|
|
144
|
-
this.srid =
|
|
143
|
+
this.srid = this.props.deterministicId();
|
|
145
144
|
const div = document.createElement('div');
|
|
146
145
|
div.setAttribute('id', this.srid);
|
|
147
146
|
this.renderScreenreeaderAlert(div);
|
|
@@ -297,6 +296,6 @@ let Alert = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
|
|
|
297
296
|
isLiveRegionAtomic: false,
|
|
298
297
|
children: null,
|
|
299
298
|
hasShadow: true
|
|
300
|
-
}, _temp)) || _class);
|
|
299
|
+
}, _temp)) || _class) || _class);
|
|
301
300
|
export default Alert;
|
|
302
301
|
export { Alert };
|
package/lib/Alert/index.js
CHANGED
|
@@ -17,6 +17,8 @@ var _keycode = _interopRequireDefault(require("keycode"));
|
|
|
17
17
|
|
|
18
18
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
19
19
|
|
|
20
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
21
|
+
|
|
20
22
|
var _CloseButton = require("@instructure/ui-buttons/lib/CloseButton");
|
|
21
23
|
|
|
22
24
|
var _View = require("@instructure/ui-view/lib/View");
|
|
@@ -35,8 +37,6 @@ var _Transition = require("@instructure/ui-motion/lib/Transition");
|
|
|
35
37
|
|
|
36
38
|
var _console = require("@instructure/console");
|
|
37
39
|
|
|
38
|
-
var _uid = require("@instructure/uid");
|
|
39
|
-
|
|
40
40
|
var _uiThemes = require("@instructure/ui-themes");
|
|
41
41
|
|
|
42
42
|
var _emotion = require("@instructure/emotion");
|
|
@@ -47,7 +47,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
47
47
|
|
|
48
48
|
var _props = require("./props");
|
|
49
49
|
|
|
50
|
-
var _dec, _class, _class2, _temp;
|
|
50
|
+
var _dec, _dec2, _class, _class2, _temp;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
---
|
|
@@ -55,7 +55,7 @@ category: components
|
|
|
55
55
|
---
|
|
56
56
|
@tsProps
|
|
57
57
|
**/
|
|
58
|
-
let Alert = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Alert extends _react.Component {
|
|
58
|
+
let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_temp = _class2 = class Alert extends _react.Component {
|
|
59
59
|
constructor(props) {
|
|
60
60
|
super(props);
|
|
61
61
|
this._timeouts = [];
|
|
@@ -148,7 +148,7 @@ let Alert = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
148
148
|
const liveRegion = this.getLiveRegion();
|
|
149
149
|
|
|
150
150
|
if (liveRegion) {
|
|
151
|
-
this.srid =
|
|
151
|
+
this.srid = this.props.deterministicId();
|
|
152
152
|
const div = document.createElement('div');
|
|
153
153
|
div.setAttribute('id', this.srid);
|
|
154
154
|
this.renderScreenreeaderAlert(div);
|
|
@@ -307,7 +307,7 @@ let Alert = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
307
307
|
isLiveRegionAtomic: false,
|
|
308
308
|
children: null,
|
|
309
309
|
hasShadow: true
|
|
310
|
-
}, _temp)) || _class);
|
|
310
|
+
}, _temp)) || _class) || _class);
|
|
311
311
|
exports.Alert = Alert;
|
|
312
312
|
var _default = Alert;
|
|
313
313
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-alerts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.17.1-snapshot.14+f0b03679c",
|
|
4
4
|
"description": "An alert component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.
|
|
27
|
-
"@instructure/ui-color-utils": "8.
|
|
28
|
-
"@instructure/ui-test-utils": "8.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.17.1-snapshot.14+f0b03679c",
|
|
27
|
+
"@instructure/ui-color-utils": "8.17.1-snapshot.14+f0b03679c",
|
|
28
|
+
"@instructure/ui-test-utils": "8.17.1-snapshot.14+f0b03679c"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.13.10",
|
|
32
|
-
"@instructure/console": "8.
|
|
33
|
-
"@instructure/emotion": "8.
|
|
34
|
-
"@instructure/shared-types": "8.
|
|
35
|
-
"@instructure/ui-a11y-content": "8.
|
|
36
|
-
"@instructure/ui-buttons": "8.
|
|
37
|
-
"@instructure/ui-icons": "8.
|
|
38
|
-
"@instructure/ui-motion": "8.
|
|
39
|
-
"@instructure/ui-react-utils": "8.
|
|
40
|
-
"@instructure/ui-themes": "8.
|
|
41
|
-
"@instructure/ui-utils": "8.
|
|
42
|
-
"@instructure/ui-view": "8.
|
|
43
|
-
"@instructure/uid": "8.
|
|
32
|
+
"@instructure/console": "8.17.1-snapshot.14+f0b03679c",
|
|
33
|
+
"@instructure/emotion": "8.17.1-snapshot.14+f0b03679c",
|
|
34
|
+
"@instructure/shared-types": "8.17.1-snapshot.14+f0b03679c",
|
|
35
|
+
"@instructure/ui-a11y-content": "8.17.1-snapshot.14+f0b03679c",
|
|
36
|
+
"@instructure/ui-buttons": "8.17.1-snapshot.14+f0b03679c",
|
|
37
|
+
"@instructure/ui-icons": "8.17.1-snapshot.14+f0b03679c",
|
|
38
|
+
"@instructure/ui-motion": "8.17.1-snapshot.14+f0b03679c",
|
|
39
|
+
"@instructure/ui-react-utils": "8.17.1-snapshot.14+f0b03679c",
|
|
40
|
+
"@instructure/ui-themes": "8.17.1-snapshot.14+f0b03679c",
|
|
41
|
+
"@instructure/ui-utils": "8.17.1-snapshot.14+f0b03679c",
|
|
42
|
+
"@instructure/ui-view": "8.17.1-snapshot.14+f0b03679c",
|
|
43
|
+
"@instructure/uid": "8.17.1-snapshot.14+f0b03679c",
|
|
44
44
|
"keycode": "^2",
|
|
45
45
|
"prop-types": "^15"
|
|
46
46
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f0b03679c4c4d05d4d650d22646ac1dc6791e935"
|
|
56
56
|
}
|
package/src/Alert/index.tsx
CHANGED
|
@@ -26,7 +26,10 @@ import React, { Component } from 'react'
|
|
|
26
26
|
import ReactDOM from 'react-dom'
|
|
27
27
|
import keycode from 'keycode'
|
|
28
28
|
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
callRenderProp,
|
|
31
|
+
withDeterministicId
|
|
32
|
+
} from '@instructure/ui-react-utils'
|
|
30
33
|
import { CloseButton } from '@instructure/ui-buttons'
|
|
31
34
|
import { View } from '@instructure/ui-view'
|
|
32
35
|
import type { ViewOwnProps } from '@instructure/ui-view'
|
|
@@ -39,7 +42,6 @@ import {
|
|
|
39
42
|
} from '@instructure/ui-icons'
|
|
40
43
|
import { Transition } from '@instructure/ui-motion'
|
|
41
44
|
import { logError as error } from '@instructure/console'
|
|
42
|
-
import { uid } from '@instructure/uid'
|
|
43
45
|
import { canvas } from '@instructure/ui-themes'
|
|
44
46
|
import { withStyle, jsx, InstUISettingsProvider } from '@instructure/emotion'
|
|
45
47
|
|
|
@@ -55,6 +57,7 @@ category: components
|
|
|
55
57
|
---
|
|
56
58
|
@tsProps
|
|
57
59
|
**/
|
|
60
|
+
@withDeterministicId()
|
|
58
61
|
@withStyle(generateStyle, generateComponentTheme)
|
|
59
62
|
class Alert extends Component<AlertProps, AlertState> {
|
|
60
63
|
static readonly componentId = 'Alert'
|
|
@@ -166,7 +169,7 @@ class Alert extends Component<AlertProps, AlertState> {
|
|
|
166
169
|
createScreenreaderAlert() {
|
|
167
170
|
const liveRegion = this.getLiveRegion()
|
|
168
171
|
if (liveRegion) {
|
|
169
|
-
this.srid =
|
|
172
|
+
this.srid = this.props.deterministicId!()
|
|
170
173
|
|
|
171
174
|
const div = document.createElement('div')
|
|
172
175
|
div.setAttribute('id', this.srid)
|
package/src/Alert/props.ts
CHANGED
|
@@ -33,6 +33,7 @@ import type {
|
|
|
33
33
|
ComponentStyle
|
|
34
34
|
} from '@instructure/emotion'
|
|
35
35
|
import type { AlertTheme, PropValidators } from '@instructure/shared-types'
|
|
36
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
36
37
|
|
|
37
38
|
type AlertOwnProps = {
|
|
38
39
|
/**
|
|
@@ -96,7 +97,7 @@ type PropKeys = keyof AlertOwnProps
|
|
|
96
97
|
|
|
97
98
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
98
99
|
|
|
99
|
-
type AlertProps = AlertOwnProps & WithStyleProps<AlertTheme, AlertStyle>
|
|
100
|
+
type AlertProps = AlertOwnProps & WithStyleProps<AlertTheme, AlertStyle> & WithDeterministicIdProps
|
|
100
101
|
|
|
101
102
|
type AlertStyle = ComponentStyle<'alert' | 'icon' | 'closeButton' | 'content'>
|
|
102
103
|
|