-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sette opp storybook * Klargjøre for oversettelse * Nynorsktekster * Merge uten å skru på feature
- Loading branch information
1 parent
77b6e2b
commit c12ee16
Showing
40 changed files
with
682 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { join, dirname } from 'path'; | ||
|
||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
|
||
export default { | ||
stories: ['../src/app/**/*.stories.@(ts|tsx)', '../src/storybook/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
getAbsolutePath('@storybook/addon-a11y'), | ||
getAbsolutePath('@storybook/addon-toolbars'), | ||
], | ||
framework: { | ||
name: '@storybook/react-vite', | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: false, | ||
}, | ||
typescript: { | ||
reactDocgen: 'react-docgen-typescript-plugin', | ||
}, | ||
}; |
12 changes: 12 additions & 0 deletions
12
apps/omsorgsdager-aleneomsorg-dialog/.storybook/preview-head.html
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 @@ | ||
<script> | ||
window.appSettings = { | ||
DEKORATOR_URL: 'https://www.nav.no/dekoratoren/?simple=true&chatbot=false', | ||
LOGIN_URL: 'http://localhost:8089/login', | ||
API_URL: 'http://localhost:8089', | ||
K9_SAK_INNSYN_API_URL: 'http://localhost:8089', | ||
PUBLIC_PATH: '/familie/sykdom-i-familien/soknad/omsorgspenger', | ||
SIF_PUBLIC_APPSTATUS_PROJECT_ID: 'ryujtq87', | ||
SIF_PUBLIC_APPSTATUS_DATASET: 'staging', | ||
APP_VERSION: 'dev', | ||
}; | ||
</script> |
36 changes: 36 additions & 0 deletions
36
apps/omsorgsdager-aleneomsorg-dialog/.storybook/preview.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,36 @@ | ||
import { Preview } from '@storybook/react'; | ||
import '@navikt/ds-css'; | ||
|
||
const preview: Preview = { | ||
globalTypes: { | ||
locale: { | ||
name: 'Språk', | ||
description: 'Velg språk som skal brukes i komponenten', | ||
defaultValue: 'nb', | ||
toolbar: { | ||
icon: 'globe', | ||
items: [ | ||
{ value: 'nb', title: 'Bokmål' }, | ||
{ value: 'nn', title: 'Nynorsk' }, | ||
], | ||
}, | ||
}, | ||
}, | ||
parameters: { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
options: { | ||
storySort: { | ||
method: 'alphabetical', | ||
order: ['Components', 'Steps', ['OmBarnet', 'Legeerklæring', 'DeltBosted', 'Oppsummering'], 'Pages'], | ||
}, | ||
}, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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
18 changes: 18 additions & 0 deletions
18
apps/omsorgsdager-aleneomsorg-dialog/src/app/i18n/all-messages.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,18 @@ | ||
import { StoryFn } from '@storybook/react'; | ||
import MessagesPreview from '@navikt/sif-common-core-ds/src/dev-utils/intl/messages-preview/MessagesPreview'; | ||
import { withIntl } from '../../storybook/decorators/withIntl'; | ||
import { applicationIntlMessages } from '.'; | ||
|
||
export default { | ||
title: 'i18N/Alle tekster', | ||
decorators: [withIntl], | ||
}; | ||
|
||
const Template: StoryFn = () => ( | ||
<MessagesPreview showExplanation={false} messages={applicationIntlMessages} showMissingTextSummary={true} /> | ||
); | ||
export const Default = Template.bind({}); | ||
|
||
Default.args = {}; | ||
|
||
Default.parameters = {}; |
18 changes: 18 additions & 0 deletions
18
apps/omsorgsdager-aleneomsorg-dialog/src/app/i18n/app-messages.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,18 @@ | ||
import { StoryFn } from '@storybook/react'; | ||
import MessagesPreview from '@navikt/sif-common-core-ds/src/dev-utils/intl/messages-preview/MessagesPreview'; | ||
import { withIntl } from '../../storybook/decorators/withIntl'; | ||
import { appMessages } from './appMessages'; | ||
|
||
export default { | ||
title: 'i18N/App-tekster', | ||
decorators: [withIntl], | ||
}; | ||
|
||
const Template: StoryFn = () => ( | ||
<MessagesPreview showExplanation={false} messages={appMessages} showMissingTextSummary={true} /> | ||
); | ||
export const Default = Template.bind({}); | ||
|
||
Default.args = {}; | ||
|
||
Default.parameters = {}; |
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
18 changes: 18 additions & 0 deletions
18
apps/omsorgsdager-aleneomsorg-dialog/src/app/i18n/lib-messages.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,18 @@ | ||
import { StoryFn } from '@storybook/react'; | ||
import MessagesPreview from '@navikt/sif-common-core-ds/src/dev-utils/intl/messages-preview/MessagesPreview'; | ||
import { libMessages } from './index'; | ||
import { withIntl } from '../../storybook/decorators/withIntl'; | ||
|
||
export default { | ||
title: 'i18N/Bibliotek tekster', | ||
decorators: [withIntl], | ||
}; | ||
|
||
const Template: StoryFn = () => ( | ||
<MessagesPreview showExplanation={false} messages={libMessages} showMissingTextSummary={true} /> | ||
); | ||
export const Default = Template.bind({}); | ||
|
||
Default.args = {}; | ||
|
||
Default.parameters = {}; |
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.