mp-design-system 0.9.25 → 0.9.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-design-system",
3
- "version": "0.9.25",
3
+ "version": "0.9.27",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "npm-run-all --parallel bundle:*",
@@ -353,6 +353,7 @@
353
353
  text-align: right;
354
354
  font-size: 1.5rem;
355
355
  transition: 300ms color;
356
+ z-index: 1;
356
357
 
357
358
  .c-icon {
358
359
  position: relative;
@@ -406,7 +407,7 @@
406
407
 
407
408
  &--event.c-card--has-image {
408
409
  @extend .c-card--switch;
409
-
410
+
410
411
  .c-card__wrapper {
411
412
  @include padding(0);
412
413
 
@@ -415,28 +416,49 @@
415
416
  }
416
417
 
417
418
  .c-card__image {
419
+ position: relative;
420
+ width: 100%;
421
+
418
422
  img {
423
+ max-height: 200px;
419
424
  height: 100%;
420
- width: auto;
421
425
  object-fit: cover;
426
+ aspect-ratio: 16 / 9;
422
427
  }
423
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
+ }
424
436
 
425
- @media (min-width: 55em) {
426
- .c-card__primary {
427
- width: calc(60% - 18px) !important;
428
- width: calc(60% - var(--space-s-m)) !important;
429
- }
437
+ .c-card__image {
438
+ width: calc(30% - 18px);
439
+ width: calc(30% - var(--space-s-m));
430
440
 
431
- .c-card__image {
432
- width: calc(40% - 18px) !important;
433
- width: calc(40% - var(--space-s-m)) !important;
441
+ img {
442
+ max-height: none !important;
434
443
  }
435
444
  }
436
445
  }
437
446
  }
438
447
  }
439
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
+
440
462
  // IE11 fix
441
463
  // This forces IE11 to use display:block instead of flex for single-column cards
442
464
  _:-ms-fullscreen, :root .c-card, :root .c-card--layout-single .c-card__wrapper { display:block; }
@@ -1,3 +1,3 @@
1
- <div>
1
+ <div class="u-pad-3xs">
2
2
  {{ comp | safe }}
3
3
  </div>
@@ -1,3 +1,3 @@
1
- <form class="mp o-grid o-grid--of-two">
1
+ <form class="mp o-grid o-grid--of-two u-pad-3xs">
2
2
  {{ comp | safe }}
3
3
  </form>
@@ -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: 0;
255
- top: 0;
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) * #{space-unit()} / $columns)) - 0.1px);
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 * #{space-unit()});
46
+ margin-bottom: calc(-1 * space-unit());
47
47
  margin-bottom: calc(-1 * var(--gutter));
48
48
  width: 100%;
49
49
 
@@ -84,6 +84,9 @@
84
84
  .u-pad-0 {
85
85
  padding: 0;
86
86
  }
87
+ .u-pad-3xs {
88
+ @include padding('3xs');
89
+ }
87
90
  .u-pad-s {
88
91
  @include padding('s');
89
92
  }
@@ -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-3">{{ component.title }}</h1>
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>