@ons/design-system 53.1.1 → 54.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/accordion/_macro.njk +2 -3
- package/components/accordion/_macro.spec.js +3 -40
- package/components/accordion/accordion.dom.js +19 -0
- package/components/{collapsible/collapsible.group.js → accordion/accordion.js} +12 -5
- package/components/accordion/accordion.spec.js +56 -51
- package/components/collapsible/_collapsible.scss +58 -85
- package/components/collapsible/_macro.njk +6 -39
- package/components/collapsible/_macro.spec.js +0 -53
- package/components/collapsible/collapsible.dom.js +3 -12
- package/components/collapsible/collapsible.js +3 -45
- package/components/collapsible/collapsible.spec.js +6 -139
- package/components/cookies-banner/_cookies-banner.scss +15 -7
- package/components/cookies-banner/_macro.njk +66 -22
- package/components/cookies-banner/_macro.spec.js +172 -114
- package/components/cookies-banner/cookies-banner.js +35 -13
- package/components/cookies-banner/cookies-banner.spec.js +58 -54
- package/components/input/_macro.njk +20 -15
- package/components/input/_macro.spec.js +56 -0
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +2 -0
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +1 -0
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/js/main.js +1 -0
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +2 -2
- package/scss/objects/_page.scss +1 -1
|
@@ -429,6 +429,34 @@ describe('macro: input', () => {
|
|
|
429
429
|
).toBe('Example prefix text');
|
|
430
430
|
});
|
|
431
431
|
|
|
432
|
+
it('does not render prefix element when `prefix.id` not set', () => {
|
|
433
|
+
const $ = cheerio.load(
|
|
434
|
+
renderComponent('input', {
|
|
435
|
+
...EXAMPLE_INPUT_MINIMAL,
|
|
436
|
+
prefix: {
|
|
437
|
+
title: 'Example prefix title',
|
|
438
|
+
text: 'Example prefix text',
|
|
439
|
+
},
|
|
440
|
+
}),
|
|
441
|
+
);
|
|
442
|
+
|
|
443
|
+
expect($('.ons-input-type--prefix').length).toBe(0);
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
it('does not render prefix element when `prefix.title` not set', () => {
|
|
447
|
+
const $ = cheerio.load(
|
|
448
|
+
renderComponent('input', {
|
|
449
|
+
...EXAMPLE_INPUT_MINIMAL,
|
|
450
|
+
prefix: {
|
|
451
|
+
text: 'Example prefix text',
|
|
452
|
+
id: 'example-prefix-id',
|
|
453
|
+
},
|
|
454
|
+
}),
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
expect($('.ons-input-type--prefix').length).toBe(0);
|
|
458
|
+
});
|
|
459
|
+
|
|
432
460
|
it('adds `aria-labelledby` attribute when `suffix` is provided', () => {
|
|
433
461
|
const $ = cheerio.load(
|
|
434
462
|
renderComponent('input', {
|
|
@@ -485,6 +513,34 @@ describe('macro: input', () => {
|
|
|
485
513
|
});
|
|
486
514
|
});
|
|
487
515
|
|
|
516
|
+
it('does not render suffix element when `suffix.id` not set', () => {
|
|
517
|
+
const $ = cheerio.load(
|
|
518
|
+
renderComponent('input', {
|
|
519
|
+
...EXAMPLE_INPUT_MINIMAL,
|
|
520
|
+
suffix: {
|
|
521
|
+
title: 'Example suffix title',
|
|
522
|
+
text: 'Example suffix text',
|
|
523
|
+
},
|
|
524
|
+
}),
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
expect($('.ons-input').length).toBe(0);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
it('does not render suffix element when `suffix.title` not set', () => {
|
|
531
|
+
const $ = cheerio.load(
|
|
532
|
+
renderComponent('input', {
|
|
533
|
+
...EXAMPLE_INPUT_MINIMAL,
|
|
534
|
+
suffix: {
|
|
535
|
+
text: 'Example suffix text',
|
|
536
|
+
id: 'example-suffix-id',
|
|
537
|
+
},
|
|
538
|
+
}),
|
|
539
|
+
);
|
|
540
|
+
|
|
541
|
+
expect($('.ons-input').length).toBe(0);
|
|
542
|
+
});
|
|
543
|
+
|
|
488
544
|
describe('search', () => {
|
|
489
545
|
it('renders `search` component', () => {
|
|
490
546
|
const faker = templateFaker();
|
|
@@ -11,6 +11,7 @@ const EXAMPLE_MUTUALLY_EXCLUSIVE_DURATION_PARAMS = {
|
|
|
11
11
|
name: 'address-duration-years',
|
|
12
12
|
suffix: {
|
|
13
13
|
text: 'Years',
|
|
14
|
+
id: 'address-duration-years-suffix',
|
|
14
15
|
},
|
|
15
16
|
attributes: {
|
|
16
17
|
min: 0,
|
|
@@ -22,6 +23,7 @@ const EXAMPLE_MUTUALLY_EXCLUSIVE_DURATION_PARAMS = {
|
|
|
22
23
|
name: 'address-duration-months',
|
|
23
24
|
suffix: {
|
|
24
25
|
text: 'Months',
|
|
26
|
+
id: 'address-duration-months-suffix',
|
|
25
27
|
},
|
|
26
28
|
attributes: {
|
|
27
29
|
min: 0,
|