Skip to content

Commit

Permalink
Deprecate Panel (#2712)
Browse files Browse the repository at this point in the history
* ⚰️ Markert Panel som deprecated

* 📝 Changeset

* 📝 JSDOC var feil for border på Box

* 🐛 📝 JSDoc manglet border-radius
  • Loading branch information
KenAJoh authored Feb 8, 2024
1 parent 700943b commit 4a02a19
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 79 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-falcons-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": patch
---

Panel: Komponent er nå markert som deprecated. Bruk `Box` i fremtiden.
25 changes: 9 additions & 16 deletions @navikt/core/react/src/panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import cl from "clsx";
import React, { forwardRef } from "react";
import { OverridableComponent } from "../util/types";

/**
* @deprecated Use Box with padding and border instead
*/
export interface PanelProps extends React.HTMLAttributes<HTMLElement> {
/**
* Panel content
Expand All @@ -17,23 +20,13 @@ export interface PanelProps extends React.HTMLAttributes<HTMLElement> {
export type PanelType = OverridableComponent<PanelProps, HTMLElement>;

/**
* A component that displays a bordered panel with heading and body.
*
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/panel)
* @see 🏷️ {@link PanelProps}
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
*
* @example
* ```jsx
* <Panel border>
* <Heading spacing level="2" size="large">
* Søk om økonomisk sosialhjelp
* </Heading>
* <BodyLong>
* Du kan søke om det du trenger økonomisk støtte til.
* </BodyLong>
* </Panel>
* @deprecated
* Use Box with padding and border instead
* ```
* <Box padding="4" borderRadius="small" />
* <Box padding="4" borderWidth="1" borderRadius="small" />
* ```
* Component will be removed in a future major release
*/
export const Panel: PanelType = forwardRef(
(
Expand Down
63 changes: 0 additions & 63 deletions @navikt/core/react/src/panel/panel.stories.tsx

This file was deleted.

0 comments on commit 4a02a19

Please sign in to comment.