From aa93674b09084a4d6f2268aa78df6d9994f4c53b Mon Sep 17 00:00:00 2001 From: hmd <-> Date: Sat, 12 Oct 2024 17:19:44 +0330 Subject: [PATCH] fix: types --- .vscode/settings.json | 3 +++ src/consts.ts | 8 +++----- src/index.ts | 12 ++++++------ src/types.ts | 1 - 4 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8549f5a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["consts"] +} diff --git a/src/consts.ts b/src/consts.ts index 4bddc9d..aa8788d 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -1,5 +1,3 @@ -import { Alpha, P3, Step } from './types'; - export const RADIX_HUES = [ "amber", "blue", @@ -35,6 +33,6 @@ export const RADIX_HUES = [ ] as const; -export const ALPHAS: Alpha[] = ['', 'A'] as const; -export const P3S: P3[] = ['', 'P3'] as const; -export const STEPS: Step[] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-fg'] as const; +export const ALPHAS = ['', 'A'] as const; +export const P3S = ['', 'P3'] as const; +export const STEPS= ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-fg'] as const; diff --git a/src/index.ts b/src/index.ts index 27ac2e7..2941c87 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ -import { Extractor, Preset, ResolvedConfig, RuleContext } from 'unocss'; +import { Preset, RuleContext } from 'unocss'; import type { Theme } from 'unocss/preset-uno'; -import { type Options, Aliases, Alpha, HueOrAlias, Property, RadixHue, Step } from './types'; +import { type Options, Aliases, Alpha, HueOrAlias, RadixHue, Step } from './types'; import { generateCSSVariablesForColorsInUse } from './preflights'; import { extendTheme } from './extendTheme'; @@ -68,10 +68,10 @@ export function presetRadix({ name: 'unocss-preset-radix', layers: layer ? { - preflights: 1, - [layer]: 2, - default: 3, - } + preflights: 1, + [layer]: 2, + default: 3, + } : undefined, shortcuts: [ // This shortcut exist so generated css for colors to have same order. diff --git a/src/types.ts b/src/types.ts index 8635490..fa3ed34 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,4 @@ import { RADIX_HUES } from './consts'; - export type Alpha = 'A' | ''; export type RadixHue = (typeof RADIX_HUES)[number]; export type Step = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '-fg';