@instructure/ui-alerts 10.15.2 → 10.15.3-snapshot-1
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 +11 -0
- package/es/Alert/index.js +16 -8
- package/lib/Alert/index.js +17 -8
- package/package.json +16 -16
- package/src/Alert/index.tsx +7 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Alert/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [10.15.3-snapshot-1](https://github.com/instructure/instructure-ui/compare/v10.15.2...v10.15.3-snapshot-1) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui-alerts:** no passthroughProps are set in component so Alert won't pass down props such as id to the underlaying DOM ([e481373](https://github.com/instructure/instructure-ui/commit/e481373d1b16dc26f7c808e4ea31bd8c59e41883))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [10.15.2](https://github.com/instructure/instructure-ui/compare/v10.15.1...v10.15.2) (2025-04-07)
|
|
7
18
|
|
|
8
19
|
|
package/es/Alert/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
const _excluded = ["margin", "styles", "children"];
|
|
1
3
|
var _dec, _dec2, _class, _Alert;
|
|
2
4
|
/*
|
|
3
5
|
* The MIT License (MIT)
|
|
@@ -26,7 +28,7 @@ var _dec, _dec2, _class, _Alert;
|
|
|
26
28
|
import React, { Component } from 'react';
|
|
27
29
|
import ReactDOM from 'react-dom';
|
|
28
30
|
import keycode from 'keycode';
|
|
29
|
-
import { callRenderProp, withDeterministicId } from '@instructure/ui-react-utils';
|
|
31
|
+
import { callRenderProp, withDeterministicId, passthroughProps } from '@instructure/ui-react-utils';
|
|
30
32
|
import { CloseButton } from '@instructure/ui-buttons';
|
|
31
33
|
import { View } from '@instructure/ui-view';
|
|
32
34
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
@@ -184,16 +186,22 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
184
186
|
})) : null;
|
|
185
187
|
}
|
|
186
188
|
renderAlert() {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
+
const _this$props3 = this.props,
|
|
190
|
+
margin = _this$props3.margin,
|
|
191
|
+
styles = _this$props3.styles,
|
|
192
|
+
children = _this$props3.children,
|
|
193
|
+
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
194
|
+
return jsx(View, Object.assign({}, passthroughProps({
|
|
195
|
+
...props
|
|
196
|
+
}), {
|
|
189
197
|
as: "div",
|
|
190
|
-
margin:
|
|
191
|
-
css:
|
|
198
|
+
margin: margin,
|
|
199
|
+
css: styles === null || styles === void 0 ? void 0 : styles.alert,
|
|
192
200
|
onKeyUp: this.handleKeyUp,
|
|
193
201
|
elementRef: this.handleRef
|
|
194
|
-
}, this.renderIcon(), jsx("div", {
|
|
195
|
-
css:
|
|
196
|
-
},
|
|
202
|
+
}), this.renderIcon(), jsx("div", {
|
|
203
|
+
css: styles === null || styles === void 0 ? void 0 : styles.content
|
|
204
|
+
}, children), this.renderCloseButton());
|
|
197
205
|
}
|
|
198
206
|
createScreenReaderPortal(liveRegion) {
|
|
199
207
|
const open = this.state.open;
|
package/lib/Alert/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.Alert = void 0;
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
12
|
var _keycode = _interopRequireDefault(require("keycode"));
|
|
12
13
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
13
14
|
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
15
|
+
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
14
16
|
var _CloseButton = require("@instructure/ui-buttons/lib/CloseButton");
|
|
15
17
|
var _View = require("@instructure/ui-view/lib/View");
|
|
16
18
|
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
@@ -24,6 +26,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
24
26
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
25
27
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
26
28
|
var _props = require("./props");
|
|
29
|
+
const _excluded = ["margin", "styles", "children"];
|
|
27
30
|
var _dec, _dec2, _class, _Alert;
|
|
28
31
|
/*
|
|
29
32
|
* The MIT License (MIT)
|
|
@@ -196,16 +199,22 @@ let Alert = exports.Alert = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
196
199
|
})) : null;
|
|
197
200
|
}
|
|
198
201
|
renderAlert() {
|
|
199
|
-
|
|
200
|
-
|
|
202
|
+
const _this$props3 = this.props,
|
|
203
|
+
margin = _this$props3.margin,
|
|
204
|
+
styles = _this$props3.styles,
|
|
205
|
+
children = _this$props3.children,
|
|
206
|
+
props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
207
|
+
return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)({
|
|
208
|
+
...props
|
|
209
|
+
}), {
|
|
201
210
|
as: "div",
|
|
202
|
-
margin:
|
|
203
|
-
css:
|
|
211
|
+
margin: margin,
|
|
212
|
+
css: styles === null || styles === void 0 ? void 0 : styles.alert,
|
|
204
213
|
onKeyUp: this.handleKeyUp,
|
|
205
214
|
elementRef: this.handleRef
|
|
206
|
-
}, this.renderIcon(), (0, _emotion.jsx)("div", {
|
|
207
|
-
css:
|
|
208
|
-
},
|
|
215
|
+
}), this.renderIcon(), (0, _emotion.jsx)("div", {
|
|
216
|
+
css: styles === null || styles === void 0 ? void 0 : styles.content
|
|
217
|
+
}, children), this.renderCloseButton());
|
|
209
218
|
}
|
|
210
219
|
createScreenReaderPortal(liveRegion) {
|
|
211
220
|
const open = this.state.open;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-alerts",
|
|
3
|
-
"version": "10.15.
|
|
3
|
+
"version": "10.15.3-snapshot-1",
|
|
4
4
|
"description": "An alert component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.15.
|
|
27
|
-
"@instructure/ui-babel-preset": "10.15.
|
|
28
|
-
"@instructure/ui-color-utils": "10.15.
|
|
29
|
-
"@instructure/ui-scripts": "10.15.
|
|
30
|
-
"@instructure/ui-test-utils": "10.15.
|
|
26
|
+
"@instructure/ui-axe-check": "10.15.3-snapshot-1",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.15.3-snapshot-1",
|
|
28
|
+
"@instructure/ui-color-utils": "10.15.3-snapshot-1",
|
|
29
|
+
"@instructure/ui-scripts": "10.15.3-snapshot-1",
|
|
30
|
+
"@instructure/ui-test-utils": "10.15.3-snapshot-1",
|
|
31
31
|
"@testing-library/jest-dom": "^6.6.3",
|
|
32
32
|
"@testing-library/react": "^16.0.1",
|
|
33
33
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/runtime": "^7.26.0",
|
|
38
|
-
"@instructure/console": "10.15.
|
|
39
|
-
"@instructure/emotion": "10.15.
|
|
40
|
-
"@instructure/shared-types": "10.15.
|
|
41
|
-
"@instructure/ui-a11y-content": "10.15.
|
|
42
|
-
"@instructure/ui-buttons": "10.15.
|
|
43
|
-
"@instructure/ui-icons": "10.15.
|
|
44
|
-
"@instructure/ui-motion": "10.15.
|
|
45
|
-
"@instructure/ui-react-utils": "10.15.
|
|
46
|
-
"@instructure/ui-themes": "10.15.
|
|
47
|
-
"@instructure/ui-view": "10.15.
|
|
38
|
+
"@instructure/console": "10.15.3-snapshot-1",
|
|
39
|
+
"@instructure/emotion": "10.15.3-snapshot-1",
|
|
40
|
+
"@instructure/shared-types": "10.15.3-snapshot-1",
|
|
41
|
+
"@instructure/ui-a11y-content": "10.15.3-snapshot-1",
|
|
42
|
+
"@instructure/ui-buttons": "10.15.3-snapshot-1",
|
|
43
|
+
"@instructure/ui-icons": "10.15.3-snapshot-1",
|
|
44
|
+
"@instructure/ui-motion": "10.15.3-snapshot-1",
|
|
45
|
+
"@instructure/ui-react-utils": "10.15.3-snapshot-1",
|
|
46
|
+
"@instructure/ui-themes": "10.15.3-snapshot-1",
|
|
47
|
+
"@instructure/ui-view": "10.15.3-snapshot-1",
|
|
48
48
|
"keycode": "^2",
|
|
49
49
|
"prop-types": "^15.8.1"
|
|
50
50
|
},
|
package/src/Alert/index.tsx
CHANGED
|
@@ -28,7 +28,8 @@ import keycode from 'keycode'
|
|
|
28
28
|
|
|
29
29
|
import {
|
|
30
30
|
callRenderProp,
|
|
31
|
-
withDeterministicId
|
|
31
|
+
withDeterministicId,
|
|
32
|
+
passthroughProps
|
|
32
33
|
} from '@instructure/ui-react-utils'
|
|
33
34
|
import { CloseButton } from '@instructure/ui-buttons'
|
|
34
35
|
import { View } from '@instructure/ui-view'
|
|
@@ -257,16 +258,18 @@ class Alert extends Component<AlertProps, AlertState> {
|
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
renderAlert() {
|
|
261
|
+
const { margin, styles, children, ...props } = this.props
|
|
260
262
|
return (
|
|
261
263
|
<View
|
|
264
|
+
{...passthroughProps({ ...props })}
|
|
262
265
|
as="div"
|
|
263
|
-
margin={
|
|
264
|
-
css={
|
|
266
|
+
margin={margin}
|
|
267
|
+
css={styles?.alert}
|
|
265
268
|
onKeyUp={this.handleKeyUp}
|
|
266
269
|
elementRef={this.handleRef}
|
|
267
270
|
>
|
|
268
271
|
{this.renderIcon()}
|
|
269
|
-
<div css={
|
|
272
|
+
<div css={styles?.content}>{children}</div>
|
|
270
273
|
{this.renderCloseButton()}
|
|
271
274
|
</View>
|
|
272
275
|
)
|