@fluentui/react-menu 0.0.0-nightlybc5ff01fb020211104.1 → 0.0.0-nightlycbf184efa720211222.1

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 (88) hide show
  1. package/CHANGELOG.json +244 -30
  2. package/CHANGELOG.md +61 -16
  3. package/dist/react-menu.d.ts +14 -9
  4. package/lib/components/Menu/useMenu.js +28 -21
  5. package/lib/components/Menu/useMenu.js.map +1 -1
  6. package/lib/components/MenuDivider/renderMenuDivider.js +2 -1
  7. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  8. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  9. package/lib/components/MenuDivider/useMenuDividerStyles.js +1 -1
  10. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  11. package/lib/components/MenuGroup/renderMenuGroup.js +2 -1
  12. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  13. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -1
  14. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  15. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  16. package/lib/components/MenuItem/MenuItem.js +0 -2
  17. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  18. package/lib/components/MenuItem/renderMenuItem.js +7 -1
  19. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  20. package/lib/components/MenuItem/useMenuItemStyles.js +11 -4
  21. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  22. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -1
  23. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  24. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +6 -1
  25. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  26. package/lib/components/MenuList/MenuList.types.d.ts +8 -6
  27. package/lib/components/MenuList/renderMenuList.js +2 -1
  28. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  29. package/lib/components/MenuList/useMenuList.js.map +1 -1
  30. package/lib/components/MenuList/useMenuListStyles.js +4 -3
  31. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  32. package/lib/components/MenuPopover/renderMenuPopover.js +4 -2
  33. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  34. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  35. package/lib/components/MenuPopover/useMenuPopoverStyles.js +7 -4
  36. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  37. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
  38. package/lib/components/MenuTrigger/useTriggerElement.js +6 -5
  39. package/lib/components/MenuTrigger/useTriggerElement.js.map +1 -1
  40. package/lib/utils/useOnMenuEnter.js.map +1 -1
  41. package/lib-commonjs/components/Menu/useMenu.js +33 -27
  42. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  43. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -1
  44. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  45. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  46. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -1
  47. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  48. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -1
  49. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  50. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  51. package/lib-commonjs/components/MenuItem/MenuItem.js +0 -3
  52. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  53. package/lib-commonjs/components/MenuItem/renderMenuItem.js +7 -1
  54. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  55. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +11 -3
  56. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  57. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -1
  58. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  59. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +6 -1
  60. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  61. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +8 -6
  62. package/lib-commonjs/components/MenuList/renderMenuList.js +2 -1
  63. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  64. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  65. package/lib-commonjs/components/MenuList/useMenuListStyles.js +3 -2
  66. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  67. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -2
  68. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  69. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  70. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +6 -3
  71. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  72. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
  73. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +6 -5
  74. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +1 -1
  75. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  76. package/package.json +16 -16
  77. package/lib/common/isConformant.d.ts +0 -4
  78. package/lib/common/isConformant.js +0 -12
  79. package/lib/common/isConformant.js.map +0 -1
  80. package/lib/common/mockUseMenuContext.d.ts +0 -7
  81. package/lib/common/mockUseMenuContext.js +0 -29
  82. package/lib/common/mockUseMenuContext.js.map +0 -1
  83. package/lib-commonjs/common/isConformant.d.ts +0 -4
  84. package/lib-commonjs/common/isConformant.js +0 -23
  85. package/lib-commonjs/common/isConformant.js.map +0 -1
  86. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  87. package/lib-commonjs/common/mockUseMenuContext.js +0 -39
  88. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-menu",
3
- "version": "0.0.0-nightlybc5ff01fb020211104.1",
3
+ "version": "0.0.0-nightlycbf184efa720211222.1",
4
4
  "description": "Fluent UI menu component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -13,7 +13,7 @@
13
13
  "license": "MIT",
14
14
  "scripts": {
15
15
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
16
- "build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-menu/src && yarn docs",
16
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-menu/src && yarn docs",
17
17
  "build": "just-scripts build",
18
18
  "bundle-size": "bundle-size measure",
19
19
  "clean": "just-scripts clean",
@@ -23,14 +23,15 @@
23
23
  "lint": "just-scripts lint",
24
24
  "start": "yarn storybook",
25
25
  "storybook": "start-storybook",
26
- "test": "jest"
26
+ "test": "jest",
27
+ "type-check": "tsc -b tsconfig.json"
27
28
  },
28
29
  "devDependencies": {
29
- "@fluentui/babel-make-styles": "0.0.0-nightlybc5ff01fb020211104.1",
30
+ "@fluentui/babel-make-styles": "0.0.0-nightlycbf184efa720211222.1",
30
31
  "@fluentui/eslint-plugin": "*",
31
- "@fluentui/jest-serializer-make-styles": "0.0.0-nightlybc5ff01fb020211104.1",
32
+ "@fluentui/jest-serializer-make-styles": "0.0.0-nightlycbf184efa720211222.1",
32
33
  "@fluentui/react-conformance": "*",
33
- "@fluentui/react-conformance-make-styles": "0.0.0-nightlybc5ff01fb020211104.1",
34
+ "@fluentui/react-conformance-make-styles": "0.0.0-nightlycbf184efa720211222.1",
34
35
  "@fluentui/scripts": "^1.0.0",
35
36
  "@types/enzyme": "3.10.3",
36
37
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -44,15 +45,15 @@
44
45
  "react-test-renderer": "^16.3.0"
45
46
  },
46
47
  "dependencies": {
47
- "@fluentui/keyboard-keys": "0.0.0-nightlybc5ff01fb020211104.1",
48
- "@fluentui/react-context-selector": "0.0.0-nightlybc5ff01fb020211104.1",
49
- "@fluentui/react-icons": "^1.1.140",
50
- "@fluentui/react-make-styles": "0.0.0-nightlybc5ff01fb020211104.1",
51
- "@fluentui/react-portal": "0.0.0-nightlybc5ff01fb020211104.1",
52
- "@fluentui/react-positioning": "0.0.0-nightlybc5ff01fb020211104.1",
53
- "@fluentui/react-provider": "0.0.0-nightlybc5ff01fb020211104.1",
54
- "@fluentui/react-tabster": "0.0.0-nightlybc5ff01fb020211104.1",
55
- "@fluentui/react-utilities": "0.0.0-nightlybc5ff01fb020211104.1",
48
+ "@fluentui/keyboard-keys": "0.0.0-nightlycbf184efa720211222.1",
49
+ "@fluentui/react-context-selector": "0.0.0-nightlycbf184efa720211222.1",
50
+ "@fluentui/react-icons": "^2.0.154-beta.5",
51
+ "@fluentui/react-make-styles": "0.0.0-nightlycbf184efa720211222.1",
52
+ "@fluentui/react-portal": "0.0.0-nightlycbf184efa720211222.1",
53
+ "@fluentui/react-positioning": "0.0.0-nightlycbf184efa720211222.1",
54
+ "@fluentui/react-shared-contexts": "0.0.0-nightlycbf184efa720211222.1",
55
+ "@fluentui/react-tabster": "0.0.0-nightlycbf184efa720211222.1",
56
+ "@fluentui/react-utilities": "0.0.0-nightlycbf184efa720211222.1",
56
57
  "tslib": "^2.1.0"
57
58
  },
58
59
  "peerDependencies": {
@@ -62,7 +63,6 @@
62
63
  "react-dom": ">=16.8.0 <18.0.0"
63
64
  },
64
65
  "beachball": {
65
- "tag": "beta",
66
66
  "disallowedChangeTypes": [
67
67
  "major",
68
68
  "minor",
@@ -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,12 +0,0 @@
1
- import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
- import makeStylesTests from '@fluentui/react-conformance-make-styles';
3
- export function isConformant(testInfo) {
4
- const defaultOptions = {
5
- asPropHandlesRef: true,
6
- componentPath: module.parent.filename.replace('.test', ''),
7
- skipAsPropTests: true,
8
- extraTests: makeStylesTests
9
- };
10
- baseIsConformant(defaultOptions, testInfo);
11
- }
12
- //# sourceMappingURL=isConformant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;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;AAJ+C,GAA7D;AAOA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","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,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":""}