@fluentui/react-toast 9.0.4 → 9.0.6
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 +55 -1
- package/CHANGELOG.md +24 -2
- package/lib/components/ToastTrigger/useToastTrigger.js +1 -1
- package/lib/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib/components/Toaster/useToasterStyles.styles.js +4 -1
- package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js +1 -1
- package/lib-commonjs/components/ToastTrigger/useToastTrigger.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +4 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,61 @@
|
|
|
2
2
|
"name": "@fluentui/react-toast",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 01 Aug 2023 10:14:29 GMT",
|
|
6
|
+
"tag": "@fluentui/react-toast_v9.0.6",
|
|
7
|
+
"version": "9.0.6",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-toast",
|
|
13
|
+
"comment": "Bump @fluentui/react-portal to v9.3.4",
|
|
14
|
+
"commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-toast",
|
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.7.0",
|
|
20
|
+
"commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-toast",
|
|
25
|
+
"comment": "Bump @fluentui/react-tabster to v9.11.1",
|
|
26
|
+
"commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"date": "Tue, 25 Jul 2023 13:29:22 GMT",
|
|
33
|
+
"tag": "@fluentui/react-toast_v9.0.5",
|
|
34
|
+
"version": "9.0.5",
|
|
35
|
+
"comments": {
|
|
36
|
+
"patch": [
|
|
37
|
+
{
|
|
38
|
+
"author": "ololubek@microsoft.com",
|
|
39
|
+
"package": "@fluentui/react-toast",
|
|
40
|
+
"commit": "1082207b08959996cd736725735cadc01d0849b0",
|
|
41
|
+
"comment": "chore: Update react-icons version to pick up fowardref change."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@fluentui/react-toast",
|
|
46
|
+
"comment": "Bump @fluentui/react-portal to v9.3.3",
|
|
47
|
+
"commit": "e59b4b305eb656c5af005fefbfa2b1f69afcdc43"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@fluentui/react-toast",
|
|
52
|
+
"comment": "Bump @fluentui/react-tabster to v9.11.0",
|
|
53
|
+
"commit": "e59b4b305eb656c5af005fefbfa2b1f69afcdc43"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "Thu, 20 Jul 2023 18:27:35 GMT",
|
|
6
60
|
"tag": "@fluentui/react-toast_v9.0.4",
|
|
7
61
|
"version": "9.0.4",
|
|
8
62
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-toast
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 01 Aug 2023 10:14:29 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.0.6)
|
|
8
|
+
|
|
9
|
+
Tue, 01 Aug 2023 10:14:29 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.0.5..@fluentui/react-toast_v9.0.6)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-portal to v9.3.4 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
|
|
15
|
+
- Bump @fluentui/react-shared-contexts to v9.7.0 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
|
|
16
|
+
- Bump @fluentui/react-tabster to v9.11.1 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
|
|
17
|
+
|
|
18
|
+
## [9.0.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.0.5)
|
|
19
|
+
|
|
20
|
+
Tue, 25 Jul 2023 13:29:22 GMT
|
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.0.4..@fluentui/react-toast_v9.0.5)
|
|
22
|
+
|
|
23
|
+
### Patches
|
|
24
|
+
|
|
25
|
+
- chore: Update react-icons version to pick up fowardref change. ([PR #28590](https://github.com/microsoft/fluentui/pull/28590) by ololubek@microsoft.com)
|
|
26
|
+
- Bump @fluentui/react-portal to v9.3.3 ([PR #28622](https://github.com/microsoft/fluentui/pull/28622) by beachball)
|
|
27
|
+
- Bump @fluentui/react-tabster to v9.11.0 ([PR #28622](https://github.com/microsoft/fluentui/pull/28622) by beachball)
|
|
28
|
+
|
|
7
29
|
## [9.0.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-toast_v9.0.4)
|
|
8
30
|
|
|
9
|
-
Thu, 20 Jul 2023 18:
|
|
31
|
+
Thu, 20 Jul 2023 18:27:35 GMT
|
|
10
32
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toast_v9.0.3..@fluentui/react-toast_v9.0.4)
|
|
11
33
|
|
|
12
34
|
### Patches
|
|
@@ -16,7 +16,7 @@ import { useToastContainerContext } from '../../contexts/toastContainerContext';
|
|
|
16
16
|
const child = getTriggerChild(children);
|
|
17
17
|
const handleClick = useEventCallback((e)=>{
|
|
18
18
|
var _child_props, _child_props_onClick;
|
|
19
|
-
(_child_props_onClick =
|
|
19
|
+
(_child_props_onClick = _child_props = child === null || child === void 0 ? void 0 : child.props.onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);
|
|
20
20
|
if (!e.isDefaultPrevented()) {
|
|
21
21
|
close();
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport type { ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */\nexport const useToastTrigger_unstable = (props: ToastTriggerProps): ToastTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const { close } = useToastContainerContext();\n\n const child = getTriggerChild(children);\n\n const handleClick = useEventCallback(\n (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: child?.ref,\n onClick: handleClick,\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","useEventCallback","useARIAButtonProps","useToastContainerContext","useToastTrigger_unstable","props","children","disableButtonEnhancement","close","child","handleClick","e","onClick","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","type"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,4BAA4B;AAC3G,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,SAASC,wBAAwB,QAAQ,uCAAuC;AAEhF;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,QAAgD;IACvF,MAAM,EAAEC,SAAQ,EAAEC,0BAA2B,KAAK,CAAA,EAAE,GAAGF;IACvD,MAAM,EAAEG,MAAK,EAAE,GAAGL;IAElB,MAAMM,QAAQT,gBAAgBM;IAE9B,MAAMI,cAAcT,iBAClB,CAACU,IAAgF;YAC/EF,cAAAA;QAAAA,CAAAA,uBAAAA,
|
|
1
|
+
{"version":3,"sources":["useToastTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport type { ToastTriggerProps, ToastTriggerState } from './ToastTrigger.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */\nexport const useToastTrigger_unstable = (props: ToastTriggerProps): ToastTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n const { close } = useToastContainerContext();\n\n const child = getTriggerChild(children);\n\n const handleClick = useEventCallback(\n (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n child?.props.onClick?.(e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n },\n );\n\n const triggerChildProps = {\n ...child?.props,\n ref: child?.ref,\n onClick: handleClick,\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n {\n ...triggerChildProps,\n type: 'button',\n },\n );\n\n return {\n children: applyTriggerPropsToChildren(\n children,\n disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n"],"names":["React","applyTriggerPropsToChildren","getTriggerChild","useEventCallback","useARIAButtonProps","useToastContainerContext","useToastTrigger_unstable","props","children","disableButtonEnhancement","close","child","handleClick","e","onClick","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","type"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,4BAA4B;AAC3G,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,SAASC,wBAAwB,QAAQ,uCAAuC;AAEhF;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,QAAgD;IACvF,MAAM,EAAEC,SAAQ,EAAEC,0BAA2B,KAAK,CAAA,EAAE,GAAGF;IACvD,MAAM,EAAEG,MAAK,EAAE,GAAGL;IAElB,MAAMM,QAAQT,gBAAgBM;IAE9B,MAAMI,cAAcT,iBAClB,CAACU,IAAgF;YAC/EF,cAAAA;QAAAA,CAAAA,uBAAAA,eAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOJ,KAAK,CAACO,OAAO,cAApBH,kCAAAA,KAAAA,IAAAA,qBAAAA,KAAAA,cAAuBE;QACvB,IAAI,CAACA,EAAEE,kBAAkB,IAAI;YAC3BL;QACF,CAAC;IACH;IAGF,MAAMM,oBAAoB;QACxB,GAAGL,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOJ,KAAK;QACfU,KAAKN,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOM,GAAG;QACfH,SAASF;IACX;IAEA,MAAMM,8BAA8Bd,mBAClCO,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAD,MAAM,YAAYR,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOQ,IAAI,AAAD,MAAM,MAAMR,MAAMQ,IAAI,GAAG,KAAK,EACpE;QACE,GAAGH,iBAAiB;QACpBG,MAAM;IACR;IAGF,OAAO;QACLX,UAAUP,4BACRO,UACAC,2BAA2BO,oBAAoBE,2BAA2B;IAE9E;AACF,EAAE"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _state_bottomStart, _state_bottomEnd, _state_topStart, _state_topEnd;
|
|
2
1
|
import { __resetStyles, mergeClasses } from '@griffel/react';
|
|
3
2
|
import { TOAST_POSITIONS, getPositionStyles } from '../../state/index';
|
|
4
3
|
export const toasterClassNames = {
|
|
@@ -15,24 +14,28 @@ export const useToasterStyles_unstable = state => {
|
|
|
15
14
|
const rootBaseClassName = useRootBaseClassName();
|
|
16
15
|
const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.root.className);
|
|
17
16
|
if (state.bottomStart) {
|
|
17
|
+
var _state_bottomStart;
|
|
18
18
|
state.bottomStart.className = className;
|
|
19
19
|
var _style;
|
|
20
20
|
(_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};
|
|
21
21
|
Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));
|
|
22
22
|
}
|
|
23
23
|
if (state.bottomEnd) {
|
|
24
|
+
var _state_bottomEnd;
|
|
24
25
|
state.bottomEnd.className = className;
|
|
25
26
|
var _style1;
|
|
26
27
|
(_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};
|
|
27
28
|
Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));
|
|
28
29
|
}
|
|
29
30
|
if (state.topStart) {
|
|
31
|
+
var _state_topStart;
|
|
30
32
|
state.topStart.className = className;
|
|
31
33
|
var _style2;
|
|
32
34
|
(_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};
|
|
33
35
|
Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));
|
|
34
36
|
}
|
|
35
37
|
if (state.topEnd) {
|
|
38
|
+
var _state_topEnd;
|
|
36
39
|
state.topEnd.className = className;
|
|
37
40
|
var _style3;
|
|
38
41
|
(_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
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,EAA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AK,CAAC,GAAGA,OAAO,GAAGD,eAAe,CAACT,KAAK,GAAG,CAAC,CAAC;IAC1HC,MAAM,CAACC,MAAM,CAACR,KAAK,CAACc,QAAQ,CAACR,KAAK,EAAEX,iBAAiB,CAACD,eAAe,CAACoB,QAAQ,EAAEd,KAAK,CAACS,GAAG,EAAET,KAAK,CAACU,MAAM,CAAC,CAAC;EAC7G;EACA,IAAIV,KAAK,CAACiB,MAAM,EAAE;IACd,IAAIC,aAAa;IACjBlB,KAAK,CAACiB,MAAM,CAACf,SAAS,GAAGA,SAAS;IAClC,IAAIiB,OAAO;IACX,CAACA,OAAO,GAAG,CAACD,aAAa,GAAGlB,KAAK,CAACiB,MAAM,EAAEX,KAAK,MAAM,IAAI,IAAIa,OAAO,KAAK,KAAK,CAAC,GAAGA,OAAO,GAAGD,aAAa,CAACZ,KAAK,GAAG,CAAC,CAAC;IACpHC,MAAM,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"}
|
|
@@ -17,7 +17,7 @@ const useToastTrigger_unstable = (props)=>{
|
|
|
17
17
|
const child = (0, _reactUtilities.getTriggerChild)(children);
|
|
18
18
|
const handleClick = (0, _reactUtilities.useEventCallback)((e)=>{
|
|
19
19
|
var _child_props, _child_props_onClick;
|
|
20
|
-
(_child_props_onClick =
|
|
20
|
+
(_child_props_onClick = _child_props = child === null || child === void 0 ? void 0 : child.props.onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);
|
|
21
21
|
if (!e.isDefaultPrevented()) {
|
|
22
22
|
close();
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */ export const useToastTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const { close } = useToastContainerContext();\n const child = getTriggerChild(children);\n const handleClick = useEventCallback((e)=>{\n var _child_props, _child_props_onClick;\n (_child_props_onClick =
|
|
1
|
+
{"version":3,"sources":["useToastTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { applyTriggerPropsToChildren, getTriggerChild, useEventCallback } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n/**\n * A non-visual component that wraps its child\n * and configures them to be the trigger that will close a `Toast`.\n * This component should only accept one child.\n *\n * This component sole purpose is to avoid opting out of the internal controlled open state of a `Toast`\n * Besides being a trigger that closes a toast through context this component doesn't do much,\n * making it basically unnecessary in cases where the trigger is outside of a toast.\n */ export const useToastTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const { close } = useToastContainerContext();\n const child = getTriggerChild(children);\n const handleClick = useEventCallback((e)=>{\n var _child_props, _child_props_onClick;\n (_child_props_onClick = _child_props = child === null || child === void 0 ? void 0 : child.props.onClick) === null || _child_props_onClick === void 0 ? void 0 : _child_props_onClick.call(_child_props, e);\n if (!e.isDefaultPrevented()) {\n close();\n }\n });\n const triggerChildProps = {\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: child === null || child === void 0 ? void 0 : child.ref,\n onClick: handleClick\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', {\n ...triggerChildProps,\n type: 'button'\n });\n return {\n children: applyTriggerPropsToChildren(children, disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\n"],"names":["useToastTrigger_unstable","props","children","disableButtonEnhancement","close","useToastContainerContext","child","getTriggerChild","handleClick","useEventCallback","e","_child_props","_child_props_onClick","onClick","call","isDefaultPrevented","triggerChildProps","ref","ariaButtonTriggerChildProps","useARIAButtonProps","type","applyTriggerPropsToChildren"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACwD;2BAC5C;uCACM;AAS9B,MAAMA,2BAA2B,CAACC,QAAQ;IACjD,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAG,GAAGF;IACxD,MAAM,EAAEG,MAAK,EAAG,GAAGC,IAAAA,+CAAwB;IAC3C,MAAMC,QAAQC,IAAAA,+BAAe,EAACL;IAC9B,MAAMM,cAAcC,IAAAA,gCAAgB,EAAC,CAACC,IAAI;QACtC,IAAIC,cAAcC;QACjBA,CAAAA,uBAAuBD,eAAeL,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK,CAACY,OAAO,AAAD,MAAO,IAAI,IAAID,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBE,IAAI,CAACH,cAAcD,EAAE;QAC3M,IAAI,CAACA,EAAEK,kBAAkB,IAAI;YACzBX;QACJ,CAAC;IACL;IACA,MAAMY,oBAAoB;QACtB,GAAGV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAML,KAAK;QAC5DgB,KAAKX,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMW,GAAG;QAC5DJ,SAASL;IACb;IACA,MAAMU,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACb,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,YAAY,AAACd,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMc,IAAI,AAAD,MAAO,MAAMd,MAAMc,IAAI,GAAG,KAAK,EAAE;QACvN,GAAGJ,iBAAiB;QACpBI,MAAM;IACV;IACA,OAAO;QACHlB,UAAUmB,IAAAA,2CAA2B,EAACnB,UAAUC,2BAA2Ba,oBAAoBE,2BAA2B;IAC9H;AACJ"}
|
|
@@ -14,7 +14,6 @@ _export(exports, {
|
|
|
14
14
|
});
|
|
15
15
|
const _react = require("@griffel/react");
|
|
16
16
|
const _index = require("../../state/index");
|
|
17
|
-
var _state_bottomStart, _state_bottomEnd, _state_topStart, _state_topEnd;
|
|
18
17
|
const toasterClassNames = {
|
|
19
18
|
root: 'fui-Toaster'
|
|
20
19
|
};
|
|
@@ -27,24 +26,28 @@ const useToasterStyles_unstable = (state)=>{
|
|
|
27
26
|
const rootBaseClassName = useRootBaseClassName();
|
|
28
27
|
const className = (0, _react.mergeClasses)(toasterClassNames.root, rootBaseClassName, state.root.className);
|
|
29
28
|
if (state.bottomStart) {
|
|
29
|
+
var _state_bottomStart;
|
|
30
30
|
state.bottomStart.className = className;
|
|
31
31
|
var _style;
|
|
32
32
|
(_style = (_state_bottomStart = state.bottomStart).style) !== null && _style !== void 0 ? _style : _state_bottomStart.style = {};
|
|
33
33
|
Object.assign(state.bottomStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomStart, state.dir, state.offset));
|
|
34
34
|
}
|
|
35
35
|
if (state.bottomEnd) {
|
|
36
|
+
var _state_bottomEnd;
|
|
36
37
|
state.bottomEnd.className = className;
|
|
37
38
|
var _style1;
|
|
38
39
|
(_style1 = (_state_bottomEnd = state.bottomEnd).style) !== null && _style1 !== void 0 ? _style1 : _state_bottomEnd.style = {};
|
|
39
40
|
Object.assign(state.bottomEnd.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.bottomEnd, state.dir, state.offset));
|
|
40
41
|
}
|
|
41
42
|
if (state.topStart) {
|
|
43
|
+
var _state_topStart;
|
|
42
44
|
state.topStart.className = className;
|
|
43
45
|
var _style2;
|
|
44
46
|
(_style2 = (_state_topStart = state.topStart).style) !== null && _style2 !== void 0 ? _style2 : _state_topStart.style = {};
|
|
45
47
|
Object.assign(state.topStart.style, (0, _index.getPositionStyles)(_index.TOAST_POSITIONS.topStart, state.dir, state.offset));
|
|
46
48
|
}
|
|
47
49
|
if (state.topEnd) {
|
|
50
|
+
var _state_topEnd;
|
|
48
51
|
state.topEnd.className = className;
|
|
49
52
|
var _style3;
|
|
50
53
|
(_style3 = (_state_topEnd = state.topEnd).style) !== null && _style3 !== void 0 ? _style3 : _state_topEnd.style = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToasterStyles.styles.js"],"sourcesContent":["
|
|
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,MAAjBA;IAUAC,yBAAyB,MAAzBA;;uBAZ+B;uBACO;AAC5C,MAAMD,oBAAoB;IAC/BE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAA4D;AAI/H,MAAMH,4BAA4BI,CAAAA,QAAS;IAChD,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,SAA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B,IAAIoB;QACHA,CAAAA,UAAU,AAACD,CAAAA,gBAAgBrB,MAAMoB,MAAM,AAAD,EAAGb,KAAK,AAAD,MAAO,IAAI,IAAIe,YAAY,KAAK,IAAIA,UAAUD,cAAcd,KAAK,GAAG,CAAC,CAAC;QACpHC,OAAOC,MAAM,CAACT,MAAMoB,MAAM,CAACb,KAAK,EAAEG,IAAAA,wBAAiB,EAACC,sBAAe,CAACS,MAAM,EAAEpB,MAAMY,GAAG,EAAEZ,MAAMa,MAAM;IACrG,CAAC;IACD,OAAOb;AACT,GACA,mDAAmD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-toast",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.6",
|
|
4
4
|
"description": "Toast component for Fluent UI",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"react-transition-group": "^4.4.1",
|
|
39
39
|
"@fluentui/react-aria": "^9.3.27",
|
|
40
|
-
"@fluentui/react-icons": "^2.0.
|
|
40
|
+
"@fluentui/react-icons": "^2.0.207",
|
|
41
41
|
"@fluentui/react-jsx-runtime": "9.0.0-alpha.12",
|
|
42
|
-
"@fluentui/react-portal": "^9.3.
|
|
43
|
-
"@fluentui/react-shared-contexts": "^9.
|
|
44
|
-
"@fluentui/react-tabster": "^9.
|
|
42
|
+
"@fluentui/react-portal": "^9.3.4",
|
|
43
|
+
"@fluentui/react-shared-contexts": "^9.7.0",
|
|
44
|
+
"@fluentui/react-tabster": "^9.11.1",
|
|
45
45
|
"@fluentui/react-theme": "^9.1.9",
|
|
46
46
|
"@fluentui/react-utilities": "^9.10.1",
|
|
47
47
|
"@griffel/react": "^1.5.7",
|