@diskette/palette 0.16.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/generate.d.ts +0 -10
- package/dist/cli/commands/generate.js +22 -23
- package/dist/colors/amber.d.ts +12 -112
- package/dist/colors/amber.js +115 -114
- package/dist/colors/blue.d.ts +12 -112
- package/dist/colors/blue.js +115 -114
- package/dist/colors/bronze.d.ts +12 -112
- package/dist/colors/bronze.js +115 -114
- package/dist/colors/brown.d.ts +12 -112
- package/dist/colors/brown.js +115 -114
- package/dist/colors/crimson.d.ts +12 -112
- package/dist/colors/crimson.js +115 -114
- package/dist/colors/cyan.d.ts +12 -112
- package/dist/colors/cyan.js +115 -114
- package/dist/colors/gold.d.ts +12 -112
- package/dist/colors/gold.js +115 -114
- package/dist/colors/grass.d.ts +12 -112
- package/dist/colors/grass.js +115 -114
- package/dist/colors/gray.d.ts +12 -112
- package/dist/colors/gray.js +115 -114
- package/dist/colors/green.d.ts +12 -112
- package/dist/colors/green.js +115 -114
- package/dist/colors/indigo.d.ts +12 -112
- package/dist/colors/indigo.js +115 -114
- package/dist/colors/iris.d.ts +12 -112
- package/dist/colors/iris.js +115 -114
- package/dist/colors/jade.d.ts +12 -112
- package/dist/colors/jade.js +115 -114
- package/dist/colors/lime.d.ts +12 -112
- package/dist/colors/lime.js +115 -114
- package/dist/colors/mauve.d.ts +12 -112
- package/dist/colors/mauve.js +115 -114
- package/dist/colors/mint.d.ts +12 -112
- package/dist/colors/mint.js +115 -114
- package/dist/colors/olive.d.ts +12 -112
- package/dist/colors/olive.js +115 -114
- package/dist/colors/orange.d.ts +12 -112
- package/dist/colors/orange.js +115 -114
- package/dist/colors/pink.d.ts +12 -112
- package/dist/colors/pink.js +115 -114
- package/dist/colors/plum.d.ts +12 -112
- package/dist/colors/plum.js +115 -114
- package/dist/colors/purple.d.ts +12 -112
- package/dist/colors/purple.js +115 -114
- package/dist/colors/red.d.ts +12 -112
- package/dist/colors/red.js +115 -114
- package/dist/colors/ruby.d.ts +12 -112
- package/dist/colors/ruby.js +115 -114
- package/dist/colors/sage.d.ts +12 -112
- package/dist/colors/sage.js +115 -114
- package/dist/colors/sand.d.ts +12 -112
- package/dist/colors/sand.js +115 -114
- package/dist/colors/sky.d.ts +12 -112
- package/dist/colors/sky.js +115 -114
- package/dist/colors/slate.d.ts +12 -112
- package/dist/colors/slate.js +115 -114
- package/dist/colors/teal.d.ts +12 -112
- package/dist/colors/teal.js +115 -114
- package/dist/colors/tomato.d.ts +12 -112
- package/dist/colors/tomato.js +115 -114
- package/dist/colors/violet.d.ts +12 -112
- package/dist/colors/violet.js +115 -114
- package/dist/colors/yellow.d.ts +12 -112
- package/dist/colors/yellow.js +115 -114
- package/dist/css.d.ts +2 -2
- package/dist/css.js +6 -11
- package/dist/index.d.ts +622 -3690
- package/dist/index.js +3 -3
- package/dist/types.d.ts +9 -12
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +8 -0
- package/package.json +1 -3
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import teal from "./colors/teal.js";
|
|
|
29
29
|
import tomato from "./colors/tomato.js";
|
|
30
30
|
import violet from "./colors/violet.js";
|
|
31
31
|
import yellow from "./colors/yellow.js";
|
|
32
|
-
export const colors =
|
|
32
|
+
export const colors = {
|
|
33
33
|
amber,
|
|
34
34
|
blue,
|
|
35
35
|
bronze,
|
|
@@ -61,8 +61,8 @@ export const colors = [
|
|
|
61
61
|
tomato,
|
|
62
62
|
violet,
|
|
63
63
|
yellow,
|
|
64
|
-
|
|
64
|
+
};
|
|
65
65
|
export default colors;
|
|
66
66
|
export { accentColors, grayColors } from "./types.js";
|
|
67
67
|
export { css } from "./css.js";
|
|
68
|
-
export { getMatchingGrayColor } from "./utils.js";
|
|
68
|
+
export { getMatchingGrayColor, toVarName } from "./utils.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -3,19 +3,17 @@ export type GrayColor = (typeof grayColors)[number];
|
|
|
3
3
|
export declare const accentColors: readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky"];
|
|
4
4
|
export type AccentColor = (typeof accentColors)[number];
|
|
5
5
|
export type Color = AccentColor | GrayColor;
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
export type ColorScale<C extends Color> = {
|
|
6
|
+
type Tuple<T, N extends number, R extends T[] = []> = R['length'] extends N ? R : Tuple<T, N, [...R, T]>;
|
|
7
|
+
type ScaleSteps = Tuple<string, 24>;
|
|
8
|
+
export interface PaletteColor<C extends Color> {
|
|
11
9
|
name: C;
|
|
12
10
|
srgb: {
|
|
13
|
-
light: ScaleSteps
|
|
14
|
-
dark: ScaleSteps
|
|
11
|
+
light: ScaleSteps;
|
|
12
|
+
dark: ScaleSteps;
|
|
15
13
|
};
|
|
16
14
|
p3: {
|
|
17
|
-
light: ScaleSteps
|
|
18
|
-
dark: ScaleSteps
|
|
15
|
+
light: ScaleSteps;
|
|
16
|
+
dark: ScaleSteps;
|
|
19
17
|
};
|
|
20
18
|
contrast: string;
|
|
21
19
|
indicator: string;
|
|
@@ -30,10 +28,9 @@ export type ColorScale<C extends Color> = {
|
|
|
30
28
|
dark: string;
|
|
31
29
|
};
|
|
32
30
|
};
|
|
33
|
-
}
|
|
34
|
-
export type AnyColorScale = ColorScale<any>;
|
|
31
|
+
}
|
|
35
32
|
export type AlphaScale<C extends 'white' | 'back'> = {
|
|
36
|
-
[K in `${C}A${
|
|
33
|
+
[K in `${C}A${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}`]: string;
|
|
37
34
|
};
|
|
38
35
|
export type AlphaConfig<C extends 'white' | 'back'> = {
|
|
39
36
|
name: C;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AccentColor, GrayColor } from './types.ts';
|
|
2
|
+
export declare function writeFileIfNotExists(path: string, data: string | NodeJS.ArrayBufferView): boolean;
|
|
2
3
|
export declare function getMatchingGrayColor(accentColor: AccentColor): GrayColor;
|
|
3
4
|
export declare const LIGHT_SELECTOR = ":root, .light, .light-theme";
|
|
4
5
|
export declare const DARK_SELECTOR = ".dark, .dark-theme";
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { existsSync, writeFileSync } from 'node:fs';
|
|
2
|
+
export function writeFileIfNotExists(path, data) {
|
|
3
|
+
if (existsSync(path)) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
writeFileSync(path, data);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
1
9
|
export function getMatchingGrayColor(accentColor) {
|
|
2
10
|
switch (accentColor) {
|
|
3
11
|
case 'tomato':
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diskette/palette",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.19.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"palette": "./dist/cli/cli.js"
|
|
7
7
|
},
|
|
@@ -28,9 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@changesets/cli": "^2.29.7",
|
|
31
|
-
"@diskette/fs": "^0.16.0",
|
|
32
31
|
"@types/node": "^24.3.0",
|
|
33
|
-
"magicast": "^0.5.1",
|
|
34
32
|
"oxlint": "^1.16.0",
|
|
35
33
|
"oxlint-tsgolint": "^0.2.0",
|
|
36
34
|
"prettier": "^3.6.2",
|