Skip to content

Commit

Permalink
🏷️(react) export DefaultToken types and defaultTokens variable
Browse files Browse the repository at this point in the history
By doing this we provide more typings for consumers which makes more
handy the use of the local configuration in cunningham.ts files.
  • Loading branch information
NathanVss committed May 24, 2023
1 parent b5fcfdf commit e05c6b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/giant-drinks-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": minor
---

export DefaultToken types and defaultTokens variable
6 changes: 5 additions & 1 deletion apps/demo/cunningham.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export default {
import { DefaultTokens } from "@openfun/cunningham-react";

const config: DefaultTokens = {
theme: {
colors: {
"primary-500": "purple",
Expand All @@ -10,3 +12,5 @@ export default {
},
},
};

export default config;
5 changes: 5 additions & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import "./index.scss";
import { PartialNested } from ":/types";
import { tokens } from "./cunningham-tokens";

export * from "./components/Button";
export * from "./components/DataGrid";
Expand All @@ -12,3 +14,6 @@ export * from "./components/Forms/Select";
export * from "./components/Loader";
export * from "./components/Pagination";
export * from "./components/Provider";

export type DefaultTokens = PartialNested<typeof tokens>;
export const defaultTokens = tokens;

0 comments on commit e05c6b7

Please sign in to comment.