mirror of
https://github.com/navikt/aksel.git
synced 2026-10-13 01:02:02 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bfd685ca1 | ||
|
|
4d24fa2c07 | ||
|
|
b305323f31 | ||
|
|
0b21e96448 | ||
|
|
70d89690bd | ||
|
|
bae6c74116 | ||
|
|
27532dfe53 | ||
|
|
9f2957436d |
No files matched your search
@@ -30,6 +30,7 @@ Alle base-pakkene våre har `fixed versjonering`. Dette tilsier at en bump på e
|
||||
```sh
|
||||
"@navikt/ds-react",
|
||||
"@navikt/ds-css",
|
||||
"@navikt/aksel-icons",
|
||||
"@navikt/ds-icons",
|
||||
"@navikt/ds-tokens",
|
||||
"@navikt/ds-tailwind",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @navikt/aksel-icons
|
||||
|
||||
## 2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -16,15 +16,17 @@
|
||||
|
||||
## Use
|
||||
|
||||
For previous users of `@navikt/ds-icons`, this package utilizes the same API. The only difference is that the icons are suffixed with `Icon` to avoid naming conflicts and visual changes to the icons themselves.
|
||||
|
||||
```jsx
|
||||
import { StarIcon } from "@navikt/ds-icons";
|
||||
import { StarIcon } from "@navikt/aksel-icons";
|
||||
|
||||
function App() {
|
||||
return <StarIcon title="star" fontSize="1.5rem"/>;
|
||||
return <StarIcon title="star" fontSize="1.5rem" />;
|
||||
}
|
||||
```
|
||||
|
||||
Tip: Use the `title` prop for accessible icons.
|
||||
```
|
||||
|
||||
### Sizing
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/aksel-icons",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.2",
|
||||
"author": "Aksel | NAV",
|
||||
"homepage": "https://aksel.nav.no/ikoner",
|
||||
"repository": {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @navikt/ds-codemod
|
||||
|
||||
## 2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-codemod",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.2",
|
||||
"description": "Aksel codemods for NAVs designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
"build-pict": "svgr --silent --index-template index-template.js --out-dir src/pictograms pictograms"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-icons": "^2.7.1",
|
||||
"@navikt/ds-react": "^2.7.1",
|
||||
"@navikt/ds-icons": "^2.7.2",
|
||||
"@navikt/ds-react": "^2.7.2",
|
||||
"clsx": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @navikt/ds-css
|
||||
|
||||
## 2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.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.7.1",
|
||||
"@navikt/ds-tokens": "^2.7.2",
|
||||
"normalize.css": "^8.0.1",
|
||||
"postcss": "^8.4.0",
|
||||
"postcss-cli": "^9.0.0",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @navikt/ds-react
|
||||
|
||||
## 2.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.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.7.1",
|
||||
"@navikt/ds-icons": "^2.7.2",
|
||||
"@radix-ui/react-tabs": "1.0.0",
|
||||
"@radix-ui/react-toggle-group": "1.0.0",
|
||||
"clsx": "^1.2.1",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @navikt/ds-tailwind
|
||||
|
||||
## 2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tailwind",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.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.7.1",
|
||||
"@navikt/ds-tokens": "^2.7.2",
|
||||
"@types/jest": "^29.0.0",
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @navikt/ds-tokens
|
||||
|
||||
## 2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tokens",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.2",
|
||||
"description": "Design-tokens for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @navikt/ds-icons
|
||||
|
||||
## 2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-icons",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.2",
|
||||
"description": "Aksel icons for NAV",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"repository": {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @navikt/ds-css-internal
|
||||
|
||||
## 2.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [`4d24fa2c0`](https://github.com/navikt/aksel/commit/4d24fa2c07e6c7fe56abf76b939e34b3529e73c1) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Timeline.Row støtter nå className, fikset css alignment ved høyde-endring i Timeline
|
||||
|
||||
## 2.7.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css-internal",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.2",
|
||||
"description": "CSS for NAV internal Designsystem-components",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
width: 100%;
|
||||
min-width: fit-content;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navdsi-timeline__axislabels {
|
||||
@@ -11,7 +12,6 @@
|
||||
height: 1rem;
|
||||
box-sizing: content-box;
|
||||
grid-column: 2;
|
||||
margin-bottom: var(--a-spacing-4);
|
||||
margin-left: var(--a-spacing-8);
|
||||
}
|
||||
|
||||
@@ -20,12 +20,16 @@
|
||||
width: auto;
|
||||
margin-right: var(--a-spacing-4);
|
||||
grid-column: 1;
|
||||
height: 1.5rem;
|
||||
min-height: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--a-spacing-2);
|
||||
}
|
||||
|
||||
.navdsi-timeline__row-label:where(:nth-last-child(2)) {
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
.navdsi-timeline__axislabels-label {
|
||||
position: absolute;
|
||||
color: var(--ac-timeline-axislabel-text, var(--a-text-subtle));
|
||||
@@ -35,7 +39,7 @@
|
||||
.navdsi-timeline__row {
|
||||
display: flex;
|
||||
background: var(--ac-timeline-row-bg, var(--a-surface-subtle));
|
||||
margin: 0 0 var(--a-spacing-8);
|
||||
margin: var(--a-spacing-4) 0;
|
||||
padding-left: var(--a-spacing-8);
|
||||
grid-column: 2;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @navikt/ds-react-internal
|
||||
|
||||
## 2.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [`4d24fa2c0`](https://github.com/navikt/aksel/commit/4d24fa2c07e6c7fe56abf76b939e34b3529e73c1) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Timeline.Row støtter nå className, fikset css alignment ved høyde-endring i Timeline
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.7.2
|
||||
- @navikt/ds-icons@2.7.2
|
||||
|
||||
## 2.7.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react-internal",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.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.7.1",
|
||||
"@navikt/ds-react": "^2.7.1",
|
||||
"@navikt/ds-icons": "^2.7.2",
|
||||
"@navikt/ds-react": "^2.7.2",
|
||||
"clsx": "^1.1.1",
|
||||
"copy-to-clipboard": "^3.3.1"
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface TimelineRowType
|
||||
}
|
||||
|
||||
export const TimelineRow = forwardRef<HTMLOListElement, TimelineRowProps>(
|
||||
({ label, headingTag = "h3", icon, ...rest }, ref) => {
|
||||
({ label, className, headingTag = "h3", icon, ...rest }, ref) => {
|
||||
const { periods, id, active } = useRowContext();
|
||||
const { setActiveRow } = useTimelineContext();
|
||||
|
||||
@@ -51,6 +51,7 @@ export const TimelineRow = forwardRef<HTMLOListElement, TimelineRowProps>(
|
||||
const firstFocusable = periods.find(
|
||||
(p) => !!p.children || !!p.onSelectPeriod
|
||||
);
|
||||
console.log(rest);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -81,7 +82,7 @@ export const TimelineRow = forwardRef<HTMLOListElement, TimelineRowProps>(
|
||||
"dd.MM.yyyy"
|
||||
)}`
|
||||
}
|
||||
className="navdsi-timeline__row-periods"
|
||||
className={cl("navdsi-timeline__row-periods", className)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
||||
e.preventDefault();
|
||||
|
||||
+7
-7
@@ -24,16 +24,16 @@ Nettside: [http://localhost:3000](http://localhost:3000)
|
||||
## Utviklingsmiljø
|
||||
|
||||
Vi bruker storybook [https://storybook.js.org/](https://storybook.js.org/) for utvikling av nye komponenter.
|
||||
Skriv `stories` for komponentene man vil teste [(hvordan skrive storybook stories)](https://storybook.js.org/docs/react/writing-stories/introduction)
|
||||
Lag `stories` for komponentene man vil teste [(hvordan skrive storybook stories)](https://storybook.js.org/docs/react/writing-stories/introduction)
|
||||
|
||||
## Utvikling av nye komponenter
|
||||
|
||||
Det er ikke satt opp en template for nye komponenter, men vi følger til dels en mal.
|
||||
Det er ikke satt opp en template for nye komponenter, men vi følger en mal.
|
||||
|
||||
```sh
|
||||
@navikt/pakkenavn
|
||||
└─ src # Komponenter
|
||||
├─ index.ts # Alle exports
|
||||
└─ src # Komponenter
|
||||
├─ index.ts # Alle exports
|
||||
└─ pakkenavn
|
||||
├─ index.ts # Alle exports fra komponent
|
||||
├─ komponent.tsx # Komponentkode
|
||||
@@ -42,15 +42,15 @@ Det er ikke satt opp en template for nye komponenter, men vi følger til dels en
|
||||
|
||||
## Dokumentasjon
|
||||
|
||||
Dokumentasjon ang komponentter finner man på [aksel.nav.no](https://design.nav.no/). Hvis man ønsker å skrive noe dokumentasjon selv gjør vi det via CMS et Sanity. Kode-eksempler blir skrevet lokalt i (https://github.com/navikt/aksel-website/tree/main/website/pages/eksempler)[aksel-website repo]
|
||||
Dokumentasjon for komponenter finner man på [aksel.nav.no](https://aksel.nav.no/). Hvis man ønsker å skrive noe dokumentasjon selv gjør vi det via CMS et Sanity. Kode-eksempler blir skrevet lokalt i (https://github.com/navikt/aksel/tree/main/aksel.nav.no/website/pages/eksempler)[/pages/eksempler]
|
||||
|
||||
## Versjonering av pakker
|
||||
|
||||
Vi bruker `changeset` for versionering av pakker. Se [README](https://github.com/navikt/aksel/blob/main/.changeset/README.md) for mer informasjon.
|
||||
Vi bruker `changeset` for versjonering av pakker. Se [README](https://github.com/navikt/aksel/blob/main/.changeset/README.md) for mer informasjon.
|
||||
|
||||
## Kodekvalitet og testing
|
||||
|
||||
Noen komponenter og løsninger blir testet med jest + react-testing-library.
|
||||
Komponenter og løsninger blir testet med jest + react-testing-library.
|
||||
|
||||
- Commit: Kjører prettier på endrede filer + linter
|
||||
- Ved PR: Kjører tester, linter og visuell regresjonstester
|
||||
|
||||
@@ -31,11 +31,13 @@
|
||||
├── core/tailwind # @navikt/ds-tailwind, tailwind-config
|
||||
├── internal/react # @navikt/ds-react-internal, komponenter interne flater
|
||||
├── internal/css # @navikt/ds-css-internal, css interne flater
|
||||
├── icons # @navikt/ds-icons, ikonpakke
|
||||
├── aksel-icons # @navikt/aksel-icons, ikonpakke
|
||||
├── icons # @navikt/ds-icons (ikke lengre i bruk)
|
||||
└── codemod # @navikt/ds-codemod, migrerings-scripts
|
||||
|
||||
aksel.nav.no/
|
||||
└── website # NEXT.JS app (v12) website/sanity # Sanity CMS-app (v3)
|
||||
├── website # NEXT.JS app (v13)
|
||||
└── website/sanity # Sanity CMS-app (v3)
|
||||
```
|
||||
|
||||
## Commands
|
||||
@@ -52,14 +54,14 @@ yarn && yarn boot
|
||||
| `yarn storybook` | Starter storybook |
|
||||
| `yarn dev` | Starter aksel-nettsiden [(Mer info)](https://github.com/navikt/aksel/blob/main/aksel.nav.no/README.md) |
|
||||
| `yarn example:shadow-dom` | Starter demo-app med shadow-dom |
|
||||
| `yarn lint` | Lints react and css workspaces |
|
||||
| `yarn test` | Runs tests |
|
||||
| `yarn lint` | Linter react and css workspaces |
|
||||
| `yarn test` | Kjører tester |
|
||||
| `yarn clean` | Fjerner genererte filer |
|
||||
| `yarn changeset` | Ny versjon-entry [(how-to)](https://github.com/navikt/aksel/blob/main/.changeset/README.md) |
|
||||
|
||||
## Bidra
|
||||
|
||||
Vi tar gjerne i mot PR-er [CONTRIBUTING.md](https://github.com/navikt/aksel/blob/main/CONTRIBUTING.md)
|
||||
Vi tar gjerne i mot PR-er! [CONTRIBUTING.md](https://github.com/navikt/aksel/blob/main/CONTRIBUTING.md)
|
||||
|
||||
## Lisenser
|
||||
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
"website"
|
||||
],
|
||||
"dependencies": {
|
||||
"@navikt/aksel-icons": "^2.7.1",
|
||||
"@navikt/ds-codemod": "^2.7.1",
|
||||
"@navikt/ds-css": "^2.7.1",
|
||||
"@navikt/ds-css-internal": "^2.7.1",
|
||||
"@navikt/ds-icons": "^2.7.1",
|
||||
"@navikt/ds-react": "^2.7.1",
|
||||
"@navikt/ds-react-internal": "^2.7.1",
|
||||
"@navikt/ds-tailwind": "^2.7.1",
|
||||
"@navikt/ds-tokens": "^2.7.1"
|
||||
"@navikt/aksel-icons": "^2.7.2",
|
||||
"@navikt/ds-codemod": "^2.7.2",
|
||||
"@navikt/ds-css": "^2.7.2",
|
||||
"@navikt/ds-css-internal": "^2.7.2",
|
||||
"@navikt/ds-icons": "^2.7.2",
|
||||
"@navikt/ds-react": "^2.7.2",
|
||||
"@navikt/ds-react-internal": "^2.7.2",
|
||||
"@navikt/ds-tailwind": "^2.7.2",
|
||||
"@navikt/ds-tokens": "^2.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier-plugin-tailwindcss": "^0.2.3"
|
||||
|
||||
@@ -26,11 +26,17 @@ import {
|
||||
} from ".";
|
||||
|
||||
export const InlineCode = (props: React.HTMLAttributes<HTMLElement>) => (
|
||||
<code className="inline-code" {...props} />
|
||||
<code
|
||||
className="bg-surface-alt-3-subtle/50 py-05 rounded px-1 leading-normal [font-size:_calc(16em_/_18)]"
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
export const KBD = (props: React.HTMLAttributes<HTMLElement>) => (
|
||||
<kbd className="inline-kbd" {...props} />
|
||||
<kbd
|
||||
className="text-text-default bg-surface-default py-05 text-medium whitespace-nowrap rounded px-1 leading-normal shadow-[0_0_0_1px_var(--a-border-strong)]"
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
const serializers = {
|
||||
|
||||
@@ -13,11 +13,11 @@ export { default as PropsSeksjon } from "./sanity-modules/props/PropsSeksjon";
|
||||
export { default as PropTable } from "./sanity-modules/props/PropTabell";
|
||||
export { default as SideModul } from "./sanity-modules/SideModul";
|
||||
export { default as Tabell } from "./sanity-modules/Tabell";
|
||||
export { default as TastaturModul } from "./sanity-modules/tastatur";
|
||||
export { default as TastaturModul } from "./sanity-modules/TastaturTabell";
|
||||
export { default as Tips } from "./sanity-modules/tips";
|
||||
export { default as TokenTable } from "./sanity-modules/TokenTable";
|
||||
export * from "./sanity-modules/UuFeedback";
|
||||
export { default as Video } from "./sanity-modules/video";
|
||||
export { default as Video } from "./sanity-modules/VideoEmbed";
|
||||
export * from "./website-modules/BreadCrumbs";
|
||||
export { default as EditButton } from "./website-modules/EditButton";
|
||||
export { default as Feedback } from "./website-modules/feedback";
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import ReactModal from "react-modal";
|
||||
import { logNav } from "../..";
|
||||
import styles from "./header.module.css";
|
||||
|
||||
const LinkElement = ({ name, href, onClick }) => {
|
||||
const { asPath } = useRouter();
|
||||
@@ -61,7 +62,7 @@ export const Hamburger = () => {
|
||||
isOpen={open}
|
||||
onRequestClose={() => setOpen(false)}
|
||||
aria={{ modal: true }}
|
||||
overlayClassName="header-modal__overlay"
|
||||
overlayClassName={styles.modalOverlay}
|
||||
contentLabel="Meny"
|
||||
className="bg-surface-default absolute left-4 top-0 right-4 block rounded py-14 px-11 sm:right-6 sm:left-auto sm:w-96 sm:max-w-[90%] lg:hidden"
|
||||
>
|
||||
@@ -70,7 +71,10 @@ export const Hamburger = () => {
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={() => setOpen(false)}
|
||||
className="aksel-tertiary-button absolute top-2 right-2"
|
||||
className={cl(
|
||||
styles.akselTertiaryButton,
|
||||
"absolute top-2 right-2"
|
||||
)}
|
||||
icon={<Close title="lukk meny" className="h-5 w-5" />}
|
||||
/>
|
||||
<LinkElement
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useRouter } from "next/router";
|
||||
import { Hamburger } from "components/layout/header/Hamburger";
|
||||
import { GlobalSearch } from "./search";
|
||||
|
||||
const LinkElement = ({ name, href, prefetch = true }) => {
|
||||
const LinkElement = ({ name, href, prefetch = undefined }) => {
|
||||
const { asPath } = useRouter();
|
||||
return (
|
||||
<li>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
.modalOverlay {
|
||||
z-index: var(--a-z-index-modal);
|
||||
@apply bg-surface-backdrop fixed inset-0 grid place-items-center lg:hidden;
|
||||
}
|
||||
|
||||
.modalOverlaySearch {
|
||||
z-index: 3000;
|
||||
@apply bg-surface-backdrop fixed inset-0 grid place-items-center;
|
||||
}
|
||||
|
||||
.akselTertiaryButton {
|
||||
--a-text-action: var(--a-deepblue-800);
|
||||
--a-text-action-on-action-subtle: var(--a-deepblue-800);
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import { useRouter } from "next/router";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import ReactModal from "react-modal";
|
||||
import { Group, GroupComponent } from "./Group";
|
||||
import styles from "../header.module.css";
|
||||
|
||||
/**
|
||||
* https://www.figma.com/file/71Sm1h6VV23lbBbQ3CJJ9t/Aksel-v2?node-id=1861%3A186079&t=ARKgZcA6B7ysmG3V-0
|
||||
@@ -212,7 +213,7 @@ export const GlobalSearch = () => {
|
||||
aria={{ modal: true }}
|
||||
contentLabel="Søk"
|
||||
className="bg-surface-default absolute inset-0 block w-screen overflow-x-auto px-4 md:px-6"
|
||||
overlayClassName="header-modal__overlay-search"
|
||||
overlayClassName={styles.modalOverlaySearch}
|
||||
>
|
||||
<div className="search-grid-wrapper relative mx-auto max-w-4xl gap-4 gap-x-8 py-24">
|
||||
<button
|
||||
|
||||
@@ -69,6 +69,7 @@ const AkselPrinsippTemplate = ({
|
||||
id="hovedinnhold"
|
||||
className={cl("aksel-artikkel pt-4 focus:outline-none", {
|
||||
"bg-white": mainPage,
|
||||
"bg-surface-subtle": !mainPage,
|
||||
})}
|
||||
>
|
||||
<article className="overflow-x-clip">
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
import { SanityT } from "@/lib";
|
||||
import { SanityBlockContent } from "@/sanity-block";
|
||||
import { ExternalLink } from "@navikt/ds-icons";
|
||||
import { BodyShort, Heading } from "@navikt/ds-react";
|
||||
import IntroSeksjon from "components/sanity-modules/IntroSeksjon";
|
||||
import Head from "next/head";
|
||||
import { dateStr, Feedback, TableOfContents } from "../..";
|
||||
|
||||
const kodepakker = {
|
||||
"ds-react": {
|
||||
title: "@navikt/ds-react",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/core",
|
||||
},
|
||||
"ds-css": {
|
||||
title: "@navikt/ds-css",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/core",
|
||||
},
|
||||
"ds-react-internal": {
|
||||
title: "@navikt/ds-react-internal",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/internal",
|
||||
},
|
||||
"ds-css-internal": {
|
||||
title: "@navikt/ds-css-internal",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/internal",
|
||||
},
|
||||
"ds-icons": {
|
||||
title: "@navikt/ds-reaciconst",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/core",
|
||||
},
|
||||
"ds-tokens": {
|
||||
title: "@navikt/ds-tokens",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/core",
|
||||
},
|
||||
"ds-tailwind": {
|
||||
title: "@navikt/ds-tailwind",
|
||||
git: "https://github.com/navikt/nav-frontend-moduler/tree/master/%40navikt/core",
|
||||
},
|
||||
};
|
||||
|
||||
const KomponentArtikkelTemplate = ({
|
||||
data,
|
||||
title,
|
||||
}: {
|
||||
data: SanityT.Schema.komponent_artikkel;
|
||||
title: string;
|
||||
}): JSX.Element => {
|
||||
const pack = data?.kodepakker?.length > 0 && kodepakker[data?.kodepakker[0]];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{data?.heading ? `${data?.heading} - ${title}` : title}</title>
|
||||
<meta
|
||||
property="og:title"
|
||||
content={`${data.heading} - Designsystemet`}
|
||||
/>
|
||||
</Head>
|
||||
<div className="content-box">
|
||||
<div className="pt-8">
|
||||
<div className="flex flex-wrap gap-2"></div>
|
||||
<Heading
|
||||
size="xlarge"
|
||||
level="1"
|
||||
spacing
|
||||
className="text-deepblue-800 flex flex-wrap items-center gap-4"
|
||||
>
|
||||
{data.heading}
|
||||
</Heading>
|
||||
<BodyShort
|
||||
as="div"
|
||||
size="small"
|
||||
className="mb-4 flex flex-wrap items-center justify-start gap-x-4 gap-y-3"
|
||||
>
|
||||
<BodyShort
|
||||
size="small"
|
||||
as="span"
|
||||
className="text-text-subtle flex items-center"
|
||||
>
|
||||
{`Oppdatert ${dateStr(data._updatedAt)}`}
|
||||
</BodyShort>
|
||||
</BodyShort>
|
||||
<BodyShort
|
||||
as="span"
|
||||
size="small"
|
||||
className="text-text-subtle flex gap-4"
|
||||
>
|
||||
{pack && (
|
||||
<>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href={`https://yarnpkg.com/package/${pack.title}`}
|
||||
className="hover:text-text-default focus:text-text-on-inverted focus:shadow-focus flex items-center gap-1 underline hover:no-underline focus:bg-blue-800 focus:no-underline focus:outline-none"
|
||||
>
|
||||
Yarn
|
||||
<ExternalLink title="Gå til yarn pakke" />
|
||||
</a>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href={pack.git}
|
||||
className="hover:text-text-default focus:text-text-on-inverted focus:shadow-focus flex items-center gap-1 underline hover:no-underline focus:bg-blue-800 focus:no-underline focus:outline-none"
|
||||
>
|
||||
Kode
|
||||
<ExternalLink title="Gå til github-kode" />
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
|
||||
{data.figma_link && (
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href={data.figma_link}
|
||||
className="hover:text-text-default focus:text-text-on-inverted focus:shadow-focus flex items-center gap-1 underline hover:no-underline focus:bg-blue-800 focus:no-underline focus:outline-none"
|
||||
>
|
||||
Figma
|
||||
<ExternalLink title="Åpne i Figma" />
|
||||
</a>
|
||||
)}
|
||||
</BodyShort>
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative flex max-w-full md:max-w-7xl">
|
||||
<TableOfContents changedState={data["content"]} hideToc={false} />
|
||||
<div className="content-box">
|
||||
<div className="mt-12">
|
||||
<IntroSeksjon node={data.intro} />
|
||||
<SanityBlockContent blocks={data["content"]} />
|
||||
</div>
|
||||
<Feedback docId={data?._id} docType={data?._type} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default KomponentArtikkelTemplate;
|
||||
@@ -4,12 +4,10 @@ import React from "react";
|
||||
|
||||
export const NoSidebarLayout = ({
|
||||
children,
|
||||
variant = "artikkel",
|
||||
aside = null,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
aside?: React.ReactNode;
|
||||
variant?: "forside" | "artikkel" | "blogg";
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
@@ -17,7 +15,7 @@ export const NoSidebarLayout = ({
|
||||
<main
|
||||
tabIndex={-1}
|
||||
id="hovedinnhold"
|
||||
className="aksel-artikkel bg-gray-50 pt-4 focus:outline-none"
|
||||
className="aksel-artikkel bg-surface-subtle pt-4 focus:outline-none"
|
||||
>
|
||||
<div className="max-w-aksel mx-auto px-4 sm:w-[90%]">
|
||||
<article className="pt-12 pb-16 md:pb-32">{children}</article>
|
||||
|
||||
File renamed without changes.
+6
-3
@@ -6,7 +6,7 @@ import React from "react";
|
||||
const KBD = (props: React.HTMLAttributes<HTMLElement>) => (
|
||||
<kbd
|
||||
className={cl(
|
||||
"my-0 mx-1 inline-block min-w-[2rem] rounded-md border border-gray-300 bg-gray-100 py-[1px] px-2 text-center font-mono text-sm text-gray-900"
|
||||
"mx-05 my-0 inline-block min-w-[2rem] rounded-md border border-gray-300 bg-gray-100 py-[1px] px-2 text-center font-mono text-sm text-gray-900"
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
@@ -26,8 +26,11 @@ const UuSeksjon = ({
|
||||
{s
|
||||
.trim()
|
||||
.split(" ")
|
||||
.map((x) => (
|
||||
<KBD key={x}>{x}</KBD>
|
||||
.map((x, i, arr) => (
|
||||
<React.Fragment key={x}>
|
||||
<KBD>{x}</KBD>
|
||||
{i !== arr.length - 1 && <span>+</span>}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
File renamed without changes.
@@ -36,7 +36,7 @@ const mockData: SanityT.Schema.tips & { _key: string } = {
|
||||
|
||||
export const TipsDemo = () => <Tips node={mockData as any} />;
|
||||
export const TipsDemoAksel = () => (
|
||||
<div className="aksel-artikkel">
|
||||
<div className="aksel-artikkel bg-surface-subtle">
|
||||
<Tips node={mockData as any} />
|
||||
</div>
|
||||
);
|
||||
|
||||
+2
-11
@@ -1,8 +1,4 @@
|
||||
html.overflow-hidden > body.ReactModal__Body--open {
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
.override-secondary-button {
|
||||
.overrideSecondaryButton {
|
||||
--ac-button-secondary-text: var(--a-deepblue-500);
|
||||
--ac-button-secondary-bg: var(--a-surface-default);
|
||||
--ac-button-secondary-border: var(--a-deepblue-500);
|
||||
@@ -11,13 +7,8 @@ html.overflow-hidden > body.ReactModal__Body--open {
|
||||
--ac-button-secondary-focus-border: var(--a-deepblue-500);
|
||||
}
|
||||
|
||||
.override-secondary-button-active {
|
||||
.overrideSecondaryButtonActive {
|
||||
--ac-button-secondary-text: var(--a-text-on-action);
|
||||
--ac-button-secondary-hover-bg: var(--a-deepblue-700);
|
||||
--ac-button-secondary-hover-text: var(--a-text-on-action);
|
||||
}
|
||||
|
||||
.aksel-tertiary-button {
|
||||
--a-text-action: var(--a-deepblue-800);
|
||||
--a-text-action-on-action-subtle: var(--a-deepblue-800);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import cl from "clsx";
|
||||
import { useRouter } from "next/router";
|
||||
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
||||
import { AmplitudeEvents, IdContext, logAmplitudeEvent } from "../utils";
|
||||
import styles from "./feedback.module.css";
|
||||
|
||||
const Feedback = ({
|
||||
docId,
|
||||
@@ -171,14 +172,17 @@ const Feedback = ({
|
||||
</Heading>
|
||||
<div
|
||||
className={cl("flex w-full gap-4", {
|
||||
"override-secondary-button justify-start": akselFeedback,
|
||||
"justify-start": akselFeedback,
|
||||
[styles.overrideSecondaryButton]: akselFeedback,
|
||||
"justify-center": center,
|
||||
})}
|
||||
>
|
||||
<Button
|
||||
variant="secondary"
|
||||
className={cl({
|
||||
"override-secondary-button-active bg-deepblue-800 text-text-on-inverted ring-deepblue-800 focus-visible:shadow-focus ring-2 ring-inset focus-visible:ring-1 focus-visible:ring-white":
|
||||
"bg-deepblue-800 text-text-on-inverted ring-deepblue-800 focus-visible:shadow-focus ring-2 ring-inset focus-visible:ring-1 focus-visible:ring-white":
|
||||
activeState === HelpfulArticleEnum.JA,
|
||||
[styles.overrideSecondaryButtonActive]:
|
||||
activeState === HelpfulArticleEnum.JA,
|
||||
})}
|
||||
onClick={() =>
|
||||
@@ -192,7 +196,9 @@ const Feedback = ({
|
||||
<Button
|
||||
variant="secondary"
|
||||
className={cl({
|
||||
"override-secondary-button-active bg-deepblue-800 text-text-on-inverted ring-deepblue-800 focus-visible:shadow-focus ring-2 ring-inset focus-visible:ring-1 focus-visible:ring-white":
|
||||
"bg-deepblue-800 text-text-on-inverted ring-deepblue-800 focus-visible:shadow-focus ring-2 ring-inset focus-visible:ring-1 focus-visible:ring-white":
|
||||
activeState === HelpfulArticleEnum.NEI,
|
||||
[styles.overrideSecondaryButtonActive]:
|
||||
activeState === HelpfulArticleEnum.NEI,
|
||||
})}
|
||||
onClick={() =>
|
||||
@@ -206,7 +212,9 @@ const Feedback = ({
|
||||
<Button
|
||||
variant="secondary"
|
||||
className={cl({
|
||||
"override-secondary-button-active bg-deepblue-800 text-text-on-inverted ring-deepblue-800 focus-visible:shadow-focus ring-2 ring-inset focus-visible:ring-1 focus-visible:ring-white":
|
||||
"bg-deepblue-800 text-text-on-inverted ring-deepblue-800 focus-visible:shadow-focus ring-2 ring-inset focus-visible:ring-1 focus-visible:ring-white":
|
||||
activeState === HelpfulArticleEnum.MISC,
|
||||
[styles.overrideSecondaryButtonActive]:
|
||||
activeState === HelpfulArticleEnum.MISC,
|
||||
})}
|
||||
onClick={() =>
|
||||
|
||||
@@ -93,7 +93,7 @@ export const IconPage = ({ name }: { name: string }) => {
|
||||
/>
|
||||
<meta
|
||||
property="og:image"
|
||||
content="https://aksel.nav.no/images/og/og-ikoner.png"
|
||||
content="https://aksel.nav.no/images/og/ikoner/og-ikoner.png"
|
||||
key="ogimage"
|
||||
/>
|
||||
</Head>
|
||||
@@ -252,7 +252,7 @@ export const IconPage = ({ name }: { name: string }) => {
|
||||
closeButton={false}
|
||||
aria-modal
|
||||
aria-label={`${name} ikon`}
|
||||
className="bg-surface-default focus-visible:shadow-focus z-modal absolute block h-full overflow-y-auto rounded py-6 px-6 focus:outline-none"
|
||||
className="bg-surface-default focus-visible:shadow-focus z-modal absolute block h-full overflow-y-auto rounded py-6 px-2 focus:outline-none sm:px-6"
|
||||
>
|
||||
{name && <IconSidebar name={name} focusRef={focusRef} />}
|
||||
</Modal>
|
||||
|
||||
@@ -63,7 +63,7 @@ export const IconSidebar = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (wrapperRef.current) {
|
||||
wrapperRef.current.focus();
|
||||
wrapperRef.current.focus({ preventScroll: true });
|
||||
}
|
||||
}, [name]);
|
||||
|
||||
@@ -95,7 +95,7 @@ export const IconSidebar = ({
|
||||
return (
|
||||
<section
|
||||
ref={wrapperRef}
|
||||
className="animate-fadeIn min-h-96 h-fit w-full basis-1/3 px-6 py-8 focus:outline-none lg:sticky lg:top-16"
|
||||
className="animate-fadeIn min-h-96 h-fit w-full basis-1/3 py-8 focus:outline-none sm:px-6 lg:sticky lg:top-16"
|
||||
tabIndex={-1}
|
||||
aria-labelledby="icon-details"
|
||||
>
|
||||
|
||||
@@ -34,7 +34,7 @@ export const TitleLinks = () => (
|
||||
</DsLink>
|
||||
</NextLink>
|
||||
</li>
|
||||
{/* <Divider />
|
||||
<Divider />
|
||||
<li className="flex items-center gap-1 leading-none">
|
||||
<DsLink
|
||||
className="text-text-default no-underline hover:underline"
|
||||
@@ -51,7 +51,7 @@ export const TitleLinks = () => (
|
||||
>
|
||||
<DownloadIcon className="text-2xl" aria-hidden /> Last ned ikonpakke
|
||||
</DsLink>
|
||||
</li> */}
|
||||
</li>
|
||||
<Divider />
|
||||
<li className="flex items-center gap-2 leading-none">
|
||||
<NextLink
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
import { GetServerSidePropsContext, NextApiRequest } from "next";
|
||||
import { isDevelopment } from "..";
|
||||
import { tokenIsValid } from "./azure";
|
||||
|
||||
export function getBearerToken(req) {
|
||||
return req.headers?.authorization?.substring("Bearer ".length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to authenticate Next.JS pages. Assumes application is behind
|
||||
* Wonderwall (https://doc.nais.io/security/auth/idporten/sidecar/).
|
||||
*/
|
||||
export const isValidated = async (context: GetServerSidePropsContext) => {
|
||||
if (isDevelopment()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const request = context.req;
|
||||
|
||||
if (request == null) {
|
||||
throw new Error("Context is missing request. This should not happen");
|
||||
}
|
||||
|
||||
const bearerToken = getBearerToken(request);
|
||||
|
||||
if (!bearerToken) {
|
||||
process.env.NODE_ENV !== "production" && console.log("No bearer token");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
await tokenIsValid(bearerToken);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export const isValidatedApi = async (req: NextApiRequest) => {
|
||||
if (isDevelopment()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (req == null) {
|
||||
throw new Error("No request given, this should not happend");
|
||||
}
|
||||
|
||||
const bearerToken = getBearerToken(req);
|
||||
|
||||
if (!bearerToken) {
|
||||
/* console.log("No bearer token"); */
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
const payload = await tokenIsValid(bearerToken);
|
||||
return payload;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -1,47 +0,0 @@
|
||||
import { createRemoteJWKSet, errors, jwtVerify } from "jose";
|
||||
import {
|
||||
FlattenedJWSInput,
|
||||
GetKeyFunction,
|
||||
JWSHeaderParameters,
|
||||
JWTPayload,
|
||||
} from "jose/dist/types/types";
|
||||
import getConfig from "next/config";
|
||||
const { serverRuntimeConfig } = getConfig();
|
||||
|
||||
const clientId = serverRuntimeConfig.azureAppClientId;
|
||||
const issuer = serverRuntimeConfig.azureAppIssuer;
|
||||
const jwksUri = serverRuntimeConfig.azureJwksUri;
|
||||
|
||||
let remoteJWKSet: GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput>;
|
||||
|
||||
export const opprettRemoteJWKSet = () => {
|
||||
const jwksUrl = new URL(jwksUri);
|
||||
remoteJWKSet = createRemoteJWKSet(jwksUrl);
|
||||
};
|
||||
|
||||
export const tokenIsValid = async (
|
||||
accessToken: string
|
||||
): Promise<JWTPayload> => {
|
||||
try {
|
||||
if (!remoteJWKSet) opprettRemoteJWKSet();
|
||||
|
||||
const { payload } = await jwtVerify(accessToken, remoteJWKSet, {
|
||||
audience: clientId,
|
||||
issuer: issuer,
|
||||
});
|
||||
|
||||
return Promise.resolve(payload);
|
||||
} catch (error) {
|
||||
let feilmelding: string;
|
||||
if (error instanceof errors.JWTExpired) {
|
||||
feilmelding = "Token har utløpt";
|
||||
} else if (error instanceof errors.JWTInvalid) {
|
||||
feilmelding = "Payload i tokenet må være gyldig JSON!";
|
||||
} else if (error instanceof errors.JWTClaimValidationFailed) {
|
||||
feilmelding = `Token mottatt har ugyldig claim ${error.claim}`;
|
||||
} else {
|
||||
feilmelding = "Token er ugyldig";
|
||||
}
|
||||
return Promise.reject(new Error(feilmelding));
|
||||
}
|
||||
};
|
||||
@@ -2,7 +2,6 @@ export * from "./sanity/queries";
|
||||
export * from "./sanity/santiy";
|
||||
export * from "./types/types";
|
||||
export * from "./types/search";
|
||||
export * from "./auth/auth";
|
||||
export type { default as SanityT } from "./types/schema";
|
||||
|
||||
export function isDevelopment(): boolean {
|
||||
|
||||
@@ -56,14 +56,6 @@ const useCdn = process.env.USE_CDN_ASSETS === "true";
|
||||
const config = () =>
|
||||
withBundleAnalyzer({
|
||||
transpilePackages: ["@navikt/ds-tokens"],
|
||||
serverRuntimeConfig: {
|
||||
// Will only be available on the server side
|
||||
azureAppClientId: process.env.AZURE_APP_CLIENT_ID,
|
||||
azureJwksUri: process.env.AZURE_OPENID_CONFIG_JWKS_URI,
|
||||
azureAppIssuer: process.env.AZURE_OPENID_CONFIG_ISSUER,
|
||||
azureAppWellKnownUrl: process.env.AZURE_APP_WELL_KNOWN_URL,
|
||||
azureAppJWK: process.env.AZURE_APP_JWK,
|
||||
},
|
||||
publicRuntimeConfig: {
|
||||
NEXT_PUBLIC_TEST: process.env.NEXT_PUBLIC_TEST,
|
||||
},
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
"copy-to-clipboard": "^3.3.1",
|
||||
"date-fns": "2.29.3",
|
||||
"fuse.js": "^6.6.2",
|
||||
"jose": "4.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"next": "^13.2.1",
|
||||
"next-sanity": "^4.1.5",
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { isValidatedApi } from "@/lib";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
export default async (
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
): Promise<void> => {
|
||||
const payload = await isValidatedApi(req);
|
||||
|
||||
const user = payload
|
||||
? { name: payload?.name, mail: payload?.preferred_username }
|
||||
: {};
|
||||
|
||||
res.status(200).json({
|
||||
status: payload ? 200 : 401,
|
||||
...user,
|
||||
});
|
||||
};
|
||||
@@ -25,10 +25,7 @@ const Example = () => {
|
||||
end={p.end}
|
||||
status={p.status}
|
||||
icon={p.icon}
|
||||
onSelectPeriod={() => {
|
||||
setActivePeriod(p.id);
|
||||
p?.onSelectPeriod?.();
|
||||
}}
|
||||
onSelectPeriod={() => setActivePeriod(p.id)}
|
||||
isActive={activePeriod && activePeriod === p.id}
|
||||
/>
|
||||
);
|
||||
@@ -43,10 +40,7 @@ const Example = () => {
|
||||
end={p.end}
|
||||
status={p.status}
|
||||
icon={p.icon}
|
||||
onSelectPeriod={() => {
|
||||
setActivePeriod(p.id);
|
||||
p?.onSelectPeriod?.();
|
||||
}}
|
||||
onSelectPeriod={() => setActivePeriod(p.id)}
|
||||
isActive={activePeriod && activePeriod === p.id}
|
||||
/>
|
||||
);
|
||||
@@ -138,6 +132,7 @@ export default withDsExample(Example);
|
||||
/* Storybook story */
|
||||
export const Demo = {
|
||||
render: Example,
|
||||
desc: "'onSelectPeriod' og 'isActive' lar deg velge aktive perioder for visning av ekstra informasjon en annen plass i UI.",
|
||||
};
|
||||
|
||||
export const args = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getClient } from "@/sanity-client";
|
||||
import { Heading, Ingress } from "@navikt/ds-react";
|
||||
import cl from "clsx";
|
||||
import { WithSidebar } from "components/layout/page-templates/WithSidebar";
|
||||
import ComponentOverview from "components/sanity-modules/component-overview";
|
||||
import ComponentOverview from "components/sanity-modules/ComponentOverview";
|
||||
import { PreviewSuspense } from "next-sanity/preview";
|
||||
import Head from "next/head";
|
||||
import { lazy } from "react";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { SanityBlockContent } from "@/sanity-block";
|
||||
import { getClient } from "@/sanity-client";
|
||||
import { BodyShort, Detail, Heading } from "@navikt/ds-react";
|
||||
import { WithSidebar } from "components/layout/page-templates/WithSidebar";
|
||||
import ComponentOverview from "components/sanity-modules/component-overview";
|
||||
import ComponentOverview from "components/sanity-modules/ComponentOverview";
|
||||
import IntroSeksjon from "components/sanity-modules/IntroSeksjon";
|
||||
import { StatusTag } from "components/website-modules/StatusTag";
|
||||
import { SuggestionBlock } from "components/website-modules/suggestionblock";
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
StorybookIcon,
|
||||
} from "components/assets";
|
||||
import { WithSidebar } from "components/layout/page-templates/WithSidebar";
|
||||
import ComponentOverview from "components/sanity-modules/component-overview";
|
||||
import ComponentOverview from "components/sanity-modules/ComponentOverview";
|
||||
import { SuggestionBlock } from "components/website-modules/suggestionblock";
|
||||
import { PreviewSuspense } from "next-sanity/preview";
|
||||
import Head from "next/head";
|
||||
|
||||
@@ -88,7 +88,7 @@ const Page = ({
|
||||
<main
|
||||
tabIndex={-1}
|
||||
id="hovedinnhold"
|
||||
className="aksel-artikkel #FEFCE9 overflow-hidden bg-[#FEFCE9] pt-[8vw] pb-16 focus:outline-none sm:pb-32"
|
||||
className="aksel-artikkel overflow-hidden bg-[#FEFCE9] pt-[8vw] pb-16 focus:outline-none sm:pb-32"
|
||||
>
|
||||
<div className="px-4">
|
||||
<div className="dynamic-wrapper-prose text-center">
|
||||
|
||||
@@ -41,7 +41,7 @@ const Page = ({
|
||||
<main
|
||||
tabIndex={-1}
|
||||
id="hovedinnhold"
|
||||
className="aksel-artikkel bg-gray-50 pt-[8vw] pb-16 focus:outline-none sm:pb-32"
|
||||
className="aksel-artikkel bg-surface-subtle pt-[8vw] pb-16 focus:outline-none sm:pb-32"
|
||||
>
|
||||
<div className="px-4">
|
||||
<div className="dynamic-wrapper-prose">
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 2.9 MiB |
@@ -1,37 +0,0 @@
|
||||
.skiplink {
|
||||
@apply z-modal bg-border-focus text-text-on-inverted absolute left-0 -translate-y-full p-4 no-underline focus-within:translate-y-0 focus-within:shadow-[inset_0_0_0_2px_white] focus-within:outline-none;
|
||||
}
|
||||
|
||||
.inline-code {
|
||||
border-radius: 0.25rem;
|
||||
background-color: rgb(226 232 240);
|
||||
padding: 0.125em 0.25em;
|
||||
font-size: calc(16em / 18); /* scale font-size with parent */
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.inline-kbd {
|
||||
white-space: nowrap;
|
||||
border-radius: 0.25rem;
|
||||
background-color: var(--a-surface-default);
|
||||
padding: 0.125rem 0.25rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5rem;
|
||||
box-shadow: 0 0 0 1px var(--a-border-strong);
|
||||
color: var(--a-text-default);
|
||||
}
|
||||
|
||||
.aksel.ReactModal__Body--open {
|
||||
overflow: hidden;
|
||||
max-height: 100vh;
|
||||
}
|
||||
|
||||
.header-modal__overlay {
|
||||
z-index: var(--a-z-index-modal);
|
||||
@apply bg-surface-backdrop fixed inset-0 grid place-items-center lg:hidden;
|
||||
}
|
||||
|
||||
.header-modal__overlay-search {
|
||||
z-index: 3000;
|
||||
@apply bg-surface-backdrop fixed inset-0 grid place-items-center;
|
||||
}
|
||||
@@ -49,3 +49,13 @@ a {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Stop content behind modal-scrolling */
|
||||
.aksel.ReactModal__Body--open {
|
||||
overflow: hidden;
|
||||
max-height: 100vh;
|
||||
}
|
||||
|
||||
.skiplink {
|
||||
@apply z-modal bg-border-focus text-text-on-inverted absolute left-0 -translate-y-full p-4 no-underline focus-within:translate-y-0 focus-within:shadow-[inset_0_0_0_2px_white] focus-within:outline-none;
|
||||
}
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
@import "tailwindcss/components";
|
||||
@import "./prismjs.css";
|
||||
@import "./layout.css";
|
||||
@import "./components.css";
|
||||
@import "./overrides.css";
|
||||
|
||||
@import "tailwindcss/utilities";
|
||||
@import "./utilities.css";
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
.aksel-artikkel {
|
||||
@apply bg-gray-50;
|
||||
}
|
||||
|
||||
.reduced-spacing .navds-typo--spacing {
|
||||
@apply mb-2;
|
||||
}
|
||||
|
||||
.content-box {
|
||||
@apply max-w-content-w-padding w-full px-4 pb-4 sm:mx-auto sm:px-6 md:mx-0 md:mr-auto md:px-12;
|
||||
}
|
||||
|
||||
.content-box--full {
|
||||
@apply w-full px-4 pb-4 sm:mx-auto sm:px-6 md:mx-0 md:mr-auto md:px-12;
|
||||
}
|
||||
|
||||
.centered-layout {
|
||||
@apply mx-auto w-full px-4 sm:px-6;
|
||||
}
|
||||
@@ -109,3 +109,7 @@ p.override-text-no-max {
|
||||
.full-bleed {
|
||||
@apply relative left-1/2 right-1/2 -mx-[50vw] w-screen md:left-auto md:right-auto md:mx-auto md:w-full md:max-w-[85%];
|
||||
}
|
||||
|
||||
.centered-layout {
|
||||
@apply mx-auto w-full px-4 sm:px-6;
|
||||
}
|
||||
@@ -10,8 +10,8 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-css": "2.7.1",
|
||||
"@navikt/ds-react": "2.7.1",
|
||||
"@navikt/ds-css": "2.7.2",
|
||||
"@navikt/ds-react": "2.7.2",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
|
||||
@@ -3351,7 +3351,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@navikt/aksel-icons@^2.7.0, @navikt/aksel-icons@workspace:@navikt/aksel-icons":
|
||||
"@navikt/aksel-icons@^2.7.1, @navikt/aksel-icons@workspace:@navikt/aksel-icons":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@navikt/aksel-icons@workspace:@navikt/aksel-icons"
|
||||
dependencies:
|
||||
@@ -3374,7 +3374,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-codemod@^2.7.0, @navikt/ds-codemod@workspace:@navikt/codemod":
|
||||
"@navikt/ds-codemod@^2.7.1, @navikt/ds-codemod@workspace:@navikt/codemod":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@navikt/ds-codemod@workspace:@navikt/codemod"
|
||||
dependencies:
|
||||
@@ -3401,7 +3401,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-css-internal@^2.7.0, @navikt/ds-css-internal@workspace:@navikt/internal/css":
|
||||
"@navikt/ds-css-internal@^2.7.1, @navikt/ds-css-internal@workspace:@navikt/internal/css":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@navikt/ds-css-internal@workspace:@navikt/internal/css"
|
||||
dependencies:
|
||||
@@ -3412,11 +3412,11 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-css@2.7.0, @navikt/ds-css@^2.7.0, @navikt/ds-css@workspace:@navikt/core/css":
|
||||
"@navikt/ds-css@2.7.1, @navikt/ds-css@^2.7.1, @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.7.0
|
||||
"@navikt/ds-tokens": ^2.7.1
|
||||
normalize.css: ^8.0.1
|
||||
postcss: ^8.4.0
|
||||
postcss-cli: ^9.0.0
|
||||
@@ -3425,7 +3425,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-icons@^2.7.0, @navikt/ds-icons@workspace:@navikt/icons":
|
||||
"@navikt/ds-icons@^2.7.1, @navikt/ds-icons@workspace:@navikt/icons":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@navikt/ds-icons@workspace:@navikt/icons"
|
||||
dependencies:
|
||||
@@ -3461,8 +3461,8 @@ __metadata:
|
||||
"@babel/preset-env": 7.19.4
|
||||
"@babel/preset-react": 7.18.6
|
||||
"@babel/preset-typescript": 7.18.6
|
||||
"@navikt/ds-icons": ^2.7.0
|
||||
"@navikt/ds-react": ^2.7.0
|
||||
"@navikt/ds-icons": ^2.7.1
|
||||
"@navikt/ds-react": ^2.7.1
|
||||
"@rollup/plugin-babel": 6.0.2
|
||||
"@rollup/plugin-commonjs": 23.0.2
|
||||
"@rollup/plugin-node-resolve": ^15.0.1
|
||||
@@ -3487,12 +3487,12 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-react-internal@^2.7.0, @navikt/ds-react-internal@workspace:@navikt/internal/react":
|
||||
"@navikt/ds-react-internal@^2.7.1, @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.7.0
|
||||
"@navikt/ds-react": ^2.7.0
|
||||
"@navikt/ds-icons": ^2.7.1
|
||||
"@navikt/ds-react": ^2.7.1
|
||||
clsx: ^1.1.1
|
||||
concurrently: 7.2.1
|
||||
copy-to-clipboard: ^3.3.1
|
||||
@@ -3508,12 +3508,12 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-react@2.7.0, @navikt/ds-react@^2.7.0, @navikt/ds-react@workspace:@navikt/core/react":
|
||||
"@navikt/ds-react@2.7.1, @navikt/ds-react@^2.7.1, @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.7.0
|
||||
"@navikt/ds-icons": ^2.7.1
|
||||
"@radix-ui/react-tabs": 1.0.0
|
||||
"@radix-ui/react-toggle-group": 1.0.0
|
||||
"@testing-library/dom": 8.13.0
|
||||
@@ -3549,11 +3549,11 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-tailwind@^2.7.0, @navikt/ds-tailwind@workspace:@navikt/core/tailwind":
|
||||
"@navikt/ds-tailwind@^2.7.1, @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.7.0
|
||||
"@navikt/ds-tokens": ^2.7.1
|
||||
"@types/jest": ^29.0.0
|
||||
color: 4.2.3
|
||||
jest: ^29.0.0
|
||||
@@ -3564,7 +3564,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@navikt/ds-tokens@^2.7.0, @navikt/ds-tokens@workspace:@navikt/core/tokens":
|
||||
"@navikt/ds-tokens@^2.7.1, @navikt/ds-tokens@workspace:@navikt/core/tokens":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@navikt/ds-tokens@workspace:@navikt/core/tokens"
|
||||
dependencies:
|
||||
@@ -7420,15 +7420,15 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "aksel.nav.no@workspace:aksel.nav.no"
|
||||
dependencies:
|
||||
"@navikt/aksel-icons": ^2.7.0
|
||||
"@navikt/ds-codemod": ^2.7.0
|
||||
"@navikt/ds-css": ^2.7.0
|
||||
"@navikt/ds-css-internal": ^2.7.0
|
||||
"@navikt/ds-icons": ^2.7.0
|
||||
"@navikt/ds-react": ^2.7.0
|
||||
"@navikt/ds-react-internal": ^2.7.0
|
||||
"@navikt/ds-tailwind": ^2.7.0
|
||||
"@navikt/ds-tokens": ^2.7.0
|
||||
"@navikt/aksel-icons": ^2.7.1
|
||||
"@navikt/ds-codemod": ^2.7.1
|
||||
"@navikt/ds-css": ^2.7.1
|
||||
"@navikt/ds-css-internal": ^2.7.1
|
||||
"@navikt/ds-icons": ^2.7.1
|
||||
"@navikt/ds-react": ^2.7.1
|
||||
"@navikt/ds-react-internal": ^2.7.1
|
||||
"@navikt/ds-tailwind": ^2.7.1
|
||||
"@navikt/ds-tokens": ^2.7.1
|
||||
prettier-plugin-tailwindcss: ^0.2.3
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -16073,13 +16073,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"jose@npm:4.10.0":
|
||||
version: 4.10.0
|
||||
resolution: "jose@npm:4.10.0"
|
||||
checksum: c575bf2519b758592b3037cac0da34ff2641e56a050b156fe6ab18c03cd6c22e5338d28d1fe3dd997c9b3c0cc7deda72faca4a93ff41274a587850c6519852d0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"js-sdsl@npm:^4.1.4":
|
||||
version: 4.3.0
|
||||
resolution: "js-sdsl@npm:4.3.0"
|
||||
@@ -21948,8 +21941,8 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "shadow-dom@workspace:examples/shadow-dom"
|
||||
dependencies:
|
||||
"@navikt/ds-css": 2.7.0
|
||||
"@navikt/ds-react": 2.7.0
|
||||
"@navikt/ds-css": 2.7.1
|
||||
"@navikt/ds-react": 2.7.1
|
||||
"@types/react": ^18.0.0
|
||||
"@types/react-dom": ^18.0.0
|
||||
"@vitejs/plugin-react": ^2.1.0
|
||||
@@ -24858,7 +24851,6 @@ __metadata:
|
||||
fuse.js: ^6.6.2
|
||||
jest: ^29.0.0
|
||||
jest-environment-jsdom: ^29.0.0
|
||||
jose: 4.10.0
|
||||
json5: 2.2.1
|
||||
lodash: ^4.17.21
|
||||
next: ^13.2.1
|
||||
|
||||
Reference in new issue
Block a user