@digdir/designsystemet 0.1.0-alpha.15 → 0.1.0-alpha.16
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/src/init/createTokensPackage.js +1 -3
- package/dist/src/tokens/actions.js +5 -1
- package/dist/types/bin/designsystemet.d.ts +3 -0
- package/dist/types/bin/designsystemet.d.ts.map +1 -0
- package/dist/types/src/colors/colorUtils.d.ts +126 -0
- package/dist/types/src/colors/colorUtils.d.ts.map +1 -0
- package/dist/types/src/colors/index.d.ts +4 -0
- package/dist/types/src/colors/index.d.ts.map +1 -0
- package/dist/types/src/colors/themeUtils.d.ts +102 -0
- package/dist/types/src/colors/themeUtils.d.ts.map +1 -0
- package/dist/types/src/colors/types.d.ts +16 -0
- package/dist/types/src/colors/types.d.ts.map +1 -0
- package/dist/types/src/init/createTokensPackage.d.ts +5 -0
- package/dist/types/src/init/createTokensPackage.d.ts.map +1 -0
- package/dist/types/src/init/generateMetadataJson.d.ts +6 -0
- package/dist/types/src/init/generateMetadataJson.d.ts.map +1 -0
- package/dist/types/src/init/generateThemesJson.d.ts +3 -0
- package/dist/types/src/init/generateThemesJson.d.ts.map +1 -0
- package/dist/types/src/init/index.d.ts +3 -0
- package/dist/types/src/init/index.d.ts.map +1 -0
- package/dist/types/src/init/nextStepsMarkdown.d.ts +3 -0
- package/dist/types/src/init/nextStepsMarkdown.d.ts.map +1 -0
- package/dist/types/src/init/template/prettier.config.d.mts +9 -0
- package/dist/types/src/init/template/prettier.config.d.mts.map +1 -0
- package/dist/types/src/init/utils.d.ts +4 -0
- package/dist/types/src/init/utils.d.ts.map +1 -0
- package/dist/types/src/migrations/beta-to-v1.d.ts +3 -0
- package/dist/types/src/migrations/beta-to-v1.d.ts.map +1 -0
- package/dist/types/src/migrations/codemods/css/plugins.d.ts +6 -0
- package/dist/types/src/migrations/codemods/css/plugins.d.ts.map +1 -0
- package/dist/types/src/migrations/codemods/css/run.d.ts +8 -0
- package/dist/types/src/migrations/codemods/css/run.d.ts.map +1 -0
- package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts +10 -0
- package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts.map +1 -0
- package/dist/types/src/migrations/codemods/jsx/run.d.ts +7 -0
- package/dist/types/src/migrations/codemods/jsx/run.d.ts.map +1 -0
- package/dist/types/src/migrations/index.d.ts +6 -0
- package/dist/types/src/migrations/index.d.ts.map +1 -0
- package/dist/types/src/migrations/react-beta-to-v1.d.ts +3 -0
- package/dist/types/src/migrations/react-beta-to-v1.d.ts.map +1 -0
- package/dist/types/src/test/jsx-test.d.ts +4 -0
- package/dist/types/src/test/jsx-test.d.ts.map +1 -0
- package/dist/types/src/tokens/actions.d.ts +6 -0
- package/dist/types/src/tokens/actions.d.ts.map +1 -0
- package/dist/types/src/tokens/build.d.ts +11 -0
- package/dist/types/src/tokens/build.d.ts.map +1 -0
- package/dist/types/src/tokens/configs.d.ts +31 -0
- package/dist/types/src/tokens/configs.d.ts.map +1 -0
- package/dist/types/src/tokens/formats/css.d.ts +5 -0
- package/dist/types/src/tokens/formats/css.d.ts.map +1 -0
- package/dist/types/src/tokens/formats/js-tokens.d.ts +6 -0
- package/dist/types/src/tokens/formats/js-tokens.d.ts.map +1 -0
- package/dist/types/src/tokens/transformers.d.ts +5 -0
- package/dist/types/src/tokens/transformers.d.ts.map +1 -0
- package/dist/types/src/tokens/utils/noCase.d.ts +11 -0
- package/dist/types/src/tokens/utils/noCase.d.ts.map +1 -0
- package/dist/types/src/tokens/utils/permutateThemes.d.ts +17 -0
- package/dist/types/src/tokens/utils/permutateThemes.d.ts.map +1 -0
- package/dist/types/src/tokens/utils/utils.d.ts +24 -0
- package/dist/types/src/tokens/utils/utils.d.ts.map +1 -0
- package/package.json +5 -2
|
@@ -2,9 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import prompts from "prompts";
|
|
5
|
-
import packageJsonTemplate from "./template/template-files/package.json"
|
|
6
|
-
type: 'json'
|
|
7
|
-
};
|
|
5
|
+
import packageJsonTemplate from "./template/template-files/package.json";
|
|
8
6
|
import generateMetadata from "./generateMetadataJson.js";
|
|
9
7
|
import generateThemes from "./generateThemesJson.js";
|
|
10
8
|
import { toGeneratedCssFileName, normalizeTokenSetName, toValidPackageName } from "./utils.js";
|
|
@@ -6,6 +6,10 @@ const sortLightmodeFirst = R.sortWith([
|
|
|
6
6
|
R.descend(R.includes('light')),
|
|
7
7
|
R.descend(R.includes('secondary'))
|
|
8
8
|
]);
|
|
9
|
+
const header = `@charset "UTF-8";
|
|
10
|
+
|
|
11
|
+
@layer ds.reset, ds.theme, ds.base, ds.utilities, ds.components;
|
|
12
|
+
\n`;
|
|
9
13
|
/**
|
|
10
14
|
* Creates a CSS entry file that imports base CSS files for a theme
|
|
11
15
|
*/ export const makeEntryFile = {
|
|
@@ -20,7 +24,7 @@ const sortLightmodeFirst = R.sortWith([
|
|
|
20
24
|
const files = await glob(`**/*`, {
|
|
21
25
|
cwd: platform.buildPath
|
|
22
26
|
});
|
|
23
|
-
const content = generateImportUrls(files);
|
|
27
|
+
const content = header + generateImportUrls(files);
|
|
24
28
|
await fs.writeFile(writePath, content);
|
|
25
29
|
},
|
|
26
30
|
undo: async function noOp() {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"designsystemet.d.ts","sourceRoot":"","sources":["../../../bin/designsystemet.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { CssColor } from '@adobe/leonardo-contrast-colors';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a HEX color '#xxxxxx' into a CSS HSL string 'hsl(x,x,x)'
|
|
4
|
+
*
|
|
5
|
+
* @param hex A hex color string
|
|
6
|
+
* @param valuesOnly If true, only the values are returned
|
|
7
|
+
* @returns A CSS HSL string
|
|
8
|
+
*/
|
|
9
|
+
export declare const hexToCssHsl: (hex: string, valuesOnly?: boolean) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Converts a HEX string '#xxxxxx' into an array of HSL values '[h,s,l]'
|
|
12
|
+
*
|
|
13
|
+
* @param H A Hex color string
|
|
14
|
+
* @returns HSL values in an array
|
|
15
|
+
*/
|
|
16
|
+
export declare const hexToHSL: (H: string) => number[];
|
|
17
|
+
/**
|
|
18
|
+
* Converts a HEX color '#xxxxxx' into an array of HSLuv values '[h,s,l]'
|
|
19
|
+
*
|
|
20
|
+
* @param hex A hex color string
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const hexToHsluv: (hex: string) => number[];
|
|
24
|
+
/**
|
|
25
|
+
* Converts a HSL number array '[h,s,l]' into HSL CSS string 'hsl(x,x,x)'
|
|
26
|
+
*
|
|
27
|
+
* @param HSL A HSL number array '[h,s,l]'
|
|
28
|
+
* @returns A hex color string
|
|
29
|
+
*/
|
|
30
|
+
export declare const hslArrToCss: (HSL: number[]) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Converts a HSL CSS string 'hsl(x,x,x)' into an array of HSL values '[h,s,l]'
|
|
33
|
+
*
|
|
34
|
+
* @param h The HSL hue
|
|
35
|
+
* @param s The HSL saturation
|
|
36
|
+
* @param l The HSL lightness
|
|
37
|
+
* @returns HEX color string
|
|
38
|
+
*/
|
|
39
|
+
export declare const HSLToHex: (h: number, s: number, l: number) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Converts a HEX color '#xxxxxx' into an array of RGB values '[R, G, B]'
|
|
42
|
+
*
|
|
43
|
+
* @param hex A hex color string
|
|
44
|
+
* @returns RGB values in an array
|
|
45
|
+
*/
|
|
46
|
+
export declare const hexToRgb: (hex: string) => {
|
|
47
|
+
r: number;
|
|
48
|
+
g: number;
|
|
49
|
+
b: number;
|
|
50
|
+
} | null;
|
|
51
|
+
/**
|
|
52
|
+
* Get the luminance of an RGB color
|
|
53
|
+
*
|
|
54
|
+
* @param r RGB red value
|
|
55
|
+
* @param G RGB green value
|
|
56
|
+
* @param b RGB blue value
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
export declare const luminanceFromRgb: (r: string, g: string, b: string) => number;
|
|
60
|
+
/**
|
|
61
|
+
* Get the luminance of a HEX color
|
|
62
|
+
*
|
|
63
|
+
* @param hex A hex color string
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare const luminanceFromHex: (hex: CssColor) => number;
|
|
67
|
+
/**
|
|
68
|
+
* Get the contrast ratio between two luminance values
|
|
69
|
+
*
|
|
70
|
+
* @param lum1 The first luminance value
|
|
71
|
+
* @param lum2 The second luminance value
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
export declare const getRatioFromLum: (lum1: number, lum2: number) => number;
|
|
75
|
+
/**
|
|
76
|
+
* Get the HSL lightness from a HEX color
|
|
77
|
+
*
|
|
78
|
+
* @param hex A hex color string
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
export declare const getHslLightessFromHex: (hex: CssColor) => number;
|
|
82
|
+
export declare const getHslSaturationFromHex: (hex: CssColor) => number;
|
|
83
|
+
/**
|
|
84
|
+
* Get the HSLuv lightness from a HEX color
|
|
85
|
+
*
|
|
86
|
+
* @param hex A hex color string
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
export declare const getLightnessFromHex: (hex: string) => number;
|
|
90
|
+
/**
|
|
91
|
+
* Get the contrast ratio between two HEX colors
|
|
92
|
+
*
|
|
93
|
+
* @param {CssColor} color1 The first color
|
|
94
|
+
* @param {CssColor} color2 The second color
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
export declare const getContrastFromHex: (color1: CssColor, color2: CssColor) => number;
|
|
98
|
+
/**
|
|
99
|
+
* Get the contrast ratio between two colors at a specific lightness
|
|
100
|
+
*
|
|
101
|
+
* @param lightness The lightness value
|
|
102
|
+
* @param mainColor The main color
|
|
103
|
+
* @param backgroundColor The background color
|
|
104
|
+
* @returns The contrast ratio
|
|
105
|
+
*/
|
|
106
|
+
export declare const getContrastFromLightness: (lightness: number, mainColor: CssColor, backgroundColor: CssColor) => number;
|
|
107
|
+
/**
|
|
108
|
+
* Maps the numbers from [start1 - end1] to the range [start2 - end2], maintaining the proportionality between the numbers in the ranges using lineaer interpolation.
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* Check if two colors have enough contrast to be used together
|
|
112
|
+
*
|
|
113
|
+
* @param {CssColor} color1 The first color
|
|
114
|
+
* @param {CssColor} color2 The second color
|
|
115
|
+
* @returns {boolean} If the colors have enough contrast
|
|
116
|
+
*/
|
|
117
|
+
export declare const areColorsContrasting: (color1: CssColor, color2: CssColor, type?: 'decorative' | 'aa' | 'aaa') => boolean;
|
|
118
|
+
export declare const getApcaContrastLc: (textColor: CssColor, backgroundColor: CssColor) => string | number;
|
|
119
|
+
/**
|
|
120
|
+
* Check if aa string value is a HEX color
|
|
121
|
+
*
|
|
122
|
+
* @param {string} hex The string to check
|
|
123
|
+
* @returns {boolean} If the string is a HEX color
|
|
124
|
+
*/
|
|
125
|
+
export declare const isHexColor: (hex: string) => boolean;
|
|
126
|
+
//# sourceMappingURL=colorUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../../../src/colors/colorUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAKhE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,iCA2CtC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,MAAO,MAAM,aAwCjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,aAKrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,EAAE,WAExC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,WA+CvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAS,MAAM;;;;QAcnC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,WAM/D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAS,QAAQ,WAS7C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SAAU,MAAM,QAAQ,MAAM,WAMzD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAS,QAAQ,WAElD,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,QAAQ,WAEpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,WAK9C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,WAAY,QAAQ,UAAU,QAAQ,WAOpE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,cAAe,MAAM,aAAa,QAAQ,mBAAmB,QAAQ,WAYzG,CAAC;AAEF;;GAEG;AAKH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WAAY,QAAQ,UAAU,QAAQ,SAAQ,YAAY,GAAG,IAAI,GAAG,KAAK,YAYzG,CAAC;AAEF,eAAO,MAAM,iBAAiB,cAAe,QAAQ,mBAAmB,QAAQ,oBAW/E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,YAErC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/colors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { CssColor } from '@adobe/leonardo-contrast-colors';
|
|
2
|
+
import type { ContrastMode, Mode, ColorInfo, ColorNumber, ThemeInfo, ColorType } from './types';
|
|
3
|
+
export type ColorError = 'none' | 'decorative' | 'interaction';
|
|
4
|
+
type GlobalGenType = {
|
|
5
|
+
themeMode?: Mode | 'all';
|
|
6
|
+
contrastMode?: ContrastMode;
|
|
7
|
+
};
|
|
8
|
+
type ThemeGenType = {
|
|
9
|
+
colors: {
|
|
10
|
+
accent: CssColor;
|
|
11
|
+
neutral: CssColor;
|
|
12
|
+
brand1: CssColor;
|
|
13
|
+
brand2: CssColor;
|
|
14
|
+
brand3: CssColor;
|
|
15
|
+
};
|
|
16
|
+
contrastMode?: ContrastMode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* Generates a color scale based on a base color and a mode.
|
|
21
|
+
*
|
|
22
|
+
* @param color The base color that is used to generate the color scale
|
|
23
|
+
* @param mode The mode of the theme
|
|
24
|
+
*/
|
|
25
|
+
export declare const generateScaleForColor: (color: CssColor, mode: Mode, contrastMode?: 'aa' | 'aaa') => ColorInfo[];
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* Generates a color theme based on a base color. Light, Dark and Contrast scales are includes.
|
|
29
|
+
*
|
|
30
|
+
* @param color The base color that is used to generate the color theme
|
|
31
|
+
*/
|
|
32
|
+
export declare const generateThemeForColor: (color: CssColor, contrastMode?: 'aa' | 'aaa') => ThemeInfo;
|
|
33
|
+
export declare const generateGlobalColors: ({ contrastMode }: GlobalGenType) => {
|
|
34
|
+
blue: ThemeInfo;
|
|
35
|
+
green: ThemeInfo;
|
|
36
|
+
orange: ThemeInfo;
|
|
37
|
+
purple: ThemeInfo;
|
|
38
|
+
red: ThemeInfo;
|
|
39
|
+
yellow: ThemeInfo;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* This function generates a complete theme for a set of colors.
|
|
43
|
+
*
|
|
44
|
+
* @param colors Which colors to generate the theme for
|
|
45
|
+
* @param contrastMode The contrast mode to use
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
export declare const generateColorTheme: ({ colors, contrastMode }: ThemeGenType) => {
|
|
49
|
+
accent: ThemeInfo;
|
|
50
|
+
neutral: ThemeInfo;
|
|
51
|
+
brand1: ThemeInfo;
|
|
52
|
+
brand2: ThemeInfo;
|
|
53
|
+
brand3: ThemeInfo;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* This function calculates a color that can be used as a strong contrast color to a base color.
|
|
58
|
+
*
|
|
59
|
+
* @param baseColor The base color
|
|
60
|
+
*/
|
|
61
|
+
export declare const calculateContrastOneColor: (baseColor: CssColor) => "#ffffff" | "#000000";
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* This function calculates a color that can be used as a subtle contrast color to a base color.
|
|
65
|
+
*
|
|
66
|
+
* @param color The base color
|
|
67
|
+
*/
|
|
68
|
+
export declare const calculateContrastTwoColor: (color: CssColor) => CssColor;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* This function checks if white or black text can be used on 2 different colors at 4.5:1 contrast.
|
|
72
|
+
*
|
|
73
|
+
* @param baseDefaultColor Base default color
|
|
74
|
+
* @param baseActiveColor Base active color
|
|
75
|
+
*/
|
|
76
|
+
export declare const canTextBeUsedOnColors: (baseDefaultColor: CssColor, baseActiveColor: CssColor) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* This function creates a color with a specific lightness value.
|
|
80
|
+
*
|
|
81
|
+
* @param color The base color
|
|
82
|
+
* @param lightness The lightness value from 0 to 100
|
|
83
|
+
*/
|
|
84
|
+
export declare const createColorWithLightness: (color: CssColor, lightness: number) => CssColor;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* This function returns the color number based on the color name.
|
|
88
|
+
*
|
|
89
|
+
* @param name The name of the color
|
|
90
|
+
*/
|
|
91
|
+
export declare const getColorNumberFromName: (name: string) => ColorNumber;
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* This function returns the color name based on the color number.
|
|
95
|
+
*
|
|
96
|
+
* @param number The number of the color
|
|
97
|
+
*/
|
|
98
|
+
export declare const getColorNameFromNumber: (number: ColorNumber) => string;
|
|
99
|
+
export declare const getBaseColor: (color: CssColor) => CssColor;
|
|
100
|
+
export declare const getCssVariable: (colorType: ColorType, colorNumber: ColorNumber) => string;
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=themeUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeUtils.d.ts","sourceRoot":"","sources":["../../../../src/colors/themeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAIhE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAUhG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC;AAE/D,KAAK,aAAa,GAAG;IACnB,SAAS,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE;QACN,MAAM,EAAE,QAAQ,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC;QAClB,MAAM,EAAE,QAAQ,CAAC;QACjB,MAAM,EAAE,QAAQ,CAAC;QACjB,MAAM,EAAE,QAAQ,CAAC;KAClB,CAAC;IACF,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAoEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,UAAW,QAAQ,QAAQ,IAAI,iBAAgB,IAAI,GAAG,KAAK,KAAU,SAAS,EAuC/G,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,UAAW,QAAQ,iBAAgB,IAAI,GAAG,KAAK,cAUhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,qBAA6B,aAAa;;;;;;;CAgB1E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,6BAAqC,YAAY;;;;;;CAc/E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,cAAe,QAAQ,0BAO5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,UAAW,QAAQ,aAaxD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,qBAAsB,QAAQ,mBAAmB,QAAQ,YAc1F,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,UAAW,QAAQ,aAAa,MAAM,aAkB1E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,MAAM,KAAG,WAmBrD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,WAAY,WAAW,KAAG,MAmB5D,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,QAAQ,aAS3C,CAAC;AAEF,eAAO,MAAM,cAAc,cAAe,SAAS,eAAe,WAAW,WAE5E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CssColor } from '@adobe/leonardo-contrast-colors';
|
|
2
|
+
export type Mode = 'light' | 'dark' | 'contrast';
|
|
3
|
+
export type ContrastMode = 'aa' | 'aaa';
|
|
4
|
+
export type ColorNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
|
|
5
|
+
export type ColorType = 'accent' | 'neutral' | 'brand1' | 'brand2' | 'brand3';
|
|
6
|
+
export type ColorInfo = {
|
|
7
|
+
hex: CssColor;
|
|
8
|
+
number: ColorNumber;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
export type ThemeInfo = {
|
|
12
|
+
light: ColorInfo[];
|
|
13
|
+
dark: ColorInfo[];
|
|
14
|
+
contrast: ColorInfo[];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/colors/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,KAAK,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC1F,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTokensPackage.d.ts","sourceRoot":"","sources":["../../../../src/init/createTokensPackage.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,KAAK,wCAAyC,CAAC;AACrD,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AA0B1C,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,iBAuO1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateMetadataJson.d.ts","sourceRoot":"","sources":["../../../../src/init/generateMetadataJson.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,KAAK,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC,EAC3C,MAAM,EAAE,MAAM,EAAE,GACf,QAAQ,CAiBV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateThemesJson.d.ts","sourceRoot":"","sources":["../../../../src/init/generateThemesJson.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC,EAC3C,MAAM,EAAE,MAAM,EAAE,GACf,WAAW,EAAE,CAMf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAIrE,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,yBAQ/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextStepsMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/init/nextStepsMarkdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,IAAI,EAAE,EACb,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,UA6FpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default config;
|
|
2
|
+
/**
|
|
3
|
+
* NOTE: This config exists to ensure files in the template dir are
|
|
4
|
+
* formatted using the default prettier rules
|
|
5
|
+
* @see https://prettier.io/docs/en/configuration.html
|
|
6
|
+
* @type {import("prettier").Config}
|
|
7
|
+
*/
|
|
8
|
+
declare const config: import("prettier").Config;
|
|
9
|
+
//# sourceMappingURL=prettier.config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.config.d.mts","sourceRoot":"","sources":["../../../../../src/init/template/prettier.config.mjs"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,sBAFU,OAAO,UAAU,EAAE,MAAM,CAEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/init/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,UAOrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/beta-to-v1.ts"],"names":[],"mappings":"gCAGuB,MAAM;AAA7B,wBAmVK"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Plugin } from 'postcss';
|
|
2
|
+
type PluginGenerator = (dictionary: Record<string, string>) => Plugin;
|
|
3
|
+
export declare const cssClassRename: PluginGenerator;
|
|
4
|
+
export declare const cssVarRename: PluginGenerator;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/css/plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;AAInD,KAAK,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;AAOtE,eAAO,MAAM,cAAc,EAAE,eAe3B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,eA6BzB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AcceptedPlugin } from 'postcss';
|
|
2
|
+
type CssCodemodProps = {
|
|
3
|
+
plugins: AcceptedPlugin[];
|
|
4
|
+
globPattern?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const runCssCodemod: ({ plugins, globPattern }: CssCodemodProps) => Promise<void>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/css/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,6BAAwD,eAAe,kBAkBhG,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { API, FileInfo } from 'jscodeshift';
|
|
2
|
+
/**
|
|
3
|
+
* Replace all class prefixes from 'fds-' to 'ds-'
|
|
4
|
+
* @param file
|
|
5
|
+
* @param api
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function replaceClassNamePrefix(file: FileInfo, api: API): string | undefined;
|
|
9
|
+
export default replaceClassNamePrefix;
|
|
10
|
+
//# sourceMappingURL=classname-prefix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classname-prefix.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/jsx/classname-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAoElE;;;;;GAKG;AACH,iBAAS,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAiB5E;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/jsx/run.ts"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAIF,eAAO,MAAM,aAAa,yBAA+C,eAAe,kBAiBvF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/migrations/index.ts"],"names":[],"mappings":";;;;AAGA,wBAGE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/react-beta-to-v1.ts"],"names":[],"mappings":"gCAEuB,MAAM;AAA7B,wBAAuE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-test.d.ts","sourceRoot":"","sources":["../../../../src/test/jsx-test.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CA6BpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/tokens/actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAWrD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAuB3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Options = {
|
|
2
|
+
/** Design tokens path */
|
|
3
|
+
tokens: string;
|
|
4
|
+
/** Output directoru for built tokens */
|
|
5
|
+
out: string;
|
|
6
|
+
/** Generate preview tokens */
|
|
7
|
+
preview: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function run(options: Options): Promise<void>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/tokens/build.ts"],"names":[],"mappings":"AAYA,KAAK,OAAO,GAAG;IACb,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF,wBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFzD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Config, TransformedToken } from 'style-dictionary/types';
|
|
2
|
+
import type { ThemeObject } from '@tokens-studio/types';
|
|
3
|
+
import type { PermutatedThemes } from './utils/permutateThemes.js';
|
|
4
|
+
export declare const prefix = "ds";
|
|
5
|
+
export declare const basePxFontSize = 16;
|
|
6
|
+
export declare const separator = "_";
|
|
7
|
+
export type IsCalculatedToken = (token: TransformedToken, options?: Config) => boolean;
|
|
8
|
+
export declare const permutateThemes: ($themes: ThemeObject[]) => PermutatedThemes;
|
|
9
|
+
type GetConfig = (options: {
|
|
10
|
+
mode?: string;
|
|
11
|
+
theme?: string;
|
|
12
|
+
semantic?: string;
|
|
13
|
+
size?: string;
|
|
14
|
+
typography?: string;
|
|
15
|
+
outPath?: string;
|
|
16
|
+
}) => Config;
|
|
17
|
+
export declare const colorModeVariables: GetConfig;
|
|
18
|
+
export declare const semanticVariables: GetConfig;
|
|
19
|
+
export declare const typescriptTokens: GetConfig;
|
|
20
|
+
export declare const typographyCSS: GetConfig;
|
|
21
|
+
type getConfigs = (getConfig: GetConfig, outPath: string, tokensDir: string, themes: PermutatedThemes) => {
|
|
22
|
+
mode: string;
|
|
23
|
+
theme: string;
|
|
24
|
+
semantic: string;
|
|
25
|
+
size: string;
|
|
26
|
+
typography: string;
|
|
27
|
+
config: Config;
|
|
28
|
+
}[];
|
|
29
|
+
export declare const getConfigs: getConfigs;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/tokens/configs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AASnE,eAAO,MAAM,MAAM,OAAO,CAAC;AAC3B,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,SAAS,MAAM,CAAC;AA2C7B,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvF,eAAO,MAAM,eAAe,YAAa,WAAW,EAAE,qBAGlD,CAAC;AAEL,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAK,MAAM,CAAC;AAEb,eAAO,MAAM,kBAAkB,EAAE,SAkChC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,SA+C/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAqC9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAoC3B,CAAC;AAEF,KAAK,UAAU,GAAG,CAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,KACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC;AAE3G,eAAO,MAAM,UAAU,EAAE,UAqCd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/css.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAarD,eAAO,MAAM,SAAS,EAAE,MAsBvB,CAAC;AAIF,eAAO,MAAM,QAAQ,EAAE,MAoCtB,CAAC;AAsCF,eAAO,MAAM,UAAU,EAAE,MAiFxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-tokens.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/js-tokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAcvE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAyBtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../../src/tokens/transformers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOxD,eAAO,MAAM,OAAO,EAAE,SAoBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC;AASF,eAAO,MAAM,mBAAmB,EAAE,SASjC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface Options {
|
|
2
|
+
splitRegexp?: RegExp | RegExp[];
|
|
3
|
+
stripRegexp?: RegExp | RegExp[];
|
|
4
|
+
delimiter?: string;
|
|
5
|
+
transform?: (part: string, index: number, parts: string[]) => string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Normalize the string into something other libraries can manipulate easier.
|
|
9
|
+
*/
|
|
10
|
+
export declare function noCase(input: string, options?: Options): string;
|
|
11
|
+
//# sourceMappingURL=noCase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noCase.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/noCase.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,OAAO;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;CACtE;AAQD;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,UAsB1D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ThemeObject } from '@tokens-studio/types';
|
|
2
|
+
declare interface Options {
|
|
3
|
+
separator?: string;
|
|
4
|
+
}
|
|
5
|
+
export type PermutatedTheme = {
|
|
6
|
+
mode?: string;
|
|
7
|
+
semantic?: string;
|
|
8
|
+
size?: string;
|
|
9
|
+
theme?: string;
|
|
10
|
+
typography?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
selectedTokenSets: string[];
|
|
13
|
+
};
|
|
14
|
+
export type PermutatedThemes = PermutatedTheme[];
|
|
15
|
+
export declare function permutateThemes(themes: ThemeObject[], { separator }?: Options): PermutatedThemes;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=permutateThemes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permutateThemes.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/permutateThemes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,WAAW,OAAO;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC;AAMjD,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,SAAe,EAAE,UAAgB,GAAG,gBAAgB,CAoD5G"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TransformedToken, DesignToken } from 'style-dictionary/types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns type based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
|
|
4
|
+
* @param token Transformed token
|
|
5
|
+
* @returns type
|
|
6
|
+
*/
|
|
7
|
+
export declare const getType: (token: TransformedToken) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Returns value based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
|
|
10
|
+
*
|
|
11
|
+
* Use generic (`<T>`) to define return value type
|
|
12
|
+
* @param token Transformed or Design token
|
|
13
|
+
* @returns value
|
|
14
|
+
*/
|
|
15
|
+
export declare const getValue: <T>(token: TransformedToken | DesignToken) => T;
|
|
16
|
+
/**
|
|
17
|
+
* Check if token type matches provided type
|
|
18
|
+
* This function is curried
|
|
19
|
+
* @param types Type or array of types to check against
|
|
20
|
+
* @param token Transformed token
|
|
21
|
+
* @returns boolean
|
|
22
|
+
*/
|
|
23
|
+
export declare const typeEquals: import("ts-toolbelt/out/Function/Curry").Curry<(types: string[] | string, token: TransformedToken) => boolean>;
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,OAAO,UAAW,gBAAgB,WAAkD,CAAC;AAElG;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,aAAc,gBAAgB,GAAG,WAAW,KAAG,CAAuC,CAAC;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,yDAAmB,MAAM,EAAE,GAAG,MAAM,SAAS,gBAAgB,aAMlF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.16",
|
|
4
4
|
"description": "CLI for Designsystemet",
|
|
5
5
|
"author": "Designsystemet team",
|
|
6
6
|
"repository": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"homepage": "https://github.com/digdir/designsystemet/tree/main/scripts/cli",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"type": "module",
|
|
13
|
+
"types": "./dist/types",
|
|
13
14
|
"files": [
|
|
14
15
|
"./dist/**"
|
|
15
16
|
],
|
|
@@ -27,9 +28,11 @@
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
31
|
+
"designsystemet": "tsx ./bin/designsystemet.ts",
|
|
30
32
|
"build:tokens": "yarn clean:theme && yarn designsystemet tokens -p -t ../../design-tokens -o ../../packages/theme/brand",
|
|
31
33
|
"build:tokens:debug": "yarn clean:theme && tsx --inspect-brk ./bin/designsystemet.ts tokens -p -t ../../design-tokens -o ../../packages/theme/brand",
|
|
32
|
-
"build": "yarn clean && swc src bin --copy-files -d dist",
|
|
34
|
+
"build": "yarn clean && swc src bin --copy-files -d dist && yarn build:types",
|
|
35
|
+
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
33
36
|
"clean": "rimraf dist",
|
|
34
37
|
"clean:theme": "yarn workspace @digdir/designsystemet-theme clean"
|
|
35
38
|
},
|