@madgex/design-system 1.51.0 → 1.53.0

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.
Files changed (83) hide show
  1. package/coverage/cobertura-coverage.xml +128 -85
  2. package/coverage/components/accordion/accordion.js.html +1 -1
  3. package/coverage/components/accordion/index.html +1 -1
  4. package/coverage/components/inputs/combobox/combobox.js.html +1 -1
  5. package/coverage/components/inputs/combobox/index.html +1 -1
  6. package/coverage/components/inputs/combobox/vue-components/Combobox.vue.html +67 -16
  7. package/coverage/components/inputs/combobox/vue-components/ListBoxOption.vue.html +211 -0
  8. package/coverage/components/inputs/combobox/vue-components/index.html +35 -20
  9. package/coverage/components/inputs/multi-select/index.html +1 -1
  10. package/coverage/components/inputs/multi-select/multi-select.js.html +1 -1
  11. package/coverage/components/inputs/multi-select/vue-components/MultiSelect.vue.html +1 -1
  12. package/coverage/components/inputs/multi-select/vue-components/MultiSelectCheckbox.vue.html +1 -1
  13. package/coverage/components/inputs/multi-select/vue-components/MultiSelectCheckboxGroup.vue.html +1 -1
  14. package/coverage/components/inputs/multi-select/vue-components/index.html +1 -1
  15. package/coverage/components/modal/index.html +1 -1
  16. package/coverage/components/modal/modal.js.html +1 -1
  17. package/coverage/components/notification/index.html +1 -1
  18. package/coverage/components/notification/notification.js.html +1 -1
  19. package/coverage/components/popover/index.html +1 -1
  20. package/coverage/components/popover/popover.js.html +1 -1
  21. package/coverage/components/switch-state/index.html +1 -1
  22. package/coverage/components/switch-state/switch-state.js.html +1 -1
  23. package/coverage/components/tabs/index.html +1 -1
  24. package/coverage/components/tabs/tabs.js.html +1 -1
  25. package/coverage/index.html +20 -20
  26. package/coverage/js/common.js.html +1 -1
  27. package/coverage/js/fractal-scripts/combobox.js.html +1 -1
  28. package/coverage/js/fractal-scripts/index.html +1 -1
  29. package/coverage/js/fractal-scripts/notification.js.html +1 -1
  30. package/coverage/js/fractal-scripts/switch-state.js.html +1 -1
  31. package/coverage/js/index-fractal.js.html +1 -1
  32. package/coverage/js/index-polyfills.js.html +1 -1
  33. package/coverage/js/index-vue.js.html +1 -1
  34. package/coverage/js/index.html +1 -1
  35. package/coverage/js/index.js.html +1 -1
  36. package/coverage/js/polyfills/closest.js.html +1 -1
  37. package/coverage/js/polyfills/index.html +1 -1
  38. package/coverage/js/polyfills/remove.js.html +1 -1
  39. package/coverage/tokens/_config.js.html +1 -1
  40. package/coverage/tokens/index.html +1 -1
  41. package/dist/_tokens/css/_tokens.css +4 -1
  42. package/dist/_tokens/js/_tokens-module.js +54 -1
  43. package/dist/_tokens/scss/_tokens.scss +10 -2
  44. package/dist/assets/icons.json +1 -1
  45. package/dist/assets/icons.svg +1 -1
  46. package/dist/css/index.css +1 -1
  47. package/dist/js/index.js +6 -6
  48. package/docs/tokens/colour.njk +2 -2
  49. package/package.json +1 -1
  50. package/src/components/accordion/README.md +12 -1
  51. package/src/components/accordion/_template.njk +38 -17
  52. package/src/components/accordion/accordion.config.js +14 -0
  53. package/src/components/accordion/accordion.njk +4 -1
  54. package/src/components/accordion/accordion.scss +21 -4
  55. package/src/components/icons/icons.scss +2 -2
  56. package/src/components/inputs/combobox/combobox.scss +16 -1
  57. package/src/components/inputs/combobox/vue-components/Combobox.vue +23 -6
  58. package/src/components/inputs/combobox/vue-components/ListBox.vue +13 -0
  59. package/src/components/inputs/combobox/vue-components/ListBoxOption.vue +20 -3
  60. package/src/components/inputs/multi-select/multi-select.config.js +1 -1
  61. package/src/components/inputs/select/select.config.js +3 -3
  62. package/src/components/skip-link/README.md +11 -0
  63. package/src/components/skip-link/_macro.njk +3 -0
  64. package/src/components/skip-link/_template.njk +3 -0
  65. package/src/components/skip-link/skip-link.njk +8 -0
  66. package/src/components/skip-link/skip-link.scss +16 -0
  67. package/src/icons/chevron-down.svg +7 -46
  68. package/src/icons/chevron-left.svg +4 -6
  69. package/src/icons/chevron-right.svg +4 -6
  70. package/src/icons/chevron-up.svg +7 -46
  71. package/src/icons/close.svg +7 -0
  72. package/src/icons/minus.svg +7 -0
  73. package/src/icons/plus-small.svg +7 -0
  74. package/src/icons/plus.svg +7 -0
  75. package/src/layout/containers/01-base-containers.njk +20 -18
  76. package/src/layout/containers/README.md +3 -0
  77. package/src/layout/containers/base-containers.config.json +1 -1
  78. package/src/scss/components/__index.scss +2 -1
  79. package/src/scss/core/_containers.scss +5 -0
  80. package/src/scss/utilities/_z-index.scss +6 -6
  81. package/src/tokens/color.json +3 -0
  82. package/src/tokens/size.json +11 -3
  83. package/tasks/colorTransforms.js +1 -1
@@ -31,11 +31,11 @@ Your context and coding style determine how you access MDS color tokens in code.
31
31
  </div>
32
32
  {% endmacro %}
33
33
 
34
-
34
+ <div>{% for key, item in tokens.color %} <a href="#{{ key }}">{{ key }}</a> {% if not loop.last %}| {% endif %}{% endfor %}</div>
35
35
 
36
36
  {% for key, item in tokens.color %}
37
37
  <div class="colors">
38
- <h2>{{ key }}</h2>
38
+ <h2 id="{{ key }}">{{ key }}</h2>
39
39
  {% if not 'value' in item and item | length %}
40
40
  {% for subkey, subitem in item %}
41
41
  {% if not 'value' in subitem and subitem | length %}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@madgex/design-system",
3
3
  "author": "Madgex",
4
4
  "license": "UNLICENSED",
5
- "version": "1.51.0",
5
+ "version": "1.53.0",
6
6
  "scripts": {
7
7
  "clean": "rimraf dist public tokens/build",
8
8
  "commit": "commit",
@@ -8,8 +8,19 @@
8
8
  - `headerClass`: class will be added to the trigger (useful to change the font size)
9
9
  - `breakpoint`: if a value (in px, em, rem) is passed, the accordion will be enabled only when screen size is smaller than the breakpoint
10
10
  - `content`: this can also be a custom component or html
11
+ - `expandIcon`: This allows you to override the iconography for the expand icon (default: chevron-down) - See design usage guidelines
12
+ - `collapseIcon`: This allows you to override the iconography for the collapse icon (default: chevron-up) - See design usage guidelines
13
+ - `leftAligned`: This will determine if the icon should sit on the left or the right of the label (default: false) - See design usage guidelines
11
14
 
12
15
 
13
16
  ## Accessibility
14
17
 
15
- when javascript is enabled, accordion will contains aria-labelledby, aria-expanded and aria-controls for screen readers.
18
+ when javascript is enabled, accordion will contains aria-labelledby, aria-expanded and aria-controls for screen readers.
19
+
20
+ ## Design usage guidelines
21
+ Where possible, the defaults should remain as they are to ensure we remain consistent across the platform, though there are a few areas where you may need to step
22
+ outside these guidelines, this offers an insight into the design decisions to best ensure you understand context and usage.
23
+
24
+ - `expandIcon`: Where possible, we should ensure that this remains unchanged as the chevrons are a universal indicator of expandable content. However, there are scenarios where this may not work for you. In these scenarios, it is suggested you use one of the following icons: `plus-small` (Plus is a little too big to align nicely with the content of the label)
25
+ - `collapseIcon`: Where possible, we should ensure that this remains unchanged as the chevrons are a universal indicator of collapsable content. However, there are scenarios where this may not work for you. In these scenarios, it is suggested you use one of the following icons: `minus`
26
+ - `leftAligned`: Usage for this parameter depends largely on the content surrounding it. There are some cases where we have a list where some items are expandable while others are not so to avoid a misalignment due to the presence of icons or not, we've decided that when in a list the accordions would have the icons on the right. When used as a single component on the page, the icon is on the left instead.
@@ -2,32 +2,53 @@
2
2
 
3
3
  {% if params.content %}
4
4
  {%- set accordionId %}
5
- {%- if item.id -%}
6
- {{ item.id }}
7
- {%- else -%}
8
- {#
9
- if the id is missing it will be constructed using:
10
- [component name]-[item triggerLabel]-[index]
11
- e.g. period-next-week-2
12
- #}
13
- {%- if params.name -%}{{ params.name | lower | trim | replace(' ', '-')}}{%- else -%}
14
- {{ item.triggerLabel | lower | trim | replace(' ', '-') }}{%- endif -%}
15
- {%- endif -%}
5
+ {%- if item.id -%}
6
+ {{ item.id }}
7
+ {%- else -%}
8
+ {#
9
+ if the id is missing it will be constructed using:
10
+ [component name]-[item triggerLabel]-[index]
11
+ e.g. period-next-week-2
12
+ #}
13
+ {%- if params.name -%}{{ params.name | lower | trim | replace(' ', '-')}}{%- else -%}
14
+ {{ item.triggerLabel | lower | trim | replace(' ', '-') }}{%- endif -%}
15
+ {%- endif -%}
16
16
  {% endset -%}
17
17
  {%- set headerTag %}
18
- {%- if params.triggerIsHeader -%}
19
- {{params.triggerIsHeader}}
20
- {%- else -%}
21
- p
22
- {%- endif -%}
18
+ {%- if params.triggerIsHeader -%}
19
+ {{params.triggerIsHeader}}
20
+ {%- else -%}
21
+ p
22
+ {%- endif -%}
23
+ {% endset -%}
24
+ {%- set collapseIcon -%}
25
+ {%- if params.collapseIcon -%}
26
+ {{params.collapseIcon}}
27
+ {%- else -%}
28
+ chevron-up
29
+ {%- endif -%}
30
+ {% endset -%}
31
+ {%- set expandIcon %}
32
+ {%- if params.expandIcon -%}
33
+ {{params.expandIcon}}
34
+ {%- else -%}
35
+ chevron-down
36
+ {% endif -%}
23
37
  {% endset -%}
24
38
  <div class="mds-accordion" id="{{accordionId}}" {% if params.breakpoint %}data-bp="{{params.breakpoint}}"{% endif %} data-test="accordion">
25
39
  <{{headerTag}} class="mds-accordion__trigger{%if params.triggerNoJsHidden %} mds-display-none{% endif %}" data-test="accordion-trigger">
26
40
  <span {% if params.headerClass %}class="{{params.headerClass}}"{% endif %}>
41
+ {% if params.leftAligned %}
42
+ {{- MdsIcon({ iconName: collapseIcon, classes: 'mds-icon--before mds-accordion__icon-collapse'}) -}}
43
+ {{- MdsIcon({ iconName: expandIcon, classes: 'mds-icon--before mds-accordion__icon-expand'}) -}}
44
+ {% endif %}
27
45
  <span class="mds-accordion__trigger-label" {%- if params.triggerLabelActive %} data-labelinverse="{{params.triggerLabelActive}}"{% endif %}>
28
46
  {{- params.triggerLabel -}}
29
47
  </span>
30
- {{- MdsIcon({ iconName: 'chevron-right', classes: 'mds-icon--after'}) -}}
48
+ {% if not params.leftAligned %}
49
+ {{- MdsIcon({ iconName: collapseIcon, classes: 'mds-icon--after mds-accordion__icon-collapse'}) -}}
50
+ {{- MdsIcon({ iconName: expandIcon, classes: 'mds-icon--after mds-accordion__icon-expand'}) -}}
51
+ {% endif %}
31
52
  </span>
32
53
  </{{headerTag}}>
33
54
  <div id="accordion-content-{{accordionId}}" class="mds-accordion__content" {%if not params.triggerNoJsHidden %}aria-labelledby="accordion-trigger-{{accordionId}}" {% endif %}data-test="accordion-content">{{params.content | safe}}</div>
@@ -15,6 +15,20 @@ module.exports = {
15
15
  '<dl class="mds-list mds-list--definition mds-list--border"><dt class="mds-list__key">Hours</dt><dd class="mds-list__value">Full time</dd><dt class="mds-list__key">Contract</dt><dd class="mds-list__value">Permanent</dd><dt class="mds-list__key">Industry</dt><dd class="mds-list__value">Accountant, Manager</dd></dl>',
16
16
  },
17
17
  },
18
+ {
19
+ name: 'Alternative icons',
20
+ context: {
21
+ name: 'Alt Icons',
22
+ triggerLabel: 'View more',
23
+ triggerLabelActive: 'View less',
24
+ triggerNoJsHidden: true,
25
+ collapseIcon: 'minus',
26
+ expandIcon: 'plus-small',
27
+ leftAligned: true,
28
+ content:
29
+ '<div class="mds-grid-row"><div class="mds-grid-col-6"><div class="mds-form-field"><div class="mds-form-element mds-form-element--multiselect js-mds-multiselect" data-test="multiselect"><fieldset><div class="mds-form-label"><legend class="mds-form-label__label">Role</legend></div><div class="mds-multiselect"><div class="mds-multiselect__checkbox-group"><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-7" value="7"><label for="Role-7">Academic Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-1" value="1"><label for="Role-1">Community Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-10" value="10"><label for="Role-10">Dispensing Assistant</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-4" value="4" checked=""><label for="Role-4">Hospital Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-6" value="6"><label for="Role-6">Industrial Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-3" value="3"><label for="Role-3">Locum Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-11" value="11"><label for="Role-11">Medicines Counter Assistant</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-2" value="2"><label for="Role-2">Pharmacy Manager</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-12" value="12"><label for="Role-12">Pharmacy Student</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-9" value="9"><label for="Role-9">Pharmacy Technician</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-8" value="8" checked=""><label for="Role-8">Pre-reg Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-513016" value="513016"><label for="Role-513016">Primary Care Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-513015" value="513015"><label for="Role-513015">Region/Area Manager</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-5" value="5"><label for="Role-5">Senior Management</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-513014" value="513014"><label for="Role-513014">Superintendent Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-13" value="13"><label for="Role-13">Other Pharmacy roles</label></div></div></div></fieldset><fieldset><div class="mds-form-label"><legend class="mds-form-label__label">Industry</legend></div><div class="mds-multiselect"><div class="mds-multiselect__checkbox-group"><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-7" value="7"><label for="Role-7">Academic Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-1" value="1"><label for="Role-1">Community Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-10" value="10"><label for="Role-10">Dispensing Assistant</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-4" value="4" checked=""><label for="Role-4">Hospital Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-6" value="6"><label for="Role-6">Industrial Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-3" value="3"><label for="Role-3">Locum Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-11" value="11"><label for="Role-11">Medicines Counter Assistant</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-2" value="2"><label for="Role-2">Pharmacy Manager</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-12" value="12"><label for="Role-12">Pharmacy Student</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-9" value="9"><label for="Role-9">Pharmacy Technician</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-8" value="8" checked=""><label for="Role-8">Pre-reg Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-513016" value="513016"><label for="Role-513016">Primary Care Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-513015" value="513015"><label for="Role-513015">Region/Area Manager</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-5" value="5"><label for="Role-5">Senior Management</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-513014" value="513014"><label for="Role-513014">Superintendent Pharmacist</label></div><div class="mds-multiselect__checkbox"><input type="checkbox" name="Role" id="Role-13" value="13"><label for="Role-13">Other Pharmacy roles</label></div></div></div></fieldset></div></div></div></div>',
30
+ },
31
+ },
18
32
  {
19
33
  name: 'Collapsed Paragraph',
20
34
  context: {
@@ -10,6 +10,9 @@
10
10
  triggerIsHeader: triggerIsHeader,
11
11
  headerClass: headerClass,
12
12
  breakpoint: breakpoint,
13
- content: content
13
+ content: content,
14
+ leftAligned: leftAligned,
15
+ expandIcon: expandIcon,
16
+ collapseIcon: collapseIcon
14
17
  }) }}
15
18
  <hr />
@@ -6,10 +6,27 @@
6
6
  display: block;
7
7
  }
8
8
 
9
- html:not(.js) .mds-accordion .mds-accordion__trigger .mds-icon{
10
- display: none;
9
+ .mds-accordion {
10
+ & .mds-icon.mds-accordion__icon {
11
+ &-expand {
12
+ display: inline-block;
13
+ }
14
+ &-collapse {
15
+ display: none;
16
+ }
17
+ }
18
+ &--expanded {
19
+ & .mds-icon.mds-accordion__icon {
20
+ &-expand {
21
+ display: none;
22
+ }
23
+ &-collapse {
24
+ display: inline-block;
25
+ }
26
+ }
27
+ }
11
28
  }
12
29
 
13
- .mds-accordion:not(.mds-accordion--expanded) .mds-icon{
14
- transform: rotate(90deg);
30
+ html:not(.js) .mds-accordion .mds-accordion__trigger .mds-icon{
31
+ display: none;
15
32
  }
@@ -56,10 +56,10 @@
56
56
  }
57
57
 
58
58
  .mds-icon--before {
59
- margin-right: 0.66em;
59
+ margin-right: 0.5em;
60
60
  }
61
61
  .mds-icon--after {
62
- margin-left: 0.66em;
62
+ margin-left: 0.5em;
63
63
  }
64
64
 
65
65
  .mds-icon--spinner {
@@ -13,9 +13,21 @@
13
13
  overflow-y: scroll;
14
14
  @include z-index();
15
15
 
16
+ & .mds-combobox-loading {
17
+ padding: $mds-size-baseline * 2 0;
18
+ & .mds-icon--spinner {
19
+ display: block;
20
+ margin: 0 auto;
21
+ }
22
+ }
23
+
16
24
  & .mds-combobox__option {
25
+ &--marked {
26
+ font-weight: 700;
27
+ }
17
28
  @extend .mds-font-pica;
18
- padding: $mds-size-baseline;
29
+ padding: $mds-size-baseline * 2 $mds-size-baseline * 3;
30
+ border-bottom: 1px solid $mds-color-neutral-lighter;
19
31
  background-color: $mds-color-neutral-white;
20
32
 
21
33
  &.mds-combobox__option--focused,
@@ -23,5 +35,8 @@
23
35
  cursor: pointer;
24
36
  background-color: $mds-color-neutral-lighter;
25
37
  }
38
+ &:last {
39
+ border-bottom: none;
40
+ }
26
41
  }
27
42
  }
@@ -17,11 +17,11 @@
17
17
  :placeholder="placeholder"
18
18
  :aria-labelledby="labelId"
19
19
  :aria-owns="listBoxId"
20
- :aria-expanded="expanded"
20
+ :aria-expanded="ariaExpanded"
21
21
  :activeDescendent="selectedOptionId"
22
22
  v-model="inputValue"
23
23
  />
24
- <ListBox :id="listBoxId" :aria-labelledby="labelId" :hidden="listBoxHidden">
24
+ <ListBox :id="listBoxId" :aria-labelledby="labelId" :hidden="listBoxHidden" :isLoading="isLoading">
25
25
  <template>
26
26
  <ListBoxOption
27
27
  v-for="(option, index) in visibleOptions"
@@ -30,6 +30,7 @@
30
30
  :id="`${optionId}-${index}`"
31
31
  :focused="selectedOption === option"
32
32
  @mousedown="clickOption(option)"
33
+ :searchValue="searchValue"
33
34
  />
34
35
  </template>
35
36
  </ListBox>
@@ -80,15 +81,24 @@ export default {
80
81
  type: Boolean,
81
82
  default: true,
82
83
  },
84
+ iconpath: {
85
+ type: String,
86
+ default: '/assets/icons.svg',
87
+ },
83
88
  },
84
89
  data() {
85
90
  return {
86
- expanded: 'false',
91
+ expanded: false,
87
92
  selected: null,
88
93
  chosen: null,
89
94
  searchValue: this.$props.value,
90
95
  };
91
96
  },
97
+ provide() {
98
+ return {
99
+ iconPath: this.iconpath,
100
+ };
101
+ },
92
102
  computed: {
93
103
  inputValue: {
94
104
  get() {
@@ -138,6 +148,9 @@ export default {
138
148
  optionId() {
139
149
  return `${this.comboboxid}-option`;
140
150
  },
151
+ isLoading() {
152
+ return this.options.length === 0 && this.expanded;
153
+ },
141
154
  selectedOptionId() {
142
155
  const index = this.visibleOptions.indexOf(this.selectedOption);
143
156
  if (index > -1) {
@@ -146,7 +159,7 @@ export default {
146
159
  return false;
147
160
  },
148
161
  listBoxHidden() {
149
- return this.expanded === 'false' || this.visibleOptions.length === 0;
162
+ return !this.expanded;
150
163
  },
151
164
  lastOptionIndex() {
152
165
  return this.visibleOptions.length - 1;
@@ -157,13 +170,17 @@ export default {
157
170
  }
158
171
  return `${this.visibleOptions.length} ${this.resultmessage}`;
159
172
  },
173
+ ariaExpanded() {
174
+ // These must be strings to apply as an aria attribute of the same name
175
+ return this.expanded ? 'true' : 'false';
176
+ },
160
177
  },
161
178
  methods: {
162
179
  makeActive() {
163
- this.expanded = 'true';
180
+ this.expanded = true;
164
181
  },
165
182
  makeInactive() {
166
- this.expanded = 'false';
183
+ this.expanded = false;
167
184
  },
168
185
  clickOption(option = this.selectedOption) {
169
186
  this.chosenOption = option;
@@ -1,5 +1,13 @@
1
1
  <template>
2
2
  <ul class="mds-combobox__listbox" role="listbox" :hidden="hidden">
3
+ <li v-if="isLoading" class="mds-combobox-loading">
4
+ <!-- Ideally we would pass this in as a slot in the custom element with MdsIcon, but something is borked
5
+ with passing slots in Chrome https://github.com/karol-f/vue-custom-element/issues/162 -->
6
+ <svg aria-hidden="true" focusable="true" class="mds-icon mds-icon--spinner mds-icon--after">
7
+ <use :href="`${iconPath}#spinner`" />
8
+ </svg>
9
+ <span class="mds-visually-hidden">Loading...</span>
10
+ </li>
3
11
  <slot></slot>
4
12
  </ul>
5
13
  </template>
@@ -12,6 +20,11 @@ export default {
12
20
  type: Boolean,
13
21
  default: true,
14
22
  },
23
+ isLoading: {
24
+ type: Boolean,
25
+ default: true,
26
+ },
15
27
  },
28
+ inject: ['iconPath'],
16
29
  };
17
30
  </script>
@@ -5,9 +5,8 @@
5
5
  :class="{ 'mds-combobox__option--focused': focused }"
6
6
  :aria-selected="focused.toString()"
7
7
  @mousedown="$emit('mousedown', $event)"
8
- >
9
- {{ option.label }}
10
- </li>
8
+ v-html="highlightOption()"
9
+ />
11
10
  </template>
12
11
 
13
12
  <script>
@@ -22,6 +21,24 @@ export default {
22
21
  type: Boolean,
23
22
  default: false,
24
23
  },
24
+ searchValue: {
25
+ type: String,
26
+ default: '',
27
+ },
28
+ },
29
+ watch: {
30
+ searchValue(newSearchValue) {
31
+ return newSearchValue;
32
+ },
33
+ },
34
+ methods: {
35
+ highlightOption() {
36
+ const optionLabelHtml = this.option.label.replace(
37
+ new RegExp(this.searchValue, 'gi'),
38
+ (match) => `<span class="mds-combobox__option--marked">${match}</span>`
39
+ );
40
+ return optionLabelHtml;
41
+ },
25
42
  },
26
43
  };
27
44
  </script>
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  title: 'Multi-Select',
3
- status: 'prototype',
3
+ status: 'wip',
4
4
  context: {
5
5
  labelText: 'Role',
6
6
  name: 'Role',
@@ -32,15 +32,15 @@ module.exports = {
32
32
  value: "option-2",
33
33
  options: [
34
34
  {
35
- label: "Option 1",
35
+ labelText: "Option 1",
36
36
  value: "option-1",
37
37
  },
38
38
  {
39
- label: "Option 2",
39
+ labelText: "Option 2",
40
40
  value: "option-2",
41
41
  },
42
42
  {
43
- label: "Option 3",
43
+ labelText: "Option 3",
44
44
  value: "option-3",
45
45
  },
46
46
  ],
@@ -0,0 +1,11 @@
1
+ All pages must include a skip link at the top
2
+
3
+ Including the skip link component gives users the option to bypass the top-level navigation links and jump to the main content on a page.
4
+
5
+ The skip link component is visually hidden until a keyboard press activates it.
6
+
7
+ ## Parameters
8
+
9
+ - `text`: Text of the link, e.g: Skip to main content - **required**,
10
+ - `href`: id of the anchor - **required**,
11
+ - `accessKey`: default is 'S' but you can specify another key if you'd like - **optional**,
@@ -0,0 +1,3 @@
1
+ {% macro MdsSkipLink(params) %}
2
+ {%- include "./_template.njk" -%}
3
+ {% endmacro %}
@@ -0,0 +1,3 @@
1
+ <div class="mds-skip-to-content">
2
+ <a class="mds-skip-to-content__link" accesskey="{{ params.accessKey | default('S')}}" title="Access key: {{ params.accessKey | default('S')}}" href="{{ params.href }}">{{ params.text }}</a>
3
+ </div>
@@ -0,0 +1,8 @@
1
+ {% from "./skip-link/_macro.njk" import MdsSkipLink %}
2
+
3
+ <p>To view the skip link component tab to this example, or click inside this example and press tab.</p>
4
+
5
+ {{ MdsSkipLink({
6
+ text: "Skip to main content",
7
+ href: "#main"
8
+ }) }}
@@ -0,0 +1,16 @@
1
+ .mds-skip-to-content__link {
2
+ background-color: $mds-color-neutral-lightest;
3
+ border: 5px solid $mds-color-border;
4
+ @extend .mds-font-double-pica;
5
+ font-weight: bold;
6
+ left: -10000px;
7
+ padding: $mds-size-baseline * 6;
8
+ position: absolute;
9
+ text-align: center;
10
+ border-radius: $mds-size-border-radius;
11
+
12
+ &:focus {
13
+ left: 0;
14
+ @include z-index(modal);
15
+ }
16
+ }
@@ -1,46 +1,7 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- id="svg16"
9
- version="1.1"
10
- viewBox="0 0 24 24"
11
- height="24px"
12
- width="24px">
13
- <metadata
14
- id="metadata22">
15
- <rdf:RDF>
16
- <cc:Work
17
- rdf:about="">
18
- <dc:format>image/svg+xml</dc:format>
19
- <dc:type
20
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
21
- <dc:title>Icon / Left Chevron</dc:title>
22
- </cc:Work>
23
- </rdf:RDF>
24
- </metadata>
25
- <defs
26
- id="defs20" />
27
- <!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
28
- <title
29
- id="title10">Icon / Left Chevron</title>
30
- <desc
31
- id="desc12">Created with Sketch.</desc>
32
- <g
33
- transform="rotate(-90,11.983124,11.999999)"
34
- fill-rule="evenodd"
35
- fill="none"
36
- stroke-width="1"
37
- stroke="none"
38
- id="Icon-/-Left-Chevron">
39
- <path
40
- transform="rotate(-180,11.983124,12)"
41
- fill-rule="nonzero"
42
- fill="#000000"
43
- id="Shape"
44
- d="m 19.466249,12 c 8.17e-4,0.661702 -0.283393,1.291701 -0.780002,1.729 l -11.152,9.811 C 6.7656561,24.184929 5.6227738,24.098329 4.9601377,23.34495 4.2975015,22.591572 4.3574889,21.446984 5.095247,20.767 l 9.752,-8.579 c 0.05415,-0.04747 0.08521,-0.115986 0.08521,-0.188 0,-0.07201 -0.03105,-0.140531 -0.08521,-0.188 l -9.752,-8.579 C 4.3574889,2.5530156 4.2975015,1.408428 4.9601377,0.65504948 5.6227738,-0.098329 6.7656561,-0.18492928 7.534247,0.46 l 11.148,9.808 c 0.497811,0.438048 0.78337,1.0689 0.784002,1.732 z" />
45
- </g>
46
- </svg>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Icon/ Chevron/ D/ 12px_32</title>
4
+ <g id="Icon/-Chevron/-D/-12px_32" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <path d="M24.1012081,11.2189953 C24.9467637,10.308397 26.3704076,10.2556695 27.2810059,11.101225 C28.1088225,11.8699119 28.2276551,13.1163577 27.6071411,14.0207774 L27.3987762,14.2810228 L17.648784,24.7810143 C16.8327937,25.6597731 15.4899036,25.733003 14.5860966,25.000704 L14.351216,24.7810143 L4.6012238,14.2810228 C3.75566826,13.3704245 3.80839581,11.9467805 4.71899409,11.101225 C5.5468107,10.3325381 6.79863201,10.306234 7.65467282,10.9919502 L7.89879186,11.2189953 L16,19.942222 L24.1012081,11.2189953 Z" id="Path-2-Copy-15" fill="#001FFF" transform="translate(16.000000, 18.000000) scale(-1, 1) translate(-16.000000, -18.000000) "></path>
6
+ </g>
7
+ </svg>
@@ -1,9 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
4
- <title>Icon / Left Chevron</title>
5
- <desc>Created with Sketch.</desc>
6
- <g id="Icon-/-Left-Chevron" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
- <path d="M19.4662488,12 C19.467066,12.6617023 19.1828559,13.2917013 18.686247,13.729 L7.53424704,23.54 C6.76565608,24.1849293 5.62277383,24.098329 4.96013766,23.3449505 C4.29750148,22.591572 4.35748888,21.4469844 5.09524704,20.767 L14.847247,12.188 C14.9014018,12.1405308 14.9324563,12.0720143 14.9324563,12 C14.9324563,11.9279857 14.9014018,11.8594692 14.847247,11.812 L5.09524704,3.233 C4.35748888,2.55301564 4.29750148,1.40842796 4.96013766,0.655049482 C5.62277383,-0.0983289982 6.76565608,-0.184929277 7.53424704,0.46 L18.682247,10.268 C19.1800581,10.7060475 19.4656174,11.3369004 19.4662488,12 Z" id="Shape" fill="#000000" fill-rule="nonzero" transform="translate(11.983124, 12.000000) rotate(-180.000000) translate(-11.983124, -12.000000) "></path>
2
+ <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Icon/ Chevron/ L/ 12px_32</title>
4
+ <g id="Icon/-Chevron/-L/-12px_32" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <path d="M24.1012081,9.21899529 C24.9467637,8.30839702 26.3704076,8.25566946 27.2810059,9.101225 C28.1088225,9.86991186 28.2276551,11.1163577 27.6071411,12.0207774 L27.3987762,12.2810228 L17.648784,22.7810143 C16.8327937,23.6597731 15.4899036,23.733003 14.5860966,23.000704 L14.351216,22.7810143 L4.6012238,12.2810228 C3.75566826,11.3704245 3.80839581,9.94678055 4.71899409,9.101225 C5.5468107,8.33253815 6.79863201,8.30623401 7.65467282,8.99195019 L7.89879186,9.21899529 L16,17.942222 L24.1012081,9.21899529 Z" id="Path-2-Copy-15" fill="#001FFF" fill-rule="nonzero" transform="translate(16.000000, 16.000000) rotate(90.000000) translate(-16.000000, -16.000000) "></path>
8
6
  </g>
9
7
  </svg>
@@ -1,9 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
4
- <title>Icon / Right Chevron</title>
5
- <desc>Created with Sketch.</desc>
6
- <g id="Icon-/-Right-Chevron" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
- <path d="M19.5000018,12 C19.500819,12.6617023 19.2166089,13.2917013 18.72,13.729 L7.568,23.54 C6.79940904,24.1849293 5.65652679,24.098329 4.99389062,23.3449505 C4.33125444,22.591572 4.39124184,21.4469844 5.129,20.767 L14.881,12.188 C14.9351547,12.1405308 14.9662092,12.0720143 14.9662092,12 C14.9662092,11.9279857 14.9351547,11.8594692 14.881,11.812 L5.129,3.233 C4.39124184,2.55301564 4.33125444,1.40842796 4.99389062,0.655049482 C5.65652679,-0.0983289982 6.79940904,-0.184929277 7.568,0.46 L18.716,10.268 C19.213811,10.7060475 19.4993703,11.3369004 19.5000018,12 Z" id="Shape" fill="#000000" fill-rule="nonzero"></path>
2
+ <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Icon/ Chevron/ R/ 12px_32</title>
4
+ <g id="Icon/-Chevron/-R/-12px_32" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <path d="M24.1012081,9.21899529 C24.9467637,8.30839702 26.3704076,8.25566946 27.2810059,9.101225 C28.1088225,9.86991186 28.2276551,11.1163577 27.6071411,12.0207774 L27.3987762,12.2810228 L17.648784,22.7810143 C16.8327937,23.6597731 15.4899036,23.733003 14.5860966,23.000704 L14.351216,22.7810143 L4.6012238,12.2810228 C3.75566826,11.3704245 3.80839581,9.94678055 4.71899409,9.101225 C5.5468107,8.33253815 6.79863201,8.30623401 7.65467282,8.99195019 L7.89879186,9.21899529 L16,17.942222 L24.1012081,9.21899529 Z" id="Path-2-Copy-15" fill="#001FFF" fill-rule="nonzero" transform="translate(16.000000, 16.000000) scale(-1, 1) rotate(90.000000) translate(-16.000000, -16.000000) "></path>
8
6
  </g>
9
7
  </svg>
@@ -1,46 +1,7 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- id="svg16"
9
- version="1.1"
10
- viewBox="0 0 24 24"
11
- height="24px"
12
- width="24px">
13
- <metadata
14
- id="metadata22">
15
- <rdf:RDF>
16
- <cc:Work
17
- rdf:about="">
18
- <dc:format>image/svg+xml</dc:format>
19
- <dc:type
20
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
21
- <dc:title>Icon / Left Chevron</dc:title>
22
- </cc:Work>
23
- </rdf:RDF>
24
- </metadata>
25
- <defs
26
- id="defs20" />
27
- <!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
28
- <title
29
- id="title10">Icon / Left Chevron</title>
30
- <desc
31
- id="desc12">Created with Sketch.</desc>
32
- <g
33
- transform="rotate(90,11.983124,12)"
34
- fill-rule="evenodd"
35
- fill="none"
36
- stroke-width="1"
37
- stroke="none"
38
- id="Icon-/-Left-Chevron">
39
- <path
40
- transform="rotate(-180,11.983124,12)"
41
- fill-rule="nonzero"
42
- fill="#000000"
43
- id="Shape"
44
- d="m 19.466249,12 c 8.17e-4,0.661702 -0.283393,1.291701 -0.780002,1.729 l -11.152,9.811 C 6.7656561,24.184929 5.6227738,24.098329 4.9601377,23.34495 4.2975015,22.591572 4.3574889,21.446984 5.095247,20.767 l 9.752,-8.579 c 0.05415,-0.04747 0.08521,-0.115986 0.08521,-0.188 0,-0.07201 -0.03105,-0.140531 -0.08521,-0.188 l -9.752,-8.579 C 4.3574889,2.5530156 4.2975015,1.408428 4.9601377,0.65504948 5.6227738,-0.098329 6.7656561,-0.18492928 7.534247,0.46 l 11.148,9.808 c 0.497811,0.438048 0.78337,1.0689 0.784002,1.732 z" />
45
- </g>
46
- </svg>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Icon/ Chevron/ U/ 12px_32</title>
4
+ <g id="Icon/-Chevron/-U/-12px_32" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <path d="M24.1012081,11.2189953 C24.9467637,10.308397 26.3704076,10.2556695 27.2810059,11.101225 C28.1088225,11.8699119 28.2276551,13.1163577 27.6071411,14.0207774 L27.3987762,14.2810228 L17.648784,24.7810143 C16.8327937,25.6597731 15.4899036,25.733003 14.5860966,25.000704 L14.351216,24.7810143 L4.6012238,14.2810228 C3.75566826,13.3704245 3.80839581,11.9467805 4.71899409,11.101225 C5.5468107,10.3325381 6.79863201,10.306234 7.65467282,10.9919502 L7.89879186,11.2189953 L16,19.942222 L24.1012081,11.2189953 Z" id="Path-2-Copy-15" fill="#001FFF" transform="translate(16.000000, 18.000000) scale(-1, -1) translate(-16.000000, -18.000000) "></path>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Icon/ x/ 12px_32</title>
4
+ <g id="Icon/-x/-12px_32" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <path d="M22.8466361,5.98095681 C23.7306343,5.22381788 25.0626572,5.2636673 25.8994949,6.10050506 C26.7781746,6.97918472 26.7781746,8.40380592 25.8994949,9.28248558 L25.8994949,9.28248558 L19.1804953,15.9994953 L25.8994949,22.7175144 C26.7781746,23.5961941 26.7781746,25.0208153 25.8994949,25.8994949 C25.0626572,26.7363327 23.7306343,26.7761821 22.8466361,26.0190432 L22.7175144,25.8994949 L15.9994953,19.1804953 L9.28248558,25.8994949 L9.15336393,26.0190432 C8.26936568,26.7761821 6.93734283,26.7363327 6.10050506,25.8994949 C5.22182541,25.0208153 5.22182541,23.5961941 6.10050506,22.7175144 L6.10050506,22.7175144 L12.8184953,15.9994953 L6.10050506,9.28248558 C5.22182541,8.40380592 5.22182541,6.97918472 6.10050506,6.10050506 C6.93734283,5.2636673 8.26936568,5.22381788 9.15336393,5.98095681 L9.28248558,6.10050506 L15.9994953,12.8184953 L22.7175144,6.10050506 Z" id="Combined-Shape" fill="#001FFF"></path>
6
+ </g>
7
+ </svg>