@atlaskit/tokens 1.11.3 → 1.13.0
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 +30 -0
- package/dist/cjs/artifacts/atlassian-dark-token-value-for-contrast-check.js +25 -0
- package/dist/cjs/artifacts/atlassian-light-token-value-for-contrast-check.js +25 -0
- package/dist/cjs/artifacts/generated-pairs.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-dark.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-legacy-dark.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/cjs/artifacts/themes/atlassian-light.js +2 -2
- package/dist/cjs/artifacts/token-default-values.js +7 -1
- package/dist/cjs/artifacts/token-names.js +7 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/cjs/constants.js +3 -1
- package/dist/cjs/custom-theme.js +108 -0
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/set-global-theme.js +156 -59
- package/dist/cjs/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/cjs/tokens/atlassian-light/color/background.js +22 -0
- package/dist/cjs/tokens/default/color/background.js +54 -2
- package/dist/cjs/utils/color-utils.js +178 -0
- package/dist/cjs/utils/custom-theme-loading-utils.js +47 -0
- package/dist/cjs/utils/custom-theme-token-contrast-check.js +74 -0
- package/dist/cjs/utils/generate-custom-color-ramp.js +222 -0
- package/dist/cjs/utils/hash.js +17 -0
- package/dist/cjs/utils/hct-color-utils/color-utils.js +310 -0
- package/dist/cjs/utils/hct-color-utils/contrast.js +188 -0
- package/dist/cjs/utils/hct-color-utils/hct.js +1036 -0
- package/dist/cjs/utils/hct-color-utils/index.js +32 -0
- package/dist/cjs/utils/hct-color-utils/math-utils.js +159 -0
- package/dist/cjs/utils/theme-loading.js +1 -1
- package/dist/cjs/utils/theme-state-transformer.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/atlassian-dark-token-value-for-contrast-check.js +18 -0
- package/dist/es2019/artifacts/atlassian-light-token-value-for-contrast-check.js +18 -0
- package/dist/es2019/artifacts/generated-pairs.js +2 -2
- package/dist/es2019/artifacts/themes/atlassian-dark.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-dark.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-legacy-light.js +7 -1
- package/dist/es2019/artifacts/themes/atlassian-light.js +7 -1
- package/dist/es2019/artifacts/token-default-values.js +7 -1
- package/dist/es2019/artifacts/token-names.js +7 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/custom-theme.js +77 -0
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/set-global-theme.js +67 -13
- package/dist/es2019/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/es2019/tokens/atlassian-light/color/background.js +22 -0
- package/dist/es2019/tokens/default/color/background.js +54 -2
- package/dist/es2019/utils/color-utils.js +154 -0
- package/dist/es2019/utils/custom-theme-loading-utils.js +31 -0
- package/dist/es2019/utils/custom-theme-token-contrast-check.js +68 -0
- package/dist/es2019/utils/generate-custom-color-ramp.js +198 -0
- package/dist/es2019/utils/hash.js +10 -0
- package/dist/es2019/utils/hct-color-utils/color-utils.js +286 -0
- package/dist/es2019/utils/hct-color-utils/contrast.js +161 -0
- package/dist/es2019/utils/hct-color-utils/hct.js +931 -0
- package/dist/es2019/utils/hct-color-utils/index.js +3 -0
- package/dist/es2019/utils/hct-color-utils/math-utils.js +145 -0
- package/dist/es2019/utils/theme-loading.js +2 -2
- package/dist/es2019/utils/theme-state-transformer.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/atlassian-dark-token-value-for-contrast-check.js +18 -0
- package/dist/esm/artifacts/atlassian-light-token-value-for-contrast-check.js +18 -0
- package/dist/esm/artifacts/generated-pairs.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-dark.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-legacy-dark.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-legacy-light.js +2 -2
- package/dist/esm/artifacts/themes/atlassian-light.js +2 -2
- package/dist/esm/artifacts/token-default-values.js +7 -1
- package/dist/esm/artifacts/token-names.js +7 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +137 -5
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +137 -5
- package/dist/esm/constants.js +1 -0
- package/dist/esm/custom-theme.js +98 -0
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/set-global-theme.js +149 -60
- package/dist/esm/tokens/atlassian-dark/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-legacy-dark/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-legacy-light/color/background.js +22 -0
- package/dist/esm/tokens/atlassian-light/color/background.js +22 -0
- package/dist/esm/tokens/default/color/background.js +54 -2
- package/dist/esm/utils/color-utils.js +162 -0
- package/dist/esm/utils/custom-theme-loading-utils.js +38 -0
- package/dist/esm/utils/custom-theme-token-contrast-check.js +65 -0
- package/dist/esm/utils/generate-custom-color-ramp.js +211 -0
- package/dist/esm/utils/hash.js +10 -0
- package/dist/esm/utils/hct-color-utils/color-utils.js +285 -0
- package/dist/esm/utils/hct-color-utils/contrast.js +181 -0
- package/dist/esm/utils/hct-color-utils/hct.js +1029 -0
- package/dist/esm/utils/hct-color-utils/index.js +3 -0
- package/dist/esm/utils/hct-color-utils/math-utils.js +145 -0
- package/dist/esm/utils/theme-loading.js +2 -2
- package/dist/esm/utils/theme-state-transformer.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types/artifacts/themes/atlassian-dark.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-light.d.ts +2 -2
- package/dist/types/artifacts/token-default-values.d.ts +7 -1
- package/dist/types/artifacts/token-names.d.ts +13 -1
- package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/custom-theme.d.ts +30 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/set-global-theme.d.ts +9 -3
- package/dist/types/types.d.ts +10 -0
- package/dist/types/utils/color-utils.d.ts +10 -0
- package/dist/types/utils/custom-theme-loading-utils.d.ts +11 -0
- package/dist/types/utils/custom-theme-token-contrast-check.d.ts +20 -0
- package/dist/types/utils/generate-custom-color-ramp.d.ts +19 -0
- package/dist/types/utils/hash.d.ts +1 -0
- package/dist/types/utils/hct-color-utils/color-utils.d.ts +131 -0
- package/dist/types/utils/hct-color-utils/contrast.d.ts +78 -0
- package/dist/types/utils/hct-color-utils/hct.d.ts +137 -0
- package/dist/types/utils/hct-color-utils/index.d.ts +3 -0
- package/dist/types/utils/hct-color-utils/math-utils.d.ts +86 -0
- package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +18 -0
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/themes/atlassian-dark.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-dark.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-legacy-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-light.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +7 -1
- package/dist/types-ts4.5/artifacts/token-names.d.ts +13 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/custom-theme.d.ts +30 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/set-global-theme.d.ts +9 -3
- package/dist/types-ts4.5/types.d.ts +10 -0
- package/dist/types-ts4.5/utils/color-utils.d.ts +27 -0
- package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +11 -0
- package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +20 -0
- package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +19 -0
- package/dist/types-ts4.5/utils/hash.d.ts +1 -0
- package/dist/types-ts4.5/utils/hct-color-utils/color-utils.d.ts +131 -0
- package/dist/types-ts4.5/utils/hct-color-utils/contrast.d.ts +78 -0
- package/dist/types-ts4.5/utils/hct-color-utils/hct.d.ts +137 -0
- package/dist/types-ts4.5/utils/hct-color-utils/index.d.ts +3 -0
- package/dist/types-ts4.5/utils/hct-color-utils/math-utils.d.ts +86 -0
- package/figma/atlassian-dark.json +56 -2
- package/figma/atlassian-legacy-dark.json +56 -2
- package/figma/atlassian-legacy-light.json +56 -2
- package/figma/atlassian-light.json +56 -2
- package/package.json +36 -37
- package/report.api.md +48 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -902
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-iteration.js +0 -895
- package/dist/types/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-iteration.d.ts +0 -91
- package/tmp/api-report-tmp.d.ts +0 -1132
|
@@ -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::6601df15e45294ebfb575b1b034a2aa7>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -3127,6 +3127,72 @@ var tokens = [{
|
|
|
3127
3127
|
"name": "color.background.selected.bold.pressed",
|
|
3128
3128
|
"path": ["color", "background", "selected", "bold", "pressed"],
|
|
3129
3129
|
"cleanName": "color.background.selected.bold.pressed"
|
|
3130
|
+
}, {
|
|
3131
|
+
"attributes": {
|
|
3132
|
+
"group": "paint",
|
|
3133
|
+
"state": "active",
|
|
3134
|
+
"introduced": "1.13.0",
|
|
3135
|
+
"description": "Use for the background of elements used to reinforce our brand, but with less emphasis."
|
|
3136
|
+
},
|
|
3137
|
+
"value": "#0747A6",
|
|
3138
|
+
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
3139
|
+
"isSource": true,
|
|
3140
|
+
"original": {
|
|
3141
|
+
"attributes": {
|
|
3142
|
+
"group": "paint",
|
|
3143
|
+
"state": "active",
|
|
3144
|
+
"introduced": "1.13.0",
|
|
3145
|
+
"description": "Use for the background of elements used to reinforce our brand, but with less emphasis."
|
|
3146
|
+
},
|
|
3147
|
+
"value": "B500"
|
|
3148
|
+
},
|
|
3149
|
+
"name": "color.background.brand.subtlest.[default]",
|
|
3150
|
+
"path": ["color", "background", "brand", "subtlest", "[default]"],
|
|
3151
|
+
"cleanName": "color.background.brand.subtlest"
|
|
3152
|
+
}, {
|
|
3153
|
+
"attributes": {
|
|
3154
|
+
"group": "paint",
|
|
3155
|
+
"state": "active",
|
|
3156
|
+
"introduced": "1.13.0",
|
|
3157
|
+
"description": "Hovered state of color.background.brand.subtlest."
|
|
3158
|
+
},
|
|
3159
|
+
"value": "#0052CC",
|
|
3160
|
+
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
3161
|
+
"isSource": true,
|
|
3162
|
+
"original": {
|
|
3163
|
+
"attributes": {
|
|
3164
|
+
"group": "paint",
|
|
3165
|
+
"state": "active",
|
|
3166
|
+
"introduced": "1.13.0",
|
|
3167
|
+
"description": "Hovered state of color.background.brand.subtlest."
|
|
3168
|
+
},
|
|
3169
|
+
"value": "B400"
|
|
3170
|
+
},
|
|
3171
|
+
"name": "color.background.brand.subtlest.hovered",
|
|
3172
|
+
"path": ["color", "background", "brand", "subtlest", "hovered"],
|
|
3173
|
+
"cleanName": "color.background.brand.subtlest.hovered"
|
|
3174
|
+
}, {
|
|
3175
|
+
"attributes": {
|
|
3176
|
+
"group": "paint",
|
|
3177
|
+
"state": "active",
|
|
3178
|
+
"introduced": "1.13.0",
|
|
3179
|
+
"description": "Pressed state of color.background.brand.subtlest"
|
|
3180
|
+
},
|
|
3181
|
+
"value": "#0747A6",
|
|
3182
|
+
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
3183
|
+
"isSource": true,
|
|
3184
|
+
"original": {
|
|
3185
|
+
"attributes": {
|
|
3186
|
+
"group": "paint",
|
|
3187
|
+
"state": "active",
|
|
3188
|
+
"introduced": "1.13.0",
|
|
3189
|
+
"description": "Pressed state of color.background.brand.subtlest"
|
|
3190
|
+
},
|
|
3191
|
+
"value": "B500"
|
|
3192
|
+
},
|
|
3193
|
+
"name": "color.background.brand.subtlest.pressed",
|
|
3194
|
+
"path": ["color", "background", "brand", "subtlest", "pressed"],
|
|
3195
|
+
"cleanName": "color.background.brand.subtlest.pressed"
|
|
3130
3196
|
}, {
|
|
3131
3197
|
"attributes": {
|
|
3132
3198
|
"group": "paint",
|
|
@@ -3154,7 +3220,7 @@ var tokens = [{
|
|
|
3154
3220
|
"group": "paint",
|
|
3155
3221
|
"state": "active",
|
|
3156
3222
|
"introduced": "0.6.0",
|
|
3157
|
-
"description": "Hovered state of color.background.brand.bold"
|
|
3223
|
+
"description": "Hovered state of color.background.brand.bold."
|
|
3158
3224
|
},
|
|
3159
3225
|
"value": "#0065FF",
|
|
3160
3226
|
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
@@ -3164,7 +3230,7 @@ var tokens = [{
|
|
|
3164
3230
|
"group": "paint",
|
|
3165
3231
|
"state": "active",
|
|
3166
3232
|
"introduced": "0.6.0",
|
|
3167
|
-
"description": "Hovered state of color.background.brand.bold"
|
|
3233
|
+
"description": "Hovered state of color.background.brand.bold."
|
|
3168
3234
|
},
|
|
3169
3235
|
"value": "B300"
|
|
3170
3236
|
},
|
|
@@ -3176,7 +3242,7 @@ var tokens = [{
|
|
|
3176
3242
|
"group": "paint",
|
|
3177
3243
|
"state": "active",
|
|
3178
3244
|
"introduced": "0.6.0",
|
|
3179
|
-
"description": "Pressed state of color.background.brand.bold"
|
|
3245
|
+
"description": "Pressed state of color.background.brand.bold."
|
|
3180
3246
|
},
|
|
3181
3247
|
"value": "#0747A6",
|
|
3182
3248
|
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
@@ -3186,13 +3252,79 @@ var tokens = [{
|
|
|
3186
3252
|
"group": "paint",
|
|
3187
3253
|
"state": "active",
|
|
3188
3254
|
"introduced": "0.6.0",
|
|
3189
|
-
"description": "Pressed state of color.background.brand.bold"
|
|
3255
|
+
"description": "Pressed state of color.background.brand.bold."
|
|
3190
3256
|
},
|
|
3191
3257
|
"value": "B500"
|
|
3192
3258
|
},
|
|
3193
3259
|
"name": "color.background.brand.bold.pressed",
|
|
3194
3260
|
"path": ["color", "background", "brand", "bold", "pressed"],
|
|
3195
3261
|
"cleanName": "color.background.brand.bold.pressed"
|
|
3262
|
+
}, {
|
|
3263
|
+
"attributes": {
|
|
3264
|
+
"group": "paint",
|
|
3265
|
+
"state": "active",
|
|
3266
|
+
"introduced": "1.13.0",
|
|
3267
|
+
"description": "Use for the background of elements used to reinforce our brand, that need to stand out a lot."
|
|
3268
|
+
},
|
|
3269
|
+
"value": "#B3D4FF",
|
|
3270
|
+
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
3271
|
+
"isSource": true,
|
|
3272
|
+
"original": {
|
|
3273
|
+
"attributes": {
|
|
3274
|
+
"group": "paint",
|
|
3275
|
+
"state": "active",
|
|
3276
|
+
"introduced": "1.13.0",
|
|
3277
|
+
"description": "Use for the background of elements used to reinforce our brand, that need to stand out a lot."
|
|
3278
|
+
},
|
|
3279
|
+
"value": "B75"
|
|
3280
|
+
},
|
|
3281
|
+
"name": "color.background.brand.boldest.[default]",
|
|
3282
|
+
"path": ["color", "background", "brand", "boldest", "[default]"],
|
|
3283
|
+
"cleanName": "color.background.brand.boldest"
|
|
3284
|
+
}, {
|
|
3285
|
+
"attributes": {
|
|
3286
|
+
"group": "paint",
|
|
3287
|
+
"state": "active",
|
|
3288
|
+
"introduced": "1.13.0",
|
|
3289
|
+
"description": "Hovered state of color.background.brand.boldest."
|
|
3290
|
+
},
|
|
3291
|
+
"value": "#DEEBFF",
|
|
3292
|
+
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
3293
|
+
"isSource": true,
|
|
3294
|
+
"original": {
|
|
3295
|
+
"attributes": {
|
|
3296
|
+
"group": "paint",
|
|
3297
|
+
"state": "active",
|
|
3298
|
+
"introduced": "1.13.0",
|
|
3299
|
+
"description": "Hovered state of color.background.brand.boldest."
|
|
3300
|
+
},
|
|
3301
|
+
"value": "B50"
|
|
3302
|
+
},
|
|
3303
|
+
"name": "color.background.brand.boldest.hovered",
|
|
3304
|
+
"path": ["color", "background", "brand", "boldest", "hovered"],
|
|
3305
|
+
"cleanName": "color.background.brand.boldest.hovered"
|
|
3306
|
+
}, {
|
|
3307
|
+
"attributes": {
|
|
3308
|
+
"group": "paint",
|
|
3309
|
+
"state": "active",
|
|
3310
|
+
"introduced": "1.13.0",
|
|
3311
|
+
"description": "Pressed state of color.background.brand.boldest."
|
|
3312
|
+
},
|
|
3313
|
+
"value": "#4C9AFF",
|
|
3314
|
+
"filePath": "src/tokens/atlassian-legacy-dark/color/background.tsx",
|
|
3315
|
+
"isSource": true,
|
|
3316
|
+
"original": {
|
|
3317
|
+
"attributes": {
|
|
3318
|
+
"group": "paint",
|
|
3319
|
+
"state": "active",
|
|
3320
|
+
"introduced": "1.13.0",
|
|
3321
|
+
"description": "Pressed state of color.background.brand.boldest."
|
|
3322
|
+
},
|
|
3323
|
+
"value": "B100"
|
|
3324
|
+
},
|
|
3325
|
+
"name": "color.background.brand.boldest.pressed",
|
|
3326
|
+
"path": ["color", "background", "brand", "boldest", "pressed"],
|
|
3327
|
+
"cleanName": "color.background.brand.boldest.pressed"
|
|
3196
3328
|
}, {
|
|
3197
3329
|
"attributes": {
|
|
3198
3330
|
"group": "paint",
|
|
@@ -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::8b7aab21b157bced2314e03774c8445e>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -3127,6 +3127,72 @@ var tokens = [{
|
|
|
3127
3127
|
"name": "color.background.selected.bold.pressed",
|
|
3128
3128
|
"path": ["color", "background", "selected", "bold", "pressed"],
|
|
3129
3129
|
"cleanName": "color.background.selected.bold.pressed"
|
|
3130
|
+
}, {
|
|
3131
|
+
"attributes": {
|
|
3132
|
+
"group": "paint",
|
|
3133
|
+
"state": "active",
|
|
3134
|
+
"introduced": "1.13.0",
|
|
3135
|
+
"description": "Use for the background of elements used to reinforce our brand, but with less emphasis."
|
|
3136
|
+
},
|
|
3137
|
+
"value": "#B3D4FF",
|
|
3138
|
+
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
3139
|
+
"isSource": true,
|
|
3140
|
+
"original": {
|
|
3141
|
+
"attributes": {
|
|
3142
|
+
"group": "paint",
|
|
3143
|
+
"state": "active",
|
|
3144
|
+
"introduced": "1.13.0",
|
|
3145
|
+
"description": "Use for the background of elements used to reinforce our brand, but with less emphasis."
|
|
3146
|
+
},
|
|
3147
|
+
"value": "B75"
|
|
3148
|
+
},
|
|
3149
|
+
"name": "color.background.brand.subtlest.[default]",
|
|
3150
|
+
"path": ["color", "background", "brand", "subtlest", "[default]"],
|
|
3151
|
+
"cleanName": "color.background.brand.subtlest"
|
|
3152
|
+
}, {
|
|
3153
|
+
"attributes": {
|
|
3154
|
+
"group": "paint",
|
|
3155
|
+
"state": "active",
|
|
3156
|
+
"introduced": "1.13.0",
|
|
3157
|
+
"description": "Hovered state of color.background.brand.subtlest."
|
|
3158
|
+
},
|
|
3159
|
+
"value": "#DEEBFF",
|
|
3160
|
+
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
3161
|
+
"isSource": true,
|
|
3162
|
+
"original": {
|
|
3163
|
+
"attributes": {
|
|
3164
|
+
"group": "paint",
|
|
3165
|
+
"state": "active",
|
|
3166
|
+
"introduced": "1.13.0",
|
|
3167
|
+
"description": "Hovered state of color.background.brand.subtlest."
|
|
3168
|
+
},
|
|
3169
|
+
"value": "B50"
|
|
3170
|
+
},
|
|
3171
|
+
"name": "color.background.brand.subtlest.hovered",
|
|
3172
|
+
"path": ["color", "background", "brand", "subtlest", "hovered"],
|
|
3173
|
+
"cleanName": "color.background.brand.subtlest.hovered"
|
|
3174
|
+
}, {
|
|
3175
|
+
"attributes": {
|
|
3176
|
+
"group": "paint",
|
|
3177
|
+
"state": "active",
|
|
3178
|
+
"introduced": "1.13.0",
|
|
3179
|
+
"description": "Pressed state of color.background.brand.subtlest"
|
|
3180
|
+
},
|
|
3181
|
+
"value": "#4C9AFF",
|
|
3182
|
+
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
3183
|
+
"isSource": true,
|
|
3184
|
+
"original": {
|
|
3185
|
+
"attributes": {
|
|
3186
|
+
"group": "paint",
|
|
3187
|
+
"state": "active",
|
|
3188
|
+
"introduced": "1.13.0",
|
|
3189
|
+
"description": "Pressed state of color.background.brand.subtlest"
|
|
3190
|
+
},
|
|
3191
|
+
"value": "B100"
|
|
3192
|
+
},
|
|
3193
|
+
"name": "color.background.brand.subtlest.pressed",
|
|
3194
|
+
"path": ["color", "background", "brand", "subtlest", "pressed"],
|
|
3195
|
+
"cleanName": "color.background.brand.subtlest.pressed"
|
|
3130
3196
|
}, {
|
|
3131
3197
|
"attributes": {
|
|
3132
3198
|
"group": "paint",
|
|
@@ -3154,7 +3220,7 @@ var tokens = [{
|
|
|
3154
3220
|
"group": "paint",
|
|
3155
3221
|
"state": "active",
|
|
3156
3222
|
"introduced": "0.6.0",
|
|
3157
|
-
"description": "Hovered state of color.background.brand.bold"
|
|
3223
|
+
"description": "Hovered state of color.background.brand.bold."
|
|
3158
3224
|
},
|
|
3159
3225
|
"value": "#0065FF",
|
|
3160
3226
|
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
@@ -3164,7 +3230,7 @@ var tokens = [{
|
|
|
3164
3230
|
"group": "paint",
|
|
3165
3231
|
"state": "active",
|
|
3166
3232
|
"introduced": "0.6.0",
|
|
3167
|
-
"description": "Hovered state of color.background.brand.bold"
|
|
3233
|
+
"description": "Hovered state of color.background.brand.bold."
|
|
3168
3234
|
},
|
|
3169
3235
|
"value": "B300"
|
|
3170
3236
|
},
|
|
@@ -3176,7 +3242,7 @@ var tokens = [{
|
|
|
3176
3242
|
"group": "paint",
|
|
3177
3243
|
"state": "active",
|
|
3178
3244
|
"introduced": "0.6.0",
|
|
3179
|
-
"description": "Pressed state of color.background.brand.bold"
|
|
3245
|
+
"description": "Pressed state of color.background.brand.bold."
|
|
3180
3246
|
},
|
|
3181
3247
|
"value": "#0747A6",
|
|
3182
3248
|
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
@@ -3186,13 +3252,79 @@ var tokens = [{
|
|
|
3186
3252
|
"group": "paint",
|
|
3187
3253
|
"state": "active",
|
|
3188
3254
|
"introduced": "0.6.0",
|
|
3189
|
-
"description": "Pressed state of color.background.brand.bold"
|
|
3255
|
+
"description": "Pressed state of color.background.brand.bold."
|
|
3190
3256
|
},
|
|
3191
3257
|
"value": "B500"
|
|
3192
3258
|
},
|
|
3193
3259
|
"name": "color.background.brand.bold.pressed",
|
|
3194
3260
|
"path": ["color", "background", "brand", "bold", "pressed"],
|
|
3195
3261
|
"cleanName": "color.background.brand.bold.pressed"
|
|
3262
|
+
}, {
|
|
3263
|
+
"attributes": {
|
|
3264
|
+
"group": "paint",
|
|
3265
|
+
"state": "active",
|
|
3266
|
+
"introduced": "1.13.0",
|
|
3267
|
+
"description": "Use for the background of elements used to reinforce our brand, that need to stand out a lot."
|
|
3268
|
+
},
|
|
3269
|
+
"value": "#0747A6",
|
|
3270
|
+
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
3271
|
+
"isSource": true,
|
|
3272
|
+
"original": {
|
|
3273
|
+
"attributes": {
|
|
3274
|
+
"group": "paint",
|
|
3275
|
+
"state": "active",
|
|
3276
|
+
"introduced": "1.13.0",
|
|
3277
|
+
"description": "Use for the background of elements used to reinforce our brand, that need to stand out a lot."
|
|
3278
|
+
},
|
|
3279
|
+
"value": "B500"
|
|
3280
|
+
},
|
|
3281
|
+
"name": "color.background.brand.boldest.[default]",
|
|
3282
|
+
"path": ["color", "background", "brand", "boldest", "[default]"],
|
|
3283
|
+
"cleanName": "color.background.brand.boldest"
|
|
3284
|
+
}, {
|
|
3285
|
+
"attributes": {
|
|
3286
|
+
"group": "paint",
|
|
3287
|
+
"state": "active",
|
|
3288
|
+
"introduced": "1.13.0",
|
|
3289
|
+
"description": "Hovered state of color.background.brand.boldest."
|
|
3290
|
+
},
|
|
3291
|
+
"value": "#0052CC",
|
|
3292
|
+
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
3293
|
+
"isSource": true,
|
|
3294
|
+
"original": {
|
|
3295
|
+
"attributes": {
|
|
3296
|
+
"group": "paint",
|
|
3297
|
+
"state": "active",
|
|
3298
|
+
"introduced": "1.13.0",
|
|
3299
|
+
"description": "Hovered state of color.background.brand.boldest."
|
|
3300
|
+
},
|
|
3301
|
+
"value": "B400"
|
|
3302
|
+
},
|
|
3303
|
+
"name": "color.background.brand.boldest.hovered",
|
|
3304
|
+
"path": ["color", "background", "brand", "boldest", "hovered"],
|
|
3305
|
+
"cleanName": "color.background.brand.boldest.hovered"
|
|
3306
|
+
}, {
|
|
3307
|
+
"attributes": {
|
|
3308
|
+
"group": "paint",
|
|
3309
|
+
"state": "active",
|
|
3310
|
+
"introduced": "1.13.0",
|
|
3311
|
+
"description": "Pressed state of color.background.brand.boldest."
|
|
3312
|
+
},
|
|
3313
|
+
"value": "#0747A6",
|
|
3314
|
+
"filePath": "src/tokens/atlassian-legacy-light/color/background.tsx",
|
|
3315
|
+
"isSource": true,
|
|
3316
|
+
"original": {
|
|
3317
|
+
"attributes": {
|
|
3318
|
+
"group": "paint",
|
|
3319
|
+
"state": "active",
|
|
3320
|
+
"introduced": "1.13.0",
|
|
3321
|
+
"description": "Pressed state of color.background.brand.boldest."
|
|
3322
|
+
},
|
|
3323
|
+
"value": "B500"
|
|
3324
|
+
},
|
|
3325
|
+
"name": "color.background.brand.boldest.pressed",
|
|
3326
|
+
"path": ["color", "background", "brand", "boldest", "pressed"],
|
|
3327
|
+
"cleanName": "color.background.brand.boldest.pressed"
|
|
3196
3328
|
}, {
|
|
3197
3329
|
"attributes": {
|
|
3198
3330
|
"group": "paint",
|
|
@@ -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::c96324369c8a09e129803eff1f33d1e8>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
@@ -3127,6 +3127,72 @@ var tokens = [{
|
|
|
3127
3127
|
"name": "color.background.selected.bold.pressed",
|
|
3128
3128
|
"path": ["color", "background", "selected", "bold", "pressed"],
|
|
3129
3129
|
"cleanName": "color.background.selected.bold.pressed"
|
|
3130
|
+
}, {
|
|
3131
|
+
"attributes": {
|
|
3132
|
+
"group": "paint",
|
|
3133
|
+
"state": "active",
|
|
3134
|
+
"introduced": "1.13.0",
|
|
3135
|
+
"description": "Use for the background of elements used to reinforce our brand, but with less emphasis."
|
|
3136
|
+
},
|
|
3137
|
+
"value": "#E9F2FF",
|
|
3138
|
+
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
3139
|
+
"isSource": true,
|
|
3140
|
+
"original": {
|
|
3141
|
+
"attributes": {
|
|
3142
|
+
"group": "paint",
|
|
3143
|
+
"state": "active",
|
|
3144
|
+
"introduced": "1.13.0",
|
|
3145
|
+
"description": "Use for the background of elements used to reinforce our brand, but with less emphasis."
|
|
3146
|
+
},
|
|
3147
|
+
"value": "Blue100"
|
|
3148
|
+
},
|
|
3149
|
+
"name": "color.background.brand.subtlest.[default]",
|
|
3150
|
+
"path": ["color", "background", "brand", "subtlest", "[default]"],
|
|
3151
|
+
"cleanName": "color.background.brand.subtlest"
|
|
3152
|
+
}, {
|
|
3153
|
+
"attributes": {
|
|
3154
|
+
"group": "paint",
|
|
3155
|
+
"state": "active",
|
|
3156
|
+
"introduced": "1.13.0",
|
|
3157
|
+
"description": "Hovered state of color.background.brand.subtlest."
|
|
3158
|
+
},
|
|
3159
|
+
"value": "#CCE0FF",
|
|
3160
|
+
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
3161
|
+
"isSource": true,
|
|
3162
|
+
"original": {
|
|
3163
|
+
"attributes": {
|
|
3164
|
+
"group": "paint",
|
|
3165
|
+
"state": "active",
|
|
3166
|
+
"introduced": "1.13.0",
|
|
3167
|
+
"description": "Hovered state of color.background.brand.subtlest."
|
|
3168
|
+
},
|
|
3169
|
+
"value": "Blue200"
|
|
3170
|
+
},
|
|
3171
|
+
"name": "color.background.brand.subtlest.hovered",
|
|
3172
|
+
"path": ["color", "background", "brand", "subtlest", "hovered"],
|
|
3173
|
+
"cleanName": "color.background.brand.subtlest.hovered"
|
|
3174
|
+
}, {
|
|
3175
|
+
"attributes": {
|
|
3176
|
+
"group": "paint",
|
|
3177
|
+
"state": "active",
|
|
3178
|
+
"introduced": "1.13.0",
|
|
3179
|
+
"description": "Pressed state of color.background.brand.subtlest"
|
|
3180
|
+
},
|
|
3181
|
+
"value": "#85B8FF",
|
|
3182
|
+
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
3183
|
+
"isSource": true,
|
|
3184
|
+
"original": {
|
|
3185
|
+
"attributes": {
|
|
3186
|
+
"group": "paint",
|
|
3187
|
+
"state": "active",
|
|
3188
|
+
"introduced": "1.13.0",
|
|
3189
|
+
"description": "Pressed state of color.background.brand.subtlest"
|
|
3190
|
+
},
|
|
3191
|
+
"value": "Blue300"
|
|
3192
|
+
},
|
|
3193
|
+
"name": "color.background.brand.subtlest.pressed",
|
|
3194
|
+
"path": ["color", "background", "brand", "subtlest", "pressed"],
|
|
3195
|
+
"cleanName": "color.background.brand.subtlest.pressed"
|
|
3130
3196
|
}, {
|
|
3131
3197
|
"attributes": {
|
|
3132
3198
|
"group": "paint",
|
|
@@ -3154,7 +3220,7 @@ var tokens = [{
|
|
|
3154
3220
|
"group": "paint",
|
|
3155
3221
|
"state": "active",
|
|
3156
3222
|
"introduced": "0.6.0",
|
|
3157
|
-
"description": "Hovered state of color.background.brand.bold"
|
|
3223
|
+
"description": "Hovered state of color.background.brand.bold."
|
|
3158
3224
|
},
|
|
3159
3225
|
"value": "#0055CC",
|
|
3160
3226
|
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
@@ -3164,7 +3230,7 @@ var tokens = [{
|
|
|
3164
3230
|
"group": "paint",
|
|
3165
3231
|
"state": "active",
|
|
3166
3232
|
"introduced": "0.6.0",
|
|
3167
|
-
"description": "Hovered state of color.background.brand.bold"
|
|
3233
|
+
"description": "Hovered state of color.background.brand.bold."
|
|
3168
3234
|
},
|
|
3169
3235
|
"value": "Blue800"
|
|
3170
3236
|
},
|
|
@@ -3176,7 +3242,7 @@ var tokens = [{
|
|
|
3176
3242
|
"group": "paint",
|
|
3177
3243
|
"state": "active",
|
|
3178
3244
|
"introduced": "0.6.0",
|
|
3179
|
-
"description": "Pressed state of color.background.brand.bold"
|
|
3245
|
+
"description": "Pressed state of color.background.brand.bold."
|
|
3180
3246
|
},
|
|
3181
3247
|
"value": "#09326C",
|
|
3182
3248
|
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
@@ -3186,13 +3252,79 @@ var tokens = [{
|
|
|
3186
3252
|
"group": "paint",
|
|
3187
3253
|
"state": "active",
|
|
3188
3254
|
"introduced": "0.6.0",
|
|
3189
|
-
"description": "Pressed state of color.background.brand.bold"
|
|
3255
|
+
"description": "Pressed state of color.background.brand.bold."
|
|
3190
3256
|
},
|
|
3191
3257
|
"value": "Blue900"
|
|
3192
3258
|
},
|
|
3193
3259
|
"name": "color.background.brand.bold.pressed",
|
|
3194
3260
|
"path": ["color", "background", "brand", "bold", "pressed"],
|
|
3195
3261
|
"cleanName": "color.background.brand.bold.pressed"
|
|
3262
|
+
}, {
|
|
3263
|
+
"attributes": {
|
|
3264
|
+
"group": "paint",
|
|
3265
|
+
"state": "active",
|
|
3266
|
+
"introduced": "1.13.0",
|
|
3267
|
+
"description": "Use for the background of elements used to reinforce our brand, that need to stand out a lot."
|
|
3268
|
+
},
|
|
3269
|
+
"value": "#092957",
|
|
3270
|
+
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
3271
|
+
"isSource": true,
|
|
3272
|
+
"original": {
|
|
3273
|
+
"attributes": {
|
|
3274
|
+
"group": "paint",
|
|
3275
|
+
"state": "active",
|
|
3276
|
+
"introduced": "1.13.0",
|
|
3277
|
+
"description": "Use for the background of elements used to reinforce our brand, that need to stand out a lot."
|
|
3278
|
+
},
|
|
3279
|
+
"value": "Blue1000"
|
|
3280
|
+
},
|
|
3281
|
+
"name": "color.background.brand.boldest.[default]",
|
|
3282
|
+
"path": ["color", "background", "brand", "boldest", "[default]"],
|
|
3283
|
+
"cleanName": "color.background.brand.boldest"
|
|
3284
|
+
}, {
|
|
3285
|
+
"attributes": {
|
|
3286
|
+
"group": "paint",
|
|
3287
|
+
"state": "active",
|
|
3288
|
+
"introduced": "1.13.0",
|
|
3289
|
+
"description": "Hovered state of color.background.brand.boldest."
|
|
3290
|
+
},
|
|
3291
|
+
"value": "#09326C",
|
|
3292
|
+
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
3293
|
+
"isSource": true,
|
|
3294
|
+
"original": {
|
|
3295
|
+
"attributes": {
|
|
3296
|
+
"group": "paint",
|
|
3297
|
+
"state": "active",
|
|
3298
|
+
"introduced": "1.13.0",
|
|
3299
|
+
"description": "Hovered state of color.background.brand.boldest."
|
|
3300
|
+
},
|
|
3301
|
+
"value": "Blue900"
|
|
3302
|
+
},
|
|
3303
|
+
"name": "color.background.brand.boldest.hovered",
|
|
3304
|
+
"path": ["color", "background", "brand", "boldest", "hovered"],
|
|
3305
|
+
"cleanName": "color.background.brand.boldest.hovered"
|
|
3306
|
+
}, {
|
|
3307
|
+
"attributes": {
|
|
3308
|
+
"group": "paint",
|
|
3309
|
+
"state": "active",
|
|
3310
|
+
"introduced": "1.13.0",
|
|
3311
|
+
"description": "Pressed state of color.background.brand.boldest."
|
|
3312
|
+
},
|
|
3313
|
+
"value": "#0055CC",
|
|
3314
|
+
"filePath": "src/tokens/atlassian-light/color/background.tsx",
|
|
3315
|
+
"isSource": true,
|
|
3316
|
+
"original": {
|
|
3317
|
+
"attributes": {
|
|
3318
|
+
"group": "paint",
|
|
3319
|
+
"state": "active",
|
|
3320
|
+
"introduced": "1.13.0",
|
|
3321
|
+
"description": "Pressed state of color.background.brand.boldest."
|
|
3322
|
+
},
|
|
3323
|
+
"value": "Blue800"
|
|
3324
|
+
},
|
|
3325
|
+
"name": "color.background.brand.boldest.pressed",
|
|
3326
|
+
"path": ["color", "background", "brand", "boldest", "pressed"],
|
|
3327
|
+
"cleanName": "color.background.brand.boldest.pressed"
|
|
3196
3328
|
}, {
|
|
3197
3329
|
"attributes": {
|
|
3198
3330
|
"group": "paint",
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export var THEME_DATA_ATTRIBUTE = 'data-theme';
|
|
2
2
|
export var COLOR_MODE_ATTRIBUTE = 'data-color-mode';
|
|
3
|
+
export var CUSTOM_THEME_ATTRIBUTE = 'data-custom-theme';
|
|
3
4
|
export var DEFAULT_THEME = 'light';
|
|
4
5
|
export var CSS_PREFIX = 'ds';
|
|
5
6
|
export var CSS_VAR_FULL = ['opacity', 'font', 'space', 'border'];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { COLOR_MODE_ATTRIBUTE, CUSTOM_THEME_ATTRIBUTE } from './constants';
|
|
4
|
+
import { themeStateDefaults } from './set-global-theme';
|
|
5
|
+
import { limitSizeOfCustomStyleElements, reduceTokenMap } from './utils/custom-theme-loading-utils';
|
|
6
|
+
import { generateColors, generateTokenMapWithContrastCheck } from './utils/generate-custom-color-ramp';
|
|
7
|
+
import { hash } from './utils/hash';
|
|
8
|
+
export var CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD = 10;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param themeSchema The schema of available themes
|
|
12
|
+
* @returns a string with the CSS for the custom theme
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Takes a color mode and custom branding options, and returns an array of objects for use in applying custom styles to the document head.
|
|
16
|
+
* Only supplies the color themes necessary for initial render, based on the current themeState. I.e. if in light mode, dark mode themes are not returned.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object<string, string>} themeState The themes and color mode that should be applied.
|
|
19
|
+
* @param {string} themeState.colorMode Determines which color theme is applied
|
|
20
|
+
* @param {Object} themeState.UNSAFE_themeOptions The custom branding options to be used for custom theme generation
|
|
21
|
+
*
|
|
22
|
+
* @returns A Promise of an object array, containing theme IDs, data-attributes to attach to the theme, and the theme CSS.
|
|
23
|
+
* If an error is encountered while loading themes, the themes array will be empty.
|
|
24
|
+
*/
|
|
25
|
+
export function getCustomThemeStyles(_x) {
|
|
26
|
+
return _getCustomThemeStyles.apply(this, arguments);
|
|
27
|
+
}
|
|
28
|
+
function _getCustomThemeStyles() {
|
|
29
|
+
_getCustomThemeStyles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(themeState) {
|
|
30
|
+
var _themeState$UNSAFE_th;
|
|
31
|
+
var brandColor, mode, optionString, uniqueId, themeRamp, themes, tokenMaps;
|
|
32
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
brandColor = themeState === null || themeState === void 0 ? void 0 : (_themeState$UNSAFE_th = themeState.UNSAFE_themeOptions) === null || _themeState$UNSAFE_th === void 0 ? void 0 : _themeState$UNSAFE_th.brandColor;
|
|
36
|
+
mode = (themeState === null || themeState === void 0 ? void 0 : themeState.colorMode) || themeStateDefaults['colorMode'];
|
|
37
|
+
optionString = JSON.stringify(themeState === null || themeState === void 0 ? void 0 : themeState.UNSAFE_themeOptions);
|
|
38
|
+
uniqueId = hash(optionString);
|
|
39
|
+
themeRamp = generateColors(brandColor); // outputs object to generate to CSS from
|
|
40
|
+
themes = [];
|
|
41
|
+
tokenMaps = generateTokenMapWithContrastCheck(brandColor, mode, themeRamp);
|
|
42
|
+
if ((mode === 'light' || mode === 'auto') && tokenMaps.light) {
|
|
43
|
+
// Light mode theming
|
|
44
|
+
themes.push({
|
|
45
|
+
id: 'light',
|
|
46
|
+
attrs: {
|
|
47
|
+
'data-theme': 'light',
|
|
48
|
+
'data-custom-theme': uniqueId
|
|
49
|
+
},
|
|
50
|
+
css: "\nhtml[".concat(CUSTOM_THEME_ATTRIBUTE, "=\"").concat(uniqueId, "\"][").concat(COLOR_MODE_ATTRIBUTE, "=\"light\"][data-theme~=\"light:light\"] {\n /* Branded tokens */\n ").concat(reduceTokenMap(tokenMaps.light, themeRamp), "\n}")
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if ((mode === 'dark' || mode === 'auto') && tokenMaps.dark) {
|
|
54
|
+
// Dark mode theming
|
|
55
|
+
themes.push({
|
|
56
|
+
id: 'dark',
|
|
57
|
+
attrs: {
|
|
58
|
+
'data-theme': 'dark',
|
|
59
|
+
'data-custom-theme': uniqueId
|
|
60
|
+
},
|
|
61
|
+
css: "\nhtml[".concat(CUSTOM_THEME_ATTRIBUTE, "=\"").concat(uniqueId, "\"][").concat(COLOR_MODE_ATTRIBUTE, "=\"dark\"][data-theme~=\"dark:dark\"] {\n /* Branded tokens */\n ").concat(reduceTokenMap(tokenMaps.dark, themeRamp), "\n}")
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return _context.abrupt("return", themes);
|
|
65
|
+
case 10:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}, _callee);
|
|
70
|
+
}));
|
|
71
|
+
return _getCustomThemeStyles.apply(this, arguments);
|
|
72
|
+
}
|
|
73
|
+
export function loadAndAppendCustomThemeCss(_x2) {
|
|
74
|
+
return _loadAndAppendCustomThemeCss.apply(this, arguments);
|
|
75
|
+
}
|
|
76
|
+
function _loadAndAppendCustomThemeCss() {
|
|
77
|
+
_loadAndAppendCustomThemeCss = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(themeState) {
|
|
78
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
79
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
getCustomThemeStyles(themeState).then(function (themes) {
|
|
82
|
+
limitSizeOfCustomStyleElements(CUSTOM_STYLE_ELEMENTS_SIZE_THRESHOLD);
|
|
83
|
+
themes.map(function (theme) {
|
|
84
|
+
var styleTag = document.createElement('style');
|
|
85
|
+
document.head.appendChild(styleTag);
|
|
86
|
+
styleTag.dataset.theme = theme.attrs['data-theme'];
|
|
87
|
+
styleTag.dataset.customTheme = theme.attrs['data-custom-theme'];
|
|
88
|
+
styleTag.textContent = theme.css;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
case 1:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee2);
|
|
96
|
+
}));
|
|
97
|
+
return _loadAndAppendCustomThemeCss.apply(this, arguments);
|
|
98
|
+
}
|