@apify/ui-library 0.76.2 → 0.76.4-featcolortokens-178953.36
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 +18 -5
- package/dist/src/components/button.js +1 -1
- package/dist/src/components/button.js.map +1 -1
- package/dist/src/design_system/colors/generated/colors_theme.dark.d.ts +110 -0
- package/dist/src/design_system/colors/generated/colors_theme.dark.d.ts.map +1 -0
- package/dist/src/design_system/colors/generated/colors_theme.dark.js +110 -0
- package/dist/src/design_system/colors/generated/colors_theme.dark.js.map +1 -0
- package/dist/src/design_system/colors/generated/colors_theme.light.d.ts +110 -0
- package/dist/src/design_system/colors/generated/colors_theme.light.d.ts.map +1 -0
- package/dist/src/design_system/colors/generated/colors_theme.light.js +110 -0
- package/dist/src/design_system/colors/generated/colors_theme.light.js.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables.dark.d.ts +5 -0
- package/dist/src/design_system/colors/generated/css_variables.dark.d.ts.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables.dark.js +147 -0
- package/dist/src/design_system/colors/generated/css_variables.dark.js.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables.light.d.ts +5 -0
- package/dist/src/design_system/colors/generated/css_variables.light.d.ts.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables.light.js +147 -0
- package/dist/src/design_system/colors/generated/css_variables.light.js.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.dark.d.ts +5 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.dark.d.ts.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.dark.js +74 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.dark.js.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.light.d.ts +5 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.light.d.ts.map +1 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.light.js +74 -0
- package/dist/src/design_system/colors/generated/css_variables_palette.light.js.map +1 -0
- package/dist/src/design_system/{properties_theme.d.ts → colors/generated/properties_theme.d.ts} +18 -14
- package/dist/src/design_system/colors/generated/properties_theme.d.ts.map +1 -0
- package/dist/src/design_system/{properties_theme.js → colors/generated/properties_theme.js} +18 -154
- package/dist/src/design_system/colors/generated/properties_theme.js.map +1 -0
- package/dist/src/design_system/colors/index.d.ts +8 -0
- package/dist/src/design_system/colors/index.d.ts.map +1 -0
- package/dist/src/design_system/colors/index.js +8 -0
- package/dist/src/design_system/colors/index.js.map +1 -0
- package/dist/src/design_system/theme.d.ts +88 -87
- package/dist/src/design_system/theme.d.ts.map +1 -1
- package/dist/src/design_system/theme.js +1 -2
- package/dist/src/design_system/theme.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +10 -4
- package/src/components/button.tsx +1 -1
- package/src/design_system/colors/build_color_tokens.js +183 -0
- package/src/design_system/colors/figma_color_tokens.dark.json +886 -0
- package/src/design_system/colors/figma_color_tokens.light.json +886 -0
- package/src/design_system/colors/generated/colors_theme.dark.ts +110 -0
- package/src/design_system/{colors_theme.ts → colors/generated/colors_theme.light.ts} +40 -143
- package/src/design_system/colors/generated/css_variables.dark.ts +147 -0
- package/src/design_system/colors/generated/css_variables.light.ts +147 -0
- package/src/design_system/colors/generated/css_variables_palette.dark.ts +74 -0
- package/src/design_system/colors/generated/css_variables_palette.light.ts +74 -0
- package/src/design_system/{properties_theme.ts → colors/generated/properties_theme.ts} +19 -293
- package/src/design_system/colors/index.ts +7 -0
- package/src/design_system/theme.ts +1 -2
- package/src/index.ts +1 -0
- package/style/colors/dark.scss +148 -0
- package/style/colors/light.scss +148 -0
- package/style/colors/palette.dark.scss +75 -0
- package/style/colors/palette.light.scss +75 -0
- package/.stylelintrc +0 -12
- package/CHANGELOG.md +0 -3446
- package/CODEOWNERS +0 -7
- package/dist/src/design_system/colors_theme.d.ts +0 -213
- package/dist/src/design_system/colors_theme.d.ts.map +0 -1
- package/dist/src/design_system/colors_theme.js +0 -213
- package/dist/src/design_system/colors_theme.js.map +0 -1
- package/dist/src/design_system/properties_theme.d.ts.map +0 -1
- package/dist/src/design_system/properties_theme.js.map +0 -1
- package/eslint.config.mjs +0 -45
- package/src/codemods/generate_color_property_tokens.mjs +0 -98
- package/src/codemods/generate_color_theme_files.mjs +0 -47
- package/src/design_system/generate_color_definitions.js +0 -44
- package/src/design_system/supernova_color_tokens.json +0 -1766
- package/tsconfig.build.json +0 -17
- package/tsconfig.json +0 -10
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
|
|
3
|
-
const code = readFileSync('./src/design_system/supernova_color_tokens.json', 'utf-8');
|
|
4
|
-
|
|
5
|
-
const colorsDefinitions = JSON.parse(code);
|
|
6
|
-
|
|
7
|
-
const getObjectValueByPath = (obj, path) => {
|
|
8
|
-
return path.split('.').reduce((acc, part) => {
|
|
9
|
-
return acc && acc[part];
|
|
10
|
-
}, obj);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const getColorPropertyName = (semanticCategory, property) => {
|
|
14
|
-
const semanticColorName = `${property.split(/[_ ]/).map((semanticPartName) => semanticPartName.toLowerCase()).join('-')}`;
|
|
15
|
-
|
|
16
|
-
// lower case and replace spaces with dashes
|
|
17
|
-
const semanticCategoryName = semanticCategory.toLowerCase().split(' ').join('-');
|
|
18
|
-
|
|
19
|
-
return `--color-${semanticCategoryName}-${semanticColorName}`;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const generateColorDefinitions = (themeVariant) => {
|
|
23
|
-
const mergedPalette = {
|
|
24
|
-
...colorsDefinitions[themeVariant].Semantic,
|
|
25
|
-
...colorsDefinitions[themeVariant].Decorative,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const colorDefinitions = [];
|
|
29
|
-
for (const [semanticCategory, palette] of Object.entries(mergedPalette)) {
|
|
30
|
-
for (const [key, { value }] of Object.entries(palette)) {
|
|
31
|
-
colorDefinitions.push(
|
|
32
|
-
|
|
33
|
-
`${getColorPropertyName(semanticCategory, key)}: ${value.startsWith('#') ? value : getObjectValueByPath(colorsDefinitions[themeVariant], value.slice(1, -1)).value};`,
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return colorDefinitions.join('\n');
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
['light', 'dark'].forEach((themeVariant) => {
|
|
42
|
-
// eslint-disable-next-line no-console
|
|
43
|
-
console.log(`\n*** CSS variables from ${themeVariant} mode ***\n`, generateColorDefinitions(themeVariant));
|
|
44
|
-
});
|