@fluentui-react-native/menu 0.4.0 → 0.5.2
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.json +76 -1
- package/CHANGELOG.md +31 -2
- package/lib/MenuItem/MenuItem.d.ts.map +1 -1
- package/lib/MenuItem/MenuItem.js +6 -19
- package/lib/MenuItem/MenuItem.js.map +1 -1
- package/lib/MenuItem/MenuItem.styling.d.ts +5 -0
- package/lib/MenuItem/MenuItem.styling.d.ts.map +1 -0
- package/lib/MenuItem/MenuItem.styling.js +26 -0
- package/lib/MenuItem/MenuItem.styling.js.map +1 -0
- package/lib/MenuItem/MenuItem.types.d.ts +6 -2
- package/lib/MenuItem/MenuItem.types.d.ts.map +1 -1
- package/lib/MenuItem/MenuItemTokens.d.ts +5 -0
- package/lib/MenuItem/MenuItemTokens.d.ts.map +1 -0
- package/lib/MenuItem/MenuItemTokens.js +26 -0
- package/lib/MenuItem/MenuItemTokens.js.map +1 -0
- package/lib/MenuItem/MenuItemTokens.win32.d.ts +5 -0
- package/lib/MenuItem/MenuItemTokens.win32.d.ts.map +1 -0
- package/lib/MenuItem/MenuItemTokens.win32.js +27 -0
- package/lib/MenuItem/MenuItemTokens.win32.js.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.d.ts +3 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.d.ts.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.js +20 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.styling.d.ts +5 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.styling.d.ts.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.styling.js +21 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.styling.js.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +43 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.types.d.ts.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.types.js +2 -0
- package/lib/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.d.ts +5 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.d.ts.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.js +26 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.js.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.win32.d.ts +5 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.win32.d.ts.map +1 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.win32.js +27 -0
- package/lib/MenuItemCheckbox/MenuItemCheckboxTokens.win32.js.map +1 -0
- package/lib/MenuItemCheckbox/useMenuItemCheckbox.d.ts +3 -0
- package/lib/MenuItemCheckbox/useMenuItemCheckbox.d.ts.map +1 -0
- package/lib/MenuItemCheckbox/useMenuItemCheckbox.js +25 -0
- package/lib/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -0
- package/lib/MenuList/MenuList.d.ts +4 -0
- package/lib/MenuList/MenuList.d.ts.map +1 -0
- package/lib/MenuList/MenuList.js +15 -0
- package/lib/MenuList/MenuList.js.map +1 -0
- package/lib/MenuList/MenuList.styling.d.ts +4 -0
- package/lib/MenuList/MenuList.styling.d.ts.map +1 -0
- package/lib/MenuList/MenuList.styling.js +14 -0
- package/lib/MenuList/MenuList.styling.js.map +1 -0
- package/lib/MenuList/MenuList.types.d.ts +17 -0
- package/lib/MenuList/MenuList.types.d.ts.map +1 -0
- package/lib/MenuList/MenuList.types.js +2 -0
- package/lib/MenuList/MenuList.types.js.map +1 -0
- package/lib/MenuList/MenuListTokens.d.ts +5 -0
- package/lib/MenuList/MenuListTokens.d.ts.map +1 -0
- package/lib/MenuList/MenuListTokens.js +8 -0
- package/lib/MenuList/MenuListTokens.js.map +1 -0
- package/lib/MenuList/MenuListTokens.win32.d.ts +5 -0
- package/lib/MenuList/MenuListTokens.win32.d.ts.map +1 -0
- package/lib/MenuList/MenuListTokens.win32.js +8 -0
- package/lib/MenuList/MenuListTokens.win32.js.map +1 -0
- package/lib/MenuPopover/MenuPopover.d.ts.map +1 -1
- package/lib/MenuPopover/MenuPopover.js +3 -2
- package/lib/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/MenuItem/MenuItem.d.ts.map +1 -1
- package/lib-commonjs/MenuItem/MenuItem.js +6 -19
- package/lib-commonjs/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/MenuItem/MenuItem.styling.d.ts +5 -0
- package/lib-commonjs/MenuItem/MenuItem.styling.d.ts.map +1 -0
- package/lib-commonjs/MenuItem/MenuItem.styling.js +29 -0
- package/lib-commonjs/MenuItem/MenuItem.styling.js.map +1 -0
- package/lib-commonjs/MenuItem/MenuItem.types.d.ts +6 -2
- package/lib-commonjs/MenuItem/MenuItem.types.d.ts.map +1 -1
- package/lib-commonjs/MenuItem/MenuItemTokens.d.ts +5 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.d.ts.map +1 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.js +30 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.js.map +1 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.win32.d.ts +5 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.win32.d.ts.map +1 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.win32.js +31 -0
- package/lib-commonjs/MenuItem/MenuItemTokens.win32.js.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.d.ts +3 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.d.ts.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.js +23 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.styling.d.ts +5 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.styling.d.ts.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.styling.js +24 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.styling.js.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +43 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.types.d.ts.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.types.js +5 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.d.ts +5 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.d.ts.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.js +30 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.js.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.win32.d.ts +5 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.win32.d.ts.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.win32.js +31 -0
- package/lib-commonjs/MenuItemCheckbox/MenuItemCheckboxTokens.win32.js.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/useMenuItemCheckbox.d.ts +3 -0
- package/lib-commonjs/MenuItemCheckbox/useMenuItemCheckbox.d.ts.map +1 -0
- package/lib-commonjs/MenuItemCheckbox/useMenuItemCheckbox.js +29 -0
- package/lib-commonjs/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -0
- package/lib-commonjs/MenuList/MenuList.d.ts +4 -0
- package/lib-commonjs/MenuList/MenuList.d.ts.map +1 -0
- package/lib-commonjs/MenuList/MenuList.js +18 -0
- package/lib-commonjs/MenuList/MenuList.js.map +1 -0
- package/lib-commonjs/MenuList/MenuList.styling.d.ts +4 -0
- package/lib-commonjs/MenuList/MenuList.styling.d.ts.map +1 -0
- package/lib-commonjs/MenuList/MenuList.styling.js +17 -0
- package/lib-commonjs/MenuList/MenuList.styling.js.map +1 -0
- package/lib-commonjs/MenuList/MenuList.types.d.ts +17 -0
- package/lib-commonjs/MenuList/MenuList.types.d.ts.map +1 -0
- package/lib-commonjs/MenuList/MenuList.types.js +5 -0
- package/lib-commonjs/MenuList/MenuList.types.js.map +1 -0
- package/lib-commonjs/MenuList/MenuListTokens.d.ts +5 -0
- package/lib-commonjs/MenuList/MenuListTokens.d.ts.map +1 -0
- package/lib-commonjs/MenuList/MenuListTokens.js +12 -0
- package/lib-commonjs/MenuList/MenuListTokens.js.map +1 -0
- package/lib-commonjs/MenuList/MenuListTokens.win32.d.ts +5 -0
- package/lib-commonjs/MenuList/MenuListTokens.win32.d.ts.map +1 -0
- package/lib-commonjs/MenuList/MenuListTokens.win32.js +12 -0
- package/lib-commonjs/MenuList/MenuListTokens.win32.js.map +1 -0
- package/lib-commonjs/MenuPopover/MenuPopover.d.ts.map +1 -1
- package/lib-commonjs/MenuPopover/MenuPopover.js +2 -1
- package/lib-commonjs/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -0
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +3 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +8 -6
- package/src/MenuItem/MenuItem.styling.ts +45 -0
- package/src/MenuItem/MenuItem.tsx +4 -12
- package/src/MenuItem/MenuItem.types.ts +7 -2
- package/src/MenuItem/MenuItemTokens.ts +29 -0
- package/src/MenuItem/MenuItemTokens.win32.ts +30 -0
- package/src/MenuItemCheckbox/MenuItemCheckbox.styling.ts +37 -0
- package/src/MenuItemCheckbox/MenuItemCheckbox.tsx +26 -0
- package/src/MenuItemCheckbox/MenuItemCheckbox.types.ts +52 -0
- package/src/MenuItemCheckbox/MenuItemCheckboxTokens.ts +29 -0
- package/src/MenuItemCheckbox/MenuItemCheckboxTokens.win32.ts +30 -0
- package/src/MenuItemCheckbox/useMenuItemCheckbox.ts +40 -0
- package/src/MenuList/MenuList.styling.ts +20 -0
- package/src/MenuList/MenuList.tsx +23 -0
- package/src/MenuList/MenuList.types.ts +17 -0
- package/src/MenuList/MenuListTokens.ts +11 -0
- package/src/MenuList/MenuListTokens.win32.ts +11 -0
- package/src/MenuPopover/MenuPopover.tsx +7 -2
- package/src/index.ts +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FontWeightValue, Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
3
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
4
|
+
import { MenuItemCheckboxTokens } from './MenuItemCheckbox.types';
|
|
5
|
+
|
|
6
|
+
export const defaultMenuItemCheckboxTokens: TokenSettings<MenuItemCheckboxTokens, Theme> = (t: Theme): MenuItemCheckboxTokens => ({
|
|
7
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
8
|
+
borderRadius: globalTokens.corner.radius.medium,
|
|
9
|
+
color: t.colors.neutralForeground2,
|
|
10
|
+
fontFamily: t.typography.families.primary,
|
|
11
|
+
fontSize: globalTokens.font.size[300],
|
|
12
|
+
fontWeight: globalTokens.font.weight.regular as FontWeightValue,
|
|
13
|
+
minHeight: 32,
|
|
14
|
+
minWidth: 160,
|
|
15
|
+
maxWidth: 300,
|
|
16
|
+
padding: globalTokens.spacing.sNudge,
|
|
17
|
+
hovered: {
|
|
18
|
+
backgroundColor: t.colors.neutralBackground1Hover,
|
|
19
|
+
color: t.colors.neutralForeground2Hover,
|
|
20
|
+
},
|
|
21
|
+
pressed: {
|
|
22
|
+
backgroundColor: t.colors.neutralBackground1Pressed,
|
|
23
|
+
color: t.colors.neutralForeground2Pressed,
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
27
|
+
color: t.colors.neutralForegroundDisabled,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FontWeightValue, Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
3
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
4
|
+
import { MenuItemCheckboxTokens } from './MenuItemCheckbox.types';
|
|
5
|
+
|
|
6
|
+
export const defaultMenuItemCheckboxTokens: TokenSettings<MenuItemCheckboxTokens, Theme> = (t: Theme): MenuItemCheckboxTokens => ({
|
|
7
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
8
|
+
borderRadius: globalTokens.corner.radius.none,
|
|
9
|
+
color: t.colors.neutralForeground1,
|
|
10
|
+
fontFamily: t.typography.families.primary,
|
|
11
|
+
fontSize: globalTokens.font.size[200],
|
|
12
|
+
fontWeight: globalTokens.font.weight.regular as FontWeightValue,
|
|
13
|
+
minHeight: 24,
|
|
14
|
+
minWidth: 160,
|
|
15
|
+
maxWidth: 300,
|
|
16
|
+
padding: globalTokens.spacing.xs,
|
|
17
|
+
paddingHorizontal: globalTokens.spacing.s,
|
|
18
|
+
hovered: {
|
|
19
|
+
backgroundColor: t.colors.neutralBackground1Hover,
|
|
20
|
+
color: t.colors.neutralForeground1Hover,
|
|
21
|
+
},
|
|
22
|
+
pressed: {
|
|
23
|
+
backgroundColor: t.colors.neutralBackground1Pressed,
|
|
24
|
+
color: t.colors.neutralForeground1Pressed,
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
28
|
+
color: t.colors.neutralForegroundDisabled,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AccessibilityState } from 'react-native';
|
|
3
|
+
import { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox.types';
|
|
4
|
+
import { memoize } from '@fluentui-react-native/framework';
|
|
5
|
+
import { useAsPressable, useKeyProps } from '@fluentui-react-native/interactive-hooks';
|
|
6
|
+
import { useMenuContext } from '../context/menuContext';
|
|
7
|
+
|
|
8
|
+
export const useMenuItemCheckbox = (props: MenuItemCheckboxProps): MenuItemCheckboxState => {
|
|
9
|
+
// attach the pressable state handlers
|
|
10
|
+
const defaultComponentRef = React.useRef(null);
|
|
11
|
+
const { onClick, accessibilityState, componentRef = defaultComponentRef, disabled, ...rest } = props;
|
|
12
|
+
const pressable = useAsPressable({ ...rest, disabled, onPress: onClick });
|
|
13
|
+
const onKeyProps = useKeyProps(onClick, ' ', 'Enter');
|
|
14
|
+
const hasSubmenu = useMenuContext().isSubmenu;
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
props: {
|
|
18
|
+
...pressable.props,
|
|
19
|
+
accessible: true,
|
|
20
|
+
accessibilityRole: 'button',
|
|
21
|
+
onAccessibilityTap: props.onAccessibilityTap || props.onClick,
|
|
22
|
+
accessibilityLabel: props.accessibilityLabel,
|
|
23
|
+
accessibilityState: getAccessibilityState(disabled, accessibilityState),
|
|
24
|
+
enableFocusRing: true,
|
|
25
|
+
focusable: !disabled,
|
|
26
|
+
hasSubmenu,
|
|
27
|
+
ref: componentRef,
|
|
28
|
+
...onKeyProps,
|
|
29
|
+
},
|
|
30
|
+
state: pressable.state,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const getAccessibilityState = memoize(getAccessibilityStateWorker);
|
|
35
|
+
function getAccessibilityStateWorker(disabled: boolean, accessibilityState?: AccessibilityState) {
|
|
36
|
+
if (accessibilityState) {
|
|
37
|
+
return { disabled, ...accessibilityState };
|
|
38
|
+
}
|
|
39
|
+
return { disabled };
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Theme, UseStylingOptions, buildProps } from '@fluentui-react-native/framework';
|
|
2
|
+
import { layoutStyles } from '@fluentui-react-native/tokens';
|
|
3
|
+
import { defaultMenuListTokens } from './MenuListTokens';
|
|
4
|
+
import { menuListName, MenuListProps, MenuListTokens, MenuListSlotProps } from './MenuList.types';
|
|
5
|
+
|
|
6
|
+
export const stylingSettings: UseStylingOptions<MenuListProps, MenuListSlotProps, MenuListTokens> = {
|
|
7
|
+
tokens: [defaultMenuListTokens, menuListName],
|
|
8
|
+
slotProps: {
|
|
9
|
+
root: buildProps(
|
|
10
|
+
(tokens: MenuListTokens, theme: Theme) => ({
|
|
11
|
+
style: {
|
|
12
|
+
backgroundColor: tokens.backgroundColor,
|
|
13
|
+
display: 'flex',
|
|
14
|
+
...layoutStyles.from(tokens, theme),
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
['backgroundColor', ...layoutStyles.keys],
|
|
18
|
+
),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsx withSlots */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { compose, UseSlots, withSlots } from '@fluentui-react-native/framework';
|
|
5
|
+
import { menuListName, MenuListProps, MenuListType } from './MenuList.types';
|
|
6
|
+
import { stylingSettings } from './MenuList.styling';
|
|
7
|
+
|
|
8
|
+
export const MenuList = compose<MenuListType>({
|
|
9
|
+
displayName: menuListName,
|
|
10
|
+
...stylingSettings,
|
|
11
|
+
slots: {
|
|
12
|
+
root: View,
|
|
13
|
+
},
|
|
14
|
+
useRender: (userProps: MenuListProps, useSlots: UseSlots<MenuListType>) => {
|
|
15
|
+
const Slots = useSlots(userProps);
|
|
16
|
+
|
|
17
|
+
return (_final: MenuListProps, children: React.ReactNode) => {
|
|
18
|
+
return <Slots.root>{children}</Slots.root>;
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default MenuList;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
2
|
+
import { IBackgroundColorTokens, LayoutTokens } from '@fluentui-react-native/tokens';
|
|
3
|
+
|
|
4
|
+
export const menuListName = 'MenuList';
|
|
5
|
+
|
|
6
|
+
export interface MenuListTokens extends LayoutTokens, IBackgroundColorTokens {}
|
|
7
|
+
|
|
8
|
+
export interface MenuListProps extends Omit<IViewProps, 'onPress'> {}
|
|
9
|
+
|
|
10
|
+
export interface MenuListSlotProps {
|
|
11
|
+
root: React.PropsWithRef<IViewProps>;
|
|
12
|
+
}
|
|
13
|
+
export interface MenuListType {
|
|
14
|
+
props: MenuListProps;
|
|
15
|
+
tokens: MenuListTokens;
|
|
16
|
+
slotProps: MenuListSlotProps;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
3
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
4
|
+
import { MenuListTokens } from './MenuList.types';
|
|
5
|
+
|
|
6
|
+
export const defaultMenuListTokens: TokenSettings<MenuListTokens, Theme> = (t: Theme): MenuListTokens => ({
|
|
7
|
+
padding: globalTokens.spacing.xs,
|
|
8
|
+
minWidth: 128,
|
|
9
|
+
maxWidth: 300,
|
|
10
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
3
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
4
|
+
import { MenuListTokens } from './MenuList.types';
|
|
5
|
+
|
|
6
|
+
export const defaultMenuListTokens: TokenSettings<MenuListTokens, Theme> = (t: Theme): MenuListTokens => ({
|
|
7
|
+
paddingVertical: globalTokens.spacing.xs,
|
|
8
|
+
minWidth: 128,
|
|
9
|
+
maxWidth: 300,
|
|
10
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
11
|
+
});
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { stagedComponent } from '@fluentui-react-native/framework';
|
|
2
|
+
import { stagedComponent, useFluentTheme } from '@fluentui-react-native/framework';
|
|
3
3
|
import { Callout } from '@fluentui-react-native/callout';
|
|
4
4
|
import { menuPopoverName, MenuPopoverProps } from './MenuPopover.types';
|
|
5
5
|
import { useMenuPopover } from './useMenuPopover';
|
|
6
6
|
|
|
7
7
|
export const MenuPopover = stagedComponent((props: MenuPopoverProps) => {
|
|
8
8
|
const state = useMenuPopover(props);
|
|
9
|
+
const theme = useFluentTheme();
|
|
9
10
|
|
|
10
11
|
return (_rest: MenuPopoverProps, children: React.ReactNode) => {
|
|
11
|
-
return
|
|
12
|
+
return (
|
|
13
|
+
<Callout target={state.triggerRef} borderWidth={1} borderColor={theme.colors.neutralStrokeAccessible}>
|
|
14
|
+
{children}
|
|
15
|
+
</Callout>
|
|
16
|
+
);
|
|
12
17
|
};
|
|
13
18
|
});
|
|
14
19
|
MenuPopover.displayName = menuPopoverName;
|
package/src/index.ts
CHANGED