@fluentui-react-native/menu 0.4.0 → 0.5.0
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 +46 -1
- package/CHANGELOG.md +15 -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/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/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/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
|
@@ -4,9 +4,13 @@ import { SvgProps, XmlProps } from 'react-native-svg';
|
|
|
4
4
|
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
5
5
|
import { TextProps } from '@fluentui-react-native/experimental-text';
|
|
6
6
|
import { IFocusable, InteractionEvent, IPressableHooks, IWithPressableOptions } from '@fluentui-react-native/interactive-hooks';
|
|
7
|
-
import { FontTokens, IBorderTokens, IColorTokens,
|
|
7
|
+
import { FontTokens, IBorderTokens, IColorTokens, LayoutTokens } from '@fluentui-react-native/tokens';
|
|
8
8
|
export declare const menuItemName = "MenuItem";
|
|
9
|
-
export interface MenuItemTokens extends LayoutTokens, FontTokens, IBorderTokens,
|
|
9
|
+
export interface MenuItemTokens extends LayoutTokens, FontTokens, IBorderTokens, IColorTokens {
|
|
10
|
+
disabled?: MenuItemTokens;
|
|
11
|
+
focused?: MenuItemTokens;
|
|
12
|
+
hovered?: MenuItemTokens;
|
|
13
|
+
pressed?: MenuItemTokens;
|
|
10
14
|
}
|
|
11
15
|
export interface MenuItemProps extends Omit<IWithPressableOptions<ViewProps>, 'onPress'> {
|
|
12
16
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.types.d.ts","sourceRoot":"","sources":["../../src/MenuItem/MenuItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAChI,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"MenuItem.types.d.ts","sourceRoot":"","sources":["../../src/MenuItem/MenuItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAChI,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAEtG,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,MAAM,WAAW,cAAe,SAAQ,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY;IAC3F,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtF,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAE3C;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACzC;AAED,oBAAY,aAAa,GAAG,eAAe,CAAC,aAAa,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;CAC9B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
3
|
+
import { MenuItemTokens } from './MenuItem.types';
|
|
4
|
+
export declare const defaultMenuItemTokens: TokenSettings<MenuItemTokens, Theme>;
|
|
5
|
+
//# sourceMappingURL=MenuItemTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemTokens.d.ts","sourceRoot":"","sources":["../../src/MenuItem/MenuItemTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,CAuBrE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultMenuItemTokens = void 0;
|
|
4
|
+
var theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
|
|
5
|
+
var defaultMenuItemTokens = function (t) { return ({
|
|
6
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
7
|
+
borderRadius: theme_tokens_1.globalTokens.corner.radius.medium,
|
|
8
|
+
color: t.colors.neutralForeground2,
|
|
9
|
+
fontFamily: t.typography.families.primary,
|
|
10
|
+
fontSize: theme_tokens_1.globalTokens.font.size[300],
|
|
11
|
+
fontWeight: theme_tokens_1.globalTokens.font.weight.regular,
|
|
12
|
+
minHeight: 32,
|
|
13
|
+
minWidth: 160,
|
|
14
|
+
maxWidth: 300,
|
|
15
|
+
padding: theme_tokens_1.globalTokens.spacing.sNudge,
|
|
16
|
+
hovered: {
|
|
17
|
+
backgroundColor: t.colors.neutralBackground1Hover,
|
|
18
|
+
color: t.colors.neutralForeground2Hover,
|
|
19
|
+
},
|
|
20
|
+
pressed: {
|
|
21
|
+
backgroundColor: t.colors.neutralBackground1Pressed,
|
|
22
|
+
color: t.colors.neutralForeground2Pressed,
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
26
|
+
color: t.colors.neutralForegroundDisabled,
|
|
27
|
+
},
|
|
28
|
+
}); };
|
|
29
|
+
exports.defaultMenuItemTokens = defaultMenuItemTokens;
|
|
30
|
+
//# sourceMappingURL=MenuItemTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemTokens.js","sourceRoot":"","sources":["../../src/MenuItem/MenuItemTokens.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAI5D,IAAM,qBAAqB,GAAyC,UAAC,CAAQ,IAAqB,OAAA,CAAC;IACxG,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAC5C,YAAY,EAAE,2BAAY,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAClC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO;IACzC,QAAQ,EAAE,2BAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACrC,UAAU,EAAE,2BAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAA0B;IAC/D,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,2BAAY,CAAC,OAAO,CAAC,MAAM;IACpC,OAAO,EAAE;QACP,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,uBAAuB;QACjD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,uBAAuB;KACxC;IACD,OAAO,EAAE;QACP,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;QACnD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;KAC1C;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;QAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;KAC1C;CACF,CAAC,EAvBuG,CAuBvG,CAAC;AAvBU,QAAA,qBAAqB,yBAuB/B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
3
|
+
import { MenuItemTokens } from './MenuItem.types';
|
|
4
|
+
export declare const defaultMenuItemTokens: TokenSettings<MenuItemTokens, Theme>;
|
|
5
|
+
//# sourceMappingURL=MenuItemTokens.win32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemTokens.win32.d.ts","sourceRoot":"","sources":["../../src/MenuItem/MenuItemTokens.win32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,CAwBrE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultMenuItemTokens = void 0;
|
|
4
|
+
var theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
|
|
5
|
+
var defaultMenuItemTokens = function (t) { return ({
|
|
6
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
7
|
+
borderRadius: theme_tokens_1.globalTokens.corner.radius.none,
|
|
8
|
+
color: t.colors.neutralForeground1,
|
|
9
|
+
fontFamily: t.typography.families.primary,
|
|
10
|
+
fontSize: theme_tokens_1.globalTokens.font.size[200],
|
|
11
|
+
fontWeight: theme_tokens_1.globalTokens.font.weight.regular,
|
|
12
|
+
minHeight: 24,
|
|
13
|
+
minWidth: 160,
|
|
14
|
+
maxWidth: 300,
|
|
15
|
+
padding: theme_tokens_1.globalTokens.spacing.xs,
|
|
16
|
+
paddingHorizontal: theme_tokens_1.globalTokens.spacing.s,
|
|
17
|
+
hovered: {
|
|
18
|
+
backgroundColor: t.colors.neutralBackground1Hover,
|
|
19
|
+
color: t.colors.neutralForeground1Hover,
|
|
20
|
+
},
|
|
21
|
+
pressed: {
|
|
22
|
+
backgroundColor: t.colors.neutralBackground1Pressed,
|
|
23
|
+
color: t.colors.neutralForeground1Pressed,
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
27
|
+
color: t.colors.neutralForegroundDisabled,
|
|
28
|
+
},
|
|
29
|
+
}); };
|
|
30
|
+
exports.defaultMenuItemTokens = defaultMenuItemTokens;
|
|
31
|
+
//# sourceMappingURL=MenuItemTokens.win32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemTokens.win32.js","sourceRoot":"","sources":["../../src/MenuItem/MenuItemTokens.win32.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAI5D,IAAM,qBAAqB,GAAyC,UAAC,CAAQ,IAAqB,OAAA,CAAC;IACxG,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAC5C,YAAY,EAAE,2BAAY,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAClC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO;IACzC,QAAQ,EAAE,2BAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACrC,UAAU,EAAE,2BAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAA0B;IAC/D,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,2BAAY,CAAC,OAAO,CAAC,EAAE;IAChC,iBAAiB,EAAE,2BAAY,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,EAAE;QACP,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,uBAAuB;QACjD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,uBAAuB;KACxC;IACD,OAAO,EAAE;QACP,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;QACnD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;KAC1C;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;QAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;KAC1C;CACF,CAAC,EAxBuG,CAwBvG,CAAC;AAxBU,QAAA,qBAAqB,yBAwB/B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MenuListProps } from './MenuList.types';
|
|
2
|
+
export declare const MenuList: import("@fluentui-react-native/framework").ComposableComponent<MenuListProps, import("./MenuList.types").MenuListSlotProps, import("./MenuList.types").MenuListTokens, object>;
|
|
3
|
+
export default MenuList;
|
|
4
|
+
//# sourceMappingURL=MenuList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAG7E,eAAO,MAAM,QAAQ,gLAanB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MenuList = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_native_1 = require("react-native");
|
|
6
|
+
var framework_1 = require("@fluentui-react-native/framework");
|
|
7
|
+
var MenuList_types_1 = require("./MenuList.types");
|
|
8
|
+
var MenuList_styling_1 = require("./MenuList.styling");
|
|
9
|
+
exports.MenuList = (0, framework_1.compose)((0, tslib_1.__assign)((0, tslib_1.__assign)({ displayName: MenuList_types_1.menuListName }, MenuList_styling_1.stylingSettings), { slots: {
|
|
10
|
+
root: react_native_1.View,
|
|
11
|
+
}, useRender: function (userProps, useSlots) {
|
|
12
|
+
var Slots = useSlots(userProps);
|
|
13
|
+
return function (_final, children) {
|
|
14
|
+
return (0, framework_1.withSlots)(Slots.root, null, children);
|
|
15
|
+
};
|
|
16
|
+
} }));
|
|
17
|
+
exports.default = exports.MenuList;
|
|
18
|
+
//# sourceMappingURL=MenuList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;AAEA,6CAAoC;AACpC,8DAAgF;AAChF,mDAA6E;AAC7E,uDAAqD;AAExC,QAAA,QAAQ,GAAG,IAAA,mBAAO,gDAC7B,WAAW,EAAE,6BAAY,IACtB,kCAAe,KAClB,KAAK,EAAE;QACL,IAAI,EAAE,mBAAI;KACX,EACD,SAAS,EAAE,UAAC,SAAwB,EAAE,QAAgC;QACpE,IAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;QAElC,OAAO,UAAC,MAAqB,EAAE,QAAyB;YACtD,OAAO,2BAAC,KAAK,CAAC,IAAI,QAAE,QAAQ,CAAc,CAAC;QAC7C,CAAC,CAAC;IACJ,CAAC,IACD,CAAC;AAEH,kBAAe,gBAAQ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UseStylingOptions } from '@fluentui-react-native/framework';
|
|
2
|
+
import { MenuListProps, MenuListTokens, MenuListSlotProps } from './MenuList.types';
|
|
3
|
+
export declare const stylingSettings: UseStylingOptions<MenuListProps, MenuListSlotProps, MenuListTokens>;
|
|
4
|
+
//# sourceMappingURL=MenuList.styling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.styling.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,iBAAiB,EAAc,MAAM,kCAAkC,CAAC;AAGxF,OAAO,EAAgB,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAElG,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,CAc/F,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stylingSettings = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var framework_1 = require("@fluentui-react-native/framework");
|
|
6
|
+
var tokens_1 = require("@fluentui-react-native/tokens");
|
|
7
|
+
var MenuListTokens_1 = require("./MenuListTokens");
|
|
8
|
+
var MenuList_types_1 = require("./MenuList.types");
|
|
9
|
+
exports.stylingSettings = {
|
|
10
|
+
tokens: [MenuListTokens_1.defaultMenuListTokens, MenuList_types_1.menuListName],
|
|
11
|
+
slotProps: {
|
|
12
|
+
root: (0, framework_1.buildProps)(function (tokens, theme) { return ({
|
|
13
|
+
style: (0, tslib_1.__assign)({ backgroundColor: tokens.backgroundColor, display: 'flex' }, tokens_1.layoutStyles.from(tokens, theme)),
|
|
14
|
+
}); }, (0, tslib_1.__spreadArray)(['backgroundColor'], tokens_1.layoutStyles.keys, true)),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=MenuList.styling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.styling.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":";;;;AAAA,8DAAwF;AACxF,wDAA6D;AAC7D,mDAAyD;AACzD,mDAAkG;AAErF,QAAA,eAAe,GAAwE;IAClG,MAAM,EAAE,CAAC,sCAAqB,EAAE,6BAAY,CAAC;IAC7C,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EACd,UAAC,MAAsB,EAAE,KAAY,IAAK,OAAA,CAAC;YACzC,KAAK,0BACH,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,OAAO,EAAE,MAAM,IACZ,qBAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CACpC;SACF,CAAC,EANwC,CAMxC,8BACD,iBAAiB,GAAK,qBAAY,CAAC,IAAI,QACzC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
3
|
+
import { IBackgroundColorTokens, LayoutTokens } from '@fluentui-react-native/tokens';
|
|
4
|
+
export declare const menuListName = "MenuList";
|
|
5
|
+
export interface MenuListTokens extends LayoutTokens, IBackgroundColorTokens {
|
|
6
|
+
}
|
|
7
|
+
export interface MenuListProps extends Omit<IViewProps, 'onPress'> {
|
|
8
|
+
}
|
|
9
|
+
export interface MenuListSlotProps {
|
|
10
|
+
root: React.PropsWithRef<IViewProps>;
|
|
11
|
+
}
|
|
12
|
+
export interface MenuListType {
|
|
13
|
+
props: MenuListProps;
|
|
14
|
+
tokens: MenuListTokens;
|
|
15
|
+
slotProps: MenuListSlotProps;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=MenuList.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.types.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAErF,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,MAAM,WAAW,cAAe,SAAQ,YAAY,EAAE,sBAAsB;CAAG;AAE/E,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC;CAAG;AAErE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;CACtC;AACD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuList.types.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.types.ts"],"names":[],"mappings":";;;AAGa,QAAA,YAAY,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
3
|
+
import { MenuListTokens } from './MenuList.types';
|
|
4
|
+
export declare const defaultMenuListTokens: TokenSettings<MenuListTokens, Theme>;
|
|
5
|
+
//# sourceMappingURL=MenuListTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuListTokens.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuListTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,CAKrE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultMenuListTokens = void 0;
|
|
4
|
+
var theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
|
|
5
|
+
var defaultMenuListTokens = function (t) { return ({
|
|
6
|
+
padding: theme_tokens_1.globalTokens.spacing.xs,
|
|
7
|
+
minWidth: 128,
|
|
8
|
+
maxWidth: 300,
|
|
9
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
10
|
+
}); };
|
|
11
|
+
exports.defaultMenuListTokens = defaultMenuListTokens;
|
|
12
|
+
//# sourceMappingURL=MenuListTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuListTokens.js","sourceRoot":"","sources":["../../src/MenuList/MenuListTokens.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAI5D,IAAM,qBAAqB,GAAyC,UAAC,CAAQ,IAAqB,OAAA,CAAC;IACxG,OAAO,EAAE,2BAAY,CAAC,OAAO,CAAC,EAAE;IAChC,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;CAC7C,CAAC,EALuG,CAKvG,CAAC;AALU,QAAA,qBAAqB,yBAK/B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
3
|
+
import { MenuListTokens } from './MenuList.types';
|
|
4
|
+
export declare const defaultMenuListTokens: TokenSettings<MenuListTokens, Theme>;
|
|
5
|
+
//# sourceMappingURL=MenuListTokens.win32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuListTokens.win32.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuListTokens.win32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,CAKrE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultMenuListTokens = void 0;
|
|
4
|
+
var theme_tokens_1 = require("@fluentui-react-native/theme-tokens");
|
|
5
|
+
var defaultMenuListTokens = function (t) { return ({
|
|
6
|
+
paddingVertical: theme_tokens_1.globalTokens.spacing.xs,
|
|
7
|
+
minWidth: 128,
|
|
8
|
+
maxWidth: 300,
|
|
9
|
+
backgroundColor: t.colors.neutralBackground1,
|
|
10
|
+
}); };
|
|
11
|
+
exports.defaultMenuListTokens = defaultMenuListTokens;
|
|
12
|
+
//# sourceMappingURL=MenuListTokens.win32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuListTokens.win32.js","sourceRoot":"","sources":["../../src/MenuList/MenuListTokens.win32.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAI5D,IAAM,qBAAqB,GAAyC,UAAC,CAAQ,IAAqB,OAAA,CAAC;IACxG,eAAe,EAAE,2BAAY,CAAC,OAAO,CAAC,EAAE;IACxC,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;CAC7C,CAAC,EALuG,CAKvG,CAAC;AALU,QAAA,qBAAqB,yBAK/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuPopover.d.ts","sourceRoot":"","sources":["../../src/MenuPopover/MenuPopover.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGxE,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"MenuPopover.d.ts","sourceRoot":"","sources":["../../src/MenuPopover/MenuPopover.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGxE,eAAO,MAAM,WAAW,iFAWtB,CAAC;AAGH,eAAe,WAAW,CAAC"}
|
|
@@ -9,8 +9,9 @@ var MenuPopover_types_1 = require("./MenuPopover.types");
|
|
|
9
9
|
var useMenuPopover_1 = require("./useMenuPopover");
|
|
10
10
|
exports.MenuPopover = (0, framework_1.stagedComponent)(function (props) {
|
|
11
11
|
var state = (0, useMenuPopover_1.useMenuPopover)(props);
|
|
12
|
+
var theme = (0, framework_1.useFluentTheme)();
|
|
12
13
|
return function (_rest, children) {
|
|
13
|
-
return react_1.default.createElement(callout_1.Callout, { target: state.triggerRef }, children);
|
|
14
|
+
return (react_1.default.createElement(callout_1.Callout, { target: state.triggerRef, borderWidth: 1, borderColor: theme.colors.neutralStrokeAccessible }, children));
|
|
14
15
|
};
|
|
15
16
|
});
|
|
16
17
|
exports.MenuPopover.displayName = MenuPopover_types_1.menuPopoverName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuPopover.js","sourceRoot":"","sources":["../../src/MenuPopover/MenuPopover.tsx"],"names":[],"mappings":";;;;AAAA,6DAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"MenuPopover.js","sourceRoot":"","sources":["../../src/MenuPopover/MenuPopover.tsx"],"names":[],"mappings":";;;;AAAA,6DAA0B;AAC1B,8DAAmF;AACnF,0DAAyD;AACzD,yDAAwE;AACxE,mDAAkD;AAErC,QAAA,WAAW,GAAG,IAAA,2BAAe,EAAC,UAAC,KAAuB;IACjE,IAAM,KAAK,GAAG,IAAA,+BAAc,EAAC,KAAK,CAAC,CAAC;IACpC,IAAM,KAAK,GAAG,IAAA,0BAAc,GAAE,CAAC;IAE/B,OAAO,UAAC,KAAuB,EAAE,QAAyB;QACxD,OAAO,CACL,8BAAC,iBAAO,IAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB,IACjG,QAAQ,CACD,CACX,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,mBAAW,CAAC,WAAW,GAAG,mCAAe,CAAC;AAE1C,kBAAe,mBAAW,CAAC"}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { Menu } from './Menu/Menu';
|
|
|
2
2
|
export { MenuTrigger } from './MenuTrigger/MenuTrigger';
|
|
3
3
|
export { MenuPopover } from './MenuPopover/MenuPopover';
|
|
4
4
|
export { MenuItem } from './MenuItem/MenuItem';
|
|
5
|
+
export { MenuList } from './MenuList/MenuList';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuItem = exports.MenuPopover = exports.MenuTrigger = exports.Menu = void 0;
|
|
3
|
+
exports.MenuList = exports.MenuItem = exports.MenuPopover = exports.MenuTrigger = exports.Menu = void 0;
|
|
4
4
|
var Menu_1 = require("./Menu/Menu");
|
|
5
5
|
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return Menu_1.Menu; } });
|
|
6
6
|
var MenuTrigger_1 = require("./MenuTrigger/MenuTrigger");
|
|
@@ -9,4 +9,6 @@ var MenuPopover_1 = require("./MenuPopover/MenuPopover");
|
|
|
9
9
|
Object.defineProperty(exports, "MenuPopover", { enumerable: true, get: function () { return MenuPopover_1.MenuPopover; } });
|
|
10
10
|
var MenuItem_1 = require("./MenuItem/MenuItem");
|
|
11
11
|
Object.defineProperty(exports, "MenuItem", { enumerable: true, get: function () { return MenuItem_1.MenuItem; } });
|
|
12
|
+
var MenuList_1 = require("./MenuList/MenuList");
|
|
13
|
+
Object.defineProperty(exports, "MenuList", { enumerable: true, get: function () { return MenuList_1.MenuList; } });
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,yDAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,yDAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,gDAA+C;AAAtC,oGAAA,QAAQ,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,yDAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,yDAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,gDAA+C;AAAtC,oGAAA,QAAQ,OAAA;AACjB,gDAA+C;AAAtC,oGAAA,QAAQ,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A cross-platform Menu component using the Fluent Design System",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@fluentui-react-native/adapters": ">=0.8.5 <1.0.0",
|
|
26
|
-
"@fluentui-react-native/callout": ">=0.19.
|
|
27
|
-
"@fluentui-react-native/experimental-text": ">=0.7.
|
|
28
|
-
"@fluentui-react-native/framework": "0.7.
|
|
29
|
-
"@fluentui-react-native/interactive-hooks": ">=0.15.
|
|
30
|
-
"@fluentui-react-native/tokens": ">=0.
|
|
26
|
+
"@fluentui-react-native/callout": ">=0.19.46 <1.0.0",
|
|
27
|
+
"@fluentui-react-native/experimental-text": ">=0.7.26 <1.0.0",
|
|
28
|
+
"@fluentui-react-native/framework": "0.7.26",
|
|
29
|
+
"@fluentui-react-native/interactive-hooks": ">=0.15.6 <1.0.0",
|
|
30
|
+
"@fluentui-react-native/theme-tokens": ">=0.16.2 <1.0.0",
|
|
31
|
+
"@fluentui-react-native/tokens": ">=0.12.0 <1.0.0",
|
|
32
|
+
"@fluentui-react-native/use-styling": ">=0.8.3 <1.0.0",
|
|
31
33
|
"react-native-svg": "^12.3.0",
|
|
32
34
|
"tslib": "^2.3.1"
|
|
33
35
|
},
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Theme, UseStylingOptions, buildProps } from '@fluentui-react-native/framework';
|
|
2
|
+
import { fontStyles, layoutStyles } from '@fluentui-react-native/tokens';
|
|
3
|
+
import { defaultMenuItemTokens } from './MenuItemTokens';
|
|
4
|
+
import { menuItemName, MenuItemProps, MenuItemTokens, MenuItemSlotProps } from './MenuItem.types';
|
|
5
|
+
|
|
6
|
+
export const menuItemStates: (keyof MenuItemTokens)[] = ['hovered', 'focused', 'pressed', 'disabled'];
|
|
7
|
+
|
|
8
|
+
export const stylingSettings: UseStylingOptions<MenuItemProps, MenuItemSlotProps, MenuItemTokens> = {
|
|
9
|
+
tokens: [defaultMenuItemTokens, menuItemName],
|
|
10
|
+
states: menuItemStates,
|
|
11
|
+
slotProps: {
|
|
12
|
+
root: buildProps(
|
|
13
|
+
(tokens: MenuItemTokens, theme: Theme) => ({
|
|
14
|
+
style: {
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
backgroundColor: tokens.backgroundColor,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
...layoutStyles.from(tokens, theme),
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
['backgroundColor', ...layoutStyles.keys],
|
|
23
|
+
),
|
|
24
|
+
content: buildProps(
|
|
25
|
+
(tokens: MenuItemTokens, theme: Theme) => {
|
|
26
|
+
return {
|
|
27
|
+
style: {
|
|
28
|
+
flexGrow: 1,
|
|
29
|
+
color: tokens.color,
|
|
30
|
+
...fontStyles.from(tokens, theme),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
['color', ...fontStyles.keys],
|
|
35
|
+
),
|
|
36
|
+
submenuIndicator: buildProps(
|
|
37
|
+
(tokens: MenuItemTokens) => {
|
|
38
|
+
return {
|
|
39
|
+
color: tokens.color,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
['color'],
|
|
43
|
+
),
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -5,18 +5,11 @@ import { compose, mergeProps, UseSlots, withSlots } from '@fluentui-react-native
|
|
|
5
5
|
import { Text } from '@fluentui-react-native/experimental-text';
|
|
6
6
|
import { menuItemName, MenuItemProps, MenuItemType } from './MenuItem.types';
|
|
7
7
|
import { useMenuItem } from './useMenuItem';
|
|
8
|
+
import { stylingSettings } from './MenuItem.styling';
|
|
8
9
|
|
|
9
10
|
export const MenuItem = compose<MenuItemType>({
|
|
10
11
|
displayName: menuItemName,
|
|
11
|
-
|
|
12
|
-
slotProps: {
|
|
13
|
-
root: {
|
|
14
|
-
style: { height: 48, width: 200, flexDirection: 'row', alignItems: 'center', backgroundColor: 'transparent' },
|
|
15
|
-
},
|
|
16
|
-
content: {
|
|
17
|
-
color: 'white',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
12
|
+
...stylingSettings,
|
|
20
13
|
slots: {
|
|
21
14
|
root: View,
|
|
22
15
|
content: Text,
|
|
@@ -24,14 +17,13 @@ export const MenuItem = compose<MenuItemType>({
|
|
|
24
17
|
},
|
|
25
18
|
useRender: (userProps: MenuItemProps, useSlots: UseSlots<MenuItemType>) => {
|
|
26
19
|
const menuItem = useMenuItem(userProps);
|
|
27
|
-
|
|
28
|
-
const Slots = useSlots(userProps);
|
|
20
|
+
const Slots = useSlots(userProps, (layer): boolean => menuItem.state[layer]);
|
|
29
21
|
|
|
30
22
|
return (final: MenuItemProps) => {
|
|
31
23
|
const mergedProps = mergeProps(menuItem.props, final);
|
|
32
24
|
const chevronXml = `
|
|
33
25
|
<svg width="12" height="16" viewBox="0 0 11 6">
|
|
34
|
-
<path fill='
|
|
26
|
+
<path fill='currentColor' d='M0.646447 0.646447C0.841709 0.451184 1.15829 0.451184 1.35355 0.646447L5.5 4.79289L9.64645 0.646447C9.84171 0.451185 10.1583 0.451185 10.3536 0.646447C10.5488 0.841709 10.5488 1.15829 10.3536 1.35355L5.85355 5.85355C5.65829 6.04882 5.34171 6.04882 5.14645 5.85355L0.646447 1.35355C0.451184 1.15829 0.451184 0.841709 0.646447 0.646447Z' />
|
|
35
27
|
</svg>`;
|
|
36
28
|
|
|
37
29
|
return (
|
|
@@ -4,11 +4,16 @@ import { SvgProps, XmlProps } from 'react-native-svg';
|
|
|
4
4
|
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
5
5
|
import { TextProps } from '@fluentui-react-native/experimental-text';
|
|
6
6
|
import { IFocusable, InteractionEvent, IPressableHooks, IWithPressableOptions } from '@fluentui-react-native/interactive-hooks';
|
|
7
|
-
import { FontTokens, IBorderTokens, IColorTokens,
|
|
7
|
+
import { FontTokens, IBorderTokens, IColorTokens, LayoutTokens } from '@fluentui-react-native/tokens';
|
|
8
8
|
|
|
9
9
|
export const menuItemName = 'MenuItem';
|
|
10
10
|
|
|
11
|
-
export interface MenuItemTokens extends LayoutTokens, FontTokens, IBorderTokens,
|
|
11
|
+
export interface MenuItemTokens extends LayoutTokens, FontTokens, IBorderTokens, IColorTokens {
|
|
12
|
+
disabled?: MenuItemTokens;
|
|
13
|
+
focused?: MenuItemTokens;
|
|
14
|
+
hovered?: MenuItemTokens;
|
|
15
|
+
pressed?: MenuItemTokens;
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
export interface MenuItemProps extends Omit<IWithPressableOptions<ViewProps>, 'onPress'> {
|
|
14
19
|
content: string;
|
|
@@ -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 { MenuItemTokens } from './MenuItem.types';
|
|
5
|
+
|
|
6
|
+
export const defaultMenuItemTokens: TokenSettings<MenuItemTokens, Theme> = (t: Theme): MenuItemTokens => ({
|
|
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 { MenuItemTokens } from './MenuItem.types';
|
|
5
|
+
|
|
6
|
+
export const defaultMenuItemTokens: TokenSettings<MenuItemTokens, Theme> = (t: Theme): MenuItemTokens => ({
|
|
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,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
|
+
});
|