@ons/design-system 43.0.0 → 44.1.1

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 (71) hide show
  1. package/components/checkboxes/_checkbox.scss +1 -1
  2. package/components/checkboxes/_macro.njk +3 -3
  3. package/components/collapsible/_collapsible.scss +1 -1
  4. package/components/field/_field-group.scss +0 -1
  5. package/components/fieldset/_macro.njk +1 -1
  6. package/components/header/_header.scss +3 -3
  7. package/components/header/_macro.njk +2 -2
  8. package/components/input/_input.scss +6 -2
  9. package/components/input/_macro.njk +1 -1
  10. package/components/message/_message.scss +3 -1
  11. package/components/modal/_macro.njk +23 -0
  12. package/components/modal/_modal.scss +32 -0
  13. package/components/modal/modal.dom.js +14 -0
  14. package/components/modal/modal.js +104 -0
  15. package/components/question/_macro.njk +2 -2
  16. package/components/radios/_macro.njk +6 -2
  17. package/components/summary/_summary.scss +4 -2
  18. package/components/table/_table.scss +1 -1
  19. package/components/timeout-modal/_macro.njk +26 -0
  20. package/components/timeout-modal/timeout.dom.js +16 -0
  21. package/components/timeout-modal/timeout.js +289 -0
  22. package/css/census.css +1 -1
  23. package/css/error.css +1 -1
  24. package/css/main.css +1 -1
  25. package/favicons/census/cy/android-chrome-192x192.png +0 -0
  26. package/favicons/census/cy/android-chrome-512x512.png +0 -0
  27. package/favicons/census/cy/apple-touch-icon.png +0 -0
  28. package/favicons/census/cy/browserconfig.xml +12 -0
  29. package/favicons/census/cy/favicon-16x16.png +0 -0
  30. package/favicons/census/cy/favicon-32x32.png +0 -0
  31. package/favicons/census/cy/favicon.ico +0 -0
  32. package/favicons/census/cy/manifest.json +20 -0
  33. package/favicons/census/cy/mstitle-150x150.png +0 -0
  34. package/favicons/census/cy/mstitle-310x150.png +0 -0
  35. package/favicons/census/cy/mstitle-310x310.png +0 -0
  36. package/favicons/census/cy/mstitle-70x70.png +0 -0
  37. package/favicons/census/cy/opengraph.png +0 -0
  38. package/favicons/census/cy/safari-pinned-tab.svg +3 -0
  39. package/favicons/census/cy/site.webmanifest +19 -0
  40. package/favicons/census/cy/twitter.png +0 -0
  41. package/favicons/census/en/android-chrome-192x192.png +0 -0
  42. package/favicons/census/en/android-chrome-512x512.png +0 -0
  43. package/favicons/census/en/apple-touch-icon.png +0 -0
  44. package/favicons/census/en/browserconfig.xml +12 -0
  45. package/favicons/census/en/favicon-16x16.png +0 -0
  46. package/favicons/census/en/favicon-32x32.png +0 -0
  47. package/favicons/census/en/favicon.ico +0 -0
  48. package/favicons/census/en/manifest.json +20 -0
  49. package/favicons/census/en/mstitle-150x150.png +0 -0
  50. package/favicons/census/en/mstitle-310x150.png +0 -0
  51. package/favicons/census/en/mstitle-310x310.png +0 -0
  52. package/favicons/census/en/mstitle-70x70.png +0 -0
  53. package/favicons/census/en/opengraph.png +0 -0
  54. package/favicons/census/en/safari-pinned-tab.svg +3 -0
  55. package/favicons/census/en/site.webmanifest +19 -0
  56. package/favicons/census/en/twitter.png +0 -0
  57. package/favicons/census/ni/favicon.ico +0 -0
  58. package/package.json +8 -11
  59. package/scripts/main.es5.js +2 -2
  60. package/scripts/main.js +1 -1
  61. package/scss/base/_global.scss +9 -5
  62. package/scss/error.scss +0 -2
  63. package/scss/helpers/_functions.scss +4 -2
  64. package/scss/main.scss +64 -8
  65. package/scss/overrides/rtl.scss +4 -2
  66. package/scss/patternlib.scss +3 -2
  67. package/scss/utilities/_colors.scss +4 -4
  68. package/scss/utilities/_grid.scss +7 -5
  69. package/src/js/domready.js +17 -0
  70. package/components/related-links/_macro.njk +0 -14
  71. package/components/related-links/_related-links.scss +0 -6
@@ -29,6 +29,14 @@ hr {
29
29
  margin: 2rem 0 0;
30
30
  }
31
31
 
32
+ %a-focus {
33
+ background-color: $color-focus;
34
+ box-shadow: 0 -2px $color-focus, 0 4px $color-text-link-focus;
35
+ color: $color-text-link-focus;
36
+ outline: 3px solid transparent;
37
+ text-decoration: none;
38
+ }
39
+
32
40
  a {
33
41
  color: $color-text-link;
34
42
  text-decoration-thickness: 1px;
@@ -52,10 +60,6 @@ a {
52
60
  text-decoration: underline solid $color-text-link-hover 2px;
53
61
  }
54
62
  &:focus:not(.ons-btn--link):not(.ons-btn--ghost):not(.ons-js-clear-btn):not(.ons-download__thumbnail--link):not(.ons-tab--row):not(.ons-skip-link) {
55
- background-color: $color-focus;
56
- box-shadow: 0 -2px $color-focus, 0 4px $color-text-link-focus;
57
- color: $color-text-link-focus;
58
- outline: 3px solid transparent;
59
- text-decoration: none;
63
+ @extend %a-focus;
60
64
  }
61
65
  }
package/scss/error.scss CHANGED
@@ -1,7 +1,5 @@
1
1
  @import 'normalize';
2
2
 
3
- @include normalize();
4
-
5
3
  body {
6
4
  background: #222;
7
5
  color: #fff;
@@ -1,11 +1,13 @@
1
+ @use 'sass:math';
2
+
1
3
  @function ems($pxval, $base: $base) {
2
- $em-size: $pxval / $base;
4
+ $em-size: math.div($pxval, $base);
3
5
 
4
6
  @return #{$em-size}em;
5
7
  }
6
8
 
7
9
  @function rems($pxval, $base: $base) {
8
- $rem-size: $pxval / $base;
10
+ $rem-size: math.div($pxval, $base);
9
11
 
10
12
  @return #{$rem-size}rem;
11
13
  }
package/scss/main.scss CHANGED
@@ -1,18 +1,74 @@
1
1
  @import 'normalize';
2
-
3
- @include normalize();
4
-
5
2
  @import 'vars/index';
6
3
  @import 'helpers/index';
7
4
  @import 'base/index';
8
5
  @import 'objects/index';
9
- @import '../components/**/*.scss';
10
- @import '../patterns/**/*.scss';
11
- @import '../foundations/**/*.scss';
6
+ @import '../components/access-code/uac';
7
+ @import '../components/address-output/address-output';
8
+ @import '../components/articles/articles';
9
+ @import '../components/autosuggest/autosuggest';
10
+ @import '../components/breadcrumbs/breadcrumbs';
11
+ @import '../components/button/button';
12
+ @import '../components/call-to-action/call-to-action';
13
+ @import '../components/card/card';
14
+ @import '../components/checkboxes/checkbox';
15
+ @import '../components/checkboxes/checkboxes';
16
+ @import '../components/collapsible/collapsible';
17
+ @import '../components/content-pagination/content-pagination';
18
+ @import '../components/cookies-banner/cookies-banner';
19
+ @import '../components/download-resources/download-resources';
20
+ @import '../components/downloads/downloads';
21
+ @import '../components/external-link/external-link';
22
+ @import '../components/feedback/feedback';
23
+ @import '../components/field/field-group';
24
+ @import '../components/field/field';
25
+ @import '../components/fieldset/fieldset';
26
+ @import '../components/find-a-support-centre/find-a-support-centre';
27
+ @import '../components/footer/footer';
28
+ @import '../components/header/header-nav';
29
+ @import '../components/header/header';
30
+ @import '../components/hero/hero';
31
+ @import '../components/icons/icons';
32
+ @import '../components/images/images';
33
+ @import '../components/input/input-type';
34
+ @import '../components/input/input';
35
+ @import '../components/label/label';
36
+ @import '../components/language-selector/language';
37
+ @import '../components/lists/list';
38
+ @import '../components/message-list/message-list';
39
+ @import '../components/message/message';
40
+ @import '../components/metadata/metadata';
41
+ @import '../components/pagination/pagination';
42
+ @import '../components/panel/panel';
43
+ @import '../components/phase-banner/phase-banner';
44
+ @import '../components/promotional-banner/promo-banner';
45
+ @import '../components/question/question';
46
+ @import '../components/quote/quote';
47
+ @import '../components/radios/radio';
48
+ @import '../components/radios/radios';
49
+ @import '../components/related-content/related-content';
50
+ @import '../components/relationships/relationships';
51
+ @import '../components/search/search';
52
+ @import '../components/section-navigation/section-navigation';
53
+ @import '../components/skip-to-content/skip';
54
+ @import '../components/status/status';
55
+ @import '../components/summary/summary';
56
+ @import '../components/table-of-contents/toc';
57
+ @import '../components/table/table';
58
+ @import '../components/tabs/tabs';
59
+ @import '../components/text-indent/text-indent';
60
+ @import '../components/timeline/timeline';
61
+ @import '../components/upload/upload';
62
+ @import '../components/video/video';
63
+ @import '../patterns/help-users-to/see-important-information/src/_highlight';
64
+ @import '../patterns/pages/question/examples/question-anatomy/pl-question-anatomy';
65
+ @import '../foundations/layout/page-template/examples/block-areas/block-areas';
66
+ @import '../foundations/style/colours/colours';
67
+ @import '../foundations/style/icons/icon-swatch';
12
68
  @import 'utilities/index';
13
69
 
14
70
  // Right to left
15
- @import 'overrides/rtl.scss';
71
+ @import 'overrides/rtl';
16
72
 
17
73
  // High Contrast Mode
18
- @import 'overrides/hcm.scss';
74
+ @import 'overrides/hcm';
@@ -1,3 +1,5 @@
1
+ @use 'sass:math';
2
+
1
3
  .ons-rtl .ons-page__container > .ons-grid {
2
4
  direction: rtl;
3
5
 
@@ -97,7 +99,7 @@
97
99
  // Flip push and pull
98
100
  @each $breakpoint-min, $size in $grid-bp {
99
101
  @for $column from 1 through $grid-cols {
100
- $width: percentage($column / $grid-cols);
102
+ $width: percentage(math.div($column, $grid-cols));
101
103
 
102
104
  @include mq($breakpoint-min) {
103
105
  .ons-push-#{$column}\@#{$breakpoint-min} {
@@ -112,7 +114,7 @@
112
114
 
113
115
  @each $breakpoint-max, $size in $grid-bp {
114
116
  @for $column from 1 through $grid-cols {
115
- $width: percentage($column / $grid-cols);
117
+ $width: percentage(math.div($column, $grid-cols));
116
118
 
117
119
  @include mq($breakpoint-min, $breakpoint-max) {
118
120
  .ons-push-#{$column}\@#{$breakpoint-min}\@#{$breakpoint-max} {
@@ -1,6 +1,7 @@
1
1
  @import 'vars/index';
2
- @import 'helpers/*.scss';
3
- @import '../views/partials/**/*.scss';
2
+ @import 'helpers/index';
3
+ @import '../views/partials/example/example';
4
+ @import '../views/partials/sub-navigation/sub-navigation';
4
5
  @import '../foundations/layout/page-template/examples/block-areas/block-areas';
5
6
  @import '../patterns/pages/question/examples/question-anatomy/pl-question-anatomy';
6
7
  @import 'prism-tomorrow';
@@ -1,16 +1,16 @@
1
1
  @each $label, $color in (blue: $color-night-blue, green: $color-leaf-green) {
2
- .ons-u-#{$label} {
2
+ .ons-u-#{'' + $label} {
3
3
  color: $color;
4
4
  }
5
- .ons-u-bg-#{$label} {
5
+ .ons-u-bg-#{'' + $label} {
6
6
  background-color: $color;
7
7
  }
8
8
 
9
9
  @for $tint from 1 through 10 {
10
- .ons-u-#{$label}-#{$tint*10} {
10
+ .ons-u-#{'' + $label}-#{$tint*10} {
11
11
  color: tint($color, $tint * 10);
12
12
  }
13
- .ons-u-bg-#{$label}-#{$tint*10} {
13
+ .ons-u-bg-#{'' + $label}-#{$tint*10} {
14
14
  background-color: tint($color, $tint * 10);
15
15
  }
16
16
  }
@@ -1,3 +1,5 @@
1
+ @use 'sass:math';
2
+
1
3
  .ons-grid {
2
4
  box-sizing: border-box;
3
5
  font-size: 0;
@@ -32,7 +34,7 @@
32
34
  }
33
35
  &.ons-grid--tight {
34
36
  .ons-grid__col {
35
- margin-bottom: $grid-gutters/2;
37
+ margin-bottom: math.div($grid-gutters, 2);
36
38
  }
37
39
  }
38
40
  }
@@ -53,9 +55,9 @@
53
55
  }
54
56
 
55
57
  .ons-grid--tight {
56
- margin-left: -$grid-gutters/2;
58
+ margin-left: math.div(-$grid-gutters, 2);
57
59
  .ons-grid__col {
58
- padding-left: $grid-gutters/2;
60
+ padding-left: math.div($grid-gutters, 2);
59
61
  }
60
62
  }
61
63
 
@@ -157,7 +159,7 @@
157
159
 
158
160
  @each $breakpoint-min, $size in $grid-bp {
159
161
  @for $column from 1 through $grid-cols {
160
- $width: percentage($column / $grid-cols);
162
+ $width: percentage(math.div($column, $grid-cols));
161
163
 
162
164
  @include mq($breakpoint-min) {
163
165
  .ons-col-#{$column}\@#{$breakpoint-min} {
@@ -179,7 +181,7 @@
179
181
 
180
182
  @each $breakpoint-max, $size in $grid-bp {
181
183
  @for $column from 1 through $grid-cols {
182
- $width: percentage($column / $grid-cols);
184
+ $width: percentage(math.div($column, $grid-cols));
183
185
 
184
186
  @include mq($breakpoint-min, $breakpoint-max) {
185
187
  .ons-col-#{$column}\@#{$breakpoint-min}\@#{$breakpoint-max} {
@@ -0,0 +1,17 @@
1
+ let callbacks = [];
2
+
3
+ const onReady = () => {
4
+ callbacks.forEach(fn => fn.call());
5
+ callbacks = [];
6
+ window.onsDOMReady = true;
7
+ };
8
+
9
+ export default function ready(fn) {
10
+ if (document.readyState === 'loading') {
11
+ callbacks.push(fn);
12
+ } else {
13
+ fn.call();
14
+ }
15
+ }
16
+
17
+ document.addEventListener('DOMContentLoaded', onReady);
@@ -1,14 +0,0 @@
1
- {% macro onsRelatedLinks(params) %}
2
- {% from "components/lists/_macro.njk" import onsList %}
3
- <div class="ons-related-links">
4
- <h2 class="ons-related-links__title ons-u-fs-r--b ons-u-mb-xs" id="{{ params.id }}">{{ params.title }}</h2>
5
- <nav class="ons-related-links__navigation" aria-labelledby="{{ params.id }}">
6
- {{
7
- onsList({
8
- "variants": 'bare',
9
- "itemsList": params.itemsList
10
- })
11
- }}
12
- </nav>
13
- </div>
14
- {% endmacro %}
@@ -1,6 +0,0 @@
1
- .ons-related-links {
2
- @extend .ons-u-mt-m;
3
-
4
- border-top: 5px solid $color-branded;
5
- padding: 1rem 0;
6
- }