@fluentui/react-toast 0.0.0-nightly-20230905-0414.1 → 0.0.0-nightly-20230907-0414.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 CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-toast",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 05 Sep 2023 04:21:18 GMT",
6
- "tag": "@fluentui/react-toast_v0.0.0-nightly-20230905-0414.1",
7
- "version": "0.0.0-nightly-20230905-0414.1",
5
+ "date": "Thu, 07 Sep 2023 04:21:32 GMT",
6
+ "tag": "@fluentui/react-toast_v0.0.0-nightly-20230907-0414.1",
7
+ "version": "0.0.0-nightly-20230907-0414.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,62 +16,209 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-toast",
19
- "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230905-0414.1",
20
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
19
+ "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230907-0414.1",
20
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-toast",
25
- "comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230905-0414.1",
26
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
25
+ "comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230907-0414.1",
26
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-toast",
31
- "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230905-0414.1",
32
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
31
+ "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230907-0414.1",
32
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-toast",
37
- "comment": "Bump @fluentui/react-portal to v0.0.0-nightly-20230905-0414.1",
38
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
37
+ "comment": "Bump @fluentui/react-portal to v0.0.0-nightly-20230907-0414.1",
38
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-toast",
43
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230905-0414.1",
44
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
43
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230907-0414.1",
44
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
45
45
  },
46
46
  {
47
47
  "author": "beachball",
48
48
  "package": "@fluentui/react-toast",
49
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230905-0414.1",
50
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
49
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230907-0414.1",
50
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
51
51
  },
52
52
  {
53
53
  "author": "beachball",
54
54
  "package": "@fluentui/react-toast",
55
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230905-0414.1",
56
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
55
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230907-0414.1",
56
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
57
57
  },
58
58
  {
59
59
  "author": "beachball",
60
60
  "package": "@fluentui/react-toast",
61
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230905-0414.1",
62
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
61
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230907-0414.1",
62
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
63
63
  },
64
64
  {
65
65
  "author": "beachball",
66
66
  "package": "@fluentui/react-toast",
67
- "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20230905-0414.1",
68
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
67
+ "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20230907-0414.1",
68
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
69
69
  },
70
70
  {
71
71
  "author": "beachball",
72
72
  "package": "@fluentui/react-toast",
73
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230905-0414.1",
74
- "commit": "80f5d6c5eba684280572bd2bdb904259d480f171"
73
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230907-0414.1",
74
+ "commit": "753f903dea0c85cc54b4f81423d10799f22e1d7b"
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ {
80
+ "date": "Wed, 06 Sep 2023 13:31:31 GMT",
81
+ "tag": "@fluentui/react-toast_v9.2.3",
82
+ "version": "9.2.3",
83
+ "comments": {
84
+ "patch": [
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui/react-toast",
88
+ "comment": "Bump @fluentui/react-aria to v9.3.36",
89
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
90
+ },
91
+ {
92
+ "author": "beachball",
93
+ "package": "@fluentui/react-toast",
94
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.6",
95
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
96
+ },
97
+ {
98
+ "author": "beachball",
99
+ "package": "@fluentui/react-toast",
100
+ "comment": "Bump @fluentui/react-portal to v9.3.13",
101
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
102
+ },
103
+ {
104
+ "author": "beachball",
105
+ "package": "@fluentui/react-toast",
106
+ "comment": "Bump @fluentui/react-tabster to v9.12.8",
107
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
108
+ },
109
+ {
110
+ "author": "beachball",
111
+ "package": "@fluentui/react-toast",
112
+ "comment": "Bump @fluentui/react-utilities to v9.13.3",
113
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ "date": "Tue, 05 Sep 2023 15:39:04 GMT",
120
+ "tag": "@fluentui/react-toast_v9.2.2",
121
+ "version": "9.2.2",
122
+ "comments": {
123
+ "patch": [
124
+ {
125
+ "author": "beachball",
126
+ "package": "@fluentui/react-toast",
127
+ "comment": "Bump @fluentui/react-aria to v9.3.35",
128
+ "commit": "94019033dfe3fd39ec0cde7dfb3b57c22805aa91"
129
+ },
130
+ {
131
+ "author": "beachball",
132
+ "package": "@fluentui/react-toast",
133
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.5",
134
+ "commit": "94019033dfe3fd39ec0cde7dfb3b57c22805aa91"
135
+ },
136
+ {
137
+ "author": "beachball",
138
+ "package": "@fluentui/react-toast",
139
+ "comment": "Bump @fluentui/react-portal to v9.3.12",
140
+ "commit": "94019033dfe3fd39ec0cde7dfb3b57c22805aa91"
141
+ },
142
+ {
143
+ "author": "beachball",
144
+ "package": "@fluentui/react-toast",
145
+ "comment": "Bump @fluentui/react-tabster to v9.12.7",
146
+ "commit": "94019033dfe3fd39ec0cde7dfb3b57c22805aa91"
147
+ },
148
+ {
149
+ "author": "beachball",
150
+ "package": "@fluentui/react-toast",
151
+ "comment": "Bump @fluentui/react-utilities to v9.13.2",
152
+ "commit": "94019033dfe3fd39ec0cde7dfb3b57c22805aa91"
153
+ }
154
+ ]
155
+ }
156
+ },
157
+ {
158
+ "date": "Tue, 05 Sep 2023 13:29:09 GMT",
159
+ "tag": "@fluentui/react-toast_v9.2.1",
160
+ "version": "9.2.1",
161
+ "comments": {
162
+ "patch": [
163
+ {
164
+ "author": "bernardo.sunderhus@gmail.com",
165
+ "package": "@fluentui/react-toast",
166
+ "commit": "b93c2ac22355b6cb6f33dd509c6cd9c21f4fffc8",
167
+ "comment": "bumps @swc/helpers version to 0.5.1"
168
+ },
169
+ {
170
+ "author": "bernardo.sunderhus@gmail.com",
171
+ "package": "@fluentui/react-toast",
172
+ "commit": "eea6d93a62249ba4fba3347fb291c67ee1a3fb24",
173
+ "comment": "chore: migrate package to use JSX importSource"
174
+ },
175
+ {
176
+ "author": "beachball",
177
+ "package": "@fluentui/react-toast",
178
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.4",
179
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
180
+ },
181
+ {
182
+ "author": "beachball",
183
+ "package": "@fluentui/react-toast",
184
+ "comment": "Bump @fluentui/react-aria to v9.3.34",
185
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
186
+ },
187
+ {
188
+ "author": "beachball",
189
+ "package": "@fluentui/react-toast",
190
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.4",
191
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
192
+ },
193
+ {
194
+ "author": "beachball",
195
+ "package": "@fluentui/react-toast",
196
+ "comment": "Bump @fluentui/react-portal to v9.3.11",
197
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
198
+ },
199
+ {
200
+ "author": "beachball",
201
+ "package": "@fluentui/react-toast",
202
+ "comment": "Bump @fluentui/react-shared-contexts to v9.7.3",
203
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
204
+ },
205
+ {
206
+ "author": "beachball",
207
+ "package": "@fluentui/react-toast",
208
+ "comment": "Bump @fluentui/react-tabster to v9.12.6",
209
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
210
+ },
211
+ {
212
+ "author": "beachball",
213
+ "package": "@fluentui/react-toast",
214
+ "comment": "Bump @fluentui/react-theme to v9.1.12",
215
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
216
+ },
217
+ {
218
+ "author": "beachball",
219
+ "package": "@fluentui/react-toast",
220
+ "comment": "Bump @fluentui/react-utilities to v9.13.1",
221
+ "commit": "da959e66f36b429e40ae61810d08dc71c16e154a"
75
222
  }
76
223
  ]
77
224
  }
package/CHANGELOG.md CHANGED
@@ -1,27 +1,71 @@
1
1
  # Change Log - @fluentui/react-toast
2
2
 
3
- This log was last generated on Tue, 05 Sep 2023 04:21:18 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 07 Sep 2023 04:21:32 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230905-0414.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v0.0.0-nightly-20230905-0414.1)
7
+ ## [0.0.0-nightly-20230907-0414.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v0.0.0-nightly-20230907-0414.1)
8
8
 
9
- Tue, 05 Sep 2023 04:21:18 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.0..@fluentui/react-toast_v0.0.0-nightly-20230905-0414.1)
9
+ Thu, 07 Sep 2023 04:21:32 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.3..@fluentui/react-toast_v0.0.0-nightly-20230907-0414.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
16
- - Bump @fluentui/react-aria to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
17
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
18
- - Bump @fluentui/react-portal to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
19
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
20
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
21
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
22
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
23
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
24
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230905-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/80f5d6c5eba684280572bd2bdb904259d480f171) by beachball)
15
+ - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
16
+ - Bump @fluentui/react-aria to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
18
+ - Bump @fluentui/react-portal to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
19
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
20
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
21
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
22
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
23
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
24
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230907-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/753f903dea0c85cc54b4f81423d10799f22e1d7b) by beachball)
25
+
26
+ ## [9.2.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.3)
27
+
28
+ Wed, 06 Sep 2023 13:31:31 GMT
29
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.2..@fluentui/react-toast_v9.2.3)
30
+
31
+ ### Patches
32
+
33
+ - Bump @fluentui/react-aria to v9.3.36 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
34
+ - Bump @fluentui/react-jsx-runtime to v9.0.6 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
35
+ - Bump @fluentui/react-portal to v9.3.13 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
36
+ - Bump @fluentui/react-tabster to v9.12.8 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
37
+ - Bump @fluentui/react-utilities to v9.13.3 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
38
+
39
+ ## [9.2.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.2)
40
+
41
+ Tue, 05 Sep 2023 15:39:04 GMT
42
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.1..@fluentui/react-toast_v9.2.2)
43
+
44
+ ### Patches
45
+
46
+ - Bump @fluentui/react-aria to v9.3.35 ([PR #29055](https://github.com/microsoft/fluentui/pull/29055) by beachball)
47
+ - Bump @fluentui/react-jsx-runtime to v9.0.5 ([PR #29055](https://github.com/microsoft/fluentui/pull/29055) by beachball)
48
+ - Bump @fluentui/react-portal to v9.3.12 ([PR #29055](https://github.com/microsoft/fluentui/pull/29055) by beachball)
49
+ - Bump @fluentui/react-tabster to v9.12.7 ([PR #29055](https://github.com/microsoft/fluentui/pull/29055) by beachball)
50
+ - Bump @fluentui/react-utilities to v9.13.2 ([PR #29055](https://github.com/microsoft/fluentui/pull/29055) by beachball)
51
+
52
+ ## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.1)
53
+
54
+ Tue, 05 Sep 2023 13:29:09 GMT
55
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.2.0..@fluentui/react-toast_v9.2.1)
56
+
57
+ ### Patches
58
+
59
+ - bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
60
+ - chore: migrate package to use JSX importSource ([PR #28959](https://github.com/microsoft/fluentui/pull/28959) by bernardo.sunderhus@gmail.com)
61
+ - Bump @fluentui/keyboard-keys to v9.0.4 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
62
+ - Bump @fluentui/react-aria to v9.3.34 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
63
+ - Bump @fluentui/react-jsx-runtime to v9.0.4 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
64
+ - Bump @fluentui/react-portal to v9.3.11 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
65
+ - Bump @fluentui/react-shared-contexts to v9.7.3 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
66
+ - Bump @fluentui/react-tabster to v9.12.6 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
67
+ - Bump @fluentui/react-theme to v9.1.12 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
68
+ - Bump @fluentui/react-utilities to v9.13.1 ([PR #29056](https://github.com/microsoft/fluentui/pull/29056) by beachball)
25
69
 
26
70
  ## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.2.0)
27
71
 
package/dist/index.d.ts CHANGED
@@ -188,6 +188,8 @@ declare type ToasterSlotsInternal = ToasterSlots & {
188
188
  bottomStart?: Slot<'div'>;
189
189
  topEnd?: Slot<'div'>;
190
190
  topStart?: Slot<'div'>;
191
+ top?: Slot<'div'>;
192
+ bottom?: Slot<'div'>;
191
193
  };
192
194
 
193
195
  /**
@@ -306,7 +308,7 @@ declare interface ToastOptions<TData = object> {
306
308
 
307
309
  export declare type ToastPoliteness = 'assertive' | 'polite';
308
310
 
309
- export declare type ToastPosition = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';
311
+ export declare type ToastPosition = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start' | 'top' | 'bottom';
310
312
 
311
313
  /**
312
314
  * Toast Props
@@ -1 +1 @@
1
- {"version":3,"sources":["Toaster.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport { ToasterOptions } from '../../state/types';\nimport { Announce, AriaLiveProps } from '../AriaLive';\n\nexport type ToasterSlots = {\n /**\n * NOTE: This root slot maps in exactly the same way to the containers rendered for each toast position\n * There is no intention (currently) to let users customize the div for each toast position.\n */\n root: Slot<'div'>;\n};\n\nexport type ToasterSlotsInternal = ToasterSlots & {\n bottomEnd?: Slot<'div'>;\n bottomStart?: Slot<'div'>;\n topEnd?: Slot<'div'>;\n topStart?: Slot<'div'>;\n};\n\n/**\n * Toaster Props\n */\nexport type ToasterProps = Omit<ComponentProps<ToasterSlots>, 'children'> &\n Partial<ToasterOptions> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * User override API for aria-live narration for toasts\n */\n announce?: Announce;\n };\n\n/**\n * State used in rendering Toaster\n */\nexport type ToasterState = ComponentState<ToasterSlotsInternal> &\n Pick<AriaLiveProps, 'announceRef'> &\n Pick<PortalProps, 'mountNode'> &\n Pick<Required<ToasterProps>, 'announce'> & {\n offset: ToasterOptions['offset'] | undefined;\n renderAriaLive: boolean;\n dir: 'rtl' | 'ltr';\n };\n"],"names":[],"mappings":"AAAA,WA0CI"}
1
+ {"version":3,"sources":["Toaster.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport { ToasterOptions } from '../../state/types';\nimport { Announce, AriaLiveProps } from '../AriaLive';\n\nexport type ToasterSlots = {\n /**\n * NOTE: This root slot maps in exactly the same way to the containers rendered for each toast position\n * There is no intention (currently) to let users customize the div for each toast position.\n */\n root: Slot<'div'>;\n};\n\nexport type ToasterSlotsInternal = ToasterSlots & {\n bottomEnd?: Slot<'div'>;\n bottomStart?: Slot<'div'>;\n topEnd?: Slot<'div'>;\n topStart?: Slot<'div'>;\n top?: Slot<'div'>;\n bottom?: Slot<'div'>;\n};\n\n/**\n * Toaster Props\n */\nexport type ToasterProps = Omit<ComponentProps<ToasterSlots>, 'children'> &\n Partial<ToasterOptions> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * User override API for aria-live narration for toasts\n */\n announce?: Announce;\n };\n\n/**\n * State used in rendering Toaster\n */\nexport type ToasterState = ComponentState<ToasterSlotsInternal> &\n Pick<AriaLiveProps, 'announceRef'> &\n Pick<PortalProps, 'mountNode'> &\n Pick<Required<ToasterProps>, 'announce'> & {\n offset: ToasterOptions['offset'] | undefined;\n renderAriaLive: boolean;\n dir: 'rtl' | 'ltr';\n };\n"],"names":[],"mappings":"AAAA,WA4CI"}
@@ -7,7 +7,7 @@ import { AriaLive } from '../AriaLive';
7
7
  */ export const renderToaster_unstable = (state)=>{
8
8
  const { announceRef, renderAriaLive } = state;
9
9
  assertSlots(state);
10
- const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;
10
+ const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd || !!state.top || !!state.bottom;
11
11
  return /*#__PURE__*/ _jsxs(_Fragment, {
12
12
  children: [
13
13
  renderAriaLive ? /*#__PURE__*/ _jsx(AriaLive, {
@@ -16,10 +16,12 @@ import { AriaLive } from '../AriaLive';
16
16
  hasToasts ? /*#__PURE__*/ _jsxs(Portal, {
17
17
  mountNode: state.mountNode,
18
18
  children: [
19
+ state.bottom ? /*#__PURE__*/ _jsx(state.bottom, {}) : null,
19
20
  state.bottomStart ? /*#__PURE__*/ _jsx(state.bottomStart, {}) : null,
20
21
  state.bottomEnd ? /*#__PURE__*/ _jsx(state.bottomEnd, {}) : null,
21
22
  state.topStart ? /*#__PURE__*/ _jsx(state.topStart, {}) : null,
22
- state.topEnd ? /*#__PURE__*/ _jsx(state.topEnd, {}) : null
23
+ state.topEnd ? /*#__PURE__*/ _jsx(state.topEnd, {}) : null,
24
+ state.top ? /*#__PURE__*/ _jsx(state.top, {}) : null
23
25
  ]
24
26
  }) : null
25
27
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToaster.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport type { ToasterState, ToasterSlotsInternal } from './Toaster.types';\nimport { AriaLive } from '../AriaLive';\n\n/**\n * Render the final JSX of Toaster\n */\nexport const renderToaster_unstable = (state: ToasterState) => {\n const { announceRef, renderAriaLive } = state;\n assertSlots<ToasterSlotsInternal>(state);\n\n const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;\n\n return (\n <>\n {renderAriaLive ? <AriaLive announceRef={announceRef} /> : null}\n {hasToasts ? (\n <Portal mountNode={state.mountNode}>\n {state.bottomStart ? <state.bottomStart /> : null}\n {state.bottomEnd ? <state.bottomEnd /> : null}\n {state.topStart ? <state.topStart /> : null}\n {state.topEnd ? <state.topEnd /> : null}\n </Portal>\n ) : null}\n </>\n );\n};\n"],"names":["assertSlots","Portal","AriaLive","renderToaster_unstable","state","announceRef","renderAriaLive","hasToasts","bottomStart","bottomEnd","topStart","topEnd","mountNode"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,QAAQ,QAAQ,cAAc;AAEvC;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGF;IACxCJ,YAAkCI;IAElC,MAAMG,YAAY,CAAC,CAACH,MAAMI,WAAW,IAAI,CAAC,CAACJ,MAAMK,SAAS,IAAI,CAAC,CAACL,MAAMM,QAAQ,IAAI,CAAC,CAACN,MAAMO,MAAM;IAEhG,qBACE;;YACGL,+BAAiB,KAACJ;gBAASG,aAAaA;iBAAkB;YAC1DE,0BACC,MAACN;gBAAOW,WAAWR,MAAMQ,SAAS;;oBAC/BR,MAAMI,WAAW,iBAAG,KAACJ,MAAMI,WAAW,QAAM;oBAC5CJ,MAAMK,SAAS,iBAAG,KAACL,MAAMK,SAAS,QAAM;oBACxCL,MAAMM,QAAQ,iBAAG,KAACN,MAAMM,QAAQ,QAAM;oBACtCN,MAAMO,MAAM,iBAAG,KAACP,MAAMO,MAAM,QAAM;;iBAEnC;;;AAGV,EAAE"}
1
+ {"version":3,"sources":["renderToaster.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport type { ToasterState, ToasterSlotsInternal } from './Toaster.types';\nimport { AriaLive } from '../AriaLive';\n\n/**\n * Render the final JSX of Toaster\n */\nexport const renderToaster_unstable = (state: ToasterState) => {\n const { announceRef, renderAriaLive } = state;\n assertSlots<ToasterSlotsInternal>(state);\n\n const hasToasts =\n !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd || !!state.top || !!state.bottom;\n\n return (\n <>\n {renderAriaLive ? <AriaLive announceRef={announceRef} /> : null}\n {hasToasts ? (\n <Portal mountNode={state.mountNode}>\n {state.bottom ? <state.bottom /> : null}\n {state.bottomStart ? <state.bottomStart /> : null}\n {state.bottomEnd ? <state.bottomEnd /> : null}\n {state.topStart ? <state.topStart /> : null}\n {state.topEnd ? <state.topEnd /> : null}\n {state.top ? <state.top /> : null}\n </Portal>\n ) : null}\n </>\n );\n};\n"],"names":["assertSlots","Portal","AriaLive","renderToaster_unstable","state","announceRef","renderAriaLive","hasToasts","bottomStart","bottomEnd","topStart","topEnd","top","bottom","mountNode"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AACxD,SAASC,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,QAAQ,QAAQ,cAAc;AAEvC;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGF;IACxCJ,YAAkCI;IAElC,MAAMG,YACJ,CAAC,CAACH,MAAMI,WAAW,IAAI,CAAC,CAACJ,MAAMK,SAAS,IAAI,CAAC,CAACL,MAAMM,QAAQ,IAAI,CAAC,CAACN,MAAMO,MAAM,IAAI,CAAC,CAACP,MAAMQ,GAAG,IAAI,CAAC,CAACR,MAAMS,MAAM;IAEjH,qBACE;;YACGP,+BAAiB,KAACJ;gBAASG,aAAaA;iBAAkB;YAC1DE,0BACC,MAACN;gBAAOa,WAAWV,MAAMU,SAAS;;oBAC/BV,MAAMS,MAAM,iBAAG,KAACT,MAAMS,MAAM,QAAM;oBAClCT,MAAMI,WAAW,iBAAG,KAACJ,MAAMI,WAAW,QAAM;oBAC5CJ,MAAMK,SAAS,iBAAG,KAACL,MAAMK,SAAS,QAAM;oBACxCL,MAAMM,QAAQ,iBAAG,KAACN,MAAMM,QAAQ,QAAM;oBACtCN,MAAMO,MAAM,iBAAG,KAACP,MAAMO,MAAM,QAAM;oBAClCP,MAAMQ,GAAG,iBAAG,KAACR,MAAMQ,GAAG,QAAM;;iBAE7B;;;AAGV,EAAE"}
@@ -65,7 +65,9 @@ import { useToastAnnounce } from './useToastAnnounce';
65
65
  bottomStart: 'div',
66
66
  bottomEnd: 'div',
67
67
  topStart: 'div',
68
- topEnd: 'div'
68
+ topEnd: 'div',
69
+ top: 'div',
70
+ bottom: 'div'
69
71
  },
70
72
  root: slot.always(rootProps, {
71
73
  elementType: 'div'
@@ -74,6 +76,8 @@ import { useToastAnnounce } from './useToastAnnounce';
74
76
  bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),
75
77
  topStart: usePositionSlot(TOAST_POSITIONS.topStart),
76
78
  topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),
79
+ top: usePositionSlot(TOAST_POSITIONS.top),
80
+ bottom: usePositionSlot(TOAST_POSITIONS.bottom),
77
81
  announceRef,
78
82
  offset,
79
83
  announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,
@@ -1 +1 @@
1
- {"version":3,"sources":["useToaster.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ExtractSlotProps,\n Slot,\n getNativeElementProps,\n useEventCallback,\n useMergedRefs,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { ToasterProps, ToasterState } from './Toaster.types';\nimport { TOAST_POSITIONS, ToastPosition, useToaster } from '../../state';\nimport { Announce } from '../AriaLive';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */\nexport const useToaster_unstable = (props: ToasterProps): ToasterState => {\n const { offset, announce: announceProp, mountNode, ...rest } = props;\n const announceRef = React.useRef<Announce>(() => null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } =\n useToaster<HTMLDivElement>(rest);\n const announce = React.useCallback<Announce>((message, options) => announceRef.current(message, options), []);\n const { dir } = useFluent();\n\n const rootProps = slot.always(getNativeElementProps('div', rest), { elementType: 'div' });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: { Escape: true },\n });\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n props.onKeyDown?.(e);\n });\n const usePositionSlot = (toastPosition: ToastPosition) => {\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp ?? announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: toastsToRender.get(toastPosition)?.map(toast => (\n <ToastContainer\n {...toast}\n tryRestoreFocus={tryRestoreFocus}\n intent={toast.intent}\n announce={announceToast}\n key={toast.toastId}\n visible={isToastVisible(toast.toastId)}\n >\n {toast.content as React.ReactNode}\n </ToastContainer>\n )),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list',\n // Explicitly casting because our slot types can't handle data attributes\n } as ExtractSlotProps<Slot<'div'>>,\n elementType: 'div',\n });\n };\n return {\n dir,\n mountNode,\n components: { root: 'div', bottomStart: 'div', bottomEnd: 'div', topStart: 'div', topEnd: 'div' },\n root: slot.always(rootProps, { elementType: 'div' }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp ?? announce,\n renderAriaLive: !announceProp,\n };\n};\n"],"names":["React","getNativeElementProps","useEventCallback","useMergedRefs","slot","useFluent_unstable","useFluent","useFocusableGroup","Escape","TOAST_POSITIONS","useToaster","ToastContainer","useToasterFocusManagement_unstable","useToastAnnounce","useToaster_unstable","props","offset","announce","announceProp","mountNode","rest","announceRef","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useCallback","message","options","current","dir","rootProps","always","elementType","focusableGroupAttr","tabBehavior","ignoreDefaultKeydown","onKeyDown","e","key","preventDefault","usePositionSlot","toastPosition","focusManagementRef","announceToast","toasterRef","optional","has","defaultProps","ref","children","get","map","toast","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","renderAriaLive"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAGEC,qBAAqB,EACrBC,gBAAgB,EAChBC,aAAa,EACbC,IAAI,QACC,4BAA4B;AACnC,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD,SAASC,eAAe,EAAiBC,UAAU,QAAQ,cAAc;AAEzE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAAS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B,GAAG,CAACT,4BAAnBtB,0CAAAA,oBAAmCgC,GAAG,CAACC,CAAAA,sBAC/C,oBAAC7C;wBACE,GAAG6C,KAAK;wBACT7B,iBAAiBA;wBACjB8B,QAAQD,MAAMC,MAAM;wBACpBxC,UAAU8B;wBACVL,KAAKc,MAAME,OAAO;wBAClBC,SAASnC,eAAegC,MAAME,OAAO;uBAEpCF,MAAMI,OAAO;gBAGlBpB;gBACA,GAAGH,kBAAkB;gBACrB,yBAAyBQ;gBACzBgB,MAAM;YAER;YACAzB,aAAa;QACf;IACF;IACA,OAAO;QACLH;QACAd;QACA2C,YAAY;YAAEC,MAAM;YAAOC,aAAa;YAAOC,WAAW;YAAOC,UAAU;YAAOC,QAAQ;QAAM;QAChGJ,MAAM3D,KAAK+B,MAAM,CAACD,WAAW;YAAEE,aAAa;QAAM;QAClD4B,aAAapB,gBAAgBnC,gBAAgBuD,WAAW;QACxDC,WAAWrB,gBAAgBnC,gBAAgBwD,SAAS;QACpDC,UAAUtB,gBAAgBnC,gBAAgByD,QAAQ;QAClDC,QAAQvB,gBAAgBnC,gBAAgB0D,MAAM;QAC9C9C;QACAL;QACAC,UAAUC,yBAAAA,0BAAAA,eAAgBD;QAC1BmD,gBAAgB,CAAClD;IACnB;AACF,EAAE"}
1
+ {"version":3,"sources":["useToaster.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ExtractSlotProps,\n Slot,\n getNativeElementProps,\n useEventCallback,\n useMergedRefs,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport type { ToasterProps, ToasterState } from './Toaster.types';\nimport { TOAST_POSITIONS, ToastPosition, useToaster } from '../../state';\nimport { Announce } from '../AriaLive';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */\nexport const useToaster_unstable = (props: ToasterProps): ToasterState => {\n const { offset, announce: announceProp, mountNode, ...rest } = props;\n const announceRef = React.useRef<Announce>(() => null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } =\n useToaster<HTMLDivElement>(rest);\n const announce = React.useCallback<Announce>((message, options) => announceRef.current(message, options), []);\n const { dir } = useFluent();\n\n const rootProps = slot.always(getNativeElementProps('div', rest), { elementType: 'div' });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: { Escape: true },\n });\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n props.onKeyDown?.(e);\n });\n const usePositionSlot = (toastPosition: ToastPosition) => {\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp ?? announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: toastsToRender.get(toastPosition)?.map(toast => (\n <ToastContainer\n {...toast}\n tryRestoreFocus={tryRestoreFocus}\n intent={toast.intent}\n announce={announceToast}\n key={toast.toastId}\n visible={isToastVisible(toast.toastId)}\n >\n {toast.content as React.ReactNode}\n </ToastContainer>\n )),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list',\n // Explicitly casting because our slot types can't handle data attributes\n } as ExtractSlotProps<Slot<'div'>>,\n elementType: 'div',\n });\n };\n\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div',\n top: 'div',\n bottom: 'div',\n },\n root: slot.always(rootProps, { elementType: 'div' }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n top: usePositionSlot(TOAST_POSITIONS.top),\n bottom: usePositionSlot(TOAST_POSITIONS.bottom),\n announceRef,\n offset,\n announce: announceProp ?? announce,\n renderAriaLive: !announceProp,\n };\n};\n"],"names":["React","getNativeElementProps","useEventCallback","useMergedRefs","slot","useFluent_unstable","useFluent","useFocusableGroup","Escape","TOAST_POSITIONS","useToaster","ToastContainer","useToasterFocusManagement_unstable","useToastAnnounce","useToaster_unstable","props","offset","announce","announceProp","mountNode","rest","announceRef","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useCallback","message","options","current","dir","rootProps","always","elementType","focusableGroupAttr","tabBehavior","ignoreDefaultKeydown","onKeyDown","e","key","preventDefault","usePositionSlot","toastPosition","focusManagementRef","announceToast","toasterRef","optional","has","defaultProps","ref","children","get","map","toast","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","top","bottom","renderAriaLive"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAGEC,qBAAqB,EACrBC,gBAAgB,EAChBC,aAAa,EACbC,IAAI,QACC,4BAA4B;AACnC,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD,SAASC,eAAe,EAAiBC,UAAU,QAAQ,cAAc;AAEzE,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD;;;;CAIC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClC,MAAM,EAAEC,MAAM,EAAEC,UAAUC,YAAY,EAAEC,SAAS,EAAE,GAAGC,MAA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,OAAO;wBAClBC,SAASnC,eAAegC,MAAME,OAAO;uBAEpCF,MAAMI,OAAO;gBAGlBpB;gBACA,GAAGH,kBAAkB;gBACrB,yBAAyBQ;gBACzBgB,MAAM;YAER;YACAzB,aAAa;QACf;IACF;IAEA,OAAO;QACLH;QACAd;QACA2C,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;YACRC,KAAK;YACLC,QAAQ;QACV;QACAN,MAAM3D,KAAK+B,MAAM,CAACD,WAAW;YAAEE,aAAa;QAAM;QAClD4B,aAAapB,gBAAgBnC,gBAAgBuD,WAAW;QACxDC,WAAWrB,gBAAgBnC,gBAAgBwD,SAAS;QACpDC,UAAUtB,gBAAgBnC,gBAAgByD,QAAQ;QAClDC,QAAQvB,gBAAgBnC,gBAAgB0D,MAAM;QAC9CC,KAAKxB,gBAAgBnC,gBAAgB2D,GAAG;QACxCC,QAAQzB,gBAAgBnC,gBAAgB4D,MAAM;QAC9ChD;QACAL;QACAC,UAAUC,yBAAAA,0BAAAA,eAAgBD;QAC1BqD,gBAAgB,CAACpD;IACnB;AACF,EAAE"}
@@ -41,6 +41,20 @@ export const useToasterStyles_unstable = state => {
41
41
  (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
42
42
  Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));
43
43
  }
44
+ if (state.top) {
45
+ var _state_top;
46
+ state.top.className = className;
47
+ var _style4;
48
+ (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};
49
+ Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));
50
+ }
51
+ if (state.bottom) {
52
+ var _state_bottom;
53
+ state.bottom.className = className;
54
+ var _style5;
55
+ (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};
56
+ Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));
57
+ }
44
58
  return state;
45
59
  };
46
60
  //# sourceMappingURL=useToasterStyles.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles_unstable","state","rootBaseClassName","className","bottomStart","_state_bottomStart","_style","style","Object","assign","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3"],"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none'\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAA0BC,YAAY,QAAQ,gBAAgB;AAC9D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,mBAAmB;AACtE,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,oBAAoB,gBAAGN,aAAA,+EAIhC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMO,yBAAyB,GAAIC,KAAK,IAAG;EAClD,MAAMC,iBAAiB,GAAGH,oBAAoB,CAAC,CAAC;EAChD,MAAMI,SAAS,GAAGT,YAAY,CAACG,iBAAiB,CAACC,IAAI,EAAEI,iBAAiB,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC/F,IAAIF,KAAK,CAACG,WAAW,EAAE;IACnB,IAAIC,kBAAkB;IACtBJ,KAAK,CAACG,WAAW,CAACD,SAAS,GAAGA,SAAS;IACvC,IAAIG,MAAM;IACV,CAACA,MAAM,GAAG,CAACD,kBAAkB,GAAGJ,KAAK,CAACG,WAAW,EAAEG,KAAK,MAAM,IAAI,IAAID,MAAM,KAAK,KAAK,CAAC,GAAGA,MAAM,GAAGD,kBAAkB,CAACE,KAAK,GAAG,CAAC,CAAC;IAChIC,MAAM,CAACC,MAAM,CAACR,KAAK,CAACG,WAAW,CAACG,KAAK,EAAEX,iBAAiB,CAACD,eAAe,CAACS,WAAW,EAAEH,KAAK,CAACS,GAAG,EAAET,KAAK,CAACU,MAAM,CAAC,CAAC;EACnH;EACA,IAAIV,KAAK,CAACW,SAAS,EAAE;IACjB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M,CAACC,MAAM,CAACR,KAAK,CAACiB,MAAM,CAACX,KAAK,EAAEX,iBAAiB,CAACD,eAAe,CAACuB,MAAM,EAAEjB,KAAK,CAACS,GAAG,EAAET,KAAK,CAACU,MAAM,CAAC,CAAC;EACzG;EACA,OAAOV,KAAK;AAChB,CAAC"}
1
+ {"version":3,"names":["__resetStyles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles_unstable","state","rootBaseClassName","className","bottomStart","_state_bottomStart","_style","style","Object","assign","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */ const useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none'\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAA0BC,YAAY,QAAQ,gBAAgB;AAC9D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,mBAAmB;AACtE,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,oBAAoB,gBAAGN,aAAA,+EAIhC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMO,yBAAyB,GAAIC,KAAK,IAAG;EAClD,MAAMC,iBAAiB,GAAGH,oBAAoB,CAAC,CAAC;EAChD,MAAMI,SAAS,GAAGT,YAAY,CAACG,iBAAiB,CAACC,IAAI,EAAEI,iBAAiB,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC/F,IAAIF,KAAK,CAACG,WAAW,EAAE;IACnB,IAAIC,kBAAkB;IACtBJ,KAAK,CAACG,W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CAACD,aAAa,GAAGxB,KAAK,CAACuB,MAAM,EAAEjB,KAAK,MAAM,IAAI,IAAImB,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,aAAa,CAAClB,KAAK,GAAG,CAAC,CAAC;IACpHC,MAAM,CAACC,MAAM,CAACR,KAAK,CAACuB,MAAM,CAACjB,KAAK,EAAEX,iBAAiB,CAACD,eAAe,CAAC6B,MAAM,EAAEvB,KAAK,CAACS,GAAG,EAAET,KAAK,CAACU,MAAM,CAAC,CAAC;EACzG;EACA,OAAOV,KAAK;AAChB,CAAC"}
@@ -7,8 +7,10 @@ export const EVENTS = {
7
7
  play: 'fui-toast-play'
8
8
  };
9
9
  export const TOAST_POSITIONS = {
10
+ bottom: 'bottom',
10
11
  bottomEnd: 'bottom-end',
11
12
  bottomStart: 'bottom-start',
13
+ top: 'top',
12
14
  topEnd: 'top-end',
13
15
  topStart: 'top-start'
14
16
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["constants.ts"],"sourcesContent":["export const EVENTS = {\n show: 'fui-toast-show',\n dismiss: 'fui-toast-dismiss',\n dismissAll: 'fui-toast-dismiss-all',\n update: 'fui-toast-update',\n pause: 'fui-toast-pause',\n play: 'fui-toast-play',\n} as const;\n\nexport const TOAST_POSITIONS = {\n bottomEnd: 'bottom-end',\n bottomStart: 'bottom-start',\n topEnd: 'top-end',\n topStart: 'top-start',\n} as const;\n"],"names":["EVENTS","show","dismiss","dismissAll","update","pause","play","TOAST_POSITIONS","bottomEnd","bottomStart","topEnd","topStart"],"mappings":"AAAA,OAAO,MAAMA,SAAS;IACpBC,MAAM;IACNC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,OAAO;IACPC,MAAM;AACR,EAAW;AAEX,OAAO,MAAMC,kBAAkB;IAC7BC,WAAW;IACXC,aAAa;IACbC,QAAQ;IACRC,UAAU;AACZ,EAAW"}
1
+ {"version":3,"sources":["constants.ts"],"sourcesContent":["export const EVENTS = {\n show: 'fui-toast-show',\n dismiss: 'fui-toast-dismiss',\n dismissAll: 'fui-toast-dismiss-all',\n update: 'fui-toast-update',\n pause: 'fui-toast-pause',\n play: 'fui-toast-play',\n} as const;\n\nexport const TOAST_POSITIONS = {\n bottom: 'bottom',\n bottomEnd: 'bottom-end',\n bottomStart: 'bottom-start',\n top: 'top',\n topEnd: 'top-end',\n topStart: 'top-start',\n} as const;\n"],"names":["EVENTS","show","dismiss","dismissAll","update","pause","play","TOAST_POSITIONS","bottom","bottomEnd","bottomStart","top","topEnd","topStart"],"mappings":"AAAA,OAAO,MAAMA,SAAS;IACpBC,MAAM;IACNC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,OAAO;IACPC,MAAM;AACR,EAAW;AAEX,OAAO,MAAMC,kBAAkB;IAC7BC,QAAQ;IACRC,WAAW;IACXC,aAAa;IACbC,KAAK;IACLC,QAAQ;IACRC,UAAU;AACZ,EAAW"}
@@ -1 +1 @@
1
- {"version":3,"sources":["types.ts"],"sourcesContent":["import type { Slot } from '@fluentui/react-utilities';\nimport { EVENTS } from './constants';\nimport * as React from 'react';\n\nexport type ToastId = string;\nexport type ToasterId = string;\n\nexport type ToastPosition = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';\nexport type ToastPoliteness = 'assertive' | 'polite';\nexport type ToastStatus = 'queued' | 'visible' | 'dismissed' | 'unmounted';\nexport type ToastIntent = 'info' | 'success' | 'error' | 'warning';\nexport type ToastChangeHandler = (event: null, data: ToastChangeData) => void;\n\nexport interface ToastChangeData extends ToastOptions, Pick<Toast, 'updateId'> {\n status: ToastStatus;\n}\n\nexport interface ToastOptions<TData = object> {\n /**\n * Uniquely identifies a toast, used for update and dismiss operations\n */\n toastId: ToastId;\n /**\n * The position the toast should render to\n */\n position: ToastPosition;\n /**\n * Toast content\n */\n content: unknown;\n /**\n * Auto dismiss timeout in milliseconds\n * @default 3000\n */\n timeout: number;\n /**\n * Toast timeout pauses while focus is on another window\n * @default false\n */\n pauseOnWindowBlur: boolean;\n /**\n * Toast timeout pauses while user cursor is on the toast\n * @default false\n */\n pauseOnHover: boolean;\n /**\n * Toast belongs to a specific toaster\n */\n toasterId: ToasterId | undefined;\n /**\n * Higher priority toasts will be rendered before lower priority toasts\n */\n priority: number;\n /**\n * Used to determine [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) narration\n * This will override the intent prop\n */\n politeness?: ToastPoliteness;\n\n /**\n * Default toast types that determine the urgency or [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) narration\n * The UI layer may use these intents to apply specific styling.\n * @default info\n */\n intent?: ToastIntent;\n /**\n * Additional data that needs to be passed to the toast\n */\n data: TData;\n\n /**\n * Reports changes to the Toast lifecycle\n */\n onStatusChange: ToastChangeHandler | undefined;\n}\n\nexport interface ToastOffsetObject {\n horizontal?: number;\n vertical?: number;\n}\n\nexport type ToastOffset = Partial<Record<ToastPosition, ToastOffsetObject>> | ToastOffsetObject;\n\nexport interface ToasterShortcuts {\n focus: (e: KeyboardEvent) => boolean;\n}\n\nexport interface ToasterOptions\n extends Pick<ToastOptions, 'position' | 'timeout' | 'pauseOnWindowBlur' | 'pauseOnHover' | 'priority'> {\n offset?: ToastOffset;\n toasterId?: ToasterId;\n limit?: number;\n shortcuts?: ToasterShortcuts;\n}\n\nexport interface Toast<TData = object> extends ToastOptions<TData> {\n /**\n * Determines the visiblity of a toast\n */\n close: () => void;\n /**\n * Removes a toast completely\n */\n remove: () => void;\n /**\n * A number used to track updates immutably\n */\n updateId: number;\n /**\n * Used to determine default priority when the user does not set one\n * Simple counter of toasts dispatched.\n */\n order: number;\n\n imperativeRef: React.RefObject<ToastImperativeRef>;\n}\n\nexport interface CommonToastDetail {\n toasterId?: ToasterId;\n}\n\nexport interface ShowToastEventDetail extends Partial<ToastOptions>, CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface UpdateToastEventDetail extends Partial<ToastOptions>, CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface DismissToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface PauseToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface PlayToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface DismissAllToastsEventDetail extends CommonToastDetail {}\n\ntype EventListener<TDetail> = (e: CustomEvent<TDetail>) => void;\n\nexport type ToastListenerMap = {\n [EVENTS.show]: EventListener<ShowToastEventDetail>;\n [EVENTS.dismiss]: EventListener<DismissToastEventDetail>;\n [EVENTS.dismissAll]: EventListener<DismissAllToastsEventDetail>;\n [EVENTS.update]: EventListener<UpdateToastEventDetail>;\n [EVENTS.play]: EventListener<PlayToastEventDetail>;\n [EVENTS.pause]: EventListener<PauseToastEventDetail>;\n};\n\ntype RootSlot = Slot<'div'>;\n\nexport interface DispatchToastOptions extends Partial<Omit<ToastOptions, 'toasterId'>> {\n root?: RootSlot;\n}\n\nexport interface UpdateToastOptions extends UpdateToastEventDetail {\n root?: RootSlot;\n}\n\nexport type ToastImperativeRef = {\n /**\n * Focuses the Toast.\n * If there are no focusable elements in the Toast, the Toast itself is focused.\n */\n focus: () => void;\n\n /**\n * Resumes the timeout of a paused toast\n */\n play: () => void;\n\n /**\n * Pauses the timeout of a toast\n */\n pause: () => void;\n};\n"],"names":["React"],"mappings":"AAEA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":["import type { Slot } from '@fluentui/react-utilities';\nimport { EVENTS } from './constants';\nimport * as React from 'react';\n\nexport type ToastId = string;\nexport type ToasterId = string;\n\nexport type ToastPosition = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start' | 'top' | 'bottom';\nexport type ToastPoliteness = 'assertive' | 'polite';\nexport type ToastStatus = 'queued' | 'visible' | 'dismissed' | 'unmounted';\nexport type ToastIntent = 'info' | 'success' | 'error' | 'warning';\nexport type ToastChangeHandler = (event: null, data: ToastChangeData) => void;\n\nexport interface ToastChangeData extends ToastOptions, Pick<Toast, 'updateId'> {\n status: ToastStatus;\n}\n\nexport interface ToastOptions<TData = object> {\n /**\n * Uniquely identifies a toast, used for update and dismiss operations\n */\n toastId: ToastId;\n /**\n * The position the toast should render to\n */\n position: ToastPosition;\n /**\n * Toast content\n */\n content: unknown;\n /**\n * Auto dismiss timeout in milliseconds\n * @default 3000\n */\n timeout: number;\n /**\n * Toast timeout pauses while focus is on another window\n * @default false\n */\n pauseOnWindowBlur: boolean;\n /**\n * Toast timeout pauses while user cursor is on the toast\n * @default false\n */\n pauseOnHover: boolean;\n /**\n * Toast belongs to a specific toaster\n */\n toasterId: ToasterId | undefined;\n /**\n * Higher priority toasts will be rendered before lower priority toasts\n */\n priority: number;\n /**\n * Used to determine [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) narration\n * This will override the intent prop\n */\n politeness?: ToastPoliteness;\n\n /**\n * Default toast types that determine the urgency or [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) narration\n * The UI layer may use these intents to apply specific styling.\n * @default info\n */\n intent?: ToastIntent;\n /**\n * Additional data that needs to be passed to the toast\n */\n data: TData;\n\n /**\n * Reports changes to the Toast lifecycle\n */\n onStatusChange: ToastChangeHandler | undefined;\n}\n\nexport interface ToastOffsetObject {\n horizontal?: number;\n vertical?: number;\n}\n\nexport type ToastOffset = Partial<Record<ToastPosition, ToastOffsetObject>> | ToastOffsetObject;\n\nexport interface ToasterShortcuts {\n focus: (e: KeyboardEvent) => boolean;\n}\n\nexport interface ToasterOptions\n extends Pick<ToastOptions, 'position' | 'timeout' | 'pauseOnWindowBlur' | 'pauseOnHover' | 'priority'> {\n offset?: ToastOffset;\n toasterId?: ToasterId;\n limit?: number;\n shortcuts?: ToasterShortcuts;\n}\n\nexport interface Toast<TData = object> extends ToastOptions<TData> {\n /**\n * Determines the visiblity of a toast\n */\n close: () => void;\n /**\n * Removes a toast completely\n */\n remove: () => void;\n /**\n * A number used to track updates immutably\n */\n updateId: number;\n /**\n * Used to determine default priority when the user does not set one\n * Simple counter of toasts dispatched.\n */\n order: number;\n\n imperativeRef: React.RefObject<ToastImperativeRef>;\n}\n\nexport interface CommonToastDetail {\n toasterId?: ToasterId;\n}\n\nexport interface ShowToastEventDetail extends Partial<ToastOptions>, CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface UpdateToastEventDetail extends Partial<ToastOptions>, CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface DismissToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface PauseToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface PlayToastEventDetail extends CommonToastDetail {\n toastId: ToastId;\n}\n\nexport interface DismissAllToastsEventDetail extends CommonToastDetail {}\n\ntype EventListener<TDetail> = (e: CustomEvent<TDetail>) => void;\n\nexport type ToastListenerMap = {\n [EVENTS.show]: EventListener<ShowToastEventDetail>;\n [EVENTS.dismiss]: EventListener<DismissToastEventDetail>;\n [EVENTS.dismissAll]: EventListener<DismissAllToastsEventDetail>;\n [EVENTS.update]: EventListener<UpdateToastEventDetail>;\n [EVENTS.play]: EventListener<PlayToastEventDetail>;\n [EVENTS.pause]: EventListener<PauseToastEventDetail>;\n};\n\ntype RootSlot = Slot<'div'>;\n\nexport interface DispatchToastOptions extends Partial<Omit<ToastOptions, 'toasterId'>> {\n root?: RootSlot;\n}\n\nexport interface UpdateToastOptions extends UpdateToastEventDetail {\n root?: RootSlot;\n}\n\nexport type ToastImperativeRef = {\n /**\n * Focuses the Toast.\n * If there are no focusable elements in the Toast, the Toast itself is focused.\n */\n focus: () => void;\n\n /**\n * Resumes the timeout of a paused toast\n */\n play: () => void;\n\n /**\n * Pauses the timeout of a toast\n */\n pause: () => void;\n};\n"],"names":["React"],"mappings":"AAEA,YAAYA,WAAW,QAAQ"}
@@ -8,6 +8,20 @@ export const getPositionStyles = (position, dir, offset)=>{
8
8
  const start = dir === 'ltr' ? 'left' : 'right';
9
9
  const end = dir === 'ltr' ? 'right' : 'left';
10
10
  switch(position){
11
+ case 'top':
12
+ Object.assign(positionStyles, {
13
+ top: vertical,
14
+ left: `calc(50% + ${horizontal}px)`,
15
+ transform: 'translateX(-50%)'
16
+ });
17
+ break;
18
+ case 'bottom':
19
+ Object.assign(positionStyles, {
20
+ bottom: vertical,
21
+ left: `calc(50% + ${horizontal}px)`,
22
+ transform: 'translateX(-50%)'
23
+ });
24
+ break;
11
25
  case 'top-start':
12
26
  Object.assign(positionStyles, {
13
27
  top: vertical,
@@ -1 +1 @@
1
- {"version":3,"sources":["getPositionStyles.ts"],"sourcesContent":["import { ToastOffsetObject, ToastOffset, ToastPosition } from '../types';\n\ninterface PositionStyles {\n position: 'fixed';\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n}\n\nexport const getPositionStyles = (position: ToastPosition, dir: 'rtl' | 'ltr', offset?: ToastOffset) => {\n const positionStyles: PositionStyles = {\n position: 'fixed',\n };\n\n const offsetStyles: ToastOffsetObject = offset ? (isShorthandOffset(offset) ? offset : offset[position] ?? {}) : {};\n\n const { horizontal = 20, vertical = 16 } = offsetStyles;\n const start = dir === 'ltr' ? 'left' : 'right';\n const end = dir === 'ltr' ? 'right' : 'left';\n\n switch (position) {\n case 'top-start':\n Object.assign(positionStyles, {\n top: vertical,\n [start]: horizontal,\n });\n break;\n case 'top-end':\n Object.assign(positionStyles, {\n top: vertical,\n [end]: horizontal,\n });\n break;\n case 'bottom-start':\n Object.assign(positionStyles, {\n bottom: vertical,\n [start]: horizontal,\n });\n break;\n case 'bottom-end':\n Object.assign(positionStyles, {\n bottom: vertical,\n [end]: horizontal,\n });\n break;\n }\n\n return positionStyles;\n};\n\nfunction isShorthandOffset(offset: ToastOffset): offset is ToastOffsetObject {\n return 'horizontal' in offset || 'vertical' in offset;\n}\n"],"names":["getPositionStyles","position","dir","offset","positionStyles","offsetStyles","isShorthandOffset","horizontal","vertical","start","end","Object","assign","top","bottom"],"mappings":"AAUA,OAAO,MAAMA,oBAAoB,CAACC,UAAyBC,KAAoBC;IAC7E,MAAMC,iBAAiC;QACrCH,UAAU;IACZ;QAEuFE;IAAvF,MAAME,eAAkCF,SAAUG,kBAAkBH,UAAUA,SAASA,CAAAA,mBAAAA,MAAM,CAACF,SAAS,cAAhBE,8BAAAA,mBAAoB,CAAC,IAAK,CAAC;IAElH,MAAM,EAAEI,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAE,GAAGH;IAC3C,MAAMI,QAAQP,QAAQ,QAAQ,SAAS;IACvC,MAAMQ,MAAMR,QAAQ,QAAQ,UAAU;IAEtC,OAAQD;QACN,KAAK;YACHU,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BS,KAAKL;gBACL,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BS,KAAKL;gBACL,CAACE,IAAI,EAAEH;YACT;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BU,QAAQN;gBACR,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BU,QAAQN;gBACR,CAACE,IAAI,EAAEH;YACT;YACA;IACJ;IAEA,OAAOH;AACT,EAAE;AAEF,SAASE,kBAAkBH,MAAmB;IAC5C,OAAO,gBAAgBA,UAAU,cAAcA;AACjD"}
1
+ {"version":3,"sources":["getPositionStyles.ts"],"sourcesContent":["import { ToastOffsetObject, ToastOffset, ToastPosition } from '../types';\n\ninterface PositionStyles {\n position: 'fixed';\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n}\n\nexport const getPositionStyles = (position: ToastPosition, dir: 'rtl' | 'ltr', offset?: ToastOffset) => {\n const positionStyles: PositionStyles = {\n position: 'fixed',\n };\n\n const offsetStyles: ToastOffsetObject = offset ? (isShorthandOffset(offset) ? offset : offset[position] ?? {}) : {};\n\n const { horizontal = 20, vertical = 16 } = offsetStyles;\n const start = dir === 'ltr' ? 'left' : 'right';\n const end = dir === 'ltr' ? 'right' : 'left';\n\n switch (position) {\n case 'top':\n Object.assign(positionStyles, {\n top: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)',\n });\n break;\n\n case 'bottom':\n Object.assign(positionStyles, {\n bottom: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)',\n });\n break;\n\n case 'top-start':\n Object.assign(positionStyles, {\n top: vertical,\n [start]: horizontal,\n });\n break;\n case 'top-end':\n Object.assign(positionStyles, {\n top: vertical,\n [end]: horizontal,\n });\n break;\n case 'bottom-start':\n Object.assign(positionStyles, {\n bottom: vertical,\n [start]: horizontal,\n });\n break;\n case 'bottom-end':\n Object.assign(positionStyles, {\n bottom: vertical,\n [end]: horizontal,\n });\n break;\n }\n\n return positionStyles;\n};\n\nfunction isShorthandOffset(offset: ToastOffset): offset is ToastOffsetObject {\n return 'horizontal' in offset || 'vertical' in offset;\n}\n"],"names":["getPositionStyles","position","dir","offset","positionStyles","offsetStyles","isShorthandOffset","horizontal","vertical","start","end","Object","assign","top","left","transform","bottom"],"mappings":"AAUA,OAAO,MAAMA,oBAAoB,CAACC,UAAyBC,KAAoBC;IAC7E,MAAMC,iBAAiC;QACrCH,UAAU;IACZ;QAEuFE;IAAvF,MAAME,eAAkCF,SAAUG,kBAAkBH,UAAUA,SAASA,CAAAA,mBAAAA,MAAM,CAACF,SAAS,cAAhBE,8BAAAA,mBAAoB,CAAC,IAAK,CAAC;IAElH,MAAM,EAAEI,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAE,GAAGH;IAC3C,MAAMI,QAAQP,QAAQ,QAAQ,SAAS;IACvC,MAAMQ,MAAMR,QAAQ,QAAQ,UAAU;IAEtC,OAAQD;QACN,KAAK;YACHU,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BS,KAAKL;gBACLM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACb;YACA;QAEF,KAAK;YACHJ,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BY,QAAQR;gBACRM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACb;YACA;QAEF,KAAK;YACHJ,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BS,KAAKL;gBACL,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BS,KAAKL;gBACL,CAACE,IAAI,EAAEH;YACT;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BY,QAAQR;gBACR,CAACC,MAAM,EAAEF;YACX;YACA;QACF,KAAK;YACHI,OAAOC,MAAM,CAACR,gBAAgB;gBAC5BY,QAAQR;gBACR,CAACE,IAAI,EAAEH;YACT;YACA;IACJ;IAEA,OAAOH;AACT,EAAE;AAEF,SAASE,kBAAkBH,MAAmB;IAC5C,OAAO,gBAAgBA,UAAU,cAAcA;AACjD"}
@@ -15,7 +15,7 @@ const _AriaLive = require("../AriaLive");
15
15
  const renderToaster_unstable = (state)=>{
16
16
  const { announceRef, renderAriaLive } = state;
17
17
  (0, _reactutilities.assertSlots)(state);
18
- const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;
18
+ const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd || !!state.top || !!state.bottom;
19
19
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
20
20
  children: [
21
21
  renderAriaLive ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_AriaLive.AriaLive, {
@@ -24,10 +24,12 @@ const renderToaster_unstable = (state)=>{
24
24
  hasToasts ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactportal.Portal, {
25
25
  mountNode: state.mountNode,
26
26
  children: [
27
+ state.bottom ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.bottom, {}) : null,
27
28
  state.bottomStart ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.bottomStart, {}) : null,
28
29
  state.bottomEnd ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.bottomEnd, {}) : null,
29
30
  state.topStart ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.topStart, {}) : null,
30
- state.topEnd ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.topEnd, {}) : null
31
+ state.topEnd ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.topEnd, {}) : null,
32
+ state.top ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.top, {}) : null
31
33
  ]
32
34
  }) : null
33
35
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef, renderAriaLive } = state;\n assertSlots(state);\n const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd;\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n renderAriaLive ? /*#__PURE__*/ _jsx(AriaLive, {\n announceRef: announceRef\n }) : null,\n hasToasts ? /*#__PURE__*/ _jsxs(Portal, {\n mountNode: state.mountNode,\n children: [\n state.bottomStart ? /*#__PURE__*/ _jsx(state.bottomStart, {}) : null,\n state.bottomEnd ? /*#__PURE__*/ _jsx(state.bottomEnd, {}) : null,\n state.topStart ? /*#__PURE__*/ _jsx(state.topStart, {}) : null,\n state.topEnd ? /*#__PURE__*/ _jsx(state.topEnd, {}) : null\n ]\n }) : null\n ]\n });\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","assertSlots","hasToasts","bottomStart","bottomEnd","topStart","topEnd","_jsxs","_Fragment","children","_jsx","AriaLive","Portal","mountNode"],"mappings":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAM7DA;;;eAAAA;;;4BANkI;gCACvH;6BACL;0BACE;AAGd,MAAMA,yBAAyB,CAACC;IACvC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGF;IACxCG,IAAAA,2BAAW,EAACH;IACZ,MAAMI,YAAY,CAAC,CAACJ,MAAMK,WAAW,IAAI,CAAC,CAACL,MAAMM,SAAS,IAAI,CAAC,CAACN,MAAMO,QAAQ,IAAI,CAAC,CAACP,MAAMQ,MAAM;IAChG,OAAO,WAAW,GAAGC,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACNT,iBAAiB,WAAW,GAAGU,IAAAA,eAAI,EAACC,kBAAQ,EAAE;gBAC1CZ,aAAaA;YACjB,KAAK;YACLG,YAAY,WAAW,GAAGK,IAAAA,gBAAK,EAACK,mBAAM,EAAE;gBACpCC,WAAWf,MAAMe,SAAS;gBAC1BJ,UAAU;oBACNX,MAAMK,WAAW,GAAG,WAAW,GAAGO,IAAAA,eAAI,EAACZ,MAAMK,WAAW,EAAE,CAAC,KAAK;oBAChEL,MAAMM,SAAS,GAAG,WAAW,GAAGM,IAAAA,eAAI,EAACZ,MAAMM,SAAS,EAAE,CAAC,KAAK;oBAC5DN,MAAMO,QAAQ,GAAG,WAAW,GAAGK,IAAAA,eAAI,EAACZ,MAAMO,QAAQ,EAAE,CAAC,KAAK;oBAC1DP,MAAMQ,MAAM,GAAG,WAAW,GAAGI,IAAAA,eAAI,EAACZ,MAAMQ,MAAM,EAAE,CAAC,KAAK;iBACzD;YACL,KAAK;SACR;IACL;AACJ"}
1
+ {"version":3,"sources":["renderToaster.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport { AriaLive } from '../AriaLive';\n/**\n * Render the final JSX of Toaster\n */ export const renderToaster_unstable = (state)=>{\n const { announceRef, renderAriaLive } = state;\n assertSlots(state);\n const hasToasts = !!state.bottomStart || !!state.bottomEnd || !!state.topStart || !!state.topEnd || !!state.top || !!state.bottom;\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n renderAriaLive ? /*#__PURE__*/ _jsx(AriaLive, {\n announceRef: announceRef\n }) : null,\n hasToasts ? /*#__PURE__*/ _jsxs(Portal, {\n mountNode: state.mountNode,\n children: [\n state.bottom ? /*#__PURE__*/ _jsx(state.bottom, {}) : null,\n state.bottomStart ? /*#__PURE__*/ _jsx(state.bottomStart, {}) : null,\n state.bottomEnd ? /*#__PURE__*/ _jsx(state.bottomEnd, {}) : null,\n state.topStart ? /*#__PURE__*/ _jsx(state.topStart, {}) : null,\n state.topEnd ? /*#__PURE__*/ _jsx(state.topEnd, {}) : null,\n state.top ? /*#__PURE__*/ _jsx(state.top, {}) : null\n ]\n }) : null\n ]\n });\n};\n"],"names":["renderToaster_unstable","state","announceRef","renderAriaLive","assertSlots","hasToasts","bottomStart","bottomEnd","topStart","topEnd","top","bottom","_jsxs","_Fragment","children","_jsx","AriaLive","Portal","mountNode"],"mappings":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAM7DA;;;eAAAA;;;4BANkI;gCACvH;6BACL;0BACE;AAGd,MAAMA,yBAAyB,CAACC;IACvC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGF;IACxCG,IAAAA,2BAAW,EAACH;IACZ,MAAMI,YAAY,CAAC,CAACJ,MAAMK,WAAW,IAAI,CAAC,CAACL,MAAMM,SAAS,IAAI,CAAC,CAACN,MAAMO,QAAQ,IAAI,CAAC,CAACP,MAAMQ,MAAM,IAAI,CAAC,CAACR,MAAMS,GAAG,IAAI,CAAC,CAACT,MAAMU,MAAM;IACjI,OAAO,WAAW,GAAGC,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACNX,iBAAiB,WAAW,GAAGY,IAAAA,eAAI,EAACC,kBAAQ,EAAE;gBAC1Cd,aAAaA;YACjB,KAAK;YACLG,YAAY,WAAW,GAAGO,IAAAA,gBAAK,EAACK,mBAAM,EAAE;gBACpCC,WAAWjB,MAAMiB,SAAS;gBAC1BJ,UAAU;oBACNb,MAAMU,MAAM,GAAG,WAAW,GAAGI,IAAAA,eAAI,EAACd,MAAMU,MAAM,EAAE,CAAC,KAAK;oBACtDV,MAAMK,WAAW,GAAG,WAAW,GAAGS,IAAAA,eAAI,EAACd,MAAMK,WAAW,EAAE,CAAC,KAAK;oBAChEL,MAAMM,SAAS,GAAG,WAAW,GAAGQ,IAAAA,eAAI,EAACd,MAAMM,SAAS,EAAE,CAAC,KAAK;oBAC5DN,MAAMO,QAAQ,GAAG,WAAW,GAAGO,IAAAA,eAAI,EAACd,MAAMO,QAAQ,EAAE,CAAC,KAAK;oBAC1DP,MAAMQ,MAAM,GAAG,WAAW,GAAGM,IAAAA,eAAI,EAACd,MAAMQ,MAAM,EAAE,CAAC,KAAK;oBACtDR,MAAMS,GAAG,GAAG,WAAW,GAAGK,IAAAA,eAAI,EAACd,MAAMS,GAAG,EAAE,CAAC,KAAK;iBACnD;YACL,KAAK;SACR;IACL;AACJ"}
@@ -72,7 +72,9 @@ const useToaster_unstable = (props)=>{
72
72
  bottomStart: 'div',
73
73
  bottomEnd: 'div',
74
74
  topStart: 'div',
75
- topEnd: 'div'
75
+ topEnd: 'div',
76
+ top: 'div',
77
+ bottom: 'div'
76
78
  },
77
79
  root: _reactutilities.slot.always(rootProps, {
78
80
  elementType: 'div'
@@ -81,6 +83,8 @@ const useToaster_unstable = (props)=>{
81
83
  bottomEnd: usePositionSlot(_state.TOAST_POSITIONS.bottomEnd),
82
84
  topStart: usePositionSlot(_state.TOAST_POSITIONS.topStart),
83
85
  topEnd: usePositionSlot(_state.TOAST_POSITIONS.topEnd),
86
+ top: usePositionSlot(_state.TOAST_POSITIONS.top),
87
+ bottom: usePositionSlot(_state.TOAST_POSITIONS.bottom),
84
88
  announceRef,
85
89
  offset,
86
90
  announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,
@@ -1 +1 @@
1
- {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset, announce: announceProp, mountNode, ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = slot.always(getNativeElementProps('div', rest), {\n elementType: 'div'\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: {\n Escape: true\n }\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown, _props;\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n (_props_onKeyDown = (_props = props).onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(_props, e);\n });\n const usePositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp !== null && announceProp !== void 0 ? announceProp : announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announceToast,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list'\n },\n elementType: 'div'\n });\n };\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div'\n },\n root: slot.always(rootProps, {\n elementType: 'div'\n }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","mountNode","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","slot","always","getNativeElementProps","elementType","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","_props_onKeyDown","_props","key","preventDefault","call","usePositionSlot","toastPosition","_toastsToRender_get","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","optional","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role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AAE,GAAGC,IAAAA,kCAAgB,EAAC5C,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAeD;QACzH,OAAOqB,oBAAI,CAACyB,QAAQ,CAACvC,eAAewC,GAAG,CAACR,iBAAiBnB,YAAY,MAAM;YACvE4B,cAAc;gBACVC,KAAKC,IAAAA,6BAAa,EAACT,oBAAoBG;gBACvCO,UAAU,AAACX,CAAAA,sBAAsBjC,eAAe6C,GAAG,CAACb,cAAa,MAAO,QAAQC,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBa,GAAG,CAAC,CAACC,QAAQ,WAAW,GAAGjD,OAAMkD,aAAa,CAACC,8BAAc,EAAE;wBACrM,GAAGF,KAAK;wBACR3C,iBAAiBA;wBACjB8C,QAAQH,MAAMG,MAAM;wBACpBzD,UAAU2C;wBACVR,KAAKmB,MAAMI,OAAO;wBAClBC,SAASnD,eAAe8C,MAAMI,OAAO;oBACzC,GAAGJ,MAAMM,OAAO;gBACpB9B;gBACA,GAAGL,kBAAkB;gBACrB,yBAAyBc;gBACzBsB,MAAM;YACV;YACArC,aAAa;QACjB;IACJ;IACA,OAAO;QACHN;QACAhB;QACA4D,YAAY;YACRC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;QACZ;QACAJ,MAAM1C,oBAAI,CAACC,MAAM,CAACF,WAAW;YACzBI,aAAa;QACjB;QACAwC,aAAa1B,gBAAgB8B,sBAAe,CAACJ,WAAW;QACxDC,WAAW3B,gBAAgB8B,sBAAe,CAACH,SAAS;QACpDC,UAAU5B,gBAAgB8B,sBAAe,CAACF,QAAQ;QAClDC,QAAQ7B,gBAAgB8B,sBAAe,CAACD,MAAM;QAC9C/D;QACAL;QACAC,UAAUC,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAeD;QAC5EqE,gBAAgB,CAACpE;IACrB;AACJ"}
1
+ {"version":3,"sources":["useToaster.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { Escape } from '@fluentui/keyboard-keys';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport { ToastContainer } from '../ToastContainer';\nimport { useToasterFocusManagement_unstable } from './useToasterFocusManagement';\nimport { useToastAnnounce } from './useToastAnnounce';\n/**\n * Create the state required to render Toaster.\n *\n * @param props - props from this instance of Toaster\n */ export const useToaster_unstable = (props)=>{\n const { offset, announce: announceProp, mountNode, ...rest } = props;\n const announceRef = React.useRef(()=>null);\n const { toastsToRender, isToastVisible, pauseAllToasts, playAllToasts, tryRestoreFocus, closeAllToasts } = useToaster(rest);\n const announce = React.useCallback((message, options)=>announceRef.current(message, options), []);\n const { dir } = useFluent();\n const rootProps = slot.always(getNativeElementProps('div', rest), {\n elementType: 'div'\n });\n const focusableGroupAttr = useFocusableGroup({\n tabBehavior: 'limited-trap-focus',\n ignoreDefaultKeydown: {\n Escape: true\n }\n });\n const onKeyDown = useEventCallback((e)=>{\n var _props_onKeyDown, _props;\n if (e.key === Escape) {\n e.preventDefault();\n closeAllToasts();\n }\n (_props_onKeyDown = (_props = props).onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(_props, e);\n });\n const usePositionSlot = (toastPosition)=>{\n var _toastsToRender_get;\n const focusManagementRef = useToasterFocusManagement_unstable(pauseAllToasts, playAllToasts);\n const { announceToast, toasterRef } = useToastAnnounce(announceProp !== null && announceProp !== void 0 ? announceProp : announce);\n return slot.optional(toastsToRender.has(toastPosition) ? rootProps : null, {\n defaultProps: {\n ref: useMergedRefs(focusManagementRef, toasterRef),\n children: (_toastsToRender_get = toastsToRender.get(toastPosition)) === null || _toastsToRender_get === void 0 ? void 0 : _toastsToRender_get.map((toast)=>/*#__PURE__*/ React.createElement(ToastContainer, {\n ...toast,\n tryRestoreFocus: tryRestoreFocus,\n intent: toast.intent,\n announce: announceToast,\n key: toast.toastId,\n visible: isToastVisible(toast.toastId)\n }, toast.content)),\n onKeyDown,\n ...focusableGroupAttr,\n 'data-toaster-position': toastPosition,\n role: 'list'\n },\n elementType: 'div'\n });\n };\n return {\n dir,\n mountNode,\n components: {\n root: 'div',\n bottomStart: 'div',\n bottomEnd: 'div',\n topStart: 'div',\n topEnd: 'div',\n top: 'div',\n bottom: 'div'\n },\n root: slot.always(rootProps, {\n elementType: 'div'\n }),\n bottomStart: usePositionSlot(TOAST_POSITIONS.bottomStart),\n bottomEnd: usePositionSlot(TOAST_POSITIONS.bottomEnd),\n topStart: usePositionSlot(TOAST_POSITIONS.topStart),\n topEnd: usePositionSlot(TOAST_POSITIONS.topEnd),\n top: usePositionSlot(TOAST_POSITIONS.top),\n bottom: usePositionSlot(TOAST_POSITIONS.bottom),\n announceRef,\n offset,\n announce: announceProp !== null && announceProp !== void 0 ? announceProp : announce,\n renderAriaLive: !announceProp\n };\n};\n"],"names":["useToaster_unstable","props","offset","announce","announceProp","mountNode","rest","announceRef","React","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useToaster","useCallback","message","options","current","dir","useFluent","rootProps","slot","always","getNativeElementProps","elementType","focusableGroupAttr","useFocusableGroup","tabBehavior","ignoreDefaultKeydown","Escape","onKeyDown","useEventCallback","e","_props_onKeyDown","_props","key","preventDefault","call","usePositionSlot","toastPosition","_toastsToRender_get","focusManagementRef","useToasterFocusManagement_unstable","announceToast","toasterRef","useToastAnnounce","optional","has","defaultProps","ref","useMergedRefs","children","get","map","toast","createElement","ToastContainer","intent","toastId","visible","content","role","components","root","bottomStart","bottomEnd","topStart","topEnd","top","bottom","TOAST_POSITIONS","renderAriaLive"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;gCACsD;qCAC7B;8BACd;8BACX;uBACqB;gCACb;2CACoB;kCAClB;AAKtB,MAAMA,sBAAsB,CAACC;IACpC,MAAM,EA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AAA,6BAAa,EAACT,oBAAoBG;gBACvCO,UAAU,AAACX,CAAAA,sBAAsBjC,eAAe6C,GAAG,CAACb,cAAa,MAAO,QAAQC,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBa,GAAG,CAAC,CAACC,QAAQ,WAAW,GAAGjD,OAAMkD,aAAa,CAACC,8BAAc,EAAE;wBACrM,GAAGF,KAAK;wBACR3C,iBAAiBA;wBACjB8C,QAAQH,MAAMG,MAAM;wBACpBzD,UAAU2C;wBACVR,KAAKmB,MAAMI,OAAO;wBAClBC,SAASnD,eAAe8C,MAAMI,OAAO;oBACzC,GAAGJ,MAAMM,OAAO;gBACpB9B;gBACA,GAAGL,kBAAkB;gBACrB,yBAAyBc;gBACzBsB,MAAM;YACV;YACArC,aAAa;QACjB;IACJ;IACA,OAAO;QACHN;QACAhB;QACA4D,YAAY;YACRC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;YACRC,KAAK;YACLC,QAAQ;QACZ;QACAN,MAAM1C,oBAAI,CAACC,MAAM,CAACF,WAAW;YACzBI,aAAa;QACjB;QACAwC,aAAa1B,gBAAgBgC,sBAAe,CAACN,WAAW;QACxDC,WAAW3B,gBAAgBgC,sBAAe,CAACL,SAAS;QACpDC,UAAU5B,gBAAgBgC,sBAAe,CAACJ,QAAQ;QAClDC,QAAQ7B,gBAAgBgC,sBAAe,CAACH,MAAM;QAC9CC,KAAK9B,gBAAgBgC,sBAAe,CAACF,GAAG;QACxCC,QAAQ/B,gBAAgBgC,sBAAe,CAACD,MAAM;QAC9CjE;QACAL;QACAC,UAAUC,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAeD;QAC5EuE,gBAAgB,CAACtE;IACrB;AACJ"}
@@ -57,5 +57,19 @@ const useToasterStyles_unstable = (state)=>{
57
57
  (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
58
58
  Object.assign(state.topEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topEnd, state.dir, state.offset));
59
59
  }
60
+ if (state.top) {
61
+ var _state_top;
62
+ state.top.className = className;
63
+ var _style4;
64
+ (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};
65
+ Object.assign(state.top.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.top, state.dir, state.offset));
66
+ }
67
+ if (state.bottom) {
68
+ var _state_bottom;
69
+ state.bottom.className = className;
70
+ var _style5;
71
+ (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};
72
+ Object.assign(state.bottom.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottom, state.dir, state.offset));
73
+ }
60
74
  return state;
61
75
  }; //# sourceMappingURL=useToasterStyles.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses","bottomStart","_state_bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3"],"mappings":";;;;;;;;;;;IAEaA,iBAAiB;eAAjBA;;IAUAC,yBAAyB;eAAzBA;;;uBAZ+B;uBACO;AAC5C,MAAMD,oBAAoB;IAC/BE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAA4D;AAI/H,MAAMH,4BAA4BI,CAAAA;IACvC,MAAMC,oBAAoBH;IAC1B,MAAMI,YAAYC,IAAAA,mBAAY,EAACR,kBAAkBE,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IAC9F,IAAIF,MAAMI,WAAW,EAAE;QACrB,IAAIC;QACJL,MAAMI,WAAW,CAACF,SAAS,GAAGA;QAC9B,IAAII;QACHA,CAAAA,SAAS,AAACD,CAAAA,qBAAqBL,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Gb,KAAK,AAAD,MAAO,QAAQe,YAAY,KAAK,IAAIA,UAAUD,cAAcd,KAAK,GAAG,CAAC;QACnHC,OAAOC,MAAM,CAACT,MAAMoB,MAAM,CAACb,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACS,MAAM,EAAEpB,MAAMY,GAAG,EAAEZ,MAAMa,MAAM;IACrG;IACA,OAAOb;AACT,GACA,mDAAmD"}
1
+ {"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["import { __resetStyles, mergeClasses } from '@griffel/react';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\nexport const toasterClassNames = {\n root: 'fui-Toaster'\n};\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r3hfdjz\", null, [\".r3hfdjz{position:fixed;width:292px;pointer-events:none;}\"]);\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = state => {\n const rootBaseClassName = useRootBaseClassName();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n state.bottomStart.className = className;\n var _style;\n (_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n if (state.bottomEnd) {\n var _state_bottomEnd;\n state.bottomEnd.className = className;\n var _style1;\n (_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n if (state.topStart) {\n var _state_topStart;\n state.topStart.className = className;\n var _style2;\n (_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n if (state.topEnd) {\n var _state_topEnd;\n state.topEnd.className = className;\n var _style3;\n (_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n if (state.top) {\n var _state_top;\n state.top.className = className;\n var _style4;\n (_style4 = (_state_top = state.top).style) !== null && _style4 !== void 0 ? _style4 : _state_top.style = {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n if (state.bottom) {\n var _state_bottom;\n state.bottom.className = className;\n var _style5;\n (_style5 = (_state_bottom = state.bottom).style) !== null && _style5 !== void 0 ? _style5 : _state_bottom.style = {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n return state;\n};\n//# sourceMappingURL=useToasterStyles.styles.js.map"],"names":["toasterClassNames","useToasterStyles_unstable","root","useRootBaseClassName","__resetStyles","state","rootBaseClassName","className","mergeClasses","bottomStart","_state_bottomStart","_style","style","Object","assign","getPositionStyles","TOAST_POSITIONS","dir","offset","bottomEnd","_state_bottomEnd","_style1","topStart","_state_topStart","_style2","topEnd","_state_topEnd","_style3","top","_state_top","_style4","bottom","_state_bottom","_style5"],"mappings":";;;;;;;;;;;IAEaA,iBAAiB;eAAjBA;;IAUAC,yBAAyB;eAAzBA;;;uBAZ+B;uBACO;AAC5C,MAAMD,oBAAoB;IAC/BE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAA4D;AAI/H,MAAMH,4BAA4BI,CAAAA;IACvC,MAAMC,oBAAoBH;IAC1B,MAAMI,YAAYC,IAAAA,mBAAY,EAACR,kBAAkBE,IAAI,EAAEI,mBAAmBD,MAAMH,IAAI,CAACK,SAAS;IAC9F,IAAIF,MAAMI,WAAW,EAAE;QACrB,IAAI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
27
  const TOAST_POSITIONS = {
28
+ bottom: 'bottom',
28
29
  bottomEnd: 'bottom-end',
29
30
  bottomStart: 'bottom-start',
31
+ top: 'top',
30
32
  topEnd: 'top-end',
31
33
  topStart: 'top-start'
32
34
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["constants.js"],"sourcesContent":["export const EVENTS = {\n show: 'fui-toast-show',\n dismiss: 'fui-toast-dismiss',\n dismissAll: 'fui-toast-dismiss-all',\n update: 'fui-toast-update',\n pause: 'fui-toast-pause',\n play: 'fui-toast-play'\n};\nexport const TOAST_POSITIONS = {\n bottomEnd: 'bottom-end',\n bottomStart: 'bottom-start',\n topEnd: 'top-end',\n topStart: 'top-start'\n};\n"],"names":["EVENTS","TOAST_POSITIONS","show","dismiss","dismissAll","update","pause","play","bottomEnd","bottomStart","topEnd","topStart"],"mappings":";;;;;;;;;;;IAAaA,MAAM;eAANA;;IAQAC,eAAe;eAAfA;;;AARN,MAAMD,SAAS;IAClBE,MAAM;IACNC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,OAAO;IACPC,MAAM;AACV;AACO,MAAMN,kBAAkB;IAC3BO,WAAW;IACXC,aAAa;IACbC,QAAQ;IACRC,UAAU;AACd"}
1
+ {"version":3,"sources":["constants.js"],"sourcesContent":["export const EVENTS = {\n show: 'fui-toast-show',\n dismiss: 'fui-toast-dismiss',\n dismissAll: 'fui-toast-dismiss-all',\n update: 'fui-toast-update',\n pause: 'fui-toast-pause',\n play: 'fui-toast-play'\n};\nexport const TOAST_POSITIONS = {\n bottom: 'bottom',\n bottomEnd: 'bottom-end',\n bottomStart: 'bottom-start',\n top: 'top',\n topEnd: 'top-end',\n topStart: 'top-start'\n};\n"],"names":["EVENTS","TOAST_POSITIONS","show","dismiss","dismissAll","update","pause","play","bottom","bottomEnd","bottomStart","top","topEnd","topStart"],"mappings":";;;;;;;;;;;IAAaA,MAAM;eAANA;;IAQAC,eAAe;eAAfA;;;AARN,MAAMD,SAAS;IAClBE,MAAM;IACNC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,OAAO;IACPC,MAAM;AACV;AACO,MAAMN,kBAAkB;IAC3BO,QAAQ;IACRC,WAAW;IACXC,aAAa;IACbC,KAAK;IACLC,QAAQ;IACRC,UAAU;AACd"}
@@ -18,6 +18,20 @@ const getPositionStyles = (position, dir, offset)=>{
18
18
  const start = dir === 'ltr' ? 'left' : 'right';
19
19
  const end = dir === 'ltr' ? 'right' : 'left';
20
20
  switch(position){
21
+ case 'top':
22
+ Object.assign(positionStyles, {
23
+ top: vertical,
24
+ left: `calc(50% + ${horizontal}px)`,
25
+ transform: 'translateX(-50%)'
26
+ });
27
+ break;
28
+ case 'bottom':
29
+ Object.assign(positionStyles, {
30
+ bottom: vertical,
31
+ left: `calc(50% + ${horizontal}px)`,
32
+ transform: 'translateX(-50%)'
33
+ });
34
+ break;
21
35
  case 'top-start':
22
36
  Object.assign(positionStyles, {
23
37
  top: vertical,
@@ -1 +1 @@
1
- {"version":3,"sources":["getPositionStyles.js"],"sourcesContent":["export const getPositionStyles = (position, dir, offset)=>{\n const positionStyles = {\n position: 'fixed'\n };\n var _offset_position;\n const offsetStyles = offset ? isShorthandOffset(offset) ? offset : (_offset_position = offset[position]) !== null && _offset_position !== void 0 ? _offset_position : {} : {};\n const { horizontal = 20, vertical = 16 } = offsetStyles;\n const start = dir === 'ltr' ? 'left' : 'right';\n const end = dir === 'ltr' ? 'right' : 'left';\n switch(position){\n case 'top-start':\n Object.assign(positionStyles, {\n top: vertical,\n [start]: horizontal\n });\n break;\n case 'top-end':\n Object.assign(positionStyles, {\n top: vertical,\n [end]: horizontal\n });\n break;\n case 'bottom-start':\n Object.assign(positionStyles, {\n bottom: vertical,\n [start]: horizontal\n });\n break;\n case 'bottom-end':\n Object.assign(positionStyles, {\n bottom: vertical,\n [end]: horizontal\n });\n break;\n }\n return positionStyles;\n};\nfunction isShorthandOffset(offset) {\n return 'horizontal' in offset || 'vertical' in offset;\n}\n"],"names":["getPositionStyles","position","dir","offset","positionStyles","_offset_position","offsetStyles","isShorthandOffset","horizontal","vertical","start","end","Object","assign","top","bottom"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,oBAAoB,CAACC,UAAUC,KAAKC;IAC7C,MAAMC,iBAAiB;QACnBH,UAAU;IACd;IACA,IAAII;IACJ,MAAMC,eAAeH,SAASI,kBAAkBJ,UAAUA,SAAS,AAACE,CAAAA,mBAAmBF,MAAM,CAACF,SAAS,AAAD,MAAO,QAAQI,qBAAqB,KAAK,IAAIA,mBAAmB,CAAC,IAAI,CAAC;IAC5K,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAE,GAAGH;IAC3C,MAAMI,QAAQR,QAAQ,QAAQ,SAAS;IACvC,MAAMS,MAAMT,QAAQ,QAAQ,UAAU;IACtC,OAAOD;QACH,KAAK;YACDW,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BU,KAAKL;gBACL,CAACC,MAAM,EAAEF;YACb;YACA;QACJ,KAAK;YACDI,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BU,KAAKL;gBACL,CAACE,IAAI,EAAEH;YACX;YACA;QACJ,KAAK;YACDI,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BW,QAAQN;gBACR,CAACC,MAAM,EAAEF;YACb;YACA;QACJ,KAAK;YACDI,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BW,QAAQN;gBACR,CAACE,IAAI,EAAEH;YACX;YACA;IACR;IACA,OAAOJ;AACX;AACA,SAASG,kBAAkBJ,MAAM;IAC7B,OAAO,gBAAgBA,UAAU,cAAcA;AACnD"}
1
+ {"version":3,"sources":["getPositionStyles.js"],"sourcesContent":["export const getPositionStyles = (position, dir, offset)=>{\n const positionStyles = {\n position: 'fixed'\n };\n var _offset_position;\n const offsetStyles = offset ? isShorthandOffset(offset) ? offset : (_offset_position = offset[position]) !== null && _offset_position !== void 0 ? _offset_position : {} : {};\n const { horizontal = 20, vertical = 16 } = offsetStyles;\n const start = dir === 'ltr' ? 'left' : 'right';\n const end = dir === 'ltr' ? 'right' : 'left';\n switch(position){\n case 'top':\n Object.assign(positionStyles, {\n top: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)'\n });\n break;\n case 'bottom':\n Object.assign(positionStyles, {\n bottom: vertical,\n left: `calc(50% + ${horizontal}px)`,\n transform: 'translateX(-50%)'\n });\n break;\n case 'top-start':\n Object.assign(positionStyles, {\n top: vertical,\n [start]: horizontal\n });\n break;\n case 'top-end':\n Object.assign(positionStyles, {\n top: vertical,\n [end]: horizontal\n });\n break;\n case 'bottom-start':\n Object.assign(positionStyles, {\n bottom: vertical,\n [start]: horizontal\n });\n break;\n case 'bottom-end':\n Object.assign(positionStyles, {\n bottom: vertical,\n [end]: horizontal\n });\n break;\n }\n return positionStyles;\n};\nfunction isShorthandOffset(offset) {\n return 'horizontal' in offset || 'vertical' in offset;\n}\n"],"names":["getPositionStyles","position","dir","offset","positionStyles","_offset_position","offsetStyles","isShorthandOffset","horizontal","vertical","start","end","Object","assign","top","left","transform","bottom"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,oBAAoB,CAACC,UAAUC,KAAKC;IAC7C,MAAMC,iBAAiB;QACnBH,UAAU;IACd;IACA,IAAII;IACJ,MAAMC,eAAeH,SAASI,kBAAkBJ,UAAUA,SAAS,AAACE,CAAAA,mBAAmBF,MAAM,CAACF,SAAS,AAAD,MAAO,QAAQI,qBAAqB,KAAK,IAAIA,mBAAmB,CAAC,IAAI,CAAC;IAC5K,MAAM,EAAEG,aAAa,EAAE,EAAEC,WAAW,EAAE,EAAE,GAAGH;IAC3C,MAAMI,QAAQR,QAAQ,QAAQ,SAAS;IACvC,MAAMS,MAAMT,QAAQ,QAAQ,UAAU;IACtC,OAAOD;QACH,KAAK;YACDW,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BU,KAAKL;gBACLM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACf;YACA;QACJ,KAAK;YACDJ,OAAOC,MAAM,CAACT,gBAAgB;gBAC1Ba,QAAQR;gBACRM,MAAM,CAAC,WAAW,EAAEP,WAAW,GAAG,CAAC;gBACnCQ,WAAW;YACf;YACA;QACJ,KAAK;YACDJ,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BU,KAAKL;gBACL,CAACC,MAAM,EAAEF;YACb;YACA;QACJ,KAAK;YACDI,OAAOC,MAAM,CAACT,gBAAgB;gBAC1BU,KAAKL;gBACL,CAACE,IAAI,EAAEH;YACX;YACA;QACJ,KAAK;YACDI,OAAOC,MAAM,CAACT,gBAAgB;gBAC1Ba,QAAQR;gBACR,CAACC,MAAM,EAAEF;YACb;YACA;QACJ,KAAK;YACDI,OAAOC,MAAM,CAACT,gBAAgB;gBAC1Ba,QAAQR;gBACR,CAACE,IAAI,EAAEH;YACX;YACA;IACR;IACA,OAAOJ;AACX;AACA,SAASG,kBAAkBJ,MAAM;IAC7B,OAAO,gBAAgBA,UAAU,cAAcA;AACnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-toast",
3
- "version": "0.0.0-nightly-20230905-0414.1",
3
+ "version": "0.0.0-nightly-20230907-0414.1",
4
4
  "description": "Toast component for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -29,22 +29,22 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@fluentui/eslint-plugin": "*",
32
- "@fluentui/react-conformance": "0.0.0-nightly-20230905-0414.1",
33
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230905-0414.1",
32
+ "@fluentui/react-conformance": "0.0.0-nightly-20230907-0414.1",
33
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230907-0414.1",
34
34
  "@fluentui/scripts-api-extractor": "*",
35
35
  "@fluentui/scripts-tasks": "*"
36
36
  },
37
37
  "dependencies": {
38
38
  "react-transition-group": "^4.4.1",
39
- "@fluentui/keyboard-keys": "0.0.0-nightly-20230905-0414.1",
40
- "@fluentui/react-aria": "0.0.0-nightly-20230905-0414.1",
39
+ "@fluentui/keyboard-keys": "0.0.0-nightly-20230907-0414.1",
40
+ "@fluentui/react-aria": "0.0.0-nightly-20230907-0414.1",
41
41
  "@fluentui/react-icons": "^2.0.207",
42
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230905-0414.1",
43
- "@fluentui/react-portal": "0.0.0-nightly-20230905-0414.1",
44
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230905-0414.1",
45
- "@fluentui/react-tabster": "0.0.0-nightly-20230905-0414.1",
46
- "@fluentui/react-theme": "0.0.0-nightly-20230905-0414.1",
47
- "@fluentui/react-utilities": "0.0.0-nightly-20230905-0414.1",
42
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230907-0414.1",
43
+ "@fluentui/react-portal": "0.0.0-nightly-20230907-0414.1",
44
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230907-0414.1",
45
+ "@fluentui/react-tabster": "0.0.0-nightly-20230907-0414.1",
46
+ "@fluentui/react-theme": "0.0.0-nightly-20230907-0414.1",
47
+ "@fluentui/react-utilities": "0.0.0-nightly-20230907-0414.1",
48
48
  "@griffel/react": "^1.5.14",
49
49
  "@swc/helpers": "^0.5.1"
50
50
  },