@elliemae/pui-app-sdk 3.0.0-beta.20 → 3.0.0-beta.21

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.
Files changed (27) hide show
  1. package/dist/cjs/index.js +2 -4
  2. package/dist/cjs/view/app-root/hosted-app.js +9 -6
  3. package/dist/cjs/view/app-root/stand-alone-app.js +7 -3
  4. package/dist/cjs/view/{media-breakpoint/index.js → breakpoint/use-breakpoint.js} +7 -8
  5. package/dist/cjs/view/{useMediaBreakpoints/index.js → breakpoint/use-media-query-list.js} +7 -7
  6. package/dist/cjs/view/modals/wait-message/index.js +4 -5
  7. package/dist/cjs/view/modals/wait-message/{html-wait-message.js → use-html-wait-message.js} +6 -7
  8. package/dist/cjs/view/{window-size/index.js → use-window-size-change.js} +6 -7
  9. package/dist/es/index.js +2 -4
  10. package/dist/es/view/app-root/hosted-app.js +9 -6
  11. package/dist/es/view/app-root/stand-alone-app.js +7 -3
  12. package/dist/es/view/{media-breakpoint/index.js → breakpoint/use-breakpoint.js} +4 -5
  13. package/dist/es/view/{useMediaBreakpoints/index.js → breakpoint/use-media-query-list.js} +4 -4
  14. package/dist/es/view/modals/wait-message/index.js +4 -5
  15. package/dist/es/view/modals/wait-message/{html-wait-message.js → use-html-wait-message.js} +4 -5
  16. package/dist/es/view/{window-size/index.js → use-window-size-change.js} +3 -4
  17. package/dist/types/index.d.ts +1 -2
  18. package/dist/types/view/{media-breakpoint → breakpoint}/index.stories.d.ts +0 -0
  19. package/dist/types/view/breakpoint/use-breakpoint.d.ts +1 -0
  20. package/dist/types/view/breakpoint/use-media-query-list.d.ts +1 -0
  21. package/dist/types/view/modals/wait-message/use-html-wait-message.d.ts +1 -0
  22. package/dist/types/view/use-window-size-change.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/dist/types/view/media-breakpoint/index.d.ts +0 -1
  25. package/dist/types/view/modals/wait-message/html-wait-message.d.ts +0 -6
  26. package/dist/types/view/useMediaBreakpoints/index.d.ts +0 -1
  27. package/dist/types/view/window-size/index.d.ts +0 -1
package/dist/cjs/index.js CHANGED
@@ -44,7 +44,6 @@ __export(lib_exports, {
44
44
  LargeTextBox: () => import_large_text_box.LargeTextBox,
45
45
  MASK_PIPES: () => import_input_mask.MASK_PIPES,
46
46
  MASK_TYPES: () => import_input_mask.MASK_TYPES,
47
- MediaBreakpoint: () => import_media_breakpoint.MediaBreakpoint,
48
47
  MicroApp: () => import_micro_app.MicroApp,
49
48
  MicroIFrameApp: () => import_micro_iframe_app.MicroIFrameApp,
50
49
  NavigationPromptActions: () => import_actions2.ACTIONS,
@@ -115,7 +114,7 @@ __export(lib_exports, {
115
114
  useAppSelector: () => import_react_redux.useAppSelector,
116
115
  useInjectReducer: () => import_redux_injectors.useInjectReducer,
117
116
  useInjectSaga: () => import_redux_injectors.useInjectSaga,
118
- useMediaBreakpoints: () => import_useMediaBreakpoints.useMediaBreakpoints,
117
+ useMediaQueryList: () => import_use_media_query_list.useMediaQueryList,
119
118
  waitMessageAction: () => import_actions3.waitMessage,
120
119
  withAppDecorator: () => import_decorator.withAppDecorator
121
120
  });
@@ -162,7 +161,6 @@ var import_render_with_router = require("./utils/testing/render-with-router.js")
162
161
  var import_render_with_state_addons = require("./utils/testing/render-with-state-addons.js");
163
162
  var import_helpers2 = require("./api/helpers.js");
164
163
  var import_users = require("./api/users/index.js");
165
- var import_useMediaBreakpoints = require("./view/useMediaBreakpoints/index.js");
166
164
  var import_decorator = require("./view/storybook/decorator.js");
167
165
  var import_error_toast = require("./view/error-toast/index.js");
168
166
  var import_form = require("./view/form/index.js");
@@ -178,7 +176,7 @@ var import_radio_group = require("./view/fields/radio-group/index.js");
178
176
  var import_date_input = require("./view/fields/date-input/index.js");
179
177
  var import_date_picker = require("./view/fields/date-picker/index.js");
180
178
  var import_submit_button = require("./view/form/submit-button/index.js");
181
- var import_media_breakpoint = require("./view/media-breakpoint/index.js");
179
+ var import_use_media_query_list = require("./view/breakpoint/use-media-query-list.js");
182
180
  var import_visually_hidden = require("./view/visually-hidden/index.js");
183
181
  var import_live_message = require("./data/live-message/index.js");
184
182
  var import_error = require("./data/error/index.js");
@@ -31,14 +31,17 @@ __export(hosted_app_exports, {
31
31
  });
32
32
  var React = __toESM(require("react"));
33
33
  var import_styled_components = __toESM(require("styled-components"));
34
- var import_media_breakpoint = require("../media-breakpoint/index.js");
35
- var import_window_size = require("../window-size/index.js");
36
- var import_html_wait_message = require("../modals/wait-message/html-wait-message.js");
34
+ var import_use_breakpoint = require("../breakpoint/use-breakpoint.js");
35
+ var import_use_window_size_change = require("../use-window-size-change.js");
36
+ var import_use_html_wait_message = require("../modals/wait-message/use-html-wait-message.js");
37
37
  var import_style = __toESM(require("./style.js"));
38
38
  const Div = import_styled_components.default.div`
39
39
  height: 100%;
40
40
  `;
41
- const HostedApp = ({ children }) => /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), /* @__PURE__ */ React.createElement(import_media_breakpoint.MediaBreakpoint, null), /* @__PURE__ */ React.createElement(import_window_size.WindowSize, null), /* @__PURE__ */ React.createElement(import_html_wait_message.HTMLWaitMessage, {
42
- close: true
43
- }), children);
41
+ const HostedApp = ({ children }) => {
42
+ (0, import_use_breakpoint.useBreakpoint)();
43
+ (0, import_use_html_wait_message.useHTMLWaitMessage)(true);
44
+ (0, import_use_window_size_change.useWindowSizeChange)();
45
+ return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), children);
46
+ };
44
47
  module.exports = __toCommonJS(hosted_app_exports);
@@ -32,8 +32,8 @@ __export(stand_alone_app_exports, {
32
32
  var React = __toESM(require("react"));
33
33
  var import_styled_components = __toESM(require("styled-components"));
34
34
  var import_react_aria_live = require("react-aria-live");
35
- var import_media_breakpoint = require("../media-breakpoint/index.js");
36
- var import_window_size = require("../window-size/index.js");
35
+ var import_use_breakpoint = require("../breakpoint/use-breakpoint.js");
36
+ var import_use_window_size_change = require("../use-window-size-change.js");
37
37
  var import_session_timeout = require("../session-timeout/index.js");
38
38
  var import_live_message = require("../live-message/index.js");
39
39
  var import_error_toast = require("../error-toast/index.js");
@@ -46,5 +46,9 @@ const StandAloneApp = ({
46
46
  manageSession,
47
47
  WaitMessage,
48
48
  children
49
- }) => /* @__PURE__ */ React.createElement(import_react_aria_live.LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), manageSession && /* @__PURE__ */ React.createElement(import_session_timeout.SessionTimeout, null), /* @__PURE__ */ React.createElement(import_media_breakpoint.MediaBreakpoint, null), /* @__PURE__ */ React.createElement(import_window_size.WindowSize, null), /* @__PURE__ */ React.createElement(import_live_message.LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(import_wait_message.WaitMessage, null), /* @__PURE__ */ React.createElement(import_error_toast.ErrorToast, null), children));
49
+ }) => {
50
+ (0, import_use_breakpoint.useBreakpoint)();
51
+ (0, import_use_window_size_change.useWindowSizeChange)();
52
+ return /* @__PURE__ */ React.createElement(import_react_aria_live.LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(import_style.default, null), manageSession && /* @__PURE__ */ React.createElement(import_session_timeout.SessionTimeout, null), /* @__PURE__ */ React.createElement(import_live_message.LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(import_wait_message.WaitMessage, null), /* @__PURE__ */ React.createElement(import_error_toast.ErrorToast, null), children));
53
+ };
50
54
  module.exports = __toCommonJS(stand_alone_app_exports);
@@ -20,20 +20,20 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var media_breakpoint_exports = {};
24
- __export(media_breakpoint_exports, {
25
- MediaBreakpoint: () => MediaBreakpoint
23
+ var use_breakpoint_exports = {};
24
+ __export(use_breakpoint_exports, {
25
+ useBreakpoint: () => useBreakpoint
26
26
  });
27
27
  var import_react = require("react");
28
28
  var import_styled_components = require("styled-components");
29
29
  var import_pubsub_js = require("pubsub-js");
30
30
  var import_react_redux = require("../../data/react-redux.js");
31
31
  var import_breakpoint = require("../../data/breakpoint/index.js");
32
- var import_useMediaBreakpoints = require("../useMediaBreakpoints/index.js");
32
+ var import_use_media_query_list = require("./use-media-query-list.js");
33
33
  var import_constants = require("../../utils/constants.js");
34
- const MediaBreakpoint = () => {
34
+ const useBreakpoint = () => {
35
35
  const theme = (0, import_react.useContext)(import_styled_components.ThemeContext);
36
- const currentBreakpoint = (0, import_useMediaBreakpoints.useMediaBreakpoints)([
36
+ const currentBreakpoint = (0, import_use_media_query_list.useMediaQueryList)([
37
37
  `(max-width: ${theme.breakpoints.small})`,
38
38
  `(max-width: ${theme.breakpoints.medium})`,
39
39
  `(max-width: ${theme.breakpoints.large})`
@@ -43,6 +43,5 @@ const MediaBreakpoint = () => {
43
43
  dispatch({ type: import_breakpoint.breakpoint.change, payload: currentBreakpoint });
44
44
  (0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
45
45
  }, [currentBreakpoint, dispatch]);
46
- return null;
47
46
  };
48
- module.exports = __toCommonJS(media_breakpoint_exports);
47
+ module.exports = __toCommonJS(use_breakpoint_exports);
@@ -20,12 +20,12 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var useMediaBreakpoints_exports = {};
24
- __export(useMediaBreakpoints_exports, {
25
- useMediaBreakpoints: () => useMediaBreakpoints
23
+ var use_media_query_list_exports = {};
24
+ __export(use_media_query_list_exports, {
25
+ useMediaQueryList: () => useMediaQueryList
26
26
  });
27
27
  var import_react = require("react");
28
- const useMediaBreakpoints = (queries, values, defaultValue) => {
28
+ const useMediaQueryList = (queries, values, defaultValue) => {
29
29
  const mediaQueryLists = queries.map((q) => window.matchMedia(q));
30
30
  const getValue = (0, import_react.useCallback)(() => {
31
31
  const index = mediaQueryLists.findIndex((mql) => mql.matches);
@@ -34,9 +34,9 @@ const useMediaBreakpoints = (queries, values, defaultValue) => {
34
34
  const [value, setValue] = (0, import_react.useState)(getValue);
35
35
  (0, import_react.useEffect)(() => {
36
36
  const handler = () => setValue(getValue);
37
- mediaQueryLists.forEach((mql) => mql.addListener(handler));
38
- return () => mediaQueryLists.forEach((mql) => mql.removeListener(handler));
37
+ mediaQueryLists.forEach((mql) => mql.addEventListener("change", handler));
38
+ return () => mediaQueryLists.forEach((mql) => mql.removeEventListener("change", handler));
39
39
  }, [getValue, mediaQueryLists]);
40
40
  return value;
41
41
  };
42
- module.exports = __toCommonJS(useMediaBreakpoints_exports);
42
+ module.exports = __toCommonJS(use_media_query_list_exports);
@@ -33,7 +33,7 @@ var React = __toESM(require("react"));
33
33
  var import_react = require("react");
34
34
  var import_ds_loading_indicator = require("@elliemae/ds-loading-indicator");
35
35
  var import_react_redux = require("../../../data/react-redux.js");
36
- var import_html_wait_message = require("./html-wait-message.js");
36
+ var import_use_html_wait_message = require("./use-html-wait-message.js");
37
37
  var import_user_wait_event = require("../../../analytics/user-wait-event.js");
38
38
  const WaitMessage = (0, import_react.memo)(({
39
39
  size = "m",
@@ -48,15 +48,14 @@ const WaitMessage = (0, import_react.memo)(({
48
48
  else
49
49
  (0, import_user_wait_event.waitEndEvent)();
50
50
  }, [isOpen]);
51
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_html_wait_message.HTMLWaitMessage, {
52
- close: isOpen !== null
53
- }), /* @__PURE__ */ React.createElement(import_ds_loading_indicator.DSLoadingIndicator, {
51
+ (0, import_use_html_wait_message.useHTMLWaitMessage)(isOpen !== null);
52
+ return /* @__PURE__ */ React.createElement(import_ds_loading_indicator.DSLoadingIndicator, {
54
53
  id: "em-loading",
55
54
  size,
56
55
  style,
57
56
  ...rest,
58
57
  loading: isOpen,
59
58
  message
60
- }));
59
+ });
61
60
  });
62
61
  module.exports = __toCommonJS(wait_message_exports);
@@ -20,17 +20,16 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var html_wait_message_exports = {};
24
- __export(html_wait_message_exports, {
25
- HTMLWaitMessage: () => HTMLWaitMessage
23
+ var use_html_wait_message_exports = {};
24
+ __export(use_html_wait_message_exports, {
25
+ useHTMLWaitMessage: () => useHTMLWaitMessage
26
26
  });
27
27
  var import_react = require("react");
28
- const HTMLWaitMessage = (0, import_react.memo)(({ close }) => {
28
+ const useHTMLWaitMessage = (close) => {
29
29
  (0, import_react.useEffect)(() => {
30
30
  const htmlWaitMsgElement = document.getElementById("em-wait-message");
31
31
  if (htmlWaitMsgElement && close)
32
32
  htmlWaitMsgElement.remove();
33
33
  }, [close]);
34
- return null;
35
- });
36
- module.exports = __toCommonJS(html_wait_message_exports);
34
+ };
35
+ module.exports = __toCommonJS(use_html_wait_message_exports);
@@ -20,14 +20,14 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
20
  return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
21
21
  };
22
22
  })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
23
- var window_size_exports = {};
24
- __export(window_size_exports, {
25
- WindowSize: () => WindowSize
23
+ var use_window_size_change_exports = {};
24
+ __export(use_window_size_change_exports, {
25
+ useWindowSizeChange: () => useWindowSizeChange
26
26
  });
27
27
  var import_react = require("react");
28
28
  var import_pubsub_js = require("pubsub-js");
29
- var import_constants = require("../../utils/constants.js");
30
- const WindowSize = () => {
29
+ var import_constants = require("../utils/constants.js");
30
+ const useWindowSizeChange = () => {
31
31
  (0, import_react.useEffect)(() => {
32
32
  if (window.ResizeObserver) {
33
33
  const observer = new ResizeObserver((entries) => {
@@ -41,6 +41,5 @@ const WindowSize = () => {
41
41
  return () => {
42
42
  };
43
43
  }, []);
44
- return null;
45
44
  };
46
- module.exports = __toCommonJS(window_size_exports);
45
+ module.exports = __toCommonJS(use_window_size_change_exports);
package/dist/es/index.js CHANGED
@@ -62,7 +62,6 @@ import { renderWithRouter } from "./utils/testing/render-with-router.js";
62
62
  import { RenderWithStateAddOns } from "./utils/testing/render-with-state-addons.js";
63
63
  import { getApiActionCreator, getSelectField } from "./api/helpers.js";
64
64
  import { getUser } from "./api/users/index.js";
65
- import { useMediaBreakpoints } from "./view/useMediaBreakpoints/index.js";
66
65
  import { withAppDecorator } from "./view/storybook/decorator.js";
67
66
  import { ErrorToast } from "./view/error-toast/index.js";
68
67
  import { Form } from "./view/form/index.js";
@@ -82,7 +81,7 @@ import { RadioGroup } from "./view/fields/radio-group/index.js";
82
81
  import { DateInput } from "./view/fields/date-input/index.js";
83
82
  import { DatePicker } from "./view/fields/date-picker/index.js";
84
83
  import { FormSubmitButton } from "./view/form/submit-button/index.js";
85
- import { MediaBreakpoint } from "./view/media-breakpoint/index.js";
84
+ import { useMediaQueryList } from "./view/breakpoint/use-media-query-list.js";
86
85
  import { VisuallyHidden } from "./view/visually-hidden/index.js";
87
86
  import { actions } from "./data/live-message/index.js";
88
87
  import { actions as actions2 } from "./data/error/index.js";
@@ -114,7 +113,6 @@ export {
114
113
  LargeTextBox,
115
114
  MASK_PIPES,
116
115
  MASK_TYPES,
117
- MediaBreakpoint,
118
116
  MicroApp,
119
117
  MicroIFrameApp,
120
118
  ACTIONS as NavigationPromptActions,
@@ -185,7 +183,7 @@ export {
185
183
  useAppSelector,
186
184
  useInjectReducer,
187
185
  useInjectSaga,
188
- useMediaBreakpoints,
186
+ useMediaQueryList,
189
187
  waitMessage as waitMessageAction,
190
188
  withAppDecorator
191
189
  };
@@ -1,15 +1,18 @@
1
1
  import * as React from "react";
2
2
  import styled from "styled-components";
3
- import { MediaBreakpoint } from "../media-breakpoint/index.js";
4
- import { WindowSize } from "../window-size/index.js";
5
- import { HTMLWaitMessage } from "../modals/wait-message/html-wait-message.js";
3
+ import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
4
+ import { useWindowSizeChange } from "../use-window-size-change.js";
5
+ import { useHTMLWaitMessage } from "../modals/wait-message/use-html-wait-message.js";
6
6
  import GlobalStyle from "./style.js";
7
7
  const Div = styled.div`
8
8
  height: 100%;
9
9
  `;
10
- const HostedApp = ({ children }) => /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), /* @__PURE__ */ React.createElement(MediaBreakpoint, null), /* @__PURE__ */ React.createElement(WindowSize, null), /* @__PURE__ */ React.createElement(HTMLWaitMessage, {
11
- close: true
12
- }), children);
10
+ const HostedApp = ({ children }) => {
11
+ useBreakpoint();
12
+ useHTMLWaitMessage(true);
13
+ useWindowSizeChange();
14
+ return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), children);
15
+ };
13
16
  export {
14
17
  HostedApp
15
18
  };
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import styled from "styled-components";
3
3
  import { LiveAnnouncer } from "react-aria-live";
4
- import { MediaBreakpoint } from "../media-breakpoint/index.js";
5
- import { WindowSize } from "../window-size/index.js";
4
+ import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
5
+ import { useWindowSizeChange } from "../use-window-size-change.js";
6
6
  import { SessionTimeout } from "../session-timeout/index.js";
7
7
  import { LiveMessage } from "../live-message/index.js";
8
8
  import { ErrorToast } from "../error-toast/index.js";
@@ -15,7 +15,11 @@ const StandAloneApp = ({
15
15
  manageSession,
16
16
  WaitMessage,
17
17
  children
18
- }) => /* @__PURE__ */ React.createElement(LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), manageSession && /* @__PURE__ */ React.createElement(SessionTimeout, null), /* @__PURE__ */ React.createElement(MediaBreakpoint, null), /* @__PURE__ */ React.createElement(WindowSize, null), /* @__PURE__ */ React.createElement(LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children));
18
+ }) => {
19
+ useBreakpoint();
20
+ useWindowSizeChange();
21
+ return /* @__PURE__ */ React.createElement(LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), manageSession && /* @__PURE__ */ React.createElement(SessionTimeout, null), /* @__PURE__ */ React.createElement(LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children));
22
+ };
19
23
  export {
20
24
  StandAloneApp
21
25
  };
@@ -3,11 +3,11 @@ import { ThemeContext } from "styled-components";
3
3
  import { publish } from "pubsub-js";
4
4
  import { useAppDispatch } from "../../data/react-redux.js";
5
5
  import { breakpoint } from "../../data/breakpoint/index.js";
6
- import { useMediaBreakpoints } from "../useMediaBreakpoints/index.js";
6
+ import { useMediaQueryList } from "./use-media-query-list.js";
7
7
  import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
8
- const MediaBreakpoint = () => {
8
+ const useBreakpoint = () => {
9
9
  const theme = useContext(ThemeContext);
10
- const currentBreakpoint = useMediaBreakpoints([
10
+ const currentBreakpoint = useMediaQueryList([
11
11
  `(max-width: ${theme.breakpoints.small})`,
12
12
  `(max-width: ${theme.breakpoints.medium})`,
13
13
  `(max-width: ${theme.breakpoints.large})`
@@ -17,8 +17,7 @@ const MediaBreakpoint = () => {
17
17
  dispatch({ type: breakpoint.change, payload: currentBreakpoint });
18
18
  publish(HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
19
19
  }, [currentBreakpoint, dispatch]);
20
- return null;
21
20
  };
22
21
  export {
23
- MediaBreakpoint
22
+ useBreakpoint
24
23
  };
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useCallback } from "react";
2
- const useMediaBreakpoints = (queries, values, defaultValue) => {
2
+ const useMediaQueryList = (queries, values, defaultValue) => {
3
3
  const mediaQueryLists = queries.map((q) => window.matchMedia(q));
4
4
  const getValue = useCallback(() => {
5
5
  const index = mediaQueryLists.findIndex((mql) => mql.matches);
@@ -8,11 +8,11 @@ const useMediaBreakpoints = (queries, values, defaultValue) => {
8
8
  const [value, setValue] = useState(getValue);
9
9
  useEffect(() => {
10
10
  const handler = () => setValue(getValue);
11
- mediaQueryLists.forEach((mql) => mql.addListener(handler));
12
- return () => mediaQueryLists.forEach((mql) => mql.removeListener(handler));
11
+ mediaQueryLists.forEach((mql) => mql.addEventListener("change", handler));
12
+ return () => mediaQueryLists.forEach((mql) => mql.removeEventListener("change", handler));
13
13
  }, [getValue, mediaQueryLists]);
14
14
  return value;
15
15
  };
16
16
  export {
17
- useMediaBreakpoints
17
+ useMediaQueryList
18
18
  };
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { memo, useEffect } from "react";
3
3
  import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
4
4
  import { useAppSelector } from "../../../data/react-redux.js";
5
- import { HTMLWaitMessage } from "./html-wait-message.js";
5
+ import { useHTMLWaitMessage } from "./use-html-wait-message.js";
6
6
  import {
7
7
  waitStartEvent,
8
8
  waitEndEvent
@@ -20,16 +20,15 @@ const WaitMessage = memo(({
20
20
  else
21
21
  waitEndEvent();
22
22
  }, [isOpen]);
23
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(HTMLWaitMessage, {
24
- close: isOpen !== null
25
- }), /* @__PURE__ */ React.createElement(DSLoadingIndicator, {
23
+ useHTMLWaitMessage(isOpen !== null);
24
+ return /* @__PURE__ */ React.createElement(DSLoadingIndicator, {
26
25
  id: "em-loading",
27
26
  size,
28
27
  style,
29
28
  ...rest,
30
29
  loading: isOpen,
31
30
  message
32
- }));
31
+ });
33
32
  });
34
33
  export {
35
34
  WaitMessage
@@ -1,12 +1,11 @@
1
- import { memo, useEffect } from "react";
2
- const HTMLWaitMessage = memo(({ close }) => {
1
+ import { useEffect } from "react";
2
+ const useHTMLWaitMessage = (close) => {
3
3
  useEffect(() => {
4
4
  const htmlWaitMsgElement = document.getElementById("em-wait-message");
5
5
  if (htmlWaitMsgElement && close)
6
6
  htmlWaitMsgElement.remove();
7
7
  }, [close]);
8
- return null;
9
- });
8
+ };
10
9
  export {
11
- HTMLWaitMessage
10
+ useHTMLWaitMessage
12
11
  };
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from "react";
2
2
  import { publish } from "pubsub-js";
3
- import { HOST_WINDOW_RESIZED } from "../../utils/constants.js";
4
- const WindowSize = () => {
3
+ import { HOST_WINDOW_RESIZED } from "../utils/constants.js";
4
+ const useWindowSizeChange = () => {
5
5
  useEffect(() => {
6
6
  if (window.ResizeObserver) {
7
7
  const observer = new ResizeObserver((entries) => {
@@ -15,8 +15,7 @@ const WindowSize = () => {
15
15
  return () => {
16
16
  };
17
17
  }, []);
18
- return null;
19
18
  };
20
19
  export {
21
- WindowSize
20
+ useWindowSizeChange
22
21
  };
@@ -41,7 +41,6 @@ export { renderWithRouter } from './utils/testing/render-with-router.js';
41
41
  export { RenderWithStateAddOns } from './utils/testing/render-with-state-addons.js';
42
42
  export { getApiActionCreator, getSelectField } from './api/helpers.js';
43
43
  export { getUser as fetchUserSettings } from './api/users/index.js';
44
- export { useMediaBreakpoints } from './view/useMediaBreakpoints/index.js';
45
44
  export { withAppDecorator } from './view/storybook/decorator.js';
46
45
  export { ErrorToast } from './view/error-toast/index.js';
47
46
  export { Form } from './view/form/index.js';
@@ -57,7 +56,7 @@ export { RadioGroup } from './view/fields/radio-group/index.js';
57
56
  export { DateInput } from './view/fields/date-input/index.js';
58
57
  export { DatePicker } from './view/fields/date-picker/index.js';
59
58
  export { FormSubmitButton } from './view/form/submit-button/index.js';
60
- export { MediaBreakpoint } from './view/media-breakpoint/index.js';
59
+ export { useMediaQueryList } from './view/breakpoint/use-media-query-list.js';
61
60
  export { VisuallyHidden } from './view/visually-hidden/index.js';
62
61
  export { actions as ariaLive } from './data/live-message/index.js';
63
62
  export { actions as error } from './data/error/index.js';
@@ -0,0 +1 @@
1
+ export declare const useBreakpoint: () => void;
@@ -0,0 +1 @@
1
+ export declare const useMediaQueryList: (queries: Array<string>, values: Array<string>, defaultValue: string) => string;
@@ -0,0 +1 @@
1
+ export declare const useHTMLWaitMessage: (close: boolean) => void;
@@ -0,0 +1 @@
1
+ export declare const useWindowSizeChange: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "3.0.0-beta.20",
3
+ "version": "3.0.0-beta.21",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -1 +0,0 @@
1
- export declare const MediaBreakpoint: () => null;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- declare type HTMLWaitMessageProps = {
3
- close: boolean;
4
- };
5
- export declare const HTMLWaitMessage: import("react").NamedExoticComponent<HTMLWaitMessageProps>;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const useMediaBreakpoints: (queries: Array<string>, values: Array<string>, defaultValue: string) => string;
@@ -1 +0,0 @@
1
- export declare const WindowSize: () => null;