diff --git a/.vscode/settings.json b/.vscode/settings.json index bae3180..cf80c04 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,8 @@ "[yaml][markdown][html][scss]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[yaml][markdown][html][scss]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/lib/common/color.ts b/lib/common/color.ts index 36580d3..87562ac 100644 --- a/lib/common/color.ts +++ b/lib/common/color.ts @@ -62,7 +62,7 @@ export class Color { (c2.r - c1.r) * n + c1.r, (c2.g - c1.g) * n + c1.g, (c2.b - c1.b) * n + c1.b, - (c2.a - c1.a) * n + c1.a, + (c2.a - c1.a) * n + c1.a ); } diff --git a/lib/common/events.ts b/lib/common/events.ts index 42834bf..09db7be 100644 --- a/lib/common/events.ts +++ b/lib/common/events.ts @@ -44,7 +44,7 @@ export const globalEvents = new EventEmitter(); let ignoreWindowFocus = false; export const setupGlobalEvents = ( - options: { ignoreWindowFocus?: boolean } = {}, + options: { ignoreWindowFocus?: boolean } = {} ): void => { ignoreWindowFocus = !!options.ignoreWindowFocus; }; diff --git a/lib/common/format.ts b/lib/common/format.ts index a87db8b..c19cf8f 100644 --- a/lib/common/format.ts +++ b/lib/common/format.ts @@ -30,7 +30,7 @@ const SI_BASE_INDEX = SI_SYMBOLS.indexOf(' '); export function formatSiUnit( value: number, minBase1000 = -SI_BASE_INDEX, - unit = '', + unit = '' ): string { if (!Number.isFinite(value)) { return value.toString(); @@ -121,7 +121,7 @@ const SI_BASE_TEN_UNITS = [ export function formatSiBaseTenUnit( value: number, minBase1000 = 0, - unit = '', + unit = '' ): string { if (!Number.isFinite(value)) { return 'NaN'; @@ -145,7 +145,7 @@ export function formatSiBaseTenUnit( */ export function formatTime( val: number, - formatType: 'short' | 'default' = 'default', + formatType: 'short' | 'default' = 'default' ): string { const totalSeconds = Math.floor(val / 10); const hours = Math.floor(totalSeconds / 3600); diff --git a/lib/common/math.ts b/lib/common/math.ts index d55d750..d6aaeb2 100644 --- a/lib/common/math.ts +++ b/lib/common/math.ts @@ -55,7 +55,7 @@ export function inRange(value: number, range: number[]): boolean { */ export function keyOfMatchingRange( value: number, - ranges: Record, + ranges: Record ): string | undefined { for (const rangeName of Object.keys(ranges)) { const range = ranges[rangeName]; diff --git a/lib/common/react.ts b/lib/common/react.ts index eea313a..7e7fb22 100644 --- a/lib/common/react.ts +++ b/lib/common/react.ts @@ -32,7 +32,7 @@ export function normalizeChildren(children: T | T[]): T[] { */ export function shallowDiffers( a: Record, - b: Record, + b: Record ): boolean { let i: string; for (i in a) { diff --git a/lib/common/string.ts b/lib/common/string.ts index fd90c35..3b832f0 100644 --- a/lib/common/string.ts +++ b/lib/common/string.ts @@ -17,7 +17,7 @@ */ export function createSearch( searchText: string, - stringifier = (obj: TObj) => JSON.stringify(obj), + stringifier = (obj: TObj) => JSON.stringify(obj) ): (obj: TObj) => boolean { const preparedSearchText = searchText.toLowerCase().trim(); @@ -190,7 +190,7 @@ export function decodeHtmlEntities(str: string): string { // Basic entities .replace( /&(nbsp|amp|quot|lt|gt|apos);/g, - (_match, entity) => TRANSLATIONS[entity], + (_match, entity) => TRANSLATIONS[entity] ) // Decimal entities .replace(/&#?([0-9]+);/gi, (_match, numStr) => { diff --git a/lib/common/timer.ts b/lib/common/timer.ts index 96c5207..efe42de 100644 --- a/lib/common/timer.ts +++ b/lib/common/timer.ts @@ -7,7 +7,7 @@ export function debounce any>( fn: F, time: number, - immediate = false, + immediate = false ): (...args: Parameters) => void { let timeout: ReturnType | null; return (...args: Parameters) => { @@ -32,7 +32,7 @@ export function debounce any>( */ export function throttle any>( fn: F, - time: number, + time: number ): (...args: Parameters) => void { let previouslyRun: number | null; let queuedToRun: ReturnType | null; @@ -47,7 +47,7 @@ export function throttle any>( } else { queuedToRun = setTimeout( () => invokeFn(...args), - time - (now - (previouslyRun ?? 0)), + time - (now - (previouslyRun ?? 0)) ); } }; diff --git a/lib/components/BlockQuote.tsx b/lib/components/BlockQuote.tsx index cd1f358..becef0a 100644 --- a/lib/components/BlockQuote.tsx +++ b/lib/components/BlockQuote.tsx @@ -1,9 +1,8 @@ import { classes } from '../common/react'; -import styles from '../styles/components/BlockQuote.module.scss'; import { Box, type BoxProps } from './Box'; export function BlockQuote(props: BoxProps) { const { className, ...rest } = props; - return ; + return ; } diff --git a/lib/components/Box.tsx b/lib/components/Box.tsx index 81218f7..855d2f8 100644 --- a/lib/components/Box.tsx +++ b/lib/components/Box.tsx @@ -249,6 +249,6 @@ export function Box(props: BoxProps & DangerDoNotUse) { ...computedProps, className: computedClassName, }, - children, + children ); } diff --git a/lib/components/Button.tsx b/lib/components/Button.tsx index 24c539e..ad55177 100644 --- a/lib/components/Button.tsx +++ b/lib/components/Button.tsx @@ -8,10 +8,8 @@ import { useRef, useState, } from 'react'; - import { KEY, isEscape } from '../common/keys'; import { type BooleanLike, classes } from '../common/react'; -import styles from '../styles/components/Button.module.scss'; import { Box, type BoxProps, @@ -111,19 +109,20 @@ export function Button(props: Props) { let buttonContent = (
-
+
{icon && iconPosition !== 'right' && ( {toDisplay} @@ -333,9 +335,10 @@ function ButtonInput(props: InputProps) { let buttonContent = ( setInInput(true)} diff --git a/lib/components/ColorBox.tsx b/lib/components/ColorBox.tsx index e1d5cff..771adda 100644 --- a/lib/components/ColorBox.tsx +++ b/lib/components/ColorBox.tsx @@ -1,7 +1,6 @@ import type { ReactNode } from 'react'; import { classes } from '../common/react'; -import styles from '../styles/components/ColorBox.module.scss'; import { type BoxProps, computeBoxClassName, computeBoxProps } from './Box'; type Props = { @@ -16,11 +15,7 @@ export function ColorBox(props: Props) { return (
{content || ''} diff --git a/lib/components/Dialog.tsx b/lib/components/Dialog.tsx index 175cbb4..fa68437 100644 --- a/lib/components/Dialog.tsx +++ b/lib/components/Dialog.tsx @@ -1,4 +1,3 @@ -import styles from '../styles/components/Dialog.module.scss'; import { Box } from './Box'; import { Button } from './Button'; @@ -13,10 +12,10 @@ type DialogProps = { export function Dialog(props: DialogProps) { const { title, onClose, children, width, height } = props; return ( -
- -
-
{title}
+
+ +
+
{title}