@ons/design-system 62.0.1 → 62.1.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/README.md +0 -63
- package/components/access-code/example-access-code-error.njk +87 -0
- package/components/access-code/example-access-code.njk +63 -0
- package/components/accordion/example-accordion-open.njk +126 -0
- package/components/accordion/example-accordion.njk +25 -0
- package/components/address-input/example-address-input-editable.njk +52 -0
- package/components/address-input/example-address-input-manual.njk +23 -0
- package/components/address-input/example-address-input.njk +40 -0
- package/components/autosuggest/example-autosuggest-country-multiple.njk +30 -0
- package/components/autosuggest/example-autosuggest-country.njk +29 -0
- package/components/back-link/example-back-link.njk +17 -0
- package/components/breadcrumbs/example-breadcrumbs-single.njk +13 -0
- package/components/breadcrumbs/example-breadcrumbs.njk +17 -0
- package/components/button/_button.scss +5 -3
- package/components/button/example-button-custom.njk +20 -0
- package/components/button/example-button-disabled.njk +7 -0
- package/components/button/example-button-download.njk +9 -0
- package/components/button/example-button-ghost.njk +15 -0
- package/components/button/example-button-group.njk +16 -0
- package/components/button/example-button-link.njk +7 -0
- package/components/button/example-button-loader.njk +9 -0
- package/components/button/example-button-new-window.njk +12 -0
- package/components/button/example-button-print.njk +8 -0
- package/components/button/example-button-secondary-small.njk +8 -0
- package/components/button/example-button-secondary.njk +8 -0
- package/components/button/example-button-small.njk +8 -0
- package/components/button/example-button-timer.njk +9 -0
- package/components/button/example-button.njk +6 -0
- package/components/call-to-action/example-call-to-action-default.njk +14 -0
- package/components/card/example-card-set-with-images.njk +41 -0
- package/components/card/example-card-set-with-lists.njk +68 -0
- package/components/card/example-card-set.njk +38 -0
- package/components/card/example-card.njk +9 -0
- package/components/checkboxes/example-checkboxes-disabled.njk +34 -0
- package/components/checkboxes/example-checkboxes-error.njk +60 -0
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +71 -0
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +177 -0
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +86 -0
- package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +69 -0
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +71 -0
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +59 -0
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +51 -0
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +61 -0
- package/components/checkboxes/example-checkboxes-without-border.njk +33 -0
- package/components/checkboxes/example-checkboxes.njk +46 -0
- package/components/content-pagination/example-content-pagination.njk +20 -0
- package/components/cookies-banner/_macro.njk +4 -4
- package/components/cookies-banner/_macro.spec.js +41 -1
- package/components/cookies-banner/example-cookies-banner-cymraeg.njk +9 -0
- package/components/cookies-banner/example-cookies-banner.njk +7 -0
- package/components/date-input/example-date-input-error.njk +62 -0
- package/components/date-input/example-date-input.njk +36 -0
- package/components/details/example-details-with-saved-state.njk +10 -0
- package/components/details/example-details-with-warning.njk +19 -0
- package/components/details/example-details.njk +9 -0
- package/components/document-list/example-document-list-article-featured.njk +31 -0
- package/components/document-list/example-document-list-articles.njk +60 -0
- package/components/document-list/example-document-list-downloads.njk +59 -0
- package/components/document-list/example-document-list-search-result-featured.njk +19 -0
- package/components/document-list/example-document-list-search-results.njk +67 -0
- package/components/duration/example-duration-error.njk +30 -0
- package/components/duration/example-duration.njk +35 -0
- package/components/duration/examples-duration-error-for-single-field.njk +31 -0
- package/components/external-link/example-external-link.njk +8 -0
- package/components/feedback/example-feedback-call-to-action.njk +14 -0
- package/components/footer/example-footer-cymraeg.njk +54 -0
- package/components/footer/example-footer-default.njk +7 -0
- package/components/footer/example-footer-transactional.njk +62 -0
- package/components/footer/example-footer-warning.njk +32 -0
- package/components/footer/example-footer-with-alternative-organisation.njk +124 -0
- package/components/footer/example-footer-with-coat-of-arms.njk +32 -0
- package/components/footer/example-footer-with-copyright.njk +35 -0
- package/components/footer/example-footer.njk +85 -0
- package/components/header/_header.scss +2 -2
- package/components/header/_macro.spec.js +97 -0
- package/components/header/example-header-default.njk +12 -0
- package/components/header/example-header-external-for-survey-with-description.njk +20 -0
- package/components/header/example-header-external-for-surveys.njk +33 -0
- package/components/header/example-header-external-welsh.njk +29 -0
- package/components/header/example-header-external-with-navigation.njk +42 -0
- package/components/header/example-header-external-with-service-links.njk +35 -0
- package/components/header/example-header-external-with-sub-navigation.njk +132 -0
- package/components/header/example-header-internal.njk +32 -0
- package/components/header/example-header-neutral-for-multicoloured-logo.njk +59 -0
- package/components/hero/example-hero-dark.njk +15 -0
- package/components/hero/example-hero-default.njk +14 -0
- package/components/images/example-images-for-regular-screens.njk +8 -0
- package/components/images/example-images-for-retina-screens.njk +10 -0
- package/components/input/example-input-email.njk +12 -0
- package/components/input/example-input-number-prefixed.njk +17 -0
- package/components/input/example-input-number-suffixed.njk +34 -0
- package/components/input/example-input-number.njk +15 -0
- package/components/input/example-input-numeric-values.njk +64 -0
- package/components/input/example-input-telephone.njk +13 -0
- package/components/input/example-input-text-width-constrained.njk +11 -0
- package/components/input/example-input-text-with-character-limit-checker.njk +17 -0
- package/components/input/example-input-text-with-description.njk +10 -0
- package/components/input/example-input-text.njk +9 -0
- package/components/label/example-label-with-description.njk +8 -0
- package/components/label/example-label.njk +8 -0
- package/components/metadata/example-metadata.njk +57 -0
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +71 -0
- package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +47 -0
- package/components/mutually-exclusive/example-mutually-exclusive-date.njk +49 -0
- package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +45 -0
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +36 -0
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +63 -0
- package/components/mutually-exclusive/example-mutually-exclusive-number.njk +43 -0
- package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +40 -0
- package/components/navigation/_macro.njk +1 -1
- package/components/pagination/example-pagination-first.njk +24 -0
- package/components/pagination/example-pagination-last.njk +24 -0
- package/components/pagination/example-pagination-with-no-range-indicator.njk +42 -0
- package/components/pagination/example-pagination.njk +116 -0
- package/components/panel/example-panel-bare.njk +9 -0
- package/components/panel/example-panel-with-announcement.njk +18 -0
- package/components/panel/example-panel-with-error-details.njk +18 -0
- package/components/panel/example-panel-with-error-summary.njk +25 -0
- package/components/panel/example-panel-with-information.njk +7 -0
- package/components/panel/example-panel-with-spacious-information.njk +7 -0
- package/components/panel/example-panel-with-success-message.njk +10 -0
- package/components/panel/example-panel-with-warning.njk +8 -0
- package/components/password/example-password.njk +11 -0
- package/components/phase-banner/example-phase-banner-alpha.njk +10 -0
- package/components/phase-banner/example-phase-banner-beta.njk +9 -0
- package/components/question/example-question-ccs.njk +49 -0
- package/components/question/example-question-fieldset.njk +99 -0
- package/components/question/example-question-interviewer-note.njk +38 -0
- package/components/question/example-question-no-fieldset.njk +46 -0
- package/components/radios/example-radios-with-clear-button.njk +97 -0
- package/components/radios/example-radios-with-descriptions.njk +57 -0
- package/components/radios/example-radios-with-error.njk +38 -0
- package/components/radios/example-radios-with-revealed-checkboxes.njk +69 -0
- package/components/radios/example-radios-with-revealed-radios.njk +68 -0
- package/components/radios/example-radios-with-revealed-select.njk +69 -0
- package/components/radios/example-radios-with-revealed-text-input.njk +80 -0
- package/components/radios/example-radios-with-separator.njk +59 -0
- package/components/radios/example-radios-with-visible-text-input.njk +40 -0
- package/components/radios/example-radios-without-border.njk +48 -0
- package/components/radios/examples-radios.njk +38 -0
- package/components/related-content/example-related-content-general.njk +44 -0
- package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -0
- package/components/related-content/example-related-content-social-media.njk +40 -0
- package/components/relationships/example-relationships-error.njk +211 -0
- package/components/relationships/example-relationships-you.njk +187 -0
- package/components/relationships/example-relationships.njk +185 -0
- package/components/search/example-search-with-character-check.njk +23 -0
- package/components/search/example-search-with-placeholder.njk +16 -0
- package/components/search/example-search.njk +16 -0
- package/components/section-navigation/example-section-navigation-vertical.njk +40 -0
- package/components/section-navigation/example-section-navigation.njk +21 -0
- package/components/select/example-select-wide.njk +55 -0
- package/components/select/example-select-with-error.njk +58 -0
- package/components/select/example-select-with-inline-label.njk +23 -0
- package/components/select/example-select.njk +50 -0
- package/components/share-page/example-share-page.njk +11 -0
- package/components/skip-to-content/example-skip-to-content.njk +10 -0
- package/components/status/example-status-dead.njk +7 -0
- package/components/status/example-status-error.njk +7 -0
- package/components/status/example-status-neutral-information.njk +6 -0
- package/components/status/example-status-pending.njk +7 -0
- package/components/status/example-status-small.njk +8 -0
- package/components/status/example-status-success.njk +7 -0
- package/components/summary/example-summary-grouped-total.njk +67 -0
- package/components/summary/example-summary-grouped-with-errors.njk +96 -0
- package/components/summary/example-summary-grouped.njk +353 -0
- package/components/summary/example-summary-household-no-rows.njk +20 -0
- package/components/summary/example-summary-household.njk +77 -0
- package/components/summary/example-summary-hub.njk +170 -0
- package/components/summary/example-summary-multiple.njk +81 -0
- package/components/summary/example-summary-no-action.njk +40 -0
- package/components/summary/example-summary.njk +107 -0
- package/components/table/_macro.njk +1 -1
- package/components/table/_table.scss +10 -10
- package/components/table/example-table-basic.njk +47 -0
- package/components/table/example-table-compact.njk +73 -0
- package/components/table/example-table-footer.njk +56 -0
- package/components/table/example-table-numeric.njk +81 -0
- package/components/table/example-table-responsive.njk +89 -0
- package/components/table/example-table-scrollable.njk +158 -0
- package/components/table/example-table-sortable.njk +236 -0
- package/components/table/sortable-table.dom.js +1 -1
- package/components/table/sortable-table.js +5 -2
- package/components/table-of-contents/example-table-of-contents-grouped.njk +50 -0
- package/components/table-of-contents/example-table-of-contents-single.njk +39 -0
- package/components/table-of-contents/example-table-of-contents-sticky.njk +78 -0
- package/components/tabs/example-tabs-details.njk +59 -0
- package/components/tabs/example-tabs.njk +39 -0
- package/components/textarea/example-textarea-error.njk +16 -0
- package/components/textarea/example-textarea-with-character-limit.njk +18 -0
- package/components/textarea/example-textarea.njk +12 -0
- package/components/timeline/example-timeline.njk +35 -0
- package/components/timeout-modal/example-timeout-modal.njk +16 -0
- package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -0
- package/components/upload/example-upload-error.njk +16 -0
- package/components/upload/example-upload.njk +12 -0
- package/components/video/example-video.njk +14 -0
- package/css/main.css +3 -3
- package/css/print.css +1 -1
- package/layout/_template.njk +1 -12
- package/package.json +3 -8
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +2 -2
- package/scss/base/_typography.scss +2 -2
- package/scss/main.scss +0 -1
- package/scss/print.scss +13 -5
- package/scss/utilities/_highlight.scss +6 -0
- package/scss/utilities/_index.scss +1 -0
- package/components/code-highlight/_macro.njk +0 -5
- package/components/code-highlight/_macro.spec.js +0 -56
- package/components/code-highlight/code-highlight.spec.js +0 -18
- package/scss/patternlib.scss +0 -148
package/scss/main.scss
CHANGED
package/scss/print.scss
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
html {
|
|
2
|
-
--ons-color-black: #222;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
.ons-btn,
|
|
6
2
|
.ons-navigation-search,
|
|
7
3
|
.ons-summary__actions,
|
|
8
4
|
.ons-footer,
|
|
9
5
|
.ons-cookies-banner,
|
|
10
6
|
.ons-language-links,
|
|
11
|
-
.ons-breadcrumb
|
|
7
|
+
.ons-breadcrumb,
|
|
8
|
+
.ons-u-ph {
|
|
12
9
|
display: none !important;
|
|
13
10
|
}
|
|
14
11
|
|
|
@@ -60,3 +57,14 @@ details > summary {
|
|
|
60
57
|
.ons-grid__col {
|
|
61
58
|
display: block; // Prevents page breaking before grid col when printing from Chrome see: https://github.com/ONSdigital/design-system/issues/2584
|
|
62
59
|
}
|
|
60
|
+
|
|
61
|
+
.ons-panel,
|
|
62
|
+
h1,
|
|
63
|
+
h2,
|
|
64
|
+
h3,
|
|
65
|
+
h4,
|
|
66
|
+
h5,
|
|
67
|
+
h6,
|
|
68
|
+
p {
|
|
69
|
+
break-inside: avoid;
|
|
70
|
+
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/** @jest-environment jsdom */
|
|
2
|
-
|
|
3
|
-
import * as cheerio from 'cheerio';
|
|
4
|
-
|
|
5
|
-
import axe from '../../tests/helpers/axe';
|
|
6
|
-
import { renderComponent } from '../../tests/helpers/rendering';
|
|
7
|
-
|
|
8
|
-
describe('macro: code-highlight', () => {
|
|
9
|
-
it('passes jest-axe checks', async () => {
|
|
10
|
-
const $ = cheerio.load(
|
|
11
|
-
renderComponent('code-highlight', {
|
|
12
|
-
language: 'js',
|
|
13
|
-
code: 'let a = 42;',
|
|
14
|
-
}),
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const results = await axe($.html());
|
|
18
|
-
expect(results).toHaveNoViolations();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('has the default language modifier style class "markup" when not specified', () => {
|
|
22
|
-
const $ = cheerio.load(
|
|
23
|
-
renderComponent('code-highlight', {
|
|
24
|
-
code: '<p>Example paragraph...</p>',
|
|
25
|
-
}),
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
expect($('.ons-patternlib-example__code').hasClass('ons-language-markup')).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('has the provided language modifier style class "markup" when not specified', () => {
|
|
32
|
-
const $ = cheerio.load(
|
|
33
|
-
renderComponent('code-highlight', {
|
|
34
|
-
language: 'js',
|
|
35
|
-
code: 'let a = 42;',
|
|
36
|
-
}),
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
expect($('.ons-patternlib-example__code').hasClass('ons-language-js')).toBe(true);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('has the provided code', () => {
|
|
43
|
-
const $ = cheerio.load(
|
|
44
|
-
renderComponent('code-highlight', {
|
|
45
|
-
language: 'js',
|
|
46
|
-
code: 'let a = 42;',
|
|
47
|
-
}),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
expect(
|
|
51
|
-
$('.ons-patternlib-example__code')
|
|
52
|
-
.text()
|
|
53
|
-
.trim(),
|
|
54
|
-
).toBe('let a = 42;');
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { renderComponent, setTestPage } from '../../tests/helpers/rendering';
|
|
2
|
-
|
|
3
|
-
describe('script: code-highlight', () => {
|
|
4
|
-
describe('mode: link', () => {
|
|
5
|
-
it('highlights tokens in code', async () => {
|
|
6
|
-
await setTestPage(
|
|
7
|
-
'/test',
|
|
8
|
-
renderComponent('code-highlight', {
|
|
9
|
-
language: 'js',
|
|
10
|
-
code: 'let a = 42;',
|
|
11
|
-
}),
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const tokenCount = await page.$$eval('.ons-patternlib-example__code .token', elements => elements.length);
|
|
15
|
-
expect(tokenCount).toBeGreaterThanOrEqual(1);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|
package/scss/patternlib.scss
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
@import '../views/partials/example/example';
|
|
2
|
-
@import '../foundations/style/colours/colours';
|
|
3
|
-
@import '../foundations/style/icons/icon-swatch';
|
|
4
|
-
@import 'prism-tomorrow';
|
|
5
|
-
|
|
6
|
-
.ons-patternlib-page {
|
|
7
|
-
height: 100vh;
|
|
8
|
-
|
|
9
|
-
&--example {
|
|
10
|
-
display: block;
|
|
11
|
-
height: auto;
|
|
12
|
-
padding: 1.5rem;
|
|
13
|
-
|
|
14
|
-
.ons-page,
|
|
15
|
-
.ons-page__content {
|
|
16
|
-
overflow-x: visible;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&__header {
|
|
21
|
-
margin: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&__sub-nav {
|
|
25
|
-
.ons-nav {
|
|
26
|
-
width: 100%;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&__body {
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__content {
|
|
35
|
-
width: 100%;
|
|
36
|
-
p,
|
|
37
|
-
li,
|
|
38
|
-
h3,
|
|
39
|
-
h4,
|
|
40
|
-
h5,
|
|
41
|
-
h6 {
|
|
42
|
-
max-width: 40rem;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
code:not(.ons-patternlib-example__code) {
|
|
46
|
-
background: var(--ons-color-grey-5);
|
|
47
|
-
color: var(--ons-color-ruby-red);
|
|
48
|
-
padding: 0.05rem 0.25rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
table {
|
|
52
|
-
border-collapse: collapse;
|
|
53
|
-
border-spacing: 0;
|
|
54
|
-
margin: 0;
|
|
55
|
-
width: 100%;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
th {
|
|
59
|
-
border-bottom: 2px solid var(--ons-color-grey-100);
|
|
60
|
-
padding: 0.5rem 0 0.5rem 1rem;
|
|
61
|
-
text-align: left;
|
|
62
|
-
vertical-align: top;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
th,
|
|
66
|
-
td {
|
|
67
|
-
line-height: 1.6;
|
|
68
|
-
padding: 0.5rem 0 0.5rem 1rem;
|
|
69
|
-
&:first-child {
|
|
70
|
-
padding-left: 0;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
td {
|
|
75
|
-
background: transparent;
|
|
76
|
-
border-bottom: 1px solid var(--ons-color-borders);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
tr:last-child td {
|
|
80
|
-
border: 0;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&__content,
|
|
85
|
-
&__sub-nav {
|
|
86
|
-
> {
|
|
87
|
-
h1,
|
|
88
|
-
h2,
|
|
89
|
-
h3,
|
|
90
|
-
h4,
|
|
91
|
-
h5,
|
|
92
|
-
h6 {
|
|
93
|
-
&:not(:first-child) {
|
|
94
|
-
margin-top: 2rem;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
h5,
|
|
99
|
-
h6 {
|
|
100
|
-
font-size: 1rem;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@for $i from 1 through 6 {
|
|
104
|
-
@for $c from 1 through 6 {
|
|
105
|
-
h#{$i} + h#{$c}:not(:first-child) {
|
|
106
|
-
margin-top: 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&__content-header {
|
|
114
|
-
margin-bottom: 1rem;
|
|
115
|
-
position: relative;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.ons-panel + .ons-patternlib-example {
|
|
119
|
-
margin-top: 2rem;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.ons-patternlib-example__iframe {
|
|
124
|
-
padding-right: 1px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.ons-patternlib-hero {
|
|
128
|
-
background: var(--ons-color-grey-5);
|
|
129
|
-
padding: 2rem 0 1rem;
|
|
130
|
-
width: 100%;
|
|
131
|
-
|
|
132
|
-
&__title {
|
|
133
|
-
max-width: 30rem;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ons-pl-experimental-tag {
|
|
138
|
-
background: var(--ons-color-info);
|
|
139
|
-
color: var(--ons-color-text-inverse);
|
|
140
|
-
display: inline-block;
|
|
141
|
-
font-size: 0.7rem;
|
|
142
|
-
font-weight: 700;
|
|
143
|
-
letter-spacing: 0.1rem;
|
|
144
|
-
margin-right: 0.5rem;
|
|
145
|
-
outline: 2px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show background
|
|
146
|
-
padding: 0.3rem 0.5rem;
|
|
147
|
-
text-transform: uppercase;
|
|
148
|
-
}
|