diff --git a/change/@fluentui-contrib-react-tree-grid-80881ec7-8cac-46fe-9082-cf87ab48dbeb.json b/change/@fluentui-contrib-react-tree-grid-80881ec7-8cac-46fe-9082-cf87ab48dbeb.json new file mode 100644 index 00000000..90802b72 --- /dev/null +++ b/change/@fluentui-contrib-react-tree-grid-80881ec7-8cac-46fe-9082-cf87ab48dbeb.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "docs: adds calls example (contextual menu + hidden menu)", + "packageName": "@fluentui-contrib/react-tree-grid", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "none" +} diff --git a/packages/react-tree-grid/stories/Calls.stories.tsx b/packages/react-tree-grid/stories/Calls.stories.tsx new file mode 100644 index 00000000..c8b9fd14 --- /dev/null +++ b/packages/react-tree-grid/stories/Calls.stories.tsx @@ -0,0 +1,284 @@ +import * as React from 'react'; +import { + TreeGrid, + TreeGridCell, + TreeGridInteraction, + TreeGridRow, +} from '@fluentui-contrib/react-tree-grid'; +import { + Avatar, + Body1, + Button, + Caption1, + Input, + Menu, + MenuItem, + MenuList, + MenuPopover, + MenuTrigger, + Tab, + TabList, + makeStyles, + mergeClasses, + shorthands, + tokens, +} from '@fluentui/react-components'; +import { + CaretRightFilled, + CaretDownFilled, + MoreHorizontalFilled, + FilterFilled, + DismissFilled, +} from '@fluentui/react-icons'; + +const useStyles = makeStyles({ + cell: { + display: 'flex', + alignItems: 'center', + ...shorthands.padding(tokens.spacingVerticalM, tokens.spacingHorizontalM), + }, + row: { + display: 'flex', + flexDirection: 'row', + alignItems: 'center', + ':hover': { + '--moreActionsBtn-opacity': '1', + '--moreActionsBtn-position': 'relative', + }, + ':focus-within': { + '--moreActionsBtn-opacity': '1', + '--moreActionsBtn-position': 'relative', + }, + }, + historyRow: { + ...shorthands.borderBottom( + tokens.strokeWidthThin, + 'solid', + tokens.colorNeutralForeground2 + ), + }, + historyRowHeader: { + ...shorthands.flex(1, 1, 'auto'), + }, + descriptionCell: { + ...shorthands.flex(1, 1, 'auto'), + ...shorthands.padding(tokens.spacingVerticalM, tokens.spacingHorizontalL), + }, + + description: { + display: 'inline-flex', + flexDirection: 'column', + }, + grid: { + display: 'flex', + flexDirection: 'column', + }, + caption: { + whiteSpace: 'nowrap', + }, + moreActionsBtn: { + position: 'var(--moreActionsBtn-position, fixed)' as 'fixed' | 'unset', + opacity: 'var(--moreActionsBtn-opacity, 0)', + ':focus': { + opacity: '1', + position: 'relative', + }, + }, + moreActionsBtnVisible: { + opacity: '1', + position: 'relative', + }, + input: { + width: '100%', + }, +}); + +export const Calls = () => { + const styles = useStyles(); + return ( + + + + + + + + + ); +}; + +const HistoryCalls = (props: { children?: React.ReactNode }) => { + const styles = useStyles(); + const [open, setOpen] = React.useState(true); + const input = ( + <> + + + + + + + + + + + + All + Missed + Incoming + Voice Call + + + + +