Skip to content

Commit 659a7c2

Browse files
committed
feat: initial work to update the fast-components design system (#3135)
* update design system colors and remove elevated corner radius * update storybook theme to include custom css to ensure accurate visuals * fix hypertext styles * update preview styles and dialog styles for corner radius * update accent color * comment failings tests per nicholasrice
1 parent d1b3f70 commit 659a7c2

23 files changed

Lines changed: 245 additions & 348 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { addons } from "@storybook/addons";
2+
import theme from "./theme";
3+
4+
addons.setConfig({
5+
theme,
6+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<style>
2+
body {
3+
background-color: #181818;
4+
}
5+
6+
h1, h2, h3, h4, h5, h6 {
7+
color: #FFF;
8+
}
9+
</style>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { create } from "@storybook/theming/create";
2+
3+
export default create({
4+
base: "dark",
5+
colorPrimary: "#DA1A5F",
6+
appContentBg: "#181818",
7+
textColor: "#FFF",
8+
brandTitle: "FAST components storybook",
9+
});

packages/web-components/fast-components/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@
7474
"@babel/core": "^7.8.4",
7575
"@babel/preset-env": "^7.1.0",
7676
"@microsoft/eslint-config-fast-dna": "^1.1.1",
77-
"@storybook/cli": "^5.3.13",
78-
"@storybook/html": "^5.3.13",
77+
"@storybook/addons": "^5.1.3",
78+
"@storybook/cli": "^5.1.3",
79+
"@storybook/html": "^5.1.3",
80+
"@storybook/theming": "^5.1.3",
7981
"@types/jest": "^25.2.1",
8082
"babel-core": "^7.0.0-bridge.0",
8183
"circular-dependency-plugin": "^5.2.0",

packages/web-components/fast-components/src/card/card.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const CardStyles = css`
1313
width: var(--card-width, 100%);
1414
box-sizing: border-box;
1515
background: var(--neutral-layer-card);
16-
border-radius: calc(var(--elevated-corner-radius) * 1px);
16+
border-radius: calc(var(--corner-radius) * 1px);
1717
${elevation};
1818
}
1919
`.withBehaviors(

packages/web-components/fast-components/src/color/accent-fill.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ describe("accentFill", (): void => {
2727
accentBaseColor(fastDesignSystemDefaults)
2828
)(fastDesignSystemDefaults);
2929

30-
test("should operate on design system defaults", (): void => {
30+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
31+
xtest("should operate on design system defaults", (): void => {
3132
expect(accentFillRest({} as FASTDesignSystem)).toBe(
3233
accentPalette[accentIndex + fastDesignSystemDefaults.accentFillRestDelta]
3334
);
@@ -54,7 +55,8 @@ describe("accentFill", (): void => {
5455
);
5556
});
5657

57-
test("should accept a function that resolves a background swatch", (): void => {
58+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
59+
xtest("should accept a function that resolves a background swatch", (): void => {
5860
expect(typeof accentFillRest(() => "#FFF")).toBe("function");
5961
expect(accentFillRest(() => "#000")({} as FASTDesignSystem)).toBe(
6062
accentPalette[63]

packages/web-components/fast-components/src/color/accent-foreground.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ describe("accentForeground", (): void => {
1919
const neutralPalette: Palette = getNeutralPalette(fastDesignSystemDefaults);
2020
const accentPalette: Palette = getAccentPalette(fastDesignSystemDefaults);
2121

22-
test("should operate on design system defaults", (): void => {
22+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
23+
xtest("should operate on design system defaults", (): void => {
2324
expect(accentForegroundRest({} as FASTDesignSystem)).toBe(accentPalette[59]);
2425
expect(accentForegroundHover({} as FASTDesignSystem)).toBe(accentPalette[65]);
2526
expect(accentForegroundActive({} as FASTDesignSystem)).toBe(accentPalette[55]);
@@ -32,7 +33,8 @@ describe("accentForeground", (): void => {
3233
);
3334
});
3435

35-
test("should accept a function that resolves a background swatch", (): void => {
36+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
37+
xtest("should accept a function that resolves a background swatch", (): void => {
3638
expect(typeof accentForegroundRest(() => "#FFF")).toBe("function");
3739
expect(accentForegroundRest(() => "#000")({} as FASTDesignSystem)).toBe(
3840
accentPalette[59]
@@ -43,7 +45,8 @@ describe("accentForeground", (): void => {
4345
);
4446
});
4547

46-
test("should increase contrast on hover state and decrease contrast on active state in either mode", (): void => {
48+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
49+
xtest("should increase contrast on hover state and decrease contrast on active state in either mode", (): void => {
4750
expect(
4851
accentPalette.indexOf(accentForegroundHover(fastDesignSystemDefaults))
4952
).toBeGreaterThan(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const white: string = "#FFFFFF";
22
export const black: string = "#000000";
3-
export const accentBaseColor: string = "#0078D4";
3+
export const accentBaseColor: string = "#DA1A5F";
44
export const neutralBaseColor: string = "#808080";

packages/web-components/fast-components/src/color/neutral-fill-card.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { FASTDesignSystem, fastDesignSystemDefaults } from "../fast-design-syste
22
import { neutralFillCard } from "./neutral-fill-card";
33

44
describe("neutralFillCard", (): void => {
5-
test("should operate on design system defaults", (): void => {
5+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
6+
xtest("should operate on design system defaults", (): void => {
67
expect(neutralFillCard({} as FASTDesignSystem)).toBe(
78
fastDesignSystemDefaults.neutralPalette[
89
fastDesignSystemDefaults.neutralFillCardDelta

packages/web-components/fast-components/src/color/neutral-fill-input.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ describe("neutralFillInput", (): void => {
1818
const neutralPalette: Palette = getNeutralPalette(fastDesignSystemDefaults);
1919
const accentPalette: Palette = getAccentPalette(fastDesignSystemDefaults);
2020

21-
test("should operate on design system defaults", (): void => {
21+
// TODO @nicholasrice: Tests are failing due as palette is expecting light
22+
xtest("should operate on design system defaults", (): void => {
2223
expect(neutralFillInputRest({} as FASTDesignSystem)).toBe(neutralPalette[0]);
2324
expect(neutralFillInputHover({} as FASTDesignSystem)).toBe(neutralPalette[0]);
2425
expect(neutralFillInputActive({} as FASTDesignSystem)).toBe(neutralPalette[0]);

0 commit comments

Comments
 (0)