@qld-gov-au/qgds-bootstrap5 2.0.11 → 2.1.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 (119) hide show
  1. package/.esbuild/plugins/qgds-plugin-generate-icon-assets.js +31 -24
  2. package/.storybook/preview.js +5 -2
  3. package/dist/assets/components/bs5/button/button.hbs +1 -1
  4. package/dist/assets/components/bs5/dateinput/dateinput.hbs +27 -27
  5. package/dist/assets/components/bs5/footer/customLinks.hbs +1 -1
  6. package/dist/assets/components/bs5/footer/followLinks.hbs +1 -1
  7. package/dist/assets/components/bs5/formcheck/formcheck.hbs +10 -2
  8. package/dist/assets/components/bs5/head/head.hbs +1 -1
  9. package/dist/assets/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
  10. package/dist/assets/components/bs5/searchInput/searchInput.hbs +35 -31
  11. package/dist/assets/components/bs5/select/select.hbs +19 -19
  12. package/dist/assets/components/bs5/textarea/textarea.hbs +17 -17
  13. package/dist/assets/components/bs5/textbox/textbox.hbs +17 -18
  14. package/dist/assets/css/qld.bootstrap.css +2 -2
  15. package/dist/assets/css/qld.bootstrap.css.map +3 -3
  16. package/dist/assets/css/qld.bootstrap.legacy.css +2 -2
  17. package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
  18. package/dist/assets/img/icons-sprite.svg +24 -24
  19. package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
  20. package/dist/assets/js/handlebars.init.min.js +159 -140
  21. package/dist/assets/js/handlebars.init.min.js.map +2 -2
  22. package/dist/assets/js/handlebars.partials.js +159 -140
  23. package/dist/assets/js/handlebars.partials.js.map +2 -2
  24. package/dist/assets/js/qld.bootstrap.min.js +9 -10
  25. package/dist/assets/js/qld.bootstrap.min.js.map +4 -4
  26. package/dist/assets/node/handlebars.init.min.js +57 -11
  27. package/dist/assets/node/handlebars.init.min.js.map +2 -2
  28. package/dist/components/bs5/button/button.hbs +1 -1
  29. package/dist/components/bs5/dateinput/dateinput.hbs +27 -27
  30. package/dist/components/bs5/footer/customLinks.hbs +1 -1
  31. package/dist/components/bs5/footer/followLinks.hbs +1 -1
  32. package/dist/components/bs5/formcheck/formcheck.hbs +10 -2
  33. package/dist/components/bs5/head/head.hbs +1 -1
  34. package/dist/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
  35. package/dist/components/bs5/searchInput/searchInput.hbs +35 -31
  36. package/dist/components/bs5/select/select.hbs +19 -19
  37. package/dist/components/bs5/textarea/textarea.hbs +17 -17
  38. package/dist/components/bs5/textbox/textbox.hbs +17 -18
  39. package/dist/package.json +1 -1
  40. package/dist/sample-data/dateinput/dateinput.data.json +14 -12
  41. package/dist/sample-data/footer/footer.data.json +3 -0
  42. package/dist/sample-data/formcheck/stories/checkbox/checkbox.data.json +4 -5
  43. package/dist/sample-data/formcheck/stories/radio/radio.data.json +4 -4
  44. package/dist/sample-data/inpageAlert/inpageAlert.data.json +1 -1
  45. package/dist/sample-data/searchInput/searchInput.data.json +20 -10
  46. package/dist/sample-data/select/select.data.json +12 -10
  47. package/dist/sample-data/textarea/textarea.data.json +14 -11
  48. package/dist/sample-data/textbox/textbox.data.json +13 -10
  49. package/package.json +1 -1
  50. package/src/components/bs5/breadcrumbs/breadcrumbs.scss +3 -4
  51. package/src/components/bs5/button/Button.js +32 -6
  52. package/src/components/bs5/button/button.hbs +1 -1
  53. package/src/components/bs5/button/button.scss +0 -5
  54. package/src/components/bs5/card/card.scss +2 -0
  55. package/src/components/bs5/dateinput/Dateinput.js +26 -11
  56. package/src/components/bs5/dateinput/dateinput.data.json +14 -12
  57. package/src/components/bs5/dateinput/dateinput.hbs +27 -27
  58. package/src/components/bs5/footer/customLinks.hbs +1 -1
  59. package/src/components/bs5/footer/followLinks.hbs +1 -1
  60. package/src/components/bs5/footer/footer.data.json +3 -0
  61. package/src/components/bs5/formcheck/Formcheck.js +57 -6
  62. package/src/components/bs5/formcheck/_form-variables.scss +167 -0
  63. package/src/components/bs5/formcheck/formcheck.hbs +10 -2
  64. package/src/components/bs5/formcheck/formcheck.scss +268 -65
  65. package/src/components/bs5/formcheck/stories/bootstrap-validation/bootstrap-validation.stories.js +304 -0
  66. package/src/components/bs5/formcheck/stories/checkbox/checkbox.data.json +4 -5
  67. package/src/components/bs5/formcheck/stories/checkbox/checkbox.stories.js +19 -111
  68. package/src/components/bs5/formcheck/stories/radio/radio.data.json +4 -4
  69. package/src/components/bs5/formcheck/stories/radio/radio.stories.js +30 -122
  70. package/src/components/bs5/header/header.scss +1 -2
  71. package/src/components/bs5/icons/_icons.list.js +7 -7
  72. package/src/components/bs5/icons/_icons.list.scss +113 -112
  73. package/src/components/bs5/icons/_icons.variables.scss +7 -6
  74. package/src/components/bs5/icons/icons.scss +2 -1
  75. package/src/components/bs5/inpageAlert/inpageAlert.data.json +1 -1
  76. package/src/components/bs5/inpageAlert/inpageAlert.hbs +10 -2
  77. package/src/components/bs5/inpageAlert/inpageAlert.scss +50 -52
  78. package/src/components/bs5/inpageAlert/inpageAlert.stories.js +54 -3
  79. package/src/components/bs5/pageLayout/{ThemeShowcase.stories.js → PaletteShowcase.stories.js} +40 -38
  80. package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +25 -29
  81. package/src/components/bs5/searchInput/search.functions.js +120 -108
  82. package/src/components/bs5/searchInput/searchInput.data.json +20 -10
  83. package/src/components/bs5/searchInput/searchInput.hbs +35 -31
  84. package/src/components/bs5/searchInput/searchInput.scss +193 -196
  85. package/src/components/bs5/searchInput/searchInput.stories.js +35 -13
  86. package/src/components/bs5/searchInput/searchInput.test.js +96 -120
  87. package/src/components/bs5/select/Select.js +13 -5
  88. package/src/components/bs5/select/Select.stories.js +27 -83
  89. package/src/components/bs5/select/select.data.json +12 -10
  90. package/src/components/bs5/select/select.hbs +19 -19
  91. package/src/components/bs5/skiplinks/skipLinks.scss +12 -4
  92. package/src/components/bs5/textarea/Textarea.js +13 -5
  93. package/src/components/bs5/textarea/Textarea.stories.js +29 -55
  94. package/src/components/bs5/textarea/textarea.data.json +14 -11
  95. package/src/components/bs5/textarea/textarea.hbs +17 -17
  96. package/src/components/bs5/textbox/Textbox.js +16 -5
  97. package/src/components/bs5/textbox/Textbox.stories.js +26 -51
  98. package/src/components/bs5/textbox/textInput.scss +12 -232
  99. package/src/components/bs5/textbox/textbox.data.json +13 -10
  100. package/src/components/bs5/textbox/textbox.hbs +17 -18
  101. package/src/components/common/focus-styles/focusStyles.mdx +20 -0
  102. package/src/components/common/focus-styles/focusStyles.stories.js +58 -0
  103. package/src/css/functions/_index.scss +5 -0
  104. package/src/css/functions/color-icon.scss +31 -0
  105. package/src/css/functions/remify.scss +32 -0
  106. package/src/css/functions/snap-line-height.scss +7 -0
  107. package/src/css/functions/string-replace.scss +49 -0
  108. package/src/css/functions/svg-encode.scss +22 -0
  109. package/src/css/main.scss +1 -1
  110. package/src/css/mixins/focusable.scss +3 -0
  111. package/src/css/mixins/make-icon.scss +1 -1
  112. package/src/css/mixins/make-link.scss +13 -10
  113. package/src/css/{qld-theme.scss → qld-palettes.scss} +50 -35
  114. package/src/css/qld-type.scss +5 -1
  115. package/src/css/qld-utilities.scss +9 -1
  116. package/src/css/qld-variables.scss +1 -1
  117. package/src/img/icons-sprite.svg +24 -24
  118. package/src/js/qld.bootstrap.js +3 -55
  119. package/src/components/bs5/formcheck/_formcheck.stories.bak.js +0 -432
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "variantClass": "alert-success",
3
- "alertType": "",
3
+ "ariaLabel": "Success alert",
4
4
  "heading": "Alert heading",
5
5
  "headingTag": "h2",
6
6
  "content": "<p>This is an alert notice with some important information. <a href='#'>Find out more</a>.</p>"
@@ -1,5 +1,13 @@
1
- <div class="alert {{variantClass}} {{customClass}}" role="alert"
2
- {{#if alertType}}aria-label="{{alertType}}"{{/if}}>
1
+ <div class="alert {{variantClass}} {{customClass}}" role="alert"
2
+ {{#if ariaLabel}}
3
+ aria-label="{{ ariaLabel }}"
4
+ {{else}}
5
+ {{#ifCond variantClass "==" "alert-info"}}aria-label="Information alert"{{/ifCond}}
6
+ {{#ifCond variantClass "==" "alert-success"}}aria-label="Success alert"{{/ifCond}}
7
+ {{#ifCond variantClass "==" "alert-error"}}aria-label="Error alert"{{/ifCond}}
8
+ {{#ifCond variantClass "==" "alert-warning"}}aria-label="Warning alert"{{/ifCond}}
9
+ {{/if}}
10
+ >
3
11
  {{#if heading}}
4
12
  {{#if headingTag}}
5
13
  <{{headingTag}} class="alert-heading">{{{ heading }}}</{{headingTag}}>
@@ -1,17 +1,19 @@
1
1
  // QLD Desing System Bootstrap 5 library
2
2
  // Extends: https://getbootstrap.com/docs/5.3/components/alerts/#variables
3
+ @use "../../../css/mixins" as m;
3
4
 
4
5
  //All alerts have the same text and background color, even on darker themes
5
6
  //To account for this, we redefine the global vars at the .alert scope
6
7
 
7
8
  .alert {
8
- @include light-theme-properties();
9
+ @extend %qld-palette-default;
9
10
  --qld-headings-color: var(--#{$prefix}light-text-text);
10
11
  --qld-alert-color: var(--#{$prefix}light-text-text);
11
12
  --qld-alert-bg: #fff;
12
13
  }
13
14
 
14
15
  .alert {
16
+ position: relative;
15
17
  padding-left: 4rem;
16
18
  overflow-wrap: break-word;
17
19
 
@@ -45,79 +47,75 @@
45
47
  no-repeat center center;
46
48
  }
47
49
 
48
- //Alert sidebar color and icon
49
- //Colors and icons defined below
50
- &:before,
51
- &:after {
52
- content: "";
53
- width: 3rem;
54
- position: absolute;
55
- left: 0;
56
- top: 0;
57
- bottom: 0;
58
- }
59
-
60
- &:after {
61
- color: #fff;
62
- background-repeat: no-repeat;
63
- background-position: center center;
64
- }
65
-
66
- //alerts color map
67
- $alert-colors-map: (
50
+ //alerts color map with icons
51
+ $alert-icons-map: (
68
52
  "success": (
69
- color: var(--#{$prefix}success),
70
- icon:
71
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_5702_82645' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='0' y='0' width='20' height='20'%3E%3Cpath d='M9.2207 12.6953C8.99805 12.918 8.58984 12.918 8.36719 12.6953L5.99219 10.3203C5.76953 10.0977 5.76953 9.68945 5.99219 9.4668C6.21484 9.24414 6.62305 9.24414 6.8457 9.4668L8.8125 11.4336L13.1172 7.0918C13.3398 6.86914 13.748 6.86914 13.9707 7.0918C14.1934 7.31445 14.1934 7.72266 13.9707 7.94531L9.2207 12.6953ZM19.5 9.875C19.5 15.1445 15.2324 19.375 10 19.375C4.73047 19.375 0.5 15.1445 0.5 9.875C0.5 4.64258 4.73047 0.375 10 0.375C15.2324 0.375 19.5 4.64258 19.5 9.875ZM10 1.5625C5.39844 1.5625 1.6875 5.31055 1.6875 9.875C1.6875 14.4766 5.39844 18.1875 10 18.1875C14.5645 18.1875 18.3125 14.4766 18.3125 9.875C18.3125 5.31055 14.5645 1.5625 10 1.5625Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_5702_82645)'%3E%3Crect width='20' height='20' fill='%23FFFFFF'/%3E%3C/g%3E%3C/svg%3E%0A",
53
+ "color": var(--#{$prefix}success),
54
+ "icon": "alert-success",
72
55
  ),
73
56
  "info": (
74
- color: var(--#{$prefix}info),
75
- icon:
76
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_5702_82508' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='1' y='1' width='18' height='18'%3E%3Cpath d='M10 7.20312C9.48047 7.20312 9.10938 6.83203 9.10938 6.3125C9.10938 5.83008 9.48047 5.42188 10 5.42188C10.4824 5.42188 10.8906 5.83008 10.8906 6.3125C10.8906 6.83203 10.4824 7.20312 10 7.20312ZM15.9375 1.5625C17.2363 1.5625 18.3125 2.63867 18.3125 3.9375V15.8125C18.3125 17.1484 17.2363 18.1875 15.9375 18.1875H4.0625C2.72656 18.1875 1.6875 17.1484 1.6875 15.8125V3.9375C1.6875 2.63867 2.72656 1.5625 4.0625 1.5625H15.9375ZM17.125 15.8125V3.9375C17.125 3.30664 16.5684 2.75 15.9375 2.75H4.0625C3.39453 2.75 2.875 3.30664 2.875 3.9375V15.8125C2.875 16.4805 3.39453 17 4.0625 17H15.9375C16.5684 17 17.125 16.4805 17.125 15.8125ZM11.7812 13.4375C12.0781 13.4375 12.375 13.7344 12.375 14.0312C12.375 14.3652 12.0781 14.625 11.7812 14.625H8.21875C7.88477 14.625 7.625 14.3652 7.625 14.0312C7.625 13.7344 7.88477 13.4375 8.21875 13.4375H9.40625V9.875H8.8125C8.47852 9.875 8.21875 9.61523 8.21875 9.28125C8.21875 8.98438 8.47852 8.6875 8.8125 8.6875H10C10.2969 8.6875 10.5938 8.98438 10.5938 9.28125V13.4375H11.7812Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_5702_82508)'%3E%3Crect width='20' height='20' fill='%23FFFFFF'/%3E%3C/g%3E%3C/svg%3E%0A",
57
+ "color": var(--#{$prefix}info),
58
+ "icon": "alert-information",
77
59
  ),
78
60
  "warning": (
79
- color: var(--#{$prefix}warning),
80
- icon:
81
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_5702_80802' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='0' y='2' width='20' height='17'%3E%3Cpath d='M10 13.9062C10.457 13.9062 10.8438 14.293 10.8086 14.75C10.8086 15.2422 10.457 15.5938 10 15.5938C9.54297 15.5938 9.15625 15.2422 9.15625 14.75C9.15625 14.293 9.50781 13.9062 10 13.9062ZM10 12.5C9.68359 12.5 9.4375 12.2539 9.4375 11.9375V6.875C9.4375 6.59375 9.71875 6.3125 10 6.3125C10.2461 6.3125 10.5273 6.59375 10.5273 6.875V11.9375C10.5273 12.2539 10.2812 12.5 10 12.5ZM18.7188 15.2422C19.0703 15.8398 19.0703 16.543 18.7188 17.1406C18.3672 17.7734 17.7344 18.125 17.0312 18.125H2.96875C2.23047 18.125 1.59766 17.7734 1.24609 17.1406C0.894531 16.543 0.894531 15.8398 1.24609 15.2422L8.27734 3.35938C8.62891 2.76172 9.26172 2.375 10 2.375C10.7031 2.41016 11.3359 2.76172 11.6875 3.35938L18.7188 15.2422ZM17.7344 16.5781C17.9102 16.332 17.875 16.0508 17.7344 15.8047L10.7031 3.92188C10.5625 3.67578 10.2812 3.53516 10 3.5C9.96484 3.5 10 3.5 10 3.5C9.68359 3.5 9.40234 3.67578 9.26172 3.92188L2.23047 15.8047C2.08984 16.0508 2.05469 16.332 2.23047 16.5781C2.37109 16.8594 2.65234 17 2.96875 17H16.9961C17.3125 17 17.5938 16.8594 17.7344 16.5781Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_5702_80802)'%3E%3Crect width='20' height='20' fill='%231D1D1D'/%3E%3C/g%3E%3C/svg%3E%0A",
61
+ "color": var(--#{$prefix}warning),
62
+ "icon": "alert-warning",
82
63
  ),
83
64
  "danger": (
84
- color: var(--#{$prefix}danger),
85
- icon:
86
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_34619_4370' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='4' y='4' width='12' height='12'%3E%3Cpath d='M14.8438 14.875C14.6562 15.0625 14.3125 15.0625 14.125 14.875L10 10.7188L5.84375 14.875C5.65625 15.0625 5.3125 15.0625 5.125 14.875C4.9375 14.6875 4.9375 14.3438 5.125 14.1562L9.28125 10L5.125 5.875C4.9375 5.6875 4.9375 5.34375 5.125 5.15625C5.3125 4.96875 5.65625 4.96875 5.84375 5.15625L10 9.3125L14.125 5.15625C14.3125 4.96875 14.6562 4.96875 14.8438 5.15625C15.0312 5.34375 15.0312 5.6875 14.8438 5.875L10.6875 10L14.8438 14.1562C15.0312 14.3438 15.0312 14.6875 14.8438 14.875Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_34619_4370)'%3E%3Crect width='20' height='20' fill='white'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='9.5' stroke='white'/%3E%3C/svg%3E%0A",
65
+ "color": var(--#{$prefix}danger),
66
+ "icon": "alert-danger",
87
67
  ),
88
- //.alert-error can be a clone of .alert-danger
89
68
  "error": (
90
- color: var(--#{$prefix}danger),
91
- icon:
92
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_34619_4370' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='4' y='4' width='12' height='12'%3E%3Cpath d='M14.8438 14.875C14.6562 15.0625 14.3125 15.0625 14.125 14.875L10 10.7188L5.84375 14.875C5.65625 15.0625 5.3125 15.0625 5.125 14.875C4.9375 14.6875 4.9375 14.3438 5.125 14.1562L9.28125 10L5.125 5.875C4.9375 5.6875 4.9375 5.34375 5.125 5.15625C5.3125 4.96875 5.65625 4.96875 5.84375 5.15625L10 9.3125L14.125 5.15625C14.3125 4.96875 14.6562 4.96875 14.8438 5.15625C15.0312 5.34375 15.0312 5.6875 14.8438 5.875L10.6875 10L14.8438 14.1562C15.0312 14.3438 15.0312 14.6875 14.8438 14.875Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_34619_4370)'%3E%3Crect width='20' height='20' fill='white'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='9.5' stroke='white'/%3E%3C/svg%3E%0A",
93
- ),
69
+ "color": var(--#{$prefix}danger),
70
+ "icon": "alert-danger",
71
+ ),
94
72
  "light": (
95
- color: var(--#{$prefix}light-grey),
96
- icon:
97
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_5702_82508' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='1' y='1' width='18' height='18'%3E%3Cpath d='M10 7.20312C9.48047 7.20312 9.10938 6.83203 9.10938 6.3125C9.10938 5.83008 9.48047 5.42188 10 5.42188C10.4824 5.42188 10.8906 5.83008 10.8906 6.3125C10.8906 6.83203 10.4824 7.20312 10 7.20312ZM15.9375 1.5625C17.2363 1.5625 18.3125 2.63867 18.3125 3.9375V15.8125C18.3125 17.1484 17.2363 18.1875 15.9375 18.1875H4.0625C2.72656 18.1875 1.6875 17.1484 1.6875 15.8125V3.9375C1.6875 2.63867 2.72656 1.5625 4.0625 1.5625H15.9375ZM17.125 15.8125V3.9375C17.125 3.30664 16.5684 2.75 15.9375 2.75H4.0625C3.39453 2.75 2.875 3.30664 2.875 3.9375V15.8125C2.875 16.4805 3.39453 17 4.0625 17H15.9375C16.5684 17 17.125 16.4805 17.125 15.8125ZM11.7812 13.4375C12.0781 13.4375 12.375 13.7344 12.375 14.0312C12.375 14.3652 12.0781 14.625 11.7812 14.625H8.21875C7.88477 14.625 7.625 14.3652 7.625 14.0312C7.625 13.7344 7.88477 13.4375 8.21875 13.4375H9.40625V9.875H8.8125C8.47852 9.875 8.21875 9.61523 8.21875 9.28125C8.21875 8.98438 8.47852 8.6875 8.8125 8.6875H10C10.2969 8.6875 10.5938 8.98438 10.5938 9.28125V13.4375H11.7812Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_5702_82508)'%3E%3Crect width='20' height='20' fill='%23595959'/%3E%3C/g%3E%3C/svg%3E%0A",
73
+ "color": var(--#{$prefix}light-grey),
74
+ "icon": null,
98
75
  ),
99
76
  "dark": (
100
- color: var(--#{$prefix}dark-grey),
101
- icon:
102
- "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='mask0_5702_82508' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='1' y='1' width='18' height='18'%3E%3Cpath d='M10 7.20312C9.48047 7.20312 9.10938 6.83203 9.10938 6.3125C9.10938 5.83008 9.48047 5.42188 10 5.42188C10.4824 5.42188 10.8906 5.83008 10.8906 6.3125C10.8906 6.83203 10.4824 7.20312 10 7.20312ZM15.9375 1.5625C17.2363 1.5625 18.3125 2.63867 18.3125 3.9375V15.8125C18.3125 17.1484 17.2363 18.1875 15.9375 18.1875H4.0625C2.72656 18.1875 1.6875 17.1484 1.6875 15.8125V3.9375C1.6875 2.63867 2.72656 1.5625 4.0625 1.5625H15.9375ZM17.125 15.8125V3.9375C17.125 3.30664 16.5684 2.75 15.9375 2.75H4.0625C3.39453 2.75 2.875 3.30664 2.875 3.9375V15.8125C2.875 16.4805 3.39453 17 4.0625 17H15.9375C16.5684 17 17.125 16.4805 17.125 15.8125ZM11.7812 13.4375C12.0781 13.4375 12.375 13.7344 12.375 14.0312C12.375 14.3652 12.0781 14.625 11.7812 14.625H8.21875C7.88477 14.625 7.625 14.3652 7.625 14.0312C7.625 13.7344 7.88477 13.4375 8.21875 13.4375H9.40625V9.875H8.8125C8.47852 9.875 8.21875 9.61523 8.21875 9.28125C8.21875 8.98438 8.47852 8.6875 8.8125 8.6875H10C10.2969 8.6875 10.5938 8.98438 10.5938 9.28125V13.4375H11.7812Z' fill='%2303213F'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_5702_82508)'%3E%3Crect width='20' height='20' fill='%23FFFFFF'/%3E%3C/g%3E%3C/svg%3E%0A",
77
+ "color": var(--#{$prefix}dark-grey),
78
+ "icon": null,
103
79
  ),
104
80
  );
105
81
 
106
- //Sets colors (border and icon-background) and icons for each alert type
107
- @each $key, $properties in $alert-colors-map {
108
- $color: map-get($properties, color);
109
- $icon: map-get($properties, icon);
82
+ &:before,
83
+ &:after {
84
+ content: "";
85
+ position: absolute;
86
+ left: 0;
87
+ top: 0;
88
+ bottom: 0;
89
+ color: #fff;
90
+ }
91
+
92
+ &:before {
93
+ width: 3rem;
94
+ }
110
95
 
96
+ //Sets border color and icon for each alert type
97
+ @each $key, $values in $alert-icons-map {
111
98
  &-#{$key} {
112
- border-color: $color;
99
+ border-color: map-get($values, "color");
113
100
  border-width: 2px;
114
101
 
115
102
  &:before {
116
- background-color: $color;
103
+ background-color: map-get($values, "color");
117
104
  }
118
105
 
119
- &:after {
120
- background-image: url($icon);
106
+ @if map-get($values, "icon") {
107
+ @include m.make-icon(
108
+ $name: map-get($values, "icon"),
109
+ $size: "md",
110
+ $pseudo: "after"
111
+ ) {
112
+ height: 100%;
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: center;
116
+ color: #fff;
117
+ margin: 0 0.75rem;
118
+ }
121
119
  }
122
120
  }
123
121
  }
@@ -49,9 +49,9 @@ export default {
49
49
  },
50
50
  options: ["alert-success", "alert-info", "alert-warning", "alert-error"],
51
51
  },
52
- alertType: {
53
- name: "Alert Type",
54
- description: `Type of the alert. i.g "Success", "Information", "Warning", "Error".`,
52
+ ariaLabel: {
53
+ name: "ARIA Label",
54
+ description: `Accessible label for the alert announced to screen readers. e.g "Success alert", "Information alert", "Warning alert", "Error alert".`,
55
55
  },
56
56
  headingTag: {
57
57
  name: "Heading Tag",
@@ -88,3 +88,54 @@ export const Dark = {
88
88
  },
89
89
  ],
90
90
  };
91
+
92
+ /**
93
+ * All alert variants with proper accessibility.
94
+ * Each alert includes CSS-based icons and a visually-hidden span for screen readers.
95
+ */
96
+ export const AllVariants = {
97
+ name: "All Alert Types (Accessibility)",
98
+ render: () => {
99
+ const alerts = [
100
+ {
101
+ variantClass: "alert-success",
102
+ ariaLabel: "Success alert",
103
+ heading: "Success Alert",
104
+ content: "<p>This action was completed successfully.</p>",
105
+ },
106
+ {
107
+ variantClass: "alert-info",
108
+ ariaLabel: "Information alert",
109
+ heading: "Information Alert",
110
+ content: "<p>Here is some important information for you to know.</p>",
111
+ },
112
+ {
113
+ variantClass: "alert-warning",
114
+ ariaLabel: "Warning alert",
115
+ heading: "Warning Alert",
116
+ content: "<p>Please be aware of this potential issue.</p>",
117
+ },
118
+ {
119
+ variantClass: "alert-error",
120
+ ariaLabel: "Error alert",
121
+ heading: "Error Alert",
122
+ content: "<p>An error occurred. Please try again.</p>",
123
+ },
124
+ ];
125
+
126
+ return alerts
127
+ .map(
128
+ (alertData) => `
129
+ <div class="mb-4">
130
+ ${new InpageAlert(alertData).html}
131
+ </div>
132
+ `
133
+ )
134
+ .join("");
135
+ },
136
+ parameters: {
137
+ controls: {
138
+ disable: true,
139
+ },
140
+ },
141
+ };
@@ -1,34 +1,35 @@
1
1
  export default {
2
- title: "5. Templates/Theme Showcase",
2
+ title: "5. Templates/Palette Showcase",
3
3
  render: (args) => {
4
4
  return args.content;
5
5
  },
6
6
  argTypes: {
7
- themeClass: {
8
- control: { type: 'select' },
9
- options: ['', 'default', 'light', 'alt', 'dark', 'dark-alt'],
10
- description: 'Theme class to apply to the content area',
7
+ paletteClass: {
8
+ control: { type: "select" },
9
+ options: ["", "default", "light", "alt", "dark", "dark-alt"],
10
+ description: "Palette class to apply to the content area",
11
11
  },
12
12
  },
13
13
  parameters: {
14
14
  layout: "padded",
15
15
  docs: {
16
16
  description: {
17
- story: 'This showcase demonstrates the theme palette classes (.default, .light, .alt, .dark, .dark-alt) that automatically apply color and background-color styling.',
17
+ story:
18
+ "This showcase demonstrates the theme palette classes (.default, .light, .alt, .dark, .dark-alt) that automatically apply color and background-color styling.",
18
19
  },
19
20
  },
20
21
  },
21
22
  };
22
23
 
23
24
  /**
24
- * Default Theme
25
- * The default theme uses the base color scheme without additional background styling
25
+ * Default Palette
26
+ * The default palette uses the base color scheme without additional background styling
26
27
  */
27
- export const DefaultTheme = {
28
+ export const DefaultPalette = {
28
29
  args: {
29
30
  content: `
30
31
  <div class="default p-4 mb-4 border">
31
- <h2>Default Theme</h2>
32
+ <h2>Default Palette</h2>
32
33
  <p>This demonstrates the default theme palette. It provides a clean, neutral appearance suitable for most content.</p>
33
34
  <a href="#" class="btn btn-primary me-2">Primary Button</a>
34
35
  <a href="#" class="btn btn-secondary">Secondary Button</a>
@@ -60,19 +61,19 @@ export const DefaultTheme = {
60
61
  };
61
62
 
62
63
  /**
63
- * Light Theme
64
- * The light theme provides a bright, clean appearance
64
+ * Light Palette
65
+ * The light palette provides a bright, clean appearance
65
66
  */
66
- export const LightTheme = {
67
+ export const LightPalette = {
67
68
  args: {
68
69
  content: `
69
70
  <div class="light p-4 mb-4 border">
70
- <h2>Light Theme</h2>
71
+ <h2>Light Palette</h2>
71
72
  <p>This demonstrates the light theme palette. It provides enhanced readability with a light background.</p>
72
73
  <a href="#" class="btn btn-primary me-2">Primary Button</a>
73
74
  <a href="#" class="btn btn-secondary">Secondary Button</a>
74
75
 
75
- <h3 class="mt-4">Theme Features</h3>
76
+ <h3 class="mt-4">Palette Features</h3>
76
77
  <ul>
77
78
  <li>Automatic color and background-color application</li>
78
79
  <li>Optimized contrast ratios</li>
@@ -84,14 +85,14 @@ export const LightTheme = {
84
85
  };
85
86
 
86
87
  /**
87
- * Alt Theme
88
+ * Alt Palette
88
89
  * The alt theme provides an alternative light styling
89
90
  */
90
- export const AltTheme = {
91
+ export const AltPalette = {
91
92
  args: {
92
93
  content: `
93
94
  <div class="alt p-4 mb-4 border">
94
- <h2>Alt Theme</h2>
95
+ <h2>Alt Palette</h2>
95
96
  <p>This demonstrates the alt theme palette. It provides a subtle alternative to the standard light theme.</p>
96
97
  <a href="#" class="btn btn-primary me-2">Primary Button</a>
97
98
  <a href="#" class="btn btn-secondary">Secondary Button</a>
@@ -106,14 +107,14 @@ export const AltTheme = {
106
107
  };
107
108
 
108
109
  /**
109
- * Dark Theme
110
+ * Dark Palette
110
111
  * The dark theme provides a bold, high-contrast appearance
111
112
  */
112
- export const DarkTheme = {
113
+ export const DarkPalette = {
113
114
  args: {
114
115
  content: `
115
116
  <div class="dark p-4 mb-4 border">
116
- <h2>Dark Theme</h2>
117
+ <h2>Dark Palette</h2>
117
118
  <p>This demonstrates the dark theme palette. It provides excellent contrast and a modern appearance.</p>
118
119
  <a href="#" class="btn btn-primary me-2">Primary Button</a>
119
120
  <a href="#" class="btn btn-secondary">Secondary Button</a>
@@ -128,14 +129,14 @@ export const DarkTheme = {
128
129
  };
129
130
 
130
131
  /**
131
- * Dark Alt Theme
132
+ * Dark Alt Palette
132
133
  * The dark alt theme provides an alternative dark styling
133
134
  */
134
- export const DarkAltTheme = {
135
+ export const DarkAltPalette = {
135
136
  args: {
136
137
  content: `
137
138
  <div class="dark-alt p-4 mb-4 border">
138
- <h2>Dark Alt Theme</h2>
139
+ <h2>Dark Alt Palette</h2>
139
140
  <p>This demonstrates the dark alt theme palette. It provides a variation of the dark theme with different background styling.</p>
140
141
  <a href="#" class="btn btn-primary me-2">Primary Button</a>
141
142
  <a href="#" class="btn btn-secondary">Secondary Button</a>
@@ -161,21 +162,21 @@ export const DarkAltTheme = {
161
162
  };
162
163
 
163
164
  /**
164
- * Theme Comparison
165
- * Shows all themes in a single view for comparison
165
+ * Palette Comparison
166
+ * Shows all palettes in a single view for comparison
166
167
  */
167
- export const ThemeComparison = {
168
+ export const PaletteComparison = {
168
169
  args: {
169
170
  content: `
170
171
  <div class="mb-4">
171
- <h2>Theme Palette Comparison</h2>
172
- <p>Compare all available theme classes side by side. Each theme automatically applies appropriate color and background-color styling.</p>
172
+ <h2>Palette Comparison</h2>
173
+ <p>Compare all available palette classes side by side. Each theme automatically applies appropriate color and background-color styling.</p>
173
174
  </div>
174
175
 
175
176
  <div class="row g-4">
176
177
  <div class="col-lg-6">
177
178
  <div class="default p-3 border">
178
- <h3>Default Theme</h3>
179
+ <h3>Default Palette</h3>
179
180
  <p>Base theme with neutral styling.</p>
180
181
  <a href="#" class="btn btn-sm btn-primary">Button</a>
181
182
  </div>
@@ -183,7 +184,7 @@ export const ThemeComparison = {
183
184
 
184
185
  <div class="col-lg-6">
185
186
  <div class="light p-3 border">
186
- <h3>Light Theme</h3>
187
+ <h3>Light Palette</h3>
187
188
  <p>Clean, bright appearance.</p>
188
189
  <a href="#" class="btn btn-sm btn-primary">Button</a>
189
190
  </div>
@@ -191,7 +192,7 @@ export const ThemeComparison = {
191
192
 
192
193
  <div class="col-lg-6">
193
194
  <div class="alt p-3 border">
194
- <h3>Alt Theme</h3>
195
+ <h3>Alt Palette</h3>
195
196
  <p>Alternative light styling.</p>
196
197
  <a href="#" class="btn btn-sm btn-primary">Button</a>
197
198
  </div>
@@ -199,7 +200,7 @@ export const ThemeComparison = {
199
200
 
200
201
  <div class="col-lg-6">
201
202
  <div class="dark p-3 border">
202
- <h3>Dark Theme</h3>
203
+ <h3>Dark Palette</h3>
203
204
  <p>High contrast, modern look.</p>
204
205
  <a href="#" class="btn btn-sm btn-primary">Button</a>
205
206
  </div>
@@ -207,7 +208,7 @@ export const ThemeComparison = {
207
208
 
208
209
  <div class="col-12">
209
210
  <div class="dark-alt p-3 border">
210
- <h3>Dark Alt Theme</h3>
211
+ <h3>Dark Alt Palette</h3>
211
212
  <p>Alternative dark styling with different background treatment.</p>
212
213
  <a href="#" class="btn btn-sm btn-primary">Button</a>
213
214
  </div>
@@ -216,7 +217,7 @@ export const ThemeComparison = {
216
217
 
217
218
  <div class="mt-5">
218
219
  <h3>Background Utility Classes</h3>
219
- <p>These utilities can be used independently of theme classes for specific background styling:</p>
220
+ <p>These utilities can be used independently of palette classes for specific background styling:</p>
220
221
  <div class="row g-3">
221
222
  <div class="col-md-3">
222
223
  <div class="bg-default p-2 text-center rounded">.bg-default</div>
@@ -230,9 +231,6 @@ export const ThemeComparison = {
230
231
  <div class="col-md-3">
231
232
  <div class="bg-dark p-2 text-center rounded text-white">.bg-dark</div>
232
233
  </div>
233
- <div class="col-md-3">
234
- <div class="bg-dark-alt p-2 text-center rounded text-white">.bg-dark-alt</div>
235
- </div>
236
234
  <div class="col-md-3">
237
235
  <div class="bg-default-shade p-2 text-center rounded">.bg-default-shade</div>
238
236
  </div>
@@ -242,6 +240,10 @@ export const ThemeComparison = {
242
240
  <div class="col-md-3">
243
241
  <div class="bg-light-alt-shade p-2 text-center rounded">.bg-light-alt-shade</div>
244
242
  </div>
243
+ <div class="col-md-3">
244
+ <div class="bg-dark-alt p-2 text-center rounded text-white">.bg-dark-alt</div>
245
+ </div>
246
+
245
247
  </div>
246
248
  </div>
247
249
  `,
@@ -6,40 +6,36 @@ exports[`SearchInput > Renders as expected 1`] = `
6
6
  -->
7
7
  <div class="qld-search-input ">
8
8
  <input id="search" name="query" class="form-control" type="text" autocomplete="off"
9
- aria-label="Search website" data-collection="qgov~sp-search" data-profile="qld" data-numranks="10" data-tiers="off" data-suggestions="https://discover.search.qld.gov.au/s/suggest.json" data-results-url="https://discover.search.qld.gov.au/s/search.json" />
9
+ aria-label="Search website" data-collection="qgov~sp-search" data-profile="qld" data-numranks="10" data-tiers="off" data-suggestions="https://discover.search.qld.gov.au/s/suggest.json" data-results-url="https://discover.search.qld.gov.au/s/search.json" placeholder="" />
10
10
  <button class="btn btn-primary" type="submit" id="search-button">
11
11
  <span class="btn-icon"></span>
12
12
  <span class="btn-label">Search</span>
13
13
  </button>
14
- <div class="suggestions suggestions__group d-none">
15
- <div class="default-suggestions">
16
- <div class="suggestions-category mt-16">
17
- <strong class="suggestions-category-label d-block">Popular services</strong>
18
- <ul class="mt-2">
19
- <li><a href="https://www.forgov.qld.gov.au/pay-benefits-and-policy/leave/submit-a-leave-application">Apply for leave</a></li>
20
- <li><a href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/starting-a-new-job/apply-for-higher-duties-or-relieving-at-level">Apply for higher duties or relieving at level</a></li>
21
- <li><a href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/recruitment/extending-my-job/extend-a-temporary-or-casual-employee">Extend a temporary or casual employee</a></li>
22
- <li><a href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/recruitment">Hire a staff member (recruitment)</a></li>
23
- </ul>
24
- </div>
25
-
26
- <div class="suggestions-category mt-16">
27
- <strong class="suggestions-category-label d-block">Browse by category</strong>
28
- <ul class="mt-12 mb-0">
29
- <li><a href="https://www.forgov.qld.gov.au/pay-benefits-and-policy/directives-policies-circulars-and-guidelines">Search for directives, policies, circulars, and guidelines</a></li>
30
- <li><a href="https://www.forgov.qld.gov.au/pay-benefits-and-policy/benefits/employee-pay-and-benefits">Employee pay and benefits</a></li>
31
- <li><a href="https://www.forgov.qld.gov.au/sandbox/archive/queensland-shared-services">Queensland Shared Services</a></li>
32
- <li><a href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/career-development">Career development</a></li>
33
- </ul>
34
- </div>
35
-
36
- <div class="suggestions-category">
37
- <a class="px-16 pt-12 pb-16 d-block suggestions-category-view-more"
38
- href="/queenslanders">Browse all categories</a>
14
+
15
+ <div class="suggestions suggestions__group default">
16
+ <div class="default-suggestions">
17
+ <div class="suggestions-category">
18
+ <strong class="suggestions-category-label d-block">Popular</strong>
19
+ <ul>
20
+ <li><a tabindex="0" href="https://www.forgov.qld.gov.au/pay-benefits-and-policy/leave/submit-a-leave-application">Apply for leave now</a></li>
21
+ <li><a tabindex="0" href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/starting-a-new-job/apply-for-higher-duties-or-relieving-at-level">Apply for higher duties or relieving at level</a></li>
22
+ <li><a tabindex="0" href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/recruitment/extending-my-job/extend-a-temporary-or-casual-employee">Extend a temporary or casual employee</a></li>
23
+ <li><a tabindex="0" href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/recruitment">Hire a staff member (recruitment)</a></li>
24
+ <li><a tabindex="0" href="/queenslanders" class="view-more">View more</a></li>
25
+ </ul>
26
+ </div>
27
+ <div class="suggestions-category">
28
+ <strong class="suggestions-category-label d-block">Collection</strong>
29
+ <ul>
30
+ <li><a tabindex="0"href="https://www.forgov.qld.gov.au/pay-benefits-and-policy/directives-policies-circulars-and-guidelines">Search for directives, policies, circulars, and guidelines</a></li>
31
+ <li><a tabindex="0"href="https://www.forgov.qld.gov.au/pay-benefits-and-policy/benefits/employee-pay-and-benefits">Employee pay and benefits</a></li>
32
+ <li><a tabindex="0"href="https://www.forgov.qld.gov.au/sandbox/archive/queensland-shared-services">Queensland Shared Services</a></li>
33
+ <li><a tabindex="0"href="https://www.forgov.qld.gov.au/recruitment-performance-and-career/career-development">Career development</a></li>
34
+ <li><a tabindex="0" href="/queenslanders" class="view-more">View all</a></li>
35
+ </ul>
36
+ </div>
39
37
  </div>
40
- </div>
41
- <div class="dynamic-suggestions"></div>
38
+ <div class="dynamic-suggestions" data-view-more="/queenslanders"></div>
42
39
  </div>
43
-
44
40
  </div>"
45
41
  `;