mp-design-system 0.9.26 → 0.9.27
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.scss +27 -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/toggle.config.js +35 -0
- package/src/_includes/components/input/toggle.njk +7 -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/package.json
CHANGED
@@ -417,33 +417,48 @@
|
|
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
|
}
|
445
447
|
}
|
446
448
|
|
449
|
+
.grid-view > .c-card--event.c-card--has-image .c-card__wrapper {
|
450
|
+
@include gap("s");
|
451
|
+
flex-direction: column;
|
452
|
+
|
453
|
+
.c-card__primary {
|
454
|
+
width: 100%;
|
455
|
+
}
|
456
|
+
|
457
|
+
.c-card__image {
|
458
|
+
width: 100%;
|
459
|
+
}
|
460
|
+
}
|
461
|
+
|
447
462
|
// IE11 fix
|
448
463
|
// This forces IE11 to use display:block instead of flex for single-column cards
|
449
464
|
_:-ms-fullscreen, :root .c-card, :root .c-card--layout-single .c-card__wrapper { display:block; }
|
@@ -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,7 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
<label for="{{ params.id }}" class="c-toggle">
|
4
|
+
<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 }} />
|
5
|
+
<span class="c-toggle__slider"></span>
|
6
|
+
{{ params.label }}
|
7
|
+
</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>
|