@fluentui/react-toast 9.6.4 → 9.7.0
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 +23 -2
- package/dist/index.d.ts +47 -2
- package/lib/components/ToastContainer/ToastContainer.types.js.map +1 -1
- package/lib/components/ToastTrigger/useToastTrigger.js +2 -2
- package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +1 -1
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib-commonjs/index.js +4 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-toast
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu,
|
|
3
|
+
This log was last generated on Thu, 21 Aug 2025 12:20:27 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.7.0)
|
|
8
|
+
|
|
9
|
+
Thu, 21 Aug 2025 12:20:27 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.6.4..@fluentui/react-toast_v9.7.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- feat: Export ToastContainer state and classNames nessecary for style overrides ([PR #35007](https://github.com/microsoft/fluentui/pull/35007) by mifraser@microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-aria to v9.16.4 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.1.6 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
17
|
+
- Bump @fluentui/react-motion to v9.10.3 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
18
|
+
- Bump @fluentui/react-motion-components-preview to v0.9.0 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
19
|
+
- Bump @fluentui/react-portal to v9.8.1 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
20
|
+
- Bump @fluentui/react-shared-contexts to v9.25.0 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.26.4 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v9.24.0 ([PR #35055](https://github.com/microsoft/fluentui/pull/35055) by beachball)
|
|
23
|
+
|
|
24
|
+
### Patches
|
|
25
|
+
|
|
26
|
+
- fix: replace deprecated element.ref usages to support react 19 ([PR #35030](https://github.com/microsoft/fluentui/pull/35030) by dmytrokirpa@microsoft.com)
|
|
27
|
+
|
|
7
28
|
## [9.6.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.6.4)
|
|
8
29
|
|
|
9
|
-
Thu, 07 Aug 2025
|
|
30
|
+
Thu, 07 Aug 2025 10:03:29 GMT
|
|
10
31
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.6.3..@fluentui/react-toast_v9.6.4)
|
|
11
32
|
|
|
12
33
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
1
|
import { ARIAButtonResultProps } from '@fluentui/react-aria';
|
|
4
2
|
import { ARIAButtonType } from '@fluentui/react-aria';
|
|
5
3
|
import { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';
|
|
@@ -77,6 +75,13 @@ export declare const renderToastTrigger_unstable: (state: ToastTriggerState) =>
|
|
|
77
75
|
|
|
78
76
|
declare type RootSlot = Slot<'div'>;
|
|
79
77
|
|
|
78
|
+
declare type TimerProps = {
|
|
79
|
+
running: boolean;
|
|
80
|
+
timeout: number;
|
|
81
|
+
onTimeout: () => void;
|
|
82
|
+
as?: 'span';
|
|
83
|
+
};
|
|
84
|
+
|
|
80
85
|
/**
|
|
81
86
|
* Toast component
|
|
82
87
|
*/
|
|
@@ -135,6 +140,8 @@ declare type ToastChangeHandler = (event: null, data: ToastChangeData) => void;
|
|
|
135
140
|
|
|
136
141
|
export declare const toastClassNames: SlotClassNames<ToastSlots>;
|
|
137
142
|
|
|
143
|
+
export declare const toastContainerClassNames: SlotClassNames<ToastContainerSlots>;
|
|
144
|
+
|
|
138
145
|
declare type ToastContainerContextValue = {
|
|
139
146
|
close: () => void;
|
|
140
147
|
intent: ToastIntent | undefined;
|
|
@@ -142,6 +149,44 @@ declare type ToastContainerContextValue = {
|
|
|
142
149
|
titleId: string;
|
|
143
150
|
};
|
|
144
151
|
|
|
152
|
+
/**
|
|
153
|
+
* ToastContainer Props
|
|
154
|
+
*/
|
|
155
|
+
declare type ToastContainerProps = Omit<ComponentProps<Partial<ToastContainerSlots>>, 'content'> & Toast_2 & {
|
|
156
|
+
visible: boolean;
|
|
157
|
+
announce: Announce;
|
|
158
|
+
intent: ToastIntent | undefined;
|
|
159
|
+
tryRestoreFocus: () => void;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
declare type ToastContainerSlots = {
|
|
163
|
+
root: NonNullable<Slot<'div'>>;
|
|
164
|
+
timer: NonNullable<Slot<TimerProps>>;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* State used in rendering ToastContainer
|
|
169
|
+
*/
|
|
170
|
+
export declare type ToastContainerState = ComponentState<ToastContainerSlots> & Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> & Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated Will be always "0".
|
|
173
|
+
*/
|
|
174
|
+
transitionTimeout: number;
|
|
175
|
+
timerTimeout: number;
|
|
176
|
+
running: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* @deprecated Will be always no-op.
|
|
179
|
+
*/
|
|
180
|
+
onTransitionEntering: () => void;
|
|
181
|
+
/**
|
|
182
|
+
* @deprecated now merged with root ref
|
|
183
|
+
*/
|
|
184
|
+
nodeRef: React_2.Ref<HTMLDivElement>;
|
|
185
|
+
onMotionFinish?: (event: null, data: {
|
|
186
|
+
direction: 'enter' | 'exit';
|
|
187
|
+
}) => void;
|
|
188
|
+
};
|
|
189
|
+
|
|
145
190
|
declare type ToastContextValues = {
|
|
146
191
|
backgroundAppearance: BackgroundAppearanceContextValue;
|
|
147
192
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastContainer/ToastContainer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Announce } from '../AriaLive/AriaLive.types';\nimport { Toast, ToastIntent } from '../../state';\nimport { ToastContainerContextValue } from '../../contexts/toastContainerContext';\nimport { TimerProps } from '../Timer/Timer';\n\nexport type ToastContainerContextValues = {\n toast: ToastContainerContextValue;\n};\n\nexport type ToastContainerSlots = {\n root: NonNullable<Slot<'div'>>;\n timer: NonNullable<Slot<TimerProps>>;\n};\n\n/**\n * ToastContainer Props\n */\nexport type ToastContainerProps = Omit<ComponentProps<Partial<ToastContainerSlots>>, 'content'> &\n Toast & {\n visible: boolean;\n announce: Announce;\n intent: ToastIntent | undefined;\n tryRestoreFocus: () => void;\n };\n\n/**\n * State used in rendering ToastContainer\n */\nexport type ToastContainerState = ComponentState<ToastContainerSlots> &\n Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> &\n Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {\n /**\n * @deprecated Will be always \"0\".\n */\n transitionTimeout: number;\n timerTimeout: number;\n running: boolean;\n /**\n * @deprecated Will be always no-op.\n */\n onTransitionEntering: () => void;\n /**\n * @deprecated\n */\n nodeRef: React.Ref<HTMLDivElement>;\n\n onMotionFinish?: (event: null, data: { direction: 'enter' | 'exit' }) => void;\n };\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastContainer/ToastContainer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Announce } from '../AriaLive/AriaLive.types';\nimport { Toast, ToastIntent } from '../../state';\nimport { ToastContainerContextValue } from '../../contexts/toastContainerContext';\nimport { TimerProps } from '../Timer/Timer';\n\nexport type ToastContainerContextValues = {\n toast: ToastContainerContextValue;\n};\n\nexport type ToastContainerSlots = {\n root: NonNullable<Slot<'div'>>;\n timer: NonNullable<Slot<TimerProps>>;\n};\n\n/**\n * ToastContainer Props\n */\nexport type ToastContainerProps = Omit<ComponentProps<Partial<ToastContainerSlots>>, 'content'> &\n Toast & {\n visible: boolean;\n announce: Announce;\n intent: ToastIntent | undefined;\n tryRestoreFocus: () => void;\n };\n\n/**\n * State used in rendering ToastContainer\n */\nexport type ToastContainerState = ComponentState<ToastContainerSlots> &\n Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> &\n Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {\n /**\n * @deprecated Will be always \"0\".\n */\n transitionTimeout: number;\n timerTimeout: number;\n running: boolean;\n /**\n * @deprecated Will be always no-op.\n */\n onTransitionEntering: () => void;\n /**\n * @deprecated now merged with root ref\n */\n nodeRef: React.Ref<HTMLDivElement>;\n\n onMotionFinish?: (event: null, data: { direction: 'enter' | 'exit' }) => void;\n };\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';
|
|
2
|
+
import { applyTriggerPropsToChildren, getTriggerChild, getReactElementRef, useEventCallback } from '@fluentui/react-utilities';
|
|
3
3
|
import { useARIAButtonProps } from '@fluentui/react-aria';
|
|
4
4
|
import { useToastContainerContext } from '../../contexts/toastContainerContext';
|
|
5
5
|
/**
|
|
@@ -23,7 +23,7 @@ import { useToastContainerContext } from '../../contexts/toastContainerContext';
|
|
|
23
23
|
});
|
|
24
24
|
const triggerChildProps = {
|
|
25
25
|
...child === null || child === void 0 ? void 0 : child.props,
|
|
26
|
-
ref: child
|
|
26
|
+
ref: getReactElementRef(child),
|
|
27
27
|
onClick: handleClick
|
|
28
28
|
};
|
|
29
29
|
const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastTrigger/useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastTrigger/useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport type { ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */\nexport const useToastTrigger_unstable = (props: ToastTriggerProps): ToastTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const { close } = useToastContainerContext();\n\n const child = getTriggerChild(children);\n\n const handleClick = useEventCallback(\n (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: getReactElementRef<HTMLButtonElement>(child),\n onClick: handleClick,\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","useEventCallback","useARIAButtonProps","useToastContainerContext","useToastTrigger_unstable","props","children","disableButtonEnhancement","close","child","handleClick","e","onClick","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","type"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,2BAA2B,EAC3BC,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,QACX,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,SAASC,wBAAwB,QAAQ,uCAAuC;AAEhF;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAM,EAAEG,KAAK,EAAE,GAAGL;IAElB,MAAMM,QAAQV,gBAAgBO;IAE9B,MAAMI,cAAcT,iBAClB,CAACU;YACCF,sBAAAA;QAAAA,kBAAAA,6BAAAA,uBAAAA,CAAAA,eAAAA,MAAOJ,KAAK,EAACO,OAAO,cAApBH,2CAAAA,0BAAAA,cAAuBE;QACvB,IAAI,CAACA,EAAEE,kBAAkB,IAAI;YAC3BL;QACF;IACF;IAGF,MAAMM,oBAAoB;WACrBL,kBAAAA,4BAAAA,MAAOJ,KAAK,AAAf;QACAU,KAAKf,mBAAsCS;QAC3CG,SAASF;IACX;IAEA,MAAMM,8BAA8Bd,mBAClCO,CAAAA,kBAAAA,4BAAAA,MAAOQ,IAAI,MAAK,YAAYR,CAAAA,kBAAAA,4BAAAA,MAAOQ,IAAI,MAAK,MAAMR,MAAMQ,IAAI,GAAG,OAC/D;QACE,GAAGH,iBAAiB;QACpBG,MAAM;IACR;IAGF,OAAO;QACLX,UAAUR,4BACRQ,UACAC,2BAA2BO,oBAAoBE;IAEnD;AACF,EAAE"}
|
package/lib/index.js
CHANGED
|
@@ -5,3 +5,4 @@ export { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable
|
|
|
5
5
|
export { ToastTitle, useToastTitleStyles_unstable, useToastTitle_unstable, renderToastTitle_unstable, toastTitleClassNames } from './ToastTitle';
|
|
6
6
|
export { ToastBody, useToastBodyStyles_unstable, useToastBody_unstable, renderToastBody_unstable, toastBodyClassNames } from './ToastBody';
|
|
7
7
|
export { ToastFooter, useToastFooterStyles_unstable, useToastFooter_unstable, renderToastFooter_unstable, toastFooterClassNames } from './ToastFooter';
|
|
8
|
+
export { toastContainerClassNames } from './ToastContainer';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController } from './state';\nexport type { ToastPosition, ToastId, ToastOffset, ToastPoliteness, ToastStatus, ToastIntent } from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';\nexport type { ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type { ToastTitleProps, ToastTitleState, ToastTitleSlots } from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type { ToastBodyProps, ToastBodyState, ToastBodySlots } from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n"],"names":["useToastController","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","Toast","useToastStyles_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,UAAU;AAG7C,SAASC,YAAY,EAAEC,wBAAwB,EAAEC,2BAA2B,QAAQ,iBAAiB;AAErG,SACEC,OAAO,EACPC,mBAAmB,EACnBC,yBAAyB,EACzBC,sBAAsB,EACtBC,iBAAiB,QACZ,YAAY;AAEnB,SAASC,KAAK,EAAEC,uBAAuB,EAAEC,iBAAiB,EAAEC,oBAAoB,EAAEC,eAAe,QAAQ,UAAU;AAGnH,SACEC,UAAU,EACVC,4BAA4B,EAC5BC,sBAAsB,EACtBC,yBAAyB,EACzBC,oBAAoB,QACf,eAAe;AAGtB,SACEC,SAAS,EACTC,2BAA2B,EAC3BC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,QACd,cAAc;AAGrB,SACEC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,0BAA0B,EAC1BC,qBAAqB,QAChB,gBAAgB"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController } from './state';\nexport type { ToastPosition, ToastId, ToastOffset, ToastPoliteness, ToastStatus, ToastIntent } from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';\nexport type { ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type { ToastTitleProps, ToastTitleState, ToastTitleSlots } from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type { ToastBodyProps, ToastBodyState, ToastBodySlots } from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n\nexport { toastContainerClassNames } from './ToastContainer';\nexport type { ToastContainerState } from './ToastContainer';\n"],"names":["useToastController","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","Toast","useToastStyles_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames","toastContainerClassNames"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,UAAU;AAG7C,SAASC,YAAY,EAAEC,wBAAwB,EAAEC,2BAA2B,QAAQ,iBAAiB;AAErG,SACEC,OAAO,EACPC,mBAAmB,EACnBC,yBAAyB,EACzBC,sBAAsB,EACtBC,iBAAiB,QACZ,YAAY;AAEnB,SAASC,KAAK,EAAEC,uBAAuB,EAAEC,iBAAiB,EAAEC,oBAAoB,EAAEC,eAAe,QAAQ,UAAU;AAGnH,SACEC,UAAU,EACVC,4BAA4B,EAC5BC,sBAAsB,EACtBC,yBAAyB,EACzBC,oBAAoB,QACf,eAAe;AAGtB,SACEC,SAAS,EACTC,2BAA2B,EAC3BC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,QACd,cAAc;AAGrB,SACEC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,0BAA0B,EAC1BC,qBAAqB,QAChB,gBAAgB;AAGvB,SAASC,wBAAwB,QAAQ,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastContainer/ToastContainer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Announce } from '../AriaLive/AriaLive.types';\nimport { Toast, ToastIntent } from '../../state';\nimport { ToastContainerContextValue } from '../../contexts/toastContainerContext';\nimport { TimerProps } from '../Timer/Timer';\n\nexport type ToastContainerContextValues = {\n toast: ToastContainerContextValue;\n};\n\nexport type ToastContainerSlots = {\n root: NonNullable<Slot<'div'>>;\n timer: NonNullable<Slot<TimerProps>>;\n};\n\n/**\n * ToastContainer Props\n */\nexport type ToastContainerProps = Omit<ComponentProps<Partial<ToastContainerSlots>>, 'content'> &\n Toast & {\n visible: boolean;\n announce: Announce;\n intent: ToastIntent | undefined;\n tryRestoreFocus: () => void;\n };\n\n/**\n * State used in rendering ToastContainer\n */\nexport type ToastContainerState = ComponentState<ToastContainerSlots> &\n Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> &\n Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {\n /**\n * @deprecated Will be always \"0\".\n */\n transitionTimeout: number;\n timerTimeout: number;\n running: boolean;\n /**\n * @deprecated Will be always no-op.\n */\n onTransitionEntering: () => void;\n /**\n * @deprecated\n */\n nodeRef: React.Ref<HTMLDivElement>;\n\n onMotionFinish?: (event: null, data: { direction: 'enter' | 'exit' }) => void;\n };\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastContainer/ToastContainer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { Announce } from '../AriaLive/AriaLive.types';\nimport { Toast, ToastIntent } from '../../state';\nimport { ToastContainerContextValue } from '../../contexts/toastContainerContext';\nimport { TimerProps } from '../Timer/Timer';\n\nexport type ToastContainerContextValues = {\n toast: ToastContainerContextValue;\n};\n\nexport type ToastContainerSlots = {\n root: NonNullable<Slot<'div'>>;\n timer: NonNullable<Slot<TimerProps>>;\n};\n\n/**\n * ToastContainer Props\n */\nexport type ToastContainerProps = Omit<ComponentProps<Partial<ToastContainerSlots>>, 'content'> &\n Toast & {\n visible: boolean;\n announce: Announce;\n intent: ToastIntent | undefined;\n tryRestoreFocus: () => void;\n };\n\n/**\n * State used in rendering ToastContainer\n */\nexport type ToastContainerState = ComponentState<ToastContainerSlots> &\n Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> &\n Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {\n /**\n * @deprecated Will be always \"0\".\n */\n transitionTimeout: number;\n timerTimeout: number;\n running: boolean;\n /**\n * @deprecated Will be always no-op.\n */\n onTransitionEntering: () => void;\n /**\n * @deprecated now merged with root ref\n */\n nodeRef: React.Ref<HTMLDivElement>;\n\n onMotionFinish?: (event: null, data: { direction: 'enter' | 'exit' }) => void;\n };\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
|
|
@@ -26,7 +26,7 @@ const useToastTrigger_unstable = (props)=>{
|
|
|
26
26
|
});
|
|
27
27
|
const triggerChildProps = {
|
|
28
28
|
...child === null || child === void 0 ? void 0 : child.props,
|
|
29
|
-
ref:
|
|
29
|
+
ref: (0, _reactutilities.getReactElementRef)(child),
|
|
30
30
|
onClick: handleClick
|
|
31
31
|
};
|
|
32
32
|
const ariaButtonTriggerChildProps = (0, _reactaria.useARIAButtonProps)((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastTrigger/useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastTrigger/useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n getReactElementRef,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport type { ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */\nexport const useToastTrigger_unstable = (props: ToastTriggerProps): ToastTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const { close } = useToastContainerContext();\n\n const child = getTriggerChild(children);\n\n const handleClick = useEventCallback(\n (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: getReactElementRef<HTMLButtonElement>(child),\n onClick: handleClick,\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","getReactElementRef","useEventCallback","useARIAButtonProps","useToastContainerContext","useToastTrigger_unstable","props","children","disableButtonEnhancement","close","child","handleClick","e","onClick","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","type"],"mappings":";;;;+BAoBaO;;;;;;;iEApBU,QAAQ;gCAMxB,4BAA4B;2BACA,uBAAuB;uCAEjB,uCAAuC;AAWzE,iCAAiC,CAACC;IACvC,MAAM,EAAEC,QAAQ,EAAEC,2BAA2B,KAAK,EAAE,GAAGF;IACvD,MAAM,EAAEG,KAAK,EAAE,OAAGL,+CAAAA;IAElB,MAAMM,YAAQV,+BAAAA,EAAgBO;IAE9B,MAAMI,kBAAcT,gCAAAA,EAClB,CAACU;YACCF,sBAAAA;QAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAAAA,CAAAA,eAAAA,MAAOJ,KAAAA,AAAK,EAACO,OAAAA,AAAO,MAAA,QAApBH,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,IAAAA,CAAAA,cAAuBE;QACvB,IAAI,CAACA,EAAEE,kBAAkB,IAAI;YAC3BL;QACF;IACF;IAGF,MAAMM,oBAAoB;WACrBL,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOJ,KAAV;QACAU,SAAKf,kCAAAA,EAAsCS;QAC3CG,SAASF;IACX;IAEA,MAAMM,kCAA8Bd,6BAAAA,EAClCO,WAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,IAAAA,AAAI,MAAK,YAAYR,CAAAA,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOQ,IAAAA,AAAI,MAAK,MAAMR,MAAMQ,IAAI,GAAG,OAC/D;QACE,GAAGH,iBAAiB;QACpBG,MAAM;IACR;IAGF,OAAO;QACLX,cAAUR,2CAAAA,EACRQ,UACAC,2BAA2BO,oBAAoBE;IAEnD;AACF,EAAE"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -51,6 +51,9 @@ _export(exports, {
|
|
|
51
51
|
toastClassNames: function() {
|
|
52
52
|
return _Toast.toastClassNames;
|
|
53
53
|
},
|
|
54
|
+
toastContainerClassNames: function() {
|
|
55
|
+
return _ToastContainer.toastContainerClassNames;
|
|
56
|
+
},
|
|
54
57
|
toastFooterClassNames: function() {
|
|
55
58
|
return _ToastFooter.toastFooterClassNames;
|
|
56
59
|
},
|
|
@@ -104,3 +107,4 @@ const _Toast = require("./Toast");
|
|
|
104
107
|
const _ToastTitle = require("./ToastTitle");
|
|
105
108
|
const _ToastBody = require("./ToastBody");
|
|
106
109
|
const _ToastFooter = require("./ToastFooter");
|
|
110
|
+
const _ToastContainer = require("./ToastContainer");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController } from './state';\nexport type { ToastPosition, ToastId, ToastOffset, ToastPoliteness, ToastStatus, ToastIntent } from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';\nexport type { ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type { ToastTitleProps, ToastTitleState, ToastTitleSlots } from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type { ToastBodyProps, ToastBodyState, ToastBodySlots } from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n"],"names":["useToastController","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","Toast","useToastStyles_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames"],"mappings":";;;;;;;;;;;IAaSS,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController } from './state';\nexport type { ToastPosition, ToastId, ToastOffset, ToastPoliteness, ToastStatus, ToastIntent } from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';\nexport type { ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type { ToastTitleProps, ToastTitleState, ToastTitleSlots } from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type { ToastBodyProps, ToastBodyState, ToastBodySlots } from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n\nexport { toastContainerClassNames } from './ToastContainer';\nexport type { ToastContainerState } from './ToastContainer';\n"],"names":["useToastController","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","Toast","useToastStyles_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames","toastContainerClassNames"],"mappings":";;;;;;;;;;;IAaSS;2BAAK;;;eAaZU,oBAAS;;;eASTK,wBAAW;;IAlBXV;qCAAU;;;eAdHb,0BAAY;;;eAGnBG,gBAAO;;4BAuBiB;eAAxBkB;;IASAK;sDAA0B;;6BAlBD;eAAzBV;;;eAjB+Cd,yCAA2B;;;eAUhBS,2BAAoB;;0BAJxD;eAAtBL;;;eAqBAgB,8BAAmB;;;eAjB6DV,sBAAe;;;eA8BxFgB,wCAAwB;;IAJ/BD,qBAAqB;;;wBAlBD;eAApBV;;;eAXAV,0BAAiB;;;eAiBjBY,sCAA2B;;;eAC3BC,gCAAqB;;;eA5BdrB,yBAAkB;;IAoCzByB;yDAA6B;;;eAC7BC,oCAAuB;;;eAxBThB,8BAAuB;;;eAKrCK,wCAA4B;;;eAC5BC,kCAAsB;;;eAhBDd,sCAAwB;;;eAUNS,wBAAiB;;6BAL/B;eAAzBL;;;eADAD,4BAAmB;;;uBAPc,UAAU;8BAGuC,iBAAiB;yBAQ9F,YAAY;uBAEsF,UAAU;4BAS5G,eAAe;2BASf,cAAc;6BASd,gBAAgB;gCAGkB,mBAAmB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-toast",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.0",
|
|
4
4
|
"description": "Toast component for Fluent UI",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@fluentui/keyboard-keys": "^9.0.8",
|
|
24
|
-
"@fluentui/react-aria": "^9.16.
|
|
24
|
+
"@fluentui/react-aria": "^9.16.4",
|
|
25
25
|
"@fluentui/react-icons": "^2.0.245",
|
|
26
|
-
"@fluentui/react-jsx-runtime": "^9.1.
|
|
27
|
-
"@fluentui/react-motion": "^9.10.
|
|
28
|
-
"@fluentui/react-motion-components-preview": "^0.
|
|
29
|
-
"@fluentui/react-portal": "^9.8.
|
|
30
|
-
"@fluentui/react-shared-contexts": "^9.
|
|
31
|
-
"@fluentui/react-tabster": "^9.26.
|
|
26
|
+
"@fluentui/react-jsx-runtime": "^9.1.6",
|
|
27
|
+
"@fluentui/react-motion": "^9.10.3",
|
|
28
|
+
"@fluentui/react-motion-components-preview": "^0.9.0",
|
|
29
|
+
"@fluentui/react-portal": "^9.8.1",
|
|
30
|
+
"@fluentui/react-shared-contexts": "^9.25.0",
|
|
31
|
+
"@fluentui/react-tabster": "^9.26.4",
|
|
32
32
|
"@fluentui/react-theme": "^9.2.0",
|
|
33
|
-
"@fluentui/react-utilities": "^9.
|
|
33
|
+
"@fluentui/react-utilities": "^9.24.0",
|
|
34
34
|
"@griffel/react": "^1.5.22",
|
|
35
35
|
"@swc/helpers": "^0.5.1"
|
|
36
36
|
},
|