nsw-design-system 3.26.3 → 3.28.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 (71) hide show
  1. package/README.md +3 -3
  2. package/package.json +5 -3
  3. package/src/components/card/_card.scss +15 -0
  4. package/src/components/content-block/_content-block.scss +14 -0
  5. package/src/components/hero-search/_hero-search.scss +1 -0
  6. package/src/components/link-list/_link-list.scss +4 -2
  7. package/src/components/main-nav/_main-nav.scss +12 -0
  8. package/src/components/side-nav/_side-nav.scss +85 -3
  9. package/src/components/utility-list/_utility-list.scss +26 -0
  10. package/src/components/utility-list/utility-list.js +3 -3
  11. package/src/core/layout/heading-links.js +8 -0
  12. package/src/core/typography/_typography.scss +0 -1
  13. package/src/docs/content/methods/easy-read/_easy-read.scss +345 -0
  14. package/src/global/scripts/helpers/utilities.js +24 -7
  15. package/src/global/scss/settings/_settings.scss +3 -0
  16. package/src/main.scss +1 -0
  17. package/dist/css/core.css +0 -2
  18. package/dist/css/core.css.map +0 -1
  19. package/dist/css/main.css +0 -3
  20. package/dist/css/main.css.map +0 -1
  21. package/dist/js/components/accordion/accordion-css.d.ts +0 -8
  22. package/dist/js/components/accordion/accordion.d.ts +0 -27
  23. package/dist/js/components/back-to-top/back-to-top.d.ts +0 -24
  24. package/dist/js/components/breadcrumbs/breadcrumbs.d.ts +0 -11
  25. package/dist/js/components/card-carousel/carousel.d.ts +0 -103
  26. package/dist/js/components/card-carousel/swipe-content.d.ts +0 -20
  27. package/dist/js/components/cookie-consent/cookie-consent.d.ts +0 -29
  28. package/dist/js/components/date-picker/date-picker.d.ts +0 -83
  29. package/dist/js/components/dialog/dialog.d.ts +0 -24
  30. package/dist/js/components/file-upload/file-upload.d.ts +0 -18
  31. package/dist/js/components/filters/filters.d.ts +0 -59
  32. package/dist/js/components/global-alert/global-alert.d.ts +0 -12
  33. package/dist/js/components/header/header.d.ts +0 -12
  34. package/dist/js/components/link/link.d.ts +0 -12
  35. package/dist/js/components/main-nav/main-nav.d.ts +0 -50
  36. package/dist/js/components/popover/popover.d.ts +0 -33
  37. package/dist/js/components/quick-exit/quick-exit.d.ts +0 -42
  38. package/dist/js/components/select/select.d.ts +0 -89
  39. package/dist/js/components/side-nav/side-nav.d.ts +0 -11
  40. package/dist/js/components/tabs/tabs.d.ts +0 -29
  41. package/dist/js/components/tooltip/toggletip.d.ts +0 -40
  42. package/dist/js/components/tooltip/tooltip.d.ts +0 -27
  43. package/dist/js/components/utility-list/utility-list.d.ts +0 -19
  44. package/dist/js/core/layout/heading-links.d.ts +0 -2
  45. package/dist/js/docs/autocomplete.d.ts +0 -56
  46. package/dist/js/docs/chart-utilities.d.ts +0 -552
  47. package/dist/js/docs/charts-and-graphs.d.ts +0 -1
  48. package/dist/js/docs/color-swatches.d.ts +0 -29
  49. package/dist/js/docs/cookie-consent-config.d.ts +0 -0
  50. package/dist/js/docs/data.d.ts +0 -7
  51. package/dist/js/docs/docs.d.ts +0 -1
  52. package/dist/js/docs/download-pdf.d.ts +0 -11
  53. package/dist/js/docs/expandable-search.d.ts +0 -10
  54. package/dist/js/global/handlebars/helpers/capitalize.d.ts +0 -2
  55. package/dist/js/global/handlebars/helpers/change-extention.d.ts +0 -2
  56. package/dist/js/global/handlebars/helpers/current-year.d.ts +0 -1
  57. package/dist/js/global/handlebars/helpers/debug.d.ts +0 -2
  58. package/dist/js/global/handlebars/helpers/encodeUrl.d.ts +0 -2
  59. package/dist/js/global/handlebars/helpers/getTextColor.d.ts +0 -2
  60. package/dist/js/global/handlebars/helpers/hyphenate.d.ts +0 -2
  61. package/dist/js/global/handlebars/helpers/if-equals.d.ts +0 -2
  62. package/dist/js/global/handlebars/helpers/or.d.ts +0 -2
  63. package/dist/js/global/handlebars/helpers/split.d.ts +0 -2
  64. package/dist/js/global/handlebars/helpers/starts-with.d.ts +0 -2
  65. package/dist/js/global/scripts/helpers/logger.d.ts +0 -5
  66. package/dist/js/global/scripts/helpers/sanitize.d.ts +0 -3
  67. package/dist/js/global/scripts/helpers/utilities.d.ts +0 -26
  68. package/dist/js/global/scripts/helpers/utilities.test.d.ts +0 -1
  69. package/dist/js/global/scripts/sticky-container.d.ts +0 -11
  70. package/dist/js/main.d.ts +0 -23
  71. package/dist/js/main.js +0 -7597
package/README.md CHANGED
@@ -28,7 +28,7 @@ We recommend the following methods:
28
28
 
29
29
  4. **Using JSDelivr CDN:** If you prefer a quicker setup, you can use the JSDelivr content delivery network to directly include the design system's CSS and JavaScript files in your project.
30
30
 
31
- Read the [Getting started page](https://designsystem.nsw.gov.au/docs/content/develop/getting-started.html) for information on the framework contents, templates, examples, and more.
31
+ Read the [Getting started page](https://designsystem.nsw.gov.au/get-started/for-developers.html) for information on the framework contents, templates, examples, and more.
32
32
 
33
33
  ## Installing with NPM
34
34
 
@@ -144,7 +144,7 @@ View and raise issues and bugs through our [Issues tracker on GitHub](https://gi
144
144
 
145
145
  ## Design System Figma UI Kit
146
146
 
147
- Access the complete set of design assets required for designing, sharing, and prototyping using our [Figma UI Kit](https://designsystem.nsw.gov.au/docs/content/design/figma-ui-kit.html).
147
+ Access the complete set of design assets required for designing, sharing, and prototyping using our [Figma UI Kit](https://designsystem.nsw.gov.au/get-started/figma-ui-kit.html).
148
148
 
149
149
  ## Versioning
150
150
 
@@ -158,6 +158,6 @@ Our version numbers consist of MAJOR.MINOR.PATCH, where:
158
158
 
159
159
  * **PATCH** version is used for minor backward-compatible updates, new component variations, and bug fixes.
160
160
 
161
- See [the Releases section of our GitHub project](https://github.com/digitalnsw/nsw-design-system/releases) for release notes for each release version. Release posts on our [release notes page](https://designsystem.nsw.gov.au/docs/content/about/release-notes.html) contain summaries of the most noteworthy changes made in each release.
161
+ See [the Releases section of our GitHub project](https://github.com/digitalnsw/nsw-design-system/releases) for release notes for each release version. Release posts on our [release notes page](https://designsystem.nsw.gov.au/release-notes/index.html) contain summaries of the most noteworthy changes made in each release.
162
162
 
163
163
  Feel free to reach out if you have any questions or need more help with integrating the NSW Design System into your projects!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsw-design-system",
3
- "version": "3.26.3",
3
+ "version": "3.28.0",
4
4
  "description": "Design system for Digital NSW",
5
5
  "main": "dist/js/main.js",
6
6
  "types": "dist/js/main.d.ts",
@@ -16,15 +16,16 @@
16
16
  "files": [
17
17
  "dist/{css,js}/**/*.{css,d.ts,js,map}",
18
18
  "src/{components,patterns,styles,core}/**/*.{scss,js}",
19
+ "src/docs/content/methods/easy-read/_easy-read.scss",
19
20
  "src/global/{scripts,scss}/**/*.{scss,js}",
20
21
  "src/main.{scss,js}"
21
22
  ],
22
23
  "repository": {
23
24
  "type": "git",
24
- "url": "https://github.com/digitalnsw/nsw-design-system.git"
25
+ "url": "https://github.com/NSWGTP/nsw-design-system.git"
25
26
  },
26
27
  "bugs": {
27
- "url": "https://github.com/digitalnsw/nsw-design-system/issues"
28
+ "url": "https://github.com/NSWGTP/nsw-design-system/issues"
28
29
  },
29
30
  "homepage": "https://www.digital.nsw.gov.au/digital-design-system",
30
31
  "scripts": {
@@ -46,6 +47,7 @@
46
47
  "release-local:major": "npm run bump:major && redrun starterkit:build surge changelog:build commit git-tag -s && npm publish",
47
48
  "release-local:minor": "npm run bump:minor && redrun starterkit:build surge changelog:build commit git-tag -s && npm publish",
48
49
  "release-local:patch": "npm run bump:patch && redrun starterkit:build surge changelog:build commit git-tag -s && npm publish",
50
+ "test:docs-ia": "node scripts/validate-docs-ia.js",
49
51
  "test:a11y": "node a11y-test.js",
50
52
  "test:a11y-local": "DISABLE_PROXY=true BASE_URL=http://localhost:3000 FULL_SWEEP=true node a11y-test.js"
51
53
  },
@@ -105,6 +105,21 @@
105
105
  color: var(--nsw-text-dark);
106
106
  }
107
107
  }
108
+
109
+ .nsw-link--icon {
110
+ > span {
111
+ text-decoration: none;
112
+ }
113
+
114
+ .nsw-material-icons,
115
+ svg {
116
+ position: static;
117
+ color: inherit;
118
+ font-size: nsw.rem(map.get(nsw.$nsw-icon-sizes, 20));
119
+ line-height: 1;
120
+ vertical-align: middle;
121
+ }
122
+ }
108
123
  }
109
124
 
110
125
  &__copy {
@@ -57,4 +57,18 @@
57
57
  &__icon {
58
58
  margin-bottom: nsw.rem(12px);
59
59
  }
60
+
61
+ &__pictogram {
62
+ width: nsw.rem(48px);
63
+ height: nsw.rem(48px);
64
+
65
+ > svg,
66
+ > img {
67
+ box-sizing: border-box;
68
+ display: block;
69
+ width: 100%;
70
+ height: 100%;
71
+ padding: nsw.rem(3px);
72
+ }
73
+ }
60
74
  }
@@ -23,6 +23,7 @@
23
23
  padding: nsw.rem(32px) nsw.rem(16px);
24
24
  background-color: var(--nsw-off-white);
25
25
  border-bottom: solid 4px var(--nsw-brand-accent);
26
+ color: var(--nsw-text-dark);
26
27
 
27
28
  @include nsw.breakpoint('md') {
28
29
  border-top-left-radius: var(--nsw-border-radius);
@@ -47,9 +47,11 @@
47
47
  outline-width: 3px;
48
48
  }
49
49
 
50
- span {
51
- text-decoration: underline;
50
+ &.nsw-link--icon span {
51
+ text-decoration: none;
52
+ }
52
53
 
54
+ span {
53
55
  span.nsw-material-icons {
54
56
  bottom: nsw.rem(-5px);
55
57
  }
@@ -91,6 +91,10 @@
91
91
  }
92
92
  }
93
93
 
94
+ > li > a:not([href]) {
95
+ cursor: pointer;
96
+ }
97
+
94
98
  > li > a {
95
99
  @include nsw.breakpoint(nsw.$nsw-desktop-breakpoint) {
96
100
  .nsw-material-icons {
@@ -193,6 +197,14 @@
193
197
  a {
194
198
  font-weight: var(--nsw-font-bold);
195
199
 
200
+ &:not([href]) {
201
+ cursor: default;
202
+
203
+ &:hover {
204
+ background-color: transparent;
205
+ }
206
+ }
207
+
196
208
  .nsw-material-icons {
197
209
  display: none;
198
210
 
@@ -1,3 +1,4 @@
1
+ @use 'sass:map';
1
2
  @use '../../global/scss/tools' as nsw;
2
3
 
3
4
  .nsw-side-nav {
@@ -37,6 +38,10 @@
37
38
  > a {
38
39
  font-weight: var(--nsw-font-bold);
39
40
  }
41
+
42
+ > .nsw-side-nav__group > summary {
43
+ font-weight: var(--nsw-font-bold);
44
+ }
40
45
  }
41
46
  }
42
47
 
@@ -49,7 +54,8 @@
49
54
  text-wrap: pretty;
50
55
 
51
56
  &.current {
52
- background-color: var(--nsw-off-white);
57
+ background-color: var(--nsw-side-nav-current-bg, var(--nsw-off-white));
58
+ font-weight: var(--nsw-font-bold);
53
59
 
54
60
  .nsw-section--invert & {
55
61
  background-color: var(--nsw-active-light);
@@ -60,7 +66,7 @@
60
66
  @include nsw.nsw-hover;
61
67
  outline-width: 0;
62
68
 
63
- .nsw-section--invert & {
69
+ .nsw-section--invert & {
64
70
  @include nsw.nsw-hover-light;
65
71
  outline-width: 0;
66
72
  }
@@ -75,6 +81,78 @@
75
81
  }
76
82
  }
77
83
 
84
+ &__group {
85
+ interpolate-size: allow-keywords; /* stylelint-disable-line property-no-unknown -- experimental details animation property */
86
+
87
+ &::details-content {
88
+ block-size: 0;
89
+ overflow: hidden;
90
+ transition: block-size nsw.$nsw-transition-duration-smooth, content-visibility nsw.$nsw-transition-duration-smooth; /* stylelint-disable-line property-no-unknown -- experimental details animation property */
91
+ transition-behavior: allow-discrete; /* stylelint-disable-line property-no-unknown -- experimental details animation property */
92
+ }
93
+
94
+ &[open]::details-content {
95
+ block-size: auto;
96
+ }
97
+
98
+ summary {
99
+ position: relative;
100
+ font-weight: var(--nsw-font-normal);
101
+ display: block;
102
+ color: var(--nsw-text-dark);
103
+ padding: nsw.rem(16px) nsw.rem(48px) nsw.rem(16px) nsw.rem(16px);
104
+ cursor: pointer;
105
+ text-wrap: pretty;
106
+ user-select: none;
107
+ list-style: none;
108
+
109
+ &::-webkit-details-marker {
110
+ display: none;
111
+ }
112
+
113
+ &::after {
114
+ content: '\e313';
115
+ position: absolute;
116
+ transform: translateY(-50%);
117
+ top: 50%;
118
+ right: nsw.rem(8px);
119
+ font-size: nsw.rem(map.get(nsw.$nsw-icon-sizes, 24));
120
+ font-weight: var(--nsw-font-normal);
121
+ color: var(--nsw-brand-dark);
122
+ transition: transform nsw.$nsw-transition-duration-smooth, color nsw.$nsw-transition-duration-smooth;
123
+ pointer-events: none;
124
+
125
+ @include nsw.material-icons;
126
+ }
127
+
128
+ &:hover {
129
+ @include nsw.nsw-hover;
130
+ outline-width: 0;
131
+
132
+ .nsw-section--invert & {
133
+ @include nsw.nsw-hover-light;
134
+ outline-width: 0;
135
+ }
136
+ }
137
+
138
+ .nsw-section--invert &:hover::after {
139
+ color: var(--nsw-brand-dark);
140
+ }
141
+
142
+ &:focus {
143
+ outline-width: 3px;
144
+ }
145
+
146
+ .nsw-section--invert & {
147
+ color: var(--nsw-text-light);
148
+ }
149
+ }
150
+
151
+ &[open] summary::after {
152
+ transform: translateY(-50%) rotate(180deg);
153
+ }
154
+ }
155
+
78
156
  &__header {
79
157
  border-bottom: solid 2px var(--nsw-brand-dark);
80
158
 
@@ -82,7 +160,9 @@
82
160
  border-color: var(--nsw-brand-light);
83
161
  }
84
162
 
85
- a {
163
+ a,
164
+ > span {
165
+ display: block;
86
166
  font-weight: var(--nsw-font-bold);
87
167
  padding: nsw.rem(8px) 0;
88
168
  }
@@ -126,6 +206,8 @@
126
206
  }
127
207
 
128
208
  .material-icons {
209
+ font-size: nsw.rem(map.get(nsw.$nsw-icon-sizes, 24));
210
+ line-height: 1;
129
211
  transition: transform 0.3s ease;
130
212
  transform: rotate(0deg);
131
213
  }
@@ -95,6 +95,32 @@
95
95
  }
96
96
  }
97
97
 
98
+ &__item--link {
99
+ padding: 0;
100
+ }
101
+
102
+ &__link {
103
+ width: 100%;
104
+ padding: nsw.rem(16px);
105
+ display: flex;
106
+ gap: nsw.$grid-gutters;
107
+ align-items: center;
108
+ color: inherit;
109
+ text-decoration: none;
110
+
111
+ &:visited {
112
+ color: inherit;
113
+ }
114
+
115
+ &:hover {
116
+ outline-width: 0;
117
+ }
118
+
119
+ &:focus {
120
+ @include nsw.nsw-focus;
121
+ }
122
+ }
123
+
98
124
  .nsw-toggletip {
99
125
  border-bottom: unset;
100
126
 
@@ -1,6 +1,6 @@
1
1
  import Toggletip from '../tooltip/toggletip'
2
2
  import logger from '../../global/scripts/helpers/logger'
3
- import { copyToClipboard as writeToClipboard } from '../../global/scripts/helpers/utilities'
3
+ import { copyToClipboard as writeToClipboard, popupWindow } from '../../global/scripts/helpers/utilities'
4
4
 
5
5
  class UtilityList extends Toggletip {
6
6
  constructor(element, toggletip = element.querySelector('.js-share')) {
@@ -36,7 +36,7 @@ class UtilityList extends Toggletip {
36
36
  if (social === 'mail') {
37
37
  window.location.href = url
38
38
  } else {
39
- window.open(url, `${social}-share-dialog`, 'width=626,height=436')
39
+ popupWindow(url, 626, 436)
40
40
  }
41
41
  })
42
42
  }
@@ -89,7 +89,7 @@ class UtilityList extends Toggletip {
89
89
 
90
90
  params.forEach((param) => {
91
91
  let paramValue = button.getAttribute(`data-${param}`)
92
- if (param === 'hashtags') paramValue = encodeURI(paramValue.replace(/#| /g, ''))
92
+ if (param === 'hashtags' && paramValue) paramValue = encodeURI(paramValue.replace(/#| /g, ''))
93
93
  if (paramValue) {
94
94
  if (social === 'facebook') {
95
95
  newUrl = `${newUrl}u=${encodeURIComponent(paramValue)}&`
@@ -6,6 +6,13 @@ const hasDocument = typeof document !== 'undefined' && hasWindow
6
6
  export const copyHeadingsClass = 'js-copy-headings'
7
7
 
8
8
  const headingSelector = 'h2'
9
+ const headingExclusionSelector = [
10
+ '.nsw-card__title',
11
+ '.nsw-carousel',
12
+ '.nsw-steps',
13
+ 'dialog',
14
+ '[role="dialog"]',
15
+ ].join(', ')
9
16
  const headingWrapperClass = 'nsw-heading-link'
10
17
  const headingClass = 'nsw-heading-link__heading'
11
18
  const headingInitAttr = 'data-heading-link-init'
@@ -298,6 +305,7 @@ export default function headingLinks() {
298
305
  roots.forEach((root) => {
299
306
  const headings = root.querySelectorAll(headingSelector)
300
307
  headings.forEach((heading) => {
308
+ if (heading.closest(headingExclusionSelector)) return
301
309
  if (heading.getAttribute(headingInitAttr) === '1') return
302
310
  enhanceHeading(heading, usedIds)
303
311
  })
@@ -240,7 +240,6 @@ h6,
240
240
  line-height: var(--nsw-line-height);
241
241
  }
242
242
 
243
-
244
243
  a {
245
244
  @include nsw.link;
246
245