mp-design-system 1.2.3 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-design-system",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "npm-run-all --parallel bundle:*",
package/src/_headers CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' polyfill.io; style-src 'self' 'unsafe-inline' fonts.googleapis.com; img-src 'self' data: p3.aprimocdn.net; font-src 'self' fonts.gstatic.com; frame-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests; block-all-mixed-content; sandbox allow-forms allow-same-origin allow-scripts;
2
+ Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' polyfill.io; style-src 'self' 'unsafe-inline' fonts.googleapis.com; img-src 'self' data: p3.aprimocdn.net img.youtube.com; font-src 'self' fonts.gstatic.com; frame-src 'self' brand.malvernpanalytical.com www.youtube.com; frame-ancestors 'self' brand.malvernpanalytical.com; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests; block-all-mixed-content; sandbox allow-forms allow-same-origin allow-scripts;
3
3
  X-Content-Type-Options: nosniff
4
4
  X-Frame-Options: SAMEORIGIN
5
5
  X-XSS-Protection: 1; mode=block
@@ -3,6 +3,7 @@ module.exports = {
3
3
  component: {
4
4
  name: 'accordion'
5
5
  },
6
+ figma: 'https://www.figma.com/file/szD8e7jNeWIfKpt6y41isi/Franklin-design-system?type=design&node-id=6879%3A3616&mode=design&t=vh7UGUcY3zjfbgUR-1',
6
7
  docs: true,
7
8
  context: {
8
9
  items: [
@@ -1,3 +1,5 @@
1
+ - To make an item display in its opened state when the page loads, add the class `c-accordion--item__open`
2
+ - The classnames `o-prose` and `u-flow--prose` on the content are optional
1
3
  ## Blank HTML template
2
4
  ```html
3
5
  <dl class="c-accordion">
@@ -10,6 +12,4 @@
10
12
  <dd class="c-accordion__content o-prose u-flow--prose">Content two</dd>
11
13
  </div>
12
14
  </dl>
13
- ```
14
- - To make an item display in its opened state when the page loads, add the class `c-accordion--item__open`
15
- - The classnames `o-prose` and `u-flow--prose` on the content are optional
15
+ ```
@@ -5,6 +5,7 @@ module.exports = {
5
5
  category: categories.card,
6
6
  component: {
7
7
  name: 'industry-card',
8
+ folder: 'card'
8
9
  },
9
10
  preview: 'cards-three',
10
11
  context: {
@@ -3,3 +3,11 @@
3
3
  {% macro card(params) %}
4
4
  {{ c({ name: 'card' }, params) }}
5
5
  {% endmacro %}
6
+
7
+ {% macro industryCard(params) %}
8
+ {{ c({ name: 'industry-card', folder: 'card' }, params) }}
9
+ {% endmacro %}
10
+
11
+ {% macro productComparisonCard(params) %}
12
+ {{ c({ name: 'product-comparison-card', folder: 'card' }, params) }}
13
+ {% endmacro %}
@@ -0,0 +1,90 @@
1
+ const categories = require('../component/categories');
2
+
3
+ module.exports = {
4
+ title: 'Product comparison card',
5
+ category: categories.card,
6
+ component: {
7
+ name: 'product-comparison-card',
8
+ folder: 'card'
9
+ },
10
+ preview: 'cards-three',
11
+ context: {
12
+ title: 'Zetasizer Pro',
13
+ description: 'The Zetasizer Pro is your go-to instrument to measure a wide range of sample types and concentrations.',
14
+ image: {
15
+ src: '/static/img/range-product-1.jpg',
16
+ alt: ''
17
+ },
18
+ features: [
19
+ {
20
+ icon: 'cross',
21
+ label: 'Classic 90° DLS'
22
+ },
23
+ {
24
+ icon: 'tick',
25
+ label: 'Dynamic light scattering'
26
+ },
27
+ {
28
+ icon: 'tick',
29
+ label: 'Static light scattering'
30
+ },
31
+ {
32
+ icon: 'tick',
33
+ label: 'Non-Invasive Back Scatter DLS'
34
+ },
35
+ {
36
+ icon: 'cross',
37
+ label: 'Multi-Angle Dynamic Light Scattering'
38
+ }
39
+ ],
40
+ footer: {
41
+ buttons: [
42
+ {
43
+ link: '#',
44
+ label: 'More details'
45
+ },
46
+ {
47
+ link: '#',
48
+ label: 'Request a quote'
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ variants: [
54
+ {
55
+ title: 'Without features list',
56
+ preview: 'cards-three',
57
+ context: {
58
+ title: 'Zetasizer Pro',
59
+ description: 'The Zetasizer Pro is your go-to instrument to measure a wide range of sample types and concentrations.',
60
+ image: {
61
+ src: '/static/img/range-product-1.jpg',
62
+ alt: ''
63
+ },
64
+ features: [
65
+ ],
66
+ footer: {
67
+ buttons: [
68
+ {
69
+ link: '#',
70
+ label: 'More details'
71
+ },
72
+ {
73
+ link: '#',
74
+ label: 'Request a quote'
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ }
80
+ ],
81
+ props: [
82
+ {
83
+ table: [
84
+ ['title', 'string'],
85
+ ['link', 'string'],
86
+ ['image', 'object', 'Image object']
87
+ ]
88
+ }
89
+ ]
90
+ }
@@ -0,0 +1,37 @@
1
+ {%- from "components/button/macro.njk" import button -%}
2
+ {%- from "components/twi/macro.njk" import twi -%}
3
+
4
+ <article class="mp c-product-comparison-card" role="article" aria-label="Product card">
5
+ <div class="c-product-comparison-card__body">
6
+ <h3 class="c-product-comparison-card__heading">{{ params.title }}</h3>
7
+ <p>{{ params.description }}</p>
8
+ {% if params.features | length %}
9
+ <p class="c-product-comparison-card__features-list-heading">Features include</p>
10
+ <ul class="c-product-comparison-card__features-list">
11
+ {% for feature in params.features %}
12
+ <li class="c-product-comparison-card__feature--{{ feature.icon }}">
13
+ {{ twi({
14
+ label: feature.label,
15
+ icon: feature.icon
16
+ }) }}
17
+ </li>
18
+ {% endfor %}
19
+ </ul>
20
+ {% endif %}
21
+ <footer class="c-product-comparison-card__footer">
22
+ {% if params.footer.buttons | length %}
23
+ {% for item in params.footer.buttons %}
24
+ {{ button({
25
+ link: item.link,
26
+ label: item.label,
27
+ colour: 'outline-green' if loop.index0 == 0 else 'green'
28
+ }) }}
29
+ {% endfor %}
30
+ {% endif %}
31
+ </footer>
32
+ </div>
33
+ <figure class="c-product-comparison-card__image">
34
+ <img src="{{ params.image.src }}" alt="{{ params.image.alt or params.title }}" />
35
+ </figure>
36
+ </article>
37
+
@@ -0,0 +1,74 @@
1
+ .c-product-comparison-card {
2
+ @extend .u-flow--2xs;
3
+ display: flex;
4
+ flex-flow: column;
5
+ border: 1px solid color('petrol', 'step-2');
6
+
7
+ & > * + * {
8
+ @include margin-top('2xs');
9
+ }
10
+
11
+ &__body {
12
+ @include padding('s-m');
13
+ display: flex;
14
+ flex-flow: column;
15
+ flex-grow: 1;
16
+
17
+ & > * + * {
18
+ @include margin-top('xs');
19
+ }
20
+ }
21
+
22
+ &__heading {
23
+ @extend .c-h;
24
+ @extend .c-h--step-1;
25
+ }
26
+
27
+ &__features-list {
28
+ @include margin-top('2xs');
29
+ list-style: none;
30
+
31
+ &-heading {
32
+ @include margin-top('s');
33
+ font-weight: weight("bold");
34
+ }
35
+
36
+ & > * + * {
37
+ @include margin-top('3xs');
38
+ }
39
+ }
40
+
41
+ &__feature {
42
+
43
+ &--tick {
44
+ svg {
45
+ color: color('green');
46
+ }
47
+ }
48
+
49
+ &--cross {
50
+ color: color('grey', 'step-2');
51
+ }
52
+ }
53
+
54
+ &__footer {
55
+ @include margin-top('auto');
56
+ @include padding-top('s');
57
+
58
+ & > * + * {
59
+ @include margin-top('2xs');
60
+ }
61
+ }
62
+
63
+ &__image {
64
+ height: 10em;
65
+ order: -1;
66
+ aspect-ratio: 16/9;
67
+
68
+ img {
69
+ height: 100%;
70
+ width: 100%;
71
+ object-fit: contain;
72
+ }
73
+ }
74
+ }
@@ -1,29 +1,25 @@
1
1
  {% from "components/component/component.njk" import c %}
2
2
 
3
- {% macro combobox(params, type = 'combobox') %}
4
- {{ c({ name: 'combobox', folder: 'input' }, params) }}
3
+ {% macro input(params) %}
4
+ {{ c({ name: 'input' }, params) }}
5
5
  {% endmacro %}
6
6
 
7
- {% macro checkbox(params, type = 'checkbox') %}
8
- {{ c({ name: 'checkbox', folder: 'input' }, params) }}
7
+ {% macro select(params) %}
8
+ {{ c({ name: 'select', folder: 'input' }, params) }}
9
9
  {% endmacro %}
10
10
 
11
- {% macro input(params) %}
12
- {{ c({ name: 'input' }, params) }}
11
+ {% macro textarea(params) %}
12
+ {{ c({ name: 'textarea', folder: 'input' }, params) }}
13
13
  {% endmacro %}
14
14
 
15
- {% macro radio(params) %}
16
- {{ c({ name: 'radio', folder: 'input' }, params) }}
15
+ {% macro checkbox(params, type = 'checkbox') %}
16
+ {{ c({ name: 'checkbox', folder: 'input' }, params) }}
17
17
  {% endmacro %}
18
18
 
19
- {% macro select(params) %}
20
- {{ c({ name: 'select', folder: 'input' }, params) }}
19
+ {% macro radio(params) %}
20
+ {{ c({ name: 'radio', folder: 'input' }, params) }}
21
21
  {% endmacro %}
22
22
 
23
23
  {% macro toggle(params, type='toggle') %}
24
24
  {{ c({ name: 'toggle', folder: 'input' }, params) }}
25
25
  {% endmacro %}
26
-
27
- {% macro textarea(params) %}
28
- {{ c({ name: 'textarea', folder: 'input' }, params) }}
29
- {% endmacro %}
@@ -8,7 +8,7 @@
8
8
 
9
9
  &:hover,
10
10
  &:focus {
11
- text-decoration: underline;
11
+ text-decoration: inherit;
12
12
  }
13
13
 
14
14
  svg {
@@ -19,7 +19,7 @@ index: true
19
19
  classes: 'c-library__hero'
20
20
  }) }}
21
21
 
22
- <div class="u-wrap u-flow--l">
22
+ <div class="u-wrap u-flow--l u-pad-right-xl">
23
23
  {{ content | safe }}
24
24
  </div>
25
25
  </div>
@@ -1,7 +1,6 @@
1
1
  import Accordion from './imports/accordion';
2
2
  import Carousel from './imports/carousel';
3
3
  import ClearForm from './imports/clear-form';
4
- import Combobox from './imports/combobox';
5
4
  import Comparison from './imports/comparison';
6
5
  import Gallery from './imports/gallery';
7
6
  import HeroPattern from './imports/hero-pattern';
@@ -23,7 +22,6 @@ import Tabs from './imports/tabs';
23
22
  Accordion();
24
23
  Carousel();
25
24
  ClearForm();
26
- Combobox();
27
25
  Comparison();
28
26
  Gallery();
29
27
  HeroPattern();
@@ -38,6 +38,17 @@ function Gallery() {
38
38
  if(slideImg.srcset != '') {
39
39
  slideImg.removeAttribute('srcset');
40
40
  }
41
+ var slideImgSrc = slideImg.getAttribute('src');
42
+ if (slideImgSrc) {
43
+ if (slideImgSrc.indexOf('?') !== -1) {
44
+ slideImg.setAttribute('src', slideImgSrc.split("?")[0] + '?quality=90&width=2176');
45
+ } else {
46
+ slideImg.setAttribute('src', slideImgSrc + '?quality=90&width=2176');
47
+ }
48
+ } else {
49
+ console.log(slideImg);
50
+ console.log('has no src defined...');
51
+ }
41
52
  }
42
53
  slide.classList.add('c-lightbox__slide');
43
54
  slide.classList.remove('c-gallery__slide');
@@ -4,6 +4,8 @@
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/industry-card.scss';
8
+ @import '~comp/card/product-comparison-card.scss';
7
9
  @import '~comp/comparison-table/comparison-table.scss';
8
10
  @import '~comp/embed/embed.scss';
9
11
  @import '~comp/featured-article-card/featured-article-card.scss';
@@ -14,7 +16,6 @@
14
16
  @import '~comp/header/header.scss';
15
17
  @import '~comp/hero/hero.scss';
16
18
  @import '~comp/icon/icon.scss';
17
- @import '~comp/industry-card/industry-card.scss';
18
19
  @import '~comp/input/input.scss';
19
20
  @import '~comp/input/radio.scss';
20
21
  @import '~comp/input/toggle.scss';
@@ -10,7 +10,7 @@ tags: brand
10
10
  {% from "components/twi/macro.njk" import twi %}
11
11
 
12
12
  {% set content %}
13
- ## UI design kit
13
+ ## Figma
14
14
 
15
15
  Franklin is available as a UI design kit in Figma. It contains text and color styles, grids and spacing, icons, and a complete library of components.
16
16
 
package/src/index.njk CHANGED
@@ -11,7 +11,7 @@ renderData:
11
11
  {% from "components/card/macro.njk" import card %}
12
12
  {% from "components/usp/macro.njk" import usp %}
13
13
 
14
- <div class="o-grid o-grid--of-four u-pad-right-xl">
14
+ <div class="o-grid o-grid--of-four">
15
15
  {{ card({
16
16
  theme: {
17
17
  layout: 'single',
@@ -94,6 +94,7 @@ renderData:
94
94
  </div>
95
95
 
96
96
  {% set content %}
97
+
97
98
  ## What is Franklin?
98
99
 
99
100
  Franklin is Malvern Panalytical's **design system** for web-based marketing materials.
@@ -103,6 +104,28 @@ Franklin is Malvern Panalytical's **design system** for web-based marketing mate
103
104
  A set of brand guidelines and a library of HTML/CSS/JS components. Using this system is the quickest and easiest way to ensure your website or web-app is on brand.
104
105
 
105
106
  The [Design Systems Handbook](https://www.designbetter.co/design-systems-handbook) by InVision is a great (free) way to learn more about design systems.
107
+
108
+ ## Are there other design systems in use?
109
+
110
+ There are two other design systems in use at Malvern Panalytical.
111
+
112
+ - [Sencillo](https://confluence.systems.mp/pages/viewpage.action?spaceKey=FA&title=MP+Sencillo+-+Design+System) (pronounced *sehn-see-yoh*) is a design system used in Smart Manager, Agrilytics, and other web-based customer-facing software applications.
113
+ - [Malvern Panalytical User Interface Guidelines](https://malvern.sharepoint.com/sites/o365-sw-ebl/SitePages/User%20Interface%20Guidelines/Malvern-Panalytical-User-Interface-Guidelines.aspx) (also known as the XBL) is the Design System that is used in our desktop software, including the new OmniTrust. At the time of writing, it hasn't been rolled out to all platforms but it should be the go to Design System for any new software that we create for our products. It is also backed up with a reusable framework that provides the styles and controls within a fixed layout base application.
114
+
115
+ ## Where does Franklin come in?
116
+
117
+ <div class="ds-table c-table c-table--responsive">
118
+
119
+ | Design system | [MP User Interface Guidelines (XBL)](https://malvern.sharepoint.com/sites/o365-sw-ebl/SitePages/User%20Interface%20Guidelines/Malvern-Panalytical-User-Interface-Guidelines.aspx) | [MP Sencillo](https://confluence.systems.mp/pages/viewpage.action?spaceKey=FA&title=MP+Sencillo+-+Design+System) | Franklin |
120
+ |---------------|------------------------------------|-------------|----------|
121
+ | Target | Desktop and tablet based software for our products | Web-based apps that are part of the Smart Manager platform | Commercial websites |
122
+ | Goal | A common look and feel with a consistent user experience across all of our product software | Bridge the gap between our desktop software and our web sites, providing a familiar and branded experience | A common look and feel with a consistent user experience across all of our web sites |
123
+ | Framework technologies | .NET C# and WPF/Xaml | .NET Blazor (C#), CSS and HTML | CSS, HTML and JavaScript |
124
+ | Devices | Desktops and tablets | Desktops, tablets and mobiles | Desktops, tablets and mobiles |
125
+ | Target Content Type | Fast changing, short textual elements, data visualisations and high user interactivity | Frequently changing, short textual elements, data visualisations and medium user interactivity | Infrequently changing, blocks of copy, marketing/product photos and low user interactivity |
126
+
127
+ </div>
128
+
106
129
  {% endset %}
107
130
 
108
131
  {% set latest %}
@@ -115,12 +138,37 @@ The [Design Systems Handbook](https://www.designbetter.co/design-systems-handboo
115
138
  - Misc. fixes
116
139
  {% endset %}
117
140
 
141
+ <div class="o-grid o-grid--layout o-grid--8/4">
142
+
118
143
  {{ markdown({
119
144
  content: content
120
145
  }) }}
121
146
 
122
- <div class="c-slat c-slat--crystal u-bg-blue-step-3 u-pad-x-l">
147
+ <div><div class="c-slat c-slat--crystal u-bg-blue-step-3 u-pad-x-l">
123
148
  {{ markdown({
124
149
  content: latest
125
150
  }) }}
126
- </div>
151
+ </div></div>
152
+
153
+ </div>
154
+
155
+ <style>
156
+ .ds-table {
157
+ border-left: 1px solid #ebf1f2;
158
+ }
159
+ .ds-table table th:nth-child(1),
160
+ .ds-table table td:nth-child(1) {
161
+ background-color: #fff;
162
+ border-color: #ebf1f2;
163
+ color: #333;
164
+ }
165
+ .ds-table table th:nth-child(2) {
166
+ background-color: #00a2c2;
167
+ }
168
+ .ds-table table th:nth-child(3) {
169
+ background-color: #005461;
170
+ }
171
+ .ds-table table th:nth-child(4) {
172
+ background-color: #003039;
173
+ }
174
+ </style>
@@ -7,7 +7,7 @@ tags: prototype
7
7
  {% from "components/prose/macro.njk" import prose %}
8
8
  {% from "components/signpost/macro.njk" import signpost %}
9
9
  {% from "components/button/macro.njk" import button %}
10
- {% from "components/industry-card/macro.njk" import industryCard %}
10
+ {% from "components/card/macro.njk" import industryCard %}
11
11
  {% from "components/campaign/macro.njk" import campaign %}
12
12
  {% from "components/card/macro.njk" import card %}
13
13
  {% from "components/option-list/macro.njk" import optionList %}
@@ -15,7 +15,7 @@ tagTitle: Industry
15
15
  {% from "components/card/macro.njk" import card %}
16
16
  {% from "components/hero/macro.njk" import hero %}
17
17
  {% from "components/prose/macro.njk" import prose, markdown %}
18
- {% from "components/industry-card/macro.njk" import industryCard %}
18
+ {% from "components/card/macro.njk" import industryCard %}
19
19
  {% from "components/accordion/macro.njk" import accordion %}
20
20
 
21
21
  {% set siteNav %}{% include "navigation/corporate.njk" %}{% endset %}
@@ -1,5 +0,0 @@
1
- {% from "components/component/component.njk" import c %}
2
-
3
- {% macro industryCard(params) %}
4
- {{ c({ name: 'industry-card' }, params) }}
5
- {% endmacro %}