Skip to content

Commit 2f5a03d

Browse files
authored
Adaptive UI: Added info color palette (#179)
1 parent e296ca0 commit 2f5a03d

File tree

5 files changed

+457
-1
lines changed

5 files changed

+457
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Added info color palette",
4+
"packageName": "@adaptive-web/adaptive-ui",
5+
"email": "47367562+bheston@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/adaptive-ui-figma-designer/src/core/registry/recipes.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ import {
5656
highlightStrokeSafety,
5757
highlightStrokeStrong,
5858
highlightStrokeSubtle,
59+
infoFillDiscernible,
60+
infoFillReadable,
61+
infoFillStealth,
62+
infoFillSubtle,
63+
infoStrokeDiscernible,
64+
infoStrokeReadable,
65+
infoStrokeSafety,
66+
infoStrokeStrong,
67+
infoStrokeSubtle,
5968
labelFontFamily,
6069
labelFontStyle,
6170
labelFontWeight,
@@ -199,6 +208,10 @@ const colorTokens: DesignTokenStore<Swatch> = [
199208
successFillSubtle.rest,
200209
successFillDiscernible.rest,
201210
successFillReadable.rest,
211+
infoFillStealth.rest,
212+
infoFillSubtle.rest,
213+
infoFillDiscernible.rest,
214+
infoFillReadable.rest,
202215
neutralFillStealth.rest,
203216
neutralFillSubtle.rest,
204217
neutralFillDiscernible.rest,
@@ -232,6 +245,11 @@ const colorTokens: DesignTokenStore<Swatch> = [
232245
successStrokeDiscernible.rest,
233246
successStrokeReadable.rest,
234247
successStrokeStrong.rest,
248+
infoStrokeSafety.rest,
249+
infoStrokeSubtle.rest,
250+
infoStrokeDiscernible.rest,
251+
infoStrokeReadable.rest,
252+
infoStrokeStrong.rest,
235253
neutralStrokeSafety.rest,
236254
neutralStrokeSubtle.rest,
237255
neutralStrokeDiscernible.rest,

packages/adaptive-ui/src/design-tokens/color.ts

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from "../token-helpers-color.js";
2525
import { createNonCss, createTokenNonCss, createTokenSwatch } from "../token-helpers.js";
2626
import { DesignTokenType, TypedDesignToken } from "../adaptive-design-tokens.js";
27-
import { accentPalette, criticalPalette, disabledPalette, highlightPalette, neutralPalette, successPalette, warningPalette } from "./palette.js";
27+
import { accentPalette, criticalPalette, disabledPalette, highlightPalette, infoPalette, neutralPalette, successPalette, warningPalette } from "./palette.js";
2828

2929
/**
3030
* Creates a DesignToken that can be used for the _accent_ palette configuration of a shared color recipe.
@@ -91,6 +91,19 @@ export function createTokenColorRecipeSuccess<T>(
9191
return createTokenColorRecipeWithPalette(recipeToken, successPalette);
9292
}
9393

94+
/**
95+
* Creates a DesignToken that can be used for the _info_ palette configuration of a shared color recipe.
96+
*
97+
* @param recipeToken - The color recipe token.
98+
*
99+
* @public
100+
*/
101+
export function createTokenColorRecipeInfo<T>(
102+
recipeToken: TypedDesignToken<Recipe<ColorRecipePaletteParams, T>>,
103+
): TypedDesignToken<RecipeOptional<ColorRecipeParams, T>> {
104+
return createTokenColorRecipeWithPalette(recipeToken, infoPalette);
105+
}
106+
94107
/**
95108
* Creates a DesignToken that can be used for the _neutral_ palette configuration of a shared color recipe.
96109
*
@@ -1286,6 +1299,68 @@ export const successStrokeStrongRecipe = createTokenColorRecipeSuccess(strokeStr
12861299
/** @public */
12871300
export const successStrokeStrong = createTokenColorSet(successStrokeStrongRecipe);
12881301

1302+
// Info color recipes
1303+
1304+
/** @public */
1305+
export const infoFillStealthRecipe = createTokenColorRecipeInfo(fillStealthRecipe);
1306+
1307+
/** @public */
1308+
export const infoFillStealth = createTokenColorSet(infoFillStealthRecipe);
1309+
1310+
/** @public */
1311+
export const infoFillSubtleRecipe = createTokenColorRecipeInfo(fillSubtleRecipe);
1312+
1313+
/** @public */
1314+
export const infoFillSubtle = createTokenColorSet(infoFillSubtleRecipe);
1315+
1316+
/** @public */
1317+
export const infoFillDiscernibleRecipe = createTokenColorRecipeInfo(fillDiscernibleRecipe);
1318+
1319+
/** @public */
1320+
export const infoFillDiscernible = createTokenColorSet(infoFillDiscernibleRecipe);
1321+
1322+
/** @public */
1323+
export const infoFillReadableRecipe = createTokenColorRecipeInfo(fillReadableRecipe);
1324+
1325+
/** @public */
1326+
export const infoFillReadable = createTokenColorSet(infoFillReadableRecipe);
1327+
1328+
/** @public */
1329+
export const infoStrokeSafetyRecipe = createTokenColorRecipeInfo(strokeSafetyRecipe);
1330+
1331+
/** @public */
1332+
export const infoStrokeSafety = createTokenColorSet(infoStrokeSafetyRecipe);
1333+
1334+
/** @public */
1335+
export const infoStrokeStealthRecipe = createTokenColorRecipeInfo(strokeStealthRecipe);
1336+
1337+
/** @public */
1338+
export const infoStrokeStealth = createTokenColorSet(infoStrokeStealthRecipe);
1339+
1340+
/** @public */
1341+
export const infoStrokeSubtleRecipe = createTokenColorRecipeInfo(strokeSubtleRecipe);
1342+
1343+
/** @public */
1344+
export const infoStrokeSubtle = createTokenColorSet(infoStrokeSubtleRecipe);
1345+
1346+
/** @public */
1347+
export const infoStrokeDiscernibleRecipe = createTokenColorRecipeInfo(strokeDiscernibleRecipe);
1348+
1349+
/** @public */
1350+
export const infoStrokeDiscernible = createTokenColorSet(infoStrokeDiscernibleRecipe);
1351+
1352+
/** @public */
1353+
export const infoStrokeReadableRecipe = createTokenColorRecipeInfo(strokeReadableRecipe);
1354+
1355+
/** @public */
1356+
export const infoStrokeReadable = createTokenColorSet(infoStrokeReadableRecipe);
1357+
1358+
/** @public */
1359+
export const infoStrokeStrongRecipe = createTokenColorRecipeInfo(strokeStrongRecipe);
1360+
1361+
/** @public */
1362+
export const infoStrokeStrong = createTokenColorSet(infoStrokeStrongRecipe);
1363+
12891364
// Neutral Fill Stealth
12901365

12911366
/** @public */

0 commit comments

Comments
 (0)