13 |
{t('hello')}{' '}
14 |
15 | world
16 |
17 |
18 |
19 |
20 |
21 | );
22 | };
23 |
24 | export default Test;
25 |
--------------------------------------------------------------------------------
/.storybook/preview.ts:
--------------------------------------------------------------------------------
1 | import type {Preview} from '@storybook/react-vite';
2 | import i18n from './i18next';
3 |
4 | const preview: Preview = {
5 | initialGlobals: {
6 | locale: 'en',
7 | locales: {
8 | en: {icon: '🇺🇸', title: 'English', right: 'EN'},
9 | fr: {icon: '🇫🇷', title: 'Français', right: 'FR'},
10 | ja: {icon: '🇯🇵', title: '日本語', right: 'JP'},
11 | },
12 | },
13 | parameters: {
14 | backgrounds: {
15 | default: 'light',
16 | },
17 | controls: {
18 | matchers: {
19 | color: /(background|color)$/i,
20 | date: /Date$/,
21 | },
22 | },
23 | i18n,
24 | },
25 | };
26 |
27 | export default preview;
28 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "esModuleInterop": true,
4 | "skipLibCheck": true,
5 | "target": "esnext", // Node 20 according to https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-20
6 | "allowJs": true,
7 | "resolveJsonModule": true,
8 | "moduleDetection": "force",
9 | "moduleResolution": "bundler",
10 | "module": "preserve",
11 | "jsx": "react",
12 | "isolatedModules": true,
13 | "verbatimModuleSyntax": true,
14 | "strict": true,
15 | "noUncheckedIndexedAccess": true,
16 | "noImplicitOverride": true,
17 | "noImplicitAny": true,
18 | "lib": ["esnext", "dom", "dom.iterable"],
19 | "baseUrl": ".",
20 | "rootDir": "."
21 | },
22 | "include": ["src/**/*", "tsup.config.ts"]
23 | }
24 |
--------------------------------------------------------------------------------
/src/stories/test.stories.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import type {Meta, StoryObj} from '@storybook/react';
3 | import Test from './Test';
4 |
5 | // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
6 | const meta: Meta = {
7 | title: 'Test',
8 | component: Test,
9 | };
10 |
11 | export default meta;
12 |
13 | export const Default: StoryObj = {
14 | render: () =>