diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b417cf5fc7..490070ea38 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,7 +2,7 @@ [fork]: https://github.com/github/primer/fork [pr]: https://github.com/github/primer/compare -[style]: http://primercss.io/guidelines/ +[style]: http://primer.github.io/guidelines/ Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. @@ -59,16 +59,16 @@ Good pull requests—patches, improvements, new features—are a fantastic help. ### Updating Primer modules -Anyone can open a pull request on Primer CSS. You do not need to work at GitHub or be a member of the org to open a pull request. +Anyone can open a pull request on Primer. You do not need to work at GitHub or be a member of the org to open a pull request. -1. Fork and clone [this repository](https://github.com/primer/primer-css). +1. Fork and clone [this repository](https://github.com/primer/primer). 2. Configure and install the dependencies: `npm install` 3. Check out the dev branch `git checkout dev` 3. Create a new branch from dev `git checkout -b my-branch-name` 4. Make your changes and commit them. 5. Push your branch and open a pull request against `dev`. Add a comment describing your proposed changes and request a review from `@primer/ds-core`. 6. Wait for CI tests to finish. - - If the tests pass, you should see a status check telling you which alpha version of primer-css you can install with npm to test your work in other projects. + - If the tests pass, you should see a status check telling you which alpha version of primer you can install with npm to test your work in other projects. - If the tests fail, review the logs and address any issues. - If the builds fail for any other reason (as they occasionally do), they may need to be manually restarted. 7. When CI tests pass, a new npm alpha release will be posted under the CI checks, you can use this npm version for testing in your project or with a GitHub site if you are staff. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 97f6af521b..42f3183180 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,8 @@ -↖ First, change the base branch from "master" to "dev". +- [ ] First, change the base branch from "master" to "dev". -↑ Next, briefly describe your proposal in the title. +- [ ] Next, briefly describe your proposal in the title. + +- [ ] Fixes: # (type an issue number after the # if applicable) Finally, tell us more about the change here, in the description. diff --git a/.gitignore b/.gitignore index ea987384e6..c92f6eba03 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .DS_Store .sass-cache node_modules +**/package-lock.json *.log build _site *.lerna_backup +.changelog diff --git a/.storybook/.babelrc b/.storybook/.babelrc new file mode 100644 index 0000000000..e9b13211c5 --- /dev/null +++ b/.storybook/.babelrc @@ -0,0 +1,7 @@ +{ + "presets": [ + "env", + "react", + "minify" + ] +} diff --git a/.storybook/Octicon.js b/.storybook/Octicon.js new file mode 100644 index 0000000000..339c56b1cd --- /dev/null +++ b/.storybook/Octicon.js @@ -0,0 +1,27 @@ +import React from 'react' +import {storiesOf} from '@storybook/react' +import octicons from 'octicons' + +export const Octicon = (props) => { + const {name} = props + if (name in octicons) { + const svg = octicons[name].toSVG(props) + return + } else { + throw new Error(`No such octicon: "${name}"!`) + } +} + +const story = storiesOf('Octicons', module) + +Object.keys(octicons).forEach(name => { + story.add(name, () => { + return ( +
+ + + +
+ ) + }) +}) diff --git a/.storybook/addons.js b/.storybook/addons.js new file mode 100644 index 0000000000..e6a2cf891d --- /dev/null +++ b/.storybook/addons.js @@ -0,0 +1 @@ +import '@storybook/addon-options/register' diff --git a/.storybook/config.js b/.storybook/config.js new file mode 100644 index 0000000000..c0195d32c9 --- /dev/null +++ b/.storybook/config.js @@ -0,0 +1,28 @@ +import React from 'react' +import { configure, addDecorator } from '@storybook/react' +import { setOptions } from '@storybook/addon-options' +import '../modules/primer/index.scss' + +setOptions({ + name: 'Primer', + url: 'http://primer.github.io/', + showDownPanel: false, +}) + +addDecorator(story => ( +
+ {story()} +
+)) + +const contexts = [ + require.context('../modules', true, /stories.*\.js$/), +] + +configure(() => { + contexts.forEach(context => { + context.keys() + .filter(key => !key.includes('node_modules')) + .forEach(context) + }) +}, module) diff --git a/.storybook/lib/storiesFromMarkdown.js b/.storybook/lib/storiesFromMarkdown.js new file mode 100644 index 0000000000..72348f2f1f --- /dev/null +++ b/.storybook/lib/storiesFromMarkdown.js @@ -0,0 +1,57 @@ +import remark from 'remark' +import parents from 'unist-util-parents' +import select from 'unist-util-select' +import findBefore from 'unist-util-find-before' +import htmlToReact from 'html-to-react' +import parsePairs from 'parse-pairs' +import React from 'react' +import ReactDOMServer from 'react-dom/server' +import {Octicon} from '../Octicon' + +const htmlParser = new htmlToReact.Parser() + +const railsOcticonToReact = (html) => { + // <%= octicon "tools" %> to + const octre = /<%= octicon ["']([a-z\-]+)["'][^%]*%>/gi + html = html.replace(octre, (match, name) => { + return ReactDOMServer.renderToStaticMarkup() + }) + return html +} + +const nodeToStory = (node, file) => { + const html = railsOcticonToReact(node.value) + const element = htmlParser.parse(html) + const pairs = node.lang.replace(/^html\s*/, '') + const attrs = pairs.length ? parsePairs(pairs) : {} + const title = attrs.title || getPreviousHeading(node) || + `story @ ${file}:${node.position.start.line}` + return { + title, + story: () => element, + attrs, + html, + file, + node, + } +} + +const getPreviousHeading = node => { + const heading = findBefore(node.parent, node, 'heading') + return (heading && !heading.used) + ? (heading.used = true, heading.children.map(c => c.value).join('')) + : undefined +} + +export default req => { + return req.keys().reduce((stories, file) => { + const content = req(file) + const ast = parents(remark.parse(content)) + const path = file.replace(/^\.\//, '') + return stories.concat( + select(ast, 'code[lang^=html]') + .map(node => nodeToStory(node, path)) + .filter(({attrs}) => attrs.story !== "false") + ) + }, []) +} diff --git a/.storybook/postcss.config.js b/.storybook/postcss.config.js new file mode 100644 index 0000000000..79cf025af8 --- /dev/null +++ b/.storybook/postcss.config.js @@ -0,0 +1,8 @@ +// FIXME this should go away when we merge and release: +// +const plugins = require("primer-module-build/lib/.postcss.json") +delete plugins.use + +module.exports = { + plugins, +} diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html new file mode 100644 index 0000000000..de95a89c1b --- /dev/null +++ b/.storybook/preview-head.html @@ -0,0 +1,2 @@ + + diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js new file mode 100644 index 0000000000..59c421d1d3 --- /dev/null +++ b/.storybook/webpack.config.js @@ -0,0 +1,44 @@ +const path = require("path"); + +const modulesPath = path.resolve(__dirname, "../modules") + +module.exports = (config, env) => { + + if (env === 'PRODUCTION') { + config.plugins = config.plugins + .filter(plugin => plugin.constructor.name !== 'UglifyJsPlugin') + } + + config.module.rules.push( + { + test: /\.md$/, + use: "raw-loader", + }, + { + test: /\.scss$/, + loaders: [ + "style-loader", + "css-loader", + { + loader: "postcss-loader", + options: { + config: { + path: require.resolve("./postcss.config.js"), + }, + }, + }, + { + loader: "sass-loader", + options: { + includePaths: [ + modulesPath, + ], + } + }, + ], + include: modulesPath, + } + ) + + return config +} diff --git a/.travis.yml b/.travis.yml index b0d72d9175..70254112bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,8 @@ env: - secure: "EZewKKWQXmtCwPtYrPZq4OQblv2OyXR61qBIl3pOxGNVG2BCjD6VOgSaiYqkA9Qbt+ihfwQkiiLvTB68gbvRSiBFV9i+XLzKzt4S8CDI5RhTLAxZB3eQFVZRYzldchzWI4sdNhTvYS1kYXmsXQZD6vJmPSnFvOI/ddfzqvnNL4M=" # github - secure: "J+1oWjvvXjyrwkY/4IFWKdN/weFmQcPwlRuFG4R0Gb3rYe4nqtC9l68sJvmS8asc8dQMhOhcUZCH6sjvo7l2WD4NuK4umPSbs+rJNUsfbvH4pZjStQIj/3ll1OfQelGDWAYQWhIfciYY4F3Bp0ZWTfKOppLQ2AVIYu1fPVXDdlo=" - -before_script: - - lerna bootstrap + # github changelog + - secure: "KcGydAqL7ryDh2rTJJB4wU8NE5BRtnrRXDEcPBScSscO3zFsHXHBDvvO04B/9hFVatXzGYXmkn+FZ0P9QikhvebzdwwyqUG2SKFiHhMvbX0m0WtAhn5NqDuKU1r5qy5YQ18r/tiLfC9GSAlEpfLAH58pwpcn8srV3Mn/yKvlrfs=" script: - npm test @@ -18,8 +17,8 @@ script: after_success: # 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-css for publishing - - cp CHANGELOG.md modules/primer-css + # copy the CHANGELOG.md primer for publishing + - cp CHANGELOG.md modules/primer - script/after_success deploy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c763d7c0..f3328adbb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,103 @@ +## 10.1.0 (2017-11-15) + +#### :rocket: Enhancement +* [#385](https://github.com/primer/primer/pull/385) New Avatar stack. ([@califa](https://github.com/califa) & [@sophshep](https://github.com/sophshep)) +* [#404](https://github.com/primer/primer/pull/404) Tooltip component updates ([@broccolini](https://github.com/broccolini)) + +#### :memo: Documentation +* [#405](https://github.com/primer/primer/pull/405) Add deprecation warning for `.avatar-stack`. ([@jonrohan](https://github.com/jonrohan)) +* [#391](https://github.com/primer/primer/pull/391) Update shields.io url to https. ([@NuttasitBoonwat](https://github.com/NuttasitBoonwat)) + +#### Committers: 5 +- Diana Mounter ([broccolini](https://github.com/broccolini)) +- Joel Califa ([califa](https://github.com/califa)) +- Jon Rohan ([jonrohan](https://github.com/jonrohan)) +- Sophie Shepherd ([sophshep](https://github.com/sophshep)) +- [NuttasitBoonwat](https://github.com/NuttasitBoonwat) + +# 10.0.1 (2017-11-14) + +#### :bug: Bug Fix + +* Fixing `peerDependencies` to be greater than equal to versions. Fixing version mismatch with buttons and box. + +# 10.0.0 (2017-11-13) + +#### :boom: Breaking Change +* [#395](https://github.com/primer/primer/pull/395) Renaming primer-css to primer. ([@jonrohan](https://github.com/jonrohan)) +* [#379](https://github.com/primer/primer/pull/379) Deprecating primer-cards and form-cards. ([@jonrohan](https://github.com/jonrohan)) +* [#336](https://github.com/primer/primer/pull/336) Move `primer-breadcrumbs` from marketing to core ([@jonrohan]((https://github.com/jonrohan)) + +#### :rocket: Enhancement +* [#371](https://github.com/primer/primer/pull/371) Add .details-reset. ([@muan](https://github.com/muan)) +* [#375](https://github.com/primer/primer/pull/375) New utilities & docs - fade out, hover grow, border white fade, responsive positioning, and circle. ([@sophshep](https://github.com/sophshep)) +* [#383](https://github.com/primer/primer/pull/383) Add 'Popover' component. ([@brandonrosage](https://github.com/brandonrosage)) +* [#377](https://github.com/primer/primer/pull/377) Refactor and add underline nav component. ([@ampinsk](https://github.com/ampinsk)) +* [#337](https://github.com/primer/primer/pull/337) Add marketing buttons to primer-marketing. ([@gladwearefriends](https://github.com/gladwearefriends)) +* [#342](https://github.com/primer/primer/pull/342) Add Subhead component. ([@shawnbot](https://github.com/shawnbot)) +* [#341](https://github.com/primer/primer/pull/341) Add branch-name component from github/github. ([@shawnbot](https://github.com/shawnbot)) + +#### :bug: Bug Fix +* [#360](https://github.com/primer/primer/pull/360) Remove ::before ::after padding hack on markdown. ([@jonrohan](https://github.com/jonrohan)) +* [#320](https://github.com/primer/primer/pull/320) Remove -webkit-text-decoration-skip override. ([@antons](https://github.com/antons)) +* [#359](https://github.com/primer/primer/pull/359) Change markdown li break to handle Safari 10.x user stylesheet bug. ([@feministy](https://github.com/feministy)) +* [#388](https://github.com/primer/primer/pull/388) Button border-radius fix to override Chroma 62. ([@broccolini](https://github.com/broccolini)) +* [#307](https://github.com/primer/primer/pull/307) Do not suppress opacity transition for tooltipped-no-delay. ([@astorije](https://github.com/astorije)) + +#### :house: Internal +* [#396](https://github.com/primer/primer/pull/396) Use lerna-changelog to generate a changelog. ([@jonrohan](https://github.com/jonrohan)) +* [#382](https://github.com/primer/primer/pull/382) Update Button docs. ([@JasonEtco](https://github.com/JasonEtco)) +* [#390](https://github.com/primer/primer/pull/390) Updating `storiesFromMarkdown` to read in rails Octicons helper and replace with react component. ([@jonrohan](https://github.com/jonrohan)) +* [#389](https://github.com/primer/primer/pull/389) Publish alpha release any time we're not on a release branch or master. ([@jonrohan](https://github.com/jonrohan)) +* [#384](https://github.com/primer/primer/pull/384) Add test to check for the current year in the license and source. ([@jonrohan](https://github.com/jonrohan)) +* [#374](https://github.com/primer/primer/pull/374) Improve Pull Request template. ([@agisilaos](https://github.com/agisilaos)) + +#### Committers: 13 +- Agisilaos Tsaraboulidis ([agisilaos](https://github.com/agisilaos)) +- Amanda Pinsker ([ampinsk](https://github.com/ampinsk)) +- Anton Sotkov ([antons](https://github.com/antons)) +- Brandon Rosage ([brandonrosage](https://github.com/brandonrosage)) +- Catherine Bui ([gladwearefriends](https://github.com/gladwearefriends)) +- Diana Mounter ([broccolini](https://github.com/broccolini)) +- Jason Etcovitch ([JasonEtco](https://github.com/JasonEtco)) +- Jon Rohan ([jonrohan](https://github.com/jonrohan)) +- Jérémie Astori ([astorije](https://github.com/astorije)) +- Mu-An ✌️ Chiou ([muan](https://github.com/muan)) +- Shawn Allen ([shawnbot](https://github.com/shawnbot)) +- Sophie Shepherd ([sophshep](https://github.com/sophshep)) +- liz abinante! ([feministy](https://github.com/feministy)) + +**Special thanks to @shaharke for transferring ownership of the Primer npm package to us so that we could make the rename happen!** :heart: + +# 9.6.0 + +### Added +- Storybook. We've added a storybook prototyping environment for testing components in seclusion. To start the server run `npm start` +- Adding yeoman generator for creating a primer module. `generator-primer-module` +- Importing `stylelint-config-primer` from https://github.com/primer/stylelint-config-primer/ into monorepo. +- Importing `stylelint-selector-no-utility` from https://github.com/primer/stylelint-selector-no-utility into monorepo. + +### Changes +- Deployment and publishing scripts refinements. + +# 9.5.0 + +### Added +- It's now possible to style `` elements as buttons and have them appear in the active/selected state when the enclosing [`
` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) is open. #346 + +### Changes +- Updates our release candidate versioning logic so that prerelease increments are done on a per-module basis, fixing #350. + +# 9.4.0 + +### Added +- Add `v-align-baseline` class to `primer-utilities` #324 +- Add deprecation warnings for `primer-cards` and `primer-forms/lib/form-validation.scss` #347 (these will be removed in v10.0.0) + +### Changes +- Update npm metadata for `primer`, `primer-core`, `primer-product`, and `primer-marketing` #328 +- Remove `HEAD` heading from the changelog #327 + # 9.3.0 ## Added @@ -7,7 +107,7 @@ ## Changes - Removes `docs` from `gitignore` - Removes the `^` from all dependencies so that we can publish exact versions -- Consolidates release notes from various sources into one changelog located in `/modules/primer-css/CHANGELOG.md` +- Consolidates release notes from various sources into one changelog located in `/modules/primer/CHANGELOG.md` # 9.2.0 @@ -18,7 +118,7 @@ ## Changes - Remove per-module configurations (`.gitignore`, `.postcss.json`, `.stylelintrc.json`) and `CHANGELOG.md` files in #284 -- Replace most static `font-size`, `font-weight`, and `line-height` CSS property values with their [SCSS variable equivalents](https://github.com/primer/primer-css/blob/c9ea37316fbb73c4d9931c52b42bc197260c0bf6/modules/primer-support/lib/variables/typography.scss#L12-L33) in #252 +- Replace most static `font-size`, `font-weight`, and `line-height` CSS property values with their [SCSS variable equivalents](https://github.com/primer/primer/blob/c9ea37316fbb73c4d9931c52b42bc197260c0bf6/modules/primer-support/lib/variables/typography.scss#L12-L33) in #252 - Refactor CI scripts to use Travis conditional deployment for release candidate and final release publish steps in #290 # 9.1.1 @@ -65,7 +165,7 @@ This release also includes major improvements to our Travis build scripts to aut We discovered that `primer-core` specified and outdated version of `primer-base` in it's dependencies. The outdated version did not have `normalize.scss` included which could cause some issues. This has issue occurred during v7.0.0 when creating the new monorepo. Also fixes repo urls in `package.json` for individual packages. -See PR [#243](https://github.com/primer/primer-css/pull/243) +See PR [#243](https://github.com/primer/primer/pull/243) ## Changes @@ -110,7 +210,7 @@ See PR [#243](https://github.com/primer/primer-css/pull/243) # 8.0.0 - Imports -Fixes issues with the ordering of imports in each of our meta-packages. See PR [#239](https://github.com/primer/primer-css/pull/239) +Fixes issues with the ordering of imports in each of our meta-packages. See PR [#239](https://github.com/primer/primer/pull/239) ## Changes @@ -126,7 +226,7 @@ Fixes issues with the ordering of imports in each of our meta-packages. See PR [ # 7.0.0 - Monorepo -In an effort to improve our publishing workflow we turned Primer CSS into a monorepo, made this repo the source of truth for Primer by removing Primer modules from GitHub, and setup Lerna for managing multiple packages and maintaining independent versioning for all our modules. +In an effort to improve our publishing workflow we turned Primer into a monorepo, made this repo the source of truth for Primer by removing Primer modules from GitHub, and setup Lerna for managing multiple packages and maintaining independent versioning for all our modules. This is exciting because: @@ -135,7 +235,7 @@ This is exciting because: - we no longer have files like package.json, scripts, and readme's in the GitHub app that don't really belong there - **we can accept pull requests from external contributors** again! -See PR for more details on this change: https://github.com/primer/primer-css/pull/230 +See PR for more details on this change: https://github.com/primer/primer/pull/230 ## Other changes: diff --git a/LICENSE b/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/README.md b/README.md index eaae719dea..5b07f7be6d 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@ -# Primer CSS +# Primer -[![npm version](http://img.shields.io/npm/v/primer-css.svg)](https://www.npmjs.org/package/primer-css) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/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 CSS framework that powers GitHub's front-end design. Primer CSS 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. +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 CSS repo is managed as a monorepo that is composed of many npm packages. +The Primer repo is managed as a monorepo that is composed of many npm packages. ### Core Packages | Package | Version | |---|---| -| **[primer-css](/modules/primer-css)**
Includes all 23 packages | [![npm](http://img.shields.io/npm/v/primer-css.svg)](https://www.npmjs.com/package/primer-css) | -| [primer-core](/modules/primer-core) | [![npm](http://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.com/package/primer-core) | -| [primer-product](/modules/primer-product) | [![npm](http://img.shields.io/npm/v/primer-product.svg)](https://www.npmjs.com/package/primer-product) | -| [primer-marketing](/modules/primer-marketing) | [![npm](http://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.com/package/primer-marketing) | +| **[primer](/modules/primer)**
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) | ## Install -This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-css` with this command. +This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer` with this command. ```sh -$ npm install --save primer-css +$ npm install --save primer ``` ## Usage @@ -31,7 +31,7 @@ $ npm install --save primer-css 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: ```scss -@import "primer-css/index.scss"; +@import "primer/index.scss"; ``` You can import individual Primer modules by installing them with npm, for instance: @@ -46,10 +46,10 @@ Then, you would import the module with: @import "primer-navigation/index.scss"; ``` -Or, while you're figuring out which modules you need, you can import them directly from the `primer-css` [`packages` directory](./packages) like so: +Or, while you're figuring out which modules you need, you can import them directly from the `primer` [`packages` directory](./packages) like so: ```scss -@import "primer-css/modules/primer-navigation/index.css"; +@import "primer/modules/primer-navigation/index.css"; ``` @@ -70,7 +70,7 @@ You can read more about primer in the [docs][docs]. [MIT](./LICENSE) © [GitHub](https://github.com/) [primer]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/lerna.json b/lerna.json index acba993dd9..c0e596e607 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,20 @@ { - "lerna": "2.0.0-rc.5", + "lerna": "2.4.0", "packages": [ - "modules/*" + "modules/*", + "tools/*" ], + "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" + }, "version": "independent" } diff --git a/modules/README.md b/modules/README.md index 4b22c24608..fb2ad7f799 100644 --- a/modules/README.md +++ b/modules/README.md @@ -1,3 +1,3 @@ # Primer modules -Primer CSS 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-css](primer-css) if you want to install all 23 packages. +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. diff --git a/modules/primer-alerts/LICENSE b/modules/primer-alerts/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-alerts/LICENSE +++ b/modules/primer-alerts/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-alerts/README.md b/modules/primer-alerts/README.md index a2688aa800..3f0b9a6d38 100644 --- a/modules/primer-alerts/README.md +++ b/modules/primer-alerts/README.md @@ -1,11 +1,11 @@ -# Primer CSS Alerts +# Primer Alerts -[![npm version](http://img.shields.io/npm/v/primer-alerts.svg)](https://www.npmjs.org/package/primer-alerts) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-alerts.svg)](https://www.npmjs.org/package/primer-alerts) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -144,8 +144,8 @@ A flash message that is full width and removes border and border radius. [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-alerts/package.json b/modules/primer-alerts/package.json index d7a08c8fd2..88eb955ffb 100644 --- a/modules/primer-alerts/package.json +++ b/modules/primer-alerts/package.json @@ -1,8 +1,8 @@ { - "version": "1.4.0", + "version": "1.5.3", "name": "primer-alerts", "description": "Flash messages, or alerts, inform users of successful or pending actions.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,18 +16,18 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-alerts", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-alerts", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "alerts", @@ -36,7 +36,7 @@ "flash", "github", "primer", - "primercss", + "design-system", "style" ] } diff --git a/modules/primer-alerts/stories/Flash.js b/modules/primer-alerts/stories/Flash.js new file mode 100644 index 0000000000..ebada81739 --- /dev/null +++ b/modules/primer-alerts/stories/Flash.js @@ -0,0 +1,49 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Flash alerts', module) +.add('flash', () => ( +
+
+ flash +
+
+)) +.add('flash-warn', () => ( +
+
+ flash-warn +
+
+)) +.add('flash-error', () => ( +
+
+ flash-error +
+
+)) +.add('flash-success', () => ( +
+
+ flash-success +
+
+)) +.add('flash with action button', () => ( +
+
+ + Flash message with action here. +
+
+)) +.add('flash-full', () => ( +
+
+
+ Full width flash message. +
+
+
+)) diff --git a/modules/primer-avatars/LICENSE b/modules/primer-avatars/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-avatars/LICENSE +++ b/modules/primer-avatars/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-avatars/README.md b/modules/primer-avatars/README.md index d818dbcac5..cfda4f495c 100644 --- a/modules/primer-avatars/README.md +++ b/modules/primer-avatars/README.md @@ -1,11 +1,11 @@ -# Primer CSS Avatars +# Primer Avatars -[![npm version](http://img.shields.io/npm/v/primer-avatars.svg)](https://www.npmjs.org/package/primer-avatars) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-avatars.svg)](https://www.npmjs.org/package/primer-avatars) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Avatars are images that users can set as their profile picture. On GitHub, they’re always going to be rounded squares. They can be custom photos, uploaded by users, or generated as Identicons as a placeholder. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -75,14 +75,62 @@ When you need a larger parent avatar, and a smaller child one, overlaid slightly ### Avatar stack -Stacked avatars can be used to show who is participating in thread when there is limited space available. When you hover over the stack, the avatars will reveal themselves. Optimally, you should put no more than 3 avatars in the stack. +Stacked avatars can be used to show multiple collaborators or participants when there is limited space available. When you hover over the stack, the avatars will reveal themselves. ```html - - @jonrohan - @aaronshekey - @josh - +
+
+ @octocat + @octocat + @octocat +
+
+``` + +Based on the number of avatars in the stack, add these modifier classes: +- `AvatarStack--two` for 2 avatars. +- `AvatarStack--three-plus` for 3 or more avatars. + +If you have more than three avatars, add a div with the classes `avatar avatar-more` as the third avatar in the stack, as such: + +```html +
+
+ @octocat + @octocat +
+ @octocat + @octocat + @octocat +
+
+``` + +You can also link individual avatars. To do this shift the `avatar` class over to the anchor: + +```html +
+ +
+``` + +Use `AvatarStack--right` to right-align the avatar stack. Remember to switch the alignment of tooltips when making this change. + +```html +
+
+ @octocat + @octocat + @octocat +
+
``` ## Circle Badge @@ -146,8 +194,8 @@ For specific cases where two badges or more need to be shown as related or conne [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-avatars/lib/avatar-stack.scss b/modules/primer-avatars/lib/avatar-stack.scss index 884f6a528d..285b85077f 100644 --- a/modules/primer-avatars/lib/avatar-stack.scss +++ b/modules/primer-avatars/lib/avatar-stack.scss @@ -2,6 +2,8 @@ // there is limited space available. // // No styleguide references +@warn ".avatar-stack will be deprecated in version 11. Use .AvatarStack instead."; + .avatar-stack { display: inline-block; white-space: nowrap; @@ -43,3 +45,137 @@ } } } + +// Refactored, new avatar stack: + +.AvatarStack { + position: relative; + min-width: 26px; + height: 20px; + + .AvatarStack-body { + position: absolute; + } + + &.AvatarStack--two { + min-width: 36px; + } + + &.AvatarStack--three-plus { + min-width: 46px; + } +} + +.AvatarStack-body { + display: flex; + background: $bg-white; + + .avatar { + position: relative; + z-index: 2; + display: flex; + width: 20px; + height: 20px; + box-sizing: content-box; + margin-right: -11px; + background-color: $bg-white; + border-right: $border-width $border-style $white; + border-radius: 2px; + transition: margin 0.1s ease-in-out; + + &:first-child { + z-index: 3; + } + + &:last-child { + z-index: 1; + } + + // stylelint-disable selector-max-type + img { + border-radius: 2px; + } + // stylelint-enable selector-max-type + + // Account for 4+ avatars + &:nth-child(n+4) { + display: none; + opacity: 0; + } + } + + &:hover { + .avatar { + margin-right: 3px; + } + + .avatar:nth-child(n+4) { + display: flex; + opacity: 1; + } + + .avatar-more { + display: none !important; + } + } +} + +.avatar.avatar-more { + z-index: 1; + margin-right: 0; + background: $gray-100; + + &::before, + &::after { + position: absolute; + display: block; + height: 20px; + content: ""; + border-radius: 2px; + outline: $border-width $border-style $white; + } + + &::before { + width: 17px; + background: $gray-200; + } + + &::after { + width: 14px; + background: $gray-300; + } +} + +// Right aligned variation + +.AvatarStack--right { + .AvatarStack-body { + right: 0; + flex-direction: row-reverse; + + &:hover .avatar { + margin-right: 0; + margin-left: 3px; + } + } + + .avatar.avatar-more { + background: $gray-300; + + &::before { + width: 5px; + } + + &::after { + width: 2px; + background: $gray-100; + } + } + + .avatar { + margin-right: 0; + margin-left: -11px; + border-right: 0; + border-left: $border-width $border-style $white; + } +} diff --git a/modules/primer-avatars/package.json b/modules/primer-avatars/package.json index fc7da1e9bf..2fa7fddb36 100644 --- a/modules/primer-avatars/package.json +++ b/modules/primer-avatars/package.json @@ -1,8 +1,8 @@ { - "version": "1.3.0", + "version": "1.5.0", "name": "primer-avatars", "description": "Basic styles for user profile avatars.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,24 +16,24 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-avatars", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-avatars", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "avatars", "primer", "css", "github", - "primercss" + "design-system" ] } diff --git a/modules/primer-avatars/stories.js b/modules/primer-avatars/stories.js new file mode 100644 index 0000000000..e969727a1c --- /dev/null +++ b/modules/primer-avatars/stories.js @@ -0,0 +1,101 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Avatars', module) +.add('avatar', () => ( + Uncle Cat +)) +.add('avatar-small', () => ( + +)) +.add('avatar-parent-child', () => ( +
+
+ + Child cat +
+
+)) +.add('avatar-stack', () => ( +
+
+ Uncle Cat + Uncle Cat + Uncle Cat +
+
+ +)) +.add('AvatarStack', () => ( +
+
+
+ Uncle Cat + Uncle Cat +
+ Uncle Cat + Uncle Cat + Uncle Cat +
+
+
+
+ Uncle Cat + Uncle Cat +
+
+
+
+ Uncle Cat + Uncle Cat +
+ Uncle Cat + Uncle Cat + Uncle Cat +
+
+
+
+ Uncle Cat + Uncle Cat +
+
+ +
+)) +.add('CircleBadge--small', () => ( +
+ + + +
+)) +.add('CircleBadge--medium', () => ( +
+ + + +
+)) +.add('CircleBadge--large', () => ( +
+ + + +
+)) +.add('DashedConnection', () => ( +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+)) diff --git a/modules/primer-base/LICENSE b/modules/primer-base/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-base/LICENSE +++ b/modules/primer-base/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-base/README.md b/modules/primer-base/README.md index 2288512dfa..521fecaffd 100644 --- a/modules/primer-base/README.md +++ b/modules/primer-base/README.md @@ -1,11 +1,11 @@ -# Primer CSS Base +# Primer Base -[![npm version](http://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-base.svg)](https://www.npmjs.org/package/primer-base) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > GitHub's CSS to reset the browsers default styles. Built on top of normalize.css -This repository is a module of the full [primer-css][primer-css] repository. And is built off of [normalize.css](https://github.com/necolas/normalize.css/) +This repository is a module of the full [primer][primer] repository. And is built off of [normalize.css](https://github.com/necolas/normalize.css/) ## Install @@ -41,8 +41,8 @@ You can read more about base in the [docs][docs]. [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-base/lib/base.scss b/modules/primer-base/lib/base.scss index 88213a74aa..32fb7b5b4b 100644 --- a/modules/primer-base/lib/base.scss +++ b/modules/primer-base/lib/base.scss @@ -64,4 +64,15 @@ th { button { cursor: pointer; + // Remove border radius added by Chroma macOS + border-radius: 0; +} + +details { + summary { cursor: pointer; } + + &:not([open]) { + // Set details content hidden by default for browsers that don't do this + > *:not(summary) { display: none; } + } } diff --git a/modules/primer-base/lib/normalize.scss b/modules/primer-base/lib/normalize.scss index bca298e757..8152aa3aed 100644 --- a/modules/primer-base/lib/normalize.scss +++ b/modules/primer-base/lib/normalize.scss @@ -89,13 +89,11 @@ template, /* 1 */ ========================================================================== */ /** - * 1. Remove the gray background on active links in IE 10. - * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + * Remove the gray background on active links in IE 10. */ a { background-color: transparent; /* 1 */ - -webkit-text-decoration-skip: objects; /* 2 */ } /** diff --git a/modules/primer-base/package.json b/modules/primer-base/package.json index ea52df0a76..7ad058dfc4 100644 --- a/modules/primer-base/package.json +++ b/modules/primer-base/package.json @@ -1,8 +1,8 @@ { - "version": "1.4.0", + "version": "1.6.1", "name": "primer-base", "description": "CSS to reset the browsers default styles", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,24 +16,24 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-base", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-base", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss", + "design-system", "base", "reset", "normalize" diff --git a/modules/primer-base/stories.js b/modules/primer-base/stories.js new file mode 100644 index 0000000000..4597969ad6 --- /dev/null +++ b/modules/primer-base/stories.js @@ -0,0 +1,7 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Base', module) + .add('button', () => ( + +)) diff --git a/modules/primer-blankslate/LICENSE b/modules/primer-blankslate/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-blankslate/LICENSE +++ b/modules/primer-blankslate/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-blankslate/README.md b/modules/primer-blankslate/README.md index d8bfaea79a..4b72b23e68 100644 --- a/modules/primer-blankslate/README.md +++ b/modules/primer-blankslate/README.md @@ -1,11 +1,11 @@ -# Primer CSS Blankslate +# Primer Blankslate -[![npm version](http://img.shields.io/npm/v/primer-blankslate.svg)](https://www.npmjs.org/package/primer-blankslate) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-blankslate.svg)](https://www.npmjs.org/package/primer-blankslate) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Blankslates are for when there is a lack of content within a page or section. Use them as placeholders to tell users why something isn’t there. Be sure to provide an action to add content as well. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -131,8 +131,8 @@ Removes the `background-color` and `border`. [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-blankslate/package.json b/modules/primer-blankslate/package.json index 40f49da61b..a1040c69a2 100644 --- a/modules/primer-blankslate/package.json +++ b/modules/primer-blankslate/package.json @@ -1,8 +1,8 @@ { - "version": "1.3.0", + "version": "1.4.3", "name": "primer-blankslate", "description": "Blankslates are for when there is a lack of content within a page or section.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,24 +16,24 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-blankslate", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-blankslate", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss", + "design-system", "blankslate", "empty", "content" diff --git a/modules/primer-blankslate/stories.js b/modules/primer-blankslate/stories.js new file mode 100644 index 0000000000..3e9b384cc8 --- /dev/null +++ b/modules/primer-blankslate/stories.js @@ -0,0 +1,40 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Blankslate', module) +.add('blankslate', () => ( +
+

This is a blank slate

+

Use it to provide information when no dynamic content exists.

+
+)) +.add('blankslate-narrow', () => ( +
+

This is a blank slate

+

Use it to provide information when no dynamic content exists.

+
+)) +.add('blankslate-large', () => ( +
+

This is a blank slate

+

Use it to provide information when no dynamic content exists.

+
+)) +.add('blankslate-spacious', () => ( +
+

This is a blank slate

+

Use it to provide information when no dynamic content exists.

+
+)) +.add('blankslate-capped', () => ( +
+

This is a blank slate

+

Use it to provide information when no dynamic content exists.

+
+)) +.add('blankslate-clean-background', () => ( +
+

This is a blank slate

+

Use it to provide information when no dynamic content exists.

+
+)) diff --git a/modules/primer-box/LICENSE b/modules/primer-box/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-box/LICENSE +++ b/modules/primer-box/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-box/README.md b/modules/primer-box/README.md index 40bcb81199..c8773cd473 100644 --- a/modules/primer-box/README.md +++ b/modules/primer-box/README.md @@ -1,11 +1,11 @@ -# Primer CSS box +# Primer box -[![npm version](http://img.shields.io/npm/v/primer-box.svg)](https://www.npmjs.org/package/primer-box) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-box.svg)](https://www.npmjs.org/package/primer-box) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Box is a module for creating rounded-corner boxes with a white background and gray borders. Box has optional element styles for headers, lists, and footers. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -47,7 +47,7 @@ The `.Box` component can be used for something as simple as a rounded corner box ## Box -A `.Box` is a container with a a white background ,a light gray border, and rounded corners. By default there are no additional styles such as padding, these can be added as needed with utility classes. Other styles and layouts can be achieved with box elements and modifiers shown in the documentation below. +A `.Box` is a container with a a white background, a light gray border, and rounded corners. By default there are no additional styles such as padding, these can be added as needed with utility classes. Other styles and layouts can be achieved with box elements and modifiers shown in the documentation below. ```html
@@ -590,8 +590,8 @@ Box patterns can also be made with, and modified with [border utilities](../util [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-box/package.json b/modules/primer-box/package.json index d62ca6a5db..196e13fd16 100644 --- a/modules/primer-box/package.json +++ b/modules/primer-box/package.json @@ -1,8 +1,8 @@ { - "version": "2.4.0", + "version": "2.5.3", "name": "primer-box", "description": "A module for creating rounded-corner boxes with options for headers, lists, and footers.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,23 +16,23 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-box", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-box", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss" + "design-system" ] } diff --git a/modules/primer-box/stories.js b/modules/primer-box/stories.js new file mode 100644 index 0000000000..2aeada432d --- /dev/null +++ b/modules/primer-box/stories.js @@ -0,0 +1,213 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Box', module) + .add('Box', () => ( +
+ Box +
+ )) + .add('Box elements', () => ( +
+
+

+ Box-title +

+
+
+ Box-body +
+
+ Box-footer +
+
+ )) + .add('Box-row', () => ( +
+
    +
  • + Box-row +
  • +
  • + Box-row +
  • +
  • + Box-row +
  • +
  • + Box-row +
  • +
+
+ )) + .add('Box--condensed', () => ( +
+
+

+ Box-title +

+
+
+ Box-body +
+
    +
  • + Box-row +
  • +
  • + Box-row +
  • +
+
+ Box-footer +
+
+ )) + .add('Box--spacious', () => ( +
+
+

+ Box-title +

+
+
+ Box-body +
+
    +
  • + Box-row +
  • +
  • + Box-row +
  • +
+
+ Box-footer +
+
+ )) + .add('Box--blue', () => ( +
+
+

+ Box-title +

+
+
+ Box-body +
+
    +
  • + Box-row +
  • +
  • + Box-row +
  • +
+
+ Box-footer +
+
+ )) + .add('Box-header--blue', () => ( +
+
+

Box-title

+
+
+ Box-body +
+
+ )) + .add('Box--danger', () => ( +
+
+ Row one +
+
+ Row two +
+
+ )) + .add('Box-row themes', () => ( +
+
+
+ .Box-row--gray +
+
+ .Box-row--hover-gray +
+
+ .Box-row--yellow +
+
+ .Box-row--hover-blue +
+
+ .Box-row--blue +
+
+
+
+ .Box-row--focus-gray and .navigation-focus +
+
+ .Box-row--focus-gray +
+
+ .Box-row--focus-blue and .navigation-focus +
+
+ .Box-row--focus-blue +
+
+
+ )) + .add('Box-row--unread', () => ( +
+
+ Box row +
+
+ Box row unread +
+
+ Box row +
+
+ )) + .add('Box-row-link', () => ( +
+ +
+ )) + .add('Box border-dashed', () => ( +
+ Box border-dashed +
+ )) + .add('Box with flash-full', () => ( +
+
+ Box-header +
+
+ flash-full +
+
+ flash-full flash-success +
+
+ flash-full flash-warn +
+
+ flash-full flash-error +
+
+ Box-body +
+
+ )) diff --git a/modules/primer-cards/LICENSE b/modules/primer-branch-name/LICENSE similarity index 97% rename from modules/primer-cards/LICENSE rename to modules/primer-branch-name/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-cards/LICENSE +++ b/modules/primer-branch-name/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-branch-name/README.md b/modules/primer-branch-name/README.md new file mode 100644 index 0000000000..49b26d442c --- /dev/null +++ b/modules/primer-branch-name/README.md @@ -0,0 +1,69 @@ +# Primer / Branch Name + +[![npm version](https://img.shields.io/npm/v/primer-branch-name.svg)](https://www.npmjs.org/package/primer-branch-name) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) + +> A nice, consistent way to display branch names. + +This repository is a module of the full [primer][primer] repository. + +## Install + +This repository is distributed with [npm]. After [installing npm][install-npm], you can install `primer-branch-name` with this command. + +``` +$ npm install --save primer-branch-name +``` + +## Usage + +The source files included are written in [Sass][sass] (SCSS) You can simply point your sass `include-path` at your `node_modules` directory and import it like this. + +```scss +@import "primer-branch-name/index.scss"; +``` + +You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._ + +## Build + +For a compiled **CSS** version of this module, an npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package: + +``` +$ npm run build +``` + +## Documentation + + + +Branch names can be a link name or not: + +```html +a_new_feature_branch +a_new_feature_branch +``` + +You may also include an octicon before the branch name text: + +```html + + <%= octicon("git-branch") width:16 height:16 %> + a_new_feature_branch + +``` + + + +## License + +[MIT](./LICENSE) © [GitHub](https://github.com/) + +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ +[npm]: https://www.npmjs.com/ +[install-npm]: https://docs.npmjs.com/getting-started/installing-node +[sass]: http://sass-lang.com/ diff --git a/modules/primer-branch-name/index.scss b/modules/primer-branch-name/index.scss new file mode 100644 index 0000000000..d893139c4e --- /dev/null +++ b/modules/primer-branch-name/index.scss @@ -0,0 +1,3 @@ +// support files +@import "primer-support/index.scss"; +@import "./lib/branch-name.scss"; diff --git a/modules/primer-branch-name/lib/branch-name.scss b/modules/primer-branch-name/lib/branch-name.scss new file mode 100644 index 0000000000..f86ff604bf --- /dev/null +++ b/modules/primer-branch-name/lib/branch-name.scss @@ -0,0 +1,20 @@ +// A nice way to display branch names inside the UI. Can be a link or not. +// stylelint-disable selector-max-type +.branch-name { + display: inline-block; + padding: 2px 6px; + font: 12px $mono-font; + color: rgba($black, 0.6); + background-color: lighten($blue-100, 3%); + border-radius: 3px; + + .octicon { + margin: 1px -2px 0 0; + color: desaturate($blue-300, 70%); + } +} + +// When a branch name is a link +// stylelint-disable selector-no-qualifying-type +a.branch-name { color: $text-blue; } +// stylelint-enable selector-no-qualifying-type diff --git a/modules/primer-branch-name/package.json b/modules/primer-branch-name/package.json new file mode 100644 index 0000000000..0d769d1f20 --- /dev/null +++ b/modules/primer-branch-name/package.json @@ -0,0 +1,32 @@ +{ + "version": "1.0.1", + "name": "primer-branch-name", + "description": "A nice, consistent way to display branch names.", + "homepage": "http://primer.github.io/", + "primer": { + "category": "product", + "module_type": "components" + }, + "author": "GitHub, Inc.", + "license": "MIT", + "style": "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" + }, + "dependencies": { + "primer-support": "4.5.0" + }, + "keywords": [ + "github", + "primer" + ] +} diff --git a/modules/primer-breadcrumb/LICENSE b/modules/primer-breadcrumb/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-breadcrumb/LICENSE +++ b/modules/primer-breadcrumb/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-breadcrumb/README.md b/modules/primer-breadcrumb/README.md index 0563466146..718b0d0469 100644 --- a/modules/primer-breadcrumb/README.md +++ b/modules/primer-breadcrumb/README.md @@ -1,11 +1,11 @@ -# Primer Marketing CSS Breadcrumb Navigation +# Primer Breadcrumb Navigation -[![npm version](http://img.shields.io/npm/v/primer-breadcrumb.svg)](https://www.npmjs.org/package/primer-breadcrumb) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-breadcrumb.svg)](https://www.npmjs.org/package/primer-breadcrumb) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) -> Breadcrumb navigation for GitHub's marketing pages with parents / grandparents. +> Breadcrumb navigation for GitHub's pages with parents / grandparents. -This repository is a module of the full [primer-css][primer] repository. +This repository is a module of the full [primer][primer] repository. ## Documentation @@ -22,7 +22,7 @@ Breadcrumbs are used to show taxonomical context on pages that are many levels d #### Usage -```html +```html title="Breadcrumb"
``` -#### Hidden text button +## Hidden text button Use `.hidden-text-expander` to indicate and toggle hidden text. @@ -245,14 +248,33 @@ Use `.hidden-text-expander` to indicate and toggle hidden text. You can also make the expander appear inline by adding `.inline`. + +## Using button styles with the details summary element + +You can add `.btn` and `.btn-*` classes to any +[``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary) +element so that it gains the appearance of a button, and +selected/active styles when the parent +[`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) +element is open. + +```html +
+ Toggle the content +

+ This content will be toggled. +

+
+``` + ## License [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-buttons/lib/button.scss b/modules/primer-buttons/lib/button.scss index d31cd625e3..a0d32a596f 100644 --- a/modules/primer-buttons/lib/button.scss +++ b/modules/primer-buttons/lib/button.scss @@ -202,3 +202,12 @@ } } } + +.details-reset { + // Remove marker added by the display: list-item browser default + > summary { list-style: none; } + // Remove marker added by details polyfill + > summary::before { display: none; } + // Remove marker added by Chrome + > summary::-webkit-details-marker { display: none; } +} diff --git a/modules/primer-buttons/package.json b/modules/primer-buttons/package.json index 374e849743..755a13eaf3 100644 --- a/modules/primer-buttons/package.json +++ b/modules/primer-buttons/package.json @@ -1,8 +1,8 @@ { - "version": "2.3.0", + "version": "2.5.1", "name": "primer-buttons", "description": "A collection of buttons used for primary and secondary actions.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,24 +16,24 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-buttons", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-buttons", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss", + "design-system", "buttons", "styles" ] diff --git a/modules/primer-buttons/stories.js b/modules/primer-buttons/stories.js new file mode 100644 index 0000000000..bb443ddda0 --- /dev/null +++ b/modules/primer-buttons/stories.js @@ -0,0 +1,72 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Button', module) + .add('btn', () => ( + + )) + .add('btn-primary', () => ( +
+ + + + + +
+ )) + .add('btn-secondary', () => ( +
+ + + + + +
+ )) + .add('btn-danger', () => ( +
+ + + + + +
+ )) + .add('btn-outline', () => ( +
+ + + + + +
+ )) + .add('btn-blue', () => ( +
+ + + + + +
+ )) + .add('btn-purple', () => ( +
+ + + + + +
+ )) + .add('btn-large', () => ( +
+ Large link button + +
+ )) + .add('btn-link', () => ( +
+ +
+ )) diff --git a/modules/primer-cards/README.md b/modules/primer-cards/README.md deleted file mode 100644 index 556c91a311..0000000000 --- a/modules/primer-cards/README.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Primer Marketing CSS Cards -[![npm version](http://img.shields.io/npm/v/primer-cards.svg)](https://www.npmjs.org/package/primer-cards) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) - -# ⚠️ The primer-cards module is being deprecated in the next major version. Use primer-box instead. - - - -> Card-like containers to group semantically related content together on marketing websites at GitHub. - -This repository is a module of the full [primer-css][primer] repository. - -## Documentation - - - -Documentation & refactor coming very soon - - - - -## Install - -This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-cards` with this command. - -``` -$ npm install --save primer-cards -``` - -## Usage - -The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this. - -```scss -@import "primer-cards/index.scss"; -``` - -You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._ - -## Build - -For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` - -``` -$ npm run build -``` - -## License - -MIT © [GitHub](https://github.com/) - -[primer]: https://github.com/primer/primer -[primer-support]: https://github.com/primer/primer-support -[support]: https://github.com/primer/primer-support -[docs]: http://primercss.io/ -[npm]: https://www.npmjs.com/ -[install-npm]: https://docs.npmjs.com/getting-started/installing-node -[sass]: http://sass-lang.com/ diff --git a/modules/primer-cards/index.scss b/modules/primer-cards/index.scss deleted file mode 100644 index a43ab0f603..0000000000 --- a/modules/primer-cards/index.scss +++ /dev/null @@ -1,6 +0,0 @@ -// support files -@warn "primer-cards: The primer-cards module is being deprecated in the next major version. Use primer-box instead."; - -@import "primer-support/index.scss"; -@import "primer-marketing-support/index.scss"; -@import "./lib/cards.scss"; diff --git a/modules/primer-cards/lib/cards.scss b/modules/primer-cards/lib/cards.scss deleted file mode 100644 index 269be5629a..0000000000 --- a/modules/primer-cards/lib/cards.scss +++ /dev/null @@ -1,6 +0,0 @@ -.card { - background-color: $white; - border: $border; - border-radius: 6px; - box-shadow: $box-shadow; -} diff --git a/modules/primer-cards/package.json b/modules/primer-cards/package.json deleted file mode 100644 index e7b65d9bdd..0000000000 --- a/modules/primer-cards/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "version": "0.4.1", - "name": "primer-cards", - "description": "Card-like containers to group semantically related content together on marketing websites at GitHub.", - "homepage": "http://primercss.io/", - "author": "GitHub, Inc.", - "license": "MIT", - "style": "build/build.css", - "main": "build/index.js", - "primer": { - "category": "marketing", - "module_type": "components" - }, - "files": [ - "index.scss", - "lib", - "build" - ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-cards", - "bugs": { - "url": "https://github.com/primer/primer-css/issues" - }, - "scripts": { - "build": "primer-module-build index.scss", - "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" - }, - "dependencies": { - "primer-marketing-support": "1.3.0", - "primer-support": "4.3.0" - }, - "keywords": [ - "cards", - "css", - "github", - "primer", - "primercss", - "style" - ] -} diff --git a/modules/primer-core/LICENSE b/modules/primer-core/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-core/LICENSE +++ b/modules/primer-core/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-core/README.md b/modules/primer-core/README.md index 238e3c1113..cc37633da7 100644 --- a/modules/primer-core/README.md +++ b/modules/primer-core/README.md @@ -1,15 +1,15 @@ # Primer Core -[![npm version](http://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.org/package/primer-core) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-core.svg)](https://www.npmjs.org/package/primer-core) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) -> Primer core is one of 3 meta-packages that belong to the Primer CSS framework. Primer core contains packages that are shared between GitHub product and marketing websites. +> Primer core is one of 3 meta-packages that belong to the Primer framework. Primer core contains packages that are shared between GitHub product and marketing websites. -This repository is a compilation of [several CSS packages](https://github.com/primer/primer-css). You can break it down into smaller sections using npm. +This repository is a compilation of [several CSS packages](https://github.com/primer/primer). You can break it down into smaller sections using npm. ## Install -This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-css` with this command. **You must have npm >=3.0 installed to be able to satisfy the dependency paths** +This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer` with this command. **You must have npm >=3.0 installed to be able to satisfy the dependency paths** ``` $ npm install --save primer-core @@ -42,7 +42,7 @@ You can read more about primer in the [docs][docs]. [MIT](./LICENSE) © [GitHub](https://github.com/) [primer]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-core/index.scss b/modules/primer-core/index.scss index 0ede55963e..65637a515b 100644 --- a/modules/primer-core/index.scss +++ b/modules/primer-core/index.scss @@ -1,8 +1,8 @@ /*! * Primer-core - * http://primercss.io + * http://primer.github.io * - * Released under MIT license. Copyright 2015 GitHub, Inc. + * Released under MIT license. Copyright (c) 2017 GitHub Inc. */ // Primer master file @@ -16,6 +16,7 @@ // Core modules @import "primer-base/index.scss"; @import "primer-box/index.scss"; +@import "primer-breadcrumb/index.scss"; @import "primer-buttons/index.scss"; @import "primer-table-object/index.scss"; @import "primer-forms/index.scss"; diff --git a/modules/primer-core/package.json b/modules/primer-core/package.json index 95e6ebbcc9..74185917a2 100644 --- a/modules/primer-core/package.json +++ b/modules/primer-core/package.json @@ -1,8 +1,8 @@ { - "version": "6.3.1", + "version": "6.6.0", "name": "primer-core", - "description": "Primer CSS's core modules", - "homepage": "http://primercss.io/", + "description": "Primer's core modules", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "build/build.css", @@ -15,26 +15,28 @@ "index.scss", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-core", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-core", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "test": "npm run build" + "test": "npm run build", + "lint": "../../script/lint-scss" }, "dependencies": { - "primer-base": "1.4.0", - "primer-box": "2.4.0", - "primer-buttons": "2.3.0", - "primer-forms": "1.3.1", - "primer-layout": "1.3.0", - "primer-navigation": "1.3.0", - "primer-support": "4.3.0", - "primer-table-object": "1.3.0", - "primer-tooltips": "1.3.0", - "primer-truncate": "1.3.0", - "primer-utilities": "4.7.0" + "primer-base": "1.6.1", + "primer-box": "2.5.3", + "primer-breadcrumb": "1.4.3", + "primer-buttons": "2.5.1", + "primer-forms": "2.0.1", + "primer-layout": "1.4.3", + "primer-navigation": "1.5.1", + "primer-support": "4.5.0", + "primer-table-object": "1.4.3", + "primer-tooltips": "1.5.0", + "primer-truncate": "1.4.3", + "primer-utilities": "4.8.3" } } diff --git a/modules/primer-css/package.json b/modules/primer-css/package.json deleted file mode 100644 index 57ba7529e8..0000000000 --- a/modules/primer-css/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "version": "9.4.0", - "name": "primer-css", - "description": "Primer is the CSS framework that powers GitHub's front-end design. Primer-css 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.", - "homepage": "http://primercss.io/", - "author": "GitHub, Inc.", - "license": "MIT", - "style": "build/build.css", - "primer": { - "module_type": "meta" - }, - "files": [ - "index.scss", - "lib", - "build", - "CHANGELOG.md" - ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-css", - "bugs": { - "url": "https://github.com/primer/primer-css/issues" - }, - "scripts": { - "build": "primer-module-build index.scss", - "prepare": "npm run build", - "test": "npm run build" - }, - "dependencies": { - "primer-alerts": "1.4.0", - "primer-avatars": "1.3.0", - "primer-base": "1.4.0", - "primer-blankslate": "1.3.0", - "primer-box": "2.4.0", - "primer-breadcrumb": "1.3.0", - "primer-buttons": "2.3.0", - "primer-cards": "0.4.1", - "primer-core": "6.3.1", - "primer-forms": "1.3.1", - "primer-labels": "1.4.0", - "primer-layout": "1.3.0", - "primer-markdown": "3.6.0", - "primer-marketing": "5.3.1", - "primer-marketing-support": "1.3.0", - "primer-marketing-type": "1.3.0", - "primer-marketing-utilities": "1.3.0", - "primer-navigation": "1.3.0", - "primer-page-headers": "1.3.0", - "primer-page-sections": "1.3.0", - "primer-product": "5.3.1", - "primer-support": "4.3.0", - "primer-table-object": "1.3.0", - "primer-tables": "1.3.0", - "primer-tooltips": "1.3.0", - "primer-truncate": "1.3.0", - "primer-utilities": "4.7.0" - }, - "keywords": [ - "primer", - "css", - "github", - "primercss" - ] -} diff --git a/modules/primer-forms/LICENSE b/modules/primer-forms/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-forms/LICENSE +++ b/modules/primer-forms/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-forms/README.md b/modules/primer-forms/README.md index 8ff8b153a9..8747063dba 100644 --- a/modules/primer-forms/README.md +++ b/modules/primer-forms/README.md @@ -1,11 +1,11 @@ -# Primer CSS Forms +# Primer Forms -[![npm version](http://img.shields.io/npm/v/primer-forms.svg)](https://www.npmjs.org/package/primer-forms) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-forms.svg)](https://www.npmjs.org/package/primer-forms) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Style individual form controls and utilize common layouts. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -42,6 +42,9 @@ status: Stable Style individual form controls and utilize common layouts. +{:toc} + +Overview: - We reset several elements' default styles for cross browser consistency and easier manipulation later. This includes `
`s, WebKit validation bubbles, and most textual ``s. - Specific types of textual ``s are styled automatically, but `.form-control` is available should you need it. - Always declare a `type` on your ` + + + )) + .add('label highlight', () => ( +
+ +
+ )) + .add('form-checkbox-details', () => ( +
+ +
+ )) + .add('form-group', () => ( +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+
+ )) + .add('form validation', () => ( +
+
+
+
+
This example input has an error.
+
+
+
+
+
+
This example input has a warning.
+
+
+ )) diff --git a/modules/primer-forms/stories/input-group.js b/modules/primer-forms/stories/input-group.js new file mode 100644 index 0000000000..0a8a3e1c03 --- /dev/null +++ b/modules/primer-forms/stories/input-group.js @@ -0,0 +1,18 @@ +import React from 'react' +import {Octicon} from '../../../.storybook/Octicon' + +export default () => ( +
+ + + + +
+) diff --git a/modules/primer-labels/LICENSE b/modules/primer-labels/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-labels/LICENSE +++ b/modules/primer-labels/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-labels/README.md b/modules/primer-labels/README.md index 6b1a61cb8b..38412f7679 100644 --- a/modules/primer-labels/README.md +++ b/modules/primer-labels/README.md @@ -1,11 +1,11 @@ -# Primer CSS Labels +# Primer Labels -[![npm version](http://img.shields.io/npm/v/primer-labels.svg)](https://www.npmjs.org/package/primer-labels) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-labels.svg)](https://www.npmjs.org/package/primer-labels) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Labels add metadata or indicate status of items and navigational elements. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -178,8 +178,8 @@ Counters can also be used in `Box` headers to indicate the number of items in a [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-labels/package.json b/modules/primer-labels/package.json index 3abfbf89e4..40f3ae3fe8 100644 --- a/modules/primer-labels/package.json +++ b/modules/primer-labels/package.json @@ -1,8 +1,8 @@ { - "version": "1.4.0", + "version": "1.5.3", "name": "primer-labels", "description": "Labels add metatdata or indicate status of items and navigational elements.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -16,23 +16,23 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-labels", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-labels", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss" + "design-system" ] } diff --git a/modules/primer-layout/LICENSE b/modules/primer-layout/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-layout/LICENSE +++ b/modules/primer-layout/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-layout/README.md b/modules/primer-layout/README.md index b4f23b0514..9e79587622 100644 --- a/modules/primer-layout/README.md +++ b/modules/primer-layout/README.md @@ -1,11 +1,11 @@ -# Primer CSS Layout +# Primer Layout -[![npm version](http://img.shields.io/npm/v/primer-layout.svg)](https://www.npmjs.org/package/primer-layout) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-layout.svg)](https://www.npmjs.org/package/primer-layout) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Primer’s layout includes basic page containers and a single-tiered, fraction-based grid system. That sounds more complicated than it really is though—it’s just containers, rows, and columns. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -130,8 +130,8 @@ Columns can be [centered](/utilities/#centering-content) by adding `.centered` t [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-layout/docs/grid.md b/modules/primer-layout/docs/grid.md index 793f440d5b..9559500bf2 100644 --- a/modules/primer-layout/docs/grid.md +++ b/modules/primer-layout/docs/grid.md @@ -2,7 +2,7 @@ title: Grid status: New release status_issue: https://github.com/github/design-systems/issues/88 -source: https://github.com/primer/primer-css/blob/master/modules/primer-layout/lib/grid.scss +source: https://github.com/primer/primer/blob/master/modules/primer-layout/lib/grid.scss --- The grid is 12 columns and percentage-based. The number of columns a container spans can be adjusted across breakpoints for responsive layouts. The grid system works with a variety of layout utilities to achieve different results. diff --git a/modules/primer-layout/package.json b/modules/primer-layout/package.json index a783d60056..44fd0d7d4d 100644 --- a/modules/primer-layout/package.json +++ b/modules/primer-layout/package.json @@ -1,8 +1,8 @@ { - "version": "1.3.0", + "version": "1.4.3", "name": "primer-layout", "description": "Containers, rows, and columns for creating page layout.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -17,23 +17,23 @@ "build", "docs" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-layout", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-layout", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss" + "design-system" ] } diff --git a/modules/primer-markdown/LICENSE b/modules/primer-markdown/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-markdown/LICENSE +++ b/modules/primer-markdown/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-markdown/README.md b/modules/primer-markdown/README.md index b28cc0807f..20bc47d5cc 100644 --- a/modules/primer-markdown/README.md +++ b/modules/primer-markdown/README.md @@ -1,11 +1,11 @@ -# Primer CSS Markdown +# Primer Markdown -[![npm version](http://img.shields.io/npm/v/primer-markdown.svg)](https://www.npmjs.org/package/primer-markdown) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-markdown.svg)](https://www.npmjs.org/package/primer-markdown) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Stylesheets for rendering GitHub Flavored Markdown and syntax highlighted code snippets. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -211,8 +211,8 @@ This is the final element on the page and there should be no margin below this. [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-markdown/lib/code.scss b/modules/primer-markdown/lib/code.scss index f703f9236d..3cdd3f9bc4 100644 --- a/modules/primer-markdown/lib/code.scss +++ b/modules/primer-markdown/lib/code.scss @@ -3,19 +3,11 @@ // Inline code snippets code, tt { - padding: 0; - padding-top: 0.2em; - padding-bottom: 0.2em; + padding: 0.2em 0.4em; margin: 0; font-size: 85%; background-color: rgba($black, 0.05); - border-radius: 3px; // don't add padding, gives scrollbars - - &::before, - &::after { - letter-spacing: -0.2em; // this creates padding - content: "\00a0"; - } + border-radius: $border-radius; br { display: none; } } @@ -53,7 +45,7 @@ font-size: 85%; line-height: 1.45; background-color: $gray-100; - border-radius: 3px; + border-radius: $border-radius; } pre code, @@ -67,10 +59,5 @@ word-wrap: normal; background-color: transparent; border: 0; - - &::before, - &::after { - content: normal; - } } } diff --git a/modules/primer-markdown/lib/lists.scss b/modules/primer-markdown/lib/lists.scss index b4510bd9ae..1a09ffcdfb 100644 --- a/modules/primer-markdown/lib/lists.scss +++ b/modules/primer-markdown/lib/lists.scss @@ -45,6 +45,10 @@ margin-bottom: 0; } + li { + word-wrap: break-all; + } + li > p { margin-top: $spacer-3; } diff --git a/modules/primer-markdown/package.json b/modules/primer-markdown/package.json index 4324d34a76..4f95c4cc74 100644 --- a/modules/primer-markdown/package.json +++ b/modules/primer-markdown/package.json @@ -1,5 +1,5 @@ { - "version": "3.6.0", + "version": "3.7.3", "name": "primer-markdown", "description": "GitHub stylesheets for rendering markdown.", "homepage": "https://github.com/primer/primer-markdown", @@ -16,18 +16,18 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-markdown", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-markdown", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-support": "4.3.0" + "primer-support": "4.5.0" }, "keywords": [ "github", diff --git a/modules/primer-markdown/stories.js b/modules/primer-markdown/stories.js new file mode 100644 index 0000000000..926c4a26ab --- /dev/null +++ b/modules/primer-markdown/stories.js @@ -0,0 +1,18 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Markdown', module) + .add('code', () => ( +
+

+ This is inline code block. This code block has a <br>
in it
. When a code block has a long sentence in it, it should wrap the page to a new line. Some people like to see the world burn and put reallylongunbrokenstringsreallylongunbrokenstringsreallylongunbrokenstringsreallylongunbrokenstringsreallylongunbrokenstrings in the code blocks. +

+
+ )) + .add('pre', () => ( +
+
+        Really long pre blocks should scroll horizontally when the words are longer than the parent container
+      
+
+ )) diff --git a/modules/primer-cards/.npmignore b/modules/primer-marketing-buttons/.npmignore similarity index 100% rename from modules/primer-cards/.npmignore rename to modules/primer-marketing-buttons/.npmignore diff --git a/modules/primer-css/LICENSE b/modules/primer-marketing-buttons/LICENSE similarity index 97% rename from modules/primer-css/LICENSE rename to modules/primer-marketing-buttons/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-css/LICENSE +++ b/modules/primer-marketing-buttons/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-marketing-buttons/README.md b/modules/primer-marketing-buttons/README.md new file mode 100644 index 0000000000..1a7c8e62a7 --- /dev/null +++ b/modules/primer-marketing-buttons/README.md @@ -0,0 +1,89 @@ +# Primer Marketing CSS Buttons + +[![npm version](https://img.shields.io/npm/v/primer-marketing-buttons.svg)](https://www.npmjs.org/package/primer-marketing-buttons) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) + +> Buttons are used for actions, like in forms, while textual hyperlinks are used for destinations, or moving from one page to another. + +This repository is a module of the full [primer][primer] repository. + +## Documentation + + + +Marketing buttons extend primer-core buttons with more color and fill styles. + + +## Colors + +Marketing buttons are available in orange. + +```html + +``` + +## Outline button colors + +The `btn-outline` has also been extended with orange, purple, and green. + +```html + +Link button + +``` + +## Transparent button + +A button can also be transparent and displayed with a white border with `btn-transparent`. + +```html +
+ +
+``` + + + +## Install + +This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-marketing-buttons` with this command. + +``` +$ npm install --save primer-marketing-buttons +``` + +## Usage + +The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this. + +```scss +@import "primer-marketing-buttons/index.scss"; +``` + +You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._ + +## Build + +For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` + +``` +$ npm run build +``` + +## License + +MIT © [GitHub](https://github.com/) + +[primer]: https://github.com/primer/primer +[primer-support]: https://github.com/primer/primer-support +[support]: https://github.com/primer/primer-support +[docs]: http://primer.github.io/ +[npm]: https://www.npmjs.com/ +[install-npm]: https://docs.npmjs.com/getting-started/installing-node +[sass]: http://sass-lang.com/ diff --git a/modules/primer-marketing-buttons/index.scss b/modules/primer-marketing-buttons/index.scss new file mode 100644 index 0000000000..9ba7d96520 --- /dev/null +++ b/modules/primer-marketing-buttons/index.scss @@ -0,0 +1,3 @@ +// support files +@import "primer-support/index.scss"; +@import "./lib/button.scss"; diff --git a/modules/primer-marketing-buttons/lib/button.scss b/modules/primer-marketing-buttons/lib/button.scss new file mode 100644 index 0000000000..930de9e9d9 --- /dev/null +++ b/modules/primer-marketing-buttons/lib/button.scss @@ -0,0 +1,24 @@ +.btn-orange { @include btn-solid($white, lighten($orange-500, 7.5%), darken($orange-500, 7.5%)); } + +.btn-outline-purple { @include btn-outline($purple); } +.btn-outline-orange { @include btn-outline($orange); } +.btn-outline-green { @include btn-outline($green); } + +@mixin btn-transparent-active { + color: $gray-800; + background-color: $white; + background-image: none; + border-color: $white; +} + +.btn-transparent { + color: $white; + background-color: transparent; + background-image: none; + border: $border-width $border-style $white-fade-50; + + &:hover, + &:active { + @include btn-transparent-active; + } +} diff --git a/modules/primer-marketing-buttons/package.json b/modules/primer-marketing-buttons/package.json new file mode 100644 index 0000000000..e77b4e0410 --- /dev/null +++ b/modules/primer-marketing-buttons/package.json @@ -0,0 +1,44 @@ +{ + "version": "1.0.2", + "name": "primer-marketing-buttons", + "description": "Buttons for marketing websites at GitHub", + "homepage": "http://primer.github.io/", + "author": "GitHub, Inc.", + "license": "MIT", + "style": "build/build.css", + "main": "build/index.js", + "primer": { + "category": "marketing", + "module_type": "components" + }, + "files": [ + "index.scss", + "lib", + "build" + ], + "repository": "https://github.com/primer/primer/tree/master/modules/primer-marketing-buttons", + "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" + }, + "dependencies": { + "primer-support": "4.5.0" + }, + "peerDependencies": { + "primer-buttons": ">=2.5.0" + }, + "keywords": [ + "css", + "github", + "primer", + "design-system", + "style", + "buttons" + ] +} diff --git a/modules/primer-marketing-buttons/stories.js b/modules/primer-marketing-buttons/stories.js new file mode 100644 index 0000000000..f84d0241fb --- /dev/null +++ b/modules/primer-marketing-buttons/stories.js @@ -0,0 +1,21 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Marketing buttons', module) + .add('Button colors', () => ( +
+ +
+ )) + .add('Outline colors', () => ( +
+ + Link button + +
+ )) + .add('Transparent button', () => ( +
+ +
+ )) diff --git a/modules/primer-marketing-support/LICENSE b/modules/primer-marketing-support/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-marketing-support/LICENSE +++ b/modules/primer-marketing-support/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-marketing-support/README.md b/modules/primer-marketing-support/README.md index f04feac035..1350f8c577 100644 --- a/modules/primer-marketing-support/README.md +++ b/modules/primer-marketing-support/README.md @@ -1,13 +1,13 @@ -# Primer CSS Marketing Support +# Primer Marketing Support -[![npm version](http://img.shields.io/npm/v/primer-marketing-support.svg)](https://www.npmjs.org/package/primer-marketing-support) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-marketing-support.svg)](https://www.npmjs.org/package/primer-marketing-support) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Support files are Sass variables, mixins, and functions that we import into different bases for use across components, objects, and utilities. Sharing these common properties across GitHub sites helps us to keep our styles more consistent. > > Most of the time to include these you'll only need to add `@import "./primer-marketing-support";` to the top of your bundle. If you want only a specific partial you can import them separately. -This repository is a module of the full [primer-css][primer] repository. +This repository is a module of the full [primer][primer] repository. ## Documentation @@ -43,7 +43,7 @@ You can also import specific portions of the module by importing those partials MIT © [GitHub](https://github.com/) [primer]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-marketing-support/package.json b/modules/primer-marketing-support/package.json index 468943a420..8487680a28 100644 --- a/modules/primer-marketing-support/package.json +++ b/modules/primer-marketing-support/package.json @@ -1,8 +1,8 @@ { - "version": "1.3.0", + "version": "1.3.3", "name": "primer-marketing-support", "description": "Sass variables, mixins, and functions for use in our components.", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -14,19 +14,20 @@ "index.scss", "lib" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-marketing-support", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-marketing-support", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "lint": "stylelint **/*.scss -s scss", - "test": "npm run lint" + "lint": "../../script/lint-scss", + "test": "npm run lint", + "build": "../../script/npm-run primer-module-build index.scss" }, "keywords": [ "primer", "css", "github", - "primercss", + "design-system", "mixins", "functions", "variables", diff --git a/modules/primer-marketing-type/LICENSE b/modules/primer-marketing-type/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-marketing-type/LICENSE +++ b/modules/primer-marketing-type/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-marketing-type/README.md b/modules/primer-marketing-type/README.md index 48d63c58a1..1be698b93c 100644 --- a/modules/primer-marketing-type/README.md +++ b/modules/primer-marketing-type/README.md @@ -1,11 +1,11 @@ # Primer Marketing CSS Typography -[![npm version](http://img.shields.io/npm/v/primer-marketing-type.svg)](https://www.npmjs.org/package/primer-marketing-type) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-marketing-type.svg)](https://www.npmjs.org/package/primer-marketing-type) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time. -This repository is a module of the full [primer-css][primer] repository. +This repository is a module of the full [primer][primer] repository. ## Documentation @@ -85,7 +85,7 @@ MIT © [GitHub](https://github.com/) [primer]: https://github.com/primer/primer [primer-support]: https://github.com/primer/primer-support [support]: https://github.com/primer/primer-support -[docs]: http://primercss.io/ +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-marketing-type/package.json b/modules/primer-marketing-type/package.json index 58f8a89825..1975cfb8fa 100644 --- a/modules/primer-marketing-type/package.json +++ b/modules/primer-marketing-type/package.json @@ -1,8 +1,8 @@ { - "version": "1.3.0", + "version": "1.4.3", "name": "primer-marketing-type", "description": "Typography for marketing websites at GitHub", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "build/build.css", @@ -16,26 +16,26 @@ "lib", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-marketing-type", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-marketing-type", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "test-docs": "ava --verbose ../../tests/modules/test-*.js", - "build": "primer-module-build index.scss", + "test-docs": "../../script/test-docs", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint test-docs" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint test-docs" }, "dependencies": { - "primer-marketing-support": "1.3.0", - "primer-support": "4.3.0" + "primer-marketing-support": "1.3.3", + "primer-support": "4.5.0" }, "keywords": [ "css", "github", "primer", - "primercss", + "design-system", "style", "type", "typography" diff --git a/modules/primer-marketing-utilities/LICENSE b/modules/primer-marketing-utilities/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-marketing-utilities/LICENSE +++ b/modules/primer-marketing-utilities/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-marketing-utilities/README.md b/modules/primer-marketing-utilities/README.md index 16e247a335..c378937932 100644 --- a/modules/primer-marketing-utilities/README.md +++ b/modules/primer-marketing-utilities/README.md @@ -1,7 +1,7 @@ # Primer Marketing CSS Utilities -[![npm version](http://img.shields.io/npm/v/primer-marketing-utilities.svg)](https://www.npmjs.org/package/primer-marketing-utilities) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-marketing-utilities.svg)](https://www.npmjs.org/package/primer-marketing-utilities) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) This repository is a module of the full [primer-marketing-css][primer-marketing-css] repository. @@ -33,14 +33,14 @@ $ npm run build ## Documentation - +You can read more about utilities in the [docs folder](./docs/) ## License [MIT](./LICENSE) © [GitHub](https://github.com/) -[primer-css]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[primer]: https://github.com/primer/primer +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-marketing-utilities/docs/borders.md b/modules/primer-marketing-utilities/docs/borders.md index 4f50741df1..8f4e1b83d3 100644 --- a/modules/primer-marketing-utilities/docs/borders.md +++ b/modules/primer-marketing-utilities/docs/borders.md @@ -1,7 +1,6 @@ --- title: Borders status: New release -status_issue: https://github.com/github/design-systems/issues/325 --- The following border utilities are meant to used in addition to those within primer-core. @@ -17,3 +16,22 @@ Top, right, bottom, and left border utilities are can be used responsively to ad .border-top-0 ``` + +## Border Colors + +### White border with alpha transparency + +Use `.border-white-fade` to add a white border with an alpha transparency of 0.15. This is useful when you want a border that is a lighter shade of the background color. Additional border colors are available in [primer-core border utilities](/borders/#border-colors). + +```html +
+ + .border-white-fade .bg-gray-dark + +
+
+ + .border-white-fade .bg-blue + +
+``` diff --git a/modules/primer-marketing-utilities/docs/layout.md b/modules/primer-marketing-utilities/docs/layout.md new file mode 100644 index 0000000000..69adc135da --- /dev/null +++ b/modules/primer-marketing-utilities/docs/layout.md @@ -0,0 +1,33 @@ +--- +title: Layout +status: New release +--- + +Marketing layout utilities build on top of [primer-core utilities](/layout/#position), adding the option of responsive positioning. + +{:toc} + +## Responsive position + +Use responsive position utilities to adjust the position of an element at different breakpoints. + +```html +
+
+ .position-md-absolute +
+
+ +
+ default +
+
+ .position-lg-relative +
+
+ default +
+
+ default +
+``` diff --git a/modules/primer-marketing-utilities/index.scss b/modules/primer-marketing-utilities/index.scss index e605a72bcd..67a7d638fb 100644 --- a/modules/primer-marketing-utilities/index.scss +++ b/modules/primer-marketing-utilities/index.scss @@ -2,3 +2,4 @@ // utilities @import "./lib/filters.scss"; @import "./lib/borders.scss"; +@import "./lib/layout.scss"; diff --git a/modules/primer-marketing-utilities/lib/borders.scss b/modules/primer-marketing-utilities/lib/borders.scss index 12ed39167a..e4cb76576e 100644 --- a/modules/primer-marketing-utilities/lib/borders.scss +++ b/modules/primer-marketing-utilities/lib/borders.scss @@ -15,3 +15,6 @@ .border-#{$breakpoint}-left-0 { border-left: 0 !important; } } } + +/* Use with .border to turn the border rgba white 0.15 */ +.border-white-fade { border-color: $white-fade-15 !important; } diff --git a/modules/primer-marketing-utilities/lib/layout.scss b/modules/primer-marketing-utilities/lib/layout.scss new file mode 100644 index 0000000000..e2a24923b1 --- /dev/null +++ b/modules/primer-marketing-utilities/lib/layout.scss @@ -0,0 +1,15 @@ +// Layout utilities +// stylelint-disable block-opening-brace-space-before, primer/selector-no-utility, comment-empty-line-before + +// Responsive position utilities + +@each $breakpoint in map-keys($breakpoints) { + @include breakpoint($breakpoint) { + /* Set position to relative */ + .position-#{$breakpoint}-relative { position: relative !important; } + /* Set position to absolute */ + .position-#{$breakpoint}-absolute { position: absolute !important; } + /* Set position to fixed */ + .position-#{$breakpoint}-fixed { position: fixed !important; } + } +} diff --git a/modules/primer-marketing-utilities/package.json b/modules/primer-marketing-utilities/package.json index 0b76b75175..2e0211e9ec 100644 --- a/modules/primer-marketing-utilities/package.json +++ b/modules/primer-marketing-utilities/package.json @@ -1,8 +1,8 @@ { - "version": "1.3.0", + "version": "1.5.1", "name": "primer-marketing-utilities", "description": "Marketing specific immutable, atomic CSS classes", - "homepage": "http://primercss.io/", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "index.scss", @@ -17,24 +17,24 @@ "build", "docs" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-marketing-utilities", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-marketing-utilities", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "lint": "stylelint **/*.scss -s scss", - "test": "npm-run-all -s build lint" + "lint": "../../script/lint-scss", + "test": "../../script/npm-run-all build lint" }, "dependencies": { - "primer-marketing-support": "1.3.0", - "primer-support": "4.3.0" + "primer-marketing-support": "1.3.3", + "primer-support": "4.5.0" }, "keywords": [ "primer", "css", "github", - "primercss" + "design-system" ] } diff --git a/modules/primer-marketing-utilities/stories.js b/modules/primer-marketing-utilities/stories.js new file mode 100644 index 0000000000..cc8ee4c2d4 --- /dev/null +++ b/modules/primer-marketing-utilities/stories.js @@ -0,0 +1,21 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +storiesOf('Marketing utilities', module) +.add('Responsive borders', () => ( +
.border-top-0
+)) +.add('border-white-fade', () => ( +
+ + .border-white-fade + +
+)) +.add('Responsive position', () => ( +
+
+ .position-md-absolute +
+
+)) diff --git a/modules/primer-marketing/LICENSE b/modules/primer-marketing/LICENSE index 5715c13693..61c8a4cffb 100755 --- a/modules/primer-marketing/LICENSE +++ b/modules/primer-marketing/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-marketing/README.md b/modules/primer-marketing/README.md index 0a7499b3d7..1141e7d20d 100755 --- a/modules/primer-marketing/README.md +++ b/modules/primer-marketing/README.md @@ -1,15 +1,15 @@ # Primer marketing -[![npm version](http://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.org/package/primer-marketing) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-marketing.svg)](https://www.npmjs.org/package/primer-marketing) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) -> Primer marketing is one of 3 meta-packages that belong to the Primer CSS framework. Primer marketing contains packages that are used on GitHub marketing websites. +> Primer marketing is one of 3 meta-packages that belong to the Primer framework. Primer marketing contains packages that are used on GitHub marketing websites. -This repository is a compilation of [several CSS packages](https://github.com/primer/primer-css). You can break it down into smaller sections using npm. +This repository is a compilation of [several CSS packages](https://github.com/primer/primer). You can break it down into smaller sections using npm. ## Install -This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-css` with this command. **You must have npm >=3.0 installed to be able to satisfy the dependency paths** +This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer` with this command. **You must have npm >=3.0 installed to be able to satisfy the dependency paths** ``` $ npm install --save primer-marketing @@ -42,7 +42,7 @@ You can read more about primer in the [docs][docs]. [MIT](./LICENSE) © [GitHub](https://github.com/) [primer]: https://github.com/primer/primer -[docs]: http://primercss.io/ +[docs]: http://primer.github.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/ diff --git a/modules/primer-marketing/index.scss b/modules/primer-marketing/index.scss index e211414969..5f2e503d95 100755 --- a/modules/primer-marketing/index.scss +++ b/modules/primer-marketing/index.scss @@ -1,8 +1,8 @@ /*! * Primer-marketing - * http://primercss.io + * http://primer.github.io * - * Released under MIT license. Copyright 2015 GitHub, Inc. + * Released under MIT license. Copyright (c) 2017 GitHub Inc. */ // Primer master file @@ -16,8 +16,7 @@ // marketing specific css modules @import "primer-marketing-type/index.scss"; -@import "primer-breadcrumb/index.scss"; -@import "primer-cards/index.scss"; +@import "primer-marketing-buttons/index.scss"; @import "primer-page-headers/index.scss"; @import "primer-page-sections/index.scss"; @import "primer-tables/index.scss"; diff --git a/modules/primer-marketing/package.json b/modules/primer-marketing/package.json index 0558381cfc..46db1b7f6a 100644 --- a/modules/primer-marketing/package.json +++ b/modules/primer-marketing/package.json @@ -1,8 +1,8 @@ { - "version": "5.3.1", + "version": "6.0.2", "name": "primer-marketing", - "description": "Primer CSS marketing packages", - "homepage": "http://primercss.io/", + "description": "Primer marketing packages", + "homepage": "http://primer.github.io/", "author": "GitHub, Inc.", "license": "MIT", "style": "build/build.css", @@ -15,24 +15,24 @@ "index.scss", "build" ], - "repository": "https://github.com/primer/primer-css/tree/master/modules/primer-marketing", + "repository": "https://github.com/primer/primer/tree/master/modules/primer-marketing", "bugs": { - "url": "https://github.com/primer/primer-css/issues" + "url": "https://github.com/primer/primer/issues" }, "scripts": { - "build": "primer-module-build index.scss", + "build": "../../script/npm-run primer-module-build index.scss", "prepare": "npm run build", - "test": "npm run build" + "test": "npm run build", + "lint": "../../script/lint-scss" }, "dependencies": { - "primer-breadcrumb": "1.3.0", - "primer-cards": "0.4.1", - "primer-marketing-support": "1.3.0", - "primer-marketing-type": "1.3.0", - "primer-marketing-utilities": "1.3.0", - "primer-page-headers": "1.3.0", - "primer-page-sections": "1.3.0", - "primer-support": "4.3.0", - "primer-tables": "1.3.0" + "primer-marketing-buttons": "1.0.2", + "primer-marketing-support": "1.3.3", + "primer-marketing-type": "1.4.3", + "primer-marketing-utilities": "1.5.1", + "primer-page-headers": "1.4.3", + "primer-page-sections": "1.4.3", + "primer-support": "4.5.0", + "primer-tables": "1.4.3" } } diff --git a/modules/primer-navigation/LICENSE b/modules/primer-navigation/LICENSE index 5715c13693..61c8a4cffb 100644 --- a/modules/primer-navigation/LICENSE +++ b/modules/primer-navigation/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 GitHub Inc. +Copyright (c) 2017 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 diff --git a/modules/primer-navigation/README.md b/modules/primer-navigation/README.md index 6f951d310d..e3ca6dc792 100644 --- a/modules/primer-navigation/README.md +++ b/modules/primer-navigation/README.md @@ -1,11 +1,11 @@ -# Primer CSS Navigation +# Primer Navigation -[![npm version](http://img.shields.io/npm/v/primer-navigation.svg)](https://www.npmjs.org/package/primer-navigation) -[![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) +[![npm version](https://img.shields.io/npm/v/primer-navigation.svg)](https://www.npmjs.org/package/primer-navigation) +[![Build Status](https://travis-ci.org/primer/primer.svg?branch=master)](https://travis-ci.org/primer/primer) > Primer comes with several navigation components. Some were designed with singular purposes, while others were design to be more flexible and appear quite frequently. -This repository is a module of the full [primer-css][primer-css] repository. +This repository is a module of the full [primer][primer] repository. ## Install @@ -48,7 +48,7 @@ Primer comes with several navigation components. Some were designed with singula The menu is a vertical list of navigational links. **A menu's width and placement must be set by you.** If you like, just use our grid columns as a parent. Otherwise, apply a custom `width`. -```html +```html title="Menu"