@madgex/design-system 6.3.8 → 6.3.10
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/dist/_tokens/css/_tokens.css +1 -1
- package/dist/_tokens/js/_tokens-module.js +1 -1
- package/dist/assets/icons-inline.svg +1 -1
- package/dist/assets/icons.json +1 -1
- package/dist/assets/icons.svg +1 -1
- package/dist/css/index.css +1 -1
- package/package.json +2 -2
- package/src/components/_preview.njk +0 -16
- package/src/components/accordion/accordion.config.js +1 -2
- package/src/components/accordion/accordion.njk +0 -46
- package/src/components/button/button.config.js +1 -1
- package/src/components/button/button.njk +0 -36
- package/src/components/card/card.config.js +1 -1
- package/src/components/icons/icons.config.js +1 -1
- package/src/components/icons/icons.njk +0 -78
- package/src/components/inputs/checkbox-list/checkbox-list.config.js +1 -1
- package/src/components/inputs/checkbox-list/checkbox-list.njk +0 -51
- package/src/components/inputs/combobox/combobox.config.js +1 -1
- package/src/components/inputs/combobox/combobox.njk +0 -77
- package/src/components/inputs/file-upload/file-upload.config.js +1 -1
- package/src/components/inputs/input/input.config.js +1 -1
- package/src/components/inputs/input/input.njk +0 -63
- package/src/components/inputs/label/label.config.js +1 -1
- package/src/components/inputs/label/label.njk +0 -35
- package/src/components/inputs/radio/radio.config.js +1 -1
- package/src/components/inputs/radio/radio.njk +0 -58
- package/src/components/inputs/select/select.config.js +1 -1
- package/src/components/inputs/single-checkbox/single-checkbox.config.js +1 -1
- package/src/components/inputs/single-checkbox/single-checkbox.njk +0 -61
- package/src/components/inputs/text-editor/text-editor.config.js +1 -1
- package/src/components/inputs/textarea/textarea.config.js +1 -1
- package/src/components/modal/modal.config.js +1 -1
- package/src/components/notification/notification.config.js +1 -1
- package/src/components/pagination/pagination.config.js +1 -1
- package/src/components/pagination/pagination.njk +0 -40
- package/src/components/pagination-numbers/pagination-numbers.config.js +1 -1
- package/src/components/popover/popover.config.js +1 -1
- package/src/components/popover/popover.njk +0 -24
- package/src/components/section-title/title-with-action.config.js +1 -1
- package/src/components/section-title/title.config.js +1 -1
- package/src/components/skip-link/skip-link.config.js +1 -1
- package/src/components/switch-state/switch-state.config.js +1 -1
- package/src/components/tabs/tabs.config.js +1 -1
- package/src/components/toggle-button-links/toggle-button-links.config.js +1 -1
- package/src/components/toggle-button-links/toggle-button-links.njk +9 -36
- package/src/icons/{info.svg → information.svg} +1 -1
- package/src/scss/components/__index.scss +0 -2
- package/src/scss/constants/_sd-tokens.scss +1 -1
- package/src/components/_import-MdsLibrary.njk +0 -7
- package/src/components/inputs/checkbox-pill/README.md +0 -18
- package/src/components/inputs/checkbox-pill/checkbox-pill.config.js +0 -5
- package/src/components/inputs/checkbox-pill/checkbox-pill.njk +0 -87
- package/src/components/inputs/checkbox-pill/checkbox-pill.scss +0 -47
- package/src/components/inputs/form-item/README.md +0 -28
- package/src/components/inputs/form-item/form-item.config.js +0 -5
- package/src/components/inputs/form-item/form-item.njk +0 -42
- package/src/components/inputs/input-number/README.md +0 -37
- package/src/components/inputs/input-number/input-number.config.js +0 -5
- package/src/components/inputs/input-number/input-number.njk +0 -68
- package/src/components/inputs/input-number/input-number.scss +0 -60
- package/tasks/design-system-vue.js +0 -14
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{% from "./inputs/single-checkbox/_macro.njk" import MdsSingleCheckbox %}
|
|
2
2
|
|
|
3
|
-
<em>Nunjucks</em>
|
|
4
3
|
<div class="mds-form-field">
|
|
5
4
|
{{- MdsSingleCheckbox({
|
|
6
5
|
name: name,
|
|
@@ -18,63 +17,3 @@
|
|
|
18
17
|
i18n: i18n
|
|
19
18
|
}) -}}
|
|
20
19
|
</div>
|
|
21
|
-
|
|
22
|
-
<em>Vue</em>
|
|
23
|
-
<div class="mds-form-field">
|
|
24
|
-
|
|
25
|
-
<div id="vue-{{id}}"></div>
|
|
26
|
-
{% set option = (options[0] or options) %}
|
|
27
|
-
<script type="module" async>
|
|
28
|
-
{% include '_import-MdsLibrary.njk' %}
|
|
29
|
-
|
|
30
|
-
vue.createApp({
|
|
31
|
-
data() {
|
|
32
|
-
return {
|
|
33
|
-
option: {{ option | dump | safe}},
|
|
34
|
-
i18n: {{(i18n or {}) | dump | safe}},
|
|
35
|
-
optional: {{optional or false}},
|
|
36
|
-
disabled: {{disabled or false}},
|
|
37
|
-
isChecked: false,
|
|
38
|
-
helpText: "{{helpText or ''}}",
|
|
39
|
-
error: {{state === 'error'}},
|
|
40
|
-
validationError: "{{validationError or ''}}",
|
|
41
|
-
describedBy: "{{describedBy or ''}}"
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
methods: {
|
|
45
|
-
createDescribedBy(ids) {
|
|
46
|
-
return [this.describedBy, ...ids].filter(id => !!id).join(' ');
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
template: `<div>
|
|
50
|
-
<MdsFormItem :error="error">
|
|
51
|
-
<template v-if="validationError" #error>{{validationError}}</template>
|
|
52
|
-
<template v-if="helpText" #help>{{helpText}}</template>
|
|
53
|
-
<template #default="slotProps">
|
|
54
|
-
<MdsSingleCheckbox
|
|
55
|
-
id="{{id}}-vue-version"
|
|
56
|
-
name="{{name}}"
|
|
57
|
-
:describedBy="createDescribedBy([slotProps.errorMessageId, slotProps.helpMessageId])"
|
|
58
|
-
classes="{{classes}}"
|
|
59
|
-
state="{{state}}"
|
|
60
|
-
:value="option.value"
|
|
61
|
-
v-model="isChecked"
|
|
62
|
-
:disabled="disabled"
|
|
63
|
-
:optional="optional"
|
|
64
|
-
:i18n="i18n" >{{option.labelText | safe}}
|
|
65
|
-
</MdsSingleCheckbox>
|
|
66
|
-
</template>
|
|
67
|
-
</MdsFormItem>
|
|
68
|
-
</div>`
|
|
69
|
-
|
|
70
|
-
}).use(MdsLibrary).mount('#vue-{{id}}');
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
{% if id === "error" %}
|
|
76
|
-
<div id="topcv-example">Learn more about TopCV.</div>
|
|
77
|
-
{% endif %}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<div style="margin-bottom:40px"></div>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
{% from "./pagination/_macro.njk" import MdsPagination %}
|
|
2
2
|
|
|
3
|
-
{# NUNJUCKS VERSION #}
|
|
4
3
|
<h2>{{ fractalTitle }}</h2>
|
|
5
|
-
<em>Nunjucks </em>
|
|
6
4
|
|
|
7
5
|
{{ MdsPagination({
|
|
8
6
|
name: name,
|
|
@@ -16,41 +14,3 @@
|
|
|
16
14
|
id: id,
|
|
17
15
|
i18n: i18n
|
|
18
16
|
}) }}
|
|
19
|
-
|
|
20
|
-
{# VUE 3 VERSION #}
|
|
21
|
-
<em>Vue</em>
|
|
22
|
-
|
|
23
|
-
<div id="vue-{{id}}"></div>
|
|
24
|
-
|
|
25
|
-
<script type="module" async>
|
|
26
|
-
{% include '_import-MdsLibrary.njk' %}
|
|
27
|
-
const { MdsPagination} = MdsLibrary;
|
|
28
|
-
|
|
29
|
-
vue.createApp({
|
|
30
|
-
components: { MdsPagination },
|
|
31
|
-
data() {
|
|
32
|
-
return {
|
|
33
|
-
i18n: {{ i18n | dump | safe }},
|
|
34
|
-
hideIcons: {{hideIcons or false}},
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
template: `<div>
|
|
38
|
-
<MdsPagination
|
|
39
|
-
name="{{ name }}"
|
|
40
|
-
classes="{{ classes }}"
|
|
41
|
-
prev-url="{{ prevUrl }}"
|
|
42
|
-
prev-extra-label="{{ prevExtraLabel }}"
|
|
43
|
-
next-url="{{ nextUrl }}"
|
|
44
|
-
next-extra-label="{{ nextExtraLabel }}"
|
|
45
|
-
back-to-url="{{ backToUrl }}"
|
|
46
|
-
:i18n="i18n"
|
|
47
|
-
:hide-icons="hideIcons"
|
|
48
|
-
/>
|
|
49
|
-
</div>`
|
|
50
|
-
|
|
51
|
-
}).mount('#vue-{{id}}');
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{% from "./popover/_macro.njk" import MdsPopover %}
|
|
2
2
|
|
|
3
|
-
<em>Nunjucks</em>
|
|
4
3
|
<div style="padding: 10px">
|
|
5
4
|
{{ MdsPopover({
|
|
6
5
|
id: id,
|
|
@@ -10,26 +9,3 @@
|
|
|
10
9
|
content: content
|
|
11
10
|
}) }}
|
|
12
11
|
</div>
|
|
13
|
-
|
|
14
|
-
<em>Vue</em>
|
|
15
|
-
<div id="vue-{{id}}" style="padding: 10px"></div>
|
|
16
|
-
|
|
17
|
-
<script async type="module">
|
|
18
|
-
{% include '_import-MdsLibrary.njk' %}
|
|
19
|
-
const { MdsPopover } = MdsLibrary;
|
|
20
|
-
|
|
21
|
-
vue.createApp({
|
|
22
|
-
components: { MdsPopover },
|
|
23
|
-
data() {
|
|
24
|
-
return {
|
|
25
|
-
placement: "{{placement}}" || undefined,
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
template: `
|
|
29
|
-
<MdsPopover id="{{id}}" classes="{{classes}}" :placement="placement">
|
|
30
|
-
{{text | safe}}
|
|
31
|
-
<template #content>{{content | safe}}</template>
|
|
32
|
-
</MdsPopover>
|
|
33
|
-
`
|
|
34
|
-
}).mount('#vue-{{id}}');
|
|
35
|
-
</script>
|
|
@@ -1,39 +1,12 @@
|
|
|
1
1
|
{% from "./toggle-button-links/_macro.njk" import MdsToggleButtonLinks %}
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
{% for item in items %}
|
|
4
|
+
{{ MdsToggleButtonLinks({
|
|
5
|
+
id: item.id,
|
|
6
|
+
i18n: item.i18n,
|
|
7
|
+
options: item.options,
|
|
8
|
+
activeHref: item.activeHref
|
|
9
|
+
})
|
|
10
|
+
}}
|
|
11
|
+
{% endfor %}
|
|
4
12
|
|
|
5
|
-
<div class="nunjucks-items">
|
|
6
|
-
{% for item in items %}
|
|
7
|
-
{{ MdsToggleButtonLinks({
|
|
8
|
-
id: item.id,
|
|
9
|
-
i18n: item.i18n,
|
|
10
|
-
options: item.options,
|
|
11
|
-
activeHref: item.activeHref
|
|
12
|
-
})
|
|
13
|
-
}}
|
|
14
|
-
{% endfor %}
|
|
15
|
-
</div>
|
|
16
|
-
<h3 style="margin-top: 10px">Vue</h3>
|
|
17
|
-
{% for item in items %}
|
|
18
|
-
|
|
19
|
-
<div id="vue-{{item.id}}"></div>
|
|
20
|
-
|
|
21
|
-
<script type="module" async>
|
|
22
|
-
{% include '_import-MdsLibrary.njk' %}
|
|
23
|
-
vue.createApp({
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
26
|
-
id: "{{ item.id}}",
|
|
27
|
-
i18n: {{(item.i18n or {}) | dump | safe}},
|
|
28
|
-
options: {{ item.options | dump | safe}},
|
|
29
|
-
activeHref: "{{ item.activeHref }}",
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
template: `<MdsToggleButtonLinks :id="id" :i18n="i18n" :options="options" v-model="activeHref" />`
|
|
34
|
-
|
|
35
|
-
}).use(MdsLibrary).mount('#vue-{{item.id}}');
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{% endfor %}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M8 0C6.41775 0 4.87103 0.469192 3.55544 1.34824C2.23984 2.22729 1.21446 3.47672 0.608962 4.93853C0.00346057 6.40034 -0.154966 8.00887 0.153716 9.56072C0.462397 11.1126 1.22432 12.538 2.34314 13.6569C3.46196 14.7757 4.88743 15.5376 6.43928 15.8463C7.99112 16.155 9.59966 15.9965 11.0615 15.391C12.5233 14.7855 13.7727 13.7602 14.6518 12.4446C15.5308 11.129 16 9.58225 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0V0ZM8.16667 3.33333C8.36445 3.33333 8.55779 3.39198 8.72223 3.50186C8.88668 3.61174 9.01486 3.76792 9.09054 3.95065C9.16623 4.13338 9.18604 4.33444 9.14745 4.52842C9.10887 4.7224 9.01362 4.90059 8.87377 5.04044C8.73392 5.18029 8.55574 5.27553 8.36176 5.31412C8.16777 5.3527 7.96671 5.3329 7.78398 5.25721C7.60126 5.18153 7.44508 5.05335 7.3352 4.8889C7.22531 4.72445 7.16666 4.53111 7.16666 4.33333C7.16666 4.06812 7.27202 3.81376 7.45956 3.62623C7.64709 3.43869 7.90145 3.33333 8.16667 3.33333ZM9.66667 12.3333H7C6.82319 12.3333 6.65362 12.2631 6.52859 12.1381C6.40357 12.013 6.33333 11.8435 6.33333 11.6667C6.33333 11.4899 6.40357 11.3203 6.52859 11.1953C6.65362 11.0702 6.82319 11 7 11H7.5C7.5442 11 7.58659 10.9824 7.61785 10.9512C7.64911 10.9199 7.66666 10.8775 7.66666 10.8333V7.83333C7.66666 7.78913 7.64911 7.74674 7.61785 7.71548C7.58659 7.68423 7.5442 7.66667 7.5 7.66667H7C6.82319 7.66667 6.65362 7.59643 6.52859 7.4714C6.40357 7.34638 6.33333 7.17681 6.33333 7C6.33333 6.82319 6.40357 6.65362 6.52859 6.5286C6.65362 6.40357 6.82319 6.33333 7 6.33333H7.66666C8.02029 6.33333 8.35943 6.47381 8.60947 6.72386C8.85952 6.97391 9 7.31304 9 7.66667V10.8333C9 10.8775 9.01756 10.9199 9.04881 10.9512C9.08007 10.9824 9.12246 11 9.16667 11H9.66667C9.84348 11 10.013 11.0702 10.1381 11.1953C10.2631 11.3203 10.3333 11.4899 10.3333 11.6667C10.3333 11.8435 10.2631 12.013 10.1381 12.1381C10.013 12.2631 9.84348 12.3333 9.66667 12.3333Z" fill="
|
|
2
|
+
<path d="M8 0C6.41775 0 4.87103 0.469192 3.55544 1.34824C2.23984 2.22729 1.21446 3.47672 0.608962 4.93853C0.00346057 6.40034 -0.154966 8.00887 0.153716 9.56072C0.462397 11.1126 1.22432 12.538 2.34314 13.6569C3.46196 14.7757 4.88743 15.5376 6.43928 15.8463C7.99112 16.155 9.59966 15.9965 11.0615 15.391C12.5233 14.7855 13.7727 13.7602 14.6518 12.4446C15.5308 11.129 16 9.58225 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0V0ZM8.16667 3.33333C8.36445 3.33333 8.55779 3.39198 8.72223 3.50186C8.88668 3.61174 9.01486 3.76792 9.09054 3.95065C9.16623 4.13338 9.18604 4.33444 9.14745 4.52842C9.10887 4.7224 9.01362 4.90059 8.87377 5.04044C8.73392 5.18029 8.55574 5.27553 8.36176 5.31412C8.16777 5.3527 7.96671 5.3329 7.78398 5.25721C7.60126 5.18153 7.44508 5.05335 7.3352 4.8889C7.22531 4.72445 7.16666 4.53111 7.16666 4.33333C7.16666 4.06812 7.27202 3.81376 7.45956 3.62623C7.64709 3.43869 7.90145 3.33333 8.16667 3.33333ZM9.66667 12.3333H7C6.82319 12.3333 6.65362 12.2631 6.52859 12.1381C6.40357 12.013 6.33333 11.8435 6.33333 11.6667C6.33333 11.4899 6.40357 11.3203 6.52859 11.1953C6.65362 11.0702 6.82319 11 7 11H7.5C7.5442 11 7.58659 10.9824 7.61785 10.9512C7.64911 10.9199 7.66666 10.8775 7.66666 10.8333V7.83333C7.66666 7.78913 7.64911 7.74674 7.61785 7.71548C7.58659 7.68423 7.5442 7.66667 7.5 7.66667H7C6.82319 7.66667 6.65362 7.59643 6.52859 7.4714C6.40357 7.34638 6.33333 7.17681 6.33333 7C6.33333 6.82319 6.40357 6.65362 6.52859 6.5286C6.65362 6.40357 6.82319 6.33333 7 6.33333H7.66666C8.02029 6.33333 8.35943 6.47381 8.60947 6.72386C8.85952 6.97391 9 7.31304 9 7.66667V10.8333C9 10.8775 9.01756 10.9199 9.04881 10.9512C9.08007 10.9824 9.12246 11 9.16667 11H9.66667C9.84348 11 10.013 11.0702 10.1381 11.1953C10.2631 11.3203 10.3333 11.4899 10.3333 11.6667C10.3333 11.8435 10.2631 12.013 10.1381 12.1381C10.013 12.2631 9.84348 12.3333 9.66667 12.3333Z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
@import '../../components/inputs/combobox/combobox';
|
|
13
13
|
@import '../../components/inputs/file-upload/file-upload';
|
|
14
14
|
@import '../../components/inputs/textarea/textarea';
|
|
15
|
-
@import '../../components/inputs/checkbox-pill/checkbox-pill';
|
|
16
15
|
@import '../../components/inputs/text-editor/text-editor';
|
|
17
|
-
@import '../../components/inputs/input-number/input-number';
|
|
18
16
|
@import '../../components/modal/modal';
|
|
19
17
|
@import '../../components/skip-link/skip-link';
|
|
20
18
|
@import '../../components/toggle-button-links/toggle-button-links';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{% if isDev %}
|
|
2
|
-
import * as MdsLibrary from 'http://localhost:8111/lib.js';
|
|
3
|
-
{% else %}
|
|
4
|
-
// es convention does not automatically import `index.js` from a folder name (nodejs does this)
|
|
5
|
-
import * as MdsLibrary from '/assets/design-system-vue.js';
|
|
6
|
-
{% endif %}
|
|
7
|
-
import * as vue from 'vue';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
## Vue
|
|
2
|
-
|
|
3
|
-
### Slots
|
|
4
|
-
|
|
5
|
-
- `default <slot/>` - Content of the Pill.
|
|
6
|
-
|
|
7
|
-
### Props
|
|
8
|
-
|
|
9
|
-
- `name`: `String` **required** - `name` attribute for the input field.
|
|
10
|
-
- `v-model`: `Any type` _optional_ - Reactive value for the input. No default value.
|
|
11
|
-
- `value`: `Any type` _optional_ - `value` attribute for the input field. No default value.
|
|
12
|
-
- `describedBy`: `String` _optional_ - `aria-describedby` attribute for input field. Default value: `''`.
|
|
13
|
-
|
|
14
|
-
### Notes
|
|
15
|
-
|
|
16
|
-
> When using multiple `<MdsCheckboxPill>` sharing the same `v-model` remember to wrap them in a `<fieldset>`.
|
|
17
|
-
|
|
18
|
-
The component uses `<label>` as the root for a11y, so we don't have to pass it as a prop. Read Sara Soueidan's [article](https://www.sarasoueidan.com/blog/inclusively-hiding-and-styling-checkboxes-and-radio-buttons/) for reference.
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
{# VUE VERSION #}
|
|
2
|
-
<h2>Vue</h2>
|
|
3
|
-
|
|
4
|
-
<div id="vue-app">
|
|
5
|
-
{% raw %}
|
|
6
|
-
<table style="
|
|
7
|
-
width: 100%;
|
|
8
|
-
opacity: 50%;
|
|
9
|
-
max-width: 700px;
|
|
10
|
-
text-align: left;
|
|
11
|
-
margin-bottom: 10px;
|
|
12
|
-
border: 1px solid lightgrey;
|
|
13
|
-
padding: 10px"
|
|
14
|
-
>
|
|
15
|
-
<tr style="color: black; font-weight: bold">
|
|
16
|
-
<th>pill</th>
|
|
17
|
-
<th>value</th>
|
|
18
|
-
</tr>
|
|
19
|
-
<tr>
|
|
20
|
-
<td>Default</td>
|
|
21
|
-
<td :style="{color: defaultPill ? 'green' : 'red'}">{{defaultPill}}</td>
|
|
22
|
-
</tr>
|
|
23
|
-
<tr>
|
|
24
|
-
<td>Default True</td>
|
|
25
|
-
<td :style="{color: defaultTruePill ? 'green' : 'red'}">{{defaultTruePill}}</td>
|
|
26
|
-
</tr>
|
|
27
|
-
<tr>
|
|
28
|
-
<td>Multiple</td>
|
|
29
|
-
<td :style="{color: multiplePillsValues.length ? 'green' : 'red' }">{{ multiplePillsValues }}</td>
|
|
30
|
-
</tr>
|
|
31
|
-
</table>
|
|
32
|
-
|
|
33
|
-
<h3>Default pill</h3>
|
|
34
|
-
<div style="padding-bottom: 10px">
|
|
35
|
-
<mds-checkbox-pill v-model="defaultPill" name="defaultPill">
|
|
36
|
-
Default Pill
|
|
37
|
-
</mds-checkbox-pill>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<h3>Default true pill</h3>
|
|
41
|
-
<div style="padding-bottom: 10px">
|
|
42
|
-
<mds-checkbox-pill v-model="defaultTruePill" name="defaultTruePill">
|
|
43
|
-
{{ defaultTruePill ? 'True' : 'False' }}
|
|
44
|
-
</mds-checkbox-pill>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<h3>Multiple pills</h3>
|
|
48
|
-
<fieldset style="max-width: 500px; border: 2px dashed #F5F5F5; padding: 10px 5px 5px 10px">
|
|
49
|
-
<legend style="padding: 3px 6px; color: lightgrey">Choose social media platforms</legend>
|
|
50
|
-
<div style="display: flex; flex-wrap: wrap;">
|
|
51
|
-
<mds-checkbox-pill
|
|
52
|
-
v-for="pill in multiplePills"
|
|
53
|
-
v-model="multiplePillsValues"
|
|
54
|
-
:name="pill.name"
|
|
55
|
-
:value="pill.name"
|
|
56
|
-
style="margin-right: 5px; margin-bottom: 5px"
|
|
57
|
-
>
|
|
58
|
-
<span>{{ pill.label }}</span>
|
|
59
|
-
<mds-icon v-show="!multiplePillsValues.includes(pill.name)" :icon-name="pill.icon" classes="mds-icon--after" />
|
|
60
|
-
</mds-checkbox-pill>
|
|
61
|
-
</div>
|
|
62
|
-
</fieldset>
|
|
63
|
-
{% endraw %}
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<script type="module" async>
|
|
67
|
-
{% include '_import-MdsLibrary.njk' %}
|
|
68
|
-
const { MdsCheckboxPill, MdsIcon } = MdsLibrary;
|
|
69
|
-
|
|
70
|
-
const app = vue.createApp({
|
|
71
|
-
components: { MdsCheckboxPill, MdsIcon },
|
|
72
|
-
data() {
|
|
73
|
-
return {
|
|
74
|
-
defaultPill: false,
|
|
75
|
-
defaultTruePill: true,
|
|
76
|
-
multiplePillsValues: [],
|
|
77
|
-
multiplePills: [
|
|
78
|
-
{ name: 'pinterest', label: 'Pinterest', icon: 'social-pinterest'},
|
|
79
|
-
{ name: 'facebook', label: 'Facebook', icon: 'social-facebook'},
|
|
80
|
-
{ name: 'twitter', label: 'Twitter', icon: 'social-twitter'},
|
|
81
|
-
{ name: 'linkedin', label: 'Linkedin', icon: 'social-linkedin'},
|
|
82
|
-
{ name: 'reddit', label: 'Reddit', icon: 'social-reddit'}
|
|
83
|
-
]
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
}).mount('#vue-app');
|
|
87
|
-
</script>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
.mds-checkbox-pill {
|
|
2
|
-
--background: #fff;
|
|
3
|
-
--text-color: var(--mds-color-text-base);
|
|
4
|
-
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
user-select: none;
|
|
7
|
-
-webkit-appearance: none;
|
|
8
|
-
width: auto;
|
|
9
|
-
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
border: $regular-border;
|
|
12
|
-
border-radius: $border-radius;
|
|
13
|
-
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
text-align: left;
|
|
17
|
-
padding: ($constant-size-baseline * 2) ($constant-size-baseline * 3);
|
|
18
|
-
|
|
19
|
-
@extend .mds-font-body-copy;
|
|
20
|
-
font-family: var(--mds-font-family-base);
|
|
21
|
-
font-weight: var(--mds-font-weight-base);
|
|
22
|
-
text-transform: none;
|
|
23
|
-
|
|
24
|
-
background: var(--background);
|
|
25
|
-
color: var(--text-color);
|
|
26
|
-
|
|
27
|
-
&:hover,
|
|
28
|
-
&:focus-within {
|
|
29
|
-
--background: #{$constant-color-neutral-lightest};
|
|
30
|
-
--text-color: #{$link-hover-color};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&:focus-within {
|
|
34
|
-
outline: 2px solid var(--mds-color-text-base);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.mds-checkbox-pill--active {
|
|
39
|
-
--background: var(--mds-color-pill-bg-base, #000);
|
|
40
|
-
--text-color: var(--mds-color-pill-text-base, #fff);
|
|
41
|
-
|
|
42
|
-
&:hover,
|
|
43
|
-
&:focus-within {
|
|
44
|
-
--background: var(--mds-color-pill-bg-hover, #{$constant-color-neutral-darker});
|
|
45
|
-
--text-color: var(--mds-color-pill-text-hover, #fff);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# 🙋 What is MdsFormItem?
|
|
2
|
-
|
|
3
|
-
MdsFormItem is a wrapper, to wrap input-type components such as MdsInput you see below. It should not be used on its own, but wrapping another component.
|
|
4
|
-
|
|
5
|
-
It includes MdsLabel and MdsFormMessage, and influences the error styling of the input with an error prop.
|
|
6
|
-
|
|
7
|
-
## Vue
|
|
8
|
-
|
|
9
|
-
### Slots
|
|
10
|
-
|
|
11
|
-
- `default <slot/>` - Slot for the main input element.
|
|
12
|
-
- `label <slot/>` - Slot for the label's content.
|
|
13
|
-
- `tooltip <slot/>` - Slot for the label's tooltip (only visible if label slot has also content).
|
|
14
|
-
- `help <slot/>` - Slot for a help message.
|
|
15
|
-
- `error <slot/>` - Slot for an error message.
|
|
16
|
-
|
|
17
|
-
### Props
|
|
18
|
-
|
|
19
|
-
- `inputId`: `String` **required** - `for` attribute for the label's component (should match the id of the input in the slot).
|
|
20
|
-
- `optional`: `Boolean` _optional_ - If the input is optional, otherwise is required. Default: `false`.
|
|
21
|
-
- `hideLabel`: `Boolean` _optional_ - If the label is visually hidden. The text of the label will the used by default as a placeholder. Default: `false`.
|
|
22
|
-
**(please see accessibility notes regarding the use of this parameter)**
|
|
23
|
-
- `i18n`: `Object` _optional_ - Text to translate/customise. Default: `{}`.
|
|
24
|
-
- `error`: `Boolean` _optional_ - Used for styling the input element. Default: `false`.
|
|
25
|
-
|
|
26
|
-
### Accessibility
|
|
27
|
-
|
|
28
|
-
Avoid using `hideLabel` if you can. Only hide the label when there can be no mistake as to what the input is for, probably when there is only one input in the form.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{# VUE VERSION #}
|
|
2
|
-
<h2>Vue</h2>
|
|
3
|
-
|
|
4
|
-
<blockquote style="background-color: #eee; border-radius: 3px; margin-bottom: 20px; padding: 20px;">
|
|
5
|
-
<h3> 🙋 What is MdsFormItem?</h3>
|
|
6
|
-
<p>MdsFormItem is a wrapper, to wrap input-type components such as MdsInput you see below. It should not be used on its own, but wrapping another component.</p>
|
|
7
|
-
<p>It includes MdsLabel and MdsFormMessage, and influences the error styling of the input with an error prop.</p>
|
|
8
|
-
</blockquote>
|
|
9
|
-
<div id="vue-app">
|
|
10
|
-
{% raw %}
|
|
11
|
-
<div class="mds-form-field" v-for="item in items" :key="item.label">
|
|
12
|
-
<mds-form-item :input-id="item.inputId" :optional="item.optional" class="mds-form-element--input" :error="item.error">
|
|
13
|
-
<mds-input :id="item.inputId" model-value="MdsFormInput wrapping MdsInput"></mds-input>
|
|
14
|
-
<template v-if="item.label" #label>{{item.label}}</template>
|
|
15
|
-
<template v-if="item.tooltip" #tooltip>{{item.tooltip}}</template>
|
|
16
|
-
<template v-if="item.help" #help>{{item.help}}</template>
|
|
17
|
-
<template v-if="item.errorMessage" #error>{{item.errorMessage}}</template>
|
|
18
|
-
</mds-form-item>
|
|
19
|
-
</div>
|
|
20
|
-
{% endraw %}
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<script type="module" async>
|
|
24
|
-
{% include '_import-MdsLibrary.njk' %}
|
|
25
|
-
const { MdsFormItem, MdsInput } = MdsLibrary;
|
|
26
|
-
|
|
27
|
-
const app = vue.createApp({
|
|
28
|
-
components: { MdsFormItem, MdsInput },
|
|
29
|
-
data() {
|
|
30
|
-
return {
|
|
31
|
-
items: [
|
|
32
|
-
{ inputId:'I', label: 'Required Input'},
|
|
33
|
-
{ inputId:'n', label: 'Optional Input', optional: true},
|
|
34
|
-
{ inputId:'N', label: 'Input with error style', error: true },
|
|
35
|
-
{ inputId:'P', label: 'Input with error message', errorMessage: 'This is an error!', error: true },
|
|
36
|
-
{ inputId:'U', label: 'Input with help', help: 'Some help message'},
|
|
37
|
-
{ inputId:'T', label: 'Input with tooltip', tooltip: 'Never miss a tip'},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
}).mount('#vue-app');
|
|
42
|
-
</script>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
## Vue
|
|
2
|
-
|
|
3
|
-
### Parameters
|
|
4
|
-
|
|
5
|
-
- `v-model (:modelValue)`: **required** The value of the input.
|
|
6
|
-
- `id`: `String` **required** - Id attribute of the input.
|
|
7
|
-
- `name`: `String` _optional_ - Name attribute of the input.
|
|
8
|
-
- `placeholder`: `String` _optional_ - Placeholder attribute of the input element. Default: `''`.
|
|
9
|
-
- `min`: `Number` _optional_ - Min attribute of the input element. Default: `Number.NEGATIVE_INFINITY`.
|
|
10
|
-
- `max`: `Number` _optional_ - Max attribute of the input element. Default: `Number.POSITIVE_INFINITY`.
|
|
11
|
-
- `step`: `Number` _optional_ - Step attribute of input element. Default: `1`.
|
|
12
|
-
- `error`: `Boolean` _optional_ - Used for a11y (`:aria-invalid` attribute). Default: `false`.
|
|
13
|
-
- `i18n`: `Object` _optional_ - Text to translate/customise.
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
i18n: {
|
|
17
|
-
increaseAriaLabel: 'Increase', // aria label for "Increase" button
|
|
18
|
-
decreaseAriaLabel: 'Decrease', // aria label for "Decrease" button
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### i18n
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
<mds-form-item input-id="my-input-number-id" class="mds-form-element--input">
|
|
26
|
-
<template #label>¿Cuántos idiomas hablas?</template>
|
|
27
|
-
<mds-input-number
|
|
28
|
-
id="my-input-number-id"
|
|
29
|
-
v-model="value"
|
|
30
|
-
min="1"
|
|
31
|
-
max="50"
|
|
32
|
-
:i18="{increaseAriaLabel: 'Aumentar', decreaseAriaLabel: 'Reducir'}"
|
|
33
|
-
/>
|
|
34
|
-
</mds-form-item>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
> Note: Remember to wrap your input components with `mds-form-item` whenever you need to use them within a form.
|