@digdir/designsystemet 1.13.2 → 1.14.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/bin/config.js +50 -658
- package/dist/bin/designsystemet.d.ts.map +1 -1
- package/dist/bin/designsystemet.js +136 -4623
- package/dist/bin/options.js +22 -14
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js +9 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js +8 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js +13 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js +10 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js +10 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js +53 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js +14 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js +9 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js +32 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js +15 -0
- package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/types/index.js +11 -0
- package/dist/package.js +5 -0
- package/dist/src/colors/colorMetadata.js +255 -261
- package/dist/src/colors/index.js +5 -522
- package/dist/src/colors/theme.js +104 -343
- package/dist/src/colors/types.js +22 -25
- package/dist/src/colors/utils.js +241 -154
- package/dist/src/config.js +103 -444
- package/dist/src/index.js +10 -3588
- package/dist/src/migrations/beta-to-v1.js +339 -537
- package/dist/src/migrations/codemods/css/plugins.js +31 -42
- package/dist/src/migrations/codemods/css/run.js +20 -151
- package/dist/src/migrations/color-rename-next49.js +44 -220
- package/dist/src/migrations/index.js +7 -577
- package/dist/src/scripts/update-preview-tokens.d.ts.map +1 -1
- package/dist/src/tokens/build.js +39 -1816
- package/dist/src/tokens/create/files.d.ts +10 -5
- package/dist/src/tokens/create/files.d.ts.map +1 -1
- package/dist/src/tokens/create/files.js +44 -601
- package/dist/src/tokens/create/generators/$designsystemet.js +8 -97
- package/dist/src/tokens/create/generators/$metadata.d.ts +7 -3
- package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/$metadata.js +24 -21
- package/dist/src/tokens/create/generators/$themes.d.ts +2 -4
- package/dist/src/tokens/create/generators/$themes.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/$themes.js +139 -312
- package/dist/src/tokens/create/generators/primitives/color-scheme.js +68 -443
- package/dist/src/tokens/create/generators/primitives/globals.js +141 -147
- package/dist/src/tokens/create/generators/primitives/size.js +146 -156
- package/dist/src/tokens/create/generators/primitives/typography.js +213 -217
- package/dist/src/tokens/create/generators/semantic/color-modes.js +24 -59
- package/dist/src/tokens/create/generators/semantic/color.js +42 -326
- package/dist/src/tokens/create/generators/semantic/style.js +379 -382
- package/dist/src/tokens/create/generators/themes/theme.js +108 -392
- package/dist/src/tokens/create.d.ts +2 -1
- package/dist/src/tokens/create.d.ts.map +1 -1
- package/dist/src/tokens/create.js +50 -1591
- package/dist/src/tokens/format.d.ts.map +1 -1
- package/dist/src/tokens/format.js +35 -3324
- package/dist/src/tokens/generate-config.js +155 -298
- package/dist/src/tokens/index.js +3 -3344
- package/dist/src/tokens/process/configs/color.js +50 -1085
- package/dist/src/tokens/process/configs/semantic.js +45 -1083
- package/dist/src/tokens/process/configs/shared.js +18 -109
- package/dist/src/tokens/process/configs/size-mode.js +27 -1082
- package/dist/src/tokens/process/configs/size.js +32 -1083
- package/dist/src/tokens/process/configs/type-scale.js +49 -1083
- package/dist/src/tokens/process/configs/typography.js +63 -1084
- package/dist/src/tokens/process/configs.js +91 -1224
- package/dist/src/tokens/process/formats/css/color.js +58 -1079
- package/dist/src/tokens/process/formats/css/semantic.js +27 -1081
- package/dist/src/tokens/process/formats/css/size-mode.js +43 -1077
- package/dist/src/tokens/process/formats/css/size.js +86 -1079
- package/dist/src/tokens/process/formats/css/type-scale.js +53 -1083
- package/dist/src/tokens/process/formats/css/typography.js +27 -1081
- package/dist/src/tokens/process/formats/css.js +18 -1081
- package/dist/src/tokens/process/output/declarations.js +18 -1201
- package/dist/src/tokens/process/output/tailwind.js +26 -40
- package/dist/src/tokens/process/output/theme.js +73 -206
- package/dist/src/tokens/process/platform.js +165 -1355
- package/dist/src/tokens/process/transformers.js +49 -89
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +100 -1183
- package/dist/src/tokens/process/utils/kebab-case.js +7 -5
- package/dist/src/tokens/types.d.ts +6 -0
- package/dist/src/tokens/types.d.ts.map +1 -1
- package/dist/src/tokens/types.js +6 -7
- package/dist/src/tokens/utils.d.ts +2 -1
- package/dist/src/tokens/utils.d.ts.map +1 -1
- package/dist/src/tokens/utils.js +107 -93
- package/dist/src/types.js +1 -5
- package/dist/src/utils/filesystem.js +112 -124
- package/package.json +12 -15
- package/configs/test-tokens.config.json +0 -82
- package/dist/src/scripts/createJsonSchema.js +0 -409
- package/dist/src/scripts/update-preview-tokens.js +0 -3353
package/dist/bin/options.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return command.getOptionValue(option);
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
var getSuppliedCliOption = getOptionIfMatchingSource("cli");
|
|
9
|
-
var getDefaultCliOption = getOptionIfMatchingSource("default");
|
|
10
|
-
var getCliOption = getOptionIfMatchingSource("cli", "default");
|
|
11
|
-
export {
|
|
12
|
-
getCliOption,
|
|
13
|
-
getDefaultCliOption,
|
|
14
|
-
getSuppliedCliOption
|
|
1
|
+
//#region bin/options.ts
|
|
2
|
+
const getOptionIfMatchingSource = (...sources) => (command, option) => {
|
|
3
|
+
const source = command.getOptionValueSource(option);
|
|
4
|
+
if (sources.includes(source)) return command.getOptionValue(option);
|
|
15
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Get an option value if it is explicitly supplied to the CLI command.
|
|
8
|
+
* The difference between this and using the option directly is that we return undefined
|
|
9
|
+
* instead of the default value if the option was not explicitly set.
|
|
10
|
+
*/
|
|
11
|
+
const getSuppliedCliOption = getOptionIfMatchingSource("cli");
|
|
12
|
+
/**
|
|
13
|
+
* Get the default value specified for a CLI command option.
|
|
14
|
+
* Mostly useful for getting values which may later be overridden.
|
|
15
|
+
*/
|
|
16
|
+
const getDefaultCliOption = getOptionIfMatchingSource("default");
|
|
17
|
+
/**
|
|
18
|
+
* Try to get the explicitly supplied CLI option, and fall back to the default value
|
|
19
|
+
* for the option as defined in the {@link Command}
|
|
20
|
+
*/
|
|
21
|
+
const getCliOption = getOptionIfMatchingSource("cli", "default");
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getCliOption, getDefaultCliOption, getSuppliedCliOption };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
|
|
2
|
+
var BorderValues;
|
|
3
|
+
(function(BorderValues) {
|
|
4
|
+
BorderValues["BORDER_COLOR"] = "color";
|
|
5
|
+
BorderValues["BORDER_WIDTH"] = "width";
|
|
6
|
+
BorderValues["BORDER_STYLE"] = "style";
|
|
7
|
+
})(BorderValues || (BorderValues = {}));
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BorderValues };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
|
|
2
|
+
var BoxShadowTypes;
|
|
3
|
+
(function(BoxShadowTypes) {
|
|
4
|
+
BoxShadowTypes["DROP_SHADOW"] = "dropShadow";
|
|
5
|
+
BoxShadowTypes["INNER_SHADOW"] = "innerShadow";
|
|
6
|
+
})(BoxShadowTypes || (BoxShadowTypes = {}));
|
|
7
|
+
//#endregion
|
|
8
|
+
export { BoxShadowTypes };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
|
|
2
|
+
var BoxShadowValues;
|
|
3
|
+
(function(BoxShadowValues) {
|
|
4
|
+
BoxShadowValues["TYPE"] = "type";
|
|
5
|
+
BoxShadowValues["COLOR"] = "color";
|
|
6
|
+
BoxShadowValues["X"] = "x";
|
|
7
|
+
BoxShadowValues["Y"] = "y";
|
|
8
|
+
BoxShadowValues["BLUR"] = "blur";
|
|
9
|
+
BoxShadowValues["SPREAD"] = "spread";
|
|
10
|
+
BoxShadowValues["BLEND_MODE"] = "blendMode";
|
|
11
|
+
})(BoxShadowValues || (BoxShadowValues = {}));
|
|
12
|
+
//#endregion
|
|
13
|
+
export { BoxShadowValues };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
|
|
2
|
+
var ColorModifierTypes;
|
|
3
|
+
(function(ColorModifierTypes) {
|
|
4
|
+
ColorModifierTypes["LIGHTEN"] = "lighten";
|
|
5
|
+
ColorModifierTypes["DARKEN"] = "darken";
|
|
6
|
+
ColorModifierTypes["MIX"] = "mix";
|
|
7
|
+
ColorModifierTypes["ALPHA"] = "alpha";
|
|
8
|
+
})(ColorModifierTypes || (ColorModifierTypes = {}));
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ColorModifierTypes };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
|
|
2
|
+
var ColorSpaceTypes;
|
|
3
|
+
(function(ColorSpaceTypes) {
|
|
4
|
+
ColorSpaceTypes["LCH"] = "lch";
|
|
5
|
+
ColorSpaceTypes["SRGB"] = "srgb";
|
|
6
|
+
ColorSpaceTypes["P3"] = "p3";
|
|
7
|
+
ColorSpaceTypes["HSL"] = "hsl";
|
|
8
|
+
})(ColorSpaceTypes || (ColorSpaceTypes = {}));
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ColorSpaceTypes };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
|
|
2
|
+
var Properties;
|
|
3
|
+
(function(Properties) {
|
|
4
|
+
Properties["sizing"] = "sizing";
|
|
5
|
+
Properties["height"] = "height";
|
|
6
|
+
Properties["width"] = "width";
|
|
7
|
+
Properties["spacing"] = "spacing";
|
|
8
|
+
Properties["verticalPadding"] = "verticalPadding";
|
|
9
|
+
Properties["horizontalPadding"] = "horizontalPadding";
|
|
10
|
+
Properties["paddingTop"] = "paddingTop";
|
|
11
|
+
Properties["paddingRight"] = "paddingRight";
|
|
12
|
+
Properties["paddingBottom"] = "paddingBottom";
|
|
13
|
+
Properties["paddingLeft"] = "paddingLeft";
|
|
14
|
+
Properties["itemSpacing"] = "itemSpacing";
|
|
15
|
+
Properties["fill"] = "fill";
|
|
16
|
+
Properties["backgroundBlur"] = "backgroundBlur";
|
|
17
|
+
Properties["border"] = "border";
|
|
18
|
+
Properties["borderTop"] = "borderTop";
|
|
19
|
+
Properties["borderRight"] = "borderRight";
|
|
20
|
+
Properties["borderBottom"] = "borderBottom";
|
|
21
|
+
Properties["borderLeft"] = "borderLeft";
|
|
22
|
+
Properties["borderColor"] = "borderColor";
|
|
23
|
+
Properties["borderRadius"] = "borderRadius";
|
|
24
|
+
Properties["borderRadiusTopLeft"] = "borderRadiusTopLeft";
|
|
25
|
+
Properties["borderRadiusTopRight"] = "borderRadiusTopRight";
|
|
26
|
+
Properties["borderRadiusBottomRight"] = "borderRadiusBottomRight";
|
|
27
|
+
Properties["borderRadiusBottomLeft"] = "borderRadiusBottomLeft";
|
|
28
|
+
Properties["borderWidth"] = "borderWidth";
|
|
29
|
+
Properties["borderWidthTop"] = "borderWidthTop";
|
|
30
|
+
Properties["borderWidthRight"] = "borderWidthRight";
|
|
31
|
+
Properties["borderWidthBottom"] = "borderWidthBottom";
|
|
32
|
+
Properties["borderWidthLeft"] = "borderWidthLeft";
|
|
33
|
+
Properties["boxShadow"] = "boxShadow";
|
|
34
|
+
Properties["opacity"] = "opacity";
|
|
35
|
+
Properties["fontFamilies"] = "fontFamilies";
|
|
36
|
+
Properties["fontWeights"] = "fontWeights";
|
|
37
|
+
Properties["fontSizes"] = "fontSizes";
|
|
38
|
+
Properties["lineHeights"] = "lineHeights";
|
|
39
|
+
Properties["typography"] = "typography";
|
|
40
|
+
Properties["composition"] = "composition";
|
|
41
|
+
Properties["letterSpacing"] = "letterSpacing";
|
|
42
|
+
Properties["paragraphSpacing"] = "paragraphSpacing";
|
|
43
|
+
Properties["textCase"] = "textCase";
|
|
44
|
+
Properties["dimension"] = "dimension";
|
|
45
|
+
Properties["textDecoration"] = "textDecoration";
|
|
46
|
+
Properties["asset"] = "asset";
|
|
47
|
+
Properties["tokenValue"] = "tokenValue";
|
|
48
|
+
Properties["value"] = "value";
|
|
49
|
+
Properties["tokenName"] = "tokenName";
|
|
50
|
+
Properties["description"] = "description";
|
|
51
|
+
})(Properties || (Properties = {}));
|
|
52
|
+
//#endregion
|
|
53
|
+
export { Properties };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
|
|
2
|
+
var StrokeStyleValues;
|
|
3
|
+
(function(StrokeStyleValues) {
|
|
4
|
+
StrokeStyleValues["SOLID"] = "solid";
|
|
5
|
+
StrokeStyleValues["DASHED"] = "dashed";
|
|
6
|
+
StrokeStyleValues["DOTTED"] = "dotted";
|
|
7
|
+
StrokeStyleValues["DOUBLE"] = "double";
|
|
8
|
+
StrokeStyleValues["GROOVE"] = "groove";
|
|
9
|
+
StrokeStyleValues["RIDGE"] = "ridge";
|
|
10
|
+
StrokeStyleValues["OUTSET"] = "outset";
|
|
11
|
+
StrokeStyleValues["INSET"] = "inset";
|
|
12
|
+
})(StrokeStyleValues || (StrokeStyleValues = {}));
|
|
13
|
+
//#endregion
|
|
14
|
+
export { StrokeStyleValues };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
|
|
2
|
+
var TokenSetStatus;
|
|
3
|
+
(function(TokenSetStatus) {
|
|
4
|
+
TokenSetStatus["DISABLED"] = "disabled";
|
|
5
|
+
TokenSetStatus["SOURCE"] = "source";
|
|
6
|
+
TokenSetStatus["ENABLED"] = "enabled";
|
|
7
|
+
})(TokenSetStatus || (TokenSetStatus = {}));
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TokenSetStatus };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
|
|
2
|
+
var TokenTypes;
|
|
3
|
+
(function(TokenTypes) {
|
|
4
|
+
TokenTypes["OTHER"] = "other";
|
|
5
|
+
TokenTypes["COLOR"] = "color";
|
|
6
|
+
TokenTypes["BORDER_RADIUS"] = "borderRadius";
|
|
7
|
+
TokenTypes["SIZING"] = "sizing";
|
|
8
|
+
TokenTypes["SPACING"] = "spacing";
|
|
9
|
+
TokenTypes["TEXT"] = "text";
|
|
10
|
+
TokenTypes["TYPOGRAPHY"] = "typography";
|
|
11
|
+
TokenTypes["OPACITY"] = "opacity";
|
|
12
|
+
TokenTypes["BORDER_WIDTH"] = "borderWidth";
|
|
13
|
+
TokenTypes["STROKE_STYLE"] = "strokeStyle";
|
|
14
|
+
TokenTypes["BOX_SHADOW"] = "boxShadow";
|
|
15
|
+
TokenTypes["FONT_FAMILIES"] = "fontFamilies";
|
|
16
|
+
TokenTypes["FONT_WEIGHTS"] = "fontWeights";
|
|
17
|
+
TokenTypes["LINE_HEIGHTS"] = "lineHeights";
|
|
18
|
+
TokenTypes["FONT_SIZES"] = "fontSizes";
|
|
19
|
+
TokenTypes["LETTER_SPACING"] = "letterSpacing";
|
|
20
|
+
TokenTypes["PARAGRAPH_SPACING"] = "paragraphSpacing";
|
|
21
|
+
TokenTypes["PARAGRAPH_INDENT"] = "paragraphIndent";
|
|
22
|
+
TokenTypes["TEXT_DECORATION"] = "textDecoration";
|
|
23
|
+
TokenTypes["TEXT_CASE"] = "textCase";
|
|
24
|
+
TokenTypes["COMPOSITION"] = "composition";
|
|
25
|
+
TokenTypes["DIMENSION"] = "dimension";
|
|
26
|
+
TokenTypes["BORDER"] = "border";
|
|
27
|
+
TokenTypes["ASSET"] = "asset";
|
|
28
|
+
TokenTypes["BOOLEAN"] = "boolean";
|
|
29
|
+
TokenTypes["NUMBER"] = "number";
|
|
30
|
+
})(TokenTypes || (TokenTypes = {}));
|
|
31
|
+
//#endregion
|
|
32
|
+
export { TokenTypes };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
|
|
2
|
+
var TypographyValues;
|
|
3
|
+
(function(TypographyValues) {
|
|
4
|
+
TypographyValues["FONT_FAMILY"] = "fontFamily";
|
|
5
|
+
TypographyValues["FONT_WEIGHT"] = "fontWeight";
|
|
6
|
+
TypographyValues["LINE_HEIGHT"] = "lineHeight";
|
|
7
|
+
TypographyValues["FONT_SIZE"] = "fontSize";
|
|
8
|
+
TypographyValues["LETTER_SPACING"] = "letterSpacing";
|
|
9
|
+
TypographyValues["PARAGRAPH_SPACING"] = "paragraphSpacing";
|
|
10
|
+
TypographyValues["PARAGRAPH_INDENT"] = "paragraphIndent";
|
|
11
|
+
TypographyValues["TEXT_DECORATION"] = "textDecoration";
|
|
12
|
+
TypographyValues["TEXT_CASE"] = "textCase";
|
|
13
|
+
})(TypographyValues || (TypographyValues = {}));
|
|
14
|
+
//#endregion
|
|
15
|
+
export { TypographyValues };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../constants/BoxShadowTypes.js";
|
|
2
|
+
import "../constants/ColorModifierTypes.js";
|
|
3
|
+
import "../constants/ColorSpaceTypes.js";
|
|
4
|
+
import "../constants/Properties.js";
|
|
5
|
+
import "../constants/TokenSetStatus.js";
|
|
6
|
+
import "../constants/TokenTypes.js";
|
|
7
|
+
import "../constants/BorderValues.js";
|
|
8
|
+
import "../constants/StrokeStyleValues.js";
|
|
9
|
+
import "../constants/BoxShadowValues.js";
|
|
10
|
+
import "../constants/TypographyValues.js";
|
|
11
|
+
export {};
|