@atlaskit/tokens 1.11.3 → 1.13.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/CHANGELOG.md +30 -0
- package/dist/cjs/artifacts/atlassian-dark-token-value-for-contrast-check.js +25 -0
- package/dist/cjs/artifacts/atlassian-light-token-value-for-contrast-check.js +25 -0
- package/dist/cjs/artifacts/generated-pairs.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-dark.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-legacy-dark.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
- package/dist/cjs/artifacts/token-default-values.js +7 -1
- package/dist/cjs/artifacts/token-names.js +7 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/cjs/constants.js +3 -1
- package/dist/cjs/custom-theme.js +108 -0
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/set-global-theme.js +156 -59
- package/dist/cjs/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-light/color/background.js +22 -0
- package/dist/cjs/tokens/default/color/background.js +54 -2
- package/dist/cjs/utils/color-utils.js +178 -0
- package/dist/cjs/utils/custom-theme-loading-utils.js +47 -0
- package/dist/cjs/utils/custom-theme-token-contrast-check.js +74 -0
- package/dist/cjs/utils/generate-custom-color-ramp.js +222 -0
- package/dist/cjs/utils/hash.js +17 -0
- package/dist/cjs/utils/hct-color-utils/color-utils.js +310 -0
- package/dist/cjs/utils/hct-color-utils/contrast.js +188 -0
- package/dist/cjs/utils/hct-color-utils/hct.js +1036 -0
- package/dist/cjs/utils/hct-color-utils/index.js +32 -0
- package/dist/cjs/utils/hct-color-utils/math-utils.js +159 -0
- package/dist/cjs/utils/theme-loading.js +1 -1
- package/dist/cjs/utils/theme-state-transformer.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/atlassian-dark-token-value-for-contrast-check.js +18 -0
- package/dist/es2019/artifacts/atlassian-light-token-value-for-contrast-check.js +18 -0
- package/dist/es2019/artifacts/generated-pairs.js +2 -2
- package/dist/es2019/artifacts/themes/atlassian-dark.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-dark.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-light.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-light.js +7 -1
- package/dist/es2019/artifacts/token-default-values.js +7 -1
- package/dist/es2019/artifacts/token-names.js +7 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/custom-theme.js +77 -0
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/set-global-theme.js +67 -13
- package/dist/es2019/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-light/color/background.js +22 -0
- package/dist/es2019/tokens/default/color/background.js +54 -2
- package/dist/es2019/utils/color-utils.js +154 -0
- package/dist/es2019/utils/custom-theme-loading-utils.js +31 -0
- package/dist/es2019/utils/custom-theme-token-contrast-check.js +68 -0
- package/dist/es2019/utils/generate-custom-color-ramp.js +198 -0
- package/dist/es2019/utils/hash.js +10 -0
- package/dist/es2019/utils/hct-color-utils/color-utils.js +286 -0
- package/dist/es2019/utils/hct-color-utils/contrast.js +161 -0
- package/dist/es2019/utils/hct-color-utils/hct.js +931 -0
- package/dist/es2019/utils/hct-color-utils/index.js +3 -0
- package/dist/es2019/utils/hct-color-utils/math-utils.js +145 -0
- package/dist/es2019/utils/theme-loading.js +2 -2
- package/dist/es2019/utils/theme-state-transformer.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/atlassian-dark-token-value-for-contrast-check.js +18 -0
- package/dist/esm/artifacts/atlassian-light-token-value-for-contrast-check.js +18 -0
- package/dist/esm/artifacts/generated-pairs.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-dark.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-legacy-dark.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
- package/dist/esm/artifacts/token-default-values.js +7 -1
- package/dist/esm/artifacts/token-names.js +7 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/esm/constants.js +1 -0
- package/dist/esm/custom-theme.js +98 -0
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/set-global-theme.js +149 -60
- package/dist/esm/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-light/color/background.js +22 -0
- package/dist/esm/tokens/default/color/background.js +54 -2
- package/dist/esm/utils/color-utils.js +162 -0
- package/dist/esm/utils/custom-theme-loading-utils.js +38 -0
- package/dist/esm/utils/custom-theme-token-contrast-check.js +65 -0
- package/dist/esm/utils/generate-custom-color-ramp.js +211 -0
- package/dist/esm/utils/hash.js +10 -0
- package/dist/esm/utils/hct-color-utils/color-utils.js +285 -0
- package/dist/esm/utils/hct-color-utils/contrast.js +181 -0
- package/dist/esm/utils/hct-color-utils/hct.js +1029 -0
- package/dist/esm/utils/hct-color-utils/index.js +3 -0
- package/dist/esm/utils/hct-color-utils/math-utils.js +145 -0
- package/dist/esm/utils/theme-loading.js +2 -2
- package/dist/esm/utils/theme-state-transformer.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types/artifacts/themes/atlassian-dark.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
- package/dist/types/artifacts/token-default-values.d.ts +7 -1
- package/dist/types/artifacts/token-names.d.ts +13 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/custom-theme.d.ts +30 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/set-global-theme.d.ts +9 -3
- package/dist/types/types.d.ts +10 -0
- package/dist/types/utils/color-utils.d.ts +10 -0
- package/dist/types/utils/custom-theme-loading-utils.d.ts +11 -0
- package/dist/types/utils/custom-theme-token-contrast-check.d.ts +20 -0
- package/dist/types/utils/generate-custom-color-ramp.d.ts +19 -0
- package/dist/types/utils/hash.d.ts +1 -0
- package/dist/types/utils/hct-color-utils/color-utils.d.ts +131 -0
- package/dist/types/utils/hct-color-utils/contrast.d.ts +78 -0
- package/dist/types/utils/hct-color-utils/hct.d.ts +137 -0
- package/dist/types/utils/hct-color-utils/index.d.ts +3 -0
- package/dist/types/utils/hct-color-utils/math-utils.d.ts +86 -0
- package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +7 -1
- package/dist/types-ts4.5/artifacts/token-names.d.ts +13 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/custom-theme.d.ts +30 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/set-global-theme.d.ts +9 -3
- package/dist/types-ts4.5/types.d.ts +10 -0
- package/dist/types-ts4.5/utils/color-utils.d.ts +27 -0
- package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +11 -0
- package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +20 -0
- package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +19 -0
- package/dist/types-ts4.5/utils/hash.d.ts +1 -0
- package/dist/types-ts4.5/utils/hct-color-utils/color-utils.d.ts +131 -0
- package/dist/types-ts4.5/utils/hct-color-utils/contrast.d.ts +78 -0
- package/dist/types-ts4.5/utils/hct-color-utils/hct.d.ts +137 -0
- package/dist/types-ts4.5/utils/hct-color-utils/index.d.ts +3 -0
- package/dist/types-ts4.5/utils/hct-color-utils/math-utils.d.ts +86 -0
- package/figma/atlassian-dark.json +56 -2
- package/figma/atlassian-legacy-dark.json +56 -2
- package/figma/atlassian-legacy-light.json +56 -2
- package/figma/atlassian-light.json +56 -2
- package/package.json +36 -37
- package/report.api.md +48 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -902
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
- package/dist/types/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
- package/tmp/api-report-tmp.d.ts +0 -1132
package/report.api.md
CHANGED
|
@@ -78,6 +78,12 @@ export type ActiveTokens =
|
|
|
78
78
|
| 'color.background.brand.bold'
|
|
79
79
|
| 'color.background.brand.bold.hovered'
|
|
80
80
|
| 'color.background.brand.bold.pressed'
|
|
81
|
+
| 'color.background.brand.boldest'
|
|
82
|
+
| 'color.background.brand.boldest.hovered'
|
|
83
|
+
| 'color.background.brand.boldest.pressed'
|
|
84
|
+
| 'color.background.brand.subtlest'
|
|
85
|
+
| 'color.background.brand.subtlest.hovered'
|
|
86
|
+
| 'color.background.brand.subtlest.pressed'
|
|
81
87
|
| 'color.background.danger'
|
|
82
88
|
| 'color.background.danger.bold'
|
|
83
89
|
| 'color.background.danger.bold.hovered'
|
|
@@ -535,6 +541,9 @@ const baseSpacingTokens: {
|
|
|
535
541
|
};
|
|
536
542
|
};
|
|
537
543
|
|
|
544
|
+
// @public (undocumented)
|
|
545
|
+
type CSSColor = HEX;
|
|
546
|
+
|
|
538
547
|
// @public (undocumented)
|
|
539
548
|
export type CSSToken = CSSTokenMap[keyof CSSTokenMap];
|
|
540
549
|
|
|
@@ -682,9 +691,15 @@ type CSSTokenMap = {
|
|
|
682
691
|
'color.background.selected.bold': 'var(--ds-background-selected-bold)';
|
|
683
692
|
'color.background.selected.bold.hovered': 'var(--ds-background-selected-bold-hovered)';
|
|
684
693
|
'color.background.selected.bold.pressed': 'var(--ds-background-selected-bold-pressed)';
|
|
694
|
+
'color.background.brand.subtlest': 'var(--ds-background-brand-subtlest)';
|
|
695
|
+
'color.background.brand.subtlest.hovered': 'var(--ds-background-brand-subtlest-hovered)';
|
|
696
|
+
'color.background.brand.subtlest.pressed': 'var(--ds-background-brand-subtlest-pressed)';
|
|
685
697
|
'color.background.brand.bold': 'var(--ds-background-brand-bold)';
|
|
686
698
|
'color.background.brand.bold.hovered': 'var(--ds-background-brand-bold-hovered)';
|
|
687
699
|
'color.background.brand.bold.pressed': 'var(--ds-background-brand-bold-pressed)';
|
|
700
|
+
'color.background.brand.boldest': 'var(--ds-background-brand-boldest)';
|
|
701
|
+
'color.background.brand.boldest.hovered': 'var(--ds-background-brand-boldest-hovered)';
|
|
702
|
+
'color.background.brand.boldest.pressed': 'var(--ds-background-brand-boldest-pressed)';
|
|
688
703
|
'color.background.danger': 'var(--ds-background-danger)';
|
|
689
704
|
'color.background.danger.hovered': 'var(--ds-background-danger-hovered)';
|
|
690
705
|
'color.background.danger.pressed': 'var(--ds-background-danger-pressed)';
|
|
@@ -887,6 +902,12 @@ type CSSTokenMap = {
|
|
|
887
902
|
'font.lineHeight.600': 'var(--ds-font-lineHeight-600)';
|
|
888
903
|
};
|
|
889
904
|
|
|
905
|
+
// @public (undocumented)
|
|
906
|
+
export interface CustomBrandSchema {
|
|
907
|
+
// (undocumented)
|
|
908
|
+
brandColor: CSSColor;
|
|
909
|
+
}
|
|
910
|
+
|
|
890
911
|
// @public (undocumented)
|
|
891
912
|
type DataColorModes = Exclude<ThemeColorModes, 'auto'>;
|
|
892
913
|
|
|
@@ -960,6 +981,7 @@ export const getThemeHtmlAttrs: ({
|
|
|
960
981
|
shape,
|
|
961
982
|
spacing,
|
|
962
983
|
typography,
|
|
984
|
+
UNSAFE_themeOptions,
|
|
963
985
|
}?: Partial<ThemeState>) => Record<string, string>;
|
|
964
986
|
|
|
965
987
|
// @public
|
|
@@ -988,6 +1010,9 @@ export type Groups =
|
|
|
988
1010
|
| 'spacing'
|
|
989
1011
|
| 'typography';
|
|
990
1012
|
|
|
1013
|
+
// @public (undocumented)
|
|
1014
|
+
type HEX = `#${string}`;
|
|
1015
|
+
|
|
991
1016
|
// @public
|
|
992
1017
|
type InternalTokenIds =
|
|
993
1018
|
| 'border.radius.050'
|
|
@@ -1043,6 +1068,12 @@ type InternalTokenIds =
|
|
|
1043
1068
|
| 'color.background.brand.bold.[default]'
|
|
1044
1069
|
| 'color.background.brand.bold.hovered'
|
|
1045
1070
|
| 'color.background.brand.bold.pressed'
|
|
1071
|
+
| 'color.background.brand.boldest.[default]'
|
|
1072
|
+
| 'color.background.brand.boldest.hovered'
|
|
1073
|
+
| 'color.background.brand.boldest.pressed'
|
|
1074
|
+
| 'color.background.brand.subtlest.[default]'
|
|
1075
|
+
| 'color.background.brand.subtlest.hovered'
|
|
1076
|
+
| 'color.background.brand.subtlest.pressed'
|
|
1046
1077
|
| 'color.background.danger.[default].[default]'
|
|
1047
1078
|
| 'color.background.danger.[default].hovered'
|
|
1048
1079
|
| 'color.background.danger.[default].pressed'
|
|
@@ -1357,7 +1388,15 @@ type Replacement = InternalTokenIds | InternalTokenIds[];
|
|
|
1357
1388
|
|
|
1358
1389
|
// @public
|
|
1359
1390
|
export const setGlobalTheme: (
|
|
1360
|
-
{
|
|
1391
|
+
{
|
|
1392
|
+
colorMode,
|
|
1393
|
+
dark,
|
|
1394
|
+
light,
|
|
1395
|
+
shape,
|
|
1396
|
+
spacing,
|
|
1397
|
+
typography,
|
|
1398
|
+
UNSAFE_themeOptions,
|
|
1399
|
+
}?: Partial<ThemeState>,
|
|
1361
1400
|
themeLoader?:
|
|
1362
1401
|
| ((id: ThemeIdsWithOverrides) => Promise<void> | void)
|
|
1363
1402
|
| undefined,
|
|
@@ -1511,6 +1550,8 @@ export interface ThemeState {
|
|
|
1511
1550
|
spacing?: Extract<ThemeIds, 'spacing'>;
|
|
1512
1551
|
// (undocumented)
|
|
1513
1552
|
typography?: Extract<ThemeIds, 'typography'>;
|
|
1553
|
+
// (undocumented)
|
|
1554
|
+
UNSAFE_themeOptions?: CustomBrandSchema;
|
|
1514
1555
|
}
|
|
1515
1556
|
|
|
1516
1557
|
// @public
|
|
@@ -1692,9 +1733,15 @@ const tokens: {
|
|
|
1692
1733
|
readonly 'color.background.selected.bold': '--ds-background-selected-bold';
|
|
1693
1734
|
readonly 'color.background.selected.bold.hovered': '--ds-background-selected-bold-hovered';
|
|
1694
1735
|
readonly 'color.background.selected.bold.pressed': '--ds-background-selected-bold-pressed';
|
|
1736
|
+
readonly 'color.background.brand.subtlest': '--ds-background-brand-subtlest';
|
|
1737
|
+
readonly 'color.background.brand.subtlest.hovered': '--ds-background-brand-subtlest-hovered';
|
|
1738
|
+
readonly 'color.background.brand.subtlest.pressed': '--ds-background-brand-subtlest-pressed';
|
|
1695
1739
|
readonly 'color.background.brand.bold': '--ds-background-brand-bold';
|
|
1696
1740
|
readonly 'color.background.brand.bold.hovered': '--ds-background-brand-bold-hovered';
|
|
1697
1741
|
readonly 'color.background.brand.bold.pressed': '--ds-background-brand-bold-pressed';
|
|
1742
|
+
readonly 'color.background.brand.boldest': '--ds-background-brand-boldest';
|
|
1743
|
+
readonly 'color.background.brand.boldest.hovered': '--ds-background-brand-boldest-hovered';
|
|
1744
|
+
readonly 'color.background.brand.boldest.pressed': '--ds-background-brand-boldest-pressed';
|
|
1698
1745
|
readonly 'color.background.danger': '--ds-background-danger';
|
|
1699
1746
|
readonly 'color.background.danger.hovered': '--ds-background-danger-hovered';
|
|
1700
1747
|
readonly 'color.background.danger.pressed': '--ds-background-danger-pressed';
|