@madgex/design-system 7.0.0 → 7.0.2
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/README.md +0 -4
- package/dist/_tokens/css/_tokens.css +1 -1
- package/dist/_tokens/js/_tokens-module.js +1 -1
- package/dist/assets/icons.json +1 -1
- package/dist/css/index.css +1 -1
- package/dist/js/index.js +1 -1
- package/package.json +2 -2
- package/src/components/accordion/README.md +4 -28
- package/src/components/button/README.md +3 -22
- package/src/components/icons/README.md +6 -25
- package/src/components/inputs/checkbox-list/README.md +0 -12
- package/src/components/inputs/combobox/README.md +1 -11
- package/src/components/inputs/input/README.md +3 -18
- package/src/components/inputs/label/README.md +2 -27
- package/src/components/inputs/radio/README.md +2 -30
- package/src/components/inputs/single-checkbox/README.md +2 -24
- package/src/components/pagination/README.md +2 -17
- package/src/components/pagination/pagination.scss +1 -0
- package/src/components/popover/README.md +3 -26
- package/src/components/tabs/tabs.config.js +2 -2
- package/src/components/toggle-button-links/README.md +0 -11
- package/src/helpers/prose/README.md +7 -0
- package/src/helpers/{edited-text/edited-text.js → prose/prose.js} +3 -5
- package/src/helpers/{edited-text/edited-text.njk → prose/prose.njk} +5 -5
- package/src/js/index.js +2 -2
- package/src/scss/constants/_sd-tokens.scss +1 -1
- package/src/scss/helpers/__index.scss +2 -2
- package/src/scss/helpers/_font-types.scss +0 -5
- package/src/scss/helpers/{_edited-text.scss → _prose.scss} +2 -5
- package/src/scss/resets/__index.scss +7 -7
- package/src/helpers/edited-text/README.md +0 -5
- package/src/typography/block-of-text.config.json +0 -3
- package/src/typography/block-of-text.njk +0 -4
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
##
|
|
2
|
-
|
|
3
|
-
### Parameters
|
|
1
|
+
## Parameters
|
|
4
2
|
|
|
5
3
|
- `id`: id of the trigger - **required**,
|
|
6
4
|
- `text`: text you want on the trigger - **required**,
|
|
@@ -13,32 +11,11 @@ Default is `top-end`.
|
|
|
13
11
|
|
|
14
12
|
Note: If there is not enough space for the popover to fit at a certain position, it will move to the opposite side.
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
## Accessibility
|
|
17
15
|
|
|
18
16
|
When javascript is enabled, the trigger uses `aria-expanded="false/true"` and there is an `aria-hidden="true"` set on the popover when it is not active.
|
|
19
17
|
If javascript is not enabled, the content of the popover just shows.
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
## Note
|
|
22
20
|
|
|
23
21
|
We are using the Popper.js library (https://github.com/popperjs/popper.js) to help with the positioning. More details here (https://popper.js.org/)
|
|
24
|
-
|
|
25
|
-
## Vue
|
|
26
|
-
|
|
27
|
-
### Slots
|
|
28
|
-
|
|
29
|
-
- `default <slot/>`: Content for nested trigger `<MdsButton />`
|
|
30
|
-
- `#content <slot/>`: Content for the popover.
|
|
31
|
-
|
|
32
|
-
### Props
|
|
33
|
-
|
|
34
|
-
- `id`: `String` **required** - `id` attribute of the trigger.
|
|
35
|
-
- `classes`: `String, Object, Array` _optional_ - Add extra classes to the trigger. No default.
|
|
36
|
-
- `placement`: `String` _optional_ - placement of the popover. Default: `'top-end'`.
|
|
37
|
-
|
|
38
|
-
### Notes
|
|
39
|
-
|
|
40
|
-
Install `@popperjs/core` if you need this component.
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
npm i @popperjs/core
|
|
44
|
-
```
|
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
|
23
23
|
label: 'Next week',
|
|
24
24
|
id: 'next-week',
|
|
25
25
|
content: '<ul><li>Lorem</li><li>ipsum</li><li>dolor</li><li>sit</li><li>amet</li></ul><p>next week</p>',
|
|
26
|
-
contentClasses: 'mds-
|
|
26
|
+
contentClasses: 'mds-prose',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
label: 'Next month',
|
|
@@ -77,7 +77,7 @@ module.exports = {
|
|
|
77
77
|
label: 'Seagulls',
|
|
78
78
|
headerText: 'Latest News about Seagulls',
|
|
79
79
|
content: '<ul><li>Lorem</li><li>ipsum</li><li>dolor</li><li>sit</li><li>amet</li></ul><p>next week</p>',
|
|
80
|
-
contentClasses: 'mds-
|
|
80
|
+
contentClasses: 'mds-prose',
|
|
81
81
|
},
|
|
82
82
|
],
|
|
83
83
|
},
|
|
@@ -2,20 +2,9 @@ Mainly used for sort options, when there are 2 options.
|
|
|
2
2
|
|
|
3
3
|
Although the component supports more than 2 options, we strongly suggest only using this component if there are 2 options. Any more and you should use `MdsSelect` instead.
|
|
4
4
|
|
|
5
|
-
## Nunjucks
|
|
6
|
-
|
|
7
5
|
### Parameters
|
|
8
6
|
|
|
9
7
|
- `id`: required id
|
|
10
8
|
- `i18n`: object e.g `{label: 'Sort by:'}`
|
|
11
9
|
- `options`: Array of objects, e.g. `[{href:'https://madgex.com/my-link1', label: 'My Link 1'}, {href:'https://madgex.com/my-link2', label: 'My Link 2'}]`
|
|
12
10
|
- `activeHref`: `href` to match to above option.href, which will denote the `active` buttonLink
|
|
13
|
-
|
|
14
|
-
## Vue
|
|
15
|
-
|
|
16
|
-
### Props
|
|
17
|
-
|
|
18
|
-
- `id`: required id
|
|
19
|
-
- `i18n`: object e.g `{label: 'Sort by:'}`
|
|
20
|
-
- `options`: Array of objects, e.g. `[{href:'https://madgex.com/my-link1', label: 'My Link 1'}, {href:'https://madgex.com/my-link2', label: 'My Link 2'}]`
|
|
21
|
-
- `:modelValue/v-model`: `href` or `to` object to match to above option.href or option.to, which will denote the `active` buttonLink
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## Helpers
|
|
2
|
+
|
|
3
|
+
Use the class `mds-prose` to normalise the text coming from a WYSIWYG editor,
|
|
4
|
+
this should only be used when content from a WYSIWYG editor is displayed.
|
|
5
|
+
|
|
6
|
+
ul, ol tags will have the style that has been removed in css-reset.
|
|
7
|
+
The line-height and paragraph margin-bottom have been increased to improve readability.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const prose = {
|
|
2
2
|
setFluidVideos: () => {
|
|
3
|
-
const elements = Array.from(
|
|
4
|
-
document.querySelectorAll('.mds-edited-text iframe, .mds-edited-text embed, .mds-edited-text object')
|
|
5
|
-
);
|
|
3
|
+
const elements = Array.from(document.querySelectorAll('.mds-prose iframe, .mds-prose embed, .mds-prose object'));
|
|
6
4
|
|
|
7
5
|
elements.forEach((element) => {
|
|
8
6
|
const newHtml = document.createElement('div');
|
|
@@ -14,4 +12,4 @@ const editedText = {
|
|
|
14
12
|
},
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
export default
|
|
15
|
+
export default prose;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<h4>Lists:</h4>
|
|
2
|
-
<div class="mds-
|
|
2
|
+
<div class="mds-prose">
|
|
3
3
|
<ol>
|
|
4
4
|
<li>
|
|
5
5
|
one
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
</ol>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
|
-
<h4>Paragraph
|
|
32
|
-
<div class="mds-
|
|
31
|
+
<h4>Paragraph:</h4>
|
|
32
|
+
<div class="mds-prose">
|
|
33
33
|
<h3>Paragraph 1</h3>
|
|
34
34
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse lacus mi, molestie vulputate dolor dictum, mollis tempor dolor. Proin ut interdum tortor, eu dictum massa. Quisque eu congue mi. Curabitur ac fermentum lorem. Ut quam sapien, mollis vel rhoncus et, mattis non sapien. Aenean nec lacinia felis. Aenean rhoncus lacinia pretium. Cras rutrum mollis orci, vitae ultrices nisi fermentum sit amet. Donec vehicula libero ac mollis ornare. Pellentesque eleifend libero urna, accumsan tincidunt lectus lobortis nec.</p>
|
|
35
35
|
<h3>Paragraph 2</h3>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
<h4>Tables</h4>
|
|
42
42
|
|
|
43
|
-
<div class="mds-
|
|
43
|
+
<div class="mds-prose">
|
|
44
44
|
|
|
45
45
|
<table border="1" cellpadding="10" cellspacing="0">
|
|
46
46
|
<tr>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
<article style="margin: 2rem 0;">
|
|
61
61
|
<h4>Iframes and media objects</h4>
|
|
62
|
-
<div class="mds-
|
|
62
|
+
<div class="mds-prose">
|
|
63
63
|
<p>
|
|
64
64
|
<iframe src="https://player.vimeo.com/video/76979871" title="Embedded Video: The New Vimeo Player (You Know, For Videos)" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
|
|
65
65
|
</p>
|
package/src/js/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import modals from '../components/modal/modal';
|
|
|
16
16
|
import fileUpload from '../components/inputs/file-upload/file-upload';
|
|
17
17
|
import characterCount from '../components/inputs/textarea/character-count';
|
|
18
18
|
import button from '../components/button/button';
|
|
19
|
-
import
|
|
19
|
+
import prose from '../helpers/prose/prose';
|
|
20
20
|
|
|
21
21
|
document.addEventListener('DOMContentLoaded', () => {
|
|
22
22
|
tabs.init();
|
|
@@ -26,5 +26,5 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
26
26
|
characterCount.init();
|
|
27
27
|
popovers.init();
|
|
28
28
|
button.init();
|
|
29
|
-
|
|
29
|
+
prose.setFluidVideos();
|
|
30
30
|
});
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
@import 'text-align';
|
|
5
5
|
@import 'display';
|
|
6
6
|
@import 'borders';
|
|
7
|
-
@import '
|
|
7
|
+
@import 'prose';
|
|
8
8
|
@import 'width-height';
|
|
9
9
|
@import 'fluid-video';
|
|
10
10
|
@import 'animation';
|
|
11
11
|
@import 'vertical-align';
|
|
12
|
-
@import 'text-formatting'
|
|
12
|
+
@import 'text-formatting';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
$font-type-scales: 's-2', 's-1', 's0', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9';
|
|
3
2
|
|
|
4
3
|
// loop will create all the classes for the font type scales in the tokens array
|
|
@@ -17,7 +16,3 @@ $font-type-scales: 's-2', 's-1', 's0', 's1', 's2', 's3', 's4', 's5', 's6', 's7',
|
|
|
17
16
|
line-height: var(--mds-font-type-#{$scale}-line-height);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
.mds-font-s0--bulk {
|
|
22
|
-
line-height: 1.75;
|
|
23
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
.mds-
|
|
1
|
+
.mds-prose {
|
|
2
|
+
line-height: 1.75;
|
|
2
3
|
& ul,
|
|
3
4
|
& ol {
|
|
4
5
|
margin: 0 0 ($constant-size-baseline * 5) ($constant-size-baseline * 3);
|
|
@@ -19,10 +20,6 @@
|
|
|
19
20
|
margin-bottom: $constant-size-baseline;
|
|
20
21
|
margin-left: $constant-size-baseline * 4;
|
|
21
22
|
}
|
|
22
|
-
}
|
|
23
|
-
.mds-edited-text.mds-font-s0--bulk,
|
|
24
|
-
.mds-font-s0--bulk .mds-edited-text,
|
|
25
|
-
.mds-edited-text .mds-font-s0--bulk {
|
|
26
23
|
& p {
|
|
27
24
|
margin-bottom: $constant-size-baseline * 4;
|
|
28
25
|
}
|
|
@@ -44,13 +44,13 @@ form,
|
|
|
44
44
|
label,
|
|
45
45
|
legend,
|
|
46
46
|
caption,
|
|
47
|
-
table:not(.mds-
|
|
48
|
-
tbody:not(.mds-
|
|
49
|
-
tfoot:not(.mds-
|
|
50
|
-
thead:not(.mds-
|
|
51
|
-
tr:not(.mds-
|
|
52
|
-
th:not(.mds-
|
|
53
|
-
td:not(.mds-
|
|
47
|
+
table:not(.mds-prose table),
|
|
48
|
+
tbody:not(.mds-prose tbody),
|
|
49
|
+
tfoot:not(.mds-prose tfoot),
|
|
50
|
+
thead:not(.mds-prose thead),
|
|
51
|
+
tr:not(.mds-prose tr),
|
|
52
|
+
th:not(.mds-prose th),
|
|
53
|
+
td:not(.mds-prose td),
|
|
54
54
|
article,
|
|
55
55
|
aside,
|
|
56
56
|
canvas,
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<div class="mds-font-s0--bulk">
|
|
2
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ante ante, volutpat non venenatis ut, blandit vel tellus. Suspendisse sagittis convallis tincidunt. Proin ut neque quis enim maximus congue. Integer ullamcorper a urna gravida efficitur. Aliquam elementum non sem eu mattis. Proin erat nulla, tincidunt quis volutpat vel, suscipit sit amet sapien. Integer auctor aliquet ligula, vel mollis lorem semper id.</p>
|
|
3
|
-
<p>Praesent pharetra, ligula sed laoreet scelerisque, libero elit commodo sem, et varius arcu risus non turpis. Nulla scelerisque urna non felis vulputate luctus. Nullam ut metus at elit consequat ultrices. Nulla bibendum feugiat nibh, ut pellentesque orci pellentesque et. Nunc sagittis lacus quis elementum ornare. Nulla non commodo diam. Proin est ante, vestibulum et nisi nec, viverra pretium magna. Suspendisse sit amet mauris velit. Fusce placerat, lectus ut facilisis mattis, neque sapien hendrerit ex, ut dapibus dui sapien id orci. Nulla accumsan lacus commodo, euismod eros ac, malesuada eros. Phasellus ultricies porta eros a dictum. Integer dapibus ultrices elit, ut lacinia diam volutpat ac. Curabitur eu sollicitudin lectus. Donec fringilla lacus turpis, eu posuere orci lobortis vel. Morbi non diam id sapien commodo interdum id viverra tortor. Suspendisse iaculis odio justo, at maximus tellus facilisis ut.</p>
|
|
4
|
-
</div>
|