shibori 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +27 -0
  5. data/Procfile +1 -0
  6. data/README.md +24 -0
  7. data/Rakefile +2 -0
  8. data/app.json +11 -0
  9. data/builder/lineage_hunter.js +80 -0
  10. data/builder/list_item_hunter.js +106 -0
  11. data/builder/media_hunter.js +51 -0
  12. data/builder/object_factory.js +60 -0
  13. data/builder/parameter_hunter.js +69 -0
  14. data/builder/pattern_assembler.js +258 -0
  15. data/builder/pattern_exporter.js +43 -0
  16. data/builder/patternlab.js +365 -0
  17. data/builder/patternlab_grunt.js +38 -0
  18. data/builder/patternlab_gulp.js +26 -0
  19. data/builder/pseudopattern_hunter.js +78 -0
  20. data/config.json +34 -0
  21. data/docs/Pattern Lab Node.md +225 -0
  22. data/favicon.ico +0 -0
  23. data/gulpfile.js +148 -0
  24. data/index.js +20 -0
  25. data/lib/shibori/version.rb +3 -0
  26. data/lib/shibori.rb +11 -0
  27. data/package.json +44 -0
  28. data/public/data/annotations.js +109 -0
  29. data/public/styleguide/css/static.css +458 -0
  30. data/public/styleguide/css/static.scss +404 -0
  31. data/public/styleguide/css/styleguide-specific.css +170 -0
  32. data/public/styleguide/css/styleguide-specific.scss +204 -0
  33. data/public/styleguide/css/styleguide.css +880 -0
  34. data/public/styleguide/css/styleguide.scss +950 -0
  35. data/public/styleguide/css/vendor/prism.css +112 -0
  36. data/public/styleguide/css/vendor/typeahead.css +66 -0
  37. data/public/styleguide/fonts/icomoon.eot +0 -0
  38. data/public/styleguide/fonts/icomoon.svg +22 -0
  39. data/public/styleguide/fonts/icomoon.ttf +0 -0
  40. data/public/styleguide/fonts/icomoon.woff +0 -0
  41. data/public/styleguide/html/README +1 -0
  42. data/public/styleguide/images/spinner.gif +0 -0
  43. data/public/styleguide/js/annotations-pattern.js +308 -0
  44. data/public/styleguide/js/annotations-viewer.js +289 -0
  45. data/public/styleguide/js/code-pattern.js +120 -0
  46. data/public/styleguide/js/code-viewer.js +443 -0
  47. data/public/styleguide/js/data-saver.js +169 -0
  48. data/public/styleguide/js/pattern-finder.js +114 -0
  49. data/public/styleguide/js/postmessage.js +127 -0
  50. data/public/styleguide/js/styleguide.js +600 -0
  51. data/public/styleguide/js/url-handler.js +182 -0
  52. data/public/styleguide/js/vendor/classlist-polyfill.js +176 -0
  53. data/public/styleguide/js/vendor/jquery.js +4 -0
  54. data/public/styleguide/js/vendor/jwerty.js +523 -0
  55. data/public/styleguide/js/vendor/prism.js +7 -0
  56. data/public/styleguide/js/vendor/typeahead.bundle.min.js +7 -0
  57. data/script/bootstrap +58 -0
  58. data/shibori.gemspec +18 -0
  59. data/shibori.jpg +0 -0
  60. data/source/_data/annotations.js +109 -0
  61. data/source/_data/data.json +93 -0
  62. data/source/_data/listitems.json +782 -0
  63. data/source/_patternlab-files/README +1 -0
  64. data/source/_patternlab-files/index.mustache +94 -0
  65. data/source/_patternlab-files/partials/ishControls.mustache +64 -0
  66. data/source/_patternlab-files/partials/patternNav.mustache +17 -0
  67. data/source/_patternlab-files/partials/patternPaths.mustache +3 -0
  68. data/source/_patternlab-files/partials/viewAllPaths.mustache +3 -0
  69. data/source/_patternlab-files/pattern-header-footer/README +1 -0
  70. data/source/_patternlab-files/pattern-header-footer/footer.html +34 -0
  71. data/source/_patternlab-files/pattern-header-footer/header.html +44 -0
  72. data/source/_patternlab-files/styleguide.mustache +75 -0
  73. data/source/_patternlab-files/viewall.mustache +75 -0
  74. data/source/_patterns/00-atoms/00-typography/00-headings.mustache +6 -0
  75. data/source/_patterns/00-atoms/00-typography/01-headings-options.mustache +7 -0
  76. data/source/_patterns/00-atoms/00-typography/02-body.mustache +2 -0
  77. data/source/_patterns/00-atoms/00-typography/03-text-manipulation.mustache +12 -0
  78. data/source/_patterns/00-atoms/00-typography/04-blockquotes.mustache +3 -0
  79. data/source/_patterns/00-atoms/00-typography/05-lists.mustache +64 -0
  80. data/source/_patterns/00-atoms/01-colors/00-colors-monochromatic.mustache +36 -0
  81. data/source/_patterns/00-atoms/01-colors/01-colors-brand.mustache +26 -0
  82. data/source/_patterns/00-atoms/01-colors/02-colors-gradients.mustache +38 -0
  83. data/source/_patterns/00-atoms/02-buttons/00-btn-lg.mustache +7 -0
  84. data/source/_patterns/00-atoms/02-buttons/01-btn-sm.mustache +7 -0
  85. data/source/_patterns/00-atoms/02-buttons/02-btn-xs.mustache +7 -0
  86. data/source/_patterns/00-atoms/02-buttons/03-btn-block.mustache +7 -0
  87. data/source/_patterns/00-atoms/02-buttons/04-btn-deploy.mustache +4 -0
  88. data/source/_patterns/00-atoms/03-forms/00-text-fields.mustache +24 -0
  89. data/source/_patterns/00-atoms/03-forms/01-select-menu.mustache +6 -0
  90. data/source/_patterns/00-atoms/03-forms/02-checkbox.mustache +10 -0
  91. data/source/_patterns/00-atoms/03-forms/03-radios.mustache +10 -0
  92. data/source/_patterns/00-atoms/03-forms/04-validation.mustache +14 -0
  93. data/source/_patterns/00-atoms/04-quote/00-pullquote.mustache +7 -0
  94. data/source/_patterns/00-atoms/04-quote/01-quote-small.mustache +7 -0
  95. data/source/_patterns/00-atoms/05-code/01-pre.mustache +11 -0
  96. data/source/_patterns/00-atoms/06-tooltips/00-text.mustache +3 -0
  97. data/source/_patterns/00-atoms/06-tooltips/01-diagram-callout.mustache +1 -0
  98. data/source/_patterns/00-atoms/07-loader/00-spinner.mustache +5 -0
  99. data/source/_patterns/00-atoms/08-readmore/00-readmore.mustache +3 -0
  100. data/source/_patterns/00-atoms/09-slider/00-dots.mustache +8 -0
  101. data/source/_patterns/00-atoms/10-tables/00-tables.mustache +26 -0
  102. data/source/_patterns/00-atoms/12-modal/00-modal.mustache +14 -0
  103. data/source/_patterns/00-atoms/13-panel/00-panel.mustache +3 -0
  104. data/source/_patterns/00-atoms/14-users/00-avatar.mustache +3 -0
  105. data/source/_patterns/00-atoms/15-icons/00-icons.mustache +333 -0
  106. data/source/_patterns/00-atoms/15-icons/04-icon-colors.mustache +38 -0
  107. data/source/_patterns/00-atoms/15-icons/05-icon-sizes.mustache +31 -0
  108. data/source/_patterns/00-atoms/15-icons/_02-languages.mustache +0 -0
  109. data/source/_patterns/00-atoms/15-icons/_03-social.mustache +0 -0
  110. data/source/_patterns/00-atoms/15-icons/_05-icon-containers.mustache +0 -0
  111. data/source/_patterns/00-atoms/16-video/01-video.mustache +3 -0
  112. data/source/_patterns/00-atoms/16-video/_00-play-button.mustache +0 -0
  113. data/source/_patterns/00-atoms/17-utilities/00-visibility.mustache +8 -0
  114. data/source/_patterns/00-atoms/17-utilities/01-ui-elements.mustache +3 -0
  115. data/source/_patterns/00-atoms/18-grid/_00-grid.mustache +0 -0
  116. data/source/_patterns/01-molecules/00-text/00-header-groups.mustache +4 -0
  117. data/source/_patterns/01-molecules/00-text/01-intro-text.mustache +5 -0
  118. data/source/_patterns/01-molecules/01-layout/00-one-up.mustache +8 -0
  119. data/source/_patterns/01-molecules/01-layout/01-two-up.mustache +9 -0
  120. data/source/_patterns/01-molecules/01-layout/02-three-up.mustache +10 -0
  121. data/source/_patterns/01-molecules/01-layout/03-four-up.mustache +11 -0
  122. data/source/_patterns/01-molecules/01-layout/04-masonary-2.mustache +24 -0
  123. data/source/_patterns/01-molecules/01-layout/05-masonary-3.mustache +24 -0
  124. data/source/_patterns/01-molecules/02-navigation/01-subnav.mustache +21 -0
  125. data/source/_patterns/01-molecules/02-navigation/02-breadcrumbs.mustache +25 -0
  126. data/source/_patterns/01-molecules/02-navigation/03-side-nav.mustache +11 -0
  127. data/source/_patterns/01-molecules/02-navigation/04-side-nav-small.mustache +32 -0
  128. data/source/_patterns/01-molecules/02-navigation/05-pagination.mustache +0 -0
  129. data/source/_patterns/01-molecules/02-navigation/06-tabs.mustache +46 -0
  130. data/source/_patterns/01-molecules/03-forms/_00-search.mustache +0 -0
  131. data/source/_patterns/01-molecules/04-slider/00-slider.mustache +8 -0
  132. data/source/_patterns/01-molecules/05-messages/00-alert.mustache +15 -0
  133. data/source/_patterns/01-molecules/06-components/_00-social-share.mustache +0 -0
  134. data/source/_patterns/01-molecules/07-Elements/01-Addons-Card.mustache +79 -0
  135. data/source/_patterns/01-molecules/07-Elements/02-Buttons-Card.mustache +131 -0
  136. data/source/_patterns/01-molecules/07-Elements/03-Buildpack-Card.mustache +109 -0
  137. data/source/_patterns/01-molecules/08-vertical-tabs/01-vertical-tabs.mustache +30 -0
  138. data/source/_patterns/02-organisms/03-sections/00-purple.mustache +11 -0
  139. data/source/_patterns/02-organisms/03-sections/01-purple-dark.mustache +12 -0
  140. data/source/_patterns/02-organisms/03-sections/03-gray-light.mustache +12 -0
  141. data/source/css/hk-icon-rails.scss +13 -0
  142. data/source/css/scss/base/_base.scss +62 -0
  143. data/source/css/scss/base/_fonts.scss +12 -0
  144. data/source/css/scss/base/_normalize.scss +431 -0
  145. data/source/css/scss/base/_type.scss +128 -0
  146. data/source/css/scss/base/_utilities.scss +78 -0
  147. data/source/css/scss/components/_alert.scss +38 -0
  148. data/source/css/scss/components/_animate.scss +3340 -0
  149. data/source/css/scss/components/_animation.scss +15 -0
  150. data/source/css/scss/components/_buttons.scss +175 -0
  151. data/source/css/scss/components/_code.scss +26 -0
  152. data/source/css/scss/components/_forms.scss +136 -0
  153. data/source/css/scss/components/_hero.scss +18 -0
  154. data/source/css/scss/components/_hr.scss +11 -0
  155. data/source/css/scss/components/_icons.scss +85 -0
  156. data/source/css/scss/components/_lists.scss +45 -0
  157. data/source/css/scss/components/_logos.scss +15 -0
  158. data/source/css/scss/components/_masonary.scss +46 -0
  159. data/source/css/scss/components/_modal.scss +218 -0
  160. data/source/css/scss/components/_owlCarousel.scss +270 -0
  161. data/source/css/scss/components/_panel.scss +11 -0
  162. data/source/css/scss/components/_pill-box.scss +38 -0
  163. data/source/css/scss/components/_quote.scss +96 -0
  164. data/source/css/scss/components/_readmore.scss +11 -0
  165. data/source/css/scss/components/_slider.scss +96 -0
  166. data/source/css/scss/components/_spinner.scss +64 -0
  167. data/source/css/scss/components/_sprites.scss +3 -0
  168. data/source/css/scss/components/_sr-only.scss +10 -0
  169. data/source/css/scss/components/_tables.scss +62 -0
  170. data/source/css/scss/components/_tooltips.scss +93 -0
  171. data/source/css/scss/components/_users.scss +11 -0
  172. data/source/css/scss/components/_vertical-tabs.scss +129 -0
  173. data/source/css/scss/components/_video.scss +7 -0
  174. data/source/css/scss/ecosystem/_addons-card.scss +3 -0
  175. data/source/css/scss/ecosystem/_cards.scss +369 -0
  176. data/source/css/scss/ecosystem/_elements-brand.scss +32 -0
  177. data/source/css/scss/ecosystem/_elements.scss +4 -0
  178. data/source/css/scss/globals/_colors.scss +189 -0
  179. data/source/css/scss/globals/_mixins.scss +45 -0
  180. data/source/css/scss/globals/_variables.scss +87 -0
  181. data/source/css/scss/layout/_grid-settings.scss +13 -0
  182. data/source/css/scss/layout/_layout.scss +95 -0
  183. data/source/css/scss/page-elements/_headers.scss +3 -0
  184. data/source/css/scss/page-elements/_navigation.scss +254 -0
  185. data/source/css/scss/page-elements/_sections.scss +66 -0
  186. data/source/css/scss/page-elements/_sidebar.scss +34 -0
  187. data/source/css/shibori.scss +63 -0
  188. data/source/fonts/bentonsans/bentonsans-book.eot +0 -0
  189. data/source/fonts/bentonsans/bentonsans-book.svg +400 -0
  190. data/source/fonts/bentonsans/bentonsans-book.ttf +0 -0
  191. data/source/fonts/bentonsans/bentonsans-book.woff +0 -0
  192. data/source/fonts/bentonsans/bentonsans-medium.eot +0 -0
  193. data/source/fonts/bentonsans/bentonsans-medium.svg +416 -0
  194. data/source/fonts/bentonsans/bentonsans-medium.ttf +0 -0
  195. data/source/fonts/bentonsans/bentonsans-medium.woff +0 -0
  196. data/source/fonts/bentonsans/bentonsans-regular.eot +0 -0
  197. data/source/fonts/bentonsans/bentonsans-regular.svg +416 -0
  198. data/source/fonts/bentonsans/bentonsans-regular.ttf +0 -0
  199. data/source/fonts/bentonsans/bentonsans-regular.woff +0 -0
  200. data/source/fonts/hk-icon/hk-icon.eot +0 -0
  201. data/source/fonts/hk-icon/hk-icon.svg +261 -0
  202. data/source/fonts/hk-icon/hk-icon.ttf +0 -0
  203. data/source/fonts/hk-icon/hk-icon.woff +0 -0
  204. data/source/fonts/inconsolata/inconsolata-bold.eot +0 -0
  205. data/source/fonts/inconsolata/inconsolata-bold.svg +239 -0
  206. data/source/fonts/inconsolata/inconsolata-bold.ttf +0 -0
  207. data/source/fonts/inconsolata/inconsolata-bold.woff +0 -0
  208. data/source/fonts/inconsolata/inconsolata-regular.eot +0 -0
  209. data/source/fonts/inconsolata/inconsolata-regular.svg +239 -0
  210. data/source/fonts/inconsolata/inconsolata-regular.ttf +0 -0
  211. data/source/fonts/inconsolata/inconsolata-regular.woff +0 -0
  212. data/source/images/blockquote/close-sm.png +0 -0
  213. data/source/images/blockquote/close.png +0 -0
  214. data/source/images/blockquote/close@2x.png +0 -0
  215. data/source/images/blockquote/open-sm.png +0 -0
  216. data/source/images/blockquote/open.png +0 -0
  217. data/source/images/blockquote/open@2x.png +0 -0
  218. data/source/images/elements/heroku_suported.svg +32 -0
  219. data/source/images/forms/select-input-arrows.svg +8 -0
  220. data/source/js/init.js +26 -0
  221. data/source/js/main.js +22 -0
  222. data/source/js/vendor/bourbon-modal.js +17 -0
  223. data/source/js/vendor/fitvids.js +77 -0
  224. data/source/js/vendor/fixto.js +719 -0
  225. data/source/js/vendor/jquery-2.0.0b2.js +8690 -0
  226. data/source/js/vendor/modernizr.js +4 -0
  227. data/source/js/vendor/owl.carousel.js +3069 -0
  228. data/source/js/vendor/readmore.js +11 -0
  229. data/source/js/vendor/unslider.js +1 -0
  230. data/source/js/vendor/vertical-tabs.js +34 -0
  231. data/test/files/test.css +19 -0
  232. data/test/lineage_hunter_tests.js +262 -0
  233. data/test/list_item_hunter_tests.js +167 -0
  234. data/test/media_hunter_tests.js +74 -0
  235. data/test/object_factory_tests.js +62 -0
  236. data/test/parameter_hunter_tests.js +298 -0
  237. data/test/pattern_assembler_tests.js +43 -0
  238. data/test/patternlab_tests.js +8 -0
  239. metadata +320 -0
@@ -0,0 +1,26 @@
1
+ var patternlab_engine = require('./patternlab.js');
2
+
3
+ module.exports = function(gulp) {
4
+
5
+ gulp.task('patternlab', ['clean'], function(cb){
6
+ var patternlab = patternlab_engine();
7
+ patternlab.build(false);
8
+ cb();
9
+ });
10
+
11
+ gulp.task('patternlab:version', function(){
12
+ var patternlab = patternlab_engine();
13
+ patternlab.version();
14
+ })
15
+
16
+ gulp.task('patternlab:only_patterns', ['clean'], function(){
17
+ var patternlab = patternlab_engine();
18
+ patternlab.build_patterns_only(false);
19
+ })
20
+
21
+ gulp.task('patternlab:help', function(){
22
+ var patternlab = patternlab_engine();
23
+ patternlab.help();
24
+ })
25
+
26
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Heroku-Patterns - v0.2.0 - 2016
3
+ *
4
+ * , and the web community.
5
+ * Licensed under the license.
6
+ *
7
+ * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
8
+ *
9
+ **/(function () {
10
+ "use strict";
11
+
12
+ var pseudopattern_hunter = function(){
13
+
14
+ function findpseudopatterns(currentPattern, patternlab){
15
+
16
+ var glob = require('glob'),
17
+ fs = require('fs-extra'),
18
+ pa = require('./pattern_assembler'),
19
+ lh = require('./lineage_hunter'),
20
+ of = require('./object_factory'),
21
+ mustache = require('mustache');
22
+
23
+ var pattern_assembler = new pa();
24
+ var lineage_hunter = new lh();
25
+
26
+ //look for a pseudo pattern by checking if there is a file containing same name, with ~ in it, ending in .json
27
+ var needle = currentPattern.subdir + '/' + currentPattern.fileName + '~*.json';
28
+ var pseudoPatterns = glob.sync(needle, {
29
+ cwd: 'source/_patterns/', //relative to gruntfile
30
+ debug: false,
31
+ nodir: true,
32
+ });
33
+
34
+ if(pseudoPatterns.length > 0){
35
+
36
+ for(var i = 0; i < pseudoPatterns.length; i++){
37
+
38
+ if(patternlab.config.debug){
39
+ console.log('found pseudoPattern variant of ' + currentPattern.key);
40
+ }
41
+
42
+ //we want to do everything we normally would here, except instead head the pseudoPattern data
43
+ var variantFileData = fs.readJSONSync('source/_patterns/' + pseudoPatterns[i]);
44
+
45
+ //extend any existing data with variant data
46
+ variantFileData = pattern_assembler.merge_data(variantFileData, currentPattern.jsonFileData);
47
+
48
+ var variantName = pseudoPatterns[i].substring(pseudoPatterns[i].indexOf('~') + 1).split('.')[0];
49
+ var patternVariant = new of.oPattern(currentPattern.subdir, currentPattern.fileName + '-' + variantName + '.mustache', variantFileData);
50
+
51
+ //see if this file has a state
52
+ pattern_assembler.setPatternState(patternVariant, patternlab);
53
+
54
+ //use the same template as the non-variant
55
+ patternVariant.template = currentPattern.template;
56
+ patternVariant.extendedTemplate = currentPattern.extendedTemplate;
57
+
58
+ //find pattern lineage
59
+ lineage_hunter.find_lineage(patternVariant, patternlab);
60
+
61
+ //add to patternlab object so we can look these up later.
62
+ pattern_assembler.addPattern(patternVariant, patternlab);
63
+ }
64
+ }
65
+
66
+ }
67
+
68
+ return {
69
+ find_pseudopatterns: function(pattern, patternlab){
70
+ findpseudopatterns(pattern, patternlab);
71
+ }
72
+ };
73
+
74
+ };
75
+
76
+ module.exports = pseudopattern_hunter;
77
+
78
+ }());
data/config.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "patterns" : {
3
+ "source" : "./source/_patterns/",
4
+ "public" : "./public/patterns/"
5
+ },
6
+ "ignored-extensions" : ["scss", "DS_Store", "less"],
7
+ "ignored-directories" : ["scss"],
8
+ "debug": false,
9
+ "ishControlsVisible": {
10
+ "s": true,
11
+ "m": true,
12
+ "l": true,
13
+ "full": true,
14
+ "random": true,
15
+ "disco": true,
16
+ "hay": true,
17
+ "mqs": true,
18
+ "find": true,
19
+ "views-all": true,
20
+ "views-annotations": true,
21
+ "views-code": true,
22
+ "views-new": true,
23
+ "tools-all": true,
24
+ "tools-sync": true,
25
+ "tools-shortcuts": true,
26
+ "tools-docs": true
27
+ },
28
+ "patternStates": {
29
+ "homepage-emergency" : "inprogress"
30
+ },
31
+ "patternExportKeys": [],
32
+ "patternExportDirectory": "./pattern_exports/",
33
+ "baseurl" : ""
34
+ }
@@ -0,0 +1,225 @@
1
+ ## Heroku WWW Marketing Pattern Lab
2
+
3
+ This style guide uses [Pattern Lab](http://patternlab.io/). It combines platform-agnostic assets, like the Mustache-based patterns, the JavaScript-based viewer, and the self-contained webserver, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site.
4
+
5
+ ### Getting Started
6
+
7
+ 1. Run `npm install` from the command line
8
+ 2. Run `gulp` or `gulp serve` from the command line
9
+
10
+ This creates all patterns, the styleguide, and the pattern lab site. `gulp serve` will have BrowserSync spin up and serve the files.
11
+
12
+ ### Command Line Interface
13
+
14
+ The following are gulp task arguments you may execute:
15
+
16
+ ##### `patternlab`
17
+ With no arguments, patternlab runs the full builder, compiling patterns, and constructing the front-end site.
18
+
19
+ ##### `patternlab:only_patterns`
20
+ Compile the patterns only, outputting to ./public/patterns
21
+
22
+ ##### `patternlab:v`
23
+ Retrieve the version of patternlab-node you have installed
24
+
25
+ ##### `patternlab:help`
26
+ Get more information about patternlab-node, pattern lab in general, and where to report issues.
27
+
28
+ ##### Nav Bar Controls
29
+ If you don't have a need for some of the nav-bar tools in the Pattern Lab frontend, you can turn them off in `config.json`.
30
+
31
+ The current selection is as follows.
32
+
33
+ ```
34
+ "ishControlsVisible": {
35
+ "s": true,
36
+ "m": true,
37
+ "l": true,
38
+ "full": true,
39
+ "random": true,
40
+ "disco": true,
41
+ "hay": true,
42
+ "mqs": false,
43
+ "find": false,
44
+ "views-all": true,
45
+ "views-annotations": true,
46
+ "views-code": true,
47
+ "views-new": true,
48
+ "tools-all": true,
49
+ "tools-follow": false,
50
+ "tools-reload": false,
51
+ "tools-shortcuts": false,
52
+ "tools-docs": true
53
+ }
54
+ ```
55
+ ##### Pattern States
56
+ You can set the state of a pattern by including it in `config.json` too. The out of the box styles are in progress (orange), in review (yellow), and complete (green).
57
+ Pattern states should be lowercase and use hyphens where spaces are present.
58
+ ```
59
+ "patternStates": {
60
+ "colors" : "inprogress",
61
+ "fonts" : "inreview",
62
+ "three-up" : "complete"
63
+ }
64
+ ```
65
+
66
+ ##### Pattern Export
67
+ `config.json` also has two properties that work together to export completed patterns for use in a production environment. Provide an array of keys and an output directory. Pattern Lab doesn't ship with any pattern export keys, but the default directory is `"./pattern_exports/"` created inside the install directory.
68
+
69
+ ```
70
+ "patternExportKeys": ["molecules-primary-nav", "organisms-header", "organisms-header"],
71
+ "patternExportDirectory": "./pattern_exports/"
72
+ ```
73
+
74
+ Coupled with exported css (much easier to extract with existing tools like [grunt-contrib-copy](https://github.com/gruntjs/grunt-contrib-copy)), pattern export can help to maintain the relevancy of the design system by directly placing partials in a directory of your choosing.
75
+
76
+ ##### baseurl
77
+
78
+ If your instance of Pattern Lab lives in a subdirectory of your server, for instance on github pages (ex: yourusername.github.io/patterns-demo/), then add the baseurl here. The baseurl is everything after the hostname - ie: `patterns-demo`
79
+
80
+ ```
81
+ "baseurl" : "/patterns-demo"
82
+ ```
83
+
84
+ Default: blank
85
+
86
+ ##### excluding patterns
87
+
88
+ If you'd like to exclude an individual pattern you can do so by prepending the filename with an underscore, like: `_filename.mustache`
89
+
90
+ You can also exclude complete directories by prepending the directory name with an underscore, like: `/_experiment/...`
91
+
92
+ ##### Debug Mode
93
+ `patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets.
94
+
95
+ ##### Server &amp; BrowserSync
96
+ Running `gulp serve` will compile the Pattern Lab frontend and host it by default on <a href="http://localhost:3000">http://localhost:3000</a> via [BrowserSync](http://www.browsersync.io/docs/). After it starts, templates, `data.json`, and scss/css changes in your source code will be automatically injected into the page.
97
+
98
+ You'll notice that if you have this open across different browsers, we do our best to keep the frontend in sync, but there is a known issue with synced navigation using the main menu.
99
+
100
+ ### Advanced Pattern Library Features
101
+
102
+ ##### Pattern Parameters
103
+ Pattern parameters are a simple mechanism for replacing Mustache variables via attributes on a pattern partial tag rather than having to use a pattern-specific json file. They are especially useful when you want to supply distinct values for Mustache variables in a specific pattern partial instance that may be included multiple times in a molecule, template, or page.
104
+
105
+ The basic syntax is this:
106
+
107
+ ```
108
+ {{> molecules-single-comment(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}
109
+ ```
110
+
111
+ The attributes listed in the pattern parameters should match Mustache variable names in your pattern. The values listed for each attribute will replace the Mustache variables. Again, pattern parameters are a simple find and replace of Mustache variables with the supplied values.
112
+
113
+ Pattern parameters **do not** currently support the following:
114
+
115
+ * sub-lists (e.g. iteration of a section),
116
+ * and the use of long strings of text can be unwieldy
117
+ * nested properties within the parameter data, such as `{{> molecules-single-comment(foo.bar: 'baz') }}`
118
+
119
+ You can read the full documentation on pattern parameters here: [Using Pattern Parameters](http://patternlab.io/docs/pattern-parameters.html)
120
+
121
+ ##### Pseudo-Patterns
122
+ Pseudo-patterns are meant to give developers the ability to build multiple and unique **rendered** patterns off of one base pattern and its mark-up while giving them control over the data that is injected into the base pattern. This feature is especially useful when developing template- and page-style patterns.
123
+
124
+ Pseudo-patterns are, essentially, the pattern-specific JSON files that would accompany a pattern. Rather than require a Mustache pattern, though, pseudo-patterns are hinted so a developer can reference a shared pattern. The basic syntax:
125
+
126
+ `patternName~pseudoPatternName.json`
127
+
128
+ The tilde, `~`, and JSON extension denotes that this is a pseudo-pattern. `patternName` is the parent pattern that will be used when rendering the pseudo-pattern. `patternName` and `pseudoPatternName` are combined when adding the pseudo-pattern to the navigation.
129
+
130
+ The JSON file itself works exactly like the [pattern-specific JSON file](http://patternlab.io/docs/data-pattern-specific.html). It has the added benefit that the pseudo-pattern will also import any values from the parent pattern's pattern-specific JSON file. Here is an example (which ships with the package) where we want to show an emergency notification on our homepage template. Our `03-templates/` directory looks like this:
131
+
132
+ ```
133
+ 00-homepage.mustache
134
+ 01-blog.mustache
135
+ 02-article.mustache
136
+ ```
137
+
138
+ Our `00-homepage.mustache` template might look like this:
139
+
140
+ ```
141
+ <div id="main-container">
142
+ {{# emergency }}
143
+ <div class="emergency">Oh Noes! Emergency!</div>
144
+ {{/ emergency }}
145
+ { ...a bunch of other content... }
146
+ </div>
147
+ ```
148
+
149
+ If our `_data.json` file doesn't give a value for `emergency` that section will never show up when `00-homepage.mustache` is rendered.
150
+
151
+ We want to show both the regular and emergency states of the homepage but we don't want to duplicate the entire `00-homepage.mustache` template. That would be a maintenance nightmare. So let's add our pseudo-pattern:
152
+
153
+ ```
154
+ 00-homepage.mustache
155
+ 00-homepage~emergency.json
156
+ 01-blog.mustache
157
+ 02-article.mustache
158
+ ```
159
+
160
+ In our pseudo-pattern, `00-homepage~emergency.json`, we add our `emergency` attribute:
161
+
162
+ ```
163
+ {
164
+ "emergency": true
165
+ }
166
+ ```
167
+
168
+ Now when we generate our site we'll have our homepage template rendered twice. Once as the regular template and once as a pseudo-pattern showing the emergency section. Note that the pseudo-pattern will show up in our navigation as `Homepage Emergency`.
169
+
170
+ ##### Pattern Linking
171
+ You can build patterns that link to one another to help simulate using a real website. This is especially useful when working with the Pages and Templates pattern types. The basic format is:
172
+
173
+ `{{ link.pattern-name }}`
174
+
175
+ For example, if you wanted to add a link to the `home page` template from your `blog` template you could write the following:
176
+
177
+ `<a href="{{ link.templates-homepage }}">Home</a>`
178
+
179
+ This would compile to:
180
+
181
+ `<a href="/patterns/templates-homepage/templates-homepage.html">Home</a>`
182
+
183
+ As you can see, it's a much easier way of linking patterns to one another.
184
+
185
+ ===
186
+
187
+ ## Working with Patterns
188
+
189
+ (The following documentation is built for the PHP version of Pattern Lab, but most applies to the node version too. If you find omissions or mistakes please open an issue.)
190
+
191
+ Patterns are the core element of Pattern Lab. Understanding how they work is the key to getting the most out of the system. Patterns use [Mustache](http://mustache.github.io/) so please read [Mustache's docs](http://mustache.github.io/mustache.5.html) as well.
192
+
193
+ * [How Patterns Are Organized](http://patternlab.io/docs/pattern-organization.html)
194
+ * [Adding New Patterns](http://patternlab.io/docs/pattern-add-new.html)
195
+ * [Reorganizing Patterns](http://patternlab.io/docs/pattern-reorganizing.html)
196
+ * [Including One Pattern Within Another via Partials](http://patternlab.io/docs/pattern-including.html)
197
+ * [Managing Assets for a Pattern: JavaScript, images, CSS, etc.](http://patternlab.io/docs/pattern-managing-assets.html)
198
+ * [Modifying the Pattern Header and Footer](http://patternlab.io/docs/pattern-header-footer.html)
199
+ * [Using Pattern Parameters](http://patternlab.io/docs/pattern-parameters.html)
200
+ * [Using Pattern State](http://patternlab.io/docs/pattern-states.html)
201
+ * ["Hiding" Patterns in the Navigation](http://patternlab.io/docs/pattern-hiding.html)
202
+ * [Adding Annotations](http://patternlab.io/docs/pattern-adding-annotations.html)
203
+ * [Viewing Patterns on a Mobile Device](http://patternlab.io/docs/pattern-mobile-view.html)
204
+
205
+ ## Creating & Working With Dynamic Data for a Pattern
206
+
207
+ The Node version of Pattern Lab utilizes Mustache as the template language for patterns. In addition to allowing for the [inclusion of one pattern within another](http://patternlab.io/docs/pattern-including.html) it also gives pattern developers the ability to include variables. This means that attributes like image sources can be centralized in one file for easy modification across one or more patterns. The Node version of Pattern Lab uses a JSON file, `source/_data/data.json`, to centralize many of these attributes.
208
+
209
+ * [Introduction to JSON & Mustache Variables](http://patternlab.io/docs/data-json-mustache.html)
210
+ * [Overriding the Central `data.json` Values with Pattern-specific Values](http://patternlab.io/docs/data-pattern-specific.html)
211
+ * [Linking to Patterns with Pattern Lab's Default `link` Variable](http://patternlab.io/docs/data-link-variable.html)
212
+ * [Creating Lists with Pattern Lab's Default `listItems` Variable](http://patternlab.io/docs/data-listitems.html)
213
+
214
+ ## Using Pattern Lab's Advanced Features
215
+
216
+ By default, the Pattern Lab assets can be manually generated and the Pattern Lab site manually refreshed but who wants to waste time doing that? Here are some ways that Pattern Lab can make your development workflow a little smoother:
217
+
218
+ * [Watching for Changes and Auto-Regenerating Patterns](http://patternlab.io/docs/advanced-auto-regenerate.html) - Node version coming soon
219
+ * [Auto-Reloading the Browser Window When Changes Are Made](http://patternlab.io/docs/advanced-reload-browser.html) - Node version coming soon
220
+ * [Multi-browser & Multi-device Testing with Page Follow](http://patternlab.io/docs/advanced-page-follow.html)
221
+ * [Keyboard Shortcuts](http://patternlab.io/docs/advanced-keyboard-shortcuts.html)
222
+ * [Special Pattern Lab-specific Query String Variables ](http://patternlab.io/docs/pattern-linking.html)
223
+ * [Preventing the Cleaning of public/](http://patternlab.io/docs/advanced-clean-public.html) - Node version coming soon
224
+ * [Modifying the Pattern Lab Nav](http://patternlab.io/docs/advanced-pattern-lab-nav.html) - Node version coming soon
225
+ * [Editing the config.ini Options](http://patternlab.io/docs/advanced-config-options.html) - Node version coming soon
data/favicon.ico ADDED
Binary file
data/gulpfile.js ADDED
@@ -0,0 +1,148 @@
1
+ 'use strict'
2
+
3
+ var pkg = require('./package.json'),
4
+ gulp = require('gulp'),
5
+ eol = require('os').EOL,
6
+ del = require('del'),
7
+ strip_banner = require('gulp-strip-banner'),
8
+ header = require('gulp-header'),
9
+ nodeunit = require('gulp-nodeunit'),
10
+ bourbon = require('node-bourbon'),
11
+ neat = require('node-neat'),
12
+ sass = require('gulp-sass'),
13
+ browserSync = require('browser-sync').create();
14
+
15
+ require('gulp-load')(gulp);
16
+ var banner = [ '/** ',
17
+ ' * <%= pkg.name %> - v<%= pkg.version %> - <%= today %>',
18
+ ' * ',
19
+ ' * <%= pkg.author %>, and the web community.',
20
+ ' * Licensed under the <%= pkg.license %> license.',
21
+ ' * ',
22
+ ' * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.',
23
+ ' * ', ' **/'].join(eol);
24
+
25
+ //load patternlab-node tasks
26
+ gulp.loadTasks(__dirname+'/builder/patternlab_gulp.js');
27
+
28
+ //clean patterns dir
29
+ gulp.task('clean', function(cb){
30
+ del.sync(['./public/patterns/*'], {force: true});
31
+ cb();
32
+ })
33
+
34
+ //build the banner
35
+ gulp.task('banner', function(){
36
+ return gulp.src([
37
+ './builder/patternlab.js',
38
+ './builder/object_factory.js',
39
+ './builder/lineage_hunter.js',
40
+ './builder/media_hunter.js',
41
+ './builder/patternlab_grunt.js',
42
+ './builder/parameter_hunter.js',
43
+ './builder/pattern_exporter.js',
44
+ './builder/pattern_assembler.js',
45
+ './builder/pseudopattern_hunter.js',
46
+ './builder/list_item_hunter.js'
47
+ ])
48
+ .pipe(strip_banner())
49
+ .pipe(header( banner, {
50
+ pkg : pkg,
51
+ today : new Date().getFullYear() }
52
+ ))
53
+ .pipe(gulp.dest('./builder'));
54
+ })
55
+
56
+ //copy tasks
57
+ gulp.task('cp:js', function(){
58
+ return gulp.src('**/*.js', {cwd:'./source/js'})
59
+ .pipe(gulp.dest('./public/js'))
60
+ });
61
+ gulp.task('cp:img', function(){
62
+ return gulp.src(
63
+ [ '**/*.gif', '**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.svg' ],
64
+ {cwd:'./source/images'} )
65
+ .pipe(gulp.dest('./public/images'))
66
+ });
67
+ gulp.task('cp:font', function(){
68
+ return gulp.src(['*', '**/*' ],
69
+ {cwd:'./source/fonts'} )
70
+ .pipe(gulp.dest('./public/fonts'))
71
+ });
72
+ gulp.task('cp:data', function(){
73
+ return gulp.src('annotations.js', {cwd:'./source/_data'})
74
+ .pipe(gulp.dest('./public/data'))
75
+ })
76
+ gulp.task('cp:css', function(){
77
+ return gulp.src('./source/css/shibori.css')
78
+ .pipe(gulp.dest('./public/css'))
79
+ .pipe(browserSync.stream());
80
+ })
81
+
82
+ //server and watch tasks
83
+ gulp.task('connect', ['lab'], function(){
84
+ browserSync.init({
85
+ server: {
86
+ baseDir: './public/'
87
+ }
88
+ });
89
+ gulp.watch('./source/css/shibori.css', ['cp:css']);
90
+
91
+ //suggested watches if you use scss
92
+ gulp.watch('./source/css/**/*.scss', ['sass:style']);
93
+ gulp.watch('./public/styleguide/css/*.scss', ['sass:styleguide']);
94
+
95
+ gulp.watch([
96
+ './source/_patterns/**/*.mustache',
97
+ './source/_patterns/**/*.json',
98
+ './source/_data/*.json' ],
99
+ ['lab-pipe'], function(){
100
+ browserSync.reload();
101
+ });
102
+
103
+ })
104
+
105
+ //unit test
106
+ gulp.task('nodeunit', function(){
107
+ return gulp.src('./test/**/*_tests.js')
108
+ .pipe(nodeunit());
109
+ })
110
+
111
+ // sass tasks, turn on if you want to use
112
+ gulp.task('sass:style', function(){
113
+ return gulp.src('./source/css/*.scss')
114
+ .pipe(sass({
115
+ outputStyle: 'expanded',
116
+ precision: 8,
117
+ includePaths: neat.includePaths
118
+ }))
119
+ .pipe(gulp.dest('./public/css'))
120
+ .pipe(browserSync.stream());
121
+ })
122
+ gulp.task('sass:styleguide', function(){
123
+ return gulp.src('./public/styleguide/css/*.scss')
124
+ .pipe(sass({
125
+ outputStyle: 'expanded',
126
+ precision: 8
127
+ }))
128
+ .pipe(gulp.dest('./public/styleguide/css'))
129
+ .pipe(browserSync.stream());
130
+ })
131
+
132
+ gulp.task('lab-pipe', ['lab'], function(cb){
133
+ cb();
134
+ browserSync.reload();
135
+ })
136
+
137
+ gulp.task('default', ['lab']);
138
+
139
+ gulp.task('assets', ['cp:js', 'cp:img', 'cp:font', 'cp:data', 'sass:style', 'sass:styleguide']);
140
+ gulp.task('prelab', ['clean', 'banner', 'assets']);
141
+ gulp.task('lab', ['prelab', 'patternlab'], function(cb){cb();});
142
+ gulp.task('patterns', ['patternlab:only_patterns']);
143
+ gulp.task('serve', ['lab', 'connect']);
144
+ gulp.task('serveprod', ['lab']);
145
+ gulp.task('travis', ['lab', 'nodeunit']);
146
+
147
+ gulp.task('version', ['patternlab:version']);
148
+ gulp.task('help', ['patternlab:help']);
data/index.js ADDED
@@ -0,0 +1,20 @@
1
+ var express = require('express');
2
+ var app = express();
3
+
4
+ app.set('port', (process.env.PORT || 5000));
5
+
6
+ app.use(express.static(__dirname + '/public'));
7
+
8
+ // views is directory for all template files
9
+ app.set('views', __dirname + '/public');
10
+ app.set('view engine', 'ejs');
11
+
12
+ app.get('/', function(request, response) {
13
+ response.render('index');
14
+ });
15
+
16
+ app.listen(app.get('port'), function() {
17
+ console.log('Node app is running on port', app.get('port'));
18
+ });
19
+
20
+
@@ -0,0 +1,3 @@
1
+ module Shibori
2
+ VERSION = '1.0.0.beta1'
3
+ end
data/lib/shibori.rb ADDED
@@ -0,0 +1,11 @@
1
+ class Shibori
2
+ class Railtie < Rails::Railtie
3
+ initializer 'shibori' do
4
+ Rails.configuration.assets.paths += [
5
+ File.expand_path('../../source/css', __FILE__),
6
+ File.expand_path('../../source/js', __FILE__),
7
+ File.expand_path('../../source/fonts', __FILE__),
8
+ ]
9
+ end
10
+ end
11
+ end
data/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "Heroku-Patterns",
3
+ "description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
4
+ "version": "0.2.0",
5
+ "scripts": {
6
+ "start": "node index.js",
7
+ "postinstall": "gulp default"
8
+ },
9
+ "dependencies": {
10
+ "browser-sync": "^2.8.2",
11
+ "del": "^1.2.1",
12
+ "diveSync": "^0.2.1",
13
+ "ejs": "2.3.3",
14
+ "express": "^4.13.3",
15
+ "fs-extra": "^0.14.0",
16
+ "glob": "^4.3.5",
17
+ "gulp": "^3.8.8",
18
+ "gulp-copy": "0.0.2",
19
+ "gulp-header": "^1.0.5",
20
+ "gulp-load": "^0.1.1",
21
+ "gulp-nodeunit": "0.0.5",
22
+ "gulp-sass": "^2.0.4",
23
+ "gulp-strip-banner": "0.0.2",
24
+ "html-entities": "^1.1.1",
25
+ "mustache": "^1.0.0",
26
+ "node-bourbon": "^4.2.3",
27
+ "node-neat": "^1.7.2",
28
+ "owl.carousel": "^2.1.4"
29
+ },
30
+ "keywords": [
31
+ "Pattern Lab",
32
+ "Atomic Web Design",
33
+ "Node",
34
+ "Grunt",
35
+ "Javascript"
36
+ ],
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git://github.com/heroku/www-patterns.git"
40
+ },
41
+ "engines": {
42
+ "node": ">=0.1"
43
+ }
44
+ }