feat: some type prefixes

This commit is contained in:
TrèsAbhi committed 2025-10-13 23:15:32 -05:00
1 parent dc60cffdff
commit 0d8cb5c1ae
31 files changed
+225 -222

No files matched your search

@@ -1,8 +1,8 @@
import { ComponentProps } from 'react';
import { type ComponentProps } from "react";
export interface GlowProps extends ComponentProps<'div'> {
export interface GlowProps extends ComponentProps<"div"> {
color: string;
direction?: 'default' | 'reverse';
direction?: "default" | "reverse";
rotation?: number;
startOpacity?: number;
endOpacity?: number;
@@ -12,7 +12,7 @@ const width = 16;
export function Glow({
color,
direction = 'default',
direction = "default",
rotation = 0,
style,
startOpacity = 0,
@@ -21,20 +21,20 @@ export function Glow({
}: GlowProps) {
const color1 = `${color}${Math.round(endOpacity * 255)
.toString(16)
.padStart(2, '0')}`;
.padStart(2, "0")}`;
const color2 = `${color}${Math.round(startOpacity * 255)
.toString(16)
.padStart(2, '0')}`;
.padStart(2, "0")}`;
const background = `linear-gradient(${
direction === 'default' ? 0 : 180
direction === "default" ? 0 : 180
}deg, ${color1} 0%, ${color2} 100%)`;
return (
<div
style={{
display: 'flex',
alignItems: direction === 'default' ? 'flex-end' : 'flex-start',
justifyContent: 'center',
display: "flex",
alignItems: direction === "default" ? "flex-end" : "flex-start",
justifyContent: "center",
transform: `rotate(${rotation}deg)`,
...style,
}}
@@ -1,7 +1,7 @@
import {
getWN8Percentile,
Percentile,
SupplementaryStats,
type SupplementaryStats,
} from '@blitzkit/core';
import { Locale } from 'discord.js';
import { translator } from '../../core/localization/translator';
@@ -1,5 +1,5 @@
import { ReactNode } from 'react';
import { theme } from '../stitches.config';
import { type ReactNode } from "react";
import { theme } from "../stitches.config";
interface CommandWrapperProps {
children: ReactNode;
@@ -10,14 +10,14 @@ export function CommandWrapper({ children, fat }: CommandWrapperProps) {
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
display: "flex",
flexDirection: "column",
padding: `16px ${fat ? 0 : 16}px`,
gap: 16,
width: '100%',
width: "100%",
color: theme.colors.textHighContrast,
backgroundColor: theme.colors.appBackground1,
position: 'relative',
position: "relative",
}}
>
{children}
@@ -1,8 +1,8 @@
import {
BlitzStats,
type BlitzStats,
getWN8Percentile,
isNumber,
SupplementaryStats,
type SupplementaryStats,
} from '@blitzkit/core';
import { Locale } from 'discord.js';
import { translator } from '../../core/localization/translator';
@@ -1,6 +1,6 @@
import { times } from 'lodash-es';
import { theme } from '../../../../stitches.config';
import { MarginInputProps } from '../Root';
import { type MarginInputProps } from '../Root';
import { MarginOrientation } from './constants';
interface MarginProps extends MarginInputProps {
@@ -1,7 +1,7 @@
import { ComponentProps } from 'react';
import { theme } from '../../../stitches.config';
import { type ComponentProps } from "react";
import { theme } from "../../../stitches.config";
interface ItemProps extends ComponentProps<'div'> {
interface ItemProps extends ComponentProps<"div"> {
position: number;
deltaPosition?: number;
score?: number;
@@ -25,15 +25,15 @@ export function Item({
<div
{...props}
style={{
cursor: 'pointer',
display: 'flex',
cursor: "pointer",
display: "flex",
padding: 8,
backgroundColor: highlight
? theme.colors.componentInteractive_blue
: theme.colors.componentInteractive,
borderRadius: 4,
alignItems: 'center',
justifyContent: 'center',
alignItems: "center",
justifyContent: "center",
gap: 8,
}}
>
@@ -50,9 +50,9 @@ export function Item({
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
display: "flex",
alignItems: "center",
justifyContent: "center",
gap: 4,
}}
>
@@ -83,22 +83,22 @@ export function Item({
{deltaPosition !== undefined && deltaPosition !== 0 && (
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
display: "flex",
alignItems: "center",
justifyContent: "center",
gap: 4,
}}
>
<img
alt={deltaPosition > 0 ? 'Increase' : 'Decrease'}
alt={deltaPosition > 0 ? "Increase" : "Decrease"}
style={{
width: 8,
height: 8,
}}
src={
deltaPosition > 0
? 'https://i.imgur.com/qbjiXa1.png'
: 'https://i.imgur.com/3uyNhun.png'
? "https://i.imgur.com/qbjiXa1.png"
: "https://i.imgur.com/3uyNhun.png"
}
/>
<span
@@ -119,11 +119,11 @@ export function Item({
<div
style={{
display: 'flex',
display: "flex",
gap: 4,
alignItems: 'center',
alignItems: "center",
width: 96,
justifyContent: 'flex-end',
justifyContent: "flex-end",
}}
>
{deltaScore !== 0 && deltaScore !== undefined && (
@@ -140,15 +140,15 @@ export function Item({
)}
{deltaScore !== 0 && deltaScore !== undefined && (
<img
alt={deltaScore > 0 ? 'Increase' : 'Decrease'}
alt={deltaScore > 0 ? "Increase" : "Decrease"}
style={{
width: 8,
height: 8,
}}
src={
deltaScore > 0
? 'https://i.imgur.com/qbjiXa1.png'
: 'https://i.imgur.com/3uyNhun.png'
? "https://i.imgur.com/qbjiXa1.png"
: "https://i.imgur.com/3uyNhun.png"
}
/>
)}
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import { type ReactNode } from 'react';
interface ColumnProps {
children: ReactNode;
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import { type ReactNode } from "react";
interface RootProps {
children: ReactNode;
@@ -8,8 +8,8 @@ export function Root({ children }: RootProps) {
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
display: "flex",
flexDirection: "column",
gap: 16,
}}
>
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import { type ReactNode } from "react";
interface RowProps {
children: ReactNode;
@@ -8,7 +8,7 @@ export function Row({ children }: RowProps) {
return (
<div
style={{
display: 'flex',
display: "flex",
gap: 8,
}}
>
+7 -7
View File
@@ -1,5 +1,5 @@
import { TierWeightsRecord } from '@blitzkit/core';
import { theme } from '../stitches.config';
import type { TierWeightsRecord } from "@blitzkit/core";
import { theme } from "../stitches.config";
interface TierWeightsProps {
weights: TierWeightsRecord;
@@ -7,7 +7,7 @@ interface TierWeightsProps {
export function TierWeights({ weights }: TierWeightsProps) {
return (
<div style={{ display: 'flex', gap: 8 }}>
<div style={{ display: "flex", gap: 8 }}>
{Object.entries(weights).map(([tier, weight]) => (
<div
key={tier}
@@ -15,11 +15,11 @@ export function TierWeights({ weights }: TierWeightsProps) {
backgroundColor: theme.colors.appBackground1_light,
flex: weight,
color: theme.colors.textHighContrast_light,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
display: "flex",
alignItems: "center",
justifyContent: "center",
fontSize: 16,
overflow: 'hidden',
overflow: "hidden",
borderRadius: 8,
minWidth: 16,
}}