@trackunit/ui-design-tokens 0.0.1-alpha-afcc978985.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/README.md +13 -0
- package/index.d.ts +5 -0
- package/index.js +677 -0
- package/package.json +10 -0
- package/scripts/generate-css.d.ts +1 -0
- package/tokens/chartColorsDefault.d.ts +2 -0
- package/tokens/colors/color.d.ts +35 -0
- package/tokens/colors/colors.d.ts +21 -0
- package/tokens/colors/index.d.ts +4 -0
- package/tokens/colors/tailwindPalette.d.ts +270 -0
- package/tokens/colors/trackunitPalette.d.ts +754 -0
- package/tokens/elevation.d.ts +13 -0
- package/tokens/size.d.ts +19 -0
- package/tokens/tokens.d.ts +13 -0
- package/tokens/typography.d.ts +20 -0
- package/tokens/utils/colorVariableToCss.d.ts +12 -0
- package/tokens/utils/getHEX.d.ts +10 -0
- package/tokens/utils/getValuesFromDesignToken.d.ts +5 -0
- package/tokens/zIndex.d.ts +9 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elevation is based on N100 with an alpha channel. E(X)A variants
|
|
3
|
+
* are for active versions(e.g. hover).
|
|
4
|
+
*/
|
|
5
|
+
export declare const elevation: {
|
|
6
|
+
readonly E05: "var(--box-shadow-sm)";
|
|
7
|
+
readonly E10: "var(--box-shadow-DEFAULT)";
|
|
8
|
+
readonly E10A: "var(--box-shadow-md)";
|
|
9
|
+
readonly E20: "var(--box-shadow-lg)";
|
|
10
|
+
readonly E30: "var(--box-shadow-xl)";
|
|
11
|
+
readonly E40: "var(--box-shadow-2xl)";
|
|
12
|
+
};
|
|
13
|
+
export declare type Elevation = typeof elevation;
|
package/tokens/size.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const size: {
|
|
2
|
+
/** --spacing-0: 0px; */
|
|
3
|
+
readonly none: "var(--spacing-0)";
|
|
4
|
+
/** --spacing-1: 0.25rem; */
|
|
5
|
+
readonly tiny: "var(--spacing-1)";
|
|
6
|
+
/** --spacing-2: 0.5rem; */
|
|
7
|
+
readonly mini: "var(--spacing-2)";
|
|
8
|
+
/** --spacing-3: 0.75rem; */
|
|
9
|
+
readonly small: "var(--spacing-3)";
|
|
10
|
+
/** --spacing-4: 1rem; */
|
|
11
|
+
readonly medium: "var(--spacing-4)";
|
|
12
|
+
/** --spacing-6: 1.5rem; */
|
|
13
|
+
readonly large: "var(--spacing-6)";
|
|
14
|
+
/** --spacing-8: 2rem; */
|
|
15
|
+
readonly giant: "var(--spacing-8)";
|
|
16
|
+
/** --spacing-10: 2.5rem; */
|
|
17
|
+
readonly enormous: "var(--spacing-10)";
|
|
18
|
+
};
|
|
19
|
+
export declare type Size = typeof size;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Elevation } from "./elevation";
|
|
2
|
+
import { Size } from "./size";
|
|
3
|
+
import { FontSize, FontWeight } from "./typography";
|
|
4
|
+
import { ZIndex } from "./zIndex";
|
|
5
|
+
export interface Tokens {
|
|
6
|
+
size: Size;
|
|
7
|
+
fontSize: FontSize;
|
|
8
|
+
fontWeight: FontWeight;
|
|
9
|
+
fontFamily: string;
|
|
10
|
+
elevation: Elevation;
|
|
11
|
+
zIndex: ZIndex;
|
|
12
|
+
}
|
|
13
|
+
export declare const tokens: Tokens;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on a root size of 16px.
|
|
3
|
+
*/
|
|
4
|
+
export declare const fontSize: {
|
|
5
|
+
readonly primary: "var( --font-size-3xl)";
|
|
6
|
+
readonly secondary: "var(--font-size-lg)";
|
|
7
|
+
readonly tertiary: "var(--font-size-base)";
|
|
8
|
+
readonly subtitle: "var(--font-size-base)";
|
|
9
|
+
readonly body: "var(--font-size-sm)";
|
|
10
|
+
readonly small: "var(--font-size-xs)";
|
|
11
|
+
};
|
|
12
|
+
export declare type FontSize = typeof fontSize;
|
|
13
|
+
/**
|
|
14
|
+
* Primary font weights.
|
|
15
|
+
*/
|
|
16
|
+
export declare const fontWeight: {
|
|
17
|
+
readonly normal: 400;
|
|
18
|
+
readonly bold: 600;
|
|
19
|
+
};
|
|
20
|
+
export declare type FontWeight = typeof fontWeight;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a css custom property from our design tokens to a useable css string.
|
|
3
|
+
*
|
|
4
|
+
* Our custom properties are saved as "rrr ggg bbb" rather than a full css color.
|
|
5
|
+
*
|
|
6
|
+
* This allows us to modify them with opacity values and more.
|
|
7
|
+
*
|
|
8
|
+
* @param variable CSS custom property for color
|
|
9
|
+
* @returns Full css for using the color
|
|
10
|
+
* @example "--color-primart-400" --> "rgb(var(--color-primary-400) / var(--tw-bg-opacity)))"
|
|
11
|
+
*/
|
|
12
|
+
export declare function colorVariableToCss(variable: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the HEX color based on a Color from the theme.
|
|
3
|
+
* Reads the RGB value from the underlying CSS variable and convert to HEX.
|
|
4
|
+
*
|
|
5
|
+
* Example: color("PRIMARY", 500, "HEX") -> #3b82f6
|
|
6
|
+
*
|
|
7
|
+
* @param variable A color from the `colors` object of the Theme
|
|
8
|
+
* @returns HEX color
|
|
9
|
+
*/
|
|
10
|
+
export declare const getHEX: (variable: string) => string;
|