Compare commits

..
Author SHA1 Message Date
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
23 changed files with 71 additions and 31 deletions

No files matched your search

+2
View File
@@ -1,5 +1,7 @@
# @navikt/aksel-icons
## 2.8.12
## 2.8.11
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/aksel-icons",
"version": "2.8.11",
"version": "2.8.12",
"author": "Aksel | NAV",
"homepage": "https://aksel.nav.no/ikoner",
"repository": {
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-codemod
## 2.8.12
## 2.8.11
## 2.8.10
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-codemod",
"version": "2.8.11",
"version": "2.8.12",
"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.11",
"@navikt/ds-react": "^2.8.11",
"@navikt/ds-icons": "^2.8.12",
"@navikt/ds-react": "^2.8.12",
"clsx": "^1.1.1"
},
"devDependencies": {
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-css
## 2.8.12
## 2.8.11
## 2.8.10
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css",
"version": "2.8.11",
"version": "2.8.12",
"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.11",
"@navikt/ds-tokens": "^2.8.12",
"normalize.css": "^8.0.1",
"postcss": "^8.4.0",
"postcss-cli": "^9.0.0",
+8
View File
@@ -1,5 +1,13 @@
# @navikt/ds-react
## 2.8.12
### Patch Changes
- Updated dependencies []:
- @navikt/aksel-icons@2.8.12
- @navikt/ds-icons@2.8.12
## 2.8.11
### Patch Changes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react",
"version": "2.8.11",
"version": "2.8.12",
"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.11",
"@navikt/ds-icons": "^2.8.11",
"@navikt/aksel-icons": "^2.8.12",
"@navikt/ds-icons": "^2.8.12",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^1.2.1",
@@ -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
*/
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-tailwind
## 2.8.12
## 2.8.11
## 2.8.10
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tailwind",
"version": "2.8.11",
"version": "2.8.12",
"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.11",
"@navikt/ds-tokens": "^2.8.12",
"@types/jest": "^29.0.0",
"color": "4.2.3",
"jest": "^29.0.0",
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-tokens
## 2.8.12
## 2.8.11
## 2.8.10
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-tokens",
"version": "2.8.11",
"version": "2.8.12",
"description": "Design-tokens for NAV designsystem",
"author": "Aksel | NAV designsystem team",
"keywords": [
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-icons
## 2.8.12
## 2.8.11
## 2.8.10
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-icons",
"version": "2.8.11",
"version": "2.8.12",
"description": "Aksel icons for NAV",
"author": "Aksel | NAV designsystem team",
"repository": {
+2
View File
@@ -1,5 +1,7 @@
# @navikt/ds-css-internal
## 2.8.12
## 2.8.11
## 2.8.10
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-css-internal",
"version": "2.8.11",
"version": "2.8.12",
"description": "CSS for NAV internal Designsystem-components",
"author": "Aksel | NAV designsystem team",
"keywords": [
+10
View File
@@ -1,5 +1,15 @@
# @navikt/ds-react-internal
## 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
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@navikt/ds-react-internal",
"version": "2.8.11",
"version": "2.8.12",
"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.11",
"@navikt/ds-react": "^2.8.11",
"@navikt/ds-icons": "^2.8.12",
"@navikt/ds-react": "^2.8.12",
"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.11",
"@navikt/ds-codemod": "^2.8.11",
"@navikt/ds-css": "^2.8.11",
"@navikt/ds-css-internal": "^2.8.11",
"@navikt/ds-icons": "^2.8.11",
"@navikt/ds-react": "^2.8.11",
"@navikt/ds-react-internal": "^2.8.11",
"@navikt/ds-tailwind": "^2.8.11",
"@navikt/ds-tokens": "^2.8.11"
"@navikt/aksel-icons": "^2.8.12",
"@navikt/ds-codemod": "^2.8.12",
"@navikt/ds-css": "^2.8.12",
"@navikt/ds-css-internal": "^2.8.12",
"@navikt/ds-icons": "^2.8.12",
"@navikt/ds-react": "^2.8.12",
"@navikt/ds-react-internal": "^2.8.12",
"@navikt/ds-tailwind": "^2.8.12",
"@navikt/ds-tokens": "^2.8.12"
},
"devDependencies": {
"prettier-plugin-tailwindcss": "^0.2.3"
+2 -2
View File
@@ -10,8 +10,8 @@
"preview": "vite preview"
},
"dependencies": {
"@navikt/ds-css": "2.8.11",
"@navikt/ds-react": "2.8.11",
"@navikt/ds-css": "2.8.12",
"@navikt/ds-react": "2.8.12",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},