@atlaskit/tokens 0.10.3 → 0.10.6
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/.eslintrc.js +35 -0
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/cjs/artifacts/rename-mapping.js +10 -10
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +37 -19
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +37 -19
- package/dist/cjs/babel-plugin/plugin.js +57 -53
- package/dist/cjs/constants.js +4 -2
- package/dist/cjs/get-token.js +9 -2
- package/dist/cjs/tokens/default/deprecated/deprecated.js +18 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/rename-mapping.js +10 -10
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +37 -19
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +37 -19
- package/dist/es2019/babel-plugin/plugin.js +50 -45
- package/dist/es2019/constants.js +2 -1
- package/dist/es2019/get-token.js +8 -2
- package/dist/es2019/tokens/default/deprecated/deprecated.js +18 -9
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/rename-mapping.js +10 -10
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +37 -19
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +37 -19
- package/dist/esm/babel-plugin/plugin.js +57 -53
- package/dist/esm/constants.js +2 -1
- package/dist/esm/get-token.js +8 -2
- package/dist/esm/tokens/default/deprecated/deprecated.js +18 -9
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/rename-mapping.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -28
- package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -28
- package/dist/types/babel-plugin/plugin.d.ts +5 -5
- package/dist/types/constants.d.ts +1 -0
- package/package.json +7 -3
|
@@ -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::
|
|
3
|
+
* @codegen <<SignedSource::2790b3e5387d05c20675eb77bb4ec986>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -2886,9 +2886,10 @@ var tokens = [{
|
|
|
2886
2886
|
}, {
|
|
2887
2887
|
"attributes": {
|
|
2888
2888
|
"group": "paint",
|
|
2889
|
-
"state": "
|
|
2889
|
+
"state": "deleted",
|
|
2890
2890
|
"introduced": "0.1.0",
|
|
2891
2891
|
"deprecated": "0.8.3",
|
|
2892
|
+
"deleted": "0.10.5",
|
|
2892
2893
|
"replacement": "color.background.inverse.subtle.[default]",
|
|
2893
2894
|
"description": "Use for backgrounds of elements on a bold background, such as in the buttons on spotlight cards."
|
|
2894
2895
|
},
|
|
@@ -2898,9 +2899,10 @@ var tokens = [{
|
|
|
2898
2899
|
"original": {
|
|
2899
2900
|
"attributes": {
|
|
2900
2901
|
"group": "paint",
|
|
2901
|
-
"state": "
|
|
2902
|
+
"state": "deleted",
|
|
2902
2903
|
"introduced": "0.1.0",
|
|
2903
2904
|
"deprecated": "0.8.3",
|
|
2905
|
+
"deleted": "0.10.5",
|
|
2904
2906
|
"replacement": "color.background.inverse.subtle.[default]",
|
|
2905
2907
|
"description": "Use for backgrounds of elements on a bold background, such as in the buttons on spotlight cards."
|
|
2906
2908
|
},
|
|
@@ -3226,9 +3228,10 @@ var tokens = [{
|
|
|
3226
3228
|
}, {
|
|
3227
3229
|
"attributes": {
|
|
3228
3230
|
"group": "paint",
|
|
3229
|
-
"state": "
|
|
3231
|
+
"state": "deleted",
|
|
3230
3232
|
"introduced": "0.6.0",
|
|
3231
3233
|
"deprecated": "0.6.2",
|
|
3234
|
+
"deleted": "0.10.5",
|
|
3232
3235
|
"replacement": "color.background.selected.[default].[default]",
|
|
3233
3236
|
"description": "Use for the background of elements used to reinforce our brand."
|
|
3234
3237
|
},
|
|
@@ -3238,9 +3241,10 @@ var tokens = [{
|
|
|
3238
3241
|
"original": {
|
|
3239
3242
|
"attributes": {
|
|
3240
3243
|
"group": "paint",
|
|
3241
|
-
"state": "
|
|
3244
|
+
"state": "deleted",
|
|
3242
3245
|
"introduced": "0.6.0",
|
|
3243
3246
|
"deprecated": "0.6.2",
|
|
3247
|
+
"deleted": "0.10.5",
|
|
3244
3248
|
"replacement": "color.background.selected.[default].[default]",
|
|
3245
3249
|
"description": "Use for the background of elements used to reinforce our brand."
|
|
3246
3250
|
},
|
|
@@ -3251,9 +3255,10 @@ var tokens = [{
|
|
|
3251
3255
|
}, {
|
|
3252
3256
|
"attributes": {
|
|
3253
3257
|
"group": "paint",
|
|
3254
|
-
"state": "
|
|
3258
|
+
"state": "deleted",
|
|
3255
3259
|
"introduced": "0.6.0",
|
|
3256
3260
|
"deprecated": "0.6.2",
|
|
3261
|
+
"deleted": "0.10.5",
|
|
3257
3262
|
"replacement": "color.background.selected.[default].hovered",
|
|
3258
3263
|
"description": "Hovered state for color.background.brand"
|
|
3259
3264
|
},
|
|
@@ -3263,9 +3268,10 @@ var tokens = [{
|
|
|
3263
3268
|
"original": {
|
|
3264
3269
|
"attributes": {
|
|
3265
3270
|
"group": "paint",
|
|
3266
|
-
"state": "
|
|
3271
|
+
"state": "deleted",
|
|
3267
3272
|
"introduced": "0.6.0",
|
|
3268
3273
|
"deprecated": "0.6.2",
|
|
3274
|
+
"deleted": "0.10.5",
|
|
3269
3275
|
"replacement": "color.background.selected.[default].hovered",
|
|
3270
3276
|
"description": "Hovered state for color.background.brand"
|
|
3271
3277
|
},
|
|
@@ -3276,9 +3282,10 @@ var tokens = [{
|
|
|
3276
3282
|
}, {
|
|
3277
3283
|
"attributes": {
|
|
3278
3284
|
"group": "paint",
|
|
3279
|
-
"state": "
|
|
3285
|
+
"state": "deleted",
|
|
3280
3286
|
"introduced": "0.6.0",
|
|
3281
3287
|
"deprecated": "0.6.2",
|
|
3288
|
+
"deleted": "0.10.5",
|
|
3282
3289
|
"replacement": "color.background.selected.[default].pressed",
|
|
3283
3290
|
"description": "Pressed state for color.background.brand"
|
|
3284
3291
|
},
|
|
@@ -3288,9 +3295,10 @@ var tokens = [{
|
|
|
3288
3295
|
"original": {
|
|
3289
3296
|
"attributes": {
|
|
3290
3297
|
"group": "paint",
|
|
3291
|
-
"state": "
|
|
3298
|
+
"state": "deleted",
|
|
3292
3299
|
"introduced": "0.6.0",
|
|
3293
3300
|
"deprecated": "0.6.2",
|
|
3301
|
+
"deleted": "0.10.5",
|
|
3294
3302
|
"replacement": "color.background.selected.[default].pressed",
|
|
3295
3303
|
"description": "Pressed state for color.background.brand"
|
|
3296
3304
|
},
|
|
@@ -3427,9 +3435,10 @@ var tokens = [{
|
|
|
3427
3435
|
}, {
|
|
3428
3436
|
"attributes": {
|
|
3429
3437
|
"group": "paint",
|
|
3430
|
-
"state": "
|
|
3438
|
+
"state": "deleted",
|
|
3431
3439
|
"introduced": "0.1.0",
|
|
3432
3440
|
"deprecated": "0.6.0",
|
|
3441
|
+
"deleted": "0.10.5",
|
|
3433
3442
|
"replacement": "color.background.selected.[default].[default]",
|
|
3434
3443
|
"description": "Use for backgrounds of elements in a selected state"
|
|
3435
3444
|
},
|
|
@@ -3439,9 +3448,10 @@ var tokens = [{
|
|
|
3439
3448
|
"original": {
|
|
3440
3449
|
"attributes": {
|
|
3441
3450
|
"group": "paint",
|
|
3442
|
-
"state": "
|
|
3451
|
+
"state": "deleted",
|
|
3443
3452
|
"introduced": "0.1.0",
|
|
3444
3453
|
"deprecated": "0.6.0",
|
|
3454
|
+
"deleted": "0.10.5",
|
|
3445
3455
|
"replacement": "color.background.selected.[default].[default]",
|
|
3446
3456
|
"description": "Use for backgrounds of elements in a selected state"
|
|
3447
3457
|
},
|
|
@@ -3452,9 +3462,10 @@ var tokens = [{
|
|
|
3452
3462
|
}, {
|
|
3453
3463
|
"attributes": {
|
|
3454
3464
|
"group": "paint",
|
|
3455
|
-
"state": "
|
|
3465
|
+
"state": "deleted",
|
|
3456
3466
|
"introduced": "0.1.0",
|
|
3457
3467
|
"deprecated": "0.6.0",
|
|
3468
|
+
"deleted": "0.10.5",
|
|
3458
3469
|
"replacement": "color.background.selected.[default].hovered",
|
|
3459
3470
|
"description": "Hover state for color.background.selected"
|
|
3460
3471
|
},
|
|
@@ -3464,9 +3475,10 @@ var tokens = [{
|
|
|
3464
3475
|
"original": {
|
|
3465
3476
|
"attributes": {
|
|
3466
3477
|
"group": "paint",
|
|
3467
|
-
"state": "
|
|
3478
|
+
"state": "deleted",
|
|
3468
3479
|
"introduced": "0.1.0",
|
|
3469
3480
|
"deprecated": "0.6.0",
|
|
3481
|
+
"deleted": "0.10.5",
|
|
3470
3482
|
"replacement": "color.background.selected.[default].hovered",
|
|
3471
3483
|
"description": "Hover state for color.background.selected"
|
|
3472
3484
|
},
|
|
@@ -4755,9 +4767,10 @@ var tokens = [{
|
|
|
4755
4767
|
}, {
|
|
4756
4768
|
"attributes": {
|
|
4757
4769
|
"group": "paint",
|
|
4758
|
-
"state": "
|
|
4770
|
+
"state": "deleted",
|
|
4759
4771
|
"introduced": "0.0.15",
|
|
4760
4772
|
"deprecated": "0.6.0",
|
|
4773
|
+
"deleted": "0.10.5",
|
|
4761
4774
|
"replacement": "color.background.selected.[default].hovered",
|
|
4762
4775
|
"description": "Hover state for background.subtleBrand"
|
|
4763
4776
|
},
|
|
@@ -4767,9 +4780,10 @@ var tokens = [{
|
|
|
4767
4780
|
"original": {
|
|
4768
4781
|
"attributes": {
|
|
4769
4782
|
"group": "paint",
|
|
4770
|
-
"state": "
|
|
4783
|
+
"state": "deleted",
|
|
4771
4784
|
"introduced": "0.0.15",
|
|
4772
4785
|
"deprecated": "0.6.0",
|
|
4786
|
+
"deleted": "0.10.5",
|
|
4773
4787
|
"replacement": "color.background.selected.[default].hovered",
|
|
4774
4788
|
"description": "Hover state for background.subtleBrand"
|
|
4775
4789
|
},
|
|
@@ -4780,9 +4794,10 @@ var tokens = [{
|
|
|
4780
4794
|
}, {
|
|
4781
4795
|
"attributes": {
|
|
4782
4796
|
"group": "paint",
|
|
4783
|
-
"state": "
|
|
4797
|
+
"state": "deleted",
|
|
4784
4798
|
"introduced": "0.0.15",
|
|
4785
4799
|
"deprecated": "0.6.0",
|
|
4800
|
+
"deleted": "0.10.5",
|
|
4786
4801
|
"replacement": "color.background.selected.[default].pressed",
|
|
4787
4802
|
"description": "Pressed state for background.subtleBrand"
|
|
4788
4803
|
},
|
|
@@ -4792,9 +4807,10 @@ var tokens = [{
|
|
|
4792
4807
|
"original": {
|
|
4793
4808
|
"attributes": {
|
|
4794
4809
|
"group": "paint",
|
|
4795
|
-
"state": "
|
|
4810
|
+
"state": "deleted",
|
|
4796
4811
|
"introduced": "0.0.15",
|
|
4797
4812
|
"deprecated": "0.6.0",
|
|
4813
|
+
"deleted": "0.10.5",
|
|
4798
4814
|
"replacement": "color.background.selected.[default].pressed",
|
|
4799
4815
|
"description": "Pressed state for background.subtleBrand"
|
|
4800
4816
|
},
|
|
@@ -4805,9 +4821,10 @@ var tokens = [{
|
|
|
4805
4821
|
}, {
|
|
4806
4822
|
"attributes": {
|
|
4807
4823
|
"group": "paint",
|
|
4808
|
-
"state": "
|
|
4824
|
+
"state": "deleted",
|
|
4809
4825
|
"introduced": "0.0.15",
|
|
4810
4826
|
"deprecated": "0.6.0",
|
|
4827
|
+
"deleted": "0.10.5",
|
|
4811
4828
|
"replacement": "color.background.selected.[default].[default]",
|
|
4812
4829
|
"description": "Use for subdued backgrounds of UI elements like information section messages and in progress lozenges."
|
|
4813
4830
|
},
|
|
@@ -4817,9 +4834,10 @@ var tokens = [{
|
|
|
4817
4834
|
"original": {
|
|
4818
4835
|
"attributes": {
|
|
4819
4836
|
"group": "paint",
|
|
4820
|
-
"state": "
|
|
4837
|
+
"state": "deleted",
|
|
4821
4838
|
"introduced": "0.0.15",
|
|
4822
4839
|
"deprecated": "0.6.0",
|
|
4840
|
+
"deleted": "0.10.5",
|
|
4823
4841
|
"replacement": "color.background.selected.[default].[default]",
|
|
4824
4842
|
"description": "Use for subdued backgrounds of UI elements like information section messages and in progress lozenges."
|
|
4825
4843
|
},
|
|
@@ -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::
|
|
3
|
+
* @codegen <<SignedSource::7cdaec19ecd5c921bc01bf32e95ed909>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -2886,9 +2886,10 @@ var tokens = [{
|
|
|
2886
2886
|
}, {
|
|
2887
2887
|
"attributes": {
|
|
2888
2888
|
"group": "paint",
|
|
2889
|
-
"state": "
|
|
2889
|
+
"state": "deleted",
|
|
2890
2890
|
"introduced": "0.1.0",
|
|
2891
2891
|
"deprecated": "0.8.3",
|
|
2892
|
+
"deleted": "0.10.5",
|
|
2892
2893
|
"replacement": "color.background.inverse.subtle.[default]",
|
|
2893
2894
|
"description": "Use for backgrounds of elements on a bold background, such as in the buttons on spotlight cards."
|
|
2894
2895
|
},
|
|
@@ -2898,9 +2899,10 @@ var tokens = [{
|
|
|
2898
2899
|
"original": {
|
|
2899
2900
|
"attributes": {
|
|
2900
2901
|
"group": "paint",
|
|
2901
|
-
"state": "
|
|
2902
|
+
"state": "deleted",
|
|
2902
2903
|
"introduced": "0.1.0",
|
|
2903
2904
|
"deprecated": "0.8.3",
|
|
2905
|
+
"deleted": "0.10.5",
|
|
2904
2906
|
"replacement": "color.background.inverse.subtle.[default]",
|
|
2905
2907
|
"description": "Use for backgrounds of elements on a bold background, such as in the buttons on spotlight cards."
|
|
2906
2908
|
},
|
|
@@ -3226,9 +3228,10 @@ var tokens = [{
|
|
|
3226
3228
|
}, {
|
|
3227
3229
|
"attributes": {
|
|
3228
3230
|
"group": "paint",
|
|
3229
|
-
"state": "
|
|
3231
|
+
"state": "deleted",
|
|
3230
3232
|
"introduced": "0.6.0",
|
|
3231
3233
|
"deprecated": "0.6.2",
|
|
3234
|
+
"deleted": "0.10.5",
|
|
3232
3235
|
"replacement": "color.background.selected.[default].[default]",
|
|
3233
3236
|
"description": "Use for the background of elements used to reinforce our brand."
|
|
3234
3237
|
},
|
|
@@ -3238,9 +3241,10 @@ var tokens = [{
|
|
|
3238
3241
|
"original": {
|
|
3239
3242
|
"attributes": {
|
|
3240
3243
|
"group": "paint",
|
|
3241
|
-
"state": "
|
|
3244
|
+
"state": "deleted",
|
|
3242
3245
|
"introduced": "0.6.0",
|
|
3243
3246
|
"deprecated": "0.6.2",
|
|
3247
|
+
"deleted": "0.10.5",
|
|
3244
3248
|
"replacement": "color.background.selected.[default].[default]",
|
|
3245
3249
|
"description": "Use for the background of elements used to reinforce our brand."
|
|
3246
3250
|
},
|
|
@@ -3251,9 +3255,10 @@ var tokens = [{
|
|
|
3251
3255
|
}, {
|
|
3252
3256
|
"attributes": {
|
|
3253
3257
|
"group": "paint",
|
|
3254
|
-
"state": "
|
|
3258
|
+
"state": "deleted",
|
|
3255
3259
|
"introduced": "0.6.0",
|
|
3256
3260
|
"deprecated": "0.6.2",
|
|
3261
|
+
"deleted": "0.10.5",
|
|
3257
3262
|
"replacement": "color.background.selected.[default].hovered",
|
|
3258
3263
|
"description": "Hovered state for color.background.brand"
|
|
3259
3264
|
},
|
|
@@ -3263,9 +3268,10 @@ var tokens = [{
|
|
|
3263
3268
|
"original": {
|
|
3264
3269
|
"attributes": {
|
|
3265
3270
|
"group": "paint",
|
|
3266
|
-
"state": "
|
|
3271
|
+
"state": "deleted",
|
|
3267
3272
|
"introduced": "0.6.0",
|
|
3268
3273
|
"deprecated": "0.6.2",
|
|
3274
|
+
"deleted": "0.10.5",
|
|
3269
3275
|
"replacement": "color.background.selected.[default].hovered",
|
|
3270
3276
|
"description": "Hovered state for color.background.brand"
|
|
3271
3277
|
},
|
|
@@ -3276,9 +3282,10 @@ var tokens = [{
|
|
|
3276
3282
|
}, {
|
|
3277
3283
|
"attributes": {
|
|
3278
3284
|
"group": "paint",
|
|
3279
|
-
"state": "
|
|
3285
|
+
"state": "deleted",
|
|
3280
3286
|
"introduced": "0.6.0",
|
|
3281
3287
|
"deprecated": "0.6.2",
|
|
3288
|
+
"deleted": "0.10.5",
|
|
3282
3289
|
"replacement": "color.background.selected.[default].pressed",
|
|
3283
3290
|
"description": "Pressed state for color.background.brand"
|
|
3284
3291
|
},
|
|
@@ -3288,9 +3295,10 @@ var tokens = [{
|
|
|
3288
3295
|
"original": {
|
|
3289
3296
|
"attributes": {
|
|
3290
3297
|
"group": "paint",
|
|
3291
|
-
"state": "
|
|
3298
|
+
"state": "deleted",
|
|
3292
3299
|
"introduced": "0.6.0",
|
|
3293
3300
|
"deprecated": "0.6.2",
|
|
3301
|
+
"deleted": "0.10.5",
|
|
3294
3302
|
"replacement": "color.background.selected.[default].pressed",
|
|
3295
3303
|
"description": "Pressed state for color.background.brand"
|
|
3296
3304
|
},
|
|
@@ -3427,9 +3435,10 @@ var tokens = [{
|
|
|
3427
3435
|
}, {
|
|
3428
3436
|
"attributes": {
|
|
3429
3437
|
"group": "paint",
|
|
3430
|
-
"state": "
|
|
3438
|
+
"state": "deleted",
|
|
3431
3439
|
"introduced": "0.1.0",
|
|
3432
3440
|
"deprecated": "0.6.0",
|
|
3441
|
+
"deleted": "0.10.5",
|
|
3433
3442
|
"replacement": "color.background.selected.[default].[default]",
|
|
3434
3443
|
"description": "Use for backgrounds of elements in a selected state"
|
|
3435
3444
|
},
|
|
@@ -3439,9 +3448,10 @@ var tokens = [{
|
|
|
3439
3448
|
"original": {
|
|
3440
3449
|
"attributes": {
|
|
3441
3450
|
"group": "paint",
|
|
3442
|
-
"state": "
|
|
3451
|
+
"state": "deleted",
|
|
3443
3452
|
"introduced": "0.1.0",
|
|
3444
3453
|
"deprecated": "0.6.0",
|
|
3454
|
+
"deleted": "0.10.5",
|
|
3445
3455
|
"replacement": "color.background.selected.[default].[default]",
|
|
3446
3456
|
"description": "Use for backgrounds of elements in a selected state"
|
|
3447
3457
|
},
|
|
@@ -3452,9 +3462,10 @@ var tokens = [{
|
|
|
3452
3462
|
}, {
|
|
3453
3463
|
"attributes": {
|
|
3454
3464
|
"group": "paint",
|
|
3455
|
-
"state": "
|
|
3465
|
+
"state": "deleted",
|
|
3456
3466
|
"introduced": "0.1.0",
|
|
3457
3467
|
"deprecated": "0.6.0",
|
|
3468
|
+
"deleted": "0.10.5",
|
|
3458
3469
|
"replacement": "color.background.selected.[default].hovered",
|
|
3459
3470
|
"description": "Hover state for color.background.selected"
|
|
3460
3471
|
},
|
|
@@ -3464,9 +3475,10 @@ var tokens = [{
|
|
|
3464
3475
|
"original": {
|
|
3465
3476
|
"attributes": {
|
|
3466
3477
|
"group": "paint",
|
|
3467
|
-
"state": "
|
|
3478
|
+
"state": "deleted",
|
|
3468
3479
|
"introduced": "0.1.0",
|
|
3469
3480
|
"deprecated": "0.6.0",
|
|
3481
|
+
"deleted": "0.10.5",
|
|
3470
3482
|
"replacement": "color.background.selected.[default].hovered",
|
|
3471
3483
|
"description": "Hover state for color.background.selected"
|
|
3472
3484
|
},
|
|
@@ -4755,9 +4767,10 @@ var tokens = [{
|
|
|
4755
4767
|
}, {
|
|
4756
4768
|
"attributes": {
|
|
4757
4769
|
"group": "paint",
|
|
4758
|
-
"state": "
|
|
4770
|
+
"state": "deleted",
|
|
4759
4771
|
"introduced": "0.0.15",
|
|
4760
4772
|
"deprecated": "0.6.0",
|
|
4773
|
+
"deleted": "0.10.5",
|
|
4761
4774
|
"replacement": "color.background.selected.[default].hovered",
|
|
4762
4775
|
"description": "Hover state for background.subtleBrand"
|
|
4763
4776
|
},
|
|
@@ -4767,9 +4780,10 @@ var tokens = [{
|
|
|
4767
4780
|
"original": {
|
|
4768
4781
|
"attributes": {
|
|
4769
4782
|
"group": "paint",
|
|
4770
|
-
"state": "
|
|
4783
|
+
"state": "deleted",
|
|
4771
4784
|
"introduced": "0.0.15",
|
|
4772
4785
|
"deprecated": "0.6.0",
|
|
4786
|
+
"deleted": "0.10.5",
|
|
4773
4787
|
"replacement": "color.background.selected.[default].hovered",
|
|
4774
4788
|
"description": "Hover state for background.subtleBrand"
|
|
4775
4789
|
},
|
|
@@ -4780,9 +4794,10 @@ var tokens = [{
|
|
|
4780
4794
|
}, {
|
|
4781
4795
|
"attributes": {
|
|
4782
4796
|
"group": "paint",
|
|
4783
|
-
"state": "
|
|
4797
|
+
"state": "deleted",
|
|
4784
4798
|
"introduced": "0.0.15",
|
|
4785
4799
|
"deprecated": "0.6.0",
|
|
4800
|
+
"deleted": "0.10.5",
|
|
4786
4801
|
"replacement": "color.background.selected.[default].pressed",
|
|
4787
4802
|
"description": "Pressed state for background.subtleBrand"
|
|
4788
4803
|
},
|
|
@@ -4792,9 +4807,10 @@ var tokens = [{
|
|
|
4792
4807
|
"original": {
|
|
4793
4808
|
"attributes": {
|
|
4794
4809
|
"group": "paint",
|
|
4795
|
-
"state": "
|
|
4810
|
+
"state": "deleted",
|
|
4796
4811
|
"introduced": "0.0.15",
|
|
4797
4812
|
"deprecated": "0.6.0",
|
|
4813
|
+
"deleted": "0.10.5",
|
|
4798
4814
|
"replacement": "color.background.selected.[default].pressed",
|
|
4799
4815
|
"description": "Pressed state for background.subtleBrand"
|
|
4800
4816
|
},
|
|
@@ -4805,9 +4821,10 @@ var tokens = [{
|
|
|
4805
4821
|
}, {
|
|
4806
4822
|
"attributes": {
|
|
4807
4823
|
"group": "paint",
|
|
4808
|
-
"state": "
|
|
4824
|
+
"state": "deleted",
|
|
4809
4825
|
"introduced": "0.0.15",
|
|
4810
4826
|
"deprecated": "0.6.0",
|
|
4827
|
+
"deleted": "0.10.5",
|
|
4811
4828
|
"replacement": "color.background.selected.[default].[default]",
|
|
4812
4829
|
"description": "Use for subdued backgrounds of UI elements like information section messages and in progress lozenges."
|
|
4813
4830
|
},
|
|
@@ -4817,9 +4834,10 @@ var tokens = [{
|
|
|
4817
4834
|
"original": {
|
|
4818
4835
|
"attributes": {
|
|
4819
4836
|
"group": "paint",
|
|
4820
|
-
"state": "
|
|
4837
|
+
"state": "deleted",
|
|
4821
4838
|
"introduced": "0.0.15",
|
|
4822
4839
|
"deprecated": "0.6.0",
|
|
4840
|
+
"deleted": "0.10.5",
|
|
4823
4841
|
"replacement": "color.background.selected.[default].[default]",
|
|
4824
4842
|
"description": "Use for subdued backgrounds of UI elements like information section messages and in progress lozenges."
|
|
4825
4843
|
},
|
|
@@ -4,75 +4,79 @@ import tokenNames from '../artifacts/token-names';
|
|
|
4
4
|
export default function plugin() {
|
|
5
5
|
return {
|
|
6
6
|
visitor: {
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Program: {
|
|
8
|
+
enter: function enter(path, state) {
|
|
9
|
+
path.traverse({
|
|
10
|
+
CallExpression: function (_CallExpression) {
|
|
11
|
+
function CallExpression(_x) {
|
|
12
|
+
return _CallExpression.apply(this, arguments);
|
|
13
|
+
}
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
CallExpression.toString = function () {
|
|
16
|
+
return _CallExpression.toString();
|
|
17
|
+
};
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
return CallExpression;
|
|
20
|
+
}(function (path) {
|
|
21
|
+
var tokenImportScope = getTokenImportScope(path);
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
if (!tokenImportScope) {
|
|
24
|
+
return;
|
|
25
|
+
} // Check arguments have correct format
|
|
23
26
|
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
if (!path.node.arguments[0]) {
|
|
29
|
+
throw new Error("token() requires at least one argument");
|
|
30
|
+
} else if (!t.isStringLiteral(path.node.arguments[0])) {
|
|
31
|
+
throw new Error("token() must have a string as the first argument");
|
|
32
|
+
} else if (path.node.arguments.length > 2) {
|
|
33
|
+
throw new Error("token() does not accept ".concat(path.node.arguments.length, " arguments"));
|
|
34
|
+
} // Check the token exists
|
|
32
35
|
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
var tokenName = path.node.arguments[0].value;
|
|
38
|
+
var cssTokenValue = tokenNames[tokenName];
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
if (!cssTokenValue) {
|
|
41
|
+
throw new Error("token '".concat(tokenName, "' does not exist"));
|
|
42
|
+
}
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
var replacementNode; // if no fallback is set, optionally find one from the default theme
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
if (path.node.arguments.length < 2) {
|
|
47
|
+
if (state.opts.shouldUseAutoFallback) {
|
|
48
|
+
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ", ").concat(getDefaultFallback(tokenName), ")"));
|
|
49
|
+
} else {
|
|
50
|
+
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ")"));
|
|
51
|
+
}
|
|
52
|
+
} // Handle fallbacks
|
|
50
53
|
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
var fallback = path.node.arguments[1];
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
if (t.isStringLiteral(fallback)) {
|
|
58
|
+
// String literals can be concatenated into css variable call
|
|
59
|
+
// Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
|
|
60
|
+
replacementNode = t.stringLiteral(fallback.value ? "var(".concat(cssTokenValue, ", ").concat(fallback.value, ")") : "var(".concat(cssTokenValue, ")"));
|
|
61
|
+
} else if (t.isExpression(fallback)) {
|
|
62
|
+
// Expressions should be placed in a template string/literal
|
|
63
|
+
replacementNode = t.templateLiteral([t.templateElement({
|
|
64
|
+
cooked: "var(".concat(cssTokenValue, ", "),
|
|
65
|
+
// Currently we create a "raw" value by inserting escape characters via regex (https://github.com/babel/babel/issues/9242)
|
|
66
|
+
raw: "var(".concat(cssTokenValue.replace(/\\|`|\${/g, '\\$&'), ", ")
|
|
67
|
+
}, false), t.templateElement({
|
|
68
|
+
raw: ')',
|
|
69
|
+
cooked: ')'
|
|
70
|
+
}, true)], [fallback]);
|
|
71
|
+
} // Replace path and call scope.crawl() to refresh the scope bindings + references
|
|
69
72
|
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
replacementNode && path.replaceWith(replacementNode); // @ts-ignore crawl is a valid property
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
tokenImportScope.crawl();
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
},
|
|
76
80
|
exit: function exit(path) {
|
|
77
81
|
path.traverse({
|
|
78
82
|
ImportDeclaration: function ImportDeclaration(path) {
|
package/dist/esm/constants.js
CHANGED
package/dist/esm/get-token.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
|
+
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
3
4
|
var name = "@atlaskit/tokens";
|
|
4
|
-
var version = "0.10.
|
|
5
|
+
var version = "0.10.6";
|
|
5
6
|
|
|
6
7
|
function token(path, fallback) {
|
|
7
8
|
var token = tokens[path];
|
|
8
9
|
|
|
9
10
|
if (process.env.NODE_ENV !== 'production' && !token) {
|
|
10
|
-
warnOnce("Unknown token id at path: ".concat(path, " for ").concat(name, "@").concat(version));
|
|
11
11
|
token = tokens['utility.UNSAFE_util.MISSING_TOKEN'];
|
|
12
|
+
warnOnce("Unknown token id at path: ".concat(path, " for ").concat(name, "@").concat(version));
|
|
13
|
+
} // if the token is not found - replacing it with variable name without any value, to avoid it being undefined which would result in invalid css
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
if (!token) {
|
|
17
|
+
token = TOKEN_NOT_FOUND_CSS_VAR;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
var tokenCall = fallback ? "var(".concat(token, ", ").concat(fallback, ")") : "var(".concat(token, ")");
|