@ons/design-system 60.0.0 → 60.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -157,22 +157,14 @@
157
157
  {% endif %}
158
158
  </div>
159
159
  {% endif %}
160
+ {% if not params.poweredBy %}
161
+ <div class="ons-footer__poweredby ons-u-mb-m">
162
+ {{ onsLogo | safe }}
163
+ </div>
164
+ {% endif %}
160
165
  </div>
161
- </div>
162
-
163
- <div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between ons-footer__poweredby">
164
- {% if params.poweredBy %}
165
- {{ params.poweredBy | safe }}
166
- {% else %}
167
- <div class="ons-grid__col ons-u-mb-m">
168
- {{ onsLogo | safe }}
169
- </div>
170
- {% endif %}
171
- </div>
172
-
173
- {% if params.crest %}
174
- <!-- Crest -->
175
- <div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
166
+ {% if params.crest %}
167
+ <!-- Crest -->
176
168
  <div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
177
169
  {{
178
170
  onsIcon({
@@ -180,10 +172,11 @@
180
172
  })
181
173
  }}
182
174
  </div>
183
- </div>
184
-
175
+ {% endif %}
176
+ </div>
177
+ {% if params.poweredBy %}
178
+ {{ params.poweredBy | safe }}
185
179
  {% endif %}
186
-
187
180
  {% if params.copyrightDeclaration %}
188
181
  <!-- Copyright -->
189
182
  <div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
@@ -416,28 +416,28 @@ describe('macro: footer', () => {
416
416
  [
417
417
  'the `poweredBy` and `OGLLink` parameters are provided',
418
418
  {
419
- poweredBy: '<img src="logo.svg" alt="logo">',
419
+ poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
420
420
  OGLLink: EXAMPLE_OGL_LINK_PARAM,
421
421
  },
422
422
  ],
423
423
  [
424
424
  'the `poweredBy` and `legal` parameters are provided',
425
425
  {
426
- poweredBy: '<img src="logo.svg" alt="logo">',
426
+ poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
427
427
  legal: EXAMPLE_LEGAL_PARAM,
428
428
  },
429
429
  ],
430
430
  [
431
431
  'the `poweredBy` and `crest` parameters are provided',
432
432
  {
433
- poweredBy: '<img src="logo.svg" alt="logo">',
433
+ poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
434
434
  crest: true,
435
435
  },
436
436
  ],
437
437
  [
438
438
  'the `poweredBy`, `legal` and `crest` parameters are provided',
439
439
  {
440
- poweredBy: '<img src="logo.svg" alt="logo">',
440
+ poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
441
441
  legal: EXAMPLE_LEGAL_PARAM,
442
442
  crest: true,
443
443
  },
@@ -445,7 +445,7 @@ describe('macro: footer', () => {
445
445
  [
446
446
  'the `poweredBy` parameter is provided but the `legal` and `crest` parameters are not provided',
447
447
  {
448
- poweredBy: '<img src="logo.svg" alt="logo">',
448
+ poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
449
449
  },
450
450
  ],
451
451
  ])('where %s', (_, poweredByParams) => {
@@ -463,7 +463,7 @@ describe('macro: footer', () => {
463
463
  it('renders the expected logo', () => {
464
464
  const $ = cheerio.load(renderComponent('footer', params));
465
465
 
466
- expect($('.ons-footer__poweredby img').attr('src')).toBe('logo.svg');
466
+ expect($('.custom-logo').length).toBe(1);
467
467
  });
468
468
  });
469
469
  });
@@ -36,11 +36,15 @@
36
36
  })
37
37
  }}
38
38
  {% endif %}
39
+ {% if caller %}
40
+ <div class="ons-hero__additional-content">
41
+ {{- caller() -}}
42
+ </div>
43
+ {% endif %}
39
44
  </div>
40
-
41
- {% if caller %}
42
- <div class="ons-hero__additional">
43
- {{- caller() -}}
45
+ {% if params.html %}
46
+ <div class="ons-hero__additional-html">
47
+ {{- params.html | safe -}}
44
48
  </div>
45
49
  {% endif %}
46
50
  </div>
@@ -61,6 +61,13 @@ describe('macro: hero', () => {
61
61
  expect(title).toBe('Hero text');
62
62
  });
63
63
 
64
+ it('has expected `html`', () => {
65
+ const $ = cheerio.load(renderComponent('hero', { ...EXAMPLE_HERO, html: '<span class="some-html">some html</span>' }));
66
+
67
+ const htmlOutput = $('.ons-hero__additional-html').html();
68
+ expect(htmlOutput).toBe('<span class="some-html">some html</span>');
69
+ });
70
+
64
71
  it('outputs the expected button', () => {
65
72
  const faker = templateFaker();
66
73
  const buttonSpy = faker.spy('button');
@@ -83,7 +90,7 @@ describe('macro: hero', () => {
83
90
  it('calls with content', () => {
84
91
  const $ = cheerio.load(renderComponent('hero', { EXAMPLE_HERO }, 'Example content...'));
85
92
 
86
- const content = $('.ons-hero__additional')
93
+ const content = $('.ons-hero__additional-content')
87
94
  .text()
88
95
  .trim();
89
96
  expect(content).toEqual(expect.stringContaining('Example content...'));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ons/design-system",
3
3
  "description": "ONS Design System built CSS, JS, and Nunjucks templates",
4
- "version": "60.0.0",
4
+ "version": "60.0.1",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "author": {