mp-design-system 1.2.10 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/dist/build/js/app.js +1 -1
  2. package/dist/build/js/app.js.map +1 -1
  3. package/dist/build/scss/library.css +1 -1
  4. package/dist/build/scss/library.css.map +1 -1
  5. package/dist/build/scss/main.css +1 -1
  6. package/dist/build/scss/main.css.map +1 -1
  7. package/package.json +1 -1
  8. package/src/_headers +1 -1
  9. package/src/_includes/components/card/card.scss +0 -38
  10. package/src/_includes/components/card/event-series-card.config.js +36 -0
  11. package/src/_includes/components/card/event-series-card.njk +45 -0
  12. package/src/_includes/components/card/event-series-card.scss +57 -0
  13. package/src/_includes/components/dynamic-form/dynamic-form.config.js +16 -0
  14. package/src/_includes/components/dynamic-form/dynamic-form.njk +319 -0
  15. package/src/_includes/components/dynamic-form/dynamic-form.scss +77 -0
  16. package/src/_includes/components/dynamic-form/macro.njk +5 -0
  17. package/src/_includes/components/embed/embed.scss +3 -0
  18. package/src/_includes/components/hero/hero.scss +1 -0
  19. package/src/_includes/components/input/combobox.njk +17 -0
  20. package/src/_includes/components/input/combobox.scss +31 -0
  21. package/src/_includes/components/input/combox.config.js +49 -0
  22. package/src/_includes/components/internal-nav/internal-nav.config.js +18 -0
  23. package/src/_includes/components/internal-nav/internal-nav.njk +18 -0
  24. package/src/_includes/components/internal-nav/internal-nav.scss +41 -21
  25. package/src/assets/js/app.js +2 -0
  26. package/src/assets/js/imports/combobox.js +66 -0
  27. package/src/assets/js/imports/internal-nav.js +23 -0
  28. package/src/assets/scss/components/index.scss +1 -0
@@ -0,0 +1,17 @@
1
+ {# <div class="c-combobox">
2
+ <input type="text" class="c-combobox__input" id="combobox-input" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="combobox-label" autocomplete="off" placeholder="Select an option" role="combobox" aria-owns="combobox-options">
3
+ <ul class="c-combobox__dropdown" id="combobox-options" role="listbox" aria-labelledby="combobox-input">
4
+ <li data-value="option1" role="option">Option 1</li>
5
+ <li data-value="option2" role="option">Option 2</li>
6
+ <li data-value="option3" role="option">Option 3</li>
7
+ </ul>
8
+ <div> #}
9
+
10
+ <div class="c-combobox">
11
+ <input type="text" id="combobox-input" class="c-combobox__input" placeholder="Type to search..." autocomplete="off" aria-controls="combobox-list" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-owns="combobox-select">
12
+ <ul id="combobox-select" class="c-combobox__select" role="listbox" aria-label="Options" tabindex="-1">
13
+ <li role="option" aria-selected="false">Option 1</li>
14
+ <li role="option" aria-selected="false">Option 2</li>
15
+ <li role="option" aria-selected="false">Option 3</li>
16
+ </ul>
17
+ </div>
@@ -0,0 +1,31 @@
1
+ .c-combobox {
2
+ position: relative;
3
+ display: inline-block;
4
+
5
+ &__input {
6
+ width: 200px;
7
+ padding: 5px;
8
+ }
9
+
10
+ &__select {
11
+ position: absolute;
12
+ z-index: 1;
13
+ list-style-type: none;
14
+ padding: 0;
15
+ margin: 0;
16
+ background-color: #f9f9f9;
17
+ border: 1px solid #ccc;
18
+ border-top: none;
19
+ display: none;
20
+
21
+ li {
22
+ padding: 10px;
23
+ cursor: pointer;
24
+
25
+ &[aria-selected="true"] {
26
+ background-color: #e6e6e6;
27
+ }
28
+ }
29
+ }
30
+
31
+ }
@@ -0,0 +1,49 @@
1
+ const categories = require('../component/categories');
2
+
3
+ module.exports = {
4
+ title: 'Combobox',
5
+ category: categories.form,
6
+ component: {
7
+ name: 'combobox',
8
+ folder: 'input'
9
+ },
10
+ figma: 'https://www.figma.com/file/rUQ6aPQAfBX55o3hH0Lqb3/Design-exploration?node-id=213%3A918',
11
+ preview: 'form',
12
+ context: {
13
+ label: 'Label',
14
+ name: 'name',
15
+ id: 'id',
16
+ type: 'text',
17
+ placeholder: 'Placeholder',
18
+ required: true
19
+ },
20
+ variants: [
21
+ {
22
+ title: 'With error',
23
+ context: {
24
+ error: true
25
+ }
26
+ },
27
+ {
28
+ title: 'With error message',
29
+ context: {
30
+ error: 'This field is required'
31
+ }
32
+ },
33
+ {
34
+ title: 'Disabled',
35
+ context: {
36
+ disabled: true
37
+ }
38
+ }
39
+ ],
40
+ props: [
41
+ {
42
+ table: [
43
+ ['label', 'string'],
44
+ ['id', 'string', 'ID attribute'],
45
+ ['name', 'string', 'Name attribute (falls back to ID)'],
46
+ ]
47
+ }
48
+ ]
49
+ }
@@ -13,6 +13,24 @@ module.exports = {
13
13
  { link: '#our-product-brands', label: 'Our product brands' }
14
14
  ]
15
15
  },
16
+ variants: [
17
+ {
18
+ title: 'Sticky on scroll',
19
+ context: {
20
+ classes: 'u-sticky',
21
+ title: 'Mastersizer range',
22
+ links: [
23
+ { link: '#overview', label: 'Overview' },
24
+ { link: '#products', label: 'Products' },
25
+ { link: '#compare', label: 'Compare' },
26
+ ],
27
+ button: {
28
+ link: '#',
29
+ label: 'Request a quote',
30
+ }
31
+ }
32
+ }
33
+ ],
16
34
  props: [
17
35
  {
18
36
  table: [
@@ -1,9 +1,27 @@
1
+ <figure class="mp c-hero c-hero--image"><div class="u-wrap"><nav class="c-breadcrumb" aria-label="Breadcrumb"><ol class="c-breadcrumb__list" role="list"><li class="c-breadcrumb__item" role="listitem"><a href="/en/products" class="c-breadcrumb__link">Products</a></li><li class="c-breadcrumb__item" role="listitem"><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--chevron-down"><use xlink:href="/resource/svg/sprite.svg#chevron-down"></use></svg><a href="/en/products/product-range" class="c-breadcrumb__link">Product range</a></li><li class="c-breadcrumb__item" role="listitem"><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--chevron-down"><use xlink:href="/resource/svg/sprite.svg#chevron-down"></use></svg><span class="c-breadcrumb__current" aria-current="Mastersizer range">Mastersizer range</span></li></ol></nav><div class="c-hero__content"><header class="u-flow--xs"><h1 class="c-h c-h--page-title">Mastersizer range</h1><p class="u-step-1">World's most popular particle size analyzers</p></header><a id="brochureDownload" class="mp c-twi u-link c-twi--left" name="downloadTracking" href="/en/assets/Mastersizer%203000%20Brochure%20%28EN%29_tcm50-58994.pdf" onclick='dataLayer.push({event:"brochure_download",tcmId:"58994",filePath:"/en/products/product-range/mastersizer-range",type:"1"}),_paq.push(["trackEvent","Button click","Download brochure","/en/products/product-range/mastersizer-range"]),stc("1","58994","/en/products/product-range/mastersizer-range")' download="Mastersizer_range" target="_blank"><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--file"><use xlink:href="/resource/svg/sprite.svg#file"></use></svg><span>Download brochure</span></a></div></div><div class="c-hero__image-bg" style="background-image:url(https://p3.aprimocdn.net/malvernpanalytical/0492be50-1fa5-4f7b-89a6-ad9e00b5d058/636216826573577799SD_Original%20file.jpg?quality=60&amp;width=1920)"></div></figure>
2
+
3
+ {%- from "components/button/macro.njk" import button -%}
4
+
1
5
  <nav class="mp c-internal-nav {{ params.classes }}" aria-label="In-page">
2
6
  <div class="c-internal-nav__wrap">
7
+ {% if params.title %}
8
+ <p class="c-internal-nav__title">{{ params.title }}</p>
9
+ {% endif %}
3
10
  <ul class="c-internal-nav__list">
4
11
  {% for item in params.links %}
5
12
  <li><a href="{{ item.link }}">{{ item.label }}</a></li>
6
13
  {% endfor %}
14
+ {% if params.button %}
15
+ {{ button({
16
+ link: params.button.link,
17
+ label: params.button.label,
18
+ colour: 'green',
19
+ classes: 'c-button--small'
20
+ }) }}
21
+ {% endif %}
7
22
  </ul>
8
23
  </div>
9
24
  </nav>
25
+
26
+
27
+ <div class="mp u-wrap u-pad-top-s u-margin-bottom-l-xl"><div class="o-grid o-grid--of-two-late u-pad-bottom-s"><div><div class="mp o-prose u-flow--prose"><p>The Mastersizer range of laser diffraction particle size analyzers set the standard for delivering rapid, accurate particle size distributions for both wet and dry dispersions. From assessing product uniformity and solubility, through to optimising packing density to improve final product performance and controlling powder flowability to increase manufacturing efficiency, particle size analysis is critical to understanding and controlling a wide range of properties. The Mastersizer range, with its intuitive software and industry-leading design and ergonomics, enables users to make these particle sizing measurements fast and routine.</p><p><strong><img src="https://p3.aprimocdn.net/malvernpanalytical/a2d29b47-f548-4104-82ad-ada400c38338/637353357645078214LB_Original%20file.png" style="float:left;width:40px;height:48px"> &nbsp;</strong><strong>Works with&nbsp;<a title="Analytical Instrument Qualification" href="/en/industries/pharmaceuticals/compliance-analytical-instrument-qualification">OmniTrust</a>: Malvern Panalytical's compliance solution for the regulated environment</strong></p></div><div class="u-margin-top-m"><a href="/en/products/request-a-quote?product=9446" class="mp c-button mp c-button c-button--inline">Request a quote</a><a href="/en/products/request-a-demonstration?product=9446" class="mp c-button mp c-button c-button--inline c-button--blue">Request a demo</a><a href="/en/about-us/contact-us/sales?product=9446" class="mp c-button mp c-button c-button--inline c-button--outline-green">Contact sales</a></div></div><div><figure class="c-embed"><div class="c-embed__wrapper"><iframe title="Video title" width="640" height="360" src="https://www.youtube.com/embed/Q4H7EdHFghs" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" enablejsapi="true"></iframe></div></figure></div></div><div id="product-comparison-table" class="mp c-comparison u-margin-y-l"><div class="c-comparison__mobile"><article><div class="c-comparison__content"><a href="/en/products/product-range/mastersizer-range/mastersizer-3000" class="c-comparison__link u-flow--prose"><figure><img src="https://p3.aprimocdn.net/malvernpanalytical/39514ce3-3c03-4457-bd60-ad9e000133fb/636216692140429322FO_Original%20file.jpg?quality=60&amp;width=200" alt="Mastersizer 3000" loading="lazy" width="200"></figure><h3 class="c-h c-h--step-0">Mastersizer 3000</h3><p>Delivering the data you need for outcomes you can trust</p><span class="mp c-button u-md-hidden">More details</span></a></div><table class="c-table"><tbody><tr><td>Particle size range</td><td>0.01µm - 3500µm</td></tr><tr class="c-table__title"><th colspan="2">Technology</th></tr><tr><td>Laser Diffraction</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr><tr class="c-table__title"><th colspan="2">Dispersion type</th></tr><tr><td>Wet</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr><tr><td>Dry</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr></tbody></table></article><article><div class="c-comparison__content"><a href="/en/products/product-range/mastersizer-range/mastersizer-3000e" class="c-comparison__link u-flow--prose"><figure><img src="https://p3.aprimocdn.net/malvernpanalytical/c975939f-9b34-4cf8-9c05-ad9e00014d61/636216692720089326GR_Original%20file.jpg?quality=60&amp;width=200" alt="Mastersizer 3000E" loading="lazy" width="200"></figure><h3 class="c-h c-h--step-0">Mastersizer 3000E</h3><p>Entry level particle size analyzer</p><span class="mp c-button u-md-hidden">More details</span></a></div><table class="c-table"><tbody><tr><td>Particle size range</td><td>0.1µm - 1000µm</td></tr><tr class="c-table__title"><th colspan="2">Technology</th></tr><tr><td>Laser Diffraction</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr><tr class="c-table__title"><th colspan="2">Dispersion type</th></tr><tr><td>Wet</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr><tr><td>Dry</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr></tbody></table></article></div><div class="c-comparison__wrapper"><table class="c-table c-table--comparison"><thead><tr><th></th><th><a href="/en/products/product-range/mastersizer-range/mastersizer-3000" class="c-comparison__link u-flow--prose"><figure><img src="https://p3.aprimocdn.net/malvernpanalytical/39514ce3-3c03-4457-bd60-ad9e000133fb/636216692140429322FO_Original%20file.jpg?quality=60&amp;width=200" alt="Mastersizer 3000" loading="lazy" width="200"></figure><h3 class="c-h c-h--step-0">Mastersizer 3000</h3><p>Delivering the data you need for outcomes you can trust</p><span class="mp c-button u-md-hidden">More details</span></a></th><th><a href="/en/products/product-range/mastersizer-range/mastersizer-3000e" class="c-comparison__link u-flow--prose"><figure><img src="https://p3.aprimocdn.net/malvernpanalytical/c975939f-9b34-4cf8-9c05-ad9e00014d61/636216692720089326GR_Original%20file.jpg?quality=60&amp;width=200" alt="Mastersizer 3000E" loading="lazy" width="200"></figure><h3 class="c-h c-h--step-0">Mastersizer 3000E</h3><p>Entry level particle size analyzer</p><span class="mp c-button u-md-hidden">More details</span></a></th></tr><tr><th></th><th><a href="/en/products/product-range/mastersizer-range/mastersizer-3000" class="mp c-button c-button--tight">More details</a></th><th><a href="/en/products/product-range/mastersizer-range/mastersizer-3000e" class="mp c-button c-button--tight">More details</a></th></tr></thead><tbody><tr><td class="title">Particle size range</td><td>0.01µm - 3500µm</td><td>0.1µm - 1000µm</td></tr><tr class="c-table__title"><th colspan="3" class="title">Technology</th></tr><tr><td>Laser Diffraction</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr><tr class="c-table__title"><th colspan="3" class="title">Dispersion type</th></tr><tr><td>Wet</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr><tr><td>Dry</td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td><td><svg role="img" aria-hidden="true" focusable="false" class="mp c-icon c-icon--tick"><use xlink:href="/resource/svg/sprite.svg#tick"></use></svg></td></tr></tbody></table></div></div></div>
@@ -1,35 +1,55 @@
1
1
  .c-internal-nav {
2
- color: color('utility-blue');
2
+ background-color: transparent;
3
+ border-bottom: 1px solid color('grey', 'step-2');
4
+ transition: 300ms background-color;
3
5
 
4
6
  &__wrap {
5
- position: relative;
6
-
7
- &:after {
8
- content: '';
9
- background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
10
- position: absolute;
11
- z-index: 1;
12
- height: 100%;
13
- right: 0;
14
- top: 0;
15
- @include space('width', 'l');
16
-
17
- @media (min-width: $wrapper) {
18
- display: none;
19
- }
20
- }
7
+ @extend .u-wrap;
8
+ display: flex;
9
+ gap: var(--space-l);
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ }
13
+
14
+ &__title {
15
+ @include padding('s', 0);
16
+ flex-shrink: 0;
17
+ font-weight: bold;
21
18
  }
22
19
 
23
20
  &__list {
24
- @include padding-bottom('m-l');
25
- @include margin-bottom('m-l');
26
- border-bottom: 1px solid color('petrol', 'step-2');
21
+ @include padding('s', 0);
22
+ color: color('utility-blue');
27
23
  white-space: nowrap;
28
24
  overflow-x: auto;
29
25
  display: flex;
26
+ align-items: center;
27
+ font-size: var(--step--1);
30
28
 
31
29
  & > * + * {
32
- @include margin-left('m-l');
30
+ @include margin-left('l');
31
+ }
32
+ }
33
+
34
+
35
+
36
+ @media (max-width: 44em) {
37
+ &__title,
38
+ .c-button {
39
+ display: none;
40
+ }
41
+
42
+ &__list {
43
+ @include padding-bottom('s');
33
44
  }
34
45
  }
35
46
  }
47
+
48
+
49
+ .c-hero + .c-internal-nav {
50
+ margin-top: calc(var(--gutter) * -1);
51
+ }
52
+
53
+ .c-internal-nav.u-sticky {
54
+ top: -1px;
55
+ }
@@ -5,6 +5,7 @@ import Comparison from './imports/comparison';
5
5
  import Gallery from './imports/gallery';
6
6
  import HeroPattern from './imports/hero-pattern';
7
7
  import HeroVideo from './imports/hero-video';
8
+ import InternalNav from './imports/internal-nav';
8
9
  import OffCanvas from './imports/off-canvas';
9
10
  import ResponsiveTable from './imports/responsive-table';
10
11
  import ScrollbarWidth from './imports/scrollbar-width';
@@ -26,6 +27,7 @@ import Tabs from './imports/tabs';
26
27
  Gallery();
27
28
  HeroPattern();
28
29
  HeroVideo();
30
+ InternalNav();
29
31
  OffCanvas();
30
32
  ResponsiveTable();
31
33
  ScrollbarWidth();
@@ -0,0 +1,66 @@
1
+ function Combobox() {
2
+ const comboboxes = Array.from(document.querySelectorAll('.c-combobox'));
3
+
4
+ comboboxes.forEach(function (combobox) {
5
+ const input = combobox.querySelector('.c-combobox__input');
6
+ const select = combobox.querySelector('.c-combobox__select');
7
+ const options = Array.from(select.querySelectorAll('li[role="option"]'));
8
+
9
+ // Set initial state
10
+ input.setAttribute('aria-expanded', 'false');
11
+ input.setAttribute('aria-owns', select.id);
12
+ input.setAttribute('aria-controls', select.id);
13
+
14
+ // Event listeners
15
+ input.addEventListener('focus', function () {
16
+ input.setAttribute('aria-expanded', 'true');
17
+ select.setAttribute('aria-expanded', 'true');
18
+ });
19
+
20
+ input.addEventListener('blur', function () {
21
+ input.setAttribute('aria-expanded', 'false');
22
+ select.setAttribute('aria-expanded', 'false');
23
+ });
24
+
25
+ input.addEventListener('input', function () {
26
+ const inputValue = input.value.toLowerCase();
27
+
28
+ options.forEach(function (option) {
29
+ const optionText = option.textContent.toLowerCase();
30
+
31
+ if (optionText.includes(inputValue)) {
32
+ option.style.display = '';
33
+ option.setAttribute('aria-hidden', 'false');
34
+ } else {
35
+ option.style.display = 'none';
36
+ option.setAttribute('aria-hidden', 'true');
37
+ }
38
+ });
39
+ });
40
+
41
+ select.addEventListener('click', function (event) {
42
+ const target = event.target;
43
+ const isOption = target.getAttribute('role') === 'option';
44
+
45
+ if (isOption) {
46
+ const selectedOption = select.querySelector('[aria-selected="true"]');
47
+ if (selectedOption) {
48
+ selectedOption.setAttribute('aria-selected', 'false');
49
+ }
50
+
51
+ target.setAttribute('aria-selected', 'true');
52
+ input.value = target.textContent;
53
+
54
+ input.focus();
55
+ }
56
+ });
57
+
58
+ // Display options initially
59
+ options.forEach(function (option) {
60
+ option.style.display = '';
61
+ option.setAttribute('aria-hidden', 'false');
62
+ });
63
+ });
64
+ }
65
+
66
+ export default Combobox;
@@ -0,0 +1,23 @@
1
+ function InternalNav() {
2
+ const internalNav = document.querySelector('.c-internal-nav.u-sticky');
3
+
4
+ if (!internalNav) {
5
+ return;
6
+ }
7
+
8
+ const observerOptions = {
9
+ root: null,
10
+ rootMargin: '0px',
11
+ threshold: 1.0
12
+ };
13
+
14
+ const intersectionCallback = (entries, observer) => {
15
+ const isIntersecting = entries[0].isIntersecting;
16
+ internalNav.classList.toggle('u-bg-white', !isIntersecting);
17
+ };
18
+
19
+ const observer = new IntersectionObserver(intersectionCallback, observerOptions);
20
+ observer.observe(internalNav);
21
+ }
22
+
23
+ export default InternalNav;
@@ -4,6 +4,7 @@
4
4
  @import '~comp/button/button.scss';
5
5
  @import '~comp/campaign/campaign.scss';
6
6
  @import '~comp/card/card.scss';
7
+ @import '~comp/card/event-series-card.scss';
7
8
  @import '~comp/card/industry-card.scss';
8
9
  @import '~comp/card/product-comparison-card.scss';
9
10
  @import '~comp/comparison-table/comparison-table.scss';