@nswds/tokens 2.4.0 → 2.4.1

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.
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nswds/tokens",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "NSW Application Design System Design Tokens",
5
5
  "homepage": "https://github.com/digitalnsw/nswds-tokens#readme",
6
6
  "repository": {
@@ -16,7 +16,8 @@
16
16
  "lint": "npx eslint . ",
17
17
  "format": "npx prettier --write .",
18
18
  "copy-styles": "cp -r src/{css,figma,js,json,less,scss,tailwind,ts} dist/",
19
- "build": "tsup src/index.ts --format esm,cjs --dts --target esnext --treeshake --clean"
19
+ "build": "tsup src/index.ts --format esm,cjs --dts --target esnext --treeshake --clean",
20
+ "test:tokens": "tsx test/token-imports/esm-typescript.ts"
20
21
  },
21
22
  "tsup": {
22
23
  "entry": [
@@ -40,19 +41,16 @@
40
41
  "onSuccess": "npm run copy-styles"
41
42
  },
42
43
  "author": "NSW Design System",
43
- "type": "commonjs",
44
+ "type": "module",
44
45
  "main": "dist/index.cjs",
45
46
  "module": "dist/index.mjs",
46
47
  "types": "dist/index.d.ts",
47
48
  "exports": {
48
49
  ".": {
49
50
  "types": "./dist/index.d.ts",
50
- "import": "./dist/index.mjs",
51
+ "import": "./dist/index.js",
51
52
  "require": "./dist/index.cjs"
52
- },
53
- "./src/css/*": "./src/css/*",
54
- "./src/scss/*": "./src/scss/*",
55
- "./src/less/*": "./src/less/*"
53
+ }
56
54
  },
57
55
  "publishConfig": {
58
56
  "access": "public",
@@ -76,10 +74,11 @@
76
74
  "semantic-release": "^24.2.3",
77
75
  "style-loader": "^4.0.0",
78
76
  "tsup": "^8.0.2",
77
+ "tsx": "^4.0.0",
79
78
  "typescript": "^5.8.2",
80
79
  "typescript-eslint": "^8.28.0"
81
80
  },
82
81
  "dependencies": {
83
82
  "@eslint/eslintrc": "^3.3.1"
84
83
  }
85
- }
84
+ }
package/src/index.ts CHANGED
@@ -1,83 +1,84 @@
1
+ /* eslint-disable */
1
2
  // JSON Tokens Imports
2
- const globalColorHex = require('../tokens/global/color/hex.json');
3
- const globalColorHsl = require('../tokens/global/color/hsl.json');
4
- const globalColorOklch = require('../tokens/global/color/oklch.json');
5
- const globalColorRgb = require('../tokens/global/color/rgb.json');
3
+ const globalColorHex = require('../tokens/global/color/hex.json')
4
+ const globalColorHsl = require('../tokens/global/color/hsl.json')
5
+ const globalColorOklch = require('../tokens/global/color/oklch.json')
6
+ const globalColorRgb = require('../tokens/global/color/rgb.json')
6
7
 
7
- const masterbrandColorHex = require('../tokens/themes/masterbrand/color/hex.json');
8
- const masterbrandColorHsl = require('../tokens/themes/masterbrand/color/hsl.json');
9
- const masterbrandColorOklch = require('../tokens/themes/masterbrand/color/oklch.json');
10
- const masterbrandColorRgb = require('../tokens/themes/masterbrand/color/rgb.json');
8
+ const masterbrandColorHex = require('../tokens/themes/masterbrand/color/hex.json')
9
+ const masterbrandColorHsl = require('../tokens/themes/masterbrand/color/hsl.json')
10
+ const masterbrandColorOklch = require('../tokens/themes/masterbrand/color/oklch.json')
11
+ const masterbrandColorRgb = require('../tokens/themes/masterbrand/color/rgb.json')
11
12
 
12
13
  // CSS Imports
13
- import * as globalCssHex from './css/colors/global/hex.css';
14
- import * as globalCssHsl from './css/colors/global/hsl.css';
15
- import * as globalCssOklch from './css/colors/global/oklch.css';
16
- import * as globalCssRgb from './css/colors/global/rgb.css';
17
- import * as masterbrandCssHex from './css/colors/themes/masterbrand/hex.css';
18
- import * as masterbrandCssHsl from './css/colors/themes/masterbrand/hsl.css';
19
- import * as masterbrandCssOklch from './css/colors/themes/masterbrand/oklch.css';
20
- import * as masterbrandCssRgb from './css/colors/themes/masterbrand/rgb.css';
14
+ import * as globalCssHex from './css/colors/global/hex.css'
15
+ import * as globalCssHsl from './css/colors/global/hsl.css'
16
+ import * as globalCssOklch from './css/colors/global/oklch.css'
17
+ import * as globalCssRgb from './css/colors/global/rgb.css'
18
+ import * as masterbrandCssHex from './css/colors/themes/masterbrand/hex.css'
19
+ import * as masterbrandCssHsl from './css/colors/themes/masterbrand/hsl.css'
20
+ import * as masterbrandCssOklch from './css/colors/themes/masterbrand/oklch.css'
21
+ import * as masterbrandCssRgb from './css/colors/themes/masterbrand/rgb.css'
21
22
 
22
23
  // JavaScript Imports
23
- import * as globalJsHex from './js/colors/global/hex.js';
24
- import * as globalJsHsl from './js/colors/global/hsl.js';
25
- import * as globalJsOklch from './js/colors/global/oklch.js';
26
- import * as globalJsRgb from './js/colors/global/rgb.js';
27
- import * as masterbrandJsHex from './js/colors/themes/masterbrand/hex.js';
28
- import * as masterbrandJsHsl from './js/colors/themes/masterbrand/hsl.js';
29
- import * as masterbrandJsOklch from './js/colors/themes/masterbrand/oklch.js';
30
- import * as masterbrandJsRgb from './js/colors/themes/masterbrand/rgb.js';
24
+ import * as globalJsHex from './js/colors/global/hex.js'
25
+ import * as globalJsHsl from './js/colors/global/hsl.js'
26
+ import * as globalJsOklch from './js/colors/global/oklch.js'
27
+ import * as globalJsRgb from './js/colors/global/rgb.js'
28
+ import * as masterbrandJsHex from './js/colors/themes/masterbrand/hex.js'
29
+ import * as masterbrandJsHsl from './js/colors/themes/masterbrand/hsl.js'
30
+ import * as masterbrandJsOklch from './js/colors/themes/masterbrand/oklch.js'
31
+ import * as masterbrandJsRgb from './js/colors/themes/masterbrand/rgb.js'
31
32
 
32
33
  // JSON Imports
33
- const globalJsonHex = require('./json/colors/global/hex.json');
34
- const globalJsonHsl = require('./json/colors/global/hsl.json');
35
- const globalJsonOklch = require('./json/colors/global/oklch.json');
36
- const globalJsonRgb = require('./json/colors/global/rgb.json');
37
- const masterbrandJsonHex = require('./json/colors/themes/masterbrand/hex.json');
38
- const masterbrandJsonHsl = require('./json/colors/themes/masterbrand/hsl.json');
39
- const masterbrandJsonOklch = require('./json/colors/themes/masterbrand/oklch.json');
40
- const masterbrandJsonRgb = require('./json/colors/themes/masterbrand/rgb.json');
34
+ const globalJsonHex = require('./json/colors/global/hex.json')
35
+ const globalJsonHsl = require('./json/colors/global/hsl.json')
36
+ const globalJsonOklch = require('./json/colors/global/oklch.json')
37
+ const globalJsonRgb = require('./json/colors/global/rgb.json')
38
+ const masterbrandJsonHex = require('./json/colors/themes/masterbrand/hex.json')
39
+ const masterbrandJsonHsl = require('./json/colors/themes/masterbrand/hsl.json')
40
+ const masterbrandJsonOklch = require('./json/colors/themes/masterbrand/oklch.json')
41
+ const masterbrandJsonRgb = require('./json/colors/themes/masterbrand/rgb.json')
41
42
 
42
43
  // LESS Imports
43
- import * as globalLessHex from './less/colors/global/hex.less';
44
- import * as globalLessHsl from './less/colors/global/hsl.less';
45
- import * as globalLessOklch from './less/colors/global/oklch.less';
46
- import * as globalLessRgb from './less/colors/global/rgb.less';
47
- import * as masterbrandLessHex from './less/colors/themes/masterbrand/hex.less';
48
- import * as masterbrandLessHsl from './less/colors/themes/masterbrand/hsl.less';
49
- import * as masterbrandLessOklch from './less/colors/themes/masterbrand/oklch.less';
50
- import * as masterbrandLessRgb from './less/colors/themes/masterbrand/rgb.less';
44
+ import * as globalLessHex from './less/colors/global/hex.less'
45
+ import * as globalLessHsl from './less/colors/global/hsl.less'
46
+ import * as globalLessOklch from './less/colors/global/oklch.less'
47
+ import * as globalLessRgb from './less/colors/global/rgb.less'
48
+ import * as masterbrandLessHex from './less/colors/themes/masterbrand/hex.less'
49
+ import * as masterbrandLessHsl from './less/colors/themes/masterbrand/hsl.less'
50
+ import * as masterbrandLessOklch from './less/colors/themes/masterbrand/oklch.less'
51
+ import * as masterbrandLessRgb from './less/colors/themes/masterbrand/rgb.less'
51
52
 
52
53
  // SCSS Imports
53
- import * as globalScssHex from './scss/colors/global/hex.scss';
54
- import * as globalScssHsl from './scss/colors/global/hsl.scss';
55
- import * as globalScssOklch from './scss/colors/global/oklch.scss';
56
- import * as globalScssRgb from './scss/colors/global/rgb.scss';
57
- import * as masterbrandScssHex from './scss/colors/themes/masterbrand/hex.scss';
58
- import * as masterbrandScssHsl from './scss/colors/themes/masterbrand/hsl.scss';
59
- import * as masterbrandScssOklch from './scss/colors/themes/masterbrand/oklch.scss';
60
- import * as masterbrandScssRgb from './scss/colors/themes/masterbrand/rgb.scss';
54
+ import * as globalScssHex from './scss/colors/global/hex.scss'
55
+ import * as globalScssHsl from './scss/colors/global/hsl.scss'
56
+ import * as globalScssOklch from './scss/colors/global/oklch.scss'
57
+ import * as globalScssRgb from './scss/colors/global/rgb.scss'
58
+ import * as masterbrandScssHex from './scss/colors/themes/masterbrand/hex.scss'
59
+ import * as masterbrandScssHsl from './scss/colors/themes/masterbrand/hsl.scss'
60
+ import * as masterbrandScssOklch from './scss/colors/themes/masterbrand/oklch.scss'
61
+ import * as masterbrandScssRgb from './scss/colors/themes/masterbrand/rgb.scss'
61
62
 
62
63
  // Tailwind Imports
63
- import * as globalTailwindHex from './tailwind/colors/global/hex.css';
64
- import * as globalTailwindHsl from './tailwind/colors/global/hsl.css';
65
- import * as globalTailwindOklch from './tailwind/colors/global/oklch.css';
66
- import * as globalTailwindRgb from './tailwind/colors/global/rgb.css';
67
- import * as masterbrandTailwindHex from './tailwind/colors/themes/masterbrand/hex.css';
68
- import * as masterbrandTailwindHsl from './tailwind/colors/themes/masterbrand/hsl.css';
69
- import * as masterbrandTailwindOklch from './tailwind/colors/themes/masterbrand/oklch.css';
70
- import * as masterbrandTailwindRgb from './tailwind/colors/themes/masterbrand/rgb.css';
64
+ import * as globalTailwindHex from './tailwind/colors/global/hex.css'
65
+ import * as globalTailwindHsl from './tailwind/colors/global/hsl.css'
66
+ import * as globalTailwindOklch from './tailwind/colors/global/oklch.css'
67
+ import * as globalTailwindRgb from './tailwind/colors/global/rgb.css'
68
+ import * as masterbrandTailwindHex from './tailwind/colors/themes/masterbrand/hex.css'
69
+ import * as masterbrandTailwindHsl from './tailwind/colors/themes/masterbrand/hsl.css'
70
+ import * as masterbrandTailwindOklch from './tailwind/colors/themes/masterbrand/oklch.css'
71
+ import * as masterbrandTailwindRgb from './tailwind/colors/themes/masterbrand/rgb.css'
71
72
 
72
73
  // TypeScript Imports
73
- import * as globalTsHex from './ts/colors/global/hex';
74
- import * as globalTsHsl from './ts/colors/global/hsl';
75
- import * as globalTsOklch from './ts/colors/global/oklch';
76
- import * as globalTsRgb from './ts/colors/global/rgb';
77
- import * as masterbrandTsHex from './ts/colors/themes/masterbrand/hex';
78
- import * as masterbrandTsHsl from './ts/colors/themes/masterbrand/hsl';
79
- import * as masterbrandTsOklch from './ts/colors/themes/masterbrand/oklch';
80
- import * as masterbrandTsRgb from './ts/colors/themes/masterbrand/rgb';
74
+ import * as globalTsHex from './ts/colors/global/hex.js'
75
+ import * as globalTsHsl from './ts/colors/global/hsl.js'
76
+ import * as globalTsOklch from './ts/colors/global/oklch.js'
77
+ import * as globalTsRgb from './ts/colors/global/rgb.js'
78
+ import * as masterbrandTsHex from './ts/colors/themes/masterbrand/hex.js'
79
+ import * as masterbrandTsHsl from './ts/colors/themes/masterbrand/hsl.js'
80
+ import * as masterbrandTsOklch from './ts/colors/themes/masterbrand/oklch.js'
81
+ import * as masterbrandTsRgb from './ts/colors/themes/masterbrand/rgb.js'
81
82
 
82
83
  export const tokens = {
83
84
  colors: {
@@ -85,139 +86,139 @@ export const tokens = {
85
86
  hex: globalColorHex,
86
87
  hsl: globalColorHsl,
87
88
  oklch: globalColorOklch,
88
- rgb: globalColorRgb
89
+ rgb: globalColorRgb,
89
90
  },
90
91
  themes: {
91
92
  masterbrand: {
92
93
  hex: masterbrandColorHex,
93
94
  hsl: masterbrandColorHsl,
94
95
  oklch: masterbrandColorOklch,
95
- rgb: masterbrandColorRgb
96
- }
97
- }
96
+ rgb: masterbrandColorRgb,
97
+ },
98
+ },
98
99
  },
99
100
  css: {
100
101
  global: {
101
102
  hex: globalCssHex,
102
103
  hsl: globalCssHsl,
103
104
  oklch: globalCssOklch,
104
- rgb: globalCssRgb
105
+ rgb: globalCssRgb,
105
106
  },
106
107
  themes: {
107
108
  masterbrand: {
108
109
  hex: masterbrandCssHex,
109
110
  hsl: masterbrandCssHsl,
110
111
  oklch: masterbrandCssOklch,
111
- rgb: masterbrandCssRgb
112
- }
113
- }
112
+ rgb: masterbrandCssRgb,
113
+ },
114
+ },
114
115
  },
115
116
  js: {
116
117
  global: {
117
118
  hex: globalJsHex,
118
119
  hsl: globalJsHsl,
119
120
  oklch: globalJsOklch,
120
- rgb: globalJsRgb
121
+ rgb: globalJsRgb,
121
122
  },
122
123
  themes: {
123
124
  masterbrand: {
124
125
  hex: masterbrandJsHex,
125
126
  hsl: masterbrandJsHsl,
126
127
  oklch: masterbrandJsOklch,
127
- rgb: masterbrandJsRgb
128
- }
129
- }
128
+ rgb: masterbrandJsRgb,
129
+ },
130
+ },
130
131
  },
131
132
  json: {
132
133
  global: {
133
134
  hex: globalJsonHex,
134
135
  hsl: globalJsonHsl,
135
136
  oklch: globalJsonOklch,
136
- rgb: globalJsonRgb
137
+ rgb: globalJsonRgb,
137
138
  },
138
139
  themes: {
139
140
  masterbrand: {
140
141
  hex: masterbrandJsonHex,
141
142
  hsl: masterbrandJsonHsl,
142
143
  oklch: masterbrandJsonOklch,
143
- rgb: masterbrandJsonRgb
144
- }
145
- }
144
+ rgb: masterbrandJsonRgb,
145
+ },
146
+ },
146
147
  },
147
148
  less: {
148
149
  global: {
149
150
  hex: globalLessHex,
150
151
  hsl: globalLessHsl,
151
152
  oklch: globalLessOklch,
152
- rgb: globalLessRgb
153
+ rgb: globalLessRgb,
153
154
  },
154
155
  themes: {
155
156
  masterbrand: {
156
157
  hex: masterbrandLessHex,
157
158
  hsl: masterbrandLessHsl,
158
159
  oklch: masterbrandLessOklch,
159
- rgb: masterbrandLessRgb
160
- }
161
- }
160
+ rgb: masterbrandLessRgb,
161
+ },
162
+ },
162
163
  },
163
164
  scss: {
164
165
  global: {
165
166
  hex: globalScssHex,
166
167
  hsl: globalScssHsl,
167
168
  oklch: globalScssOklch,
168
- rgb: globalScssRgb
169
+ rgb: globalScssRgb,
169
170
  },
170
171
  themes: {
171
172
  masterbrand: {
172
173
  hex: masterbrandScssHex,
173
174
  hsl: masterbrandScssHsl,
174
175
  oklch: masterbrandScssOklch,
175
- rgb: masterbrandScssRgb
176
- }
177
- }
176
+ rgb: masterbrandScssRgb,
177
+ },
178
+ },
178
179
  },
179
180
  tailwind: {
180
181
  global: {
181
182
  hex: globalTailwindHex,
182
183
  hsl: globalTailwindHsl,
183
184
  oklch: globalTailwindOklch,
184
- rgb: globalTailwindRgb
185
+ rgb: globalTailwindRgb,
185
186
  },
186
187
  themes: {
187
188
  masterbrand: {
188
189
  hex: masterbrandTailwindHex,
189
190
  hsl: masterbrandTailwindHsl,
190
191
  oklch: masterbrandTailwindOklch,
191
- rgb: masterbrandTailwindRgb
192
- }
193
- }
192
+ rgb: masterbrandTailwindRgb,
193
+ },
194
+ },
194
195
  },
195
196
  ts: {
196
197
  global: {
197
198
  hex: globalTsHex,
198
199
  hsl: globalTsHsl,
199
200
  oklch: globalTsOklch,
200
- rgb: globalTsRgb
201
+ rgb: globalTsRgb,
201
202
  },
202
203
  themes: {
203
204
  masterbrand: {
204
205
  hex: masterbrandTsHex,
205
206
  hsl: masterbrandTsHsl,
206
207
  oklch: masterbrandTsOklch,
207
- rgb: masterbrandTsRgb
208
- }
209
- }
210
- }
211
- };
208
+ rgb: masterbrandTsRgb,
209
+ },
210
+ },
211
+ },
212
+ }
212
213
 
213
- export const colorTokens = tokens.colors;
214
- export const cssTokens = tokens.css;
215
- export const jsTokens = tokens.js;
216
- export const jsonTokens = tokens.json;
217
- export const lessTokens = tokens.less;
218
- export const scssTokens = tokens.scss;
219
- export const tailwindTokens = tokens.tailwind;
220
- export const tsTokens = tokens.ts;
214
+ export const colorTokens = tokens.colors
215
+ export const cssTokens = tokens.css
216
+ export const jsTokens = tokens.js
217
+ export const jsonTokens = tokens.json
218
+ export const lessTokens = tokens.less
219
+ export const scssTokens = tokens.scss
220
+ export const tailwindTokens = tokens.tailwind
221
+ export const tsTokens = tokens.ts
221
222
 
222
223
  // Export icon paths
223
224
  export const icons = {
@@ -271,25 +272,25 @@ export const icons = {
271
272
  unfoldLess: './icons/unfold_less.svg',
272
273
  unfoldMore: './icons/unfold_more.svg',
273
274
  upload: './icons/upload.svg',
274
- west: './icons/west.svg'
275
- };
275
+ west: './icons/west.svg',
276
+ }
276
277
 
277
278
  // Export brand assets
278
279
  export const brand = {
279
280
  iconDark: {
280
281
  ico: './brand/icon-dark.ico',
281
282
  png: './brand/icon-dark.png',
282
- svg: './brand/icon-dark.svg'
283
+ svg: './brand/icon-dark.svg',
283
284
  },
284
285
  iconLight: {
285
286
  ico: './brand/icon-light.ico',
286
287
  png: './brand/icon-light.png',
287
- svg: './brand/icon-light.svg'
288
+ svg: './brand/icon-light.svg',
288
289
  },
289
290
  icon: './brand/icon.svg',
290
291
  logo: {
291
292
  png: './brand/logo.png',
292
- svg: './brand/logo.svg'
293
+ svg: './brand/logo.svg',
293
294
  },
294
- placeholder: './brand/placeholder.svg'
295
- };
295
+ placeholder: './brand/placeholder.svg',
296
+ }
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
@@ -1 +1 @@
1
- {}
1
+ {}
package/src/types.d.ts CHANGED
@@ -1,25 +1,27 @@
1
+ interface JsModule {
2
+ [key: string]: string | number
3
+ }
1
4
  declare module '*.css' {
2
- const content: string;
3
- export default content;
5
+ const content: string
6
+ export default content
4
7
  }
5
8
 
6
9
  declare module '*.scss' {
7
- const content: string;
8
- export default content;
10
+ const content: string
11
+ export default content
9
12
  }
10
13
 
11
14
  declare module '*.less' {
12
- const content: string;
13
- export default content;
15
+ const content: string
16
+ export default content
14
17
  }
15
18
 
16
19
  declare module '*.js' {
17
- const content: { [key: string]: any };
18
- export default content;
20
+ const content: { [key: string]: JsModule }
21
+ export default content
19
22
  }
20
23
 
21
24
  declare module '*.ts' {
22
- const content: { [key: string]: any };
23
- export default content;
25
+ const content: { [key: string]: JsModule }
26
+ export default content
24
27
  }
25
-