(react) add Switch component

Implement a shiny new component that can be used as an alternative to
the regular checkbox.
This commit is contained in:
Nathan Vasse
2023-05-17 15:21:46 +02:00
committed by NathanVss
parent ec8def0cb1
commit 9d7ad489ba
15 changed files with 815 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
import { DefaultTokens } from "@openfun/cunningham-tokens";
export const tokens = (defaults: DefaultTokens) => ({
"accent-color": defaults.theme.colors["success-700"],
"rail-background-color": defaults.theme.colors["greyscale-500"],
"rail-background-color--disabled": defaults.theme.colors["greyscale-400"],
"rail-border-radius": "50vw",
"handle-background-color": "white",
"handle-background-color--disabled": defaults.theme.colors["greyscale-200"],
"handle-border-radius": "50%",
});