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

[V6] Major-release #2623

Merged
merged 34 commits into from Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6f62cb5
[V6] Deprecated Grid og ContentContainer (#2622)
KenAJoh Jan 15, 2024
d179824
Merge branch 'main' into aksel-v6
KenAJoh Jan 15, 2024
c0419ad
Merge branch 'main' into aksel-v6
KenAJoh Jan 16, 2024
444fe5d
Textarea: Fjern wrapper (#2635)
HalvorHaugan Jan 16, 2024
5706b06
Merge branch 'main' into aksel-v6
KenAJoh Jan 16, 2024
af14279
[V6] Chat-props deprecation (#2631)
KenAJoh Jan 18, 2024
c59a808
[V6] 1440px breakpoint (#2632)
KenAJoh Jan 18, 2024
9512fc6
[V6] Fjernet z-index-modal token (#2637)
KenAJoh Jan 18, 2024
40f688f
Merge branch 'main' into aksel-v6
KenAJoh Jan 18, 2024
aa8cc46
[V6] ErrorSummary magic (#2642)
KenAJoh Jan 18, 2024
fc3d520
:memo: Oppdatert migreringsguide for z-index + tailwind
KenAJoh Jan 18, 2024
32523e4
:bug: Fikset bruk av z-modal i tailwind
KenAJoh Jan 18, 2024
c2e1e94
Merge branch 'main' into aksel-v6
KenAJoh Jan 29, 2024
5891e69
Merge branch 'main' into aksel-v6
KenAJoh Jan 31, 2024
44e4ce1
Merge branch 'main' into aksel-v6
KenAJoh Jan 31, 2024
d4ae3ea
Merge branch 'main' into aksel-v6
KenAJoh Feb 6, 2024
857b14e
Merge branch 'main' into aksel-v6
KenAJoh Feb 6, 2024
caa34f1
Merge branch 'main' into aksel-v6
KenAJoh Feb 7, 2024
832c406
:fire: Fjernet openOnFocus-prop fra date
KenAJoh Feb 7, 2024
83df87a
[V6] Modal: strengere prop-typer (#2718)
HalvorHaugan Feb 8, 2024
a6bd0f8
Merge branch 'main' into aksel-v6
KenAJoh Feb 13, 2024
4999e28
:art: SortState i Table har nå none tilgjengelig (#2726)
KenAJoh Feb 14, 2024
939e6ad
[V6] Oppdatert bruk av action-farger (#2717)
KenAJoh Feb 14, 2024
3f6b930
[V6] Native ESM-støtte 🎉 (#2677)
KenAJoh Feb 14, 2024
f0a3598
Merge branch 'main' into aksel-v6
KenAJoh Feb 14, 2024
63e4467
:bug: Async-lasting av date-fns er nå v3 esm compliant
KenAJoh Feb 14, 2024
143c2fd
Merge branch 'main' into aksel-v6
KenAJoh Feb 14, 2024
32cc6e3
Search: Ekskluder 'type' fra SearchProps (#2736)
HalvorHaugan Feb 19, 2024
6d2c87a
Merge branch 'main' into aksel-v6
KenAJoh Feb 19, 2024
c5fca35
:tada: Ny token icon-action-hover
KenAJoh Feb 19, 2024
33d962b
:fire: Fjernet v6-endringer for ErrorSummary. Endringer vil bli gjort…
KenAJoh Feb 19, 2024
d670da3
OverridableComponent: Fikset feil som tillot vilkårlige props (#2739)
HalvorHaugan Feb 19, 2024
9a4a4c9
Merge branch 'main' into aksel-v6
KenAJoh Feb 19, 2024
0ab3569
:fire: Fjernet migration.md
KenAJoh Feb 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/few-apples-divide.md
@@ -0,0 +1,6 @@
---
"@navikt/ds-react": major
"@navikt/aksel": major
---

Chat: Fjernet deprecated props `backgroundColor` og `avatarBgColor`. Bruk prop `variant` som erstatning.
5 changes: 5 additions & 0 deletions .changeset/happy-jeans-juggle.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": major
---

Search: Fjern 'type' fra SearchProps
8 changes: 8 additions & 0 deletions .changeset/large-shrimps-brush.md
@@ -0,0 +1,8 @@
---
"@navikt/ds-tokens": major
"@navikt/ds-react": major
"@navikt/ds-css": major
"@navikt/ds-tailwind": major
---

Tokens: La til nytt brekkpunkt `2xl` for `1440px`. Alle primitives er oppdatert for å reflektere oppdateringen. Brukere av Tailwind vil måtte sjekke at overskriving av `screen: "2xl"` ikke brekker app.
6 changes: 6 additions & 0 deletions .changeset/late-beds-rhyme.md
@@ -0,0 +1,6 @@
---
"@navikt/aksel-icons": major
"@navikt/ds-react": major
---

ESM: ds-react og aksel-icons støtter nå native ESM 🎉
5 changes: 5 additions & 0 deletions .changeset/light-ads-report.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": major
---

OverridableComponent: Fikset feil som tillot vilkårlige props
6 changes: 6 additions & 0 deletions .changeset/loud-boxes-drop.md
@@ -0,0 +1,6 @@
---
"@navikt/ds-react": major
"@navikt/ds-css": major
---

Grid, ContentContainer: Komponenter er fjernet fra systemet. [Se migreringsguide](https://aksel.nav.no/grunnleggende/kode/migrering#dd2cfa9fb1d1).
5 changes: 5 additions & 0 deletions .changeset/ninety-bulldogs-swim.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": major
---

Table: SortState.direction har nå `none` tilgjengelig: `"ascending" | "descending" | "none"`
5 changes: 5 additions & 0 deletions .changeset/tall-turtles-flow.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-tokens": major
---

Tokens: Fjernet token `--a-z-index-modal` da den ikke lengre blir konsumert i systemet.
6 changes: 6 additions & 0 deletions .changeset/ten-parents-drop.md
@@ -0,0 +1,6 @@
---
"@navikt/aksel-icons": minor
"@navikt/ds-react": minor
---

SSR: ds-react og aksel-icons støtter nå `use-client` og kan brukes i nextjs app-router uten lokal re-eksportering.
5 changes: 5 additions & 0 deletions .changeset/three-chefs-notice.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": major
---

CSS: Oppdatert bruk av action-farger i systemet. Dette påvirker komponentene: Button, CopyButton, Dropdown, Combobox, ConfirmationPanel, Radio, Checkbox, Search, Select, TextField, Textarea, Helptext, LinkPanel, Link, ReadMore, Stepper og Tabs. Endringen skal ikke brekke noe så lenge man ikke har overskrevet farger manuelt.
5 changes: 5 additions & 0 deletions .changeset/three-chefs-notice2.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": major
---

Tokens: Nye tokens `--a-text-action-hover`,`--a-icon-action-hover` og `--a-border-action-hover`
7 changes: 7 additions & 0 deletions .changeset/tiny-trainers-float.md
@@ -0,0 +1,7 @@
---
"@navikt/aksel-stylelint": major
"@navikt/ds-react": major
"@navikt/ds-css": major
---

Textarea: Fjernet div med klassen navds-textarea\_\_wrapper
5 changes: 5 additions & 0 deletions .changeset/tricky-zoos-clap.md
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": major
---

Modal: Strengere prop-typer
1 change: 1 addition & 0 deletions @navikt/aksel-icons/config/template.js
Expand Up @@ -25,6 +25,7 @@ const template = (variables, { tpl }) => {
};

return tpl`
"use client";
${imports};

${variables.interfaces};
Expand Down
24 changes: 15 additions & 9 deletions @navikt/aksel-icons/package.json
Expand Up @@ -20,24 +20,28 @@
"access": "public",
"provenance": true
},
"sideEffects": [
"*.svg"
],
"sideEffects": false,
"license": "MIT",
"main": "./dist/react/cjs/index.js",
"module": "./dist/react/esm/index.js",
"typings": "./dist/react/esm/index.d.ts",
"exports": {
".": {
"types": "./dist/react/esm/index.d.ts",
"import": "./dist/react/esm/index.js",
"require": "./dist/react/cjs/index.js"
"import": {
"types": "./dist/react/esm/index.d.ts",
"default": "./dist/react/esm/index.js"
},
"require": {
"types": "./dist/react/cjs/index.d.ts",
"default": "./dist/react/cjs/index.js"
}
},
"./svg/*.svg": "./dist/svg/*.svg",
"./metadata": {
"types": "./dist/metadata.d.ts",
"default": "./dist/metadata.js"
}
},
"./svg/*.svg": "./dist/svg/*.svg",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
Expand All @@ -55,7 +59,8 @@
"parse-svg": "node -e 'require(\"./config/parse-svg.js\").main()'",
"copy": "copyfiles util/* src",
"update-metadata": "node config/metadata.js",
"build": "yarn copy && yarn create-icons && concurrently \"tsc\" \"tsc -p tsconfig.esm.json\" && node config/cleanTypes.js && yarn update-metadata && yarn parse-svg",
"write-packagejson": "echo '{\"type\": \"module\"}' > dist/react/esm/package.json",
"build": "yarn copy && yarn create-icons && concurrently \"tsc\" \"tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json && yarn write-packagejson\" && node config/cleanTypes.js && yarn update-metadata && yarn parse-svg",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"fetch-new:icons": "node config/figma/index.mjs",
"zip:icons": "node config/zip.js"
Expand All @@ -75,6 +80,7 @@
"lodash.startcase": "4.4.0",
"react": "^18.0.0",
"rehype-parse": "8.0.4",
"tsc-alias": "1.8.8",
"typescript": "^5.1.6",
"unified": "10.1.2"
},
Expand Down
6 changes: 5 additions & 1 deletion @navikt/aksel-icons/tsconfig.esm.json
Expand Up @@ -3,7 +3,11 @@
"compilerOptions": {
"outDir": "./dist/react/esm",
"module": "esnext",
"sourceMap": false,
"sourceMap": true,
"declaration": true
},
"tsc-alias": {
"resolveFullPaths": true,
"verbose": false
}
}
4 changes: 3 additions & 1 deletion @navikt/aksel-icons/tsconfig.json
Expand Up @@ -3,7 +3,9 @@
"compilerOptions": {
"outDir": "./dist/react/cjs",
"module": "commonjs",
"skipLibCheck": true
"skipLibCheck": true,
"declaration": true,
"sourceMap": true
},
"exclude": ["./util", "./__tests__", "**/*.stories.*"],
"include": ["./src"]
Expand Down
10 changes: 10 additions & 0 deletions @navikt/aksel-stylelint/src/deprecations.ts
Expand Up @@ -50,4 +50,14 @@ export const deprecations: DeprecatedList = [
message:
"There is no 1:1 replacement for this, the size will depend on the 'poster' prop and the viewport width",
},
{
classes: ["navds-grid", "navds-content-container"],
deprecatePrefix: true,
message:
"Components were replaced by `HGrid` and `Page.Block` in version 6",
},
{
classes: ["navds-textarea__wrapper"],
message: "Removed in v6.0.0",
},
];
10 changes: 10 additions & 0 deletions @navikt/aksel/src/codemod/migrations.ts
Expand Up @@ -87,6 +87,16 @@ export const migrations: {
path: "v4.0.0/date/date",
},
],
"v6.0.0": [
{
description:
"Removes `backgroundColor` and `avatarBgColor` properties from `Chat` and `Chat.Bubble`",
value: "v6-chat",
path: "v6.0.0/chat/chat",
warning:
"Remember to update use of `variant`-prop to match previous use of colors. If needed the component exposes css-variables for custom overrides",
},
],
};

export function getMigrationPath(str: string) {
Expand Down
75 changes: 75 additions & 0 deletions @navikt/aksel/src/codemod/transforms/v6.0.0/chat/chat.ts
@@ -0,0 +1,75 @@
import { getLineTerminator } from "../../../utils/lineterminator";

/**
* @param {import('jscodeshift').FileInfo} file
* @param {import('jscodeshift').API} api
*/
export default function transformer(file, api) {
const j = api.jscodeshift;
let localName = "Chat";

const root = j(file.source);

/* Finds used name for Chat component */
root
.find(j.ImportDeclaration)
.filter((path) => path.node.source.value === "@navikt/ds-react")
.forEach((imp) => {
imp.value.specifiers.forEach((x) => {
if (x.imported.name === "Chat" && x.local.name !== x.imported.name) {
localName = x.local.name;
}
});
});

root
.find(j.JSXElement, {
openingElement: {
name: {
name: localName,
},
},
})
.forEach((path) => {
j(path)
.find(j.JSXAttribute, {
name: {
name: "backgroundColor",
},
})
.remove();
j(path)
.find(j.JSXAttribute, {
name: {
name: "avatarBgColor",
},
})
.remove();
});

root
.find(j.JSXElement, {
openingElement: {
name: {
type: "JSXMemberExpression",
object: {
name: localName,
},
property: {
name: "Bubble",
},
},
},
})
.forEach((path) => {
j(path)
.find(j.JSXAttribute, {
name: {
name: "backgroundColor",
},
})
.remove();
});

return root.toSource(getLineTerminator(file.source));
}
@@ -0,0 +1,12 @@
import { check } from "../../../../utils/check";

const migration = "chat";
const fixtures = ["import-alias", "idempotent"];

for (const fixture of fixtures) {
check(__dirname, {
fixture,
migration,
extension: "js",
});
}
@@ -0,0 +1,17 @@
import {
Chat,
Button,
} from "@navikt/ds-react";

export const Demo = () => (
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
<Chat.Bubble>
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
</Chat.Bubble>
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
<Chat.Bubble>
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
labore nisi ut.
</Chat.Bubble>
</Chat>
);
@@ -0,0 +1,17 @@
import {
Chat,
Button,
} from "@navikt/ds-react";

export const Demo = () => (
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
<Chat.Bubble>
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
</Chat.Bubble>
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
<Chat.Bubble>
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
labore nisi ut.
</Chat.Bubble>
</Chat>
);
@@ -0,0 +1,17 @@
import {
Chat as DsChat,
Button,
} from "@navikt/ds-react";

export const Demo = () => (
<DsChat avatar="ON" name="Ola Normann" backgroundColor="#321" timestamp="01.01.21 14:00" avatarBgColor="#123" >
<DsChat.Bubble>
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
</DsChat.Bubble>
<DsChat.Bubble backgroundColor="#fff">Tempor fugiat amet eu sint in in ullamco.</DsChat.Bubble>
<DsChat.Bubble backgroundColor="#111">
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
labore nisi ut.
</DsChat.Bubble>
</DsChat>
);
@@ -0,0 +1,17 @@
import {
Chat as DsChat,
Button,
} from "@navikt/ds-react";

export const Demo = () => (
<DsChat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
<DsChat.Bubble>
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
</DsChat.Bubble>
<DsChat.Bubble>Tempor fugiat amet eu sint in in ullamco.</DsChat.Bubble>
<DsChat.Bubble>
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
labore nisi ut.
</DsChat.Bubble>
</DsChat>
);
@@ -0,0 +1,17 @@
import {
Chat,
Button,
} from "@navikt/ds-react";

export const Demo = () => (
<Chat avatar="ON" name="Ola Normann" backgroundColor="#321" timestamp="01.01.21 14:00" avatarBgColor="#123" >
<Chat.Bubble>
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
</Chat.Bubble>
<Chat.Bubble backgroundColor="#fff">Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
<Chat.Bubble backgroundColor="#111">
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
labore nisi ut.
</Chat.Bubble>
</Chat>
);