-
Notifications
You must be signed in to change notification settings - Fork 75
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 12848-upload-static-images-to-be-used-by-the…
…-image-component
- Loading branch information
Showing
60 changed files
with
7,776 additions
and
1,765 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
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
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
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
24 changes: 24 additions & 0 deletions
24
frontend/libs/studio-components/src/components/StudioBetaTag/StudioBetaTag.stories.tsx
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,24 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryFn } from '@storybook/react'; | ||
import { StudioBetaTag } from './StudioBetaTag'; | ||
|
||
type Story = StoryFn<typeof StudioBetaTag>; | ||
|
||
const meta: Meta = { | ||
title: 'Components/StudioBetaTag', | ||
component: StudioBetaTag, | ||
argTypes: { | ||
size: { | ||
control: 'radio', | ||
options: ['sm', 'md', 'lg'], | ||
}, | ||
}, | ||
}; | ||
|
||
export const Preview: Story = (args): React.ReactElement => <StudioBetaTag {...args} />; | ||
|
||
Preview.args = { | ||
size: 'sm', | ||
}; | ||
|
||
export default meta; |
19 changes: 19 additions & 0 deletions
19
frontend/libs/studio-components/src/components/StudioBetaTag/StudioBetaTag.test.tsx
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,19 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { StudioBetaTag, type StudioBetaTagProps } from './StudioBetaTag'; | ||
import { testRootClassNameAppending } from '../../test-utils/testRootClassNameAppending'; | ||
|
||
describe('StudioBetaTag', () => { | ||
it('should render the "Beta" text', () => { | ||
renderStudioBetaTag(); | ||
expect(screen.getByText('Beta')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Appends given classname to the component', () => { | ||
testRootClassNameAppending((className) => renderStudioBetaTag({ className })); | ||
}); | ||
}); | ||
|
||
const renderStudioBetaTag = (props: Partial<StudioBetaTagProps> = {}) => { | ||
return render(<StudioBetaTag {...props} />); | ||
}; |
12 changes: 12 additions & 0 deletions
12
frontend/libs/studio-components/src/components/StudioBetaTag/StudioBetaTag.tsx
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,12 @@ | ||
import React from 'react'; | ||
import { StudioTag, type StudioTagProps } from '../StudioTag'; | ||
|
||
export type StudioBetaTagProps = Omit<StudioTagProps, 'color' | 'children'>; | ||
|
||
export const StudioBetaTag = ({ size = 'sm', ...rest }: StudioBetaTagProps) => { | ||
return ( | ||
<StudioTag color='info' size={size} {...rest}> | ||
Beta | ||
</StudioTag> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
frontend/libs/studio-components/src/components/StudioBetaTag/index.ts
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 @@ | ||
export { StudioBetaTag, type StudioBetaTagProps } from './StudioBetaTag'; |
1 change: 1 addition & 0 deletions
1
frontend/libs/studio-components/src/components/StudioTag/index.tsx
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 @@ | ||
export { Tag as StudioTag, type TagProps as StudioTagProps } from '@digdir/designsystemet-react'; |
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
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
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 |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
"peerDependencies": { | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"typescript": "5.5.4" | ||
"typescript": "5.6.2" | ||
} | ||
} |
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
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
Oops, something went wrong.