Skip to content

Commit

Permalink
🔨 Load bootstrap in storybook
Browse files Browse the repository at this point in the history
Since Bootstrap is loaded in the admin too for Formio, we must include
it in storybook for an accurate preview.

Note that while a CDN is used in the admin, to facilitate local/offline
development, we're using the NPM package here.
  • Loading branch information
sergei-maertens committed Jan 1, 2025
1 parent 8e02004 commit db48bcf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'bootstrap/dist/css/bootstrap.css';
import '../src/openforms/scss/screen.scss';
import '../src/openforms/scss/admin/admin_overrides.scss';
import {withModalDecorator, withReactSelectDecorator, TinyMceDecorator} from 'components/admin/form_design/story-decorators';
Expand Down
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"autoprefixer": "^10.2.4",
"babel-loader": "^8.2.2",
"babel-plugin-formatjs": "^10.5.1",
"bootstrap": "~4.6.0",
"browserslist": "^4.21.5",
"copy-webpack-plugin": "^6.4.1",
"css-has-pseudo": "^6.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ import {StepsFieldSet} from './form-creation-form';

export default {
title: 'Form design / Tabs / Steps',
decorators: [FormDecorator, AdminChangeFormDecorator],
decorators: [
FormDecorator,
Story => (
<div className="react-form-create">
<Story />
</div>
),
AdminChangeFormDecorator,
],
component: StepsFieldSet,
args: {
submitting: false,
Expand Down

0 comments on commit db48bcf

Please sign in to comment.