@qld-gov-au/qgds-bootstrap5 1.1.40 → 2.0.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 (184) hide show
  1. package/.eslintrc.cjs +27 -27
  2. package/.vscode/settings.json +5 -5
  3. package/dist/assets/components/bs5/button/button.hbs +48 -30
  4. package/dist/assets/components/bs5/card/card.hbs +3 -17
  5. package/dist/assets/components/bs5/containerLayout/containerLayout.hbs +100 -0
  6. package/dist/assets/components/bs5/footer/customLinks.hbs +7 -0
  7. package/dist/assets/components/bs5/footer/feedbackForm.hbs +25 -0
  8. package/dist/assets/components/bs5/footer/followLinks.hbs +14 -0
  9. package/dist/assets/components/bs5/footer/footer.hbs +229 -346
  10. package/dist/assets/components/bs5/formcheck/formcheck.hbs +1 -1
  11. package/dist/assets/components/bs5/head/head.hbs +4 -4
  12. package/dist/assets/components/bs5/header/header.hbs +124 -878
  13. package/dist/assets/components/bs5/header/headerBrand.hbs +35 -0
  14. package/dist/assets/components/bs5/link/link.hbs +41 -0
  15. package/dist/assets/components/bs5/logo/logoCOALandscape.hbs +110 -55
  16. package/dist/assets/components/bs5/logo/logoCOALandscape2Lines.hbs +2 -1
  17. package/dist/assets/components/bs5/navbar/navbar.hbs +65 -245
  18. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithForm.hbs +53 -22
  19. package/dist/assets/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +79 -59
  20. package/dist/assets/components/bs5/pageLayout/templates/homePage.hbs +111 -0
  21. package/dist/assets/components/bs5/searchInput/searchInput.hbs +9 -11
  22. package/dist/assets/css/qld.bootstrap.css +1 -1
  23. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  24. package/dist/assets/js/bootstrap.bundle.js +3 -6
  25. package/dist/assets/js/bootstrap.bundle.js.map +1 -1
  26. package/dist/assets/js/bootstrap.bundle.min.js +2 -2
  27. package/dist/assets/js/bootstrap.bundle.min.js.map +1 -1
  28. package/dist/assets/js/bootstrap.js +3 -6
  29. package/dist/assets/js/bootstrap.min.js +2 -2
  30. package/dist/assets/js/bootstrap.min.js.map +1 -1
  31. package/dist/assets/js/handlebars.helpers.bundle.js.map +2 -2
  32. package/dist/assets/js/handlebars.helpers.js +34 -34
  33. package/dist/assets/js/handlebars.init.min.js +1055 -2041
  34. package/dist/assets/js/handlebars.init.min.js.map +4 -4
  35. package/dist/assets/js/handlebars.partials.js +14 -6
  36. package/dist/assets/js/qld.bootstrap.min.js +9 -9
  37. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  38. package/dist/assets/node/handlebars.init.min.js +538 -108
  39. package/dist/assets/node/handlebars.init.min.js.map +3 -3
  40. package/dist/components/bs5/button/button.hbs +48 -30
  41. package/dist/components/bs5/card/card.hbs +3 -17
  42. package/dist/components/bs5/containerLayout/containerLayout.hbs +100 -0
  43. package/dist/components/bs5/footer/customLinks.hbs +7 -0
  44. package/dist/components/bs5/footer/feedbackForm.hbs +25 -0
  45. package/dist/components/bs5/footer/followLinks.hbs +14 -0
  46. package/dist/components/bs5/footer/footer.hbs +229 -346
  47. package/dist/components/bs5/formcheck/formcheck.hbs +1 -1
  48. package/dist/components/bs5/head/head.hbs +4 -4
  49. package/dist/components/bs5/header/header.hbs +124 -878
  50. package/dist/components/bs5/header/headerBrand.hbs +35 -0
  51. package/dist/components/bs5/link/link.hbs +41 -0
  52. package/dist/components/bs5/logo/logoCOALandscape.hbs +110 -55
  53. package/dist/components/bs5/logo/logoCOALandscape2Lines.hbs +2 -1
  54. package/dist/components/bs5/navbar/navbar.hbs +65 -245
  55. package/dist/components/bs5/pageLayout/templates/contentPageWithForm.hbs +53 -22
  56. package/dist/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +79 -59
  57. package/dist/components/bs5/pageLayout/templates/homePage.hbs +111 -0
  58. package/dist/components/bs5/searchInput/searchInput.hbs +9 -11
  59. package/dist/components/handlebars.helpers.js +34 -34
  60. package/dist/components/handlebars.partials.js +14 -6
  61. package/dist/package.json +2 -2
  62. package/dist/sample-data/button/button.data.json +10 -8
  63. package/dist/sample-data/footer/footer.data.json +128 -84
  64. package/dist/sample-data/formcheck/stories/checkbox/checkbox.data.json +51 -46
  65. package/dist/sample-data/formcheck/stories/radio/radio.data.json +51 -46
  66. package/dist/sample-data/header/header.variant.coBrand.data.json +28 -40
  67. package/dist/sample-data/header/header.variant.endorsed.data.json +116 -150
  68. package/dist/sample-data/header/header.variant.masterBrand.data.json +116 -152
  69. package/dist/sample-data/header/header.variant.standAlone.data.json +118 -150
  70. package/dist/sample-data/header/header.variant.subBrand.data.json +32 -159
  71. package/dist/sample-data/inpageAlert/inpageAlert.data.json +6 -6
  72. package/dist/sample-data/link/link.data.json +77 -0
  73. package/dist/sample-data/logo/logo.data.json +1 -0
  74. package/dist/sample-data/navbar/navbar.data.json +191 -0
  75. package/dist/sample-data/searchInput/searchInput.data.json +2 -3
  76. package/dist/sample-data/tabs/tabs.data.json +45 -44
  77. package/package.json +2 -2
  78. package/src/components/bs5/accordion/Accordion.mdx +8 -2
  79. package/src/components/bs5/banner/Banner.mdx +6 -1
  80. package/src/components/bs5/banner/banner.scss +16 -9
  81. package/src/components/bs5/banner/banner.stories.js +17 -17
  82. package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +8 -2
  83. package/src/components/bs5/breadcrumbs/breadcrumbs.functions.js +2 -0
  84. package/src/components/bs5/breadcrumbs/breadcrumbs.scss +1 -1
  85. package/src/components/bs5/button/button.data.json +10 -8
  86. package/src/components/bs5/button/button.hbs +48 -30
  87. package/src/components/bs5/button/button.scss +61 -0
  88. package/src/components/bs5/button/button.stories.js +29 -10
  89. package/src/components/bs5/callToAction/callToAction.mdx +8 -3
  90. package/src/components/bs5/card/Card.mdx +8 -2
  91. package/src/components/bs5/card/card.hbs +3 -17
  92. package/src/components/bs5/card/card.scss +103 -103
  93. package/src/components/bs5/containerLayout/containerLayout.hbs +100 -0
  94. package/src/components/bs5/containerLayout/containerLayout.stories.js +83 -0
  95. package/src/components/bs5/footer/Footer.js +3 -3
  96. package/src/components/bs5/footer/Footer.mdx +8 -2
  97. package/src/components/bs5/footer/customLinks.hbs +7 -0
  98. package/src/components/bs5/footer/feedbackForm.hbs +25 -0
  99. package/src/components/bs5/footer/followLinks.hbs +14 -0
  100. package/src/components/bs5/footer/footer.data.json +128 -84
  101. package/src/components/bs5/footer/footer.functions.js +2 -1
  102. package/src/components/bs5/footer/footer.hbs +229 -346
  103. package/src/components/bs5/footer/footer.scss +262 -272
  104. package/src/components/bs5/footer/footer.stories.js +4 -92
  105. package/src/components/bs5/footer/footer_formio.scss +219 -0
  106. package/src/components/bs5/formcheck/formcheck.hbs +1 -1
  107. package/src/components/bs5/formcheck/formcheck.scss +161 -139
  108. package/src/components/bs5/formcheck/stories/checkbox/checkbox.data.json +51 -46
  109. package/src/components/bs5/formcheck/stories/radio/radio.data.json +51 -46
  110. package/src/components/bs5/globalAlert/GlobalAlert.mdx +8 -2
  111. package/src/components/bs5/globalAlert/globalAlert.test.js +3 -11
  112. package/src/components/bs5/header/_header-variables.scss +272 -0
  113. package/src/components/bs5/header/header.functions.js +9 -9
  114. package/src/components/bs5/header/header.hbs +124 -878
  115. package/src/components/bs5/header/header.scss +279 -411
  116. package/src/components/bs5/header/header.stories.js +8 -28
  117. package/src/components/bs5/header/header.variant.coBrand.data.json +28 -40
  118. package/src/components/bs5/header/header.variant.endorsed.data.json +116 -150
  119. package/src/components/bs5/header/header.variant.masterBrand.data.json +116 -152
  120. package/src/components/bs5/header/header.variant.standAlone.data.json +118 -150
  121. package/src/components/bs5/header/header.variant.subBrand.data.json +32 -159
  122. package/src/components/bs5/header/headerBrand.hbs +35 -0
  123. package/src/components/bs5/icons/icons.scss +79 -72
  124. package/src/components/bs5/inpageAlert/InpageAlert.mdx +8 -2
  125. package/src/components/bs5/inpageAlert/inpageAlert.data.json +6 -6
  126. package/src/components/bs5/inpagenav/inpagenav.scss +37 -37
  127. package/src/components/bs5/link/link.data.json +77 -0
  128. package/src/components/bs5/link/link.hbs +41 -0
  129. package/src/components/bs5/{pageLayout/pageLayout.js → link/link.js} +4 -5
  130. package/src/components/bs5/link/link.mdx +16 -0
  131. package/src/components/bs5/link/link.scss +81 -0
  132. package/src/components/bs5/link/link.stories.js +126 -0
  133. package/src/components/bs5/linkColumns/linkColumns.mdx +8 -3
  134. package/src/components/bs5/logo/logo.data.json +1 -0
  135. package/src/components/bs5/logo/logoCOALandscape.hbs +110 -55
  136. package/src/components/bs5/logo/logoCOALandscape2Lines.hbs +2 -1
  137. package/src/components/bs5/navbar/Navbar.js +2 -9
  138. package/src/components/bs5/navbar/navbar.data.json +191 -0
  139. package/src/components/bs5/navbar/navbar.functions.js +48 -196
  140. package/src/components/bs5/navbar/navbar.hbs +65 -245
  141. package/src/components/bs5/navbar/navbar.scss +684 -562
  142. package/src/components/bs5/navbar/navbar.stories.js +533 -0
  143. package/src/components/bs5/pageLayout/{FullWidthLandingPage.js → HomePage.js} +2 -2
  144. package/src/components/bs5/pageLayout/pageLayout.stories.js +242 -98
  145. package/src/components/bs5/pageLayout/templates/contentPageWithForm.hbs +53 -22
  146. package/src/components/bs5/pageLayout/templates/contentPageWithSideNavigation.hbs +79 -59
  147. package/src/components/bs5/pageLayout/templates/homePage.hbs +111 -0
  148. package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +8 -3
  149. package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +10 -9
  150. package/src/components/bs5/searchInput/search.functions.js +94 -63
  151. package/src/components/bs5/searchInput/searchInput.data.json +2 -3
  152. package/src/components/bs5/searchInput/searchInput.hbs +9 -11
  153. package/src/components/bs5/searchInput/searchInput.scss +297 -255
  154. package/src/components/bs5/searchInput/searchInput.test.js +98 -90
  155. package/src/components/bs5/tabs/tabs.data.json +45 -44
  156. package/src/components/bs5/tabs/tabs.scss +544 -500
  157. package/src/components/bs5/tabs/tabs.stories.js +81 -51
  158. package/src/components/common/layout/container.scss +22 -0
  159. package/src/components/common/layout/content.scss +11 -4
  160. package/src/components/common/layout/grid.scss +26 -0
  161. package/src/css/main.scss +7 -2
  162. package/src/css/mixins/_index.scss +2 -1
  163. package/src/css/mixins/register-vars.scss +23 -0
  164. package/src/css/qld-variables.scss +106 -83
  165. package/src/css/utilities/_index.scss +1 -0
  166. package/src/css/utilities/responsive-visually-hidden.scss +10 -0
  167. package/src/js/handlebars.helpers.js +34 -34
  168. package/src/js/handlebars.partials.js +14 -6
  169. package/src/js/qld.bootstrap.js +10 -11
  170. package/dist/assets/components/bs5/footer/footerForgov.hbs +0 -279
  171. package/dist/assets/components/bs5/pageLayout/pageLayout.hbs +0 -34
  172. package/dist/assets/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +0 -61
  173. package/dist/components/bs5/footer/footerForgov.hbs +0 -279
  174. package/dist/components/bs5/pageLayout/pageLayout.hbs +0 -34
  175. package/dist/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +0 -61
  176. package/src/components/bs5/footer/_colours.scss +0 -149
  177. package/src/components/bs5/footer/_measurements.scss +0 -32
  178. package/src/components/bs5/footer/footerForgov.hbs +0 -279
  179. package/src/components/bs5/header/_colours.scss +0 -271
  180. package/src/components/bs5/header/_icons.scss +0 -10
  181. package/src/components/bs5/navbar/_colours.scss +0 -85
  182. package/src/components/bs5/navbar/_icons.scss +0 -64
  183. package/src/components/bs5/pageLayout/pageLayout.hbs +0 -34
  184. package/src/components/bs5/pageLayout/templates/fullWidthLandingPage.hbs +0 -61
@@ -25,7 +25,8 @@ $input-transition:
25
25
  // Checks and radios (LARGE)
26
26
  $form-check-input-width: 2rem;
27
27
 
28
- $form-check-input-width-small: 22px;
28
+ // Checks and radios (SMALL)
29
+ $form-check-input-width-small: 1.375rem;
29
30
 
30
31
  $form-check-min-height: $font-size-base * $line-height-base;
31
32
  $form-check-padding-start: $form-check-input-width + 0.5rem;
@@ -37,13 +38,13 @@ $form-check-transition: null;
37
38
  $form-check-input-active-filter: brightness(100%);
38
39
 
39
40
  $form-check-input-bg: $input-bg;
40
- $form-check-input-border: 2px solid var(--#{$prefix}soft-grey);
41
+ $form-check-input-border: 2px solid var(--#{$prefix}light-text-text);
41
42
  $form-check-input-border-radius: 0.25em;
42
43
  $form-check-radio-border-radius: 50%;
43
44
 
44
- $form-check-input-checked-color: #414141;
45
+ $form-check-input-checked-color: var(--#{$prefix}light-text-text);
45
46
  $form-check-input-checked-bg-color: transparent;
46
- $form-check-input-checked-border-color: var(--#{$prefix}soft-grey);
47
+ $form-check-input-checked-border-color: var(--#{$prefix}light-text-text);
47
48
 
48
49
  $form-check-hover: var(--#{$prefix}dark-hover);
49
50
 
@@ -58,25 +59,27 @@ $form-check-input-outline-dark: 3px solid var(--#{$prefix}dark-focus);
58
59
  $form-check-input-border-width-small: 2px;
59
60
 
60
61
  // DARK ICON
61
- $form-check-input-checked-color-dark: #fff;
62
+ $form-check-input-checked-color-dark: var(--#{$prefix}dark-text-text);
62
63
 
63
64
  // DARK BORDER
64
- $form-check-input-border-dark: 0.15em solid var(--#{$prefix}dark-alt-border);
65
+ $form-check-input-border-dark: var(--#{$prefix}dark-text-text);
65
66
 
66
67
  // RADIO CHECKED LIGHT
67
- $form-radio-bg-image: url("data:image/svg+xml,<svg viewBox='-2 -2 4 4' xmlns='http://www.w3.org/2000/svg'><circle r='1.8' fill='#{$form-check-input-checked-color}'/></svg>");
68
+ $form-radio-bg-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><circle cx="16" cy="16" r="11" fill="#000000"/></svg>');
69
+ $form-radio-bg-image-small: url('data:image/svg+xml,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 17.5C14.5899 17.5 17.5 14.5899 17.5 11C17.5 7.41015 14.5899 4.5 11 4.5C7.41015 4.5 4.5 7.41015 4.5 11C4.5 14.5899 7.41015 17.5 11 17.5Z" fill="#000000"/></svg>');
68
70
 
69
71
  // RADIO CHECKED DARK
70
72
  $form-radio-bg-image-dark: url("data:image/svg+xml,<svg viewBox='-2 -2 4 4' xmlns='http://www.w3.org/2000/svg'><circle r='1.8' fill='#{$form-check-input-checked-color-dark}'/></svg>");
71
73
 
72
74
  // CHECKBOX CHECKED LIGHT
73
- $form-check-bg-image: url("data:image/svg+xml,<svg width='18' height='13' viewBox='0 0 18 13' fill='#{$form-check-input-checked-color}' xmlns='http://www.w3.org/2000/svg'><path d='M17.5547 0.445312C17.7891 0.679688 17.7891 1.10938 17.5547 1.34375L6.92969 11.9688C6.69531 12.2031 6.26562 12.2031 6.03125 11.9688L0.40625 6.34375C0.171875 6.10938 0.171875 5.67969 0.40625 5.44531C0.640625 5.21094 1.07031 5.21094 1.30469 5.44531L6.5 10.6406L16.6562 0.445312C16.8906 0.210938 17.3203 0.210938 17.5547 0.445312Z' /></svg>");
75
+ $form-check-bg-image: url("data:image/svg+xml,%3Csvg width='18' height='14' viewBox='0 0 18 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5498 13.8L0.0498047 7.30002L2.2998 5.05002L6.5498 9.30002L15.6998 0.150024L17.9498 2.40002L6.5498 13.8Z' fill='currentColor'/%3E%3C/svg%3E%0A");
74
76
 
75
77
  // CHECKBOX CHECKED DARK
76
- $form-check-bg-image-dark: url("data:image/svg+xml,<svg width='18' height='13' viewBox='0 0 18 13' fill='#{$form-check-input-checked-color-dark}' xmlns='http://www.w3.org/2000/svg'><path d='M17.5547 0.445312C17.7891 0.679688 17.7891 1.10938 17.5547 1.34375L6.92969 11.9688C6.69531 12.2031 6.26562 12.2031 6.03125 11.9688L0.40625 6.34375C0.171875 6.10938 0.171875 5.67969 0.40625 5.44531C0.640625 5.21094 1.07031 5.21094 1.30469 5.44531L6.5 10.6406L16.6562 0.445312C16.8906 0.210938 17.3203 0.210938 17.5547 0.445312Z' /></svg>");
78
+ $form-check-bg-image-dark: url("data:image/svg+xml,%3Csvg width='18' height='14' viewBox='0 0 18 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5498 13.8L0.0498047 7.30002L2.2998 5.05002L6.5498 9.30002L15.6998 0.150024L17.9498 2.40002L6.5498 13.8Z' fill='#{$form-check-input-checked-color-dark}'/%3E%3C/svg%3E");
77
79
 
78
80
  // ESCAPE SVGs FOR ICONS
79
81
  $form-radio-button: #{escape-svg($form-radio-bg-image)};
82
+ $form-radio-button-small: #{escape-svg($form-radio-bg-image-small)};
80
83
  $form-radio-button-dark: #{escape-svg($form-radio-bg-image-dark)};
81
84
  $form-checkbox-button: #{escape-svg($form-check-bg-image)};
82
85
  $form-checkbox-button-dark: #{escape-svg($form-check-bg-image-dark)};
@@ -92,21 +95,6 @@ $form-check-btn-check-disabled-opacity: $btn-disabled-opacity;
92
95
 
93
96
  $form-check-inline-margin-end: 1rem;
94
97
 
95
- .small {
96
- .form-check .form-check-input {
97
- width: $form-check-input-width-small;
98
- height: $form-check-input-width-small;
99
-
100
- &[type="checkbox"],
101
- &[type="radio"] {
102
- border-width: #{$form-check-input-border-width-small};
103
- &:checked {
104
- background-size: 14px 14px;
105
- }
106
- }
107
- }
108
- }
109
-
110
98
  .form-label {
111
99
  font-weight: 600;
112
100
  line-height: 1.5;
@@ -138,158 +126,192 @@ $form-check-inline-margin-end: 1rem;
138
126
  &:active,
139
127
  &:focus {
140
128
  border-color: var(--#{$prefix}input-border-color-hover);
141
- outline: #{$form-check-input-outline};
129
+ outline: $form-check-input-outline;
142
130
  outline-offset: 2px;
143
131
  box-shadow: none;
144
132
  }
145
133
  }
146
134
 
147
- .form-check {
148
- display: flex;
149
- align-items: center;
150
- margin-bottom: $form-check-margin-bottom;
151
-
152
- .form-check-input {
153
- width: $form-check-input-width;
154
- height: $form-check-input-width;
155
- margin-top: 0;
156
-
157
- &:hover,
158
- &:focus {
159
- cursor: pointer;
160
- background-color: var(--#{$prefix}extra-light-grey);
135
+ .form-check-input {
136
+ // hides the original input element, and + label recreates it visually
137
+ background-size: calc(2rem - 8px);
138
+ border: 0;
139
+ clip-path: inset(0 0 0 0);
140
+ width: 1px;
141
+ height: 1px;
142
+ margin: -1px;
143
+ overflow: hidden;
144
+ padding: 0;
145
+ position: absolute;
146
+ margin-top: 0;
147
+
148
+ + label {
149
+ --_background-color: transparent;
150
+ cursor: pointer;
151
+ position: relative;
152
+ vertical-align: bottom;
153
+ line-height: 2rem;
154
+ padding-left: 2.5rem;
155
+ margin-left: -1.5em;
156
+
157
+ // before is the outer box with border,
158
+ // after is the check or radio icon
159
+ &::before,
160
+ &::after {
161
+ visibility: visible;
162
+ content: " ";
163
+ display: block;
164
+ position: absolute;
165
+ top: 0;
166
+ left: 0;
167
+ box-sizing: border-box;
168
+ background-repeat: no-repeat;
169
+ z-index: 9;
170
+ border: $form-check-input-border;
171
+ width: 2rem;
172
+ height: 2rem;
161
173
  }
162
- &:active,
163
- &:focus {
164
- border-color: var(--#{$prefix}input-border-color-hover);
165
- outline: #{$form-check-input-outline};
166
- outline-offset: 3px;
167
- box-shadow: none;
174
+ &::before {
175
+ background-color: var(--_background-color);
176
+ border-color: $form-check-input-checked-border-color;
177
+ background-image: none !important;
178
+ }
179
+
180
+ &::after {
181
+ z-index: 101;
182
+ background-color: transparent;
168
183
  }
169
184
  }
170
185
 
171
- // DEFAULT RADIO
172
- .form-check-input[type="radio"] {
186
+ &:active + label::before,
187
+ &:focus + label::before {
188
+ border-color: var(--#{$prefix}input-border-color-hover);
189
+ outline: $form-check-input-outline;
190
+ outline-offset: 2px;
191
+ box-shadow: none;
192
+ }
193
+
194
+ &:hover + label {
195
+ --_background-color: var(--#{$prefix}extra-light-grey);
196
+ }
197
+
198
+ &:checked {
199
+ background-color: transparent;
173
200
  background-image: none;
174
- background-size: calc(2rem - 8px);
175
- border: $form-check-input-border;
176
201
 
177
- &:checked {
178
- background-color: transparent;
179
- background-image: #{$form-radio-button};
180
- background-size: calc(2rem - 8px);
202
+ & + label::after {
203
+ content: "";
204
+ display: block;
205
+ mask-repeat: no-repeat;
206
+ mask-position: center;
207
+ background-color: $form-check-input-checked-color;
181
208
  }
182
209
  }
183
210
 
184
- // DEFAULT CHECKBOX
185
- .form-check-input[type="checkbox"] {
186
- background-size: calc(2rem - 8px);
187
- border: $form-check-input-border;
211
+ &[type="checkbox"] {
188
212
  border-radius: 0;
189
213
 
190
214
  &:checked {
191
- background-image: #{$form-checkbox-button};
192
- background-color: #{$form-check-input-checked-bg-color};
193
- background-size: 1.125rem;
194
- background-position: center;
195
- border-color: #{$form-check-input-checked-border-color};
215
+ + label::after {
216
+ mask-image: $form-check-bg-image;
217
+ mask-size: 1.125rem;
218
+ }
196
219
  }
197
220
  }
198
221
 
199
- // DEFAULT VALID
200
- .valid & {
201
- .form-check-input[type="radio"],
202
- .form-check-input[type="checkbox"] {
203
- outline: #{$form-check-valid-color} solid 2px;
204
-
205
- &:focus {
206
- outline: #{$form-check-input-outline};
207
- outline-offset: 2px;
208
- box-shadow: none;
222
+ &[type="radio"] {
223
+ background-image: none;
224
+
225
+ + label {
226
+ //
227
+ &::before,
228
+ &::after {
229
+ border-radius: 50%;
209
230
  }
210
- &:checked:focus {
211
- outline: #{$form-check-input-outline};
231
+
232
+ &::after {
233
+ mask-image: $form-radio-button;
234
+ mask-size: 100%;
212
235
  }
213
236
  }
214
237
  }
215
- // DEFAULT INVALID
238
+
239
+ // DEFAULT VALID & INVALID
240
+ .valid &,
241
+ .invalid & {
242
+ &:focus + label::before {
243
+ outline: $form-check-input-outline;
244
+ outline-offset: 2px;
245
+ box-shadow: none;
246
+ }
247
+ }
248
+ .valid & {
249
+ + label::before {
250
+ outline: $form-check-valid-color solid 2px;
251
+ }
252
+ }
216
253
  .invalid & {
217
- .form-check-input[type="radio"],
218
- .form-check-input[type="checkbox"] {
219
- outline: #{$form-check-invalid-color} solid 2px;
220
-
221
- &:focus {
222
- outline: #{$form-check-input-outline};
223
- outline-offset: 2px;
224
- box-shadow: none;
225
- }
226
- &:checked:focus {
227
- outline: #{$form-check-input-outline};
228
- }
254
+ + label::before {
255
+ outline: $form-check-invalid-color solid 2px;
229
256
  }
230
257
  }
231
- // DARK
232
- .dark &,
233
- .dark-alt & {
234
- .form-check-input {
235
- &:hover,
236
- &:focus {
237
- background-color: #{$form-check-hover};
238
- }
258
+
259
+ .small & {
260
+ &:checked + label::before {
261
+ background-size: 22px 22px;
239
262
  }
240
- .form-check-input[type="checkbox"]:checked {
241
- background-image: #{$form-checkbox-button-dark};
263
+
264
+ &[type="checkbox"]:checked + label:after {
265
+ mask-size: 0.84906rem 0.63988rem;
242
266
  }
243
- .form-check-input[type="radio"]:checked {
244
- background-image: #{$form-radio-button-dark};
267
+
268
+ + label {
269
+ font-size: 1rem;
270
+ font-style: normal;
271
+ font-weight: 400;
272
+ line-height: $input-line-height;
273
+ padding-left: 1.875rem;
274
+
275
+ &:before,
276
+ &:after {
277
+ width: $form-check-input-width-small;
278
+ height: $form-check-input-width-small;
279
+ border-width: $form-check-input-border-width-small;
280
+ }
245
281
  }
246
- .form-check-input,
247
- .form-check-input:checked {
248
- border: #{$form-check-input-border-dark};
282
+
283
+ &[type="radio"] + label::after {
284
+ mask-image: $form-radio-button-small;
249
285
  }
250
- .form-check-input:focus {
251
- outline: #{$form-check-input-outline-dark};
286
+ }
287
+
288
+ .dark &,
289
+ .dark-alt & {
290
+ &:hover + label {
291
+ --_background-color: $form-check-hover;
252
292
  }
253
- .small & {
254
- .form-check-input[type="checkbox"],
255
- .form-check-input[type="radio"] {
256
- &:checked {
257
- background-color: transparent;
258
- background-size: 14px 14px;
259
- }
260
- }
293
+ &:hover + label::after {
294
+ background-color: $form-check-hover;
261
295
  }
262
- // DARK VALID
263
- .valid & {
264
- .form-check-input[type="radio"],
265
- .form-check-input[type="checkbox"] {
266
- outline: #{$form-check-valid-color} solid 2px;
267
- &:focus {
268
- outline: #{$form-check-input-outline-dark};
269
- outline-offset: 2px;
270
- box-shadow: none;
271
- }
272
- &:checked:focus {
273
- outline: #{$form-check-input-outline-dark};
274
- }
275
- }
296
+ + label::before,
297
+ + label::after {
298
+ border-color: $form-check-input-border-dark;
276
299
  }
277
- // DARK INVALID
278
- .invalid & {
279
- .form-check-input[type="radio"],
280
- .form-check-input[type="checkbox"] {
281
- outline: #{$form-check-invalid-color} solid 2px;
282
- &:focus {
283
- outline: #{$form-check-input-outline-dark};
284
- outline-offset: 2px;
285
- box-shadow: none;
286
- }
287
- &:checked:focus {
288
- outline: #{$form-check-input-outline-dark};
289
- }
300
+ &:checked {
301
+ & + label::after {
302
+ background-color: $form-check-input-checked-color-dark;
290
303
  }
291
304
  }
305
+ :focus {
306
+ outline: $form-check-input-outline-dark;
307
+ }
292
308
  }
309
+ }
310
+
311
+ .form-check {
312
+ display: flex;
313
+ align-items: center;
314
+ margin-bottom: $form-check-margin-bottom;
293
315
  &-label {
294
316
  margin-left: 0.5rem;
295
317
  }
@@ -1,48 +1,53 @@
1
1
  {
2
- "questionLabel": "Which service do you need?",
3
- "optionalLabel": "(Optional)",
4
- "hintLabel": "Hint label",
5
- "listClasses": "field-required",
6
- "listitems": [
7
- {
8
- "type": "checkbox",
9
- "id": "checkboxItem1",
10
- "name": "checkboxOption",
11
- "label": "Option 1",
12
- "value": "1",
13
- "isDisabled": false
14
- },
15
- {
16
- "type": "checkbox",
17
- "id": "checkboxItem2",
18
- "name": "checkboxOption",
19
- "label": "Option 2",
20
- "value": "2",
21
- "isDisabled": false
22
- },
23
- {
24
- "type": "checkbox",
25
- "id": "checkboxItem3",
26
- "name": "checkboxOption",
27
- "label": "Option 3",
28
- "value": "3",
29
- "isDisabled": false
30
- },
31
- {
32
- "type": "checkbox",
33
- "id": "checkboxItem4",
34
- "name": "checkboxOption",
35
- "label": "Option 4",
36
- "value": "4",
37
- "isDisabled": false
38
- },
39
- {
40
- "type": "checkbox",
41
- "id": "checkboxItem5",
42
- "name": "checkboxOption",
43
- "label": "Disabled",
44
- "value": "",
45
- "isDisabled": true
46
- }
47
- ]
2
+ "questionLabel": "Which service do you need?",
3
+ "optionalLabel": "(Optional)",
4
+ "hintLabel": "Hint label",
5
+ "listClasses": "field-required",
6
+ "listitems": [
7
+ {
8
+ "type": "checkbox",
9
+ "id": "checkboxItem1",
10
+ "name": "checkboxOption",
11
+ "label": "Option 1",
12
+ "value": "1",
13
+ "isDisabled": false,
14
+ "isChecked": false
15
+ },
16
+ {
17
+ "type": "checkbox",
18
+ "id": "checkboxItem2",
19
+ "name": "checkboxOption",
20
+ "label": "Option 2",
21
+ "value": "2",
22
+ "isDisabled": false,
23
+ "isChecked": false
24
+ },
25
+ {
26
+ "type": "checkbox",
27
+ "id": "checkboxItem3",
28
+ "name": "checkboxOption",
29
+ "label": "Option 3",
30
+ "value": "3",
31
+ "isDisabled": false,
32
+ "isChecked": false
33
+ },
34
+ {
35
+ "type": "checkbox",
36
+ "id": "checkboxItem4",
37
+ "name": "checkboxOption",
38
+ "label": "Option 4",
39
+ "value": "4",
40
+ "isDisabled": false,
41
+ "isChecked": true
42
+ },
43
+ {
44
+ "type": "checkbox",
45
+ "id": "checkboxItem5",
46
+ "name": "checkboxOption",
47
+ "label": "Disabled",
48
+ "value": "",
49
+ "isDisabled": true,
50
+ "isChecked": false
51
+ }
52
+ ]
48
53
  }
@@ -1,48 +1,53 @@
1
1
  {
2
- "questionLabel": "Which service do you need?",
3
- "optionalLabel": "(Optional)",
4
- "hintLabel": "Hint label",
5
- "listClasses": "field-required",
6
- "listitems": [
7
- {
8
- "type": "radio",
9
- "id": "radioItem1",
10
- "name": "radioOption",
11
- "label": "Option 1",
12
- "value": "1",
13
- "isDisabled": false
14
- },
15
- {
16
- "type": "radio",
17
- "id": "radioItem2",
18
- "name": "radioOption",
19
- "label": "Option 2",
20
- "value": "2",
21
- "isDisabled": false
22
- },
23
- {
24
- "type": "radio",
25
- "id": "radioItem3",
26
- "name": "radioOption",
27
- "label": "Option 3",
28
- "value": "3",
29
- "isDisabled": false
30
- },
31
- {
32
- "type": "radio",
33
- "id": "radioItem4",
34
- "name": "radioOption",
35
- "label": "Option 4",
36
- "value": "4",
37
- "isDisabled": false
38
- },
39
- {
40
- "type": "radio",
41
- "id": "radioItem5",
42
- "name": "radioOption",
43
- "label": "Disabled",
44
- "value": "",
45
- "isDisabled": true
46
- }
47
- ]
2
+ "questionLabel": "Which service do you need?",
3
+ "optionalLabel": "(Optional)",
4
+ "hintLabel": "Hint label",
5
+ "listClasses": "field-required",
6
+ "listitems": [
7
+ {
8
+ "type": "radio",
9
+ "id": "radioItem1",
10
+ "name": "radioOption",
11
+ "label": "Option 1",
12
+ "value": "1",
13
+ "isDisabled": false,
14
+ "isChecked": false
15
+ },
16
+ {
17
+ "type": "radio",
18
+ "id": "radioItem2",
19
+ "name": "radioOption",
20
+ "label": "Option 2",
21
+ "value": "2",
22
+ "isDisabled": false,
23
+ "isChecked": false
24
+ },
25
+ {
26
+ "type": "radio",
27
+ "id": "radioItem3",
28
+ "name": "radioOption",
29
+ "label": "Option 3",
30
+ "value": "3",
31
+ "isDisabled": false,
32
+ "isChecked": true
33
+ },
34
+ {
35
+ "type": "radio",
36
+ "id": "radioItem4",
37
+ "name": "radioOption",
38
+ "label": "Option 4",
39
+ "value": "4",
40
+ "isDisabled": false,
41
+ "isChecked": false
42
+ },
43
+ {
44
+ "type": "radio",
45
+ "id": "radioItem5",
46
+ "name": "radioOption",
47
+ "label": "Disabled",
48
+ "value": "",
49
+ "isDisabled": true,
50
+ "isChecked": false
51
+ }
52
+ ]
48
53
  }
@@ -1,9 +1,11 @@
1
- import { Canvas, Meta, Story } from "@storybook/blocks"
2
- import * as GlobalAlertStories from "./globalAlert.stories"
1
+ import { Canvas, Meta, Story, Source } from "@storybook/blocks";
2
+ import * as GlobalAlertStories from "./globalAlert.stories";
3
+ import defaultdata from "./globalAlert.data.json";
3
4
 
4
5
  <Meta of={GlobalAlertStories} />
5
6
 
6
7
  # Global alert
8
+
7
9
  <Canvas>
8
10
  <Story of={GlobalAlertStories.Critical} />
9
11
  </Canvas>
@@ -13,3 +15,7 @@ import * as GlobalAlertStories from "./globalAlert.stories"
13
15
  - [Component library (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=23805-314551&mode=design&t=NREcuP5UOBB2Y6G4-4)
14
16
  - [Master component file (Figma)](https://www.figma.com/file/qKsxl3ogIlBp7dafgxXuCA/QLD-GOV-DDS?type=design&node-id=5990-97590&mode=design&t=YLfxdziHdqD2Ty0o-0)
15
17
  - [Design System website](https://www.designsystem.qld.gov.au/components/alerts-global)
18
+
19
+ ## Example JSON data
20
+
21
+ <Source language="json" code={JSON.stringify(defaultdata, null, 2)} />
@@ -83,17 +83,9 @@ describe("initGlobalAlerts", () => {
83
83
  const globalAlertComponent = new GlobalAlert(testMockData);
84
84
  return `
85
85
  <!DOCTYPE html>
86
- <html>
87
- <head>
88
- <meta charset="utf-8">
89
- <link rel="stylesheet" href="${__dirname}/../../../../dist/assets/css/qld.bootstrap.css">
90
- </head>
91
- <body>
92
- ${globalAlertComponent.html}
93
- <script>${bootstrapJsFile}</script>
94
- <script>${qldBootstrapJsFile}</script>
95
- </body>
96
- </html>
86
+ ${globalAlertComponent.html}
87
+ <script>${bootstrapJsFile}</script>
88
+ <script>${qldBootstrapJsFile}</script>
97
89
  `;
98
90
  };
99
91