docks_theme_api 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +15 -0
  2. data/.babelrc +4 -0
  3. data/.editorconfig +8 -0
  4. data/.eslintrc +115 -0
  5. data/.gitignore +24 -0
  6. data/.rubocop.yml +20 -0
  7. data/.travis.yml +16 -0
  8. data/Gemfile +4 -0
  9. data/README.md +5 -0
  10. data/Rakefile +3 -0
  11. data/assets/images/icons.svg +63 -0
  12. data/assets/scripts/coffeescript/pattern_library_helpers.coffee +8 -0
  13. data/assets/scripts/javascript/pattern_library_helpers.js +11 -0
  14. data/assets/scripts/pattern_library.js +10380 -0
  15. data/assets/scripts/pattern_library_demo.js +0 -0
  16. data/assets/styles/less/pattern-library-helpers.less +103 -0
  17. data/assets/styles/pattern-library-demo.css +1882 -0
  18. data/assets/styles/pattern-library.css +1882 -0
  19. data/assets/styles/sass/pattern-library-helpers.sass +90 -0
  20. data/assets/styles/scss/pattern-library-helpers.scss +99 -0
  21. data/assets/styles/stylus/pattern-library-helpers.styl +90 -0
  22. data/assets/templates/erb/demo.erb +26 -0
  23. data/assets/templates/erb/layouts/demo.erb +17 -0
  24. data/assets/templates/erb/layouts/pattern.erb +76 -0
  25. data/assets/templates/erb/partials/sidebar.erb +124 -0
  26. data/assets/templates/erb/partials/symbols/class.erb +1 -0
  27. data/assets/templates/erb/partials/symbols/demo.erb +40 -0
  28. data/assets/templates/erb/partials/symbols/factory.erb +70 -0
  29. data/assets/templates/erb/partials/symbols/function.erb +103 -0
  30. data/assets/templates/erb/partials/symbols/mixin.erb +62 -0
  31. data/assets/templates/erb/partials/symbols/variable.erb +59 -0
  32. data/assets/templates/erb/pattern.erb +102 -0
  33. data/assets/templates/haml/demo.haml +14 -0
  34. data/assets/templates/haml/layouts/demo.haml +6 -0
  35. data/assets/templates/haml/layouts/pattern.haml +38 -0
  36. data/assets/templates/haml/partials/sidebar.haml +68 -0
  37. data/assets/templates/haml/partials/symbols/class.haml +1 -0
  38. data/assets/templates/haml/partials/symbols/demo.haml +23 -0
  39. data/assets/templates/haml/partials/symbols/factory.haml +38 -0
  40. data/assets/templates/haml/partials/symbols/function.haml +54 -0
  41. data/assets/templates/haml/partials/symbols/mixin.haml +31 -0
  42. data/assets/templates/haml/partials/symbols/variable.haml +22 -0
  43. data/assets/templates/haml/pattern.haml +54 -0
  44. data/assets/templates/slim/demo.slim +24 -0
  45. data/assets/templates/slim/layouts/demo.slim +5 -0
  46. data/assets/templates/slim/layouts/pattern.slim +48 -0
  47. data/assets/templates/slim/partials/sidebar.slim +112 -0
  48. data/assets/templates/slim/partials/symbols/class.slim +1 -0
  49. data/assets/templates/slim/partials/symbols/demo.slim +30 -0
  50. data/assets/templates/slim/partials/symbols/factory.slim +57 -0
  51. data/assets/templates/slim/partials/symbols/function.slim +81 -0
  52. data/assets/templates/slim/partials/symbols/mixin.slim +45 -0
  53. data/assets/templates/slim/partials/symbols/variable.slim +35 -0
  54. data/assets/templates/slim/pattern.slim +63 -0
  55. data/docks_config.rb +32 -0
  56. data/docks_theme_api.gemspec +37 -0
  57. data/gulpfile.js +88 -0
  58. data/karma.conf.js +6 -0
  59. data/lib/docks_theme_api/components/base_component.rb +99 -0
  60. data/lib/docks_theme_api/components/code_block_component.rb +10 -0
  61. data/lib/docks_theme_api/components/popover_component.rb +15 -0
  62. data/lib/docks_theme_api/components/table_component.rb +34 -0
  63. data/lib/docks_theme_api/components/tablist_component.rb +11 -0
  64. data/lib/docks_theme_api/components.rb +21 -0
  65. data/lib/docks_theme_api/helpers/ui_helper.rb +69 -0
  66. data/lib/docks_theme_api/theme.rb +21 -0
  67. data/lib/docks_theme_api.rb +1 -0
  68. data/package.json +60 -0
  69. data/source/behaviors/filterable/filterable.coffee +353 -0
  70. data/source/behaviors/filterable/filterable.js +0 -0
  71. data/source/behaviors/filterable/filterable.scss +34 -0
  72. data/source/behaviors/filterable/package.json +3 -0
  73. data/source/behaviors/index.js +0 -0
  74. data/source/components/avatar/avatar.erb +20 -0
  75. data/source/components/avatar/avatar.js +142 -0
  76. data/source/components/avatar/avatar.scss +200 -0
  77. data/source/components/avatar/avatar_container.erb +13 -0
  78. data/source/components/avatar/package.json +3 -0
  79. data/source/components/avatar/spec/avatar_spec.js +81 -0
  80. data/source/components/badge/badge.scss +158 -0
  81. data/source/components/button/button.scss +213 -0
  82. data/source/components/card/card.scss +32 -0
  83. data/source/components/code_block/code-block.scss +353 -0
  84. data/source/components/code_block/code_block.erb +95 -0
  85. data/source/components/code_block/code_block.js +444 -0
  86. data/source/components/code_block/package.json +3 -0
  87. data/source/components/code_block/spec/code_block_spec.js +10 -0
  88. data/source/components/demo/demo.js +244 -0
  89. data/source/components/demo/demo.scss +90 -0
  90. data/source/components/demo/package.json +3 -0
  91. data/source/components/exploded/exploded.erb +25 -0
  92. data/source/components/exploded/exploded.js +694 -0
  93. data/source/components/exploded/exploded.scss +166 -0
  94. data/source/components/exploded/package.json +3 -0
  95. data/source/components/field/field.js +24 -0
  96. data/source/components/field/field.scss +101 -0
  97. data/source/components/field/package.json +3 -0
  98. data/source/components/header/header.scss +33 -0
  99. data/source/components/iframe/iframe.erb +12 -0
  100. data/source/components/iframe/iframe.js +381 -0
  101. data/source/components/iframe/package.json +3 -0
  102. data/source/components/index.js +37 -0
  103. data/source/components/inline_group/inline-group.scss +14 -0
  104. data/source/components/internal_link/internal_link.js +49 -0
  105. data/source/components/internal_link/package.json +3 -0
  106. data/source/components/list/list.scss +230 -0
  107. data/source/components/modal/modal.coffee +84 -0
  108. data/source/components/modal/modal.erb +19 -0
  109. data/source/components/modal/modal.js +0 -0
  110. data/source/components/modal/modal.scss +57 -0
  111. data/source/components/modal/package.json +3 -0
  112. data/source/components/notice/notice.scss +48 -0
  113. data/source/components/popover/package.json +3 -0
  114. data/source/components/popover/popover.coffee +562 -0
  115. data/source/components/popover/popover.erb +21 -0
  116. data/source/components/popover/popover.js +0 -0
  117. data/source/components/popover/popover.scss +139 -0
  118. data/source/components/range/range.scss +78 -0
  119. data/source/components/resizable/package.json +3 -0
  120. data/source/components/resizable/resizable.erb +30 -0
  121. data/source/components/resizable/resizable.js +250 -0
  122. data/source/components/resizable/resizable.scss +245 -0
  123. data/source/components/resizable/size_buttons.js +249 -0
  124. data/source/components/scroll_container/package.json +3 -0
  125. data/source/components/scroll_container/scroll-container.scss +4 -0
  126. data/source/components/scroll_container/scroll_container.js +24 -0
  127. data/source/components/section/section.scss +99 -0
  128. data/source/components/select/package.json +3 -0
  129. data/source/components/select/select.erb +21 -0
  130. data/source/components/select/select.js +35 -0
  131. data/source/components/select/select.scss +163 -0
  132. data/source/components/table/package.json +3 -0
  133. data/source/components/table/table.erb +16 -0
  134. data/source/components/table/table.js +351 -0
  135. data/source/components/table/table.scss +236 -0
  136. data/source/components/tablist/package.json +3 -0
  137. data/source/components/tablist/tablist.erb +13 -0
  138. data/source/components/tablist/tablist.js +246 -0
  139. data/source/components/tablist/tablist.scss +191 -0
  140. data/source/components/tablist/tablist_panel.erb +14 -0
  141. data/source/components/tablist/tablist_tab.erb +20 -0
  142. data/source/components/toggle/package.json +3 -0
  143. data/source/components/toggle/toggle.erb +11 -0
  144. data/source/components/toggle/toggle.js +211 -0
  145. data/source/components/toggle/toggle_container.erb +30 -0
  146. data/source/components/vertical_spacer/vertical-spacer.scss +3 -0
  147. data/source/components/vertical_stack/vertical-stack.scss +19 -0
  148. data/source/components/xray/package.json +3 -0
  149. data/source/components/xray/xray.erb +50 -0
  150. data/source/components/xray/xray.js +123 -0
  151. data/source/components/xray/xray.scss +79 -0
  152. data/source/foundation/app/app.js +15 -0
  153. data/source/foundation/app/package.json +3 -0
  154. data/source/pattern-library-demo.scss +13 -0
  155. data/source/pattern-library.scss +13 -0
  156. data/source/pattern_library.js +8 -0
  157. data/source/pattern_library_demo.js +8 -0
  158. data/source/structures/index.js +11 -0
  159. data/source/structures/sidebar/package.json +3 -0
  160. data/source/structures/sidebar/sidebar.js +69 -0
  161. data/source/structures/sidebar/sidebar.scss +79 -0
  162. data/source/utilities/builder/builder.js +138 -0
  163. data/source/utilities/builder/package.json +3 -0
  164. data/source/utilities/client/client.js +7 -0
  165. data/source/utilities/client/package.json +3 -0
  166. data/source/utilities/colors/colors.scss +112 -0
  167. data/source/utilities/defaults/defaults.scss +38 -0
  168. data/source/utilities/dom_cache/dom_cache.js +24 -0
  169. data/source/utilities/dom_cache/package.json +3 -0
  170. data/source/utilities/events/events.js +25 -0
  171. data/source/utilities/events/package.json +3 -0
  172. data/source/utilities/font_sizes/font-sizes.scss +85 -0
  173. data/source/utilities/foundation/a11y.scss +10 -0
  174. data/source/utilities/foundation/base.scss +29 -0
  175. data/source/utilities/foundation/icon.scss +114 -0
  176. data/source/utilities/foundation/layout.scss +67 -0
  177. data/source/utilities/foundation/page.scss +39 -0
  178. data/source/utilities/foundation/type.scss +208 -0
  179. data/source/utilities/functions/functions.scss +127 -0
  180. data/source/utilities/keycodes/keycodes.js +23 -0
  181. data/source/utilities/keycodes/package.json +3 -0
  182. data/source/utilities/markup/markup.js +90 -0
  183. data/source/utilities/markup/package.json +3 -0
  184. data/source/utilities/media/media.scss +172 -0
  185. data/source/utilities/mixins/mixins.scss +89 -0
  186. data/source/utilities/naming_convention/naming_convention.js +3 -0
  187. data/source/utilities/naming_convention/package.json +3 -0
  188. data/source/utilities/numbers/numbers.js +14 -0
  189. data/source/utilities/numbers/package.json +3 -0
  190. data/source/utilities/painting/package.json +3 -0
  191. data/source/utilities/painting/painting.js +7 -0
  192. data/source/utilities/pattern/package.json +3 -0
  193. data/source/utilities/pattern/pattern.js +50 -0
  194. data/source/utilities/query_string/package.json +3 -0
  195. data/source/utilities/query_string/query_string.js +24 -0
  196. data/source/utilities/template/package.json +3 -0
  197. data/source/utilities/template/template.js +10 -0
  198. data/source/utilities/text_range/package.json +3 -0
  199. data/source/utilities/text_range/text_range.js +30 -0
  200. data/source/utilities/ui_events/package.json +3 -0
  201. data/source/utilities/ui_events/ui_events.js +85 -0
  202. data/source/utilities/variables/variables.scss +18 -0
  203. data/source/utilities/z_indexes/z-indexes.scss +88 -0
  204. data/source/vendor/array_includes.js +28 -0
  205. data/source/vendor/highlight.js +1142 -0
  206. data/source/vendor/index.js +1 -0
  207. data/source/vendor/matrix.js +399 -0
  208. data/source/vendor/query_string.js +66 -0
  209. data/spec/assets/.eslintrc +9 -0
  210. data/spec/assets/spec_fixture.js +33 -0
  211. data/spec/assets/spec_helper.js +19 -0
  212. data/spec/lib/components/base_component_spec.rb +156 -0
  213. data/spec/lib/components_spec.rb +30 -0
  214. data/spec/lib/helpers/ui_helper_spec.rb +62 -0
  215. data/spec/lib/theme_spec.rb +25 -0
  216. data/spec/spec_helper.rb +15 -0
  217. data/tasks/gulp/.eslintrc +6 -0
  218. data/tasks/gulp/browser_sync.js +8 -0
  219. data/tasks/gulp/code_quality/scripts.js +10 -0
  220. data/tasks/gulp/config/index.js +116 -0
  221. data/tasks/gulp/minify/scripts.js +13 -0
  222. data/tasks/gulp/minify/styles.js +13 -0
  223. data/tasks/gulp/pattern_library/index.js +5 -0
  224. data/tasks/gulp/pattern_library/scripts.js +10 -0
  225. data/tasks/gulp/pattern_library/styles.js +10 -0
  226. data/tasks/gulp/scripts.js +8 -0
  227. data/tasks/gulp/spec/scripts.js +11 -0
  228. data/tasks/gulp/styles.js +17 -0
  229. data/tasks/gulp/utilities/babel/relative_require.js +22 -0
  230. data/tasks/gulp/utilities/babel/spec_helper.js +20 -0
  231. data/tasks/gulp/utilities/browserify_bundler.js +22 -0
  232. data/tasks/gulp/utilities/handle_errors.js +13 -0
  233. data/tasks/gulp/watch.js +9 -0
  234. data/tasks/rake/rspec.rake +7 -0
  235. data/tasks/rake/rubocop.rake +8 -0
  236. data/tasks/rake/templates.rake +50 -0
  237. metadata +470 -0
@@ -0,0 +1,103 @@
1
+ <div class="section" id="<%= function.symbol_id %>" data-private="<%= function.private? %>">
2
+ <header>
3
+ <div class="inline-group">
4
+ <div class="inline-group__item">
5
+ <h3 class="type type--heading type--heading-3">
6
+ <span class="type--code"><%= function.name %></span>
7
+ </h3>
8
+ </div>
9
+
10
+ <% if function.private? || function.deprecated %>
11
+ <div class="inline-group__item">
12
+ <div class="badge__container">
13
+ <% if function.private? %>
14
+ <span class="badge badge--standalone badge--secret">private</span>
15
+ <% end %>
16
+
17
+ <% if function.deprecated %>
18
+ <span class="badge badge--standalone badge--warning">deprecated</span>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ </header>
25
+
26
+ <div class="type-container"><%= function.description %></div>
27
+
28
+ <%= docks_code_block(code: function.signature, language: function.source.language_code, full_width?: true) %>
29
+
30
+ <% unless (aliases = function.fetch(:aliases, [])).empty? %>
31
+ <h4 class="type type--heading type--heading-4">Aliases</h4>
32
+
33
+ <% aliases.each do |an_alias| %>
34
+ <code class="type--code"><%= an_alias %></code>
35
+ <% end %>
36
+ <% end %>
37
+
38
+ <% unless (requires = function.fetch(:requires, [])).empty? %>
39
+ <h4 class="type type--heading type--heading-4">Requires</h4>
40
+
41
+ <% requires.each do |a_require| %>
42
+ <a href="<%= docks_path(a_require) %>"><code class="type--code"><%= a_require %></code></a>
43
+ <% end %>
44
+ <% end %>
45
+
46
+ <% unless (params = function.fetch(:params, [])).empty? %>
47
+ <h4 class="type type--heading type--heading-4">Parameters</h4>
48
+
49
+ <% params.each do |param| %>
50
+ <h5 class="type type--heading type--heading-5">
51
+ <span class="type--code"><%= param.name %></span>
52
+ <span class="badge"><%= param.types.first.name %><%= "[]" if param.types.first.array %></span>
53
+
54
+ <% if param.multiple %>
55
+ <span class="badge">Multiple</span>
56
+ <% end %>
57
+ </h5>
58
+
59
+ <div class="type-container type-container--small"><%= param.description %></div>
60
+
61
+ <% unless (properties = param.properties || []).empty? %>
62
+ <% docks_table do %>
63
+ <thead class="table__header">
64
+ <tr class="table__row">
65
+ <th class="table__cell">Name</th>
66
+ <th class="table__cell">Description</th>
67
+ <th class="table__cell">Types</th>
68
+ <th class="table__cell table__cell--centered">Default</th>
69
+ </tr>
70
+ </thead>
71
+
72
+ <tbody class="table__body">
73
+ <% properties.each do |property| %>
74
+ <tr class="table__row">
75
+ <td class="table__cell"><code class="type--code"><%= property.name %></code></td>
76
+ <td class="table__cell">
77
+ <div class="type-container type-container--small"><%= property.description %></div>
78
+ </td>
79
+ <td class="table__cell"><%= (type = property.types && property.types.first) ? "<span class='type--code'>#{type}</span>" : "Anything" %></td>
80
+ <td class="table__cell table__cell--centered"><%= (default = property.default) ? "<span class='type--code'>#{default}</span>" : "&mdash;" %></td>
81
+ </tr>
82
+ <% end %>
83
+ </tbody>
84
+ <% end %>
85
+ <% end %>
86
+ <% end %>
87
+ <% end %>
88
+
89
+ <h4 class="type type--heading type--heading-4">Returns</h4>
90
+ <% if return_types = function.returns && function.returns.types %>
91
+ <a href="<%= docks_path(return_types.first.name, language: function.source.language_code) %>"><code class="type--code"><%= return_types.first %></code></a>
92
+ <% else %>
93
+ <p class="type type--paragraph">Nothing</p>
94
+ <% end %>
95
+
96
+ <% unless (examples = function.fetch(:examples, [])).empty? %>
97
+ <h4 class="type type--heading type--heading-4"><%= "Example".pluralize(examples.length) %></h4>
98
+
99
+ <% examples.each do |example| %>
100
+ <%= docks_code_block code: example.code, language: example.language, condensed?: true %>
101
+ <% end %>
102
+ <% end %>
103
+ </div>
@@ -0,0 +1,62 @@
1
+ <div class="section" id="<%= mixin.symbol_id %>" data-private="<%= mixin.private? %>">
2
+ <header>
3
+ <div class="inline-group">
4
+ <div class="inline-group__item">
5
+ <h3 class="type type--heading type--heading-3">
6
+ <span class="type--code"><%= mixin.name %></span>
7
+ </h3>
8
+ </div>
9
+
10
+ <% if mixin.private? || mixin.deprecated %>
11
+ <div class="inline-group__item">
12
+ <div class="badge__container">
13
+ <% if mixin.private? %>
14
+ <span class="badge badge--standalone badge--secret">private</span>
15
+ <% end %>
16
+
17
+ <% if mixin.deprecated %>
18
+ <span class="badge badge--standalone badge--warning">deprecated</span>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ </header>
25
+
26
+ <div class="type-container"><%= mixin.description %></div>
27
+
28
+ <%= docks_code_block code: mixin.signature, language: mixin.source.language_code, id: "mixin--#{mixin.name}", full_width?: true %>
29
+
30
+ <% unless (aliases = mixin.fetch(:aliases, [])).empty? %>
31
+ <h4 class="type type--heading type--heading-4">Aliases</h4>
32
+
33
+ <% aliases.each do |an_alias| %>
34
+ <code class="type--code"><%= an_alias %></code>
35
+ <% end %>
36
+ <% end %>
37
+
38
+ <% unless (params = mixin.fetch(:params, [])).empty? %>
39
+ <h4 class="type type--heading type--heading-4">Parameters</h4>
40
+
41
+ <% params.each do |param| %>
42
+ <h5 class="type type--heading type--heading-5">
43
+ <span class="type--code"><%= param.name %></span>
44
+ <span class="badge"><%= param.types.first.name %><%= "[]" if param.types.first.array %></span>
45
+
46
+ <% if param.multiple %>
47
+ <span class="badge">Multiple</span>
48
+ <% end %>
49
+ </h5>
50
+
51
+ <div class="type-container type-container--small"><%= param.description %></div>
52
+ <% end %>
53
+ <% end %>
54
+
55
+ <% unless (examples = mixin.fetch(:examples, [])).empty? %>
56
+ <h4 class="type type--heading type--heading-4"><%= "Example".pluralize(examples.length) %></h4>
57
+
58
+ <% examples.each do |example| %>
59
+ <%= docks_code_block code: example.code, language: example.language, condensed?: true %>
60
+ <% end %>
61
+ <% end %>
62
+ </div>
@@ -0,0 +1,59 @@
1
+ <div class="section" id="<%= variable.symbol_id %>" data-private="<%= variable.private? %>">
2
+ <header>
3
+ <div class="inline-group">
4
+ <div class="inline-group__item">
5
+ <h3 class="type type--heading type--heading-3">
6
+ <span class="type--code"><%= variable.name %></span>
7
+ </h3>
8
+ </div>
9
+
10
+ <% if variable.private? || variable.deprecated %>
11
+ <div class="inline-group__item">
12
+ <div class="badge__container">
13
+ <% if variable.private? %>
14
+ <span class="badge badge--standalone badge--secret">private</span>
15
+ <% end %>
16
+
17
+ <% if variable.deprecated %>
18
+ <span class="badge badge--standalone badge--warning">deprecated</span>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ </header>
25
+
26
+ <div class="type-container"><%= variable.description %></div>
27
+
28
+ <% if type = variable.type %>
29
+ <h4 class="type type--heading type--heading-4">Type</h4>
30
+
31
+ <a href="<%= docks_path(type, language: variable.source.language_code) %>"><code class="type--code"><%= type %></code></a>
32
+ <% end %>
33
+
34
+ <% unless (used_by = variable.fetch(:used_by, [])).empty? %>
35
+ <h4 class="type type--heading type--heading-4">Used By</h4>
36
+
37
+ <% used_by.each do |user| %>
38
+ <a href="<%= docks_path(user, language: variable.source.language_code) %>"><code class="type--code"><%= user %></code></a>
39
+ <% end %>
40
+ <% end %>
41
+
42
+ <% { "properties" => "variable", "methods" => "function" }.each do |prop, partial| %>
43
+ <% unless (props = variable.send(prop.to_sym)).empty? %>
44
+ <h4 class="type type--heading type--heading-4"><%= prop.capitalize %></h4>
45
+
46
+ <% props.each do |a_prop| %>
47
+ <% locals = {} %>
48
+ <% locals[partial.to_sym] = a_prop %>
49
+
50
+ <%= render partial: "symbols/#{partial}", locals: locals %>
51
+ <% end %>
52
+ <% end %>
53
+ <% end %>
54
+
55
+ <% if value = variable.value %>
56
+ <h4 class="type type--heading type--heading-4">Value</h4>
57
+ <code class="type--code"><%= value %></code>
58
+ <% end %>
59
+ </div>
@@ -0,0 +1,102 @@
1
+ <% render_everything %>
2
+
3
+ <div class="content">
4
+ <% if deprecation = @pattern.deprecated %>
5
+ <div class="notice">
6
+ <h3 class="type type--heading type--heading-3">Deprecated as of <strong><%= deprecation.version %></strong></h3>
7
+ <div class="type-container"><%= deprecation.description %></div>
8
+ </div>
9
+ <% end %>
10
+
11
+ <pre><%#= @pattern.to_yaml %></pre>
12
+ <pre><%#= @pattern_library.to_yaml %></pre>
13
+
14
+ <% if description = @pattern.description %>
15
+ <div class="type-container">
16
+ <%= description %>
17
+ </div>
18
+ <% end %>
19
+ </div>
20
+
21
+ <% if @pattern.has_structure? && @pattern.has_behavior? %>
22
+ <% docks_tablist(size: :large, manage_url?: true) do |tablist| %>
23
+ <%= tablist.tab(text: "Structure", active?: true, id: "page__content__tab--markup", panel_id: "page__content--markup", icon: :code) %>
24
+ <%= tablist.tab(text: "Behavior", id: "page__content__tab--behavior", panel_id: "page__content--behavior", icon: :script) %>
25
+ <% end %>
26
+ <% end %>
27
+
28
+ <div class="tablist__panel-container">
29
+ <% docks_component("tablist:panel", active?: @pattern.has_structure?, id: "page__content--markup", tab_id: "page__content__tab--markup") do %>
30
+ <div id="symbols--structure" data-filter-items=".section">
31
+ <% @pattern.demos.each do |demo| %>
32
+ <%= render partial: "symbols/demo", locals: { demo: demo } %>
33
+ <% end %>
34
+
35
+ <% unless (variables = @pattern.variables(exclude: :script)).empty? %>
36
+ <div class="content content--extra-vertical-spacing">
37
+ <h2 class="type type--heading type--heading-2 type--heading-bordered">Variables</h2>
38
+
39
+ <% variables.each do |variable| %>
40
+ <%= render partial: "symbols/variable", locals: { variable: variable } %>
41
+ <% end %>
42
+ </div>
43
+ <% end %>
44
+
45
+ <% unless (functions = @pattern.functions(exclude: :script)).empty? %>
46
+ <div class="content content--extra-vertical-spacing">
47
+ <h2 class="type type--heading type--heading-2 type--heading-bordered">Functions</h2>
48
+
49
+ <% functions.each_with_index do |func, index| %>
50
+ <%= render partial: "symbols/function", locals: { function: func } %>
51
+ <% end %>
52
+ </div>
53
+ <% end %>
54
+
55
+ <% unless (mixins = @pattern.mixins(exclude: :script)).empty? %>
56
+ <div class="content content--extra-vertical-spacing">
57
+ <h2 class="type type--heading type--heading-2 type--heading-bordered">Mixins</h2>
58
+
59
+ <% mixins.each do |mixin| %>
60
+ <%= render partial: "symbols/mixin", locals: { mixin: mixin } %>
61
+ <% end %>
62
+ </div>
63
+ <% end %>
64
+ </div>
65
+ <% end %>
66
+
67
+ <% docks_component("tablist:panel", active?: !@pattern.has_structure?, id: "page__content--behavior", tab_id: "page__content__tab--behavior") do %>
68
+ <div id="symbols--behavior" data-filter-items=".section">
69
+ <% unless (factories = @pattern.factories(include: :script)).empty? %>
70
+ <% factories.each do |factory| %>
71
+ <%= render partial: "symbols/factory", locals: { factory: factory } %>
72
+ <% end %>
73
+ <% end %>
74
+
75
+ <% unless (classes = @pattern.classes(include: :script)).empty? %>
76
+ <% classes.each do |klass| %>
77
+ <%= render partial: "symbols/class", locals: { klass: klass } %>
78
+ <% end %>
79
+ <% end %>
80
+
81
+ <% unless (variables = @pattern.variables(include: :script)).empty? %>
82
+ <div class="content content--extra-vertical-spacing">
83
+ <h2 class="type type--heading type--heading-2 type--heading-bordered">Variables</h2>
84
+
85
+ <% variables.each do |variable| %>
86
+ <%= render partial: "symbols/variable", locals: { variable: variable } %>
87
+ <% end %>
88
+ </div>
89
+ <% end %>
90
+
91
+ <% unless (functions = @pattern.functions(include: :script)).empty? %>
92
+ <div class="content content--extra-vertical-spacing">
93
+ <h2 class="type type--heading type--heading-2 type--heading-bordered">Functions</h2>
94
+
95
+ <% functions.each do |func| %>
96
+ <%= render partial: "symbols/function", locals: { function: func } %>
97
+ <% end %>
98
+ </div>
99
+ <% end %>
100
+ </div>
101
+ <% end %>
102
+ </div>
@@ -0,0 +1,14 @@
1
+ .iframe{"data-iframe-id" => id}
2
+ .demo{"data-iframe-id" => id}
3
+ - if demo.kind_of?(Docks::Containers::Demo)
4
+ - demo_variations = [demo.component] + demo.joint_variations
5
+ - demo_variations.each do |variation|
6
+ - name = variation.name
7
+ %section.demo__section{"data-name" => name, id: "demo__section--#{name}"}
8
+ - unless demo_variations.length == 1
9
+ %header.demo__header
10
+ %h2.badge.badge--code= name
11
+ .content= variation.markup
12
+ - else
13
+ %section.demo__section
14
+ .content= demo
@@ -0,0 +1,6 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta{content: "text/html; charset=US-ASCII", "http-equiv" => "Content-Type"}/
5
+ %body
6
+ .wrapper= yield
@@ -0,0 +1,38 @@
1
+ %body
2
+ - render_everything
3
+ = stylesheet_link_tag "pattern-library"
4
+ = docks_icons
5
+ .page
6
+ .page__sidebar
7
+ = render "sidebar"
8
+ .page__content
9
+ .vertical-stack
10
+ .vertical-stack__item.vertical-stack__item--fixed
11
+ .page-header
12
+ .grid.grid--vertically-centered
13
+ .grid__item.grid__item--no-flex
14
+ %button.sidebar__toggler
15
+ %span.helper--visually-hidden Toggle Sidebar
16
+ .icon.icon--action.icon--hamburger
17
+ .icon--hamburger__slice
18
+ .grid__item
19
+ %h1.type.type--heading.type--heading-1= @pattern.title
20
+ - if has_github?
21
+ .popover__container
22
+ %button.docks-button.docks-button--dark
23
+ Github
24
+ %i.icon.icon--disclosure
25
+ - docks_popover do
26
+ .list
27
+ %a.list__item{href: "#{github_root_url}/issues/new?body=#{url_encode(github_issue_message)}", target: "_blank"} File an issue
28
+ .list__group
29
+ %h4.type.type--heading.type--heading-4 View source
30
+ - relative_pattern_files.each do |file|
31
+ %a.list__item.type--code{href: "#{github_url(file)}", target: "_blank"}= File.basename(file)
32
+ .vertical-stack__item
33
+ %main.scroll-container= yield
34
+ = docks_details_sheet
35
+ = docks_xray
36
+ :javascript
37
+ window.pattern = #{CGI.unescapeHTML(@pattern.to_json)};
38
+ = javascript_include_tag "pattern_library"
@@ -0,0 +1,68 @@
1
+ %body
2
+ %nav.sidebar
3
+ .vertical-stack
4
+ .vertical-stack__item.vertical-stack__item--fixed
5
+ %header.page-header
6
+ .grid.grid--vertically-centered
7
+ .grid__item
8
+ %label.label.helper--visually-hidden{for: "search"} Search
9
+ .field.field--text
10
+ .field__icon
11
+ = docks_icon(:search, size: :medium)
12
+ %input#search.field__input{"data-filter-attribute" => "contents", "data-filters" => "#list--patterns, #list--this-pattern", placeholder: "Search", type: "search"}/
13
+ .grid__item.grid__item--no-flex
14
+ .popover__container
15
+ = docks_icon :eye, size: :large, color: :gray_darker
16
+ - docks_popover do |popover|
17
+ - popover.pane do
18
+ .field.field--switch
19
+ %input#private-toggle.field__switch{"data-checked-value" => "true|false", "data-filter-attribute" => "data-private", "data-filters" => "#list--this-pattern, #symbols--structure, #symbols--behavior", type: "checkbox"}/
20
+ %label.label{for: "private-toggle"} Show private symbols
21
+ .vertical-stack__item
22
+ - unless @pattern.symbols.empty?
23
+ #list--this-pattern.list{"data-filter-items" => ".list__item"}
24
+ - symbol_contents = { "structure" => @pattern.has_structure?, "behavior" => @pattern.has_behavior? }
25
+ - has_both = symbol_contents["structure"] && symbol_contents["behavior"]
26
+ %h3.type.type--heading.type--heading-3 This Pattern
27
+ - %w(structure behavior).each do |group|
28
+ - if symbol_contents[group]
29
+ - if group == "structure" && !(demos = @pattern.demos).empty?
30
+ .list__group
31
+ %h4.type.type--heading.type--heading-4 Components
32
+ - demos.each do |demo|
33
+ %a.list__item.type--code{"data-private" => "#{demo.component.private?}", href: "##{demo.component.symbol_id}"}= demo.name
34
+ - if group == "behavior" && !(factories = @pattern.factories).empty?
35
+ .list__group
36
+ %h4.type.type--heading.type--heading-4 Factories
37
+ - factories.each do |factory|
38
+ %a.list__item.type--code{"data-private" => "#{factory.private?}", href: "##{factory.symbol_id}"}= factory.name
39
+ - factory.static_properties.each do |prop|
40
+ %a.list__item.list__item--indented.type--code{"data-private" => "#{prop.private?}", href: "##{prop.symbol_id}"}
41
+ \.#{prop.name}
42
+ - factory.static_methods.each do |meth|
43
+ %a.list__item.list__item--indented.type--code{"data-private" => "#{meth.private?}", href: "##{meth.symbol_id}"}
44
+ \.#{meth.name}()
45
+ - factory.instance_properties.each do |prop|
46
+ %a.list__item.list__item--indented.type--code{"data-private" => "#{prop.private?}", href: "##{prop.symbol_id}"}
47
+ \##{prop.name}
48
+ - factory.instance_methods.each do |meth|
49
+ %a.list__item.list__item--indented.type--code{"data-private" => "#{meth.private?}", href: "##{meth.symbol_id}"}
50
+ \##{meth.name}()
51
+ - %w(variable function mixin).each do |type|
52
+ - symbol_options = {}
53
+ - symbol_options[group == "behavior" ? :include : :exclude] = Docks::Types::Languages::SCRIPT
54
+ - symbols = @pattern.send(type.pluralize.to_sym, symbol_options)
55
+ - unless symbols.empty?
56
+ .list__group
57
+ %h4.type.type--heading.type--heading-4= type.pluralize.capitalize
58
+ - symbols.each do |symbol|
59
+ %a.list__item.type--code{"data-private" => "#{symbol.private?}", href: "##{symbol.symbol_id}"}= symbol.name
60
+ #list--patterns.list{"data-filter-items" => ".list__item"}
61
+ %h3.type.type--heading.type--heading-3 Library
62
+ - @pattern_library.groups do |group, patterns|
63
+ .list__group
64
+ %h4.type.type--heading.type--heading-4= group.pluralize
65
+ - patterns.sort { |one, two| one.name <=> two.name }.each do |pattern|
66
+ - active_pattern = pattern.name == @pattern.name
67
+ %a{class: "list__item#{" list__item--is-active" if active_pattern}", href: "#{active_pattern ? "javascript:" : docks.pattern_path(pattern.name)}"}
68
+ = pattern.title
@@ -0,0 +1 @@
1
+ = render(partial: "symbols/factory", locals: { factory: klass })
@@ -0,0 +1,23 @@
1
+ %body
2
+ %section.section{"data-private" => "#{demo.component.private?}", id: "#{demo.component.symbol_id}"}
3
+ %header.content
4
+ .grid
5
+ .grid__item
6
+ %h3.type.type--heading.type--heading-2
7
+ - if title = demo.component.title
8
+ = title
9
+ - else
10
+ %span.type--code= demo.component.name
11
+ .grid__item.grid__item--no-flex
12
+ .docks-button__container
13
+ .docks-button{"data-xray-trigger" => "#{demo.name}"} x-ray
14
+ - markup = render(inline: (demo.component.markup || demo.component.helper), layout: false)
15
+ - code_details = []
16
+ - code_details << { code: demo.component.helper, language: "erb", label: "Helper" } unless demo.component.helper.nil?
17
+ - code_details << { code: markup, language: "html", label: "Markup" }
18
+ - options = [demo.name].concat demo.joint_variations.map { |variant| variant.name }
19
+ = docks_code_block(code: code_details, hideable?: true, full_width?: true, hidden?: true, options: options, id: demo.name, demo: demo)
20
+ - if demo.component.description
21
+ .content
22
+ .type-container
23
+ = demo.component.description
@@ -0,0 +1,38 @@
1
+ .content.content--extra-vertical-spacing
2
+ .section{"data-private" => "#{factory.private?}", id: "#{factory.symbol_id}"}
3
+ %h2.type.type--heading.type--heading-2.type--heading-bordered
4
+ %span.type--code= factory.name
5
+ .type-container= factory.description
6
+ = docks_code_block(code: factory.signature, language: factory.source.language_code)
7
+ - unless (params = factory.fetch(:params, [])).empty?
8
+ %h4.type.type--heading.type--heading-4 Parameters
9
+ - params.each do |param|
10
+ %h5.type.type--heading.type--heading-5
11
+ %span.type--code= param.name
12
+ %span.badge= param.types.first
13
+ .type-container.type-container--small= param.description
14
+ - unless (properties = param.properties || []).empty?
15
+ - docks_table do
16
+ %thead.table__header
17
+ %tr.table__row
18
+ %th.table__cell Name
19
+ %th.table__cell Description
20
+ %th.table__cell Types
21
+ %th.table__cell.table__cell--centered Default
22
+ %tbody.table__body
23
+ - properties.each do |property|
24
+ %tr.table__row
25
+ %td.table__cell
26
+ %code.type--code= property.name
27
+ %td.table__cell
28
+ .type-container.type-container--small= property.description
29
+ %td.table__cell= (type = property.types.try(:first)) ? "<span class='type--code'>#{type}</span>".html_safe : "Anything"
30
+ %td.table__cell.table__cell--centered= (default = property.default) ? "<span class='type--code'>#{default}</span>".html_safe : "&mdash;".html_safe
31
+ - unless (examples = factory.fetch(:examples, [])).empty?
32
+ %h4.type.type--heading.type--heading-4= "Example".pluralize(examples.length)
33
+ - examples.each do |example|
34
+ = docks_code_block(code: example.code, language: example.language, condensed?: true)
35
+ - factory.properties.each do |property|
36
+ = render "docks/partials/variable", variable: property
37
+ - factory.methods.each do |method|
38
+ = render "docks/partials/function", function: method
@@ -0,0 +1,54 @@
1
+ %body
2
+ .section{"data-private" => "#{function.private?}", id: "#{function.symbol_id}"}
3
+ %header
4
+ .inline-group
5
+ .inline-group__item
6
+ %h3.type.type--heading.type--heading-3
7
+ %span.type--code= function.name
8
+ - if function.private? || function.deprecated
9
+ .inline-group__item
10
+ .badge__container
11
+ - if function.private?
12
+ %span.badge.badge--standalone.badge--secret private
13
+ - if function.deprecated
14
+ %span.badge.badge--standalone.badge--warning deprecated
15
+ .type-container= function.description
16
+ = docks_code_block code: function.signature, language: function.source.language_code, id: "function--#{function.name}", full_width?: true
17
+ - unless (aliases = function.fetch(:aliases, [])).empty?
18
+ %h4.type.type--heading.type--heading-4 Aliases
19
+ - aliases.each do |an_alias|
20
+ %code.type--code= an_alias
21
+ - unless (params = function.fetch(:params, [])).empty?
22
+ %h4.type.type--heading.type--heading-4 Parameters
23
+ - params.each do |param|
24
+ %h5.type.type--heading.type--heading-5
25
+ %span.type--code= param.name
26
+ %span.badge= param.types.first
27
+ .type-container.type-container--small= param.description
28
+ - unless (properties = param.properties || []).empty?
29
+ - docks_table do
30
+ %thead.table__header
31
+ %tr.table__row
32
+ %th.table__cell Name
33
+ %th.table__cell Description
34
+ %th.table__cell Types
35
+ %th.table__cell.table__cell--centered Default
36
+ %tbody.table__body
37
+ - properties.each do |property|
38
+ %tr.table__row
39
+ %td.table__cell
40
+ %code.type--code= property.name
41
+ %td.table__cell
42
+ .type-container.type-container--small= property.description
43
+ %td.table__cell= (type = !property.types && property.types.first) ? "<span class='type--code'>#{type}</span>" : "Anything"
44
+ %td.table__cell.table__cell--centered= (default = property.default) ? "<span class='type--code'>#{default}</span>" : "&mdash;"
45
+ %h4.type.type--heading.type--heading-4 Returns
46
+ - if return_types = function.returns && function.returns.types
47
+ %a{href: "#{docks_path(return_types.first, language: function.source.language_code)}"}
48
+ %code.type--code= return_types.first
49
+ - else
50
+ %p.type.type--paragraph Nothing
51
+ - unless (examples = function.fetch(:examples, [])).empty?
52
+ %h4.type.type--heading.type--heading-4= "Example".pluralize(examples.length)
53
+ - examples.each do |example|
54
+ = docks_code_block code: example.code, language: example.language, condensed?: true
@@ -0,0 +1,31 @@
1
+ %body
2
+ .section{"data-private" => "#{mixin.private?}", id: "#{mixin.symbol_id}"}
3
+ %header
4
+ .inline-group
5
+ .inline-group__item
6
+ %h3.type.type--heading.type--heading-3
7
+ %span.type--code= mixin.name
8
+ - if mixin.private? || mixin.deprecated
9
+ .inline-group__item
10
+ .badge__container
11
+ - if mixin.private?
12
+ %span.badge.badge--standalone.badge--secret private
13
+ - if mixin.deprecated
14
+ %span.badge.badge--standalone.badge--warning deprecated
15
+ .type-container= mixin.description
16
+ = docks_code_block code: mixin.signature, language: mixin.source.language_code, id: "mixin--#{mixin.name}", full_width?: true
17
+ - unless (aliases = mixin.fetch(:aliases, [])).empty?
18
+ %h4.type.type--heading.type--heading-4 Aliases
19
+ - aliases.each do |an_alias|
20
+ %code.type--code= an_alias
21
+ - unless (params = mixin.fetch(:params, [])).empty?
22
+ %h4.type.type--heading.type--heading-4 Parameters
23
+ - params.each do |param|
24
+ %h5.type.type--heading.type--heading-5
25
+ %span.type--code= param.name
26
+ %span.badge= param.types.first
27
+ .type-container.type-container--small= param.description
28
+ - unless (examples = mixin.fetch(:examples, [])).empty?
29
+ %h4.type.type--heading.type--heading-4= "Example".pluralize(examples.length)
30
+ - examples.each do |example|
31
+ = docks_code_block code: example.code, language: example.language, condensed?: true
@@ -0,0 +1,22 @@
1
+ %body
2
+ .section{"data-private" => "#{variable.private?}", id: "#{variable.symbol_id}"}
3
+ %header
4
+ .inline-group
5
+ .inline-group__item
6
+ %h3.type.type--heading.type--heading-3
7
+ %span.type--code= variable.name
8
+ - if variable.private? || variable.deprecated
9
+ .inline-group__item
10
+ .badge__container
11
+ - if variable.private?
12
+ %span.badge.badge--standalone.badge--secret private
13
+ - if variable.deprecated
14
+ %span.badge.badge--standalone.badge--warning deprecated
15
+ .type-container= variable.description
16
+ - if type = variable.type
17
+ %h4.type.type--heading.type--heading-4 Type
18
+ %a{href: "#{docks_path_to(type, language: variable.source.language_code)}"}
19
+ %code.type--code= type
20
+ - if value = variable.value
21
+ %h4.type.type--heading.type--heading-4 Value
22
+ %code.type--code= value