Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gjør familie-clipboard deprecated #1144

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/familie-clipboard/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Clipboard

**Denne komponenten er deprecated og kommer ikke til å bli vedlikeholdt. Designsystemet Aksel har sin egen versjon som brukes i stedet.**

Clipboard komponent som kan brukes for å vise og kopiere tekst.

## Installasjon
Expand All @@ -8,4 +10,4 @@ Clipboard komponent som kan brukes for å vise og kopiere tekst.
npm install @navikt/familie-clipboard
# eller hvis du bruker yarn:
yarn add @navikt/familie-clipboard
```
```
13 changes: 6 additions & 7 deletions packages/familie-visittkort/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,21 @@
"tsc": "tsc -p tsconfig.json"
},
"dependencies": {
"@navikt/familie-clipboard": "^11.0.0",
"@navikt/familie-ikoner": "^7.0.0",
"@navikt/familie-typer": "^8.0.0",
"classnames": "^2.3.2",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@navikt/ds-css": "2.x",
"@navikt/ds-react": "2.x",
"@navikt/ds-tokens": "2.x",
"@navikt/ds-css": "4.x",
"@navikt/ds-react": "4.x",
"@navikt/ds-tokens": "4.x",
"styled-components": "^5.3.5"
},
"peerDependencies": {
"@navikt/ds-css": "2.x || 3.x || 4.x",
"@navikt/ds-react": "2.x || 3.x || 4.x",
"@navikt/ds-tokens": "2.x || 3.x || 4.x",
"@navikt/ds-css": "4.x",
"@navikt/ds-react": "4.x",
"@navikt/ds-tokens": "4.x",
"react": "^17.x || 18.x",
"styled-components": "^5.x"
}
Expand Down
16 changes: 11 additions & 5 deletions packages/familie-visittkort/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Clipboard from '@navikt/familie-clipboard';
import { FamilieIkonVelger } from '@navikt/familie-ikoner';
import { kjønnType } from '@navikt/familie-typer';
import * as React from 'react';
import styled from 'styled-components';
import { BodyShort, Label } from '@navikt/ds-react';
import { CopyButton, Label } from '@navikt/ds-react';
import { AGray700, ASpacing2, ASpacing4 } from '@navikt/ds-tokens/dist/tokens';

export interface IkonProps {
Expand Down Expand Up @@ -34,6 +33,12 @@ const StyledVisittkort = styled.div`
}
`;

const FlexBox = styled.div`
display: flex;
align-items: center;
gap: 0.25rem;
`;

export const Visittkort: React.FunctionComponent<IProps> = ({
alder,
children,
Expand All @@ -59,9 +64,10 @@ export const Visittkort: React.FunctionComponent<IProps> = ({

<div className={'visittkort__pipe'}>|</div>

<Clipboard>
<BodyShort size={'small'}>{ident}</BodyShort>
</Clipboard>
<FlexBox>
{ident}
<CopyButton copyText={ident} size={'small'} />
</FlexBox>

{children}
</StyledVisittkort>
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3414,6 +3414,11 @@
resolved "https://npm.pkg.github.com/download/@navikt/ds-tokens/4.9.0/f93d5c52adb03b266077092b6f4c7d0775af076e#f93d5c52adb03b266077092b6f4c7d0775af076e"
integrity sha512-HLH8IJ0QmitthGsoftTWWh33JNsbDT+3AoTlMqwwYignbopfr47YB8EnduraHNBWMFwVDU8TSpkT7boVlEsvnQ==

"@navikt/[email protected]":
version "4.12.1"
resolved "https://npm.pkg.github.com/download/@navikt/ds-tokens/4.12.1/965d6d0f998cdbe8759d54c47788d67e24240af3#965d6d0f998cdbe8759d54c47788d67e24240af3"
integrity sha512-i6kt6D0Zy9/ECRdHw54VoK3bk3oAbY2TsbOiUC0NgBwOOSfR+D/zKCiBXMkbpkQNba8mHrC3RVfNp59pWteAUQ==

"@ndelangen/get-tarball@^3.0.7":
version "3.0.9"
resolved "https://registry.yarnpkg.com/@ndelangen/get-tarball/-/get-tarball-3.0.9.tgz#727ff4454e65f34707e742a59e5e6b1f525d8964"
Expand Down
Loading