@instructure/ui-alerts 10.16.1-snapshot-0 → 10.16.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 CHANGED
@@ -3,7 +3,7 @@
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.16.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v10.16.0...v10.16.1-snapshot-0) (2025-04-15)
6
+ ## [10.16.1](https://github.com/instructure/instructure-ui/compare/v10.16.0...v10.16.1) (2025-04-22)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-alerts
9
9
 
@@ -23,7 +23,6 @@ var _Alert, _Alert2, _div, _Alert4, _Alert5;
23
23
  * SOFTWARE.
24
24
  */
25
25
 
26
- import React from 'react';
27
26
  import { render, screen, waitFor } from '@testing-library/react';
28
27
  import { vi } from 'vitest';
29
28
  import { runAxeCheck } from '@instructure/ui-axe-check';
@@ -33,6 +32,7 @@ import { Alert } from '../index';
33
32
  // eslint-disable-next-line no-restricted-imports
34
33
  import { generateA11yTests } from '@instructure/ui-scripts/lib/test/generateA11yTests';
35
34
  import AlertExamples from '../__examples__/Alert.examples';
35
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
36
36
  describe('<Alert />', () => {
37
37
  let srdiv;
38
38
  let consoleWarningMock;
@@ -57,9 +57,10 @@ describe('<Alert />', () => {
57
57
  consoleErrorMock.mockRestore();
58
58
  });
59
59
  it('should render', async () => {
60
- render(_Alert || (_Alert = /*#__PURE__*/React.createElement(Alert, {
61
- variant: "success"
62
- }, "Success: Sample alert text.")));
60
+ render(_Alert || (_Alert = _jsx(Alert, {
61
+ variant: "success",
62
+ children: "Success: Sample alert text."
63
+ })));
63
64
  const text = screen.getByText('Success: Sample alert text.');
64
65
  expect(text).toBeInTheDocument();
65
66
  });
@@ -75,19 +76,23 @@ describe('<Alert />', () => {
75
76
  }
76
77
  });
77
78
  it('should not render the Close button when `renderCloseButtonLabel` is not provided', async () => {
78
- render(_Alert2 || (_Alert2 = /*#__PURE__*/React.createElement(Alert, {
79
- variant: "success"
80
- }, "Success: Sample alert text.")));
79
+ render(_Alert2 || (_Alert2 = _jsx(Alert, {
80
+ variant: "success",
81
+ children: "Success: Sample alert text."
82
+ })));
81
83
  const closeButton = screen.queryByRole('button');
82
84
  expect(closeButton).not.toBeInTheDocument();
83
85
  });
84
86
  it('should call `onDismiss` when the close button is clicked with renderCloseButtonLabel', async () => {
85
87
  const onDismiss = vi.fn();
86
- render(/*#__PURE__*/React.createElement(Alert, {
88
+ render(_jsx(Alert, {
87
89
  variant: "success",
88
- renderCloseButtonLabel: _div || (_div = /*#__PURE__*/React.createElement("div", null, "Close")),
89
- onDismiss: onDismiss
90
- }, "Success: Sample alert text."));
90
+ renderCloseButtonLabel: _div || (_div = _jsx("div", {
91
+ children: "Close"
92
+ })),
93
+ onDismiss: onDismiss,
94
+ children: "Success: Sample alert text."
95
+ }));
91
96
  const closeButton = screen.getByRole('button');
92
97
  userEvent.click(closeButton);
93
98
  await waitFor(() => {
@@ -103,43 +108,47 @@ describe('<Alert />', () => {
103
108
  Object.entries(iconComponentsVariants).forEach(([variant, iconComponent]) => {
104
109
  var _Alert3;
105
110
  it(`"${variant}" variant should have icon "${iconComponent}".`, async () => {
106
- const _render2 = render(_Alert3 || (_Alert3 = /*#__PURE__*/React.createElement(Alert, {
111
+ const _render2 = render(_Alert3 || (_Alert3 = _jsx(Alert, {
107
112
  variant: variant,
108
- transition: "none"
109
- }, "Success: Sample alert text."))),
113
+ transition: "none",
114
+ children: "Success: Sample alert text."
115
+ }))),
110
116
  container = _render2.container;
111
117
  const icon = container.querySelector('svg[class$="-svgIcon"]');
112
118
  expect(icon).toHaveAttribute('name', iconComponent);
113
119
  });
114
120
  });
115
121
  it('should meet a11y standards', async () => {
116
- const _render3 = render(_Alert4 || (_Alert4 = /*#__PURE__*/React.createElement(Alert, {
122
+ const _render3 = render(_Alert4 || (_Alert4 = _jsx(Alert, {
117
123
  variant: "success",
118
- transition: "none"
119
- }, "Success: Sample alert text."))),
124
+ transition: "none",
125
+ children: "Success: Sample alert text."
126
+ }))),
120
127
  container = _render3.container;
121
128
  const axeCheck = await runAxeCheck(container);
122
129
  expect(axeCheck).toBe(true);
123
130
  });
124
131
  it('should add alert text to aria live region, when present', async () => {
125
132
  const liveRegion = document.getElementById('_alertLiveRegion');
126
- render(/*#__PURE__*/React.createElement(Alert, {
133
+ render(_jsx(Alert, {
127
134
  variant: "success",
128
135
  transition: "none",
129
136
  liveRegion: () => liveRegion,
130
- liveRegionPoliteness: "polite"
131
- }, "Success: Sample alert text."));
137
+ liveRegionPoliteness: "polite",
138
+ children: "Success: Sample alert text."
139
+ }));
132
140
  expect(liveRegion).toHaveTextContent('Success: Sample alert text.');
133
141
  expect(liveRegion).toHaveAttribute('aria-live', 'polite');
134
142
  });
135
143
  describe('with `screenReaderOnly', () => {
136
144
  it('should not render anything when using `liveRegion`', async () => {
137
145
  const liveRegion = document.getElementById('_alertLiveRegion');
138
- const _render4 = render(/*#__PURE__*/React.createElement(Alert, {
146
+ const _render4 = render(_jsx(Alert, {
139
147
  variant: "success",
140
148
  liveRegion: () => liveRegion,
141
- screenReaderOnly: true
142
- }, "Success: Sample alert text. asdsfds")),
149
+ screenReaderOnly: true,
150
+ children: "Success: Sample alert text. asdsfds"
151
+ })),
143
152
  container = _render4.container;
144
153
  expect(container.children.length).toBe(0);
145
154
  expect(liveRegion.children.length).toBe(1);
@@ -147,63 +156,69 @@ describe('<Alert />', () => {
147
156
  it('should warn if `liveRegion` is not defined', async () => {
148
157
  const consoleWarningSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
149
158
  const warning = "Warning: [Alert] The 'screenReaderOnly' prop must be used in conjunction with 'liveRegion'.";
150
- render(_Alert5 || (_Alert5 = /*#__PURE__*/React.createElement(Alert, {
159
+ render(_Alert5 || (_Alert5 = _jsx(Alert, {
151
160
  variant: "success",
152
- screenReaderOnly: true
153
- }, "Success: Sample alert text.")));
161
+ screenReaderOnly: true,
162
+ children: "Success: Sample alert text."
163
+ })));
154
164
  await waitFor(() => {
155
165
  expect(consoleWarningSpy.mock.calls[0][0]).toEqual(expect.stringContaining(warning));
156
166
  });
157
167
  });
158
168
  it('should set aria-atomic to the aria live region when isLiveRegionAtomic is present', async () => {
159
169
  const liveRegion = document.getElementById('_alertLiveRegion');
160
- render(/*#__PURE__*/React.createElement(Alert, {
170
+ render(_jsx(Alert, {
161
171
  variant: "success",
162
172
  transition: "none",
163
173
  liveRegion: () => liveRegion,
164
174
  liveRegionPoliteness: "polite",
165
- isLiveRegionAtomic: true
166
- }, "Success: Sample alert text."));
175
+ isLiveRegionAtomic: true,
176
+ children: "Success: Sample alert text."
177
+ }));
167
178
  expect(liveRegion).toHaveTextContent('Success: Sample alert text.');
168
179
  expect(liveRegion).toHaveAttribute('aria-atomic', 'true');
169
180
  });
170
181
  it('should close when told to, with transition', async () => {
171
182
  const liveRegion = document.getElementById('_alertLiveRegion');
172
- const _render5 = render(/*#__PURE__*/React.createElement(Alert, {
183
+ const _render5 = render(_jsx(Alert, {
173
184
  variant: "success",
174
- liveRegion: () => liveRegion
175
- }, "Success: Sample alert text.")),
185
+ liveRegion: () => liveRegion,
186
+ children: "Success: Sample alert text."
187
+ })),
176
188
  rerender = _render5.rerender;
177
189
  expect(liveRegion.children.length).toBe(1);
178
190
 
179
191
  //set open to false
180
- rerender(/*#__PURE__*/React.createElement(Alert, {
192
+ rerender(_jsx(Alert, {
181
193
  variant: "success",
182
194
  open: false,
183
- liveRegion: () => liveRegion
184
- }, "Success: Sample alert text."));
195
+ liveRegion: () => liveRegion,
196
+ children: "Success: Sample alert text."
197
+ }));
185
198
  await waitFor(() => {
186
199
  expect(liveRegion.children.length).toBe(0);
187
200
  });
188
201
  });
189
202
  it('should close when told to, without transition', async () => {
190
203
  const liveRegion = document.getElementById('_alertLiveRegion');
191
- const _render6 = render(/*#__PURE__*/React.createElement(Alert, {
204
+ const _render6 = render(_jsx(Alert, {
192
205
  variant: "success",
193
206
  transition: "none",
194
- liveRegion: () => liveRegion
195
- }, "Success: Sample alert text.")),
207
+ liveRegion: () => liveRegion,
208
+ children: "Success: Sample alert text."
209
+ })),
196
210
  rerender = _render6.rerender,
197
211
  container = _render6.container;
198
212
  expect(liveRegion.children.length).toBe(1);
199
213
 
200
214
  //set open to false
201
- rerender(/*#__PURE__*/React.createElement(Alert, {
215
+ rerender(_jsx(Alert, {
202
216
  open: false,
203
217
  variant: "success",
204
218
  transition: "none",
205
- liveRegion: () => liveRegion
206
- }, "Success: Sample alert text."));
219
+ liveRegion: () => liveRegion,
220
+ children: "Success: Sample alert text."
221
+ }));
207
222
  await waitFor(() => {
208
223
  expect(container).not.toHaveTextContent('Success: Sample alert text.');
209
224
  expect(liveRegion.children.length).toBe(0);
package/es/Alert/index.js CHANGED
@@ -24,8 +24,8 @@ var _dec, _dec2, _class, _Alert;
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  * SOFTWARE.
26
26
  */
27
- /** @jsx jsx */
28
- import React, { Component } from 'react';
27
+
28
+ import { Fragment, Component } from 'react';
29
29
  import ReactDOM from 'react-dom';
30
30
  import keycode from 'keycode';
31
31
  import { callRenderProp, withDeterministicId, passthroughProps } from '@instructure/ui-react-utils';
@@ -35,10 +35,11 @@ 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 { withStyle, jsx } from '@instructure/emotion';
38
+ import { withStyle } from '@instructure/emotion';
39
39
  import generateStyle from './styles';
40
40
  import generateComponentTheme from './theme';
41
41
  import { propTypes, allowedProps } from './props';
42
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
42
43
  /**
43
44
  ---
44
45
  category: components
@@ -119,7 +120,9 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
119
120
  }
120
121
  }
121
122
  createScreenreaderContentNode() {
122
- return jsx(ScreenReaderContent, null, this.props.children);
123
+ return _jsx(ScreenReaderContent, {
124
+ children: this.props.children
125
+ });
123
126
  }
124
127
  createScreenreaderAlert() {
125
128
  const liveRegion = this.getLiveRegion();
@@ -169,21 +172,22 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
169
172
  renderIcon() {
170
173
  var _this$props$styles;
171
174
  const Icon = this.variantUI[this.props.variant];
172
- return jsx("div", {
173
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon
174
- }, jsx(Icon, null));
175
+ return _jsx("div", {
176
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon,
177
+ children: _jsx(Icon, {})
178
+ });
175
179
  }
176
180
  renderCloseButton() {
177
181
  var _this$props$styles2;
178
182
  const closeButtonLabel = this.props.renderCloseButtonLabel && callRenderProp(this.props.renderCloseButtonLabel);
179
- return closeButtonLabel ? jsx("div", {
183
+ return closeButtonLabel ? _jsx("div", {
180
184
  css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.closeButton,
181
- key: "closeButton"
182
- }, jsx(CloseButton, {
183
- onClick: this.close,
184
- size: "small",
185
- screenReaderLabel: closeButtonLabel
186
- })) : null;
185
+ children: _jsx(CloseButton, {
186
+ onClick: this.close,
187
+ size: "small",
188
+ screenReaderLabel: closeButtonLabel
189
+ })
190
+ }, "closeButton") : null;
187
191
  }
188
192
  renderAlert() {
189
193
  const _this$props3 = this.props,
@@ -191,23 +195,27 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
191
195
  styles = _this$props3.styles,
192
196
  children = _this$props3.children,
193
197
  props = _objectWithoutProperties(_this$props3, _excluded);
194
- return jsx(View, Object.assign({}, passthroughProps({
195
- ...props
196
- }), {
198
+ return _jsxs(View, {
199
+ ...passthroughProps({
200
+ ...props
201
+ }),
197
202
  as: "div",
198
203
  margin: margin,
199
204
  css: styles === null || styles === void 0 ? void 0 : styles.alert,
200
205
  onKeyUp: this.handleKeyUp,
201
- elementRef: this.handleRef
202
- }), this.renderIcon(), jsx("div", {
203
- css: styles === null || styles === void 0 ? void 0 : styles.content
204
- }, children), this.renderCloseButton());
206
+ elementRef: this.handleRef,
207
+ children: [this.renderIcon(), _jsx("div", {
208
+ css: styles === null || styles === void 0 ? void 0 : styles.content,
209
+ children: children
210
+ }), this.renderCloseButton()]
211
+ });
205
212
  }
206
213
  createScreenReaderPortal(liveRegion) {
207
214
  const open = this.state.open;
208
- return open ? /*#__PURE__*/ReactDOM.createPortal(jsx("div", {
209
- id: this.srid
210
- }, this.createScreenreaderContentNode()), liveRegion) : null;
215
+ return open ? /*#__PURE__*/ReactDOM.createPortal(_jsx("div", {
216
+ id: this.srid,
217
+ children: this.createScreenreaderContentNode()
218
+ }), liveRegion) : null;
211
219
  }
212
220
  render() {
213
221
  const liveRegion = this.getLiveRegion();
@@ -218,15 +226,20 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
218
226
  return screenReaderContent;
219
227
  }
220
228
  if (this.props.transition === 'none') {
221
- return this.state.open ? jsx(React.Fragment, null, screenReaderContent, this.renderAlert()) : null;
229
+ return this.state.open ? _jsxs(Fragment, {
230
+ children: [screenReaderContent, this.renderAlert()]
231
+ }) : null;
222
232
  }
223
- return jsx(React.Fragment, null, screenReaderContent, jsx(Transition, {
224
- type: this.props.transition,
225
- transitionOnMount: true,
226
- in: this.state.open,
227
- unmountOnExit: true,
228
- onExited: this.onExitTransition
229
- }, this.renderAlert()));
233
+ return _jsxs(Fragment, {
234
+ children: [screenReaderContent, _jsx(Transition, {
235
+ type: this.props.transition,
236
+ transitionOnMount: true,
237
+ in: this.state.open,
238
+ unmountOnExit: true,
239
+ onExited: this.onExitTransition,
240
+ children: this.renderAlert()
241
+ })]
242
+ });
230
243
  }
231
244
  }, _Alert.displayName = "Alert", _Alert.componentId = 'Alert', _Alert.propTypes = propTypes, _Alert.allowedProps = allowedProps, _Alert.defaultProps = {
232
245
  variant: 'info',
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _react = _interopRequireDefault(require("react"));
5
- var _react2 = require("@testing-library/react");
4
+ var _react = require("@testing-library/react");
6
5
  var _vitest = require("vitest");
7
6
  var _runAxeCheck = require("@instructure/ui-axe-check/lib/runAxeCheck.js");
8
7
  require("@testing-library/jest-dom");
@@ -10,6 +9,7 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
10
9
  var _index = require("../index");
11
10
  var _generateA11yTests = require("@instructure/ui-scripts/lib/test/generateA11yTests");
12
11
  var _Alert6 = _interopRequireDefault(require("../__examples__/Alert.examples"));
12
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
13
13
  var _Alert, _Alert2, _div, _Alert4, _Alert5;
14
14
  /*
15
15
  * The MIT License (MIT)
@@ -59,17 +59,18 @@ describe('<Alert />', () => {
59
59
  consoleErrorMock.mockRestore();
60
60
  });
61
61
  it('should render', async () => {
62
- (0, _react2.render)(_Alert || (_Alert = /*#__PURE__*/_react.default.createElement(_index.Alert, {
63
- variant: "success"
64
- }, "Success: Sample alert text.")));
65
- const text = _react2.screen.getByText('Success: Sample alert text.');
62
+ (0, _react.render)(_Alert || (_Alert = (0, _jsxRuntime.jsx)(_index.Alert, {
63
+ variant: "success",
64
+ children: "Success: Sample alert text."
65
+ })));
66
+ const text = _react.screen.getByText('Success: Sample alert text.');
66
67
  expect(text).toBeInTheDocument();
67
68
  });
68
69
  describe('with generated examples', () => {
69
70
  const generatedComponents = (0, _generateA11yTests.generateA11yTests)(_index.Alert, _Alert6.default);
70
71
  for (const component of generatedComponents) {
71
72
  it(component.description, async () => {
72
- const _render = (0, _react2.render)(component.content),
73
+ const _render = (0, _react.render)(component.content),
73
74
  container = _render.container;
74
75
  const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
75
76
  expect(axeCheck).toBe(true);
@@ -77,22 +78,26 @@ describe('<Alert />', () => {
77
78
  }
78
79
  });
79
80
  it('should not render the Close button when `renderCloseButtonLabel` is not provided', async () => {
80
- (0, _react2.render)(_Alert2 || (_Alert2 = /*#__PURE__*/_react.default.createElement(_index.Alert, {
81
- variant: "success"
82
- }, "Success: Sample alert text.")));
83
- const closeButton = _react2.screen.queryByRole('button');
81
+ (0, _react.render)(_Alert2 || (_Alert2 = (0, _jsxRuntime.jsx)(_index.Alert, {
82
+ variant: "success",
83
+ children: "Success: Sample alert text."
84
+ })));
85
+ const closeButton = _react.screen.queryByRole('button');
84
86
  expect(closeButton).not.toBeInTheDocument();
85
87
  });
86
88
  it('should call `onDismiss` when the close button is clicked with renderCloseButtonLabel', async () => {
87
89
  const onDismiss = _vitest.vi.fn();
88
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Alert, {
90
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Alert, {
89
91
  variant: "success",
90
- renderCloseButtonLabel: _div || (_div = /*#__PURE__*/_react.default.createElement("div", null, "Close")),
91
- onDismiss: onDismiss
92
- }, "Success: Sample alert text."));
93
- const closeButton = _react2.screen.getByRole('button');
92
+ renderCloseButtonLabel: _div || (_div = (0, _jsxRuntime.jsx)("div", {
93
+ children: "Close"
94
+ })),
95
+ onDismiss: onDismiss,
96
+ children: "Success: Sample alert text."
97
+ }));
98
+ const closeButton = _react.screen.getByRole('button');
94
99
  _userEvent.default.click(closeButton);
95
- await (0, _react2.waitFor)(() => {
100
+ await (0, _react.waitFor)(() => {
96
101
  expect(onDismiss).toHaveBeenCalled();
97
102
  });
98
103
  });
@@ -105,43 +110,47 @@ describe('<Alert />', () => {
105
110
  Object.entries(iconComponentsVariants).forEach(([variant, iconComponent]) => {
106
111
  var _Alert3;
107
112
  it(`"${variant}" variant should have icon "${iconComponent}".`, async () => {
108
- const _render2 = (0, _react2.render)(_Alert3 || (_Alert3 = /*#__PURE__*/_react.default.createElement(_index.Alert, {
113
+ const _render2 = (0, _react.render)(_Alert3 || (_Alert3 = (0, _jsxRuntime.jsx)(_index.Alert, {
109
114
  variant: variant,
110
- transition: "none"
111
- }, "Success: Sample alert text."))),
115
+ transition: "none",
116
+ children: "Success: Sample alert text."
117
+ }))),
112
118
  container = _render2.container;
113
119
  const icon = container.querySelector('svg[class$="-svgIcon"]');
114
120
  expect(icon).toHaveAttribute('name', iconComponent);
115
121
  });
116
122
  });
117
123
  it('should meet a11y standards', async () => {
118
- const _render3 = (0, _react2.render)(_Alert4 || (_Alert4 = /*#__PURE__*/_react.default.createElement(_index.Alert, {
124
+ const _render3 = (0, _react.render)(_Alert4 || (_Alert4 = (0, _jsxRuntime.jsx)(_index.Alert, {
119
125
  variant: "success",
120
- transition: "none"
121
- }, "Success: Sample alert text."))),
126
+ transition: "none",
127
+ children: "Success: Sample alert text."
128
+ }))),
122
129
  container = _render3.container;
123
130
  const axeCheck = await (0, _runAxeCheck.runAxeCheck)(container);
124
131
  expect(axeCheck).toBe(true);
125
132
  });
126
133
  it('should add alert text to aria live region, when present', async () => {
127
134
  const liveRegion = document.getElementById('_alertLiveRegion');
128
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Alert, {
135
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Alert, {
129
136
  variant: "success",
130
137
  transition: "none",
131
138
  liveRegion: () => liveRegion,
132
- liveRegionPoliteness: "polite"
133
- }, "Success: Sample alert text."));
139
+ liveRegionPoliteness: "polite",
140
+ children: "Success: Sample alert text."
141
+ }));
134
142
  expect(liveRegion).toHaveTextContent('Success: Sample alert text.');
135
143
  expect(liveRegion).toHaveAttribute('aria-live', 'polite');
136
144
  });
137
145
  describe('with `screenReaderOnly', () => {
138
146
  it('should not render anything when using `liveRegion`', async () => {
139
147
  const liveRegion = document.getElementById('_alertLiveRegion');
140
- const _render4 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Alert, {
148
+ const _render4 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Alert, {
141
149
  variant: "success",
142
150
  liveRegion: () => liveRegion,
143
- screenReaderOnly: true
144
- }, "Success: Sample alert text. asdsfds")),
151
+ screenReaderOnly: true,
152
+ children: "Success: Sample alert text. asdsfds"
153
+ })),
145
154
  container = _render4.container;
146
155
  expect(container.children.length).toBe(0);
147
156
  expect(liveRegion.children.length).toBe(1);
@@ -149,64 +158,70 @@ describe('<Alert />', () => {
149
158
  it('should warn if `liveRegion` is not defined', async () => {
150
159
  const consoleWarningSpy = _vitest.vi.spyOn(console, 'error').mockImplementation(() => {});
151
160
  const warning = "Warning: [Alert] The 'screenReaderOnly' prop must be used in conjunction with 'liveRegion'.";
152
- (0, _react2.render)(_Alert5 || (_Alert5 = /*#__PURE__*/_react.default.createElement(_index.Alert, {
161
+ (0, _react.render)(_Alert5 || (_Alert5 = (0, _jsxRuntime.jsx)(_index.Alert, {
153
162
  variant: "success",
154
- screenReaderOnly: true
155
- }, "Success: Sample alert text.")));
156
- await (0, _react2.waitFor)(() => {
163
+ screenReaderOnly: true,
164
+ children: "Success: Sample alert text."
165
+ })));
166
+ await (0, _react.waitFor)(() => {
157
167
  expect(consoleWarningSpy.mock.calls[0][0]).toEqual(expect.stringContaining(warning));
158
168
  });
159
169
  });
160
170
  it('should set aria-atomic to the aria live region when isLiveRegionAtomic is present', async () => {
161
171
  const liveRegion = document.getElementById('_alertLiveRegion');
162
- (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Alert, {
172
+ (0, _react.render)((0, _jsxRuntime.jsx)(_index.Alert, {
163
173
  variant: "success",
164
174
  transition: "none",
165
175
  liveRegion: () => liveRegion,
166
176
  liveRegionPoliteness: "polite",
167
- isLiveRegionAtomic: true
168
- }, "Success: Sample alert text."));
177
+ isLiveRegionAtomic: true,
178
+ children: "Success: Sample alert text."
179
+ }));
169
180
  expect(liveRegion).toHaveTextContent('Success: Sample alert text.');
170
181
  expect(liveRegion).toHaveAttribute('aria-atomic', 'true');
171
182
  });
172
183
  it('should close when told to, with transition', async () => {
173
184
  const liveRegion = document.getElementById('_alertLiveRegion');
174
- const _render5 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Alert, {
185
+ const _render5 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Alert, {
175
186
  variant: "success",
176
- liveRegion: () => liveRegion
177
- }, "Success: Sample alert text.")),
187
+ liveRegion: () => liveRegion,
188
+ children: "Success: Sample alert text."
189
+ })),
178
190
  rerender = _render5.rerender;
179
191
  expect(liveRegion.children.length).toBe(1);
180
192
 
181
193
  //set open to false
182
- rerender(/*#__PURE__*/_react.default.createElement(_index.Alert, {
194
+ rerender((0, _jsxRuntime.jsx)(_index.Alert, {
183
195
  variant: "success",
184
196
  open: false,
185
- liveRegion: () => liveRegion
186
- }, "Success: Sample alert text."));
187
- await (0, _react2.waitFor)(() => {
197
+ liveRegion: () => liveRegion,
198
+ children: "Success: Sample alert text."
199
+ }));
200
+ await (0, _react.waitFor)(() => {
188
201
  expect(liveRegion.children.length).toBe(0);
189
202
  });
190
203
  });
191
204
  it('should close when told to, without transition', async () => {
192
205
  const liveRegion = document.getElementById('_alertLiveRegion');
193
- const _render6 = (0, _react2.render)(/*#__PURE__*/_react.default.createElement(_index.Alert, {
206
+ const _render6 = (0, _react.render)((0, _jsxRuntime.jsx)(_index.Alert, {
194
207
  variant: "success",
195
208
  transition: "none",
196
- liveRegion: () => liveRegion
197
- }, "Success: Sample alert text.")),
209
+ liveRegion: () => liveRegion,
210
+ children: "Success: Sample alert text."
211
+ })),
198
212
  rerender = _render6.rerender,
199
213
  container = _render6.container;
200
214
  expect(liveRegion.children.length).toBe(1);
201
215
 
202
216
  //set open to false
203
- rerender(/*#__PURE__*/_react.default.createElement(_index.Alert, {
217
+ rerender((0, _jsxRuntime.jsx)(_index.Alert, {
204
218
  open: false,
205
219
  variant: "success",
206
220
  transition: "none",
207
- liveRegion: () => liveRegion
208
- }, "Success: Sample alert text."));
209
- await (0, _react2.waitFor)(() => {
221
+ liveRegion: () => liveRegion,
222
+ children: "Success: Sample alert text."
223
+ }));
224
+ await (0, _react.waitFor)(() => {
210
225
  expect(container).not.toHaveTextContent('Success: Sample alert text.');
211
226
  expect(liveRegion.children.length).toBe(0);
212
227
  });