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,53 @@
'use client';
import * as React from 'react';
import { slot } from '@fluentui/react-utilities';
import { useTreeContext_unstable } from '../../contexts';
import { treeAvatarSize } from '../../utils/tokens';
import { useTreeItemLayout_unstable } from '../TreeItemLayout/useTreeItemLayout';
import { Checkbox } from '@fluentui/react-checkbox';
import { Radio } from '@fluentui/react-radio';
/**
* Create the state required to render TreeItemPersonaLayout.
*
* The returned state can be modified with hooks such as useTreeItemPersonaLayoutStyles_unstable,
* before being passed to renderTreeItemPersonaLayout_unstable.
*
* @param props - props from this instance of TreeItemPersonaLayout
* @param ref - reference to root HTMLElement of TreeItemPersonaLayout
*/ export const useTreeItemPersonaLayout_unstable = (props, ref)=>{
const { media, children, main, description } = props;
const treeItemLayoutState = useTreeItemLayout_unstable({
...props,
iconBefore: null,
iconAfter: null
}, ref);
const size = useTreeContext_unstable((ctx)=>ctx.size);
const selectionMode = useTreeContext_unstable((ctx)=>ctx.selectionMode);
return {
...treeItemLayoutState,
components: {
expandIcon: 'div',
main: 'div',
description: 'div',
root: 'div',
media: 'div',
aside: 'div',
actions: 'div',
// Casting here to a union between checkbox and radio
selector: selectionMode === 'multiselect' ? Checkbox : Radio
},
avatarSize: treeAvatarSize[size],
main: slot.always(main, {
defaultProps: {
children
},
elementType: 'div'
}),
media: slot.always(media, {
elementType: 'div'
}),
description: slot.optional(description, {
elementType: 'div'
})
};
};