@artistanbul/frontend-component-header-sumac 1.1.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.
Files changed (165) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +93 -0
  3. package/README.rst +193 -0
  4. package/dist/Avatar.js +43 -0
  5. package/dist/Avatar.js.map +1 -0
  6. package/dist/Header.js +130 -0
  7. package/dist/Header.js.map +1 -0
  8. package/dist/Header.messages.js +110 -0
  9. package/dist/Header.messages.js.map +1 -0
  10. package/dist/Header.test.jsx +104 -0
  11. package/dist/Icons.js +52 -0
  12. package/dist/Icons.js.map +1 -0
  13. package/dist/Logo.js +28 -0
  14. package/dist/Logo.js.map +1 -0
  15. package/dist/Menu/Menu.js +321 -0
  16. package/dist/Menu/Menu.js.map +1 -0
  17. package/dist/Menu/index.js +3 -0
  18. package/dist/Menu/index.js.map +1 -0
  19. package/dist/Menu/menu.scss +45 -0
  20. package/dist/__snapshots__/Header.test.jsx.snap +445 -0
  21. package/dist/desktop-header/DesktopHeader.js +174 -0
  22. package/dist/desktop-header/DesktopHeader.js.map +1 -0
  23. package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js +51 -0
  24. package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js.map +1 -0
  25. package/dist/desktop-header/DesktopHeaderUserMenu.js +49 -0
  26. package/dist/desktop-header/DesktopHeaderUserMenu.js.map +1 -0
  27. package/dist/desktop-header/DesktopLoggedOutItems.js +22 -0
  28. package/dist/desktop-header/DesktopLoggedOutItems.js.map +1 -0
  29. package/dist/generic/messages.js +15 -0
  30. package/dist/generic/messages.js.map +1 -0
  31. package/dist/i18n/index.js +2 -0
  32. package/dist/i18n/index.js.map +1 -0
  33. package/dist/images/omnikampus/artistanbul-logo.png +0 -0
  34. package/dist/images/omnikampus/omnikampus-just-logo.png +0 -0
  35. package/dist/images/omnikampus/omnikampus-logo.png +0 -0
  36. package/dist/index.js +73 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/index.scss +248 -0
  39. package/dist/learning-header/AnonymousUserMenu.js +25 -0
  40. package/dist/learning-header/AnonymousUserMenu.js.map +1 -0
  41. package/dist/learning-header/AuthenticatedUserDropdown.js +57 -0
  42. package/dist/learning-header/AuthenticatedUserDropdown.js.map +1 -0
  43. package/dist/learning-header/LearningHeader.js +61 -0
  44. package/dist/learning-header/LearningHeader.js.map +1 -0
  45. package/dist/learning-header/LearningHeaderCourseInfo.js +24 -0
  46. package/dist/learning-header/LearningHeaderCourseInfo.js.map +1 -0
  47. package/dist/learning-header/LearningHeaderHelpLink.js +13 -0
  48. package/dist/learning-header/LearningHeaderHelpLink.js.map +1 -0
  49. package/dist/learning-header/LearningHeaderUserMenuItems.js +20 -0
  50. package/dist/learning-header/LearningHeaderUserMenuItems.js.map +1 -0
  51. package/dist/learning-header/LearningLoggedOutButtons.js +24 -0
  52. package/dist/learning-header/LearningLoggedOutButtons.js.map +1 -0
  53. package/dist/learning-header/messages.js +40 -0
  54. package/dist/learning-header/messages.js.map +1 -0
  55. package/dist/mobile-header/MobileHeader.js +192 -0
  56. package/dist/mobile-header/MobileHeader.js.map +1 -0
  57. package/dist/mobile-header/MobileHeaderMainMenu.js +46 -0
  58. package/dist/mobile-header/MobileHeaderMainMenu.js.map +1 -0
  59. package/dist/mobile-header/MobileHeaderUserMenu.js +38 -0
  60. package/dist/mobile-header/MobileHeaderUserMenu.js.map +1 -0
  61. package/dist/mobile-header/MobileLoggedOutItems.js +27 -0
  62. package/dist/mobile-header/MobileLoggedOutItems.js.map +1 -0
  63. package/dist/plugin-slots/CourseInfoSlot/README.md +125 -0
  64. package/dist/plugin-slots/CourseInfoSlot/images/add_custom_components_before_and_after_course_info.png +0 -0
  65. package/dist/plugin-slots/CourseInfoSlot/images/replace_course_info_with_custom_component.png +0 -0
  66. package/dist/plugin-slots/CourseInfoSlot/images/replace_course_title.png +0 -0
  67. package/dist/plugin-slots/CourseInfoSlot/index.js +31 -0
  68. package/dist/plugin-slots/CourseInfoSlot/index.js.map +1 -0
  69. package/dist/plugin-slots/DesktopHeaderSlot/README.md +41 -0
  70. package/dist/plugin-slots/DesktopHeaderSlot/images/desktop_header_custom_component.png +0 -0
  71. package/dist/plugin-slots/DesktopHeaderSlot/index.js +15 -0
  72. package/dist/plugin-slots/DesktopHeaderSlot/index.js.map +1 -0
  73. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/README.md +134 -0
  74. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_component.png +0 -0
  75. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_components_before_after.png +0 -0
  76. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_modify_items.png +0 -0
  77. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js +19 -0
  78. package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js.map +1 -0
  79. package/dist/plugin-slots/DesktopMainMenuSlot/README.md +134 -0
  80. package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_component.png +0 -0
  81. package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_components_before_after.png +0 -0
  82. package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_modify_items.png +0 -0
  83. package/dist/plugin-slots/DesktopMainMenuSlot/index.js +19 -0
  84. package/dist/plugin-slots/DesktopMainMenuSlot/index.js.map +1 -0
  85. package/dist/plugin-slots/DesktopSecondaryMenuSlot/README.md +129 -0
  86. package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_component.png +0 -0
  87. package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_components_before_after.png +0 -0
  88. package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_modify_items.png +0 -0
  89. package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js +19 -0
  90. package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js.map +1 -0
  91. package/dist/plugin-slots/DesktopUserMenuSlot/README.md +141 -0
  92. package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_component.png +0 -0
  93. package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_components_before_after.png +0 -0
  94. package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_modify_items.png +0 -0
  95. package/dist/plugin-slots/DesktopUserMenuSlot/index.js +19 -0
  96. package/dist/plugin-slots/DesktopUserMenuSlot/index.js.map +1 -0
  97. package/dist/plugin-slots/LearningHelpSlot/README.md +41 -0
  98. package/dist/plugin-slots/LearningHelpSlot/images/learning_help_custom_component.png +0 -0
  99. package/dist/plugin-slots/LearningHelpSlot/index.js +10 -0
  100. package/dist/plugin-slots/LearningHelpSlot/index.js.map +1 -0
  101. package/dist/plugin-slots/LearningLoggedOutItemsSlot/README.md +132 -0
  102. package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_component.png +0 -0
  103. package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_components_before_after.png +0 -0
  104. package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_modified_items.png +0 -0
  105. package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js +17 -0
  106. package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js.map +1 -0
  107. package/dist/plugin-slots/LearningUserMenuSlot/README.md +130 -0
  108. package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_component.png +0 -0
  109. package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_components_before_after.png +0 -0
  110. package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_modified_items.png +0 -0
  111. package/dist/plugin-slots/LearningUserMenuSlot/index.js +17 -0
  112. package/dist/plugin-slots/LearningUserMenuSlot/index.js.map +1 -0
  113. package/dist/plugin-slots/LogoSlot/README.md +69 -0
  114. package/dist/plugin-slots/LogoSlot/index.js +26 -0
  115. package/dist/plugin-slots/LogoSlot/index.js.map +1 -0
  116. package/dist/plugin-slots/MobileHeaderSlot/README.md +41 -0
  117. package/dist/plugin-slots/MobileHeaderSlot/images/mobile_header_custom_component.png +0 -0
  118. package/dist/plugin-slots/MobileHeaderSlot/index.js +15 -0
  119. package/dist/plugin-slots/MobileHeaderSlot/index.js.map +1 -0
  120. package/dist/plugin-slots/MobileLoggedOutItemsSlot/README.md +134 -0
  121. package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_component.png +0 -0
  122. package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_components_before_after.png +0 -0
  123. package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_modify_items.png +0 -0
  124. package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js +19 -0
  125. package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js.map +1 -0
  126. package/dist/plugin-slots/MobileMainMenuSlot/README.md +134 -0
  127. package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_component.png +0 -0
  128. package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_components_before_after.png +0 -0
  129. package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_modify_items.png +0 -0
  130. package/dist/plugin-slots/MobileMainMenuSlot/index.js +19 -0
  131. package/dist/plugin-slots/MobileMainMenuSlot/index.js.map +1 -0
  132. package/dist/plugin-slots/MobileUserMenuSlot/README.md +142 -0
  133. package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_component.png +0 -0
  134. package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_components_before_after.png +0 -0
  135. package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_modify_items.png +0 -0
  136. package/dist/plugin-slots/MobileUserMenuSlot/index.js +19 -0
  137. package/dist/plugin-slots/MobileUserMenuSlot/index.js.map +1 -0
  138. package/dist/plugin-slots/README.md +15 -0
  139. package/dist/setupTest.js +125 -0
  140. package/dist/studio-header/BrandNav.js +24 -0
  141. package/dist/studio-header/BrandNav.js.map +1 -0
  142. package/dist/studio-header/CourseLockUp.js +46 -0
  143. package/dist/studio-header/CourseLockUp.js.map +1 -0
  144. package/dist/studio-header/HeaderBody.js +143 -0
  145. package/dist/studio-header/HeaderBody.js.map +1 -0
  146. package/dist/studio-header/MobileHeader.js +79 -0
  147. package/dist/studio-header/MobileHeader.js.map +1 -0
  148. package/dist/studio-header/MobileMenu.js +46 -0
  149. package/dist/studio-header/MobileMenu.js.map +1 -0
  150. package/dist/studio-header/NavDropdownMenu.js +32 -0
  151. package/dist/studio-header/NavDropdownMenu.js.map +1 -0
  152. package/dist/studio-header/StudioHeader.js +79 -0
  153. package/dist/studio-header/StudioHeader.js.map +1 -0
  154. package/dist/studio-header/StudioHeader.scss +49 -0
  155. package/dist/studio-header/UserMenu.js +55 -0
  156. package/dist/studio-header/UserMenu.js.map +1 -0
  157. package/dist/studio-header/index.js +3 -0
  158. package/dist/studio-header/index.js.map +1 -0
  159. package/dist/studio-header/messages.js +55 -0
  160. package/dist/studio-header/messages.js.map +1 -0
  161. package/dist/studio-header/utils.js +26 -0
  162. package/dist/studio-header/utils.js.map +1 -0
  163. package/dist/test-utils.js +26 -0
  164. package/dist/test-utils.js.map +1 -0
  165. package/package.json +79 -0
@@ -0,0 +1,104 @@
1
+ /* eslint-disable react/prop-types */
2
+ import React from 'react';
3
+ import { IntlProvider } from '@edx/frontend-platform/i18n';
4
+ import TestRenderer from 'react-test-renderer';
5
+ import { AppContext } from '@edx/frontend-platform/react';
6
+ import { Context as ResponsiveContext } from 'react-responsive';
7
+
8
+ import Header from './index';
9
+
10
+ const HeaderComponent = ({ width, contextValue }) => (
11
+ <ResponsiveContext.Provider value={width}>
12
+ <IntlProvider locale="en" messages={{}}>
13
+ <AppContext.Provider
14
+ value={contextValue}
15
+ >
16
+ <Header />
17
+ </AppContext.Provider>
18
+ </IntlProvider>
19
+ </ResponsiveContext.Provider>
20
+ );
21
+
22
+ describe('<Header />', () => {
23
+ it('renders correctly for anonymous desktop', () => {
24
+ const contextValue = {
25
+ authenticatedUser: null,
26
+ config: {
27
+ LMS_BASE_URL: process.env.LMS_BASE_URL,
28
+ SITE_NAME: process.env.SITE_NAME,
29
+ LOGIN_URL: process.env.LOGIN_URL,
30
+ LOGOUT_URL: process.env.LOGOUT_URL,
31
+ LOGO_URL: process.env.LOGO_URL,
32
+ },
33
+ };
34
+ const component = <HeaderComponent width={{ width: 1280 }} contextValue={contextValue} />;
35
+
36
+ const wrapper = TestRenderer.create(component);
37
+
38
+ expect(wrapper.toJSON()).toMatchSnapshot();
39
+ });
40
+
41
+ it('renders correctly for authenticated desktop', () => {
42
+ const contextValue = {
43
+ authenticatedUser: {
44
+ userId: 'abc123',
45
+ username: 'edX',
46
+ roles: [],
47
+ administrator: false,
48
+ },
49
+ config: {
50
+ LMS_BASE_URL: process.env.LMS_BASE_URL,
51
+ SITE_NAME: process.env.SITE_NAME,
52
+ LOGIN_URL: process.env.LOGIN_URL,
53
+ LOGOUT_URL: process.env.LOGOUT_URL,
54
+ LOGO_URL: process.env.LOGO_URL,
55
+ },
56
+ };
57
+ const component = <HeaderComponent width={{ width: 1280 }} contextValue={contextValue} />;
58
+
59
+ const wrapper = TestRenderer.create(component);
60
+
61
+ expect(wrapper.toJSON()).toMatchSnapshot();
62
+ });
63
+
64
+ it('renders correctly for anonymous mobile', () => {
65
+ const contextValue = {
66
+ authenticatedUser: null,
67
+ config: {
68
+ LMS_BASE_URL: process.env.LMS_BASE_URL,
69
+ SITE_NAME: process.env.SITE_NAME,
70
+ LOGIN_URL: process.env.LOGIN_URL,
71
+ LOGOUT_URL: process.env.LOGOUT_URL,
72
+ LOGO_URL: process.env.LOGO_URL,
73
+ },
74
+ };
75
+ const component = <HeaderComponent width={{ width: 500 }} contextValue={contextValue} />;
76
+
77
+ const wrapper = TestRenderer.create(component);
78
+
79
+ expect(wrapper.toJSON()).toMatchSnapshot();
80
+ });
81
+
82
+ it('renders correctly for authenticated mobile', () => {
83
+ const contextValue = {
84
+ authenticatedUser: {
85
+ userId: 'abc123',
86
+ username: 'edX',
87
+ roles: [],
88
+ administrator: false,
89
+ },
90
+ config: {
91
+ LMS_BASE_URL: process.env.LMS_BASE_URL,
92
+ SITE_NAME: process.env.SITE_NAME,
93
+ LOGIN_URL: process.env.LOGIN_URL,
94
+ LOGOUT_URL: process.env.LOGOUT_URL,
95
+ LOGO_URL: process.env.LOGO_URL,
96
+ },
97
+ };
98
+ const component = <HeaderComponent width={{ width: 500 }} contextValue={contextValue} />;
99
+
100
+ const wrapper = TestRenderer.create(component);
101
+
102
+ expect(wrapper.toJSON()).toMatchSnapshot();
103
+ });
104
+ });
package/dist/Icons.js ADDED
@@ -0,0 +1,52 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React from 'react';
3
+ export var MenuIcon = function MenuIcon(props) {
4
+ return /*#__PURE__*/React.createElement("svg", _extends({
5
+ width: "24px",
6
+ height: "24px",
7
+ viewBox: "0 0 24 24",
8
+ version: "1.1"
9
+ }, props), /*#__PURE__*/React.createElement("rect", {
10
+ fill: "currentColor",
11
+ x: "2",
12
+ y: "5",
13
+ width: "20",
14
+ height: "2"
15
+ }), /*#__PURE__*/React.createElement("rect", {
16
+ fill: "currentColor",
17
+ x: "2",
18
+ y: "11",
19
+ width: "20",
20
+ height: "2"
21
+ }), /*#__PURE__*/React.createElement("rect", {
22
+ fill: "currentColor",
23
+ x: "2",
24
+ y: "17",
25
+ width: "20",
26
+ height: "2"
27
+ }));
28
+ };
29
+ export var AvatarIcon = function AvatarIcon(props) {
30
+ return /*#__PURE__*/React.createElement("svg", _extends({
31
+ width: "24px",
32
+ height: "24px",
33
+ viewBox: "0 0 24 24",
34
+ version: "1.1"
35
+ }, props), /*#__PURE__*/React.createElement("path", {
36
+ d: "M4.10255106,18.1351061 C4.7170266,16.0581859 8.01891846,14.4720277 12,14.4720277 C15.9810815,14.4720277 19.2829734,16.0581859 19.8974489,18.1351061 C21.215206,16.4412566 22,14.3122775 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,14.3122775 2.78479405,16.4412566 4.10255106,18.1351061 Z M12,24 C5.372583,24 0,18.627417 0,12 C0,5.372583 5.372583,0 12,0 C18.627417,0 24,5.372583 24,12 C24,18.627417 18.627417,24 12,24 Z M12,13 C9.790861,13 8,11.209139 8,9 C8,6.790861 9.790861,5 12,5 C14.209139,5 16,6.790861 16,9 C16,11.209139 14.209139,13 12,13 Z",
37
+ fill: "currentColor"
38
+ }));
39
+ };
40
+ export var CaretIcon = function CaretIcon(props) {
41
+ return /*#__PURE__*/React.createElement("svg", _extends({
42
+ width: "16px",
43
+ height: "16px",
44
+ viewBox: "0 0 16 16",
45
+ version: "1.1"
46
+ }, props), /*#__PURE__*/React.createElement("path", {
47
+ d: "M7,4 L7,8 L11,8 L11,10 L5,10 L5,4 L7,4 Z",
48
+ fill: "currentColor",
49
+ transform: "translate(8.000000, 7.000000) rotate(-45.000000) translate(-8.000000, -7.000000) "
50
+ }));
51
+ };
52
+ //# sourceMappingURL=Icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icons.js","names":["React","MenuIcon","props","createElement","_extends","width","height","viewBox","version","fill","x","y","AvatarIcon","d","CaretIcon","transform"],"sources":["../src/Icons.jsx"],"sourcesContent":["import React from 'react';\n\nexport const MenuIcon = (props) => (\n <svg\n width=\"24px\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n version=\"1.1\"\n {...props}\n >\n <rect fill=\"currentColor\" x=\"2\" y=\"5\" width=\"20\" height=\"2\" />\n <rect fill=\"currentColor\" x=\"2\" y=\"11\" width=\"20\" height=\"2\" />\n <rect fill=\"currentColor\" x=\"2\" y=\"17\" width=\"20\" height=\"2\" />\n </svg>\n);\n\nexport const AvatarIcon = (props) => (\n <svg\n width=\"24px\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n version=\"1.1\"\n {...props}\n >\n <path\n d=\"M4.10255106,18.1351061 C4.7170266,16.0581859 8.01891846,14.4720277 12,14.4720277 C15.9810815,14.4720277 19.2829734,16.0581859 19.8974489,18.1351061 C21.215206,16.4412566 22,14.3122775 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,14.3122775 2.78479405,16.4412566 4.10255106,18.1351061 Z M12,24 C5.372583,24 0,18.627417 0,12 C0,5.372583 5.372583,0 12,0 C18.627417,0 24,5.372583 24,12 C24,18.627417 18.627417,24 12,24 Z M12,13 C9.790861,13 8,11.209139 8,9 C8,6.790861 9.790861,5 12,5 C14.209139,5 16,6.790861 16,9 C16,11.209139 14.209139,13 12,13 Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport const CaretIcon = (props) => (\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n {...props}\n >\n <path\n d=\"M7,4 L7,8 L11,8 L11,10 L5,10 L5,4 L7,4 Z\"\n fill=\"currentColor\"\n transform=\"translate(8.000000, 7.000000) rotate(-45.000000) translate(-8.000000, -7.000000) \"\n />\n </svg>\n);\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAO,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,KAAK;EAAA,oBAC5BF,KAAA,CAAAG,aAAA,QAAAC,QAAA;IACEC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC;EAAK,GACTN,KAAK,gBAETF,KAAA,CAAAG,aAAA;IAAMM,IAAI,EAAC,cAAc;IAACC,CAAC,EAAC,GAAG;IAACC,CAAC,EAAC,GAAG;IAACN,KAAK,EAAC,IAAI;IAACC,MAAM,EAAC;EAAG,CAAE,CAAC,eAC9DN,KAAA,CAAAG,aAAA;IAAMM,IAAI,EAAC,cAAc;IAACC,CAAC,EAAC,GAAG;IAACC,CAAC,EAAC,IAAI;IAACN,KAAK,EAAC,IAAI;IAACC,MAAM,EAAC;EAAG,CAAE,CAAC,eAC/DN,KAAA,CAAAG,aAAA;IAAMM,IAAI,EAAC,cAAc;IAACC,CAAC,EAAC,GAAG;IAACC,CAAC,EAAC,IAAI;IAACN,KAAK,EAAC,IAAI;IAACC,MAAM,EAAC;EAAG,CAAE,CAC3D,CAAC;AAAA,CACP;AAED,OAAO,IAAMM,UAAU,GAAG,SAAbA,UAAUA,CAAIV,KAAK;EAAA,oBAC9BF,KAAA,CAAAG,aAAA,QAAAC,QAAA;IACEC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC;EAAK,GACTN,KAAK,gBAETF,KAAA,CAAAG,aAAA;IACEU,CAAC,EAAC,6jBAA6jB;IAC/jBJ,IAAI,EAAC;EAAc,CACpB,CACE,CAAC;AAAA,CACP;AAED,OAAO,IAAMK,SAAS,GAAG,SAAZA,SAASA,CAAIZ,KAAK;EAAA,oBAC7BF,KAAA,CAAAG,aAAA,QAAAC,QAAA;IACEC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbC,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC;EAAK,GACTN,KAAK,gBAETF,KAAA,CAAAG,aAAA;IACEU,CAAC,EAAC,0CAA0C;IAC5CJ,IAAI,EAAC,cAAc;IACnBM,SAAS,EAAC;EAAmF,CAC9F,CACE,CAAC;AAAA,CACP","ignoreList":[]}
package/dist/Logo.js ADDED
@@ -0,0 +1,28 @@
1
+ var _excluded = ["href", "src", "alt"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
5
+ import React from 'react';
6
+ import PropTypes from 'prop-types';
7
+ var Logo = function Logo(_ref) {
8
+ var href = _ref.href,
9
+ src = _ref.src,
10
+ alt = _ref.alt,
11
+ attributes = _objectWithoutProperties(_ref, _excluded);
12
+ return /*#__PURE__*/React.createElement("a", _extends({
13
+ href: href,
14
+ className: "logo"
15
+ }, attributes), /*#__PURE__*/React.createElement("img", {
16
+ className: "d-block",
17
+ src: src,
18
+ alt: alt
19
+ }));
20
+ };
21
+ export var logoDataShape = {
22
+ href: PropTypes.string.isRequired,
23
+ src: PropTypes.string.isRequired,
24
+ alt: PropTypes.string.isRequired
25
+ };
26
+ Logo.propTypes = logoDataShape;
27
+ export default Logo;
28
+ //# sourceMappingURL=Logo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logo.js","names":["React","PropTypes","Logo","_ref","href","src","alt","attributes","_objectWithoutProperties","_excluded","createElement","_extends","className","logoDataShape","string","isRequired","propTypes"],"sources":["../src/Logo.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Logo = ({\n href,\n src,\n alt,\n ...attributes\n}) => (\n <a href={href} className=\"logo\" {...attributes}>\n <img className=\"d-block\" src={src} alt={alt} />\n </a>\n);\n\nexport const logoDataShape = {\n href: PropTypes.string.isRequired,\n src: PropTypes.string.isRequired,\n alt: PropTypes.string.isRequired,\n};\n\nLogo.propTypes = logoDataShape;\n\nexport default Logo;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,IAAMC,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA;EAAA,IACRC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IACAC,UAAU,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBAEbT,KAAA,CAAAU,aAAA,MAAAC,QAAA;IAAGP,IAAI,EAAEA,IAAK;IAACQ,SAAS,EAAC;EAAM,GAAKL,UAAU,gBAC5CP,KAAA,CAAAU,aAAA;IAAKE,SAAS,EAAC,SAAS;IAACP,GAAG,EAAEA,GAAI;IAACC,GAAG,EAAEA;EAAI,CAAE,CAC7C,CAAC;AAAA,CACL;AAED,OAAO,IAAMO,aAAa,GAAG;EAC3BT,IAAI,EAAEH,SAAS,CAACa,MAAM,CAACC,UAAU;EACjCV,GAAG,EAAEJ,SAAS,CAACa,MAAM,CAACC,UAAU;EAChCT,GAAG,EAAEL,SAAS,CAACa,MAAM,CAACC;AACxB,CAAC;AAEDb,IAAI,CAACc,SAAS,GAAGH,aAAa;AAE9B,eAAeX,IAAI","ignoreList":[]}
@@ -0,0 +1,321 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["tag", "className"],
3
+ _excluded2 = ["tag", "className"];
4
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
9
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
10
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
12
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
13
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
14
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
20
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
21
+ import React from 'react';
22
+ import { CSSTransition } from 'react-transition-group';
23
+ import PropTypes from 'prop-types';
24
+ var MenuTrigger = function MenuTrigger(_ref) {
25
+ var tag = _ref.tag,
26
+ className = _ref.className,
27
+ attributes = _objectWithoutProperties(_ref, _excluded);
28
+ return /*#__PURE__*/React.createElement(tag, _objectSpread({
29
+ className: "menu-trigger ".concat(className)
30
+ }, attributes));
31
+ };
32
+ MenuTrigger.propTypes = {
33
+ tag: PropTypes.string,
34
+ className: PropTypes.string
35
+ };
36
+ MenuTrigger.defaultProps = {
37
+ tag: 'div',
38
+ className: null
39
+ };
40
+ var MenuTriggerComp = /*#__PURE__*/React.createElement(MenuTrigger, null);
41
+ var MenuTriggerType = MenuTriggerComp.type;
42
+ var MenuContent = function MenuContent(_ref2) {
43
+ var tag = _ref2.tag,
44
+ className = _ref2.className,
45
+ attributes = _objectWithoutProperties(_ref2, _excluded2);
46
+ return /*#__PURE__*/React.createElement(tag, _objectSpread({
47
+ className: ['menu-content', className].join(' ')
48
+ }, attributes));
49
+ };
50
+ MenuContent.propTypes = {
51
+ tag: PropTypes.string,
52
+ className: PropTypes.string
53
+ };
54
+ MenuContent.defaultProps = {
55
+ tag: 'div',
56
+ className: null
57
+ };
58
+ var menuPropTypes = {
59
+ tag: PropTypes.string,
60
+ onClose: PropTypes.func,
61
+ onOpen: PropTypes.func,
62
+ closeOnDocumentClick: PropTypes.bool,
63
+ respondToPointerEvents: PropTypes.bool,
64
+ className: PropTypes.string,
65
+ transitionTimeout: PropTypes.number,
66
+ transitionClassName: PropTypes.string,
67
+ children: PropTypes.arrayOf(PropTypes.node).isRequired
68
+ };
69
+ var Menu = /*#__PURE__*/function (_React$Component) {
70
+ function Menu(props) {
71
+ var _this;
72
+ _classCallCheck(this, Menu);
73
+ _this = _callSuper(this, Menu, [props]);
74
+ _this.menu = /*#__PURE__*/React.createRef();
75
+ _this.state = {
76
+ expanded: false
77
+ };
78
+ _this.onTriggerClick = _this.onTriggerClick.bind(_this);
79
+ _this.onCloseClick = _this.onCloseClick.bind(_this);
80
+ _this.onKeyDown = _this.onKeyDown.bind(_this);
81
+ _this.onDocumentClick = _this.onDocumentClick.bind(_this);
82
+ _this.onMouseEnter = _this.onMouseEnter.bind(_this);
83
+ _this.onMouseLeave = _this.onMouseLeave.bind(_this);
84
+ return _this;
85
+ }
86
+
87
+ // Lifecycle Events
88
+ _inherits(Menu, _React$Component);
89
+ return _createClass(Menu, [{
90
+ key: "componentWillUnmount",
91
+ value: function componentWillUnmount() {
92
+ document.removeEventListener('touchend', this.onDocumentClick, true);
93
+ document.removeEventListener('click', this.onDocumentClick, true);
94
+
95
+ // Call onClose callback when unmounting and open
96
+ if (this.state.expanded && this.props.onClose) {
97
+ this.props.onClose();
98
+ }
99
+ }
100
+
101
+ // Event handlers
102
+ }, {
103
+ key: "onDocumentClick",
104
+ value: function onDocumentClick(e) {
105
+ if (!this.props.closeOnDocumentClick) {
106
+ return;
107
+ }
108
+ var clickIsInMenu = this.menu.current === e.target || this.menu.current.contains(e.target);
109
+ if (clickIsInMenu) {
110
+ return;
111
+ }
112
+ this.close();
113
+ }
114
+ }, {
115
+ key: "onTriggerClick",
116
+ value: function onTriggerClick(e) {
117
+ // Let the browser follow the link of the trigger if the menu
118
+ // is already expanded and the trigger has an href attribute
119
+ if (this.state.expanded && e.target.getAttribute('href')) {
120
+ return;
121
+ }
122
+ e.preventDefault();
123
+ this.toggle();
124
+ }
125
+ }, {
126
+ key: "onCloseClick",
127
+ value: function onCloseClick() {
128
+ this.getFocusableElements()[0].focus();
129
+ this.close();
130
+ }
131
+ }, {
132
+ key: "onKeyDown",
133
+ value: function onKeyDown(e) {
134
+ if (!this.state.expanded) {
135
+ return;
136
+ }
137
+ switch (e.key) {
138
+ case 'Escape':
139
+ {
140
+ e.preventDefault();
141
+ e.stopPropagation();
142
+ this.getFocusableElements()[0].focus();
143
+ this.close();
144
+ break;
145
+ }
146
+ case 'Enter':
147
+ {
148
+ // Using focusable elements instead of a ref to the trigger
149
+ // because Hyperlink and Button can handle refs as functional components
150
+ if (document.activeElement === this.getFocusableElements()[0]) {
151
+ e.preventDefault();
152
+ this.toggle();
153
+ }
154
+ break;
155
+ }
156
+ case 'Tab':
157
+ {
158
+ e.preventDefault();
159
+ if (e.shiftKey) {
160
+ this.focusPrevious();
161
+ } else {
162
+ this.focusNext();
163
+ }
164
+ break;
165
+ }
166
+ case 'ArrowDown':
167
+ {
168
+ e.preventDefault();
169
+ this.focusNext();
170
+ break;
171
+ }
172
+ case 'ArrowUp':
173
+ {
174
+ e.preventDefault();
175
+ this.focusPrevious();
176
+ break;
177
+ }
178
+ default:
179
+ }
180
+ }
181
+ }, {
182
+ key: "onMouseEnter",
183
+ value: function onMouseEnter() {
184
+ if (!this.props.respondToPointerEvents) {
185
+ return;
186
+ }
187
+ this.open();
188
+ }
189
+ }, {
190
+ key: "onMouseLeave",
191
+ value: function onMouseLeave() {
192
+ if (!this.props.respondToPointerEvents) {
193
+ return;
194
+ }
195
+ this.close();
196
+ }
197
+
198
+ // Internal functions
199
+ }, {
200
+ key: "getFocusableElements",
201
+ value: function getFocusableElements() {
202
+ return this.menu.current.querySelectorAll('button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])');
203
+ }
204
+ }, {
205
+ key: "getAttributesFromProps",
206
+ value: function getAttributesFromProps() {
207
+ var _this2 = this;
208
+ // Any extra props are attributes for the menu
209
+ var attributes = {};
210
+ Object.keys(this.props).filter(function (property) {
211
+ return menuPropTypes[property] === undefined;
212
+ }).forEach(function (property) {
213
+ attributes[property] = _this2.props[property];
214
+ });
215
+ return attributes;
216
+ }
217
+ }, {
218
+ key: "focusNext",
219
+ value: function focusNext() {
220
+ var focusableElements = Array.from(this.getFocusableElements());
221
+ var activeIndex = focusableElements.indexOf(document.activeElement);
222
+ var nextIndex = (activeIndex + 1) % focusableElements.length;
223
+ focusableElements[nextIndex].focus();
224
+ }
225
+ }, {
226
+ key: "focusPrevious",
227
+ value: function focusPrevious() {
228
+ var focusableElements = Array.from(this.getFocusableElements());
229
+ var activeIndex = focusableElements.indexOf(document.activeElement);
230
+ var previousIndex = (activeIndex || focusableElements.length) - 1;
231
+ focusableElements[previousIndex].focus();
232
+ }
233
+ }, {
234
+ key: "open",
235
+ value: function open() {
236
+ if (this.props.onOpen) {
237
+ this.props.onOpen();
238
+ }
239
+ this.setState({
240
+ expanded: true
241
+ });
242
+ // Listen to touchend and click events to ensure the menu
243
+ // can be closed on mobile, pointer, and mixed input devices
244
+ document.addEventListener('touchend', this.onDocumentClick, true);
245
+ document.addEventListener('click', this.onDocumentClick, true);
246
+ }
247
+ }, {
248
+ key: "close",
249
+ value: function close() {
250
+ if (this.props.onClose) {
251
+ this.props.onClose();
252
+ }
253
+ this.setState({
254
+ expanded: false
255
+ });
256
+ document.removeEventListener('touchend', this.onDocumentClick, true);
257
+ document.removeEventListener('click', this.onDocumentClick, true);
258
+ }
259
+ }, {
260
+ key: "toggle",
261
+ value: function toggle() {
262
+ if (this.state.expanded) {
263
+ this.close();
264
+ } else {
265
+ this.open();
266
+ }
267
+ }
268
+ }, {
269
+ key: "renderTrigger",
270
+ value: function renderTrigger(node) {
271
+ return /*#__PURE__*/React.cloneElement(node, {
272
+ onClick: this.onTriggerClick,
273
+ 'aria-haspopup': 'menu',
274
+ 'aria-expanded': this.state.expanded
275
+ });
276
+ }
277
+ }, {
278
+ key: "renderMenuContent",
279
+ value: function renderMenuContent(node) {
280
+ return /*#__PURE__*/React.createElement(CSSTransition, {
281
+ "in": this.state.expanded,
282
+ timeout: this.props.transitionTimeout,
283
+ classNames: this.props.transitionClassName,
284
+ unmountOnExit: true
285
+ }, node);
286
+ }
287
+ }, {
288
+ key: "render",
289
+ value: function render() {
290
+ var _this3 = this;
291
+ var className = this.props.className;
292
+ var wrappedChildren = React.Children.map(this.props.children, function (child) {
293
+ if (child.type === MenuTriggerType) {
294
+ return _this3.renderTrigger(child);
295
+ }
296
+ return _this3.renderMenuContent(child);
297
+ });
298
+ var rootClassName = this.state.expanded ? 'menu expanded' : 'menu';
299
+ return /*#__PURE__*/React.createElement(this.props.tag, _objectSpread({
300
+ className: "".concat(rootClassName, " ").concat(className),
301
+ ref: this.menu,
302
+ onKeyDown: this.onKeyDown,
303
+ onMouseEnter: this.onMouseEnter,
304
+ onMouseLeave: this.onMouseLeave
305
+ }, this.getAttributesFromProps()), wrappedChildren);
306
+ }
307
+ }]);
308
+ }(React.Component);
309
+ Menu.propTypes = menuPropTypes;
310
+ Menu.defaultProps = {
311
+ tag: 'div',
312
+ className: null,
313
+ onClose: null,
314
+ onOpen: null,
315
+ respondToPointerEvents: false,
316
+ closeOnDocumentClick: true,
317
+ transitionTimeout: 250,
318
+ transitionClassName: 'menu-content'
319
+ };
320
+ export { Menu, MenuTrigger, MenuContent };
321
+ //# sourceMappingURL=Menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.js","names":["React","CSSTransition","PropTypes","MenuTrigger","_ref","tag","className","attributes","_objectWithoutProperties","_excluded","createElement","_objectSpread","concat","propTypes","string","defaultProps","MenuTriggerComp","MenuTriggerType","type","MenuContent","_ref2","_excluded2","join","menuPropTypes","onClose","func","onOpen","closeOnDocumentClick","bool","respondToPointerEvents","transitionTimeout","number","transitionClassName","children","arrayOf","node","isRequired","Menu","_React$Component","props","_this","_classCallCheck","_callSuper","menu","createRef","state","expanded","onTriggerClick","bind","onCloseClick","onKeyDown","onDocumentClick","onMouseEnter","onMouseLeave","_inherits","_createClass","key","value","componentWillUnmount","document","removeEventListener","e","clickIsInMenu","current","target","contains","close","getAttribute","preventDefault","toggle","getFocusableElements","focus","stopPropagation","activeElement","shiftKey","focusPrevious","focusNext","open","querySelectorAll","getAttributesFromProps","_this2","Object","keys","filter","property","undefined","forEach","focusableElements","Array","from","activeIndex","indexOf","nextIndex","length","previousIndex","setState","addEventListener","renderTrigger","cloneElement","onClick","renderMenuContent","timeout","classNames","unmountOnExit","render","_this3","wrappedChildren","Children","map","child","rootClassName","ref","Component"],"sources":["../../src/Menu/Menu.jsx"],"sourcesContent":["import React from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport PropTypes from 'prop-types';\n\nconst MenuTrigger = ({ tag, className, ...attributes }) => React.createElement(tag, {\n className: `menu-trigger ${className}`,\n ...attributes,\n});\nMenuTrigger.propTypes = {\n tag: PropTypes.string,\n className: PropTypes.string,\n};\nMenuTrigger.defaultProps = {\n tag: 'div',\n className: null,\n};\nconst MenuTriggerComp = <MenuTrigger />;\nconst MenuTriggerType = MenuTriggerComp.type;\n\nconst MenuContent = ({ tag, className, ...attributes }) => React.createElement(tag, {\n className: ['menu-content', className].join(' '),\n ...attributes,\n});\nMenuContent.propTypes = {\n tag: PropTypes.string,\n className: PropTypes.string,\n};\nMenuContent.defaultProps = {\n tag: 'div',\n className: null,\n};\n\nconst menuPropTypes = {\n tag: PropTypes.string,\n onClose: PropTypes.func,\n onOpen: PropTypes.func,\n closeOnDocumentClick: PropTypes.bool,\n respondToPointerEvents: PropTypes.bool,\n className: PropTypes.string,\n transitionTimeout: PropTypes.number,\n transitionClassName: PropTypes.string,\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n};\n\nclass Menu extends React.Component {\n constructor(props) {\n super(props);\n\n this.menu = React.createRef();\n this.state = {\n expanded: false,\n };\n\n this.onTriggerClick = this.onTriggerClick.bind(this);\n this.onCloseClick = this.onCloseClick.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onDocumentClick = this.onDocumentClick.bind(this);\n this.onMouseEnter = this.onMouseEnter.bind(this);\n this.onMouseLeave = this.onMouseLeave.bind(this);\n }\n\n // Lifecycle Events\n componentWillUnmount() {\n document.removeEventListener('touchend', this.onDocumentClick, true);\n document.removeEventListener('click', this.onDocumentClick, true);\n\n // Call onClose callback when unmounting and open\n if (this.state.expanded && this.props.onClose) {\n this.props.onClose();\n }\n }\n\n // Event handlers\n onDocumentClick(e) {\n if (!this.props.closeOnDocumentClick) {\n return;\n }\n\n const clickIsInMenu = this.menu.current === e.target || this.menu.current.contains(e.target);\n if (clickIsInMenu) {\n return;\n }\n\n this.close();\n }\n\n onTriggerClick(e) {\n // Let the browser follow the link of the trigger if the menu\n // is already expanded and the trigger has an href attribute\n if (this.state.expanded && e.target.getAttribute('href')) {\n return;\n }\n\n e.preventDefault();\n this.toggle();\n }\n\n onCloseClick() {\n this.getFocusableElements()[0].focus();\n this.close();\n }\n\n onKeyDown(e) {\n if (!this.state.expanded) {\n return;\n }\n switch (e.key) {\n case 'Escape': {\n e.preventDefault();\n e.stopPropagation();\n this.getFocusableElements()[0].focus();\n this.close();\n break;\n }\n case 'Enter': {\n // Using focusable elements instead of a ref to the trigger\n // because Hyperlink and Button can handle refs as functional components\n if (document.activeElement === this.getFocusableElements()[0]) {\n e.preventDefault();\n this.toggle();\n }\n break;\n }\n case 'Tab': {\n e.preventDefault();\n if (e.shiftKey) {\n this.focusPrevious();\n } else {\n this.focusNext();\n }\n break;\n }\n case 'ArrowDown': {\n e.preventDefault();\n this.focusNext();\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n this.focusPrevious();\n break;\n }\n default:\n }\n }\n\n onMouseEnter() {\n if (!this.props.respondToPointerEvents) {\n return;\n }\n this.open();\n }\n\n onMouseLeave() {\n if (!this.props.respondToPointerEvents) {\n return;\n }\n this.close();\n }\n\n // Internal functions\n\n getFocusableElements() {\n return this.menu.current.querySelectorAll('button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not([disabled])');\n }\n\n getAttributesFromProps() {\n // Any extra props are attributes for the menu\n const attributes = {};\n Object.keys(this.props)\n .filter(property => menuPropTypes[property] === undefined)\n .forEach((property) => {\n attributes[property] = this.props[property];\n });\n return attributes;\n }\n\n focusNext() {\n const focusableElements = Array.from(this.getFocusableElements());\n const activeIndex = focusableElements.indexOf(document.activeElement);\n const nextIndex = (activeIndex + 1) % focusableElements.length;\n focusableElements[nextIndex].focus();\n }\n\n focusPrevious() {\n const focusableElements = Array.from(this.getFocusableElements());\n const activeIndex = focusableElements.indexOf(document.activeElement);\n const previousIndex = (activeIndex || focusableElements.length) - 1;\n focusableElements[previousIndex].focus();\n }\n\n open() {\n if (this.props.onOpen) {\n this.props.onOpen();\n }\n this.setState({ expanded: true });\n // Listen to touchend and click events to ensure the menu\n // can be closed on mobile, pointer, and mixed input devices\n document.addEventListener('touchend', this.onDocumentClick, true);\n document.addEventListener('click', this.onDocumentClick, true);\n }\n\n close() {\n if (this.props.onClose) {\n this.props.onClose();\n }\n this.setState({ expanded: false });\n document.removeEventListener('touchend', this.onDocumentClick, true);\n document.removeEventListener('click', this.onDocumentClick, true);\n }\n\n toggle() {\n if (this.state.expanded) {\n this.close();\n } else {\n this.open();\n }\n }\n\n renderTrigger(node) {\n return React.cloneElement(node, {\n onClick: this.onTriggerClick,\n 'aria-haspopup': 'menu',\n 'aria-expanded': this.state.expanded,\n });\n }\n\n renderMenuContent(node) {\n return (\n <CSSTransition\n in={this.state.expanded}\n timeout={this.props.transitionTimeout}\n classNames={this.props.transitionClassName}\n unmountOnExit\n >\n {node}\n </CSSTransition>\n );\n }\n\n render() {\n const { className } = this.props;\n\n const wrappedChildren = React.Children.map(this.props.children, (child) => {\n if (child.type === MenuTriggerType) {\n return this.renderTrigger(child);\n }\n return this.renderMenuContent(child);\n });\n\n const rootClassName = this.state.expanded ? 'menu expanded' : 'menu';\n\n return React.createElement(this.props.tag, {\n className: `${rootClassName} ${className}`,\n ref: this.menu,\n onKeyDown: this.onKeyDown,\n onMouseEnter: this.onMouseEnter,\n onMouseLeave: this.onMouseLeave,\n ...this.getAttributesFromProps(),\n }, wrappedChildren);\n }\n}\n\nMenu.propTypes = menuPropTypes;\nMenu.defaultProps = {\n tag: 'div',\n className: null,\n onClose: null,\n onOpen: null,\n respondToPointerEvents: false,\n closeOnDocumentClick: true,\n transitionTimeout: 250,\n transitionClassName: 'menu-content',\n};\n\nexport { Menu, MenuTrigger, MenuContent };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,wBAAwB;AACtD,OAAOC,SAAS,MAAM,YAAY;AAElC,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA;EAAA,IAAMC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAKC,UAAU,GAAAC,wB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CAACU,aAAa,CAAC,IAAI,CAAC6B,KAAK,CAAClC,GAAG,EAAAM,aAAA;QACvCL,SAAS,KAAAM,MAAA,CAAKkG,aAAa,OAAAlG,MAAA,CAAIN,SAAS,CAAE;QAC1CyG,GAAG,EAAE,IAAI,CAACpE,IAAI;QACdO,SAAS,EAAE,IAAI,CAACA,SAAS;QACzBE,YAAY,EAAE,IAAI,CAACA,YAAY;QAC/BC,YAAY,EAAE,IAAI,CAACA;MAAY,GAC5B,IAAI,CAAC0B,sBAAsB,CAAC,CAAC,GAC/B2B,eAAe,CAAC;IACrB;EAAC;AAAA,EAxNgB1G,KAAK,CAACgH,SAAS;AA2NlC3E,IAAI,CAACxB,SAAS,GAAGU,aAAa;AAC9Bc,IAAI,CAACtB,YAAY,GAAG;EAClBV,GAAG,EAAE,KAAK;EACVC,SAAS,EAAE,IAAI;EACfkB,OAAO,EAAE,IAAI;EACbE,MAAM,EAAE,IAAI;EACZG,sBAAsB,EAAE,KAAK;EAC7BF,oBAAoB,EAAE,IAAI;EAC1BG,iBAAiB,EAAE,GAAG;EACtBE,mBAAmB,EAAE;AACvB,CAAC;AAED,SAASK,IAAI,EAAElC,WAAW,EAAEgB,WAAW","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { Menu, MenuTrigger, MenuContent } from './Menu';
2
+ export { Menu, MenuTrigger, MenuContent };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Menu","MenuTrigger","MenuContent"],"sources":["../../src/Menu/index.jsx"],"sourcesContent":["import { Menu, MenuTrigger, MenuContent } from './Menu';\n\nexport { Menu, MenuTrigger, MenuContent };\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,WAAW,EAAEC,WAAW,QAAQ,QAAQ;AAEvD,SAASF,IAAI,EAAEC,WAAW,EAAEC,WAAW","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ .menu {
2
+ position: relative;
3
+ }
4
+ .menu-content {
5
+ position: absolute;
6
+ top: 100%;
7
+ z-index: 10;
8
+ background: #fff;
9
+ min-width: 10rem;
10
+ &.pin-left {
11
+ left: 0;
12
+ }
13
+ &.pin-right {
14
+ right: 0;
15
+ }
16
+ }
17
+
18
+
19
+ .menu-dropdown-enter {
20
+ opacity: 0;
21
+ transform-origin: 75% 0;
22
+ transform: scale3d(0.8, 0.8, 1);
23
+ }
24
+ .menu-dropdown-enter-active {
25
+ transform-origin: 75% 0;
26
+ transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
27
+ transform: scale3d(1, 1, 1);
28
+ opacity: 1;
29
+ }
30
+ .menu-dropdown-enter-done {
31
+ }
32
+
33
+ .menu-dropdown-exit {
34
+ transform-origin: 75% 0;
35
+ transform: scale3d(1, 1, 1);
36
+ opacity: 1;
37
+ }
38
+ .menu-dropdown-exit-active {
39
+ transform-origin: 75% 0;
40
+ transform: scale3d(0.8, 0.8, 1);
41
+ transition: all 250ms cubic-bezier(0.8, 0, 0.6, 1);
42
+ opacity: 0;
43
+ }
44
+ .menu-dropdown-exit-done {
45
+ }