@ons/design-system 62.2.4 → 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/access-code/example-access-code-error.njk +1 -1
- package/components/accordion/_macro.njk +1 -1
- package/components/breadcrumbs/_macro.njk +2 -2
- package/components/breadcrumbs/_macro.spec.js +1 -1
- package/components/button/_macro.njk +1 -1
- package/components/button/_macro.spec.js +6 -6
- package/components/card/_macro.njk +1 -1
- package/components/card/_macro.spec.js +1 -1
- 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/collapsible/_macro.spec.js +1 -1
- package/components/content-pagination/_macro.njk +2 -2
- package/components/content-pagination/_macro.spec.js +2 -2
- package/components/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +2 -2
- package/components/details/_macro.njk +1 -1
- package/components/details/_macro.spec.js +1 -1
- package/components/document-list/_macro.njk +1 -1
- package/components/footer/_macro.njk +2 -2
- package/components/footer/_macro.spec.js +7 -7
- package/components/header/_macro.njk +3 -3
- package/components/header/_macro.spec.js +5 -6
- package/components/{icons → icon}/_macro.spec.js +7 -7
- package/components/{images → image}/_macro.spec.js +13 -13
- package/components/{images/example-images-for-regular-screens.njk → image/example-image-for-regular-screens.njk} +1 -1
- package/components/{images/example-images-for-retina-screens.njk → image/example-image-for-retina-screens.njk} +1 -1
- 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/{lists → list}/_macro.njk +3 -3
- package/components/{lists → list}/_macro.spec.js +42 -42
- package/components/message/_macro.njk +2 -2
- package/components/message/_macro.spec.js +0 -1
- package/components/metadata/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
- package/components/navigation/_macro.njk +3 -3
- package/components/pagination/_macro.njk +65 -69
- package/components/pagination/_macro.spec.js +18 -16
- package/components/pagination/example-pagination-first.njk +5 -5
- package/components/pagination/example-pagination-last.njk +5 -5
- package/components/pagination/example-pagination-with-no-range-indicator.njk +11 -11
- package/components/pagination/example-pagination.njk +2 -2
- package/components/panel/_macro.njk +2 -2
- package/components/panel/_macro.spec.js +2 -2
- package/components/panel/example-panel-with-error-summary.njk +1 -1
- package/components/phase-banner/_phase-banner.scss +2 -1
- package/components/question/_macro.njk +1 -1
- package/components/question/_macro.spec.js +1 -1
- package/components/quote/_macro.njk +1 -1
- package/components/quote/_macro.spec.js +1 -1
- package/components/related-content/_macro.njk +1 -1
- package/components/related-content/_macro.spec.js +1 -1
- package/components/related-content/example-related-content-general.njk +1 -1
- package/components/relationships/example-relationships-error.njk +1 -1
- package/components/section-navigation/_macro.njk +2 -2
- package/components/select/_macro.njk +1 -2
- package/components/share-page/_macro.njk +1 -1
- package/components/share-page/_macro.spec.js +5 -5
- package/components/summary/_macro.njk +5 -6
- package/components/summary/_macro.spec.js +8 -23
- 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 +4 -4
- package/components/table/_macro.spec.js +17 -1
- package/components/table/example-table-basic.njk +1 -2
- package/components/table/example-table-numeric.njk +6 -3
- package/components/table-of-contents/_macro.njk +1 -1
- package/components/table-of-contents/_macro.spec.js +2 -2
- package/components/tabs/_macro.njk +6 -5
- package/components/tabs/_macro.spec.js +25 -2
- 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/components/timeline/_macro.njk +1 -1
- package/components/timeline/_macro.spec.js +1 -1
- package/css/main.css +3 -3
- package/css/print.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 +3 -4
- package/components/search/_macro.njk +0 -30
- package/components/search/_macro.spec.js +0 -69
- package/components/search/_search.scss +0 -9
- /package/components/{icons/_icons.scss → icon/_icon.scss} +0 -0
- /package/components/{icons → icon}/_macro.njk +0 -0
- /package/components/{images/_images.scss → image/_image.scss} +0 -0
- /package/components/{images → image}/_macro.njk +0 -0
- /package/components/{lists → list}/_list.scss +0 -0
package/scss/main.scss
CHANGED
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
@import '../components/footer/footer';
|
|
27
27
|
@import '../components/header/header';
|
|
28
28
|
@import '../components/hero/hero';
|
|
29
|
-
@import '../components/
|
|
30
|
-
@import '../components/
|
|
29
|
+
@import '../components/icon/icon';
|
|
30
|
+
@import '../components/image/image';
|
|
31
31
|
@import '../components/input/input-type';
|
|
32
32
|
@import '../components/input/input';
|
|
33
33
|
@import '../components/label/label';
|
|
34
34
|
@import '../components/language-selector/language';
|
|
35
|
-
@import '../components/
|
|
35
|
+
@import '../components/list/list';
|
|
36
36
|
@import '../components/message-list/message-list';
|
|
37
37
|
@import '../components/message/message';
|
|
38
38
|
@import '../components/metadata/metadata';
|
|
@@ -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
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|