@ons/design-system 44.0.1 → 45.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 (165) hide show
  1. package/components/access-code/uac.scss +5 -5
  2. package/components/address-input/_macro.njk +1 -0
  3. package/components/address-input/autosuggest.address.js +0 -1
  4. package/components/autosuggest/_macro.njk +1 -0
  5. package/components/autosuggest/autosuggest.ui.js +3 -3
  6. package/components/autosuggest/{code.list.searcher.js → fuse-config.js} +1 -3
  7. package/components/checkboxes/_checkbox-macro.njk +1 -1
  8. package/components/checkboxes/_macro.njk +1 -1
  9. package/components/fieldset/_macro.njk +1 -1
  10. package/components/header/_header.scss +3 -4
  11. package/components/header/_macro.njk +2 -2
  12. package/components/highlight/_highlight.scss +5 -0
  13. package/components/input/_input.scss +2 -2
  14. package/components/metadata/_macro.njk +1 -1
  15. package/components/metadata/_metadata.scss +1 -1
  16. package/components/modal/_macro.njk +23 -0
  17. package/components/modal/_modal.scss +32 -0
  18. package/components/modal/modal.dom.js +14 -0
  19. package/components/modal/modal.js +104 -0
  20. package/components/radios/_macro.njk +2 -2
  21. package/components/table-of-contents/_macro.njk +7 -7
  22. package/components/textarea/_macro.njk +2 -2
  23. package/components/timeout-modal/_macro.njk +26 -0
  24. package/components/timeout-modal/timeout.dom.js +16 -0
  25. package/components/timeout-modal/timeout.js +289 -0
  26. package/css/census.css +1 -0
  27. package/css/error.css +1 -0
  28. package/css/main.css +1 -0
  29. package/css/print.css +1 -0
  30. package/favicons/android-chrome-192x192.png +0 -0
  31. package/favicons/android-chrome-512x512.png +0 -0
  32. package/favicons/apple-touch-icon.png +0 -0
  33. package/favicons/browserconfig.xml +12 -0
  34. package/favicons/census/cy/android-chrome-192x192.png +0 -0
  35. package/favicons/census/cy/android-chrome-512x512.png +0 -0
  36. package/favicons/census/cy/apple-touch-icon.png +0 -0
  37. package/favicons/census/cy/browserconfig.xml +12 -0
  38. package/favicons/census/cy/favicon-16x16.png +0 -0
  39. package/favicons/census/cy/favicon-32x32.png +0 -0
  40. package/favicons/census/cy/favicon.ico +0 -0
  41. package/favicons/census/cy/manifest.json +20 -0
  42. package/favicons/census/cy/mstitle-150x150.png +0 -0
  43. package/favicons/census/cy/mstitle-310x150.png +0 -0
  44. package/favicons/census/cy/mstitle-310x310.png +0 -0
  45. package/favicons/census/cy/mstitle-70x70.png +0 -0
  46. package/favicons/census/cy/opengraph.png +0 -0
  47. package/favicons/census/cy/safari-pinned-tab.svg +3 -0
  48. package/favicons/census/cy/site.webmanifest +19 -0
  49. package/favicons/census/cy/twitter.png +0 -0
  50. package/favicons/census/en/android-chrome-192x192.png +0 -0
  51. package/favicons/census/en/android-chrome-512x512.png +0 -0
  52. package/favicons/census/en/apple-touch-icon.png +0 -0
  53. package/favicons/census/en/browserconfig.xml +12 -0
  54. package/favicons/census/en/favicon-16x16.png +0 -0
  55. package/favicons/census/en/favicon-32x32.png +0 -0
  56. package/favicons/census/en/favicon.ico +0 -0
  57. package/favicons/census/en/manifest.json +20 -0
  58. package/favicons/census/en/mstitle-150x150.png +0 -0
  59. package/favicons/census/en/mstitle-310x150.png +0 -0
  60. package/favicons/census/en/mstitle-310x310.png +0 -0
  61. package/favicons/census/en/mstitle-70x70.png +0 -0
  62. package/favicons/census/en/opengraph.png +0 -0
  63. package/favicons/census/en/safari-pinned-tab.svg +3 -0
  64. package/favicons/census/en/site.webmanifest +19 -0
  65. package/favicons/census/en/twitter.png +0 -0
  66. package/favicons/census/ni/favicon.ico +0 -0
  67. package/favicons/favicon-16x16.png +0 -0
  68. package/favicons/favicon-32x32.png +0 -0
  69. package/favicons/favicon.ico +0 -0
  70. package/favicons/manifest.json +27 -0
  71. package/favicons/maskable_icon.png +0 -0
  72. package/favicons/mstitle-150x150.png +0 -0
  73. package/favicons/mstitle-310x150.png +0 -0
  74. package/favicons/mstitle-310x310.png +0 -0
  75. package/favicons/mstitle-70x70.png +0 -0
  76. package/favicons/opengraph.png +0 -0
  77. package/favicons/safari-pinned-tab.svg +25 -0
  78. package/favicons/site.webmanifest +19 -0
  79. package/favicons/twitter.png +0 -0
  80. package/fonts/opensans-bold.woff +0 -0
  81. package/fonts/opensans-bold.woff2 +0 -0
  82. package/fonts/opensans-regular.woff +0 -0
  83. package/fonts/opensans-regular.woff2 +0 -0
  84. package/fonts/robotomono-bold.woff +0 -0
  85. package/fonts/robotomono-bold.woff2 +0 -0
  86. package/fonts/robotomono-regular.woff +0 -0
  87. package/fonts/robotomono-regular.woff2 +0 -0
  88. package/img/UKOpenGovernmentLicence-grey.svg +1 -0
  89. package/img/UKOpenGovernmentLicence.svg +1 -0
  90. package/img/card-placeholder.svg +1 -0
  91. package/img/census-landscape.svg +1 -0
  92. package/img/census-promo-banner.svg +1 -0
  93. package/img/circle-lines.svg +1 -0
  94. package/img/icons--check.svg +1 -0
  95. package/img/icons--chevron-down.svg +1 -0
  96. package/img/its-about-us--dark.svg +1 -0
  97. package/img/its-about-us--light.svg +1 -0
  98. package/img/large/hero-man.png +0 -0
  99. package/img/large/mother-and-daughter-in-ireland.jpg +0 -0
  100. package/img/large/mum-and-child-healthcare-belfast.jpg +0 -0
  101. package/img/large/placeholder-card.png +0 -0
  102. package/img/large/placeholder-news-medium.png +0 -0
  103. package/img/large/placeholder-news.png +0 -0
  104. package/img/large/placeholder-portrait.png +0 -0
  105. package/img/large/students.jpg +0 -0
  106. package/img/large/woman-in-purple-dress-shirt.jpg +0 -0
  107. package/img/logo.svg +1 -0
  108. package/img/ni-syn-cyfrif--dark.svg +1 -0
  109. package/img/ni-syn-cyfrif--light.svg +1 -0
  110. package/img/nisra-logo-black-en.svg +1 -0
  111. package/img/ogl.svg +1 -0
  112. package/img/ons-logo-black-cy.svg +1 -0
  113. package/img/ons-logo-black-en.svg +1 -0
  114. package/img/rehearsal-areas.svg +1 -0
  115. package/img/small/hero-man.png +0 -0
  116. package/img/small/mother-and-daughter-in-ireland.jpg +0 -0
  117. package/img/small/mum-and-child-healthcare-belfast.jpg +0 -0
  118. package/img/small/placeholder-card.png +0 -0
  119. package/img/small/placeholder-news-medium.png +0 -0
  120. package/img/small/placeholder-news.png +0 -0
  121. package/img/small/placeholder-portrait.png +0 -0
  122. package/img/small/students.jpg +0 -0
  123. package/img/small/woman-in-purple-dress-shirt.jpg +0 -0
  124. package/package.json +4 -4
  125. package/scripts/main.es5.js +7 -0
  126. package/scripts/main.js +7 -0
  127. package/scss/base/_fonts.scss +4 -0
  128. package/scss/base/_forms.scss +29 -0
  129. package/scss/base/_global.scss +65 -0
  130. package/scss/base/_index.scss +4 -0
  131. package/scss/base/_typography.scss +46 -0
  132. package/scss/census.scss +2 -0
  133. package/scss/error.scss +27 -0
  134. package/scss/helpers/_functions.scss +44 -0
  135. package/scss/helpers/_index.scss +3 -0
  136. package/scss/helpers/_mixins.scss +94 -0
  137. package/scss/helpers/_mq.scss +93 -0
  138. package/scss/main.scss +71 -0
  139. package/scss/objects/_container.scss +34 -0
  140. package/scss/objects/_index.scss +3 -0
  141. package/scss/objects/_page.scss +49 -0
  142. package/scss/objects/_spacing.scss +23 -0
  143. package/scss/overrides/hcm.scss +81 -0
  144. package/scss/overrides/rtl.scss +131 -0
  145. package/scss/patternlib.scss +216 -0
  146. package/scss/print.scss +66 -0
  147. package/scss/settings/_census.scss +13 -0
  148. package/scss/utilities/_border.scss +12 -0
  149. package/scss/utilities/_colors.scss +17 -0
  150. package/scss/utilities/_display.scss +19 -0
  151. package/scss/utilities/_float.scss +34 -0
  152. package/scss/utilities/_grid.scss +245 -0
  153. package/scss/utilities/_index.scss +10 -0
  154. package/scss/utilities/_margin.scss +24 -0
  155. package/scss/utilities/_pad.scss +25 -0
  156. package/scss/utilities/_typography.scss +88 -0
  157. package/scss/utilities/_utilities.scss +31 -0
  158. package/scss/utilities/_visibility.scss +45 -0
  159. package/scss/vars/_colors.scss +112 -0
  160. package/scss/vars/_forms.scss +50 -0
  161. package/scss/vars/_grid.scss +17 -0
  162. package/scss/vars/_index.scss +5 -0
  163. package/scss/vars/_typography.scss +67 -0
  164. package/scss/vars/_vars.scss +1 -0
  165. package/page-templates/_template.njk +0 -242
@@ -0,0 +1,131 @@
1
+ @use 'sass:math';
2
+
3
+ .ons-rtl .ons-page__container > .ons-grid {
4
+ direction: rtl;
5
+
6
+ ul {
7
+ padding-left: 0;
8
+ padding-right: 1.5rem;
9
+ }
10
+
11
+ // List
12
+ .ons-list {
13
+ padding: 0 1.5rem 0 0;
14
+
15
+ &__link {
16
+ margin-left: 1rem;
17
+ margin-right: 0;
18
+ }
19
+
20
+ &--bare {
21
+ padding-right: 0;
22
+ }
23
+
24
+ &--dashed {
25
+ padding-right: 0;
26
+
27
+ .ons-list__item {
28
+ margin-left: 0;
29
+ margin-right: 25px;
30
+
31
+ &::before {
32
+ left: auto;
33
+ margin-left: 0;
34
+ margin-right: -25px;
35
+ right: 0;
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ // Panel
42
+ .ons-panel {
43
+ border-left: 0;
44
+ border-right: 8px solid transparent;
45
+
46
+ &--info {
47
+ border-color: $color-info;
48
+ }
49
+
50
+ &--warn,
51
+ &--warn-branded {
52
+ .ons-panel__body {
53
+ padding: 0.222rem 2.8rem 0.222rem 0;
54
+ }
55
+ }
56
+
57
+ &--bare {
58
+ .ons-panel__body {
59
+ padding: 0.1rem 1.5rem 0 0;
60
+ }
61
+ }
62
+ }
63
+
64
+ // Buttons
65
+ .ons-btn {
66
+ .ons-svg-icon {
67
+ margin: 0 0.5rem 0.1rem 0;
68
+ transform: rotate(180deg);
69
+ }
70
+ }
71
+
72
+ // Content pagination
73
+ .ons-content-pagination {
74
+ &__list {
75
+ padding: 0;
76
+ }
77
+
78
+ &__link-text {
79
+ margin: 0 0.5rem 0 0;
80
+ }
81
+
82
+ &__link-label {
83
+ margin: 0 2rem 0 0;
84
+ }
85
+
86
+ .ons-svg-icon {
87
+ transform: rotate(180deg);
88
+ }
89
+ }
90
+
91
+ // Download
92
+ .ons-download {
93
+ &__image {
94
+ margin-left: 1.5rem;
95
+ margin-right: 0;
96
+ }
97
+ }
98
+
99
+ // Flip push and pull
100
+ @each $breakpoint-min, $size in $grid-bp {
101
+ @for $column from 1 through $grid-cols {
102
+ $width: percentage(math.div($column, $grid-cols));
103
+
104
+ @include mq($breakpoint-min) {
105
+ .ons-push-#{$column}\@#{$breakpoint-min} {
106
+ left: -$width;
107
+ }
108
+
109
+ .ons-pull-#{$column}\@#{$breakpoint-min} {
110
+ left: $width;
111
+ }
112
+ }
113
+ }
114
+
115
+ @each $breakpoint-max, $size in $grid-bp {
116
+ @for $column from 1 through $grid-cols {
117
+ $width: percentage(math.div($column, $grid-cols));
118
+
119
+ @include mq($breakpoint-min, $breakpoint-max) {
120
+ .ons-push-#{$column}\@#{$breakpoint-min}\@#{$breakpoint-max} {
121
+ left: -$width;
122
+ }
123
+
124
+ .ons-pull-#{$column}\@#{$breakpoint-min}\@#{$breakpoint-max} {
125
+ left: $width;
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,216 @@
1
+ @import 'vars/index';
2
+ @import 'helpers/index';
3
+ @import '../views/partials/example/example';
4
+ @import '../views/partials/sub-navigation/sub-navigation';
5
+ @import '../foundations/layout/page-template/examples/block-areas/block-areas';
6
+ @import '../patterns/pages/question/examples/question-anatomy/pl-question-anatomy';
7
+ @import '../foundations/layout/page-template/examples/block-areas/block-areas';
8
+ @import '../foundations/style/colours/colours';
9
+ @import '../foundations/style/icons/icon-swatch';
10
+ @import 'prism-tomorrow';
11
+
12
+ .ons-patternlib-page {
13
+ height: 100vh;
14
+
15
+ &--example {
16
+ display: block;
17
+ height: auto;
18
+ padding: 1.5rem;
19
+
20
+ .ons-page,
21
+ .ons-page__content {
22
+ overflow-x: visible;
23
+ }
24
+ }
25
+
26
+ &__header {
27
+ margin: 0;
28
+ }
29
+
30
+ &__sub-nav {
31
+ .ons-nav {
32
+ width: 100%;
33
+ }
34
+ }
35
+
36
+ &__body {
37
+ overflow: hidden;
38
+ }
39
+
40
+ &__content {
41
+ width: 100%;
42
+ p,
43
+ li,
44
+ h3,
45
+ h4,
46
+ h5,
47
+ h6 {
48
+ max-width: 40rem;
49
+ }
50
+
51
+ code:not(.ons-patternlib-example__code) {
52
+ background: $color-grey-5;
53
+ color: $color-ruby-red;
54
+ padding: 0.05rem 0.25rem;
55
+ }
56
+
57
+ table {
58
+ border-collapse: collapse;
59
+ border-spacing: 0;
60
+ margin: 0;
61
+ width: 100%;
62
+ }
63
+
64
+ th {
65
+ border-bottom: 2px solid $color-grey-100;
66
+ padding: 0.5rem 0 0.5rem 1rem;
67
+ text-align: left;
68
+ vertical-align: top;
69
+ }
70
+
71
+ th,
72
+ td {
73
+ line-height: 1.6;
74
+ padding: 0.5rem 0 0.5rem 1rem;
75
+ &:first-child {
76
+ padding-left: 0;
77
+ }
78
+ }
79
+
80
+ td {
81
+ background: transparent;
82
+ border-bottom: 1px solid $color-borders;
83
+ }
84
+
85
+ tr:last-child td {
86
+ border: 0;
87
+ }
88
+ }
89
+
90
+ .ons-table-scrollable {
91
+ position: relative;
92
+ ::-webkit-scrollbar {
93
+ height: 7px;
94
+ }
95
+ ::-webkit-scrollbar-thumb {
96
+ background: $color-grey-75;
97
+ border-radius: 20px;
98
+ }
99
+ &--on {
100
+ th,
101
+ td {
102
+ white-space: nowrap;
103
+ }
104
+ }
105
+ &__content {
106
+ overflow: visible;
107
+ overflow-x: scroll;
108
+ width: 100%;
109
+ &:focus {
110
+ outline: 3px solid $color-focus;
111
+ outline-offset: 3px;
112
+ }
113
+ th,
114
+ td {
115
+ @include mq(xxs, m) {
116
+ white-space: nowrap;
117
+ }
118
+ }
119
+ .ons-table__right-shadow,
120
+ .ons-table__left-shadow {
121
+ height: 100%;
122
+ position: absolute;
123
+ top: 0;
124
+ width: 5px;
125
+ z-index: 200;
126
+
127
+ &.ons-with-transition {
128
+ transition: box-shadow 0.4s ease-out;
129
+ }
130
+ }
131
+ .ons-table__right-shadow {
132
+ right: 0;
133
+ &.ons-visible {
134
+ box-shadow: inset -1px 0 0 0 #bfc1c3, inset -5px 0 0 0 rgba(191, 193, 195, 0.4);
135
+ }
136
+ }
137
+ .ons-table__left-shadow {
138
+ left: 0;
139
+ &.ons-visible {
140
+ box-shadow: inset 1px 0 0 0 #bfc1c3, inset -5px 0 0 0 rgba(191, 193, 195, 0.4);
141
+ }
142
+ }
143
+ }
144
+ }
145
+
146
+ &__content,
147
+ &__sub-nav {
148
+ > {
149
+ h1,
150
+ h2,
151
+ h3,
152
+ h4,
153
+ h5,
154
+ h6 {
155
+ &:not(:first-child) {
156
+ margin-top: 2rem;
157
+ }
158
+ }
159
+
160
+ h5,
161
+ h6 {
162
+ font-size: 1rem;
163
+ }
164
+
165
+ @for $i from 1 through 6 {
166
+ @for $c from 1 through 6 {
167
+ h#{$i} + h#{$c}:not(:first-child) {
168
+ margin-top: 0;
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+
175
+ &__content-header {
176
+ margin-bottom: 1rem;
177
+ position: relative;
178
+ }
179
+
180
+ .ons-panel + .ons-patternlib-example {
181
+ margin-top: 2rem;
182
+ }
183
+ }
184
+
185
+ .ons-patternlib-example__iframe {
186
+ padding-right: 1px;
187
+ }
188
+
189
+ .ons-patternlib-hero {
190
+ background: $color-grey-5;
191
+ padding: 2rem 0 1rem;
192
+ width: 100%;
193
+
194
+ &__title {
195
+ max-width: 30rem;
196
+ }
197
+ }
198
+
199
+ .ons-pl-grid-col {
200
+ background: $color-grey-5;
201
+ font-size: 0.8rem;
202
+ margin: 0 0 1rem;
203
+ padding: 1rem;
204
+ }
205
+
206
+ .ons-pl-experimental-tag {
207
+ background: $color-info;
208
+ color: $color-text-inverse;
209
+ display: inline-block;
210
+ font-size: 0.7rem;
211
+ font-weight: 700;
212
+ letter-spacing: 0.1rem;
213
+ margin-right: 0.5rem;
214
+ padding: 0.3rem 0.5rem;
215
+ text-transform: uppercase;
216
+ }
@@ -0,0 +1,66 @@
1
+ $color-black: #222;
2
+
3
+ .ons-btn,
4
+ .ons-summary__actions,
5
+ .ons-footer,
6
+ .ons-cookies-banner,
7
+ .ons-language-links,
8
+ .ons-breadcrumb {
9
+ display: none !important;
10
+ }
11
+
12
+ a::after {
13
+ content: ' (' attr(href) ') ';
14
+ }
15
+
16
+ .ons-header {
17
+ &__main,
18
+ &__bottom {
19
+ background: transparent;
20
+ }
21
+
22
+ &__title {
23
+ color: $color-black;
24
+ }
25
+
26
+ &-nav {
27
+ display: block;
28
+ &__item {
29
+ display: inline-block;
30
+ }
31
+ &__item--active {
32
+ border: 0;
33
+ }
34
+ &__link,
35
+ &__link:hover {
36
+ color: $color-black;
37
+ }
38
+ }
39
+
40
+ & &__svg-logo {
41
+ fill: $color-black;
42
+ }
43
+ }
44
+
45
+ .ons-collapsible {
46
+ &--initialised & {
47
+ &__icon {
48
+ display: none;
49
+ }
50
+
51
+ &__title {
52
+ color: $color-black;
53
+ margin-bottom: 1rem;
54
+ margin-left: -1.5rem;
55
+ text-decoration: none;
56
+ }
57
+
58
+ &__content {
59
+ display: block;
60
+ }
61
+ }
62
+ }
63
+
64
+ .ons-hero {
65
+ color-adjust: exact;
66
+ }
@@ -0,0 +1,13 @@
1
+ // Census brand
2
+ $color-black: #222;
3
+ $color-branded: #902082;
4
+ $color-branded-tint: rgba(144, 32, 130, 0.1); // 10% of brand colour
5
+ $color-branded-secondary: #df0667;
6
+ $color-branded-tertiary: #3c388e;
7
+ $color-branded-supporting: #00a3a6;
8
+ $color-branded-supporting-tint: rgba(#00a3a6, 0.2);
9
+ $color-census-gradient: linear-gradient(to bottom left, #902082 0%, #3c388e 100%);
10
+
11
+ // Assignment
12
+ $color-tag-bg: $color-branded-supporting-tint;
13
+ $color-text-link-hover: $color-black;
@@ -0,0 +1,12 @@
1
+ $border: (
2
+ bt: border-top,
3
+ br: border-right,
4
+ bb: border-bottom,
5
+ bl: border-left,
6
+ );
7
+
8
+ @each $abbr, $dec in $border {
9
+ @include bp-suffix(ons-u-#{$abbr}, $create-between-breakpoints: true) {
10
+ #{$dec}: 1px solid $color-borders !important;
11
+ }
12
+ }
@@ -0,0 +1,17 @@
1
+ @each $label, $color in (blue: $color-night-blue, green: $color-leaf-green) {
2
+ .ons-u-#{'' + $label} {
3
+ color: $color;
4
+ }
5
+ .ons-u-bg-#{'' + $label} {
6
+ background-color: $color;
7
+ }
8
+
9
+ @for $tint from 1 through 10 {
10
+ .ons-u-#{'' + $label}-#{$tint*10} {
11
+ color: tint($color, $tint * 10);
12
+ }
13
+ .ons-u-bg-#{'' + $label}-#{$tint*10} {
14
+ background-color: tint($color, $tint * 10);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,19 @@
1
+ @include bp-suffix('ons-u-d-no', $create-between-breakpoints: true) {
2
+ display: none !important;
3
+ }
4
+
5
+ @include bp-suffix('ons-u-d-b', $create-between-breakpoints: true) {
6
+ display: block !important;
7
+ }
8
+
9
+ .ons-u-db-no-js_enabled {
10
+ body.ons-js-enabled & {
11
+ display: none !important;
12
+ }
13
+ }
14
+
15
+ .ons-u-db-no-js_disabled {
16
+ body:not(.ons-js-enabled) & {
17
+ display: none !important;
18
+ }
19
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * For modern browsers
3
+ * 1. The space content is one way to avoid an Opera bug when the
4
+ * contenteditable attribute is included anywhere else in the document.
5
+ * Otherwise it causes space to appear at the top and bottom of elements
6
+ * that are clearfixed.
7
+ * 2. The use of `table` rather than `block` is only necessary if using
8
+ * `:before` to contain the top-margins of child elements.
9
+ */
10
+ .ons-u-cf::before,
11
+ .ons-u-cf::after {
12
+ content: ' '; /* 1 */
13
+ display: table; /* 2 */
14
+ }
15
+
16
+ .ons-u-cf::after {
17
+ clear: both;
18
+ }
19
+
20
+ .ons-u-fl {
21
+ float: left;
22
+ }
23
+
24
+ .ons-u-fr {
25
+ float: right;
26
+ }
27
+
28
+ .ons-u-f-no {
29
+ float: none;
30
+ }
31
+
32
+ @include bp-suffix(ons-u-fr) {
33
+ float: right;
34
+ }