-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/table-radio-button
- Loading branch information
Showing
183 changed files
with
5,297 additions
and
3,428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,3 +404,5 @@ layout-sets.schema.v1.json | |
layoutSettings.schema.v1.json | ||
|
||
eslint-results.html | ||
|
||
runner-results |
725 changes: 367 additions & 358 deletions
725
.yarn/releases/yarn-4.5.0.cjs → .yarn/releases/yarn-4.5.1.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"reporterEnabled": "cypress-parallel/json-stream.reporter.js, cypress-parallel/simple-spec.reporter.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React, { forwardRef } from 'react'; | ||
import type { PropsWithChildren } from 'react'; | ||
|
||
import { Button as DesignSystemButton, Spinner } from '@digdir/designsystemet-react'; | ||
import type { ButtonProps as DesignSystemButtonProps } from '@digdir/designsystemet-react'; | ||
|
||
import { useLanguage } from 'src/features/language/useLanguage'; | ||
|
||
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | undefined; | ||
export type ButtonColor = 'first' | 'second' | 'success' | 'danger' | undefined; | ||
|
||
export type ButtonProps = { | ||
variant?: ButtonVariant; | ||
color?: ButtonColor; | ||
isLoading?: boolean; | ||
size?: 'sm' | 'md' | 'lg'; | ||
className?: string; | ||
} & Pick< | ||
DesignSystemButtonProps, | ||
| 'id' | ||
| 'title' | ||
| 'disabled' | ||
| 'icon' | ||
| 'fullWidth' | ||
| 'onClick' | ||
| 'style' | ||
| 'tabIndex' | ||
| 'onMouseDown' | ||
| 'aria-label' | ||
| 'aria-busy' | ||
| 'aria-controls' | ||
| 'aria-haspopup' | ||
| 'aria-expanded' | ||
| 'aria-labelledby' | ||
| 'aria-describedby' | ||
| 'onKeyUp' | ||
>; | ||
|
||
export const Button = forwardRef<HTMLButtonElement, PropsWithChildren<ButtonProps>>(function Button( | ||
{ id, disabled, isLoading = false, variant = 'primary', color = 'first', size = 'sm', children, ...props }, | ||
ref, | ||
) { | ||
const { langAsString } = useLanguage(); | ||
return ( | ||
<DesignSystemButton | ||
id={id} | ||
disabled={disabled || isLoading} | ||
variant={variant} | ||
color={color} | ||
size={size} | ||
ref={ref} | ||
{...props} | ||
> | ||
{isLoading && ( | ||
<Spinner | ||
aria-hidden='true' | ||
color={color} | ||
size={size === 'lg' ? 'sm' : 'xs'} | ||
title={langAsString('general.loading')} | ||
/> | ||
)} | ||
{children} | ||
</DesignSystemButton> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.