@trackunit/ui-design-tokens 0.0.106 → 0.0.108
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/package.json
CHANGED
|
@@ -28,8 +28,8 @@ type OutputOptions = (typeof outputOptions)[number];
|
|
|
28
28
|
* color("PRIMARY", 200) --> "rgb(var(--color-primary-200) / var(--tw-bg-opacity)))"
|
|
29
29
|
*"
|
|
30
30
|
*/
|
|
31
|
-
declare function color<
|
|
32
|
-
declare function color<
|
|
33
|
-
declare function color<
|
|
34
|
-
declare function color<
|
|
31
|
+
declare function color<TColorName extends ThemeColorKeys>(ColorKey: TColorName): string;
|
|
32
|
+
declare function color<TColorName extends ThemeColorKeys>(ColorKey: TColorName, variant?: ColorVariants<TColorName>): string;
|
|
33
|
+
declare function color<TColorName extends ThemeColorKeys>(ColorKey: TColorName, output?: OutputOptions): string;
|
|
34
|
+
declare function color<TColorName extends ThemeColorKeys>(ColorKey: TColorName, variant?: ColorVariants<TColorName>, output?: OutputOptions): string;
|
|
35
35
|
export { color };
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ThemeColorKeys, trackunitPalette } from "./trackunitPalette";
|
|
5
5
|
/** Type used for available variants for a given ColorName */
|
|
6
|
-
export type ColorVariants<
|
|
7
|
-
export interface ThemeColorObject<
|
|
8
|
-
name: Lowercase<
|
|
6
|
+
export type ColorVariants<TColorName extends ThemeColorKeys> = keyof (typeof themeColors)[TColorName]["variants"];
|
|
7
|
+
export interface ThemeColorObject<TThemeColorKeys extends ThemeColorKeys> {
|
|
8
|
+
name: Lowercase<TThemeColorKeys>;
|
|
9
9
|
variants: {
|
|
10
|
-
[key in keyof (typeof trackunitPalette)[
|
|
10
|
+
[key in keyof (typeof trackunitPalette)[TThemeColorKeys]]: string;
|
|
11
11
|
};
|
|
12
|
-
defaultVariant?: keyof (typeof trackunitPalette)[
|
|
12
|
+
defaultVariant?: keyof (typeof trackunitPalette)[TThemeColorKeys];
|
|
13
13
|
}
|
|
14
14
|
export type ThemeColorsObject = {
|
|
15
15
|
[key in ThemeColorKeys]: ThemeColorObject<key>;
|