govuk_publishing_components 41.0.0 → 41.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +192 -171
  3. data/app/assets/stylesheets/component_guide/application.scss +10 -11
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +2 -3
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +3 -3
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +60 -23
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +3 -3
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +1 -3
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +19 -19
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +14 -10
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +3 -3
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -2
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +8 -8
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +16 -10
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +2 -2
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +33 -35
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +3 -3
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -1
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +13 -3
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +6 -6
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +2 -3
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -3
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -3
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -4
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +3 -3
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +10 -10
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +3 -3
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  40. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +5 -4
  41. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
  43. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +2 -2
  44. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -1
  45. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  46. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +5 -5
  47. data/app/views/govuk_publishing_components/components/_cards.html.erb +11 -3
  48. data/app/views/govuk_publishing_components/components/docs/cards.yml +40 -29
  49. data/lib/govuk_publishing_components/version.rb +1 -1
  50. data/node_modules/axe-core/axe.d.ts +18 -5
  51. data/node_modules/axe-core/axe.js +757 -716
  52. data/node_modules/axe-core/axe.min.js +2 -2
  53. data/node_modules/axe-core/locales/_template.json +101 -96
  54. data/node_modules/axe-core/locales/de.json +12 -5
  55. data/node_modules/axe-core/locales/ja.json +15 -7
  56. data/node_modules/axe-core/package.json +14 -10
  57. data/node_modules/axe-core/sri-history.json +4 -0
  58. metadata +4 -4
@@ -17,14 +17,14 @@
17
17
  }
18
18
 
19
19
  p {
20
- @include govuk-font($size: 19, $weight: bold);
21
20
  margin: 0;
21
+ @include govuk-font($size: 19, $weight: bold);
22
22
  }
23
23
 
24
24
  em {
25
- @include govuk-font($size: 80, $weight: bold);
26
25
  display: block;
27
26
  margin: 3px 0 -5px;
27
+ @include govuk-font($size: 80, $weight: bold);
28
28
  }
29
29
  }
30
30
  }
@@ -33,9 +33,9 @@
33
33
  }
34
34
 
35
35
  th {
36
- @include govuk-font($size: 19, $weight: bold);
37
36
  text-align: left;
38
37
  color: $govuk-text-colour;
38
+ @include govuk-font($size: 19, $weight: bold);
39
39
  }
40
40
 
41
41
  td small {
@@ -30,8 +30,8 @@
30
30
  }
31
31
 
32
32
  p {
33
- @include govuk-font($size: 19, $weight: bold);
34
33
  margin-left: 1em;
34
+ @include govuk-font($size: 19, $weight: bold);
35
35
  }
36
36
  }
37
37
 
@@ -8,9 +8,9 @@
8
8
  ol,
9
9
  ul,
10
10
  p {
11
- @include govuk-font($size: 19);
12
11
  margin-top: $govuk-gutter-half;
13
12
  margin-bottom: $govuk-gutter-half;
13
+ @include govuk-font($size: 19);
14
14
 
15
15
  @include govuk-media-query($from: tablet) {
16
16
  margin-top: $gutter-two-thirds;
@@ -24,15 +24,15 @@
24
24
  // thus H1's are not expected and are discouraged by bare styling
25
25
 
26
26
  h1 {
27
- @include govuk-font($size: 19);
28
27
  margin: 0;
29
28
  padding: 0;
29
+ @include govuk-font($size: 19);
30
30
  }
31
31
 
32
32
  h2 {
33
- @include govuk-font($size: 27, $weight: bold);
34
33
  margin-top: $govuk-gutter;
35
34
  margin-bottom: 0;
35
+ @include govuk-font($size: 27, $weight: bold);
36
36
 
37
37
  @include govuk-media-query($from: desktop) {
38
38
  margin-top: $govuk-gutter * 1.5;
@@ -41,9 +41,9 @@
41
41
  }
42
42
 
43
43
  h3 {
44
- @include govuk-font($size: 19, $weight: bold);
45
44
  margin-top: $govuk-gutter + 5px;
46
45
  margin-bottom: 0;
46
+ @include govuk-font($size: 19, $weight: bold);
47
47
  }
48
48
 
49
49
  // H4, H5 and H6 are discouraged and thus styled the same
@@ -51,9 +51,9 @@
51
51
  h4,
52
52
  h5,
53
53
  h6 {
54
- @include govuk-font($size: 19, $weight: bold);
55
54
  margin-top: $govuk-gutter + 5px;
56
55
  margin-bottom: 0;
56
+ @include govuk-font($size: 19, $weight: bold);
57
57
 
58
58
  + p {
59
59
  margin-top: 5px;
@@ -3,9 +3,13 @@
3
3
  heading ||= nil
4
4
  items ||= nil
5
5
  sub_heading_level ||= 3
6
- two_column_layout ||= false
6
+ columns ||= false
7
+
7
8
  ul_classes = %w[gem-c-cards__list]
8
- ul_classes << 'gem-c-cards__list--two-column-desktop' if two_column_layout
9
+ ul_classes << 'gem-c-cards__list--one-column' unless columns
10
+ ul_classes << 'gem-c-cards__list--two-column-desktop' if columns == 2
11
+ ul_classes << 'gem-c-cards__list--three-column-desktop' if columns == 3
12
+
9
13
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
10
14
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
11
15
  component_helper.add_class("gem-c-cards")
@@ -13,7 +17,11 @@
13
17
  <% if items.present? %>
14
18
  <%= tag.div(**component_helper.all_attributes) do %>
15
19
  <% if heading %>
16
- <%= content_tag(shared_helper.get_heading_level, class: "gem-c-cards__heading govuk-heading-m") do %>
20
+ <%
21
+ heading_classes = %w[gem-c-cards__heading govuk-heading-m]
22
+ heading_classes << "gem-c-cards__heading--underline" unless columns
23
+ %>
24
+ <%= content_tag(shared_helper.get_heading_level, class: heading_classes) do %>
17
25
  <%= heading %>
18
26
  <% end %>
19
27
  <% end %>
@@ -1,13 +1,11 @@
1
- name: Cards (experimental)
1
+ name: Cards
2
2
  description: A grid of cards that have a link and a description
3
3
  body: |
4
- The component renders the cards as an unordered list element and visually presents it as a grid. It doesn't use the [GOV.UK Design System grid](https://design-system.service.gov.uk/styles/layout/#grid-system) but sets its own so that it can separately target desktop, tablet and mobile columns.
4
+ The component renders the cards as an unordered list element and visually presents it using CSS grid to display the cards in either a one (default), two or three column layout. It doesn't use the [GOV.UK Design System grid](https://design-system.service.gov.uk/styles/layout/#grid-system) but sets its own so that it can separately target desktop, tablet and mobile columns.
5
5
 
6
- You can display the grid in three or two columns on desktop. Browsers that don't support CSS grid always display one column.
6
+ Browsers that don't support CSS grid always display one column.
7
7
 
8
8
  You must set a `href` for all the links.
9
-
10
- This component is currently experimental. If you are using it, please feed back any research findings to the GOV.UK Explore team.
11
9
  accessibility_criteria: |
12
10
  The component must:
13
11
 
@@ -42,38 +40,34 @@ examples:
42
40
  text: Citizenship and living in the&nbsp;UK
43
41
  path: http://www.gov.uk
44
42
  description: Voting, community participation, life in the UK, international projects
43
+ one_column_layout_without_heading:
44
+ description: No border at the top of the list of cards is present when using a one column layout without a heading. The first card item will still include a top border when using a 2 or 3 column layout as shown in the examples below.
45
+ data:
46
+ items:
45
47
  - link:
46
- text: Crime, justice and the&nbsp;law
47
- path: http://www.gov.uk
48
- description: Legal processes, courts and the police
49
- - link:
50
- text: Disabled people
51
- path: http://www.gov.uk
52
- description: Includes carers, your rights, benefits and the Equality Act
53
- - link:
54
- text: Driving and transport
48
+ text: Benefits
55
49
  path: http://www.gov.uk
56
- description: Includes vehicle tax, MOT and driving licences
50
+ description: Includes eligibility, appeals, tax credits and Universal Credit
57
51
  - link:
58
- text: Education and learning
52
+ text: Births, deaths, marriages and&nbsp;care
59
53
  path: http://www.gov.uk
60
- description: Includes student loans, admissions and apprenticeships
54
+ description: Parenting, civil partnerships, divorce and Lasting Power of Attorney
61
55
  - link:
62
- text: Employing people
56
+ text: Business and self-employed
63
57
  path: http://www.gov.uk
64
- description: Includes pay, contracts, hiring and redundancies
58
+ description: Tools and guidance for businesses
65
59
  - link:
66
- text: Environment and countryside
60
+ text: Childcare and parenting
67
61
  path: http://www.gov.uk
68
- description: Includes flooding, recycling and wildlife
62
+ description: Includes giving birth, fostering, adopting, benefits for children, childcare and schools
69
63
  - link:
70
- text: Housing and local services
64
+ text: Citizenship and living in the&nbsp;UK
71
65
  path: http://www.gov.uk
72
- description: Owning or renting and council services
66
+ description: Voting, community participation, life in the UK, international projects
73
67
  two_column_layout:
74
- description: Override default three column layout on desktop by passing through `two_column_layout` parameter (defaults to `false`).
68
+ description: Override default single column layout on desktop by setting the `columns` parameter to `2`.
75
69
  data:
76
- two_column_layout: true
70
+ columns: 2
77
71
  items:
78
72
  - link:
79
73
  text: Benefits
@@ -95,14 +89,31 @@ examples:
95
89
  text: Citizenship and living in the&nbsp;UK
96
90
  path: http://www.gov.uk
97
91
  description: Voting, community participation, life in the UK, international projects
92
+ three_column_layout:
93
+ description: Override default single column layout on desktop by setting the `columns` parameter to `3`.
94
+ data:
95
+ columns: 3
96
+ items:
98
97
  - link:
99
- text: Crime, justice and the&nbsp;law
98
+ text: Benefits
100
99
  path: http://www.gov.uk
101
- description: Legal processes, courts and the police
100
+ description: Includes eligibility, appeals, tax credits and Universal Credit
102
101
  - link:
103
- text: Disabled people
102
+ text: Births, deaths, marriages and&nbsp;care
104
103
  path: http://www.gov.uk
105
- description: Includes carers, your rights, benefits and the Equality Act
104
+ description: Parenting, civil partnerships, divorce and Lasting Power of Attorney
105
+ - link:
106
+ text: Business and self-employed
107
+ path: http://www.gov.uk
108
+ description: Tools and guidance for businesses
109
+ - link:
110
+ text: Childcare and parenting
111
+ path: http://www.gov.uk
112
+ description: Includes giving birth, fostering, adopting, benefits for children, childcare and schools
113
+ - link:
114
+ text: Citizenship and living in the&nbsp;UK
115
+ path: http://www.gov.uk
116
+ description: Voting, community participation, life in the UK, international projects
106
117
  custom_heading_levels:
107
118
  description: |
108
119
  Override default heading level by passing through `heading_level` parameter (defaults to `<h2>`).
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "41.0.0".freeze
2
+ VERSION = "41.1.1".freeze
3
3
  end
@@ -70,16 +70,19 @@ declare namespace axe {
70
70
  | LabelledShadowDomSelector
71
71
  | LabelledFramesSelector;
72
72
  type SelectorList = Array<Selector | FramesSelector> | NodeList;
73
+ type ContextProp = Selector | SelectorList;
73
74
  type ContextObject =
74
75
  | {
75
- include: Selector | SelectorList;
76
- exclude?: Selector | SelectorList;
76
+ include: ContextProp;
77
+ exclude?: ContextProp;
77
78
  }
78
79
  | {
79
- exclude: Selector | SelectorList;
80
- include?: Selector | SelectorList;
80
+ exclude: ContextProp;
81
+ include?: ContextProp;
81
82
  };
82
- type ElementContext = Selector | SelectorList | ContextObject;
83
+ type ContextSpec = ContextProp | ContextObject;
84
+ /** Synonym to ContextSpec */
85
+ type ElementContext = ContextSpec;
83
86
 
84
87
  type SerialSelector =
85
88
  | BaseSelector
@@ -406,6 +409,16 @@ declare namespace axe {
406
409
  shadowSelect: (selector: CrossTreeSelector) => Element | null;
407
410
  shadowSelectAll: (selector: CrossTreeSelector) => Element[];
408
411
  getStandards(): Required<Standards>;
412
+ isContextSpec: (context: unknown) => context is ContextSpec;
413
+ isContextObject: (context: unknown) => context is ContextObject;
414
+ isContextProp: (context: unknown) => context is ContextProp;
415
+ isLabelledFramesSelector: (
416
+ selector: unknown
417
+ ) => selector is LabelledFramesSelector;
418
+ isLabelledShadowDomSelector: (
419
+ selector: unknown
420
+ ) => selector is LabelledShadowDomSelector;
421
+
409
422
  DqElement: new (
410
423
  elm: Element,
411
424
  options?: { absolutePaths?: boolean }