@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.
Files changed (104) hide show
  1. package/components/access-code/example-access-code-error.njk +1 -1
  2. package/components/accordion/_macro.njk +1 -1
  3. package/components/breadcrumbs/_macro.njk +2 -2
  4. package/components/breadcrumbs/_macro.spec.js +1 -1
  5. package/components/button/_macro.njk +1 -1
  6. package/components/button/_macro.spec.js +6 -6
  7. package/components/card/_macro.njk +1 -1
  8. package/components/card/_macro.spec.js +1 -1
  9. package/components/char-check-limit/_macro.njk +1 -1
  10. package/components/char-check-limit/_macro.spec.js +1 -1
  11. package/components/char-check-limit/character-check.spec.js +16 -16
  12. package/components/checkboxes/_macro.njk +3 -1
  13. package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
  14. package/components/collapsible/_macro.spec.js +1 -1
  15. package/components/content-pagination/_macro.njk +2 -2
  16. package/components/content-pagination/_macro.spec.js +2 -2
  17. package/components/cookies-banner/_macro.njk +2 -2
  18. package/components/cookies-banner/_macro.spec.js +2 -2
  19. package/components/details/_macro.njk +1 -1
  20. package/components/details/_macro.spec.js +1 -1
  21. package/components/document-list/_macro.njk +1 -1
  22. package/components/footer/_macro.njk +2 -2
  23. package/components/footer/_macro.spec.js +7 -7
  24. package/components/header/_macro.njk +3 -3
  25. package/components/header/_macro.spec.js +5 -6
  26. package/components/{icons → icon}/_macro.spec.js +7 -7
  27. package/components/{images → image}/_macro.spec.js +13 -13
  28. package/components/{images/example-images-for-regular-screens.njk → image/example-image-for-regular-screens.njk} +1 -1
  29. package/components/{images/example-images-for-retina-screens.njk → image/example-image-for-retina-screens.njk} +1 -1
  30. package/components/input/_input.scss +6 -0
  31. package/components/input/_macro.njk +20 -13
  32. package/components/input/_macro.spec.js +2 -22
  33. package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
  34. package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
  35. package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
  36. package/components/{lists → list}/_macro.njk +3 -3
  37. package/components/{lists → list}/_macro.spec.js +42 -42
  38. package/components/message/_macro.njk +2 -2
  39. package/components/message/_macro.spec.js +0 -1
  40. package/components/metadata/_macro.njk +1 -1
  41. package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
  42. package/components/navigation/_macro.njk +3 -3
  43. package/components/pagination/_macro.njk +65 -69
  44. package/components/pagination/_macro.spec.js +18 -16
  45. package/components/pagination/example-pagination-first.njk +5 -5
  46. package/components/pagination/example-pagination-last.njk +5 -5
  47. package/components/pagination/example-pagination-with-no-range-indicator.njk +11 -11
  48. package/components/pagination/example-pagination.njk +2 -2
  49. package/components/panel/_macro.njk +2 -2
  50. package/components/panel/_macro.spec.js +2 -2
  51. package/components/panel/example-panel-with-error-summary.njk +1 -1
  52. package/components/phase-banner/_phase-banner.scss +2 -1
  53. package/components/question/_macro.njk +1 -1
  54. package/components/question/_macro.spec.js +1 -1
  55. package/components/quote/_macro.njk +1 -1
  56. package/components/quote/_macro.spec.js +1 -1
  57. package/components/related-content/_macro.njk +1 -1
  58. package/components/related-content/_macro.spec.js +1 -1
  59. package/components/related-content/example-related-content-general.njk +1 -1
  60. package/components/relationships/example-relationships-error.njk +1 -1
  61. package/components/section-navigation/_macro.njk +2 -2
  62. package/components/select/_macro.njk +1 -2
  63. package/components/share-page/_macro.njk +1 -1
  64. package/components/share-page/_macro.spec.js +5 -5
  65. package/components/summary/_macro.njk +5 -6
  66. package/components/summary/_macro.spec.js +8 -23
  67. package/components/summary/example-summary-grouped-total.njk +0 -2
  68. package/components/summary/example-summary-grouped-with-errors.njk +0 -4
  69. package/components/summary/example-summary-grouped.njk +0 -19
  70. package/components/summary/example-summary-household.njk +0 -5
  71. package/components/summary/example-summary-hub.njk +0 -8
  72. package/components/summary/example-summary-multiple.njk +0 -4
  73. package/components/summary/example-summary.njk +0 -4
  74. package/components/table/_macro.njk +4 -4
  75. package/components/table/_macro.spec.js +17 -1
  76. package/components/table/example-table-basic.njk +1 -2
  77. package/components/table/example-table-numeric.njk +6 -3
  78. package/components/table-of-contents/_macro.njk +1 -1
  79. package/components/table-of-contents/_macro.spec.js +2 -2
  80. package/components/tabs/_macro.njk +6 -5
  81. package/components/tabs/_macro.spec.js +25 -2
  82. package/components/tabs/_tabs.scss +11 -15
  83. package/components/tabs/example-tabs.njk +6 -6
  84. package/components/tabs/tabs.js +24 -8
  85. package/components/tabs/tabs.spec.js +40 -2
  86. package/components/textarea/_macro.njk +2 -2
  87. package/components/textarea/_macro.spec.js +2 -2
  88. package/components/textarea/textarea.spec.js +6 -10
  89. package/components/timeline/_macro.njk +1 -1
  90. package/components/timeline/_macro.spec.js +1 -1
  91. package/css/main.css +3 -3
  92. package/css/print.css +1 -1
  93. package/package.json +1 -1
  94. package/scripts/main.es5.js +1 -1
  95. package/scripts/main.js +1 -1
  96. package/scss/main.scss +3 -4
  97. package/components/search/_macro.njk +0 -30
  98. package/components/search/_macro.spec.js +0 -69
  99. package/components/search/_search.scss +0 -9
  100. /package/components/{icons/_icons.scss → icon/_icon.scss} +0 -0
  101. /package/components/{icons → icon}/_macro.njk +0 -0
  102. /package/components/{images/_images.scss → image/_image.scss} +0 -0
  103. /package/components/{images → image}/_macro.njk +0 -0
  104. /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/icons/icons';
30
- @import '../components/images/images';
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/lists/list';
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
- });
@@ -1,9 +0,0 @@
1
- .ons-search-component {
2
- display: flex;
3
- flex-flow: row wrap;
4
- gap: 0.5rem;
5
-
6
- @include mq(s) {
7
- flex-flow: row nowrap !important;
8
- }
9
- }
File without changes
File without changes
File without changes