@fluentui/react-toast 9.7.18 → 9.8.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 +27 -2
- package/dist/index.d.ts +155 -50
- package/lib/Toast.js +1 -1
- package/lib/Toast.js.map +1 -1
- package/lib/ToastBody.js +1 -1
- package/lib/ToastBody.js.map +1 -1
- package/lib/ToastTitle.js +1 -1
- package/lib/ToastTitle.js.map +1 -1
- package/lib/Toaster.js +1 -1
- package/lib/Toaster.js.map +1 -1
- package/lib/components/AriaLive/useAriaLiveStyles.styles.js +0 -2
- package/lib/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
- package/lib/components/AriaLive/useAriaLiveStyles.styles.raw.js +0 -1
- package/lib/components/AriaLive/useAriaLiveStyles.styles.raw.js.map +1 -1
- package/lib/components/Toast/Toast.types.js +1 -1
- package/lib/components/Toast/Toast.types.js.map +1 -1
- package/lib/components/Toast/index.js +1 -1
- package/lib/components/Toast/index.js.map +1 -1
- package/lib/components/Toast/useToast.js +18 -7
- package/lib/components/Toast/useToast.js.map +1 -1
- package/lib/components/Toast/useToastStyles.styles.js +0 -2
- package/lib/components/Toast/useToastStyles.styles.js.map +1 -1
- package/lib/components/Toast/useToastStyles.styles.raw.js +0 -1
- package/lib/components/Toast/useToastStyles.styles.raw.js.map +1 -1
- package/lib/components/ToastBody/ToastBody.types.js +1 -1
- package/lib/components/ToastBody/ToastBody.types.js.map +1 -1
- package/lib/components/ToastBody/index.js +1 -1
- package/lib/components/ToastBody/index.js.map +1 -1
- package/lib/components/ToastBody/useToastBody.js +17 -7
- package/lib/components/ToastBody/useToastBody.js.map +1 -1
- package/lib/components/ToastBody/useToastBodyStyles.styles.js +0 -2
- package/lib/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
- package/lib/components/ToastBody/useToastBodyStyles.styles.raw.js +0 -1
- package/lib/components/ToastBody/useToastBodyStyles.styles.raw.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainerStyles.styles.js +0 -2
- package/lib/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
- package/lib/components/ToastContainer/useToastContainerStyles.styles.raw.js +0 -1
- package/lib/components/ToastContainer/useToastContainerStyles.styles.raw.js.map +1 -1
- package/lib/components/ToastFooter/useToastFooterStyles.styles.js +0 -2
- package/lib/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
- package/lib/components/ToastFooter/useToastFooterStyles.styles.raw.js +0 -1
- package/lib/components/ToastFooter/useToastFooterStyles.styles.raw.js.map +1 -1
- package/lib/components/ToastTitle/ToastTitle.types.js +1 -1
- package/lib/components/ToastTitle/ToastTitle.types.js.map +1 -1
- package/lib/components/ToastTitle/index.js +1 -1
- package/lib/components/ToastTitle/index.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitle.js +39 -23
- package/lib/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js +0 -2
- package/lib/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.raw.js +0 -1
- package/lib/components/ToastTitle/useToastTitleStyles.styles.raw.js.map +1 -1
- package/lib/components/Toaster/index.js +1 -0
- package/lib/components/Toaster/index.js.map +1 -1
- package/lib/components/Toaster/useToastAnnounce.js +1 -1
- package/lib/components/Toaster/useToastAnnounce.js.map +1 -1
- package/lib/components/Toaster/useToaster.js +0 -1
- package/lib/components/Toaster/useToaster.js.map +1 -1
- package/lib/components/Toaster/useToasterStyles.styles.js +0 -2
- package/lib/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/lib/components/Toaster/useToasterStyles.styles.raw.js +0 -1
- package/lib/components/Toaster/useToasterStyles.styles.raw.js.map +1 -1
- package/lib/index.js +7 -5
- package/lib/index.js.map +1 -1
- package/lib/state/types.js.map +1 -1
- package/lib-commonjs/Toast.js +3 -0
- package/lib-commonjs/Toast.js.map +1 -1
- package/lib-commonjs/ToastBody.js +3 -0
- package/lib-commonjs/ToastBody.js.map +1 -1
- package/lib-commonjs/ToastTitle.js +3 -0
- package/lib-commonjs/ToastTitle.js.map +1 -1
- package/lib-commonjs/Toaster.js +3 -0
- package/lib-commonjs/Toaster.js.map +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js +0 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/AriaLive/useAriaLiveStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Toast/Toast.types.js +1 -1
- package/lib-commonjs/components/Toast/Toast.types.js.map +1 -1
- package/lib-commonjs/components/Toast/index.js +3 -0
- package/lib-commonjs/components/Toast/index.js.map +1 -1
- package/lib-commonjs/components/Toast/useToast.js +19 -5
- package/lib-commonjs/components/Toast/useToast.js.map +1 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.js +0 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/Toast/useToastStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ToastBody/ToastBody.types.js +1 -1
- package/lib-commonjs/components/ToastBody/ToastBody.types.js.map +1 -1
- package/lib-commonjs/components/ToastBody/index.js +3 -0
- package/lib-commonjs/components/ToastBody/index.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBody.js +19 -6
- package/lib-commonjs/components/ToastBody/useToastBody.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js +0 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/ToastBody/useToastBodyStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js +0 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/ToastContainer/useToastContainerStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js +0 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/ToastFooter/useToastFooterStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/ToastTitle.types.js +1 -1
- package/lib-commonjs/components/ToastTitle/ToastTitle.types.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/index.js +3 -0
- package/lib-commonjs/components/ToastTitle/index.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitle.js +43 -24
- package/lib-commonjs/components/ToastTitle/useToastTitle.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js +0 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/ToastTitle/useToastTitleStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Toaster/index.js +4 -0
- package/lib-commonjs/components/Toaster/index.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToastAnnounce.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToaster.js +0 -1
- package/lib-commonjs/components/Toaster/useToaster.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js +0 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/Toaster/useToasterStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/index.js +31 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/state/types.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Toaster/useToaster.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ExtractSlotProps, Slot } from '@fluentui/react-utilities';\nimport { getIntrinsicElementProps, 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 type { ToasterProps, ToasterState } from './Toaster.types';\nimport type { ToastPosition } from '../../state';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport type { 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
|
|
1
|
+
{"version":3,"sources":["../src/components/Toaster/useToaster.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ExtractSlotProps, Slot } from '@fluentui/react-utilities';\nimport { getIntrinsicElementProps, 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 type { ToasterProps, ToasterState } from './Toaster.types';\nimport type { ToastPosition } from '../../state';\nimport { TOAST_POSITIONS, useToaster } from '../../state';\nimport type { 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, inline = false, ...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 { onKeyDown: onKeyDownProp, ...rootProps } = slot.always(\n getIntrinsicElementProps<ExtractSlotProps<Slot<'div'>>>('div', rest),\n {\n elementType: 'div',\n },\n );\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 onKeyDownProp?.(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<ExtractSlotProps<Slot<'div'>>>(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 inline,\n };\n};\n"],"names":["React","getIntrinsicElementProps","useEventCallback","useMergedRefs","slot","useFluent_unstable","useFluent","useFocusableGroup","Escape","TOAST_POSITIONS","useToaster","ToastContainer","useToasterFocusManagement_unstable","useToastAnnounce","useToaster_unstable","props","offset","announce","announceProp","mountNode","inline","rest","announceRef","useRef","toastsToRender","isToastVisible","pauseAllToasts","playAllToasts","tryRestoreFocus","closeAllToasts","useCallback","message","options","current","dir","onKeyDown","onKeyDownProp","rootProps","always","elementType","focusableGroupAttr","tabBehavior","ignoreDefaultKeydown","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;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,wBAAwB,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC5G,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,MAAM,QAAQ,0BAA0B;AAGjD,SAASC,eAAe,EAAEC,UAAU,QAAQ,cAAc;AAE1D,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,EAAE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wBACpB1C,UAAUgC;wBACVL,KAAKc,MAAME,OAAO;wBAClBC,SAASpC,eAAeiC,MAAME,OAAO;uBAEpCF,MAAMI,OAAO;gBAGlB3B;gBACA,GAAGK,kBAAkB;gBACrB,yBAAyBO;gBACzBgB,MAAM;YAER;YACAxB,aAAa;QACf;IACF;IAEA,OAAO;QACLL;QACAf;QACA6C,YAAY;YACVC,MAAM;YACNC,aAAa;YACbC,WAAW;YACXC,UAAU;YACVC,QAAQ;YACRC,KAAK;YACLC,QAAQ;QACV;QACAN,MAAM7D,KAAKkC,MAAM,CAACD,WAAW;YAAEE,aAAa;QAAM;QAClD2B,aAAapB,gBAAgBrC,gBAAgByD,WAAW;QACxDC,WAAWrB,gBAAgBrC,gBAAgB0D,SAAS;QACpDC,UAAUtB,gBAAgBrC,gBAAgB2D,QAAQ;QAClDC,QAAQvB,gBAAgBrC,gBAAgB4D,MAAM;QAC9CC,KAAKxB,gBAAgBrC,gBAAgB6D,GAAG;QACxCC,QAAQzB,gBAAgBrC,gBAAgB8D,MAAM;QAC9CjD;QACAN;QACAC,UAAUC,yBAAAA,0BAAAA,eAAgBD;QAC1BuD,gBAAgB,CAACtD;QACjBE;IACF;AACF,EAAE"}
|
|
@@ -20,8 +20,6 @@ const useToasterStyles = /*#__PURE__*/__styles({
|
|
|
20
20
|
* Apply styling to the Toaster slots based on the state
|
|
21
21
|
*/
|
|
22
22
|
export const useToasterStyles_unstable = state => {
|
|
23
|
-
'use no memo';
|
|
24
|
-
|
|
25
23
|
const rootBaseClassName = useRootBaseClassName();
|
|
26
24
|
const styles = useToasterStyles();
|
|
27
25
|
const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles","inline","qhf8xq","d","useToasterStyles_unstable","state","rootBaseClassName","styles","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":["'use client';\nimport { makeResetStyles, makeStyles, 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});\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute'\n }\n});\n/**\n * Apply styling to the Toaster slots based on the state\n */ export const useToasterStyles_unstable = (state)=>{\n
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","useToasterStyles","inline","qhf8xq","d","useToasterStyles_unstable","state","rootBaseClassName","styles","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":["'use client';\nimport { makeResetStyles, makeStyles, 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});\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute'\n }\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 styles = useToasterStyles();\n const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);\n if (state.bottomStart) {\n var _state_bottomStart;\n // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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_POSITI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
|
|
@@ -19,7 +19,6 @@ const useToasterStyles = makeStyles({
|
|
|
19
19
|
/**
|
|
20
20
|
* Apply styling to the Toaster slots based on the state
|
|
21
21
|
*/ export const useToasterStyles_unstable = (state)=>{
|
|
22
|
-
'use no memo';
|
|
23
22
|
const rootBaseClassName = useRootBaseClassName();
|
|
24
23
|
const styles = useToasterStyles();
|
|
25
24
|
const className = mergeClasses(toasterClassNames.root, rootBaseClassName, state.inline && styles.inline, state.root.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Toaster/useToasterStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { ToasterSlots, ToasterState } from './Toaster.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\n\nexport const toasterClassNames: SlotClassNames<ToasterSlots> = {\n root: 'fui-Toaster',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none',\n});\n\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute',\n },\n});\n\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = (state: ToasterState): ToasterState => {\n
|
|
1
|
+
{"version":3,"sources":["../src/components/Toaster/useToasterStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { ToasterSlots, ToasterState } from './Toaster.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { TOAST_POSITIONS, getPositionStyles } from '../../state/index';\n\nexport const toasterClassNames: SlotClassNames<ToasterSlots> = {\n root: 'fui-Toaster',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n position: 'fixed',\n width: '292px',\n pointerEvents: 'none',\n});\n\nconst useToasterStyles = makeStyles({\n inline: {\n position: 'absolute',\n },\n});\n\n/**\n * Apply styling to the Toaster slots based on the state\n */\nexport const useToasterStyles_unstable = (state: ToasterState): ToasterState => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useToasterStyles();\n const className = mergeClasses(\n toasterClassNames.root,\n rootBaseClassName,\n state.inline && styles.inline,\n state.root.className,\n );\n if (state.bottomStart) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottomStart.className = className;\n state.bottomStart.style ??= {};\n Object.assign(state.bottomStart.style, getPositionStyles(TOAST_POSITIONS.bottomStart, state.dir, state.offset));\n }\n\n if (state.bottomEnd) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottomEnd.className = className;\n state.bottomEnd.style ??= {};\n Object.assign(state.bottomEnd.style, getPositionStyles(TOAST_POSITIONS.bottomEnd, state.dir, state.offset));\n }\n\n if (state.topStart) {\n // eslint-disable-next-line react-hooks/immutability\n state.topStart.className = className;\n state.topStart.style ??= {};\n Object.assign(state.topStart.style, getPositionStyles(TOAST_POSITIONS.topStart, state.dir, state.offset));\n }\n\n if (state.topEnd) {\n // eslint-disable-next-line react-hooks/immutability\n state.topEnd.className = className;\n state.topEnd.style ??= {};\n Object.assign(state.topEnd.style, getPositionStyles(TOAST_POSITIONS.topEnd, state.dir, state.offset));\n }\n\n if (state.top) {\n // eslint-disable-next-line react-hooks/immutability\n state.top.className = className;\n state.top.style ??= {};\n Object.assign(state.top.style, getPositionStyles(TOAST_POSITIONS.top, state.dir, state.offset));\n }\n\n if (state.bottom) {\n // eslint-disable-next-line react-hooks/immutability\n state.bottom.className = className;\n state.bottom.style ??= {};\n Object.assign(state.bottom.style, getPositionStyles(TOAST_POSITIONS.bottom, state.dir, state.offset));\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","TOAST_POSITIONS","getPositionStyles","toasterClassNames","root","useRootBaseClassName","position","width","pointerEvents","useToasterStyles","inline","useToasterStyles_unstable","state","rootBaseClassName","styles","className","bottomStart","style","Object","assign","dir","offset","bottomEnd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
-
export { useToastController } from './state';
|
|
1
|
+
export { useToastController, useToaster } from './state';
|
|
2
2
|
export { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';
|
|
3
|
-
export { Toaster, useToaster_unstable, useToasterStyles_unstable, renderToaster_unstable, toasterClassNames } from './Toaster';
|
|
4
|
-
export { Toast, useToastStyles_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';
|
|
5
|
-
export { ToastTitle, useToastTitleStyles_unstable, useToastTitle_unstable, renderToastTitle_unstable, toastTitleClassNames } from './ToastTitle';
|
|
6
|
-
export { ToastBody, useToastBodyStyles_unstable, useToastBody_unstable, renderToastBody_unstable, toastBodyClassNames } from './ToastBody';
|
|
3
|
+
export { Toaster, useToaster_unstable, useToasterStyles_unstable, renderToaster_unstable, toasterClassNames, useToastAnnounce } from './Toaster';
|
|
4
|
+
export { Toast, useToastStyles_unstable, useToastBase_unstable, useToast_unstable, renderToast_unstable, toastClassNames } from './Toast';
|
|
5
|
+
export { ToastTitle, useToastTitleStyles_unstable, useToastTitleBase_unstable, useToastTitle_unstable, renderToastTitle_unstable, toastTitleClassNames } from './ToastTitle';
|
|
6
|
+
export { ToastBody, useToastBodyStyles_unstable, useToastBodyBase_unstable, useToastBody_unstable, renderToastBody_unstable, toastBodyClassNames } from './ToastBody';
|
|
7
7
|
export { ToastFooter, useToastFooterStyles_unstable, useToastFooter_unstable, renderToastFooter_unstable, toastFooterClassNames } from './ToastFooter';
|
|
8
|
+
export { ToastContainerContextProvider, useToastContainerContext } from './contexts/toastContainerContext';
|
|
8
9
|
export { toastContainerClassNames } from './ToastContainer';
|
|
10
|
+
export { useToastContainer_unstable, renderToastContainer_unstable, useToastContainerContextValues_unstable } from './ToastContainer';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController } from './state';\nexport type { ToastPosition
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { useToastController, useToaster } from './state';\nexport type {\n Announce as ToastAnnounce,\n AnnounceOptions as ToastAnnounceOptions,\n LiveMessage as ToastLiveMessage,\n} from './AriaLive';\nexport type {\n ToastPosition,\n ToastId,\n ToastOffset,\n ToastPoliteness,\n ToastStatus,\n ToastIntent,\n ToasterId,\n ToasterOptions,\n ToasterShortcuts,\n ToastImperativeRef,\n Toast as ToastData,\n ToastChangeData,\n ToastChangeHandler,\n ToastOptions,\n DispatchToastOptions as ToastDispatchOptions,\n UpdateToastOptions as ToastUpdateOptions,\n UpdateToastEventDetail as ToastUpdateEventDetail,\n} from './state';\n\nexport { ToastTrigger, useToastTrigger_unstable, renderToastTrigger_unstable } from './ToastTrigger';\nexport type { ToastTriggerChildProps, ToastTriggerProps, ToastTriggerState } from './ToastTrigger';\nexport {\n Toaster,\n useToaster_unstable,\n useToasterStyles_unstable,\n renderToaster_unstable,\n toasterClassNames,\n useToastAnnounce,\n} from './Toaster';\nexport type { ToasterProps, ToasterState, ToasterSlots } from './Toaster';\nexport {\n Toast,\n useToastStyles_unstable,\n useToastBase_unstable,\n useToast_unstable,\n renderToast_unstable,\n toastClassNames,\n} from './Toast';\nexport type { ToastBaseProps, ToastBaseState, ToastProps, ToastState, ToastSlots } from './Toast';\n\nexport {\n ToastTitle,\n useToastTitleStyles_unstable,\n useToastTitleBase_unstable,\n useToastTitle_unstable,\n renderToastTitle_unstable,\n toastTitleClassNames,\n} from './ToastTitle';\nexport type {\n ToastTitleBaseProps,\n ToastTitleBaseState,\n ToastTitleProps,\n ToastTitleState,\n ToastTitleSlots,\n} from './ToastTitle';\n\nexport {\n ToastBody,\n useToastBodyStyles_unstable,\n useToastBodyBase_unstable,\n useToastBody_unstable,\n renderToastBody_unstable,\n toastBodyClassNames,\n} from './ToastBody';\nexport type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodyState,\n ToastBodySlots,\n} from './ToastBody';\n\nexport {\n ToastFooter,\n useToastFooterStyles_unstable,\n useToastFooter_unstable,\n renderToastFooter_unstable,\n toastFooterClassNames,\n} from './ToastFooter';\nexport type { ToastFooterProps, ToastFooterState, ToastFooterSlots } from './ToastFooter';\n\nexport type { ToastContainerContextValue } from './contexts/toastContainerContext';\nexport { ToastContainerContextProvider, useToastContainerContext } from './contexts/toastContainerContext';\nexport { toastContainerClassNames } from './ToastContainer';\nexport type { ToastContainerSlots, ToastContainerProps, ToastContainerState } from './ToastContainer';\nexport {\n useToastContainer_unstable,\n renderToastContainer_unstable,\n useToastContainerContextValues_unstable,\n} from './ToastContainer';\n"],"names":["useToastController","useToaster","ToastTrigger","useToastTrigger_unstable","renderToastTrigger_unstable","Toaster","useToaster_unstable","useToasterStyles_unstable","renderToaster_unstable","toasterClassNames","useToastAnnounce","Toast","useToastStyles_unstable","useToastBase_unstable","useToast_unstable","renderToast_unstable","toastClassNames","ToastTitle","useToastTitleStyles_unstable","useToastTitleBase_unstable","useToastTitle_unstable","renderToastTitle_unstable","toastTitleClassNames","ToastBody","useToastBodyStyles_unstable","useToastBodyBase_unstable","useToastBody_unstable","renderToastBody_unstable","toastBodyClassNames","ToastFooter","useToastFooterStyles_unstable","useToastFooter_unstable","renderToastFooter_unstable","toastFooterClassNames","ToastContainerContextProvider","useToastContainerContext","toastContainerClassNames","useToastContainer_unstable","renderToastContainer_unstable","useToastContainerContextValues_unstable"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,UAAU,QAAQ,UAAU;AA0BzD,SAASC,YAAY,EAAEC,wBAAwB,EAAEC,2BAA2B,QAAQ,iBAAiB;AAErG,SACEC,OAAO,EACPC,mBAAmB,EACnBC,yBAAyB,EACzBC,sBAAsB,EACtBC,iBAAiB,EACjBC,gBAAgB,QACX,YAAY;AAEnB,SACEC,KAAK,EACLC,uBAAuB,EACvBC,qBAAqB,EACrBC,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,QACV,UAAU;AAGjB,SACEC,UAAU,EACVC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,oBAAoB,QACf,eAAe;AAStB,SACEC,SAAS,EACTC,2BAA2B,EAC3BC,yBAAyB,EACzBC,qBAAqB,EACrBC,wBAAwB,EACxBC,mBAAmB,QACd,cAAc;AASrB,SACEC,WAAW,EACXC,6BAA6B,EAC7BC,uBAAuB,EACvBC,0BAA0B,EAC1BC,qBAAqB,QAChB,gBAAgB;AAIvB,SAASC,6BAA6B,EAAEC,wBAAwB,QAAQ,mCAAmC;AAC3G,SAASC,wBAAwB,QAAQ,mBAAmB;AAE5D,SACEC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uCAAuC,QAClC,mBAAmB"}
|
package/lib/state/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state/types.ts"],"sourcesContent":["import type { Slot } from '@fluentui/react-utilities';\nimport type { EVENTS } from './constants';\nimport type * 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 | null>;\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\
|
|
1
|
+
{"version":3,"sources":["../src/state/types.ts"],"sourcesContent":["import type { Slot } from '@fluentui/react-utilities';\nimport type { EVENTS } from './constants';\nimport type * 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 | null>;\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\nexport interface DispatchToastOptions extends Partial<Omit<ToastOptions, 'toasterId'>> {\n root?: Slot<'div'>;\n}\n\nexport interface UpdateToastOptions extends UpdateToastEventDetail {\n root?: Slot<'div'>;\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":[],"mappings":"AAkKA,WAgBE"}
|
package/lib-commonjs/Toast.js
CHANGED
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
toastClassNames: function() {
|
|
19
19
|
return _index.toastClassNames;
|
|
20
20
|
},
|
|
21
|
+
useToastBase_unstable: function() {
|
|
22
|
+
return _index.useToastBase_unstable;
|
|
23
|
+
},
|
|
21
24
|
useToastStyles_unstable: function() {
|
|
22
25
|
return _index.useToastStyles_unstable;
|
|
23
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Toast.ts"],"sourcesContent":["export type {
|
|
1
|
+
{"version":3,"sources":["../src/Toast.ts"],"sourcesContent":["export type {\n ToastBaseProps,\n ToastBaseState,\n ToastContextValues,\n ToastProps,\n ToastSlots,\n ToastState,\n} from './components/Toast/index';\nexport {\n Toast,\n renderToast_unstable,\n toastClassNames,\n useToastStyles_unstable,\n useToastBase_unstable,\n useToast_unstable,\n} from './components/Toast/index';\n"],"names":["Toast","renderToast_unstable","toastClassNames","useToastStyles_unstable","useToastBase_unstable","useToast_unstable"],"mappings":";;;;;;;;;;;;eASEA,YAAK;;;eACLC,2BAAoB;;;eACpBC,sBAAe;;;eAEfE,4BAAqB;;;eADrBD,8BAAuB;;;eAEvBE,wBAAiB;;;uBACZ,2BAA2B"}
|
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
toastBodyClassNames: function() {
|
|
19
19
|
return _index.toastBodyClassNames;
|
|
20
20
|
},
|
|
21
|
+
useToastBodyBase_unstable: function() {
|
|
22
|
+
return _index.useToastBodyBase_unstable;
|
|
23
|
+
},
|
|
21
24
|
useToastBodyStyles_unstable: function() {
|
|
22
25
|
return _index.useToastBodyStyles_unstable;
|
|
23
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ToastBody.ts"],"sourcesContent":["export type {
|
|
1
|
+
{"version":3,"sources":["../src/ToastBody.ts"],"sourcesContent":["export type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodySlots,\n ToastBodyState,\n} from './components/ToastBody/index';\nexport {\n ToastBody,\n renderToastBody_unstable,\n toastBodyClassNames,\n useToastBodyStyles_unstable,\n useToastBodyBase_unstable,\n useToastBody_unstable,\n} from './components/ToastBody/index';\n"],"names":["ToastBody","renderToastBody_unstable","toastBodyClassNames","useToastBodyStyles_unstable","useToastBodyBase_unstable","useToastBody_unstable"],"mappings":";;;;;;;;;;;;eAQEA,gBAAS;;;eACTC,+BAAwB;;;eACxBC,0BAAmB;;;eAEnBE,gCAAyB;;;eADzBD,kCAA2B;;;eAE3BE,4BAAqB;;;uBAChB,+BAA+B"}
|
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
toastTitleClassNames: function() {
|
|
19
19
|
return _index.toastTitleClassNames;
|
|
20
20
|
},
|
|
21
|
+
useToastTitleBase_unstable: function() {
|
|
22
|
+
return _index.useToastTitleBase_unstable;
|
|
23
|
+
},
|
|
21
24
|
useToastTitleStyles_unstable: function() {
|
|
22
25
|
return _index.useToastTitleStyles_unstable;
|
|
23
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ToastTitle.ts"],"sourcesContent":["export type {
|
|
1
|
+
{"version":3,"sources":["../src/ToastTitle.ts"],"sourcesContent":["export type {\n ToastTitleBaseProps,\n ToastTitleBaseState,\n ToastTitleProps,\n ToastTitleSlots,\n ToastTitleState,\n} from './components/ToastTitle/index';\nexport {\n ToastTitle,\n renderToastTitle_unstable,\n toastTitleClassNames,\n useToastTitleStyles_unstable,\n useToastTitleBase_unstable,\n useToastTitle_unstable,\n} from './components/ToastTitle/index';\n"],"names":["ToastTitle","renderToastTitle_unstable","toastTitleClassNames","useToastTitleStyles_unstable","useToastTitleBase_unstable","useToastTitle_unstable"],"mappings":";;;;;;;;;;;;eAQEA,iBAAU;;;eACVC,gCAAyB;;;eACzBC,2BAAoB;;;eAEpBE,iCAA0B;;;eAD1BD,mCAA4B;;;eAE5BE,6BAAsB;;;uBACjB,gCAAgC"}
|
package/lib-commonjs/Toaster.js
CHANGED
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
toasterClassNames: function() {
|
|
19
19
|
return _index.toasterClassNames;
|
|
20
20
|
},
|
|
21
|
+
useToastAnnounce: function() {
|
|
22
|
+
return _index.useToastAnnounce;
|
|
23
|
+
},
|
|
21
24
|
useToasterStyles_unstable: function() {
|
|
22
25
|
return _index.useToasterStyles_unstable;
|
|
23
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Toaster.ts"],"sourcesContent":["export type { ToasterProps, ToasterSlots, ToasterSlotsInternal, ToasterState } from './components/Toaster/index';\nexport {\n Toaster,\n renderToaster_unstable,\n toasterClassNames,\n useToasterStyles_unstable,\n useToaster_unstable,\n} from './components/Toaster/index';\n"],"names":["Toaster","renderToaster_unstable","toasterClassNames","useToasterStyles_unstable","useToaster_unstable"],"mappings":";;;;;;;;;;;;eAEEA,cAAO;;;eACPC,6BAAsB;;;eACtBC,wBAAiB;;;
|
|
1
|
+
{"version":3,"sources":["../src/Toaster.ts"],"sourcesContent":["export type { ToasterProps, ToasterSlots, ToasterSlotsInternal, ToasterState } from './components/Toaster/index';\nexport {\n Toaster,\n renderToaster_unstable,\n toasterClassNames,\n useToasterStyles_unstable,\n useToaster_unstable,\n useToastAnnounce,\n} from './components/Toaster/index';\n"],"names":["Toaster","renderToaster_unstable","toasterClassNames","useToasterStyles_unstable","useToaster_unstable","useToastAnnounce"],"mappings":";;;;;;;;;;;;eAEEA,cAAO;;;eACPC,6BAAsB;;;eACtBC,wBAAiB;;;eAGjBG,uBAAgB;;;eAFhBF,gCAAyB;;;eACzBC,0BAAmB;;;uBAEd,6BAA6B"}
|
|
@@ -28,7 +28,6 @@ const ariaLiveClassNames = {
|
|
|
28
28
|
".rrd10u0{clip:rect(0px, 0px, 0px, 0px);height:1px;margin:-1px;overflow:hidden;padding:0px;width:1px;position:absolute;}"
|
|
29
29
|
]);
|
|
30
30
|
const useAriaLiveStyles_unstable = (state)=>{
|
|
31
|
-
'use no memo';
|
|
32
31
|
const visuallyHidden = useResetStyles();
|
|
33
32
|
// eslint-disable-next-line react-hooks/immutability
|
|
34
33
|
state.assertive.className = (0, _react.mergeClasses)(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAriaLiveStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses, makeResetStyles } from '@griffel/react';\nexport const ariaLiveClassNames = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute'\n});\n/**\n * Apply styling to the AriaLive slots based on the state\n */ export const useAriaLiveStyles_unstable = (state)=>{\n
|
|
1
|
+
{"version":3,"sources":["useAriaLiveStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses, makeResetStyles } from '@griffel/react';\nexport const ariaLiveClassNames = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute'\n});\n/**\n * Apply styling to the AriaLive slots based on the state\n */ export const useAriaLiveStyles_unstable = (state)=>{\n const visuallyHidden = useResetStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.assertive.className = mergeClasses(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);\n // eslint-disable-next-line react-hooks/immutability\n state.polite.className = mergeClasses(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);\n return state;\n};\n"],"names":["mergeClasses","__resetStyles","ariaLiveClassNames","assertive","polite","useResetStyles","useAriaLiveStyles_unstable","state","visuallyHidden","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAECE,kBAAkB;;;IAiBdI,0BAA0B;;;;uBAlBG,gBAAgB;AACvD,2BAA2B;IAC9BH,SAAS,EAAE,yBAAyB;IACpCC,MAAM,EAAE;AACZ,CAAC;AACD;;CAEA,GAAI,MAAMC,cAAc,GAAA,WAAA,OAAGJ,oBAAA,EAAA,WAAA,MAAA;IAAA;CAQ1B,CAAC;AAGS,oCAAoCM,KAAK,IAAG;IACnD,MAAMC,cAAc,GAAGH,cAAc,CAAC,CAAC;IACvC,oDAAA;IACAE,KAAK,CAACJ,SAAS,CAACM,SAAS,OAAGT,mBAAY,EAACQ,cAAc,EAAEN,kBAAkB,CAACC,SAAS,EAAEI,KAAK,CAACJ,SAAS,CAACM,SAAS,CAAC;IACjH,oDAAA;IACAF,KAAK,CAACH,MAAM,CAACK,SAAS,OAAGT,mBAAY,EAACQ,cAAc,EAAEN,kBAAkB,CAACE,MAAM,EAAEG,KAAK,CAACH,MAAM,CAACK,SAAS,CAAC;IACxG,OAAOF,KAAK;AAChB,CAAC"}
|
|
@@ -34,7 +34,6 @@ const ariaLiveClassNames = {
|
|
|
34
34
|
position: 'absolute'
|
|
35
35
|
});
|
|
36
36
|
const useAriaLiveStyles_unstable = (state)=>{
|
|
37
|
-
'use no memo';
|
|
38
37
|
const visuallyHidden = useResetStyles();
|
|
39
38
|
// eslint-disable-next-line react-hooks/immutability
|
|
40
39
|
state.assertive.className = (0, _react.mergeClasses)(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AriaLive/useAriaLiveStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses, makeResetStyles } from '@griffel/react';\nimport type { AriaLiveSlots, AriaLiveState } from './AriaLive.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const ariaLiveClassNames: SlotClassNames<AriaLiveSlots> = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite',\n};\n\n/**\n * Styles for the root slot\n */\nconst useResetStyles = makeResetStyles({\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n});\n\n/**\n * Apply styling to the AriaLive slots based on the state\n */\nexport const useAriaLiveStyles_unstable = (state: AriaLiveState): AriaLiveState => {\n
|
|
1
|
+
{"version":3,"sources":["../src/components/AriaLive/useAriaLiveStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses, makeResetStyles } from '@griffel/react';\nimport type { AriaLiveSlots, AriaLiveState } from './AriaLive.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const ariaLiveClassNames: SlotClassNames<AriaLiveSlots> = {\n assertive: 'fui-AriaLive__assertive',\n polite: 'fui-AriaLive__polite',\n};\n\n/**\n * Styles for the root slot\n */\nconst useResetStyles = makeResetStyles({\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n});\n\n/**\n * Apply styling to the AriaLive slots based on the state\n */\nexport const useAriaLiveStyles_unstable = (state: AriaLiveState): AriaLiveState => {\n const visuallyHidden = useResetStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.assertive.className = mergeClasses(visuallyHidden, ariaLiveClassNames.assertive, state.assertive.className);\n // eslint-disable-next-line react-hooks/immutability\n state.polite.className = mergeClasses(visuallyHidden, ariaLiveClassNames.polite, state.polite.className);\n\n return state;\n};\n"],"names":["mergeClasses","makeResetStyles","ariaLiveClassNames","assertive","polite","useResetStyles","clip","height","margin","overflow","padding","width","position","useAriaLiveStyles_unstable","state","visuallyHidden","className"],"mappings":"AAAA;;;;;;;;;;;;IAMaE,kBAAAA;;;8BAqBAW;eAAAA;;;uBAzBiC,iBAAiB;AAIxD,2BAA0D;IAC/DV,WAAW;IACXC,QAAQ;AACV,EAAE;AAEF;;CAEC,GACD,MAAMC,iBAAiBJ,0BAAAA,EAAgB;IACrCK,MAAM;IACNC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,SAAS;IACTC,OAAO;IACPC,UAAU;AACZ;AAKO,mCAAmC,CAACE;IACzC,MAAMC,iBAAiBV;IACvB,oDAAoD;IACpDS,MAAMX,SAAS,CAACa,SAAS,OAAGhB,mBAAAA,EAAae,gBAAgBb,mBAAmBC,SAAS,EAAEW,MAAMX,SAAS,CAACa,SAAS;IAChH,oDAAoD;IACpDF,MAAMV,MAAM,CAACY,SAAS,OAAGhB,mBAAAA,EAAae,gBAAgBb,mBAAmBE,MAAM,EAAEU,MAAMV,MAAM,CAACY,SAAS;IAEvG,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Toast/Toast.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\nimport type { ToastIntent } from '../../state/types';\n\nexport type ToastSlots = {\n root: Slot<'div'>;\n};\n\nexport type ToastContextValues = {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n\n/**\n * Toast Props\n */\nexport type ToastProps = ComponentProps<ToastSlots> & {\n appearance?: BackgroundAppearanceContextValue;\n};\n\n/**\n * State used in rendering Toast\n */\nexport type ToastState = ComponentState<ToastSlots> & {\n backgroundAppearance: BackgroundAppearanceContextValue;\n intent?: ToastIntent | undefined;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/Toast/Toast.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\nimport type { ToastIntent } from '../../state/types';\n\nexport type ToastSlots = {\n root: Slot<'div'>;\n};\n\nexport type ToastContextValues = {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n\n/**\n * Toast Props\n */\nexport type ToastProps = ComponentProps<ToastSlots> & {\n appearance?: BackgroundAppearanceContextValue;\n};\n\n/**\n * Toast Props without design-only props.\n */\nexport type ToastBaseProps = Omit<ToastProps, 'appearance'>;\n\n/**\n * State used in rendering Toast\n */\nexport type ToastState = ComponentState<ToastSlots> & {\n backgroundAppearance: BackgroundAppearanceContextValue;\n intent?: ToastIntent | undefined;\n};\n\n/**\n * State used in rendering Toast, without design-only state.\n */\nexport type ToastBaseState = Omit<ToastState, 'backgroundAppearance'>;\n"],"names":[],"mappings":"AAgCA;;CAEC,GACD,WAAsE"}
|
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
toastClassNames: function() {
|
|
19
19
|
return _useToastStylesstyles.toastClassNames;
|
|
20
20
|
},
|
|
21
|
+
useToastBase_unstable: function() {
|
|
22
|
+
return _useToast.useToastBase_unstable;
|
|
23
|
+
},
|
|
21
24
|
useToastStyles_unstable: function() {
|
|
22
25
|
return _useToastStylesstyles.useToastStyles_unstable;
|
|
23
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Toast/index.ts"],"sourcesContent":["export { Toast } from './Toast';\nexport type {
|
|
1
|
+
{"version":3,"sources":["../src/components/Toast/index.ts"],"sourcesContent":["export { Toast } from './Toast';\nexport type {\n ToastBaseProps,\n ToastBaseState,\n ToastContextValues,\n ToastProps,\n ToastSlots,\n ToastState,\n} from './Toast.types';\nexport { renderToast_unstable } from './renderToast';\nexport { useToastBase_unstable, useToast_unstable } from './useToast';\nexport { toastClassNames, useToastStyles_unstable } from './useToastStyles.styles';\n"],"names":["Toast","renderToast_unstable","useToastBase_unstable","useToast_unstable","toastClassNames","useToastStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,YAAK;;;eASLC,iCAAoB;;;eAEpBG,qCAAe;;;eADfF,+BAAqB;;;eACJG,6CAAuB;;;eADjBF,2BAAiB;;;uBAV3B,UAAU;6BASK,gBAAgB;0BACI,aAAa;sCACb,0BAA0B"}
|
|
@@ -3,15 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
useToastBase_unstable: function() {
|
|
14
|
+
return useToastBase_unstable;
|
|
15
|
+
},
|
|
16
|
+
useToast_unstable: function() {
|
|
9
17
|
return useToast_unstable;
|
|
10
18
|
}
|
|
11
19
|
});
|
|
12
20
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
21
|
const _toastContainerContext = require("../../contexts/toastContainerContext");
|
|
14
|
-
const
|
|
22
|
+
const useToastBase_unstable = (props, ref)=>{
|
|
15
23
|
const { intent } = (0, _toastContainerContext.useToastContainerContext)();
|
|
16
24
|
return {
|
|
17
25
|
components: {
|
|
@@ -26,7 +34,13 @@ const useToast_unstable = (props, ref)=>{
|
|
|
26
34
|
}), {
|
|
27
35
|
elementType: 'div'
|
|
28
36
|
}),
|
|
29
|
-
backgroundAppearance: props.appearance,
|
|
30
37
|
intent
|
|
31
38
|
};
|
|
32
39
|
};
|
|
40
|
+
const useToast_unstable = (props, ref)=>{
|
|
41
|
+
const state = useToastBase_unstable(props, ref);
|
|
42
|
+
return {
|
|
43
|
+
...state,
|
|
44
|
+
backgroundAppearance: props.appearance
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Toast/useToast.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastProps, ToastState } from './Toast.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * Create the state required to render Toast
|
|
1
|
+
{"version":3,"sources":["../src/components/Toast/useToast.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastBaseProps, ToastBaseState, ToastProps, ToastState } from './Toast.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\n\n/**\n * Create the base state required to render Toast, without design-only props.\n *\n * @param props - props from this instance of Toast (without appearance)\n * @param ref - reference to root HTMLElement of Toast\n */\nexport const useToastBase_unstable = (props: ToastBaseProps, ref: React.Ref<HTMLElement>): ToastBaseState => {\n const { intent } = useToastContainerContext();\n\n return {\n components: {\n root: 'div',\n },\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 ...props,\n }),\n { elementType: 'div' },\n ),\n intent,\n };\n};\n\n/**\n * Create the state required to render Toast.\n *\n * The returned state can be modified with hooks such as useToastStyles_unstable,\n * before being passed to renderToast_unstable.\n *\n * @param props - props from this instance of Toast\n * @param ref - reference to root HTMLElement of Toast\n */\nexport const useToast_unstable = (props: ToastProps, ref: React.Ref<HTMLElement>): ToastState => {\n const state = useToastBase_unstable(props, ref);\n return {\n ...state,\n backgroundAppearance: props.appearance,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useToastContainerContext","useToastBase_unstable","props","ref","intent","components","root","always","elementType","useToast_unstable","state","backgroundAppearance","appearance"],"mappings":"AAAA;;;;;;;;;;;;IAaaG,qBAAAA;;;qBA8BAQ;;;;gCAxCkC,4BAA4B;uCAElC,uCAAuC;AAQzE,8BAA8B,CAACP,OAAuBC;IAC3D,MAAM,EAAEC,MAAM,EAAE,GAAGJ,mDAAAA;IAEnB,OAAO;QACLK,YAAY;YACVC,MAAM;QACR;QACAA,MAAMP,oBAAAA,CAAKQ,MAAM,KACfT,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FK,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAEM,aAAa;QAAM;QAEvBJ;IACF;AACF,EAAE;AAWK,MAAMK,oBAAoB,CAACP,OAAmBC;IACnD,MAAMO,QAAQT,sBAAsBC,OAAOC;IAC3C,OAAO;QACL,GAAGO,KAAK;QACRC,sBAAsBT,MAAMU,UAAU;IACxC;AACF,EAAE"}
|
|
@@ -36,7 +36,6 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
36
36
|
]
|
|
37
37
|
});
|
|
38
38
|
const useToastStyles_unstable = (state)=>{
|
|
39
|
-
'use no memo';
|
|
40
39
|
const rootBaseClassName = useRootBaseClassName();
|
|
41
40
|
const styles = useStyles();
|
|
42
41
|
// eslint-disable-next-line react-hooks/immutability
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useToastStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastClassNames = {\n root: 'fui-Toast'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n padding: '12px',\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n lineHeight: '20px',\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1\n});\nconst useStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted\n }\n});\n/**\n * Apply styling to the Toast slots based on the state\n */ export const useToastStyles_unstable = (state)=>{\n
|
|
1
|
+
{"version":3,"sources":["useToastStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const toastClassNames = {\n root: 'fui-Toast'\n};\nconst useRootBaseClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n padding: '12px',\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n lineHeight: '20px',\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1\n});\nconst useStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted\n }\n});\n/**\n * Apply styling to the Toast slots based on the state\n */ export const useToastStyles_unstable = (state)=>{\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toastClassNames.root, rootBaseClassName, state.backgroundAppearance === 'inverted' && styles.inverted, state.root.className);\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","toastClassNames","root","useRootBaseClassName","useStyles","inverted","sj55zd","De3pzq","d","useToastStyles_unstable","state","rootBaseClassName","styles","className","backgroundAppearance"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCI,eAAe;;;IAwBXQ,uBAAuB;;;;uBA1BkB,gBAAgB;AAEnE,wBAAwB;IAC3BP,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,GAAA,WAAA,OAAGN,oBAAA,EAAA,WAAA,MAAA;IAAA;CAY5B,CAAC;AACF,MAAMO,SAAS,GAAA,WAAA,OAAGN,eAAA,EAAA;IAAAO,QAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;KAAA;AAAA,CAKjB,CAAC;AAGS,iCAAiCE,KAAK,IAAG;IAChD,MAAMC,iBAAiB,GAAGR,oBAAoB,CAAC,CAAC;IAChD,MAAMS,MAAM,GAAGR,SAAS,CAAC,CAAC;IAC1B,oDAAA;IACAM,KAAK,CAACR,IAAI,CAACW,SAAS,OAAGd,mBAAY,EAACE,eAAe,CAACC,IAAI,EAAES,iBAAiB,EAAED,KAAK,CAACI,oBAAoB,KAAK,UAAU,IAAIF,MAAM,CAACP,QAAQ,EAAEK,KAAK,CAACR,IAAI,CAACW,SAAS,CAAC;IAChK,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Toast/useToastStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ToastSlots, ToastState } from './Toast.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const toastClassNames: SlotClassNames<ToastSlots> = {\n root: 'fui-Toast',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n padding: '12px',\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n lineHeight: '20px',\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n});\n\nconst useStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted,\n },\n});\n\n/**\n * Apply styling to the Toast slots based on the state\n */\nexport const useToastStyles_unstable = (state: ToastState): ToastState => {\n
|
|
1
|
+
{"version":3,"sources":["../src/components/Toast/useToastStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ToastSlots, ToastState } from './Toast.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const toastClassNames: SlotClassNames<ToastSlots> = {\n root: 'fui-Toast',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n padding: '12px',\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorTransparentStroke}`,\n boxShadow: tokens.shadow8,\n fontSize: tokens.fontSizeBase300,\n lineHeight: '20px',\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n});\n\nconst useStyles = makeStyles({\n inverted: {\n color: tokens.colorNeutralForegroundInverted2,\n backgroundColor: tokens.colorNeutralBackgroundInverted,\n },\n});\n\n/**\n * Apply styling to the Toast slots based on the state\n */\nexport const useToastStyles_unstable = (state: ToastState): ToastState => {\n const rootBaseClassName = useRootBaseClassName();\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n toastClassNames.root,\n rootBaseClassName,\n state.backgroundAppearance === 'inverted' && styles.inverted,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","toastClassNames","root","useRootBaseClassName","display","gridTemplateColumns","padding","borderRadius","borderRadiusMedium","border","colorTransparentStroke","boxShadow","shadow8","fontSize","fontSizeBase300","lineHeight","fontWeight","fontWeightSemibold","color","colorNeutralForeground1","backgroundColor","colorNeutralBackground1","useStyles","inverted","colorNeutralForegroundInverted2","colorNeutralBackgroundInverted","useToastStyles_unstable","state","rootBaseClassName","styles","className","backgroundAppearance"],"mappings":"AAAA;;;;;;;;;;;;IAOaI,eAAAA;;;2BA4BAyB;eAAAA;;;uBAjC6C,iBAAiB;4BACpD,wBAAwB;AAIxC,wBAAoD;IACzDxB,MAAM;AACR,EAAE;AAEF,MAAMC,2BAAuBN,sBAAAA,EAAgB;IAC3CO,SAAS;IACTC,qBAAqB;IACrBC,SAAS;IACTC,cAAcP,kBAAAA,CAAOQ,kBAAkB;IACvCC,QAAQ,CAAC,UAAU,EAAET,kBAAAA,CAAOU,sBAAsB,EAAE;IACpDC,WAAWX,kBAAAA,CAAOY,OAAO;IACzBC,UAAUb,kBAAAA,CAAOc,eAAe;IAChCC,YAAY;IACZC,YAAYhB,kBAAAA,CAAOiB,kBAAkB;IACrCC,OAAOlB,kBAAAA,CAAOmB,uBAAuB;IACrCC,iBAAiBpB,kBAAAA,CAAOqB,uBAAuB;AACjD;AAEA,MAAMC,YAAYxB,qBAAAA,EAAW;IAC3ByB,UAAU;QACRL,OAAOlB,kBAAAA,CAAOwB,+BAA+B;QAC7CJ,iBAAiBpB,kBAAAA,CAAOyB,8BAA8B;IACxD;AACF;AAKO,gCAAgC,CAACE;IACtC,MAAMC,oBAAoBzB;IAC1B,MAAM0B,SAASP;IACf,oDAAoD;IACpDK,MAAMzB,IAAI,CAAC4B,SAAS,OAAG/B,mBAAAA,EACrBE,gBAAgBC,IAAI,EACpB0B,mBACAD,MAAMI,oBAAoB,KAAK,cAAcF,OAAON,QAAQ,EAC5DI,MAAMzB,IAAI,CAAC4B,SAAS;IAGtB,OAAOH;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastBody/ToastBody.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\n\nexport type ToastBodySlots = {\n root: Slot<'div'>;\n subtitle?: Slot<'div'>;\n};\n\n/**\n * ToastBody Props\n */\nexport type ToastBodyProps = ComponentProps<ToastBodySlots> & {};\n\n/**\n * State used in rendering ToastBody\n */\nexport type ToastBodyState = ComponentState<ToastBodySlots> & {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastBody/ToastBody.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';\n\nexport type ToastBodySlots = {\n root: Slot<'div'>;\n subtitle?: Slot<'div'>;\n};\n\n/**\n * ToastBody Props\n */\nexport type ToastBodyProps = ComponentProps<ToastBodySlots> & {};\n\n/**\n * ToastBody Props without design-only props.\n */\nexport type ToastBodyBaseProps = ToastBodyProps;\n\n/**\n * State used in rendering ToastBody\n */\nexport type ToastBodyState = ComponentState<ToastBodySlots> & {\n backgroundAppearance: BackgroundAppearanceContextValue;\n};\n\n/**\n * State used in rendering ToastBody, without design-only state.\n */\nexport type ToastBodyBaseState = Omit<ToastBodyState, 'backgroundAppearance'>;\n"],"names":[],"mappings":"AAyBA;;CAEC,GACD,WAA8E"}
|
|
@@ -18,6 +18,9 @@ _export(exports, {
|
|
|
18
18
|
toastBodyClassNames: function() {
|
|
19
19
|
return _useToastBodyStylesstyles.toastBodyClassNames;
|
|
20
20
|
},
|
|
21
|
+
useToastBodyBase_unstable: function() {
|
|
22
|
+
return _useToastBody.useToastBodyBase_unstable;
|
|
23
|
+
},
|
|
21
24
|
useToastBodyStyles_unstable: function() {
|
|
22
25
|
return _useToastBodyStylesstyles.useToastBodyStyles_unstable;
|
|
23
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastBody/index.ts"],"sourcesContent":["export { ToastBody } from './ToastBody';\nexport type {
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastBody/index.ts"],"sourcesContent":["export { ToastBody } from './ToastBody';\nexport type {\n ToastBodyBaseProps,\n ToastBodyBaseState,\n ToastBodyProps,\n ToastBodySlots,\n ToastBodyState,\n} from './ToastBody.types';\nexport { renderToastBody_unstable } from './renderToastBody';\nexport { useToastBodyBase_unstable, useToastBody_unstable } from './useToastBody';\nexport { toastBodyClassNames, useToastBodyStyles_unstable } from './useToastBodyStyles.styles';\n"],"names":["ToastBody","renderToastBody_unstable","useToastBodyBase_unstable","useToastBody_unstable","toastBodyClassNames","useToastBodyStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,oBAAS;;;eAQTC,yCAAwB;;;eAExBG,6CAAmB;;;eADnBF,uCAAyB;;;eACJG,qDAA2B;;;eADrBF,mCAAqB;;;2BAT/B,cAAc;iCAQC,oBAAoB;8BACI,iBAAiB;0CACjB,8BAA8B"}
|
|
@@ -3,17 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
useToastBodyBase_unstable: function() {
|
|
14
|
+
return useToastBodyBase_unstable;
|
|
15
|
+
},
|
|
16
|
+
useToastBody_unstable: function() {
|
|
9
17
|
return useToastBody_unstable;
|
|
10
18
|
}
|
|
11
19
|
});
|
|
12
20
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
21
|
const _toastContainerContext = require("../../contexts/toastContainerContext");
|
|
14
22
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
|
-
const
|
|
16
|
-
const backgroundAppearance = (0, _reactsharedcontexts.useBackgroundAppearance)();
|
|
23
|
+
const useToastBodyBase_unstable = (props, ref)=>{
|
|
17
24
|
const { bodyId } = (0, _toastContainerContext.useToastContainerContext)();
|
|
18
25
|
return {
|
|
19
26
|
components: {
|
|
@@ -32,7 +39,13 @@ const useToastBody_unstable = (props, ref)=>{
|
|
|
32
39
|
...props
|
|
33
40
|
}), {
|
|
34
41
|
elementType: 'div'
|
|
35
|
-
})
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const useToastBody_unstable = (props, ref)=>{
|
|
46
|
+
const backgroundAppearance = (0, _reactsharedcontexts.useBackgroundAppearance)();
|
|
47
|
+
return {
|
|
48
|
+
...useToastBodyBase_unstable(props, ref),
|
|
36
49
|
backgroundAppearance
|
|
37
50
|
};
|
|
38
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ToastBody/useToastBody.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastBodyProps, ToastBodyState } from './ToastBody.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render ToastBody
|
|
1
|
+
{"version":3,"sources":["../src/components/ToastBody/useToastBody.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ToastBodyBaseProps, ToastBodyBaseState, ToastBodyProps, ToastBodyState } from './ToastBody.types';\nimport { useToastContainerContext } from '../../contexts/toastContainerContext';\nimport { useBackgroundAppearance } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the base state required to render ToastBody, without design-only props.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */\nexport const useToastBodyBase_unstable = (\n props: ToastBodyBaseProps,\n ref: React.Ref<HTMLElement>,\n): ToastBodyBaseState => {\n const { bodyId } = useToastContainerContext();\n return {\n components: {\n root: 'div',\n subtitle: 'div',\n },\n subtitle: slot.optional(props.subtitle, { elementType: 'div' }),\n root: slot.always(\n 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 id: bodyId,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n};\n\n/**\n * Create the state required to render ToastBody.\n *\n * The returned state can be modified with hooks such as useToastBodyStyles_unstable,\n * before being passed to renderToastBody_unstable.\n *\n * @param props - props from this instance of ToastBody\n * @param ref - reference to root HTMLElement of ToastBody\n */\nexport const useToastBody_unstable = (props: ToastBodyProps, ref: React.Ref<HTMLElement>): ToastBodyState => {\n const backgroundAppearance = useBackgroundAppearance();\n return {\n ...useToastBodyBase_unstable(props, ref),\n backgroundAppearance,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useToastContainerContext","useBackgroundAppearance","useToastBodyBase_unstable","props","ref","bodyId","components","root","subtitle","optional","elementType","always","id","useToastBody_unstable","backgroundAppearance"],"mappings":"AAAA;;;;;;;;;;;;IAcaI,yBAAAA;;;yBAkCAW;;;;gCA7CkC,4BAA4B;uCAElC,uCAAuC;qCACxC,kCAAkC;AAQnE,kCAAkC,CACvCV,OACAC;IAEA,MAAM,EAAEC,MAAM,EAAE,OAAGL,+CAAAA;IACnB,OAAO;QACLM,YAAY;YACVC,MAAM;YACNC,UAAU;QACZ;QACAA,UAAUT,oBAAAA,CAAKU,QAAQ,CAACN,MAAMK,QAAQ,EAAE;YAAEE,aAAa;QAAM;QAC7DH,MAAMR,oBAAAA,CAAKY,MAAM,KACfb,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FM,KAAKA;YACLQ,IAAIP;YACJ,GAAGF,KAAK;QACV,IACA;YAAEO,aAAa;QAAM;IAEzB;AACF,EAAE;AAWK,MAAMG,wBAAwB,CAACV,OAAuBC;IAC3D,MAAMU,2BAAuBb,4CAAAA;IAC7B,OAAO;QACL,GAAGC,0BAA0BC,OAAOC,IAAI;QACxCU;IACF;AACF,EAAE"}
|
|
@@ -41,7 +41,6 @@ const useInvertedStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
41
41
|
]
|
|
42
42
|
});
|
|
43
43
|
const useToastBodyStyles_unstable = (state)=>{
|
|
44
|
-
'use no memo';
|
|
45
44
|
const rootBaseClassName = useRootBaseClassName();
|
|
46
45
|
const subtitleBaseClassName = useSubtitleBaseClassName();
|
|
47
46
|
const invertedStyles = useInvertedStyles();
|