Skip to content

Commit

Permalink
Merge branch 'next' into feat/suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes authored Dec 13, 2024
2 parents bc5ba0a + 9050ed1 commit 9c56945
Show file tree
Hide file tree
Showing 62 changed files with 611 additions and 296 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-geese-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet": minor
---

Added option dry run using `--dry` on `tokens create` & `tokens build`
5 changes: 5 additions & 0 deletions .changeset/lazy-wolves-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet": minor
---

`tokens create` now writes by default
5 changes: 5 additions & 0 deletions .changeset/wicked-pots-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet": minor
---

Changed `-w, --write` to `-o, --out-dir` on `tokens create` & `tokens build` for defining output dir
8 changes: 6 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ on:
- 'biome.jsonc'
jobs:
checks:
name: Lint
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/gh-setup
- name: Lint code
- name: Build
run: yarn build
- name: Types
run: yarn types
- name: Biome CI
run: yarn biome ci .
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
pull-requests: write

jobs:
checks:
test:
name: Build & test
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
"css.customData": ["./.vscode/css-data.json"],
"css.customData": [
"./.vscode/css-data.json"
],
"[css]": {
"editor.defaultFormatter": "biomejs.biome"
},
Expand All @@ -24,5 +26,8 @@
},
"[html]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
4 changes: 4 additions & 0 deletions apps/_components/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.css' {
const styles: { [className: string]: string };
export default styles;
}
1 change: 1 addition & 0 deletions apps/_components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@navikt/aksel-icons": "^6.14.0",
"@types/react-syntax-highlighter": "^15.5.13",
"clsx": "^2.1.1",
"next": "^14.2.5",
"prettier": "^3.3.3",
"react-syntax-highlighter": "^15.5.0"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/_components/src/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const Header = ({
onClick={() => setOpen(false)}
prefetch={false}
className={cl(
pathname.includes(item.href) && classes.active,
pathname?.includes(item.href) && classes.active,
classes.link,
'ds-focus',
)}
Expand Down
9 changes: 7 additions & 2 deletions apps/_components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"rootDir": "./src",
"compilerOptions": {
"outDir": "./tsc-build",
"declarationDir": "./dist/types",
Expand All @@ -9,8 +10,12 @@
"noEmit": false,
"incremental": true,
"moduleResolution": "Bundler",
"types": ["@digdir/designsystemet-theme/colors.d.ts"]
"types": ["@digdir/designsystemet-theme/colors.d.ts", "./declarations.d.ts"]
},
"include": ["./src", "./stories", "declarations.d.ts"],
"rootDir": "./src"
"plugins": [
{
"name": "next"
}
]
}
58 changes: 58 additions & 0 deletions apps/storefront/app/monstre/bekreftelsesdialog/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Card, CardContent, Heading, Paragraph } from '@digdir/designsystemet-react';

import { Image } from '@components';
import { MenuPageLayout } from '@layouts';
import { Contributors } from '@blog';

export const metadata = {
title: 'Bekreftelsesdialog',
description: '...'
};

export default ({ children }) => (
<MenuPageLayout
content={children}
data={{
title: 'Bekreftelsesdialog',
date: '23. oktober 2024',
}}
/>
);

## Innledning
I tillegg til [brukerutløste feilmeldinger](/monstre/feilmeldinger) og [systemvarsler](/monstre/systemvarsler), har vi også bekreftelsesdialoger. Bekreftelsesdialoger vises i form av en `modal` eller `popover` og ber brukeren bekrefte en handling som har alvorlige eller irreversible konsekvenser.


#### Popover
En `popover` er et ui-element som legger seg over grensesnittet. I motsetning til `modal` så vil ikke grensesnittet bak bli tonet ned, og brukeren vil ikke bli "låst" inne i popover komponenten. Disse kan være nyttige å bruke om du vil gi en beskjed basert på en handling. For eksempel at du vil informere brukeren om at det elementet de ønsker å slette ikke kan gjenopprettes om de velger å slette det. Disse burde kun brukes om det er lite informasjon som skal gis. Om du har bruk for mer plass kan `modal` være et bedre alternativ.

Eksempelet under viser en popover der du må bekrefte at du ønsker å slette en rad i en tabell.
<Image dataUnstyled
src='/img/popover-systemvarsler.png'
alt='Skjermbilde av tabell med medlemsliste. Popover viser en knapp der du må bekrefte at du ønsker å fjerne et medlem.'
/>


<Card color='brand3' data-unstyled>
*Retningslinjene er under arbeid fra 5. juni 2024 i en tverretatlig arbeidsgruppe med deltakere fra Digdir, Nav, Skatt, Brreg, Politiet, KS DIF og Oslo kommune. Alle er velkommen til å påvirke arbeidet på [Github](https://github.com/digdir/designsystemet/discussions/1801) eller i [#Mønster-kanalen](https://designsystemet.slack.com/archives/C05RBGB92MC/p1712751837722749)[Slack](https://join.slack.com/t/designsystemet/shared_invite/zt-2438eotl3-a4266Vd2IeqMWO8TBw5PrQ).
</Card>

<Contributors
authors={[
'Roy Halvor Frimanslund (Brreg)',
'Astrid Eline Øksnes (Politiet)',
'Bernard Tommerbakke (Oslo Kommune)',
'Vegard Haugstvedt (NAV)',
'Eirik Backer (Mattilsynet)',
'Lasse Febakke Straum (Digdir)',
'Frida Almqvist (Entur)',
'Marianne Røsvik (Digdir)',
'Camilla Orten (SKD)',
'Gørild Døhl (Digdir)',
'Viveca Krishnamoorthi (Digdir)',

]}
/>
<br />
<br />
<br />
Loading

0 comments on commit 9c56945

Please sign in to comment.