Skip to content

Commit 0ea6e86

Browse files
authored
Merge 6493e98 into 505462b
2 parents 505462b + 6493e98 commit 0ea6e86

File tree

431 files changed

+2879
-16307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

431 files changed

+2879
-16307
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- [ ] Documentation / Decision Records
1010
- [ ] Storybook
1111
- [ ] Style mappings (`@navikt/core/css/config/_mappings.js`)
12-
- [ ] Component tokens (`@navikt/core/css/tokens.json`)
1312
- [ ] CSS class deprecations (`@navikt/aksel-stylelint/src/deprecations.ts`)
1413
- [ ] Exports (`@navikt/core/react/src/index.ts` and `@navikt/core/react/package.json`)
1514
- [ ] New component? CSS import (`@navikt/core/css/index.css`)

.github/copilot-instructions.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,6 @@ Troubleshooting
200200
## Darkside theming and tokens
201201

202202
- Use design tokens and CSS layers; avoid hard-coded colors/spacing.
203-
- Website imports Darkside CSS and tokens, see:
204-
- `aksel.nav.no/website/pages/global.css` (imports `@navikt/ds-css/darkside`)
205-
- `aksel.nav.no/website/pages/_app.tsx` (imports `@navikt/ds-tokens/darkside-css`)
206203
- Stylelint enforces token usage; unknown/missing custom properties will fail lint.
207204

208205
## Website (Next.js)
@@ -227,7 +224,7 @@ Troubleshooting
227224
- Storybook: “Run yarn storybook” (or `yarn storybook:aksel` for the website config)
228225
- Lint/format: “Run yarn lint” (full install recommended) and optional `yarn biome:lint`
229226
- Versioning: “Run yarn changeset, then yarn create-version”
230-
- Theming: “Import @navikt/ds-css/darkside in global CSS and ensure tokens via @navikt/ds-tokens/darkside-css
227+
- Theming: “Import @navikt/ds-css in global CSS”
231228

232229
## Code reviews (for Copilot)
233230

.storybook/layout.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ body {
1515
padding: 1rem;
1616
}
1717

18-
.colgap[data-theme="dark"],
19-
.rowgap[data-theme="dark"] {
20-
background-color: var(--a-gray-900);
21-
}
22-
2318
.rowgap-wrap {
2419
flex-wrap: wrap;
2520
}

.storybook/preview.tsx

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,12 @@
11
import { withThemeByClassName } from "@storybook/addon-themes";
22
import { Preview } from "@storybook/nextjs";
3-
import React, { useEffect, useLayoutEffect } from "react";
4-
// @ts-expect-error - Temporary
5-
import darksideCss from "../@navikt/core/css/darkside/index.css?inline";
6-
// @ts-expect-error - Temporary
7-
import defaultCss from "../@navikt/core/css/index.css?inline";
3+
import React, { useEffect } from "react";
4+
import "../@navikt/core/css/src/index.css";
85
import { Provider } from "../@navikt/core/react/src/provider";
9-
import { Theme } from "../@navikt/core/react/src/theme";
106
import { Translations } from "../@navikt/core/react/src/util/i18n/i18n.types";
117
import { en, nb, nn } from "../@navikt/core/react/src/util/i18n/locales";
128
import "./layout.css";
139

14-
const ModeDecorator = ({ children, mode, theme }) => {
15-
useLayoutEffect(() => {
16-
const style = document.createElement("style");
17-
style.innerHTML = mode === "darkside" ? darksideCss : defaultCss;
18-
document.head.appendChild(style);
19-
20-
if (mode === "darkside") {
21-
document.body.style.setProperty("background", "var(--ax-bg-default)");
22-
}
23-
24-
return () => {
25-
document.head.removeChild(style);
26-
document.body.style.removeProperty("background");
27-
};
28-
}, [mode]);
29-
30-
return mode === "darkside" ? (
31-
<Theme theme={theme || undefined} hasBackground={false}>
32-
{children}
33-
</Theme>
34-
) : (
35-
children
36-
);
37-
};
38-
3910
type Language = "nb" | "nn" | "en";
4011
const locales: Record<Language, Translations> = {
4112
nb,
@@ -55,7 +26,6 @@ const TypoDecorator = ({
5526
useEffect(() => {
5627
const fontVariable = fonts.includes(font) ? `"${font}", sans-serif` : null;
5728
document.body.style.setProperty("--ax-font-family", fontVariable);
58-
document.body.style.setProperty("--a-font-family", fontVariable);
5929
}, [font]);
6030

6131
return children;
@@ -93,21 +63,6 @@ export default {
9363
},
9464

9565
globalTypes: {
96-
mode: {
97-
name: "Darkside",
98-
toolbar: {
99-
items: [
100-
{
101-
value: "default",
102-
icon: "hourglass",
103-
title: "Legacy theme",
104-
},
105-
{ value: "darkside", icon: "beaker", title: "Darkside theme" },
106-
],
107-
showName: true,
108-
dynamicTitle: true,
109-
},
110-
},
11166
language: {
11267
toolbar: {
11368
icon: "globe",
@@ -140,11 +95,6 @@ export default {
14095
<StoryFn />
14196
</TypoDecorator>
14297
),
143-
(StoryFn, context) => (
144-
<ModeDecorator mode={context.globals.mode} theme={context.globals.theme}>
145-
<StoryFn />
146-
</ModeDecorator>
147-
),
14898
(StoryFn, context) =>
14999
context.globals.language ? (
150100
<Provider locale={locales[context.globals.language as Language]}>

@navikt/aksel-icons/figma-plugin/src/ui/app.css

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@import "@navikt/ds-css";
22

33
.wrapper {
4-
background-color: var(--a-bg-default);
4+
background-color: var(--ax-bg-default);
55
}
66

77
.form {
8-
border-bottom: 1px solid var(--a-border-subtle);
8+
border-bottom: 1px solid var(--ax-border-neutral-subtle);
99
position: sticky;
1010
top: 0;
1111
z-index: 20;
@@ -16,7 +16,7 @@
1616
gap: 1rem;
1717
padding-block: 0.5rem;
1818
padding-inline: 1rem;
19-
background-color: var(--a-bg-default);
19+
background-color: var(--ax-bg-default);
2020
}
2121

2222
.form-togglegroup {
@@ -45,7 +45,7 @@
4545
}
4646

4747
.sub-heading {
48-
color: var(--a-text-subtle);
48+
color: var(--ax-text-neutral-subtle);
4949
margin-bottom: 0.25rem;
5050
}
5151

@@ -58,22 +58,23 @@
5858
.icon-button {
5959
min-height: 3rem;
6060
min-width: 3rem;
61-
border-radius: var(--a-border-radius-small);
61+
border-radius: var(--ax-radius-2);
6262
display: grid;
6363
place-content: center;
64-
background-color: var(--a-surface-default);
64+
background-color: var(--ax-bg-neutral-softA);
6565
cursor: pointer;
6666
border: none;
6767
}
6868

6969
.icon-button:hover {
70-
background-color: var(--a-surface-hover);
70+
background-color: var(--ax-bg-neutral-moderate-hoverA);
7171
}
7272

7373
.icon-button:active {
74-
background-color: var(--a-surface-neutral-subtle-hover);
74+
background-color: var(--ax-bg-neutral-moderate-pressedA);
7575
}
7676

7777
.icon-button:focus-visible {
78-
outline: 2px solid var(--a-border-focus);
78+
outline: 3px solid var(--ax-border-focus);
79+
outline-offset: 2px;
7980
}

@navikt/aksel-icons/icons.stories.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Icons: Story = {
3636
export const IconsInverted: Story = {
3737
render: () => {
3838
return (
39-
<div className="icons">
39+
<div className="dark">
4040
{Object.entries(AkselIcons).map(([key, Value]) => (
4141
<React.Fragment key={key}>
4242
<Value
@@ -47,18 +47,6 @@ export const IconsInverted: Story = {
4747
/>
4848
</React.Fragment>
4949
))}
50-
<style>
51-
{`
52-
.icons{
53-
display: flex;
54-
flex-wrap: wrap;
55-
background: var(--a-gray-900);
56-
}
57-
.icon-color{
58-
color: var(--a-icon-on-inverted);
59-
}
60-
`}
61-
</style>
6250
</div>
6351
);
6452
},
File renamed without changes.

@navikt/aksel-stylelint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"scripts": {
3232
"test": "yarn build && node --import tsx --test ./dist/**/*.test.js",
3333
"copy-css": "node -e \"require('fs').copyFileSync('../core/css/dist/index.css','dist/index.css')\"",
34-
"copy-tokens": "node -e \"require('fs').copyFileSync('../core/css/tokens.json','dist/tokens.json')\"",
34+
"copy-tokens": "node -e \"require('fs').copyFileSync('legacy-tokens.json','dist/tokens.json')\"",
3535
"copy": "yarn copy-css && yarn copy-tokens",
3636
"build": "tsc -p . && concurrently \"yarn:copy-*\"",
3737
"watch:lint": "tsc --watch -p .",

@navikt/aksel-stylelint/src/deprecations.ts

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,4 @@ type DeprecatedList = {
44
deprecatePrefix?: boolean;
55
}[];
66

7-
export const deprecations: DeprecatedList = [
8-
{
9-
classes: ["navdsi-deprecated-example", "navdsi-other-deprecated-example"],
10-
message: "Removed in vX.X.X, see documentation [link] for more information",
11-
},
12-
{
13-
classes: [
14-
"navdsi-dropdown",
15-
"navdsi-copy-to-clipboard",
16-
"navdsi-header",
17-
"navdsi-timeline",
18-
],
19-
message:
20-
"Class were moved to '@navikt/ds-css' and renamed with 'navds'-prefix in v4.0.0. Docs: https://aksel.nav.no/grunnleggende/kode/endringslogg#h728704adeb59.",
21-
deprecatePrefix: true,
22-
},
23-
{
24-
classes: ["navds-chips--icon-left"],
25-
message:
26-
"In v4.1.0 Chips. Toggle no longer handles special alignment for checkmark-icon, thus removing this class",
27-
},
28-
{
29-
classes: ["navds-modal__overlay"],
30-
message:
31-
"Removed in v5.0.0, use `.navds-modal::backdrop` and `.navds-modal--polyfilled + .backdrop` instead",
32-
},
33-
{
34-
classes: ["navds-modal__button--shake"],
35-
message: "Removed in v5.0.0",
36-
},
37-
{
38-
classes: ["navds-modal__content"],
39-
message: "Renamed to `.navds-modal__body` in v5.0.0",
40-
},
41-
{
42-
classes: ["navds-guide__illustration"],
43-
message: "Use `.navds-guide` instead",
44-
},
45-
{
46-
classes: [
47-
"navds-guide__illustration--small",
48-
"navds-guide__illustration--medium",
49-
],
50-
message:
51-
"There is no 1:1 replacement for this, the size will depend on the 'poster' prop and the viewport width",
52-
},
53-
{
54-
classes: ["navds-grid", "navds-content-container"],
55-
deprecatePrefix: true,
56-
message:
57-
"Components were replaced by `HGrid` and `Page.Block` in version 6",
58-
},
59-
{
60-
classes: ["navds-textarea__wrapper"],
61-
message: "Removed in v6.0.0",
62-
},
63-
{
64-
classes: [
65-
"navds-pagination__prev-next-icon",
66-
"navds-pagination__next-text",
67-
"navds-pagination__prev-text",
68-
],
69-
message: "These classes had no effect and were removed in v7.1.0",
70-
},
71-
{
72-
classes: ["navds-list--nested", "navds-list__item-content"],
73-
message: "Removed in v7.1.1",
74-
},
75-
{
76-
classes: ["navds-combobox__button-clear"],
77-
message: "Removed in v7.8.0",
78-
},
79-
{
80-
classes: ["navds-switch__checkmark"],
81-
message: "Removed in v7.24.0",
82-
},
83-
{
84-
classes: ["navds-modal__document-body"],
85-
message:
86-
"Will be removed in next major v8. We recommend not using this class anymore.",
87-
},
88-
];
7+
export const deprecations: DeprecatedList = [];

@navikt/aksel/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ Tries to migrate List component moving 'title' and 'description' props to 'Headi
7070

7171
#### Variants
7272

73+
`npx @navikt/aksel codemod v8-button-variant ...`
7374
`npx @navikt/aksel codemod v8-tag-variant ...`
7475
`npx @navikt/aksel codemod v8-toggle-group-variant ...`
7576
`npx @navikt/aksel codemod v8-accordion-variant ...`
7677
`npx @navikt/aksel codemod v8-chips-variant ...`
78+
`npx @navikt/aksel codemod v8-link-variant ...`
7779

7880
Updates variant + data-color props based on current variant prop.
7981

0 commit comments

Comments
 (0)