Compare commits

..
Author SHA1 Message Date
github-actions[bot]andgithub-actions[bot] 9691ac4713 Version Packages (#1768)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-27 11:51:25 +01:00
Ken 7174bbe7bf 🐛 Fikset visning av tema-grupperinger i sanity 2023-01-27 11:47:05 +01:00
Ken 62f36da5e7 📝 Changeset 2023-01-27 10:23:41 +01:00
Ken 9ec5133ba2 💄 +4px horisontal padding small textfield (team-aksel/issues/89) 2023-01-27 10:23:01 +01:00
Ken 0a7906187f 🔥 Linting 2023-01-27 10:17:56 +01:00
Ken 28f2a3f532 ♿ Aria-live polite på tilbakemeldinger 2023-01-27 10:16:54 +01:00
Ken f5d404b925 🐛 Fikset proptabell-feil med dl-lister 2023-01-27 10:00:06 +01:00
Ken 05955acaf7 ♿ Fikset tabindex scrolltop, skiplink 2023-01-27 09:51:05 +01:00
Ken 55362f3ea7 🎨 Fikset team-aksel#145 issue god-praksis forfatter og dato 2023-01-27 09:42:20 +01:00
Ken 28f8f7a408 🐛 System-theme light fungerte ikke i Sanity 2023-01-27 09:34:38 +01:00
Ken 6778e902f3 ♿ Fikset heading-nivå for artikkelkort på landingssider god-praksis 2023-01-26 16:04:36 +01:00
Ken 92566d5750 Merge branch 'master' of https://github.com/navikt/Designsystemet 2023-01-26 15:38:11 +01:00
Kai Erik Schieren 6911913748 ✨ cmp label (#1765) 2023-01-26 13:49:40 +01:00
Kai Erik Schieren 7f3e96ae01 🎨 add labels to issue templates (#1764) 2023-01-26 12:55:42 +01:00
Ken 19791c0339 Merge branch 'master' into next 2023-01-26 12:17:03 +01:00
Kai Erik Schieren 6a00fca823 Issue templates (#1763)
* ✨ new component issue template

* ✨ add templates for feeback icon + cmp
2023-01-26 09:40:54 +01:00
Ole Jørgen Bakken f5d3ed8eee Endret til textarea i svaralternativet (#1762) 2023-01-25 14:56:07 +01:00
Ole Jørgen Bakken 5c00b91dfb Legger til en issue form for nye ikoner (#1761) 2023-01-25 14:53:13 +01:00
Ken 5b82182fda 🔥 Fjernet gamle sanity-felt 2023-01-25 09:26:55 +01:00
Ken 6246c1d311 📝 Readmes 2023-01-25 09:18:46 +01:00
Ken 04ad4d09b2 ⬆️ Oppdatert sanity 2023-01-24 16:02:07 +01:00
Ken 65ddd4bd18 Merge branch 'master' into next 2023-01-24 15:47:30 +01:00
Ken f51d43c06a Revert "✨ Ny tokenvisning"
This reverts commit ff2515fabb.
2023-01-10 10:44:41 +01:00
Ken 8c81ae46e0 Revert "💄 Copytoken med tooltip"
This reverts commit 21da657eb0.
2023-01-10 10:43:50 +01:00
Ken d64da78d8b Merge branch 'master' into next 2023-01-09 09:05:25 +01:00
Ken 21da657eb0 💄 Copytoken med tooltip 2023-01-05 11:03:20 +01:00
Ken 52d2d5f41d Merge branch 'tokens/refactor-v2' into next 2023-01-03 14:18:30 +01:00
Ken ff2515fabb ✨ Ny tokenvisning 2023-01-03 13:31:05 +01:00
Ken 23066e9503 ⬆️ Oppdatert aksel til å bruke clsx 2022-12-25 14:19:25 +01:00
68 changed files with 1099 additions and 743 deletions

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
name: Ny komponent
description: Send et ønske om en eller flere nye komponenter
title: "[Ny komponent]: "
labels: ["nytt ✨", "forespørsel 🥰", "komponenter 🧩"]
assignees:
- olejorgenbakken
body:
- type: markdown
attributes:
value: |
Takk for at du bidrar inn i Aksel!
- type: input
id: title
attributes:
label: Navn på komponent
description: Hva er navnet på komponenten du ønsker deg?
placeholder: eks. datepicker
validations:
required: true
- type: textarea
id: examples
attributes:
label: Eksempel på komponenten
description: Send en lenke til eksempler på komponenten
+24
View File
@@ -0,0 +1,24 @@
name: Nytt ikon
description: Send et ønske om et eller flere nye ikoner
title: "[Nytt ikon]: "
labels: ["nytt ✨", "ikoner 🖼", "forespørsel 🥰"]
assignees:
- olejorgenbakken
body:
- type: markdown
attributes:
value: |
Takk for at du bidrar inn i Aksel!
- type: input
id: title
attributes:
label: Navn på ikonet
description: Hva er navnet på ikonet du ønsker deg?
placeholder: eks. send
validations:
required: true
- type: textarea
id: examples
attributes:
label: Eksempel på ikonet
description: Send en lenke til eksempler på ikonet
@@ -0,0 +1,16 @@
name: Innspill til komponent
description: Send inn innspill til komponent
title: "[Innspill til komponent]: "
labels: ["forespørsel 🥰", "komponenter 🧩"]
assignees:
- olejorgenbakken
body:
- type: markdown
attributes:
value: |
Takk for at du bidrar inn i Aksel!
- type: textarea
id: feeback
attributes:
label: Tilbakemelding
description: Beskriv hvilke tilbakemeldinger du har til komponenten
+16
View File
@@ -0,0 +1,16 @@
name: Innspill til ikon
description: Send inn innspill til ikon
title: "[Innspill til ikon]: "
labels: ["forespørsel 🥰"]
assignees:
- olejorgenbakken
body:
- type: markdown
attributes:
value: |
Takk for at du bidrar inn i Aksel!
- type: textarea
id: feeback
attributes:
label: Tilbakemelding
description: Beskriv hvilke tilbakemeldinger du har til ikonet
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-codemod
## 2.1.2
## 2.1.1
## 2.1.0
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-codemod",
"version": "2.1.1",
"version": "2.1.2",
"description": "Aksel codemods for NAVs designsystem",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
+2 -2
View File
@@ -39,8 +39,8 @@
"build-pict": "svgr --silent --index-template index-template.js --out-dir src/pictograms pictograms"
},
"dependencies": {
"@navikt/ds-icons": "^2.1.1",
"@navikt/ds-react": "^2.1.1",
"@navikt/ds-icons": "^2.1.2",
"@navikt/ds-react": "^2.1.2",
"clsx": "^1.1.1"
},
"devDependencies": {
+6
View File
@@ -1,5 +1,11 @@
# @navikt/ds-css
## 2.1.2
### Patch Changes
- [`62f36da5e`](https://github.com/navikt/Designsystemet/commit/62f36da5e74fc7f53414d42b310c3b57597795bc) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Small textfield har nå 8px horisontal padding (4px før)
## 2.1.1
## 2.1.0
+1 -1
View File
@@ -27,7 +27,7 @@
}
.navds-form-field--small .navds-text-field__input {
padding: 0 0.25rem;
padding: 0 0.5rem;
min-height: 32px;
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css",
"version": "2.1.1",
"version": "2.1.2",
"description": "CSS for NAV Designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
@@ -20,7 +20,7 @@
"watch": "postcss --watch --use postcss-import -o dist/index.css index.css"
},
"devDependencies": {
"@navikt/ds-tokens": "^2.1.1",
"@navikt/ds-tokens": "^2.1.2",
"normalize.css": "^8.0.1",
"postcss": "^8.4.0",
"postcss-cli": "^9.0.0",
+7
View File
@@ -1,5 +1,12 @@
# @navikt/ds-react
## 2.1.2
### Patch Changes
- Updated dependencies []:
- @navikt/ds-icons@2.1.2
## 2.1.1
### Patch Changes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react",
"version": "2.1.1",
"version": "2.1.2",
"description": "Aksel react-components for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -37,7 +37,7 @@
},
"dependencies": {
"@floating-ui/react": "0.17.0",
"@navikt/ds-icons": "^2.1.1",
"@navikt/ds-icons": "^2.1.2",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^1.2.1",
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-tailwind
## 2.1.2
## 2.1.1
## 2.1.0
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tailwind",
"version": "2.1.1",
"version": "2.1.2",
"description": "Tailwind config based on @navikt/ds-tokens",
"author": "Aksel | NAV designsystem team",
"keywords": [
@@ -22,7 +22,7 @@
"directory": "@navikt/core/tailwind"
},
"devDependencies": {
"@navikt/ds-tokens": "^2.1.1",
"@navikt/ds-tokens": "^2.1.2",
"@types/jest": "^29.0.0",
"color": "4.2.3",
"jest": "^29.0.0",
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-tokens
## 2.1.2
## 2.1.1
## 2.1.0
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tokens",
"version": "2.1.1",
"version": "2.1.2",
"description": "Design-tokens for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-icons
## 2.1.2
## 2.1.1
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-icons",
"version": "2.1.1",
"version": "2.1.2",
"description": "Aksel icons for NAV",
"author": "Aksel | NAV designsystem team",
"repository": {
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-css-internal
## 2.1.2
## 2.1.1
## 2.1.0
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css-internal",
"version": "2.1.1",
"version": "2.1.2",
"description": "CSS for NAV internal Designsystem-components",
"author": "Aksel | NAV designsystem team",
"keywords": [
+8
View File
@@ -1,5 +1,13 @@
# @navikt/ds-react-internal
## 2.1.2
### Patch Changes
- Updated dependencies []:
- @navikt/ds-react@2.1.2
- @navikt/ds-icons@2.1.2
## 2.1.1
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react-internal",
"version": "2.1.1",
"version": "2.1.2",
"description": "Aksel react components for internal UIs in NAV",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -35,8 +35,8 @@
"watch": "tsc --watch -p tsconfig.esm.json"
},
"dependencies": {
"@navikt/ds-icons": "^2.1.1",
"@navikt/ds-react": "^2.1.1",
"@navikt/ds-icons": "^2.1.2",
"@navikt/ds-react": "^2.1.2",
"clsx": "^1.1.1",
"copy-to-clipboard": "^3.3.1"
},
+3 -2
View File
@@ -39,7 +39,8 @@
aksel.nav.no/
├── website # NEXT.JS app (v12)
└── sanity # Sanity CMS-app (v2)
├── website/sanity # Sanity CMS-app (v3)
└── sanity # Sanity CMS-app (deprecated v2)
```
## Commands
@@ -71,7 +72,7 @@ Vi tar gjerne i mot PR-er [CONTRIBUTING.md](https://github.com/navikt/Designsyst
## Codeowners
Løsningen forvaltes av team Aksel/Designsystemet
Løsningen forvaltes av team Aksel
[Slack](https://nav-it.slack.com/archives/C7NE7A8UF)
+8 -8
View File
@@ -15,14 +15,14 @@
"website"
],
"dependencies": {
"@navikt/ds-codemod": "^2.1.1",
"@navikt/ds-css": "^2.1.1",
"@navikt/ds-css-internal": "^2.1.1",
"@navikt/ds-icons": "^2.1.1",
"@navikt/ds-react": "^2.1.1",
"@navikt/ds-react-internal": "^2.1.1",
"@navikt/ds-tailwind": "^2.1.1",
"@navikt/ds-tokens": "^2.1.1"
"@navikt/ds-codemod": "^2.1.2",
"@navikt/ds-css": "^2.1.2",
"@navikt/ds-css-internal": "^2.1.2",
"@navikt/ds-icons": "^2.1.2",
"@navikt/ds-react": "^2.1.2",
"@navikt/ds-react-internal": "^2.1.2",
"@navikt/ds-tailwind": "^2.1.2",
"@navikt/ds-tokens": "^2.1.2"
},
"devDependencies": {
"prettier-plugin-tailwindcss": "^0.1.13"
@@ -1,7 +1,7 @@
import { ExternalLink } from "@navikt/ds-icons";
import { BodyLong, Detail, Heading, Ingress, Link } from "@navikt/ds-react";
import BlockContent from "@sanity/block-content-to-react";
import cl from "classnames";
import cl from "clsx";
import InnholdsKort from "components/sanity-modules/cards/InnholdsKort";
import NextLink from "next/link";
import React, { createContext, useContext } from "react";
@@ -56,13 +56,14 @@ const FooterForm = () => {
return (
<>
<div className="flex w-full max-w-md flex-col gap-8" data-theme="dark">
{sent.status ? (
<div>
<div aria-live="polite">
{sent.status && (
<Label spacing as="p">
Meldingen er sendt til Aksel, takk for tilbakemeldingen!
</Label>
</div>
) : (
)}
</div>
{!sent.status && (
<form onSubmit={(e) => handleSubmit(e)} className="w-full">
<div className="mb-4 flex flex-col gap-4">
<Heading level="2" size="small">
@@ -1,6 +1,6 @@
import { Close, Hamburger as HamburgerIcon } from "@navikt/ds-icons";
import { Button } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import Link from "next/link";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
@@ -1,7 +1,7 @@
import Logo from "components/assets/Logo";
import Link from "next/link";
import { logNav } from "../..";
import cl from "classnames";
import cl from "clsx";
import { useRouter } from "next/router";
import { Hamburger } from "components/layout/header/Hamburger";
@@ -42,7 +42,7 @@ export const Header = ({
}) => {
return (
<>
<a className="skiplink" href="#hovedinnhold" tabIndex={-1}>
<a className="skiplink" href="#hovedinnhold">
Hopp til innhold
</a>
<header
@@ -1,7 +1,7 @@
import { SanityT, urlFor } from "@/lib";
import { SanityBlockContent } from "@/sanity-block";
import { Next } from "@navikt/ds-icons";
import { BodyShort, Heading, Ingress, Label } from "@navikt/ds-react";
import { BodyShort, Detail, Heading, Ingress, Label } from "@navikt/ds-react";
import ArtikkelCard from "components/sanity-modules/cards/ArtikkelCard";
import Head from "next/head";
import NextLink from "next/link";
@@ -55,7 +55,7 @@ const AkselArtikkelTemplate = ({
</Heading>
<div className="card-grid-3-1 mt-6 px-4">
{data.relevante_artikler.map((x: any) =>
x && x?._id ? <ArtikkelCard {...x} key={x._id} /> : null
x && x?._id ? <ArtikkelCard level="3" {...x} key={x._id} /> : null
)}
</div>
</div>
@@ -123,18 +123,22 @@ const AkselArtikkelTemplate = ({
{data?.ingress}
</Ingress>
)}
<div className="mt-6 flex gap-3 text-base">
<BodyShort
size="small"
as="span"
className="text-text-subtle whitespace-nowrap"
>
<div className="mt-6 inline-flex flex-wrap items-center gap-2 text-base">
<Detail uppercase as="span">
{dateStr(date)}
</BodyShort>
</Detail>
{authors?.length > 0 && (
<BodyShort size="small" as="div" className="flex flex-wrap gap-1">
<address className="not-italic">{authors[0]}</address>
</BodyShort>
<>
<span className="bg-deepblue-700 h-2 w-2 rotate-45 rounded-[1px] opacity-25" />
<BodyShort
size="small"
as="div"
className="flex flex-wrap gap-1"
>
<address className="not-italic">{authors?.[0]}</address>
</BodyShort>
</>
)}
</div>
{hasTema && (
@@ -1,7 +1,7 @@
import { SanityT, urlFor } from "@/lib";
import { SanityBlockContent } from "@/sanity-block";
import { BodyShort, Heading, Ingress, Label } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import { Header } from "components/layout/header/Header";
import Head from "next/head";
import { Footer } from "..";
@@ -5,7 +5,7 @@ import { Header } from "components/layout/header/Header";
import { Sidebar } from "components/layout/sidebar/Sidebar";
import Feedback from "components/website-modules/feedback";
import { ReactNode } from "react";
import cl from "classnames";
import cl from "clsx";
import NextLink from "next/link";
import { capitalize } from "@/utils";
import Image from "next/image";
@@ -2,7 +2,7 @@ import { SidebarT } from "@/lib";
import { logNav } from "@/utils";
import { Expand } from "@navikt/ds-icons";
import { BodyShort, Detail, Tag } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import Link from "next/link";
import { useRouter } from "next/router";
import { useMemo, useState } from "react";
@@ -3,7 +3,7 @@ import { withErrorBoundary } from "@/error-boundary";
import { SanityT, urlFor } from "@/lib";
import { ErrorFilled, SuccessFilled, WarningFilled } from "@navikt/ds-icons";
import { BodyShort } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import React from "react";
const GetIcon = (s: string) => {
@@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import { BodyLong, Link } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import React from "react";
import { urlFor, SanityT } from "@/lib";
import { withErrorBoundary } from "@/error-boundary";
@@ -1,6 +1,6 @@
import { withErrorBoundary } from "@/error-boundary";
import { BodyShort } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import NextLink from "next/link";
import Image from "next/image";
import { logNav } from "@/utils";
@@ -1,5 +1,5 @@
import { BodyShort, Heading } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import NextLink from "next/link";
import React from "react";
import { logNav } from "@/components";
@@ -2,7 +2,7 @@ import { capitalize, Snippet } from "@/components";
import { withErrorBoundary } from "@/error-boundary";
import { SanityT } from "@/lib";
import { BodyLong, Link, Chips } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import { useEffect, useState } from "react";
import { CodeSandbox } from "./CodeSandbox";
@@ -2,7 +2,7 @@ import { SuccessStroke } from "@navikt/ds-icons";
import { useRef, useState, useEffect } from "react";
import copy from "copy-to-clipboard";
import React from "react";
import cl from "classnames";
import cl from "clsx";
import style from "./index.module.css";
import { CopyIcon } from "@sanity/icons";
@@ -1,6 +1,6 @@
import { withErrorBoundary } from "@/error-boundary";
import { SanityT } from "@/lib";
import cl from "classnames";
import cl from "clsx";
import Highlight, { defaultProps } from "prism-react-renderer";
import React from "react";
import CopyButton from "./CopyButton";
@@ -2,7 +2,7 @@
import { SanityT, urlFor } from "@/lib";
import { Heading } from "@navikt/ds-react";
import Nextlink from "next/link";
import cl from "classnames";
import cl from "clsx";
import Image from "next/image";
import { StatusTag } from "components/website-modules/StatusTag";
@@ -37,15 +37,15 @@ const List = ({ prop, parent }: { prop: any; parent: string }) => {
<span>{prop.type ? <>{Highlighter({ type: prop.type })}</> : ""}</span>
</dt>
{prop.description && (
<dl className="font-sans text-base">{prop.description}</dl>
<dd className="font-sans text-base">{prop.description}</dd>
)}
{prop.name === "ref" && prop.type.includes("Ref<") && (
<dl className="font-sans text-base">
<dd className="font-sans text-base">
{`${parent} extends ${prop.type.slice(
prop.type.indexOf("<") + 1,
prop.type.lastIndexOf(">")
)}`}
</dl>
</dd>
)}
</Detail>
);
@@ -1,6 +1,6 @@
import { withErrorBoundary } from "@/error-boundary";
import { SanityT } from "@/lib";
import cl from "classnames";
import cl from "clsx";
import React from "react";
const KBD = (props: React.HTMLAttributes<HTMLElement>) => (
@@ -3,7 +3,7 @@ import { SanityT } from "@/lib";
import { SanityBlockContent } from "@/sanity-block";
import { Edit, LightBulb } from "@navikt/ds-icons";
import { Detail, Link } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import React from "react";
import style from "./tips.module.css";
@@ -1,5 +1,5 @@
import { Copy, SuccessStroke } from "@navikt/ds-icons";
import cl from "classnames";
import cl from "clsx";
import copystring from "copy-to-clipboard";
import { useEffect, useRef, useState } from "react";
@@ -1,6 +1,6 @@
import { withErrorBoundary } from "@/error-boundary";
import { BodyLong, ReadMore } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import { useState } from "react";
const Video = ({
@@ -1,7 +1,7 @@
import { withErrorBoundary } from "@/error-boundary";
import Link from "next/link";
import React from "react";
import cl from "classnames";
import cl from "clsx";
import { logNav } from "@/utils";
const AkselLink = ({
@@ -1,6 +1,6 @@
import NextLink from "next/link";
import { useRouter } from "next/router";
import cl from "classnames";
import cl from "clsx";
export const BreadCrumbs = ({
href,
@@ -1,5 +1,5 @@
import { Heading } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import React from "react";
export const LevelTwoHeading = ({
@@ -3,7 +3,7 @@ import NextLink from "next/link";
import { dateStr } from "@/utils";
import { BodyLong, BodyShort, Heading, Link } from "@navikt/ds-react";
import { SanityT, urlFor } from "@/lib";
import cl from "classnames";
import cl from "clsx";
import { getImage } from "components/website-modules/utils/get-image";
import { SanityBlockContent } from "@/sanity-block";
@@ -1,6 +1,6 @@
import { removeEmojies } from "@/utils";
import { BodyShort, Heading, Link } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import throttle from "lodash/throttle";
import * as React from "react";
import { useEffect, useState } from "react";
@@ -1,6 +1,6 @@
import { removeEmojies } from "@/utils";
import { BodyShort, Link } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import throttle from "lodash/throttle";
import * as React from "react";
import { useEffect, useState } from "react";
@@ -5,10 +5,9 @@ export const ScrollTop = () => {
<button
onClick={() => {
window.scrollTo(0, 0);
document.getElementById("hovedinnhold")?.focus?.();
}}
className="text-xlarge text-text-on-inverted focus-visible:shadow-focus-inverted group -mt-[10px] flex h-[48px] w-fit items-center justify-center gap-2 rounded p-2 font-semibold hover:underline focus:outline-none"
aria-hidden
id="scroll-top-button"
>
<svg
fill="none"
@@ -1,5 +1,5 @@
import styles from "./cube.module.css";
import cl from "classnames";
import cl from "clsx";
const Rect = ({ ...props }) => (
<svg
@@ -1,6 +1,6 @@
import { ComponentType } from "react";
import styles from "./examples.module.css";
import cl from "classnames";
import cl from "clsx";
export const withDsExample = (
Component: ComponentType,
@@ -1,14 +1,8 @@
import { BodyShort, Button, Heading, Label, Textarea } from "@navikt/ds-react";
import cl from "classnames";
import { useRouter } from "next/router";
import React, {
useCallback,
useContext,
useEffect,
useRef,
useState,
} from "react";
import { FeedbackT, HelpfulArticleEnum } from "@/lib";
import { Button, Heading, Label, Textarea } from "@navikt/ds-react";
import cl from "clsx";
import { useRouter } from "next/router";
import { useCallback, useContext, useEffect, useRef, useState } from "react";
import { AmplitudeEvents, IdContext, logAmplitudeEvent } from "../utils";
const Feedback = ({
@@ -99,7 +93,7 @@ const Feedback = ({
setThanksFeedback(true);
timeoutTimer.current = window.setTimeout(() => {
setThanksFeedback(false);
}, 3000);
}, 6000);
return () => {
if (timeoutTimer.current) {
@@ -246,9 +240,13 @@ const Feedback = ({
</Button>
</form>
)}
{thanksFeedback && (
<BodyShort size="small">Takk for tilbakemeldingen!</BodyShort>
)}
<div aria-live="polite">
{thanksFeedback && (
<Heading size="small" as="p" className="mt-8">
Takk for tilbakemeldingen!
</Heading>
)}
</div>
</div>
</div>
);
-2
View File
@@ -10,7 +10,6 @@ test.describe("Axe a11y", () => {
const accessibilityScanResults = await new AxeBuilder({ page })
.disableRules(["definition-list", "scrollable-region-focusable"])
.exclude("iframe")
.exclude("#scroll-top-button")
.analyze();
expect(accessibilityScanResults.violations).toEqual([]);
});
@@ -21,5 +20,4 @@ test.describe("Axe a11y", () => {
Disabled rules:
- definition-list: 'div' as a direct child of 'dl' should be valid. Ignoring failed test.
- scrollable-region-focusable: Up for discussion. Should code-block be focusable fot easier access and allowing scroll with keyboard?
- Excluded "Til toppen" button to avoid error around focusable items with aria-hidden
*/
+12 -12
View File
@@ -23,19 +23,19 @@
},
"dependencies": {
"@sanity/block-content-to-react": "^3.0.0",
"@sanity/client": "^3.3.0",
"@sanity/code-input": "3.0.1",
"@sanity/color-input": "^3.0.1",
"@sanity/icons": "2.1.0",
"@sanity/image-url": "1.0.1",
"@sanity/preview-kit": "^1.2.8",
"@sanity/client": "^4.0.1",
"@sanity/code-input": "4.0.0",
"@sanity/color-input": "^3.0.2",
"@sanity/icons": "2.2.2",
"@sanity/image-url": "1.0.2",
"@sanity/preview-kit": "^1.3.2",
"@sanity/table": "1.0.1",
"@sanity/ui": "^1.0.0",
"@sanity/vision": "3.0.6",
"@sanity/vision": "3.2.5",
"@svgr/webpack": "^5.5.0",
"amplitude-js": "^8.8.0",
"boring-avatars": "1.7.0",
"classnames": "^2.3.1",
"clsx": "^1.2.1",
"codesandbox": "^2.2.3",
"color": "4.2.3",
"copy-to-clipboard": "^3.3.1",
@@ -45,17 +45,17 @@
"jwt-decode": "3.1.2",
"lodash": "^4.17.21",
"next": "^12.2.0",
"next-sanity": "^3.1.4",
"next-sanity": "^4.1.1",
"prettier": "2.7.1",
"prism-react-renderer": "^1.3.0",
"prismjs": "^1.27.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-modal": "3.15.1",
"sanity": "3.0.6",
"sanity-plugin-asset-source-unsplash": "^1.0.0",
"sanity": "3.2.5",
"sanity-plugin-asset-source-unsplash": "^1.0.6",
"sanity-plugin-iframe-pane": "^2.1.1",
"sanity-plugin-media": "^2.0.2",
"sanity-plugin-media": "^2.0.4",
"sitemap": "^7.0.0",
"styled-components": "^5.2",
"swr": "^1.1.2",
@@ -1,9 +1,21 @@
import { NextStudio } from "next-sanity/studio";
import { useState } from "react";
import { useEffect, useState } from "react";
import { workspaceConfig } from "../../sanity/sanity.config";
const StudioPage = () => {
const [scheme, setScheme] = useState("light");
const [scheme, setScheme] = useState("dark");
useEffect(() => {
const theme = localStorage.getItem("sanityStudio:ui:colorScheme");
if (theme) {
setScheme(theme);
} else {
/* Assume user using system-theme */
window?.matchMedia &&
window?.matchMedia("(prefers-color-scheme: dark)").matches
? setScheme("dark")
: setScheme("light");
}
}, []);
return (
<div
@@ -4,7 +4,7 @@ import { akselTemaDocs, getAkselTema, SanityT, urlFor } from "@/lib";
import { SanityBlockContent } from "@/sanity-block";
import { getClient } from "@/sanity-client";
import { Detail, Heading, Label } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import { Header } from "components/layout/header/Header";
import ArtikkelCard from "components/sanity-modules/cards/ArtikkelCard";
import { AkselCubeStatic } from "components/website-modules/cube";
@@ -166,6 +166,7 @@ const Page = ({ tema: page }: PageProps): JSX.Element => {
(x: ArtiklerT) => (
<ArtikkelCard
{...x}
level="3"
source={page?.slug?.current}
key={x._id}
variant="god-praksis"
@@ -2,7 +2,7 @@ import { grunnleggendeLandingQuery, SidebarT, urlFor } from "@/lib";
import { SanityBlockContent } from "@/sanity-block";
import { getClient } from "@/sanity-client";
import { Heading, Ingress } from "@navikt/ds-react";
import cl from "classnames";
import cl from "clsx";
import { WithSidebar } from "components/layout/page-templates/WithSidebar";
import ComponentOverview from "components/sanity-modules/component-overview";
import { PreviewSuspense } from "next-sanity/preview";
+1 -1
View File
@@ -21,7 +21,7 @@ import { PreviewSuspense } from "next-sanity/preview";
import Head from "next/head";
import Link from "next/link";
import { lazy, useEffect, useState } from "react";
import cl from "classnames";
import cl from "clsx";
function getPrefersReducedMotion() {
const QUERY = "(prefers-reduced-motion: no-preference)";
@@ -8,7 +8,7 @@ import { PreviewSuspense } from "next-sanity/preview";
import Head from "next/head";
import { lazy } from "react";
import { komponentKategorier } from "../../sanity/config";
import cl from "classnames";
import cl from "clsx";
const Page = ({
page,
@@ -4,12 +4,13 @@ import { StructureBuilder } from "sanity/desk";
/* documentStore is in Alpha, so avoid using for now */
export const GodPraksisPanes = async (getClient, S: StructureBuilder) => {
let tema = await getClient({ apiVersion: "2021-06-07" }).fetch(
`*[_type == "aksel_tema" && defined(seksjoner)]{title,seksjoner, _id}`
`*[_type == "aksel_tema"]{title,seksjoner, _id}`
);
tema = tema
.map((x) => ({
title: x.title,
sider: x.seksjoner.reduce((b, n) => [...b, ...(n?.sider ?? [])], []),
sider:
x.seksjoner?.reduce((b, n) => [...b, ...(n?.sider ?? [])], []) || [],
_id: x._id,
}))
.filter(
@@ -34,15 +35,18 @@ export const GodPraksisPanes = async (getClient, S: StructureBuilder) => {
S.listItem()
.title(
`${title} (${
ids.filter((x) => x?.tema && x?.tema?.find?.((y) => y._ref === _id))
.length ?? 0
ids.filter(
(x) =>
x?.tema &&
x?.tema?.find?.((y) => y._ref === _id.replace("drafts.", ""))
).length ?? 0
})`
)
.child(
S.documentList()
.title(`${title}`)
.filter(`_type == 'aksel_artikkel' && $tag in tema[]->title`)
.params({ tag: title })
.filter(`_type == 'aksel_artikkel' && $tag in tema[]._ref`)
.params({ tag: _id.replace("drafts.", "") })
/* .menuItems([...S.documentTypeList("aksel_artikkel").getMenuItems()]) */
)
),
@@ -1,5 +1,5 @@
import differenceInMonths from "date-fns/differenceInMonths";
import differenceInDays from "date-fns/differenceInDays";
/* import differenceInDays from "date-fns/differenceInDays"; */
const isAfter = (date) => differenceInMonths(new Date(), new Date(date)) >= 6;
@@ -24,18 +24,12 @@ export const artikkelPreview = (_type: string) => {
].includes(type) &&
updateInfo
) {
const diff = Math.abs(
/* const diff = Math.abs(
differenceInDays(new Date(updateInfo), new Date())
);
); */
return {
title: heading,
subtitle: `${
isAfter(updateInfo)
? "UTDATERT"
: diff === 0
? "I dag"
: `${diff} dager`
} | ${_type} ${
subtitle: `${isAfter(updateInfo) ? "UTDATERT |" : ""} ${_type} ${
tema ?? kategori
? `${(tema ?? kategori) && "/ "}${tema ?? kategori ?? ``}`
: ""
@@ -8,9 +8,7 @@ export const styles = [
{
title: "Avsnitt",
value: "normal",
blockEditor: {
render: (props) => <p className="text-lg">{props.children}</p>,
},
component: (props) => <p className="text-lg">{props.children}</p>,
},
];
@@ -22,12 +20,12 @@ export const block = {
{
title: "Bullet-liste",
value: "bullet",
blockEditor: { icon: () => <OlistIcon aria-label="Ul-liste" /> },
icon: () => <OlistIcon aria-label="Ul-liste" />,
},
{
title: "Nummerert-liste",
value: "number",
blockEditor: { icon: () => <OlistIcon aria-label="Ol-liste" /> },
icon: () => <OlistIcon aria-label="Ol-liste" />,
},
],
marks: {
@@ -35,29 +33,28 @@ export const block = {
{
title: "Strong",
value: "strong",
blockEditor: { icon: () => <BoldIcon aria-label="Bold" /> },
icon: () => <BoldIcon aria-label="Bold" />,
},
{
title: "Italic",
value: "em",
blockEditor: { icon: () => <ItalicIcon aria-label="Italic" /> },
icon: () => <ItalicIcon aria-label="Italic" />,
},
{
title: "Inline-Kode",
value: "code",
blockEditor: { icon: () => <CodeIcon aria-label="Kode" /> },
icon: () => <CodeIcon aria-label="Kode" />,
},
{
title: "KBD",
value: "kbd",
blockEditor: {
icon: () => <div>KBD</div>,
render: (props) => (
<KBD padding={[1, 1, 2]} style={{ verticalAlign: "super" }}>
{props.children}
</KBD>
),
},
icon: () => <div>KBD</div>,
component: (props) => (
<KBD padding={[1, 1, 2]} style={{ verticalAlign: "super" }}>
{props.children}
</KBD>
),
},
],
annotations: [
@@ -65,9 +62,7 @@ export const block = {
title: "Link til sanity-side",
name: "internalLink",
type: "object",
blockEditor: {
icon: () => <Link title="Lenke til sanity-side" />,
},
icon: () => <Link title="Lenke til sanity-side" />,
options: {
modal: {
type: "dialog",
@@ -87,9 +82,7 @@ export const block = {
title: "Lenke",
name: "link",
type: "object",
blockEditor: {
icon: () => <ExternalLink title="Lenke til ekstern-side" />,
},
icon: () => <ExternalLink title="Lenke til ekstern-side" />,
fields: [
{
title: "URL",
@@ -28,33 +28,11 @@ const main = async () => {
);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const newData = [];
docs.forEach((data) => {
if (data?.slug_v2?.current) {
newData.push({
_id: data._id,
slug: data.slug_v2,
});
if (!data._id.includes("draft")) {
transactionClient.create({
_type: "redirect",
source: `/${data.slug.current}`,
destination: `/${data.slug_v2.current}`,
permanent: true,
});
}
} else {
console.log(data.heading);
}
transactionClient.patch(data._id, (p) => p.unset(["slug_v2"]));
});
for (const data of newData) {
const id = data._id;
delete data._id;
transactionClient.patch(id, (p) => p.set({ ...data }));
}
/* transactionClient.create({
_type: "redirect",
source: `/designsystem`,
+2 -2
View File
@@ -10,8 +10,8 @@
"preview": "vite preview"
},
"dependencies": {
"@navikt/ds-css": "2.1.1",
"@navikt/ds-react": "2.1.1",
"@navikt/ds-css": "2.1.2",
"@navikt/ds-react": "2.1.2",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
+834 -572
View File
File diff suppressed because it is too large. Load diff