@atlaskit/tokens 0.10.18 → 0.10.19

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 (84) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/css/atlassian-dark.css +3 -1
  3. package/css/atlassian-legacy-dark.css +3 -1
  4. package/css/atlassian-legacy-light.css +3 -1
  5. package/css/atlassian-light.css +3 -1
  6. package/dist/cjs/artifacts/palettes-raw/legacy-palette.js +35 -1
  7. package/dist/cjs/artifacts/palettes-raw/palette.js +35 -1
  8. package/dist/cjs/artifacts/token-default-values.js +3 -1
  9. package/dist/cjs/artifacts/token-names.js +3 -1
  10. package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +45 -3
  11. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +45 -3
  12. package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +45 -3
  13. package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +45 -3
  14. package/dist/cjs/constants.js +5 -3
  15. package/dist/cjs/get-token.js +1 -1
  16. package/dist/cjs/palettes/legacy-palette.js +18 -0
  17. package/dist/cjs/palettes/palette.js +18 -0
  18. package/dist/cjs/tokens/atlassian-dark/opacity/opacity.js +18 -0
  19. package/dist/cjs/tokens/atlassian-legacy-dark/opacity/opacity.js +18 -0
  20. package/dist/cjs/tokens/atlassian-legacy-light/opacity/opacity.js +18 -0
  21. package/dist/cjs/tokens/atlassian-light/opacity/opacity.js +18 -0
  22. package/dist/cjs/tokens/default/elevation/shadow.js +1 -1
  23. package/dist/cjs/tokens/default/opacity/opacity.js +28 -0
  24. package/dist/cjs/utils/token-ids.js +8 -5
  25. package/dist/cjs/version.json +1 -1
  26. package/dist/es2019/artifacts/palettes-raw/legacy-palette.js +35 -1
  27. package/dist/es2019/artifacts/palettes-raw/palette.js +35 -1
  28. package/dist/es2019/artifacts/token-default-values.js +3 -1
  29. package/dist/es2019/artifacts/token-names.js +3 -1
  30. package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +45 -3
  31. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +45 -3
  32. package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +45 -3
  33. package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +45 -3
  34. package/dist/es2019/constants.js +2 -1
  35. package/dist/es2019/get-token.js +1 -1
  36. package/dist/es2019/palettes/legacy-palette.js +18 -0
  37. package/dist/es2019/palettes/palette.js +18 -0
  38. package/dist/es2019/tokens/atlassian-dark/opacity/opacity.js +11 -0
  39. package/dist/es2019/tokens/atlassian-legacy-dark/opacity/opacity.js +11 -0
  40. package/dist/es2019/tokens/atlassian-legacy-light/opacity/opacity.js +11 -0
  41. package/dist/es2019/tokens/atlassian-light/opacity/opacity.js +11 -0
  42. package/dist/es2019/tokens/default/elevation/shadow.js +1 -1
  43. package/dist/es2019/tokens/default/opacity/opacity.js +21 -0
  44. package/dist/es2019/utils/token-ids.js +6 -4
  45. package/dist/es2019/version.json +1 -1
  46. package/dist/esm/artifacts/palettes-raw/legacy-palette.js +35 -1
  47. package/dist/esm/artifacts/palettes-raw/palette.js +35 -1
  48. package/dist/esm/artifacts/token-default-values.js +3 -1
  49. package/dist/esm/artifacts/token-names.js +3 -1
  50. package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +45 -3
  51. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +45 -3
  52. package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +45 -3
  53. package/dist/esm/artifacts/tokens-raw/atlassian-light.js +45 -3
  54. package/dist/esm/constants.js +2 -1
  55. package/dist/esm/get-token.js +1 -1
  56. package/dist/esm/palettes/legacy-palette.js +18 -0
  57. package/dist/esm/palettes/palette.js +18 -0
  58. package/dist/esm/tokens/atlassian-dark/opacity/opacity.js +11 -0
  59. package/dist/esm/tokens/atlassian-legacy-dark/opacity/opacity.js +11 -0
  60. package/dist/esm/tokens/atlassian-legacy-light/opacity/opacity.js +11 -0
  61. package/dist/esm/tokens/atlassian-light/opacity/opacity.js +11 -0
  62. package/dist/esm/tokens/default/elevation/shadow.js +1 -1
  63. package/dist/esm/tokens/default/opacity/opacity.js +21 -0
  64. package/dist/esm/utils/token-ids.js +6 -4
  65. package/dist/esm/version.json +1 -1
  66. package/dist/types/artifacts/palettes-raw/legacy-palette.d.ts +20 -3
  67. package/dist/types/artifacts/palettes-raw/palette.d.ts +20 -3
  68. package/dist/types/artifacts/token-default-values.d.ts +3 -1
  69. package/dist/types/artifacts/token-names.d.ts +5 -1
  70. package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +28 -1
  71. package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +28 -1
  72. package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +28 -1
  73. package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +28 -1
  74. package/dist/types/artifacts/types-internal.d.ts +2 -2
  75. package/dist/types/artifacts/types.d.ts +2 -2
  76. package/dist/types/constants.d.ts +1 -0
  77. package/dist/types/tokens/atlassian-dark/opacity/opacity.d.ts +3 -0
  78. package/dist/types/tokens/atlassian-legacy-dark/opacity/opacity.d.ts +3 -0
  79. package/dist/types/tokens/atlassian-legacy-light/opacity/opacity.d.ts +3 -0
  80. package/dist/types/tokens/atlassian-light/opacity/opacity.d.ts +3 -0
  81. package/dist/types/tokens/default/opacity/opacity.d.ts +3 -0
  82. package/dist/types/types.d.ts +29 -8
  83. package/dist/types/utils/token-ids.d.ts +1 -3
  84. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { CSS_PREFIX } from '../constants';
1
+ import { CSS_PREFIX, CSS_VAR_FULL } from '../constants';
2
2
  /**
3
3
  * Transforms a style dictionary token path to a CSS custom property.
4
4
  *
@@ -15,10 +15,11 @@ import { CSS_PREFIX } from '../constants';
15
15
  */
16
16
 
17
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
- };
18
+ const normalizedPath = typeof path === 'string' ? path.split('.') : path; // Opacity and other 'shallow' groups are more readable when not trimmed
21
19
 
20
+ const slice = CSS_VAR_FULL.includes(path[0]) ? 0 : 1;
21
+ return `--${[CSS_PREFIX, ...normalizedPath.slice(slice)].filter(el => el !== '[default]').join('-')}`;
22
+ };
22
23
  /**
23
24
  * Transforms a style dictionary token path to a shorthand token id
24
25
  * These ids will be typically be how tokens are interacted with via typescript and css
@@ -33,6 +34,7 @@ export const getCSSCustomProperty = path => {
33
34
  * // Returns color.background.bold
34
35
  * getTokenId('color.background.bold.[default]')
35
36
  */
37
+
36
38
  export const getTokenId = path => {
37
39
  const normalizedPath = typeof path === 'string' ? path.split('.') : path;
38
40
  return normalizedPath.filter(el => el !== '[default]').join('.');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.18",
3
+ "version": "0.10.19",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -1,9 +1,43 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::73a857568cd56494102a8abd48a3f08c>>
3
+ * @codegen <<SignedSource::91ca2bc33315a9a910c7ca93bcb63936>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
7
+ "value": 0.2,
8
+ "attributes": {
9
+ "group": "palette",
10
+ "category": "opacity"
11
+ },
12
+ "filePath": "src/palettes/legacy-palette.tsx",
13
+ "isSource": true,
14
+ "original": {
15
+ "value": 0.2,
16
+ "attributes": {
17
+ "group": "palette",
18
+ "category": "opacity"
19
+ }
20
+ },
21
+ "name": "value.opacity.Opacity20",
22
+ "path": ["value", "opacity", "Opacity20"]
23
+ }, {
24
+ "value": 0.4,
25
+ "attributes": {
26
+ "group": "palette",
27
+ "category": "opacity"
28
+ },
29
+ "filePath": "src/palettes/legacy-palette.tsx",
30
+ "isSource": true,
31
+ "original": {
32
+ "value": 0.4,
33
+ "attributes": {
34
+ "group": "palette",
35
+ "category": "opacity"
36
+ }
37
+ },
38
+ "name": "value.opacity.Opacity40",
39
+ "path": ["value", "opacity", "Opacity40"]
40
+ }, {
7
41
  "value": "transparent",
8
42
  "attributes": {
9
43
  "group": "palette",
@@ -1,9 +1,43 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::48a859c3e6fb79202e5702421d1b6254>>
3
+ * @codegen <<SignedSource::54a73caa5e11805075c57f698252b1e7>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
7
+ "value": 0.2,
8
+ "attributes": {
9
+ "group": "palette",
10
+ "category": "opacity"
11
+ },
12
+ "filePath": "src/palettes/palette.tsx",
13
+ "isSource": true,
14
+ "original": {
15
+ "value": 0.2,
16
+ "attributes": {
17
+ "group": "palette",
18
+ "category": "opacity"
19
+ }
20
+ },
21
+ "name": "value.opacity.Opacity20",
22
+ "path": ["value", "opacity", "Opacity20"]
23
+ }, {
24
+ "value": 0.4,
25
+ "attributes": {
26
+ "group": "palette",
27
+ "category": "opacity"
28
+ },
29
+ "filePath": "src/palettes/palette.tsx",
30
+ "isSource": true,
31
+ "original": {
32
+ "value": 0.4,
33
+ "attributes": {
34
+ "group": "palette",
35
+ "category": "opacity"
36
+ }
37
+ },
38
+ "name": "value.opacity.Opacity40",
39
+ "path": ["value", "opacity", "Opacity40"]
40
+ }, {
7
41
  "value": "#E9F2FF",
8
42
  "attributes": {
9
43
  "group": "palette",
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Token names mapped to their value in the default Atlassian theme ('light')
5
5
  *
6
- * @codegen <<SignedSource::bf85c12f621d58ae427a6fd99c62fd24>>
6
+ * @codegen <<SignedSource::d33654f7422a0d210f1d8a1bf4497a45>>
7
7
  * @codegenCommand yarn build tokens
8
8
  */
9
9
  var defaultTokenValues = {
@@ -288,6 +288,8 @@ var defaultTokenValues = {
288
288
  'elevation.surface.sunken': '#F7F8F9',
289
289
  'elevation.surface.raised': '#FFFFFF',
290
290
  'elevation.surface.overlay': '#FFFFFF',
291
+ 'opacity.disabled': '0.4',
292
+ 'opacity.loading': '0.2',
291
293
  'utility.UNSAFE_util.transparent': 'transparent',
292
294
  'utility.UNSAFE_util.MISSING_TOKEN': '#FA11F2'
293
295
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::3acc6507214a2d925fd75bce0549f0ab>>
3
+ * @codegen <<SignedSource::e9fa17eebeaf3b2a8318f43c4f7e89c4>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = {
@@ -285,6 +285,8 @@ var tokens = {
285
285
  'elevation.surface.sunken': '--ds-surface-sunken',
286
286
  'elevation.surface.raised': '--ds-surface-raised',
287
287
  'elevation.surface.overlay': '--ds-surface-overlay',
288
+ 'opacity.disabled': '--ds-opacity-disabled',
289
+ 'opacity.loading': '--ds-opacity-loading',
288
290
  'utility.UNSAFE_util.transparent': '--ds-UNSAFE_util-transparent',
289
291
  'utility.UNSAFE_util.MISSING_TOKEN': '--ds-UNSAFE_util-MISSING_TOKEN'
290
292
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::3fef3c7e03c920ccf46adb8e5016f1f9>>
3
+ * @codegen <<SignedSource::b756f5f6727c826e5f41b4d6b9d2b8e3>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
@@ -6499,7 +6499,7 @@ var tokens = [{
6499
6499
  "group": "shadow",
6500
6500
  "state": "active",
6501
6501
  "introduced": "0.6.0",
6502
- "description": "Use to create a shadow when content scolls under other content."
6502
+ "description": "Use to create a shadow when content scrolls under other content."
6503
6503
  },
6504
6504
  "value": [{
6505
6505
  "radius": 12,
@@ -6525,7 +6525,7 @@ var tokens = [{
6525
6525
  "group": "shadow",
6526
6526
  "state": "active",
6527
6527
  "introduced": "0.6.0",
6528
- "description": "Use to create a shadow when content scolls under other content."
6528
+ "description": "Use to create a shadow when content scrolls under other content."
6529
6529
  },
6530
6530
  "value": [{
6531
6531
  "radius": 12,
@@ -6704,6 +6704,48 @@ var tokens = [{
6704
6704
  },
6705
6705
  "name": "elevation.surface.overlay",
6706
6706
  "path": ["elevation", "surface", "overlay"]
6707
+ }, {
6708
+ "attributes": {
6709
+ "group": "opacity",
6710
+ "state": "active",
6711
+ "introduced": "0.10.13",
6712
+ "description": "Apply to images when in a disabled state."
6713
+ },
6714
+ "value": 0.4,
6715
+ "filePath": "src/tokens/atlassian-dark/opacity/opacity.tsx",
6716
+ "isSource": true,
6717
+ "original": {
6718
+ "attributes": {
6719
+ "group": "opacity",
6720
+ "state": "active",
6721
+ "introduced": "0.10.13",
6722
+ "description": "Apply to images when in a disabled state."
6723
+ },
6724
+ "value": "Opacity40"
6725
+ },
6726
+ "name": "opacity.disabled",
6727
+ "path": ["opacity", "disabled"]
6728
+ }, {
6729
+ "attributes": {
6730
+ "group": "opacity",
6731
+ "state": "active",
6732
+ "introduced": "0.10.13",
6733
+ "description": "Apply to content that sits under a loading spinner."
6734
+ },
6735
+ "value": 0.2,
6736
+ "filePath": "src/tokens/atlassian-dark/opacity/opacity.tsx",
6737
+ "isSource": true,
6738
+ "original": {
6739
+ "attributes": {
6740
+ "group": "opacity",
6741
+ "state": "active",
6742
+ "introduced": "0.10.13",
6743
+ "description": "Apply to content that sits under a loading spinner."
6744
+ },
6745
+ "value": "Opacity20"
6746
+ },
6747
+ "name": "opacity.loading",
6748
+ "path": ["opacity", "loading"]
6707
6749
  }, {
6708
6750
  "attributes": {
6709
6751
  "group": "raw",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::1db540cf97cd7f307fc628bbb5346972>>
3
+ * @codegen <<SignedSource::a99ec8f38397a16cab91e936de51714f>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
@@ -6499,7 +6499,7 @@ var tokens = [{
6499
6499
  "group": "shadow",
6500
6500
  "state": "active",
6501
6501
  "introduced": "0.6.0",
6502
- "description": "Use to create a shadow when content scolls under other content."
6502
+ "description": "Use to create a shadow when content scrolls under other content."
6503
6503
  },
6504
6504
  "value": [{
6505
6505
  "radius": 12,
@@ -6525,7 +6525,7 @@ var tokens = [{
6525
6525
  "group": "shadow",
6526
6526
  "state": "active",
6527
6527
  "introduced": "0.6.0",
6528
- "description": "Use to create a shadow when content scolls under other content."
6528
+ "description": "Use to create a shadow when content scrolls under other content."
6529
6529
  },
6530
6530
  "value": [{
6531
6531
  "radius": 12,
@@ -6704,6 +6704,48 @@ var tokens = [{
6704
6704
  },
6705
6705
  "name": "elevation.surface.overlay",
6706
6706
  "path": ["elevation", "surface", "overlay"]
6707
+ }, {
6708
+ "attributes": {
6709
+ "group": "opacity",
6710
+ "state": "active",
6711
+ "introduced": "0.10.13",
6712
+ "description": "Apply to images when in a disabled state."
6713
+ },
6714
+ "value": 0.4,
6715
+ "filePath": "src/tokens/atlassian-legacy-dark/opacity/opacity.tsx",
6716
+ "isSource": true,
6717
+ "original": {
6718
+ "attributes": {
6719
+ "group": "opacity",
6720
+ "state": "active",
6721
+ "introduced": "0.10.13",
6722
+ "description": "Apply to images when in a disabled state."
6723
+ },
6724
+ "value": "Opacity40"
6725
+ },
6726
+ "name": "opacity.disabled",
6727
+ "path": ["opacity", "disabled"]
6728
+ }, {
6729
+ "attributes": {
6730
+ "group": "opacity",
6731
+ "state": "active",
6732
+ "introduced": "0.10.13",
6733
+ "description": "Apply to content that sits under a loading spinner."
6734
+ },
6735
+ "value": 0.2,
6736
+ "filePath": "src/tokens/atlassian-legacy-dark/opacity/opacity.tsx",
6737
+ "isSource": true,
6738
+ "original": {
6739
+ "attributes": {
6740
+ "group": "opacity",
6741
+ "state": "active",
6742
+ "introduced": "0.10.13",
6743
+ "description": "Apply to content that sits under a loading spinner."
6744
+ },
6745
+ "value": "Opacity20"
6746
+ },
6747
+ "name": "opacity.loading",
6748
+ "path": ["opacity", "loading"]
6707
6749
  }, {
6708
6750
  "attributes": {
6709
6751
  "group": "raw",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::6a9c9852352020740a85fbffbcc447e3>>
3
+ * @codegen <<SignedSource::180d57420fabe8bfc7baadbcf7e39146>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
@@ -6479,7 +6479,7 @@ var tokens = [{
6479
6479
  "group": "shadow",
6480
6480
  "state": "active",
6481
6481
  "introduced": "0.6.0",
6482
- "description": "Use to create a shadow when content scolls under other content."
6482
+ "description": "Use to create a shadow when content scrolls under other content."
6483
6483
  },
6484
6484
  "value": [{
6485
6485
  "radius": 8,
@@ -6505,7 +6505,7 @@ var tokens = [{
6505
6505
  "group": "shadow",
6506
6506
  "state": "active",
6507
6507
  "introduced": "0.6.0",
6508
- "description": "Use to create a shadow when content scolls under other content."
6508
+ "description": "Use to create a shadow when content scrolls under other content."
6509
6509
  },
6510
6510
  "value": [{
6511
6511
  "radius": 8,
@@ -6664,6 +6664,48 @@ var tokens = [{
6664
6664
  },
6665
6665
  "name": "elevation.surface.overlay",
6666
6666
  "path": ["elevation", "surface", "overlay"]
6667
+ }, {
6668
+ "attributes": {
6669
+ "group": "opacity",
6670
+ "state": "active",
6671
+ "introduced": "0.10.13",
6672
+ "description": "Apply to images when in a disabled state."
6673
+ },
6674
+ "value": 0.4,
6675
+ "filePath": "src/tokens/atlassian-legacy-light/opacity/opacity.tsx",
6676
+ "isSource": true,
6677
+ "original": {
6678
+ "attributes": {
6679
+ "group": "opacity",
6680
+ "state": "active",
6681
+ "introduced": "0.10.13",
6682
+ "description": "Apply to images when in a disabled state."
6683
+ },
6684
+ "value": "Opacity40"
6685
+ },
6686
+ "name": "opacity.disabled",
6687
+ "path": ["opacity", "disabled"]
6688
+ }, {
6689
+ "attributes": {
6690
+ "group": "opacity",
6691
+ "state": "active",
6692
+ "introduced": "0.10.13",
6693
+ "description": "Apply to content that sits under a loading spinner."
6694
+ },
6695
+ "value": 0.2,
6696
+ "filePath": "src/tokens/atlassian-legacy-light/opacity/opacity.tsx",
6697
+ "isSource": true,
6698
+ "original": {
6699
+ "attributes": {
6700
+ "group": "opacity",
6701
+ "state": "active",
6702
+ "introduced": "0.10.13",
6703
+ "description": "Apply to content that sits under a loading spinner."
6704
+ },
6705
+ "value": "Opacity20"
6706
+ },
6707
+ "name": "opacity.loading",
6708
+ "path": ["opacity", "loading"]
6667
6709
  }, {
6668
6710
  "attributes": {
6669
6711
  "group": "raw",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- * @codegen <<SignedSource::f6a9d19d9e568ee23ce24a7127ceb09c>>
3
+ * @codegen <<SignedSource::6977decc7ef870a337b1171d6775d9dc>>
4
4
  * @codegenCommand yarn build tokens
5
5
  */
6
6
  var tokens = [{
@@ -6479,7 +6479,7 @@ var tokens = [{
6479
6479
  "group": "shadow",
6480
6480
  "state": "active",
6481
6481
  "introduced": "0.6.0",
6482
- "description": "Use to create a shadow when content scolls under other content."
6482
+ "description": "Use to create a shadow when content scrolls under other content."
6483
6483
  },
6484
6484
  "value": [{
6485
6485
  "radius": 8,
@@ -6505,7 +6505,7 @@ var tokens = [{
6505
6505
  "group": "shadow",
6506
6506
  "state": "active",
6507
6507
  "introduced": "0.6.0",
6508
- "description": "Use to create a shadow when content scolls under other content."
6508
+ "description": "Use to create a shadow when content scrolls under other content."
6509
6509
  },
6510
6510
  "value": [{
6511
6511
  "radius": 8,
@@ -6664,6 +6664,48 @@ var tokens = [{
6664
6664
  },
6665
6665
  "name": "elevation.surface.overlay",
6666
6666
  "path": ["elevation", "surface", "overlay"]
6667
+ }, {
6668
+ "attributes": {
6669
+ "group": "opacity",
6670
+ "state": "active",
6671
+ "introduced": "0.10.13",
6672
+ "description": "Apply to images when in a disabled state."
6673
+ },
6674
+ "value": 0.4,
6675
+ "filePath": "src/tokens/atlassian-light/opacity/opacity.tsx",
6676
+ "isSource": true,
6677
+ "original": {
6678
+ "attributes": {
6679
+ "group": "opacity",
6680
+ "state": "active",
6681
+ "introduced": "0.10.13",
6682
+ "description": "Apply to images when in a disabled state."
6683
+ },
6684
+ "value": "Opacity40"
6685
+ },
6686
+ "name": "opacity.disabled",
6687
+ "path": ["opacity", "disabled"]
6688
+ }, {
6689
+ "attributes": {
6690
+ "group": "opacity",
6691
+ "state": "active",
6692
+ "introduced": "0.10.13",
6693
+ "description": "Apply to content that sits under a loading spinner."
6694
+ },
6695
+ "value": 0.2,
6696
+ "filePath": "src/tokens/atlassian-light/opacity/opacity.tsx",
6697
+ "isSource": true,
6698
+ "original": {
6699
+ "attributes": {
6700
+ "group": "opacity",
6701
+ "state": "active",
6702
+ "introduced": "0.10.13",
6703
+ "description": "Apply to content that sits under a loading spinner."
6704
+ },
6705
+ "value": "Opacity20"
6706
+ },
6707
+ "name": "opacity.loading",
6708
+ "path": ["opacity", "loading"]
6667
6709
  }, {
6668
6710
  "attributes": {
6669
6711
  "group": "raw",
@@ -1,7 +1,8 @@
1
1
  export var THEMES = ['light', 'dark', 'legacy-light', 'legacy-dark'];
2
2
  export var THEME_DATA_ATTRIBUTE = 'data-theme';
3
3
  export var DEFAULT_THEME = 'light';
4
- export var CSS_PREFIX = 'ds'; // Maps the longer theme name to a shorthand used in css/code
4
+ export var CSS_PREFIX = 'ds';
5
+ export var CSS_VAR_FULL = ['opacity']; // Maps the longer theme name to a shorthand used in css/code
5
6
 
6
7
  export var THEME_NAME_MAP = {
7
8
  'atlassian-light': 'light',
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
4
4
  var name = "@atlaskit/tokens";
5
- var version = "0.10.18";
5
+ var version = "0.10.19";
6
6
 
7
7
  function token(path, fallback) {
8
8
  var token = tokens[path];
@@ -4,6 +4,24 @@
4
4
  * This palette should be exclusively used for backwards compatible themes
5
5
  */
6
6
  var palette = {
7
+ value: {
8
+ opacity: {
9
+ Opacity20: {
10
+ value: 0.2,
11
+ attributes: {
12
+ group: 'palette',
13
+ category: 'opacity'
14
+ }
15
+ },
16
+ Opacity40: {
17
+ value: 0.4,
18
+ attributes: {
19
+ group: 'palette',
20
+ category: 'opacity'
21
+ }
22
+ }
23
+ }
24
+ },
7
25
  color: {
8
26
  palette: {
9
27
  transparent: {
@@ -1,4 +1,22 @@
1
1
  var palette = {
2
+ value: {
3
+ opacity: {
4
+ Opacity20: {
5
+ value: 0.2,
6
+ attributes: {
7
+ group: 'palette',
8
+ category: 'opacity'
9
+ }
10
+ },
11
+ Opacity40: {
12
+ value: 0.4,
13
+ attributes: {
14
+ group: 'palette',
15
+ category: 'opacity'
16
+ }
17
+ }
18
+ }
19
+ },
2
20
  color: {
3
21
  palette: {
4
22
  B100: {
@@ -0,0 +1,11 @@
1
+ var opacity = {
2
+ opacity: {
3
+ disabled: {
4
+ value: 'Opacity40'
5
+ },
6
+ loading: {
7
+ value: 'Opacity20'
8
+ }
9
+ }
10
+ };
11
+ export default opacity;
@@ -0,0 +1,11 @@
1
+ var opacity = {
2
+ opacity: {
3
+ disabled: {
4
+ value: 'Opacity40'
5
+ },
6
+ loading: {
7
+ value: 'Opacity20'
8
+ }
9
+ }
10
+ };
11
+ export default opacity;
@@ -0,0 +1,11 @@
1
+ var opacity = {
2
+ opacity: {
3
+ disabled: {
4
+ value: 'Opacity40'
5
+ },
6
+ loading: {
7
+ value: 'Opacity20'
8
+ }
9
+ }
10
+ };
11
+ export default opacity;
@@ -0,0 +1,11 @@
1
+ var opacity = {
2
+ opacity: {
3
+ disabled: {
4
+ value: 'Opacity40'
5
+ },
6
+ loading: {
7
+ value: 'Opacity20'
8
+ }
9
+ }
10
+ };
11
+ export default opacity;
@@ -14,7 +14,7 @@ var shadow = {
14
14
  group: 'shadow',
15
15
  state: 'active',
16
16
  introduced: '0.6.0',
17
- description: "Use to create a shadow when content scolls under other content."
17
+ description: "Use to create a shadow when content scrolls under other content."
18
18
  }
19
19
  },
20
20
  overlay: {
@@ -0,0 +1,21 @@
1
+ var opacity = {
2
+ opacity: {
3
+ disabled: {
4
+ attributes: {
5
+ group: 'opacity',
6
+ state: 'active',
7
+ introduced: '0.10.13',
8
+ description: "Apply to images when in a disabled state."
9
+ }
10
+ },
11
+ loading: {
12
+ attributes: {
13
+ group: 'opacity',
14
+ state: 'active',
15
+ introduced: '0.10.13',
16
+ description: "Apply to content that sits under a loading spinner."
17
+ }
18
+ }
19
+ }
20
+ };
21
+ export default opacity;
@@ -1,5 +1,5 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import { CSS_PREFIX } from '../constants';
2
+ import { CSS_PREFIX, CSS_VAR_FULL } from '../constants';
3
3
  /**
4
4
  * Transforms a style dictionary token path to a CSS custom property.
5
5
  *
@@ -16,12 +16,13 @@ import { CSS_PREFIX } from '../constants';
16
16
  */
17
17
 
18
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) {
19
+ var normalizedPath = typeof path === 'string' ? path.split('.') : path; // Opacity and other 'shallow' groups are more readable when not trimmed
20
+
21
+ var slice = CSS_VAR_FULL.includes(path[0]) ? 0 : 1;
22
+ return "--".concat([CSS_PREFIX].concat(_toConsumableArray(normalizedPath.slice(slice))).filter(function (el) {
21
23
  return el !== '[default]';
22
24
  }).join('-'));
23
25
  };
24
-
25
26
  /**
26
27
  * Transforms a style dictionary token path to a shorthand token id
27
28
  * These ids will be typically be how tokens are interacted with via typescript and css
@@ -36,6 +37,7 @@ export var getCSSCustomProperty = function getCSSCustomProperty(path) {
36
37
  * // Returns color.background.bold
37
38
  * getTokenId('color.background.bold.[default]')
38
39
  */
40
+
39
41
  export var getTokenId = function getTokenId(path) {
40
42
  var normalizedPath = typeof path === 'string' ? path.split('.') : path;
41
43
  return normalizedPath.filter(function (el) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "0.10.18",
3
+ "version": "0.10.19",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]