Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Justering semantiske farger, tokens #1787

Merged
merged 16 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cyan-trainers-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-tokens": minor
---

Justeringer i semantiske fargetokens, statusfarger nå mer tydelig
70 changes: 0 additions & 70 deletions @navikt/aksel-icons/src/Mute.tsx

This file was deleted.

1 change: 0 additions & 1 deletion @navikt/aksel-icons/src/index.ts

This file was deleted.

39 changes: 0 additions & 39 deletions @navikt/aksel-icons/src/util/useId.ts

This file was deleted.

3 changes: 0 additions & 3 deletions @navikt/aksel-icons/svgtest/ChevronCeft.svg

This file was deleted.

6 changes: 0 additions & 6 deletions @navikt/aksel-icons/svgtest/ChevronCeft.yml

This file was deleted.

3 changes: 0 additions & 3 deletions @navikt/aksel-icons/svgtest/ChevronDown.svg

This file was deleted.

8 changes: 0 additions & 8 deletions @navikt/aksel-icons/svgtest/ChevronDown.yml

This file was deleted.

3 changes: 0 additions & 3 deletions @navikt/aksel-icons/svgtest/ChevronRight.svg

This file was deleted.

6 changes: 0 additions & 6 deletions @navikt/aksel-icons/svgtest/ChevronRight.yml

This file was deleted.

3 changes: 0 additions & 3 deletions @navikt/aksel-icons/svgtest/ChevronUp.svg

This file was deleted.

9 changes: 0 additions & 9 deletions @navikt/aksel-icons/svgtest/ChevronUp.yml

This file was deleted.

6 changes: 0 additions & 6 deletions @navikt/aksel-icons/svgtest/Hearing.svg

This file was deleted.

6 changes: 0 additions & 6 deletions @navikt/aksel-icons/svgtest/Hearing.yml

This file was deleted.

6 changes: 0 additions & 6 deletions @navikt/aksel-icons/svgtest/HearingImpaired.svg

This file was deleted.

6 changes: 0 additions & 6 deletions @navikt/aksel-icons/svgtest/HearingImpaired.yml

This file was deleted.

5 changes: 5 additions & 0 deletions @navikt/core/css/alert.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
font-size: 1.5rem;
align-self: flex-start;
height: var(--a-font-line-height-xlarge);
background: radial-gradient(circle, var(--a-surface-default) 50%, 0, transparent);
}

.navds-alert--small > .navds-alert__icon {
Expand All @@ -41,6 +42,10 @@
background-color: var(--ac-alert-warning-bg, var(--a-surface-warning-subtle));
}

.navds-alert--warning > .navds-alert__icon {
background: radial-gradient(circle at 50% 57%, var(--a-surface-default) 32%, 0, transparent);
}

.navds-alert--info {
border-color: var(--ac-alert-info-border, var(--a-border-info));
background-color: var(--ac-alert-info-bg, var(--a-surface-info-subtle));
Expand Down
8 changes: 2 additions & 6 deletions @navikt/core/css/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
gap: var(--a-spacing-1);
}

.navds-alert--info .navds-link {
color: var(--a-text-default);
}

.navds-alert--error .navds-link,
.navds-confirmation-panel--error .navds-link {
.navds-alert .navds-link,
.navds-confirmation-panel .navds-link {
color: var(--a-text-default);
}

Expand Down
14 changes: 13 additions & 1 deletion @navikt/core/react/src/alert/alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from "@storybook/react";
import React from "react";
import { Alert } from ".";
import { BodyLong, Heading as DsHeading } from "..";
import { BodyLong, Heading as DsHeading, Link } from "..";

const meta: Meta<typeof Alert> = {
title: "ds-react/Alert",
Expand Down Expand Up @@ -135,3 +135,15 @@ export const Heading = () => {
</div>
);
};

export const Links = () => {
return (
<div className="colgap">
{variants.map((variant, i) => (
<Alert key={variant} variant={variant}>
<Link href="#">Id elit esse enim reprehenderit</Link>
</Alert>
))}
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
const docs = require("../docs.json");
const DsTokens = require("../dist/tokens-cjs.js");
const kebabCase = require("./kebabCase.js");
const docs = require("../../docs.json");
const DsTokens = require("../../dist/tokens-cjs.js");
const kebabCase = require("../kebabCase.js");

const flatten = Object.values(docs).reduce((old, val) => [...old, ...val], []);

const notFound = [];
const removed = [];
const wrongValues = [];

describe("Validate tokens dokumentation", () => {
flatten.forEach((x) => {
it(`${x} should be documented`, () => {
expect(
Object.keys(DsTokens).find(
(y) => `--${kebabCase(y)}`.replace("--az-", "--a-z-") === x.name
)
).toBeDefined();
});
});

Object.entries(DsTokens).forEach(([key, val]) => {
const formatedKey = `--${kebabCase(key)}`.replace("--az-", "--a-z-");
it(`${formatedKey} should exist in docs`, () => {
const tokenInDoc = flatten.find((x) => x.name === formatedKey);
expect(tokenInDoc).toBeDefined();
});

it(`${formatedKey} should have correct value ${val}`, () => {
const formatedKey = `--${kebabCase(key)}`.replace("--az-", "--a-z-");

const tokenInDoc = flatten.find((x) => x.name === formatedKey);
expect(tokenInDoc?.value).toEqual(val);
});
});
});

flatten.forEach((x) => {
!Object.keys(DsTokens).find(
(y) => `--${kebabCase(y)}`.replace("--az-", "--a-z-") === x.name
Expand Down
Loading