@easypost/easy-ui 1.0.0-alpha.75 → 1.0.0-alpha.76

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.
@@ -73,7 +73,18 @@ export type NotificationItemStateProps = AriaToastProps<NotificationProps> & {
73
73
  * function that is called when an alert is dismissed. The `state` prop captures stateful information,
74
74
  * such as functions that can interact with the queue in a programmatic way.
75
75
  */
76
- export declare function Notification(props: NotificationItemStateProps): React.JSX.Element;
76
+ export declare const Notification: React.ForwardRefExoticComponent<AriaToastProps<NotificationProps> & {
77
+ /**
78
+ * The `toast` name here is an artifact of react-stately, not an Easy UI `toast`
79
+ * it is more appropriate to think of this as a `notification`.
80
+ */
81
+ toast: QueuedNotification;
82
+ /**
83
+ * Holds the internal state for notifications and the functions that directly
84
+ * interact with the queue object. Consumers do not see this state.
85
+ */
86
+ state: NotificationInternalState;
87
+ } & React.RefAttributes<HTMLDivElement>>;
77
88
  export declare const NotificationContext: React.Context<NotificationExternalState | null>;
78
89
  /**
79
90
  * Notifications of type alert or toast can be displayed using this hook. The hook returns a notification
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../src/Notification/Notification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAqC,MAAM,OAAO,CAAC;AAO5E,OAAO,EAAE,cAAc,EAAY,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAS/D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,qBAAqB,GAAG;IAClC,wBAAwB;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,2BAA2B;IAC3B,OAAO,EAAE,SAAS,CAAC;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hC,CAAC;AAmBH,eAAO,MAAM,mBAAmB,iDACuB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuHG;AACH,wBAAgB,eAAe,8BAS9B;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iBAAiB;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,UAAU,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAAG;IAClC,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACxC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,yBAAyB;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,uBAAuB;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,mCAAmC;IACnC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAqCpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationContainer.d.ts","sourceRoot":"","sources":["../../src/Notification/NotificationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,MAAM,0BAA0B,GAAG;IACvC,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACxC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,yBAAyB;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,KAAK,EAAE,yBAAyB,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBA6CtE"}
1
+ {"version":3,"file":"NotificationContainer.d.ts","sourceRoot":"","sources":["../../src/Notification/NotificationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,0BAA0B,GAAG;IACvC,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACxC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,yBAAyB;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,KAAK,EAAE,yBAAyB,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBAmDtE"}
@@ -1,16 +1,21 @@
1
+ import { AriaToastRegionProps } from "@react-aria/toast";
1
2
  import React from "react";
2
3
  import { NotificationInternalState } from "./Notification";
3
- import { AriaToastRegionProps } from "@react-aria/toast";
4
+ import { NotificationTransitionProps } from "./NotificationTransition";
4
5
  export type NotificationRegionProps = AriaToastRegionProps & {
5
6
  /**
6
7
  * Holds the internal state for notifications and the functions that directly
7
8
  * interact with the queue object. Consumers do not see this state.
8
9
  */
9
10
  state: NotificationInternalState;
11
+ /**
12
+ * Callback function used to track the transition state of the notification.
13
+ */
14
+ onTransitionPendingChange: NotificationTransitionProps["onTransitionPendingChange"];
10
15
  };
11
16
  /**
12
17
  * @privateRemarks
13
- * This componenet is responsible for rendering individual notifications into
18
+ * This component is responsible for rendering individual notifications into
14
19
  * a region.
15
20
  */
16
21
  export declare function NotificationRegion(props: NotificationRegionProps): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationRegion.d.ts","sourceRoot":"","sources":["../../src/Notification/NotificationRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAgB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAkB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzE,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG;IAC3D;;;OAGG;IACH,KAAK,EAAE,yBAAyB,CAAC;CAClC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,qBAgBhE"}
1
+ {"version":3,"file":"NotificationRegion.d.ts","sourceRoot":"","sources":["../../src/Notification/NotificationRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAkB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAgB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAEL,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG;IAC3D;;;OAGG;IACH,KAAK,EAAE,yBAAyB,CAAC;IAEjC;;OAEG;IACH,yBAAyB,EAAE,2BAA2B,CAAC,2BAA2B,CAAC,CAAC;CACrF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,qBA0BhE"}
@@ -0,0 +1,29 @@
1
+ import React, { Key, RefObject, ReactNode } from "react";
2
+ type ChildrenFunction<T> = (args: T) => ReactNode;
3
+ export type NotificationTransitionProps = {
4
+ /**
5
+ * Children function that receives a ref to the node being transitioned.
6
+ */
7
+ children: ChildrenFunction<{
8
+ nodeRef: RefObject<HTMLDivElement>;
9
+ }>;
10
+ /**
11
+ * Unique key for the transition.
12
+ */
13
+ transitionKey: Key;
14
+ /**
15
+ * Callback function used to track the transition state of the notification.
16
+ */
17
+ onTransitionPendingChange?: (isTransitionPending: boolean) => void;
18
+ };
19
+ export declare function NotificationTransition({ children, transitionKey, onTransitionPendingChange, ...transitionGroupProps }: NotificationTransitionProps): React.JSX.Element;
20
+ /**
21
+ * Track when a list of transitions are complete in a TransitionGroup. Useful
22
+ * for showing/hiding a notification container while transitions are pending.
23
+ */
24
+ export declare function useNotificationTransitionTracking(): {
25
+ isTransitionPending: boolean;
26
+ onTransitionPendingChange: (isTransitionPending: boolean) => void;
27
+ };
28
+ export {};
29
+ //# sourceMappingURL=NotificationTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationTransition.d.ts","sourceRoot":"","sources":["../../src/Notification/NotificationTransition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAY,SAAS,EAAe,MAAM,OAAO,CAAC;AAIhF,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;AAElD,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;QAAE,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAA;KAAE,CAAC,CAAC;IAEnE;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;IAEnB;;OAEG;IACH,yBAAyB,CAAC,EAAE,CAAC,mBAAmB,EAAE,OAAO,KAAK,IAAI,CAAC;CACpE,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,aAAa,EACb,yBAAoC,EACpC,GAAG,oBAAoB,EACxB,EAAE,2BAA2B,qBAiC7B;AAED;;;GAGG;AACH,wBAAgB,iCAAiC;;qDAES,OAAO;EAShE"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Notification = require("../__chunks__/Notification-BCS0ugaf.js");
3
+ const Notification = require("../__chunks__/Notification-B_dzUkJq.js");
4
4
  exports.Notification = Notification.Notification;
5
5
  exports.NotificationContext = Notification.NotificationContext;
6
6
  exports.NotificationProvider = Notification.NotificationProvider;
@@ -1,4 +1,4 @@
1
- import { N, a, b, u } from "../__chunks__/Notification-lg6ggtug.mjs";
1
+ import { N, a, b, u } from "../__chunks__/Notification-C-_hCM1v.mjs";
2
2
  export {
3
3
  N as Notification,
4
4
  a as NotificationContext,
package/Provider/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const usePress = require("../__chunks__/usePress-DchxjERD.js");
4
4
  const React = require("react");
5
- const Notification = require("../__chunks__/Notification-BCS0ugaf.js");
5
+ const Notification = require("../__chunks__/Notification-B_dzUkJq.js");
6
6
  const Theme = require("../__chunks__/Theme-Ck5K42IR.js");
7
7
  function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
8
8
  return React.createElement(EasyUIRouterProvider, {
@@ -1,6 +1,6 @@
1
1
  import { d as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb } from "../__chunks__/usePress-BH70cn5g.mjs";
2
2
  import React__default from "react";
3
- import { b as NotificationProvider } from "../__chunks__/Notification-lg6ggtug.mjs";
3
+ import { b as NotificationProvider } from "../__chunks__/Notification-C-_hCM1v.mjs";
4
4
  import { T as ThemeProvider } from "../__chunks__/Theme-CctofSlt.mjs";
5
5
  function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
6
6
  return React__default.createElement(EasyUIRouterProvider, {