@fluentui-react-native/menu 0.9.0 → 0.9.3

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.
Files changed (44) hide show
  1. package/CHANGELOG.json +100 -1
  2. package/CHANGELOG.md +35 -2
  3. package/lib/MenuList/MenuList.d.ts +0 -1
  4. package/lib/MenuList/MenuList.d.ts.map +1 -1
  5. package/lib/MenuList/MenuList.js +23 -5
  6. package/lib/MenuList/MenuList.js.map +1 -1
  7. package/lib/MenuList/MenuList.styling.d.ts.map +1 -1
  8. package/lib/MenuList/MenuList.styling.js +2 -1
  9. package/lib/MenuList/MenuList.styling.js.map +1 -1
  10. package/lib/MenuList/MenuList.types.d.ts +4 -1
  11. package/lib/MenuList/MenuList.types.d.ts.map +1 -1
  12. package/lib/MenuList/MenuListTokens.d.ts.map +1 -1
  13. package/lib/MenuList/MenuListTokens.js +1 -0
  14. package/lib/MenuList/MenuListTokens.js.map +1 -1
  15. package/lib/MenuList/{useMenuContextValue.d.ts → useMenuListContextValue.d.ts} +1 -1
  16. package/lib/MenuList/useMenuListContextValue.d.ts.map +1 -0
  17. package/lib/MenuList/{useMenuContextValue.js → useMenuListContextValue.js} +1 -1
  18. package/lib/MenuList/useMenuListContextValue.js.map +1 -0
  19. package/lib-commonjs/MenuList/MenuList.d.ts +0 -1
  20. package/lib-commonjs/MenuList/MenuList.d.ts.map +1 -1
  21. package/lib-commonjs/MenuList/MenuList.js +22 -4
  22. package/lib-commonjs/MenuList/MenuList.js.map +1 -1
  23. package/lib-commonjs/MenuList/MenuList.styling.d.ts.map +1 -1
  24. package/lib-commonjs/MenuList/MenuList.styling.js +2 -1
  25. package/lib-commonjs/MenuList/MenuList.styling.js.map +1 -1
  26. package/lib-commonjs/MenuList/MenuList.types.d.ts +4 -1
  27. package/lib-commonjs/MenuList/MenuList.types.d.ts.map +1 -1
  28. package/lib-commonjs/MenuList/MenuListTokens.d.ts.map +1 -1
  29. package/lib-commonjs/MenuList/MenuListTokens.js +1 -0
  30. package/lib-commonjs/MenuList/MenuListTokens.js.map +1 -1
  31. package/lib-commonjs/MenuList/{useMenuContextValue.d.ts → useMenuListContextValue.d.ts} +1 -1
  32. package/lib-commonjs/MenuList/useMenuListContextValue.d.ts.map +1 -0
  33. package/lib-commonjs/MenuList/{useMenuContextValue.js → useMenuListContextValue.js} +1 -1
  34. package/lib-commonjs/MenuList/useMenuListContextValue.js.map +1 -0
  35. package/package.json +7 -7
  36. package/src/MenuList/MenuList.styling.ts +2 -1
  37. package/src/MenuList/MenuList.tsx +23 -5
  38. package/src/MenuList/MenuList.types.ts +4 -2
  39. package/src/MenuList/MenuListTokens.ts +1 -0
  40. package/src/MenuList/{useMenuContextValue.ts → useMenuListContextValue.ts} +0 -0
  41. package/lib/MenuList/useMenuContextValue.d.ts.map +0 -1
  42. package/lib/MenuList/useMenuContextValue.js.map +0 -1
  43. package/lib-commonjs/MenuList/useMenuContextValue.d.ts.map +0 -1
  44. package/lib-commonjs/MenuList/useMenuContextValue.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,106 @@
2
2
  "name": "@fluentui-react-native/menu",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 20 May 2022 19:53:36 GMT",
5
+ "date": "Tue, 24 May 2022 00:36:28 GMT",
6
+ "tag": "@fluentui-react-native/menu_v0.9.3",
7
+ "version": "0.9.3",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "ruaraki@microsoft.com",
12
+ "package": "@fluentui-react-native/menu",
13
+ "commit": "f0ea5a1602a636e49778c77f94aae23d6faee485",
14
+ "comment": "Implement gap token"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Sat, 21 May 2022 16:18:06 GMT",
21
+ "tag": "@fluentui-react-native/menu_v0.9.2",
22
+ "version": "0.9.2",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "beachball",
27
+ "package": "@fluentui-react-native/menu",
28
+ "comment": "Bump @fluentui-react-native/callout to v0.20.2",
29
+ "commit": "313cc45fbeb5bfaff0b266194cc48608bf6d2c35"
30
+ },
31
+ {
32
+ "author": "beachball",
33
+ "package": "@fluentui-react-native/menu",
34
+ "comment": "Bump @fluentui-react-native/experimental-text to v0.7.28",
35
+ "commit": "313cc45fbeb5bfaff0b266194cc48608bf6d2c35"
36
+ },
37
+ {
38
+ "author": "beachball",
39
+ "package": "@fluentui-react-native/menu",
40
+ "comment": "Bump @fluentui-react-native/framework to v0.7.28",
41
+ "commit": "313cc45fbeb5bfaff0b266194cc48608bf6d2c35"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui-react-native/menu",
46
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.15.8",
47
+ "commit": "313cc45fbeb5bfaff0b266194cc48608bf6d2c35"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui-react-native/menu",
52
+ "comment": "Bump @fluentui-react-native/tokens to v0.12.2",
53
+ "commit": "313cc45fbeb5bfaff0b266194cc48608bf6d2c35"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "date": "Sat, 21 May 2022 01:47:58 GMT",
60
+ "tag": "@fluentui-react-native/menu_v0.9.1",
61
+ "version": "0.9.1",
62
+ "comments": {
63
+ "patch": [
64
+ {
65
+ "author": "beachball",
66
+ "package": "@fluentui-react-native/menu",
67
+ "comment": "Bump @fluentui-react-native/callout to v0.20.1",
68
+ "commit": "36ea0d81629f9326eb8c23912d9949381014dade"
69
+ },
70
+ {
71
+ "author": "beachball",
72
+ "package": "@fluentui-react-native/menu",
73
+ "comment": "Bump @fluentui-react-native/experimental-text to v0.7.27",
74
+ "commit": "36ea0d81629f9326eb8c23912d9949381014dade"
75
+ },
76
+ {
77
+ "author": "beachball",
78
+ "package": "@fluentui-react-native/menu",
79
+ "comment": "Bump @fluentui-react-native/framework to v0.7.27",
80
+ "commit": "36ea0d81629f9326eb8c23912d9949381014dade"
81
+ },
82
+ {
83
+ "author": "beachball",
84
+ "package": "@fluentui-react-native/menu",
85
+ "comment": "Bump @fluentui-react-native/interactive-hooks to v0.15.7",
86
+ "commit": "36ea0d81629f9326eb8c23912d9949381014dade"
87
+ },
88
+ {
89
+ "author": "beachball",
90
+ "package": "@fluentui-react-native/menu",
91
+ "comment": "Bump @fluentui-react-native/theme-tokens to v0.16.3",
92
+ "commit": "36ea0d81629f9326eb8c23912d9949381014dade"
93
+ },
94
+ {
95
+ "author": "beachball",
96
+ "package": "@fluentui-react-native/menu",
97
+ "comment": "Bump @fluentui-react-native/tokens to v0.12.1",
98
+ "commit": "36ea0d81629f9326eb8c23912d9949381014dade"
99
+ }
100
+ ]
101
+ }
102
+ },
103
+ {
104
+ "date": "Fri, 20 May 2022 19:53:48 GMT",
6
105
  "tag": "@fluentui-react-native/menu_v0.9.0",
7
106
  "version": "0.9.0",
8
107
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,45 @@
1
1
  # Change Log - @fluentui-react-native/menu
2
2
 
3
- This log was last generated on Fri, 20 May 2022 19:53:36 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 24 May 2022 00:36:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.9.3
8
+
9
+ Tue, 24 May 2022 00:36:28 GMT
10
+
11
+ ### Patches
12
+
13
+ - Implement gap token (ruaraki@microsoft.com)
14
+
15
+ ## 0.9.2
16
+
17
+ Sat, 21 May 2022 16:18:06 GMT
18
+
19
+ ### Patches
20
+
21
+ - Bump @fluentui-react-native/callout to v0.20.2
22
+ - Bump @fluentui-react-native/experimental-text to v0.7.28
23
+ - Bump @fluentui-react-native/framework to v0.7.28
24
+ - Bump @fluentui-react-native/interactive-hooks to v0.15.8
25
+ - Bump @fluentui-react-native/tokens to v0.12.2
26
+
27
+ ## 0.9.1
28
+
29
+ Sat, 21 May 2022 01:47:58 GMT
30
+
31
+ ### Patches
32
+
33
+ - Bump @fluentui-react-native/callout to v0.20.1
34
+ - Bump @fluentui-react-native/experimental-text to v0.7.27
35
+ - Bump @fluentui-react-native/framework to v0.7.27
36
+ - Bump @fluentui-react-native/interactive-hooks to v0.15.7
37
+ - Bump @fluentui-react-native/theme-tokens to v0.16.3
38
+ - Bump @fluentui-react-native/tokens to v0.12.1
39
+
7
40
  ## 0.9.0
8
41
 
9
- Fri, 20 May 2022 19:53:36 GMT
42
+ Fri, 20 May 2022 19:53:48 GMT
10
43
 
11
44
  ### Minor changes
12
45
 
@@ -1,4 +1,3 @@
1
1
  import { MenuListProps } from './MenuList.types';
2
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
3
  //# sourceMappingURL=MenuList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAM7E,eAAO,MAAM,QAAQ,gLAmBnB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AA0B7E,eAAO,MAAM,QAAQ,gLAmBnB,CAAC"}
@@ -1,13 +1,32 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __rest } from "tslib";
2
+ /** @jsx withSlots */
3
+ import React from 'react';
2
4
  import { View } from 'react-native';
3
- import { compose, withSlots } from '@fluentui-react-native/framework';
5
+ import { compose, mergeProps, stagedComponent, withSlots } from '@fluentui-react-native/framework';
4
6
  import { menuListName } from './MenuList.types';
5
7
  import { stylingSettings } from './MenuList.styling';
6
8
  import { MenuListProvider } from '../context/menuListContext';
7
9
  import { useMenuList } from './useMenuList';
8
- import { useMenuListContextValue } from './useMenuContextValue';
10
+ import { useMenuListContextValue } from './useMenuListContextValue';
11
+ var MenuStack = stagedComponent(function (props) {
12
+ var gap = props.gap, rest = __rest(props, ["gap"]);
13
+ return function (final, children) {
14
+ if (gap && gap > 0 && children) {
15
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16
+ // @ts-ignore - GH:1684, fix typing error
17
+ children = React.Children.map(children, function (child, index) {
18
+ if (React.isValidElement(child) && index > 0) {
19
+ return React.cloneElement(child, mergeProps(child.props, { style: { marginTop: gap } }));
20
+ }
21
+ return child;
22
+ });
23
+ }
24
+ return withSlots(View, __assign({}, mergeProps(rest, final)), children);
25
+ };
26
+ });
27
+ MenuStack.displayName = 'MenuStack';
9
28
  export var MenuList = compose(__assign(__assign({ displayName: menuListName }, stylingSettings), { slots: {
10
- root: View,
29
+ root: MenuStack,
11
30
  }, useRender: function (userProps, useSlots) {
12
31
  var menuList = useMenuList(userProps);
13
32
  var contextValue = useMenuListContextValue(menuList);
@@ -17,5 +36,4 @@ export var MenuList = compose(__assign(__assign({ displayName: menuListName }, s
17
36
  withSlots(Slots.root, null, children)));
18
37
  };
19
38
  } }));
20
- export default MenuList;
21
39
  //# sourceMappingURL=MenuList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAY,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,CA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D,CAAC"}
@@ -1 +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"}
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,CAe/F,CAAC"}
@@ -8,7 +8,8 @@ export var stylingSettings = {
8
8
  slotProps: {
9
9
  root: buildProps(function (tokens, theme) { return ({
10
10
  style: __assign({ backgroundColor: tokens.backgroundColor, display: 'flex' }, layoutStyles.from(tokens, theme)),
11
- }); }, __spreadArray(['backgroundColor'], layoutStyles.keys, true)),
11
+ gap: tokens.gap,
12
+ }); }, __spreadArray(['backgroundColor', 'gap'], layoutStyles.keys, true)),
12
13
  },
13
14
  };
14
15
  //# sourceMappingURL=MenuList.styling.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.styling.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":";AAAA,OAAO,EAA4B,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAoD,MAAM,kBAAkB,CAAC;AAElG,MAAM,CAAC,IAAM,eAAe,GAAwE;IAClG,MAAM,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;IAC7C,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,UAAC,MAAsB,EAAE,KAAY,IAAK,OAAA,CAAC;YACzC,KAAK,aACH,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,OAAO,EAAE,MAAM,IACZ,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CACpC;SACF,CAAC,EANwC,CAMxC,iBACD,iBAAiB,GAAK,YAAY,CAAC,IAAI,QACzC;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"MenuList.styling.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":";AAAA,OAAO,EAA4B,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAoD,MAAM,kBAAkB,CAAC;AAElG,MAAM,CAAC,IAAM,eAAe,GAAwE;IAClG,MAAM,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;IAC7C,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,UAAC,MAAsB,EAAE,KAAY,IAAK,OAAA,CAAC;YACzC,KAAK,aACH,eAAe,EAAE,MAAM,CAAC,eAAe,EACvC,OAAO,EAAE,MAAM,IACZ,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CACpC;YACD,GAAG,EAAE,MAAM,CAAC,GAAG;SAChB,CAAC,EAPwC,CAOxC,iBACD,iBAAiB,EAAE,KAAK,GAAK,YAAY,CAAC,IAAI,QAChD;KACF;CACF,CAAC"}
@@ -4,6 +4,7 @@ import { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
4
4
  import { IBackgroundColorTokens, LayoutTokens } from '@fluentui-react-native/tokens';
5
5
  export declare const menuListName = "MenuList";
6
6
  export interface MenuListTokens extends LayoutTokens, IBackgroundColorTokens {
7
+ gap?: number;
7
8
  }
8
9
  export interface MenuListProps extends Omit<IViewProps, 'onPress'> {
9
10
  checked?: Record<string, boolean>;
@@ -15,7 +16,9 @@ export interface MenuListState extends MenuListProps {
15
16
  isCheckedControlled: boolean;
16
17
  }
17
18
  export interface MenuListSlotProps {
18
- root: React.PropsWithRef<IViewProps>;
19
+ root: React.PropsWithRef<IViewProps> & {
20
+ gap?: number;
21
+ };
19
22
  }
20
23
  export interface MenuListType {
21
24
  props: MenuListProps;
@@ -1 +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,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,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;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACnF;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,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AAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;CAC9B"}
@@ -1 +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"}
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,CAMrE,CAAC"}
@@ -4,5 +4,6 @@ export var defaultMenuListTokens = function (t) { return ({
4
4
  minWidth: 128,
5
5
  maxWidth: 300,
6
6
  backgroundColor: t.colors.neutralBackground1,
7
+ gap: globalTokens.spacing.xxs,
7
8
  }); };
8
9
  //# sourceMappingURL=MenuListTokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuListTokens.js","sourceRoot":"","sources":["../../src/MenuList/MenuListTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE,MAAM,CAAC,IAAM,qBAAqB,GAAyC,UAAC,CAAQ,IAAqB,OAAA,CAAC;IACxG,OAAO,EAAE,YAAY,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"}
1
+ {"version":3,"file":"MenuListTokens.js","sourceRoot":"","sources":["../../src/MenuList/MenuListTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE,MAAM,CAAC,IAAM,qBAAqB,GAAyC,UAAC,CAAQ,IAAqB,OAAA,CAAC;IACxG,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE;IAChC,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAC5C,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG;CAC9B,CAAC,EANuG,CAMvG,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { MenuListContextValue } from '../context/menuListContext';
2
2
  import { MenuListState } from './MenuList.types';
3
3
  export declare const useMenuListContextValue: (state: MenuListState) => MenuListContextValue;
4
- //# sourceMappingURL=useMenuContextValue.d.ts.map
4
+ //# sourceMappingURL=useMenuListContextValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuListContextValue.d.ts","sourceRoot":"","sources":["../../src/MenuList/useMenuListContextValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,uBAAuB,UAAW,aAAa,KAAG,oBAE9D,CAAC"}
@@ -2,4 +2,4 @@ import { __assign } from "tslib";
2
2
  export var useMenuListContextValue = function (state) {
3
3
  return __assign({}, state);
4
4
  };
5
- //# sourceMappingURL=useMenuContextValue.js.map
5
+ //# sourceMappingURL=useMenuListContextValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuListContextValue.js","sourceRoot":"","sources":["../../src/MenuList/useMenuListContextValue.ts"],"names":[],"mappings":";AAGA,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,KAAoB;IAC1D,oBAAY,KAAK,EAAG;AACtB,CAAC,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import { MenuListProps } from './MenuList.types';
2
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
3
  //# sourceMappingURL=MenuList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAM7E,eAAO,MAAM,QAAQ,gLAmBnB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AA0B7E,eAAO,MAAM,QAAQ,gLAmBnB,CAAC"}
@@ -2,23 +2,41 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MenuList = void 0;
4
4
  var tslib_1 = require("tslib");
5
+ /** @jsx withSlots */
6
+ var react_1 = (0, tslib_1.__importDefault)(require("react"));
5
7
  var react_native_1 = require("react-native");
6
8
  var framework_1 = require("@fluentui-react-native/framework");
7
9
  var MenuList_types_1 = require("./MenuList.types");
8
10
  var MenuList_styling_1 = require("./MenuList.styling");
9
11
  var menuListContext_1 = require("../context/menuListContext");
10
12
  var useMenuList_1 = require("./useMenuList");
11
- var useMenuContextValue_1 = require("./useMenuContextValue");
13
+ var useMenuListContextValue_1 = require("./useMenuListContextValue");
14
+ var MenuStack = (0, framework_1.stagedComponent)(function (props) {
15
+ var gap = props.gap, rest = (0, tslib_1.__rest)(props, ["gap"]);
16
+ return function (final, children) {
17
+ if (gap && gap > 0 && children) {
18
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
+ // @ts-ignore - GH:1684, fix typing error
20
+ children = react_1.default.Children.map(children, function (child, index) {
21
+ if (react_1.default.isValidElement(child) && index > 0) {
22
+ return react_1.default.cloneElement(child, (0, framework_1.mergeProps)(child.props, { style: { marginTop: gap } }));
23
+ }
24
+ return child;
25
+ });
26
+ }
27
+ return (0, framework_1.withSlots)(react_native_1.View, (0, tslib_1.__assign)({}, (0, framework_1.mergeProps)(rest, final)), children);
28
+ };
29
+ });
30
+ MenuStack.displayName = 'MenuStack';
12
31
  exports.MenuList = (0, framework_1.compose)((0, tslib_1.__assign)((0, tslib_1.__assign)({ displayName: MenuList_types_1.menuListName }, MenuList_styling_1.stylingSettings), { slots: {
13
- root: react_native_1.View,
32
+ root: MenuStack,
14
33
  }, useRender: function (userProps, useSlots) {
15
34
  var menuList = (0, useMenuList_1.useMenuList)(userProps);
16
- var contextValue = (0, useMenuContextValue_1.useMenuListContextValue)(menuList);
35
+ var contextValue = (0, useMenuListContextValue_1.useMenuListContextValue)(menuList);
17
36
  var Slots = useSlots(menuList);
18
37
  return function (_final, children) {
19
38
  return ((0, framework_1.withSlots)(menuListContext_1.MenuListProvider, { value: contextValue },
20
39
  (0, framework_1.withSlots)(Slots.root, null, children)));
21
40
  };
22
41
  } }));
23
- exports.default = exports.MenuList;
24
42
  //# sourceMappingURL=MenuList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;AAEA,6CAAoC;AACpC,8DAAgF;AAChF,mDAA6E;AAC7E,uDAAqD;AACrD,8DAA8D;AAC9D,6CAA4C;AAC5C,6DAAgE;AAEnD,QAAA,QAAQ,GAAG,IAAA,mBAAO,gDAC7B,WAAW,EAAE,6BAAY,IACtB,kCAAe,KAClB,KAAK,EAAE;QACL,IAAI,EAAE,mBAAI;KACX,EACD,SAAS,EAAE,UAAC,SA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,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;iBAC1F;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,2BAAC,mBAAI,4BAAK,IAAA,sBAAU,EAAC,IAAI,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAQ,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEvB,QAAA,QAAQ,GAAG,IAAA,mBAAO,gDAC7B,WAAW,EAAE,6BAAY,IACtB,kCAAe,KAClB,KAAK,EAAE;QACL,IAAI,EAAE,SAAS;KAChB,EACD,SAAS,EAAE,UAAC,SAAwB,EAAE,QAAgC;QACpE,IAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,SAAS,CAAC,CAAC;QACxC,IAAM,YAAY,GAAG,IAAA,iDAAuB,EAAC,QAAQ,CAAC,CAAC;QACvD,IAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEjC,OAAO,UAAC,MAAqB,EAAE,QAAyB;YACtD,OAAO,CACL,2BAAC,kCAAgB,IAAC,KAAK,EAAE,YAAY;gBACnC,2BAAC,KAAK,CAAC,IAAI,QAAE,QAAQ,CAAc,CAClB,CACpB,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,IACD,CAAC"}
@@ -1 +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"}
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,CAe/F,CAAC"}
@@ -11,7 +11,8 @@ exports.stylingSettings = {
11
11
  slotProps: {
12
12
  root: (0, framework_1.buildProps)(function (tokens, theme) { return ({
13
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)),
14
+ gap: tokens.gap,
15
+ }); }, (0, tslib_1.__spreadArray)(['backgroundColor', 'gap'], tokens_1.layoutStyles.keys, true)),
15
16
  },
16
17
  };
17
18
  //# sourceMappingURL=MenuList.styling.js.map
@@ -1 +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"}
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;YACD,GAAG,EAAE,MAAM,CAAC,GAAG;SAChB,CAAC,EAPwC,CAOxC,8BACD,iBAAiB,EAAE,KAAK,GAAK,qBAAY,CAAC,IAAI,QAChD;KACF;CACF,CAAC"}
@@ -4,6 +4,7 @@ import { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
4
4
  import { IBackgroundColorTokens, LayoutTokens } from '@fluentui-react-native/tokens';
5
5
  export declare const menuListName = "MenuList";
6
6
  export interface MenuListTokens extends LayoutTokens, IBackgroundColorTokens {
7
+ gap?: number;
7
8
  }
8
9
  export interface MenuListProps extends Omit<IViewProps, 'onPress'> {
9
10
  checked?: Record<string, boolean>;
@@ -15,7 +16,9 @@ export interface MenuListState extends MenuListProps {
15
16
  isCheckedControlled: boolean;
16
17
  }
17
18
  export interface MenuListSlotProps {
18
- root: React.PropsWithRef<IViewProps>;
19
+ root: React.PropsWithRef<IViewProps> & {
20
+ gap?: number;
21
+ };
19
22
  }
20
23
  export interface MenuListType {
21
24
  props: MenuListProps;
@@ -1 +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,gBAAgB,EAAE,MAAM,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AAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACnF;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AACD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;CAC9B"}
@@ -1 +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"}
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,CAMrE,CAAC"}
@@ -7,6 +7,7 @@ var defaultMenuListTokens = function (t) { return ({
7
7
  minWidth: 128,
8
8
  maxWidth: 300,
9
9
  backgroundColor: t.colors.neutralBackground1,
10
+ gap: theme_tokens_1.globalTokens.spacing.xxs,
10
11
  }); };
11
12
  exports.defaultMenuListTokens = defaultMenuListTokens;
12
13
  //# sourceMappingURL=MenuListTokens.js.map
@@ -1 +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"}
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;IAC5C,GAAG,EAAE,2BAAY,CAAC,OAAO,CAAC,GAAG;CAC9B,CAAC,EANuG,CAMvG,CAAC;AANU,QAAA,qBAAqB,yBAM/B"}
@@ -1,4 +1,4 @@
1
1
  import { MenuListContextValue } from '../context/menuListContext';
2
2
  import { MenuListState } from './MenuList.types';
3
3
  export declare const useMenuListContextValue: (state: MenuListState) => MenuListContextValue;
4
- //# sourceMappingURL=useMenuContextValue.d.ts.map
4
+ //# sourceMappingURL=useMenuListContextValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuListContextValue.d.ts","sourceRoot":"","sources":["../../src/MenuList/useMenuListContextValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,uBAAuB,UAAW,aAAa,KAAG,oBAE9D,CAAC"}
@@ -6,4 +6,4 @@ var useMenuListContextValue = function (state) {
6
6
  return (0, tslib_1.__assign)({}, state);
7
7
  };
8
8
  exports.useMenuListContextValue = useMenuListContextValue;
9
- //# sourceMappingURL=useMenuContextValue.js.map
9
+ //# sourceMappingURL=useMenuListContextValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuListContextValue.js","sourceRoot":"","sources":["../../src/MenuList/useMenuListContextValue.ts"],"names":[],"mappings":";;;;AAGO,IAAM,uBAAuB,GAAG,UAAC,KAAoB;IAC1D,iCAAY,KAAK,EAAG;AACtB,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/menu",
3
- "version": "0.9.0",
3
+ "version": "0.9.3",
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,12 +23,12 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@fluentui-react-native/adapters": ">=0.8.5 <1.0.0",
26
- "@fluentui-react-native/callout": ">=0.20.0 <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",
26
+ "@fluentui-react-native/callout": ">=0.20.2 <1.0.0",
27
+ "@fluentui-react-native/experimental-text": ">=0.7.28 <1.0.0",
28
+ "@fluentui-react-native/framework": "0.7.28",
29
+ "@fluentui-react-native/interactive-hooks": ">=0.15.8 <1.0.0",
30
+ "@fluentui-react-native/theme-tokens": ">=0.16.3 <1.0.0",
31
+ "@fluentui-react-native/tokens": ">=0.12.2 <1.0.0",
32
32
  "@fluentui-react-native/use-styling": ">=0.8.3 <1.0.0",
33
33
  "react-native-svg": "^12.3.0",
34
34
  "tslib": "^2.3.1"
@@ -13,8 +13,9 @@ export const stylingSettings: UseStylingOptions<MenuListProps, MenuListSlotProps
13
13
  display: 'flex',
14
14
  ...layoutStyles.from(tokens, theme),
15
15
  },
16
+ gap: tokens.gap,
16
17
  }),
17
- ['backgroundColor', ...layoutStyles.keys],
18
+ ['backgroundColor', 'gap', ...layoutStyles.keys],
18
19
  ),
19
20
  },
20
21
  };
@@ -1,18 +1,38 @@
1
1
  /** @jsx withSlots */
2
2
  import React from 'react';
3
3
  import { View } from 'react-native';
4
- import { compose, UseSlots, withSlots } from '@fluentui-react-native/framework';
4
+ import { compose, mergeProps, stagedComponent, UseSlots, withSlots } from '@fluentui-react-native/framework';
5
5
  import { menuListName, MenuListProps, MenuListType } from './MenuList.types';
6
6
  import { stylingSettings } from './MenuList.styling';
7
7
  import { MenuListProvider } from '../context/menuListContext';
8
8
  import { useMenuList } from './useMenuList';
9
- import { useMenuListContextValue } from './useMenuContextValue';
9
+ import { useMenuListContextValue } from './useMenuListContextValue';
10
+ import { IViewProps } from '@fluentui-react-native/adapters';
11
+
12
+ const MenuStack = stagedComponent((props: React.PropsWithRef<IViewProps> & { gap?: number }) => {
13
+ const { gap, ...rest } = props;
14
+ return (final: React.PropsWithRef<IViewProps> & { gap?: number }, children: React.ReactNode) => {
15
+ if (gap && gap > 0 && children) {
16
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17
+ // @ts-ignore - GH:1684, fix typing error
18
+ children = React.Children.map(children, (child: React.ReactChild, index: number) => {
19
+ if (React.isValidElement(child) && index > 0) {
20
+ return React.cloneElement(child, mergeProps(child.props, { style: { marginTop: gap } }));
21
+ }
22
+ return child;
23
+ });
24
+ }
25
+
26
+ return <View {...mergeProps(rest, final)}>{children}</View>;
27
+ };
28
+ });
29
+ MenuStack.displayName = 'MenuStack';
10
30
 
11
31
  export const MenuList = compose<MenuListType>({
12
32
  displayName: menuListName,
13
33
  ...stylingSettings,
14
34
  slots: {
15
- root: View,
35
+ root: MenuStack,
16
36
  },
17
37
  useRender: (userProps: MenuListProps, useSlots: UseSlots<MenuListType>) => {
18
38
  const menuList = useMenuList(userProps);
@@ -28,5 +48,3 @@ export const MenuList = compose<MenuListType>({
28
48
  };
29
49
  },
30
50
  });
31
-
32
- export default MenuList;
@@ -4,7 +4,9 @@ import { IBackgroundColorTokens, LayoutTokens } from '@fluentui-react-native/tok
4
4
 
5
5
  export const menuListName = 'MenuList';
6
6
 
7
- export interface MenuListTokens extends LayoutTokens, IBackgroundColorTokens {}
7
+ export interface MenuListTokens extends LayoutTokens, IBackgroundColorTokens {
8
+ gap?: number;
9
+ }
8
10
 
9
11
  export interface MenuListProps extends Omit<IViewProps, 'onPress'> {
10
12
  checked?: Record<string, boolean>;
@@ -18,7 +20,7 @@ export interface MenuListState extends MenuListProps {
18
20
  }
19
21
 
20
22
  export interface MenuListSlotProps {
21
- root: React.PropsWithRef<IViewProps>;
23
+ root: React.PropsWithRef<IViewProps> & { gap?: number };
22
24
  }
23
25
  export interface MenuListType {
24
26
  props: MenuListProps;
@@ -8,4 +8,5 @@ export const defaultMenuListTokens: TokenSettings<MenuListTokens, Theme> = (t: T
8
8
  minWidth: 128,
9
9
  maxWidth: 300,
10
10
  backgroundColor: t.colors.neutralBackground1,
11
+ gap: globalTokens.spacing.xxs,
11
12
  });
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuContextValue.d.ts","sourceRoot":"","sources":["../../src/MenuList/useMenuContextValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,uBAAuB,UAAW,aAAa,KAAG,oBAE9D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuContextValue.js","sourceRoot":"","sources":["../../src/MenuList/useMenuContextValue.ts"],"names":[],"mappings":";AAGA,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,KAAoB;IAC1D,oBAAY,KAAK,EAAG;AACtB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuContextValue.d.ts","sourceRoot":"","sources":["../../src/MenuList/useMenuContextValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,uBAAuB,UAAW,aAAa,KAAG,oBAE9D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMenuContextValue.js","sourceRoot":"","sources":["../../src/MenuList/useMenuContextValue.ts"],"names":[],"mappings":";;;;AAGO,IAAM,uBAAuB,GAAG,UAAC,KAAoB;IAC1D,iCAAY,KAAK,EAAG;AACtB,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC"}