Skip to content

Commit

Permalink
fix: add union versions of enum types and expose constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema committed Apr 7, 2023
1 parent 3e1ccfc commit 9f4dc96
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-roses-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/types': patch
---

Add unions of enum types. Move constants re-exports to main entrypoint.
2 changes: 2 additions & 0 deletions src/constants/BoxShadowTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export enum BoxShadowTypes {
DROP_SHADOW = 'dropShadow',
INNER_SHADOW = 'innerShadow',
}

export type BoxShadowUnion = `${BoxShadowTypes}`;
2 changes: 2 additions & 0 deletions src/constants/ColorModifierTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export enum ColorModifierTypes {
MIX = 'mix',
ALPHA = 'alpha',
}

export type ColorModifierUnion = `${ColorModifierTypes}`;
2 changes: 2 additions & 0 deletions src/constants/ColorSpaceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export enum ColorSpaceTypes {
P3 = 'p3',
HSL = 'hsl',
}

export type ColorSpaceUnion = `${ColorSpaceTypes}`;
2 changes: 2 additions & 0 deletions src/constants/Properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ export enum Properties {
tokenName = 'tokenName',
description = 'description',
}

export type PropertiesUnion = `${Properties}`;
2 changes: 2 additions & 0 deletions src/constants/TokenSetStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export enum TokenSetStatus {
SOURCE = 'source', // @README this means the token set will be used to resolve references, but will be excluded from styles creation
ENABLED = 'enabled', // @README this means the token set is fully enabled and will affect style creation
}

export type TokenSetStatusUnion = `${TokenSetStatus}`;
2 changes: 2 additions & 0 deletions src/constants/TokenTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export enum TokenTypes {
BORDER = 'border',
ASSET = 'asset',
}

export type TokenTypesUnion = `${TokenTypes}`;
6 changes: 0 additions & 6 deletions src/constants/index.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ export * from './ThemeObject';
export * from './UsedTokenSetsMap';
export * from './tokens/index';
export * from './values/index';
export * from '../constants/BoxShadowTypes';
export * from '../constants/ColorModifierTypes';
export * from '../constants/ColorSpaceTypes';
export * from '../constants/Properties';
export * from '../constants/TokenSetStatus';
export * from '../constants/TokenTypes';

0 comments on commit 9f4dc96

Please sign in to comment.