45
.github/main.workflow
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
workflow "lint, test, deploy, publish" {
|
||||
on = "push"
|
||||
resolves = [
|
||||
"lint",
|
||||
"test",
|
||||
"deploy",
|
||||
"publish",
|
||||
]
|
||||
}
|
||||
|
||||
action "install" {
|
||||
uses = "actions/npm@v2.0.0"
|
||||
args = ["install", "--unsafe-perm"]
|
||||
}
|
||||
|
||||
action "lint" {
|
||||
needs = "install"
|
||||
uses = "actions/npm@v2.0.0"
|
||||
args = "run lint"
|
||||
}
|
||||
|
||||
action "test" {
|
||||
needs = "install"
|
||||
uses = "actions/npm@v2.0.0"
|
||||
args = "test"
|
||||
}
|
||||
|
||||
action "deploy" {
|
||||
needs = "install"
|
||||
uses = "primer/deploy@v2.2.0"
|
||||
secrets = [
|
||||
"GITHUB_TOKEN",
|
||||
"NOW_TOKEN",
|
||||
]
|
||||
}
|
||||
|
||||
action "publish" {
|
||||
needs = ["lint", "test"]
|
||||
uses = "primer/publish@v1.0.0"
|
||||
args = ["--", "--unsafe-perm"]
|
||||
secrets = ["GITHUB_TOKEN", "NPM_AUTH_TOKEN"]
|
||||
env = {
|
||||
PUBLISH_STATUS_CONTEXT = "npm publish primer"
|
||||
}
|
||||
}
|
10
.gitignore
vendored
@ -1,10 +1,10 @@
|
||||
*.lerna_backup
|
||||
*.log
|
||||
*/*/package-lock.json
|
||||
*.tgz
|
||||
.DS_Store
|
||||
.changelog
|
||||
.next/
|
||||
.sass-cache
|
||||
_site
|
||||
build
|
||||
primer-version.txt
|
||||
node_modules
|
||||
build/
|
||||
dist/
|
||||
node_modules/
|
||||
|
17
.npmignore
@ -1,2 +1,17 @@
|
||||
*.yml
|
||||
*.log
|
||||
.github/
|
||||
.postcss.json
|
||||
.next/
|
||||
.storybook/
|
||||
next.config.js
|
||||
now.json
|
||||
docs/
|
||||
docs-test/
|
||||
lib/
|
||||
pages/
|
||||
script/
|
||||
# we ignore this because everything in src/ is copied out in script/prepublish
|
||||
src/
|
||||
static/
|
||||
tests/
|
||||
tools/
|
||||
|
2
.npmrc
@ -1,3 +1,3 @@
|
||||
save=true
|
||||
save-exact=true
|
||||
no-package-lock=true
|
||||
git-tag-version=false
|
||||
|
34
.travis.yml
@ -1,34 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 8
|
||||
|
||||
env:
|
||||
global:
|
||||
# github
|
||||
- secure: "J+1oWjvvXjyrwkY/4IFWKdN/weFmQcPwlRuFG4R0Gb3rYe4nqtC9l68sJvmS8asc8dQMhOhcUZCH6sjvo7l2WD4NuK4umPSbs+rJNUsfbvH4pZjStQIj/3ll1OfQelGDWAYQWhIfciYY4F3Bp0ZWTfKOppLQ2AVIYu1fPVXDdlo="
|
||||
# github changelog
|
||||
- secure: "KcGydAqL7ryDh2rTJJB4wU8NE5BRtnrRXDEcPBScSscO3zFsHXHBDvvO04B/9hFVatXzGYXmkn+FZ0P9QikhvebzdwwyqUG2SKFiHhMvbX0m0WtAhn5NqDuKU1r5qy5YQ18r/tiLfC9GSAlEpfLAH58pwpcn8srV3Mn/yKvlrfs="
|
||||
|
||||
script:
|
||||
- npm test
|
||||
- script/check-versions
|
||||
- script/selector-diff-report
|
||||
|
||||
before_deploy:
|
||||
# this will short-circuit the publish step if it fails to interpolate $NPM_API_KEY
|
||||
- npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}"
|
||||
# copy the CHANGELOG.md primer for publishing
|
||||
- cp CHANGELOG.md modules/primer
|
||||
|
||||
deploy:
|
||||
# publish canary releases on all branches *except* master and release-*
|
||||
- provider: script
|
||||
script: script/deploy --yes
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branches: true
|
||||
tags: false
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
secure: W9lPRuuPMNwElkXZ8UZtu5phgUNleDCK0PgERa28dkh5b0Y9xzRpIQPRJfqVYAPtnMVXhfYcqryMzA4oj0E4fc7OxQsKmMeF1OcTuj5N4CM5xXR/qXDehOUTp6fpCToIX9d4hZ2H///PCExpul3TcfxYJe6EWQCHYd1n6zKRl8g=
|
26
DEVELOP.md
@ -5,7 +5,7 @@ If you've made it this far, **thank you**! We appreciate your contribution, and
|
||||
## Structure
|
||||
The project is structured as a [monorepo] made up of lots of small npm modules, many of which depend on each other. We use [Lerna] to manage, version, and publish all of the packages together.
|
||||
|
||||
The top-level `package.json` is not published, but tracks common dependencies for developing Primer, and hosts some useful npm [run-scripts]. See the [scripts section](#scripts) for more info.
|
||||
The top-level `package.json` is not published, but tracks common dependencies for developing Primer, and hosts some useful npm [run-scripts](#scripts).
|
||||
|
||||
## Workflow
|
||||
The typical Primer workflow looks something like this:
|
||||
@ -57,28 +57,12 @@ storiesFromMarkdown(require.context('.', true, /\.md$/))
|
||||
|
||||
This is how we find all of the Markdown files in the package directory and generate stories from their code blocks. Storybook sections are labeled by the first argument to `storiesOf()` (in the above example, "Module name"), and individual stories get their titles from either the previous Markdown heading or the `title` attribute in the fenced code block. See the [`code-blocks` docs](https://npmjs.com/package/code-blocks) and the [`storiesFromMarkdown()` source](./.storybook/lib/storiesFromMarkdown.js) for more info.
|
||||
|
||||
## CSS packages
|
||||
All of the Primer CSS packages live in the [modules](./modules) subdirectory, including the [`primer`](./modules/package) omnibus package.
|
||||
|
||||
## Tools
|
||||
Many tools specific to development of Primer CSS live in the [tools](./tools) subdirectory.
|
||||
|
||||
## Scripts
|
||||
The [`script` directory](./script) houses a collection of scripts that we use to maintain, test, build, and publish packages. Some scripts of note:
|
||||
Our [`package.json`](package.json) houses a collection of [run-scripts] that we use to maintain, test, build, and publish Primer CSS. You can list them with:
|
||||
|
||||
* `script/check-imports` compares the list of Primer npm dependencies for each package with SCSS `@import` statements in its source, and warns if any mismatches (dependencies without corresponding imports, or vice-versa) are found.
|
||||
* `script/compare-published` compares the latest published versions of each Primer CSS package with the `version` field in its local `package.json`, and reports any discrepancies.
|
||||
* `script/get-packages` lists all of the package subdirectories from both `modules` and `tools` directories, and is useful for iterating in shell scripts:
|
||||
|
||||
```sh
|
||||
for pkg in $(script/get-packages); do
|
||||
echo $pkg
|
||||
done
|
||||
```
|
||||
|
||||
If you're looking for more detail, you can also run `npx lerna ls`, which will list the packages by name along with their versions.
|
||||
|
||||
Scripts like `lint-scss`, `notify`, and `test-docs` are called from individual packages to run specific common tasks; `npm-run` and `npm-run-all` are used more generally to run monorepo-installed npm utilities within the package directory, and can probably be refactored to simply run [npx].
|
||||
```sh
|
||||
npm run
|
||||
```
|
||||
|
||||
|
||||
[monorepo]: https://github.com/babel/babel/blob/master/doc/design/monorepo.md
|
||||
|
91
README.md
@ -1,49 +1,28 @@
|
||||
# Primer
|
||||
[![npm version](https://img.shields.io/npm/v/@primer/css.svg)](https://www.npmjs.org/package/@primer/css)
|
||||
|
||||
[![npm version](https://img.shields.io/npm/v/primer.svg)](https://www.npmjs.org/package/primer)
|
||||
[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer)
|
||||
|
||||
Primer is the design system that powers GitHub. Primer includes 23 packages that are grouped into 3 core meta-packages for easy install. Each package and meta-package is independently versioned and distributed via npm, so it's easy to include all or part of Primer within your own project.
|
||||
|
||||
## Packages
|
||||
|
||||
The Primer repo is managed as a monorepo that is composed of many npm packages.
|
||||
|
||||
### Core Packages
|
||||
|
||||
| Package | Version |
|
||||
|---|---|
|
||||
| **[primer](/modules/primer)** <br />Includes all 23 packages | [![npm](https://img.shields.io/npm/v/primer.svg)](https://www.npmjs.com/package/primer) |
|
||||
| [primer-core](/modules/primer-core) | [![npm](https://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.com/package/primer-core) |
|
||||
| [primer-product](/modules/primer-product) | [![npm](https://img.shields.io/npm/v/primer-product.svg)](https://www.npmjs.com/package/primer-product) |
|
||||
| [primer-marketing](/modules/primer-marketing) | [![npm](https://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.com/package/primer-marketing) |
|
||||
Primer CSS is the Sass implementation of [Primer], the design system that powers GitHub.
|
||||
|
||||
## Install
|
||||
|
||||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer` with this command.
|
||||
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `@primer/css` with this command.
|
||||
|
||||
```sh
|
||||
$ npm install --save primer
|
||||
$ npm install --save @primer/css
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The source files included are written in [Sass][sass] (SCSS). After [installing](#install) with npm, you can add your project's `node_modules` directory to your Sass [include paths](https://github.com/sass/node-sass#includepaths) (AKA [load paths](http://technology.customink.com/blog/2014/10/09/understanding-and-using-sass-load-paths/) in Ruby), then import it like this:
|
||||
The included source files are written in [Sass][sass] with the SCSS syntax. After [installing](#install) with npm, you can add your project's `node_modules` directory to your Sass [include paths](https://github.com/sass/node-sass#includepaths) (AKA [load paths](http://technology.customink.com/blog/2014/10/09/understanding-and-using-sass-load-paths/) in Ruby), then import it like this:
|
||||
|
||||
```scss
|
||||
@import "primer/index.scss";
|
||||
@import "@primer/css/index.scss";
|
||||
```
|
||||
|
||||
You can import individual Primer modules by installing them with npm, for instance:
|
||||
|
||||
```sh
|
||||
$ npm install --save primer-navigation
|
||||
```
|
||||
|
||||
Then, you would import the module with:
|
||||
You can import individual Primer modules directly from the `@primer/css` package:
|
||||
|
||||
```scss
|
||||
@import "primer-navigation/index.scss";
|
||||
@import "@primer/css/core/index.scss";
|
||||
@import "@primer/css/product/index.scss";
|
||||
@import "@primer/css/marketing/index.scss";
|
||||
```
|
||||
|
||||
## Development
|
||||
@ -53,14 +32,58 @@ See [DEVELOP.md](./DEVELOP.md) for development docs.
|
||||
You can find docs about our release process in [RELEASING.md](./RELEASING.md).
|
||||
|
||||
## Documentation
|
||||
The Primer CSS documentation site is created with [Next] and hosted on [Now].
|
||||
|
||||
Primer CSS documentation is published to the [GitHub Style Guide](https://styleguide.github.com/primer/).
|
||||
### Running the site
|
||||
Once you've cloned this repo and run `npm install`, you can start the site with:
|
||||
|
||||
```sh
|
||||
npm start
|
||||
```
|
||||
|
||||
This should start up the Next dev server and a background task that will keep the `pages` directory up-to-date whenever you change the source files in `modules/primer*`.
|
||||
|
||||
### Syncing the docs
|
||||
If, for whatever reason, the dev server isn't syncing files, you have two choices:
|
||||
|
||||
1. Stop the server (`ctrl-C`) and restart it (`npm run dev`), which will re-sync the files and clear Next's cache.
|
||||
2. Run [script/sync](./script/sync) manually:
|
||||
|
||||
```sh
|
||||
# in the docs directory
|
||||
script/sync
|
||||
```
|
||||
|
||||
**If you find yourself needing to do this often, please [file an issue](/primer/primer/issues/new) and tag `@shawnbot`**. :bow:
|
||||
|
||||
## The pages directory
|
||||
The [pages directory](./pages/) contains all of the files that map to URLs on the site. Because we plan to host the site at `primer.style/css` (and because of the way that Now's path aliasing feature works), we nest all of our documentation under the additional [css directory](./pages/css).
|
||||
|
||||
The sync task maintains a listing of files that it's copied from the modules directory in `pages/css/.gitignore`, which ensures that none of these files are checked into git.
|
||||
|
||||
## Sync internals
|
||||
|
||||
We use [Metalsmith] to sync the source docs to the `pages` directory and transform them in the following ways:
|
||||
|
||||
1. We filter the list of files to only Markdown documents and `package.json` files
|
||||
1. Many package `README.md`s wrap the actual documentation content in `<!-- %docs -->` HTML comments that usually include YAML frontmatter. In these instances, we extract the content that portion and reformat the frontmatter.
|
||||
1. We filter out any Markdown files that _don't_ include a `path` frontmatter key, and rename the destination file to match the `path` (e.g. `path: foo/bar` writes to `pages/css/foo/bar.md`).
|
||||
1. We set the `source` frontmatter key to a fully-qualified `github.com` URL for the source file so that we can link directly to it.
|
||||
1. A limited list of fields for all packages is extracted into a single file (`pages/css/packages.json`), which serves as a light-weight dependency graph.
|
||||
1. We read [the changelog](../CHANGELOG.md) and write it to `whats-new/changelog.md` with some additional frontmatter.
|
||||
1. We read the list of files from `pages/css/.gitignore` and delete them from the filesystem, then write the new list of paths so that they aren't committed to git.
|
||||
|
||||
All of the logic for syncing the source docs (and transforming them in transit) is controlled in [`lib/sync.js`](./lib/sync.js), and each "step" in the transformation (as well as the watching) is implemented as a Metalsmith plugin.
|
||||
|
||||
**Why [Metalsmith]?** We're glad you asked! `@shawnbot` likes the simplicity of Metalsmith's core and how easy it is to write powerful plugins.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) © [GitHub](https://github.com/)
|
||||
|
||||
[primer]: https://github.com/primer/primer
|
||||
[npm]: https://www.npmjs.com/
|
||||
[Metalsmith]: https://metalsmith.io/
|
||||
[Next]: https://github.com/zeit/next.js
|
||||
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
||||
[npm]: https://www.npmjs.com/
|
||||
[primer]: https://github.com/primer/primer
|
||||
[sass]: http://sass-lang.com/
|
||||
|
22
RELEASING.md
@ -22,13 +22,11 @@
|
||||
npm run bump
|
||||
```
|
||||
|
||||
4. Run `script/check-versions` to catch any cross-module version mismatches. (This will run on Travis, too.)
|
||||
4. Test your changes with the latest release candidate version in the appropriate places (styleguide, storybook, github/github).
|
||||
|
||||
5. Test your changes with the latest release candidate version in the appropriate places (styleguide, storybook, github/github).
|
||||
5. Once the release PR is approved and you've done necessary testing, merge to `master`. This will trigger publishing to npm.
|
||||
|
||||
6. Once the release PR is approved and you've done necessary testing, merge to `master`. This will trigger publishing to npm.
|
||||
|
||||
7. Create a new release branch for the next release from `master` and name it `release-<version>`. Please use the following template for the PR description, linking to the relevant issues and/or pull requests for each change, and removing irrelevant headings:
|
||||
6. Create a new release branch for the next release from `master` and name it `release-<version>`. Please use the following template for the PR description, linking to the relevant issues and/or pull requests for each change, and removing irrelevant headings:
|
||||
|
||||
```md
|
||||
# Primer [Major|Minor|Patch] Release
|
||||
@ -73,19 +71,17 @@
|
||||
|
||||
1. Create a new branch
|
||||
|
||||
2. Update the primer version in your terminal `bin/npm install primer@<version>`.
|
||||
2. Update the primer version in your terminal `bin/npm install @primer/css@<version>`.
|
||||
|
||||
3. Update `stylelint-config-primer` in your terminal to the appropriate version `bin/npm install stylelint-config-primer@latest`.
|
||||
3. If you need to make changes to github/github due to the Primer release, make a separate branch. When ready, merge that branch into your release branch.
|
||||
|
||||
4. If you need to make changes to github/github due to the Primer release, make a separate branch. When ready, merge that branch into your release branch.
|
||||
4. Add reviewers.
|
||||
|
||||
5. Add reviewers.
|
||||
5. Check that every deleted vendor file has an accompanying updated vendor file and that the version numbers look correct.
|
||||
|
||||
6. Check that every deleted vendor file has an accompanying updated vendor file and that the version numbers look correct.
|
||||
6. Test on review-lab.
|
||||
|
||||
7. Test on review-lab.
|
||||
|
||||
8. When ready, merge! 🎉
|
||||
7. When ready, merge! 🎉
|
||||
|
||||
|
||||
### Publish release tag
|
||||
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"plugin:github/es6",
|
||||
"plugin:github/react",
|
||||
"plugin:jsx-a11y/recommended"
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "^16.6"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"import/no-namespace": 0
|
||||
}
|
||||
}
|
2
docs/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
.next/
|
||||
static/primer.css
|
@ -1,58 +0,0 @@
|
||||
# Primer CSS docs site
|
||||
This directory hosts a [Next] site that pulls in Primer CSS documentation from the [modules directory](../modules).
|
||||
|
||||
## Running the site
|
||||
First, make sure that you've bootstrapped the monorepo from the top-level directory. The `fresh` run-script will ensure that all `node_modules` or `package-lock.json` files are removed first:
|
||||
|
||||
```
|
||||
# in the repo root
|
||||
npm run fresh
|
||||
```
|
||||
|
||||
Then, navigate to this directory (`cd docs`) and run:
|
||||
|
||||
```sh
|
||||
# in the docs directory
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This should start up the Next dev server and a background task that will keep the `pages` directory up-to-date whenever you change the source files in `modules/primer*`.
|
||||
|
||||
## Syncing the docs
|
||||
If, for whatever reason, the dev server isn't syncing files, you have two choices:
|
||||
|
||||
1. Stop the server (`ctrl-C`) and restart it (`npm run dev`), which will re-sync the files and clear Next's cache.
|
||||
2. Run [script/sync](./script/sync) manually:
|
||||
|
||||
```sh
|
||||
# in the docs directory
|
||||
script/sync
|
||||
```
|
||||
|
||||
**If you find yourself needing to do this often, please [file an issue](/primer/primer/issues/new) and tag `@shawnbot`**. :bow:
|
||||
|
||||
## The pages directory
|
||||
The [pages directory](./pages/) contains all of the files that map to URLs on the site. Because we plan to host the site at `primer.style/css` (and because of the way that Now's path aliasing feature works), we nest all of our documentation under the additional [css directory](./pages/css).
|
||||
|
||||
The sync task maintains a listing of files that it's copied from the modules directory in `pages/css/.gitignore`, which ensures that none of these files are checked into git.
|
||||
|
||||
If you find yourself editing a file,
|
||||
|
||||
## Sync internals
|
||||
|
||||
We use [Metalsmith] to sync the source docs to the `pages` directory and transform them in the following ways:
|
||||
|
||||
1. We filter the list of files to only Markdown documents and `package.json` files
|
||||
1. Many package `README.md`s wrap the actual documentation content in `<!-- %docs -->` HTML comments that usually include YAML frontmatter. In these instances, we extract the content that portion and reformat the frontmatter.
|
||||
1. We filter out any Markdown files that _don't_ include a `path` frontmatter key, and rename the destination file to match the `path` (e.g. `path: foo/bar` writes to `pages/css/foo/bar.md`).
|
||||
1. We set the `source` frontmatter key to a fully-qualified `github.com` URL for the source file so that we can link directly to it.
|
||||
1. A limited list of fields for all packages is extracted into a single file (`pages/css/packages.json`), which serves as a light-weight dependency graph.
|
||||
1. We read [the changelog](../CHANGELOG.md) and write it to `whats-new/changelog.md` with some additional frontmatter.
|
||||
1. We read the list of files from `pages/css/.gitignore` and delete them from the filesystem, then write the new list of paths so that they aren't committed to git.
|
||||
|
||||
All of the logic for syncing the source docs (and transforming them in transit) is controlled in [`lib/sync.js`](./lib/sync.js), and each "step" in the transformation (as well as the watching) is implemented as a Metalsmith plugin.
|
||||
|
||||
**Why [Metalsmith]?** We're glad you asked! `@shawnbot` likes the simplicity of Metalsmith's core and how easy it is to write powerful plugins.
|
||||
|
||||
[Metalsmith]: https://metalsmith.io/
|
||||
[Next]: https://github.com/zeit/next.js
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 812 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
12767
docs/package-lock.json
generated
@ -1,73 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@primer/css-docs",
|
||||
"scripts": {
|
||||
"lint": "eslint pages src",
|
||||
"pretest": "npm run sync",
|
||||
"test": "node test/urls.js",
|
||||
"check-links": "script/check-links http://localhost:3000/css -v",
|
||||
"sync": "script/sync",
|
||||
"watch": "script/sync --watch",
|
||||
"dev": "next",
|
||||
"build": "next build",
|
||||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@githubprimer/octicons-react": "^8.1.3",
|
||||
"@mdx-js/mdx": "^0.16.6",
|
||||
"@mdx-js/tag": "0.15.0",
|
||||
"@primer/components": "^8.2.0-beta",
|
||||
"@svgr/webpack": "2.4.1",
|
||||
"@zeit/next-css": "^1.0.1",
|
||||
"@zeit/next-sass": "^1.0.1",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"broken-link-checker": "^0.7.8",
|
||||
"char-spinner": "^1.0.1",
|
||||
"chroma-js": "^1.4.1",
|
||||
"clipboard-copy-element": "^0.5.0",
|
||||
"colorette": "^1.0.7",
|
||||
"details-dialog-element": "^1.4.0",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-plugin-github": "1.0.0",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"fs-extra": "^4.0.2",
|
||||
"gray-matter": "^4.0.1",
|
||||
"hast-util-to-html": "^5.0.0",
|
||||
"hast-util-to-string": "^1.0.1",
|
||||
"html-2-jsx": "^0.5.1-dev",
|
||||
"klaw": "^3.0.0",
|
||||
"loader-utils": "^1.1.0",
|
||||
"mdx-constant": "^0.1.0",
|
||||
"mdx-live": "2.0.0-alpha.2",
|
||||
"metalsmith": "^2.3.0",
|
||||
"metalsmith-filter": "^1.0.2",
|
||||
"metalsmith-matters": "^1.2.0",
|
||||
"metalsmith-watch": "^1.0.3",
|
||||
"minimatch": "^3.0.4",
|
||||
"next": "7.0.2",
|
||||
"next-compose-plugins": "2.1.1",
|
||||
"node-sass": "^4.10.0",
|
||||
"now": "^12.1.8",
|
||||
"primer": "11.0.0",
|
||||
"primer-colors": "^1.0.1",
|
||||
"prism-github": "^1.1.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react": "16.6.1",
|
||||
"react-dom": "16.6.1",
|
||||
"react-measure": "^2.2.2",
|
||||
"refractor": "^2.6.2",
|
||||
"remark-emoji": "^2.0.2",
|
||||
"remark-images": "^0.16.1",
|
||||
"remark-parse": "^6.0.3",
|
||||
"remark-textr": "^3.0.3",
|
||||
"remark-toc": "^5.1.1",
|
||||
"styled-components": "^4.1.2",
|
||||
"title-case": "^2.1.1",
|
||||
"tree-model": "^1.0.7",
|
||||
"typographic-base": "^1.0.4",
|
||||
"unified": "^7.1.0",
|
||||
"unist-util-select": "^2.0.0",
|
||||
"unist-util-stringify-position": "^2.0.0",
|
||||
"unist-util-visit": "^1.4.0"
|
||||
}
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
import redirect from '../src/redirect'
|
||||
export default redirect('/css')
|
@ -1 +0,0 @@
|
||||
module.exports = require('eslint-plugin-github/prettier.config')
|
@ -5,7 +5,7 @@ import Router from 'next/router'
|
||||
* and client-side:
|
||||
*
|
||||
* ```js
|
||||
* import {redirect} from '../src/utils'
|
||||
* import {redirect} from '../docs/utils'
|
||||
* export default redirect('/some/path')
|
||||
* ```
|
||||
*/
|
22
lerna.json
@ -1,22 +0,0 @@
|
||||
{
|
||||
"lerna": "2.4.0",
|
||||
"version": "independent",
|
||||
"packages": [
|
||||
"docs",
|
||||
"modules/*",
|
||||
"tools/*"
|
||||
],
|
||||
"npmClientArgs": ["--no-package-lock"],
|
||||
"changelog": {
|
||||
"repo": "primer/primer",
|
||||
"labels": {
|
||||
"Tag: Breaking Change": ":boom: Breaking Change",
|
||||
"Tag: Enhancement": ":rocket: Enhancement",
|
||||
"Tag: Bug Fix": ":bug: Bug Fix",
|
||||
"Tag: Polish": ":nail_care: Polish",
|
||||
"Tag: Documentation": ":memo: Documentation",
|
||||
"Tag: Internal": ":house: Internal"
|
||||
},
|
||||
"cacheDir": ".changelog"
|
||||
}
|
||||
}
|
@ -2,15 +2,15 @@ const each = require('./each')
|
||||
|
||||
module.exports = function addSource(options = {}) {
|
||||
const {namespace = 'data'} = options
|
||||
for (const key of ['branch', 'repo']) {
|
||||
for (const key of ['branch', 'repository']) {
|
||||
if (!options[key]) {
|
||||
throw new Error(`addSource() plugin requires options.${key} (got ${JSON.stringify(options[key])})`)
|
||||
}
|
||||
}
|
||||
const {branch, repo} = options
|
||||
const {branch, repository} = options
|
||||
return each((file, source) => {
|
||||
if (file[namespace]) {
|
||||
file[namespace].source = `https://github.com/${repo}/tree/${branch}/modules/${source}`
|
||||
file[namespace].source = `${repository}/tree/${branch}/modules/${source}`
|
||||
}
|
||||
})
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
/* eslint-disable no-console */
|
||||
const sync = require('./sync')
|
||||
const cssLoaderConfig = require('@zeit/next-css/css-loader-config')
|
||||
const {CI, NODE_ENV, NOW_URL} = process.env
|
||||
const {NODE_ENV, NOW_URL} = process.env
|
||||
|
||||
module.exports = (nextConfig = {}) => {
|
||||
const {assetPrefix = NOW_URL || ''} = nextConfig
|
||||
@ -28,23 +27,7 @@ module.exports = (nextConfig = {}) => {
|
||||
|
||||
// only attempt to sync locally and in CI
|
||||
if (dev && !configured) {
|
||||
sync({watch: !CI})
|
||||
}
|
||||
|
||||
// in production, we don't need to compile Primer from SCSS; just inline
|
||||
// the CSS build!
|
||||
if (!dev) {
|
||||
config.resolve.alias['primer/index.scss$'] = require.resolve('primer/build/build.css')
|
||||
|
||||
const cssLoader = cssLoaderConfig(config, {
|
||||
dev,
|
||||
isServer
|
||||
})
|
||||
options.defaultLoaders.css = cssLoader
|
||||
config.module.rules.push({
|
||||
test: /\.css$/,
|
||||
loader: cssLoader
|
||||
})
|
||||
sync({watch: !NODE_ENV})
|
||||
}
|
||||
|
||||
config.module.rules.push({
|
@ -3,6 +3,7 @@ const filter = require('metalsmith-filter')
|
||||
const frontmatter = require('metalsmith-matters')
|
||||
const watch = require('metalsmith-watch')
|
||||
|
||||
const {repository} = require('../package.json')
|
||||
const addPackageMeta = require('./add-package-meta')
|
||||
const {extractPackages, writePackagesJSON} = require('./extract-packages-json')
|
||||
const addSource = require('./add-source')
|
||||
@ -23,14 +24,14 @@ module.exports = function sync(options = {}) {
|
||||
let files
|
||||
|
||||
const metal = Metalsmith(process.cwd())
|
||||
.source('../modules')
|
||||
.source('src')
|
||||
.destination('pages/css')
|
||||
.clean(false)
|
||||
.frontmatter(false)
|
||||
// ignore anything containing "node_modules" in its path
|
||||
.ignore(path => path.includes('node_modules'))
|
||||
// only match files that look like docs
|
||||
.use(filter(['*/README.md', '*/docs/*.md', '*/package.json']))
|
||||
.use(filter(['**/*.md']))
|
||||
.use(extractPackages())
|
||||
// convert <!-- %docs -->...<!-- %enddocs --> blocks into frontmatter
|
||||
.use(parseDocComments({log}))
|
||||
@ -43,7 +44,7 @@ module.exports = function sync(options = {}) {
|
||||
.use(
|
||||
addSource({
|
||||
branch: 'master',
|
||||
repo: 'primer/primer',
|
||||
repository,
|
||||
log
|
||||
})
|
||||
)
|
@ -1,96 +0,0 @@
|
||||
const {basename, join, resolve} = require('path')
|
||||
const PromiseQueue = require('p-queue')
|
||||
const execa = require('execa')
|
||||
const globby = require('globby')
|
||||
const rootDir = resolve(__dirname, '../..')
|
||||
const lernaConfig = require(join(rootDir, 'lerna.json'))
|
||||
const modulesDir = join(rootDir, 'modules')
|
||||
require('console.table')
|
||||
|
||||
const unique = list => Array.from(new Set(list)).sort()
|
||||
|
||||
const matchAll = (pattern, text) => {
|
||||
const matches = []
|
||||
let match
|
||||
while (match = pattern.exec(text)) {
|
||||
matches.push(match)
|
||||
}
|
||||
return matches
|
||||
}
|
||||
|
||||
const checks = {
|
||||
'has stories': (module, key) => {
|
||||
return globby(join(module.path, '**/stories.js'))
|
||||
.then(files => ({
|
||||
[key]: files.length > 0 ? 'yes' : 'no'
|
||||
}))
|
||||
},
|
||||
'docs test': (module, key) => {
|
||||
return execa(join(rootDir, 'script/test-docs'), {
|
||||
cwd: module.path
|
||||
})
|
||||
.then(result => ({[key]: 'pass'}))
|
||||
.catch(({stderr}) => {
|
||||
const pattern = /("\.[-\w]+") is not documented/g
|
||||
const matches = matchAll(pattern, stderr)
|
||||
.map(match => match[1])
|
||||
let missing = matches ? Array.from(matches) : []
|
||||
const max = 5
|
||||
if (missing.length > max) {
|
||||
const more = missing.length - max
|
||||
missing = missing.slice(0, max).concat(`and ${more} more...`)
|
||||
}
|
||||
return {
|
||||
[key]: 'FAIL',
|
||||
'missing docs': unique(missing).join(', ')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const args = process.argv.slice(2)
|
||||
|
||||
const modules = args.length
|
||||
? Promise.resolve(args)
|
||||
: globby(join(modulesDir, 'primer-*'))
|
||||
|
||||
modules
|
||||
.then(moduleDirs => {
|
||||
console.log('Found %d module directories', moduleDirs.length)
|
||||
return moduleDirs
|
||||
.map(path => ({
|
||||
path,
|
||||
name: basename(path),
|
||||
pkg: require(join(path, 'package.json'))
|
||||
}))
|
||||
.filter(({pkg}) => pkg.primer.module_type !== 'meta')
|
||||
})
|
||||
.then(modules => {
|
||||
console.log('Filtered to %d modules (excluding meta-packages)', modules.length)
|
||||
|
||||
const queue = new PromiseQueue({concurrency: 3})
|
||||
|
||||
for (const module of modules) {
|
||||
module.checks = {}
|
||||
for (const [name, check] of Object.entries(checks)) {
|
||||
queue.add(() => {
|
||||
// console.warn(`? check: ${module.name} ${name}`)
|
||||
return check(module, name)
|
||||
.then(result => {
|
||||
Object.assign(module.checks, result)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
console.warn(`Running ${queue.size} checks...`)
|
||||
return queue.onIdle().then(() => modules)
|
||||
})
|
||||
.then(modules => {
|
||||
console.warn('ran tests on %d modules', modules.length)
|
||||
const rows = modules.map(({name, checks}) => {
|
||||
return Object.assign({'package': name}, checks)
|
||||
})
|
||||
console.table(rows)
|
||||
})
|
||||
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "primer-scorecard",
|
||||
"scripts": {
|
||||
"test": "node index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"console.table": "^0.10.0",
|
||||
"execa": "^0.10.0",
|
||||
"globby": "^6.1.0",
|
||||
"p-queue": "^2.4.2"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
# Primer modules
|
||||
|
||||
Primer is monorepo composed of 23 packages which can be installed altogether or individually via npm. We group our packages into 3 meta-packages which you can install individually: [primer-core](primer-core), [primer-product](primer-product), and [primer-marketing](primer-marketing). Install [primer](primer) if you want to install all 23 packages.
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,3 +0,0 @@
|
||||
// support files
|
||||
@import "primer-support/index.scss";
|
||||
@import "./lib/flash.scss";
|
@ -1,48 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"name": "primer-alerts",
|
||||
"description": "Flash messages, or alerts, inform users of successful or pending actions.",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "build/build.css",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"primer": {
|
||||
"category": "product",
|
||||
"module_type": "components",
|
||||
"class_whitelist": [
|
||||
"warning"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-alerts",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"alerts",
|
||||
"callouts",
|
||||
"css",
|
||||
"flash",
|
||||
"github",
|
||||
"primer",
|
||||
"design-system",
|
||||
"style"
|
||||
]
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
|
||||
storiesOf('Flash alerts', module)
|
||||
.add('flash', () => (
|
||||
<div className='p-4'>
|
||||
<div className='flash'>
|
||||
flash
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('flash-warn', () => (
|
||||
<div className='p-4'>
|
||||
<div className='flash flash-warn'>
|
||||
flash-warn
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('flash-error', () => (
|
||||
<div className='p-4'>
|
||||
<div className='flash flash-error'>
|
||||
flash-error
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('flash-success', () => (
|
||||
<div className='p-4'>
|
||||
<div className='flash flash-success'>
|
||||
flash-success
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('flash with action button', () => (
|
||||
<div className='p-4'>
|
||||
<div className="flash">
|
||||
<button type="submit" className="btn btn-sm primary flash-action">Complete action</button>
|
||||
Flash message with action here.
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('flash-full', () => (
|
||||
<div className='p-4'>
|
||||
<div className="container-lg">
|
||||
<div className="flash flash-full">
|
||||
Full width flash message.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,7 +0,0 @@
|
||||
@import "primer-support/index.scss";
|
||||
|
||||
// Avatars
|
||||
@import "./lib/avatar.scss";
|
||||
@import "./lib/avatar-parent-child.scss";
|
||||
@import "./lib/avatar-stack.scss";
|
||||
@import "./lib/circle-badge.scss";
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"name": "primer-avatars",
|
||||
"description": "Basic styles for user profile avatars.",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "build/build.css",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"primer": {
|
||||
"category": "product",
|
||||
"module_type": "components"
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-avatars",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"avatars",
|
||||
"primer",
|
||||
"css",
|
||||
"github",
|
||||
"design-system"
|
||||
]
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
import storiesFromMarkdown from '../../.storybook/lib/storiesFromMarkdown'
|
||||
|
||||
const stories = storiesOf('Avatars', module)
|
||||
|
||||
storiesFromMarkdown(require.context('.', true, /\.md$/))
|
||||
.forEach(({title, story}) => {
|
||||
stories.add(title, story)
|
||||
})
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,5 +0,0 @@
|
||||
@import "primer-support/index.scss";
|
||||
|
||||
@import "./lib/normalize.scss";
|
||||
@import "./lib/base.scss";
|
||||
@import "./lib/typography-base.scss";
|
@ -1,48 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"name": "primer-base",
|
||||
"description": "CSS to reset the browsers default styles",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "build/build.css",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"primer": {
|
||||
"category": "core",
|
||||
"module_type": "support",
|
||||
"class_whitelist": [
|
||||
"octicon",
|
||||
"rule"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-base",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"primer",
|
||||
"css",
|
||||
"github",
|
||||
"design-system",
|
||||
"base",
|
||||
"reset",
|
||||
"normalize"
|
||||
]
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
|
||||
storiesOf('Base', module)
|
||||
.add('button', () => (
|
||||
<button>Button</button>
|
||||
))
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,3 +0,0 @@
|
||||
@import "primer-support/index.scss";
|
||||
|
||||
@import "./lib/blankslate.scss";
|
@ -1,44 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"name": "primer-blankslate",
|
||||
"description": "Blankslates are for when there is a lack of content within a page or section.",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "build/build.css",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"primer": {
|
||||
"category": "product",
|
||||
"module_type": "components"
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-blankslate",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"primer",
|
||||
"css",
|
||||
"github",
|
||||
"design-system",
|
||||
"blankslate",
|
||||
"empty",
|
||||
"content"
|
||||
]
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
|
||||
storiesOf('Blankslate', module)
|
||||
.add('blankslate', () => (
|
||||
<div className='blankslate'>
|
||||
<h3>This is a blank slate</h3>
|
||||
<p>Use it to provide information when no dynamic content exists.</p>
|
||||
</div>
|
||||
))
|
||||
.add('blankslate-narrow', () => (
|
||||
<div className='blankslate blankslate-narrow'>
|
||||
<h3>This is a blank slate</h3>
|
||||
<p>Use it to provide information when no dynamic content exists.</p>
|
||||
</div>
|
||||
))
|
||||
.add('blankslate-large', () => (
|
||||
<div className='blankslate blankslate-large'>
|
||||
<h3>This is a blank slate</h3>
|
||||
<p>Use it to provide information when no dynamic content exists.</p>
|
||||
</div>
|
||||
))
|
||||
.add('blankslate-spacious', () => (
|
||||
<div className='blankslate blankslate-spacious'>
|
||||
<h3>This is a blank slate</h3>
|
||||
<p>Use it to provide information when no dynamic content exists.</p>
|
||||
</div>
|
||||
))
|
||||
.add('blankslate-capped', () => (
|
||||
<div className='blankslate blankslate-capped'>
|
||||
<h3>This is a blank slate</h3>
|
||||
<p>Use it to provide information when no dynamic content exists.</p>
|
||||
</div>
|
||||
))
|
||||
.add('blankslate-clean-background', () => (
|
||||
<div className='blankslate blankslate-clean-background'>
|
||||
<h3>This is a blank slate</h3>
|
||||
<p>Use it to provide information when no dynamic content exists.</p>
|
||||
</div>
|
||||
))
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,2 +0,0 @@
|
||||
@import "primer-support/index.scss";
|
||||
@import "./lib/box.scss";
|
@ -1,41 +0,0 @@
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"name": "primer-box",
|
||||
"description": "A module for creating rounded-corner boxes with options for headers, lists, and footers.",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "build/build.css",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"primer": {
|
||||
"category": "core",
|
||||
"module_type": "components"
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-box",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"primer",
|
||||
"css",
|
||||
"github",
|
||||
"design-system"
|
||||
]
|
||||
}
|
@ -1,213 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
|
||||
storiesOf('Box', module)
|
||||
.add('Box', () => (
|
||||
<div className='Box'>
|
||||
Box
|
||||
</div>
|
||||
))
|
||||
.add('Box elements', () => (
|
||||
<div className='Box'>
|
||||
<div className='Box-header'>
|
||||
<h3 className='Box-title'>
|
||||
Box-title
|
||||
</h3>
|
||||
</div>
|
||||
<div className='Box-body'>
|
||||
Box-body
|
||||
</div>
|
||||
<div className='Box-footer'>
|
||||
Box-footer
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box-row', () => (
|
||||
<div className='Box'>
|
||||
<ul>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
))
|
||||
.add('Box--condensed', () => (
|
||||
<div className='Box Box--condensed'>
|
||||
<div className='Box-header'>
|
||||
<h3 className='Box-title'>
|
||||
Box-title
|
||||
</h3>
|
||||
</div>
|
||||
<div className='Box-body'>
|
||||
Box-body
|
||||
</div>
|
||||
<ul>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
</ul>
|
||||
<div className='Box-footer'>
|
||||
Box-footer
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box--spacious', () => (
|
||||
<div className='Box Box--spacious'>
|
||||
<div className='Box-header'>
|
||||
<h3 className='Box-title'>
|
||||
Box-title
|
||||
</h3>
|
||||
</div>
|
||||
<div className='Box-body'>
|
||||
Box-body
|
||||
</div>
|
||||
<ul>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
</ul>
|
||||
<div className='Box-footer'>
|
||||
Box-footer
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box--blue', () => (
|
||||
<div className='Box Box--blue'>
|
||||
<div className='Box-header'>
|
||||
<h3 className='Box-title'>
|
||||
Box-title
|
||||
</h3>
|
||||
</div>
|
||||
<div className='Box-body'>
|
||||
Box-body
|
||||
</div>
|
||||
<ul>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
<li className='Box-row'>
|
||||
Box-row
|
||||
</li>
|
||||
</ul>
|
||||
<div className='Box-footer'>
|
||||
Box-footer
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box-header--blue', () => (
|
||||
<div className='Box'>
|
||||
<div className='Box-header Box-header--blue'>
|
||||
<h3 className='Box-title'>Box-title</h3>
|
||||
</div>
|
||||
<div className='Box-body'>
|
||||
Box-body
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box--danger', () => (
|
||||
<div className='Box Box--danger'>
|
||||
<div className='Box-row'>
|
||||
Row one
|
||||
</div>
|
||||
<div className='Box-row'>
|
||||
Row two
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box-row themes', () => (
|
||||
<div>
|
||||
<div className='Box mb-4'>
|
||||
<div className='Box-row Box-row--gray'>
|
||||
.Box-row--gray
|
||||
</div>
|
||||
<div className='Box-row Box-row--hover-gray'>
|
||||
.Box-row--hover-gray
|
||||
</div>
|
||||
<div className='Box-row Box-row--yellow'>
|
||||
.Box-row--yellow
|
||||
</div>
|
||||
<div className='Box-row Box-row--hover-blue'>
|
||||
.Box-row--hover-blue
|
||||
</div>
|
||||
<div className='Box-row Box-row--blue'>
|
||||
.Box-row--blue
|
||||
</div>
|
||||
</div>
|
||||
<div className='Box'>
|
||||
<div className='Box-row Box-row--focus-gray navigation-focus'>
|
||||
.Box-row--focus-gray and .navigation-focus
|
||||
</div>
|
||||
<div className='Box-row Box-row--focus-gray'>
|
||||
.Box-row--focus-gray
|
||||
</div>
|
||||
<div className='Box-row Box-row--focus-blue navigation-focus'>
|
||||
.Box-row--focus-blue and .navigation-focus
|
||||
</div>
|
||||
<div className='Box-row Box-row--focus-blue'>
|
||||
.Box-row--focus-blue
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box-row--unread', () => (
|
||||
<div className='Box'>
|
||||
<div className='Box-row'>
|
||||
Box row
|
||||
</div>
|
||||
<div className='Box-row Box-row--unread'>
|
||||
Box row unread
|
||||
</div>
|
||||
<div className='Box-row'>
|
||||
Box row
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box-row-link', () => (
|
||||
<div className='Box'>
|
||||
<div className='Box-row'>
|
||||
<a className='Box-row-link' href='#url'>Box row link</a>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add('Box border-dashed', () => (
|
||||
<div className='Box border-dashed p-2'>
|
||||
Box border-dashed
|
||||
</div>
|
||||
))
|
||||
.add('Box with flash-full', () => (
|
||||
<div className='Box'>
|
||||
<div className='Box-header'>
|
||||
Box-header
|
||||
</div>
|
||||
<div className='flash flash-full'>
|
||||
flash-full
|
||||
</div>
|
||||
<div className='flash flash-full flash-success'>
|
||||
flash-full flash-success
|
||||
</div>
|
||||
<div className='flash flash-full flash-warn'>
|
||||
flash-full flash-warn
|
||||
</div>
|
||||
<div className='flash flash-full flash-error'>
|
||||
flash-full flash-error
|
||||
</div>
|
||||
<div className='Box-body'>
|
||||
Box-body
|
||||
</div>
|
||||
</div>
|
||||
))
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,3 +0,0 @@
|
||||
// support files
|
||||
@import "primer-support/index.scss";
|
||||
@import "./lib/branch-name.scss";
|
@ -1,41 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"name": "primer-branch-name",
|
||||
"description": "A nice, consistent way to display branch names.",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"primer": {
|
||||
"category": "product",
|
||||
"module_type": "components"
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "index.scss",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-branch-name",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"test-docs": "../../script/test-docs",
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint test-docs",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"github",
|
||||
"primer",
|
||||
"design-system"
|
||||
]
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
import storiesFromMarkdown from '../../.storybook/lib/storiesFromMarkdown'
|
||||
|
||||
const stories = storiesOf('Branch Name', module)
|
||||
|
||||
storiesFromMarkdown(require.context('.', true, /\.md$/))
|
||||
.forEach(({title, story}) => {
|
||||
stories.add(title, story)
|
||||
})
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|
@ -1,3 +0,0 @@
|
||||
// support files
|
||||
@import "primer-support/index.scss";
|
||||
@import "./lib/breadcrumb.scss";
|
@ -1,45 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"name": "primer-breadcrumb",
|
||||
"description": "Breadcrumb navigation for pages with parents / grandparents.",
|
||||
"homepage": "http://primer.github.io/",
|
||||
"author": "GitHub, Inc.",
|
||||
"license": "MIT",
|
||||
"style": "build/build.css",
|
||||
"sass": "index.scss",
|
||||
"main": "build/index.js",
|
||||
"primer": {
|
||||
"category": "core",
|
||||
"module_type": "components"
|
||||
},
|
||||
"files": [
|
||||
"index.scss",
|
||||
"lib",
|
||||
"build"
|
||||
],
|
||||
"repository": "https://github.com/primer/primer/tree/master/modules/primer-breadcrumb",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primer/primer/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"test-docs": "../../script/test-docs",
|
||||
"build": "../../script/npm-run primer-module-build index.scss",
|
||||
"prepare": "npm run build",
|
||||
"lint": "../../script/lint-scss",
|
||||
"test": "../../script/npm-run-all build lint test-docs",
|
||||
"prepublishOnly": "../../script/notify pending",
|
||||
"postpublish": "../../script/notify success"
|
||||
},
|
||||
"dependencies": {
|
||||
"primer-support": "5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"breadcrumb",
|
||||
"css",
|
||||
"github",
|
||||
"navigation",
|
||||
"primer",
|
||||
"design-system",
|
||||
"style"
|
||||
]
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import React from 'react'
|
||||
import { storiesOf } from '@storybook/react'
|
||||
import storiesFromMarkdown from '../../.storybook/lib/storiesFromMarkdown'
|
||||
|
||||
const stories = storiesOf('Breadcrumb', module)
|
||||
|
||||
storiesFromMarkdown(require.context('.', true, /\.md$/))
|
||||
.forEach(({title, story}) => {
|
||||
stories.add(title, story)
|
||||
})
|
@ -1,2 +0,0 @@
|
||||
*.yml
|
||||
.github
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 GitHub 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.
|