@ons/design-system 62.0.2 → 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/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 +2 -2
- package/components/cookies-banner/_macro.spec.js +1 -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/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/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/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-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/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/css/print.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.ons-btn,.ons-navigation-search,.ons-summary__actions,.ons-footer,.ons-cookies-banner,.ons-language-links,.ons-breadcrumb,.ons-u-ph{display:none !important}a::after{content:" (" attr(href) ") "}.ons-header__main,.ons-header__bottom{background:transparent}.ons-header__title{color:var(--ons-color-black)}.ons-header .ons-header__svg-logo{fill:var(--ons-color-black)}.ons-navigation--main,.ons-navigation--sub{border-top:1px solid var(--ons-color-text-link);display:block !important;padding:1rem 0 .5rem}.ons-navigation--main .ons-navigation__item,.ons-navigation--sub .ons-navigation__item{display:inline-block}.ons-navigation--main .ons-navigation__item--active,.ons-navigation--sub .ons-navigation__item--active{border:0}.ons-navigation--main .ons-navigation__link,.ons-navigation--main .ons-navigation__link:hover,.ons-navigation--sub .ons-navigation__link,.ons-navigation--sub .ons-navigation__link:hover{color:var(--ons-color-text-link)}details,details>summary{display:block !important}.ons-hero{-webkit-print-color-adjust:exact;color-adjust:exact}.ons-grid__col{display:block}.ons-panel,h1,h2,h3,h4,h5,h6,p{-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}
|
package/layout/_template.njk
CHANGED
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
{% set cdn_url = (pageConfig.cdn.url if pageConfig.cdn and pageConfig.cdn.url) or "https://cdn.ons.gov.uk/sdc/design-system" %}
|
|
17
17
|
{% set slash = "" if cdn_url | last == "/" else "/" %}
|
|
18
18
|
{% set assetsURL = cdn_url + slash + ((pageConfig.cdn.version if pageConfig.cdn and pageConfig.cdn.version) or release_version or designSystemVersion) %}
|
|
19
|
-
{% elif pageInfo and pageInfo.version %}
|
|
20
|
-
{# Prototype kits #}
|
|
21
|
-
{% set assetsURL = "/" + pageInfo.version %}
|
|
22
19
|
{% elif pageConfig.assetsURL %}
|
|
23
20
|
{# Runner Dev #}
|
|
24
21
|
{% set assetsURL = pageConfig.assetsURL %}
|
|
@@ -29,8 +26,6 @@
|
|
|
29
26
|
|
|
30
27
|
{% if pageConfig and pageConfig.title %}
|
|
31
28
|
{% set page_title = pageConfig.title %}
|
|
32
|
-
{% elif pageInfo and pageInfo.title %}
|
|
33
|
-
{% set page_title = pageInfo.title %}
|
|
34
29
|
{% elif page and page.title %}
|
|
35
30
|
{% set page_title = page.title %}
|
|
36
31
|
{% else %}
|
|
@@ -225,15 +220,9 @@
|
|
|
225
220
|
{% block bodyEnd %}{% endblock %}
|
|
226
221
|
{% endblock %}
|
|
227
222
|
|
|
228
|
-
{% if isPatternLib %}
|
|
229
|
-
{% set scripts = assetsURL + "/scripts/main.js," + assetsURL + "/scripts/patternlib.js" %}
|
|
230
|
-
{% else %}
|
|
231
|
-
{% set scripts = assetsURL + "/scripts/main.js" %}
|
|
232
|
-
{% endif %}
|
|
233
|
-
|
|
234
223
|
<script{% if pageConfig.cspNonce %} nonce="{{ pageConfig.cspNonce }}"{% elif pageConfig.cspNonce is not defined and csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>
|
|
235
224
|
(function() {
|
|
236
|
-
var s = '{{
|
|
225
|
+
var s = [ '{{ assetsURL }}/scripts/main.js' ],
|
|
237
226
|
c = document.createElement('script');
|
|
238
227
|
|
|
239
228
|
if (!('noModule' in c)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ons/design-system",
|
|
3
3
|
"description": "ONS Design System built CSS, JS, and Nunjucks templates",
|
|
4
|
-
"version": "62.0
|
|
4
|
+
"version": "62.1.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "gulp start",
|
|
12
12
|
"watch": "gulp watch",
|
|
13
|
-
"test": "gulp build-assets
|
|
13
|
+
"test": "gulp build-assets && TEST_PORT=3020 TEST_WITH_PUPPETEER=1 jest '.*\\.spec\\.js'",
|
|
14
14
|
"test:no-build": "TEST_PORT=3020 TEST_WITH_PUPPETEER=1 jest '.*\\.spec\\.js'",
|
|
15
15
|
"test:with-log": "yarn test --no-color 2>test.log",
|
|
16
16
|
"test:start-server": "TEST_PORT=3020 gulp start-dev-server",
|
|
17
17
|
"build": "yarn && yarn tidy-clean && NODE_ENV=production gulp build",
|
|
18
18
|
"npm-bundle": "NODE_ENV=production yarn tidy-clean && NODE_ENV=production gulp build-package && babel-node ci/generate-npm-package.js",
|
|
19
19
|
"cdn-bundle": "NODE_ENV=production yarn tidy-clean && NODE_ENV=production gulp build-package && babel-node ci/prepare-templates-for-zip.js",
|
|
20
|
-
"test-visual": "yarn build && npx percy exec -- babel-node src/tests/visual/percy.snapshots.js",
|
|
21
20
|
"tidy-clean": "rm -rf build css favicons fonts img components layout scripts coverage scss js",
|
|
22
21
|
"check-unused": "npx npm-check-unused",
|
|
23
22
|
"dedupe-deps": "npx yarn-deduplicate yarn.lock",
|
|
@@ -101,7 +100,6 @@
|
|
|
101
100
|
"gulp-terser": "^2.0.1",
|
|
102
101
|
"http-server": "^0.12.3",
|
|
103
102
|
"husky": "^1.2.0",
|
|
104
|
-
"iframe-resizer": "4.2.11",
|
|
105
103
|
"jest": "^27.5.1",
|
|
106
104
|
"jest-axe": "^6.0.0",
|
|
107
105
|
"jest-puppeteer": "^6.1.0",
|
|
@@ -109,7 +107,6 @@
|
|
|
109
107
|
"lighthouse": "^7.5.0",
|
|
110
108
|
"lint-staged": "^8.1.0",
|
|
111
109
|
"lodash": "^4.17.21",
|
|
112
|
-
"marked": "^2.1.3",
|
|
113
110
|
"mdn-polyfills": "^5.14.0",
|
|
114
111
|
"minimist": "^1.2.5",
|
|
115
112
|
"normalize.css": "^8.0.1",
|
|
@@ -118,7 +115,6 @@
|
|
|
118
115
|
"postcss-url": "^8.0.0",
|
|
119
116
|
"prepend-file": "^1.3.1",
|
|
120
117
|
"prettier": "^1.15.2",
|
|
121
|
-
"prismjs": "1.24.0",
|
|
122
118
|
"puppeteer": "^13.5.1",
|
|
123
119
|
"remark-cli": "^9.0.0",
|
|
124
120
|
"remark-lint": "^8.0.0",
|
|
@@ -137,8 +133,7 @@
|
|
|
137
133
|
"vinyl-buffer": "^1.0.1",
|
|
138
134
|
"vinyl-source-stream": "^2.0.0",
|
|
139
135
|
"watchify": "^3.0.0",
|
|
140
|
-
"whatwg-fetch": "^3.0.0"
|
|
141
|
-
"yaml": "^1.10.2"
|
|
136
|
+
"whatwg-fetch": "^3.0.0"
|
|
142
137
|
},
|
|
143
138
|
"publishConfig": {
|
|
144
139
|
"access": "public"
|
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
|
-
}
|