@trackunit/css-component-tokens 0.0.40 → 0.0.42
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/index.cjs.js
CHANGED
|
@@ -60,6 +60,15 @@ const _default = _createPlugin.default;
|
|
|
60
60
|
let createPlugin = createPlugin$2;
|
|
61
61
|
var plugin = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default;
|
|
62
62
|
|
|
63
|
+
/** Returns object structure for Tailwind variable config for specified theme for ALL ComponentTokenDefinitions. */
|
|
64
|
+
const getComponentTokenVariablesByThemeName = (theme, componentTokenDefinitions) => {
|
|
65
|
+
const themeTokenObject = Object.fromEntries(Object.entries(componentTokenDefinitions).map(([componentName, componentThemes]) => [
|
|
66
|
+
componentName,
|
|
67
|
+
componentThemes[theme],
|
|
68
|
+
]));
|
|
69
|
+
return themeTokenObject;
|
|
70
|
+
};
|
|
71
|
+
|
|
63
72
|
/**
|
|
64
73
|
* Returns the designTokens passed, but ensures it satisfies DesignTokens type while keeping it literal
|
|
65
74
|
*/
|
|
@@ -250,15 +259,6 @@ const componentTokenDefinitions = {
|
|
|
250
259
|
formGroup: FormGroupTokenDefinition,
|
|
251
260
|
};
|
|
252
261
|
|
|
253
|
-
/** Returns object structure for Tailwind variable config for specified theme for ALL ComponentTokenDefinitions. */
|
|
254
|
-
const getComponentTokenVariablesByThemeName = (theme, componentTokenDefinitions) => {
|
|
255
|
-
const themeTokenObject = Object.fromEntries(Object.entries(componentTokenDefinitions).map(([componentName, componentThemes]) => [
|
|
256
|
-
componentName,
|
|
257
|
-
componentThemes[theme],
|
|
258
|
-
]));
|
|
259
|
-
return themeTokenObject;
|
|
260
|
-
};
|
|
261
|
-
|
|
262
262
|
/** The prefix for css variables and tailwind component classes */
|
|
263
263
|
const PREFIX = "component";
|
|
264
264
|
/**
|
package/index.esm.js
CHANGED
|
@@ -56,6 +56,15 @@ const _default = _createPlugin.default;
|
|
|
56
56
|
let createPlugin = createPlugin$2;
|
|
57
57
|
var plugin = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default;
|
|
58
58
|
|
|
59
|
+
/** Returns object structure for Tailwind variable config for specified theme for ALL ComponentTokenDefinitions. */
|
|
60
|
+
const getComponentTokenVariablesByThemeName = (theme, componentTokenDefinitions) => {
|
|
61
|
+
const themeTokenObject = Object.fromEntries(Object.entries(componentTokenDefinitions).map(([componentName, componentThemes]) => [
|
|
62
|
+
componentName,
|
|
63
|
+
componentThemes[theme],
|
|
64
|
+
]));
|
|
65
|
+
return themeTokenObject;
|
|
66
|
+
};
|
|
67
|
+
|
|
59
68
|
/**
|
|
60
69
|
* Returns the designTokens passed, but ensures it satisfies DesignTokens type while keeping it literal
|
|
61
70
|
*/
|
|
@@ -246,15 +255,6 @@ const componentTokenDefinitions = {
|
|
|
246
255
|
formGroup: FormGroupTokenDefinition,
|
|
247
256
|
};
|
|
248
257
|
|
|
249
|
-
/** Returns object structure for Tailwind variable config for specified theme for ALL ComponentTokenDefinitions. */
|
|
250
|
-
const getComponentTokenVariablesByThemeName = (theme, componentTokenDefinitions) => {
|
|
251
|
-
const themeTokenObject = Object.fromEntries(Object.entries(componentTokenDefinitions).map(([componentName, componentThemes]) => [
|
|
252
|
-
componentName,
|
|
253
|
-
componentThemes[theme],
|
|
254
|
-
]));
|
|
255
|
-
return themeTokenObject;
|
|
256
|
-
};
|
|
257
|
-
|
|
258
258
|
/** The prefix for css variables and tailwind component classes */
|
|
259
259
|
const PREFIX = "component";
|
|
260
260
|
/**
|
package/package.json
CHANGED
|
@@ -246,5 +246,5 @@ export declare const componentTokenDefinitions: {
|
|
|
246
246
|
export type ComponentTokenDefinitions = typeof componentTokenDefinitions;
|
|
247
247
|
export type ComponentNames = keyof typeof componentTokenDefinitions;
|
|
248
248
|
export type ComponentTokenNames<Component extends ComponentNames> = {
|
|
249
|
-
[Key in keyof typeof componentTokenDefinitions[Component][ThemeNames] & string]: Key;
|
|
250
|
-
}[keyof typeof componentTokenDefinitions[Component][ThemeNames] & string];
|
|
249
|
+
[Key in keyof (typeof componentTokenDefinitions)[Component][ThemeNames] & string]: Key;
|
|
250
|
+
}[keyof (typeof componentTokenDefinitions)[Component][ThemeNames] & string];
|