Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9e080f892 | ||
|
|
0dc8eb7a1e | ||
|
|
70fd78c926 | ||
|
|
dbc5e7dc07 | ||
|
|
4b0b8e4ae4 | ||
|
|
57e7e1ecc4 | ||
|
|
9534fe2540 | ||
|
|
44683d38f1 | ||
|
|
23c976e5d2 | ||
|
|
9ea823d630 | ||
|
|
65c65a6637 | ||
|
|
ef2a2a9c49 | ||
|
|
3f63fd7fb6 | ||
|
|
6fe9788444 | ||
|
|
10c6545885 | ||
|
|
2e76272a35 | ||
|
|
803a7a4d0f | ||
|
|
d8b7e69788 | ||
|
|
097ef18910 | ||
|
|
bb081354fc | ||
|
|
edc08c6f8a | ||
|
|
fc3577baf4 | ||
|
|
f02250ab75 | ||
|
|
1af80dcc1b | ||
|
|
373f40d968 | ||
|
|
75609e1b09 | ||
|
|
ea9bb63d0a | ||
|
|
a148b08eb5 | ||
|
|
1ca7e746e1 | ||
|
|
535ed17d36 | ||
|
|
8df1bc26a0 | ||
|
|
1b15ab146a | ||
|
|
0868b7d716 | ||
|
|
618d8d3de1 | ||
|
|
e9831b4e2a | ||
|
|
b0aa3ce0e7 | ||
|
|
4fa62f5d64 | ||
|
|
350e929bd2 | ||
|
|
64d178ea36 | ||
|
|
cb3decf3bd | ||
|
|
d66d009fe8 | ||
|
|
5974a77140 | ||
|
|
68b4444bb1 | ||
|
|
fc7d16b64b | ||
|
|
08a893c29a | ||
|
|
8d181e7a92 | ||
|
|
ab1c0849f4 | ||
|
|
96098e532f | ||
|
|
0b14ef50e9 | ||
|
|
262f8bf5d2 | ||
|
|
f18a2dde8f | ||
|
|
2e48c97b50 | ||
|
|
8bf2b8f322 | ||
|
|
ceb7b231b5 | ||
|
|
f7f304b33d | ||
|
|
151484afd3 | ||
|
|
7ae6969b35 | ||
|
|
65cfd8b459 | ||
|
|
3c9405b718 | ||
|
|
48b347e814 | ||
|
|
59de2d7992 | ||
|
|
0166c17985 | ||
|
|
57b1de13a9 | ||
|
|
52104b0f23 | ||
|
|
564a6b4b90 | ||
|
|
d43a4bfbdb | ||
|
|
1e647bffc6 | ||
|
|
986c43ead3 | ||
|
|
ea4fffdeba | ||
|
|
c14e9c346b | ||
|
|
d3dd96d2d4 | ||
|
|
b5fd3dd734 | ||
|
|
6979811e67 | ||
|
|
82ab82889d | ||
|
|
0b978693d6 | ||
|
|
feabc168d7 | ||
|
|
759c12eeef | ||
|
|
e3bc4f99a0 | ||
|
|
8c31007854 | ||
|
|
cf80626256 | ||
|
|
cbcfecbe72 | ||
|
|
a1ae58d041 | ||
|
|
a6cf7c1f25 | ||
|
|
a31a969863 | ||
|
|
19504b0d32 | ||
|
|
920a037b47 | ||
|
|
568f55e4be | ||
|
|
53cbedf041 | ||
|
|
cb356c23dc | ||
|
|
8f76acc776 | ||
|
|
d0269a84c0 | ||
|
|
e36206197d | ||
|
|
5e6bb7e016 | ||
|
|
15ed6b0f2f | ||
|
|
16142657ec | ||
|
|
a5b50f4cef | ||
|
|
796b7ac49f | ||
|
|
9bafc3e218 | ||
|
|
72c04454e5 | ||
|
|
dc4ad88427 | ||
|
|
00ecf7c67c | ||
|
|
83f8127570 | ||
|
|
b6017ea5cf | ||
|
|
b96036d14a | ||
|
|
d0fafb41b3 | ||
|
|
ddf8f65499 | ||
|
|
31aa6243ef | ||
|
|
afca0f481a | ||
|
|
2ffc2c22dc | ||
|
|
d8100c1589 | ||
|
|
a4cce95171 | ||
|
|
01ab8e5741 | ||
|
|
dd1a961dd2 | ||
|
|
11520ce468 | ||
|
|
20c8f9204b | ||
|
|
0074bfd5fb | ||
|
|
a0504f4e57 | ||
|
|
7bcac33423 | ||
|
|
a6feaea201 | ||
|
|
9c6cf8c811 | ||
|
|
592e0ccae9 | ||
|
|
f2f44ad2d7 | ||
|
|
322077fff8 | ||
|
|
5eaf729cc4 | ||
|
|
f285477a6c | ||
|
|
16f693cee9 | ||
|
|
2a7198e02b | ||
|
|
98b4f4e76a | ||
|
|
cf397f2522 | ||
|
|
7f1305c639 | ||
|
|
5964775a8e | ||
|
|
f1ea4ee1e0 | ||
|
|
cc24357a9e | ||
|
|
53406e54a9 | ||
|
|
39faa2b945 | ||
|
|
02e5978664 | ||
|
|
fa20f601df | ||
|
|
132ee94235 | ||
|
|
fa5aa175ab | ||
|
|
cf8833c885 | ||
|
|
a37f42b28a | ||
|
|
b8e797bc92 | ||
|
|
c248cb2a57 | ||
|
|
2a748c7903 | ||
|
|
2f2cbc16ca | ||
|
|
c0b8928ece | ||
|
|
50fe0e785b | ||
|
|
b2d31aed46 | ||
|
|
9fdf2cd4df | ||
|
|
02aa151153 | ||
|
|
a472fc4793 | ||
|
|
fdab54742f | ||
|
|
53230c1d67 | ||
|
|
d6dfdff964 | ||
|
|
2feb10005c |
No files matched your search
@@ -24,10 +24,10 @@ jobs:
|
||||
${{ runner.os }}-build-
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
run: cd aksel.nav.no/sanity && yarn
|
||||
|
||||
- name: Export dataset
|
||||
run: SANITY_TOKEN=${{secrets.SANITY_DATASET_EDITOR_TOKEN}} yarn workspace aksel.nav.no sanity:backup
|
||||
run: cd aksel.nav.no/sanity && SANITY_TOKEN=${{secrets.SANITY_DATASET_EDITOR_TOKEN}} yarn backup
|
||||
- name: Upload GCP bucket
|
||||
uses: "google-github-actions/auth@v0"
|
||||
with:
|
||||
@@ -36,4 +36,4 @@ jobs:
|
||||
with:
|
||||
path: ./aksel.nav.no/sanity
|
||||
destination: "aksel-website-prod/backups"
|
||||
glob: "**/backup-*.tar.gz"
|
||||
glob: "backup-*.tar.gz"
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: yarn workspace website e2e
|
||||
run: yarn workspace website e2e:full
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
|
||||
@@ -20,9 +20,8 @@ jobs:
|
||||
- uses: "actions/checkout@v3"
|
||||
|
||||
- id: upload
|
||||
uses: nais/frontend-plattform-cdn-upload-action@main
|
||||
uses: navikt/frontend/actions/cdn-upload/v1@main
|
||||
with:
|
||||
cdn-environment: cdn.nav.no
|
||||
cdn-team-name: aksel
|
||||
source: ./fonts
|
||||
destination: "" # uploads folder to team root
|
||||
|
||||
@@ -148,3 +148,5 @@ tmp.json
|
||||
/playwright/.cache/
|
||||
playwright-report/
|
||||
/test-results/
|
||||
backup-*.tar.gz
|
||||
sitemap-urls.json
|
||||
@@ -1,5 +1,19 @@
|
||||
# @navikt/ds-codemod
|
||||
|
||||
## 2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-codemod",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"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.0.4",
|
||||
"@navikt/ds-react": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.11",
|
||||
"@navikt/ds-react": "^2.0.11",
|
||||
"clsx": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -51,7 +51,6 @@
|
||||
"@rollup/plugin-commonjs": "23.0.2",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@svgr/cli": "6.2.1",
|
||||
"@types/node": "^17.0.35",
|
||||
"concurrently": "7.2.1",
|
||||
"copyfiles": "2.4.1",
|
||||
"postcss-combine-duplicated-selectors": "10.0.3",
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @navikt/ds-css
|
||||
|
||||
## 2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Reverserte border-width endrind i button
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
border-bottom: 2px solid var(--a-border-strong);
|
||||
border-bottom: 2px solid var(--ac-accordion-header-border, var(--a-border-strong));
|
||||
}
|
||||
|
||||
.navds-accordion__header:focus {
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
.navds-button--secondary {
|
||||
color: var(--ac-button-secondary-text, var(--a-text-action));
|
||||
background-color: var(--ac-button-secondary-bg, var(--a-surface-default));
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
}
|
||||
|
||||
.navds-button--secondary:hover {
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
|
||||
.navds-button--secondary:focus {
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-secondary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-secondary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--secondary:active {
|
||||
@@ -145,7 +145,7 @@
|
||||
.navds-button--secondary:hover:where(:disabled, .navds-button--disabled) {
|
||||
color: var(--ac-button-secondary-text, var(--a-text-action));
|
||||
background-color: var(--ac-button-secondary-bg, var(--a-surface-default));
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-secondary-border, var(--a-border-action));
|
||||
}
|
||||
|
||||
/****************************
|
||||
@@ -162,7 +162,7 @@
|
||||
}
|
||||
|
||||
.navds-button--tertiary:focus {
|
||||
box-shadow: inset 0 0 0 1.5px var(--ac-button-tertiary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
box-shadow: inset 0 0 0 2px var(--ac-button-tertiary-focus-border, var(--a-border-action)), var(--a-shadow-focus);
|
||||
}
|
||||
|
||||
.navds-button--tertiary:active {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"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.0.4",
|
||||
"@navikt/ds-tokens": "^2.0.11",
|
||||
"normalize.css": "^8.0.1",
|
||||
"postcss": "^8.4.0",
|
||||
"postcss-cli": "^9.0.0",
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"--ac-alert-success-bg": "--a-surface-success-subtle"
|
||||
},
|
||||
"accordion": {
|
||||
"--ac-accordion-header-border": "--a-border-strong",
|
||||
"--ac-accordion-header-text-hover": "--a-text-action-on-action-subtle",
|
||||
"--ac-accordion-header-border-hover": "--a-border-strong",
|
||||
"--ac-accordion-item-bg-open": "--a-surface-action-subtle",
|
||||
|
||||
@@ -1,5 +1,64 @@
|
||||
# @navikt/ds-react
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Button submittet form i table
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- ShouldCloseOnEsc i Modal
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Confirmationpanel wrappet med div
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- :bug: Fikset keyboard-click i monthpicker
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- DateInput hadde duplikat className satt
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"description": "Aksel react-components for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@floating-ui/react-dom-interactions": "0.9.2",
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.11",
|
||||
"@radix-ui/react-tabs": "1.0.0",
|
||||
"@radix-ui/react-toggle-group": "1.0.0",
|
||||
"clsx": "^1.2.1",
|
||||
@@ -52,7 +52,6 @@
|
||||
"@testing-library/user-event": "^14.2.0",
|
||||
"@types/faker": "5.5.8",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"@types/react-modal": "^3.13.1",
|
||||
"concurrently": "7.2.1",
|
||||
"copyfiles": "^2.4.1",
|
||||
|
||||
@@ -108,7 +108,6 @@ const DateInput: DateInputType = forwardRef<HTMLInputElement, DateInputProps>(
|
||||
autoComplete="off"
|
||||
aria-controls={ariaId}
|
||||
className={cl(
|
||||
className,
|
||||
"navds-date__field-input",
|
||||
"navds-text-field__input",
|
||||
"navds-body-short",
|
||||
|
||||
@@ -74,7 +74,6 @@ export const MonthButton = ({
|
||||
: -1
|
||||
}
|
||||
onKeyDown={(e) => {
|
||||
e.preventDefault();
|
||||
const next = nextEnabled(
|
||||
months,
|
||||
e.key,
|
||||
|
||||
@@ -51,6 +51,7 @@ export const ConfirmationPanel = forwardRef<
|
||||
size={props.size}
|
||||
className="navds-confirmation-panel__content"
|
||||
id={`confirmation-panel-${id}`}
|
||||
as="div"
|
||||
>
|
||||
{children}
|
||||
</BodyLong>
|
||||
|
||||
@@ -36,6 +36,10 @@ export interface ModalProps {
|
||||
* @default true
|
||||
*/
|
||||
closeButton?: boolean;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
shouldCloseOnEsc?: boolean;
|
||||
/**
|
||||
* Allows custom styling of ReactModal, in accordance with their typing
|
||||
*/
|
||||
@@ -75,6 +79,7 @@ export const Modal = forwardRef<ReactModal, ModalProps>(
|
||||
className,
|
||||
overlayClassName,
|
||||
shouldCloseOnOverlayClick = true,
|
||||
shouldCloseOnEsc = true,
|
||||
closeButton = true,
|
||||
"aria-describedby": ariaDescribedBy,
|
||||
"aria-labelledby": ariaLabelledBy,
|
||||
@@ -123,6 +128,7 @@ export const Modal = forwardRef<ReactModal, ModalProps>(
|
||||
className={cl("navds-modal", className)}
|
||||
overlayClassName={cl("navds-modal__overlay", overlayClassName)}
|
||||
shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}
|
||||
shouldCloseOnEsc={shouldCloseOnEsc}
|
||||
onRequestClose={(e) => onModalCloseRequest(e)}
|
||||
aria={{
|
||||
describedby: ariaDescribedBy,
|
||||
|
||||
@@ -44,6 +44,7 @@ export const ColumnHeader: ColumnHeaderType = forwardRef(
|
||||
>
|
||||
{sortable ? (
|
||||
<button
|
||||
type="button"
|
||||
className="navds-table__sort-button"
|
||||
onClick={
|
||||
sortable && sortKey
|
||||
|
||||
@@ -85,6 +85,7 @@ export const ExpandableRow: ExpandableRowType = forwardRef(
|
||||
>
|
||||
{!expansionDisabled && (
|
||||
<button
|
||||
type="button"
|
||||
className="navds-table__toggle-expand-button"
|
||||
aria-controls={id}
|
||||
aria-expanded={isOpen}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# @navikt/ds-tailwind
|
||||
|
||||
## 2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tailwind",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"description": "Tailwind config based on @navikt/ds-tokens",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -22,9 +22,8 @@
|
||||
"directory": "@navikt/core/tailwind"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@navikt/ds-tokens": "^2.0.4",
|
||||
"@navikt/ds-tokens": "^2.0.11",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# @navikt/ds-tokens
|
||||
|
||||
## 2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-tokens",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"description": "Design-tokens for NAV designsystem",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
@@ -31,7 +31,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/node": "^17.0.35",
|
||||
"color": "4.2.3",
|
||||
"jest": "^29.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @navikt/ds-icons
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Oppdatert svg-path i ikoner
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-icons",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"description": "Aksel icons for NAV",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"repository": {
|
||||
@@ -49,7 +49,6 @@
|
||||
"@svgr/cli": "6.2.1",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/lodash.startcase": "^4.4.6",
|
||||
"@types/node": "^17.0.35",
|
||||
"@types/rimraf": "3.0.2",
|
||||
"axios": "^0.21.3",
|
||||
"concurrently": "7.2.1",
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.70711 4.7071C8.09763 4.31657 8.09763 3.68341 7.70711 3.29289C7.31658 2.90236 6.68342 2.90236 6.29289 3.29289L2.29289 7.29289C2.10535 7.48042 2 7.73478 2 8C2 8.26521 2.10535 8.51957 2.29289 8.7071L6.29289 12.7071C6.68342 13.0976 7.31658 13.0976 7.70711 12.7071C8.09763 12.3166 8.09763 11.6834 7.70711 11.2929L5.41421 8.99999H15C17.7614 8.99999 20 11.2386 20 14C20 16.7614 17.7614 19 15 19H13.7879C13.2356 19 12.7879 19.4477 12.7879 20C12.7879 20.5523 13.2356 21 13.7879 21H15C18.866 21 22 17.866 22 14C22 10.134 18.866 6.99999 15 6.99999H5.41421L7.70711 4.7071Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.70708 4.7071L8.41418 3.99999L6.99997 2.58578L6.29286 3.29288L2.29286 7.29289L1.58575 7.99999L2.29286 8.7071L6.29286 12.7071L6.99997 13.4142L8.41418 12L7.70708 11.2929L5.41418 8.99999H15C17.7614 8.99999 20 11.2386 20 14C20 16.7614 17.7614 19 15 19H13.7878H12.7878V21H13.7878H15C18.866 21 22 17.866 22 14C22 10.134 18.866 6.99999 15 6.99999H5.41418L7.70708 4.7071Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 536 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0C0.895431 0 0 0.89543 0 2V22C0 23.1046 0.89543 24 2 24H22C23.1046 24 24 23.1046 24 22V2C24 0.895431 23.1046 0 22 0H2ZM7.70711 3.29289C8.09763 3.68342 8.09763 4.31658 7.70711 4.70711L5.41422 7H15C18.866 7 22 10.134 22 14C22 17.866 18.866 21 15 21H13.7879C13.2356 21 12.7879 20.5523 12.7879 20C12.7879 19.4477 13.2356 19 13.7879 19H15C17.7614 19 20 16.7614 20 14C20 11.2386 17.7614 9 15 9H5.41421L7.70711 11.2929C8.09763 11.6834 8.09763 12.3166 7.70711 12.7071C7.31659 13.0976 6.68342 13.0976 6.2929 12.7071L2.29289 8.70711C2.10536 8.51957 2 8.26522 2 8C2 7.73479 2.10536 7.48043 2.29289 7.2929L6.2929 3.29289C6.68342 2.90237 7.31659 2.90237 7.70711 3.29289Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.41418 3.99999L6.99997 2.58578L1.58575 7.99999L6.99997 13.4142L8.41418 12L5.41418 8.99999H15C17.7614 8.99999 20 11.2386 20 14C20 16.7614 17.7614 19 15 19H12.7878V21H15C18.866 21 22 17.866 22 14C22 10.134 18.866 6.99999 15 6.99999H5.41418L8.41418 3.99999Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 427 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 17V18H5V17H3ZM20 10L20.7071 10.7071L21.4142 10L20.7071 9.29289L20 10ZM16.7071 5.29289L16 4.58579L14.5858 6L15.2929 6.70711L16.7071 5.29289ZM15.2929 13.2929L14.5858 14L16 15.4142L16.7071 14.7071L15.2929 13.2929ZM5 17V14H3V17H5ZM8 11H20V9H8V11ZM20.7071 9.29289L16.7071 5.29289L15.2929 6.70711L19.2929 10.7071L20.7071 9.29289ZM19.2929 9.29289L15.2929 13.2929L16.7071 14.7071L20.7071 10.7071L19.2929 9.29289ZM5 14C5 12.3431 6.34315 11 8 11V9C5.23858 9 3 11.2386 3 14H5Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16 4.58579L21.4142 10L16 15.4142L14.5858 14L17.5858 11H8C6.34315 11 5 12.3431 5 14V18H3V14C3 11.2386 5.23858 9 8 9H17.5858L14.5858 6.00001L16 4.58579Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 322 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 17V18H5V17H3ZM20 10L20.7071 10.7071L21.4142 10L20.7071 9.29289L20 10ZM16.7071 5.29289L16 4.58579L14.5858 6L15.2929 6.70711L16.7071 5.29289ZM15.2929 13.2929L14.5858 14L16 15.4142L16.7071 14.7071L15.2929 13.2929ZM5 17V14H3V17H5ZM8 11H20V9H8V11ZM20.7071 9.29289L16.7071 5.29289L15.2929 6.70711L19.2929 10.7071L20.7071 9.29289ZM19.2929 9.29289L15.2929 13.2929L16.7071 14.7071L20.7071 10.7071L19.2929 9.29289ZM5 14C5 12.3431 6.34315 11 8 11V9C5.23858 9 3 11.2386 3 14H5Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16 4.58578L21.4142 10L16 15.4142L14.5858 14L17.5858 11H8C6.34315 11 5 12.3431 5 14V18H3V14C3 11.2386 5.23858 9 8 9H17.5858L14.5858 6L16 4.58578Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 316 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 0C0.447715 0 0 0.447716 0 1V23C0 23.5523 0.447716 24 1 24H23C23.5523 24 24 23.5523 24 23V1C24 0.447715 23.5523 0 23 0H1ZM12.2928 10.2929L17.5857 5L13 5V3H21V11H19V6.41412L13.707 11.7071L12.2928 10.2929ZM5 17.5859V13H3V21H11V19H6.4143L11.7072 13.7071L10.293 12.2929L5 17.5859Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5857 5L12.2928 10.2929L13.707 11.7071L19 6.41412V11H21V3H13V5L17.5857 5ZM5 13V17.5859L10.293 12.2929L11.7072 13.7071L6.4143 19H11V21H3V13H5Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 315 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 0C0.447715 0 0 0.447716 0 1V23C0 23.5523 0.447716 24 1 24H23C23.5523 24 24 23.5523 24 23V1C24 0.447715 23.5523 0 23 0H1ZM21.7068 3.70709L16.414 8.99998H20.9999V11H12.9999V2.99998H14.9999V7.5856L20.2926 2.29288L21.7068 3.70709ZM2.29272 20.2929L7.58562 15L2.99991 15L2.99991 13L10.9999 13L10.9999 21H8.99991V16.4141L3.70694 21.7071L2.29272 20.2929Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.414 8.99998L21.7068 3.70709L20.2926 2.29288L14.9999 7.5856V2.99998H12.9999V11H20.9999V8.99998H16.414ZM7.58562 15L2.29272 20.2929L3.70694 21.7071L8.99991 16.4141L8.99991 21H10.9999L10.9999 13L2.99991 13L2.99991 15L7.58562 15Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 399 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.70711 3.7071C10.0976 3.31658 10.0976 2.68341 9.70711 2.29289C9.31658 1.90237 8.68342 1.90237 8.29289 2.29289L5.29289 5.29289C5.10535 5.48043 5 5.73478 5 6C5 6.26522 5.10535 6.51957 5.29289 6.70711L8.29289 9.7071C8.68342 10.0976 9.31658 10.0976 9.70711 9.7071C10.0976 9.31658 10.0976 8.68341 9.70711 8.29289L8.41421 7H17C18.6569 7 20 8.34314 20 10V12C20 12.5523 20.4477 13 21 13C21.5523 13 22 12.5523 22 12V10C22 7.23857 19.7614 5 17 5H8.41421L9.70711 3.7071ZM14.2929 20.2929C13.9024 20.6834 13.9024 21.3166 14.2929 21.7071C14.6834 22.0976 15.3166 22.0976 15.7071 21.7071L18.7071 18.7071C18.8946 18.5196 19 18.2652 19 18C19 17.7348 18.8946 17.4804 18.7071 17.2929L15.7071 14.2929C15.3166 13.9024 14.6834 13.9024 14.2929 14.2929C13.9024 14.6834 13.9024 15.3166 14.2929 15.7071L15.5858 17L7 17C5.34314 17 4 15.6568 4 14L4 12C4 11.4477 3.55228 11 3 11C2.44771 11 2 11.4477 2 12V14C2 16.7614 4.23858 19 7 19H15.5858L14.2929 20.2929Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.70711 3.7071L10.4142 2.99999L9 1.58578L8.29289 2.29289L5.29289 5.29289L4.58578 6L5.29289 6.7071L8.29289 9.7071L9 10.4142L10.4142 8.99999L9.70711 8.29289L8.41421 6.99999H17C18.6569 6.99999 20 8.34314 20 9.99999V12V13H22V12V9.99999C22 7.23857 19.7614 4.99999 17 4.99999H8.41421L9.70711 3.7071ZM14.2929 20.2929L13.5858 21L15 22.4142L15.7071 21.7071L18.7071 18.7071L19.4142 18L18.7071 17.2929L15.7071 14.2929L15 13.5858L13.5858 15L14.2929 15.7071L15.5858 17L7 17C5.34314 17 4 15.6568 4 14L4 12L4 11H2V12V14C2 16.7614 4.23858 19 7 19H15.5858L14.2929 20.2929Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 727 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0C0.895431 0 0 0.89543 0 2V22C0 23.1046 0.89543 24 2 24H22C23.1046 24 24 23.1046 24 22V2C24 0.895431 23.1046 0 22 0H2ZM9.70711 2.29289C10.0976 2.68342 10.0976 3.31658 9.70711 3.70711L8.41421 5H17C19.7614 5 22 7.23858 22 10V12C22 12.5523 21.5523 13 21 13C20.4477 13 20 12.5523 20 12V10C20 8.34315 18.6569 7 17 7H8.41421L9.70711 8.29289C10.0976 8.68342 10.0976 9.31658 9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L5.29289 6.70711C5.10535 6.51957 5 6.26522 5 6C5 5.73479 5.10535 5.48043 5.29289 5.2929L8.29289 2.29289C8.68342 1.90237 9.31658 1.90237 9.70711 2.29289ZM14.2929 21.7071C13.9024 21.3166 13.9024 20.6834 14.2929 20.2929L15.5858 19H7C4.23858 19 2 16.7614 2 14V12C2 11.4477 2.44771 11 3 11C3.55228 11 4 11.4477 4 12V14C4 15.6569 5.34314 17 7 17H15.5858L14.2929 15.7071C13.9024 15.3166 13.9024 14.6834 14.2929 14.2929C14.6834 13.9024 15.3166 13.9024 15.7071 14.2929L18.7071 17.2929C18.8946 17.4804 19 17.7348 19 18C19 18.2652 18.8946 18.5196 18.7071 18.7071L15.7071 21.7071C15.3166 22.0976 14.6834 22.0976 14.2929 21.7071Z" fill="#262626"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.70711 3.7071L10.4142 2.99999L9 1.58578L8.29289 2.29289L5.29289 5.29289L4.58578 6L5.29289 6.7071L8.29289 9.7071L9 10.4142L10.4142 8.99999L9.70711 8.29289L8.41421 6.99999H17C18.6569 6.99999 20 8.34314 20 9.99999V12V13H22V12V9.99999C22 7.23857 19.7614 4.99999 17 4.99999H8.41421L9.70711 3.7071ZM14.2929 20.2929L13.5858 21L15 22.4142L15.7071 21.7071L18.7071 18.7071L19.4142 18L18.7071 17.2929L15.7071 14.2929L15 13.5858L13.5858 15L14.2929 15.7071L15.5858 17L7 17C5.34314 17 4 15.6568 4 14L4 12L4 11H2V12V14C2 16.7614 4.23858 19 7 19H15.5858L14.2929 20.2929Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 727 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.70817 6C8.11909 4.75448 9.9715 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12H2C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C9.27396 2 6.80296 3.09136 5 4.85869L5 2H3L3 8H9V6H6.70817Z" fill="#262626"/>
|
||||
<path d="M6.70817 6C8.11909 4.75448 9.9715 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12H2C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C9.27396 2 6.80296 3.09136 5 4.85869L5 2H3L3 8H9V6H6.70817Z" fill="#262626"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 394 B |
@@ -1,5 +1,19 @@
|
||||
# @navikt/ds-css-internal
|
||||
|
||||
## 2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
## 2.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-css-internal",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"description": "CSS for NAV internal Designsystem-components",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,61 @@
|
||||
# @navikt/ds-react-internal
|
||||
|
||||
## 2.0.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-icons@2.0.11
|
||||
- @navikt/ds-react@2.0.11
|
||||
|
||||
## 2.0.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.10
|
||||
- @navikt/ds-icons@2.0.10
|
||||
|
||||
## 2.0.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.9
|
||||
- @navikt/ds-icons@2.0.9
|
||||
|
||||
## 2.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.8
|
||||
- @navikt/ds-icons@2.0.8
|
||||
|
||||
## 2.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.7
|
||||
- @navikt/ds-icons@2.0.7
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.6
|
||||
- @navikt/ds-icons@2.0.6
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @navikt/ds-react@2.0.5
|
||||
- @navikt/ds-icons@2.0.5
|
||||
|
||||
## 2.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@navikt/ds-react-internal",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"description": "Aksel react components for internal UIs in NAV",
|
||||
"author": "Aksel | NAV designsystem team",
|
||||
"license": "MIT",
|
||||
@@ -35,13 +35,12 @@
|
||||
"watch": "tsc --watch -p tsconfig.esm.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-react": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.11",
|
||||
"@navikt/ds-react": "^2.0.11",
|
||||
"clsx": "^1.1.1",
|
||||
"copy-to-clipboard": "^3.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^17.0.35",
|
||||
"concurrently": "7.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "10.9.0",
|
||||
|
||||
@@ -7,12 +7,17 @@
|
||||
"tags": ["designsystem", "docs"]
|
||||
},
|
||||
{
|
||||
"url": "https://aksel.nav.no/artikkel/",
|
||||
"url": "https://aksel.nav.no/god-praksis/",
|
||||
"tags": ["aksel"],
|
||||
"selectors_key": "aksel"
|
||||
},
|
||||
{
|
||||
"url": "https://aksel.nav.no/blogg/",
|
||||
"url": "https://aksel.nav.no/produktbloggen/",
|
||||
"tags": ["aksel"],
|
||||
"selectors_key": "aksel"
|
||||
},
|
||||
{
|
||||
"url": "https://aksel.nav.no/prinsipper/",
|
||||
"tags": ["aksel"],
|
||||
"selectors_key": "aksel"
|
||||
}
|
||||
@@ -41,7 +46,8 @@
|
||||
"selectors_exclude": [".algolia-ignore-index"],
|
||||
"stop_urls": [
|
||||
"https://aksel.nav.no/preview",
|
||||
"https://old-design-nav.vercel.app"
|
||||
"https://old-design-nav.vercel.app",
|
||||
"https://aksel.nav.no/eksempler"
|
||||
],
|
||||
"sitemap_urls": ["https://aksel.nav.no/api/sitemap"],
|
||||
"js_render": true
|
||||
|
||||
@@ -40,10 +40,3 @@ spec:
|
||||
- host: cdn.sanity.io
|
||||
rules: []
|
||||
env:
|
||||
azure:
|
||||
application:
|
||||
enabled: true
|
||||
allowAllUsers: true
|
||||
tenant: nav.no
|
||||
sidecar:
|
||||
enabled: true
|
||||
@@ -38,13 +38,6 @@ spec:
|
||||
- host: cdn.sanity.io
|
||||
rules: []
|
||||
env:
|
||||
azure:
|
||||
application:
|
||||
enabled: true
|
||||
allowAllUsers: true
|
||||
tenant: nav.no
|
||||
sidecar:
|
||||
enabled: true
|
||||
gcp:
|
||||
buckets:
|
||||
- name: aksel-website-prod
|
||||
|
||||
@@ -8,25 +8,21 @@
|
||||
"dev": "yarn workspace website dev",
|
||||
"build:next": "yarn workspace website build",
|
||||
"serve:next": "yarn workspace website start",
|
||||
"sanity": "yarn workspace sanity start",
|
||||
"sanity:deploy": "yarn workspace sanity deploy",
|
||||
"sanity:backup": "yarn workspace sanity backup",
|
||||
"sanity:update": "yarn workspace website update:sanity",
|
||||
"test": "yarn workspace website test"
|
||||
},
|
||||
"workspaces": [
|
||||
"sanity",
|
||||
"website"
|
||||
],
|
||||
"dependencies": {
|
||||
"@navikt/ds-codemod": "^2.0.4",
|
||||
"@navikt/ds-css": "^2.0.4",
|
||||
"@navikt/ds-css-internal": "^2.0.4",
|
||||
"@navikt/ds-icons": "^2.0.4",
|
||||
"@navikt/ds-react": "^2.0.4",
|
||||
"@navikt/ds-react-internal": "^2.0.4",
|
||||
"@navikt/ds-tailwind": "^2.0.4",
|
||||
"@navikt/ds-tokens": "^2.0.4"
|
||||
"@navikt/ds-codemod": "^2.0.11",
|
||||
"@navikt/ds-css": "^2.0.11",
|
||||
"@navikt/ds-css-internal": "^2.0.11",
|
||||
"@navikt/ds-icons": "^2.0.11",
|
||||
"@navikt/ds-react": "^2.0.11",
|
||||
"@navikt/ds-react-internal": "^2.0.11",
|
||||
"@navikt/ds-tailwind": "^2.0.11",
|
||||
"@navikt/ds-tokens": "^2.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier-plugin-tailwindcss": "^0.1.13"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
.yarn/cache
|
||||
production.tar.gz
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useEffect } from "react";
|
||||
import config from "config:sanity";
|
||||
|
||||
const BUNDLE_CHECK_INTERVAL = 60 * 1000;
|
||||
const BUNDLE_CHECK_INTERVAL_DECLINED = 60 * 10000;
|
||||
const BUNDLE_CHECK_INTERVAL = 60 * 5000;
|
||||
const BUNDLE_CHECK_INTERVAL_DECLINED = 60 * 20000;
|
||||
const CHANGES_AVAILABLE_MESSAGE =
|
||||
"Studioet er har nye endringer! For å ta i bruk disse vil siden nå oppdateres for den nyeste versjonen.";
|
||||
|
||||
@@ -25,6 +25,11 @@ const BundleChecker = () => {
|
||||
interval = createInterval();
|
||||
|
||||
return () => clearInterval(interval);
|
||||
|
||||
/*
|
||||
TODO: @release uncomment for redirecting to new studio
|
||||
*/
|
||||
/* window.location.replace(`http://aksel.nav.no/admin`); */
|
||||
}, []);
|
||||
|
||||
// We're a react component, in theory, so return null to not render anything
|
||||
|
||||
@@ -11,11 +11,6 @@ export const adminPanel = async (roles) =>
|
||||
S.list()
|
||||
.title("Admin")
|
||||
.items([
|
||||
S.documentListItem()
|
||||
.title(`Forside Aksel`)
|
||||
.schemaType(`vk_frontpage`)
|
||||
.icon(() => <Picture />)
|
||||
.id(`frontpage_vk_praksis`),
|
||||
S.listItem()
|
||||
.title("Standalone-sider")
|
||||
.child(S.documentTypeList("aksel_standalone")),
|
||||
|
||||
@@ -68,7 +68,9 @@ export const akselInnhold = async () => {
|
||||
})
|
||||
)
|
||||
),
|
||||
S.listItem().title("Blogg").child(S.documentTypeList("aksel_blogg")),
|
||||
S.listItem()
|
||||
.title("Produktbloggen")
|
||||
.child(S.documentTypeList("aksel_blogg")),
|
||||
S.listItem()
|
||||
.title("Prinsipper")
|
||||
.child(
|
||||
|
||||
@@ -93,18 +93,10 @@ export const dsPanel = async (roles) => {
|
||||
.title("Eksempler")
|
||||
.icon(() => <span>{`EX`}</span>)
|
||||
.child(S.documentTypeList("kode_eksempler_fil")),
|
||||
S.listItem()
|
||||
.title("Fargekategorier")
|
||||
.icon(() => <Folder />)
|
||||
.child(S.documentTypeList("ds_color_categories")),
|
||||
S.listItem()
|
||||
.title("Props")
|
||||
.icon(() => <Folder />)
|
||||
.child(S.documentTypeList("ds_props")),
|
||||
S.listItem()
|
||||
.title("Tokens")
|
||||
.icon(() => <Folder />)
|
||||
.child(S.documentTypeList("ds_tokens")),
|
||||
S.listItem()
|
||||
.title("Token-kategorier")
|
||||
.icon(() => <Folder />)
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
"@sanity/form-builder": "b38478227ba5e22c91981da4b53436df22e48ff25238a55a973ed620be5068aa",
|
||||
"@sanity/data-aspects": "d199e2c199b3e26cd28b68dc84d7fc01c9186bf5089580f2e2446994d36b3cb6",
|
||||
"@sanity/vision": "da5b6ed712703ecd04bf4df560570c668aa95252c6bc1c41d6df1bda9b8b8f60",
|
||||
"power-table": "922902575995e62af8f628e6abe652ecc5f3b1e1d2dec5859392e79e47707088"
|
||||
"power-table": "922902575995e62af8f628e6abe652ecc5f3b1e1d2dec5859392e79e47707088",
|
||||
"table": "e56785cc6cecbacf8ebe6bb99ffae32b973e233503c0714497ac7df3042863f1"
|
||||
}
|
||||
@@ -38,14 +38,6 @@ export const publishedAtField = {
|
||||
!currentUser.roles.find((x) => x.name === "administrator"),
|
||||
};
|
||||
|
||||
export const migratedField = {
|
||||
title: "Migrert riktekst",
|
||||
name: "isMigrated",
|
||||
type: "boolean",
|
||||
hidden: true,
|
||||
initialValue: true,
|
||||
};
|
||||
|
||||
export const titleField = {
|
||||
title: "Sidetittel",
|
||||
name: "heading",
|
||||
@@ -111,19 +103,3 @@ export const innholdFieldNewNested = (name?: string, type?: string) => {
|
||||
delete fields.group;
|
||||
return fields;
|
||||
};
|
||||
|
||||
export const hidePageFeedback = {
|
||||
title: "Tilbakemeldinger",
|
||||
name: "metadata_feedback",
|
||||
type: "object",
|
||||
group: "settings",
|
||||
fields: [
|
||||
{
|
||||
title: "Skjul artikkel feedback modul",
|
||||
description: "Gjemmer <<Var denne artikkelen til hjelp?>> modulen.",
|
||||
name: "hide_feedback",
|
||||
type: "boolean",
|
||||
initialValue: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -114,3 +114,41 @@ export const groups = [
|
||||
title: "SEO",
|
||||
},
|
||||
];
|
||||
|
||||
export const validateKategoriSlug = (Rule, prefix) =>
|
||||
Rule.required().custom((slug, { document }) => {
|
||||
if (!slug.current.startsWith(`${prefix}${document?.kategori}/`)) {
|
||||
return `Slug må starte med prefiks: ${prefix}${document?.kategori}`;
|
||||
}
|
||||
if ((slug.current.match(/\//g) || []).length > 3 - 1) {
|
||||
return `Siden kan bare være på ${3} nivå`;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
export const kategoriSlug = (prefix: string) => ({
|
||||
title: "url (v2)",
|
||||
name: "slug_v2",
|
||||
type: "slug",
|
||||
validation: (Rule) => validateKategoriSlug(Rule, prefix),
|
||||
group: "settings",
|
||||
options: {
|
||||
source: (s) => `${s?.kategori}/${s?.heading}`,
|
||||
slugify: (input) => {
|
||||
return (
|
||||
`${prefix}${input}`
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.slice(0, 200)
|
||||
.trim()
|
||||
.replace(/\s+/g, "-")
|
||||
.replace(/-+/gm, "-")
|
||||
.replace(/æ/g, "a")
|
||||
.replace(/å/g, "a")
|
||||
.replace(/ø/g, "o")
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
.replace(/[&\\#!,+()$~%.'"¨:*?<>{}]/g, "")
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -10,7 +10,10 @@
|
||||
"build": "sanity build",
|
||||
"deploy": "yarn typegen && sanity deploy",
|
||||
"backup": "node scripts/backup.js",
|
||||
"typegen": "sanity exec typegen.ts"
|
||||
"typegen": "sanity exec typegen.ts",
|
||||
"sanity:dev": "sanity start",
|
||||
"sanity:deploy": "yarn typegen && sanity deploy",
|
||||
"sanity:backup": "node scripts/backup.js"
|
||||
},
|
||||
"main": "package.json",
|
||||
"keywords": [
|
||||
@@ -29,6 +32,7 @@
|
||||
"@sanity/export": "^2.30.3",
|
||||
"@sanity/production-preview": "^2.29.3",
|
||||
"@sanity/react-hooks": "^2.35.0",
|
||||
"@sanity/ui": "^0.37.22",
|
||||
"@sanity/vision": "^2.35.0",
|
||||
"moment": "2.29.4",
|
||||
"sanity-codegen": "0.9.8",
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
groups,
|
||||
ingressField,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
relevanteArtiklerField,
|
||||
sanitySlug,
|
||||
@@ -12,7 +11,7 @@ import {
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "artikkel/";
|
||||
const prefix = "god-praksis/artikler/";
|
||||
|
||||
export default {
|
||||
title: "Aksel Artikkel",
|
||||
@@ -22,9 +21,24 @@ export default {
|
||||
...defaultDocPreview,
|
||||
fields: [
|
||||
publishedAtField,
|
||||
{
|
||||
title: "Sist godkjent",
|
||||
name: "updateInfo",
|
||||
type: "object",
|
||||
hidden: true,
|
||||
fields: [
|
||||
{
|
||||
type: "date",
|
||||
name: "lastVerified",
|
||||
title: "Sist oppdatert",
|
||||
description: "Kun synlig for utviklere",
|
||||
readOnly: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 2),
|
||||
sanitySlug(prefix, 3),
|
||||
{
|
||||
title: "Tema",
|
||||
description: "Legg til de viktigeste temaene",
|
||||
@@ -39,6 +53,5 @@ export default {
|
||||
relevanteArtiklerField,
|
||||
|
||||
SEOFields,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
export { default as Artikkel } from "./articles/artikkel";
|
||||
export { default as Blogg } from "./articles/blogg";
|
||||
export { default as Tema } from "./tema";
|
||||
export { default as Prinsipp } from "./articles/prinsipp";
|
||||
export { default as Standalone } from "./articles/standalone";
|
||||
@@ -4,14 +4,13 @@ import {
|
||||
groups,
|
||||
ingressField,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
SEOFields,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "blogg/";
|
||||
const prefix = "produktbloggen/";
|
||||
|
||||
export default {
|
||||
title: "Blogg",
|
||||
@@ -28,6 +27,5 @@ export default {
|
||||
innholdFieldNew,
|
||||
|
||||
SEOFields,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KomponentArtikkel } from "./index";
|
||||
import KomponentArtikkel from "./komponent";
|
||||
|
||||
export default {
|
||||
...KomponentArtikkel,
|
||||
@@ -1,83 +0,0 @@
|
||||
import {
|
||||
defaultDocPreview,
|
||||
editorField,
|
||||
groups,
|
||||
hidePageFeedback,
|
||||
innholdFieldNew,
|
||||
innholdFieldNewNested,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "designsystem/side/";
|
||||
|
||||
export default {
|
||||
title: "Artikkel",
|
||||
name: "ds_artikkel",
|
||||
type: "document",
|
||||
groups,
|
||||
...defaultDocPreview,
|
||||
fields: [
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 3),
|
||||
{
|
||||
title: "Layout",
|
||||
description:
|
||||
"'Full' bruker hele bredden, men fjerner table of content (bruk bare for eks ikonside eller komponentvisning)",
|
||||
name: "layout",
|
||||
type: "string",
|
||||
group: "settings",
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Full", value: "full" },
|
||||
{ title: "Default", value: "default" },
|
||||
],
|
||||
layout: "radio",
|
||||
},
|
||||
initialValue: "default",
|
||||
},
|
||||
{
|
||||
type: "boolean",
|
||||
name: "artikkel_type",
|
||||
title: "Bruk Tabs",
|
||||
group: "innhold",
|
||||
initialValue: false,
|
||||
},
|
||||
{
|
||||
...innholdFieldNew,
|
||||
type: "riktekst_ds_artikkel",
|
||||
hidden: ({ document }) => !!document?.artikkel_type,
|
||||
},
|
||||
{
|
||||
name: "content_tabs",
|
||||
title: "Innhold i Tabs",
|
||||
type: "array",
|
||||
group: "innhold",
|
||||
hidden: ({ document }) => !document?.artikkel_type,
|
||||
of: [
|
||||
{
|
||||
name: "tab",
|
||||
title: "Tab",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Tittel",
|
||||
description: "Innhold vil da legges under url/tab-tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Tabben må ha en enkel tittel"),
|
||||
},
|
||||
innholdFieldNewNested(),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
hidePageFeedback,
|
||||
],
|
||||
};
|
||||
@@ -1,93 +0,0 @@
|
||||
export default {
|
||||
title: "Fargekategori",
|
||||
name: "ds_color_categories",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
title: "Beskrivelse",
|
||||
name: "description",
|
||||
type: "riktekst_enkel",
|
||||
},
|
||||
{
|
||||
type: "array",
|
||||
name: "colors",
|
||||
title: "Farger",
|
||||
of: [{ type: "ds_color" }],
|
||||
options: {
|
||||
sortable: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const Color = {
|
||||
name: "ds_color",
|
||||
title: "Farge",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Navn",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
name: "full_title",
|
||||
title: "CSS variabelnavn",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Fargetype/nivå",
|
||||
name: "color_type",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
initialValue: "global",
|
||||
readOnly: true,
|
||||
options: {
|
||||
layout: "radio",
|
||||
list: [
|
||||
{ value: "global", title: "Global" },
|
||||
{ value: "semantic", title: "Semantic" },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "color_name",
|
||||
title: "Brukt fargenavn",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
hidden: ({ parent }) => parent?.color_type === "global",
|
||||
},
|
||||
{
|
||||
name: "color_roles",
|
||||
title: "Fargeroller",
|
||||
type: "array",
|
||||
hidden: ({ parent }) => parent?.color_type === "global",
|
||||
of: [{ type: "string", name: "role" }],
|
||||
},
|
||||
{
|
||||
name: "color_value",
|
||||
title: "Brukt farge",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
name: "color_index",
|
||||
title: "Fargeindeks",
|
||||
type: "number",
|
||||
description:
|
||||
"Brukes for å endre rekkefølgen på listen. Farger med indeks 0 vil være først, større tall sorteres under der igjen",
|
||||
},
|
||||
],
|
||||
__experimental_omnisearch_visibility: false,
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
export default {
|
||||
title: "Tokens",
|
||||
name: "ds_tokens",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Navn",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Verdi",
|
||||
name: "token",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Faktisk verdi",
|
||||
name: "raw",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Parent",
|
||||
name: "parent",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Beskrivelse",
|
||||
name: "beskrivelse",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
title: "Autogenerert",
|
||||
name: "autogenerated",
|
||||
type: "boolean",
|
||||
readOnly: true,
|
||||
},
|
||||
],
|
||||
__experimental_omnisearch_visibility: false,
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
export { default as KomponentArtikkel } from "./articles/komponent";
|
||||
export { default as Artikkel } from "./articles/artikkel";
|
||||
export { default as ComponentTemplate } from "./component-template";
|
||||
|
||||
export { default as Props } from "./automated/props";
|
||||
export { default as TokensOld } from "./automated/tokens.old";
|
||||
export { default as TokenKategori } from "./automated/tokens";
|
||||
export { default as KodeEksempler } from "./automated/kode-eksempler";
|
||||
export {
|
||||
Color,
|
||||
default as ColorCategories,
|
||||
} from "./automated/color-categories";
|
||||
export { default as Frontpage } from "./frontpage";
|
||||
export { default as Navigation, ds_header_heading } from "./navigation";
|
||||
@@ -1,129 +0,0 @@
|
||||
export default {
|
||||
name: "ds_navigation",
|
||||
title: "Navigation",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Designsystem navigajsons-struktur",
|
||||
name: "title",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
hidden: true,
|
||||
initialValue: "Designsystem navigajsons-struktur",
|
||||
},
|
||||
{
|
||||
name: "headings",
|
||||
title: "Header linker",
|
||||
type: "array",
|
||||
of: [
|
||||
{
|
||||
type: "ds_navigation_heading",
|
||||
name: "heading",
|
||||
title: "Header link",
|
||||
},
|
||||
],
|
||||
validation: (Rule) =>
|
||||
Rule.required()
|
||||
.min(1)
|
||||
.error("Headingmenyen må ha minst en koblet lenke i sidemenyen"),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const ds_header_heading = {
|
||||
name: "ds_navigation_heading",
|
||||
title: "Header link",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Heading tittel",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Side selve headingen linker til",
|
||||
description:
|
||||
"Husk å legge denne til i menyen også, hvis ikke blir den bare tilgjengelig via headern",
|
||||
name: "link_ref",
|
||||
type: "reference",
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må linke til en startside"),
|
||||
},
|
||||
{
|
||||
title: "Meny for denne headingen",
|
||||
name: "menu",
|
||||
type: "array",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny må ha misnt en lenke"),
|
||||
of: [
|
||||
{
|
||||
title: "Menypunkt",
|
||||
name: "item",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Menypunkt tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Link til side",
|
||||
name: "link",
|
||||
type: "reference",
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
options: {
|
||||
modal: {
|
||||
type: "dialog",
|
||||
width: "medium", // 'small' | 'medium' | 'large' | 'full'
|
||||
},
|
||||
},
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må lenke til en side"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "subheading",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Subheading må være fylt ut"),
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare(selection) {
|
||||
const { title } = selection;
|
||||
return {
|
||||
title: title,
|
||||
subtitle: "Subheading",
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare({ title }) {
|
||||
return {
|
||||
title: `${title}`,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,65 @@
|
||||
import {
|
||||
defaultDocPreview,
|
||||
editorField,
|
||||
groups,
|
||||
innholdFieldNew,
|
||||
kategoriSlug,
|
||||
publishedAtField,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "grunnleggende/";
|
||||
|
||||
export default {
|
||||
title: "Artikkel",
|
||||
name: "ds_artikkel",
|
||||
type: "document",
|
||||
groups,
|
||||
...defaultDocPreview,
|
||||
fields: [
|
||||
{
|
||||
title: "Sist godkjent",
|
||||
name: "updateInfo",
|
||||
type: "object",
|
||||
hidden: true,
|
||||
fields: [
|
||||
{
|
||||
type: "date",
|
||||
name: "lastVerified",
|
||||
title: "Sist oppdatert",
|
||||
description: "Kun synlig for utviklere",
|
||||
readOnly: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
publishedAtField,
|
||||
editorField,
|
||||
titleField,
|
||||
kategoriSlug(prefix),
|
||||
{ title: "url", name: "slug", type: "slug", hidden: true },
|
||||
{
|
||||
title: "Kategori",
|
||||
name: "kategori",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Styling", value: "styling" },
|
||||
{ title: "Tokens", value: "tokens" },
|
||||
{ title: "Stæsj", value: "staesj" },
|
||||
{ title: "Guider", value: "guider" },
|
||||
].map((x) => ({
|
||||
title: x.title,
|
||||
value: x.value,
|
||||
})),
|
||||
layout: "radio",
|
||||
},
|
||||
hidden: ({ currentUser }) =>
|
||||
!currentUser.roles.find((x) => x.name === "developer"),
|
||||
},
|
||||
{
|
||||
...innholdFieldNew,
|
||||
type: "riktekst_ds_artikkel",
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,8 +1,143 @@
|
||||
// MIGRERT
|
||||
|
||||
import { People } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
import profilePage from "../../components/profile/profile-page";
|
||||
import { isEditorUnique } from "@/lib";
|
||||
import userStore from "part:@sanity/base/user";
|
||||
import sanityClient from "part:@sanity/base/client";
|
||||
|
||||
const navn = [
|
||||
"Alpesteinbukk",
|
||||
"Amurtiger",
|
||||
"Kamel",
|
||||
"Blissbukk",
|
||||
"Borneoorangutang",
|
||||
"Damfrosk",
|
||||
"Dvergsilkeape",
|
||||
"Dåhjort",
|
||||
"Edderkoppape",
|
||||
"Elandantilope",
|
||||
"Elg",
|
||||
"Esel",
|
||||
"Oter",
|
||||
"Fjellrev",
|
||||
"Flodsvin",
|
||||
"Fugler",
|
||||
"Gaupe",
|
||||
"Gepard",
|
||||
"Gulkinngibbon",
|
||||
"Javalangur",
|
||||
"Jerv",
|
||||
"Krokodille",
|
||||
"Labrador",
|
||||
"Puddel",
|
||||
"Skogskatt",
|
||||
"Maine Coon",
|
||||
"Lavlandstapir",
|
||||
"Beagle",
|
||||
"Hysky",
|
||||
"Løve",
|
||||
"Løvetamarin",
|
||||
"Nubisk geit",
|
||||
"Papegøye",
|
||||
"Ringhalelemur",
|
||||
"Rødpanda",
|
||||
"Sau",
|
||||
"Sjimpanse",
|
||||
"Sjiraff",
|
||||
"Stråleskilpadde",
|
||||
"Slanger",
|
||||
"Steppesebra",
|
||||
"Flamingo",
|
||||
"Struts",
|
||||
"Shetlandsponni",
|
||||
"Surikat",
|
||||
"Tiger",
|
||||
"Ulv",
|
||||
"Fjordfe",
|
||||
"Ekorn",
|
||||
"Bever",
|
||||
"Lemen",
|
||||
"Klatremus",
|
||||
"Fjellmarkmus",
|
||||
"Dvergmus",
|
||||
"Småskogmus",
|
||||
"Steinkobbe",
|
||||
"Røyskatt",
|
||||
"Moskusfe",
|
||||
];
|
||||
|
||||
const adjektiv = [
|
||||
"aktuell",
|
||||
"alvorlig",
|
||||
"ansvarlig",
|
||||
"berømt",
|
||||
"bevisst",
|
||||
"klein",
|
||||
"eksisterende",
|
||||
"fjern",
|
||||
"forsiktig",
|
||||
"heldig",
|
||||
"hjelpsom",
|
||||
"hyppig",
|
||||
"imponerende",
|
||||
"kul",
|
||||
"sjarmerende",
|
||||
"lykkelig",
|
||||
"lys",
|
||||
"merkelig",
|
||||
"mistenkelig",
|
||||
"modig",
|
||||
"morsom",
|
||||
"nysgjerrig",
|
||||
"rå",
|
||||
"rask",
|
||||
"blå",
|
||||
"fersk",
|
||||
"grønn",
|
||||
"rettferdig",
|
||||
"rimelig",
|
||||
"ryddig",
|
||||
"selvsikker",
|
||||
"skarp",
|
||||
"skikkelig",
|
||||
"skyldig",
|
||||
"smal",
|
||||
"sprudlende",
|
||||
"søt",
|
||||
"stolt",
|
||||
"streng",
|
||||
"sulten",
|
||||
"tilgjengelig",
|
||||
"vennlig",
|
||||
"voksen",
|
||||
"ærlig",
|
||||
"flittig",
|
||||
];
|
||||
|
||||
const client = sanityClient.withConfig({ apiVersion: "2020-06-19" });
|
||||
|
||||
const generateName = async () => {
|
||||
console.log("ran");
|
||||
const names = await client.fetch(`*[_type == "editor"].anon_navn.current`);
|
||||
|
||||
let c = 0;
|
||||
let res = "";
|
||||
while ((res === "" || names.includes(res)) && c < 1000) {
|
||||
const adj = adjektiv[Math.floor(Math.random() * adjektiv.length)];
|
||||
const animal = navn[Math.floor(Math.random() * navn.length)];
|
||||
res = `${adj.charAt(0).toUpperCase() + adj.slice(1)} ${animal}`;
|
||||
c += 1;
|
||||
}
|
||||
|
||||
console.log(res);
|
||||
return res;
|
||||
};
|
||||
|
||||
const generateInitialName = async () => ({
|
||||
current: await generateName(),
|
||||
});
|
||||
|
||||
export default {
|
||||
title: "Redaktører",
|
||||
@@ -29,6 +164,23 @@ export default {
|
||||
slugify: (input) => input,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Gjør meg anonym",
|
||||
description:
|
||||
"På artikler bytter vi ut navnet ditt med et tullenavn. Eks. Sprudlende Tiger",
|
||||
name: "anonym",
|
||||
type: "boolean",
|
||||
initialValue: true,
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
hidden: true,
|
||||
title: "Anonymt navn",
|
||||
name: "anon_navn",
|
||||
type: "slug",
|
||||
initialValue: () => generateInitialName(),
|
||||
readOnly: true,
|
||||
},
|
||||
{
|
||||
title: "Roller",
|
||||
description: "eks: Utvikler, Webanalytiker, uu-spesialist",
|
||||
|
||||
@@ -3,13 +3,12 @@ import {
|
||||
editorField,
|
||||
groups,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
kategoriSlug,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
} from "@/lib";
|
||||
|
||||
const prefix = "designsystem/komponenter/";
|
||||
const prefix = "komponenter/";
|
||||
|
||||
export default {
|
||||
title: "Komponentartikkel",
|
||||
@@ -21,7 +20,41 @@ export default {
|
||||
publishedAtField,
|
||||
editorField,
|
||||
titleField,
|
||||
sanitySlug(prefix, 3),
|
||||
kategoriSlug(prefix),
|
||||
{ title: "url", name: "slug", type: "slug", hidden: true },
|
||||
{
|
||||
title: "Sist godkjent",
|
||||
name: "updateInfo",
|
||||
type: "object",
|
||||
hidden: true,
|
||||
fields: [
|
||||
{
|
||||
type: "date",
|
||||
name: "lastVerified",
|
||||
title: "Sist oppdatert",
|
||||
description: "Kun synlig for utviklere",
|
||||
readOnly: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Kategori",
|
||||
name: "kategori",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Core", value: "core" },
|
||||
{ title: "Internal", value: "internal" },
|
||||
].map((x) => ({
|
||||
title: x.title,
|
||||
value: x.value,
|
||||
})),
|
||||
layout: "radio",
|
||||
},
|
||||
hidden: ({ currentUser }) =>
|
||||
!currentUser.roles.find((x) => x.name === "developer"),
|
||||
},
|
||||
{
|
||||
title: "Metadata",
|
||||
name: "status",
|
||||
@@ -46,7 +79,7 @@ export default {
|
||||
},
|
||||
{
|
||||
name: "bilde",
|
||||
title: "Thumbnail/og-bilde",
|
||||
title: "Thumbnail",
|
||||
type: "image",
|
||||
},
|
||||
],
|
||||
@@ -63,7 +96,7 @@ export default {
|
||||
{
|
||||
...innholdFieldNew,
|
||||
type: "riktekst_komponent",
|
||||
name: "bruk_tab",
|
||||
name: "content",
|
||||
title: "Innhold",
|
||||
},
|
||||
{
|
||||
@@ -1,144 +1,121 @@
|
||||
import { Expand, Link } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
const config = require("../../config");
|
||||
|
||||
const maxDepth = 2;
|
||||
|
||||
const checkDepth = (list, depth) => {
|
||||
if (!list || list.length === 0) {
|
||||
throw new Error("Dropdown lister må ha mist et element");
|
||||
}
|
||||
|
||||
if (depth > maxDepth) {
|
||||
throw new Error(`Sidemeny kan ha maks dybde på ${maxDepth} elementer`);
|
||||
}
|
||||
|
||||
for (const el of list) {
|
||||
el._type === "dropdown" && checkDepth(el.dropdown, depth + 1);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
function validateNestedDepth(sidemenu) {
|
||||
if (!sidemenu) {
|
||||
return "Sidemeny må ha minst et element";
|
||||
}
|
||||
try {
|
||||
checkDepth(sidemenu, 0);
|
||||
} catch (e) {
|
||||
return e.message;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "navigation",
|
||||
name: "ds_navigation",
|
||||
title: "Navigation",
|
||||
type: "document",
|
||||
fields: [
|
||||
{
|
||||
title: "Designsystem navigajsons-struktur",
|
||||
name: "title",
|
||||
title: "Tittel",
|
||||
type: "string",
|
||||
readOnly: true,
|
||||
hidden: true,
|
||||
initialValue: "Designsystem navigajsons-struktur",
|
||||
},
|
||||
{
|
||||
name: "sidemenu",
|
||||
title: "Sidemeny",
|
||||
name: "headings",
|
||||
title: "Header linker",
|
||||
type: "array",
|
||||
of: [
|
||||
{
|
||||
type: "ds_navigation_heading",
|
||||
name: "heading",
|
||||
title: "Header link",
|
||||
},
|
||||
],
|
||||
validation: (Rule) =>
|
||||
Rule.required()
|
||||
.min(1)
|
||||
.error("Headingmenyen må ha minst en koblet lenke i sidemenyen"),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const ds_header_heading = {
|
||||
name: "ds_navigation_heading",
|
||||
title: "Header link",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Heading tittel",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Side selve headingen linker til",
|
||||
description:
|
||||
"Linker eller dropdowns med linker. Maks dybde på 2 dropdowns er støttet. Sider må være publisert før de kan linkes her.",
|
||||
type: "array",
|
||||
of: [
|
||||
{ type: "navigation_dropdown", name: "dropdown", title: "Dropdown" },
|
||||
{ type: "navigation_link", name: "link", title: "Link" },
|
||||
],
|
||||
validation: (Rule) => Rule.required().min(1),
|
||||
},
|
||||
],
|
||||
validation: (Rule) =>
|
||||
Rule.required().custom(({ sidemenu, ...rest }) => {
|
||||
return validateNestedDepth(sidemenu);
|
||||
}),
|
||||
};
|
||||
|
||||
export const dropdown = {
|
||||
name: "navigation_dropdown",
|
||||
title: "Dropdown",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Tittel",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
title: "Meny",
|
||||
name: "dropdown",
|
||||
type: "array",
|
||||
of: [
|
||||
{ type: "navigation_link", name: "link", title: "Link" },
|
||||
{ type: "navigation_dropdown", name: "dropdown", title: "Dropdown" },
|
||||
],
|
||||
validation: (Rule) => Rule.required().min(1),
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare({ title }) {
|
||||
return {
|
||||
title: `${title}`,
|
||||
media: <Expand />,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const link = {
|
||||
name: "navigation_link",
|
||||
title: "Link",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
title: "Tittel",
|
||||
type: "string",
|
||||
validation: (Rule) => Rule.required(),
|
||||
},
|
||||
{
|
||||
title: "Link",
|
||||
"Husk å legge denne til i menyen også, hvis ikke blir den bare tilgjengelig via headern",
|
||||
name: "link_ref",
|
||||
type: "reference",
|
||||
weak: true,
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
validation: (Rule) => Rule.required(),
|
||||
/* Matches results based on document prefix */
|
||||
options: {
|
||||
filter: ({ document }) => {
|
||||
const match = config.teams.find((team) =>
|
||||
document._id.endsWith(team.name)
|
||||
);
|
||||
if (!match) {
|
||||
return {
|
||||
filter: ``,
|
||||
};
|
||||
}
|
||||
return {
|
||||
filter: `_type match ["${match.prefix}_*", "*_page"]`,
|
||||
};
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Header lenken må linke til en startside"),
|
||||
},
|
||||
{
|
||||
title: "Meny for denne headingen",
|
||||
name: "menu",
|
||||
type: "array",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny må ha misnt en lenke"),
|
||||
of: [
|
||||
{
|
||||
title: "Menypunkt",
|
||||
name: "item",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Menypunkt tittel",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må ha en tittel"),
|
||||
},
|
||||
{
|
||||
title: "Link til side",
|
||||
name: "link",
|
||||
type: "reference",
|
||||
to: [{ type: "komponent_artikkel" }, { type: "ds_artikkel" }],
|
||||
options: {
|
||||
modal: {
|
||||
type: "dialog",
|
||||
width: "medium", // 'small' | 'medium' | 'large' | 'full'
|
||||
},
|
||||
},
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Sidemeny-lenken må lenke til en side"),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "subheading",
|
||||
type: "object",
|
||||
fields: [
|
||||
{
|
||||
title: "Subheading",
|
||||
name: "title",
|
||||
type: "string",
|
||||
validation: (Rule) =>
|
||||
Rule.required().error("Subheading må være fylt ut"),
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
},
|
||||
prepare(selection) {
|
||||
const { title } = selection;
|
||||
return {
|
||||
title: title,
|
||||
subtitle: "Subheading",
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
options: {
|
||||
modal: {
|
||||
type: "dialog",
|
||||
width: "medium", // 'small' | 'medium' | 'large' | 'full'
|
||||
},
|
||||
},
|
||||
preview: {
|
||||
select: {
|
||||
title: "title",
|
||||
@@ -146,7 +123,6 @@ export const link = {
|
||||
prepare({ title }) {
|
||||
return {
|
||||
title: `${title}`,
|
||||
media: <Link />,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
ingressField,
|
||||
innholdFieldPrinsipp,
|
||||
isSlugUnique,
|
||||
migratedField,
|
||||
prinsipper,
|
||||
publishedAtField,
|
||||
SEOFields,
|
||||
@@ -138,6 +137,5 @@ export default {
|
||||
ingressField,
|
||||
innholdFieldPrinsipp,
|
||||
SEOFields,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
@@ -2,7 +2,6 @@ import {
|
||||
defaultDocPreview,
|
||||
groups,
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
publishedAtField,
|
||||
sanitySlug,
|
||||
titleField,
|
||||
@@ -21,6 +20,5 @@ export default {
|
||||
titleField,
|
||||
sanitySlug(prefix, 2),
|
||||
innholdFieldNew,
|
||||
migratedField,
|
||||
],
|
||||
};
|
||||
@@ -11,7 +11,10 @@ export default {
|
||||
name: "title",
|
||||
type: "string",
|
||||
group: "innhold",
|
||||
validation: (Rule) => Rule.required().error("Temaet må ha et navn"),
|
||||
validation: (Rule) =>
|
||||
Rule.required()
|
||||
.warning("Denne endringe påvirker URL")
|
||||
.error("Temaet må ha et navn"),
|
||||
},
|
||||
{
|
||||
title: "Kort Intro/Oppsummering",
|
||||
@@ -30,6 +33,36 @@ export default {
|
||||
type: "riktekst_enkel",
|
||||
group: "innhold",
|
||||
},
|
||||
{
|
||||
title: "Hidden",
|
||||
name: "bruk_seksjoner",
|
||||
type: "boolean",
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
title: "Shortname",
|
||||
description: "En mer sanitert visning av tema-navnet i url ene",
|
||||
name: "slug",
|
||||
type: "slug",
|
||||
group: "innhold",
|
||||
validation: (Rule) => Rule.required().error("Tema må ha en URL"),
|
||||
options: {
|
||||
source: "title",
|
||||
slugify: (s: string) =>
|
||||
s
|
||||
? s
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.replace(/\s+/g, "-")
|
||||
.replace(/-+/gm, "-")
|
||||
.replace(/æ/g, "a")
|
||||
.replace(/å/g, "a")
|
||||
.replace(/ø/g, "o")
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
.replace(/[&\\#!,+()$~%.'"¨:*?<>{}]/g, "")
|
||||
: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Ansvarlig for tema",
|
||||
description: "Legg til redaktør som har forvaltningsansvaret for temaet",
|
||||
@@ -39,15 +72,6 @@ export default {
|
||||
validation: (Rule) => Rule.required(),
|
||||
group: "innhold",
|
||||
},
|
||||
{
|
||||
title: "Bruk seksjonsinndeling",
|
||||
description:
|
||||
"Vil ikke vise artikler som ikke er lagt til i seksjoner hvis valgt!",
|
||||
name: "bruk_seksjoner",
|
||||
type: "boolean",
|
||||
group: "innhold",
|
||||
initialValue: false,
|
||||
},
|
||||
{
|
||||
title: "Seksjonering",
|
||||
description:
|
||||
@@ -55,7 +79,6 @@ export default {
|
||||
name: "seksjoner",
|
||||
type: "array",
|
||||
group: "innhold",
|
||||
hidden: ({ parent }) => !parent?.bruk_seksjoner,
|
||||
of: [
|
||||
{
|
||||
type: "object",
|
||||
@@ -107,5 +130,19 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Pictogram",
|
||||
name: "pictogram",
|
||||
type: "image",
|
||||
fields: [
|
||||
{
|
||||
name: "alt",
|
||||
type: "string",
|
||||
title: "Attribution",
|
||||
hidden: true,
|
||||
},
|
||||
],
|
||||
validation: (Rule) => Rule.required().error("Tema må ha pictogram"),
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,28 +1,28 @@
|
||||
import Accordion from "./accordion";
|
||||
import Alert from "./alert";
|
||||
import Innholdskort from "./innholdskort";
|
||||
import Bilde from "./bilde";
|
||||
import HeroBilde from "./hero-bilde";
|
||||
import DoDont, { doDontBlock } from "./do-dont";
|
||||
import HeroBilde from "./hero-bilde";
|
||||
import introKomponent from "./intro-komponent";
|
||||
import Kode from "./kode";
|
||||
import KodeEksempler from "./kode-eksempler";
|
||||
import Props from "./props";
|
||||
import RelatertInnhold from "./relatert-innhold";
|
||||
import Innholdskort from "./innholdskort";
|
||||
import KodeEksempler from "./kode-eksempler";
|
||||
import TokenRef from "./token-tabell";
|
||||
import { tmpTabell, tmpTabellRow } from "./tabellv2";
|
||||
import {
|
||||
RiktekstAksel,
|
||||
RiktekstDsArtikkel,
|
||||
RiktekstEnkel,
|
||||
RiktekstKomponent,
|
||||
RiktekstTabell,
|
||||
RiktekstPrinsipp,
|
||||
RiktekstTabell,
|
||||
} from "./riktekst";
|
||||
import SpesialSeksjon from "./spesial-seksjon";
|
||||
import Tastatur from "./tastatur";
|
||||
import Tips from "./tips";
|
||||
import TokenRef from "./token-tabell";
|
||||
import Video from "./video";
|
||||
import { tmpTabell, tmpTabellRow } from "./tabellv2";
|
||||
|
||||
const v2Blocks = [
|
||||
tmpTabell,
|
||||
@@ -36,6 +36,7 @@ const v2Blocks = [
|
||||
RiktekstPrinsipp,
|
||||
|
||||
/* Moduler */
|
||||
/* Tabellv2, */
|
||||
DoDont,
|
||||
doDontBlock,
|
||||
Bilde,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Usikker på om skal være med videre
|
||||
|
||||
import { FileContent } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
initialValue: false,
|
||||
},
|
||||
{
|
||||
title: "Installasjon-snippet",
|
||||
title: "Eksempel-navn",
|
||||
name: "dir",
|
||||
type: "reference",
|
||||
to: [{ type: "kode_eksempler_fil" }],
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import React from "react";
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import { List } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// MIGRERT
|
||||
|
||||
import { allDocumentTypes } from "../../config";
|
||||
import { Link } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Star } from "@navikt/ds-icons";
|
||||
import React from "react";
|
||||
|
||||
export default {
|
||||
title: "Sidemodul",
|
||||
title: "Unik Sidemodul",
|
||||
type: "object",
|
||||
name: "spesial_seksjon",
|
||||
icon: Star,
|
||||
@@ -14,26 +14,13 @@ export default {
|
||||
type: "string",
|
||||
options: {
|
||||
list: [
|
||||
{ title: "Farge kategori", value: "farge_kategori" },
|
||||
{ title: "Token kategori", value: "token_kategori" },
|
||||
{ title: "Ikonsøk", value: "ikonsok" },
|
||||
{ title: "Endringslogg", value: "endringslogg" },
|
||||
{ title: "Komponentoversikt", value: "komponentoversikt" },
|
||||
/* ...Object.keys(docs).map((x) => ({
|
||||
title: `Tokenvisning: ${x}`,
|
||||
value: `tokens_${x}`,
|
||||
})), */
|
||||
],
|
||||
layout: "radio",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Farge kategori",
|
||||
type: "reference",
|
||||
name: "farge_ref",
|
||||
hidden: ({ parent }) => parent.modul !== "farge_kategori",
|
||||
to: [{ type: "ds_color_categories" }],
|
||||
},
|
||||
{
|
||||
title: "Token kategori",
|
||||
type: "reference",
|
||||
@@ -49,7 +36,7 @@ export default {
|
||||
prepare(s) {
|
||||
return {
|
||||
title: s.modul,
|
||||
subtitle: "Sidemodul",
|
||||
subtitle: "Unik Sidemodul",
|
||||
media: () => <Star />,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -4,42 +4,44 @@ import schemaTypes from "all:part:@sanity/base/schema-type";
|
||||
/* Schemas */
|
||||
/* Documents */
|
||||
import editors from "./documents/editors";
|
||||
import navigation, { dropdown, link } from "./documents/navigation";
|
||||
import frontpage from "./documents/frontpage";
|
||||
import redirect from "./documents/redirects";
|
||||
import KodeEksempler from "./documents/kode-eksempler";
|
||||
import Tokens from "./documents/tokens";
|
||||
import Props from "./documents/props";
|
||||
import DsFrontpage from "./documents/ds-frontpage";
|
||||
import DsCompTemplate from "./documents/component-template";
|
||||
import KompArtikkel from "./documents/komponent";
|
||||
import AkselTema from "./documents/tema";
|
||||
import AkselArtikkel from "./documents/aksel-artikkel";
|
||||
import DsArtikkel from "./documents/ds-artikkel";
|
||||
import Blogg from "./documents/blogg";
|
||||
import Prinsipp from "./documents/prinsipp";
|
||||
import Standalone from "./documents/standalone";
|
||||
import Navigation, { ds_header_heading } from "./documents/navigation";
|
||||
|
||||
import * as Designsystem from "./documents/designsystem";
|
||||
import * as Aksel from "./documents/aksel";
|
||||
import v2Blocks from "./modules";
|
||||
|
||||
export default createSchema({
|
||||
name: "default",
|
||||
types: schemaTypes.concat([
|
||||
...v2Blocks,
|
||||
frontpage,
|
||||
editors,
|
||||
navigation,
|
||||
link,
|
||||
dropdown,
|
||||
redirect,
|
||||
Navigation,
|
||||
ds_header_heading,
|
||||
KompArtikkel,
|
||||
|
||||
Designsystem.Color,
|
||||
Designsystem.ds_header_heading,
|
||||
Designsystem.ColorCategories,
|
||||
Designsystem.TokensOld,
|
||||
Designsystem.TokenKategori,
|
||||
Designsystem.KodeEksempler,
|
||||
Designsystem.Props,
|
||||
Designsystem.ComponentTemplate,
|
||||
Designsystem.Frontpage,
|
||||
Designsystem.Navigation,
|
||||
Designsystem.KomponentArtikkel,
|
||||
Designsystem.Artikkel,
|
||||
KodeEksempler,
|
||||
Tokens,
|
||||
Props,
|
||||
DsFrontpage,
|
||||
DsCompTemplate,
|
||||
DsArtikkel,
|
||||
|
||||
Aksel.Artikkel,
|
||||
Aksel.Blogg,
|
||||
Aksel.Tema,
|
||||
Aksel.Prinsipp,
|
||||
Aksel.Standalone,
|
||||
AkselArtikkel,
|
||||
Blogg,
|
||||
AkselTema,
|
||||
Prinsipp,
|
||||
Standalone,
|
||||
]),
|
||||
});
|
||||
@@ -2,6 +2,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 InnholdsKort from "components/sanity-modules/cards/InnholdsKort";
|
||||
import NextLink from "next/link";
|
||||
import React, { createContext, useContext } from "react";
|
||||
import {
|
||||
@@ -10,7 +11,6 @@ import {
|
||||
Bilde,
|
||||
CodeExamples,
|
||||
DoDont,
|
||||
InnholdsKort,
|
||||
Kode,
|
||||
LevelTwoHeading,
|
||||
PropsSeksjon,
|
||||
@@ -93,7 +93,7 @@ const serializers = {
|
||||
case "h3":
|
||||
return (
|
||||
<Heading
|
||||
className="algolia-index-lvl3 max-w-text mt-8 scroll-mt-20 focus:outline-none"
|
||||
className="algolia-index-lvl3 max-w-text text-deepblue-800 mt-8 scroll-mt-20 focus:outline-none"
|
||||
spacing
|
||||
level="3"
|
||||
size="medium"
|
||||
@@ -105,7 +105,7 @@ const serializers = {
|
||||
case "h4":
|
||||
return (
|
||||
<Heading
|
||||
className="algolia-index-lvl4 max-w-text mt-6"
|
||||
className="algolia-index-lvl4 max-w-text text-deepblue-800 mt-6"
|
||||
spacing
|
||||
level="4"
|
||||
size="small"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { definePreview } from "next-sanity/preview";
|
||||
import { ComponentType } from "react";
|
||||
import { config } from "../lib/sanity/config";
|
||||
|
||||
const usePreview = definePreview(config);
|
||||
|
||||
const WithPreview = ({
|
||||
comp: Comp,
|
||||
query,
|
||||
params,
|
||||
props,
|
||||
}: {
|
||||
comp: ComponentType;
|
||||
query: string;
|
||||
props: any;
|
||||
params?: any;
|
||||
}) => {
|
||||
const data = usePreview(null, query, params);
|
||||
return <Comp {...props} {...data} />;
|
||||
};
|
||||
|
||||
export default WithPreview;
|
||||
@@ -1,97 +0,0 @@
|
||||
export const DsFrontpageIllustration = ({ ...rest }) => (
|
||||
<svg
|
||||
width="624"
|
||||
height="240"
|
||||
viewBox="0 0 624 240"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
focusable="false"
|
||||
aria-hidden
|
||||
aria-label="illustrasjon for designsystemet"
|
||||
{...rest}
|
||||
>
|
||||
<g clipPath="url(#clip0_2835_38953)">
|
||||
<circle cx="386.5" cy="144.5" r="95.5" fill="#E6F0FF" />
|
||||
<rect x="144" y="97" width="144" height="144" fill="#66A5F4" />
|
||||
<rect x="49" y="193" width="48" height="48" fill="#0067C5" />
|
||||
<rect x="96" y="193" width="48" height="48" fill="#E6F0FF" />
|
||||
<rect y="193" width="48" height="48" fill="#262626" />
|
||||
<line x1="96.5" y1="-1" x2="96.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="480.5" y1="-1" x2="480.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="144.5" y1="2.18557e-08" x2="144.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="288.5" y1="2.18557e-08" x2="288.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="48.5" y1="-2.18557e-08" x2="48.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="144" y1="145.5" x2="-4.37114e-08" y2="145.5" stroke="#0067C5" />
|
||||
<line x1="144" y1="193.5" x2="-4.37114e-08" y2="193.5" stroke="#0067C5" />
|
||||
<line x1="288" y1="97.5" y2="97.5" stroke="#0067C5" />
|
||||
<line x1="480" y1="97.5" x2="288" y2="97.5" stroke="#0067C5" />
|
||||
<line x1="624" y1="49.5" x2="288" y2="49.5" stroke="#0067C5" />
|
||||
<line x1="624" y1="192.5" x2="288" y2="192.5" stroke="#0067C5" />
|
||||
<rect x="480" y="193" width="144" height="50" fill="#262626" />
|
||||
<path
|
||||
d="M200.355 159.833L200.355 159.833L200.358 159.841C201.098 162.554 201.863 165.194 202.652 167.761L204.167 173.032H193.152L194.667 167.761C195.457 165.193 196.198 162.575 196.889 159.909L196.89 159.907L198.625 153.087C199.202 155.319 199.779 157.567 200.355 159.833ZM177.525 193.186L177.311 193.841H178H186.722H187.098L187.203 193.479L190.868 180.758H206.377L210.043 193.479L210.147 193.841H210.523H219.541H220.229L220.016 193.186L204.272 144.845L204.16 144.5H203.797H193.744H193.381L193.269 144.845L177.525 193.186ZM226.741 191.699L226.746 191.703C228.825 193.731 231.545 194.728 234.856 194.728C237.098 194.728 239.172 194.243 241.069 193.27C242.815 192.396 244.455 191.334 245.99 190.084L246.483 193.414L246.547 193.841H246.978H254H254.5V193.341V171.831C254.5 166.692 253.354 162.691 250.984 159.906C248.645 157.05 245.107 155.661 240.473 155.661C237.511 155.661 234.742 156.138 232.168 157.097C229.626 158.044 227.328 159.168 225.275 160.47L224.879 160.72L225.103 161.131L228.208 166.823L228.458 167.282L228.906 167.011C230.51 166.039 232.138 165.213 233.787 164.534C235.455 163.867 237.141 163.535 238.847 163.535C240.029 163.535 240.986 163.725 241.739 164.079L241.75 164.084L241.761 164.089C242.518 164.401 243.106 164.862 243.541 165.47L243.553 165.486L243.566 165.502C244.051 166.076 244.387 166.764 244.568 167.579L244.572 167.595L244.576 167.612C244.77 168.268 244.9 168.96 244.966 169.686C241.406 170.08 238.311 170.633 235.685 171.349L235.683 171.35C232.991 172.097 230.728 173.025 228.904 174.14L228.904 174.14L228.898 174.143C227.114 175.265 225.767 176.63 224.882 178.243L224.882 178.243L224.879 178.249C224.047 179.809 223.638 181.592 223.638 183.584C223.638 186.898 224.662 189.62 226.741 191.699L226.741 191.699ZM241.338 186.104L241.338 186.104L241.33 186.109C240.23 186.751 238.988 187.076 237.591 187.076C236.145 187.076 235.001 186.727 234.121 186.067C233.3 185.451 232.843 184.442 232.843 182.919C232.843 182.12 233.041 181.366 233.444 180.651C233.831 179.962 234.493 179.331 235.473 178.77L235.481 178.766L235.489 178.761C236.473 178.152 237.782 177.601 239.432 177.116C240.945 176.671 242.8 176.304 245 176.02V183.365C243.7 184.555 242.479 185.465 241.338 186.104Z"
|
||||
fill="black"
|
||||
stroke="black"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M530.667 89H520V99.6667H530.667V89ZM530.667 115.667H520V126.333H530.667V115.667ZM520 142.333H530.667V153H520V142.333ZM557.333 89H546.667V99.6667H557.333V89ZM546.667 115.667H557.333V126.333H546.667V115.667ZM557.333 142.333H546.667V153H557.333V142.333ZM573.333 89H584V99.6667H573.333V89ZM584 115.667H573.333V126.333H584V115.667ZM573.333 142.333H584V153H573.333V142.333Z"
|
||||
fill="#262626"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_2835_38953">
|
||||
<rect width="624" height="240" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
);
|
||||
|
||||
export const DsFrontpageFooterIllustration = ({ ...rest }) => (
|
||||
<svg
|
||||
viewBox="0 0 624 240"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
focusable="false"
|
||||
aria-hidden
|
||||
aria-label="illustrasjon for designsystemet"
|
||||
{...rest}
|
||||
>
|
||||
<g clipPath="url(#clip0_2835_38954)">
|
||||
<circle cx="386.5" cy="144.5" r="95.5" fill="#E6F0FF" />
|
||||
<rect x="144" y="97" width="144" height="144" fill="#66A5F4" />
|
||||
<rect x="49" y="193" width="48" height="48" fill="#0067C5" />
|
||||
<rect x="96" y="193" width="48" height="48" fill="#E6F0FF" />
|
||||
<rect y="193" width="48" height="48" fill="#262626" />
|
||||
<line x1="96.5" y1="-1" x2="96.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="480.5" y1="-1" x2="480.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="144.5" y1="2.18557e-08" x2="144.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="288.5" y1="2.18557e-08" x2="288.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="48.5" y1="-2.18557e-08" x2="48.5" y2="240" stroke="#0067C5" />
|
||||
<line x1="144" y1="145.5" x2="-4.37114e-08" y2="145.5" stroke="#0067C5" />
|
||||
<line x1="144" y1="193.5" x2="-4.37114e-08" y2="193.5" stroke="#0067C5" />
|
||||
<line x1="288" y1="97.5" y2="97.5" stroke="#0067C5" />
|
||||
<line x1="480" y1="97.5" x2="288" y2="97.5" stroke="#0067C5" />
|
||||
<line x1="624" y1="49.5" x2="288" y2="49.5" stroke="#0067C5" />
|
||||
<line x1="624" y1="192.5" x2="288" y2="192.5" stroke="#0067C5" />
|
||||
<rect x="480" y="193" width="144" height="50" fill="#262626" />
|
||||
<path
|
||||
d="M200.355 159.833L200.355 159.833L200.358 159.841C201.098 162.554 201.863 165.194 202.652 167.761L204.167 173.032H193.152L194.667 167.761C195.457 165.193 196.198 162.575 196.889 159.909L196.89 159.907L198.625 153.087C199.202 155.319 199.779 157.567 200.355 159.833ZM177.525 193.186L177.311 193.841H178H186.722H187.098L187.203 193.479L190.868 180.758H206.377L210.043 193.479L210.147 193.841H210.523H219.541H220.229L220.016 193.186L204.272 144.845L204.16 144.5H203.797H193.744H193.381L193.269 144.845L177.525 193.186ZM226.741 191.699L226.746 191.703C228.825 193.731 231.545 194.728 234.856 194.728C237.098 194.728 239.172 194.243 241.069 193.27C242.815 192.396 244.455 191.334 245.99 190.084L246.483 193.414L246.547 193.841H246.978H254H254.5V193.341V171.831C254.5 166.692 253.354 162.691 250.984 159.906C248.645 157.05 245.107 155.661 240.473 155.661C237.511 155.661 234.742 156.138 232.168 157.097C229.626 158.044 227.328 159.168 225.275 160.47L224.879 160.72L225.103 161.131L228.208 166.823L228.458 167.282L228.906 167.011C230.51 166.039 232.138 165.213 233.787 164.534C235.455 163.867 237.141 163.535 238.847 163.535C240.029 163.535 240.986 163.725 241.739 164.079L241.75 164.084L241.761 164.089C242.518 164.401 243.106 164.862 243.541 165.47L243.553 165.486L243.566 165.502C244.051 166.076 244.387 166.764 244.568 167.579L244.572 167.595L244.576 167.612C244.77 168.268 244.9 168.96 244.966 169.686C241.406 170.08 238.311 170.633 235.685 171.349L235.683 171.35C232.991 172.097 230.728 173.025 228.904 174.14L228.904 174.14L228.898 174.143C227.114 175.265 225.767 176.63 224.882 178.243L224.882 178.243L224.879 178.249C224.047 179.809 223.638 181.592 223.638 183.584C223.638 186.898 224.662 189.62 226.741 191.699L226.741 191.699ZM241.338 186.104L241.338 186.104L241.33 186.109C240.23 186.751 238.988 187.076 237.591 187.076C236.145 187.076 235.001 186.727 234.121 186.067C233.3 185.451 232.843 184.442 232.843 182.919C232.843 182.12 233.041 181.366 233.444 180.651C233.831 179.962 234.493 179.331 235.473 178.77L235.481 178.766L235.489 178.761C236.473 178.152 237.782 177.601 239.432 177.116C240.945 176.671 242.8 176.304 245 176.02V183.365C243.7 184.555 242.479 185.465 241.338 186.104Z"
|
||||
fill="black"
|
||||
stroke="black"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M530.667 89H520V99.6667H530.667V89ZM530.667 115.667H520V126.333H530.667V115.667ZM520 142.333H530.667V153H520V142.333ZM557.333 89H546.667V99.6667H557.333V89ZM546.667 115.667H557.333V126.333H546.667V115.667ZM557.333 142.333H546.667V153H557.333V142.333ZM573.333 89H584V99.6667H573.333V89ZM584 115.667H573.333V126.333H584V115.667ZM573.333 142.333H584V153H573.333V142.333Z"
|
||||
fill="#262626"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_2835_38954">
|
||||
<rect width="624" height="240" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
);
|
||||
@@ -0,0 +1,47 @@
|
||||
import React from "react";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
const Logo = (props): JSX.Element => (
|
||||
<svg
|
||||
width="119"
|
||||
height="26"
|
||||
viewBox="0 0 119 26"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
aria-hidden
|
||||
{...props}
|
||||
>
|
||||
<path
|
||||
d="M56.9682 23.3413L48.1959 1.94542C47.9106 1.30354 47.2687 0.839966 46.5199 0.839966C45.8067 0.839966 45.1292 1.30354 44.8795 1.94542L36.1072 23.3413C36.0359 23.5196 36.0002 23.6623 36.0002 23.7692C36.0002 24.3398 36.4638 24.839 37.07 24.839C37.498 24.839 37.9259 24.5537 38.0685 24.1615L40.1724 18.8838H52.903L55.0069 24.1615C55.1496 24.5537 55.5418 24.839 56.0054 24.839C56.6116 24.839 57.0752 24.3398 57.0752 23.7692C57.0752 23.5909 57.0039 23.4483 56.9682 23.3413ZM40.9213 17.0295L46.5199 2.9439L52.1541 17.0295H40.9213Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M75.0623 23.2343L68.1086 15.3179L74.884 8.93474C75.0623 8.75645 75.1693 8.50683 75.1693 8.29287C75.1693 7.82929 74.8127 7.40137 74.3135 7.40137C74.0995 7.40137 73.8855 7.47269 73.7072 7.61533L63.4729 17.3148V1.76712C63.4729 1.26788 63.045 0.839966 62.5457 0.839966C62.0465 0.839966 61.6186 1.26788 61.6186 1.76712V23.9119C61.6186 24.4111 62.0465 24.839 62.5457 24.839C63.045 24.839 63.4729 24.4111 63.4729 23.9119V19.5614L66.6823 16.5303L73.6003 24.5181C73.7786 24.732 74.0282 24.839 74.3491 24.839C74.884 24.839 75.2763 24.4111 75.2763 23.8762C75.2763 23.6266 75.205 23.4126 75.0623 23.2343Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M79.0353 22.9491C80.747 24.5181 82.6726 25.16 85.1331 25.16C89.448 25.16 91.5876 22.8777 91.5876 20.0963C91.5876 16.4233 88.2712 15.6031 85.3114 14.8543C82.9222 14.2481 80.7113 13.7132 80.7113 11.7519C80.7113 9.96888 82.3517 8.64947 85.0262 8.64947C86.9518 8.64947 88.5565 9.327 89.6619 10.3968C89.7689 10.5038 89.9829 10.6108 90.1612 10.6108C90.6247 10.6108 90.9813 10.2185 90.9813 9.79058C90.9813 9.5053 90.8744 9.327 90.6961 9.1487C89.4123 7.93627 87.5937 7.08043 85.0262 7.08043C81.1392 7.08043 78.8927 9.22002 78.8927 11.8589C78.8927 15.2109 82.0664 15.9597 84.9548 16.6729C87.4154 17.3148 89.7689 17.9567 89.7689 20.1676C89.7689 22.1645 88.0572 23.5909 85.1688 23.5909C83.0649 23.5909 81.3532 22.7708 80.1408 21.6296C79.9981 21.487 79.8198 21.4157 79.6059 21.4157C79.1066 21.4157 78.7144 21.8079 78.7144 22.3072C78.7144 22.5568 78.857 22.8064 79.0353 22.9491Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M95.2069 16.1024C95.2069 21.4157 98.8086 25.16 103.837 25.16C106.404 25.16 108.365 24.3398 110.077 22.8421C110.255 22.6638 110.362 22.4855 110.362 22.2359C110.362 21.7723 110.041 21.4513 109.614 21.4513C109.435 21.4513 109.257 21.487 109.15 21.594C107.688 22.9134 105.941 23.5553 103.979 23.5553C99.914 23.5553 97.4179 20.4529 97.2396 16.7086H110.541C111.254 16.7086 111.646 16.3163 111.646 15.6745C111.646 11.2526 108.758 7.08043 103.516 7.08043C98.7373 7.08043 95.2069 11.11 95.2069 16.1024ZM103.48 8.68513C107.795 8.68513 109.72 12.3224 109.756 15.2465H97.2396C97.3822 12.2511 99.4148 8.68513 103.48 8.68513Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M117.365 24.839C117.865 24.839 118.293 24.4111 118.293 23.9119V1.76712C118.293 1.26788 117.865 0.839966 117.365 0.839966C116.866 0.839966 116.438 1.26788 116.438 1.76712V23.9119C116.438 24.4111 116.866 24.839 117.365 24.839Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M0.292684 8.54331C-0.0977248 8.15267 -0.0975372 7.5195 0.293103 7.1291L5.44967 1.97558C5.47463 1.95063 5.4999 1.92606 5.52546 1.90187L5.52289 1.8993C6.03155 1.39065 6.65771 1.07111 7.314 0.9407C7.59976 0.874273 7.89433 0.839967 8.19243 0.839967L20.12 0.839966C22.2629 0.839967 24 2.5771 24 4.71997V16.6435C24 16.9198 23.9705 17.1931 23.9133 17.4591C23.7914 18.1347 23.4693 18.7813 22.9471 19.3035L22.9458 19.3022C22.9189 19.3309 22.8915 19.3592 22.8636 19.3871L17.7071 24.5435C17.3166 24.934 16.6834 24.934 16.2929 24.5435C15.9024 24.153 15.9024 23.5198 16.2929 23.1293L21.4494 17.9728C21.6986 17.7236 21.8706 17.4116 21.9501 17.074C22.0233 16.6182 21.8843 16.1349 21.5329 15.7835L9.06289 3.31352C8.70098 2.95161 8.20044 2.81283 7.73221 2.89716C7.40619 2.97949 7.10531 3.14852 6.86347 3.39021L1.7069 8.54373C1.31626 8.93414 0.683092 8.93395 0.292684 8.54331ZM11.4178 2.83997L22 13.4222V4.71997C22 3.68167 21.1583 2.83997 20.12 2.83997L11.4178 2.83997Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
<path
|
||||
d="M0.292893 24.5435C-0.0976311 24.153 -0.0976311 23.5198 0.292893 23.1293L9.29289 14.1293C9.68342 13.7388 10.3166 13.7388 10.7071 14.1293C11.0976 14.5198 11.0976 15.153 10.7071 15.5435L1.70711 24.5435C1.31658 24.934 0.683417 24.934 0.292893 24.5435Z"
|
||||
fill="#004367"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
|
||||
export default Logo;
|
||||
@@ -2,4 +2,4 @@ export * from "./FigmaIcon";
|
||||
export { default as NavLogoWhite } from "./NavLogoWhite";
|
||||
export { default as NAVLogoDark } from "./NavLogoDark";
|
||||
|
||||
export * from "./DsFrontpageIllustration";
|
||||
export * from "./Logo";
|
||||
@@ -22,8 +22,6 @@ export { default as EditButton } from "./website-modules/EditButton";
|
||||
export { default as Feedback } from "./website-modules/feedback";
|
||||
export * from "./website-modules/H2";
|
||||
export { default as PreviewBanner } from "./website-modules/PreviewBanner";
|
||||
export { default as Search } from "./website-modules/search";
|
||||
export { PrinsippSlope, Slope } from "./website-modules/Slope";
|
||||
export * from "./website-modules/TilToppen";
|
||||
export * from "./website-modules/TOC";
|
||||
export * from "./website-modules/utils";
|
||||
@@ -2,26 +2,7 @@ import Error from "next/error";
|
||||
import React from "react";
|
||||
import { SanityT } from "@/lib";
|
||||
import AkselArtikkelTemplate from "./page-templates/AkselArtikkel";
|
||||
import AkselBloggTemplate from "./page-templates/AkselBlogg";
|
||||
import ArtikkelTemplate from "./page-templates/Artikkel";
|
||||
import ArtikkelTabbedTemplate from "./page-templates/ArtikkelTabbed";
|
||||
import KomponentArtikkelTemplate from "./page-templates/KomponentArtikkel";
|
||||
import AkselPrinsippTemplate from "./page-templates/AkselPrinsipp";
|
||||
import AkselStandaloneTemplate from "./page-templates/AkselStandalone";
|
||||
|
||||
type komponent_artikkel = {
|
||||
komponent_artikkel: (props: {
|
||||
data: SanityT.Schema.komponent_artikkel;
|
||||
title: string;
|
||||
}) => JSX.Element;
|
||||
};
|
||||
|
||||
type ds_artikkel = {
|
||||
ds_artikkel: (props: {
|
||||
data: SanityT.Schema.ds_artikkel;
|
||||
title: string;
|
||||
}) => JSX.Element;
|
||||
};
|
||||
|
||||
type aksel_artikkel = {
|
||||
aksel_artikkel: (props: {
|
||||
@@ -30,20 +11,6 @@ type aksel_artikkel = {
|
||||
}) => JSX.Element;
|
||||
};
|
||||
|
||||
type aksel_blogg = {
|
||||
aksel_blogg: (props: {
|
||||
data: SanityT.Schema.aksel_blogg;
|
||||
title: string;
|
||||
}) => JSX.Element;
|
||||
};
|
||||
|
||||
type aksel_standalone = {
|
||||
aksel_standalone: (props: {
|
||||
data: SanityT.Schema.aksel_standalone;
|
||||
title: string;
|
||||
}) => JSX.Element;
|
||||
};
|
||||
|
||||
type aksel_prinsipp = {
|
||||
aksel_prinsipp: (props: {
|
||||
data: SanityT.Schema.aksel_prinsipp;
|
||||
@@ -51,38 +18,18 @@ type aksel_prinsipp = {
|
||||
}) => JSX.Element;
|
||||
};
|
||||
|
||||
type templateT =
|
||||
| komponent_artikkel
|
||||
| ds_artikkel
|
||||
| aksel_artikkel
|
||||
| aksel_blogg
|
||||
| aksel_standalone
|
||||
| aksel_prinsipp;
|
||||
type templateT = aksel_artikkel | aksel_prinsipp;
|
||||
|
||||
const templates: templateT = {
|
||||
komponent_artikkel: (props) => <KomponentArtikkelTemplate {...props} />,
|
||||
ds_artikkel: (props) =>
|
||||
props.data.artikkel_type ? (
|
||||
<ArtikkelTabbedTemplate {...props} />
|
||||
) : (
|
||||
<ArtikkelTemplate {...props} />
|
||||
),
|
||||
aksel_artikkel: (props) => <AkselArtikkelTemplate {...props} />,
|
||||
aksel_blogg: (props) => <AkselBloggTemplate {...props} />,
|
||||
aksel_prinsipp: (props) => <AkselPrinsippTemplate {...props} />,
|
||||
aksel_standalone: (props) => <AkselStandaloneTemplate {...props} />,
|
||||
};
|
||||
|
||||
const TemplatePicker = ({
|
||||
data,
|
||||
title,
|
||||
}: {
|
||||
data:
|
||||
| SanityT.Schema.komponent_artikkel
|
||||
| SanityT.Schema.aksel_artikkel
|
||||
| SanityT.Schema.aksel_blogg
|
||||
| SanityT.Schema.aksel_standalone
|
||||
| SanityT.Schema.aksel_prinsipp;
|
||||
data: SanityT.Schema.aksel_artikkel | SanityT.Schema.aksel_prinsipp;
|
||||
title: string;
|
||||
}): JSX.Element => {
|
||||
if (!Object.keys(templates).includes(data?._type)) {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import { getActiveHeading } from "@/components";
|
||||
import { mockArtikkel, mockNav } from "@/mockdata";
|
||||
import { PagePropsContext } from "@/utils";
|
||||
import Footer from "./Footer";
|
||||
|
||||
export default {
|
||||
title: "LayoutsParts/Footer",
|
||||
component: Footer,
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
},
|
||||
};
|
||||
|
||||
const args = {
|
||||
page: mockArtikkel,
|
||||
navigation: mockNav,
|
||||
activeHeading: getActiveHeading(mockNav, "designsystem/side/oversikt-guider"),
|
||||
slug: "designsystem/side/oversikt-guider",
|
||||
};
|
||||
|
||||
export const AkselFooter = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider value={{ pageProps: props }}>
|
||||
<Footer variant="aksel" />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
AkselFooter.args = args;
|
||||
|
||||
export const DsFooter = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider value={{ pageProps: props }}>
|
||||
<Footer variant="ds" />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
DsFooter.args = args;
|
||||
@@ -1,64 +1,62 @@
|
||||
import { BodyShort, Heading, Link } from "@navikt/ds-react";
|
||||
import cl from "classnames";
|
||||
|
||||
import NextLink from "next/link";
|
||||
import { EditButton, ScrollTop } from "../..";
|
||||
import FooterForm from "./FooterForm";
|
||||
|
||||
const Footer = ({ variant = "ds" }: { variant: "ds" | "aksel" }) => {
|
||||
const Footer = () => {
|
||||
return (
|
||||
<footer
|
||||
data-hj-suppress
|
||||
data-theme="dark"
|
||||
className={cl(
|
||||
"algolia-ignore-index text-text-on-inverted relative flex w-full justify-center px-4",
|
||||
{
|
||||
"bg-deepblue-800": variant === "aksel",
|
||||
"bg-gray-900": variant === "ds",
|
||||
}
|
||||
)}
|
||||
className="algolia-ignore-index text-text-on-inverted bg-deepblue-800 relative flex w-full justify-center"
|
||||
>
|
||||
<div className="dynamic-wrapper relative grid w-full gap-16 py-12">
|
||||
<div className="relative z-10 mx-auto grid w-full max-w-screen-2xl gap-16 px-4 pt-12 pb-16 md:px-6">
|
||||
<div className="grid gap-12 xl:grid-cols-3 xl:gap-6">
|
||||
<ScrollTop />
|
||||
<div>
|
||||
<Heading as="p" size="small">
|
||||
Kontakt oss
|
||||
<Heading level="2" size="small">
|
||||
Aksel
|
||||
</Heading>
|
||||
<BodyShort as="ul" className="mt-5 grid gap-2">
|
||||
<li>
|
||||
<NextLink href="/artikkel/om-aksel" passHref>
|
||||
<NextLink href="/god-praksis/artikler/om-aksel" passHref>
|
||||
<Link className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200">
|
||||
Om Aksel
|
||||
</Link>
|
||||
</NextLink>
|
||||
</li>
|
||||
<li>
|
||||
<NextLink href="/artikkel/skriv-for-aksel" passHref>
|
||||
<NextLink href="/god-praksis/artikler/skriv-for-aksel" passHref>
|
||||
<Link className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200">
|
||||
Skriv for Aksel
|
||||
</Link>
|
||||
</NextLink>
|
||||
</li>
|
||||
{variant === "aksel" && (
|
||||
<li>
|
||||
<Link
|
||||
className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200"
|
||||
href="https://nav-it.slack.com/archives/C0370ADS0HX"
|
||||
>
|
||||
Aksel på Slack
|
||||
</Link>
|
||||
</li>
|
||||
)}
|
||||
{variant === "ds" && (
|
||||
<li>
|
||||
<li>
|
||||
<Link
|
||||
className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200"
|
||||
href="https://nav-it.slack.com/archives/C0370ADS0HX"
|
||||
>
|
||||
#Aksel på Slack
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link
|
||||
className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200"
|
||||
href="/prinsipper/brukeropplevelse"
|
||||
>
|
||||
Prinsipper for brukeropplevelse
|
||||
</Link>
|
||||
</li>
|
||||
{/* <li>
|
||||
<Link
|
||||
className="text-text-on-inverted focus:shadow-focus focus:text-text-default focus:bg-blue-200 focus:shadow-blue-200"
|
||||
href="https://nav-it.slack.com/archives/C7NE7A8UF"
|
||||
>
|
||||
Designsystemet på Slack
|
||||
</Link>
|
||||
</li>
|
||||
)}
|
||||
</li> */}
|
||||
</BodyShort>
|
||||
</div>
|
||||
<FooterForm />
|
||||
@@ -90,9 +88,10 @@ const Footer = ({ variant = "ds" }: { variant: "ds" | "aksel" }) => {
|
||||
</svg>
|
||||
Arbeids- og velferdsetaten
|
||||
</div>
|
||||
<BodyShort className="mb-1 self-end xl:mb-0">
|
||||
<span className="mb-1 self-end xl:mb-0" />
|
||||
{/* <BodyShort className="mb-1 self-end xl:mb-0">
|
||||
Redaktør: Eidar Grande Vollan
|
||||
</BodyShort>
|
||||
</BodyShort> */}
|
||||
<div className="hidden self-end xl:block">
|
||||
<p>© 2022 NAV</p>
|
||||
<NextLink href="/side/personvernerklaering" passHref>
|
||||
@@ -111,7 +110,48 @@ const Footer = ({ variant = "ds" }: { variant: "ds" | "aksel" }) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<EditButton variant={variant} />
|
||||
<EditButton />
|
||||
<svg
|
||||
width="548"
|
||||
height="422"
|
||||
viewBox="0 0 548 422"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="absolute right-0 bottom-0 z-0"
|
||||
aria-hidden
|
||||
focusable={false}
|
||||
>
|
||||
<path
|
||||
d="M664.991 350.212L431.631 116.852L664.64 116.852L898 350.212L664.991 350.212Z"
|
||||
stroke="#004367"
|
||||
strokeWidth="2.9687"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M625.456 156.037L392.097 389.396L625.456 622.756L858.816 389.396L625.456 156.037Z"
|
||||
stroke="#004367"
|
||||
strokeWidth="2.9687"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M353.262 195.222L119.903 428.581H352.912L586.271 195.222H353.262Z"
|
||||
stroke="#004367"
|
||||
strokeWidth="2.9687"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M314.076 234.407L80.7169 467.767L314.076 701.126L547.436 467.767L314.076 234.407Z"
|
||||
stroke="#004367"
|
||||
strokeWidth="2.9687"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M508.251 506.951L274.892 740.31H507.901L741.261 506.951H508.251Z"
|
||||
stroke="#004367"
|
||||
strokeWidth="2.9687"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Button, Heading, Label, Textarea } from "@navikt/ds-react";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import isEmpty from "validator/lib/isEmpty";
|
||||
|
||||
const FooterForm = () => {
|
||||
const [contactForm, setContactForm] = useState({
|
||||
@@ -17,7 +16,7 @@ const FooterForm = () => {
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
let fail = false;
|
||||
if (isEmpty(contactForm.content, { ignore_whitespace: true })) {
|
||||
if (!contactForm?.content || contactForm?.content.trim().length === 0) {
|
||||
setContentError({
|
||||
...contentError,
|
||||
content: "Melding kan ikke være tom. Fyll inn meldingen.",
|
||||
@@ -58,10 +57,11 @@ const FooterForm = () => {
|
||||
) : (
|
||||
<form onSubmit={(e) => handleSubmit(e)} className="w-full">
|
||||
<div className="mb-4 flex flex-col gap-4">
|
||||
<Heading as="legend" size="small">
|
||||
<Heading level="2" size="small">
|
||||
Gi en tilbakemelding
|
||||
</Heading>
|
||||
<Textarea
|
||||
className="textarea-override"
|
||||
error={contentError.content}
|
||||
autoComplete="off"
|
||||
label="Melding"
|
||||
@@ -73,7 +73,7 @@ const FooterForm = () => {
|
||||
hasWritten: true,
|
||||
});
|
||||
e.target.value &&
|
||||
!isEmpty(e.target.value, { ignore_whitespace: true }) &&
|
||||
e.target.value.trim().length !== 0 &&
|
||||
setContentError({ ...contentError, content: "" });
|
||||
}}
|
||||
description="Ikke skriv inn navn eller andre personopplysninger"
|
||||
@@ -81,6 +81,9 @@ const FooterForm = () => {
|
||||
/>
|
||||
</div>
|
||||
{contactForm.hasWritten && <Button>Send melding</Button>}
|
||||
<style>{`.textarea-override {
|
||||
--ac-textarea-bg: var(--a-deepblue-800);
|
||||
}`}</style>
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
import cl from "classnames";
|
||||
import NextLink from "next/link";
|
||||
import React from "react";
|
||||
import { logNav, Search } from "../..";
|
||||
import AkselLogo from "../../assets/AkselLogo";
|
||||
import ProfileDropdown from "./ProfileDropdown";
|
||||
|
||||
const AkselHeader = ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: "forside" | "artikkel" | "blogg" | "inngang";
|
||||
}): JSX.Element => {
|
||||
return (
|
||||
<header
|
||||
className={cl(
|
||||
"shadow-header group sticky top-0 z-20 w-full backdrop-blur transition-colors duration-200 ease-out",
|
||||
{
|
||||
"header-aksel-forside bg-deepblue-900/90 hover:bg-deepblue-900 text-white":
|
||||
variant === "forside",
|
||||
"header-aksel-artikkel text-deepblue-800 bg-gray-50/80":
|
||||
variant === "artikkel",
|
||||
"header-aksel-artikkel text-deepblue-800 bg-white/80":
|
||||
variant === "inngang",
|
||||
"header-aksel-artikkel text-deepblue-800 bg-orange-50/80 ":
|
||||
variant === "blogg",
|
||||
}
|
||||
)}
|
||||
>
|
||||
<div className="dynamic-wrapper flex justify-between">
|
||||
<a className="skiplink" href="#hovedinnhold" tabIndex={-1}>
|
||||
Hopp til innhold
|
||||
</a>
|
||||
|
||||
<NextLink href="/" passHref>
|
||||
<a
|
||||
className={cl("flex gap-3 px-4 py-3 focus:outline-none", {
|
||||
"focus-visible:shadow-focus-inverted-inset hover:bg-gray-100/10":
|
||||
variant === "forside",
|
||||
"focus-visible:shadow-focus-inset hover:bg-gray-900/10":
|
||||
variant === "artikkel" || variant === "blogg",
|
||||
})}
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"header",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
)
|
||||
}
|
||||
>
|
||||
<AkselLogo className="h-7 w-7" aria-hidden />
|
||||
<span className="text-2xl">Aksel</span>
|
||||
</a>
|
||||
</NextLink>
|
||||
<span className="flex">
|
||||
<ProfileDropdown dark={variant === "forside"} />
|
||||
<Search
|
||||
variant={variant === "forside" ? "aksel-inverted" : "aksel"}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<style jsx global>{`
|
||||
.search-open .header-aksel-forside {
|
||||
background-color: var(--a-deepblue-900);
|
||||
}
|
||||
|
||||
.search-open .header-aksel-artikkel {
|
||||
background-color: var(--a-gray-50);
|
||||
}
|
||||
`}</style>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
export default AkselHeader;
|
||||
@@ -1,92 +0,0 @@
|
||||
import { DsNavigationHeadingT } from "@/lib";
|
||||
import { Header } from "@navikt/ds-react-internal";
|
||||
import cl from "classnames";
|
||||
import NextLink from "next/link";
|
||||
import React, { useContext } from "react";
|
||||
import { logNav, PagePropsContext, Search } from "../..";
|
||||
import MobileNavigation from "./menu/MobileNav";
|
||||
import PortalNavigation from "./menu/PortalNav";
|
||||
import ProfileDropdown from "./ProfileDropdown";
|
||||
|
||||
const DesignsystemHeader = (): JSX.Element => {
|
||||
const { pageProps } = useContext(PagePropsContext);
|
||||
|
||||
const nonMobile = (
|
||||
<>
|
||||
<PortalNavigation title="Designsystemet" />
|
||||
<div className="z-[1050] mr-auto flex">
|
||||
{pageProps?.navigation?.headings.map(
|
||||
(heading: DsNavigationHeadingT) => (
|
||||
<NextLink
|
||||
href={`/${
|
||||
(heading.link_ref as { slug?: { current: string } })?.slug
|
||||
?.current
|
||||
}`}
|
||||
passHref
|
||||
key={heading.title + heading.link_ref}
|
||||
>
|
||||
<a
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"header",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
)
|
||||
}
|
||||
className={cl(
|
||||
"algolia-index-heading 2lg:px-4 min-w-header flex cursor-pointer items-center justify-center whitespace-nowrap py-0 px-2 focus:outline-none",
|
||||
{
|
||||
"text-text-on-inverted hover:bg-gray-800 focus-visible:shadow-[inset_0_0_0_1px_var(--a-gray-900),inset_0_0_0_3px_var(--a-border-focus-on-inverted)]":
|
||||
!(pageProps?.activeHeading?.title === heading.title),
|
||||
"algolia-index-heading--active text-text-default bg-white hover:bg-gray-50 focus-visible:shadow-[inset_0_0_0_1px_var(--a-gray-900),inset_0_0_0_2px_var(--a-white)_,inset_0_0_0_4px_var(--a-gray-900)]":
|
||||
pageProps?.activeHeading?.title === heading.title,
|
||||
}
|
||||
)}
|
||||
>
|
||||
{heading.title}
|
||||
</a>
|
||||
</NextLink>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
<div className="ml-auto flex">
|
||||
<ProfileDropdown dark />
|
||||
<Search />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
const mobile = (
|
||||
<>
|
||||
<PortalNavigation title="Designsystemet" />
|
||||
<div className="ml-auto flex">
|
||||
<ProfileDropdown dark />
|
||||
<Search />
|
||||
<MobileNavigation />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<a className="skiplink" href="#hovedinnhold" tabIndex={-1}>
|
||||
Hopp til innhold
|
||||
</a>
|
||||
<Header className="z-[1050] justify-center">
|
||||
<div
|
||||
className="h-header hidden w-full max-w-screen-2xl lg:flex"
|
||||
data-theme="light"
|
||||
>
|
||||
{nonMobile}
|
||||
</div>
|
||||
<div
|
||||
className="h-header flex w-full max-w-screen-2xl lg:hidden"
|
||||
data-theme="light"
|
||||
>
|
||||
{mobile}
|
||||
</div>
|
||||
</Header>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default DesignsystemHeader;
|
||||
@@ -0,0 +1,105 @@
|
||||
import { Close, Hamburger as HamburgerIcon } from "@navikt/ds-icons";
|
||||
import { Button } from "@navikt/ds-react";
|
||||
import cl from "classnames";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import ReactModal from "react-modal";
|
||||
import { logNav } from "../..";
|
||||
|
||||
const LinkElement = ({ name, href, onClick }) => {
|
||||
const { asPath } = useRouter();
|
||||
return (
|
||||
<li className="flex h-11 items-center">
|
||||
<Link href={href} passHref>
|
||||
<a
|
||||
className={cl(
|
||||
"hover:bg-surface-action-subtle-hover focus-visible:shadow-focus-inset relative flex h-full w-full items-center rounded px-2 focus:outline-none",
|
||||
{
|
||||
"before:bg-surface-action-selected pl-4 font-semibold before:absolute before:left-0 before:h-6 before:w-1 before:rounded-full":
|
||||
asPath.startsWith(href),
|
||||
"": !asPath.startsWith(href),
|
||||
}
|
||||
)}
|
||||
onClick={(e) => {
|
||||
logNav(
|
||||
"header",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
);
|
||||
onClick();
|
||||
}}
|
||||
>
|
||||
{name}
|
||||
</a>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
export const Hamburger = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
ReactModal.setAppElement("#__next");
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={cl("z-[1050] mr-0 flex h-full justify-center")}>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
aria-haspopup="false"
|
||||
onClick={() => setOpen(!open)}
|
||||
aria-expanded={open}
|
||||
className="aksel-tertiary-button"
|
||||
icon={
|
||||
<HamburgerIcon
|
||||
className="pointer-events-none text-2xl"
|
||||
aria-label="Åpne meny"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<ReactModal
|
||||
isOpen={open}
|
||||
onRequestClose={() => setOpen(false)}
|
||||
aria={{ modal: true }}
|
||||
overlayClassName="header-modal__overlay"
|
||||
contentLabel="Meny"
|
||||
className="bg-surface-default xs:max-w-[90%] xs:right-6 xs:left-auto xs:w-96 absolute left-4 top-0 right-4 block rounded py-14 px-11 md:hidden"
|
||||
>
|
||||
<nav aria-label="hovedmeny">
|
||||
<ul>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={() => setOpen(false)}
|
||||
className="aksel-tertiary-button absolute top-2 right-2"
|
||||
icon={<Close title="lukk meny" className="h-5 w-5" />}
|
||||
/>
|
||||
<LinkElement
|
||||
onClick={() => setOpen(false)}
|
||||
name="God praksis"
|
||||
href="/god-praksis"
|
||||
/>
|
||||
<LinkElement
|
||||
onClick={() => setOpen(false)}
|
||||
name="Grunnleggende"
|
||||
href="/grunnleggende"
|
||||
/>
|
||||
<LinkElement
|
||||
onClick={() => setOpen(false)}
|
||||
name="Komponenter"
|
||||
href="/komponenter"
|
||||
/>
|
||||
<LinkElement
|
||||
onClick={() => setOpen(false)}
|
||||
name="Blogg"
|
||||
href="/produktbloggen"
|
||||
/>
|
||||
</ul>
|
||||
</nav>
|
||||
</ReactModal>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,74 +0,0 @@
|
||||
import { getActiveHeading } from "@/components";
|
||||
import { mockArtikkel, mockNav } from "@/mockdata";
|
||||
import { PagePropsContext } from "@/utils";
|
||||
import AkselHeader from "./AkselHeader";
|
||||
import DesignsystemHeader from "./DesignsystemHeader";
|
||||
|
||||
export default {
|
||||
title: "LayoutsParts/Header",
|
||||
component: AkselHeader,
|
||||
subComponents: {
|
||||
DesignsystemHeader,
|
||||
},
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
},
|
||||
};
|
||||
|
||||
const args = {
|
||||
page: mockArtikkel,
|
||||
navigation: mockNav,
|
||||
activeHeading: getActiveHeading(mockNav, "designsystem/side/oversikt-guider"),
|
||||
slug: "designsystem/side/oversikt-guider",
|
||||
};
|
||||
|
||||
export const ArtikkelHeader = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider value={{ pageProps: props }}>
|
||||
<AkselHeader variant="artikkel" />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
ArtikkelHeader.args = args;
|
||||
export const ArtikkelForside = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider value={{ pageProps: props }}>
|
||||
<AkselHeader variant="forside" />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
ArtikkelForside.args = args;
|
||||
|
||||
export const BloggHeader = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider value={{ pageProps: props }}>
|
||||
<AkselHeader variant="blogg" />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
BloggHeader.args = args;
|
||||
|
||||
export const DesignsystemHeaderWNav = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider value={{ pageProps: props }}>
|
||||
<DesignsystemHeader />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
DesignsystemHeaderWNav.args = args;
|
||||
|
||||
export const DesignsystemHeaderNoNav = (props) => {
|
||||
return (
|
||||
<PagePropsContext.Provider
|
||||
value={{ pageProps: { ...props, activeHeading: null } }}
|
||||
>
|
||||
<DesignsystemHeader />
|
||||
</PagePropsContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
DesignsystemHeaderWNav.args = args;
|
||||
@@ -0,0 +1,87 @@
|
||||
import Logo from "components/assets/Logo";
|
||||
import Link from "next/link";
|
||||
import { logNav } from "../..";
|
||||
import cl from "classnames";
|
||||
import { useRouter } from "next/router";
|
||||
import { Hamburger } from "components/layout/header/Hamburger";
|
||||
|
||||
const LinkElement = ({ name, href }) => {
|
||||
const { asPath } = useRouter();
|
||||
return (
|
||||
<li>
|
||||
<Link href={href} passHref>
|
||||
<a
|
||||
className={cl(
|
||||
"text-text-default focus-visible:shadow-focus relative grid h-full place-items-center rounded px-2 focus:outline-none",
|
||||
{
|
||||
"before:bg-border-action-selected font-semibold before:absolute before:bottom-[4px] before:z-10 before:h-1 before:w-full before:rounded-full":
|
||||
asPath.startsWith(href),
|
||||
"hover:before:bg-border-subtle-hover before:absolute before:bottom-[4px] before:z-10 before:h-1 before:w-full before:rounded-full":
|
||||
!asPath.startsWith(href),
|
||||
}
|
||||
)}
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"header",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
)
|
||||
}
|
||||
>
|
||||
{name}
|
||||
</a>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
export const Header = ({
|
||||
variant = "default",
|
||||
}: {
|
||||
variant?: "blogg" | "subtle" | "default" | "transparent";
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<a className="skiplink" href="#hovedinnhold" tabIndex={-1}>
|
||||
Hopp til innhold
|
||||
</a>
|
||||
<header
|
||||
className={cl("h-header z-20 flex items-center", {
|
||||
"bg-[#FEFCE9]": variant === "blogg",
|
||||
"bg-surface-default": variant === "default",
|
||||
"bg-surface-subtle": variant === "subtle",
|
||||
"bg-surface-transparent": variant === "transparent",
|
||||
})}
|
||||
>
|
||||
<div className="xs:pr-6 xs:pl-4 mx-auto flex h-11 w-full max-w-screen-2xl items-center justify-between pr-4 pl-4">
|
||||
<Link href="/" passHref>
|
||||
<a
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"header",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
)
|
||||
}
|
||||
className="focus-visible:shadow-focus grid h-full place-items-center rounded px-2 focus:outline-none"
|
||||
>
|
||||
<Logo />
|
||||
<span className="sr-only">Aksel</span>
|
||||
</a>
|
||||
</Link>
|
||||
<nav className="hidden h-full md:block" aria-label="Hovedmeny">
|
||||
<ul className="hidden h-full gap-2 md:flex">
|
||||
<LinkElement name="God praksis" href="/god-praksis" />
|
||||
<LinkElement name="Grunnleggende" href="/grunnleggende" />
|
||||
<LinkElement name="Komponenter" href="/komponenter" />
|
||||
<LinkElement name="Bloggen" href="/produktbloggen" />
|
||||
</ul>
|
||||
</nav>
|
||||
<div className="h-full md:hidden">
|
||||
<Hamburger />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
/* import { Logout } from "@navikt/ds-icons";
|
||||
import { Button } from "@navikt/ds-react";
|
||||
import { useContext } from "react";
|
||||
import {
|
||||
AuthenticationContext,
|
||||
AuthenticationStatus,
|
||||
} from "../../website-modules/utils";
|
||||
|
||||
const ProfileDropdown = ({ dark = false }: { dark?: boolean }) => {
|
||||
const context = useContext(AuthenticationContext);
|
||||
|
||||
if (context.status !== AuthenticationStatus.IS_AUTHENTICATED) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
data-theme={dark ? "dark" : "light"}
|
||||
onClick={() => context.logout()}
|
||||
className="my-auto bg-transparent md:mx-4"
|
||||
variant="secondary"
|
||||
icon={<Logout title="Logg ut" className="block xs:hidden" />}
|
||||
>
|
||||
<span className="hidden xs:block">Logg ut</span>
|
||||
</Button>
|
||||
);
|
||||
}; */
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const ProfileDropdown = ({ dark = false }: { dark?: boolean }) => null;
|
||||
|
||||
export default ProfileDropdown;
|
||||
@@ -1,165 +0,0 @@
|
||||
import { Back, Close, Hamburger, Next } from "@navikt/ds-icons";
|
||||
import { Detail, Heading } from "@navikt/ds-react";
|
||||
import cl from "classnames";
|
||||
import NextLink from "next/link";
|
||||
import React, { useContext, useEffect, useState } from "react";
|
||||
import { PagePropsContext } from "../../..";
|
||||
import { DsNavigationHeadingT } from "@/lib";
|
||||
import Menu from "../../menu/DsMobileMenu";
|
||||
import Toggle from "./Toggle";
|
||||
|
||||
const MobileNavigation = () => {
|
||||
const { pageProps } = useContext(PagePropsContext);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [heading, setHeading] = useState(pageProps?.activeHeading);
|
||||
const [level, setLevel] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
pageProps?.activeHeading && setHeading(pageProps?.activeHeading);
|
||||
}, [pageProps?.activeHeading]);
|
||||
|
||||
const button = (
|
||||
<>
|
||||
{open ? (
|
||||
<Close
|
||||
className="pointer-events-none text-2xl"
|
||||
aria-label="Lukk meny"
|
||||
/>
|
||||
) : (
|
||||
<Hamburger
|
||||
className="pointer-events-none text-2xl"
|
||||
aria-label="Åpne meny"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
const headingMenu = pageProps?.navigation?.headings && (
|
||||
<>
|
||||
<ul className="animate-fadeIn text-text-default hidden md:block lg:hidden">
|
||||
{pageProps?.navigation?.headings.map(
|
||||
(heading: DsNavigationHeadingT) => (
|
||||
<li
|
||||
key={heading._key}
|
||||
className={cl(
|
||||
"focus-within:shadow-focus-inset hover:bg-surface-hover first-of-type:rounded-t last-of-type:rounded-b",
|
||||
{
|
||||
"border-l-surface-inverted bg-surface-neutral-subtle border-l-[6px]":
|
||||
pageProps?.activeHeading?.title === heading.title,
|
||||
}
|
||||
)}
|
||||
>
|
||||
<NextLink
|
||||
href={`/${heading?.link_ref?.slug?.current ?? "#"}`}
|
||||
passHref
|
||||
>
|
||||
<a
|
||||
className={cl(
|
||||
"text-text-default flex min-h-[48px] w-full items-center justify-between bg-none py-3 pr-4 pl-8 no-underline focus:outline-none",
|
||||
{
|
||||
"pl-[26px] font-semibold":
|
||||
pageProps?.activeHeading?.title === heading.title,
|
||||
}
|
||||
)}
|
||||
onClick={() => {
|
||||
setHeading(heading);
|
||||
setOpen(false);
|
||||
}}
|
||||
>
|
||||
{heading?.title}
|
||||
</a>
|
||||
</NextLink>
|
||||
</li>
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
<ul
|
||||
className={cl({
|
||||
"animate-fadeIn block md:hidden lg:block": !heading || level === 0,
|
||||
hidden: level === 1,
|
||||
})}
|
||||
>
|
||||
{pageProps?.navigation.headings.map((heading: DsNavigationHeadingT) => (
|
||||
<li
|
||||
key={heading._key}
|
||||
className={cl(
|
||||
"focus-within:shadow-focus-inset hover:bg-surface-neutral-subtle first-of-type:rounded-t last-of-type:rounded-b",
|
||||
{
|
||||
"border-l-surface-inverted bg-surface-neutral-subtle border-l-[6px]":
|
||||
pageProps?.activeHeading?.title === heading.title,
|
||||
}
|
||||
)}
|
||||
>
|
||||
<button
|
||||
className={cl(
|
||||
"text-text-default flex min-h-[48px] w-full items-center justify-between bg-none py-3 pr-4 pl-8 no-underline focus:outline-none",
|
||||
{
|
||||
"pl-[26px] font-semibold":
|
||||
pageProps?.activeHeading?.title === heading.title,
|
||||
}
|
||||
)}
|
||||
onClick={() => {
|
||||
setHeading(heading);
|
||||
setLevel(1);
|
||||
}}
|
||||
>
|
||||
{heading?.title}
|
||||
<Next aria-hidden title={`åpne ${heading?.title} menyen`} />
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
);
|
||||
|
||||
const menu = (
|
||||
<>
|
||||
{heading && (
|
||||
<div
|
||||
className={cl("animate-fadeIn text-text-default", {
|
||||
hidden: level === 0,
|
||||
})}
|
||||
>
|
||||
<Heading
|
||||
onClick={() => setLevel(0)}
|
||||
as="button"
|
||||
size="xsmall"
|
||||
className="text-text-default hover:bg-surface-neutral-subtle focus-visible:shadow-focus-inset flex w-full items-center gap-2 rounded-t-[4px] border-none bg-none px-2 py-4 hover:underline focus:outline-none"
|
||||
>
|
||||
<Back aria-hidden aria-label="tilbake til hovedmeny" />
|
||||
Tilbake
|
||||
</Heading>
|
||||
<Detail
|
||||
size="small"
|
||||
className="heading--active bg-surface-subtle p-2 uppercase"
|
||||
>
|
||||
{heading.title}
|
||||
</Detail>
|
||||
<Menu
|
||||
inCategory={level === 0}
|
||||
heading={heading}
|
||||
onClick={() => setOpen(false)}
|
||||
className="animate-fadeIn mt-0 max-h-[512px] overflow-y-auto"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<Toggle
|
||||
isHamburger
|
||||
open={open}
|
||||
setOpen={setOpen}
|
||||
buttonContent={button}
|
||||
menu={
|
||||
<>
|
||||
{headingMenu}
|
||||
{menu}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default MobileNavigation;
|
||||
@@ -1,47 +0,0 @@
|
||||
import NextLink from "next/link";
|
||||
import React from "react";
|
||||
import { logNav } from "../../..";
|
||||
import AkselLogo from "../../../assets/AkselLogo";
|
||||
|
||||
const PortalNav = ({ title }: { title: string }) => {
|
||||
return (
|
||||
<div className="text-text-on-inverted xs:mr-8 z-[1050] mr-0 flex h-full justify-center">
|
||||
<NextLink href="/" passHref>
|
||||
<a
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"portalnavigasjon",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
)
|
||||
}
|
||||
className="navdsi-header__button min-w-header flex items-center justify-center border-none focus:outline-none focus-visible:shadow-[inset_0_0_0_1px_var(--a-surface-inverted),inset_0_0_0_3px_var(--a-border-focus-on-inverted)]"
|
||||
>
|
||||
<span className="sr-only">Tilbake til forsiden</span>
|
||||
<AkselLogo
|
||||
focusable={false}
|
||||
className="h-7 w-7 "
|
||||
aria-hidden
|
||||
aria-label="Tilbake til forsiden"
|
||||
/>
|
||||
</a>
|
||||
</NextLink>
|
||||
<NextLink href="/designsystem" passHref>
|
||||
<a
|
||||
onClick={(e) =>
|
||||
logNav(
|
||||
"portalnavigasjon",
|
||||
window.location.pathname,
|
||||
e.currentTarget.getAttribute("href")
|
||||
)
|
||||
}
|
||||
className="navdsi-header__button min-w-header flex items-center justify-center border-none focus:outline-none focus-visible:shadow-[inset_0_0_0_1px_var(--a-surface-inverted),inset_0_0_0_3px_var(--a-border-focus-on-inverted)]"
|
||||
>
|
||||
{title}
|
||||
</a>
|
||||
</NextLink>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PortalNav;
|
||||