From fc3badc2add18420b26dd03d8b5f2cc47b90fe14 Mon Sep 17 00:00:00 2001 From: jorenbroekema Date: Thu, 16 Nov 2023 13:41:13 +0100 Subject: [PATCH] BREAKING: add strokeStyle and rename some union types for consistency --- .changeset/many-doors-argue.md | 5 +++++ package-lock.json | 4 ++-- src/constants/BorderValues.ts | 2 ++ src/constants/BoxShadowTypes.ts | 2 +- src/constants/BoxShadowValues.ts | 2 ++ src/constants/ColorModifierTypes.ts | 2 +- src/constants/ColorSpaceTypes.ts | 2 +- src/constants/StrokeStyleValues.ts | 12 ++++++++++++ src/constants/TokenTypes.ts | 1 + src/constants/TypographyValues.ts | 2 ++ src/types/index.ts | 1 + 11 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .changeset/many-doors-argue.md create mode 100644 src/constants/StrokeStyleValues.ts diff --git a/.changeset/many-doors-argue.md b/.changeset/many-doors-argue.md new file mode 100644 index 0000000..6f7f3ab --- /dev/null +++ b/.changeset/many-doors-argue.md @@ -0,0 +1,5 @@ +--- +'@tokens-studio/types': minor +--- + +BREAKING: add strokeStyle token type and values enum, rename the following 3 type exports for consistency: BoxShadowUnion -> BoxShadowTypesUnion, ColorModifierUnion -> ColorModifierTypesUnion, ColorSpaceUnion -> ColorSpaceTypesUnion. Export union types for the enum constants that did not yet have one. diff --git a/package-lock.json b/package-lock.json index c184d02..bcafe22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tokens-studio/types", - "version": "0.2.2", + "version": "0.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tokens-studio/types", - "version": "0.2.2", + "version": "0.2.5", "license": "MIT", "devDependencies": { "@changesets/cli": "^2.26.0", diff --git a/src/constants/BorderValues.ts b/src/constants/BorderValues.ts index bd6dcb6..5f6c284 100644 --- a/src/constants/BorderValues.ts +++ b/src/constants/BorderValues.ts @@ -3,3 +3,5 @@ export enum BorderValues { BORDER_WIDTH = 'width', BORDER_STYLE = 'style', } + +export type BorderValuesUnion = `${BorderValues}`; diff --git a/src/constants/BoxShadowTypes.ts b/src/constants/BoxShadowTypes.ts index 70512cd..48cf49e 100644 --- a/src/constants/BoxShadowTypes.ts +++ b/src/constants/BoxShadowTypes.ts @@ -3,4 +3,4 @@ export enum BoxShadowTypes { INNER_SHADOW = 'innerShadow', } -export type BoxShadowUnion = `${BoxShadowTypes}`; +export type BoxShadowTypesUnion = `${BoxShadowTypes}`; diff --git a/src/constants/BoxShadowValues.ts b/src/constants/BoxShadowValues.ts index 7a114ee..d66ce3a 100644 --- a/src/constants/BoxShadowValues.ts +++ b/src/constants/BoxShadowValues.ts @@ -7,3 +7,5 @@ export enum BoxShadowValues { SPREAD = 'spread', BLEND_MODE = 'blendMode', } + +export type BoxShadowValuesUnion = `${BoxShadowValues}`; diff --git a/src/constants/ColorModifierTypes.ts b/src/constants/ColorModifierTypes.ts index f741f02..96746d9 100644 --- a/src/constants/ColorModifierTypes.ts +++ b/src/constants/ColorModifierTypes.ts @@ -5,4 +5,4 @@ export enum ColorModifierTypes { ALPHA = 'alpha', } -export type ColorModifierUnion = `${ColorModifierTypes}`; +export type ColorModifierTypesUnion = `${ColorModifierTypes}`; diff --git a/src/constants/ColorSpaceTypes.ts b/src/constants/ColorSpaceTypes.ts index 7fe0fee..b6041f7 100644 --- a/src/constants/ColorSpaceTypes.ts +++ b/src/constants/ColorSpaceTypes.ts @@ -5,4 +5,4 @@ export enum ColorSpaceTypes { HSL = 'hsl', } -export type ColorSpaceUnion = `${ColorSpaceTypes}`; +export type ColorSpaceTypesUnion = `${ColorSpaceTypes}`; diff --git a/src/constants/StrokeStyleValues.ts b/src/constants/StrokeStyleValues.ts new file mode 100644 index 0000000..c922f75 --- /dev/null +++ b/src/constants/StrokeStyleValues.ts @@ -0,0 +1,12 @@ +export enum StrokeStyleValues { + SOLID = 'solid', + DASHED = 'dashed', + DOTTED = 'dotted', + DOUBLE = 'double', + GROOVE = 'groove', + RIDGE = 'ridge', + OUTSET = 'outset', + INSET = 'inset', +} + +export type StrokeStyleValuesUnion = `${StrokeStyleValues}`; diff --git a/src/constants/TokenTypes.ts b/src/constants/TokenTypes.ts index 96d1057..8ce5040 100644 --- a/src/constants/TokenTypes.ts +++ b/src/constants/TokenTypes.ts @@ -8,6 +8,7 @@ export enum TokenTypes { TYPOGRAPHY = 'typography', OPACITY = 'opacity', BORDER_WIDTH = 'borderWidth', + STROKE_STYLE = 'strokeStyle', BOX_SHADOW = 'boxShadow', FONT_FAMILIES = 'fontFamilies', FONT_WEIGHTS = 'fontWeights', diff --git a/src/constants/TypographyValues.ts b/src/constants/TypographyValues.ts index 422c64d..7630267 100644 --- a/src/constants/TypographyValues.ts +++ b/src/constants/TypographyValues.ts @@ -9,3 +9,5 @@ export enum TypographyValues { TEXT_DECORATION = 'textDecoration', TEXT_CASE = 'textCase', } + +export type TypographyValuesUnion = `${TypographyValues}`; diff --git a/src/types/index.ts b/src/types/index.ts index 49c7698..905c49e 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -12,6 +12,7 @@ export * from './ThemeObject.js'; export * from './UsedTokenSetsMap.js'; export * from './valueTypes.js'; export * from '../constants/BorderValues.js'; +export * from '../constants/StrokeStyleValues.js'; export * from '../constants/BoxShadowValues.js'; export * from '../constants/TypographyValues.js';