Skip to content

Commit

Permalink
Merge branch 'next' into docs/data-color
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes authored Nov 28, 2024
2 parents ea406ef + 99aa669 commit 80f2704
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-jeans-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet-react": patch
---

React: Set `"type": "module"` in `package.json`
6 changes: 6 additions & 0 deletions .changeset/silver-penguins-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@digdir/designsystemet-react": patch
"@digdir/designsystemet-css": patch
---

Rename `Accordion` to `Details`
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@digdir/designsystemet-react",
"type": "module",
"version": "1.0.0-next.39",
"description": "React components for Designsystemet",
"author": "Designsystemet team",
Expand Down
12 changes: 12 additions & 0 deletions packages/react/src/components/Details/Details.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,24 @@ Med `Details` kan du presentere mye innhold på liten plass i en eller flere rad
## Bruk

```tsx
/* Uten ramme */
import { Details } from '@digdir/designsystemet-react';

<Details>
<Details.Summary>Details heading text</Details.Summary>
<Details.Content>Details content</Details.Content>
</Details>

/* Med ramme */

import { Details, Card } from '@digdir/designsystemet-react';

<Card>
<Details>
<Details.Summary>Details heading text</Details.Summary>
<Details.Content>Details content</Details.Content>
</Details>
</Card>
```

## Eksempler
Expand Down
14 changes: 3 additions & 11 deletions packages/react/src/components/form/Fieldset/Fieldset.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import cl from 'clsx/lite';
import type { FieldsetHTMLAttributes, ReactNode } from 'react';
import type { FieldsetHTMLAttributes } from 'react';
import { forwardRef } from 'react';

import type { DefaultProps } from '../../../types';
import type { MergeRight } from '../../../utilities';

export type FieldsetProps = MergeRight<
DefaultProps & FieldsetHTMLAttributes<HTMLFieldSetElement>,
{
/** Toggle `disabled` all input fields within the fieldset. */
disabled?: boolean;
/** If set, this will diplay an error message at the bottom of the fieldset. */
error?: ReactNode;
}
>;
export type FieldsetProps = DefaultProps &
FieldsetHTMLAttributes<HTMLFieldSetElement>;

export const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(
function Fieldset({ className, ...rest }, ref) {
Expand Down

0 comments on commit 80f2704

Please sign in to comment.