@madgex/design-system 1.65.2 → 1.65.3

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 (55) hide show
  1. package/__tests__/unit/src/components/accordion.spec.js +1 -1
  2. package/__tests__/unit/src/components/combobox.spec.js +0 -9
  3. package/coverage/cobertura-coverage.xml +163 -179
  4. package/coverage/components/accordion/accordion.js.html +8 -14
  5. package/coverage/components/accordion/index.html +11 -11
  6. package/coverage/components/inputs/combobox/combobox.js.html +11 -5
  7. package/coverage/components/inputs/combobox/index.html +7 -7
  8. package/coverage/components/inputs/combobox/vue-components/Combobox.vue.html +30 -42
  9. package/coverage/components/inputs/combobox/vue-components/ListBoxOption.vue.html +4 -4
  10. package/coverage/components/inputs/combobox/vue-components/index.html +16 -16
  11. package/coverage/components/inputs/file-upload/file-upload.js.html +1 -1
  12. package/coverage/components/inputs/file-upload/index.html +1 -1
  13. package/coverage/components/inputs/textarea/character-count.js.html +1 -1
  14. package/coverage/components/inputs/textarea/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 +27 -27
  26. package/coverage/js/common.js.html +1 -1
  27. package/coverage/js/fractal-scripts/combobox.js.html +21 -18
  28. package/coverage/js/fractal-scripts/index.html +9 -9
  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/arrayPrototypeFind.js.html +1 -1
  37. package/coverage/js/polyfills/closest.js.html +1 -1
  38. package/coverage/js/polyfills/index.html +1 -1
  39. package/coverage/js/polyfills/objectAssign.js.html +1 -1
  40. package/coverage/js/polyfills/remove.js.html +1 -1
  41. package/coverage/tokens/_config.js.html +1 -1
  42. package/coverage/tokens/index.html +1 -1
  43. package/dist/_tokens/css/_tokens.css +3 -3
  44. package/dist/_tokens/js/_tokens-module.js +5 -5
  45. package/dist/_tokens/scss/_tokens.scss +3 -3
  46. package/dist/assets/icons.json +1 -1
  47. package/dist/css/index.css +1 -1
  48. package/dist/js/index.js +4 -4
  49. package/package.json +1 -1
  50. package/src/components/accordion/accordion.js +2 -4
  51. package/src/components/inputs/combobox/_template.njk +1 -1
  52. package/src/components/inputs/combobox/combobox.js +2 -0
  53. package/src/components/inputs/combobox/vue-components/Combobox.vue +1 -5
  54. package/src/js/fractal-scripts/combobox.js +8 -7
  55. package/src/tokens/color.json +2 -2
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.65.2",
5
+ "version": "1.65.3",
6
6
  "scripts": {
7
7
  "clean": "rimraf dist public tokens/build",
8
8
  "commit": "commit",
@@ -59,11 +59,10 @@ const accordion = {
59
59
  },
60
60
  setAccordion: (accordionTrigger, accordionContent) => {
61
61
  const triggerContainer = accordionTrigger;
62
- const accordionTriggerId = triggerContainer.id;
63
62
  const label = triggerContainer.querySelector('.mds-accordion-trigger__label');
64
63
  const labelText = label.innerText;
65
64
  const isNonClosing = accordionTrigger.classList.contains(accordionNonClosingClass);
66
- const triggerButton = accordion.createButton(accordionTriggerId, triggerContainer);
65
+ const triggerButton = accordion.createButton(triggerContainer);
67
66
  triggerContainer.classList.remove('mds-display-none');
68
67
  if (accordionContent.nodeName.toLowerCase() !== 'fieldset') {
69
68
  accordionContent.setAttribute('aria-label', labelText);
@@ -79,7 +78,7 @@ const accordion = {
79
78
  accordion.toggleExpand(triggerButton, triggerContainer, accordionContent, isNonClosing);
80
79
  });
81
80
  },
82
- createButton: (accordionTriggerId, element) => {
81
+ createButton: (element) => {
83
82
  const accordionTriggerSpan = element.querySelector(`.${accordionTriggerClass} > span`);
84
83
  const accordionTriggerButton = document.createElement('button');
85
84
  accordionTriggerButton.className = accordionTriggerButtonClass;
@@ -87,7 +86,6 @@ const accordion = {
87
86
  accordionTriggerButton.classList.add('mds-button');
88
87
  accordionTriggerButton.classList.add('mds-button--plain');
89
88
  accordionTriggerButton.classList.add('mds-padding-b0');
90
- accordionTriggerButton.setAttribute('id', accordionTriggerId);
91
89
  accordionTriggerButton.setAttribute('aria-expanded', false);
92
90
  if (accordionTriggerSpan) {
93
91
  accordionTriggerButton.appendChild(accordionTriggerSpan);
@@ -44,7 +44,7 @@
44
44
  }) }}
45
45
  <div class="mds-form-element__fallback">
46
46
  {% if params.fallbackTo === 'select' and params.options %}
47
- <select class="mds-form-control" id="select-{{ comboboxId }}" name="{{ comboboxName }}" aria-labelledby="{{ comboboxId }}-label" value="{{ params.defaultValue|default('') }}" {% if params.validationError %} aria-invalid="true" {% else %} aria-invalid="false" {% endif %} {% if not params.optional %} aria-required="true" {% endif %} >
47
+ <select class="mds-form-control" id="{{ comboboxId }}" name="{{ comboboxName }}" value="{{ params.defaultValue|default('') }}" {% if params.validationError %} aria-invalid="true" {% else %} aria-invalid="false" {% endif %} {% if not params.optional %} aria-required="true" {% endif %} >
48
48
  <option>{{ placeholder }}</option>
49
49
  {%- if params.options -%}
50
50
  {%- for value, option in params.options -%}
@@ -7,8 +7,10 @@ export default {
7
7
  connectedCallback() {
8
8
  // If the custom element has loaded, clear up any fallback elements that could cause ID clashes or weirdness in form submission
9
9
  const fallbackInput = this.parentElement.querySelector('input');
10
+ const fallbackSelect = this.parentElement.querySelector('select');
10
11
 
11
12
  if (fallbackInput) fallbackInput.remove();
13
+ if (fallbackSelect) fallbackSelect.removeAttribute('id');
12
14
  },
13
15
  },
14
16
  };
@@ -15,7 +15,6 @@
15
15
  :id="comboboxid"
16
16
  :name="name"
17
17
  :placeholder="placeholder"
18
- :aria-labelledby="labelId"
19
18
  :aria-owns="listBoxId"
20
19
  :aria-expanded="ariaExpanded"
21
20
  :activeDescendent="selectedOptionId"
@@ -23,7 +22,7 @@
23
22
  :isRequired="dataRequired"
24
23
  v-model="inputValue"
25
24
  />
26
- <ListBox :id="listBoxId" :aria-labelledby="labelId" :hidden="listBoxHidden" :isLoading="isLoading">
25
+ <ListBox :id="listBoxId" :hidden="listBoxHidden" :isLoading="isLoading">
27
26
  <template>
28
27
  <ListBoxOption
29
28
  v-for="(option, index) in visibleOptions"
@@ -147,9 +146,6 @@ export default {
147
146
  }
148
147
  return this.options;
149
148
  },
150
- labelId() {
151
- return `${this.comboboxid}-label`;
152
- },
153
149
  listBoxId() {
154
150
  return `${this.comboboxid}-listbox`;
155
151
  },
@@ -3,16 +3,17 @@ const elementName = 'mds-combobox';
3
3
  function bindToSelect() {
4
4
  const el = document.querySelector(`[data-combobox-id="distance-selection"]`);
5
5
  if (el) {
6
- const selectInput = document.getElementById('select-distance-selection');
6
+ const selectInput = el.querySelector('select');
7
7
  const options = Array.from(selectInput.querySelectorAll('option'));
8
8
  const vueSelect = el.querySelector(elementName);
9
9
  vueSelect.options = options.slice(1).map((opt) => ({ value: opt.value, label: opt.textContent }));
10
- vueSelect.addEventListener('select-option', (event) => {
11
- const [option] = event.detail;
12
- if (!option) return;
13
- selectInput.value = option.value;
14
- selectInput.querySelector(`option[value="${option.value}"]`).setAttribute('selected', true);
15
- });
10
+ // not sure it's needed ?
11
+ // vueSelect.addEventListener('select-option', (event) => {
12
+ // const [option] = event.detail;
13
+ // if (!option) return;
14
+ // selectInput.value = option.value;
15
+ // selectInput.querySelector(`option[value="${option.value}"]`).setAttribute('selected', true);
16
+ // });
16
17
  }
17
18
  }
18
19
 
@@ -82,7 +82,7 @@
82
82
  "value" : "#549b24"
83
83
  },
84
84
  "darkest": {
85
- "value" : "#45801d"
85
+ "value" : "#40791B"
86
86
  },
87
87
  "base": {
88
88
  "value" : "#5ba927"
@@ -99,7 +99,7 @@
99
99
  "value" : "#f4aa08"
100
100
  },
101
101
  "darkest": {
102
- "value" : "#d99500"
102
+ "value" : "#946500"
103
103
  },
104
104
  "base": {
105
105
  "value" : "#ffb411"