Skip to content

Commit 3e09cf2

Browse files
committed
Add 'packages/canvas-header/' from commit 'e0d0b0293e1981eefa8b8a4df9a37926532356b6'
git-subtree-dir: packages/canvas-header git-subtree-mainline: ec4fad8 git-subtree-split: e0d0b02
2 parents ec4fad8 + e0d0b02 commit 3e09cf2

17 files changed

+1156
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# @lg-private/canvas-header
2+
3+
## 3.0.1
4+
5+
### Patch Changes
6+
7+
- 1916bd3: Removes background color from canvas header.
8+
9+
Fixes "Copied" tooltip alignment.
10+
11+
- f66e884: Updates `LiveExample` story so it displays correctly on .design
12+
13+
## 3.0.0
14+
15+
### Major Changes
16+
17+
- c9203f7: Removes `prop-types`. Updates LG core packages to latest
18+
19+
## 2.1.0
20+
21+
### Minor Changes
22+
23+
- daef9ca: Adds `resourceBadges` prop to render badges to the right of the resource name
24+
25+
## 2.0.1
26+
27+
### Patch Changes
28+
29+
- 8f076fb: Fixes naming of lg private packages from `@leafygreen-ui/*` to `@lg-private/*`
30+
31+
## 2.0.0
32+
33+
### Major Changes
34+
35+
- 0d12b4c: - Adds `badges` prop. This prop allows users to pass in [Badges](https://www.mongodb.design/component/badge/live-example).
36+
37+
E.g.
38+
39+
```js
40+
badges={<Badge variant="green">Enabled</Badge>}
41+
```
42+
43+
- Bump to @leafygreen-ui/leafygreen-provider@3.1.12
44+
45+
## 1.0.2
46+
47+
### Patch Changes
48+
49+
- 33e6b57: No functional changes. Upgrades build to use Node 18
50+
51+
## 1.0.1
52+
53+
### Patch Changes
54+
55+
- 476f90a: Updates `icon` & `tokens` packages to latest
56+
- d5c17a8: Updates TS builds to use `[email protected]`
57+
58+
## 1.0.0
59+
60+
### Major Changes
61+
62+
- 8a2c4d1: First major release of `CanvasHeader`. [LG-3949](https://jira.mongodb.org/browse/LG-3949)

packages/canvas-header/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Canvas Header
2+
3+
![npm (scoped)](https://img.shields.io/npm/v/@lg-private/canvas-header.svg)
4+
5+
#### [View on MongoDB.design](https://www.mongodb.design/component/canvas-header/example/)
6+
7+
## Installation
8+
9+
### Yarn
10+
11+
```shell
12+
yarn add @lg-private/canvas-header
13+
```
14+
15+
### NPM
16+
17+
```shell
18+
npm install @lg-private/canvas-header
19+
```
20+
21+
## Example
22+
23+
```js
24+
import { CanvasHeader } from `@lg-private/canvas-header`;
25+
import Button from '@leafygreen-ui/button';
26+
import Icon from '@leafygreen-ui/icon';
27+
import { BackLink } from '@leafygreen-ui/typography';
28+
29+
30+
<CanvasHeader
31+
pageTitle="page title"
32+
resourceName='ac_iqttxwn_shard-00-01.hvcuthh.mongodbnet:27017_324892384903284902384903284903284902384903284832908_long_name'
33+
resourceIcon={<Icon glyph={'ShardedCluster'} />}
34+
backLink={
35+
<BackLink
36+
href="/home"
37+
>
38+
Back to Cluster
39+
</BackLink>
40+
}
41+
actions={
42+
<Button
43+
variant="primary"
44+
leftGlyph={<Icon glyph={'InviteUser'} />}
45+
>
46+
Invite user
47+
</Button>
48+
}
49+
badges={
50+
<>
51+
<Badge variant="green">Enabled</Badge>
52+
<Badge variant="blue">In Dev Mode</Badge>
53+
</>
54+
}
55+
/>
56+
```
57+
58+
## Properties
59+
60+
| Prop | Type | Description | Default |
61+
| -------------- | ----------------- | ----------------------------------------------------------------------------- | ------- |
62+
| `darkMode` | `boolean` | Determines if the component renders in dark mode | `false` |
63+
| `pageTitle` | `React.ReactNode` | Required page title | |
64+
| `resourceName` | `string` | Opitional resource name that will copy to the clipboard when clicked | |
65+
| `resourceIcon` | `React.ReachNode` | Optional icon that will render to the left of the resource name | |
66+
| `badges` | `React.ReachNode` | Optional badges that will render to the right of the resource name | |
67+
| `actions` | `React.ReachNode` | Optional buttons that will render to the right of the badges or resource name | |
68+
| `backLink` | `React.ReactNode` | Optional link that will render above the page title. | |
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@lg-private/canvas-header",
3+
"version": "3.0.1",
4+
"description": "LeafyGreen UI Kit Canvas Header",
5+
"main": "./dist/umd/index.js",
6+
"module": "./dist/esm/index.js",
7+
"types": "./dist/types/index.d.ts",
8+
"exports": {
9+
".": {
10+
"require": "./dist/umd/index.js",
11+
"import": "./dist/esm/index.js",
12+
"types": "./dist/types/index.d.ts"
13+
}
14+
},
15+
"license": "Apache-2.0",
16+
"scripts": {
17+
"build": "lg build-package",
18+
"tsc": "lg build-ts",
19+
"docs": "lg build-tsdoc"
20+
},
21+
"publishConfig": {
22+
"access": "public",
23+
"registry": "https://artifactory.corp.mongodb.com/artifactory/api/npm/leafygreen-ui/"
24+
},
25+
"dependencies": {
26+
"@leafygreen-ui/emotion": "^4.0.8",
27+
"@leafygreen-ui/icon": "^13.0.0",
28+
"@leafygreen-ui/lib": "^14.0.0",
29+
"@leafygreen-ui/palette": "^4.1.0",
30+
"@leafygreen-ui/tokens": "^2.11.0",
31+
"@leafygreen-ui/tooltip": "^13.0.0",
32+
"@leafygreen-ui/typography": "^20.0.0"
33+
},
34+
"peerDependencies": {
35+
"@leafygreen-ui/leafygreen-provider": "^4.0.0"
36+
},
37+
"devDependencies": {
38+
"@leafygreen-ui/badge": "^9.0.0",
39+
"@leafygreen-ui/button": "^22.0.0",
40+
"@lg-tools/build": "0.8.0",
41+
"@lg-tools/storybook-utils": "^0.3.0",
42+
"@faker-js/faker": "^8.4.1"
43+
},
44+
"homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/canvas-header",
45+
"repository": {
46+
"type": "git",
47+
"url": "https://github.com/mongodb/leafygreen-ui"
48+
},
49+
"bugs": {
50+
"url": "https://jira.mongodb.org/projects/PD/summary"
51+
}
52+
}

0 commit comments

Comments
 (0)