Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,33 @@
import * as React from 'react';
/**
* Guard method that validates if a shorthand is a slot
* can be used to extends properties provided by a slot
*
* @example
* ```
* const backdropSlot = resolveShorthand(backdrop, {
* defaultProps: {
* onClick: useEventCallback(event => {
* if (isResolvedShorthand(backdrop)) {
* backdrop.onClick?.(event)
* }
* // do something after passing click down the line
* }),
* },
* })
* ```
* @example
* ```
* const handleBackDropClick = (event) => {
* // do your thing
* }
* const backdropSlot = resolveShorthand(backdrop, {
* defaultProps: {
* onClick: useEventCallback(
* mergeCallbacks(isResolvedShorthand(backdrop) ? backdrop.onClick : undefined, handleBackdropClick)
* )
* })
* ```
*/ export function isResolvedShorthand(shorthand) {
return shorthand !== null && typeof shorthand === 'object' && !Array.isArray(shorthand) && !React.isValidElement(shorthand);
}