Skip to content

Commit 6a2164b

Browse files
authored
Merge pull request #64 from DouglasNeuroInformatics/i18n
refactor i18next implementation to align with odc runtime and allow registering events and non-react usage
2 parents 70ab09e + 360873e commit 6a2164b

File tree

78 files changed

+2557
-2549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2557
-2549
lines changed

.storybook/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta } from '@storybook/blocks';
1+
import { Meta } from '@storybook/addon-docs/blocks';
22

33
<Meta title="Welcome" />
44

.storybook/main.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
22

33
const config: StorybookConfig = {
4-
addons: [
5-
'@storybook/addon-docs',
6-
'@storybook/addon-links',
7-
'@storybook/addon-essentials',
8-
'@storybook/addon-interactions'
9-
],
4+
addons: ['@storybook/addon-docs', '@storybook/addon-links'],
105
core: {
116
disableTelemetry: true
127
},
13-
docs: {
14-
autodocs: 'tag'
15-
},
168
framework: {
179
name: '@storybook/react-vite',
1810
options: {

.storybook/manager.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, { useEffect } from 'react';
1+
import React, { Fragment, useEffect } from 'react';
22

3-
import { IconButton } from '@storybook/components';
4-
import { addons, types } from '@storybook/manager-api';
53
import { MoonIcon, SunIcon } from 'lucide-react';
4+
import { IconButton } from 'storybook/internal/components';
5+
import { addons, types } from 'storybook/manager-api';
66
import { match } from 'ts-pattern';
77

88
import { useTheme } from '../src/hooks/useTheme';
99
import theme from './theme';
1010

11-
const ExampleToolbar = React.memo(function ExampleToolbar() {
11+
const Toolbar = React.memo(function Toolbar() {
1212
const [theme, setTheme] = useTheme();
1313

1414
useEffect(() => {
@@ -17,17 +17,19 @@ const ExampleToolbar = React.memo(function ExampleToolbar() {
1717
}, [theme]);
1818

1919
return (
20-
<IconButton
21-
title="TailwindCSS Theme"
22-
onClick={() => {
23-
setTheme(theme === 'light' ? 'dark' : 'light');
24-
}}
25-
>
26-
{match(theme)
27-
.with('dark', () => <SunIcon height={14} width={14} />)
28-
.with('light', () => <MoonIcon height={14} width={14} />)
29-
.exhaustive()}
30-
</IconButton>
20+
<Fragment>
21+
<IconButton
22+
title="TailwindCSS Theme"
23+
onClick={() => {
24+
setTheme(theme === 'light' ? 'dark' : 'light');
25+
}}
26+
>
27+
{match(theme)
28+
.with('dark', () => <SunIcon height={14} width={14} />)
29+
.with('light', () => <MoonIcon height={14} width={14} />)
30+
.exhaustive()}
31+
</IconButton>
32+
</Fragment>
3133
);
3234
});
3335

@@ -36,8 +38,8 @@ addons.setConfig({ theme });
3638
addons.register('docs-theme', () => {
3739
addons.add('docs-theme-addon', {
3840
match: ({ viewMode }) => !!viewMode?.match(/^(story|docs)$/),
39-
render: ExampleToolbar,
40-
title: 'Addon to change docs story theme',
41+
render: Toolbar,
42+
title: 'Addon to change docs story theme and language',
4143
type: types.TOOL
4244
});
4345
});

.storybook/preview.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import type { Preview } from '@storybook/react';
1+
import type { Preview } from '@storybook/react-vite';
22

33
import { i18n } from '../src/i18n';
44
import theme from './theme';
55

66
import '../src/tailwind/globals.css';
77

8-
i18n.init();
8+
i18n.init({
9+
translations: {}
10+
});
911

1012
const preview: Preview = {
1113
initialGlobals: {

.storybook/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { create } from '@storybook/theming/create';
21
import { formatRgb } from 'culori';
2+
import { create } from 'storybook/theming/create';
33
import colors from 'tailwindcss/colors';
44
import defaultTheme from 'tailwindcss/defaultTheme';
55

package.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"zod": "^3.25.x"
6969
},
7070
"dependencies": {
71-
"@douglasneuroinformatics/libjs": "^3.0.1",
71+
"@douglasneuroinformatics/libjs": "^3.0.2",
7272
"@douglasneuroinformatics/libui-form-types": "^0.11.0",
7373
"@radix-ui/react-accordion": "^1.2.3",
7474
"@radix-ui/react-alert-dialog": "^1.1.6",
@@ -116,17 +116,10 @@
116116
"@douglasneuroinformatics/semantic-release": "^0.2.1",
117117
"@douglasneuroinformatics/tsconfig": "^1.0.3",
118118
"@faker-js/faker": "^9.6.0",
119-
"@storybook/addon-docs": "^8.6.11",
120-
"@storybook/addon-essentials": "^8.6.11",
121-
"@storybook/addon-interactions": "^8.6.11",
122-
"@storybook/addon-links": "^8.6.11",
123-
"@storybook/blocks": "^8.6.11",
124-
"@storybook/components": "^8.6.11",
119+
"@storybook/addon-docs": "^9.0.6",
120+
"@storybook/addon-links": "^9.0.6",
125121
"@storybook/icons": "^1.4.0",
126-
"@storybook/manager-api": "^8.6.11",
127-
"@storybook/react": "^8.6.11",
128-
"@storybook/react-vite": "^8.6.11",
129-
"@storybook/theming": "^8.6.11",
122+
"@storybook/react-vite": "^9.0.6",
130123
"@tailwindcss/vite": "^4.1.0",
131124
"@testing-library/dom": "^10.4.0",
132125
"@testing-library/jest-dom": "^6.6.3",
@@ -137,7 +130,7 @@
137130
"@types/node": "22.x",
138131
"@types/react": "^19.0.12",
139132
"@types/react-dom": "^19.0.4",
140-
"@vitejs/plugin-react-swc": "^3.8.1",
133+
"@vitejs/plugin-react-swc": "^3.10.1",
141134
"@vitest/coverage-v8": "^3.1.1",
142135
"culori": "^4.0.1",
143136
"eslint": "^9.23.0",
@@ -147,10 +140,10 @@
147140
"prettier": "^3.5.3",
148141
"prettier-plugin-tailwindcss": "^0.6.11",
149142
"sort-json": "^2.0.1",
150-
"storybook": "^8.6.11",
143+
"storybook": "^9.0.6",
151144
"tsup": "^8.4.0",
152145
"typescript": "5.6.x",
153-
"vite": "6.2.4",
146+
"vite": "^6.3.5",
154147
"vitest": "^3.1.1"
155148
},
156149
"commitlint": {
@@ -166,6 +159,7 @@
166159
"pnpm": {
167160
"onlyBuiltDependencies": [
168161
"@swc/core",
162+
"@tailwindcss/oxide",
169163
"esbuild"
170164
]
171165
}

0 commit comments

Comments
 (0)