Compare commits

...
Author SHA1 Message Date
github-actions[bot]andgithub-actions[bot] e5edad201a Version Packages (#1923)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-18 13:07:50 +02:00
Ken ecd6241e57 🎉 Oppdatert ikoner (#1921) 2023-04-18 12:40:22 +02:00
Ken 6ab0935a1f 🐛 Fikset kodevisning på Aksel 2023-04-17 12:19:01 +02:00
Ken ac0595135e 🐛 Fikset tsconfig aliasing 2023-04-17 09:29:45 +02:00
Ken 29928ef32e 🚚 Type-handling refactor
🏷️ Accordion-types

🏷️ Alert-types

🏷️ Code-snippet types

🏷️ Table-types

🏷️ UU-table typer

🏷️ token,bilde,innholdkort,relatertinnholdkort,examples,prop types

♻️ Cleanup types export/import

🏷️ Moved sanity-interfaceses

🏷️ Prop-generation types fix
2023-04-17 08:38:53 +02:00
Ken 9b4c7d972c ⬆️ Oppdatert storybook til v7 2023-04-13 13:54:38 +02:00
Ken f003fd38f7 ⬆️ Bumpet sanity 2023-04-13 13:17:54 +02:00
Ken 86cdc9cb70 ⬆️ 🐛 Oppdatert sanity, fikset axe-alerts 2023-04-13 13:11:30 +02:00
github-actions[bot]andgithub-actions[bot] dac31f6dda Version Packages (#1916)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-12 15:38:30 +02:00
Vegard Haugstvedt 85353d2c4f 🐛 Fixed TS conflicts and added onClick callback to CopyToClipboard (#1915)
* Add onclick prop to CopyToClipboard component, so it is possible to add external callbacks on clicks.

Requested to enable Amplitude-logging on clicks

* 🐛 Fixed TS conflicts and added onClick callback to CopyToClipboard
2023-04-12 15:33:13 +02:00
Vegard Haugstvedt cd927bdc46 🐛 Fixed conflicting inherited type for ExpandableRows (#1913)
'content' prop had a conflict with the html attribute content
2023-04-12 14:01:29 +02:00
github-actions[bot]andgithub-actions[bot] fcec29fd60 Version Packages (#1912)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-03 18:49:10 +02:00
Ken 2704279107 ✨ Oppdatert ikoner (#1909) 2023-04-03 16:08:52 +02:00
github-actions[bot]andgithub-actions[bot] 46cbb4ba87 Version Packages (#1908)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-31 13:41:44 +02:00
Ken 63fdacf0f8 ♻️ Refactor eventhandling i datepicker-hooks (#1907) 2023-03-31 13:26:53 +02:00
github-actions[bot]andgithub-actions[bot] b5c8a94378 Version Packages (#1906)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-31 12:47:17 +02:00
Ken 212194964c ✨ Bedre tokens-utvalg for button (#1905) 2023-03-31 11:58:30 +02:00
Ken d151cf4c07 🐛 Fikset bakgrunn på tips-modul 2023-03-30 15:30:14 +02:00
Ken 44ba7a3a79 ♻️ Bruker flere nye aksel-icons på nettside, refactor Tips-modul 2023-03-30 15:26:36 +02:00
Ken d94a636dc4 🐛 Fikset build-error på bakgrunn av ny sanity-dependency 2023-03-30 14:20:02 +02:00
github-actions[bot]andgithub-actions[bot] 36ae2e5005 Version Packages (#1903)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-30 10:37:10 +02:00
Ken ed8e284540 📝 changeset 2023-03-30 10:10:44 +02:00
Ken 262d59cf98 ✨ Nye ikoner 2023-03-30 10:09:39 +02:00
Ken 57705de77c 🎨 Sanity doc-creation tekster 2023-03-29 16:13:54 +02:00
Ken 4ec35a01ca ⬆️ Sanity v3.8.0 2023-03-29 14:09:59 +02:00
187 changed files with 2142 additions and 2953 deletions

No files matched your search

-17
View File
@@ -23,7 +23,6 @@ module.exports = {
addons: [
"@storybook/addon-a11y",
"@whitespace/storybook-addon-html",
"storybook-addon-next-router",
{
name: "@storybook/addon-storysource",
@@ -83,24 +82,8 @@ module.exports = {
"../aksel.nav.no/website/components/website-modules/utils/index.ts"
),
},
{
find: "@lib",
replacement: path.resolve(
__dirname,
"../aksel.nav.no/website/lib/index.ts"
),
},
],
},
});
},
};
/* "@/components": ["components/index.ts"],
"@/lib": ["lib/index.ts"],
"@/pages/*": ["pages/*"],
"@/sanity-block": ["components/SanityBlockContent.tsx"],
"@/utils": ["components/website-modules/utils/index.ts"],
"@/layout": ["components/layout/index.ts"],
"@/error-boundary": ["components/website-modules/ErrorBoundary.tsx"],
"@/sanity-client": ["lib/sanity/sanity.server"] */
-3
View File
@@ -24,9 +24,6 @@ export const parameters = {
},
],
},
nextRouter: {
Provider: RouterContext.Provider,
},
};
export const globalTypes = {
+27
View File
@@ -1,5 +1,32 @@
# @navikt/aksel-icons
## 2.8.13
### Patch Changes
- [#1921](https://github.com/navikt/aksel/pull/1921) [`ecd6241e5`](https://github.com/navikt/aksel/commit/ecd6241e5751519fbda800a5f41a613957dbf77c) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Oppdatert ikoner :tada:
## 2.8.12
## 2.8.11
### Patch Changes
- [#1909](https://github.com/navikt/aksel/pull/1909) [`270427910`](https://github.com/navikt/aksel/commit/2704279107a5fbf93048de37d014e78f6721438f) Thanks [@KenAJoh](https://github.com/KenAJoh)! - Oppdatert ikoner
## 2.8.10
## 2.8.9
## 2.8.8
### Patch Changes
- [`ed8e28454`](https://github.com/navikt/aksel/commit/ed8e284540a9e3a5be7d1d5e393f31db86962613) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :sparkles: Nye ikoner
- :tada: VideoSlash
- :tada: VideoSlashFill
## 2.8.7
## 2.8.6
+2 -2
View File
@@ -33,8 +33,8 @@ fs.writeFileSync(
sub_category: "Time",
keywords: string[];
variant: "stroke" | "fill";
date_added: Date;
date_modified: Date;
updated_at: Date;
created_at: Date;
}
declare const metadata: {
@@ -13,5 +13,5 @@ keywords:
- reload
- oppdater
variant: Stroke
updated_at: 08.03.2023
updated_at: 03.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -11,5 +11,5 @@ keywords:
- åpnet
- opened
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -8,5 +8,5 @@ keywords:
- back
- tilbake
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -9,5 +9,5 @@ keywords:
- frem
- fram
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -10,5 +10,5 @@ keywords:
- close
- lukke
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -9,5 +9,5 @@ keywords:
- sortering
- sorting
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -4,5 +4,5 @@ sub_category: Vehicles
keywords:
- sykkel
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -15,5 +15,5 @@ keywords:
- fullføring
- validering
variant: Stroke
updated_at: 08.03.2023
updated_at: 14.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -10,5 +10,5 @@ keywords:
- åpner
- mer
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -6,5 +6,5 @@ keywords:
- høyre
- side
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -10,5 +10,5 @@ keywords:
- lukk
- lukke
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -8,5 +8,5 @@ keywords:
- historikk
- visited
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -7,5 +7,5 @@ keywords:
- downloading
- last ned
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -14,5 +14,5 @@ keywords:
- pålogging
- adgang
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -7,5 +7,5 @@ keywords:
- data
- tabell
variant: Stroke
updated_at: 08.03.2023
updated_at: 14.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -13,5 +13,5 @@ keywords:
- fremdrift
- nedtelling
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
@@ -13,5 +13,5 @@ keywords:
- fremdrift
- nedtelling
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
+1 -3
View File
@@ -1,5 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 9.5H12V17.5" stroke="#262626" stroke-width="1.5" stroke-miterlimit="3.99933" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.75 6.5V6.5C11.75 6.63807 11.8619 6.75 12 6.75V6.75C12.1381 6.75 12.25 6.63807 12.25 6.5V6.5C12.25 6.36193 12.1381 6.25 12 6.25V6.25C11.8619 6.25 11.75 6.36193 11.75 6.5V6.5ZM11.75 6.5H12.01H12" stroke="#262626" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10 17.5H14" stroke="#262626" stroke-width="1.5" stroke-miterlimit="3.99933" stroke-linecap="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 6.5C11 5.94772 11.4477 5.5 12 5.5C12.5523 5.5 13 5.94772 13 6.5C13 7.05228 12.5523 7.5 12 7.5C11.4477 7.5 11 7.05228 11 6.5ZM9.25 9.5C9.25 9.08579 9.58579 8.75 10 8.75H12C12.4142 8.75 12.75 9.08579 12.75 9.5V16.75H14C14.4142 16.75 14.75 17.0858 14.75 17.5C14.75 17.9142 14.4142 18.25 14 18.25H12H10C9.58579 18.25 9.25 17.9142 9.25 17.5C9.25 17.0858 9.58579 16.75 10 16.75H11.25V10.25H10C9.58579 10.25 9.25 9.91421 9.25 9.5Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 598 B

+1 -1
View File
@@ -15,5 +15,5 @@ keywords:
- beskrivelse
- forklaring
variant: Stroke
updated_at: 08.03.2023
updated_at: 31.03.2023
created_at: 07.03.2023
@@ -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="M4 2.75C3.58579 2.75 3.25 3.08579 3.25 3.5V19.5C3.25 19.9142 3.58579 20.25 4 20.25H20C20.4142 20.25 20.75 19.9142 20.75 19.5V3.5C20.75 3.08579 20.4142 2.75 20 2.75H4ZM4.75 18.75V4.25H19.25V18.75H4.75ZM12 6.5C11.4477 6.5 11 6.94772 11 7.5C11 8.05228 11.4477 8.5 12 8.5C12.5523 8.5 13 8.05228 13 7.5C13 6.94772 12.5523 6.5 12 6.5ZM10.5 9.75C10.0858 9.75 9.75 10.0858 9.75 10.5C9.75 10.9142 10.0858 11.25 10.5 11.25H11.25V15.25H10.5C10.0858 15.25 9.75 15.5858 9.75 16C9.75 16.4142 10.0858 16.75 10.5 16.75H12H13.5C13.9142 16.75 14.25 16.4142 14.25 16C14.25 15.5858 13.9142 15.25 13.5 15.25H12.75V10.5C12.75 10.0858 12.4142 9.75 12 9.75H10.5Z" fill="#262626"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.25C3.58579 3.25 3.25 3.58579 3.25 4V20C3.25 20.4142 3.58579 20.75 4 20.75H20C20.4142 20.75 20.75 20.4142 20.75 20V4C20.75 3.58579 20.4142 3.25 20 3.25H4ZM4.75 19.25V4.75H19.25V19.25H4.75ZM12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7ZM10.5 10.25C10.0858 10.25 9.75 10.5858 9.75 11C9.75 11.4142 10.0858 11.75 10.5 11.75H11.25V15.75H10.5C10.0858 15.75 9.75 16.0858 9.75 16.5C9.75 16.9142 10.0858 17.25 10.5 17.25H12H13.5C13.9142 17.25 14.25 16.9142 14.25 16.5C14.25 16.0858 13.9142 15.75 13.5 15.75H12.75V11C12.75 10.5858 12.4142 10.25 12 10.25H10.5Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 787 B

@@ -15,5 +15,5 @@ keywords:
- beskrivelse
- forklaring
variant: Stroke
updated_at: 08.03.2023
updated_at: 03.04.2023
created_at: 07.03.2023
@@ -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="M3.25 3.5C3.25 3.08579 3.58579 2.75 4 2.75H20C20.4142 2.75 20.75 3.08579 20.75 3.5V19.5C20.75 19.9142 20.4142 20.25 20 20.25H4C3.58579 20.25 3.25 19.9142 3.25 19.5V3.5ZM11 7.5C11 6.94772 11.4477 6.5 12 6.5C12.5523 6.5 13 6.94772 13 7.5C13 8.05228 12.5523 8.5 12 8.5C11.4477 8.5 11 8.05228 11 7.5ZM9.75 10.5C9.75 10.0858 10.0858 9.75 10.5 9.75H12C12.4142 9.75 12.75 10.0858 12.75 10.5V15.25H13.5C13.9142 15.25 14.25 15.5858 14.25 16C14.25 16.4142 13.9142 16.75 13.5 16.75H12H10.5C10.0858 16.75 9.75 16.4142 9.75 16C9.75 15.5858 10.0858 15.25 10.5 15.25H11.25V11.25H10.5C10.0858 11.25 9.75 10.9142 9.75 10.5Z" fill="#262626"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.25 4C3.25 3.58579 3.58579 3.25 4 3.25H20C20.4142 3.25 20.75 3.58579 20.75 4V20C20.75 20.4142 20.4142 20.75 20 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20V4ZM11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8ZM9.75 11C9.75 10.5858 10.0858 10.25 10.5 10.25H12C12.4142 10.25 12.75 10.5858 12.75 11V15.75H13.5C13.9142 15.75 14.25 16.0858 14.25 16.5C14.25 16.9142 13.9142 17.25 13.5 17.25H12H10.5C10.0858 17.25 9.75 16.9142 9.75 16.5C9.75 16.0858 10.0858 15.75 10.5 15.75H11.25V11.75H10.5C10.0858 11.75 9.75 11.4142 9.75 11Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 750 B

@@ -15,5 +15,5 @@ keywords:
- beskrivelse
- forklaring
variant: Fill
updated_at: 08.03.2023
updated_at: 03.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -13,5 +13,5 @@ keywords:
- oversettelse
- bytt språk
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -15,5 +15,5 @@ keywords:
- avslutt
- avslutt
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -6,5 +6,5 @@ keywords:
- chain
- kobling
variant: Stroke
updated_at: 08.03.2023
updated_at: 11.04.2023
created_at: 07.03.2023
@@ -12,5 +12,5 @@ keywords:
- nedtrekksvalg
- ellipse
variant: Stroke
updated_at: 08.03.2023
updated_at: 17.04.2023
created_at: 07.03.2023
@@ -12,5 +12,5 @@ keywords:
- nedtrekksvalg
- ellipse
variant: Stroke
updated_at: 08.03.2023
updated_at: 12.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -6,5 +6,5 @@ keywords:
- meny
- hamburger
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -8,5 +8,5 @@ keywords:
- replace
- new version
variant: Stroke
updated_at: 08.03.2023
updated_at: 17.04.2023
created_at: 07.03.2023
+2 -1
View File
@@ -6,6 +6,7 @@ keywords:
- nyheter
- tidsskrift
- presse
- avis
variant: Stroke
updated_at: 08.03.2023
updated_at: 18.04.2023
created_at: 07.03.2023
+2 -1
View File
@@ -6,6 +6,7 @@ keywords:
- nyheter
- tidsskrift
- presse
- avis
variant: Fill
updated_at: 08.03.2023
updated_at: 18.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -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="M11.6248 2.35048C11.8568 2.21651 12.1427 2.21651 12.3748 2.35048L20.1578 6.84397C20.273 6.90772 20.3729 7.00264 20.4435 7.125C20.5142 7.24739 20.5465 7.38143 20.544 7.51313V16.5C20.544 16.7679 20.4011 17.0155 20.169 17.1495L12.3903 21.6405C12.2766 21.71 12.143 21.75 12 21.75H12C11.9837 21.75 11.9675 21.7495 11.9513 21.7484C11.8311 21.7407 11.7186 21.7047 11.6205 21.647L3.83057 17.1495C3.59852 17.0155 3.45557 16.7679 3.45557 16.5V7.513C3.45316 7.38134 3.48541 7.24735 3.55605 7.125C3.62669 7.00265 3.7266 6.90773 3.84183 6.84398L11.6248 2.35048ZM4.95557 8.79904V16.067L11.25 19.7011L11.25 12.4331L4.95557 8.79904ZM12.75 12.4329V19.7008L19.044 16.067V8.79904L12.75 12.4329ZM18.294 7.5L11.9998 11.134L5.70557 7.5L11.9998 3.86603L18.294 7.5Z" fill="#262626"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.438 7.11571C20.3678 6.99792 20.2701 6.90625 20.1578 6.84415L12.3872 2.35776C12.3621 2.34263 12.3361 2.32904 12.3095 2.31701C12.2098 2.27163 12.1042 2.24991 11.9999 2.25C11.8955 2.24989 11.7899 2.27161 11.6901 2.31701C11.6635 2.32904 11.6375 2.34263 11.6124 2.35775L3.84183 6.84411C3.7266 6.90785 3.62669 7.00277 3.55605 7.12513C3.48541 7.24748 3.45316 7.38146 3.45557 7.51312V16.5001C3.45557 16.7681 3.59852 17.0157 3.83057 17.1496L11.6124 21.6425C11.6307 21.6535 11.6494 21.6637 11.6685 21.6731C11.6958 21.6866 11.7242 21.6985 11.7533 21.7086C11.8339 21.7368 11.9172 21.7503 11.9998 21.7503C12.0536 21.7503 12.1078 21.7445 12.1613 21.7327C12.2435 21.7147 12.3206 21.6832 12.3903 21.6407L20.169 17.1496C20.4011 17.0157 20.544 16.7681 20.544 16.5001V7.51305C20.5464 7.38481 20.5158 7.25437 20.4489 7.13462C20.4454 7.12826 20.4418 7.12196 20.438 7.11571ZM18.294 7.50013L11.9998 3.86615L5.70557 7.50012L11.9998 11.1341L18.294 7.50013ZM4.95557 8.79916V16.0671L11.25 19.7012L11.25 12.4332L4.95557 8.79916ZM12.75 12.433L19.044 8.79917V16.0671L12.75 19.701V12.433Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 912 B

After

Width:  |  Height:  |  Size: 1.2 KiB

+1 -1
View File
@@ -14,5 +14,5 @@ keywords:
- programmering
- distribusjon
variant: Stroke
updated_at: 08.03.2023
updated_at: 23.03.2023
created_at: 07.03.2023
+1 -1
View File
@@ -14,5 +14,5 @@ keywords:
- programmering
- distribusjon
variant: Fill
updated_at: 08.03.2023
updated_at: 23.03.2023
created_at: 07.03.2023
+2 -1
View File
@@ -5,6 +5,7 @@ keywords:
- presentasjon
- presentere
- present
- whiteboard
variant: Stroke
updated_at: 08.03.2023
updated_at: 18.04.2023
created_at: 07.03.2023
@@ -5,6 +5,7 @@ keywords:
- presentasjon
- presentere
- present
- whiteboard
variant: Fill
updated_at: 08.03.2023
updated_at: 18.04.2023
created_at: 07.03.2023
+1 -2
View File
@@ -1,4 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.5 9.5C9.5 8 10.5 7 12 7C13.5 7 14.5 8 14.5 9.5C14.5 11 12 12 12 13.5V14" stroke="#262626" stroke-width="1.5" stroke-miterlimit="3.99933" stroke-linecap="round"/>
<path d="M11.75 16.5V16.5C11.75 16.6381 11.8619 16.75 12 16.75V16.75C12.1381 16.75 12.25 16.6381 12.25 16.5V16.5C12.25 16.3619 12.1381 16.25 12 16.25V16.25C11.8619 16.25 11.75 16.3619 11.75 16.5V16.5ZM11.75 16.5H12.01H12" stroke="#262626" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.25 9.5C10.25 8.92044 10.4399 8.49575 10.7178 8.21783C10.9957 7.93991 11.4204 7.75 12 7.75C12.5796 7.75 13.0043 7.93991 13.2822 8.21783C13.5601 8.49575 13.75 8.92044 13.75 9.5C13.75 9.65777 13.6859 9.84934 13.4991 10.1109C13.3076 10.379 13.0426 10.6467 12.7197 10.9697L12.6985 10.9909C12.4009 11.2884 12.0511 11.6381 11.7803 12.0172C11.4984 12.4118 11.25 12.9078 11.25 13.5V14C11.25 14.4142 11.5858 14.75 12 14.75C12.4142 14.75 12.75 14.4142 12.75 14V13.5C12.75 13.3422 12.8141 13.1507 13.0009 12.8891C13.1924 12.621 13.4574 12.3533 13.7803 12.0303L13.8015 12.0091C14.0991 11.7116 14.4489 11.3619 14.7197 10.9828C15.0016 10.5882 15.25 10.0922 15.25 9.5C15.25 8.57956 14.9399 7.75425 14.3428 7.15717C13.7457 6.56009 12.9204 6.25 12 6.25C11.0796 6.25 10.2543 6.56009 9.65717 7.15717C9.06009 7.75425 8.75 8.57956 8.75 9.5C8.75 9.91421 9.08579 10.25 9.5 10.25C9.91421 10.25 10.25 9.91421 10.25 9.5ZM12 15.5C11.4477 15.5 11 15.9477 11 16.5C11 17.0523 11.4477 17.5 12 17.5C12.5523 17.5 13 17.0523 13 16.5C13 15.9477 12.5523 15.5 12 15.5Z" fill="#262626"/>
</svg>

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 1.2 KiB

+1 -1
View File
@@ -13,5 +13,5 @@ keywords:
- veiledning
- spørsmålstegn
variant: Stroke
updated_at: 08.03.2023
updated_at: 31.03.2023
created_at: 07.03.2023
+1 -1
View File
@@ -8,5 +8,5 @@ keywords:
- loading
- laster
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -8,5 +8,5 @@ keywords:
- loading
- laster
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -12,5 +12,5 @@ keywords:
- diagram
- analyse
variant: Stroke
updated_at: 08.03.2023
updated_at: 17.04.2023
created_at: 07.03.2023
+3
View File
@@ -0,0 +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="M15 5.25H7.875C7.46079 5.25 7.125 5.58579 7.125 6C7.125 6.41421 7.46079 6.75 7.875 6.75H15C15.1381 6.75 15.25 6.86193 15.25 7V9.6V14.4C15.25 14.5901 15.3207 14.7637 15.4373 14.8959C15.4739 14.9375 15.5152 14.975 15.5605 15.0078C15.6286 15.0571 15.7052 15.0952 15.7877 15.1195L20.7714 16.7143C20.9995 16.7873 21.2488 16.747 21.4422 16.6058C21.6356 16.4646 21.75 16.2395 21.75 16V8C21.75 7.76051 21.6356 7.53542 21.4422 7.39422C21.2488 7.25302 20.9995 7.21269 20.7714 7.28568L16.75 8.57254V7C16.75 6.0335 15.9665 5.25 15 5.25ZM20.25 14.9725L16.75 13.8525V10.1475L20.25 9.02746V14.9725ZM3.75 10.5C3.75 10.0858 3.41421 9.75 3 9.75C2.58579 9.75 2.25 10.0858 2.25 10.5V17C2.25 17.9665 3.0335 18.75 4 18.75H11.125C11.5392 18.75 11.875 18.4142 11.875 18C11.875 17.5858 11.5392 17.25 11.125 17.25H4C3.86193 17.25 3.75 17.1381 3.75 17V10.5ZM4.03033 5.46967C3.73744 5.17678 3.26256 5.17678 2.96967 5.46967C2.67678 5.76256 2.67678 6.23744 2.96967 6.53033L14.9697 18.5303C15.2626 18.8232 15.7374 18.8232 16.0303 18.5303C16.3232 18.2374 16.3232 17.7626 16.0303 17.4697L4.03033 5.46967Z" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+26
View File
@@ -0,0 +1,26 @@
name: VideoSlash
category: Media
sub_category: Media
keywords:
- record
- film
- video
- camera
- no camera
- no video
- no filming
- no recording
- opptak
- ta opp
- filme
- video
- kamera
- ingen filming
- ingen video
- ingen kamera
- ingen opptak
- unavailable
- utilgjengelig
variant: Stroke
updated_at: 31.03.2023
created_at: 30.03.2023
@@ -0,0 +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.67678 8.35876C2.51929 8.20127 2.25 8.31281 2.25 8.53553V17C2.25 17.9665 3.0335 18.75 4 18.75H12.4645C12.6872 18.75 12.7987 18.4807 12.6412 18.3232L2.67678 8.35876ZM16.3232 15.6412C16.4807 15.7987 16.75 15.6872 16.75 15.4645V7C16.75 6.0335 15.9665 5.25 15 5.25H6.53553C6.31281 5.25 6.20127 5.51929 6.35876 5.67678L16.3232 15.6412ZM18.25 15.725C18.25 15.8337 18.3203 15.93 18.4238 15.9631L20.7714 16.7143C20.9995 16.7873 21.2488 16.747 21.4422 16.6058C21.6356 16.4646 21.75 16.2395 21.75 16V8.00001C21.75 7.76052 21.6356 7.53543 21.4422 7.39423C21.2488 7.25303 20.9995 7.2127 20.7714 7.28569L18.4238 8.03692C18.3203 8.07006 18.25 8.16631 18.25 8.27503V15.725ZM4.03033 5.46967C3.73744 5.17678 3.26256 5.17678 2.96967 5.46967C2.67678 5.76256 2.67678 6.23744 2.96967 6.53033L14.9697 18.5303C15.2626 18.8232 15.7374 18.8232 16.0303 18.5303C16.3232 18.2374 16.3232 17.7626 16.0303 17.4697L4.03033 5.46967Z" fill="#262626"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1,26 @@
name: VideoSlashFill
category: Media
sub_category: Media
keywords:
- record
- film
- video
- camera
- no camera
- no video
- no filming
- no recording
- opptak
- ta opp
- filme
- video
- kamera
- ingen filming
- ingen video
- ingen kamera
- ingen opptak
- unavailable
- utilgjengelig
variant: Fill
updated_at: 31.03.2023
created_at: 30.03.2023
+1 -1
View File
@@ -13,5 +13,5 @@ keywords:
- oksygen
- blodtrykk
variant: Stroke
updated_at: 08.03.2023
updated_at: 14.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -15,5 +15,5 @@ keywords:
- avvis
- avslå
variant: Stroke
updated_at: 08.03.2023
updated_at: 13.04.2023
created_at: 07.03.2023
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/aksel-icons",
"version": "2.8.7",
"version": "2.8.13",
"author": "Aksel | NAV",
"homepage": "https://aksel.nav.no/ikoner",
"repository": {
+2 -1
View File
@@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist/react/cjs",
"module": "commonjs"
"module": "commonjs",
"skipLibCheck": true
},
"exclude": ["./util", "./__tests__", "**/*.stories.*"],
"include": ["./src"]
+12
View File
@@ -1,5 +1,17 @@
# @navikt/ds-codemod
## 2.8.13
## 2.8.12
## 2.8.11
## 2.8.10
## 2.8.9
## 2.8.8
## 2.8.7
## 2.8.6
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-codemod",
"version": "2.8.7",
"version": "2.8.13",
"description": "Aksel codemods for NAVs designsystem",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
+2 -2
View File
@@ -39,8 +39,8 @@
"build-pict": "svgr --silent --index-template index-template.js --out-dir src/pictograms pictograms"
},
"dependencies": {
"@navikt/ds-icons": "^2.8.7",
"@navikt/ds-react": "^2.8.7",
"@navikt/ds-icons": "^2.8.13",
"@navikt/ds-react": "^2.8.13",
"clsx": "^1.1.1"
},
"devDependencies": {
+16
View File
@@ -1,5 +1,21 @@
# @navikt/ds-css
## 2.8.13
## 2.8.12
## 2.8.11
## 2.8.10
## 2.8.9
### Patch Changes
- [#1905](https://github.com/navikt/aksel/pull/1905) [`212194964`](https://github.com/navikt/aksel/commit/212194964c4dd576e1ffc031316dff8cbe5016a2) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :sparkles: Padding/border-radius tokens for button.css
## 2.8.8
## 2.8.7
### Patch Changes
+19 -7
View File
@@ -16,38 +16,50 @@
}
.navds-button {
--__ac-button-padding: var(--a-spacing-3) var(--a-spacing-5);
display: inline-flex;
cursor: pointer;
margin: 0;
text-decoration: none;
border: none;
background: none;
border-radius: var(--a-border-radius-medium);
padding: var(--a-spacing-3) var(--a-spacing-5);
border-radius: var(--ac-button-border-radius, var(--a-border-radius-medium));
padding: var(--ac-button-padding, var(--__ac-button-padding));
align-items: center;
justify-content: center;
gap: var(--a-spacing-2);
}
.navds-button--small {
padding: 0.375rem var(--a-spacing-3);
--__ac-button-padding: 0.375rem var(--a-spacing-3);
padding: var(--ac-button-padding-small, var(--__ac-button-padding));
}
.navds-button--xsmall {
padding: var(--a-spacing-05) var(--a-spacing-2);
--__ac-button-padding: var(--a-spacing-05) var(--a-spacing-2);
padding: var(--ac-button-padding-xsmall, var(--__ac-button-padding));
gap: var(--a-spacing-1);
}
.navds-button--icon-only {
padding: var(--a-spacing-3);
--__ac-button-padding: var(--a-spacing-3);
padding: var(--ac-button-padding-icon-only, var(--__ac-button-padding));
}
.navds-button--small.navds-button--icon-only {
padding: 0.375rem;
--__ac-button-padding: 0.375rem;
padding: var(--ac-button-padding-icon-only-small, var(--__ac-button-padding));
}
.navds-button--xsmall.navds-button--icon-only {
padding: var(--a-spacing-1);
--__ac-button-padding: var(--a-spacing-1);
padding: var(--ac-button-padding-icon-only-xsmall, var(--__ac-button-padding));
}
.navds-button:focus {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css",
"version": "2.8.7",
"version": "2.8.13",
"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.8.7",
"@navikt/ds-tokens": "^2.8.13",
"normalize.css": "^8.0.1",
"postcss": "^8.4.0",
"postcss-cli": "^9.0.0",
+7
View File
@@ -27,6 +27,13 @@
"--ac-accordion-content-border-open": "--a-border-default"
},
"button": {
"--ac-button-border-radius": "--a-border-radius-medium",
"--ac-button-padding": "var(--a-spacing-3) var(--a-spacing-5)",
"--ac-button-padding-small": "0.375rem var(--a-spacing-3)",
"--ac-button-padding-xsmall": "var(--a-spacing-05) var(--a-spacing-2)",
"--ac-button-padding-icon-only": "var(--a-spacing-3)",
"--ac-button-padding-icon-only-small": "0.375rem",
"--ac-button-padding-icon-only-xsmall": "var(--a-spacing-1)",
"--ac-button-primary-bg": "--a-surface-action",
"--ac-button-primary-text": "--a-text-on-action",
"--ac-button-primary-hover-bg": "--a-surface-action-hover",
+50
View File
@@ -1,5 +1,55 @@
# @navikt/ds-react
## 2.8.13
### Patch Changes
- Updated dependencies [[`ecd6241e5`](https://github.com/navikt/aksel/commit/ecd6241e5751519fbda800a5f41a613957dbf77c)]:
- @navikt/aksel-icons@2.8.13
- @navikt/ds-icons@2.8.13
## 2.8.12
### Patch Changes
- Updated dependencies []:
- @navikt/aksel-icons@2.8.12
- @navikt/ds-icons@2.8.12
## 2.8.11
### Patch Changes
- Updated dependencies [[`270427910`](https://github.com/navikt/aksel/commit/2704279107a5fbf93048de37d014e78f6721438f)]:
- @navikt/aksel-icons@2.8.11
- @navikt/ds-icons@2.8.11
## 2.8.10
### Patch Changes
- [#1907](https://github.com/navikt/aksel/pull/1907) [`63fdacf0f`](https://github.com/navikt/aksel/commit/63fdacf0f8fa09593c64b35b49381d6c8a1befd1) Thanks [@KenAJoh](https://github.com/KenAJoh)! - :recycle: Refactor event-handling i datepicker-hooks
- Updated dependencies []:
- @navikt/aksel-icons@2.8.10
- @navikt/ds-icons@2.8.10
## 2.8.9
### Patch Changes
- Updated dependencies []:
- @navikt/aksel-icons@2.8.9
- @navikt/ds-icons@2.8.9
## 2.8.8
### Patch Changes
- Updated dependencies [[`ed8e28454`](https://github.com/navikt/aksel/commit/ed8e284540a9e3a5be7d1d5e393f31db86962613)]:
- @navikt/aksel-icons@2.8.8
- @navikt/ds-icons@2.8.8
## 2.8.7
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react",
"version": "2.8.7",
"version": "2.8.13",
"description": "Aksel react-components for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -37,8 +37,8 @@
},
"dependencies": {
"@floating-ui/react": "0.17.0",
"@navikt/aksel-icons": "^2.8.7",
"@navikt/ds-icons": "^2.8.7",
"@navikt/aksel-icons": "^2.8.13",
"@navikt/ds-icons": "^2.8.13",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^1.2.1",
+1 -1
View File
@@ -3,7 +3,7 @@ import cl from "clsx";
import React, { forwardRef, InputHTMLAttributes } from "react";
import { BodyShort, Button, ErrorMessage, Label, omit } from "..";
import { FormFieldProps, useFormField } from "../form/useFormField";
import { useDateInputContext } from "./hooks";
import { useDateInputContext } from "./context";
export interface DateInputProps
extends FormFieldProps,
@@ -0,0 +1,5 @@
export { useDateInputContext, DateContext } from "./useDateInputContext";
export {
useSharedMonthContext,
SharedMonthProvider,
} from "./useSharedMonthContext";
@@ -13,14 +13,14 @@ import {
} from "react-day-picker";
import { omit, Popover, useId } from "../..";
import { DateInputType, DatePickerInput } from "../DateInput";
import { DateContext } from "../hooks";
import { DateContext } from "../context";
import { getLocaleFromString, labels } from "../utils";
import { Caption, DropdownCaption } from "./caption";
import DatePickerStandalone, {
DatePickerStandaloneType,
} from "./DatePickerStandalone";
import { DayButton } from "./DayButton";
import { Head } from "./Head";
import { TableHead } from "./TableHead";
export type ConditionalModeProps =
| {
@@ -221,7 +221,7 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
components={{
Caption: dropdownCaption ? DropdownCaption : Caption,
Day: DayButton,
Head: Head,
Head: TableHead,
}}
className={cl("navds-date", className)}
classNames={{
@@ -13,7 +13,7 @@ import { omit } from "../..";
import { getLocaleFromString, labels } from "../utils";
import { Caption, DropdownCaption } from "./caption";
import { ConditionalModeProps, DatePickerDefaultProps } from "./DatePicker";
import { Head } from "./Head";
import { TableHead } from "./TableHead";
interface DatePickerStandaloneDefaultProps
extends Omit<
@@ -100,7 +100,7 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
selected={selected ?? selectedDates}
components={{
Caption: dropdownCaption ? DropdownCaption : Caption,
Head: Head,
Head: TableHead,
}}
className="navds-date"
classNames={{ vhidden: "navds-sr-only" }}
@@ -2,7 +2,7 @@ import React from "react";
import { HeadRow, useDayPicker } from "react-day-picker";
/** Render the table head. */
export function Head(): JSX.Element {
export function TableHead(): JSX.Element {
const { classNames, styles, components } = useDayPicker();
const HeadRowComponent = components?.HeadRow ?? HeadRow;
return (
@@ -12,27 +12,6 @@ const disabledDays = [
export default {
title: "ds-react/Datepicker",
component: DatePicker,
argTypes: {
size: {
control: {
type: "radio",
options: ["medium", "small"],
},
},
locale: {
control: {
type: "radio",
options: ["nb", "nn", "en"],
},
},
mode: {
defaultValue: "single",
control: {
type: "radio",
options: ["single", "multiple", "range"],
},
},
},
};
export const Default = {
@@ -123,6 +102,27 @@ export const Default = {
inputfield: true,
standalone: false,
openOnFocus: true,
mode: "single",
},
argTypes: {
size: {
control: {
type: "radio",
options: ["medium", "small"],
},
},
locale: {
control: {
type: "radio",
options: ["nb", "nn", "en"],
},
},
mode: {
control: {
type: "radio",
options: ["single", "multiple", "range"],
},
},
},
};
@@ -4,8 +4,3 @@ export { useRangeDatepicker as UNSAFE_useRangeDatepicker } from "./useRangeDatep
export type { RangeValidationT } from "./useRangeDatepicker";
export { useMonthpicker as UNSAFE_useMonthpicker } from "./useMonthPicker";
export type { MonthValidationT } from "./useMonthPicker";
export { useDateInputContext, DateContext } from "./useDateInputContext";
export {
useSharedMonthContext,
SharedMonthProvider,
} from "./useSharedMonthContext";
@@ -1,6 +1,6 @@
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
import isWeekend from "date-fns/isWeekend";
import React, { useCallback, useEffect, useRef, useState } from "react";
import React, { useRef, useState } from "react";
import { DayClickEventHandler, isMatch } from "react-day-picker";
import { DateInputProps } from "../DateInput";
import { DatePickerProps } from "../datepicker/DatePicker";
@@ -10,6 +10,8 @@ import {
isValidDate,
parseDate,
} from "../utils";
import { useEscape } from "./useEscape";
import { useOutsideClickHandler } from "./useOutsideClickHandler";
export interface UseDatepickerOptions
extends Pick<
@@ -134,7 +136,7 @@ export const useDatepicker = (
const locale = getLocaleFromString(_locale);
const inputRef = useRef<HTMLInputElement>(null);
const daypickerRef = useRef<HTMLDivElement>(null);
const [daypickerRef, setDaypickerRef] = useState<HTMLDivElement>();
const [defaultSelected, setDefaultSelected] = useState(_defaultSelected);
@@ -148,45 +150,21 @@ export const useDatepicker = (
: "";
const [inputValue, setInputValue] = useState(defaultInputValue);
useOutsideClickHandler(open, setOpen, [
daypickerRef,
inputRef.current,
inputRef.current?.nextSibling,
]);
useEscape(open, setOpen, inputRef);
const updateDate = (date?: Date) => {
onDateChange?.(date);
setSelectedDay(date);
};
const updateValidation = (val: Partial<DateValidationT> = {}) => {
const msg = getValidationMessage(val);
onValidate?.(msg);
};
const handleFocusIn = useCallback(
(e) => {
/* Workaround for shadow-dom users (open) */
const composed = e.composedPath?.()?.[0];
if (!e?.target || !e?.target?.nodeType || !composed) {
return;
}
![
daypickerRef.current,
inputRef.current,
inputRef.current?.nextSibling,
].some(
(element) => element?.contains(e.target) || element?.contains(composed)
) &&
open &&
setOpen(false);
},
[open]
);
useEffect(() => {
window.addEventListener("focusin", handleFocusIn);
window.addEventListener("pointerdown", handleFocusIn);
return () => {
window?.removeEventListener?.("focusin", handleFocusIn);
window?.removeEventListener?.("pointerdown", handleFocusIn);
};
}, [handleFocusIn]);
const updateValidation = (val: Partial<DateValidationT> = {}) =>
onValidate?.(getValidationMessage(val));
const reset = () => {
updateDate(defaultSelected);
@@ -300,24 +278,6 @@ export const useDatepicker = (
setMonth(defaultMonth ?? day);
};
const handleClose = useCallback(() => {
setOpen(false);
inputRef.current && inputRef.current.focus();
}, []);
const escape = useCallback(
(e) => open && e.key === "Escape" && handleClose(),
[handleClose, open]
);
useEffect(() => {
window.addEventListener("keydown", escape, false);
return () => {
window.removeEventListener("keydown", escape, false);
};
}, [escape]);
const datepickerProps = {
month,
onMonthChange: (month) => setMonth(month),
@@ -331,7 +291,7 @@ export const useDatepicker = (
onOpenToggle: () => setOpen((x) => !x),
disabled,
disableWeekends,
ref: daypickerRef,
ref: setDaypickerRef,
};
const inputProps = {
@@ -0,0 +1,25 @@
import React, { useCallback, useEffect } from "react";
export const useEscape = (
open: boolean,
setOpen: React.Dispatch<React.SetStateAction<boolean>>,
focusRef: any
) => {
const handleClose = useCallback(() => {
setOpen(false);
focusRef?.current && focusRef.current.focus();
}, [focusRef, setOpen]);
const escape = useCallback(
(e) => open && e.key === "Escape" && handleClose(),
[handleClose, open]
);
useEffect(() => {
window.addEventListener("keydown", escape, false);
return () => {
window.removeEventListener("keydown", escape, false);
};
}, [escape]);
};
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useRef, useState } from "react";
import React, { useRef, useState } from "react";
import { DateInputProps } from "../DateInput";
import { MonthPickerProps } from "../monthpicker/MonthPicker";
import {
@@ -8,6 +8,8 @@ import {
isValidDate,
parseDate,
} from "../utils";
import { useEscape } from "./useEscape";
import { useOutsideClickHandler } from "./useOutsideClickHandler";
export interface UseMonthPickerOptions
extends Pick<
@@ -118,7 +120,7 @@ export const useMonthpicker = (
const locale = getLocaleFromString(_locale);
const inputRef = useRef<HTMLInputElement>(null);
const monthpickerRef = useRef<HTMLDivElement>(null);
const [monthpickerRef, setMonthpickerRef] = useState<HTMLDivElement>();
// Initialize states
const [year, setYear] = useState(defaultSelected ?? defaultYear ?? today);
@@ -131,44 +133,21 @@ export const useMonthpicker = (
const [inputValue, setInputValue] = useState(defaultInputValue);
useOutsideClickHandler(open, setOpen, [
monthpickerRef,
inputRef.current,
inputRef.current?.nextSibling,
]);
useEscape(open, setOpen, inputRef);
const updateMonth = (date?: Date) => {
onMonthChange?.(date);
setSelectedMonth(date);
};
const updateValidation = (val: Partial<MonthValidationT> = {}) => {
const msg = getValidationMessage(val);
onValidate?.(msg);
};
const handleFocusIn = useCallback(
(e) => {
/* Workaround for shadow-dom users (open) */
const composed = e.composedPath?.()?.[0];
if (!e?.target || !e?.target?.nodeType || !composed) {
return;
}
![
monthpickerRef.current,
inputRef.current,
inputRef.current?.nextSibling,
].some(
(element) => element?.contains(e.target) || element?.contains(composed)
) &&
open &&
setOpen(false);
},
[open]
);
useEffect(() => {
window.addEventListener("focusin", handleFocusIn);
window.addEventListener("pointerdown", handleFocusIn);
return () => {
window?.removeEventListener?.("focusin", handleFocusIn);
window?.removeEventListener?.("pointerdown", handleFocusIn);
};
}, [handleFocusIn]);
const updateValidation = (val: Partial<MonthValidationT> = {}) =>
onValidate?.(getValidationMessage(val));
const reset = () => {
updateMonth(defaultSelected);
@@ -294,24 +273,6 @@ export const useMonthpicker = (
setYear(month);
};
const handleClose = useCallback(() => {
setOpen(false);
inputRef.current && inputRef.current.focus();
}, []);
const escape = useCallback(
(e) => open && e.key === "Escape" && handleClose(),
[handleClose, open]
);
useEffect(() => {
window.addEventListener("keydown", escape, false);
return () => {
window.removeEventListener("keydown", escape, false);
};
}, [escape]);
const monthpickerProps = {
year,
onYearChange: (y?: Date) => setYear(y ?? today),
@@ -323,7 +284,7 @@ export const useMonthpicker = (
open,
onOpenToggle: () => setOpen((x) => !x),
disabled,
ref: monthpickerRef,
ref: setMonthpickerRef,
};
const inputProps = {
@@ -0,0 +1,34 @@
import React, { useCallback, useEffect } from "react";
export const useOutsideClickHandler = (
open: boolean,
setOpen: React.Dispatch<React.SetStateAction<boolean>>,
refs: Array<any>
) => {
const handleFocusIn = useCallback(
(e) => {
const composed = e.composedPath?.()?.[0];
if (!e?.target || !e?.target?.nodeType || !composed) {
return;
}
if (
!refs.some(
(element) =>
element?.contains(e.target) || element?.contains(composed)
)
) {
open && setOpen(false);
}
},
[open, refs, setOpen]
);
useEffect(() => {
window.addEventListener("focusin", handleFocusIn);
window.addEventListener("pointerdown", handleFocusIn);
return () => {
window?.removeEventListener?.("focusin", handleFocusIn);
window?.removeEventListener?.("pointerdown", handleFocusIn);
};
}, [handleFocusIn]);
};
@@ -1,7 +1,7 @@
import differenceInCalendarDays from "date-fns/differenceInCalendarDays";
import isBefore from "date-fns/isBefore";
import isWeekend from "date-fns/isWeekend";
import React, { useCallback, useEffect, useRef, useState } from "react";
import React, { useRef, useState } from "react";
import { DateRange, isMatch } from "react-day-picker";
import { DateInputProps } from "../DateInput";
import { DatePickerProps } from "../datepicker/DatePicker";
@@ -12,6 +12,8 @@ import {
parseDate,
} from "../utils";
import { DateValidationT, UseDatepickerOptions } from "./useDatepicker";
import { useEscape } from "./useEscape";
import { useOutsideClickHandler } from "./useOutsideClickHandler";
export type RangeValidationT = {
from: DateValidationT;
@@ -211,7 +213,7 @@ export const useRangeDatepicker = (
const inputRefTo = useRef<HTMLInputElement>(null);
const inputRefFrom = useRef<HTMLInputElement>(null);
const datePickerRef = useRef<HTMLDivElement | null>(null);
const [daypickerRef, setDaypickerRef] = useState<HTMLDivElement>();
const [defaultSelected, setDefaultSelected] = useState(_defaultSelected);
@@ -241,6 +243,20 @@ export const useRangeDatepicker = (
const [open, setOpen] = useState(false);
useOutsideClickHandler(open, setOpen, [
daypickerRef,
inputRefTo.current,
inputRefFrom.current,
inputRefTo.current?.nextSibling,
inputRefFrom.current?.nextSibling,
]);
useEscape(
open,
setOpen,
selectedRange?.from && !selectedRange?.to ? inputRefTo : inputRefFrom
);
const updateRange = (range?: DateRange) => {
onRangeChange?.(range);
setSelectedRange(range);
@@ -255,37 +271,6 @@ export const useRangeDatepicker = (
onValidate?.(msg);
};
const handleFocusIn = useCallback(
(e) => {
/* Workaround for shadow-dom users (open) */
const composed = e.composedPath?.()?.[0];
if (!e?.target || !e?.target?.nodeType || !composed) {
return;
}
![
datePickerRef.current,
inputRefTo.current,
inputRefFrom.current,
inputRefTo.current?.nextSibling,
inputRefFrom.current?.nextSibling,
].some(
(element) => element?.contains(e.target) || element?.contains(composed)
) &&
open &&
setOpen(false);
},
[open]
);
useEffect(() => {
window.addEventListener("focusin", handleFocusIn);
window.addEventListener("pointerdown", handleFocusIn);
return () => {
window?.removeEventListener?.("focusin", handleFocusIn);
window?.removeEventListener?.("pointerdown", handleFocusIn);
};
}, [handleFocusIn]);
const reset = () => {
updateRange(defaultSelected ?? { from: undefined, to: undefined });
setMonth(defaultSelected ? defaultSelected?.from : defaultMonth ?? today);
@@ -527,28 +512,6 @@ export const useRangeDatepicker = (
: toChange(e.target.value, day, isBefore, isAfter);
};
const handleClose = useCallback(() => {
setOpen(false);
if (selectedRange?.from && !selectedRange?.to) {
inputRefTo?.current?.focus();
} else {
inputRefFrom?.current?.focus();
}
}, [selectedRange]);
const escape = useCallback(
(e) => open && e.key === "Escape" && handleClose(),
[handleClose, open]
);
useEffect(() => {
window.addEventListener("keydown", escape, false);
return () => {
window.removeEventListener("keydown", escape, false);
};
}, [escape]);
const datepickerProps = {
month: month,
onMonthChange: (month) => setMonth(month),
@@ -563,7 +526,7 @@ export const useRangeDatepicker = (
onOpenToggle: () => setOpen((x) => !x),
disabled,
disableWeekends,
ref: datePickerRef,
ref: setDaypickerRef,
};
const fromInputProps = {
@@ -6,7 +6,7 @@ import isSameMonth from "date-fns/isSameMonth";
import setYear from "date-fns/setYear";
import React, { useEffect, useRef } from "react";
import { useDayPicker } from "react-day-picker";
import { useSharedMonthContext } from "../hooks";
import { useSharedMonthContext } from "../context";
import { dateIsInCurrentMonth, isMatch, nextEnabled } from "../utils";
interface MonthType {
@@ -6,7 +6,7 @@ import startOfYear from "date-fns/startOfYear";
import React from "react";
import { useDayPicker } from "react-day-picker";
import { Button, Select } from "../..";
import { useSharedMonthContext } from "../hooks";
import { useSharedMonthContext } from "../context";
import { hasNextYear, labelNextYear, labelPrevYear } from "../utils";
export const MonthCaption = () => {
@@ -3,7 +3,7 @@ import React, { forwardRef, useRef, useState } from "react";
import { RootProvider } from "react-day-picker";
import { Popover, useId } from "../..";
import { DateInputType, MonthPickerInput } from "../DateInput";
import { DateContext, SharedMonthProvider } from "../hooks";
import { DateContext, SharedMonthProvider } from "../context";
import { getLocaleFromString, Matcher } from "../utils";
import MonthCaption from "./MonthCaption";
import MonthPickerStandalone, {
@@ -1,7 +1,7 @@
import cl from "clsx";
import React, { forwardRef, useState } from "react";
import { RootProvider } from "react-day-picker";
import { SharedMonthProvider } from "../hooks";
import { SharedMonthProvider } from "../context";
import { getLocaleFromString } from "../utils";
import MonthCaption from "./MonthCaption";
import { MonthPickerProps } from "./MonthPicker";
@@ -4,7 +4,7 @@ import setYear from "date-fns/setYear";
import startOfMonth from "date-fns/startOfMonth";
import React, { useState } from "react";
import { BodyShort } from "../..";
import { useSharedMonthContext } from "../hooks";
import { useSharedMonthContext } from "../context";
import { isMatch } from "../utils";
import MonthButton from "./MonthButton";
@@ -6,7 +6,7 @@ import AnimateHeight from "../util/AnimateHeight";
import DataCell from "./DataCell";
import Row, { RowProps } from "./Row";
export interface ExpandableRowProps extends RowProps {
export interface ExpandableRowProps extends Omit<RowProps, "content"> {
/**
* Content of the expanded row
*/
+12
View File
@@ -1,5 +1,17 @@
# @navikt/ds-tailwind
## 2.8.13
## 2.8.12
## 2.8.11
## 2.8.10
## 2.8.9
## 2.8.8
## 2.8.7
## 2.8.6
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tailwind",
"version": "2.8.7",
"version": "2.8.13",
"description": "Tailwind config based on @navikt/ds-tokens",
"author": "Aksel | NAV designsystem team",
"keywords": [
@@ -22,7 +22,7 @@
"directory": "@navikt/core/tailwind"
},
"devDependencies": {
"@navikt/ds-tokens": "^2.8.7",
"@navikt/ds-tokens": "^2.8.13",
"@types/jest": "^29.0.0",
"color": "4.2.3",
"jest": "^29.0.0",
+12
View File
@@ -1,5 +1,17 @@
# @navikt/ds-tokens
## 2.8.13
## 2.8.12
## 2.8.11
## 2.8.10
## 2.8.9
## 2.8.8
## 2.8.7
## 2.8.6
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tokens",
"version": "2.8.7",
"version": "2.8.13",
"description": "Design-tokens for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
+12
View File
@@ -1,5 +1,17 @@
# @navikt/ds-icons
## 2.8.13
## 2.8.12
## 2.8.11
## 2.8.10
## 2.8.9
## 2.8.8
## 2.8.7
## 2.8.6
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-icons",
"version": "2.8.7",
"version": "2.8.13",
"description": "Aksel icons for NAV",
"author": "Aksel | NAV designsystem team",
"repository": {
+2 -1
View File
@@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./cjs",
"module": "commonjs"
"module": "commonjs",
"skipLibCheck": true
},
"exclude": ["./figma", "./util", "./tests", "./scripts", "**/*.stories.*"],
"include": ["./src"]
+12
View File
@@ -1,5 +1,17 @@
# @navikt/ds-css-internal
## 2.8.13
## 2.8.12
## 2.8.11
## 2.8.10
## 2.8.9
## 2.8.8
## 2.8.7
## 2.8.6
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css-internal",
"version": "2.8.7",
"version": "2.8.13",
"description": "CSS for NAV internal Designsystem-components",
"author": "Aksel | NAV designsystem team",
"keywords": [
+50
View File
@@ -1,5 +1,55 @@
# @navikt/ds-react-internal
## 2.8.13
### Patch Changes
- Updated dependencies []:
- @navikt/ds-react@2.8.13
- @navikt/ds-icons@2.8.13
## 2.8.12
### Patch Changes
- [#1915](https://github.com/navikt/aksel/pull/1915) [`85353d2c4`](https://github.com/navikt/aksel/commit/85353d2c4fb24ab59656f8094ca685d70acd46f1) Thanks [@it-vegard](https://github.com/it-vegard)! - Fixed TS conficts and added onClick callback to CopyToClipboard
- Updated dependencies []:
- @navikt/ds-react@2.8.12
- @navikt/ds-icons@2.8.12
## 2.8.11
### Patch Changes
- Updated dependencies []:
- @navikt/ds-react@2.8.11
- @navikt/ds-icons@2.8.11
## 2.8.10
### Patch Changes
- Updated dependencies [[`63fdacf0f`](https://github.com/navikt/aksel/commit/63fdacf0f8fa09593c64b35b49381d6c8a1befd1)]:
- @navikt/ds-react@2.8.10
- @navikt/ds-icons@2.8.10
## 2.8.9
### Patch Changes
- Updated dependencies []:
- @navikt/ds-react@2.8.9
- @navikt/ds-icons@2.8.9
## 2.8.8
### Patch Changes
- Updated dependencies []:
- @navikt/ds-react@2.8.8
- @navikt/ds-icons@2.8.8
## 2.8.7
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react-internal",
"version": "2.8.7",
"version": "2.8.13",
"description": "Aksel react components for internal UIs in NAV",
"author": "Aksel | NAV designsystem team",
"license": "MIT",
@@ -35,8 +35,8 @@
"watch": "tsc --watch -p tsconfig.esm.json"
},
"dependencies": {
"@navikt/ds-icons": "^2.8.7",
"@navikt/ds-react": "^2.8.7",
"@navikt/ds-icons": "^2.8.13",
"@navikt/ds-react": "^2.8.13",
"clsx": "^1.1.1",
"copy-to-clipboard": "^3.3.1"
},
@@ -11,7 +11,7 @@ import {
} from "@navikt/ds-react";
export interface CopyToClipboardProps
extends Omit<ButtonProps, "children" | "variant" | "loading"> {
extends Omit<ButtonProps, "children" | "onClick" | "variant" | "loading"> {
/**
* Button text
*/
@@ -20,6 +20,10 @@ export interface CopyToClipboardProps
* Text to be copied to clipboard
*/
copyText: string;
/**
* Callback function triggered when clicking the button
*/
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
/**
* Description of text. Example: "Kopierte personnummer til clipboard"
*/
@@ -63,6 +67,7 @@ export const CopyToClipboard = forwardRef<
copyText,
popoverText,
className,
onClick,
size = "medium",
popoverPlacement = "bottom",
iconPosition = "left",
@@ -85,9 +90,12 @@ export const CopyToClipboard = forwardRef<
};
}, [openPopover]);
const handleClick = () => {
const handleClick = (event: React.MouseEvent<HTMLElement, MouseEvent>) => {
copy(copyText);
setOpenPopover(true);
if (onClick) {
onClick(event);
}
};
const copyTitle = title ?? (children ? undefined : `Kopier ${copyText}`);
+9 -9
View File
@@ -15,15 +15,15 @@
"website"
],
"dependencies": {
"@navikt/aksel-icons": "^2.8.7",
"@navikt/ds-codemod": "^2.8.7",
"@navikt/ds-css": "^2.8.7",
"@navikt/ds-css-internal": "^2.8.7",
"@navikt/ds-icons": "^2.8.7",
"@navikt/ds-react": "^2.8.7",
"@navikt/ds-react-internal": "^2.8.7",
"@navikt/ds-tailwind": "^2.8.7",
"@navikt/ds-tokens": "^2.8.7"
"@navikt/aksel-icons": "^2.8.13",
"@navikt/ds-codemod": "^2.8.13",
"@navikt/ds-css": "^2.8.13",
"@navikt/ds-css-internal": "^2.8.13",
"@navikt/ds-icons": "^2.8.13",
"@navikt/ds-react": "^2.8.13",
"@navikt/ds-react-internal": "^2.8.13",
"@navikt/ds-tailwind": "^2.8.13",
"@navikt/ds-tokens": "^2.8.13"
},
"devDependencies": {
"prettier-plugin-tailwindcss": "^0.2.3"
@@ -1,4 +1,4 @@
import { ExternalLink } from "@navikt/ds-icons";
import { ExternalLinkIcon } from "@navikt/aksel-icons";
import { BodyLong, Detail, Heading, Ingress, Link } from "@navikt/ds-react";
import BlockContent from "@sanity/block-content-to-react";
import cl from "clsx";
@@ -220,7 +220,7 @@ const serializers = {
)
}
>
{children} <ExternalLink title="åpner lenken i ny fane" />
{children} <ExternalLinkIcon title="åpner lenken i ny fane" />
</Link>
) : (
<NextLink href={href} passHref legacyBehavior>
@@ -1,8 +1,8 @@
import { definePreview } from "next-sanity/preview";
import { ComponentType } from "react";
import { config } from "../lib/sanity/config";
import { clientConfig } from "@/sanity/config";
const usePreview = definePreview(config);
const usePreview = definePreview(clientConfig);
const WithPreview = ({
comp: Comp,
@@ -1,33 +0,0 @@
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
const NAVLogoDark = (props) => (
<svg
width="3.25em"
height="3.25em"
viewBox="0 0 269 169"
fill="none"
xmlns="http://www.w3.org/2000/svg"
focusable="false"
role="img"
aria-label="NAV"
{...props}
>
<path
d="M0 121.359L17.265 78.6299H33.854L16.611 121.359H0Z"
fill="var(--a-surface-inverted)"
/>
<path
d="M213.044 121.359L230.088 78.6299H239.132L222.089 121.359H213.044Z"
fill="var(--a-surface-inverted)"
/>
<path
d="M246.563 121.359L263.604 78.6299H268.407L251.364 121.359H246.563Z"
fill="var(--a-surface-inverted)"
/>
<path
d="M197.36 78.6299H182.344C182.344 78.6299 181.309 78.6299 180.943 79.5439L172.633 104.983L164.33 79.5439C163.964 78.6299 162.923 78.6299 162.923 78.6299H134.051C133.426 78.6299 132.902 79.1519 132.902 79.7729V88.4119C132.902 81.5589 125.61 78.6299 121.34 78.6299C111.778 78.6299 105.377 84.9279 103.384 94.5029C103.276 88.1509 102.748 85.8749 101.037 83.5439C100.251 82.4019 99.1154 81.4419 97.8784 80.6479C95.3314 79.1559 93.0444 78.6299 88.1294 78.6299H82.3584C82.3584 78.6299 81.3154 78.6299 80.9474 79.5439L75.6964 92.5569V79.7729C75.6964 79.1519 75.1764 78.6299 74.5524 78.6299H61.1984C61.1984 78.6299 60.1674 78.6299 59.7924 79.5439L54.3334 93.0749C54.3334 93.0749 53.7884 94.4279 55.0344 94.4279H60.1674V120.212C60.1674 120.852 60.6714 121.359 61.3144 121.359H74.5524C75.1764 121.359 75.6964 120.852 75.6964 120.212V94.4279H80.8564C83.8174 94.4279 84.4444 94.5089 85.5964 95.0459C86.2904 95.3079 86.9154 95.8379 87.2564 96.4489C87.9544 97.7629 88.1294 99.3409 88.1294 103.994V120.212C88.1294 120.852 88.6434 121.359 89.2784 121.359H101.966C101.966 121.359 103.4 121.359 103.967 119.943L106.779 112.993C110.518 118.23 116.672 121.359 124.32 121.359H125.991C125.991 121.359 127.434 121.359 128.005 119.943L132.902 107.815V120.212C132.902 120.852 133.426 121.359 134.051 121.359H147.003C147.003 121.359 148.432 121.359 149.006 119.943C149.006 119.943 154.186 107.082 154.206 106.985H154.214C154.413 105.915 153.061 105.915 153.061 105.915H148.438V83.8469L162.983 119.943C163.551 121.359 164.983 121.359 164.983 121.359H180.284C180.284 121.359 181.724 121.359 182.292 119.943L198.417 80.0139C198.975 78.6299 197.36 78.6299 197.36 78.6299ZM132.902 105.915H124.202C120.739 105.915 117.922 103.111 117.922 99.6438C117.922 96.1828 120.739 93.3608 124.202 93.3608H126.635C130.089 93.3608 132.902 96.1828 132.902 99.6438V105.915ZM125.309 168.942C78.6681 168.942 40.8491 131.125 40.8491 84.477C40.8491 37.824 78.6681 0 125.309 0C171.967 0 209.79 37.824 209.79 84.477C209.79 131.125 171.967 168.942 125.309 168.942Z"
fill="var(--a-surface-inverted)"
/>
</svg>
);
export default NAVLogoDark;
@@ -1,30 +0,0 @@
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
const NAVLogoWhite = (props) => (
<svg
width="3.25em"
height="3.25em"
viewBox="0 0 269 169"
fill="none"
xmlns="http://www.w3.org/2000/svg"
focusable="false"
role="img"
aria-label="NAV"
{...props}
>
<path d="M0 121.359L17.265 78.6299H33.854L16.611 121.359H0Z" fill="white" />
<path
d="M213.044 121.359L230.088 78.6299H239.132L222.089 121.359H213.044Z"
fill="white"
/>
<path
d="M246.563 121.359L263.604 78.6299H268.407L251.364 121.359H246.563Z"
fill="white"
/>
<path
d="M197.36 78.6299H182.344C182.344 78.6299 181.309 78.6299 180.943 79.5439L172.633 104.983L164.33 79.5439C163.964 78.6299 162.923 78.6299 162.923 78.6299H134.051C133.426 78.6299 132.902 79.1519 132.902 79.7729V88.4119C132.902 81.5589 125.61 78.6299 121.34 78.6299C111.778 78.6299 105.377 84.9279 103.384 94.5029C103.276 88.1509 102.748 85.8749 101.037 83.5439C100.251 82.4019 99.1154 81.4419 97.8784 80.6479C95.3314 79.1559 93.0444 78.6299 88.1294 78.6299H82.3584C82.3584 78.6299 81.3154 78.6299 80.9474 79.5439L75.6964 92.5569V79.7729C75.6964 79.1519 75.1764 78.6299 74.5524 78.6299H61.1984C61.1984 78.6299 60.1674 78.6299 59.7924 79.5439L54.3334 93.0749C54.3334 93.0749 53.7884 94.4279 55.0344 94.4279H60.1674V120.212C60.1674 120.852 60.6714 121.359 61.3144 121.359H74.5524C75.1764 121.359 75.6964 120.852 75.6964 120.212V94.4279H80.8564C83.8174 94.4279 84.4444 94.5089 85.5964 95.0459C86.2904 95.3079 86.9154 95.8379 87.2564 96.4489C87.9544 97.7629 88.1294 99.3409 88.1294 103.994V120.212C88.1294 120.852 88.6434 121.359 89.2784 121.359H101.966C101.966 121.359 103.4 121.359 103.967 119.943L106.779 112.993C110.518 118.23 116.672 121.359 124.32 121.359H125.991C125.991 121.359 127.434 121.359 128.005 119.943L132.902 107.815V120.212C132.902 120.852 133.426 121.359 134.051 121.359H147.003C147.003 121.359 148.432 121.359 149.006 119.943C149.006 119.943 154.186 107.082 154.206 106.985H154.214C154.413 105.915 153.061 105.915 153.061 105.915H148.438V83.8469L162.983 119.943C163.551 121.359 164.983 121.359 164.983 121.359H180.284C180.284 121.359 181.724 121.359 182.292 119.943L198.417 80.0139C198.975 78.6299 197.36 78.6299 197.36 78.6299ZM132.902 105.915H124.202C120.739 105.915 117.922 103.111 117.922 99.6438C117.922 96.1828 120.739 93.3608 124.202 93.3608H126.635C130.089 93.3608 132.902 96.1828 132.902 99.6438V105.915ZM125.309 168.942C78.6681 168.942 40.8491 131.125 40.8491 84.477C40.8491 37.824 78.6681 0 125.309 0C171.967 0 209.79 37.824 209.79 84.477C209.79 131.125 171.967 168.942 125.309 168.942Z"
fill="white"
/>
</svg>
);
export default NAVLogoWhite;
Loaded 100 of 187 files, more files were not shown because too many files have changed in this diff. Show more