@fluentui/react-alert 9.0.0-beta.81 → 9.0.0-beta.83

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,7 +2,91 @@
2
2
  "name": "@fluentui/react-alert",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 02 Oct 2023 08:53:05 GMT",
5
+ "date": "Thu, 05 Oct 2023 15:17:55 GMT",
6
+ "tag": "@fluentui/react-alert_v9.0.0-beta.83",
7
+ "version": "9.0.0-beta.83",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-alert",
13
+ "commit": "86dd76990e3da5af1f2b6b04a3aec46141d5a653",
14
+ "comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-alert",
19
+ "comment": "Bump @fluentui/react-avatar to v9.5.37",
20
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-alert",
25
+ "comment": "Bump @fluentui/react-button to v9.3.46",
26
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-alert",
31
+ "comment": "Bump @fluentui/react-tabster to v9.13.4",
32
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-alert",
37
+ "comment": "Bump @fluentui/react-utilities to v9.14.1",
38
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-alert",
43
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.14",
44
+ "commit": "690590449dc3d65cd40b2b06a990fd920180919d"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Wed, 04 Oct 2023 08:45:47 GMT",
51
+ "tag": "@fluentui/react-alert_v9.0.0-beta.82",
52
+ "version": "9.0.0-beta.82",
53
+ "comments": {
54
+ "prerelease": [
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-alert",
58
+ "comment": "Bump @fluentui/react-avatar to v9.5.36",
59
+ "commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-alert",
64
+ "comment": "Bump @fluentui/react-button to v9.3.45",
65
+ "commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-alert",
70
+ "comment": "Bump @fluentui/react-tabster to v9.13.3",
71
+ "commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-alert",
76
+ "comment": "Bump @fluentui/react-utilities to v9.14.0",
77
+ "commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-alert",
82
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.13",
83
+ "commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "date": "Mon, 02 Oct 2023 08:56:05 GMT",
6
90
  "tag": "@fluentui/react-alert_v9.0.0-beta.81",
7
91
  "version": "9.0.0-beta.81",
8
92
  "comments": {
@@ -11,19 +95,19 @@
11
95
  "author": "beachball",
12
96
  "package": "@fluentui/react-alert",
13
97
  "comment": "Bump @fluentui/react-avatar to v9.5.35",
14
- "commit": "18ddec93bdb85a009bc1392058c52b2ea336340e"
98
+ "commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
15
99
  },
16
100
  {
17
101
  "author": "beachball",
18
102
  "package": "@fluentui/react-alert",
19
103
  "comment": "Bump @fluentui/react-button to v9.3.44",
20
- "commit": "18ddec93bdb85a009bc1392058c52b2ea336340e"
104
+ "commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
21
105
  },
22
106
  {
23
107
  "author": "beachball",
24
108
  "package": "@fluentui/react-alert",
25
109
  "comment": "Bump @fluentui/react-tabster to v9.13.2",
26
- "commit": "18ddec93bdb85a009bc1392058c52b2ea336340e"
110
+ "commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
27
111
  }
28
112
  ]
29
113
  }
package/CHANGELOG.md CHANGED
@@ -1,19 +1,46 @@
1
1
  # Change Log - @fluentui/react-alert
2
2
 
3
- This log was last generated on Mon, 02 Oct 2023 08:53:05 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 Oct 2023 15:17:55 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-beta.83](https://github.com/microsoft/fluentui/tree/@fluentui/react-alert_v9.0.0-beta.83)
8
+
9
+ Thu, 05 Oct 2023 15:17:55 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-alert_v9.0.0-beta.82..@fluentui/react-alert_v9.0.0-beta.83)
11
+
12
+ ### Changes
13
+
14
+ - chore: migrate from getNativeElementProps to getIntrinsicElementProps ([PR #29387](https://github.com/microsoft/fluentui/pull/29387) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-avatar to v9.5.37 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
16
+ - Bump @fluentui/react-button to v9.3.46 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.13.4 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.14.1 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
19
+ - Bump @fluentui/react-jsx-runtime to v9.0.14 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
20
+
21
+ ## [9.0.0-beta.82](https://github.com/microsoft/fluentui/tree/@fluentui/react-alert_v9.0.0-beta.82)
22
+
23
+ Wed, 04 Oct 2023 08:45:47 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-alert_v9.0.0-beta.81..@fluentui/react-alert_v9.0.0-beta.82)
25
+
26
+ ### Changes
27
+
28
+ - Bump @fluentui/react-avatar to v9.5.36 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
29
+ - Bump @fluentui/react-button to v9.3.45 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
30
+ - Bump @fluentui/react-tabster to v9.13.3 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
31
+ - Bump @fluentui/react-utilities to v9.14.0 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
32
+ - Bump @fluentui/react-jsx-runtime to v9.0.13 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
33
+
7
34
  ## [9.0.0-beta.81](https://github.com/microsoft/fluentui/tree/@fluentui/react-alert_v9.0.0-beta.81)
8
35
 
9
- Mon, 02 Oct 2023 08:53:05 GMT
36
+ Mon, 02 Oct 2023 08:56:05 GMT
10
37
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-alert_v9.0.0-beta.80..@fluentui/react-alert_v9.0.0-beta.81)
11
38
 
12
39
  ### Changes
13
40
 
14
- - Bump @fluentui/react-avatar to v9.5.35 ([PR #29351](https://github.com/microsoft/fluentui/pull/29351) by beachball)
15
- - Bump @fluentui/react-button to v9.3.44 ([PR #29351](https://github.com/microsoft/fluentui/pull/29351) by beachball)
16
- - Bump @fluentui/react-tabster to v9.13.2 ([PR #29351](https://github.com/microsoft/fluentui/pull/29351) by beachball)
41
+ - Bump @fluentui/react-avatar to v9.5.35 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
42
+ - Bump @fluentui/react-button to v9.3.44 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
43
+ - Bump @fluentui/react-tabster to v9.13.2 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
17
44
 
18
45
  ## [9.0.0-beta.80](https://github.com/microsoft/fluentui/tree/@fluentui/react-alert_v9.0.0-beta.80)
19
46
 
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { Avatar } from '@fluentui/react-avatar';
3
3
  import { Button } from '@fluentui/react-button';
4
4
  import { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';
5
- import { getNativeElementProps, slot } from '@fluentui/react-utilities';
5
+ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
6
6
  /**
7
7
  * Create the state required to render Alert.
8
8
  *
@@ -62,8 +62,11 @@ import { getNativeElementProps, slot } from '@fluentui/react-utilities';
62
62
  },
63
63
  icon,
64
64
  intent,
65
- root: slot.always(getNativeElementProps('div', {
66
- ref,
65
+ root: slot.always(getIntrinsicElementProps('div', {
66
+ // FIXME:
67
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
68
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
69
+ ref: ref,
67
70
  role: defaultRole,
68
71
  children: props.children,
69
72
  ...props
@@ -1 +1 @@
1
- {"version":3,"sources":["useAlert.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { AlertProps, AlertState } from './Alert.types';\n\n/**\n * Create the state required to render Alert.\n *\n * The returned state can be modified with hooks such as useAlertStyles_unstable,\n * before being passed to renderAlert_unstable.\n *\n * @param props - props from this instance of Alert\n * @param ref - reference to root HTMLElement of Alert\n */\nexport const useAlert_unstable = (props: AlertProps, ref: React.Ref<HTMLElement>): AlertState => {\n const { appearance = 'primary', intent } = props;\n\n /** Determine the role and icon to render based on the intent */\n let defaultIcon;\n let defaultRole = 'status';\n switch (intent) {\n case 'success':\n defaultIcon = <CheckmarkCircleFilled />;\n break;\n case 'error':\n defaultIcon = <DismissCircleFilled />;\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = <WarningFilled />;\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = <InfoFilled />;\n break;\n }\n\n const action = slot.optional(props.action, { defaultProps: { appearance: 'transparent' }, elementType: Button });\n const avatar = slot.optional(props.avatar, { elementType: Avatar });\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {\n icon = slot.optional(props.icon, {\n defaultProps: { children: defaultIcon },\n renderByDefault: !!props.intent,\n elementType: 'span',\n });\n }\n return {\n action,\n appearance,\n avatar,\n components: { root: 'div', icon: 'span', action: Button, avatar: Avatar },\n icon,\n intent,\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n role: defaultRole,\n children: props.children,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","Avatar","Button","CheckmarkCircleFilled","DismissCircleFilled","InfoFilled","WarningFilled","getNativeElementProps","slot","useAlert_unstable","props","ref","appearance","intent","defaultIcon","defaultRole","action","optional","defaultProps","elementType","avatar","icon","children","renderByDefault","components","root","always","role"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB;AAC9G,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAIxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAE3C,8DAA8D,GAC9D,IAAII;IACJ,IAAIC,cAAc;IAClB,OAAQF;QACN,KAAK;YACHC,4BAAc,oBAACX;YACf;QACF,KAAK;YACHW,4BAAc,oBAACV;YACfW,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACR;YACfS,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACT;YACf;IACJ;IAEA,MAAMW,SAASR,KAAKS,QAAQ,CAACP,MAAMM,MAAM,EAAE;QAAEE,cAAc;YAAEN,YAAY;QAAc;QAAGO,aAAajB;IAAO;IAC9G,MAAMkB,SAASZ,KAAKS,QAAQ,CAACP,MAAMU,MAAM,EAAE;QAAED,aAAalB;IAAO;IACjE,IAAIoB;IACJ,8DAA8D,GAAG,IAAI,CAACD,QAAQ;QAC5EC,OAAOb,KAAKS,QAAQ,CAACP,MAAMW,IAAI,EAAE;YAC/BH,cAAc;gBAAEI,UAAUR;YAAY;YACtCS,iBAAiB,CAAC,CAACb,MAAMG,MAAM;YAC/BM,aAAa;QACf;IACF;IACA,OAAO;QACLH;QACAJ;QACAQ;QACAI,YAAY;YAAEC,MAAM;YAAOJ,MAAM;YAAQL,QAAQd;YAAQkB,QAAQnB;QAAO;QACxEoB;QACAR;QACAY,MAAMjB,KAAKkB,MAAM,CACfnB,sBAAsB,OAAO;YAC3BI;YACAgB,MAAMZ;YACNO,UAAUZ,MAAMY,QAAQ;YACxB,GAAGZ,KAAK;QACV,IACA;YAAES,aAAa;QAAM;IAEzB;AACF,EAAE"}
1
+ {"version":3,"sources":["useAlert.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n\nimport type { AlertProps, AlertState } from './Alert.types';\n\n/**\n * Create the state required to render Alert.\n *\n * The returned state can be modified with hooks such as useAlertStyles_unstable,\n * before being passed to renderAlert_unstable.\n *\n * @param props - props from this instance of Alert\n * @param ref - reference to root HTMLElement of Alert\n */\nexport const useAlert_unstable = (props: AlertProps, ref: React.Ref<HTMLElement>): AlertState => {\n const { appearance = 'primary', intent } = props;\n\n /** Determine the role and icon to render based on the intent */\n let defaultIcon;\n let defaultRole = 'status';\n switch (intent) {\n case 'success':\n defaultIcon = <CheckmarkCircleFilled />;\n break;\n case 'error':\n defaultIcon = <DismissCircleFilled />;\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = <WarningFilled />;\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = <InfoFilled />;\n break;\n }\n\n const action = slot.optional(props.action, { defaultProps: { appearance: 'transparent' }, elementType: Button });\n const avatar = slot.optional(props.avatar, { elementType: Avatar });\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {\n icon = slot.optional(props.icon, {\n defaultProps: { children: defaultIcon },\n renderByDefault: !!props.intent,\n elementType: 'span',\n });\n }\n return {\n action,\n appearance,\n avatar,\n components: { root: 'div', icon: 'span', action: Button, avatar: Avatar },\n icon,\n intent,\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n role: defaultRole,\n children: props.children,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","Avatar","Button","CheckmarkCircleFilled","DismissCircleFilled","InfoFilled","WarningFilled","getIntrinsicElementProps","slot","useAlert_unstable","props","ref","appearance","intent","defaultIcon","defaultRole","action","optional","defaultProps","elementType","avatar","icon","children","renderByDefault","components","root","always","role"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB;AAC9G,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAI3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAE3C,8DAA8D,GAC9D,IAAII;IACJ,IAAIC,cAAc;IAClB,OAAQF;QACN,KAAK;YACHC,4BAAc,oBAACX;YACf;QACF,KAAK;YACHW,4BAAc,oBAACV;YACfW,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACR;YACfS,cAAc;YACd;QACF,KAAK;YACHD,4BAAc,oBAACT;YACf;IACJ;IAEA,MAAMW,SAASR,KAAKS,QAAQ,CAACP,MAAMM,MAAM,EAAE;QAAEE,cAAc;YAAEN,YAAY;QAAc;QAAGO,aAAajB;IAAO;IAC9G,MAAMkB,SAASZ,KAAKS,QAAQ,CAACP,MAAMU,MAAM,EAAE;QAAED,aAAalB;IAAO;IACjE,IAAIoB;IACJ,8DAA8D,GAAG,IAAI,CAACD,QAAQ;QAC5EC,OAAOb,KAAKS,QAAQ,CAACP,MAAMW,IAAI,EAAE;YAC/BH,cAAc;gBAAEI,UAAUR;YAAY;YACtCS,iBAAiB,CAAC,CAACb,MAAMG,MAAM;YAC/BM,aAAa;QACf;IACF;IACA,OAAO;QACLH;QACAJ;QACAQ;QACAI,YAAY;YAAEC,MAAM;YAAOJ,MAAM;YAAQL,QAAQd;YAAQkB,QAAQnB;QAAO;QACxEoB;QACAR;QACAY,MAAMjB,KAAKkB,MAAM,CACfnB,yBAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FI,KAAKA;YACLgB,MAAMZ;YACNO,UAAUZ,MAAMY,QAAQ;YACxB,GAAGZ,KAAK;QACV,IACA;YAAES,aAAa;QAAM;IAEzB;AACF,EAAE"}
@@ -65,8 +65,11 @@ const useAlert_unstable = (props, ref)=>{
65
65
  },
66
66
  icon,
67
67
  intent,
68
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
69
- ref,
68
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
69
+ // FIXME:
70
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
71
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
72
+ ref: ref,
70
73
  role: defaultRole,
71
74
  children: props.children,
72
75
  ...props
@@ -1 +1 @@
1
- {"version":3,"sources":["useAlert.js"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render Alert.\n *\n * The returned state can be modified with hooks such as useAlertStyles_unstable,\n * before being passed to renderAlert_unstable.\n *\n * @param props - props from this instance of Alert\n * @param ref - reference to root HTMLElement of Alert\n */ export const useAlert_unstable = (props, ref)=>{\n const { appearance = 'primary', intent } = props;\n /** Determine the role and icon to render based on the intent */ let defaultIcon;\n let defaultRole = 'status';\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n const action = slot.optional(props.action, {\n defaultProps: {\n appearance: 'transparent'\n },\n elementType: Button\n });\n const avatar = slot.optional(props.avatar, {\n elementType: Avatar\n });\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {\n icon = slot.optional(props.icon, {\n defaultProps: {\n children: defaultIcon\n },\n renderByDefault: !!props.intent,\n elementType: 'span'\n });\n }\n return {\n action,\n appearance,\n avatar,\n components: {\n root: 'div',\n icon: 'span',\n action: Button,\n avatar: Avatar\n },\n icon,\n intent,\n root: slot.always(getNativeElementProps('div', {\n ref,\n role: defaultRole,\n children: props.children,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAlert_unstable","props","ref","appearance","intent","defaultIcon","defaultRole","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","slot","optional","defaultProps","elementType","Button","avatar","Avatar","icon","children","renderByDefault","components","root","always","getNativeElementProps","role"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;6BACA;6BACA;4BAC+D;gCAC1C;AASjC,MAAMA,oBAAoB,CAACC,OAAOC;IACzC,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC3C,8DAA8D,GAAG,IAAII;IACrE,IAAIC,cAAc;IAClB,OAAOF;QACH,KAAK;YACDC,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACC,iCAAqB,EAAE;YACvE;QACJ,KAAK;YACDJ,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACE,+BAAmB,EAAE;YACrEJ,cAAc;YACd;QACJ,KAAK;YACDD,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACG,yBAAa,EAAE;YAC/DL,cAAc;YACd;QACJ,KAAK;YACDD,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACI,sBAAU,EAAE;YAC5D;IACR;IACA,MAAMC,SAASC,oBAAI,CAACC,QAAQ,CAACd,MAAMY,MAAM,EAAE;QACvCG,cAAc;YACVb,YAAY;QAChB;QACAc,aAAaC,mBAAM;IACvB;IACA,MAAMC,SAASL,oBAAI,CAACC,QAAQ,CAACd,MAAMkB,MAAM,EAAE;QACvCF,aAAaG,mBAAM;IACvB;IACA,IAAIC;IACJ,8DAA8D,GAAG,IAAI,CAACF,QAAQ;QAC1EE,OAAOP,oBAAI,CAACC,QAAQ,CAACd,MAAMoB,IAAI,EAAE;YAC7BL,cAAc;gBACVM,UAAUjB;YACd;YACAkB,iBAAiB,CAAC,CAACtB,MAAMG,MAAM;YAC/Ba,aAAa;QACjB;IACJ;IACA,OAAO;QACHJ;QACAV;QACAgB;QACAK,YAAY;YACRC,MAAM;YACNJ,MAAM;YACNR,QAAQK,mBAAM;YACdC,QAAQC,mBAAM;QAClB;QACAC;QACAjB;QACAqB,MAAMX,oBAAI,CAACY,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CzB;YACA0B,MAAMtB;YACNgB,UAAUrB,MAAMqB,QAAQ;YACxB,GAAGrB,KAAK;QACZ,IAAI;YACAgB,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useAlert.js"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { Button } from '@fluentui/react-button';\nimport { CheckmarkCircleFilled, DismissCircleFilled, InfoFilled, WarningFilled } from '@fluentui/react-icons';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Create the state required to render Alert.\n *\n * The returned state can be modified with hooks such as useAlertStyles_unstable,\n * before being passed to renderAlert_unstable.\n *\n * @param props - props from this instance of Alert\n * @param ref - reference to root HTMLElement of Alert\n */ export const useAlert_unstable = (props, ref)=>{\n const { appearance = 'primary', intent } = props;\n /** Determine the role and icon to render based on the intent */ let defaultIcon;\n let defaultRole = 'status';\n switch(intent){\n case 'success':\n defaultIcon = /*#__PURE__*/ React.createElement(CheckmarkCircleFilled, null);\n break;\n case 'error':\n defaultIcon = /*#__PURE__*/ React.createElement(DismissCircleFilled, null);\n defaultRole = 'alert';\n break;\n case 'warning':\n defaultIcon = /*#__PURE__*/ React.createElement(WarningFilled, null);\n defaultRole = 'alert';\n break;\n case 'info':\n defaultIcon = /*#__PURE__*/ React.createElement(InfoFilled, null);\n break;\n }\n const action = slot.optional(props.action, {\n defaultProps: {\n appearance: 'transparent'\n },\n elementType: Button\n });\n const avatar = slot.optional(props.avatar, {\n elementType: Avatar\n });\n let icon;\n /** Avatar prop takes precedence over the icon or intent prop */ if (!avatar) {\n icon = slot.optional(props.icon, {\n defaultProps: {\n children: defaultIcon\n },\n renderByDefault: !!props.intent,\n elementType: 'span'\n });\n }\n return {\n action,\n appearance,\n avatar,\n components: {\n root: 'div',\n icon: 'span',\n action: Button,\n avatar: Avatar\n },\n icon,\n intent,\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n role: defaultRole,\n children: props.children,\n ...props\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useAlert_unstable","props","ref","appearance","intent","defaultIcon","defaultRole","React","createElement","CheckmarkCircleFilled","DismissCircleFilled","WarningFilled","InfoFilled","action","slot","optional","defaultProps","elementType","Button","avatar","Avatar","icon","children","renderByDefault","components","root","always","getIntrinsicElementProps","role"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;6BACA;6BACA;4BAC+D;gCACvC;AASpC,MAAMA,oBAAoB,CAACC,OAAOC;IACzC,MAAM,EAAEC,aAAa,SAAS,EAAEC,MAAM,EAAE,GAAGH;IAC3C,8DAA8D,GAAG,IAAII;IACrE,IAAIC,cAAc;IAClB,OAAOF;QACH,KAAK;YACDC,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACC,iCAAqB,EAAE;YACvE;QACJ,KAAK;YACDJ,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACE,+BAAmB,EAAE;YACrEJ,cAAc;YACd;QACJ,KAAK;YACDD,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACG,yBAAa,EAAE;YAC/DL,cAAc;YACd;QACJ,KAAK;YACDD,cAAc,WAAW,GAAGE,OAAMC,aAAa,CAACI,sBAAU,EAAE;YAC5D;IACR;IACA,MAAMC,SAASC,oBAAI,CAACC,QAAQ,CAACd,MAAMY,MAAM,EAAE;QACvCG,cAAc;YACVb,YAAY;QAChB;QACAc,aAAaC,mBAAM;IACvB;IACA,MAAMC,SAASL,oBAAI,CAACC,QAAQ,CAACd,MAAMkB,MAAM,EAAE;QACvCF,aAAaG,mBAAM;IACvB;IACA,IAAIC;IACJ,8DAA8D,GAAG,IAAI,CAACF,QAAQ;QAC1EE,OAAOP,oBAAI,CAACC,QAAQ,CAACd,MAAMoB,IAAI,EAAE;YAC7BL,cAAc;gBACVM,UAAUjB;YACd;YACAkB,iBAAiB,CAAC,CAACtB,MAAMG,MAAM;YAC/Ba,aAAa;QACjB;IACJ;IACA,OAAO;QACHJ;QACAV;QACAgB;QACAK,YAAY;YACRC,MAAM;YACNJ,MAAM;YACNR,QAAQK,mBAAM;YACdC,QAAQC,mBAAM;QAClB;QACAC;QACAjB;QACAqB,MAAMX,oBAAI,CAACY,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FzB,KAAKA;YACL0B,MAAMtB;YACNgB,UAAUrB,MAAMqB,QAAQ;YACxB,GAAGrB,KAAK;QACZ,IAAI;YACAgB,aAAa;QACjB;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-alert",
3
- "version": "9.0.0-beta.81",
3
+ "version": "9.0.0-beta.83",
4
4
  "description": "An alert component to display brief messages",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -33,13 +33,13 @@
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-avatar": "^9.5.35",
37
- "@fluentui/react-button": "^9.3.44",
36
+ "@fluentui/react-avatar": "^9.5.37",
37
+ "@fluentui/react-button": "^9.3.46",
38
38
  "@fluentui/react-icons": "^2.0.217",
39
- "@fluentui/react-tabster": "^9.13.2",
39
+ "@fluentui/react-tabster": "^9.13.4",
40
40
  "@fluentui/react-theme": "^9.1.14",
41
- "@fluentui/react-utilities": "^9.13.5",
42
- "@fluentui/react-jsx-runtime": "^9.0.12",
41
+ "@fluentui/react-utilities": "^9.14.1",
42
+ "@fluentui/react-jsx-runtime": "^9.0.14",
43
43
  "@griffel/react": "^1.5.14",
44
44
  "@swc/helpers": "^0.5.1"
45
45
  },