@qhealth-design-system/core 1.8.2 → 1.8.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.8.3 - 2024-08-19
11
+
10
12
  ## 1.8.2 - 2024-08-16
11
13
 
12
14
  ## 1.8.1 - 2024-08-15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qhealth-design-system/core",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "",
5
5
  "licence": "MIT",
6
6
  "main": "index.js",
@@ -38,46 +38,3 @@ body {
38
38
  z-index: 3;
39
39
  }
40
40
  }
41
-
42
-
43
- /*
44
- Written to address squiz forms' error state issues
45
- */
46
-
47
- div.sq-form-question-tickbox-list.sq-form-question-error {
48
- fieldset {
49
- label::before {
50
- box-shadow: 0 0 0 3px $QLD-color-status__error;
51
- }
52
- }
53
- }
54
-
55
- div.sq-form-question-option-list.sq-form-question-error {
56
- fieldset {
57
- label::before {
58
- box-shadow: 0 0 0 3px $QLD-color-status__error;
59
- }
60
- }
61
- }
62
-
63
- div.sq-form-question-error {
64
- input[type=text]:not(:focus),
65
- input[type=email]:not(:focus),
66
- input[type=date]:not(:focus),
67
- textarea:not(:focus),
68
- select:not(:focus) {
69
- border-color: $QLD-color-status__error;
70
- background-color: $QLD-color-status__error--lightest;
71
- }
72
- }
73
-
74
- .qld__body--dark, .qld__body--dark-alt {
75
- .sq-form-error {
76
- color: $QLD-color-status__error--lightest;
77
- }
78
- }
79
-
80
- .sq-form-error {
81
- color: $QLD-color-status__error;
82
- margin-top: 0.5rem !important;
83
- }
@@ -17,7 +17,7 @@
17
17
  }
18
18
  & &__list--desktop{
19
19
  display: none;
20
- @include QLD-media(md) {
20
+ @include QLD-media(lg) {
21
21
  display: flex;
22
22
  flex-direction: row;
23
23
  flex-wrap: wrap;
@@ -25,13 +25,13 @@
25
25
  }
26
26
  }
27
27
  & &__list--mobile{
28
- @include QLD-media(md) {
28
+ @include QLD-media(lg) {
29
29
  display: none;
30
30
  }
31
31
  }
32
32
  .qld__link-list.qld__link-list--inline:not(.qld__breadcrumbs .qld__breadcrumbs__list--mobile, .qld__banner__breadcrumbs--mobile ul) {
33
33
  display: none;
34
- @include QLD-media(md) {
34
+ @include QLD-media(lg) {
35
35
  display: flex;
36
36
  flex-direction: row;
37
37
  flex-wrap: nowrap;
@@ -68,12 +68,6 @@
68
68
  @include QLD-underline('light','underline','default','noVisited');
69
69
  color: var(--QLD-color-light__link);
70
70
  }
71
-
72
- // .qld__icon{
73
- // @include QLD-space(margin, 0 0.5unit);
74
- // color: var(--QLD-color-light__action--secondary);
75
- // @include QLD-space(height, 1unit);
76
- // }
77
71
 
78
72
  &:after {
79
73
  content: " ";
@@ -93,18 +87,16 @@
93
87
 
94
88
  &:last-child {
95
89
  display: flex;
96
- flex-grow: 1;
97
- // overflow: hidden;
98
90
  white-space: wrap;
99
91
  text-overflow: ellipsis;
100
- flex: 1 1 auto;
92
+ flex: 0 1 auto;
101
93
  flex-shrink: 3;
102
94
 
103
95
  &:after {
104
96
  display: none;
105
97
  }
106
98
 
107
- @include QLD-media(md) {
99
+ @include QLD-media(lg) {
108
100
 
109
101
  white-space: nowrap;
110
102
  }
@@ -162,7 +154,7 @@
162
154
  @include QLD-space(padding, 1unit 1unit);
163
155
  margin: 0;
164
156
 
165
- @include QLD-media(md) {
157
+ @include QLD-media(lg) {
166
158
  display: none;
167
159
  }
168
160
 
@@ -184,7 +176,7 @@
184
176
  .qld__banner__breadcrumbs--desktop {
185
177
  display: none;
186
178
 
187
- @include QLD-media(md) {
179
+ @include QLD-media(lg) {
188
180
  @include QLD-space(margin, 0 0 1rem);
189
181
  display: inline-block;
190
182
  > .qld__link-list > li {
@@ -223,7 +215,7 @@
223
215
  }
224
216
 
225
217
  ~ *:last-child {
226
- @include QLD-media(md) {
218
+ @include QLD-media(lg) {
227
219
  @include QLD-space(margin-bottom, auto);
228
220
  }
229
221
  }
@@ -9,11 +9,6 @@
9
9
  var originalBreadCrumbUl = null;
10
10
 
11
11
  function getTheElements(resized = false) {
12
- // const banner =
13
- // document.querySelector(".qld__banner--breadcrumbs") ||
14
- // document.querySelector(".qld__body--breadcrumb");
15
-
16
- // if (document) {
17
12
  const bannerBreadCrumbsAll = document.querySelectorAll(
18
13
  "nav.qld__banner__breadcrumbs--desktop"
19
14
  );
@@ -34,12 +29,9 @@
34
29
 
35
30
  const containerFluidStyle = window.getComputedStyle(containerFluid);
36
31
 
37
- const paddings = parseFloat(containerFluidStyle.getPropertyValue('padding-right').replace(/\D/g, '')) + parseFloat(containerFluidStyle.getPropertyValue('padding-left').replace(/\D/g, ''));
32
+ const paddings = parseFloat(containerFluidStyle.getPropertyValue('padding-right').replace(/[^\d.]/g, '')) + parseFloat(containerFluidStyle.getPropertyValue('padding-left').replace(/[^\d.]/g, ''));
38
33
  bannerBreadCrumb.style.maxWidth = (containerFluid.offsetWidth - paddings) + 'px';
39
34
 
40
-
41
- // console.log('here is the containerFluid.offsetWidth ', paddings , ' here is the containerFluid.offsetWidth ', bannerBreadCrumb)
42
-
43
35
  if(!originalBreadCrumbUl) {
44
36
  originalBreadCrumbUl = bannerBreadCrumb.querySelector("ul.qld__link-list").cloneNode(true);
45
37
  }
@@ -56,22 +48,13 @@
56
48
  breadCrumbsUl,
57
49
  };
58
50
  }
59
-
60
-
61
- // }
62
-
63
- // return null;
64
51
  }
65
52
 
66
53
  function createOverFlow() {
67
- //create the over flow menu here:
68
54
 
69
- //start wrapper
70
55
  const overFlowWrapper = document.createElement("div");
71
56
  overFlowWrapper.className = "qld__overflow_menu_wrapper";
72
- //end wrapper
73
57
 
74
- //start overflow button
75
58
  const button = document.createElement("button");
76
59
  button.className =
77
60
  "qld__btn qld__btn--toggle qld__overflow_menu__btn qld__accordion--closed";
@@ -105,11 +88,9 @@
105
88
 
106
89
  svg.appendChild(path);
107
90
  button.appendChild(svg);
108
- //end overflow button
109
91
 
110
92
  overFlowWrapper.appendChild(button);
111
93
 
112
- // Start menu element
113
94
  const div = document.createElement("div");
114
95
  div.className = "qld__overflow_menu qld__accordion--closed";
115
96
  div.setAttribute("id", "overflow-menu--");
@@ -119,12 +100,9 @@
119
100
  ul.setAttribute("aria-label", "qld__overflow_menu qld__link-columns");
120
101
 
121
102
  div.appendChild(ul);
122
- //end menu
123
103
 
124
104
  overFlowWrapper.appendChild(div);
125
105
 
126
- //This menu does not have the uls , uls are going to be created in insertfunction
127
-
128
106
  return overFlowWrapper;
129
107
  }
130
108
 
@@ -154,7 +132,6 @@
154
132
  breadCrumbsUlLis[1].className = "qld__overflow_menu--breadcrumbs";
155
133
  breadCrumbsUlLis[1].appendChild(overflowMenu);
156
134
  breadCrumbsUlLis[1].style.display = "flex";
157
- truncateLastLi(breadCrumbsUlLis, breadcrumbUL);
158
135
  }
159
136
 
160
137
  breadcrumb.init = function () {
@@ -162,7 +139,6 @@
162
139
  const { breadCrumbsUl } = getTheElements();
163
140
 
164
141
  const breadCrumbsUlLis = breadCrumbsUl.querySelectorAll("li");
165
- // if (breadCrumbsUl.offsetHeight > breadCrumbsUlLis[0].offsetHeight && breadCrumbsUlLis.length > 2 && breadCrumbsUlLis[0].offsetHeight > 0) {
166
142
  if (breadCrumbsUlLis.length > 2 && breadCrumbsUlLis[0].offsetHeight > 0) {
167
143
  const overflowMenu = createOverFlow();
168
144
  let breadcrumbLisLength = breadCrumbsUlLis.length;
@@ -175,8 +151,7 @@
175
151
  totalLisOffsetWidth += breadCrumbsUlLis[i].offsetWidth;
176
152
  }
177
153
 
178
- if(breadCrumbsUlLis.length > 5) {
179
-
154
+ if(breadcrumbLisLength > 5) {
180
155
  insertOverFlowButton(overflowMenu, breadCrumbsUlLis[1]);
181
156
  breadCrumbsUlLis[1].style.display = "none";
182
157
  appendOverflow(breadCrumbsUlLis, overflowMenu, breadCrumbsUl);
@@ -190,9 +165,12 @@
190
165
 
191
166
  } else if((breadCrumbsUl.offsetHeight > (breadCrumbsUlLis[0].offsetHeight * 1.9))) {
192
167
 
193
- insertOverFlowButton(overflowMenu, breadCrumbsUlLis[1]);
194
- breadCrumbsUlLis[1].style.display = "none";
195
- appendOverflow(breadCrumbsUlLis, overflowMenu, breadCrumbsUl);
168
+ if(breadcrumbLisLength > 3) {
169
+ insertOverFlowButton(overflowMenu, breadCrumbsUlLis[1]);
170
+ breadCrumbsUlLis[1].style.display = "none";
171
+ appendOverflow(breadCrumbsUlLis, overflowMenu, breadCrumbsUl);
172
+ }
173
+
196
174
  i = 2;
197
175
 
198
176
  while ((breadCrumbsUl.offsetHeight > (breadCrumbsUlLis[0].offsetHeight * 1.9)) &&
@@ -204,23 +182,27 @@
204
182
 
205
183
  i++;
206
184
  }
207
- } else if(parseFloat(breadCrumbsUl.style.maxWidth.replace(/\D/g, '')) < totalLisOffsetWidth) {
208
-
209
- insertOverFlowButton(overflowMenu, breadCrumbsUlLis[1]);
210
- breadCrumbsUlLis[1].style.display = "none";
211
- appendOverflow(breadCrumbsUlLis, overflowMenu, breadCrumbsUl);
185
+ } else if(parseFloat(breadCrumbsUl.style.maxWidth.replace(/[^\d.]/g, '')) < totalLisOffsetWidth) {
186
+
187
+ if(breadcrumbLisLength > 3) {
188
+ insertOverFlowButton(overflowMenu, breadCrumbsUlLis[1]);
189
+ breadCrumbsUlLis[1].style.display = "none";
190
+ appendOverflow(breadCrumbsUlLis, overflowMenu, breadCrumbsUl);
191
+ }
192
+
212
193
  i = 2;
213
194
 
214
- while ((parseFloat(breadCrumbsUl.style.maxWidth.replace(/\D/g, ''))< totalLisOffsetWidth) &&
195
+ while ((parseFloat(breadCrumbsUl.style.maxWidth.replace(/[^\d.]/g, ''))< totalLisOffsetWidth) &&
215
196
  (i < breadcrumbLisLength - 2)
216
197
  ) {
217
198
 
218
199
  insertOverFlowButton(overflowMenu, breadCrumbsUlLis[i]);
219
200
  breadCrumbsUlLis[i].style.display = "none";
220
-
221
201
  i++;
222
202
  }
223
203
  }
204
+
205
+ truncateLastLi(breadCrumbsUlLis, breadCrumbsUl);
224
206
  }
225
207
  }
226
208
  };
@@ -674,4 +674,46 @@ select.qld__text-input--block.qld__field-width--1-quarter {
674
674
  select.qld__text-input--block.qld__field-width--3-quarters {
675
675
  max-width:$QLD-fluid-width__3-quarters;
676
676
  }
677
+ }
678
+
679
+
680
+ /*
681
+ Written to address squiz forms' error state issues
682
+ */
683
+
684
+ div.sq-form-question-tickbox-list.sq-form-question-error {
685
+ fieldset {
686
+ label::before {
687
+ box-shadow: 0 0 0 3px $QLD-color-status__error;
688
+ }
689
+ }
690
+ }
691
+
692
+ div.sq-form-question-option-list.sq-form-question-error {
693
+ fieldset {
694
+ label::before {
695
+ box-shadow: 0 0 0 3px $QLD-color-status__error;
696
+ }
697
+ }
698
+ }
699
+
700
+ div.sq-form-question-error {
701
+ input[type=text]:not(:focus),
702
+ input[type=email]:not(:focus),
703
+ input[type=date]:not(:focus),
704
+ textarea:not(:focus),
705
+ select:not(:focus) {
706
+ border-color: $QLD-color-status__error;
707
+ background-color: $QLD-color-status__error--lightest;
708
+ }
709
+ }
710
+
711
+ .qld__body--dark, .qld__body--dark-alt {
712
+ .sq-form-error {
713
+ color: $QLD-color-status__error--lightest;
714
+ }
715
+ }
716
+
717
+ .sq-form-error {
718
+ color: $QLD-color-status__error;
677
719
  }