@ons/design-system 63.0.0 → 65.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/_macro.njk +2 -2
- package/components/access-code/_macro.spec.js +2 -2
- package/components/access-code/access-code.dom.js +11 -0
- package/components/access-code/{uac.js → access-code.js} +1 -1
- package/components/access-code/{uac.scss → access-code.scss} +1 -1
- package/components/access-code/example-access-code-error.njk +6 -6
- package/components/access-code/example-access-code.njk +4 -4
- package/components/accordion/_macro.njk +2 -2
- package/components/accordion/_macro.spec.js +3 -3
- package/components/accordion/accordion.dom.js +1 -1
- package/components/accordion/accordion.js +1 -1
- package/components/breadcrumbs/_breadcrumbs.scss +6 -6
- package/components/breadcrumbs/_macro.njk +4 -4
- package/components/breadcrumbs/_macro.spec.js +13 -13
- package/components/button/_button.scss +27 -27
- package/components/button/_macro.spec.js +2 -2
- package/components/call-to-action/_macro.njk +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/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +2 -2
- package/components/date-input/_macro.njk +3 -3
- package/components/date-input/_macro.spec.js +118 -0
- package/components/date-input/example-date-input-error-for-single-field.njk +63 -0
- package/components/details/_details.scss +1 -1
- package/components/external-link/_external-link.scss +3 -3
- package/components/external-link/_macro.njk +1 -1
- package/components/footer/_footer.scss +2 -2
- package/components/footer/example-footer-with-alternative-organisation.njk +5 -5
- package/components/header/_header.scss +8 -8
- package/components/icon/_icon.scss +1 -1
- package/components/icon/_macro.njk +35 -35
- package/components/icon/_macro.spec.js +1 -1
- package/components/image/_image.scss +2 -2
- package/components/image/_macro.njk +4 -6
- package/components/image/_macro.spec.js +10 -10
- 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/_macro.njk +4 -3
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
- package/components/pagination/_macro.njk +2 -2
- package/components/pagination/example-pagination-first.njk +0 -2
- package/components/pagination/example-pagination-last.njk +0 -2
- package/components/pagination/example-pagination-with-no-range-indicator.njk +0 -2
- package/components/pagination/example-pagination.njk +0 -2
- package/components/panel/_macro.njk +1 -1
- package/components/panel/_panel.scss +7 -7
- package/components/password/_macro.njk +1 -1
- package/components/password/example-password.njk +1 -2
- package/components/quote/_quote.scss +1 -1
- package/components/radios/_macro.njk +1 -1
- package/components/select/_macro.njk +1 -2
- package/components/skip-to-content/_macro.njk +2 -1
- package/components/skip-to-content/_macro.spec.js +17 -3
- package/components/skip-to-content/_skip.scss +1 -1
- package/components/skip-to-content/skip-to-content.dom.js +1 -1
- package/components/skip-to-content/skip-to-content.spec.js +3 -3
- package/components/summary/_macro.njk +1 -2
- package/components/summary/_macro.spec.js +7 -22
- package/components/summary/_summary.scss +1 -1
- 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/_table.scss +6 -6
- package/components/table/example-table-numeric.njk +6 -3
- package/components/table/sortable-table.js +1 -1
- 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/components/timeline/_macro.njk +18 -22
- package/components/timeline/_macro.spec.js +18 -0
- package/components/video/example-video.njk +1 -1
- package/components/video/video.js +10 -1
- package/components/video/video.spec.js +33 -0
- package/css/main.css +3 -3
- package/css/print.css +1 -1
- package/js/main.js +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +1 -1
- package/scss/main.scss +1 -2
- package/scss/objects/_spacing.scss +3 -3
- package/scss/overrides/hcm.scss +6 -6
- package/scss/overrides/rtl.scss +2 -2
- package/scss/print.scss +1 -1
- package/components/access-code/uac.dom.js +0 -11
- package/components/search/_macro.njk +0 -30
- package/components/search/_macro.spec.js +0 -69
- package/components/search/_search.scss +0 -9
- /package/components/access-code/{uac.spec.js → access-code.spec.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{% from "components/input/_macro.njk" import onsInput %}
|
|
2
2
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
3
3
|
|
|
4
|
-
{% macro
|
|
4
|
+
{% macro onsAccessCode(params) %}
|
|
5
5
|
{% set groupSize = params.groupSize | default(4) %}
|
|
6
6
|
{% set extraSpaces = (params.maxlength | default(16) / groupSize) - 1 %}
|
|
7
7
|
{% set maxlength = params.maxlength | default(16) + extraSpaces %}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"id": params.id,
|
|
12
12
|
"type": params.type,
|
|
13
13
|
"name": params.name,
|
|
14
|
-
"classes": "ons-
|
|
14
|
+
"classes": "ons-access-code__input ons-js-access-code" + (" ons-u-mb-xs" if params.postTextboxLinkText else ""),
|
|
15
15
|
"label": params.label,
|
|
16
16
|
"attributes": {
|
|
17
17
|
"maxlength": maxlength,
|
|
@@ -150,13 +150,13 @@ describe('macro: access-code', () => {
|
|
|
150
150
|
const $ = cheerio.load(
|
|
151
151
|
renderComponent('access-code', {
|
|
152
152
|
error: {
|
|
153
|
-
id: '
|
|
153
|
+
id: 'access-code-error',
|
|
154
154
|
text: 'Enter an access code',
|
|
155
155
|
},
|
|
156
156
|
}),
|
|
157
157
|
);
|
|
158
158
|
|
|
159
|
-
expect($('#
|
|
159
|
+
expect($('#access-code-error').length).toBe(1);
|
|
160
160
|
expect($('.ons-panel__error > strong').text()).toBe('Enter an access code');
|
|
161
161
|
});
|
|
162
162
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import domready from '../../js/domready';
|
|
2
|
+
|
|
3
|
+
domready(async () => {
|
|
4
|
+
const accessCodeInputs = [...document.querySelectorAll('.ons-js-access-code')];
|
|
5
|
+
|
|
6
|
+
if (accessCodeInputs.length) {
|
|
7
|
+
const accessCode = (await import('./access-code')).default;
|
|
8
|
+
|
|
9
|
+
accessCodeInputs.forEach(element => new accessCode(element));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -3,7 +3,7 @@ title: "Example: Access code error"
|
|
|
3
3
|
layout: ~
|
|
4
4
|
---
|
|
5
5
|
{% extends "layout/_template.njk" %}
|
|
6
|
-
{% from "components/access-code/_macro.njk" import
|
|
6
|
+
{% from "components/access-code/_macro.njk" import onsAccessCode %}
|
|
7
7
|
{% from "components/button/_macro.njk" import onsButton %}
|
|
8
8
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
9
9
|
{% from "components/details/_macro.njk" import onsDetails %}
|
|
@@ -27,7 +27,7 @@ layout: ~
|
|
|
27
27
|
"itemsList": [
|
|
28
28
|
{
|
|
29
29
|
"text": "Enter an access code",
|
|
30
|
-
"url": "#
|
|
30
|
+
"url": "#access-code-error",
|
|
31
31
|
"variants": "inPageLink"
|
|
32
32
|
}
|
|
33
33
|
]
|
|
@@ -37,9 +37,9 @@ layout: ~
|
|
|
37
37
|
|
|
38
38
|
<h1 class="ons-u-mt-l">Start study</h1>
|
|
39
39
|
|
|
40
|
-
{{
|
|
41
|
-
"id": "
|
|
42
|
-
"name": "
|
|
40
|
+
{{ onsAccessCode({
|
|
41
|
+
"id": "access-code",
|
|
42
|
+
"name": "access-code",
|
|
43
43
|
"postTextboxLinkText": "Where to find your access code",
|
|
44
44
|
"postTextboxLinkUrl": "#0",
|
|
45
45
|
"label": {
|
|
@@ -48,7 +48,7 @@ layout: ~
|
|
|
48
48
|
},
|
|
49
49
|
"securityMessage": "Your personal information is protected by law and will be kept confidential",
|
|
50
50
|
"error": {
|
|
51
|
-
"id": "
|
|
51
|
+
"id": "access-code-error",
|
|
52
52
|
"text": "Enter an access code"
|
|
53
53
|
}
|
|
54
54
|
}) }}
|
|
@@ -3,7 +3,7 @@ title: "Example: Access code"
|
|
|
3
3
|
layout: ~
|
|
4
4
|
---
|
|
5
5
|
{% extends "layout/_template.njk" %}
|
|
6
|
-
{% from "components/access-code/_macro.njk" import
|
|
6
|
+
{% from "components/access-code/_macro.njk" import onsAccessCode %}
|
|
7
7
|
{% from "components/button/_macro.njk" import onsButton %}
|
|
8
8
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
9
9
|
{% from "components/details/_macro.njk" import onsDetails %}
|
|
@@ -17,9 +17,9 @@ layout: ~
|
|
|
17
17
|
{% block main %}
|
|
18
18
|
<h1 class="ons-u-mt-l">Start study</h1>
|
|
19
19
|
|
|
20
|
-
{{
|
|
21
|
-
"id": "
|
|
22
|
-
"name": "
|
|
20
|
+
{{ onsAccessCode({
|
|
21
|
+
"id": "access-code",
|
|
22
|
+
"name": "access-code",
|
|
23
23
|
"postTextboxLinkText": "Where to find your access code",
|
|
24
24
|
"postTextboxLinkUrl": "#0",
|
|
25
25
|
"label": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
onsButton({
|
|
16
16
|
"type": "button",
|
|
17
17
|
"text": params.allButton.open,
|
|
18
|
-
"classes": "ons-
|
|
18
|
+
"classes": "ons-accordion__toggle-all ons-u-mb-s ons-u-d-no",
|
|
19
19
|
"variants": ["secondary", "small"],
|
|
20
|
-
"innerClasses": "ons-
|
|
20
|
+
"innerClasses": "ons-accordion__toggle-all-inner",
|
|
21
21
|
"attributes": attributes
|
|
22
22
|
})
|
|
23
23
|
}}
|
|
@@ -162,7 +162,7 @@ describe('macro: accordion', () => {
|
|
|
162
162
|
}),
|
|
163
163
|
);
|
|
164
164
|
|
|
165
|
-
expect($('button.ons-
|
|
165
|
+
expect($('button.ons-accordion__toggle-all').length).toBe(1);
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
it('has additionally provided `attributes`', () => {
|
|
@@ -180,8 +180,8 @@ describe('macro: accordion', () => {
|
|
|
180
180
|
}),
|
|
181
181
|
);
|
|
182
182
|
|
|
183
|
-
expect($('button.ons-
|
|
184
|
-
expect($('button.ons-
|
|
183
|
+
expect($('button.ons-accordion__toggle-all').attr('a')).toBe('123');
|
|
184
|
+
expect($('button.ons-accordion__toggle-all').attr('b')).toBe('456');
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import domready from '../../js/domready';
|
|
2
2
|
|
|
3
3
|
async function initialiseAccordions() {
|
|
4
|
-
const toggleAllButtons = [...document.querySelectorAll('.ons-
|
|
4
|
+
const toggleAllButtons = [...document.querySelectorAll('.ons-accordion__toggle-all')];
|
|
5
5
|
|
|
6
6
|
if (toggleAllButtons.length) {
|
|
7
7
|
const detailsComponents = [...document.querySelectorAll('.ons-js-details')];
|
|
@@ -3,7 +3,7 @@ export default class Accordion {
|
|
|
3
3
|
this.openDetailsEls = 0;
|
|
4
4
|
|
|
5
5
|
this.button = button;
|
|
6
|
-
this.buttonInner = button.querySelector('.ons-
|
|
6
|
+
this.buttonInner = button.querySelector('.ons-accordion__toggle-all-inner');
|
|
7
7
|
this.group = button.getAttribute('data-group');
|
|
8
8
|
this.detailsEls = detailsEls.filter(details => details.group === this.group);
|
|
9
9
|
this.totalDetailsEls = this.detailsEls.length;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$breadcrumb-chevron-height: 0.65rem;
|
|
2
2
|
|
|
3
|
-
.ons-
|
|
3
|
+
.ons-breadcrumbs {
|
|
4
4
|
align-items: center;
|
|
5
5
|
display: flex;
|
|
6
6
|
padding: 1rem 0;
|
|
@@ -20,7 +20,7 @@ $breadcrumb-chevron-height: 0.65rem;
|
|
|
20
20
|
display: none;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.ons-
|
|
23
|
+
.ons-icon {
|
|
24
24
|
height: $breadcrumb-chevron-height;
|
|
25
25
|
margin: 0 0.2rem;
|
|
26
26
|
vertical-align: middle;
|
|
@@ -30,7 +30,7 @@ $breadcrumb-chevron-height: 0.65rem;
|
|
|
30
30
|
&:nth-last-child(1) {
|
|
31
31
|
// small screen last child
|
|
32
32
|
direction: rtl;
|
|
33
|
-
.ons-
|
|
33
|
+
.ons-icon {
|
|
34
34
|
margin-left: -0.13rem;
|
|
35
35
|
transform: rotate(180deg);
|
|
36
36
|
}
|
|
@@ -46,7 +46,7 @@ $breadcrumb-chevron-height: 0.65rem;
|
|
|
46
46
|
&:nth-last-child(1) {
|
|
47
47
|
// last child
|
|
48
48
|
direction: ltr;
|
|
49
|
-
.ons-
|
|
49
|
+
.ons-icon {
|
|
50
50
|
display: none;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -54,13 +54,13 @@ $breadcrumb-chevron-height: 0.65rem;
|
|
|
54
54
|
&:first-child:nth-last-child(1) {
|
|
55
55
|
//first and last child
|
|
56
56
|
direction: rtl;
|
|
57
|
-
.ons-
|
|
57
|
+
.ons-icon {
|
|
58
58
|
display: inline-block;
|
|
59
59
|
vertical-align: middle;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
&:not(:last-child).ons-
|
|
63
|
+
&:not(:last-child).ons-icon {
|
|
64
64
|
//not last child
|
|
65
65
|
margin: 0;
|
|
66
66
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
2
2
|
|
|
3
3
|
{% macro onsBreadcrumbs(params) %}
|
|
4
|
-
<nav class="ons-
|
|
5
|
-
<ol class="ons-
|
|
4
|
+
<nav class="ons-breadcrumbs{{ ' ' + params.classes if params.classes else '' }}" aria-label="{{ params.ariaLabel | default("Breadcrumbs") }}" {% if params.id %} id="{{ params.id }}"{% endif %}>
|
|
5
|
+
<ol class="ons-breadcrumbs__items ons-u-fs-s">
|
|
6
6
|
{% for item in params.itemsList %}
|
|
7
|
-
<li class="ons-
|
|
8
|
-
<a class="ons-
|
|
7
|
+
<li class="ons-breadcrumbs__item{{ ' ' + item.itemClasses if item.itemClasses else '' }}" id="breadcrumb-{{ loop.index }}">
|
|
8
|
+
<a class="ons-breadcrumbs__link{{ ' ' + item.linkClasses if item.linkClasses else '' }}" href="{{ item.url }}"{% if item.id %} id="{{ item.id }}"{% endif %}
|
|
9
9
|
{% if item.attributes %}{% for attribute, value in (item.attributes.items() if item.attributes is mapping and item.attributes.items else item.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}
|
|
10
10
|
>{{ item.text }}</a>
|
|
11
11
|
{{
|
|
@@ -58,62 +58,62 @@ describe('macro: breadcrumbs', () => {
|
|
|
58
58
|
it('has additionally provided style classes', () => {
|
|
59
59
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
60
60
|
|
|
61
|
-
expect($('.ons-
|
|
62
|
-
expect($('.ons-
|
|
61
|
+
expect($('.ons-breadcrumbs').hasClass('extra-class')).toBe(true);
|
|
62
|
+
expect($('.ons-breadcrumbs').hasClass('another-extra-class')).toBe(true);
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('has a default `aria-label` of "Breadcrumbs"', () => {
|
|
66
66
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS_MINIMAL));
|
|
67
67
|
|
|
68
|
-
expect($('.ons-
|
|
68
|
+
expect($('.ons-breadcrumbs').attr('aria-label')).toBe('Breadcrumbs');
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
it('has the provided `ariaLabel` for `aria-label`', () => {
|
|
72
72
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
73
73
|
|
|
74
|
-
expect($('.ons-
|
|
74
|
+
expect($('.ons-breadcrumbs').attr('aria-label')).toBe('Breadcrumbs label');
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
it('has the provided `id`', () => {
|
|
78
78
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
79
79
|
|
|
80
|
-
expect($('.ons-
|
|
80
|
+
expect($('.ons-breadcrumbs').attr('id')).toBe('example-breadcrumbs');
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
it('has additionally provided style classes on `item` element', () => {
|
|
84
84
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
85
85
|
|
|
86
|
-
expect($('.ons-
|
|
87
|
-
expect($('.ons-
|
|
86
|
+
expect($('.ons-breadcrumbs__item:first').hasClass('item-extra-class')).toBe(true);
|
|
87
|
+
expect($('.ons-breadcrumbs__item:first').hasClass('item-another-extra-class')).toBe(true);
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
it('has additionally provided style classes on `link` element', () => {
|
|
91
91
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
92
92
|
|
|
93
|
-
expect($('.ons-
|
|
94
|
-
expect($('.ons-
|
|
93
|
+
expect($('.ons-breadcrumbs__link:first').hasClass('link-extra-class')).toBe(true);
|
|
94
|
+
expect($('.ons-breadcrumbs__link:first').hasClass('link-another-extra-class')).toBe(true);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
it('has provided `url` on `link` elements', () => {
|
|
98
98
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
99
99
|
|
|
100
|
-
const urls = mapAll($('.ons-
|
|
100
|
+
const urls = mapAll($('.ons-breadcrumbs__link'), node => node.attr('href'));
|
|
101
101
|
expect(urls).toEqual(['https://example.com/', 'https://example.com/guide/']);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
it('has provided `text` on `link` elements', () => {
|
|
105
105
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
106
106
|
|
|
107
|
-
const labels = mapAll($('.ons-
|
|
107
|
+
const labels = mapAll($('.ons-breadcrumbs__link'), node => node.text().trim());
|
|
108
108
|
expect(labels).toEqual(['Home', 'Guide']);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
it('has provided `attributes` on `link` elements', () => {
|
|
112
112
|
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
113
113
|
|
|
114
|
-
const testValuesA = mapAll($('.ons-
|
|
114
|
+
const testValuesA = mapAll($('.ons-breadcrumbs__link'), node => node.attr('data-a'));
|
|
115
115
|
expect(testValuesA).toEqual(['123', '789']);
|
|
116
|
-
const testValuesB = mapAll($('.ons-
|
|
116
|
+
const testValuesB = mapAll($('.ons-breadcrumbs__link'), node => node.attr('data-b'));
|
|
117
117
|
expect(testValuesB).toEqual(['456', 'ABC']);
|
|
118
118
|
});
|
|
119
119
|
|
|
@@ -31,7 +31,7 @@ $button-shadow-size: 3px;
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
&--search {
|
|
34
|
-
.ons-
|
|
34
|
+
.ons-icon {
|
|
35
35
|
@include mq(s, l) {
|
|
36
36
|
margin-right: 0.5rem;
|
|
37
37
|
}
|
|
@@ -49,7 +49,7 @@ $button-shadow-size: 3px;
|
|
|
49
49
|
pointer-events: none;
|
|
50
50
|
position: relative;
|
|
51
51
|
|
|
52
|
-
.ons-
|
|
52
|
+
.ons-icon {
|
|
53
53
|
fill: var(--ons-color-text-inverse);
|
|
54
54
|
height: 18px;
|
|
55
55
|
margin-top: -$button-shadow-size;
|
|
@@ -76,7 +76,7 @@ $button-shadow-size: 3px;
|
|
|
76
76
|
box-shadow: 0 ems($button-shadow-size) 0 var(--ons-color-text-link-focus);
|
|
77
77
|
color: var(--ons-color-text-link-focus);
|
|
78
78
|
|
|
79
|
-
.ons-
|
|
79
|
+
.ons-icon {
|
|
80
80
|
fill: var(--ons-color-text-link-focus);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -93,7 +93,7 @@ $button-shadow-size: 3px;
|
|
|
93
93
|
box-shadow: none;
|
|
94
94
|
color: var(--ons-color-text-inverse);
|
|
95
95
|
|
|
96
|
-
.ons-
|
|
96
|
+
.ons-icon {
|
|
97
97
|
fill: var(--ons-color-text-inverse);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -112,7 +112,7 @@ $button-shadow-size: 3px;
|
|
|
112
112
|
&--small & {
|
|
113
113
|
&__inner {
|
|
114
114
|
padding: 0.5em 0.7em;
|
|
115
|
-
.ons-
|
|
115
|
+
.ons-icon {
|
|
116
116
|
height: 16px;
|
|
117
117
|
width: 16px;
|
|
118
118
|
}
|
|
@@ -141,7 +141,7 @@ $button-shadow-size: 3px;
|
|
|
141
141
|
color: var(--ons-color-text);
|
|
142
142
|
font-weight: $font-weight-regular;
|
|
143
143
|
|
|
144
|
-
.ons-
|
|
144
|
+
.ons-icon {
|
|
145
145
|
fill: var(--ons-color-text);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -177,7 +177,7 @@ $button-shadow-size: 3px;
|
|
|
177
177
|
outline: inherit;
|
|
178
178
|
|
|
179
179
|
&__inner {
|
|
180
|
-
.ons-
|
|
180
|
+
.ons-icon {
|
|
181
181
|
fill: var(--ons-color-text);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -196,7 +196,7 @@ $button-shadow-size: 3px;
|
|
|
196
196
|
color: var(--ons-color-text-link);
|
|
197
197
|
font-weight: $font-weight-regular;
|
|
198
198
|
padding: 0;
|
|
199
|
-
.ons-
|
|
199
|
+
.ons-icon {
|
|
200
200
|
fill: var(--ons-color-text-link);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -205,7 +205,7 @@ $button-shadow-size: 3px;
|
|
|
205
205
|
&--text-link-inverse & {
|
|
206
206
|
&__inner {
|
|
207
207
|
color: var(--ons-color-text-inverse-link);
|
|
208
|
-
.ons-
|
|
208
|
+
.ons-icon {
|
|
209
209
|
fill: var(--ons-color-text-inverse-link);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -217,7 +217,7 @@ $button-shadow-size: 3px;
|
|
|
217
217
|
&__inner {
|
|
218
218
|
background: none;
|
|
219
219
|
color: var(--ons-color-text-link-hover);
|
|
220
|
-
.ons-
|
|
220
|
+
.ons-icon {
|
|
221
221
|
fill: var(--ons-color-text-link-hover);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -228,7 +228,7 @@ $button-shadow-size: 3px;
|
|
|
228
228
|
&--text-link-inverse.active & {
|
|
229
229
|
&__inner {
|
|
230
230
|
color: var(--ons-color-text-inverse-link-hover);
|
|
231
|
-
.ons-
|
|
231
|
+
.ons-icon {
|
|
232
232
|
fill: var(--ons-color-text-inverse-link-hover);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -247,7 +247,7 @@ $button-shadow-size: 3px;
|
|
|
247
247
|
background-color: var(--ons-color-focus);
|
|
248
248
|
box-shadow: 0 -2px var(--ons-color-focus), 0 4px var(--ons-color-text-link-focus) !important;
|
|
249
249
|
color: var(--ons-color-text-link-focus);
|
|
250
|
-
.ons-
|
|
250
|
+
.ons-icon {
|
|
251
251
|
fill: var(--ons-color-text-link-focus);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -259,7 +259,7 @@ $button-shadow-size: 3px;
|
|
|
259
259
|
border: 2px solid rgba(255, 255, 255, 0.6);
|
|
260
260
|
box-shadow: none;
|
|
261
261
|
color: var(--ons-color-text-inverse);
|
|
262
|
-
.ons-
|
|
262
|
+
.ons-icon {
|
|
263
263
|
fill: var(--ons-color-text-inverse);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -271,7 +271,7 @@ $button-shadow-size: 3px;
|
|
|
271
271
|
border: 2px solid var(--ons-color-black);
|
|
272
272
|
box-shadow: none;
|
|
273
273
|
color: var(--ons-color-text);
|
|
274
|
-
.ons-
|
|
274
|
+
.ons-icon {
|
|
275
275
|
fill: var(--ons-color-text);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
@@ -306,7 +306,7 @@ $button-shadow-size: 3px;
|
|
|
306
306
|
&--dropdown:focus:hover & {
|
|
307
307
|
&__inner {
|
|
308
308
|
color: var(--ons-color-text);
|
|
309
|
-
.ons-
|
|
309
|
+
.ons-icon {
|
|
310
310
|
fill: var(--ons-color-text);
|
|
311
311
|
}
|
|
312
312
|
}
|
|
@@ -326,7 +326,7 @@ $button-shadow-size: 3px;
|
|
|
326
326
|
background: rgba(0, 0, 0, 0.2);
|
|
327
327
|
border-color: rgba(255, 255, 255, 0.6);
|
|
328
328
|
color: var(--ons-color-text-inverse);
|
|
329
|
-
.ons-
|
|
329
|
+
.ons-icon {
|
|
330
330
|
fill: var(--ons-color-text-inverse);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
@@ -340,7 +340,7 @@ $button-shadow-size: 3px;
|
|
|
340
340
|
background: var(--ons-color-black);
|
|
341
341
|
border-color: var(--ons-color-black);
|
|
342
342
|
color: var(--ons-color-white);
|
|
343
|
-
.ons-
|
|
343
|
+
.ons-icon {
|
|
344
344
|
fill: var(--ons-color-white);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -352,7 +352,7 @@ $button-shadow-size: 3px;
|
|
|
352
352
|
&__inner {
|
|
353
353
|
background: var(--ons-color-focus);
|
|
354
354
|
color: var(--ons-color-text-link-focus);
|
|
355
|
-
.ons-
|
|
355
|
+
.ons-icon {
|
|
356
356
|
fill: var(--ons-color-text-link-focus);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
@@ -364,7 +364,7 @@ $button-shadow-size: 3px;
|
|
|
364
364
|
&__inner {
|
|
365
365
|
border-color: var(--ons-color-text-link-focus);
|
|
366
366
|
box-shadow: 0 0 0 1px var(--ons-color-text-link-focus);
|
|
367
|
-
.ons-
|
|
367
|
+
.ons-icon {
|
|
368
368
|
fill: var(--ons-color-black);
|
|
369
369
|
}
|
|
370
370
|
}
|
|
@@ -374,7 +374,7 @@ $button-shadow-size: 3px;
|
|
|
374
374
|
&__inner {
|
|
375
375
|
position: relative;
|
|
376
376
|
transition: color 0.3s ease-in-out;
|
|
377
|
-
.ons-
|
|
377
|
+
.ons-icon {
|
|
378
378
|
height: 27px;
|
|
379
379
|
left: 50%;
|
|
380
380
|
margin: 0;
|
|
@@ -389,7 +389,7 @@ $button-shadow-size: 3px;
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
&--loader.ons-btn--small {
|
|
392
|
-
.ons-
|
|
392
|
+
.ons-icon {
|
|
393
393
|
height: 24px;
|
|
394
394
|
width: 24px;
|
|
395
395
|
}
|
|
@@ -398,7 +398,7 @@ $button-shadow-size: 3px;
|
|
|
398
398
|
&--loader.ons-is-loading & {
|
|
399
399
|
&__inner {
|
|
400
400
|
color: transparent;
|
|
401
|
-
.ons-
|
|
401
|
+
.ons-icon {
|
|
402
402
|
margin-left: 0 !important;
|
|
403
403
|
opacity: 1;
|
|
404
404
|
}
|
|
@@ -423,14 +423,14 @@ $button-shadow-size: 3px;
|
|
|
423
423
|
|
|
424
424
|
&--mobile[aria-expanded='true'],
|
|
425
425
|
&--text-link[aria-expanded='true'] {
|
|
426
|
-
.ons-
|
|
426
|
+
.ons-icon {
|
|
427
427
|
transform: rotate(270deg);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
&--mobile,
|
|
432
432
|
&--text-link {
|
|
433
|
-
.ons-
|
|
433
|
+
.ons-icon {
|
|
434
434
|
transform: rotate(90deg);
|
|
435
435
|
}
|
|
436
436
|
|
|
@@ -479,7 +479,7 @@ $button-shadow-size: 3px;
|
|
|
479
479
|
padding: 0.6rem 1rem;
|
|
480
480
|
text-align: left;
|
|
481
481
|
|
|
482
|
-
.ons-
|
|
482
|
+
.ons-icon {
|
|
483
483
|
fill: var(--ons-color-branded-text);
|
|
484
484
|
float: right;
|
|
485
485
|
margin-top: 3px;
|
|
@@ -491,7 +491,7 @@ $button-shadow-size: 3px;
|
|
|
491
491
|
&__inner {
|
|
492
492
|
background: var(--ons-color-branded-secondary);
|
|
493
493
|
color: var(--ons-color-white);
|
|
494
|
-
.ons-
|
|
494
|
+
.ons-icon {
|
|
495
495
|
fill: var(--ons-color-white);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
@@ -502,7 +502,7 @@ $button-shadow-size: 3px;
|
|
|
502
502
|
&__inner {
|
|
503
503
|
background: var(--ons-color-branded-secondary);
|
|
504
504
|
color: var(--ons-color-white);
|
|
505
|
-
.ons-
|
|
505
|
+
.ons-icon {
|
|
506
506
|
fill: var(--ons-color-white);
|
|
507
507
|
}
|
|
508
508
|
}
|
|
@@ -200,7 +200,7 @@ describe('macro: button', () => {
|
|
|
200
200
|
}),
|
|
201
201
|
);
|
|
202
202
|
|
|
203
|
-
expect($('.ons-
|
|
203
|
+
expect($('.ons-icon + .ons-btn__text').text()).toBe('Click me!');
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
it('has custom icon after button text', () => {
|
|
@@ -213,7 +213,7 @@ describe('macro: button', () => {
|
|
|
213
213
|
);
|
|
214
214
|
|
|
215
215
|
expect(
|
|
216
|
-
$('.ons-btn__text + .ons-
|
|
216
|
+
$('.ons-btn__text + .ons-icon')
|
|
217
217
|
.prev()
|
|
218
218
|
.text(),
|
|
219
219
|
).toBe('Click me!');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</span>
|
|
7
7
|
{% endif %}
|
|
8
8
|
<span
|
|
9
|
-
id="{{ params.id }}
|
|
9
|
+
id="{{ params.id }}"
|
|
10
10
|
class="ons-input__limit ons-u-fs-s--b ons-u-d-no ons-u-mt-xs"
|
|
11
11
|
data-charcount-singular="{{ params.charCountSingular }}"
|
|
12
12
|
data-charcount-plural="{{ params.charCountPlural }}"
|
|
@@ -40,7 +40,7 @@ describe('macro: char-check-limit', () => {
|
|
|
40
40
|
it('has the provided `id` attribute', () => {
|
|
41
41
|
const $ = cheerio.load(renderComponent('char-check-limit', EXAMPLE_CHAR_CHECK_LIMIT));
|
|
42
42
|
|
|
43
|
-
expect($('.ons-input__limit').attr('id')).toBe('example-char-check-limit
|
|
43
|
+
expect($('.ons-input__limit').attr('id')).toBe('example-char-check-limit');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it('has the provided data attributes', () => {
|