@viasat/beam-tokens 2.89.0 → 2.91.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 +38 -0
- package/index.js +2 -2290
- package/native/i18n/font-face-names.generated.cjs +1 -0
- package/native/i18n/font-face-names.generated.js +1 -0
- package/native/i18n/typography-overlay.cjs +1 -0
- package/native/i18n/typography-overlay.js +1 -0
- package/native/index.cjs +1 -0
- package/native/index.js +1 -0
- package/native/themes/blue-consumer.cjs +1 -0
- package/native/themes/blue-consumer.js +1 -0
- package/native/themes/blue-enterprise.cjs +1 -0
- package/native/themes/blue-enterprise.js +1 -0
- package/native/themes/green-consumer.cjs +1 -0
- package/native/themes/green-consumer.js +1 -0
- package/native/themes/green-enterprise.cjs +1 -0
- package/native/themes/green-enterprise.js +1 -0
- package/native/themes/neutral-consumer.cjs +1 -0
- package/native/themes/neutral-consumer.js +1 -0
- package/native/themes/neutral-enterprise.cjs +1 -0
- package/native/themes/neutral-enterprise.js +1 -0
- package/native/themes/orange-consumer.cjs +1 -0
- package/native/themes/orange-consumer.js +1 -0
- package/native/themes/orange-enterprise.cjs +1 -0
- package/native/themes/orange-enterprise.js +1 -0
- package/native/themes/pink-consumer.cjs +1 -0
- package/native/themes/pink-consumer.js +1 -0
- package/native/themes/pink-enterprise.cjs +1 -0
- package/native/themes/pink-enterprise.js +1 -0
- package/native/themes/teal-consumer.cjs +1 -0
- package/native/themes/teal-consumer.js +1 -0
- package/native/themes/teal-enterprise.cjs +1 -0
- package/native/themes/teal-enterprise.js +1 -0
- package/native/themes/violet-consumer.cjs +1 -0
- package/native/themes/violet-consumer.js +1 -0
- package/native/themes/violet-enterprise.cjs +1 -0
- package/native/themes/violet-enterprise.js +1 -0
- package/package.json +36 -1
- package/types/configs/colors/colors.format.d.ts +1 -1
- package/types/configs/colors/colors.transformers.d.ts +1 -1
- package/types/configs/colors/index.d.ts +3 -3
- package/types/configs/colors/sd.colors.config.d.ts +1 -1
- package/types/configs/components/components.format.css.d.ts +1 -1
- package/types/configs/components/components.transformers.d.ts +1 -1
- package/types/configs/components/index.d.ts +1 -1
- package/types/configs/components/sd.components.config.d.ts +1 -1
- package/types/configs/dimensions/dimension.format.css.d.ts +1 -1
- package/types/configs/dimensions/dimensions.transformers.d.ts +1 -1
- package/types/configs/dimensions/dimensions.utils.d.ts +1 -1
- package/types/configs/dimensions/index.d.ts +3 -3
- package/types/configs/dimensions/sd.dimension.config.d.ts +1 -1
- package/types/configs/expressive/expressive.format.d.ts +1 -1
- package/types/configs/expressive/index.d.ts +2 -2
- package/types/configs/expressive/sd.expressive.config.d.ts +1 -1
- package/types/configs/index.d.ts +1 -1
- package/types/configs/js/index.d.ts +3 -3
- package/types/configs/js/js.formatters.d.ts +1 -1
- package/types/configs/js/js.transformers.d.ts +1 -1
- package/types/configs/js/sd.js.config.d.ts +1 -1
- package/types/configs/language/formatters/css.d.ts +1 -1
- package/types/configs/language/formatters/index.d.ts +1 -1
- package/types/configs/language/index.d.ts +4 -4
- package/types/configs/language/sd.language.config.d.ts +1 -1
- package/types/configs/language/transformers/index.d.ts +1 -1
- package/types/configs/native/index.d.ts +15 -0
- package/types/configs/native/native.color-guard.d.ts +13 -0
- package/types/configs/native/native.dimension.d.ts +13 -0
- package/types/configs/native/native.opacity-guard.d.ts +9 -0
- package/types/configs/native/native.resolvers.d.ts +5 -0
- package/types/configs/native/native.shadow.d.ts +17 -0
- package/types/configs/native/native.source.d.ts +24 -0
- package/types/configs/native/native.transformers.d.ts +3 -0
- package/types/configs/native/native.types-guard.d.ts +1 -0
- package/types/configs/native/native.types.d.ts +28 -0
- package/types/configs/native/native.typography.d.ts +22 -0
- package/types/configs/native/native.utils.d.ts +3 -0
- package/types/configs/native/sd.native.config.d.ts +7 -0
- package/types/configs/product-type/index.d.ts +4 -4
- package/types/configs/product-type/product-type.format.css.d.ts +1 -1
- package/types/configs/product-type/product-type.transformers.d.ts +1 -1
- package/types/configs/product-type/sd.product-tokens.config.d.ts +1 -1
- package/types/configs/shadows/index.d.ts +4 -4
- package/types/configs/shadows/sd.shadow.config.d.ts +1 -1
- package/types/configs/shadows/shadow.transformers.d.ts +1 -1
- package/types/configs/shadows/shadows.format.css.d.ts +1 -1
- package/types/configs/shadows/shadows.utils.d.ts +1 -1
- package/types/configs/storybook/index.d.ts +3 -3
- package/types/configs/storybook/js.formatters.d.ts +1 -1
- package/types/configs/storybook/js.transformers.d.ts +1 -1
- package/types/configs/storybook/sd.storybook.config.d.ts +1 -1
- package/types/configs/themes/generateThemes.d.ts +1 -1
- package/types/configs/themes/index.d.ts +1 -1
- package/types/configs/themes/sd.theme.config.d.ts +1 -1
- package/types/configs/themes/theme.utils.d.ts +5 -5
- package/types/configs/typography/formatters/css.d.ts +1 -1
- package/types/configs/typography/formatters/index.d.ts +1 -1
- package/types/configs/typography/helpers.d.ts +1 -1
- package/types/configs/typography/index.d.ts +4 -4
- package/types/configs/typography/sd.typography.config.d.ts +1 -1
- package/types/configs/typography/transformers/index.d.ts +1 -1
- package/types/lib/index.d.ts +2 -2
- package/types/lib/native/i18n/font-face-names.generated.d.ts +1 -0
- package/types/lib/native/i18n/typography-overlay.d.ts +10 -0
- package/types/lib/native/index.d.ts +1 -0
- package/types/lib/native/themes/blue-consumer.d.ts +3 -0
- package/types/lib/native/themes/blue-enterprise.d.ts +3 -0
- package/types/lib/native/themes/green-consumer.d.ts +3 -0
- package/types/lib/native/themes/green-enterprise.d.ts +3 -0
- package/types/lib/native/themes/neutral-consumer.d.ts +3 -0
- package/types/lib/native/themes/neutral-enterprise.d.ts +3 -0
- package/types/lib/native/themes/orange-consumer.d.ts +3 -0
- package/types/lib/native/themes/orange-enterprise.d.ts +3 -0
- package/types/lib/native/themes/pink-consumer.d.ts +3 -0
- package/types/lib/native/themes/pink-enterprise.d.ts +3 -0
- package/types/lib/native/themes/teal-consumer.d.ts +3 -0
- package/types/lib/native/themes/teal-enterprise.d.ts +3 -0
- package/types/lib/native/themes/violet-consumer.d.ts +3 -0
- package/types/lib/native/themes/violet-enterprise.d.ts +3 -0
- package/types/lib/native/token-tree.generated.d.ts +1723 -0
- package/types/lib/native/types.d.ts +58 -0
- package/types/utils/build-tokens-native.d.ts +1 -0
- package/types/utils/constants/class-names.d.ts +1 -1
- package/types/utils/constants/index.d.ts +7 -7
- package/types/utils/constants/theme.d.ts +20 -0
- package/types/utils/constants/token-types.d.ts +1 -1
- package/types/utils/constants/types.d.ts +4 -9
- package/types/utils/files/cleanup.d.ts +1 -1
- package/types/utils/files/index.d.ts +5 -5
- package/types/utils/files/merge.d.ts +1 -1
- package/types/utils/files/paths.d.ts +1 -1
- package/types/utils/formatters/className.d.ts +1 -1
- package/types/utils/formatters/format.css.d.ts +1 -1
- package/types/utils/formatters/format.scss.d.ts +1 -1
- package/types/utils/formatters/index.d.ts +4 -4
- package/types/utils/index.d.ts +8 -8
- package/types/utils/occurrences.d.ts +1 -1
- package/types/utils/tokens.d.ts +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Accent, BaseColorTheme, BaseShapeTheme } from '../../utils/constants/theme.js';
|
|
2
|
+
import { BeamTokensTree } from './token-tree.generated.js';
|
|
3
|
+
export type { Accent };
|
|
4
|
+
/** Per-locale font-family overlay */
|
|
5
|
+
export type { TypographyOverlay } from './i18n/typography-overlay.js';
|
|
6
|
+
/** Locales the overlay covers */
|
|
7
|
+
export type { SupportedLanguages } from '../../utils/constants/theme.js';
|
|
8
|
+
/** Every accent the token build emits a theme module for. Guarded by the drift spec. */
|
|
9
|
+
export { BASE_ACCENTS as ACCENTS } from '../../utils/constants/theme.js';
|
|
10
|
+
export type Mode = BaseColorTheme;
|
|
11
|
+
export type ProductType = BaseShapeTheme;
|
|
12
|
+
/**
|
|
13
|
+
* The full resolved token tree for one mode — a shape-only interface generated
|
|
14
|
+
* from the default `teal-enterprise` theme (`token-tree.generated.ts`).
|
|
15
|
+
*/
|
|
16
|
+
export type BeamTokens = BeamTokensTree;
|
|
17
|
+
/** The public slice app consumers read */
|
|
18
|
+
export type Tokens = {
|
|
19
|
+
sem: BeamTokens['sem'];
|
|
20
|
+
expressive: BeamTokens['expressive'];
|
|
21
|
+
dataviz: BeamTokens['dataviz'];
|
|
22
|
+
};
|
|
23
|
+
/** The nine expressive micro-theme palettes */
|
|
24
|
+
export type Expressive = BeamTokens['expressive'];
|
|
25
|
+
/** The name of an expressive palette (`accent`, `blue`, …). */
|
|
26
|
+
export type ExpressivePaletteKey = keyof Expressive;
|
|
27
|
+
/** One expressive palette's slots. */
|
|
28
|
+
export type ExpressivePalette = Expressive[ExpressivePaletteKey];
|
|
29
|
+
/**
|
|
30
|
+
* A theme module, typed with the modes it ships.
|
|
31
|
+
* - `TokenThemes<'light' | 'dark'>` ships both modes; `TokenThemes<'light'>` ships light only.
|
|
32
|
+
* - Bare `TokenThemes` means any theme (at least one mode). The provider and `setTheme` take this;
|
|
33
|
+
* use it to store or collect themes: `useState<TokenThemes>(…)`, `Record<string, TokenThemes>`.
|
|
34
|
+
*/
|
|
35
|
+
export type TokenThemes<M extends Mode = never> = {
|
|
36
|
+
accent: Accent;
|
|
37
|
+
productType: ProductType;
|
|
38
|
+
} & ([M] extends [never] ? {
|
|
39
|
+
light: BeamTokens;
|
|
40
|
+
dark?: BeamTokens;
|
|
41
|
+
} | {
|
|
42
|
+
light?: BeamTokens;
|
|
43
|
+
dark: BeamTokens;
|
|
44
|
+
} : {
|
|
45
|
+
[K in M]: BeamTokens;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Identifies the active combo.
|
|
49
|
+
*
|
|
50
|
+
* Mirrors `BeamTheme` in @viasat/beam-shared (src/lib/utils/constants.ts) — see
|
|
51
|
+
* `BASE_ACCENTS` in utils/constants/theme.ts for why these are duplicated rather
|
|
52
|
+
* than imported. Keep in sync.
|
|
53
|
+
*/
|
|
54
|
+
export type BeamTheme = {
|
|
55
|
+
mode: Mode;
|
|
56
|
+
accent: Accent;
|
|
57
|
+
productType: ProductType;
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './class-names';
|
|
2
|
-
export * from './math';
|
|
3
|
-
export * from './paths';
|
|
4
|
-
export * from './token-types';
|
|
5
|
-
export * from './theme';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './typography';
|
|
1
|
+
export * from './class-names.js';
|
|
2
|
+
export * from './math.js';
|
|
3
|
+
export * from './paths.js';
|
|
4
|
+
export * from './token-types.js';
|
|
5
|
+
export * from './theme.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
export * from './typography.js';
|
|
@@ -5,6 +5,7 @@ export declare const BASE_COLOR_THEMES: {
|
|
|
5
5
|
readonly light: "light";
|
|
6
6
|
readonly dark: "dark";
|
|
7
7
|
};
|
|
8
|
+
export type BaseColorTheme = typeof BASE_COLOR_THEMES[keyof typeof BASE_COLOR_THEMES];
|
|
8
9
|
/**
|
|
9
10
|
* Shapes themes we support
|
|
10
11
|
*/
|
|
@@ -12,6 +13,24 @@ export declare const BASE_SHAPE_THEMES: {
|
|
|
12
13
|
readonly consumer: "consumer";
|
|
13
14
|
readonly enterprise: "enterprise";
|
|
14
15
|
};
|
|
16
|
+
export type BaseShapeTheme = typeof BASE_SHAPE_THEMES[keyof typeof BASE_SHAPE_THEMES];
|
|
17
|
+
/**
|
|
18
|
+
* Accents the token build emits a theme for.
|
|
19
|
+
*
|
|
20
|
+
* Mirrors `ACCENT` in @viasat/beam-shared (src/lib/utils/constants.ts).
|
|
21
|
+
* Deliberately duplicated: @viasat/beam-tokens publishes with zero dependencies
|
|
22
|
+
* and shouldn't take one on @viasat/beam-shared for a seven-item list.
|
|
23
|
+
* Keep the two in sync. Drift against the emitted native themes is caught by
|
|
24
|
+
* `native.accents-guard.spec.ts`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const BASE_ACCENTS: readonly ["blue", "green", "neutral", "orange", "pink", "teal", "violet"];
|
|
27
|
+
/** One of the accent families the build emits. */
|
|
28
|
+
export type Accent = typeof BASE_ACCENTS[number];
|
|
29
|
+
/**
|
|
30
|
+
* The base ramp. Has no accent override directory of its own, and its enterprise
|
|
31
|
+
* light tree defines the public `BeamTokens` shape (`token-tree.generated.ts`).
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_ACCENT = "teal";
|
|
15
34
|
/**
|
|
16
35
|
* Language that are supported. Update this list as needed
|
|
17
36
|
*/
|
|
@@ -23,3 +42,4 @@ export declare const SUPPORTED_LANGUAGE_CODES: {
|
|
|
23
42
|
readonly zh: "zh";
|
|
24
43
|
};
|
|
25
44
|
export declare const SUPPORT_LANGUAGES: ("ar" | "he" | "ja" | "th" | "zh")[];
|
|
45
|
+
export type SupportedLanguages = typeof SUPPORTED_LANGUAGE_CODES[keyof typeof SUPPORTED_LANGUAGE_CODES];
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { Config, Format, Named, Platform, Transform, TransformGroup, File, TransformedToken } from 'style-dictionary';
|
|
2
|
-
import { TOKEN_FILE_NAMES } from './paths';
|
|
3
|
-
import { EXPRESSIVE_THEMES, SUPPORTED_TOKEN_TYPES, TOKEN_CATEGORIES } from './token-types';
|
|
4
|
-
import {
|
|
2
|
+
import { TOKEN_FILE_NAMES } from './paths.js';
|
|
3
|
+
import { EXPRESSIVE_THEMES, SUPPORTED_TOKEN_TYPES, TOKEN_CATEGORIES } from './token-types.js';
|
|
4
|
+
import { BaseColorTheme, BaseShapeTheme, SupportedLanguages } from './theme.js';
|
|
5
5
|
export type TOKEN_FILE_NAME_KEYS = keyof typeof TOKEN_FILE_NAMES;
|
|
6
6
|
export type VALID_TOKEN_TYPES = keyof typeof SUPPORTED_TOKEN_TYPES;
|
|
7
7
|
export type TOKEN_CATEGORY = keyof typeof TOKEN_CATEGORIES;
|
|
8
|
-
|
|
9
|
-
* Theming
|
|
10
|
-
*/
|
|
11
|
-
export type BaseColorTheme = typeof BASE_COLOR_THEMES[keyof typeof BASE_COLOR_THEMES];
|
|
12
|
-
export type BaseShapeTheme = typeof BASE_SHAPE_THEMES[keyof typeof BASE_SHAPE_THEMES];
|
|
13
|
-
export type SupportedLanguages = typeof SUPPORTED_LANGUAGE_CODES[keyof typeof SUPPORTED_LANGUAGE_CODES];
|
|
8
|
+
export type { SupportedLanguages };
|
|
14
9
|
export type ComponentTokenPaths = typeof TOKEN_FILE_NAMES[Extract<TOKEN_CATEGORY, 'comp'>];
|
|
15
10
|
export type PrimitiveAndCompTokenCategories = Extract<TOKEN_CATEGORY, 'primitive' | 'comp'>;
|
|
16
11
|
export type TokenOutputPaths = Record<TOKEN_FILE_NAME_KEYS | PrimitiveAndCompTokenCategories | BaseColorTheme, string | ComponentTokenPaths | TOKEN_FILE_NAME_KEYS[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './cleanup';
|
|
2
|
-
export * from './merge';
|
|
3
|
-
export * from './paths';
|
|
4
|
-
export * from './scan';
|
|
5
|
-
export * from './validate';
|
|
1
|
+
export * from './cleanup.js';
|
|
2
|
+
export * from './merge.js';
|
|
3
|
+
export * from './paths.js';
|
|
4
|
+
export * from './scan.js';
|
|
5
|
+
export * from './validate.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuiltInParserName, CustomParser, LiteralUnion } from 'prettier';
|
|
2
|
-
import { BuildConfig, VALID_TOKEN_TYPES } from '../constants/types';
|
|
2
|
+
import { BuildConfig, VALID_TOKEN_TYPES } from '../constants/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Merges multiple files into a single output file
|
|
5
5
|
* @param outputPaths - Array of paths to input files
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from 'style-dictionary';
|
|
2
|
-
import { OutPutFilesPaths, BuildConfig, ThemeConfig, OrganizedThemes } from '../constants/types';
|
|
2
|
+
import { OutPutFilesPaths, BuildConfig, ThemeConfig, OrganizedThemes } from '../constants/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Generates a list of output file paths from Style Dictionary configs
|
|
5
5
|
* @param configs - Array of Style Dictionary configurations
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransformedToken, Dictionary, Options } from 'style-dictionary';
|
|
2
|
-
import { TOKEN_CATEGORIES, TOKEN_CATEGORY } from '../constants';
|
|
2
|
+
import { TOKEN_CATEGORIES, TOKEN_CATEGORY } from '../constants/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Generates CSS variables for a given set of tokens.
|
|
5
5
|
* @param dictionary - The list of transformed tokens.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Format, Named, TransformedToken } from 'style-dictionary';
|
|
2
|
-
import { CssVarsFormatters } from '../constants/types';
|
|
2
|
+
import { CssVarsFormatters } from '../constants/types.js';
|
|
3
3
|
export declare const createScssVariables: ({ dictionary, }: {
|
|
4
4
|
dictionary: TransformedToken[];
|
|
5
5
|
}) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './className';
|
|
2
|
-
export * from './format.css';
|
|
3
|
-
export * from './format.scss';
|
|
4
|
-
export * from './token.utils.css';
|
|
1
|
+
export * from './className.js';
|
|
2
|
+
export * from './format.css.js';
|
|
3
|
+
export * from './format.scss.js';
|
|
4
|
+
export * from './token.utils.css.js';
|
package/types/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './files';
|
|
3
|
-
export * from './formatters';
|
|
4
|
-
export * from './functions';
|
|
5
|
-
export * from './occurrences';
|
|
6
|
-
export * from './tokens';
|
|
7
|
-
export * from './transformers';
|
|
8
|
-
export * from './dataviz';
|
|
1
|
+
export * from './constants/index.js';
|
|
2
|
+
export * from './files/index.js';
|
|
3
|
+
export * from './formatters/index.js';
|
|
4
|
+
export * from './functions.js';
|
|
5
|
+
export * from './occurrences.js';
|
|
6
|
+
export * from './tokens.js';
|
|
7
|
+
export * from './transformers.js';
|
|
8
|
+
export * from './dataviz.js';
|
package/types/utils/tokens.d.ts
CHANGED