@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.
- package/CHANGELOG.md +57 -0
- package/README.md +30 -0
- package/es/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.js +47 -0
- package/es/TopNavBar/TopNavBarActionItems/index.js +215 -0
- package/es/TopNavBar/TopNavBarActionItems/props.js +36 -0
- package/es/TopNavBar/TopNavBarActionItems/styles.js +76 -0
- package/es/TopNavBar/TopNavBarActionItems/theme.js +46 -0
- package/es/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.js +57 -0
- package/es/TopNavBar/TopNavBarBrand/index.js +117 -0
- package/es/TopNavBar/TopNavBarBrand/props.js +37 -0
- package/es/TopNavBar/TopNavBarBrand/styles.js +91 -0
- package/es/TopNavBar/TopNavBarBrand/theme.js +42 -0
- package/es/TopNavBar/TopNavBarContext.js +37 -0
- package/es/TopNavBar/TopNavBarItem/TopNavBarItemLocator.js +114 -0
- package/es/TopNavBar/TopNavBarItem/index.js +634 -0
- package/es/TopNavBar/TopNavBarItem/props.js +64 -0
- package/es/TopNavBar/TopNavBarItem/styles.js +124 -0
- package/es/TopNavBar/TopNavBarItem/theme.js +54 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.js +86 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +119 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +31 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/styles.js +115 -0
- package/es/TopNavBar/TopNavBarLayout/DesktopLayout/theme.js +61 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.js +126 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +454 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +31 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.js +158 -0
- package/es/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.js +61 -0
- package/es/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.js +36 -0
- package/es/TopNavBar/TopNavBarLayout/index.js +118 -0
- package/es/TopNavBar/TopNavBarLayout/props.js +69 -0
- package/es/TopNavBar/TopNavBarLayout/theme.js +40 -0
- package/es/TopNavBar/TopNavBarLocator.js +29 -0
- package/es/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.js +54 -0
- package/es/TopNavBar/TopNavBarMenuItems/index.js +210 -0
- package/es/TopNavBar/TopNavBarMenuItems/props.js +35 -0
- package/es/TopNavBar/TopNavBarMenuItems/styles.js +65 -0
- package/es/TopNavBar/TopNavBarMenuItems/theme.js +45 -0
- package/es/TopNavBar/TopNavBarUser/TopNavBarUserLocator.js +29 -0
- package/es/TopNavBar/TopNavBarUser/index.js +109 -0
- package/es/TopNavBar/TopNavBarUser/props.js +32 -0
- package/es/TopNavBar/TopNavBarUser/styles.js +45 -0
- package/es/TopNavBar/index.js +110 -0
- package/es/TopNavBar/props.js +33 -0
- package/es/TopNavBar/utils/exampleHelpers.js +211 -0
- package/es/TopNavBar/utils/exampleSvgFiles.js +86 -0
- package/es/TopNavBar/utils/mapItemsForDrilldown.js +142 -0
- package/es/index.js +24 -0
- package/lib/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.js +59 -0
- package/lib/TopNavBar/TopNavBarActionItems/index.js +222 -0
- package/lib/TopNavBar/TopNavBarActionItems/props.js +50 -0
- package/lib/TopNavBar/TopNavBarActionItems/styles.js +84 -0
- package/lib/TopNavBar/TopNavBarActionItems/theme.js +54 -0
- package/lib/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.js +68 -0
- package/lib/TopNavBar/TopNavBarBrand/index.js +115 -0
- package/lib/TopNavBar/TopNavBarBrand/props.js +48 -0
- package/lib/TopNavBar/TopNavBarBrand/styles.js +99 -0
- package/lib/TopNavBar/TopNavBarBrand/theme.js +50 -0
- package/lib/TopNavBar/TopNavBarContext.js +46 -0
- package/lib/TopNavBar/TopNavBarItem/TopNavBarItemLocator.js +131 -0
- package/lib/TopNavBar/TopNavBarItem/index.js +650 -0
- package/lib/TopNavBar/TopNavBarItem/props.js +79 -0
- package/lib/TopNavBar/TopNavBarItem/styles.js +132 -0
- package/lib/TopNavBar/TopNavBarItem/theme.js +62 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.js +102 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/index.js +113 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/props.js +40 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/styles.js +123 -0
- package/lib/TopNavBar/TopNavBarLayout/DesktopLayout/theme.js +69 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.js +143 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.js +472 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.js +40 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.js +166 -0
- package/lib/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.js +69 -0
- package/lib/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.js +48 -0
- package/lib/TopNavBar/TopNavBarLayout/index.js +113 -0
- package/lib/TopNavBar/TopNavBarLayout/props.js +94 -0
- package/lib/TopNavBar/TopNavBarLayout/theme.js +52 -0
- package/lib/TopNavBar/TopNavBarLocator.js +39 -0
- package/lib/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.js +66 -0
- package/lib/TopNavBar/TopNavBarMenuItems/index.js +213 -0
- package/lib/TopNavBar/TopNavBarMenuItems/props.js +48 -0
- package/lib/TopNavBar/TopNavBarMenuItems/styles.js +73 -0
- package/lib/TopNavBar/TopNavBarMenuItems/theme.js +53 -0
- package/lib/TopNavBar/TopNavBarUser/TopNavBarUserLocator.js +39 -0
- package/lib/TopNavBar/TopNavBarUser/index.js +104 -0
- package/lib/TopNavBar/TopNavBarUser/props.js +45 -0
- package/lib/TopNavBar/TopNavBarUser/styles.js +53 -0
- package/lib/TopNavBar/index.js +110 -0
- package/lib/TopNavBar/props.js +44 -0
- package/lib/TopNavBar/utils/exampleHelpers.js +255 -0
- package/lib/TopNavBar/utils/exampleSvgFiles.js +75 -0
- package/lib/TopNavBar/utils/mapItemsForDrilldown.js +165 -0
- package/lib/index.js +13 -0
- package/lib/package.json +1 -0
- package/package.json +64 -0
- package/src/TopNavBar/README.md +2329 -0
- package/src/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.ts +53 -0
- package/src/TopNavBar/TopNavBarActionItems/index.tsx +299 -0
- package/src/TopNavBar/TopNavBarActionItems/props.ts +152 -0
- package/src/TopNavBar/TopNavBarActionItems/styles.ts +92 -0
- package/src/TopNavBar/TopNavBarActionItems/theme.ts +51 -0
- package/src/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.ts +44 -0
- package/src/TopNavBar/TopNavBarBrand/index.tsx +139 -0
- package/src/TopNavBar/TopNavBarBrand/props.ts +146 -0
- package/src/TopNavBar/TopNavBarBrand/styles.ts +102 -0
- package/src/TopNavBar/TopNavBarBrand/theme.ts +48 -0
- package/src/TopNavBar/TopNavBarContext.ts +47 -0
- package/src/TopNavBar/TopNavBarItem/TopNavBarItemLocator.ts +111 -0
- package/src/TopNavBar/TopNavBarItem/index.tsx +752 -0
- package/src/TopNavBar/TopNavBarItem/props.ts +331 -0
- package/src/TopNavBar/TopNavBarItem/styles.ts +142 -0
- package/src/TopNavBar/TopNavBarItem/theme.ts +60 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.ts +84 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/index.tsx +148 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/props.ts +104 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/styles.ts +136 -0
- package/src/TopNavBar/TopNavBarLayout/DesktopLayout/theme.ts +66 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.ts +125 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.tsx +600 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.ts +187 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.ts +184 -0
- package/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.ts +69 -0
- package/src/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.ts +46 -0
- package/src/TopNavBar/TopNavBarLayout/index.tsx +149 -0
- package/src/TopNavBar/TopNavBarLayout/props.ts +209 -0
- package/src/TopNavBar/TopNavBarLayout/theme.ts +47 -0
- package/src/TopNavBar/TopNavBarLocator.ts +31 -0
- package/src/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.ts +56 -0
- package/src/TopNavBar/TopNavBarMenuItems/index.tsx +275 -0
- package/src/TopNavBar/TopNavBarMenuItems/props.ts +133 -0
- package/src/TopNavBar/TopNavBarMenuItems/styles.ts +72 -0
- package/src/TopNavBar/TopNavBarMenuItems/theme.ts +51 -0
- package/src/TopNavBar/TopNavBarUser/TopNavBarUserLocator.ts +32 -0
- package/src/TopNavBar/TopNavBarUser/index.tsx +133 -0
- package/src/TopNavBar/TopNavBarUser/props.ts +83 -0
- package/src/TopNavBar/TopNavBarUser/styles.ts +47 -0
- package/src/TopNavBar/index.tsx +142 -0
- package/src/TopNavBar/props.ts +108 -0
- package/src/TopNavBar/utils/exampleHelpers.tsx +342 -0
- package/src/TopNavBar/utils/exampleSvgFiles.tsx +76 -0
- package/src/TopNavBar/utils/mapItemsForDrilldown.tsx +228 -0
- package/src/index.ts +62 -0
- package/tsconfig.build.json +37 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +4 -0
- package/types/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.d.ts +2116 -0
- package/types/TopNavBar/TopNavBarActionItems/TopNavBarActionItemsLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/index.d.ts +40 -0
- package/types/TopNavBar/TopNavBarActionItems/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/props.d.ts +59 -0
- package/types/TopNavBar/TopNavBarActionItems/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarActionItems/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarActionItems/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarActionItems/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.d.ts +592 -0
- package/types/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/index.d.ts +30 -0
- package/types/TopNavBar/TopNavBarBrand/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/props.d.ts +60 -0
- package/types/TopNavBar/TopNavBarBrand/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarBrand/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarBrand/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarBrand/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarContext.d.ts +17 -0
- package/types/TopNavBar/TopNavBarContext.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/TopNavBarItemLocator.d.ts +642 -0
- package/types/TopNavBar/TopNavBarItem/TopNavBarItemLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/index.d.ts +64 -0
- package/types/TopNavBar/TopNavBarItem/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/props.d.ts +188 -0
- package/types/TopNavBar/TopNavBarItem/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarItem/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarItem/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarItem/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.d.ts +5737 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/TopNavBarDesktopLayoutLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts +31 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts +29 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarLayout/DesktopLayout/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.d.ts +4357 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/TopNavBarSmallViewportLayoutLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts +58 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts +89 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarLayout/SmallViewportLayout/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.d.ts +7 -0
- package/types/TopNavBar/TopNavBarLayout/TopNavBarLayoutLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/index.d.ts +34 -0
- package/types/TopNavBar/TopNavBarLayout/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/props.d.ts +83 -0
- package/types/TopNavBar/TopNavBarLayout/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLayout/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarLayout/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarLocator.d.ts +566 -0
- package/types/TopNavBar/TopNavBarLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.d.ts +1351 -0
- package/types/TopNavBar/TopNavBarMenuItems/TopNavBarMenuItemsLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/index.d.ts +38 -0
- package/types/TopNavBar/TopNavBarMenuItems/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/props.d.ts +53 -0
- package/types/TopNavBar/TopNavBarMenuItems/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/styles.d.ts +15 -0
- package/types/TopNavBar/TopNavBarMenuItems/styles.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarMenuItems/theme.d.ts +10 -0
- package/types/TopNavBar/TopNavBarMenuItems/theme.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/TopNavBarUserLocator.d.ts +566 -0
- package/types/TopNavBar/TopNavBarUser/TopNavBarUserLocator.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/index.d.ts +31 -0
- package/types/TopNavBar/TopNavBarUser/index.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/props.d.ts +29 -0
- package/types/TopNavBar/TopNavBarUser/props.d.ts.map +1 -0
- package/types/TopNavBar/TopNavBarUser/styles.d.ts +14 -0
- package/types/TopNavBar/TopNavBarUser/styles.d.ts.map +1 -0
- package/types/TopNavBar/index.d.ts +38 -0
- package/types/TopNavBar/index.d.ts.map +1 -0
- package/types/TopNavBar/props.d.ts +43 -0
- package/types/TopNavBar/props.d.ts.map +1 -0
- package/types/TopNavBar/utils/exampleHelpers.d.ts +70 -0
- package/types/TopNavBar/utils/exampleHelpers.d.ts.map +1 -0
- package/types/TopNavBar/utils/exampleSvgFiles.d.ts +7 -0
- package/types/TopNavBar/utils/exampleSvgFiles.d.ts.map +1 -0
- package/types/TopNavBar/utils/mapItemsForDrilldown.d.ts +19 -0
- package/types/TopNavBar/utils/mapItemsForDrilldown.d.ts.map +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [8.30.1-snapshot-15](https://github.com/instructure/instructure-ui/compare/v8.30.0...v8.30.1-snapshot-15) (2022-11-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **shared-types,ui,ui-top-nav-bar:** add new `TopNavBar` component ([3f27257](https://github.com/instructure/instructure-ui/commit/3f272572276fb62d7b06005dd46206604c890db2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [8.30.0](https://github.com/instructure/instructure-ui/compare/v8.29.0...v8.30.0) (2022-10-26)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [8.29.0](https://github.com/instructure/instructure-ui/compare/v8.28.0...v8.29.0) (2022-09-29)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [8.28.2](https://github.com/instructure/instructure-ui/compare/v8.28.0...v8.28.2) (2022-09-16)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [8.28.1](https://github.com/instructure/instructure-ui/compare/v8.28.0...v8.28.1) (2022-09-12)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [8.28.0](https://github.com/instructure/instructure-ui/compare/v8.27.0...v8.28.0) (2022-09-02)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @instructure/ui-top-nav-bar
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
See the instructure-ui mono-repo [change log](#CHANGELOG) for past changes.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: packages
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## ui-top-nav-bar
|
|
6
|
+
|
|
7
|
+
[![npm][npm]][npm-url]
|
|
8
|
+
[![MIT License][license-badge]][license]
|
|
9
|
+
[![Code of Conduct][coc-badge]][coc]
|
|
10
|
+
|
|
11
|
+
A UI component library made by Instructure Inc.
|
|
12
|
+
|
|
13
|
+
### Components
|
|
14
|
+
|
|
15
|
+
The `ui-top-nav-bar` package contains the following:
|
|
16
|
+
|
|
17
|
+
- [TopNavBar](#TopNavBar)
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
yarn add @instructure/ui-top-nav-bar
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[npm]: https://img.shields.io/npm/v/@instructure/ui-top-nav-bar.svg
|
|
26
|
+
[npm-url]: https://npmjs.com/package/@instructure/ui-top-nav-bar
|
|
27
|
+
[license-badge]: https://img.shields.io/npm/l/instructure-ui.svg?style=flat-square
|
|
28
|
+
[license]: https://github.com/instructure/instructure-ui/blob/master/LICENSE
|
|
29
|
+
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
|
|
30
|
+
[coc]: https://github.com/instructure/instructure-ui/blob/master/CODE_OF_CONDUCT.md
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { locator } from '@instructure/ui-test-locator';
|
|
25
|
+
/* eslint-disable no-restricted-imports */
|
|
26
|
+
// @ts-expect-error bypass no type definition found error
|
|
27
|
+
|
|
28
|
+
import { TruncateListLocator } from '@instructure/ui-truncate-list/es/TruncateList/TruncateListLocator';
|
|
29
|
+
/* eslint-enable no-restricted-imports */
|
|
30
|
+
|
|
31
|
+
import { TopNavBarItemLocator } from '../TopNavBarItem/TopNavBarItemLocator';
|
|
32
|
+
import { TopNavBarActionItems } from './index';
|
|
33
|
+
export const TopNavBarActionItemsLocator = 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
|
|
34
|
+
TopNavBarActionItems.selector, {
|
|
35
|
+
findAllActionItems: function () {
|
|
36
|
+
return TopNavBarItemLocator.findAll(...arguments);
|
|
37
|
+
},
|
|
38
|
+
findTruncateList: function () {
|
|
39
|
+
return TruncateListLocator.find(...arguments);
|
|
40
|
+
},
|
|
41
|
+
findTruncateListTriggerItem: async function () {
|
|
42
|
+
const truncateList = await TruncateListLocator.find(...arguments);
|
|
43
|
+
if (!truncateList) return void 0;
|
|
44
|
+
const allItems = await TopNavBarItemLocator.findAll(...arguments);
|
|
45
|
+
return allItems[allItems.length - 1];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
var _dec, _dec2, _dec3, _class, _class2;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* The MIT License (MIT)
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/** @jsx jsx */
|
|
28
|
+
import React, { Component } from 'react';
|
|
29
|
+
import { omitProps, passthroughProps, safeCloneElement, withDeterministicId } from '@instructure/ui-react-utils';
|
|
30
|
+
import { testable } from '@instructure/ui-testable';
|
|
31
|
+
import { warn, error } from '@instructure/console';
|
|
32
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
33
|
+
import { Drilldown } from '@instructure/ui-drilldown';
|
|
34
|
+
import { IconMoreLine } from '@instructure/ui-icons';
|
|
35
|
+
import { TruncateList } from '@instructure/ui-truncate-list';
|
|
36
|
+
import { TopNavBarItem } from '../TopNavBarItem';
|
|
37
|
+
import { mapItemsForDrilldown, renderMappedItemDrilldownSubpages, renderMappedItemsAsDrilldownOptions } from '../utils/mapItemsForDrilldown';
|
|
38
|
+
import { TopNavBarContext } from '../TopNavBarContext';
|
|
39
|
+
import generateStyle from './styles';
|
|
40
|
+
import generateComponentTheme from './theme';
|
|
41
|
+
import { propTypes, allowedProps } from './props';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
---
|
|
45
|
+
parent: TopNavBar
|
|
46
|
+
id: TopNavBar.ActionItems
|
|
47
|
+
---
|
|
48
|
+
@module TopNavBarActionItems
|
|
49
|
+
@tsProps
|
|
50
|
+
**/
|
|
51
|
+
let TopNavBarActionItems = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class TopNavBarActionItems extends Component {
|
|
52
|
+
constructor(props) {
|
|
53
|
+
super(props);
|
|
54
|
+
this.ref = null;
|
|
55
|
+
this._hiddenActionItemsMenuId = void 0;
|
|
56
|
+
this._hiddenActionItemsMenuTriggerId = void 0;
|
|
57
|
+
|
|
58
|
+
this.handleRef = el => {
|
|
59
|
+
const elementRef = this.props.elementRef;
|
|
60
|
+
this.ref = el;
|
|
61
|
+
|
|
62
|
+
if (typeof elementRef === 'function') {
|
|
63
|
+
elementRef(el);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
this.renderOptionContent = (children, itemProps) => {
|
|
68
|
+
const styles = this.props.styles;
|
|
69
|
+
const status = itemProps.status;
|
|
70
|
+
return jsx("span", {
|
|
71
|
+
css: status === 'active' ? styles === null || styles === void 0 ? void 0 : styles.dropdownMenuOptionActive : styles === null || styles === void 0 ? void 0 : styles.dropdownMenuOption
|
|
72
|
+
}, children);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
this._hiddenActionItemsMenuId = props.deterministicId('TopNavBarActionItems-hiddenActionItemsMenu');
|
|
76
|
+
this._hiddenActionItemsMenuTriggerId = props.deterministicId('TopNavBarActionItems-hiddenActionItemsMenuTrigger');
|
|
77
|
+
this.state = {
|
|
78
|
+
key: 0,
|
|
79
|
+
visibleActionItemsCount: void 0
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
componentDidMount() {
|
|
84
|
+
var _this$props$makeStyle, _this$props;
|
|
85
|
+
|
|
86
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStylesVariables);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
componentDidUpdate(prevProps) {
|
|
90
|
+
var _this$props$makeStyle2, _this$props2;
|
|
91
|
+
|
|
92
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStylesVariables);
|
|
93
|
+
|
|
94
|
+
if (this.context.layout === 'smallViewport' && React.Children.count(prevProps.children) !== React.Children.count(this.props.children)) {
|
|
95
|
+
this.setState({
|
|
96
|
+
key: this.state.key + 1
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get makeStylesVariables() {
|
|
102
|
+
return {
|
|
103
|
+
layout: this.context.layout
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get childrenArray() {
|
|
108
|
+
const children = React.Children.toArray(this.props.children);
|
|
109
|
+
return children.map(child => {
|
|
110
|
+
if (!(child !== null && child !== void 0 && child.props)) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const _child$props = child.props,
|
|
115
|
+
id = _child$props.id,
|
|
116
|
+
renderAvatar = _child$props.renderAvatar,
|
|
117
|
+
renderIcon = _child$props.renderIcon,
|
|
118
|
+
variant = _child$props.variant;
|
|
119
|
+
|
|
120
|
+
if (renderAvatar) {
|
|
121
|
+
warn(false, `Items in <TopNavBar.ActionItems> are not allowed to have avatars, please remove it from item with the id "${id}".`);
|
|
122
|
+
return safeCloneElement(child, {
|
|
123
|
+
renderAvatar: void 0,
|
|
124
|
+
variant: 'default'
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (this.context.layout === 'smallViewport' && variant !== 'icon') {
|
|
129
|
+
if (!renderIcon) {
|
|
130
|
+
error(false, `Items in <TopNavBar.ActionItems> are required to have the \`renderIcon\` prop, because only the icons are displayed due to the lack of space. Please add an icon to the item with the id "${id}".`);
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return safeCloneElement(child, {
|
|
135
|
+
variant: 'icon'
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return child;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
renderHiddenActionItemsMenu(hiddenItems) {
|
|
144
|
+
const _this$props3 = this.props,
|
|
145
|
+
renderHiddenItemsMenuTriggerLabel = _this$props3.renderHiddenItemsMenuTriggerLabel,
|
|
146
|
+
renderHiddenItemsMenuTriggerTooltip = _this$props3.renderHiddenItemsMenuTriggerTooltip;
|
|
147
|
+
const mappedItems = mapItemsForDrilldown(hiddenItems, {
|
|
148
|
+
renderOptionContent: this.renderOptionContent
|
|
149
|
+
});
|
|
150
|
+
const subPages = renderMappedItemDrilldownSubpages(mappedItems);
|
|
151
|
+
const options = renderMappedItemsAsDrilldownOptions(mappedItems);
|
|
152
|
+
const label = typeof renderHiddenItemsMenuTriggerLabel === 'function' ? renderHiddenItemsMenuTriggerLabel(hiddenItems.length) : renderHiddenItemsMenuTriggerLabel;
|
|
153
|
+
const tooltip = typeof renderHiddenItemsMenuTriggerTooltip === 'function' ? renderHiddenItemsMenuTriggerTooltip(hiddenItems.length) : renderHiddenItemsMenuTriggerTooltip;
|
|
154
|
+
return jsx(TopNavBarItem, {
|
|
155
|
+
id: this._hiddenActionItemsMenuTriggerId,
|
|
156
|
+
renderIcon: IconMoreLine,
|
|
157
|
+
variant: "icon",
|
|
158
|
+
tooltip: tooltip,
|
|
159
|
+
showSubmenuChevron: false,
|
|
160
|
+
renderSubmenu: jsx(Drilldown, {
|
|
161
|
+
rootPageId: this._hiddenActionItemsMenuId
|
|
162
|
+
}, [jsx(Drilldown.Page, {
|
|
163
|
+
id: this._hiddenActionItemsMenuId,
|
|
164
|
+
key: this._hiddenActionItemsMenuId
|
|
165
|
+
}, options), ...subPages])
|
|
166
|
+
}, label);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
renderTruncatedActionItemList() {
|
|
170
|
+
const _this$props4 = this.props,
|
|
171
|
+
listLabel = _this$props4.listLabel,
|
|
172
|
+
styles = _this$props4.styles;
|
|
173
|
+
return jsx(TruncateList, Object.assign({}, passthroughProps(omitProps(this.props, allowedProps)), {
|
|
174
|
+
key: this.state.key // rerender if child count changes
|
|
175
|
+
,
|
|
176
|
+
elementRef: this.handleRef,
|
|
177
|
+
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarActionItems,
|
|
178
|
+
visibleItemsCount: this.state.visibleActionItemsCount,
|
|
179
|
+
onUpdate: _ref => {
|
|
180
|
+
let visibleItemsCount = _ref.visibleItemsCount;
|
|
181
|
+
this.setState({
|
|
182
|
+
visibleActionItemsCount: visibleItemsCount
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
renderHiddenItemMenu: hiddenChildren => this.renderHiddenActionItemsMenu(hiddenChildren),
|
|
186
|
+
"aria-label": listLabel
|
|
187
|
+
}), this.childrenArray);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
render() {
|
|
191
|
+
const _this$props5 = this.props,
|
|
192
|
+
listLabel = _this$props5.listLabel,
|
|
193
|
+
styles = _this$props5.styles;
|
|
194
|
+
|
|
195
|
+
if (!this.childrenArray.length) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (this.context.layout === 'smallViewport') {
|
|
200
|
+
return this.renderTruncatedActionItemList();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return jsx("ul", Object.assign({}, omitProps(this.props, allowedProps), {
|
|
204
|
+
ref: this.handleRef,
|
|
205
|
+
css: styles === null || styles === void 0 ? void 0 : styles.topNavBarActionItems,
|
|
206
|
+
"aria-label": listLabel
|
|
207
|
+
}), this.childrenArray.map(item => jsx("li", {
|
|
208
|
+
css: styles === null || styles === void 0 ? void 0 : styles.listItem,
|
|
209
|
+
key: item.props.id
|
|
210
|
+
}, item)));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
}, _class2.displayName = "TopNavBarActionItems", _class2.componentId = 'TopNavBar.ActionItems', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {}, _class2.contextType = TopNavBarContext, _class2)) || _class) || _class) || _class);
|
|
214
|
+
export { TopNavBarActionItems };
|
|
215
|
+
export default TopNavBarActionItems;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
26
|
+
import { TopNavBarItem } from '../TopNavBarItem';
|
|
27
|
+
import { topNavBarItemTooltipPropType } from '../TopNavBarItem/props';
|
|
28
|
+
const propTypes = {
|
|
29
|
+
children: ChildrenPropTypes.oneOf([TopNavBarItem]),
|
|
30
|
+
listLabel: PropTypes.string,
|
|
31
|
+
renderHiddenItemsMenuTriggerLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,
|
|
32
|
+
renderHiddenItemsMenuTriggerTooltip: PropTypes.oneOfType([topNavBarItemTooltipPropType, PropTypes.func]),
|
|
33
|
+
elementRef: PropTypes.func
|
|
34
|
+
};
|
|
35
|
+
const allowedProps = ['children', 'listLabel', 'renderHiddenItemsMenuTriggerLabel', 'renderHiddenItemsMenuTriggerTooltip', 'elementRef'];
|
|
36
|
+
export { propTypes, allowedProps };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* ---
|
|
27
|
+
* private: true
|
|
28
|
+
* ---
|
|
29
|
+
* Generates the style object from the theme and provided additional information
|
|
30
|
+
* @param {Object} componentTheme The theme variable object.
|
|
31
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
32
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
33
|
+
* @return {Object} The final style object, which will be used in the component
|
|
34
|
+
*/
|
|
35
|
+
const generateStyle = (componentTheme, _props, state) => {
|
|
36
|
+
const dropdownMenuOptionStyle = {
|
|
37
|
+
display: 'inline-block',
|
|
38
|
+
padding: `0 ${componentTheme.smallViewportDropdownMenuActiveOptionIndicatorSpacing}`
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
topNavBarActionItems: {
|
|
42
|
+
label: 'topNavBarActionItems',
|
|
43
|
+
boxSizing: 'border-box',
|
|
44
|
+
listStyleType: 'none',
|
|
45
|
+
margin: '0',
|
|
46
|
+
padding: '0',
|
|
47
|
+
flex: '0 0',
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexDirection: 'row',
|
|
50
|
+
alignItems: 'stretch',
|
|
51
|
+
justifyContent: 'flex-end',
|
|
52
|
+
...(state.layout === 'smallViewport' && {
|
|
53
|
+
flex: '1 1',
|
|
54
|
+
marginInlineStart: componentTheme.smallViewportActionItemContainerMargin,
|
|
55
|
+
maxWidth: componentTheme.smallViewportActionItemContainerMaxWidth
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
listItem: {
|
|
59
|
+
label: 'topNavBarActionItems__listItem',
|
|
60
|
+
flex: '0 0'
|
|
61
|
+
},
|
|
62
|
+
dropdownMenuOption: {
|
|
63
|
+
label: 'topNavBarActionItems__dropdownMenuOption',
|
|
64
|
+
...dropdownMenuOptionStyle
|
|
65
|
+
},
|
|
66
|
+
dropdownMenuOptionActive: {
|
|
67
|
+
label: 'topNavBarActionItems__dropdownMenuOptionActive',
|
|
68
|
+
...dropdownMenuOptionStyle,
|
|
69
|
+
fontWeight: componentTheme.smallViewportDropdownMenuActiveOptionFontWeight,
|
|
70
|
+
paddingBlockEnd: componentTheme.smallViewportDropdownMenuActiveOptionIndicatorSpacing,
|
|
71
|
+
borderBottom: `${componentTheme.smallViewportDropdownMenuActiveOptionIndicatorWidth} solid ${componentTheme.smallViewportDropdownMenuActiveOptionIndicatorColor}`
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default generateStyle;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
27
|
+
* @param {Object} theme The actual theme object.
|
|
28
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
29
|
+
*/
|
|
30
|
+
const generateComponentTheme = theme => {
|
|
31
|
+
const typography = theme.typography,
|
|
32
|
+
spacing = theme.spacing,
|
|
33
|
+
borders = theme.borders;
|
|
34
|
+
const componentVariables = {
|
|
35
|
+
smallViewportActionItemContainerMargin: spacing === null || spacing === void 0 ? void 0 : spacing.xxLarge,
|
|
36
|
+
smallViewportActionItemContainerMaxWidth: '50%',
|
|
37
|
+
smallViewportDropdownMenuActiveOptionFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
|
|
38
|
+
smallViewportDropdownMenuActiveOptionIndicatorSpacing: '0.25rem',
|
|
39
|
+
smallViewportDropdownMenuActiveOptionIndicatorWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
40
|
+
smallViewportDropdownMenuActiveOptionIndicatorColor: 'currentColor'
|
|
41
|
+
};
|
|
42
|
+
return { ...componentVariables
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default generateComponentTheme;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { locator } from '@instructure/ui-test-locator';
|
|
25
|
+
import { find } from '@instructure/ui-test-utils';
|
|
26
|
+
import { TopNavBarBrand } from './index'; // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
27
|
+
|
|
28
|
+
export const TopNavBarBrandLocator = locator(TopNavBarBrand.selector, {
|
|
29
|
+
findContainer: function () {
|
|
30
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
+
args[_key] = arguments[_key];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return find('[class$="-topNavBarBrand__container"]', ...args);
|
|
35
|
+
},
|
|
36
|
+
findBrandNameContainer: function () {
|
|
37
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
38
|
+
args[_key2] = arguments[_key2];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return find('[class$="-topNavBarBrand__nameContainer"]', ...args);
|
|
42
|
+
},
|
|
43
|
+
findBrandIconContainer: function () {
|
|
44
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
45
|
+
args[_key3] = arguments[_key3];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return find('[class$="-topNavBarBrand__iconContainer"]', ...args);
|
|
49
|
+
},
|
|
50
|
+
findScreenReaderLabel: function () {
|
|
51
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
52
|
+
args[_key4] = arguments[_key4];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return find('[class$="-screenReaderContent"]', ...args);
|
|
56
|
+
}
|
|
57
|
+
});
|