-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from pxblue/dev
Go BLUI
- Loading branch information
Showing
53 changed files
with
27,774 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,40 @@ | ||
version: 2 | ||
version: 2.1 | ||
orbs: | ||
gh: circleci/[email protected] | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/node:12.6-browsers | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
key: v1-dependencies--{{ checksum "package.json" }}--{{ checksum "symbols-mui/package.json" }} | ||
- run: | ||
name: Install Dependencies | ||
command: | | ||
yarn install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
cd symbols-mui && yarn install:dependencies | ||
- run: | ||
name: Build Packages | ||
command: yarn build | ||
command: | | ||
yarn build | ||
cd symbols-mui && yarn build | ||
- run: | ||
name: Verify SVG Build Artifacts | ||
command: yarn test:svg | ||
command: | | ||
yarn test:svg | ||
cd symbols-mui && yarn test | ||
- save_cache: | ||
name: Save Cache | ||
paths: | ||
- node_modules | ||
- icons-mui/node_modules | ||
key: v1-dependencies--{{ checksum "package.json" }}--{{ checksum "symbols-mui/package.json" }} | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- symbols | ||
- symbols-mui/symbols | ||
|
||
publish: | ||
docker: | ||
|
@@ -41,8 +49,23 @@ jobs: | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc | ||
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
- run: | ||
name: Publish @pxblue/symbols | ||
name: Publish @brightlayer-ui/symbols | ||
command: cd symbols && yarn publish:package -b $CIRCLE_BRANCH | ||
- run: | ||
name: Publish @brightlayer-ui/symbols-mui | ||
command: cd symbols-mui && yarn publish:package -b $CIRCLE_BRANCH | ||
tag: | ||
docker: | ||
- image: circleci/node:12.9.1-browsers | ||
steps: | ||
- checkout | ||
- gh/setup | ||
- run: | ||
name: Tag @brightlayer-ui/symbols | ||
command: cd symbols && yarn tag:package -b $CIRCLE_BRANCH -s -blui-symbols | ||
- run: | ||
name: Tag @brightlayer-ui/symbols-mui | ||
command: cd symbols-mui && yarn tag:package -b $CIRCLE_BRANCH -s -blui-symbols-mui | ||
workflows: | ||
version: 2 | ||
symbols: | ||
|
@@ -56,3 +79,10 @@ workflows: | |
only: | ||
- master | ||
- dev | ||
- tag: | ||
requires: | ||
- publish | ||
filters: | ||
branches: | ||
only: | ||
- master |
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 |
---|---|---|
|
@@ -26,3 +26,5 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
/.idea/ | ||
|
||
symbols-mui/symbols |
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -1 +1 @@ | ||
* @huayunh @joebochill @emclaug2 | ||
* @huayunh @jeffvg @emclaug2 @daileytj |
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 |
---|---|---|
@@ -1,85 +1,6 @@ | ||
# PX Blue Symbols | ||
[![](https://img.shields.io/npm/v/@pxblue/symbols.svg?label=@pxblue/symbols&style=flat)](https://www.npmjs.com/package/@pxblue/symbols) | ||
[![](https://img.shields.io/circleci/project/github/pxblue/symbols/master.svg?style=flat)](https://circleci.com/gh/pxblue/symbols/tree/master) | ||
|
||
This is a library of one-line symbols for use in PX Blue applications. | ||
|
||
## Installation | ||
To install the PX Blue symbols from NPM as a dependency for your project, you can run one of the following commands in your project root: | ||
``` | ||
npm install --save @pxblue/symbols | ||
or | ||
yarn add @pxblue/symbols | ||
``` | ||
|
||
## Usage | ||
### Angular | ||
The simplest way to use these SVG symbols in Angular is to register them with the matIconRegistry so they can be used with the ```<mat-icon>``` tag. You can register symbols individually, or as the entire PX Blue set: | ||
|
||
``` | ||
import { Component } from "@angular/core"; | ||
import { MatIconRegistry } from "@angular/material/icon"; | ||
import { DomSanitizer } from "@angular/platform-browser"; | ||
declare var require: any; | ||
const symbol = require("@pxblue/symbols/battery.svg"); // individual symbol | ||
const symbolSet = require("@pxblue/symbols/symbols.svg"); // full set | ||
``` | ||
|
||
Then, in your constructor, register the symbol or the symbol set. It will then be available for use as a ```<mat-icon>```. | ||
|
||
#### Individual Icon | ||
``` | ||
// app.component.ts | ||
export class AppComponent { | ||
constructor( | ||
private matIconRegistry: MatIconRegistry, | ||
private domSanitizer: DomSanitizer | ||
) { | ||
this.matIconRegistry.addSvgIcon( | ||
"battery", | ||
this.domSanitizer.bypassSecurityTrustResourceUrl(symbol) | ||
); | ||
} | ||
} | ||
``` | ||
|
||
``` | ||
// app.component.html | ||
<mat-icon svgIcon="battery"></mat-icon> | ||
``` | ||
|
||
#### Entire Icon Set | ||
``` | ||
// app.component.ts | ||
export class AppComponent { | ||
constructor( | ||
private matIconRegistry: MatIconRegistry, | ||
private domSanitizer: DomSanitizer | ||
) { | ||
this.matIconRegistry.addSvgIconSetInNamespace('px-symbols', this.domSanitizer.bypassSecurityTrustResourceUrl(symbolSet)); | ||
} | ||
} | ||
``` | ||
|
||
``` | ||
// app.component.ts | ||
<mat-icon svgIcon="px-symbols:battery"></mat-icon> | ||
``` | ||
|
||
### React | ||
``` | ||
const symbol = require('@pxblue/symbols/SYMBOL_NAME.svg'); | ||
... | ||
<img src={symbol}/> | ||
``` | ||
|
||
>NOTE: If you will be using many of these symbols in your application, we recommend you use [@pxblue/symbols-mui](https://www.npmjs.com/package/@pxblue/symbols-mui) to simplify usage. This library makes more sense if you just need one or two symbols or if you want to reduce the size of your bundle. | ||
### Available Symbols | ||
Please see [Available Symbols](https://github.com/pxblue/symbols/blob/master/available_symbols.md) for a list of currently available symbols. | ||
|
||
# For Icon Creators | ||
Each symbol has its own folder in the /icons/symbols folder, which includes the clean SVG file . | ||
|
||
# Brightlayer UI Symbols | ||
[![](https://img.shields.io/npm/v/@brightlayer-ui/symbols.svg?label=@brightlayer-ui/symbols&style=flat)](https://www.npmjs.com/package/@brightlayer-ui/symbols) | ||
[![](https://img.shields.io/npm/v/@brightlayer-ui/symbols-mui.svg?label=@brightlayer-ui/symbols-mui&style=flat)](https://www.npmjs.com/package/@brightlayer-ui/symbols-mui) | ||
[![](https://img.shields.io/circleci/project/github/brightlayer-ui/symbols/master.svg?style=flat)](https://circleci.com/gh/brightlayer-ui/symbols/tree/master) | ||
|
||
This is a repo that contains [one-line symbols](https://github.com/brightlayer-ui/symbols/tree/master/symbols) for use in Brightlayer UI applications as well as [componentized symbols](https://github.com/brightlayer-ui/symbols/tree/master/symbols-mui) for use within a React application. |
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,29 @@ | ||
# Recent Changes | ||
|
||
## v1.1.1 (October 29, 2021) | ||
|
||
### Changed | ||
|
||
- Changed package namespace from `@pxblue` to `@brightlayer-ui`. | ||
|
||
## Package Migration Notice | ||
|
||
Previous versions listed after this indicator refer to our deprecated `@pxblue` packages. | ||
|
||
--- | ||
|
||
## v1.1.1 (July 2, 2020) | ||
|
||
### Fixed | ||
|
||
- Fixes viewbox issues with some symbols. | ||
|
||
## v1.1.0 (February 13, 2020) | ||
|
||
### Added | ||
|
||
- Added type definitions for use in TypeScript projects. | ||
|
||
## v1.0.0 (October 25, 2018) | ||
|
||
Initial Release |
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,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2020 - Present, Eaton | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,28 @@ | ||
# Publishing Instructions | ||
|
||
## Automatic Publishing | ||
|
||
This package is published to NPM automatically by CircleCI when code is merged into the `dev` or `master` branches. To publish a new version, simply update the version in `package.json` and merge your code into the appropriate branch. | ||
- The `dev` branch will publish versions marked as `alpha` or `beta`. | ||
- The `master` branch will publish any version (`alpha`, `beta`, or `latest`). | ||
In both cases, the code will only be published if the version number differs from the current version published under the respective dist tag. | ||
|
||
## Manually Publishing | ||
|
||
If you need to publish a package manually, you can run the following commands from the root folder: | ||
|
||
```sh | ||
yarn build | ||
yarn publish:package | ||
``` | ||
|
||
The publishing script will look at the version in the `package.json` and automatically determine whether to publish an alpha, beta, or latest package. | ||
|
||
For this command to work, you must have an NPM token configured in your environment variables or you can perform a login prior to executing the publish command via: | ||
|
||
```sh | ||
yarn build | ||
npm adduser && yarn publish:package | ||
``` | ||
|
||
> Publishing manually should only be done for `alpha` or `beta` packages. The command will work for `latest` packages, but this should be avoided except in rare situations where the automatic publishing functionality is not working in CircleCI. |
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,49 @@ | ||
[![](https://img.shields.io/circleci/project/github/brightlayer-ui/symbols/master.svg?style=flat)](https://circleci.com/gh/brightlayer-ui/symbols/tree/master) | ||
![npm](https://img.shields.io/npm/v/@brightlayer-ui/symbols-mui?label=%40brightlayer-ui/symbols-mui) | ||
|
||
# Brightlayer UI Symbols for Material-UI | ||
This library contains componentized svg symbols from [@brightlayer-ui/symbols](https://github.com/brightlayer-ui/symbols) for use in React applications using Material UI. The symbols are made available in the same way that Material UI exposes the [Material Icons](https://material-ui.com/style/icons/#svg-material-icons). | ||
|
||
## Installation | ||
To install the Brightlayer UI mui symbols from NPM as a dependency for your project, you can run one of the following commands in your project root: | ||
``` | ||
npm install --save @brightlayer-ui/symbols-mui | ||
or | ||
yarn add @brightlayer-ui/symbols-mui | ||
``` | ||
|
||
>**NOTE (Peer Dependencies):** Using this package requires you to have @material-ui/core and @material-ui/icons defined as dependencies in your project's package.json file. | ||
|
||
## Usage | ||
|
||
### Angular | ||
This package is intended for use only in React applications. For a way to link svg symbols for use in Angular applications, see [@brightlayer-ui/symbols](https://github.com/brightlayer-ui/symbols). | ||
|
||
|
||
### React | ||
Once you have installed the npm module, you can import the symbol components into your application as follows: | ||
``` | ||
import mySymbol from '@brightlayer-ui/symbols-mui/MySymbol; | ||
... | ||
<mySymbol></mySymbol> | ||
``` | ||
If you are importing multiple symbols, you can save some space by using named imports from the package root: | ||
``` | ||
import {FirstSymbol, SecondSymbol, ThirdSymbol} from '@brightlayer-ui/symbols-mui'; | ||
``` | ||
|
||
Symbol names are in TitleCase - for a list of available symbols, refer to [@brightlayer-ui/symbols](https://github.com/brightlayer-ui/symbols/blob/master/README.md) or look at our live [demo](http://brightlayer-ui.github.io/style/iconography). | ||
|
||
## Building Symbol Set (for contributors) | ||
To build the symbols set, e.g. when new symbols are added: | ||
|
||
``` | ||
yarn install | ||
yarn run svgr | ||
``` | ||
or | ||
``` | ||
yarn install | ||
yarn run mui | ||
``` |
Oops, something went wrong.