govuk_publishing_components 17.21.0 → 18.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (476) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/all_components.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -1
  4. data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
  5. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -1
  6. data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
  8. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +1 -1
  9. data/app/assets/stylesheets/component_guide/application.scss +5 -7
  10. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +1 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +5 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +3 -15
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +2 -2
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +28 -9
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +1 -13
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -1
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -1
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +3 -3
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +3 -3
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -1
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +18 -7
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -1
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -1
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +1 -1
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +6 -6
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +8 -3
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +6 -3
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +10 -3
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -1
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -1
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -3
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +17 -1
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +8 -6
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -1
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -1
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +5 -5
  53. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  54. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -2
  56. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
  57. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +2 -2
  58. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -2
  59. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -2
  60. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +2 -2
  61. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -2
  62. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +2 -2
  63. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
  64. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +2 -2
  65. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -1
  66. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -1
  67. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  68. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -1
  69. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
  70. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +4 -4
  71. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  72. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +2 -2
  73. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss +0 -4
  74. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +4 -1
  75. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +1 -1
  76. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +1 -1
  77. data/app/views/govuk_publishing_components/component_guide/index.html.erb +14 -12
  78. data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -1
  79. data/app/views/govuk_publishing_components/components/_button.html.erb +16 -2
  80. data/app/views/govuk_publishing_components/components/_character_count.html.erb +1 -1
  81. data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +1 -1
  82. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +5 -1
  83. data/app/views/govuk_publishing_components/components/_details.html.erb +3 -1
  84. data/app/views/govuk_publishing_components/components/_error_summary.html.erb +1 -1
  85. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -2
  86. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
  87. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +2 -2
  88. data/app/views/govuk_publishing_components/components/_tabs.html.erb +1 -1
  89. data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
  90. data/app/views/govuk_publishing_components/components/_title.html.erb +1 -1
  91. data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
  92. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +12 -0
  93. data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +1 -1
  94. data/app/views/govuk_publishing_components/components/docs/fieldset.yml +1 -1
  95. data/app/views/govuk_publishing_components/components/docs/label.yml +4 -1
  96. data/app/views/govuk_publishing_components/components/docs/table.yml +1 -0
  97. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
  98. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +2 -2
  99. data/config/initializers/assets.rb +3 -3
  100. data/config/locales/en.yml +0 -2
  101. data/lib/govuk_publishing_components/version.rb +1 -1
  102. data/node_modules/govuk-frontend/README.md +4 -9
  103. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +4 -5
  104. data/node_modules/govuk-frontend/{all-ie8.scss → govuk/all-ie8.scss} +0 -0
  105. data/node_modules/govuk-frontend/{all.js → govuk/all.js} +116 -63
  106. data/node_modules/govuk-frontend/{all.scss → govuk/all.scss} +0 -0
  107. data/node_modules/govuk-frontend/govuk/assets/fonts/bold-affa96571d-v2.woff +0 -0
  108. data/node_modules/govuk-frontend/govuk/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  109. data/node_modules/govuk-frontend/govuk/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  110. data/node_modules/govuk-frontend/govuk/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  111. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/favicon.ico +0 -0
  112. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-152x152.png +0 -0
  113. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-167x167.png +0 -0
  114. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-180x180.png +0 -0
  115. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon.png +0 -0
  116. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-crest-2x.png +0 -0
  117. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-crest.png +0 -0
  118. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-logotype-crown.png +0 -0
  119. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-mask-icon.svg +0 -0
  120. data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-opengraph-image.png +0 -0
  121. data/node_modules/govuk-frontend/{common.js → govuk/common.js} +0 -0
  122. data/node_modules/govuk-frontend/{components → govuk/components}/_all.scss +0 -0
  123. data/node_modules/govuk-frontend/{components → govuk/components}/accordion/README.md +0 -0
  124. data/node_modules/govuk-frontend/{components → govuk/components}/accordion/_accordion.scss +48 -28
  125. data/node_modules/govuk-frontend/{components → govuk/components}/accordion/accordion.js +0 -0
  126. data/node_modules/govuk-frontend/{components → govuk/components}/accordion/macro-options.json +8 -2
  127. data/node_modules/govuk-frontend/{components → govuk/components}/accordion/macro.njk +0 -0
  128. data/node_modules/govuk-frontend/{components → govuk/components}/accordion/template.njk +1 -3
  129. data/node_modules/govuk-frontend/{components → govuk/components}/back-link/README.md +0 -0
  130. data/node_modules/govuk-frontend/{components → govuk/components}/back-link/_back-link.scss +17 -9
  131. data/node_modules/govuk-frontend/{components → govuk/components}/back-link/macro-options.json +0 -0
  132. data/node_modules/govuk-frontend/{components → govuk/components}/back-link/macro.njk +0 -0
  133. data/node_modules/govuk-frontend/{components → govuk/components}/back-link/template.njk +0 -0
  134. data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/README.md +0 -0
  135. data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/_breadcrumbs.scss +10 -11
  136. data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/macro-options.json +0 -0
  137. data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/macro.njk +0 -0
  138. data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/template.njk +0 -0
  139. data/node_modules/govuk-frontend/{components → govuk/components}/button/README.md +0 -0
  140. data/node_modules/govuk-frontend/{components → govuk/components}/button/_button.scss +76 -46
  141. data/node_modules/govuk-frontend/{components → govuk/components}/button/button.js +168 -17
  142. data/node_modules/govuk-frontend/{components → govuk/components}/button/macro-options.json +0 -0
  143. data/node_modules/govuk-frontend/{components → govuk/components}/button/macro.njk +0 -0
  144. data/node_modules/govuk-frontend/govuk/components/button/template.njk +60 -0
  145. data/node_modules/govuk-frontend/{components → govuk/components}/character-count/README.md +0 -0
  146. data/node_modules/govuk-frontend/{components → govuk/components}/character-count/_character-count.scss +0 -0
  147. data/node_modules/govuk-frontend/{components → govuk/components}/character-count/character-count.js +5 -1
  148. data/node_modules/govuk-frontend/{components → govuk/components}/character-count/macro-options.json +0 -0
  149. data/node_modules/govuk-frontend/{components → govuk/components}/character-count/macro.njk +0 -0
  150. data/node_modules/govuk-frontend/{components → govuk/components}/character-count/template.njk +2 -2
  151. data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/README.md +0 -0
  152. data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/_checkboxes.scss +4 -6
  153. data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/checkboxes.js +0 -0
  154. data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/macro-options.json +6 -0
  155. data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/macro.njk +0 -0
  156. data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/template.njk +18 -5
  157. data/node_modules/govuk-frontend/{components → govuk/components}/date-input/README.md +0 -0
  158. data/node_modules/govuk-frontend/{components → govuk/components}/date-input/_date-input.scss +0 -0
  159. data/node_modules/govuk-frontend/{components → govuk/components}/date-input/macro-options.json +0 -0
  160. data/node_modules/govuk-frontend/{components → govuk/components}/date-input/macro.njk +0 -0
  161. data/node_modules/govuk-frontend/{components → govuk/components}/date-input/template.njk +1 -1
  162. data/node_modules/govuk-frontend/{components → govuk/components}/details/README.md +0 -0
  163. data/node_modules/govuk-frontend/{components → govuk/components}/details/_details.scss +12 -13
  164. data/node_modules/govuk-frontend/{components → govuk/components}/details/details.js +3 -4
  165. data/node_modules/govuk-frontend/{components → govuk/components}/details/implementation.md +0 -0
  166. data/node_modules/govuk-frontend/{components → govuk/components}/details/macro-options.json +0 -0
  167. data/node_modules/govuk-frontend/{components → govuk/components}/details/macro.njk +0 -0
  168. data/node_modules/govuk-frontend/{components → govuk/components}/details/template.njk +1 -1
  169. data/node_modules/govuk-frontend/{components → govuk/components}/error-message/README.md +0 -0
  170. data/node_modules/govuk-frontend/{components → govuk/components}/error-message/_error-message.scss +0 -0
  171. data/node_modules/govuk-frontend/{components → govuk/components}/error-message/macro-options.json +0 -0
  172. data/node_modules/govuk-frontend/{components → govuk/components}/error-message/macro.njk +0 -0
  173. data/node_modules/govuk-frontend/{components → govuk/components}/error-message/template.njk +0 -0
  174. data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/README.md +0 -0
  175. data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/_error-summary.scss +4 -17
  176. data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/error-summary.js +0 -10
  177. data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/macro-options.json +0 -0
  178. data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/macro.njk +0 -0
  179. data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/template.njk +1 -1
  180. data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/README.md +0 -0
  181. data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/_fieldset.scss +0 -0
  182. data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/macro-options.json +1 -1
  183. data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/macro.njk +0 -0
  184. data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/template.njk +0 -0
  185. data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/README.md +0 -0
  186. data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +81 -0
  187. data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/macro-options.json +6 -0
  188. data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/macro.njk +0 -0
  189. data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/template.njk +1 -1
  190. data/node_modules/govuk-frontend/{components → govuk/components}/footer/README.md +0 -0
  191. data/node_modules/govuk-frontend/{components → govuk/components}/footer/_footer.scss +47 -16
  192. data/node_modules/govuk-frontend/{components → govuk/components}/footer/macro-options.json +5 -0
  193. data/node_modules/govuk-frontend/{components → govuk/components}/footer/macro.njk +0 -0
  194. data/node_modules/govuk-frontend/{components → govuk/components}/footer/template.njk +1 -1
  195. data/node_modules/govuk-frontend/{components → govuk/components}/header/README.md +0 -0
  196. data/node_modules/govuk-frontend/{components → govuk/components}/header/_header.scss +34 -21
  197. data/node_modules/govuk-frontend/{components → govuk/components}/header/header.js +1 -1
  198. data/node_modules/govuk-frontend/{components → govuk/components}/header/macro-options.json +2 -2
  199. data/node_modules/govuk-frontend/{components → govuk/components}/header/macro.njk +0 -0
  200. data/node_modules/govuk-frontend/{components → govuk/components}/header/template.njk +6 -9
  201. data/node_modules/govuk-frontend/{components → govuk/components}/hint/README.md +0 -0
  202. data/node_modules/govuk-frontend/{components → govuk/components}/hint/_hint.scss +0 -0
  203. data/node_modules/govuk-frontend/{components → govuk/components}/hint/macro-options.json +0 -0
  204. data/node_modules/govuk-frontend/{components → govuk/components}/hint/macro.njk +0 -0
  205. data/node_modules/govuk-frontend/{components → govuk/components}/hint/template.njk +0 -0
  206. data/node_modules/govuk-frontend/{components → govuk/components}/input/README.md +0 -0
  207. data/node_modules/govuk-frontend/{components → govuk/components}/input/_input.scss +24 -1
  208. data/node_modules/govuk-frontend/{components → govuk/components}/input/macro-options.json +6 -0
  209. data/node_modules/govuk-frontend/{components → govuk/components}/input/macro.njk +0 -0
  210. data/node_modules/govuk-frontend/{components → govuk/components}/input/template.njk +1 -1
  211. data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/README.md +0 -0
  212. data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/_inset-text.scss +0 -0
  213. data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/macro-options.json +0 -0
  214. data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/macro.njk +0 -0
  215. data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/template.njk +0 -0
  216. data/node_modules/govuk-frontend/{components → govuk/components}/label/README.md +0 -0
  217. data/node_modules/govuk-frontend/{components → govuk/components}/label/_label.scss +0 -0
  218. data/node_modules/govuk-frontend/{components → govuk/components}/label/macro-options.json +0 -0
  219. data/node_modules/govuk-frontend/{components → govuk/components}/label/macro.njk +0 -0
  220. data/node_modules/govuk-frontend/{components → govuk/components}/label/template.njk +0 -0
  221. data/node_modules/govuk-frontend/{components → govuk/components}/panel/README.md +0 -0
  222. data/node_modules/govuk-frontend/{components → govuk/components}/panel/_panel.scss +1 -1
  223. data/node_modules/govuk-frontend/{components → govuk/components}/panel/macro-options.json +0 -0
  224. data/node_modules/govuk-frontend/{components → govuk/components}/panel/macro.njk +0 -0
  225. data/node_modules/govuk-frontend/{components → govuk/components}/panel/template.njk +0 -0
  226. data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/README.md +0 -0
  227. data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/_phase-banner.scss +0 -0
  228. data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/macro-options.json +0 -0
  229. data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/macro.njk +0 -0
  230. data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/template.njk +5 -7
  231. data/node_modules/govuk-frontend/{components → govuk/components}/radios/README.md +0 -0
  232. data/node_modules/govuk-frontend/{components → govuk/components}/radios/_radios.scss +7 -9
  233. data/node_modules/govuk-frontend/{components → govuk/components}/radios/macro-options.json +0 -0
  234. data/node_modules/govuk-frontend/{components → govuk/components}/radios/macro.njk +0 -0
  235. data/node_modules/govuk-frontend/{components → govuk/components}/radios/radios.js +24 -11
  236. data/node_modules/govuk-frontend/{components → govuk/components}/radios/template.njk +15 -5
  237. data/node_modules/govuk-frontend/{components → govuk/components}/select/README.md +0 -0
  238. data/node_modules/govuk-frontend/{components → govuk/components}/select/_select.scss +23 -1
  239. data/node_modules/govuk-frontend/{components → govuk/components}/select/macro-options.json +6 -0
  240. data/node_modules/govuk-frontend/{components → govuk/components}/select/macro.njk +0 -0
  241. data/node_modules/govuk-frontend/{components → govuk/components}/select/template.njk +1 -1
  242. data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/README.md +0 -0
  243. data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/_skip-link.scss +6 -1
  244. data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/macro-options.json +0 -0
  245. data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/macro.njk +0 -0
  246. data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/template.njk +0 -0
  247. data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/README.md +0 -0
  248. data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/_summary-list.scss +0 -0
  249. data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/macro-options.json +7 -1
  250. data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/macro.njk +0 -0
  251. data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/template.njk +1 -1
  252. data/node_modules/govuk-frontend/{components → govuk/components}/table/README.md +0 -0
  253. data/node_modules/govuk-frontend/{components → govuk/components}/table/_table.scss +1 -0
  254. data/node_modules/govuk-frontend/{components → govuk/components}/table/macro-options.json +0 -0
  255. data/node_modules/govuk-frontend/{components → govuk/components}/table/macro.njk +0 -0
  256. data/node_modules/govuk-frontend/{components → govuk/components}/table/template.njk +14 -14
  257. data/node_modules/govuk-frontend/{components → govuk/components}/tabs/README.md +0 -0
  258. data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +142 -0
  259. data/node_modules/govuk-frontend/{components → govuk/components}/tabs/macro-options.json +0 -0
  260. data/node_modules/govuk-frontend/{components → govuk/components}/tabs/macro.njk +0 -0
  261. data/node_modules/govuk-frontend/{components → govuk/components}/tabs/tabs.js +59 -5
  262. data/node_modules/govuk-frontend/{components → govuk/components}/tabs/template.njk +4 -6
  263. data/node_modules/govuk-frontend/{components → govuk/components}/tag/README.md +0 -0
  264. data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +44 -0
  265. data/node_modules/govuk-frontend/{components → govuk/components}/tag/macro-options.json +0 -0
  266. data/node_modules/govuk-frontend/{components → govuk/components}/tag/macro.njk +0 -0
  267. data/node_modules/govuk-frontend/{components → govuk/components}/tag/template.njk +0 -0
  268. data/node_modules/govuk-frontend/{components → govuk/components}/textarea/README.md +0 -0
  269. data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +55 -0
  270. data/node_modules/govuk-frontend/{components → govuk/components}/textarea/macro-options.json +6 -0
  271. data/node_modules/govuk-frontend/{components → govuk/components}/textarea/macro.njk +0 -0
  272. data/node_modules/govuk-frontend/{components → govuk/components}/textarea/template.njk +1 -1
  273. data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/README.md +0 -0
  274. data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/_warning-text.scss +0 -0
  275. data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/macro-options.json +0 -0
  276. data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/macro.njk +0 -0
  277. data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/template.njk +0 -0
  278. data/node_modules/govuk-frontend/{core → govuk/core}/_all.scss +0 -0
  279. data/node_modules/govuk-frontend/{core → govuk/core}/_global-styles.scss +0 -0
  280. data/node_modules/govuk-frontend/{core → govuk/core}/_links.scss +0 -0
  281. data/node_modules/govuk-frontend/{core → govuk/core}/_lists.scss +0 -0
  282. data/node_modules/govuk-frontend/{core → govuk/core}/_section-break.scss +0 -0
  283. data/node_modules/govuk-frontend/{core → govuk/core}/_template.scss +0 -0
  284. data/node_modules/govuk-frontend/{core → govuk/core}/_typography.scss +0 -0
  285. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_all.scss +1 -1
  286. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_clearfix.scss +0 -0
  287. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_colour.scss +23 -1
  288. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_device-pixels.scss +0 -0
  289. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +28 -0
  290. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
  291. data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +60 -0
  292. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_links.scss +15 -1
  293. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_media-queries.scss +0 -0
  294. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_shape-arrow.scss +0 -0
  295. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_spacing.scss +0 -0
  296. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_typography.scss +23 -5
  297. data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_visually-hidden.scss +4 -2
  298. data/node_modules/govuk-frontend/{objects → govuk/objects}/_all.scss +0 -0
  299. data/node_modules/govuk-frontend/{objects → govuk/objects}/_form-group.scss +0 -0
  300. data/node_modules/govuk-frontend/{objects → govuk/objects}/_grid.scss +2 -2
  301. data/node_modules/govuk-frontend/{objects → govuk/objects}/_main-wrapper.scss +15 -1
  302. data/node_modules/govuk-frontend/{objects → govuk/objects}/_width-container.scss +0 -0
  303. data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_all.scss +0 -0
  304. data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_display.scss +0 -0
  305. data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_spacing.scss +0 -0
  306. data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_typography.scss +0 -0
  307. data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_width.scss +0 -0
  308. data/node_modules/govuk-frontend/{settings → govuk/settings}/_all.scss +0 -0
  309. data/node_modules/govuk-frontend/{settings → govuk/settings}/_assets.scss +0 -0
  310. data/node_modules/govuk-frontend/{settings → govuk/settings}/_colours-applied.scss +9 -8
  311. data/node_modules/govuk-frontend/{settings → govuk/settings}/_colours-organisations.scss +1 -1
  312. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +101 -0
  313. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +75 -0
  314. data/node_modules/govuk-frontend/{settings → govuk/settings}/_global-styles.scss +0 -0
  315. data/node_modules/govuk-frontend/{settings → govuk/settings}/_ie8.scss +0 -0
  316. data/node_modules/govuk-frontend/{settings → govuk/settings}/_measurements.scss +2 -2
  317. data/node_modules/govuk-frontend/{settings → govuk/settings}/_media-queries.scss +0 -0
  318. data/node_modules/govuk-frontend/{settings → govuk/settings}/_spacing.scss +0 -0
  319. data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-font-families.scss +11 -1
  320. data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-font.scss +27 -7
  321. data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-responsive.scss +9 -10
  322. data/node_modules/govuk-frontend/{template.njk → govuk/template.njk} +0 -0
  323. data/node_modules/govuk-frontend/{tools → govuk/tools}/_all.scss +0 -0
  324. data/node_modules/govuk-frontend/{tools → govuk/tools}/_compatibility.scss +0 -0
  325. data/node_modules/govuk-frontend/{tools → govuk/tools}/_exports.scss +0 -0
  326. data/node_modules/govuk-frontend/{tools → govuk/tools}/_font-url.scss +0 -0
  327. data/node_modules/govuk-frontend/{tools → govuk/tools}/_ie8.scss +0 -0
  328. data/node_modules/govuk-frontend/{tools → govuk/tools}/_iff.scss +0 -0
  329. data/node_modules/govuk-frontend/{tools → govuk/tools}/_image-url.scss +0 -0
  330. data/node_modules/govuk-frontend/{tools → govuk/tools}/_px-to-em.scss +0 -0
  331. data/node_modules/govuk-frontend/{tools → govuk/tools}/_px-to-rem.scss +0 -0
  332. data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_all.scss +0 -0
  333. data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_clearfix.scss +0 -0
  334. data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_visually-hidden.scss +0 -0
  335. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/_sass-mq.scss +0 -0
  336. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/DOMTokenList.js +0 -0
  337. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Document.js +0 -0
  338. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element.js +0 -0
  339. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/classList.js +0 -0
  340. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/closest.js +0 -0
  341. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/matches.js +0 -0
  342. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +259 -0
  343. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +257 -0
  344. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Event.js +0 -0
  345. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Function/prototype/bind.js +0 -0
  346. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Object/defineProperty.js +0 -0
  347. data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Window.js +0 -0
  348. data/node_modules/govuk-frontend/package.json +21 -21
  349. data/node_modules/react-is/README.md +2 -12
  350. data/node_modules/react-is/build-info.json +5 -5
  351. data/node_modules/react-is/cjs/react-is.development.js +7 -2
  352. data/node_modules/react-is/cjs/react-is.production.min.js +6 -6
  353. data/node_modules/react-is/package.json +13 -13
  354. data/node_modules/react-is/umd/react-is.development.js +7 -2
  355. data/node_modules/react-is/umd/react-is.production.min.js +5 -5
  356. data/node_modules/type/CHANGELOG.md +62 -50
  357. data/node_modules/type/LICENSE +15 -0
  358. data/node_modules/type/README.md +19 -19
  359. data/node_modules/type/error/is.js +28 -7
  360. data/node_modules/type/package.json +36 -22
  361. data/node_modules/type/test/error/is.js +13 -5
  362. metadata +247 -344
  363. data/app/assets/javascripts/govuk_publishing_components/components/accessible-autocomplete.js +0 -79
  364. data/app/assets/stylesheets/govuk_publishing_components/components/_accessible-autocomplete.scss +0 -41
  365. data/app/views/govuk_publishing_components/components/_accessible_autocomplete.html.erb +0 -35
  366. data/app/views/govuk_publishing_components/components/docs/accessible_autocomplete.yml +0 -49
  367. data/node_modules/accessible-autocomplete/CHANGELOG.md +0 -269
  368. data/node_modules/accessible-autocomplete/CONTRIBUTING.md +0 -150
  369. data/node_modules/accessible-autocomplete/LICENSE.txt +0 -20
  370. data/node_modules/accessible-autocomplete/Procfile +0 -1
  371. data/node_modules/accessible-autocomplete/README.md +0 -416
  372. data/node_modules/accessible-autocomplete/accessibility-criteria.md +0 -42
  373. data/node_modules/accessible-autocomplete/app.json +0 -15
  374. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +0 -1
  375. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +0 -2
  376. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +0 -1
  377. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +0 -2
  378. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +0 -1
  379. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +0 -2
  380. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +0 -1
  381. data/node_modules/accessible-autocomplete/examples/form.html +0 -671
  382. data/node_modules/accessible-autocomplete/examples/index.html +0 -665
  383. data/node_modules/accessible-autocomplete/examples/multiselect.html +0 -134
  384. data/node_modules/accessible-autocomplete/examples/preact/index.html +0 -346
  385. data/node_modules/accessible-autocomplete/examples/react/index.html +0 -347
  386. data/node_modules/accessible-autocomplete/package-lock.json +0 -14491
  387. data/node_modules/accessible-autocomplete/package.json +0 -173
  388. data/node_modules/accessible-autocomplete/preact.js +0 -1
  389. data/node_modules/accessible-autocomplete/react.js +0 -1
  390. data/node_modules/accessible-autocomplete/scripts/check-staged.js +0 -14
  391. data/node_modules/accessible-autocomplete/src/autocomplete.css +0 -192
  392. data/node_modules/accessible-autocomplete/src/autocomplete.js +0 -618
  393. data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +0 -11
  394. data/node_modules/accessible-autocomplete/src/status.js +0 -80
  395. data/node_modules/accessible-autocomplete/src/wrapper.js +0 -76
  396. data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +0 -44
  397. data/node_modules/accessible-autocomplete/test/functional/index.js +0 -485
  398. data/node_modules/accessible-autocomplete/test/functional/wrapper.js +0 -318
  399. data/node_modules/accessible-autocomplete/test/integration/index.js +0 -188
  400. data/node_modules/accessible-autocomplete/test/karma.config.js +0 -42
  401. data/node_modules/accessible-autocomplete/test/wdio.config.js +0 -80
  402. data/node_modules/accessible-autocomplete/webpack.config.babel.js +0 -193
  403. data/node_modules/govuk-frontend/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
  404. data/node_modules/govuk-frontend/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
  405. data/node_modules/govuk-frontend/assets/fonts/bold-fb2676462a-v1.eot +0 -0
  406. data/node_modules/govuk-frontend/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
  407. data/node_modules/govuk-frontend/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
  408. data/node_modules/govuk-frontend/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
  409. data/node_modules/govuk-frontend/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
  410. data/node_modules/govuk-frontend/assets/fonts/light-458f8ea81c-v1.woff +0 -0
  411. data/node_modules/govuk-frontend/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
  412. data/node_modules/govuk-frontend/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
  413. data/node_modules/govuk-frontend/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
  414. data/node_modules/govuk-frontend/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
  415. data/node_modules/govuk-frontend/assets/images/icon-arrow-left.png +0 -0
  416. data/node_modules/govuk-frontend/assets/images/icon-important.png +0 -0
  417. data/node_modules/govuk-frontend/assets/images/icon-pointer-2x.png +0 -0
  418. data/node_modules/govuk-frontend/assets/images/icon-pointer.png +0 -0
  419. data/node_modules/govuk-frontend/components/button/template.njk +0 -35
  420. data/node_modules/govuk-frontend/components/file-upload/_file-upload.scss +0 -19
  421. data/node_modules/govuk-frontend/components/tabs/_tabs.scss +0 -130
  422. data/node_modules/govuk-frontend/components/tag/_tag.scss +0 -33
  423. data/node_modules/govuk-frontend/components/textarea/_textarea.scss +0 -32
  424. data/node_modules/govuk-frontend/helpers/_focusable.scss +0 -34
  425. data/node_modules/govuk-frontend/helpers/_font-faces.scss +0 -67
  426. data/node_modules/govuk-frontend/helpers/_grid.scss +0 -107
  427. data/node_modules/govuk-frontend/settings/_colours-palette.scss +0 -37
  428. data/node_modules/govuk-frontend/settings/_compatibility.scss +0 -51
  429. data/node_modules/preact/LICENSE +0 -21
  430. data/node_modules/preact/README.md +0 -592
  431. data/node_modules/preact/debug.js +0 -740
  432. data/node_modules/preact/debug.js.map +0 -1
  433. data/node_modules/preact/debug/dist/debug.js +0 -2
  434. data/node_modules/preact/debug/dist/debug.js.map +0 -1
  435. data/node_modules/preact/debug/dist/debug.mjs +0 -681
  436. data/node_modules/preact/debug/dist/debug.mjs.map +0 -1
  437. data/node_modules/preact/debug/dist/debug.module.js +0 -2
  438. data/node_modules/preact/debug/dist/debug.module.js.map +0 -1
  439. data/node_modules/preact/debug/dist/debug.umd.js +0 -2
  440. data/node_modules/preact/debug/dist/debug.umd.js.map +0 -1
  441. data/node_modules/preact/debug/index.js +0 -122
  442. data/node_modules/preact/devtools.js +0 -403
  443. data/node_modules/preact/devtools.js.map +0 -1
  444. data/node_modules/preact/devtools/devtools.js +0 -395
  445. data/node_modules/preact/devtools/index.js +0 -4
  446. data/node_modules/preact/dist/preact.d.ts +0 -1712
  447. data/node_modules/preact/dist/preact.dev.js +0 -727
  448. data/node_modules/preact/dist/preact.dev.js.map +0 -1
  449. data/node_modules/preact/dist/preact.js +0 -414
  450. data/node_modules/preact/dist/preact.js.flow +0 -25
  451. data/node_modules/preact/dist/preact.js.map +0 -1
  452. data/node_modules/preact/dist/preact.min.js +0 -2
  453. data/node_modules/preact/dist/preact.min.js.map +0 -1
  454. data/node_modules/preact/dist/preact.mjs +0 -724
  455. data/node_modules/preact/dist/preact.mjs.map +0 -1
  456. data/node_modules/preact/dist/preact.umd.js +0 -751
  457. data/node_modules/preact/dist/preact.umd.js.map +0 -1
  458. data/node_modules/preact/package.json +0 -226
  459. data/node_modules/preact/src/clone-element.js +0 -18
  460. data/node_modules/preact/src/component.js +0 -90
  461. data/node_modules/preact/src/constants.js +0 -17
  462. data/node_modules/preact/src/dom/index.js +0 -139
  463. data/node_modules/preact/src/h.js +0 -86
  464. data/node_modules/preact/src/options.js +0 -22
  465. data/node_modules/preact/src/preact.d.ts +0 -1712
  466. data/node_modules/preact/src/preact.js +0 -32
  467. data/node_modules/preact/src/preact.js.flow +0 -25
  468. data/node_modules/preact/src/render-queue.js +0 -27
  469. data/node_modules/preact/src/render.js +0 -22
  470. data/node_modules/preact/src/util.js +0 -30
  471. data/node_modules/preact/src/vdom/component-recycler.js +0 -48
  472. data/node_modules/preact/src/vdom/component.js +0 -296
  473. data/node_modules/preact/src/vdom/diff.js +0 -337
  474. data/node_modules/preact/src/vdom/index.js +0 -54
  475. data/node_modules/preact/src/vnode.js +0 -9
  476. data/node_modules/preact/typings.json +0 -5
@@ -1,727 +0,0 @@
1
- (function () {
2
- 'use strict';
3
-
4
- var VNode = function VNode() {};
5
-
6
- var options = {};
7
-
8
- var stack = [];
9
-
10
- var EMPTY_CHILDREN = [];
11
-
12
- function h(nodeName, attributes) {
13
- var children = EMPTY_CHILDREN,
14
- lastSimple,
15
- child,
16
- simple,
17
- i;
18
- for (i = arguments.length; i-- > 2;) {
19
- stack.push(arguments[i]);
20
- }
21
- if (attributes && attributes.children != null) {
22
- if (!stack.length) stack.push(attributes.children);
23
- delete attributes.children;
24
- }
25
- while (stack.length) {
26
- if ((child = stack.pop()) && child.pop !== undefined) {
27
- for (i = child.length; i--;) {
28
- stack.push(child[i]);
29
- }
30
- } else {
31
- if (typeof child === 'boolean') child = null;
32
-
33
- if (simple = typeof nodeName !== 'function') {
34
- if (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;
35
- }
36
-
37
- if (simple && lastSimple) {
38
- children[children.length - 1] += child;
39
- } else if (children === EMPTY_CHILDREN) {
40
- children = [child];
41
- } else {
42
- children.push(child);
43
- }
44
-
45
- lastSimple = simple;
46
- }
47
- }
48
-
49
- var p = new VNode();
50
- p.nodeName = nodeName;
51
- p.children = children;
52
- p.attributes = attributes == null ? undefined : attributes;
53
- p.key = attributes == null ? undefined : attributes.key;
54
-
55
- if (options.vnode !== undefined) options.vnode(p);
56
-
57
- return p;
58
- }
59
-
60
- function extend(obj, props) {
61
- for (var i in props) {
62
- obj[i] = props[i];
63
- }return obj;
64
- }
65
-
66
- function applyRef(ref, value) {
67
- if (ref) {
68
- if (typeof ref == 'function') ref(value);else ref.current = value;
69
- }
70
- }
71
-
72
- var defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;
73
-
74
- function cloneElement(vnode, props) {
75
- return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);
76
- }
77
-
78
- var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;
79
-
80
- var items = [];
81
-
82
- function enqueueRender(component) {
83
- if (!component._dirty && (component._dirty = true) && items.push(component) == 1) {
84
- (options.debounceRendering || defer)(rerender);
85
- }
86
- }
87
-
88
- function rerender() {
89
- var p;
90
- while (p = items.pop()) {
91
- if (p._dirty) renderComponent(p);
92
- }
93
- }
94
-
95
- function isSameNodeType(node, vnode, hydrating) {
96
- if (typeof vnode === 'string' || typeof vnode === 'number') {
97
- return node.splitText !== undefined;
98
- }
99
- if (typeof vnode.nodeName === 'string') {
100
- return !node._componentConstructor && isNamedNode(node, vnode.nodeName);
101
- }
102
- return hydrating || node._componentConstructor === vnode.nodeName;
103
- }
104
-
105
- function isNamedNode(node, nodeName) {
106
- return node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();
107
- }
108
-
109
- function getNodeProps(vnode) {
110
- var props = extend({}, vnode.attributes);
111
- props.children = vnode.children;
112
-
113
- var defaultProps = vnode.nodeName.defaultProps;
114
- if (defaultProps !== undefined) {
115
- for (var i in defaultProps) {
116
- if (props[i] === undefined) {
117
- props[i] = defaultProps[i];
118
- }
119
- }
120
- }
121
-
122
- return props;
123
- }
124
-
125
- function createNode(nodeName, isSvg) {
126
- var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);
127
- node.normalizedNodeName = nodeName;
128
- return node;
129
- }
130
-
131
- function removeNode(node) {
132
- var parentNode = node.parentNode;
133
- if (parentNode) parentNode.removeChild(node);
134
- }
135
-
136
- function setAccessor(node, name, old, value, isSvg) {
137
- if (name === 'className') name = 'class';
138
-
139
- if (name === 'key') {} else if (name === 'ref') {
140
- applyRef(old, null);
141
- applyRef(value, node);
142
- } else if (name === 'class' && !isSvg) {
143
- node.className = value || '';
144
- } else if (name === 'style') {
145
- if (!value || typeof value === 'string' || typeof old === 'string') {
146
- node.style.cssText = value || '';
147
- }
148
- if (value && typeof value === 'object') {
149
- if (typeof old !== 'string') {
150
- for (var i in old) {
151
- if (!(i in value)) node.style[i] = '';
152
- }
153
- }
154
- for (var i in value) {
155
- node.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];
156
- }
157
- }
158
- } else if (name === 'dangerouslySetInnerHTML') {
159
- if (value) node.innerHTML = value.__html || '';
160
- } else if (name[0] == 'o' && name[1] == 'n') {
161
- var useCapture = name !== (name = name.replace(/Capture$/, ''));
162
- name = name.toLowerCase().substring(2);
163
- if (value) {
164
- if (!old) node.addEventListener(name, eventProxy, useCapture);
165
- } else {
166
- node.removeEventListener(name, eventProxy, useCapture);
167
- }
168
- (node._listeners || (node._listeners = {}))[name] = value;
169
- } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {
170
- try {
171
- node[name] = value == null ? '' : value;
172
- } catch (e) {}
173
- if ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);
174
- } else {
175
- var ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));
176
-
177
- if (value == null || value === false) {
178
- if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);
179
- } else if (typeof value !== 'function') {
180
- if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);
181
- }
182
- }
183
- }
184
-
185
- function eventProxy(e) {
186
- return this._listeners[e.type](options.event && options.event(e) || e);
187
- }
188
-
189
- var mounts = [];
190
-
191
- var diffLevel = 0;
192
-
193
- var isSvgMode = false;
194
-
195
- var hydrating = false;
196
-
197
- function flushMounts() {
198
- var c;
199
- while (c = mounts.shift()) {
200
- if (options.afterMount) options.afterMount(c);
201
- if (c.componentDidMount) c.componentDidMount();
202
- }
203
- }
204
-
205
- function diff(dom, vnode, context, mountAll, parent, componentRoot) {
206
- if (!diffLevel++) {
207
- isSvgMode = parent != null && parent.ownerSVGElement !== undefined;
208
-
209
- hydrating = dom != null && !('__preactattr_' in dom);
210
- }
211
-
212
- var ret = idiff(dom, vnode, context, mountAll, componentRoot);
213
-
214
- if (parent && ret.parentNode !== parent) parent.appendChild(ret);
215
-
216
- if (! --diffLevel) {
217
- hydrating = false;
218
-
219
- if (!componentRoot) flushMounts();
220
- }
221
-
222
- return ret;
223
- }
224
-
225
- function idiff(dom, vnode, context, mountAll, componentRoot) {
226
- var out = dom,
227
- prevSvgMode = isSvgMode;
228
-
229
- if (vnode == null || typeof vnode === 'boolean') vnode = '';
230
-
231
- if (typeof vnode === 'string' || typeof vnode === 'number') {
232
- if (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {
233
- if (dom.nodeValue != vnode) {
234
- dom.nodeValue = vnode;
235
- }
236
- } else {
237
- out = document.createTextNode(vnode);
238
- if (dom) {
239
- if (dom.parentNode) dom.parentNode.replaceChild(out, dom);
240
- recollectNodeTree(dom, true);
241
- }
242
- }
243
-
244
- out['__preactattr_'] = true;
245
-
246
- return out;
247
- }
248
-
249
- var vnodeName = vnode.nodeName;
250
- if (typeof vnodeName === 'function') {
251
- return buildComponentFromVNode(dom, vnode, context, mountAll);
252
- }
253
-
254
- isSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;
255
-
256
- vnodeName = String(vnodeName);
257
- if (!dom || !isNamedNode(dom, vnodeName)) {
258
- out = createNode(vnodeName, isSvgMode);
259
-
260
- if (dom) {
261
- while (dom.firstChild) {
262
- out.appendChild(dom.firstChild);
263
- }
264
- if (dom.parentNode) dom.parentNode.replaceChild(out, dom);
265
-
266
- recollectNodeTree(dom, true);
267
- }
268
- }
269
-
270
- var fc = out.firstChild,
271
- props = out['__preactattr_'],
272
- vchildren = vnode.children;
273
-
274
- if (props == null) {
275
- props = out['__preactattr_'] = {};
276
- for (var a = out.attributes, i = a.length; i--;) {
277
- props[a[i].name] = a[i].value;
278
- }
279
- }
280
-
281
- if (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {
282
- if (fc.nodeValue != vchildren[0]) {
283
- fc.nodeValue = vchildren[0];
284
- }
285
- } else if (vchildren && vchildren.length || fc != null) {
286
- innerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);
287
- }
288
-
289
- diffAttributes(out, vnode.attributes, props);
290
-
291
- isSvgMode = prevSvgMode;
292
-
293
- return out;
294
- }
295
-
296
- function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {
297
- var originalChildren = dom.childNodes,
298
- children = [],
299
- keyed = {},
300
- keyedLen = 0,
301
- min = 0,
302
- len = originalChildren.length,
303
- childrenLen = 0,
304
- vlen = vchildren ? vchildren.length : 0,
305
- j,
306
- c,
307
- f,
308
- vchild,
309
- child;
310
-
311
- if (len !== 0) {
312
- for (var i = 0; i < len; i++) {
313
- var _child = originalChildren[i],
314
- props = _child['__preactattr_'],
315
- key = vlen && props ? _child._component ? _child._component.__key : props.key : null;
316
- if (key != null) {
317
- keyedLen++;
318
- keyed[key] = _child;
319
- } else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {
320
- children[childrenLen++] = _child;
321
- }
322
- }
323
- }
324
-
325
- if (vlen !== 0) {
326
- for (var i = 0; i < vlen; i++) {
327
- vchild = vchildren[i];
328
- child = null;
329
-
330
- var key = vchild.key;
331
- if (key != null) {
332
- if (keyedLen && keyed[key] !== undefined) {
333
- child = keyed[key];
334
- keyed[key] = undefined;
335
- keyedLen--;
336
- }
337
- } else if (min < childrenLen) {
338
- for (j = min; j < childrenLen; j++) {
339
- if (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {
340
- child = c;
341
- children[j] = undefined;
342
- if (j === childrenLen - 1) childrenLen--;
343
- if (j === min) min++;
344
- break;
345
- }
346
- }
347
- }
348
-
349
- child = idiff(child, vchild, context, mountAll);
350
-
351
- f = originalChildren[i];
352
- if (child && child !== dom && child !== f) {
353
- if (f == null) {
354
- dom.appendChild(child);
355
- } else if (child === f.nextSibling) {
356
- removeNode(f);
357
- } else {
358
- dom.insertBefore(child, f);
359
- }
360
- }
361
- }
362
- }
363
-
364
- if (keyedLen) {
365
- for (var i in keyed) {
366
- if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);
367
- }
368
- }
369
-
370
- while (min <= childrenLen) {
371
- if ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);
372
- }
373
- }
374
-
375
- function recollectNodeTree(node, unmountOnly) {
376
- var component = node._component;
377
- if (component) {
378
- unmountComponent(component);
379
- } else {
380
- if (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);
381
-
382
- if (unmountOnly === false || node['__preactattr_'] == null) {
383
- removeNode(node);
384
- }
385
-
386
- removeChildren(node);
387
- }
388
- }
389
-
390
- function removeChildren(node) {
391
- node = node.lastChild;
392
- while (node) {
393
- var next = node.previousSibling;
394
- recollectNodeTree(node, true);
395
- node = next;
396
- }
397
- }
398
-
399
- function diffAttributes(dom, attrs, old) {
400
- var name;
401
-
402
- for (name in old) {
403
- if (!(attrs && attrs[name] != null) && old[name] != null) {
404
- setAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);
405
- }
406
- }
407
-
408
- for (name in attrs) {
409
- if (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {
410
- setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);
411
- }
412
- }
413
- }
414
-
415
- var recyclerComponents = [];
416
-
417
- function createComponent(Ctor, props, context) {
418
- var inst,
419
- i = recyclerComponents.length;
420
-
421
- if (Ctor.prototype && Ctor.prototype.render) {
422
- inst = new Ctor(props, context);
423
- Component.call(inst, props, context);
424
- } else {
425
- inst = new Component(props, context);
426
- inst.constructor = Ctor;
427
- inst.render = doRender;
428
- }
429
-
430
- while (i--) {
431
- if (recyclerComponents[i].constructor === Ctor) {
432
- inst.nextBase = recyclerComponents[i].nextBase;
433
- recyclerComponents.splice(i, 1);
434
- return inst;
435
- }
436
- }
437
-
438
- return inst;
439
- }
440
-
441
- function doRender(props, state, context) {
442
- return this.constructor(props, context);
443
- }
444
-
445
- function setComponentProps(component, props, renderMode, context, mountAll) {
446
- if (component._disable) return;
447
- component._disable = true;
448
-
449
- component.__ref = props.ref;
450
- component.__key = props.key;
451
- delete props.ref;
452
- delete props.key;
453
-
454
- if (typeof component.constructor.getDerivedStateFromProps === 'undefined') {
455
- if (!component.base || mountAll) {
456
- if (component.componentWillMount) component.componentWillMount();
457
- } else if (component.componentWillReceiveProps) {
458
- component.componentWillReceiveProps(props, context);
459
- }
460
- }
461
-
462
- if (context && context !== component.context) {
463
- if (!component.prevContext) component.prevContext = component.context;
464
- component.context = context;
465
- }
466
-
467
- if (!component.prevProps) component.prevProps = component.props;
468
- component.props = props;
469
-
470
- component._disable = false;
471
-
472
- if (renderMode !== 0) {
473
- if (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {
474
- renderComponent(component, 1, mountAll);
475
- } else {
476
- enqueueRender(component);
477
- }
478
- }
479
-
480
- applyRef(component.__ref, component);
481
- }
482
-
483
- function renderComponent(component, renderMode, mountAll, isChild) {
484
- if (component._disable) return;
485
-
486
- var props = component.props,
487
- state = component.state,
488
- context = component.context,
489
- previousProps = component.prevProps || props,
490
- previousState = component.prevState || state,
491
- previousContext = component.prevContext || context,
492
- isUpdate = component.base,
493
- nextBase = component.nextBase,
494
- initialBase = isUpdate || nextBase,
495
- initialChildComponent = component._component,
496
- skip = false,
497
- snapshot = previousContext,
498
- rendered,
499
- inst,
500
- cbase;
501
-
502
- if (component.constructor.getDerivedStateFromProps) {
503
- state = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));
504
- component.state = state;
505
- }
506
-
507
- if (isUpdate) {
508
- component.props = previousProps;
509
- component.state = previousState;
510
- component.context = previousContext;
511
- if (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {
512
- skip = true;
513
- } else if (component.componentWillUpdate) {
514
- component.componentWillUpdate(props, state, context);
515
- }
516
- component.props = props;
517
- component.state = state;
518
- component.context = context;
519
- }
520
-
521
- component.prevProps = component.prevState = component.prevContext = component.nextBase = null;
522
- component._dirty = false;
523
-
524
- if (!skip) {
525
- rendered = component.render(props, state, context);
526
-
527
- if (component.getChildContext) {
528
- context = extend(extend({}, context), component.getChildContext());
529
- }
530
-
531
- if (isUpdate && component.getSnapshotBeforeUpdate) {
532
- snapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);
533
- }
534
-
535
- var childComponent = rendered && rendered.nodeName,
536
- toUnmount,
537
- base;
538
-
539
- if (typeof childComponent === 'function') {
540
-
541
- var childProps = getNodeProps(rendered);
542
- inst = initialChildComponent;
543
-
544
- if (inst && inst.constructor === childComponent && childProps.key == inst.__key) {
545
- setComponentProps(inst, childProps, 1, context, false);
546
- } else {
547
- toUnmount = inst;
548
-
549
- component._component = inst = createComponent(childComponent, childProps, context);
550
- inst.nextBase = inst.nextBase || nextBase;
551
- inst._parentComponent = component;
552
- setComponentProps(inst, childProps, 0, context, false);
553
- renderComponent(inst, 1, mountAll, true);
554
- }
555
-
556
- base = inst.base;
557
- } else {
558
- cbase = initialBase;
559
-
560
- toUnmount = initialChildComponent;
561
- if (toUnmount) {
562
- cbase = component._component = null;
563
- }
564
-
565
- if (initialBase || renderMode === 1) {
566
- if (cbase) cbase._component = null;
567
- base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);
568
- }
569
- }
570
-
571
- if (initialBase && base !== initialBase && inst !== initialChildComponent) {
572
- var baseParent = initialBase.parentNode;
573
- if (baseParent && base !== baseParent) {
574
- baseParent.replaceChild(base, initialBase);
575
-
576
- if (!toUnmount) {
577
- initialBase._component = null;
578
- recollectNodeTree(initialBase, false);
579
- }
580
- }
581
- }
582
-
583
- if (toUnmount) {
584
- unmountComponent(toUnmount);
585
- }
586
-
587
- component.base = base;
588
- if (base && !isChild) {
589
- var componentRef = component,
590
- t = component;
591
- while (t = t._parentComponent) {
592
- (componentRef = t).base = base;
593
- }
594
- base._component = componentRef;
595
- base._componentConstructor = componentRef.constructor;
596
- }
597
- }
598
-
599
- if (!isUpdate || mountAll) {
600
- mounts.push(component);
601
- } else if (!skip) {
602
-
603
- if (component.componentDidUpdate) {
604
- component.componentDidUpdate(previousProps, previousState, snapshot);
605
- }
606
- if (options.afterUpdate) options.afterUpdate(component);
607
- }
608
-
609
- while (component._renderCallbacks.length) {
610
- component._renderCallbacks.pop().call(component);
611
- }if (!diffLevel && !isChild) flushMounts();
612
- }
613
-
614
- function buildComponentFromVNode(dom, vnode, context, mountAll) {
615
- var c = dom && dom._component,
616
- originalComponent = c,
617
- oldDom = dom,
618
- isDirectOwner = c && dom._componentConstructor === vnode.nodeName,
619
- isOwner = isDirectOwner,
620
- props = getNodeProps(vnode);
621
- while (c && !isOwner && (c = c._parentComponent)) {
622
- isOwner = c.constructor === vnode.nodeName;
623
- }
624
-
625
- if (c && isOwner && (!mountAll || c._component)) {
626
- setComponentProps(c, props, 3, context, mountAll);
627
- dom = c.base;
628
- } else {
629
- if (originalComponent && !isDirectOwner) {
630
- unmountComponent(originalComponent);
631
- dom = oldDom = null;
632
- }
633
-
634
- c = createComponent(vnode.nodeName, props, context);
635
- if (dom && !c.nextBase) {
636
- c.nextBase = dom;
637
-
638
- oldDom = null;
639
- }
640
- setComponentProps(c, props, 1, context, mountAll);
641
- dom = c.base;
642
-
643
- if (oldDom && dom !== oldDom) {
644
- oldDom._component = null;
645
- recollectNodeTree(oldDom, false);
646
- }
647
- }
648
-
649
- return dom;
650
- }
651
-
652
- function unmountComponent(component) {
653
- if (options.beforeUnmount) options.beforeUnmount(component);
654
-
655
- var base = component.base;
656
-
657
- component._disable = true;
658
-
659
- if (component.componentWillUnmount) component.componentWillUnmount();
660
-
661
- component.base = null;
662
-
663
- var inner = component._component;
664
- if (inner) {
665
- unmountComponent(inner);
666
- } else if (base) {
667
- if (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);
668
-
669
- component.nextBase = base;
670
-
671
- removeNode(base);
672
- recyclerComponents.push(component);
673
-
674
- removeChildren(base);
675
- }
676
-
677
- applyRef(component.__ref, null);
678
- }
679
-
680
- function Component(props, context) {
681
- this._dirty = true;
682
-
683
- this.context = context;
684
-
685
- this.props = props;
686
-
687
- this.state = this.state || {};
688
-
689
- this._renderCallbacks = [];
690
- }
691
-
692
- extend(Component.prototype, {
693
- setState: function setState(state, callback) {
694
- if (!this.prevState) this.prevState = this.state;
695
- this.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);
696
- if (callback) this._renderCallbacks.push(callback);
697
- enqueueRender(this);
698
- },
699
- forceUpdate: function forceUpdate(callback) {
700
- if (callback) this._renderCallbacks.push(callback);
701
- renderComponent(this, 2);
702
- },
703
- render: function render() {}
704
- });
705
-
706
- function render(vnode, parent, merge) {
707
- return diff(merge, vnode, {}, false, parent, false);
708
- }
709
-
710
- function createRef() {
711
- return {};
712
- }
713
-
714
- var preact = {
715
- h: h,
716
- createElement: h,
717
- cloneElement: cloneElement,
718
- createRef: createRef,
719
- Component: Component,
720
- render: render,
721
- rerender: rerender,
722
- options: options
723
- };
724
-
725
- if (typeof module != 'undefined') module.exports = preact;else self.preact = preact;
726
- }());
727
- //# sourceMappingURL=preact.dev.js.map