From 37ea06a0e63cda9f9d843d3bb41d2193d9e9e97c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 15 Oct 2021 04:53:09 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20`amber`,=20th?= =?UTF-8?q?e=20Gestione=20Amber=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Bluelib.stories.jsx | 8 ++++++++ src/components/Bluelib.tsx | 5 ++++- src/types.ts | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/Bluelib.stories.jsx b/src/components/Bluelib.stories.jsx index 7cc719f..fd5528f 100644 --- a/src/components/Bluelib.stories.jsx +++ b/src/components/Bluelib.stories.jsx @@ -111,6 +111,14 @@ Sophon.args = { theme: "sophon", } + +export const GestioneAmber = Paper.bind({}) +GestioneAmber.args = { + ...Paper.args, + theme: "amber", +} + + export const CustomRed = Paper.bind({}) CustomRed.args = { ...Paper.args, diff --git a/src/components/Bluelib.tsx b/src/components/Bluelib.tsx index 3c30e92..49539cd 100644 --- a/src/components/Bluelib.tsx +++ b/src/components/Bluelib.tsx @@ -1,5 +1,6 @@ import * as React from "react" import * as ReactDOM from "react-dom" +import {BluelibTheme, BluelibThemes} from "../types" import * as Types from "../types" import * as Colors from "../utils/Colors" import Color from "color" @@ -9,6 +10,7 @@ import PaperTheme from "../bluelib/src/targets/paper.module.css" import RoyalBlueTheme from "../bluelib/src/targets/royalblue.module.css" import HackerTheme from "../bluelib/src/targets/hacker.module.css" import SophonTheme from "../bluelib/src/targets/sophon.module.css" +import GestioneAmberTheme from "../bluelib/src/targets/amber.module.css" const BuiltinThemes = { @@ -16,11 +18,12 @@ const BuiltinThemes = { "royalblue": RoyalBlueTheme, "hacker": HackerTheme, "sophon": SophonTheme, + "amber": GestioneAmberTheme, } export interface BluelibProps extends Types.BluelibHTMLProps { - theme: "paper" | "royalblue" | "hacker" | "sophon", + theme: BluelibTheme, backgroundColor?: typeof Color, foregroundColor?: typeof Color, diff --git a/src/types.ts b/src/types.ts index a4dd351..17161bd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -44,3 +44,9 @@ export type Validity = boolean | null | undefined * Bluelib's builtin colors, as strings. */ export type BuiltinColor = "red" | "orange" | "yellow" | "lime" | "cyan" | "blue" | "magenta" | "gray" + + +/** + * Bluelib default themes, as strings. + */ +export type BluelibTheme = "royalblue" | "sophon" | "hacker" | "paper" | "amber" \ No newline at end of file