@instructure/ui-top-nav-bar 8.30.1-snapshot-15

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 (238) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +30 -0
  3. package/es/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.js +47 -0
  4. package/es/TopNavBar/TopNavBarActionItems/index.js +215 -0
  5. package/es/TopNavBar/TopNavBarActionItems/props.js +36 -0
  6. package/es/TopNavBar/TopNavBarActionItems/styles.js +76 -0
  7. package/es/TopNavBar/TopNavBarActionItems/theme.js +46 -0
  8. package/es/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.js +57 -0
  9. package/es/TopNavBar/TopNavBarBrand/index.js +117 -0
  10. package/es/TopNavBar/TopNavBarBrand/props.js +37 -0
  11. package/es/TopNavBar/TopNavBarBrand/styles.js +91 -0
  12. package/es/TopNavBar/TopNavBarBrand/theme.js +42 -0
  13. package/es/TopNavBar/TopNavBarContext.js +37 -0
  14. package/es/TopNavBar/TopNavBarItem/TopNavBarItemLocator.js +114 -0
  15. package/es/TopNavBar/TopNavBarItem/index.js +634 -0
  16. package/es/TopNavBar/TopNavBarItem/props.js +64 -0
  17. package/es/TopNavBar/TopNavBarItem/styles.js +124 -0
  18. package/es/TopNavBar/TopNavBarItem/theme.js +54 -0
  19. package/es/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.js +86 -0
  20. package/es/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +119 -0
  21. package/es/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +31 -0
  22. package/es/TopNavBar/TopNavBarLayout/DesktopLayout/styles.js +115 -0
  23. package/es/TopNavBar/TopNavBarLayout/DesktopLayout/theme.js +61 -0
  24. package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.js +126 -0
  25. package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +454 -0
  26. package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +31 -0
  27. package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.js +158 -0
  28. package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.js +61 -0
  29. package/es/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.js +36 -0
  30. package/es/TopNavBar/TopNavBarLayout/index.js +118 -0
  31. package/es/TopNavBar/TopNavBarLayout/props.js +69 -0
  32. package/es/TopNavBar/TopNavBarLayout/theme.js +40 -0
  33. package/es/TopNavBar/TopNavBarLocator.js +29 -0
  34. package/es/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.js +54 -0
  35. package/es/TopNavBar/TopNavBarMenuItems/index.js +210 -0
  36. package/es/TopNavBar/TopNavBarMenuItems/props.js +35 -0
  37. package/es/TopNavBar/TopNavBarMenuItems/styles.js +65 -0
  38. package/es/TopNavBar/TopNavBarMenuItems/theme.js +45 -0
  39. package/es/TopNavBar/TopNavBarUser/TopNavBarUserLocator.js +29 -0
  40. package/es/TopNavBar/TopNavBarUser/index.js +109 -0
  41. package/es/TopNavBar/TopNavBarUser/props.js +32 -0
  42. package/es/TopNavBar/TopNavBarUser/styles.js +45 -0
  43. package/es/TopNavBar/index.js +110 -0
  44. package/es/TopNavBar/props.js +33 -0
  45. package/es/TopNavBar/utils/exampleHelpers.js +211 -0
  46. package/es/TopNavBar/utils/exampleSvgFiles.js +86 -0
  47. package/es/TopNavBar/utils/mapItemsForDrilldown.js +142 -0
  48. package/es/index.js +24 -0
  49. package/lib/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.js +59 -0
  50. package/lib/TopNavBar/TopNavBarActionItems/index.js +222 -0
  51. package/lib/TopNavBar/TopNavBarActionItems/props.js +50 -0
  52. package/lib/TopNavBar/TopNavBarActionItems/styles.js +84 -0
  53. package/lib/TopNavBar/TopNavBarActionItems/theme.js +54 -0
  54. package/lib/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.js +68 -0
  55. package/lib/TopNavBar/TopNavBarBrand/index.js +115 -0
  56. package/lib/TopNavBar/TopNavBarBrand/props.js +48 -0
  57. package/lib/TopNavBar/TopNavBarBrand/styles.js +99 -0
  58. package/lib/TopNavBar/TopNavBarBrand/theme.js +50 -0
  59. package/lib/TopNavBar/TopNavBarContext.js +46 -0
  60. package/lib/TopNavBar/TopNavBarItem/TopNavBarItemLocator.js +131 -0
  61. package/lib/TopNavBar/TopNavBarItem/index.js +650 -0
  62. package/lib/TopNavBar/TopNavBarItem/props.js +79 -0
  63. package/lib/TopNavBar/TopNavBarItem/styles.js +132 -0
  64. package/lib/TopNavBar/TopNavBarItem/theme.js +62 -0
  65. package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.js +102 -0
  66. package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +113 -0
  67. package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +40 -0
  68. package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/styles.js +123 -0
  69. package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/theme.js +69 -0
  70. package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.js +143 -0
  71. package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +472 -0
  72. package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +40 -0
  73. package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.js +166 -0
  74. package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.js +69 -0
  75. package/lib/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.js +48 -0
  76. package/lib/TopNavBar/TopNavBarLayout/index.js +113 -0
  77. package/lib/TopNavBar/TopNavBarLayout/props.js +94 -0
  78. package/lib/TopNavBar/TopNavBarLayout/theme.js +52 -0
  79. package/lib/TopNavBar/TopNavBarLocator.js +39 -0
  80. package/lib/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.js +66 -0
  81. package/lib/TopNavBar/TopNavBarMenuItems/index.js +213 -0
  82. package/lib/TopNavBar/TopNavBarMenuItems/props.js +48 -0
  83. package/lib/TopNavBar/TopNavBarMenuItems/styles.js +73 -0
  84. package/lib/TopNavBar/TopNavBarMenuItems/theme.js +53 -0
  85. package/lib/TopNavBar/TopNavBarUser/TopNavBarUserLocator.js +39 -0
  86. package/lib/TopNavBar/TopNavBarUser/index.js +104 -0
  87. package/lib/TopNavBar/TopNavBarUser/props.js +45 -0
  88. package/lib/TopNavBar/TopNavBarUser/styles.js +53 -0
  89. package/lib/TopNavBar/index.js +110 -0
  90. package/lib/TopNavBar/props.js +44 -0
  91. package/lib/TopNavBar/utils/exampleHelpers.js +255 -0
  92. package/lib/TopNavBar/utils/exampleSvgFiles.js +75 -0
  93. package/lib/TopNavBar/utils/mapItemsForDrilldown.js +165 -0
  94. package/lib/index.js +13 -0
  95. package/lib/package.json +1 -0
  96. package/package.json +64 -0
  97. package/src/TopNavBar/README.md +2329 -0
  98. package/src/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.ts +53 -0
  99. package/src/TopNavBar/TopNavBarActionItems/index.tsx +299 -0
  100. package/src/TopNavBar/TopNavBarActionItems/props.ts +152 -0
  101. package/src/TopNavBar/TopNavBarActionItems/styles.ts +92 -0
  102. package/src/TopNavBar/TopNavBarActionItems/theme.ts +51 -0
  103. package/src/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.ts +44 -0
  104. package/src/TopNavBar/TopNavBarBrand/index.tsx +139 -0
  105. package/src/TopNavBar/TopNavBarBrand/props.ts +146 -0
  106. package/src/TopNavBar/TopNavBarBrand/styles.ts +102 -0
  107. package/src/TopNavBar/TopNavBarBrand/theme.ts +48 -0
  108. package/src/TopNavBar/TopNavBarContext.ts +47 -0
  109. package/src/TopNavBar/TopNavBarItem/TopNavBarItemLocator.ts +111 -0
  110. package/src/TopNavBar/TopNavBarItem/index.tsx +752 -0
  111. package/src/TopNavBar/TopNavBarItem/props.ts +331 -0
  112. package/src/TopNavBar/TopNavBarItem/styles.ts +142 -0
  113. package/src/TopNavBar/TopNavBarItem/theme.ts +60 -0
  114. package/src/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.ts +84 -0
  115. package/src/TopNavBar/TopNavBarLayout/DesktopLayout/index.tsx +148 -0
  116. package/src/TopNavBar/TopNavBarLayout/DesktopLayout/props.ts +104 -0
  117. package/src/TopNavBar/TopNavBarLayout/DesktopLayout/styles.ts +136 -0
  118. package/src/TopNavBar/TopNavBarLayout/DesktopLayout/theme.ts +66 -0
  119. package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.ts +125 -0
  120. package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.tsx +600 -0
  121. package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.ts +187 -0
  122. package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.ts +184 -0
  123. package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.ts +69 -0
  124. package/src/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.ts +46 -0
  125. package/src/TopNavBar/TopNavBarLayout/index.tsx +149 -0
  126. package/src/TopNavBar/TopNavBarLayout/props.ts +209 -0
  127. package/src/TopNavBar/TopNavBarLayout/theme.ts +47 -0
  128. package/src/TopNavBar/TopNavBarLocator.ts +31 -0
  129. package/src/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.ts +56 -0
  130. package/src/TopNavBar/TopNavBarMenuItems/index.tsx +275 -0
  131. package/src/TopNavBar/TopNavBarMenuItems/props.ts +133 -0
  132. package/src/TopNavBar/TopNavBarMenuItems/styles.ts +72 -0
  133. package/src/TopNavBar/TopNavBarMenuItems/theme.ts +51 -0
  134. package/src/TopNavBar/TopNavBarUser/TopNavBarUserLocator.ts +32 -0
  135. package/src/TopNavBar/TopNavBarUser/index.tsx +133 -0
  136. package/src/TopNavBar/TopNavBarUser/props.ts +83 -0
  137. package/src/TopNavBar/TopNavBarUser/styles.ts +47 -0
  138. package/src/TopNavBar/index.tsx +142 -0
  139. package/src/TopNavBar/props.ts +108 -0
  140. package/src/TopNavBar/utils/exampleHelpers.tsx +342 -0
  141. package/src/TopNavBar/utils/exampleSvgFiles.tsx +76 -0
  142. package/src/TopNavBar/utils/mapItemsForDrilldown.tsx +228 -0
  143. package/src/index.ts +62 -0
  144. package/tsconfig.build.json +37 -0
  145. package/tsconfig.build.tsbuildinfo +1 -0
  146. package/tsconfig.json +4 -0
  147. package/types/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.d.ts +2116 -0
  148. package/types/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.d.ts.map +1 -0
  149. package/types/TopNavBar/TopNavBarActionItems/index.d.ts +40 -0
  150. package/types/TopNavBar/TopNavBarActionItems/index.d.ts.map +1 -0
  151. package/types/TopNavBar/TopNavBarActionItems/props.d.ts +59 -0
  152. package/types/TopNavBar/TopNavBarActionItems/props.d.ts.map +1 -0
  153. package/types/TopNavBar/TopNavBarActionItems/styles.d.ts +15 -0
  154. package/types/TopNavBar/TopNavBarActionItems/styles.d.ts.map +1 -0
  155. package/types/TopNavBar/TopNavBarActionItems/theme.d.ts +10 -0
  156. package/types/TopNavBar/TopNavBarActionItems/theme.d.ts.map +1 -0
  157. package/types/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.d.ts +592 -0
  158. package/types/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.d.ts.map +1 -0
  159. package/types/TopNavBar/TopNavBarBrand/index.d.ts +30 -0
  160. package/types/TopNavBar/TopNavBarBrand/index.d.ts.map +1 -0
  161. package/types/TopNavBar/TopNavBarBrand/props.d.ts +60 -0
  162. package/types/TopNavBar/TopNavBarBrand/props.d.ts.map +1 -0
  163. package/types/TopNavBar/TopNavBarBrand/styles.d.ts +15 -0
  164. package/types/TopNavBar/TopNavBarBrand/styles.d.ts.map +1 -0
  165. package/types/TopNavBar/TopNavBarBrand/theme.d.ts +10 -0
  166. package/types/TopNavBar/TopNavBarBrand/theme.d.ts.map +1 -0
  167. package/types/TopNavBar/TopNavBarContext.d.ts +17 -0
  168. package/types/TopNavBar/TopNavBarContext.d.ts.map +1 -0
  169. package/types/TopNavBar/TopNavBarItem/TopNavBarItemLocator.d.ts +642 -0
  170. package/types/TopNavBar/TopNavBarItem/TopNavBarItemLocator.d.ts.map +1 -0
  171. package/types/TopNavBar/TopNavBarItem/index.d.ts +64 -0
  172. package/types/TopNavBar/TopNavBarItem/index.d.ts.map +1 -0
  173. package/types/TopNavBar/TopNavBarItem/props.d.ts +188 -0
  174. package/types/TopNavBar/TopNavBarItem/props.d.ts.map +1 -0
  175. package/types/TopNavBar/TopNavBarItem/styles.d.ts +15 -0
  176. package/types/TopNavBar/TopNavBarItem/styles.d.ts.map +1 -0
  177. package/types/TopNavBar/TopNavBarItem/theme.d.ts +10 -0
  178. package/types/TopNavBar/TopNavBarItem/theme.d.ts.map +1 -0
  179. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.d.ts +5737 -0
  180. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.d.ts.map +1 -0
  181. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts +31 -0
  182. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts.map +1 -0
  183. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts +29 -0
  184. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts.map +1 -0
  185. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/styles.d.ts +15 -0
  186. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/styles.d.ts.map +1 -0
  187. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/theme.d.ts +10 -0
  188. package/types/TopNavBar/TopNavBarLayout/DesktopLayout/theme.d.ts.map +1 -0
  189. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.d.ts +4357 -0
  190. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.d.ts.map +1 -0
  191. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts +58 -0
  192. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts.map +1 -0
  193. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts +89 -0
  194. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts.map +1 -0
  195. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.d.ts +15 -0
  196. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.d.ts.map +1 -0
  197. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.d.ts +10 -0
  198. package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.d.ts.map +1 -0
  199. package/types/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.d.ts +7 -0
  200. package/types/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.d.ts.map +1 -0
  201. package/types/TopNavBar/TopNavBarLayout/index.d.ts +34 -0
  202. package/types/TopNavBar/TopNavBarLayout/index.d.ts.map +1 -0
  203. package/types/TopNavBar/TopNavBarLayout/props.d.ts +83 -0
  204. package/types/TopNavBar/TopNavBarLayout/props.d.ts.map +1 -0
  205. package/types/TopNavBar/TopNavBarLayout/theme.d.ts +10 -0
  206. package/types/TopNavBar/TopNavBarLayout/theme.d.ts.map +1 -0
  207. package/types/TopNavBar/TopNavBarLocator.d.ts +566 -0
  208. package/types/TopNavBar/TopNavBarLocator.d.ts.map +1 -0
  209. package/types/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.d.ts +1351 -0
  210. package/types/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.d.ts.map +1 -0
  211. package/types/TopNavBar/TopNavBarMenuItems/index.d.ts +38 -0
  212. package/types/TopNavBar/TopNavBarMenuItems/index.d.ts.map +1 -0
  213. package/types/TopNavBar/TopNavBarMenuItems/props.d.ts +53 -0
  214. package/types/TopNavBar/TopNavBarMenuItems/props.d.ts.map +1 -0
  215. package/types/TopNavBar/TopNavBarMenuItems/styles.d.ts +15 -0
  216. package/types/TopNavBar/TopNavBarMenuItems/styles.d.ts.map +1 -0
  217. package/types/TopNavBar/TopNavBarMenuItems/theme.d.ts +10 -0
  218. package/types/TopNavBar/TopNavBarMenuItems/theme.d.ts.map +1 -0
  219. package/types/TopNavBar/TopNavBarUser/TopNavBarUserLocator.d.ts +566 -0
  220. package/types/TopNavBar/TopNavBarUser/TopNavBarUserLocator.d.ts.map +1 -0
  221. package/types/TopNavBar/TopNavBarUser/index.d.ts +31 -0
  222. package/types/TopNavBar/TopNavBarUser/index.d.ts.map +1 -0
  223. package/types/TopNavBar/TopNavBarUser/props.d.ts +29 -0
  224. package/types/TopNavBar/TopNavBarUser/props.d.ts.map +1 -0
  225. package/types/TopNavBar/TopNavBarUser/styles.d.ts +14 -0
  226. package/types/TopNavBar/TopNavBarUser/styles.d.ts.map +1 -0
  227. package/types/TopNavBar/index.d.ts +38 -0
  228. package/types/TopNavBar/index.d.ts.map +1 -0
  229. package/types/TopNavBar/props.d.ts +43 -0
  230. package/types/TopNavBar/props.d.ts.map +1 -0
  231. package/types/TopNavBar/utils/exampleHelpers.d.ts +70 -0
  232. package/types/TopNavBar/utils/exampleHelpers.d.ts.map +1 -0
  233. package/types/TopNavBar/utils/exampleSvgFiles.d.ts +7 -0
  234. package/types/TopNavBar/utils/exampleSvgFiles.d.ts.map +1 -0
  235. package/types/TopNavBar/utils/mapItemsForDrilldown.d.ts +19 -0
  236. package/types/TopNavBar/utils/mapItemsForDrilldown.d.ts.map +1 -0
  237. package/types/index.d.ts +11 -0
  238. package/types/index.d.ts.map +1 -0
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.topNavBarItemTooltipPropType = exports.propTypes = exports.allowedProps = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _Children = require("@instructure/ui-prop-types/lib/Children.js");
13
+
14
+ var _Drilldown = require("@instructure/ui-drilldown/lib/Drilldown");
15
+
16
+ /*
17
+ * The MIT License (MIT)
18
+ *
19
+ * Copyright (c) 2015 - present Instructure, Inc.
20
+ *
21
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ * of this software and associated documentation files (the "Software"), to deal
23
+ * in the Software without restriction, including without limitation the rights
24
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ * copies of the Software, and to permit persons to whom the Software is
26
+ * furnished to do so, subject to the following conditions:
27
+ *
28
+ * The above copyright notice and this permission notice shall be included in all
29
+ * copies or substantial portions of the Software.
30
+ *
31
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
+ * SOFTWARE.
38
+ */
39
+ const topNavBarItemTooltipPropType = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
40
+ renderTip: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
41
+ color: _propTypes.default.oneOf(['primary', 'primary-inverse']),
42
+ placement: _propTypes.default.string,
43
+ offsetX: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
44
+ offsetY: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
45
+ onShowContent: _propTypes.default.func,
46
+ onHideContent: _propTypes.default.func
47
+ })]);
48
+
49
+ exports.topNavBarItemTooltipPropType = topNavBarItemTooltipPropType;
50
+ const propTypes = {
51
+ id: _propTypes.default.string.isRequired,
52
+ children: _propTypes.default.node.isRequired,
53
+ variant: _propTypes.default.oneOf(['default', 'button', 'icon', 'avatar']),
54
+ status: _propTypes.default.oneOf(['default', 'active', 'disabled']),
55
+ renderSubmenu: _Children.Children.oneOf([_Drilldown.Drilldown]),
56
+ showSubmenuChevron: _propTypes.default.bool,
57
+ customPopoverConfig: _propTypes.default.object,
58
+ tooltip: topNavBarItemTooltipPropType,
59
+ renderAvatar: _propTypes.default.shape({
60
+ avatarName: _propTypes.default.string.isRequired,
61
+ avatarSrc: _propTypes.default.string,
62
+ avatarAlt: _propTypes.default.string
63
+ }),
64
+ renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
65
+ href: _propTypes.default.string,
66
+ onClick: _propTypes.default.func,
67
+ onSubmenuToggle: _propTypes.default.func,
68
+ onMouseOver: _propTypes.default.func,
69
+ onMouseOut: _propTypes.default.func,
70
+ onFocus: _propTypes.default.func,
71
+ onBlur: _propTypes.default.func,
72
+ onKeyDown: _propTypes.default.func,
73
+ onKeyUp: _propTypes.default.func,
74
+ elementRef: _propTypes.default.func,
75
+ itemRef: _propTypes.default.func
76
+ };
77
+ exports.propTypes = propTypes;
78
+ const allowedProps = ['id', 'children', 'variant', 'status', 'renderSubmenu', 'showSubmenuChevron', 'customPopoverConfig', 'tooltip', 'renderAvatar', 'renderIcon', 'href', 'onClick', 'onSubmenuToggle', 'onMouseOver', 'onMouseOut', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'elementRef', 'itemRef'];
79
+ exports.allowedProps = allowedProps;
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ /**
33
+ * ---
34
+ * private: true
35
+ * ---
36
+ * Generates the style object from the theme and provided additional information
37
+ * @param {Object} componentTheme The theme variable object.
38
+ * @param {Object} props the props of the component, the style is applied to
39
+ * @param {Object} state the state of the component, the style is applied to
40
+ * @return {Object} The final style object, which will be used in the component
41
+ */
42
+ const generateStyle = (componentTheme, props, state) => {
43
+ const status = props.status,
44
+ variant = props.variant,
45
+ renderSubmenu = props.renderSubmenu,
46
+ renderAvatar = props.renderAvatar,
47
+ customPopoverConfig = props.customPopoverConfig;
48
+ const layout = state.layout,
49
+ inverseColor = state.inverseColor;
50
+ const isSmallViewport = layout === 'smallViewport';
51
+ const isActive = renderAvatar ? false : status === 'active' && variant === 'default';
52
+ const hasPopover = renderSubmenu || customPopoverConfig;
53
+ const activeIndicatorPosition = `calc(${componentTheme.itemInlinePadding} - ${componentTheme.activeItemIndicatorSpacing})`;
54
+ return {
55
+ topNavBarItem: {
56
+ label: 'topNavBarItem',
57
+ padding: `0 calc(${componentTheme.itemSpacing} / 2)`,
58
+ height: '100%',
59
+ display: 'flex',
60
+ justifyContent: 'center',
61
+ alignItems: hasPopover ? 'stretch' : 'center'
62
+ },
63
+ container: {
64
+ label: 'topNavBarItem__container',
65
+ display: 'flex',
66
+ alignItems: 'center',
67
+ justifyContent: 'center',
68
+ position: 'relative',
69
+ ...(isActive && {
70
+ '&::after': {
71
+ content: '""',
72
+ position: 'absolute',
73
+ insetBlockEnd: 0,
74
+ insetInlineStart: activeIndicatorPosition,
75
+ insetInlineEnd: activeIndicatorPosition,
76
+ height: componentTheme.activeIndicatorWidth,
77
+ background: inverseColor ? componentTheme.activeIndicatorColorInverse : componentTheme.activeIndicatorColor,
78
+ display: 'block'
79
+ }
80
+ }),
81
+ '& a': {
82
+ textDecoration: 'none'
83
+ }
84
+ },
85
+ content: {
86
+ label: 'topNavBarItem__content',
87
+ fontSize: componentTheme.fontSize,
88
+ fontFamily: componentTheme.fontFamily,
89
+ fontWeight: componentTheme.fontWeight,
90
+ appearance: 'none',
91
+ border: 0,
92
+ outline: 0,
93
+ margin: 0,
94
+ textDecoration: 'none',
95
+ whiteSpace: 'nowrap',
96
+ display: 'flex',
97
+ justifyContent: 'center',
98
+ alignItems: 'center',
99
+ color: inverseColor ? componentTheme.colorInverse : componentTheme.color,
100
+ ...(isActive && {
101
+ fontWeight: componentTheme.activeItemFontWeight
102
+ }),
103
+ '*': {
104
+ pointerEvents: 'none'
105
+ }
106
+ },
107
+ avatarContainer: {
108
+ label: 'topNavBarItem__avatarContainer',
109
+ display: 'flex',
110
+ alignItems: 'center',
111
+ paddingInlineEnd: `calc(${componentTheme.iconTextGap} * 1.5)`
112
+ },
113
+ submenuTriggerContainer: {
114
+ label: 'topNavBarItem__submenuTriggerContainer',
115
+ height: '100%',
116
+ display: 'flex',
117
+ alignItems: 'center'
118
+ },
119
+ submenuIcon: {
120
+ label: 'topNavBarItem__submenuIcon',
121
+ fontSize: '0.875em',
122
+ display: 'flex',
123
+ alignItems: 'center',
124
+ paddingInlineStart: componentTheme.iconTextGap
125
+ },
126
+ focusOutlineOffset: isSmallViewport ? '0.375rem' : '0.625rem',
127
+ itemInlinePadding: componentTheme.itemInlinePadding
128
+ };
129
+ };
130
+
131
+ var _default = generateStyle;
132
+ exports.default = _default;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ /**
33
+ * Generates the theme object for the component from the theme and provided additional information
34
+ * @param {Object} theme The actual theme object.
35
+ * @return {Object} The final theme object with the overrides and component variables
36
+ */
37
+ const generateComponentTheme = theme => {
38
+ const colors = theme.colors,
39
+ spacing = theme.spacing,
40
+ typography = theme.typography,
41
+ borders = theme.borders;
42
+ const componentVariables = {
43
+ fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
44
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
45
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
46
+ color: 'inherit',
47
+ colorInverse: 'inherit',
48
+ itemInlinePadding: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
49
+ itemSpacing: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
50
+ iconTextGap: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
51
+ activeItemFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
52
+ activeItemIndicatorSpacing: '0.25rem',
53
+ activeIndicatorWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
54
+ activeIndicatorColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
55
+ activeIndicatorColorInverse: colors.textDarkest
56
+ };
57
+ return { ...componentVariables
58
+ };
59
+ };
60
+
61
+ var _default = generateComponentTheme;
62
+ exports.default = _default;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TopNavBarDesktopLayoutLocator = void 0;
7
+
8
+ var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
9
+
10
+ var _uiTestUtils = require("@instructure/ui-test-utils");
11
+
12
+ var _getComputedStyle = require("@instructure/ui-dom-utils/lib/getComputedStyle.js");
13
+
14
+ var _TopNavBarBrandLocator = require("../../TopNavBarBrand/TopNavBarBrandLocator");
15
+
16
+ var _TopNavBarMenuItemsLocator = require("../../TopNavBarMenuItems/TopNavBarMenuItemsLocator");
17
+
18
+ var _TopNavBarActionItemsLocator = require("../../TopNavBarActionItems/TopNavBarActionItemsLocator");
19
+
20
+ var _TopNavBarUserLocator = require("../../TopNavBarUser/TopNavBarUserLocator");
21
+
22
+ var _index = require("./index");
23
+
24
+ /*
25
+ * The MIT License (MIT)
26
+ *
27
+ * Copyright (c) 2015 - present Instructure, Inc.
28
+ *
29
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
30
+ * of this software and associated documentation files (the "Software"), to deal
31
+ * in the Software without restriction, including without limitation the rights
32
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33
+ * copies of the Software, and to permit persons to whom the Software is
34
+ * furnished to do so, subject to the following conditions:
35
+ *
36
+ * The above copyright notice and this permission notice shall be included in all
37
+ * copies or substantial portions of the Software.
38
+ *
39
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45
+ * SOFTWARE.
46
+ */
47
+ const TopNavBarDesktopLayoutLocator = (0, _locator.locator)( // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
48
+ _index.TopNavBarDesktopLayout.selector, {
49
+ findBrandContainer: function () {
50
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
51
+ args[_key] = arguments[_key];
52
+ }
53
+
54
+ return (0, _uiTestUtils.find)('[class$=-topNavBarDesktopLayout__brandContainer]', ...args);
55
+ },
56
+ findMenuItemsContainer: function () {
57
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
58
+ args[_key2] = arguments[_key2];
59
+ }
60
+
61
+ return (0, _uiTestUtils.find)('[class$=-topNavBarDesktopLayout__menuItemsContainer]', ...args);
62
+ },
63
+ findActionItemsContainer: function () {
64
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
65
+ args[_key3] = arguments[_key3];
66
+ }
67
+
68
+ return (0, _uiTestUtils.find)('[class$=-topNavBarDesktopLayout__actionItemsContainer]', ...args);
69
+ },
70
+ findUserContainer: function () {
71
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
72
+ args[_key4] = arguments[_key4];
73
+ }
74
+
75
+ return (0, _uiTestUtils.find)('[class$=-topNavBarDesktopLayout__userContainer]', ...args);
76
+ },
77
+ findBrand: function () {
78
+ return _TopNavBarBrandLocator.TopNavBarBrandLocator.find(...arguments);
79
+ },
80
+ findMenuItems: function () {
81
+ return _TopNavBarMenuItemsLocator.TopNavBarMenuItemsLocator.find(...arguments);
82
+ },
83
+ findActionItems: function () {
84
+ return _TopNavBarActionItemsLocator.TopNavBarActionItemsLocator.find(...arguments);
85
+ },
86
+ findUser: function () {
87
+ return _TopNavBarUserLocator.TopNavBarUserLocator.find(...arguments);
88
+ },
89
+ getActionsUserSeparatorBackground: async function () {
90
+ try {
91
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
92
+ args[_key5] = arguments[_key5];
93
+ }
94
+
95
+ const user = await (0, _uiTestUtils.find)('[class$=-topNavBarDesktopLayout__userContainer]', ...args);
96
+ return user ? (0, _getComputedStyle.getComputedStyle)(user.getDOMNode(), '::before').backgroundColor : 'rgba(0, 0, 0, 0)';
97
+ } catch {
98
+ return 'rgba(0, 0, 0, 0)';
99
+ }
100
+ }
101
+ });
102
+ exports.TopNavBarDesktopLayoutLocator = TopNavBarDesktopLayoutLocator;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = exports.TopNavBarDesktopLayout = void 0;
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
15
+
16
+ var _testable = require("@instructure/ui-testable/lib/testable.js");
17
+
18
+ var _emotion = require("@instructure/emotion");
19
+
20
+ var _TopNavBarContext = require("../../TopNavBarContext");
21
+
22
+ var _styles = _interopRequireDefault(require("./styles"));
23
+
24
+ var _theme = _interopRequireDefault(require("./theme"));
25
+
26
+ var _props = require("./props");
27
+
28
+ var _dec, _dec2, _class, _class2;
29
+
30
+ /**
31
+ ---
32
+ private: true
33
+ ---
34
+ @tsProps
35
+ **/
36
+ let TopNavBarDesktopLayout = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class TopNavBarDesktopLayout extends _react.Component {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.ref = null;
40
+
41
+ this.handleRef = el => {
42
+ const elementRef = this.props.elementRef;
43
+ this.ref = el;
44
+
45
+ if (typeof elementRef === 'function') {
46
+ elementRef(el);
47
+ }
48
+ };
49
+ }
50
+
51
+ componentDidMount() {
52
+ var _this$props$makeStyle, _this$props;
53
+
54
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStylesVariables);
55
+ }
56
+
57
+ componentDidUpdate() {
58
+ var _this$props$makeStyle2, _this$props2;
59
+
60
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
61
+ }
62
+
63
+ get makeStylesVariables() {
64
+ return {
65
+ inverseColor: this.context.inverseColor,
66
+ hasBrandBlock: this.hasBrandBlock,
67
+ hasActionItemsBlock: this.hasActionItemsBlock,
68
+ hasUserBlock: this.hasUserBlock
69
+ };
70
+ }
71
+
72
+ get hasBrandBlock() {
73
+ const renderBrand = this.props.renderBrand;
74
+ return !!renderBrand && (!!renderBrand.props.renderName || !!renderBrand.props.renderIcon);
75
+ }
76
+
77
+ get hasActionItemsBlock() {
78
+ const renderActionItems = this.props.renderActionItems;
79
+ return !!renderActionItems && _react.default.Children.count(renderActionItems.props.children) > 0;
80
+ }
81
+
82
+ get hasUserBlock() {
83
+ const renderUser = this.props.renderUser;
84
+ return !!renderUser && _react.default.Children.count(renderUser.props.children) > 0;
85
+ }
86
+
87
+ render() {
88
+ const _this$props3 = this.props,
89
+ renderBrand = _this$props3.renderBrand,
90
+ renderMenuItems = _this$props3.renderMenuItems,
91
+ renderActionItems = _this$props3.renderActionItems,
92
+ renderUser = _this$props3.renderUser,
93
+ navLabel = _this$props3.navLabel,
94
+ styles = _this$props3.styles;
95
+ return (0, _emotion.jsx)("nav", Object.assign({}, (0, _omitProps.omitProps)(this.props, _props.allowedProps), {
96
+ ref: this.handleRef,
97
+ css: styles === null || styles === void 0 ? void 0 : styles.topNavBarDesktopLayout,
98
+ "aria-label": navLabel
99
+ }), this.hasBrandBlock && (0, _emotion.jsx)("div", {
100
+ css: styles === null || styles === void 0 ? void 0 : styles.brandContainer
101
+ }, renderBrand), (0, _emotion.jsx)("div", {
102
+ css: styles === null || styles === void 0 ? void 0 : styles.menuItemsContainer
103
+ }, renderMenuItems), this.hasActionItemsBlock && (0, _emotion.jsx)("div", {
104
+ css: styles === null || styles === void 0 ? void 0 : styles.actionItemsContainer
105
+ }, renderActionItems), this.hasUserBlock && (0, _emotion.jsx)("div", {
106
+ css: styles === null || styles === void 0 ? void 0 : styles.userContainer
107
+ }, renderUser));
108
+ }
109
+
110
+ }, _class2.displayName = "TopNavBarDesktopLayout", _class2.componentId = 'TopNavBar.DesktopLayout', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {}, _class2.contextType = _TopNavBarContext.TopNavBarContext, _class2)) || _class) || _class);
111
+ exports.TopNavBarDesktopLayout = TopNavBarDesktopLayout;
112
+ var _default = TopNavBarDesktopLayout;
113
+ exports.default = _default;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.propTypes = exports.allowedProps = void 0;
7
+
8
+ var _props = require("../props");
9
+
10
+ /*
11
+ * The MIT License (MIT)
12
+ *
13
+ * Copyright (c) 2015 - present Instructure, Inc.
14
+ *
15
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ * of this software and associated documentation files (the "Software"), to deal
17
+ * in the Software without restriction, including without limitation the rights
18
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ * copies of the Software, and to permit persons to whom the Software is
20
+ * furnished to do so, subject to the following conditions:
21
+ *
22
+ * The above copyright notice and this permission notice shall be included in all
23
+ * copies or substantial portions of the Software.
24
+ *
25
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ * SOFTWARE.
32
+ */
33
+ const propTypes = { // Edit PropTypes in TopNabBarLayout/props.ts
34
+ ..._props.commonPropTypes,
35
+ ..._props.desktopPropTypes
36
+ };
37
+ exports.propTypes = propTypes;
38
+ const allowedProps = [// Edit allowed props in TopNabBarLayout/props.ts
39
+ ..._props.commonAllowedProps, ..._props.desktopAllowedProps];
40
+ exports.allowedProps = allowedProps;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ /**
33
+ * ---
34
+ * private: true
35
+ * ---
36
+ * Generates the style object from the theme and provided additional information
37
+ * @param {Object} componentTheme The theme variable object.
38
+ * @param {Object} props the props of the component, the style is applied to
39
+ * @param {Object} state the state of the component, the style is applied to
40
+ * @return {Object} The final style object, which will be used in the component
41
+ */
42
+ const generateStyle = (componentTheme, props, state) => {
43
+ const hideActionsUserSeparator = props.hideActionsUserSeparator;
44
+ const inverseColor = state.inverseColor,
45
+ hasBrandBlock = state.hasBrandBlock,
46
+ hasActionItemsBlock = state.hasActionItemsBlock,
47
+ hasUserBlock = state.hasUserBlock;
48
+ const hasUserSeparator = hasActionItemsBlock && hasUserBlock && !hideActionsUserSeparator;
49
+ return {
50
+ topNavBarDesktopLayout: {
51
+ label: 'topNavBarDesktopLayout',
52
+ flowMode: 'logical',
53
+ fontSize: componentTheme.desktopFontSize,
54
+ fontFamily: componentTheme.desktopFontFamily,
55
+ fontWeight: componentTheme.desktopFontWeight,
56
+ background: inverseColor ? componentTheme.desktopBackgroundInverse : componentTheme.desktopBackground,
57
+ borderBlockEnd: inverseColor ? componentTheme.desktopBottomBorderInverse : componentTheme.desktopBottomBorder,
58
+ display: 'flex',
59
+ alignItems: 'stretch',
60
+ justifyContent: 'space-between',
61
+ height: componentTheme.desktopHeight,
62
+ zIndex: componentTheme.desktopZIndex,
63
+ maxWidth: '100%',
64
+ overflow: 'hidden',
65
+ paddingInline: componentTheme.desktopInlinePadding,
66
+ paddingBlock: 0,
67
+ ...(hasBrandBlock && {
68
+ paddingInlineStart: 0
69
+ })
70
+ },
71
+ brandContainer: {
72
+ label: 'topNavBarDesktopLayout__brandContainer',
73
+ display: 'flex',
74
+ flexGrow: 0,
75
+ flexShrink: 0,
76
+ marginBlock: 0,
77
+ marginInline: componentTheme.desktopBrandContainerInlineMargin
78
+ },
79
+ menuItemsContainer: {
80
+ label: 'topNavBarDesktopLayout__menuItemsContainer',
81
+ display: 'flex',
82
+ flexGrow: 1,
83
+ flexShrink: 1,
84
+ marginBlock: 0,
85
+ marginInline: componentTheme.desktopMenuItemsContainerInlineMargin,
86
+ overflow: 'hidden'
87
+ },
88
+ actionItemsContainer: {
89
+ label: 'topNavBarDesktopLayout__actionItemsContainer',
90
+ display: 'flex',
91
+ flexGrow: 0,
92
+ flexShrink: 0,
93
+ marginBlock: 0,
94
+ marginInline: componentTheme.desktopActionItemsContainerInlineMargin
95
+ },
96
+ userContainer: {
97
+ label: 'topNavBarDesktopLayout__userContainer',
98
+ display: 'flex',
99
+ flexGrow: 0,
100
+ flexShrink: 0,
101
+ marginBlock: 0,
102
+ marginInline: componentTheme.desktopUserContainerInlineMargin,
103
+ ...(hasUserSeparator && {
104
+ position: 'relative',
105
+ paddingInlineStart: componentTheme.desktopUserSeparatorGap,
106
+ '&::before': {
107
+ content: '""',
108
+ position: 'absolute',
109
+ insetInlineStart: 0,
110
+ insetBlockStart: '50%',
111
+ marginBlockStart: `calc(-${componentTheme.desktopUserSeparatorHeight} / 2)`,
112
+ height: componentTheme.desktopUserSeparatorHeight,
113
+ width: componentTheme.desktopUserSeparatorWidth,
114
+ background: inverseColor ? componentTheme.desktopUserSeparatorColorInverse : componentTheme.desktopUserSeparatorColor,
115
+ display: 'block'
116
+ }
117
+ })
118
+ }
119
+ };
120
+ };
121
+
122
+ var _default = generateStyle;
123
+ exports.default = _default;