@fluentui/react-menu 0.0.0-nightlyf3ce1fbe1d20211110.1 → 0.0.0-nightlyf8be6a7c6520220106.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. package/CHANGELOG.json +244 -30
  2. package/CHANGELOG.md +61 -16
  3. package/Spec.md +21 -16
  4. package/dist/react-menu.d.ts +54 -4
  5. package/lib/MenuSplitGroup.d.ts +1 -0
  6. package/lib/MenuSplitGroup.js +2 -0
  7. package/lib/MenuSplitGroup.js.map +1 -0
  8. package/lib/components/Menu/useMenu.js +28 -21
  9. package/lib/components/Menu/useMenu.js.map +1 -1
  10. package/lib/components/MenuDivider/renderMenuDivider.js +2 -1
  11. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  12. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  13. package/lib/components/MenuDivider/useMenuDividerStyles.js +1 -1
  14. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  15. package/lib/components/MenuGroup/renderMenuGroup.js +2 -1
  16. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  17. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -1
  18. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  19. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  20. package/lib/components/MenuItem/MenuItem.js +0 -2
  21. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  22. package/lib/components/MenuItem/MenuItem.types.d.ts +1 -1
  23. package/lib/components/MenuItem/renderMenuItem.js +7 -1
  24. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  25. package/lib/components/MenuItem/useMenuItem.js +2 -2
  26. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  27. package/lib/components/MenuItem/useMenuItemStyles.js +19 -21
  28. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  29. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -1
  30. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  31. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +6 -1
  32. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  33. package/lib/components/MenuList/renderMenuList.js +2 -1
  34. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  35. package/lib/components/MenuList/useMenuList.js.map +1 -1
  36. package/lib/components/MenuList/useMenuListStyles.js +4 -3
  37. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  38. package/lib/components/MenuPopover/renderMenuPopover.js +4 -2
  39. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  40. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  41. package/lib/components/MenuPopover/useMenuPopoverStyles.js +7 -4
  42. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  43. package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  44. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  45. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  46. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +13 -0
  47. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
  48. package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  49. package/lib/components/MenuSplitGroup/index.d.ts +5 -0
  50. package/lib/components/MenuSplitGroup/index.js +6 -0
  51. package/lib/components/MenuSplitGroup/index.js.map +1 -0
  52. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  53. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +16 -0
  54. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  55. package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +16 -0
  56. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +72 -0
  57. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  58. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  59. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +34 -0
  60. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  61. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
  62. package/lib/components/MenuTrigger/useTriggerElement.js +6 -5
  63. package/lib/components/MenuTrigger/useTriggerElement.js.map +1 -1
  64. package/lib/index.d.ts +11 -10
  65. package/lib/index.js +11 -10
  66. package/lib/index.js.map +1 -1
  67. package/lib/utils/useOnMenuEnter.js.map +1 -1
  68. package/lib-commonjs/MenuSplitGroup.d.ts +1 -0
  69. package/lib-commonjs/MenuSplitGroup.js +10 -0
  70. package/lib-commonjs/MenuSplitGroup.js.map +1 -0
  71. package/lib-commonjs/components/Menu/useMenu.js +33 -27
  72. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  73. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -1
  74. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  75. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  76. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -1
  77. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  78. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -1
  79. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  80. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  81. package/lib-commonjs/components/MenuItem/MenuItem.js +0 -3
  82. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  83. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +1 -1
  84. package/lib-commonjs/components/MenuItem/renderMenuItem.js +7 -1
  85. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  86. package/lib-commonjs/components/MenuItem/useMenuItem.js +2 -2
  87. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  88. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +19 -20
  89. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  90. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -1
  91. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  92. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +6 -1
  93. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  94. package/lib-commonjs/components/MenuList/renderMenuList.js +2 -1
  95. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  96. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  97. package/lib-commonjs/components/MenuList/useMenuListStyles.js +3 -2
  98. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  99. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -2
  100. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  101. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  102. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +6 -3
  103. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  104. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
  105. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
  106. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  107. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +13 -0
  108. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
  109. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  110. package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
  111. package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
  112. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
  113. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
  114. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +28 -0
  115. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  116. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +16 -0
  117. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +86 -0
  118. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  119. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
  120. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +45 -0
  121. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  122. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
  123. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +6 -5
  124. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +1 -1
  125. package/lib-commonjs/index.d.ts +11 -10
  126. package/lib-commonjs/index.js +16 -14
  127. package/lib-commonjs/index.js.map +1 -1
  128. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  129. package/package.json +16 -16
  130. package/lib/common/isConformant.d.ts +0 -4
  131. package/lib/common/isConformant.js +0 -12
  132. package/lib/common/isConformant.js.map +0 -1
  133. package/lib/common/mockUseMenuContext.d.ts +0 -7
  134. package/lib/common/mockUseMenuContext.js +0 -29
  135. package/lib/common/mockUseMenuContext.js.map +0 -1
  136. package/lib-commonjs/common/isConformant.d.ts +0 -4
  137. package/lib-commonjs/common/isConformant.js +0 -23
  138. package/lib-commonjs/common/isConformant.js.map +0 -1
  139. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  140. package/lib-commonjs/common/mockUseMenuContext.js +0 -39
  141. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
@@ -1,29 +0,0 @@
1
- import { useMenuContext } from '../contexts/menuContext';
2
- /**
3
- * A test utility to mock the useMenuContext hook that relies on context selector
4
- * Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
5
- * @param options Menu context values to set for testing
6
- */
7
-
8
- export const mockUseMenuContext = (options = {}) => {
9
- const mockContext = {
10
- open: false,
11
- setOpen: () => null,
12
- triggerRef: {
13
- current: null
14
- },
15
- menuPopoverRef: {
16
- current: null
17
- },
18
- openOnContext: false,
19
- openOnHover: false,
20
- isSubmenu: false,
21
- triggerId: 'id',
22
- ...options
23
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
-
25
- useMenuContext.mockImplementation(selector => {
26
- return selector(mockContext);
27
- });
28
- };
29
- //# sourceMappingURL=mockUseMenuContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/common/mockUseMenuContext.ts"],"names":[],"mappings":"AACA,SAAS,cAAT,QAA+B,yBAA/B;AAGA;;;;AAIG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAAC,OAAA,GAAqC,EAAtC,KAA4C;AAC5E,QAAM,WAAW,GAAqB;AACpC,IAAA,IAAI,EAAE,KAD8B;AAEpC,IAAA,OAAO,EAAE,MAAM,IAFqB;AAGpC,IAAA,UAAU,EAAG;AAAE,MAAA,OAAO,EAAE;AAAX,KAHuB;AAIpC,IAAA,cAAc,EAAG;AAAE,MAAA,OAAO,EAAE;AAAX,KAJmB;AAKpC,IAAA,aAAa,EAAE,KALqB;AAMpC,IAAA,WAAW,EAAE,KANuB;AAOpC,IAAA,SAAS,EAAE,KAPyB;AAQpC,IAAA,SAAS,EAAE,IARyB;AASpC,OAAG;AATiC,GAAtC,CAD4E,CAY5E;;AACC,EAAA,cAA4B,CAAC,kBAA7B,CAAiD,QAAD,IAAiD;AAChG,WAAO,QAAQ,CAAC,WAAD,CAAf;AACD,GAFA;AAGF,CAhBM","sourceRoot":""}
@@ -1,4 +0,0 @@
1
- import type { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
- componentPath?: string;
4
- }): void;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isConformant = void 0;
7
-
8
- const react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
9
-
10
- const react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
11
-
12
- function isConformant(testInfo) {
13
- const defaultOptions = {
14
- asPropHandlesRef: true,
15
- componentPath: module.parent.filename.replace('.test', ''),
16
- skipAsPropTests: true,
17
- extraTests: react_conformance_make_styles_1.default
18
- };
19
- react_conformance_1.isConformant(defaultOptions, testInfo);
20
- }
21
-
22
- exports.isConformant = isConformant;
23
- //# sourceMappingURL=isConformant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,MAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,QAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,eAAe,EAAE,IAH0C;AAI3D,IAAA,UAAU,EAAE,+BAAA,CAAA;AAJ+C,GAA7D;AAOA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAXD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
@@ -1,7 +0,0 @@
1
- import type { MenuContextValue } from '../contexts/menuContext';
2
- /**
3
- * A test utility to mock the useMenuContext hook that relies on context selector
4
- * Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
5
- * @param options Menu context values to set for testing
6
- */
7
- export declare const mockUseMenuContext: (options?: Partial<MenuContextValue>) => void;
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.mockUseMenuContext = void 0;
7
-
8
- const menuContext_1 = /*#__PURE__*/require("../contexts/menuContext");
9
- /**
10
- * A test utility to mock the useMenuContext hook that relies on context selector
11
- * Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
12
- * @param options Menu context values to set for testing
13
- */
14
-
15
-
16
- const mockUseMenuContext = (options = {}) => {
17
- const mockContext = {
18
- open: false,
19
- setOpen: () => null,
20
- triggerRef: {
21
- current: null
22
- },
23
- menuPopoverRef: {
24
- current: null
25
- },
26
- openOnContext: false,
27
- openOnHover: false,
28
- isSubmenu: false,
29
- triggerId: 'id',
30
- ...options
31
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
-
33
- menuContext_1.useMenuContext.mockImplementation(selector => {
34
- return selector(mockContext);
35
- });
36
- };
37
-
38
- exports.mockUseMenuContext = mockUseMenuContext;
39
- //# sourceMappingURL=mockUseMenuContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/common/mockUseMenuContext.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAA,GAAqC,EAAtC,KAA4C;AAC5E,QAAM,WAAW,GAAqB;AACpC,IAAA,IAAI,EAAE,KAD8B;AAEpC,IAAA,OAAO,EAAE,MAAM,IAFqB;AAGpC,IAAA,UAAU,EAAG;AAAE,MAAA,OAAO,EAAE;AAAX,KAHuB;AAIpC,IAAA,cAAc,EAAG;AAAE,MAAA,OAAO,EAAE;AAAX,KAJmB;AAKpC,IAAA,aAAa,EAAE,KALqB;AAMpC,IAAA,WAAW,EAAE,KANuB;AAOpC,IAAA,SAAS,EAAE,KAPyB;AAQpC,IAAA,SAAS,EAAE,IARyB;AASpC,OAAG;AATiC,GAAtC,CAD4E,CAY5E;;AACC,EAAA,aAAA,CAAA,cAAA,CAA6B,kBAA7B,CAAiD,QAAD,IAAiD;AAChG,WAAO,QAAQ,CAAC,WAAD,CAAf;AACD,GAFA;AAGF,CAhBM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourceRoot":""}