@fluentui/react-message-bar 0.0.0-nightly-20250114-0406.1 → 0.0.0-nightly-20250120-0408.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.md CHANGED
@@ -1,27 +1,27 @@
1
1
  # Change Log - @fluentui/react-message-bar
2
2
 
3
- This log was last generated on Tue, 14 Jan 2025 04:10:18 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 20 Jan 2025 04:12:56 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20250114-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-message-bar_v0.0.0-nightly-20250114-0406.1)
7
+ ## [0.0.0-nightly-20250120-0408.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-message-bar_v0.0.0-nightly-20250120-0408.1)
8
8
 
9
- Tue, 14 Jan 2025 04:10:18 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-message-bar_v9.3.0..@fluentui/react-message-bar_v0.0.0-nightly-20250114-0406.1)
9
+ Mon, 20 Jan 2025 04:12:56 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-message-bar_v9.3.0..@fluentui/react-message-bar_v0.0.0-nightly-20250120-0408.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/react-button to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
17
- - Bump @fluentui/react-motion to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
18
- - Bump @fluentui/react-motion-components-preview to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
19
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
20
- - Bump @fluentui/react-link to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
21
- - Bump @fluentui/react-theme to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
22
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
23
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
24
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20250114-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/749362121e3bd09c78e3fa87b766e7632338d027) by beachball)
15
+ - Bump @fluentui/react-button to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
17
+ - Bump @fluentui/react-motion to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
18
+ - Bump @fluentui/react-motion-components-preview to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
19
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
20
+ - Bump @fluentui/react-link to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
21
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
22
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
23
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
24
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20250120-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/a62055796cadd29a7713bf95763cb097626ce4f0) by beachball)
25
25
 
26
26
  ## [9.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-message-bar_v9.3.0)
27
27
 
@@ -18,7 +18,7 @@ import { useMessageBarTransitionContext } from '../../contexts/messageBarTransit
18
18
  const autoReflow = layout === 'auto';
19
19
  const { ref: reflowRef, reflowing } = useMessageBarReflow(autoReflow);
20
20
  const computedLayout = autoReflow ? reflowing ? 'multiline' : 'singleline' : layout;
21
- // eslint-disable-next-line deprecation/deprecation
21
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
22
22
  const { className: transitionClassName, nodeRef } = useMessageBarTransitionContext();
23
23
  const actionsRef = React.useRef(null);
24
24
  const bodyRef = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/MessageBar/useMessageBar.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-utilities';\nimport { useAnnounce } from '@fluentui/react-shared-contexts';\nimport type { MessageBarProps, MessageBarState } from './MessageBar.types';\nimport { getIntentIcon } from './getIntentIcon';\nimport { useMessageBarReflow } from './useMessageBarReflow';\nimport { useMessageBarTransitionContext } from '../../contexts/messageBarTransitionContext';\n\n/**\n * Create the state required to render MessageBar.\n *\n * The returned state can be modified with hooks such as useMessageBarStyles_unstable,\n * before being passed to renderMessageBar_unstable.\n *\n * @param props - props from this instance of MessageBar\n * @param ref - reference to root HTMLElement of MessageBar\n */\nexport const useMessageBar_unstable = (props: MessageBarProps, ref: React.Ref<HTMLDivElement>): MessageBarState => {\n const { layout = 'auto', intent = 'info', politeness, shape = 'rounded' } = props;\n const computedPoliteness = politeness ?? intent === 'info' ? 'polite' : 'assertive';\n const autoReflow = layout === 'auto';\n const { ref: reflowRef, reflowing } = useMessageBarReflow(autoReflow);\n const computedLayout = autoReflow ? (reflowing ? 'multiline' : 'singleline') : layout;\n // eslint-disable-next-line deprecation/deprecation\n const { className: transitionClassName, nodeRef } = useMessageBarTransitionContext();\n const actionsRef = React.useRef<HTMLDivElement | null>(null);\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n const { announce } = useAnnounce();\n const titleId = useId();\n\n React.useEffect(() => {\n const bodyMessage = bodyRef.current?.textContent;\n const actionsMessage = actionsRef.current?.textContent;\n\n const message = [bodyMessage, actionsMessage].filter(Boolean).join(',');\n announce(message, { polite: computedPoliteness === 'polite', alert: computedPoliteness === 'assertive' });\n }, [bodyRef, actionsRef, announce, computedPoliteness]);\n\n return {\n components: {\n root: 'div',\n icon: 'div',\n bottomReflowSpacer: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, reflowRef, nodeRef),\n role: 'group',\n 'aria-labelledby': titleId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n\n icon: slot.optional(props.icon, {\n renderByDefault: true,\n elementType: 'div',\n defaultProps: { children: getIntentIcon(intent) },\n }),\n bottomReflowSpacer: slot.optional(props.bottomReflowSpacer, {\n renderByDefault: computedLayout === 'multiline',\n elementType: 'div',\n }),\n layout: computedLayout,\n intent,\n transitionClassName,\n actionsRef,\n bodyRef,\n titleId,\n shape,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useId","useMergedRefs","useAnnounce","getIntentIcon","useMessageBarReflow","useMessageBarTransitionContext","useMessageBar_unstable","props","ref","layout","intent","politeness","shape","computedPoliteness","autoReflow","reflowRef","reflowing","computedLayout","className","transitionClassName","nodeRef","actionsRef","useRef","bodyRef","announce","titleId","useEffect","bodyMessage","current","textContent","actionsMessage","message","filter","Boolean","join","polite","alert","components","root","icon","bottomReflowSpacer","always","role","elementType","optional","renderByDefault","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,EAAEC,KAAK,EAAEC,aAAa,QAAQ,4BAA4B;AACjG,SAASC,WAAW,QAAQ,kCAAkC;AAE9D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,8BAA8B,QAAQ,6CAA6C;AAE5F;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,SAAS,MAAM,EAAEC,SAAS,MAAM,EAAEC,UAAU,EAAEC,QAAQ,SAAS,EAAE,GAAGL;IAC5E,MAAMM,qBAAqBF,CAAAA,uBAAAA,wBAAAA,aAAcD,WAAW,MAAK,IAAI,WAAW;IACxE,MAAMI,aAAaL,WAAW;IAC9B,MAAM,EAAED,KAAKO,SAAS,EAAEC,SAAS,EAAE,GAAGZ,oBAAoBU;IAC1D,MAAMG,iBAAiBH,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essageBar/useMessageBar.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-utilities';\nimport { useAnnounce } from '@fluentui/react-shared-contexts';\nimport type { MessageBarProps, MessageBarState } from './MessageBar.types';\nimport { getIntentIcon } from './getIntentIcon';\nimport { useMessageBarReflow } from './useMessageBarReflow';\nimport { useMessageBarTransitionContext } from '../../contexts/messageBarTransitionContext';\n\n/**\n * Create the state required to render MessageBar.\n *\n * The returned state can be modified with hooks such as useMessageBarStyles_unstable,\n * before being passed to renderMessageBar_unstable.\n *\n * @param props - props from this instance of MessageBar\n * @param ref - reference to root HTMLElement of MessageBar\n */\nexport const useMessageBar_unstable = (props: MessageBarProps, ref: React.Ref<HTMLDivElement>): MessageBarState => {\n const { layout = 'auto', intent = 'info', politeness, shape = 'rounded' } = props;\n const computedPoliteness = politeness ?? intent === 'info' ? 'polite' : 'assertive';\n const autoReflow = layout === 'auto';\n const { ref: reflowRef, reflowing } = useMessageBarReflow(autoReflow);\n const computedLayout = autoReflow ? (reflowing ? 'multiline' : 'singleline') : layout;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const { className: transitionClassName, nodeRef } = useMessageBarTransitionContext();\n const actionsRef = React.useRef<HTMLDivElement | null>(null);\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n const { announce } = useAnnounce();\n const titleId = useId();\n\n React.useEffect(() => {\n const bodyMessage = bodyRef.current?.textContent;\n const actionsMessage = actionsRef.current?.textContent;\n\n const message = [bodyMessage, actionsMessage].filter(Boolean).join(',');\n announce(message, { polite: computedPoliteness === 'polite', alert: computedPoliteness === 'assertive' });\n }, [bodyRef, actionsRef, announce, computedPoliteness]);\n\n return {\n components: {\n root: 'div',\n icon: 'div',\n bottomReflowSpacer: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, reflowRef, nodeRef),\n role: 'group',\n 'aria-labelledby': titleId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n\n icon: slot.optional(props.icon, {\n renderByDefault: true,\n elementType: 'div',\n defaultProps: { children: getIntentIcon(intent) },\n }),\n bottomReflowSpacer: slot.optional(props.bottomReflowSpacer, {\n renderByDefault: computedLayout === 'multiline',\n elementType: 'div',\n }),\n layout: computedLayout,\n intent,\n transitionClassName,\n actionsRef,\n bodyRef,\n titleId,\n shape,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useId","useMergedRefs","useAnnounce","getIntentIcon","useMessageBarReflow","useMessageBarTransitionContext","useMessageBar_unstable","props","ref","layout","intent","politeness","shape","computedPoliteness","autoReflow","reflowRef","reflowing","computedLayout","className","transitionClassName","nodeRef","actionsRef","useRef","bodyRef","announce","titleId","useEffect","bodyMessage","current","textContent","actionsMessage","message","filter","Boolean","join","polite","alert","components","root","icon","bottomReflowSpacer","always","role","elementType","optional","renderByDefault","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,EAAEC,KAAK,EAAEC,aAAa,QAAQ,4BAA4B;AACjG,SAASC,WAAW,QAAQ,kCAAkC;AAE9D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,8BAA8B,QAAQ,6CAA6C;AAE5F;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,SAAS,MAAM,EAAEC,SAAS,MAAM,EAAEC,UAAU,EAAEC,QAAQ,SAAS,EAAE,GAAGL;IAC5E,MAAMM,qBAAqBF,CAAAA,uBAAAA,wBAAAA,aAAcD,WAAW,MAAK,IAAI,WAAW;IACxE,MAAMI,aAAaL,WAAW;IAC9B,MAAM,EAAED,KAAKO,SAAS,EAAEC,SAAS,EAAE,GAAG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AACF,EAAE"}
@@ -21,7 +21,7 @@ const useMessageBar_unstable = (props, ref)=>{
21
21
  const autoReflow = layout === 'auto';
22
22
  const { ref: reflowRef, reflowing } = (0, _useMessageBarReflow.useMessageBarReflow)(autoReflow);
23
23
  const computedLayout = autoReflow ? reflowing ? 'multiline' : 'singleline' : layout;
24
- // eslint-disable-next-line deprecation/deprecation
24
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
25
25
  const { className: transitionClassName, nodeRef } = (0, _messageBarTransitionContext.useMessageBarTransitionContext)();
26
26
  const actionsRef = _react.useRef(null);
27
27
  const bodyRef = _react.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/MessageBar/useMessageBar.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-utilities';\nimport { useAnnounce } from '@fluentui/react-shared-contexts';\nimport type { MessageBarProps, MessageBarState } from './MessageBar.types';\nimport { getIntentIcon } from './getIntentIcon';\nimport { useMessageBarReflow } from './useMessageBarReflow';\nimport { useMessageBarTransitionContext } from '../../contexts/messageBarTransitionContext';\n\n/**\n * Create the state required to render MessageBar.\n *\n * The returned state can be modified with hooks such as useMessageBarStyles_unstable,\n * before being passed to renderMessageBar_unstable.\n *\n * @param props - props from this instance of MessageBar\n * @param ref - reference to root HTMLElement of MessageBar\n */\nexport const useMessageBar_unstable = (props: MessageBarProps, ref: React.Ref<HTMLDivElement>): MessageBarState => {\n const { layout = 'auto', intent = 'info', politeness, shape = 'rounded' } = props;\n const computedPoliteness = politeness ?? intent === 'info' ? 'polite' : 'assertive';\n const autoReflow = layout === 'auto';\n const { ref: reflowRef, reflowing } = useMessageBarReflow(autoReflow);\n const computedLayout = autoReflow ? (reflowing ? 'multiline' : 'singleline') : layout;\n // eslint-disable-next-line deprecation/deprecation\n const { className: transitionClassName, nodeRef } = useMessageBarTransitionContext();\n const actionsRef = React.useRef<HTMLDivElement | null>(null);\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n const { announce } = useAnnounce();\n const titleId = useId();\n\n React.useEffect(() => {\n const bodyMessage = bodyRef.current?.textContent;\n const actionsMessage = actionsRef.current?.textContent;\n\n const message = [bodyMessage, actionsMessage].filter(Boolean).join(',');\n announce(message, { polite: computedPoliteness === 'polite', alert: computedPoliteness === 'assertive' });\n }, [bodyRef, actionsRef, announce, computedPoliteness]);\n\n return {\n components: {\n root: 'div',\n icon: 'div',\n bottomReflowSpacer: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, reflowRef, nodeRef),\n role: 'group',\n 'aria-labelledby': titleId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n\n icon: slot.optional(props.icon, {\n renderByDefault: true,\n elementType: 'div',\n defaultProps: { children: getIntentIcon(intent) },\n }),\n bottomReflowSpacer: slot.optional(props.bottomReflowSpacer, {\n renderByDefault: computedLayout === 'multiline',\n elementType: 'div',\n }),\n layout: computedLayout,\n intent,\n transitionClassName,\n actionsRef,\n bodyRef,\n titleId,\n shape,\n };\n};\n"],"names":["useMessageBar_unstable","props","ref","layout","intent","politeness","shape","computedPoliteness","autoReflow","reflowRef","reflowing","useMessageBarReflow","computedLayout","className","transitionClassName","nodeRef","useMessageBarTransitionContext","actionsRef","React","useRef","bodyRef","announce","useAnnounce","titleId","useId","useEffect","bodyMessage","current","textContent","actionsMessage","message","filter","Boolean","join","polite","alert","components","root","icon","bottomReflowSpacer","slot","always","getIntrinsicElementProps","useMergedRefs","role","elementType","optional","renderByDefault","defaultProps","children","getIntentIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBaA;;;eAAAA;;;;iEAjBU;gCAC8C;qCACzC;+BAEE;qCACM;6CACW;AAWxC,MAAMA,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,SAAS,MAAM,EAAEC,SAA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BxC,KAAKyC,IAAAA,6BAAAA,EAAczC,KAAKO,WAAWM;YACnC6B,MAAM;YACN,mBAAmBrB;YACnB,GAAGtB,KAAK;QACV,IACA;YAAE4C,aAAa;QAAM;QAGvBP,MAAME,oBAAAA,CAAKM,QAAQ,CAAC7C,MAAMqC,IAAI,EAAE;YAC9BS,iBAAiB;YACjBF,aAAa;YACbG,cAAc;gBAAEC,UAAUC,IAAAA,4BAAAA,EAAc9C;YAAQ;QAClD;QACAmC,oBAAoBC,oBAAAA,CAAKM,QAAQ,CAAC7C,MAAMsC,kBAAkB,EAAE;YAC1DQ,iBAAiBnC,mBAAmB;YACpCiC,aAAa;QACf;QACA1C,QAAQS;QACRR;QACAU;QACAG;QACAG;QACAG;QACAjB;IACF;AACF"}
1
+ {"version":3,"sources":["../src/components/MessageBar/useMessageBar.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-utilities';\nimport { useAnnounce } from '@fluentui/react-shared-contexts';\nimport type { MessageBarProps, MessageBarState } from './MessageBar.types';\nimport { getIntentIcon } from './getIntentIcon';\nimport { useMessageBarReflow } from './useMessageBarReflow';\nimport { useMessageBarTransitionContext } from '../../contexts/messageBarTransitionContext';\n\n/**\n * Create the state required to render MessageBar.\n *\n * The returned state can be modified with hooks such as useMessageBarStyles_unstable,\n * before being passed to renderMessageBar_unstable.\n *\n * @param props - props from this instance of MessageBar\n * @param ref - reference to root HTMLElement of MessageBar\n */\nexport const useMessageBar_unstable = (props: MessageBarProps, ref: React.Ref<HTMLDivElement>): MessageBarState => {\n const { layout = 'auto', intent = 'info', politeness, shape = 'rounded' } = props;\n const computedPoliteness = politeness ?? intent === 'info' ? 'polite' : 'assertive';\n const autoReflow = layout === 'auto';\n const { ref: reflowRef, reflowing } = useMessageBarReflow(autoReflow);\n const computedLayout = autoReflow ? (reflowing ? 'multiline' : 'singleline') : layout;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const { className: transitionClassName, nodeRef } = useMessageBarTransitionContext();\n const actionsRef = React.useRef<HTMLDivElement | null>(null);\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n const { announce } = useAnnounce();\n const titleId = useId();\n\n React.useEffect(() => {\n const bodyMessage = bodyRef.current?.textContent;\n const actionsMessage = actionsRef.current?.textContent;\n\n const message = [bodyMessage, actionsMessage].filter(Boolean).join(',');\n announce(message, { polite: computedPoliteness === 'polite', alert: computedPoliteness === 'assertive' });\n }, [bodyRef, actionsRef, announce, computedPoliteness]);\n\n return {\n components: {\n root: 'div',\n icon: 'div',\n bottomReflowSpacer: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, reflowRef, nodeRef),\n role: 'group',\n 'aria-labelledby': titleId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n\n icon: slot.optional(props.icon, {\n renderByDefault: true,\n elementType: 'div',\n defaultProps: { children: getIntentIcon(intent) },\n }),\n bottomReflowSpacer: slot.optional(props.bottomReflowSpacer, {\n renderByDefault: computedLayout === 'multiline',\n elementType: 'div',\n }),\n layout: computedLayout,\n intent,\n transitionClassName,\n actionsRef,\n bodyRef,\n titleId,\n shape,\n };\n};\n"],"names":["useMessageBar_unstable","props","ref","layout","intent","politeness","shape","computedPoliteness","autoReflow","reflowRef","reflowing","useMessageBarReflow","computedLayout","className","transitionClassName","nodeRef","useMessageBarTransitionContext","actionsRef","React","useRef","bodyRef","announce","useAnnounce","titleId","useId","useEffect","bodyMessage","current","textContent","actionsMessage","message","filter","Boolean","join","polite","alert","components","root","icon","bottomReflowSpacer","slot","always","getIntrinsicElementProps","useMergedRefs","role","elementType","optional","renderByDefault","defaultProps","children","getIntentIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAiBaA;;;eAAAA;;;;iEAjBU;gCAC8C;qCACzC;+BAEE;qCACM;6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AAoB;QACtB;QACAF,MAAMG,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9BxC,KAAKyC,IAAAA,6BAAAA,EAAczC,KAAKO,WAAWM;YACnC6B,MAAM;YACN,mBAAmBrB;YACnB,GAAGtB,KAAK;QACV,IACA;YAAE4C,aAAa;QAAM;QAGvBP,MAAME,oBAAAA,CAAKM,QAAQ,CAAC7C,MAAMqC,IAAI,EAAE;YAC9BS,iBAAiB;YACjBF,aAAa;YACbG,cAAc;gBAAEC,UAAUC,IAAAA,4BAAAA,EAAc9C;YAAQ;QAClD;QACAmC,oBAAoBC,oBAAAA,CAAKM,QAAQ,CAAC7C,MAAMsC,kBAAkB,EAAE;YAC1DQ,iBAAiBnC,mBAAmB;YACpCiC,aAAa;QACf;QACA1C,QAAQS;QACRR;QACAU;QACAG;QACAG;QACAG;QACAjB;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-message-bar",
3
- "version": "0.0.0-nightly-20250114-0406.1",
3
+ "version": "0.0.0-nightly-20250120-0408.1",
4
4
  "description": "Fluent UI MessageBar component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -13,20 +13,20 @@
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
15
  "@fluentui/eslint-plugin": "*",
16
- "@fluentui/react-conformance": "0.0.0-nightly-20250114-0406.1",
17
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20250114-0406.1",
16
+ "@fluentui/react-conformance": "0.0.0-nightly-20250120-0408.1",
17
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20250120-0408.1",
18
18
  "@fluentui/scripts-api-extractor": "*"
19
19
  },
20
20
  "dependencies": {
21
- "@fluentui/react-button": "0.0.0-nightly-20250114-0406.1",
21
+ "@fluentui/react-button": "0.0.0-nightly-20250120-0408.1",
22
22
  "@fluentui/react-icons": "^2.0.245",
23
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20250114-0406.1",
24
- "@fluentui/react-motion": "0.0.0-nightly-20250114-0406.1",
25
- "@fluentui/react-motion-components-preview": "0.0.0-nightly-20250114-0406.1",
26
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20250114-0406.1",
27
- "@fluentui/react-link": "0.0.0-nightly-20250114-0406.1",
28
- "@fluentui/react-theme": "0.0.0-nightly-20250114-0406.1",
29
- "@fluentui/react-utilities": "0.0.0-nightly-20250114-0406.1",
23
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20250120-0408.1",
24
+ "@fluentui/react-motion": "0.0.0-nightly-20250120-0408.1",
25
+ "@fluentui/react-motion-components-preview": "0.0.0-nightly-20250120-0408.1",
26
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20250120-0408.1",
27
+ "@fluentui/react-link": "0.0.0-nightly-20250120-0408.1",
28
+ "@fluentui/react-theme": "0.0.0-nightly-20250120-0408.1",
29
+ "@fluentui/react-utilities": "0.0.0-nightly-20250120-0408.1",
30
30
  "@griffel/react": "^1.5.22",
31
31
  "@swc/helpers": "^0.5.1"
32
32
  },