@fluentui/react-toast 9.1.6 → 9.2.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.json +115 -1
- package/CHANGELOG.md +34 -2
- package/dist/index.d.ts +3 -2
- package/lib/components/AriaLive/AriaLive.js.map +1 -1
- package/lib/components/AriaLive/renderAriaLive.js +7 -2
- package/lib/components/AriaLive/renderAriaLive.js.map +1 -1
- package/lib/components/AriaLive/useAriaLive.js +6 -4
- package/lib/components/AriaLive/useAriaLive.js.map +1 -1
- package/lib/components/Timer/Timer.js +1 -1
- package/lib/components/Timer/Timer.js.map +1 -1
- package/lib/components/Toast/Toast.js.map +1 -1
- package/lib/components/Toast/renderToast.js +5 -4
- package/lib/components/Toast/renderToast.js.map +1 -1
- package/lib/components/Toast/useToast.js.map +1 -1
- package/lib/components/Toast/useToastContextValues.js +1 -1
- package/lib/components/Toast/useToastContextValues.js.map +1 -1
- package/lib/components/ToastBody/ToastBody.js.map +1 -1
- package/lib/components/ToastBody/renderToastBody.js +7 -2
- package/lib/components/ToastBody/renderToastBody.js.map +1 -1
- package/lib/components/ToastBody/useToastBody.js +1 -1
- package/lib/components/ToastBody/useToastBody.js.map +1 -1
- package/lib/components/ToastContainer/ToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/renderToastContainer.js +12 -7
- package/lib/components/ToastContainer/renderToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainer.js +15 -15
- package/lib/components/ToastContainer/useToastContainer.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainerContextValues.js +1 -1
- package/lib/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
- package/lib/components/ToastFooter/ToastFooter.js.map +1 -1
- package/lib/components/ToastFooter/renderToastFooter.js +2 -2
- package/lib/components/ToastFooter/renderToastFooter.js.map +1 -1
- package/lib/components/ToastFooter/useToastFooter.js.map +1 -1
- package/lib/components/ToastTitle/ToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/renderToastTitle.js +8 -2
- package/lib/components/ToastTitle/renderToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitle.js +1 -1
- package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib/components/ToastTrigger/ToastTrigger.js.map +1 -1
- package/lib/components/ToastTrigger/useToastTrigger.js +8 -7
- package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Toaster/renderToaster.js +18 -5
- package/lib/components/Toaster/renderToaster.js.map +1 -1
- package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
- package/lib/components/Toaster/useToaster.js +7 -6
- package/lib/components/Toaster/useToaster.js.map +1 -1
- package/lib/components/Toaster/useToasterFocusManagement.js +2 -2
- package/lib/components/Toaster/useToasterFocusManagement.js.map +1 -1
- package/lib/contexts/toastContainerContext.js.map +1 -1
- package/lib/state/useToastController.js +3 -2
- package/lib/state/useToastController.js.map +1 -1
- package/lib/state/useToaster.js +15 -11
- package/lib/state/useToaster.js.map +1 -1
- package/lib/state/vanilla/createToaster.js +7 -7
- package/lib/state/vanilla/createToaster.js.map +1 -1
- package/lib/state/vanilla/dismissAllToasts.js.map +1 -1
- package/lib/state/vanilla/dismissToast.js.map +1 -1
- package/lib/state/vanilla/dispatchToast.js.map +1 -1
- package/lib/state/vanilla/getPositionStyles.js +1 -1
- package/lib/state/vanilla/getPositionStyles.js.map +1 -1
- package/lib/state/vanilla/pauseToast.js.map +1 -1
- package/lib/state/vanilla/playToast.js.map +1 -1
- package/lib/state/vanilla/updateToast.js.map +1 -1
- package/lib-commonjs/AriaLive.js +2 -2
- package/lib-commonjs/AriaLive.js.map +1 -1
- package/lib-commonjs/Toast.js +2 -2
- package/lib-commonjs/Toast.js.map +1 -1
- package/lib-commonjs/ToastBody.js +2 -2
- package/lib-commonjs/ToastBody.js.map +1 -1
- package/lib-commonjs/ToastContainer.js +2 -2
- package/lib-commonjs/ToastContainer.js.map +1 -1
- package/lib-commonjs/ToastFooter.js +2 -2
- package/lib-commonjs/ToastFooter.js.map +1 -1
- package/lib-commonjs/ToastTitle.js +2 -2
- package/lib-commonjs/ToastTitle.js.map +1 -1
- package/lib-commonjs/ToastTrigger.js +2 -2
- package/lib-commonjs/ToastTrigger.js.map +1 -1
- package/lib-commonjs/Toaster.js +2 -2
- package/lib-commonjs/Toaster.js.map +1 -1
- package/lib-commonjs/components/AriaLive/AriaLive.js +7 -5
- package/lib-commonjs/components/AriaLive/AriaLive.js.map +1 -1
- package/lib-commonjs/components/AriaLive/AriaLive.types.js +2 -2
- package/lib-commonjs/components/AriaLive/AriaLive.types.js.map +1 -1
- package/lib-commonjs/components/AriaLive/index.js +6 -6
- package/lib-commonjs/components/AriaLive/index.js.map +1 -1
- package/lib-commonjs/components/AriaLive/renderAriaLive.js +13 -6
- package/lib-commonjs/components/AriaLive/renderAriaLive.js.map +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLive.js +16 -12
- package/lib-commonjs/components/AriaLive/useAriaLive.js.map +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +7 -3
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Timer/Timer.js +8 -6
- package/lib-commonjs/components/Timer/Timer.js.map +1 -1
- package/lib-commonjs/components/Timer/index.js +2 -2
- package/lib-commonjs/components/Timer/index.js.map +1 -1
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js +4 -2
- package/lib-commonjs/components/Timer/useTimerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Toast/Toast.js +7 -5
- package/lib-commonjs/components/Toast/Toast.js.map +1 -1
- package/lib-commonjs/components/Toast/index.js +6 -6
- package/lib-commonjs/components/Toast/index.js.map +1 -1
- package/lib-commonjs/components/Toast/renderToast.js +12 -9
- package/lib-commonjs/components/Toast/renderToast.js.map +1 -1
- package/lib-commonjs/components/Toast/useToast.js +7 -5
- package/lib-commonjs/components/Toast/useToast.js.map +1 -1
- package/lib-commonjs/components/Toast/useToastContextValues.js +4 -2
- package/lib-commonjs/components/Toast/useToastContextValues.js.map +1 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.js +8 -4
- package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastBody/ToastBody.js +7 -5
- package/lib-commonjs/components/ToastBody/ToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/index.js +6 -6
- package/lib-commonjs/components/ToastBody/index.js.map +1 -1
- package/lib-commonjs/components/ToastBody/renderToastBody.js +13 -6
- package/lib-commonjs/components/ToastBody/renderToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBody.js +11 -9
- package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +9 -5
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/ToastContainer.js +7 -5
- package/lib-commonjs/components/ToastContainer/ToastContainer.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js +2 -2
- package/lib-commonjs/components/ToastContainer/ToastContainer.types.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/index.js +7 -7
- package/lib-commonjs/components/ToastContainer/index.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/renderToastContainer.js +19 -12
- package/lib-commonjs/components/ToastContainer/renderToastContainer.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainer.js +42 -40
- package/lib-commonjs/components/ToastContainer/useToastContainer.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js +6 -4
- package/lib-commonjs/components/ToastContainer/useToastContainerContextValues.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +8 -4
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/ToastFooter.js +7 -5
- package/lib-commonjs/components/ToastFooter/ToastFooter.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/index.js +6 -6
- package/lib-commonjs/components/ToastFooter/index.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/renderToastFooter.js +8 -6
- package/lib-commonjs/components/ToastFooter/renderToastFooter.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooter.js +7 -5
- package/lib-commonjs/components/ToastFooter/useToastFooter.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +7 -3
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/ToastTitle.js +7 -5
- package/lib-commonjs/components/ToastTitle/ToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/index.js +6 -6
- package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/renderToastTitle.js +14 -6
- package/lib-commonjs/components/ToastTitle/renderToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitle.js +17 -15
- package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +13 -9
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.js +5 -3
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js +2 -2
- package/lib-commonjs/components/ToastTrigger/ToastTrigger.types.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/index.js +5 -5
- package/lib-commonjs/components/ToastTrigger/index.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js +3 -1
- package/lib-commonjs/components/ToastTrigger/renderToastTrigger.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +18 -15
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib-commonjs/components/Toaster/Toaster.js +7 -5
- package/lib-commonjs/components/Toaster/Toaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/index.js +6 -6
- package/lib-commonjs/components/Toaster/index.js.map +1 -1
- package/lib-commonjs/components/Toaster/renderToaster.js +26 -11
- package/lib-commonjs/components/Toaster/renderToaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToastAnnounce.js +8 -6
- package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToaster.js +25 -22
- package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterFocusManagement.js +19 -17
- package/lib-commonjs/components/Toaster/useToasterFocusManagement.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +7 -3
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/toastContainerContext.js +8 -4
- package/lib-commonjs/contexts/toastContainerContext.js.map +1 -1
- package/lib-commonjs/index.js +93 -35
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/state/constants.js +6 -2
- package/lib-commonjs/state/constants.js.map +1 -1
- package/lib-commonjs/state/index.js +10 -6
- package/lib-commonjs/state/index.js.map +1 -1
- package/lib-commonjs/state/types.js +2 -2
- package/lib-commonjs/state/types.js.map +1 -1
- package/lib-commonjs/state/useToastController.js +9 -6
- package/lib-commonjs/state/useToastController.js.map +1 -1
- package/lib-commonjs/state/useToaster.js +26 -20
- package/lib-commonjs/state/useToaster.js.map +1 -1
- package/lib-commonjs/state/vanilla/createToaster.js +14 -12
- package/lib-commonjs/state/vanilla/createToaster.js.map +1 -1
- package/lib-commonjs/state/vanilla/dismissAllToasts.js +3 -1
- package/lib-commonjs/state/vanilla/dismissAllToasts.js.map +1 -1
- package/lib-commonjs/state/vanilla/dismissToast.js +3 -1
- package/lib-commonjs/state/vanilla/dismissToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/dispatchToast.js +3 -1
- package/lib-commonjs/state/vanilla/dispatchToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/getPositionStyles.js +4 -2
- package/lib-commonjs/state/vanilla/getPositionStyles.js.map +1 -1
- package/lib-commonjs/state/vanilla/index.js +9 -9
- package/lib-commonjs/state/vanilla/index.js.map +1 -1
- package/lib-commonjs/state/vanilla/pauseToast.js +3 -1
- package/lib-commonjs/state/vanilla/pauseToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/playToast.js +3 -1
- package/lib-commonjs/state/vanilla/playToast.js.map +1 -1
- package/lib-commonjs/state/vanilla/updateToast.js +3 -1
- package/lib-commonjs/state/vanilla/updateToast.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,121 @@
|
|
|
2
2
|
"name": "@fluentui/react-toast",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 05 Sep 2023 13:23:14 GMT",
|
|
6
|
+
"tag": "@fluentui/react-toast_v9.2.1",
|
|
7
|
+
"version": "9.2.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-toast",
|
|
13
|
+
"commit": "b93c2ac22355b6cb6f33dd509c6cd9c21f4fffc8",
|
|
14
|
+
"comment": "bumps @swc/helpers version to 0.5.1"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-toast",
|
|
19
|
+
"commit": "eea6d93a62249ba4fba3347fb291c67ee1a3fb24",
|
|
20
|
+
"comment": "chore: migrate package to use JSX importSource"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-toast",
|
|
25
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.4",
|
|
26
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-toast",
|
|
31
|
+
"comment": "Bump @fluentui/react-aria to v9.3.34",
|
|
32
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-toast",
|
|
37
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.4",
|
|
38
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-toast",
|
|
43
|
+
"comment": "Bump @fluentui/react-portal to v9.3.11",
|
|
44
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-toast",
|
|
49
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.7.3",
|
|
50
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@fluentui/react-toast",
|
|
55
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.6",
|
|
56
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@fluentui/react-toast",
|
|
61
|
+
"comment": "Bump @fluentui/react-theme to v9.1.12",
|
|
62
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@fluentui/react-toast",
|
|
67
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.1",
|
|
68
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"date": "Tue, 29 Aug 2023 12:57:35 GMT",
|
|
75
|
+
"tag": "@fluentui/react-toast_v9.2.0",
|
|
76
|
+
"version": "9.2.0",
|
|
77
|
+
"comments": {
|
|
78
|
+
"minor": [
|
|
79
|
+
{
|
|
80
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
81
|
+
"package": "@fluentui/react-toast",
|
|
82
|
+
"commit": "3ef92a485889eee5010ed32b8fc1ec1d8127cc44",
|
|
83
|
+
"comment": "feat: adds mountNode to Toaster API"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-toast",
|
|
88
|
+
"comment": "Bump @fluentui/react-aria to v9.3.33",
|
|
89
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-toast",
|
|
94
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.3",
|
|
95
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-toast",
|
|
100
|
+
"comment": "Bump @fluentui/react-portal to v9.3.10",
|
|
101
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"author": "beachball",
|
|
105
|
+
"package": "@fluentui/react-toast",
|
|
106
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.5",
|
|
107
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"author": "beachball",
|
|
111
|
+
"package": "@fluentui/react-toast",
|
|
112
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.0",
|
|
113
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"date": "Thu, 24 Aug 2023 10:26:35 GMT",
|
|
6
120
|
"tag": "@fluentui/react-toast_v9.1.6",
|
|
7
121
|
"version": "9.1.6",
|
|
8
122
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-toast
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 05 Sep 2023 13:23:14 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.1)
|
|
8
|
+
|
|
9
|
+
Tue, 05 Sep 2023 13:23:14 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.0..@fluentui/react-toast_v9.2.1)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
|
|
15
|
+
- chore: migrate package to use JSX importSource ([PR #28959](https://github.com/microsoft/fluentui/pull/28959) by bernardo.sunderhus@gmail.com)
|
|
16
|
+
- Bump @fluentui/keyboard-keys to v9.0.4 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
17
|
+
- Bump @fluentui/react-aria to v9.3.34 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
18
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.4 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
19
|
+
- Bump @fluentui/react-portal to v9.3.11 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
20
|
+
- Bump @fluentui/react-shared-contexts to v9.7.3 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.12.6 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
22
|
+
- Bump @fluentui/react-theme to v9.1.12 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v9.13.1 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
|
24
|
+
|
|
25
|
+
## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.0)
|
|
26
|
+
|
|
27
|
+
Tue, 29 Aug 2023 12:57:35 GMT
|
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.1.6..@fluentui/react-toast_v9.2.0)
|
|
29
|
+
|
|
30
|
+
### Minor changes
|
|
31
|
+
|
|
32
|
+
- feat: adds mountNode to Toaster API ([PR #29003](https://github.com/microsoft/fluentui/pull/29003) by bernardo.sunderhus@gmail.com)
|
|
33
|
+
- Bump @fluentui/react-aria to v9.3.33 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
34
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.3 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
35
|
+
- Bump @fluentui/react-portal to v9.3.10 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
36
|
+
- Bump @fluentui/react-tabster to v9.12.5 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
37
|
+
- Bump @fluentui/react-utilities to v9.13.0 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
|
38
|
+
|
|
7
39
|
## [9.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.1.6)
|
|
8
40
|
|
|
9
|
-
Thu, 24 Aug 2023 10:
|
|
41
|
+
Thu, 24 Aug 2023 10:26:35 GMT
|
|
10
42
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.1.5..@fluentui/react-toast_v9.1.6)
|
|
11
43
|
|
|
12
44
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { ComponentProps } from '@fluentui/react-utilities';
|
|
|
7
7
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
8
8
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
9
9
|
import { JSXElementConstructor } from 'react';
|
|
10
|
+
import type { PortalProps } from '@fluentui/react-portal';
|
|
10
11
|
import * as React_2 from 'react';
|
|
11
12
|
import { ReactElement } from 'react';
|
|
12
13
|
import type { Slot } from '@fluentui/react-utilities';
|
|
@@ -163,7 +164,7 @@ declare interface ToasterOptions extends Pick<ToastOptions, 'position' | 'timeou
|
|
|
163
164
|
/**
|
|
164
165
|
* Toaster Props
|
|
165
166
|
*/
|
|
166
|
-
export declare type ToasterProps = Omit<ComponentProps<ToasterSlots>, 'children'> & Partial<ToasterOptions> & {
|
|
167
|
+
export declare type ToasterProps = Omit<ComponentProps<ToasterSlots>, 'children'> & Partial<ToasterOptions> & Pick<PortalProps, 'mountNode'> & {
|
|
167
168
|
/**
|
|
168
169
|
* User override API for aria-live narration for toasts
|
|
169
170
|
*/
|
|
@@ -192,7 +193,7 @@ declare type ToasterSlotsInternal = ToasterSlots & {
|
|
|
192
193
|
/**
|
|
193
194
|
* State used in rendering Toaster
|
|
194
195
|
*/
|
|
195
|
-
export declare type ToasterState = ComponentState<ToasterSlotsInternal> & Pick<AriaLiveProps, 'announceRef'> & Pick<Required<ToasterProps>, 'announce'> & {
|
|
196
|
+
export declare type ToasterState = ComponentState<ToasterSlotsInternal> & Pick<AriaLiveProps, 'announceRef'> & Pick<PortalProps, 'mountNode'> & Pick<Required<ToasterProps>, 'announce'> & {
|
|
196
197
|
offset: ToasterOptions['offset'] | undefined;
|
|
197
198
|
renderAriaLive: boolean;
|
|
198
199
|
dir: 'rtl' | 'ltr';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AriaLive.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAriaLive_unstable } from './useAriaLive';\nimport { renderAriaLive_unstable } from './renderAriaLive';\nimport { useAriaLiveStyles_unstable } from './useAriaLiveStyles.styles';\nimport type { AriaLiveProps } from './AriaLive.types';\n\n/**\n * A component that manages aria live announcements imperatively\n */\nexport const AriaLive: React.FC<AriaLiveProps> = props => {\n const state = useAriaLive_unstable(props);\n\n useAriaLiveStyles_unstable(state);\n return renderAriaLive_unstable(state);\n};\n\nAriaLive.displayName = 'AriaLive';\n"],"names":["React","useAriaLive_unstable","renderAriaLive_unstable","useAriaLiveStyles_unstable","AriaLive","props","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE;;CAEC,GACD,OAAO,MAAMC,WAAoCC,CAAAA
|
|
1
|
+
{"version":3,"sources":["AriaLive.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAriaLive_unstable } from './useAriaLive';\nimport { renderAriaLive_unstable } from './renderAriaLive';\nimport { useAriaLiveStyles_unstable } from './useAriaLiveStyles.styles';\nimport type { AriaLiveProps } from './AriaLive.types';\n\n/**\n * A component that manages aria live announcements imperatively\n */\nexport const AriaLive: React.FC<AriaLiveProps> = props => {\n const state = useAriaLive_unstable(props);\n\n useAriaLiveStyles_unstable(state);\n return renderAriaLive_unstable(state);\n};\n\nAriaLive.displayName = 'AriaLive';\n"],"names":["React","useAriaLive_unstable","renderAriaLive_unstable","useAriaLiveStyles_unstable","AriaLive","props","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE;;CAEC,GACD,OAAO,MAAMC,WAAoCC,CAAAA;IAC/C,MAAMC,QAAQL,qBAAqBI;IAEnCF,2BAA2BG;IAC3B,OAAOJ,wBAAwBI;AACjC,EAAE;AAEFF,SAASG,WAAW,GAAG"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of AriaLive
|
|
5
5
|
*/ export const renderAriaLive_unstable = (state)=>{
|
|
6
6
|
assertSlots(state);
|
|
7
|
-
return /*#__PURE__*/
|
|
7
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ _jsx(state.assertive, {}),
|
|
10
|
+
/*#__PURE__*/ _jsx(state.polite, {})
|
|
11
|
+
]
|
|
12
|
+
});
|
|
8
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderAriaLive.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderAriaLive.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { AriaLiveState, AriaLiveSlots } from './AriaLive.types';\n\n/**\n * Render the final JSX of AriaLive\n */\nexport const renderAriaLive_unstable = (state: AriaLiveState) => {\n assertSlots<AriaLiveSlots>(state);\n\n return (\n <>\n <state.assertive />\n <state.polite />\n </>\n );\n};\n"],"names":["assertSlots","renderAriaLive_unstable","state","assertive","polite"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtCF,YAA2BE;IAE3B,qBACE;;0BACE,KAACA,MAAMC,SAAS;0BAChB,KAACD,MAAME,MAAM;;;AAGnB,EAAE"}
|
|
@@ -9,6 +9,7 @@ import { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-uti
|
|
|
9
9
|
*
|
|
10
10
|
* @param props - props from this instance of AriaLive
|
|
11
11
|
*/ export const useAriaLive_unstable = (props)=>{
|
|
12
|
+
var _currentMessage, _currentMessage1;
|
|
12
13
|
const [currentMessage, setCurrentMessage] = React.useState(undefined);
|
|
13
14
|
// Can't rely on Date.now() if user invokes announce more than once in a code block
|
|
14
15
|
const order = React.useRef(0);
|
|
@@ -19,8 +20,9 @@ import { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-uti
|
|
|
19
20
|
return a.politeness === 'assertive' ? -1 : 1;
|
|
20
21
|
}));
|
|
21
22
|
const announce = useEventCallback((message, options)=>{
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
var _currentMessage;
|
|
24
|
+
const { politeness } = options;
|
|
25
|
+
if (message === ((_currentMessage = currentMessage) === null || _currentMessage === void 0 ? void 0 : _currentMessage.message)) {
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
const liveMessage = {
|
|
@@ -48,8 +50,8 @@ import { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-uti
|
|
|
48
50
|
messageQueue
|
|
49
51
|
]);
|
|
50
52
|
React.useImperativeHandle(props.announceRef, ()=>announce);
|
|
51
|
-
const politeMessage = (currentMessage === null ||
|
|
52
|
-
const assertiveMessage = (currentMessage === null ||
|
|
53
|
+
const politeMessage = ((_currentMessage = currentMessage) === null || _currentMessage === void 0 ? void 0 : _currentMessage.politeness) === 'polite' ? currentMessage.message : undefined;
|
|
54
|
+
const assertiveMessage = ((_currentMessage1 = currentMessage) === null || _currentMessage1 === void 0 ? void 0 : _currentMessage1.politeness) === 'assertive' ? currentMessage.message : undefined;
|
|
53
55
|
return {
|
|
54
56
|
components: {
|
|
55
57
|
assertive: 'div',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAriaLive.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { AnnounceOptions, AriaLiveProps, AriaLiveState, LiveMessage } from './AriaLive.types';\n\n/** The duration the message needs to be in present in DOM for screen readers to register a change and announce */\nconst MESSAGE_DURATION = 500;\n\n/**\n * Create the state required to render AriaLive.\n *\n * The returned state can be modified with hooks such as useAriaLiveStyles_unstable,\n * before being passed to renderAriaLive_unstable.\n *\n * @param props - props from this instance of AriaLive\n */\nexport const useAriaLive_unstable = (props: AriaLiveProps): AriaLiveState => {\n const [currentMessage, setCurrentMessage] = React.useState<LiveMessage | undefined>(undefined);\n // Can't rely on Date.now() if user invokes announce more than once in a code block\n const order = React.useRef(0);\n const [messageQueue] = React.useState(() =>\n createPriorityQueue<LiveMessage>((a, b) => {\n if (a.politeness === b.politeness) {\n return a.createdAt - b.createdAt;\n }\n\n return a.politeness === 'assertive' ? -1 : 1;\n }),\n );\n\n const announce = useEventCallback((message: string, options: AnnounceOptions) => {\n const { politeness } = options;\n if (message === currentMessage?.message) {\n return;\n }\n\n const liveMessage: LiveMessage = {\n message,\n politeness,\n createdAt: order.current++,\n };\n\n if (!currentMessage) {\n setCurrentMessage(liveMessage);\n } else {\n messageQueue.enqueue(liveMessage);\n }\n });\n\n React.useEffect(() => {\n const timeout = setTimeout(() => {\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n\n return () => clearTimeout(timeout);\n }, [currentMessage, messageQueue]);\n\n React.useImperativeHandle(props.announceRef, () => announce);\n\n const politeMessage = currentMessage?.politeness === 'polite' ? currentMessage.message : undefined;\n const assertiveMessage = currentMessage?.politeness === 'assertive' ? currentMessage.message : undefined;\n\n return {\n components: {\n assertive: 'div',\n polite: 'div',\n },\n\n assertive: slot.always(props.assertive, {\n defaultProps: { 'aria-live': 'assertive', children: assertiveMessage },\n elementType: 'div',\n }),\n polite: slot.always(props.polite, {\n defaultProps: { 'aria-live': 'polite', children: politeMessage },\n elementType: 'div',\n }),\n };\n};\n"],"names":["React","createPriorityQueue","useEventCallback","slot","MESSAGE_DURATION","useAriaLive_unstable","props","currentMessage","setCurrentMessage","useState","undefined","order","useRef","messageQueue","a","b","politeness","createdAt","announce","message","options","liveMessage","current","enqueue","useEffect","timeout","setTimeout","peek","dequeue","clearTimeout","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","always","defaultProps","children","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxF,gHAAgH,GAChH,MAAMC,mBAAmB;AAEzB;;;;;;;CAOC,GACD,OAAO,MAAMC,uBAAuB,CAACC,
|
|
1
|
+
{"version":3,"sources":["useAriaLive.ts"],"sourcesContent":["import * as React from 'react';\nimport { createPriorityQueue, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { AnnounceOptions, AriaLiveProps, AriaLiveState, LiveMessage } from './AriaLive.types';\n\n/** The duration the message needs to be in present in DOM for screen readers to register a change and announce */\nconst MESSAGE_DURATION = 500;\n\n/**\n * Create the state required to render AriaLive.\n *\n * The returned state can be modified with hooks such as useAriaLiveStyles_unstable,\n * before being passed to renderAriaLive_unstable.\n *\n * @param props - props from this instance of AriaLive\n */\nexport const useAriaLive_unstable = (props: AriaLiveProps): AriaLiveState => {\n const [currentMessage, setCurrentMessage] = React.useState<LiveMessage | undefined>(undefined);\n // Can't rely on Date.now() if user invokes announce more than once in a code block\n const order = React.useRef(0);\n const [messageQueue] = React.useState(() =>\n createPriorityQueue<LiveMessage>((a, b) => {\n if (a.politeness === b.politeness) {\n return a.createdAt - b.createdAt;\n }\n\n return a.politeness === 'assertive' ? -1 : 1;\n }),\n );\n\n const announce = useEventCallback((message: string, options: AnnounceOptions) => {\n const { politeness } = options;\n if (message === currentMessage?.message) {\n return;\n }\n\n const liveMessage: LiveMessage = {\n message,\n politeness,\n createdAt: order.current++,\n };\n\n if (!currentMessage) {\n setCurrentMessage(liveMessage);\n } else {\n messageQueue.enqueue(liveMessage);\n }\n });\n\n React.useEffect(() => {\n const timeout = setTimeout(() => {\n if (messageQueue.peek()) {\n setCurrentMessage(messageQueue.dequeue());\n } else {\n setCurrentMessage(undefined);\n }\n }, MESSAGE_DURATION);\n\n return () => clearTimeout(timeout);\n }, [currentMessage, messageQueue]);\n\n React.useImperativeHandle(props.announceRef, () => announce);\n\n const politeMessage = currentMessage?.politeness === 'polite' ? currentMessage.message : undefined;\n const assertiveMessage = currentMessage?.politeness === 'assertive' ? currentMessage.message : undefined;\n\n return {\n components: {\n assertive: 'div',\n polite: 'div',\n },\n\n assertive: slot.always(props.assertive, {\n defaultProps: { 'aria-live': 'assertive', children: assertiveMessage },\n elementType: 'div',\n }),\n polite: slot.always(props.polite, {\n defaultProps: { 'aria-live': 'polite', children: politeMessage },\n elementType: 'div',\n }),\n };\n};\n"],"names":["React","createPriorityQueue","useEventCallback","slot","MESSAGE_DURATION","useAriaLive_unstable","props","currentMessage","setCurrentMessage","useState","undefined","order","useRef","messageQueue","a","b","politeness","createdAt","announce","message","options","liveMessage","current","enqueue","useEffect","timeout","setTimeout","peek","dequeue","clearTimeout","useImperativeHandle","announceRef","politeMessage","assertiveMessage","components","assertive","polite","always","defaultProps","children","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxF,gHAAgH,GAChH,MAAMC,mBAAmB;AAEzB;;;;;;;CAOC,GACD,OAAO,MAAMC,uBAAuB,CAACC;QA+CbC,iBACGA;IA/CzB,MAAM,CAACA,gBAAgBC,kBAAkB,GAAGR,MAAMS,QAAQ,CAA0BC;IACpF,mFAAmF;IACnF,MAAMC,QAAQX,MAAMY,MAAM,CAAC;IAC3B,MAAM,CAACC,aAAa,GAAGb,MAAMS,QAAQ,CAAC,IACpCR,oBAAiC,CAACa,GAAGC;YACnC,IAAID,EAAEE,UAAU,KAAKD,EAAEC,UAAU,EAAE;gBACjC,OAAOF,EAAEG,SAAS,GAAGF,EAAEE,SAAS;YAClC;YAEA,OAAOH,EAAEE,UAAU,KAAK,cAAc,CAAC,IAAI;QAC7C;IAGF,MAAME,WAAWhB,iBAAiB,CAACiB,SAAiBC;YAElCb;QADhB,MAAM,EAAES,UAAU,EAAE,GAAGI;QACvB,IAAID,cAAYZ,kBAAAA,4BAAAA,sCAAAA,gBAAgBY,OAAO,GAAE;YACvC;QACF;QAEA,MAAME,cAA2B;YAC/BF;YACAH;YACAC,WAAWN,MAAMW,OAAO;QAC1B;QAEA,IAAI,CAACf,gBAAgB;YACnBC,kBAAkBa;QACpB,OAAO;YACLR,aAAaU,OAAO,CAACF;QACvB;IACF;IAEArB,MAAMwB,SAAS,CAAC;QACd,MAAMC,UAAUC,WAAW;YACzB,IAAIb,aAAac,IAAI,IAAI;gBACvBnB,kBAAkBK,aAAae,OAAO;YACxC,OAAO;gBACLpB,kBAAkBE;YACpB;QACF,GAAGN;QAEH,OAAO,IAAMyB,aAAaJ;IAC5B,GAAG;QAAClB;QAAgBM;KAAa;IAEjCb,MAAM8B,mBAAmB,CAACxB,MAAMyB,WAAW,EAAE,IAAMb;IAEnD,MAAMc,gBAAgBzB,EAAAA,kBAAAA,4BAAAA,sCAAAA,gBAAgBS,UAAU,MAAK,WAAWT,eAAeY,OAAO,GAAGT;IACzF,MAAMuB,mBAAmB1B,EAAAA,mBAAAA,4BAAAA,uCAAAA,iBAAgBS,UAAU,MAAK,cAAcT,eAAeY,OAAO,GAAGT;IAE/F,OAAO;QACLwB,YAAY;YACVC,WAAW;YACXC,QAAQ;QACV;QAEAD,WAAWhC,KAAKkC,MAAM,CAAC/B,MAAM6B,SAAS,EAAE;YACtCG,cAAc;gBAAE,aAAa;gBAAaC,UAAUN;YAAiB;YACrEO,aAAa;QACf;QACAJ,QAAQjC,KAAKkC,MAAM,CAAC/B,MAAM8B,MAAM,EAAE;YAChCE,cAAc;gBAAE,aAAa;gBAAUC,UAAUP;YAAc;YAC/DQ,aAAa;QACf;IACF;AACF,EAAE"}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useBaseAnimationStyles } from './useTimerStyles.styles';
|
|
3
3
|
export const Timer = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
4
4
|
const baseAnimationStyles = useBaseAnimationStyles();
|
|
5
|
-
const { running
|
|
5
|
+
const { running, timeout, onTimeout } = props;
|
|
6
6
|
const style = {
|
|
7
7
|
animationDuration: `${timeout}ms`,
|
|
8
8
|
animationPlayState: running ? 'running' : 'paused'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Timer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useBaseAnimationStyles } from './useTimerStyles.styles';\n\nexport type TimerProps = {\n running: boolean;\n timeout: number;\n onTimeout: () => void;\n as?: 'span';\n};\n\nexport const Timer = React.forwardRef<HTMLDivElement, TimerProps>((props, ref) => {\n const baseAnimationStyles = useBaseAnimationStyles();\n const { running, timeout, onTimeout } = props;\n\n const style: React.CSSProperties = {\n animationDuration: `${timeout}ms`,\n animationPlayState: running ? 'running' : 'paused',\n };\n\n if (timeout < 0) {\n return null;\n }\n\n return (\n <span\n onAnimationEnd={onTimeout}\n data-timer-status={style.animationPlayState}\n ref={ref}\n style={style}\n className={baseAnimationStyles}\n />\n );\n});\n\nTimer.displayName = 'Timer';\n"],"names":["React","useBaseAnimationStyles","Timer","forwardRef","props","ref","baseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","span","onAnimationEnd","data-timer-status","className","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,0BAA0B;AASjE,OAAO,MAAMC,sBAAQF,MAAMG,UAAU,CAA6B,CAACC,OAAOC
|
|
1
|
+
{"version":3,"sources":["Timer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useBaseAnimationStyles } from './useTimerStyles.styles';\n\nexport type TimerProps = {\n running: boolean;\n timeout: number;\n onTimeout: () => void;\n as?: 'span';\n};\n\nexport const Timer = React.forwardRef<HTMLDivElement, TimerProps>((props, ref) => {\n const baseAnimationStyles = useBaseAnimationStyles();\n const { running, timeout, onTimeout } = props;\n\n const style: React.CSSProperties = {\n animationDuration: `${timeout}ms`,\n animationPlayState: running ? 'running' : 'paused',\n };\n\n if (timeout < 0) {\n return null;\n }\n\n return (\n <span\n onAnimationEnd={onTimeout}\n data-timer-status={style.animationPlayState}\n ref={ref}\n style={style}\n className={baseAnimationStyles}\n />\n );\n});\n\nTimer.displayName = 'Timer';\n"],"names":["React","useBaseAnimationStyles","Timer","forwardRef","props","ref","baseAnimationStyles","running","timeout","onTimeout","style","animationDuration","animationPlayState","span","onAnimationEnd","data-timer-status","className","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,0BAA0B;AASjE,OAAO,MAAMC,sBAAQF,MAAMG,UAAU,CAA6B,CAACC,OAAOC;IACxE,MAAMC,sBAAsBL;IAC5B,MAAM,EAAEM,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGL;IAExC,MAAMM,QAA6B;QACjCC,mBAAmB,CAAC,EAAEH,QAAQ,EAAE,CAAC;QACjCI,oBAAoBL,UAAU,YAAY;IAC5C;IAEA,IAAIC,UAAU,GAAG;QACf,OAAO;IACT;IAEA,qBACE,oBAACK;QACCC,gBAAgBL;QAChBM,qBAAmBL,MAAME,kBAAkB;QAC3CP,KAAKA;QACLK,OAAOA;QACPM,WAAWV;;AAGjB,GAAG;AAEHJ,MAAMe,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToast_unstable } from './useToast';\nimport { renderToast_unstable } from './renderToast';\nimport { useToastStyles_unstable } from './useToastStyles.styles';\nimport type { ToastProps } from './Toast.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToastContextValues_unstable } from './useToastContextValues';\n\n/**\n * Toast component\n */\nexport const Toast: ForwardRefComponent<ToastProps> = React.forwardRef((props, ref) => {\n const state = useToast_unstable(props, ref);\n\n useToastStyles_unstable(state);\n return renderToast_unstable(state, useToastContextValues_unstable(state));\n});\n\nToast.displayName = 'Toast';\n"],"names":["React","useToast_unstable","renderToast_unstable","useToastStyles_unstable","useToastContextValues_unstable","Toast","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,8BAA8B,QAAQ,0BAA0B;AAEzE;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC
|
|
1
|
+
{"version":3,"sources":["Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToast_unstable } from './useToast';\nimport { renderToast_unstable } from './renderToast';\nimport { useToastStyles_unstable } from './useToastStyles.styles';\nimport type { ToastProps } from './Toast.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToastContextValues_unstable } from './useToastContextValues';\n\n/**\n * Toast component\n */\nexport const Toast: ForwardRefComponent<ToastProps> = React.forwardRef((props, ref) => {\n const state = useToast_unstable(props, ref);\n\n useToastStyles_unstable(state);\n return renderToast_unstable(state, useToastContextValues_unstable(state));\n});\n\nToast.displayName = 'Toast';\n"],"names":["React","useToast_unstable","renderToast_unstable","useToastStyles_unstable","useToastContextValues_unstable","Toast","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,8BAA8B,QAAQ,0BAA0B;AAEzE;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IACxB,OAAOP,qBAAqBO,OAAOL,+BAA+BK;AACpE,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
import { BackgroundAppearanceProvider } from '@fluentui/react-shared-contexts';
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of Toast
|
|
6
6
|
*/ export const renderToast_unstable = (state, contextValues)=>{
|
|
7
7
|
assertSlots(state);
|
|
8
|
-
return /*#__PURE__*/
|
|
9
|
-
value: contextValues.backgroundAppearance
|
|
10
|
-
|
|
8
|
+
return /*#__PURE__*/ _jsx(BackgroundAppearanceProvider, {
|
|
9
|
+
value: contextValues.backgroundAppearance,
|
|
10
|
+
children: /*#__PURE__*/ _jsx(state.root, {})
|
|
11
|
+
});
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderToast.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderToast.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { BackgroundAppearanceProvider } from '@fluentui/react-shared-contexts';\nimport type { ToastState, ToastSlots, ToastContextValues } from './Toast.types';\n\n/**\n * Render the final JSX of Toast\n */\nexport const renderToast_unstable = (state: ToastState, contextValues: ToastContextValues) => {\n assertSlots<ToastSlots>(state);\n\n return (\n <BackgroundAppearanceProvider value={contextValues.backgroundAppearance}>\n <state.root />\n </BackgroundAppearanceProvider>\n );\n};\n"],"names":["assertSlots","BackgroundAppearanceProvider","renderToast_unstable","state","contextValues","value","backgroundAppearance","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,4BAA4B,QAAQ,kCAAkC;AAG/E;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAmBC;IACtDJ,YAAwBG;IAExB,qBACE,KAACF;QAA6BI,OAAOD,cAAcE,oBAAoB;kBACrE,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToast.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastProps, ToastState } from './Toast.types';\n\n/**\n * Create the state required to render Toast.\n *\n * The returned state can be modified with hooks such as useToastStyles_unstable,\n * before being passed to renderToast_unstable.\n *\n * @param props - props from this instance of Toast\n * @param ref - reference to root HTMLElement of Toast\n */\nexport const useToast_unstable = (props: ToastProps, ref: React.Ref<HTMLElement>): ToastState => {\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance: props.appearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToast_unstable","props","ref","components","root","always","elementType","backgroundAppearance","appearance"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC
|
|
1
|
+
{"version":3,"sources":["useToast.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastProps, ToastState } from './Toast.types';\n\n/**\n * Create the state required to render Toast.\n *\n * The returned state can be modified with hooks such as useToastStyles_unstable,\n * before being passed to renderToast_unstable.\n *\n * @param props - props from this instance of Toast\n * @param ref - reference to root HTMLElement of Toast\n */\nexport const useToast_unstable = (props: ToastProps, ref: React.Ref<HTMLElement>): ToastState => {\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance: props.appearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToast_unstable","props","ref","components","root","always","elementType","backgroundAppearance","appearance"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,OAAO;QACLC,YAAY;YACVC,MAAM;QACR;QACAA,MAAML,KAAKM,MAAM,CACfP,sBAAsB,OAAO;YAC3BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEK,aAAa;QAAM;QAEvBC,sBAAsBN,MAAMO,UAAU;IACxC;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastContextValues.ts"],"sourcesContent":["import { ToastContextValues, ToastState } from './Toast.types';\n\nexport function useToastContextValues_unstable(state: ToastState): ToastContextValues {\n const { backgroundAppearance } = state;\n\n return {\n backgroundAppearance,\n };\n}\n"],"names":["useToastContextValues_unstable","state","backgroundAppearance"],"mappings":"AAEA,OAAO,SAASA,+BAA+BC,KAAiB
|
|
1
|
+
{"version":3,"sources":["useToastContextValues.ts"],"sourcesContent":["import { ToastContextValues, ToastState } from './Toast.types';\n\nexport function useToastContextValues_unstable(state: ToastState): ToastContextValues {\n const { backgroundAppearance } = state;\n\n return {\n backgroundAppearance,\n };\n}\n"],"names":["useToastContextValues_unstable","state","backgroundAppearance"],"mappings":"AAEA,OAAO,SAASA,+BAA+BC,KAAiB;IAC9D,MAAM,EAAEC,oBAAoB,EAAE,GAAGD;IAEjC,OAAO;QACLC;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ToastBody.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastBody_unstable } from './useToastBody';\nimport { renderToastBody_unstable } from './renderToastBody';\nimport { useToastBodyStyles_unstable } from './useToastBodyStyles.styles';\nimport type { ToastBodyProps } from './ToastBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * ToastBody component\n */\nexport const ToastBody: ForwardRefComponent<ToastBodyProps> = React.forwardRef((props, ref) => {\n const state = useToastBody_unstable(props, ref);\n\n useToastBodyStyles_unstable(state);\n return renderToastBody_unstable(state);\n});\n\nToastBody.displayName = 'ToastBody';\n"],"names":["React","useToastBody_unstable","renderToastBody_unstable","useToastBodyStyles_unstable","ToastBody","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC
|
|
1
|
+
{"version":3,"sources":["ToastBody.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastBody_unstable } from './useToastBody';\nimport { renderToastBody_unstable } from './renderToastBody';\nimport { useToastBodyStyles_unstable } from './useToastBodyStyles.styles';\nimport type { ToastBodyProps } from './ToastBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * ToastBody component\n */\nexport const ToastBody: ForwardRefComponent<ToastBodyProps> = React.forwardRef((props, ref) => {\n const state = useToastBody_unstable(props, ref);\n\n useToastBodyStyles_unstable(state);\n return renderToastBody_unstable(state);\n});\n\nToastBody.displayName = 'ToastBody';\n"],"names":["React","useToastBody_unstable","renderToastBody_unstable","useToastBodyStyles_unstable","ToastBody","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of ToastBody
|
|
5
5
|
*/ export const renderToastBody_unstable = (state)=>{
|
|
6
6
|
assertSlots(state);
|
|
7
|
-
return /*#__PURE__*/
|
|
7
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ _jsx(state.root, {}),
|
|
10
|
+
state.subtitle ? /*#__PURE__*/ _jsx(state.subtitle, {}) : null
|
|
11
|
+
]
|
|
12
|
+
});
|
|
8
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderToastBody.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderToastBody.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ToastBodyState, ToastBodySlots } from './ToastBody.types';\n\n/**\n * Render the final JSX of ToastBody\n */\nexport const renderToastBody_unstable = (state: ToastBodyState) => {\n assertSlots<ToastBodySlots>(state);\n\n return (\n <>\n <state.root />\n {state.subtitle ? <state.subtitle /> : null}\n </>\n );\n};\n"],"names":["assertSlots","renderToastBody_unstable","state","root","subtitle"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE;;0BACE,KAACA,MAAMC,IAAI;YACVD,MAAME,QAAQ,iBAAG,KAACF,MAAME,QAAQ,QAAM;;;AAG7C,EAAE"}
|
|
@@ -12,7 +12,7 @@ import { useBackgroundAppearance } from '@fluentui/react-shared-contexts';
|
|
|
12
12
|
* @param ref - reference to root HTMLElement of ToastBody
|
|
13
13
|
*/ export const useToastBody_unstable = (props, ref)=>{
|
|
14
14
|
const backgroundAppearance = useBackgroundAppearance();
|
|
15
|
-
const { bodyId
|
|
15
|
+
const { bodyId } = useToastContainerContext();
|
|
16
16
|
return {
|
|
17
17
|
components: {
|
|
18
18
|
root: 'div',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastBody.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastBodyProps, ToastBodyState } from './ToastBody.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render ToastBody.\n *\n * The returned state can be modified with hooks such as useToastBodyStyles_unstable,\n * before being passed to renderToastBody_unstable.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */\nexport const useToastBody_unstable = (props: ToastBodyProps, ref: React.Ref<HTMLElement>): ToastBodyState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { bodyId } = useToastContainerContext();\n return {\n components: {\n root: 'div',\n subtitle: 'div',\n },\n subtitle: slot.optional(props.subtitle, { elementType: 'div' }),\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n id: bodyId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToastContainerContext","useBackgroundAppearance","useToastBody_unstable","props","ref","backgroundAppearance","bodyId","components","root","subtitle","optional","elementType","always","id"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAExE,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC
|
|
1
|
+
{"version":3,"sources":["useToastBody.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastBodyProps, ToastBodyState } from './ToastBody.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render ToastBody.\n *\n * The returned state can be modified with hooks such as useToastBodyStyles_unstable,\n * before being passed to renderToastBody_unstable.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */\nexport const useToastBody_unstable = (props: ToastBodyProps, ref: React.Ref<HTMLElement>): ToastBodyState => {\n const backgroundAppearance = useBackgroundAppearance();\n const { bodyId } = useToastContainerContext();\n return {\n components: {\n root: 'div',\n subtitle: 'div',\n },\n subtitle: slot.optional(props.subtitle, { elementType: 'div' }),\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n id: bodyId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n backgroundAppearance,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useToastContainerContext","useBackgroundAppearance","useToastBody_unstable","props","ref","backgroundAppearance","bodyId","components","root","subtitle","optional","elementType","always","id"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAExE,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAMC,uBAAuBJ;IAC7B,MAAM,EAAEK,MAAM,EAAE,GAAGN;IACnB,OAAO;QACLO,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUV,KAAKW,QAAQ,CAACP,MAAMM,QAAQ,EAAE;YAAEE,aAAa;QAAM;QAC7DH,MAAMT,KAAKa,MAAM,CACfd,sBAAsB,OAAO;YAC3BM;YACAS,IAAIP;YACJ,GAAGH,KAAK;QACV,IACA;YAAEQ,aAAa;QAAM;QAEvBN;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ToastContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastContainer_unstable } from './useToastContainer';\nimport { renderToastContainer_unstable } from './renderToastContainer';\nimport { useToastContainerStyles_unstable } from './useToastContainerStyles.styles';\nimport type { ToastContainerProps } from './ToastContainer.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToastContainerContextValues_unstable } from './useToastContainerContextValues';\n\n/**\n * ToastContainer component\n */\nexport const ToastContainer: ForwardRefComponent<ToastContainerProps> = React.forwardRef((props, ref) => {\n const state = useToastContainer_unstable(props, ref);\n\n useToastContainerStyles_unstable(state);\n return renderToastContainer_unstable(state, useToastContainerContextValues_unstable(state));\n});\n\nToastContainer.displayName = 'ToastContainer';\n"],"names":["React","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerStyles_unstable","useToastContainerContextValues_unstable","ToastContainer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAE3F;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC
|
|
1
|
+
{"version":3,"sources":["ToastContainer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToastContainer_unstable } from './useToastContainer';\nimport { renderToastContainer_unstable } from './renderToastContainer';\nimport { useToastContainerStyles_unstable } from './useToastContainerStyles.styles';\nimport type { ToastContainerProps } from './ToastContainer.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToastContainerContextValues_unstable } from './useToastContainerContextValues';\n\n/**\n * ToastContainer component\n */\nexport const ToastContainer: ForwardRefComponent<ToastContainerProps> = React.forwardRef((props, ref) => {\n const state = useToastContainer_unstable(props, ref);\n\n useToastContainerStyles_unstable(state);\n return renderToastContainer_unstable(state, useToastContainerContextValues_unstable(state));\n});\n\nToastContainer.displayName = 'ToastContainer';\n"],"names":["React","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerStyles_unstable","useToastContainerContextValues_unstable","ToastContainer","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,uCAAuC,QAAQ,mCAAmC;AAE3F;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IACjC,OAAOP,8BAA8BO,OAAOL,wCAAwCK;AACtF,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
import { Transition } from 'react-transition-group';
|
|
4
4
|
import { ToastContainerContextProvider } from '../../contexts/toastContainerContext';
|
|
5
5
|
/**
|
|
6
6
|
* Render the final JSX of ToastContainer
|
|
7
7
|
*/ export const renderToastContainer_unstable = (state, contextValues)=>{
|
|
8
|
-
const { onTransitionEntering
|
|
8
|
+
const { onTransitionEntering, visible, transitionTimeout, remove, nodeRef } = state;
|
|
9
9
|
assertSlots(state);
|
|
10
|
-
return /*#__PURE__*/
|
|
10
|
+
return /*#__PURE__*/ _jsx(Transition, {
|
|
11
11
|
in: visible,
|
|
12
12
|
appear: true,
|
|
13
13
|
unmountOnExit: true,
|
|
14
14
|
timeout: transitionTimeout,
|
|
15
15
|
onExited: remove,
|
|
16
16
|
onEntering: onTransitionEntering,
|
|
17
|
-
nodeRef: nodeRef
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
nodeRef: nodeRef,
|
|
18
|
+
children: /*#__PURE__*/ _jsxs(ToastContainerContextProvider, {
|
|
19
|
+
value: contextValues.toast,
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(state.root, {}),
|
|
22
|
+
/*#__PURE__*/ _jsx(state.timer, {})
|
|
23
|
+
]
|
|
24
|
+
})
|
|
25
|
+
});
|
|
21
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderToastContainer.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderToastContainer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Transition } from 'react-transition-group';\nimport type { ToastContainerState, ToastContainerSlots, ToastContainerContextValues } from './ToastContainer.types';\nimport { ToastContainerContextProvider } from '../../contexts/toastContainerContext';\n\n/**\n * Render the final JSX of ToastContainer\n */\nexport const renderToastContainer_unstable = (\n state: ToastContainerState,\n contextValues: ToastContainerContextValues,\n) => {\n const { onTransitionEntering, visible, transitionTimeout, remove, nodeRef } = state;\n assertSlots<ToastContainerSlots>(state);\n\n return (\n <Transition\n in={visible}\n appear\n unmountOnExit\n timeout={transitionTimeout}\n onExited={remove}\n onEntering={onTransitionEntering}\n nodeRef={nodeRef}\n >\n <ToastContainerContextProvider value={contextValues.toast}>\n <state.root />\n <state.timer />\n </ToastContainerContextProvider>\n </Transition>\n );\n};\n"],"names":["assertSlots","Transition","ToastContainerContextProvider","renderToastContainer_unstable","state","contextValues","onTransitionEntering","visible","transitionTimeout","remove","nodeRef","in","appear","unmountOnExit","timeout","onExited","onEntering","value","toast","root","timer"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,SAASC,6BAA6B,QAAQ,uCAAuC;AAErF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,MAAM,EAAEC,oBAAoB,EAAEC,OAAO,EAAEC,iBAAiB,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGN;IAC9EJ,YAAiCI;IAEjC,qBACE,KAACH;QACCU,IAAIJ;QACJK,MAAM;QACNC,aAAa;QACbC,SAASN;QACTO,UAAUN;QACVO,YAAYV;QACZI,SAASA;kBAET,cAAA,MAACR;YAA8Be,OAAOZ,cAAca,KAAK;;8BACvD,KAACd,MAAMe,IAAI;8BACX,KAACf,MAAMgB,KAAK;;;;AAIpB,EAAE"}
|
|
@@ -19,11 +19,11 @@ const intentPolitenessMap = {
|
|
|
19
19
|
* @param props - props from this instance of ToastContainer
|
|
20
20
|
* @param ref - reference to root HTMLElement of ToastContainer
|
|
21
21
|
*/ export const useToastContainer_unstable = (props, ref)=>{
|
|
22
|
-
const { visible
|
|
22
|
+
const { visible, children, close: closeProp, remove, updateId, announce, data, timeout: timerTimeout, politeness: desiredPoliteness, intent = 'info', pauseOnHover, pauseOnWindowBlur, imperativeRef, tryRestoreFocus, ...rest } = props;
|
|
23
23
|
const titleId = useId('toast-title');
|
|
24
24
|
const bodyId = useId('toast-body');
|
|
25
25
|
const toastRef = React.useRef(null);
|
|
26
|
-
const { targetDocument
|
|
26
|
+
const { targetDocument } = useFluent_unstable();
|
|
27
27
|
const [running, setRunning] = React.useState(false);
|
|
28
28
|
const imperativePauseRef = React.useRef(false);
|
|
29
29
|
const focusedToastBeforeClose = React.useRef(false);
|
|
@@ -38,28 +38,28 @@ const intentPolitenessMap = {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const close = useEventCallback(()=>{
|
|
41
|
-
var _toastRef_current;
|
|
42
|
-
const activeElement = targetDocument === null ||
|
|
41
|
+
var _targetDocument, _toastRef_current;
|
|
42
|
+
const activeElement = (_targetDocument = targetDocument) === null || _targetDocument === void 0 ? void 0 : _targetDocument.activeElement;
|
|
43
43
|
if (activeElement && ((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains(activeElement))) {
|
|
44
44
|
focusedToastBeforeClose.current = true;
|
|
45
45
|
}
|
|
46
46
|
closeProp();
|
|
47
47
|
});
|
|
48
48
|
const onStatusChange = useEventCallback((status)=>{
|
|
49
|
-
var _props_onStatusChange;
|
|
50
|
-
return (_props_onStatusChange = props.onStatusChange) === null || _props_onStatusChange === void 0 ? void 0 : _props_onStatusChange.call(
|
|
49
|
+
var _props_onStatusChange, _props;
|
|
50
|
+
return (_props_onStatusChange = (_props = props).onStatusChange) === null || _props_onStatusChange === void 0 ? void 0 : _props_onStatusChange.call(_props, null, {
|
|
51
51
|
status,
|
|
52
52
|
...props
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
const pause = useEventCallback(()=>setRunning(false));
|
|
56
56
|
const play = useEventCallback(()=>{
|
|
57
|
-
var _toastRef_current;
|
|
57
|
+
var _targetDocument, _toastRef_current;
|
|
58
58
|
if (imperativePauseRef.current) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
var _targetDocument_activeElement;
|
|
62
|
-
const containsActive = !!((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains((_targetDocument_activeElement = targetDocument === null ||
|
|
62
|
+
const containsActive = !!((_toastRef_current = toastRef.current) === null || _toastRef_current === void 0 ? void 0 : _toastRef_current.contains((_targetDocument_activeElement = (_targetDocument = targetDocument) === null || _targetDocument === void 0 ? void 0 : _targetDocument.activeElement) !== null && _targetDocument_activeElement !== void 0 ? _targetDocument_activeElement : null));
|
|
63
63
|
if (timerTimeout < 0) {
|
|
64
64
|
setRunning(true);
|
|
65
65
|
return;
|
|
@@ -137,18 +137,18 @@ const intentPolitenessMap = {
|
|
|
137
137
|
onStatusChange
|
|
138
138
|
]);
|
|
139
139
|
const onMouseEnter = useEventCallback((e)=>{
|
|
140
|
-
var _userRootSlot_onMouseEnter;
|
|
140
|
+
var _userRootSlot_onMouseEnter, _userRootSlot;
|
|
141
141
|
pause();
|
|
142
|
-
userRootSlot === null ||
|
|
142
|
+
(_userRootSlot = userRootSlot) === null || _userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = _userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(_userRootSlot, e);
|
|
143
143
|
});
|
|
144
144
|
const onMouseLeave = useEventCallback((e)=>{
|
|
145
|
-
var _userRootSlot_onMouseEnter;
|
|
145
|
+
var _userRootSlot_onMouseEnter, _userRootSlot;
|
|
146
146
|
play();
|
|
147
|
-
userRootSlot === null ||
|
|
147
|
+
(_userRootSlot = userRootSlot) === null || _userRootSlot === void 0 ? void 0 : (_userRootSlot_onMouseEnter = _userRootSlot.onMouseEnter) === null || _userRootSlot_onMouseEnter === void 0 ? void 0 : _userRootSlot_onMouseEnter.call(_userRootSlot, e);
|
|
148
148
|
});
|
|
149
|
-
const { findFirstFocusable
|
|
149
|
+
const { findFirstFocusable, findLastFocusable } = useFocusFinders();
|
|
150
150
|
const onKeyDown = useEventCallback((e)=>{
|
|
151
|
-
var _userRootSlot_onKeyDown;
|
|
151
|
+
var _userRootSlot_onKeyDown, _userRootSlot;
|
|
152
152
|
if (e.key === Delete) {
|
|
153
153
|
e.preventDefault();
|
|
154
154
|
close();
|
|
@@ -163,7 +163,7 @@ const intentPolitenessMap = {
|
|
|
163
163
|
(_findFirstFocusable = findFirstFocusable(e.currentTarget)) === null || _findFirstFocusable === void 0 ? void 0 : _findFirstFocusable.focus();
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
userRootSlot === null ||
|
|
166
|
+
(_userRootSlot = userRootSlot) === null || _userRootSlot === void 0 ? void 0 : (_userRootSlot_onKeyDown = _userRootSlot.onKeyDown) === null || _userRootSlot_onKeyDown === void 0 ? void 0 : _userRootSlot_onKeyDown.call(_userRootSlot, e);
|
|
167
167
|
});
|
|
168
168
|
React.useEffect(()=>{
|
|
169
169
|
var _toastRef_current;
|