Skip to content

Commit df037aa

Browse files
authored
refactor(react): conform type declaration export syntax (#3156)
1 parent 8ee2d94 commit df037aa

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.changeset/nasty-ligers-reflect.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@digdir/designsystemet-react": minor
3+
"@digdir/designsystemet-theme": minor
4+
---
5+
6+
Changed alias for type declaration exports
7+
- React: export alias `./react-types.d.ts` was changed to `./react-types`
8+
- Theme: added `types` field to default export in package.json, so now it should be posssible to use `"@digdir/designsystemet-theme"`

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ use all your colors in the components which have a `data-color` prop:
121121
// ...other compilerOptions
122122
"types": [
123123
// ...other types
124-
"@digdir/designsystemet-theme/colors.d.ts"
124+
"@digdir/designsystemet-theme"
125125
]
126126
},
127127
}
@@ -160,7 +160,7 @@ add the following to your `tsconfig.json`:
160160
// ...other compilerOptions
161161
"types": [
162162
// ...other types
163-
"@digdir/designsystemet-react/react-types.d.ts"
163+
"@digdir/designsystemet-react/react-types"
164164
]
165165
},
166166
}

packages/react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"./colors": {
2121
"types": "./dist/types/colors.d.ts"
2222
},
23-
"./react-types.d.ts": {
23+
"./react-types": {
2424
"types": "./dist/react-types.d.ts"
2525
}
2626
},

packages/theme/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"homepage": "https://github.com/digdir/designsystemet/tree/main/packages/theme",
1111
"license": "MIT",
1212
"exports": {
13-
".": "./brand/digdir.css",
13+
".": {
14+
"types": "./brand/colors.d.ts",
15+
"default": "./brand/digdir.css"
16+
} ,
1417
"./*": "./brand/*"
1518
},
1619
"files": [

0 commit comments

Comments
 (0)