mp-design-system 0.9.29 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) 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/_includes/components/button/button.config.js +6 -0
  9. package/src/_includes/components/button/button.scss +7 -0
  10. package/src/_includes/components/card/card.config.js +143 -1
  11. package/src/_includes/components/card/card.scss +13 -0
  12. package/src/_includes/components/input/checkbox.config.js +6 -0
  13. package/src/_includes/components/input/checkbox.njk +2 -2
  14. package/src/_includes/components/input/input.config.js +6 -0
  15. package/src/_includes/components/input/input.njk +1 -1
  16. package/src/_includes/components/input/input.scss +11 -0
  17. package/src/_includes/components/input/radio.config.js +6 -0
  18. package/src/_includes/components/input/radio.njk +2 -2
  19. package/src/_includes/components/input/radio.scss +13 -0
  20. package/src/_includes/components/input/select.config.js +6 -0
  21. package/src/_includes/components/input/select.njk +1 -1
  22. package/src/_includes/components/input/textarea.config.js +6 -0
  23. package/src/_includes/components/input/textarea.njk +1 -1
  24. package/src/_includes/components/input/toggle.config.js +6 -0
  25. package/src/_includes/components/input/toggle.njk +2 -2
  26. package/src/_includes/components/input/toggle.scss +16 -0
  27. package/src/_includes/components/tabs/tabs.config.js +5 -5
  28. package/src/_includes/components/tabs/tabs.njk +1 -1
  29. package/src/_includes/components/tabs/tabs.scss +4 -0
  30. package/src/_includes/components/twi/twi.njk +1 -1
  31. package/src/_includes/includes/system-scripts.njk +1 -1
  32. package/src/_includes/layout.njk +1 -0
  33. package/src/_includes/system-home-page.njk +1 -0
  34. package/src/assets/js/app.js +2 -0
  35. package/src/assets/js/imports/off-canvas.js +97 -0
  36. package/src/assets/scss/elements/reset.scss +0 -7
  37. package/src/assets/scss/objects/index.scss +1 -0
  38. package/src/assets/scss/objects/off-canvas.scss +85 -0
  39. package/src/assets/scss/utilities/link.scss +1 -0
  40. package/src/components/iconography.njk +3 -0
  41. package/src/index.njk +14 -7
  42. package/src/patterns/form.njk +324 -151
  43. package/src/patterns/off-canvas.njk +42 -0
  44. package/src/prototype/index.njk +2 -2
  45. package/src/static/svg/sprite.svg +41 -20
@@ -0,0 +1,85 @@
1
+ .o-off-canvas {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ background-color: transparent;
8
+ opacity: 0;
9
+ visibility: hidden;
10
+ transition: opacity 0.3s ease, visibility 0s linear 0.3s;
11
+ z-index: 9999;
12
+
13
+ &__backdrop {
14
+ position: fixed;
15
+ top: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ background-color: rgba(color("grey"), 0.5);
20
+ opacity: 0;
21
+ visibility: hidden;
22
+ transition: opacity 0.3s ease;
23
+ backdrop-filter: blur(5px);
24
+ }
25
+
26
+ &__content {
27
+ position: fixed;
28
+ top: 0;
29
+ right: -100%;
30
+ width: calc(100% - var(--space-m));
31
+ height: 100%;
32
+ background-color: color("white");
33
+ transition: right 0.3s ease;
34
+ display: flex;
35
+ flex-direction: column;
36
+ }
37
+
38
+ &__header {
39
+ @extend .c-h--step-3;
40
+ @include padding('s', 's', 0);
41
+
42
+ & > * {
43
+ margin-bottom: 0 !important;
44
+ }
45
+ }
46
+
47
+ &__header + &__main {
48
+ @include margin-top('m');
49
+ }
50
+
51
+ &__main {
52
+ @include margin-bottom('m');
53
+ @include padding(0, 's');
54
+ overflow-y: scroll;
55
+ }
56
+
57
+ &__footer {
58
+ @include margin-top('auto');
59
+ @include padding(0, 's', 's');
60
+ display: flex;
61
+ flex-direction: column;
62
+ align-items: stretch;
63
+ }
64
+
65
+ &__close {
66
+ @extend .u-link;
67
+ @include margin(0, 'auto');
68
+ @include padding('s');
69
+ }
70
+
71
+ &--open {
72
+ opacity: 1;
73
+ visibility: visible;
74
+ transition: opacity 0.3s ease;
75
+
76
+ .o-off-canvas__backdrop {
77
+ opacity: 1;
78
+ visibility: visible;
79
+ }
80
+
81
+ .o-off-canvas__content {
82
+ right: 0;
83
+ }
84
+ }
85
+ }
@@ -2,6 +2,7 @@
2
2
  .mp .u-link,
3
3
  .u-link {
4
4
  color: color('utility-blue');
5
+ cursor: pointer;
5
6
 
6
7
  &:hover {
7
8
  text-decoration: underline;
@@ -21,6 +21,7 @@ Icons add visual noise to designs and should be used sparingly.
21
21
  'arrow-left',
22
22
  'arrow-right',
23
23
  'chevron-down',
24
+ 'chevron-up',
24
25
  'cross',
25
26
  'dash',
26
27
  'facebook',
@@ -28,12 +29,14 @@ Icons add visual noise to designs and should be used sparingly.
28
29
  'info',
29
30
  'instagram',
30
31
  'linkedin',
32
+ 'lock',
31
33
  'log-out',
32
34
  'play',
33
35
  'rss',
34
36
  'search',
35
37
  'tick',
36
38
  'twitter',
39
+ 'warning',
37
40
  'youtube'
38
41
  ] %}
39
42
 
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">
14
+ <div class="o-grid o-grid--of-four u-pad-right-xl">
15
15
  {{ card({
16
16
  theme: {
17
17
  layout: 'single',
@@ -99,18 +99,25 @@ renderData:
99
99
  A combination of brand guidelines and a library of HTML/CSS/JS components.
100
100
 
101
101
  As Malvern Panalytical has grown, our online experiences have become disparate and inconsistent. The goal of this design system is to address this by creating a single source of truth. It will rely on us all using and contributing to it, with the ongoing support of the Design System Team.
102
+ {% endset %}
102
103
 
104
+ {% set latest %}
103
105
  ## Latest updates
104
- ##### V.{{ config.dsVersion }} - Jan 2022
106
+ ##### V.{{ config.dsVersion }} - May 2023
105
107
 
106
- - New Features Table component
107
- - New Gallery component
108
- - New illustration documentation
109
- - Fix IE11 navigation bug
108
+ - Add new toggle components
109
+ - Add new breadcrumb component
110
+ - Add button with loading indicator
111
+ - Update event card styles
110
112
  - Misc. fixes
111
- - Misc. documentation improvements
112
113
  {% endset %}
113
114
 
114
115
  {{ markdown({
115
116
  content: content
116
117
  }) }}
118
+
119
+ <div class="c-slat c-slat--crystal u-bg-blue-step-3 u-pad-x-l">
120
+ {{ markdown({
121
+ content: latest
122
+ }) }}
123
+ </div>
@@ -13,161 +13,334 @@ layout: patterns-page
13
13
 
14
14
  <div class="u-flow">
15
15
  <form>
16
- <fieldset class="c-fieldset">
17
- <div class="u-flow--m u-wrap--fields">
18
- {{ input({
19
- label: 'Text',
20
- name: 'text_input',
21
- id: 'text_input',
22
- type: 'text',
23
- placeholder: 'Placeholder'
24
- })}}
25
-
26
- {{ select({
27
- label: "Select",
28
- name: "select",
29
- id: "select",
30
- placeholder: "Placeholder",
31
- required: true,
32
- options: [
33
- [
34
- "option-1",
35
- "Option 1"
36
- ],
37
- [
38
- "Option 2"
39
- ],
40
- [
41
- "option-3",
42
- "Option 3"
43
- ]
16
+ <fieldset class="c-fieldset u-flow--m u-wrap--fields">
17
+ {{ input({
18
+ label: 'Text',
19
+ name: 'text_input',
20
+ id: 'text_input',
21
+ type: 'text',
22
+ placeholder: 'Placeholder'
23
+ })}}
24
+
25
+ {{ select({
26
+ label: "Select",
27
+ name: "select",
28
+ id: "select",
29
+ placeholder: "Placeholder",
30
+ options: [
31
+ [
32
+ "option-1",
33
+ "Option 1"
34
+ ],
35
+ [
36
+ "Option 2"
37
+ ],
38
+ [
39
+ "option-3",
40
+ "Option 3"
41
+ ]
42
+ ]
43
+ })}}
44
+
45
+ {{ textarea({
46
+ label: 'Textarea',
47
+ name: 'textarea',
48
+ id: 'textarea',
49
+ type: 'textarea',
50
+ placeholder: 'Placeholder'
51
+ })}}
52
+
53
+ <label class="c-label">Checkboxes</label>
54
+ {% for _ in ["Live","Laugh","Love"] %}
55
+ <div>
56
+ {{ checkbox({
57
+ label: _,
58
+ name: 'tenets',
59
+ id: _,
60
+ value: _
61
+ })}}
62
+ </div>
63
+ {% endfor %}
64
+
65
+ <label class="c-label">Radio buttons</label>
66
+ {% for _ in ["Bears","Beets","Battlestar Galactica"] %}
67
+ <div>
68
+ {{ radio({
69
+ label: _,
70
+ name: 'facts',
71
+ id: _,
72
+ value: _
73
+ })}}
74
+ </div>
75
+ {% endfor %}
76
+
77
+ <label class="c-label">Toggle</label>
78
+ {{ toggle({
79
+ label: 'Toggle',
80
+ name: 'toggle',
81
+ id: 'toggle',
82
+ type: 'toggle',
83
+ placeholder: 'Toggle?'
84
+ })}}
85
+ </fieldset>
86
+
87
+ <hr>
88
+
89
+ {# MISC FIELD TYPES EXAMPLES #}
90
+ <fieldset class="c-fieldset u-flow--m u-wrap--fields">
91
+ <legend id="variations"><code>&lt;input&gt;</code> variations</legend>
92
+
93
+ {{ input({
94
+ label: 'Email',
95
+ name: 'email_input',
96
+ id: 'email_input',
97
+ type: 'email',
98
+ placeholder: 'Placeholder'
99
+ })}}
100
+
101
+ {{ input({
102
+ label: 'Password',
103
+ name: 'password_input',
104
+ id: 'password_input',
105
+ type: 'password'
106
+ })}}
107
+
108
+ {{ input({
109
+ label: 'Date',
110
+ name: 'date_input',
111
+ id: 'date_input',
112
+ type: 'date',
113
+ placeholder: 'Placeholder'
114
+ })}}
115
+
116
+ {{ input({
117
+ label: 'Search',
118
+ name: 'search_input',
119
+ id: 'search_input',
120
+ type: 'search',
121
+ placeholder: 'Placeholder'
122
+ })}}
123
+
124
+ {{ input({
125
+ label: 'Telephone',
126
+ name: 'tel_input',
127
+ id: 'tel_input',
128
+ type: 'tel',
129
+ placeholder: 'Placeholder'
130
+ })}}
131
+
132
+ {{ input({
133
+ label: 'Number',
134
+ name: 'number_input',
135
+ id: 'number_input',
136
+ type: 'number',
137
+ placeholder: 'Placeholder'
138
+ })}}
139
+
140
+ {{ input({
141
+ label: 'File',
142
+ name: 'file_input',
143
+ id: 'file_input',
144
+ type: 'file',
145
+ classes: 'c-input--file'
146
+ })}}
147
+
148
+ {{ input({
149
+ label: 'Range',
150
+ name: 'range_input',
151
+ id: 'range_input',
152
+ type: 'range',
153
+ placeholder: 'Placeholder'
154
+ })}}
155
+
156
+ {{ input({
157
+ label: 'URL',
158
+ name: 'url_input',
159
+ id: 'url_input',
160
+ type: 'url',
161
+ placeholder: 'Placeholder'
162
+ })}}
163
+
164
+ {{ input({
165
+ label: 'Color',
166
+ name: 'color_input',
167
+ id: 'color_input',
168
+ type: 'color',
169
+ placeholder: 'Placeholder'
170
+ })}}
171
+ </fieldset>
172
+
173
+ <hr>
174
+
175
+ {# DISABLED EXAMPLES #}
176
+ <fieldset class="c-fieldset u-flow--m u-wrap--fields">
177
+ <legend id="disabled">Disabled</legend>
178
+ {{ input({
179
+ label: 'Text',
180
+ name: 'text_input',
181
+ id: 'text_input',
182
+ type: 'text',
183
+ placeholder: 'Placeholder',
184
+ disabled: true
185
+ })}}
186
+
187
+ {{ select({
188
+ label: "Select",
189
+ name: "select",
190
+ id: "select",
191
+ placeholder: "Placeholder",
192
+ disabled: true,
193
+ options: [
194
+ [
195
+ "option-1",
196
+ "Option 1"
197
+ ],
198
+ [
199
+ "Option 2"
200
+ ],
201
+ [
202
+ "option-3",
203
+ "Option 3"
44
204
  ]
45
- })}}
46
-
47
- {{ textarea({
48
- label: 'Textarea',
49
- name: 'textarea',
50
- id: 'textarea',
51
- type: 'textarea',
52
- placeholder: 'Placeholder'
53
- })}}
54
-
55
- <label class="c-label">Checkboxes</label>
56
- {% for _ in ["Live","Laugh","Love"] %}
57
- <div>
58
- {{ checkbox({
59
- label: _,
60
- name: 'tenets',
61
- id: _
62
- })}}
63
- </div>
64
- {% endfor %}
65
-
66
- <label class="c-label">Radio buttons</label>
67
- {% for _ in ["Bears","Beets","Battlestar Galactica"] %}
68
- <div>
69
- {{ radio({
70
- label: _,
71
- name: 'facts',
72
- id: _
73
- })}}
74
- </div>
75
- {% endfor %}
76
-
77
- <label class="c-label">Toggle</label>
78
- {{ toggle({
79
- label: 'Toggle',
80
- name: 'toggle',
81
- id: 'toggle',
82
- type: 'toggle',
83
- placeholder: 'Toggle?'
84
- })}}
85
-
86
- <br>
87
- <legend><code>&lt;input&gt;</code> variations</legend>
88
-
89
- {{ input({
90
- label: 'Email',
91
- name: 'email_input',
92
- id: 'email_input',
93
- type: 'email',
94
- placeholder: 'Placeholder'
95
- })}}
96
-
97
- {{ input({
98
- label: 'Password',
99
- name: 'password_input',
100
- id: 'password_input',
101
- type: 'password'
102
- })}}
103
-
104
- {{ input({
105
- label: 'Date',
106
- name: 'date_input',
107
- id: 'date_input',
108
- type: 'date',
109
- placeholder: 'Placeholder'
110
- })}}
111
-
112
- {{ input({
113
- label: 'Search',
114
- name: 'search_input',
115
- id: 'search_input',
116
- type: 'search',
117
- placeholder: 'Placeholder'
118
- })}}
119
-
120
- {{ input({
121
- label: 'Telephone',
122
- name: 'tel_input',
123
- id: 'tel_input',
124
- type: 'tel',
125
- placeholder: 'Placeholder'
126
- })}}
127
-
128
- {{ input({
129
- label: 'Number',
130
- name: 'number_input',
131
- id: 'number_input',
132
- type: 'number',
133
- placeholder: 'Placeholder'
134
- })}}
135
-
136
- {{ input({
137
- label: 'File',
138
- name: 'file_input',
139
- id: 'file_input',
140
- type: 'file',
141
- classes: 'c-input--file'
142
- })}}
143
-
144
- {{ input({
145
- label: 'Range',
146
- name: 'range_input',
147
- id: 'range_input',
148
- type: 'range',
149
- placeholder: 'Placeholder'
150
- })}}
151
-
152
- {{ input({
153
- label: 'URL',
154
- name: 'url_input',
155
- id: 'url_input',
156
- type: 'url',
157
- placeholder: 'Placeholder'
158
- })}}
159
-
160
- {{ input({
161
- label: 'Color',
162
- name: 'color_input',
163
- id: 'color_input',
164
- type: 'color',
165
- placeholder: 'Placeholder'
166
- })}}
167
- </div>
205
+ ]
206
+ })}}
207
+
208
+ {{ textarea({
209
+ label: 'Textarea',
210
+ name: 'textarea',
211
+ id: 'textarea',
212
+ type: 'textarea',
213
+ placeholder: 'Placeholder',
214
+ disabled: true
215
+ })}}
216
+
217
+ <label class="c-label">Checkboxes</label>
218
+ {% for _ in ["Live","Laugh","Love"] %}
219
+ <div>
220
+ {{ checkbox({
221
+ label: _,
222
+ name: 'tenets--disabled',
223
+ id: _+'--disabled',
224
+ disabled: true
225
+ })}}
226
+ </div>
227
+ {% endfor %}
228
+
229
+ <label class="c-label">Radio buttons</label>
230
+ {% for _ in ["Bears","Beets","Battlestar Galactica"] %}
231
+ <div>
232
+ {{ radio({
233
+ label: _,
234
+ name: 'facts--disabled',
235
+ id: _+'--disabled',
236
+ disabled: true
237
+ })}}
238
+ </div>
239
+ {% endfor %}
240
+
241
+ <label class="c-label">Toggle</label>
242
+ {{ toggle({
243
+ label: 'Toggle',
244
+ name: 'toggle--disabled',
245
+ id: 'toggle--disabled',
246
+ type: 'toggle',
247
+ placeholder: 'Toggle?',
248
+ disabled: true
249
+ })}}
250
+
251
+ {{ input({
252
+ label: 'Email',
253
+ name: 'email_input',
254
+ id: 'email_input',
255
+ type: 'email',
256
+ placeholder: 'Placeholder',
257
+ disabled: true
258
+ })}}
259
+
260
+ {{ input({
261
+ label: 'Password',
262
+ name: 'password_input',
263
+ id: 'password_input',
264
+ type: 'password',
265
+ disabled: true
266
+ })}}
267
+
268
+ {{ input({
269
+ label: 'Date',
270
+ name: 'date_input',
271
+ id: 'date_input',
272
+ type: 'date',
273
+ placeholder: 'Placeholder',
274
+ disabled: true
275
+ })}}
276
+
277
+ {{ input({
278
+ label: 'Search',
279
+ name: 'search_input',
280
+ id: 'search_input',
281
+ type: 'search',
282
+ placeholder: 'Placeholder',
283
+ disabled: true
284
+ })}}
285
+
286
+ {{ input({
287
+ label: 'Telephone',
288
+ name: 'tel_input',
289
+ id: 'tel_input',
290
+ type: 'tel',
291
+ placeholder: 'Placeholder',
292
+ disabled: true
293
+ })}}
294
+
295
+ {{ input({
296
+ label: 'Number',
297
+ name: 'number_input',
298
+ id: 'number_input',
299
+ type: 'number',
300
+ placeholder: 'Placeholder',
301
+ disabled: true
302
+ })}}
303
+
304
+ {{ input({
305
+ label: 'File',
306
+ name: 'file_input',
307
+ id: 'file_input',
308
+ type: 'file',
309
+ classes: 'c-input--file',
310
+ disabled: true
311
+ })}}
312
+
313
+ {{ input({
314
+ label: 'Range',
315
+ name: 'range_input',
316
+ id: 'range_input',
317
+ type: 'range',
318
+ placeholder: 'Placeholder',
319
+ disabled: true
320
+ })}}
321
+
322
+ {{ input({
323
+ label: 'URL',
324
+ name: 'url_input',
325
+ id: 'url_input',
326
+ type: 'url',
327
+ placeholder: 'Placeholder',
328
+ disabled: true
329
+ })}}
330
+
331
+ {{ input({
332
+ label: 'Color',
333
+ name: 'color_input',
334
+ id: 'color_input',
335
+ type: 'color',
336
+ placeholder: 'Placeholder',
337
+ disabled: true
338
+ })}}
168
339
  </fieldset>
169
340
  </form>
170
341
 
342
+ <hr>
343
+
171
344
  {{ alert({
172
345
  type: 'info',
173
346
  content: '<h3>To do:</h3>