@viasat/beam-tokens 2.0.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.
Files changed (134) hide show
  1. package/README.md +275 -0
  2. package/components/Accordion.css +108 -0
  3. package/components/ActionList.css +150 -0
  4. package/components/Alert.css +244 -0
  5. package/components/Avatar.css +124 -0
  6. package/components/Badge.css +542 -0
  7. package/components/BadgeDot.css +150 -0
  8. package/components/BatchActions.css +34 -0
  9. package/components/Breadcrumb.css +44 -0
  10. package/components/Button.css +466 -0
  11. package/components/Card.css +102 -0
  12. package/components/Chip.css +102 -0
  13. package/components/CloseButton.css +42 -0
  14. package/components/DataTable.css +214 -0
  15. package/components/Dialog.css +150 -0
  16. package/components/Divider.css +32 -0
  17. package/components/EmptyState.css +56 -0
  18. package/components/FileUpload.css +204 -0
  19. package/components/Header.css +94 -0
  20. package/components/HelperText.css +100 -0
  21. package/components/Input.css +328 -0
  22. package/components/Label.css +46 -0
  23. package/components/Link.css +102 -0
  24. package/components/List.css +22 -0
  25. package/components/Menu.css +14 -0
  26. package/components/Pagination.css +58 -0
  27. package/components/Panel.css +74 -0
  28. package/components/Popover.css +56 -0
  29. package/components/ProgressBar.css +78 -0
  30. package/components/SegmentedControl.css +56 -0
  31. package/components/SideNav.css +28 -0
  32. package/components/Slider.css +78 -0
  33. package/components/Spinner.css +120 -0
  34. package/components/Stepper.css +248 -0
  35. package/components/Tabs.css +106 -0
  36. package/components/Toast.css +190 -0
  37. package/components/Tooltip.css +70 -0
  38. package/index.cjs +2 -0
  39. package/index.js +2258 -0
  40. package/package.json +63 -0
  41. package/themes/blue.css +32 -0
  42. package/themes/green.css +44 -0
  43. package/themes/neutral.css +32 -0
  44. package/themes/onefi.css +6069 -0
  45. package/themes/orange.css +32 -0
  46. package/themes/pink.css +32 -0
  47. package/themes/violet.css +32 -0
  48. package/tokens.css +3573 -0
  49. package/tokens.scss +3889 -0
  50. package/types/configs/colors/colors.format.d.ts +11 -0
  51. package/types/configs/colors/colors.transformers.d.ts +9 -0
  52. package/types/configs/colors/colors.utils.d.ts +21 -0
  53. package/types/configs/colors/index.d.ts +5 -0
  54. package/types/configs/colors/sd.colors.config.d.ts +7 -0
  55. package/types/configs/components/components.format.css.d.ts +16 -0
  56. package/types/configs/components/components.transformers.d.ts +4 -0
  57. package/types/configs/components/index.d.ts +2 -0
  58. package/types/configs/components/sd.components.config.d.ts +11 -0
  59. package/types/configs/dimensions/dimension.format.css.d.ts +8 -0
  60. package/types/configs/dimensions/dimensions.transformers.d.ts +9 -0
  61. package/types/configs/dimensions/dimensions.utils.d.ts +55 -0
  62. package/types/configs/dimensions/index.d.ts +7 -0
  63. package/types/configs/dimensions/sd.dimension.config.d.ts +15 -0
  64. package/types/configs/expressive/expressive.format.d.ts +11 -0
  65. package/types/configs/expressive/index.d.ts +3 -0
  66. package/types/configs/expressive/sd.expressive.config.d.ts +6 -0
  67. package/types/configs/index.d.ts +7 -0
  68. package/types/configs/js/index.d.ts +4 -0
  69. package/types/configs/js/js.formatters.d.ts +3 -0
  70. package/types/configs/js/js.transformers.d.ts +10 -0
  71. package/types/configs/js/js.utils.d.ts +2 -0
  72. package/types/configs/js/sd.js.config.d.ts +6 -0
  73. package/types/configs/language/formatters/css.d.ts +17 -0
  74. package/types/configs/language/formatters/index.d.ts +3 -0
  75. package/types/configs/language/index.d.ts +6 -0
  76. package/types/configs/language/sd.language.config.d.ts +7 -0
  77. package/types/configs/language/transformers/attribute.d.ts +10 -0
  78. package/types/configs/language/transformers/index.d.ts +5 -0
  79. package/types/configs/product-type/index.d.ts +5 -0
  80. package/types/configs/product-type/product-type.format.css.d.ts +8 -0
  81. package/types/configs/product-type/product-type.transformers.d.ts +2 -0
  82. package/types/configs/product-type/sd.product-tokens.config.d.ts +7 -0
  83. package/types/configs/shadows/index.d.ts +7 -0
  84. package/types/configs/shadows/sd.shadow.config.d.ts +9 -0
  85. package/types/configs/shadows/shadow.transformers.d.ts +7 -0
  86. package/types/configs/shadows/shadows.format.css.d.ts +8 -0
  87. package/types/configs/shadows/shadows.utils.d.ts +11 -0
  88. package/types/configs/storybook/index.d.ts +4 -0
  89. package/types/configs/storybook/js.formatters.d.ts +3 -0
  90. package/types/configs/storybook/js.transformers.d.ts +5 -0
  91. package/types/configs/storybook/js.utils.d.ts +2 -0
  92. package/types/configs/storybook/sd.storybook.config.d.ts +6 -0
  93. package/types/configs/themes/generateThemes.d.ts +2 -0
  94. package/types/configs/themes/index.d.ts +1 -0
  95. package/types/configs/themes/sd.theme.config.d.ts +3 -0
  96. package/types/configs/themes/theme.utils.d.ts +18 -0
  97. package/types/configs/typography/formatters/css.d.ts +20 -0
  98. package/types/configs/typography/formatters/index.d.ts +3 -0
  99. package/types/configs/typography/helpers.d.ts +84 -0
  100. package/types/configs/typography/index.d.ts +6 -0
  101. package/types/configs/typography/sd.typography.config.d.ts +5 -0
  102. package/types/configs/typography/transformers/attribute.d.ts +16 -0
  103. package/types/configs/typography/transformers/index.d.ts +5 -0
  104. package/types/configs/typography/transformers/value.d.ts +4 -0
  105. package/types/lib/index.d.ts +8 -0
  106. package/types/lib/js/tokens.d.ts +1462 -0
  107. package/types/lib/js/tokensObj.d.ts +15888 -0
  108. package/types/lib/storybook-token-table/tokens.d.ts +9980 -0
  109. package/types/utils/build-tokens.d.ts +1 -0
  110. package/types/utils/constants/class-names.d.ts +19 -0
  111. package/types/utils/constants/index.d.ts +7 -0
  112. package/types/utils/constants/math.d.ts +1 -0
  113. package/types/utils/constants/paths.d.ts +27 -0
  114. package/types/utils/constants/theme.d.ts +24 -0
  115. package/types/utils/constants/token-types.d.ts +48 -0
  116. package/types/utils/constants/types.d.ts +114 -0
  117. package/types/utils/constants/typography.d.ts +39 -0
  118. package/types/utils/dataviz.d.ts +68 -0
  119. package/types/utils/files/cleanup.d.ts +11 -0
  120. package/types/utils/files/index.d.ts +5 -0
  121. package/types/utils/files/merge.d.ts +20 -0
  122. package/types/utils/files/paths.d.ts +25 -0
  123. package/types/utils/files/scan.d.ts +38 -0
  124. package/types/utils/files/validate.d.ts +13 -0
  125. package/types/utils/formatters/className.d.ts +13 -0
  126. package/types/utils/formatters/format.css.d.ts +19 -0
  127. package/types/utils/formatters/format.scss.d.ts +12 -0
  128. package/types/utils/formatters/index.d.ts +4 -0
  129. package/types/utils/formatters/token.utils.css.d.ts +50 -0
  130. package/types/utils/functions.d.ts +13 -0
  131. package/types/utils/index.d.ts +8 -0
  132. package/types/utils/occurrences.d.ts +32 -0
  133. package/types/utils/tokens.d.ts +34 -0
  134. package/types/utils/transformers.d.ts +11 -0
@@ -0,0 +1,11 @@
1
+ import { Named, Format } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../utils';
3
+ /**
4
+ * Formatter to generate CSS variables for color tokens.
5
+ */
6
+ export declare const colorCssVarsFormatter: Named<Format>;
7
+ /**
8
+ * All formatters for color tokens.
9
+ */
10
+ export declare const colorFormatters: CssVarsFormatters;
11
+ export default colorFormatters;
@@ -0,0 +1,9 @@
1
+ import { Named, Transform, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../utils';
3
+ /**
4
+ * Adds CSS names to color and opacity tokens.
5
+ */
6
+ export declare const colorTokenCssName: Named<Transform>;
7
+ export declare const colorsTransformGroup: Named<TransformGroup>;
8
+ export declare const colorTransformers: TokenTransformers;
9
+ export default colorTransformers;
@@ -0,0 +1,21 @@
1
+ import { TransformedToken } from 'style-dictionary';
2
+ /**
3
+ * Checks if the given token is a color token.
4
+ */
5
+ export declare const isColorToken: (token: TransformedToken) => boolean;
6
+ /**
7
+ * Checks if the given token represents a gradient.
8
+ */
9
+ export declare const isGradient: (token: TransformedToken) => boolean;
10
+ /**
11
+ * Converts hex color to RGBA format.
12
+ */
13
+ export declare const hexToRgba: (value: string, wrap?: boolean) => string;
14
+ /**
15
+ * Transforms tokens to RGBA format.
16
+ */
17
+ export declare const transformToRGBA: (token: TransformedToken) => string;
18
+ /**
19
+ * Parses gradient token values.
20
+ */
21
+ export declare const parseGradientTokenValue: (token: TransformedToken) => string;
@@ -0,0 +1,5 @@
1
+ import { BuildConfig, ThemeConfig } from '../../utils';
2
+ export * from './sd.colors.config';
3
+ export * from './colors.transformers';
4
+ export declare const colorBuildConfig: BuildConfig;
5
+ export declare const colorThemeConfig: (theme: ThemeConfig) => BuildConfig;
@@ -0,0 +1,7 @@
1
+ import { Config, TransformedToken } from 'style-dictionary';
2
+ import { OutPutFilesPaths, CommonConfig } from '../../utils';
3
+ export declare const COMMON_CONFIG: CommonConfig;
4
+ export declare const tokenFilter: (token: TransformedToken) => boolean;
5
+ declare const ViasatConfig: Config[];
6
+ export declare const colorOutputPaths: OutPutFilesPaths;
7
+ export default ViasatConfig;
@@ -0,0 +1,16 @@
1
+ import { Named, Format } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../utils';
3
+ /**
4
+ * Generates component prefix
5
+ */
6
+ export declare const generateComponentPrefix: (componentName: string) => string;
7
+ /**
8
+ * Formatter to generate CSS variables for a specific component's tokens.
9
+ * This is called separately for light and dark themes to create theme-specific CSS output.
10
+ */
11
+ export declare const componentCssVarsFormatter: Named<Format>;
12
+ /**
13
+ * All formatters for component tokens.
14
+ */
15
+ export declare const componentFormatters: CssVarsFormatters;
16
+ export default componentFormatters;
@@ -0,0 +1,4 @@
1
+ import { Named, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../utils';
3
+ export declare const componentsTransformGroup: Named<TransformGroup>;
4
+ export declare const componentTransformers: TokenTransformers;
@@ -0,0 +1,2 @@
1
+ import { BuildConfig } from '../../utils';
2
+ export declare const componentsBuildConfig: BuildConfig;
@@ -0,0 +1,11 @@
1
+ import { Config, TransformedToken } from 'style-dictionary';
2
+ import { OutPutFilesPaths, CommonConfig } from '../../utils';
3
+ export declare const COMMON_CONFIG: CommonConfig;
4
+ /**
5
+ * Filters tokens to only include component tokens (bm.comp.*)
6
+ * This excludes utility-comp tokens (bm.utility.comp.*) which should stay in tokens.css
7
+ */
8
+ export declare const tokenFilter: (token: TransformedToken) => boolean;
9
+ declare const ComponentsConfig: Config[];
10
+ export declare const componentOutputPaths: OutPutFilesPaths;
11
+ export default ComponentsConfig;
@@ -0,0 +1,8 @@
1
+ import { Named, Format } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../utils';
3
+ /**
4
+ * Formatter to generate CSS variables for dimension tokens.
5
+ */
6
+ export declare const dimensionCssVarsFormatter: Named<Format>;
7
+ declare const dimensionCssVarsFormatters: CssVarsFormatters;
8
+ export default dimensionCssVarsFormatters;
@@ -0,0 +1,9 @@
1
+ import { Named, Transform, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../utils';
3
+ /** Transforms */
4
+ export declare const parseRawRemTokenValue: Named<Transform>;
5
+ export declare const parseSemTokenValue: Named<Transform>;
6
+ export declare const parseCompTokenValue: Named<Transform>;
7
+ export declare const dimensionTransformGroup: Named<TransformGroup>;
8
+ export declare const dimensionTransformers: TokenTransformers;
9
+ export default dimensionTransformers;
@@ -0,0 +1,55 @@
1
+ import { TOKEN_CATEGORY, OccurrenceCounts } from '../../utils';
2
+ import { TransformedToken } from 'style-dictionary';
3
+ /**
4
+ * Checks if the token is a dimension token.
5
+ */
6
+ export declare const isDimensionToken: (token: TransformedToken, category?: TOKEN_CATEGORY) => boolean;
7
+ /**
8
+ * Checks if the token is a dimension utility.
9
+ */
10
+ export declare const isDimensionUtility: (token: TransformedToken) => boolean;
11
+ /**
12
+ * Converts a mathematical equation to CSS variable format.
13
+ */
14
+ export declare const convertMathEquationToCssVarFormat: (token: TransformedToken) => string;
15
+ /**
16
+ * Checks if the value contains a mathematical symbol.
17
+ */
18
+ export declare const containsMathSymbol: (value: string) => boolean;
19
+ /**
20
+ * Checks if the value contains a token reference.
21
+ */
22
+ export declare const containsTokenReference: (value: string) => boolean;
23
+ /**
24
+ * Determines the token base based on its reference.
25
+ */
26
+ export declare const getTokenBase: (value: string) => string;
27
+ /**
28
+ * Converts a token reference to CSS variable format.
29
+ */
30
+ export declare const convertTokenReferenceToCssVar: (value: string) => string;
31
+ /**
32
+ * Checks if the occurrences represent a single occurrence.
33
+ */
34
+ export declare const isSingleOccurrence: (occurrences: OccurrenceCounts) => boolean;
35
+ /**
36
+ * Checks if the occurrences represent multiple occurrences.
37
+ */
38
+ export declare const isMultipleOccurrence: (occurrences: OccurrenceCounts) => boolean;
39
+ /**
40
+ * Converts a single token to CSS variable format.
41
+ */
42
+ export declare const convertSingleTokenToCssVar: (tokenValue: string, fallback: string) => string;
43
+ /**
44
+ * Converts multiple tokens to CSS variable format.
45
+ */
46
+ export declare const convertMultipleTokensToCssVar: (token: TransformedToken) => string;
47
+ /**
48
+ * Converts a joint token name into an array of formatted CSS variable names.
49
+ *
50
+ * @param token - The token containing the joint value.
51
+ * @param delimiter - The delimiter used to split the token name (default: '.').
52
+ * @param useCssVarWrapper - Whether to wrap the formatted names in `var(--tokenName)`.
53
+ * @returns An array of formatted CSS variable names.
54
+ */
55
+ export declare const convertJointTokenNameToCssVarFormat: (token: TransformedToken, delimiter?: string, useCssVarWrapper?: boolean) => string[];
@@ -0,0 +1,7 @@
1
+ import { BuildConfig, CssVarsFormatters, ThemeConfig } from '../../utils';
2
+ export * from './sd.dimension.config';
3
+ export * from './dimensions.transformers';
4
+ export declare const dimensionFormatters: CssVarsFormatters;
5
+ export default dimensionFormatters;
6
+ export declare const dimensionBuildConfig: BuildConfig;
7
+ export declare const dimensionThemeConfig: (theme: ThemeConfig) => BuildConfig;
@@ -0,0 +1,15 @@
1
+ import { Config, TransformedToken } from 'style-dictionary';
2
+ import { OutPutFilesPaths, CommonConfig } from '../../utils';
3
+ export declare const COMMON_CONFIG: CommonConfig;
4
+ /**
5
+ * Token filter to identify valid dimension tokens.
6
+ * Excludes font-size and utility tokens at the product type level.
7
+ */
8
+ export declare const tokenFilter: (token: TransformedToken) => boolean;
9
+ /** Dimension Style Dictionary Configuration */
10
+ export declare const dimensionStyleDictConfig: Config;
11
+ /** Generate all configurations including theme-specific configs */
12
+ declare const allConfigs: Config[];
13
+ /** Output paths for CSS and SCSS files */
14
+ export declare const dimensionOutputPaths: OutPutFilesPaths;
15
+ export default allConfigs;
@@ -0,0 +1,11 @@
1
+ import { Named, Format } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../utils';
3
+ /**
4
+ * Formatter to generate CSS variables for color tokens.
5
+ */
6
+ export declare const expressiveColorFormatter: Named<Format>;
7
+ /**
8
+ * All formatters for color tokens.
9
+ */
10
+ export declare const expressiveFormatters: CssVarsFormatters;
11
+ export default expressiveFormatters;
@@ -0,0 +1,3 @@
1
+ import { BuildConfig } from '../../utils';
2
+ export * from './sd.expressive.config';
3
+ export declare const expressiveColorBuildConfig: BuildConfig;
@@ -0,0 +1,6 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { OutPutFilesPaths, CommonConfig } from '../../utils';
3
+ export declare const COMMON_CONFIG: CommonConfig;
4
+ declare const ExpressiveConfigs: Config[];
5
+ export declare const expressiveColorOutputPaths: OutPutFilesPaths;
6
+ export default ExpressiveConfigs;
@@ -0,0 +1,7 @@
1
+ import { BuildConfig, ThemeConfig } from '../utils';
2
+ /**
3
+ * Type guard to check if a value is a BuildConfig.
4
+ */
5
+ export declare const isBuildConfig: (value: unknown) => value is BuildConfig;
6
+ export declare const AllThemes: ThemeConfig[];
7
+ export default AllThemes;
@@ -0,0 +1,4 @@
1
+ import { BuildConfig } from '../../utils';
2
+ export * from './sd.js.config';
3
+ export * from './js.transformers';
4
+ export declare const jsBuildConfig: BuildConfig;
@@ -0,0 +1,3 @@
1
+ import { CssVarsFormatters } from '../../utils';
2
+ export declare const jsFormatters: CssVarsFormatters;
3
+ export default jsFormatters;
@@ -0,0 +1,10 @@
1
+ import { Named, TransformGroup, Transform } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../utils';
3
+ export declare const colorsCssProperty: Named<Transform>;
4
+ export declare const dimensionsCssProperty: Named<Transform>;
5
+ export declare const shadowsCssProperty: Named<Transform>;
6
+ export declare const removeAttributes: Named<Transform>;
7
+ export declare const tokenCssNameAsValue: Named<Transform>;
8
+ export declare const jsTransformGroup: Named<TransformGroup>;
9
+ export declare const jsTransformers: TokenTransformers;
10
+ export default jsTransformers;
@@ -0,0 +1,2 @@
1
+ import { TransformedToken } from 'style-dictionary';
2
+ export declare const tokenCssProperty: (token: TransformedToken, attribute: string) => boolean;
@@ -0,0 +1,6 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { OutPutFilesPaths } from '../../utils';
3
+ export declare const jsStyleDictConfig: Config;
4
+ export declare const allConfigs: Config[];
5
+ export declare const jsOutputPaths: OutPutFilesPaths;
6
+ export default allConfigs;
@@ -0,0 +1,17 @@
1
+ import { Named, Format, TransformedToken } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../../utils';
3
+ type TypoTokenFormatterHelper = (params: {
4
+ dictionary: TransformedToken[];
5
+ }) => string;
6
+ export declare const createCssAttributeVars: TypoTokenFormatterHelper;
7
+ /**
8
+ * This formatter is used to generate css variables for colors
9
+ * @param {StyleDictionary.Dictionary} dictionary - The style dictionary dictionary object
10
+ * @param {StyleDictionary.Options} options - optional formatter options
11
+ * @param {ClassName} options.className - the class name to use for the css variables
12
+ * @param {SupportedLanguages} options.languages - The languages to generate css for
13
+ * @param {boolean} options.disableComponent - disable component tokens
14
+ **/
15
+ export declare const typographyLanguageFormatter: Named<Format>;
16
+ declare const typographyLanguageFormatters: CssVarsFormatters;
17
+ export default typographyLanguageFormatters;
@@ -0,0 +1,3 @@
1
+ import { CssVarsFormatters } from '../../../utils';
2
+ export declare const typographyFormatters: CssVarsFormatters;
3
+ export default typographyFormatters;
@@ -0,0 +1,6 @@
1
+ import { BuildConfig, SupportedLanguages, ThemeConfig } from '../../utils';
2
+ export * from './formatters';
3
+ export * from './sd.language.config';
4
+ export * from './transformers';
5
+ export declare const languageBuildConfig: BuildConfig;
6
+ export declare const languageThemeConfig: (theme: ThemeConfig, languages: SupportedLanguages[]) => BuildConfig;
@@ -0,0 +1,7 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { OutPutFilesPaths, CommonConfig } from '../../utils';
3
+ export declare const tokenFilter: (token: import('style-dictionary').TransformedToken) => boolean;
4
+ export declare const COMMON_CONFIG: CommonConfig;
5
+ declare const allConfigs: Config[];
6
+ export declare const languageOutputPaths: OutPutFilesPaths;
7
+ export default allConfigs;
@@ -0,0 +1,10 @@
1
+ import { Named, Transform } from 'style-dictionary';
2
+ export declare const languageTokenCssName: Named<Transform>;
3
+ /**
4
+ * This transformer is used to add clamp attributes to responsive headings
5
+ * so that they can be used in the css output
6
+ * @todo Move this logic to the scaling of the theme files phase of the code?
7
+ * - What about the viasat theme where we don't scan and we jsut build directly.
8
+ * - I guess no need since we control the configs by hand
9
+ */
10
+ export declare const languageAttributes: Named<Transform>;
@@ -0,0 +1,5 @@
1
+ import { Named, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../../utils';
3
+ export declare const languageTransformGroup: Named<TransformGroup>;
4
+ export declare const languageTransformers: TokenTransformers;
5
+ export default languageTransformers;
@@ -0,0 +1,5 @@
1
+ import { BuildConfig } from '../../utils';
2
+ export * from './product-type.format.css';
3
+ export * from './sd.product-tokens.config';
4
+ export * from './product-type.transformers';
5
+ export declare const productTypeBuildConfig: BuildConfig;
@@ -0,0 +1,8 @@
1
+ import { Named, Format } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../utils';
3
+ /**
4
+ * Formatter to generate CSS variables for product type themes.
5
+ **/
6
+ export declare const dimensionCssVarsFormatter: Named<Format>;
7
+ export declare const productTypeFormatters: CssVarsFormatters;
8
+ export default productTypeFormatters;
@@ -0,0 +1,2 @@
1
+ export declare const productTypeTransformers: import('../../utils').TokenTransformers;
2
+ export default productTypeTransformers;
@@ -0,0 +1,7 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { OutPutFilesPaths } from '../../utils';
3
+ export declare const enterpriseStyleDictConfig: Config;
4
+ export declare const consumerStyleDictConfig: Config;
5
+ declare const allConfigs: Config[];
6
+ export declare const productTypeOutputPaths: OutPutFilesPaths;
7
+ export default allConfigs;
@@ -0,0 +1,7 @@
1
+ import { BuildConfig, CssVarsFormatters, ThemeConfig } from '../../utils';
2
+ export * from './sd.shadow.config';
3
+ export * from './shadows.format.css';
4
+ export * from './shadow.transformers';
5
+ export declare const shadowFormatters: CssVarsFormatters;
6
+ export declare const shadowBuildConfig: BuildConfig;
7
+ export declare const ShadowThemeConfig: (theme: ThemeConfig) => BuildConfig;
@@ -0,0 +1,9 @@
1
+ import { Config, TransformedToken } from 'style-dictionary';
2
+ import { OutPutFilesPaths, CommonConfig } from '../../utils';
3
+ export declare const COMMON_CONFIG: CommonConfig;
4
+ export declare const tokenFilter: (token: TransformedToken, darkMode?: boolean) => boolean;
5
+ export declare const shadowStyleDictConfig: Config;
6
+ export declare const darkShadowStyleDictConfig: Config;
7
+ declare const ViasatConfig: Config[];
8
+ export declare const shadowOutputPaths: OutPutFilesPaths;
9
+ export default ViasatConfig;
@@ -0,0 +1,7 @@
1
+ import { Named, Transform, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../utils';
3
+ export declare const parseGblTokenValue: Named<Transform>;
4
+ export declare const parseSemTokenValue: Named<Transform>;
5
+ export declare const dimensionTransformGroup: Named<TransformGroup>;
6
+ export declare const shadowTransformers: TokenTransformers;
7
+ export default shadowTransformers;
@@ -0,0 +1,8 @@
1
+ import { Format, Named } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../utils';
3
+ /**
4
+ * Formatter to generate CSS variables for shadow tokens.
5
+ **/
6
+ export declare const shadowCssVarsFormatter: Named<Format>;
7
+ declare const shadowCssVarsFormatters: CssVarsFormatters;
8
+ export default shadowCssVarsFormatters;
@@ -0,0 +1,11 @@
1
+ import { TransformedToken } from 'style-dictionary';
2
+ import { TOKEN_CATEGORY } from '../../utils';
3
+ export declare const isShadowToken: (token: TransformedToken, category: TOKEN_CATEGORY) => boolean;
4
+ export declare const parseShadowTokenValue: (token: TransformedToken) => {
5
+ bmValue: string;
6
+ category?: string;
7
+ type?: string;
8
+ item?: string;
9
+ subitem?: string;
10
+ state?: string;
11
+ };
@@ -0,0 +1,4 @@
1
+ import { BuildConfig } from '../../utils';
2
+ export * from './sd.storybook.config';
3
+ export * from './js.transformers';
4
+ export declare const storybookBuildConfig: BuildConfig;
@@ -0,0 +1,3 @@
1
+ import { CssVarsFormatters } from '../../utils';
2
+ export declare const storyBookFormatters: CssVarsFormatters;
3
+ export default storyBookFormatters;
@@ -0,0 +1,5 @@
1
+ import { Named, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../utils';
3
+ export declare const storybookTransformGroup: Named<TransformGroup>;
4
+ export declare const storybookTransformers: TokenTransformers;
5
+ export default storybookTransformers;
@@ -0,0 +1,2 @@
1
+ import { TransformedToken } from 'style-dictionary';
2
+ export declare const tokenCssProperty: (token: TransformedToken, attribute: string) => boolean;
@@ -0,0 +1,6 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { OutPutFilesPaths } from '../../utils';
3
+ export declare const storybookStyleDictConfig: Config;
4
+ export declare const allConfigs: Config[];
5
+ export declare const storybookOutputPaths: OutPutFilesPaths;
6
+ export default allConfigs;
@@ -0,0 +1,2 @@
1
+ import { ThemeConfig } from '../../utils';
2
+ export declare const generateThemes: () => ThemeConfig[];
@@ -0,0 +1 @@
1
+ export * from './generateThemes';
@@ -0,0 +1,3 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { ThemeConfigurationGenerator } from '../../utils';
3
+ export declare const createThemeConfigs: ({ theme, commonConfig, tokenFilter, languages, }: ThemeConfigurationGenerator) => Config[];
@@ -0,0 +1,18 @@
1
+ import { TokenOutputPaths, ThemeConfig } from '../../utils/constants';
2
+ /**
3
+ * Checks if a theme contains a given token type.
4
+ * @param themeRootPath - The root path of the theme.
5
+ * @param tokenType - The type of token to check.
6
+ * @param tokenSearchString - An optional search string to refine the check.
7
+ * @returns True if the theme contains the token type.
8
+ */
9
+ export declare const doesThemeHaveToken: ({ themeRootPath, tokenType, tokenSearchString, }: {
10
+ themeRootPath: string;
11
+ tokenType: keyof TokenOutputPaths;
12
+ tokenSearchString?: string | string[];
13
+ }) => boolean;
14
+ export declare const hasDarkTheme: (themeRootPath: string) => false | "dark";
15
+ export declare const hasDimensionTokens: (themeRootPath: string, theme: ThemeConfig) => false | import('../../utils/constants').BuildConfig;
16
+ export declare const hasShadowTokens: (themeRootPath: string, theme: ThemeConfig) => false | import('../../utils/constants').BuildConfig;
17
+ export declare const hasTypographyTokens: (themeRootPath: string, theme: ThemeConfig) => false | import('../../utils/constants').BuildConfig;
18
+ export declare const hasLanguageTokens: (themeRootPath: string, theme: ThemeConfig) => false | import('../../utils/constants').BuildConfig;
@@ -0,0 +1,20 @@
1
+ import { Named, Format, TransformedToken } from 'style-dictionary';
2
+ import { CssVarsFormatters } from '../../../utils';
3
+ type TypoTokenFormatterHelper = (params: {
4
+ dictionary: TransformedToken[];
5
+ }) => string;
6
+ export declare const createResponsiveHeadingClampCssVars: TypoTokenFormatterHelper;
7
+ export declare const createTypographyFontClass: TypoTokenFormatterHelper;
8
+ export declare const createTypographyFontShortHandCssVar: TypoTokenFormatterHelper;
9
+ /**
10
+ * This formatter is used to generate css variables for colors
11
+ * @param {StyleDictionary.Dictionary} dictionary - The style dictionary dictionary object
12
+ * @param {StyleDictionary.Options} options - optional formatter options
13
+ * @param {ClassName} options.className - the class name to use for the css variables
14
+ * @param {boolean} options.includeRoot - include the :root selector in the output file
15
+ * @param {boolean} options.generateFontCss - generate css classes for typography fonts instead, for the purpose of importing into scss files
16
+ * @param {boolean} options.disableComponent - disable component tokens
17
+ **/
18
+ export declare const typographyCssVarsFormatter: Named<Format>;
19
+ declare const typographyCssVarsFormatters: CssVarsFormatters;
20
+ export default typographyCssVarsFormatters;
@@ -0,0 +1,3 @@
1
+ import { CssVarsFormatters } from '../../../utils';
2
+ export declare const typographyFormatters: CssVarsFormatters;
3
+ export default typographyFormatters;
@@ -0,0 +1,84 @@
1
+ import { TransformedToken } from 'style-dictionary';
2
+ import { CommonConfig } from '../../utils';
3
+ export declare const COMMON_CONFIG: CommonConfig;
4
+ /**
5
+ * These tokens are a special case that Figma and Token Studio do not support
6
+ * so we have to manually create them and their mappings
7
+ */
8
+ export declare const responsiveHeadings: readonly ["6xl", "5xl", "4xl", "3xl", "2xl"];
9
+ export type ResponsiveHeadings = typeof responsiveHeadings[number];
10
+ export declare const responsiveHeadingsNoDots: string[];
11
+ /**
12
+ * Default filter for typography tokens
13
+ *
14
+ * @param {TransformedToken} token
15
+ * @returns {boolean} true if token is a typography token
16
+ */
17
+ export declare const filter: (token: TransformedToken) => boolean;
18
+ /**
19
+ * Function that filters out the heading tokens that don't have `code` in the token name
20
+ * those tokens are just used for figma and not for code!
21
+ *
22
+ * @param {TransformedToken} token
23
+ * @returns {boolean} true if token is a typography token
24
+ */
25
+ export declare const isNonCodeHeading: (token: TransformedToken) => boolean;
26
+ /**
27
+ *
28
+ * Checks weather the original token JSON is a typography token.
29
+ * This is a useful function to filter out the typography tokens
30
+ *
31
+ * @param {TransformedToken} token
32
+ * @returns {boolean} true if token is a typography token
33
+ */
34
+ export declare const isTypographyTokenType: (token: TransformedToken) => boolean;
35
+ /**
36
+ *
37
+ * These are all the Typography tokens that are not responsive headings
38
+ * or css properties
39
+ *
40
+ * @param {TransformedToken} token
41
+ * @returns {boolean} true if token is a typography token
42
+ */
43
+ export declare const isTypographyToken: (token: TransformedToken) => boolean;
44
+ /**
45
+ *
46
+ * Checks weather a token is a responsive heading token
47
+ *
48
+ * @param {TransformedToken} token
49
+ * @returns {boolean} true if token is a typography token
50
+ */
51
+ export declare const isResponsiveHeading: (token: TransformedToken) => boolean;
52
+ /**
53
+ *
54
+ * Checks weather a token is a typography css properties token such as
55
+ * fontFamilies, fontWeights, etc.
56
+ *
57
+ * @param {TransformedToken} token
58
+ * @returns {boolean} true if token is a typography token
59
+ */
60
+ export declare const isTypographyCssProperties: (token: TransformedToken) => boolean;
61
+ /**
62
+ *
63
+ * Checks weather a token is a paragraph indent token, these are special tokens
64
+ *
65
+ * @param {TransformedToken} token
66
+ * @returns {boolean} true if token is a typography token
67
+ */
68
+ export declare const isParagraphIndentToken: (token: TransformedToken) => boolean;
69
+ /**
70
+ *
71
+ * Checks weather a tokens has an original type of fontFamilies
72
+ *
73
+ * @param {TransformedToken} token
74
+ * @returns {boolean} true if token is a typography token
75
+ */
76
+ export declare const isFontFamiliesToken: (token: TransformedToken) => boolean;
77
+ /**
78
+ *
79
+ * Checks weather a tokens has an original type of fontWeights
80
+ *
81
+ * @param {TransformedToken} token
82
+ * @returns {boolean} true if token is a typography token
83
+ */
84
+ export declare const isFontWeightsToken: (token: TransformedToken) => boolean;
@@ -0,0 +1,6 @@
1
+ import { BuildConfig, ThemeConfig } from '../../utils';
2
+ export * from './formatters';
3
+ export * from './sd.typography.config';
4
+ export * from './transformers';
5
+ export declare const typographyBuildConfig: BuildConfig;
6
+ export declare const typographyThemeConfig: (theme: ThemeConfig) => BuildConfig;
@@ -0,0 +1,5 @@
1
+ import { Config } from 'style-dictionary';
2
+ import { OutPutFilesPaths } from '../../utils';
3
+ declare const allConfigs: Config[];
4
+ export declare const typographyOutputPaths: OutPutFilesPaths;
5
+ export default allConfigs;
@@ -0,0 +1,16 @@
1
+ import { Named, Transform } from 'style-dictionary';
2
+ export declare const typographyTokenCssName: Named<Transform>;
3
+ type ClampAttribute = 'min' | 'max' | 'value';
4
+ export type ClampAttributesObj = Record<ClampAttribute, string>;
5
+ export type ClampCssVarsAttributes = {
6
+ name: string;
7
+ min: Record<string, string>;
8
+ max: Record<string, string>;
9
+ value: Record<string, string>;
10
+ };
11
+ /**
12
+ * This transformer is used to add clamp attributes to responsive headings
13
+ * so that they can be used in the css output
14
+ */
15
+ export declare const responsiveHeadingsClampAttributes: Named<Transform>;
16
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Named, TransformGroup } from 'style-dictionary';
2
+ import { TokenTransformers } from '../../../utils';
3
+ export declare const typographyTransformGroup: Named<TransformGroup>;
4
+ export declare const typographyTransformers: TokenTransformers;
5
+ export default typographyTransformers;