@atlaskit/tokens 1.4.1 → 1.4.2
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 +6 -0
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +15 -0
- package/dist/types-ts4.5/artifacts/palettes-raw/legacy-palette.d.ts +41 -0
- package/dist/types-ts4.5/artifacts/palettes-raw/palette.d.ts +41 -0
- package/dist/types-ts4.5/artifacts/palettes-raw/shape-palette.d.ts +22 -0
- package/dist/types-ts4.5/artifacts/palettes-raw/spacing-scale.d.ts +41 -0
- package/dist/types-ts4.5/artifacts/palettes-raw/typography-palette.d.ts +22 -0
- package/dist/types-ts4.5/artifacts/replacement-mapping.d.ts +26 -0
- package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +16 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark-iteration.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark-new-input-border.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-dark.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-light-new-input-border.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-shape.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-spacing.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/themes/atlassian-typography.d.ts +7 -0
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +341 -0
- package/dist/types-ts4.5/artifacts/token-names.d.ts +669 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +113 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +113 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +89 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +89 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-shape.d.ts +29 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-spacing.d.ts +59 -0
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography.d.ts +29 -0
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +6 -0
- package/dist/types-ts4.5/artifacts/types.d.ts +6 -0
- package/dist/types-ts4.5/artifacts/typescript/atlassian-dark-token-names.d.ts +784 -0
- package/dist/types-ts4.5/artifacts/typescript/atlassian-dark-types-internal.d.ts +6 -0
- package/dist/types-ts4.5/artifacts/typescript/atlassian-dark-types.d.ts +6 -0
- package/dist/types-ts4.5/artifacts/typescript/atlassian-light-token-names.d.ts +784 -0
- package/dist/types-ts4.5/artifacts/typescript/atlassian-light-types-internal.d.ts +6 -0
- package/dist/types-ts4.5/artifacts/typescript/atlassian-light-types.d.ts +6 -0
- package/dist/types-ts4.5/babel-plugin/index.d.ts +1 -0
- package/dist/types-ts4.5/babel-plugin/plugin.d.ts +14 -0
- package/dist/types-ts4.5/constants.d.ts +6 -0
- package/dist/types-ts4.5/entry-points/babel-plugin.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/palettes-raw.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/rename-mapping.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/token-ids.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/token-names.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/token-order.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/tokens-raw.d.ts +5 -0
- package/dist/types-ts4.5/get-global-theme.d.ts +2 -0
- package/dist/types-ts4.5/get-token-value.d.ts +25 -0
- package/dist/types-ts4.5/get-token.d.ts +26 -0
- package/dist/types-ts4.5/index.d.ts +13 -0
- package/dist/types-ts4.5/palettes/legacy-palette.d.ts +10 -0
- package/dist/types-ts4.5/palettes/palette.d.ts +5 -0
- package/dist/types-ts4.5/palettes/shape-palette.d.ts +67 -0
- package/dist/types-ts4.5/palettes/spacing-scale.d.ts +95 -0
- package/dist/types-ts4.5/palettes/typography-palette.d.ts +14 -0
- package/dist/types-ts4.5/set-global-theme.d.ts +74 -0
- package/dist/types-ts4.5/theme-config.d.ts +110 -0
- package/dist/types-ts4.5/theme-mutation-observer.d.ts +22 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/chart.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/interaction.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/skeleton.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/color/text.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/elevation/shadow.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/elevation/surface.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/opacity/opacity.d.ts +3 -0
- package/dist/types-ts4.5/tokens/atlassian-dark/utility/utility.d.ts +5 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/color/chart.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/color/text.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/elevation/shadow.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-iteration/elevation/surface.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-dark-new-input-border/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/chart.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/interaction.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/skeleton.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/color/text.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/elevation/shadow.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/elevation/surface.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/opacity/opacity.d.ts +3 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-dark/utility/utility.d.ts +5 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/chart.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/interaction.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/skeleton.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/color/text.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/elevation/shadow.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/elevation/surface.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/opacity/opacity.d.ts +3 -0
- package/dist/types-ts4.5/tokens/atlassian-legacy-light/utility/utility.d.ts +5 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/chart.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/interaction.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/skeleton.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/color/text.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/elevation/shadow.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/elevation/surface.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-light/opacity/opacity.d.ts +3 -0
- package/dist/types-ts4.5/tokens/atlassian-light/utility/utility.d.ts +5 -0
- package/dist/types-ts4.5/tokens/atlassian-light-new-input-border/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-shape/shape.d.ts +7 -0
- package/dist/types-ts4.5/tokens/atlassian-spacing/spacing.d.ts +10 -0
- package/dist/types-ts4.5/tokens/atlassian-typography/font-family.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-typography/font-size.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-typography/font-weight.d.ts +4 -0
- package/dist/types-ts4.5/tokens/atlassian-typography/line-height.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/accent.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/background.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/border.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/chart.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/icon.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/interaction.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/skeleton.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/color/text.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/elevation/shadow.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/elevation/surface.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/opacity/opacity.d.ts +3 -0
- package/dist/types-ts4.5/tokens/default/shape/shape.d.ts +3 -0
- package/dist/types-ts4.5/tokens/default/spacing/spacing.d.ts +8 -0
- package/dist/types-ts4.5/tokens/default/typography/font-family.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/typography/font-size.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/typography/font-weight.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/typography/line-height.d.ts +4 -0
- package/dist/types-ts4.5/tokens/default/utility/utility.d.ts +5 -0
- package/dist/types-ts4.5/types.d.ts +829 -0
- package/dist/types-ts4.5/use-theme-observer.d.ts +15 -0
- package/dist/types-ts4.5/utils/color-detection.d.ts +13 -0
- package/dist/types-ts4.5/utils/theme-loading.d.ts +3 -0
- package/dist/types-ts4.5/utils/theme-state-transformer.d.ts +26 -0
- package/dist/types-ts4.5/utils/token-ids.d.ts +41 -0
- package/dist/types-ts4.5/utils/token-order.d.ts +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActiveThemeState } from './set-global-theme';
|
|
2
|
+
/**
|
|
3
|
+
* A React hook which returns the current themes and color-mode set on `<html>`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```
|
|
7
|
+
* const { colorMode, dark, light, spacing, typography } = useThemeObserver();
|
|
8
|
+
*
|
|
9
|
+
* // Performing side effects when it changes
|
|
10
|
+
* useEffect(() => {
|
|
11
|
+
* console.log(`The color mode has changed to ${theme.colorMode}`);
|
|
12
|
+
* }, [theme.colorMode]);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const useThemeObserver: () => Partial<ActiveThemeState>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ShadowToken } from '../types';
|
|
2
|
+
export declare const hexToRGBAValues: (hex: string) => {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
a: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Returns a box shadow formatted for CSS from a ShadowToken raw value.
|
|
10
|
+
*
|
|
11
|
+
* @param rawShadow - ShadowToken raw value
|
|
12
|
+
*/
|
|
13
|
+
export declare const getBoxShadow: (rawShadow: ShadowToken<string>['value']) => string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ThemeState } from '../set-global-theme';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a string that is formatted for the `data-theme` HTML attribute
|
|
4
|
+
* to an object that can be passed to `setGlobalTheme`.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} themes The themes that should be applied.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* themeStringToObject('dark:dark light:legacy-light spacing:spacing');
|
|
11
|
+
* // returns { dark: 'dark', light: 'legacy-light', spacing: 'spacing' }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const themeStringToObject: (themeState: string) => Partial<ThemeState>;
|
|
15
|
+
/**
|
|
16
|
+
* Converts a theme object to a string formatted for the `data-theme` HTML attribute.
|
|
17
|
+
*
|
|
18
|
+
* @param {object} themes The themes that should be applied.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```
|
|
22
|
+
* themeObjectToString({ dark: 'dark', light: 'legacy-light', spacing: 'spacing' });
|
|
23
|
+
* // returns 'dark:dark light:legacy-light spacing:spacing'
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const themeObjectToString: (themeState: Partial<ThemeState>) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforms a style dictionary token path to a CSS custom property.
|
|
3
|
+
*
|
|
4
|
+
* A css prefix will be prepended and all [default] key words will be omitted
|
|
5
|
+
* from the path
|
|
6
|
+
*
|
|
7
|
+
* @example <caption>Passing a path as an array</caption>
|
|
8
|
+
* // Returns ds-background-bold
|
|
9
|
+
* getCSSCustomProperty(['color', 'background', 'bold', '[default]'])
|
|
10
|
+
*
|
|
11
|
+
* @example <caption>Passing a path as a string</caption>
|
|
12
|
+
* // Returns ds-background-bold
|
|
13
|
+
* getCSSCustomProperty('color.background.bold.[default]')
|
|
14
|
+
*/
|
|
15
|
+
export declare const getCSSCustomProperty: (path: string | string[]) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Transforms a style dictionary token path to a shorthand token id
|
|
18
|
+
* These ids will be typically be how tokens are interacted with via typescript and css
|
|
19
|
+
*
|
|
20
|
+
* All [default] key words will be omitted from the path
|
|
21
|
+
*
|
|
22
|
+
* @example <caption>Passing a path as an array</caption>
|
|
23
|
+
* // Returns color.background.bold
|
|
24
|
+
* getTokenId(['color', 'background', 'bold', '[default]'])
|
|
25
|
+
*
|
|
26
|
+
* @example <caption>Passing a path as a string</caption>
|
|
27
|
+
* // Returns color.background.bold
|
|
28
|
+
* getTokenId('color.background.bold.[default]')
|
|
29
|
+
*/
|
|
30
|
+
export declare const getTokenId: (path: string | string[]) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Transforms a style dictionary token path to a fully qualified token id
|
|
33
|
+
* These Ids are intended to be used internal to this package by style-dictionary
|
|
34
|
+
*
|
|
35
|
+
* [default] key words will NOT be omitted from the path
|
|
36
|
+
*
|
|
37
|
+
* @example <caption>Passing a path as a string</caption>
|
|
38
|
+
* // Returns color.background.bold.[default]
|
|
39
|
+
* getFullyQualifiedTokenId(['color', 'background', 'bold', '[default]'])
|
|
40
|
+
*/
|
|
41
|
+
export declare const getFullyQualifiedTokenId: (path: string[]) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tokens",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
5
|
"description": "Design tokens are the single source of truth to name and store design decisions.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/checkbox": "^12.6.0",
|
|
72
72
|
"@atlaskit/code": "^14.6.0",
|
|
73
73
|
"@atlaskit/docs": "^9.1.0",
|
|
74
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
74
|
+
"@atlaskit/dropdown-menu": "^11.9.0",
|
|
75
75
|
"@atlaskit/ds-explorations": "^2.1.0",
|
|
76
76
|
"@atlaskit/dynamic-table": "^14.9.0",
|
|
77
77
|
"@atlaskit/empty-state": "^7.5.0",
|