Compare commits

...
Author SHA1 Message Date
github-actions[bot]andgithub-actions[bot] 98dbc155fe Version Packages (#1774)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-31 10:55:24 +01:00
Ken 87f194c1dc 📝 Changeset 2023-01-31 10:49:41 +01:00
Ken 7f73315264 🐛 useRangepicker edgecase ved valg av start etter slutt 2023-01-31 10:48:42 +01:00
Ken c027c2e464 ♿ role=img på ikoner fra sanity 2023-01-30 12:35:13 +01:00
Ken 92dd582d68 🐛 Bedre error-handling for feilede lenker 2023-01-30 11:34:18 +01:00
Ken bb302bbbd6 Merge branch 'master' of https://github.com/navikt/Designsystemet 2023-01-30 10:55:58 +01:00
Ken 55005c80f3 🐛 Fiket sanity-preview av Accordion 2023-01-30 09:58:02 +01:00
Ken 27e6423b54 Update README.md 2023-01-30 09:32:53 +01:00
Ken 21a842d419 🎨 Tilbakemeldingsvisning på 'forsiden' i sanity 2023-01-27 15:27:15 +01:00
30 changed files with 162 additions and 67 deletions

No files matched your search

+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-codemod
## 2.1.4
## 2.1.3
## 2.1.2
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-codemod",
"version": "2.1.3",
"version": "2.1.4",
"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.3",
"@navikt/ds-react": "^2.1.3",
"@navikt/ds-icons": "^2.1.4",
"@navikt/ds-react": "^2.1.4",
"clsx": "^1.1.1"
},
"devDependencies": {
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-css
## 2.1.4
## 2.1.3
## 2.1.2
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css",
"version": "2.1.3",
"version": "2.1.4",
"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.3",
"@navikt/ds-tokens": "^2.1.4",
"normalize.css": "^8.0.1",
"postcss": "^8.4.0",
"postcss-cli": "^9.0.0",
+9
View File
@@ -1,5 +1,14 @@
# @navikt/ds-react
## 2.1.4
### Patch Changes
- [`87f194c1d`](https://github.com/navikt/Designsystemet/commit/87f194c1dc29b10a604de676b358d117e2dbf52f) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Fikset edgecase i useRangepicker der valg av startdato etter sluttdato ga feil output
- Updated dependencies []:
- @navikt/ds-icons@2.1.4
## 2.1.3
### Patch Changes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react",
"version": "2.1.3",
"version": "2.1.4",
"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.3",
"@navikt/ds-icons": "^2.1.4",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^1.2.1",
@@ -164,6 +164,7 @@ export const UseRangedDatepicker = () => {
UNSAFE_useRangeDatepicker({
fromDate: new Date("Aug 23 2019"),
onRangeChange: console.log,
onValidate: console.log,
});
return (
@@ -1,4 +1,5 @@
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
import { isBefore } from "date-fns/esm";
import isWeekend from "date-fns/isWeekend";
import React, { useCallback, useEffect, useRef, useState } from "react";
import { DateRange, isMatch } from "react-day-picker";
@@ -371,24 +372,26 @@ export const useRangeDatepicker = (
if (range?.from && range?.to) {
setOpen(false);
}
const prevToRange =
let prevToRange =
!selectedRange?.from && selectedRange?.to ? selectedRange?.to : range?.to;
const resetTo = isBefore(prevToRange, range?.from);
range?.from
? setFromInputValue(
formatDateForInput(range?.from, locale, "date", inputFormat)
)
: setFromInputValue("");
prevToRange
prevToRange && !resetTo
? setToInputValue(
formatDateForInput(prevToRange, locale, "date", inputFormat)
)
: setToInputValue("");
updateValidation(
{ isValidDate: !!range?.from, isEmpty: !range?.from },
{ isValidDate: !!range?.to, isEmpty: !prevToRange }
{ isValidDate: !!range?.to, isEmpty: !prevToRange || resetTo }
);
updateRange({ from: range?.from, to: prevToRange });
updateRange({ from: range?.from, to: resetTo ? undefined : prevToRange });
};
const fromChange = (
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-tailwind
## 2.1.4
## 2.1.3
## 2.1.2
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tailwind",
"version": "2.1.3",
"version": "2.1.4",
"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.3",
"@navikt/ds-tokens": "^2.1.4",
"@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.4
## 2.1.3
## 2.1.2
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tokens",
"version": "2.1.3",
"version": "2.1.4",
"description": "Design-tokens for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-icons
## 2.1.4
## 2.1.3
## 2.1.2
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-icons",
"version": "2.1.3",
"version": "2.1.4",
"description": "Aksel icons for NAV",
"author": "Aksel | NAV designsystem team",
"repository": {
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-css-internal
## 2.1.4
## 2.1.3
## 2.1.2
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css-internal",
"version": "2.1.3",
"version": "2.1.4",
"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.4
### Patch Changes
- Updated dependencies [[`87f194c1d`](https://github.com/navikt/Designsystemet/commit/87f194c1dc29b10a604de676b358d117e2dbf52f)]:
- @navikt/ds-react@2.1.4
- @navikt/ds-icons@2.1.4
## 2.1.3
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react-internal",
"version": "2.1.3",
"version": "2.1.4",
"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.3",
"@navikt/ds-react": "^2.1.3",
"@navikt/ds-icons": "^2.1.4",
"@navikt/ds-react": "^2.1.4",
"clsx": "^1.1.1",
"copy-to-clipboard": "^3.3.1"
},
+1 -1
View File
@@ -40,7 +40,7 @@
aksel.nav.no/
├── website # NEXT.JS app (v12)
├── website/sanity # Sanity CMS-app (v3)
└── sanity # Sanity CMS-app (deprecated v2)
└── sanity # Sanity CMS-app (deprecated v2)
```
## Commands
+8 -8
View File
@@ -15,14 +15,14 @@
"website"
],
"dependencies": {
"@navikt/ds-codemod": "^2.1.3",
"@navikt/ds-css": "^2.1.3",
"@navikt/ds-css-internal": "^2.1.3",
"@navikt/ds-icons": "^2.1.3",
"@navikt/ds-react": "^2.1.3",
"@navikt/ds-react-internal": "^2.1.3",
"@navikt/ds-tailwind": "^2.1.3",
"@navikt/ds-tokens": "^2.1.3"
"@navikt/ds-codemod": "^2.1.4",
"@navikt/ds-css": "^2.1.4",
"@navikt/ds-css-internal": "^2.1.4",
"@navikt/ds-icons": "^2.1.4",
"@navikt/ds-react": "^2.1.4",
"@navikt/ds-react-internal": "^2.1.4",
"@navikt/ds-tailwind": "^2.1.4",
"@navikt/ds-tokens": "^2.1.4"
},
"devDependencies": {
"prettier-plugin-tailwindcss": "^0.1.13"
@@ -182,6 +182,9 @@ const serializers = {
mark: any;
children: any;
}) => {
if (!href) {
return children;
}
if (href && href.startsWith("mailto:")) {
return (
<NextLink href={href} passHref>
@@ -88,7 +88,7 @@ const TokenTable = ({ node }: { node: SanityT.Schema.token_kategori }) => {
</>
) : (
<>
<CopyIcon aria-hidden />
<CopyIcon aria-hidden role="img" />
<span className="sr-only">Kopier formarterte tokens</span>
</>
)}
@@ -58,6 +58,7 @@ const CopyButton = React.forwardRef<HTMLButtonElement, CopyButtonProps>(
<CopyIcon
className="text-[2rem] opacity-90 group-hover:opacity-100"
aria-label="Kopier kodesnutt"
role="img"
/>
)}
</button>
+3 -3
View File
@@ -59,7 +59,7 @@ const IntroCards = () => {
<Link href={href} passHref>
<a className="focus-visible:shadow-focus bg-surface-default hover:shadow-small hover:ring-border-subtle group z-10 rounded-lg p-4 hover:ring-1 focus:outline-none">
<span className="xs:flex items-center gap-2">
<Icon aria-hidden className="shrink-0 text-2xl" />
<Icon aria-hidden className="shrink-0 text-2xl" role="img" />
<span className="text-xl font-semibold group-hover:underline">
{title}
</span>
@@ -120,12 +120,12 @@ const GetStarted = ({
>
{pause ? (
<>
<PlayIcon aria-hidden />
<PlayIcon aria-hidden role="img" />
<span className="sr-only">Start animasjon</span>
</>
) : (
<>
<PauseIcon aria-hidden />
<PauseIcon aria-hidden role="img" />
<span className="sr-only">Stopp animasjon</span>
</>
)}
@@ -81,15 +81,75 @@ export const structure = async (
(x: Role) => x.name === "god-praksis-forfatter"
); */
const feedback = await getClient({ apiVersion: "2021-06-07" }).fetch(
`*[_type == "aksel_feedback" && $id in doc_ref->contributors[]->user_id.current]{_id, behandlet}`,
{ id: currentUser?.id }
);
return S.list()
.title("Innholdstyper")
.items([
...(editor
? [S.documentListItem().schemaType(`editor`).id(editor._id)]
: []),
...(feedback.length > 0
? [
S.documentListItem().schemaType(`editor`).id(editor._id),
S.listItem()
.title(
`Nye tilbakemeldinger (${
feedback.filter(
(x) => !x._id.includes("draft") && x.behandlet === false
).length
})`
)
.icon(CommentIcon)
.child(
S.list()
.title("Tilbakemeldinger")
.items([
S.listItem()
.title(
`Nye tilbakemeldinger (${
feedback.filter(
(x) =>
!x._id.includes("draft") && x.behandlet === false
).length
})`
)
.child(
S.documentList()
.title(`Nye tilbakemeldinger`)
.filter(
`_type == 'aksel_feedback' && behandlet == false && _id in $ids`
)
.params({
ids: feedback.map((x) => x?._id),
})
),
S.listItem()
.title(
`Ferdig behandlet (${
feedback.filter(
(x) =>
!x._id.includes("draft") && x.behandlet === true
).length
})`
)
.child(
S.documentList()
.title("Ferdig")
.filter(
`_type == 'aksel_feedback' && behandlet == true && _id in $ids`
)
.params({
ids: feedback.map((x) => x?._id),
})
),
])
),
S.divider(),
]
: []),
: [S.divider()]),
S.listItem()
.title("God Praksis")
.icon(OkHandIcon)
@@ -218,8 +218,6 @@ export const EditorPage = () => {
(query) => client.fetch(query)
);
console.log(data);
const {
data: fbData,
error: fbError,
@@ -42,9 +42,9 @@ export const Accordion = defineType({
],
components: {
preview: (val: any) => {
return val.value?.list ? (
return val?.list ? (
<div>
{val.value.list.map((x) => (
{val.list.map((x) => (
<div
key={x._key}
className="border-b-border flex w-full justify-between border-b py-2 px-4 "
@@ -63,8 +63,8 @@ export const Accordion = defineType({
select: {
list: "list",
},
prepare() {
return { title: "Accordion", media: StackCompactIcon };
prepare({ ...props }) {
return { title: "Accordion", media: StackCompactIcon, list: props?.list };
},
},
});
+2 -2
View File
@@ -10,8 +10,8 @@
"preview": "vite preview"
},
"dependencies": {
"@navikt/ds-css": "2.1.3",
"@navikt/ds-react": "2.1.3",
"@navikt/ds-css": "2.1.4",
"@navikt/ds-react": "2.1.4",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
+25 -25
View File
@@ -3457,7 +3457,7 @@ __metadata:
languageName: node
linkType: hard
"@navikt/ds-codemod@^2.1.1, @navikt/ds-codemod@workspace:@navikt/codemod":
"@navikt/ds-codemod@^2.1.3, @navikt/ds-codemod@workspace:@navikt/codemod":
version: 0.0.0-use.local
resolution: "@navikt/ds-codemod@workspace:@navikt/codemod"
dependencies:
@@ -3484,7 +3484,7 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-css-internal@^2.1.1, @navikt/ds-css-internal@workspace:@navikt/internal/css":
"@navikt/ds-css-internal@^2.1.3, @navikt/ds-css-internal@workspace:@navikt/internal/css":
version: 0.0.0-use.local
resolution: "@navikt/ds-css-internal@workspace:@navikt/internal/css"
dependencies:
@@ -3495,11 +3495,11 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-css@2.1.1, @navikt/ds-css@^2.1.1, @navikt/ds-css@workspace:@navikt/core/css":
"@navikt/ds-css@2.1.3, @navikt/ds-css@^2.1.3, @navikt/ds-css@workspace:@navikt/core/css":
version: 0.0.0-use.local
resolution: "@navikt/ds-css@workspace:@navikt/core/css"
dependencies:
"@navikt/ds-tokens": ^2.1.1
"@navikt/ds-tokens": ^2.1.3
normalize.css: ^8.0.1
postcss: ^8.4.0
postcss-cli: ^9.0.0
@@ -3508,7 +3508,7 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-icons@^2.1.1, @navikt/ds-icons@workspace:@navikt/icons":
"@navikt/ds-icons@^2.1.3, @navikt/ds-icons@workspace:@navikt/icons":
version: 0.0.0-use.local
resolution: "@navikt/ds-icons@workspace:@navikt/icons"
dependencies:
@@ -3544,8 +3544,8 @@ __metadata:
"@babel/preset-env": 7.19.4
"@babel/preset-react": 7.18.6
"@babel/preset-typescript": 7.18.6
"@navikt/ds-icons": ^2.1.1
"@navikt/ds-react": ^2.1.1
"@navikt/ds-icons": ^2.1.3
"@navikt/ds-react": ^2.1.3
"@rollup/plugin-babel": 6.0.2
"@rollup/plugin-commonjs": 23.0.2
"@rollup/plugin-node-resolve": ^15.0.1
@@ -3570,12 +3570,12 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-react-internal@^2.1.1, @navikt/ds-react-internal@workspace:@navikt/internal/react":
"@navikt/ds-react-internal@^2.1.3, @navikt/ds-react-internal@workspace:@navikt/internal/react":
version: 0.0.0-use.local
resolution: "@navikt/ds-react-internal@workspace:@navikt/internal/react"
dependencies:
"@navikt/ds-icons": ^2.1.1
"@navikt/ds-react": ^2.1.1
"@navikt/ds-icons": ^2.1.3
"@navikt/ds-react": ^2.1.3
clsx: ^1.1.1
concurrently: 7.2.1
copy-to-clipboard: ^3.3.1
@@ -3591,12 +3591,12 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-react@2.1.1, @navikt/ds-react@^2.1.1, @navikt/ds-react@workspace:@navikt/core/react":
"@navikt/ds-react@2.1.3, @navikt/ds-react@^2.1.3, @navikt/ds-react@workspace:@navikt/core/react":
version: 0.0.0-use.local
resolution: "@navikt/ds-react@workspace:@navikt/core/react"
dependencies:
"@floating-ui/react": 0.17.0
"@navikt/ds-icons": ^2.1.1
"@navikt/ds-icons": ^2.1.3
"@radix-ui/react-tabs": 1.0.0
"@radix-ui/react-toggle-group": 1.0.0
"@testing-library/dom": 8.13.0
@@ -3632,11 +3632,11 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-tailwind@^2.1.1, @navikt/ds-tailwind@workspace:@navikt/core/tailwind":
"@navikt/ds-tailwind@^2.1.3, @navikt/ds-tailwind@workspace:@navikt/core/tailwind":
version: 0.0.0-use.local
resolution: "@navikt/ds-tailwind@workspace:@navikt/core/tailwind"
dependencies:
"@navikt/ds-tokens": ^2.1.1
"@navikt/ds-tokens": ^2.1.3
"@types/jest": ^29.0.0
color: 4.2.3
jest: ^29.0.0
@@ -3647,7 +3647,7 @@ __metadata:
languageName: unknown
linkType: soft
"@navikt/ds-tokens@^2.1.1, @navikt/ds-tokens@workspace:@navikt/core/tokens":
"@navikt/ds-tokens@^2.1.3, @navikt/ds-tokens@workspace:@navikt/core/tokens":
version: 0.0.0-use.local
resolution: "@navikt/ds-tokens@workspace:@navikt/core/tokens"
dependencies:
@@ -8177,14 +8177,14 @@ __metadata:
version: 0.0.0-use.local
resolution: "aksel.nav.no@workspace:aksel.nav.no"
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.3
"@navikt/ds-css": ^2.1.3
"@navikt/ds-css-internal": ^2.1.3
"@navikt/ds-icons": ^2.1.3
"@navikt/ds-react": ^2.1.3
"@navikt/ds-react-internal": ^2.1.3
"@navikt/ds-tailwind": ^2.1.3
"@navikt/ds-tokens": ^2.1.3
prettier-plugin-tailwindcss: ^0.1.13
languageName: unknown
linkType: soft
@@ -24115,8 +24115,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "shadow-dom@workspace:examples/shadow-dom"
dependencies:
"@navikt/ds-css": 2.1.1
"@navikt/ds-react": 2.1.1
"@navikt/ds-css": 2.1.3
"@navikt/ds-react": 2.1.3
"@types/react": ^18.0.0
"@types/react-dom": ^18.0.0
"@vitejs/plugin-react": ^2.1.0