@atlaskit/tokens 0.7.2 → 0.8.1
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 +3 -0
- package/css/atlassian-light.css +3 -0
- package/dist/cjs/artifacts/rename-mapping.js +89 -89
- package/dist/cjs/artifacts/token-default-values.js +3 -0
- package/dist/cjs/artifacts/token-names.js +3 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +267 -178
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +267 -178
- 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/skeleton.js +20 -0
- package/dist/cjs/tokens/atlassian-dark/elevation/shadow.js +23 -0
- package/dist/cjs/tokens/atlassian-light/color/skeleton.js +20 -0
- package/dist/cjs/tokens/atlassian-light/elevation/shadow.js +19 -0
- package/dist/cjs/tokens/default/color/skeleton.js +28 -0
- package/dist/cjs/tokens/default/deprecated/deprecated.js +89 -89
- package/dist/cjs/tokens/default/elevation/shadow.js +7 -0
- package/dist/cjs/version.json +4 -2
- package/dist/es2019/artifacts/rename-mapping.js +89 -89
- package/dist/es2019/artifacts/token-default-values.js +3 -0
- package/dist/es2019/artifacts/token-names.js +3 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +267 -178
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +267 -178
- 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/skeleton.js +13 -0
- package/dist/es2019/tokens/atlassian-dark/elevation/shadow.js +23 -0
- package/dist/es2019/tokens/atlassian-light/color/skeleton.js +13 -0
- package/dist/es2019/tokens/atlassian-light/elevation/shadow.js +19 -0
- package/dist/es2019/tokens/default/color/skeleton.js +21 -0
- package/dist/es2019/tokens/default/deprecated/deprecated.js +89 -89
- package/dist/es2019/tokens/default/elevation/shadow.js +7 -0
- package/dist/es2019/version.json +4 -2
- package/dist/esm/artifacts/rename-mapping.js +89 -89
- package/dist/esm/artifacts/token-default-values.js +3 -0
- package/dist/esm/artifacts/token-names.js +3 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +267 -178
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +267 -178
- 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/skeleton.js +13 -0
- package/dist/esm/tokens/atlassian-dark/elevation/shadow.js +23 -0
- package/dist/esm/tokens/atlassian-light/color/skeleton.js +13 -0
- package/dist/esm/tokens/atlassian-light/elevation/shadow.js +19 -0
- package/dist/esm/tokens/default/color/skeleton.js +21 -0
- package/dist/esm/tokens/default/deprecated/deprecated.js +89 -89
- package/dist/esm/tokens/default/elevation/shadow.js +7 -0
- package/dist/esm/version.json +4 -2
- package/dist/types/artifacts/token-default-values.d.ts +3 -0
- package/dist/types/artifacts/token-names.d.ts +6 -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 +9 -0
- package/package.json +5 -2
- package/token-ids/package.json +7 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var ALLOWED_THEMES = ['light', 'dark'];
|
|
2
|
+
export var DEFAULT_THEME = 'light';
|
|
3
|
+
export var CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand used in css/code
|
|
4
|
+
|
|
5
|
+
export var 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/esm/get-token.js
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { CSS_PREFIX } from './constants';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms a style dictionary token path to a CSS custom property.
|
|
5
|
+
*
|
|
6
|
+
* A css prefix will be prepended and all [default] key words will be omitted
|
|
7
|
+
* from the path
|
|
8
|
+
*
|
|
9
|
+
* @example <caption>Passing a path as an array</caption>
|
|
10
|
+
* // Returns ds-background-bold
|
|
11
|
+
* getCSSCustomProperty(['color', 'background', 'bold', '[default]'])
|
|
12
|
+
*
|
|
13
|
+
* @example <caption>Passing a path as a string</caption>
|
|
14
|
+
* // Returns ds-background-bold
|
|
15
|
+
* getCSSCustomProperty('color.background.bold.[default]')
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export var getCSSCustomProperty = function getCSSCustomProperty(path) {
|
|
19
|
+
var normalizedPath = typeof path === 'string' ? path.split('.') : path;
|
|
20
|
+
return "--".concat([CSS_PREFIX].concat(_toConsumableArray(normalizedPath.slice(1))).filter(function (el) {
|
|
21
|
+
return el !== '[default]';
|
|
22
|
+
}).join('-'));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Transforms a style dictionary token path to a shorthand token id
|
|
27
|
+
* These ids will be typically be how tokens are interacted with via typescript and css
|
|
28
|
+
*
|
|
29
|
+
* All [default] key words will be omitted from the path
|
|
30
|
+
*
|
|
31
|
+
* @example <caption>Passing a path as an array</caption>
|
|
32
|
+
* // Returns color.background.bold
|
|
33
|
+
* getTokenId(['color', 'background', 'bold', '[default]'])
|
|
34
|
+
*
|
|
35
|
+
* @example <caption>Passing a path as a string</caption>
|
|
36
|
+
* // Returns color.background.bold
|
|
37
|
+
* getTokenId('color.background.bold.[default]')
|
|
38
|
+
*/
|
|
39
|
+
export var getTokenId = function getTokenId(path) {
|
|
40
|
+
var normalizedPath = typeof path === 'string' ? path.split('.') : path;
|
|
41
|
+
return normalizedPath.filter(function (el) {
|
|
42
|
+
return el !== '[default]';
|
|
43
|
+
}).join('.');
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Transforms a style dictionary token path to a fully qualified token id
|
|
47
|
+
* These Ids are intended to be used internal to this package by style-dictionary
|
|
48
|
+
*
|
|
49
|
+
* [default] key words will NOT be omitted from the path
|
|
50
|
+
*
|
|
51
|
+
* @example <caption>Passing a path as a string</caption>
|
|
52
|
+
* // Returns color.background.bold.[default]
|
|
53
|
+
* getFullyQualifiedTokenId(['color', 'background', 'bold', '[default]'])
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
export var getFullyQualifiedTokenId = function getFullyQualifiedTokenId(path) {
|
|
57
|
+
return path.join('.');
|
|
58
|
+
};
|
|
@@ -22,6 +22,29 @@ var shadow = {
|
|
|
22
22
|
opacity: 0.5
|
|
23
23
|
}]
|
|
24
24
|
},
|
|
25
|
+
overflow: {
|
|
26
|
+
value: [{
|
|
27
|
+
radius: 12,
|
|
28
|
+
offset: {
|
|
29
|
+
x: 0,
|
|
30
|
+
y: 0
|
|
31
|
+
},
|
|
32
|
+
// @ts-ignore no current palette colour for this yet
|
|
33
|
+
color: '#030404',
|
|
34
|
+
// This opacity overrides the color alpha.
|
|
35
|
+
opacity: 0.56
|
|
36
|
+
}, {
|
|
37
|
+
radius: 1,
|
|
38
|
+
offset: {
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0
|
|
41
|
+
},
|
|
42
|
+
// @ts-ignore no current palette colour for this yet
|
|
43
|
+
color: '#030404',
|
|
44
|
+
// This opacity overrides the color alpha.
|
|
45
|
+
opacity: 0.5
|
|
46
|
+
}]
|
|
47
|
+
},
|
|
25
48
|
overlay: {
|
|
26
49
|
value: [{
|
|
27
50
|
radius: 0,
|
|
@@ -20,6 +20,25 @@ var shadow = {
|
|
|
20
20
|
opacity: 0.31
|
|
21
21
|
}]
|
|
22
22
|
},
|
|
23
|
+
overflow: {
|
|
24
|
+
value: [{
|
|
25
|
+
radius: 8,
|
|
26
|
+
offset: {
|
|
27
|
+
x: 0,
|
|
28
|
+
y: 8
|
|
29
|
+
},
|
|
30
|
+
color: 'N1100',
|
|
31
|
+
opacity: 0.08
|
|
32
|
+
}, {
|
|
33
|
+
radius: 1,
|
|
34
|
+
offset: {
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0
|
|
37
|
+
},
|
|
38
|
+
color: 'N1100',
|
|
39
|
+
opacity: 0.12
|
|
40
|
+
}]
|
|
41
|
+
},
|
|
23
42
|
overlay: {
|
|
24
43
|
value: [{
|
|
25
44
|
radius: 12,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var 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;
|