@atlaskit/tokens 0.7.3 → 0.8.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 +89 -0
- package/css/atlassian-dark.css +5 -3
- package/css/atlassian-light.css +5 -3
- package/dist/cjs/artifacts/rename-mapping.js +89 -89
- package/dist/cjs/artifacts/token-default-values.js +5 -3
- package/dist/cjs/artifacts/token-names.js +2 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +222 -184
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +222 -184
- package/dist/cjs/constants.js +18 -0
- package/dist/cjs/entry-points/token-ids.js +25 -0
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/token-ids.js +75 -0
- package/dist/cjs/tokens/atlassian-dark/color/background.js +3 -3
- package/dist/cjs/tokens/atlassian-dark/color/skeleton.js +20 -0
- package/dist/cjs/tokens/atlassian-light/color/background.js +3 -3
- package/dist/cjs/tokens/atlassian-light/color/skeleton.js +20 -0
- package/dist/cjs/tokens/default/color/skeleton.js +28 -0
- package/dist/cjs/tokens/default/deprecated/deprecated.js +89 -89
- package/dist/cjs/version.json +4 -2
- package/dist/es2019/artifacts/rename-mapping.js +89 -89
- package/dist/es2019/artifacts/token-default-values.js +5 -3
- package/dist/es2019/artifacts/token-names.js +2 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +222 -184
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +222 -184
- package/dist/es2019/constants.js +8 -0
- package/dist/es2019/entry-points/token-ids.js +1 -0
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/token-ids.js +51 -0
- package/dist/es2019/tokens/atlassian-dark/color/background.js +3 -3
- package/dist/es2019/tokens/atlassian-dark/color/skeleton.js +13 -0
- package/dist/es2019/tokens/atlassian-light/color/background.js +3 -3
- package/dist/es2019/tokens/atlassian-light/color/skeleton.js +13 -0
- package/dist/es2019/tokens/default/color/skeleton.js +21 -0
- package/dist/es2019/tokens/default/deprecated/deprecated.js +89 -89
- package/dist/es2019/version.json +4 -2
- package/dist/esm/artifacts/rename-mapping.js +89 -89
- package/dist/esm/artifacts/token-default-values.js +5 -3
- package/dist/esm/artifacts/token-names.js +2 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +222 -184
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +222 -184
- package/dist/esm/constants.js +8 -0
- package/dist/esm/entry-points/token-ids.js +1 -0
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/token-ids.js +58 -0
- package/dist/esm/tokens/atlassian-dark/color/background.js +3 -3
- package/dist/esm/tokens/atlassian-dark/color/skeleton.js +13 -0
- package/dist/esm/tokens/atlassian-light/color/background.js +3 -3
- package/dist/esm/tokens/atlassian-light/color/skeleton.js +13 -0
- package/dist/esm/tokens/default/color/skeleton.js +21 -0
- package/dist/esm/tokens/default/deprecated/deprecated.js +89 -89
- package/dist/esm/version.json +4 -2
- package/dist/types/artifacts/token-default-values.d.ts +5 -3
- package/dist/types/artifacts/token-names.d.ts +4 -0
- package/dist/types/artifacts/types-internal.d.ts +1 -1
- package/dist/types/artifacts/types.d.ts +1 -1
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/entry-points/token-ids.d.ts +1 -0
- package/dist/types/token-ids.d.ts +43 -0
- package/dist/types/tokens/atlassian-dark/color/skeleton.d.ts +3 -0
- package/dist/types/tokens/atlassian-light/color/skeleton.d.ts +3 -0
- package/dist/types/tokens/default/color/skeleton.d.ts +3 -0
- package/dist/types/tokens/default/utility/utility.d.ts +10 -10
- package/dist/types/types.d.ts +8 -0
- package/package.json +5 -2
- package/token-ids/package.json +7 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const ALLOWED_THEMES = ['light', 'dark'];
|
|
2
|
+
export const DEFAULT_THEME = 'light';
|
|
3
|
+
export const CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand used in css/code
|
|
4
|
+
|
|
5
|
+
export const LONG_SHORT_MAPPING = {
|
|
6
|
+
'atlassian-light': 'light',
|
|
7
|
+
'atlassian-dark': 'dark'
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getCSSCustomProperty, getTokenId, getFullyQualifiedTokenId } from '../token-ids';
|
package/dist/es2019/get-token.js
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CSS_PREFIX } from './constants';
|
|
2
|
+
/**
|
|
3
|
+
* Transforms a style dictionary token path to a CSS custom property.
|
|
4
|
+
*
|
|
5
|
+
* A css prefix will be prepended and all [default] key words will be omitted
|
|
6
|
+
* from the path
|
|
7
|
+
*
|
|
8
|
+
* @example <caption>Passing a path as an array</caption>
|
|
9
|
+
* // Returns ds-background-bold
|
|
10
|
+
* getCSSCustomProperty(['color', 'background', 'bold', '[default]'])
|
|
11
|
+
*
|
|
12
|
+
* @example <caption>Passing a path as a string</caption>
|
|
13
|
+
* // Returns ds-background-bold
|
|
14
|
+
* getCSSCustomProperty('color.background.bold.[default]')
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const getCSSCustomProperty = path => {
|
|
18
|
+
const normalizedPath = typeof path === 'string' ? path.split('.') : path;
|
|
19
|
+
return `--${[CSS_PREFIX, ...normalizedPath.slice(1)].filter(el => el !== '[default]').join('-')}`;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Transforms a style dictionary token path to a shorthand token id
|
|
24
|
+
* These ids will be typically be how tokens are interacted with via typescript and css
|
|
25
|
+
*
|
|
26
|
+
* All [default] key words will be omitted from the path
|
|
27
|
+
*
|
|
28
|
+
* @example <caption>Passing a path as an array</caption>
|
|
29
|
+
* // Returns color.background.bold
|
|
30
|
+
* getTokenId(['color', 'background', 'bold', '[default]'])
|
|
31
|
+
*
|
|
32
|
+
* @example <caption>Passing a path as a string</caption>
|
|
33
|
+
* // Returns color.background.bold
|
|
34
|
+
* getTokenId('color.background.bold.[default]')
|
|
35
|
+
*/
|
|
36
|
+
export const getTokenId = path => {
|
|
37
|
+
const normalizedPath = typeof path === 'string' ? path.split('.') : path;
|
|
38
|
+
return normalizedPath.filter(el => el !== '[default]').join('.');
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Transforms a style dictionary token path to a fully qualified token id
|
|
42
|
+
* These Ids are intended to be used internal to this package by style-dictionary
|
|
43
|
+
*
|
|
44
|
+
* [default] key words will NOT be omitted from the path
|
|
45
|
+
*
|
|
46
|
+
* @example <caption>Passing a path as a string</caption>
|
|
47
|
+
* // Returns color.background.bold.[default]
|
|
48
|
+
* getFullyQualifiedTokenId(['color', 'background', 'bold', '[default]'])
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export const getFullyQualifiedTokenId = path => path.join('.');
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const color = {
|
|
2
|
+
color: {
|
|
3
|
+
skeleton: {
|
|
4
|
+
'[default]': {
|
|
5
|
+
attributes: {
|
|
6
|
+
group: 'paint',
|
|
7
|
+
state: 'active',
|
|
8
|
+
description: 'Use for skeleton loading states'
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
subtle: {
|
|
12
|
+
attributes: {
|
|
13
|
+
group: 'paint',
|
|
14
|
+
state: 'active',
|
|
15
|
+
description: 'Use for the pulse or shimmer effect in skeleton loading states'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default color;
|