🏷️(react) export DefaultToken types and defaultTokens variable
By doing this we provide more typings for consumers which makes more handy the use of the local configuration in cunningham.ts files.
This commit is contained in:
5
.changeset/giant-drinks-battle.md
Normal file
5
.changeset/giant-drinks-battle.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@openfun/cunningham-react": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
export DefaultToken types and defaultTokens variable
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
export default {
|
import { DefaultTokens } from "@openfun/cunningham-react";
|
||||||
|
|
||||||
|
const config: DefaultTokens = {
|
||||||
theme: {
|
theme: {
|
||||||
colors: {
|
colors: {
|
||||||
"primary-500": "purple",
|
"primary-500": "purple",
|
||||||
@@ -10,3 +12,5 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
import { PartialNested } from ":/types";
|
||||||
|
import { tokens } from "./cunningham-tokens";
|
||||||
|
|
||||||
export * from "./components/Button";
|
export * from "./components/Button";
|
||||||
export * from "./components/DataGrid";
|
export * from "./components/DataGrid";
|
||||||
@@ -12,3 +14,6 @@ export * from "./components/Forms/Select";
|
|||||||
export * from "./components/Loader";
|
export * from "./components/Loader";
|
||||||
export * from "./components/Pagination";
|
export * from "./components/Pagination";
|
||||||
export * from "./components/Provider";
|
export * from "./components/Provider";
|
||||||
|
|
||||||
|
export type DefaultTokens = PartialNested<typeof tokens>;
|
||||||
|
export const defaultTokens = tokens;
|
||||||
|
|||||||
Reference in New Issue
Block a user