diff --git a/.github/CODE_OF_CONDUCT-es.md b/.github/CODE_OF_CONDUCT-es.md index a2990a0c..26a9e57f 100644 --- a/.github/CODE_OF_CONDUCT-es.md +++ b/.github/CODE_OF_CONDUCT-es.md @@ -1,7 +1,7 @@ # Código de Conducta convenido para Contribuyentes Ver este documento en otro idioma: -[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [Português](.github/CONTRIBUTING-pt-BR.md) +[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [简体中文](.github/CONTRIBUTING-zh-CN.md) / [Português](.github/CONTRIBUTING-pt-BR.md) ## Nuestro compromiso diff --git a/.github/CODE_OF_CONDUCT-jp.md b/.github/CODE_OF_CONDUCT-jp.md index 286d80dd..ecc1ccfa 100644 --- a/.github/CODE_OF_CONDUCT-jp.md +++ b/.github/CODE_OF_CONDUCT-jp.md @@ -1,7 +1,7 @@ # コントリビューター行動規範 このドキュメントを別の言語で表示する: -[English](CONTRIBUTING.md) / [Español](.github/CONTRIBUTING-es.md) / [Português](.github/CONTRIBUTING-pt-BR.md) +[English](CONTRIBUTING.md) / [简体中文](.github/CONTRIBUTING-zh-CN.md) / [Español](.github/CONTRIBUTING-es.md) / [Português](.github/CONTRIBUTING-pt-BR.md) ## 私たちの約束 diff --git a/.github/CODE_OF_CONDUCT-pt-BR.md b/.github/CODE_OF_CONDUCT-pt-BR.md index 99b32316..77ef8f59 100644 --- a/.github/CODE_OF_CONDUCT-pt-BR.md +++ b/.github/CODE_OF_CONDUCT-pt-BR.md @@ -1,7 +1,7 @@ # Código de Conduta para Colaboradores Veja este documento em outro idioma: -[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [Español](.github/CONTRIBUTING-es.md) +[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [简体中文](.github/CONTRIBUTING-zh-CN.md) / [Español](.github/CONTRIBUTING-es.md) ## Nossa promessa diff --git a/.github/CODE_OF_CONDUCT-zh-CN.md b/.github/CODE_OF_CONDUCT-zh-CN.md new file mode 100644 index 00000000..41595514 --- /dev/null +++ b/.github/CODE_OF_CONDUCT-zh-CN.md @@ -0,0 +1,57 @@ +# 参与者行为准则 + +使用其他语言来阅读本文档: +[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [Español](.github/CONTRIBUTING-es.md) / [Português](.github/CONTRIBUTING-pt-BR.md) + +## 我们的誓言 + +为了维护一个开放并且友好的环境, 作为贡献者以及维护者,我们宣誓确保参与我们的项目以及社区的每一个人都有免受骚扰的体验,不管他/她的年纪,体型,残疾与否,种族,性别特征与表达,经验程度,国籍,个人外貌,种族,宗教信仰,性特征以及性取向如何。 + +## 我们的标准 + +关于创建积极的环境的贡献的例子包括: + +* 使用欢迎友好以及包容的语言 +* 尊重不同的视角以及经验 +* 优雅的接受有建设性的批评 +* 聚焦于对社区有利的方面 +* 展现对应其他社区成员的认同 + +对于参与者来说不可接受的行为包括: + +* 性语言的使用或者具象化并且不受欢迎的性诱惑或者更进一步 +* 抹黑,羞辱的/贬损的评论,和针对个人或政治性的攻击 +* 公开或者私下骚扰 +* 公开其他人的隐私信息,比如未经许可的物理或者电子(邮箱)地址 +* 在专业领域其他被认为不合时宜的行为 + +## 我们的义务 + +项目维护者们有义务澄清可以被接受的行为的标准,并且对于任何不可接受的行为应当采取合适并且正确的行动来对待。 + +项目维护者们有权利和义务去删除,编辑,或者拒绝评论,提交,代码,维基编辑,问题等,以及其他不符合行为准则的贡献,或者当某些贡献者被视为不合时宜的,威胁性的,冒犯的或者有害的时候,我们也可以临时性地或者永久性地封禁他们。 + + +## 范畴 + +本行为准则适用于本项目空间,或者当个人代表本项目或社区在公共场合出席的场合。代表一个项目或者社区的例子包括使用一个官方的项目邮件地址,通过官方社交媒体账号发帖,或者作为一个指定的代表参与线上或者线下的活动。如何作为一个项目的代表可能会进一步被项目维护者定义并且澄清。 + +## 执行 + +你可以通过[support@nostalgi.cc][support-email]联系项目组举报辱骂,骚扰或者其他不被接受的行为事例。如果联系整个项目组是不必要的,请私下联系项目组的任何成员: + +* B.C.Rikko <[b.c.rikko@gmail.com](mailto:b.c.rikko@gmail.com)> +* Igor Guastalla <[limaguastallaigor@gmail.com](mailto:limaguastallaigor@gmail.com)> +* Trezy <[tre@trezy.com](mailto:tre@trezy.com)> + +所有的投诉都会被审核并且进行调查,并且会对公众出具一个视为必要且合适的回复。项目组有义务维护举报者个人的隐私。进一步的具体执行细节政策可能会分开来发布。 + +不真诚地遵守或者执行行为准则的项目维护者可能会面临项目领导其他成员所决定的临时的或者永久的影响。 + +## 归属 + +本行为准则改编自[贡献者契约][homepage], 版本 1.4, 可以从这里访问 [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[support-email]: mailto:support@nostalgi.cc +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/CONTRIBUTING-es.md b/.github/CONTRIBUTING-es.md index fb6ceab3..80100d36 100644 --- a/.github/CONTRIBUTING-es.md +++ b/.github/CONTRIBUTING-es.md @@ -1,7 +1,7 @@ # Contribución Ver este documento en otro idioma: -[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [Português](.github/CONTRIBUTING-pt-BR.md) +[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [简体中文](CONTRIBUTING-zh-CN.md) / [Português](.github/CONTRIBUTING-pt-BR.md) ¿Quieres contribuir al proyecto? ¡Genial! @@ -53,6 +53,7 @@ Este proyecto se apega al Código de Conducta convenido para Contribuyentes. Al │ ├── generic.scss: Estilo general y reboot.css │ └── variables.scss: Variables comunes ├── elements + ├── components ├── form ├── icons: Iconos 16x16 ├── pixel-arts: Para iconos que no son 16x16. @@ -96,7 +97,7 @@ Utilizamos [Commitizen][commitizen] and [`commitlint`][commitlint] para asegurar [commitizen]: https://github.com/commitizen/cz-cli [commitlint]: [https://github.com/marionebl/commitlint] [egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github -[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new +[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new/choose [new-pr]: https://github.com/nostalgic-css/NES.css/compare/develop...develop [semantic-release]: https://github.com/semantic-release/semantic-release [sentimental-versioning]: http://sentimentalversioning.org/ diff --git a/.github/CONTRIBUTING-jp.md b/.github/CONTRIBUTING-jp.md index 3995b723..ab0576dc 100644 --- a/.github/CONTRIBUTING-jp.md +++ b/.github/CONTRIBUTING-jp.md @@ -1,7 +1,7 @@ # 貢献する このドキュメントを別の言語で表示する: -[English](CONTRIBUTING.md) / [Español](.github/CONTRIBUTING-es.md) / [Português](.github/CONTRIBUTING-pt-BR.md) +[English](CONTRIBUTING.md) / [简体中文](CONTRIBUTING-zh-CN.md) / [Español](.github/CONTRIBUTING-es.md) / [Português](.github/CONTRIBUTING-pt-BR.md) このプロジェクトに貢献したいですか?素晴らしい! @@ -53,6 +53,7 @@ │ ├── generic.scss: 一般的なスタイルとreboot.cssの上書き │ └── variables.scss: 共通変数 ├── elements + ├── components ├── form ├── icons: 16x16のアイコン ├── pixel-arts: 16x16以外のアイコン @@ -96,7 +97,7 @@ [commitizen]: https://github.com/commitizen/cz-cli [commitlint]: [https://github.com/marionebl/commitlint] [egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github -[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new +[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new/choose [new-pr]: https://github.com/nostalgic-css/NES.css/compare/develop...develop [semantic-release]: https://github.com/semantic-release/semantic-release [sentimental-versioning]: http://sentimentalversioning.org/ diff --git a/.github/CONTRIBUTING-pt-BR.md b/.github/CONTRIBUTING-pt-BR.md index b09ed5f9..14df092f 100644 --- a/.github/CONTRIBUTING-pt-BR.md +++ b/.github/CONTRIBUTING-pt-BR.md @@ -1,7 +1,7 @@ # Contribuindo Veja este documento em outro idioma: -[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [Español](.github/CONTRIBUTING-es.md) +[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [简体中文](CONTRIBUTING-zh-CN.md) / [Español](.github/CONTRIBUTING-es.md) Quer contribuir para este projeto? Legal! @@ -53,6 +53,7 @@ Nós estamos muito felizes de você querer contribuir para o projeto! Os próxim │ ├── generic.scss: Estilização genérica e reboot.css │ └── variables.scss: Variáveis em comum ├── elements + ├── components ├── form ├── icons: 16x16 icons ├── pixel-arts: Para ícones que não são 16x16. @@ -96,7 +97,7 @@ Nós usamos [Commitizen][commitizen] e [`commitlint`][commitlint] a fim de asseg [commitizen]: https://github.com/commitizen/cz-cli [commitlint]: [https://github.com/marionebl/commitlint] [egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github -[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new +[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new/choose [new-pr]: https://github.com/nostalgic-css/NES.css/compare/develop...develop [semantic-release]: https://github.com/semantic-release/semantic-release [sentimental-versioning]: http://sentimentalversioning.org/ diff --git a/.github/CONTRIBUTING-zh-CN.md b/.github/CONTRIBUTING-zh-CN.md new file mode 100644 index 00000000..a97494e2 --- /dev/null +++ b/.github/CONTRIBUTING-zh-CN.md @@ -0,0 +1,103 @@ +# 贡献 + +使用其他语言来阅读本文档: +[English](CONTRIBUTING.md) / [日本語](.github/CONTRIBUTING-jp.md) / [Español](.github/CONTRIBUTING-es.md) / [Português](.github/CONTRIBUTING-pt-BR.md) + +你打算为本项目做贡献?太棒了! + +## 需要知道的事情 + +本项目与参与者行为准则保持一致. 我们期望你在参与本项目的时候也赞同并支持该行为准则. 关于报告不可接受的行为,请参考我们的[行为准则][code-of-conduct]. + +**在忙于你的第一个PR吗?** +[如何在GitHub上面为开源项目做贡献][egghead] + +## 如何 + +* 搭建项目? + [我们有详细的说明!](#project-setup) + +* 找到了bug? + [请让我们知道!][new-issue] + +* 为bug打补丁? + [提交PR!][new-pr] + +* 添加一个新功能? + 请确保[新开一个issue][new-issue] 来描述你的功能, 当你准备好接受反馈的时候再提交一个[新的PR][new-pr]! + +## 搭建项目 + +你有想为我们的项目做贡献,我们真的很高兴! ❤️ 请参考如下的步骤开始吧: + +1. Fork 并且 clone 我们的代码仓库 +2. 安装必须的依赖: + ```sh + $ npm install + ``` +3. 启动开发服务器: + ```sh + $ npm run storybook + ``` + +### 目录结构 +```sh +. +├── index.html: Demo page +├── style.css: Demo page style +├── css: Distribution files +├── docs: Storybook stories +└── scss: Source + ├── base + │ ├── reboot.scss: Don't change! (Bootstrap Reboot) + │ ├── generic.scss: Generic style and reboot.css + │ └── variables.scss: Common variables + ├── elements + ├── components + ├── form + ├── icons: 16x16 icons + ├── pixel-arts: For icons other than 16x16. + └── utilities +``` + +> 小建议: 确保你的 `master` 分支指向原始的代码仓库并且从你fork的分支上创建PR. 请按如下命令进行操作: +> +> ``` +> git remote add upstream https://github.com/nostalgic-css/NES.css.git +> git fetch upstream +> git branch --set-upstream-to=upstream/master master +> ``` +> +> 这样就会把原始的代码仓库添加为一个名为"upstream"的远程连接,并且从这个远程的仓库连接获取git的信息, 然后当你运行`git pull`命令的时候会指定本地的`master`分支去使用`upstream/master`分支. 在这个时候, 你就能基于这个`master` 分支来创建所有你自己的分支. 当你想更新你的`master`的版本信息的时候, 执行一个常规的`git pull`命令即可. + +## `nostalgic-css` 组织如何为项目做贡献 + +`nostalgic-css` 组织的成员必须遵守如下的步骤. 外部的贡献者只需要遵守以上的准则即可. + +### 开发步骤 + +1. 使用下面的格式化规则从`develop`分支来创建自己的分支。 +2. 做满足问题要求的必要的工作。如果发现你的工作跟该问题无关,请[创建一个新的问题][new-issue]并且在另外一个分支在进行你的工作。 +3. 提交你的PR然后合并回`develop`分支. + * 任何影响当前开发的改变都必须在文档里面描述清楚. + * 跟某一问题相关的PRs必须把那个问题的号码标注在标题里. 比如: `[#33] Fix bug` + * 分配一个问题给你自己. + * 当这个问题准备合并的时候, 必须向`nostalgic-css/NES.css` 小组申请审核. +4. 一旦PR被批准了,接下来合并分支的更改就是被分配者的义务了。 + +### 提交格式化 + +我们使用[Commitizen][commitizen] 以及 [`commitlint`][commitlint] 来确保所有的项目提交都是易于阅读的, 并且使用 [`semantic-release`][semantic-release] 来确保我们的发布是自动化的, [不浪漫的以及不带情感色彩的][sentimental-versioning]. + + + + + +[code-of-conduct]: CODE_OF_CONDUCT.md +[commitizen]: https://github.com/commitizen/cz-cli +[commitlint]: [https://github.com/marionebl/commitlint] +[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github +[new-issue]: https://github.com/nostalgic-css/NES.css/issues/new/choose +[new-pr]: https://github.com/nostalgic-css/NES.css/compare/develop...develop +[semantic-release]: https://github.com/semantic-release/semantic-release +[sentimental-versioning]: http://sentimentalversioning.org/ diff --git a/.github/README-es.md b/.github/README-es.md index e5b44149..78384ca0 100644 --- a/.github/README-es.md +++ b/.github/README-es.md @@ -1,7 +1,7 @@
NES.css is a **NES-style(8bit-like)** CSS Framework. @@ -32,9 +32,11 @@ Importa el CSS utiliando un elemento ``: ```html - + + + ``` ### Tipografías @@ -45,7 +47,7 @@ NES.css no contiene ninguna tipografía, pero recomendamos la siguiente lista de |-----------|--------------------------------------------------------------------| | (Default) | [Press Start 2P](https://fonts.google.com/specimen/Press+Start+2P) | | Inglés | [Kongtext](https://www.dafont.com/kongtext.font) | -| Japonés | [美咲フォント](http://www.geocities.jp/littlimi/misaki.htm) | +| Japonés | [美咲フォント](http://littlelimit.net/misaki.htm) | | Japonés | [Nu もち](http://kokagem.sakura.ne.jp/font/mochi/) | | Coreano | [둥근모꼴](http://cactus.tistory.com/193) | @@ -97,7 +99,7 @@ Si deseas colaborar con el proyecto ¡Recibimos todo tipo de contribuciones! ¡R [commitizen]: http://commitizen.github.io/cz-cli/ [commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg -[contributing-document]: .github/CONTRIBUTING-es.md +[contributing-document]: ./CONTRIBUTING-es.md [gitter]: https://gitter.im/nostalgic-css/Lobby [gitter-badge]: https://img.shields.io/gitter/room/nostalgic-css/Lobby.svg [google-fonts-guide]: https://developers.google.com/fonts/docs/getting_started diff --git a/.github/README-jp.md b/.github/README-jp.md index bced0270..7dbed279 100644 --- a/.github/README-jp.md +++ b/.github/README-jp.md @@ -1,7 +1,7 @@ NES.cssは **ファミコン風(8bit ライク)** なCSSフレームワークです。 @@ -31,10 +31,12 @@ yarn add nes.css ``要素を使ってCSSをインポートする: ```html - - - + + + + + ``` ### フォント @@ -45,7 +47,7 @@ NES.cssはいかなるフォントも提供していませんが、ライブラ |-----------|--------------------------------------------------------------------| | (デフォルト) | [Press Start 2P](https://fonts.google.com/specimen/Press+Start+2P) | | 英語 | [Kongtext](https://www.dafont.com/kongtext.font) | -| 日本語 | [美咲フォント](http://www.geocities.jp/littlimi/misaki.htm) | +| 日本語 | [美咲フォント](http://littlelimit.net/misaki.htm) | | 日本語 | [Nu もち](http://kokagem.sakura.ne.jp/font/mochi/) | | 韓国語 | [둥근모꼴](http://cactus.tistory.com/193) | @@ -97,7 +99,7 @@ NES.cssは次のブラウザの最新バージョンと互換性があります [commitizen]: http://commitizen.github.io/cz-cli/ [commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg -[contributing-document]: CONTRIBUTING.md +[contributing-document]: ./CONTRIBUTING-jp.md [gitter]: https://gitter.im/nostalgic-css/Lobby [gitter-badge]: https://img.shields.io/gitter/room/nostalgic-css/Lobby.svg [google-fonts-guide]: https://developers.google.com/fonts/docs/getting_started diff --git a/.github/README-pt-BR.md b/.github/README-pt-BR.md index 06f1f146..845bd112 100644 --- a/.github/README-pt-BR.md +++ b/.github/README-pt-BR.md @@ -1,7 +1,7 @@ NES.css é um Framework CSS, no **estilo NES(8bit)**. @@ -32,9 +32,11 @@ Importe o CSS através de um elemento ``: ```html - + + + ``` ### Fontes @@ -45,7 +47,7 @@ NES.css não fornece nenhuma fonte, mas nós mantemos uma lista de fontes recome |-----------|--------------------------------------------------------------------| | (Padrão) | [Press Start 2P](https://fonts.google.com/specimen/Press+Start+2P) | | Inglês | [Kongtext](https://www.dafont.com/kongtext.font) | -| Japonês | [美咲フォント](http://www.geocities.jp/littlimi/misaki.htm) | +| Japonês | [美咲フォント](http://littlelimit.net/misaki.htm) | | Japonês | [Nu もち](http://kokagem.sakura.ne.jp/font/mochi/) | | Coreano | [둥근모꼴](http://cactus.tistory.com/193) | @@ -96,7 +98,7 @@ Se você quiser nos ajudar com o projeto, nós agradecemos contribuições de to [commitizen]: http://commitizen.github.io/cz-cli/ [commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg -[contributing-document]: .github/CONTRIBUTING-pt-BR.md +[contributing-document]: ./CONTRIBUTING-pt-BR.md [gitter]: https://gitter.im/nostalgic-css/Lobby [gitter-badge]: https://img.shields.io/gitter/room/nostalgic-css/Lobby.svg [google-fonts-guide]: https://developers.google.com/fonts/docs/getting_started diff --git a/.github/README-zh-CN.md b/.github/README-zh-CN.md new file mode 100644 index 00000000..aaf95bb6 --- /dev/null +++ b/.github/README-zh-CN.md @@ -0,0 +1,85 @@ + + +NES.css 是一款 **NES-风格(8位机)** 的CSS 框架. + +[![Gitter][gitter-badge]][gitter] [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) + +## 安装 + +#### via package manager + +```shell +npm install nes.css +# or +yarn add nes.css +``` + +### via CDN + +```html + + + + + + +``` + +### 推荐字体 + +|Language|Font| +|----|----| +|(Default)|[Press Start 2P](https://fonts.google.com/specimen/Press+Start+2P)| +|English|[Kongtext](https://www.dafont.com/kongtext.font)| +|Japanese|[美咲フォント](http://littlelimit.net/misaki.htm)| +|Japanese|[Nu もち](http://kokagem.sakura.ne.jp/font/mochi/)| +| Korean|[둥근모꼴](http://cactus.tistory.com/193)| + + +## 使用 + +NES.css 只提供组件. 你需要定义你自己的布局. + +默认字体[Press Start 2P](https://fonts.google.com/specimen/Press+Start+2P?selection.family=Press+Start+2P) 只支持英文字符. 当你把这个框架与其他非英语的语言一起使用的时候, 请使用另外的字体. 请根据这个关于Google Fonts的 [说明](https://developers.google.com/fonts/docs/getting_started) 了解如何把它引入项目, 或者按照如下方式简单引人: + +```html + + + + + +``` + +## 只需要CSS + +NES.css 仅仅需要 CSS 而不依赖其他任何 JavaScript. + + +## 浏览器支持 + +NES.css 与如下浏览器的最新版本兼容. +* Chrome +* Firefox +* Safari + +未经测试 +* IE/Edge + + +## 版权许可 + +代码以及文档版权 2018 [B.C.Rikko](https://github.com/BcRikko). 代码基于MIT许可发布. 文档基于Creative Commons许可发布. + + + + +[gitter]: https://gitter.im/nostalgic-css/Lobby +[gitter-badge]: https://img.shields.io/gitter/room/nostalgic-css/Lobby.svg diff --git a/.prettierignore b/.prettierignore index 5098fa12..10cc54b5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ **/*.html **/*.md +demo/lib/* diff --git a/.storybook/addons.js b/.storybook/addons.js index 3c785b30..e3c8ae92 100644 --- a/.storybook/addons.js +++ b/.storybook/addons.js @@ -1 +1,4 @@ -import '@storybook/addon-knobs/register'; // eslint-disable-line import/no-extraneous-dependencies +/* eslint-disable import/no-extraneous-dependencies */ +import '@storybook/addon-knobs/register'; +import '@storybook/addon-backgrounds/register'; +/* eslint-enable */ diff --git a/.storybook/config.js b/.storybook/config.js index 821f6afd..8abe709d 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -1,4 +1,10 @@ -import { configure } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies +/* eslint-disable import/no-extraneous-dependencies */ +import { + addDecorator, + configure, +} from '@storybook/html'; +import { withBackgrounds } from '@storybook/addon-backgrounds'; +/* eslint-enable */ import '../scss/nes.scss'; // eslint-disable-line import/no-unresolved @@ -8,4 +14,15 @@ function loadStories() { req.keys().forEach(filename => req(filename)); } +addDecorator(withBackgrounds([ + { name: 'Blue', value: 'blue' }, + { name: 'Green', value: 'green' }, + { name: 'Yellow', value: 'yellow' }, + { name: 'Orange', value: 'orange' }, + { name: 'Red', value: 'red' }, + { name: 'Purple', value: 'purple' }, + { name: 'Black', value: 'black' }, + { name: 'White', value: 'white', default: true }, +])); + configure(loadStories, module); diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html index f71eb706..766b21df 100644 --- a/.storybook/preview-head.html +++ b/.storybook/preview-head.html @@ -2,6 +2,7 @@ ",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"tag",b:"?",e:"/?>",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}}); \ No newline at end of file diff --git a/style.css b/demo/style.css similarity index 51% rename from style.css rename to demo/style.css index 498e2640..716bb2d8 100644 --- a/style.css +++ b/demo/style.css @@ -16,6 +16,20 @@ div.containers > .nes-container { max-width: 400px; } +.selects { + display: flex; + justify-content: space-between; + margin-left: 4px; +} + +.selects .nes-select { + display: inline-flex; +} + +.nes-select + .nes-select { + margin-left: 24px; +} + .balloon.nes-container .nes-balloon { max-width: 600px; margin: 2rem 2rem; @@ -42,6 +56,14 @@ div.containers > .nes-container { margin-bottom: 1rem; } +#tables { + margin: 35px auto; +} + +#progress { + margin-top: 35px; +} + .footer { text-align: center; } @@ -73,6 +95,82 @@ div.containers > .nes-container { align-self: flex-end; } +.show-code { + position: absolute; + top: -4px; + right: -4px; + display: flex; + justify-content: center; + width: 40px; + height: 34px; + font-size: 0.7em; +} + +.sample-code { + margin: 0; +} +.sample-code > code { + padding: 1em 2em; + line-height: 2em; +} + +.code { + display: none; + padding: 0; + margin-top: -20px; + font-size: 0.85em; +} + +.copy { + width: 58px; + height: 34px; +} + +#form .nes-field, +#form .field { + margin-top: 20px; +} + +.copied { + position: absolute; + right: 35px; + bottom: 25px; + z-index: 2; + display: none; + padding: 10px; + font-size: 0.7em; + color: #000; +} + +.balloon .copied { + right: 10px; + bottom: -4px; +} + +#dialogs > section { + display: inline-block; +} + +#dialogs .dialog-menu { + padding: 0; + text-align: center; +} + +#texts { + display: inline-block; +} + +.nes-text { + margin-right: 2em; +} + +@media screen and (max-width: 1280px) { + .code p:first-child { + width: 99%; + padding-top: 2.7em; + } +} + @media screen and (max-width: 768px) { body { padding: 0; @@ -85,4 +183,14 @@ div.containers > .nes-container { .github-link { display: none; } + + .code p { + width: 100%; + font-size: 0.8em; + } + + #code-avatars p { + overflow: hidden; + text-overflow: ellipsis; + } } diff --git a/dialog-polyfill.css b/dialog-polyfill.css new file mode 100644 index 00000000..8d863618 --- /dev/null +++ b/dialog-polyfill.css @@ -0,0 +1,45 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. */ +dialog { + position: absolute; + right: 0; + left: 0; + display: block; + width: -moz-fit-content; + width: -webkit-fit-content; + width: fit-content; + height: -moz-fit-content; + height: -webkit-fit-content; + height: fit-content; + padding: 1em; + margin: auto; + color: black; + background: white; + border: solid; +} + +dialog:not([open]) { + display: none; +} + +dialog + .backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0, 0, 0, 0.1); +} + +._dialog_overlay { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +dialog.fixed { + position: fixed; + top: 50%; + transform: translate(0, -50%); +} diff --git a/docs/avatars.stories.js b/docs/avatars.stories.js index c1a213d7..35f79cf5 100644 --- a/docs/avatars.stories.js +++ b/docs/avatars.stories.js @@ -16,5 +16,7 @@ stories.add('avatars', () => { const isRounded = boolean('is-rounded', false) ? 'is-rounded' : ''; const selectedClasses = [isRounded, options].join(' '); - return ``; + return ``; }); diff --git a/docs/badge.stories.js b/docs/badge.stories.js new file mode 100644 index 00000000..fa4d591c --- /dev/null +++ b/docs/badge.stories.js @@ -0,0 +1,43 @@ +import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies +import { // eslint-disable-line import/no-extraneous-dependencies + withKnobs, radios, number, +} from '@storybook/addon-knobs'; + +const stories = storiesOf('Badges', module); +stories.addDecorator(withKnobs); + +stories.add('badges', () => { + const optionsLeft = radios('left/only', { + 'is-dark': 'is-dark', + 'is-success': 'is-success', + 'is-primary': 'is-primary', + 'is-warning': 'is-warning', + 'is-error': 'is-error', + }, 'is-dark'); + + const optionsRight = radios('right', { + 'is-dark': 'is-dark', + 'is-success': 'is-success', + 'is-primary': 'is-primary', + 'is-warning': 'is-warning', + 'is-error': 'is-error', + }, 'is-success'); + + const isSplitedIsIconOrDefault = radios('default/splited/icon', { + default: '', + 'is-splited': 'is-splited', + 'is-icon': 'is-icon', + }, 'is-splited'); + + const fontSize = number('font-size', 1, { + range: true, + min: 0, + max: 100, + step: 0.01, + }); + + return ` + + + `; +}); diff --git a/docs/dialogs.stories.js b/docs/dialogs.stories.js index bff79610..2d9e914b 100644 --- a/docs/dialogs.stories.js +++ b/docs/dialogs.stories.js @@ -8,8 +8,11 @@ stories.addDecorator(withKnobs); stories.add('dialog', () => { const open = boolean('open', true) ? 'open' : ''; + const isRounded = boolean('is-rounded', false) ? 'is-rounded' : ''; + const isDark = boolean('is-dark', false) ? 'is-dark' : ''; + const selectedClasses = [isRounded, isDark]; - return `