🏷️(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:
Nathan Vasse
2023-05-23 15:17:46 +02:00
committed by NathanVss
parent b5fcfdfeab
commit e05c6b786c
3 changed files with 15 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": minor
---
export DefaultToken types and defaultTokens variable

View File

@@ -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;

View File

@@ -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;