-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(instui-config,shared-types,ui-navigation,ui-side-nav-bar,ui): ad…
…d side-nav-bar component and deprecate navigation Closes: INSTUI-3792
- Loading branch information
Showing
41 changed files
with
1,804 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/node_modules/** | ||
/lib/** | ||
/es/** | ||
/types/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
lib/ | ||
.babel-cache/ | ||
es/ | ||
types/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/.* | ||
**/__tests__ | ||
**/__testfixtures__ | ||
**/__examples__ | ||
*.config.js | ||
*.conf.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
category: packages | ||
--- | ||
|
||
## ui-side-nav-bar | ||
|
||
[![npm][npm]][npm-url] | ||
[![MIT License][license-badge]][license] | ||
[![Code of Conduct][coc-badge]][coc] | ||
|
||
Main and application level navigational components. | ||
|
||
### Components | ||
|
||
The `ui-side-nav-bar` package contains the following: | ||
|
||
- [SideNavBar](#SideNavBar) | ||
- [AppNav](#AppNav) | ||
|
||
### Installation | ||
|
||
```sh | ||
yarn add @instructure/ui-side-nav-bar | ||
``` | ||
|
||
### Usage | ||
|
||
```js | ||
import React from 'react' | ||
import { SideNavBar } from '@instructure/ui-side-nav-bar' | ||
import { Avatar } from '@instructure/ui-avatar' | ||
|
||
const MySideNavBar = () => { | ||
return ( | ||
<SideNavBar label="My SideNavBar"> | ||
<SideNavBar.Item | ||
icon={<Avatar name="Joel Andrews" size="x-small" />} | ||
label="My Account" | ||
href="http://example.com" | ||
/> | ||
</SideNavBar> | ||
) | ||
} | ||
``` | ||
|
||
For detailed usage and documentation, see individual component examples. | ||
|
||
[npm]: https://img.shields.io/npm/v/@instructure/ui-side-nav-bar.svg | ||
[npm-url]: https://npmjs.com/package/@instructure/ui-side-nav-bar | ||
[license-badge]: https://img.shields.io/npm/l/instructure-ui.svg?style=flat-square | ||
[license]: https:/instructure/instructure-ui/blob/master/LICENSE | ||
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square | ||
[coc]: https:/instructure/instructure-ui/blob/master/CODE_OF_CONDUCT.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2015 - present Instructure, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
module.exports = { | ||
presets: [ | ||
[ | ||
require('@instructure/ui-babel-preset'), | ||
{ | ||
coverage: Boolean(process.env.COVERAGE), | ||
esModules: Boolean(process.env.ES_MODULES), | ||
removeConsole: process.env.NODE_ENV === 'production', | ||
transformImports: Boolean(process.env.TRANSFORM_IMPORTS) | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"name": "@instructure/ui-side-nav-bar", | ||
"version": "8.38.1", | ||
"description": "Main and application level navigational components", | ||
"author": "Instructure, Inc. Engineering and Product Design", | ||
"module": "./es/index.js", | ||
"main": "./lib/index.js", | ||
"types": "./types/index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https:/instructure/instructure-ui.git" | ||
}, | ||
"homepage": "https://instructure.github.io/instructure-ui/", | ||
"bugs": "https:/instructure/instructure-ui/issues", | ||
"scripts": { | ||
"lint": "run -T ui-scripts lint", | ||
"lint:fix": "run -T ui-scripts lint --fix", | ||
"clean": "run -T ui-scripts clean", | ||
"build": "run -T ui-scripts build --modules es,cjs", | ||
"build:watch": "yarn ts:check --watch & run -T ui-scripts build --watch", | ||
"build:types": "run -T tsc -p tsconfig.build.json", | ||
"ts:check": "run -T tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "8.38.1", | ||
"@instructure/ui-color-utils": "8.38.1", | ||
"@instructure/ui-test-locator": "8.38.1", | ||
"@instructure/ui-test-utils": "8.38.1", | ||
"@instructure/ui-themes": "8.38.1" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.22.5", | ||
"@instructure/console": "8.38.1", | ||
"@instructure/debounce": "8.38.1", | ||
"@instructure/emotion": "8.38.1", | ||
"@instructure/shared-types": "8.38.1", | ||
"@instructure/ui-a11y-content": "8.38.1", | ||
"@instructure/ui-a11y-utils": "8.38.1", | ||
"@instructure/ui-badge": "8.38.1", | ||
"@instructure/ui-dom-utils": "8.38.1", | ||
"@instructure/ui-focusable": "8.38.1", | ||
"@instructure/ui-icons": "8.38.1", | ||
"@instructure/ui-menu": "8.38.1", | ||
"@instructure/ui-prop-types": "8.38.1", | ||
"@instructure/ui-react-utils": "8.38.1", | ||
"@instructure/ui-testable": "8.38.1", | ||
"@instructure/ui-tooltip": "8.38.1", | ||
"@instructure/ui-truncate-list": "8.38.1", | ||
"@instructure/ui-utils": "8.38.1", | ||
"@instructure/ui-view": "8.38.1", | ||
"prop-types": "^15.8.1" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8 <=18" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
describes: SideNavBar | ||
--- | ||
|
||
A top-level `SideNavBar` component. | ||
|
||
> Note that this component is experimental and its API might change significantly in the future. | ||
```js | ||
--- | ||
example: true | ||
--- | ||
<div style={{height: '35rem'}}> | ||
<SideNavBar | ||
label="Main navigation" | ||
toggleLabel={{ | ||
expandedLabel: 'Minimize SideNavBar', | ||
minimizedLabel: 'Expand SideNavBar' | ||
}} | ||
> | ||
<SideNavBar.Item | ||
icon={<IconUserLine />} | ||
label={<ScreenReaderContent>Home</ScreenReaderContent>} | ||
href="#" | ||
themeOverride={{ | ||
backgroundColor: 'red', | ||
hoverBackgroundColor: 'blue' | ||
}} | ||
/> | ||
<SideNavBar.Item | ||
icon={<Avatar name="Ziggy Marley" size="x-small"/>} | ||
label="Account" | ||
onClick={() => { this.loadSubNav('account') }} | ||
/> | ||
<SideNavBar.Item | ||
icon={<IconAdminLine />} | ||
label="Admin" | ||
href="#" | ||
/> | ||
<SideNavBar.Item selected | ||
icon={<IconDashboardLine />} | ||
label="Dashboard" | ||
href="#" | ||
/> | ||
<SideNavBar.Item | ||
icon={<Badge count={99}><IconInboxLine /></Badge>} | ||
label="Inbox" | ||
href="#" | ||
/> | ||
<SideNavBar.Item | ||
icon={<IconUserLine />} | ||
label="Supercalifragilistic" | ||
href="#" | ||
/> | ||
</SideNavBar> | ||
</div> | ||
``` | ||
|
||
### Guidelines | ||
|
||
```js | ||
--- | ||
guidelines: true | ||
--- | ||
<Guidelines> | ||
<Figure recommendation="yes" title="Do"> | ||
<Figure.Item>Use for top-level SideNavBar</Figure.Item> | ||
<Figure.Item>Remember that SideNavBar can be themed by the institution</Figure.Item> | ||
</Figure> | ||
<Figure recommendation="no" title="Don't"> | ||
<Figure.Item>Add LTI links to the main area</Figure.Item> | ||
</Figure> | ||
</Guidelines> | ||
``` |
Oops, something went wrong.