Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e99b3be
feat: prep for storybook 10
Nov 17, 2025
edd5e7f
chore: update dependencies [skip chromatic]
Nov 20, 2025
f19fb50
Merge branch 'main' into feat/storybook-10-update
Nov 21, 2025
2de2c0d
Merge branch 'main' into feat/storybook-10-update
Nov 25, 2025
97b79ab
chore: update dependencies
Nov 25, 2025
f254939
Merge branch 'main' into feat/storybook-10-update
Nov 25, 2025
ee58217
feat: use fork of storybook addon for storybook-design-token
Nov 25, 2025
99d020e
feat: switch to fork for storybook-addon-html [skip chromatic]
Nov 25, 2025
e62a1a7
Merge branch 'main' into feat/storybook-10-update
Nov 26, 2025
6d8a81c
Merge branch 'main' into feat/storybook-10-update
Dec 3, 2025
811a5de
chore: merge upstream [skip chromatic]
Dec 3, 2025
3bf3fa9
chore: update to storybook 10.1 [skip chromatic]
Dec 3, 2025
93051b9
feat: document AI feature in SB 10 [skip chromatic]
Dec 3, 2025
a636785
chore: update react
Dec 4, 2025
269a445
Merge branch 'main' into pr/627
Dec 9, 2025
e0e9383
chore: update dependencies [skip chromatic]
Dec 9, 2025
e06bce9
Merge branch 'main' into pr/627
Jan 2, 2026
37bd0ef
chore: rebuild lock [skip chromatic]
Jan 2, 2026
09d2c0d
chore: disable storybook-addon-html [skip chromatic]
Jan 2, 2026
d63de25
Merge branch 'main' into feat/storybook-10-update
khawkins98 Jan 2, 2026
eaed500
chore: remove old @storybook/blocks, now part of main stroybook bundl…
Jan 2, 2026
d1e4c8d
Merge branch 'main' into feat/storybook-10-update
Jan 4, 2026
a03b3b6
chore: fix blocks import [skip crhomatic]
Jan 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
branches: ['main'],
plugins: [
'@semantic-release/commit-analyzer',
Expand Down
11 changes: 9 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default {
},
},
'@storybook/addon-links',
'@whitespace/storybook-addon-html',
// TODO: Re-enable once https://github.com/whitespace-se/storybook-addon-html/pull/149 is merged
// '@whitespace/storybook-addon-html',
'storybook-addon-rtl',
'@storybook/addon-a11y',
'@storybook/addon-webpack5-compiler-babel',
Expand Down Expand Up @@ -128,13 +129,19 @@ export default {
options: {},
},

features: {
experimentalComponentsManifest: true,
},

docs: {
story: {
inline: false,
},
},

typescript: {
reactDocgen: 'react-docgen-typescript',
// Use react-docgen for faster builds (handles basic TS types)
// Switch to 'react-docgen-typescript' if props tables are missing or incomplete for TS components
reactDocgen: 'react-docgen',
},
};
2 changes: 1 addition & 1 deletion .storybook/presets.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = ['@storybook/addon-docs/preact/preset'];
export default ['@storybook/addon-docs/preact/preset'];
189 changes: 93 additions & 96 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,94 +8,6 @@ import themePreventionWeb from '../stories/assets/scss/style-preventionweb.scss'
import themeIRP from '../stories/assets/scss/style-irp.scss';
import themeMCR from '../stories/assets/scss/style-mcr.scss';

// Configure Storybook
export const parameters = {
actions: {
argTypes: {
onClick: { action: 'clicked' },
onChange: { action: 'changed' },
},
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
designToken: {
defaultTab: 'Colors',
disable: true,
},
html: {
prettier: {
tabWidth: 2,
useTabs: false,
removeComments: true,
htmlWhitespaceSensitivity: 'css',
printWidth: 80,
semi: true,
singleQuote: true,
trailingComma: 'es5',
},
},
docs: {
source: {
format: 'dedent',
},
},
viewport: {
viewports: INITIAL_VIEWPORTS,
},
options: {
storySort: {
method: 'alphabetical',
order: [
'Introduction',
'Getting started',
['Intro', 'How to use our design system?', 'Browser support'],
'Design decisions',
'Components',
'Utilities',
],
includeName: true,
},
},
};

/* Implementing locale for language switcher */
export const globalTypes = {
locale: {
name: 'Locale',
description: 'locale',
defaultValue: 'en',
toolbar: {
icon: 'globe',
items: [
{ value: 'english', title: 'English' },
{ value: 'arabic', title: 'Arabic' },
{ value: 'burmese', title: 'Burmese' },
{ value: 'japanese', title: 'Japanese' },
],
},
},
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'Global UNDRR Theme',
toolbar: {
icon: 'paintbrush',
items: [
{ value: 'Global UNDRR Theme', title: 'Global UNDRR Theme' },
{ value: 'PreventionWeb Theme', title: 'PreventionWeb Theme' },
{ value: 'IRP Theme', title: 'IRP Theme' },
{ value: 'MCR2030 Theme', title: 'MCR2030 Theme' },
],
showName: true,
dynamicTitle: true,
},
},
};

// Function to get current language code
const getLangCode = (Story, context) => {
let activeLang = context.initialGlobals.locale;
Expand Down Expand Up @@ -203,12 +115,97 @@ const themeDecorator = (Story, context) => {
return <Story {...context} />;
};

// Apply decorators
export const decorators = [
getLangCode,
sbFrameReset,
setDirection,
themeDecorator,
];
/** @type { import('storybook').Preview } */
const preview = {
parameters: {
actions: {
argTypes: {
onClick: { action: 'clicked' },
onChange: { action: 'changed' },
},
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
designToken: {
defaultTab: 'Colors',
disable: true,
},
html: {
prettier: {
tabWidth: 2,
useTabs: false,
removeComments: true,
htmlWhitespaceSensitivity: 'css',
printWidth: 80,
semi: true,
singleQuote: true,
trailingComma: 'es5',
},
},
docs: {
source: {
format: 'dedent',
},
},
viewport: {
viewports: INITIAL_VIEWPORTS,
},
options: {
storySort: {
method: 'alphabetical',
order: [
'Introduction',
'Getting started',
['Intro', 'How to use our design system?', 'Browser support'],
'Design decisions',
'Components',
'Utilities',
],
includeName: true,
},
},
},

globalTypes: {
locale: {
name: 'Locale',
description: 'locale',
defaultValue: 'en',
toolbar: {
icon: 'globe',
items: [
{ value: 'english', title: 'English' },
{ value: 'arabic', title: 'Arabic' },
{ value: 'burmese', title: 'Burmese' },
{ value: 'japanese', title: 'Japanese' },
],
},
},
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'Global UNDRR Theme',
toolbar: {
icon: 'paintbrush',
items: [
{ value: 'Global UNDRR Theme', title: 'Global UNDRR Theme' },
{ value: 'PreventionWeb Theme', title: 'PreventionWeb Theme' },
{ value: 'IRP Theme', title: 'IRP Theme' },
{ value: 'MCR2030 Theme', title: 'MCR2030 Theme' },
],
showName: true,
dynamicTitle: true,
},
},
},

decorators: [getLangCode, sbFrameReset, setDirection, themeDecorator],

tags: ['autodocs'],
};

export const tags = ['autodocs'];
export default preview;
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
presets: [
[
'@babel/preset-env',
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ const config = {
transformIgnorePatterns: ['node_modules/(?!core-js)'],
};

module.exports = config;
export default config;
2 changes: 1 addition & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Add any global setup for Jest tests here
require('@testing-library/jest-dom');
import '@testing-library/jest-dom';
31 changes: 15 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,21 @@
"@eslint/js": "9.39.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@storybook/addon-a11y": "9.1.16",
"@storybook/addon-a11y": "10.1.11",
"@storybook/addon-actions": "9.0.8",
"@storybook/addon-docs": "^9.1.16",
"@storybook/addon-links": "9.1.16",
"@storybook/addon-themes": "^9.1.16",
"@storybook/addon-docs": "^10.1.11",
"@storybook/addon-links": "10.1.11",
"@storybook/addon-themes": "^10.1.11",
"@storybook/addon-webpack5-compiler-babel": "4.0.0",
"@storybook/blocks": "9.0.0-alpha.17",
"@storybook/cli": "9.1.16",
"@storybook/react": "10.1.4",
"@storybook/react-webpack5": "9.1.16",
"@storybook/cli": "10.1.11",
"@storybook/react": "10.1.11",
"@storybook/react-webpack5": "10.1.11",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "16.3.1",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"@typescript-eslint/eslint-plugin": "^8.51.0",
"@typescript-eslint/parser": "^8.51.0",
"@whitespace/storybook-addon-html": "8.0.2",
"@wordpress/babel-preset-default": "8.36.0",
"@wordpress/babel-preset-default": "8.37.0",
"alter-css-url-loader": "1.1.3",
"autoprefixer": "10.4.23",
"babel-jest": "30.2.0",
Expand All @@ -102,10 +101,10 @@
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-spellcheck": "0.0.20",
"eslint-plugin-storybook": "9.1.16",
"eslint-plugin-storybook": "10.1.11",
"extract-loader": "5.1.0",
"glob": "13.0.0",
"globals": "16.5.0",
"globals": "17.0.0",
"html-entities": "2.6.0",
"jest": "30.2.0",
"jest-environment-jsdom": "30.2.0",
Expand All @@ -127,20 +126,20 @@
"sass": "1.97.1",
"sass-loader": "16.0.6",
"semantic-release": "^25.0.2",
"storybook": "9.1.17",
"storybook": "10.1.11",
"storybook-addon-rtl": "3.0.1",
"storybook-design-token": "^5.0.0",
"style-loader": "4.0.0",
"stylelint": "16.26.1",
"stylelint-config-recommended-scss": "16.0.2",
"stylelint-config-standard-scss": "16.0.0",
"stylelint-prettier": "5.0.3",
"stylelint-scss": "6.13.0",
"stylelint-scss": "6.14.0",
"svg-spritemap-webpack-plugin": "5.1.0",
"svgo": "4.0.0",
"svgo-loader": "4.0.0",
"typescript": "^5.9.3",
"webpack": "5.103.0",
"webpack": "5.104.1",
"webpack-cli": "6.0.1",
"webpack-fix-style-only-entries": "0.6.1"
},
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/BaseTypography/BaseTypography.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canvas, Meta, Story, Source, Anchor } from '@storybook/blocks';
import { Canvas, Meta, Story, Source, Anchor } from '@storybook/addon-docs/blocks';
import * as BaseTypographyStories from './BaseTypography.stories';

import { Heading } from './../Typography/Heading/Heading';
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Colors/color.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from '@storybook/blocks';
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { DesignTokenDocBlock } from 'storybook-design-token';

<Meta
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Icons/Icons.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from '@storybook/blocks';
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { Icons } from './Icons';
import data from './Icons.json';
import * as IconsStories from './Icons.stories';
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Images/AuthorImage/AuthorImages.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from '@storybook/blocks';
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { Authorimg } from './AuthorImages';
import user from '../../../assets/images/author.png';
import * as AuthorImagesStories from './AuthorImages.stories';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas, Source } from '@storybook/blocks';
import { Meta, Story, Canvas, Source } from '@storybook/addon-docs/blocks';
import { Images } from './ImageCaptionCredit';
import sample_imagelg from '../../../assets/images/sample_image-lg.jpg';
import sample_imagemd from '../../../assets/images/sample_image-md.jpg';
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Layout/Breakpoint/Breakpoint.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Source } from '@storybook/blocks';
import { Meta, Story, Source } from '@storybook/addon-docs/blocks';
import { DesignTokenDocBlock } from 'storybook-design-token';

<Meta
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Layout/Container/Container.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canvas, Meta, Story, Source } from '@storybook/blocks';
import { Canvas, Meta, Story, Source } from '@storybook/addon-docs/blocks';
import { Container } from './Container';
import * as ContainerStories from './Container.stories';

Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Layout/Grid/Grid.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canvas, Meta, Story, Source } from '@storybook/blocks';
import { Canvas, Meta, Story, Source } from '@storybook/addon-docs/blocks';
import { Grid } from './Grid';
import * as GridStories from './Grid.stories';

Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Layout/Spacing/Spacing.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from '@storybook/blocks';
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { DesignTokenDocBlock } from 'storybook-design-token';

<Meta
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Layout/Widths/Widths.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Source } from '@storybook/blocks';
import { Meta, Story, Source } from '@storybook/addon-docs/blocks';
import { DesignTokenDocBlock } from 'storybook-design-token';

<Meta
Expand Down
2 changes: 1 addition & 1 deletion stories/Atom/Logo/Logo.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas, Anchor } from '@storybook/blocks';
import { Meta, Story, Canvas, Anchor } from '@storybook/addon-docs/blocks';
import { Logo } from './Logo';
import * as LogoStories from './Logo.stories';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from '@storybook/blocks';
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { ProgressBarNavigation } from './ProgressBarNavigation';
import * as ProgressBarNavigationStories from './ProgressBarNavigation.stories';

Expand Down
Loading