color_scheme -> theme
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { interactive, toggleable } from "../element"
|
||||
import { background, foreground } from "../style_tree/components"
|
||||
import { useTheme, ColorScheme } from "../theme"
|
||||
import { useTheme, Theme } from "../theme"
|
||||
|
||||
export type Margin = {
|
||||
top: number
|
||||
@@ -11,15 +11,15 @@ export type Margin = {
|
||||
|
||||
interface IconButtonOptions {
|
||||
layer?:
|
||||
| ColorScheme["lowest"]
|
||||
| ColorScheme["middle"]
|
||||
| ColorScheme["highest"]
|
||||
color?: keyof ColorScheme["lowest"]
|
||||
| Theme["lowest"]
|
||||
| Theme["middle"]
|
||||
| Theme["highest"]
|
||||
color?: keyof Theme["lowest"]
|
||||
margin?: Partial<Margin>
|
||||
}
|
||||
|
||||
type ToggleableIconButtonOptions = IconButtonOptions & {
|
||||
active_color?: keyof ColorScheme["lowest"]
|
||||
active_color?: keyof Theme["lowest"]
|
||||
}
|
||||
|
||||
export function icon_button({ color, margin, layer }: IconButtonOptions) {
|
||||
@@ -67,7 +67,7 @@ export function icon_button({ color, margin, layer }: IconButtonOptions) {
|
||||
}
|
||||
|
||||
export function toggleable_icon_button(
|
||||
theme: ColorScheme,
|
||||
theme: Theme,
|
||||
{ color, active_color, margin }: ToggleableIconButtonOptions
|
||||
) {
|
||||
if (!color) color = "base"
|
||||
|
||||
@@ -5,21 +5,21 @@ import {
|
||||
foreground,
|
||||
text,
|
||||
} from "../style_tree/components"
|
||||
import { useTheme, ColorScheme } from "../theme"
|
||||
import { useTheme, Theme } from "../theme"
|
||||
import { Margin } from "./icon_button"
|
||||
|
||||
interface TextButtonOptions {
|
||||
layer?:
|
||||
| ColorScheme["lowest"]
|
||||
| ColorScheme["middle"]
|
||||
| ColorScheme["highest"]
|
||||
color?: keyof ColorScheme["lowest"]
|
||||
| Theme["lowest"]
|
||||
| Theme["middle"]
|
||||
| Theme["highest"]
|
||||
color?: keyof Theme["lowest"]
|
||||
margin?: Partial<Margin>
|
||||
text_properties?: TextProperties
|
||||
}
|
||||
|
||||
type ToggleableTextButtonOptions = TextButtonOptions & {
|
||||
active_color?: keyof ColorScheme["lowest"]
|
||||
active_color?: keyof Theme["lowest"]
|
||||
}
|
||||
|
||||
export function text_button({
|
||||
@@ -75,7 +75,7 @@ export function text_button({
|
||||
}
|
||||
|
||||
export function toggleable_text_button(
|
||||
theme: ColorScheme,
|
||||
theme: Theme,
|
||||
{ color, active_color, margin }: ToggleableTextButtonOptions
|
||||
) {
|
||||
if (!color) color = "base"
|
||||
|
||||
Reference in New Issue
Block a user