mp-design-system 0.9.26 → 0.9.28
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/build/scss/library.css +1 -1
- package/dist/build/scss/library.css.map +1 -1
- package/dist/build/scss/main.css +1 -1
- package/dist/build/scss/main.css.map +1 -1
- package/package.json +1 -1
- package/src/_includes/components/card/card.config.js +41 -5
- package/src/_includes/components/card/card.njk +9 -4
- package/src/_includes/components/card/card.scss +54 -12
- package/src/_includes/components/component/preview-default.njk +1 -1
- package/src/_includes/components/component/preview-form.njk +1 -1
- package/src/_includes/components/input/macro.njk +4 -0
- package/src/_includes/components/input/toggle.config.js +35 -0
- package/src/_includes/components/input/toggle.njk +5 -0
- package/src/_includes/components/input/toggle.scss +59 -0
- package/src/assets/scss/components/index.scss +1 -0
- package/src/assets/scss/library.scss +6 -2
- package/src/assets/scss/objects/grid.scss +2 -2
- package/src/assets/scss/utilities/space.scss +3 -0
- package/src/components-pages.njk +3 -1
- package/src/patterns/form.njk +10 -0
package/package.json
CHANGED
@@ -81,7 +81,8 @@ module.exports = {
|
|
81
81
|
footer: {
|
82
82
|
cta: {
|
83
83
|
link: '#',
|
84
|
-
label: 'Read more'
|
84
|
+
label: 'Read more',
|
85
|
+
icon: 'arrow-right',
|
85
86
|
}
|
86
87
|
}
|
87
88
|
}
|
@@ -159,7 +160,8 @@ module.exports = {
|
|
159
160
|
footer: {
|
160
161
|
cta: {
|
161
162
|
link: '#',
|
162
|
-
label: 'View full details'
|
163
|
+
label: 'View full details',
|
164
|
+
icon: 'arrow-right',
|
163
165
|
},
|
164
166
|
},
|
165
167
|
shop: {
|
@@ -200,7 +202,8 @@ module.exports = {
|
|
200
202
|
footer: {
|
201
203
|
cta: {
|
202
204
|
link: '#',
|
203
|
-
label: 'Read the whitepaper'
|
205
|
+
label: 'Read the whitepaper',
|
206
|
+
icon: 'arrow-right',
|
204
207
|
},
|
205
208
|
},
|
206
209
|
tag: 'Whitepaper'
|
@@ -254,7 +257,7 @@ module.exports = {
|
|
254
257
|
date: {
|
255
258
|
date: new Date(),
|
256
259
|
time: '11:00 – 12:00',
|
257
|
-
timezone: 'EST'
|
260
|
+
timezone: 'EST',
|
258
261
|
},
|
259
262
|
meta: [
|
260
263
|
'English'
|
@@ -676,7 +679,8 @@ module.exports = {
|
|
676
679
|
footer: {
|
677
680
|
cta: {
|
678
681
|
link: '#',
|
679
|
-
label: 'Read the whitepaper'
|
682
|
+
label: 'Read the whitepaper',
|
683
|
+
icon: 'arrow-right',
|
680
684
|
}
|
681
685
|
},
|
682
686
|
tag: 'Whitepaper',
|
@@ -774,6 +778,38 @@ module.exports = {
|
|
774
778
|
link: '#'
|
775
779
|
}
|
776
780
|
},
|
781
|
+
{
|
782
|
+
title: 'Event series card',
|
783
|
+
preview: 'content-width',
|
784
|
+
context: {
|
785
|
+
theme: {
|
786
|
+
border: false,
|
787
|
+
layout: 'single',
|
788
|
+
name: 'event-series',
|
789
|
+
inlineSpecs: false,
|
790
|
+
corner: false,
|
791
|
+
},
|
792
|
+
image: {
|
793
|
+
src: '/static/img/blog-page-image-1.jpg',
|
794
|
+
alt: 'Product image alt'
|
795
|
+
},
|
796
|
+
header: {
|
797
|
+
title: 'Part 1 - The theory of X-Ray Fluorescence (XRF)',
|
798
|
+
date: {
|
799
|
+
date: (new Date()).toLocaleString('default', { month: 'short', year: 'numeric' }),
|
800
|
+
formatted: true,
|
801
|
+
},
|
802
|
+
},
|
803
|
+
footer: {
|
804
|
+
cta: {
|
805
|
+
link: '#',
|
806
|
+
label: 'Watch now',
|
807
|
+
icon: 'play',
|
808
|
+
}
|
809
|
+
},
|
810
|
+
link: '#'
|
811
|
+
}
|
812
|
+
},
|
777
813
|
],
|
778
814
|
|
779
815
|
props: [
|
@@ -14,6 +14,7 @@
|
|
14
14
|
{% set hasImage = params.image.src %}
|
15
15
|
{% set isInPast = header.date.duration %}
|
16
16
|
{% set hasDate = header.date.date %}
|
17
|
+
{% set hasFormat = header.date.formatted %}
|
17
18
|
{% set hasTime = header.date.time %}
|
18
19
|
{% set hasTimezone = header.date.timezone %}
|
19
20
|
{% set hasMeta = header.meta | length %}
|
@@ -68,17 +69,21 @@
|
|
68
69
|
</a>
|
69
70
|
</figure>
|
70
71
|
{% endif %}
|
71
|
-
|
72
72
|
<div class="c-card__primary">
|
73
|
-
|
74
73
|
{% if header %}
|
75
74
|
<header class="c-card__header u-flow--2xs">
|
76
|
-
{% if hasDate and not isInPast %}
|
75
|
+
{% if hasDate and not isInPast and hasFormat == false %}
|
77
76
|
<time class="c-card__datetime">
|
78
77
|
<span class="c-card__day">{{ header.date.date.getDate() }} </span>
|
79
78
|
<span class="c-card__month">{{ header.date.date.getMonth() | months }}</span>
|
80
79
|
</time>
|
81
80
|
{% endif %}
|
81
|
+
|
82
|
+
{% if hasDate and hasFormat == true %}
|
83
|
+
<time class="c-card__datetime">
|
84
|
+
<span>{{ header.date.date }}</span>
|
85
|
+
</time>
|
86
|
+
{% endif %}
|
82
87
|
|
83
88
|
{% if not params.theme.metaLast and (hasTime or hasTimezone or isInPast or hasMeta) %}
|
84
89
|
{{ meta() }}
|
@@ -144,7 +149,7 @@
|
|
144
149
|
link: footer.cta.link,
|
145
150
|
label: footer.cta.label,
|
146
151
|
classes: 'u-link',
|
147
|
-
icon:
|
152
|
+
icon: footer.cta.icon
|
148
153
|
}) }}
|
149
154
|
</div>
|
150
155
|
{% endif %}
|
@@ -417,31 +417,73 @@
|
|
417
417
|
|
418
418
|
.c-card__image {
|
419
419
|
position: relative;
|
420
|
+
width: 100%;
|
420
421
|
|
421
422
|
img {
|
423
|
+
max-height: 200px;
|
422
424
|
height: 100%;
|
423
425
|
object-fit: cover;
|
424
426
|
aspect-ratio: 16 / 9;
|
425
427
|
}
|
426
428
|
}
|
429
|
+
}
|
430
|
+
|
431
|
+
@media (min-width: 55em) {
|
432
|
+
.c-card__primary {
|
433
|
+
width: calc(70% - 18px);
|
434
|
+
width: calc(70% - var(--space-s-m));
|
435
|
+
}
|
427
436
|
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
width: calc(60% - var(--space-s-m)) !important;
|
432
|
-
}
|
433
|
-
|
434
|
-
.c-card__image {
|
435
|
-
width: calc(40% - 18px) !important;
|
436
|
-
width: calc(40% - var(--space-s-m)) !important;
|
437
|
+
.c-card__image {
|
438
|
+
width: calc(30% - 18px);
|
439
|
+
width: calc(30% - var(--space-s-m));
|
437
440
|
|
438
|
-
|
439
|
-
|
440
|
-
}
|
441
|
+
img {
|
442
|
+
max-height: none !important;
|
441
443
|
}
|
442
444
|
}
|
443
445
|
}
|
444
446
|
}
|
447
|
+
|
448
|
+
&--event-series {
|
449
|
+
box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 20%);
|
450
|
+
|
451
|
+
.c-card__image img {
|
452
|
+
aspect-ratio: 2/1;
|
453
|
+
}
|
454
|
+
|
455
|
+
.c-card__header > * + * {
|
456
|
+
@include margin('s', 0, 0, 0);
|
457
|
+
}
|
458
|
+
|
459
|
+
.c-card__datetime {
|
460
|
+
font-size: var(--step--1);
|
461
|
+
font-weight: normal;
|
462
|
+
}
|
463
|
+
|
464
|
+
.c-card__title {
|
465
|
+
font-size: var(--step-0);
|
466
|
+
}
|
467
|
+
|
468
|
+
.c-card__footer .u-link,
|
469
|
+
.c-card__footer .u-link svg {
|
470
|
+
color: color('utility-blue', 'step-1');
|
471
|
+
font-size: var(--step--1);
|
472
|
+
}
|
473
|
+
}
|
474
|
+
}
|
475
|
+
|
476
|
+
.grid-view > .c-card--event.c-card--has-image .c-card__wrapper {
|
477
|
+
@include gap("s");
|
478
|
+
flex-direction: column;
|
479
|
+
|
480
|
+
.c-card__primary {
|
481
|
+
width: 100%;
|
482
|
+
}
|
483
|
+
|
484
|
+
.c-card__image {
|
485
|
+
width: 100%;
|
486
|
+
}
|
445
487
|
}
|
446
488
|
|
447
489
|
// IE11 fix
|
@@ -0,0 +1,35 @@
|
|
1
|
+
const categories = require('../component/categories');
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
title: 'Toggle',
|
5
|
+
category: categories.form,
|
6
|
+
component: {
|
7
|
+
name: 'toggle',
|
8
|
+
folder: 'input'
|
9
|
+
},
|
10
|
+
figma: 'https://www.figma.com/file/szD8e7jNeWIfKpt6y41isi/Franklin-design-system?node-id=213-918',
|
11
|
+
preview: 'form',
|
12
|
+
context: {
|
13
|
+
label: 'Label',
|
14
|
+
name: 'name',
|
15
|
+
id: 'id'
|
16
|
+
},
|
17
|
+
variants: [
|
18
|
+
{
|
19
|
+
title: 'Toggled on',
|
20
|
+
context: {
|
21
|
+
checked: true
|
22
|
+
}
|
23
|
+
}
|
24
|
+
],
|
25
|
+
props: [
|
26
|
+
{
|
27
|
+
table: [
|
28
|
+
['label', 'string'],
|
29
|
+
['id', 'string', 'ID attribute'],
|
30
|
+
['name', 'string', 'Name attribute (falls back to ID)'],
|
31
|
+
['checked', 'bool', 'Is this input checked?']
|
32
|
+
]
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<label for="{{ params.id }}" class="c-toggle">
|
2
|
+
<input type="checkbox" class="c-toggle__checkbox" id="{{ params.id }}" value="{{ params.value }}" role="switch" aria-checked="false" aria-label="{{ params.label }}" {{ 'checked' if params.checked }} {{ 'required' if params.required }} />
|
3
|
+
<span class="c-toggle__slider"></span>
|
4
|
+
{{ params.label }}
|
5
|
+
</label>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
.c-toggle {
|
2
|
+
position: relative;
|
3
|
+
@include step(-1);
|
4
|
+
display: inline-block;
|
5
|
+
white-space: nowrap;
|
6
|
+
|
7
|
+
&__checkbox {
|
8
|
+
@extend .u-hidden;
|
9
|
+
}
|
10
|
+
|
11
|
+
&__slider {
|
12
|
+
@include margin-right('2xs');
|
13
|
+
@include margin-left('2xs');
|
14
|
+
position: relative;
|
15
|
+
display: inline-block;
|
16
|
+
height: 1.25rem;
|
17
|
+
width: 2.25rem;
|
18
|
+
border: 1px solid color('petrol', 'step-2');
|
19
|
+
border-radius: 1.25rem;
|
20
|
+
vertical-align: text-bottom;
|
21
|
+
|
22
|
+
&::before {
|
23
|
+
position: absolute;
|
24
|
+
content: "";
|
25
|
+
background-color: color('white');
|
26
|
+
border: 1px solid color('petrol', 'step-2');
|
27
|
+
height: 0.75rem;
|
28
|
+
width: 0.75rem;
|
29
|
+
top: 0;
|
30
|
+
bottom: 0;
|
31
|
+
left: 0.25rem;
|
32
|
+
margin: auto 0;
|
33
|
+
border-radius: 50%;
|
34
|
+
transition: .1s;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
&:hover &__slider,
|
39
|
+
&:focus-within &__slider {
|
40
|
+
background-color: color('petrol', 'step-3');
|
41
|
+
}
|
42
|
+
|
43
|
+
&:focus-within &__slider {
|
44
|
+
outline: 2px solid;
|
45
|
+
}
|
46
|
+
|
47
|
+
&__checkbox:checked + &__slider {
|
48
|
+
background-color: color('utility-blue');
|
49
|
+
}
|
50
|
+
|
51
|
+
&:hover &__checkbox:checked + &__slider,
|
52
|
+
&:focus-within &__checkbox:checked + &__slider {
|
53
|
+
background-color: color('utility-blue', 'step--1');
|
54
|
+
}
|
55
|
+
|
56
|
+
&__checkbox:checked + &__slider::before {
|
57
|
+
transform: translateX(1rem);
|
58
|
+
}
|
59
|
+
}
|
@@ -17,6 +17,7 @@
|
|
17
17
|
@import '~comp/industry-card/industry-card.scss';
|
18
18
|
@import '~comp/input/input.scss';
|
19
19
|
@import '~comp/input/radio.scss';
|
20
|
+
@import '~comp/input/toggle.scss';
|
20
21
|
@import '~comp/internal-nav/internal-nav.scss';
|
21
22
|
@import '~comp/meta-box/meta-box.scss';
|
22
23
|
@import '~comp/option-list/option-list.scss';
|
@@ -251,8 +251,8 @@
|
|
251
251
|
iframe {
|
252
252
|
height: 100%;
|
253
253
|
width: 100%;
|
254
|
-
left:
|
255
|
-
top:
|
254
|
+
left: -4px;
|
255
|
+
top: -4px;
|
256
256
|
transition:
|
257
257
|
padding .3s cubic-bezier(0.22, 0.61, 0.36, 1),
|
258
258
|
background-color .3s cubic-bezier(0.22, 0.61, 0.36, 1);
|
@@ -261,6 +261,10 @@
|
|
261
261
|
@media only screen and (min-width: 600px) {
|
262
262
|
position: absolute;
|
263
263
|
}
|
264
|
+
|
265
|
+
body {
|
266
|
+
border: 2px solid red;
|
267
|
+
}
|
264
268
|
}
|
265
269
|
}
|
266
270
|
|
@@ -26,7 +26,7 @@ $grid-gutter-width: 36;
|
|
26
26
|
$width: math.div(100%, $columns);
|
27
27
|
|
28
28
|
& > * {
|
29
|
-
width: calc(($width - (($columns - 1) *
|
29
|
+
width: calc(($width - (($columns - 1) * space-unit() / $columns)) - 0.1px);
|
30
30
|
width: calc(($width - (($columns - 1) * var(--gutter) / $columns)) - 0.1px);
|
31
31
|
|
32
32
|
& + * {
|
@@ -43,7 +43,7 @@ $grid-gutter-width: 36;
|
|
43
43
|
display: flex;
|
44
44
|
flex-wrap: wrap;
|
45
45
|
justify-content: stretch;
|
46
|
-
margin-bottom: calc(-1 *
|
46
|
+
margin-bottom: calc(-1 * space-unit());
|
47
47
|
margin-bottom: calc(-1 * var(--gutter));
|
48
48
|
width: 100%;
|
49
49
|
|
package/src/components-pages.njk
CHANGED
@@ -20,13 +20,15 @@ renderData:
|
|
20
20
|
<div class="c-library-stretch u-wrap mp c-tabs c-tabs--flex c-tabs--anchor c-tabs--persist u-pad-y-m-l">
|
21
21
|
<header class="u-wrap u-flow--s-l u-margin-bottom-s">
|
22
22
|
<div class="u-split">
|
23
|
-
<h1 class="c-h c-h--step-
|
23
|
+
<h1 class="c-h c-h--step-4">{{ component.title }}</h1>
|
24
24
|
<div>
|
25
25
|
{% if component.version %}<span class="c-library-version">Version {{ component.version }}</span>{% endif %}
|
26
26
|
{% if component.status %}<span class="u-margin-left-xs c-library-status c-library-status--{{ component.status | slug }}">{{ component.status }}</span>{% endif %}
|
27
27
|
</div>
|
28
28
|
</div>
|
29
29
|
|
30
|
+
{% if component.description %}<p>{{ component.description }}</p>{% endif %}
|
31
|
+
|
30
32
|
<nav class="c-tabs__controls">
|
31
33
|
<ul class="c-tabs__controls-list">
|
32
34
|
<li><a class="c-tabs__control c-tabs__control--active" href="#component-example">Example</a></li>
|
package/src/patterns/form.njk
CHANGED
@@ -8,6 +8,7 @@ layout: patterns-page
|
|
8
8
|
{% from "components/input/macro.njk" import textarea %}
|
9
9
|
{% from "components/input/macro.njk" import checkbox %}
|
10
10
|
{% from "components/input/macro.njk" import radio %}
|
11
|
+
{% from "components/input/macro.njk" import toggle %}
|
11
12
|
{% from "components/alert/macro.njk" import alert %}
|
12
13
|
|
13
14
|
<div class="u-flow">
|
@@ -73,6 +74,15 @@ layout: patterns-page
|
|
73
74
|
</div>
|
74
75
|
{% endfor %}
|
75
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
|
+
|
76
86
|
<br>
|
77
87
|
<legend><code><input></code> variations</legend>
|
78
88
|
|