@ons/design-system 63.0.0 → 64.0.0
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.
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +1 -1
- package/components/char-check-limit/character-check.spec.js +16 -16
- package/components/checkboxes/_macro.njk +3 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
- package/components/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +2 -2
- package/components/input/_input.scss +6 -0
- package/components/input/_macro.njk +20 -13
- package/components/input/_macro.spec.js +2 -22
- package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
- package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
- package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
- package/components/select/_macro.njk +1 -2
- package/components/summary/_macro.njk +1 -2
- package/components/summary/_macro.spec.js +7 -22
- package/components/summary/example-summary-grouped-total.njk +0 -2
- package/components/summary/example-summary-grouped-with-errors.njk +0 -4
- package/components/summary/example-summary-grouped.njk +0 -19
- package/components/summary/example-summary-household.njk +0 -5
- package/components/summary/example-summary-hub.njk +0 -8
- package/components/summary/example-summary-multiple.njk +0 -4
- package/components/summary/example-summary.njk +0 -4
- package/components/table/_macro.njk +1 -1
- package/components/table/_macro.spec.js +16 -0
- package/components/table/example-table-numeric.njk +6 -3
- package/components/tabs/_macro.njk +4 -3
- package/components/tabs/_macro.spec.js +23 -0
- package/components/tabs/_tabs.scss +11 -15
- package/components/tabs/example-tabs.njk +6 -6
- package/components/tabs/tabs.js +24 -8
- package/components/tabs/tabs.spec.js +40 -2
- package/components/textarea/_macro.njk +2 -2
- package/components/textarea/_macro.spec.js +2 -2
- package/components/textarea/textarea.spec.js +6 -10
- package/css/main.css +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/main.scss +0 -1
- package/components/search/_macro.njk +0 -30
- package/components/search/_macro.spec.js +0 -69
- package/components/search/_search.scss +0 -9
package/scss/main.scss
CHANGED
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
@import '../components/radios/radios';
|
|
48
48
|
@import '../components/related-content/related-content';
|
|
49
49
|
@import '../components/relationships/relationships';
|
|
50
|
-
@import '../components/search/search';
|
|
51
50
|
@import '../components/section-navigation/section-navigation';
|
|
52
51
|
@import '../components/skip-to-content/skip';
|
|
53
52
|
@import '../components/status/status';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{% macro onsSearch(params) %}
|
|
2
|
-
{% from "components/button/_macro.njk" import onsButton %}
|
|
3
|
-
|
|
4
|
-
{% set content = caller() %}
|
|
5
|
-
|
|
6
|
-
<div class="ons-search-component">
|
|
7
|
-
{{ content | safe }}
|
|
8
|
-
|
|
9
|
-
{%- set buttonLabel -%}
|
|
10
|
-
{%- if params.searchButton.visuallyHideButtonText == true -%}
|
|
11
|
-
<span class="ons-u-vh">{{ params.searchButton.text }}</span>
|
|
12
|
-
{%- else -%}
|
|
13
|
-
{{ params.searchButton.text }}
|
|
14
|
-
{%- endif -%}
|
|
15
|
-
{%- endset -%}
|
|
16
|
-
|
|
17
|
-
{{
|
|
18
|
-
onsButton({
|
|
19
|
-
"type": params.searchButton.type,
|
|
20
|
-
"html": buttonLabel,
|
|
21
|
-
"id": params.searchButton.id,
|
|
22
|
-
"variants": 'small',
|
|
23
|
-
"classes": 'ons-search__btn' + (" " + params.searchButton.classes if params.searchButton.classes else ""),
|
|
24
|
-
"attributes": params.searchButton.attributes,
|
|
25
|
-
"iconType": params.searchButton.iconType,
|
|
26
|
-
"iconPosition": 'only' if params.searchButton.visuallyHideButtonText == true else 'before'
|
|
27
|
-
})
|
|
28
|
-
}}
|
|
29
|
-
</div>
|
|
30
|
-
{% endmacro %}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/** @jest-environment jsdom */
|
|
2
|
-
|
|
3
|
-
import * as cheerio from 'cheerio';
|
|
4
|
-
|
|
5
|
-
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
|
|
6
|
-
|
|
7
|
-
const EXAMPLE_SEARCH = {
|
|
8
|
-
searchButton: {
|
|
9
|
-
id: 'search-button-id',
|
|
10
|
-
type: 'button',
|
|
11
|
-
text: 'Search for address',
|
|
12
|
-
iconType: 'search',
|
|
13
|
-
classes: 'extra-search-button-class',
|
|
14
|
-
attributes: { a: 42 },
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const FAKE_NESTED_CONTENT = '<span class="test--nested">Nested content...</span>';
|
|
19
|
-
|
|
20
|
-
describe('macro: search', () => {
|
|
21
|
-
it('renders expected nested content', () => {
|
|
22
|
-
const $ = cheerio.load(renderComponent('search', EXAMPLE_SEARCH, FAKE_NESTED_CONTENT));
|
|
23
|
-
|
|
24
|
-
expect($('.ons-search-component .test--nested').text()).toBe('Nested content...');
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('renders button component', () => {
|
|
28
|
-
const faker = templateFaker();
|
|
29
|
-
const buttonSpy = faker.spy('button');
|
|
30
|
-
|
|
31
|
-
faker.renderComponent('input', EXAMPLE_SEARCH);
|
|
32
|
-
|
|
33
|
-
expect(buttonSpy.occurrences[0]).toEqual({
|
|
34
|
-
id: 'search-button-id',
|
|
35
|
-
type: 'button',
|
|
36
|
-
html: 'Search for address',
|
|
37
|
-
variants: 'small',
|
|
38
|
-
classes: 'ons-search__btn extra-search-button-class',
|
|
39
|
-
attributes: EXAMPLE_SEARCH.searchButton.attributes,
|
|
40
|
-
iconType: 'search',
|
|
41
|
-
iconPosition: 'before',
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('renders button component with a visibly hidden label when specified', () => {
|
|
46
|
-
const faker = templateFaker();
|
|
47
|
-
const buttonSpy = faker.spy('button');
|
|
48
|
-
|
|
49
|
-
faker.renderComponent('input', {
|
|
50
|
-
searchButton: {
|
|
51
|
-
id: 'search-button-id',
|
|
52
|
-
type: 'button',
|
|
53
|
-
text: 'Search for address',
|
|
54
|
-
iconType: 'search',
|
|
55
|
-
visuallyHideButtonText: true,
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
expect(buttonSpy.occurrences[0]).toEqual({
|
|
60
|
-
id: 'search-button-id',
|
|
61
|
-
type: 'button',
|
|
62
|
-
html: '<span class="ons-u-vh">Search for address</span>',
|
|
63
|
-
variants: 'small',
|
|
64
|
-
classes: 'ons-search__btn',
|
|
65
|
-
iconPosition: 'only',
|
|
66
|
-
iconType: 'search',
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|